@seniorsistemas/angular-components 17.8.6 → 17.8.7

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.
@@ -6360,6 +6360,21 @@
6360
6360
  return ExportUtils;
6361
6361
  }());
6362
6362
 
6363
+ var convertToMomentDateFormat = function (format) {
6364
+ // A ordem dos replaces é importante.
6365
+ return format
6366
+ .replace(/\bd\b/, "D") // day of month (no leading zero)
6367
+ .replace(/\bdd\b/, "DD") // day of month
6368
+ .replace(/\bo\b/, "DDD") // day of the year (no leading zero)
6369
+ .replace(/\boo\b/, "DDDD") // day of the year
6370
+ .replace(/\bM\b/, "MMM") // month name short
6371
+ .replace(/\bMM\b/, "MMMM") // month name long
6372
+ .replace(/\bm\b/, "M") // month of year (no leading)
6373
+ .replace(/\bmm\b/, "MM") // month of year
6374
+ .replace(/\by\b/, "YY") // year (two digits)
6375
+ .replace(/\byy\b/, "YYYY"); // year (four digits)
6376
+ };
6377
+
6363
6378
 
6364
6379
  (function (ValidateErrors) {
6365
6380
  ValidateErrors["MAX_FILE_SIZE"] = "MAX_FILE_SIZE";
@@ -8305,10 +8320,15 @@
8305
8320
 
8306
8321
  var moment$4 = moment_;
8307
8322
  var TableColumnsComponent = /** @class */ (function () {
8308
- function TableColumnsComponent(viewContainerRef, translate, hostProjectConfigs) {
8323
+ function TableColumnsComponent(localeService, viewContainerRef, translate, hostProjectConfigs) {
8324
+ this.localeService = localeService;
8309
8325
  this.viewContainerRef = viewContainerRef;
8310
8326
  this.translate = translate;
8311
8327
  this.hostProjectConfigs = hostProjectConfigs;
8328
+ this.locale = {
8329
+ calendar: __assign(__assign({}, this.localeService.getLocaleOptions().calendar), { dateFormat: convertToMomentDateFormat(this.localeService.getLocaleOptions().calendar.dateFormat) }),
8330
+ number: __assign(__assign({}, this.localeService.getLocaleOptions().number), { scale: 0 })
8331
+ };
8312
8332
  this.formattedColumns = [];
8313
8333
  }
8314
8334
  TableColumnsComponent.prototype.ngOnChanges = function (changes) {
@@ -8337,16 +8357,13 @@
8337
8357
  return null;
8338
8358
  };
8339
8359
  TableColumnsComponent.prototype.validateComponentAttributes = function (changes) {
8340
- var _a, _b, _c;
8360
+ var _a, _b;
8341
8361
  if (!this.columns && !((_a = changes.columns) === null || _a === void 0 ? void 0 : _a.currentValue)) {
8342
8362
  throw new Error("The 'columns' attribute must be informed!");
8343
8363
  }
8344
8364
  if (!this.rowValue && !((_b = changes.rowValue) === null || _b === void 0 ? void 0 : _b.currentValue)) {
8345
8365
  throw new Error("The 'rowValue' attribute must be informed!");
8346
8366
  }
8347
- if (!this.locale && !((_c = changes.locale) === null || _c === void 0 ? void 0 : _c.currentValue)) {
8348
- throw new Error("The 'locale' attribute must be informed!");
8349
- }
8350
8367
  };
8351
8368
  TableColumnsComponent.prototype.createColumnsTemplate = function (changes) {
8352
8369
  var _this = this;
@@ -8405,10 +8422,10 @@
8405
8422
  });
8406
8423
  return attributeValue;
8407
8424
  };
8408
- TableColumnsComponent.prototype.getNumberConfigs = function (column, locale) {
8409
- return __assign(__assign({}, locale.number), { scale: column.scale !== null && column.scale !== undefined
8425
+ TableColumnsComponent.prototype.getNumberConfigs = function (column) {
8426
+ return __assign(__assign({}, this.locale.number), { scale: column.scale !== null && column.scale !== undefined
8410
8427
  ? this.getColumnScale(column.scale)
8411
- : locale.number.scale, prefix: locale.number.currencySymbol + " " });
8428
+ : this.locale.number.scale, prefix: this.locale.number.currencySymbol + " " });
8412
8429
  };
8413
8430
  TableColumnsComponent.prototype.getDateFormat = function (column, locale) {
8414
8431
  return column.dateFormat ? column.dateFormat : locale.calendar.dateFormat;
@@ -8426,7 +8443,7 @@
8426
8443
  if (_this.isAttributeValueInvalid(attributeValue)) {
8427
8444
  return uninformed;
8428
8445
  }
8429
- var numberConfigs = _this.getNumberConfigs(column, locale);
8446
+ var numberConfigs = _this.getNumberConfigs(column);
8430
8447
  switch (column.type) {
8431
8448
  case exports.EnumColumnFieldType.ENUM:
8432
8449
  return _this.translate.instant(column.enumPrefix + attributeValue.toString().toLowerCase());
@@ -8524,6 +8541,7 @@
8524
8541
  return columns.sort(function (a, b) { return a.sequence - b.sequence; });
8525
8542
  };
8526
8543
  TableColumnsComponent.ctorParameters = function () { return [
8544
+ { type: LocaleService },
8527
8545
  { type: core.ViewContainerRef },
8528
8546
  { type: core$1.TranslateService },
8529
8547
  { type: undefined, decorators: [{ type: core.Inject, args: [HostProjectConfigsInjectionToken,] }] }
@@ -8546,7 +8564,7 @@
8546
8564
  selector: "s-table-columns",
8547
8565
  styles: [":host{display:none}"]
8548
8566
  }),
8549
- __param(2, core.Inject(HostProjectConfigsInjectionToken))
8567
+ __param(3, core.Inject(HostProjectConfigsInjectionToken))
8550
8568
  ], TableColumnsComponent);
8551
8569
  return TableColumnsComponent;
8552
8570
  }());
@@ -10941,8 +10959,10 @@
10941
10959
  event.stopPropagation();
10942
10960
  };
