@seniorsistemas/angular-components 17.2.10 → 17.2.11

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.
Files changed (37) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +1692 -1643
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/country-phone-picker/country-phone-picker.component.d.ts +5 -0
  6. package/components/dynamic-form/components/fields/base-field-component.d.ts +2 -1
  7. package/components/dynamic-form/components/fields/country-phone-picker/country-phone-picker-field.component.d.ts +7 -0
  8. package/components/dynamic-form/configurations/field-type.d.ts +1 -0
  9. package/components/dynamic-form/configurations/fields/country-phone-picker-field.d.ts +15 -0
  10. package/components/dynamic-form/configurations/fields/index.d.ts +19 -0
  11. package/esm2015/components/country-phone-picker/country-phone-picker.component.js +13 -2
  12. package/esm2015/components/dynamic-form/components/fields/base-field-component.js +1 -1
  13. package/esm2015/components/dynamic-form/components/fields/country-phone-picker/country-phone-picker-field.component.js +17 -0
  14. package/esm2015/components/dynamic-form/configurations/field-type.js +2 -1
  15. package/esm2015/components/dynamic-form/configurations/fields/country-phone-picker-field.js +11 -0
  16. package/esm2015/components/dynamic-form/configurations/fields/index.js +20 -0
  17. package/esm2015/components/dynamic-form/configurations/form-field.js +4 -1
  18. package/esm2015/components/dynamic-form/dynamic-form.js +7 -4
  19. package/esm2015/components/dynamic-form/dynamic-form.module.js +56 -47
  20. package/esm2015/seniorsistemas-angular-components.js +55 -54
  21. package/esm5/components/country-phone-picker/country-phone-picker.component.js +13 -2
  22. package/esm5/components/dynamic-form/components/fields/base-field-component.js +1 -1
  23. package/esm5/components/dynamic-form/components/fields/country-phone-picker/country-phone-picker-field.component.js +20 -0
  24. package/esm5/components/dynamic-form/configurations/field-type.js +2 -1
  25. package/esm5/components/dynamic-form/configurations/fields/country-phone-picker-field.js +16 -0
  26. package/esm5/components/dynamic-form/configurations/fields/index.js +20 -0
  27. package/esm5/components/dynamic-form/configurations/form-field.js +4 -1
  28. package/esm5/components/dynamic-form/dynamic-form.js +7 -4
  29. package/esm5/components/dynamic-form/dynamic-form.module.js +56 -47
  30. package/esm5/seniorsistemas-angular-components.js +55 -54
  31. package/fesm2015/seniorsistemas-angular-components.js +1502 -1460
  32. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  33. package/fesm5/seniorsistemas-angular-components.js +1635 -1587
  34. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  35. package/package.json +1 -1
  36. package/seniorsistemas-angular-components.d.ts +54 -53
  37. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -18,7 +18,7 @@ import { Hotkey, HotkeysService, HotkeyModule } from 'angular2-hotkeys';
18
18
  import BigNumber, { BigNumber as BigNumber$1 } from 'bignumber.js';
19
19
  import { AutoComplete, AutoCompleteModule } from 'primeng/autocomplete';
20
20
  import { Dialog, DialogModule } from 'primeng/dialog';
21
- import { Table, TableService, RowToggler, TableModule as TableModule$1 } from 'primeng/table';
21
+ import { Table, RowToggler, TableService, TableModule as TableModule$1 } from 'primeng/table';
22
22
  import { applyMask, AlignmentOptions, CurrencyMaskDirective as CurrencyMaskDirective$1 } from '@seniorsistemas/ng2-currency-mask';
23
23
  import { user, service } from '@seniorsistemas/senior-platform-data';
24
24
  import * as moment_ from 'moment';
@@ -37,10 +37,10 @@ import { MultiSelectModule } from 'primeng/multiselect';
37
37
  import { PanelModule as PanelModule$1 } from 'primeng/panel';
38
38
  import { RadioButtonModule } from 'primeng/radiobutton';
39
39
  import { SliderModule } from 'primeng/slider';
40
+ import { MessageService, ConfirmationService } from 'primeng/api';
40
41
  import { ProgressBarModule as ProgressBarModule$1 } from 'primeng/progressbar';
41
42
  import { DomSanitizer, BrowserModule } from '@angular/platform-browser';
42
43
  import { Clipboard } from '@angular/cdk/clipboard';
43
- import { MessageService, ConfirmationService } from 'primeng/api';
44
44
  import Cropper from 'cropperjs';
45
45
  import * as elementResizeDetectorMaker_ from 'element-resize-detector';
46
46
  import { FocusTrapFactory, A11yModule } from '@angular/cdk/a11y';
@@ -2034,7 +2034,11 @@ let CountryPhonePickerComponent = CountryPhonePickerComponent_1 = class CountryP
2034
2034
  this.offsetTop = 0;
2035
2035
  this.ordination = Ordination.NO;
2036
2036
  this.selected = new EventEmitter();
2037
+ /**
2038
+ * @deprecated Use focusLost event instead.
2039
+ */
2037
2040
  this.blur = new EventEmitter();
2041
+ this.focusLost = new EventEmitter();
2038
2042
  this.tabindex = 0;
