@seniorsistemas/angular-components 17.2.10 → 17.2.12

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 (43) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +1646 -1596
  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/components/fields/select/select-field.component.js +2 -2
  15. package/esm2015/components/dynamic-form/configurations/field-type.js +2 -1
  16. package/esm2015/components/dynamic-form/configurations/fields/country-phone-picker-field.js +11 -0
  17. package/esm2015/components/dynamic-form/configurations/fields/index.js +20 -0
  18. package/esm2015/components/dynamic-form/configurations/fields/select-field.js +2 -2
  19. package/esm2015/components/dynamic-form/configurations/form-field.js +4 -1
  20. package/esm2015/components/dynamic-form/dynamic-form.js +7 -4
  21. package/esm2015/components/dynamic-form/dynamic-form.module.js +56 -47
  22. package/esm2015/locale/fallback.js +2 -1
  23. package/esm2015/seniorsistemas-angular-components.js +55 -54
  24. package/esm5/components/country-phone-picker/country-phone-picker.component.js +13 -2
  25. package/esm5/components/dynamic-form/components/fields/base-field-component.js +1 -1
  26. package/esm5/components/dynamic-form/components/fields/country-phone-picker/country-phone-picker-field.component.js +20 -0
  27. package/esm5/components/dynamic-form/components/fields/select/select-field.component.js +2 -2
  28. package/esm5/components/dynamic-form/configurations/field-type.js +2 -1
  29. package/esm5/components/dynamic-form/configurations/fields/country-phone-picker-field.js +16 -0
  30. package/esm5/components/dynamic-form/configurations/fields/index.js +20 -0
  31. package/esm5/components/dynamic-form/configurations/fields/select-field.js +2 -2
  32. package/esm5/components/dynamic-form/configurations/form-field.js +4 -1
  33. package/esm5/components/dynamic-form/dynamic-form.js +7 -4
  34. package/esm5/components/dynamic-form/dynamic-form.module.js +56 -47
  35. package/esm5/locale/fallback.js +2 -1
  36. package/esm5/seniorsistemas-angular-components.js +55 -54
  37. package/fesm2015/seniorsistemas-angular-components.js +1472 -1429
  38. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  39. package/fesm5/seniorsistemas-angular-components.js +1589 -1540
  40. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  41. package/package.json +1 -1
  42. package/seniorsistemas-angular-components.d.ts +54 -53
  43. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/animations'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('primeng/breadcrumb'), require('primeng/tieredmenu'), require('primeng/tooltip'), require('primeng/dom'), require('primeng/calendar'), require('@ngx-translate/core'), require('ngx-mask'), require('@angular/common/http'), require('angular2-hotkeys'), require('bignumber.js'), require('primeng/autocomplete'), require('primeng/dialog'), require('primeng/table'), require('@seniorsistemas/ng2-currency-mask'), require('@seniorsistemas/senior-platform-data'), require('moment'), require('ngx-cookie-service'), require('ng2-currency-mask'), require('primeng/button'), require('primeng/checkbox'), require('primeng/chips'), require('primeng/dropdown'), require('primeng/fieldset'), require('primeng/inputmask'), require('primeng/inputtext'), require('primeng/inputtextarea'), require('primeng/keyfilter'), require('primeng/multiselect'), require('primeng/panel'), require('primeng/radiobutton'), require('primeng/slider'), require('primeng/progressbar'), require('@angular/platform-browser'), require('@angular/cdk/clipboard'), require('primeng/api'), require('cropperjs'), require('element-resize-detector'), require('@angular/cdk/a11y'), require('primeng/scrollpanel'), require('primeng/sidebar'), require('primeng/confirmdialog'), require('@codemirror/view'), require('@codemirror/state'), require('@codemirror/lint'), require('@codemirror/language'), require('@lezer/generator'), require('@codemirror/highlight'), require('@codemirror/autocomplete'), require('@codemirror/tooltip'), require('@codemirror/gutter')) :
