@senior-gestao-empresarial/angular-components 7.19.0 → 7.20.0
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/senior-gestao-empresarial-angular-components.umd.js +843 -220
- package/bundles/senior-gestao-empresarial-angular-components.umd.js.map +1 -1
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js +2 -2
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js.map +1 -1
- package/components/object-card/elements/field/object-card-field.component.d.ts +18 -0
- package/components/object-card/elements/main/object-card-main.component.d.ts +37 -0
- package/components/object-card/index.d.ts +4 -0
- package/components/object-card/object-card.component.d.ts +29 -0
- package/components/object-card/object-card.module.d.ts +2 -0
- package/components/shared/border-button/border-button.component.d.ts +7 -0
- package/components/shared/border-button/border-button.module.d.ts +2 -0
- package/components/shared/models/border-button-options.d.ts +9 -0
- package/components/shared/models/enum-severity.d.ts +7 -0
- package/components/thumbnail/index.d.ts +3 -0
- package/components/thumbnail/thumbnail-size.d.ts +5 -0
- package/components/thumbnail/thumbnail.component.d.ts +28 -0
- package/components/thumbnail/thumbnail.module.d.ts +2 -0
- package/components/thumbnail/thumbnail.service.d.ts +21 -0
- package/esm2015/components/object-card/elements/field/object-card-field.component.js +58 -0
- package/esm2015/components/object-card/elements/main/object-card-main.component.js +142 -0
- package/esm2015/components/object-card/index.js +5 -0
- package/esm2015/components/object-card/object-card.component.js +142 -0
- package/esm2015/components/object-card/object-card.module.js +22 -0
- package/esm2015/components/shared/border-button/border-button.component.js +24 -0
- package/esm2015/components/shared/border-button/border-button.module.js +16 -0
- package/esm2015/components/shared/models/border-button-options.js +1 -0
- package/esm2015/components/shared/models/enum-severity.js +9 -0
- package/esm2015/components/thumbnail/index.js +4 -0
- package/esm2015/components/thumbnail/thumbnail-size.js +7 -0
- package/esm2015/components/thumbnail/thumbnail.component.js +96 -0
- package/esm2015/components/thumbnail/thumbnail.module.js +17 -0
- package/esm2015/components/thumbnail/thumbnail.service.js +90 -0
- package/esm2015/public-api.js +3 -1
- package/esm2015/senior-gestao-empresarial-angular-components.js +8 -5
- package/esm5/components/object-card/elements/field/object-card-field.component.js +60 -0
- package/esm5/components/object-card/elements/main/object-card-main.component.js +167 -0
- package/esm5/components/object-card/index.js +5 -0
- package/esm5/components/object-card/object-card.component.js +144 -0
- package/esm5/components/object-card/object-card.module.js +25 -0
- package/esm5/components/shared/border-button/border-button.component.js +25 -0
- package/esm5/components/shared/border-button/border-button.module.js +19 -0
- package/esm5/components/shared/models/border-button-options.js +1 -0
- package/esm5/components/shared/models/enum-severity.js +9 -0
- package/esm5/components/thumbnail/index.js +4 -0
- package/esm5/components/thumbnail/thumbnail-size.js +7 -0
- package/esm5/components/thumbnail/thumbnail.component.js +99 -0
- package/esm5/components/thumbnail/thumbnail.module.js +20 -0
- package/esm5/components/thumbnail/thumbnail.service.js +95 -0
- package/esm5/public-api.js +3 -1
- package/esm5/senior-gestao-empresarial-angular-components.js +8 -5
- package/fesm2015/senior-gestao-empresarial-angular-components.js +737 -167
- package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-angular-components.js +835 -218
- package/fesm5/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
- package/senior-gestao-empresarial-angular-components.d.ts +7 -4
- package/senior-gestao-empresarial-angular-components.metadata.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('primeng/breadcrumb'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('moment'), require('@seniorsistemas/angular-components'), require('@angular/common/http'), require('primeng/api'), require('@ngx-translate/core'), require('@seniorsistemas/platform-components'), require('@
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@senior-gestao-empresarial/angular-components', ['exports', '@angular/core', '@angular/common', 'primeng/breadcrumb', '@angular/router', 'rxjs', 'rxjs/operators', 'moment', '@seniorsistemas/angular-components', '@angular/common/http', 'primeng/api', '@ngx-translate/core', '@seniorsistemas/platform-components', '@
|
|
4
|
-
(global = global || self, factory((global['senior-gestao-empresarial'] = global['senior-gestao-empresarial'] || {}, global['senior-gestao-empresarial']['angular-components'] = {}), global.ng.core, global.ng.common, global.breadcrumb, global.ng.router, global.rxjs, global.rxjs.operators, global.
|
|
5
|
-
}(this, (function (exports, core, common, breadcrumb, router, rxjs, operators,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('primeng/breadcrumb'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('moment'), require('@seniorsistemas/angular-components'), require('@angular/common/http'), require('primeng/api'), require('@ngx-translate/core'), require('@seniorsistemas/platform-components'), require('primeng/tooltip'), require('primeng/dialog'), require('@angular/animations'), require('@angular/forms'), require('@seniorsistemas/senior-platform-data'), require('@stomp/stompjs'), require('sockjs-client'), require('js-cookie')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@senior-gestao-empresarial/angular-components', ['exports', '@angular/core', '@angular/common', 'primeng/breadcrumb', '@angular/router', 'rxjs', 'rxjs/operators', 'moment', '@seniorsistemas/angular-components', '@angular/common/http', 'primeng/api', '@ngx-translate/core', '@seniorsistemas/platform-components', 'primeng/tooltip', 'primeng/dialog', '@angular/animations', '@angular/forms', '@seniorsistemas/senior-platform-data', '@stomp/stompjs', 'sockjs-client', 'js-cookie'], factory) :
|
|
4
|
+
(global = global || self, factory((global['senior-gestao-empresarial'] = global['senior-gestao-empresarial'] || {}, global['senior-gestao-empresarial']['angular-components'] = {}), global.ng.core, global.ng.common, global.breadcrumb, global.ng.router, global.rxjs, global.rxjs.operators, global.moment$2, global.angularComponents, global.ng.common.http, global.api, global.core$1, global.platformComponents, global.tooltip, global.dialog, global.ng.animations, global.ng.forms, global.seniorPlatformData, global.stompjs, global.SockJS, global.jsCookie));
|
|
5
|
+
}(this, (function (exports, core, common, breadcrumb, router, rxjs, operators, moment$2, angularComponents, http, api, core$1, platformComponents, tooltip, dialog, animations, forms, seniorPlatformData, stompjs, SockJS, jsCookie) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
return ErpLookupsService;
|
|
401
401
|
}());
|
|
402
402
|
|
|
403
|
-
var moment =
|
|
403
|
+
var moment = moment$2;
|
|
404
404
|
/** Filter System Query Option - Operators supported in the expression language */
|
|
405
405
|
|
|
406
406
|
(function (EnumLogicalOperator) {
|
|
@@ -7712,226 +7712,220 @@
|
|
|
7712
7712
|
return ErpLookupsModule;
|
|
7713
7713
|
}());
|
|
7714
7714
|
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7715
|
+
|
|
7716
|
+
(function (ThumbnailSize) {
|
|
7717
|
+
ThumbnailSize["Small"] = "small";
|
|
7718
|
+
ThumbnailSize["Medium"] = "medium";
|
|
7719
|
+
ThumbnailSize["Large"] = "large";
|
|
7720
|
+
})(exports.ThumbnailSize || (exports.ThumbnailSize = {}));
|
|
7721
|
+
|
|
7722
|
+
var ThumbnailService = /** @class */ (function () {
|
|
7723
|
+
function ThumbnailService() {
|
|
7718
7724
|
}
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7725
|
+
ThumbnailService_1 = ThumbnailService;
|
|
7726
|
+
ThumbnailService.prototype.getBinaryFile = function (img) {
|
|
7727
|
+
var _this = this;
|
|
7728
|
+
return new Promise(function (resolve) {
|
|
7729
|
+
var getOrientation = _this.getOrientation.bind(_this);
|
|
7730
|
+
var http = new XMLHttpRequest();
|
|
7731
|
+
http.addEventListener("load", function () {
|
|
7732
|
+
if (http.readyState === 4 && (http.status === ThumbnailService_1.HTTP_STATUS_OK || http.status === 0)) {
|
|
7733
|
+
var orientation_1 = getOrientation(http.response);
|
|
7734
|
+
http = null;
|
|
7735
|
+
resolve(orientation_1);
|
|
7730
7736
|
}
|
|
7731
7737
|
});
|
|
7738
|
+
http.addEventListener("error", function () {
|
|
7739
|
+
http = null;
|
|
7740
|
+
throw new Error("Não foi possível carregar a imagem");
|
|
7741
|
+
});
|
|
7742
|
+
http.open("GET", img.src, true);
|
|
7743
|
+
http.responseType = "arraybuffer";
|
|
7744
|
+
http.send(null);
|
|
7732
7745
|
});
|
|
7733
7746
|
};
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7747
|
+
/**
|
|
7748
|
+
* Retorna a tag da orientação EXIF {-1} Não definido, {-2} Não é formato JPEG, {1, 2, 3, 4, 5, 6, 7, 8} valores da orientação.
|
|
7749
|
+
*/
|
|
7750
|
+
ThumbnailService.prototype.getOrientation = function (file) {
|
|
7751
|
+
var view = new DataView(file);
|
|
7752
|
+
if (view.getUint16(0, false) !== ThumbnailService_1.JPEG_MARKER) {
|
|
7753
|
+
return ThumbnailService_1.NOT_JPEG;
|
|
7754
|
+
}
|
|
7755
|
+
var length = view.byteLength;
|
|
7756
|
+
var offset = ThumbnailService_1.INITIAL_OFFSET;
|
|
7757
|
+
while (offset < length) {
|
|
7758
|
+
var marker = view.getUint16(offset, false);
|
|
7759
|
+
offset += ThumbnailService_1.INITIAL_OFFSET;
|
|
7760
|
+
if (marker === ThumbnailService_1.EXIF_MARKER) {
|
|
7761
|
+
var orientation_2 = this.extractOrientationFromExif(view, offset);
|
|
7762
|
+
if (orientation_2 !== null) {
|
|
7763
|
+
return orientation_2;
|
|
7744
7764
|
}
|
|
7745
|
-
|
|
7746
|
-
|
|
7765
|
+
return ThumbnailService_1.NOT_DEFINED;
|
|
7766
|
+
}
|
|
7767
|
+
// tslint:disable-next-line: no-bitwise
|
|
7768
|
+
if ((marker & ThumbnailService_1.MARKER_MASK) !== ThumbnailService_1.MARKER_MASK) {
|
|
7769
|
+
break;
|
|
7770
|
+
}
|
|
7771
|
+
offset += view.getUint16(offset, false);
|
|
7772
|
+
}
|
|
7773
|
+
return ThumbnailService_1.NOT_DEFINED;
|
|
7747
7774
|
};
|
|
7748
|
-
|
|
7775
|
+
ThumbnailService.prototype.extractOrientationFromExif = function (view, initialOffset) {
|
|
7776
|
+
var offset = initialOffset;
|
|
7777
|
+
offset += ThumbnailService_1.INITIAL_OFFSET;
|
|
7778
|
+
if (view.getUint32(offset, false) !== ThumbnailService_1.EXIF_SIGNATURE) {
|
|
7779
|
+
return null;
|
|
7780
|
+
}
|
|
7781
|
+
offset += ThumbnailService_1.EXIF_OFFSET;
|
|
7782
|
+
var little = view.getUint16(offset, false) === ThumbnailService_1.LITTLE_ENDIAN_MARKER;
|
|
7783
|
+
offset += view.getUint32(offset + 4, little);
|
|
7784
|
+
var tags = view.getUint16(offset, little);
|
|
7785
|
+
offset += ThumbnailService_1.INITIAL_OFFSET;
|
|
7786
|
+
for (var i = 0; i < tags; i++) {
|
|
7787
|
+
var tagOffset = offset + i * ThumbnailService_1.TAG_SIZE;
|
|
7788
|
+
if (view.getUint16(tagOffset, little) === ThumbnailService_1.ORIENTATION_TAG) {
|
|
7789
|
+
return view.getUint16(tagOffset + ThumbnailService_1.TAG_VALUE_OFFSET, little);
|
|
7790
|
+
}
|
|
7791
|
+
}
|
|
7792
|
+
return null;
|
|
7793
|
+
};
|
|
7794
|
+
var ThumbnailService_1;
|
|
7795
|
+
ThumbnailService.HTTP_STATUS_OK = 200;
|
|
7796
|
+
ThumbnailService.JPEG_MARKER = 0xffd8;
|
|
7797
|
+
ThumbnailService.EXIF_MARKER = 0xffe1;
|
|
7798
|
+
ThumbnailService.EXIF_SIGNATURE = 0x45786966;
|
|
7799
|
+
ThumbnailService.LITTLE_ENDIAN_MARKER = 0x4949;
|
|
7800
|
+
ThumbnailService.ORIENTATION_TAG = 0x0112;
|
|
7801
|
+
ThumbnailService.MARKER_MASK = 0xff00;
|
|
7802
|
+
ThumbnailService.NOT_DEFINED = -1;
|
|
7803
|
+
ThumbnailService.NOT_JPEG = -2;
|
|
7804
|
+
ThumbnailService.INITIAL_OFFSET = 2;
|
|
7805
|
+
ThumbnailService.EXIF_OFFSET = 6;
|
|
7806
|
+
ThumbnailService.TAG_SIZE = 12;
|
|
7807
|
+
ThumbnailService.TAG_VALUE_OFFSET = 8;
|
|
7808
|
+
ThumbnailService = ThumbnailService_1 = __decorate([
|
|
7809
|
+
core.Injectable()
|
|
7810
|
+
], ThumbnailService);
|
|
7811
|
+
return ThumbnailService;
|
|
7749
7812
|
}());
|
|
7750
7813
|
|
|
7751
|
-
var
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7814
|
+
var ThumbnailComponent = /** @class */ (function () {
|
|
7815
|
+
function ThumbnailComponent(thumbnailService) {
|
|
7816
|
+
this.thumbnailService = thumbnailService;
|
|
7817
|
+
this.fallback = false;
|
|
7818
|
+
this.id = "s-thumbnail-" + ThumbnailComponent_1.getNextId();
|
|
7819
|
+
this.size = exports.ThumbnailSize.Medium;
|
|
7820
|
+
this.iconClass = "far fa-image";
|
|
7821
|
+
this.hasAction = false;
|
|
7822
|
+
this.actionIconClass = "fas fa-camera";
|
|
7823
|
+
this.isTile = false;
|
|
7824
|
+
this.isBrand = false;
|
|
7825
|
+
this.ngUnsubscribe = new rxjs.Subject();
|
|
7758
7826
|
}
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
switch (_a.label) {
|
|
7764
|
-
case 0: return [4 /*yield*/, _super.prototype.get.call(this, this.FILTERS_KEY)];
|
|
7765
|
-
case 1:
|
|
7766
|
-
store = (_a.sent()) || {};
|
|
7767
|
-
this.removeEmptyValues(filters);
|
|
7768
|
-
store[key] = filters;
|
|
7769
|
-
return [4 /*yield*/, _super.prototype.store.call(this, this.FILTERS_KEY, store)];
|
|
7770
|
-
case 2:
|
|
7771
|
-
_a.sent();
|
|
7772
|
-
return [2 /*return*/];
|
|
7773
|
-
}
|
|
7774
|
-
});
|
|
7775
|
-
});
|
|
7776
|
-
};
|
|
7777
|
-
FiltersStorageService.prototype.getFilters = function (key) {
|
|
7778
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
7779
|
-
var store;
|
|
7780
|
-
return __generator(this, function (_a) {
|
|
7781
|
-
switch (_a.label) {
|
|
7782
|
-
case 0: return [4 /*yield*/, _super.prototype.get.call(this, this.FILTERS_KEY)];
|
|
7783
|
-
case 1:
|
|
7784
|
-
store = (_a.sent()) || {};
|
|
7785
|
-
return [2 /*return*/, store[key] || {}];
|
|
7786
|
-
}
|
|
7787
|
-
});
|
|
7788
|
-
});
|
|
7827
|
+
ThumbnailComponent_1 = ThumbnailComponent;
|
|
7828
|
+
ThumbnailComponent.prototype.ngOnDestroy = function () {
|
|
7829
|
+
this.ngUnsubscribe.next();
|
|
7830
|
+
this.ngUnsubscribe.complete();
|
|
7789
7831
|
};
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
store = (_a.sent()) || {};
|
|
7798
|
-
delete store[key];
|
|
7799
|
-
return [4 /*yield*/, _super.prototype.store.call(this, this.FILTERS_KEY, store)];
|
|
7800
|
-
case 2:
|
|
7801
|
-
_a.sent();
|
|
7802
|
-
return [2 /*return*/];
|
|
7803
|
-
}
|
|
7832
|
+
ThumbnailComponent.prototype.ngAfterViewInit = function () {
|
|
7833
|
+
var _this = this;
|
|
7834
|
+
if (this.imgEl) {
|
|
7835
|
+
this.imgEl.nativeElement.addEventListener("load", function () {
|
|
7836
|
+
rxjs.from(_this.thumbnailService.getBinaryFile(_this.imgEl.nativeElement))
|
|
7837
|
+
.pipe(operators.takeUntil(_this.ngUnsubscribe))
|
|
7838
|
+
.subscribe(function (orientation) { return (_this.orientation = orientation); });
|
|
7804
7839
|
});
|
|
7805
|
-
}
|
|
7840
|
+
}
|
|
7806
7841
|
};
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
case 0: return [4 /*yield*/, this.storeFilters(key, filters)];
|
|
7812
|
-
case 1:
|
|
7813
|
-
_a.sent();
|
|
7814
|
-
return [2 /*return*/];
|
|
7815
|
-
}
|
|
7816
|
-
});
|
|
7817
|
-
});
|
|
7842
|
+
ThumbnailComponent.getNextId = function () {
|
|
7843
|
+
var id = ThumbnailComponent_1.nextId;
|
|
7844
|
+
ThumbnailComponent_1.nextId++;
|
|
7845
|
+
return id;
|
|
7818
7846
|
};
|
|
7819
|
-
|
|
7820
|
-
var
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
delete filters[field];
|
|
7824
|
-
}
|
|
7825
|
-
});
|
|
7847
|
+
ThumbnailComponent.prototype.getImageAltText = function () {
|
|
7848
|
+
var altText = this.imageAlt || '';
|
|
7849
|
+
// Remove a palavra "image" ou "imagem" para evitar redundância
|
|
7850
|
+
return altText.replace(/\bimage\b/gi, '').replace(/\bimagem\b/gi, '').trim();
|
|
7826
7851
|
};
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
return true;
|
|
7830
|
-
}
|
|
7831
|
-
if (Array.isArray(field)) {
|
|
7832
|
-
return field.length === 0;
|
|
7833
|
-
}
|
|
7834
|
-
if (typeof field === "string") {
|
|
7835
|
-
return field.trim() === "";
|
|
7836
|
-
}
|
|
7837
|
-
if (typeof field === "object") {
|
|
7838
|
-
return Object.keys(field).length === 0;
|
|
7839
|
-
}
|
|
7840
|
-
return false;
|
|
7852
|
+
ThumbnailComponent.prototype.onImageError = function () {
|
|
7853
|
+
this.fallback = true;
|
|
7841
7854
|
};
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
return {};
|
|
7845
|
-
}
|
|
7846
|
-
Object.keys(values).forEach(function (fieldValue) {
|
|
7847
|
-
var field = fields.find(function (it) { return it.name == fieldValue; });
|
|
7848
|
-
if (field) {
|
|
7849
|
-
var val = values[fieldValue];
|
|
7850
|
-
if (!val)
|
|
7851
|
-
return;
|
|
7852
|
-
switch (field.type) {
|
|
7853
|
-
case angularComponents.FieldType.Integer:
|
|
7854
|
-
case angularComponents.FieldType.Double:
|
|
7855
|
-
case angularComponents.FieldType.Money:
|
|
7856
|
-
if (typeof val !== "number")
|
|
7857
|
-
delete values[fieldValue];
|
|
7858
|
-
break;
|
|
7859
|
-
case angularComponents.FieldType.Boolean:
|
|
7860
|
-
if (typeof val !== "boolean")
|
|
7861
|
-
delete values[fieldValue];
|
|
7862
|
-
break;
|
|
7863
|
-
case angularComponents.FieldType.Date:
|
|
7864
|
-
case angularComponents.FieldType.DateTime:
|
|
7865
|
-
case angularComponents.FieldType.Time:
|
|
7866
|
-
if (!moment$1(val, moment$1.ISO_8601, true).isValid())
|
|
7867
|
-
delete values[fieldValue];
|
|
7868
|
-
break;
|
|
7869
|
-
case angularComponents.FieldType.String:
|
|
7870
|
-
case angularComponents.FieldType.Text:
|
|
7871
|
-
if (typeof val !== "string")
|
|
7872
|
-
delete values[fieldValue];
|
|
7873
|
-
break;
|
|
7874
|
-
case angularComponents.FieldType.Lookup:
|
|
7875
|
-
case angularComponents.FieldType.Autocomplete:
|
|
7876
|
-
if (field.multiple) {
|
|
7877
|
-
if (!(Array.isArray(val) && val.length))
|
|
7878
|
-
delete values[fieldValue];
|
|
7879
|
-
}
|
|
7880
|
-
else {
|
|
7881
|
-
if (!(val instanceof Object))
|
|
7882
|
-
delete values[fieldValue];
|
|
7883
|
-
}
|
|
7884
|
-
break;
|
|
7885
|
-
case angularComponents.FieldType.Enum:
|
|
7886
|
-
if (field.multiple && !(Array.isArray(val) && val.length)) {
|
|
7887
|
-
delete values[fieldValue];
|
|
7888
|
-
}
|
|
7889
|
-
break;
|
|
7890
|
-
case angularComponents.FieldType.Chips:
|
|
7891
|
-
if (!(Array.isArray(val) && val.length)) {
|
|
7892
|
-
delete values[fieldValue];
|
|
7893
|
-
}
|
|
7894
|
-
break;
|
|
7895
|
-
default:
|
|
7896
|
-
break;
|
|
7897
|
-
}
|
|
7898
|
-
}
|
|
7899
|
-
});
|
|
7900
|
-
return values;
|
|
7855
|
+
ThumbnailComponent.prototype.onFallbackError = function () {
|
|
7856
|
+
this.imageFallback = null;
|
|
7901
7857
|
};
|
|
7902
|
-
|
|
7903
|
-
|
|
7858
|
+
var ThumbnailComponent_1;
|
|
7859
|
+
ThumbnailComponent.nextId = 0;
|
|
7860
|
+
ThumbnailComponent.ctorParameters = function () { return [
|
|
7861
|
+
{ type: ThumbnailService }
|
|
7862
|
+
]; };
|
|
7863
|
+
__decorate([
|
|
7864
|
+
core.ViewChild("img", { static: false })
|
|
7865
|
+
], ThumbnailComponent.prototype, "imgEl", void 0);
|
|
7866
|
+
__decorate([
|
|
7867
|
+
core.Input()
|
|
7868
|
+
], ThumbnailComponent.prototype, "id", void 0);
|
|
7869
|
+
__decorate([
|
|
7870
|
+
core.Input()
|
|
7871
|
+
], ThumbnailComponent.prototype, "size", void 0);
|
|
7872
|
+
__decorate([
|
|
7873
|
+
core.Input()
|
|
7874
|
+
], ThumbnailComponent.prototype, "imageSource", void 0);
|
|
7875
|
+
__decorate([
|
|
7876
|
+
core.Input()
|
|
7877
|
+
], ThumbnailComponent.prototype, "imageFallback", void 0);
|
|
7878
|
+
__decorate([
|
|
7879
|
+
core.Input()
|
|
7880
|
+
], ThumbnailComponent.prototype, "imageAlt", void 0);
|
|
7881
|
+
__decorate([
|
|
7882
|
+
core.Input()
|
|
7883
|
+
], ThumbnailComponent.prototype, "iconClass", void 0);
|
|
7884
|
+
__decorate([
|
|
7885
|
+
core.Input()
|
|
7886
|
+
], ThumbnailComponent.prototype, "hasAction", void 0);
|
|
7887
|
+
__decorate([
|
|
7888
|
+
core.Input()
|
|
7889
|
+
], ThumbnailComponent.prototype, "actionIconClass", void 0);
|
|
7890
|
+
__decorate([
|
|
7891
|
+
core.Input()
|
|
7892
|
+
], ThumbnailComponent.prototype, "isTile", void 0);
|
|
7893
|
+
__decorate([
|
|
7894
|
+
core.Input()
|
|
7895
|
+
], ThumbnailComponent.prototype, "isBrand", void 0);
|
|
7896
|
+
ThumbnailComponent = ThumbnailComponent_1 = __decorate([
|
|
7897
|
+
core.Component({
|
|
7898
|
+
selector: "s-thumbnail",
|
|
7899
|
+
template: "<div\n [id]=\"id\"\n class=\"thumbnail-container thumbnail-container--{{size}}\"\n [attr.title]=\"imageAlt || 'Thumbnail'\"\n [ngClass]=\"{\n 'thumbnail-container--with-action': hasAction,\n 'thumbnail-container--brand': isBrand\n }\">\n <div\n [id]=\"id + '-image-container'\"\n *ngIf=\"imageSource || imageFallback\"\n class=\"image-container\"\n [ngClass]=\"{\n 'image-container--rounded': !isBrand\n }\">\n <ng-container *ngIf=\"!fallback; else fallbackImage\">\n <ng-container *ngTemplateOutlet=\"imageTemplate; context: {\n imgId: id + '-image',\n imgSrc: imageSource,\n errorHandler: onImageError,\n titleText: imageAlt || 'Thumbnail'\n }\"></ng-container>\n </ng-container>\n\n <ng-template #fallbackImage>\n <ng-container *ngIf=\"imageFallback; else iconFallback\">\n <ng-container *ngTemplateOutlet=\"imageTemplate; context: {\n imgId: id + '-image-fallback',\n imgSrc: imageFallback,\n errorHandler: onFallbackError,\n titleText: imageAlt || 'Thumbnail fallback'\n }\"></ng-container>\n </ng-container>\n </ng-template>\n\n <ng-template #iconFallback>\n <i\n ngClass=\"far fa-image\"\n class=\"fallback-img-color\">\n </i>\n </ng-template>\n\n <ng-template\n #imageTemplate\n let-imgId=\"imgId\"\n let-imgSrc=\"imgSrc\"\n let-errorHandler=\"errorHandler\"\n let-titleText=\"titleText\">\n <img\n #img\n [id]=\"imgId\"\n (error)=\"errorHandler()\"\n [src]=\"imgSrc\"\n alt=\"\"\n [attr.alt]=\"getImageAltText()\"\n [attr.title]=\"titleText\"\n width=\"100%\"\n height=\"auto\"\n [ngClass]=\"{\n 'smallThumbnail': isTile,\n 'exif-orientation-2': orientation == 2,\n 'exif-orientation-3': orientation == 3,\n 'exif-orientation-4': orientation == 4,\n 'exif-orientation-5': orientation == 5,\n 'exif-orientation-6': orientation == 6,\n 'exif-orientation-7': orientation == 7,\n 'exif-orientation-8': orientation == 8\n }\"/>\n </ng-template>\n </div>\n <div\n [id]=\"id + '-action-icon-container'\"\n *ngIf=\"hasAction\"\n class=\"action-icon-container action-icon-container--{{size}}\">\n <span\n [id]=\"id + '-action-icon'\"\n [class]=\"actionIconClass\"\n aria-hidden=\"true\">\n </span>\n </div>\n <div\n [id]=\"id + '-icon-container'\"\n *ngIf=\"!imageSource && !imageFallback\"\n class=\"icon-container icon-container--{{size}}\"\n [ngClass]=\"{'image-container--rounded': !isBrand}\">\n <span\n [id]=\"id + '-icon'\"\n [class]=\"iconClass\"\n aria-hidden=\"true\">\n </span>\n </div>\n\n <ng-content></ng-content>\n</div>\n",
|
|
7900
|
+
styles: [":host{display:inline-block}.thumbnail-container{color:#fff;position:relative;text-align:center}.thumbnail-container--large{font-size:50px;height:100px;width:100px}.thumbnail-container--large.thumbnail-container--brand{width:200px}.thumbnail-container--medium{font-size:40px;height:70px;width:70px}.thumbnail-container--medium.thumbnail-container--brand{width:140px}.thumbnail-container--small{font-size:22px;height:40px;width:40px}.thumbnail-container--small.thumbnail-container--brand{width:80px}.thumbnail-container--with-action{cursor:pointer}.action-icon-container{background-color:#428bca;border-radius:50%;bottom:0;position:absolute;right:0}.action-icon-container--large,.action-icon-container--medium{font-size:10pt;height:25px;padding:3px;width:25px}.action-icon-container--small{font-size:6pt;height:16px;padding:2px;width:16px}.icon-container,.image-container{-ms-flex-align:center;align-items:center;height:100%;overflow:hidden;width:100%}.icon-container--rounded,.image-container--rounded{border-radius:50%}.smallThumbnail{height:40px!important}.icon-container{background-color:#ccc;color:#fff}.icon-container--large{line-height:98px}.icon-container--medium{line-height:68px}.icon-container--small{line-height:38px}.image-container{-ms-flex-align:center;align-items:center;background-color:#ccc;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.image-container img{width:100%}.image-container img.exif-orientation-2{transform:rotateY(180deg)}.image-container img.exif-orientation-3{transform:rotate(180deg)}.image-container img.exif-orientation-4{transform:rotate(180deg) rotateY(180deg)}.image-container img.exif-orientation-5{transform:rotate(270deg) rotateY(180deg)}.image-container img.exif-orientation-6{transform:rotate(90deg)}.image-container img.exif-orientation-7{transform:rotate(90deg) rotateY(180deg)}.image-container img.exif-orientation-8{transform:rotate(270deg)}.fallback-img-color{color:#fff}"]
|
|
7901
|
+
})
|
|
7902
|
+
], ThumbnailComponent);
|
|
7903
|
+
return ThumbnailComponent;
|
|
7904
|
+
}());
|
|
7904
7905
|
|
|
7905
|
-
var
|
|
7906
|
-
|
|
7907
|
-
* Erp Polling
|
|
7908
|
-
* @class ErpPolling
|
|
7909
|
-
*/
|
|
7910
|
-
function ErpPolling() {
|
|
7906
|
+
var ThumbnailModule = /** @class */ (function () {
|
|
7907
|
+
function ThumbnailModule() {
|
|
7911
7908
|
}
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
if (intervalMs === void 0) { intervalMs = 29000; }
|
|
7922
|
-
return rxjs.interval(intervalMs)
|
|
7923
|
-
.pipe(operators.takeWhile(takeWhileFn), operators.switchMap(calling));
|
|
7924
|
-
};
|
|
7925
|
-
ErpPolling = __decorate([
|
|
7926
|
-
core.Injectable()
|
|
7927
|
-
/**
|
|
7928
|
-
* Erp Polling
|
|
7929
|
-
* @class ErpPolling
|
|
7930
|
-
*/
|
|
7931
|
-
], ErpPolling);
|
|
7932
|
-
return ErpPolling;
|
|
7909
|
+
ThumbnailModule = __decorate([
|
|
7910
|
+
core.NgModule({
|
|
7911
|
+
imports: [common.CommonModule],
|
|
7912
|
+
declarations: [ThumbnailComponent],
|
|
7913
|
+
exports: [ThumbnailComponent],
|
|
7914
|
+
providers: [ThumbnailService],
|
|
7915
|
+
})
|
|
7916
|
+
], ThumbnailModule);
|
|
7917
|
+
return ThumbnailModule;
|
|
7933
7918
|
}());
|
|
7934
7919
|
|
|
7920
|
+
var EnumSeverity;
|
|
7921
|
+
(function (EnumSeverity) {
|
|
7922
|
+
EnumSeverity["Default"] = "Default";
|
|
7923
|
+
EnumSeverity["Info"] = "Info";
|
|
7924
|
+
EnumSeverity["Warn"] = "Warn";
|
|
7925
|
+
EnumSeverity["Error"] = "Error";
|
|
7926
|
+
EnumSeverity["Success"] = "Success";
|
|
7927
|
+
})(EnumSeverity || (EnumSeverity = {}));
|
|
7928
|
+
|
|
7935
7929
|
var Breakpoints = {
|
|
7936
7930
|
SM_MIN: 0,
|
|
7937
7931
|
SM_MAX: 640,
|
|
@@ -7943,17 +7937,73 @@
|
|
|
7943
7937
|
XL_MAX: Infinity,
|
|
7944
7938
|
};
|
|
7945
7939
|
|
|
7946
|
-
var
|
|
7947
|
-
function
|
|
7948
|
-
|
|
7940
|
+
var ObjectCardFieldComponent = /** @class */ (function () {
|
|
7941
|
+
function ObjectCardFieldComponent() {
|
|
7942
|
+
this.id = "erp-object-card-field-" + ObjectCardFieldComponent_1.getNextId();
|
|
7943
|
+
this.buttonClick = new core.EventEmitter();
|
|
7949
7944
|
}
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7945
|
+
ObjectCardFieldComponent_1 = ObjectCardFieldComponent;
|
|
7946
|
+
ObjectCardFieldComponent.getNextId = function () {
|
|
7947
|
+
var id = ObjectCardFieldComponent_1.nextId;
|
|
7948
|
+
ObjectCardFieldComponent_1.nextId++;
|
|
7949
|
+
return id;
|
|
7950
|
+
};
|
|
7951
|
+
var ObjectCardFieldComponent_1;
|
|
7952
|
+
ObjectCardFieldComponent.nextId = 0;
|
|
7953
|
+
__decorate([
|
|
7954
|
+
core.Input()
|
|
7955
|
+
], ObjectCardFieldComponent.prototype, "id", void 0);
|
|
7956
|
+
__decorate([
|
|
7957
|
+
core.Input()
|
|
7958
|
+
], ObjectCardFieldComponent.prototype, "imageSource", void 0);
|
|
7959
|
+
__decorate([
|
|
7960
|
+
core.Input()
|
|
7961
|
+
], ObjectCardFieldComponent.prototype, "imageAlt", void 0);
|
|
7962
|
+
__decorate([
|
|
7963
|
+
core.Input()
|
|
7964
|
+
], ObjectCardFieldComponent.prototype, "iconClass", void 0);
|
|
7965
|
+
__decorate([
|
|
7966
|
+
core.Input()
|
|
7967
|
+
], ObjectCardFieldComponent.prototype, "label", void 0);
|
|
7968
|
+
__decorate([
|
|
7969
|
+
core.Input()
|
|
7970
|
+
], ObjectCardFieldComponent.prototype, "description", void 0);
|
|
7971
|
+
__decorate([
|
|
7972
|
+
core.Input()
|
|
7973
|
+
], ObjectCardFieldComponent.prototype, "buttonLabel", void 0);
|
|
7974
|
+
__decorate([
|
|
7975
|
+
core.Input()
|
|
7976
|
+
], ObjectCardFieldComponent.prototype, "buttonModel", void 0);
|
|
7977
|
+
__decorate([
|
|
7978
|
+
core.Output()
|
|
7979
|
+
], ObjectCardFieldComponent.prototype, "buttonClick", void 0);
|
|
7980
|
+
__decorate([
|
|
7981
|
+
core.ContentChild(ThumbnailComponent, { static: true })
|
|
7982
|
+
], ObjectCardFieldComponent.prototype, "thumbnailComponent", void 0);
|
|
7983
|
+
__decorate([
|
|
7984
|
+
core.ViewChild(core.TemplateRef, { static: true })
|
|
7985
|
+
], ObjectCardFieldComponent.prototype, "content", void 0);
|
|
7986
|
+
ObjectCardFieldComponent = ObjectCardFieldComponent_1 = __decorate([
|
|
7987
|
+
core.Component({
|
|
7988
|
+
selector: "erp-object-card-field",
|
|
7989
|
+
template: "<ng-template>\n <div class=\"container\">\n <ng-content select=\"s-thumbnail\"></ng-content>\n <s-thumbnail\n [id]=\"id + '-thumbnail'\"\n *ngIf=\"!thumbnailComponent && (imageSource || iconClass)\"\n [imageSource]=\"imageSource\"\n [imageAlt]=\"imageAlt || label\"\n [iconClass]=\"iconClass\"\n size=\"small\"\n ></s-thumbnail>\n\n <div class=\"info-container\">\n <div #labelTemplate><ng-content select=\"[labelTemplate]\"></ng-content></div>\n <ng-container *ngTemplateOutlet=\"textSpan; context: {\n elementId: id + '-label',\n text: label,\n cssClass: 'label',\n templateWrapper: labelTemplate\n }\"></ng-container>\n\n <div #descriptionTemplate><ng-content select=\"[descriptionTemplate]\"></ng-content></div>\n <ng-container *ngTemplateOutlet=\"textSpan; context: {\n cssClass: 'description',\n elementId: id + '-description',\n templateWrapper: descriptionTemplate,\n text: description\n }\"></ng-container>\n\n <s-button\n *ngIf=\"buttonLabel\"\n [id]=\"id + '-button'\"\n styleClass=\"object-card-button\"\n [label]=\"buttonLabel\"\n priority=\"link\"\n size=\"small\"\n [model]=\"buttonModel\"\n (onClick)=\"buttonClick.emit($event)\"\n ></s-button>\n\n <ng-template\n #textSpan\n let-text=\"text\"\n let-elementId=\"elementId\"\n let-templateWrapper=\"templateWrapper\"\n let-cssClass=\"cssClass\"\n >\n <span\n *ngIf=\"!templateWrapper.children.length\"\n [id]=\"elementId\"\n [pTooltip]=\"text\"\n tooltipPosition=\"top\"\n [class]=\"cssClass\"\n showDelay=\"500\"\n >{{ text }}</span>\n </ng-template>\n </div>\n </div>\n</ng-template>\n",
|
|
7990
|
+
styles: [".container{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;height:100%}.info-container{margin-left:10px}.info-container,.info-container span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.info-container .label{color:#999;display:block}.info-container .description{display:block}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.info-container{-ms-flex:1;flex:1}}@media (max-width:767px){.info-container,.info-container span{white-space:normal}}.info-container:only-child{margin-left:0}"]
|
|
7991
|
+
})
|
|
7992
|
+
], ObjectCardFieldComponent);
|
|
7993
|
+
return ObjectCardFieldComponent;
|
|
7994
|
+
}());
|
|
7995
|
+
|
|
7996
|
+
var ExportUtils = /** @class */ (function () {
|
|
7997
|
+
function ExportUtils() {
|
|
7998
|
+
throw new Error("Classe não deve ser instanciada.");
|
|
7999
|
+
}
|
|
8000
|
+
ExportUtils.exportCSV = function (columns, data, csvSeparator, documentName) {
|
|
8001
|
+
var _this = this;
|
|
8002
|
+
if (columns === void 0) { columns = []; }
|
|
8003
|
+
if (data === void 0) { data = []; }
|
|
8004
|
+
if (csvSeparator === void 0) { csvSeparator = ";"; }
|
|
8005
|
+
if (documentName === void 0) { documentName = "download"; }
|
|
8006
|
+
var csv = "\ufeff";
|
|
7957
8007
|
columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
|
|
7958
8008
|
csv += "\"" + (column.header || column.field) + "\"";
|
|
7959
8009
|
if (i < columns.length - 1)
|
|
@@ -8097,7 +8147,7 @@
|
|
|
8097
8147
|
*/
|
|
8098
8148
|
FormUtilsService.prototype.getFormFormattedDate = function (date, format) {
|
|
8099
8149
|
if (format === void 0) { format = "YYYY-MM-DDT00:00:00"; }
|
|
8100
|
-
return date ? new Date(
|
|
8150
|
+
return date ? new Date(moment$2(date).format(format)) : undefined;
|
|
8101
8151
|
};
|
|
8102
8152
|
/**
|
|
8103
8153
|
* Method to format dates in a string
|
|
@@ -8107,7 +8157,7 @@
|
|
|
8107
8157
|
*/
|
|
8108
8158
|
FormUtilsService.prototype.getEntityFormattedDate = function (date, format) {
|
|
8109
8159
|
if (format === void 0) { format = "YYYY-MM-DD"; }
|
|
8110
|
-
return date ?
|
|
8160
|
+
return date ? moment$2(date).format(format) : undefined;
|
|
8111
8161
|
};
|
|
8112
8162
|
/**
|
|
8113
8163
|
* Method to get a object with only the lookup id
|
|
@@ -8383,6 +8433,570 @@
|
|
|
8383
8433
|
GENERIC_ERROR: 600
|
|
8384
8434
|
};
|
|
8385
8435
|
|
|
8436
|
+
var ObjectCardMainComponent = /** @class */ (function () {
|
|
8437
|
+
function ObjectCardMainComponent() {
|
|
8438
|
+
this.id = "erp-object-card-main-" + ObjectCardMainComponent_1.getNextId();
|
|
8439
|
+
this.iconClass = "fa fa-picture-o";
|
|
8440
|
+
this.hasThumbnail = true;
|
|
8441
|
+
this.hasDescription = true;
|
|
8442
|
+
this.isBrand = false;
|
|
8443
|
+
this.expandableImage = false;
|
|
8444
|
+
this.buttonClick = new core.EventEmitter();
|
|
8445
|
+
this.showImageModal = false;
|
|
8446
|
+
this.loadingFullImage = false;
|
|
8447
|
+
this._thumbnailSize = exports.ThumbnailSize.Medium;
|
|
8448
|
+
}
|
|
8449
|
+
ObjectCardMainComponent_1 = ObjectCardMainComponent;
|
|
8450
|
+
Object.defineProperty(ObjectCardMainComponent.prototype, "thumbnailSize", {
|
|
8451
|
+
get: function () {
|
|
8452
|
+
return this._thumbnailSize;
|
|
8453
|
+
},
|
|
8454
|
+
set: function (value) {
|
|
8455
|
+
this._thumbnailSize = value;
|
|
8456
|
+
if (this.thumbnailComponent) {
|
|
8457
|
+
this.thumbnailComponent.size = value;
|
|
8458
|
+
}
|
|
8459
|
+
},
|
|
8460
|
+
enumerable: true,
|
|
8461
|
+
configurable: true
|
|
8462
|
+
});
|
|
8463
|
+
ObjectCardMainComponent.prototype.onResize = function () {
|
|
8464
|
+
this.update();
|
|
8465
|
+
};
|
|
8466
|
+
ObjectCardMainComponent.prototype.ngAfterContentInit = function () {
|
|
8467
|
+
this.update();
|
|
8468
|
+
};
|
|
8469
|
+
ObjectCardMainComponent.prototype.update = function () {
|
|
8470
|
+
var windowWidth = window.innerWidth;
|
|
8471
|
+
if (windowWidth <= Breakpoints.SM_MAX) {
|
|
8472
|
+
this.thumbnailSize = exports.ThumbnailSize.Small;
|
|
8473
|
+
}
|
|
8474
|
+
else {
|
|
8475
|
+
this.thumbnailSize = exports.ThumbnailSize.Medium;
|
|
8476
|
+
}
|
|
8477
|
+
};
|
|
8478
|
+
ObjectCardMainComponent.getNextId = function () {
|
|
8479
|
+
var id = ObjectCardMainComponent_1.nextId;
|
|
8480
|
+
ObjectCardMainComponent_1.nextId++;
|
|
8481
|
+
return id;
|
|
8482
|
+
};
|
|
8483
|
+
ObjectCardMainComponent.prototype.getImageAltText = function () {
|
|
8484
|
+
var altText = this.imageAlt || this.label || '';
|
|
8485
|
+
return altText.replace(/\bimage\b/gi, '').replace(/\bimagem\b/gi, '').trim();
|
|
8486
|
+
};
|
|
8487
|
+
ObjectCardMainComponent.prototype.openImageModal = function () {
|
|
8488
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8489
|
+
var _a;
|
|
8490
|
+
return __generator(this, function (_b) {
|
|
8491
|
+
switch (_b.label) {
|
|
8492
|
+
case 0:
|
|
8493
|
+
if (!this.expandableImage || !this.imageSource) {
|
|
8494
|
+
return [2 /*return*/];
|
|
8495
|
+
}
|
|
8496
|
+
this.showImageModal = true;
|
|
8497
|
+
_a = this;
|
|
8498
|
+
return [4 /*yield*/, this.resolveFullImageSource()];
|
|
8499
|
+
case 1:
|
|
8500
|
+
_a.fullImageSource = _b.sent();
|
|
8501
|
+
return [2 /*return*/];
|
|
8502
|
+
}
|
|
8503
|
+
});
|
|
8504
|
+
});
|
|
8505
|
+
};
|
|
8506
|
+
ObjectCardMainComponent.prototype.resolveFullImageSource = function () {
|
|
8507
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8508
|
+
var result, error_1;
|
|
8509
|
+
return __generator(this, function (_a) {
|
|
8510
|
+
switch (_a.label) {
|
|
8511
|
+
case 0:
|
|
8512
|
+
if (!this.imageLoader || this.fullImageSource) {
|
|
8513
|
+
return [2 /*return*/, this.fullImageSource || this.imageSource];
|
|
8514
|
+
}
|
|
8515
|
+
this.loadingFullImage = true;
|
|
8516
|
+
_a.label = 1;
|
|
8517
|
+
case 1:
|
|
8518
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
8519
|
+
result = this.imageLoader();
|
|
8520
|
+
return [4 /*yield*/, (result instanceof Promise ? result : result.toPromise())];
|
|
8521
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
8522
|
+
case 3:
|
|
8523
|
+
error_1 = _a.sent();
|
|
8524
|
+
console.error('Erro ao carregar imagem completa:', error_1);
|
|
8525
|
+
return [2 /*return*/, this.imageSource];
|
|
8526
|
+
case 4:
|
|
8527
|
+
this.loadingFullImage = false;
|
|
8528
|
+
return [7 /*endfinally*/];
|
|
8529
|
+
case 5: return [2 /*return*/];
|
|
8530
|
+
}
|
|
8531
|
+
});
|
|
8532
|
+
});
|
|
8533
|
+
};
|
|
8534
|
+
var ObjectCardMainComponent_1;
|
|
8535
|
+
ObjectCardMainComponent.nextId = 0;
|
|
8536
|
+
__decorate([
|
|
8537
|
+
core.Input()
|
|
8538
|
+
], ObjectCardMainComponent.prototype, "id", void 0);
|
|
8539
|
+
__decorate([
|
|
8540
|
+
core.Input()
|
|
8541
|
+
], ObjectCardMainComponent.prototype, "imageSource", void 0);
|
|
8542
|
+
__decorate([
|
|
8543
|
+
core.Input()
|
|
8544
|
+
], ObjectCardMainComponent.prototype, "imageFallback", void 0);
|
|
8545
|
+
__decorate([
|
|
8546
|
+
core.Input()
|
|
8547
|
+
], ObjectCardMainComponent.prototype, "imageAlt", void 0);
|
|
8548
|
+
__decorate([
|
|
8549
|
+
core.Input()
|
|
8550
|
+
], ObjectCardMainComponent.prototype, "iconClass", void 0);
|
|
8551
|
+
__decorate([
|
|
8552
|
+
core.Input()
|
|
8553
|
+
], ObjectCardMainComponent.prototype, "hasThumbnail", void 0);
|
|
8554
|
+
__decorate([
|
|
8555
|
+
core.Input()
|
|
8556
|
+
], ObjectCardMainComponent.prototype, "hasDescription", void 0);
|
|
8557
|
+
__decorate([
|
|
8558
|
+
core.Input()
|
|
8559
|
+
], ObjectCardMainComponent.prototype, "isBrand", void 0);
|
|
8560
|
+
__decorate([
|
|
8561
|
+
core.Input()
|
|
8562
|
+
], ObjectCardMainComponent.prototype, "expandableImage", void 0);
|
|
8563
|
+
__decorate([
|
|
8564
|
+
core.Input()
|
|
8565
|
+
], ObjectCardMainComponent.prototype, "imageLoader", void 0);
|
|
8566
|
+
__decorate([
|
|
8567
|
+
core.Input()
|
|
8568
|
+
], ObjectCardMainComponent.prototype, "label", void 0);
|
|
8569
|
+
__decorate([
|
|
8570
|
+
core.Input()
|
|
8571
|
+
], ObjectCardMainComponent.prototype, "description", void 0);
|
|
8572
|
+
__decorate([
|
|
8573
|
+
core.Input()
|
|
8574
|
+
], ObjectCardMainComponent.prototype, "buttonLabel", void 0);
|
|
8575
|
+
__decorate([
|
|
8576
|
+
core.Input()
|
|
8577
|
+
], ObjectCardMainComponent.prototype, "buttonModel", void 0);
|
|
8578
|
+
__decorate([
|
|
8579
|
+
core.Output()
|
|
8580
|
+
], ObjectCardMainComponent.prototype, "buttonClick", void 0);
|
|
8581
|
+
__decorate([
|
|
8582
|
+
core.ContentChild(ThumbnailComponent, { static: true })
|
|
8583
|
+
], ObjectCardMainComponent.prototype, "thumbnailComponent", void 0);
|
|
8584
|
+
__decorate([
|
|
8585
|
+
core.HostListener("window:resize")
|
|
8586
|
+
], ObjectCardMainComponent.prototype, "onResize", null);
|
|
8587
|
+
ObjectCardMainComponent = ObjectCardMainComponent_1 = __decorate([
|
|
8588
|
+
core.Component({
|
|
8589
|
+
selector: "erp-object-card-main",
|
|
8590
|
+
template: "<ng-container *ngIf=\"hasThumbnail\">\n <ng-content select=\"s-thumbnail\"></ng-content>\n <s-thumbnail\n [id]=\"id + '-thumbnail'\"\n [imageSource]=\"imageSource\"\n [imageFallback]=\"imageFallback\"\n [imageAlt]=\"imageAlt\"\n [iconClass]=\"iconClass\"\n [size]=\"thumbnailSize\"\n *ngIf=\"!thumbnailComponent\"\n [isBrand]=\"isBrand\"\n [ngClass]=\"{'expandable-thumbnail': expandableImage && imageSource}\"\n (click)=\"openImageModal()\"\n (keydown.enter)=\"openImageModal()\"\n (keydown.space)=\"openImageModal()\"\n tabindex=\"0\"\n role=\"button\"\n ></s-thumbnail>\n</ng-container>\n\n<p-dialog\n [header]=\"imageAlt || 'Visualizar'\"\n [(visible)]=\"showImageModal\"\n [modal]=\"true\"\n [dismissableMask]=\"true\"\n [styleClass]=\"'image-modal'\"\n [contentStyle]=\"{'overflow': 'auto', 'text-align': 'center'}\"\n>\n <s-loading-state [loading]=\"loadingFullImage\">\n <img\n *ngIf=\"fullImageSource\"\n [src]=\"fullImageSource\"\n alt=\"\"\n [attr.alt]=\"getImageAltText()\"\n width=\"100%\"\n height=\"auto\"\n class=\"expanded-image\"\n />\n </s-loading-state>\n</p-dialog>\n\n<ng-container *ngIf=\"hasDescription\">\n <div class=\"info-container\">\n <div #labelTemplate><ng-content select=\"[labelTemplate]\"></ng-content></div>\n <ng-container *ngTemplateOutlet=\"textSpan; context: {\n elementId: id + '-label',\n text: label,\n cssClass: 'label',\n templateWrapper: labelTemplate\n }\"></ng-container>\n\n <div #descriptionTemplate><ng-content select=\"[descriptionTemplate]\"></ng-content></div>\n <ng-container *ngTemplateOutlet=\"textSpan; context: {\n elementId: id + '-description',\n text: description,\n cssClass: 'description',\n templateWrapper: descriptionTemplate\n }\"></ng-container>\n\n <s-button\n [id]=\"id + '-button'\"\n *ngIf=\"buttonLabel\"\n styleClass=\"object-card-button\"\n priority=\"link\"\n [label]=\"buttonLabel\"\n [model]=\"buttonModel\"\n size=\"small\"\n (onClick)=\"buttonClick.emit($event)\"\n ></s-button>\n\n <ng-template\n #textSpan\n let-elementId=\"elementId\"\n let-text=\"text\"\n let-cssClass=\"cssClass\"\n let-templateWrapper=\"templateWrapper\"\n >\n <span\n [id]=\"elementId\"\n *ngIf=\"!templateWrapper.children.length\"\n [class]=\"cssClass\"\n [pTooltip]=\"text\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >{{ text }}</span>\n </ng-template>\n </div>\n</ng-container>\n",
|
|
8591
|
+
styles: [":host{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;min-height:70px}.info-container{margin-left:10px;-ms-flex:1;flex:1}.info-container,.info-container span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.info-container .label{display:block;font-weight:700}.info-container .description{color:#999;display:block}@media (max-width:767px){.info-container,.info-container span{white-space:normal}}::ng-deep .expandable-thumbnail{cursor:pointer;transition:opacity .2s}::ng-deep .expandable-thumbnail:hover{opacity:.8}::ng-deep .image-modal .p-dialog{max-width:90vw;max-height:90vh}::ng-deep .image-modal .expanded-image{max-width:80vw;max-height:80vh;width:auto;height:auto;object-fit:contain}"]
|
|
8592
|
+
})
|
|
8593
|
+
], ObjectCardMainComponent);
|
|
8594
|
+
return ObjectCardMainComponent;
|
|
8595
|
+
}());
|
|
8596
|
+
|
|
8597
|
+
var ObjectCardComponent = /** @class */ (function () {
|
|
8598
|
+
function ObjectCardComponent() {
|
|
8599
|
+
this.id = "erp-object-card-" + ObjectCardComponent_1.getNextId();
|
|
8600
|
+
this.expanded = false;
|
|
8601
|
+
this.expandTooltip = "Abrir painel";
|
|
8602
|
+
this.collapseTooltip = "Fechar painel";
|
|
8603
|
+
this.fieldsMinWidth = 200;
|
|
8604
|
+
this.expandedChange = new core.EventEmitter();
|
|
8605
|
+
this.maxVisibleFields = 0;
|
|
8606
|
+
this.severity = EnumSeverity.Default;
|
|
8607
|
+
this.EnumSeverity = EnumSeverity;
|
|
8608
|
+
}
|
|
8609
|
+
ObjectCardComponent_1 = ObjectCardComponent;
|
|
8610
|
+
ObjectCardComponent.prototype.ngAfterContentChecked = function () {
|
|
8611
|
+
this.update();
|
|
8612
|
+
};
|
|
8613
|
+
ObjectCardComponent.prototype.update = function () {
|
|
8614
|
+
var windowWidth = window.innerWidth;
|
|
8615
|
+
var containerWidth = this.container.nativeElement.getBoundingClientRect().width;
|
|
8616
|
+
var mainFieldWidth = this.cardMainContainer.nativeElement.getBoundingClientRect().width;
|
|
8617
|
+
var remainingSpace = containerWidth - mainFieldWidth;
|
|
8618
|
+
var fieldsMinWidth = this.fieldsMinWidth;
|
|
8619
|
+
var expandIconWidth = this.iconContainer.nativeElement.getBoundingClientRect().width;
|
|
8620
|
+
var maxFieldQtd;
|
|
8621
|
+
if (windowWidth <= Breakpoints.SM_MAX) {
|
|
8622
|
+
maxFieldQtd = 0;
|
|
8623
|
+
}
|
|
8624
|
+
else {
|
|
8625
|
+
maxFieldQtd = Math.floor((remainingSpace) / fieldsMinWidth);
|
|
8626
|
+
}
|
|
8627
|
+
var hasExpandIcon = maxFieldQtd && maxFieldQtd < this.fields.length;
|
|
8628
|
+
if (hasExpandIcon) {
|
|
8629
|
+
this.iconContainer.nativeElement.style.display = 'flex';
|
|
8630
|
+
remainingSpace = remainingSpace - expandIconWidth;
|
|
8631
|
+
maxFieldQtd = Math.floor((remainingSpace) / fieldsMinWidth);
|
|
8632
|
+
}
|
|
8633
|
+
else {
|
|
8634
|
+
this.iconContainer.nativeElement.style.display = 'none';
|
|
8635
|
+
}
|
|
8636
|
+
this.maxVisibleFields = maxFieldQtd;
|
|
8637
|
+
if (maxFieldQtd >= this.fields.length && this.expanded) {
|
|
8638
|
+
this.collapse();
|
|
8639
|
+
}
|
|
8640
|
+
};
|
|
8641
|
+
ObjectCardComponent.prototype.toggle = function () {
|
|
8642
|
+
this.expanded ? this.collapse() : this.expand();
|
|
8643
|
+
};
|
|
8644
|
+
ObjectCardComponent.prototype.expand = function () {
|
|
8645
|
+
this.expanded = true;
|
|
8646
|
+
this.expandedChange.emit(this.expanded);
|
|
8647
|
+
};
|
|
8648
|
+
ObjectCardComponent.prototype.collapse = function () {
|
|
8649
|
+
this.expanded = false;
|
|
8650
|
+
this.expandedChange.emit(this.expanded);
|
|
8651
|
+
};
|
|
8652
|
+
ObjectCardComponent.getNextId = function () {
|
|
8653
|
+
var id = ObjectCardComponent_1.nextId;
|
|
8654
|
+
ObjectCardComponent_1.nextId++;
|
|
8655
|
+
return id;
|
|
8656
|
+
};
|
|
8657
|
+
var ObjectCardComponent_1;
|
|
8658
|
+
ObjectCardComponent.nextId = 0;
|
|
8659
|
+
__decorate([
|
|
8660
|
+
core.Input()
|
|
8661
|
+
], ObjectCardComponent.prototype, "id", void 0);
|
|
8662
|
+
__decorate([
|
|
8663
|
+
core.Input()
|
|
8664
|
+
], ObjectCardComponent.prototype, "expanded", void 0);
|
|
8665
|
+
__decorate([
|
|
8666
|
+
core.Input()
|
|
8667
|
+
], ObjectCardComponent.prototype, "expandTooltip", void 0);
|
|
8668
|
+
__decorate([
|
|
8669
|
+
core.Input()
|
|
8670
|
+
], ObjectCardComponent.prototype, "collapseTooltip", void 0);
|
|
8671
|
+
__decorate([
|
|
8672
|
+
core.Input()
|
|
8673
|
+
], ObjectCardComponent.prototype, "fieldsMinWidth", void 0);
|
|
8674
|
+
__decorate([
|
|
8675
|
+
core.Output()
|
|
8676
|
+
], ObjectCardComponent.prototype, "expandedChange", void 0);
|
|
8677
|
+
__decorate([
|
|
8678
|
+
core.ContentChild(ObjectCardMainComponent, { static: true })
|
|
8679
|
+
], ObjectCardComponent.prototype, "main", void 0);
|
|
8680
|
+
__decorate([
|
|
8681
|
+
core.ContentChildren(ObjectCardFieldComponent, { descendants: true })
|
|
8682
|
+
], ObjectCardComponent.prototype, "fields", void 0);
|
|
8683
|
+
__decorate([
|
|
8684
|
+
core.Input()
|
|
8685
|
+
], ObjectCardComponent.prototype, "severity", void 0);
|
|
8686
|
+
__decorate([
|
|
8687
|
+
core.Input()
|
|
8688
|
+
], ObjectCardComponent.prototype, "borderButtonOptions", void 0);
|
|
8689
|
+
__decorate([
|
|
8690
|
+
core.ViewChild('contentContainer', { static: true })
|
|
8691
|
+
], ObjectCardComponent.prototype, "container", void 0);
|
|
8692
|
+
__decorate([
|
|
8693
|
+
core.ViewChild('cardMainContainer', { static: true })
|
|
8694
|
+
], ObjectCardComponent.prototype, "cardMainContainer", void 0);
|
|
8695
|
+
__decorate([
|
|
8696
|
+
core.ViewChild('iconContainer', { static: true })
|
|
8697
|
+
], ObjectCardComponent.prototype, "iconContainer", void 0);
|
|
8698
|
+
ObjectCardComponent = ObjectCardComponent_1 = __decorate([
|
|
8699
|
+
core.Component({
|
|
8700
|
+
selector: "erp-object-card",
|
|
8701
|
+
template: "<div [id]=\"id\" class=\"container\">\n <s-border-button\n *ngIf=\"\n borderButtonOptions?.visible\n ? borderButtonOptions?.visible(severity)\n : false\n \"\n [severity]=\"severity\"\n [options]=\"borderButtonOptions\"\n class=\"object-card__border-button\"\n [@BorderButtonAnimation]\n ></s-border-button>\n\n <div\n [id]=\"id + '-main-container'\"\n class=\"main-container\"\n #contentContainer\n [ngClass]=\"{\n 'with-hidden-fields': fields.length > maxVisibleFields,\n 'with-visible-fields': fields.length && maxVisibleFields,\n 'main-container--severity-default': severity === EnumSeverity.Default,\n 'main-container--severity-info': severity === EnumSeverity.Info,\n 'main-container--severity-warn': severity === EnumSeverity.Warn,\n 'main-container--severity-error': severity === EnumSeverity.Error,\n 'main-container--severity-success': severity == EnumSeverity.Success\n }\"\n >\n <div class=\"object-content\">\n <div class=\"erp-object-card-main\" #cardMainContainer [style.min-width.px]=\"fieldsMinWidth\">\n <ng-content select=\"erp-object-card-main\"></ng-content>\n </div>\n\n <div class=\"divider\" *ngIf=\"maxVisibleFields && fields.length\"></div>\n\n <div *ngFor=\"let field of (fields.toArray() | slice: 0:maxVisibleFields)\"\n class=\"erp-object-card-field\"\n [style.min-width.px]=\"fieldsMinWidth\">\n\n <ng-container *ngTemplateOutlet=\"field.content\"></ng-container>\n </div>\n </div>\n\n <button\n #iconContainer\n [id]=\"id + '-expand-icon-container'\"\n class=\"expand-icon-container\"\n (click)=\"toggle()\"\n [pTooltip]=\"expanded ? collapseTooltip : expandTooltip\"\n [attr.aria-label]=\"expanded ? collapseTooltip : expandTooltip\"\n title=\"Expandir/Recolher\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n type=\"button\"\n >\n <span\n [id]=\"id + '-expand-icon'\"\n class=\"expand-icon fa\"\n [ngClass]=\"{ 'fa-minus': expanded, 'fa-plus': !expanded }\"\n ></span>\n </button>\n </div>\n\n <div\n [id]=\"id + '-expandable-container'\"\n [@expandableContent]=\"expanded\"\n class=\"expandable-container\"\n [ngClass]=\"{\n 'expandable-container--severity-default':\n severity === EnumSeverity.Default,\n 'expandable-container--severity-info': severity === EnumSeverity.Info,\n 'expandable-container--severity-warn': severity === EnumSeverity.Warn,\n 'expandable-container--severity-error': severity === EnumSeverity.Error,\n 'expandable-container--severity-success':\n severity == EnumSeverity.Success\n }\"\n >\n <div class=\"childlist\">\n <ng-container\n *ngFor=\"\n let field of fields.toArray()\n | slice : maxVisibleFields : fields.length\n \"\n >\n <div class=\"erp-object-card-field\" [style.min-width.px]=\"fieldsMinWidth\">\n <ng-container\n *ngTemplateOutlet=\"field.content\"\n ></ng-container>\n </div>\n </ng-container>\n </div>\n </div>\n</div>\n",
|
|
8702
|
+
animations: [
|
|
8703
|
+
animations.trigger("expandableContent", [
|
|
8704
|
+
animations.state("*", animations.style({
|
|
8705
|
+
height: "0",
|
|
8706
|
+
})),
|
|
8707
|
+
animations.state("false", animations.style({
|
|
8708
|
+
height: "0",
|
|
8709
|
+
})),
|
|
8710
|
+
animations.state("true", animations.style({
|
|
8711
|
+
height: "*",
|
|
8712
|
+
})),
|
|
8713
|
+
animations.transition("* => true", animations.animate("200ms ease-out")),
|
|
8714
|
+
animations.transition("false <=> true", animations.animate("200ms ease-out")),
|
|
8715
|
+
]),
|
|
8716
|
+
animations.trigger("BorderButtonAnimation", [
|
|
8717
|
+
animations.transition(":enter", [
|
|
8718
|
+
animations.style({ transform: "scaleY(0)", opacity: 0 }),
|
|
8719
|
+
animations.animate("300ms ease", animations.style({ transform: "scaleY(1)", opacity: 1 })),
|
|
8720
|
+
]),
|
|
8721
|
+
animations.transition(":leave", [
|
|
8722
|
+
animations.style({ transform: "scaleY(1)", opacity: 1 }),
|
|
8723
|
+
animations.animate("300ms ease", animations.style({ transform: "scaleY(0)", opacity: 0 })),
|
|
8724
|
+
]),
|
|
8725
|
+
]),
|
|
8726
|
+
],
|
|
8727
|
+
styles: [":host{display:block}:host::ng-deep .sds-badge{height:auto;white-space:normal}.container{margin-bottom:20px;position:relative}.main-container{display:-ms-flexbox;display:flex}.expandable-container,.main-container{background-color:#fff;border:1px solid #ccc;position:relative;overflow:hidden;width:100%}.expandable-container--severity-default{border-color:#ccc;border-top:initial}.expandable-container--severity-info{transition:border-color .5s;border-color:#428bca;border-top:initial}.expandable-container--severity-warn{transition:border-color .5s;border-color:#f8931f;border-top:initial}.expandable-container--severity-error{transition:border-color .5s;border-color:#c13018;border-top:initial}.expandable-container--severity-success{transition:border-color .5s;border-color:#0c9348;border-top:initial}.main-container--severity-default{border-color:#ccc}.main-container--severity-info{transition:border-color .5s;border-color:#428bca}.main-container--severity-warn{transition:border-color .5s;border-color:#f8931f}.main-container--severity-error{transition:border-color .5s;border-color:#c13018}.main-container--severity-success{transition:border-color .5s;border-color:#0c9348}.object-card__border-button{position:absolute;top:-13px;right:15px;z-index:1}.expandable-container{border-top:none;box-shadow:inset 0 6px 4px -4px #ddd;margin-top:-1px}.expand-icon-container{display:none;text-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;padding:12px;background:0 0;border:none;color:inherit}.expand-icon{-ms-flex:1;flex:1}.object-content{display:-ms-flexbox;display:flex;width:100%}.erp-object-card-main{overflow:hidden;padding:15px}.main-container.with-visible-fields .erp-object-card-main{max-width:30%}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.main-container.with-visible-fields .erp-object-card-main{width:20%}}.erp-object-card-field{overflow:hidden;height:100%}.main-container .erp-object-card-field{padding:15px}.main-container .divider{width:1px;-ms-flex-negative:0;flex-shrink:0;background-color:#ccc;margin:15px -1px 15px 0}.main-container.with-hidden-fields .object-content{width:calc(100% - 35px)}.main-container.with-hidden-fields .expand-icon-container{display:-ms-flexbox;display:flex}::ng-deep .object-card-button{padding-left:0!important;padding-right:10px!important;border:none!important;height:auto!important;min-width:auto!important;text-align:left!important}@media (max-width:767px){.erp-object-card-main{max-width:calc(100% - 50px)}}.childlist{width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:1em;gap:1em}"]
|
|
8728
|
+
})
|
|
8729
|
+
], ObjectCardComponent);
|
|
8730
|
+
return ObjectCardComponent;
|
|
8731
|
+
}());
|
|
8732
|
+
|
|
8733
|
+
var BorderButtonComponent = /** @class */ (function () {
|
|
8734
|
+
function BorderButtonComponent() {
|
|
8735
|
+
this.severity = EnumSeverity.Default;
|
|
8736
|
+
this.EnumSeverity = EnumSeverity;
|
|
8737
|
+
}
|
|
8738
|
+
__decorate([
|
|
8739
|
+
core.Input()
|
|
8740
|
+
], BorderButtonComponent.prototype, "severity", void 0);
|
|
8741
|
+
__decorate([
|
|
8742
|
+
core.Input()
|
|
8743
|
+
], BorderButtonComponent.prototype, "options", void 0);
|
|
8744
|
+
BorderButtonComponent = __decorate([
|
|
8745
|
+
core.Component({
|
|
8746
|
+
selector: "s-border-button",
|
|
8747
|
+
template: "<button\n class=\"border-button\"\n [ngClass]=\"{\n 'border-button--severity-default': severity === EnumSeverity.Default,\n 'border-button--severity-info': severity === EnumSeverity.Info,\n 'border-button--severity-warn': severity === EnumSeverity.Warn,\n 'border-button--severity-error': severity === EnumSeverity.Error,\n 'border-button--severity-success': severity == EnumSeverity.Success,\n 'border-button--disabled': options?.disabled\n ? options?.disabled(severity)\n : false\n }\"\n (click)=\"options?.onClick ? options?.onClick(severity) : null\"\n [pTooltip]=\"options?.tooltip ? options?.tooltip(severity) : null\"\n tooltipPosition=\"left\"\n [disabled]=\"options?.disabled ? options?.disabled(severity) : false\"\n>\n <span class=\"border-button__label\">\n {{ options?.label ? options?.label(severity) : null }}\n </span>\n <span\n *ngIf=\"options?.icon ? options?.icon(severity) : false\"\n class=\"border-button__icon {{ options?.icon(severity) }}\"\n ></span>\n</button>\n",
|
|
8748
|
+
styles: [".border-button{padding:0 8px;border:1px solid;border-radius:12px;height:23px;max-width:320px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer}.border-button__label{font-family:Open Sans,sans-serif;font-size:12px;line-height:150%;width:100%;display:block;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.border-button__icon{font-size:12px;color:#333;margin-left:8px}.border-button--severity-default{border-color:#ccc;background-color:#fff}.border-button--severity-info{border-color:#428bca;background-color:#d5e8ec;transition:background-color .5s,border-color .5s}.border-button--severity-info:enabled:hover{background-color:#9ecad4;cursor:pointer}.border-button--severity-info:enabled:active{transition:none;background-color:#67acbc;border-color:#67acbc}.border-button--severity-warn{border-color:#f8931f;background-color:#fce3ba;transition:background-color .5s,border-color .5s}.border-button--severity-warn:enabled:hover{background-color:#f8bf5e;cursor:pointer}.border-button--severity-warn:enabled:active{transition:none;background-color:#f5a319;border-color:#f5a319}.border-button--severity-error{border-color:#c13018;background-color:#fcd2d2;transition:background-color .5s,border-color .5s}.border-button--severity-error:enabled:hover{background-color:#f89696;cursor:pointer}.border-button--severity-error:enabled:active{transition:none;background-color:#f45b5b;border-color:#f45b5b}.border-button--severity-success{border-color:#0c9348;background-color:#e6ffb3;transition:background-color .5s,border-color .5s}.border-button--severity-success:enabled:hover{background-color:#c8ff5c;cursor:pointer}.border-button--severity-success:enabled:active{transition:none;background-color:#ade500;border-color:#ade500}.border-button--disabled:disabled:hover{cursor:default}"]
|
|
8749
|
+
})
|
|
8750
|
+
], BorderButtonComponent);
|
|
8751
|
+
return BorderButtonComponent;
|
|
8752
|
+
}());
|
|
8753
|
+
|
|
8754
|
+
var BorderButtonModule = /** @class */ (function () {
|
|
8755
|
+
function BorderButtonModule() {
|
|
8756
|
+
}
|
|
8757
|
+
BorderButtonModule = __decorate([
|
|
8758
|
+
core.NgModule({
|
|
8759
|
+
imports: [common.CommonModule, tooltip.TooltipModule],
|
|
8760
|
+
declarations: [BorderButtonComponent],
|
|
8761
|
+
exports: [BorderButtonComponent]
|
|
8762
|
+
})
|
|
8763
|
+
], BorderButtonModule);
|
|
8764
|
+
return BorderButtonModule;
|
|
8765
|
+
}());
|
|
8766
|
+
|
|
8767
|
+
var ErpObjectCardModule = /** @class */ (function () {
|
|
8768
|
+
function ErpObjectCardModule() {
|
|
8769
|
+
}
|
|
8770
|
+
ErpObjectCardModule = __decorate([
|
|
8771
|
+
core.NgModule({
|
|
8772
|
+
imports: [common.CommonModule, tooltip.TooltipModule, dialog.DialogModule, ThumbnailModule, angularComponents.ButtonModule, angularComponents.LoadingStateModule, BorderButtonModule],
|
|
8773
|
+
declarations: [ObjectCardComponent, ObjectCardMainComponent, ObjectCardFieldComponent],
|
|
8774
|
+
exports: [ThumbnailModule, ObjectCardComponent, ObjectCardMainComponent, ObjectCardFieldComponent],
|
|
8775
|
+
})
|
|
8776
|
+
], ErpObjectCardModule);
|
|
8777
|
+
return ErpObjectCardModule;
|
|
8778
|
+
}());
|
|
8779
|
+
|
|
8780
|
+
var StorageService = /** @class */ (function () {
|
|
8781
|
+
function StorageService() {
|
|
8782
|
+
this.GET_USER_ID = seniorPlatformData.user.getUserData().then(function (user) { return user.id; });
|
|
8783
|
+
}
|
|
8784
|
+
StorageService.prototype.store = function (key, value) {
|
|
8785
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8786
|
+
var _a, _b;
|
|
8787
|
+
return __generator(this, function (_c) {
|
|
8788
|
+
switch (_c.label) {
|
|
8789
|
+
case 0:
|
|
8790
|
+
_b = (_a = localStorage).setItem;
|
|
8791
|
+
return [4 /*yield*/, this.GET_USER_ID];
|
|
8792
|
+
case 1:
|
|
8793
|
+
_b.apply(_a, [(_c.sent()) + "_" + key, JSON.stringify(value)]);
|
|
8794
|
+
return [2 /*return*/];
|
|
8795
|
+
}
|
|
8796
|
+
});
|
|
8797
|
+
});
|
|
8798
|
+
};
|
|
8799
|
+
StorageService.prototype.get = function (key) {
|
|
8800
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8801
|
+
var _a, _b, _c, _d;
|
|
8802
|
+
return __generator(this, function (_e) {
|
|
8803
|
+
switch (_e.label) {
|
|
8804
|
+
case 0:
|
|
8805
|
+
_b = (_a = JSON).parse;
|
|
8806
|
+
_d = (_c = localStorage).getItem;
|
|
8807
|
+
return [4 /*yield*/, this.GET_USER_ID];
|
|
8808
|
+
case 1: return [2 /*return*/, _b.apply(_a, [_d.apply(_c, [(_e.sent()) + "_" + key])]) || {}];
|
|
8809
|
+
}
|
|
8810
|
+
});
|
|
8811
|
+
});
|
|
8812
|
+
};
|
|
8813
|
+
return StorageService;
|
|
8814
|
+
}());
|
|
8815
|
+
|
|
8816
|
+
var moment$1 = moment$2; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
8817
|
+
var FiltersStorageService = /** @class */ (function (_super) {
|
|
8818
|
+
__extends(FiltersStorageService, _super);
|
|
8819
|
+
function FiltersStorageService() {
|
|
8820
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
8821
|
+
_this.FILTERS_KEY = "SENIOR_FILTERS";
|
|
8822
|
+
return _this;
|
|
8823
|
+
}
|
|
8824
|
+
FiltersStorageService.prototype.storeFilters = function (key, filters) {
|
|
8825
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8826
|
+
var store;
|
|
8827
|
+
return __generator(this, function (_a) {
|
|
8828
|
+
switch (_a.label) {
|
|
8829
|
+
case 0: return [4 /*yield*/, _super.prototype.get.call(this, this.FILTERS_KEY)];
|
|
8830
|
+
case 1:
|
|
8831
|
+
store = (_a.sent()) || {};
|
|
8832
|
+
this.removeEmptyValues(filters);
|
|
8833
|
+
store[key] = filters;
|
|
8834
|
+
return [4 /*yield*/, _super.prototype.store.call(this, this.FILTERS_KEY, store)];
|
|
8835
|
+
case 2:
|
|
8836
|
+
_a.sent();
|
|
8837
|
+
return [2 /*return*/];
|
|
8838
|
+
}
|
|
8839
|
+
});
|
|
8840
|
+
});
|
|
8841
|
+
};
|
|
8842
|
+
FiltersStorageService.prototype.getFilters = function (key) {
|
|
8843
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8844
|
+
var store;
|
|
8845
|
+
return __generator(this, function (_a) {
|
|
8846
|
+
switch (_a.label) {
|
|
8847
|
+
case 0: return [4 /*yield*/, _super.prototype.get.call(this, this.FILTERS_KEY)];
|
|
8848
|
+
case 1:
|
|
8849
|
+
store = (_a.sent()) || {};
|
|
8850
|
+
return [2 /*return*/, store[key] || {}];
|
|
8851
|
+
}
|
|
8852
|
+
});
|
|
8853
|
+
});
|
|
8854
|
+
};
|
|
8855
|
+
FiltersStorageService.prototype.removeFilter = function (key) {
|
|
8856
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8857
|
+
var store;
|
|
8858
|
+
return __generator(this, function (_a) {
|
|
8859
|
+
switch (_a.label) {
|
|
8860
|
+
case 0: return [4 /*yield*/, _super.prototype.get.call(this, this.FILTERS_KEY)];
|
|
8861
|
+
case 1:
|
|
8862
|
+
store = (_a.sent()) || {};
|
|
8863
|
+
delete store[key];
|
|
8864
|
+
return [4 /*yield*/, _super.prototype.store.call(this, this.FILTERS_KEY, store)];
|
|
8865
|
+
case 2:
|
|
8866
|
+
_a.sent();
|
|
8867
|
+
return [2 /*return*/];
|
|
8868
|
+
}
|
|
8869
|
+
});
|
|
8870
|
+
});
|
|
8871
|
+
};
|
|
8872
|
+
FiltersStorageService.prototype.clearFilterValue = function (key, filters) {
|
|
8873
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8874
|
+
return __generator(this, function (_a) {
|
|
8875
|
+
switch (_a.label) {
|
|
8876
|
+
case 0: return [4 /*yield*/, this.storeFilters(key, filters)];
|
|
8877
|
+
case 1:
|
|
8878
|
+
_a.sent();
|
|
8879
|
+
return [2 /*return*/];
|
|
8880
|
+
}
|
|
8881
|
+
});
|
|
8882
|
+
});
|
|
8883
|
+
};
|
|
8884
|
+
FiltersStorageService.prototype.removeEmptyValues = function (filters) {
|
|
8885
|
+
var _this = this;
|
|
8886
|
+
Object.keys(filters).forEach(function (field) {
|
|
8887
|
+
if (_this.isInvalid(filters[field])) {
|
|
8888
|
+
delete filters[field];
|
|
8889
|
+
}
|
|
8890
|
+
});
|
|
8891
|
+
};
|
|
8892
|
+
FiltersStorageService.prototype.isInvalid = function (field) {
|
|
8893
|
+
if (field === null || field === undefined) {
|
|
8894
|
+
return true;
|
|
8895
|
+
}
|
|
8896
|
+
if (Array.isArray(field)) {
|
|
8897
|
+
return field.length === 0;
|
|
8898
|
+
}
|
|
8899
|
+
if (typeof field === "string") {
|
|
8900
|
+
return field.trim() === "";
|
|
8901
|
+
}
|
|
8902
|
+
if (typeof field === "object") {
|
|
8903
|
+
return Object.keys(field).length === 0;
|
|
8904
|
+
}
|
|
8905
|
+
return false;
|
|
8906
|
+
};
|
|
8907
|
+
FiltersStorageService.prototype.removeInvalidValues = function (values, fields) {
|
|
8908
|
+
if (!values) {
|
|
8909
|
+
return {};
|
|
8910
|
+
}
|
|
8911
|
+
Object.keys(values).forEach(function (fieldValue) {
|
|
8912
|
+
var field = fields.find(function (it) { return it.name == fieldValue; });
|
|
8913
|
+
if (field) {
|
|
8914
|
+
var val = values[fieldValue];
|
|
8915
|
+
if (!val)
|
|
8916
|
+
return;
|
|
8917
|
+
switch (field.type) {
|
|
8918
|
+
case angularComponents.FieldType.Integer:
|
|
8919
|
+
case angularComponents.FieldType.Double:
|
|
8920
|
+
case angularComponents.FieldType.Money:
|
|
8921
|
+
if (typeof val !== "number")
|
|
8922
|
+
delete values[fieldValue];
|
|
8923
|
+
break;
|
|
8924
|
+
case angularComponents.FieldType.Boolean:
|
|
8925
|
+
if (typeof val !== "boolean")
|
|
8926
|
+
delete values[fieldValue];
|
|
8927
|
+
break;
|
|
8928
|
+
case angularComponents.FieldType.Date:
|
|
8929
|
+
case angularComponents.FieldType.DateTime:
|
|
8930
|
+
case angularComponents.FieldType.Time:
|
|
8931
|
+
if (!moment$1(val, moment$1.ISO_8601, true).isValid())
|
|
8932
|
+
delete values[fieldValue];
|
|
8933
|
+
break;
|
|
8934
|
+
case angularComponents.FieldType.String:
|
|
8935
|
+
case angularComponents.FieldType.Text:
|
|
8936
|
+
if (typeof val !== "string")
|
|
8937
|
+
delete values[fieldValue];
|
|
8938
|
+
break;
|
|
8939
|
+
case angularComponents.FieldType.Lookup:
|
|
8940
|
+
case angularComponents.FieldType.Autocomplete:
|
|
8941
|
+
if (field.multiple) {
|
|
8942
|
+
if (!(Array.isArray(val) && val.length))
|
|
8943
|
+
delete values[fieldValue];
|
|
8944
|
+
}
|
|
8945
|
+
else {
|
|
8946
|
+
if (!(val instanceof Object))
|
|
8947
|
+
delete values[fieldValue];
|
|
8948
|
+
}
|
|
8949
|
+
break;
|
|
8950
|
+
case angularComponents.FieldType.Enum:
|
|
8951
|
+
if (field.multiple && !(Array.isArray(val) && val.length)) {
|
|
8952
|
+
delete values[fieldValue];
|
|
8953
|
+
}
|
|
8954
|
+
break;
|
|
8955
|
+
case angularComponents.FieldType.Chips:
|
|
8956
|
+
if (!(Array.isArray(val) && val.length)) {
|
|
8957
|
+
delete values[fieldValue];
|
|
8958
|
+
}
|
|
8959
|
+
break;
|
|
8960
|
+
default:
|
|
8961
|
+
break;
|
|
8962
|
+
}
|
|
8963
|
+
}
|
|
8964
|
+
});
|
|
8965
|
+
return values;
|
|
8966
|
+
};
|
|
8967
|
+
return FiltersStorageService;
|
|
8968
|
+
}(StorageService));
|
|
8969
|
+
|
|
8970
|
+
var ErpPolling = /** @class */ (function () {
|
|
8971
|
+
/**
|
|
8972
|
+
* Erp Polling
|
|
8973
|
+
* @class ErpPolling
|
|
8974
|
+
*/
|
|
8975
|
+
function ErpPolling() {
|
|
8976
|
+
}
|
|
8977
|
+
/**
|
|
8978
|
+
* Criação de um polling.
|
|
8979
|
+
* @typeParam `<T>` Tipo do objeto que o retorno do `observable` vai devolver.
|
|
8980
|
+
* @param takeWhileFn Função com retorno booleano, condição para a conclusão do polling, se falso conclui o polling.
|
|
8981
|
+
* @param calling Função com retorno `Observable<T>`, será a chamada feita pelo polling a cada X ms.
|
|
8982
|
+
* @param intervalMs Valor em ms que determina o intervalo das chamadas do polling.
|
|
8983
|
+
* @return Um `observable` com repetição cíclica a cada X ms _(`interval` informado nos parâmetros de entrada)_
|
|
8984
|
+
*/
|
|
8985
|
+
ErpPolling.prototype.pollingMount = function (takeWhileFn, calling, intervalMs) {
|
|
8986
|
+
if (intervalMs === void 0) { intervalMs = 29000; }
|
|
8987
|
+
return rxjs.interval(intervalMs)
|
|
8988
|
+
.pipe(operators.takeWhile(takeWhileFn), operators.switchMap(calling));
|
|
8989
|
+
};
|
|
8990
|
+
ErpPolling = __decorate([
|
|
8991
|
+
core.Injectable()
|
|
8992
|
+
/**
|
|
8993
|
+
* Erp Polling
|
|
8994
|
+
* @class ErpPolling
|
|
8995
|
+
*/
|
|
8996
|
+
], ErpPolling);
|
|
8997
|
+
return ErpPolling;
|
|
8998
|
+
}());
|
|
8999
|
+
|
|
8386
9000
|
// https://widget.tracksale.co/
|
|
8387
9001
|
var NpsService = /** @class */ (function () {
|
|
8388
9002
|
function NpsService() {
|
|
@@ -9261,6 +9875,7 @@
|
|
|
9261
9875
|
exports.ErpLookupsFormField = ErpLookupsFormField;
|
|
9262
9876
|
exports.ErpLookupsModule = ErpLookupsModule;
|
|
9263
9877
|
exports.ErpLookupsService = ErpLookupsService;
|
|
9878
|
+
exports.ErpObjectCardModule = ErpObjectCardModule;
|
|
9264
9879
|
exports.ErpPolling = ErpPolling;
|
|
9265
9880
|
exports.ExportUtils = ExportUtils;
|
|
9266
9881
|
exports.FiltersStorageService = FiltersStorageService;
|
|
@@ -9275,6 +9890,9 @@
|
|
|
9275
9890
|
exports.NcmLookup = NcmLookup;
|
|
9276
9891
|
exports.NotaFiscalEntradaLookup = NotaFiscalEntradaLookup;
|
|
9277
9892
|
exports.NpsService = NpsService;
|
|
9893
|
+
exports.ObjectCardComponent = ObjectCardComponent;
|
|
9894
|
+
exports.ObjectCardFieldComponent = ObjectCardFieldComponent;
|
|
9895
|
+
exports.ObjectCardMainComponent = ObjectCardMainComponent;
|
|
9278
9896
|
exports.OperacoesLookup = OperacoesLookup;
|
|
9279
9897
|
exports.OrigemDestinoLookup = OrigemDestinoLookup;
|
|
9280
9898
|
exports.OrigemMercadoriaLookup = OrigemMercadoriaLookup;
|
|
@@ -9284,6 +9902,8 @@
|
|
|
9284
9902
|
exports.QuantidadeDisponivelDemandaLookup = QuantidadeDisponivelDemandaLookup;
|
|
9285
9903
|
exports.RequisicaoLookup = RequisicaoLookup;
|
|
9286
9904
|
exports.SegmentoLookup = SegmentoLookup;
|
|
9905
|
+
exports.ThumbnailComponent = ThumbnailComponent;
|
|
9906
|
+
exports.ThumbnailModule = ThumbnailModule;
|
|
9287
9907
|
exports.TypeTaxesLookup = TypeTaxesLookup;
|
|
9288
9908
|
exports.UnidadeMedidaLookup = UnidadeMedidaLookup;
|
|
9289
9909
|
exports.UtilsModule = UtilsModule;
|
|
@@ -9294,10 +9914,13 @@
|
|
|
9294
9914
|
exports.ɵ0 = ɵ0;
|
|
9295
9915
|
exports.ɵ1 = ɵ1;
|
|
9296
9916
|
exports.ɵ2 = ɵ2;
|
|
9297
|
-
exports.ɵc =
|
|
9298
|
-
exports.ɵd =
|
|
9299
|
-
exports.ɵe =
|
|
9300
|
-
exports.ɵf =
|
|
9917
|
+
exports.ɵc = ThumbnailService;
|
|
9918
|
+
exports.ɵd = BorderButtonModule;
|
|
9919
|
+
exports.ɵe = BorderButtonComponent;
|
|
9920
|
+
exports.ɵf = StorageService;
|
|
9921
|
+
exports.ɵg = UserInformationService;
|
|
9922
|
+
exports.ɵh = VerifyModulePermissionService;
|
|
9923
|
+
exports.ɵi = VerifyModulePermissionsService;
|
|
9301
9924
|
|
|
9302
9925
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9303
9926
|
|