@seniorsistemas/angular-components 17.5.0 → 17.5.1

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.
@@ -6215,6 +6215,11 @@ var ProgressBarMode;
6215
6215
 
6216
6216
  var ProgressBarComponent = /** @class */ (function () {
6217
6217
  function ProgressBarComponent() {
6218
+ this.numberFormatOptions = {
6219
+ style: "decimal",
6220
+ minimumFractionDigits: 0,
6221
+ maximumFractionDigits: 2,
6222
+ };
6218
6223
  this.showValue = true;
6219
6224
  this.mode = ProgressBarMode.Determinate;
6220
6225
  }
@@ -6235,6 +6240,9 @@ var ProgressBarComponent = /** @class */ (function () {
6235
6240
  __decorate([
6236
6241
  Input()
6237
6242
  ], ProgressBarComponent.prototype, "value", void 0);
6243
+ __decorate([
6244
+ Input()
6245
+ ], ProgressBarComponent.prototype, "numberFormatOptions", void 0);
6238
6246
  __decorate([
6239
6247
  Input()
6240
6248
  ], ProgressBarComponent.prototype, "targetValue", void 0);
@@ -6256,7 +6264,7 @@ var ProgressBarComponent = /** @class */ (function () {
6256
6264
  ProgressBarComponent = __decorate([
6257
6265
  Component({
6258
6266
  selector: "s-progressbar",
6259
- template: "<ng-container *ngIf=\"mode === 'determinate'; then pbDeterminateTemplate else pbIndeterminateTemplate\"></ng-container>\n\n<ng-template #pbDeterminateTemplate>\n <s-progressbar-determinate\n [value]=\"value\"\n [targetValue]=\"targetValue\"\n [targetLabel]=\"targetLabel\"\n [activeColor]=\"activeColor\"\n [showValue]=\"showValue\">\n </s-progressbar-determinate>\n</ng-template>\n\n<ng-template #pbIndeterminateTemplate>\n <s-progressbar-indeterminate\n [activeColor]=\"activeColor\"\n [label]=\"label\">\n </s-progressbar-indeterminate>\n</ng-template>",
6267
+ template: "<ng-container *ngIf=\"mode === 'determinate'; then pbDeterminateTemplate else pbIndeterminateTemplate\"></ng-container>\n\n<ng-template #pbDeterminateTemplate>\n <s-progressbar-determinate\n [value]=\"value\"\n [numberFormatOptions]=\"numberFormatOptions\"\n [targetValue]=\"targetValue\"\n [targetLabel]=\"targetLabel\"\n [activeColor]=\"activeColor\"\n [showValue]=\"showValue\">\n </s-progressbar-determinate>\n</ng-template>\n\n<ng-template #pbIndeterminateTemplate>\n <s-progressbar-indeterminate\n [activeColor]=\"activeColor\"\n [label]=\"label\">\n </s-progressbar-indeterminate>\n</ng-template>",
6260
6268
  styles: [".progress-bar{position:relative}.progress-bar .progress-bar-all{background-color:#d8d8d8;border-radius:4px;height:24px;overflow:hidden;width:100%}.progress-bar .progress-bar-all .progress-bar-active{-ms-flex-align:center;align-items:center;color:#fff;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:14px;height:100%;-ms-flex-pack:center;justify-content:center;line-height:150%;-webkit-user-select:none;-ms-user-select:none;user-select:none;width:80%}.progress-bar .progress-bar-all .progress-bar-active--blue{background-color:#428bca}.progress-bar .progress-bar-all .progress-bar-active--green{background-color:#0c9348}.progress-bar .progress-bar-all .progress-bar-active--red{background-color:#c13018}.progress-bar .progress-bar-all .progress-bar-active--yellow{background-color:#fcbf10}.progress-bar .target{-ms-flex-align:start;align-items:flex-start;bottom:-38px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:absolute}.progress-bar .target .target-line{background-color:#333;height:40px;margin:8px 0;width:1px}.progress-bar .target .target-label{background-color:#426e78;border-radius:10px;color:#e5eaea;font-family:\"Open Sans\",sans-serif;font-size:12px;line-height:150%;padding:2px 12px}"]
6261
6269
  })
6262
6270
  ], ProgressBarComponent);
@@ -6264,11 +6272,24 @@ var ProgressBarComponent = /** @class */ (function () {
6264
6272
  }());
6265
6273
 
6266
6274
  var ProgressBarDeterminateComponent = /** @class */ (function () {
6267
- function ProgressBarDeterminateComponent() {
6275
+ function ProgressBarDeterminateComponent(localeService) {
6276
+ this.localeService = localeService;
6268
6277
  this.showValue = true;
6269
6278
  }
6270
6279
  ProgressBarDeterminateComponent.prototype.ngOnInit = function () {
6271
6280
  this.validateValues();
6281
+ this.onGetLocale();
6282
+ };
6283
+ ProgressBarDeterminateComponent.prototype.onGetLocale = function () {
6284
+ var _this = this;
6285
+ this.localeService.getLocale().subscribe({
6286
+ next: function (locale) {
6287
+ _this.numberFormat = new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : "pt-BR", _this.numberFormatOptions);
6288
+ },
6289
+ error: function () {
6290
+ _this.numberFormat = new Intl.NumberFormat("pt-BR", _this.numberFormatOptions);
6291
+ },
6292
+ });
6272
6293
  };
6273
6294
  ProgressBarDeterminateComponent.prototype.validateValues = function () {
6274
6295
  if (this.value < 0 || this.value > 100) {
@@ -6278,9 +6299,15 @@ var ProgressBarDeterminateComponent = /** @class */ (function () {
6278
6299
  throw new Error("Invalid value for targetValue");
6279
6300
  }
6280
6301
  };
6302
+ ProgressBarDeterminateComponent.ctorParameters = function () { return [
6303
+ { type: LocaleService }
6304
+ ]; };
6281
6305
  __decorate([
6282
6306
  Input()
6283
6307
  ], ProgressBarDeterminateComponent.prototype, "value", void 0);
6308
+ __decorate([
6309
+ Input()
6310
+ ], ProgressBarDeterminateComponent.prototype, "numberFormatOptions", void 0);
6284
6311
  __decorate([
6285
6312
  Input()
6286
6313
  ], ProgressBarDeterminateComponent.prototype, "targetValue", void 0);
@@ -6296,7 +6323,7 @@ var ProgressBarDeterminateComponent = /** @class */ (function () {
6296
6323
  ProgressBarDeterminateComponent = __decorate([
6297
6324
  Component({
6298
6325
  selector: "s-progressbar-determinate",
6299
- template: "<div class=\"progressbar-determinate\">\n <div class=\"progressbar-container\">\n <div\n class=\"progressbar-active\"\n [ngClass]=\"{\n 'progressbar-active--blue' : activeColor === 'blue',\n 'progressbar-active--green': activeColor === 'green',\n 'progressbar-active--red': activeColor === 'red',\n 'progressbar-active--yellow': activeColor === 'yellow'\n }\"\n [ngStyle]=\"{ 'width': value + '%' }\">\n {{ showValue && value ? value + '%' : '' }}\n </div>\n </div>\n <div\n *ngIf=\"targetValue\"\n class=\"target\"\n [ngStyle]=\"{\n 'left': targetValue <= 50 ? targetValue + '%' : 'unset',\n 'right': targetValue > 50 ? 100 - targetValue + '%' : 'unset',\n 'align-items': targetValue > 50 ? 'flex-end' : 'flex-start'\n }\">\n <span class=\"target-line\"></span>\n <span class=\"target-label\">\n {{ targetLabel || value + '%' }}\n </span>\n </div>\n </div>\n ",
6326
+ template: "<div class=\"progressbar-determinate\">\n <div class=\"progressbar-container\">\n <div\n class=\"progressbar-active\"\n [ngClass]=\"{\n 'progressbar-active--blue' : activeColor === 'blue',\n 'progressbar-active--green': activeColor === 'green',\n 'progressbar-active--red': activeColor === 'red',\n 'progressbar-active--yellow': activeColor === 'yellow'\n }\"\n [ngStyle]=\"{ 'width': value + '%' }\">\n\n {{ showValue && value ? numberFormat.format(value) + '%' : '' }}\n </div>\n </div>\n <div\n *ngIf=\"targetValue\"\n class=\"target\"\n [ngStyle]=\"{\n 'left': targetValue <= 50 ? targetValue + '%' : 'unset',\n 'right': targetValue > 50 ? 100 - targetValue + '%' : 'unset',\n 'align-items': targetValue > 50 ? 'flex-end' : 'flex-start'\n }\">\n <span class=\"target-line\"></span>\n <span class=\"target-label\">\n {{ targetLabel || numberFormat.format(value) + '%' }}\n </span>\n </div>\n </div>\n",
6300
6327
  styles: [".progressbar-determinate{position:relative}.progressbar-determinate .progressbar-container{background-color:#d8d8d8;border-radius:4px;height:24px;overflow:hidden;width:100%}.progressbar-determinate .progressbar-container .progressbar-active{-ms-flex-align:center;align-items:center;color:#fff;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:14px;height:100%;-ms-flex-pack:center;justify-content:center;line-height:150%;-webkit-user-select:none;-ms-user-select:none;user-select:none;width:80%}.progressbar-determinate .progressbar-container .progressbar-active--blue{background-color:#428bca}.progressbar-determinate .progressbar-container .progressbar-active--green{background-color:#0c9348}.progressbar-determinate .progressbar-container .progressbar-active--red{background-color:#c13018}.progressbar-determinate .progressbar-container .progressbar-active--yellow{background-color:#fcbf10;color:#212533}.progressbar-determinate .target{-ms-flex-align:start;align-items:flex-start;bottom:-38px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:absolute}.progressbar-determinate .target .target-line{background-color:#333;height:40px;margin:8px 0;width:1px}.progressbar-determinate .target .target-label{background-color:#426e78;border-radius:10px;color:#e5eaea;font-family:\"Open Sans\",sans-serif;font-size:12px;line-height:150%;padding:2px 12px}"]
6301
6328
  })
6302
6329
  ], ProgressBarDeterminateComponent);
@@ -6315,7 +6342,7 @@ var ProgressBarIndeterminateComponent = /** @class */ (function () {
6315
6342
  ProgressBarIndeterminateComponent = __decorate([
6316
6343
  Component({
6317
6344
  selector: "s-progressbar-indeterminate",
6318
- template: "<!-- progressbar-indeterminate.component.html -->\n<div class=\"progressbar-indeterminate\">\n <div class=\"progressbar-container\">\n <div class=\"indeterminate-bar\" [ngClass]=\"{\n 'indeterminate-bar--blue': activeColor === 'blue',\n 'indeterminate-bar--green': activeColor === 'green',\n 'indeterminate-bar--red': activeColor === 'red',\n 'indeterminate-bar--yellow': activeColor === 'yellow'\n }\"></div>\n </div>\n \n <span *ngIf=\"label\" class=\"progressbar-label\">{{ label }}</span>\n</div>\n",
6345
+ template: "<div class=\"progressbar-indeterminate\">\n <div class=\"progressbar-container\">\n <div class=\"indeterminate-bar\" [ngClass]=\"{\n 'indeterminate-bar--blue': activeColor === 'blue',\n 'indeterminate-bar--green': activeColor === 'green',\n 'indeterminate-bar--red': activeColor === 'red',\n 'indeterminate-bar--yellow': activeColor === 'yellow'\n }\"></div>\n </div>\n\n <span *ngIf=\"label\" class=\"progressbar-label\">{{ label }}</span>\n</div>\n",
6319
6346
  styles: [".progressbar-indeterminate{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.progressbar-indeterminate .progressbar-container{background-color:#d8d8d8;border-radius:4px;height:24px;margin:8px 0;overflow:hidden;width:100%}.progressbar-indeterminate .indeterminate-bar{animation:5s infinite indeterminate-progress;background-color:#428bca;height:100%;width:40%}.progressbar-indeterminate .indeterminate-bar--blue{background-color:#428bca}.progressbar-indeterminate .indeterminate-bar--green{background-color:#0c9348}.progressbar-indeterminate .indeterminate-bar--red{background-color:#c13018}.progressbar-indeterminate .indeterminate-bar--yellow{background-color:#fcbf10}.progressbar-indeterminate .progressbar-label{font-family:\"Open Sans\" sans-serif;font-size:12px;line-height:150%;color:#212533}@keyframes indeterminate-progress{0%{transform:translateX(-250%)}100%{transform:translateX(250%)}}"]
6320
6347
  })
6321
6348
  ], ProgressBarIndeterminateComponent);