3
- typeof define === 'function' && define.amd ? define('@seniorsistemas/angular-components', ['exports', '@angular/core', '@angular/animations', 'rxjs', 'rxjs/operators', '@angular/common', '@angular/forms', '@angular/router', 'primeng/breadcrumb', 'primeng/tieredmenu', 'primeng/tooltip', 'primeng/dom', 'primeng/calendar', '@ngx-translate/core', 'ngx-mask', '@angular/common/http', 'angular2-hotkeys', 'bignumber.js', 'primeng/autocomplete', 'primeng/dialog', 'primeng/table', '@seniorsistemas/ng2-currency-mask', '@seniorsistemas/senior-platform-data', 'moment', 'ngx-cookie-service', 'ng2-currency-mask', 'primeng/button', 'primeng/checkbox', 'primeng/chips', 'primeng/dropdown', 'primeng/fieldset', 'primeng/inputmask', 'primeng/inputtext', 'primeng/inputtextarea', 'primeng/keyfilter', 'primeng/multiselect', 'primeng/panel', 'primeng/radiobutton', 'primeng/slider', 'primeng/progressbar', '@angular/platform-browser', '@angular/cdk/clipboard', 'primeng/api', 'cropperjs', 'element-resize-detector', '@angular/cdk/a11y', 'primeng/scrollpanel', 'primeng/sidebar', 'primeng/confirmdialog', '@codemirror/view', '@codemirror/state', '@codemirror/lint', '@codemirror/language', '@lezer/generator', '@codemirror/highlight', '@codemirror/autocomplete', '@codemirror/tooltip', '@codemirror/gutter'], factory) :
4
- (global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['angular-components'] = {}), global.ng.core, global.ng.animations, global.rxjs, global.rxjs.operators, global.ng.common, global.ng.forms, global.ng.router, global.breadcrumb, global.tieredmenu, global.tooltip, global.dom, global.calendar, global.core$1, global.ngxMask, global.ng.common.http, global.angular2Hotkeys, global.BigNumber, global.autocomplete$1, global.dialog, global.table, global.ng2CurrencyMask, global.seniorPlatformData, global.moment_, global.ngxCookieService, global.ng2CurrencyMask$1, global.button, global.checkbox, global.chips, global.dropdown, global.fieldset, global.inputmask, global.inputtext, global.inputtextarea, global.keyfilter, global.multiselect, global.panel, global.radiobutton, global.slider, global.progressbar, global.ng.platformBrowser, global.ng.cdk.clipboard, global.api, global.Cropper, global.elementResizeDetectorMaker_, global.ng.cdk.a11y, global.scrollpanel, global.sidebar, global.confirmdialog, global.view, global.state, global.lint, global.language, global.generator, global.highlight, global.autocomplete$2, global.tooltip$1, global.gutter));
5
- }(this, (function (exports, core, animations, rxjs, operators, common, forms, router, breadcrumb, tieredmenu, tooltip, dom, calendar, core$1, ngxMask, http, angular2Hotkeys, BigNumber, autocomplete$1, dialog, table, ng2CurrencyMask, seniorPlatformData, moment_, ngxCookieService, ng2CurrencyMask$1, button, checkbox, chips, dropdown, fieldset, inputmask, inputtext, inputtextarea, keyfilter, multiselect, panel, radiobutton, slider, progressbar, platformBrowser, clipboard, api, Cropper, elementResizeDetectorMaker_, a11y, scrollpanel, sidebar, confirmdialog, view, state, lint, language, generator, highlight, autocomplete$2, tooltip$1, gutter) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/animations'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('primeng/breadcrumb'), require('primeng/tieredmenu'), require('primeng/tooltip'), require('primeng/dom'), require('primeng/calendar'), require('@ngx-translate/core'), require('ngx-mask'), require('@angular/common/http'), require('angular2-hotkeys'), require('bignumber.js'), require('primeng/autocomplete'), require('primeng/dialog'), require('primeng/table'), require('@seniorsistemas/ng2-currency-mask'), require('@seniorsistemas/senior-platform-data'), require('moment'), require('ngx-cookie-service'), require('ng2-currency-mask'), require('primeng/button'), require('primeng/checkbox'), require('primeng/chips'), require('primeng/dropdown'), require('primeng/fieldset'), require('primeng/inputmask'), require('primeng/inputtext'), require('primeng/inputtextarea'), require('primeng/keyfilter'), require('primeng/multiselect'), require('primeng/panel'), require('primeng/radiobutton'), require('primeng/slider'), require('primeng/api'), require('primeng/progressbar'), require('@angular/platform-browser'), require('@angular/cdk/clipboard'), require('cropperjs'), require('element-resize-detector'), require('@angular/cdk/a11y'), require('primeng/scrollpanel'), require('primeng/sidebar'), require('primeng/confirmdialog'), require('@codemirror/view'), require('@codemirror/state'), require('@codemirror/lint'), require('@codemirror/language'), require('@lezer/generator'), require('@codemirror/highlight'), require('@codemirror/autocomplete'), require('@codemirror/tooltip'), require('@codemirror/gutter')) :
3
+ typeof define === 'function' && define.amd ? define('@seniorsistemas/angular-components', ['exports', '@angular/core', '@angular/animations', 'rxjs', 'rxjs/operators', '@angular/common', '@angular/forms', '@angular/router', 'primeng/breadcrumb', 'primeng/tieredmenu', 'primeng/tooltip', 'primeng/dom', 'primeng/calendar', '@ngx-translate/core', 'ngx-mask', '@angular/common/http', 'angular2-hotkeys', 'bignumber.js', 'primeng/autocomplete', 'primeng/dialog', 'primeng/table', '@seniorsistemas/ng2-currency-mask', '@seniorsistemas/senior-platform-data', 'moment', 'ngx-cookie-service', 'ng2-currency-mask', 'primeng/button', 'primeng/checkbox', 'primeng/chips', 'primeng/dropdown', 'primeng/fieldset', 'primeng/inputmask', 'primeng/inputtext', 'primeng/inputtextarea', 'primeng/keyfilter', 'primeng/multiselect', 'primeng/panel', 'primeng/radiobutton', 'primeng/slider', 'primeng/api', 'primeng/progressbar', '@angular/platform-browser', '@angular/cdk/clipboard', 'cropperjs', 'element-resize-detector', '@angular/cdk/a11y', 'primeng/scrollpanel', 'primeng/sidebar', 'primeng/confirmdialog', '@codemirror/view', '@codemirror/state', '@codemirror/lint', '@codemirror/language', '@lezer/generator', '@codemirror/highlight', '@codemirror/autocomplete', '@codemirror/tooltip', '@codemirror/gutter'], factory) :
4
+ (global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['angular-components'] = {}), global.ng.core, global.ng.animations, global.rxjs, global.rxjs.operators, global.ng.common, global.ng.forms, global.ng.router, global.breadcrumb, global.tieredmenu, global.tooltip, global.dom, global.calendar, global.core$1, global.ngxMask, global.ng.common.http, global.angular2Hotkeys, global.BigNumber, global.autocomplete$1, global.dialog, global.table, global.ng2CurrencyMask, global.seniorPlatformData, global.moment_, global.ngxCookieService, global.ng2CurrencyMask$1, global.button, global.checkbox, global.chips, global.dropdown, global.fieldset, global.inputmask, global.inputtext, global.inputtextarea, global.keyfilter, global.multiselect, global.panel, global.radiobutton, global.slider, global.api, global.progressbar, global.ng.platformBrowser, global.ng.cdk.clipboard, global.Cropper, global.elementResizeDetectorMaker_, global.ng.cdk.a11y, global.scrollpanel, global.sidebar, global.confirmdialog, global.view, global.state, global.lint, global.language, global.generator, global.highlight, global.autocomplete$2, global.tooltip$1, global.gutter));
5
+ }(this, (function (exports, core, animations, rxjs, operators, common, forms, router, breadcrumb, tieredmenu, tooltip, dom, calendar, core$1, ngxMask, http, angular2Hotkeys, BigNumber, autocomplete$1, dialog, table, ng2CurrencyMask, seniorPlatformData, moment_, ngxCookieService, ng2CurrencyMask$1, button, checkbox, chips, dropdown, fieldset, inputmask, inputtext, inputtextarea, keyfilter, multiselect, panel, radiobutton, slider, api, progressbar, platformBrowser, clipboard, Cropper, elementResizeDetectorMaker_, a11y, scrollpanel, sidebar, confirmdialog, view, state, lint, language, generator, highlight, autocomplete$2, tooltip$1, gutter) { 'use strict';
6
6
 
7
7
  var BigNumber__default = 'default' in BigNumber ? BigNumber['default'] : BigNumber;
8
8
  Cropper = Cropper && Cropper.hasOwnProperty('default') ? Cropper['default'] : Cropper;
@@ -2265,7 +2265,11 @@
2265
2265
  this.offsetTop = 0;
2266
2266
  this.ordination = exports.Ordination.NO;
2267
2267
  this.selected = new core.EventEmitter();
2268
+ /**
2269
+ * @deprecated Use focusLost event instead.
2270
+ */
2268
2271
  this.blur = new core.EventEmitter();
2272
+ this.focusLost = new core.EventEmitter();
2269
2273
  this.tabindex = 0;
2270
2274
  this._filterCountries = function (value) {
2271
2275
  if (!value) {
@@ -2404,6 +2408,10 @@
2404
2408
  CountryPhonePickerComponent.prototype.getPlaceholder = function () {
2405
2409
  return this.mask.replace(/9/g, "");
2406
2410
  };
2411
+ CountryPhonePickerComponent.prototype.onBlur = function (value) {
2412
+ this.blur.emit(value);
2413
+ this.focusLost.emit(value);
2414
+ };
2407
2415
  CountryPhonePickerComponent.prototype._getSelectedCountryDefault = function () {
2408
2416
  if (!this._countriesList.length) {
2409
2417
  throw new Error("No country loaded");
@@ -2497,6 +2505,9 @@
2497
2505
  __decorate([
2498
2506
  core.Output()
2499
2507
  ], CountryPhonePickerComponent.prototype, "blur", void 0);
2508
+ __decorate([
2509
+ core.Output()
2510
+ ], CountryPhonePickerComponent.prototype, "focusLost", void 0);
2500
2511
  __decorate([
2501
2512
  core.ViewChild("phoneInput", { static: true })
2502
2513
  ], CountryPhonePickerComponent.prototype, "phoneInput", void 0);
@@ -2512,7 +2523,7 @@
2512
2523
  CountryPhonePickerComponent = CountryPhonePickerComponent_1 = __decorate([
2513
2524
  core.Component({
2514
2525
  selector: "s-country-phone-picker",
2515
- 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>",
2526
+ 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>",
2516
2527
  providers: [{
2517
2528
  provide: forms.NG_VALUE_ACCESSOR,
2518
2529
  useExisting: core.forwardRef(function () { return CountryPhonePickerComponent_1; }),
@@ -2550,6 +2561,7 @@
2550
2561
  FieldType["Blob"] = "Blob";
2551
2562
  FieldType["Boolean"] = "Boolean";
2552
2563
  FieldType["Chips"] = "Chips";
2564
+ FieldType["CountryPhonePicker"] = "CountryPhonePicker";
2553
2565
  FieldType["Custom"] = "Custom";
2554
2566
  FieldType["Date"] = "Date";
2555
2567
  FieldType["DateTime"] = "DateTime";
@@ -3412,7 +3424,7 @@
3412
3424
  _this.autoDisplayFirst = config.autoDisplayFirst;
3413
3425
  _this.options = config.options;
3414
3426
  _this.multiple = config.multiple;
3415
- _this.multipleSelectedLabel = config.multipleSelectedLabel || "{0} registros selecionados";
3427
+ _this.multipleSelectedLabel = config.multipleSelectedLabel;
3416
3428
  _this.onClick = config.onClick;
3417
3429
  _this.onChange = config.onChange;
3418
3430
  _this.emptyMessage = config.emptyMessage;
@@ -3519,6 +3531,19 @@
3519
3531
  return SliderField;
3520
3532
  }(Field));
3521
3533
 
3534
+ var CountryPhonePickerField = /** @class */ (function (_super) {
3535
+ __extends(CountryPhonePickerField, _super);
3536
+ function CountryPhonePickerField(config) {
3537
+ var _this = _super.call(this, config) || this;
3538
+ _this.countries = config.countries;
3539
+ _this.ordination = config.ordination;
3540
+ _this.onSelected = config.onSelected;
3541
+ _this.onFocusLost = config.onFocusLost;
3542
+ return _this;
3543
+ }
3544
+ return CountryPhonePickerField;
3545
+ }(Field));
3546
+
3522
3547
  var FormField = /** @class */ (function () {
3523
3548
  function FormField(config) {
3524
3549
  switch (config.type) {
@@ -3556,6 +3581,8 @@
3556
3581
  return new RadioButtonField(config);
3557
3582
  case exports.FieldType.Chips:
3558
3583
  return new ChipsField(config);
3584
+ case exports.FieldType.CountryPhonePicker:
3585
+ return new CountryPhonePickerField(config);
3559
3586
  case exports.FieldType.Blob:
3560
3587
  return new BlobField(config);
3561
3588
  case exports.FieldType.Slider:
@@ -4266,157 +4293,422 @@
4266
4293
  return DynamicFormComponent;
4267
4294
  }());
4268
4295
 
4269
- var EmptyStateComponent = /** @class */ (function () {
4270
- function EmptyStateComponent() {
4271
- this.id = "s-empty-state-" + EmptyStateComponent_1.nextId++;
4272
- this.iconClass = "fa fa-inbox";
4273
- this.showPrimaryAction = true;
4274
- this.showSecondaryAction = true;
4275
- this.primaryModel = [];
4276
- this.primaryAction = new core.EventEmitter();
4277
- this.secondaryAction = new core.EventEmitter();
4296
+ var IAssistService = /** @class */ (function () {
4297
+ function IAssistService(http, _messageService) {
4298
+ this.http = http;
4299
+ this._messageService = _messageService;
4278
4300
  }
4279
- EmptyStateComponent_1 = EmptyStateComponent;
4280
- var EmptyStateComponent_1;
4281
- EmptyStateComponent.nextId = 0;
4282
- __decorate([
4283
- core.Input()
4284
- ], EmptyStateComponent.prototype, "id", void 0);
4285
- __decorate([
4286
- core.Input()
4287
- ], EmptyStateComponent.prototype, "iconClass", void 0);
4288
- __decorate([
4289
- core.Input()
4290
- ], EmptyStateComponent.prototype, "title", void 0);
4291
- __decorate([
4292
- core.Input()
4293
- ], EmptyStateComponent.prototype, "description", void 0);
4294
- __decorate([
4295
- core.Input()
4296
- ], EmptyStateComponent.prototype, "showPrimaryAction", void 0);
4297
- __decorate([
4298
- core.Input()
4299
- ], EmptyStateComponent.prototype, "showSecondaryAction", void 0);
4300
- __decorate([
4301
- core.Input()
4302
- ], EmptyStateComponent.prototype, "primaryActionLabel", void 0);
4303
- __decorate([
4304
- core.Input()
4305
- ], EmptyStateComponent.prototype, "secondaryActionLabel", void 0);
4301
+ IAssistService.prototype.askIA = function (context, data) {
4302
+ var _this = this;
4303
+ return this.http.post("platform/iassist/api/latest/completions", {
4304
+ "prompt": this._createPrompt(context, data),
4305
+ "provider": "OPEN_AI",
4306
+ "parameters": {
4307
+ "model": "gpt-3.5-turbo",
4308
+ "max_tokens": 700,
4309
+ "temperature": 1
4310
+ }
4311
+ }).pipe(operators.catchError(function (err) {
4312
+ _this._messageService.add({
4313
+ severity: "error",
4314
+ summary: err.status ? String(err.status) : "Error",
4315
+ detail: (err.error && err.error.message) || err.statusText || err.message || "Error",
4316
+ });
4317
+ return rxjs.throwError(err);
4318
+ }));
4319
+ };
4320
+ IAssistService.prototype._createPrompt = function (context, data) {
4321
+ return "Crie um texto gen\u00E9rico para preencher o campo de textarea.\n " + (data.label ? "O campo tem o label " + data.label + "." : "") + "\n " + (data.id ? "O campo tem o id " + data.id + "." : "") + "\n " + (data.placeholder ? "Considere as instru\u00E7\u00F5es/sugest\u00F5es do placeholder: " + data.placeholder + "." : "") + "\n Baseie-se no contexto informado pelo usu\u00E1rio: '" + context + "'.\n O texto deve ser formal e conter informa\u00E7\u00F5es pertinentes a um campo como este, como se um usu\u00E1rio real tivesse preenchido com as informa\u00E7\u00F5es necess\u00E1rias. \n O texto deve ser neutro com rela\u00E7\u00E3o a generos, ra\u00E7as, religi\u00F5es, etc.\n O texto deve ser impessoal e n\u00E3o deve conter informa\u00E7\u00F5es pessoais do usu\u00E1rio.\n N\u00E3o direcione o texto a ningu\u00E9m, n\u00E3o use express\u00F5es como: caro, atenciosamente. gostaria, agrade\u00E7o. O texto deve ser gen\u00E9rico.\n \n Exemplos de texto:\n Um campo de descri\u00E7\u00E3o de usu\u00E1rio: \"Usu\u00E1rio com 20 anos, estudante de engenharia, gosta de jogar futebol e assistir filmes.\"\n Outro exemplo de descri\u00E7\u00E3o de usu\u00E1rio: \"Usu\u00E1rio administrador, com acesso total ao sistema, respons\u00E1vel por gerenciar os usu\u00E1rios e os produtos.\"\n Um campo de descri\u00E7\u00E3o de um produto: \"O produto \u00E9 um celular, com tela de 6 polegadas, 128GB de armazenamento, 4GB de mem\u00F3ria RAM, c\u00E2mera de 12MP e bateria de 4000mAh.\"\n Outro exemplo de descri\u00E7\u00E3o de produto: \"O produto \u00E9 uma geladeira, com capacidade de 500 litros, 2 portas, cor branca, com freezer e gaveta de legumes.\"\n Outro exemplo de descri\u00E7\u00E3o de produto: \"O produto \u00E9 uma camiseta, tamanho M, cor azul, 100% algod\u00E3o, com estampa de um gato.\"\n \n Em caso de contexto incompleto crie um texto gen\u00E9rico, como se fosse um exemplo de preenchimento do campo.\n O texto \u00E9 para um campo de textarea, ent\u00E3o escreva um texto sucinto.\n Exiba apenas o texto do output";
4322
+ };
4323
+ IAssistService.ctorParameters = function () { return [
4324
+ { type: http.HttpClient },
4325
+ { type: api.MessageService }
4326
+ ]; };
4327
+ IAssistService = __decorate([
4328
+ core.Injectable()
4329
+ ], IAssistService);
4330
+ return IAssistService;
4331
+ }());
4332
+
4333
+ var LongPressDirective = /** @class */ (function () {
4334
+ function LongPressDirective() {
4335
+ this.sLongPressDelay = 500;
4336
+ this.sLongPress = new core.EventEmitter();
4337
+ this.mouseUp = new rxjs.Subject();
4338
+ this.mouseDown = new rxjs.Subject();
4339
+ this.ngUnsubscribe = new rxjs.Subject();
4340
+ }
4341
+ LongPressDirective.prototype.onMouseUp = function (event) {
4342
+ this.mouseUp.next(event);
4343
+ };
4344
+ LongPressDirective.prototype.onMouseDown = function (event) {
4345
+ this.mouseDown.next(event);
4346
+ };
4347
+ LongPressDirective.prototype.ngOnInit = function () {
4348
+ var _this = this;
4349
+ this.mouseDown
4350
+ .pipe(operators.debounceTime(this.sLongPressDelay), operators.takeUntil(this.mouseUp), operators.repeat(), operators.takeUntil(this.ngUnsubscribe))
4351
+ .subscribe(function (event) { return _this.sLongPress.emit(event); });
4352
+ };
4353
+ LongPressDirective.prototype.ngOnDestroy = function () {
4354
+ this.ngUnsubscribe.next();
4355
+ this.ngUnsubscribe.complete();
4356
+ };
4306
4357
  __decorate([
4307
4358
  core.Input()
4308
- ], EmptyStateComponent.prototype, "primaryModel", void 0);
4359
+ ], LongPressDirective.prototype, "sLongPressDelay", void 0);
4309
4360
  __decorate([
4310
4361
  core.Output()
4311
- ], EmptyStateComponent.prototype, "primaryAction", void 0);
4362
+ ], LongPressDirective.prototype, "sLongPress", void 0);
4312
4363
  __decorate([
4313
- core.Output()
4314
- ], EmptyStateComponent.prototype, "secondaryAction", void 0);
4315
- EmptyStateComponent = EmptyStateComponent_1 = __decorate([
4316
- core.Component({
4317
- selector: "s-empty-state",
4318
- 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>",
4319
- 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%}"]
4364
+ core.HostListener("mouseup", ["$event"]),
4365
+ core.HostListener("touchend", ["$event"])
4366
+ ], LongPressDirective.prototype, "onMouseUp", null);
4367
+ __decorate([
4368
+ core.HostListener("mousedown", ["$event"]),
4369
+ core.HostListener("touchstart", ["$event"])
4370
+ ], LongPressDirective.prototype, "onMouseDown", null);
4371
+ LongPressDirective = __decorate([
4372
+ core.Directive({
4373
+ selector: "[sLongPress]",
4320
4374
  })
4321
- ], EmptyStateComponent);
4322
- return EmptyStateComponent;
4375
+ ], LongPressDirective);
4376
+ return LongPressDirective;
4323
4377
  }());
4324
4378
 
4325
- var EmptyStateGoBackComponent = /** @class */ (function () {
4326
- function EmptyStateGoBackComponent(cookieService) {
4327
- this.cookieService = cookieService;
4328
- this.iconClass = "fa fa-exclamation-triangle";
4379
+ var DoubleClickDirective = /** @class */ (function () {
4380
+ function DoubleClickDirective() {
4381
+ this.onDoubleClick = new core.EventEmitter();
4382
+ this._timeout = null;
4383
+ this._DOUBLE_CLICK_DELAY = 500;
4329
4384
  }
4330
- EmptyStateGoBackComponent.prototype.goBack = function () {
4331
- var portalUrl = this.cookieService.get("com.senior.portal.url");
4332
- window.open(portalUrl, "_top");
4385
+ DoubleClickDirective.prototype.onClick = function (event) {
4386
+ this.handleOnClickEvent(event);
4387
+ };
4388
+ DoubleClickDirective.prototype.handleOnClickEvent = function (event) {
4389
+ var _this = this;
4390
+ if (this._timeout) {
4391
+ this.clearTimeout();
4392
+ this.onDoubleClick.emit(event);
4393
+ }
4394
+ else {
4395
+ this._timeout = setTimeout(function () { return _this.clearTimeout(); }, this._DOUBLE_CLICK_DELAY);
4396
+ }
4397
+ };
4398
+ DoubleClickDirective.prototype.clearTimeout = function () {
4399
+ clearTimeout(this._timeout);
4400
+ this._timeout = null;
4333
4401
  };
4334
- EmptyStateGoBackComponent.nextId = 0;
4335
- EmptyStateGoBackComponent.ctorParameters = function () { return [
4336
- { type: ngxCookieService.CookieService }
4337
- ]; };
4338
- __decorate([
4339
- core.Input()
4340
- ], EmptyStateGoBackComponent.prototype, "iconClass", void 0);
4341
- __decorate([
4342
- core.Input()
4343
- ], EmptyStateGoBackComponent.prototype, "title", void 0);
4344
4402
  __decorate([
4345
- core.Input()
4346
- ], EmptyStateGoBackComponent.prototype, "description", void 0);
4403
+ core.Output()
4404
+ ], DoubleClickDirective.prototype, "onDoubleClick", void 0);
4347
4405
  __decorate([
4348
- core.Input()
4349
- ], EmptyStateGoBackComponent.prototype, "primaryActionLabel", void 0);
4350
- EmptyStateGoBackComponent = __decorate([
4351
- core.Component({
4352
- selector: "s-empty-state-go-back",
4353
- template: "<s-empty-state \n [iconClass]=\"iconClass\" \n [title]=\"title\" \n [description]=\"description\" \n (primaryAction)=\"goBack()\"\n [primaryActionLabel]=\"primaryActionLabel\">\n</s-empty-state>"
4406
+ core.HostListener("click", ["$event"])
4407
+ ], DoubleClickDirective.prototype, "onClick", null);
4408
+ DoubleClickDirective = __decorate([
4409
+ core.Directive({
4410
+ selector: '[sDoubleClick]'
4354
4411
  })
4355
- ], EmptyStateGoBackComponent);
4356
- return EmptyStateGoBackComponent;
4412
+ ], DoubleClickDirective);
4413
+ return DoubleClickDirective;
4357
4414
  }());
4358
4415
 
4359
- var EmptyStateModule = /** @class */ (function () {
4360
- function EmptyStateModule() {
4416
+ var MouseEventsModule = /** @class */ (function () {
4417
+ function MouseEventsModule() {
4361
4418
  }
4362
- EmptyStateModule = __decorate([
4419
+ MouseEventsModule = __decorate([
4363
4420
  core.NgModule({
4364
- imports: [common.CommonModule, ButtonModule],
4365
- providers: [ngxCookieService.CookieService],
4366
- declarations: [EmptyStateComponent, EmptyStateGoBackComponent],
4367
- exports: [EmptyStateComponent, EmptyStateGoBackComponent],
4421
+ imports: [common.CommonModule],
4422
+ declarations: [
4423
+ LongPressDirective,
4424
+ DoubleClickDirective
4425
+ ],
4426
+ exports: [
4427
+ LongPressDirective,
4428
+ DoubleClickDirective
4429
+ ],
4368
4430
  })
4369
- ], EmptyStateModule);
4370
- return EmptyStateModule;
4431
+ ], MouseEventsModule);
4432
+ return MouseEventsModule;
4371
4433
  }());
4372
4434
 
4373
- /**
4374
- * Formats a JSON response to a JS object
4375
- * @param response The response to format
4376
- * @returns A JS object based on the response's body
4377
- */
4378
- function formatJsonResponse(response) {
4379
- return __awaiter(this, void 0, void 0, function () {
4380
- return __generator(this, function (_a) {
4381
- return [2 /*return*/, response.json()];
4382
- });
4383
- });
4384
- }
4385
-
4386
- /**
4387
- * Formats a Blob response to a JS object
4388
- * @param response The response to format
4389
- * @returns A JS object based on the response's body
4390
- */
4391
- function formatBlobResponse(response) {
4392
- return __awaiter(this, void 0, void 0, function () {
4393
- var textResponse;
4394
- return __generator(this, function (_a) {
4395
- switch (_a.label) {
4396
- case 0: return [4 /*yield*/, response.blob()];
4397
- case 1: return [4 /*yield*/, (_a.sent()).text()];
4398
- case 2:
4399
- textResponse = _a.sent();
4400
- return [2 /*return*/, JSON.parse(textResponse)];
4401
- }
4402
- });
4403
- });
4404
- }
4405
-
4406
- /**
4407
- * Custom HttpClient for cases when is not possible to use the Angular's HttpClient
4408
- */
4409
- var CustomHttpClient = /** @class */ (function () {
4410
- function CustomHttpClient() {
4411
- }
4412
- /**
4413
- * Executes a Http Get
4414
- * @param url Url to execute the Get on
4415
- * @param init Optional additional configs
4416
- * @returns Whether a Promise<T> on request success or an error in request fail
4417
- */
4418
- CustomHttpClient.GET = function (url, init) {
4419
- if (init === void 0) { init = {}; }
4435
+ var BignumberInputDirective = /** @class */ (function (_super) {
4436
+ __extends(BignumberInputDirective, _super);
4437
+ function BignumberInputDirective() {
4438
+ var _this = _super !== null && _super.apply(this, arguments) || this;
4439
+ _this.precision = 15;
4440
+ _this.scale = 0;
4441
+ _this.decimalSeparator = ",";
4442
+ _this.alignTo = ng2CurrencyMask.AlignmentOptions.LEFT;
4443
+ _this.allowNegative = true;
4444
+ return _this;
4445
+ }
4446
+ BignumberInputDirective_1 = BignumberInputDirective;
4447
+ BignumberInputDirective.prototype.ngOnInit = function () {
4448
+ this.updateVariables();
4449
+ _super.prototype.ngOnInit.call(this);
4450
+ };
4451
+ BignumberInputDirective.prototype.ngOnChanges = function (changes) {
4452
+ var placeholderChange = changes.placeholder && changes.placeholder.currentValue;
4453
+ if (!placeholderChange && this.scale) {
4454
+ this.placeholder = "0" + this.decimalSeparator + "".padEnd(this.scale, "0");
4455
+ }
4456
+ if (changes.scale ||
4457
+ changes.decimalSeparator ||
4458
+ changes.thousandsSeparator ||
4459
+ changes.alignTo ||
4460
+ changes.precision ||
4461
+ changes.allowNegative) {
4462
+ this.updateVariables();
4463
+ }
4464
+ };
4465
+ BignumberInputDirective.prototype.onKeypress = function (event) {
4466
+ var code = event.code;
4467
+ if (code === "Minus" || code === "NumpadSubtract") {
4468
+ if (this.allowNegative) {
4469
+ this.maxLength = this._maxLength + 1;
4470
+ }
4471
+ }
4472
+ else if (code === "Equal" || code === "NumpadAdd") {
4473
+ this.maxLength = this._maxLength;
4474
+ }
4475
+ };
4476
+ /**
4477
+ * Update the options values according to the directive input values.
4478
+ */
4479
+ BignumberInputDirective.prototype.updateVariables = function () {
4480
+ var _a;
4481
+ this.options = {
4482
+ align: this.alignTo,
4483
+ decimalSeparator: this.decimalSeparator,
4484
+ thousandsSeparator: (_a = this.thousandsSeparator) !== null && _a !== void 0 ? _a : ".",
4485
+ scale: this.scale || 0,
4486
+ prefix: "",
4487
+ suffix: "",
4488
+ allowNegative: this.allowNegative
4489
+ };
4490
+ this.calculateMaxLength();
4491
+ };
4492
+ /**
4493
+ * Responsible to calculate the field maximum length considering the separators.
4494
+ */
4495
+ BignumberInputDirective.prototype.calculateMaxLength = function () {
4496
+ var _a, _b;
4497
+ var decSepLength = this.decimalSeparator.length;
4498
+ var thoSepLength = (_b = (_a = this.thousandsSeparator) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1;
4499
+ var maxLength = this.precision + (this.scale ? decSepLength : 0);
4500
+ maxLength += Math.ceil((this.precision - (this.scale ? this.scale : 0)) / 3 - 1) * thoSepLength;
4501
+ this._maxLength = maxLength;
4502
+ this.maxLength = maxLength;
4503
+ };
4504
+ var BignumberInputDirective_1;
4505
+ __decorate([
4506
+ core.Input()
4507
+ ], BignumberInputDirective.prototype, "precision", void 0);
4508
+ __decorate([
4509
+ core.Input()
4510
+ ], BignumberInputDirective.prototype, "scale", void 0);
4511
+ __decorate([
4512
+ core.Input()
4513
+ ], BignumberInputDirective.prototype, "decimalSeparator", void 0);
4514
+ __decorate([
4515
+ core.Input()
4516
+ ], BignumberInputDirective.prototype, "thousandsSeparator", void 0);
4517
+ __decorate([
4518
+ core.Input()
4519
+ ], BignumberInputDirective.prototype, "alignTo", void 0);
4520
+ __decorate([
4521
+ core.Input()
4522
+ ], BignumberInputDirective.prototype, "allowNegative", void 0);
4523
+ __decorate([
4524
+ core.Input(),
4525
+ core.HostBinding("attr.placeholder")
4526
+ ], BignumberInputDirective.prototype, "placeholder", void 0);
4527
+ __decorate([
4528
+ core.HostBinding("attr.maxLength")
4529
+ ], BignumberInputDirective.prototype, "maxLength", void 0);
4530
+ __decorate([
4531
+ core.HostListener("keypress", ["$event"])
4532
+ ], BignumberInputDirective.prototype, "onKeypress", null);
4533
+ BignumberInputDirective = BignumberInputDirective_1 = __decorate([
4534
+ core.Directive({
4535
+ selector: "input[sBignumberInput]",
4536
+ providers: [
4537
+ {
4538
+ provide: forms.NG_VALUE_ACCESSOR,
4539
+ useExisting: core.forwardRef(function () { return BignumberInputDirective_1; }),
4540
+ multi: true,
4541
+ },
4542
+ ],
4543
+ })
4544
+ ], BignumberInputDirective);
4545
+ return BignumberInputDirective;
4546
+ }(ng2CurrencyMask.CurrencyMaskDirective));
4547
+
4548
+ var BignumberInputModule = /** @class */ (function () {
4549
+ function BignumberInputModule() {
4550
+ }
4551
+ BignumberInputModule = __decorate([
4552
+ core.NgModule({
4553
+ imports: [common.CommonModule],
4554
+ declarations: [BignumberInputDirective],
4555
+ exports: [BignumberInputDirective],
4556
+ })
4557
+ ], BignumberInputModule);
4558
+ return BignumberInputModule;
4559
+ }());
4560
+
4561
+ var EmptyStateComponent = /** @class */ (function () {
4562
+ function EmptyStateComponent() {
4563
+ this.id = "s-empty-state-" + EmptyStateComponent_1.nextId++;
4564
+ this.iconClass = "fa fa-inbox";
4565
+ this.showPrimaryAction = true;
4566
+ this.showSecondaryAction = true;
4567
+ this.primaryModel = [];
4568
+ this.primaryAction = new core.EventEmitter();
4569
+ this.secondaryAction = new core.EventEmitter();
4570
+ }
4571
+ EmptyStateComponent_1 = EmptyStateComponent;
4572
+ var EmptyStateComponent_1;
4573
+ EmptyStateComponent.nextId = 0;
4574
+ __decorate([
4575
+ core.Input()
4576
+ ], EmptyStateComponent.prototype, "id", void 0);
4577
+ __decorate([
4578
+ core.Input()
4579
+ ], EmptyStateComponent.prototype, "iconClass", void 0);
4580
+ __decorate([
4581
+ core.Input()
4582
+ ], EmptyStateComponent.prototype, "title", void 0);
4583
+ __decorate([
4584
+ core.Input()
4585
+ ], EmptyStateComponent.prototype, "description", void 0);
4586
+ __decorate([
4587
+ core.Input()
4588
+ ], EmptyStateComponent.prototype, "showPrimaryAction", void 0);
4589
+ __decorate([
4590
+ core.Input()
4591
+ ], EmptyStateComponent.prototype, "showSecondaryAction", void 0);
4592
+ __decorate([
4593
+ core.Input()
4594
+ ], EmptyStateComponent.prototype, "primaryActionLabel", void 0);
4595
+ __decorate([
4596
+ core.Input()
4597
+ ], EmptyStateComponent.prototype, "secondaryActionLabel", void 0);
4598
+ __decorate([
4599
+ core.Input()
4600
+ ], EmptyStateComponent.prototype, "primaryModel", void 0);
4601
+ __decorate([
4602
+ core.Output()
4603
+ ], EmptyStateComponent.prototype, "primaryAction", void 0);
4604
+ __decorate([
4605
+ core.Output()
4606
+ ], EmptyStateComponent.prototype, "secondaryAction", void 0);
4607
+ EmptyStateComponent = EmptyStateComponent_1 = __decorate([
4608
+ core.Component({
4609
+ selector: "s-empty-state",
4610
+ 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>",
4611
+ 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%}"]
4612
+ })
4613
+ ], EmptyStateComponent);
4614
+ return EmptyStateComponent;
4615
+ }());
4616
+
4617
+ var EmptyStateGoBackComponent = /** @class */ (function () {
4618
+ function EmptyStateGoBackComponent(cookieService) {
4619
+ this.cookieService = cookieService;
4620
+ this.iconClass = "fa fa-exclamation-triangle";
4621
+ }
4622
+ EmptyStateGoBackComponent.prototype.goBack = function () {
4623
+ var portalUrl = this.cookieService.get("com.senior.portal.url");
4624
+ window.open(portalUrl, "_top");
4625
+ };
4626
+ EmptyStateGoBackComponent.nextId = 0;
4627
+ EmptyStateGoBackComponent.ctorParameters = function () { return [
4628
+ { type: ngxCookieService.CookieService }
4629
+ ]; };
4630
+ __decorate([
4631
+ core.Input()
4632
+ ], EmptyStateGoBackComponent.prototype, "iconClass", void 0);
4633
+ __decorate([
4634
+ core.Input()
4635
+ ], EmptyStateGoBackComponent.prototype, "title", void 0);
4636
+ __decorate([
4637
+ core.Input()
4638
+ ], EmptyStateGoBackComponent.prototype, "description", void 0);
4639
+ __decorate([
4640
+ core.Input()
4641
+ ], EmptyStateGoBackComponent.prototype, "primaryActionLabel", void 0);
4642
+ EmptyStateGoBackComponent = __decorate([
4643
+ core.Component({
4644
+ selector: "s-empty-state-go-back",
4645
+ template: "<s-empty-state \n [iconClass]=\"iconClass\" \n [title]=\"title\" \n [description]=\"description\" \n (primaryAction)=\"goBack()\"\n [primaryActionLabel]=\"primaryActionLabel\">\n</s-empty-state>"
4646
+ })
4647
+ ], EmptyStateGoBackComponent);
4648
+ return EmptyStateGoBackComponent;
4649
+ }());
4650
+
4651
+ var EmptyStateModule = /** @class */ (function () {
4652
+ function EmptyStateModule() {
4653
+ }
4654
+ EmptyStateModule = __decorate([
4655
+ core.NgModule({
4656
+ imports: [common.CommonModule, ButtonModule],
4657
+ providers: [ngxCookieService.CookieService],
4658
+ declarations: [EmptyStateComponent, EmptyStateGoBackComponent],
4659
+ exports: [EmptyStateComponent, EmptyStateGoBackComponent],
4660
+ })
4661
+ ], EmptyStateModule);
4662
+ return EmptyStateModule;
4663
+ }());
4664
+
4665
+ /**
4666
+ * Formats a JSON response to a JS object
4667
+ * @param response The response to format
4668
+ * @returns A JS object based on the response's body
4669
+ */
4670
+ function formatJsonResponse(response) {
4671
+ return __awaiter(this, void 0, void 0, function () {
4672
+ return __generator(this, function (_a) {
4673
+ return [2 /*return*/, response.json()];
4674
+ });
4675
+ });
4676
+ }
4677
+
4678
+ /**
4679
+ * Formats a Blob response to a JS object
4680
+ * @param response The response to format
4681
+ * @returns A JS object based on the response's body
4682
+ */
4683
+ function formatBlobResponse(response) {
4684
+ return __awaiter(this, void 0, void 0, function () {
4685
+ var textResponse;
4686
+ return __generator(this, function (_a) {
4687
+ switch (_a.label) {
4688
+ case 0: return [4 /*yield*/, response.blob()];
4689
+ case 1: return [4 /*yield*/, (_a.sent()).text()];
4690
+ case 2:
4691
+ textResponse = _a.sent();
4692
+ return [2 /*return*/, JSON.parse(textResponse)];
4693
+ }
4694
+ });
4695
+ });
4696
+ }
4697
+
4698
+ /**
4699
+ * Custom HttpClient for cases when is not possible to use the Angular's HttpClient
4700
+ */
4701
+ var CustomHttpClient = /** @class */ (function () {
4702
+ function CustomHttpClient() {
4703
+ }
4704
+ /**
4705
+ * Executes a Http Get
4706
+ * @param url Url to execute the Get on
4707
+ * @param init Optional additional configs
4708
+ * @returns Whether a Promise<T> on request success or an error in request fail
4709
+ */
4710
+ CustomHttpClient.GET = function (url, init) {
4711
+ if (init === void 0) { init = {}; }
4420
4712
  return __awaiter(this, void 0, void 0, function () {
4421
4713
  var response;
4422
4714
  return __generator(this, function (_a) {
@@ -5406,294 +5698,319 @@
5406
5698
  return MaskFormatterModule;
5407
5699
  }());
5408
5700
 
5409
- var BignumberInputDirective = /** @class */ (function (_super) {
5410
- __extends(BignumberInputDirective, _super);
5411
- function BignumberInputDirective() {
5412
- var _this = _super !== null && _super.apply(this, arguments) || this;
5413
- _this.precision = 15;
5414
- _this.scale = 0;
5415
- _this.decimalSeparator = ",";
5416
- _this.alignTo = ng2CurrencyMask.AlignmentOptions.LEFT;
5417
- _this.allowNegative = true;
5418
- return _this;
5701
+
5702
+ (function (PasswordStrengths) {
5703
+ PasswordStrengths["VeryWeak"] = "Very_weak";
5704
+ PasswordStrengths["Weak"] = "weak";
5705
+ PasswordStrengths["Medium"] = "medium";
5706
+ PasswordStrengths["Strong"] = "strong";
5707
+ })(exports.PasswordStrengths || (exports.PasswordStrengths = {}));
5708
+
5709
+
5710
+ (function (PasswordStrengthPositions) {
5711
+ PasswordStrengthPositions["Top"] = "top";
5712
+ PasswordStrengthPositions["Right"] = "right";
5713
+ PasswordStrengthPositions["Left"] = "left";
5714
+ })(exports.PasswordStrengthPositions || (exports.PasswordStrengthPositions = {}));
5715
+
5716
+ var PasswordStrengthComponent = /** @class */ (function () {
5717
+ function PasswordStrengthComponent() {
5718
+ this.weakTitle = "Fraca";
5719
+ this.mediumTitle = "Médio";
5720
+ this.strongTitle = "Forte";
5721
+ this.position = exports.PasswordStrengthPositions.Right;
5722
+ this.left = 0;
5723
+ this.top = 0;
5724
+ this.visible = false;
5419
5725
  }
5420
- BignumberInputDirective_1 = BignumberInputDirective;
5421
- BignumberInputDirective.prototype.ngOnInit = function () {
5422
- this.updateVariables();
5423
- _super.prototype.ngOnInit.call(this);
5726
+ PasswordStrengthComponent.prototype.ngOnInit = function () {
5727
+ this.title = this.weakTitle;
5424
5728
  };
5425
- BignumberInputDirective.prototype.ngOnChanges = function (changes) {
5426
- var placeholderChange = changes.placeholder && changes.placeholder.currentValue;
5427
- if (!placeholderChange && this.scale) {
5428
- this.placeholder = "0" + this.decimalSeparator + "".padEnd(this.scale, "0");
5429
- }
5430
- if (changes.scale ||
5431
- changes.decimalSeparator ||
5432
- changes.thousandsSeparator ||
5433
- changes.alignTo ||
5434
- changes.precision ||
5435
- changes.allowNegative) {
5436
- this.updateVariables();
5729
+ PasswordStrengthComponent.prototype.setPasswordStrengthPosition = function () {
5730
+ var passwordStrength = document.querySelector(".password-strength");
5731
+ switch (this.position) {
5732
+ case exports.PasswordStrengthPositions.Top:
5733
+ passwordStrength.classList.add("password-strength--top");
5734
+ break;
5735
+ case exports.PasswordStrengthPositions.Right:
5736
+ passwordStrength.classList.add("password-strength--right");
5737
+ break;
5738
+ case exports.PasswordStrengthPositions.Left:
5739
+ passwordStrength.classList.add("password-strength--left");
5740
+ break;
5437
5741
  }
5438
5742
  };
5439
- BignumberInputDirective.prototype.onKeypress = function (event) {
5440
- var code = event.code;
5441
- if (code === "Minus" || code === "NumpadSubtract") {
5442
- if (this.allowNegative) {
5443
- this.maxLength = this._maxLength + 1;
5444
- }
5445
- }
5446
- else if (code === "Equal" || code === "NumpadAdd") {
5447
- this.maxLength = this._maxLength;
5743
+ PasswordStrengthComponent.prototype.updateIndicators = function (passwordStrength) {
5744
+ var strengthIndicator1 = document.querySelector("#strength-indicator-1");
5745
+ var strengthIndicator2 = document.querySelector("#strength-indicator-2");
5746
+ var strengthIndicator3 = document.querySelector("#strength-indicator-3");
5747
+ var onIndicators = [];
5748
+ var indicators = [
5749
+ strengthIndicator1,
5750
+ strengthIndicator2,
5751
+ strengthIndicator3,
5752
+ ];
5753
+ var strengthClass;
5754
+ switch (passwordStrength) {
5755
+ case exports.PasswordStrengths.VeryWeak:
5756
+ this.title = this.weakTitle;
5757
+ break;
5758
+ case exports.PasswordStrengths.Weak:
5759
+ this.title = this.weakTitle;
5760
+ strengthClass = "strength-indicator--weak";
5761
+ onIndicators.push(strengthIndicator1);
5762
+ break;
5763
+ case exports.PasswordStrengths.Medium:
5764
+ this.title = this.mediumTitle;
5765
+ strengthClass = "strength-indicator--medium";
5766
+ onIndicators.push(strengthIndicator1);
5767
+ onIndicators.push(strengthIndicator2);
5768
+ break;
5769
+ case exports.PasswordStrengths.Strong:
5770
+ this.title = this.strongTitle;
5771
+ strengthClass = "strength-indicator--strong";
5772
+ onIndicators.push(strengthIndicator1);
5773
+ onIndicators.push(strengthIndicator2);
5774
+ onIndicators.push(strengthIndicator3);
5775
+ break;
5448
5776
  }
5777
+ indicators.forEach(function (indicator) {
5778
+ indicator.classList.remove("strength-indicator--weak", "strength-indicator--medium", "strength-indicator--strong");
5779
+ });
5780
+ onIndicators.forEach(function (indicator) {
5781
+ indicator.classList.add(strengthClass);
5782
+ });
5449
5783
  };
5450
- /**
5451
- * Update the options values according to the directive input values.
5452
- */
5453
- BignumberInputDirective.prototype.updateVariables = function () {
5454
- var _a;
5455
- this.options = {
5456
- align: this.alignTo,
5457
- decimalSeparator: this.decimalSeparator,
5458
- thousandsSeparator: (_a = this.thousandsSeparator) !== null && _a !== void 0 ? _a : ".",
5459
- scale: this.scale || 0,
5460
- prefix: "",
5461
- suffix: "",
5462
- allowNegative: this.allowNegative
5463
- };
5464
- this.calculateMaxLength();
5465
- };
5466
- /**
5467
- * Responsible to calculate the field maximum length considering the separators.
5468
- */
5469
- BignumberInputDirective.prototype.calculateMaxLength = function () {
5470
- var _a, _b;
5471
- var decSepLength = this.decimalSeparator.length;
5472
- var thoSepLength = (_b = (_a = this.thousandsSeparator) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1;
5473
- var maxLength = this.precision + (this.scale ? decSepLength : 0);
5474
- maxLength += Math.ceil((this.precision - (this.scale ? this.scale : 0)) / 3 - 1) * thoSepLength;
5475
- this._maxLength = maxLength;
5476
- this.maxLength = maxLength;
5477
- };
5478
- var BignumberInputDirective_1;
5479
- __decorate([
5480
- core.Input()
5481
- ], BignumberInputDirective.prototype, "precision", void 0);
5482
- __decorate([
5483
- core.Input()
5484
- ], BignumberInputDirective.prototype, "scale", void 0);
5485
5784
  __decorate([
5486
5785
  core.Input()
5487
- ], BignumberInputDirective.prototype, "decimalSeparator", void 0);
5786
+ ], PasswordStrengthComponent.prototype, "weakTitle", void 0);
5488
5787
  __decorate([
5489
5788
  core.Input()
5490
- ], BignumberInputDirective.prototype, "thousandsSeparator", void 0);
5789
+ ], PasswordStrengthComponent.prototype, "mediumTitle", void 0);
5491
5790
  __decorate([
5492
5791
  core.Input()
5493
- ], BignumberInputDirective.prototype, "alignTo", void 0);
5792
+ ], PasswordStrengthComponent.prototype, "strongTitle", void 0);
5494
5793
  __decorate([
5495
5794
  core.Input()
5496
- ], BignumberInputDirective.prototype, "allowNegative", void 0);
5497
- __decorate([
5498
- core.Input(),
5499
- core.HostBinding("attr.placeholder")
5500
- ], BignumberInputDirective.prototype, "placeholder", void 0);
5501
- __decorate([
5502
- core.HostBinding("attr.maxLength")
5503
- ], BignumberInputDirective.prototype, "maxLength", void 0);
5504
- __decorate([
5505
- core.HostListener("keypress", ["$event"])
5506
- ], BignumberInputDirective.prototype, "onKeypress", null);
5507
- BignumberInputDirective = BignumberInputDirective_1 = __decorate([
5508
- core.Directive({
5509
- selector: "input[sBignumberInput]",
5510
- providers: [
5511
- {
5512
- provide: forms.NG_VALUE_ACCESSOR,
5513
- useExisting: core.forwardRef(function () { return BignumberInputDirective_1; }),
5514
- multi: true,
5515
- },
5516
- ],
5517
- })
5518
- ], BignumberInputDirective);
5519
- return BignumberInputDirective;
5520
- }(ng2CurrencyMask.CurrencyMaskDirective));
5521
-
5522
- var BignumberInputModule = /** @class */ (function () {
5523
- function BignumberInputModule() {
5524
- }
5525
- BignumberInputModule = __decorate([
5526
- core.NgModule({
5527
- imports: [common.CommonModule],
5528
- declarations: [BignumberInputDirective],
5529
- exports: [BignumberInputDirective],
5795
+ ], PasswordStrengthComponent.prototype, "description", void 0);
5796
+ PasswordStrengthComponent = __decorate([
5797
+ core.Component({
5798
+ 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>",
5799
+ 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}"]
5530
5800
  })
5531
- ], BignumberInputModule);
5532
- return BignumberInputModule;
5801
+ ], PasswordStrengthComponent);
5802
+ return PasswordStrengthComponent;
5533
5803
  }());
5534
5804
 
5535
- var TableHeaderCheckboxComponent = /** @class */ (function () {
5536
- function TableHeaderCheckboxComponent(table, tableService) {
5537
- var _this = this;
5538
- this.table = table;
5539
- this.tableService = tableService;
5540
- this.id = "s-table-header-checkbox-" + TableHeaderCheckboxComponent_1.nextId++;
5541
- this.ngUnsubscribe = new rxjs.Subject();
5542
- this.table.tableService.valueSource$.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function () {
5543
- _this.checked = _this.updateCheckedState();
5544
- });
5545
- this.table.tableService.selectionSource$.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function () {
5546
- _this.checked = _this.updateCheckedState();
5547
- });
5805
+ var PasswordStrengthDirective = /** @class */ (function () {
5806
+ function PasswordStrengthDirective(elementRef, appRef, componentFactoryResolver, injector) {
5807
+ this.elementRef = elementRef;
5808
+ this.appRef = appRef;
5809
+ this.componentFactoryResolver = componentFactoryResolver;
5810
+ this.injector = injector;
5811
+ this.enabled = true;
5812
+ this.position = exports.PasswordStrengthPositions.Right;
5813
+ this.componentRef = null;
5548
5814
  }
5549
- TableHeaderCheckboxComponent_1 = TableHeaderCheckboxComponent;
5550
- TableHeaderCheckboxComponent.prototype.ngOnInit = function () {
5551
- this.checked = this.updateCheckedState();
5552
- };
5553
- TableHeaderCheckboxComponent.prototype.ngOnDestroy = function () {
5554
- this.ngUnsubscribe.next();
5555
- };
5556
- TableHeaderCheckboxComponent.prototype.onFocus = function () {
5557
- this.hasFocus = true;
5558
- };
5559
- TableHeaderCheckboxComponent.prototype.onBlur = function () {
5560
- this.hasFocus = false;
5561
- };
5562
- TableHeaderCheckboxComponent.prototype.isDisabled = function () {
5563
- return this.disabled || !this.table.value || !this.table.value.length;
5564
- };
5565
- TableHeaderCheckboxComponent.prototype.onClick = function () {
5566
- if (!this.disabled) {
5567
- if (this.table.value && this.table.value.length > 0)
5568
- this.onToggleCheckbox(!this.checked);
5569
- }
5815
+ PasswordStrengthDirective.prototype.ngOnInit = function () {
5816
+ this.validateProperties();
5570
5817
  };
5571
- TableHeaderCheckboxComponent.prototype.updateCheckedState = function () {
5572
- if (this.table.filteredValue) {
5573
- var val = this.table.filteredValue;
5574
- return val && val.length > 0 && this.table.selection && this.table.selection.length > 0 && this.isAllFilteredValuesChecked();
5818
+ PasswordStrengthDirective.prototype.onFocus = function () {
5819
+ var _a, _b, _c;
5820
+ var content = (_a = this.elementRef.nativeElement.value) !== null && _a !== void 0 ? _a : "";
5821
+ if (content) {
5822
+ this.createPasswordStrength();
5823
+ (_b = this.componentRef) === null || _b === void 0 ? void 0 : _b.instance.updateIndicators(this.validation(content));
5575
5824
  }
5576
5825
  else {
5577
- var val = this.table.value;
5578
- return val && val.length > 0 && this.table.selection && this.table.selection.length > 0 && this.isAllValuesChecked();
5826
+ (_c = this.componentRef) === null || _c === void 0 ? void 0 : _c.instance.updateIndicators(exports.PasswordStrengths.VeryWeak);
5579
5827
  }
5580
5828
  };
5581
- TableHeaderCheckboxComponent.prototype.onToggleCheckbox = function (checked) {
5582
- var _this = this;
5583
- var _a = this.table, filteredValue = _a.filteredValue, value = _a.value, dataKey = _a.dataKey;
5584
- var gridData = checked ? (filteredValue ? filteredValue.slice() : value.slice()) : [];
5585
- if (checked) {
5586
- var unselecteds = gridData
5587
- .filter(function (record) { return !_this.table._selection.find(function (selected) { return record[dataKey] === selected[dataKey]; }); })
5588
- .map(function (record) {
5589
- if (_this.useAllObject)
5590
- return record;
5591
- var newRecord = {};
5592
- if (_this.rowProps)
5593
- _this.rowProps.forEach(function (prop) { return (newRecord[prop] = record[prop]); });
5594
- else
5595
- newRecord[dataKey] = record[dataKey];
5596
- return newRecord;
5597
- });
5598
- this.table._selection = __spread(this.table._selection, unselecteds);
5599
- }
5600
- else {
5601
- value.forEach(function (data) {
5602
- _this.table._selection = _this.table._selection.filter(function (record) { return record[dataKey] !== data[dataKey]; });
5603
- });
5829
+ PasswordStrengthDirective.prototype.onBlur = function () {
5830
+ this.destroyPasswordStrength();
5831
+ };
5832
+ PasswordStrengthDirective.prototype.createPasswordStrength = function () {
5833
+ if (this.enabled && this.componentRef === null) {
5834
+ var componentFactory = this.componentFactoryResolver.resolveComponentFactory(PasswordStrengthComponent);
5835
+ this.componentRef = componentFactory.create(this.injector);
5836
+ this.appRef.attachView(this.componentRef.hostView);
5837
+ var domElem = this.componentRef.hostView.rootNodes[0];
5838
+ document.body.appendChild(domElem);
5839
+ this.setPasswordStrengthComponentProperties();
5840
+ this.showPasswordStrength();
5604
5841
  }
5605
- this.table.updateSelectionKeys();
5606
- this.table.selectionChange.emit(this.table._selection);
5607
- this.tableService.onSelectionChange();
5608
- if (this.table.isStateful())
5609
- this.table.saveState();
5610
5842
  };
5611
- TableHeaderCheckboxComponent.prototype.isAllFilteredValuesChecked = function () {
5612
- var e_1, _a;
5613
- if (!this.table.filteredValue) {
5614
- return false;
5843
+ PasswordStrengthDirective.prototype.showPasswordStrength = function () {
5844
+ if (this.componentRef !== null) {
5845
+ this.componentRef.instance.visible = true;
5615
5846
  }
5616
- else {
5617
- try {
5618
- for (var _b = __values(this.table.filteredValue), _c = _b.next(); !_c.done; _c = _b.next()) {
5619
- var rowData = _c.value;
5620
- if (!this.table.isSelected(rowData)) {
5621
- return false;
5622
- }
5847
+ };
5848
+ PasswordStrengthDirective.prototype.setPasswordStrengthComponentProperties = function () {
5849
+ if (this.componentRef != null) {
5850
+ this.componentRef.instance.position = this.position;
5851
+ this.componentRef.instance.weakTitle = this.weakTitle;
5852
+ this.componentRef.instance.mediumTitle = this.mediumTitle;
5853
+ this.componentRef.instance.strongTitle = this.strongTitle;
5854
+ this.componentRef.instance.description = this.description;
5855
+ var _a = this.elementRef.nativeElement.getBoundingClientRect(), top_1 = _a.top, right = _a.right, bottom = _a.bottom, left = _a.left;
5856
+ var margin = 20;
5857
+ var elementRefHeight = bottom - top_1;
5858
+ var elementRefWidth = right - left;
5859
+ var safeSpace = 150;
5860
+ var positioned = false;
5861
+ var invalidOptions = [];
5862
+ while (!positioned) {
5863
+ if (invalidOptions.includes(exports.PasswordStrengthPositions.Top)
5864
+ && invalidOptions.includes(exports.PasswordStrengthPositions.Right)
5865
+ && invalidOptions.includes(exports.PasswordStrengthPositions.Left)) {
5866
+ this.destroyPasswordStrength();
5867
+ throw new Error("No space to show password strength");
5623
5868
  }
5624
- }
5625
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
5626
- finally {
5627
- try {
5628
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
5869
+ switch (this.position) {
5870
+ case exports.PasswordStrengthPositions.Top: {
5871
+ var topShift = top_1;
5872
+ var rightShift = document.body.clientWidth - right;
5873
+ var leftShift = left;
5874
+ if (topShift <= elementRefHeight + safeSpace || rightShift < 50 || leftShift < 50) {
5875
+ this.position = exports.PasswordStrengthPositions.Right;
5876
+ invalidOptions.push(exports.PasswordStrengthPositions.Top);
5877
+ break;
5878
+ }
5879
+ this.componentRef.instance.top = Math.round(top_1 - margin);
5880
+ this.componentRef.instance.left = Math.round(elementRefWidth / 2 + left);
5881
+ positioned = true;
5882
+ break;
5883
+ }
5884
+ case exports.PasswordStrengthPositions.Right: {
5885
+ var rightShift = document.body.clientWidth - right;
5886
+ if (rightShift <= elementRefWidth + safeSpace) {
5887
+ this.position = exports.PasswordStrengthPositions.Left;
5888
+ invalidOptions.push(exports.PasswordStrengthPositions.Right);
5889
+ break;
5890
+ }
5891
+ this.componentRef.instance.top = Math.round(top_1 + elementRefHeight / 2);
5892
+ this.componentRef.instance.left = Math.round(right + margin);
5893
+ positioned = true;
5894
+ break;
5895
+ }
5896
+ case exports.PasswordStrengthPositions.Left: {
5897
+ var leftShift = left;
5898
+ if (leftShift <= elementRefWidth + safeSpace) {
5899
+ this.position = exports.PasswordStrengthPositions.Top;
5900
+ invalidOptions.push(exports.PasswordStrengthPositions.Left);
5901
+ break;
5902
+ }
5903
+ this.componentRef.instance.top = Math.round(top_1 + elementRefHeight / 2);
5904
+ this.componentRef.instance.left = Math.round(left - margin);
5905
+ positioned = true;
5906
+ break;
5907
+ }
5908
+ default: {
5909
+ break;
5910
+ }
5629
5911
  }
5630
- finally { if (e_1) throw e_1.error; }
5912
+ this.componentRef.instance.position = this.position;
5631
5913
  }
5632
- return true;
5633
5914
  }
5634
5915
  };
5635
- TableHeaderCheckboxComponent.prototype.isAllValuesChecked = function () {
5636
- var e_2, _a;
5637
- if (!this.table.value) {
5638
- return false;
5916
+ PasswordStrengthDirective.prototype.validateProperties = function () {
5917
+ this.validation = this.validation || this.defaultValidator;
5918
+ if (!this.description) {
5919
+ throw new Error("Description is required");
5639
5920
  }
5640
- else {
5641
- try {
5642
- for (var _b = __values(this.table.value), _c = _b.next(); !_c.done; _c = _b.next()) {
5643
- var rowData = _c.value;
5644
- if (!this.table.isSelected(rowData)) {
5645
- return false;
5646
- }
5647
- }
5648
- }
5649
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
5650
- finally {
5651
- try {
5652
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
5653
- }
5654
- finally { if (e_2) throw e_2.error; }
5921
+ };
5922
+ PasswordStrengthDirective.prototype.destroyPasswordStrength = function () {
5923
+ if (this.componentRef !== null) {
5924
+ this.appRef.detachView(this.componentRef.hostView);
5925
+ this.componentRef.destroy();
5926
+ this.componentRef = null;
5927
+ }
5928
+ };
5929
+ PasswordStrengthDirective.prototype.defaultValidator = function (content) {
5930
+ var points = 0;
5931
+ var regExpValidations = [
5932
+ new RegExp("(?=.*\\d)"),
5933
+ new RegExp("(?=.*[a-z])"),
5934
+ new RegExp("(?=.*[A-Z])"),
5935
+ new RegExp("(?=.*[!@#$%&*.\\-=+^~])"),
5936
+ ];
5937
+ if (content.length >= 6) {
5938
+ points++;
5939
+ }
5940
+ regExpValidations.forEach(function (validation) {
5941
+ if (validation.test(content)) {
5942
+ points++;
5655
5943
  }
5656
- return true;
5944
+ });
5945
+ if (points < 1) {
5946
+ return exports.PasswordStrengths.VeryWeak;
5947
+ }
5948
+ else if (points < 4) {
5949
+ return exports.PasswordStrengths.Weak;
5950
+ }
5951
+ else if (points < 5) {
5952
+ return exports.PasswordStrengths.Medium;
5953
+ }
5954
+ else {
5955
+ return exports.PasswordStrengths.Strong;
5657
5956
  }
5658
5957
  };
5659
- var TableHeaderCheckboxComponent_1;
5660
- TableHeaderCheckboxComponent.nextId = 0;
5661
- TableHeaderCheckboxComponent.ctorParameters = function () { return [
5662
- { type: table.Table },
5663
- { type: table.TableService }
5958
+ PasswordStrengthDirective.ctorParameters = function () { return [
5959
+ { type: core.ElementRef },
5960
+ { type: core.ApplicationRef },
5961
+ { type: core.ComponentFactoryResolver },
5962
+ { type: core.Injector }
5664
5963
  ]; };
5665
5964
  __decorate([
5666
- core.Input()
5667
- ], TableHeaderCheckboxComponent.prototype, "id", void 0);
5965
+ core.Input("sPasswordStrength")
5966
+ ], PasswordStrengthDirective.prototype, "enabled", void 0);
5668
5967
  __decorate([
5669
- core.Input()
5670
- ], TableHeaderCheckboxComponent.prototype, "disabled", void 0);
5968
+ core.Input("psValidation")
5969
+ ], PasswordStrengthDirective.prototype, "validation", void 0);
5671
5970
  __decorate([
5672
- core.Input()
5673
- ], TableHeaderCheckboxComponent.prototype, "rowProps", void 0);
5971
+ core.Input("psPosition")
5972
+ ], PasswordStrengthDirective.prototype, "position", void 0);
5674
5973
  __decorate([
5675
- core.Input()
5676
- ], TableHeaderCheckboxComponent.prototype, "useAllObject", void 0);
5677
- TableHeaderCheckboxComponent = TableHeaderCheckboxComponent_1 = __decorate([
5678
- core.Component({
5679
- selector: "s-table-header-checkbox",
5680
- template: "\n <div class=\"ui-chkbox ui-widget\" (click)=\"onClick()\">\n <div class=\"ui-helper-hidden-accessible\">\n <input type=\"checkbox\" [checked]=\"checked\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" [disabled]=\"isDisabled()\">\n </div>\n <div [ngClass]=\"{'ui-chkbox-box ui-widget ui-state-default':true,\n 'ui-state-active':checked, 'ui-state-disabled': isDisabled(), 'ui-state-focus': hasFocus}\">\n <span [id]=\"id\" class=\"ui-chkbox-icon ui-clickable\" [ngClass]=\"{'pi pi-check':checked}\"></span>\n </div>\n </div>\n "
5974
+ core.Input("psWeakTitle")
5975
+ ], PasswordStrengthDirective.prototype, "weakTitle", void 0);
5976
+ __decorate([
5977
+ core.Input("psMediumTitle")
5978
+ ], PasswordStrengthDirective.prototype, "mediumTitle", void 0);
5979
+ __decorate([
5980
+ core.Input("psStrongTitle")
5981
+ ], PasswordStrengthDirective.prototype, "strongTitle", void 0);
5982
+ __decorate([
5983
+ core.Input("psDescription")
5984
+ ], PasswordStrengthDirective.prototype, "description", void 0);
5985
+ __decorate([
5986
+ core.HostListener("keyup"),
5987
+ core.HostListener("focus")
5988
+ ], PasswordStrengthDirective.prototype, "onFocus", null);
5989
+ __decorate([
5990
+ core.HostListener("blur")
5991
+ ], PasswordStrengthDirective.prototype, "onBlur", null);
5992
+ PasswordStrengthDirective = __decorate([
5993
+ core.Directive({
5994
+ selector: "[sPasswordStrength]",
5681
5995
  })
5682
- ], TableHeaderCheckboxComponent);
5683
- return TableHeaderCheckboxComponent;
5996
+ ], PasswordStrengthDirective);
5997
+ return PasswordStrengthDirective;
5684
5998
  }());
5685
5999
 
5686
- var TableHeaderCheckboxModule = /** @class */ (function () {
5687
- function TableHeaderCheckboxModule() {
6000
+ var PasswordStrengthModule = /** @class */ (function () {
6001
+ function PasswordStrengthModule() {
5688
6002
  }
5689
- TableHeaderCheckboxModule = __decorate([
6003
+ PasswordStrengthModule = __decorate([
5690
6004
  core.NgModule({
5691
6005
  imports: [common.CommonModule],
5692
- exports: [TableHeaderCheckboxComponent],
5693
- declarations: [TableHeaderCheckboxComponent],
6006
+ declarations: [
6007
+ PasswordStrengthComponent,
6008
+ PasswordStrengthDirective,
6009
+ ],
6010
+ exports: [PasswordStrengthDirective],
5694
6011
  })
5695
- ], TableHeaderCheckboxModule);
5696
- return TableHeaderCheckboxModule;
6012
+ ], PasswordStrengthModule);
6013
+ return PasswordStrengthModule;
5697
6014
  }());
5698
6015
 
5699
6016
  var NavigationDirective = /** @class */ (function () {
@@ -6712,167 +7029,190 @@
6712
7029
  return TableModule;
6713
7030
  }());
6714
7031
 
6715
- var AutocompleteFieldComponent = /** @class */ (function () {
6716
- function AutocompleteFieldComponent() {
6717
- }
6718
- __decorate([
6719
- core.Input()
6720
- ], AutocompleteFieldComponent.prototype, "field", void 0);
6721
- __decorate([
6722
- core.Input()
6723
- ], AutocompleteFieldComponent.prototype, "formControl", void 0);
6724
- AutocompleteFieldComponent = __decorate([
6725
- core.Component({
6726
- 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"
6727
- })
6728
- ], AutocompleteFieldComponent);
6729
- return AutocompleteFieldComponent;
6730
- }());
6731
-
6732
- var BooleanFieldComponent = /** @class */ (function () {
6733
- function BooleanFieldComponent() {
7032
+ var TableHeaderCheckboxComponent = /** @class */ (function () {
7033
+ function TableHeaderCheckboxComponent(table, tableService) {
7034
+ var _this = this;
7035
+ this.table = table;
7036
+ this.tableService = tableService;
7037
+ this.id = "s-table-header-checkbox-" + TableHeaderCheckboxComponent_1.nextId++;
7038
+ this.ngUnsubscribe = new rxjs.Subject();
7039
+ this.table.tableService.valueSource$.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function () {
7040
+ _this.checked = _this.updateCheckedState();
7041
+ });
7042
+ this.table.tableService.selectionSource$.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function () {
7043
+ _this.checked = _this.updateCheckedState();
7044
+ });
6734
7045
  }
6735
- BooleanFieldComponent.prototype.onClear = function () {
6736
- this.formControl.reset();
7046
+ TableHeaderCheckboxComponent_1 = TableHeaderCheckboxComponent;
7047
+ TableHeaderCheckboxComponent.prototype.ngOnInit = function () {
7048
+ this.checked = this.updateCheckedState();
6737
7049
  };
6738
- __decorate([
6739
- core.Input()
6740
- ], BooleanFieldComponent.prototype, "field", void 0);
6741
- __decorate([
6742
- core.Input()
6743
- ], BooleanFieldComponent.prototype, "formControl", void 0);
6744
- BooleanFieldComponent = __decorate([
6745
- core.Component({
6746
- 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"
6747
- })
6748
- ], BooleanFieldComponent);
6749
- return BooleanFieldComponent;
6750
- }());
6751
-
6752
- var CalendarFieldComponent = /** @class */ (function () {
6753
- function CalendarFieldComponent() {
6754
- }
6755
- __decorate([
6756
- core.Input()
6757
- ], CalendarFieldComponent.prototype, "field", void 0);
6758
- __decorate([
6759
- core.Input()
6760
- ], CalendarFieldComponent.prototype, "formControl", void 0);
6761
- __decorate([
6762
- core.Input()
6763
- ], CalendarFieldComponent.prototype, "showTime", void 0);
6764
- __decorate([
6765
- core.Input()
6766
- ], CalendarFieldComponent.prototype, "timeOnly", void 0);
6767
- CalendarFieldComponent = __decorate([
6768
- core.Component({
6769
- 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"
6770
- })
6771
- ], CalendarFieldComponent);
6772
- return CalendarFieldComponent;
6773
- }());
6774
-
6775
- var ChipsFieldComponent = /** @class */ (function () {
6776
- function ChipsFieldComponent(clipboard) {
6777
- this.clipboard = clipboard;
6778
- this.feedbackMessageVisible = false;
6779
- this.copyButtonVisible = true;
6780
- }
6781
- ChipsFieldComponent.prototype.onCopyFieldContent = function () {
7050
+ TableHeaderCheckboxComponent.prototype.ngOnDestroy = function () {
7051
+ this.ngUnsubscribe.next();
7052
+ };
7053
+ TableHeaderCheckboxComponent.prototype.onFocus = function () {
7054
+ this.hasFocus = true;
7055
+ };
7056
+ TableHeaderCheckboxComponent.prototype.onBlur = function () {
7057
+ this.hasFocus = false;
7058
+ };
7059
+ TableHeaderCheckboxComponent.prototype.isDisabled = function () {
7060
+ return this.disabled || !this.table.value || !this.table.value.length;
7061
+ };
7062
+ TableHeaderCheckboxComponent.prototype.onClick = function () {
7063
+ if (!this.disabled) {
7064
+ if (this.table.value && this.table.value.length > 0)
7065
+ this.onToggleCheckbox(!this.checked);
7066
+ }
7067
+ };
7068
+ TableHeaderCheckboxComponent.prototype.updateCheckedState = function () {
7069
+ if (this.table.filteredValue) {
7070
+ var val = this.table.filteredValue;
7071
+ return val && val.length > 0 && this.table.selection && this.table.selection.length > 0 && this.isAllFilteredValuesChecked();
7072
+ }
7073
+ else {
7074
+ var val = this.table.value;
7075
+ return val && val.length > 0 && this.table.selection && this.table.selection.length > 0 && this.isAllValuesChecked();
7076
+ }
7077
+ };
7078
+ TableHeaderCheckboxComponent.prototype.onToggleCheckbox = function (checked) {
6782
7079
  var _this = this;
6783
- if (this.formControl.value) {
6784
- this.copyButtonVisible = false;
6785
- this.feedbackMessageVisible = true;
6786
- setTimeout(function () {
6787
- _this.feedbackMessageVisible = false;
6788
- _this.copyButtonVisible = true;
6789
- }, 3000);
6790
- var content = this.formControl.value.join(this.field.separator || "\n");
6791
- this.clipboard.copy(content);
6792
- if (this.field.onCopy) {
6793
- this.field.onCopy(content);
7080
+ var _a = this.table, filteredValue = _a.filteredValue, value = _a.value, dataKey = _a.dataKey;
7081
+ var gridData = checked ? (filteredValue ? filteredValue.slice() : value.slice()) : [];
7082
+ if (checked) {
7083
+ var unselecteds = gridData
7084
+ .filter(function (record) { return !_this.table._selection.find(function (selected) { return record[dataKey] === selected[dataKey]; }); })
7085
+ .map(function (record) {
7086
+ if (_this.useAllObject)
7087
+ return record;
7088
+ var newRecord = {};
7089
+ if (_this.rowProps)
7090
+ _this.rowProps.forEach(function (prop) { return (newRecord[prop] = record[prop]); });
7091
+ else
7092
+ newRecord[dataKey] = record[dataKey];
7093
+ return newRecord;
7094
+ });
7095
+ this.table._selection = __spread(this.table._selection, unselecteds);
7096
+ }
7097
+ else {
7098
+ value.forEach(function (data) {
7099
+ _this.table._selection = _this.table._selection.filter(function (record) { return record[dataKey] !== data[dataKey]; });
7100
+ });
7101
+ }
7102
+ this.table.updateSelectionKeys();
7103
+ this.table.selectionChange.emit(this.table._selection);
7104
+ this.tableService.onSelectionChange();
7105
+ if (this.table.isStateful())
7106
+ this.table.saveState();
7107
+ };
7108
+ TableHeaderCheckboxComponent.prototype.isAllFilteredValuesChecked = function () {
7109
+ var e_1, _a;
7110
+ if (!this.table.filteredValue) {
7111
+ return false;
7112
+ }
7113
+ else {
7114
+ try {
7115
+ for (var _b = __values(this.table.filteredValue), _c = _b.next(); !_c.done; _c = _b.next()) {
7116
+ var rowData = _c.value;
7117
+ if (!this.table.isSelected(rowData)) {
7118
+ return false;
7119
+ }
7120
+ }
7121
+ }
7122
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
7123
+ finally {
7124
+ try {
7125
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
7126
+ }
7127
+ finally { if (e_1) throw e_1.error; }
6794
7128
  }
7129
+ return true;
6795
7130
  }
6796
7131
  };
6797
- ChipsFieldComponent.ctorParameters = function () { return [
6798
- { type: clipboard.Clipboard }
7132
+ TableHeaderCheckboxComponent.prototype.isAllValuesChecked = function () {
7133
+ var e_2, _a;
7134
+ if (!this.table.value) {
7135
+ return false;
7136
+ }
7137
+ else {
7138
+ try {
7139
+ for (var _b = __values(this.table.value), _c = _b.next(); !_c.done; _c = _b.next()) {
7140
+ var rowData = _c.value;
7141
+ if (!this.table.isSelected(rowData)) {
7142
+ return false;
7143
+ }
7144
+ }
7145
+ }
7146
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
7147
+ finally {
7148
+ try {
7149
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
7150
+ }
7151
+ finally { if (e_2) throw e_2.error; }
7152
+ }
7153
+ return true;
7154
+ }
7155
+ };
7156
+ var TableHeaderCheckboxComponent_1;
7157
+ TableHeaderCheckboxComponent.nextId = 0;
7158
+ TableHeaderCheckboxComponent.ctorParameters = function () { return [
7159
+ { type: table.Table },
7160
+ { type: table.TableService }
6799
7161
  ]; };
6800
7162
  __decorate([
6801
7163
  core.Input()
6802
- ], ChipsFieldComponent.prototype, "field", void 0);
7164
+ ], TableHeaderCheckboxComponent.prototype, "id", void 0);
6803
7165
  __decorate([
6804
7166
  core.Input()
6805
- ], ChipsFieldComponent.prototype, "formControl", void 0);
6806
- ChipsFieldComponent = __decorate([
6807
- core.Component({
6808
- 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",
6809
- 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}"]
6810
- })
6811
- ], ChipsFieldComponent);
6812
- return ChipsFieldComponent;
6813
- }());
6814
-
6815
- /**
6816
- * @deprecated Should use bignumber instead
6817
- */
6818
- var CurrencyFieldComponent = /** @class */ (function (_super) {
6819
- __extends(CurrencyFieldComponent, _super);
6820
- function CurrencyFieldComponent() {
6821
- return _super !== null && _super.apply(this, arguments) || this;
6822
- }
7167
+ ], TableHeaderCheckboxComponent.prototype, "disabled", void 0);
6823
7168
  __decorate([
6824
7169
  core.Input()
6825
- ], CurrencyFieldComponent.prototype, "field", void 0);
7170
+ ], TableHeaderCheckboxComponent.prototype, "rowProps", void 0);
6826
7171
  __decorate([
6827
7172
  core.Input()
6828
- ], CurrencyFieldComponent.prototype, "formControl", void 0);
6829
- CurrencyFieldComponent = __decorate([
7173
+ ], TableHeaderCheckboxComponent.prototype, "useAllObject", void 0);
7174
+ TableHeaderCheckboxComponent = TableHeaderCheckboxComponent_1 = __decorate([
6830
7175
  core.Component({
6831
- 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"
7176
+ selector: "s-table-header-checkbox",
7177
+ template: "\n <div class=\"ui-chkbox ui-widget\" (click)=\"onClick()\">\n <div class=\"ui-helper-hidden-accessible\">\n <input type=\"checkbox\" [checked]=\"checked\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" [disabled]=\"isDisabled()\">\n </div>\n <div [ngClass]=\"{'ui-chkbox-box ui-widget ui-state-default':true,\n 'ui-state-active':checked, 'ui-state-disabled': isDisabled(), 'ui-state-focus': hasFocus}\">\n <span [id]=\"id\" class=\"ui-chkbox-icon ui-clickable\" [ngClass]=\"{'pi pi-check':checked}\"></span>\n </div>\n </div>\n "
6832
7178
  })
6833
- ], CurrencyFieldComponent);
6834
- return CurrencyFieldComponent;
6835
- }(BaseFieldComponent));
7179
+ ], TableHeaderCheckboxComponent);
7180
+ return TableHeaderCheckboxComponent;
7181
+ }());
6836
7182
 
6837
- var FileUploadComponent$1 = /** @class */ (function (_super) {
6838
- __extends(FileUploadComponent, _super);
6839
- function FileUploadComponent() {
6840
- return _super !== null && _super.apply(this, arguments) || this;
7183
+ var TableHeaderCheckboxModule = /** @class */ (function () {
7184
+ function TableHeaderCheckboxModule() {
6841
7185
  }
6842
- __decorate([
6843
- core.Input()
6844
- ], FileUploadComponent.prototype, "field", void 0);
6845
- __decorate([
6846
- core.Input()
6847
- ], FileUploadComponent.prototype, "formControl", void 0);
6848
- FileUploadComponent = __decorate([
6849
- core.Component({
6850
- 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"
7186
+ TableHeaderCheckboxModule = __decorate([
7187
+ core.NgModule({
7188
+ imports: [common.CommonModule],
7189
+ exports: [TableHeaderCheckboxComponent],
7190
+ declarations: [TableHeaderCheckboxComponent],
6851
7191
  })
6852
- ], FileUploadComponent);
6853
- return FileUploadComponent;
6854
- }(BaseFieldComponent));
7192
+ ], TableHeaderCheckboxModule);
7193
+ return TableHeaderCheckboxModule;
7194
+ }());
6855
7195
 
6856
- var LookupFieldComponent = /** @class */ (function () {
6857
- function LookupFieldComponent() {
7196
+ var AutocompleteFieldComponent = /** @class */ (function () {
7197
+ function AutocompleteFieldComponent() {
6858
7198
  }
6859
7199
  __decorate([
6860
7200
  core.Input()
6861
- ], LookupFieldComponent.prototype, "field", void 0);
7201
+ ], AutocompleteFieldComponent.prototype, "field", void 0);
6862
7202
  __decorate([
6863
7203
  core.Input()
6864
- ], LookupFieldComponent.prototype, "formControl", void 0);
6865
- LookupFieldComponent = __decorate([
7204
+ ], AutocompleteFieldComponent.prototype, "formControl", void 0);
7205
+ AutocompleteFieldComponent = __decorate([
6866
7206
  core.Component({
6867
- 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"
7207
+ 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"
6868
7208
  })
6869
- ], LookupFieldComponent);
6870
- return LookupFieldComponent;
7209
+ ], AutocompleteFieldComponent);
7210
+ return AutocompleteFieldComponent;
6871
7211
  }());
6872
7212
 
6873
- var NumberFieldComponent = /** @class */ (function (_super) {
6874
- __extends(NumberFieldComponent, _super);
6875
- function NumberFieldComponent() {
7213
+ var BignumberFieldComponent = /** @class */ (function (_super) {
7214
+ __extends(BignumberFieldComponent, _super);
7215
+ function BignumberFieldComponent() {
6876
7216
  var _this = _super !== null && _super.apply(this, arguments) || this;
6877
7217
  _this.onInput = new core.EventEmitter();
6878
7218
  _this.onFocus = new core.EventEmitter();
@@ -6880,33 +7220,35 @@
6880
7220
  _this.ngUnsubscribe = new rxjs.Subject();
6881
7221
  return _this;
6882
7222
  }
6883
- NumberFieldComponent.prototype.ngOnInit = function () {
7223
+ BignumberFieldComponent.prototype.ngOnInit = function () {
6884
7224
  var _this = this;
6885
- this.onFocus.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
6886
- if (_this.field.onFocus)
7225
+ this.onFocus
7226
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
7227
+ .subscribe(function (event) {
7228
+ if (_this.field.onFocus) {
6887
7229
  _this.field.onFocus(event);
7230
+ }
6888
7231
  });
6889
- this.onInput.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
6890
- if (_this.field.onInput)
7232
+ this.onInput
7233
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
7234
+ .subscribe(function (event) {
7235
+ if (_this.field.onInput) {
6891
7236
  _this.field.onInput(event);
7237
+ }
6892
7238
  });
6893
- this.onComplete.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
6894
- if (_this.field.onComplete)
7239
+ this.onComplete
7240
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
7241
+ .subscribe(function (event) {
7242
+ if (_this.field.onComplete) {
6895
7243
  _this.field.onComplete(event);
7244
+ }
6896
7245
  });
6897
7246
  };
6898
- NumberFieldComponent.prototype.ngOnDestroy = function () {
7247
+ BignumberFieldComponent.prototype.ngOnDestroy = function () {
6899
7248
  this.ngUnsubscribe.next();
6900
7249
  this.ngUnsubscribe.complete();
6901
7250
  };
6902
- Object.defineProperty(NumberFieldComponent.prototype, "numberAlignmentOption", {
6903
- get: function () {
6904
- return exports.NumberAlignmentOption;
6905
- },
6906
- enumerable: true,
6907
- configurable: true
6908
- });
6909
- Object.defineProperty(NumberFieldComponent.prototype, "fieldType", {
7251
+ Object.defineProperty(BignumberFieldComponent.prototype, "fieldType", {
6910
7252
  get: function () {
6911
7253
  return exports.FieldType;
6912
7254
  },
@@ -6915,308 +7257,167 @@
6915
7257
  });
6916
7258
  __decorate([
6917
7259
  core.Input()
6918
- ], NumberFieldComponent.prototype, "field", void 0);
7260
+ ], BignumberFieldComponent.prototype, "field", void 0);
6919
7261
  __decorate([
6920
7262
  core.Input()
6921
- ], NumberFieldComponent.prototype, "formControl", void 0);
7263
+ ], BignumberFieldComponent.prototype, "formControl", void 0);
6922
7264
  __decorate([
6923
7265
  core.Output()
6924
- ], NumberFieldComponent.prototype, "onInput", void 0);
7266
+ ], BignumberFieldComponent.prototype, "onInput", void 0);
6925
7267
  __decorate([
6926
7268
  core.Output()
6927
- ], NumberFieldComponent.prototype, "onFocus", void 0);
7269
+ ], BignumberFieldComponent.prototype, "onFocus", void 0);
6928
7270
  __decorate([
6929
7271
  core.Output()
6930
- ], NumberFieldComponent.prototype, "onComplete", void 0);
6931
- NumberFieldComponent = __decorate([
7272
+ ], BignumberFieldComponent.prototype, "onComplete", void 0);
7273
+ BignumberFieldComponent = __decorate([
6932
7274
  core.Component({
6933
- 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",
7275
+ 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",
6934
7276
  encapsulation: core.ViewEncapsulation.None,
6935
7277
  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}"]
6936
7278
  })
6937
- ], NumberFieldComponent);
6938
- return NumberFieldComponent;
7279
+ ], BignumberFieldComponent);
7280
+ return BignumberFieldComponent;
6939
7281
  }(BaseFieldComponent));
6940
7282
 
6941
- var RadioButtonComponent = /** @class */ (function () {
6942
- function RadioButtonComponent() {
6943
- this.onClick = new core.EventEmitter();
6944
- this.onFocus = new core.EventEmitter();
6945
- this.ngUnsubscribe = new rxjs.Subject();
7283
+ var BooleanFieldComponent = /** @class */ (function () {
7284
+ function BooleanFieldComponent() {
6946
7285
  }
6947
- RadioButtonComponent.prototype.ngOnInit = function () {
6948
- var _this = this;
6949
- this.onFocus.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
6950
- if (_this.field.onFocus)
6951
- _this.field.onFocus(event);
6952
- });
6953
- this.onClick.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
6954
- if (_this.field.onClick)
6955
- _this.field.onClick(event);
6956
- });
6957
- };
6958
- RadioButtonComponent.prototype.ngOnDestroy = function () {
6959
- this.ngUnsubscribe.next();
6960
- this.ngUnsubscribe.complete();
6961
- };
6962
- RadioButtonComponent.prototype.onClear = function () {
7286
+ BooleanFieldComponent.prototype.onClear = function () {
6963
7287
  this.formControl.reset();
6964
7288
  };
6965
7289
  __decorate([
6966
7290
  core.Input()
6967
- ], RadioButtonComponent.prototype, "field", void 0);
7291
+ ], BooleanFieldComponent.prototype, "field", void 0);
6968
7292
  __decorate([
6969
7293
  core.Input()
6970
- ], RadioButtonComponent.prototype, "formControl", void 0);
6971
- __decorate([
6972
- core.Output()
6973
- ], RadioButtonComponent.prototype, "onClick", void 0);
6974
- __decorate([
6975
- core.Output()
6976
- ], RadioButtonComponent.prototype, "onFocus", void 0);
6977
- RadioButtonComponent = __decorate([
7294
+ ], BooleanFieldComponent.prototype, "formControl", void 0);
7295
+ BooleanFieldComponent = __decorate([
6978
7296
  core.Component({
6979
- 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",
6980
- encapsulation: core.ViewEncapsulation.None,
6981
- styles: ["\n s-button.horizontal-clear-option button {\n width: min-content !important;\n }\n "]
7297
+ 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"
6982
7298
  })
6983
- ], RadioButtonComponent);
6984
- return RadioButtonComponent;
7299
+ ], BooleanFieldComponent);
7300
+ return BooleanFieldComponent;
6985
7301
  }());
6986
7302
 
6987
- var SelectFieldComponent = /** @class */ (function (_super) {
6988
- __extends(SelectFieldComponent, _super);
6989
- function SelectFieldComponent() {
6990
- return _super !== null && _super.apply(this, arguments) || this;
6991
- }
6992
- __decorate([
6993
- core.Input()
6994
- ], SelectFieldComponent.prototype, "field", void 0);
6995
- __decorate([
6996
- core.Input()
6997
- ], SelectFieldComponent.prototype, "formControl", void 0);
6998
- SelectFieldComponent = __decorate([
6999
- core.Component({
7000
- 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"
7001
- })
7002
- ], SelectFieldComponent);
7003
- return SelectFieldComponent;
7004
- }(BaseFieldComponent));
7005
-
7006
- var TextAreaFieldComponent = /** @class */ (function () {
7007
- function TextAreaFieldComponent() {
7303
+ var BooleanSwitchFieldComponent = /** @class */ (function () {
7304
+ function BooleanSwitchFieldComponent() {
7008
7305
  }
7009
7306
  __decorate([
7010
7307
  core.Input()
7011
- ], TextAreaFieldComponent.prototype, "field", void 0);
7308
+ ], BooleanSwitchFieldComponent.prototype, "field", void 0);
7012
7309
  __decorate([
7013
7310
  core.Input()
7014
- ], TextAreaFieldComponent.prototype, "formControl", void 0);
7015
- TextAreaFieldComponent = __decorate([
7311
+ ], BooleanSwitchFieldComponent.prototype, "formControl", void 0);
7312
+ BooleanSwitchFieldComponent = __decorate([
7016
7313
  core.Component({
7017
- 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"
7018
- })
7019
- ], TextAreaFieldComponent);
7020
- return TextAreaFieldComponent;
7021
- }());
7022
-
7023
- var IAssistService = /** @class */ (function () {
7024
- function IAssistService(http, _messageService) {
7025
- this.http = http;
7026
- this._messageService = _messageService;
7027
- }
7028
- IAssistService.prototype.askIA = function (context, data) {
7029
- var _this = this;
7030
- return this.http.post("platform/iassist/api/latest/completions", {
7031
- "prompt": this._createPrompt(context, data),
7032
- "provider": "OPEN_AI",
7033
- "parameters": {
7034
- "model": "gpt-3.5-turbo",
7035
- "max_tokens": 700,
7036
- "temperature": 1
7037
- }
7038
- }).pipe(operators.catchError(function (err) {
7039
- _this._messageService.add({
7040
- severity: "error",
7041
- summary: err.status ? String(err.status) : "Error",
7042
- detail: (err.error && err.error.message) || err.statusText || err.message || "Error",
7043
- });
7044
- return rxjs.throwError(err);
7045
- }));
7046
- };
7047
- IAssistService.prototype._createPrompt = function (context, data) {
7048
- return "Crie um texto gen\u00E9rico para preencher o campo de textarea.\n " + (data.label ? "O campo tem o label " + data.label + "." : "") + "\n " + (data.id ? "O campo tem o id " + data.id + "." : "") + "\n " + (data.placeholder ? "Considere as instru\u00E7\u00F5es/sugest\u00F5es do placeholder: " + data.placeholder + "." : "") + "\n Baseie-se no contexto informado pelo usu\u00E1rio: '" + context + "'.\n O texto deve ser formal e conter informa\u00E7\u00F5es pertinentes a um campo como este, como se um usu\u00E1rio real tivesse preenchido com as informa\u00E7\u00F5es necess\u00E1rias. \n O texto deve ser neutro com rela\u00E7\u00E3o a generos, ra\u00E7as, religi\u00F5es, etc.\n O texto deve ser impessoal e n\u00E3o deve conter informa\u00E7\u00F5es pessoais do usu\u00E1rio.\n N\u00E3o direcione o texto a ningu\u00E9m, n\u00E3o use express\u00F5es como: caro, atenciosamente. gostaria, agrade\u00E7o. O texto deve ser gen\u00E9rico.\n \n Exemplos de texto:\n Um campo de descri\u00E7\u00E3o de usu\u00E1rio: \"Usu\u00E1rio com 20 anos, estudante de engenharia, gosta de jogar futebol e assistir filmes.\"\n Outro exemplo de descri\u00E7\u00E3o de usu\u00E1rio: \"Usu\u00E1rio administrador, com acesso total ao sistema, respons\u00E1vel por gerenciar os usu\u00E1rios e os produtos.\"\n Um campo de descri\u00E7\u00E3o de um produto: \"O produto \u00E9 um celular, com tela de 6 polegadas, 128GB de armazenamento, 4GB de mem\u00F3ria RAM, c\u00E2mera de 12MP e bateria de 4000mAh.\"\n Outro exemplo de descri\u00E7\u00E3o de produto: \"O produto \u00E9 uma geladeira, com capacidade de 500 litros, 2 portas, cor branca, com freezer e gaveta de legumes.\"\n Outro exemplo de descri\u00E7\u00E3o de produto: \"O produto \u00E9 uma camiseta, tamanho M, cor azul, 100% algod\u00E3o, com estampa de um gato.\"\n \n Em caso de contexto incompleto crie um texto gen\u00E9rico, como se fosse um exemplo de preenchimento do campo.\n O texto \u00E9 para um campo de textarea, ent\u00E3o escreva um texto sucinto.\n Exiba apenas o texto do output";
7049
- };
7050
- IAssistService.ctorParameters = function () { return [
7051
- { type: http.HttpClient },
7052
- { type: api.MessageService }
7053
- ]; };
7054
- IAssistService = __decorate([
7055
- core.Injectable()
7056
- ], IAssistService);
7057
- return IAssistService;
7058
- }());
7059
-
7060
- var TextAreaIAFieldComponent = /** @class */ (function () {
7061
- function TextAreaIAFieldComponent(_iassistService, _formBuilder, _translateService) {
7062
- this._iassistService = _iassistService;
7063
- this._formBuilder = _formBuilder;
7064
- this._translateService = _translateService;
7065
- this.isVisible = false;
7066
- this.isLoading = false;
7067
- }
7068
- TextAreaIAFieldComponent.prototype.ngOnInit = function () {
7069
- this._createDialogFields();
7070
- this._createDialogFormGroup();
7071
- };
7072
- TextAreaIAFieldComponent.prototype.showDialog = function () {
7073
- this.isVisible = true;
7074
- };
7075
- TextAreaIAFieldComponent.prototype.onHideDialog = function () {
7076
- this.formGroup.get("context").setValue("");
7077
- };
7078
- TextAreaIAFieldComponent.prototype.hideDialog = function () {
7079
- this.isVisible = false;
7080
- };
7081
- TextAreaIAFieldComponent.prototype.submitContext = function () {
7082
- var _this = this;
7083
- var context = this.formGroup.get("context");
7084
- this.isLoading = true;
7085
- this._iassistService.askIA(context.value, {
7086
- id: this.field.id,
7087
- label: this.field.label,
7088
- placeholder: this.field.placeholder,
7089
- })
7090
- .pipe(operators.catchError(function (err) {
7091
- _this.isLoading = false;
7092
- return rxjs.throwError(err);
7093
- }))
7094
- .subscribe(function (res) {
7095
- _this.formControl.setValue(res.text);
7096
- _this.isLoading = false;
7097
- });
7098
- this.hideDialog();
7099
- };
7100
- TextAreaIAFieldComponent.prototype._createDialogFields = function () {
7101
- this.fields = [
7102
- new FormField({
7103
- name: "context",
7104
- type: exports.FieldType.String,
7105
- label: this._translateService.instant("platform.angular_components.context"),
7106
- size: { sm: 12, md: 12, lg: 12, xl: 12 },
7107
- }),
7108
- ];
7109
- };
7110
- TextAreaIAFieldComponent.prototype._createDialogFormGroup = function () {
7111
- this.formGroup = this._formBuilder.group({
7112
- context: [""],
7113
- });
7114
- };
7115
- TextAreaIAFieldComponent.ctorParameters = function () { return [
7116
- { type: IAssistService },
7117
- { type: forms.FormBuilder },
7118
- { type: core$1.TranslateService }
7119
- ]; };
7314
+ 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>"
7315
+ })
7316
+ ], BooleanSwitchFieldComponent);
7317
+ return BooleanSwitchFieldComponent;
7318
+ }());
7319
+
7320
+ var CalendarFieldComponent = /** @class */ (function () {
7321
+ function CalendarFieldComponent() {
7322
+ }
7120
7323
  __decorate([
7121
7324
  core.Input()
7122
- ], TextAreaIAFieldComponent.prototype, "field", void 0);
7325
+ ], CalendarFieldComponent.prototype, "field", void 0);
7123
7326
  __decorate([
7124
7327
  core.Input()
7125
- ], TextAreaIAFieldComponent.prototype, "formControl", void 0);
7126
- TextAreaIAFieldComponent = __decorate([
7328
+ ], CalendarFieldComponent.prototype, "formControl", void 0);
7329
+ __decorate([
7330
+ core.Input()
7331
+ ], CalendarFieldComponent.prototype, "showTime", void 0);
7332
+ __decorate([
7333
+ core.Input()
7334
+ ], CalendarFieldComponent.prototype, "timeOnly", void 0);
7335
+ CalendarFieldComponent = __decorate([
7127
7336
  core.Component({
7128
- 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>",
7129
- 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}"]
7337
+ 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"
7130
7338
  })
7131
- ], TextAreaIAFieldComponent);
7132
- return TextAreaIAFieldComponent;
7339
+ ], CalendarFieldComponent);
7340
+ return CalendarFieldComponent;
7133
7341
  }());
7134
7342
 
7135
- var TextFieldComponent = /** @class */ (function (_super) {
7136
- __extends(TextFieldComponent, _super);
7137
- function TextFieldComponent() {
7138
- var _this = _super !== null && _super.apply(this, arguments) || this;
7139
- _this.onInput = new core.EventEmitter();
7140
- _this.onFocus = new core.EventEmitter();
7141
- _this.onComplete = new core.EventEmitter();
7142
- _this.ngUnsubscribe = new rxjs.Subject();
7143
- return _this;
7343
+ var ChipsFieldComponent = /** @class */ (function () {
7344
+ function ChipsFieldComponent(clipboard) {
7345
+ this.clipboard = clipboard;
7346
+ this.feedbackMessageVisible = false;
7347
+ this.copyButtonVisible = true;
7144
7348
  }
7145
- TextFieldComponent.prototype.ngOnInit = function () {
7349
+ ChipsFieldComponent.prototype.onCopyFieldContent = function () {
7146
7350
  var _this = this;
7147
- this.onFocus.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
7148
- if (_this.field.onFocus)
7149
- _this.field.onFocus(event);
7150
- });
7151
- this.onInput.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
7152
- if (_this.field.onInput)
7153
- _this.field.onInput(event);
7154
- });
7155
- this.onComplete.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
7156
- if (_this.field.onComplete)
7157
- _this.field.onComplete(event);
7158
- });
7159
- };
7160
- TextFieldComponent.prototype.ngOnDestroy = function () {
7161
- this.ngUnsubscribe.next();
7162
- this.ngUnsubscribe.complete();
7351
+ if (this.formControl.value) {
7352
+ this.copyButtonVisible = false;
7353
+ this.feedbackMessageVisible = true;
7354
+ setTimeout(function () {
7355
+ _this.feedbackMessageVisible = false;
7356
+ _this.copyButtonVisible = true;
7357
+ }, 3000);
7358
+ var content = this.formControl.value.join(this.field.separator || "\n");
7359
+ this.clipboard.copy(content);
7360
+ if (this.field.onCopy) {
7361
+ this.field.onCopy(content);
7362
+ }
7363
+ }
7163
7364
  };
7365
+ ChipsFieldComponent.ctorParameters = function () { return [
7366
+ { type: clipboard.Clipboard }
7367
+ ]; };
7164
7368
  __decorate([
7165
7369
  core.Input()
7166
- ], TextFieldComponent.prototype, "field", void 0);
7370
+ ], ChipsFieldComponent.prototype, "field", void 0);
7167
7371
  __decorate([
7168
7372
  core.Input()
7169
- ], TextFieldComponent.prototype, "formControl", void 0);
7170
- __decorate([
7171
- core.Output()
7172
- ], TextFieldComponent.prototype, "onInput", void 0);
7173
- __decorate([
7174
- core.Output()
7175
- ], TextFieldComponent.prototype, "onFocus", void 0);
7176
- __decorate([
7177
- core.Output()
7178
- ], TextFieldComponent.prototype, "onComplete", void 0);
7179
- TextFieldComponent = __decorate([
7373
+ ], ChipsFieldComponent.prototype, "formControl", void 0);
7374
+ ChipsFieldComponent = __decorate([
7180
7375
  core.Component({
7181
- 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",
7182
- encapsulation: core.ViewEncapsulation.None,
7183
- 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}"]
7376
+ 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",
7377
+ 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}"]
7184
7378
  })
7185
- ], TextFieldComponent);
7186
- return TextFieldComponent;
7187
- }(BaseFieldComponent));
7379
+ ], ChipsFieldComponent);
7380
+ return ChipsFieldComponent;
7381
+ }());
7188
7382
 
7189
- var RowComponent = /** @class */ (function () {
7190
- function RowComponent() {
7383
+ var CountryPhonePickerFieldComponent = /** @class */ (function () {
7384
+ function CountryPhonePickerFieldComponent() {
7191
7385
  }
7192
- RowComponent.prototype.ngOnInit = function () { };
7193
- RowComponent.prototype.getErrorMessages = function (errorMessages) {
7194
- if (errorMessages)
7195
- return this.isFunction(errorMessages) ? errorMessages() : errorMessages;
7196
- return this.errorMessages;
7197
- };
7198
- RowComponent.prototype.isFunction = function (value) {
7199
- return value instanceof Function;
7200
- };
7201
7386
  __decorate([
7202
7387
  core.Input()
7203
- ], RowComponent.prototype, "id", void 0);
7388
+ ], CountryPhonePickerFieldComponent.prototype, "field", void 0);
7204
7389
  __decorate([
7205
7390
  core.Input()
7206
- ], RowComponent.prototype, "config", void 0);
7391
+ ], CountryPhonePickerFieldComponent.prototype, "formControl", void 0);
7392
+ CountryPhonePickerFieldComponent = __decorate([
7393
+ core.Component({
7394
+ 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>"
7395
+ })
7396
+ ], CountryPhonePickerFieldComponent);
7397
+ return CountryPhonePickerFieldComponent;
7398
+ }());
7399
+
7400
+ /**
7401
+ * @deprecated Should use bignumber instead
7402
+ */
7403
+ var CurrencyFieldComponent = /** @class */ (function (_super) {
7404
+ __extends(CurrencyFieldComponent, _super);
7405
+ function CurrencyFieldComponent() {
7406
+ return _super !== null && _super.apply(this, arguments) || this;
7407
+ }
7207
7408
  __decorate([
7208
7409
  core.Input()
7209
- ], RowComponent.prototype, "group", void 0);
7410
+ ], CurrencyFieldComponent.prototype, "field", void 0);
7210
7411
  __decorate([
7211
7412
  core.Input()
7212
- ], RowComponent.prototype, "errorMessages", void 0);
7213
- RowComponent = __decorate([
7413
+ ], CurrencyFieldComponent.prototype, "formControl", void 0);
7414
+ CurrencyFieldComponent = __decorate([
7214
7415
  core.Component({
7215
- template: "\n <div class=\"ui-fluid\" [formGroup]=\"group\">\n <div class=\"ui-g\">\n <ng-container *ngFor=\"let field of config.fields\">\n <div [ngClass]=\"field.gridClass\" *ngIf=\"field.visible()\">\n <label\n [for]=\"field.name\"\n [ngClass]=\"{ 'required': field.required() }\"\n *sInfoSign=\"field.infoSign\"\n >\n {{ field.label }}\n </label>\n <ng-container *sDynamicForm=\"{ id: id, config: field, group: group}\"></ng-container>\n <s-control-errors [form]=\"group\" [control]=\"group.controls[field.name]\"\n [errorMessages]=\"getErrorMessages(field.errorMessages)\"></s-control-errors>\n <ng-template *ngIf=\"field?.bottomTemplate\" [ngTemplateOutlet]=\"field.bottomTemplate\"></ng-template>\n </div>\n </ng-container>\n </div>\n "
7416
+ 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"
7216
7417
  })
7217
- ], RowComponent);
7218
- return RowComponent;
7219
- }());
7418
+ ], CurrencyFieldComponent);
7419
+ return CurrencyFieldComponent;
7420
+ }(BaseFieldComponent));
7220
7421
 
7221
7422
  var FieldsetComponent = /** @class */ (function () {
7222
7423
  function FieldsetComponent() {
@@ -7242,79 +7443,45 @@
7242
7443
  return FieldsetComponent;
7243
7444
  }());
7244
7445
 
7245
- var SectionComponent = /** @class */ (function () {
7246
- function SectionComponent() {
7446
+ var FileUploadComponent$1 = /** @class */ (function (_super) {
7447
+ __extends(FileUploadComponent, _super);
7448
+ function FileUploadComponent() {
7449
+ return _super !== null && _super.apply(this, arguments) || this;
7247
7450
  }
7248
7451
  __decorate([
7249
7452
  core.Input()
7250
- ], SectionComponent.prototype, "id", void 0);
7251
- __decorate([
7252
- core.Input()
7253
- ], SectionComponent.prototype, "config", void 0);
7254
- __decorate([
7255
- core.Input()
7256
- ], SectionComponent.prototype, "group", void 0);
7453
+ ], FileUploadComponent.prototype, "field", void 0);
7257
7454
  __decorate([
7258
7455
  core.Input()
7259
- ], SectionComponent.prototype, "errorMessages", void 0);
7260
- SectionComponent = __decorate([
7456
+ ], FileUploadComponent.prototype, "formControl", void 0);
7457
+ FileUploadComponent = __decorate([
7261
7458
  core.Component({
7262
- template: "\n <h3 *ngIf=\"config?.header\" class=\"sds-section-title\">{{config.header}}</h3>\n <ng-container *ngFor=\"let conf of config.configs\">\n <ng-container *sDynamicForm=\"{ id: id, config: conf, group: group, errorMessages: errorMessages }\"></ng-container>\n </ng-container>\n "
7459
+ 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"
7263
7460
  })
7264
- ], SectionComponent);
7265
- return SectionComponent;
7266
- }());
7461
+ ], FileUploadComponent);
7462
+ return FileUploadComponent;
7463
+ }(BaseFieldComponent));
7267
7464
 
7268
- var DynamicFieldComponent = /** @class */ (function () {
7269
- function DynamicFieldComponent() {
7465
+ var LookupFieldComponent = /** @class */ (function () {
7466
+ function LookupFieldComponent() {
7270
7467
  }
7271
- DynamicFieldComponent.prototype.getErrorMessages = function (errorMessages) {
7272
- if (errorMessages)
7273
- return this.isFunction(errorMessages)
7274
- ? __assign(__assign({}, this.errorMessages), errorMessages()) : __assign(__assign({}, this.errorMessages), errorMessages);
7275
- return this.errorMessages;
7276
- };
7277
- DynamicFieldComponent.prototype.isFunction = function (value) {
7278
- return value instanceof Function;
7279
- };
7280
- __decorate([
7281
- core.Input()
7282
- ], DynamicFieldComponent.prototype, "id", void 0);
7283
- __decorate([
7284
- core.Input()
7285
- ], DynamicFieldComponent.prototype, "fields", void 0);
7286
- __decorate([
7287
- core.Input()
7288
- ], DynamicFieldComponent.prototype, "form", void 0);
7289
7468
  __decorate([
7290
7469
  core.Input()
7291
- ], DynamicFieldComponent.prototype, "errorMessages", void 0);
7470
+ ], LookupFieldComponent.prototype, "field", void 0);
7292
7471
  __decorate([
7293
7472
  core.Input()
7294
- ], DynamicFieldComponent.prototype, "displayTimeInfoSign", void 0);
7295
- DynamicFieldComponent = __decorate([
7473
+ ], LookupFieldComponent.prototype, "formControl", void 0);
7474
+ LookupFieldComponent = __decorate([
7296
7475
  core.Component({
7297
- selector: "s-dynamic-field",
7298
- 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>"
7476
+ 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"
7299
7477
  })
7300
- ], DynamicFieldComponent);
7301
- return DynamicFieldComponent;
7478
+ ], LookupFieldComponent);
7479
+ return LookupFieldComponent;
7302
7480
  }());
7303
7481
 
7304
- var GridType;
7305
- (function (GridType) {
7306
- GridType["Row"] = "Row";
7307
- })(GridType || (GridType = {}));
7308
-
7309
- var StructureType;
7310
- (function (StructureType) {
7311
- StructureType["Fieldset"] = "Fieldset";
7312
- StructureType["Section"] = "Section";
7313
- })(StructureType || (StructureType = {}));
7314
-
7315
- var BignumberFieldComponent = /** @class */ (function (_super) {
7316
- __extends(BignumberFieldComponent, _super);
7317
- function BignumberFieldComponent() {
7482
+ var NumberFieldComponent = /** @class */ (function (_super) {
7483
+ __extends(NumberFieldComponent, _super);
7484
+ function NumberFieldComponent() {
7318
7485
  var _this = _super !== null && _super.apply(this, arguments) || this;
7319
7486
  _this.onInput = new core.EventEmitter();
7320
7487
  _this.onFocus = new core.EventEmitter();
@@ -7322,35 +7489,33 @@
7322
7489
  _this.ngUnsubscribe = new rxjs.Subject();
7323
7490
  return _this;
7324
7491
  }
7325
- BignumberFieldComponent.prototype.ngOnInit = function () {
7492
+ NumberFieldComponent.prototype.ngOnInit = function () {
7326
7493
  var _this = this;
7327
- this.onFocus
7328
- .pipe(operators.takeUntil(this.ngUnsubscribe))
7329
- .subscribe(function (event) {
7330
- if (_this.field.onFocus) {
7494
+ this.onFocus.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
7495
+ if (_this.field.onFocus)
7331
7496
  _this.field.onFocus(event);
7332
- }
7333
7497
  });
7334
- this.onInput
7335
- .pipe(operators.takeUntil(this.ngUnsubscribe))
7336
- .subscribe(function (event) {
7337
- if (_this.field.onInput) {
7498
+ this.onInput.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
7499
+ if (_this.field.onInput)
7338
7500
  _this.field.onInput(event);
7339
- }
7340
7501
  });
7341
- this.onComplete
7342
- .pipe(operators.takeUntil(this.ngUnsubscribe))
7343
- .subscribe(function (event) {
7344
- if (_this.field.onComplete) {
7502
+ this.onComplete.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
7503
+ if (_this.field.onComplete)
7345
7504
  _this.field.onComplete(event);
7346
- }
7347
7505
  });
7348
7506
  };
7349
- BignumberFieldComponent.prototype.ngOnDestroy = function () {
7507
+ NumberFieldComponent.prototype.ngOnDestroy = function () {
7350
7508
  this.ngUnsubscribe.next();
7351
7509
  this.ngUnsubscribe.complete();
7352
7510
  };
7353
- Object.defineProperty(BignumberFieldComponent.prototype, "fieldType", {
7511
+ Object.defineProperty(NumberFieldComponent.prototype, "numberAlignmentOption", {
7512
+ get: function () {
7513
+ return exports.NumberAlignmentOption;
7514
+ },
7515
+ enumerable: true,
7516
+ configurable: true
7517
+ });
7518
+ Object.defineProperty(NumberFieldComponent.prototype, "fieldType", {
7354
7519
  get: function () {
7355
7520
  return exports.FieldType;
7356
7521
  },
@@ -7359,46 +7524,29 @@
7359
7524
  });
7360
7525
  __decorate([
7361
7526
  core.Input()
7362
- ], BignumberFieldComponent.prototype, "field", void 0);
7527
+ ], NumberFieldComponent.prototype, "field", void 0);
7363
7528
  __decorate([
7364
7529
  core.Input()
7365
- ], BignumberFieldComponent.prototype, "formControl", void 0);
7530
+ ], NumberFieldComponent.prototype, "formControl", void 0);
7366
7531
  __decorate([
7367
7532
  core.Output()
7368
- ], BignumberFieldComponent.prototype, "onInput", void 0);
7533
+ ], NumberFieldComponent.prototype, "onInput", void 0);
7369
7534
  __decorate([
7370
7535
  core.Output()
7371
- ], BignumberFieldComponent.prototype, "onFocus", void 0);
7536
+ ], NumberFieldComponent.prototype, "onFocus", void 0);
7372
7537
  __decorate([
7373
7538
  core.Output()
7374
- ], BignumberFieldComponent.prototype, "onComplete", void 0);
7375
- BignumberFieldComponent = __decorate([
7539
+ ], NumberFieldComponent.prototype, "onComplete", void 0);
7540
+ NumberFieldComponent = __decorate([
7376
7541
  core.Component({
7377
- 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",
7542
+ 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",
7378
7543
  encapsulation: core.ViewEncapsulation.None,
7379
7544
  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}"]
7380
7545
  })
7381
- ], BignumberFieldComponent);
7382
- return BignumberFieldComponent;
7546
+ ], NumberFieldComponent);
7547
+ return NumberFieldComponent;
7383
7548
  }(BaseFieldComponent));
