@sankhyalabs/sankhyablocks 1.4.0-beta.6 → 1.4.0-beta.8
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-b54dfb89.js → SnkMessageBuilder-6c2f7bcd.js} +87 -11
- package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
- package/dist/cjs/configurableElementsStorage-93459c72.js +20 -0
- package/dist/cjs/constants-aebcc2f5.js +69 -0
- package/dist/cjs/draggable.bundle-82a25c06.js +6886 -0
- package/dist/cjs/form-config-fetcher-2de7c16a.js +6895 -0
- package/dist/cjs/{index-6fcf07f3.js → index-188190ee.js} +2 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +240 -6972
- package/dist/cjs/snk-config-modal.cjs.entry.js +62 -0
- package/dist/cjs/snk-config-options.cjs.entry.js +163 -0
- package/dist/cjs/{snk-filter-bar_5.cjs.entry.js → snk-configurator_6.cjs.entry.js} +193 -6
- package/dist/cjs/snk-crud.cjs.entry.js +13 -11
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-field-config_2.cjs.entry.js +135 -0
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +957 -0
- package/dist/cjs/snk-form.cjs.entry.js +146 -0
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-tab-config.cjs.entry.js +321 -0
- package/dist/cjs/{taskbar-elements-aedfeae6.js → taskbar-elements-4c2c6704.js} +10 -6
- package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +27 -1
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +1 -1
- package/dist/collection/components/snk-application/snk-application.js +144 -23
- package/dist/collection/components/snk-configurator/snk-configurator.js +261 -0
- package/dist/collection/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.js +16 -0
- package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.css +122 -0
- package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.js +137 -0
- package/dist/collection/components/snk-crud/snk-crud.js +15 -13
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +33 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +3 -3
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
- package/dist/collection/components/snk-form/snk-form.css +4 -0
- package/dist/collection/components/snk-form/snk-form.js +108 -30
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.css +9 -0
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.js +248 -0
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.css +164 -0
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +140 -0
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.css +185 -0
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +1062 -0
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.css +272 -0
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +476 -0
- package/dist/collection/components/snk-grid/snk-grid.js +92 -22
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +9 -5
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +35 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +35 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +106 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +9 -1
- package/dist/collection/lib/message/SnkMessageBuilder.js +8 -1
- package/dist/collection/lib/message/resources/snk-configurator.msg.js +11 -0
- package/dist/collection/lib/message/resources/snk-form.msg.js +59 -2
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -1
- package/dist/collection/lib/utils/constants.js +58 -0
- package/dist/components/SnkMessageBuilder.js +87 -11
- package/dist/components/_commonjsHelpers.js +17 -0
- package/dist/components/constants.js +60 -0
- package/dist/components/form-config-fetcher.js +6889 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +6 -0
- package/dist/components/snk-application2.js +225 -6954
- package/dist/components/snk-config-modal.d.ts +11 -0
- package/dist/components/snk-config-modal.js +6 -0
- package/dist/components/snk-config-modal2.js +91 -0
- package/dist/components/snk-config-options.d.ts +11 -0
- package/dist/components/snk-config-options.js +6 -0
- package/dist/components/snk-config-options2.js +178 -0
- package/dist/components/snk-configurator.d.ts +11 -0
- package/dist/components/snk-configurator.js +6 -0
- package/dist/components/snk-configurator2.js +212 -0
- package/dist/components/snk-crud.js +62 -25
- package/dist/components/snk-field-config.d.ts +11 -0
- package/dist/components/snk-field-config.js +6 -0
- package/dist/components/snk-field-config2.js +70 -0
- package/dist/components/snk-filter-bar2.js +1 -1
- package/dist/components/snk-filter-personalized.js +2 -0
- package/dist/components/snk-form-config.d.ts +11 -0
- package/dist/components/snk-form-config.js +6 -0
- package/dist/components/snk-form-config2.js +996 -0
- package/dist/components/snk-form2.js +79 -29
- package/dist/components/snk-grid2.js +43 -24
- package/dist/components/snk-tab-config.d.ts +11 -0
- package/dist/components/snk-tab-config.js +6 -0
- package/dist/components/snk-tab-config2.js +7220 -0
- package/dist/components/snk-taskbar2.js +27 -9
- package/dist/esm/{SnkMessageBuilder-d440381c.js → SnkMessageBuilder-5792c260.js} +87 -11
- package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
- package/dist/esm/configurableElementsStorage-cdc144b5.js +18 -0
- package/dist/esm/constants-c4e3341e.js +60 -0
- package/dist/esm/draggable.bundle-41d56f06.js +6884 -0
- package/dist/esm/form-config-fetcher-96c6c2dc.js +6889 -0
- package/dist/esm/{index-81dda3cf.js → index-bafb2cef.js} +2 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-application.entry.js +224 -6956
- package/dist/esm/snk-config-modal.entry.js +58 -0
- package/dist/esm/snk-config-options.entry.js +159 -0
- package/dist/esm/{snk-filter-bar_5.entry.js → snk-configurator_6.entry.js} +194 -8
- package/dist/esm/snk-crud.entry.js +13 -11
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-field-config_2.entry.js +130 -0
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-detail.entry.js +1 -1
- package/dist/esm/snk-filter-multi-select.entry.js +1 -1
- package/dist/esm/snk-filter-number.entry.js +1 -1
- package/dist/esm/snk-filter-period.entry.js +1 -1
- package/dist/esm/snk-filter-personalized.entry.js +1 -1
- package/dist/esm/snk-filter-search.entry.js +1 -1
- package/dist/esm/snk-filter-text.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +953 -0
- package/dist/esm/snk-form.entry.js +142 -0
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-tab-config.entry.js +317 -0
- package/dist/esm/{taskbar-elements-38eb5d51.js → taskbar-elements-2035b1c7.js} +10 -6
- package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/p-03f9c407.js +1 -0
- package/dist/sankhyablocks/{p-ba426ea9.entry.js → p-04ad681a.entry.js} +1 -1
- package/dist/sankhyablocks/p-112455b1.js +1 -0
- package/dist/sankhyablocks/p-1963b46f.entry.js +1 -0
- package/dist/sankhyablocks/p-21c8929b.js +1 -0
- package/dist/sankhyablocks/p-26c503a6.entry.js +1 -0
- package/dist/sankhyablocks/{p-2e49afef.entry.js → p-31631fb6.entry.js} +1 -1
- package/dist/sankhyablocks/p-361299e8.js +26 -0
- package/dist/sankhyablocks/p-434e0dcf.entry.js +1 -0
- package/dist/sankhyablocks/{p-aecf3e0a.entry.js → p-6c61416a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-49580cdd.entry.js → p-857c4735.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4574a955.entry.js → p-8cd8977c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6386d720.entry.js → p-916068ff.entry.js} +1 -1
- package/dist/sankhyablocks/p-9f2c5fac.entry.js +1 -0
- package/dist/sankhyablocks/p-ad658f44.js +1 -0
- package/dist/sankhyablocks/p-ae302037.entry.js +75 -0
- package/dist/sankhyablocks/p-af11b0e7.js +1 -0
- package/dist/sankhyablocks/p-af306302.entry.js +1 -0
- package/dist/sankhyablocks/p-b6d6b172.js +1 -0
- package/dist/sankhyablocks/{p-40b27004.entry.js → p-cc85ba53.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0352c0e2.entry.js → p-ccdf59eb.entry.js} +1 -1
- package/dist/sankhyablocks/p-ce789145.entry.js +1 -0
- package/dist/sankhyablocks/p-cf81e313.entry.js +1 -0
- package/dist/sankhyablocks/{p-0ea25487.entry.js → p-d1ae76ec.entry.js} +1 -1
- package/dist/sankhyablocks/p-d50651a3.js +1 -0
- package/dist/sankhyablocks/{p-fac2b6a9.js → p-ddb03141.js} +2 -2
- package/dist/sankhyablocks/p-ee906940.entry.js +1 -0
- package/dist/sankhyablocks/{p-5bdb8452.entry.js → p-f9084ecb.entry.js} +1 -1
- package/dist/sankhyablocks/p-fa75fba5.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +29 -14
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +46 -0
- package/dist/types/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.d.ts +8 -0
- package/dist/types/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.d.ts +38 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +50 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +92 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +8 -6
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +3 -3
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +40 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +65 -0
- package/dist/types/components/snk-form/snk-form.d.ts +71 -0
- package/dist/types/components/snk-form/subcomponents/snk-config-options/snk-config-options.d.ts +41 -0
- package/dist/types/components/snk-form/subcomponents/snk-field-config/snk-field-config.d.ts +32 -0
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +139 -0
- package/dist/types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.d.ts +97 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +59 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +6 -5
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -3
- package/dist/types/components.d.ts +358 -13
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +21 -3
- package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +1 -0
- package/dist/types/lib/message/resources/snk-configurator.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-form.msg.d.ts +5 -2
- package/dist/types/lib/utils/constants.d.ts +62 -0
- package/dist/types/lib/utils/pesquisa.d.ts +2 -1
- package/package.json +4 -3
- package/react/components.d.ts +6 -0
- package/react/components.js +6 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/snk-form_2.cjs.entry.js +0 -247
- package/dist/esm/snk-form_2.entry.js +0 -242
- package/dist/sankhyablocks/p-1a58f45c.entry.js +0 -74
- package/dist/sankhyablocks/p-21e940aa.entry.js +0 -1
- package/dist/sankhyablocks/p-2eea7eea.js +0 -1
- package/dist/sankhyablocks/p-77216252.entry.js +0 -1
- package/dist/sankhyablocks/p-86f15ffe.js +0 -1
- package/dist/sankhyablocks/p-97009a2c.entry.js +0 -1
- package/dist/sankhyablocks/p-a14c49db.entry.js +0 -1
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-6fcf07f3.js');
|
|
6
|
-
const core = require('@sankhyalabs/core');
|
|
7
|
-
const taskbarElements = require('./taskbar-elements-aedfeae6.js');
|
|
8
|
-
|
|
9
|
-
class TaskbarProcessor {
|
|
10
|
-
constructor(defaultButtons) {
|
|
11
|
-
this._defaultButtons = defaultButtons;
|
|
12
|
-
}
|
|
13
|
-
process(taskbarId, taskbarManager, dataState, disabledButtons = []) {
|
|
14
|
-
var _a;
|
|
15
|
-
this.customButtons = new Map();
|
|
16
|
-
this.buttons = "";
|
|
17
|
-
this.disabledButtons = [];
|
|
18
|
-
(_a = this.getButtonsArray(taskbarId, taskbarManager, dataState)) === null || _a === void 0 ? void 0 : _a.forEach(btnDef => {
|
|
19
|
-
let buttonName;
|
|
20
|
-
if (typeof btnDef === "string") {
|
|
21
|
-
buttonName = btnDef;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
const customBtn = btnDef;
|
|
25
|
-
this.customButtons.set(customBtn.name, customBtn);
|
|
26
|
-
buttonName = customBtn.name;
|
|
27
|
-
}
|
|
28
|
-
if (!this.isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabledButtons)) {
|
|
29
|
-
this.disabledButtons.push(buttonName);
|
|
30
|
-
}
|
|
31
|
-
if (this.buttons.length > 0) {
|
|
32
|
-
this.buttons += ",";
|
|
33
|
-
}
|
|
34
|
-
this.buttons += buttonName;
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
getButtonsArray(taskbarId, taskbarManager, dataState) {
|
|
38
|
-
const defaults = this._defaultButtons[taskbarId];
|
|
39
|
-
if (taskbarManager) {
|
|
40
|
-
return taskbarManager.getButtons(taskbarId, dataState, [...defaults]);
|
|
41
|
-
}
|
|
42
|
-
return defaults;
|
|
43
|
-
}
|
|
44
|
-
isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabled) {
|
|
45
|
-
const originalValue = disabled.includes(buttonName) ? false : true;
|
|
46
|
-
if (taskbarManager && taskbarManager.isEnabled) {
|
|
47
|
-
return taskbarManager.isEnabled(taskbarId, dataState, buttonName, originalValue);
|
|
48
|
-
}
|
|
49
|
-
return originalValue;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const snkFormCss = ".sc-snk-form-h{display:block}.snk-form.sc-snk-form{position:relative;padding:var(--space--large);padding-top:var(--space--medium)}.snk-form__header.sc-snk-form{position:relative;padding-top:var(--space--medium);padding-bottom:var(--space--medium);margin-bottom:var(--space--medium)}.snk-form__header--fixed.sc-snk-form{position:sticky;top:0;background:var(--background--body);z-index:var(--more-visible, 2);padding-left:var(--space--large);padding-right:var(--space--large);margin-left:calc(var(--space--large) * -1);margin-right:calc(var(--space--large) * -1);width:calc(100% + (var(--space--large) * 2))}";
|
|
54
|
-
|
|
55
|
-
const SnkForm = class {
|
|
56
|
-
constructor(hostRef) {
|
|
57
|
-
index.registerInstance(this, hostRef);
|
|
58
|
-
this.exit = index.createEvent(this, "exit", 7);
|
|
59
|
-
this.actionClick = index.createEvent(this, "actionClick", 7);
|
|
60
|
-
this._taskbarProcessor = new TaskbarProcessor({
|
|
61
|
-
"snkForm.regular": ["PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "GRID_MODE", "INSERT"],
|
|
62
|
-
"snkForm.finish_edition": ["CANCEL", "SAVE"]
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
getFormConfig() {
|
|
66
|
-
return (this._dataState && this._dataState.insertionMode ? this._insertionFormConfig : this._editionFormConfig);
|
|
67
|
-
}
|
|
68
|
-
getInsertionHiddenFields(formConfig) {
|
|
69
|
-
const hiddenFields = [];
|
|
70
|
-
formConfig === null || formConfig === void 0 ? void 0 : formConfig.forEach(cfg => {
|
|
71
|
-
const def = this._dataUnit.getField(cfg.name);
|
|
72
|
-
if (def === null || def === void 0 ? void 0 : def.readOnly) {
|
|
73
|
-
hiddenFields.push(cfg.name);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
return hiddenFields;
|
|
77
|
-
}
|
|
78
|
-
exitForm() {
|
|
79
|
-
if (this._dataUnit.isDirty()) {
|
|
80
|
-
this._dataUnit.cancelEdition({ after: () => this.exit.emit() });
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
this.exit.emit();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
getDisabledButtons() {
|
|
87
|
-
const disabled = [];
|
|
88
|
-
if (!this._dataState.hasPrevious) {
|
|
89
|
-
disabled.push("PREVIOUS");
|
|
90
|
-
}
|
|
91
|
-
if (!this._dataState.hasNext) {
|
|
92
|
-
disabled.push("NEXT");
|
|
93
|
-
}
|
|
94
|
-
return disabled;
|
|
95
|
-
}
|
|
96
|
-
loadInsertionConfig() {
|
|
97
|
-
if (this._dataUnit && this._configLoaded) {
|
|
98
|
-
this._insertionFormConfig = this._editionFormConfig.filter(fieldCfg => {
|
|
99
|
-
const def = this._dataUnit.getField(fieldCfg.name);
|
|
100
|
-
if (def === null || def === void 0 ? void 0 : def.readOnly) {
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
return true;
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
109
|
-
* através de um pequeno modulo na estrutura da aplicação:
|
|
110
|
-
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
111
|
-
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-form.msg.ts"
|
|
112
|
-
*/
|
|
113
|
-
getMessage(key) {
|
|
114
|
-
return this._application.messagesBuilder.getMessage(key, this.getMessageParams());
|
|
115
|
-
}
|
|
116
|
-
getMessageParams() {
|
|
117
|
-
var _a;
|
|
118
|
-
return ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectedRecords) ? this._dataState.selectedRecords[0] : undefined;
|
|
119
|
-
}
|
|
120
|
-
componentWillLoad() {
|
|
121
|
-
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
122
|
-
if (this._application) {
|
|
123
|
-
this._application.loadFormConfig(this.configName).then(cfg => {
|
|
124
|
-
this._configLoaded = true;
|
|
125
|
-
this._editionFormConfig = cfg;
|
|
126
|
-
this.loadInsertionConfig();
|
|
127
|
-
});
|
|
128
|
-
//Forçamos a carga dos acessos pra aproveitar a request inicial.
|
|
129
|
-
this._application.getAllAccess();
|
|
130
|
-
}
|
|
131
|
-
let parent = this._element.parentElement;
|
|
132
|
-
while (parent) {
|
|
133
|
-
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
134
|
-
this._snkDataUnit = parent;
|
|
135
|
-
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
136
|
-
this._dataState = this._snkDataUnit.dataState;
|
|
137
|
-
if (this._dataUnit) {
|
|
138
|
-
this.loadInsertionConfig();
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
142
|
-
this._dataUnit = evt.detail;
|
|
143
|
-
this.loadInsertionConfig();
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
|
|
147
|
-
this._dataState = evt.detail;
|
|
148
|
-
});
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
parent = parent.parentElement;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
componentWillRender() {
|
|
155
|
-
var _a;
|
|
156
|
-
const taskbarId = ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "snkForm.finish_edition" : "snkForm.regular";
|
|
157
|
-
const disabledButtons = [];
|
|
158
|
-
if (!this._dataState || !this._dataState.hasPrevious) {
|
|
159
|
-
disabledButtons.push("PREVIOUS");
|
|
160
|
-
}
|
|
161
|
-
if (!this._dataState || !this._dataState.hasNext) {
|
|
162
|
-
disabledButtons.push("NEXT");
|
|
163
|
-
}
|
|
164
|
-
this._taskbarProcessor.process(taskbarId, this.taskbarManager, this._dataState, disabledButtons);
|
|
165
|
-
}
|
|
166
|
-
render() {
|
|
167
|
-
var _a;
|
|
168
|
-
if (!this._configLoaded || !this._dataUnit || !this._dataState) {
|
|
169
|
-
return undefined;
|
|
170
|
-
}
|
|
171
|
-
return (index.h("section", { class: "snk-form" }, index.h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, index.h("ez-button", { title: this.getMessage("snkForm.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm() }), index.h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, index.h("snk-taskbar", { key: "formTaskbar", buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, primaryButton: ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", dataUnit: this._dataUnit }))), index.h("section", null, index.h("div", { class: "ez-row" }, index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator }))))));
|
|
172
|
-
}
|
|
173
|
-
get _element() { return index.getElement(this); }
|
|
174
|
-
};
|
|
175
|
-
SnkForm.style = snkFormCss;
|
|
176
|
-
|
|
177
|
-
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--small)}";
|
|
178
|
-
|
|
179
|
-
const SnkGrid = class {
|
|
180
|
-
constructor(hostRef) {
|
|
181
|
-
index.registerInstance(this, hostRef);
|
|
182
|
-
this.actionClick = index.createEvent(this, "actionClick", 7);
|
|
183
|
-
this.gridDoubleClick = index.createEvent(this, "gridDoubleClick", 7);
|
|
184
|
-
this._topTaskbarProcessor = new TaskbarProcessor({
|
|
185
|
-
"snkGridTopTaskbar": ["FORM_MODE", "CONFIG_GRID", "INSERT"]
|
|
186
|
-
});
|
|
187
|
-
this._headerTaskbarProcessor = new TaskbarProcessor({
|
|
188
|
-
"snkGridHeaderTaskbar.unselected": ["REFRESH"],
|
|
189
|
-
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
actionClickHandler(evt) {
|
|
193
|
-
if (evt.detail === taskbarElements.TaskbarElement.CONFIG_GRID && this._grid) {
|
|
194
|
-
this._grid.openGridConfig();
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
saveConfig(config) {
|
|
198
|
-
const snkApplication = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
199
|
-
if (snkApplication) {
|
|
200
|
-
snkApplication.saveGridConfig(config);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
componentWillLoad() {
|
|
204
|
-
const snkApplication = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
205
|
-
if (snkApplication) {
|
|
206
|
-
snkApplication.loadGridConfig(this.configName).then(cfg => {
|
|
207
|
-
this._gridConfig = cfg;
|
|
208
|
-
this._configLoaded = true;
|
|
209
|
-
});
|
|
210
|
-
//Forçamos a carga dos acessos pra aproveitar a request inicial.
|
|
211
|
-
snkApplication.getAllAccess();
|
|
212
|
-
}
|
|
213
|
-
let parent = this._element.parentElement;
|
|
214
|
-
while (parent) {
|
|
215
|
-
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
216
|
-
this._snkDataUnit = parent;
|
|
217
|
-
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
218
|
-
if (!this._dataUnit) {
|
|
219
|
-
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
220
|
-
this._dataUnit = evt.detail;
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
|
|
224
|
-
this._dataState = evt.detail;
|
|
225
|
-
});
|
|
226
|
-
break;
|
|
227
|
-
}
|
|
228
|
-
parent = parent.parentElement;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
componentWillRender() {
|
|
232
|
-
const headerTaskbarId = this._dataState && this._dataState.selectedRecords.length > 0 ? "snkGridHeaderTaskbar.selected" : "snkGridHeaderTaskbar.unselected";
|
|
233
|
-
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState);
|
|
234
|
-
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
|
|
235
|
-
}
|
|
236
|
-
render() {
|
|
237
|
-
if (!this._configLoaded || !this._dataUnit) {
|
|
238
|
-
return undefined;
|
|
239
|
-
}
|
|
240
|
-
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-padding-bottom--medium ez-margin-bottom--medium" }, index.h("snk-filter-bar", { dataUnit: this._dataUnit, class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), 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", onActionClick: evt => this.actionClickHandler(evt), key: "topTaskbar", dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), index.h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: evt => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver }, index.h("snk-taskbar", { dataUnit: this._dataUnit, 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" }))));
|
|
241
|
-
}
|
|
242
|
-
get _element() { return index.getElement(this); }
|
|
243
|
-
};
|
|
244
|
-
SnkGrid.style = snkGridCss;
|
|
245
|
-
|
|
246
|
-
exports.snk_form = SnkForm;
|
|
247
|
-
exports.snk_grid = SnkGrid;
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-81dda3cf.js';
|
|
2
|
-
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
-
import { T as TaskbarElement } from './taskbar-elements-38eb5d51.js';
|
|
4
|
-
|
|
5
|
-
class TaskbarProcessor {
|
|
6
|
-
constructor(defaultButtons) {
|
|
7
|
-
this._defaultButtons = defaultButtons;
|
|
8
|
-
}
|
|
9
|
-
process(taskbarId, taskbarManager, dataState, disabledButtons = []) {
|
|
10
|
-
var _a;
|
|
11
|
-
this.customButtons = new Map();
|
|
12
|
-
this.buttons = "";
|
|
13
|
-
this.disabledButtons = [];
|
|
14
|
-
(_a = this.getButtonsArray(taskbarId, taskbarManager, dataState)) === null || _a === void 0 ? void 0 : _a.forEach(btnDef => {
|
|
15
|
-
let buttonName;
|
|
16
|
-
if (typeof btnDef === "string") {
|
|
17
|
-
buttonName = btnDef;
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
const customBtn = btnDef;
|
|
21
|
-
this.customButtons.set(customBtn.name, customBtn);
|
|
22
|
-
buttonName = customBtn.name;
|
|
23
|
-
}
|
|
24
|
-
if (!this.isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabledButtons)) {
|
|
25
|
-
this.disabledButtons.push(buttonName);
|
|
26
|
-
}
|
|
27
|
-
if (this.buttons.length > 0) {
|
|
28
|
-
this.buttons += ",";
|
|
29
|
-
}
|
|
30
|
-
this.buttons += buttonName;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
getButtonsArray(taskbarId, taskbarManager, dataState) {
|
|
34
|
-
const defaults = this._defaultButtons[taskbarId];
|
|
35
|
-
if (taskbarManager) {
|
|
36
|
-
return taskbarManager.getButtons(taskbarId, dataState, [...defaults]);
|
|
37
|
-
}
|
|
38
|
-
return defaults;
|
|
39
|
-
}
|
|
40
|
-
isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabled) {
|
|
41
|
-
const originalValue = disabled.includes(buttonName) ? false : true;
|
|
42
|
-
if (taskbarManager && taskbarManager.isEnabled) {
|
|
43
|
-
return taskbarManager.isEnabled(taskbarId, dataState, buttonName, originalValue);
|
|
44
|
-
}
|
|
45
|
-
return originalValue;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const snkFormCss = ".sc-snk-form-h{display:block}.snk-form.sc-snk-form{position:relative;padding:var(--space--large);padding-top:var(--space--medium)}.snk-form__header.sc-snk-form{position:relative;padding-top:var(--space--medium);padding-bottom:var(--space--medium);margin-bottom:var(--space--medium)}.snk-form__header--fixed.sc-snk-form{position:sticky;top:0;background:var(--background--body);z-index:var(--more-visible, 2);padding-left:var(--space--large);padding-right:var(--space--large);margin-left:calc(var(--space--large) * -1);margin-right:calc(var(--space--large) * -1);width:calc(100% + (var(--space--large) * 2))}";
|
|
50
|
-
|
|
51
|
-
const SnkForm = class {
|
|
52
|
-
constructor(hostRef) {
|
|
53
|
-
registerInstance(this, hostRef);
|
|
54
|
-
this.exit = createEvent(this, "exit", 7);
|
|
55
|
-
this.actionClick = createEvent(this, "actionClick", 7);
|
|
56
|
-
this._taskbarProcessor = new TaskbarProcessor({
|
|
57
|
-
"snkForm.regular": ["PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "GRID_MODE", "INSERT"],
|
|
58
|
-
"snkForm.finish_edition": ["CANCEL", "SAVE"]
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
getFormConfig() {
|
|
62
|
-
return (this._dataState && this._dataState.insertionMode ? this._insertionFormConfig : this._editionFormConfig);
|
|
63
|
-
}
|
|
64
|
-
getInsertionHiddenFields(formConfig) {
|
|
65
|
-
const hiddenFields = [];
|
|
66
|
-
formConfig === null || formConfig === void 0 ? void 0 : formConfig.forEach(cfg => {
|
|
67
|
-
const def = this._dataUnit.getField(cfg.name);
|
|
68
|
-
if (def === null || def === void 0 ? void 0 : def.readOnly) {
|
|
69
|
-
hiddenFields.push(cfg.name);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
return hiddenFields;
|
|
73
|
-
}
|
|
74
|
-
exitForm() {
|
|
75
|
-
if (this._dataUnit.isDirty()) {
|
|
76
|
-
this._dataUnit.cancelEdition({ after: () => this.exit.emit() });
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
this.exit.emit();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
getDisabledButtons() {
|
|
83
|
-
const disabled = [];
|
|
84
|
-
if (!this._dataState.hasPrevious) {
|
|
85
|
-
disabled.push("PREVIOUS");
|
|
86
|
-
}
|
|
87
|
-
if (!this._dataState.hasNext) {
|
|
88
|
-
disabled.push("NEXT");
|
|
89
|
-
}
|
|
90
|
-
return disabled;
|
|
91
|
-
}
|
|
92
|
-
loadInsertionConfig() {
|
|
93
|
-
if (this._dataUnit && this._configLoaded) {
|
|
94
|
-
this._insertionFormConfig = this._editionFormConfig.filter(fieldCfg => {
|
|
95
|
-
const def = this._dataUnit.getField(fieldCfg.name);
|
|
96
|
-
if (def === null || def === void 0 ? void 0 : def.readOnly) {
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
return true;
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
105
|
-
* através de um pequeno modulo na estrutura da aplicação:
|
|
106
|
-
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
107
|
-
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-form.msg.ts"
|
|
108
|
-
*/
|
|
109
|
-
getMessage(key) {
|
|
110
|
-
return this._application.messagesBuilder.getMessage(key, this.getMessageParams());
|
|
111
|
-
}
|
|
112
|
-
getMessageParams() {
|
|
113
|
-
var _a;
|
|
114
|
-
return ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectedRecords) ? this._dataState.selectedRecords[0] : undefined;
|
|
115
|
-
}
|
|
116
|
-
componentWillLoad() {
|
|
117
|
-
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
118
|
-
if (this._application) {
|
|
119
|
-
this._application.loadFormConfig(this.configName).then(cfg => {
|
|
120
|
-
this._configLoaded = true;
|
|
121
|
-
this._editionFormConfig = cfg;
|
|
122
|
-
this.loadInsertionConfig();
|
|
123
|
-
});
|
|
124
|
-
//Forçamos a carga dos acessos pra aproveitar a request inicial.
|
|
125
|
-
this._application.getAllAccess();
|
|
126
|
-
}
|
|
127
|
-
let parent = this._element.parentElement;
|
|
128
|
-
while (parent) {
|
|
129
|
-
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
130
|
-
this._snkDataUnit = parent;
|
|
131
|
-
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
132
|
-
this._dataState = this._snkDataUnit.dataState;
|
|
133
|
-
if (this._dataUnit) {
|
|
134
|
-
this.loadInsertionConfig();
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
138
|
-
this._dataUnit = evt.detail;
|
|
139
|
-
this.loadInsertionConfig();
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
|
|
143
|
-
this._dataState = evt.detail;
|
|
144
|
-
});
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
parent = parent.parentElement;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
componentWillRender() {
|
|
151
|
-
var _a;
|
|
152
|
-
const taskbarId = ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "snkForm.finish_edition" : "snkForm.regular";
|
|
153
|
-
const disabledButtons = [];
|
|
154
|
-
if (!this._dataState || !this._dataState.hasPrevious) {
|
|
155
|
-
disabledButtons.push("PREVIOUS");
|
|
156
|
-
}
|
|
157
|
-
if (!this._dataState || !this._dataState.hasNext) {
|
|
158
|
-
disabledButtons.push("NEXT");
|
|
159
|
-
}
|
|
160
|
-
this._taskbarProcessor.process(taskbarId, this.taskbarManager, this._dataState, disabledButtons);
|
|
161
|
-
}
|
|
162
|
-
render() {
|
|
163
|
-
var _a;
|
|
164
|
-
if (!this._configLoaded || !this._dataUnit || !this._dataState) {
|
|
165
|
-
return undefined;
|
|
166
|
-
}
|
|
167
|
-
return (h("section", { class: "snk-form" }, h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, h("ez-button", { title: this.getMessage("snkForm.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm() }), h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, h("snk-taskbar", { key: "formTaskbar", buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, primaryButton: ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", dataUnit: this._dataUnit }))), h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator }))))));
|
|
168
|
-
}
|
|
169
|
-
get _element() { return getElement(this); }
|
|
170
|
-
};
|
|
171
|
-
SnkForm.style = snkFormCss;
|
|
172
|
-
|
|
173
|
-
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--small)}";
|
|
174
|
-
|
|
175
|
-
const SnkGrid = class {
|
|
176
|
-
constructor(hostRef) {
|
|
177
|
-
registerInstance(this, hostRef);
|
|
178
|
-
this.actionClick = createEvent(this, "actionClick", 7);
|
|
179
|
-
this.gridDoubleClick = createEvent(this, "gridDoubleClick", 7);
|
|
180
|
-
this._topTaskbarProcessor = new TaskbarProcessor({
|
|
181
|
-
"snkGridTopTaskbar": ["FORM_MODE", "CONFIG_GRID", "INSERT"]
|
|
182
|
-
});
|
|
183
|
-
this._headerTaskbarProcessor = new TaskbarProcessor({
|
|
184
|
-
"snkGridHeaderTaskbar.unselected": ["REFRESH"],
|
|
185
|
-
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
actionClickHandler(evt) {
|
|
189
|
-
if (evt.detail === TaskbarElement.CONFIG_GRID && this._grid) {
|
|
190
|
-
this._grid.openGridConfig();
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
saveConfig(config) {
|
|
194
|
-
const snkApplication = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
195
|
-
if (snkApplication) {
|
|
196
|
-
snkApplication.saveGridConfig(config);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
componentWillLoad() {
|
|
200
|
-
const snkApplication = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
201
|
-
if (snkApplication) {
|
|
202
|
-
snkApplication.loadGridConfig(this.configName).then(cfg => {
|
|
203
|
-
this._gridConfig = cfg;
|
|
204
|
-
this._configLoaded = true;
|
|
205
|
-
});
|
|
206
|
-
//Forçamos a carga dos acessos pra aproveitar a request inicial.
|
|
207
|
-
snkApplication.getAllAccess();
|
|
208
|
-
}
|
|
209
|
-
let parent = this._element.parentElement;
|
|
210
|
-
while (parent) {
|
|
211
|
-
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
212
|
-
this._snkDataUnit = parent;
|
|
213
|
-
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
214
|
-
if (!this._dataUnit) {
|
|
215
|
-
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
216
|
-
this._dataUnit = evt.detail;
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
|
|
220
|
-
this._dataState = evt.detail;
|
|
221
|
-
});
|
|
222
|
-
break;
|
|
223
|
-
}
|
|
224
|
-
parent = parent.parentElement;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
componentWillRender() {
|
|
228
|
-
const headerTaskbarId = this._dataState && this._dataState.selectedRecords.length > 0 ? "snkGridHeaderTaskbar.selected" : "snkGridHeaderTaskbar.unselected";
|
|
229
|
-
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState);
|
|
230
|
-
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
|
|
231
|
-
}
|
|
232
|
-
render() {
|
|
233
|
-
if (!this._configLoaded || !this._dataUnit) {
|
|
234
|
-
return undefined;
|
|
235
|
-
}
|
|
236
|
-
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-padding-bottom--medium ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), 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", onActionClick: evt => this.actionClickHandler(evt), key: "topTaskbar", dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: evt => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver }, h("snk-taskbar", { dataUnit: this._dataUnit, 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" }))));
|
|
237
|
-
}
|
|
238
|
-
get _element() { return getElement(this); }
|
|
239
|
-
};
|
|
240
|
-
SnkGrid.style = snkGridCss;
|
|
241
|
-
|
|
242
|
-
export { SnkForm as snk_form, SnkGrid as snk_grid };
|