@sankhyalabs/sankhyablocks 8.1.0-dev.7 → 8.1.0-dev.9
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/{ConfigStorage-73e7afff.js → ConfigStorage-e32e1391.js} +4 -4
- package/dist/cjs/{DataFetcher-004811c6.js → DataFetcher-d2c6ae38.js} +29 -0
- package/dist/cjs/{SnkFormConfigManager-d1f1a222.js → SnkFormConfigManager-5e61b0a9.js} +2 -2
- package/dist/cjs/{auth-fetcher-58237931.js → auth-fetcher-da975ac5.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-029eafbd.js → dataunit-fetcher-58ad78a7.js} +1 -1
- package/dist/cjs/{filter-bar-config-fetcher-2b8ed9d0.js → filter-bar-config-fetcher-80b033ce.js} +1 -1
- package/dist/cjs/{form-config-fetcher-181767c9.js → form-config-fetcher-761994b9.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-9a97994a.js → pesquisa-fetcher-bb0bb679.js} +1 -1
- package/dist/cjs/{resource-fetcher-c0332609.js → resource-fetcher-95d24dff.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +8 -8
- package/dist/cjs/snk-attach.cjs.entry.js +2 -2
- package/dist/cjs/snk-crud.cjs.entry.js +4 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -8
- package/dist/cjs/snk-filter-bar.cjs.entry.js +5 -5
- package/dist/cjs/snk-filter-detail.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +5 -5
- package/dist/cjs/snk-form-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-form.cjs.entry.js +6 -6
- package/dist/cjs/snk-grid-config.cjs.entry.js +5 -5
- package/dist/cjs/snk-grid.cjs.entry.js +10 -9
- package/dist/cjs/{snk-guides-viewer-14a8b94c.js → snk-guides-viewer-eb0a79a4.js} +3 -3
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +5 -5
- package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +14 -71
- package/dist/collection/components/snk-grid/snk-grid.js +25 -4
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -59
- package/dist/collection/lib/utils/urlutils.js +29 -0
- package/dist/components/DataFetcher.js +29 -0
- package/dist/components/snk-grid2.js +7 -5
- package/dist/components/snk-simple-crud2.js +2 -59
- package/dist/esm/{ConfigStorage-19a7260b.js → ConfigStorage-b6aefe42.js} +4 -4
- package/dist/esm/{DataFetcher-e0fc5549.js → DataFetcher-aaaff866.js} +29 -0
- package/dist/esm/{SnkFormConfigManager-1a42eb02.js → SnkFormConfigManager-80901f2d.js} +2 -2
- package/dist/esm/{auth-fetcher-83a946f8.js → auth-fetcher-7860d777.js} +1 -1
- package/dist/esm/{dataunit-fetcher-6a695723.js → dataunit-fetcher-9dfcdb1d.js} +1 -1
- package/dist/esm/{filter-bar-config-fetcher-06e02851.js → filter-bar-config-fetcher-317cb6bf.js} +1 -1
- package/dist/esm/{form-config-fetcher-9e167008.js → form-config-fetcher-4a34b86a.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-9118eb7a.js → pesquisa-fetcher-01d058e6.js} +1 -1
- package/dist/esm/{resource-fetcher-768d5556.js → resource-fetcher-b36ac145.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +2 -2
- package/dist/esm/snk-application.entry.js +8 -8
- package/dist/esm/snk-attach.entry.js +2 -2
- package/dist/esm/snk-crud.entry.js +4 -4
- package/dist/esm/snk-data-exporter.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +8 -8
- package/dist/esm/snk-filter-bar.entry.js +5 -5
- package/dist/esm/snk-filter-detail.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +5 -5
- package/dist/esm/snk-form-config.entry.js +3 -3
- package/dist/esm/snk-form.entry.js +6 -6
- package/dist/esm/snk-grid-config.entry.js +5 -5
- package/dist/esm/snk-grid.entry.js +10 -9
- package/dist/esm/{snk-guides-viewer-2dba91ca.js → snk-guides-viewer-ee42eb53.js} +3 -3
- package/dist/esm/snk-guides-viewer.entry.js +8 -8
- package/dist/esm/snk-personalized-filter.entry.js +5 -5
- package/dist/esm/snk-print-selector.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +4 -61
- package/dist/sankhyablocks/{p-e7e54737.entry.js → p-05bcad8a.entry.js} +1 -1
- package/dist/sankhyablocks/p-0b64f036.entry.js +1 -0
- package/dist/sankhyablocks/{p-3de965a4.entry.js → p-0e97ec46.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0ed0fc02.entry.js → p-1b81c379.entry.js} +1 -1
- package/dist/sankhyablocks/{p-98f9d076.js → p-2dd0f891.js} +2 -2
- package/dist/sankhyablocks/p-330f584a.entry.js +1 -0
- package/dist/sankhyablocks/{p-bc735728.entry.js → p-35ecafcb.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e28129aa.entry.js → p-40b1ec07.entry.js} +1 -1
- package/dist/sankhyablocks/{p-d1b89765.js → p-42843f0e.js} +1 -1
- package/dist/sankhyablocks/{p-5f3a80da.entry.js → p-459d4267.entry.js} +1 -1
- package/dist/sankhyablocks/{p-be684b38.entry.js → p-557affc8.entry.js} +1 -1
- package/dist/sankhyablocks/{p-df8621b4.js → p-60791bb6.js} +1 -1
- package/dist/sankhyablocks/{p-815a42c0.entry.js → p-6295424d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f88c45bf.js → p-64c2cec3.js} +1 -1
- package/dist/sankhyablocks/{p-e5845241.entry.js → p-77ecc583.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6eb61de1.js → p-803b79d6.js} +1 -1
- package/dist/sankhyablocks/{p-7e285d6c.entry.js → p-80729c9b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0a4c753d.js → p-85affa29.js} +1 -1
- package/dist/sankhyablocks/p-95fa8af6.entry.js +1 -0
- package/dist/sankhyablocks/{p-8a41172a.entry.js → p-96c1ae78.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7d4a2149.entry.js → p-b556fadc.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2ac9c585.js → p-bee6b5d7.js} +1 -1
- package/dist/sankhyablocks/{p-8f8184ff.js → p-dd1fa35d.js} +1 -1
- package/dist/sankhyablocks/{p-976e56e9.js → p-e42f1f2a.js} +1 -1
- package/dist/sankhyablocks/{p-c0f656af.entry.js → p-f24c4bc7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7b8b8ae9.js → p-f737f7e1.js} +1 -1
- package/dist/sankhyablocks/{p-f31bfdee.entry.js → p-fd69eab9.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +1 -1
- package/dist/types/components.d.ts +2 -0
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -7
- package/dist/types/lib/utils/urlutils.d.ts +14 -0
- package/package.json +2 -2
- package/dist/sankhyablocks/p-22c6fe1a.entry.js +0 -1
- package/dist/sankhyablocks/p-244cda1b.entry.js +0 -1
- package/dist/sankhyablocks/p-59ceb17c.entry.js +0 -1
@@ -6,17 +6,17 @@ const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
8
8
|
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
9
|
-
const ConfigStorage = require('./ConfigStorage-
|
9
|
+
const ConfigStorage = require('./ConfigStorage-e32e1391.js');
|
10
10
|
const index$1 = require('./index-0e663819.js');
|
11
11
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
12
12
|
const index$2 = require('./index-102ba62d.js');
|
13
13
|
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-804ff4c7.js');
|
14
14
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
15
|
-
require('./form-config-fetcher-
|
16
|
-
require('./DataFetcher-
|
15
|
+
require('./form-config-fetcher-761994b9.js');
|
16
|
+
require('./DataFetcher-d2c6ae38.js');
|
17
17
|
require('./_commonjsHelpers-537d719a.js');
|
18
|
-
require('./resource-fetcher-
|
19
|
-
require('./filter-bar-config-fetcher-
|
18
|
+
require('./resource-fetcher-95d24dff.js');
|
19
|
+
require('./filter-bar-config-fetcher-80b033ce.js');
|
20
20
|
require('./filter-item-type.enum-aa823a00.js');
|
21
21
|
|
22
22
|
const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.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:300px}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
|
@@ -26,7 +26,6 @@ const SnkGrid = class {
|
|
26
26
|
index.registerInstance(this, hostRef);
|
27
27
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
28
28
|
this.gridDoubleClick = index.createEvent(this, "gridDoubleClick", 7);
|
29
|
-
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
|
30
29
|
this._topTaskbarProcessor = new taskbarProcessor.TaskbarProcessor({
|
31
30
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
32
31
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
@@ -43,6 +42,7 @@ const SnkGrid = class {
|
|
43
42
|
this._dataState = undefined;
|
44
43
|
this._gridConfig = undefined;
|
45
44
|
this._popUpGridConfig = false;
|
45
|
+
this.columnFilterDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
|
46
46
|
this.configName = undefined;
|
47
47
|
this.selectionToastConfig = undefined;
|
48
48
|
this.actionsList = undefined;
|
@@ -228,10 +228,11 @@ const SnkGrid = class {
|
|
228
228
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
229
229
|
}
|
230
230
|
finshLoading() {
|
231
|
+
var _a, _b;
|
231
232
|
this._dataUnitLoadLockerResolver = this._dataUnit.addLoadingLocker();
|
232
233
|
this.addElementID();
|
233
|
-
this.
|
234
|
-
this.
|
234
|
+
(_a = this.columnFilterDataSource) === null || _a === void 0 ? void 0 : _a.setApplication(this._application);
|
235
|
+
(_b = this.columnFilterDataSource) === null || _b === void 0 ? void 0 : _b.setDataUnit(this._dataUnit);
|
235
236
|
}
|
236
237
|
componentWillLoad() {
|
237
238
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
@@ -323,7 +324,7 @@ const SnkGrid = class {
|
|
323
324
|
return undefined;
|
324
325
|
}
|
325
326
|
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
326
|
-
index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), index.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() })), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.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: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.
|
327
|
+
index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), index.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() })), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.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: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, index.h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
|
327
328
|
}
|
328
329
|
get _element() { return index.getElement(this); }
|
329
330
|
};
|
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
const index = require('./index-f9e81701.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
5
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-5e61b0a9.js');
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
7
7
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
8
8
|
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
9
9
|
const constants = require('./constants-d187e03e.js');
|
10
|
-
require('./DataFetcher-
|
11
|
-
require('./pesquisa-fetcher-
|
10
|
+
require('./DataFetcher-d2c6ae38.js');
|
11
|
+
require('./pesquisa-fetcher-bb0bb679.js');
|
12
12
|
const index$1 = require('./index-0e663819.js');
|
13
13
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
14
14
|
|
@@ -2,17 +2,17 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-eb0a79a4.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
|
-
require('./SnkFormConfigManager-
|
9
|
-
require('./ConfigStorage-
|
10
|
-
require('./form-config-fetcher-
|
11
|
-
require('./DataFetcher-
|
8
|
+
require('./SnkFormConfigManager-5e61b0a9.js');
|
9
|
+
require('./ConfigStorage-e32e1391.js');
|
10
|
+
require('./form-config-fetcher-761994b9.js');
|
11
|
+
require('./DataFetcher-d2c6ae38.js');
|
12
12
|
require('./_commonjsHelpers-537d719a.js');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
|
-
require('./resource-fetcher-
|
15
|
-
require('./filter-bar-config-fetcher-
|
14
|
+
require('./resource-fetcher-95d24dff.js');
|
15
|
+
require('./filter-bar-config-fetcher-80b033ce.js');
|
16
16
|
require('./filter-item-type.enum-aa823a00.js');
|
17
17
|
require('@sankhyalabs/ezui/dist/collection/utils/form');
|
18
18
|
require('./taskbar-processor-bce3f499.js');
|
@@ -20,7 +20,7 @@ require('./taskbar-elements-b98dd6e9.js');
|
|
20
20
|
require('./index-0e663819.js');
|
21
21
|
require('./index-102ba62d.js');
|
22
22
|
require('./constants-d187e03e.js');
|
23
|
-
require('./pesquisa-fetcher-
|
23
|
+
require('./pesquisa-fetcher-bb0bb679.js');
|
24
24
|
require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
25
25
|
|
26
26
|
|
@@ -5,17 +5,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-1aeb625d.js');
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
8
|
+
const ConfigStorage = require('./ConfigStorage-e32e1391.js');
|
9
9
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
10
10
|
const index$1 = require('./index-c5771aba.js');
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
12
12
|
require('./filter-item-type.enum-aa823a00.js');
|
13
|
-
require('./form-config-fetcher-
|
14
|
-
require('./DataFetcher-
|
13
|
+
require('./form-config-fetcher-761994b9.js');
|
14
|
+
require('./DataFetcher-d2c6ae38.js');
|
15
15
|
require('./_commonjsHelpers-537d719a.js');
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
17
|
-
require('./resource-fetcher-
|
18
|
-
require('./filter-bar-config-fetcher-
|
17
|
+
require('./resource-fetcher-95d24dff.js');
|
18
|
+
require('./filter-bar-config-fetcher-80b033ce.js');
|
19
19
|
|
20
20
|
const snkPersonalizedFilterCss = ".sc-snk-personalized-filter-h{display:flex;height:100%;padding:var(--space--large, 24px);--snk-personalized-filter--width:100%;--snk-personalized-filter--height:100%;--snk-personalized-filter--background-color-line:var(--color--disable-secondary);--snk-personalized-filter--margin-line:var(--border--radius-medium, 12px)}.snk-personalized-filter.sc-snk-personalized-filter{height:var(--snk-personalized-filter--width);width:var(--snk-personalized-filter--height)}.snk-personalized-filter__header-actions.sc-snk-personalized-filter{display:flex;gap:var(--space--medium)}.snk-personalized-filter__group.sc-snk-personalized-filter{flex:1}.snk-personalized-filter__expression-input--line.sc-snk-personalized-filter{width:100%;height:2px;background-color:var(--snk-personalized-filter--background-color-line);margin-top:var(--snk-personalized-filter--margin-line);margin-bottom:var(--snk-personalized-filter--margin-line)}.ez-box__main.sc-snk-personalized-filter{height:90%}.snk-personalized-filter__button-mode.sc-snk-personalized-filter{height:35px}";
|
21
21
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
|
-
const DataFetcher = require('./DataFetcher-
|
6
|
+
const DataFetcher = require('./DataFetcher-d2c6ae38.js');
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
8
|
const core = require('@sankhyalabs/core');
|
9
9
|
const ModalButtonStatus = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container/modal-button-status');
|
@@ -4,13 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const constants
|
7
|
+
const constants = require('./constants-d187e03e.js');
|
8
8
|
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
9
|
-
require('./DataFetcher-
|
10
|
-
require('./pesquisa-fetcher-
|
9
|
+
require('./DataFetcher-d2c6ae38.js');
|
10
|
+
require('./pesquisa-fetcher-bb0bb679.js');
|
11
11
|
const index$1 = require('./index-0e663819.js');
|
12
12
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
13
|
-
const constants = require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
13
|
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-804ff4c7.js');
|
15
14
|
require('./index-102ba62d.js');
|
16
15
|
require('./_commonjsHelpers-537d719a.js');
|
@@ -22,7 +21,7 @@ class InMemoryLoader {
|
|
22
21
|
this.metadata = metadata;
|
23
22
|
this._dataUnit = new core.DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
24
23
|
this._dataUnit.metadataLoader = () => this.metadaLoader();
|
25
|
-
this._dataUnit.dataLoader = (dataUnit, request) =>
|
24
|
+
this._dataUnit.dataLoader = (dataUnit, request) => core.defaultDataLoader(dataUnit, request, this._records);
|
26
25
|
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
27
26
|
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
28
27
|
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
@@ -59,62 +58,6 @@ class InMemoryLoader {
|
|
59
58
|
metadaLoader() {
|
60
59
|
return Promise.resolve(this._metadata);
|
61
60
|
}
|
62
|
-
dataLoader(dataUnit, request) {
|
63
|
-
const filters = this.getColumnFilters(dataUnit);
|
64
|
-
let records = this.applyFilters(filters);
|
65
|
-
if (request.sort) {
|
66
|
-
request.sort.forEach(sort => {
|
67
|
-
records = records.sort((recordA, recordB) => {
|
68
|
-
const fieldA = recordA[sort.field];
|
69
|
-
const fieldB = recordB[sort.field];
|
70
|
-
const sortFn = this.getSortFn(sort.dataType);
|
71
|
-
return sortFn(fieldA, fieldB) * (sort.mode == core.SortMode.ASC ? 1 : -1);
|
72
|
-
});
|
73
|
-
});
|
74
|
-
}
|
75
|
-
return Promise.resolve({ records: records });
|
76
|
-
}
|
77
|
-
applyFilters(filters) {
|
78
|
-
let records = [...this._records];
|
79
|
-
filters.forEach(filter => {
|
80
|
-
records = records.filter(record => { var _a; return filter.values.includes((_a = record[filter.column]) === null || _a === void 0 ? void 0 : _a.toString()); });
|
81
|
-
});
|
82
|
-
return records;
|
83
|
-
}
|
84
|
-
getColumnFilters(dataUnit) {
|
85
|
-
var _a, _b;
|
86
|
-
const allFilters = (_a = dataUnit.getFilters()) !== null && _a !== void 0 ? _a : [];
|
87
|
-
const columnFilters = (_b = allFilters.filter(filter => { var _a; return (_a = filter.name) === null || _a === void 0 ? void 0 : _a.includes(constants.DISTINCT_FILTER_NAME_PREFIX); })) !== null && _b !== void 0 ? _b : [];
|
88
|
-
return columnFilters.map(filter => {
|
89
|
-
var _a, _b;
|
90
|
-
return {
|
91
|
-
column: (_b = (_a = filter.name) === null || _a === void 0 ? void 0 : _a.replace(constants.DISTINCT_FILTER_NAME_PREFIX, "")) !== null && _b !== void 0 ? _b : "",
|
92
|
-
values: filter.params.map(param => param.value),
|
93
|
-
};
|
94
|
-
});
|
95
|
-
}
|
96
|
-
getSortFn(type) {
|
97
|
-
switch (type) {
|
98
|
-
case core.DataType.NUMBER:
|
99
|
-
return this.sortNumber;
|
100
|
-
case core.DataType.DATE:
|
101
|
-
return this.sortDate;
|
102
|
-
case core.DataType.OBJECT:
|
103
|
-
return this.sortObject;
|
104
|
-
default:
|
105
|
-
return core.StringUtils.compare;
|
106
|
-
}
|
107
|
-
}
|
108
|
-
sortObject(a, b) {
|
109
|
-
return core.StringUtils.compare(a === null || a === void 0 ? void 0 : a["label"], b === null || b === void 0 ? void 0 : b["label"]);
|
110
|
-
}
|
111
|
-
sortNumber(a, b) {
|
112
|
-
return a - b;
|
113
|
-
}
|
114
|
-
sortDate(a, b) {
|
115
|
-
let timeA = a.getTime(), timeB = b.getTime();
|
116
|
-
return timeA === timeB ? 0 : (timeA < timeB ? -1 : 1);
|
117
|
-
}
|
118
61
|
saveLoader(_dataUnit, changes) {
|
119
62
|
return new Promise((resolve) => {
|
120
63
|
let dataUnitRecords = [];
|
@@ -168,11 +111,11 @@ const SnkSimpleCrud = class {
|
|
168
111
|
"snkSimpleCrudTaskbar.grid_selected": this.resolveInMemoryBtns(this.REGULAR_SELECTED_BTNS).concat(taskbarElements.TaskbarElement.FORM_MODE),
|
169
112
|
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
170
113
|
});
|
171
|
-
this._currentViewMode = constants
|
114
|
+
this._currentViewMode = constants.VIEW_MODE.GRID;
|
172
115
|
this._config = undefined;
|
173
116
|
this.dataState = undefined;
|
174
117
|
this.dataUnit = undefined;
|
175
|
-
this.mode = constants
|
118
|
+
this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
|
176
119
|
this.gridConfig = undefined;
|
177
120
|
this.formConfig = undefined;
|
178
121
|
this.multipleSelection = undefined;
|
@@ -183,7 +126,7 @@ const SnkSimpleCrud = class {
|
|
183
126
|
}
|
184
127
|
resolveInMemoryBtns(taskbarButtons) {
|
185
128
|
const newTaskBarConfig = [...taskbarButtons];
|
186
|
-
if (this.mode === constants
|
129
|
+
if (this.mode === constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
|
187
130
|
newTaskBarConfig.splice(1, 1);
|
188
131
|
}
|
189
132
|
return newTaskBarConfig;
|
@@ -200,15 +143,15 @@ const SnkSimpleCrud = class {
|
|
200
143
|
actionClickListener(evt) {
|
201
144
|
const act = evt.detail;
|
202
145
|
if (act === taskbarElements.TaskbarElement.GRID_MODE) {
|
203
|
-
this.goToView(constants
|
146
|
+
this.goToView(constants.VIEW_MODE.GRID);
|
204
147
|
}
|
205
148
|
else if (act === taskbarElements.TaskbarElement.FORM_MODE) {
|
206
|
-
this.goToView(constants
|
149
|
+
this.goToView(constants.VIEW_MODE.FORM);
|
207
150
|
}
|
208
151
|
evt.stopPropagation();
|
209
152
|
}
|
210
153
|
onModeChange() {
|
211
|
-
if (this.mode == constants
|
154
|
+
if (this.mode == constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
|
212
155
|
this.initInMemoryDataUnit();
|
213
156
|
}
|
214
157
|
}
|
@@ -238,9 +181,9 @@ const SnkSimpleCrud = class {
|
|
238
181
|
if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
|
239
182
|
!this.dataState.selectionInfo.isAllRecords() &&
|
240
183
|
((_c = this.dataState.selectionInfo.records) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
241
|
-
return this._currentViewMode === constants
|
184
|
+
return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
|
242
185
|
}
|
243
|
-
return this._currentViewMode === constants
|
186
|
+
return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
|
244
187
|
}
|
245
188
|
initInMemoryDataUnit() {
|
246
189
|
this._inMemoryLoader = new InMemoryLoader(this._metadata);
|
@@ -318,13 +261,13 @@ const SnkSimpleCrud = class {
|
|
318
261
|
handleCancelEdit() {
|
319
262
|
var _a;
|
320
263
|
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.recordsIsEmpty) {
|
321
|
-
this.goToView(constants
|
264
|
+
this.goToView(constants.VIEW_MODE.GRID);
|
322
265
|
this.dataUnit.clearSelection();
|
323
266
|
}
|
324
267
|
}
|
325
268
|
render() {
|
326
269
|
var _a;
|
327
|
-
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants
|
270
|
+
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-flex ez-box ez-box--shadow" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", 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, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }), index.h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
328
271
|
? undefined
|
329
272
|
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
330
273
|
}
|
@@ -10,7 +10,6 @@ import SnkMultiSelectionListDataSource from './filtercolumn/SnkMultiSelectionLis
|
|
10
10
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
11
11
|
export class SnkGrid {
|
12
12
|
constructor() {
|
13
|
-
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
|
14
13
|
this._topTaskbarProcessor = new TaskbarProcessor({
|
15
14
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
16
15
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
@@ -27,6 +26,7 @@ export class SnkGrid {
|
|
27
26
|
this._dataState = undefined;
|
28
27
|
this._gridConfig = undefined;
|
29
28
|
this._popUpGridConfig = false;
|
29
|
+
this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
|
30
30
|
this.configName = undefined;
|
31
31
|
this.selectionToastConfig = undefined;
|
32
32
|
this.actionsList = undefined;
|
@@ -212,10 +212,11 @@ export class SnkGrid {
|
|
212
212
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
213
213
|
}
|
214
214
|
finshLoading() {
|
215
|
+
var _a, _b;
|
215
216
|
this._dataUnitLoadLockerResolver = this._dataUnit.addLoadingLocker();
|
216
217
|
this.addElementID();
|
217
|
-
this.
|
218
|
-
this.
|
218
|
+
(_a = this.columnFilterDataSource) === null || _a === void 0 ? void 0 : _a.setApplication(this._application);
|
219
|
+
(_b = this.columnFilterDataSource) === null || _b === void 0 ? void 0 : _b.setDataUnit(this._dataUnit);
|
219
220
|
}
|
220
221
|
componentWillLoad() {
|
221
222
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
@@ -307,7 +308,7 @@ export class SnkGrid {
|
|
307
308
|
return undefined;
|
308
309
|
}
|
309
310
|
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--medium" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
310
|
-
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() })), 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: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.
|
311
|
+
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() })), 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: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), 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), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
|
311
312
|
}
|
312
313
|
static get is() { return "snk-grid"; }
|
313
314
|
static get encapsulation() { return "scoped"; }
|
@@ -323,6 +324,26 @@ export class SnkGrid {
|
|
323
324
|
}
|
324
325
|
static get properties() {
|
325
326
|
return {
|
327
|
+
"columnFilterDataSource": {
|
328
|
+
"type": "unknown",
|
329
|
+
"mutable": true,
|
330
|
+
"complexType": {
|
331
|
+
"original": "SnkMultiSelectionListDataSource",
|
332
|
+
"resolved": "SnkMultiSelectionListDataSource",
|
333
|
+
"references": {
|
334
|
+
"SnkMultiSelectionListDataSource": {
|
335
|
+
"location": "global"
|
336
|
+
}
|
337
|
+
}
|
338
|
+
},
|
339
|
+
"required": false,
|
340
|
+
"optional": false,
|
341
|
+
"docs": {
|
342
|
+
"tags": [],
|
343
|
+
"text": ""
|
344
|
+
},
|
345
|
+
"defaultValue": "new SnkMultiSelectionListDataSource()"
|
346
|
+
},
|
326
347
|
"configName": {
|
327
348
|
"type": "string",
|
328
349
|
"mutable": false,
|
@@ -1,12 +1,11 @@
|
|
1
|
-
import { ChangeOperation,
|
2
|
-
import { DISTINCT_FILTER_NAME_PREFIX } from "@sankhyalabs/ezui/dist/collection/utils/constants";
|
1
|
+
import { ChangeOperation, DataUnit, defaultDataLoader, StringUtils, } from '@sankhyalabs/core';
|
3
2
|
export default class InMemoryLoader {
|
4
3
|
constructor(metadata, records) {
|
5
4
|
this.records = records || [];
|
6
5
|
this.metadata = metadata;
|
7
6
|
this._dataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
8
7
|
this._dataUnit.metadataLoader = () => this.metadaLoader();
|
9
|
-
this._dataUnit.dataLoader = (dataUnit, request) =>
|
8
|
+
this._dataUnit.dataLoader = (dataUnit, request) => defaultDataLoader(dataUnit, request, this._records);
|
10
9
|
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
11
10
|
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
12
11
|
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
@@ -43,62 +42,6 @@ export default class InMemoryLoader {
|
|
43
42
|
metadaLoader() {
|
44
43
|
return Promise.resolve(this._metadata);
|
45
44
|
}
|
46
|
-
dataLoader(dataUnit, request) {
|
47
|
-
const filters = this.getColumnFilters(dataUnit);
|
48
|
-
let records = this.applyFilters(filters);
|
49
|
-
if (request.sort) {
|
50
|
-
request.sort.forEach(sort => {
|
51
|
-
records = records.sort((recordA, recordB) => {
|
52
|
-
const fieldA = recordA[sort.field];
|
53
|
-
const fieldB = recordB[sort.field];
|
54
|
-
const sortFn = this.getSortFn(sort.dataType);
|
55
|
-
return sortFn(fieldA, fieldB) * (sort.mode == SortMode.ASC ? 1 : -1);
|
56
|
-
});
|
57
|
-
});
|
58
|
-
}
|
59
|
-
return Promise.resolve({ records: records });
|
60
|
-
}
|
61
|
-
applyFilters(filters) {
|
62
|
-
let records = [...this._records];
|
63
|
-
filters.forEach(filter => {
|
64
|
-
records = records.filter(record => { var _a; return filter.values.includes((_a = record[filter.column]) === null || _a === void 0 ? void 0 : _a.toString()); });
|
65
|
-
});
|
66
|
-
return records;
|
67
|
-
}
|
68
|
-
getColumnFilters(dataUnit) {
|
69
|
-
var _a, _b;
|
70
|
-
const allFilters = (_a = dataUnit.getFilters()) !== null && _a !== void 0 ? _a : [];
|
71
|
-
const columnFilters = (_b = allFilters.filter(filter => { var _a; return (_a = filter.name) === null || _a === void 0 ? void 0 : _a.includes(DISTINCT_FILTER_NAME_PREFIX); })) !== null && _b !== void 0 ? _b : [];
|
72
|
-
return columnFilters.map(filter => {
|
73
|
-
var _a, _b;
|
74
|
-
return {
|
75
|
-
column: (_b = (_a = filter.name) === null || _a === void 0 ? void 0 : _a.replace(DISTINCT_FILTER_NAME_PREFIX, "")) !== null && _b !== void 0 ? _b : "",
|
76
|
-
values: filter.params.map(param => param.value),
|
77
|
-
};
|
78
|
-
});
|
79
|
-
}
|
80
|
-
getSortFn(type) {
|
81
|
-
switch (type) {
|
82
|
-
case DataType.NUMBER:
|
83
|
-
return this.sortNumber;
|
84
|
-
case DataType.DATE:
|
85
|
-
return this.sortDate;
|
86
|
-
case DataType.OBJECT:
|
87
|
-
return this.sortObject;
|
88
|
-
default:
|
89
|
-
return StringUtils.compare;
|
90
|
-
}
|
91
|
-
}
|
92
|
-
sortObject(a, b) {
|
93
|
-
return StringUtils.compare(a === null || a === void 0 ? void 0 : a["label"], b === null || b === void 0 ? void 0 : b["label"]);
|
94
|
-
}
|
95
|
-
sortNumber(a, b) {
|
96
|
-
return a - b;
|
97
|
-
}
|
98
|
-
sortDate(a, b) {
|
99
|
-
let timeA = a.getTime(), timeB = b.getTime();
|
100
|
-
return timeA === timeB ? 0 : (timeA < timeB ? -1 : 1);
|
101
|
-
}
|
102
45
|
saveLoader(_dataUnit, changes) {
|
103
46
|
return new Promise((resolve) => {
|
104
47
|
let dataUnitRecords = [];
|
@@ -22,4 +22,33 @@ export default class UrlUtils {
|
|
22
22
|
return window['mock_url'];
|
23
23
|
return `${location.protocol}//${location.hostname}${location.port ? ":" + location.port : ""}`;
|
24
24
|
}
|
25
|
+
/**
|
26
|
+
* Extrai da URL o parâmetro que contém o resourceId da tela desejada.
|
27
|
+
*
|
28
|
+
*/
|
29
|
+
static getResourceIdFromUrlToken(url) {
|
30
|
+
try {
|
31
|
+
const parts = url.split('/');
|
32
|
+
const encodedValue = parts[1];
|
33
|
+
return atob(encodedValue);
|
34
|
+
}
|
35
|
+
catch (error) {
|
36
|
+
throw new Error('Erro ao obter resourceId:' + error);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
/**
|
40
|
+
* Extrai da URL o parâmetro que contém o o objeto com a PK do registro específico.
|
41
|
+
*
|
42
|
+
*/
|
43
|
+
static getPkObjectFromUrlToken(url) {
|
44
|
+
try {
|
45
|
+
const parts = url.split('/');
|
46
|
+
const encodedObjectPart = parts[parts.length - 2];
|
47
|
+
const decodedObjectPart = atob(encodedObjectPart);
|
48
|
+
return JSON.parse(decodedObjectPart);
|
49
|
+
}
|
50
|
+
catch (error) {
|
51
|
+
throw new Error('Erro ao obter a PK do objeto:' + error);
|
52
|
+
}
|
53
|
+
}
|
25
54
|
}
|
@@ -6434,6 +6434,35 @@ class UrlUtils {
|
|
6434
6434
|
return window['mock_url'];
|
6435
6435
|
return `${location.protocol}//${location.hostname}${location.port ? ":" + location.port : ""}`;
|
6436
6436
|
}
|
6437
|
+
/**
|
6438
|
+
* Extrai da URL o parâmetro que contém o resourceId da tela desejada.
|
6439
|
+
*
|
6440
|
+
*/
|
6441
|
+
static getResourceIdFromUrlToken(url) {
|
6442
|
+
try {
|
6443
|
+
const parts = url.split('/');
|
6444
|
+
const encodedValue = parts[1];
|
6445
|
+
return atob(encodedValue);
|
6446
|
+
}
|
6447
|
+
catch (error) {
|
6448
|
+
throw new Error('Erro ao obter resourceId:' + error);
|
6449
|
+
}
|
6450
|
+
}
|
6451
|
+
/**
|
6452
|
+
* Extrai da URL o parâmetro que contém o o objeto com a PK do registro específico.
|
6453
|
+
*
|
6454
|
+
*/
|
6455
|
+
static getPkObjectFromUrlToken(url) {
|
6456
|
+
try {
|
6457
|
+
const parts = url.split('/');
|
6458
|
+
const encodedObjectPart = parts[parts.length - 2];
|
6459
|
+
const decodedObjectPart = atob(encodedObjectPart);
|
6460
|
+
return JSON.parse(decodedObjectPart);
|
6461
|
+
}
|
6462
|
+
catch (error) {
|
6463
|
+
throw new Error('Erro ao obter a PK do objeto:' + error);
|
6464
|
+
}
|
6465
|
+
}
|
6437
6466
|
}
|
6438
6467
|
|
6439
6468
|
class ServiceBrokerRecaller {
|
@@ -4,7 +4,7 @@ import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMeta
|
|
4
4
|
import { d as defineCustomElement$1, T as TaskbarElement } from './snk-taskbar2.js';
|
5
5
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
6
6
|
import { P as PresentationMode } from './index2.js';
|
7
|
-
import {
|
7
|
+
import { T as TaskbarProcessor, S as SnkMultiSelectionListDataSource } from './SnkMultiSelectionListDataSource.js';
|
8
8
|
import { s as store } from './index3.js';
|
9
9
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
10
10
|
import { d as defineCustomElement$h } from './snk-actions-button2.js';
|
@@ -32,7 +32,6 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
32
32
|
this.__registerHost();
|
33
33
|
this.actionClick = createEvent(this, "actionClick", 7);
|
34
34
|
this.gridDoubleClick = createEvent(this, "gridDoubleClick", 7);
|
35
|
-
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
|
36
35
|
this._topTaskbarProcessor = new TaskbarProcessor({
|
37
36
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
38
37
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
@@ -49,6 +48,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
49
48
|
this._dataState = undefined;
|
50
49
|
this._gridConfig = undefined;
|
51
50
|
this._popUpGridConfig = false;
|
51
|
+
this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
|
52
52
|
this.configName = undefined;
|
53
53
|
this.selectionToastConfig = undefined;
|
54
54
|
this.actionsList = undefined;
|
@@ -234,10 +234,11 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
234
234
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
235
235
|
}
|
236
236
|
finshLoading() {
|
237
|
+
var _a, _b;
|
237
238
|
this._dataUnitLoadLockerResolver = this._dataUnit.addLoadingLocker();
|
238
239
|
this.addElementID();
|
239
|
-
this.
|
240
|
-
this.
|
240
|
+
(_a = this.columnFilterDataSource) === null || _a === void 0 ? void 0 : _a.setApplication(this._application);
|
241
|
+
(_b = this.columnFilterDataSource) === null || _b === void 0 ? void 0 : _b.setDataUnit(this._dataUnit);
|
241
242
|
}
|
242
243
|
componentWillLoad() {
|
243
244
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
@@ -329,11 +330,12 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
329
330
|
return undefined;
|
330
331
|
}
|
331
332
|
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--medium" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
332
|
-
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() })), 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: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.
|
333
|
+
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() })), 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: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), 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), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
|
333
334
|
}
|
334
335
|
get _element() { return this; }
|
335
336
|
static get style() { return snkGridCss; }
|
336
337
|
}, [6, "snk-grid", {
|
338
|
+
"columnFilterDataSource": [1040],
|
337
339
|
"configName": [1, "config-name"],
|
338
340
|
"selectionToastConfig": [16],
|
339
341
|
"actionsList": [16],
|