2039
2043
  this._filterCountries = (value) => {
2040
2044
  if (!value) {
@@ -2160,6 +2164,10 @@ let CountryPhonePickerComponent = CountryPhonePickerComponent_1 = class CountryP
2160
2164
  getPlaceholder() {
2161
2165
  return this.mask.replace(/9/g, "");
2162
2166
  }
2167
+ onBlur(value) {
2168
+ this.blur.emit(value);
2169
+ this.focusLost.emit(value);
2170
+ }
2163
2171
  _getSelectedCountryDefault() {
2164
2172
  if (!this._countriesList.length) {
2165
2173
  throw new Error("No country loaded");
@@ -2242,6 +2250,9 @@ __decorate([
2242
2250
  __decorate([
2243
2251
  Output()
2244
2252
  ], CountryPhonePickerComponent.prototype, "blur", void 0);
2253
+ __decorate([
2254
+ Output()
2255
+ ], CountryPhonePickerComponent.prototype, "focusLost", void 0);
2245
2256
  __decorate([
2246
2257
  ViewChild("phoneInput", { static: true })
2247
2258
  ], CountryPhonePickerComponent.prototype, "phoneInput", void 0);
@@ -2257,7 +2268,7 @@ __decorate([
2257
2268
  CountryPhonePickerComponent = CountryPhonePickerComponent_1 = __decorate([
2258
2269
  Component({
2259
2270
  selector: "s-country-phone-picker",
2260
- template: "<div class=\"country-phone-picker\">\n <div class=\"phone-input\">\n <div class=\"drop\" (click)=\"open = !open\">\n <span class=\"drop-flag\" [ngClass]=\"'fi fi-' + selectedItem.id\">\n </span>\n <span class=\"drop-icon fas fa-caret-down\"></span>\n </div>\n <p class=\"phone-ddi\">{{ selectedItem.ddi }}</p>\n <input\n #phoneInput\n type=\"tel\"\n autofocus\n [mask]=\"mask\" \n [placeholder]=\"getPlaceholder()\"\n [formControl]=\"phone\"\n (focus)=\"onPhoneInputFocus()\" \n (blur)=\"blur.emit(value)\"\n />\n </div>\n <div *ngIf=\"open\" class=\"dropdown\">\n <div class=\"search\">\n <input\n class=\"search-field\"\n type=\"text\"\n [formControl]=\"filter\">\n <span class=\"search-icon fas fa-search\"></span>\n <span\n class=\"search-clear fa fa-times\"\n (click)=\"onCleanFilter()\"></span>\n </div>\n <ul class=\"select-list\">\n <li\n *ngFor=\"let country of filteredCountriesList; let i = index;\"\n class=\"select-option\"\n [ngClass]=\"{ 'select-option--focused': i == currentItemIndex }\"\n (click)=\"onSelectItem(country)\">\n <span\n class=\"select-option__flag\"\n [ngClass]=\"'fi fi-' + country.id\">\n </span>\n <span class=\"select-option__name\">\n {{ \"platform.angular_components.country_name_\" + country.id | translate }}\n </span>\n <span class=\"select-option__ddi\">\n {{ country.ddi }}\n </span>\n </li>\n </ul>\n </div>\n</div>",
2271
+ template: "<div class=\"country-phone-picker\">\n <div class=\"phone-input\">\n <div class=\"drop\" (click)=\"open = !open\">\n <span class=\"drop-flag\" [ngClass]=\"'fi fi-' + selectedItem.id\">\n </span>\n <span class=\"drop-icon fas fa-caret-down\"></span>\n </div>\n <p class=\"phone-ddi\">{{ selectedItem.ddi }}</p>\n <input\n #phoneInput\n type=\"tel\"\n autofocus\n [mask]=\"mask\" \n [placeholder]=\"getPlaceholder()\"\n [formControl]=\"phone\"\n (focus)=\"onPhoneInputFocus()\" \n (blur)=\"onBlur(value)\"\n />\n </div>\n <div *ngIf=\"open\" class=\"dropdown\">\n <div class=\"search\">\n <input\n class=\"search-field\"\n type=\"text\"\n [formControl]=\"filter\">\n <span class=\"search-icon fas fa-search\"></span>\n <span\n class=\"search-clear fa fa-times\"\n (click)=\"onCleanFilter()\"></span>\n </div>\n <ul class=\"select-list\">\n <li\n *ngFor=\"let country of filteredCountriesList; let i = index;\"\n class=\"select-option\"\n [ngClass]=\"{ 'select-option--focused': i == currentItemIndex }\"\n (click)=\"onSelectItem(country)\">\n <span\n class=\"select-option__flag\"\n [ngClass]=\"'fi fi-' + country.id\">\n </span>\n <span class=\"select-option__name\">\n {{ \"platform.angular_components.country_name_\" + country.id | translate }}\n </span>\n <span class=\"select-option__ddi\">\n {{ country.ddi }}\n </span>\n </li>\n </ul>\n </div>\n</div>",
2261
2272
  providers: [{
2262
2273
  provide: NG_VALUE_ACCESSOR,
2263
2274
  useExisting: forwardRef(() => CountryPhonePickerComponent_1),
@@ -2290,6 +2301,7 @@ var FieldType;
2290
2301
  FieldType["Blob"] = "Blob";
2291
2302
  FieldType["Boolean"] = "Boolean";
2292
2303
  FieldType["Chips"] = "Chips";
2304
+ FieldType["CountryPhonePicker"] = "CountryPhonePicker";
2293
2305
  FieldType["Custom"] = "Custom";
2294
2306
  FieldType["Date"] = "Date";
2295
2307
  FieldType["DateTime"] = "DateTime";
@@ -3130,6 +3142,16 @@ class SliderField extends Field {
3130
3142
  }
3131
3143
  }
3132
3144
 
3145
+ class CountryPhonePickerField extends Field {
3146
+ constructor(config) {
3147
+ super(config);
3148
+ this.countries = config.countries;
3149
+ this.ordination = config.ordination;
3150
+ this.onSelected = config.onSelected;
3151
+ this.onFocusLost = config.onFocusLost;
3152
+ }
3153
+ }
3154
+
3133
3155
  class FormField {
3134
3156
  constructor(config) {
3135
3157
  switch (config.type) {
@@ -3167,6 +3189,8 @@ class FormField {
3167
3189
  return new RadioButtonField(config);
3168
3190
  case FieldType.Chips:
3169
3191
  return new ChipsField(config);
3192
+ case FieldType.CountryPhonePicker:
3193
+ return new CountryPhonePickerField(config);
3170
3194
  case FieldType.Blob:
3171
3195
  return new BlobField(config);
3172
3196
  case FieldType.Slider:
@@ -3851,145 +3875,413 @@ DynamicFormComponent = __decorate([
3851
3875
  })
3852
3876
  ], DynamicFormComponent);
3853
3877
 
3854
- var EmptyStateComponent_1;
3855
- let EmptyStateComponent = EmptyStateComponent_1 = class EmptyStateComponent {
3878
+ let IAssistService = class IAssistService {
3879
+ constructor(http, _messageService) {
3880
+ this.http = http;
3881
+ this._messageService = _messageService;
3882
+ }
3883
+ askIA(context, data) {
3884
+ return this.http.post("platform/iassist/api/latest/completions", {
3885
+ "prompt": this._createPrompt(context, data),
3886
+ "provider": "OPEN_AI",
3887
+ "parameters": {
3888
+ "model": "gpt-3.5-turbo",
3889
+ "max_tokens": 700,
3890
+ "temperature": 1
3891
+ }
3892
+ }).pipe(catchError((err) => {
3893
+ this._messageService.add({
3894
+ severity: "error",
3895
+ summary: err.status ? String(err.status) : "Error",
3896
+ detail: (err.error && err.error.message) || err.statusText || err.message || "Error",
3897
+ });
3898
+ return throwError(err);
3899
+ }));
3900
+ }
3901
+ _createPrompt(context, data) {
3902
+ return `Crie um texto genérico para preencher o campo de textarea.
3903
+ ${data.label ? `O campo tem o label ${data.label}.` : ""}
3904
+ ${data.id ? `O campo tem o id ${data.id}.` : ""}
3905
+ ${data.placeholder ? `Considere as instruções/sugestões do placeholder: ${data.placeholder}.` : ""}
3906
+ Baseie-se no contexto informado pelo usuário: '${context}'.
3907
+ O texto deve ser formal e conter informações pertinentes a um campo como este, como se um usuário real tivesse preenchido com as informações necessárias.
3908
+ O texto deve ser neutro com relação a generos, raças, religiões, etc.
3909
+ O texto deve ser impessoal e não deve conter informações pessoais do usuário.
3910
+ Não direcione o texto a ninguém, não use expressões como: caro, atenciosamente. gostaria, agradeço. O texto deve ser genérico.
3911
+
3912
+ Exemplos de texto:
3913
+ Um campo de descrição de usuário: "Usuário com 20 anos, estudante de engenharia, gosta de jogar futebol e assistir filmes."
3914
+ Outro exemplo de descrição de usuário: "Usuário administrador, com acesso total ao sistema, responsável por gerenciar os usuários e os produtos."
3915
+ Um campo de descrição de um produto: "O produto é um celular, com tela de 6 polegadas, 128GB de armazenamento, 4GB de memória RAM, câmera de 12MP e bateria de 4000mAh."
3916
+ Outro exemplo de descrição de produto: "O produto é uma geladeira, com capacidade de 500 litros, 2 portas, cor branca, com freezer e gaveta de legumes."
3917
+ Outro exemplo de descrição de produto: "O produto é uma camiseta, tamanho M, cor azul, 100% algodão, com estampa de um gato."
3918
+
3919
+ Em caso de contexto incompleto crie um texto genérico, como se fosse um exemplo de preenchimento do campo.
3920
+ O texto é para um campo de textarea, então escreva um texto sucinto.
3921
+ Exiba apenas o texto do output`;
3922
+ }
3923
+ };
3924
+ IAssistService.ctorParameters = () => [
3925
+ { type: HttpClient },
3926
+ { type: MessageService }
3927
+ ];
3928
+ IAssistService = __decorate([
3929
+ Injectable()
3930
+ ], IAssistService);
3931
+
3932
+ let LongPressDirective = class LongPressDirective {
3856
3933
  constructor() {
3857
- this.id = `s-empty-state-${EmptyStateComponent_1.nextId++}`;
3858
- this.iconClass = "fa fa-inbox";
3859
- this.showPrimaryAction = true;
3860
- this.showSecondaryAction = true;
3861
- this.primaryModel = [];
3862
- this.primaryAction = new EventEmitter();
3863
- this.secondaryAction = new EventEmitter();
3934
+ this.sLongPressDelay = 500;
3935
+ this.sLongPress = new EventEmitter();
3936
+ this.mouseUp = new Subject();
3937
+ this.mouseDown = new Subject();
3938
+ this.ngUnsubscribe = new Subject();
3939
+ }
3940
+ onMouseUp(event) {
3941
+ this.mouseUp.next(event);
3942
+ }
3943
+ onMouseDown(event) {
3944
+ this.mouseDown.next(event);
3945
+ }
3946
+ ngOnInit() {
3947
+ this.mouseDown
3948
+ .pipe(debounceTime(this.sLongPressDelay), takeUntil(this.mouseUp), repeat(), takeUntil(this.ngUnsubscribe))
3949
+ .subscribe(event => this.sLongPress.emit(event));
3950
+ }
3951
+ ngOnDestroy() {
3952
+ this.ngUnsubscribe.next();
3953
+ this.ngUnsubscribe.complete();
3864
3954
  }
3865
3955
  };
3866
- EmptyStateComponent.nextId = 0;
3867
- __decorate([
3868
- Input()
3869
- ], EmptyStateComponent.prototype, "id", void 0);
3870
- __decorate([
3871
- Input()
3872
- ], EmptyStateComponent.prototype, "iconClass", void 0);
3873
- __decorate([
3874
- Input()
3875
- ], EmptyStateComponent.prototype, "title", void 0);
3876
- __decorate([
3877
- Input()
3878
- ], EmptyStateComponent.prototype, "description", void 0);
3879
- __decorate([
3880
- Input()
3881
- ], EmptyStateComponent.prototype, "showPrimaryAction", void 0);
3882
- __decorate([
3883
- Input()
3884
- ], EmptyStateComponent.prototype, "showSecondaryAction", void 0);
3885
- __decorate([
3886
- Input()
3887
- ], EmptyStateComponent.prototype, "primaryActionLabel", void 0);
3888
3956
  __decorate([
3889
3957
  Input()
3890
- ], EmptyStateComponent.prototype, "secondaryActionLabel", void 0);
3891
- __decorate([
3892
- Input()
3893
- ], EmptyStateComponent.prototype, "primaryModel", void 0);
3958
+ ], LongPressDirective.prototype, "sLongPressDelay", void 0);
3894
3959
  __decorate([
3895
3960
  Output()
3896
- ], EmptyStateComponent.prototype, "primaryAction", void 0);
3961
+ ], LongPressDirective.prototype, "sLongPress", void 0);
3897
3962
  __decorate([
3898
- Output()
3899
- ], EmptyStateComponent.prototype, "secondaryAction", void 0);
3900
- EmptyStateComponent = EmptyStateComponent_1 = __decorate([
3901
- Component({
3902
- selector: `s-empty-state`,
3903
- template: "<div [id]=\"id\" class=\"container\">\n <div [id]=\"id + '-icon'\" class=\"icon\">\n <i [attr.class]=\"iconClass ? iconClass : 'fa fa-cogs'\" aria-hidden=\"true\"></i>\n </div>\n <div [id]=\"id + '-title'\" class=\"title\">{{title}}</div>\n <div [id]=\"id + '-description'\" class=\"description\" *ngIf=\"description\">\n <p>{{description}}</p>\n </div>\n <div [id]=\"id + '-actions'\" class=\"actions\" *ngIf=\"showPrimaryAction && primaryActionLabel\">\n <s-button [id]=\"id + '-primary-action'\" type=\"button\" [label]=\"primaryActionLabel\"\n [model]=\"primaryModel\" (click)=\"primaryAction.next()\"></s-button>\n <s-button [id]=\"id + '-secondary-action'\" *ngIf=\"showSecondaryAction && secondaryActionLabel\" id=\"secondaryAction\" type=\"button\"\n [label]=\"secondaryActionLabel\" priority=\"link\" (click)=\"secondaryAction.next()\"></s-button>\n </div>\n</div>",
3904
- styles: [".container{width:100%;text-align:center}.title{font-weight:700;margin-bottom:10px}.description{margin-bottom:15px;color:#999;padding:0 20px;text-align:center}.description>p{margin:auto;max-width:400px;max-height:80px;overflow:hidden}.icon{color:#d8d8d8;font-size:6em}.actions{text-align:center;width:100%}"]
3963
+ HostListener("mouseup", ["$event"]),
3964
+ HostListener("touchend", ["$event"])
3965
+ ], LongPressDirective.prototype, "onMouseUp", null);
3966
+ __decorate([
3967
+ HostListener("mousedown", ["$event"]),
3968
+ HostListener("touchstart", ["$event"])
3969
+ ], LongPressDirective.prototype, "onMouseDown", null);
3970
+ LongPressDirective = __decorate([
3971
+ Directive({
3972
+ selector: "[sLongPress]",
3905
3973
  })
3906
- ], EmptyStateComponent);
3974
+ ], LongPressDirective);
3907
3975
 
3908
- let EmptyStateGoBackComponent = class EmptyStateGoBackComponent {
3909
- constructor(cookieService) {
3910
- this.cookieService = cookieService;
3911
- this.iconClass = "fa fa-exclamation-triangle";
3976
+ let DoubleClickDirective = class DoubleClickDirective {
3977
+ constructor() {
3978
+ this.onDoubleClick = new EventEmitter();
3979
+ this._timeout = null;
3980
+ this._DOUBLE_CLICK_DELAY = 500;
3912
3981
  }
3913
- goBack() {
3914
- const portalUrl = this.cookieService.get("com.senior.portal.url");
3915
- window.open(portalUrl, "_top");
3982
+ onClick(event) {
3983
+ this.handleOnClickEvent(event);
3984
+ }
3985
+ handleOnClickEvent(event) {
3986
+ if (this._timeout) {
3987
+ this.clearTimeout();
3988
+ this.onDoubleClick.emit(event);
3989
+ }
3990
+ else {
3991
+ this._timeout = setTimeout(() => this.clearTimeout(), this._DOUBLE_CLICK_DELAY);
3992
+ }
3993
+ }
3994
+ clearTimeout() {
3995
+ clearTimeout(this._timeout);
3996
+ this._timeout = null;
3916
3997
  }
3917
3998
  };
3918
- EmptyStateGoBackComponent.nextId = 0;
3919
- EmptyStateGoBackComponent.ctorParameters = () => [
3920
- { type: CookieService }
3921
- ];
3922
- __decorate([
3923
- Input()
3924
- ], EmptyStateGoBackComponent.prototype, "iconClass", void 0);
3925
3999
  __decorate([
3926
- Input()
3927
- ], EmptyStateGoBackComponent.prototype, "title", void 0);
3928
- __decorate([
3929
- Input()
3930
- ], EmptyStateGoBackComponent.prototype, "description", void 0);
4000
+ Output()
4001
+ ], DoubleClickDirective.prototype, "onDoubleClick", void 0);
3931
4002
  __decorate([
3932
- Input()
3933
- ], EmptyStateGoBackComponent.prototype, "primaryActionLabel", void 0);
3934
- EmptyStateGoBackComponent = __decorate([
3935
- Component({
3936
- selector: `s-empty-state-go-back`,
3937
- template: "<s-empty-state \n [iconClass]=\"iconClass\" \n [title]=\"title\" \n [description]=\"description\" \n (primaryAction)=\"goBack()\"\n [primaryActionLabel]=\"primaryActionLabel\">\n</s-empty-state>"
4003
+ HostListener("click", ["$event"])
4004
+ ], DoubleClickDirective.prototype, "onClick", null);
4005
+ DoubleClickDirective = __decorate([
4006
+ Directive({
4007
+ selector: '[sDoubleClick]'
3938
4008
  })
3939
- ], EmptyStateGoBackComponent);
4009
+ ], DoubleClickDirective);
3940
4010
 
3941
- let EmptyStateModule = class EmptyStateModule {
4011
+ let MouseEventsModule = class MouseEventsModule {
3942
4012
  };
3943
- EmptyStateModule = __decorate([
4013
+ MouseEventsModule = __decorate([
3944
4014
  NgModule({
3945
- imports: [CommonModule, ButtonModule],
3946
- providers: [CookieService],
3947
- declarations: [EmptyStateComponent, EmptyStateGoBackComponent],
3948
- exports: [EmptyStateComponent, EmptyStateGoBackComponent],
4015
+ imports: [CommonModule],
4016
+ declarations: [
4017
+ LongPressDirective,
4018
+ DoubleClickDirective
4019
+ ],
4020
+ exports: [
4021
+ LongPressDirective,
4022
+ DoubleClickDirective
4023
+ ],
3949
4024
  })
3950
- ], EmptyStateModule);
3951
-
3952
- /**
3953
- * Formats a JSON response to a JS object
3954
- * @param response The response to format
3955
- * @returns A JS object based on the response's body
3956
- */
3957
- function formatJsonResponse(response) {
3958
- return __awaiter(this, void 0, void 0, function* () {
3959
- return response.json();
3960
- });
3961
- }
3962
-
3963
- /**
3964
- * Formats a Blob response to a JS object
3965
- * @param response The response to format
3966
- * @returns A JS object based on the response's body
3967
- */
3968
- function formatBlobResponse(response) {
3969
- return __awaiter(this, void 0, void 0, function* () {
3970
- const textResponse = yield (yield response.blob()).text();
3971
- return JSON.parse(textResponse);
3972
- });
3973
- }
4025
+ ], MouseEventsModule);
3974
4026
 
3975
- /**
3976
- * Custom HttpClient for cases when is not possible to use the Angular's HttpClient
3977
- */
3978
- class CustomHttpClient {
3979
- /**
3980
- * Executes a Http Get
3981
- * @param url Url to execute the Get on
3982
- * @param init Optional additional configs
3983
- * @returns Whether a Promise<T> on request success or an error in request fail
3984
- */
3985
- static GET(url, init = {}) {
3986
- return __awaiter(this, void 0, void 0, function* () {
3987
- const response = yield this.interceptRequest(url, Object.assign(Object.assign({}, init), { method: "GET" }));
3988
- return this.formatResponse(response);
3989
- });
3990
- }
3991
- /**
3992
- * Executes a Http Post
4027
+ var BignumberInputDirective_1;
4028
+ let BignumberInputDirective = BignumberInputDirective_1 = class BignumberInputDirective extends CurrencyMaskDirective$1 {
4029
+ constructor() {
4030
+ super(...arguments);
4031
+ this.precision = 15;
4032
+ this.scale = 0;
4033
+ this.decimalSeparator = ",";
4034
+ this.alignTo = AlignmentOptions.LEFT;
4035
+ this.allowNegative = true;
4036
+ }
4037
+ ngOnInit() {
4038
+ this.updateVariables();
4039
+ super.ngOnInit();
4040
+ }
4041
+ ngOnChanges(changes) {
4042
+ const placeholderChange = changes.placeholder && changes.placeholder.currentValue;
4043
+ if (!placeholderChange && this.scale) {
4044
+ this.placeholder = `0${this.decimalSeparator}${"".padEnd(this.scale, "0")}`;
4045
+ }
4046
+ if (changes.scale ||
4047
+ changes.decimalSeparator ||
4048
+ changes.thousandsSeparator ||
4049
+ changes.alignTo ||
4050
+ changes.precision ||
4051
+ changes.allowNegative) {
4052
+ this.updateVariables();
4053
+ }
4054
+ }
4055
+ onKeypress(event) {
4056
+ const code = event.code;
4057
+ if (code === "Minus" || code === "NumpadSubtract") {
4058
+ if (this.allowNegative) {
4059
+ this.maxLength = this._maxLength + 1;
4060
+ }
4061
+ }
4062
+ else if (code === "Equal" || code === "NumpadAdd") {
4063
+ this.maxLength = this._maxLength;
4064
+ }
4065
+ }
4066
+ /**
4067
+ * Update the options values according to the directive input values.
4068
+ */
4069
+ updateVariables() {
4070
+ var _a;
4071
+ this.options = {
4072
+ align: this.alignTo,
4073
+ decimalSeparator: this.decimalSeparator,
4074
+ thousandsSeparator: (_a = this.thousandsSeparator) !== null && _a !== void 0 ? _a : ".",
4075
+ scale: this.scale || 0,
4076
+ prefix: "",
4077
+ suffix: "",
4078
+ allowNegative: this.allowNegative
4079
+ };
4080
+ this.calculateMaxLength();
4081
+ }
4082
+ /**
4083
+ * Responsible to calculate the field maximum length considering the separators.
4084
+ */
4085
+ calculateMaxLength() {
4086
+ var _a, _b;
4087
+ const decSepLength = this.decimalSeparator.length;
4088
+ const thoSepLength = (_b = (_a = this.thousandsSeparator) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1;
4089
+ let maxLength = this.precision + (this.scale ? decSepLength : 0);
4090
+ maxLength += Math.ceil((this.precision - (this.scale ? this.scale : 0)) / 3 - 1) * thoSepLength;
4091
+ this._maxLength = maxLength;
4092
+ this.maxLength = maxLength;
4093
+ }
4094
+ };
4095
+ __decorate([
4096
+ Input()
4097
+ ], BignumberInputDirective.prototype, "precision", void 0);
4098
+ __decorate([
4099
+ Input()
4100
+ ], BignumberInputDirective.prototype, "scale", void 0);
4101
+ __decorate([
4102
+ Input()
4103
+ ], BignumberInputDirective.prototype, "decimalSeparator", void 0);
4104
+ __decorate([
4105
+ Input()
4106
+ ], BignumberInputDirective.prototype, "thousandsSeparator", void 0);
4107
+ __decorate([
4108
+ Input()
4109
+ ], BignumberInputDirective.prototype, "alignTo", void 0);
4110
+ __decorate([
4111
+ Input()
4112
+ ], BignumberInputDirective.prototype, "allowNegative", void 0);
4113
+ __decorate([
4114
+ Input(),
4115
+ HostBinding("attr.placeholder")
4116
+ ], BignumberInputDirective.prototype, "placeholder", void 0);
4117
+ __decorate([
4118
+ HostBinding("attr.maxLength")
4119
+ ], BignumberInputDirective.prototype, "maxLength", void 0);
4120
+ __decorate([
4121
+ HostListener("keypress", ["$event"])
4122
+ ], BignumberInputDirective.prototype, "onKeypress", null);
4123
+ BignumberInputDirective = BignumberInputDirective_1 = __decorate([
4124
+ Directive({
4125
+ selector: "input[sBignumberInput]",
4126
+ providers: [
4127
+ {
4128
+ provide: NG_VALUE_ACCESSOR,
4129
+ useExisting: forwardRef(() => BignumberInputDirective_1),
4130
+ multi: true,
4131
+ },
4132
+ ],
4133
+ })
4134
+ ], BignumberInputDirective);
4135
+
4136
+ let BignumberInputModule = class BignumberInputModule {
4137
+ };
4138
+ BignumberInputModule = __decorate([
4139
+ NgModule({
4140
+ imports: [CommonModule],
4141
+ declarations: [BignumberInputDirective],
4142
+ exports: [BignumberInputDirective],
4143
+ })
4144
+ ], BignumberInputModule);
4145
+
4146
+ var EmptyStateComponent_1;
4147
+ let EmptyStateComponent = EmptyStateComponent_1 = class EmptyStateComponent {
4148
+ constructor() {
4149
+ this.id = `s-empty-state-${EmptyStateComponent_1.nextId++}`;
4150
+ this.iconClass = "fa fa-inbox";
4151
+ this.showPrimaryAction = true;
4152
+ this.showSecondaryAction = true;
4153
+ this.primaryModel = [];
4154
+ this.primaryAction = new EventEmitter();
4155
+ this.secondaryAction = new EventEmitter();
4156
+ }
4157
+ };
4158
+ EmptyStateComponent.nextId = 0;
4159
+ __decorate([
4160
+ Input()
4161
+ ], EmptyStateComponent.prototype, "id", void 0);
4162
+ __decorate([
4163
+ Input()
4164
+ ], EmptyStateComponent.prototype, "iconClass", void 0);
4165
+ __decorate([
4166
+ Input()
4167
+ ], EmptyStateComponent.prototype, "title", void 0);
4168
+ __decorate([
4169
+ Input()
4170
+ ], EmptyStateComponent.prototype, "description", void 0);
4171
+ __decorate([
4172
+ Input()
4173
+ ], EmptyStateComponent.prototype, "showPrimaryAction", void 0);
4174
+ __decorate([
4175
+ Input()
4176
+ ], EmptyStateComponent.prototype, "showSecondaryAction", void 0);
4177
+ __decorate([
4178
+ Input()
4179
+ ], EmptyStateComponent.prototype, "primaryActionLabel", void 0);
4180
+ __decorate([
4181
+ Input()
4182
+ ], EmptyStateComponent.prototype, "secondaryActionLabel", void 0);
4183
+ __decorate([
4184
+ Input()
4185
+ ], EmptyStateComponent.prototype, "primaryModel", void 0);
4186
+ __decorate([
4187
+ Output()
4188
+ ], EmptyStateComponent.prototype, "primaryAction", void 0);
4189
+ __decorate([
4190
+ Output()
4191
+ ], EmptyStateComponent.prototype, "secondaryAction", void 0);
4192
+ EmptyStateComponent = EmptyStateComponent_1 = __decorate([
4193
+ Component({
4194
+ selector: `s-empty-state`,
4195
+ template: "<div [id]=\"id\" class=\"container\">\n <div [id]=\"id + '-icon'\" class=\"icon\">\n <i [attr.class]=\"iconClass ? iconClass : 'fa fa-cogs'\" aria-hidden=\"true\"></i>\n </div>\n <div [id]=\"id + '-title'\" class=\"title\">{{title}}</div>\n <div [id]=\"id + '-description'\" class=\"description\" *ngIf=\"description\">\n <p>{{description}}</p>\n </div>\n <div [id]=\"id + '-actions'\" class=\"actions\" *ngIf=\"showPrimaryAction && primaryActionLabel\">\n <s-button [id]=\"id + '-primary-action'\" type=\"button\" [label]=\"primaryActionLabel\"\n [model]=\"primaryModel\" (click)=\"primaryAction.next()\"></s-button>\n <s-button [id]=\"id + '-secondary-action'\" *ngIf=\"showSecondaryAction && secondaryActionLabel\" id=\"secondaryAction\" type=\"button\"\n [label]=\"secondaryActionLabel\" priority=\"link\" (click)=\"secondaryAction.next()\"></s-button>\n </div>\n</div>",
4196
+ styles: [".container{width:100%;text-align:center}.title{font-weight:700;margin-bottom:10px}.description{margin-bottom:15px;color:#999;padding:0 20px;text-align:center}.description>p{margin:auto;max-width:400px;max-height:80px;overflow:hidden}.icon{color:#d8d8d8;font-size:6em}.actions{text-align:center;width:100%}"]
4197
+ })
4198
+ ], EmptyStateComponent);
4199
+
4200
+ let EmptyStateGoBackComponent = class EmptyStateGoBackComponent {
4201
+ constructor(cookieService) {
4202
+ this.cookieService = cookieService;
4203
+ this.iconClass = "fa fa-exclamation-triangle";
4204
+ }
4205
+ goBack() {
4206
+ const portalUrl = this.cookieService.get("com.senior.portal.url");
4207
+ window.open(portalUrl, "_top");
4208
+ }
4209
+ };
4210
+ EmptyStateGoBackComponent.nextId = 0;
4211
+ EmptyStateGoBackComponent.ctorParameters = () => [
4212
+ { type: CookieService }
4213
+ ];
4214
+ __decorate([
4215
+ Input()
4216
+ ], EmptyStateGoBackComponent.prototype, "iconClass", void 0);
4217
+ __decorate([
4218
+ Input()
4219
+ ], EmptyStateGoBackComponent.prototype, "title", void 0);
4220
+ __decorate([
4221
+ Input()
4222
+ ], EmptyStateGoBackComponent.prototype, "description", void 0);
4223
+ __decorate([
4224
+ Input()
4225
+ ], EmptyStateGoBackComponent.prototype, "primaryActionLabel", void 0);
4226
+ EmptyStateGoBackComponent = __decorate([
4227
+ Component({
4228
+ selector: `s-empty-state-go-back`,
4229
+ template: "<s-empty-state \n [iconClass]=\"iconClass\" \n [title]=\"title\" \n [description]=\"description\" \n (primaryAction)=\"goBack()\"\n [primaryActionLabel]=\"primaryActionLabel\">\n</s-empty-state>"
4230
+ })
4231
+ ], EmptyStateGoBackComponent);
4232
+
4233
+ let EmptyStateModule = class EmptyStateModule {
4234
+ };
4235
+ EmptyStateModule = __decorate([
4236
+ NgModule({
4237
+ imports: [CommonModule, ButtonModule],
4238
+ providers: [CookieService],
4239
+ declarations: [EmptyStateComponent, EmptyStateGoBackComponent],
4240
+ exports: [EmptyStateComponent, EmptyStateGoBackComponent],
4241
+ })
4242
+ ], EmptyStateModule);
4243
+
4244
+ /**
4245
+ * Formats a JSON response to a JS object
4246
+ * @param response The response to format
4247
+ * @returns A JS object based on the response's body
4248
+ */
4249
+ function formatJsonResponse(response) {
4250
+ return __awaiter(this, void 0, void 0, function* () {
4251
+ return response.json();
4252
+ });
4253
+ }
4254
+
4255
+ /**
4256
+ * Formats a Blob response to a JS object
4257
+ * @param response The response to format
4258
+ * @returns A JS object based on the response's body
4259
+ */
4260
+ function formatBlobResponse(response) {
4261
+ return __awaiter(this, void 0, void 0, function* () {
4262
+ const textResponse = yield (yield response.blob()).text();
4263
+ return JSON.parse(textResponse);
4264
+ });
4265
+ }
4266
+
4267
+ /**
4268
+ * Custom HttpClient for cases when is not possible to use the Angular's HttpClient
4269
+ */
4270
+ class CustomHttpClient {
4271
+ /**
4272
+ * Executes a Http Get
4273
+ * @param url Url to execute the Get on
4274
+ * @param init Optional additional configs
4275
+ * @returns Whether a Promise<T> on request success or an error in request fail
4276
+ */
4277
+ static GET(url, init = {}) {
4278
+ return __awaiter(this, void 0, void 0, function* () {
4279
+ const response = yield this.interceptRequest(url, Object.assign(Object.assign({}, init), { method: "GET" }));
4280
+ return this.formatResponse(response);
4281
+ });
4282
+ }
4283
+ /**
4284
+ * Executes a Http Post
3993
4285
  * @param url Url to execute the Post on
3994
4286
  * @param body Info to send to server on Post
3995
4287
  * @param init Optional additional configs
@@ -4859,269 +5151,315 @@ MaskFormatterModule = __decorate([
4859
5151
  })
4860
5152
  ], MaskFormatterModule);
4861
5153
 
4862
- var BignumberInputDirective_1;
4863
- let BignumberInputDirective = BignumberInputDirective_1 = class BignumberInputDirective extends CurrencyMaskDirective$1 {
5154
+ var PasswordStrengths;
5155
+ (function (PasswordStrengths) {
5156
+ PasswordStrengths["VeryWeak"] = "Very_weak";
5157
+ PasswordStrengths["Weak"] = "weak";
5158
+ PasswordStrengths["Medium"] = "medium";
5159
+ PasswordStrengths["Strong"] = "strong";
5160
+ })(PasswordStrengths || (PasswordStrengths = {}));
5161
+
5162
+ var PasswordStrengthPositions;
5163
+ (function (PasswordStrengthPositions) {
5164
+ PasswordStrengthPositions["Top"] = "top";
5165
+ PasswordStrengthPositions["Right"] = "right";
5166
+ PasswordStrengthPositions["Left"] = "left";
5167
+ })(PasswordStrengthPositions || (PasswordStrengthPositions = {}));
5168
+
5169
+ let PasswordStrengthComponent = class PasswordStrengthComponent {
4864
5170
  constructor() {
4865
- super(...arguments);
4866
- this.precision = 15;
4867
- this.scale = 0;
4868
- this.decimalSeparator = ",";
4869
- this.alignTo = AlignmentOptions.LEFT;
4870
- this.allowNegative = true;
5171
+ this.weakTitle = "Fraca";
5172
+ this.mediumTitle = "Médio";
5173
+ this.strongTitle = "Forte";
5174
+ this.position = PasswordStrengthPositions.Right;
5175
+ this.left = 0;
5176
+ this.top = 0;
5177
+ this.visible = false;
4871
5178
  }
4872
5179
  ngOnInit() {
4873
- this.updateVariables();
4874
- super.ngOnInit();
4875
- }
4876
- ngOnChanges(changes) {
4877
- const placeholderChange = changes.placeholder && changes.placeholder.currentValue;
4878
- if (!placeholderChange && this.scale) {
4879
- this.placeholder = `0${this.decimalSeparator}${"".padEnd(this.scale, "0")}`;
4880
- }
4881
- if (changes.scale ||
4882
- changes.decimalSeparator ||
4883
- changes.thousandsSeparator ||
4884
- changes.alignTo ||
4885
- changes.precision ||
4886
- changes.allowNegative) {
4887
- this.updateVariables();
4888
- }
5180
+ this.title = this.weakTitle;
4889
5181
  }
4890
- onKeypress(event) {
4891
- const code = event.code;
4892
- if (code === "Minus" || code === "NumpadSubtract") {
4893
- if (this.allowNegative) {
4894
- this.maxLength = this._maxLength + 1;
4895
- }
4896
- }
4897
- else if (code === "Equal" || code === "NumpadAdd") {
4898
- this.maxLength = this._maxLength;
5182
+ setPasswordStrengthPosition() {
5183
+ const passwordStrength = document.querySelector(".password-strength");
5184
+ switch (this.position) {
5185
+ case PasswordStrengthPositions.Top:
5186
+ passwordStrength.classList.add("password-strength--top");
5187
+ break;
5188
+ case PasswordStrengthPositions.Right:
5189
+ passwordStrength.classList.add("password-strength--right");
5190
+ break;
5191
+ case PasswordStrengthPositions.Left:
5192
+ passwordStrength.classList.add("password-strength--left");
5193
+ break;
4899
5194
  }
4900
5195
  }
4901
- /**
4902
- * Update the options values according to the directive input values.
4903
- */
4904
- updateVariables() {
4905
- var _a;
4906
- this.options = {
4907
- align: this.alignTo,
4908
- decimalSeparator: this.decimalSeparator,
4909
- thousandsSeparator: (_a = this.thousandsSeparator) !== null && _a !== void 0 ? _a : ".",
4910
- scale: this.scale || 0,
4911
- prefix: "",
4912
- suffix: "",
4913
- allowNegative: this.allowNegative
4914
- };
4915
- this.calculateMaxLength();
4916
- }
4917
- /**
4918
- * Responsible to calculate the field maximum length considering the separators.
4919
- */
4920
- calculateMaxLength() {
4921
- var _a, _b;
4922
- const decSepLength = this.decimalSeparator.length;
4923
- const thoSepLength = (_b = (_a = this.thousandsSeparator) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1;
4924
- let maxLength = this.precision + (this.scale ? decSepLength : 0);
4925
- maxLength += Math.ceil((this.precision - (this.scale ? this.scale : 0)) / 3 - 1) * thoSepLength;
4926
- this._maxLength = maxLength;
4927
- this.maxLength = maxLength;
5196
+ updateIndicators(passwordStrength) {
5197
+ const strengthIndicator1 = document.querySelector("#strength-indicator-1");
5198
+ const strengthIndicator2 = document.querySelector("#strength-indicator-2");
5199
+ const strengthIndicator3 = document.querySelector("#strength-indicator-3");
5200
+ const onIndicators = [];
5201
+ const indicators = [
5202
+ strengthIndicator1,
5203
+ strengthIndicator2,
5204
+ strengthIndicator3,
5205
+ ];
5206
+ let strengthClass;
5207
+ switch (passwordStrength) {
5208
+ case PasswordStrengths.VeryWeak:
5209
+ this.title = this.weakTitle;
5210
+ break;
5211
+ case PasswordStrengths.Weak:
5212
+ this.title = this.weakTitle;
5213
+ strengthClass = "strength-indicator--weak";
5214
+ onIndicators.push(strengthIndicator1);
5215
+ break;
5216
+ case PasswordStrengths.Medium:
5217
+ this.title = this.mediumTitle;
5218
+ strengthClass = "strength-indicator--medium";
5219
+ onIndicators.push(strengthIndicator1);
5220
+ onIndicators.push(strengthIndicator2);
5221
+ break;
5222
+ case PasswordStrengths.Strong:
5223
+ this.title = this.strongTitle;
5224
+ strengthClass = "strength-indicator--strong";
5225
+ onIndicators.push(strengthIndicator1);
5226
+ onIndicators.push(strengthIndicator2);
5227
+ onIndicators.push(strengthIndicator3);
5228
+ break;
5229
+ }
5230
+ indicators.forEach(indicator => {
5231
+ indicator.classList.remove("strength-indicator--weak", "strength-indicator--medium", "strength-indicator--strong");
5232
+ });
5233
+ onIndicators.forEach(indicator => {
5234
+ indicator.classList.add(strengthClass);
5235
+ });
4928
5236
  }
4929
5237
  };
4930
5238
  __decorate([
4931
5239
  Input()
4932
- ], BignumberInputDirective.prototype, "precision", void 0);
4933
- __decorate([
4934
- Input()
4935
- ], BignumberInputDirective.prototype, "scale", void 0);
4936
- __decorate([
4937
- Input()
4938
- ], BignumberInputDirective.prototype, "decimalSeparator", void 0);
5240
+ ], PasswordStrengthComponent.prototype, "weakTitle", void 0);
4939
5241
  __decorate([
4940
5242
  Input()
4941
- ], BignumberInputDirective.prototype, "thousandsSeparator", void 0);
5243
+ ], PasswordStrengthComponent.prototype, "mediumTitle", void 0);
4942
5244
  __decorate([
4943
5245
  Input()
4944
- ], BignumberInputDirective.prototype, "alignTo", void 0);
5246
+ ], PasswordStrengthComponent.prototype, "strongTitle", void 0);
4945
5247
  __decorate([
4946
5248
  Input()
4947
- ], BignumberInputDirective.prototype, "allowNegative", void 0);
4948
- __decorate([
4949
- Input(),
4950
- HostBinding("attr.placeholder")
4951
- ], BignumberInputDirective.prototype, "placeholder", void 0);
4952
- __decorate([
4953
- HostBinding("attr.maxLength")
4954
- ], BignumberInputDirective.prototype, "maxLength", void 0);
4955
- __decorate([
4956
- HostListener("keypress", ["$event"])
4957
- ], BignumberInputDirective.prototype, "onKeypress", null);
4958
- BignumberInputDirective = BignumberInputDirective_1 = __decorate([
4959
- Directive({
4960
- selector: "input[sBignumberInput]",
4961
- providers: [
4962
- {
4963
- provide: NG_VALUE_ACCESSOR,
4964
- useExisting: forwardRef(() => BignumberInputDirective_1),
4965
- multi: true,
4966
- },
4967
- ],
4968
- })
4969
- ], BignumberInputDirective);
4970
-
4971
- let BignumberInputModule = class BignumberInputModule {
4972
- };
4973
- BignumberInputModule = __decorate([
4974
- NgModule({
4975
- imports: [CommonModule],
4976
- declarations: [BignumberInputDirective],
4977
- exports: [BignumberInputDirective],
5249
+ ], PasswordStrengthComponent.prototype, "description", void 0);
5250
+ PasswordStrengthComponent = __decorate([
5251
+ Component({
5252
+ template: "<div\n class=\"password-strength\"\n [ngStyle]=\"{\n 'left': left + 'px',\n 'top': top + 'px'\n }\"\n [ngClass]=\"['password-strength--' + position]\">\n <span class=\"title\">{{ title }}</span>\n <div class=\"strength-indicators\">\n <span class=\"strength-indicator\" id=\"strength-indicator-1\"></span>\n <span class=\"strength-indicator\" id=\"strength-indicator-2\"></span>\n <span class=\"strength-indicator\" id=\"strength-indicator-3\"></span>\n </div>\n <span class=\"content\">{{ description }}</span>\n</div>",
5253
+ styles: [".password-strength{position:fixed;transform:translateX(-50%);background-color:#fff;border-radius:2px;box-shadow:0 0 5px 1px #ccc;padding:10px;width:232px;z-index:99999}.password-strength::after{content:\"\";position:absolute}.password-strength .title{font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:700;line-height:150%}.password-strength .strength-indicators{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:10px 0}.password-strength .strength-indicators .strength-indicator{background-color:#ccc;border-radius:2px;display:inline-block;height:3px;width:64px}.password-strength .strength-indicators .strength-indicator--weak{background-color:#c13018}.password-strength .strength-indicators .strength-indicator--medium{background-color:#fcbf10}.password-strength .strength-indicators .strength-indicator--strong{background-color:#0c9348}.password-strength .content{font-family:\"Open Sans\",sans-serif;font-size:12px;font-weight:400;line-height:150%}.password-strength--top{transform:translate(-50%,-100%)}.password-strength--top::after{top:100%;right:calc(50% - 4px);border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #fff}.password-strength--right{transform:translateY(-50%)}.password-strength--right::after{bottom:calc(50% - 8px);left:-8px;border-top:8px solid transparent;border-right:8px solid #fff;border-bottom:8px solid transparent}.password-strength--left{transform:translate(-100%,-50%)}.password-strength--left::after{bottom:calc(50% - 8px);right:-8px;border-top:8px solid transparent;border-left:8px solid #fff;border-bottom:8px solid transparent}"]
4978
5254
  })
4979
- ], BignumberInputModule);
5255
+ ], PasswordStrengthComponent);
4980
5256
 
4981
- var TableHeaderCheckboxComponent_1;
4982
- let TableHeaderCheckboxComponent = TableHeaderCheckboxComponent_1 = class TableHeaderCheckboxComponent {
4983
- constructor(table, tableService) {
4984
- this.table = table;
4985
- this.tableService = tableService;
4986
- this.id = `s-table-header-checkbox-${TableHeaderCheckboxComponent_1.nextId++}`;
4987
- this.ngUnsubscribe = new Subject();
4988
- this.table.tableService.valueSource$.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
4989
- this.checked = this.updateCheckedState();
4990
- });
4991
- this.table.tableService.selectionSource$.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
4992
- this.checked = this.updateCheckedState();
4993
- });
5257
+ let PasswordStrengthDirective = class PasswordStrengthDirective {
5258
+ constructor(elementRef, appRef, componentFactoryResolver, injector) {
5259
+ this.elementRef = elementRef;
5260
+ this.appRef = appRef;
5261
+ this.componentFactoryResolver = componentFactoryResolver;
5262
+ this.injector = injector;
5263
+ this.enabled = true;
5264
+ this.position = PasswordStrengthPositions.Right;
5265
+ this.componentRef = null;
4994
5266
  }
4995
5267
  ngOnInit() {
4996
- this.checked = this.updateCheckedState();
4997
- }
4998
- ngOnDestroy() {
4999
- this.ngUnsubscribe.next();
5268
+ this.validateProperties();
5000
5269
  }
5001
5270
  onFocus() {
5002
- this.hasFocus = true;
5271
+ var _a, _b, _c;
5272
+ const content = (_a = this.elementRef.nativeElement.value) !== null && _a !== void 0 ? _a : "";
5273
+ if (content) {
5274
+ this.createPasswordStrength();
5275
+ (_b = this.componentRef) === null || _b === void 0 ? void 0 : _b.instance.updateIndicators(this.validation(content));
5276
+ }
5277
+ else {
5278
+ (_c = this.componentRef) === null || _c === void 0 ? void 0 : _c.instance.updateIndicators(PasswordStrengths.VeryWeak);
5279
+ }
5003
5280
  }
5004
5281
  onBlur() {
5005
- this.hasFocus = false;
5006
- }
5007
- isDisabled() {
5008
- return this.disabled || !this.table.value || !this.table.value.length;
5282
+ this.destroyPasswordStrength();
5009
5283
  }
5010
- onClick() {
5011
- if (!this.disabled) {
5012
- if (this.table.value && this.table.value.length > 0)
5013
- this.onToggleCheckbox(!this.checked);
5284
+ createPasswordStrength() {
5285
+ if (this.enabled && this.componentRef === null) {
5286
+ const componentFactory = this.componentFactoryResolver.resolveComponentFactory(PasswordStrengthComponent);
5287
+ this.componentRef = componentFactory.create(this.injector);
5288
+ this.appRef.attachView(this.componentRef.hostView);
5289
+ const domElem = this.componentRef.hostView.rootNodes[0];
5290
+ document.body.appendChild(domElem);
5291
+ this.setPasswordStrengthComponentProperties();
5292
+ this.showPasswordStrength();
5014
5293
  }
5015
5294
  }
5016
- updateCheckedState() {
5017
- if (this.table.filteredValue) {
5018
- const val = this.table.filteredValue;
5019
- return val && val.length > 0 && this.table.selection && this.table.selection.length > 0 && this.isAllFilteredValuesChecked();
5295
+ showPasswordStrength() {
5296
+ if (this.componentRef !== null) {
5297
+ this.componentRef.instance.visible = true;
5020
5298
  }
5021
- else {
5022
- const val = this.table.value;
5023
- return val && val.length > 0 && this.table.selection && this.table.selection.length > 0 && this.isAllValuesChecked();
5299
+ }
5300
+ setPasswordStrengthComponentProperties() {
5301
+ if (this.componentRef != null) {
5302
+ this.componentRef.instance.position = this.position;
5303
+ this.componentRef.instance.weakTitle = this.weakTitle;
5304
+ this.componentRef.instance.mediumTitle = this.mediumTitle;
5305
+ this.componentRef.instance.strongTitle = this.strongTitle;
5306
+ this.componentRef.instance.description = this.description;
5307
+ const { top, right, bottom, left } = this.elementRef.nativeElement.getBoundingClientRect();
5308
+ const margin = 20;
5309
+ const elementRefHeight = bottom - top;
5310
+ const elementRefWidth = right - left;
5311
+ const safeSpace = 150;
5312
+ let positioned = false;
5313
+ const invalidOptions = [];
5314
+ while (!positioned) {
5315
+ if (invalidOptions.includes(PasswordStrengthPositions.Top)
5316
+ && invalidOptions.includes(PasswordStrengthPositions.Right)
5317
+ && invalidOptions.includes(PasswordStrengthPositions.Left)) {
5318
+ this.destroyPasswordStrength();
5319
+ throw new Error("No space to show password strength");
5320
+ }
5321
+ switch (this.position) {
5322
+ case PasswordStrengthPositions.Top: {
5323
+ const topShift = top;
5324
+ const rightShift = document.body.clientWidth - right;
5325
+ const leftShift = left;
5326
+ if (topShift <= elementRefHeight + safeSpace || rightShift < 50 || leftShift < 50) {
5327
+ this.position = PasswordStrengthPositions.Right;
5328
+ invalidOptions.push(PasswordStrengthPositions.Top);
5329
+ break;
5330
+ }
5331
+ this.componentRef.instance.top = Math.round(top - margin);
5332
+ this.componentRef.instance.left = Math.round(elementRefWidth / 2 + left);
5333
+ positioned = true;
5334
+ break;
5335
+ }
5336
+ case PasswordStrengthPositions.Right: {
5337
+ const rightShift = document.body.clientWidth - right;
5338
+ if (rightShift <= elementRefWidth + safeSpace) {
5339
+ this.position = PasswordStrengthPositions.Left;
5340
+ invalidOptions.push(PasswordStrengthPositions.Right);
5341
+ break;
5342
+ }
5343
+ this.componentRef.instance.top = Math.round(top + elementRefHeight / 2);
5344
+ this.componentRef.instance.left = Math.round(right + margin);
5345
+ positioned = true;
5346
+ break;
5347
+ }
5348
+ case PasswordStrengthPositions.Left: {
5349
+ const leftShift = left;
5350
+ if (leftShift <= elementRefWidth + safeSpace) {
5351
+ this.position = PasswordStrengthPositions.Top;
5352
+ invalidOptions.push(PasswordStrengthPositions.Left);
5353
+ break;
5354
+ }
5355
+ this.componentRef.instance.top = Math.round(top + elementRefHeight / 2);
5356
+ this.componentRef.instance.left = Math.round(left - margin);
5357
+ positioned = true;
5358
+ break;
5359
+ }
5360
+ default: {
5361
+ break;
5362
+ }
5363
+ }
5364
+ this.componentRef.instance.position = this.position;
5365
+ }
5024
5366
  }
5025
5367
  }
5026
- onToggleCheckbox(checked) {
5027
- const { filteredValue, value, dataKey } = this.table;
5028
- const gridData = checked ? (filteredValue ? filteredValue.slice() : value.slice()) : [];
5029
- if (checked) {
5030
- const unselecteds = gridData
5031
- .filter(record => !this.table._selection.find((selected) => record[dataKey] === selected[dataKey]))
5032
- .map((record) => {
5033
- if (this.useAllObject)
5034
- return record;
5035
- const newRecord = {};
5036
- if (this.rowProps)
5037
- this.rowProps.forEach((prop) => (newRecord[prop] = record[prop]));
5038
- else
5039
- newRecord[dataKey] = record[dataKey];
5040
- return newRecord;
5041
- });
5042
- this.table._selection = [...this.table._selection, ...unselecteds];
5368
+ validateProperties() {
5369
+ this.validation = this.validation || this.defaultValidator;
5370
+ if (!this.description) {
5371
+ throw new Error("Description is required");
5043
5372
  }
5044
- else {
5045
- value.forEach((data) => {
5046
- this.table._selection = this.table._selection.filter((record) => record[dataKey] !== data[dataKey]);
5047
- });
5373
+ }
5374
+ destroyPasswordStrength() {
5375
+ if (this.componentRef !== null) {
5376
+ this.appRef.detachView(this.componentRef.hostView);
5377
+ this.componentRef.destroy();
5378
+ this.componentRef = null;
5048
5379
  }
5049
- this.table.updateSelectionKeys();
5050
- this.table.selectionChange.emit(this.table._selection);
5051
- this.tableService.onSelectionChange();
5052
- if (this.table.isStateful())
5053
- this.table.saveState();
5054
5380
  }
5055
- isAllFilteredValuesChecked() {
5056
- if (!this.table.filteredValue) {
5057
- return false;
5381
+ defaultValidator(content) {
5382
+ let points = 0;
5383
+ const regExpValidations = [
5384
+ new RegExp("(?=.*\\d)"),
5385
+ new RegExp("(?=.*[a-z])"),
5386
+ new RegExp("(?=.*[A-Z])"),
5387
+ new RegExp("(?=.*[!@#$%&*.\\-=+^~])"),
5388
+ ];
5389
+ if (content.length >= 6) {
5390
+ points++;
5058
5391
  }
5059
- else {
5060
- for (const rowData of this.table.filteredValue) {
5061
- if (!this.table.isSelected(rowData)) {
5062
- return false;
5063
- }
5392
+ regExpValidations.forEach(validation => {
5393
+ if (validation.test(content)) {
5394
+ points++;
5064
5395
  }
5065
- return true;
5396
+ });
5397
+ if (points < 1) {
5398
+ return PasswordStrengths.VeryWeak;
5066
5399
  }
5067
- }
5068
- isAllValuesChecked() {
5069
- if (!this.table.value) {
5070
- return false;
5400
+ else if (points < 4) {
5401
+ return PasswordStrengths.Weak;
5402
+ }
5403
+ else if (points < 5) {
5404
+ return PasswordStrengths.Medium;
5071
5405
  }
5072
5406
  else {
5073
- for (const rowData of this.table.value) {
5074
- if (!this.table.isSelected(rowData)) {
5075
- return false;
5076
- }
5077
- }
5078
- return true;
5407
+ return PasswordStrengths.Strong;
5079
5408
  }
5080
5409
  }
5081
5410
  };
5082
- TableHeaderCheckboxComponent.nextId = 0;
5083
- TableHeaderCheckboxComponent.ctorParameters = () => [
5084
- { type: Table },
5085
- { type: TableService }
5411
+ PasswordStrengthDirective.ctorParameters = () => [
5412
+ { type: ElementRef },
5413
+ { type: ApplicationRef },
5414
+ { type: ComponentFactoryResolver },
5415
+ { type: Injector }
5086
5416
  ];
5087
5417
  __decorate([
5088
- Input()
5089
- ], TableHeaderCheckboxComponent.prototype, "id", void 0);
5418
+ Input("sPasswordStrength")
5419
+ ], PasswordStrengthDirective.prototype, "enabled", void 0);
5090
5420
  __decorate([
5091
- Input()
5092
- ], TableHeaderCheckboxComponent.prototype, "disabled", void 0);
5421
+ Input("psValidation")
5422
+ ], PasswordStrengthDirective.prototype, "validation", void 0);
5093
5423
  __decorate([
5094
- Input()
5095
- ], TableHeaderCheckboxComponent.prototype, "rowProps", void 0);
5424
+ Input("psPosition")
5425
+ ], PasswordStrengthDirective.prototype, "position", void 0);
5096
5426
  __decorate([
5097
- Input()
5098
- ], TableHeaderCheckboxComponent.prototype, "useAllObject", void 0);
5099
- TableHeaderCheckboxComponent = TableHeaderCheckboxComponent_1 = __decorate([
5100
- Component({
5101
- selector: "s-table-header-checkbox",
5102
- template: `
5103
- <div class="ui-chkbox ui-widget" (click)="onClick()">
5104
- <div class="ui-helper-hidden-accessible">
5105
- <input type="checkbox" [checked]="checked" (focus)="onFocus()" (blur)="onBlur()" [disabled]="isDisabled()">
5106
- </div>
5107
- <div [ngClass]="{'ui-chkbox-box ui-widget ui-state-default':true,
5108
- 'ui-state-active':checked, 'ui-state-disabled': isDisabled(), 'ui-state-focus': hasFocus}">
5109
- <span [id]="id" class="ui-chkbox-icon ui-clickable" [ngClass]="{'pi pi-check':checked}"></span>
5110
- </div>
5111
- </div>
5112
- `
5427
+ Input("psWeakTitle")
5428
+ ], PasswordStrengthDirective.prototype, "weakTitle", void 0);
5429
+ __decorate([
5430
+ Input("psMediumTitle")
5431
+ ], PasswordStrengthDirective.prototype, "mediumTitle", void 0);
5432
+ __decorate([
5433
+ Input("psStrongTitle")
5434
+ ], PasswordStrengthDirective.prototype, "strongTitle", void 0);
5435
+ __decorate([
5436
+ Input("psDescription")
5437
+ ], PasswordStrengthDirective.prototype, "description", void 0);
5438
+ __decorate([
5439
+ HostListener("keyup"),
5440
+ HostListener("focus")
5441
+ ], PasswordStrengthDirective.prototype, "onFocus", null);
5442
+ __decorate([
5443
+ HostListener("blur")
5444
+ ], PasswordStrengthDirective.prototype, "onBlur", null);
5445
+ PasswordStrengthDirective = __decorate([
5446
+ Directive({
5447
+ selector: "[sPasswordStrength]",
5113
5448
  })
5114
- ], TableHeaderCheckboxComponent);
5449
+ ], PasswordStrengthDirective);
5115
5450
 
5116
- let TableHeaderCheckboxModule = class TableHeaderCheckboxModule {
5451
+ let PasswordStrengthModule = class PasswordStrengthModule {
5117
5452
  };
5118
- TableHeaderCheckboxModule = __decorate([
5453
+ PasswordStrengthModule = __decorate([
5119
5454
  NgModule({
5120
5455
  imports: [CommonModule],
5121
- exports: [TableHeaderCheckboxComponent],
5122
- declarations: [TableHeaderCheckboxComponent],
5456
+ declarations: [
5457
+ PasswordStrengthComponent,
5458
+ PasswordStrengthDirective,
5459
+ ],
5460
+ exports: [PasswordStrengthDirective],
5123
5461
  })
5124
- ], TableHeaderCheckboxModule);
5462
+ ], PasswordStrengthModule);
5125
5463
 
5126
5464
  let NavigationDirective = class NavigationDirective {
5127
5465
  onKeyDown(event) {
@@ -5996,558 +6334,407 @@ __decorate([
5996
6334
  Input()
5997
6335
  ], TablePagingComponent.prototype, "exportFileName", void 0);
5998
6336
  __decorate([
5999
- Input()
6000
- ], TablePagingComponent.prototype, "table", void 0);
6001
- __decorate([
6002
- Input()
6003
- ], TablePagingComponent.prototype, "exportable", void 0);
6004
- __decorate([
6005
- Input()
6006
- ], TablePagingComponent.prototype, "enableExportSelectedRecords", void 0);
6007
- __decorate([
6008
- Input()
6009
- ], TablePagingComponent.prototype, "customActions", void 0);
6010
- __decorate([
6011
- Input()
6012
- ], TablePagingComponent.prototype, "loadAllRecords", void 0);
6013
- __decorate([
6014
- Input()
6015
- ], TablePagingComponent.prototype, "loadCurrentPageRecords", void 0);
6016
- __decorate([
6017
- Input()
6018
- ], TablePagingComponent.prototype, "loadSelectedRecords", void 0);
6019
- __decorate([
6020
- Output()
6021
- ], TablePagingComponent.prototype, "totalRecordsText", void 0);
6022
- TablePagingComponent = __decorate([
6023
- Component({
6024
- template: "<div class=\"paging-container\">\n <span class=\"total-records\">\n {{totalRecordsText}}\n </span>\n <s-button\n *ngIf=\"exportable\"\n class=\"export-button\" \n priority=\"default\" \n iconClass=\"fa fa-fw fa-file-export\" \n [disabled]=\"false\" \n [auxiliary]=\"true\" \n [tooltip]=\"getTooltipText()\" \n [model]=\"getActions()\">\n </s-button>\n</div>\n",
6025
- selector: "s-table-paging",
6026
- styles: [".paging-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.export-button{margin-left:6px}"]
6027
- }),
6028
- __param(1, Inject(HostProjectConfigsInjectionToken))
6029
- ], TablePagingComponent);
6030
-
6031
- let TableModule = class TableModule {
6032
- };
6033
- TableModule = __decorate([
6034
- NgModule({
6035
- imports: [
6036
- CommonModule,
6037
- TooltipModule,
6038
- TokenListModule,
6039
- TranslateModule,
6040
- ButtonModule,
6041
- InfoSignModule
6042
- ],
6043
- exports: [
6044
- RowTogllerDirective,
6045
- NavigationDirective,
6046
- TableColumnsComponent,
6047
- TableFrozenPositionDirective,
6048
- TablePagingComponent
6049
- ],
6050
- declarations: [
6051
- RowTogllerDirective,
6052
- NavigationDirective,
6053
- TableColumnsComponent,
6054
- TableFrozenPositionDirective,
6055
- TablePagingComponent
6056
- ],
6057
- })
6058
- ], TableModule);
6059
-
6060
- let AutocompleteFieldComponent = class AutocompleteFieldComponent {
6061
- };
6062
- __decorate([
6063
- Input()
6064
- ], AutocompleteFieldComponent.prototype, "field", void 0);
6065
- __decorate([
6066
- Input()
6067
- ], AutocompleteFieldComponent.prototype, "formControl", void 0);
6068
- AutocompleteFieldComponent = __decorate([
6069
- Component({
6070
- template: "<div\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\">\n <s-lookup\n [id]=\"(field.id || field.name)\"\n [multiple]=\"field.multiple\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [lookupSuggestions]=\"field.suggestions\"\n [dataKey]=\"field.dataKey\"\n (onLookupRequest)=\"field.onSearch($event)\"\n [lookupDisplayField]=\"field.displayField\"\n [showSearch]=\"false\"\n [lookupAppendTo]=\"field.appendTo\"\n (onSelect)=\"field.onSelect ? field.onSelect($event) : null\"\n (onUnselect)=\"field.onUnselect ? field.onUnselect($event) : null\"\n (onClear)=\"field.onClear ? field.onClear($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [lookupEmptyMessage]=\"field.emptyMessage\">\n </s-lookup>\n</div>\n"
6071
- })
6072
- ], AutocompleteFieldComponent);
6073
-
6074
- let BooleanFieldComponent = class BooleanFieldComponent {
6075
- onClear() {
6076
- this.formControl.reset();
6077
- }
6078
- };
6079
- __decorate([
6080
- Input()
6081
- ], BooleanFieldComponent.prototype, "field", void 0);
6082
- __decorate([
6083
- Input()
6084
- ], BooleanFieldComponent.prototype, "formControl", void 0);
6085
- BooleanFieldComponent = __decorate([
6086
- Component({
6087
- template: "<ng-container *ngIf=\"field.verticalAlignment;else horizontalAlignment\">\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"true\"\n [label]=\"field.optionsLabel.true\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-1'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n <div class=\"ui-g-12\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"false\"\n [label]=\"field.optionsLabel.false\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-2'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n <div\n *ngIf=\"!field.showClear && !field.required()\"\n class=\"ui-g-12\">\n <p-radioButton \n [name]=\"field.name\"\n [value]=\"null\"\n [label]=\"field.optionsLabel.empty\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-3'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton> \n </div>\n <div>\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n </div>\n\n </div>\n</ng-container>\n\n<ng-template #horizontalAlignment>\n <div class=\"ui-g\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"true\"\n [label]=\"field.optionsLabel.true\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-1'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n \n <p-radioButton\n [name]=\"field.name\"\n [value]=\"false\"\n [label]=\"field.optionsLabel.false\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-2'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n\n <p-radioButton\n *ngIf=\"!field.showClear && !field.required()\"\n [name]=\"field.name\"\n [value]=\"null\"\n [label]=\"field.optionsLabel.empty\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-3'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n style=\"margin-left: 40px;\"\n [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n </div>\n</ng-template>\n"
6088
- })
6089
- ], BooleanFieldComponent);
6090
-
6091
- let CalendarFieldComponent = class CalendarFieldComponent {
6092
- };
6093
- __decorate([
6094
- Input()
6095
- ], CalendarFieldComponent.prototype, "field", void 0);
6096
- __decorate([
6097
- Input()
6098
- ], CalendarFieldComponent.prototype, "formControl", void 0);
6099
- __decorate([
6100
- Input()
6101
- ], CalendarFieldComponent.prototype, "showTime", void 0);
6102
- __decorate([
6103
- Input()
6104
- ], CalendarFieldComponent.prototype, "timeOnly", void 0);
6105
- CalendarFieldComponent = __decorate([
6106
- Component({
6107
- template: "<div\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\">\n <!-- Remover as propriedades [showTransitionOptions] e [hideTransitionOptions] quando atualizar para o PrimeNG v10, esses atributos foram\n usados para remover um bug ocasionado pela anima\u00E7\u00E3o do componente p-calendar, bug explicado nas issues: #ERPROM-5534, #ERPROM-8248 e #DSN-1045. -->\n <p-calendar\n #calendar\n sCalendarMask\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [showIcon]=\"true\"\n [timeOnly]=\"timeOnly\"\n [selectionMode]=\"field.selectionMode\"\n [rangeSeparator]=\"field.rangeSeparator\"\n [showTime]=\"showTime\"\n [showSeconds]=\"field.showSeconds\"\n [showOnFocus]=\"field.showOnFocus\"\n [formControl]=\"formControl\"\n [icon]=\"timeOnly ? 'fa fa-clock' : 'fa fa-calendar'\"\n [minDate]=\"field.minDate\"\n [maxDate]=\"field.maxDate\"\n [defaultDate]=\"field.defaultDate\"\n [locale]=\"field.calendarLocaleOptions\"\n [dateFormat]=\"field.calendarLocaleOptions.dateFormat\"\n [hourFormat]=\"field.calendarLocaleOptions.hourFormat\"\n [view]=\"field.view\"\n [placeholder]=\"field.placeholder\"\n inputStyleClass=\"mousetrap\"\n [appendTo]=\"field.appendTo\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event): null\"\n (onSelect)=\"field.onSelect ? field.onSelect($event) : null\"\n (onClose)=\"field.onClose ? field.onClose($event) : null\"\n (onTodayClick)=\"field.onTodayClick ? field.onTodayClick($event) : null\"\n (onClearClick)=\"field.onClearClick ? field.onClearClick($event) : null\"\n (onMonthChange)=\"field.onMonthChange ? field.onMonthChange($event) : null\"\n (onYearChange)=\"field.onYearChange ? field.onYearChange($event) : null\"\n [showTransitionOptions]=\"'0ms'\"\n [hideTransitionOptions]=\"'0ms'\">\n </p-calendar>\n</div>\n"
6108
- })
6109
- ], CalendarFieldComponent);
6110
-
6111
- let ChipsFieldComponent = class ChipsFieldComponent {
6112
- constructor(clipboard) {
6113
- this.clipboard = clipboard;
6114
- this.feedbackMessageVisible = false;
6115
- this.copyButtonVisible = true;
6116
- }
6117
- onCopyFieldContent() {
6118
- if (this.formControl.value) {
6119
- this.copyButtonVisible = false;
6120
- this.feedbackMessageVisible = true;
6121
- setTimeout(() => {
6122
- this.feedbackMessageVisible = false;
6123
- this.copyButtonVisible = true;
6124
- }, 3000);
6125
- const content = this.formControl.value.join(this.field.separator || "\n");
6126
- this.clipboard.copy(content);
6127
- if (this.field.onCopy) {
6128
- this.field.onCopy(content);
6129
- }
6130
- }
6131
- }
6132
- };
6133
- ChipsFieldComponent.ctorParameters = () => [
6134
- { type: Clipboard }
6135
- ];
6136
- __decorate([
6137
- Input()
6138
- ], ChipsFieldComponent.prototype, "field", void 0);
6139
- __decorate([
6140
- Input()
6141
- ], ChipsFieldComponent.prototype, "formControl", void 0);
6142
- ChipsFieldComponent = __decorate([
6143
- Component({
6144
- template: "<div class=\"chips-field-wrapper\">\n <div style=\"width: 100%;\">\n <p-chips\n *ngIf=\"field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [pKeyFilter]=\"field.keyFilter\">\n <ng-template let-item pTemplate=\"item\">\n <span\n class=\"chip-content\"\n [sTooltip]=\"item\">\n {{ item }}\n </span>\n </ng-template>\n </p-chips>\n \n <p-chips\n *ngIf=\"!field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n <ng-template let-item pTemplate=\"item\">\n <span\n class=\"chip-content\"\n [sTooltip]=\"item\">\n {{ item }}\n </span>\n </ng-template>\n </p-chips>\n </div>\n \n <button\n *ngIf=\"field.showCopyButton && formControl.value?.length > 0 && copyButtonVisible\"\n class=\"copy-content-button\"\n (click)=\"onCopyFieldContent()\">\n {{ \"platform.angular_components.copy_field_content\" | translate }}\n </button>\n \n <span\n *ngIf=\"feedbackMessageVisible\"\n class=\"feedback-message\">\n {{ \"platform.angular_components.copied_to_clipboard\" | translate }}\n </span>\n</div>\n",
6145
- styles: [".chips-field-wrapper{-ms-flex-align:start;align-items:flex-start;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.chips-field-wrapper .chip-content{display:block;overflow:hidden;padding-right:1rem;text-overflow:ellipsis}.chips-field-wrapper .copy-content-button{background-color:transparent;border:none;color:#2a6496;cursor:pointer;margin-top:8px}.chips-field-wrapper .feedback-message{color:#0c9348;display:block;margin-top:8px;-webkit-user-select:none;-ms-user-select:none;user-select:none}"]
6146
- })
6147
- ], ChipsFieldComponent);
6148
-
6149
- /**
6150
- * @deprecated Should use bignumber instead
6151
- */
6152
- let CurrencyFieldComponent = class CurrencyFieldComponent extends BaseFieldComponent {
6153
- };
6337
+ Input()
6338
+ ], TablePagingComponent.prototype, "table", void 0);
6154
6339
  __decorate([
6155
6340
  Input()
6156
- ], CurrencyFieldComponent.prototype, "field", void 0);
6341
+ ], TablePagingComponent.prototype, "exportable", void 0);
6157
6342
  __decorate([
6158
6343
  Input()
6159
- ], CurrencyFieldComponent.prototype, "formControl", void 0);
6160
- CurrencyFieldComponent = __decorate([
6161
- Component({
6162
- template: "<div class=\"ui-inputgroup\">\n <span\n *ngIf=\"field.numberLocaleOptions.currencySymbol\"\n class=\"ui-inputgroup-addon\">\n {{ field.numberLocaleOptions.currencySymbol }}\n </span>\n <input\n *ngIf=\"!field.mask\"\n type=\"text\"\n [id]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [formControl]=\"formControl\"\n sNumberInput\n [precision]=\"isFunction(field.precision) ? trigger(field.precision) : field.precision\"\n [scale]=\"isFunction(field.scale) ? trigger(field.scale) : field.scale\"\n [decimalSeparator]=\"field.numberLocaleOptions.decimalSeparator\"\n [thousandsSeparator]=\"field.numberLocaleOptions.thousandsSeparator\"\n [alignTo]=\"field.alignTo\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"field.onFocus ? field.onFocus($event): null\" />\n <p-inputMask\n *ngIf=\"field.mask\"\n type=\"text\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [formControl]=\"formControl\"\n [mask]=\"field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event): null\"\n (onComplete)=\"field.onComplete ? field.onComplete($event) : null\"\n (onInput)=\"field.onInput ? field.onInput($event) : null\" >\n </p-inputMask>\n</div>\n"
6163
- })
6164
- ], CurrencyFieldComponent);
6165
-
6166
- let FileUploadComponent$1 = class FileUploadComponent extends BaseFieldComponent {
6167
- };
6344
+ ], TablePagingComponent.prototype, "enableExportSelectedRecords", void 0);
6168
6345
  __decorate([
6169
6346
  Input()
6170
- ], FileUploadComponent$1.prototype, "field", void 0);
6347
+ ], TablePagingComponent.prototype, "customActions", void 0);
6171
6348
  __decorate([
6172
6349
  Input()
6173
- ], FileUploadComponent$1.prototype, "formControl", void 0);
6174
- FileUploadComponent$1 = __decorate([
6175
- Component({
6176
- template: "<s-file-upload [id]=\"(field.id || field.name)\" [accept]=\"field.accept\" [files]=\"field.files\" [multiple]=\"field.multiple\"\n [chooseLabel]=\"field.chooseLabel\" [removeLabel]=\"field.removeLabel\" [cancelLabel]=\"field.cancelLabel\"\n [successTooltip]=\"field.successTooltip\" (uploadHandler)=\"field.onUploadFile($event, field)\"\n (removeFile)=\"field.onRemoveFile($event, field)\" (cancelUpload)=\"field.onCancelUpload($event, field)\"\n (downloadFile)=\"field.onDownloadFile($event, field)\" [formGroup]=\"formControl\"\n [showFileUploadDate]=\"field.showFileUploadDate\"> \n</s-file-upload>\n"
6177
- })
6178
- ], FileUploadComponent$1);
6179
-
6180
- let LookupFieldComponent = class LookupFieldComponent {
6181
- };
6350
+ ], TablePagingComponent.prototype, "loadAllRecords", void 0);
6182
6351
  __decorate([
6183
6352
  Input()
6184
- ], LookupFieldComponent.prototype, "field", void 0);
6353
+ ], TablePagingComponent.prototype, "loadCurrentPageRecords", void 0);
6185
6354
  __decorate([
6186
6355
  Input()
6187
- ], LookupFieldComponent.prototype, "formControl", void 0);
6188
- LookupFieldComponent = __decorate([
6356
+ ], TablePagingComponent.prototype, "loadSelectedRecords", void 0);
6357
+ __decorate([
6358
+ Output()
6359
+ ], TablePagingComponent.prototype, "totalRecordsText", void 0);
6360
+ TablePagingComponent = __decorate([
6189
6361
  Component({
6190
- template: "<div\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\">\n <s-lookup\n [id]=\"(field.id || field.name)\"\n [multiple]=\"field.multiple\"\n [formControl]=\"formControl\"\n [lookupSuggestions]=\"field.lookupSuggestions\"\n [dataKey]=\"field.dataKey\"\n [placeholder]=\"field.placeholder\"\n [searchFields]=\"field.searchFields\"\n [searchGridFields]=\"field.searchGridFields\"\n [searchGridData]=\"field.gridData\"\n (onLookupRequest)=\"field.onLookupRequest($event)\"\n (onSearchRequest)=\"field.onSearchRequest($event)\"\n [lookupDisplayField]=\"field.lookupDisplayField\"\n [searchTotalRecords]=\"field.searchTotalRecords\"\n [searchTotalRecordsLabel]=\"field.searchTotalRecordsLabel\"\n [searchTitle]=\"field.searchTitle\"\n [selectLabel]=\"field.selectLabel\"\n [searchEmptyTitle]=\"field.searchEmptyTitle\"\n [filterLabel]=\"field.filterLabel\"\n [filterTitle]=\"field.filterTitle\"\n [clearLabel]=\"field.clearLabel\"\n [cancelLabel]=\"field.cancelLabel\"\n [emptyFieldLabel]=\"field.emptyFieldLabel \"\n (onSelect)=\"field.onSelect($event)\"\n (onUnselect)=\"field.onUnselect($event)\"\n (onClear)=\"field.onClear ? field.onClear($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [lookupAppendTo]=\"field.appendTo\"\n [lookupEmptyMessage]=\"field.emptyMessage\"\n [recordLabel]=\"field.recordLabel\"\n [recordsLabel]=\"field.recordsLabel\"\n [defaultFilter]=\"field.defaultFilter\"\n [autocompleteForceSelection]=\"field.autocompleteForceSelection\">\n </s-lookup>\n</div>\n"
6362
+ template: "<div class=\"paging-container\">\n <span class=\"total-records\">\n {{totalRecordsText}}\n </span>\n <s-button\n *ngIf=\"exportable\"\n class=\"export-button\" \n priority=\"default\" \n iconClass=\"fa fa-fw fa-file-export\" \n [disabled]=\"false\" \n [auxiliary]=\"true\" \n [tooltip]=\"getTooltipText()\" \n [model]=\"getActions()\">\n </s-button>\n</div>\n",
6363
+ selector: "s-table-paging",
6364
+ styles: [".paging-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.export-button{margin-left:6px}"]
6365
+ }),
6366
+ __param(1, Inject(HostProjectConfigsInjectionToken))
6367
+ ], TablePagingComponent);
6368
+
6369
+ let TableModule = class TableModule {
6370
+ };
6371
+ TableModule = __decorate([
6372
+ NgModule({
6373
+ imports: [
6374
+ CommonModule,
6375
+ TooltipModule,
6376
+ TokenListModule,
6377
+ TranslateModule,
6378
+ ButtonModule,
6379
+ InfoSignModule
6380
+ ],
6381
+ exports: [
6382
+ RowTogllerDirective,
6383
+ NavigationDirective,
6384
+ TableColumnsComponent,
6385
+ TableFrozenPositionDirective,
6386
+ TablePagingComponent
6387
+ ],
6388
+ declarations: [
6389
+ RowTogllerDirective,
6390
+ NavigationDirective,
6391
+ TableColumnsComponent,
6392
+ TableFrozenPositionDirective,
6393
+ TablePagingComponent
6394
+ ],
6191
6395
  })
6192
- ], LookupFieldComponent);
6396
+ ], TableModule);
6193
6397
 
6194
- let NumberFieldComponent = class NumberFieldComponent extends BaseFieldComponent {
6195
- constructor() {
6196
- super(...arguments);
6197
- this.onInput = new EventEmitter();
6198
- this.onFocus = new EventEmitter();
6199
- this.onComplete = new EventEmitter();
6398
+ var TableHeaderCheckboxComponent_1;
6399
+ let TableHeaderCheckboxComponent = TableHeaderCheckboxComponent_1 = class TableHeaderCheckboxComponent {
6400
+ constructor(table, tableService) {
6401
+ this.table = table;
6402
+ this.tableService = tableService;
6403
+ this.id = `s-table-header-checkbox-${TableHeaderCheckboxComponent_1.nextId++}`;
6200
6404
  this.ngUnsubscribe = new Subject();
6201
- }
6202
- ngOnInit() {
6203
- this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
6204
- if (this.field.onFocus)
6205
- this.field.onFocus(event);
6206
- });
6207
- this.onInput.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
6208
- if (this.field.onInput)
6209
- this.field.onInput(event);
6405
+ this.table.tableService.valueSource$.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
6406
+ this.checked = this.updateCheckedState();
6210
6407
  });
6211
- this.onComplete.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
6212
- if (this.field.onComplete)
6213
- this.field.onComplete(event);
6408
+ this.table.tableService.selectionSource$.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
6409
+ this.checked = this.updateCheckedState();
6214
6410
  });
6215
6411
  }
6412
+ ngOnInit() {
6413
+ this.checked = this.updateCheckedState();
6414
+ }
6216
6415
  ngOnDestroy() {
6217
6416
  this.ngUnsubscribe.next();
6218
- this.ngUnsubscribe.complete();
6219
6417
  }
6220
- get numberAlignmentOption() {
6221
- return NumberAlignmentOption;
6418
+ onFocus() {
6419
+ this.hasFocus = true;
6222
6420
  }
6223
- get fieldType() {
6224
- return FieldType;
6421
+ onBlur() {
6422
+ this.hasFocus = false;
6423
+ }
6424
+ isDisabled() {
6425
+ return this.disabled || !this.table.value || !this.table.value.length;
6426
+ }
6427
+ onClick() {
6428
+ if (!this.disabled) {
6429
+ if (this.table.value && this.table.value.length > 0)
6430
+ this.onToggleCheckbox(!this.checked);
6431
+ }
6432
+ }
6433
+ updateCheckedState() {
6434
+ if (this.table.filteredValue) {
6435
+ const val = this.table.filteredValue;
6436
+ return val && val.length > 0 && this.table.selection && this.table.selection.length > 0 && this.isAllFilteredValuesChecked();
6437
+ }
6438
+ else {
6439
+ const val = this.table.value;
6440
+ return val && val.length > 0 && this.table.selection && this.table.selection.length > 0 && this.isAllValuesChecked();
6441
+ }
6442
+ }
6443
+ onToggleCheckbox(checked) {
6444
+ const { filteredValue, value, dataKey } = this.table;
6445
+ const gridData = checked ? (filteredValue ? filteredValue.slice() : value.slice()) : [];
6446
+ if (checked) {
6447
+ const unselecteds = gridData
6448
+ .filter(record => !this.table._selection.find((selected) => record[dataKey] === selected[dataKey]))
6449
+ .map((record) => {
6450
+ if (this.useAllObject)
6451
+ return record;
6452
+ const newRecord = {};
6453
+ if (this.rowProps)
6454
+ this.rowProps.forEach((prop) => (newRecord[prop] = record[prop]));
6455
+ else
6456
+ newRecord[dataKey] = record[dataKey];
6457
+ return newRecord;
6458
+ });
6459
+ this.table._selection = [...this.table._selection, ...unselecteds];
6460
+ }
6461
+ else {
6462
+ value.forEach((data) => {
6463
+ this.table._selection = this.table._selection.filter((record) => record[dataKey] !== data[dataKey]);
6464
+ });
6465
+ }
6466
+ this.table.updateSelectionKeys();
6467
+ this.table.selectionChange.emit(this.table._selection);
6468
+ this.tableService.onSelectionChange();
6469
+ if (this.table.isStateful())
6470
+ this.table.saveState();
6471
+ }
6472
+ isAllFilteredValuesChecked() {
6473
+ if (!this.table.filteredValue) {
6474
+ return false;
6475
+ }
6476
+ else {
6477
+ for (const rowData of this.table.filteredValue) {
6478
+ if (!this.table.isSelected(rowData)) {
6479
+ return false;
6480
+ }
6481
+ }
6482
+ return true;
6483
+ }
6484
+ }
6485
+ isAllValuesChecked() {
6486
+ if (!this.table.value) {
6487
+ return false;
6488
+ }
6489
+ else {
6490
+ for (const rowData of this.table.value) {
6491
+ if (!this.table.isSelected(rowData)) {
6492
+ return false;
6493
+ }
6494
+ }
6495
+ return true;
6496
+ }
6225
6497
  }
6226
6498
  };
6499
+ TableHeaderCheckboxComponent.nextId = 0;
6500
+ TableHeaderCheckboxComponent.ctorParameters = () => [
6501
+ { type: Table },
6502
+ { type: TableService }
6503
+ ];
6227
6504
  __decorate([
6228
6505
  Input()
6229
- ], NumberFieldComponent.prototype, "field", void 0);
6506
+ ], TableHeaderCheckboxComponent.prototype, "id", void 0);
6230
6507
  __decorate([
6231
6508
  Input()
6232
- ], NumberFieldComponent.prototype, "formControl", void 0);
6509
+ ], TableHeaderCheckboxComponent.prototype, "disabled", void 0);
6233
6510
  __decorate([
6234
- Output()
6235
- ], NumberFieldComponent.prototype, "onInput", void 0);
6511
+ Input()
6512
+ ], TableHeaderCheckboxComponent.prototype, "rowProps", void 0);
6236
6513
  __decorate([
6237
- Output()
6238
- ], NumberFieldComponent.prototype, "onFocus", void 0);
6514
+ Input()
6515
+ ], TableHeaderCheckboxComponent.prototype, "useAllObject", void 0);
6516
+ TableHeaderCheckboxComponent = TableHeaderCheckboxComponent_1 = __decorate([
6517
+ Component({
6518
+ selector: "s-table-header-checkbox",
6519
+ template: `
6520
+ <div class="ui-chkbox ui-widget" (click)="onClick()">
6521
+ <div class="ui-helper-hidden-accessible">
6522
+ <input type="checkbox" [checked]="checked" (focus)="onFocus()" (blur)="onBlur()" [disabled]="isDisabled()">
6523
+ </div>
6524
+ <div [ngClass]="{'ui-chkbox-box ui-widget ui-state-default':true,
6525
+ 'ui-state-active':checked, 'ui-state-disabled': isDisabled(), 'ui-state-focus': hasFocus}">
6526
+ <span [id]="id" class="ui-chkbox-icon ui-clickable" [ngClass]="{'pi pi-check':checked}"></span>
6527
+ </div>
6528
+ </div>
6529
+ `
6530
+ })
6531
+ ], TableHeaderCheckboxComponent);
6532
+
6533
+ let TableHeaderCheckboxModule = class TableHeaderCheckboxModule {
6534
+ };
6535
+ TableHeaderCheckboxModule = __decorate([
6536
+ NgModule({
6537
+ imports: [CommonModule],
6538
+ exports: [TableHeaderCheckboxComponent],
6539
+ declarations: [TableHeaderCheckboxComponent],
6540
+ })
6541
+ ], TableHeaderCheckboxModule);
6542
+
6543
+ let AutocompleteFieldComponent = class AutocompleteFieldComponent {
6544
+ };
6239
6545
  __decorate([
6240
- Output()
6241
- ], NumberFieldComponent.prototype, "onComplete", void 0);
6242
- NumberFieldComponent = __decorate([
6546
+ Input()
6547
+ ], AutocompleteFieldComponent.prototype, "field", void 0);
6548
+ __decorate([
6549
+ Input()
6550
+ ], AutocompleteFieldComponent.prototype, "formControl", void 0);
6551
+ AutocompleteFieldComponent = __decorate([
6243
6552
  Component({
6244
- template: "<p-inputMask\n *ngIf=\"field.mask; else noMask\"\n type=\"text\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [mask]=\"isFunction(field.mask) ? field.mask() : field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"onFocus.next($event)\"\n (onComplete)=\"onComplete.next($event)\"\n (onInput)=\"onInput.next($event)\"\n [formControl]=\"formControl\" >\n</p-inputMask>\n<ng-template #noMask>\n <ng-container>\n <div class=\"ui-inputgroup\">\n <ng-container *ngIf=\"field.leftAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.leftAddon.label\">{{field.leftAddon.label}}</span>\n <span *ngIf=\"!field.leftAddon.label\" [ngClass]=\"field.leftAddon.icon\"></span>\n </span>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"field.type === fieldType.Double && field.alignTo === numberAlignmentOption.LEFT ? localizedNumber : input\"></ng-container>\n\n <ng-container *ngIf=\"field.rightAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.rightAddon.label\">{{field.rightAddon.label}}</span>\n <span *ngIf=\"!field.rightAddon.label\" [ngClass]=\"field.rightAddon.icon\"></span>\n </span>\n </ng-container>\n </div>\n </ng-container>\n</ng-template>\n<ng-template #input>\n <input\n [id]=\"(field.id || field.name)\"\n type=\"text\"\n [name]=\"field.name\"\n sNumberInput\n [precision]=\"isFunction(field.precision) ? trigger(field.precision) : field.precision\"\n [scale]=\"isFunction(field.scale) ? trigger(field.scale) : field.scale\"\n [decimalSeparator]=\"field.numberLocaleOptions.decimalSeparator\"\n [thousandsSeparator]=\"field.numberLocaleOptions.thousandsSeparator\"\n [alignTo]=\"field.alignTo\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n [formControl]=\"formControl\" />\n</ng-template>\n<ng-template #localizedNumber>\n <input\n [id]=\"(field.id || field.name)\"\n type=\"text\"\n [name]=\"field.name\"\n sLocalizedNumberInput\n [precision]=\"isFunction(field.precision) ? trigger(field.precision) : field.precision\"\n [decimalSeparator]=\"field.numberLocaleOptions.decimalSeparator\"\n [thousandsSeparator]=\"field.numberLocaleOptions.thousandsSeparator\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n [formControl]=\"formControl\" />\n</ng-template>\n",
6245
- encapsulation: ViewEncapsulation.None,
6246
- styles: ["s-number-field.ng-dirty.ng-invalid .ui-inputtext{border-color:#c13018}s-number-field.ng-dirty.ng-invalid .ui-inputtext:hover{border-color:#e44328}"]
6553
+ template: "<div\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\">\n <s-lookup\n [id]=\"(field.id || field.name)\"\n [multiple]=\"field.multiple\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [lookupSuggestions]=\"field.suggestions\"\n [dataKey]=\"field.dataKey\"\n (onLookupRequest)=\"field.onSearch($event)\"\n [lookupDisplayField]=\"field.displayField\"\n [showSearch]=\"false\"\n [lookupAppendTo]=\"field.appendTo\"\n (onSelect)=\"field.onSelect ? field.onSelect($event) : null\"\n (onUnselect)=\"field.onUnselect ? field.onUnselect($event) : null\"\n (onClear)=\"field.onClear ? field.onClear($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [lookupEmptyMessage]=\"field.emptyMessage\">\n </s-lookup>\n</div>\n"
6247
6554
  })
6248
- ], NumberFieldComponent);
6555
+ ], AutocompleteFieldComponent);
6249
6556
 
