@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-38407.0 → 0.0.0-bugfix-dev-KB-9999.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-977c90b1.js → pesquisa-fetcher-c790ffb7.js} +21 -7
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_2.cjs.entry.js +4 -2
- 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 +25 -3
- package/dist/cjs/snk-filter-modal.cjs.entry.js +2 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -1
- package/dist/cjs/snk-grid.cjs.entry.js +2 -1
- package/dist/cjs/{snk-guides-viewer-5803fe92.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 +14 -2
- 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-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/filter-item/editors/snk-filter-multi-select.js +2 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +19 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +39 -2
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
- package/dist/collection/components/snk-grid/snk-grid.js +19 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +53 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +3 -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/dataUnit/InMemoryLoader.js +1 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +17 -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 +21 -7
- 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 +26 -3
- package/dist/components/snk-filter-modal.js +4 -2
- package/dist/components/snk-filter-multi-select.js +2 -1
- package/dist/components/snk-grid2.js +3 -1
- package/dist/components/snk-simple-crud2.js +15 -1
- package/dist/components/snk-taskbar2.js +55 -4
- package/dist/components/taskbar-actions-button2.js +3 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-5e228b5a.js → pesquisa-fetcher-4000d0b8.js} +21 -7
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_2.entry.js +4 -2
- 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 +25 -3
- package/dist/esm/snk-filter-modal.entry.js +2 -1
- package/dist/esm/snk-filter-multi-select.entry.js +2 -1
- package/dist/esm/snk-grid.entry.js +2 -1
- package/dist/esm/{snk-guides-viewer-c77e1c8f.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 +14 -2
- package/dist/esm/snk-taskbar.entry.js +52 -4
- package/dist/sankhyablocks/{p-3efca291.entry.js → p-0574c231.entry.js} +1 -1
- package/dist/sankhyablocks/p-0eb1ff03.js +65 -0
- package/dist/sankhyablocks/{p-59ce706a.entry.js → p-11bbb65e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ce4bca21.js → p-2419f19f.js} +1 -1
- package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
- package/dist/sankhyablocks/{p-2dd38000.entry.js → p-3838d2ff.entry.js} +1 -1
- package/dist/sankhyablocks/{p-34156b41.entry.js → p-45d82274.entry.js} +1 -1
- package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
- package/dist/sankhyablocks/p-79b4b271.entry.js +1 -0
- package/dist/sankhyablocks/p-96ef14f9.entry.js +1 -0
- package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
- package/dist/sankhyablocks/{p-86164061.entry.js → p-db4edd06.entry.js} +3 -3
- package/dist/sankhyablocks/p-df2b84c4.entry.js +1 -0
- package/dist/sankhyablocks/p-e0b23084.entry.js +1 -0
- package/dist/sankhyablocks/p-ed2dce4b.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +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/filter-modal/snk-filter-modal.d.ts +5 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +3 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +10 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +20 -1
- package/dist/types/components.d.ts +64 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
- package/package.json +9 -2
- package/dist/sankhyablocks/p-20726710.entry.js +0 -1
- package/dist/sankhyablocks/p-25c77ddb.js +0 -65
- package/dist/sankhyablocks/p-69efa80d.entry.js +0 -1
- package/dist/sankhyablocks/p-7d8d7fe9.entry.js +0 -1
- package/dist/sankhyablocks/p-a9e5b094.entry.js +0 -1
- package/dist/sankhyablocks/p-ab568a2e.entry.js +0 -1
- package/dist/sankhyablocks/p-b05ab13d.entry.js +0 -1
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
- package/dist/sankhyablocks/p-f39f48c2.entry.js +0 -1
|
@@ -34,6 +34,8 @@ export class SnkSimpleCrud {
|
|
|
34
34
|
this.taskbarManager = undefined;
|
|
35
35
|
this.messagesBuilder = undefined;
|
|
36
36
|
this.useEnterLikeTab = false;
|
|
37
|
+
this.actionsList = undefined;
|
|
38
|
+
this.configName = undefined;
|
|
37
39
|
}
|
|
38
40
|
resolveInMemoryBtns(taskbarButtons) {
|
|
39
41
|
const newTaskBarConfig = [...taskbarButtons];
|
|
@@ -232,7 +234,7 @@ export class SnkSimpleCrud {
|
|
|
232
234
|
}
|
|
233
235
|
getActionsList() {
|
|
234
236
|
var _a, _b;
|
|
235
|
-
|
|
237
|
+
const hardList = [{
|
|
236
238
|
value: StringUtils.generateUUID(),
|
|
237
239
|
label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "Buscar",
|
|
238
240
|
disableCloseOnSelect: true,
|
|
@@ -241,6 +243,16 @@ export class SnkSimpleCrud {
|
|
|
241
243
|
? this.getColumnSearch(actionButton, item)
|
|
242
244
|
: this.getFieldSearch(actionButton, item)
|
|
243
245
|
}];
|
|
246
|
+
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
|
247
|
+
const taskbarID = this.getTopTaskBarId();
|
|
248
|
+
return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
|
|
249
|
+
}
|
|
250
|
+
return hardList.concat(this.actionsList);
|
|
251
|
+
}
|
|
252
|
+
getTopTaskBarId() {
|
|
253
|
+
var _a;
|
|
254
|
+
return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${PresentationMode.PRIMARY}` :
|
|
255
|
+
`snkGridTopTaskbar.regular${PresentationMode.PRIMARY}`;
|
|
244
256
|
}
|
|
245
257
|
async keyDownListener(event) {
|
|
246
258
|
if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
|
|
@@ -494,6 +506,46 @@ export class SnkSimpleCrud {
|
|
|
494
506
|
"attribute": "use-enter-like-tab",
|
|
495
507
|
"reflect": false,
|
|
496
508
|
"defaultValue": "false"
|
|
509
|
+
},
|
|
510
|
+
"actionsList": {
|
|
511
|
+
"type": "unknown",
|
|
512
|
+
"mutable": false,
|
|
513
|
+
"complexType": {
|
|
514
|
+
"original": "Array<Action>",
|
|
515
|
+
"resolved": "Action[]",
|
|
516
|
+
"references": {
|
|
517
|
+
"Array": {
|
|
518
|
+
"location": "global"
|
|
519
|
+
},
|
|
520
|
+
"Action": {
|
|
521
|
+
"location": "import",
|
|
522
|
+
"path": "../snk-taskbar/snk-taskbar"
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
"required": false,
|
|
527
|
+
"optional": false,
|
|
528
|
+
"docs": {
|
|
529
|
+
"tags": [],
|
|
530
|
+
"text": "A\u00E7\u00F5es a serem colocadas no bot\u00E3o \"Mais op\u00E7\u00F5es\" do componente snk-taskbar."
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
"configName": {
|
|
534
|
+
"type": "string",
|
|
535
|
+
"mutable": true,
|
|
536
|
+
"complexType": {
|
|
537
|
+
"original": "string",
|
|
538
|
+
"resolved": "string",
|
|
539
|
+
"references": {}
|
|
540
|
+
},
|
|
541
|
+
"required": false,
|
|
542
|
+
"optional": false,
|
|
543
|
+
"docs": {
|
|
544
|
+
"tags": [],
|
|
545
|
+
"text": "Usado para salvar as configura\u00E7\u00F5es dos blocos de constru\u00E7\u00E3o."
|
|
546
|
+
},
|
|
547
|
+
"attribute": "config-name",
|
|
548
|
+
"reflect": false
|
|
497
549
|
}
|
|
498
550
|
};
|
|
499
551
|
}
|
|
@@ -67,7 +67,7 @@ export class TaskbarActionsButton {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
getSelectedAction(id, actions) {
|
|
70
|
-
let selectedItem;
|
|
70
|
+
let selectedItem = null;
|
|
71
71
|
for (const item of actions) {
|
|
72
72
|
if (item.id === id) {
|
|
73
73
|
selectedItem = item;
|
|
@@ -76,6 +76,8 @@ export class TaskbarActionsButton {
|
|
|
76
76
|
if (!(item === null || item === void 0 ? void 0 : item.children))
|
|
77
77
|
continue;
|
|
78
78
|
selectedItem = this.getSelectedAction(id, item.children);
|
|
79
|
+
if (selectedItem)
|
|
80
|
+
break;
|
|
79
81
|
}
|
|
80
82
|
return selectedItem;
|
|
81
83
|
}
|
|
@@ -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": {}
|
|
@@ -13,7 +13,7 @@ export default class InMemoryLoader {
|
|
|
13
13
|
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
|
14
14
|
}
|
|
15
15
|
getRecordsToLoad() {
|
|
16
|
-
if (this._initialRecords == undefined
|
|
16
|
+
if (this._initialRecords == undefined || this.dataUnit.records.length > 0) {
|
|
17
17
|
this._initialRecords = this.dataUnit.records;
|
|
18
18
|
}
|
|
19
19
|
return this._initialRecords;
|
|
@@ -184,15 +184,29 @@ export default class DataUnitFetcher {
|
|
|
184
184
|
});
|
|
185
185
|
return updatingFields;
|
|
186
186
|
}
|
|
187
|
+
getUpdatingFields(dataUnit, originalUpdatingFields) {
|
|
188
|
+
if (originalUpdatingFields == undefined) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const updatingFields = Object.assign({}, originalUpdatingFields);
|
|
192
|
+
Object.keys(updatingFields).forEach(key => {
|
|
193
|
+
const descriptor = dataUnit.getField(key);
|
|
194
|
+
if (descriptor != undefined && descriptor.standAlone) {
|
|
195
|
+
delete updatingFields[key];
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
return this.addTransientProperties(dataUnit, updatingFields);
|
|
199
|
+
}
|
|
187
200
|
saveData(dataUnit, duChanges) {
|
|
188
201
|
const updatedRecordsIds = [];
|
|
189
202
|
const addedRecordsIds = [];
|
|
190
203
|
const changes = duChanges.map((change) => {
|
|
191
|
-
const { dataUnit: changeDU, record,
|
|
204
|
+
const { dataUnit: changeDU, record, operation } = change;
|
|
192
205
|
const dataUnitInstance = DataUnitStorage.get(changeDU);
|
|
206
|
+
const updatingFields = this.getUpdatingFields(dataUnitInstance, change.updatingFields);
|
|
193
207
|
let parsedUpdatingFields;
|
|
194
|
-
if (updatingFields) {
|
|
195
|
-
parsedUpdatingFields = Object.entries(
|
|
208
|
+
if (updatingFields != undefined) {
|
|
209
|
+
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
|
196
210
|
const descriptor = dataUnitInstance.getField(fieldName);
|
|
197
211
|
const dataType = descriptor ? descriptor.dataType : DataType.TEXT;
|
|
198
212
|
return { fieldName, dataType, value: dataUnitInstance.valueToString(fieldName, value) };
|
|
@@ -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 {
|
|
@@ -50,7 +50,7 @@ export class PesquisaFetcher {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
loadAdvancedSearch(entityName, argument, criteria, searchOptions) {
|
|
53
|
-
var _a, _b, _c;
|
|
53
|
+
var _a, _b, _c, _d;
|
|
54
54
|
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
|
55
55
|
const values = {
|
|
56
56
|
argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
|
|
@@ -63,7 +63,7 @@ export class PesquisaFetcher {
|
|
|
63
63
|
$: (_a = values.criteria) === null || _a === void 0 ? void 0 : _a.expression
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
|
-
if (((_b = values.criteria) === null || _b === void 0 ? void 0 : _b.params.length) > 0) {
|
|
66
|
+
if (((_c = (_b = values.criteria) === null || _b === void 0 ? void 0 : _b.params) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
67
67
|
externalCriteria.params = {
|
|
68
68
|
param: values.criteria.params.map(param => {
|
|
69
69
|
let value = param.value;
|
|
@@ -97,7 +97,7 @@ export class PesquisaFetcher {
|
|
|
97
97
|
const reqBody = {
|
|
98
98
|
"serviceName": serviceName,
|
|
99
99
|
"requestBody": {
|
|
100
|
-
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (
|
|
100
|
+
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (_d = values.searchOptions) === null || _d === void 0 ? void 0 : _d.rootEntity }, { options }),
|
|
101
101
|
"clientEventList": {
|
|
102
102
|
"clientEvent": []
|
|
103
103
|
}
|
|
@@ -54,7 +54,7 @@ class PesquisaFetcher {
|
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
loadAdvancedSearch(entityName, argument, criteria, searchOptions) {
|
|
57
|
-
var _a, _b, _c;
|
|
57
|
+
var _a, _b, _c, _d;
|
|
58
58
|
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
|
59
59
|
const values = {
|
|
60
60
|
argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
|
|
@@ -67,7 +67,7 @@ class PesquisaFetcher {
|
|
|
67
67
|
$: (_a = values.criteria) === null || _a === void 0 ? void 0 : _a.expression
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
-
if (((_b = values.criteria) === null || _b === void 0 ? void 0 : _b.params.length) > 0) {
|
|
70
|
+
if (((_c = (_b = values.criteria) === null || _b === void 0 ? void 0 : _b.params) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
71
71
|
externalCriteria.params = {
|
|
72
72
|
param: values.criteria.params.map(param => {
|
|
73
73
|
let value = param.value;
|
|
@@ -101,7 +101,7 @@ class PesquisaFetcher {
|
|
|
101
101
|
const reqBody = {
|
|
102
102
|
"serviceName": serviceName,
|
|
103
103
|
"requestBody": {
|
|
104
|
-
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (
|
|
104
|
+
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (_d = values.searchOptions) === null || _d === void 0 ? void 0 : _d.rootEntity }, { options }),
|
|
105
105
|
"clientEventList": {
|
|
106
106
|
"clientEvent": []
|
|
107
107
|
}
|
|
@@ -402,7 +402,7 @@ class InMemoryLoader {
|
|
|
402
402
|
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
|
403
403
|
}
|
|
404
404
|
getRecordsToLoad() {
|
|
405
|
-
if (this._initialRecords == undefined
|
|
405
|
+
if (this._initialRecords == undefined || this.dataUnit.records.length > 0) {
|
|
406
406
|
this._initialRecords = this.dataUnit.records;
|
|
407
407
|
}
|
|
408
408
|
return this._initialRecords;
|
|
@@ -1005,15 +1005,29 @@ class DataUnitFetcher {
|
|
|
1005
1005
|
});
|
|
1006
1006
|
return updatingFields;
|
|
1007
1007
|
}
|
|
1008
|
+
getUpdatingFields(dataUnit, originalUpdatingFields) {
|
|
1009
|
+
if (originalUpdatingFields == undefined) {
|
|
1010
|
+
return;
|
|
1011
|
+
}
|
|
1012
|
+
const updatingFields = Object.assign({}, originalUpdatingFields);
|
|
1013
|
+
Object.keys(updatingFields).forEach(key => {
|
|
1014
|
+
const descriptor = dataUnit.getField(key);
|
|
1015
|
+
if (descriptor != undefined && descriptor.standAlone) {
|
|
1016
|
+
delete updatingFields[key];
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
return this.addTransientProperties(dataUnit, updatingFields);
|
|
1020
|
+
}
|
|
1008
1021
|
saveData(dataUnit, duChanges) {
|
|
1009
1022
|
const updatedRecordsIds = [];
|
|
1010
1023
|
const addedRecordsIds = [];
|
|
1011
1024
|
const changes = duChanges.map((change) => {
|
|
1012
|
-
const { dataUnit: changeDU, record,
|
|
1025
|
+
const { dataUnit: changeDU, record, operation } = change;
|
|
1013
1026
|
const dataUnitInstance = DataUnitStorage.get(changeDU);
|
|
1027
|
+
const updatingFields = this.getUpdatingFields(dataUnitInstance, change.updatingFields);
|
|
1014
1028
|
let parsedUpdatingFields;
|
|
1015
|
-
if (updatingFields) {
|
|
1016
|
-
parsedUpdatingFields = Object.entries(
|
|
1029
|
+
if (updatingFields != undefined) {
|
|
1030
|
+
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
|
1017
1031
|
const descriptor = dataUnitInstance.getField(fieldName);
|
|
1018
1032
|
const dataType = descriptor ? descriptor.dataType : DataType.TEXT;
|
|
1019
1033
|
return { fieldName, dataType, value: dataUnitInstance.valueToString(fieldName, value) };
|
|
@@ -72,7 +72,22 @@ class TotalsFetcher {
|
|
|
72
72
|
|
|
73
73
|
class ParametersFetcher {
|
|
74
74
|
constructor() {
|
|
75
|
+
this._embeddedParams = new Map();
|
|
75
76
|
this.templateByQuery = new Map();
|
|
77
|
+
try {
|
|
78
|
+
if (window["MGE_PARAMS"] != undefined) {
|
|
79
|
+
const source = atob(window['MGE_PARAMS']);
|
|
80
|
+
const params = source.split('__;__');
|
|
81
|
+
params.forEach(param => {
|
|
82
|
+
const [key, value] = param.split("__=__");
|
|
83
|
+
this._embeddedParams.set(key, value);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
console.error("Problemas ao obter parâmetros embarcados");
|
|
89
|
+
console.error(error);
|
|
90
|
+
}
|
|
76
91
|
this.buldTemplates();
|
|
77
92
|
}
|
|
78
93
|
buldTemplates() {
|
|
@@ -84,6 +99,9 @@ class ParametersFetcher {
|
|
|
84
99
|
}`);
|
|
85
100
|
}
|
|
86
101
|
async getParam(name) {
|
|
102
|
+
if (this._embeddedParams.has(name)) {
|
|
103
|
+
return Promise.resolve(this._embeddedParams.get(name));
|
|
104
|
+
}
|
|
87
105
|
const completPath = `param://application?params=${name}`;
|
|
88
106
|
return DataFetcher.get().callGraphQL({
|
|
89
107
|
values: { name: completPath },
|
|
@@ -121,6 +139,9 @@ class ParametersFetcher {
|
|
|
121
139
|
if (Array.isArray(obj) && obj.length > 0) {
|
|
122
140
|
obj = obj[0];
|
|
123
141
|
}
|
|
142
|
+
if (typeof obj === "string") {
|
|
143
|
+
return obj;
|
|
144
|
+
}
|
|
124
145
|
if (StringUtils.isEmpty(obj.resource))
|
|
125
146
|
return "";
|
|
126
147
|
try {
|
|
@@ -69,6 +69,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
69
69
|
this.presentationMode = PresentationMode.PRIMARY;
|
|
70
70
|
this.messagesBuilder = undefined;
|
|
71
71
|
this.useEnterLikeTab = false;
|
|
72
|
+
this.disablePersonalizedFilter = undefined;
|
|
72
73
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
|
73
74
|
}
|
|
74
75
|
/**
|
|
@@ -201,7 +202,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
201
202
|
window.removeEventListener("keydown", this._keyDownHandler);
|
|
202
203
|
}
|
|
203
204
|
async initKeyboardManager() {
|
|
204
|
-
|
|
205
|
+
var _a;
|
|
206
|
+
const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
|
|
205
207
|
if (keyboardManager) {
|
|
206
208
|
const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
|
|
207
209
|
async function saveDataUnitHandlingFocus() {
|
|
@@ -250,7 +252,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
250
252
|
}
|
|
251
253
|
}
|
|
252
254
|
async removeShortcuts() {
|
|
253
|
-
|
|
255
|
+
var _a;
|
|
256
|
+
const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
|
|
254
257
|
if (keyboardManager) {
|
|
255
258
|
keyboardManager
|
|
256
259
|
.unbind("F6")
|
|
@@ -317,7 +320,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
317
320
|
return;
|
|
318
321
|
}
|
|
319
322
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
|
320
|
-
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" }))));
|
|
323
|
+
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" }))));
|
|
321
324
|
}
|
|
322
325
|
get _element() { return this; }
|
|
323
326
|
static get watchers() { return {
|
|
@@ -336,6 +339,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
336
339
|
"presentationMode": [1, "presentation-mode"],
|
|
337
340
|
"messagesBuilder": [1040],
|
|
338
341
|
"useEnterLikeTab": [4, "use-enter-like-tab"],
|
|
342
|
+
"disablePersonalizedFilter": [4, "disable-personalized-filter"],
|
|
339
343
|
"_dataUnit": [32],
|
|
340
344
|
"_dataState": [32],
|
|
341
345
|
"attachmentRegisterKey": [32],
|
|
@@ -43,7 +43,7 @@ import { d as defineCustomElement$l } from './snk-field-config2.js';
|
|
|
43
43
|
import { d as defineCustomElement$d } from './snk-form-config2.js';
|
|
44
44
|
import { d as defineCustomElement$4 } from './snk-tab-config2.js';
|
|
45
45
|
|
|
46
|
-
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
|
|
46
|
+
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
|
|
47
47
|
|
|
48
48
|
const FORM_NAME_PREFIX = "__FORM:";
|
|
49
49
|
const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -425,7 +425,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
425
425
|
}
|
|
426
426
|
buildTaskBar() {
|
|
427
427
|
var _a;
|
|
428
|
-
return h("div", { class: `
|
|
428
|
+
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" })));
|
|
429
429
|
}
|
|
430
430
|
async dataUnitActionHandler(action) {
|
|
431
431
|
var _a;
|
|
@@ -484,7 +484,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
484
484
|
}
|
|
485
485
|
this.loadTaskbarProcessor();
|
|
486
486
|
const showGuides = this._guides && (this._guides.length > 1);
|
|
487
|
-
return (h("section", { class: "snk-guides-viewer" }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "
|
|
487
|
+
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 &&
|
|
488
488
|
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 ?
|
|
489
489
|
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) })
|
|
490
490
|
:
|
|
@@ -62,16 +62,18 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
62
62
|
this.loadListSource();
|
|
63
63
|
}
|
|
64
64
|
optionLoader(searchArgument) {
|
|
65
|
-
var _a, _b, _c, _d;
|
|
65
|
+
var _a, _b, _c, _d, _e, _f;
|
|
66
66
|
const { mode, argument } = searchArgument;
|
|
67
67
|
if (this._application === undefined) {
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
70
|
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;
|
|
71
|
+
const criteria = (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e.criteria;
|
|
71
72
|
const options = {
|
|
72
|
-
entityDescription: (
|
|
73
|
+
entityDescription: (_f = this.config) === null || _f === void 0 ? void 0 : _f.label,
|
|
73
74
|
entity: this._entityName,
|
|
74
|
-
searchOptions: searchOptions
|
|
75
|
+
searchOptions: searchOptions,
|
|
76
|
+
criteria,
|
|
75
77
|
};
|
|
76
78
|
return this._application.executePreparedSearch(mode, argument, options);
|
|
77
79
|
}
|