7384
7549
 
7385
- var BooleanSwitchFieldComponent = /** @class */ (function () {
7386
- function BooleanSwitchFieldComponent() {
7387
- }
7388
- __decorate([
7389
- core.Input()
7390
- ], BooleanSwitchFieldComponent.prototype, "field", void 0);
7391
- __decorate([
7392
- core.Input()
7393
- ], BooleanSwitchFieldComponent.prototype, "formControl", void 0);
7394
- BooleanSwitchFieldComponent = __decorate([
7395
- core.Component({
7396
- 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>"
7397
- })
7398
- ], BooleanSwitchFieldComponent);
7399
- return BooleanSwitchFieldComponent;
7400
- }());
7401
-
7402
7550
  var PasswordFieldComponent = /** @class */ (function () {
7403
7551
  function PasswordFieldComponent() {
7404
7552
  this.onInput = new core.EventEmitter();
@@ -7459,751 +7607,649 @@
7459
7607
  return PasswordFieldComponent;
7460
7608
  }());
7461
7609
 
7462
- var SliderFieldComponent = /** @class */ (function (_super) {
7463
- __extends(SliderFieldComponent, _super);
7464
- function SliderFieldComponent() {
7465
- var _this = _super !== null && _super.apply(this, arguments) || this;
7466
- _this.onChange = new core.EventEmitter();
7467
- _this.onSlideEnd = new core.EventEmitter();
7468
- _this.ngUnsubscribe = new rxjs.Subject();
7469
- return _this;
7610
+ var RadioButtonComponent = /** @class */ (function () {
7611
+ function RadioButtonComponent() {
7612
+ this.onClick = new core.EventEmitter();
7613
+ this.onFocus = new core.EventEmitter();
7614
+ this.ngUnsubscribe = new rxjs.Subject();
7470
7615
  }
7471
- SliderFieldComponent.prototype.ngOnInit = function () {
7616
+ RadioButtonComponent.prototype.ngOnInit = function () {
7472
7617
  var _this = this;
7473
- var _a, _b;
7474
- this.onChange.pipe(operators.takeUntil(this.ngUnsubscribe))
7475
- .subscribe(function (event) {
7476
- if (_this.field.onChange) {
7477
- _this.field.onChange(event);
7478
- }
7618
+ this.onFocus.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
7619
+ if (_this.field.onFocus)
7620
+ _this.field.onFocus(event);
7479
7621
  });
7480
- this.onSlideEnd.pipe(operators.takeUntil(this.ngUnsubscribe))
7481
- .subscribe(function (event) {
7482
- if (_this.field.onSlideEnd) {
7483
- _this.field.onSlideEnd(event);
7484
- }
7622
+ this.onClick.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
7623
+ if (_this.field.onClick)
7624
+ _this.field.onClick(event);
7485
7625
  });
7486
- var values = ((_a = this.field) === null || _a === void 0 ? void 0 : _a.range) ? [this.field.min, this.field.max] : this.field.min;
7487
- this.formControl.setValue((_b = this.field.defaultValue) !== null && _b !== void 0 ? _b : values);
7488
7626
  };
7489
- SliderFieldComponent.prototype.ngOnDestroy = function () {
7627
+ RadioButtonComponent.prototype.ngOnDestroy = function () {
7490
7628
  this.ngUnsubscribe.next();
7491
7629
  this.ngUnsubscribe.complete();
7492
7630
  };
7493
- Object.defineProperty(SliderFieldComponent.prototype, "fieldType", {
7494
- get: function () {
7495
- return exports.FieldType;
7496
- },
7497
- enumerable: true,
7498
- configurable: true
7499
- });
7500
- SliderFieldComponent.prototype.getRangeLabel = function () {
7501
- var _a, _b, _c, _d;
7502
- var _e = __read((_a = this.formControl.value) !== null && _a !== void 0 ? _a : [0, 0], 2), value0 = _e[0], value1 = _e[1];
7503
- var prefix = (_b = this.field.prefix) !== null && _b !== void 0 ? _b : '';
7504
- var suffix = (_c = this.field.suffix) !== null && _c !== void 0 ? _c : '';
7505
- var separator = (_d = this.field.rangeSeparator) !== null && _d !== void 0 ? _d : ' - ';
7506
- if (!value0 || value0 < this.field.min) {
7507
- value0 = this.field.min;
7508
- }
7509
- if (!value1 || value1 > this.field.max) {
7510
- value1 = this.field.max;
7511
- }
7512
- return "" + prefix + value0 + suffix + separator + prefix + value1 + suffix;
7513
- };
7514
- SliderFieldComponent.prototype.getNonRangeLabel = function () {
7515
- var _a, _b, _c;
7516
- var value = (_a = this.formControl) === null || _a === void 0 ? void 0 : _a.value;
7517
- var prefix = (_b = this.field.prefix) !== null && _b !== void 0 ? _b : '';
7518
- var suffix = (_c = this.field.suffix) !== null && _c !== void 0 ? _c : '';
7519
- if (!value || value < this.field.min) {
7520
- value = this.field.min;
7521
- }
7522
- if (value > this.field.max) {
7523
- value = this.field.max;
7524
- }
7525
- return "" + prefix + value + suffix;
7631
+ RadioButtonComponent.prototype.onClear = function () {
7632
+ this.formControl.reset();
7526
7633
  };
7527
- Object.defineProperty(SliderFieldComponent.prototype, "label", {
7528
- get: function () {
7529
- return this.field.range ? this.getRangeLabel() : this.getNonRangeLabel();
7530
- },
7531
- enumerable: true,
7532
- configurable: true
7533
- });
7534
7634
  __decorate([
7535
7635
  core.Input()
7536
- ], SliderFieldComponent.prototype, "field", void 0);
7636
+ ], RadioButtonComponent.prototype, "field", void 0);
7537
7637
  __decorate([
7538
7638
  core.Input()
7539
- ], SliderFieldComponent.prototype, "formControl", void 0);
7639
+ ], RadioButtonComponent.prototype, "formControl", void 0);
7540
7640
  __decorate([
7541
7641
  core.Output()
7542
- ], SliderFieldComponent.prototype, "onChange", void 0);
7642
+ ], RadioButtonComponent.prototype, "onClick", void 0);
7543
7643
  __decorate([
7544
7644
  core.Output()
7545
- ], SliderFieldComponent.prototype, "onSlideEnd", void 0);
7546
- SliderFieldComponent = __decorate([
7645
+ ], RadioButtonComponent.prototype, "onFocus", void 0);
7646
+ RadioButtonComponent = __decorate([
7547
7647
  core.Component({
7548
- template: "<ng-container>\n <div class=\"slider-group\">\n <div class=\"slider-label\">\n <span>{{label}}</span>\n </div>\n <p-slider \n [id]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [range]=\"field.range\"\n [orientation]=\"field.orientation\"\n [min]=\"field.min\" \n [max]=\"field.max\"\n [step]=\"field.step\"\n [animate]=\"field.animate\" \n (onChange)=\"field.onChange ? field.onChange($event) : null\"\n (onSlideEnd)=\"field.onSlideEnd ? field.onSlideEnd($event) : null\">\n </p-slider>\n </div>\n</ng-container>",
7549
- styles: [".slider-label{margin-bottom:5px;margin-left:-10px}.slider-group{margin-left:9px;margin-right:11px}"]
7648
+ 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",
7649
+ encapsulation: core.ViewEncapsulation.None,
7650
+ styles: ["\n s-button.horizontal-clear-option button {\n width: min-content !important;\n }\n "]
7550
7651
  })
7551
- ], SliderFieldComponent);
7552
- return SliderFieldComponent;
7553
- }(BaseFieldComponent));
7652
+ ], RadioButtonComponent);
7653
+ return RadioButtonComponent;
7654
+ }());
7554
7655
 
