@po-ui/ng-components 5.15.0 → 5.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/po-ui-ng-components.umd.js +206 -162
- package/bundles/po-ui-ng-components.umd.js.map +1 -1
- package/esm2015/lib/components/po-field/po-datepicker-range/interfaces/po-datepicker-range-literals.interface.js +1 -1
- package/esm2015/lib/components/po-field/po-datepicker-range/po-datepicker-range-base.component.js +48 -6
- package/esm2015/lib/components/po-field/po-datepicker-range/po-datepicker-range.component.js +2 -2
- package/esm2015/lib/components/po-field/po-datepicker-range/po-datepicker-range.literals.js +9 -5
- package/esm2015/lib/components/po-field/po-field.model.js +75 -0
- package/esm2015/lib/components/po-field/po-lookup/po-lookup-base.component.js +11 -5
- package/esm2015/lib/components/po-field/po-lookup/po-lookup.component.js +2 -2
- package/esm2015/lib/components/po-field/po-switch/po-switch.component.js +85 -9
- package/esm2015/lib/components/po-page/po-page-header/po-page-header.component.js +2 -2
- package/esm2015/lib/components/po-stepper/po-stepper-circle/po-stepper-circle.component.js +2 -2
- package/esm2015/lib/components/po-stepper/po-stepper-step/po-stepper-step.component.js +5 -4
- package/esm2015/lib/components/po-stepper/po-stepper.component.js +2 -2
- package/esm2015/lib/components/po-table/po-table-column-label/po-table-column-label.interface.js +1 -1
- package/esm2015/po-ui-ng-components.js +2 -2
- package/fesm2015/po-ui-ng-components.js +188 -141
- package/fesm2015/po-ui-ng-components.js.map +1 -1
- package/lib/components/po-field/po-datepicker-range/interfaces/po-datepicker-range-literals.interface.d.ts +2 -0
- package/lib/components/po-field/po-datepicker-range/po-datepicker-range-base.component.d.ts +5 -3
- package/lib/components/po-field/po-field.model.d.ts +50 -0
- package/lib/components/po-field/po-lookup/po-lookup-base.component.d.ts +3 -1
- package/lib/components/po-field/po-switch/po-switch.component.d.ts +49 -3
- package/lib/components/po-stepper/po-stepper-step/po-stepper-step.component.d.ts +1 -0
- package/lib/components/po-table/po-table-column-label/po-table-column-label.interface.d.ts +1 -1
- package/package.json +4 -4
- package/po-ui-ng-components-5.16.0.tgz +0 -0
- package/po-ui-ng-components.d.ts +1 -1
- package/po-ui-ng-components.metadata.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-update/v2/index.js +1 -1
- package/schematics/ng-update/v3/index.js +1 -1
- package/schematics/ng-update/v4/index.js +1 -1
- package/schematics/ng-update/v5/index.js +1 -1
- package/esm2015/lib/components/po-field/po-switch/po-switch-base.component.js +0 -158
- package/lib/components/po-field/po-switch/po-switch-base.component.d.ts +0 -100
- package/po-ui-ng-components-5.15.0.tgz +0 -0
|
@@ -16967,19 +16967,23 @@
|
|
|
16967
16967
|
var poDatepickerRangeLiteralsDefault = {
|
|
16968
16968
|
en: {
|
|
16969
16969
|
invalidFormat: 'Date in invalid format',
|
|
16970
|
-
startDateGreaterThanEndDate: 'Start date greater than end date'
|
|
16970
|
+
startDateGreaterThanEndDate: 'Start date greater than end date',
|
|
16971
|
+
invalidDate: 'Invalid date'
|
|
16971
16972
|
},
|
|
16972
16973
|
es: {
|
|
16973
16974
|
invalidFormat: 'Fecha en formato no válido',
|
|
16974
|
-
startDateGreaterThanEndDate: 'Fecha de inicio mayor que fecha final'
|
|
16975
|
+
startDateGreaterThanEndDate: 'Fecha de inicio mayor que fecha final',
|
|
16976
|
+
invalidDate: 'Fecha invalida'
|
|
16975
16977
|
},
|
|
16976
16978
|
pt: {
|
|
16977
16979
|
invalidFormat: 'Data no formato inválido',
|
|
16978
|
-
startDateGreaterThanEndDate: 'Data inicial maior que data final'
|
|
16980
|
+
startDateGreaterThanEndDate: 'Data inicial maior que data final',
|
|
16981
|
+
invalidDate: 'Data inválida'
|
|
16979
16982
|
},
|
|
16980
16983
|
ru: {
|
|
16981
16984
|
invalidFormat: 'Дата в неверном формате',
|
|
16982
|
-
startDateGreaterThanEndDate: 'Дата начала больше даты окончания'
|
|
16985
|
+
startDateGreaterThanEndDate: 'Дата начала больше даты окончания',
|
|
16986
|
+
invalidDate: 'Недействительная дата'
|
|
16983
16987
|
}
|
|
16984
16988
|
};
|
|
16985
16989
|
|
|
@@ -17283,6 +17287,14 @@
|
|
|
17283
17287
|
}
|
|
17284
17288
|
};
|
|
17285
17289
|
}
|
|
17290
|
+
if (!this.verifyValidDate(startDate, endDate)) {
|
|
17291
|
+
this.errorMessage = this.literals.invalidDate;
|
|
17292
|
+
return {
|
|
17293
|
+
date: {
|
|
17294
|
+
valid: false
|
|
17295
|
+
}
|
|
17296
|
+
};
|
|
17297
|
+
}
|
|
17286
17298
|
if (this.dateRangeObjectFailed(control.value) || this.dateRangeFormatFailed(startDate, endDate)) {
|
|
17287
17299
|
this.errorMessage = this.literals.invalidFormat;
|
|
17288
17300
|
return {
|
|
@@ -17338,6 +17350,17 @@
|
|
|
17338
17350
|
this.validatorChange(model);
|
|
17339
17351
|
}
|
|
17340
17352
|
};
|
|
17353
|
+
PoDatepickerRangeBaseComponent.prototype.verifyValidDate = function (startDate, endDate) {
|
|
17354
|
+
if (startDate !== '' && endDate !== '') {
|
|
17355
|
+
return this.dateIsValid(startDate) && this.dateIsValid(endDate);
|
|
17356
|
+
}
|
|
17357
|
+
else if (startDate !== '') {
|
|
17358
|
+
return this.dateIsValid(startDate);
|
|
17359
|
+
}
|
|
17360
|
+
else {
|
|
17361
|
+
return this.dateIsValid(endDate);
|
|
17362
|
+
}
|
|
17363
|
+
};
|
|
17341
17364
|
PoDatepickerRangeBaseComponent.prototype.convertPatternDateFormat = function (value) {
|
|
17342
17365
|
if (value instanceof Date) {
|
|
17343
17366
|
return this.poDateService.convertDateToISO(value);
|
|
@@ -17361,6 +17384,29 @@
|
|
|
17361
17384
|
requiredFailed(this.required, this.disabled, startDate) &&
|
|
17362
17385
|
requiredFailed(this.required, this.disabled, endDate));
|
|
17363
17386
|
};
|
|
17387
|
+
PoDatepickerRangeBaseComponent.prototype.dateIsValid = function (date) {
|
|
17388
|
+
var _a = __read(date.split('-'), 3), strYear = _a[0], strMonth = _a[1], strDay = _a[2];
|
|
17389
|
+
var year = Number(strYear);
|
|
17390
|
+
var month = Number(strMonth);
|
|
17391
|
+
var day = Number(strDay);
|
|
17392
|
+
//verificação dos meses com 31 dias
|
|
17393
|
+
if (month === 1 || month === 3 || month === 5 || month === 7 || month === 8 || month === 10 || month === 12) {
|
|
17394
|
+
return day < 1 || day > 31 ? false : true;
|
|
17395
|
+
}
|
|
17396
|
+
else if (month === 4 || month === 6 || month === 9 || month === 11) {
|
|
17397
|
+
//verificação dos meses com 30 dias
|
|
17398
|
+
return day < 1 || day > 30 ? false : true;
|
|
17399
|
+
}
|
|
17400
|
+
else {
|
|
17401
|
+
//verificacao de ano bissexto para verificar até qual dia irá o mês de fevereiro
|
|
17402
|
+
if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {
|
|
17403
|
+
return day < 1 || day > 29 ? false : true;
|
|
17404
|
+
}
|
|
17405
|
+
else {
|
|
17406
|
+
return day < 1 || day > 28 ? false : true;
|
|
17407
|
+
}
|
|
17408
|
+
}
|
|
17409
|
+
};
|
|
17364
17410
|
return PoDatepickerRangeBaseComponent;
|
|
17365
17411
|
}());
|
|
17366
17412
|
PoDatepickerRangeBaseComponent.decorators = [
|
|
@@ -17678,7 +17724,7 @@
|
|
|
17678
17724
|
PoDatepickerRangeComponent.prototype.getDateRangeFormatValidation = function (startDate, endDate, isStartDateTargetEvent) {
|
|
17679
17725
|
this.setDateRangeInputValidation(startDate, endDate);
|
|
17680
17726
|
return {
|
|
17681
|
-
isValid: this.isDateRangeInputFormatValid && this.isStartDateRangeInputValid,
|
|
17727
|
+
isValid: this.isDateRangeInputFormatValid && this.isStartDateRangeInputValid && this.verifyValidDate(startDate, endDate),
|
|
17682
17728
|
dateRangeModel: this.getValidatedModel(startDate, endDate, isStartDateTargetEvent)
|
|
17683
17729
|
};
|
|
17684
17730
|
};
|
|
@@ -19330,6 +19376,8 @@
|
|
|
19330
19376
|
* @default `false`
|
|
19331
19377
|
*/
|
|
19332
19378
|
this.infiniteScroll = false;
|
|
19379
|
+
/** Exibe um ícone que permite limpar o campo. */
|
|
19380
|
+
this.clean = false;
|
|
19333
19381
|
/**
|
|
19334
19382
|
* Evento será disparado quando ocorrer algum erro na requisição de busca do item.
|
|
19335
19383
|
* Será passado por parâmetro o objeto de erro retornado.
|
|
@@ -19505,6 +19553,10 @@
|
|
|
19505
19553
|
PoLookupBaseComponent.prototype.ngAfterViewInit = function () {
|
|
19506
19554
|
this.setControl();
|
|
19507
19555
|
};
|
|
19556
|
+
PoLookupBaseComponent.prototype.cleanModel = function () {
|
|
19557
|
+
this.cleanViewValue();
|
|
19558
|
+
this.callOnChange(undefined);
|
|
19559
|
+
};
|
|
19508
19560
|
// Função implementada do ControlValueAccessor
|
|
19509
19561
|
// Usada para interceptar os estados de habilitado via forms api
|
|
19510
19562
|
PoLookupBaseComponent.prototype.setDisabledState = function (isDisabled) {
|
|
@@ -19605,10 +19657,6 @@
|
|
|
19605
19657
|
this.cleanViewValue();
|
|
19606
19658
|
}
|
|
19607
19659
|
};
|
|
19608
|
-
PoLookupBaseComponent.prototype.cleanModel = function () {
|
|
19609
|
-
this.cleanViewValue();
|
|
19610
|
-
this.callOnChange(undefined);
|
|
19611
|
-
};
|
|
19612
19660
|
PoLookupBaseComponent.prototype.cleanViewValue = function () {
|
|
19613
19661
|
this.setViewValue('', {});
|
|
19614
19662
|
this.oldValue = '';
|
|
@@ -19678,6 +19726,7 @@
|
|
|
19678
19726
|
optional: [{ type: i0.Input, args: ['p-optional',] }],
|
|
19679
19727
|
advancedFilters: [{ type: i0.Input, args: ['p-advanced-filters',] }],
|
|
19680
19728
|
infiniteScroll: [{ type: i0.Input, args: ['p-infinite-scroll',] }],
|
|
19729
|
+
clean: [{ type: i0.Input, args: ['p-clean',] }],
|
|
19681
19730
|
onError: [{ type: i0.Output, args: ['p-error',] }],
|
|
19682
19731
|
selected: [{ type: i0.Output, args: ['p-selected',] }],
|
|
19683
19732
|
change: [{ type: i0.Output, args: ['p-change',] }],
|
|
@@ -19692,6 +19741,9 @@
|
|
|
19692
19741
|
__decorate([
|
|
19693
19742
|
InputBoolean()
|
|
19694
19743
|
], PoLookupBaseComponent.prototype, "infiniteScroll", void 0);
|
|
19744
|
+
__decorate([
|
|
19745
|
+
InputBoolean()
|
|
19746
|
+
], PoLookupBaseComponent.prototype, "clean", void 0);
|
|
19695
19747
|
|
|
19696
19748
|
/**
|
|
19697
19749
|
*
|
|
@@ -20756,7 +20808,7 @@
|
|
|
20756
20808
|
PoLookupComponent.decorators = [
|
|
20757
20809
|
{ type: i0.Component, args: [{
|
|
20758
20810
|
selector: 'po-lookup',
|
|
20759
|
-
template: "<po-field-container [p-label]=\"label\" [p-help]=\"help\" [p-optional]=\"!required && optional\">\n <div class=\"po-field-container-content\">\n <input\n #inp\n class=\"po-input
|
|
20811
|
+
template: "<po-field-container [p-label]=\"label\" [p-help]=\"help\" [p-optional]=\"!required && optional\">\n <div class=\"po-field-container-content\">\n <input\n #inp\n class=\"po-input\"\n type=\"text\"\n [ngClass]=\"clean && inp.value ? 'po-input-double-icon-right' : 'po-input-icon-right'\"\n [autocomplete]=\"autocomplete\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n (blur)=\"searchEvent()\"\n />\n\n <div class=\"po-field-icon-container-right\">\n <po-clean *ngIf=\"clean && !disabled\" [p-element-ref]=\"inputEl\" (p-change-event)=\"cleanModel()\"> </po-clean>\n\n <span\n #iconLookup\n class=\"po-icon po-field-icon po-icon-search\"\n tabindex=\"-1\"\n [class.po-field-icon]=\"!disabled\"\n [class.po-field-icon-disabled]=\"disabled\"\n (click)=\"openLookup()\"\n (focus)=\"inp.focus()\"\n >\n </span>\n </div>\n </div>\n\n <po-field-container-bottom></po-field-container-bottom>\n</po-field-container>\n",
|
|
20760
20812
|
providers: providers$2
|
|
20761
20813
|
},] }
|
|
20762
20814
|
];
|
|
@@ -24513,37 +24565,8 @@
|
|
|
24513
24565
|
onKeydown: [{ type: i0.HostListener, args: ['keydown', ['$event'],] }]
|
|
24514
24566
|
};
|
|
24515
24567
|
|
|
24516
|
-
/**
|
|
24517
|
-
|
|
24518
|
-
*
|
|
24519
|
-
* @description
|
|
24520
|
-
*
|
|
24521
|
-
* Enum para posicionar o label do valor do po-switch.
|
|
24522
|
-
*/
|
|
24523
|
-
exports.PoSwitchLabelPosition = void 0;
|
|
24524
|
-
(function (PoSwitchLabelPosition) {
|
|
24525
|
-
/** Posiciona o label do lado esquerdo do switch. */
|
|
24526
|
-
PoSwitchLabelPosition[PoSwitchLabelPosition["Right"] = 0] = "Right";
|
|
24527
|
-
/** Posiciona o label do lado direito do switch. */
|
|
24528
|
-
PoSwitchLabelPosition[PoSwitchLabelPosition["Left"] = 1] = "Left";
|
|
24529
|
-
})(exports.PoSwitchLabelPosition || (exports.PoSwitchLabelPosition = {}));
|
|
24530
|
-
|
|
24531
|
-
/**
|
|
24532
|
-
* @description
|
|
24533
|
-
*
|
|
24534
|
-
* O componente `po-switch` é um [checkbox](/documentation/po-checkbox-group) mais intuitivo, pois faz analogia a um interruptor.
|
|
24535
|
-
* Deve ser usado quando deseja-se transmitir a ideia de ligar / desligar uma funcionalidade específica.
|
|
24536
|
-
*
|
|
24537
|
-
* Pode-se ligar ou deligar o botão utilizando a tecla de espaço ou o clique do mouse.
|
|
24538
|
-
*
|
|
24539
|
-
* O texto exibido pode ser alterado de acordo com o valor setado aumentando as possibilidades de uso do componente,
|
|
24540
|
-
* portanto, recomenda-se informar textos que contextualizem seu uso para que facilite a compreensão do usuário.
|
|
24541
|
-
*
|
|
24542
|
-
* > O componente não altera o valor incial informado no *model*, portanto indica-se inicializa-lo caso ter necessidade.
|
|
24543
|
-
*/
|
|
24544
|
-
var PoSwitchBaseComponent = /** @class */ (function () {
|
|
24545
|
-
function PoSwitchBaseComponent(changeDetector) {
|
|
24546
|
-
this.changeDetector = changeDetector;
|
|
24568
|
+
var PoFieldModel = /** @class */ (function () {
|
|
24569
|
+
function PoFieldModel() {
|
|
24547
24570
|
/**
|
|
24548
24571
|
* @optional
|
|
24549
24572
|
*
|
|
@@ -24561,145 +24584,89 @@
|
|
|
24561
24584
|
*
|
|
24562
24585
|
* @description
|
|
24563
24586
|
*
|
|
24564
|
-
*
|
|
24565
|
-
*/
|
|
24566
|
-
this.change = new i0.EventEmitter();
|
|
24567
|
-
/**
|
|
24568
|
-
* @optional
|
|
24569
|
-
*
|
|
24570
|
-
* @description
|
|
24571
|
-
*
|
|
24572
|
-
* Função para atualizar o ngModel do componente, necessário quando não for utilizado dentro da tag form.
|
|
24573
|
-
*/
|
|
24574
|
-
this.ngModelChange = new i0.EventEmitter();
|
|
24575
|
-
this.switchValue = false;
|
|
24576
|
-
this._disabled = false;
|
|
24577
|
-
/**
|
|
24578
|
-
* Texto exibido quando o valor do componente for `true`.
|
|
24579
|
-
*
|
|
24580
|
-
* @default `true`
|
|
24581
|
-
*/
|
|
24582
|
-
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
24583
|
-
this.labelOn = 'true';
|
|
24584
|
-
/**
|
|
24585
|
-
* Texto exibido quando o valor do componente for `false`.
|
|
24587
|
+
* Indica se o campo será desabilitado.
|
|
24586
24588
|
*
|
|
24587
24589
|
* @default `false`
|
|
24588
24590
|
*/
|
|
24589
|
-
|
|
24590
|
-
this.labelOff = 'false';
|
|
24591
|
+
this.disabled = false;
|
|
24591
24592
|
/**
|
|
24592
24593
|
* @optional
|
|
24593
24594
|
*
|
|
24594
24595
|
* @description
|
|
24595
24596
|
*
|
|
24596
|
-
*
|
|
24597
|
-
*
|
|
24598
|
-
* > Por padrão exibe à direita.
|
|
24597
|
+
* Evento disparado ao alterar valor do campo.
|
|
24599
24598
|
*/
|
|
24600
|
-
|
|
24601
|
-
this.labelPosition = exports.PoSwitchLabelPosition.Right;
|
|
24599
|
+
this.change = new i0.EventEmitter();
|
|
24602
24600
|
}
|
|
24603
|
-
Object.defineProperty(PoSwitchBaseComponent.prototype, "setLabelOn", {
|
|
24604
|
-
set: function (label) {
|
|
24605
|
-
this.labelOn = label || 'true';
|
|
24606
|
-
},
|
|
24607
|
-
enumerable: false,
|
|
24608
|
-
configurable: true
|
|
24609
|
-
});
|
|
24610
|
-
Object.defineProperty(PoSwitchBaseComponent.prototype, "setLabelOff", {
|
|
24611
|
-
set: function (label) {
|
|
24612
|
-
this.labelOff = label || 'false';
|
|
24613
|
-
},
|
|
24614
|
-
enumerable: false,
|
|
24615
|
-
configurable: true
|
|
24616
|
-
});
|
|
24617
|
-
Object.defineProperty(PoSwitchBaseComponent.prototype, "setLabelPosition", {
|
|
24618
|
-
set: function (position) {
|
|
24619
|
-
this.labelPosition = position in exports.PoSwitchLabelPosition ? parseInt(position, 10) : exports.PoSwitchLabelPosition.Right;
|
|
24620
|
-
},
|
|
24621
|
-
enumerable: false,
|
|
24622
|
-
configurable: true
|
|
24623
|
-
});
|
|
24624
|
-
Object.defineProperty(PoSwitchBaseComponent.prototype, "disabled", {
|
|
24625
|
-
get: function () {
|
|
24626
|
-
return this._disabled;
|
|
24627
|
-
},
|
|
24628
|
-
/**
|
|
24629
|
-
* @optional
|
|
24630
|
-
*
|
|
24631
|
-
* @description
|
|
24632
|
-
*
|
|
24633
|
-
* Indica se o campo será desabilitado.
|
|
24634
|
-
*
|
|
24635
|
-
* @default `false`
|
|
24636
|
-
*/
|
|
24637
|
-
set: function (disabled) {
|
|
24638
|
-
this._disabled = convertToBoolean(disabled);
|
|
24639
|
-
},
|
|
24640
|
-
enumerable: false,
|
|
24641
|
-
configurable: true
|
|
24642
|
-
});
|
|
24643
|
-
PoSwitchBaseComponent.prototype.changeValue = function (value) {
|
|
24644
|
-
if (this.switchValue !== value) {
|
|
24645
|
-
this.switchValue = value;
|
|
24646
|
-
if (this.propagateChange) {
|
|
24647
|
-
this.propagateChange(value);
|
|
24648
|
-
}
|
|
24649
|
-
else {
|
|
24650
|
-
this.ngModelChange.emit(value);
|
|
24651
|
-
}
|
|
24652
|
-
this.change.emit(this.switchValue);
|
|
24653
|
-
}
|
|
24654
|
-
};
|
|
24655
|
-
PoSwitchBaseComponent.prototype.eventClick = function () {
|
|
24656
|
-
if (!this.disabled) {
|
|
24657
|
-
this.changeValue(!this.switchValue);
|
|
24658
|
-
}
|
|
24659
|
-
};
|
|
24660
24601
|
// Função implementada do ControlValueAccessor
|
|
24661
24602
|
// Usada para interceptar os estados de habilitado via forms api
|
|
24662
|
-
|
|
24603
|
+
PoFieldModel.prototype.setDisabledState = function (isDisabled) {
|
|
24663
24604
|
this.disabled = isDisabled;
|
|
24664
24605
|
};
|
|
24665
|
-
|
|
24606
|
+
PoFieldModel.prototype.registerOnChange = function (fn) {
|
|
24666
24607
|
this.propagateChange = fn;
|
|
24667
24608
|
};
|
|
24668
|
-
|
|
24609
|
+
PoFieldModel.prototype.registerOnTouched = function (fn) {
|
|
24669
24610
|
this.onTouched = fn;
|
|
24670
24611
|
};
|
|
24671
|
-
|
|
24672
|
-
|
|
24673
|
-
|
|
24674
|
-
|
|
24612
|
+
PoFieldModel.prototype.writeValue = function (value) {
|
|
24613
|
+
this.onWriteValue(value);
|
|
24614
|
+
};
|
|
24615
|
+
PoFieldModel.prototype.updateModel = function (value) {
|
|
24616
|
+
if (this.propagateChange) {
|
|
24617
|
+
this.propagateChange(value);
|
|
24675
24618
|
}
|
|
24676
24619
|
};
|
|
24677
|
-
return
|
|
24620
|
+
return PoFieldModel;
|
|
24678
24621
|
}());
|
|
24679
|
-
|
|
24622
|
+
PoFieldModel.decorators = [
|
|
24680
24623
|
{ type: i0.Directive }
|
|
24681
24624
|
];
|
|
24682
|
-
|
|
24683
|
-
|
|
24684
|
-
]; };
|
|
24685
|
-
PoSwitchBaseComponent.propDecorators = {
|
|
24686
|
-
name: [{ type: i0.Input, args: ['name',] }],
|
|
24687
|
-
autoFocus: [{ type: i0.Input, args: ['p-auto-focus',] }],
|
|
24625
|
+
PoFieldModel.ctorParameters = function () { return []; };
|
|
24626
|
+
PoFieldModel.propDecorators = {
|
|
24688
24627
|
label: [{ type: i0.Input, args: ['p-label',] }],
|
|
24628
|
+
name: [{ type: i0.Input, args: ['name',] }],
|
|
24689
24629
|
help: [{ type: i0.Input, args: ['p-help',] }],
|
|
24690
|
-
|
|
24691
|
-
|
|
24692
|
-
|
|
24693
|
-
setLabelOff: [{ type: i0.Input, args: ['p-label-off',] }],
|
|
24694
|
-
setLabelPosition: [{ type: i0.Input, args: ['p-label-position',] }],
|
|
24695
|
-
disabled: [{ type: i0.Input, args: ['p-disabled',] }]
|
|
24630
|
+
autoFocus: [{ type: i0.Input, args: ['p-auto-focus',] }],
|
|
24631
|
+
disabled: [{ type: i0.Input, args: ['p-disabled',] }],
|
|
24632
|
+
change: [{ type: i0.Output, args: ['p-change',] }]
|
|
24696
24633
|
};
|
|
24697
24634
|
__decorate([
|
|
24698
24635
|
InputBoolean()
|
|
24699
|
-
],
|
|
24636
|
+
], PoFieldModel.prototype, "autoFocus", void 0);
|
|
24637
|
+
__decorate([
|
|
24638
|
+
InputBoolean()
|
|
24639
|
+
], PoFieldModel.prototype, "disabled", void 0);
|
|
24640
|
+
|
|
24641
|
+
/**
|
|
24642
|
+
* @usedBy PoSwitchComponent
|
|
24643
|
+
*
|
|
24644
|
+
* @description
|
|
24645
|
+
*
|
|
24646
|
+
* Enum para posicionar o label do valor do po-switch.
|
|
24647
|
+
*/
|
|
24648
|
+
exports.PoSwitchLabelPosition = void 0;
|
|
24649
|
+
(function (PoSwitchLabelPosition) {
|
|
24650
|
+
/** Posiciona o label do lado esquerdo do switch. */
|
|
24651
|
+
PoSwitchLabelPosition[PoSwitchLabelPosition["Right"] = 0] = "Right";
|
|
24652
|
+
/** Posiciona o label do lado direito do switch. */
|
|
24653
|
+
PoSwitchLabelPosition[PoSwitchLabelPosition["Left"] = 1] = "Left";
|
|
24654
|
+
})(exports.PoSwitchLabelPosition || (exports.PoSwitchLabelPosition = {}));
|
|
24700
24655
|
|
|
24701
24656
|
/**
|
|
24702
|
-
* @docsExtends
|
|
24657
|
+
* @docsExtends PoFieldModel
|
|
24658
|
+
*
|
|
24659
|
+
* @description
|
|
24660
|
+
*
|
|
24661
|
+
* O componente `po-switch` é um [checkbox](/documentation/po-checkbox-group) mais intuitivo, pois faz analogia a um interruptor.
|
|
24662
|
+
* Deve ser usado quando deseja-se transmitir a ideia de ligar / desligar uma funcionalidade específica.
|
|
24663
|
+
*
|
|
24664
|
+
* Pode-se ligar ou deligar o botão utilizando a tecla de espaço ou o clique do mouse.
|
|
24665
|
+
*
|
|
24666
|
+
* O texto exibido pode ser alterado de acordo com o valor setado aumentando as possibilidades de uso do componente,
|
|
24667
|
+
* portanto, recomenda-se informar textos que contextualizem seu uso para que facilite a compreensão do usuário.
|
|
24668
|
+
*
|
|
24669
|
+
* > O componente não altera o valor incial informado no *model*, portanto indica-se inicializa-lo caso ter necessidade.
|
|
24703
24670
|
*
|
|
24704
24671
|
* @example
|
|
24705
24672
|
*
|
|
@@ -24728,8 +24695,63 @@
|
|
|
24728
24695
|
var PoSwitchComponent = /** @class */ (function (_super) {
|
|
24729
24696
|
__extends(PoSwitchComponent, _super);
|
|
24730
24697
|
function PoSwitchComponent(changeDetector) {
|
|
24731
|
-
|
|
24698
|
+
var _this = _super.call(this) || this;
|
|
24699
|
+
_this.changeDetector = changeDetector;
|
|
24700
|
+
_this.value = false;
|
|
24701
|
+
_this._labelOff = 'false';
|
|
24702
|
+
_this._labelOn = 'true';
|
|
24703
|
+
_this._labelPosition = exports.PoSwitchLabelPosition.Right;
|
|
24704
|
+
return _this;
|
|
24732
24705
|
}
|
|
24706
|
+
Object.defineProperty(PoSwitchComponent.prototype, "labelPosition", {
|
|
24707
|
+
get: function () {
|
|
24708
|
+
return this._labelPosition;
|
|
24709
|
+
},
|
|
24710
|
+
/**
|
|
24711
|
+
* @optional
|
|
24712
|
+
*
|
|
24713
|
+
* @description
|
|
24714
|
+
*
|
|
24715
|
+
* Posição de exibição do rótulo.
|
|
24716
|
+
*
|
|
24717
|
+
* > Por padrão exibe à direita.
|
|
24718
|
+
*/
|
|
24719
|
+
set: function (position) {
|
|
24720
|
+
this._labelPosition = position in exports.PoSwitchLabelPosition ? parseInt(position, 10) : exports.PoSwitchLabelPosition.Right;
|
|
24721
|
+
},
|
|
24722
|
+
enumerable: false,
|
|
24723
|
+
configurable: true
|
|
24724
|
+
});
|
|
24725
|
+
Object.defineProperty(PoSwitchComponent.prototype, "labelOff", {
|
|
24726
|
+
get: function () {
|
|
24727
|
+
return this._labelOff;
|
|
24728
|
+
},
|
|
24729
|
+
/**
|
|
24730
|
+
* Texto exibido quando o valor do componente for `false`.
|
|
24731
|
+
*
|
|
24732
|
+
* @default `false`
|
|
24733
|
+
*/
|
|
24734
|
+
set: function (label) {
|
|
24735
|
+
this._labelOff = label || 'false';
|
|
24736
|
+
},
|
|
24737
|
+
enumerable: false,
|
|
24738
|
+
configurable: true
|
|
24739
|
+
});
|
|
24740
|
+
Object.defineProperty(PoSwitchComponent.prototype, "labelOn", {
|
|
24741
|
+
get: function () {
|
|
24742
|
+
return this._labelOn;
|
|
24743
|
+
},
|
|
24744
|
+
/**
|
|
24745
|
+
* Texto exibido quando o valor do componente for `true`.
|
|
24746
|
+
*
|
|
24747
|
+
* @default `true`
|
|
24748
|
+
*/
|
|
24749
|
+
set: function (label) {
|
|
24750
|
+
this._labelOn = label || 'true';
|
|
24751
|
+
},
|
|
24752
|
+
enumerable: false,
|
|
24753
|
+
configurable: true
|
|
24754
|
+
});
|
|
24733
24755
|
PoSwitchComponent.prototype.ngAfterViewInit = function () {
|
|
24734
24756
|
if (this.autoFocus) {
|
|
24735
24757
|
this.focus();
|
|
@@ -24782,17 +24804,35 @@
|
|
|
24782
24804
|
}
|
|
24783
24805
|
};
|
|
24784
24806
|
PoSwitchComponent.prototype.onKeyDown = function (event) {
|
|
24785
|
-
if (event.which ===
|
|
24807
|
+
if (event.which === PoKeyCodeEnum.space || event.keyCode === PoKeyCodeEnum.space) {
|
|
24786
24808
|
event.preventDefault();
|
|
24787
24809
|
this.eventClick();
|
|
24788
24810
|
}
|
|
24789
24811
|
};
|
|
24812
|
+
PoSwitchComponent.prototype.changeValue = function (value) {
|
|
24813
|
+
if (this.value !== value) {
|
|
24814
|
+
this.value = value;
|
|
24815
|
+
this.updateModel(value);
|
|
24816
|
+
this.change.emit(this.value);
|
|
24817
|
+
}
|
|
24818
|
+
};
|
|
24819
|
+
PoSwitchComponent.prototype.eventClick = function () {
|
|
24820
|
+
if (!this.disabled) {
|
|
24821
|
+
this.changeValue(!this.value);
|
|
24822
|
+
}
|
|
24823
|
+
};
|
|
24824
|
+
PoSwitchComponent.prototype.onWriteValue = function (value) {
|
|
24825
|
+
if (value !== this.value) {
|
|
24826
|
+
this.value = !!value;
|
|
24827
|
+
this.changeDetector.markForCheck();
|
|
24828
|
+
}
|
|
24829
|
+
};
|
|
24790
24830
|
return PoSwitchComponent;
|
|
24791
|
-
}(
|
|
24831
|
+
}(PoFieldModel));
|
|
24792
24832
|
PoSwitchComponent.decorators = [
|
|
24793
24833
|
{ type: i0.Component, args: [{
|
|
24794
24834
|
selector: 'po-switch',
|
|
24795
|
-
template: "<po-field-container [p-label]=\"label\" [p-help]=\"help\">\n <div class=\"po-field-container-content po-switch-content\" [attr.name]=\"name\">\n <div\n class=\"po-switch-container po-clickable\"\n #switchContainer\n [class.po-switch-container-disabled]=\"disabled\"\n [class.po-switch-container-off]=\"
|
|
24835
|
+
template: "<po-field-container [p-label]=\"label\" [p-help]=\"help\">\n <div class=\"po-field-container-content po-switch-content\" [attr.name]=\"name\">\n <div\n class=\"po-switch-container po-clickable\"\n #switchContainer\n [class.po-switch-container-disabled]=\"disabled\"\n [class.po-switch-container-off]=\"value === false && !disabled\"\n [class.po-switch-container-on]=\"value === true && !disabled\"\n [class.po-switch-container-right]=\"getSwitchPosition() === 'right'\"\n [tabindex]=\"disabled ? -1 : 0\"\n (click)=\"eventClick()\"\n (keydown)=\"onKeyDown($event)\"\n (blur)=\"onBlur()\"\n >\n <div\n class=\"po-switch-button\"\n [class.po-switch-button-on]=\"value === true\"\n [class.po-switch-button-off]=\"value === false\"\n [class.po-switch-button-disabled]=\"disabled\"\n >\n <span class=\"po-icon po-icon-{{ value === true ? 'ok' : 'close' }}\"></span>\n </div>\n </div>\n\n <span class=\"po-switch-label po-clickable po-switch-label-{{ getLabelPosition() }}\" (click)=\"eventClick()\">\n {{ value === true ? labelOn : labelOff }}\n </span>\n </div>\n\n <po-field-container-bottom></po-field-container-bottom>\n</po-field-container>\n",
|
|
24796
24836
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
24797
24837
|
providers: [
|
|
24798
24838
|
{
|
|
@@ -24807,7 +24847,10 @@
|
|
|
24807
24847
|
{ type: i0.ChangeDetectorRef }
|
|
24808
24848
|
]; };
|
|
24809
24849
|
PoSwitchComponent.propDecorators = {
|
|
24810
|
-
switchContainer: [{ type: i0.ViewChild, args: ['switchContainer', { static: true },] }]
|
|
24850
|
+
switchContainer: [{ type: i0.ViewChild, args: ['switchContainer', { static: true },] }],
|
|
24851
|
+
labelPosition: [{ type: i0.Input, args: ['p-label-position',] }],
|
|
24852
|
+
labelOff: [{ type: i0.Input, args: ['p-label-off',] }],
|
|
24853
|
+
labelOn: [{ type: i0.Input, args: ['p-label-on',] }]
|
|
24811
24854
|
};
|
|
24812
24855
|
|
|
24813
24856
|
/**
|
|
@@ -33456,7 +33499,7 @@
|
|
|
33456
33499
|
PoPageHeaderComponent.decorators = [
|
|
33457
33500
|
{ type: i0.Component, args: [{
|
|
33458
33501
|
selector: 'po-page-header',
|
|
33459
|
-
template: "<div class=\"po-page-header\">\n <!-- Breadcrumb -->\n <div class=\"po-page-header-breadcrumb\" *ngIf=\"breadcrumb && breadcrumb.items.length\">\n <po-breadcrumb\n [p-favorite-service]=\"breadcrumb.favorite\"\n [p-items]=\"breadcrumb.items\"\n [p-params-service]=\"breadcrumb.params\"\n >\n </po-breadcrumb>\n </div>\n\n <!-- Titulo -->\n
|
|
33502
|
+
template: "<div class=\"po-page-header\">\n <!-- Breadcrumb -->\n <div class=\"po-page-header-breadcrumb\" *ngIf=\"breadcrumb && breadcrumb.items.length\">\n <po-breadcrumb\n [p-favorite-service]=\"breadcrumb.favorite\"\n [p-items]=\"breadcrumb.items\"\n [p-params-service]=\"breadcrumb.params\"\n >\n </po-breadcrumb>\n </div>\n\n <div class=\"po-pt-1\">\n <!-- Titulo -->\n <h1 class=\"po-page-header-title\" *ngIf=\"title\">\n {{ title }}\n </h1>\n\n <!-- Opera\u00E7\u00F5es -->\n <ng-content></ng-content>\n </div>\n</div>\n"
|
|
33460
33503
|
},] }
|
|
33461
33504
|
];
|
|
33462
33505
|
|
|
@@ -34896,7 +34939,7 @@
|
|
|
34896
34939
|
PoStepperCircleComponent.decorators = [
|
|
34897
34940
|
{ type: i0.Component, args: [{
|
|
34898
34941
|
selector: 'po-stepper-circle',
|
|
34899
|
-
template: "<div
|
|
34942
|
+
template: "<div class=\"po-stepper-circle\" [style.height.px]=\"size\" [style.width.px]=\"size\" [tabindex]=\"isDisabled ? -1 : 0\">\n <span\n *ngIf=\"!isActive\"\n class=\"po-stepper-circle-content\"\n [class.po-icon]=\"icons || isDone\"\n [class.po-icon-exclamation]=\"icons && isError\"\n [class.po-icon-info]=\"icons && (isActive || isDefault || isDisabled)\"\n [class.po-icon-ok]=\"isDone\"\n [class.po-stepper-circle-content-lg]=\"isLargeStep\"\n [class.po-stepper-circle-content-md]=\"isMediumStep\"\n >\n {{ !icons && !isDone ? content : '' }}\n </span>\n\n <div *ngIf=\"isActive || isError\" class=\"po-stepper-circle-active\"></div>\n</div>\n"
|
|
34900
34943
|
},] }
|
|
34901
34944
|
];
|
|
34902
34945
|
PoStepperCircleComponent.propDecorators = {
|
|
@@ -35304,7 +35347,7 @@
|
|
|
35304
35347
|
PoStepperComponent.decorators = [
|
|
35305
35348
|
{ type: i0.Component, args: [{
|
|
35306
35349
|
selector: 'po-stepper',
|
|
35307
|
-
template: "<div class=\"po-stepper po-stepper-{{ orientation }}\">\n <div class=\"po-stepper-container\">\n <po-stepper-step\n *ngFor=\"let step of stepList; let index = index; trackBy: trackByFn\"\n class=\"po-stepper-step-position\"\n [p-circle-content]=\"index + 1\"\n [p-label]=\"step.label\"\n [p-orientation]=\"orientation\"\n [p-status]=\"step.status\"\n [p-step-icons]=\"stepIcons\"\n [p-step-size]=\"stepSize\"\n (p-activated)=\"onStepActive(step)\"\n (p-click)=\"changeStep(index, step)\"\n (p-enter)=\"changeStep(index, step)\"\n >\n </po-stepper-step>\n </div>\n\n <div *ngIf=\"usePoSteps\" class=\"po-stepper-content\">\n <ng-content></ng-content>\n </div>\n</div>\n"
|
|
35350
|
+
template: "<div class=\"po-stepper po-stepper-{{ orientation }}\">\n <div class=\"po-stepper-container\">\n <po-stepper-step\n *ngFor=\"let step of stepList; let index = index; trackBy: trackByFn\"\n class=\"po-stepper-step-position\"\n [p-circle-content]=\"index + 1\"\n [p-label]=\"step.label\"\n [p-orientation]=\"orientation\"\n [p-status]=\"step.status\"\n [p-step-icons]=\"stepIcons\"\n [p-step-size]=\"stepSize\"\n [p-next-status]=\"poSteps.get(index + 1)?.status\"\n (p-activated)=\"onStepActive(step)\"\n (p-click)=\"changeStep(index, step)\"\n (p-enter)=\"changeStep(index, step)\"\n >\n </po-stepper-step>\n </div>\n\n <div *ngIf=\"usePoSteps\" class=\"po-stepper-content\">\n <ng-content></ng-content>\n </div>\n</div>\n"
|
|
35308
35351
|
},] }
|
|
35309
35352
|
];
|
|
35310
35353
|
PoStepperComponent.ctorParameters = function () { return [
|
|
@@ -35434,11 +35477,11 @@
|
|
|
35434
35477
|
PoStepperStepComponent.prototype.getStatusClass = function (status) {
|
|
35435
35478
|
switch (status) {
|
|
35436
35479
|
case exports.PoStepperStatus.Active:
|
|
35437
|
-
return 'po-stepper-step-
|
|
35480
|
+
return 'po-stepper-step-default';
|
|
35438
35481
|
case exports.PoStepperStatus.Disabled:
|
|
35439
35482
|
return 'po-stepper-step-disabled';
|
|
35440
35483
|
case exports.PoStepperStatus.Done:
|
|
35441
|
-
return 'po-stepper-step-
|
|
35484
|
+
return 'po-stepper-step-default';
|
|
35442
35485
|
case exports.PoStepperStatus.Error:
|
|
35443
35486
|
return 'po-stepper-step-error';
|
|
35444
35487
|
default:
|
|
@@ -35460,12 +35503,13 @@
|
|
|
35460
35503
|
PoStepperStepComponent.decorators = [
|
|
35461
35504
|
{ type: i0.Component, args: [{
|
|
35462
35505
|
selector: 'po-stepper-step',
|
|
35463
|
-
template: "<div class=\"po-stepper-step\" [ngClass]=\"getStatusClass(status)\" (click)=\"onClick()\" (keydown.enter)=\"onEnter()\">\n <div class=\"po-stepper-step-container\" [style.width.px]=\"isVerticalOrientation ? stepSize : undefined\">\n <div\n [class.po-stepper-step-bar-top]=\"isVerticalOrientation\"\n [class.po-stepper-step-bar-left]=\"!isVerticalOrientation\"\n [style.margin-right.px]=\"marginHorizontalBar\"\n ></div>\n\n <po-stepper-circle [p-content]=\"circleContent\" [p-icons]=\"stepIcons\" [p-size]=\"stepSize\" [p-status]=\"status\">\n </po-stepper-circle>\n\n <div\n [class.po-stepper-step-bar-bottom]=\"isVerticalOrientation\"\n [class.po-stepper-step-bar-right]=\"!isVerticalOrientation\"\n [style.margin-left.px]=\"marginHorizontalBar\"\n ></div>\n </div>\n\n <po-stepper-label class=\"po-stepper-step-label-position\" [p-content]=\"label\"> </po-stepper-label>\n</div>\n"
|
|
35506
|
+
template: "<div class=\"po-stepper-step\" [ngClass]=\"getStatusClass(status)\" (click)=\"onClick()\" (keydown.enter)=\"onEnter()\">\n <div class=\"po-stepper-step-container\" [style.width.px]=\"isVerticalOrientation ? stepSize : undefined\">\n <div\n [class.po-stepper-step-bar-top]=\"isVerticalOrientation\"\n [class.po-stepper-step-bar-left]=\"!isVerticalOrientation\"\n [style.margin-right.px]=\"marginHorizontalBar\"\n ></div>\n\n <po-stepper-circle [p-content]=\"circleContent\" [p-icons]=\"stepIcons\" [p-size]=\"stepSize\" [p-status]=\"status\">\n </po-stepper-circle>\n\n <div\n [class.po-stepper-step-bar-bottom]=\"isVerticalOrientation\"\n [class.po-stepper-step-bar-right]=\"!isVerticalOrientation\"\n [class.po-stepper-step-dashed-border]=\"nextStatus === 'disabled' && !isVerticalOrientation\"\n [class.po-stepper-step-dashed-border-vertical]=\"nextStatus === 'disabled' && isVerticalOrientation\"\n [style.margin-left.px]=\"marginHorizontalBar\"\n ></div>\n </div>\n\n <po-stepper-label class=\"po-stepper-step-label-position\" [p-content]=\"label\"> </po-stepper-label>\n</div>\n"
|
|
35464
35507
|
},] }
|
|
35465
35508
|
];
|
|
35466
35509
|
PoStepperStepComponent.propDecorators = {
|
|
35467
35510
|
circleContent: [{ type: i0.Input, args: ['p-circle-content',] }],
|
|
35468
35511
|
orientation: [{ type: i0.Input, args: ['p-orientation',] }],
|
|
35512
|
+
nextStatus: [{ type: i0.Input, args: ['p-next-status',] }],
|
|
35469
35513
|
activated: [{ type: i0.Output, args: ['p-activated',] }],
|
|
35470
35514
|
click: [{ type: i0.Output, args: ['p-click',] }],
|
|
35471
35515
|
enter: [{ type: i0.Output, args: ['p-enter',] }],
|
|
@@ -38769,7 +38813,7 @@
|
|
|
38769
38813
|
exports.ɵdz = PoRichTextBodyComponent;
|
|
38770
38814
|
exports.ɵe = PoAvatarBaseComponent;
|
|
38771
38815
|
exports.ɵea = PoSelectBaseComponent;
|
|
38772
|
-
exports.ɵeb =
|
|
38816
|
+
exports.ɵeb = PoFieldModel;
|
|
38773
38817
|
exports.ɵec = PoTextareaBaseComponent;
|
|
38774
38818
|
exports.ɵed = PoUploadBaseComponent;
|
|
38775
38819
|
exports.ɵee = PoUploadService;
|