6250
- let RadioButtonComponent = class RadioButtonComponent {
6557
+ let BignumberFieldComponent = class BignumberFieldComponent extends BaseFieldComponent {
6251
6558
  constructor() {
6252
- this.onClick = new EventEmitter();
6559
+ super(...arguments);
6560
+ this.onInput = new EventEmitter();
6253
6561
  this.onFocus = new EventEmitter();
6562
+ this.onComplete = new EventEmitter();
6254
6563
  this.ngUnsubscribe = new Subject();
6255
6564
  }
6256
6565
  ngOnInit() {
6257
- this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
6258
- if (this.field.onFocus)
6566
+ this.onFocus
6567
+ .pipe(takeUntil(this.ngUnsubscribe))
6568
+ .subscribe((event) => {
6569
+ if (this.field.onFocus) {
6259
6570
  this.field.onFocus(event);
6571
+ }
6260
6572
  });
6261
- this.onClick.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
6262
- if (this.field.onClick)
6263
- this.field.onClick(event);
6573
+ this.onInput
6574
+ .pipe(takeUntil(this.ngUnsubscribe))
6575
+ .subscribe((event) => {
6576
+ if (this.field.onInput) {
6577
+ this.field.onInput(event);
6578
+ }
6579
+ });
6580
+ this.onComplete
6581
+ .pipe(takeUntil(this.ngUnsubscribe))
6582
+ .subscribe((event) => {
6583
+ if (this.field.onComplete) {
6584
+ this.field.onComplete(event);
6585
+ }
6264
6586
  });
6265
6587
  }
6266
6588
  ngOnDestroy() {
6267
6589
  this.ngUnsubscribe.next();
6268
6590
  this.ngUnsubscribe.complete();
6269
6591
  }
6270
- onClear() {
6271
- this.formControl.reset();
6592
+ get fieldType() {
6593
+ return FieldType;
6272
6594
  }
6273
6595
  };
6274
6596
  __decorate([
6275
6597
  Input()
6276
- ], RadioButtonComponent.prototype, "field", void 0);
6598
+ ], BignumberFieldComponent.prototype, "field", void 0);
6277
6599
  __decorate([
6278
6600
  Input()
6279
- ], RadioButtonComponent.prototype, "formControl", void 0);
6601
+ ], BignumberFieldComponent.prototype, "formControl", void 0);
6280
6602
  __decorate([
6281
6603
  Output()
6282
- ], RadioButtonComponent.prototype, "onClick", void 0);
6604
+ ], BignumberFieldComponent.prototype, "onInput", void 0);
6283
6605
  __decorate([
6284
6606
  Output()
6285
- ], RadioButtonComponent.prototype, "onFocus", void 0);
6286
- RadioButtonComponent = __decorate([
6607
+ ], BignumberFieldComponent.prototype, "onFocus", void 0);
6608
+ __decorate([
6609
+ Output()
6610
+ ], BignumberFieldComponent.prototype, "onComplete", void 0);
6611
+ BignumberFieldComponent = __decorate([
6287
6612
  Component({
6288
- template: "<ng-container *ngIf=\"field.verticalAlignment;else horizontalAlignment\">\n <div class=\"ui-g\">\n <div\n *ngFor=\"let option of field.options; let i = index\"\n class=\"ui-g-12\">\n <ng-container\n [ngTemplateOutlet]=\"radioButton\"\n [ngTemplateOutletContext]=\"{option: option, index: i}\">\n </ng-container>\n </div>\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n [label]=\"field.clearLabel || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n </div>\n</ng-container>\n\n<ng-template #horizontalAlignment>\n <div class=\"ui-g\">\n <ng-container\n *ngFor=\"let option of field.options; let i = index\"\n [ngTemplateOutlet]=\"radioButton\"\n [ngTemplateOutletContext]=\"{option: option, index: i}\">\n </ng-container>\n </div>\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n class=\"horizontal-clear-option\"\n [label]=\"field.clearLabel || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n</ng-template>\n\n<ng-template #radioButton let-option=\"option\" let-i=\"index\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"option.value\"\n [label]=\"option.label\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-' + i\"\n [sTooltip]=\"field.tooltip\"\n (onClick)=\"onClick.next($event)\"\n (onFocus)=\"onFocus.next($event)\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n</ng-template>\n",
6613
+ template: "<p-inputMask\n *ngIf=\"field.mask; else noMask\"\n type=\"text\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [mask]=\"isFunction(field.mask) ? field.mask() : field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"onFocus.next($event)\"\n (onComplete)=\"onComplete.next($event)\"\n (onInput)=\"onInput.next($event)\"\n [formControl]=\"formControl\"\n [autoClear]=\"field.autoClear\">\n</p-inputMask>\n\n<ng-template #noMask>\n <ng-container>\n <div class=\"ui-inputgroup\">\n <ng-container *ngIf=\"field.leftAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.leftAddon.label\">{{field.leftAddon.label}}</span>\n <span *ngIf=\"!field.leftAddon.label\" [ngClass]=\"field.leftAddon.icon\"></span>\n </span>\n </ng-container>\n\n <input\n [id]=\"(field.id || field.name)\"\n type=\"text\"\n [name]=\"field.name\"\n sBignumberInput\n [allowNegative]=\"field.allowNegative\"\n [precision]=\"isFunction(field.precision) ? trigger(field.precision) : field.precision\"\n [scale]=\"isFunction(field.scale) ? trigger(field.scale) : field.scale\"\n [decimalSeparator]=\"field.numberLocaleOptions.decimalSeparator\"\n [thousandsSeparator]=\"field.numberLocaleOptions.thousandsSeparator\"\n [alignTo]=\"field.alignTo\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n [formControl]=\"formControl\" />\n <ng-container *ngIf=\"field.rightAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.rightAddon.label\">{{field.rightAddon.label}}</span>\n <span *ngIf=\"!field.rightAddon.label\" [ngClass]=\"field.rightAddon.icon\"></span>\n </span>\n </ng-container>\n </div>\n </ng-container>\n</ng-template>\n",
6289
6614
  encapsulation: ViewEncapsulation.None,
6290
- styles: [`
6291
- s-button.horizontal-clear-option button {
6292
- width: min-content !important;
6293
- }
6294
- `]
6615
+ styles: ["s-number-field.ng-dirty.ng-invalid .ui-inputtext{border-color:#c13018}s-number-field.ng-dirty.ng-invalid .ui-inputtext:hover{border-color:#e44328}"]
6295
6616
  })
6296
- ], RadioButtonComponent);
6617
+ ], BignumberFieldComponent);
6297
6618
 
