@sankhyalabs/sankhyablocks 5.4.3 → 5.5.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/{SnkMessageBuilder-115e8a80.js → SnkMessageBuilder-26da04f7.js} +35 -1
- package/dist/cjs/{constants-ae0ed870.js → constants-3787fa32.js} +1 -0
- package/dist/cjs/dataunit-fetcher-8f5ade55.js +319 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +3 -315
- package/dist/cjs/snk-attach.cjs.entry.js +449 -0
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +22 -13
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
- package/dist/cjs/{snk-data-unit-aa613f3b.js → snk-data-unit-c43df27b.js} +4 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +4 -5
- package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +11 -4
- package/dist/cjs/{snk-guides-viewer-7db960c2.js → snk-guides-viewer-e6a65393.js} +2 -2
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -4
- package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
- package/dist/cjs/{snk-simple-crud.cjs.entry.js → snk-simple-bar_2.cjs.entry.js} +47 -5
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +5 -4
- package/dist/cjs/taskbar-elements-80285601.js +313 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/snk-attach/interfaces/index.js +1 -0
- package/dist/collection/components/snk-attach/snk-attach.css +8 -0
- package/dist/collection/components/snk-attach/snk-attach.js +202 -0
- package/dist/collection/components/snk-attach/structure/crud-config-builder.js +37 -0
- package/dist/collection/components/snk-attach/structure/data-unit-builder.js +106 -0
- package/dist/collection/components/snk-attach/structure/index.js +3 -0
- package/dist/collection/components/snk-attach/structure/taskbar-builder.js +47 -0
- package/dist/collection/components/snk-configurator/snk-configurator.js +3 -3
- package/dist/collection/components/snk-crud/snk-crud.js +22 -11
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +21 -0
- package/dist/collection/components/snk-grid/snk-grid.js +11 -3
- package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +37 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +65 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +3 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +4 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/attach-fetcher.js +136 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/ISave.js +6 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/index.js +3 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +5 -1
- package/dist/collection/lib/message/resources/snk-attach.msg.js +27 -0
- package/dist/collection/lib/message/resources/snk-simple-bar.msg.js +3 -0
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -0
- package/dist/collection/lib/utils/constants.js +1 -0
- package/dist/components/SnkMessageBuilder.js +35 -1
- package/dist/components/constants.js +1 -0
- package/dist/components/dataunit-fetcher.js +317 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-application2.js +2 -314
- package/dist/components/snk-attach.d.ts +11 -0
- package/dist/components/snk-attach.js +6 -0
- package/dist/components/snk-attach2.js +498 -0
- package/dist/components/snk-crud.js +77 -48
- package/dist/components/snk-data-unit2.js +4 -0
- package/dist/components/snk-grid2.js +11 -4
- package/dist/components/snk-simple-bar.js +1 -41
- package/dist/components/snk-simple-bar2.js +59 -0
- package/dist/components/snk-simple-crud.js +1 -328
- package/dist/{esm/snk-simple-crud.entry.js → components/snk-simple-crud2.js} +73 -18
- package/dist/components/snk-taskbar2.js +7 -2
- package/dist/esm/{SnkMessageBuilder-a15d22f8.js → SnkMessageBuilder-7a9392e6.js} +35 -1
- package/dist/esm/{constants-15617e7d.js → constants-e916ccc3.js} +1 -0
- package/dist/esm/dataunit-fetcher-d32c6a47.js +317 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +3 -315
- package/dist/esm/snk-attach.entry.js +445 -0
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +23 -14
- package/dist/esm/snk-data-exporter.entry.js +3 -3
- package/dist/esm/{snk-data-unit-5ed93c0e.js → snk-data-unit-f9e4c694.js} +4 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +4 -5
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-grid-config.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +11 -4
- package/dist/esm/{snk-guides-viewer-1e7c21f6.js → snk-guides-viewer-62a9f74d.js} +2 -2
- package/dist/esm/snk-guides-viewer.entry.js +3 -4
- package/dist/esm/snk-select-box.entry.js +1 -1
- package/dist/esm/snk-simple-bar_2.entry.js +324 -0
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +5 -4
- package/dist/esm/taskbar-elements-055ba1ad.js +309 -0
- package/dist/sankhyablocks/p-17375123.js +1 -0
- package/dist/sankhyablocks/{p-b80cf644.entry.js → p-1c0ee011.entry.js} +1 -1
- package/dist/sankhyablocks/p-4512cc6c.entry.js +1 -0
- package/dist/sankhyablocks/p-5cbbe1f7.entry.js +1 -0
- package/dist/sankhyablocks/p-63d01871.entry.js +1 -0
- package/dist/sankhyablocks/{p-0a1e7f75.entry.js → p-6ac29569.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f4d36823.entry.js → p-6f0b3cc0.entry.js} +1 -1
- package/dist/sankhyablocks/p-741b00ef.entry.js +1 -0
- package/dist/sankhyablocks/{p-6516f35a.entry.js → p-86f75e7a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-32599159.entry.js → p-8b02b276.entry.js} +1 -1
- package/dist/sankhyablocks/p-92a0fca4.js +1 -0
- package/dist/sankhyablocks/p-999d1953.entry.js +1 -0
- package/dist/sankhyablocks/{p-9bfa3cfb.entry.js → p-a412992c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-703dddb9.js → p-aeffd219.js} +1 -1
- package/dist/sankhyablocks/p-b2523981.entry.js +11 -0
- package/dist/sankhyablocks/p-c3efd4eb.entry.js +1 -0
- package/dist/sankhyablocks/{p-3169584f.entry.js → p-e0b4aec3.entry.js} +1 -1
- package/dist/sankhyablocks/p-ebe876f5.entry.js +1 -0
- package/dist/sankhyablocks/p-ed438690.js +1 -0
- package/dist/sankhyablocks/p-f2223502.js +1 -0
- package/dist/sankhyablocks/p-f3d0c744.entry.js +1 -0
- package/dist/sankhyablocks/p-f821768b.js +74 -0
- package/dist/sankhyablocks/{p-f29caa0a.entry.js → p-f8c66aa3.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-attach/interfaces/index.d.ts +10 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +45 -0
- package/dist/types/components/snk-attach/structure/crud-config-builder.d.ts +7 -0
- package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +16 -0
- package/dist/types/components/snk-attach/structure/index.d.ts +3 -0
- package/dist/types/components/snk-attach/structure/taskbar-builder.d.ts +8 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +5 -0
- package/dist/types/components/snk-simple-bar/snk-simple-bar.d.ts +14 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +1 -0
- package/dist/types/components.d.ts +67 -0
- package/dist/types/global.d.ts +9 -0
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +8 -2
- package/dist/types/lib/http/data-fetcher/fetchers/attach-fetcher.d.ts +14 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.d.ts +9 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.d.ts +13 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/ISave.d.ts +26 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/index.d.ts +3 -0
- package/dist/types/lib/message/resources/snk-attach.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-simple-bar.msg.d.ts +1 -0
- package/dist/types/lib/utils/constants.d.ts +2 -1
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/index-fc7ca86c.js +0 -200
- package/dist/cjs/snk-simple-bar.cjs.entry.js +0 -30
- package/dist/cjs/taskbar-elements-5e87cf44.js +0 -115
- package/dist/esm/index-e467ade5.js +0 -198
- package/dist/esm/snk-simple-bar.entry.js +0 -26
- package/dist/esm/taskbar-elements-10d80c79.js +0 -112
- package/dist/sankhyablocks/p-1393dc00.entry.js +0 -1
- package/dist/sankhyablocks/p-1c17eecf.entry.js +0 -1
- package/dist/sankhyablocks/p-2ecf14ff.js +0 -1
- package/dist/sankhyablocks/p-340d6fb0.entry.js +0 -84
- package/dist/sankhyablocks/p-74724fa7.js +0 -1
- package/dist/sankhyablocks/p-79f01b63.entry.js +0 -1
- package/dist/sankhyablocks/p-81e85890.entry.js +0 -1
- package/dist/sankhyablocks/p-94e6fc90.entry.js +0 -1
- package/dist/sankhyablocks/p-98f7f796.js +0 -1
- package/dist/sankhyablocks/p-b3e71248.entry.js +0 -1
- package/dist/sankhyablocks/p-bc281de0.js +0 -1
- package/dist/sankhyablocks/p-d61759a5.entry.js +0 -1
- package/dist/sankhyablocks/p-d65809d5.entry.js +0 -1
- package/dist/sankhyablocks/p-f587a454.js +0 -1
- package/dist/types/components/snk-application/snk-application.d.ts +0 -259
- package/dist/types/components/snk-crud/snk-crud.d.ts +0 -73
- package/dist/types/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.d.ts +0 -40
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +0 -27
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +0 -23
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +0 -23
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +0 -29
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +0 -25
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +0 -19
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -38
- package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +0 -74
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +0 -53
- package/dist/types/components/snk-grid/snk-grid.d.ts +0 -95
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -59
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
8
|
+
const taskbarElements = require('./taskbar-elements-80285601.js');
|
8
9
|
const ConfigStorage = require('./ConfigStorage-91adf3fe.js');
|
9
10
|
const index$1 = require('./index-f400b1d6.js');
|
10
11
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
11
|
-
const index$2 = require('./index-fc7ca86c.js');
|
12
12
|
require('./form-config-fetcher-fa19680a.js');
|
13
13
|
require('./DataFetcher-a9d0228f.js');
|
14
14
|
require('./_commonjsHelpers-537d719a.js');
|
@@ -28,7 +28,7 @@ const SnkGrid = class {
|
|
28
28
|
});
|
29
29
|
this._headerTaskbarProcessor = new taskbarProcessor.TaskbarProcessor({
|
30
30
|
"snkGridHeaderTaskbar.unselected": ["REFRESH", "DATA_EXPORTER"],
|
31
|
-
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH", "DATA_EXPORTER"],
|
31
|
+
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", this.getAttachAvailable(), "REFRESH", "DATA_EXPORTER"],
|
32
32
|
"snkGridHeaderTaskbar.detail.unselected": ["REFRESH"],
|
33
33
|
"snkGridHeaderTaskbar.detail.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
|
34
34
|
});
|
@@ -69,6 +69,13 @@ const SnkGrid = class {
|
|
69
69
|
async setConfig(config) {
|
70
70
|
this.setGridConfig(config);
|
71
71
|
}
|
72
|
+
getAttachAvailable() {
|
73
|
+
var _a;
|
74
|
+
const isValidVersion = core.VersionUtils.isRequiredVersion((_a = window.envContext) === null || _a === void 0 ? void 0 : _a.sysVersion, '4.22');
|
75
|
+
if (isValidVersion)
|
76
|
+
return taskbarElements.TaskbarElement.ATTACH;
|
77
|
+
return "";
|
78
|
+
}
|
72
79
|
openGridConfig() {
|
73
80
|
this._grid.getColumnsState()
|
74
81
|
.then((gridColumns) => {
|
@@ -202,7 +209,7 @@ const SnkGrid = class {
|
|
202
209
|
return (_c = (_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
203
210
|
}
|
204
211
|
};
|
205
|
-
|
212
|
+
taskbarElements.store.set("exporterProviders", Object.assign(Object.assign({}, taskbarElements.store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
|
206
213
|
}
|
207
214
|
addElementID() {
|
208
215
|
const dataInfo = { dataUnit: this._dataUnit };
|
@@ -238,7 +245,7 @@ const SnkGrid = class {
|
|
238
245
|
const disabledButtons = [];
|
239
246
|
if ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) {
|
240
247
|
if (this._dataState.selectionInfo.length > 1) {
|
241
|
-
disabledButtons.push(
|
248
|
+
disabledButtons.push(taskbarElements.TaskbarElement.CLONE, "ATTACH");
|
242
249
|
}
|
243
250
|
if (this._dataState.selectionInfo.isAllRecords()) {
|
244
251
|
disabledButtons.push("REMOVE");
|
@@ -5,8 +5,8 @@ const core = require('@sankhyalabs/core');
|
|
5
5
|
const SnkFormConfigManager = require('./SnkFormConfigManager-e1a10283.js');
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
7
7
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
9
|
-
const constants = require('./constants-
|
8
|
+
const taskbarElements = require('./taskbar-elements-80285601.js');
|
9
|
+
const constants = require('./constants-3787fa32.js');
|
10
10
|
require('./DataFetcher-a9d0228f.js');
|
11
11
|
require('./pesquisa-fetcher-954b74c3.js');
|
12
12
|
const index$1 = require('./index-f400b1d6.js');
|
@@ -2,7 +2,7 @@
|
|
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-e6a65393.js');
|
6
6
|
require('./index-21bd01e1.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('./SnkFormConfigManager-e1a10283.js');
|
@@ -12,10 +12,9 @@ require('./DataFetcher-a9d0228f.js');
|
|
12
12
|
require('./_commonjsHelpers-537d719a.js');
|
13
13
|
require('@sankhyalabs/ezui/dist/collection/utils/form');
|
14
14
|
require('./taskbar-processor-bce3f499.js');
|
15
|
-
require('./taskbar-elements-
|
15
|
+
require('./taskbar-elements-80285601.js');
|
16
16
|
require('./index-f400b1d6.js');
|
17
|
-
require('./
|
18
|
-
require('./constants-ae0ed870.js');
|
17
|
+
require('./constants-3787fa32.js');
|
19
18
|
require('./pesquisa-fetcher-954b74c3.js');
|
20
19
|
|
21
20
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
6
|
-
const constants = require('./constants-
|
6
|
+
const constants = require('./constants-3787fa32.js');
|
7
7
|
|
8
8
|
const snkSelectBoxCss = "ez-combo-box{width:100px}.grid-config-combo{--ez-text-input--height:28px;--ez-text-input__input--background-color:#fff;--ez-text-input__input--border-color:#dce0e8}";
|
9
9
|
|
@@ -4,15 +4,51 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const constants = require('./constants-
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
7
|
+
const constants = require('./constants-3787fa32.js');
|
8
|
+
const taskbarElements = require('./taskbar-elements-80285601.js');
|
9
9
|
require('./DataFetcher-a9d0228f.js');
|
10
10
|
require('./pesquisa-fetcher-954b74c3.js');
|
11
11
|
const index$1 = require('./index-f400b1d6.js');
|
12
12
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
13
|
-
require('./index-fc7ca86c.js');
|
14
13
|
require('./_commonjsHelpers-537d719a.js');
|
15
14
|
|
15
|
+
const snkSimpleBarCss = ".sc-snk-simple-bar-h{display:flex;height:100%;width:100%}.simple-bar__container.sc-snk-simple-bar{flex:1;display:flex;align-items:stretch;gap:var(--space--small)}.simple-bar__left-slot.sc-snk-simple-bar{min-width:280px;flex:1;display:flex;align-items:center}.simple-bar__right-slot.sc-snk-simple-bar{flex:1;display:flex;align-items:center;justify-content:flex-end}.simple-bar__column.sc-snk-simple-bar{flex:1;display:flex;flex-direction:column}";
|
16
|
+
|
17
|
+
const SnkSimpleBar = class {
|
18
|
+
constructor(hostRef) {
|
19
|
+
index.registerInstance(this, hostRef);
|
20
|
+
this.clickBreadcrumbItem = index.createEvent(this, "clickBreadcrumbItem", 3);
|
21
|
+
this.exit = index.createEvent(this, "exit", 3);
|
22
|
+
this.label = undefined;
|
23
|
+
this.breadcrumbItens = undefined;
|
24
|
+
this.messagesBuilder = undefined;
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
28
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
29
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
30
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-simple-bar.msg.ts"
|
31
|
+
*/
|
32
|
+
getMessage(key, params) {
|
33
|
+
var _a;
|
34
|
+
if (this.messagesBuilder)
|
35
|
+
return this.messagesBuilder.getMessage(key, params);
|
36
|
+
if ((_a = this._application) === null || _a === void 0 ? void 0 : _a.messagesBuilder)
|
37
|
+
return this._application.messagesBuilder.getMessage(key, params);
|
38
|
+
}
|
39
|
+
componentDidLoad() {
|
40
|
+
if (!this._element)
|
41
|
+
return;
|
42
|
+
core.ElementIDUtils.addIDInfo(this._element);
|
43
|
+
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
44
|
+
}
|
45
|
+
render() {
|
46
|
+
return (index.h("div", { class: "simple-bar__container ez-margin-vertical--medium ez-padding--extra-small" }, index.h("div", { class: "simple-bar__left-slot" }, index.h("ez-button", { class: "ez-padding-right--medium", title: this.getMessage('snkSimpleBar.backTitle'), mode: 'icon', iconName: "arrow_back", size: 'medium', onClick: () => this.exit.emit() }), index.h("div", { class: "simple-bar__column" }, index.h("h1", { class: "ez-title ez-title--primary ez-title--extra-large" }, this.label), index.h("ez-breadcrumb", { items: this.breadcrumbItens, onSelectedItem: ({ detail }) => this.clickBreadcrumbItem.emit(detail) }))), index.h("div", { class: "simple-bar__right-slot" }, index.h("slot", { name: "rightSlot" }))));
|
47
|
+
}
|
48
|
+
get _element() { return index.getElement(this); }
|
49
|
+
};
|
50
|
+
SnkSimpleBar.style = snkSimpleBarCss;
|
51
|
+
|
16
52
|
class InMemoryLoader {
|
17
53
|
constructor(metadata, records) {
|
18
54
|
this.records = records || [];
|
@@ -146,6 +182,9 @@ const SnkSimpleCrud = class {
|
|
146
182
|
this.dataState = undefined;
|
147
183
|
this.dataUnit = undefined;
|
148
184
|
this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
|
185
|
+
this.gridConfig = undefined;
|
186
|
+
this.formConfig = undefined;
|
187
|
+
this.useCancelConfirm = true;
|
149
188
|
this.taskbarManager = undefined;
|
150
189
|
this.messagesBuilder = undefined;
|
151
190
|
}
|
@@ -250,7 +289,9 @@ const SnkSimpleCrud = class {
|
|
250
289
|
fieldMetadata.push(field);
|
251
290
|
});
|
252
291
|
if (fieldMetadata.length > 0) {
|
253
|
-
this.
|
292
|
+
if (!this.formConfig) {
|
293
|
+
this.formConfig = formConfig;
|
294
|
+
}
|
254
295
|
this._metadata = {
|
255
296
|
name: "SimpleCrud",
|
256
297
|
label: "SimpleCrud",
|
@@ -274,7 +315,7 @@ const SnkSimpleCrud = class {
|
|
274
315
|
}
|
275
316
|
render() {
|
276
317
|
var _a;
|
277
|
-
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, onDataStateChange: evt => this.onDataStateChange(evt), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), 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: "simple-crud__taskbar ez-box ez-box--shadow ez-padding--medium", 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, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), "no-header": true }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { dataUnit: this.dataUnit, config: this.
|
318
|
+
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), 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: "simple-crud__taskbar ez-box ez-box--shadow ez-padding--medium", 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, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), config: this.gridConfig, "no-header": true }, 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 }))))));
|
278
319
|
}
|
279
320
|
get _element() { return index.getElement(this); }
|
280
321
|
static get watchers() { return {
|
@@ -284,4 +325,5 @@ const SnkSimpleCrud = class {
|
|
284
325
|
};
|
285
326
|
SnkSimpleCrud.style = snkSimpleCrudCss;
|
286
327
|
|
328
|
+
exports.snk_simple_bar = SnkSimpleBar;
|
287
329
|
exports.snk_simple_crud = SnkSimpleCrud;
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
6
6
|
const draggable_bundle = require('./draggable.bundle-82a25c06.js');
|
7
7
|
const core = require('@sankhyalabs/core');
|
8
|
-
const constants = require('./constants-
|
8
|
+
const constants = require('./constants-3787fa32.js');
|
9
9
|
require('./_commonjsHelpers-537d719a.js');
|
10
10
|
|
11
11
|
const snkTabConfigCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}.sc-snk-tab-config-h{--snk-tab-config--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--snk-tab-config--forward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--snk-tab-config__lower-bar--background-color:var(--color--disable-primary, #e5eaf0);--snk-tab-config__lower-bar--border:2px solid var(--color--disable-primary, #e5eaf0);--snk-tab-config__tab--color:var(--text--primary, #626e82);--snk-tab-config__tab--font-family:var(--font-pattern, \"Roboto\");--snk-tab-config__tab--font-size:var(--title--small, 14px);--snk-tab-config__tab--padding:var(--space--small, 6px) var(--space--medium, 12px);--snk-tab-config__tab-is-active--color:var(--color--primary, #008561);--snk-tab-config__tab-hover--color:var(--color--secondary, #383c45);--snk-tab-config__tab-is-focused--border:1px dashed var(--color--primary, #008561);--snk-tab-config__tab-label--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--snk-tab-config__tab-label--margin-bottom:var(--space--extra-small, 3px);--snk-tab-config__new-button-icon--color:var(--color--secondary-700, #1C1D22);--snk-tab-config__forward-button--background-color:var(--text--primary, #626e82);--snk-tab-config__forward-button-hover--background-color:var(--color--primary, #008561);--snk-tab-config__left-icon--padding-right:var(--space--small, 6px);--snk-tab-config__left-icon--color:var(--text--disable, #AFB6C0);--snk-tab-config__tab-label-disabled--color:var(--text--disable, #AFB6C0);--snk-tab-config__slot--margin-left:var(--space--small, 6px);display:flex;position:relative;width:100%;overflow:hidden}.tab-config__scroll.sc-snk-tab-config{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.tab-config__lower-bar.sc-snk-tab-config{position:absolute;left:0%;right:0%;top:91%;bottom:0%;border-radius:2px;background-color:var(--snk-tab-config__lower-bar--background-color);border:var(--snk-tab-config__lower-bar--border)}.tab-config__tab.sc-snk-tab-config{display:flex;border:none;background-color:unset;cursor:pointer;align-items:center;justify-content:center;min-width:fit-content;color:var(--snk-tab-config__tab--color);font-family:var(--snk-tab-config__tab--font-family);font-size:var(--snk-tab-config__tab--font-size);padding:var(--snk-tab-config__tab--padding)}.tab-config__tab.sc-snk-tab-config:focus,.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{outline:none}.tab-config__tab--is-active.sc-snk-tab-config{position:relative;color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab.sc-snk-tab-config:hover{color:var(--snk-tab-config__tab-hover--color)}.tab-config__tab--is-active.sc-snk-tab-config:hover{color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab--is-active.sc-snk-tab-config::after{content:\"\";position:absolute;width:100%;height:100%;clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out;background-color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab--is-focused.sc-snk-tab-config{border:var(--snk-tab-config__tab-is-focused--border)}.tab-config__tab-label.sc-snk-tab-config{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--snk-tab-config__tab-label--text-shadow);margin-bottom:var(--snk-tab-config__tab-label--margin-bottom)}.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config ez-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__new-button-icon--color)}.tab-config__backward-button.sc-snk-tab-config{left:0px;box-shadow:10px 10px 5px 5px white;background:white}.tab-config__forward-button.sc-snk-tab-config{box-shadow:10px 10px 5px 20px white;background:white}.tab-config__forward-button.sc-snk-tab-config::after,.tab-config__backward-button.sc-snk-tab-config::after{content:'';display:flex;width:10px;height:16px;background-color:var(--snk-tab-config__forward-button--background-color)}.tab-config__forward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--forward-icon);mask-image:var(--snk-tab-config--forward-icon)}.tab-config__backward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--backward-icon);mask-image:var(--snk-tab-config--backward-icon)}.tab-config__forward-button.sc-snk-tab-config:hover::after,.tab-config__backward-button.sc-snk-tab-config:hover::after{background-color:var(--snk-tab-config__forward-button-hover--background-color)}.tab-config__new-button.sc-snk-tab-config:hover ez-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__forward-button-hover--background-color)}.tab-config__hidden.sc-snk-tab-config{display:none}.tab-config__scroll.sc-snk-tab-config::-webkit-scrollbar{display:none}.tab-config__left-icon.sc-snk-tab-config{padding-right:var(--snk-tab-config__left-icon--padding-right);--ez-icon--color:var(--snk-tab-config__left-icon--color)}.tab-config__left-icon--eye-off.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__left-icon--color)}.tab-config__right-icon.sc-snk-tab-config{visibility:hidden;padding-left:var(--snk-tab-config__left-icon--padding-right)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{visibility:visible}.tab-config__tab--is-active.sc-snk-tab-config .tab-config__right-icon.sc-snk-tab-config{visibility:visible;--ez-icon--color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__tab-hover--color)}.tab-config__tab--is-active.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__tab-is-active--color)}.tab-config__actions-button.sc-snk-tab-config{--ez-actions-button__btn-action--min-width:100px;visibility:hidden;opacity:0;transition:visibility 1s linear, opacity 0.3s linear}.tab-config__tab.sc-snk-tab-config:hover .tab-config__actions-button.sc-snk-tab-config{visibility:visible;opacity:1;transition:visibility 0.2s linear, opacity 0.10s linear}[data-draggable-element].sc-snk-tab-config{cursor:grab}.tab-config__tab-label-disabled.sc-snk-tab-config{color:var(--snk-tab-config__tab-label-disabled--color)}.tab-config__slot.sc-snk-tab-config{margin-left:var(--snk-tab-config__slot--margin-left)}";
|
@@ -5,9 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
8
|
+
const taskbarElements = require('./taskbar-elements-80285601.js');
|
9
9
|
const index$1 = require('./index-f400b1d6.js');
|
10
|
-
require('./index-fc7ca86c.js');
|
11
10
|
|
12
11
|
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
|
13
12
|
|
@@ -28,7 +27,8 @@ const SnkTaskbar = class {
|
|
28
27
|
[taskbarElements.TaskbarElement.SAVE]: "snkTaskbar.titleSave",
|
29
28
|
[taskbarElements.TaskbarElement.GRID_MODE]: "snkTaskbar.titleGridMode",
|
30
29
|
[taskbarElements.TaskbarElement.FORM_MODE]: "snkTaskbar.titleFormMode",
|
31
|
-
[taskbarElements.TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator"
|
30
|
+
[taskbarElements.TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator",
|
31
|
+
[taskbarElements.TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
|
32
32
|
};
|
33
33
|
this._permissions = undefined;
|
34
34
|
this.configName = undefined;
|
@@ -135,7 +135,8 @@ const SnkTaskbar = class {
|
|
135
135
|
if (index > 1) {
|
136
136
|
className += "ez-padding-left--medium";
|
137
137
|
}
|
138
|
-
|
138
|
+
const taskbarElement = taskbarElements.TaskbarElement[def.toString()];
|
139
|
+
if (taskbarElement) {
|
139
140
|
return taskbarElements.buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList, this.configName, this.presentationMode);
|
140
141
|
}
|
141
142
|
else {
|
@@ -0,0 +1,313 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
const index = require('./index-21bd01e1.js');
|
4
|
+
const index$1 = require('./index-f400b1d6.js');
|
5
|
+
|
6
|
+
const appendToMap = (map, propName, value) => {
|
7
|
+
const items = map.get(propName);
|
8
|
+
if (!items) {
|
9
|
+
map.set(propName, [value]);
|
10
|
+
}
|
11
|
+
else if (!items.includes(value)) {
|
12
|
+
items.push(value);
|
13
|
+
}
|
14
|
+
};
|
15
|
+
const debounce = (fn, ms) => {
|
16
|
+
let timeoutId;
|
17
|
+
return (...args) => {
|
18
|
+
if (timeoutId) {
|
19
|
+
clearTimeout(timeoutId);
|
20
|
+
}
|
21
|
+
timeoutId = setTimeout(() => {
|
22
|
+
timeoutId = 0;
|
23
|
+
fn(...args);
|
24
|
+
}, ms);
|
25
|
+
};
|
26
|
+
};
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Check if a possible element isConnected.
|
30
|
+
* The property might not be there, so we check for it.
|
31
|
+
*
|
32
|
+
* We want it to return true if isConnected is not a property,
|
33
|
+
* otherwise we would remove these elements and would not update.
|
34
|
+
*
|
35
|
+
* Better leak in Edge than to be useless.
|
36
|
+
*/
|
37
|
+
const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
38
|
+
const cleanupElements = debounce((map) => {
|
39
|
+
for (let key of map.keys()) {
|
40
|
+
map.set(key, map.get(key).filter(isConnected));
|
41
|
+
}
|
42
|
+
}, 2000);
|
43
|
+
const stencilSubscription = () => {
|
44
|
+
if (typeof index.getRenderingRef !== 'function') {
|
45
|
+
// If we are not in a stencil project, we do nothing.
|
46
|
+
// This function is not really exported by @stencil/core.
|
47
|
+
return {};
|
48
|
+
}
|
49
|
+
const elmsToUpdate = new Map();
|
50
|
+
return {
|
51
|
+
dispose: () => elmsToUpdate.clear(),
|
52
|
+
get: (propName) => {
|
53
|
+
const elm = index.getRenderingRef();
|
54
|
+
if (elm) {
|
55
|
+
appendToMap(elmsToUpdate, propName, elm);
|
56
|
+
}
|
57
|
+
},
|
58
|
+
set: (propName) => {
|
59
|
+
const elements = elmsToUpdate.get(propName);
|
60
|
+
if (elements) {
|
61
|
+
elmsToUpdate.set(propName, elements.filter(index.forceUpdate));
|
62
|
+
}
|
63
|
+
cleanupElements(elmsToUpdate);
|
64
|
+
},
|
65
|
+
reset: () => {
|
66
|
+
elmsToUpdate.forEach((elms) => elms.forEach(index.forceUpdate));
|
67
|
+
cleanupElements(elmsToUpdate);
|
68
|
+
},
|
69
|
+
};
|
70
|
+
};
|
71
|
+
|
72
|
+
const unwrap = (val) => (typeof val === 'function' ? val() : val);
|
73
|
+
const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
|
74
|
+
const unwrappedState = unwrap(defaultState);
|
75
|
+
let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
|
76
|
+
const handlers = {
|
77
|
+
dispose: [],
|
78
|
+
get: [],
|
79
|
+
set: [],
|
80
|
+
reset: [],
|
81
|
+
};
|
82
|
+
const reset = () => {
|
83
|
+
var _a;
|
84
|
+
// When resetting the state, the default state may be a function - unwrap it to invoke it.
|
85
|
+
// otherwise, the state won't be properly reset
|
86
|
+
states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
|
87
|
+
handlers.reset.forEach((cb) => cb());
|
88
|
+
};
|
89
|
+
const dispose = () => {
|
90
|
+
// Call first dispose as resetting the state would
|
91
|
+
// cause less updates ;)
|
92
|
+
handlers.dispose.forEach((cb) => cb());
|
93
|
+
reset();
|
94
|
+
};
|
95
|
+
const get = (propName) => {
|
96
|
+
handlers.get.forEach((cb) => cb(propName));
|
97
|
+
return states.get(propName);
|
98
|
+
};
|
99
|
+
const set = (propName, value) => {
|
100
|
+
const oldValue = states.get(propName);
|
101
|
+
if (shouldUpdate(value, oldValue, propName)) {
|
102
|
+
states.set(propName, value);
|
103
|
+
handlers.set.forEach((cb) => cb(propName, value, oldValue));
|
104
|
+
}
|
105
|
+
};
|
106
|
+
const state = (typeof Proxy === 'undefined'
|
107
|
+
? {}
|
108
|
+
: new Proxy(unwrappedState, {
|
109
|
+
get(_, propName) {
|
110
|
+
return get(propName);
|
111
|
+
},
|
112
|
+
ownKeys(_) {
|
113
|
+
return Array.from(states.keys());
|
114
|
+
},
|
115
|
+
getOwnPropertyDescriptor() {
|
116
|
+
return {
|
117
|
+
enumerable: true,
|
118
|
+
configurable: true,
|
119
|
+
};
|
120
|
+
},
|
121
|
+
has(_, propName) {
|
122
|
+
return states.has(propName);
|
123
|
+
},
|
124
|
+
set(_, propName, value) {
|
125
|
+
set(propName, value);
|
126
|
+
return true;
|
127
|
+
},
|
128
|
+
}));
|
129
|
+
const on = (eventName, callback) => {
|
130
|
+
handlers[eventName].push(callback);
|
131
|
+
return () => {
|
132
|
+
removeFromArray(handlers[eventName], callback);
|
133
|
+
};
|
134
|
+
};
|
135
|
+
const onChange = (propName, cb) => {
|
136
|
+
const unSet = on('set', (key, newValue) => {
|
137
|
+
if (key === propName) {
|
138
|
+
cb(newValue);
|
139
|
+
}
|
140
|
+
});
|
141
|
+
// We need to unwrap the defaultState because it might be a function.
|
142
|
+
// Otherwise we might not be sending the right reset value.
|
143
|
+
const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
|
144
|
+
return () => {
|
145
|
+
unSet();
|
146
|
+
unReset();
|
147
|
+
};
|
148
|
+
};
|
149
|
+
const use = (...subscriptions) => {
|
150
|
+
const unsubs = subscriptions.reduce((unsubs, subscription) => {
|
151
|
+
if (subscription.set) {
|
152
|
+
unsubs.push(on('set', subscription.set));
|
153
|
+
}
|
154
|
+
if (subscription.get) {
|
155
|
+
unsubs.push(on('get', subscription.get));
|
156
|
+
}
|
157
|
+
if (subscription.reset) {
|
158
|
+
unsubs.push(on('reset', subscription.reset));
|
159
|
+
}
|
160
|
+
if (subscription.dispose) {
|
161
|
+
unsubs.push(on('dispose', subscription.dispose));
|
162
|
+
}
|
163
|
+
return unsubs;
|
164
|
+
}, []);
|
165
|
+
return () => unsubs.forEach((unsub) => unsub());
|
166
|
+
};
|
167
|
+
const forceUpdate = (key) => {
|
168
|
+
const oldValue = states.get(key);
|
169
|
+
handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
|
170
|
+
};
|
171
|
+
return {
|
172
|
+
state,
|
173
|
+
get,
|
174
|
+
set,
|
175
|
+
on,
|
176
|
+
onChange,
|
177
|
+
use,
|
178
|
+
dispose,
|
179
|
+
reset,
|
180
|
+
forceUpdate,
|
181
|
+
};
|
182
|
+
};
|
183
|
+
const removeFromArray = (array, item) => {
|
184
|
+
const index = array.indexOf(item);
|
185
|
+
if (index >= 0) {
|
186
|
+
array[index] = array[array.length - 1];
|
187
|
+
array.length--;
|
188
|
+
}
|
189
|
+
};
|
190
|
+
|
191
|
+
const createStore = (defaultState, shouldUpdate) => {
|
192
|
+
const map = createObservableMap(defaultState, shouldUpdate);
|
193
|
+
map.use(stencilSubscription());
|
194
|
+
return map;
|
195
|
+
};
|
196
|
+
|
197
|
+
const store = createStore({
|
198
|
+
exporterProviders: {}
|
199
|
+
});
|
200
|
+
|
201
|
+
exports.TaskbarElement = void 0;
|
202
|
+
(function (TaskbarElement) {
|
203
|
+
TaskbarElement["PREVIOUS"] = "PREVIOUS";
|
204
|
+
TaskbarElement["NEXT"] = "NEXT";
|
205
|
+
TaskbarElement["REFRESH"] = "REFRESH";
|
206
|
+
TaskbarElement["UPDATE"] = "UPDATE";
|
207
|
+
TaskbarElement["CLONE"] = "CLONE";
|
208
|
+
TaskbarElement["REMOVE"] = "REMOVE";
|
209
|
+
TaskbarElement["INSERT"] = "INSERT";
|
210
|
+
TaskbarElement["CANCEL"] = "CANCEL";
|
211
|
+
TaskbarElement["SAVE"] = "SAVE";
|
212
|
+
TaskbarElement["GRID_MODE"] = "GRID_MODE";
|
213
|
+
TaskbarElement["FORM_MODE"] = "FORM_MODE";
|
214
|
+
TaskbarElement["MORE_OPTIONS"] = "MORE_OPTIONS";
|
215
|
+
TaskbarElement["DIVIDER"] = "DIVIDER";
|
216
|
+
TaskbarElement["CONFIGURATOR"] = "CONFIGURATOR";
|
217
|
+
TaskbarElement["DATA_EXPORTER"] = "DATA_EXPORTER";
|
218
|
+
TaskbarElement["ATTACH"] = "ATTACH";
|
219
|
+
})(exports.TaskbarElement || (exports.TaskbarElement = {}));
|
220
|
+
exports.AuthorizationElements = void 0;
|
221
|
+
(function (AuthorizationElements) {
|
222
|
+
AuthorizationElements["UPDATE"] = "UPDATE";
|
223
|
+
AuthorizationElements["CLONE"] = "CLONE";
|
224
|
+
AuthorizationElements["REMOVE"] = "REMOVE";
|
225
|
+
AuthorizationElements["INSERT"] = "INSERT";
|
226
|
+
AuthorizationElements["CONFIGURATOR"] = "CONFIGURATOR";
|
227
|
+
})(exports.AuthorizationElements || (exports.AuthorizationElements = {}));
|
228
|
+
exports.VisibleWhenForbidden = void 0;
|
229
|
+
(function (VisibleWhenForbidden) {
|
230
|
+
VisibleWhenForbidden["CONFIGURATOR"] = "CONFIGURATOR";
|
231
|
+
})(exports.VisibleWhenForbidden || (exports.VisibleWhenForbidden = {}));
|
232
|
+
const buildCustomButton = (def, className, dataElementId, action, isEnabled) => {
|
233
|
+
const { hint, text, iconName } = def;
|
234
|
+
if (iconName) {
|
235
|
+
if (text) {
|
236
|
+
return iconTextButton(iconName, def.name, className, dataElementId, hint, text, action, isEnabled);
|
237
|
+
}
|
238
|
+
else {
|
239
|
+
return iconButton(iconName, def.name, className, dataElementId, hint, action, isEnabled);
|
240
|
+
}
|
241
|
+
}
|
242
|
+
else {
|
243
|
+
return textButton(def.name, className, dataElementId, text, hint, action, isEnabled);
|
244
|
+
}
|
245
|
+
};
|
246
|
+
const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, configName, presentationMode) => {
|
247
|
+
var _a;
|
248
|
+
const title = getTitle(element);
|
249
|
+
switch (element) {
|
250
|
+
case exports.TaskbarElement.PREVIOUS:
|
251
|
+
return iconButton("chevron-left", element, className, dataElementId, title, action, isEnabled);
|
252
|
+
case exports.TaskbarElement.NEXT:
|
253
|
+
return iconButton("chevron-right", element, className, dataElementId, title, action, isEnabled);
|
254
|
+
case exports.TaskbarElement.REFRESH:
|
255
|
+
return iconButton("sync", element, className, dataElementId, title, action, isEnabled);
|
256
|
+
case exports.TaskbarElement.UPDATE:
|
257
|
+
return iconButton("edit", element, className, dataElementId, title, action, isEnabled);
|
258
|
+
case exports.TaskbarElement.CLONE:
|
259
|
+
return iconButton("copy", element, className, dataElementId, title, action, isEnabled);
|
260
|
+
case exports.TaskbarElement.REMOVE:
|
261
|
+
return iconButton("delete", element, className, dataElementId, title, action, isEnabled);
|
262
|
+
case exports.TaskbarElement.INSERT:
|
263
|
+
if (presentationMode === index$1.PresentationMode.PRIMARY) {
|
264
|
+
return iconTextButton("plus", element, className, dataElementId, title, title, action, isEnabled);
|
265
|
+
}
|
266
|
+
else {
|
267
|
+
return iconButton("plus", element, className, dataElementId, title, action, isEnabled);
|
268
|
+
}
|
269
|
+
case exports.TaskbarElement.CANCEL:
|
270
|
+
return textButton(element, className, dataElementId, title, title, action, isEnabled);
|
271
|
+
case exports.TaskbarElement.SAVE:
|
272
|
+
if (presentationMode === index$1.PresentationMode.PRIMARY) {
|
273
|
+
return iconTextButton("save", element, className, dataElementId, title, title, action, isEnabled);
|
274
|
+
}
|
275
|
+
else {
|
276
|
+
return iconButton("save", element, className, dataElementId, title, action, isEnabled);
|
277
|
+
}
|
278
|
+
case exports.TaskbarElement.GRID_MODE:
|
279
|
+
return iconButton("table", element, className, dataElementId, title, action, isEnabled);
|
280
|
+
case exports.TaskbarElement.FORM_MODE:
|
281
|
+
return iconButton("list", element, className, dataElementId, title, action, isEnabled);
|
282
|
+
case exports.TaskbarElement.CONFIGURATOR:
|
283
|
+
return iconButton("settings-inverted", element, className, dataElementId, title, action, isEnabled);
|
284
|
+
case exports.TaskbarElement.MORE_OPTIONS:
|
285
|
+
return actionButton(element, className, dataElementId, title, action, isEnabled, actions);
|
286
|
+
case exports.TaskbarElement.DIVIDER:
|
287
|
+
return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
|
288
|
+
case exports.TaskbarElement.DATA_EXPORTER:
|
289
|
+
const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
|
290
|
+
return index.h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId });
|
291
|
+
case exports.TaskbarElement.ATTACH:
|
292
|
+
return iconButton("anexo", element, className, dataElementId, title, action, isEnabled);
|
293
|
+
}
|
294
|
+
};
|
295
|
+
function textButton(name, className, dataElementId, text, title, action, isEnabled) {
|
296
|
+
return index.h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
|
297
|
+
}
|
298
|
+
function iconButton(iconName, name, className, dataElementId, title, action, isEnabled) {
|
299
|
+
return index.h("ez-button", { title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
300
|
+
}
|
301
|
+
function iconTextButton(iconName, name, className, dataElementId, text, title, action, isEnabled) {
|
302
|
+
return index.h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
|
303
|
+
index.h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
304
|
+
}
|
305
|
+
function actionButton(element, className, dataElementId, title, action, isEnabled, actions) {
|
306
|
+
return actions && actions.length > 0
|
307
|
+
? index.h("ez-actions-button", { title: title, size: "small", "data-element-id": dataElementId, arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
|
308
|
+
: undefined;
|
309
|
+
}
|
310
|
+
|
311
|
+
exports.buildCustomButton = buildCustomButton;
|
312
|
+
exports.buildElem = buildElem;
|
313
|
+
exports.store = store;
|
@@ -7,6 +7,8 @@
|
|
7
7
|
"./components/snk-filter-bar/filter-list/snk-filter-list.js",
|
8
8
|
"./components/snk-filter-bar/filter-modal/snk-filter-modal.js",
|
9
9
|
"./components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js",
|
10
|
+
"./components/snk-simple-crud/snk-simple-crud.js",
|
11
|
+
"./components/snk-attach/snk-attach.js",
|
10
12
|
"./components/snk-configurator/snk-configurator.js",
|
11
13
|
"./components/snk-crud/snk-crud.js",
|
12
14
|
"./components/snk-crud/subcomponents/snk-guides-viewer.js",
|
@@ -35,7 +37,6 @@
|
|
35
37
|
"./components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js",
|
36
38
|
"./components/snk-pesquisa/snk-pesquisa.js",
|
37
39
|
"./components/snk-simple-bar/snk-simple-bar.js",
|
38
|
-
"./components/snk-simple-crud/snk-simple-crud.js",
|
39
40
|
"./components/teste-pesquisa/teste-pesquisa.js"
|
40
41
|
],
|
41
42
|
"compiler": {
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|