@seniorsistemas/angular-components 17.8.12 → 17.8.14

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 (38) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +54 -24
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/dynamic-form/components/fields/index.d.ts +19 -0
  6. package/components/dynamic-form/configurations/fields/decimal-field.d.ts +2 -2
  7. package/components/dynamic-form/configurations/fields/field.d.ts +4 -0
  8. package/components/dynamic-form/configurations/fields/number-field.d.ts +2 -0
  9. package/components/navigation-button/index.d.ts +1 -1
  10. package/components/navigation-button/models/index.d.ts +2 -0
  11. package/components/navigation-button/models/navigation-button-step-changed-info.d.ts +5 -0
  12. package/components/navigation-button/navigation-button.component.d.ts +9 -6
  13. package/esm2015/components/custom-fields/custom-fields.component.js +29 -21
  14. package/esm2015/components/dynamic-form/components/fields/index.js +20 -0
  15. package/esm2015/components/dynamic-form/configurations/fields/decimal-field.js +3 -2
  16. package/esm2015/components/dynamic-form/configurations/fields/field.js +3 -1
  17. package/esm2015/components/dynamic-form/configurations/fields/number-field.js +2 -1
  18. package/esm2015/components/dynamic-form/dynamic-form.js +1 -1
  19. package/esm2015/components/navigation-button/index.js +1 -1
  20. package/esm2015/components/navigation-button/models/index.js +1 -0
  21. package/esm2015/components/navigation-button/models/navigation-button-step-changed-info.js +1 -0
  22. package/esm2015/components/navigation-button/navigation-button.component.js +29 -10
  23. package/esm5/components/custom-fields/custom-fields.component.js +26 -18
  24. package/esm5/components/dynamic-form/components/fields/index.js +20 -0
  25. package/esm5/components/dynamic-form/configurations/fields/decimal-field.js +3 -2
  26. package/esm5/components/dynamic-form/configurations/fields/field.js +3 -1
  27. package/esm5/components/dynamic-form/configurations/fields/number-field.js +2 -1
  28. package/esm5/components/dynamic-form/dynamic-form.js +1 -1
  29. package/esm5/components/navigation-button/index.js +1 -1
  30. package/esm5/components/navigation-button/models/index.js +1 -0
  31. package/esm5/components/navigation-button/models/navigation-button-step-changed-info.js +1 -0
  32. package/esm5/components/navigation-button/navigation-button.component.js +30 -11
  33. package/fesm2015/seniorsistemas-angular-components.js +56 -26
  34. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  35. package/fesm5/seniorsistemas-angular-components.js +54 -24
  36. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  37. package/package.json +1 -1
  38. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -4451,6 +4451,8 @@ var Field = /** @class */ (function () {
4451
4451
  this.gridClass = Object.keys(this.size).map(function (key) { return "ui-" + key + "-" + _this.size[key]; });
4452
4452
  this.defaultValue = config.defaultValue;
4453
4453
  this.representedBy = config.representedBy;
4454
+ this.CustomFieldClass = config.CustomFieldClass;
4455
+ this.CustomFieldComponentClass = config.CustomFieldComponentClass;
4454
4456
  }
4455
4457
  return Field;
4456
4458
  }());