6298
- let SelectFieldComponent = class SelectFieldComponent extends BaseFieldComponent {
6619
+ let BooleanFieldComponent = class BooleanFieldComponent {
6620
+ onClear() {
6621
+ this.formControl.reset();
6622
+ }
6299
6623
  };
6300
6624
  __decorate([
6301
6625
  Input()
6302
- ], SelectFieldComponent.prototype, "field", void 0);
6626
+ ], BooleanFieldComponent.prototype, "field", void 0);
6303
6627
  __decorate([
6304
6628
  Input()
6305
- ], SelectFieldComponent.prototype, "formControl", void 0);
6306
- SelectFieldComponent = __decorate([
6629
+ ], BooleanFieldComponent.prototype, "formControl", void 0);
6630
+ BooleanFieldComponent = __decorate([
6307
6631
  Component({
6308
- template: "<p-dropdown\n *ngIf=\"!field.multiple\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [placeholder]=\"field.placeholder || ' '\"\n [formControl]=\"formControl\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [showClear]=\"field.showClear\"\n dataKey=\"{{field.dataKey}}\"\n optionLabel=\"{{field.optionLabel}}\"\n [autoDisplayFirst]=\"field.autoDisplayFirst\"\n [appendTo]=\"field.appendTo || 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\">\n</p-dropdown>\n<p-multiSelect\n *ngIf=\"field.multiple\"\n [formControl]=\"formControl\"\n [name]=\"field.name\"\n [inputId]=\"(field.id || field.name)\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [defaultLabel]=\"field.placeholder\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [emptyFilterMessage]=\"field.emptyMessage || 'Nenhum registro encontrado'\"\n [showDelay]=\"500\"\n [selectedItemsLabel]=\"field.multipleSelectedLabel\"\n [appendTo]=\"field.appendTo || 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\">\n</p-multiSelect>\n\n"
6632
+ template: "<ng-container *ngIf=\"field.verticalAlignment;else horizontalAlignment\">\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"true\"\n [label]=\"field.optionsLabel.true\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-1'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n <div class=\"ui-g-12\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"false\"\n [label]=\"field.optionsLabel.false\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-2'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n </div>\n <div\n *ngIf=\"!field.showClear && !field.required()\"\n class=\"ui-g-12\">\n <p-radioButton \n [name]=\"field.name\"\n [value]=\"null\"\n [label]=\"field.optionsLabel.empty\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-3'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton> \n </div>\n <div>\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n </div>\n\n </div>\n</ng-container>\n\n<ng-template #horizontalAlignment>\n <div class=\"ui-g\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"true\"\n [label]=\"field.optionsLabel.true\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-1'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n \n <p-radioButton\n [name]=\"field.name\"\n [value]=\"false\"\n [label]=\"field.optionsLabel.false\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-2'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n\n <p-radioButton\n *ngIf=\"!field.showClear && !field.required()\"\n [name]=\"field.name\"\n [value]=\"null\"\n [label]=\"field.optionsLabel.empty\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-3'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n style=\"margin-left: 40px;\"\n [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n </div>\n</ng-template>\n"
6309
6633
  })
6310
- ], SelectFieldComponent);
6634
+ ], BooleanFieldComponent);
6311
6635
 
6312
- let TextAreaFieldComponent = class TextAreaFieldComponent {
6636
+ let BooleanSwitchFieldComponent = class BooleanSwitchFieldComponent {
6313
6637
  };
6314
6638
  __decorate([
6315
6639
  Input()
6316
- ], TextAreaFieldComponent.prototype, "field", void 0);
6640
+ ], BooleanSwitchFieldComponent.prototype, "field", void 0);
6317
6641
  __decorate([
6318
6642
  Input()
6319
- ], TextAreaFieldComponent.prototype, "formControl", void 0);
6320
- TextAreaFieldComponent = __decorate([
6643
+ ], BooleanSwitchFieldComponent.prototype, "formControl", void 0);
6644
+ BooleanSwitchFieldComponent = __decorate([
6321
6645
  Component({
6322
- template: "<textarea\n [id]=\"(field.id || field.name)\"\n *ngIf=\"!field.keyFilter\"\n pInputTextarea\n [rows]=\"field.rows\"\n [cols]=\"field.cols\"\n [formControl]=\"formControl\"\n style=\"resize: vertical;\"\n [ngStyle]=\"field.style\"\n></textarea>\n<textarea\n [id]=\"(field.id || field.name)\"\n *ngIf=\"field.keyFilter\"\n pInputTextarea\n [rows]=\"field.rows\"\n [cols]=\"field.cols\"\n [formControl]=\"formControl\"\n style=\"resize: vertical;\"\n [pKeyFilter]=\"field.keyFilter\"\n [ngStyle]=\"field.style\"\n></textarea>\n"
6646
+ template: "<div class=\"ui-grid ui-grid-responsive ui-grid-pad ui-fluid\">\n <div class=\"ui-grid-row\">\n <div class=\"i-grid-col-1\">\n <s-switch\n [id]=\"(field.id || field.name)\"\n [inputName]=\"field.name\"\n [formControl]=\"formControl\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n (valueChanged)=\"field.onChange ? field.onChange($event) : null\">\n </s-switch>\n </div>\n <div class=\"i-grid-col-1\" *ngIf=\"field.optionsLabel\">\n <ng-container *ngIf=\"formControl.value; else caseFalse\">\n <span>{{ field.optionsLabel.true }}</span>\n </ng-container>\n <ng-template #caseFalse>\n <span>{{ field.optionsLabel.false }}</span>\n </ng-template>\n </div>\n </div>\n</div>"
6323
6647
  })
6324
- ], TextAreaFieldComponent);
6325
-
6326
- let IAssistService = class IAssistService {
6327
- constructor(http, _messageService) {
6328
- this.http = http;
6329
- this._messageService = _messageService;
6330
- }
6331
- askIA(context, data) {
6332
- return this.http.post("platform/iassist/api/latest/completions", {
6333
- "prompt": this._createPrompt(context, data),
6334
- "provider": "OPEN_AI",
6335
- "parameters": {
6336
- "model": "gpt-3.5-turbo",
6337
- "max_tokens": 700,
6338
- "temperature": 1
6339
- }
6340
- }).pipe(catchError((err) => {
6341
- this._messageService.add({
6342
- severity: "error",
6343
- summary: err.status ? String(err.status) : "Error",
6344
- detail: (err.error && err.error.message) || err.statusText || err.message || "Error",
6345
- });
6346
- return throwError(err);
6347
- }));
6348
- }
6349
- _createPrompt(context, data) {
6350
- return `Crie um texto genérico para preencher o campo de textarea.
6351
- ${data.label ? `O campo tem o label ${data.label}.` : ""}
6352
- ${data.id ? `O campo tem o id ${data.id}.` : ""}
6353
- ${data.placeholder ? `Considere as instruções/sugestões do placeholder: ${data.placeholder}.` : ""}
6354
- Baseie-se no contexto informado pelo usuário: '${context}'.
6355
- O texto deve ser formal e conter informações pertinentes a um campo como este, como se um usuário real tivesse preenchido com as informações necessárias.
6356
- O texto deve ser neutro com relação a generos, raças, religiões, etc.
6357
- O texto deve ser impessoal e não deve conter informações pessoais do usuário.
6358
- Não direcione o texto a ninguém, não use expressões como: caro, atenciosamente. gostaria, agradeço. O texto deve ser genérico.
6359
-
6360
- Exemplos de texto:
6361
- Um campo de descrição de usuário: "Usuário com 20 anos, estudante de engenharia, gosta de jogar futebol e assistir filmes."
6362
- Outro exemplo de descrição de usuário: "Usuário administrador, com acesso total ao sistema, responsável por gerenciar os usuários e os produtos."
6363
- Um campo de descrição de um produto: "O produto é um celular, com tela de 6 polegadas, 128GB de armazenamento, 4GB de memória RAM, câmera de 12MP e bateria de 4000mAh."
6364
- Outro exemplo de descrição de produto: "O produto é uma geladeira, com capacidade de 500 litros, 2 portas, cor branca, com freezer e gaveta de legumes."
6365
- Outro exemplo de descrição de produto: "O produto é uma camiseta, tamanho M, cor azul, 100% algodão, com estampa de um gato."
6366
-
6367
- Em caso de contexto incompleto crie um texto genérico, como se fosse um exemplo de preenchimento do campo.
6368
- O texto é para um campo de textarea, então escreva um texto sucinto.
6369
- Exiba apenas o texto do output`;
6370
- }
6371
- };
6372
- IAssistService.ctorParameters = () => [
6373
- { type: HttpClient },
6374
- { type: MessageService }
6375
- ];
6376
- IAssistService = __decorate([
6377
- Injectable()
6378
- ], IAssistService);
6648
+ ], BooleanSwitchFieldComponent);
6379
6649
 
