@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-60622.0 → 0.0.0-bugfix-dev-KB-62386.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/dist/cjs/{ContinuousInsertUtils-b32220f0.js → ContinuousInsertUtils-807730a8.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-data-exporter.cjs.entry.js +11 -10
- package/dist/cjs/{snk-data-unit-004f781a.js → snk-data-unit-47202e42.js} +14 -7
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +19 -15
- package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -11
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +4 -4
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +5 -5
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +2 -2
- package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +4 -4
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +14 -7
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +44 -14
- package/dist/collection/components/snk-grid/snk-grid.css +1 -1
- package/dist/collection/components/snk-grid/snk-grid.js +1 -1
- package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +1 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +0 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +5 -9
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +2 -2
- package/dist/components/ContinuousInsertUtils.js +2 -2
- package/dist/components/snk-data-exporter2.js +10 -9
- package/dist/components/snk-data-unit2.js +14 -7
- package/dist/components/snk-filter-bar2.js +20 -15
- package/dist/components/snk-filter-checkbox-list.js +1 -1
- package/dist/components/snk-grid2.js +2 -2
- package/dist/components/snk-simple-bar2.js +1 -1
- package/dist/components/snk-simple-crud2.js +6 -10
- package/dist/esm/{ContinuousInsertUtils-aae77a37.js → ContinuousInsertUtils-1a82a768.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-data-exporter.entry.js +11 -10
- package/dist/esm/{snk-data-unit-a90ce6f2.js → snk-data-unit-de45e0e1.js} +14 -7
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +19 -15
- package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +3 -3
- package/dist/esm/snk-simple-bar.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +7 -11
- package/dist/sankhyablocks/{p-9bc1c239.entry.js → p-0035ad6e.entry.js} +1 -1
- package/dist/sankhyablocks/p-0911e61a.entry.js +1 -0
- package/dist/sankhyablocks/{p-47a038a3.js → p-3ae9d08a.js} +1 -1
- package/dist/sankhyablocks/{p-aaa3ee68.entry.js → p-5f157b09.entry.js} +1 -1
- package/dist/sankhyablocks/{p-43a73838.entry.js → p-62e048c6.entry.js} +1 -1
- package/dist/sankhyablocks/p-90281f0b.entry.js +1 -0
- package/dist/sankhyablocks/p-b9679243.entry.js +1 -0
- package/dist/sankhyablocks/{p-9132a0a1.js → p-bccfc262.js} +1 -1
- package/dist/sankhyablocks/p-c2e468c9.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +3 -3
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +2 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -1
- package/package.json +1 -1
- package/dist/sankhyablocks/p-7f918d0b.entry.js +0 -1
- package/dist/sankhyablocks/p-88aa931b.entry.js +0 -1
- package/dist/sankhyablocks/p-b2caaaf9.entry.js +0 -1
- package/dist/sankhyablocks/p-b82a7720.entry.js +0 -1
package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { UserInterface } from "@sankhyalabs/core";
|
|
2
2
|
import { DataFetcher } from "../../../lib";
|
|
3
3
|
import { getOptionKey, getVisibleColumns } from "../utils/ParserExport";
|
|
4
|
-
import { DataExporterType } from "../../../lib/@types";
|
|
5
4
|
export default class ClientSideExporterStrategy {
|
|
6
5
|
constructor(provider) {
|
|
7
6
|
this._provider = provider;
|
|
@@ -12,15 +11,16 @@ export default class ClientSideExporterStrategy {
|
|
|
12
11
|
return visibleColumns;
|
|
13
12
|
}
|
|
14
13
|
async executeExport(resolveProps) {
|
|
15
|
-
|
|
14
|
+
var _a;
|
|
15
|
+
const { methodName, gridTitle } = resolveProps;
|
|
16
16
|
const records = await this._provider.getRecords();
|
|
17
|
-
const columns =
|
|
17
|
+
const columns = ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
|
18
18
|
const [serviceName, processor] = this.getExecutor(methodName);
|
|
19
19
|
const payload = {
|
|
20
20
|
serviceName,
|
|
21
21
|
requestBody: {
|
|
22
22
|
grid: {
|
|
23
|
-
|
|
23
|
+
gridTitle,
|
|
24
24
|
columns: this.buildColumnsObject(columns),
|
|
25
25
|
rows: this.buildRowsObject(columns, records),
|
|
26
26
|
customOptions: { xlsxExtension: false }
|
package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js
CHANGED
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
import { ApplicationContext, ObjectUtils } from "@sankhyalabs/core";
|
|
14
14
|
import { DataFetcher } from '../../../lib/http/data-fetcher/DataFetcher';
|
|
15
|
-
import { DataExporterOption
|
|
15
|
+
import { DataExporterOption } from "../../../lib/@types";
|
|
16
16
|
import { getOptionKey, getVisibleColumns } from "../utils/ParserExport";
|
|
17
17
|
export default class ServerSideExporterStrategy {
|
|
18
18
|
constructor(provider) {
|
|
@@ -24,11 +24,11 @@ export default class ServerSideExporterStrategy {
|
|
|
24
24
|
return visibleColumns;
|
|
25
25
|
}
|
|
26
26
|
async getParams(resolveProps) {
|
|
27
|
-
var _a, _b, _c, _d, _e, _f;
|
|
27
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
28
28
|
const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
29
|
-
const columns =
|
|
30
|
-
const sort = (
|
|
31
|
-
const resourceURI = (
|
|
29
|
+
const columns = ((_c = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _c === void 0 ? void 0 : _c.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
|
30
|
+
const sort = (_e = (_d = this._provider).getOrders) === null || _e === void 0 ? void 0 : _e.call(_d);
|
|
31
|
+
const resourceURI = (_g = (_f = this._provider).getResourceURI) === null || _g === void 0 ? void 0 : _g.call(_f);
|
|
32
32
|
const selectedIDs = this._provider.getSelectedIDs();
|
|
33
33
|
const option = resolveProps.exportOption;
|
|
34
34
|
const currentPageOptions = [
|
|
@@ -42,7 +42,7 @@ export class SnkDataExporter {
|
|
|
42
42
|
resolver: ({ type, format, email: { to, subject, message } }) => {
|
|
43
43
|
var _a;
|
|
44
44
|
const methodName = (_a = DataExporterFormat[format === null || format === void 0 ? void 0 : format.toUpperCase()]) !== null && _a !== void 0 ? _a : DataExporterFormat.PDF;
|
|
45
|
-
this.resolveExporter({ type, methodName, to, subject, message, fileName: this._appLabel,
|
|
45
|
+
this.resolveExporter({ type, methodName, to, subject, message, fileName: this._appLabel, gridTitle: this._appLabel }, () => {
|
|
46
46
|
this._snkEmailSender.close();
|
|
47
47
|
ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
|
|
48
48
|
});
|
|
@@ -130,7 +130,7 @@ export class SnkDataExporter {
|
|
|
130
130
|
const params = {
|
|
131
131
|
methodName: DataExporterOption[`EXPORT_TO_${fileType}`],
|
|
132
132
|
fileName: this._appLabel,
|
|
133
|
-
|
|
133
|
+
gridTitle: this._appLabel,
|
|
134
134
|
exportOption: option,
|
|
135
135
|
limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b),
|
|
136
136
|
type: this.getExportType(option),
|
|
@@ -42,21 +42,21 @@ export const dataFetcherXLSResponse = {
|
|
|
42
42
|
export const exportPDFParams = {
|
|
43
43
|
methodName: 'exportToPDF',
|
|
44
44
|
fileName: '',
|
|
45
|
-
|
|
45
|
+
gridTitle: '',
|
|
46
46
|
};
|
|
47
47
|
export const exportXLSParams = {
|
|
48
48
|
methodName: 'exportToXLS',
|
|
49
49
|
fileName: '',
|
|
50
|
-
|
|
50
|
+
gridTitle: '',
|
|
51
51
|
};
|
|
52
52
|
export const serviceNamePDF = "GridPDFBuilderSP.buildPDFFromJson";
|
|
53
53
|
export const serviceNameXLS = "GridXLSBuilderSP.buildXLSFromJson";
|
|
54
|
-
export function buildExpectedResponse({ serviceName,
|
|
54
|
+
export function buildExpectedResponse({ serviceName, gridTitle, value, align = 'left', type = 'S' }) {
|
|
55
55
|
return {
|
|
56
56
|
serviceName: serviceName,
|
|
57
57
|
requestBody: {
|
|
58
58
|
grid: {
|
|
59
|
-
|
|
59
|
+
gridTitle: gridTitle,
|
|
60
60
|
columns: {
|
|
61
61
|
column: [
|
|
62
62
|
{
|
|
@@ -540,19 +540,26 @@ export class SnkDataUnit {
|
|
|
540
540
|
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
|
-
|
|
544
|
-
|
|
543
|
+
updateMetadataWithRMP() {
|
|
544
|
+
this.fillFieldsWithRmp(this.dataUnit.metadata);
|
|
545
|
+
this.fillFieldsWithRmPrecision(this.dataUnit.metadata);
|
|
546
|
+
const dataUnitUpdatedMetadata = this.handleDULinksOnMetadataLoaded(this.dataUnit.metadata);
|
|
547
|
+
this.dataUnit.metadata = dataUnitUpdatedMetadata;
|
|
548
|
+
}
|
|
549
|
+
async loadDataUnit() {
|
|
550
|
+
var _a, _b;
|
|
545
551
|
if (this.dataUnit == null && this._application && this.entityName) {
|
|
546
552
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
|
547
553
|
}
|
|
548
554
|
if (this.dataUnit) {
|
|
549
555
|
this.dataUnit.pageSize = this.pageSize;
|
|
550
556
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
551
|
-
this.dataUnit.addInterceptor(this);
|
|
552
557
|
this.dataUnit.subscribe(this._dataUnitObserver);
|
|
553
|
-
if (
|
|
554
|
-
|
|
555
|
-
|
|
558
|
+
if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) {
|
|
559
|
+
this.updateMetadataWithRMP();
|
|
560
|
+
}
|
|
561
|
+
this.dataUnit.addInterceptor(this);
|
|
562
|
+
if ((_b = this.dataUnit.records) === null || _b === void 0 ? void 0 : _b.length) {
|
|
556
563
|
const { records } = this.getMetadataByRow(this.dataUnit);
|
|
557
564
|
this.dataUnit.records = records;
|
|
558
565
|
}
|
|
@@ -640,7 +647,7 @@ export class SnkDataUnit {
|
|
|
640
647
|
}
|
|
641
648
|
}
|
|
642
649
|
async componentDidLoad() {
|
|
643
|
-
await this.loadDataUnit(
|
|
650
|
+
await this.loadDataUnit();
|
|
644
651
|
this.handlerLinkFields();
|
|
645
652
|
}
|
|
646
653
|
render() {
|
package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js
CHANGED
|
@@ -19,7 +19,7 @@ export class SnkFilterCheckboxList {
|
|
|
19
19
|
this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
|
|
20
20
|
}
|
|
21
21
|
renderOptions() {
|
|
22
|
-
return this.optionsList.map(option => (h("ez-check", { label: option.label,
|
|
22
|
+
return this.optionsList.map(option => (h("ez-check", { label: option.label, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name) })));
|
|
23
23
|
}
|
|
24
24
|
isChecked(itemName) {
|
|
25
25
|
var _a;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApplicationContext, ElementIDUtils,
|
|
1
|
+
import { ApplicationContext, ElementIDUtils, ObjectUtils, ErrorException } from '@sankhyalabs/core';
|
|
2
2
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
|
3
3
|
import { h, Host } from '@stencil/core';
|
|
4
4
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
|
@@ -27,6 +27,7 @@ export class SnkFilterBar {
|
|
|
27
27
|
this._filtersComparator = (a, b) => {
|
|
28
28
|
return this._calculateSortIndex(b) - this._calculateSortIndex(a);
|
|
29
29
|
};
|
|
30
|
+
this.customFilterBarConfig = undefined;
|
|
30
31
|
this.dataUnit = undefined;
|
|
31
32
|
this.title = undefined;
|
|
32
33
|
this.configName = undefined;
|
|
@@ -337,20 +338,23 @@ export class SnkFilterBar {
|
|
|
337
338
|
}
|
|
338
339
|
}
|
|
339
340
|
async loadConfigFromStorage(clearCache) {
|
|
340
|
-
|
|
341
|
-
|
|
341
|
+
try {
|
|
342
|
+
if (clearCache) {
|
|
343
|
+
await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
|
|
344
|
+
}
|
|
345
|
+
let config;
|
|
346
|
+
if (this.customFilterBarConfig) {
|
|
347
|
+
config = await this.customFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
config = await ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
|
|
351
|
+
}
|
|
352
|
+
this.filterConfig = config.map(item => this.normalizeItem(item));
|
|
353
|
+
this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
|
|
354
|
+
}
|
|
355
|
+
catch (e) {
|
|
356
|
+
throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), e);
|
|
342
357
|
}
|
|
343
|
-
return new Promise(accept => {
|
|
344
|
-
ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
|
|
345
|
-
.then((filters) => {
|
|
346
|
-
accept();
|
|
347
|
-
this.filterConfig = filters.map(item => this.normalizeItem(item));
|
|
348
|
-
this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
|
|
349
|
-
})
|
|
350
|
-
.catch(reason => {
|
|
351
|
-
throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
|
|
352
|
-
});
|
|
353
|
-
});
|
|
354
358
|
}
|
|
355
359
|
attachDataUnit() {
|
|
356
360
|
if (this.dataUnit == undefined) {
|
|
@@ -477,6 +481,32 @@ export class SnkFilterBar {
|
|
|
477
481
|
}
|
|
478
482
|
static get properties() {
|
|
479
483
|
return {
|
|
484
|
+
"customFilterBarConfig": {
|
|
485
|
+
"type": "unknown",
|
|
486
|
+
"mutable": false,
|
|
487
|
+
"complexType": {
|
|
488
|
+
"original": "(configName: string, resourceId: string, options: any) => Promise<Array<SnkFilterItemConfig>>",
|
|
489
|
+
"resolved": "(configName: string, resourceId: string, options: any) => Promise<SnkFilterItemConfig[]>",
|
|
490
|
+
"references": {
|
|
491
|
+
"Promise": {
|
|
492
|
+
"location": "global"
|
|
493
|
+
},
|
|
494
|
+
"Array": {
|
|
495
|
+
"location": "global"
|
|
496
|
+
},
|
|
497
|
+
"SnkFilterItemConfig": {
|
|
498
|
+
"location": "import",
|
|
499
|
+
"path": "./filter-item/snk-filter-item"
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
"required": false,
|
|
504
|
+
"optional": true,
|
|
505
|
+
"docs": {
|
|
506
|
+
"tags": [],
|
|
507
|
+
"text": "Loader customizado para carregar as configura\u00E7\u00F5es"
|
|
508
|
+
}
|
|
509
|
+
},
|
|
480
510
|
"dataUnit": {
|
|
481
511
|
"type": "unknown",
|
|
482
512
|
"mutable": true,
|
|
@@ -456,7 +456,7 @@ export class SnkGrid {
|
|
|
456
456
|
if (!this._dataUnit) {
|
|
457
457
|
return undefined;
|
|
458
458
|
}
|
|
459
|
-
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto" }, h("div", { class: "snk-grid__header ez-margin-bottom--
|
|
459
|
+
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
|
|
460
460
|
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
461
461
|
}
|
|
462
462
|
static get is() { return "snk-grid"; }
|
|
@@ -26,7 +26,7 @@ export class SnkSimpleBar {
|
|
|
26
26
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
|
-
return (h("div", { class: "simple-bar__container ez-margin-vertical--
|
|
29
|
+
return (h("div", { class: "simple-bar__container ez-margin-vertical--small ez-padding--extra-small" }, h("div", { class: "simple-bar__left-slot" }, h("ez-button", { class: "ez-padding-right--medium", title: this.getMessage('snkSimpleBar.backTitle'), mode: 'icon', iconName: "arrow_back", size: 'medium', onClick: () => this.exit.emit() }), h("div", { class: "simple-bar__column" }, h("h1", { class: "ez-title ez-title--primary ez-title--extra-large" }, this.label), h("ez-breadcrumb", { items: this.breadcrumbItens, onSelectedItem: ({ detail }) => this.clickBreadcrumbItem.emit(detail) }))), h("div", { class: "simple-bar__right-slot" }, h("slot", { name: "rightSlot" }))));
|
|
30
30
|
}
|
|
31
31
|
static get is() { return "snk-simple-bar"; }
|
|
32
32
|
static get encapsulation() { return "scoped"; }
|
|
@@ -23,9 +23,9 @@ export class SnkSimpleCrud {
|
|
|
23
23
|
this._customEditors = new Map();
|
|
24
24
|
this._customRenders = new Map();
|
|
25
25
|
this._taskbarProcessor = new TaskbarProcessor({
|
|
26
|
-
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false, [TaskbarElement.GRID_MODE]
|
|
26
|
+
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false, [TaskbarElement.GRID_MODE]),
|
|
27
27
|
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
|
|
28
|
-
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [TaskbarElement.GRID_MODE]
|
|
28
|
+
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [TaskbarElement.GRID_MODE]),
|
|
29
29
|
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
|
|
30
30
|
"snkSimpleCrudTaskbar.finish_edition": this.getFinishEditionButtonsCallback.bind(this)
|
|
31
31
|
});
|
|
@@ -125,12 +125,8 @@ export class SnkSimpleCrud {
|
|
|
125
125
|
}
|
|
126
126
|
return btns;
|
|
127
127
|
}
|
|
128
|
-
getButtons(selected, extraButtons
|
|
129
|
-
|
|
130
|
-
if (removeRefresh) {
|
|
131
|
-
btnList = btnList.filter(item => item !== TaskbarElement.REFRESH);
|
|
132
|
-
}
|
|
133
|
-
return this.addConfigButton(this.resolveInMemoryBtns(btnList)
|
|
128
|
+
getButtons(selected, extraButtons) {
|
|
129
|
+
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
|
134
130
|
.concat(extraButtons));
|
|
135
131
|
}
|
|
136
132
|
addConfigButton(buttons) {
|
|
@@ -730,7 +726,7 @@ export class SnkSimpleCrud {
|
|
|
730
726
|
if (this.dataUnit == undefined) {
|
|
731
727
|
return;
|
|
732
728
|
}
|
|
733
|
-
const taskbarContent = (h("snk-taskbar", { class: this._currentViewMode === VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--
|
|
729
|
+
const taskbarContent = (h("snk-taskbar", { class: this._currentViewMode === VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--small", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
|
|
734
730
|
return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, this._currentViewMode === VIEW_MODE.FORM && taskbarContent, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
735
731
|
? undefined
|
|
736
732
|
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, this._currentViewMode === VIEW_MODE.GRID && taskbarContent, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NumberUtils, ObjectUtils } from "@sankhyalabs/core";
|
|
1
|
+
import { NumberUtils, ObjectUtils, StringUtils } from "@sankhyalabs/core";
|
|
2
2
|
export default class RmPrecisionCustomValueFormatter {
|
|
3
3
|
setGrid(grid) {
|
|
4
4
|
if (this._grid) {
|
|
@@ -16,7 +16,7 @@ export default class RmPrecisionCustomValueFormatter {
|
|
|
16
16
|
}
|
|
17
17
|
format(currentValue, column, recordId) {
|
|
18
18
|
var _a;
|
|
19
|
-
if (
|
|
19
|
+
if (StringUtils.isEmpty(currentValue)) {
|
|
20
20
|
return currentValue;
|
|
21
21
|
}
|
|
22
22
|
const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { D as DataFetcher } from './DataFetcher.js';
|
|
2
2
|
import './pesquisa-fetcher.js';
|
|
3
|
-
import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, NumberUtils, DataType
|
|
3
|
+
import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, StringUtils, NumberUtils, DataType } from '@sankhyalabs/core';
|
|
4
4
|
import './ISave.js';
|
|
5
5
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
6
6
|
import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
@@ -229,7 +229,7 @@ class RmPrecisionCustomValueFormatter {
|
|
|
229
229
|
}
|
|
230
230
|
format(currentValue, column, recordId) {
|
|
231
231
|
var _a;
|
|
232
|
-
if (
|
|
232
|
+
if (StringUtils.isEmpty(currentValue)) {
|
|
233
233
|
return currentValue;
|
|
234
234
|
}
|
|
235
235
|
const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
|
|
@@ -284,11 +284,11 @@ class ServerSideExporterStrategy {
|
|
|
284
284
|
return visibleColumns;
|
|
285
285
|
}
|
|
286
286
|
async getParams(resolveProps) {
|
|
287
|
-
var _a, _b, _c, _d, _e, _f;
|
|
287
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
288
288
|
const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
289
|
-
const columns =
|
|
290
|
-
const sort = (
|
|
291
|
-
const resourceURI = (
|
|
289
|
+
const columns = ((_c = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _c === void 0 ? void 0 : _c.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
|
290
|
+
const sort = (_e = (_d = this._provider).getOrders) === null || _e === void 0 ? void 0 : _e.call(_d);
|
|
291
|
+
const resourceURI = (_g = (_f = this._provider).getResourceURI) === null || _g === void 0 ? void 0 : _g.call(_f);
|
|
292
292
|
const selectedIDs = this._provider.getSelectedIDs();
|
|
293
293
|
const option = resolveProps.exportOption;
|
|
294
294
|
const currentPageOptions = [
|
|
@@ -343,15 +343,16 @@ class ClientSideExporterStrategy {
|
|
|
343
343
|
return visibleColumns;
|
|
344
344
|
}
|
|
345
345
|
async executeExport(resolveProps) {
|
|
346
|
-
|
|
346
|
+
var _a;
|
|
347
|
+
const { methodName, gridTitle } = resolveProps;
|
|
347
348
|
const records = await this._provider.getRecords();
|
|
348
|
-
const columns =
|
|
349
|
+
const columns = ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
|
349
350
|
const [serviceName, processor] = this.getExecutor(methodName);
|
|
350
351
|
const payload = {
|
|
351
352
|
serviceName,
|
|
352
353
|
requestBody: {
|
|
353
354
|
grid: {
|
|
354
|
-
|
|
355
|
+
gridTitle,
|
|
355
356
|
columns: this.buildColumnsObject(columns),
|
|
356
357
|
rows: this.buildRowsObject(columns, records),
|
|
357
358
|
customOptions: { xlsxExtension: false }
|
|
@@ -462,7 +463,7 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
462
463
|
resolver: ({ type, format, email: { to, subject, message } }) => {
|
|
463
464
|
var _a;
|
|
464
465
|
const methodName = (_a = DataExporterFormat[format === null || format === void 0 ? void 0 : format.toUpperCase()]) !== null && _a !== void 0 ? _a : DataExporterFormat.PDF;
|
|
465
|
-
this.resolveExporter({ type, methodName, to, subject, message, fileName: this._appLabel,
|
|
466
|
+
this.resolveExporter({ type, methodName, to, subject, message, fileName: this._appLabel, gridTitle: this._appLabel }, () => {
|
|
466
467
|
this._snkEmailSender.close();
|
|
467
468
|
ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
|
|
468
469
|
});
|
|
@@ -550,7 +551,7 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
550
551
|
const params = {
|
|
551
552
|
methodName: DataExporterOption[`EXPORT_TO_${fileType}`],
|
|
552
553
|
fileName: this._appLabel,
|
|
553
|
-
|
|
554
|
+
gridTitle: this._appLabel,
|
|
554
555
|
exportOption: option,
|
|
555
556
|
limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b),
|
|
556
557
|
type: this.getExportType(option),
|
|
@@ -546,19 +546,26 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
546
546
|
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
|
-
|
|
550
|
-
|
|
549
|
+
updateMetadataWithRMP() {
|
|
550
|
+
this.fillFieldsWithRmp(this.dataUnit.metadata);
|
|
551
|
+
this.fillFieldsWithRmPrecision(this.dataUnit.metadata);
|
|
552
|
+
const dataUnitUpdatedMetadata = this.handleDULinksOnMetadataLoaded(this.dataUnit.metadata);
|
|
553
|
+
this.dataUnit.metadata = dataUnitUpdatedMetadata;
|
|
554
|
+
}
|
|
555
|
+
async loadDataUnit() {
|
|
556
|
+
var _a, _b;
|
|
551
557
|
if (this.dataUnit == null && this._application && this.entityName) {
|
|
552
558
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
|
553
559
|
}
|
|
554
560
|
if (this.dataUnit) {
|
|
555
561
|
this.dataUnit.pageSize = this.pageSize;
|
|
556
562
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
557
|
-
this.dataUnit.addInterceptor(this);
|
|
558
563
|
this.dataUnit.subscribe(this._dataUnitObserver);
|
|
559
|
-
if (
|
|
560
|
-
|
|
561
|
-
|
|
564
|
+
if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) {
|
|
565
|
+
this.updateMetadataWithRMP();
|
|
566
|
+
}
|
|
567
|
+
this.dataUnit.addInterceptor(this);
|
|
568
|
+
if ((_b = this.dataUnit.records) === null || _b === void 0 ? void 0 : _b.length) {
|
|
562
569
|
const { records } = this.getMetadataByRow(this.dataUnit);
|
|
563
570
|
this.dataUnit.records = records;
|
|
564
571
|
}
|
|
@@ -646,7 +653,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
646
653
|
}
|
|
647
654
|
}
|
|
648
655
|
async componentDidLoad() {
|
|
649
|
-
await this.loadDataUnit(
|
|
656
|
+
await this.loadDataUnit();
|
|
650
657
|
this.handlerLinkFields();
|
|
651
658
|
}
|
|
652
659
|
render() {
|
|
@@ -253,7 +253,7 @@ class SnkFilterModalFactory {
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:1fr minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter-bar__title.sc-snk-filter-bar{max-width:260px;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:16px;font-family:var(--font-pattern, Arial);font-weight:var(--text-weight--large, 600);color:var(--color--title-primary, #2B3A54);margin-top:8px}[data-mode=\"hidden\"].sc-snk-filter-bar-h{width:0px;height:0px}[data-mode=\"button\"].sc-snk-filter-bar-h{grid-template-columns:1fr;width:fit-content}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__scroller.sc-snk-filter-bar{height:calc(100% + var(--space-extra-small, 3px))}.snk-filter-bar__filter-item-container.sc-snk-filter-bar{display:flex;align-
|
|
256
|
+
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:1fr minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter-bar__title.sc-snk-filter-bar{max-width:260px;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:16px;font-family:var(--font-pattern, Arial);font-weight:var(--text-weight--large, 600);color:var(--color--title-primary, #2B3A54);margin-top:8px}[data-mode=\"hidden\"].sc-snk-filter-bar-h{width:0px;height:0px}[data-mode=\"button\"].sc-snk-filter-bar-h{grid-template-columns:1fr;width:fit-content}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__scroller.sc-snk-filter-bar{height:calc(100% + var(--space-extra-small, 3px))}.snk-filter-bar__filter-item-container.sc-snk-filter-bar{display:flex;align-items:start}.snk-filter-bar__scroller.sc-snk-filter-bar .sc-snk-filter-bar:first-child{margin-left:var(--space-extra-small, 3px)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}";
|
|
257
257
|
|
|
258
258
|
const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
259
259
|
constructor() {
|
|
@@ -279,6 +279,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
279
279
|
this._filtersComparator = (a, b) => {
|
|
280
280
|
return this._calculateSortIndex(b) - this._calculateSortIndex(a);
|
|
281
281
|
};
|
|
282
|
+
this.customFilterBarConfig = undefined;
|
|
282
283
|
this.dataUnit = undefined;
|
|
283
284
|
this.title = undefined;
|
|
284
285
|
this.configName = undefined;
|
|
@@ -588,20 +589,23 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
588
589
|
}
|
|
589
590
|
}
|
|
590
591
|
async loadConfigFromStorage(clearCache) {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
}
|
|
592
|
+
try {
|
|
593
|
+
if (clearCache) {
|
|
594
|
+
await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
|
|
595
|
+
}
|
|
596
|
+
let config;
|
|
597
|
+
if (this.customFilterBarConfig) {
|
|
598
|
+
config = await this.customFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
config = await ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
|
|
602
|
+
}
|
|
603
|
+
this.filterConfig = config.map(item => this.normalizeItem(item));
|
|
604
|
+
this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
|
|
605
|
+
}
|
|
606
|
+
catch (e) {
|
|
607
|
+
throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), e);
|
|
608
|
+
}
|
|
605
609
|
}
|
|
606
610
|
attachDataUnit() {
|
|
607
611
|
if (this.dataUnit == undefined) {
|
|
@@ -720,6 +724,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
720
724
|
}; }
|
|
721
725
|
static get style() { return snkFilterBarCss; }
|
|
722
726
|
}, [2, "snk-filter-bar", {
|
|
727
|
+
"customFilterBarConfig": [16],
|
|
723
728
|
"dataUnit": [1040],
|
|
724
729
|
"title": [1],
|
|
725
730
|
"configName": [1, "config-name"],
|
|
@@ -23,7 +23,7 @@ const SnkFilterCheckboxList$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
23
23
|
this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
|
|
24
24
|
}
|
|
25
25
|
renderOptions() {
|
|
26
|
-
return this.optionsList.map(option => (h("ez-check", { label: option.label,
|
|
26
|
+
return this.optionsList.map(option => (h("ez-check", { label: option.label, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name) })));
|
|
27
27
|
}
|
|
28
28
|
isChecked(itemName) {
|
|
29
29
|
var _a;
|
|
@@ -86,7 +86,7 @@ class ServerSideExporterProvider extends CommonsExporter {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px;--snk-grid-padding:var(--space--
|
|
89
|
+
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px;--snk-grid-padding:var(--space--small)}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%;padding:var(--snk-grid-padding)}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
|
|
90
90
|
|
|
91
91
|
const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
92
92
|
constructor() {
|
|
@@ -536,7 +536,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
536
536
|
if (!this._dataUnit) {
|
|
537
537
|
return undefined;
|
|
538
538
|
}
|
|
539
|
-
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto" }, h("div", { class: "snk-grid__header ez-margin-bottom--
|
|
539
|
+
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
|
|
540
540
|
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
541
541
|
}
|
|
542
542
|
get _element() { return this; }
|
|
@@ -33,7 +33,7 @@ const SnkSimpleBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
33
33
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
return (h("div", { class: "simple-bar__container ez-margin-vertical--
|
|
36
|
+
return (h("div", { class: "simple-bar__container ez-margin-vertical--small ez-padding--extra-small" }, h("div", { class: "simple-bar__left-slot" }, h("ez-button", { class: "ez-padding-right--medium", title: this.getMessage('snkSimpleBar.backTitle'), mode: 'icon', iconName: "arrow_back", size: 'medium', onClick: () => this.exit.emit() }), h("div", { class: "simple-bar__column" }, h("h1", { class: "ez-title ez-title--primary ez-title--extra-large" }, this.label), h("ez-breadcrumb", { items: this.breadcrumbItens, onSelectedItem: ({ detail }) => this.clickBreadcrumbItem.emit(detail) }))), h("div", { class: "simple-bar__right-slot" }, h("slot", { name: "rightSlot" }))));
|
|
37
37
|
}
|
|
38
38
|
get _element() { return this; }
|
|
39
39
|
static get style() { return snkSimpleBarCss; }
|