@@ -4773,6 +4775,7 @@ var NumberField = /** @class */ (function (_super) {
4773
4775
  _this.numberLocaleOptions = config.numberLocaleOptions;
4774
4776
  _this.browserAutocomplete = config.browserAutocomplete;
4775
4777
  _this.precision = config.precision;
4778
+ _this.scale = config.scale;
4776
4779
  _this.alignTo = config.alignTo || NumberAlignmentOption.LEFT;
4777
4780
  _this.mask = config.mask;
4778
4781
  _this.leftAddon = config.leftAddon;
@@ -4792,10 +4795,11 @@ var NumberField = /** @class */ (function (_super) {
4792
4795
  var DecimalField = /** @class */ (function (_super) {
4793
4796
  __extends(DecimalField, _super);
4794
4797
  function DecimalField(config) {
4798
+ var _a;
4795
4799
  var _this = _super.call(this, config) || this;
4796
4800
  _this.numberLocaleOptions = config.numberLocaleOptions;
4797
4801
  _this.alignTo = config.alignTo || NumberAlignmentOption.RIGHT;
4798
- _this.scale = config.scale || config.scale === 0 ? config.scale : 2;
4802
+ _this.scale = typeof config.scale === "function" ? config.scale() : (_a = config.scale) !== null && _a !== void 0 ? _a : 2;
4799
4803
  return _this;
4800
4804
  }
4801
4805
  return DecimalField;
@@ -11357,7 +11361,7 @@ var CustomFieldsComponent = /** @class */ (function () {
11357
11361
  CustomFieldType.Date,
11358
11362
  CustomFieldType.DateTime,
11359
11363
  CustomFieldType.LocalDateTime,
11360
- CustomFieldType.Time
11364
+ CustomFieldType.Time,
11361
11365
  ];
11362
11366
  var validators = [];
11363
11367
  if (validationRegex && !asIsTypes.includes(fieldType))
@@ -11505,7 +11509,9 @@ var CustomFieldsComponent = /** @class */ (function () {
11505
11509
  CustomFieldsComponent.prototype.createFilesIfSetFormValuesAfterInit = function () {
11506
11510
  var _this = this;
11507
11511
  if (!this.hasUploaded) {
11508
- this.fields.filter(function (field) { return field.type === FieldType.Blob; }).forEach(function (field) {
11512
+ this.fields
11513
+ .filter(function (field) { return field.type === FieldType.Blob; })
11514
+ .forEach(function (field) {
11509
11515
  if (_this.formGroup.get(field.name).value)
11510
11516
  _this.createBlobToFileUpload(field);
11511
11517
  });
@@ -11549,10 +11555,7 @@ var CustomFieldsComponent = /** @class */ (function () {
11549
11555
  return parsedValues;
11550
11556
  };
11551
11557
  CustomFieldsComponent.prototype.isTypeNumberOrEnum = function (type) {
11552
- var numberOrEnum = [
11553
- FieldType.Number,
11554
- FieldType.Enum
11555
- ];
11558
+ var numberOrEnum = [FieldType.Number, FieldType.Enum];
11556
11559
  return numberOrEnum.includes(type);
11557
11560
  };
11558
11561
  CustomFieldsComponent.prototype.getFormField = function (field, localeOptions) {
@@ -11572,7 +11575,11 @@ var CustomFieldsComponent = /** @class */ (function () {
11572
11575
  break;
11573
11576
  case CustomFieldType.Money:
11574
11577
  parameters = {
11575
- type: FieldType.Number,
11578
+ type: FieldType.Custom,
11579
+ CustomFieldComponentClass: NumberFieldComponent,
11580
+ CustomFieldClass: NumberField,
11581
+ precision: 15,
11582
+ scale: 2,
11576
11583
  leftAddon: {
11577
11584
  label: (_b = (_a = localeOptions === null || localeOptions === void 0 ? void 0 : localeOptions.number) === null || _a === void 0 ? void 0 : _a.currencySymbol) !== null && _b !== void 0 ? _b : "R$",
11578
11585
  },
@@ -11580,18 +11587,22 @@ var CustomFieldsComponent = /** @class */ (function () {
11580
11587
  break;
11581
11588
  case CustomFieldType.Double:
11582
11589
  parameters = {
11583
- type: FieldType.Number
11590
+ type: FieldType.Custom,
11591
+ CustomFieldComponentClass: NumberFieldComponent,
11592
+ CustomFieldClass: NumberField,
11593
+ precision: 15,
11594
+ scale: 2,
11584
11595
  };
11585
11596
  break;
11586
11597
  case CustomFieldType.Integer:
11587
11598
  parameters = {
11588
- type: FieldType.Number,
11589
- scale: 0
11599
+ type: FieldType.Custom,
11600
+ CustomFieldComponentClass: NumberFieldComponent,
11601
+ CustomFieldClass: NumberField,
11602
+ precision: 15,
11603
+ scale: 0,
11590
11604
  };
11591
11605
  break;
11592
- default:
11593
- parameters = {};
11594
- break;
11595
11606
  }
11596
11607
  return new FormField(__assign({ name: field.id, label: field.customization.label, tooltip: field.customization.tooltip, infoSign: field.customization.infoSign, type: field.type, mask: field.customization.mask, required: function () { return field.customization.mandatory; }, calendarOptions: localeOptions.calendar, currencyOptions: localeOptions.number }, parameters));
11597
11608
  };
@@ -11639,7 +11650,7 @@ var CustomFieldsComponent = /** @class */ (function () {
11639
11650
  onDownloadFile: function (event, formfield) {
11640
11651
  _this.downloadFile(event, formfield);
11641
11652
  },
11642
- showFileUploadDate: this.showFileUploadDate
11653
+ showFileUploadDate: this.showFileUploadDate,
11643
11654
  };
11644
11655
  };
11645
11656
  /**
@@ -14742,7 +14753,9 @@ var KanbanModule = /** @class */ (function () {
14742
14753
  }());
14743
14754
 
14744
14755
  var NavigationButtonComponent = /** @class */ (function () {
14745
- function NavigationButtonComponent() {
14756
+ function NavigationButtonComponent(changeDetectorRef) {
14757
+ this.changeDetectorRef = changeDetectorRef;
14758
+ this.changeOnInit = false;
14746
14759
  this.stepChanged = new EventEmitter();
14747
14760
  this.currentIndex = 0;
14748
14761
  this.isDisabled = false;
@@ -14750,14 +14763,25 @@ var NavigationButtonComponent = /** @class */ (function () {
14750
14763
  }
14751
14764
  NavigationButtonComponent_1 = NavigationButtonComponent;
14752
14765
  NavigationButtonComponent.prototype.ngOnInit = function () {
14753
- var _this = this;
14754
- var index = this.steps.findIndex(function (step) { return step.value === _this._value; });
14755
- this.currentIndex = index !== -1 ? index : 0;
14756
- this.stepChanged.emit({
14757
- previous: undefined,
14758
- current: this.steps[this.currentIndex],
14759
- });
14760
14766
  this._createTieredMenuItems();
14767
+ if (this.changeOnInit) {
14768
+ this.stepChanged.emit({
14769
+ previous: undefined,
14770
+ current: this.steps[this.currentIndex],
14771
+ });
14772
+ }
14773
+ };
14774
+ NavigationButtonComponent.prototype.ngAfterViewInit = function () {
14775
+ this._setDefaultValue();
14776
+ };
14777
+ NavigationButtonComponent.prototype._setDefaultValue = function () {
14778
+ var _this = this;
14779
+ if (this.defaultValue) {
14780
+ this._value = this.defaultValue;
14781
+ var index = this.steps.findIndex(function (step) { return step.value === _this._value; });
14782
+ this.currentIndex = index !== -1 ? index : 0;
14783
+ this.changeDetectorRef.detectChanges();
14784
+ }
14761
14785
  };
14762
14786
  NavigationButtonComponent.prototype.writeValue = function (value) {
14763
14787
  var _this = this;
@@ -14803,11 +14827,14 @@ var NavigationButtonComponent = /** @class */ (function () {
14803
14827
  this.steps.forEach(function (step) {
14804
14828
  _this.tieredMenuItems.push({
14805
14829
  label: step.label,
14806
- command: function () { return _this.currentIndex = _this.steps.findIndex(function (s) { return s === step; }); },
14830
+ command: function () { return (_this.currentIndex = _this.steps.findIndex(function (s) { return s === step; })); },
14807
14831
  });
14808
14832
  });
14809
14833
  };
14810
14834
  var NavigationButtonComponent_1;
14835
+ NavigationButtonComponent.ctorParameters = function () { return [
14836
+ { type: ChangeDetectorRef }
14837
+ ]; };
14811
14838
  __decorate([
14812
14839
  Input()
14813
14840
  ], NavigationButtonComponent.prototype, "steps", void 0);
@@ -14817,6 +14844,9 @@ var NavigationButtonComponent = /** @class */ (function () {
14817
14844
  __decorate([
14818
14845
  Input()
14819
14846
  ], NavigationButtonComponent.prototype, "tooltip", void 0);
14847
+ __decorate([
14848
+ Input()
14849
+ ], NavigationButtonComponent.prototype, "changeOnInit", void 0);
14820
14850
  __decorate([
14821
14851
  Output()
14822
14852
  ], NavigationButtonComponent.prototype, "stepChanged", void 0);