6380
- let TextAreaIAFieldComponent = class TextAreaIAFieldComponent {
6381
- constructor(_iassistService, _formBuilder, _translateService) {
6382
- this._iassistService = _iassistService;
6383
- this._formBuilder = _formBuilder;
6384
- this._translateService = _translateService;
6385
- this.isVisible = false;
6386
- this.isLoading = false;
6387
- }
6388
- ngOnInit() {
6389
- this._createDialogFields();
6390
- this._createDialogFormGroup();
6391
- }
6392
- showDialog() {
6393
- this.isVisible = true;
6394
- }
6395
- onHideDialog() {
6396
- this.formGroup.get("context").setValue("");
6397
- }
6398
- hideDialog() {
6399
- this.isVisible = false;
6400
- }
6401
- submitContext() {
6402
- const context = this.formGroup.get("context");
6403
- this.isLoading = true;
6404
- this._iassistService.askIA(context.value, {
6405
- id: this.field.id,
6406
- label: this.field.label,
6407
- placeholder: this.field.placeholder,
6408
- })
6409
- .pipe(catchError((err) => {
6410
- this.isLoading = false;
6411
- return throwError(err);
6412
- }))
6413
- .subscribe((res) => {
6414
- this.formControl.setValue(res.text);
6415
- this.isLoading = false;
6416
- });
6417
- this.hideDialog();
6418
- }
6419
- _createDialogFields() {
6420
- this.fields = [
6421
- new FormField({
6422
- name: "context",
6423
- type: FieldType.String,
6424
- label: this._translateService.instant("platform.angular_components.context"),
6425
- size: { sm: 12, md: 12, lg: 12, xl: 12 },
6426
- }),
6427
- ];
6428
- }
6429
- _createDialogFormGroup() {
6430
- this.formGroup = this._formBuilder.group({
6431
- context: [""],
6432
- });
6433
- }
6650
+ let CalendarFieldComponent = class CalendarFieldComponent {
6434
6651
  };
6435
- TextAreaIAFieldComponent.ctorParameters = () => [
6436
- { type: IAssistService },
6437
- { type: FormBuilder },
6438
- { type: TranslateService }
6439
- ];
6440
6652
  __decorate([
6441
6653
  Input()
6442
- ], TextAreaIAFieldComponent.prototype, "field", void 0);
6654
+ ], CalendarFieldComponent.prototype, "field", void 0);
6443
6655
  __decorate([
6444
6656
  Input()
6445
- ], TextAreaIAFieldComponent.prototype, "formControl", void 0);
6446
- TextAreaIAFieldComponent = __decorate([
6657
+ ], CalendarFieldComponent.prototype, "formControl", void 0);
6658
+ __decorate([
6659
+ Input()
6660
+ ], CalendarFieldComponent.prototype, "showTime", void 0);
6661
+ __decorate([
6662
+ Input()
6663
+ ], CalendarFieldComponent.prototype, "timeOnly", void 0);
6664
+ CalendarFieldComponent = __decorate([
6447
6665
  Component({
6448
- template: "<s-loading-state\n [loading]=\"isLoading\"\n [blockWindow]=\"true\"> \n</s-loading-state>\n\n<p-dialog\n [(visible)]=\"isVisible\"\n [modal]=\"true\"\n [style]=\"{ width: '50vw' }\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n (onHide)=\"onHideDialog()\">\n <p-header>\n <div class=\"dialog-header\">\n <span class=\"iassist-icon\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </span>\n {{ 'platform.angular_components.iassist_text_generator' | translate }}\n </div>\n </p-header>\n <s-dynamic-form\n [fields]=\"fields\"\n [form]=\"formGroup\">\n </s-dynamic-form>\n <p-footer>\n <div class=\"footer-content\">\n <s-button\n id=\"-submit-button\"\n type=\"button\"\n [label]=\"'platform.angular_components.generate_text' | translate\"\n (onClick)=\"submitContext()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n showDelay=\"500\">\n </s-button>\n <s-button\n id=\"-cancel-button\"\n type=\"button\"\n priority=\"link\"\n [label]=\"'platform.angular_components.cancel' | translate\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n showDelay=\"500\">\n </s-button>\n </div>\n </p-footer>\n</p-dialog>\n\n<div class=\"textarea-ia\">\n <textarea\n [id]=\"(field.id || field.name)\"\n pInputTextarea\n [rows]=\"field.rows\"\n [cols]=\"field.cols\"\n [formControl]=\"formControl\"\n style=\"resize: vertical;\"\n [ngStyle]=\"field.style\">\n </textarea>\n <button\n class=\"iassist-button\"\n (click)=\"showDialog()\"\n [sTooltip]=\"'platform.angular_components.iassist_text_generator' | translate\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </button>\n</div>\n\n<ng-template #iassistIcon>\n <svg style=\"width: 100%; height: 100%;\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5.81451 18.1054L5.99593 17.6059L7.52166 13.4099L7.60877 13.1726L7.61277 13.1614L7.94285 12.2543L8.01159 12.0648L8.05394 11.949L5.2998 8.52426L5.02726 8.18379C5.00569 8.15821 4.9881 8.13104 4.97292 8.10226C4.90099 7.9632 4.85063 7.81294 4.82186 7.6531C4.73075 7.1344 4.90418 6.60771 5.28382 6.24326C5.29421 6.23447 5.3038 6.22567 5.31419 6.21688L5.47164 6.0914L9.3439 3.00238L9.5469 2.84094L9.57088 2.82096L10.4101 2.15041L11.8007 1.04188C11.2181 0.925188 10.6163 0.863647 10.0001 0.863647C4.95374 0.863647 0.863281 4.9541 0.863281 9.99963C0.863281 13.5346 2.87254 16.5989 5.80971 18.1182\" fill=\"#0FA389\"/>\n <path d=\"M14.099 1.83472L13.9495 2.24632L11.997 7.61074L11.9427 7.7594L11.9003 7.87369L14.7448 11.4103C14.7463 11.4127 14.7479 11.4143 14.7495 11.4167L14.9414 11.654C14.9541 11.67 14.9661 11.6868 14.9765 11.7044C15.0764 11.8698 15.1444 12.0505 15.1779 12.2431C15.273 12.7826 15.0812 13.3284 14.676 13.6897C14.656 13.7129 14.6345 13.7344 14.6105 13.7536L11.8563 15.9507L11.6789 16.0922L11.6022 16.1537L10.7406 16.8402V16.841L10.3937 17.1176L9.85747 17.5452L9.39951 17.9112L8.11035 18.9398C8.72016 19.0677 9.35155 19.1364 9.99973 19.1364C15.0461 19.1364 19.1365 15.046 19.1365 9.99964C19.1365 6.42789 17.0857 3.33727 14.099 1.83472Z\" fill=\"#0FA389\"/>\n <path d=\"M14.7287 12.3222C14.7047 12.1832 14.6551 12.0545 14.5864 11.941L14.3954 11.7036C14.3954 11.7036 14.3946 11.7028 14.3938 11.7028L11.3839 7.96005L10.5031 6.86511L10.4256 6.7676L9.03255 5.03487L8.83674 4.79191C8.79278 4.71678 8.75681 4.63446 8.73204 4.54814C8.72085 4.51058 8.71286 4.47222 8.70566 4.43465C8.68568 4.32196 8.68408 4.21007 8.69847 4.10217L8.62334 4.16291L8.44511 4.30438L5.75731 6.44871L5.60066 6.57339C5.34011 6.82275 5.20584 7.19279 5.27218 7.57482C5.29296 7.68751 5.32892 7.79541 5.37927 7.89292C5.37927 7.89292 5.37927 7.89292 5.38007 7.89371L5.6566 8.23818L8.57139 11.8627L8.63293 11.9394L9.53047 13.0559L9.59041 13.1303L9.98363 13.6186L11.0178 14.9046C11.0186 14.9054 11.0194 14.9069 11.0202 14.9077L11.1361 15.0516V15.0524C11.2184 15.1755 11.2768 15.317 11.3048 15.4728C11.3239 15.5807 11.3263 15.6878 11.3143 15.7925L11.3175 15.7965L11.3943 15.735L11.5717 15.5935L14.3266 13.3964L14.3218 13.3908C14.6335 13.1438 14.8022 12.7394 14.7287 12.3222Z\" fill=\"#F3F3F5\"/>\n <path d=\"M10.6822 15.0082C10.6814 15.0074 10.6806 15.0058 10.6806 15.005L10.5672 14.8643L10.3809 14.6325L10.3282 14.567L10.2211 14.4335L9.40028 13.4129L9.32835 13.3242L8.77289 12.6345L8.68098 12.5194L8.44121 12.2205L8.37168 12.4099L8.04159 13.317L8.0376 13.329L7.95128 13.5664L6.42475 17.7623L6.24333 18.2618L5.90605 19.1881L5.73262 19.6645C5.73182 19.6661 5.73102 19.6677 5.73102 19.6685C5.72863 19.6749 5.72703 19.6821 5.72543 19.6885C5.71584 19.7228 5.71424 19.758 5.72063 19.7948C5.74461 19.929 5.87329 20.0193 6.00836 19.9962C6.04112 19.9898 6.07229 19.9778 6.09867 19.9602C6.09867 19.9602 6.09947 19.9602 6.10027 19.9594L6.14103 19.9266L7.39422 18.9268L9.11496 17.5537L9.57292 17.1877L10.1092 16.7601L10.4561 16.4827L10.4537 16.4811C10.7582 16.2382 10.9236 15.8402 10.8509 15.4294C10.8237 15.2735 10.7654 15.1313 10.6822 15.0082Z\" fill=\"#0C847B\"/>\n <path d=\"M9.17644 4.56325C9.2124 4.68713 9.26915 4.80062 9.34268 4.90053C9.34348 4.90053 9.34428 4.90213 9.34428 4.90213L9.40342 4.97645C9.40502 4.97805 9.40582 4.97885 9.40662 4.98045L9.56806 5.17946L9.64878 5.28096L9.67915 5.31932L9.8414 5.51993L10.5559 6.40947L10.7054 6.59569L11.2169 7.23188L11.5142 7.60192L11.5693 7.45247L13.5202 2.08964L14.1596 0.332135C14.1596 0.330536 14.1604 0.328139 14.1612 0.32654C14.174 0.288177 14.1772 0.246617 14.17 0.205058C14.1468 0.0699879 14.0182 -0.0195258 13.8823 0.00365186C13.8407 0.0116442 13.8024 0.028428 13.7712 0.0540033L12.578 1.00589L12.498 1.06982L10.6958 2.50844L9.85658 3.17819L9.8326 3.19737L9.6296 3.35961L9.45297 3.50028C9.2116 3.73925 9.08692 4.08931 9.15006 4.44976C9.15726 4.48813 9.16525 4.52649 9.17644 4.56325Z\" fill=\"#0C847B\"/>\n </svg>\n</ng-template>",
6449
- styles: [".footer-content{display:-ms-flexbox;display:flex;-ms-flex-positive:0;flex-grow:0}.textarea-ia{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;gap:8px}.iassist-button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border:none;border-radius:50%;box-shadow:none;cursor:pointer;height:32px;width:32px}.dialog-header{display:-ms-flexbox;display:flex;gap:12px}.dialog-header .iassist-icon{display:block;height:24px;width:24px}"]
6666
+ template: "<div\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\">\n <!-- Remover as propriedades [showTransitionOptions] e [hideTransitionOptions] quando atualizar para o PrimeNG v10, esses atributos foram\n usados para remover um bug ocasionado pela anima\u00E7\u00E3o do componente p-calendar, bug explicado nas issues: #ERPROM-5534, #ERPROM-8248 e #DSN-1045. -->\n <p-calendar\n #calendar\n sCalendarMask\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [showIcon]=\"true\"\n [timeOnly]=\"timeOnly\"\n [selectionMode]=\"field.selectionMode\"\n [rangeSeparator]=\"field.rangeSeparator\"\n [showTime]=\"showTime\"\n [showSeconds]=\"field.showSeconds\"\n [showOnFocus]=\"field.showOnFocus\"\n [formControl]=\"formControl\"\n [icon]=\"timeOnly ? 'fa fa-clock' : 'fa fa-calendar'\"\n [minDate]=\"field.minDate\"\n [maxDate]=\"field.maxDate\"\n [defaultDate]=\"field.defaultDate\"\n [locale]=\"field.calendarLocaleOptions\"\n [dateFormat]=\"field.calendarLocaleOptions.dateFormat\"\n [hourFormat]=\"field.calendarLocaleOptions.hourFormat\"\n [view]=\"field.view\"\n [placeholder]=\"field.placeholder\"\n inputStyleClass=\"mousetrap\"\n [appendTo]=\"field.appendTo\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event): null\"\n (onSelect)=\"field.onSelect ? field.onSelect($event) : null\"\n (onClose)=\"field.onClose ? field.onClose($event) : null\"\n (onTodayClick)=\"field.onTodayClick ? field.onTodayClick($event) : null\"\n (onClearClick)=\"field.onClearClick ? field.onClearClick($event) : null\"\n (onMonthChange)=\"field.onMonthChange ? field.onMonthChange($event) : null\"\n (onYearChange)=\"field.onYearChange ? field.onYearChange($event) : null\"\n [showTransitionOptions]=\"'0ms'\"\n [hideTransitionOptions]=\"'0ms'\">\n </p-calendar>\n</div>\n"
6450
6667
  })
6451
- ], TextAreaIAFieldComponent);
6668
+ ], CalendarFieldComponent);
6452
6669
 
6453
- let TextFieldComponent = class TextFieldComponent extends BaseFieldComponent {
6454
- constructor() {
6455
- super(...arguments);
6456
- this.onInput = new EventEmitter();
6457
- this.onFocus = new EventEmitter();
6458
- this.onComplete = new EventEmitter();
6459
- this.ngUnsubscribe = new Subject();
6460
- }
6461
- ngOnInit() {
6462
- this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
6463
- if (this.field.onFocus)
6464
- this.field.onFocus(event);
6465
- });
6466
- this.onInput.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
6467
- if (this.field.onInput)
6468
- this.field.onInput(event);
6469
- });
6470
- this.onComplete.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
6471
- if (this.field.onComplete)
6472
- this.field.onComplete(event);
6473
- });
6670
+ let ChipsFieldComponent = class ChipsFieldComponent {
6671
+ constructor(clipboard) {
6672
+ this.clipboard = clipboard;
6673
+ this.feedbackMessageVisible = false;
6674
+ this.copyButtonVisible = true;
6474
6675
  }
6475
- ngOnDestroy() {
6476
- this.ngUnsubscribe.next();
6477
- this.ngUnsubscribe.complete();
6676
+ onCopyFieldContent() {
6677
+ if (this.formControl.value) {
6678
+ this.copyButtonVisible = false;
6679
+ this.feedbackMessageVisible = true;
6680
+ setTimeout(() => {
6681
+ this.feedbackMessageVisible = false;
6682
+ this.copyButtonVisible = true;
6683
+ }, 3000);
6684
+ const content = this.formControl.value.join(this.field.separator || "\n");
6685
+ this.clipboard.copy(content);
6686
+ if (this.field.onCopy) {
6687
+ this.field.onCopy(content);
6688
+ }
6689
+ }
6478
6690
  }
6479
6691
  };
6692
+ ChipsFieldComponent.ctorParameters = () => [
6693
+ { type: Clipboard }
6694
+ ];
6480
6695
  __decorate([
6481
- Input()
6482
- ], TextFieldComponent.prototype, "field", void 0);
6483
- __decorate([
6484
- Input()
6485
- ], TextFieldComponent.prototype, "formControl", void 0);
6486
- __decorate([
6487
- Output()
6488
- ], TextFieldComponent.prototype, "onInput", void 0);
6489
- __decorate([
6490
- Output()
6491
- ], TextFieldComponent.prototype, "onFocus", void 0);
6696
+ Input()
6697
+ ], ChipsFieldComponent.prototype, "field", void 0);
6492
6698
  __decorate([
6493
- Output()
6494
- ], TextFieldComponent.prototype, "onComplete", void 0);
6495
- TextFieldComponent = __decorate([
6699
+ Input()
6700
+ ], ChipsFieldComponent.prototype, "formControl", void 0);
6701
+ ChipsFieldComponent = __decorate([
6496
6702
  Component({
6497
- template: "<p-inputMask\n *ngIf=\"field.mask; else noMask\"\n [type]=\"field.inputType || 'text'\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [mask]=\"isFunction(field.mask) ? field.mask() : field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"onFocus.next($event)\"\n (onComplete)=\"onComplete.next($event)\"\n (onInput)=\"onInput.next($event)\"\n [formControl]=\"formControl\">\n</p-inputMask>\n<ng-template #noMask>\n <ng-container>\n <div class=\"ui-inputgroup\">\n <ng-container *ngIf=\"field.leftAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.leftAddon.label\">{{field.leftAddon.label}}</span>\n <span *ngIf=\"!field.leftAddon.label\" [ngClass]=\"field.leftAddon.icon\"></span>\n </span>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"field.keyFilter ? inputKeyFilter : input\"></ng-container>\n <ng-container *ngIf=\"field.rightAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.rightAddon.label\">{{field.rightAddon.label}}</span>\n <span *ngIf=\"!field.rightAddon.label\" [ngClass]=\"field.rightAddon.icon\"></span>\n </span>\n </ng-container>\n </div>\n </ng-container>\n</ng-template>\n<ng-template #input>\n <input\n [type]=\"field.inputType || 'text'\"\n [id]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n [maxLength]=\"field.maxLength\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n (input)=\"onInput.next($event)\"\n [formControl]=\"formControl\"\n [ngStyle]=\"field.style\" />\n</ng-template>\n<ng-template #inputKeyFilter>\n <input\n #inputText\n [type]=\"field.inputType || 'text'\"\n [id]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n [maxLength]=\"field.maxLength\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n (input)=\"onInput.next($event)\"\n [pKeyFilter]=\"field.keyFilter\"\n [formControl]=\"formControl\"\n [ngStyle]=\"field.style\" />\n</ng-template>\n",
6498
- encapsulation: ViewEncapsulation.None,
6499
- styles: ["s-text-field.ng-dirty.ng-invalid .ui-inputtext{border-color:#c13018}s-text-field.ng-dirty.ng-invalid .ui-inputtext:hover{border-color:#e44328}"]
6703
+ template: "<div class=\"chips-field-wrapper\">\n <div style=\"width: 100%;\">\n <p-chips\n *ngIf=\"field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [pKeyFilter]=\"field.keyFilter\">\n <ng-template let-item pTemplate=\"item\">\n <span\n class=\"chip-content\"\n [sTooltip]=\"item\">\n {{ item }}\n </span>\n </ng-template>\n </p-chips>\n \n <p-chips\n *ngIf=\"!field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n <ng-template let-item pTemplate=\"item\">\n <span\n class=\"chip-content\"\n [sTooltip]=\"item\">\n {{ item }}\n </span>\n </ng-template>\n </p-chips>\n </div>\n \n <button\n *ngIf=\"field.showCopyButton && formControl.value?.length > 0 && copyButtonVisible\"\n class=\"copy-content-button\"\n (click)=\"onCopyFieldContent()\">\n {{ \"platform.angular_components.copy_field_content\" | translate }}\n </button>\n \n <span\n *ngIf=\"feedbackMessageVisible\"\n class=\"feedback-message\">\n {{ \"platform.angular_components.copied_to_clipboard\" | translate }}\n </span>\n</div>\n",
6704
+ styles: [".chips-field-wrapper{-ms-flex-align:start;align-items:flex-start;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.chips-field-wrapper .chip-content{display:block;overflow:hidden;padding-right:1rem;text-overflow:ellipsis}.chips-field-wrapper .copy-content-button{background-color:transparent;border:none;color:#2a6496;cursor:pointer;margin-top:8px}.chips-field-wrapper .feedback-message{color:#0c9348;display:block;margin-top:8px;-webkit-user-select:none;-ms-user-select:none;user-select:none}"]
6500
6705
  })
6501
- ], TextFieldComponent);
6706
+ ], ChipsFieldComponent);
6502
6707
 
6503
- let RowComponent = class RowComponent {
6504
- constructor() { }
6505
- ngOnInit() { }
6506
- getErrorMessages(errorMessages) {
6507
- if (errorMessages)
6508
- return this.isFunction(errorMessages) ? errorMessages() : errorMessages;
6509
- return this.errorMessages;
6510
- }
6511
- isFunction(value) {
6512
- return value instanceof Function;
6513
- }
6708
+ let CountryPhonePickerFieldComponent = class CountryPhonePickerFieldComponent {
6514
6709
  };
6515
6710
  __decorate([
6516
6711
  Input()
6517
- ], RowComponent.prototype, "id", void 0);
6712
+ ], CountryPhonePickerFieldComponent.prototype, "field", void 0);
6518
6713
  __decorate([
6519
6714
  Input()
6520
- ], RowComponent.prototype, "config", void 0);
6715
+ ], CountryPhonePickerFieldComponent.prototype, "formControl", void 0);
6716
+ CountryPhonePickerFieldComponent = __decorate([
6717
+ Component({
6718
+ template: "<s-country-phone-picker\n [formControl]=\"formControl\"\n [ordination]=\"field.ordination\"\n [countries]=\"field.countries\"\n (selected)=\"field.onSelected\"\n (focusLost)=\"field.onFocusLost\">\n</s-country-phone-picker>"
6719
+ })
6720
+ ], CountryPhonePickerFieldComponent);
6721
+
6722
+ /**
6723
+ * @deprecated Should use bignumber instead
6724
+ */
6725
+ let CurrencyFieldComponent = class CurrencyFieldComponent extends BaseFieldComponent {
6726
+ };
6521
6727
  __decorate([
6522
6728
  Input()
6523
- ], RowComponent.prototype, "group", void 0);
6729
+ ], CurrencyFieldComponent.prototype, "field", void 0);
6524
6730
  __decorate([
6525
6731
  Input()
6526
- ], RowComponent.prototype, "errorMessages", void 0);
6527
- RowComponent = __decorate([
6732
+ ], CurrencyFieldComponent.prototype, "formControl", void 0);
6733
+ CurrencyFieldComponent = __decorate([
6528
6734
  Component({
6529
- template: `
6530
- <div class="ui-fluid" [formGroup]="group">
6531
- <div class="ui-g">
6532
- <ng-container *ngFor="let field of config.fields">
6533
- <div [ngClass]="field.gridClass" *ngIf="field.visible()">
6534
- <label
6535
- [for]="field.name"
6536
- [ngClass]="{ 'required': field.required() }"
6537
- *sInfoSign="field.infoSign"
6538
- >
6539
- {{ field.label }}
6540
- </label>
6541
- <ng-container *sDynamicForm="{ id: id, config: field, group: group}"></ng-container>
6542
- <s-control-errors [form]="group" [control]="group.controls[field.name]"
6543
- [errorMessages]="getErrorMessages(field.errorMessages)"></s-control-errors>
6544
- <ng-template *ngIf="field?.bottomTemplate" [ngTemplateOutlet]="field.bottomTemplate"></ng-template>
6545
- </div>
6546
- </ng-container>
6547
- </div>
6548
- `
6735
+ template: "<div class=\"ui-inputgroup\">\n <span\n *ngIf=\"field.numberLocaleOptions.currencySymbol\"\n class=\"ui-inputgroup-addon\">\n {{ field.numberLocaleOptions.currencySymbol }}\n </span>\n <input\n *ngIf=\"!field.mask\"\n type=\"text\"\n [id]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [formControl]=\"formControl\"\n sNumberInput\n [precision]=\"isFunction(field.precision) ? trigger(field.precision) : field.precision\"\n [scale]=\"isFunction(field.scale) ? trigger(field.scale) : field.scale\"\n [decimalSeparator]=\"field.numberLocaleOptions.decimalSeparator\"\n [thousandsSeparator]=\"field.numberLocaleOptions.thousandsSeparator\"\n [alignTo]=\"field.alignTo\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"field.onFocus ? field.onFocus($event): null\" />\n <p-inputMask\n *ngIf=\"field.mask\"\n type=\"text\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [formControl]=\"formControl\"\n [mask]=\"field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event): null\"\n (onComplete)=\"field.onComplete ? field.onComplete($event) : null\"\n (onInput)=\"field.onInput ? field.onInput($event) : null\" >\n </p-inputMask>\n</div>\n"
6549
6736
  })
6550
- ], RowComponent);
6737
+ ], CurrencyFieldComponent);
6551
6738
 
6552
6739
  let FieldsetComponent = class FieldsetComponent {
6553
6740
  };
@@ -6578,76 +6765,35 @@ FieldsetComponent = __decorate([
6578
6765
  })
6579
6766
  ], FieldsetComponent);
6580
6767
 
6581
- let SectionComponent = class SectionComponent {
6768
+ let FileUploadComponent$1 = class FileUploadComponent extends BaseFieldComponent {
6582
6769
  };
6583
6770
  __decorate([
6584
6771
  Input()
6585
- ], SectionComponent.prototype, "id", void 0);
6586
- __decorate([
6587
- Input()
6588
- ], SectionComponent.prototype, "config", void 0);
6589
- __decorate([
6590
- Input()
6591
- ], SectionComponent.prototype, "group", void 0);
6772
+ ], FileUploadComponent$1.prototype, "field", void 0);
6592
6773
  __decorate([
6593
6774
  Input()
6594
- ], SectionComponent.prototype, "errorMessages", void 0);
6595
- SectionComponent = __decorate([
6775
+ ], FileUploadComponent$1.prototype, "formControl", void 0);
6776
+ FileUploadComponent$1 = __decorate([
6596
6777
  Component({
6597
- template: `
6598
- <h3 *ngIf="config?.header" class="sds-section-title">{{config.header}}</h3>
6599
- <ng-container *ngFor="let conf of config.configs">
6600
- <ng-container *sDynamicForm="{ id: id, config: conf, group: group, errorMessages: errorMessages }"></ng-container>
6601
- </ng-container>
6602
- `
6778
+ template: "<s-file-upload [id]=\"(field.id || field.name)\" [accept]=\"field.accept\" [files]=\"field.files\" [multiple]=\"field.multiple\"\n [chooseLabel]=\"field.chooseLabel\" [removeLabel]=\"field.removeLabel\" [cancelLabel]=\"field.cancelLabel\"\n [successTooltip]=\"field.successTooltip\" (uploadHandler)=\"field.onUploadFile($event, field)\"\n (removeFile)=\"field.onRemoveFile($event, field)\" (cancelUpload)=\"field.onCancelUpload($event, field)\"\n (downloadFile)=\"field.onDownloadFile($event, field)\" [formGroup]=\"formControl\"\n [showFileUploadDate]=\"field.showFileUploadDate\"> \n</s-file-upload>\n"
6603
6779
  })
6604
- ], SectionComponent);
6780
+ ], FileUploadComponent$1);
6605
6781
 
6606
- let DynamicFieldComponent = class DynamicFieldComponent {
6607
- getErrorMessages(errorMessages) {
6608
- if (errorMessages)
6609
- return this.isFunction(errorMessages)
6610
- ? Object.assign(Object.assign({}, this.errorMessages), errorMessages()) : Object.assign(Object.assign({}, this.errorMessages), errorMessages);
6611
- return this.errorMessages;
6612
- }
6613
- isFunction(value) {
6614
- return value instanceof Function;
6615
- }
6782
+ let LookupFieldComponent = class LookupFieldComponent {
6616
6783
  };
6617
6784
  __decorate([
6618
6785
  Input()
6619
- ], DynamicFieldComponent.prototype, "id", void 0);
6620
- __decorate([
6621
- Input()
6622
- ], DynamicFieldComponent.prototype, "fields", void 0);
6623
- __decorate([
6624
- Input()
6625
- ], DynamicFieldComponent.prototype, "form", void 0);
6626
- __decorate([
6627
- Input()
6628
- ], DynamicFieldComponent.prototype, "errorMessages", void 0);
6786
+ ], LookupFieldComponent.prototype, "field", void 0);
6629
6787
  __decorate([
6630
6788
  Input()
6631
- ], DynamicFieldComponent.prototype, "displayTimeInfoSign", void 0);
6632
- DynamicFieldComponent = __decorate([
6789
+ ], LookupFieldComponent.prototype, "formControl", void 0);
6790
+ LookupFieldComponent = __decorate([
6633
6791
  Component({
6634
- selector: "s-dynamic-field",
6635
- template: "<div class=\"ui-fluid\" [formGroup]=\"form\">\n <div class=\"ui-g\">\n <ng-container *ngFor=\"let field of fields\">\n <div\n *ngIf=\"!field.visible || field.visible()\"\n [ngClass]=\"field.gridClass\">\n <span *ngIf=\"field.label\">\n <label\n *sInfoSign=\"field.infoSign; displayTime: displayTimeInfoSign\"\n [for]=\"field.name\"\n [ngClass]=\"{ 'required': field.required() }\">\n {{ field.label }}\n </label>\n </span>\n <ng-container *sDynamicForm=\"{\n id: id,\n config: field,\n group: form\n }\">\n </ng-container>\n <s-control-errors\n [form]=\"form\"\n [control]=\"form.controls[field.name]\"\n [errorMessages]=\"getErrorMessages(field.errorMessages)\">\n </s-control-errors>\n <ng-template\n *ngIf=\"field?.bottomTemplate\"\n [ngTemplateOutlet]=\"field.bottomTemplate\">\n </ng-template>\n </div>\n </ng-container>\n </div>\n</div>"
6792
+ template: "<div\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\">\n <s-lookup\n [id]=\"(field.id || field.name)\"\n [multiple]=\"field.multiple\"\n [formControl]=\"formControl\"\n [lookupSuggestions]=\"field.lookupSuggestions\"\n [dataKey]=\"field.dataKey\"\n [placeholder]=\"field.placeholder\"\n [searchFields]=\"field.searchFields\"\n [searchGridFields]=\"field.searchGridFields\"\n [searchGridData]=\"field.gridData\"\n (onLookupRequest)=\"field.onLookupRequest($event)\"\n (onSearchRequest)=\"field.onSearchRequest($event)\"\n [lookupDisplayField]=\"field.lookupDisplayField\"\n [searchTotalRecords]=\"field.searchTotalRecords\"\n [searchTotalRecordsLabel]=\"field.searchTotalRecordsLabel\"\n [searchTitle]=\"field.searchTitle\"\n [selectLabel]=\"field.selectLabel\"\n [searchEmptyTitle]=\"field.searchEmptyTitle\"\n [filterLabel]=\"field.filterLabel\"\n [filterTitle]=\"field.filterTitle\"\n [clearLabel]=\"field.clearLabel\"\n [cancelLabel]=\"field.cancelLabel\"\n [emptyFieldLabel]=\"field.emptyFieldLabel \"\n (onSelect)=\"field.onSelect($event)\"\n (onUnselect)=\"field.onUnselect($event)\"\n (onClear)=\"field.onClear ? field.onClear($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [lookupAppendTo]=\"field.appendTo\"\n [lookupEmptyMessage]=\"field.emptyMessage\"\n [recordLabel]=\"field.recordLabel\"\n [recordsLabel]=\"field.recordsLabel\"\n [defaultFilter]=\"field.defaultFilter\"\n [autocompleteForceSelection]=\"field.autocompleteForceSelection\">\n </s-lookup>\n</div>\n"
6636
6793
  })
6637
- ], DynamicFieldComponent);
6638
-
6639
- var GridType;
6640
- (function (GridType) {
6641
- GridType["Row"] = "Row";
6642
- })(GridType || (GridType = {}));
6643
-
6644
- var StructureType;
6645
- (function (StructureType) {
6646
- StructureType["Fieldset"] = "Fieldset";
6647
- StructureType["Section"] = "Section";
6648
- })(StructureType || (StructureType = {}));
6794
+ ], LookupFieldComponent);
6649
6795
 