10943
10961
  ProfilePicturePickerComponent.prototype.onDrop = function (event) {
10962
+ var _a;
10944
10963
  event.preventDefault();
10945
10964
  event.stopPropagation();
10965
+ (_a = this._onTouched) === null || _a === void 0 ? void 0 : _a.call(this);
10946
10966
  var files = [];
10947
10967
  var dataTransferFiles = event.dataTransfer.files;
10948
10968
  for (var i = 0; i < dataTransferFiles.length; i++) {
@@ -10965,9 +10985,11 @@
10965
10985
  }
10966
10986
  };
10967
10987
  ProfilePicturePickerComponent.prototype.selectPhoto = function () {
10988
+ var _a;
10968
10989
  var fileInputElement = this.fileInput.nativeElement;
10969
10990
  fileInputElement.value = "";
10970
10991
  fileInputElement.click();
10992
+ (_a = this._onTouched) === null || _a === void 0 ? void 0 : _a.call(this);
10971
10993
  };
10972
10994
  ProfilePicturePickerComponent.prototype.removePhoto = function () {
10973
10995
  var _this = this;
@@ -10997,10 +11019,11 @@
10997
11019
  fileReader.readAsDataURL(file);
10998
11020
  fileReader.onloadend = function (fileEvent) {
10999
11021
  _this.imageCropperService.show(__assign({ imageSource: fileEvent.target.result, croppedImage: function (image) {
11022
+ var _a;
11000
11023
  _this.image = image;
11001
11024
  _this.changedImage.emit(image);
11002
11025
  _this._value = { sourceFile: file, base64: image };
11003
- _this._onChange(_this._value);
11026
+ (_a = _this._onChange) === null || _a === void 0 ? void 0 : _a.call(_this, _this._value);
11004
11027
  }, changeImage: function () { return _this.selectPhoto(); }, allowSelectAnother: false, aspectRatio: _this.aspectRatio }, _this.cropperLabelsConfig));
11005
11028
  };
11006
11029
  };
@@ -18246,6 +18269,7 @@
18246
18269
  exports.TooltipModule = TooltipModule;
18247
18270
  exports.WorkspaceSwitchComponent = WorkspaceSwitchComponent;
18248
18271
  exports.WorkspaceSwitchModule = WorkspaceSwitchModule;
18272
+ exports.convertToMomentDateFormat = convertToMomentDateFormat;
18249
18273
  exports.countries = countries;
18250
18274
  exports.fallback = fallback;
18251
18275
  exports.ɵa = TooltipComponent;