7555
- var DynamicForm = /** @class */ (function () {
7556
- function DynamicForm(_a) {
7557
- var group = _a.group, errorMessages = _a.errorMessages;
7558
- this.group = group;
7559
- this.errorMessages = errorMessages;
7656
+ var SectionComponent = /** @class */ (function () {
7657
+ function SectionComponent() {
7560
7658
  }
7561
- return DynamicForm;
7659
+ __decorate([
7660
+ core.Input()
7661
+ ], SectionComponent.prototype, "id", void 0);
7662
+ __decorate([
7663
+ core.Input()
7664
+ ], SectionComponent.prototype, "config", void 0);
7665
+ __decorate([
7666
+ core.Input()
7667
+ ], SectionComponent.prototype, "group", void 0);
7668
+ __decorate([
7669
+ core.Input()
7670
+ ], SectionComponent.prototype, "errorMessages", void 0);
7671
+ SectionComponent = __decorate([
7672
+ core.Component({
7673
+ template: "\n <h3 *ngIf=\"config?.header\" class=\"sds-section-title\">{{config.header}}</h3>\n <ng-container *ngFor=\"let conf of config.configs\">\n <ng-container *sDynamicForm=\"{ id: id, config: conf, group: group, errorMessages: errorMessages }\"></ng-container>\n </ng-container>\n "
7674
+ })
7675
+ ], SectionComponent);
7676
+ return SectionComponent;
7562
7677
  }());
7563
- var DynamicField = /** @class */ (function (_super) {
7564
- __extends(DynamicField, _super);
7565
- function DynamicField(_a) {
7566
- var group = _a.group, field = _a.field, errorMessages = _a.errorMessages;
7567
- var _this = _super.call(this, {
7568
- group: group,
7569
- errorMessages: errorMessages,
7570
- }) || this;
7571
- _this.field = field;
7572
- _this.setFieldPropertiesByType();
7573
- return _this;
7574
- }
7575
- DynamicField.prototype.setFieldPropertiesByType = function () {
7576
- if (this.field.type === exports.FieldType.Integer || this.field.type === exports.FieldType.Double) {
7577
- this.field.numberLocaleOptions.currencySymbol = "";
7578
- }
7579
- };
7580
- DynamicField.prototype.createComponent = function (resolver, container) {
7581
- var componentFactory = resolver.resolveComponentFactory(this.getComponent());
7582
- var component = container.createComponent(componentFactory);
7583
- component.instance.field = this.field;
7584
- // Must be this way because some teams use name like "e070emp.codemp"
7585
- component.instance.formControl = this.group["controls"][this.field.name];
7586
- component.instance.errorMessages = this.errorMessages;
7587
- this.setVariablesByType(component);
7588
- return component;
7589
- };
7590
- DynamicField.prototype.setVariablesByType = function (component) {
7591
- if (this.field.type == exports.FieldType.Time) {
7592
- component.instance.timeOnly = true;
7593
- }
7594
- if ([exports.FieldType.LocalDateTime, exports.FieldType.DateTime, exports.FieldType.Time].includes(this.field.type)) {
7595
- component.instance.showTime = true;
7596
- }
7597
- };
7598
- DynamicField.prototype.updateVariables = function (component) {
7599
- component.instance.field = this.field;
7600
- component.instance.formControl = this.group["controls"][this.field.name];
7601
- this.setVariablesByType(component);
7602
- };
7603
- DynamicField.prototype.getComponent = function () {
7604
- switch (this.field.type) {
7605
- case exports.FieldType.Autocomplete:
7606
- return AutocompleteFieldComponent;
7607
- case exports.FieldType.Binary:
7608
- case exports.FieldType.String:
7609
- return TextFieldComponent;
7610
- case exports.FieldType.Boolean:
7611
- return this.field.representedBy === "switch" ? BooleanSwitchFieldComponent : BooleanFieldComponent;
7612
- case exports.FieldType.Chips:
7613
- return ChipsFieldComponent;
7614
- case exports.FieldType.Date:
7615
- case exports.FieldType.DateTime:
7616
- case exports.FieldType.LocalDateTime:
7617
- case exports.FieldType.Time:
7618
- return CalendarFieldComponent;
7619
- case exports.FieldType.Number:
7620
- case exports.FieldType.Integer:
7621
- case exports.FieldType.Double:
7622
- return BignumberFieldComponent;
7623
- case exports.FieldType.Enum:
7624
- return SelectFieldComponent;
7625
- case exports.FieldType.Lookup:
7626
- return LookupFieldComponent;
7627
- case exports.FieldType.Money:
7628
- return CurrencyFieldComponent;
7629
- case exports.FieldType.Radio:
7630
- return RadioButtonComponent;
7631
- case exports.FieldType.Text:
7632
- return TextAreaFieldComponent;
7633
- case exports.FieldType.TextIA:
7634
- return TextAreaIAFieldComponent;
7635
- case exports.FieldType.Password:
7636
- return PasswordFieldComponent;
7637
- case exports.FieldType.Blob:
7638
- return FileUploadComponent$1;
7639
- case exports.FieldType.Slider:
7640
- return SliderFieldComponent;
7641
- case exports.FieldType.Custom:
7642
- return this.field.CustomFieldComponentClass;
7643
- default:
7644
- throw new Error("Trying to use an unsupported type (" + this.field.type + ").");
7645
- }
7646
- };
7647
- return DynamicField;
7648
- }(DynamicForm));
7649
- var DynamicStructure = /** @class */ (function (_super) {
7650
- __extends(DynamicStructure, _super);
7651
- function DynamicStructure(_a) {
7652
- var group = _a.group, config = _a.config, errorMessages = _a.errorMessages;
7653
- var _this = _super.call(this, {
7654
- group: group,
7655
- errorMessages: errorMessages,
7656
- }) || this;
7657
- _this.config = config;
7658
- return _this;
7678
+
7679
+ var SelectFieldComponent = /** @class */ (function (_super) {
7680
+ __extends(SelectFieldComponent, _super);
7681
+ function SelectFieldComponent() {
7682
+ return _super !== null && _super.apply(this, arguments) || this;
7659
7683
  }
7660
- DynamicStructure.prototype.createComponent = function (resolver, container) {
7661
- var componentFactory = resolver.resolveComponentFactory(this.getComponent());
7662
- var component = container.createComponent(componentFactory);
7663
- component.instance.config = this.config;
7664
- component.instance.group = this.group;
7665
- return component;
7666
- };
7667
- DynamicStructure.prototype.updateVariables = function (component) {
7668
- component.instance.structure = this.config;
7669
- component.instance.group = this.group;
7670
- };
7671
- DynamicStructure.prototype.getComponent = function () {
7672
- switch (this.config.type) {
7673
- case StructureType.Fieldset:
7674
- return FieldsetComponent;
7675
- case StructureType.Section:
7676
- return SectionComponent;
7677
- default:
7678
- throw new Error("Trying to use an unsupported type (" + this.config.type + ").");
7679
- }
7680
- };
7681
- return DynamicStructure;
7682
- }(DynamicForm));
7683
- var DynamicGrid = /** @class */ (function (_super) {
7684
- __extends(DynamicGrid, _super);
7685
- function DynamicGrid(_a) {
7686
- var group = _a.group, config = _a.config, errorMessages = _a.errorMessages;
7687
- var _this = _super.call(this, { group: group, errorMessages: errorMessages }) || this;
7688
- _this.config = config;
7684
+ __decorate([
7685
+ core.Input()
7686
+ ], SelectFieldComponent.prototype, "field", void 0);
7687
+ __decorate([
7688
+ core.Input()
7689
+ ], SelectFieldComponent.prototype, "formControl", void 0);
7690
+ SelectFieldComponent = __decorate([
7691
+ core.Component({
7692
+ 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 || 'platform.angular_components.no_records_found' | translate\"\n [showDelay]=\"500\"\n [selectedItemsLabel]=\"field.multipleSelectedLabel || 'platform.angular_components.total_records_selected' | translate\"\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"
7693
+ })
7694
+ ], SelectFieldComponent);
7695
+ return SelectFieldComponent;
7696
+ }(BaseFieldComponent));
7697
+
7698
+ var SliderFieldComponent = /** @class */ (function (_super) {
7699
+ __extends(SliderFieldComponent, _super);
7700
+ function SliderFieldComponent() {
7701
+ var _this = _super !== null && _super.apply(this, arguments) || this;
7702
+ _this.onChange = new core.EventEmitter();
7703
+ _this.onSlideEnd = new core.EventEmitter();
7704
+ _this.ngUnsubscribe = new rxjs.Subject();
7689
7705
  return _this;
7690
7706
  }
7691
- DynamicGrid.prototype.createComponent = function (resolver, container) {
7692
- var componentFactory = resolver.resolveComponentFactory(this.getComponent());
7693
- var component = container.createComponent(componentFactory);
7694
- component.instance.config = this.config;
7695
- component.instance.group = this.group;
7696
- component.instance.errorMessages = this.errorMessages;
7697
- return component;
7698
- };
7699
- DynamicGrid.prototype.updateVariables = function (component) {
7700
- component.instance.config = this.config;
7701
- component.instance.group = this.group;
7707
+ SliderFieldComponent.prototype.ngOnInit = function () {
7708
+ var _this = this;
7709
+ var _a, _b;
7710
+ this.onChange.pipe(operators.takeUntil(this.ngUnsubscribe))
7711
+ .subscribe(function (event) {
7712
+ if (_this.field.onChange) {
7713
+ _this.field.onChange(event);
7714
+ }
7715
+ });
7716
+ this.onSlideEnd.pipe(operators.takeUntil(this.ngUnsubscribe))
7717
+ .subscribe(function (event) {
7718
+ if (_this.field.onSlideEnd) {
7719
+ _this.field.onSlideEnd(event);
7720
+ }
7721
+ });
7722
+ var values = ((_a = this.field) === null || _a === void 0 ? void 0 : _a.range) ? [this.field.min, this.field.max] : this.field.min;
7723
+ this.formControl.setValue((_b = this.field.defaultValue) !== null && _b !== void 0 ? _b : values);
7702
7724
  };
7703
- DynamicGrid.prototype.getComponent = function () {
7704
- switch (this.config.type) {
7705
- case GridType.Row:
7706
- return RowComponent;
7707
- default:
7708
- throw new Error("Trying to use an unsupported type (" + this.config.type + ").");
7709
- }
7725
+ SliderFieldComponent.prototype.ngOnDestroy = function () {
7726
+ this.ngUnsubscribe.next();
7727
+ this.ngUnsubscribe.complete();
7710
7728
  };
7711
- return DynamicGrid;
7712
- }(DynamicForm));
7713
-
7714
- var DynamicFormDirective = /** @class */ (function () {
7715
- function DynamicFormDirective(resolver, container) {
7716
- this.resolver = resolver;
7717
- this.container = container;
7718
- }
7719
- Object.defineProperty(DynamicFormDirective.prototype, "sDynamicForm", {
7720
- set: function (context) {
7721
- var id = context.id, config = context.config, group = context.group, errorMessages = context.errorMessages;
7722
- this.id = id;
7723
- this.config = config;
7724
- this.group = group;
7725
- this.errorMessages = errorMessages;
7729
+ Object.defineProperty(SliderFieldComponent.prototype, "fieldType", {
7730
+ get: function () {
7731
+ return exports.FieldType;
7726
7732
  },
7727
7733
  enumerable: true,
7728
7734
  configurable: true
7729
7735
  });
7730
- DynamicFormDirective.prototype.ngOnInit = function () {
7731
- if (this.isField()) {
7732
- if (!(this.config.id) && this.id) {
7733
- this.config.id = this.id + "-" + this.config.name;
7734
- }
7735
- this.directiveConfig = new DynamicField({
7736
- group: this.group,
7737
- field: this.config,
7738
- errorMessages: this.errorMessages,
7739
- });
7740
- }
7741
- else if (this.isStructure()) {
7742
- this.directiveConfig = new DynamicStructure({
7743
- group: this.group,
7744
- config: this.config,
7745
- errorMessages: this.errorMessages,
7746
- });
7736
+ SliderFieldComponent.prototype.getRangeLabel = function () {
7737
+ var _a, _b, _c, _d;
7738
+ var _e = __read((_a = this.formControl.value) !== null && _a !== void 0 ? _a : [0, 0], 2), value0 = _e[0], value1 = _e[1];
7739
+ var prefix = (_b = this.field.prefix) !== null && _b !== void 0 ? _b : '';
7740
+ var suffix = (_c = this.field.suffix) !== null && _c !== void 0 ? _c : '';
7741
+ var separator = (_d = this.field.rangeSeparator) !== null && _d !== void 0 ? _d : ' - ';
7742
+ if (!value0 || value0 < this.field.min) {
7743
+ value0 = this.field.min;
7747
7744
  }
7748
- else if (this.isGrid()) {
7749
- this.directiveConfig = new DynamicGrid({
7750
- group: this.group,
7751
- config: this.config,
7752
- errorMessages: this.errorMessages,
7753
- });
7745
+ if (!value1 || value1 > this.field.max) {
7746
+ value1 = this.field.max;
7754
7747
  }
7755
- else
7756
- throw new Error("Trying to use an unsupported type (" + this.config.type + ").");
7757
- this.component = this.directiveConfig.createComponent(this.resolver, this.container);
7758
- this.component.instance.id = this.id;
7759
- this.component.instance.errorMessages = this.errorMessages;
7748
+ return "" + prefix + value0 + suffix + separator + prefix + value1 + suffix;
7760
7749
  };
7761
- DynamicFormDirective.prototype.ngOnChanges = function () {
7762
- if (this.component) {
7763
- this.directiveConfig.updateVariables(this.component);
7764
- this.component.instance.errorMessages = this.errorMessages;
7750
+ SliderFieldComponent.prototype.getNonRangeLabel = function () {
7751
+ var _a, _b, _c;
7752
+ var value = (_a = this.formControl) === null || _a === void 0 ? void 0 : _a.value;
7753
+ var prefix = (_b = this.field.prefix) !== null && _b !== void 0 ? _b : '';
7754
+ var suffix = (_c = this.field.suffix) !== null && _c !== void 0 ? _c : '';
7755
+ if (!value || value < this.field.min) {
7756
+ value = this.field.min;
7757
+ }
7758
+ if (value > this.field.max) {
7759
+ value = this.field.max;
7765
7760
  }
7761
+ return "" + prefix + value + suffix;
7766
7762
  };
7767
- DynamicFormDirective.prototype.isField = function () {
7768
- return exports.FieldType[this.config.type];
7763
+ Object.defineProperty(SliderFieldComponent.prototype, "label", {
7764
+ get: function () {
7765
+ return this.field.range ? this.getRangeLabel() : this.getNonRangeLabel();
7766
+ },
7767
+ enumerable: true,
7768
+ configurable: true
7769
+ });
7770
+ __decorate([
7771
+ core.Input()
7772
+ ], SliderFieldComponent.prototype, "field", void 0);
7773
+ __decorate([
7774
+ core.Input()
7775
+ ], SliderFieldComponent.prototype, "formControl", void 0);
7776
+ __decorate([
7777
+ core.Output()
7778
+ ], SliderFieldComponent.prototype, "onChange", void 0);
7779
+ __decorate([
7780
+ core.Output()
7781
+ ], SliderFieldComponent.prototype, "onSlideEnd", void 0);
7782
+ SliderFieldComponent = __decorate([
7783
+ core.Component({
7784
+ template: "<ng-container>\n <div class=\"slider-group\">\n <div class=\"slider-label\">\n <span>{{label}}</span>\n </div>\n <p-slider \n [id]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [range]=\"field.range\"\n [orientation]=\"field.orientation\"\n [min]=\"field.min\" \n [max]=\"field.max\"\n [step]=\"field.step\"\n [animate]=\"field.animate\" \n (onChange)=\"field.onChange ? field.onChange($event) : null\"\n (onSlideEnd)=\"field.onSlideEnd ? field.onSlideEnd($event) : null\">\n </p-slider>\n </div>\n</ng-container>",
7785
+ styles: [".slider-label{margin-bottom:5px;margin-left:-10px}.slider-group{margin-left:9px;margin-right:11px}"]
7786
+ })
7787
+ ], SliderFieldComponent);
7788
+ return SliderFieldComponent;
7789
+ }(BaseFieldComponent));
7790
+
7791
+ var TextAreaFieldComponent = /** @class */ (function () {
7792
+ function TextAreaFieldComponent() {
7793
+ }
7794
+ __decorate([
7795
+ core.Input()
7796
+ ], TextAreaFieldComponent.prototype, "field", void 0);
7797
+ __decorate([
7798
+ core.Input()
7799
+ ], TextAreaFieldComponent.prototype, "formControl", void 0);
7800
+ TextAreaFieldComponent = __decorate([
7801
+ core.Component({
7802
+ 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"
7803
+ })
7804
+ ], TextAreaFieldComponent);
7805
+ return TextAreaFieldComponent;
7806
+ }());
7807
+
7808
+ var TextAreaIAFieldComponent = /** @class */ (function () {
7809
+ function TextAreaIAFieldComponent(_iassistService, _formBuilder, _translateService) {
7810
+ this._iassistService = _iassistService;
7811
+ this._formBuilder = _formBuilder;
7812
+ this._translateService = _translateService;
7813
+ this.isVisible = false;
7814
+ this.isLoading = false;
7815
+ }
7816
+ TextAreaIAFieldComponent.prototype.ngOnInit = function () {
7817
+ this._createDialogFields();
7818
+ this._createDialogFormGroup();
7769
7819
  };
7770
- DynamicFormDirective.prototype.isStructure = function () {
7771
- return StructureType[this.config.type];
7820
+ TextAreaIAFieldComponent.prototype.showDialog = function () {
7821
+ this.isVisible = true;
7822
+ };
7823
+ TextAreaIAFieldComponent.prototype.onHideDialog = function () {
7824
+ this.formGroup.get("context").setValue("");
7825
+ };
7826
+ TextAreaIAFieldComponent.prototype.hideDialog = function () {
7827
+ this.isVisible = false;
7828
+ };
7829
+ TextAreaIAFieldComponent.prototype.submitContext = function () {
7830
+ var _this = this;
7831
+ var context = this.formGroup.get("context");
7832
+ this.isLoading = true;
7833
+ this._iassistService.askIA(context.value, {
7834
+ id: this.field.id,
7835
+ label: this.field.label,
7836
+ placeholder: this.field.placeholder,
7837
+ })
7838
+ .pipe(operators.catchError(function (err) {
7839
+ _this.isLoading = false;
7840
+ return rxjs.throwError(err);
7841
+ }))
7842
+ .subscribe(function (res) {
7843
+ _this.formControl.setValue(res.text);
7844
+ _this.isLoading = false;
7845
+ });
7846
+ this.hideDialog();
7847
+ };
7848
+ TextAreaIAFieldComponent.prototype._createDialogFields = function () {
7849
+ this.fields = [
7850
+ new FormField({
7851
+ name: "context",
7852
+ type: exports.FieldType.String,
7853
+ label: this._translateService.instant("platform.angular_components.context"),
7854
+ size: { sm: 12, md: 12, lg: 12, xl: 12 },
7855
+ }),
7856
+ ];
7772
7857
  };
7773
- DynamicFormDirective.prototype.isGrid = function () {
7774
- return GridType[this.config.type];
7858
+ TextAreaIAFieldComponent.prototype._createDialogFormGroup = function () {
7859
+ this.formGroup = this._formBuilder.group({
7860
+ context: [""],
7861
+ });
7775
7862
  };
7776
- DynamicFormDirective.ctorParameters = function () { return [
7777
- { type: core.ComponentFactoryResolver },
7778
- { type: core.ViewContainerRef }
7863
+ TextAreaIAFieldComponent.ctorParameters = function () { return [
7864
+ { type: IAssistService },
7865
+ { type: forms.FormBuilder },
7866
+ { type: core$1.TranslateService }
7779
7867
  ]; };
7780
7868
  __decorate([
7781
7869
  core.Input()
7782
- ], DynamicFormDirective.prototype, "sDynamicForm", null);
7870
+ ], TextAreaIAFieldComponent.prototype, "field", void 0);
7783
7871
  __decorate([
7784
- core.Input("sDynamicFormDisplayTimeInfoSign")
7785
- ], DynamicFormDirective.prototype, "displayTimeInfoSign", void 0);
7786
- DynamicFormDirective = __decorate([
7787
- core.Directive({ selector: "[sDynamicForm]" })
7788
- ], DynamicFormDirective);
7789
- return DynamicFormDirective;
7872
+ core.Input()
7873
+ ], TextAreaIAFieldComponent.prototype, "formControl", void 0);
7874
+ TextAreaIAFieldComponent = __decorate([
7875
+ core.Component({
7876
+ 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>",
7877
+ 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}"]
7878
+ })
7879
+ ], TextAreaIAFieldComponent);
7880
+ return TextAreaIAFieldComponent;
7790
7881
  }());
7791
7882
 
7792
- var LongPressDirective = /** @class */ (function () {
7793
- function LongPressDirective() {
7794
- this.sLongPressDelay = 500;
7795
- this.sLongPress = new core.EventEmitter();
7796
- this.mouseUp = new rxjs.Subject();
7797
- this.mouseDown = new rxjs.Subject();
7798
- this.ngUnsubscribe = new rxjs.Subject();
7883
+ var TextFieldComponent = /** @class */ (function (_super) {
7884
+ __extends(TextFieldComponent, _super);
7885
+ function TextFieldComponent() {
7886
+ var _this = _super !== null && _super.apply(this, arguments) || this;
7887
+ _this.onInput = new core.EventEmitter();
7888
+ _this.onFocus = new core.EventEmitter();
7889
+ _this.onComplete = new core.EventEmitter();
7890
+ _this.ngUnsubscribe = new rxjs.Subject();
7891
+ return _this;
7799
7892
  }
7800
- LongPressDirective.prototype.onMouseUp = function (event) {
7801
- this.mouseUp.next(event);
7802
- };
7803
- LongPressDirective.prototype.onMouseDown = function (event) {
7804
- this.mouseDown.next(event);
7805
- };
7806
- LongPressDirective.prototype.ngOnInit = function () {
7893
+ TextFieldComponent.prototype.ngOnInit = function () {
7807
7894
  var _this = this;
7808
- this.mouseDown
7809
- .pipe(operators.debounceTime(this.sLongPressDelay), operators.takeUntil(this.mouseUp), operators.repeat(), operators.takeUntil(this.ngUnsubscribe))
7810
- .subscribe(function (event) { return _this.sLongPress.emit(event); });
7895
+ this.onFocus.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
7896
+ if (_this.field.onFocus)
7897
+ _this.field.onFocus(event);
7898
+ });
7899
+ this.onInput.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
7900
+ if (_this.field.onInput)
7901
+ _this.field.onInput(event);
7902
+ });
7903
+ this.onComplete.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
7904
+ if (_this.field.onComplete)
7905
+ _this.field.onComplete(event);
7906
+ });
7811
7907
  };
7812
- LongPressDirective.prototype.ngOnDestroy = function () {
7908
+ TextFieldComponent.prototype.ngOnDestroy = function () {
7813
7909
  this.ngUnsubscribe.next();
7814
7910
  this.ngUnsubscribe.complete();
7815
7911
  };
7816
7912
  __decorate([
7817
7913
  core.Input()
7818
- ], LongPressDirective.prototype, "sLongPressDelay", void 0);
7914
+ ], TextFieldComponent.prototype, "field", void 0);
7915
+ __decorate([
7916
+ core.Input()
7917
+ ], TextFieldComponent.prototype, "formControl", void 0);
7819
7918
  __decorate([
7820
7919
  core.Output()
7821
- ], LongPressDirective.prototype, "sLongPress", void 0);
7920
+ ], TextFieldComponent.prototype, "onInput", void 0);
7822
7921
  __decorate([
7823
- core.HostListener("mouseup", ["$event"]),
7824
- core.HostListener("touchend", ["$event"])
7825
- ], LongPressDirective.prototype, "onMouseUp", null);
7922
+ core.Output()
7923
+ ], TextFieldComponent.prototype, "onFocus", void 0);
7826
7924
  __decorate([
7827
- core.HostListener("mousedown", ["$event"]),
7828
- core.HostListener("touchstart", ["$event"])
7829
- ], LongPressDirective.prototype, "onMouseDown", null);
7830
- LongPressDirective = __decorate([
7831
- core.Directive({
7832
- selector: "[sLongPress]",
7925
+ core.Output()
7926
+ ], TextFieldComponent.prototype, "onComplete", void 0);
7927
+ TextFieldComponent = __decorate([
7928
+ core.Component({
7929
+ 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",
7930
+ encapsulation: core.ViewEncapsulation.None,
7931
+ 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}"]
7833
7932
  })
7834
- ], LongPressDirective);
7835
- return LongPressDirective;
7836
- }());
7933
+ ], TextFieldComponent);
7934
+ return TextFieldComponent;
7935
+ }(BaseFieldComponent));
7837
7936
 
7838
- var DoubleClickDirective = /** @class */ (function () {
7839
- function DoubleClickDirective() {
7840
- this.onDoubleClick = new core.EventEmitter();
7841
- this._timeout = null;
7842
- this._DOUBLE_CLICK_DELAY = 500;
7937
+ var RowComponent = /** @class */ (function () {
7938
+ function RowComponent() {
7843
7939
  }
7844
- DoubleClickDirective.prototype.onClick = function (event) {
7845
- this.handleOnClickEvent(event);
7846
- };
7847
- DoubleClickDirective.prototype.handleOnClickEvent = function (event) {
7848
- var _this = this;
7849
- if (this._timeout) {
7850
- this.clearTimeout();
7851
- this.onDoubleClick.emit(event);
7852
- }
7853
- else {
7854
- this._timeout = setTimeout(function () { return _this.clearTimeout(); }, this._DOUBLE_CLICK_DELAY);
7855
- }
7940
+ RowComponent.prototype.ngOnInit = function () { };
7941
+ RowComponent.prototype.getErrorMessages = function (errorMessages) {
7942
+ if (errorMessages)
7943
+ return this.isFunction(errorMessages) ? errorMessages() : errorMessages;
7944
+ return this.errorMessages;
7856
7945
  };
7857
- DoubleClickDirective.prototype.clearTimeout = function () {
7858
- clearTimeout(this._timeout);
7859
- this._timeout = null;
7946
+ RowComponent.prototype.isFunction = function (value) {
7947
+ return value instanceof Function;
7860
7948
  };
7861
7949
  __decorate([
7862
- core.Output()
7863
- ], DoubleClickDirective.prototype, "onDoubleClick", void 0);
7950
+ core.Input()
7951
+ ], RowComponent.prototype, "id", void 0);
7864
7952
  __decorate([
7865
- core.HostListener("click", ["$event"])
7866
- ], DoubleClickDirective.prototype, "onClick", null);
7867
- DoubleClickDirective = __decorate([
7868
- core.Directive({
7869
- selector: '[sDoubleClick]'
7870
- })
7871
- ], DoubleClickDirective);
7872
- return DoubleClickDirective;
7873
- }());
7874
-
7875
- var MouseEventsModule = /** @class */ (function () {
7876
- function MouseEventsModule() {
7877
- }
7878
- MouseEventsModule = __decorate([
7879
- core.NgModule({
7880
- imports: [common.CommonModule],
7881
- declarations: [
7882
- LongPressDirective,
7883
- DoubleClickDirective
7884
- ],
7885
- exports: [
7886
- LongPressDirective,
7887
- DoubleClickDirective
7888
- ],
7889
- })
7890
- ], MouseEventsModule);
7891
- return MouseEventsModule;
7892
- }());
7893
-
7894
-
7895
- (function (PasswordStrengths) {
7896
- PasswordStrengths["VeryWeak"] = "Very_weak";
7897
- PasswordStrengths["Weak"] = "weak";
7898
- PasswordStrengths["Medium"] = "medium";
7899
- PasswordStrengths["Strong"] = "strong";
7900
- })(exports.PasswordStrengths || (exports.PasswordStrengths = {}));
7901
-
7902
-
7903
- (function (PasswordStrengthPositions) {
7904
- PasswordStrengthPositions["Top"] = "top";
7905
- PasswordStrengthPositions["Right"] = "right";
7906
- PasswordStrengthPositions["Left"] = "left";
7907
- })(exports.PasswordStrengthPositions || (exports.PasswordStrengthPositions = {}));
7908
-
7909
- var PasswordStrengthComponent = /** @class */ (function () {
7910
- function PasswordStrengthComponent() {
7911
- this.weakTitle = "Fraca";
7912
- this.mediumTitle = "Médio";
7913
- this.strongTitle = "Forte";
7914
- this.position = exports.PasswordStrengthPositions.Right;
7915
- this.left = 0;
7916
- this.top = 0;
7917
- this.visible = false;
7918
- }
7919
- PasswordStrengthComponent.prototype.ngOnInit = function () {
7920
- this.title = this.weakTitle;
7921
- };
7922
- PasswordStrengthComponent.prototype.setPasswordStrengthPosition = function () {
7923
- var passwordStrength = document.querySelector(".password-strength");
7924
- switch (this.position) {
7925
- case exports.PasswordStrengthPositions.Top:
7926
- passwordStrength.classList.add("password-strength--top");
7927
- break;
7928
- case exports.PasswordStrengthPositions.Right:
7929
- passwordStrength.classList.add("password-strength--right");
7930
- break;
7931
- case exports.PasswordStrengthPositions.Left:
7932
- passwordStrength.classList.add("password-strength--left");
7933
- break;
7934
- }
7935
- };
7936
- PasswordStrengthComponent.prototype.updateIndicators = function (passwordStrength) {
7937
- var strengthIndicator1 = document.querySelector("#strength-indicator-1");
7938
- var strengthIndicator2 = document.querySelector("#strength-indicator-2");
7939
- var strengthIndicator3 = document.querySelector("#strength-indicator-3");
7940
- var onIndicators = [];
7941
- var indicators = [
7942
- strengthIndicator1,
7943
- strengthIndicator2,
7944
- strengthIndicator3,
7945
- ];
7946
- var strengthClass;
7947
- switch (passwordStrength) {
7948
- case exports.PasswordStrengths.VeryWeak:
7949
- this.title = this.weakTitle;
7950
- break;
7951
- case exports.PasswordStrengths.Weak:
7952
- this.title = this.weakTitle;
7953
- strengthClass = "strength-indicator--weak";
7954
- onIndicators.push(strengthIndicator1);
7955
- break;
7956
- case exports.PasswordStrengths.Medium:
7957
- this.title = this.mediumTitle;
7958
- strengthClass = "strength-indicator--medium";
7959
- onIndicators.push(strengthIndicator1);
7960
- onIndicators.push(strengthIndicator2);
7961
- break;
7962
- case exports.PasswordStrengths.Strong:
7963
- this.title = this.strongTitle;
7964
- strengthClass = "strength-indicator--strong";
7965
- onIndicators.push(strengthIndicator1);
7966
- onIndicators.push(strengthIndicator2);
7967
- onIndicators.push(strengthIndicator3);
7968
- break;
7969
- }
7970
- indicators.forEach(function (indicator) {
7971
- indicator.classList.remove("strength-indicator--weak", "strength-indicator--medium", "strength-indicator--strong");
7972
- });
7973
- onIndicators.forEach(function (indicator) {
7974
- indicator.classList.add(strengthClass);
7975
- });
7953
+ core.Input()
7954
+ ], RowComponent.prototype, "config", void 0);
7955
+ __decorate([
7956
+ core.Input()
7957
+ ], RowComponent.prototype, "group", void 0);
7958
+ __decorate([
7959
+ core.Input()
7960
+ ], RowComponent.prototype, "errorMessages", void 0);
7961
+ RowComponent = __decorate([
7962
+ core.Component({
7963
+ template: "\n <div class=\"ui-fluid\" [formGroup]=\"group\">\n <div class=\"ui-g\">\n <ng-container *ngFor=\"let field of config.fields\">\n <div [ngClass]=\"field.gridClass\" *ngIf=\"field.visible()\">\n <label\n [for]=\"field.name\"\n [ngClass]=\"{ 'required': field.required() }\"\n *sInfoSign=\"field.infoSign\"\n >\n {{ field.label }}\n </label>\n <ng-container *sDynamicForm=\"{ id: id, config: field, group: group}\"></ng-container>\n <s-control-errors [form]=\"group\" [control]=\"group.controls[field.name]\"\n [errorMessages]=\"getErrorMessages(field.errorMessages)\"></s-control-errors>\n <ng-template *ngIf=\"field?.bottomTemplate\" [ngTemplateOutlet]=\"field.bottomTemplate\"></ng-template>\n </div>\n </ng-container>\n </div>\n "
7964
+ })
7965
+ ], RowComponent);
7966
+ return RowComponent;
7967
+ }());
7968
+
7969
+ var DynamicFieldComponent = /** @class */ (function () {
7970
+ function DynamicFieldComponent() {
7971
+ }
7972
+ DynamicFieldComponent.prototype.getErrorMessages = function (errorMessages) {
7973
+ if (errorMessages)
7974
+ return this.isFunction(errorMessages)
7975
+ ? __assign(__assign({}, this.errorMessages), errorMessages()) : __assign(__assign({}, this.errorMessages), errorMessages);
7976
+ return this.errorMessages;
7977
+ };
7978
+ DynamicFieldComponent.prototype.isFunction = function (value) {
7979
+ return value instanceof Function;
7976
7980
  };
7977
7981
  __decorate([
7978
7982
  core.Input()
7979
- ], PasswordStrengthComponent.prototype, "weakTitle", void 0);
7983
+ ], DynamicFieldComponent.prototype, "id", void 0);
7980
7984
  __decorate([
7981
7985
  core.Input()
7982
- ], PasswordStrengthComponent.prototype, "mediumTitle", void 0);
7986
+ ], DynamicFieldComponent.prototype, "fields", void 0);
7983
7987
  __decorate([
7984
7988
  core.Input()
7985
- ], PasswordStrengthComponent.prototype, "strongTitle", void 0);
7989
+ ], DynamicFieldComponent.prototype, "form", void 0);
7986
7990
  __decorate([
7987
7991
  core.Input()
7988
- ], PasswordStrengthComponent.prototype, "description", void 0);
7989
- PasswordStrengthComponent = __decorate([
7992
+ ], DynamicFieldComponent.prototype, "errorMessages", void 0);
7993
+ __decorate([
7994
+ core.Input()
7995
+ ], DynamicFieldComponent.prototype, "displayTimeInfoSign", void 0);
7996
+ DynamicFieldComponent = __decorate([
7990
7997
  core.Component({
7991
- 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>",
7992
- 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}"]
7998
+ selector: "s-dynamic-field",
7999
+ 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>"
7993
8000
  })
7994
- ], PasswordStrengthComponent);
7995
- return PasswordStrengthComponent;
8001
+ ], DynamicFieldComponent);
8002
+ return DynamicFieldComponent;
7996
8003
  }());
