@sankhyalabs/sankhyablocks 8.15.0-dev.20 → 8.15.0-dev.22
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/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-e4a7c4c3.js → pesquisa-fetcher-c790ffb7.js} +3 -3
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_2.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +22 -1
- package/dist/cjs/snk-attach.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +7 -4
- package/dist/cjs/snk-detail-view.cjs.entry.js +2 -2
- package/dist/cjs/snk-entity-list.cjs.entry.js +5 -3
- package/dist/cjs/snk-filter-bar.cjs.entry.js +17 -2
- package/dist/cjs/snk-grid.cjs.entry.js +2 -1
- package/dist/cjs/{snk-guides-viewer-d32c096f.js → snk-guides-viewer-32c1d35d.js} +4 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
- package/dist/cjs/snk-simple-crud.cjs.entry.js +1 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +51 -3
- package/dist/collection/components/snk-application/__mocks__/snk-application.js +7 -0
- package/dist/collection/components/snk-application/snk-application.js +9 -9
- package/dist/collection/components/snk-crud/snk-crud.js +23 -3
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +11 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +2 -2
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +5 -3
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +17 -2
- package/dist/collection/components/snk-grid/snk-grid.js +19 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +17 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +88 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +21 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +3 -3
- package/dist/components/dataunit-fetcher.js +3 -3
- package/dist/components/snk-application2.js +21 -0
- package/dist/components/snk-crud.js +7 -3
- package/dist/components/snk-detail-view2.js +3 -3
- package/dist/components/snk-entity-list.js +5 -3
- package/dist/components/snk-filter-bar2.js +17 -2
- package/dist/components/snk-grid2.js +3 -1
- package/dist/components/snk-taskbar2.js +55 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-fa0c2540.js → pesquisa-fetcher-4000d0b8.js} +3 -3
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_2.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +22 -1
- package/dist/esm/snk-attach.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +7 -4
- package/dist/esm/snk-detail-view.entry.js +2 -2
- package/dist/esm/snk-entity-list.entry.js +5 -3
- package/dist/esm/snk-filter-bar.entry.js +17 -2
- package/dist/esm/snk-grid.entry.js +2 -1
- package/dist/esm/{snk-guides-viewer-f49613c6.js → snk-guides-viewer-8adacfd4.js} +4 -4
- package/dist/esm/snk-guides-viewer.entry.js +2 -2
- package/dist/esm/snk-simple-crud.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +52 -4
- package/dist/sankhyablocks/{p-282789a6.entry.js → p-0574c231.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3b0e4e08.js → p-0eb1ff03.js} +1 -1
- package/dist/sankhyablocks/{p-02e3a45b.entry.js → p-11bbb65e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0ec5b2e5.js → p-2419f19f.js} +1 -1
- package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
- package/dist/sankhyablocks/{p-ac384baf.entry.js → p-3838d2ff.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9bdbc7d8.entry.js → p-45d82274.entry.js} +1 -1
- package/dist/sankhyablocks/p-79b4b271.entry.js +1 -0
- package/dist/sankhyablocks/p-96ef14f9.entry.js +1 -0
- package/dist/sankhyablocks/{p-e817f254.entry.js → p-db4edd06.entry.js} +3 -3
- package/dist/sankhyablocks/p-df2b84c4.entry.js +1 -0
- package/dist/sankhyablocks/{p-9b5944a4.entry.js → p-e0b23084.entry.js} +1 -1
- package/dist/sankhyablocks/p-ed2dce4b.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/subcomponents/snk-actions-form.d.ts +1 -1
- package/dist/types/components/snk-application/__mocks__/snk-application.d.ts +3 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +5 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +2 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +20 -1
- package/dist/types/components.d.ts +32 -0
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-2582537c.entry.js +0 -1
- package/dist/sankhyablocks/p-62896624.entry.js +0 -1
- package/dist/sankhyablocks/p-69efa80d.entry.js +0 -1
- package/dist/sankhyablocks/p-b05ab13d.entry.js +0 -1
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
@@ -9,13 +9,15 @@ const taskbarElements = require('./taskbar-elements-01b85b99.js');
|
|
9
9
|
const index$1 = require('./index-0922807b.js');
|
10
10
|
require('./index-102ba62d.js');
|
11
11
|
|
12
|
-
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
|
12
|
+
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex;flex-wrap:wrap}.no-wrap.sc-snk-taskbar-h{flex-wrap:nowrap}.full-width.sc-snk-taskbar-h{width:100%}.align-right.sc-snk-taskbar-h{justify-content:flex-end}.overflowed.sc-snk-taskbar{display:none}";
|
13
13
|
|
14
14
|
const SnkTaskbar = class {
|
15
15
|
constructor(hostRef) {
|
16
16
|
index.registerInstance(this, hostRef);
|
17
17
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
18
18
|
this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
|
19
|
+
this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME = 'taskbar-custom-elements-container';
|
20
|
+
this.ACTIONS_BUTTON_TAG = 'TASKBAR-ACTIONS-BUTTON';
|
19
21
|
this._titleKeyByElement = {
|
20
22
|
[taskbarElements.TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
|
21
23
|
[taskbarElements.TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
|
@@ -33,11 +35,14 @@ const SnkTaskbar = class {
|
|
33
35
|
[taskbarElements.TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
|
34
36
|
};
|
35
37
|
this._permissions = undefined;
|
38
|
+
this._overFlowedElements = [];
|
36
39
|
this._customElements = undefined;
|
37
40
|
this._customElementsId = undefined;
|
38
41
|
this._slotContainer = undefined;
|
42
|
+
this.alignRigth = false;
|
39
43
|
this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
|
40
44
|
this.customContainerId = undefined;
|
45
|
+
this.overflowStrategy = 'hiddenItems';
|
41
46
|
this.configName = undefined;
|
42
47
|
this.resourceID = undefined;
|
43
48
|
this.buttons = undefined;
|
@@ -51,6 +56,7 @@ const SnkTaskbar = class {
|
|
51
56
|
}
|
52
57
|
observeButtons() {
|
53
58
|
this._definitions = undefined;
|
59
|
+
requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
|
54
60
|
}
|
55
61
|
// Internal methods
|
56
62
|
elementsFromString(strButtons) {
|
@@ -231,15 +237,52 @@ const SnkTaskbar = class {
|
|
231
237
|
}
|
232
238
|
this.validatePresentationMode();
|
233
239
|
}
|
240
|
+
handleOverFlow(overFlowingElements) {
|
241
|
+
const elementsToHandle = overFlowingElements.filter(element => !this.hasToIgnoreOverFlow(element));
|
242
|
+
this.resetOverFlowedElements();
|
243
|
+
this.doOverFlowElements(elementsToHandle);
|
244
|
+
}
|
245
|
+
resetOverFlowedElements() {
|
246
|
+
this._overFlowedElements.forEach(element => {
|
247
|
+
element.classList.remove(core.OVERFLOWED_CLASS_NAME);
|
248
|
+
});
|
249
|
+
this._overFlowedElements = [];
|
250
|
+
}
|
251
|
+
doOverFlowElements(overFlowedElements) {
|
252
|
+
overFlowedElements.forEach(element => {
|
253
|
+
element.classList.add(core.OVERFLOWED_CLASS_NAME);
|
254
|
+
this._overFlowedElements.push(element);
|
255
|
+
});
|
256
|
+
}
|
257
|
+
hasToIgnoreOverFlow(element) {
|
258
|
+
return element.classList.contains(this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME);
|
259
|
+
}
|
260
|
+
handleOverFlowStrategy() {
|
261
|
+
if (this.overflowStrategy === 'hiddenItems') {
|
262
|
+
this._overFlowWatcher = new core.OverflowWatcher(this.buildOverFlowWatcherParams());
|
263
|
+
}
|
264
|
+
}
|
265
|
+
buildOverFlowWatcherParams() {
|
266
|
+
return {
|
267
|
+
element: this._element,
|
268
|
+
callback: this.handleOverFlow.bind(this),
|
269
|
+
overFlowDirection: core.OverflowDirection.HORIZONTAL,
|
270
|
+
deltaSize: 1,
|
271
|
+
notOverFlow: ["moreOptions"]
|
272
|
+
};
|
273
|
+
}
|
234
274
|
componentDidLoad() {
|
235
275
|
const dataInfo = { dataUnit: this.dataUnit };
|
236
276
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
277
|
+
this.handleOverFlowStrategy();
|
237
278
|
}
|
238
279
|
componentDidRender() {
|
239
280
|
this.appendCustomElementsInTaskbar();
|
240
281
|
}
|
241
282
|
disconnectedCallback() {
|
283
|
+
var _a;
|
242
284
|
this.unlinkAllCustomElements();
|
285
|
+
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
|
243
286
|
}
|
244
287
|
unlinkAllCustomElements() {
|
245
288
|
var _a;
|
@@ -257,7 +300,7 @@ const SnkTaskbar = class {
|
|
257
300
|
return undefined;
|
258
301
|
}
|
259
302
|
let index$1 = 0;
|
260
|
-
return (index.h(index.Host,
|
303
|
+
return (index.h(index.Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
|
261
304
|
var _a;
|
262
305
|
if (elem === taskbarElements.TaskbarElement.DIVIDER) {
|
263
306
|
index$1 = 0;
|
@@ -275,7 +318,12 @@ const SnkTaskbar = class {
|
|
275
318
|
return this.addCustomElementContainer(elem);
|
276
319
|
}
|
277
320
|
return index.h("slot", { name: elem });
|
278
|
-
})), index.h("div", { class:
|
321
|
+
})), index.h("div", { class: this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME }, index.h("slot", { name: this.customSlotId }))));
|
322
|
+
}
|
323
|
+
getHostClasses() {
|
324
|
+
if (this.overflowStrategy !== 'hiddenItems')
|
325
|
+
return 'no-wrap';
|
326
|
+
return `full-width ${this.alignRigth ? 'align-right' : ""}`;
|
279
327
|
}
|
280
328
|
get _element() { return index.getElement(this); }
|
281
329
|
static get watchers() { return {
|
@@ -2150,6 +2150,10 @@ export class SnkApplication {
|
|
2150
2150
|
"Promise": {
|
2151
2151
|
"location": "global"
|
2152
2152
|
},
|
2153
|
+
"IOption": {
|
2154
|
+
"location": "import",
|
2155
|
+
"path": "@sankhyalabs/ezui/dist/types/components/ez-search/ez-search"
|
2156
|
+
},
|
2153
2157
|
"ISearchArgument": {
|
2154
2158
|
"location": "import",
|
2155
2159
|
"path": "@sankhyalabs/ezui/dist/types/components/ez-search/ez-search"
|
@@ -2161,16 +2165,12 @@ export class SnkApplication {
|
|
2161
2165
|
"Array": {
|
2162
2166
|
"location": "global"
|
2163
2167
|
},
|
2164
|
-
"IOption": {
|
2165
|
-
"location": "import",
|
2166
|
-
"path": "@sankhyalabs/ezui/dist/types/components/ez-search/ez-search"
|
2167
|
-
},
|
2168
2168
|
"SearchCriteria": {
|
2169
2169
|
"location": "import",
|
2170
2170
|
"path": "../../lib/http/data-fetcher/fetchers/pesquisa-fetcher"
|
2171
2171
|
}
|
2172
2172
|
},
|
2173
|
-
"return": "Promise<
|
2173
|
+
"return": "Promise<IOption | IOption[]>"
|
2174
2174
|
},
|
2175
2175
|
"docs": {
|
2176
2176
|
"text": "Obt\u00E9m as op\u00E7\u00F5es em componentes de pesquisa\nEx.: snk-config-options",
|
@@ -2194,18 +2194,18 @@ export class SnkApplication {
|
|
2194
2194
|
"Promise": {
|
2195
2195
|
"location": "global"
|
2196
2196
|
},
|
2197
|
-
"Array": {
|
2198
|
-
"location": "global"
|
2199
|
-
},
|
2200
2197
|
"IOption": {
|
2201
2198
|
"location": "import",
|
2202
2199
|
"path": "@sankhyalabs/ezui/dist/types/components/ez-search/ez-search"
|
2203
2200
|
},
|
2201
|
+
"Array": {
|
2202
|
+
"location": "global"
|
2203
|
+
},
|
2204
2204
|
"HTMLSnkPesquisaElement": {
|
2205
2205
|
"location": "global"
|
2206
2206
|
}
|
2207
2207
|
},
|
2208
|
-
"return": "Promise<
|
2208
|
+
"return": "Promise<IOption | IOption[]>"
|
2209
2209
|
},
|
2210
2210
|
"docs": {
|
2211
2211
|
"text": "Obt\u00E9m as op\u00E7\u00F5es em componentes de pesquisa\nEx.: snk-config-options",
|
@@ -30,6 +30,7 @@ export class SnkCrud {
|
|
30
30
|
this.presentationMode = PresentationMode.PRIMARY;
|
31
31
|
this.messagesBuilder = undefined;
|
32
32
|
this.useEnterLikeTab = false;
|
33
|
+
this.disablePersonalizedFilter = undefined;
|
33
34
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
34
35
|
}
|
35
36
|
/**
|
@@ -162,7 +163,8 @@ export class SnkCrud {
|
|
162
163
|
window.removeEventListener("keydown", this._keyDownHandler);
|
163
164
|
}
|
164
165
|
async initKeyboardManager() {
|
165
|
-
|
166
|
+
var _a;
|
167
|
+
const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
|
166
168
|
if (keyboardManager) {
|
167
169
|
const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
|
168
170
|
async function saveDataUnitHandlingFocus() {
|
@@ -211,7 +213,8 @@ export class SnkCrud {
|
|
211
213
|
}
|
212
214
|
}
|
213
215
|
async removeShortcuts() {
|
214
|
-
|
216
|
+
var _a;
|
217
|
+
const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
|
215
218
|
if (keyboardManager) {
|
216
219
|
keyboardManager
|
217
220
|
.unbind("F6")
|
@@ -278,7 +281,7 @@ export class SnkCrud {
|
|
278
281
|
return;
|
279
282
|
}
|
280
283
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
281
|
-
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
284
|
+
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
282
285
|
}
|
283
286
|
static get is() { return "snk-crud"; }
|
284
287
|
static get encapsulation() { return "scoped"; }
|
@@ -514,6 +517,23 @@ export class SnkCrud {
|
|
514
517
|
"attribute": "use-enter-like-tab",
|
515
518
|
"reflect": false,
|
516
519
|
"defaultValue": "false"
|
520
|
+
},
|
521
|
+
"disablePersonalizedFilter": {
|
522
|
+
"type": "boolean",
|
523
|
+
"mutable": false,
|
524
|
+
"complexType": {
|
525
|
+
"original": "boolean",
|
526
|
+
"resolved": "boolean",
|
527
|
+
"references": {}
|
528
|
+
},
|
529
|
+
"required": false,
|
530
|
+
"optional": false,
|
531
|
+
"docs": {
|
532
|
+
"tags": [],
|
533
|
+
"text": "Desabilita a apresenta\u00E7\u00E3o da op\u00E7\u00E3o de filtros personalizados na filter bar (chip de filtros) \ne no modal lateral de filtros (container de filtros personalizados)."
|
534
|
+
},
|
535
|
+
"attribute": "disable-personalized-filter",
|
536
|
+
"reflect": false
|
517
537
|
}
|
518
538
|
};
|
519
539
|
}
|
@@ -25,7 +25,7 @@ snk-form-view {
|
|
25
25
|
position: relative;
|
26
26
|
padding-left: 0px;
|
27
27
|
padding-top: 0px;
|
28
|
-
|
28
|
+
|
29
29
|
/*public*/
|
30
30
|
padding-right: var(--snk-guides-viewer--space-large);
|
31
31
|
padding-bottom: var(--snk-guides-viewer--space-large);
|
@@ -57,6 +57,15 @@ snk-form-view {
|
|
57
57
|
margin-bottom: var(--snk-guides-viewer--space-medium);
|
58
58
|
}
|
59
59
|
|
60
|
+
.snk-guides-viewer__header-breadcrumb{
|
61
|
+
width: 25%;
|
62
|
+
display: flex;
|
63
|
+
}
|
64
|
+
|
65
|
+
.snk-guides-viewer__header-taskbar{
|
66
|
+
width: 75%;
|
67
|
+
}
|
68
|
+
|
60
69
|
.snk-guides-viewer__container {
|
61
70
|
/*private*/
|
62
71
|
display: grid;
|
@@ -88,4 +97,4 @@ snk-form-view {
|
|
88
97
|
min-height: 100%;
|
89
98
|
align-items: flex-start;
|
90
99
|
align-content: flex-start;
|
91
|
-
}
|
100
|
+
}
|
@@ -383,7 +383,7 @@ export class SnkGuidesViewer {
|
|
383
383
|
}
|
384
384
|
buildTaskBar() {
|
385
385
|
var _a;
|
386
|
-
return h("div", { class: `
|
386
|
+
return h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.getActionsList(), messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS", alignRigth: true }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
|
387
387
|
}
|
388
388
|
async dataUnitActionHandler(action) {
|
389
389
|
var _a;
|
@@ -442,7 +442,7 @@ export class SnkGuidesViewer {
|
|
442
442
|
}
|
443
443
|
this.loadTaskbarProcessor();
|
444
444
|
const showGuides = this._guides && (this._guides.length > 1);
|
445
|
-
return (h("section", { class: "snk-guides-viewer" }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "
|
445
|
+
return (h("section", { class: "snk-guides-viewer" }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getMessage("snkCrud.title")), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
|
446
446
|
h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
|
447
447
|
h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
|
448
448
|
:
|
@@ -56,16 +56,18 @@ export class SnkEntityList {
|
|
56
56
|
this.loadListSource();
|
57
57
|
}
|
58
58
|
optionLoader(searchArgument) {
|
59
|
-
var _a, _b, _c, _d;
|
59
|
+
var _a, _b, _c, _d, _e, _f;
|
60
60
|
const { mode, argument } = searchArgument;
|
61
61
|
if (this._application === undefined) {
|
62
62
|
return;
|
63
63
|
}
|
64
64
|
const searchOptions = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.searchContext) === null || _c === void 0 ? void 0 : _c.searchOptions;
|
65
|
+
const criteria = (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e.criteria;
|
65
66
|
const options = {
|
66
|
-
entityDescription: (
|
67
|
+
entityDescription: (_f = this.config) === null || _f === void 0 ? void 0 : _f.label,
|
67
68
|
entity: this._entityName,
|
68
|
-
searchOptions: searchOptions
|
69
|
+
searchOptions: searchOptions,
|
70
|
+
criteria,
|
69
71
|
};
|
70
72
|
return this._application.executePreparedSearch(mode, argument, options);
|
71
73
|
}
|
@@ -11,6 +11,7 @@ export class SnkFilterBar {
|
|
11
11
|
this._updateSequence = [];
|
12
12
|
this._loadingPending = false;
|
13
13
|
this._configUpdated = false;
|
14
|
+
this._firstLoad = true;
|
14
15
|
this._pendingVariables = false;
|
15
16
|
this._customfiltersToBeUpdated = [];
|
16
17
|
this._calculateSortIndex = (item) => {
|
@@ -165,13 +166,27 @@ export class SnkFilterBar {
|
|
165
166
|
return;
|
166
167
|
}
|
167
168
|
this._loadingPending = false;
|
168
|
-
this.dataUnit.
|
169
|
+
this.doLoadData(this.dataUnit.getLastLoadRequest() != undefined);
|
169
170
|
}
|
170
171
|
if (this._configUpdated) {
|
171
172
|
this._configUpdated = false;
|
172
173
|
ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
|
173
174
|
}
|
174
175
|
}
|
176
|
+
async doLoadData(forceReload = false) {
|
177
|
+
try {
|
178
|
+
if (this._firstLoad && !forceReload) {
|
179
|
+
let autoLoad = await this._application.getBooleanParam("global.carregar.registros.iniciar.tela");
|
180
|
+
if (!autoLoad) {
|
181
|
+
return;
|
182
|
+
}
|
183
|
+
}
|
184
|
+
this.dataUnit.loadData(undefined, undefined, true);
|
185
|
+
}
|
186
|
+
finally {
|
187
|
+
this._firstLoad = false;
|
188
|
+
}
|
189
|
+
}
|
175
190
|
/**
|
176
191
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
177
192
|
* através de um pequeno modulo na estrutura da aplicação:
|
@@ -209,7 +224,7 @@ export class SnkFilterBar {
|
|
209
224
|
registryFilterProvider() {
|
210
225
|
this.dataUnit.addFilterProvider(this);
|
211
226
|
if (this.filterConfig) {
|
212
|
-
this.
|
227
|
+
this.doLoadData();
|
213
228
|
}
|
214
229
|
}
|
215
230
|
itemFocused(selectedItem) {
|
@@ -52,6 +52,7 @@ export class SnkGrid {
|
|
52
52
|
this.taskbarCustomContainerId = undefined;
|
53
53
|
this.gridHeaderCustomSlotId = 'GRID_HEADER_CUSTOM_ELEMENTS';
|
54
54
|
this.topTaskbarCustomSlotId = 'GRID_TASKBAR_CUSTOM_ELEMENTS';
|
55
|
+
this.disablePersonalizedFilter = undefined;
|
55
56
|
}
|
56
57
|
/**
|
57
58
|
* Exibe a janela de configurações da grade.
|
@@ -399,7 +400,7 @@ export class SnkGrid {
|
|
399
400
|
return undefined;
|
400
401
|
}
|
401
402
|
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
402
|
-
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail) }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
403
|
+
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
403
404
|
}
|
404
405
|
static get is() { return "snk-grid"; }
|
405
406
|
static get encapsulation() { return "scoped"; }
|
@@ -742,6 +743,23 @@ export class SnkGrid {
|
|
742
743
|
"attribute": "top-taskbar-custom-slot-id",
|
743
744
|
"reflect": false,
|
744
745
|
"defaultValue": "'GRID_TASKBAR_CUSTOM_ELEMENTS'"
|
746
|
+
},
|
747
|
+
"disablePersonalizedFilter": {
|
748
|
+
"type": "boolean",
|
749
|
+
"mutable": false,
|
750
|
+
"complexType": {
|
751
|
+
"original": "boolean",
|
752
|
+
"resolved": "boolean",
|
753
|
+
"references": {}
|
754
|
+
},
|
755
|
+
"required": false,
|
756
|
+
"optional": false,
|
757
|
+
"docs": {
|
758
|
+
"tags": [],
|
759
|
+
"text": "Desabilita a apresenta\u00E7\u00E3o da op\u00E7\u00E3o de filtros personalizados na filter bar (chip de filtros) \ne no modal lateral de filtros (container de filtros personalizados)."
|
760
|
+
},
|
761
|
+
"attribute": "disable-personalized-filter",
|
762
|
+
"reflect": false
|
745
763
|
}
|
746
764
|
};
|
747
765
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
|
1
|
+
import { ApplicationContext, ElementIDUtils, OverflowDirection, OverflowWatcher, StringUtils, OVERFLOWED_CLASS_NAME } from '@sankhyalabs/core';
|
2
2
|
import { h, Host } from '@stencil/core';
|
3
3
|
import { AuthorizationConfig } from '../snk-configurator/AuthorizationConfig';
|
4
4
|
import { AuthorizationElements, buildCustomButton, buildElem, TaskbarElement, VisibleWhenForbidden, } from './elements/taskbar-elements';
|
@@ -6,6 +6,8 @@ import { PresentationMode } from '../../lib/@types';
|
|
6
6
|
export class SnkTaskbar {
|
7
7
|
constructor() {
|
8
8
|
this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
|
9
|
+
this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME = 'taskbar-custom-elements-container';
|
10
|
+
this.ACTIONS_BUTTON_TAG = 'TASKBAR-ACTIONS-BUTTON';
|
9
11
|
this._titleKeyByElement = {
|
10
12
|
[TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
|
11
13
|
[TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
|
@@ -23,11 +25,14 @@ export class SnkTaskbar {
|
|
23
25
|
[TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
|
24
26
|
};
|
25
27
|
this._permissions = undefined;
|
28
|
+
this._overFlowedElements = [];
|
26
29
|
this._customElements = undefined;
|
27
30
|
this._customElementsId = undefined;
|
28
31
|
this._slotContainer = undefined;
|
32
|
+
this.alignRigth = false;
|
29
33
|
this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
|
30
34
|
this.customContainerId = undefined;
|
35
|
+
this.overflowStrategy = 'hiddenItems';
|
31
36
|
this.configName = undefined;
|
32
37
|
this.resourceID = undefined;
|
33
38
|
this.buttons = undefined;
|
@@ -41,6 +46,7 @@ export class SnkTaskbar {
|
|
41
46
|
}
|
42
47
|
observeButtons() {
|
43
48
|
this._definitions = undefined;
|
49
|
+
requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
|
44
50
|
}
|
45
51
|
// Internal methods
|
46
52
|
elementsFromString(strButtons) {
|
@@ -221,15 +227,52 @@ export class SnkTaskbar {
|
|
221
227
|
}
|
222
228
|
this.validatePresentationMode();
|
223
229
|
}
|
230
|
+
handleOverFlow(overFlowingElements) {
|
231
|
+
const elementsToHandle = overFlowingElements.filter(element => !this.hasToIgnoreOverFlow(element));
|
232
|
+
this.resetOverFlowedElements();
|
233
|
+
this.doOverFlowElements(elementsToHandle);
|
234
|
+
}
|
235
|
+
resetOverFlowedElements() {
|
236
|
+
this._overFlowedElements.forEach(element => {
|
237
|
+
element.classList.remove(OVERFLOWED_CLASS_NAME);
|
238
|
+
});
|
239
|
+
this._overFlowedElements = [];
|
240
|
+
}
|
241
|
+
doOverFlowElements(overFlowedElements) {
|
242
|
+
overFlowedElements.forEach(element => {
|
243
|
+
element.classList.add(OVERFLOWED_CLASS_NAME);
|
244
|
+
this._overFlowedElements.push(element);
|
245
|
+
});
|
246
|
+
}
|
247
|
+
hasToIgnoreOverFlow(element) {
|
248
|
+
return element.classList.contains(this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME);
|
249
|
+
}
|
250
|
+
handleOverFlowStrategy() {
|
251
|
+
if (this.overflowStrategy === 'hiddenItems') {
|
252
|
+
this._overFlowWatcher = new OverflowWatcher(this.buildOverFlowWatcherParams());
|
253
|
+
}
|
254
|
+
}
|
255
|
+
buildOverFlowWatcherParams() {
|
256
|
+
return {
|
257
|
+
element: this._element,
|
258
|
+
callback: this.handleOverFlow.bind(this),
|
259
|
+
overFlowDirection: OverflowDirection.HORIZONTAL,
|
260
|
+
deltaSize: 1,
|
261
|
+
notOverFlow: ["moreOptions"]
|
262
|
+
};
|
263
|
+
}
|
224
264
|
componentDidLoad() {
|
225
265
|
const dataInfo = { dataUnit: this.dataUnit };
|
226
266
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
267
|
+
this.handleOverFlowStrategy();
|
227
268
|
}
|
228
269
|
componentDidRender() {
|
229
270
|
this.appendCustomElementsInTaskbar();
|
230
271
|
}
|
231
272
|
disconnectedCallback() {
|
273
|
+
var _a;
|
232
274
|
this.unlinkAllCustomElements();
|
275
|
+
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
|
233
276
|
}
|
234
277
|
unlinkAllCustomElements() {
|
235
278
|
var _a;
|
@@ -247,7 +290,7 @@ export class SnkTaskbar {
|
|
247
290
|
return undefined;
|
248
291
|
}
|
249
292
|
let index = 0;
|
250
|
-
return (h(Host,
|
293
|
+
return (h(Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
|
251
294
|
var _a;
|
252
295
|
if (elem === TaskbarElement.DIVIDER) {
|
253
296
|
index = 0;
|
@@ -265,7 +308,12 @@ export class SnkTaskbar {
|
|
265
308
|
return this.addCustomElementContainer(elem);
|
266
309
|
}
|
267
310
|
return h("slot", { name: elem });
|
268
|
-
})), h("div", { class:
|
311
|
+
})), h("div", { class: this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME }, h("slot", { name: this.customSlotId }))));
|
312
|
+
}
|
313
|
+
getHostClasses() {
|
314
|
+
if (this.overflowStrategy !== 'hiddenItems')
|
315
|
+
return 'no-wrap';
|
316
|
+
return `full-width ${this.alignRigth ? 'align-right' : ""}`;
|
269
317
|
}
|
270
318
|
static get is() { return "snk-taskbar"; }
|
271
319
|
static get encapsulation() { return "scoped"; }
|
@@ -281,6 +329,24 @@ export class SnkTaskbar {
|
|
281
329
|
}
|
282
330
|
static get properties() {
|
283
331
|
return {
|
332
|
+
"alignRigth": {
|
333
|
+
"type": "boolean",
|
334
|
+
"mutable": false,
|
335
|
+
"complexType": {
|
336
|
+
"original": "boolean",
|
337
|
+
"resolved": "boolean",
|
338
|
+
"references": {}
|
339
|
+
},
|
340
|
+
"required": false,
|
341
|
+
"optional": false,
|
342
|
+
"docs": {
|
343
|
+
"tags": [],
|
344
|
+
"text": "Usado para determinar O alinhamento dos items na taskbar."
|
345
|
+
},
|
346
|
+
"attribute": "align-rigth",
|
347
|
+
"reflect": false,
|
348
|
+
"defaultValue": "false"
|
349
|
+
},
|
284
350
|
"customSlotId": {
|
285
351
|
"type": "string",
|
286
352
|
"mutable": false,
|
@@ -316,6 +382,24 @@ export class SnkTaskbar {
|
|
316
382
|
"attribute": "custom-container-id",
|
317
383
|
"reflect": false
|
318
384
|
},
|
385
|
+
"overflowStrategy": {
|
386
|
+
"type": "string",
|
387
|
+
"mutable": false,
|
388
|
+
"complexType": {
|
389
|
+
"original": "'hiddenItems' | 'none'",
|
390
|
+
"resolved": "\"hiddenItems\" | \"none\"",
|
391
|
+
"references": {}
|
392
|
+
},
|
393
|
+
"required": false,
|
394
|
+
"optional": false,
|
395
|
+
"docs": {
|
396
|
+
"tags": [],
|
397
|
+
"text": "Define como ser\u00E1 o comportamento da taskbar quando ocorrer overflow"
|
398
|
+
},
|
399
|
+
"attribute": "overflow-strategy",
|
400
|
+
"reflect": false,
|
401
|
+
"defaultValue": "'hiddenItems'"
|
402
|
+
},
|
319
403
|
"configName": {
|
320
404
|
"type": "string",
|
321
405
|
"mutable": false,
|
@@ -515,6 +599,7 @@ export class SnkTaskbar {
|
|
515
599
|
static get states() {
|
516
600
|
return {
|
517
601
|
"_permissions": {},
|
602
|
+
"_overFlowedElements": {},
|
518
603
|
"_customElements": {},
|
519
604
|
"_customElementsId": {},
|
520
605
|
"_slotContainer": {}
|
@@ -3,7 +3,22 @@ import { DateUtils, StringUtils, ObjectUtils } from "@sankhyalabs/core";
|
|
3
3
|
import { DataFetcher } from "../DataFetcher";
|
4
4
|
export default class ParametersFetcher {
|
5
5
|
constructor() {
|
6
|
+
this._embeddedParams = new Map();
|
6
7
|
this.templateByQuery = new Map();
|
8
|
+
try {
|
9
|
+
if (window["MGE_PARAMS"] != undefined) {
|
10
|
+
const source = atob(window['MGE_PARAMS']);
|
11
|
+
const params = source.split('__;__');
|
12
|
+
params.forEach(param => {
|
13
|
+
const [key, value] = param.split("__=__");
|
14
|
+
this._embeddedParams.set(key, value);
|
15
|
+
});
|
16
|
+
}
|
17
|
+
}
|
18
|
+
catch (error) {
|
19
|
+
console.error("Problemas ao obter parâmetros embarcados");
|
20
|
+
console.error(error);
|
21
|
+
}
|
7
22
|
this.buldTemplates();
|
8
23
|
}
|
9
24
|
buldTemplates() {
|
@@ -15,6 +30,9 @@ export default class ParametersFetcher {
|
|
15
30
|
}`);
|
16
31
|
}
|
17
32
|
async getParam(name) {
|
33
|
+
if (this._embeddedParams.has(name)) {
|
34
|
+
return Promise.resolve(this._embeddedParams.get(name));
|
35
|
+
}
|
18
36
|
const completPath = `param://application?params=${name}`;
|
19
37
|
return DataFetcher.get().callGraphQL({
|
20
38
|
values: { name: completPath },
|
@@ -52,6 +70,9 @@ export default class ParametersFetcher {
|
|
52
70
|
if (Array.isArray(obj) && obj.length > 0) {
|
53
71
|
obj = obj[0];
|
54
72
|
}
|
73
|
+
if (typeof obj === "string") {
|
74
|
+
return obj;
|
75
|
+
}
|
55
76
|
if (StringUtils.isEmpty(obj.resource))
|
56
77
|
return "";
|
57
78
|
try {
|