@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,18 +1,21 @@
|
|
|
1
|
-
import { __spread, __assign, __decorate, __extends, __awaiter, __generator,
|
|
2
|
-
import { Input, Component, NgModule, Injectable, Inject, ɵɵdefineInjectable, ɵɵinject } from '@angular/core';
|
|
1
|
+
import { __spread, __assign, __decorate, __extends, __param, __awaiter, __generator, __values } from 'tslib';
|
|
2
|
+
import { Input, Component, NgModule, Injectable, ViewChild, EventEmitter, Output, ContentChild, TemplateRef, Inject, HostListener, ContentChildren, ɵɵdefineInjectable, ɵɵinject } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
|
|
5
5
|
import { NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router, RouterModule } from '@angular/router';
|
|
6
|
-
import { Subject, throwError,
|
|
6
|
+
import { Subject, throwError, from, of, interval, BehaviorSubject, ReplaySubject } from 'rxjs';
|
|
7
7
|
import { takeUntil, filter, catchError, map, takeWhile, switchMap, take, finalize } from 'rxjs/operators';
|
|
8
|
-
import * as
|
|
9
|
-
import { FormField, FieldType } from '@seniorsistemas/angular-components';
|
|
8
|
+
import * as moment$2 from 'moment';
|
|
9
|
+
import { FormField, FieldType, ButtonModule, LoadingStateModule } from '@seniorsistemas/angular-components';
|
|
10
10
|
import { HttpParams, HttpClient } from '@angular/common/http';
|
|
11
11
|
import { MessageService } from 'primeng/api';
|
|
12
12
|
import { TranslateService } from '@ngx-translate/core';
|
|
13
13
|
import { HttpInterceptorModule } from '@seniorsistemas/platform-components';
|
|
14
|
-
import {
|
|
14
|
+
import { TooltipModule } from 'primeng/tooltip';
|
|
15
|
+
import { DialogModule } from 'primeng/dialog';
|
|
16
|
+
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
15
17
|
import { FormControl, FormGroup } from '@angular/forms';
|
|
18
|
+
import { user } from '@seniorsistemas/senior-platform-data';
|
|
16
19
|
import { Client, FrameImpl } from '@stomp/stompjs';
|
|
17
20
|
import * as SockJS from 'sockjs-client';
|
|
18
21
|
import { get } from 'js-cookie';
|
|
@@ -194,7 +197,7 @@ var ErpLookupsService = /** @class */ (function () {
|
|
|
194
197
|
return ErpLookupsService;
|
|
195
198
|
}());
|
|
196
199
|
|
|
197
|
-
var moment =
|
|
200
|
+
var moment = moment$2;
|
|
198
201
|
/** Filter System Query Option - Operators supported in the expression language */
|
|
199
202
|
var EnumLogicalOperator;
|
|
200
203
|
(function (EnumLogicalOperator) {
|
|
@@ -7506,226 +7509,220 @@ var ErpLookupsModule = /** @class */ (function () {
|
|
|
7506
7509
|
return ErpLookupsModule;
|
|
7507
7510
|
}());
|
|
7508
7511
|
|
|
7509
|
-
var
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
+
var ThumbnailSize;
|
|
7513
|
+
(function (ThumbnailSize) {
|
|
7514
|
+
ThumbnailSize["Small"] = "small";
|
|
7515
|
+
ThumbnailSize["Medium"] = "medium";
|
|
7516
|
+
ThumbnailSize["Large"] = "large";
|
|
7517
|
+
})(ThumbnailSize || (ThumbnailSize = {}));
|
|
7518
|
+
|
|
7519
|
+
var ThumbnailService = /** @class */ (function () {
|
|
7520
|
+
function ThumbnailService() {
|
|
7512
7521
|
}
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7522
|
+
ThumbnailService_1 = ThumbnailService;
|
|
7523
|
+
ThumbnailService.prototype.getBinaryFile = function (img) {
|
|
7524
|
+
var _this = this;
|
|
7525
|
+
return new Promise(function (resolve) {
|
|
7526
|
+
var getOrientation = _this.getOrientation.bind(_this);
|
|
7527
|
+
var http = new XMLHttpRequest();
|
|
7528
|
+
http.addEventListener("load", function () {
|
|
7529
|
+
if (http.readyState === 4 && (http.status === ThumbnailService_1.HTTP_STATUS_OK || http.status === 0)) {
|
|
7530
|
+
var orientation_1 = getOrientation(http.response);
|
|
7531
|
+
http = null;
|
|
7532
|
+
resolve(orientation_1);
|
|
7524
7533
|
}
|
|
7525
7534
|
});
|
|
7535
|
+
http.addEventListener("error", function () {
|
|
7536
|
+
http = null;
|
|
7537
|
+
throw new Error("Não foi possível carregar a imagem");
|
|
7538
|
+
});
|
|
7539
|
+
http.open("GET", img.src, true);
|
|
7540
|
+
http.responseType = "arraybuffer";
|
|
7541
|
+
http.send(null);
|
|
7526
7542
|
});
|
|
7527
7543
|
};
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7544
|
+
/**
|
|
7545
|
+
* 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.
|
|
7546
|
+
*/
|
|
7547
|
+
ThumbnailService.prototype.getOrientation = function (file) {
|
|
7548
|
+
var view = new DataView(file);
|
|
7549
|
+
if (view.getUint16(0, false) !== ThumbnailService_1.JPEG_MARKER) {
|
|
7550
|
+
return ThumbnailService_1.NOT_JPEG;
|
|
7551
|
+
}
|
|
7552
|
+
var length = view.byteLength;
|
|
7553
|
+
var offset = ThumbnailService_1.INITIAL_OFFSET;
|
|
7554
|
+
while (offset < length) {
|
|
7555
|
+
var marker = view.getUint16(offset, false);
|
|
7556
|
+
offset += ThumbnailService_1.INITIAL_OFFSET;
|
|
7557
|
+
if (marker === ThumbnailService_1.EXIF_MARKER) {
|
|
7558
|
+
var orientation_2 = this.extractOrientationFromExif(view, offset);
|
|
7559
|
+
if (orientation_2 !== null) {
|
|
7560
|
+
return orientation_2;
|
|
7538
7561
|
}
|
|
7539
|
-
|
|
7540
|
-
|
|
7562
|
+
return ThumbnailService_1.NOT_DEFINED;
|
|
7563
|
+
}
|
|
7564
|
+
// tslint:disable-next-line: no-bitwise
|
|
7565
|
+
if ((marker & ThumbnailService_1.MARKER_MASK) !== ThumbnailService_1.MARKER_MASK) {
|
|
7566
|
+
break;
|
|
7567
|
+
}
|
|
7568
|
+
offset += view.getUint16(offset, false);
|
|
7569
|
+
}
|
|
7570
|
+
return ThumbnailService_1.NOT_DEFINED;
|
|
7541
7571
|
};
|
|
7542
|
-
|
|
7572
|
+
ThumbnailService.prototype.extractOrientationFromExif = function (view, initialOffset) {
|
|
7573
|
+
var offset = initialOffset;
|
|
7574
|
+
offset += ThumbnailService_1.INITIAL_OFFSET;
|
|
7575
|
+
if (view.getUint32(offset, false) !== ThumbnailService_1.EXIF_SIGNATURE) {
|
|
7576
|
+
return null;
|
|
7577
|
+
}
|
|
7578
|
+
offset += ThumbnailService_1.EXIF_OFFSET;
|
|
7579
|
+
var little = view.getUint16(offset, false) === ThumbnailService_1.LITTLE_ENDIAN_MARKER;
|
|
7580
|
+
offset += view.getUint32(offset + 4, little);
|
|
7581
|
+
var tags = view.getUint16(offset, little);
|
|
7582
|
+
offset += ThumbnailService_1.INITIAL_OFFSET;
|
|
7583
|
+
for (var i = 0; i < tags; i++) {
|
|
7584
|
+
var tagOffset = offset + i * ThumbnailService_1.TAG_SIZE;
|
|
7585
|
+
if (view.getUint16(tagOffset, little) === ThumbnailService_1.ORIENTATION_TAG) {
|
|
7586
|
+
return view.getUint16(tagOffset + ThumbnailService_1.TAG_VALUE_OFFSET, little);
|
|
7587
|
+
}
|
|
7588
|
+
}
|
|
7589
|
+
return null;
|
|
7590
|
+
};
|
|
7591
|
+
var ThumbnailService_1;
|
|
7592
|
+
ThumbnailService.HTTP_STATUS_OK = 200;
|
|
7593
|
+
ThumbnailService.JPEG_MARKER = 0xffd8;
|
|
7594
|
+
ThumbnailService.EXIF_MARKER = 0xffe1;
|
|
7595
|
+
ThumbnailService.EXIF_SIGNATURE = 0x45786966;
|
|
7596
|
+
ThumbnailService.LITTLE_ENDIAN_MARKER = 0x4949;
|
|
7597
|
+
ThumbnailService.ORIENTATION_TAG = 0x0112;
|
|
7598
|
+
ThumbnailService.MARKER_MASK = 0xff00;
|
|
7599
|
+
ThumbnailService.NOT_DEFINED = -1;
|
|
7600
|
+
ThumbnailService.NOT_JPEG = -2;
|
|
7601
|
+
ThumbnailService.INITIAL_OFFSET = 2;
|
|
7602
|
+
ThumbnailService.EXIF_OFFSET = 6;
|
|
7603
|
+
ThumbnailService.TAG_SIZE = 12;
|
|
7604
|
+
ThumbnailService.TAG_VALUE_OFFSET = 8;
|
|
7605
|
+
ThumbnailService = ThumbnailService_1 = __decorate([
|
|
7606
|
+
Injectable()
|
|
7607
|
+
], ThumbnailService);
|
|
7608
|
+
return ThumbnailService;
|
|
7543
7609
|
}());
|
|
7544
7610
|
|
|
7545
|
-
var
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7611
|
+
var ThumbnailComponent = /** @class */ (function () {
|
|
7612
|
+
function ThumbnailComponent(thumbnailService) {
|
|
7613
|
+
this.thumbnailService = thumbnailService;
|
|
7614
|
+
this.fallback = false;
|
|
7615
|
+
this.id = "s-thumbnail-" + ThumbnailComponent_1.getNextId();
|
|
7616
|
+
this.size = ThumbnailSize.Medium;
|
|
7617
|
+
this.iconClass = "far fa-image";
|
|
7618
|
+
this.hasAction = false;
|
|
7619
|
+
this.actionIconClass = "fas fa-camera";
|
|
7620
|
+
this.isTile = false;
|
|
7621
|
+
this.isBrand = false;
|
|
7622
|
+
this.ngUnsubscribe = new Subject();
|
|
7552
7623
|
}
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
switch (_a.label) {
|
|
7558
|
-
case 0: return [4 /*yield*/, _super.prototype.get.call(this, this.FILTERS_KEY)];
|
|
7559
|
-
case 1:
|
|
7560
|
-
store = (_a.sent()) || {};
|
|
7561
|
-
this.removeEmptyValues(filters);
|
|
7562
|
-
store[key] = filters;
|
|
7563
|
-
return [4 /*yield*/, _super.prototype.store.call(this, this.FILTERS_KEY, store)];
|
|
7564
|
-
case 2:
|
|
7565
|
-
_a.sent();
|
|
7566
|
-
return [2 /*return*/];
|
|
7567
|
-
}
|
|
7568
|
-
});
|
|
7569
|
-
});
|
|
7570
|
-
};
|
|
7571
|
-
FiltersStorageService.prototype.getFilters = function (key) {
|
|
7572
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
7573
|
-
var store;
|
|
7574
|
-
return __generator(this, function (_a) {
|
|
7575
|
-
switch (_a.label) {
|
|
7576
|
-
case 0: return [4 /*yield*/, _super.prototype.get.call(this, this.FILTERS_KEY)];
|
|
7577
|
-
case 1:
|
|
7578
|
-
store = (_a.sent()) || {};
|
|
7579
|
-
return [2 /*return*/, store[key] || {}];
|
|
7580
|
-
}
|
|
7581
|
-
});
|
|
7582
|
-
});
|
|
7624
|
+
ThumbnailComponent_1 = ThumbnailComponent;
|
|
7625
|
+
ThumbnailComponent.prototype.ngOnDestroy = function () {
|
|
7626
|
+
this.ngUnsubscribe.next();
|
|
7627
|
+
this.ngUnsubscribe.complete();
|
|
7583
7628
|
};
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
store = (_a.sent()) || {};
|
|
7592
|
-
delete store[key];
|
|
7593
|
-
return [4 /*yield*/, _super.prototype.store.call(this, this.FILTERS_KEY, store)];
|
|
7594
|
-
case 2:
|
|
7595
|
-
_a.sent();
|
|
7596
|
-
return [2 /*return*/];
|
|
7597
|
-
}
|
|
7629
|
+
ThumbnailComponent.prototype.ngAfterViewInit = function () {
|
|
7630
|
+
var _this = this;
|
|
7631
|
+
if (this.imgEl) {
|
|
7632
|
+
this.imgEl.nativeElement.addEventListener("load", function () {
|
|
7633
|
+
from(_this.thumbnailService.getBinaryFile(_this.imgEl.nativeElement))
|
|
7634
|
+
.pipe(takeUntil(_this.ngUnsubscribe))
|
|
7635
|
+
.subscribe(function (orientation) { return (_this.orientation = orientation); });
|
|
7598
7636
|
});
|
|
7599
|
-
}
|
|
7637
|
+
}
|
|
7600
7638
|
};
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
case 0: return [4 /*yield*/, this.storeFilters(key, filters)];
|
|
7606
|
-
case 1:
|
|
7607
|
-
_a.sent();
|
|
7608
|
-
return [2 /*return*/];
|
|
7609
|
-
}
|
|
7610
|
-
});
|
|
7611
|
-
});
|
|
7639
|
+
ThumbnailComponent.getNextId = function () {
|
|
7640
|
+
var id = ThumbnailComponent_1.nextId;
|
|
7641
|
+
ThumbnailComponent_1.nextId++;
|
|
7642
|
+
return id;
|
|
7612
7643
|
};
|
|
7613
|
-
|
|
7614
|
-
var
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
delete filters[field];
|
|
7618
|
-
}
|
|
7619
|
-
});
|
|
7644
|
+
ThumbnailComponent.prototype.getImageAltText = function () {
|
|
7645
|
+
var altText = this.imageAlt || '';
|
|
7646
|
+
// Remove a palavra "image" ou "imagem" para evitar redundância
|
|
7647
|
+
return altText.replace(/\bimage\b/gi, '').replace(/\bimagem\b/gi, '').trim();
|
|
7620
7648
|
};
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
return true;
|
|
7624
|
-
}
|
|
7625
|
-
if (Array.isArray(field)) {
|
|
7626
|
-
return field.length === 0;
|
|
7627
|
-
}
|
|
7628
|
-
if (typeof field === "string") {
|
|
7629
|
-
return field.trim() === "";
|
|
7630
|
-
}
|
|
7631
|
-
if (typeof field === "object") {
|
|
7632
|
-
return Object.keys(field).length === 0;
|
|
7633
|
-
}
|
|
7634
|
-
return false;
|
|
7649
|
+
ThumbnailComponent.prototype.onImageError = function () {
|
|
7650
|
+
this.fallback = true;
|
|
7635
7651
|
};
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
return {};
|
|
7639
|
-
}
|
|
7640
|
-
Object.keys(values).forEach(function (fieldValue) {
|
|
7641
|
-
var field = fields.find(function (it) { return it.name == fieldValue; });
|
|
7642
|
-
if (field) {
|
|
7643
|
-
var val = values[fieldValue];
|
|
7644
|
-
if (!val)
|
|
7645
|
-
return;
|
|
7646
|
-
switch (field.type) {
|
|
7647
|
-
case FieldType.Integer:
|
|
7648
|
-
case FieldType.Double:
|
|
7649
|
-
case FieldType.Money:
|
|
7650
|
-
if (typeof val !== "number")
|
|
7651
|
-
delete values[fieldValue];
|
|
7652
|
-
break;
|
|
7653
|
-
case FieldType.Boolean:
|
|
7654
|
-
if (typeof val !== "boolean")
|
|
7655
|
-
delete values[fieldValue];
|
|
7656
|
-
break;
|
|
7657
|
-
case FieldType.Date:
|
|
7658
|
-
case FieldType.DateTime:
|
|
7659
|
-
case FieldType.Time:
|
|
7660
|
-
if (!moment$1(val, moment$1.ISO_8601, true).isValid())
|
|
7661
|
-
delete values[fieldValue];
|
|
7662
|
-
break;
|
|
7663
|
-
case FieldType.String:
|
|
7664
|
-
case FieldType.Text:
|
|
7665
|
-
if (typeof val !== "string")
|
|
7666
|
-
delete values[fieldValue];
|
|
7667
|
-
break;
|
|
7668
|
-
case FieldType.Lookup:
|
|
7669
|
-
case FieldType.Autocomplete:
|
|
7670
|
-
if (field.multiple) {
|
|
7671
|
-
if (!(Array.isArray(val) && val.length))
|
|
7672
|
-
delete values[fieldValue];
|
|
7673
|
-
}
|
|
7674
|
-
else {
|
|
7675
|
-
if (!(val instanceof Object))
|
|
7676
|
-
delete values[fieldValue];
|
|
7677
|
-
}
|
|
7678
|
-
break;
|
|
7679
|
-
case FieldType.Enum:
|
|
7680
|
-
if (field.multiple && !(Array.isArray(val) && val.length)) {
|
|
7681
|
-
delete values[fieldValue];
|
|
7682
|
-
}
|
|
7683
|
-
break;
|
|
7684
|
-
case FieldType.Chips:
|
|
7685
|
-
if (!(Array.isArray(val) && val.length)) {
|
|
7686
|
-
delete values[fieldValue];
|
|
7687
|
-
}
|
|
7688
|
-
break;
|
|
7689
|
-
default:
|
|
7690
|
-
break;
|
|
7691
|
-
}
|
|
7692
|
-
}
|
|
7693
|
-
});
|
|
7694
|
-
return values;
|
|
7652
|
+
ThumbnailComponent.prototype.onFallbackError = function () {
|
|
7653
|
+
this.imageFallback = null;
|
|
7695
7654
|
};
|
|
7696
|
-
|
|
7697
|
-
|
|
7655
|
+
var ThumbnailComponent_1;
|
|
7656
|
+
ThumbnailComponent.nextId = 0;
|
|
7657
|
+
ThumbnailComponent.ctorParameters = function () { return [
|
|
7658
|
+
{ type: ThumbnailService }
|
|
7659
|
+
]; };
|
|
7660
|
+
__decorate([
|
|
7661
|
+
ViewChild("img", { static: false })
|
|
7662
|
+
], ThumbnailComponent.prototype, "imgEl", void 0);
|
|
7663
|
+
__decorate([
|
|
7664
|
+
Input()
|
|
7665
|
+
], ThumbnailComponent.prototype, "id", void 0);
|
|
7666
|
+
__decorate([
|
|
7667
|
+
Input()
|
|
7668
|
+
], ThumbnailComponent.prototype, "size", void 0);
|
|
7669
|
+
__decorate([
|
|
7670
|
+
Input()
|
|
7671
|
+
], ThumbnailComponent.prototype, "imageSource", void 0);
|
|
7672
|
+
__decorate([
|
|
7673
|
+
Input()
|
|
7674
|
+
], ThumbnailComponent.prototype, "imageFallback", void 0);
|
|
7675
|
+
__decorate([
|
|
7676
|
+
Input()
|
|
7677
|
+
], ThumbnailComponent.prototype, "imageAlt", void 0);
|
|
7678
|
+
__decorate([
|
|
7679
|
+
Input()
|
|
7680
|
+
], ThumbnailComponent.prototype, "iconClass", void 0);
|
|
7681
|
+
__decorate([
|
|
7682
|
+
Input()
|
|
7683
|
+
], ThumbnailComponent.prototype, "hasAction", void 0);
|
|
7684
|
+
__decorate([
|
|
7685
|
+
Input()
|
|
7686
|
+
], ThumbnailComponent.prototype, "actionIconClass", void 0);
|
|
7687
|
+
__decorate([
|
|
7688
|
+
Input()
|
|
7689
|
+
], ThumbnailComponent.prototype, "isTile", void 0);
|
|
7690
|
+
__decorate([
|
|
7691
|
+
Input()
|
|
7692
|
+
], ThumbnailComponent.prototype, "isBrand", void 0);
|
|
7693
|
+
ThumbnailComponent = ThumbnailComponent_1 = __decorate([
|
|
7694
|
+
Component({
|
|
7695
|
+
selector: "s-thumbnail",
|
|
7696
|
+
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",
|
|
7697
|
+
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}"]
|
|
7698
|
+
})
|
|
7699
|
+
], ThumbnailComponent);
|
|
7700
|
+
return ThumbnailComponent;
|
|
7701
|
+
}());
|
|
7698
7702
|
|
|
7699
|
-
var
|
|
7700
|
-
|
|
7701
|
-
* Erp Polling
|
|
7702
|
-
* @class ErpPolling
|
|
7703
|
-
*/
|
|
7704
|
-
function ErpPolling() {
|
|
7703
|
+
var ThumbnailModule = /** @class */ (function () {
|
|
7704
|
+
function ThumbnailModule() {
|
|
7705
7705
|
}
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
if (intervalMs === void 0) { intervalMs = 29000; }
|
|
7716
|
-
return interval(intervalMs)
|
|
7717
|
-
.pipe(takeWhile(takeWhileFn), switchMap(calling));
|
|
7718
|
-
};
|
|
7719
|
-
ErpPolling = __decorate([
|
|
7720
|
-
Injectable()
|
|
7721
|
-
/**
|
|
7722
|
-
* Erp Polling
|
|
7723
|
-
* @class ErpPolling
|
|
7724
|
-
*/
|
|
7725
|
-
], ErpPolling);
|
|
7726
|
-
return ErpPolling;
|
|
7706
|
+
ThumbnailModule = __decorate([
|
|
7707
|
+
NgModule({
|
|
7708
|
+
imports: [CommonModule],
|
|
7709
|
+
declarations: [ThumbnailComponent],
|
|
7710
|
+
exports: [ThumbnailComponent],
|
|
7711
|
+
providers: [ThumbnailService],
|
|
7712
|
+
})
|
|
7713
|
+
], ThumbnailModule);
|
|
7714
|
+
return ThumbnailModule;
|
|
7727
7715
|
}());
|
|
7728
7716
|
|
|
7717
|
+
var EnumSeverity;
|
|
7718
|
+
(function (EnumSeverity) {
|
|
7719
|
+
EnumSeverity["Default"] = "Default";
|
|
7720
|
+
EnumSeverity["Info"] = "Info";
|
|
7721
|
+
EnumSeverity["Warn"] = "Warn";
|
|
7722
|
+
EnumSeverity["Error"] = "Error";
|
|
7723
|
+
EnumSeverity["Success"] = "Success";
|
|
7724
|
+
})(EnumSeverity || (EnumSeverity = {}));
|
|
7725
|
+
|
|
7729
7726
|
var Breakpoints = {
|
|
7730
7727
|
SM_MIN: 0,
|
|
7731
7728
|
SM_MAX: 640,
|
|
@@ -7737,16 +7734,72 @@ var Breakpoints = {
|
|
|
7737
7734
|
XL_MAX: Infinity,
|
|
7738
7735
|
};
|
|
7739
7736
|
|
|
7740
|
-
var
|
|
7741
|
-
function
|
|
7742
|
-
|
|
7737
|
+
var ObjectCardFieldComponent = /** @class */ (function () {
|
|
7738
|
+
function ObjectCardFieldComponent() {
|
|
7739
|
+
this.id = "erp-object-card-field-" + ObjectCardFieldComponent_1.getNextId();
|
|
7740
|
+
this.buttonClick = new EventEmitter();
|
|
7743
7741
|
}
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7742
|
+
ObjectCardFieldComponent_1 = ObjectCardFieldComponent;
|
|
7743
|
+
ObjectCardFieldComponent.getNextId = function () {
|
|
7744
|
+
var id = ObjectCardFieldComponent_1.nextId;
|
|
7745
|
+
ObjectCardFieldComponent_1.nextId++;
|
|
7746
|
+
return id;
|
|
7747
|
+
};
|
|
7748
|
+
var ObjectCardFieldComponent_1;
|
|
7749
|
+
ObjectCardFieldComponent.nextId = 0;
|
|
7750
|
+
__decorate([
|
|
7751
|
+
Input()
|
|
7752
|
+
], ObjectCardFieldComponent.prototype, "id", void 0);
|
|
7753
|
+
__decorate([
|
|
7754
|
+
Input()
|
|
7755
|
+
], ObjectCardFieldComponent.prototype, "imageSource", void 0);
|
|
7756
|
+
__decorate([
|
|
7757
|
+
Input()
|
|
7758
|
+
], ObjectCardFieldComponent.prototype, "imageAlt", void 0);
|
|
7759
|
+
__decorate([
|
|
7760
|
+
Input()
|
|
7761
|
+
], ObjectCardFieldComponent.prototype, "iconClass", void 0);
|
|
7762
|
+
__decorate([
|
|
7763
|
+
Input()
|
|
7764
|
+
], ObjectCardFieldComponent.prototype, "label", void 0);
|
|
7765
|
+
__decorate([
|
|
7766
|
+
Input()
|
|
7767
|
+
], ObjectCardFieldComponent.prototype, "description", void 0);
|
|
7768
|
+
__decorate([
|
|
7769
|
+
Input()
|
|
7770
|
+
], ObjectCardFieldComponent.prototype, "buttonLabel", void 0);
|
|
7771
|
+
__decorate([
|
|
7772
|
+
Input()
|
|
7773
|
+
], ObjectCardFieldComponent.prototype, "buttonModel", void 0);
|
|
7774
|
+
__decorate([
|
|
7775
|
+
Output()
|
|
7776
|
+
], ObjectCardFieldComponent.prototype, "buttonClick", void 0);
|
|
7777
|
+
__decorate([
|
|
7778
|
+
ContentChild(ThumbnailComponent, { static: true })
|
|
7779
|
+
], ObjectCardFieldComponent.prototype, "thumbnailComponent", void 0);
|
|
7780
|
+
__decorate([
|
|
7781
|
+
ViewChild(TemplateRef, { static: true })
|
|
7782
|
+
], ObjectCardFieldComponent.prototype, "content", void 0);
|
|
7783
|
+
ObjectCardFieldComponent = ObjectCardFieldComponent_1 = __decorate([
|
|
7784
|
+
Component({
|
|
7785
|
+
selector: "erp-object-card-field",
|
|
7786
|
+
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",
|
|
7787
|
+
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}"]
|
|
7788
|
+
})
|
|
7789
|
+
], ObjectCardFieldComponent);
|
|
7790
|
+
return ObjectCardFieldComponent;
|
|
7791
|
+
}());
|
|
7792
|
+
|
|
7793
|
+
var ExportUtils = /** @class */ (function () {
|
|
7794
|
+
function ExportUtils() {
|
|
7795
|
+
throw new Error("Classe não deve ser instanciada.");
|
|
7796
|
+
}
|
|
7797
|
+
ExportUtils.exportCSV = function (columns, data, csvSeparator, documentName) {
|
|
7798
|
+
var _this = this;
|
|
7799
|
+
if (columns === void 0) { columns = []; }
|
|
7800
|
+
if (data === void 0) { data = []; }
|
|
7801
|
+
if (csvSeparator === void 0) { csvSeparator = ";"; }
|
|
7802
|
+
if (documentName === void 0) { documentName = "download"; }
|
|
7750
7803
|
var csv = "\ufeff";
|
|
7751
7804
|
columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
|
|
7752
7805
|
csv += "\"" + (column.header || column.field) + "\"";
|
|
@@ -7891,7 +7944,7 @@ var FormUtilsService = /** @class */ (function () {
|
|
|
7891
7944
|
*/
|
|
7892
7945
|
FormUtilsService.prototype.getFormFormattedDate = function (date, format) {
|
|
7893
7946
|
if (format === void 0) { format = "YYYY-MM-DDT00:00:00"; }
|
|
7894
|
-
return date ? new Date(
|
|
7947
|
+
return date ? new Date(moment$2(date).format(format)) : undefined;
|
|
7895
7948
|
};
|
|
7896
7949
|
/**
|
|
7897
7950
|
* Method to format dates in a string
|
|
@@ -7901,7 +7954,7 @@ var FormUtilsService = /** @class */ (function () {
|
|
|
7901
7954
|
*/
|
|
7902
7955
|
FormUtilsService.prototype.getEntityFormattedDate = function (date, format) {
|
|
7903
7956
|
if (format === void 0) { format = "YYYY-MM-DD"; }
|
|
7904
|
-
return date ?
|
|
7957
|
+
return date ? moment$2(date).format(format) : undefined;
|
|
7905
7958
|
};
|
|
7906
7959
|
/**
|
|
7907
7960
|
* Method to get a object with only the lookup id
|
|
@@ -8177,6 +8230,570 @@ var HTTP_STATUS_CODE = {
|
|
|
8177
8230
|
GENERIC_ERROR: 600
|
|
8178
8231
|
};
|
|
8179
8232
|
|
|
8233
|
+
var ObjectCardMainComponent = /** @class */ (function () {
|
|
8234
|
+
function ObjectCardMainComponent() {
|
|
8235
|
+
this.id = "erp-object-card-main-" + ObjectCardMainComponent_1.getNextId();
|
|
8236
|
+
this.iconClass = "fa fa-picture-o";
|
|
8237
|
+
this.hasThumbnail = true;
|
|
8238
|
+
this.hasDescription = true;
|
|
8239
|
+
this.isBrand = false;
|
|
8240
|
+
this.expandableImage = false;
|
|
8241
|
+
this.buttonClick = new EventEmitter();
|
|
8242
|
+
this.showImageModal = false;
|
|
8243
|
+
this.loadingFullImage = false;
|
|
8244
|
+
this._thumbnailSize = ThumbnailSize.Medium;
|
|
8245
|
+
}
|
|
8246
|
+
ObjectCardMainComponent_1 = ObjectCardMainComponent;
|
|
8247
|
+
Object.defineProperty(ObjectCardMainComponent.prototype, "thumbnailSize", {
|
|
8248
|
+
get: function () {
|
|
8249
|
+
return this._thumbnailSize;
|
|
8250
|
+
},
|
|
8251
|
+
set: function (value) {
|
|
8252
|
+
this._thumbnailSize = value;
|
|
8253
|
+
if (this.thumbnailComponent) {
|
|
8254
|
+
this.thumbnailComponent.size = value;
|
|
8255
|
+
}
|
|
8256
|
+
},
|
|
8257
|
+
enumerable: true,
|
|
8258
|
+
configurable: true
|
|
8259
|
+
});
|
|
8260
|
+
ObjectCardMainComponent.prototype.onResize = function () {
|
|
8261
|
+
this.update();
|
|
8262
|
+
};
|
|
8263
|
+
ObjectCardMainComponent.prototype.ngAfterContentInit = function () {
|
|
8264
|
+
this.update();
|
|
8265
|
+
};
|
|
8266
|
+
ObjectCardMainComponent.prototype.update = function () {
|
|
8267
|
+
var windowWidth = window.innerWidth;
|
|
8268
|
+
if (windowWidth <= Breakpoints.SM_MAX) {
|
|
8269
|
+
this.thumbnailSize = ThumbnailSize.Small;
|
|
8270
|
+
}
|
|
8271
|
+
else {
|
|
8272
|
+
this.thumbnailSize = ThumbnailSize.Medium;
|
|
8273
|
+
}
|
|
8274
|
+
};
|
|
8275
|
+
ObjectCardMainComponent.getNextId = function () {
|
|
8276
|
+
var id = ObjectCardMainComponent_1.nextId;
|
|
8277
|
+
ObjectCardMainComponent_1.nextId++;
|
|
8278
|
+
return id;
|
|
8279
|
+
};
|
|
8280
|
+
ObjectCardMainComponent.prototype.getImageAltText = function () {
|
|
8281
|
+
var altText = this.imageAlt || this.label || '';
|
|
8282
|
+
return altText.replace(/\bimage\b/gi, '').replace(/\bimagem\b/gi, '').trim();
|
|
8283
|
+
};
|
|
8284
|
+
ObjectCardMainComponent.prototype.openImageModal = function () {
|
|
8285
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8286
|
+
var _a;
|
|
8287
|
+
return __generator(this, function (_b) {
|
|
8288
|
+
switch (_b.label) {
|
|
8289
|
+
case 0:
|
|
8290
|
+
if (!this.expandableImage || !this.imageSource) {
|
|
8291
|
+
return [2 /*return*/];
|
|
8292
|
+
}
|
|
8293
|
+
this.showImageModal = true;
|
|
8294
|
+
_a = this;
|
|
8295
|
+
return [4 /*yield*/, this.resolveFullImageSource()];
|
|
8296
|
+
case 1:
|
|
8297
|
+
_a.fullImageSource = _b.sent();
|
|
8298
|
+
return [2 /*return*/];
|
|
8299
|
+
}
|
|
8300
|
+
});
|
|
8301
|
+
});
|
|
8302
|
+
};
|
|
8303
|
+
ObjectCardMainComponent.prototype.resolveFullImageSource = function () {
|
|
8304
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8305
|
+
var result, error_1;
|
|
8306
|
+
return __generator(this, function (_a) {
|
|
8307
|
+
switch (_a.label) {
|
|
8308
|
+
case 0:
|
|
8309
|
+
if (!this.imageLoader || this.fullImageSource) {
|
|
8310
|
+
return [2 /*return*/, this.fullImageSource || this.imageSource];
|
|
8311
|
+
}
|
|
8312
|
+
this.loadingFullImage = true;
|
|
8313
|
+
_a.label = 1;
|
|
8314
|
+
case 1:
|
|
8315
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
8316
|
+
result = this.imageLoader();
|
|
8317
|
+
return [4 /*yield*/, (result instanceof Promise ? result : result.toPromise())];
|
|
8318
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
8319
|
+
case 3:
|
|
8320
|
+
error_1 = _a.sent();
|
|
8321
|
+
console.error('Erro ao carregar imagem completa:', error_1);
|
|
8322
|
+
return [2 /*return*/, this.imageSource];
|
|
8323
|
+
case 4:
|
|
8324
|
+
this.loadingFullImage = false;
|
|
8325
|
+
return [7 /*endfinally*/];
|
|
8326
|
+
case 5: return [2 /*return*/];
|
|
8327
|
+
}
|
|
8328
|
+
});
|
|
8329
|
+
});
|
|
8330
|
+
};
|
|
8331
|
+
var ObjectCardMainComponent_1;
|
|
8332
|
+
ObjectCardMainComponent.nextId = 0;
|
|
8333
|
+
__decorate([
|
|
8334
|
+
Input()
|
|
8335
|
+
], ObjectCardMainComponent.prototype, "id", void 0);
|
|
8336
|
+
__decorate([
|
|
8337
|
+
Input()
|
|
8338
|
+
], ObjectCardMainComponent.prototype, "imageSource", void 0);
|
|
8339
|
+
__decorate([
|
|
8340
|
+
Input()
|
|
8341
|
+
], ObjectCardMainComponent.prototype, "imageFallback", void 0);
|
|
8342
|
+
__decorate([
|
|
8343
|
+
Input()
|
|
8344
|
+
], ObjectCardMainComponent.prototype, "imageAlt", void 0);
|
|
8345
|
+
__decorate([
|
|
8346
|
+
Input()
|
|
8347
|
+
], ObjectCardMainComponent.prototype, "iconClass", void 0);
|
|
8348
|
+
__decorate([
|
|
8349
|
+
Input()
|
|
8350
|
+
], ObjectCardMainComponent.prototype, "hasThumbnail", void 0);
|
|
8351
|
+
__decorate([
|
|
8352
|
+
Input()
|
|
8353
|
+
], ObjectCardMainComponent.prototype, "hasDescription", void 0);
|
|
8354
|
+
__decorate([
|
|
8355
|
+
Input()
|
|
8356
|
+
], ObjectCardMainComponent.prototype, "isBrand", void 0);
|
|
8357
|
+
__decorate([
|
|
8358
|
+
Input()
|
|
8359
|
+
], ObjectCardMainComponent.prototype, "expandableImage", void 0);
|
|
8360
|
+
__decorate([
|
|
8361
|
+
Input()
|
|
8362
|
+
], ObjectCardMainComponent.prototype, "imageLoader", void 0);
|
|
8363
|
+
__decorate([
|
|
8364
|
+
Input()
|
|
8365
|
+
], ObjectCardMainComponent.prototype, "label", void 0);
|
|
8366
|
+
__decorate([
|
|
8367
|
+
Input()
|
|
8368
|
+
], ObjectCardMainComponent.prototype, "description", void 0);
|
|
8369
|
+
__decorate([
|
|
8370
|
+
Input()
|
|
8371
|
+
], ObjectCardMainComponent.prototype, "buttonLabel", void 0);
|
|
8372
|
+
__decorate([
|
|
8373
|
+
Input()
|
|
8374
|
+
], ObjectCardMainComponent.prototype, "buttonModel", void 0);
|
|
8375
|
+
__decorate([
|
|
8376
|
+
Output()
|
|
8377
|
+
], ObjectCardMainComponent.prototype, "buttonClick", void 0);
|
|
8378
|
+
__decorate([
|
|
8379
|
+
ContentChild(ThumbnailComponent, { static: true })
|
|
8380
|
+
], ObjectCardMainComponent.prototype, "thumbnailComponent", void 0);
|
|
8381
|
+
__decorate([
|
|
8382
|
+
HostListener("window:resize")
|
|
8383
|
+
], ObjectCardMainComponent.prototype, "onResize", null);
|
|
8384
|
+
ObjectCardMainComponent = ObjectCardMainComponent_1 = __decorate([
|
|
8385
|
+
Component({
|
|
8386
|
+
selector: "erp-object-card-main",
|
|
8387
|
+
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",
|
|
8388
|
+
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}"]
|
|
8389
|
+
})
|
|
8390
|
+
], ObjectCardMainComponent);
|
|
8391
|
+
return ObjectCardMainComponent;
|
|
8392
|
+
}());
|
|
8393
|
+
|
|
8394
|
+
var ObjectCardComponent = /** @class */ (function () {
|
|
8395
|
+
function ObjectCardComponent() {
|
|
8396
|
+
this.id = "erp-object-card-" + ObjectCardComponent_1.getNextId();
|
|
8397
|
+
this.expanded = false;
|
|
8398
|
+
this.expandTooltip = "Abrir painel";
|
|
8399
|
+
this.collapseTooltip = "Fechar painel";
|
|
8400
|
+
this.fieldsMinWidth = 200;
|
|
8401
|
+
this.expandedChange = new EventEmitter();
|
|
8402
|
+
this.maxVisibleFields = 0;
|
|
8403
|
+
this.severity = EnumSeverity.Default;
|
|
8404
|
+
this.EnumSeverity = EnumSeverity;
|
|
8405
|
+
}
|
|
8406
|
+
ObjectCardComponent_1 = ObjectCardComponent;
|
|
8407
|
+
ObjectCardComponent.prototype.ngAfterContentChecked = function () {
|
|
8408
|
+
this.update();
|
|
8409
|
+
};
|
|
8410
|
+
ObjectCardComponent.prototype.update = function () {
|
|
8411
|
+
var windowWidth = window.innerWidth;
|
|
8412
|
+
var containerWidth = this.container.nativeElement.getBoundingClientRect().width;
|
|
8413
|
+
var mainFieldWidth = this.cardMainContainer.nativeElement.getBoundingClientRect().width;
|
|
8414
|
+
var remainingSpace = containerWidth - mainFieldWidth;
|
|
8415
|
+
var fieldsMinWidth = this.fieldsMinWidth;
|
|
8416
|
+
var expandIconWidth = this.iconContainer.nativeElement.getBoundingClientRect().width;
|
|
8417
|
+
var maxFieldQtd;
|
|
8418
|
+
if (windowWidth <= Breakpoints.SM_MAX) {
|
|
8419
|
+
maxFieldQtd = 0;
|
|
8420
|
+
}
|
|
8421
|
+
else {
|
|
8422
|
+
maxFieldQtd = Math.floor((remainingSpace) / fieldsMinWidth);
|
|
8423
|
+
}
|
|
8424
|
+
var hasExpandIcon = maxFieldQtd && maxFieldQtd < this.fields.length;
|
|
8425
|
+
if (hasExpandIcon) {
|
|
8426
|
+
this.iconContainer.nativeElement.style.display = 'flex';
|
|
8427
|
+
remainingSpace = remainingSpace - expandIconWidth;
|
|
8428
|
+
maxFieldQtd = Math.floor((remainingSpace) / fieldsMinWidth);
|
|
8429
|
+
}
|
|
8430
|
+
else {
|
|
8431
|
+
this.iconContainer.nativeElement.style.display = 'none';
|
|
8432
|
+
}
|
|
8433
|
+
this.maxVisibleFields = maxFieldQtd;
|
|
8434
|
+
if (maxFieldQtd >= this.fields.length && this.expanded) {
|
|
8435
|
+
this.collapse();
|
|
8436
|
+
}
|
|
8437
|
+
};
|
|
8438
|
+
ObjectCardComponent.prototype.toggle = function () {
|
|
8439
|
+
this.expanded ? this.collapse() : this.expand();
|
|
8440
|
+
};
|
|
8441
|
+
ObjectCardComponent.prototype.expand = function () {
|
|
8442
|
+
this.expanded = true;
|
|
8443
|
+
this.expandedChange.emit(this.expanded);
|
|
8444
|
+
};
|
|
8445
|
+
ObjectCardComponent.prototype.collapse = function () {
|
|
8446
|
+
this.expanded = false;
|
|
8447
|
+
this.expandedChange.emit(this.expanded);
|
|
8448
|
+
};
|
|
8449
|
+
ObjectCardComponent.getNextId = function () {
|
|
8450
|
+
var id = ObjectCardComponent_1.nextId;
|
|
8451
|
+
ObjectCardComponent_1.nextId++;
|
|
8452
|
+
return id;
|
|
8453
|
+
};
|
|
8454
|
+
var ObjectCardComponent_1;
|
|
8455
|
+
ObjectCardComponent.nextId = 0;
|
|
8456
|
+
__decorate([
|
|
8457
|
+
Input()
|
|
8458
|
+
], ObjectCardComponent.prototype, "id", void 0);
|
|
8459
|
+
__decorate([
|
|
8460
|
+
Input()
|
|
8461
|
+
], ObjectCardComponent.prototype, "expanded", void 0);
|
|
8462
|
+
__decorate([
|
|
8463
|
+
Input()
|
|
8464
|
+
], ObjectCardComponent.prototype, "expandTooltip", void 0);
|
|
8465
|
+
__decorate([
|
|
8466
|
+
Input()
|
|
8467
|
+
], ObjectCardComponent.prototype, "collapseTooltip", void 0);
|
|
8468
|
+
__decorate([
|
|
8469
|
+
Input()
|
|
8470
|
+
], ObjectCardComponent.prototype, "fieldsMinWidth", void 0);
|
|
8471
|
+
__decorate([
|
|
8472
|
+
Output()
|
|
8473
|
+
], ObjectCardComponent.prototype, "expandedChange", void 0);
|
|
8474
|
+
__decorate([
|
|
8475
|
+
ContentChild(ObjectCardMainComponent, { static: true })
|
|
8476
|
+
], ObjectCardComponent.prototype, "main", void 0);
|
|
8477
|
+
__decorate([
|
|
8478
|
+
ContentChildren(ObjectCardFieldComponent, { descendants: true })
|
|
8479
|
+
], ObjectCardComponent.prototype, "fields", void 0);
|
|
8480
|
+
__decorate([
|
|
8481
|
+
Input()
|
|
8482
|
+
], ObjectCardComponent.prototype, "severity", void 0);
|
|
8483
|
+
__decorate([
|
|
8484
|
+
Input()
|
|
8485
|
+
], ObjectCardComponent.prototype, "borderButtonOptions", void 0);
|
|
8486
|
+
__decorate([
|
|
8487
|
+
ViewChild('contentContainer', { static: true })
|
|
8488
|
+
], ObjectCardComponent.prototype, "container", void 0);
|
|
8489
|
+
__decorate([
|
|
8490
|
+
ViewChild('cardMainContainer', { static: true })
|
|
8491
|
+
], ObjectCardComponent.prototype, "cardMainContainer", void 0);
|
|
8492
|
+
__decorate([
|
|
8493
|
+
ViewChild('iconContainer', { static: true })
|
|
8494
|
+
], ObjectCardComponent.prototype, "iconContainer", void 0);
|
|
8495
|
+
ObjectCardComponent = ObjectCardComponent_1 = __decorate([
|
|
8496
|
+
Component({
|
|
8497
|
+
selector: "erp-object-card",
|
|
8498
|
+
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",
|
|
8499
|
+
animations: [
|
|
8500
|
+
trigger("expandableContent", [
|
|
8501
|
+
state("*", style({
|
|
8502
|
+
height: "0",
|
|
8503
|
+
})),
|
|
8504
|
+
state("false", style({
|
|
8505
|
+
height: "0",
|
|
8506
|
+
})),
|
|
8507
|
+
state("true", style({
|
|
8508
|
+
height: "*",
|
|
8509
|
+
})),
|
|
8510
|
+
transition("* => true", animate("200ms ease-out")),
|
|
8511
|
+
transition("false <=> true", animate("200ms ease-out")),
|
|
8512
|
+
]),
|
|
8513
|
+
trigger("BorderButtonAnimation", [
|
|
8514
|
+
transition(":enter", [
|
|
8515
|
+
style({ transform: "scaleY(0)", opacity: 0 }),
|
|
8516
|
+
animate("300ms ease", style({ transform: "scaleY(1)", opacity: 1 })),
|
|
8517
|
+
]),
|
|
8518
|
+
transition(":leave", [
|
|
8519
|
+
style({ transform: "scaleY(1)", opacity: 1 }),
|
|
8520
|
+
animate("300ms ease", style({ transform: "scaleY(0)", opacity: 0 })),
|
|
8521
|
+
]),
|
|
8522
|
+
]),
|
|
8523
|
+
],
|
|
8524
|
+
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}"]
|
|
8525
|
+
})
|
|
8526
|
+
], ObjectCardComponent);
|
|
8527
|
+
return ObjectCardComponent;
|
|
8528
|
+
}());
|
|
8529
|
+
|
|
8530
|
+
var BorderButtonComponent = /** @class */ (function () {
|
|
8531
|
+
function BorderButtonComponent() {
|
|
8532
|
+
this.severity = EnumSeverity.Default;
|
|
8533
|
+
this.EnumSeverity = EnumSeverity;
|
|
8534
|
+
}
|
|
8535
|
+
__decorate([
|
|
8536
|
+
Input()
|
|
8537
|
+
], BorderButtonComponent.prototype, "severity", void 0);
|
|
8538
|
+
__decorate([
|
|
8539
|
+
Input()
|
|
8540
|
+
], BorderButtonComponent.prototype, "options", void 0);
|
|
8541
|
+
BorderButtonComponent = __decorate([
|
|
8542
|
+
Component({
|
|
8543
|
+
selector: "s-border-button",
|
|
8544
|
+
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",
|
|
8545
|
+
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}"]
|
|
8546
|
+
})
|
|
8547
|
+
], BorderButtonComponent);
|
|
8548
|
+
return BorderButtonComponent;
|
|
8549
|
+
}());
|
|
8550
|
+
|
|
8551
|
+
var BorderButtonModule = /** @class */ (function () {
|
|
8552
|
+
function BorderButtonModule() {
|
|
8553
|
+
}
|
|
8554
|
+
BorderButtonModule = __decorate([
|
|
8555
|
+
NgModule({
|
|
8556
|
+
imports: [CommonModule, TooltipModule],
|
|
8557
|
+
declarations: [BorderButtonComponent],
|
|
8558
|
+
exports: [BorderButtonComponent]
|
|
8559
|
+
})
|
|
8560
|
+
], BorderButtonModule);
|
|
8561
|
+
return BorderButtonModule;
|
|
8562
|
+
}());
|
|
8563
|
+
|
|
8564
|
+
var ErpObjectCardModule = /** @class */ (function () {
|
|
8565
|
+
function ErpObjectCardModule() {
|
|
8566
|
+
}
|
|
8567
|
+
ErpObjectCardModule = __decorate([
|
|
8568
|
+
NgModule({
|
|
8569
|
+
imports: [CommonModule, TooltipModule, DialogModule, ThumbnailModule, ButtonModule, LoadingStateModule, BorderButtonModule],
|
|
8570
|
+
declarations: [ObjectCardComponent, ObjectCardMainComponent, ObjectCardFieldComponent],
|
|
8571
|
+
exports: [ThumbnailModule, ObjectCardComponent, ObjectCardMainComponent, ObjectCardFieldComponent],
|
|
8572
|
+
})
|
|
8573
|
+
], ErpObjectCardModule);
|
|
8574
|
+
return ErpObjectCardModule;
|
|
8575
|
+
}());
|
|
8576
|
+
|
|
8577
|
+
var StorageService = /** @class */ (function () {
|
|
8578
|
+
function StorageService() {
|
|
8579
|
+
this.GET_USER_ID = user.getUserData().then(function (user) { return user.id; });
|
|
8580
|
+
}
|
|
8581
|
+
StorageService.prototype.store = function (key, value) {
|
|
8582
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8583
|
+
var _a, _b;
|
|
8584
|
+
return __generator(this, function (_c) {
|
|
8585
|
+
switch (_c.label) {
|
|
8586
|
+
case 0:
|
|
8587
|
+
_b = (_a = localStorage).setItem;
|
|
8588
|
+
return [4 /*yield*/, this.GET_USER_ID];
|
|
8589
|
+
case 1:
|
|
8590
|
+
_b.apply(_a, [(_c.sent()) + "_" + key, JSON.stringify(value)]);
|
|
8591
|
+
return [2 /*return*/];
|
|
8592
|
+
}
|
|
8593
|
+
});
|
|
8594
|
+
});
|
|
8595
|
+
};
|
|
8596
|
+
StorageService.prototype.get = function (key) {
|
|
8597
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8598
|
+
var _a, _b, _c, _d;
|
|
8599
|
+
return __generator(this, function (_e) {
|
|
8600
|
+
switch (_e.label) {
|
|
8601
|
+
case 0:
|
|
8602
|
+
_b = (_a = JSON).parse;
|
|
8603
|
+
_d = (_c = localStorage).getItem;
|
|
8604
|
+
return [4 /*yield*/, this.GET_USER_ID];
|
|
8605
|
+
case 1: return [2 /*return*/, _b.apply(_a, [_d.apply(_c, [(_e.sent()) + "_" + key])]) || {}];
|
|
8606
|
+
}
|
|
8607
|
+
});
|
|
8608
|
+
});
|
|
8609
|
+
};
|
|
8610
|
+
return StorageService;
|
|
8611
|
+
}());
|
|
8612
|
+
|
|
8613
|
+
var moment$1 = moment$2; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
8614
|
+
var FiltersStorageService = /** @class */ (function (_super) {
|
|
8615
|
+
__extends(FiltersStorageService, _super);
|
|
8616
|
+
function FiltersStorageService() {
|
|
8617
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
8618
|
+
_this.FILTERS_KEY = "SENIOR_FILTERS";
|
|
8619
|
+
return _this;
|
|
8620
|
+
}
|
|
8621
|
+
FiltersStorageService.prototype.storeFilters = function (key, filters) {
|
|
8622
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8623
|
+
var store;
|
|
8624
|
+
return __generator(this, function (_a) {
|
|
8625
|
+
switch (_a.label) {
|
|
8626
|
+
case 0: return [4 /*yield*/, _super.prototype.get.call(this, this.FILTERS_KEY)];
|
|
8627
|
+
case 1:
|
|
8628
|
+
store = (_a.sent()) || {};
|
|
8629
|
+
this.removeEmptyValues(filters);
|
|
8630
|
+
store[key] = filters;
|
|
8631
|
+
return [4 /*yield*/, _super.prototype.store.call(this, this.FILTERS_KEY, store)];
|
|
8632
|
+
case 2:
|
|
8633
|
+
_a.sent();
|
|
8634
|
+
return [2 /*return*/];
|
|
8635
|
+
}
|
|
8636
|
+
});
|
|
8637
|
+
});
|
|
8638
|
+
};
|
|
8639
|
+
FiltersStorageService.prototype.getFilters = function (key) {
|
|
8640
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8641
|
+
var store;
|
|
8642
|
+
return __generator(this, function (_a) {
|
|
8643
|
+
switch (_a.label) {
|
|
8644
|
+
case 0: return [4 /*yield*/, _super.prototype.get.call(this, this.FILTERS_KEY)];
|
|
8645
|
+
case 1:
|
|
8646
|
+
store = (_a.sent()) || {};
|
|
8647
|
+
return [2 /*return*/, store[key] || {}];
|
|
8648
|
+
}
|
|
8649
|
+
});
|
|
8650
|
+
});
|
|
8651
|
+
};
|
|
8652
|
+
FiltersStorageService.prototype.removeFilter = function (key) {
|
|
8653
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8654
|
+
var store;
|
|
8655
|
+
return __generator(this, function (_a) {
|
|
8656
|
+
switch (_a.label) {
|
|
8657
|
+
case 0: return [4 /*yield*/, _super.prototype.get.call(this, this.FILTERS_KEY)];
|
|
8658
|
+
case 1:
|
|
8659
|
+
store = (_a.sent()) || {};
|
|
8660
|
+
delete store[key];
|
|
8661
|
+
return [4 /*yield*/, _super.prototype.store.call(this, this.FILTERS_KEY, store)];
|
|
8662
|
+
case 2:
|
|
8663
|
+
_a.sent();
|
|
8664
|
+
return [2 /*return*/];
|
|
8665
|
+
}
|
|
8666
|
+
});
|
|
8667
|
+
});
|
|
8668
|
+
};
|
|
8669
|
+
FiltersStorageService.prototype.clearFilterValue = function (key, filters) {
|
|
8670
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8671
|
+
return __generator(this, function (_a) {
|
|
8672
|
+
switch (_a.label) {
|
|
8673
|
+
case 0: return [4 /*yield*/, this.storeFilters(key, filters)];
|
|
8674
|
+
case 1:
|
|
8675
|
+
_a.sent();
|
|
8676
|
+
return [2 /*return*/];
|
|
8677
|
+
}
|
|
8678
|
+
});
|
|
8679
|
+
});
|
|
8680
|
+
};
|
|
8681
|
+
FiltersStorageService.prototype.removeEmptyValues = function (filters) {
|
|
8682
|
+
var _this = this;
|
|
8683
|
+
Object.keys(filters).forEach(function (field) {
|
|
8684
|
+
if (_this.isInvalid(filters[field])) {
|
|
8685
|
+
delete filters[field];
|
|
8686
|
+
}
|
|
8687
|
+
});
|
|
8688
|
+
};
|
|
8689
|
+
FiltersStorageService.prototype.isInvalid = function (field) {
|
|
8690
|
+
if (field === null || field === undefined) {
|
|
8691
|
+
return true;
|
|
8692
|
+
}
|
|
8693
|
+
if (Array.isArray(field)) {
|
|
8694
|
+
return field.length === 0;
|
|
8695
|
+
}
|
|
8696
|
+
if (typeof field === "string") {
|
|
8697
|
+
return field.trim() === "";
|
|
8698
|
+
}
|
|
8699
|
+
if (typeof field === "object") {
|
|
8700
|
+
return Object.keys(field).length === 0;
|
|
8701
|
+
}
|
|
8702
|
+
return false;
|
|
8703
|
+
};
|
|
8704
|
+
FiltersStorageService.prototype.removeInvalidValues = function (values, fields) {
|
|
8705
|
+
if (!values) {
|
|
8706
|
+
return {};
|
|
8707
|
+
}
|
|
8708
|
+
Object.keys(values).forEach(function (fieldValue) {
|
|
8709
|
+
var field = fields.find(function (it) { return it.name == fieldValue; });
|
|
8710
|
+
if (field) {
|
|
8711
|
+
var val = values[fieldValue];
|
|
8712
|
+
if (!val)
|
|
8713
|
+
return;
|
|
8714
|
+
switch (field.type) {
|
|
8715
|
+
case FieldType.Integer:
|
|
8716
|
+
case FieldType.Double:
|
|
8717
|
+
case FieldType.Money:
|
|
8718
|
+
if (typeof val !== "number")
|
|
8719
|
+
delete values[fieldValue];
|
|
8720
|
+
break;
|
|
8721
|
+
case FieldType.Boolean:
|
|
8722
|
+
if (typeof val !== "boolean")
|
|
8723
|
+
delete values[fieldValue];
|
|
8724
|
+
break;
|
|
8725
|
+
case FieldType.Date:
|
|
8726
|
+
case FieldType.DateTime:
|
|
8727
|
+
case FieldType.Time:
|
|
8728
|
+
if (!moment$1(val, moment$1.ISO_8601, true).isValid())
|
|
8729
|
+
delete values[fieldValue];
|
|
8730
|
+
break;
|
|
8731
|
+
case FieldType.String:
|
|
8732
|
+
case FieldType.Text:
|
|
8733
|
+
if (typeof val !== "string")
|
|
8734
|
+
delete values[fieldValue];
|
|
8735
|
+
break;
|
|
8736
|
+
case FieldType.Lookup:
|
|
8737
|
+
case FieldType.Autocomplete:
|
|
8738
|
+
if (field.multiple) {
|
|
8739
|
+
if (!(Array.isArray(val) && val.length))
|
|
8740
|
+
delete values[fieldValue];
|
|
8741
|
+
}
|
|
8742
|
+
else {
|
|
8743
|
+
if (!(val instanceof Object))
|
|
8744
|
+
delete values[fieldValue];
|
|
8745
|
+
}
|
|
8746
|
+
break;
|
|
8747
|
+
case FieldType.Enum:
|
|
8748
|
+
if (field.multiple && !(Array.isArray(val) && val.length)) {
|
|
8749
|
+
delete values[fieldValue];
|
|
8750
|
+
}
|
|
8751
|
+
break;
|
|
8752
|
+
case FieldType.Chips:
|
|
8753
|
+
if (!(Array.isArray(val) && val.length)) {
|
|
8754
|
+
delete values[fieldValue];
|
|
8755
|
+
}
|
|
8756
|
+
break;
|
|
8757
|
+
default:
|
|
8758
|
+
break;
|
|
8759
|
+
}
|
|
8760
|
+
}
|
|
8761
|
+
});
|
|
8762
|
+
return values;
|
|
8763
|
+
};
|
|
8764
|
+
return FiltersStorageService;
|
|
8765
|
+
}(StorageService));
|
|
8766
|
+
|
|
8767
|
+
var ErpPolling = /** @class */ (function () {
|
|
8768
|
+
/**
|
|
8769
|
+
* Erp Polling
|
|
8770
|
+
* @class ErpPolling
|
|
8771
|
+
*/
|
|
8772
|
+
function ErpPolling() {
|
|
8773
|
+
}
|
|
8774
|
+
/**
|
|
8775
|
+
* Criação de um polling.
|
|
8776
|
+
* @typeParam `<T>` Tipo do objeto que o retorno do `observable` vai devolver.
|
|
8777
|
+
* @param takeWhileFn Função com retorno booleano, condição para a conclusão do polling, se falso conclui o polling.
|
|
8778
|
+
* @param calling Função com retorno `Observable<T>`, será a chamada feita pelo polling a cada X ms.
|
|
8779
|
+
* @param intervalMs Valor em ms que determina o intervalo das chamadas do polling.
|
|
8780
|
+
* @return Um `observable` com repetição cíclica a cada X ms _(`interval` informado nos parâmetros de entrada)_
|
|
8781
|
+
*/
|
|
8782
|
+
ErpPolling.prototype.pollingMount = function (takeWhileFn, calling, intervalMs) {
|
|
8783
|
+
if (intervalMs === void 0) { intervalMs = 29000; }
|
|
8784
|
+
return interval(intervalMs)
|
|
8785
|
+
.pipe(takeWhile(takeWhileFn), switchMap(calling));
|
|
8786
|
+
};
|
|
8787
|
+
ErpPolling = __decorate([
|
|
8788
|
+
Injectable()
|
|
8789
|
+
/**
|
|
8790
|
+
* Erp Polling
|
|
8791
|
+
* @class ErpPolling
|
|
8792
|
+
*/
|
|
8793
|
+
], ErpPolling);
|
|
8794
|
+
return ErpPolling;
|
|
8795
|
+
}());
|
|
8796
|
+
|
|
8180
8797
|
// https://widget.tracksale.co/
|
|
8181
8798
|
var NpsService = /** @class */ (function () {
|
|
8182
8799
|
function NpsService() {
|
|
@@ -8946,5 +9563,5 @@ var ModulesEnum;
|
|
|
8946
9563
|
* Generated bundle index. Do not edit.
|
|
8947
9564
|
*/
|
|
8948
9565
|
|
|
8949
|
-
export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, CaracteristicaFiscalLookup, ClassificacaoTributariaLookup, ComposicaoBaseCalculoLookup, ContaInternaFilialLookup, CountryLookup, CplTriNotaSaidaE001EndLookup, CplTriNotaSaidaE001PesLookup, CplTriNotaSaidaE001TnsLookup, CplTriNotaSaidaE007UfsLookup, CplTriNotaSaidaE008RaiLookup, CplTriNotaSaidaE015MedLookup, CplTriNotaSaidaE020SnfLookup, CplTriNotaSaidaE024MsgLookup, CplTriNotaSaidaE028CpgLookup, CplTriNotaSaidaE032EdcLookup, CplTriNotaSaidaE051DisLookup, CplTriNotaSaidaE066FpgLookup, CplTriNotaSaidaE070EmpLookup, CplTriNotaSaidaE070FilLookup, CplTriNotaSaidaE075DerLookup, CplTriNotaSaidaE080SerLookup, CplTriNotaSaidaNaturezaReceitaPisCofinsLookup, CplTriNotaSaidaNcmLookup, CplTriNotaSaidaNfEntradaLookup, CplTriNotaSaidaNfSaidaLookup, CurrencyLookup, DfeEventoLookup, DocumentoLookup, E001EndLookup, E001PesLookup, E001TnsLookup, E001TnsSupEstLookup, E002TptLookup, E006PaiLookup, E007UfsLookup, E008CepLookup, E008RaiLookup, E012FamLookup, E015MedLookup, E020SnfLookup, E021MotLookup, E023CrpLookup, E024MsgLookup, E027EqiLookup, E027StrLookup, E028CpgLookup, E030AgeLookup, E030BanLookup, E031MoeLookup, E032EdcLookup, E034TccLookup, E035OcrLookup, E036InsLookup, E039PorLookup, E041CebLookup, E043MpcLookup, E043PcmLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E076MarLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E089DocLookup, E090HrpComGerLookup, E090PesLookup, E091PlfLookup, E095HfoSupGerLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EntityPersonProductLookup, EnumLogicalOperator, EquipmentLookup, ErpLookups, ErpLookupsFormField, ErpLookupsModule, ErpLookupsService, ErpPolling, ExportUtils, FiltersStorageService, FormUtilsService, HTTP_STATUS_CODE, IndOperacaoFornecimentoLookup, LeiComplementar1162003Lookup, LigacaoItemFornecedorLookup, ListaServicoNacionalLookup, LookupValidationUtils, ModulesEnum, NbsLookup, NcmLookup, NotaFiscalEntradaLookup, NpsService, OperacoesLookup, OrigemDestinoLookup, OrigemMercadoriaLookup, ParametersLookup, PrimitiveManager, ProdutoServicoLookup, QuantidadeDisponivelDemandaLookup, RequisicaoLookup, SegmentoLookup, TypeTaxesLookup, UnidadeMedidaLookup, UtilsModule, VerifyModulePermission, VerifyModulePermissions, WebsocketService, naturezaReceitaPisCofins, ɵ0, ɵ1, ɵ2, EnumAnaSin as ɵa, EnumNatCtb as ɵb,
|
|
9566
|
+
export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, CaracteristicaFiscalLookup, ClassificacaoTributariaLookup, ComposicaoBaseCalculoLookup, ContaInternaFilialLookup, CountryLookup, CplTriNotaSaidaE001EndLookup, CplTriNotaSaidaE001PesLookup, CplTriNotaSaidaE001TnsLookup, CplTriNotaSaidaE007UfsLookup, CplTriNotaSaidaE008RaiLookup, CplTriNotaSaidaE015MedLookup, CplTriNotaSaidaE020SnfLookup, CplTriNotaSaidaE024MsgLookup, CplTriNotaSaidaE028CpgLookup, CplTriNotaSaidaE032EdcLookup, CplTriNotaSaidaE051DisLookup, CplTriNotaSaidaE066FpgLookup, CplTriNotaSaidaE070EmpLookup, CplTriNotaSaidaE070FilLookup, CplTriNotaSaidaE075DerLookup, CplTriNotaSaidaE080SerLookup, CplTriNotaSaidaNaturezaReceitaPisCofinsLookup, CplTriNotaSaidaNcmLookup, CplTriNotaSaidaNfEntradaLookup, CplTriNotaSaidaNfSaidaLookup, CurrencyLookup, DfeEventoLookup, DocumentoLookup, E001EndLookup, E001PesLookup, E001TnsLookup, E001TnsSupEstLookup, E002TptLookup, E006PaiLookup, E007UfsLookup, E008CepLookup, E008RaiLookup, E012FamLookup, E015MedLookup, E020SnfLookup, E021MotLookup, E023CrpLookup, E024MsgLookup, E027EqiLookup, E027StrLookup, E028CpgLookup, E030AgeLookup, E030BanLookup, E031MoeLookup, E032EdcLookup, E034TccLookup, E035OcrLookup, E036InsLookup, E039PorLookup, E041CebLookup, E043MpcLookup, E043PcmLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E076MarLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E089DocLookup, E090HrpComGerLookup, E090PesLookup, E091PlfLookup, E095HfoSupGerLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EntityPersonProductLookup, EnumLogicalOperator, EquipmentLookup, ErpLookups, ErpLookupsFormField, ErpLookupsModule, ErpLookupsService, ErpObjectCardModule, ErpPolling, ExportUtils, FiltersStorageService, FormUtilsService, HTTP_STATUS_CODE, IndOperacaoFornecimentoLookup, LeiComplementar1162003Lookup, LigacaoItemFornecedorLookup, ListaServicoNacionalLookup, LookupValidationUtils, ModulesEnum, NbsLookup, NcmLookup, NotaFiscalEntradaLookup, NpsService, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, OperacoesLookup, OrigemDestinoLookup, OrigemMercadoriaLookup, ParametersLookup, PrimitiveManager, ProdutoServicoLookup, QuantidadeDisponivelDemandaLookup, RequisicaoLookup, SegmentoLookup, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TypeTaxesLookup, UnidadeMedidaLookup, UtilsModule, VerifyModulePermission, VerifyModulePermissions, WebsocketService, naturezaReceitaPisCofins, ɵ0, ɵ1, ɵ2, EnumAnaSin as ɵa, EnumNatCtb as ɵb, ThumbnailService as ɵc, BorderButtonModule as ɵd, BorderButtonComponent as ɵe, StorageService as ɵf, UserInformationService as ɵg, VerifyModulePermissionService as ɵh, VerifyModulePermissionsService as ɵi };
|
|
8950
9567
|
//# sourceMappingURL=senior-gestao-empresarial-angular-components.js.map
|