@sankhyalabs/sankhyablocks 1.3.31-beta.5 → 1.3.31-beta.6
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/{index-ebe8245e.js → index-532bcc28.js} +0 -34
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +97 -5
- package/dist/cjs/snk-data-unit.cjs.entry.js +49 -34
- package/dist/cjs/snk-form.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +2 -2
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +15 -34
- package/dist/cjs/{taskbar-elements-589a3744.js → taskbar-elements-9d47b416.js} +4 -2
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/components/snk-application/snk-application.js +107 -31
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +82 -62
- package/dist/collection/components/snk-form/snk-form.js +5 -5
- package/dist/collection/components/snk-grid/snk-grid.js +3 -3
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +3 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +17 -33
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +16 -0
- package/dist/components/snk-application2.js +97 -5
- package/dist/components/snk-data-unit.js +48 -33
- package/dist/components/snk-taskbar2.js +14 -32
- package/dist/esm/{index-7565ae23.js → index-0b078db7.js} +0 -34
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-application.entry.js +97 -5
- package/dist/esm/snk-data-unit.entry.js +49 -34
- package/dist/esm/snk-form.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +2 -2
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +13 -32
- package/dist/esm/{taskbar-elements-b6822601.js → taskbar-elements-3ba30bf4.js} +4 -2
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/{p-a4b2fa10.entry.js → p-3cb106f7.entry.js} +3 -3
- package/dist/sankhyablocks/p-3fce3190.entry.js +1 -0
- package/dist/sankhyablocks/{p-bb8d8fe7.entry.js → p-560fdf54.entry.js} +1 -1
- package/dist/sankhyablocks/p-574764bf.js +1 -0
- package/dist/sankhyablocks/p-8f7b9a85.entry.js +1 -0
- package/dist/sankhyablocks/{p-e7ade160.entry.js → p-9c225717.entry.js} +1 -1
- package/dist/sankhyablocks/p-a45dba1a.js +2 -0
- package/dist/sankhyablocks/{p-6d82d7fd.entry.js → p-a670853c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-bb31ea2a.entry.js → p-a8305c35.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +85 -9
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +20 -3
- package/dist/types/components.d.ts +216 -2
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +2 -0
- package/package.json +1 -1
- package/dist/collection/components/snk-taskbar/component/snk-popup-button.js +0 -7
- package/dist/sankhyablocks/p-306224bf.entry.js +0 -1
- package/dist/sankhyablocks/p-4ee1e12b.js +0 -1
- package/dist/sankhyablocks/p-88278b85.entry.js +0 -1
- package/dist/sankhyablocks/p-90b832f7.js +0 -2
- package/dist/types/components/snk-taskbar/component/snk-popup-button.d.ts +0 -12
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { h, proxyCustomElement, HTMLElement, createEvent, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
|
-
const SnkPopupButton = ({ className, title, source, opened, setOpened, actionClick }) => {
|
|
5
|
-
return (h("div", { class: "ez-flex " + className },
|
|
6
|
-
h("ez-button", { id: "moreOptionsButton", title: title, mode: "icon", iconName: "dots-vertical", size: "small", onClick: () => setOpened(true) }),
|
|
7
|
-
h("ez-popover", { opened: opened, autoClose: true, innerElement: ["moreOptionsButton", "moreOptionsDiv"], onEzVisibilityChange: (event) => setOpened(event.detail) },
|
|
8
|
-
h("div", { id: "moreOptionsDiv", class: "ez-padding--small" }, source.map((option, index) => h("ez-button", { className: "btn-options", size: "small", label: option.label, key: index, onClick: () => actionClick(option) }))))));
|
|
9
|
-
};
|
|
10
|
-
|
|
11
4
|
var TaskbarElement;
|
|
12
5
|
(function (TaskbarElement) {
|
|
13
6
|
TaskbarElement["PREVIOUS"] = "PREVIOUS";
|
|
@@ -33,7 +26,7 @@ var AuthorizationElements;
|
|
|
33
26
|
AuthorizationElements["INSERT"] = "INSERT";
|
|
34
27
|
AuthorizationElements["CONFIG_GRID"] = "CONFIG_GRID";
|
|
35
28
|
})(AuthorizationElements || (AuthorizationElements = {}));
|
|
36
|
-
const buildElem = (element, className, getTitle, action, isEnabled) => {
|
|
29
|
+
const buildElem = (element, className, getTitle, action, isEnabled, actions) => {
|
|
37
30
|
switch (element) {
|
|
38
31
|
case TaskbarElement.PREVIOUS:
|
|
39
32
|
return iconButton("chevron-left", element, className, getTitle, action, isEnabled);
|
|
@@ -59,6 +52,8 @@ const buildElem = (element, className, getTitle, action, isEnabled) => {
|
|
|
59
52
|
return iconButton("list", element, className, getTitle, action, isEnabled);
|
|
60
53
|
case TaskbarElement.CONFIG_GRID:
|
|
61
54
|
return iconButton("settings-inverted", element, className, getTitle, action, isEnabled);
|
|
55
|
+
case TaskbarElement.MORE_OPTIONS:
|
|
56
|
+
return h("ez-actions-button", { size: "small", class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions });
|
|
62
57
|
case TaskbarElement.DIVIDER:
|
|
63
58
|
return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium" });
|
|
64
59
|
}
|
|
@@ -78,7 +73,6 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
78
73
|
super();
|
|
79
74
|
this.__registerHost();
|
|
80
75
|
this.actionClick = createEvent(this, "actionClick", 7);
|
|
81
|
-
this._moreOptionsOpened = false;
|
|
82
76
|
}
|
|
83
77
|
observeButtons() {
|
|
84
78
|
this._definitions = undefined;
|
|
@@ -151,10 +145,6 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
151
145
|
}
|
|
152
146
|
this.actionClick.emit(elem);
|
|
153
147
|
}
|
|
154
|
-
actionClickHandler(act) {
|
|
155
|
-
this._moreOptionsOpened = false;
|
|
156
|
-
this.actionClick.emit(act.key);
|
|
157
|
-
}
|
|
158
148
|
isEnabled(elem) {
|
|
159
149
|
return !(this.disabledButtons && this.disabledButtons.includes(elem));
|
|
160
150
|
}
|
|
@@ -164,29 +154,22 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
164
154
|
if (index > 1) {
|
|
165
155
|
className += "ez-padding-left--medium";
|
|
166
156
|
}
|
|
167
|
-
|
|
168
|
-
element = this.actionsList ? h(SnkPopupButton, { className: className, title: this.getTitle(def), source: this.actionsList, opened: this._moreOptionsOpened, setOpened: opened => this._moreOptionsOpened = opened, actionClick: act => this.actionClickHandler(act) }) : undefined;
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
element = buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
172
|
-
}
|
|
157
|
+
element = buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
|
|
173
158
|
return element;
|
|
174
159
|
}
|
|
175
160
|
// Lifecycle
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
snkApplication.getAllAccess().then(access => this._permissions = access);
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
this._permissions = {};
|
|
184
|
-
}
|
|
161
|
+
componentWillLoad() {
|
|
162
|
+
const snkApplication = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
163
|
+
if (snkApplication) {
|
|
164
|
+
snkApplication.getAllAccess().then(access => this._permissions = access);
|
|
185
165
|
}
|
|
186
166
|
else {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
167
|
+
this._permissions = {};
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
componentWillRender() {
|
|
171
|
+
if (this._definitions == undefined && this._permissions) {
|
|
172
|
+
this._definitions = this.elementsFromString(this.buttons);
|
|
190
173
|
}
|
|
191
174
|
}
|
|
192
175
|
render() {
|
|
@@ -219,7 +202,6 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
219
202
|
"primaryButton": [1, "primary-button"],
|
|
220
203
|
"disabledButtons": [16],
|
|
221
204
|
"dataUnit": [16],
|
|
222
|
-
"_moreOptionsOpened": [32],
|
|
223
205
|
"_permissions": [32]
|
|
224
206
|
}]);
|
|
225
207
|
function defineCustomElement() {
|
|
@@ -187,10 +187,6 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
if (typeof nodeName === 'function') {
|
|
191
|
-
// nodeName is a functional component
|
|
192
|
-
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
|
193
|
-
}
|
|
194
190
|
const vnode = newVNode(nodeName, null);
|
|
195
191
|
vnode.$attrs$ = vnodeData;
|
|
196
192
|
if (vNodeChildren.length > 0) {
|
|
@@ -225,36 +221,6 @@ const newVNode = (tag, text) => {
|
|
|
225
221
|
};
|
|
226
222
|
const Host = {};
|
|
227
223
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
228
|
-
const vdomFnUtils = {
|
|
229
|
-
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
230
|
-
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
231
|
-
};
|
|
232
|
-
const convertToPublic = (node) => ({
|
|
233
|
-
vattrs: node.$attrs$,
|
|
234
|
-
vchildren: node.$children$,
|
|
235
|
-
vkey: node.$key$,
|
|
236
|
-
vname: node.$name$,
|
|
237
|
-
vtag: node.$tag$,
|
|
238
|
-
vtext: node.$text$,
|
|
239
|
-
});
|
|
240
|
-
const convertToPrivate = (node) => {
|
|
241
|
-
if (typeof node.vtag === 'function') {
|
|
242
|
-
const vnodeData = Object.assign({}, node.vattrs);
|
|
243
|
-
if (node.vkey) {
|
|
244
|
-
vnodeData.key = node.vkey;
|
|
245
|
-
}
|
|
246
|
-
if (node.vname) {
|
|
247
|
-
vnodeData.name = node.vname;
|
|
248
|
-
}
|
|
249
|
-
return h(node.vtag, vnodeData, ...(node.vchildren || []));
|
|
250
|
-
}
|
|
251
|
-
const vnode = newVNode(node.vtag, node.vtext);
|
|
252
|
-
vnode.$attrs$ = node.vattrs;
|
|
253
|
-
vnode.$children$ = node.vchildren;
|
|
254
|
-
vnode.$key$ = node.vkey;
|
|
255
|
-
vnode.$name$ = node.vname;
|
|
256
|
-
return vnode;
|
|
257
|
-
};
|
|
258
224
|
/**
|
|
259
225
|
* Production setAccessor() function based on Preact by
|
|
260
226
|
* Jason Miller (@developit)
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-0b078db7.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Esm v2.16.1 | MIT Licensed | https://stenciljs.com
|
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-form",[[2,"snk-form",{"formTitle":[1,"form-title"],"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32]}]]],["snk-grid",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32]}]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"messageBuilder":[16],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"
|
|
13
|
+
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-form",[[2,"snk-form",{"formTitle":[1,"form-title"],"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32]}]]],["snk-grid",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32]}]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"messageBuilder":[16],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-taskbar",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-0b078db7.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Browser v2.16.1 | MIT Licensed | https://stenciljs.com
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-form",[[2,"snk-form",{"formTitle":[1,"form-title"],"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32]}]]],["snk-grid",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32]}]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"messageBuilder":[16],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"
|
|
16
|
+
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-form",[[2,"snk-form",{"formTitle":[1,"form-title"],"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32]}]]],["snk-grid",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32]}]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"messageBuilder":[16],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-taskbar",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
|
|
17
17
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-0b078db7.js';
|
|
2
2
|
import { ErrorException, StringUtils, DataUnit, DataType, ChangeOperation, DateUtils, ObjectUtils, WaitingChangeException, WarningException, DependencyType, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
|
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
|
|
@@ -6687,6 +6687,7 @@ class WaitingRequest {
|
|
|
6687
6687
|
class DataUnitFetcher {
|
|
6688
6688
|
constructor() {
|
|
6689
6689
|
this.templateByQuery = new Map();
|
|
6690
|
+
this._loadDataTimeout = {};
|
|
6690
6691
|
this.buldTemplates();
|
|
6691
6692
|
}
|
|
6692
6693
|
buldTemplates() {
|
|
@@ -6784,6 +6785,21 @@ class DataUnitFetcher {
|
|
|
6784
6785
|
});
|
|
6785
6786
|
}
|
|
6786
6787
|
loadData(dataUnit, request) {
|
|
6788
|
+
const duName = dataUnit.name;
|
|
6789
|
+
if (this._loadDataTimeout[duName]) {
|
|
6790
|
+
clearTimeout(this._loadDataTimeout[duName]);
|
|
6791
|
+
delete this._loadDataTimeout[duName];
|
|
6792
|
+
}
|
|
6793
|
+
return new Promise((resolve, reject) => {
|
|
6794
|
+
this._loadDataTimeout[duName] = setTimeout(() => {
|
|
6795
|
+
delete this._loadDataTimeout[duName];
|
|
6796
|
+
this.doLoadData(dataUnit, request)
|
|
6797
|
+
.then(result => resolve(result))
|
|
6798
|
+
.catch(reason => reject(reason));
|
|
6799
|
+
}, 200);
|
|
6800
|
+
});
|
|
6801
|
+
}
|
|
6802
|
+
doLoadData(dataUnit, request) {
|
|
6787
6803
|
return new Promise((resolve, reject) => {
|
|
6788
6804
|
var _a;
|
|
6789
6805
|
const { sort, filters, limit, offset, quickFilter } = request;
|
|
@@ -7294,6 +7310,9 @@ const SnkApplication = class {
|
|
|
7294
7310
|
}
|
|
7295
7311
|
});
|
|
7296
7312
|
}
|
|
7313
|
+
/**
|
|
7314
|
+
* Caso o usuário logado seja o SUP.
|
|
7315
|
+
*/
|
|
7297
7316
|
async isUserSup() {
|
|
7298
7317
|
return new Promise((resolve, reject) => {
|
|
7299
7318
|
this.auth.then((authorization) => {
|
|
@@ -7303,6 +7322,9 @@ const SnkApplication = class {
|
|
|
7303
7322
|
});
|
|
7304
7323
|
});
|
|
7305
7324
|
}
|
|
7325
|
+
/**
|
|
7326
|
+
* Se o usuário logado tem permissão pra determinada ação.
|
|
7327
|
+
*/
|
|
7306
7328
|
async hasAccess(access) {
|
|
7307
7329
|
return new Promise((resolve, reject) => {
|
|
7308
7330
|
this.auth.then((authorization) => {
|
|
@@ -7312,6 +7334,9 @@ const SnkApplication = class {
|
|
|
7312
7334
|
});
|
|
7313
7335
|
});
|
|
7314
7336
|
}
|
|
7337
|
+
/**
|
|
7338
|
+
* Retorna todos os acessos do usuário logado.
|
|
7339
|
+
*/
|
|
7315
7340
|
async getAllAccess() {
|
|
7316
7341
|
return new Promise((resolve, reject) => {
|
|
7317
7342
|
this.auth.then((authorization) => {
|
|
@@ -7326,34 +7351,55 @@ const SnkApplication = class {
|
|
|
7326
7351
|
});
|
|
7327
7352
|
});
|
|
7328
7353
|
}
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7354
|
+
/**
|
|
7355
|
+
* Retorna o valor de um parâmetro do tipo string.
|
|
7356
|
+
*/
|
|
7332
7357
|
async getStringParam(name) {
|
|
7333
7358
|
return this.parameters.asString(name, this.resourceID);
|
|
7334
7359
|
}
|
|
7360
|
+
/**
|
|
7361
|
+
* Retorna o valor de um parâmetro do tipo Inteiro.
|
|
7362
|
+
*/
|
|
7335
7363
|
async getIntParam(name) {
|
|
7336
7364
|
return this.parameters.asInteger(name, this.resourceID);
|
|
7337
7365
|
}
|
|
7366
|
+
/**
|
|
7367
|
+
* Retorna o valor de um parâmetro do tipo Decimal.
|
|
7368
|
+
*/
|
|
7338
7369
|
async getFloatParam(name) {
|
|
7339
7370
|
return this.parameters.asFloat(name, this.resourceID);
|
|
7340
7371
|
}
|
|
7372
|
+
/**
|
|
7373
|
+
* Retorna o valor de um parâmetro do tipo booleano.
|
|
7374
|
+
*/
|
|
7341
7375
|
async getBooleanParam(name) {
|
|
7342
7376
|
return this.parameters.asBoolean(name, this.resourceID);
|
|
7343
7377
|
}
|
|
7378
|
+
/**
|
|
7379
|
+
* Retorna o valor de um parâmetro do tipo data.
|
|
7380
|
+
*/
|
|
7344
7381
|
async getDateParam(name) {
|
|
7345
7382
|
return this.parameters.asDate(name, this.resourceID);
|
|
7346
7383
|
}
|
|
7384
|
+
/**
|
|
7385
|
+
* Mostra o conteúdo passado em um Popup
|
|
7386
|
+
*/
|
|
7347
7387
|
async showPopUp(content) {
|
|
7348
7388
|
this._popUp.appendChild(content);
|
|
7349
7389
|
this._popUp["opened"] = true;
|
|
7350
7390
|
}
|
|
7391
|
+
/**
|
|
7392
|
+
* Fecha o popup, liberando o conteúdo.
|
|
7393
|
+
*/
|
|
7351
7394
|
async closePopUp() {
|
|
7352
7395
|
Array.from(this._popUp.children).forEach(c => {
|
|
7353
7396
|
this._popUp.removeChild(c);
|
|
7354
7397
|
});
|
|
7355
7398
|
this._popUp["opened"] = false;
|
|
7356
7399
|
}
|
|
7400
|
+
/**
|
|
7401
|
+
* Verifica se a licença do cliente tem determinado opcional (produto)
|
|
7402
|
+
*/
|
|
7357
7403
|
async temOpcional(opcional) {
|
|
7358
7404
|
const opts = opcional.split(",");
|
|
7359
7405
|
return new Promise((resolve, reject) => {
|
|
@@ -7377,6 +7423,10 @@ const SnkApplication = class {
|
|
|
7377
7423
|
});
|
|
7378
7424
|
});
|
|
7379
7425
|
}
|
|
7426
|
+
/**
|
|
7427
|
+
* Retorna a configuração de um recurso por service broker
|
|
7428
|
+
* Veja também o método "loadConfig"
|
|
7429
|
+
*/
|
|
7380
7430
|
async getConfig(key) {
|
|
7381
7431
|
let payload = {
|
|
7382
7432
|
"serviceName": "SystemUtilsSP.getConf",
|
|
@@ -7394,6 +7444,9 @@ const SnkApplication = class {
|
|
|
7394
7444
|
.catch(error => reject(error));
|
|
7395
7445
|
});
|
|
7396
7446
|
}
|
|
7447
|
+
/**
|
|
7448
|
+
* Salva a configuração de determinado recurso.
|
|
7449
|
+
*/
|
|
7397
7450
|
async saveConfig(key, data) {
|
|
7398
7451
|
let payload = {
|
|
7399
7452
|
"serviceName": "SystemUtilsSP.saveConf",
|
|
@@ -7412,19 +7465,31 @@ const SnkApplication = class {
|
|
|
7412
7465
|
.catch(error => reject(error));
|
|
7413
7466
|
});
|
|
7414
7467
|
}
|
|
7468
|
+
/**
|
|
7469
|
+
* Acessa informações de contexto "empurrados" na abertura da tela
|
|
7470
|
+
*/
|
|
7415
7471
|
async getAttributeFromHTMLWrapper(attribName) {
|
|
7416
7472
|
return Promise.resolve(window[attribName]);
|
|
7417
7473
|
}
|
|
7474
|
+
/**
|
|
7475
|
+
* Abre determinada tela, repassando pkObject
|
|
7476
|
+
*/
|
|
7418
7477
|
async openApp(resourceId, pkObject) {
|
|
7419
7478
|
Workspace.openAppActivity(resourceId, pkObject);
|
|
7420
7479
|
}
|
|
7480
|
+
/**
|
|
7481
|
+
* Cria o DataUnit a partir do nome da entidade.
|
|
7482
|
+
*/
|
|
7421
7483
|
async createDataunit(entityName) {
|
|
7422
7484
|
return new Promise(resolve => {
|
|
7423
7485
|
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID);
|
|
7424
7486
|
dataUnit.loadMetadata().then(() => resolve(dataUnit));
|
|
7425
7487
|
});
|
|
7426
7488
|
}
|
|
7427
|
-
|
|
7489
|
+
/**
|
|
7490
|
+
* Cria e armazena o DataUnit em um cache
|
|
7491
|
+
*/
|
|
7492
|
+
async getDataUnit(entityName, dataUnitName) {
|
|
7428
7493
|
return new Promise((resolve, reject) => {
|
|
7429
7494
|
const dataUnit = this._duCache.get(dataUnitName);
|
|
7430
7495
|
if (dataUnit) {
|
|
@@ -7440,30 +7505,57 @@ const SnkApplication = class {
|
|
|
7440
7505
|
}
|
|
7441
7506
|
});
|
|
7442
7507
|
}
|
|
7508
|
+
/**
|
|
7509
|
+
* Retorna o resourceID da tela em questão.
|
|
7510
|
+
*/
|
|
7443
7511
|
async getResourceID() {
|
|
7444
7512
|
return Promise.resolve(this.resourceID);
|
|
7445
7513
|
}
|
|
7514
|
+
/**
|
|
7515
|
+
* Mostra o diálogo de alerta de acordo com os parâmetros passados.
|
|
7516
|
+
*/
|
|
7446
7517
|
async alert(title, message, icon, options) {
|
|
7447
7518
|
return ApplicationUtils.alert(title, message, icon, options);
|
|
7448
7519
|
}
|
|
7520
|
+
/**
|
|
7521
|
+
* Mostra o diálogo de erro de acordo com os parâmetros passados.
|
|
7522
|
+
*/
|
|
7449
7523
|
async error(title, message, icon, options) {
|
|
7450
7524
|
return ApplicationUtils.error(title, message, icon, options);
|
|
7451
7525
|
}
|
|
7526
|
+
/**
|
|
7527
|
+
* Exibe um diálogo de confirmação
|
|
7528
|
+
*/
|
|
7452
7529
|
async confirm(title, message, icon, critical, options) {
|
|
7453
7530
|
return ApplicationUtils.confirm(title, message, icon, critical, options);
|
|
7454
7531
|
}
|
|
7532
|
+
/**
|
|
7533
|
+
* Mostra uma informação efêmera (de segundo plano).
|
|
7534
|
+
*/
|
|
7455
7535
|
async info(message, options) {
|
|
7456
7536
|
return ApplicationUtils.info(message, options);
|
|
7457
7537
|
}
|
|
7538
|
+
/**
|
|
7539
|
+
* Busca a configuração de formulário.
|
|
7540
|
+
*/
|
|
7458
7541
|
async loadFormConfig(name) {
|
|
7459
7542
|
return this.formConfigFetcher.loadFormConfig(name, this.resourceID);
|
|
7460
7543
|
}
|
|
7544
|
+
/**
|
|
7545
|
+
* Busca a configuração de grade.
|
|
7546
|
+
*/
|
|
7461
7547
|
async loadGridConfig(name) {
|
|
7462
7548
|
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
|
7463
7549
|
}
|
|
7550
|
+
/**
|
|
7551
|
+
* Salva a configuração de grade.
|
|
7552
|
+
*/
|
|
7464
7553
|
async saveGridConfig(config) {
|
|
7465
7554
|
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
7466
7555
|
}
|
|
7556
|
+
async getAuthList(_auth) {
|
|
7557
|
+
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
|
7558
|
+
}
|
|
7467
7559
|
get urlParams() {
|
|
7468
7560
|
if (!this._urlParams) {
|
|
7469
7561
|
this._urlParams = UrlUtils.getQueryParams(location.search);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-0b078db7.js';
|
|
2
2
|
import { Action, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
|
|
@@ -7,10 +7,18 @@ const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;h
|
|
|
7
7
|
const SnkDataUnit = class {
|
|
8
8
|
constructor(hostRef) {
|
|
9
9
|
registerInstance(this, hostRef);
|
|
10
|
-
this.insertionMode = createEvent(this, "insertionMode", 7);
|
|
11
10
|
this.dataStateChange = createEvent(this, "dataStateChange", 7);
|
|
12
11
|
this.dataUnitReady = createEvent(this, "dataUnitReady", 7);
|
|
12
|
+
this.insertionMode = createEvent(this, "insertionMode", 7);
|
|
13
13
|
this._onDataUnitResolve = [];
|
|
14
|
+
/**
|
|
15
|
+
* Determina quantas linhas são retornadas por página
|
|
16
|
+
*/
|
|
17
|
+
this.pageSize = 150;
|
|
18
|
+
/**
|
|
19
|
+
* Quando ativada essa propriedade faz com que haja uma carga imediata no DataUnit
|
|
20
|
+
*/
|
|
21
|
+
this.autoLoad = true;
|
|
14
22
|
this._dataUnitObserver = (action) => {
|
|
15
23
|
let msg = this.getActionInfo(action.type);
|
|
16
24
|
if (msg) {
|
|
@@ -36,6 +44,38 @@ const SnkDataUnit = class {
|
|
|
36
44
|
this.dataState = duState;
|
|
37
45
|
};
|
|
38
46
|
}
|
|
47
|
+
observePageSize() {
|
|
48
|
+
if (this.dataUnit) {
|
|
49
|
+
this.dataUnit.pageSize = this.pageSize;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
observeDataUnitName(newValue, oldValue) {
|
|
53
|
+
if (oldValue != newValue) {
|
|
54
|
+
this.dataUnit = undefined;
|
|
55
|
+
this.dataUnitName = newValue;
|
|
56
|
+
this.loadDataUnit();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
observeEntityName(newValue, oldValue) {
|
|
60
|
+
if (oldValue != newValue) {
|
|
61
|
+
this.dataUnit = undefined;
|
|
62
|
+
this.entityName = newValue;
|
|
63
|
+
this.loadDataUnit();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
observeDataState(newValue, oldValue) {
|
|
67
|
+
if (oldValue != newValue) {
|
|
68
|
+
this.dataStateChange.emit(newValue);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
observeDataUnit() {
|
|
72
|
+
this.dataUnitReady.emit(this.dataUnit);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Pode-se obter o dataUnit através desse método. Outra forma, é ouvir o evento de
|
|
76
|
+
*
|
|
77
|
+
* @returns dataUnit
|
|
78
|
+
*/
|
|
39
79
|
async getDataUnit() {
|
|
40
80
|
return new Promise((resolve) => {
|
|
41
81
|
if (this.dataUnit) {
|
|
@@ -88,44 +128,16 @@ const SnkDataUnit = class {
|
|
|
88
128
|
if (this.messageBuilder) {
|
|
89
129
|
return this.messageBuilder(action, this.dataState, this.dataUnit);
|
|
90
130
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return this.i18n("components.editionCanceled");
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
observePageSize() {
|
|
98
|
-
if (this.dataUnit) {
|
|
99
|
-
this.dataUnit.pageSize = this.pageSize;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
observeDataUnitName(newValue, oldValue) {
|
|
103
|
-
if (oldValue != newValue) {
|
|
104
|
-
this.dataUnit = undefined;
|
|
105
|
-
this.dataUnitName = newValue;
|
|
106
|
-
this.loadDataUnit();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
observeEntityName(newValue, oldValue) {
|
|
110
|
-
if (oldValue != newValue) {
|
|
111
|
-
this.dataUnit = undefined;
|
|
112
|
-
this.entityName = newValue;
|
|
113
|
-
this.loadDataUnit();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
observeDataState(newValue, oldValue) {
|
|
117
|
-
if (oldValue != newValue) {
|
|
118
|
-
this.dataStateChange.emit(newValue);
|
|
131
|
+
if (action === Action.EDITION_CANCELED) {
|
|
132
|
+
return this.i18n("components.editionCanceled");
|
|
119
133
|
}
|
|
120
134
|
}
|
|
121
|
-
observeDataUnit() {
|
|
122
|
-
this.dataUnitReady.emit(this.dataUnit);
|
|
123
|
-
}
|
|
124
135
|
async loadDataUnit() {
|
|
125
136
|
if (!this.dataUnit) {
|
|
126
137
|
const app = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
127
138
|
if (app && this.entityName) {
|
|
128
|
-
this.
|
|
139
|
+
const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
|
|
140
|
+
this.dataUnit = await app.getDataUnit(this.entityName, cacheName);
|
|
129
141
|
this.dataUnit.pageSize = this.pageSize;
|
|
130
142
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
131
143
|
this.dataUnit.addInterceptor(this);
|
|
@@ -150,6 +162,9 @@ const SnkDataUnit = class {
|
|
|
150
162
|
};
|
|
151
163
|
return pt_br[key];
|
|
152
164
|
}
|
|
165
|
+
//---------------------------------------------
|
|
166
|
+
// Lifecycle web component
|
|
167
|
+
//---------------------------------------------
|
|
153
168
|
componentDidRender() {
|
|
154
169
|
this.loadDataUnit();
|
|
155
170
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-0b078db7.js';
|
|
2
2
|
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
4
|
const snkFormCss = ".sc-snk-form-h{display:block}";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-0b078db7.js';
|
|
2
2
|
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
|
3
|
+
import { T as TaskbarElement } from './taskbar-elements-3ba30bf4.js';
|
|
4
4
|
|
|
5
5
|
const snkGridCss = ".sc-snk-grid-h{display:flex;height:100%;width:100%}";
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-0b078db7.js';
|
|
2
2
|
import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
4
|
const snkPesquisaCss = ".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__content-scrollbar--background-color:var(--text--primary, #626e82);--snk-pesquisa__content-scrollbar--border-radius:var(--border--radius-medium, 12px);--snk-pesquisa__content-scrollbar--width:var(--space--medium, 12px) display: block;max-height:100%;height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input-close.sc-snk-pesquisa{cursor:pointer}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%;overflow-y:auto;padding-right:var(--snk-pesquisa__content--padding-right)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:#f0f2f5;border-radius:var(--snk-pesquisa__content-scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__content-scrollbar--background-color);border-radius:var(--snk-pesquisa__content-scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:#f0f2f5;width:var(--snk-pesquisa__content-scrollbar--width);max-width:var(--snk-pesquisa__content-scrollbar--width);min-width:var(--snk-pesquisa__content-scrollbar--width)}.snk-pesquisa__records.sc-snk-pesquisa{font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);color:var(--snk-pesquisa__records--color);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}";
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-0b078db7.js';
|
|
2
2
|
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
-
import { A as AuthorizationElements, T as TaskbarElement, b as buildElem } from './taskbar-elements-
|
|
4
|
-
|
|
5
|
-
const SnkPopupButton = ({ className, title, source, opened, setOpened, actionClick }) => {
|
|
6
|
-
return (h("div", { class: "ez-flex " + className },
|
|
7
|
-
h("ez-button", { id: "moreOptionsButton", title: title, mode: "icon", iconName: "dots-vertical", size: "small", onClick: () => setOpened(true) }),
|
|
8
|
-
h("ez-popover", { opened: opened, autoClose: true, innerElement: ["moreOptionsButton", "moreOptionsDiv"], onEzVisibilityChange: (event) => setOpened(event.detail) },
|
|
9
|
-
h("div", { id: "moreOptionsDiv", class: "ez-padding--small" }, source.map((option, index) => h("ez-button", { className: "btn-options", size: "small", label: option.label, key: index, onClick: () => actionClick(option) }))))));
|
|
10
|
-
};
|
|
3
|
+
import { A as AuthorizationElements, T as TaskbarElement, b as buildElem } from './taskbar-elements-3ba30bf4.js';
|
|
11
4
|
|
|
12
5
|
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
|
|
13
6
|
|
|
@@ -15,7 +8,6 @@ const SnkTaskbar = class {
|
|
|
15
8
|
constructor(hostRef) {
|
|
16
9
|
registerInstance(this, hostRef);
|
|
17
10
|
this.actionClick = createEvent(this, "actionClick", 7);
|
|
18
|
-
this._moreOptionsOpened = false;
|
|
19
11
|
}
|
|
20
12
|
observeButtons() {
|
|
21
13
|
this._definitions = undefined;
|
|
@@ -88,10 +80,6 @@ const SnkTaskbar = class {
|
|
|
88
80
|
}
|
|
89
81
|
this.actionClick.emit(elem);
|
|
90
82
|
}
|
|
91
|
-
actionClickHandler(act) {
|
|
92
|
-
this._moreOptionsOpened = false;
|
|
93
|
-
this.actionClick.emit(act.key);
|
|
94
|
-
}
|
|
95
83
|
isEnabled(elem) {
|
|
96
84
|
return !(this.disabledButtons && this.disabledButtons.includes(elem));
|
|
97
85
|
}
|
|
@@ -101,29 +89,22 @@ const SnkTaskbar = class {
|
|
|
101
89
|
if (index > 1) {
|
|
102
90
|
className += "ez-padding-left--medium";
|
|
103
91
|
}
|
|
104
|
-
|
|
105
|
-
element = this.actionsList ? h(SnkPopupButton, { className: className, title: this.getTitle(def), source: this.actionsList, opened: this._moreOptionsOpened, setOpened: opened => this._moreOptionsOpened = opened, actionClick: act => this.actionClickHandler(act) }) : undefined;
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
element = buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
109
|
-
}
|
|
92
|
+
element = buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
|
|
110
93
|
return element;
|
|
111
94
|
}
|
|
112
95
|
// Lifecycle
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
snkApplication.getAllAccess().then(access => this._permissions = access);
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
this._permissions = {};
|
|
121
|
-
}
|
|
96
|
+
componentWillLoad() {
|
|
97
|
+
const snkApplication = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
98
|
+
if (snkApplication) {
|
|
99
|
+
snkApplication.getAllAccess().then(access => this._permissions = access);
|
|
122
100
|
}
|
|
123
101
|
else {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
102
|
+
this._permissions = {};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
componentWillRender() {
|
|
106
|
+
if (this._definitions == undefined && this._permissions) {
|
|
107
|
+
this._definitions = this.elementsFromString(this.buttons);
|
|
127
108
|
}
|
|
128
109
|
}
|
|
129
110
|
render() {
|