6650
- let BignumberFieldComponent = class BignumberFieldComponent extends BaseFieldComponent {
6796
+ let NumberFieldComponent = class NumberFieldComponent extends BaseFieldComponent {
6651
6797
  constructor() {
6652
6798
  super(...arguments);
6653
6799
  this.onInput = new EventEmitter();
@@ -6656,72 +6802,52 @@ let BignumberFieldComponent = class BignumberFieldComponent extends BaseFieldCom
6656
6802
  this.ngUnsubscribe = new Subject();
6657
6803
  }
6658
6804
  ngOnInit() {
6659
- this.onFocus
6660
- .pipe(takeUntil(this.ngUnsubscribe))
6661
- .subscribe((event) => {
6662
- if (this.field.onFocus) {
6805
+ this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
6806
+ if (this.field.onFocus)
6663
6807
  this.field.onFocus(event);
6664
- }
6665
6808
  });
6666
- this.onInput
6667
- .pipe(takeUntil(this.ngUnsubscribe))
6668
- .subscribe((event) => {
6669
- if (this.field.onInput) {
6809
+ this.onInput.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
6810
+ if (this.field.onInput)
6670
6811
  this.field.onInput(event);
6671
- }
6672
6812
  });
6673
- this.onComplete
6674
- .pipe(takeUntil(this.ngUnsubscribe))
6675
- .subscribe((event) => {
6676
- if (this.field.onComplete) {
6813
+ this.onComplete.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
6814
+ if (this.field.onComplete)
6677
6815
  this.field.onComplete(event);
6678
- }
6679
6816
  });
6680
6817
  }
6681
6818
  ngOnDestroy() {
6682
6819
  this.ngUnsubscribe.next();
6683
6820
  this.ngUnsubscribe.complete();
6684
6821
  }
6822
+ get numberAlignmentOption() {
6823
+ return NumberAlignmentOption;
6824
+ }
6685
6825
  get fieldType() {
6686
6826
  return FieldType;
6687
6827
  }
6688
6828
  };
6689
6829
  __decorate([
6690
6830
  Input()
6691
- ], BignumberFieldComponent.prototype, "field", void 0);
6831
+ ], NumberFieldComponent.prototype, "field", void 0);
6692
6832
  __decorate([
6693
6833
  Input()
6694
- ], BignumberFieldComponent.prototype, "formControl", void 0);
6834
+ ], NumberFieldComponent.prototype, "formControl", void 0);
6695
6835
  __decorate([
6696
6836
  Output()
6697
- ], BignumberFieldComponent.prototype, "onInput", void 0);
6837
+ ], NumberFieldComponent.prototype, "onInput", void 0);
6698
6838
  __decorate([
6699
6839
  Output()
6700
- ], BignumberFieldComponent.prototype, "onFocus", void 0);
6840
+ ], NumberFieldComponent.prototype, "onFocus", void 0);
6701
6841
  __decorate([
6702
6842
  Output()
6703
- ], BignumberFieldComponent.prototype, "onComplete", void 0);
6704
- BignumberFieldComponent = __decorate([
6843
+ ], NumberFieldComponent.prototype, "onComplete", void 0);
6844
+ NumberFieldComponent = __decorate([
6705
6845
  Component({
6706
- template: "<p-inputMask\n *ngIf=\"field.mask; else noMask\"\n type=\"text\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [mask]=\"isFunction(field.mask) ? field.mask() : field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"onFocus.next($event)\"\n (onComplete)=\"onComplete.next($event)\"\n (onInput)=\"onInput.next($event)\"\n [formControl]=\"formControl\"\n [autoClear]=\"field.autoClear\">\n</p-inputMask>\n\n<ng-template #noMask>\n <ng-container>\n <div class=\"ui-inputgroup\">\n <ng-container *ngIf=\"field.leftAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.leftAddon.label\">{{field.leftAddon.label}}</span>\n <span *ngIf=\"!field.leftAddon.label\" [ngClass]=\"field.leftAddon.icon\"></span>\n </span>\n </ng-container>\n\n <input\n [id]=\"(field.id || field.name)\"\n type=\"text\"\n [name]=\"field.name\"\n sBignumberInput\n [allowNegative]=\"field.allowNegative\"\n [precision]=\"isFunction(field.precision) ? trigger(field.precision) : field.precision\"\n [scale]=\"isFunction(field.scale) ? trigger(field.scale) : field.scale\"\n [decimalSeparator]=\"field.numberLocaleOptions.decimalSeparator\"\n [thousandsSeparator]=\"field.numberLocaleOptions.thousandsSeparator\"\n [alignTo]=\"field.alignTo\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n [formControl]=\"formControl\" />\n <ng-container *ngIf=\"field.rightAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.rightAddon.label\">{{field.rightAddon.label}}</span>\n <span *ngIf=\"!field.rightAddon.label\" [ngClass]=\"field.rightAddon.icon\"></span>\n </span>\n </ng-container>\n </div>\n </ng-container>\n</ng-template>\n",
6846
+ template: "<p-inputMask\n *ngIf=\"field.mask; else noMask\"\n type=\"text\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [mask]=\"isFunction(field.mask) ? field.mask() : field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"onFocus.next($event)\"\n (onComplete)=\"onComplete.next($event)\"\n (onInput)=\"onInput.next($event)\"\n [formControl]=\"formControl\" >\n</p-inputMask>\n<ng-template #noMask>\n <ng-container>\n <div class=\"ui-inputgroup\">\n <ng-container *ngIf=\"field.leftAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.leftAddon.label\">{{field.leftAddon.label}}</span>\n <span *ngIf=\"!field.leftAddon.label\" [ngClass]=\"field.leftAddon.icon\"></span>\n </span>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"field.type === fieldType.Double && field.alignTo === numberAlignmentOption.LEFT ? localizedNumber : input\"></ng-container>\n\n <ng-container *ngIf=\"field.rightAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.rightAddon.label\">{{field.rightAddon.label}}</span>\n <span *ngIf=\"!field.rightAddon.label\" [ngClass]=\"field.rightAddon.icon\"></span>\n </span>\n </ng-container>\n </div>\n </ng-container>\n</ng-template>\n<ng-template #input>\n <input\n [id]=\"(field.id || field.name)\"\n type=\"text\"\n [name]=\"field.name\"\n sNumberInput\n [precision]=\"isFunction(field.precision) ? trigger(field.precision) : field.precision\"\n [scale]=\"isFunction(field.scale) ? trigger(field.scale) : field.scale\"\n [decimalSeparator]=\"field.numberLocaleOptions.decimalSeparator\"\n [thousandsSeparator]=\"field.numberLocaleOptions.thousandsSeparator\"\n [alignTo]=\"field.alignTo\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n [formControl]=\"formControl\" />\n</ng-template>\n<ng-template #localizedNumber>\n <input\n [id]=\"(field.id || field.name)\"\n type=\"text\"\n [name]=\"field.name\"\n sLocalizedNumberInput\n [precision]=\"isFunction(field.precision) ? trigger(field.precision) : field.precision\"\n [decimalSeparator]=\"field.numberLocaleOptions.decimalSeparator\"\n [thousandsSeparator]=\"field.numberLocaleOptions.thousandsSeparator\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n [formControl]=\"formControl\" />\n</ng-template>\n",
6707
6847
  encapsulation: ViewEncapsulation.None,
6708
6848
  styles: ["s-number-field.ng-dirty.ng-invalid .ui-inputtext{border-color:#c13018}s-number-field.ng-dirty.ng-invalid .ui-inputtext:hover{border-color:#e44328}"]
6709
6849
  })
6710
- ], BignumberFieldComponent);
6711
-
6712
- let BooleanSwitchFieldComponent = class BooleanSwitchFieldComponent {
6713
- };
6714
- __decorate([
6715
- Input()
6716
- ], BooleanSwitchFieldComponent.prototype, "field", void 0);
6717
- __decorate([
6718
- Input()
6719
- ], BooleanSwitchFieldComponent.prototype, "formControl", void 0);
6720
- BooleanSwitchFieldComponent = __decorate([
6721
- Component({
6722
- template: "<div class=\"ui-grid ui-grid-responsive ui-grid-pad ui-fluid\">\n <div class=\"ui-grid-row\">\n <div class=\"i-grid-col-1\">\n <s-switch\n [id]=\"(field.id || field.name)\"\n [inputName]=\"field.name\"\n [formControl]=\"formControl\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n (valueChanged)=\"field.onChange ? field.onChange($event) : null\">\n </s-switch>\n </div>\n <div class=\"i-grid-col-1\" *ngIf=\"field.optionsLabel\">\n <ng-container *ngIf=\"formControl.value; else caseFalse\">\n <span>{{ field.optionsLabel.true }}</span>\n </ng-container>\n <ng-template #caseFalse>\n <span>{{ field.optionsLabel.false }}</span>\n </ng-template>\n </div>\n </div>\n</div>"
6723
- })
6724
- ], BooleanSwitchFieldComponent);
6850
+ ], NumberFieldComponent);
6725
6851
 
6726
6852
  let PasswordFieldComponent = class PasswordFieldComponent {
6727
6853
  constructor() {
@@ -6760,26 +6886,113 @@ let PasswordFieldComponent = class PasswordFieldComponent {
6760
6886
  };
6761
6887
  __decorate([
6762
6888
  Input()
6763
- ], PasswordFieldComponent.prototype, "field", void 0);
6889
+ ], PasswordFieldComponent.prototype, "field", void 0);
6890
+ __decorate([
6891
+ Input()
6892
+ ], PasswordFieldComponent.prototype, "formControl", void 0);
6893
+ __decorate([
6894
+ Output()
6895
+ ], PasswordFieldComponent.prototype, "onInput", void 0);
6896
+ __decorate([
6897
+ Output()
6898
+ ], PasswordFieldComponent.prototype, "onFocus", void 0);
6899
+ __decorate([
6900
+ Output()
6901
+ ], PasswordFieldComponent.prototype, "onComplete", void 0);
6902
+ PasswordFieldComponent = __decorate([
6903
+ Component({
6904
+ template: "<input\n type=\"password\"\n [id]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n [maxLength]=\"field.maxLength\"\n pInputText\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n (input)=\"onInput.next($event)\"\n [formControl]=\"formControl\"\n [ngStyle]=\"field.style\"\n [sPasswordStrength]=\"field.passwordStrength\"\n [psDescription]=\"field.passwordStrengthOptions?.description\"\n [psWeakTitle]=\"field.passwordStrengthOptions?.weakTitle\"\n [psMediumTitle]=\"field.passwordStrengthOptions?.mediumTitle\"\n [psStrongTitle]=\"field.passwordStrengthOptions?.strongTitle\"\n [psValidation]=\"field.passwordStrengthOptions?.validation\" />",
6905
+ encapsulation: ViewEncapsulation.None,
6906
+ styles: ["s-text-field.ng-dirty.ng-invalid .ui-inputtext{border-color:#c13018}s-text-field.ng-dirty.ng-invalid .ui-inputtext:hover{border-color:#e44328}"]
6907
+ })
6908
+ ], PasswordFieldComponent);
6909
+
6910
+ let RadioButtonComponent = class RadioButtonComponent {
6911
+ constructor() {
6912
+ this.onClick = new EventEmitter();
6913
+ this.onFocus = new EventEmitter();
6914
+ this.ngUnsubscribe = new Subject();
6915
+ }
6916
+ ngOnInit() {
6917
+ this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
6918
+ if (this.field.onFocus)
6919
+ this.field.onFocus(event);
6920
+ });
6921
+ this.onClick.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
6922
+ if (this.field.onClick)
6923
+ this.field.onClick(event);
6924
+ });
6925
+ }
6926
+ ngOnDestroy() {
6927
+ this.ngUnsubscribe.next();
6928
+ this.ngUnsubscribe.complete();
6929
+ }
6930
+ onClear() {
6931
+ this.formControl.reset();
6932
+ }
6933
+ };
6934
+ __decorate([
6935
+ Input()
6936
+ ], RadioButtonComponent.prototype, "field", void 0);
6937
+ __decorate([
6938
+ Input()
6939
+ ], RadioButtonComponent.prototype, "formControl", void 0);
6940
+ __decorate([
6941
+ Output()
6942
+ ], RadioButtonComponent.prototype, "onClick", void 0);
6943
+ __decorate([
6944
+ Output()
6945
+ ], RadioButtonComponent.prototype, "onFocus", void 0);
6946
+ RadioButtonComponent = __decorate([
6947
+ Component({
6948
+ template: "<ng-container *ngIf=\"field.verticalAlignment;else horizontalAlignment\">\n <div class=\"ui-g\">\n <div\n *ngFor=\"let option of field.options; let i = index\"\n class=\"ui-g-12\">\n <ng-container\n [ngTemplateOutlet]=\"radioButton\"\n [ngTemplateOutletContext]=\"{option: option, index: i}\">\n </ng-container>\n </div>\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n [label]=\"field.clearLabel || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n </div>\n</ng-container>\n\n<ng-template #horizontalAlignment>\n <div class=\"ui-g\">\n <ng-container\n *ngFor=\"let option of field.options; let i = index\"\n [ngTemplateOutlet]=\"radioButton\"\n [ngTemplateOutletContext]=\"{option: option, index: i}\">\n </ng-container>\n </div>\n <s-button\n *ngIf=\"field.showClear && !field.required() && !formControl.disabled\"\n class=\"horizontal-clear-option\"\n [label]=\"field.clearLabel || 'Clear selection'\"\n (onClick)=\"onClear()\"\n priority=\"link\">\n </s-button>\n</ng-template>\n\n<ng-template #radioButton let-option=\"option\" let-i=\"index\">\n <p-radioButton\n [name]=\"field.name\"\n [value]=\"option.value\"\n [label]=\"option.label\"\n [formControl]=\"formControl\"\n [inputId]=\"(field.id || field.name) + '-' + i\"\n [sTooltip]=\"field.tooltip\"\n (onClick)=\"onClick.next($event)\"\n (onFocus)=\"onFocus.next($event)\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n </p-radioButton>\n</ng-template>\n",
6949
+ encapsulation: ViewEncapsulation.None,
6950
+ styles: [`
6951
+ s-button.horizontal-clear-option button {
6952
+ width: min-content !important;
6953
+ }
6954
+ `]
6955
+ })
6956
+ ], RadioButtonComponent);
6957
+
6958
+ let SectionComponent = class SectionComponent {
6959
+ };
6960
+ __decorate([
6961
+ Input()
6962
+ ], SectionComponent.prototype, "id", void 0);
6764
6963
  __decorate([
6765
6964
  Input()
6766
- ], PasswordFieldComponent.prototype, "formControl", void 0);
6965
+ ], SectionComponent.prototype, "config", void 0);
6767
6966
  __decorate([
6768
- Output()
6769
- ], PasswordFieldComponent.prototype, "onInput", void 0);
6967
+ Input()
6968
+ ], SectionComponent.prototype, "group", void 0);
6770
6969
  __decorate([
6771
- Output()
6772
- ], PasswordFieldComponent.prototype, "onFocus", void 0);
6970
+ Input()
6971
+ ], SectionComponent.prototype, "errorMessages", void 0);
6972
+ SectionComponent = __decorate([
6973
+ Component({
6974
+ template: `
6975
+ <h3 *ngIf="config?.header" class="sds-section-title">{{config.header}}</h3>
6976
+ <ng-container *ngFor="let conf of config.configs">
6977
+ <ng-container *sDynamicForm="{ id: id, config: conf, group: group, errorMessages: errorMessages }"></ng-container>
6978
+ </ng-container>
6979
+ `
6980
+ })
6981
+ ], SectionComponent);
6982
+
6983
+ let SelectFieldComponent = class SelectFieldComponent extends BaseFieldComponent {
6984
+ };
6773
6985
  __decorate([
6774
- Output()
6775
- ], PasswordFieldComponent.prototype, "onComplete", void 0);
6776
- PasswordFieldComponent = __decorate([
6986
+ Input()
6987
+ ], SelectFieldComponent.prototype, "field", void 0);
6988
+ __decorate([
6989
+ Input()
6990
+ ], SelectFieldComponent.prototype, "formControl", void 0);
6991
+ SelectFieldComponent = __decorate([
6777
6992
  Component({
6778
- template: "<input\n type=\"password\"\n [id]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n [maxLength]=\"field.maxLength\"\n pInputText\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n (input)=\"onInput.next($event)\"\n [formControl]=\"formControl\"\n [ngStyle]=\"field.style\"\n [sPasswordStrength]=\"field.passwordStrength\"\n [psDescription]=\"field.passwordStrengthOptions?.description\"\n [psWeakTitle]=\"field.passwordStrengthOptions?.weakTitle\"\n [psMediumTitle]=\"field.passwordStrengthOptions?.mediumTitle\"\n [psStrongTitle]=\"field.passwordStrengthOptions?.strongTitle\"\n [psValidation]=\"field.passwordStrengthOptions?.validation\" />",
6779
- encapsulation: ViewEncapsulation.None,
6780
- styles: ["s-text-field.ng-dirty.ng-invalid .ui-inputtext{border-color:#c13018}s-text-field.ng-dirty.ng-invalid .ui-inputtext:hover{border-color:#e44328}"]
6993
+ template: "<p-dropdown\n *ngIf=\"!field.multiple\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [placeholder]=\"field.placeholder || ' '\"\n [formControl]=\"formControl\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [showClear]=\"field.showClear\"\n dataKey=\"{{field.dataKey}}\"\n optionLabel=\"{{field.optionLabel}}\"\n [autoDisplayFirst]=\"field.autoDisplayFirst\"\n [appendTo]=\"field.appendTo || 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\">\n</p-dropdown>\n<p-multiSelect\n *ngIf=\"field.multiple\"\n [formControl]=\"formControl\"\n [name]=\"field.name\"\n [inputId]=\"(field.id || field.name)\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [defaultLabel]=\"field.placeholder\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [emptyFilterMessage]=\"field.emptyMessage || 'Nenhum registro encontrado'\"\n [showDelay]=\"500\"\n [selectedItemsLabel]=\"field.multipleSelectedLabel\"\n [appendTo]=\"field.appendTo || 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\">\n</p-multiSelect>\n\n"
6781
6994
  })
6782
- ], PasswordFieldComponent);
6995
+ ], SelectFieldComponent);
6783
6996
 
6784
6997
  let SliderFieldComponent = class SliderFieldComponent extends BaseFieldComponent {
6785
6998
  constructor() {
@@ -6862,242 +7075,114 @@ SliderFieldComponent = __decorate([
6862
7075
  })
6863
7076
  ], SliderFieldComponent);
6864
7077
 
6865
- class DynamicForm {
6866
- constructor({ group, errorMessages }) {
6867
- this.group = group;
6868
- this.errorMessages = errorMessages;
6869
- }
6870
- }
6871
- class DynamicField extends DynamicForm {
6872
- constructor({ group, field, errorMessages }) {
6873
- super({
6874
- group,
6875
- errorMessages,
6876
- });
6877
- this.field = field;
6878
- this.setFieldPropertiesByType();
6879
- }
6880
- setFieldPropertiesByType() {
6881
- if (this.field.type === FieldType.Integer || this.field.type === FieldType.Double) {
6882
- this.field.numberLocaleOptions.currencySymbol = "";
6883
- }
6884
- }
6885
- createComponent(resolver, container) {
6886
- const componentFactory = resolver.resolveComponentFactory(this.getComponent());
6887
- const component = container.createComponent(componentFactory);
6888
- component.instance.field = this.field;
6889
- // Must be this way because some teams use name like "e070emp.codemp"
6890
- component.instance.formControl = this.group["controls"][this.field.name];
6891
- component.instance.errorMessages = this.errorMessages;
6892
- this.setVariablesByType(component);
6893
- return component;
6894
- }
6895
- setVariablesByType(component) {
6896
- if (this.field.type == FieldType.Time) {
6897
- component.instance.timeOnly = true;
6898
- }
6899
- if ([FieldType.LocalDateTime, FieldType.DateTime, FieldType.Time].includes(this.field.type)) {
6900
- component.instance.showTime = true;
6901
- }
6902
- }
6903
- updateVariables(component) {
6904
- component.instance.field = this.field;
6905
- component.instance.formControl = this.group["controls"][this.field.name];
6906
- this.setVariablesByType(component);
6907
- }
6908
- getComponent() {
6909
- switch (this.field.type) {
6910
- case FieldType.Autocomplete:
6911
- return AutocompleteFieldComponent;
6912
- case FieldType.Binary:
6913
- case FieldType.String:
6914
- return TextFieldComponent;
6915
- case FieldType.Boolean:
6916
- return this.field.representedBy === "switch" ? BooleanSwitchFieldComponent : BooleanFieldComponent;
6917
- case FieldType.Chips:
6918
- return ChipsFieldComponent;
6919
- case FieldType.Date:
6920
- case FieldType.DateTime:
6921
- case FieldType.LocalDateTime:
6922
- case FieldType.Time:
6923
- return CalendarFieldComponent;
6924
- case FieldType.Number:
6925
- case FieldType.Integer:
6926
- case FieldType.Double:
6927
- return BignumberFieldComponent;
6928
- case FieldType.Enum:
6929
- return SelectFieldComponent;
6930
- case FieldType.Lookup:
6931
- return LookupFieldComponent;
6932
- case FieldType.Money:
6933
- return CurrencyFieldComponent;
6934
- case FieldType.Radio:
6935
- return RadioButtonComponent;
6936
- case FieldType.Text:
6937
- return TextAreaFieldComponent;
6938
- case FieldType.TextIA:
6939
- return TextAreaIAFieldComponent;
6940
- case FieldType.Password:
6941
- return PasswordFieldComponent;
6942
- case FieldType.Blob:
6943
- return FileUploadComponent$1;
6944
- case FieldType.Slider:
6945
- return SliderFieldComponent;
6946
- case FieldType.Custom:
6947
- return this.field.CustomFieldComponentClass;
6948
- default:
6949
- throw new Error(`Trying to use an unsupported type (${this.field.type}).`);
6950
- }
6951
- }
6952
- }
6953
- class DynamicStructure extends DynamicForm {
6954
- constructor({ group, config, errorMessages }) {
6955
- super({
6956
- group,
6957
- errorMessages,
6958
- });
6959
- this.config = config;
6960
- }
6961
- createComponent(resolver, container) {
6962
- const componentFactory = resolver.resolveComponentFactory(this.getComponent());
6963
- const component = container.createComponent(componentFactory);
6964
- component.instance.config = this.config;
6965
- component.instance.group = this.group;
6966
- return component;
6967
- }
6968
- updateVariables(component) {
6969
- component.instance.structure = this.config;
6970
- component.instance.group = this.group;
6971
- }
6972
- getComponent() {
6973
- switch (this.config.type) {
6974
- case StructureType.Fieldset:
6975
- return FieldsetComponent;
6976
- case StructureType.Section:
6977
- return SectionComponent;
6978
- default:
6979
- throw new Error(`Trying to use an unsupported type (${this.config.type}).`);
6980
- }
6981
- }
6982
- }
6983
- class DynamicGrid extends DynamicForm {
6984
- constructor({ group, config, errorMessages }) {
6985
- super({ group, errorMessages });
6986
- this.config = config;
6987
- }
6988
- createComponent(resolver, container) {
6989
- const componentFactory = resolver.resolveComponentFactory(this.getComponent());
6990
- const component = container.createComponent(componentFactory);
6991
- component.instance.config = this.config;
6992
- component.instance.group = this.group;
6993
- component.instance.errorMessages = this.errorMessages;
6994
- return component;
6995
- }
6996
- updateVariables(component) {
6997
- component.instance.config = this.config;
6998
- component.instance.group = this.group;
6999
- }
7000
- getComponent() {
7001
- switch (this.config.type) {
7002
- case GridType.Row:
7003
- return RowComponent;
7004
- default:
7005
- throw new Error(`Trying to use an unsupported type (${this.config.type}).`);
7006
- }
7007
- }
7008
- }
7078
+ let TextAreaFieldComponent = class TextAreaFieldComponent {
7079
+ };
7080
+ __decorate([
7081
+ Input()
7082
+ ], TextAreaFieldComponent.prototype, "field", void 0);
7083
+ __decorate([
7084
+ Input()
7085
+ ], TextAreaFieldComponent.prototype, "formControl", void 0);
7086
+ TextAreaFieldComponent = __decorate([
7087
+ Component({
7088
+ template: "<textarea\n [id]=\"(field.id || field.name)\"\n *ngIf=\"!field.keyFilter\"\n pInputTextarea\n [rows]=\"field.rows\"\n [cols]=\"field.cols\"\n [formControl]=\"formControl\"\n style=\"resize: vertical;\"\n [ngStyle]=\"field.style\"\n></textarea>\n<textarea\n [id]=\"(field.id || field.name)\"\n *ngIf=\"field.keyFilter\"\n pInputTextarea\n [rows]=\"field.rows\"\n [cols]=\"field.cols\"\n [formControl]=\"formControl\"\n style=\"resize: vertical;\"\n [pKeyFilter]=\"field.keyFilter\"\n [ngStyle]=\"field.style\"\n></textarea>\n"
7089
+ })
7090
+ ], TextAreaFieldComponent);
7009
7091
 
