Skip to content

Commit

Permalink
feat(switch): cria propriedade p-hide-label-status
Browse files Browse the repository at this point in the history
Cria propriedade `p-hide-label-status` para esconder label de status

fixes : DTHFUI-9751
  • Loading branch information
jcorrea97 authored and CSimoesJr committed Oct 18, 2024
1 parent 1ae9457 commit 929b241
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>

<po-label
*ngIf="label"
*ngIf="!hideLabelStatus"
class="po-switch-label"
[p-disabled]="disabled"
[p-label]="value === true ? labelOn : labelOff"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ export class PoSwitchComponent extends PoFieldModel<any> {
return this._formatModel;
}

/**
* @optional
*
* @description
*
* Indica se o status do `model` será escondido visualmente ao lado do switch.
*
* > Por padrão será atribuído `false`.
* @default `false`
*/
@Input({ alias: 'p-hide-label-status', transform: convertToBoolean }) hideLabelStatus: boolean = false;

/**
* @optional
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[p-label-on]="labelOn"
[p-label-position]="labelPosition"
[p-format-model]="properties.includes('formatModel')"
[p-hide-label-status]="properties.includes('hideLabelStatus')"
(p-change)="changeEvent('p-change')"
>
</po-switch>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export class SamplePoSwitchLabsComponent implements OnInit {

public readonly propertiesOptions: Array<PoCheckboxGroupOption> = [
{ value: 'disabled', label: 'Disabled' },
{ value: 'formatModel', label: 'Format Model' }
{ value: 'formatModel', label: 'Format Model' },
{ value: 'hideLabelStatus', label: 'Hide label status' }
];

ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
(keydown)="onKeyDown($event, option)"
[p-disabled]="option.disabled || disabled || isFixed(option)"
[p-value]="checkedOptions[option.value]"
p-label-off=" "
p-label-on=" "
[p-hide-label-status]="true"
>
</po-switch>
<span class="po-table-list-manager-item-text">
Expand Down

0 comments on commit 929b241

Please sign in to comment.