@seniorsistemas/angular-components 17.6.4 → 17.7.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.
- package/bundles/seniorsistemas-angular-components.umd.js +820 -851
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/file-upload/file-upload.component.d.ts +17 -15
- package/components/file-upload/models/index.d.ts +0 -1
- package/components/file-upload/models/validate-errors.d.ts +0 -1
- package/components/locale/locale.service.d.ts +5 -0
- package/components/locale/options/index.d.ts +1 -0
- package/components/locale/pipes/numeric.pipe.d.ts +13 -0
- package/components/locale/services/numeric.service.d.ts +24 -0
- package/esm2015/components/file-upload/file-upload.component.js +45 -60
- package/esm2015/components/file-upload/file-upload.module.js +6 -16
- package/esm2015/components/file-upload/file-upload.service.js +1 -3
- package/esm2015/components/file-upload/models/index.js +1 -2
- package/esm2015/components/file-upload/models/validate-errors.js +1 -2
- package/esm2015/components/locale/locale.module.js +8 -4
- package/esm2015/components/locale/locale.service.js +9 -2
- package/esm2015/components/locale/options/index.js +1 -1
- package/esm2015/components/locale/pipes/numeric.pipe.js +28 -0
- package/esm2015/components/locale/services/numeric.service.js +70 -0
- package/esm2015/seniorsistemas-angular-components.js +62 -62
- package/esm5/components/file-upload/file-upload.component.js +45 -60
- package/esm5/components/file-upload/file-upload.module.js +6 -16
- package/esm5/components/file-upload/file-upload.service.js +1 -3
- package/esm5/components/file-upload/models/index.js +1 -2
- package/esm5/components/file-upload/models/validate-errors.js +1 -2
- package/esm5/components/locale/locale.module.js +8 -4
- package/esm5/components/locale/locale.service.js +10 -3
- package/esm5/components/locale/options/index.js +1 -1
- package/esm5/components/locale/pipes/numeric.pipe.js +32 -0
- package/esm5/components/locale/services/numeric.service.js +71 -0
- package/esm5/seniorsistemas-angular-components.js +62 -62
- package/fesm2015/seniorsistemas-angular-components.js +769 -802
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +766 -796
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.d.ts +61 -61
- package/seniorsistemas-angular-components.metadata.json +1 -1
- package/components/file-upload/components/file-item/file-item.component.d.ts +0 -26
- package/components/file-upload/models/storage-units.d.ts +0 -5
- package/esm2015/components/file-upload/components/file-item/file-item.component.js +0 -105
- package/esm2015/components/file-upload/models/storage-units.js +0 -6
- package/esm5/components/file-upload/components/file-item/file-item.component.js +0 -107
- package/esm5/components/file-upload/models/storage-units.js +0 -6
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __decorate, __awaiter, __param, __rest } from 'tslib';
|
|
2
|
-
import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Directive, KeyValueDiffers, HostBinding, Renderer2, TemplateRef, InjectionToken, Inject, ViewEncapsulation,
|
|
2
|
+
import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Directive, KeyValueDiffers, HostBinding, Renderer2, TemplateRef, InjectionToken, Inject, ViewEncapsulation, ViewContainerRef, ChangeDetectorRef, Pipe, ɵɵinject, Optional, ContentChild } from '@angular/core';
|
|
3
3
|
import { trigger, transition, style as style$7, animate, state, group, query, animateChild } from '@angular/animations';
|
|
4
4
|
import { Subject, of, from, ReplaySubject, throwError, forkJoin } from 'rxjs';
|
|
5
5
|
import { takeUntil, tap, map, switchMap, catchError, first, filter, take, delay, debounceTime, repeat, finalize } from 'rxjs/operators';
|
|
6
6
|
import { CommonModule } from '@angular/common';
|
|
7
7
|
import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, FormControl, FormGroup, NG_VALIDATORS, FormBuilder, Validators, FormArray, ControlContainer } from '@angular/forms';
|
|
8
8
|
import { RouterModule, NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router } from '@angular/router';
|
|
9
|
-
import { HttpClient,
|
|
9
|
+
import { HttpClient, HttpEventType, HttpClientModule } from '@angular/common/http';
|
|
10
10
|
import { user, service } from '@seniorsistemas/senior-platform-data';
|
|
11
11
|
import * as moment_ from 'moment';
|
|
12
12
|
import { CookieService } from 'ngx-cookie-service';
|
|
@@ -47,6 +47,7 @@ import { PanelModule as PanelModule$1 } from 'primeng/panel';
|
|
|
47
47
|
import { RadioButtonModule } from 'primeng/radiobutton';
|
|
48
48
|
import { SliderModule } from 'primeng/slider';
|
|
49
49
|
import { MessageService, ConfirmationService } from 'primeng/api';
|
|
50
|
+
import { ProgressBarModule as ProgressBarModule$1 } from 'primeng/progressbar';
|
|
50
51
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
51
52
|
import { Clipboard } from '@angular/cdk/clipboard';
|
|
52
53
|
import Cropper from 'cropperjs';
|
|
@@ -892,7 +893,7 @@ let LocaleService = class LocaleService {
|
|
|
892
893
|
get() {
|
|
893
894
|
return this.localeOptions
|
|
894
895
|
? of(this.localeOptions)
|
|
895
|
-
: this.getLocaleConfig().pipe(tap((localeOptions) => (this.localeOptions = localeOptions)));
|
|
896
|
+
: this.getLocaleConfig().pipe(tap((localeOptions) => (this.localeOptions = Object.assign(Object.assign({}, localeOptions), { locale: this.locale }))));
|
|
896
897
|
}
|
|
897
898
|
getLocale() {
|
|
898
899
|
return this.locale
|
|
@@ -902,6 +903,13 @@ let LocaleService = class LocaleService {
|
|
|
902
903
|
return this.locale;
|
|
903
904
|
}));
|
|
904
905
|
}
|
|
906
|
+
/**
|
|
907
|
+
* Returns an object with the locale options based on the user's locale(platform locale).
|
|
908
|
+
* @return The locale options object.
|
|
909
|
+
*/
|
|
910
|
+
getLocaleOptions() {
|
|
911
|
+
return this.localeOptions;
|
|
912
|
+
}
|
|
905
913
|
getUserData() {
|
|
906
914
|
try {
|
|
907
915
|
return of(JSON.parse(this.cookieService.get("com.senior.token")));
|
|
@@ -5627,713 +5635,212 @@ EmptyStateModule = __decorate([
|
|
|
5627
5635
|
})
|
|
5628
5636
|
], EmptyStateModule);
|
|
5629
5637
|
|
|
5630
|
-
|
|
5631
|
-
(
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5638
|
+
let FileUploadService = class FileUploadService {
|
|
5639
|
+
constructor() {
|
|
5640
|
+
this.BASE_URL_FIELD_CUSTOMIZATION = "platform/field_customization";
|
|
5641
|
+
this.TOKEN = new AbortController();
|
|
5642
|
+
}
|
|
5643
|
+
getMetadataCustomField(request) {
|
|
5644
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5645
|
+
return CustomHttpClient.POST(`${this.BASE_URL_FIELD_CUSTOMIZATION}/queries/getFileMetadata`, request, { signal: this.TOKEN.signal });
|
|
5646
|
+
});
|
|
5647
|
+
}
|
|
5648
|
+
};
|
|
5649
|
+
FileUploadService = __decorate([
|
|
5650
|
+
Injectable()
|
|
5651
|
+
], FileUploadService);
|
|
5637
5652
|
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5653
|
+
const Breakpoints = {
|
|
5654
|
+
SM_MIN: 0,
|
|
5655
|
+
SM_MAX: 767,
|
|
5656
|
+
MD_MIN: 768,
|
|
5657
|
+
MD_MAX: 991,
|
|
5658
|
+
LG_MIN: 992,
|
|
5659
|
+
LG_MAX: 1199,
|
|
5660
|
+
XL_MIN: 1200,
|
|
5661
|
+
XL_MAX: Infinity,
|
|
5662
|
+
};
|
|
5643
5663
|
|
|
5644
|
-
|
|
5664
|
+
class ExportUtils {
|
|
5645
5665
|
constructor() {
|
|
5646
|
-
|
|
5647
|
-
style: "decimal",
|
|
5648
|
-
minimumFractionDigits: 0,
|
|
5649
|
-
maximumFractionDigits: 2,
|
|
5650
|
-
};
|
|
5651
|
-
this.showValue = true;
|
|
5652
|
-
this.mode = ProgressBarMode.Determinate;
|
|
5666
|
+
throw new Error("Classe não deve ser instanciada.");
|
|
5653
5667
|
}
|
|
5654
|
-
|
|
5655
|
-
|
|
5668
|
+
static addClass(element, className) {
|
|
5669
|
+
element.nativeElement.className = `${element.nativeElement.className} ${className}`;
|
|
5656
5670
|
}
|
|
5657
|
-
|
|
5658
|
-
if (
|
|
5659
|
-
|
|
5671
|
+
static removeClass(element, className) {
|
|
5672
|
+
if (element.nativeElement.className.includes(className)) {
|
|
5673
|
+
element.nativeElement.className = element.nativeElement.className.replace(className, "");
|
|
5660
5674
|
}
|
|
5661
|
-
|
|
5662
|
-
|
|
5675
|
+
}
|
|
5676
|
+
static exportCSV(columns = [], data = [], csvSeparator = ";", documentName = "download") {
|
|
5677
|
+
let csv = "\ufeff";
|
|
5678
|
+
columns.filter((column) => column.exportable && column.field).forEach((column, i) => {
|
|
5679
|
+
csv += `"${column.header || column.field}"`;
|
|
5680
|
+
if (i < columns.length - 1)
|
|
5681
|
+
csv += csvSeparator;
|
|
5682
|
+
});
|
|
5683
|
+
data.forEach((record) => {
|
|
5684
|
+
csv += "\n";
|
|
5685
|
+
columns.filter((column) => column.exportable && column.field).forEach((column, i) => {
|
|
5686
|
+
let cellData;
|
|
5687
|
+
if (Array.isArray(column.field)) {
|
|
5688
|
+
const fieldValues = column.field.map((col) => this.resolveFieldData(record, col));
|
|
5689
|
+
cellData = fieldValues
|
|
5690
|
+
.flat()
|
|
5691
|
+
.filter((value) => value !== null && value !== undefined)
|
|
5692
|
+
.join(column.separator);
|
|
5693
|
+
}
|
|
5694
|
+
else {
|
|
5695
|
+
cellData = this.resolveFieldData(record, column.field);
|
|
5696
|
+
}
|
|
5697
|
+
if (cellData != null)
|
|
5698
|
+
cellData = String(cellData).replace(/"/g, `""`);
|
|
5699
|
+
else
|
|
5700
|
+
cellData = "";
|
|
5701
|
+
csv += `"${cellData}"`;
|
|
5702
|
+
if (i < columns.length - 1)
|
|
5703
|
+
csv += csvSeparator;
|
|
5704
|
+
});
|
|
5705
|
+
});
|
|
5706
|
+
const blob = new Blob([csv], {
|
|
5707
|
+
type: "text/csv;charset=utf-8;",
|
|
5708
|
+
});
|
|
5709
|
+
if (window.navigator.msSaveOrOpenBlob)
|
|
5710
|
+
navigator.msSaveOrOpenBlob(blob, documentName + ".csv");
|
|
5711
|
+
else {
|
|
5712
|
+
const link = document.createElement("a");
|
|
5713
|
+
link.style.display = "none";
|
|
5714
|
+
document.body.appendChild(link);
|
|
5715
|
+
if (link.download !== undefined) {
|
|
5716
|
+
link.setAttribute("href", URL.createObjectURL(blob));
|
|
5717
|
+
link.setAttribute("download", documentName + ".csv");
|
|
5718
|
+
link.click();
|
|
5719
|
+
}
|
|
5720
|
+
else {
|
|
5721
|
+
csv = "data:text/csv;charset=utf-8," + csv;
|
|
5722
|
+
window.open(encodeURI(csv));
|
|
5723
|
+
}
|
|
5724
|
+
document.body.removeChild(link);
|
|
5663
5725
|
}
|
|
5664
|
-
|
|
5665
|
-
|
|
5726
|
+
}
|
|
5727
|
+
static resolveFieldData(data, field) {
|
|
5728
|
+
if (data && field) {
|
|
5729
|
+
if (this.isFunction(field))
|
|
5730
|
+
return field(data);
|
|
5731
|
+
else if (field.indexOf(".") == -1)
|
|
5732
|
+
return data[field];
|
|
5733
|
+
else {
|
|
5734
|
+
const fields = field.split(".");
|
|
5735
|
+
let value = data;
|
|
5736
|
+
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
5737
|
+
if (value == null) {
|
|
5738
|
+
return null;
|
|
5739
|
+
}
|
|
5740
|
+
value = value[fields[i]];
|
|
5741
|
+
}
|
|
5742
|
+
return value;
|
|
5743
|
+
}
|
|
5666
5744
|
}
|
|
5745
|
+
else
|
|
5746
|
+
return null;
|
|
5667
5747
|
}
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
__decorate([
|
|
5673
|
-
Input()
|
|
5674
|
-
], ProgressBarComponent.prototype, "numberFormatOptions", void 0);
|
|
5675
|
-
__decorate([
|
|
5676
|
-
Input()
|
|
5677
|
-
], ProgressBarComponent.prototype, "targetValue", void 0);
|
|
5678
|
-
__decorate([
|
|
5679
|
-
Input()
|
|
5680
|
-
], ProgressBarComponent.prototype, "label", void 0);
|
|
5681
|
-
__decorate([
|
|
5682
|
-
Input()
|
|
5683
|
-
], ProgressBarComponent.prototype, "targetLabel", void 0);
|
|
5684
|
-
__decorate([
|
|
5685
|
-
Input()
|
|
5686
|
-
], ProgressBarComponent.prototype, "activeColor", void 0);
|
|
5687
|
-
__decorate([
|
|
5688
|
-
Input()
|
|
5689
|
-
], ProgressBarComponent.prototype, "showValue", void 0);
|
|
5690
|
-
__decorate([
|
|
5691
|
-
Input()
|
|
5692
|
-
], ProgressBarComponent.prototype, "mode", void 0);
|
|
5693
|
-
ProgressBarComponent = __decorate([
|
|
5694
|
-
Component({
|
|
5695
|
-
selector: "s-progressbar",
|
|
5696
|
-
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>",
|
|
5697
|
-
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}"]
|
|
5698
|
-
})
|
|
5699
|
-
], ProgressBarComponent);
|
|
5748
|
+
static isFunction(obj) {
|
|
5749
|
+
return !!(obj && obj.constructor && obj.call && obj.apply);
|
|
5750
|
+
}
|
|
5751
|
+
}
|
|
5700
5752
|
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5753
|
+
var ValidateErrors;
|
|
5754
|
+
(function (ValidateErrors) {
|
|
5755
|
+
ValidateErrors["MAX_FILE_SIZE"] = "MAX_FILE_SIZE";
|
|
5756
|
+
ValidateErrors["MAX_FILE_LIMIT"] = "MAX_FILE_LIMIT";
|
|
5757
|
+
ValidateErrors["UNSUPPORTED_EXTENSION"] = "UNSUPPORTED_EXTENSION";
|
|
5758
|
+
})(ValidateErrors || (ValidateErrors = {}));
|
|
5759
|
+
|
|
5760
|
+
var FileUploadPermissions;
|
|
5761
|
+
(function (FileUploadPermissions) {
|
|
5762
|
+
FileUploadPermissions["Add"] = "add";
|
|
5763
|
+
FileUploadPermissions["Read"] = "read";
|
|
5764
|
+
FileUploadPermissions["Remove"] = "remove";
|
|
5765
|
+
})(FileUploadPermissions || (FileUploadPermissions = {}));
|
|
5766
|
+
const ALL_PERMISSIONS = [
|
|
5767
|
+
FileUploadPermissions.Add,
|
|
5768
|
+
FileUploadPermissions.Read,
|
|
5769
|
+
FileUploadPermissions.Remove,
|
|
5770
|
+
];
|
|
5771
|
+
|
|
5772
|
+
var FileUploadComponent_1;
|
|
5773
|
+
const moment$1 = moment_;
|
|
5774
|
+
let FileUploadComponent = FileUploadComponent_1 = class FileUploadComponent {
|
|
5775
|
+
constructor(sanitizer, fileUploadService, translate) {
|
|
5776
|
+
this.sanitizer = sanitizer;
|
|
5777
|
+
this.fileUploadService = fileUploadService;
|
|
5778
|
+
this.translate = translate;
|
|
5779
|
+
this.ADD_PERMISSION = FileUploadPermissions.Add;
|
|
5780
|
+
this.READ_PERMISSION = FileUploadPermissions.Read;
|
|
5781
|
+
this.REMOVE_PERMISSION = FileUploadPermissions.Remove;
|
|
5782
|
+
this.id = `s-file-upload-${FileUploadComponent_1.nextId++}`;
|
|
5783
|
+
this.supportedExtensions = [];
|
|
5784
|
+
this.disabled = false;
|
|
5785
|
+
this.showFileUploadDate = false;
|
|
5786
|
+
this.permissions = ALL_PERMISSIONS;
|
|
5787
|
+
this.uploadHandler = new EventEmitter();
|
|
5788
|
+
this.removeFile = new EventEmitter();
|
|
5789
|
+
this.cancelUpload = new EventEmitter();
|
|
5790
|
+
this.downloadFile = new EventEmitter();
|
|
5791
|
+
this.validateErrors = new EventEmitter();
|
|
5792
|
+
this._files = [];
|
|
5793
|
+
this.ngUsubscribe = new Subject();
|
|
5794
|
+
this.inputValue = "";
|
|
5795
|
+
}
|
|
5796
|
+
set files(files) {
|
|
5797
|
+
var _a;
|
|
5798
|
+
if (this.showFileUploadDate && ((_a = files[0]) === null || _a === void 0 ? void 0 : _a.objectId)) {
|
|
5799
|
+
this.getUploadDate(files);
|
|
5800
|
+
}
|
|
5801
|
+
this._files = files.map(file => {
|
|
5802
|
+
if (this.isImage(file)) {
|
|
5803
|
+
file.objectURL = this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(file));
|
|
5804
|
+
}
|
|
5805
|
+
return file;
|
|
5806
|
+
});
|
|
5705
5807
|
}
|
|
5706
5808
|
ngOnInit() {
|
|
5707
|
-
this.
|
|
5708
|
-
|
|
5809
|
+
this.supportedExtensions = this.supportedExtensions
|
|
5810
|
+
.map(extension => extension.replace(".", "").toLowerCase());
|
|
5709
5811
|
}
|
|
5710
|
-
|
|
5711
|
-
this.
|
|
5712
|
-
|
|
5713
|
-
this.numberFormat = new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : "pt-BR", this.numberFormatOptions);
|
|
5714
|
-
},
|
|
5715
|
-
error: () => {
|
|
5716
|
-
this.numberFormat = new Intl.NumberFormat("pt-BR", this.numberFormatOptions);
|
|
5717
|
-
},
|
|
5718
|
-
});
|
|
5812
|
+
ngOnDestroy() {
|
|
5813
|
+
this.ngUsubscribe.next();
|
|
5814
|
+
this.ngUsubscribe.complete();
|
|
5719
5815
|
}
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
throw new Error("Invalid value for value");
|
|
5723
|
-
}
|
|
5724
|
-
if (this.targetValue < 0 || this.targetValue > 100) {
|
|
5725
|
-
throw new Error("Invalid value for targetValue");
|
|
5726
|
-
}
|
|
5727
|
-
}
|
|
5728
|
-
};
|
|
5729
|
-
ProgressBarDeterminateComponent.ctorParameters = () => [
|
|
5730
|
-
{ type: LocaleService }
|
|
5731
|
-
];
|
|
5732
|
-
__decorate([
|
|
5733
|
-
Input()
|
|
5734
|
-
], ProgressBarDeterminateComponent.prototype, "value", void 0);
|
|
5735
|
-
__decorate([
|
|
5736
|
-
Input()
|
|
5737
|
-
], ProgressBarDeterminateComponent.prototype, "numberFormatOptions", void 0);
|
|
5738
|
-
__decorate([
|
|
5739
|
-
Input()
|
|
5740
|
-
], ProgressBarDeterminateComponent.prototype, "targetValue", void 0);
|
|
5741
|
-
__decorate([
|
|
5742
|
-
Input()
|
|
5743
|
-
], ProgressBarDeterminateComponent.prototype, "targetLabel", void 0);
|
|
5744
|
-
__decorate([
|
|
5745
|
-
Input()
|
|
5746
|
-
], ProgressBarDeterminateComponent.prototype, "activeColor", void 0);
|
|
5747
|
-
__decorate([
|
|
5748
|
-
Input()
|
|
5749
|
-
], ProgressBarDeterminateComponent.prototype, "showValue", void 0);
|
|
5750
|
-
ProgressBarDeterminateComponent = __decorate([
|
|
5751
|
-
Component({
|
|
5752
|
-
selector: "s-progressbar-determinate",
|
|
5753
|
-
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",
|
|
5754
|
-
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}"]
|
|
5755
|
-
})
|
|
5756
|
-
], ProgressBarDeterminateComponent);
|
|
5757
|
-
|
|
5758
|
-
let ProgressBarIndeterminateComponent = class ProgressBarIndeterminateComponent {
|
|
5759
|
-
};
|
|
5760
|
-
__decorate([
|
|
5761
|
-
Input()
|
|
5762
|
-
], ProgressBarIndeterminateComponent.prototype, "activeColor", void 0);
|
|
5763
|
-
__decorate([
|
|
5764
|
-
Input()
|
|
5765
|
-
], ProgressBarIndeterminateComponent.prototype, "label", void 0);
|
|
5766
|
-
ProgressBarIndeterminateComponent = __decorate([
|
|
5767
|
-
Component({
|
|
5768
|
-
selector: "s-progressbar-indeterminate",
|
|
5769
|
-
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",
|
|
5770
|
-
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%)}}"]
|
|
5771
|
-
})
|
|
5772
|
-
], ProgressBarIndeterminateComponent);
|
|
5773
|
-
|
|
5774
|
-
let ProgressBarModule = class ProgressBarModule {
|
|
5775
|
-
};
|
|
5776
|
-
ProgressBarModule = __decorate([
|
|
5777
|
-
NgModule({
|
|
5778
|
-
imports: [CommonModule],
|
|
5779
|
-
declarations: [
|
|
5780
|
-
ProgressBarComponent,
|
|
5781
|
-
ProgressBarDeterminateComponent,
|
|
5782
|
-
ProgressBarIndeterminateComponent,
|
|
5783
|
-
],
|
|
5784
|
-
exports: [ProgressBarComponent],
|
|
5785
|
-
})
|
|
5786
|
-
], ProgressBarModule);
|
|
5787
|
-
|
|
5788
|
-
let LocalizedBignumberPipe = class LocalizedBignumberPipe {
|
|
5789
|
-
constructor(localeService) {
|
|
5790
|
-
this.localeService = localeService;
|
|
5791
|
-
}
|
|
5792
|
-
transform(value, options) {
|
|
5793
|
-
return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
|
|
5794
|
-
}
|
|
5795
|
-
applyMask(value, options) {
|
|
5796
|
-
return this.localeService.get().pipe(map(localeConfig => {
|
|
5797
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
5798
|
-
const configs = {
|
|
5799
|
-
prefix: (_c = (_a = options === null || options === void 0 ? void 0 : options.prefix) !== null && _a !== void 0 ? _a : (_b = localeConfig === null || localeConfig === void 0 ? void 0 : localeConfig.number) === null || _b === void 0 ? void 0 : _b.currencySymbol) !== null && _c !== void 0 ? _c : "R$",
|
|
5800
|
-
thousandsSeparator: (_f = (_d = options === null || options === void 0 ? void 0 : options.thousandsSeparator) !== null && _d !== void 0 ? _d : (_e = localeConfig === null || localeConfig === void 0 ? void 0 : localeConfig.number) === null || _e === void 0 ? void 0 : _e.thousandsSeparator) !== null && _f !== void 0 ? _f : ".",
|
|
5801
|
-
decimalSeparator: (_j = (_g = options === null || options === void 0 ? void 0 : options.decimalSeparator) !== null && _g !== void 0 ? _g : (_h = localeConfig === null || localeConfig === void 0 ? void 0 : localeConfig.number) === null || _h === void 0 ? void 0 : _h.decimalSeparator) !== null && _j !== void 0 ? _j : ",",
|
|
5802
|
-
scale: (_k = options === null || options === void 0 ? void 0 : options.scale) !== null && _k !== void 0 ? _k : 2,
|
|
5803
|
-
allowNegative: (_l = options === null || options === void 0 ? void 0 : options.allowNegative) !== null && _l !== void 0 ? _l : true
|
|
5804
|
-
};
|
|
5805
|
-
const isNumber = !(new BigNumber(value).isNaN());
|
|
5806
|
-
return applyMask(value, configs, isNumber);
|
|
5807
|
-
}));
|
|
5808
|
-
}
|
|
5809
|
-
};
|
|
5810
|
-
LocalizedBignumberPipe.ctorParameters = () => [
|
|
5811
|
-
{ type: LocaleService }
|
|
5812
|
-
];
|
|
5813
|
-
LocalizedBignumberPipe = __decorate([
|
|
5814
|
-
Pipe({
|
|
5815
|
-
name: "localizedBignumber",
|
|
5816
|
-
})
|
|
5817
|
-
], LocalizedBignumberPipe);
|
|
5818
|
-
|
|
5819
|
-
let LocalizedBignumberImpurePipe = class LocalizedBignumberImpurePipe extends LocalizedBignumberPipe {
|
|
5820
|
-
transform(value, options) {
|
|
5821
|
-
return super.transform(value, options);
|
|
5822
|
-
}
|
|
5823
|
-
};
|
|
5824
|
-
LocalizedBignumberImpurePipe = __decorate([
|
|
5825
|
-
Pipe({
|
|
5826
|
-
name: "localizedBignumberImpure",
|
|
5827
|
-
pure: false,
|
|
5828
|
-
})
|
|
5829
|
-
], LocalizedBignumberImpurePipe);
|
|
5830
|
-
|
|
5831
|
-
class LocalizedCurrencyPipeOptions extends NumberLocaleOptions {
|
|
5832
|
-
constructor(config = {}) {
|
|
5833
|
-
super(config);
|
|
5834
|
-
this.scale = 2;
|
|
5835
|
-
}
|
|
5836
|
-
}
|
|
5837
|
-
/**
|
|
5838
|
-
* @deprecated Should use localizedBignumberPipe instead
|
|
5839
|
-
*/
|
|
5840
|
-
let LocalizedCurrencyPipe = class LocalizedCurrencyPipe {
|
|
5841
|
-
constructor(localeService) {
|
|
5842
|
-
this.localeService = localeService;
|
|
5843
|
-
}
|
|
5844
|
-
transform(value, options) {
|
|
5845
|
-
if (!options) {
|
|
5846
|
-
options = new LocalizedCurrencyPipeOptions();
|
|
5847
|
-
}
|
|
5848
|
-
return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
|
|
5849
|
-
}
|
|
5850
|
-
applyMask(value, options) {
|
|
5851
|
-
return this.localeService.get().pipe(map(localeConfig => {
|
|
5852
|
-
const config = Object.assign(Object.assign({}, localeConfig.number), options);
|
|
5853
|
-
const { scale, currencySymbol, thousandsSeparator, decimalSeparator } = config;
|
|
5854
|
-
const rawValue = Number(value).toFixed(scale);
|
|
5855
|
-
const onlyNumbers = rawValue.replace(/[^0-9]/g, ``);
|
|
5856
|
-
const integerPart = onlyNumbers
|
|
5857
|
-
.slice(0, onlyNumbers.length - scale)
|
|
5858
|
-
.replace(/^0*/g, ``)
|
|
5859
|
-
.replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator) || `0`;
|
|
5860
|
-
const decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);
|
|
5861
|
-
const newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;
|
|
5862
|
-
const isZero = !Number(onlyNumbers);
|
|
5863
|
-
const operator = rawValue.includes("-") && !isZero ? "-" : "";
|
|
5864
|
-
return `${operator}${currencySymbol}${newValue}`;
|
|
5865
|
-
}));
|
|
5866
|
-
}
|
|
5867
|
-
};
|
|
5868
|
-
LocalizedCurrencyPipe.ctorParameters = () => [
|
|
5869
|
-
{ type: LocaleService }
|
|
5870
|
-
];
|
|
5871
|
-
LocalizedCurrencyPipe = __decorate([
|
|
5872
|
-
Pipe({
|
|
5873
|
-
name: "localizedCurrency",
|
|
5874
|
-
})
|
|
5875
|
-
], LocalizedCurrencyPipe);
|
|
5876
|
-
|
|
5877
|
-
/**
|
|
5878
|
-
* @deprecated Should use localizedBignumberPipe instead
|
|
5879
|
-
*/
|
|
5880
|
-
let LocalizedCurrencyImpurePipe = class LocalizedCurrencyImpurePipe extends LocalizedCurrencyPipe {
|
|
5881
|
-
transform(value, options = new LocalizedCurrencyPipeOptions()) {
|
|
5882
|
-
return super.transform(value, options);
|
|
5883
|
-
}
|
|
5884
|
-
};
|
|
5885
|
-
LocalizedCurrencyImpurePipe = __decorate([
|
|
5886
|
-
Pipe({
|
|
5887
|
-
name: "localizedCurrencyImpure",
|
|
5888
|
-
pure: false,
|
|
5889
|
-
})
|
|
5890
|
-
], LocalizedCurrencyImpurePipe);
|
|
5891
|
-
|
|
5892
|
-
const moment$1 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
5893
|
-
let LocalizedDatePipe = class LocalizedDatePipe {
|
|
5894
|
-
constructor(localeService) {
|
|
5895
|
-
this.localeService = localeService;
|
|
5896
|
-
}
|
|
5897
|
-
transform(value, format = "L LTS") {
|
|
5898
|
-
return this.localeService.get().pipe(map(() => (value ? moment$1(value).format(format) : value)));
|
|
5899
|
-
}
|
|
5900
|
-
};
|
|
5901
|
-
LocalizedDatePipe.ctorParameters = () => [
|
|
5902
|
-
{ type: LocaleService }
|
|
5903
|
-
];
|
|
5904
|
-
LocalizedDatePipe = __decorate([
|
|
5905
|
-
Pipe({
|
|
5906
|
-
name: "localizedDate",
|
|
5907
|
-
})
|
|
5908
|
-
], LocalizedDatePipe);
|
|
5909
|
-
|
|
5910
|
-
let LocalizedDateImpurePipe = class LocalizedDateImpurePipe extends LocalizedDatePipe {
|
|
5911
|
-
};
|
|
5912
|
-
LocalizedDateImpurePipe = __decorate([
|
|
5913
|
-
Pipe({
|
|
5914
|
-
name: "localizedDateImpure",
|
|
5915
|
-
pure: false,
|
|
5916
|
-
})
|
|
5917
|
-
], LocalizedDateImpurePipe);
|
|
5918
|
-
|
|
5919
|
-
/**
|
|
5920
|
-
* @deprecated Should use localizedBignumberPipe instead
|
|
5921
|
-
*/
|
|
5922
|
-
let LocalizedNumberPipe = class LocalizedNumberPipe {
|
|
5923
|
-
constructor(localeService) {
|
|
5924
|
-
this.localeService = localeService;
|
|
5925
|
-
}
|
|
5926
|
-
transform(value, minimumFractionDigits) {
|
|
5927
|
-
return from(this.localeService.getLocale()).pipe(map((locale) => {
|
|
5928
|
-
const numericValue = Number(value);
|
|
5929
|
-
if (!value && isNaN(numericValue))
|
|
5930
|
-
return;
|
|
5931
|
-
return new Intl.NumberFormat(locale, {
|
|
5932
|
-
minimumFractionDigits: minimumFractionDigits || 0,
|
|
5933
|
-
}).format(Number(value));
|
|
5934
|
-
}));
|
|
5935
|
-
}
|
|
5936
|
-
};
|
|
5937
|
-
LocalizedNumberPipe.ctorParameters = () => [
|
|
5938
|
-
{ type: LocaleService }
|
|
5939
|
-
];
|
|
5940
|
-
LocalizedNumberPipe = __decorate([
|
|
5941
|
-
Pipe({ name: "localizedNumber" })
|
|
5942
|
-
], LocalizedNumberPipe);
|
|
5943
|
-
|
|
5944
|
-
const moment$2 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
5945
|
-
let LocalizedTimePipe = class LocalizedTimePipe {
|
|
5946
|
-
constructor(localeService) {
|
|
5947
|
-
this.localeService = localeService;
|
|
5948
|
-
}
|
|
5949
|
-
transform(value, format = "LTS") {
|
|
5950
|
-
return this.localeService.get().pipe(map(() => (value ? moment$2(value, "HH:mm:ss").format(format) : value)));
|
|
5951
|
-
}
|
|
5952
|
-
};
|
|
5953
|
-
LocalizedTimePipe.ctorParameters = () => [
|
|
5954
|
-
{ type: LocaleService }
|
|
5955
|
-
];
|
|
5956
|
-
LocalizedTimePipe = __decorate([
|
|
5957
|
-
Pipe({
|
|
5958
|
-
name: "localizedTime",
|
|
5959
|
-
})
|
|
5960
|
-
], LocalizedTimePipe);
|
|
5961
|
-
|
|
5962
|
-
let LocalizedTimeImpurePipe = class LocalizedTimeImpurePipe extends LocalizedTimePipe {
|
|
5963
|
-
};
|
|
5964
|
-
LocalizedTimeImpurePipe = __decorate([
|
|
5965
|
-
Pipe({
|
|
5966
|
-
name: "localizedTimeImpure",
|
|
5967
|
-
pure: false,
|
|
5968
|
-
})
|
|
5969
|
-
], LocalizedTimeImpurePipe);
|
|
5970
|
-
|
|
5971
|
-
var LocaleModule_1;
|
|
5972
|
-
let LocaleModule = LocaleModule_1 = class LocaleModule {
|
|
5973
|
-
static forRoot() {
|
|
5974
|
-
return {
|
|
5975
|
-
ngModule: LocaleModule_1,
|
|
5976
|
-
providers: [
|
|
5977
|
-
LocaleService,
|
|
5978
|
-
LocalizedCurrencyPipe,
|
|
5979
|
-
LocalizedDatePipe,
|
|
5980
|
-
LocalizedTimePipe,
|
|
5981
|
-
LocalizedNumberPipe,
|
|
5982
|
-
LocalizedCurrencyImpurePipe,
|
|
5983
|
-
LocalizedDateImpurePipe,
|
|
5984
|
-
LocalizedTimeImpurePipe,
|
|
5985
|
-
LocalizedBignumberPipe,
|
|
5986
|
-
LocalizedBignumberImpurePipe
|
|
5987
|
-
],
|
|
5988
|
-
};
|
|
5989
|
-
}
|
|
5990
|
-
static forChild() {
|
|
5991
|
-
return {
|
|
5992
|
-
ngModule: LocaleModule_1,
|
|
5993
|
-
};
|
|
5994
|
-
}
|
|
5995
|
-
};
|
|
5996
|
-
LocaleModule = LocaleModule_1 = __decorate([
|
|
5997
|
-
NgModule({
|
|
5998
|
-
imports: [CommonModule],
|
|
5999
|
-
exports: [
|
|
6000
|
-
LocalizedCurrencyPipe,
|
|
6001
|
-
LocalizedDatePipe,
|
|
6002
|
-
LocalizedTimePipe,
|
|
6003
|
-
LocalizedNumberPipe,
|
|
6004
|
-
LocalizedCurrencyImpurePipe,
|
|
6005
|
-
LocalizedDateImpurePipe,
|
|
6006
|
-
LocalizedTimeImpurePipe,
|
|
6007
|
-
LocalizedBignumberPipe,
|
|
6008
|
-
LocalizedBignumberImpurePipe
|
|
6009
|
-
],
|
|
6010
|
-
declarations: [
|
|
6011
|
-
LocalizedCurrencyPipe,
|
|
6012
|
-
LocalizedDatePipe,
|
|
6013
|
-
LocalizedTimePipe,
|
|
6014
|
-
LocalizedNumberPipe,
|
|
6015
|
-
LocalizedCurrencyImpurePipe,
|
|
6016
|
-
LocalizedDateImpurePipe,
|
|
6017
|
-
LocalizedTimeImpurePipe,
|
|
6018
|
-
LocalizedBignumberPipe,
|
|
6019
|
-
LocalizedBignumberImpurePipe
|
|
6020
|
-
],
|
|
6021
|
-
})
|
|
6022
|
-
], LocaleModule);
|
|
6023
|
-
|
|
6024
|
-
const Breakpoints = {
|
|
6025
|
-
SM_MIN: 0,
|
|
6026
|
-
SM_MAX: 767,
|
|
6027
|
-
MD_MIN: 768,
|
|
6028
|
-
MD_MAX: 991,
|
|
6029
|
-
LG_MIN: 992,
|
|
6030
|
-
LG_MAX: 1199,
|
|
6031
|
-
XL_MIN: 1200,
|
|
6032
|
-
XL_MAX: Infinity,
|
|
6033
|
-
};
|
|
6034
|
-
|
|
6035
|
-
class ExportUtils {
|
|
6036
|
-
constructor() {
|
|
6037
|
-
throw new Error("Classe não deve ser instanciada.");
|
|
6038
|
-
}
|
|
6039
|
-
static addClass(element, className) {
|
|
6040
|
-
element.nativeElement.className = `${element.nativeElement.className} ${className}`;
|
|
6041
|
-
}
|
|
6042
|
-
static removeClass(element, className) {
|
|
6043
|
-
if (element.nativeElement.className.includes(className)) {
|
|
6044
|
-
element.nativeElement.className = element.nativeElement.className.replace(className, "");
|
|
6045
|
-
}
|
|
6046
|
-
}
|
|
6047
|
-
static exportCSV(columns = [], data = [], csvSeparator = ";", documentName = "download") {
|
|
6048
|
-
let csv = "\ufeff";
|
|
6049
|
-
columns.filter((column) => column.exportable && column.field).forEach((column, i) => {
|
|
6050
|
-
csv += `"${column.header || column.field}"`;
|
|
6051
|
-
if (i < columns.length - 1)
|
|
6052
|
-
csv += csvSeparator;
|
|
6053
|
-
});
|
|
6054
|
-
data.forEach((record) => {
|
|
6055
|
-
csv += "\n";
|
|
6056
|
-
columns.filter((column) => column.exportable && column.field).forEach((column, i) => {
|
|
6057
|
-
let cellData;
|
|
6058
|
-
if (Array.isArray(column.field)) {
|
|
6059
|
-
const fieldValues = column.field.map((col) => this.resolveFieldData(record, col));
|
|
6060
|
-
cellData = fieldValues
|
|
6061
|
-
.flat()
|
|
6062
|
-
.filter((value) => value !== null && value !== undefined)
|
|
6063
|
-
.join(column.separator);
|
|
6064
|
-
}
|
|
6065
|
-
else {
|
|
6066
|
-
cellData = this.resolveFieldData(record, column.field);
|
|
6067
|
-
}
|
|
6068
|
-
if (cellData != null)
|
|
6069
|
-
cellData = String(cellData).replace(/"/g, `""`);
|
|
6070
|
-
else
|
|
6071
|
-
cellData = "";
|
|
6072
|
-
csv += `"${cellData}"`;
|
|
6073
|
-
if (i < columns.length - 1)
|
|
6074
|
-
csv += csvSeparator;
|
|
6075
|
-
});
|
|
6076
|
-
});
|
|
6077
|
-
const blob = new Blob([csv], {
|
|
6078
|
-
type: "text/csv;charset=utf-8;",
|
|
6079
|
-
});
|
|
6080
|
-
if (window.navigator.msSaveOrOpenBlob)
|
|
6081
|
-
navigator.msSaveOrOpenBlob(blob, documentName + ".csv");
|
|
6082
|
-
else {
|
|
6083
|
-
const link = document.createElement("a");
|
|
6084
|
-
link.style.display = "none";
|
|
6085
|
-
document.body.appendChild(link);
|
|
6086
|
-
if (link.download !== undefined) {
|
|
6087
|
-
link.setAttribute("href", URL.createObjectURL(blob));
|
|
6088
|
-
link.setAttribute("download", documentName + ".csv");
|
|
6089
|
-
link.click();
|
|
6090
|
-
}
|
|
6091
|
-
else {
|
|
6092
|
-
csv = "data:text/csv;charset=utf-8," + csv;
|
|
6093
|
-
window.open(encodeURI(csv));
|
|
6094
|
-
}
|
|
6095
|
-
document.body.removeChild(link);
|
|
6096
|
-
}
|
|
6097
|
-
}
|
|
6098
|
-
static resolveFieldData(data, field) {
|
|
6099
|
-
if (data && field) {
|
|
6100
|
-
if (this.isFunction(field))
|
|
6101
|
-
return field(data);
|
|
6102
|
-
else if (field.indexOf(".") == -1)
|
|
6103
|
-
return data[field];
|
|
6104
|
-
else {
|
|
6105
|
-
const fields = field.split(".");
|
|
6106
|
-
let value = data;
|
|
6107
|
-
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
6108
|
-
if (value == null) {
|
|
6109
|
-
return null;
|
|
6110
|
-
}
|
|
6111
|
-
value = value[fields[i]];
|
|
6112
|
-
}
|
|
6113
|
-
return value;
|
|
6114
|
-
}
|
|
6115
|
-
}
|
|
6116
|
-
else
|
|
6117
|
-
return null;
|
|
6118
|
-
}
|
|
6119
|
-
static isFunction(obj) {
|
|
6120
|
-
return !!(obj && obj.constructor && obj.call && obj.apply);
|
|
6121
|
-
}
|
|
6122
|
-
}
|
|
6123
|
-
|
|
6124
|
-
var ValidateErrors;
|
|
6125
|
-
(function (ValidateErrors) {
|
|
6126
|
-
ValidateErrors["MAX_FILE_SIZE"] = "MAX_FILE_SIZE";
|
|
6127
|
-
ValidateErrors["MAX_COMBINED_FILE_SIZE"] = "MAX_COMBINED_FILE_SIZE";
|
|
6128
|
-
ValidateErrors["MAX_FILE_LIMIT"] = "MAX_FILE_LIMIT";
|
|
6129
|
-
ValidateErrors["UNSUPPORTED_EXTENSION"] = "UNSUPPORTED_EXTENSION";
|
|
6130
|
-
})(ValidateErrors || (ValidateErrors = {}));
|
|
6131
|
-
|
|
6132
|
-
var FileUploadPermissions;
|
|
6133
|
-
(function (FileUploadPermissions) {
|
|
6134
|
-
FileUploadPermissions["Add"] = "add";
|
|
6135
|
-
FileUploadPermissions["Read"] = "read";
|
|
6136
|
-
FileUploadPermissions["Remove"] = "remove";
|
|
6137
|
-
})(FileUploadPermissions || (FileUploadPermissions = {}));
|
|
6138
|
-
const ALL_PERMISSIONS = [
|
|
6139
|
-
FileUploadPermissions.Add,
|
|
6140
|
-
FileUploadPermissions.Read,
|
|
6141
|
-
FileUploadPermissions.Remove,
|
|
6142
|
-
];
|
|
6143
|
-
|
|
6144
|
-
const StorageUnits = {
|
|
6145
|
-
KB: 1024,
|
|
6146
|
-
MB: Math.pow(1024, 2),
|
|
6147
|
-
GB: Math.pow(1024, 3),
|
|
6148
|
-
};
|
|
6149
|
-
|
|
6150
|
-
let FileItemComponent = class FileItemComponent {
|
|
6151
|
-
constructor(localeService) {
|
|
6152
|
-
this.localeService = localeService;
|
|
6153
|
-
this.canReadFiles = true;
|
|
6154
|
-
this.canRemoveFiles = true;
|
|
6155
|
-
this.cancelUpload = new EventEmitter();
|
|
6156
|
-
this.removeFile = new EventEmitter();
|
|
6157
|
-
}
|
|
6158
|
-
ngOnInit() {
|
|
6159
|
-
this._getLocale();
|
|
6160
|
-
}
|
|
6161
|
-
ngAfterContentInit() {
|
|
6162
|
-
this._update();
|
|
5816
|
+
ngAfterContentInit() {
|
|
5817
|
+
this.update();
|
|
6163
5818
|
}
|
|
6164
5819
|
onResize() {
|
|
6165
|
-
this.
|
|
6166
|
-
}
|
|
6167
|
-
_update() {
|
|
6168
|
-
const windowWidth = window.innerWidth;
|
|
6169
|
-
this.isSmallDevice = windowWidth <= Breakpoints.SM_MAX;
|
|
6170
|
-
}
|
|
6171
|
-
simplifySize(size) {
|
|
6172
|
-
let unit;
|
|
6173
|
-
let convertedSize;
|
|
6174
|
-
if (size < StorageUnits.KB) {
|
|
6175
|
-
convertedSize = size;
|
|
6176
|
-
unit = "bytes";
|
|
6177
|
-
}
|
|
6178
|
-
else if (size < StorageUnits.MB) {
|
|
6179
|
-
convertedSize = size / StorageUnits.KB;
|
|
6180
|
-
unit = "KB";
|
|
6181
|
-
}
|
|
6182
|
-
else if (size < StorageUnits.GB) {
|
|
6183
|
-
convertedSize = size / StorageUnits.MB;
|
|
6184
|
-
unit = "MB";
|
|
6185
|
-
}
|
|
6186
|
-
else {
|
|
6187
|
-
convertedSize = size / StorageUnits.GB;
|
|
6188
|
-
unit = "GB";
|
|
6189
|
-
}
|
|
6190
|
-
return `${convertedSize.toLocaleString(this._locale, { maximumFractionDigits: 2 })} ${unit}`;
|
|
6191
|
-
}
|
|
6192
|
-
_getLocale() {
|
|
6193
|
-
this.localeService
|
|
6194
|
-
.getLocale()
|
|
6195
|
-
.pipe(first())
|
|
6196
|
-
.subscribe((locale) => {
|
|
6197
|
-
this._locale = locale;
|
|
6198
|
-
});
|
|
6199
|
-
}
|
|
6200
|
-
};
|
|
6201
|
-
FileItemComponent.ctorParameters = () => [
|
|
6202
|
-
{ type: LocaleService }
|
|
6203
|
-
];
|
|
6204
|
-
__decorate([
|
|
6205
|
-
Input()
|
|
6206
|
-
], FileItemComponent.prototype, "id", void 0);
|
|
6207
|
-
__decorate([
|
|
6208
|
-
Input()
|
|
6209
|
-
], FileItemComponent.prototype, "file", void 0);
|
|
6210
|
-
__decorate([
|
|
6211
|
-
Input()
|
|
6212
|
-
], FileItemComponent.prototype, "canReadFiles", void 0);
|
|
6213
|
-
__decorate([
|
|
6214
|
-
Input()
|
|
6215
|
-
], FileItemComponent.prototype, "canRemoveFiles", void 0);
|
|
6216
|
-
__decorate([
|
|
6217
|
-
Input()
|
|
6218
|
-
], FileItemComponent.prototype, "cancelLabel", void 0);
|
|
6219
|
-
__decorate([
|
|
6220
|
-
Input()
|
|
6221
|
-
], FileItemComponent.prototype, "removeLabel", void 0);
|
|
6222
|
-
__decorate([
|
|
6223
|
-
Input()
|
|
6224
|
-
], FileItemComponent.prototype, "ariaLabelProgress", void 0);
|
|
6225
|
-
__decorate([
|
|
6226
|
-
Input()
|
|
6227
|
-
], FileItemComponent.prototype, "successTooltip", void 0);
|
|
6228
|
-
__decorate([
|
|
6229
|
-
Input()
|
|
6230
|
-
], FileItemComponent.prototype, "ariaLabelSuccess", void 0);
|
|
6231
|
-
__decorate([
|
|
6232
|
-
Output()
|
|
6233
|
-
], FileItemComponent.prototype, "cancelUpload", void 0);
|
|
6234
|
-
__decorate([
|
|
6235
|
-
Output()
|
|
6236
|
-
], FileItemComponent.prototype, "removeFile", void 0);
|
|
6237
|
-
__decorate([
|
|
6238
|
-
HostListener("window:resize")
|
|
6239
|
-
], FileItemComponent.prototype, "onResize", null);
|
|
6240
|
-
FileItemComponent = __decorate([
|
|
6241
|
-
Component({
|
|
6242
|
-
selector: "s-file-item",
|
|
6243
|
-
template: "<div [id]=\"id\" class=\"file-item-container\">\n <div class=\"file-info\">\n <ng-container *ngIf=\"canReadFiles; then fileNameUrl; else fileName\"></ng-container>\n <ng-template #fileNameUrl>\n <a\n class=\"file-name file-name--link\"\n tabindex=\"0\"\n [href]=\"file.objectURL\"\n download>\n {{ file.name }}\n </a>\n </ng-template>\n <ng-template #fileName>\n <span\n *ngIf=\"!canReadFiles\"\n class=\"file-name\">\n {{ file.name }}\n </span>\n </ng-template>\n <span class=\"file-size\">\n {{ simplifySize(file.size) }}\n </span>\n <div\n *ngIf=\"file.isUploading && !isSmallDevice\"\n class=\"progressbar\"\n [attr.aria-label]=\"ariaLabelProgress || 'platform.angular_components.loading_file' | translate\">\n <s-progressbar\n [value]=\"file.progress\"\n activeColor=\"blue\"\n [showValue]=\"true\">\n </s-progressbar>\n </div>\n <span\n *ngIf=\"file.isUploading && isSmallDevice\" \n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"ariaLabelProgress || 'platform.angular_components.loading_file' | translate\">\n </span>\n\n <span\n *ngIf=\"!file.isUploading && !file.error\"\n class=\"status-icon status-icon--success fas fa-check\"\n [attr.aria-label]=\"ariaLabelSuccess || successTooltip || 'platform.angular_components.file_attached_successfully' | translate\"\n [sTooltip]=\"successTooltip || 'platform.angular_components.file_attached_successfully' | translate\">\n </span>\n <span\n *ngIf=\"!file.isUploading && file.error\"\n class=\"status-icon status-icon--fail fas fa-times\"\n [attr.aria-label]=\"file.error?.message\"\n [sTooltip]=\"file.error?.message\">\n </span>\n </div>\n <button\n *ngIf=\"file.isUploading\"\n class=\"file-option file-option--cancel\"\n (click)=\"cancelUpload.emit(file)\">\n {{ cancelLabel || \"platform.angular_components.cancel\" | translate }}\n </button>\n <button\n *ngIf=\"canRemoveFiles && !file.isUploading\"\n class=\"file-option file-option--remove\"\n (click)=\"removeFile.emit(file)\">\n {{ removeLabel || \"platform.angular_components.remove\" | translate }}\n </button>\n</div>\n",
|
|
6244
|
-
styles: [".file-item-container{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:16px;padding:16px}.file-item-container .file-info{color:#212533;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:14px;gap:16px;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}.file-item-container .file-info .file-name{-ms-flex-positive:1;flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-item-container .file-info .file-name--link{color:#428bca;text-decoration:none}.file-item-container .file-info .file-size{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-item-container .progressbar{width:20%}.file-item-container .status-icon{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;font-size:12px}.file-item-container .status-icon--success{color:#0c9348}.file-item-container .status-icon--fail{color:#c13018}.file-item-container .file-option{background-color:transparent;border:none;color:#428bca;cursor:pointer;font-family:\"Open Sans\",sans-serif;font-size:14px;overflow:hidden;text-overflow:ellipsis;max-width:100%}@media screen and (max-width:600px){.file-item-container{-ms-flex-align:start;align-items:flex-start;-ms-flex-direction:column;flex-direction:column}}"]
|
|
6245
|
-
})
|
|
6246
|
-
], FileItemComponent);
|
|
6247
|
-
|
|
6248
|
-
const moment$3 = moment_;
|
|
6249
|
-
let FileUploadService = class FileUploadService {
|
|
6250
|
-
constructor() {
|
|
6251
|
-
this.BASE_URL_FIELD_CUSTOMIZATION = "platform/field_customization";
|
|
6252
|
-
this.TOKEN = new AbortController();
|
|
6253
|
-
}
|
|
6254
|
-
getMetadataCustomField(request) {
|
|
6255
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
6256
|
-
return CustomHttpClient.POST(`${this.BASE_URL_FIELD_CUSTOMIZATION}/queries/getFileMetadata`, request, { signal: this.TOKEN.signal });
|
|
6257
|
-
});
|
|
6258
|
-
}
|
|
6259
|
-
};
|
|
6260
|
-
FileUploadService = __decorate([
|
|
6261
|
-
Injectable()
|
|
6262
|
-
], FileUploadService);
|
|
6263
|
-
|
|
6264
|
-
var FileUploadComponent_1;
|
|
6265
|
-
const moment$4 = moment_;
|
|
6266
|
-
let FileUploadComponent = FileUploadComponent_1 = class FileUploadComponent {
|
|
6267
|
-
constructor(sanitizer, fileUploadService, translate) {
|
|
6268
|
-
this.sanitizer = sanitizer;
|
|
6269
|
-
this.fileUploadService = fileUploadService;
|
|
6270
|
-
this.translate = translate;
|
|
6271
|
-
this.ADD_PERMISSION = FileUploadPermissions.Add;
|
|
6272
|
-
this.READ_PERMISSION = FileUploadPermissions.Read;
|
|
6273
|
-
this.REMOVE_PERMISSION = FileUploadPermissions.Remove;
|
|
6274
|
-
this.id = `s-file-upload-${FileUploadComponent_1.nextId++}`;
|
|
6275
|
-
this.supportedExtensions = [];
|
|
6276
|
-
this.disabled = false;
|
|
6277
|
-
this.showFileUploadDate = false;
|
|
6278
|
-
this.permissions = ALL_PERMISSIONS;
|
|
6279
|
-
this.uploadHandler = new EventEmitter();
|
|
6280
|
-
this.removeFile = new EventEmitter();
|
|
6281
|
-
this.cancelUpload = new EventEmitter();
|
|
6282
|
-
this.downloadFile = new EventEmitter();
|
|
6283
|
-
this.validateErrors = new EventEmitter();
|
|
6284
|
-
this.inputValue = "";
|
|
6285
|
-
this._files = [];
|
|
6286
|
-
this.ngUsubscribe = new Subject();
|
|
6287
|
-
}
|
|
6288
|
-
set files(files) {
|
|
6289
|
-
var _a;
|
|
6290
|
-
if (this.showFileUploadDate && ((_a = files[0]) === null || _a === void 0 ? void 0 : _a.objectId)) {
|
|
6291
|
-
this._getUploadDate(files);
|
|
6292
|
-
}
|
|
6293
|
-
this._files = files.map((file) => {
|
|
6294
|
-
if (this._isImage(file)) {
|
|
6295
|
-
file.objectURL = this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(file));
|
|
6296
|
-
}
|
|
6297
|
-
return file;
|
|
6298
|
-
});
|
|
6299
|
-
}
|
|
6300
|
-
ngOnInit() {
|
|
6301
|
-
this.supportedExtensions = this.supportedExtensions.map((extension) => extension.replace(".", "").toLowerCase());
|
|
6302
|
-
}
|
|
6303
|
-
ngOnDestroy() {
|
|
6304
|
-
this.ngUsubscribe.next();
|
|
6305
|
-
this.ngUsubscribe.complete();
|
|
5820
|
+
this.update();
|
|
6306
5821
|
}
|
|
6307
5822
|
onFileSelect(files) {
|
|
6308
5823
|
const newFiles = [];
|
|
6309
5824
|
if (!this.multiple) {
|
|
6310
5825
|
this.files = [];
|
|
6311
5826
|
}
|
|
6312
|
-
if (this.
|
|
5827
|
+
if (this.isFileLimitExceeded(files)) {
|
|
6313
5828
|
this.validateErrors.emit({
|
|
6314
5829
|
files,
|
|
6315
5830
|
validation: ValidateErrors.MAX_FILE_LIMIT,
|
|
6316
5831
|
});
|
|
6317
|
-
this.
|
|
6318
|
-
return;
|
|
6319
|
-
}
|
|
6320
|
-
if (this._isFileCombinedSizeExceeded(files)) {
|
|
6321
|
-
this.validateErrors.emit({
|
|
6322
|
-
files,
|
|
6323
|
-
validation: ValidateErrors.MAX_COMBINED_FILE_SIZE,
|
|
6324
|
-
});
|
|
6325
|
-
this._clearFileInput();
|
|
5832
|
+
this.clearFileInput();
|
|
6326
5833
|
return;
|
|
6327
5834
|
}
|
|
6328
5835
|
for (const file of files) {
|
|
6329
|
-
if (this.
|
|
5836
|
+
if (this.isUnsupportedFileExtension(file)) {
|
|
6330
5837
|
this.validateErrors.emit({
|
|
6331
5838
|
files: [file],
|
|
6332
5839
|
validation: ValidateErrors.UNSUPPORTED_EXTENSION,
|
|
6333
5840
|
});
|
|
6334
5841
|
continue;
|
|
6335
5842
|
}
|
|
6336
|
-
if (this.
|
|
5843
|
+
if (this.isFileSizeExceeded(file)) {
|
|
6337
5844
|
this.validateErrors.emit({
|
|
6338
5845
|
files: [file],
|
|
6339
5846
|
validation: ValidateErrors.MAX_FILE_SIZE,
|
|
@@ -6348,7 +5855,7 @@ let FileUploadComponent = FileUploadComponent_1 = class FileUploadComponent {
|
|
|
6348
5855
|
files: newFiles,
|
|
6349
5856
|
});
|
|
6350
5857
|
}
|
|
6351
|
-
this.
|
|
5858
|
+
this.clearFileInput();
|
|
6352
5859
|
}
|
|
6353
5860
|
onRemoveFile(file) {
|
|
6354
5861
|
const fileIndex = this.files.indexOf(file);
|
|
@@ -6357,13 +5864,12 @@ let FileUploadComponent = FileUploadComponent_1 = class FileUploadComponent {
|
|
|
6357
5864
|
this.removeFile.emit({ file });
|
|
6358
5865
|
}
|
|
6359
5866
|
}
|
|
6360
|
-
onCancelUpload(
|
|
6361
|
-
const
|
|
6362
|
-
if (
|
|
6363
|
-
this.files.splice(index, 1);
|
|
5867
|
+
onCancelUpload(index) {
|
|
5868
|
+
const removedFiles = this.files.splice(index, 1);
|
|
5869
|
+
if (removedFiles.length) {
|
|
6364
5870
|
this.cancelUpload.emit(index);
|
|
6365
5871
|
}
|
|
6366
|
-
this.
|
|
5872
|
+
this.clearFileInput();
|
|
6367
5873
|
}
|
|
6368
5874
|
onDowloadFile(index) {
|
|
6369
5875
|
this.downloadFile.emit({
|
|
@@ -6374,64 +5880,50 @@ let FileUploadComponent = FileUploadComponent_1 = class FileUploadComponent {
|
|
|
6374
5880
|
get files() {
|
|
6375
5881
|
return this._files;
|
|
6376
5882
|
}
|
|
6377
|
-
|
|
5883
|
+
update() {
|
|
5884
|
+
const windowWidth = window.innerWidth;
|
|
5885
|
+
this.isSmallDevice = windowWidth <= Breakpoints.SM_MAX;
|
|
5886
|
+
}
|
|
5887
|
+
isImage(file) {
|
|
6378
5888
|
return /^image\//.test(file.type);
|
|
6379
5889
|
}
|
|
6380
|
-
|
|
5890
|
+
isFileLimitExceeded(files) {
|
|
6381
5891
|
if (!this.fileLimit) {
|
|
6382
5892
|
return false;
|
|
6383
5893
|
}
|
|
6384
5894
|
return this.files.length + files.length > this.fileLimit;
|
|
6385
5895
|
}
|
|
6386
|
-
|
|
6387
|
-
if (!this.maxCombinedFileSize) {
|
|
6388
|
-
return false;
|
|
6389
|
-
}
|
|
6390
|
-
const filesList = [...files, ...this.files];
|
|
6391
|
-
const combinedSize = filesList.reduce((combinedSize, file) => combinedSize + file.size, 0);
|
|
6392
|
-
return combinedSize > this.maxCombinedFileSize;
|
|
6393
|
-
}
|
|
6394
|
-
_isFileSizeExceeded(file) {
|
|
5896
|
+
isFileSizeExceeded(file) {
|
|
6395
5897
|
if (!this.maxFileSize) {
|
|
6396
5898
|
return false;
|
|
6397
5899
|
}
|
|
6398
5900
|
return file.size > this.maxFileSize;
|
|
6399
5901
|
}
|
|
6400
|
-
|
|
5902
|
+
isUnsupportedFileExtension(file) {
|
|
6401
5903
|
var _a;
|
|
6402
5904
|
if ((_a = this.supportedExtensions) === null || _a === void 0 ? void 0 : _a.length) {
|
|
6403
|
-
const extension = file.name
|
|
6404
|
-
.split(".")
|
|
6405
|
-
.pop()
|
|
6406
|
-
.toLowerCase();
|
|
5905
|
+
const extension = file.name.split(".").pop().toLowerCase();
|
|
6407
5906
|
return !this.supportedExtensions.includes(extension);
|
|
6408
5907
|
}
|
|
6409
5908
|
return false;
|
|
6410
5909
|
}
|
|
6411
|
-
|
|
5910
|
+
clearFileInput() {
|
|
6412
5911
|
this.inputUpload.nativeElement.value = null;
|
|
6413
5912
|
}
|
|
6414
|
-
|
|
5913
|
+
getUploadDate(blobFile) {
|
|
6415
5914
|
if (!blobFile) {
|
|
6416
5915
|
return;
|
|
6417
5916
|
}
|
|
6418
|
-
this.fileUploadService
|
|
6419
|
-
.
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
const
|
|
6424
|
-
const
|
|
6425
|
-
const
|
|
6426
|
-
const
|
|
6427
|
-
|
|
6428
|
-
this.modifiedDate = this.translate.instant("platform.angular_components.date_modified_custom_blob", {
|
|
6429
|
-
hour,
|
|
6430
|
-
minutes,
|
|
6431
|
-
day,
|
|
6432
|
-
month,
|
|
6433
|
-
fullYear,
|
|
6434
|
-
});
|
|
5917
|
+
this.fileUploadService.getMetadataCustomField({ objectId: blobFile[0].objectId })
|
|
5918
|
+
.then(metadata => this.setModifiedDate(metadata));
|
|
5919
|
+
}
|
|
5920
|
+
setModifiedDate(metadata) {
|
|
5921
|
+
const hour = moment$1(metadata.modified).format("HH");
|
|
5922
|
+
const minutes = moment$1(metadata.modified).format("mm");
|
|
5923
|
+
const day = moment$1(metadata.modified).format("DD");
|
|
5924
|
+
const month = moment$1(metadata.modified).format("MM");
|
|
5925
|
+
const fullYear = moment$1(metadata.modified).format("YYYY");
|
|
5926
|
+
this.modifiedDate = this.translate.instant("platform.angular_components.date_modified_custom_blob", { hour, minutes, day, month, fullYear });
|
|
6435
5927
|
}
|
|
6436
5928
|
};
|
|
6437
5929
|
FileUploadComponent.nextId = 0;
|
|
@@ -6476,9 +5968,6 @@ __decorate([
|
|
|
6476
5968
|
__decorate([
|
|
6477
5969
|
Input()
|
|
6478
5970
|
], FileUploadComponent.prototype, "maxFileSize", void 0);
|
|
6479
|
-
__decorate([
|
|
6480
|
-
Input()
|
|
6481
|
-
], FileUploadComponent.prototype, "maxCombinedFileSize", void 0);
|
|
6482
5971
|
__decorate([
|
|
6483
5972
|
Input()
|
|
6484
5973
|
], FileUploadComponent.prototype, "fileLimit", void 0);
|
|
@@ -6524,11 +6013,14 @@ __decorate([
|
|
|
6524
6013
|
__decorate([
|
|
6525
6014
|
Output()
|
|
6526
6015
|
], FileUploadComponent.prototype, "validateErrors", void 0);
|
|
6016
|
+
__decorate([
|
|
6017
|
+
HostListener("window:resize")
|
|
6018
|
+
], FileUploadComponent.prototype, "onResize", null);
|
|
6527
6019
|
FileUploadComponent = FileUploadComponent_1 = __decorate([
|
|
6528
6020
|
Component({
|
|
6529
6021
|
selector: "s-file-upload",
|
|
6530
|
-
template: "<div
|
|
6531
|
-
styles: [".fileupload .fileupload-choose{position:relative;margin:15px 0;width:-webkit-max-content;width:max-content}.fileupload input[type=file]{display:none}.fileupload .file-
|
|
6022
|
+
template: "<div\n [id]=\"id\"\n class=\"s-fileupload\">\n <div class=\"s-fileupload-choose\">\n <input\n #inputUpload\n [id]=\"id+'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"onFileSelect($event.dataTransfer\n ? $event.dataTransfer.files\n : $event.target.files)\"> \n <s-button\n *ngIf=\"permissions.includes(ADD_PERMISSION)\"\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\n (onClick)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formGroup?.disabled\"\n [auxiliary]=\"false\">\n </s-button>\n </div>\n\n <section\n *ngIf=\"files.length\" \n [id]=\"id + 'fileupload-list'\"\n class=\"s-fileupload-list\"\n role=\"grid\">\n <ng-container *ngFor=\"let file of files; let i = index\">\n <div\n class=\"s-fileupload-list-file\"\n role=\"row\">\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"s-fileupload-list-file-name\"\n role=\"gridcell\">\n <ng-container *ngTemplateOutlet=\"permissions.includes(READ_PERMISSION) && file.savedFile || file.progress === 100\n ? descriptionUrl\n : description; context: {\n $implicit: file,\n index: i\n }\">\n </ng-container>\n <span *ngIf=\"modifiedDate\" class=\"s-fileupload-list-file-name-date\">{{ modifiedDate }}</span>\n </div>\n <div\n class=\"s-fileupload-list-file-status\"\n role=\"gridcell\">\n <p-progressBar\n *ngIf=\"file.isUploading && !isSmallDevice\"\n [style]=\"{ 'width': '250px', 'background-color': '#d8d8d8', 'border-radius': '0px', 'height': '14px'}\"\n [value]=\"file.progress\"\n [showValue]=\"false\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelProgress || 'platform.angular_components.loading_file' | translate\">\n </p-progressBar>\n <span\n *ngIf=\"file.isUploading && isSmallDevice\" \n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"ariaLabelProgress || 'platform.angular_components.loading_file' | translate\">\n </span>\n <span\n *ngIf=\"!file.isUploading && !file.error && file.progress === 100\"\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelSuccess || successTooltip || 'platform.angular_components.file_attached_successfully' | translate\"\n [pTooltip]=\"successTooltip || 'platform.angular_components.file_attached_successfully' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n <span\n *ngIf=\"file.error?.message\" \n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [pTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n </div>\n <div\n class=\"s-fileupload-list-file-actions\"\n role=\"gridcell\">\n <a\n *ngIf=\"file.isUploading\"\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\">\n {{ cancelLabel || 'platform.angular_components.cancel' | translate }}\n </a>\n <a\n *ngIf=\"permissions.includes(REMOVE_PERMISSION) && !file.isUploading && !(disabled || !!formGroup?.disabled)\"\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"ariaLabelRemove || removeLabel || 'platform.angular_components.remove' | translate\">\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\n </a>\n </div>\n </div>\n </ng-container>\n </section>\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i = index>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">{{file.name}}\n </a>\n <a\n style=\"display: none;\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor>\n </a>\n</ng-template>\n\n<ng-template\n #description\n let-file>\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">\n {{file.name}}\n </span>\n</ng-template>\n",
|
|
6023
|
+
styles: [".s-fileupload .s-fileupload-choose{position:relative;margin:15px 0;width:-webkit-max-content;width:max-content}.s-fileupload input[type=file]{display:none}.s-fileupload-list{border:1px solid #ccc}.s-fileupload-list-file:not(:first-child){border-top:1px solid #ccc}.s-fileupload-list .s-fileupload-list-file{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:justify;justify-content:space-between;padding:15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-item-align:center;align-self:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name .s-fileupload-list-file-name-date{font-size:.75rem;color:#999}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name>a{cursor:pointer;text-decoration:none}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center}.s-fileupload-list .s-fileupload-list-file .fas.fa-circle-notch{color:#d8d8d8;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-check{color:#0c9348;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-times{color:#c13018;font-size:12px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin-top:15px;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;width:100%}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action{text-decoration:none;color:#428bca}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :focus,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :visited,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action:hover{text-decoration:none}@media (min-width:768px){.s-fileupload-list .s-fileupload-list-file{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{width:auto;-ms-flex-positive:2;flex-grow:2}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{margin:0 15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin:0;width:auto}}"]
|
|
6532
6024
|
})
|
|
6533
6025
|
], FileUploadComponent);
|
|
6534
6026
|
|
|
@@ -6536,22 +6028,15 @@ let FileUploadModule = class FileUploadModule {
|
|
|
6536
6028
|
};
|
|
6537
6029
|
FileUploadModule = __decorate([
|
|
6538
6030
|
NgModule({
|
|
6031
|
+
declarations: [FileUploadComponent],
|
|
6539
6032
|
imports: [
|
|
6540
6033
|
CommonModule,
|
|
6541
|
-
HttpClientModule,
|
|
6542
6034
|
ButtonModule,
|
|
6543
|
-
TooltipModule,
|
|
6544
|
-
ProgressBarModule,
|
|
6035
|
+
TooltipModule$1,
|
|
6036
|
+
ProgressBarModule$1,
|
|
6545
6037
|
TranslateModule,
|
|
6546
6038
|
],
|
|
6547
|
-
|
|
6548
|
-
FileUploadComponent,
|
|
6549
|
-
FileItemComponent,
|
|
6550
|
-
],
|
|
6551
|
-
providers: [
|
|
6552
|
-
FileUploadService,
|
|
6553
|
-
LocaleService,
|
|
6554
|
-
],
|
|
6039
|
+
providers: [FileUploadService],
|
|
6555
6040
|
exports: [FileUploadComponent],
|
|
6556
6041
|
})
|
|
6557
6042
|
], FileUploadModule);
|
|
@@ -6827,59 +6312,383 @@ let LoadingStateDirective = class LoadingStateDirective {
|
|
|
6827
6312
|
this.loaderComponent.instance.indicator = this.indicator;
|
|
6828
6313
|
}
|
|
6829
6314
|
}
|
|
6830
|
-
ngAfterViewInit() {
|
|
6831
|
-
this.createComponent();
|
|
6315
|
+
ngAfterViewInit() {
|
|
6316
|
+
this.createComponent();
|
|
6317
|
+
}
|
|
6318
|
+
createComponent() {
|
|
6319
|
+
const factory = this.componentFactoryResolver.resolveComponentFactory(LoadingStateComponent);
|
|
6320
|
+
this.loaderComponent = this.target.createComponent(factory);
|
|
6321
|
+
this.loaderComponent.instance.contents = this.template;
|
|
6322
|
+
this.loaderComponent.instance.loading = this._loading;
|
|
6323
|
+
this.loaderComponent.instance.indicator = this.indicator;
|
|
6324
|
+
this.cdr.detectChanges();
|
|
6325
|
+
}
|
|
6326
|
+
ngOnDestroy() {
|
|
6327
|
+
if (this.loaderComponent) {
|
|
6328
|
+
this.loaderComponent.destroy();
|
|
6329
|
+
}
|
|
6330
|
+
}
|
|
6331
|
+
};
|
|
6332
|
+
LoadingStateDirective.ctorParameters = () => [
|
|
6333
|
+
{ type: ViewContainerRef },
|
|
6334
|
+
{ type: TemplateRef },
|
|
6335
|
+
{ type: ComponentFactoryResolver },
|
|
6336
|
+
{ type: ChangeDetectorRef }
|
|
6337
|
+
];
|
|
6338
|
+
__decorate([
|
|
6339
|
+
Input("sLoadingState")
|
|
6340
|
+
], LoadingStateDirective.prototype, "sLoadingState", null);
|
|
6341
|
+
LoadingStateDirective = __decorate([
|
|
6342
|
+
Directive({
|
|
6343
|
+
selector: "[sLoadingState]",
|
|
6344
|
+
})
|
|
6345
|
+
], LoadingStateDirective);
|
|
6346
|
+
|
|
6347
|
+
let LoadingStateModule = class LoadingStateModule {
|
|
6348
|
+
};
|
|
6349
|
+
LoadingStateModule = __decorate([
|
|
6350
|
+
NgModule({
|
|
6351
|
+
imports: [
|
|
6352
|
+
CommonModule,
|
|
6353
|
+
SVGFactoryModule,
|
|
6354
|
+
],
|
|
6355
|
+
declarations: [
|
|
6356
|
+
LoadingStateComponent,
|
|
6357
|
+
LoadingStateDirective,
|
|
6358
|
+
DotsIndicatorComponent,
|
|
6359
|
+
LoadingIndicatorComponent,
|
|
6360
|
+
],
|
|
6361
|
+
exports: [
|
|
6362
|
+
LoadingStateComponent,
|
|
6363
|
+
LoadingStateDirective,
|
|
6364
|
+
],
|
|
6365
|
+
entryComponents: [LoadingStateComponent],
|
|
6366
|
+
})
|
|
6367
|
+
], LoadingStateModule);
|
|
6368
|
+
|
|
6369
|
+
let LocalizedBignumberPipe = class LocalizedBignumberPipe {
|
|
6370
|
+
constructor(localeService) {
|
|
6371
|
+
this.localeService = localeService;
|
|
6372
|
+
}
|
|
6373
|
+
transform(value, options) {
|
|
6374
|
+
return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
|
|
6375
|
+
}
|
|
6376
|
+
applyMask(value, options) {
|
|
6377
|
+
return this.localeService.get().pipe(map(localeConfig => {
|
|
6378
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
6379
|
+
const configs = {
|
|
6380
|
+
prefix: (_c = (_a = options === null || options === void 0 ? void 0 : options.prefix) !== null && _a !== void 0 ? _a : (_b = localeConfig === null || localeConfig === void 0 ? void 0 : localeConfig.number) === null || _b === void 0 ? void 0 : _b.currencySymbol) !== null && _c !== void 0 ? _c : "R$",
|
|
6381
|
+
thousandsSeparator: (_f = (_d = options === null || options === void 0 ? void 0 : options.thousandsSeparator) !== null && _d !== void 0 ? _d : (_e = localeConfig === null || localeConfig === void 0 ? void 0 : localeConfig.number) === null || _e === void 0 ? void 0 : _e.thousandsSeparator) !== null && _f !== void 0 ? _f : ".",
|
|
6382
|
+
decimalSeparator: (_j = (_g = options === null || options === void 0 ? void 0 : options.decimalSeparator) !== null && _g !== void 0 ? _g : (_h = localeConfig === null || localeConfig === void 0 ? void 0 : localeConfig.number) === null || _h === void 0 ? void 0 : _h.decimalSeparator) !== null && _j !== void 0 ? _j : ",",
|
|
6383
|
+
scale: (_k = options === null || options === void 0 ? void 0 : options.scale) !== null && _k !== void 0 ? _k : 2,
|
|
6384
|
+
allowNegative: (_l = options === null || options === void 0 ? void 0 : options.allowNegative) !== null && _l !== void 0 ? _l : true
|
|
6385
|
+
};
|
|
6386
|
+
const isNumber = !(new BigNumber(value).isNaN());
|
|
6387
|
+
return applyMask(value, configs, isNumber);
|
|
6388
|
+
}));
|
|
6389
|
+
}
|
|
6390
|
+
};
|
|
6391
|
+
LocalizedBignumberPipe.ctorParameters = () => [
|
|
6392
|
+
{ type: LocaleService }
|
|
6393
|
+
];
|
|
6394
|
+
LocalizedBignumberPipe = __decorate([
|
|
6395
|
+
Pipe({
|
|
6396
|
+
name: "localizedBignumber",
|
|
6397
|
+
})
|
|
6398
|
+
], LocalizedBignumberPipe);
|
|
6399
|
+
|
|
6400
|
+
let LocalizedBignumberImpurePipe = class LocalizedBignumberImpurePipe extends LocalizedBignumberPipe {
|
|
6401
|
+
transform(value, options) {
|
|
6402
|
+
return super.transform(value, options);
|
|
6403
|
+
}
|
|
6404
|
+
};
|
|
6405
|
+
LocalizedBignumberImpurePipe = __decorate([
|
|
6406
|
+
Pipe({
|
|
6407
|
+
name: "localizedBignumberImpure",
|
|
6408
|
+
pure: false,
|
|
6409
|
+
})
|
|
6410
|
+
], LocalizedBignumberImpurePipe);
|
|
6411
|
+
|
|
6412
|
+
class LocalizedCurrencyPipeOptions extends NumberLocaleOptions {
|
|
6413
|
+
constructor(config = {}) {
|
|
6414
|
+
super(config);
|
|
6415
|
+
this.scale = 2;
|
|
6416
|
+
}
|
|
6417
|
+
}
|
|
6418
|
+
/**
|
|
6419
|
+
* @deprecated Should use localizedBignumberPipe instead
|
|
6420
|
+
*/
|
|
6421
|
+
let LocalizedCurrencyPipe = class LocalizedCurrencyPipe {
|
|
6422
|
+
constructor(localeService) {
|
|
6423
|
+
this.localeService = localeService;
|
|
6424
|
+
}
|
|
6425
|
+
transform(value, options) {
|
|
6426
|
+
if (!options) {
|
|
6427
|
+
options = new LocalizedCurrencyPipeOptions();
|
|
6428
|
+
}
|
|
6429
|
+
return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
|
|
6430
|
+
}
|
|
6431
|
+
applyMask(value, options) {
|
|
6432
|
+
return this.localeService.get().pipe(map(localeConfig => {
|
|
6433
|
+
const config = Object.assign(Object.assign({}, localeConfig.number), options);
|
|
6434
|
+
const { scale, currencySymbol, thousandsSeparator, decimalSeparator } = config;
|
|
6435
|
+
const rawValue = Number(value).toFixed(scale);
|
|
6436
|
+
const onlyNumbers = rawValue.replace(/[^0-9]/g, ``);
|
|
6437
|
+
const integerPart = onlyNumbers
|
|
6438
|
+
.slice(0, onlyNumbers.length - scale)
|
|
6439
|
+
.replace(/^0*/g, ``)
|
|
6440
|
+
.replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator) || `0`;
|
|
6441
|
+
const decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);
|
|
6442
|
+
const newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;
|
|
6443
|
+
const isZero = !Number(onlyNumbers);
|
|
6444
|
+
const operator = rawValue.includes("-") && !isZero ? "-" : "";
|
|
6445
|
+
return `${operator}${currencySymbol}${newValue}`;
|
|
6446
|
+
}));
|
|
6447
|
+
}
|
|
6448
|
+
};
|
|
6449
|
+
LocalizedCurrencyPipe.ctorParameters = () => [
|
|
6450
|
+
{ type: LocaleService }
|
|
6451
|
+
];
|
|
6452
|
+
LocalizedCurrencyPipe = __decorate([
|
|
6453
|
+
Pipe({
|
|
6454
|
+
name: "localizedCurrency",
|
|
6455
|
+
})
|
|
6456
|
+
], LocalizedCurrencyPipe);
|
|
6457
|
+
|
|
6458
|
+
/**
|
|
6459
|
+
* @deprecated Should use localizedBignumberPipe instead
|
|
6460
|
+
*/
|
|
6461
|
+
let LocalizedCurrencyImpurePipe = class LocalizedCurrencyImpurePipe extends LocalizedCurrencyPipe {
|
|
6462
|
+
transform(value, options = new LocalizedCurrencyPipeOptions()) {
|
|
6463
|
+
return super.transform(value, options);
|
|
6464
|
+
}
|
|
6465
|
+
};
|
|
6466
|
+
LocalizedCurrencyImpurePipe = __decorate([
|
|
6467
|
+
Pipe({
|
|
6468
|
+
name: "localizedCurrencyImpure",
|
|
6469
|
+
pure: false,
|
|
6470
|
+
})
|
|
6471
|
+
], LocalizedCurrencyImpurePipe);
|
|
6472
|
+
|
|
6473
|
+
const moment$2 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
6474
|
+
let LocalizedDatePipe = class LocalizedDatePipe {
|
|
6475
|
+
constructor(localeService) {
|
|
6476
|
+
this.localeService = localeService;
|
|
6477
|
+
}
|
|
6478
|
+
transform(value, format = "L LTS") {
|
|
6479
|
+
return this.localeService.get().pipe(map(() => (value ? moment$2(value).format(format) : value)));
|
|
6480
|
+
}
|
|
6481
|
+
};
|
|
6482
|
+
LocalizedDatePipe.ctorParameters = () => [
|
|
6483
|
+
{ type: LocaleService }
|
|
6484
|
+
];
|
|
6485
|
+
LocalizedDatePipe = __decorate([
|
|
6486
|
+
Pipe({
|
|
6487
|
+
name: "localizedDate",
|
|
6488
|
+
})
|
|
6489
|
+
], LocalizedDatePipe);
|
|
6490
|
+
|
|
6491
|
+
let LocalizedDateImpurePipe = class LocalizedDateImpurePipe extends LocalizedDatePipe {
|
|
6492
|
+
};
|
|
6493
|
+
LocalizedDateImpurePipe = __decorate([
|
|
6494
|
+
Pipe({
|
|
6495
|
+
name: "localizedDateImpure",
|
|
6496
|
+
pure: false,
|
|
6497
|
+
})
|
|
6498
|
+
], LocalizedDateImpurePipe);
|
|
6499
|
+
|
|
6500
|
+
/**
|
|
6501
|
+
* @deprecated Should use localizedBignumberPipe instead
|
|
6502
|
+
*/
|
|
6503
|
+
let LocalizedNumberPipe = class LocalizedNumberPipe {
|
|
6504
|
+
constructor(localeService) {
|
|
6505
|
+
this.localeService = localeService;
|
|
6506
|
+
}
|
|
6507
|
+
transform(value, minimumFractionDigits) {
|
|
6508
|
+
return from(this.localeService.getLocale()).pipe(map((locale) => {
|
|
6509
|
+
const numericValue = Number(value);
|
|
6510
|
+
if (!value && isNaN(numericValue))
|
|
6511
|
+
return;
|
|
6512
|
+
return new Intl.NumberFormat(locale, {
|
|
6513
|
+
minimumFractionDigits: minimumFractionDigits || 0,
|
|
6514
|
+
}).format(Number(value));
|
|
6515
|
+
}));
|
|
6516
|
+
}
|
|
6517
|
+
};
|
|
6518
|
+
LocalizedNumberPipe.ctorParameters = () => [
|
|
6519
|
+
{ type: LocaleService }
|
|
6520
|
+
];
|
|
6521
|
+
LocalizedNumberPipe = __decorate([
|
|
6522
|
+
Pipe({ name: "localizedNumber" })
|
|
6523
|
+
], LocalizedNumberPipe);
|
|
6524
|
+
|
|
6525
|
+
const moment$3 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
6526
|
+
let LocalizedTimePipe = class LocalizedTimePipe {
|
|
6527
|
+
constructor(localeService) {
|
|
6528
|
+
this.localeService = localeService;
|
|
6529
|
+
}
|
|
6530
|
+
transform(value, format = "LTS") {
|
|
6531
|
+
return this.localeService.get().pipe(map(() => (value ? moment$3(value, "HH:mm:ss").format(format) : value)));
|
|
6532
|
+
}
|
|
6533
|
+
};
|
|
6534
|
+
LocalizedTimePipe.ctorParameters = () => [
|
|
6535
|
+
{ type: LocaleService }
|
|
6536
|
+
];
|
|
6537
|
+
LocalizedTimePipe = __decorate([
|
|
6538
|
+
Pipe({
|
|
6539
|
+
name: "localizedTime",
|
|
6540
|
+
})
|
|
6541
|
+
], LocalizedTimePipe);
|
|
6542
|
+
|
|
6543
|
+
let LocalizedTimeImpurePipe = class LocalizedTimeImpurePipe extends LocalizedTimePipe {
|
|
6544
|
+
};
|
|
6545
|
+
LocalizedTimeImpurePipe = __decorate([
|
|
6546
|
+
Pipe({
|
|
6547
|
+
name: "localizedTimeImpure",
|
|
6548
|
+
pure: false,
|
|
6549
|
+
})
|
|
6550
|
+
], LocalizedTimeImpurePipe);
|
|
6551
|
+
|
|
6552
|
+
let NumericService = class NumericService {
|
|
6553
|
+
constructor(localeService) {
|
|
6554
|
+
this.localeService = localeService;
|
|
6555
|
+
}
|
|
6556
|
+
/**
|
|
6557
|
+
* Wrapper around Intl.NumberFormat that returns the localized value using the user's locale by default(platform's preferential language).
|
|
6558
|
+
*
|
|
6559
|
+
* This method should only be used after the localeService has been initialized by the host application, either by a resolver or a manual call.
|
|
6560
|
+
*
|
|
6561
|
+
* Can be overwritten by the provided Intl.NumberFormatOptions.
|
|
6562
|
+
*
|
|
6563
|
+
* Documentation is available at {@link https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat Intl.NumberFormatOptions}.
|
|
6564
|
+
*
|
|
6565
|
+
* @param {number | string | BigNumber} value The value to be formatted.
|
|
6566
|
+
* @param {Intl.NumberFormatOptions} options Options that overwrites the default Intl.NumberFormatOptions.
|
|
6567
|
+
* @return `string` The formatted value.
|
|
6568
|
+
*/
|
|
6569
|
+
instant(value, options) {
|
|
6570
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
6571
|
+
options = Object.assign(Object.assign({}, options), { locale: (_c = (_a = options === null || options === void 0 ? void 0 : options.locale) !== null && _a !== void 0 ? _a : (_b = this.localeService.getLocaleOptions()) === null || _b === void 0 ? void 0 : _b.locale) !== null && _c !== void 0 ? _c : "pt-BR", options: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.options), { currency: ((_d = options === null || options === void 0 ? void 0 : options.options) === null || _d === void 0 ? void 0 : _d.style) === "currency" ? (_f = (_e = options === null || options === void 0 ? void 0 : options.options) === null || _e === void 0 ? void 0 : _e.currency) !== null && _f !== void 0 ? _f : "BRL" : undefined, currencyDisplay: ((_g = options === null || options === void 0 ? void 0 : options.options) === null || _g === void 0 ? void 0 : _g.style) === "currency" ? (_j = (_h = options === null || options === void 0 ? void 0 : options.options) === null || _h === void 0 ? void 0 : _h.currencyDisplay) !== null && _j !== void 0 ? _j : "narrowSymbol" : undefined, minimumFractionDigits: (_l = (_k = options === null || options === void 0 ? void 0 : options.options) === null || _k === void 0 ? void 0 : _k.minimumFractionDigits) !== null && _l !== void 0 ? _l : 0 }) });
|
|
6572
|
+
// From https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
|
|
6573
|
+
return new Intl.NumberFormat(options.locale, options.options).format(this.getType(value) === "number" || this.getType(value) === "string" ? value : value.toString());
|
|
6574
|
+
}
|
|
6575
|
+
getType(value) {
|
|
6576
|
+
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
|
|
6577
|
+
if (value === null) {
|
|
6578
|
+
return "null";
|
|
6579
|
+
}
|
|
6580
|
+
const baseType = typeof value;
|
|
6581
|
+
// Primitive types
|
|
6582
|
+
if (baseType !== "object" && baseType !== "function") {
|
|
6583
|
+
return baseType;
|
|
6584
|
+
}
|
|
6585
|
+
// Symbol.toStringTag often specifies the "display name" of the
|
|
6586
|
+
// object's class. It's used in Object.prototype.toString().
|
|
6587
|
+
const tag = value[Symbol.toStringTag];
|
|
6588
|
+
if (typeof tag === "string") {
|
|
6589
|
+
return tag;
|
|
6590
|
+
}
|
|
6591
|
+
// If it's a function whose source code starts with the "class" keyword
|
|
6592
|
+
if (baseType === "function" && Function.prototype.toString.call(value).startsWith("class")) {
|
|
6593
|
+
return "class";
|
|
6594
|
+
}
|
|
6595
|
+
// The name of the constructor; for example `Array`, `GeneratorFunction`,
|
|
6596
|
+
// `Number`, `String`, `Boolean` or `MyCustomClass`
|
|
6597
|
+
const className = value.constructor.name;
|
|
6598
|
+
if (typeof className === "string" && className !== "") {
|
|
6599
|
+
return className;
|
|
6600
|
+
}
|
|
6601
|
+
// At this point there's no robust way to get the type of value,
|
|
6602
|
+
// so we use the base implementation.
|
|
6603
|
+
return baseType;
|
|
6832
6604
|
}
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6605
|
+
};
|
|
6606
|
+
NumericService.ctorParameters = () => [
|
|
6607
|
+
{ type: LocaleService }
|
|
6608
|
+
];
|
|
6609
|
+
NumericService.ɵprov = ɵɵdefineInjectable({ factory: function NumericService_Factory() { return new NumericService(ɵɵinject(LocaleService)); }, token: NumericService, providedIn: "root" });
|
|
6610
|
+
NumericService = __decorate([
|
|
6611
|
+
Injectable({
|
|
6612
|
+
providedIn: "root",
|
|
6613
|
+
})
|
|
6614
|
+
], NumericService);
|
|
6615
|
+
|
|
6616
|
+
let NumericPipe = class NumericPipe {
|
|
6617
|
+
constructor(numericService, localeService) {
|
|
6618
|
+
this.numericService = numericService;
|
|
6619
|
+
this.localeService = localeService;
|
|
6840
6620
|
}
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
this.
|
|
6844
|
-
|
|
6621
|
+
transform(value, options) {
|
|
6622
|
+
return (options === null || options === void 0 ? void 0 : options.locale) ? of(this.numericService.instant(value, options))
|
|
6623
|
+
: this.localeService.getLocale().pipe(map((locale) => this.numericService.instant(value, {
|
|
6624
|
+
locale,
|
|
6625
|
+
options: options === null || options === void 0 ? void 0 : options.options,
|
|
6626
|
+
})));
|
|
6845
6627
|
}
|
|
6846
6628
|
};
|
|
6847
|
-
|
|
6848
|
-
{ type:
|
|
6849
|
-
{ type:
|
|
6850
|
-
{ type: ComponentFactoryResolver },
|
|
6851
|
-
{ type: ChangeDetectorRef }
|
|
6629
|
+
NumericPipe.ctorParameters = () => [
|
|
6630
|
+
{ type: NumericService },
|
|
6631
|
+
{ type: LocaleService }
|
|
6852
6632
|
];
|
|
6853
|
-
__decorate([
|
|
6854
|
-
|
|
6855
|
-
],
|
|
6856
|
-
LoadingStateDirective = __decorate([
|
|
6857
|
-
Directive({
|
|
6858
|
-
selector: "[sLoadingState]",
|
|
6859
|
-
})
|
|
6860
|
-
], LoadingStateDirective);
|
|
6633
|
+
NumericPipe = __decorate([
|
|
6634
|
+
Pipe({ name: "numeric" })
|
|
6635
|
+
], NumericPipe);
|
|
6861
6636
|
|
|
6862
|
-
|
|
6637
|
+
var LocaleModule_1;
|
|
6638
|
+
let LocaleModule = LocaleModule_1 = class LocaleModule {
|
|
6639
|
+
static forRoot() {
|
|
6640
|
+
return {
|
|
6641
|
+
ngModule: LocaleModule_1,
|
|
6642
|
+
providers: [
|
|
6643
|
+
LocaleService,
|
|
6644
|
+
LocalizedCurrencyPipe,
|
|
6645
|
+
LocalizedDatePipe,
|
|
6646
|
+
LocalizedTimePipe,
|
|
6647
|
+
LocalizedNumberPipe,
|
|
6648
|
+
LocalizedCurrencyImpurePipe,
|
|
6649
|
+
LocalizedDateImpurePipe,
|
|
6650
|
+
LocalizedTimeImpurePipe,
|
|
6651
|
+
LocalizedBignumberPipe,
|
|
6652
|
+
LocalizedBignumberImpurePipe,
|
|
6653
|
+
NumericPipe
|
|
6654
|
+
],
|
|
6655
|
+
};
|
|
6656
|
+
}
|
|
6657
|
+
static forChild() {
|
|
6658
|
+
return {
|
|
6659
|
+
ngModule: LocaleModule_1,
|
|
6660
|
+
};
|
|
6661
|
+
}
|
|
6863
6662
|
};
|
|
6864
|
-
|
|
6663
|
+
LocaleModule = LocaleModule_1 = __decorate([
|
|
6865
6664
|
NgModule({
|
|
6866
|
-
imports: [
|
|
6867
|
-
|
|
6868
|
-
|
|
6665
|
+
imports: [CommonModule],
|
|
6666
|
+
exports: [
|
|
6667
|
+
LocalizedCurrencyPipe,
|
|
6668
|
+
LocalizedDatePipe,
|
|
6669
|
+
LocalizedTimePipe,
|
|
6670
|
+
LocalizedNumberPipe,
|
|
6671
|
+
LocalizedCurrencyImpurePipe,
|
|
6672
|
+
LocalizedDateImpurePipe,
|
|
6673
|
+
LocalizedTimeImpurePipe,
|
|
6674
|
+
LocalizedBignumberPipe,
|
|
6675
|
+
LocalizedBignumberImpurePipe,
|
|
6676
|
+
NumericPipe
|
|
6869
6677
|
],
|
|
6870
6678
|
declarations: [
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6679
|
+
LocalizedCurrencyPipe,
|
|
6680
|
+
LocalizedDatePipe,
|
|
6681
|
+
LocalizedTimePipe,
|
|
6682
|
+
LocalizedNumberPipe,
|
|
6683
|
+
LocalizedCurrencyImpurePipe,
|
|
6684
|
+
LocalizedDateImpurePipe,
|
|
6685
|
+
LocalizedTimeImpurePipe,
|
|
6686
|
+
LocalizedBignumberPipe,
|
|
6687
|
+
LocalizedBignumberImpurePipe,
|
|
6688
|
+
NumericPipe
|
|
6879
6689
|
],
|
|
6880
|
-
entryComponents: [LoadingStateComponent],
|
|
6881
6690
|
})
|
|
6882
|
-
],
|
|
6691
|
+
], LocaleModule);
|
|
6883
6692
|
|
|
6884
6693
|
var LocalizedNumberInputDirective_1;
|
|
6885
6694
|
let LocalizedNumberInputDirective = LocalizedNumberInputDirective_1 = class LocalizedNumberInputDirective {
|
|
@@ -7702,7 +7511,7 @@ var EnumBadgeColors;
|
|
|
7702
7511
|
EnumBadgeColors["GRAY"] = "gray";
|
|
7703
7512
|
})(EnumBadgeColors || (EnumBadgeColors = {}));
|
|
7704
7513
|
|
|
7705
|
-
const moment$
|
|
7514
|
+
const moment$4 = moment_;
|
|
7706
7515
|
let TableColumnsComponent = class TableColumnsComponent {
|
|
7707
7516
|
constructor(viewContainerRef, translate, hostProjectConfigs) {
|
|
7708
7517
|
this.viewContainerRef = viewContainerRef;
|
|
@@ -7807,7 +7616,7 @@ let TableColumnsComponent = class TableColumnsComponent {
|
|
|
7807
7616
|
return applyMask(attributeValue, numberConfigs, this.isNumber(attributeValue));
|
|
7808
7617
|
case EnumColumnFieldType.DATE:
|
|
7809
7618
|
const dateFormat = this.getDateFormat(column, locale);
|
|
7810
|
-
return moment$
|
|
7619
|
+
return moment$4(attributeValue).format(dateFormat);
|
|
7811
7620
|
case EnumColumnFieldType.BOOLEAN:
|
|
7812
7621
|
const value = attributeValue ? "yes" : "no";
|
|
7813
7622
|
return this.translate.instant(prefix + value);
|
|
@@ -9834,7 +9643,7 @@ var CustomFieldType;
|
|
|
9834
9643
|
CustomFieldType["Any"] = "Any";
|
|
9835
9644
|
CustomFieldType["Enum"] = "Enum";
|
|
9836
9645
|
})(CustomFieldType || (CustomFieldType = {}));
|
|
9837
|
-
const moment$
|
|
9646
|
+
const moment$5 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
9838
9647
|
let CustomFieldsComponent = CustomFieldsComponent_1 = class CustomFieldsComponent {
|
|
9839
9648
|
constructor(customFieldsService, localeService, sanitizer, translateService, controlContainer) {
|
|
9840
9649
|
this.customFieldsService = customFieldsService;
|
|
@@ -10022,16 +9831,16 @@ let CustomFieldsComponent = CustomFieldsComponent_1 = class CustomFieldsComponen
|
|
|
10022
9831
|
return;
|
|
10023
9832
|
switch (type) {
|
|
10024
9833
|
case FieldType.Date:
|
|
10025
|
-
parsedValues[name] = moment$
|
|
9834
|
+
parsedValues[name] = moment$5(value).toDate();
|
|
10026
9835
|
break;
|
|
10027
9836
|
case FieldType.DateTime:
|
|
10028
|
-
parsedValues[name] = moment$
|
|
9837
|
+
parsedValues[name] = moment$5(value).toDate();
|
|
10029
9838
|
break;
|
|
10030
9839
|
case FieldType.LocalDateTime:
|
|
10031
|
-
parsedValues[name] = moment$
|
|
9840
|
+
parsedValues[name] = moment$5(value, "YYYY-MM-DD[T]HH:mm:ss.SSS").toDate();
|
|
10032
9841
|
break;
|
|
10033
9842
|
case FieldType.Time:
|
|
10034
|
-
parsedValues[name] = moment$
|
|
9843
|
+
parsedValues[name] = moment$5(value, "HH:mm:ss").toDate();
|
|
10035
9844
|
break;
|
|
10036
9845
|
}
|
|
10037
9846
|
});
|
|
@@ -10062,16 +9871,16 @@ let CustomFieldsComponent = CustomFieldsComponent_1 = class CustomFieldsComponen
|
|
|
10062
9871
|
value = new BigNumber(value).toFixed(scale).toString();
|
|
10063
9872
|
break;
|
|
10064
9873
|
case FieldType.Date:
|
|
10065
|
-
value = moment$
|
|
9874
|
+
value = moment$5(value).format("YYYY-MM-DD");
|
|
10066
9875
|
break;
|
|
10067
9876
|
case FieldType.DateTime:
|
|
10068
|
-
value = moment$
|
|
9877
|
+
value = moment$5(value).format();
|
|
10069
9878
|
break;
|
|
10070
9879
|
case FieldType.LocalDateTime:
|
|
10071
|
-
value = moment$
|
|
9880
|
+
value = moment$5(value).format("YYYY-MM-DD[T]HH:mm:ss.SSS");
|
|
10072
9881
|
break;
|
|
10073
9882
|
case FieldType.Time:
|
|
10074
|
-
value = moment$
|
|
9883
|
+
value = moment$5(value).format("HH:mm:ss");
|
|
10075
9884
|
break;
|
|
10076
9885
|
}
|
|
10077
9886
|
}
|
|
@@ -10464,7 +10273,7 @@ EditableOverlayModule = __decorate([
|
|
|
10464
10273
|
})
|
|
10465
10274
|
], EditableOverlayModule);
|
|
10466
10275
|
|
|
10467
|
-
const moment$
|
|
10276
|
+
const moment$6 = moment_;
|
|
10468
10277
|
const YEAR = "year";
|
|
10469
10278
|
const MONTH = "month";
|
|
10470
10279
|
const DAY = "day";
|
|
@@ -10474,19 +10283,19 @@ const SECOND = "second";
|
|
|
10474
10283
|
const MILLISECOND = "millisecond";
|
|
10475
10284
|
class DateUtils {
|
|
10476
10285
|
static parse(date) {
|
|
10477
|
-
return moment$
|
|
10286
|
+
return moment$6(date).toDate();
|
|
10478
10287
|
}
|
|
10479
10288
|
static toString(date, with_time = false) {
|
|
10480
|
-
let result = with_time ? moment$
|
|
10289
|
+
let result = with_time ? moment$6(date, "YYYY-MM-DD hh:mm:ss.SSS") : moment$6(date, "YYYY-MM-DD");
|
|
10481
10290
|
return result.toString();
|
|
10482
10291
|
}
|
|
10483
10292
|
static format(date, formatString = "YYYY-MM-DD HH:mm:ss.SSS", lang = "en") {
|
|
10484
|
-
const monthName = moment$
|
|
10293
|
+
const monthName = moment$6(date)
|
|
10485
10294
|
.locale(lang)
|
|
10486
10295
|
.startOf("month")
|
|
10487
10296
|
.format("MMMM");
|
|
10488
10297
|
const monthNameCapitalized = monthName.charAt(0).toUpperCase() + monthName.slice(1);
|
|
10489
|
-
const dateToFormat = moment$
|
|
10298
|
+
const dateToFormat = moment$6(date).locale(lang);
|
|
10490
10299
|
const format_map = {
|
|
10491
10300
|
YYYY: dateToFormat.format("YYYY"),
|
|
10492
10301
|
MM: dateToFormat.format("MM"),
|
|
@@ -10516,13 +10325,13 @@ class DateUtils {
|
|
|
10516
10325
|
return str;
|
|
10517
10326
|
}
|
|
10518
10327
|
static diff(fistDate, secondDate, scale) {
|
|
10519
|
-
const milliseconds = moment$
|
|
10520
|
-
const seconds = moment$
|
|
10521
|
-
const minutes = moment$
|
|
10522
|
-
const hours = moment$
|
|
10523
|
-
const days = moment$
|
|
10524
|
-
const months = moment$
|
|
10525
|
-
const years = moment$
|
|
10328
|
+
const milliseconds = moment$6(fistDate).diff(secondDate, MILLISECOND);
|
|
10329
|
+
const seconds = moment$6(fistDate).diff(secondDate, SECOND);
|
|
10330
|
+
const minutes = moment$6(fistDate).diff(secondDate, MINUTE);
|
|
10331
|
+
const hours = moment$6(fistDate).diff(secondDate, HOUR);
|
|
10332
|
+
const days = moment$6(fistDate).diff(secondDate, DAY);
|
|
10333
|
+
const months = moment$6(fistDate).diff(secondDate, MONTH);
|
|
10334
|
+
const years = moment$6(fistDate).diff(secondDate, YEAR);
|
|
10526
10335
|
if (!scale.endsWith("s")) {
|
|
10527
10336
|
scale += "s";
|
|
10528
10337
|
}
|
|
@@ -10537,14 +10346,14 @@ class DateUtils {
|
|
|
10537
10346
|
}[scale]);
|
|
10538
10347
|
}
|
|
10539
10348
|
static today() {
|
|
10540
|
-
const dateStr = moment$
|
|
10349
|
+
const dateStr = moment$6().format("YYY-MM-DD");
|
|
10541
10350
|
return new Date(dateStr);
|
|
10542
10351
|
}
|
|
10543
10352
|
static now() {
|
|
10544
|
-
return moment$
|
|
10353
|
+
return moment$6().toDate();
|
|
10545
10354
|
}
|
|
10546
10355
|
static add(date, quantity, scale) {
|
|
10547
|
-
return moment$
|
|
10356
|
+
return moment$6(date).add(quantity, scale).toDate();
|
|
10548
10357
|
}
|
|
10549
10358
|
static startOf(date, scale) {
|
|
10550
10359
|
const scores = {
|
|
@@ -10572,7 +10381,7 @@ class DateUtils {
|
|
|
10572
10381
|
return new Date(vals[0], vals[1], vals[2], vals[3], vals[4], vals[5], vals[6]);
|
|
10573
10382
|
}
|
|
10574
10383
|
static clone(date) {
|
|
10575
|
-
return moment$
|
|
10384
|
+
return moment$6(date).toDate();
|
|
10576
10385
|
}
|
|
10577
10386
|
static getDateValues(date) {
|
|
10578
10387
|
return [
|
|
@@ -10586,7 +10395,7 @@ class DateUtils {
|
|
|
10586
10395
|
];
|
|
10587
10396
|
}
|
|
10588
10397
|
static getDaysInMonth(date) {
|
|
10589
|
-
return moment$
|
|
10398
|
+
return moment$6(date, "YYYY-MM").daysInMonth();
|
|
10590
10399
|
}
|
|
10591
10400
|
}
|
|
10592
10401
|
|
|
@@ -14127,6 +13936,164 @@ ProfilePicturePickerModule = __decorate([
|
|
|
14127
13936
|
})
|
|
14128
13937
|
], ProfilePicturePickerModule);
|
|
14129
13938
|
|
|
13939
|
+
var ProgressBarColors;
|
|
13940
|
+
(function (ProgressBarColors) {
|
|
13941
|
+
ProgressBarColors["Blue"] = "blue";
|
|
13942
|
+
ProgressBarColors["Green"] = "green";
|
|
13943
|
+
ProgressBarColors["Red"] = "red";
|
|
13944
|
+
ProgressBarColors["Yellow"] = "yellow";
|
|
13945
|
+
})(ProgressBarColors || (ProgressBarColors = {}));
|
|
13946
|
+
|
|
13947
|
+
var ProgressBarMode;
|
|
13948
|
+
(function (ProgressBarMode) {
|
|
13949
|
+
ProgressBarMode["Determinate"] = "determinate";
|
|
13950
|
+
ProgressBarMode["Indeterminate"] = "indeterminate";
|
|
13951
|
+
})(ProgressBarMode || (ProgressBarMode = {}));
|
|
13952
|
+
|
|
13953
|
+
let ProgressBarComponent = class ProgressBarComponent {
|
|
13954
|
+
constructor() {
|
|
13955
|
+
this.numberFormatOptions = {
|
|
13956
|
+
style: "decimal",
|
|
13957
|
+
minimumFractionDigits: 0,
|
|
13958
|
+
maximumFractionDigits: 2,
|
|
13959
|
+
};
|
|
13960
|
+
this.showValue = true;
|
|
13961
|
+
this.mode = ProgressBarMode.Determinate;
|
|
13962
|
+
}
|
|
13963
|
+
ngOnInit() {
|
|
13964
|
+
this.validateInputs();
|
|
13965
|
+
}
|
|
13966
|
+
validateInputs() {
|
|
13967
|
+
if (this.value < 0 || this.value > 100) {
|
|
13968
|
+
throw new Error("Invalid value for value");
|
|
13969
|
+
}
|
|
13970
|
+
if (this.targetValue < 0 || this.targetValue > 100) {
|
|
13971
|
+
throw new Error("Invalid value for targetValue");
|
|
13972
|
+
}
|
|
13973
|
+
if (this.mode === ProgressBarMode.Indeterminate && (this.value || this.targetValue || this.targetLabel)) {
|
|
13974
|
+
throw new Error("When the mode is indeterminate, the value, targetValue and targetLabel parameters are not expected.");
|
|
13975
|
+
}
|
|
13976
|
+
}
|
|
13977
|
+
};
|
|
13978
|
+
__decorate([
|
|
13979
|
+
Input()
|
|
13980
|
+
], ProgressBarComponent.prototype, "value", void 0);
|
|
13981
|
+
__decorate([
|
|
13982
|
+
Input()
|
|
13983
|
+
], ProgressBarComponent.prototype, "numberFormatOptions", void 0);
|
|
13984
|
+
__decorate([
|
|
13985
|
+
Input()
|
|
13986
|
+
], ProgressBarComponent.prototype, "targetValue", void 0);
|
|
13987
|
+
__decorate([
|
|
13988
|
+
Input()
|
|
13989
|
+
], ProgressBarComponent.prototype, "label", void 0);
|
|
13990
|
+
__decorate([
|
|
13991
|
+
Input()
|
|
13992
|
+
], ProgressBarComponent.prototype, "targetLabel", void 0);
|
|
13993
|
+
__decorate([
|
|
13994
|
+
Input()
|
|
13995
|
+
], ProgressBarComponent.prototype, "activeColor", void 0);
|
|
13996
|
+
__decorate([
|
|
13997
|
+
Input()
|
|
13998
|
+
], ProgressBarComponent.prototype, "showValue", void 0);
|
|
13999
|
+
__decorate([
|
|
14000
|
+
Input()
|
|
14001
|
+
], ProgressBarComponent.prototype, "mode", void 0);
|
|
14002
|
+
ProgressBarComponent = __decorate([
|
|
14003
|
+
Component({
|
|
14004
|
+
selector: "s-progressbar",
|
|
14005
|
+
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>",
|
|
14006
|
+
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}"]
|
|
14007
|
+
})
|
|
14008
|
+
], ProgressBarComponent);
|
|
14009
|
+
|
|
14010
|
+
let ProgressBarDeterminateComponent = class ProgressBarDeterminateComponent {
|
|
14011
|
+
constructor(localeService) {
|
|
14012
|
+
this.localeService = localeService;
|
|
14013
|
+
this.showValue = true;
|
|
14014
|
+
}
|
|
14015
|
+
ngOnInit() {
|
|
14016
|
+
this.validateValues();
|
|
14017
|
+
this.onGetLocale();
|
|
14018
|
+
}
|
|
14019
|
+
onGetLocale() {
|
|
14020
|
+
this.localeService.getLocale().subscribe({
|
|
14021
|
+
next: (locale) => {
|
|
14022
|
+
this.numberFormat = new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : "pt-BR", this.numberFormatOptions);
|
|
14023
|
+
},
|
|
14024
|
+
error: () => {
|
|
14025
|
+
this.numberFormat = new Intl.NumberFormat("pt-BR", this.numberFormatOptions);
|
|
14026
|
+
},
|
|
14027
|
+
});
|
|
14028
|
+
}
|
|
14029
|
+
validateValues() {
|
|
14030
|
+
if (this.value < 0 || this.value > 100) {
|
|
14031
|
+
throw new Error("Invalid value for value");
|
|
14032
|
+
}
|
|
14033
|
+
if (this.targetValue < 0 || this.targetValue > 100) {
|
|
14034
|
+
throw new Error("Invalid value for targetValue");
|
|
14035
|
+
}
|
|
14036
|
+
}
|
|
14037
|
+
};
|
|
14038
|
+
ProgressBarDeterminateComponent.ctorParameters = () => [
|
|
14039
|
+
{ type: LocaleService }
|
|
14040
|
+
];
|
|
14041
|
+
__decorate([
|
|
14042
|
+
Input()
|
|
14043
|
+
], ProgressBarDeterminateComponent.prototype, "value", void 0);
|
|
14044
|
+
__decorate([
|
|
14045
|
+
Input()
|
|
14046
|
+
], ProgressBarDeterminateComponent.prototype, "numberFormatOptions", void 0);
|
|
14047
|
+
__decorate([
|
|
14048
|
+
Input()
|
|
14049
|
+
], ProgressBarDeterminateComponent.prototype, "targetValue", void 0);
|
|
14050
|
+
__decorate([
|
|
14051
|
+
Input()
|
|
14052
|
+
], ProgressBarDeterminateComponent.prototype, "targetLabel", void 0);
|
|
14053
|
+
__decorate([
|
|
14054
|
+
Input()
|
|
14055
|
+
], ProgressBarDeterminateComponent.prototype, "activeColor", void 0);
|
|
14056
|
+
__decorate([
|
|
14057
|
+
Input()
|
|
14058
|
+
], ProgressBarDeterminateComponent.prototype, "showValue", void 0);
|
|
14059
|
+
ProgressBarDeterminateComponent = __decorate([
|
|
14060
|
+
Component({
|
|
14061
|
+
selector: "s-progressbar-determinate",
|
|
14062
|
+
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",
|
|
14063
|
+
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}"]
|
|
14064
|
+
})
|
|
14065
|
+
], ProgressBarDeterminateComponent);
|
|
14066
|
+
|
|
14067
|
+
let ProgressBarIndeterminateComponent = class ProgressBarIndeterminateComponent {
|
|
14068
|
+
};
|
|
14069
|
+
__decorate([
|
|
14070
|
+
Input()
|
|
14071
|
+
], ProgressBarIndeterminateComponent.prototype, "activeColor", void 0);
|
|
14072
|
+
__decorate([
|
|
14073
|
+
Input()
|
|
14074
|
+
], ProgressBarIndeterminateComponent.prototype, "label", void 0);
|
|
14075
|
+
ProgressBarIndeterminateComponent = __decorate([
|
|
14076
|
+
Component({
|
|
14077
|
+
selector: "s-progressbar-indeterminate",
|
|
14078
|
+
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",
|
|
14079
|
+
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%)}}"]
|
|
14080
|
+
})
|
|
14081
|
+
], ProgressBarIndeterminateComponent);
|
|
14082
|
+
|
|
14083
|
+
let ProgressBarModule = class ProgressBarModule {
|
|
14084
|
+
};
|
|
14085
|
+
ProgressBarModule = __decorate([
|
|
14086
|
+
NgModule({
|
|
14087
|
+
imports: [CommonModule],
|
|
14088
|
+
declarations: [
|
|
14089
|
+
ProgressBarComponent,
|
|
14090
|
+
ProgressBarDeterminateComponent,
|
|
14091
|
+
ProgressBarIndeterminateComponent,
|
|
14092
|
+
],
|
|
14093
|
+
exports: [ProgressBarComponent],
|
|
14094
|
+
})
|
|
14095
|
+
], ProgressBarModule);
|
|
14096
|
+
|
|
14130
14097
|
let PanelComponent = class PanelComponent {
|
|
14131
14098
|
constructor() {
|
|
14132
14099
|
this.toggleable = true;
|
|
@@ -16537,5 +16504,5 @@ const fallback = {
|
|
|
16537
16504
|
* Generated bundle index. Do not edit.
|
|
16538
16505
|
*/
|
|
16539
16506
|
|
|
16540
|
-
export { AccordionComponent, AccordionModule, AccordionPanelComponent, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, CardComponent, CardModule, CardTemplateTypes, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileValidation, FormField, GanttComponent, GanttModule, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, IAInsightComponent, IAInsightModule, IAInsightTemplateTypes, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, KanbanComponent, KanbanModule, KanbanTemplateTypes, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RatingScaleComponent, RatingScaleModule, RationButtonOption, RowTogllerDirective, SVGFactoryDirective, SVGFactoryModule, Section, SelectButtonComponent, SelectButtonModule, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, SwitchComponent, SwitchModule, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TieredMenuDirective, TieredMenuModule, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, ViewMode, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb,
|
|
16507
|
+
export { AccordionComponent, AccordionModule, AccordionPanelComponent, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, CardComponent, CardModule, CardTemplateTypes, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileValidation, FormField, GanttComponent, GanttModule, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, IAInsightComponent, IAInsightModule, IAInsightTemplateTypes, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, KanbanComponent, KanbanModule, KanbanTemplateTypes, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RatingScaleComponent, RatingScaleModule, RationButtonOption, RowTogllerDirective, SVGFactoryDirective, SVGFactoryModule, Section, SelectButtonComponent, SelectButtonModule, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, SwitchComponent, SwitchModule, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TieredMenuDirective, TieredMenuModule, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, ViewMode, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, LocalizedNumberInputModule as ɵba, NumberInputModule as ɵbb, NumberFieldComponent as ɵbc, CurrencyFieldModule as ɵbd, CurrencyFieldComponent as ɵbe, NumberFieldModule$1 as ɵbf, BignumberInputModule as ɵbg, BignumberFieldComponent as ɵbh, AutocompleteFieldComponent as ɵbi, BooleanFieldComponent as ɵbj, BooleanSwitchFieldComponent as ɵbk, CalendarFieldComponent as ɵbl, ChipsFieldComponent as ɵbm, CountryPhonePickerFieldComponent as ɵbn, DynamicFieldComponent as ɵbo, DynamicFormDirective as ɵbp, FieldsetComponent as ɵbq, FileUploadComponent$1 as ɵbr, LookupFieldComponent as ɵbs, PasswordFieldComponent as ɵbt, RadioButtonComponent as ɵbu, RowComponent as ɵbv, SectionComponent as ɵbw, SelectFieldComponent as ɵbx, SliderFieldComponent as ɵby, TextAreaFieldComponent as ɵbz, TemplateDirective as ɵc, TextAreaIAFieldComponent as ɵca, IAssistService as ɵcb, DecimalField as ɵcd, SideTableComponent as ɵce, ThumbnailService as ɵcf, InfiniteScrollModule as ɵcg, InfiniteScrollDirective as ɵch, IAInsightSidebarComponent as ɵci, IAInsightCardComponent as ɵcj, IAInsightCardLoaderComponent as ɵck, StructureModule as ɵcl, HeaderComponent as ɵcm, FooterComponent as ɵcn, KanbanEventService as ɵco, KanbanItemComponent as ɵcp, KanbanColumnComponent as ɵcq, KanbanItemDraggingComponent as ɵcr, NumberLocaleOptions as ɵcs, BorderButtonModule as ɵct, BorderButtonComponent as ɵcu, ProgressBarDeterminateComponent as ɵcv, ProgressBarIndeterminateComponent as ɵcw, SelectButtonItemComponent as ɵcx, SlidePanelService as ɵcy, TieredMenuEventService as ɵcz, TemplateModule as ɵd, TieredMenuService as ɵda, TieredMenuComponent as ɵdb, TieredMenuNestedComponent as ɵdc, TieredMenuItemComponent as ɵdd, TieredMenuDividerComponent as ɵde, TimelineItemModule as ɵdf, TimelineIconItemComponent as ɵdg, HorizontalTimelineModule as ɵdh, HorizontalTimelineComponent as ɵdi, VerticalTimelineModule as ɵdj, VerticalTimelineComponent as ɵdk, RangeLineComponent as ɵdl, CollapseOptionComponent as ɵdm, CollapsedItemsComponent as ɵdn, VerticalItemsComponent as ɵdo, CustomTranslationsModule as ɵe, CodeEditorComponent as ɵf, CoreFacade as ɵg, CodeMirror6Core as ɵh, CountryPhonePickerService as ɵi, LocalizedCurrencyImpurePipe as ɵj, LocalizedBignumberPipe as ɵk, LocalizedBignumberImpurePipe as ɵl, NumericPipe as ɵm, NumericService as ɵn, EmptyStateGoBackComponent as ɵo, IAssistIconComponent as ɵp, SeniorIconComponent as ɵq, DotsIndicatorComponent as ɵr, LoadingIndicatorComponent as ɵs, FileUploadService as ɵt, InfoSignComponent as ɵu, TableColumnsComponent as ɵv, TablePagingComponent as ɵw, TextFieldModule as ɵx, TextFieldComponent as ɵy, NumberFieldModule as ɵz };
|
|
16541
16508
|
//# sourceMappingURL=seniorsistemas-angular-components.js.map
|