7010
- let DynamicFormDirective = class DynamicFormDirective {
7011
- constructor(resolver, container) {
7012
- this.resolver = resolver;
7013
- this.container = container;
7014
- }
7015
- set sDynamicForm(context) {
7016
- const { id, config, group, errorMessages } = context;
7017
- this.id = id;
7018
- this.config = config;
7019
- this.group = group;
7020
- this.errorMessages = errorMessages;
7092
+ let TextAreaIAFieldComponent = class TextAreaIAFieldComponent {
7093
+ constructor(_iassistService, _formBuilder, _translateService) {
7094
+ this._iassistService = _iassistService;
7095
+ this._formBuilder = _formBuilder;
7096
+ this._translateService = _translateService;
7097
+ this.isVisible = false;
7098
+ this.isLoading = false;
7021
7099
  }
7022
7100
  ngOnInit() {
7023
- if (this.isField()) {
7024
- if (!(this.config.id) && this.id) {
7025
- this.config.id = this.id + "-" + this.config.name;
7026
- }
7027
- this.directiveConfig = new DynamicField({
7028
- group: this.group,
7029
- field: this.config,
7030
- errorMessages: this.errorMessages,
7031
- });
7032
- }
7033
- else if (this.isStructure()) {
7034
- this.directiveConfig = new DynamicStructure({
7035
- group: this.group,
7036
- config: this.config,
7037
- errorMessages: this.errorMessages,
7038
- });
7039
- }
7040
- else if (this.isGrid()) {
7041
- this.directiveConfig = new DynamicGrid({
7042
- group: this.group,
7043
- config: this.config,
7044
- errorMessages: this.errorMessages,
7045
- });
7046
- }
7047
- else
7048
- throw new Error(`Trying to use an unsupported type (${this.config.type}).`);
7049
- this.component = this.directiveConfig.createComponent(this.resolver, this.container);
7050
- this.component.instance.id = this.id;
7051
- this.component.instance.errorMessages = this.errorMessages;
7101
+ this._createDialogFields();
7102
+ this._createDialogFormGroup();
7103
+ }
7104
+ showDialog() {
7105
+ this.isVisible = true;
7052
7106
  }
7053
- ngOnChanges() {
7054
- if (this.component) {
7055
- this.directiveConfig.updateVariables(this.component);
7056
- this.component.instance.errorMessages = this.errorMessages;
7057
- }
7107
+ onHideDialog() {
7108
+ this.formGroup.get("context").setValue("");
7058
7109
  }
7059
- isField() {
7060
- return FieldType[this.config.type];
7110
+ hideDialog() {
7111
+ this.isVisible = false;
7061
7112
  }
7062
- isStructure() {
7063
- return StructureType[this.config.type];
7113
+ submitContext() {
7114
+ const context = this.formGroup.get("context");
7115
+ this.isLoading = true;
7116
+ this._iassistService.askIA(context.value, {
7117
+ id: this.field.id,
7118
+ label: this.field.label,
7119
+ placeholder: this.field.placeholder,
7120
+ })
7121
+ .pipe(catchError((err) => {
7122
+ this.isLoading = false;
7123
+ return throwError(err);
7124
+ }))
7125
+ .subscribe((res) => {
7126
+ this.formControl.setValue(res.text);
7127
+ this.isLoading = false;
7128
+ });
7129
+ this.hideDialog();
7064
7130
  }
7065
- isGrid() {
7066
- return GridType[this.config.type];
7131
+ _createDialogFields() {
7132
+ this.fields = [
7133
+ new FormField({
7134
+ name: "context",
7135
+ type: FieldType.String,
7136
+ label: this._translateService.instant("platform.angular_components.context"),
7137
+ size: { sm: 12, md: 12, lg: 12, xl: 12 },
7138
+ }),
7139
+ ];
7140
+ }
7141
+ _createDialogFormGroup() {
7142
+ this.formGroup = this._formBuilder.group({
7143
+ context: [""],
7144
+ });
7067
7145
  }
7068
7146
  };
7069
- DynamicFormDirective.ctorParameters = () => [
7070
- { type: ComponentFactoryResolver },
7071
- { type: ViewContainerRef }
7147
+ TextAreaIAFieldComponent.ctorParameters = () => [
7148
+ { type: IAssistService },
7149
+ { type: FormBuilder },
7150
+ { type: TranslateService }
7072
7151
  ];
7073
7152
  __decorate([
7074
7153
  Input()
7075
- ], DynamicFormDirective.prototype, "sDynamicForm", null);
7154
+ ], TextAreaIAFieldComponent.prototype, "field", void 0);
7076
7155
  __decorate([
7077
- Input("sDynamicFormDisplayTimeInfoSign")
7078
- ], DynamicFormDirective.prototype, "displayTimeInfoSign", void 0);
7079
- DynamicFormDirective = __decorate([
7080
- Directive({ selector: "[sDynamicForm]" })
7081
- ], DynamicFormDirective);
7156
+ Input()
7157
+ ], TextAreaIAFieldComponent.prototype, "formControl", void 0);
7158
+ TextAreaIAFieldComponent = __decorate([
7159
+ Component({
7160
+ template: "<s-loading-state\n [loading]=\"isLoading\"\n [blockWindow]=\"true\"> \n</s-loading-state>\n\n<p-dialog\n [(visible)]=\"isVisible\"\n [modal]=\"true\"\n [style]=\"{ width: '50vw' }\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n (onHide)=\"onHideDialog()\">\n <p-header>\n <div class=\"dialog-header\">\n <span class=\"iassist-icon\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </span>\n {{ 'platform.angular_components.iassist_text_generator' | translate }}\n </div>\n </p-header>\n <s-dynamic-form\n [fields]=\"fields\"\n [form]=\"formGroup\">\n </s-dynamic-form>\n <p-footer>\n <div class=\"footer-content\">\n <s-button\n id=\"-submit-button\"\n type=\"button\"\n [label]=\"'platform.angular_components.generate_text' | translate\"\n (onClick)=\"submitContext()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n showDelay=\"500\">\n </s-button>\n <s-button\n id=\"-cancel-button\"\n type=\"button\"\n priority=\"link\"\n [label]=\"'platform.angular_components.cancel' | translate\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n showDelay=\"500\">\n </s-button>\n </div>\n </p-footer>\n</p-dialog>\n\n<div class=\"textarea-ia\">\n <textarea\n [id]=\"(field.id || field.name)\"\n pInputTextarea\n [rows]=\"field.rows\"\n [cols]=\"field.cols\"\n [formControl]=\"formControl\"\n style=\"resize: vertical;\"\n [ngStyle]=\"field.style\">\n </textarea>\n <button\n class=\"iassist-button\"\n (click)=\"showDialog()\"\n [sTooltip]=\"'platform.angular_components.iassist_text_generator' | translate\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </button>\n</div>\n\n<ng-template #iassistIcon>\n <svg style=\"width: 100%; height: 100%;\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5.81451 18.1054L5.99593 17.6059L7.52166 13.4099L7.60877 13.1726L7.61277 13.1614L7.94285 12.2543L8.01159 12.0648L8.05394 11.949L5.2998 8.52426L5.02726 8.18379C5.00569 8.15821 4.9881 8.13104 4.97292 8.10226C4.90099 7.9632 4.85063 7.81294 4.82186 7.6531C4.73075 7.1344 4.90418 6.60771 5.28382 6.24326C5.29421 6.23447 5.3038 6.22567 5.31419 6.21688L5.47164 6.0914L9.3439 3.00238L9.5469 2.84094L9.57088 2.82096L10.4101 2.15041L11.8007 1.04188C11.2181 0.925188 10.6163 0.863647 10.0001 0.863647C4.95374 0.863647 0.863281 4.9541 0.863281 9.99963C0.863281 13.5346 2.87254 16.5989 5.80971 18.1182\" fill=\"#0FA389\"/>\n <path d=\"M14.099 1.83472L13.9495 2.24632L11.997 7.61074L11.9427 7.7594L11.9003 7.87369L14.7448 11.4103C14.7463 11.4127 14.7479 11.4143 14.7495 11.4167L14.9414 11.654C14.9541 11.67 14.9661 11.6868 14.9765 11.7044C15.0764 11.8698 15.1444 12.0505 15.1779 12.2431C15.273 12.7826 15.0812 13.3284 14.676 13.6897C14.656 13.7129 14.6345 13.7344 14.6105 13.7536L11.8563 15.9507L11.6789 16.0922L11.6022 16.1537L10.7406 16.8402V16.841L10.3937 17.1176L9.85747 17.5452L9.39951 17.9112L8.11035 18.9398C8.72016 19.0677 9.35155 19.1364 9.99973 19.1364C15.0461 19.1364 19.1365 15.046 19.1365 9.99964C19.1365 6.42789 17.0857 3.33727 14.099 1.83472Z\" fill=\"#0FA389\"/>\n <path d=\"M14.7287 12.3222C14.7047 12.1832 14.6551 12.0545 14.5864 11.941L14.3954 11.7036C14.3954 11.7036 14.3946 11.7028 14.3938 11.7028L11.3839 7.96005L10.5031 6.86511L10.4256 6.7676L9.03255 5.03487L8.83674 4.79191C8.79278 4.71678 8.75681 4.63446 8.73204 4.54814C8.72085 4.51058 8.71286 4.47222 8.70566 4.43465C8.68568 4.32196 8.68408 4.21007 8.69847 4.10217L8.62334 4.16291L8.44511 4.30438L5.75731 6.44871L5.60066 6.57339C5.34011 6.82275 5.20584 7.19279 5.27218 7.57482C5.29296 7.68751 5.32892 7.79541 5.37927 7.89292C5.37927 7.89292 5.37927 7.89292 5.38007 7.89371L5.6566 8.23818L8.57139 11.8627L8.63293 11.9394L9.53047 13.0559L9.59041 13.1303L9.98363 13.6186L11.0178 14.9046C11.0186 14.9054 11.0194 14.9069 11.0202 14.9077L11.1361 15.0516V15.0524C11.2184 15.1755 11.2768 15.317 11.3048 15.4728C11.3239 15.5807 11.3263 15.6878 11.3143 15.7925L11.3175 15.7965L11.3943 15.735L11.5717 15.5935L14.3266 13.3964L14.3218 13.3908C14.6335 13.1438 14.8022 12.7394 14.7287 12.3222Z\" fill=\"#F3F3F5\"/>\n <path d=\"M10.6822 15.0082C10.6814 15.0074 10.6806 15.0058 10.6806 15.005L10.5672 14.8643L10.3809 14.6325L10.3282 14.567L10.2211 14.4335L9.40028 13.4129L9.32835 13.3242L8.77289 12.6345L8.68098 12.5194L8.44121 12.2205L8.37168 12.4099L8.04159 13.317L8.0376 13.329L7.95128 13.5664L6.42475 17.7623L6.24333 18.2618L5.90605 19.1881L5.73262 19.6645C5.73182 19.6661 5.73102 19.6677 5.73102 19.6685C5.72863 19.6749 5.72703 19.6821 5.72543 19.6885C5.71584 19.7228 5.71424 19.758 5.72063 19.7948C5.74461 19.929 5.87329 20.0193 6.00836 19.9962C6.04112 19.9898 6.07229 19.9778 6.09867 19.9602C6.09867 19.9602 6.09947 19.9602 6.10027 19.9594L6.14103 19.9266L7.39422 18.9268L9.11496 17.5537L9.57292 17.1877L10.1092 16.7601L10.4561 16.4827L10.4537 16.4811C10.7582 16.2382 10.9236 15.8402 10.8509 15.4294C10.8237 15.2735 10.7654 15.1313 10.6822 15.0082Z\" fill=\"#0C847B\"/>\n <path d=\"M9.17644 4.56325C9.2124 4.68713 9.26915 4.80062 9.34268 4.90053C9.34348 4.90053 9.34428 4.90213 9.34428 4.90213L9.40342 4.97645C9.40502 4.97805 9.40582 4.97885 9.40662 4.98045L9.56806 5.17946L9.64878 5.28096L9.67915 5.31932L9.8414 5.51993L10.5559 6.40947L10.7054 6.59569L11.2169 7.23188L11.5142 7.60192L11.5693 7.45247L13.5202 2.08964L14.1596 0.332135C14.1596 0.330536 14.1604 0.328139 14.1612 0.32654C14.174 0.288177 14.1772 0.246617 14.17 0.205058C14.1468 0.0699879 14.0182 -0.0195258 13.8823 0.00365186C13.8407 0.0116442 13.8024 0.028428 13.7712 0.0540033L12.578 1.00589L12.498 1.06982L10.6958 2.50844L9.85658 3.17819L9.8326 3.19737L9.6296 3.35961L9.45297 3.50028C9.2116 3.73925 9.08692 4.08931 9.15006 4.44976C9.15726 4.48813 9.16525 4.52649 9.17644 4.56325Z\" fill=\"#0C847B\"/>\n </svg>\n</ng-template>",
7161
+ styles: [".footer-content{display:-ms-flexbox;display:flex;-ms-flex-positive:0;flex-grow:0}.textarea-ia{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;gap:8px}.iassist-button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border:none;border-radius:50%;box-shadow:none;cursor:pointer;height:32px;width:32px}.dialog-header{display:-ms-flexbox;display:flex;gap:12px}.dialog-header .iassist-icon{display:block;height:24px;width:24px}"]
7162
+ })
7163
+ ], TextAreaIAFieldComponent);
7082
7164
 
7083
- let LongPressDirective = class LongPressDirective {
7165
+ let TextFieldComponent = class TextFieldComponent extends BaseFieldComponent {
7084
7166
  constructor() {
7085
- this.sLongPressDelay = 500;
7086
- this.sLongPress = new EventEmitter();
7087
- this.mouseUp = new Subject();
7088
- this.mouseDown = new Subject();
7167
+ super(...arguments);
7168
+ this.onInput = new EventEmitter();
7169
+ this.onFocus = new EventEmitter();
7170
+ this.onComplete = new EventEmitter();
7089
7171
  this.ngUnsubscribe = new Subject();
7090
7172
  }
7091
- onMouseUp(event) {
7092
- this.mouseUp.next(event);
7093
- }
7094
- onMouseDown(event) {
7095
- this.mouseDown.next(event);
7096
- }
7097
7173
  ngOnInit() {
7098
- this.mouseDown
7099
- .pipe(debounceTime(this.sLongPressDelay), takeUntil(this.mouseUp), repeat(), takeUntil(this.ngUnsubscribe))
7100
- .subscribe(event => this.sLongPress.emit(event));
7174
+ this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
7175
+ if (this.field.onFocus)
7176
+ this.field.onFocus(event);
7177
+ });
7178
+ this.onInput.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
7179
+ if (this.field.onInput)
7180
+ this.field.onInput(event);
7181
+ });
7182
+ this.onComplete.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
7183
+ if (this.field.onComplete)
7184
+ this.field.onComplete(event);
7185
+ });
7101
7186
  }
7102
7187
  ngOnDestroy() {
7103
7188
  this.ngUnsubscribe.next();
@@ -7106,420 +7191,375 @@ let LongPressDirective = class LongPressDirective {
7106
7191
  };
7107
7192
  __decorate([
7108
7193
  Input()
7109
- ], LongPressDirective.prototype, "sLongPressDelay", void 0);
7194
+ ], TextFieldComponent.prototype, "field", void 0);
7195
+ __decorate([
7196
+ Input()
7197
+ ], TextFieldComponent.prototype, "formControl", void 0);
7110
7198
  __decorate([
7111
7199
  Output()
7112
- ], LongPressDirective.prototype, "sLongPress", void 0);
7200
+ ], TextFieldComponent.prototype, "onInput", void 0);
7113
7201
  __decorate([
7114
- HostListener("mouseup", ["$event"]),
7115
- HostListener("touchend", ["$event"])
7116
- ], LongPressDirective.prototype, "onMouseUp", null);
7202
+ Output()
7203
+ ], TextFieldComponent.prototype, "onFocus", void 0);
7117
7204
  __decorate([
7118
- HostListener("mousedown", ["$event"]),
7119
- HostListener("touchstart", ["$event"])
7120
- ], LongPressDirective.prototype, "onMouseDown", null);
7121
- LongPressDirective = __decorate([
7122
- Directive({
7123
- selector: "[sLongPress]",
7205
+ Output()
7206
+ ], TextFieldComponent.prototype, "onComplete", void 0);
7207
+ TextFieldComponent = __decorate([
7208
+ Component({
7209
+ template: "<p-inputMask\n *ngIf=\"field.mask; else noMask\"\n [type]=\"field.inputType || 'text'\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [mask]=\"isFunction(field.mask) ? field.mask() : field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"onFocus.next($event)\"\n (onComplete)=\"onComplete.next($event)\"\n (onInput)=\"onInput.next($event)\"\n [formControl]=\"formControl\">\n</p-inputMask>\n<ng-template #noMask>\n <ng-container>\n <div class=\"ui-inputgroup\">\n <ng-container *ngIf=\"field.leftAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.leftAddon.label\">{{field.leftAddon.label}}</span>\n <span *ngIf=\"!field.leftAddon.label\" [ngClass]=\"field.leftAddon.icon\"></span>\n </span>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"field.keyFilter ? inputKeyFilter : input\"></ng-container>\n <ng-container *ngIf=\"field.rightAddon\">\n <span class=\"ui-inputgroup-addon\">\n <span *ngIf=\"field.rightAddon.label\">{{field.rightAddon.label}}</span>\n <span *ngIf=\"!field.rightAddon.label\" [ngClass]=\"field.rightAddon.icon\"></span>\n </span>\n </ng-container>\n </div>\n </ng-container>\n</ng-template>\n<ng-template #input>\n <input\n [type]=\"field.inputType || 'text'\"\n [id]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n [maxLength]=\"field.maxLength\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n (input)=\"onInput.next($event)\"\n [formControl]=\"formControl\"\n [ngStyle]=\"field.style\" />\n</ng-template>\n<ng-template #inputKeyFilter>\n <input\n #inputText\n [type]=\"field.inputType || 'text'\"\n [id]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n [maxLength]=\"field.maxLength\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"onFocus.next($event)\"\n (input)=\"onInput.next($event)\"\n [pKeyFilter]=\"field.keyFilter\"\n [formControl]=\"formControl\"\n [ngStyle]=\"field.style\" />\n</ng-template>\n",
7210
+ encapsulation: ViewEncapsulation.None,
7211
+ styles: ["s-text-field.ng-dirty.ng-invalid .ui-inputtext{border-color:#c13018}s-text-field.ng-dirty.ng-invalid .ui-inputtext:hover{border-color:#e44328}"]
7124
7212
  })
7125
- ], LongPressDirective);
7213
+ ], TextFieldComponent);
7126
7214
 
7127
- let DoubleClickDirective = class DoubleClickDirective {
7128
- constructor() {
7129
- this.onDoubleClick = new EventEmitter();
7130
- this._timeout = null;
7131
- this._DOUBLE_CLICK_DELAY = 500;
7132
- }
7133
- onClick(event) {
7134
- this.handleOnClickEvent(event);
7135
- }
7136
- handleOnClickEvent(event) {
7137
- if (this._timeout) {
7138
- this.clearTimeout();
7139
- this.onDoubleClick.emit(event);
7140
- }
7141
- else {
7142
- this._timeout = setTimeout(() => this.clearTimeout(), this._DOUBLE_CLICK_DELAY);
7143
- }
7215
+ let RowComponent = class RowComponent {
7216
+ constructor() { }
7217
+ ngOnInit() { }
7218
+ getErrorMessages(errorMessages) {
7219
+ if (errorMessages)
7220
+ return this.isFunction(errorMessages) ? errorMessages() : errorMessages;
7221
+ return this.errorMessages;
7144
7222
  }
7145
- clearTimeout() {
7146
- clearTimeout(this._timeout);
7147
- this._timeout = null;
7223
+ isFunction(value) {
7224
+ return value instanceof Function;
7148
7225
  }
7149
7226
  };
7150
7227
  __decorate([
7151
- Output()
7152
- ], DoubleClickDirective.prototype, "onDoubleClick", void 0);
7228
+ Input()
7229
+ ], RowComponent.prototype, "id", void 0);
7153
7230
  __decorate([
7154
- HostListener("click", ["$event"])
7155
- ], DoubleClickDirective.prototype, "onClick", null);
7156
- DoubleClickDirective = __decorate([
7157
- Directive({
7158
- selector: '[sDoubleClick]'
7159
- })
7160
- ], DoubleClickDirective);
7161
-
7162
- let MouseEventsModule = class MouseEventsModule {
7163
- };
7164
- MouseEventsModule = __decorate([
7165
- NgModule({
7166
- imports: [CommonModule],
7167
- declarations: [
7168
- LongPressDirective,
7169
- DoubleClickDirective
7170
- ],
7171
- exports: [
7172
- LongPressDirective,
7173
- DoubleClickDirective
7174
- ],
7231
+ Input()
7232
+ ], RowComponent.prototype, "config", void 0);
7233
+ __decorate([
7234
+ Input()
7235
+ ], RowComponent.prototype, "group", void 0);
7236
+ __decorate([
7237
+ Input()
7238
+ ], RowComponent.prototype, "errorMessages", void 0);
7239
+ RowComponent = __decorate([
7240
+ Component({
7241
+ template: `
7242
+ <div class="ui-fluid" [formGroup]="group">
7243
+ <div class="ui-g">
7244
+ <ng-container *ngFor="let field of config.fields">
7245
+ <div [ngClass]="field.gridClass" *ngIf="field.visible()">
7246
+ <label
7247
+ [for]="field.name"
7248
+ [ngClass]="{ 'required': field.required() }"
7249
+ *sInfoSign="field.infoSign"
7250
+ >
7251
+ {{ field.label }}
7252
+ </label>
7253
+ <ng-container *sDynamicForm="{ id: id, config: field, group: group}"></ng-container>
7254
+ <s-control-errors [form]="group" [control]="group.controls[field.name]"
7255
+ [errorMessages]="getErrorMessages(field.errorMessages)"></s-control-errors>
7256
+ <ng-template *ngIf="field?.bottomTemplate" [ngTemplateOutlet]="field.bottomTemplate"></ng-template>
7257
+ </div>
7258
+ </ng-container>
7259
+ </div>
7260
+ `
7175
7261
  })
7176
- ], MouseEventsModule);
7177
-
7178
- var PasswordStrengths;
7179
- (function (PasswordStrengths) {
7180
- PasswordStrengths["VeryWeak"] = "Very_weak";
7181
- PasswordStrengths["Weak"] = "weak";
7182
- PasswordStrengths["Medium"] = "medium";
7183
- PasswordStrengths["Strong"] = "strong";
7184
- })(PasswordStrengths || (PasswordStrengths = {}));
7185
-
7186
- var PasswordStrengthPositions;
7187
- (function (PasswordStrengthPositions) {
7188
- PasswordStrengthPositions["Top"] = "top";
7189
- PasswordStrengthPositions["Right"] = "right";
7190
- PasswordStrengthPositions["Left"] = "left";
7191
- })(PasswordStrengthPositions || (PasswordStrengthPositions = {}));
7262
+ ], RowComponent);
7192
7263
 
7193
- let PasswordStrengthComponent = class PasswordStrengthComponent {
7194
- constructor() {
7195
- this.weakTitle = "Fraca";
7196
- this.mediumTitle = "Médio";
7197
- this.strongTitle = "Forte";
7198
- this.position = PasswordStrengthPositions.Right;
7199
- this.left = 0;
7200
- this.top = 0;
7201
- this.visible = false;
7202
- }
7203
- ngOnInit() {
7204
- this.title = this.weakTitle;
7205
- }
7206
- setPasswordStrengthPosition() {
7207
- const passwordStrength = document.querySelector(".password-strength");
7208
- switch (this.position) {
7209
- case PasswordStrengthPositions.Top:
7210
- passwordStrength.classList.add("password-strength--top");
7211
- break;
7212
- case PasswordStrengthPositions.Right:
7213
- passwordStrength.classList.add("password-strength--right");
7214
- break;
7215
- case PasswordStrengthPositions.Left:
7216
- passwordStrength.classList.add("password-strength--left");
7217
- break;
7218
- }
7264
+ let DynamicFieldComponent = class DynamicFieldComponent {
7265
+ getErrorMessages(errorMessages) {
7266
+ if (errorMessages)
7267
+ return this.isFunction(errorMessages)
7268
+ ? Object.assign(Object.assign({}, this.errorMessages), errorMessages()) : Object.assign(Object.assign({}, this.errorMessages), errorMessages);
7269
+ return this.errorMessages;
7219
7270
  }
7220
- updateIndicators(passwordStrength) {
7221
- const strengthIndicator1 = document.querySelector("#strength-indicator-1");
7222
- const strengthIndicator2 = document.querySelector("#strength-indicator-2");
7223
- const strengthIndicator3 = document.querySelector("#strength-indicator-3");
7224
- const onIndicators = [];
7225
- const indicators = [
7226
- strengthIndicator1,
7227
- strengthIndicator2,
7228
- strengthIndicator3,
7229
- ];
7230
- let strengthClass;
7231
- switch (passwordStrength) {
7232
- case PasswordStrengths.VeryWeak:
7233
- this.title = this.weakTitle;
7234
- break;
7235
- case PasswordStrengths.Weak:
7236
- this.title = this.weakTitle;
7237
- strengthClass = "strength-indicator--weak";
7238
- onIndicators.push(strengthIndicator1);
7239
- break;
7240
- case PasswordStrengths.Medium:
7241
- this.title = this.mediumTitle;
7242
- strengthClass = "strength-indicator--medium";
7243
- onIndicators.push(strengthIndicator1);
7244
- onIndicators.push(strengthIndicator2);
7245
- break;
7246
- case PasswordStrengths.Strong:
7247
- this.title = this.strongTitle;
7248
- strengthClass = "strength-indicator--strong";
7249
- onIndicators.push(strengthIndicator1);
7250
- onIndicators.push(strengthIndicator2);
7251
- onIndicators.push(strengthIndicator3);
7252
- break;
7253
- }
7254
- indicators.forEach(indicator => {
7255
- indicator.classList.remove("strength-indicator--weak", "strength-indicator--medium", "strength-indicator--strong");
7256
- });
7257
- onIndicators.forEach(indicator => {
7258
- indicator.classList.add(strengthClass);
7259
- });
7271
+ isFunction(value) {
7272
+ return value instanceof Function;
7260
7273
  }
7261
7274
  };
7262
7275
  __decorate([
7263
7276
  Input()
7264
- ], PasswordStrengthComponent.prototype, "weakTitle", void 0);
7277
+ ], DynamicFieldComponent.prototype, "id", void 0);
7265
7278
  __decorate([
7266
7279
  Input()
7267
- ], PasswordStrengthComponent.prototype, "mediumTitle", void 0);
7280
+ ], DynamicFieldComponent.prototype, "fields", void 0);
7268
7281
  __decorate([
7269
7282
  Input()
7270
- ], PasswordStrengthComponent.prototype, "strongTitle", void 0);
7283
+ ], DynamicFieldComponent.prototype, "form", void 0);
7271
7284
  __decorate([
7272
7285
  Input()
7273
- ], PasswordStrengthComponent.prototype, "description", void 0);
7274
- PasswordStrengthComponent = __decorate([
7286
+ ], DynamicFieldComponent.prototype, "errorMessages", void 0);
7287
+ __decorate([
7288
+ Input()
7289
+ ], DynamicFieldComponent.prototype, "displayTimeInfoSign", void 0);
7290
+ DynamicFieldComponent = __decorate([
7275
7291
  Component({
7276
- template: "<div\n class=\"password-strength\"\n [ngStyle]=\"{\n 'left': left + 'px',\n 'top': top + 'px'\n }\"\n [ngClass]=\"['password-strength--' + position]\">\n <span class=\"title\">{{ title }}</span>\n <div class=\"strength-indicators\">\n <span class=\"strength-indicator\" id=\"strength-indicator-1\"></span>\n <span class=\"strength-indicator\" id=\"strength-indicator-2\"></span>\n <span class=\"strength-indicator\" id=\"strength-indicator-3\"></span>\n </div>\n <span class=\"content\">{{ description }}</span>\n</div>",
7277
- styles: [".password-strength{position:fixed;transform:translateX(-50%);background-color:#fff;border-radius:2px;box-shadow:0 0 5px 1px #ccc;padding:10px;width:232px;z-index:99999}.password-strength::after{content:\"\";position:absolute}.password-strength .title{font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:700;line-height:150%}.password-strength .strength-indicators{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:10px 0}.password-strength .strength-indicators .strength-indicator{background-color:#ccc;border-radius:2px;display:inline-block;height:3px;width:64px}.password-strength .strength-indicators .strength-indicator--weak{background-color:#c13018}.password-strength .strength-indicators .strength-indicator--medium{background-color:#fcbf10}.password-strength .strength-indicators .strength-indicator--strong{background-color:#0c9348}.password-strength .content{font-family:\"Open Sans\",sans-serif;font-size:12px;font-weight:400;line-height:150%}.password-strength--top{transform:translate(-50%,-100%)}.password-strength--top::after{top:100%;right:calc(50% - 4px);border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #fff}.password-strength--right{transform:translateY(-50%)}.password-strength--right::after{bottom:calc(50% - 8px);left:-8px;border-top:8px solid transparent;border-right:8px solid #fff;border-bottom:8px solid transparent}.password-strength--left{transform:translate(-100%,-50%)}.password-strength--left::after{bottom:calc(50% - 8px);right:-8px;border-top:8px solid transparent;border-left:8px solid #fff;border-bottom:8px solid transparent}"]
7292
+ selector: "s-dynamic-field",
7293
+ template: "<div class=\"ui-fluid\" [formGroup]=\"form\">\n <div class=\"ui-g\">\n <ng-container *ngFor=\"let field of fields\">\n <div\n *ngIf=\"!field.visible || field.visible()\"\n [ngClass]=\"field.gridClass\">\n <span *ngIf=\"field.label\">\n <label\n *sInfoSign=\"field.infoSign; displayTime: displayTimeInfoSign\"\n [for]=\"field.name\"\n [ngClass]=\"{ 'required': field.required() }\">\n {{ field.label }}\n </label>\n </span>\n <ng-container *sDynamicForm=\"{\n id: id,\n config: field,\n group: form\n }\">\n </ng-container>\n <s-control-errors\n [form]=\"form\"\n [control]=\"form.controls[field.name]\"\n [errorMessages]=\"getErrorMessages(field.errorMessages)\">\n </s-control-errors>\n <ng-template\n *ngIf=\"field?.bottomTemplate\"\n [ngTemplateOutlet]=\"field.bottomTemplate\">\n </ng-template>\n </div>\n </ng-container>\n </div>\n</div>"
7278
7294
  })
7279
- ], PasswordStrengthComponent);
7295
+ ], DynamicFieldComponent);
7280
7296
 
