@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-99992.1 → 0.0.0-bugfix-dev-KB-47082.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/{ConfigStorage-302bbbd4.js → ConfigStorage-d4c99a5e.js} +2 -2
- package/dist/cjs/{DataFetcher-ba94ed5b.js → DataFetcher-99f0f6ed.js} +5 -3
- package/dist/cjs/{SnkFormConfigManager-71c4768e.js → SnkFormConfigManager-3621bfc4.js} +2 -2
- package/dist/cjs/{auth-fetcher-c8467c07.js → auth-fetcher-5161d082.js} +1 -1
- package/dist/cjs/{form-config-fetcher-df043d3d.js → form-config-fetcher-9f1a13ca.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-c790ffb7.js → pesquisa-fetcher-c416a6b7.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_2.cjs.entry.js +4 -4
- package/dist/cjs/snk-application.cjs.entry.js +5 -5
- package/dist/cjs/snk-attach.cjs.entry.js +5 -5
- package/dist/cjs/snk-crud.cjs.entry.js +7 -6
- package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
- package/dist/cjs/snk-filter-bar.cjs.entry.js +12 -5
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +41 -27
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +6 -5
- package/dist/cjs/{snk-guides-viewer-32c1d35d.js → snk-guides-viewer-bd69fce4.js} +5 -5
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +6 -6
- package/dist/cjs/snk-taskbar.cjs.entry.js +41 -5
- package/dist/cjs/{taskbar-elements-01b85b99.js → taskbar-elements-1e4fb2e0.js} +8 -8
- package/dist/collection/components/snk-crud/snk-crud.js +20 -2
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +23 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +75 -2
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +39 -25
- package/dist/collection/components/snk-grid/snk-grid.js +20 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +2 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +1 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +8 -8
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +42 -5
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +5 -3
- package/dist/components/DataFetcher.js +5 -3
- package/dist/components/snk-crud.js +3 -1
- package/dist/components/snk-filter-bar2.js +13 -3
- package/dist/components/snk-form-config2.js +39 -25
- package/dist/components/snk-grid2.js +3 -1
- package/dist/components/snk-simple-crud2.js +2 -2
- package/dist/components/snk-taskbar2.js +50 -13
- package/dist/components/taskbar-actions-button2.js +1 -1
- package/dist/esm/{ConfigStorage-4151acc8.js → ConfigStorage-39ed8aeb.js} +2 -2
- package/dist/esm/{DataFetcher-aa159c5a.js → DataFetcher-a650ae58.js} +5 -3
- package/dist/esm/{SnkFormConfigManager-5c7d3771.js → SnkFormConfigManager-692e20c7.js} +2 -2
- package/dist/esm/{auth-fetcher-c05dc474.js → auth-fetcher-17dc5b5e.js} +1 -1
- package/dist/esm/{form-config-fetcher-36219cd3.js → form-config-fetcher-f121f880.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-4000d0b8.js → pesquisa-fetcher-ab16a2e8.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_2.entry.js +4 -4
- package/dist/esm/snk-application.entry.js +5 -5
- package/dist/esm/snk-attach.entry.js +5 -5
- package/dist/esm/snk-crud.entry.js +7 -6
- package/dist/esm/snk-data-exporter.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +7 -7
- package/dist/esm/snk-filter-bar.entry.js +12 -5
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +41 -27
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid-config.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +6 -5
- package/dist/esm/{snk-guides-viewer-8adacfd4.js → snk-guides-viewer-fde82cc1.js} +5 -5
- package/dist/esm/snk-guides-viewer.entry.js +7 -7
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +6 -6
- package/dist/esm/snk-taskbar.entry.js +41 -5
- package/dist/esm/{taskbar-elements-d4d0b424.js → taskbar-elements-846c027c.js} +8 -8
- package/dist/sankhyablocks/p-11ad137d.entry.js +1 -0
- package/dist/sankhyablocks/p-3e2e2424.entry.js +1 -0
- package/dist/sankhyablocks/p-3e91d5ea.entry.js +1 -0
- package/dist/sankhyablocks/p-50783a8b.js +1 -0
- package/dist/sankhyablocks/{p-2419f19f.js → p-57212bb5.js} +1 -1
- package/dist/sankhyablocks/{p-0574c231.entry.js → p-5f5b58b6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-aa95fb2c.js → p-67aedbe0.js} +1 -1
- package/dist/sankhyablocks/{p-573a07c5.js → p-725d04ba.js} +1 -1
- package/dist/sankhyablocks/{p-e0fd9555.entry.js → p-827e4b01.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e0b23084.entry.js → p-84bb8f47.entry.js} +1 -1
- package/dist/sankhyablocks/p-8c13d8d6.entry.js +1 -0
- package/dist/sankhyablocks/p-8c49760e.js +1 -0
- package/dist/sankhyablocks/{p-11bbb65e.entry.js → p-91b7f78a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7f3c7b09.entry.js → p-9d608b62.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0d7863ed.js → p-a13ccb86.js} +1 -1
- package/dist/sankhyablocks/p-b7004423.entry.js +1 -0
- package/dist/sankhyablocks/{p-9695f78b.js → p-be75153c.js} +1 -1
- package/dist/sankhyablocks/{p-0eb1ff03.js → p-c6247955.js} +1 -1
- package/dist/sankhyablocks/{p-3838d2ff.entry.js → p-d4802f81.entry.js} +1 -1
- package/dist/sankhyablocks/{p-761ed32f.entry.js → p-e3bd000e.entry.js} +1 -1
- package/dist/sankhyablocks/p-fb842329.entry.js +1 -0
- package/dist/sankhyablocks/{p-1d75d9f9.entry.js → p-fcdcb0e2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-db4edd06.entry.js → p-fd0a8d68.entry.js} +1 -1
- package/dist/sankhyablocks/{p-40915359.entry.js → p-fdc4cb9b.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +12 -1
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +1 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +7 -0
- package/dist/types/components.d.ts +43 -6
- package/package.json +1 -1
- package/dist/sankhyablocks/p-374d03f6.js +0 -1
- package/dist/sankhyablocks/p-45d82274.entry.js +0 -1
- package/dist/sankhyablocks/p-79b4b271.entry.js +0 -1
- package/dist/sankhyablocks/p-96ef14f9.entry.js +0 -1
- package/dist/sankhyablocks/p-cb7419e0.entry.js +0 -1
- package/dist/sankhyablocks/p-df2b84c4.entry.js +0 -1
- package/dist/sankhyablocks/p-e6380c60.js +0 -1
- package/dist/sankhyablocks/p-ed2dce4b.entry.js +0 -1
|
@@ -8,6 +8,7 @@ export class SnkTaskbar {
|
|
|
8
8
|
this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
|
|
9
9
|
this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME = 'taskbar-custom-elements-container';
|
|
10
10
|
this.ACTIONS_BUTTON_TAG = 'TASKBAR-ACTIONS-BUTTON';
|
|
11
|
+
this.NOT_OVERFLOW_ELEMENTS = ["moreOptions", "dataExporter_snkDataExporter", "actionsButton_snkActionsButton"];
|
|
11
12
|
this._titleKeyByElement = {
|
|
12
13
|
[TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
|
|
13
14
|
[TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
|
|
@@ -29,6 +30,7 @@ export class SnkTaskbar {
|
|
|
29
30
|
this._customElements = undefined;
|
|
30
31
|
this._customElementsId = undefined;
|
|
31
32
|
this._slotContainer = undefined;
|
|
33
|
+
this._hiddenActionsList = [];
|
|
32
34
|
this.alignRigth = false;
|
|
33
35
|
this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
|
|
34
36
|
this.customContainerId = undefined;
|
|
@@ -142,12 +144,19 @@ export class SnkTaskbar {
|
|
|
142
144
|
}
|
|
143
145
|
const taskbarElement = TaskbarElement[def.toString()];
|
|
144
146
|
if (taskbarElement) {
|
|
145
|
-
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.
|
|
147
|
+
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.buildDynamicActionsList(), this.configName, this.presentationMode);
|
|
146
148
|
}
|
|
147
149
|
else {
|
|
148
150
|
return buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
149
151
|
}
|
|
150
152
|
}
|
|
153
|
+
buildDynamicActionsList() {
|
|
154
|
+
var _a;
|
|
155
|
+
if (this._hiddenActionsList.length) {
|
|
156
|
+
return [...((_a = this.actionsList) !== null && _a !== void 0 ? _a : []), { type: 'divider', label: "", value: "" }, ...this._hiddenActionsList];
|
|
157
|
+
}
|
|
158
|
+
return this.actionsList;
|
|
159
|
+
}
|
|
151
160
|
getIdElemBtnNative(taskbarElem) {
|
|
152
161
|
return StringUtils.toCamelCase(taskbarElem);
|
|
153
162
|
}
|
|
@@ -188,9 +197,11 @@ export class SnkTaskbar {
|
|
|
188
197
|
});
|
|
189
198
|
}
|
|
190
199
|
addCustomElementContainer(elem) {
|
|
200
|
+
var _a;
|
|
191
201
|
const elementId = `${this.TASKBAR_ITEM_ID_PREFIX}${elem}`;
|
|
192
202
|
if (!this._customElementsId.includes(elementId)) {
|
|
193
203
|
this._customElementsId.push(elementId);
|
|
204
|
+
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.addNotOverFlowElement(elementId);
|
|
194
205
|
}
|
|
195
206
|
return h("span", { key: elementId, id: elementId });
|
|
196
207
|
}
|
|
@@ -236,14 +247,39 @@ export class SnkTaskbar {
|
|
|
236
247
|
this._overFlowedElements.forEach(element => {
|
|
237
248
|
element.classList.remove(OVERFLOWED_CLASS_NAME);
|
|
238
249
|
});
|
|
250
|
+
this._hiddenActionsList = [];
|
|
239
251
|
this._overFlowedElements = [];
|
|
240
252
|
}
|
|
241
253
|
doOverFlowElements(overFlowedElements) {
|
|
242
254
|
overFlowedElements.forEach(element => {
|
|
243
255
|
element.classList.add(OVERFLOWED_CLASS_NAME);
|
|
244
256
|
this._overFlowedElements.push(element);
|
|
257
|
+
this.addItemToActionList(element);
|
|
245
258
|
});
|
|
246
259
|
}
|
|
260
|
+
addItemToActionList(element) {
|
|
261
|
+
const taskbarElement = this.getTaskbarElementName(element);
|
|
262
|
+
if (taskbarElement && this.isEnabled(taskbarElement) && this.isAllowed(taskbarElement)) {
|
|
263
|
+
const optionItem = {
|
|
264
|
+
value: taskbarElement,
|
|
265
|
+
label: this.getTaskbarElementLabel(element),
|
|
266
|
+
iconName: this.getTaskbarElementIcon(element)
|
|
267
|
+
};
|
|
268
|
+
this._hiddenActionsList.push(optionItem);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
getTaskbarElementName(element) {
|
|
272
|
+
var _a;
|
|
273
|
+
return (_a = element.getAttribute('data-taskbar-element')) !== null && _a !== void 0 ? _a : "";
|
|
274
|
+
}
|
|
275
|
+
getTaskbarElementIcon(element) {
|
|
276
|
+
var _a;
|
|
277
|
+
return (_a = element.getAttribute('data-taskbar-icon')) !== null && _a !== void 0 ? _a : "";
|
|
278
|
+
}
|
|
279
|
+
getTaskbarElementLabel(element) {
|
|
280
|
+
var _a;
|
|
281
|
+
return (_a = element.getAttribute('data-taskbar-label')) !== null && _a !== void 0 ? _a : "";
|
|
282
|
+
}
|
|
247
283
|
hasToIgnoreOverFlow(element) {
|
|
248
284
|
return element.classList.contains(this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME);
|
|
249
285
|
}
|
|
@@ -257,8 +293,7 @@ export class SnkTaskbar {
|
|
|
257
293
|
element: this._element,
|
|
258
294
|
callback: this.handleOverFlow.bind(this),
|
|
259
295
|
overFlowDirection: OverflowDirection.HORIZONTAL,
|
|
260
|
-
|
|
261
|
-
notOverFlow: ["moreOptions"]
|
|
296
|
+
notOverFlow: this.NOT_OVERFLOW_ELEMENTS
|
|
262
297
|
};
|
|
263
298
|
}
|
|
264
299
|
componentDidLoad() {
|
|
@@ -291,7 +326,7 @@ export class SnkTaskbar {
|
|
|
291
326
|
}
|
|
292
327
|
let index = 0;
|
|
293
328
|
return (h(Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
|
|
294
|
-
var _a;
|
|
329
|
+
var _a, _b;
|
|
295
330
|
if (elem === TaskbarElement.DIVIDER) {
|
|
296
331
|
index = 0;
|
|
297
332
|
}
|
|
@@ -307,6 +342,7 @@ export class SnkTaskbar {
|
|
|
307
342
|
if (this._customElements.has(elem)) {
|
|
308
343
|
return this.addCustomElementContainer(elem);
|
|
309
344
|
}
|
|
345
|
+
(_b = this._overFlowWatcher) === null || _b === void 0 ? void 0 : _b.addNotOverFlowElement(elem);
|
|
310
346
|
return h("slot", { name: elem });
|
|
311
347
|
})), h("div", { class: this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME }, h("slot", { name: this.customSlotId }))));
|
|
312
348
|
}
|
|
@@ -602,7 +638,8 @@ export class SnkTaskbar {
|
|
|
602
638
|
"_overFlowedElements": {},
|
|
603
639
|
"_customElements": {},
|
|
604
640
|
"_customElementsId": {},
|
|
605
|
-
"_slotContainer": {}
|
|
641
|
+
"_slotContainer": {},
|
|
642
|
+
"_hiddenActionsList": {}
|
|
606
643
|
};
|
|
607
644
|
}
|
|
608
645
|
static get events() {
|
|
@@ -275,7 +275,6 @@ export class DataFetcher {
|
|
|
275
275
|
if (http.readyState == 4 && http.status == 200) {
|
|
276
276
|
try {
|
|
277
277
|
const jsonResp = JSON.parse(http.responseText);
|
|
278
|
-
await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
|
279
278
|
/**
|
|
280
279
|
* Este trecho difere do projeto HTML5 devido à decisão de adotar uma abordagem síncrona para esta chamada. Isso é justificado pelo fato de que, no cenário em questão, a abordagem assíncrona teria impactos negativos.
|
|
281
280
|
*
|
|
@@ -286,8 +285,10 @@ export class DataFetcher {
|
|
|
286
285
|
if (this.isServiceBrokerError(jsonResp)) {
|
|
287
286
|
reject(this.processServiceBrokerErrorInfo(jsonResp));
|
|
288
287
|
}
|
|
289
|
-
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED
|
|
290
|
-
|
|
288
|
+
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED) {
|
|
289
|
+
if (jsonResp.statusMessage) {
|
|
290
|
+
console.debug(`[DataFetcher] ${jsonResp.statusMessage}`);
|
|
291
|
+
}
|
|
291
292
|
}
|
|
292
293
|
else {
|
|
293
294
|
accept(jsonResp.responseBody);
|
|
@@ -295,6 +296,7 @@ export class DataFetcher {
|
|
|
295
296
|
(_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
|
|
296
297
|
}
|
|
297
298
|
}
|
|
299
|
+
this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
|
298
300
|
}
|
|
299
301
|
catch (err) {
|
|
300
302
|
console.warn(`Erro ao executar serviço: ${err}`);
|
|
@@ -6786,7 +6786,6 @@ class DataFetcher {
|
|
|
6786
6786
|
if (http.readyState == 4 && http.status == 200) {
|
|
6787
6787
|
try {
|
|
6788
6788
|
const jsonResp = JSON.parse(http.responseText);
|
|
6789
|
-
await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
|
6790
6789
|
/**
|
|
6791
6790
|
* Este trecho difere do projeto HTML5 devido à decisão de adotar uma abordagem síncrona para esta chamada. Isso é justificado pelo fato de que, no cenário em questão, a abordagem assíncrona teria impactos negativos.
|
|
6792
6791
|
*
|
|
@@ -6797,8 +6796,10 @@ class DataFetcher {
|
|
|
6797
6796
|
if (this.isServiceBrokerError(jsonResp)) {
|
|
6798
6797
|
reject(this.processServiceBrokerErrorInfo(jsonResp));
|
|
6799
6798
|
}
|
|
6800
|
-
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED
|
|
6801
|
-
|
|
6799
|
+
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED) {
|
|
6800
|
+
if (jsonResp.statusMessage) {
|
|
6801
|
+
console.debug(`[DataFetcher] ${jsonResp.statusMessage}`);
|
|
6802
|
+
}
|
|
6802
6803
|
}
|
|
6803
6804
|
else {
|
|
6804
6805
|
accept(jsonResp.responseBody);
|
|
@@ -6806,6 +6807,7 @@ class DataFetcher {
|
|
|
6806
6807
|
(_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
|
|
6807
6808
|
}
|
|
6808
6809
|
}
|
|
6810
|
+
this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
|
6809
6811
|
}
|
|
6810
6812
|
catch (err) {
|
|
6811
6813
|
console.warn(`Erro ao executar serviço: ${err}`);
|
|
@@ -59,6 +59,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
59
59
|
this._canEdit = undefined;
|
|
60
60
|
this._resourceID = undefined;
|
|
61
61
|
this.configName = undefined;
|
|
62
|
+
this.filterBarTitle = undefined;
|
|
62
63
|
this.selectionToastConfig = undefined;
|
|
63
64
|
this.showActionButtons = false;
|
|
64
65
|
this.actionsList = undefined;
|
|
@@ -320,7 +321,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
320
321
|
return;
|
|
321
322
|
}
|
|
322
323
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
|
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" }))));
|
|
324
|
+
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, filterBarTitle: this.filterBarTitle, "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" }))));
|
|
324
325
|
}
|
|
325
326
|
get _element() { return this; }
|
|
326
327
|
static get watchers() { return {
|
|
@@ -329,6 +330,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
329
330
|
static get style() { return snkCrudCss; }
|
|
330
331
|
}, [6, "snk-crud", {
|
|
331
332
|
"configName": [1025, "config-name"],
|
|
333
|
+
"filterBarTitle": [1, "filter-bar-title"],
|
|
332
334
|
"selectionToastConfig": [16],
|
|
333
335
|
"showActionButtons": [4, "show-action-buttons"],
|
|
334
336
|
"actionsList": [16],
|
|
@@ -253,7 +253,7 @@ class SnkFilterModalFactory {
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__scroller.sc-snk-filter-bar{height:calc(100% + var(--space-extra-small, 3px))}.snk-filter-bar__filter-item-container.sc-snk-filter-bar{display:flex;align-self:center}.snk-filter-bar__scroller.sc-snk-filter-bar .sc-snk-filter-bar:first-child{margin-left:var(--space-extra-small, 3px)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}";
|
|
256
|
+
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:1fr minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter-bar__title.sc-snk-filter-bar{max-width:260px;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:16px;font-family:var(--font-pattern, Arial);font-weight:var(--text-weight--large, 600);color:var(--color--title-primary, #2B3A54);margin-top:8px}[data-mode=\"hidden\"].sc-snk-filter-bar-h{display:none}[data-mode=\"button\"].sc-snk-filter-bar-h{grid-template-columns:1fr;width:fit-content}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__scroller.sc-snk-filter-bar{height:calc(100% + var(--space-extra-small, 3px))}.snk-filter-bar__filter-item-container.sc-snk-filter-bar{display:flex;align-self:center}.snk-filter-bar__scroller.sc-snk-filter-bar .sc-snk-filter-bar:first-child{margin-left:var(--space-extra-small, 3px)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}";
|
|
257
257
|
|
|
258
258
|
const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
259
259
|
constructor() {
|
|
@@ -280,8 +280,10 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
280
280
|
return this._calculateSortIndex(b) - this._calculateSortIndex(a);
|
|
281
281
|
};
|
|
282
282
|
this.dataUnit = undefined;
|
|
283
|
+
this.title = undefined;
|
|
283
284
|
this.configName = undefined;
|
|
284
285
|
this.resourceID = undefined;
|
|
286
|
+
this.mode = "regular";
|
|
285
287
|
this.filterConfig = undefined;
|
|
286
288
|
this.messagesBuilder = undefined;
|
|
287
289
|
this.disablePersonalizedFilter = undefined;
|
|
@@ -598,6 +600,9 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
598
600
|
filterChangeListener(evt) {
|
|
599
601
|
this.updateFilter(evt.detail);
|
|
600
602
|
}
|
|
603
|
+
/**
|
|
604
|
+
* Abre o modal de filtros
|
|
605
|
+
*/
|
|
601
606
|
async showFilterModal() {
|
|
602
607
|
const callbackOnApplyFilter = (filters) => {
|
|
603
608
|
this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
|
|
@@ -669,7 +674,9 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
669
674
|
if (this.showPersonalizedFilter) {
|
|
670
675
|
return h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.handleHidePersonalizedFilter(false), onEzAfterSave: () => this.handleHidePersonalizedFilter(true), entityUri: this.dataUnit.name, configName: this.configName, resourceID: this.resourceID });
|
|
671
676
|
}
|
|
672
|
-
|
|
677
|
+
if (this.mode === "button")
|
|
678
|
+
return (h(Host, { "data-mode": this.mode }, h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) })));
|
|
679
|
+
return (h(Host, { "data-mode": this.mode }, h("div", null, h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
|
|
673
680
|
}
|
|
674
681
|
get _element() { return this; }
|
|
675
682
|
static get watchers() { return {
|
|
@@ -678,8 +685,10 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
678
685
|
static get style() { return snkFilterBarCss; }
|
|
679
686
|
}, [2, "snk-filter-bar", {
|
|
680
687
|
"dataUnit": [1040],
|
|
688
|
+
"title": [1],
|
|
681
689
|
"configName": [1, "config-name"],
|
|
682
690
|
"resourceID": [1, "resource-i-d"],
|
|
691
|
+
"mode": [1],
|
|
683
692
|
"filterConfig": [1040],
|
|
684
693
|
"messagesBuilder": [1040],
|
|
685
694
|
"disablePersonalizedFilter": [4, "disable-personalized-filter"],
|
|
@@ -691,7 +700,8 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
691
700
|
"getFilterItem": [64],
|
|
692
701
|
"updateFilterItem": [64],
|
|
693
702
|
"addFilterItem": [64],
|
|
694
|
-
"removeFilterItem": [64]
|
|
703
|
+
"removeFilterItem": [64],
|
|
704
|
+
"showFilterModal": [64]
|
|
695
705
|
}, [[0, "filterChange", "filterChangeListener"]]]);
|
|
696
706
|
function defineCustomElement() {
|
|
697
707
|
if (typeof customElements === "undefined") {
|
|
@@ -34,6 +34,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
34
34
|
this._formFieldsStyle = "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding-right--small ez-padding-bottom--medium sc-snk-form-config";
|
|
35
35
|
this._fieldsAvailableStyle = "ez-col ez-col--sd-12 ez-col--tb-12 ez-margin-bottom--medium ez-margin-right--medium sc-snk-form-config";
|
|
36
36
|
this._fieldFloatingStyle = "form-config__field-config--dragged";
|
|
37
|
+
this._sortableTimer = 100;
|
|
37
38
|
this._formConfigOptions = [];
|
|
38
39
|
this._fieldConfigSelected = undefined;
|
|
39
40
|
this._layoutFormConfig = undefined;
|
|
@@ -48,20 +49,27 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
48
49
|
this.messagesBuilder = undefined;
|
|
49
50
|
}
|
|
50
51
|
observeConfigManager() {
|
|
51
|
-
this.loadConfig();
|
|
52
|
+
this.loadConfig(this._sortableTimer);
|
|
52
53
|
}
|
|
53
|
-
loadFields() {
|
|
54
|
+
loadFields(updateTimer = 0) {
|
|
54
55
|
this._layoutFormConfig = [];
|
|
55
|
-
|
|
56
|
+
if (updateTimer > 0) {
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
this.buildFields();
|
|
59
|
+
}, updateTimer);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this.buildFields();
|
|
63
|
+
}
|
|
56
64
|
}
|
|
57
65
|
buildFields() {
|
|
58
66
|
this.buildFormConfig();
|
|
59
67
|
this.buildAvailableFields();
|
|
60
68
|
}
|
|
61
|
-
loadFormConfig() {
|
|
69
|
+
loadFormConfig(updateTimer) {
|
|
62
70
|
var _a;
|
|
63
71
|
this._formConfig = this.getConfig();
|
|
64
|
-
this.loadFields();
|
|
72
|
+
this.loadFields(updateTimer);
|
|
65
73
|
this.controlFieldConfig();
|
|
66
74
|
if (((_a = this._filterFieldsAvailable) === null || _a === void 0 ? void 0 : _a.value) != undefined) {
|
|
67
75
|
this._filterFieldsAvailable.value = "";
|
|
@@ -104,12 +112,12 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
104
112
|
}
|
|
105
113
|
}
|
|
106
114
|
resetChangeConfig() {
|
|
107
|
-
this.loadFormConfig();
|
|
115
|
+
this.loadFormConfig(this._sortableTimer);
|
|
108
116
|
this.clearTempGroups();
|
|
109
117
|
}
|
|
110
118
|
resetChangeOptionConfig() {
|
|
111
119
|
this._formConfigChanged = false;
|
|
112
|
-
this.loadConfig();
|
|
120
|
+
this.loadConfig(this._sortableTimer);
|
|
113
121
|
this.clearTempGroups();
|
|
114
122
|
}
|
|
115
123
|
getTabsToSave() {
|
|
@@ -324,7 +332,9 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
324
332
|
&& oldContainer.id === newContainer.id) {
|
|
325
333
|
evt.cancel();
|
|
326
334
|
this._fieldsAvailable = [];
|
|
327
|
-
|
|
335
|
+
setTimeout(() => {
|
|
336
|
+
this.buildAvailableFields();
|
|
337
|
+
}, this._sortableTimer);
|
|
328
338
|
return true;
|
|
329
339
|
}
|
|
330
340
|
return false;
|
|
@@ -367,7 +377,11 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
367
377
|
if (isNewGroup) {
|
|
368
378
|
this.clearTempGroups(true);
|
|
369
379
|
}
|
|
370
|
-
|
|
380
|
+
const sortableTimer = oldContainer.dataset.groupName !== newContainer.dataset.groupName
|
|
381
|
+
|| (newContainer.id === CONTAINER_ID.withoutGroup && oldContainer.id === CONTAINER_ID.fieldsAvailable)
|
|
382
|
+
? this._sortableTimer
|
|
383
|
+
: 0;
|
|
384
|
+
this.updateFieldsToSave(sortableTimer);
|
|
371
385
|
}, this._renderTimer);
|
|
372
386
|
return true;
|
|
373
387
|
}
|
|
@@ -397,12 +411,12 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
397
411
|
return;
|
|
398
412
|
}
|
|
399
413
|
}
|
|
400
|
-
updateFieldsToSave() {
|
|
414
|
+
updateFieldsToSave(updateTimer = 0) {
|
|
401
415
|
const fields = this.getFieldsToSave();
|
|
402
416
|
if ((fields === null || fields === void 0 ? void 0 : fields.length) > 0) {
|
|
403
417
|
this._formConfig.fields = fields;
|
|
404
418
|
}
|
|
405
|
-
this.loadFields();
|
|
419
|
+
this.loadFields(updateTimer);
|
|
406
420
|
this._formConfigChanged = true;
|
|
407
421
|
}
|
|
408
422
|
controlSortableField() {
|
|
@@ -432,7 +446,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
432
446
|
controlStopDraggingGroup(evt) {
|
|
433
447
|
if (evt.data.newIndex !== evt.data.oldIndex) {
|
|
434
448
|
setTimeout(() => {
|
|
435
|
-
this.updateFieldsToSave();
|
|
449
|
+
this.updateFieldsToSave(this._sortableTimer);
|
|
436
450
|
}, this._renderTimer);
|
|
437
451
|
}
|
|
438
452
|
}
|
|
@@ -505,7 +519,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
505
519
|
});
|
|
506
520
|
if (tabs.length > 0) {
|
|
507
521
|
this._formConfig.tabs = tabs;
|
|
508
|
-
this.loadFields();
|
|
522
|
+
this.loadFields(this._sortableTimer);
|
|
509
523
|
this.controlFieldConfig();
|
|
510
524
|
this._formConfigChanged = true;
|
|
511
525
|
}
|
|
@@ -529,13 +543,13 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
529
543
|
if (config != undefined) {
|
|
530
544
|
this._formConfig = config;
|
|
531
545
|
this._tabSelected = 1;
|
|
532
|
-
this.loadFields();
|
|
546
|
+
this.loadFields(this._sortableTimer);
|
|
533
547
|
this.controlFieldConfig();
|
|
534
548
|
this.clearTempGroups();
|
|
535
549
|
}
|
|
536
550
|
}
|
|
537
|
-
loadConfig() {
|
|
538
|
-
this.loadFormConfig();
|
|
551
|
+
loadConfig(updateTimer = 0) {
|
|
552
|
+
this.loadFormConfig(updateTimer);
|
|
539
553
|
this.loadUserConfig();
|
|
540
554
|
}
|
|
541
555
|
addNewGroup() {
|
|
@@ -576,7 +590,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
576
590
|
});
|
|
577
591
|
}
|
|
578
592
|
else {
|
|
579
|
-
this.updateFieldsToSave();
|
|
593
|
+
this.updateFieldsToSave(this._sortableTimer);
|
|
580
594
|
}
|
|
581
595
|
}
|
|
582
596
|
checkGroupExists(newLabel, indexGroup, isTempGroup = false) {
|
|
@@ -622,7 +636,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
622
636
|
field.group = newLabel;
|
|
623
637
|
}
|
|
624
638
|
});
|
|
625
|
-
this.loadFields();
|
|
639
|
+
this.loadFields(this._sortableTimer);
|
|
626
640
|
this.controlFieldConfig();
|
|
627
641
|
this._formConfigChanged = true;
|
|
628
642
|
}
|
|
@@ -836,14 +850,14 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
836
850
|
this._formConfigChanged = true;
|
|
837
851
|
this.resetSortables();
|
|
838
852
|
}
|
|
839
|
-
controlRemoveFieldConfig(fieldConfig) {
|
|
853
|
+
controlRemoveFieldConfig(fieldConfig, updateTimer) {
|
|
840
854
|
var _a;
|
|
841
855
|
this._formConfigChanged = false;
|
|
842
856
|
if (fieldConfig == undefined) {
|
|
843
857
|
return;
|
|
844
858
|
}
|
|
845
859
|
this._formConfig.fields = (_a = this._formConfig.fields) === null || _a === void 0 ? void 0 : _a.filter((field) => field.name !== fieldConfig.name);
|
|
846
|
-
this.loadFields();
|
|
860
|
+
this.loadFields(updateTimer);
|
|
847
861
|
this.controlFieldConfig();
|
|
848
862
|
this._formConfigChanged = true;
|
|
849
863
|
this.resetSortables();
|
|
@@ -852,14 +866,14 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
852
866
|
this.controlSortableField();
|
|
853
867
|
this.controlSortableGroup();
|
|
854
868
|
}
|
|
855
|
-
handleFieldConfigChange(evt) {
|
|
869
|
+
handleFieldConfigChange(evt, updateTimer = 0) {
|
|
856
870
|
const { field: fieldConfig, type: actionType } = evt.detail;
|
|
857
871
|
if (actionType === ACTION_CONFIG.configuration) {
|
|
858
872
|
this.controlFieldConfig(fieldConfig);
|
|
859
873
|
return;
|
|
860
874
|
}
|
|
861
875
|
if (actionType === ACTION_CONFIG.remove) {
|
|
862
|
-
this.controlRemoveFieldConfig(fieldConfig);
|
|
876
|
+
this.controlRemoveFieldConfig(fieldConfig, updateTimer);
|
|
863
877
|
return;
|
|
864
878
|
}
|
|
865
879
|
if (actionType === ACTION_CONFIG.add) {
|
|
@@ -880,7 +894,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
880
894
|
tab.label = newLabel;
|
|
881
895
|
}
|
|
882
896
|
});
|
|
883
|
-
this.loadFields();
|
|
897
|
+
this.loadFields(this._sortableTimer);
|
|
884
898
|
this.controlFieldConfig();
|
|
885
899
|
this._formConfigChanged = true;
|
|
886
900
|
}
|
|
@@ -900,7 +914,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
900
914
|
this._formConfig.tabs = (_a = this._formConfig.tabs) === null || _a === void 0 ? void 0 : _a.filter((tab) => {
|
|
901
915
|
return tab.label !== tabSelected.detail.label;
|
|
902
916
|
});
|
|
903
|
-
this.loadFields();
|
|
917
|
+
this.loadFields(this._sortableTimer);
|
|
904
918
|
this.controlFieldConfig();
|
|
905
919
|
this._formConfigChanged = true;
|
|
906
920
|
}
|
|
@@ -913,7 +927,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
913
927
|
tab.visible = !tab.visible;
|
|
914
928
|
}
|
|
915
929
|
});
|
|
916
|
-
this.loadFields();
|
|
930
|
+
this.loadFields(this._sortableTimer);
|
|
917
931
|
this.controlFieldConfig();
|
|
918
932
|
this._formConfigChanged = true;
|
|
919
933
|
}
|
|
@@ -59,6 +59,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
59
59
|
this._showSnkFilterBar = true;
|
|
60
60
|
this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
|
|
61
61
|
this.configName = undefined;
|
|
62
|
+
this.filterBarTitle = undefined;
|
|
62
63
|
this.resourceID = undefined;
|
|
63
64
|
this.selectionToastConfig = undefined;
|
|
64
65
|
this.actionsList = undefined;
|
|
@@ -422,13 +423,14 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
422
423
|
return undefined;
|
|
423
424
|
}
|
|
424
425
|
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 &&
|
|
425
|
-
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 }))));
|
|
426
|
+
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, 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 }))));
|
|
426
427
|
}
|
|
427
428
|
get _element() { return this; }
|
|
428
429
|
static get style() { return snkGridCss; }
|
|
429
430
|
}, [6, "snk-grid", {
|
|
430
431
|
"columnFilterDataSource": [1040],
|
|
431
432
|
"configName": [1, "config-name"],
|
|
433
|
+
"filterBarTitle": [1, "filter-bar-title"],
|
|
432
434
|
"resourceID": [1, "resource-i-d"],
|
|
433
435
|
"selectionToastConfig": [16],
|
|
434
436
|
"actionsList": [16],
|
|
@@ -310,9 +310,9 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
310
310
|
}
|
|
311
311
|
render() {
|
|
312
312
|
var _a;
|
|
313
|
-
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium
|
|
313
|
+
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
314
314
|
? undefined
|
|
315
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig, fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }))))));
|
|
315
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { class: "ez-margin-top--large", dataUnit: this.dataUnit, config: this.formConfig, fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }))))));
|
|
316
316
|
}
|
|
317
317
|
get _element() { return this; }
|
|
318
318
|
static get watchers() { return {
|