7997
8004
 
7998
- var PasswordStrengthDirective = /** @class */ (function () {
7999
- function PasswordStrengthDirective(elementRef, appRef, componentFactoryResolver, injector) {
8000
- this.elementRef = elementRef;
8001
- this.appRef = appRef;
8002
- this.componentFactoryResolver = componentFactoryResolver;
8003
- this.injector = injector;
8004
- this.enabled = true;
8005
- this.position = exports.PasswordStrengthPositions.Right;
8006
- this.componentRef = null;
8005
+ var GridType;
8006
+ (function (GridType) {
8007
+ GridType["Row"] = "Row";
8008
+ })(GridType || (GridType = {}));
8009
+
8010
+ var StructureType;
8011
+ (function (StructureType) {
8012
+ StructureType["Fieldset"] = "Fieldset";
8013
+ StructureType["Section"] = "Section";
8014
+ })(StructureType || (StructureType = {}));
8015
+
8016
+ var DynamicForm = /** @class */ (function () {
8017
+ function DynamicForm(_a) {
8018
+ var group = _a.group, errorMessages = _a.errorMessages;
8019
+ this.group = group;
8020
+ this.errorMessages = errorMessages;
8007
8021
  }
8008
- PasswordStrengthDirective.prototype.ngOnInit = function () {
8009
- this.validateProperties();
8010
- };
8011
- PasswordStrengthDirective.prototype.onFocus = function () {
8012
- var _a, _b, _c;
8013
- var content = (_a = this.elementRef.nativeElement.value) !== null && _a !== void 0 ? _a : "";
8014
- if (content) {
8015
- this.createPasswordStrength();
8016
- (_b = this.componentRef) === null || _b === void 0 ? void 0 : _b.instance.updateIndicators(this.validation(content));
8017
- }
8018
- else {
8019
- (_c = this.componentRef) === null || _c === void 0 ? void 0 : _c.instance.updateIndicators(exports.PasswordStrengths.VeryWeak);
8022
+ return DynamicForm;
8023
+ }());
8024
+ var DynamicField = /** @class */ (function (_super) {
8025
+ __extends(DynamicField, _super);
8026
+ function DynamicField(_a) {
8027
+ var group = _a.group, field = _a.field, errorMessages = _a.errorMessages;
8028
+ var _this = _super.call(this, {
8029
+ group: group,
8030
+ errorMessages: errorMessages,
8031
+ }) || this;
8032
+ _this.field = field;
8033
+ _this.setFieldPropertiesByType();
8034
+ return _this;
8035
+ }
8036
+ DynamicField.prototype.setFieldPropertiesByType = function () {
8037
+ if (this.field.type === exports.FieldType.Integer || this.field.type === exports.FieldType.Double) {
8038
+ this.field.numberLocaleOptions.currencySymbol = "";
8020
8039
  }
8021
8040
  };
8022
- PasswordStrengthDirective.prototype.onBlur = function () {
8023
- this.destroyPasswordStrength();
8041
+ DynamicField.prototype.createComponent = function (resolver, container) {
8042
+ var componentFactory = resolver.resolveComponentFactory(this.getComponent());
8043
+ var component = container.createComponent(componentFactory);
8044
+ component.instance.field = this.field;
8045
+ // Must be this way because some teams use name like "e070emp.codemp"
8046
+ component.instance.formControl = this.group["controls"][this.field.name];
8047
+ component.instance.errorMessages = this.errorMessages;
8048
+ this.setVariablesByType(component);
8049
+ return component;
8024
8050
  };
8025
- PasswordStrengthDirective.prototype.createPasswordStrength = function () {
8026
- if (this.enabled && this.componentRef === null) {
8027
- var componentFactory = this.componentFactoryResolver.resolveComponentFactory(PasswordStrengthComponent);
8028
- this.componentRef = componentFactory.create(this.injector);
8029
- this.appRef.attachView(this.componentRef.hostView);
8030
- var domElem = this.componentRef.hostView.rootNodes[0];
8031
- document.body.appendChild(domElem);
8032
- this.setPasswordStrengthComponentProperties();
8033
- this.showPasswordStrength();
8051
+ DynamicField.prototype.setVariablesByType = function (component) {
8052
+ if (this.field.type == exports.FieldType.Time) {
8053
+ component.instance.timeOnly = true;
8034
8054
  }
8035
- };
8036
- PasswordStrengthDirective.prototype.showPasswordStrength = function () {
8037
- if (this.componentRef !== null) {
8038
- this.componentRef.instance.visible = true;
8055
+ if ([exports.FieldType.LocalDateTime, exports.FieldType.DateTime, exports.FieldType.Time].includes(this.field.type)) {
8056
+ component.instance.showTime = true;
8039
8057
  }
8040
8058
  };
8041
- PasswordStrengthDirective.prototype.setPasswordStrengthComponentProperties = function () {
8042
- if (this.componentRef != null) {
8043
- this.componentRef.instance.position = this.position;
8044
- this.componentRef.instance.weakTitle = this.weakTitle;
8045
- this.componentRef.instance.mediumTitle = this.mediumTitle;
8046
- this.componentRef.instance.strongTitle = this.strongTitle;
8047
- this.componentRef.instance.description = this.description;
8048
- var _a = this.elementRef.nativeElement.getBoundingClientRect(), top_1 = _a.top, right = _a.right, bottom = _a.bottom, left = _a.left;
8049
- var margin = 20;
8050
- var elementRefHeight = bottom - top_1;
8051
- var elementRefWidth = right - left;
8052
- var safeSpace = 150;
8053
- var positioned = false;
8054
- var invalidOptions = [];
8055
- while (!positioned) {
8056
- if (invalidOptions.includes(exports.PasswordStrengthPositions.Top)
8057
- && invalidOptions.includes(exports.PasswordStrengthPositions.Right)
8058
- && invalidOptions.includes(exports.PasswordStrengthPositions.Left)) {
8059
- this.destroyPasswordStrength();
8060
- throw new Error("No space to show password strength");
8061
- }
8062
- switch (this.position) {
8063
- case exports.PasswordStrengthPositions.Top: {
8064
- var topShift = top_1;
8065
- var rightShift = document.body.clientWidth - right;
8066
- var leftShift = left;
8067
- if (topShift <= elementRefHeight + safeSpace || rightShift < 50 || leftShift < 50) {
8068
- this.position = exports.PasswordStrengthPositions.Right;
8069
- invalidOptions.push(exports.PasswordStrengthPositions.Top);
8070
- break;
8071
- }
8072
- this.componentRef.instance.top = Math.round(top_1 - margin);
8073
- this.componentRef.instance.left = Math.round(elementRefWidth / 2 + left);
8074
- positioned = true;
8075
- break;
8076
- }
8077
- case exports.PasswordStrengthPositions.Right: {
8078
- var rightShift = document.body.clientWidth - right;
8079
- if (rightShift <= elementRefWidth + safeSpace) {
8080
- this.position = exports.PasswordStrengthPositions.Left;
8081
- invalidOptions.push(exports.PasswordStrengthPositions.Right);
8082
- break;
8083
- }
8084
- this.componentRef.instance.top = Math.round(top_1 + elementRefHeight / 2);
8085
- this.componentRef.instance.left = Math.round(right + margin);
8086
- positioned = true;
8087
- break;
8088
- }
8089
- case exports.PasswordStrengthPositions.Left: {
8090
- var leftShift = left;
8091
- if (leftShift <= elementRefWidth + safeSpace) {
8092
- this.position = exports.PasswordStrengthPositions.Top;
8093
- invalidOptions.push(exports.PasswordStrengthPositions.Left);
8094
- break;
8095
- }
8096
- this.componentRef.instance.top = Math.round(top_1 + elementRefHeight / 2);
8097
- this.componentRef.instance.left = Math.round(left - margin);
8098
- positioned = true;
8099
- break;
8100
- }
8101
- default: {
8102
- break;
8103
- }
8104
- }
8105
- this.componentRef.instance.position = this.position;
8106
- }
8059
+ DynamicField.prototype.updateVariables = function (component) {
8060
+ component.instance.field = this.field;
8061
+ component.instance.formControl = this.group["controls"][this.field.name];
8062
+ this.setVariablesByType(component);
8063
+ };
8064
+ DynamicField.prototype.getComponent = function () {
8065
+ switch (this.field.type) {
8066
+ case exports.FieldType.Autocomplete:
8067
+ return AutocompleteFieldComponent;
8068
+ case exports.FieldType.Binary:
8069
+ case exports.FieldType.String:
8070
+ return TextFieldComponent;
8071
+ case exports.FieldType.Boolean:
8072
+ return this.field.representedBy === "switch" ? BooleanSwitchFieldComponent : BooleanFieldComponent;
8073
+ case exports.FieldType.Chips:
8074
+ return ChipsFieldComponent;
8075
+ case exports.FieldType.CountryPhonePicker:
8076
+ return CountryPhonePickerFieldComponent;
8077
+ case exports.FieldType.Date:
8078
+ case exports.FieldType.DateTime:
8079
+ case exports.FieldType.LocalDateTime:
8080
+ case exports.FieldType.Time:
8081
+ return CalendarFieldComponent;
8082
+ case exports.FieldType.Number:
8083
+ case exports.FieldType.Integer:
8084
+ case exports.FieldType.Double:
8085
+ return BignumberFieldComponent;
8086
+ case exports.FieldType.Enum:
8087
+ return SelectFieldComponent;
8088
+ case exports.FieldType.Lookup:
8089
+ return LookupFieldComponent;
8090
+ case exports.FieldType.Money:
8091
+ return CurrencyFieldComponent;
8092
+ case exports.FieldType.Radio:
8093
+ return RadioButtonComponent;
8094
+ case exports.FieldType.Text:
8095
+ return TextAreaFieldComponent;
8096
+ case exports.FieldType.TextIA:
8097
+ return TextAreaIAFieldComponent;
8098
+ case exports.FieldType.Password:
8099
+ return PasswordFieldComponent;
8100
+ case exports.FieldType.Blob:
8101
+ return FileUploadComponent$1;
8102
+ case exports.FieldType.Slider:
8103
+ return SliderFieldComponent;
8104
+ case exports.FieldType.Custom:
8105
+ return this.field.CustomFieldComponentClass;
8106
+ default:
8107
+ throw new Error("Trying to use an unsupported type (" + this.field.type + ").");
8107
8108
  }
8108
8109
  };
8109
- PasswordStrengthDirective.prototype.validateProperties = function () {
8110
- this.validation = this.validation || this.defaultValidator;
8111
- if (!this.description) {
8112
- throw new Error("Description is required");
8113
- }
8110
+ return DynamicField;
8111
+ }(DynamicForm));
8112
+ var DynamicStructure = /** @class */ (function (_super) {
8113
+ __extends(DynamicStructure, _super);
8114
+ function DynamicStructure(_a) {
8115
+ var group = _a.group, config = _a.config, errorMessages = _a.errorMessages;
8116
+ var _this = _super.call(this, {
8117
+ group: group,
8118
+ errorMessages: errorMessages,
8119
+ }) || this;
8120
+ _this.config = config;
8121
+ return _this;
8122
+ }
8123
+ DynamicStructure.prototype.createComponent = function (resolver, container) {
8124
+ var componentFactory = resolver.resolveComponentFactory(this.getComponent());
8125
+ var component = container.createComponent(componentFactory);
8126
+ component.instance.config = this.config;
8127
+ component.instance.group = this.group;
8128
+ return component;
8129
+ };
8130
+ DynamicStructure.prototype.updateVariables = function (component) {
8131
+ component.instance.structure = this.config;
8132
+ component.instance.group = this.group;
8114
8133
  };
8115
- PasswordStrengthDirective.prototype.destroyPasswordStrength = function () {
8116
- if (this.componentRef !== null) {
8117
- this.appRef.detachView(this.componentRef.hostView);
8118
- this.componentRef.destroy();
8119
- this.componentRef = null;
8134
+ DynamicStructure.prototype.getComponent = function () {
8135
+ switch (this.config.type) {
8136
+ case StructureType.Fieldset:
8137
+ return FieldsetComponent;
8138
+ case StructureType.Section:
8139
+ return SectionComponent;
8140
+ default:
8141
+ throw new Error("Trying to use an unsupported type (" + this.config.type + ").");
8120
8142
  }
8121
8143
  };
8122
- PasswordStrengthDirective.prototype.defaultValidator = function (content) {
8123
- var points = 0;
8124
- var regExpValidations = [
8125
- new RegExp("(?=.*\\d)"),
8126
- new RegExp("(?=.*[a-z])"),
8127
- new RegExp("(?=.*[A-Z])"),
8128
- new RegExp("(?=.*[!@#$%&*.\\-=+^~])"),
8129
- ];
8130
- if (content.length >= 6) {
8131
- points++;
8144
+ return DynamicStructure;
8145
+ }(DynamicForm));
8146
+ var DynamicGrid = /** @class */ (function (_super) {
8147
+ __extends(DynamicGrid, _super);
8148
+ function DynamicGrid(_a) {
8149
+ var group = _a.group, config = _a.config, errorMessages = _a.errorMessages;
8150
+ var _this = _super.call(this, { group: group, errorMessages: errorMessages }) || this;
8151
+ _this.config = config;
8152
+ return _this;
8153
+ }
8154
+ DynamicGrid.prototype.createComponent = function (resolver, container) {
8155
+ var componentFactory = resolver.resolveComponentFactory(this.getComponent());
8156
+ var component = container.createComponent(componentFactory);
8157
+ component.instance.config = this.config;
8158
+ component.instance.group = this.group;
8159
+ component.instance.errorMessages = this.errorMessages;
8160
+ return component;
8161
+ };
8162
+ DynamicGrid.prototype.updateVariables = function (component) {
8163
+ component.instance.config = this.config;
8164
+ component.instance.group = this.group;
8165
+ };
8166
+ DynamicGrid.prototype.getComponent = function () {
8167
+ switch (this.config.type) {
8168
+ case GridType.Row:
8169
+ return RowComponent;
8170
+ default:
8171
+ throw new Error("Trying to use an unsupported type (" + this.config.type + ").");
8132
8172
  }
8133
- regExpValidations.forEach(function (validation) {
8134
- if (validation.test(content)) {
8135
- points++;
8173
+ };
8174
+ return DynamicGrid;
8175
+ }(DynamicForm));
8176
+
8177
+ var DynamicFormDirective = /** @class */ (function () {
8178
+ function DynamicFormDirective(resolver, container) {
8179
+ this.resolver = resolver;
8180
+ this.container = container;
8181
+ }
8182
+ Object.defineProperty(DynamicFormDirective.prototype, "sDynamicForm", {
8183
+ set: function (context) {
8184
+ var id = context.id, config = context.config, group = context.group, errorMessages = context.errorMessages;
8185
+ this.id = id;
8186
+ this.config = config;
8187
+ this.group = group;
8188
+ this.errorMessages = errorMessages;
8189
+ },
8190
+ enumerable: true,
8191
+ configurable: true
8192
+ });
8193
+ DynamicFormDirective.prototype.ngOnInit = function () {
8194
+ if (this.isField()) {
8195
+ if (!(this.config.id) && this.id) {
8196
+ this.config.id = this.id + "-" + this.config.name;
8136
8197
  }
8137
- });
8138
- if (points < 1) {
8139
- return exports.PasswordStrengths.VeryWeak;
8198
+ this.directiveConfig = new DynamicField({
8199
+ group: this.group,
8200
+ field: this.config,
8201
+ errorMessages: this.errorMessages,
8202
+ });
8140
8203
  }
8141
- else if (points < 4) {
8142
- return exports.PasswordStrengths.Weak;
8204
+ else if (this.isStructure()) {
8205
+ this.directiveConfig = new DynamicStructure({
8206
+ group: this.group,
8207
+ config: this.config,
8208
+ errorMessages: this.errorMessages,
8209
+ });
8143
8210
  }
8144
- else if (points < 5) {
8145
- return exports.PasswordStrengths.Medium;
8211
+ else if (this.isGrid()) {
8212
+ this.directiveConfig = new DynamicGrid({
8213
+ group: this.group,
8214
+ config: this.config,
8215
+ errorMessages: this.errorMessages,
8216
+ });
8146
8217
  }
8147
- else {
8148
- return exports.PasswordStrengths.Strong;
8218
+ else
8219
+ throw new Error("Trying to use an unsupported type (" + this.config.type + ").");
8220
+ this.component = this.directiveConfig.createComponent(this.resolver, this.container);
8221
+ this.component.instance.id = this.id;
8222
+ this.component.instance.errorMessages = this.errorMessages;
8223
+ };
8224
+ DynamicFormDirective.prototype.ngOnChanges = function () {
8225
+ if (this.component) {
8226
+ this.directiveConfig.updateVariables(this.component);
8227
+ this.component.instance.errorMessages = this.errorMessages;
8149
8228
  }
8150
8229
  };
8151
- PasswordStrengthDirective.ctorParameters = function () { return [
8152
- { type: core.ElementRef },
8153
- { type: core.ApplicationRef },
8230
+ DynamicFormDirective.prototype.isField = function () {
8231
+ return exports.FieldType[this.config.type];
8232
+ };
8233
+ DynamicFormDirective.prototype.isStructure = function () {
8234
+ return StructureType[this.config.type];
8235
+ };
8236
+ DynamicFormDirective.prototype.isGrid = function () {
8237
+ return GridType[this.config.type];
8238
+ };
8239
+ DynamicFormDirective.ctorParameters = function () { return [
8154
8240
  { type: core.ComponentFactoryResolver },
8155
- { type: core.Injector }
8241
+ { type: core.ViewContainerRef }
8156
8242
  ]; };
8157
8243
  __decorate([
8158
- core.Input("sPasswordStrength")
8159
- ], PasswordStrengthDirective.prototype, "enabled", void 0);
8160
- __decorate([
8161
- core.Input("psValidation")
8162
- ], PasswordStrengthDirective.prototype, "validation", void 0);
8163
- __decorate([
8164
- core.Input("psPosition")
8165
- ], PasswordStrengthDirective.prototype, "position", void 0);
8166
- __decorate([
8167
- core.Input("psWeakTitle")
8168
- ], PasswordStrengthDirective.prototype, "weakTitle", void 0);
8169
- __decorate([
8170
- core.Input("psMediumTitle")
8171
- ], PasswordStrengthDirective.prototype, "mediumTitle", void 0);
8172
- __decorate([
8173
- core.Input("psStrongTitle")
8174
- ], PasswordStrengthDirective.prototype, "strongTitle", void 0);
8175
- __decorate([
8176
- core.Input("psDescription")
8177
- ], PasswordStrengthDirective.prototype, "description", void 0);
8178
- __decorate([
8179
- core.HostListener("keyup"),
8180
- core.HostListener("focus")
8181
- ], PasswordStrengthDirective.prototype, "onFocus", null);
8244
+ core.Input()
8245
+ ], DynamicFormDirective.prototype, "sDynamicForm", null);
8182
8246
  __decorate([
8183
- core.HostListener("blur")
8184
- ], PasswordStrengthDirective.prototype, "onBlur", null);
8185
- PasswordStrengthDirective = __decorate([
8186
- core.Directive({
8187
- selector: "[sPasswordStrength]",
8188
- })
8189
- ], PasswordStrengthDirective);
8190
- return PasswordStrengthDirective;
8191
- }());
8192
-
8193
- var PasswordStrengthModule = /** @class */ (function () {
8194
- function PasswordStrengthModule() {
8195
- }
8196
- PasswordStrengthModule = __decorate([
8197
- core.NgModule({
8198
- imports: [common.CommonModule],
8199
- declarations: [
8200
- PasswordStrengthComponent,
8201
- PasswordStrengthDirective,
8202
- ],
8203
- exports: [PasswordStrengthDirective],
8204
- })
8205
- ], PasswordStrengthModule);
8206
- return PasswordStrengthModule;
8247
+ core.Input("sDynamicFormDisplayTimeInfoSign")
8248
+ ], DynamicFormDirective.prototype, "displayTimeInfoSign", void 0);
8249
+ DynamicFormDirective = __decorate([
8250
+ core.Directive({ selector: "[sDynamicForm]" })
8251
+ ], DynamicFormDirective);
8252
+ return DynamicFormDirective;
8207
8253
  }());
8208
8254
 
8209
8255
  var DynamicFormModule = /** @class */ (function () {
@@ -8212,36 +8258,36 @@
8212
8258
  DynamicFormModule = __decorate([
8213
8259
  core.NgModule({
8214
8260
  imports: [
8215
- common.CommonModule,
8216
- forms.FormsModule,
8217
- forms.ReactiveFormsModule,
8218
- TooltipModule,
8219
- inputtext.InputTextModule,
8220
- checkbox.CheckboxModule,
8221
- calendar.CalendarModule,
8222
- inputmask.InputMaskModule,
8223
- dropdown.DropdownModule,
8224
- NumberInputModule,
8225
- BignumberInputModule,
8226
- LocalizedNumberInputModule,
8227
- ControlErrorsModule,
8228
- LocaleModule,
8229
8261
  autocomplete$1.AutoCompleteModule,
8230
- multiselect.MultiSelectModule,
8231
- button.ButtonModule,
8262
+ BignumberInputModule,
8232
8263
  ButtonModule,
8233
- panel.PanelModule,
8264
+ CalendarMaskModule,
8265
+ calendar.CalendarModule,
8266
+ checkbox.CheckboxModule,
8267
+ chips.ChipsModule,
8268
+ common.CommonModule,
8269
+ ControlErrorsModule,
8270
+ CountryPhonePickerModule,
8234
8271
  dialog.DialogModule,
8235
- radiobutton.RadioButtonModule,
8236
- table.TableModule,
8272
+ dropdown.DropdownModule,
8237
8273
  EmptyStateModule,
8238
- LoadingStateModule,
8274
+ forms.FormsModule,
8239
8275
  angular2Hotkeys.HotkeyModule,
8240
- chips.ChipsModule,
8241
- CalendarMaskModule,
8276
+ inputmask.InputMaskModule,
8242
8277
  inputtextarea.InputTextareaModule,
8243
- radiobutton.RadioButtonModule,
8278
+ inputtext.InputTextModule,
8244
8279
  keyfilter.KeyFilterModule,
8280
+ LoadingStateModule,
8281
+ LocaleModule,
8282
+ LocalizedNumberInputModule,
8283
+ panel.PanelModule,
8284
+ button.ButtonModule,
8285
+ table.TableModule,
8286
+ multiselect.MultiSelectModule,
8287
+ NumberInputModule,
8288
+ radiobutton.RadioButtonModule,
8289
+ forms.ReactiveFormsModule,
8290
+ TooltipModule,
8245
8291
  fieldset.FieldsetModule,
8246
8292
  TableHeaderCheckboxModule,
8247
8293
  FileUploadModule,
@@ -8257,52 +8303,54 @@
8257
8303
  ],
8258
8304
  declarations: [
8259
8305
  AutocompleteFieldComponent,
8306
+ BignumberFieldComponent,
8260
8307
  BooleanFieldComponent,
8308
+ BooleanSwitchFieldComponent,
8261
8309
  CalendarFieldComponent,
8262
8310
  ChipsFieldComponent,
8311
+ CountryPhonePickerFieldComponent,
8263
8312
  CurrencyFieldComponent,
8264
- DynamicFormComponent,
8265
8313
  DynamicFieldComponent,
8314
+ DynamicFormComponent,
8266
8315
  DynamicFormDirective,
8267
8316
  FieldsetComponent,
8268
8317
  FileUploadComponent$1,
8269
8318
  LookupComponent,
8270
8319
  LookupFieldComponent,
8271
8320
  NumberFieldComponent,
8272
- BignumberFieldComponent,
8321
+ PasswordFieldComponent,
8273
8322
  RadioButtonComponent,
8274
8323
  RowComponent,
8275
8324
  SectionComponent,
8276
8325
  SelectFieldComponent,
8326
+ SliderFieldComponent,
8277
8327
  TextAreaFieldComponent,
8278
8328
  TextAreaIAFieldComponent,
8279
8329
  TextFieldComponent,
8280
- BooleanSwitchFieldComponent,
8281
- PasswordFieldComponent,
8282
- SliderFieldComponent,
8283
8330
  ],
8284
8331
  exports: [DynamicFormComponent, LookupComponent],
8285
8332
  entryComponents: [
8286
8333
  AutocompleteFieldComponent,
8334
+ BignumberFieldComponent,
8287
8335
  BooleanFieldComponent,
8336
+ BooleanSwitchFieldComponent,
8288
8337
  CalendarFieldComponent,
8289
8338
  ChipsFieldComponent,
8339
+ CountryPhonePickerFieldComponent,
8290
8340
  CurrencyFieldComponent,
8291
8341
  FieldsetComponent,
8292
8342
  FileUploadComponent$1,
8293
8343
  LookupFieldComponent,
8294
8344
  NumberFieldComponent,
8295
- BignumberFieldComponent,
8345
+ PasswordFieldComponent,
8296
8346
  RadioButtonComponent,
8297
8347
  RowComponent,
8298
8348
  SectionComponent,
8299
8349
  SelectFieldComponent,
8350
+ SliderFieldComponent,
8300
8351
  TextAreaFieldComponent,
8301
8352
  TextAreaIAFieldComponent,
8302
8353
  TextFieldComponent,
8303
- PasswordFieldComponent,
8304
- BooleanSwitchFieldComponent,
8305
- SliderFieldComponent,
8306
8354
  ],
8307
8355
  providers: [
8308
8356
  angular2Hotkeys.HotkeysService,
@@ -15654,6 +15702,7 @@
15654
15702
  "platform.angular_components.no_records_found": "Nenhum registro encontrado",
15655
15703
  "platform.angular_components.total_record": "{{ count }} registros encontrados",
15656
15704
  "platform.angular_components.total_records": "{{ count }} registros encontrados",
15705
+ "platform.angular_components.total_records_selected": "{0} registros selecionados",
15657
15706
  "platform.angular_components.country_name_br": "Brasil",
15658
15707
  "platform.angular_components.country_name_us": "Estados Unidos",
15659
15708
  "platform.angular_components.country_name_co": "Colômbia",
@@ -16033,46 +16082,47 @@
16033
16082
  exports.fallback = fallback;
16034
16083
  exports.ɵa = TooltipComponent;
16035
16084
  exports.ɵb = TooltipDirective;
16036
- exports.ɵba = SelectFieldComponent;
16037
- exports.ɵbb = TextAreaFieldComponent;
16038
- exports.ɵbc = TextAreaIAFieldComponent;
16039
- exports.ɵbd = IAssistService;
16040
- exports.ɵbe = TextFieldComponent;
16041
- exports.ɵbf = BooleanSwitchFieldComponent;
16042
- exports.ɵbg = PasswordFieldComponent;
16043
- exports.ɵbh = SliderFieldComponent;
16044
- exports.ɵbj = DecimalField;
16045
- exports.ɵbk = SideTableComponent;
16046
- exports.ɵbl = StructureModule;
16047
- exports.ɵbm = HeaderComponent;
16048
- exports.ɵbn = FooterComponent;
16049
- exports.ɵbo = NumberLocaleOptions;
16050
- exports.ɵbp = ThumbnailService;
16051
- exports.ɵbq = BorderButtonModule;
16052
- exports.ɵbr = BorderButtonComponent;
16053
- exports.ɵbs = TimelineItemModule;
16054
- exports.ɵbt = TimelineIconItemComponent;
16055
- exports.ɵbu = HorizontalTimelineModule;
16056
- exports.ɵbv = HorizontalTimelineComponent;
16057
- exports.ɵbw = VerticalTimelineModule;
16058
- exports.ɵbx = VerticalTimelineComponent;
16059
- exports.ɵby = RangeLineComponent;
16060
- exports.ɵbz = CollapseOptionComponent;
16085
+ exports.ɵba = RadioButtonComponent;
16086
+ exports.ɵbb = RowComponent;
16087
+ exports.ɵbc = SectionComponent;
16088
+ exports.ɵbd = SelectFieldComponent;
16089
+ exports.ɵbe = SliderFieldComponent;
16090
+ exports.ɵbf = TextAreaFieldComponent;
16091
+ exports.ɵbg = TextAreaIAFieldComponent;
16092
+ exports.ɵbh = IAssistService;
16093
+ exports.ɵbi = TextFieldComponent;
16094
+ exports.ɵbk = DecimalField;
16095
+ exports.ɵbl = SideTableComponent;
16096
+ exports.ɵbm = StructureModule;
16097
+ exports.ɵbn = HeaderComponent;
16098
+ exports.ɵbo = FooterComponent;
16099
+ exports.ɵbp = NumberLocaleOptions;
16100
+ exports.ɵbq = ThumbnailService;
16101
+ exports.ɵbr = BorderButtonModule;
16102
+ exports.ɵbs = BorderButtonComponent;
16103
+ exports.ɵbt = TimelineItemModule;
16104
+ exports.ɵbu = TimelineIconItemComponent;
16105
+ exports.ɵbv = HorizontalTimelineModule;
16106
+ exports.ɵbw = HorizontalTimelineComponent;
16107
+ exports.ɵbx = VerticalTimelineModule;
16108
+ exports.ɵby = VerticalTimelineComponent;
16109
+ exports.ɵbz = RangeLineComponent;
16061
16110
  exports.ɵc = CountryPhonePickerService;
16062
- exports.ɵca = CollapsedItemsComponent;
16063
- exports.ɵcb = VerticalItemsComponent;
16064
- exports.ɵcc = InfiniteScrollModule;
16065
- exports.ɵcd = InfiniteScrollDirective;
16066
- exports.ɵce = CustomTranslationsModule;
16067
- exports.ɵcf = CodeEditorComponent;
16068
- exports.ɵcg = CoreFacade;
16069
- exports.ɵch = CodeMirror6Core;
16070
- exports.ɵci = TieredMenuEventService;
16071
- exports.ɵcj = TieredMenuService;
16072
- exports.ɵck = TieredMenuComponent;
16073
- exports.ɵcl = TieredMenuNestedComponent;
16074
- exports.ɵcm = TieredMenuItemComponent;
16075
- exports.ɵcn = TieredMenuDividerComponent;
16111
+ exports.ɵca = CollapseOptionComponent;
16112
+ exports.ɵcb = CollapsedItemsComponent;
16113
+ exports.ɵcc = VerticalItemsComponent;
16114
+ exports.ɵcd = InfiniteScrollModule;
16115
+ exports.ɵce = InfiniteScrollDirective;
16116
+ exports.ɵcf = CustomTranslationsModule;
16117
+ exports.ɵcg = CodeEditorComponent;
16118
+ exports.ɵch = CoreFacade;
16119
+ exports.ɵci = CodeMirror6Core;
16120
+ exports.ɵcj = TieredMenuEventService;
16121
+ exports.ɵck = TieredMenuService;
16122
+ exports.ɵcl = TieredMenuComponent;
16123
+ exports.ɵcm = TieredMenuNestedComponent;
16124
+ exports.ɵcn = TieredMenuItemComponent;
16125
+ exports.ɵco = TieredMenuDividerComponent;
16076
16126
  exports.ɵd = LocalizedCurrencyImpurePipe;
16077
16127
  exports.ɵe = LocalizedBignumberPipe;
16078
16128
  exports.ɵf = LocalizedBignumberImpurePipe;
@@ -16082,20 +16132,20 @@
16082
16132
  exports.ɵj = TableColumnsComponent;
16083
16133
  exports.ɵk = TablePagingComponent;
16084
16134
  exports.ɵl = AutocompleteFieldComponent;
16085
- exports.ɵm = BooleanFieldComponent;
16086
- exports.ɵn = CalendarFieldComponent;
16087
- exports.ɵo = ChipsFieldComponent;
16088
- exports.ɵp = CurrencyFieldComponent;
16089
- exports.ɵq = DynamicFieldComponent;
16090
- exports.ɵr = DynamicFormDirective;
16091
- exports.ɵs = FieldsetComponent;
16092
- exports.ɵt = FileUploadComponent$1;
16093
- exports.ɵu = LookupFieldComponent;
16094
- exports.ɵv = NumberFieldComponent;
16095
- exports.ɵw = BignumberFieldComponent;
16096
- exports.ɵx = RadioButtonComponent;
16097
- exports.ɵy = RowComponent;
16098
- exports.ɵz = SectionComponent;
16135
+ exports.ɵm = BignumberFieldComponent;
16136
+ exports.ɵn = BooleanFieldComponent;
16137
+ exports.ɵo = BooleanSwitchFieldComponent;
16138
+ exports.ɵp = CalendarFieldComponent;
16139
+ exports.ɵq = ChipsFieldComponent;
16140
+ exports.ɵr = CountryPhonePickerFieldComponent;
16141
+ exports.ɵs = CurrencyFieldComponent;
16142
+ exports.ɵt = DynamicFieldComponent;
16143
+ exports.ɵu = DynamicFormDirective;
16144
+ exports.ɵv = FieldsetComponent;
16145
+ exports.ɵw = FileUploadComponent$1;
16146
+ exports.ɵx = LookupFieldComponent;
16147
+ exports.ɵy = NumberFieldComponent;
16148
+ exports.ɵz = PasswordFieldComponent;
16099
16149
 
16100
16150
  Object.defineProperty(exports, '__esModule', { value: true });
16101
16151