@sankhyalabs/sankhyablocks 8.15.0-rc.1 → 8.15.0-rc.10
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-34be11ce.js} +70 -7
- package/dist/cjs/{DataFetcher-ba94ed5b.js → DataFetcher-99f0f6ed.js} +5 -3
- package/dist/cjs/{SnkFormConfigManager-71c4768e.js → SnkFormConfigManager-6211fb28.js} +7 -2
- package/dist/cjs/{SnkMessageBuilder-e7dcf408.js → SnkMessageBuilder-141aa18d.js} +2 -1
- package/dist/cjs/SnkMultiSelectionListDataSource-5213120b.js +140 -0
- 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/index-f9e81701.js +2 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-e4a7c4c3.js → pesquisa-fetcher-94f6b316.js} +235 -24
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/{snk-actions-button_2.cjs.entry.js → snk-actions-button_4.cjs.entry.js} +520 -5
- package/dist/cjs/snk-application.cjs.entry.js +34 -8
- package/dist/cjs/snk-attach.cjs.entry.js +7 -8
- package/dist/cjs/snk-crud.cjs.entry.js +16 -10
- package/dist/cjs/snk-data-exporter.cjs.entry.js +8 -4
- package/dist/cjs/{snk-data-unit-82c08a8c.js → snk-data-unit-6026a9f7.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +9 -10
- package/dist/cjs/snk-entity-list.cjs.entry.js +5 -3
- package/dist/cjs/snk-filter-bar.cjs.entry.js +36 -7
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +47 -27
- package/dist/cjs/snk-form.cjs.entry.js +11 -4
- package/dist/cjs/snk-grid.cjs.entry.js +40 -22
- package/dist/cjs/{snk-guides-viewer-d32c096f.js → snk-guides-viewer-508bb6fe.js} +15 -9
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -8
- package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +3 -1
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +214 -23
- package/dist/cjs/snk-taskbar.cjs.entry.js +100 -14
- package/dist/cjs/{taskbar-elements-01b85b99.js → taskbar-elements-3ecd1278.js} +9 -9
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/snk-application/__mocks__/snk-application.js +7 -0
- package/dist/collection/components/snk-application/snk-application.js +51 -11
- package/dist/collection/components/snk-crud/snk-crud.js +95 -3
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +11 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +27 -3
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +5 -1
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +5 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +3 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +23 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +116 -4
- package/dist/collection/components/snk-form/snk-form.js +25 -1
- package/dist/collection/components/{snk-form → snk-form-config}/SnkFormConfigManager.js +6 -1
- package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.js +50 -30
- package/dist/collection/components/snk-grid/snk-grid.js +103 -16
- package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.js +130 -123
- package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.js +1 -1
- package/dist/collection/components/snk-simple-crud/regular-buttons.js +3 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +5 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +325 -17
- 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 +9 -9
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +17 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +139 -13
- package/dist/collection/lib/configs/ConfigStorage.js +63 -3
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +5 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +21 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +6 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +4 -11
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -1
- package/dist/collection/lib/utils/CrudUtils.js +13 -1
- package/dist/components/ConfigStorage.js +68 -5
- package/dist/components/DataFetcher.js +5 -3
- package/dist/components/SnkFormConfigManager.js +5 -0
- package/dist/components/SnkMessageBuilder.js +2 -1
- package/dist/components/dataunit-fetcher.js +4 -11
- package/dist/components/field-search.js +93 -3
- package/dist/components/index.d.ts +6 -6
- package/dist/components/snk-application2.js +30 -1
- package/dist/components/snk-attach2.js +54 -12
- package/dist/components/snk-crud.js +15 -3
- package/dist/components/snk-data-exporter2.js +5 -1
- package/dist/components/snk-detail-view2.js +40 -7
- package/dist/components/snk-entity-list.js +5 -3
- package/dist/components/snk-filter-bar2.js +38 -5
- package/dist/components/snk-form-config2.js +46 -26
- package/dist/components/snk-form.js +8 -0
- package/dist/components/snk-grid-config2.js +128 -102
- package/dist/components/snk-grid2.js +41 -17
- package/dist/components/snk-personalized-filter-editor.js +3 -1
- package/dist/components/snk-simple-crud2.js +270 -28
- package/dist/components/snk-taskbar2.js +114 -24
- package/dist/components/taskbar-actions-button2.js +1 -1
- package/dist/esm/{ConfigStorage-4151acc8.js → ConfigStorage-101a2b4c.js} +70 -7
- package/dist/esm/{DataFetcher-aa159c5a.js → DataFetcher-a650ae58.js} +5 -3
- package/dist/esm/{SnkFormConfigManager-5c7d3771.js → SnkFormConfigManager-d86ba46f.js} +7 -2
- package/dist/esm/{SnkMessageBuilder-0fb796b9.js → SnkMessageBuilder-9747ddd2.js} +2 -1
- package/dist/esm/SnkMultiSelectionListDataSource-7e7eada5.js +133 -0
- 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/index-a7d3d3f1.js +2 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-fa0c2540.js → pesquisa-fetcher-f05a12ca.js} +226 -16
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +519 -6
- package/dist/esm/snk-application.entry.js +34 -8
- package/dist/esm/snk-attach.entry.js +6 -7
- package/dist/esm/snk-crud.entry.js +16 -10
- package/dist/esm/snk-data-exporter.entry.js +8 -4
- package/dist/esm/{snk-data-unit-5d201fb3.js → snk-data-unit-4c343635.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +9 -10
- package/dist/esm/snk-entity-list.entry.js +5 -3
- package/dist/esm/snk-filter-bar.entry.js +36 -7
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +48 -28
- package/dist/esm/snk-form.entry.js +11 -4
- package/dist/esm/snk-grid.entry.js +41 -23
- package/dist/esm/{snk-guides-viewer-f49613c6.js → snk-guides-viewer-18859840.js} +15 -9
- package/dist/esm/snk-guides-viewer.entry.js +7 -8
- package/dist/esm/snk-personalized-filter-editor.entry.js +3 -1
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +215 -24
- package/dist/esm/snk-taskbar.entry.js +101 -15
- package/dist/esm/{taskbar-elements-d4d0b424.js → taskbar-elements-2473c8ac.js} +9 -9
- package/dist/sankhyablocks/p-1f3174cb.entry.js +1 -0
- package/dist/sankhyablocks/p-1fa5a18c.entry.js +11 -0
- package/dist/sankhyablocks/p-20b46647.entry.js +1 -0
- package/dist/sankhyablocks/p-2897fb8c.js +1 -0
- package/dist/sankhyablocks/{p-05243555.js → p-2936303b.js} +1 -1
- package/dist/sankhyablocks/p-2b909f08.entry.js +1 -0
- package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
- package/dist/sankhyablocks/p-50783a8b.js +1 -0
- package/dist/sankhyablocks/p-5c0b53ce.js +56 -0
- package/dist/sankhyablocks/p-5dbc1a3f.js +1 -0
- package/dist/sankhyablocks/p-60fa6c7a.js +1 -0
- package/dist/sankhyablocks/p-64c1b368.entry.js +1 -0
- package/dist/sankhyablocks/{p-7f3c7b09.entry.js → p-6b28cc74.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e0fd9555.entry.js → p-7ddd95b6.entry.js} +1 -1
- package/dist/sankhyablocks/p-7e05bd83.entry.js +1 -0
- package/dist/sankhyablocks/p-7f97fee2.entry.js +1 -0
- package/dist/sankhyablocks/{p-f3d1c48e.js → p-9a5d1b39.js} +1 -1
- package/dist/sankhyablocks/{p-0d7863ed.js → p-a13ccb86.js} +1 -1
- package/dist/sankhyablocks/p-ae4fc9a9.js +1 -0
- package/dist/sankhyablocks/p-b11aa1e0.entry.js +1 -0
- package/dist/sankhyablocks/p-b41a622a.entry.js +1 -0
- package/dist/sankhyablocks/p-b4de81ac.entry.js +1 -0
- package/dist/sankhyablocks/p-ba4871b5.entry.js +1 -0
- package/dist/sankhyablocks/{p-9695f78b.js → p-be75153c.js} +1 -1
- package/dist/sankhyablocks/p-d01ceda6.entry.js +1 -0
- package/dist/sankhyablocks/p-d304659d.entry.js +1 -0
- package/dist/sankhyablocks/p-d78d4062.js +65 -0
- package/dist/sankhyablocks/p-e4fb3308.entry.js +1 -0
- package/dist/sankhyablocks/p-e7dbe53a.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/subcomponents/snk-actions-form.d.ts +1 -1
- package/dist/types/components/snk-application/__mocks__/snk-application.d.ts +3 -0
- package/dist/types/components/snk-application/snk-application.d.ts +8 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +21 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +1 -1
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +6 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +19 -1
- package/dist/types/components/snk-form/snk-form.d.ts +6 -1
- package/dist/types/components/{snk-form → snk-form-config}/SnkFormConfigManager.d.ts +1 -0
- package/dist/types/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.d.ts +5 -3
- package/dist/types/components/snk-grid/snk-grid.d.ts +20 -1
- package/dist/types/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.d.ts +11 -6
- package/dist/types/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.d.ts +1 -1
- package/dist/types/components/snk-simple-crud/regular-buttons.d.ts +3 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +61 -3
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +28 -1
- package/dist/types/components.d.ts +193 -12
- package/dist/types/lib/configs/ConfigStorage.d.ts +21 -1
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +2 -1
- package/dist/types/lib/utils/CrudUtils.d.ts +3 -0
- package/package.json +9 -2
- package/dist/cjs/PreloadManager-84466da6.js +0 -224
- package/dist/cjs/SnkMultiSelectionListDataSource-ba5838c2.js +0 -49
- package/dist/cjs/snk-grid-config.cjs.entry.js +0 -483
- package/dist/cjs/snk-select-box.cjs.entry.js +0 -25
- package/dist/esm/PreloadManager-c1c2f2b4.js +0 -222
- package/dist/esm/SnkMultiSelectionListDataSource-44494b0e.js +0 -43
- package/dist/esm/snk-grid-config.entry.js +0 -479
- package/dist/esm/snk-select-box.entry.js +0 -21
- package/dist/sankhyablocks/p-02e3a45b.entry.js +0 -1
- package/dist/sankhyablocks/p-094c30cb.js +0 -1
- package/dist/sankhyablocks/p-0ec5b2e5.js +0 -1
- package/dist/sankhyablocks/p-1d75d9f9.entry.js +0 -1
- package/dist/sankhyablocks/p-2582537c.entry.js +0 -1
- package/dist/sankhyablocks/p-282789a6.entry.js +0 -1
- package/dist/sankhyablocks/p-374d03f6.js +0 -1
- package/dist/sankhyablocks/p-3b0e4e08.js +0 -65
- package/dist/sankhyablocks/p-40915359.entry.js +0 -1
- package/dist/sankhyablocks/p-573a07c5.js +0 -1
- package/dist/sankhyablocks/p-62896624.entry.js +0 -1
- package/dist/sankhyablocks/p-69efa80d.entry.js +0 -1
- package/dist/sankhyablocks/p-761ed32f.entry.js +0 -1
- package/dist/sankhyablocks/p-98674137.entry.js +0 -1
- package/dist/sankhyablocks/p-9b5944a4.entry.js +0 -1
- package/dist/sankhyablocks/p-9bdbc7d8.entry.js +0 -1
- package/dist/sankhyablocks/p-aa95fb2c.js +0 -56
- package/dist/sankhyablocks/p-ac384baf.entry.js +0 -1
- package/dist/sankhyablocks/p-b05ab13d.entry.js +0 -1
- package/dist/sankhyablocks/p-c22c1d8e.js +0 -1
- package/dist/sankhyablocks/p-c4874327.entry.js +0 -1
- package/dist/sankhyablocks/p-c758265f.entry.js +0 -1
- package/dist/sankhyablocks/p-cb7419e0.entry.js +0 -1
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
- package/dist/sankhyablocks/p-e6380c60.js +0 -1
- package/dist/sankhyablocks/p-e817f254.entry.js +0 -11
- /package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.js +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.js +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.js +0 -0
- /package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.css +0 -0
- /package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.css +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.d.ts +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.d.ts +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.d.ts +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import { h, proxyCustomElement, HTMLElement, createEvent, Host } from '@stencil/core/internal/client';
|
2
|
-
import { StringUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
2
|
+
import { StringUtils, ApplicationContext, OVERFLOWED_CLASS_NAME, OverflowWatcher, OverflowDirection, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { A as AuthorizationConfig } from './AuthorizationConfig.js';
|
4
4
|
import { P as PresentationMode } from './index2.js';
|
5
5
|
import { s as store } from './index3.js';
|
@@ -93,35 +93,35 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
|
|
93
93
|
case TaskbarElement.CONFIGURATOR:
|
94
94
|
return iconButton("settings-inverted", element, className, dataElementId, title, action, isEnabled);
|
95
95
|
case TaskbarElement.MORE_OPTIONS:
|
96
|
-
return actionButton(element, dataElementId, title, isEnabled, actions, action);
|
96
|
+
return actionButton(element, className, dataElementId, title, isEnabled, actions, action);
|
97
97
|
case TaskbarElement.DIVIDER:
|
98
|
-
return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-
|
98
|
+
return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
|
99
99
|
case TaskbarElement.DATA_EXPORTER:
|
100
100
|
const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
|
101
|
-
return h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId });
|
101
|
+
return h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element });
|
102
102
|
case TaskbarElement.ATTACH:
|
103
103
|
return iconButton("anexo", element, className, dataElementId, title, action, isEnabled);
|
104
104
|
case TaskbarElement.ACTIONS_BUTTON:
|
105
|
-
return h("snk-actions-button", { "data-element-id": dataElementId });
|
105
|
+
return h("snk-actions-button", { "data-element-id": dataElementId, "data-taskbar-element": element });
|
106
106
|
}
|
107
107
|
};
|
108
108
|
function textButton(name, className, dataElementId, text, title, action, isEnabled) {
|
109
|
-
return h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
|
109
|
+
return h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-taskbar-label": text, "data-taskbar-element": name, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
|
110
110
|
}
|
111
111
|
function iconButton(iconName, name, className, dataElementId, title, action, isEnabled) {
|
112
|
-
return h("ez-button", { key: dataElementId, title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
112
|
+
return h("ez-button", { key: dataElementId, title: title, mode: "icon", size: "small", class: className, "data-taskbar-label": title, "data-taskbar-element": name, "data-taskbar-icon": iconName, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
113
113
|
}
|
114
114
|
function iconTextButton(iconName, name, className, dataElementId, text, title, action, isEnabled) {
|
115
|
-
return h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
|
115
|
+
return h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-taskbar-label": text, "data-taskbar-icon": iconName, "data-taskbar-element": name, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
|
116
116
|
h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
117
117
|
}
|
118
|
-
function actionButton(element, dataElementId, title, isEnabled, actions, action) {
|
118
|
+
function actionButton(element, className, dataElementId, title, isEnabled, actions, action) {
|
119
119
|
return actions && actions.length > 0
|
120
|
-
? h("taskbar-actions-button", { key: dataElementId, title: title, "data-element-id": dataElementId, enabled: isEnabled(element), actions: actions, onTaskbarActionSelected: (evt) => action(evt.detail.value) })
|
120
|
+
? h("taskbar-actions-button", { class: className, key: dataElementId, title: title, "data-taskbar-element": element, "data-element-id": dataElementId, enabled: isEnabled(element), actions: actions, onTaskbarActionSelected: (evt) => action(evt.detail.value) })
|
121
121
|
: undefined;
|
122
122
|
}
|
123
123
|
|
124
|
-
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
|
124
|
+
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex;flex-wrap:wrap}.no-wrap.sc-snk-taskbar-h{flex-wrap:nowrap}.full-width.sc-snk-taskbar-h{width:100%}.align-right.sc-snk-taskbar-h{justify-content:flex-end}.overflowed.sc-snk-taskbar{display:none}";
|
125
125
|
|
126
126
|
const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
127
127
|
constructor() {
|
@@ -129,6 +129,9 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
129
129
|
this.__registerHost();
|
130
130
|
this.actionClick = createEvent(this, "actionClick", 7);
|
131
131
|
this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
|
132
|
+
this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME = 'taskbar-custom-elements-container';
|
133
|
+
this.ACTIONS_BUTTON_TAG = 'TASKBAR-ACTIONS-BUTTON';
|
134
|
+
this.NOT_OVERFLOW_ELEMENTS = ["moreOptions", "dataExporter_snkDataExporter", "actionsButton_snkActionsButton"];
|
132
135
|
this._titleKeyByElement = {
|
133
136
|
[TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
|
134
137
|
[TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
|
@@ -146,11 +149,15 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
146
149
|
[TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
|
147
150
|
};
|
148
151
|
this._permissions = undefined;
|
152
|
+
this._overFlowedElements = [];
|
149
153
|
this._customElements = undefined;
|
150
154
|
this._customElementsId = undefined;
|
151
155
|
this._slotContainer = undefined;
|
156
|
+
this._hiddenActionsList = [];
|
157
|
+
this.alignRigth = false;
|
152
158
|
this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
|
153
159
|
this.customContainerId = undefined;
|
160
|
+
this.overflowStrategy = 'hiddenItems';
|
154
161
|
this.configName = undefined;
|
155
162
|
this.resourceID = undefined;
|
156
163
|
this.buttons = undefined;
|
@@ -164,6 +171,13 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
164
171
|
}
|
165
172
|
observeButtons() {
|
166
173
|
this._definitions = undefined;
|
174
|
+
requestAnimationFrame(() => {
|
175
|
+
requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
|
176
|
+
});
|
177
|
+
}
|
178
|
+
observeDisabledButtons() {
|
179
|
+
var _a;
|
180
|
+
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate();
|
167
181
|
}
|
168
182
|
// Internal methods
|
169
183
|
elementsFromString(strButtons) {
|
@@ -259,12 +273,19 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
259
273
|
}
|
260
274
|
const taskbarElement = TaskbarElement[def.toString()];
|
261
275
|
if (taskbarElement) {
|
262
|
-
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.
|
276
|
+
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);
|
263
277
|
}
|
264
278
|
else {
|
265
279
|
return buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
266
280
|
}
|
267
281
|
}
|
282
|
+
buildDynamicActionsList() {
|
283
|
+
var _a;
|
284
|
+
if (this._hiddenActionsList.length) {
|
285
|
+
return [...((_a = this.actionsList) !== null && _a !== void 0 ? _a : []), { type: 'divider', label: "", value: "" }, ...this._hiddenActionsList];
|
286
|
+
}
|
287
|
+
return this.actionsList;
|
288
|
+
}
|
268
289
|
getIdElemBtnNative(taskbarElem) {
|
269
290
|
return StringUtils.toCamelCase(taskbarElem);
|
270
291
|
}
|
@@ -305,11 +326,13 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
305
326
|
});
|
306
327
|
}
|
307
328
|
addCustomElementContainer(elem) {
|
329
|
+
var _a;
|
308
330
|
const elementId = `${this.TASKBAR_ITEM_ID_PREFIX}${elem}`;
|
309
331
|
if (!this._customElementsId.includes(elementId)) {
|
310
332
|
this._customElementsId.push(elementId);
|
333
|
+
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.addNotOverFlowElement(elementId);
|
311
334
|
}
|
312
|
-
return h("span", { key: elementId, id: elementId });
|
335
|
+
return h("span", { class: "ez-padding-left--medium", key: elementId, id: elementId });
|
313
336
|
}
|
314
337
|
getCustomElements() {
|
315
338
|
var _a, _b;
|
@@ -344,15 +367,76 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
344
367
|
}
|
345
368
|
this.validatePresentationMode();
|
346
369
|
}
|
370
|
+
handleOverFlow(overFlowingElements) {
|
371
|
+
const elementsToHandle = overFlowingElements.filter(element => !this.hasToIgnoreOverFlow(element));
|
372
|
+
this.resetOverFlowedElements();
|
373
|
+
this.doOverFlowElements(elementsToHandle);
|
374
|
+
}
|
375
|
+
resetOverFlowedElements() {
|
376
|
+
this._overFlowedElements.forEach(element => {
|
377
|
+
element.classList.remove(OVERFLOWED_CLASS_NAME);
|
378
|
+
});
|
379
|
+
this._hiddenActionsList = [];
|
380
|
+
this._overFlowedElements = [];
|
381
|
+
}
|
382
|
+
doOverFlowElements(overFlowedElements) {
|
383
|
+
overFlowedElements.forEach(element => {
|
384
|
+
element.classList.add(OVERFLOWED_CLASS_NAME);
|
385
|
+
this._overFlowedElements.push(element);
|
386
|
+
this.addItemToActionList(element);
|
387
|
+
});
|
388
|
+
}
|
389
|
+
addItemToActionList(element) {
|
390
|
+
const taskbarElement = this.getTaskbarElementName(element);
|
391
|
+
if (taskbarElement && this.isEnabled(taskbarElement) && this.isAllowed(taskbarElement)) {
|
392
|
+
const optionItem = {
|
393
|
+
value: taskbarElement,
|
394
|
+
label: this.getTaskbarElementLabel(element),
|
395
|
+
iconName: this.getTaskbarElementIcon(element)
|
396
|
+
};
|
397
|
+
this._hiddenActionsList.push(optionItem);
|
398
|
+
}
|
399
|
+
}
|
400
|
+
getTaskbarElementName(element) {
|
401
|
+
var _a;
|
402
|
+
return (_a = element.getAttribute('data-taskbar-element')) !== null && _a !== void 0 ? _a : "";
|
403
|
+
}
|
404
|
+
getTaskbarElementIcon(element) {
|
405
|
+
var _a;
|
406
|
+
return (_a = element.getAttribute('data-taskbar-icon')) !== null && _a !== void 0 ? _a : "";
|
407
|
+
}
|
408
|
+
getTaskbarElementLabel(element) {
|
409
|
+
var _a;
|
410
|
+
return (_a = element.getAttribute('data-taskbar-label')) !== null && _a !== void 0 ? _a : "";
|
411
|
+
}
|
412
|
+
hasToIgnoreOverFlow(element) {
|
413
|
+
return element.classList.contains(this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME);
|
414
|
+
}
|
415
|
+
handleOverFlowStrategy() {
|
416
|
+
if (this.overflowStrategy === 'hiddenItems') {
|
417
|
+
this._overFlowWatcher = new OverflowWatcher(this.buildOverFlowWatcherParams());
|
418
|
+
}
|
419
|
+
}
|
420
|
+
buildOverFlowWatcherParams() {
|
421
|
+
return {
|
422
|
+
element: this._element,
|
423
|
+
callback: this.handleOverFlow.bind(this),
|
424
|
+
overFlowDirection: OverflowDirection.HORIZONTAL,
|
425
|
+
notOverFlow: this.NOT_OVERFLOW_ELEMENTS
|
426
|
+
};
|
427
|
+
}
|
347
428
|
componentDidLoad() {
|
348
429
|
const dataInfo = { dataUnit: this.dataUnit };
|
349
430
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
431
|
+
this.handleOverFlowStrategy();
|
350
432
|
}
|
351
433
|
componentDidRender() {
|
352
434
|
this.appendCustomElementsInTaskbar();
|
353
435
|
}
|
354
436
|
disconnectedCallback() {
|
437
|
+
var _a;
|
355
438
|
this.unlinkAllCustomElements();
|
439
|
+
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
|
356
440
|
}
|
357
441
|
unlinkAllCustomElements() {
|
358
442
|
var _a;
|
@@ -370,14 +454,9 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
370
454
|
return undefined;
|
371
455
|
}
|
372
456
|
let index = 0;
|
373
|
-
return (h(Host,
|
374
|
-
var _a;
|
375
|
-
|
376
|
-
index = 0;
|
377
|
-
}
|
378
|
-
else {
|
379
|
-
index++;
|
380
|
-
}
|
457
|
+
return (h(Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
|
458
|
+
var _a, _b;
|
459
|
+
index++;
|
381
460
|
if (TaskbarElement[elem]) {
|
382
461
|
return this.getElement(index, TaskbarElement[elem]);
|
383
462
|
}
|
@@ -387,17 +466,26 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
387
466
|
if (this._customElements.has(elem)) {
|
388
467
|
return this.addCustomElementContainer(elem);
|
389
468
|
}
|
469
|
+
(_b = this._overFlowWatcher) === null || _b === void 0 ? void 0 : _b.addNotOverFlowElement(elem);
|
390
470
|
return h("slot", { name: elem });
|
391
|
-
})), h("div", { class:
|
471
|
+
})), h("div", { class: this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME }, h("slot", { name: this.customSlotId }))));
|
472
|
+
}
|
473
|
+
getHostClasses() {
|
474
|
+
if (this.overflowStrategy !== 'hiddenItems')
|
475
|
+
return 'no-wrap';
|
476
|
+
return `full-width ${this.alignRigth ? 'align-right' : ""}`;
|
392
477
|
}
|
393
478
|
get _element() { return this; }
|
394
479
|
static get watchers() { return {
|
395
|
-
"buttons": ["observeButtons"]
|
480
|
+
"buttons": ["observeButtons"],
|
481
|
+
"disabledButtons": ["observeDisabledButtons"]
|
396
482
|
}; }
|
397
483
|
static get style() { return snkTaskbarCss; }
|
398
484
|
}, [6, "snk-taskbar", {
|
485
|
+
"alignRigth": [4, "align-rigth"],
|
399
486
|
"customSlotId": [1, "custom-slot-id"],
|
400
487
|
"customContainerId": [1, "custom-container-id"],
|
488
|
+
"overflowStrategy": [1, "overflow-strategy"],
|
401
489
|
"configName": [1, "config-name"],
|
402
490
|
"resourceID": [1, "resource-i-d"],
|
403
491
|
"buttons": [1],
|
@@ -409,9 +497,11 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
409
497
|
"presentationMode": [1537, "presentation-mode"],
|
410
498
|
"messagesBuilder": [1040],
|
411
499
|
"_permissions": [32],
|
500
|
+
"_overFlowedElements": [32],
|
412
501
|
"_customElements": [32],
|
413
502
|
"_customElementsId": [32],
|
414
|
-
"_slotContainer": [32]
|
503
|
+
"_slotContainer": [32],
|
504
|
+
"_hiddenActionsList": [32]
|
415
505
|
}]);
|
416
506
|
function defineCustomElement() {
|
417
507
|
if (typeof customElements === "undefined") {
|
@@ -126,7 +126,7 @@ const TaskbarActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
126
126
|
this.taskbarActionsButtonDisconnected.emit();
|
127
127
|
}
|
128
128
|
render() {
|
129
|
-
return (h(Host, null, h("div", { class:
|
129
|
+
return (h(Host, null, h("div", { class: `${this.canShowDropdown() ? ' ez-elevation--16' : ''}` }, h("ez-button", { title: this.title, mode: 'icon', iconName: 'dots-vertical', size: 'small', enabled: this.enabled, onClick: () => this.controlDropdown() }), this.canShowDropdown() && h("ez-dropdown", { items: this.loadItems(), onEzClick: (evt) => this.onSelectAction(evt.detail), onEzOutsideClick: () => this._showDropdown = false, itemBuilder: (item, level) => this.dropdownItemBuilder(item, level) }))));
|
130
130
|
}
|
131
131
|
get _element() { return this; }
|
132
132
|
static get style() { return taskbarActionsButtonCss; }
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-
|
1
|
+
import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-f121f880.js';
|
2
2
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
3
3
|
import { ObjectUtils } from '@sankhyalabs/core';
|
4
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-
|
4
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-a650ae58.js';
|
5
5
|
|
6
6
|
class GridConfigFetcher extends ResourceFetcher {
|
7
7
|
constructor() {
|
@@ -232,7 +232,7 @@ class PersonalizedFilterFetcher {
|
|
232
232
|
assistent
|
233
233
|
}
|
234
234
|
}`);
|
235
|
-
this.templateByQuery.set("savePersonalizedFilter", dist.gql `
|
235
|
+
this.templateByQuery.set("savePersonalizedFilter", dist.gql `
|
236
236
|
mutation($name: String!, $filterAssistent: InputFilterAssistent!) {
|
237
237
|
$queryAlias$: savePersonalizedFilter(name: $name, filterAssistent: $filterAssistent) {
|
238
238
|
id
|
@@ -254,11 +254,11 @@ class PersonalizedFilterFetcher {
|
|
254
254
|
}
|
255
255
|
}`);
|
256
256
|
}
|
257
|
-
async loadPersonalizedFilter(resourceID, filterID, configName) {
|
257
|
+
async loadPersonalizedFilter(resourceID, filterID, configName, legacyConfigName) {
|
258
258
|
return new Promise((resolve, reject) => {
|
259
259
|
DataFetcher.get()
|
260
260
|
.callGraphQL({
|
261
|
-
values: { name: this.resolveURI(resourceID, configName) + "/" + filterID },
|
261
|
+
values: { name: this.resolveURI(resourceID, configName) + "/" + filterID + this.resolveLegacyConfigName(legacyConfigName) },
|
262
262
|
query: this.templateByQuery.get("fetchFilterAssistent"),
|
263
263
|
})
|
264
264
|
.then((resp) => {
|
@@ -270,6 +270,9 @@ class PersonalizedFilterFetcher {
|
|
270
270
|
});
|
271
271
|
});
|
272
272
|
}
|
273
|
+
resolveLegacyConfigName(legacyConfigName) {
|
274
|
+
return legacyConfigName ? `?legacyResourceID=${legacyConfigName}` : '';
|
275
|
+
}
|
273
276
|
async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
274
277
|
if (!personalizedFilter || Object.keys(personalizedFilter).length == 0) {
|
275
278
|
return Promise.reject(new Error("personalizedFilter não pode ser vazio"));
|
@@ -358,11 +361,30 @@ var CONFIG_SOURCE;
|
|
358
361
|
CONFIG_SOURCE["filterBar"] = "filterBar";
|
359
362
|
})(CONFIG_SOURCE || (CONFIG_SOURCE = {}));
|
360
363
|
class ConfigStorage {
|
361
|
-
static
|
364
|
+
static addFilterBarLegacyConfig(configName, legacyConfigName) {
|
365
|
+
this.validateConfigName(configName, legacyConfigName);
|
366
|
+
this.filterBarLegacyConfig.set(configName, legacyConfigName);
|
367
|
+
}
|
368
|
+
static addFormLegacyConfig(configName, legacyConfigName) {
|
369
|
+
this.validateConfigName(configName, legacyConfigName);
|
370
|
+
this.formLegacyConfig.set(configName, legacyConfigName);
|
371
|
+
}
|
372
|
+
static addGridLegacyConfig(configName, legacyConfigName) {
|
373
|
+
this.validateConfigName(configName, legacyConfigName);
|
374
|
+
this.gridLegacyConfig.set(configName, legacyConfigName);
|
375
|
+
}
|
376
|
+
static preload(resourceID, configName, legacyConfigs) {
|
377
|
+
if (configName && (legacyConfigs === null || legacyConfigs === void 0 ? void 0 : legacyConfigs.gridLegacyConfig)) {
|
378
|
+
ConfigStorage.addGridLegacyConfig(configName, legacyConfigs.gridLegacyConfig);
|
379
|
+
}
|
380
|
+
if (configName && (legacyConfigs === null || legacyConfigs === void 0 ? void 0 : legacyConfigs.formLegacyConfig)) {
|
381
|
+
ConfigStorage.addFormLegacyConfig(configName, legacyConfigs.formLegacyConfig);
|
382
|
+
}
|
362
383
|
ConfigStorage.loadFormConfig(configName, resourceID);
|
363
384
|
ConfigStorage.loadGridConfig(configName, resourceID);
|
364
385
|
}
|
365
386
|
static async loadFilterBarConfig(name, resourceID, urlParams) {
|
387
|
+
urlParams = this.handleLegacyConfig(name, CONFIG_SOURCE.filterBar, urlParams);
|
366
388
|
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.filterBar, resourceID);
|
367
389
|
if (!ConfigStorage.configById.has(cacheID)) {
|
368
390
|
ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(resourceID, name, urlParams));
|
@@ -370,6 +392,7 @@ class ConfigStorage {
|
|
370
392
|
return ConfigStorage.configById.get(cacheID);
|
371
393
|
}
|
372
394
|
static async loadFormConfig(name, resourceID) {
|
395
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.form);
|
373
396
|
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form, resourceID);
|
374
397
|
if (!ConfigStorage.configById.has(cacheID)) {
|
375
398
|
ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, resourceID));
|
@@ -377,6 +400,7 @@ class ConfigStorage {
|
|
377
400
|
return ConfigStorage.configById.get(cacheID);
|
378
401
|
}
|
379
402
|
static async loadGridConfig(name, resourceID) {
|
403
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
380
404
|
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid, resourceID);
|
381
405
|
if (!ConfigStorage.configById.has(cacheID)) {
|
382
406
|
ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, resourceID));
|
@@ -388,6 +412,7 @@ class ConfigStorage {
|
|
388
412
|
return this.filterBarConfigFetcher.saveConfig(config, resourceID, name);
|
389
413
|
}
|
390
414
|
static async saveFormConfig(config, name, resourceID) {
|
415
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.form);
|
391
416
|
await this.deleteFormConfigCache(name, resourceID);
|
392
417
|
return this.formConfigFetcher.saveConfig(config, name, resourceID);
|
393
418
|
}
|
@@ -402,7 +427,8 @@ class ConfigStorage {
|
|
402
427
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
403
428
|
}
|
404
429
|
static async loadPersonalizedFilter(filterId, resourceID, configName) {
|
405
|
-
|
430
|
+
const legacyConfigName = this.filterBarLegacyConfig.get(configName);
|
431
|
+
return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName, legacyConfigName);
|
406
432
|
}
|
407
433
|
static async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
408
434
|
//Ao criar ou alterar um filtro personalizado,
|
@@ -425,6 +451,38 @@ class ConfigStorage {
|
|
425
451
|
static async deleteFilterBarConfigCache(name, resourceID) {
|
426
452
|
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.filterBar);
|
427
453
|
}
|
454
|
+
static validateConfigName(configName, legacyConfigName) {
|
455
|
+
if (!configName)
|
456
|
+
throw Error(this.CONFIG_NAME_ERROR_MESSAGE);
|
457
|
+
if (!legacyConfigName)
|
458
|
+
throw Error(this.LEGACY_CONFIG_NAME_ERROR_MESSAGE);
|
459
|
+
}
|
460
|
+
static handleLegacyConfig(configName, configSource, urlParams) {
|
461
|
+
let legacyConfigName;
|
462
|
+
switch (configSource) {
|
463
|
+
case CONFIG_SOURCE.filterBar:
|
464
|
+
legacyConfigName = this.filterBarLegacyConfig.get(configName);
|
465
|
+
break;
|
466
|
+
case CONFIG_SOURCE.grid:
|
467
|
+
legacyConfigName = this.gridLegacyConfig.get(configName);
|
468
|
+
break;
|
469
|
+
case CONFIG_SOURCE.form:
|
470
|
+
legacyConfigName = this.formLegacyConfig.get(configName);
|
471
|
+
}
|
472
|
+
const params = urlParams ? Object.assign({}, urlParams) : {};
|
473
|
+
if (legacyConfigName) {
|
474
|
+
params['legacyResourceID'] = legacyConfigName;
|
475
|
+
}
|
476
|
+
return params;
|
477
|
+
}
|
478
|
+
static handleLegacyConfigAsString(name, source) {
|
479
|
+
const params = this.handleLegacyConfig(name, source);
|
480
|
+
const legacyResourceID = params['legacyResourceID'];
|
481
|
+
if (legacyResourceID) {
|
482
|
+
name = name + `?legacyResourceID=${legacyResourceID}`;
|
483
|
+
}
|
484
|
+
return name;
|
485
|
+
}
|
428
486
|
static async deleteConfigCache(name, resourceID, source) {
|
429
487
|
const cacheID = ConfigStorage.buildCacheID(name, source, resourceID);
|
430
488
|
this.configById.delete(cacheID);
|
@@ -436,6 +494,11 @@ class ConfigStorage {
|
|
436
494
|
return `req_${source}_${name}_${resourceID}`;
|
437
495
|
}
|
438
496
|
}
|
497
|
+
ConfigStorage.CONFIG_NAME_ERROR_MESSAGE = "ConfigName precisa ser informado.";
|
498
|
+
ConfigStorage.LEGACY_CONFIG_NAME_ERROR_MESSAGE = "LegacyConfigName precisa ser informado.";
|
499
|
+
ConfigStorage.filterBarLegacyConfig = new Map();
|
500
|
+
ConfigStorage.formLegacyConfig = new Map();
|
501
|
+
ConfigStorage.gridLegacyConfig = new Map();
|
439
502
|
ConfigStorage.configById = new Map();
|
440
503
|
ConfigStorage.filterBarConfigFetcher = new FilterBarConfigFetcher();
|
441
504
|
ConfigStorage.formConfigFetcher = new FormConfigFetcher();
|
@@ -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}`);
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-101a2b4c.js';
|
2
2
|
import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
3
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
3
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-f121f880.js';
|
4
4
|
|
5
5
|
class SnkFormConfigManager {
|
6
6
|
constructor(configName, resourceID, onConfigChange) {
|
@@ -8,6 +8,11 @@ class SnkFormConfigManager {
|
|
8
8
|
this._configName = configName;
|
9
9
|
this._onConfigChange = onConfigChange;
|
10
10
|
}
|
11
|
+
addFormLegacyConfig(legacyConfigName) {
|
12
|
+
if (this._configName) {
|
13
|
+
ConfigStorage.addFormLegacyConfig(this._configName, legacyConfigName);
|
14
|
+
}
|
15
|
+
}
|
11
16
|
async loadConfig() {
|
12
17
|
return new Promise(resolve => {
|
13
18
|
ConfigStorage.loadFormConfig(this._configName, this._resourceID)
|
@@ -286,7 +286,8 @@ const snkDataExporterMessages = {
|
|
286
286
|
},
|
287
287
|
message: {
|
288
288
|
emailSuccess: "E-mail enviado com sucesso",
|
289
|
-
exportError: "
|
289
|
+
exportError: "Falha ao exportar dados",
|
290
|
+
unknownFailure: "O motivo da falha não pode ser identificado.",
|
290
291
|
exportPermission: "O usuário não possui permissão para exportar o arquivo.",
|
291
292
|
},
|
292
293
|
title: {
|
@@ -0,0 +1,133 @@
|
|
1
|
+
import { D as DataFetcher } from './DataFetcher-a650ae58.js';
|
2
|
+
import { a as PreloadManager } from './pesquisa-fetcher-f05a12ca.js';
|
3
|
+
import { SortMode, ApplicationContext, UserInterface, DateUtils } from '@sankhyalabs/core';
|
4
|
+
import './index-0ece87a6.js';
|
5
|
+
import './ISave-d8c8bc59.js';
|
6
|
+
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
7
|
+
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
8
|
+
import './filter-item-type.enum-d45e026f.js';
|
9
|
+
import './form-config-fetcher-f121f880.js';
|
10
|
+
import InMemoryFilterColumnDataSource from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
|
11
|
+
|
12
|
+
class CrudUtils {
|
13
|
+
static assertDefaultSorting(gridConfig, dataUnit) {
|
14
|
+
if (gridConfig && dataUnit) {
|
15
|
+
dataUnit.defaultSorting = gridConfig
|
16
|
+
.columns
|
17
|
+
.filter(col => col.ascending != undefined)
|
18
|
+
.sort((colA, colB) => colA.orderIndex - colB.orderIndex)
|
19
|
+
.map(({ name: field, ascending }) => {
|
20
|
+
const { dataType } = dataUnit.getField(field);
|
21
|
+
return { field, dataType, mode: ascending ? SortMode.ASC : SortMode.DESC };
|
22
|
+
});
|
23
|
+
}
|
24
|
+
}
|
25
|
+
static find(entityName, fields, criteria, onlyFirst = true, criteriaExpression, orderBy) {
|
26
|
+
const SERVICE_CRUD_FIND = "mge@crud.find";
|
27
|
+
let parsedFields = [];
|
28
|
+
let parsedCriteria = [];
|
29
|
+
let literalCriteria = {};
|
30
|
+
let application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
31
|
+
if (fields) {
|
32
|
+
if (!Array.isArray(fields)) {
|
33
|
+
throw new Error(application.messagesBuilder.getMessage("crudUtils.errorArray", null));
|
34
|
+
}
|
35
|
+
fields.forEach((fieldName) => {
|
36
|
+
parsedFields.push({
|
37
|
+
name: fieldName
|
38
|
+
});
|
39
|
+
});
|
40
|
+
}
|
41
|
+
if (criteria) {
|
42
|
+
for (const key in criteria) {
|
43
|
+
if (criteria.hasOwnProperty(key)) {
|
44
|
+
parsedCriteria.push({ nome: key, valor: criteria[key] });
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
if (criteriaExpression) {
|
49
|
+
literalCriteria = {
|
50
|
+
expression: {
|
51
|
+
$: criteriaExpression
|
52
|
+
}
|
53
|
+
};
|
54
|
+
}
|
55
|
+
let request = {
|
56
|
+
requestBody: {
|
57
|
+
entity: {
|
58
|
+
name: entityName,
|
59
|
+
criterio: parsedCriteria,
|
60
|
+
fields: {
|
61
|
+
field: parsedFields
|
62
|
+
},
|
63
|
+
literalCriteria: literalCriteria,
|
64
|
+
orderby: orderBy
|
65
|
+
}
|
66
|
+
}
|
67
|
+
};
|
68
|
+
return new Promise((resolve) => {
|
69
|
+
DataFetcher.get().callServiceBroker(SERVICE_CRUD_FIND, JSON.stringify(request)).then((result) => {
|
70
|
+
var _a;
|
71
|
+
let entities = (_a = result.entidades) === null || _a === void 0 ? void 0 : _a.entidade;
|
72
|
+
if (entities != undefined) {
|
73
|
+
let crudFindResult = {
|
74
|
+
fields: new Map()
|
75
|
+
};
|
76
|
+
for (let key in entities) {
|
77
|
+
let fieldValue = entities[key];
|
78
|
+
if (fieldValue.hasOwnProperty('$')) {
|
79
|
+
crudFindResult.fields.set(key, fieldValue.$);
|
80
|
+
}
|
81
|
+
if (onlyFirst) {
|
82
|
+
break;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
resolve(crudFindResult);
|
86
|
+
}
|
87
|
+
else {
|
88
|
+
resolve(null);
|
89
|
+
}
|
90
|
+
});
|
91
|
+
});
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
class SnkMultiSelectionListDataSource {
|
96
|
+
setDataUnit(dataUnit) {
|
97
|
+
this._dataUnit = dataUnit;
|
98
|
+
}
|
99
|
+
setApplication(application) {
|
100
|
+
this._application = application;
|
101
|
+
}
|
102
|
+
formatLabel(fieldName, value) {
|
103
|
+
const { userInterface } = this._dataUnit.getField(fieldName);
|
104
|
+
if (userInterface === UserInterface.DATETIME) {
|
105
|
+
return DateUtils.formatDate(this._dataUnit.valueFromString(fieldName, value));
|
106
|
+
}
|
107
|
+
return String(this._dataUnit.getFormattedValue(fieldName, value));
|
108
|
+
}
|
109
|
+
async getStaticOptions(fieldName) {
|
110
|
+
if (fieldName == undefined) {
|
111
|
+
return Promise.resolve(undefined);
|
112
|
+
}
|
113
|
+
return Promise.resolve(await PreloadManager.getDistinct(this._dataUnit, fieldName));
|
114
|
+
}
|
115
|
+
fetchData(filterTerm, fieldName) {
|
116
|
+
return new Promise(resolve => {
|
117
|
+
this._application.executeSelectDistinct(this._dataUnit, fieldName, filterTerm).then(result => {
|
118
|
+
resolve(result.map(item => {
|
119
|
+
const field = this._dataUnit.getField(fieldName);
|
120
|
+
if (field.userInterface === UserInterface.SEARCH) {
|
121
|
+
return Object.assign(Object.assign({}, JSON.parse(item)), { check: true });
|
122
|
+
}
|
123
|
+
return { value: item, label: this.formatLabel(fieldName, item), check: true };
|
124
|
+
}));
|
125
|
+
});
|
126
|
+
});
|
127
|
+
}
|
128
|
+
sortItems(fieldName, items) {
|
129
|
+
return InMemoryFilterColumnDataSource.defaultSorterMultSelectionOption(this._dataUnit, fieldName, items);
|
130
|
+
}
|
131
|
+
}
|
132
|
+
|
133
|
+
export { CrudUtils as C, SnkMultiSelectionListDataSource as S };
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ObjectUtils } from '@sankhyalabs/core';
|
2
|
-
import { R as ResourceFetcher } from './form-config-fetcher-
|
2
|
+
import { R as ResourceFetcher } from './form-config-fetcher-f121f880.js';
|
3
3
|
|
4
4
|
class AuthFetcher extends ResourceFetcher {
|
5
5
|
getData(resourceID) {
|