7281
- let PasswordStrengthDirective = class PasswordStrengthDirective {
7282
- constructor(elementRef, appRef, componentFactoryResolver, injector) {
7283
- this.elementRef = elementRef;
7284
- this.appRef = appRef;
7285
- this.componentFactoryResolver = componentFactoryResolver;
7286
- this.injector = injector;
7287
- this.enabled = true;
7288
- this.position = PasswordStrengthPositions.Right;
7289
- this.componentRef = null;
7297
+ var GridType;
7298
+ (function (GridType) {
7299
+ GridType["Row"] = "Row";
7300
+ })(GridType || (GridType = {}));
7301
+
7302
+ var StructureType;
7303
+ (function (StructureType) {
7304
+ StructureType["Fieldset"] = "Fieldset";
7305
+ StructureType["Section"] = "Section";
7306
+ })(StructureType || (StructureType = {}));
7307
+
7308
+ class DynamicForm {
7309
+ constructor({ group, errorMessages }) {
7310
+ this.group = group;
7311
+ this.errorMessages = errorMessages;
7290
7312
  }
7291
- ngOnInit() {
7292
- this.validateProperties();
7313
+ }
7314
+ class DynamicField extends DynamicForm {
7315
+ constructor({ group, field, errorMessages }) {
7316
+ super({
7317
+ group,
7318
+ errorMessages,
7319
+ });
7320
+ this.field = field;
7321
+ this.setFieldPropertiesByType();
7293
7322
  }
7294
- onFocus() {
7295
- var _a, _b, _c;
7296
- const content = (_a = this.elementRef.nativeElement.value) !== null && _a !== void 0 ? _a : "";
7297
- if (content) {
7298
- this.createPasswordStrength();
7299
- (_b = this.componentRef) === null || _b === void 0 ? void 0 : _b.instance.updateIndicators(this.validation(content));
7300
- }
7301
- else {
7302
- (_c = this.componentRef) === null || _c === void 0 ? void 0 : _c.instance.updateIndicators(PasswordStrengths.VeryWeak);
7323
+ setFieldPropertiesByType() {
7324
+ if (this.field.type === FieldType.Integer || this.field.type === FieldType.Double) {
7325
+ this.field.numberLocaleOptions.currencySymbol = "";
7303
7326
  }
7304
7327
  }
7305
- onBlur() {
7306
- this.destroyPasswordStrength();
7328
+ createComponent(resolver, container) {
7329
+ const componentFactory = resolver.resolveComponentFactory(this.getComponent());
7330
+ const component = container.createComponent(componentFactory);
7331
+ component.instance.field = this.field;
7332
+ // Must be this way because some teams use name like "e070emp.codemp"
7333
+ component.instance.formControl = this.group["controls"][this.field.name];
7334
+ component.instance.errorMessages = this.errorMessages;
7335
+ this.setVariablesByType(component);
7336
+ return component;
7307
7337
  }
7308
- createPasswordStrength() {
7309
- if (this.enabled && this.componentRef === null) {
7310
- const componentFactory = this.componentFactoryResolver.resolveComponentFactory(PasswordStrengthComponent);
7311
- this.componentRef = componentFactory.create(this.injector);
7312
- this.appRef.attachView(this.componentRef.hostView);
7313
- const domElem = this.componentRef.hostView.rootNodes[0];
7314
- document.body.appendChild(domElem);
7315
- this.setPasswordStrengthComponentProperties();
7316
- this.showPasswordStrength();
7338
+ setVariablesByType(component) {
7339
+ if (this.field.type == FieldType.Time) {
7340
+ component.instance.timeOnly = true;
7317
7341
  }
7318
- }
7319
- showPasswordStrength() {
7320
- if (this.componentRef !== null) {
7321
- this.componentRef.instance.visible = true;
7342
+ if ([FieldType.LocalDateTime, FieldType.DateTime, FieldType.Time].includes(this.field.type)) {
7343
+ component.instance.showTime = true;
7322
7344
  }
7323
7345
  }
7324
- setPasswordStrengthComponentProperties() {
7325
- if (this.componentRef != null) {
7326
- this.componentRef.instance.position = this.position;
7327
- this.componentRef.instance.weakTitle = this.weakTitle;
7328
- this.componentRef.instance.mediumTitle = this.mediumTitle;
7329
- this.componentRef.instance.strongTitle = this.strongTitle;
7330
- this.componentRef.instance.description = this.description;
7331
- const { top, right, bottom, left } = this.elementRef.nativeElement.getBoundingClientRect();
7332
- const margin = 20;
7333
- const elementRefHeight = bottom - top;
7334
- const elementRefWidth = right - left;
7335
- const safeSpace = 150;
7336
- let positioned = false;
7337
- const invalidOptions = [];
7338
- while (!positioned) {
7339
- if (invalidOptions.includes(PasswordStrengthPositions.Top)
7340
- && invalidOptions.includes(PasswordStrengthPositions.Right)
7341
- && invalidOptions.includes(PasswordStrengthPositions.Left)) {
7342
- this.destroyPasswordStrength();
7343
- throw new Error("No space to show password strength");
7344
- }
7345
- switch (this.position) {
7346
- case PasswordStrengthPositions.Top: {
7347
- const topShift = top;
7348
- const rightShift = document.body.clientWidth - right;
7349
- const leftShift = left;
7350
- if (topShift <= elementRefHeight + safeSpace || rightShift < 50 || leftShift < 50) {
7351
- this.position = PasswordStrengthPositions.Right;
7352
- invalidOptions.push(PasswordStrengthPositions.Top);
7353
- break;
7354
- }
7355
- this.componentRef.instance.top = Math.round(top - margin);
7356
- this.componentRef.instance.left = Math.round(elementRefWidth / 2 + left);
7357
- positioned = true;
7358
- break;
7359
- }
7360
- case PasswordStrengthPositions.Right: {
7361
- const rightShift = document.body.clientWidth - right;
7362
- if (rightShift <= elementRefWidth + safeSpace) {
7363
- this.position = PasswordStrengthPositions.Left;
7364
- invalidOptions.push(PasswordStrengthPositions.Right);
7365
- break;
7366
- }
7367
- this.componentRef.instance.top = Math.round(top + elementRefHeight / 2);
7368
- this.componentRef.instance.left = Math.round(right + margin);
7369
- positioned = true;
7370
- break;
7371
- }
7372
- case PasswordStrengthPositions.Left: {
7373
- const leftShift = left;
7374
- if (leftShift <= elementRefWidth + safeSpace) {
7375
- this.position = PasswordStrengthPositions.Top;
7376
- invalidOptions.push(PasswordStrengthPositions.Left);
7377
- break;
7378
- }
7379
- this.componentRef.instance.top = Math.round(top + elementRefHeight / 2);
7380
- this.componentRef.instance.left = Math.round(left - margin);
7381
- positioned = true;
7382
- break;
7383
- }
7384
- default: {
7385
- break;
7386
- }
7387
- }
7388
- this.componentRef.instance.position = this.position;
7389
- }
7390
- }
7346
+ updateVariables(component) {
7347
+ component.instance.field = this.field;
7348
+ component.instance.formControl = this.group["controls"][this.field.name];
7349
+ this.setVariablesByType(component);
7391
7350
  }
7392
- validateProperties() {
7393
- this.validation = this.validation || this.defaultValidator;
7394
- if (!this.description) {
7395
- throw new Error("Description is required");
7351
+ getComponent() {
7352
+ switch (this.field.type) {
7353
+ case FieldType.Autocomplete:
7354
+ return AutocompleteFieldComponent;
7355
+ case FieldType.Binary:
7356
+ case FieldType.String:
7357
+ return TextFieldComponent;
7358
+ case FieldType.Boolean:
7359
+ return this.field.representedBy === "switch" ? BooleanSwitchFieldComponent : BooleanFieldComponent;
7360
+ case FieldType.Chips:
7361
+ return ChipsFieldComponent;
7362
+ case FieldType.CountryPhonePicker:
7363
+ return CountryPhonePickerFieldComponent;
7364
+ case FieldType.Date:
7365
+ case FieldType.DateTime:
7366
+ case FieldType.LocalDateTime:
7367
+ case FieldType.Time:
7368
+ return CalendarFieldComponent;
7369
+ case FieldType.Number:
7370
+ case FieldType.Integer:
7371
+ case FieldType.Double:
7372
+ return BignumberFieldComponent;
7373
+ case FieldType.Enum:
7374
+ return SelectFieldComponent;
7375
+ case FieldType.Lookup:
7376
+ return LookupFieldComponent;
7377
+ case FieldType.Money:
7378
+ return CurrencyFieldComponent;
7379
+ case FieldType.Radio:
7380
+ return RadioButtonComponent;
7381
+ case FieldType.Text:
7382
+ return TextAreaFieldComponent;
7383
+ case FieldType.TextIA:
7384
+ return TextAreaIAFieldComponent;
7385
+ case FieldType.Password:
7386
+ return PasswordFieldComponent;
7387
+ case FieldType.Blob:
7388
+ return FileUploadComponent$1;
7389
+ case FieldType.Slider:
7390
+ return SliderFieldComponent;
7391
+ case FieldType.Custom:
7392
+ return this.field.CustomFieldComponentClass;
7393
+ default:
7394
+ throw new Error(`Trying to use an unsupported type (${this.field.type}).`);
7396
7395
  }
7397
7396
  }
7398
- destroyPasswordStrength() {
7399
- if (this.componentRef !== null) {
7400
- this.appRef.detachView(this.componentRef.hostView);
7401
- this.componentRef.destroy();
7402
- this.componentRef = null;
7397
+ }
7398
+ class DynamicStructure extends DynamicForm {
7399
+ constructor({ group, config, errorMessages }) {
7400
+ super({
7401
+ group,
7402
+ errorMessages,
7403
+ });
7404
+ this.config = config;
7405
+ }
7406
+ createComponent(resolver, container) {
7407
+ const componentFactory = resolver.resolveComponentFactory(this.getComponent());
7408
+ const component = container.createComponent(componentFactory);
7409
+ component.instance.config = this.config;
7410
+ component.instance.group = this.group;
7411
+ return component;
7412
+ }
7413
+ updateVariables(component) {
7414
+ component.instance.structure = this.config;
7415
+ component.instance.group = this.group;
7416
+ }
7417
+ getComponent() {
7418
+ switch (this.config.type) {
7419
+ case StructureType.Fieldset:
7420
+ return FieldsetComponent;
7421
+ case StructureType.Section:
7422
+ return SectionComponent;
7423
+ default:
7424
+ throw new Error(`Trying to use an unsupported type (${this.config.type}).`);
7403
7425
  }
7404
7426
  }
7405
- defaultValidator(content) {
7406
- let points = 0;
7407
- const regExpValidations = [
7408
- new RegExp("(?=.*\\d)"),
7409
- new RegExp("(?=.*[a-z])"),
7410
- new RegExp("(?=.*[A-Z])"),
7411
- new RegExp("(?=.*[!@#$%&*.\\-=+^~])"),
7412
- ];
7413
- if (content.length >= 6) {
7414
- points++;
7427
+ }
7428
+ class DynamicGrid extends DynamicForm {
7429
+ constructor({ group, config, errorMessages }) {
7430
+ super({ group, errorMessages });
7431
+ this.config = config;
7432
+ }
7433
+ createComponent(resolver, container) {
7434
+ const componentFactory = resolver.resolveComponentFactory(this.getComponent());
7435
+ const component = container.createComponent(componentFactory);
7436
+ component.instance.config = this.config;
7437
+ component.instance.group = this.group;
7438
+ component.instance.errorMessages = this.errorMessages;
7439
+ return component;
7440
+ }
7441
+ updateVariables(component) {
7442
+ component.instance.config = this.config;
7443
+ component.instance.group = this.group;
7444
+ }
7445
+ getComponent() {
7446
+ switch (this.config.type) {
7447
+ case GridType.Row:
7448
+ return RowComponent;
7449
+ default:
7450
+ throw new Error(`Trying to use an unsupported type (${this.config.type}).`);
7415
7451
  }
7416
- regExpValidations.forEach(validation => {
7417
- if (validation.test(content)) {
7418
- points++;
7452
+ }
7453
+ }
7454
+
7455
+ let DynamicFormDirective = class DynamicFormDirective {
7456
+ constructor(resolver, container) {
7457
+ this.resolver = resolver;
7458
+ this.container = container;
7459
+ }
7460
+ set sDynamicForm(context) {
7461
+ const { id, config, group, errorMessages } = context;
7462
+ this.id = id;
7463
+ this.config = config;
7464
+ this.group = group;
7465
+ this.errorMessages = errorMessages;
7466
+ }
7467
+ ngOnInit() {
7468
+ if (this.isField()) {
7469
+ if (!(this.config.id) && this.id) {
7470
+ this.config.id = this.id + "-" + this.config.name;
7419
7471
  }
7420
- });
7421
- if (points < 1) {
7422
- return PasswordStrengths.VeryWeak;
7472
+ this.directiveConfig = new DynamicField({
7473
+ group: this.group,
7474
+ field: this.config,
7475
+ errorMessages: this.errorMessages,
7476
+ });
7423
7477
  }
7424
- else if (points < 4) {
7425
- return PasswordStrengths.Weak;
7478
+ else if (this.isStructure()) {
7479
+ this.directiveConfig = new DynamicStructure({
7480
+ group: this.group,
7481
+ config: this.config,
7482
+ errorMessages: this.errorMessages,
7483
+ });
7426
7484
  }
7427
- else if (points < 5) {
7428
- return PasswordStrengths.Medium;
7485
+ else if (this.isGrid()) {
7486
+ this.directiveConfig = new DynamicGrid({
7487
+ group: this.group,
7488
+ config: this.config,
7489
+ errorMessages: this.errorMessages,
7490
+ });
7429
7491
  }
7430
- else {
7431
- return PasswordStrengths.Strong;
7492
+ else
7493
+ throw new Error(`Trying to use an unsupported type (${this.config.type}).`);
7494
+ this.component = this.directiveConfig.createComponent(this.resolver, this.container);
7495
+ this.component.instance.id = this.id;
7496
+ this.component.instance.errorMessages = this.errorMessages;
7497
+ }
7498
+ ngOnChanges() {
7499
+ if (this.component) {
7500
+ this.directiveConfig.updateVariables(this.component);
7501
+ this.component.instance.errorMessages = this.errorMessages;
7432
7502
  }
7433
7503
  }
7504
+ isField() {
7505
+ return FieldType[this.config.type];
7506
+ }
7507
+ isStructure() {
7508
+ return StructureType[this.config.type];
7509
+ }
7510
+ isGrid() {
7511
+ return GridType[this.config.type];
7512
+ }
7434
7513
  };
7435
- PasswordStrengthDirective.ctorParameters = () => [
7436
- { type: ElementRef },
7437
- { type: ApplicationRef },
7514
+ DynamicFormDirective.ctorParameters = () => [
7438
7515
  { type: ComponentFactoryResolver },
7439
- { type: Injector }
7516
+ { type: ViewContainerRef }
7440
7517
  ];
7441
7518
  __decorate([
7442
- Input("sPasswordStrength")
7443
- ], PasswordStrengthDirective.prototype, "enabled", void 0);
7444
- __decorate([
7445
- Input("psValidation")
7446
- ], PasswordStrengthDirective.prototype, "validation", void 0);
7447
- __decorate([
7448
- Input("psPosition")
7449
- ], PasswordStrengthDirective.prototype, "position", void 0);
7450
- __decorate([
7451
- Input("psWeakTitle")
7452
- ], PasswordStrengthDirective.prototype, "weakTitle", void 0);
7453
- __decorate([
7454
- Input("psMediumTitle")
7455
- ], PasswordStrengthDirective.prototype, "mediumTitle", void 0);
7456
- __decorate([
7457
- Input("psStrongTitle")
7458
- ], PasswordStrengthDirective.prototype, "strongTitle", void 0);
7459
- __decorate([
7460
- Input("psDescription")
7461
- ], PasswordStrengthDirective.prototype, "description", void 0);
7462
- __decorate([
7463
- HostListener("keyup"),
7464
- HostListener("focus")
7465
- ], PasswordStrengthDirective.prototype, "onFocus", null);
7519
+ Input()
7520
+ ], DynamicFormDirective.prototype, "sDynamicForm", null);
7466
7521
  __decorate([
7467
- HostListener("blur")
7468
- ], PasswordStrengthDirective.prototype, "onBlur", null);
7469
- PasswordStrengthDirective = __decorate([
7470
- Directive({
7471
- selector: "[sPasswordStrength]",
7472
- })
7473
- ], PasswordStrengthDirective);
7474
-
7475
- let PasswordStrengthModule = class PasswordStrengthModule {
7476
- };
7477
- PasswordStrengthModule = __decorate([
7478
- NgModule({
7479
- imports: [CommonModule],
7480
- declarations: [
7481
- PasswordStrengthComponent,
7482
- PasswordStrengthDirective,
7483
- ],
7484
- exports: [PasswordStrengthDirective],
7485
- })
7486
- ], PasswordStrengthModule);
7522
+ Input("sDynamicFormDisplayTimeInfoSign")
7523
+ ], DynamicFormDirective.prototype, "displayTimeInfoSign", void 0);
7524
+ DynamicFormDirective = __decorate([
7525
+ Directive({ selector: "[sDynamicForm]" })
7526
+ ], DynamicFormDirective);
7487
7527
 
7488
7528
  let DynamicFormModule = class DynamicFormModule {
7489
7529
  };
7490
7530
  DynamicFormModule = __decorate([
7491
7531
  NgModule({
7492
7532
  imports: [
7493
- CommonModule,
7494
- FormsModule,
7495
- ReactiveFormsModule,
7496
- TooltipModule,
7497
- InputTextModule,
7498
- CheckboxModule,
7499
- CalendarModule,
7500
- InputMaskModule,
7501
- DropdownModule,
7502
- NumberInputModule,
7503
- BignumberInputModule,
7504
- LocalizedNumberInputModule,
7505
- ControlErrorsModule,
7506
- LocaleModule,
7507
7533
  AutoCompleteModule,
7508
- MultiSelectModule,
7509
- ButtonModule$1,
7534
+ BignumberInputModule,
7510
7535
  ButtonModule,
7511
- PanelModule$1,
7536
+ CalendarMaskModule,
7537
+ CalendarModule,
7538
+ CheckboxModule,
7539
+ ChipsModule,
7540
+ CommonModule,
7541
+ ControlErrorsModule,
7542
+ CountryPhonePickerModule,
7512
7543
  DialogModule,
7513
- RadioButtonModule,
7514
- TableModule$1,
7544
+ DropdownModule,
7515
7545
  EmptyStateModule,
7516
- LoadingStateModule,
7546
+ FormsModule,
7517
7547
  HotkeyModule,
7518
- ChipsModule,
7519
- CalendarMaskModule,
7548
+ InputMaskModule,
7520
7549
  InputTextareaModule,
7521
- RadioButtonModule,
7550
+ InputTextModule,
7522
7551
  KeyFilterModule,
7552
+ LoadingStateModule,
7553
+ LocaleModule,
7554
+ LocalizedNumberInputModule,
7555
+ PanelModule$1,
7556
+ ButtonModule$1,
7557
+ TableModule$1,
7558
+ MultiSelectModule,
7559
+ NumberInputModule,
7560
+ RadioButtonModule,
7561
+ ReactiveFormsModule,
7562
+ TooltipModule,
7523
7563
  FieldsetModule,
7524
7564
  TableHeaderCheckboxModule,
7525
7565
  FileUploadModule,
@@ -7535,52 +7575,54 @@ DynamicFormModule = __decorate([
7535
7575
  ],
7536
7576
  declarations: [
7537
7577
  AutocompleteFieldComponent,
7578
+ BignumberFieldComponent,
7538
7579
  BooleanFieldComponent,
7580
+ BooleanSwitchFieldComponent,
7539
7581
  CalendarFieldComponent,
7540
7582
  ChipsFieldComponent,
7583
+ CountryPhonePickerFieldComponent,
7541
7584
  CurrencyFieldComponent,
7542
- DynamicFormComponent,
7543
7585
  DynamicFieldComponent,
7586
+ DynamicFormComponent,
7544
7587
  DynamicFormDirective,
7545
7588
  FieldsetComponent,
7546
7589
  FileUploadComponent$1,
7547
7590
  LookupComponent,
7548
7591
  LookupFieldComponent,
7549
7592
  NumberFieldComponent,
7550
- BignumberFieldComponent,
7593
+ PasswordFieldComponent,
7551
7594
  RadioButtonComponent,
7552
7595
  RowComponent,
7553
7596
  SectionComponent,
7554
7597
  SelectFieldComponent,
7598
+ SliderFieldComponent,
7555
7599
  TextAreaFieldComponent,
7556
7600
  TextAreaIAFieldComponent,
7557
7601
  TextFieldComponent,
7558
- BooleanSwitchFieldComponent,
7559
- PasswordFieldComponent,
7560
- SliderFieldComponent,
7561
7602
  ],
7562
7603
  exports: [DynamicFormComponent, LookupComponent],
7563
7604
  entryComponents: [
7564
7605
  AutocompleteFieldComponent,
7606
+ BignumberFieldComponent,
7565
7607
  BooleanFieldComponent,
7608
+ BooleanSwitchFieldComponent,
7566
7609
  CalendarFieldComponent,
7567
7610
  ChipsFieldComponent,
7611
+ CountryPhonePickerFieldComponent,
7568
7612
  CurrencyFieldComponent,
7569
7613
  FieldsetComponent,
7570
7614
  FileUploadComponent$1,
7571
7615
  LookupFieldComponent,
7572
7616
  NumberFieldComponent,
7573
- BignumberFieldComponent,
7617
+ PasswordFieldComponent,
7574
7618
  RadioButtonComponent,
7575
7619
  RowComponent,
7576
7620
  SectionComponent,
7577
7621
  SelectFieldComponent,
7622
+ SliderFieldComponent,
7578
7623
  TextAreaFieldComponent,
7579
7624
  TextAreaIAFieldComponent,
7580
7625
  TextFieldComponent,
7581
- PasswordFieldComponent,
7582
- BooleanSwitchFieldComponent,
7583
- SliderFieldComponent,
7584
7626
  ],
7585
7627
  providers: [
7586
7628
  HotkeysService,
@@ -14727,5 +14769,5 @@ const fallback = {
14727
14769
  * Generated bundle index. Do not edit.
14728
14770
  */
14729
14771
 
14730
- export { AccordionComponent, AccordionModule, AccordionPanelComponent, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileValidation, FormField, GanttComponent, GanttModule, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RatingScaleComponent, RatingScaleModule, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, SwitchComponent, SwitchModule, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TieredMenuDirective, TieredMenuModule, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, ViewMode, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, SelectFieldComponent as ɵba, TextAreaFieldComponent as ɵbb, TextAreaIAFieldComponent as ɵbc, IAssistService as ɵbd, TextFieldComponent as ɵbe, BooleanSwitchFieldComponent as ɵbf, PasswordFieldComponent as ɵbg, SliderFieldComponent as ɵbh, DecimalField as ɵbj, SideTableComponent as ɵbk, StructureModule as ɵbl, HeaderComponent as ɵbm, FooterComponent as ɵbn, NumberLocaleOptions as ɵbo, ThumbnailService as ɵbp, BorderButtonModule as ɵbq, BorderButtonComponent as ɵbr, TimelineItemModule as ɵbs, TimelineIconItemComponent as ɵbt, HorizontalTimelineModule as ɵbu, HorizontalTimelineComponent as ɵbv, VerticalTimelineModule as ɵbw, VerticalTimelineComponent as ɵbx, RangeLineComponent as ɵby, CollapseOptionComponent as ɵbz, CountryPhonePickerService as ɵc, CollapsedItemsComponent as ɵca, VerticalItemsComponent as ɵcb, InfiniteScrollModule as ɵcc, InfiniteScrollDirective as ɵcd, CustomTranslationsModule as ɵce, CodeEditorComponent as ɵcf, CoreFacade as ɵcg, CodeMirror6Core as ɵch, TieredMenuEventService as ɵci, TieredMenuService as ɵcj, TieredMenuComponent as ɵck, TieredMenuNestedComponent as ɵcl, TieredMenuItemComponent as ɵcm, TieredMenuDividerComponent as ɵcn, LocalizedCurrencyImpurePipe as ɵd, LocalizedBignumberPipe as ɵe, LocalizedBignumberImpurePipe as ɵf, EmptyStateGoBackComponent as ɵg, FileUploadService as ɵh, InfoSignComponent as ɵi, TableColumnsComponent as ɵj, TablePagingComponent as ɵk, AutocompleteFieldComponent as ɵl, BooleanFieldComponent as ɵm, CalendarFieldComponent as ɵn, ChipsFieldComponent as ɵo, CurrencyFieldComponent as ɵp, DynamicFieldComponent as ɵq, DynamicFormDirective as ɵr, FieldsetComponent as ɵs, FileUploadComponent$1 as ɵt, LookupFieldComponent as ɵu, NumberFieldComponent as ɵv, BignumberFieldComponent as ɵw, RadioButtonComponent as ɵx, RowComponent as ɵy, SectionComponent as ɵz };
14772
+ export { AccordionComponent, AccordionModule, AccordionPanelComponent, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileValidation, FormField, GanttComponent, GanttModule, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RatingScaleComponent, RatingScaleModule, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, SwitchComponent, SwitchModule, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TieredMenuDirective, TieredMenuModule, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, ViewMode, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, RadioButtonComponent as ɵba, RowComponent as ɵbb, SectionComponent as ɵbc, SelectFieldComponent as ɵbd, SliderFieldComponent as ɵbe, TextAreaFieldComponent as ɵbf, TextAreaIAFieldComponent as ɵbg, IAssistService as ɵbh, TextFieldComponent as ɵbi, DecimalField as ɵbk, SideTableComponent as ɵbl, StructureModule as ɵbm, HeaderComponent as ɵbn, FooterComponent as ɵbo, NumberLocaleOptions as ɵbp, ThumbnailService as ɵbq, BorderButtonModule as ɵbr, BorderButtonComponent as ɵbs, TimelineItemModule as ɵbt, TimelineIconItemComponent as ɵbu, HorizontalTimelineModule as ɵbv, HorizontalTimelineComponent as ɵbw, VerticalTimelineModule as ɵbx, VerticalTimelineComponent as ɵby, RangeLineComponent as ɵbz, CountryPhonePickerService as ɵc, CollapseOptionComponent as ɵca, CollapsedItemsComponent as ɵcb, VerticalItemsComponent as ɵcc, InfiniteScrollModule as ɵcd, InfiniteScrollDirective as ɵce, CustomTranslationsModule as ɵcf, CodeEditorComponent as ɵcg, CoreFacade as ɵch, CodeMirror6Core as ɵci, TieredMenuEventService as ɵcj, TieredMenuService as ɵck, TieredMenuComponent as ɵcl, TieredMenuNestedComponent as ɵcm, TieredMenuItemComponent as ɵcn, TieredMenuDividerComponent as ɵco, LocalizedCurrencyImpurePipe as ɵd, LocalizedBignumberPipe as ɵe, LocalizedBignumberImpurePipe as ɵf, EmptyStateGoBackComponent as ɵg, FileUploadService as ɵh, InfoSignComponent as ɵi, TableColumnsComponent as ɵj, TablePagingComponent as ɵk, AutocompleteFieldComponent as ɵl, BignumberFieldComponent as ɵm, BooleanFieldComponent as ɵn, BooleanSwitchFieldComponent as ɵo, CalendarFieldComponent as ɵp, ChipsFieldComponent as ɵq, CountryPhonePickerFieldComponent as ɵr, CurrencyFieldComponent as ɵs, DynamicFieldComponent as ɵt, DynamicFormDirective as ɵu, FieldsetComponent as ɵv, FileUploadComponent$1 as ɵw, LookupFieldComponent as ɵx, NumberFieldComponent as ɵy, PasswordFieldComponent as ɵz };
14731
14773
  //# sourceMappingURL=seniorsistemas-angular-components.js.map