@sankhyalabs/sankhyablocks 5.4.3 → 5.6.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/{SnkMessageBuilder-115e8a80.js → SnkMessageBuilder-e64dce7f.js} +49 -1
- package/dist/cjs/{constants-ae0ed870.js → constants-3787fa32.js} +1 -0
- package/dist/cjs/dataunit-fetcher-8f5ade55.js +319 -0
- package/dist/cjs/index-8d94b7e0.js +7 -0
- package/dist/cjs/{index-fc7ca86c.js → index-de79181a.js} +2 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +3 -315
- package/dist/cjs/snk-attach.cjs.entry.js +450 -0
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +23 -13
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
- package/dist/cjs/{snk-data-unit-aa613f3b.js → snk-data-unit-85d6565e.js} +4 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +5 -5
- package/dist/cjs/snk-expression-item.cjs.entry.js +213 -0
- package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +435 -0
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +11 -3
- package/dist/cjs/{snk-guides-viewer-7db960c2.js → snk-guides-viewer-9784c527.js} +2 -2
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +4 -4
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +126 -0
- package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
- package/dist/cjs/{snk-simple-crud.cjs.entry.js → snk-simple-bar_2.cjs.entry.js} +48 -5
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +6 -4
- package/dist/cjs/{taskbar-elements-5e87cf44.js → taskbar-elements-bc2598f9.js} +4 -1
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/snk-attach/interfaces/index.js +1 -0
- package/dist/collection/components/snk-attach/snk-attach.css +8 -0
- package/dist/collection/components/snk-attach/snk-attach.js +202 -0
- package/dist/collection/components/snk-attach/structure/crud-config-builder.js +37 -0
- package/dist/collection/components/snk-attach/structure/data-unit-builder.js +106 -0
- package/dist/collection/components/snk-attach/structure/index.js +3 -0
- package/dist/collection/components/snk-attach/structure/taskbar-builder.js +47 -0
- package/dist/collection/components/snk-configurator/snk-configurator.js +3 -3
- package/dist/collection/components/snk-crud/snk-crud.js +22 -11
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +21 -0
- package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js +62 -69
- package/dist/collection/components/snk-grid/snk-grid.js +11 -3
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css +4 -0
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +87 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js +34 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css +97 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +298 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +2 -2
- package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +37 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +65 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +3 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +4 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/attach-fetcher.js +136 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/ISave.js +6 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/index.js +3 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +63 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +7 -1
- package/dist/collection/lib/message/resources/snk-attach.msg.js +27 -0
- package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +12 -0
- package/dist/collection/lib/message/resources/snk-simple-bar.msg.js +3 -0
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -0
- package/dist/collection/lib/store/index.js +2 -1
- package/dist/collection/lib/utils/constants.js +1 -0
- package/dist/components/SnkMessageBuilder.js +49 -1
- package/dist/components/constants.js +1 -0
- package/dist/components/dataunit-fetcher.js +317 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index2.js +1 -1
- package/dist/components/index3.js +199 -0
- package/dist/components/snk-application2.js +2 -314
- package/dist/components/snk-attach.d.ts +11 -0
- package/dist/components/snk-attach.js +6 -0
- package/dist/components/snk-attach2.js +498 -0
- package/dist/components/snk-crud.js +77 -48
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-data-unit2.js +4 -0
- package/dist/components/snk-expression-item.d.ts +11 -0
- package/dist/components/snk-expression-item.js +6 -0
- package/dist/components/snk-expression-item2.js +241 -0
- package/dist/components/snk-filter-field-search.js +1 -200
- package/dist/{esm/snk-filter-field-search.entry.js → components/snk-filter-field-search2.js} +65 -38
- package/dist/components/snk-filter-param-config.js +1 -273
- package/dist/{esm/snk-filter-param-config.entry.js → components/snk-filter-param-config2.js} +35 -11
- package/dist/components/snk-grid2.js +12 -4
- package/dist/components/snk-personalized-filter.d.ts +11 -0
- package/dist/components/snk-personalized-filter.js +158 -0
- package/dist/components/snk-simple-bar.js +1 -41
- package/dist/components/snk-simple-bar2.js +59 -0
- package/dist/components/snk-simple-crud.js +1 -328
- package/dist/{esm/snk-simple-crud.entry.js → components/snk-simple-crud2.js} +73 -18
- package/dist/components/snk-taskbar2.js +10 -199
- package/dist/esm/{SnkMessageBuilder-a15d22f8.js → SnkMessageBuilder-f3590f65.js} +49 -1
- package/dist/esm/{constants-15617e7d.js → constants-e916ccc3.js} +1 -0
- package/dist/esm/dataunit-fetcher-d32c6a47.js +317 -0
- package/dist/esm/{index-6519a79e.js → index-507e19ec.js} +1 -1
- package/dist/esm/index-620ac460.js +7 -0
- package/dist/esm/{index-e467ade5.js → index-8efbf198.js} +2 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +3 -315
- package/dist/esm/snk-attach.entry.js +446 -0
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +25 -15
- package/dist/esm/snk-data-exporter.entry.js +4 -4
- package/dist/esm/{snk-data-unit-5ed93c0e.js → snk-data-unit-50b1660c.js} +4 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +6 -6
- package/dist/esm/snk-expression-item.entry.js +209 -0
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/snk-filter-field-search_2.entry.js +430 -0
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-grid-config.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +13 -5
- package/dist/esm/{snk-guides-viewer-1e7c21f6.js → snk-guides-viewer-4d12f268.js} +3 -3
- package/dist/esm/snk-guides-viewer.entry.js +5 -5
- package/dist/esm/snk-personalized-filter.entry.js +122 -0
- package/dist/esm/snk-select-box.entry.js +1 -1
- package/dist/esm/snk-simple-bar_2.entry.js +325 -0
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +7 -5
- package/dist/esm/{taskbar-elements-10d80c79.js → taskbar-elements-e6af3e93.js} +5 -2
- package/dist/sankhyablocks/p-17375123.js +1 -0
- package/dist/sankhyablocks/{p-b80cf644.entry.js → p-1c0ee011.entry.js} +1 -1
- package/dist/sankhyablocks/p-1dcfd32a.entry.js +1 -0
- package/dist/sankhyablocks/p-27e264d9.entry.js +1 -0
- package/dist/sankhyablocks/p-343699ad.entry.js +1 -0
- package/dist/sankhyablocks/p-3d3263b4.js +1 -0
- package/dist/sankhyablocks/p-3fbe2d69.entry.js +11 -0
- package/dist/sankhyablocks/p-433dfa63.entry.js +1 -0
- package/dist/sankhyablocks/{p-f132e371.js → p-4c2015a9.js} +1 -1
- package/dist/sankhyablocks/p-4eefe631.entry.js +1 -0
- package/dist/sankhyablocks/p-6a02e236.js +1 -0
- package/dist/sankhyablocks/{p-0a1e7f75.entry.js → p-6ac29569.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f4d36823.entry.js → p-6f0b3cc0.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6516f35a.entry.js → p-86f75e7a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-32599159.entry.js → p-8b02b276.entry.js} +1 -1
- package/dist/sankhyablocks/p-8bdf5e57.entry.js +1 -0
- package/dist/sankhyablocks/{p-9bfa3cfb.entry.js → p-c4417efb.entry.js} +1 -1
- package/dist/sankhyablocks/p-c9477950.js +1 -0
- package/dist/sankhyablocks/{p-703dddb9.js → p-ccd26e3a.js} +1 -1
- package/dist/sankhyablocks/p-d410f45a.js +1 -0
- package/dist/sankhyablocks/p-df8f13b4.entry.js +1 -0
- package/dist/sankhyablocks/{p-3169584f.entry.js → p-e0b4aec3.entry.js} +1 -1
- package/dist/sankhyablocks/p-e9f42525.entry.js +1 -0
- package/dist/sankhyablocks/{p-1393dc00.entry.js → p-f344b811.entry.js} +1 -1
- package/dist/sankhyablocks/p-f4184ce7.js +1 -0
- package/dist/sankhyablocks/p-f821768b.js +74 -0
- package/dist/sankhyablocks/{p-f29caa0a.entry.js → p-f8c66aa3.entry.js} +1 -1
- package/dist/sankhyablocks/p-fd4ed40a.entry.js +1 -0
- package/dist/sankhyablocks/p-ff96b509.entry.js +27 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-attach/interfaces/index.d.ts +10 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +45 -0
- package/dist/types/components/snk-attach/structure/crud-config-builder.d.ts +7 -0
- package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +16 -0
- package/dist/types/components/snk-attach/structure/index.d.ts +3 -0
- package/dist/types/components/snk-attach/structure/taskbar-builder.d.ts +8 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +5 -0
- package/dist/types/components/snk-filter-field-search/interfaces/index.d.ts +14 -4
- package/dist/types/components/snk-filter-field-search/snk-filter-field-search.d.ts +13 -10
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +20 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.d.ts +9 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.d.ts +54 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.d.ts +4 -2
- package/dist/types/components/snk-simple-bar/snk-simple-bar.d.ts +14 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +1 -0
- package/dist/types/components.d.ts +150 -9
- package/dist/types/global.d.ts +9 -0
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +8 -2
- package/dist/types/lib/http/data-fetcher/fetchers/attach-fetcher.d.ts +14 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.d.ts +9 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.d.ts +13 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/ISave.d.ts +26 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/index.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +7 -0
- package/dist/types/lib/message/resources/snk-attach.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-personalized-filter.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/snk-simple-bar.msg.d.ts +1 -0
- package/dist/types/lib/store/index.d.ts +1 -0
- package/dist/types/lib/utils/constants.d.ts +2 -1
- package/package.json +1 -1
- package/react/components.d.ts +3 -0
- package/react/components.js +3 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/snk-filter-field-search.cjs.entry.js +0 -185
- package/dist/cjs/snk-filter-param-config.cjs.entry.js +0 -256
- package/dist/cjs/snk-simple-bar.cjs.entry.js +0 -30
- package/dist/esm/snk-simple-bar.entry.js +0 -26
- package/dist/sankhyablocks/p-1c17eecf.entry.js +0 -1
- package/dist/sankhyablocks/p-2ecf14ff.js +0 -1
- package/dist/sankhyablocks/p-340d6fb0.entry.js +0 -84
- package/dist/sankhyablocks/p-74724fa7.js +0 -1
- package/dist/sankhyablocks/p-79d22df0.entry.js +0 -1
- package/dist/sankhyablocks/p-79f01b63.entry.js +0 -1
- package/dist/sankhyablocks/p-81e85890.entry.js +0 -1
- package/dist/sankhyablocks/p-93d8fe00.entry.js +0 -1
- package/dist/sankhyablocks/p-94e6fc90.entry.js +0 -1
- package/dist/sankhyablocks/p-98f7f796.js +0 -1
- package/dist/sankhyablocks/p-b3e71248.entry.js +0 -1
- package/dist/sankhyablocks/p-bc281de0.js +0 -1
- package/dist/sankhyablocks/p-d61759a5.entry.js +0 -1
- package/dist/sankhyablocks/p-d65809d5.entry.js +0 -1
- package/dist/sankhyablocks/p-f587a454.js +0 -1
- package/dist/types/components/snk-application/snk-application.d.ts +0 -259
- package/dist/types/components/snk-crud/snk-crud.d.ts +0 -73
- package/dist/types/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.d.ts +0 -40
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +0 -27
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +0 -23
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +0 -23
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +0 -29
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +0 -25
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +0 -19
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -38
- package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +0 -74
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +0 -53
- package/dist/types/components/snk-grid/snk-grid.d.ts +0 -95
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -59
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
|
|
2
2
|
import { d as draggable_bundle } from './draggable.bundle-41d56f06.js';
|
3
3
|
import { ObjectUtils, ElementIDUtils, ArrayUtils, ApplicationContext } from '@sankhyalabs/core';
|
4
4
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
5
|
-
import { C as CONFIG_EVENTS, T as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants-
|
5
|
+
import { C as CONFIG_EVENTS, T as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants-e916ccc3.js';
|
6
6
|
import { U as UserConfigType } from './form-config-fetcher-018e7e73.js';
|
7
7
|
import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
8
8
|
import './_commonjsHelpers-9943807e.js';
|
@@ -3,7 +3,7 @@ import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
4
|
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode';
|
5
5
|
import { C as ConfigStorage } from './ConfigStorage-ac77ff39.js';
|
6
|
-
import { O as ORDER_VALUES } from './constants-
|
6
|
+
import { O as ORDER_VALUES } from './constants-e916ccc3.js';
|
7
7
|
import './form-config-fetcher-018e7e73.js';
|
8
8
|
import './DataFetcher-b3d8b2d5.js';
|
9
9
|
import './_commonjsHelpers-9943807e.js';
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cfd4bb13.js';
|
2
|
-
import { ElementIDUtils, ApplicationContext, DataType } from '@sankhyalabs/core';
|
2
|
+
import { VersionUtils, ElementIDUtils, ApplicationContext, DataType } from '@sankhyalabs/core';
|
3
3
|
import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
4
|
+
import { T as TaskbarElement } from './taskbar-elements-e6af3e93.js';
|
4
5
|
import { C as ConfigStorage } from './ConfigStorage-ac77ff39.js';
|
5
|
-
import { P as PresentationMode } from './index-
|
6
|
+
import { P as PresentationMode } from './index-507e19ec.js';
|
6
7
|
import { T as TaskbarProcessor } from './taskbar-processor-94402e6e.js';
|
7
|
-
import { s as store } from './index-
|
8
|
+
import { s as store } from './index-8efbf198.js';
|
8
9
|
import './form-config-fetcher-018e7e73.js';
|
9
10
|
import './DataFetcher-b3d8b2d5.js';
|
10
11
|
import './_commonjsHelpers-9943807e.js';
|
@@ -24,7 +25,7 @@ const SnkGrid = class {
|
|
24
25
|
});
|
25
26
|
this._headerTaskbarProcessor = new TaskbarProcessor({
|
26
27
|
"snkGridHeaderTaskbar.unselected": ["REFRESH", "DATA_EXPORTER"],
|
27
|
-
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH", "DATA_EXPORTER"],
|
28
|
+
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", this.getAttachAvailable(), "REFRESH", "DATA_EXPORTER"],
|
28
29
|
"snkGridHeaderTaskbar.detail.unselected": ["REFRESH"],
|
29
30
|
"snkGridHeaderTaskbar.detail.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
|
30
31
|
});
|
@@ -65,6 +66,13 @@ const SnkGrid = class {
|
|
65
66
|
async setConfig(config) {
|
66
67
|
this.setGridConfig(config);
|
67
68
|
}
|
69
|
+
getAttachAvailable() {
|
70
|
+
var _a;
|
71
|
+
const isValidVersion = VersionUtils.isRequiredVersion((_a = window.envContext) === null || _a === void 0 ? void 0 : _a.sysVersion, '4.22');
|
72
|
+
if (isValidVersion)
|
73
|
+
return TaskbarElement.ATTACH;
|
74
|
+
return "";
|
75
|
+
}
|
68
76
|
openGridConfig() {
|
69
77
|
this._grid.getColumnsState()
|
70
78
|
.then((gridColumns) => {
|
@@ -234,7 +242,7 @@ const SnkGrid = class {
|
|
234
242
|
const disabledButtons = [];
|
235
243
|
if ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) {
|
236
244
|
if (this._dataState.selectionInfo.length > 1) {
|
237
|
-
disabledButtons.push(
|
245
|
+
disabledButtons.push(TaskbarElement.CLONE, "ATTACH");
|
238
246
|
}
|
239
247
|
if (this._dataState.selectionInfo.isAllRecords()) {
|
240
248
|
disabledButtons.push("REMOVE");
|
@@ -3,11 +3,11 @@ import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { S as SnkFormConfigManager } from './SnkFormConfigManager-40609500.js';
|
4
4
|
import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
5
5
|
import { T as TaskbarProcessor } from './taskbar-processor-94402e6e.js';
|
6
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
7
|
-
import { c as VIEW_MODE } from './constants-
|
6
|
+
import { T as TaskbarElement } from './taskbar-elements-e6af3e93.js';
|
7
|
+
import { c as VIEW_MODE } from './constants-e916ccc3.js';
|
8
8
|
import './DataFetcher-b3d8b2d5.js';
|
9
9
|
import './pesquisa-fetcher-bd6af0e3.js';
|
10
|
-
import { P as PresentationMode } from './index-
|
10
|
+
import { P as PresentationMode } from './index-507e19ec.js';
|
11
11
|
|
12
12
|
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
|
13
13
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export { S as snk_guides_viewer } from './snk-guides-viewer-
|
1
|
+
export { S as snk_guides_viewer } from './snk-guides-viewer-4d12f268.js';
|
2
2
|
import './index-cfd4bb13.js';
|
3
3
|
import '@sankhyalabs/core';
|
4
4
|
import './SnkFormConfigManager-40609500.js';
|
@@ -8,8 +8,8 @@ import './DataFetcher-b3d8b2d5.js';
|
|
8
8
|
import './_commonjsHelpers-9943807e.js';
|
9
9
|
import '@sankhyalabs/ezui/dist/collection/utils/form';
|
10
10
|
import './taskbar-processor-94402e6e.js';
|
11
|
-
import './taskbar-elements-
|
12
|
-
import './index-
|
13
|
-
import './index-
|
14
|
-
import './constants-
|
11
|
+
import './taskbar-elements-e6af3e93.js';
|
12
|
+
import './index-507e19ec.js';
|
13
|
+
import './index-8efbf198.js';
|
14
|
+
import './constants-e916ccc3.js';
|
15
15
|
import './pesquisa-fetcher-bd6af0e3.js';
|
@@ -0,0 +1,122 @@
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-cfd4bb13.js';
|
2
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-b3d8b2d5.js';
|
3
|
+
import { F as FilterUserConfigTypes, c as FilterOperand } from './index-507e19ec.js';
|
4
|
+
import { s as store } from './index-8efbf198.js';
|
5
|
+
import { StringUtils, ApplicationContext } from '@sankhyalabs/core';
|
6
|
+
import './_commonjsHelpers-9943807e.js';
|
7
|
+
|
8
|
+
class PersonalizedFilterFetcher {
|
9
|
+
constructor() {
|
10
|
+
this.templateByQuery = new Map();
|
11
|
+
this.buildTemplates();
|
12
|
+
}
|
13
|
+
buildTemplates() {
|
14
|
+
const query = dist.gql `
|
15
|
+
query($name: String!) {
|
16
|
+
$queryAlias$: fetchFilterFields(name: $name){
|
17
|
+
currentLink {
|
18
|
+
description
|
19
|
+
uri
|
20
|
+
}
|
21
|
+
links {
|
22
|
+
description
|
23
|
+
uri
|
24
|
+
fieldCount
|
25
|
+
}
|
26
|
+
fields {
|
27
|
+
name
|
28
|
+
description
|
29
|
+
uri
|
30
|
+
onlyDate
|
31
|
+
dataType
|
32
|
+
userInterface
|
33
|
+
properties {
|
34
|
+
name
|
35
|
+
value
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
`;
|
41
|
+
this.templateByQuery.set("fetchFilterFields", query);
|
42
|
+
}
|
43
|
+
loadFields(uri) {
|
44
|
+
return new Promise((resolve, reject) => {
|
45
|
+
DataFetcher.get()
|
46
|
+
.callGraphQL({
|
47
|
+
values: { name: uri },
|
48
|
+
query: this.templateByQuery.get("fetchFilterFields"),
|
49
|
+
})
|
50
|
+
.then((resp) => {
|
51
|
+
let fields = resp.fields;
|
52
|
+
for (const field of fields) {
|
53
|
+
if (Array.isArray(field.properties) && field.properties.length > 0 && field.userInterface === "SEARCH") {
|
54
|
+
const propertiesConvertedObject = field.properties.reduce((accumulator, prop) => {
|
55
|
+
accumulator[prop.name] = prop.value;
|
56
|
+
return accumulator;
|
57
|
+
}, {});
|
58
|
+
field.properties = propertiesConvertedObject;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
resolve(Object.assign(Object.assign({}, resp), { fields: fields }));
|
62
|
+
})
|
63
|
+
.catch((error) => {
|
64
|
+
reject(error);
|
65
|
+
});
|
66
|
+
});
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
const snkPersonalizedFilterCss = ":host{display:flex}";
|
71
|
+
|
72
|
+
const SnkPersonalizedFilter = class {
|
73
|
+
constructor(hostRef) {
|
74
|
+
registerInstance(this, hostRef);
|
75
|
+
this._personalizedFilterFetcher = new PersonalizedFilterFetcher();
|
76
|
+
this._dataSourceFetcher = {
|
77
|
+
fetchData: async (entity) => {
|
78
|
+
let entityURI = entity === null || entity === void 0 ? void 0 : entity.uri;
|
79
|
+
if (StringUtils.isEmpty(entityURI)) {
|
80
|
+
entityURI = "dd://Financeiro/br.com.sankhya.fin.cad.receber"; //TODO: Receber como prop
|
81
|
+
}
|
82
|
+
return await this._personalizedFilterFetcher.loadFields(entityURI);
|
83
|
+
}
|
84
|
+
};
|
85
|
+
this.items = {
|
86
|
+
entityName: "Financeiro",
|
87
|
+
fieldName: "CODBCO",
|
88
|
+
description: "Financeiro >> Banco",
|
89
|
+
type: FilterUserConfigTypes.DECIMAL,
|
90
|
+
expression: "Financeiro.CODBCO",
|
91
|
+
operand: FilterOperand.EQUAL,
|
92
|
+
paramVariable: false,
|
93
|
+
value: "61",
|
94
|
+
systemConfig: null,
|
95
|
+
userConfig: null
|
96
|
+
};
|
97
|
+
this.handleFilterItemChange = (changes) => {
|
98
|
+
console.log("Campo do ExpressionItem alterado");
|
99
|
+
console.log(changes);
|
100
|
+
};
|
101
|
+
this.handleFilterItemRemove = (expression) => {
|
102
|
+
console.log("Event de deleção disparado");
|
103
|
+
console.log(expression);
|
104
|
+
};
|
105
|
+
this.messagesBuilder = undefined;
|
106
|
+
}
|
107
|
+
componentWillLoad() {
|
108
|
+
if (store.get("filterFieldsDataSource") == undefined) {
|
109
|
+
store.set("filterFieldsDataSource", this._dataSourceFetcher);
|
110
|
+
}
|
111
|
+
if (!this.messagesBuilder) {
|
112
|
+
const snkApp = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
113
|
+
this.messagesBuilder = snkApp === null || snkApp === void 0 ? void 0 : snkApp.messagesBuilder;
|
114
|
+
}
|
115
|
+
}
|
116
|
+
render() {
|
117
|
+
return (h(Host, null, h("div", null, h("snk-expression-item", { expression: this.items, canRemove: true, onEzFilterItemChange: (evt) => this.handleFilterItemChange(evt.detail), onEzFilterItemRemove: (evt) => this.handleFilterItemRemove(evt.detail), messagesBuilder: this.messagesBuilder }))));
|
118
|
+
}
|
119
|
+
};
|
120
|
+
SnkPersonalizedFilter.style = snkPersonalizedFilterCss;
|
121
|
+
|
122
|
+
export { SnkPersonalizedFilter as snk_personalized_filter };
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-cfd4bb13.js';
|
2
|
-
import { O as ORDER_VALUES } from './constants-
|
2
|
+
import { O as ORDER_VALUES } from './constants-e916ccc3.js';
|
3
3
|
|
4
4
|
const snkSelectBoxCss = "ez-combo-box{width:100px}.grid-config-combo{--ez-text-input--height:28px;--ez-text-input__input--background-color:#fff;--ez-text-input__input--border-color:#dce0e8}";
|
5
5
|
|
@@ -0,0 +1,325 @@
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cfd4bb13.js';
|
2
|
+
import { ElementIDUtils, ApplicationContext, DataUnit, StringUtils, SortMode, DataType, ChangeOperation, ObjectUtils, UserInterface } from '@sankhyalabs/core';
|
3
|
+
import { c as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-e916ccc3.js';
|
4
|
+
import { T as TaskbarElement } from './taskbar-elements-e6af3e93.js';
|
5
|
+
import './DataFetcher-b3d8b2d5.js';
|
6
|
+
import './pesquisa-fetcher-bd6af0e3.js';
|
7
|
+
import { P as PresentationMode } from './index-507e19ec.js';
|
8
|
+
import { T as TaskbarProcessor } from './taskbar-processor-94402e6e.js';
|
9
|
+
import './index-8efbf198.js';
|
10
|
+
import './_commonjsHelpers-9943807e.js';
|
11
|
+
|
12
|
+
const snkSimpleBarCss = ".sc-snk-simple-bar-h{display:flex;height:100%;width:100%}.simple-bar__container.sc-snk-simple-bar{flex:1;display:flex;align-items:stretch;gap:var(--space--small)}.simple-bar__left-slot.sc-snk-simple-bar{min-width:280px;flex:1;display:flex;align-items:center}.simple-bar__right-slot.sc-snk-simple-bar{flex:1;display:flex;align-items:center;justify-content:flex-end}.simple-bar__column.sc-snk-simple-bar{flex:1;display:flex;flex-direction:column}";
|
13
|
+
|
14
|
+
const SnkSimpleBar = class {
|
15
|
+
constructor(hostRef) {
|
16
|
+
registerInstance(this, hostRef);
|
17
|
+
this.clickBreadcrumbItem = createEvent(this, "clickBreadcrumbItem", 3);
|
18
|
+
this.exit = createEvent(this, "exit", 3);
|
19
|
+
this.label = undefined;
|
20
|
+
this.breadcrumbItens = undefined;
|
21
|
+
this.messagesBuilder = undefined;
|
22
|
+
}
|
23
|
+
/**
|
24
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
25
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
26
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
27
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-simple-bar.msg.ts"
|
28
|
+
*/
|
29
|
+
getMessage(key, params) {
|
30
|
+
var _a;
|
31
|
+
if (this.messagesBuilder)
|
32
|
+
return this.messagesBuilder.getMessage(key, params);
|
33
|
+
if ((_a = this._application) === null || _a === void 0 ? void 0 : _a.messagesBuilder)
|
34
|
+
return this._application.messagesBuilder.getMessage(key, params);
|
35
|
+
}
|
36
|
+
componentDidLoad() {
|
37
|
+
if (!this._element)
|
38
|
+
return;
|
39
|
+
ElementIDUtils.addIDInfo(this._element);
|
40
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
41
|
+
}
|
42
|
+
render() {
|
43
|
+
return (h("div", { class: "simple-bar__container ez-margin-vertical--medium ez-padding--extra-small" }, h("div", { class: "simple-bar__left-slot" }, h("ez-button", { class: "ez-padding-right--medium", title: this.getMessage('snkSimpleBar.backTitle'), mode: 'icon', iconName: "arrow_back", size: 'medium', onClick: () => this.exit.emit() }), h("div", { class: "simple-bar__column" }, h("h1", { class: "ez-title ez-title--primary ez-title--extra-large" }, this.label), h("ez-breadcrumb", { items: this.breadcrumbItens, onSelectedItem: ({ detail }) => this.clickBreadcrumbItem.emit(detail) }))), h("div", { class: "simple-bar__right-slot" }, h("slot", { name: "rightSlot" }))));
|
44
|
+
}
|
45
|
+
get _element() { return getElement(this); }
|
46
|
+
};
|
47
|
+
SnkSimpleBar.style = snkSimpleBarCss;
|
48
|
+
|
49
|
+
class InMemoryLoader {
|
50
|
+
constructor(metadata, records) {
|
51
|
+
this.records = records || [];
|
52
|
+
this.metadata = metadata;
|
53
|
+
this._dataUnit = new DataUnit("InMemoryDataUnit");
|
54
|
+
this._dataUnit.metadataLoader = () => this.metadaLoader();
|
55
|
+
this._dataUnit.dataLoader = (_dataUnit, request) => this.dataLoader(_dataUnit, request);
|
56
|
+
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
57
|
+
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
58
|
+
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
59
|
+
}
|
60
|
+
get dataUnit() {
|
61
|
+
return this._dataUnit;
|
62
|
+
}
|
63
|
+
get records() {
|
64
|
+
return this._records;
|
65
|
+
}
|
66
|
+
set records(records) {
|
67
|
+
this._records = records === null || records === void 0 ? void 0 : records.map(record => {
|
68
|
+
if (!record["__record__id__"]) {
|
69
|
+
record["__record__id__"] = this.generateUniqueId();
|
70
|
+
}
|
71
|
+
return record;
|
72
|
+
});
|
73
|
+
if (this._dataUnit) {
|
74
|
+
this._dataUnit.records = [...this._records];
|
75
|
+
}
|
76
|
+
}
|
77
|
+
get metadata() {
|
78
|
+
return this._metadata;
|
79
|
+
}
|
80
|
+
set metadata(metadata) {
|
81
|
+
this._metadata = metadata;
|
82
|
+
if (this._dataUnit) {
|
83
|
+
this._dataUnit.metadata = this._metadata;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
generateUniqueId() {
|
87
|
+
return StringUtils.generateUUID();
|
88
|
+
}
|
89
|
+
metadaLoader() {
|
90
|
+
return Promise.resolve(this._metadata);
|
91
|
+
}
|
92
|
+
dataLoader(_dataUnit, request) {
|
93
|
+
let records = [...this._records];
|
94
|
+
if (request.sort) {
|
95
|
+
request.sort.forEach(sort => {
|
96
|
+
records = records.sort((recordA, recordB) => {
|
97
|
+
const fieldA = recordA[sort.field];
|
98
|
+
const fieldB = recordB[sort.field];
|
99
|
+
const sortFn = this.getSortFn(sort.dataType);
|
100
|
+
return sortFn(fieldA, fieldB) * (sort.mode == SortMode.ASC ? 1 : -1);
|
101
|
+
});
|
102
|
+
});
|
103
|
+
}
|
104
|
+
return Promise.resolve({ records: records });
|
105
|
+
}
|
106
|
+
getSortFn(type) {
|
107
|
+
switch (type) {
|
108
|
+
case DataType.NUMBER:
|
109
|
+
return this.sortNumber;
|
110
|
+
case DataType.DATE:
|
111
|
+
return this.sortDate;
|
112
|
+
case DataType.OBJECT:
|
113
|
+
return this.sortObject;
|
114
|
+
default:
|
115
|
+
return StringUtils.compare;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
sortObject(a, b) {
|
119
|
+
return StringUtils.compare(a["label"], b["label"]);
|
120
|
+
}
|
121
|
+
sortNumber(a, b) {
|
122
|
+
return a - b;
|
123
|
+
}
|
124
|
+
sortDate(a, b) {
|
125
|
+
let timeA = a.getTime(), timeB = b.getTime();
|
126
|
+
return timeA === timeB ? 0 : (timeA < timeB ? -1 : 1);
|
127
|
+
}
|
128
|
+
saveLoader(_dataUnit, changes) {
|
129
|
+
return new Promise((resolve) => {
|
130
|
+
let dataUnitRecords = [];
|
131
|
+
changes.forEach(change => {
|
132
|
+
let { record, updatingFields, operation } = change;
|
133
|
+
let isAdd = false;
|
134
|
+
if (operation === ChangeOperation.INSERT ||
|
135
|
+
operation === ChangeOperation.COPY) {
|
136
|
+
record["__old__id__"] = record["__record__id__"];
|
137
|
+
record["__record__id__"] = this.generateUniqueId();
|
138
|
+
isAdd = true;
|
139
|
+
}
|
140
|
+
const changedRecord = Object.assign(Object.assign({}, record), updatingFields);
|
141
|
+
if (isAdd) {
|
142
|
+
this.records.push(changedRecord);
|
143
|
+
}
|
144
|
+
else {
|
145
|
+
const recordIndex = this.records.findIndex(r => r["__record__id__"] == changedRecord["__record__id__"]);
|
146
|
+
this.records[recordIndex] = changedRecord;
|
147
|
+
}
|
148
|
+
dataUnitRecords.push(changedRecord);
|
149
|
+
});
|
150
|
+
resolve(dataUnitRecords);
|
151
|
+
});
|
152
|
+
}
|
153
|
+
removeLoader(_dataUnit, recordIds) {
|
154
|
+
return new Promise((resolve) => {
|
155
|
+
this._records = this._records.filter(record => !recordIds.includes(record["__record__id__"]));
|
156
|
+
resolve(recordIds);
|
157
|
+
});
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
161
|
+
const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto;row-gap:12px;height:100%;width:100%}.simple-crud__taskbar.sc-snk-simple-crud{z-index:var(--more-visible, 2);margin-bottom:var(--space--medium)}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
|
162
|
+
|
163
|
+
const SnkSimpleCrud = class {
|
164
|
+
constructor(hostRef) {
|
165
|
+
registerInstance(this, hostRef);
|
166
|
+
this.dataStateChange = createEvent(this, "dataStateChange", 3);
|
167
|
+
this.dataUnitReady = createEvent(this, "dataUnitReady", 3);
|
168
|
+
this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER"];
|
169
|
+
this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER"];
|
170
|
+
this._taskbarProcessor = new TaskbarProcessor({
|
171
|
+
"snkSimpleCrudTaskbar.form_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.GRID_MODE),
|
172
|
+
"snkSimpleCrudTaskbar.grid_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.FORM_MODE),
|
173
|
+
"snkSimpleCrudTaskbar.form_selected": this.resolveInMemoryBtns(this.REGULAR_SELECTED_BTNS).concat(TaskbarElement.GRID_MODE),
|
174
|
+
"snkSimpleCrudTaskbar.grid_selected": this.resolveInMemoryBtns(this.REGULAR_SELECTED_BTNS).concat(TaskbarElement.FORM_MODE),
|
175
|
+
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
176
|
+
});
|
177
|
+
this._currentViewMode = VIEW_MODE.GRID;
|
178
|
+
this._config = undefined;
|
179
|
+
this.dataState = undefined;
|
180
|
+
this.dataUnit = undefined;
|
181
|
+
this.mode = SIMPLE_CRUD_MODE.SERVER;
|
182
|
+
this.gridConfig = undefined;
|
183
|
+
this.formConfig = undefined;
|
184
|
+
this.useCancelConfirm = true;
|
185
|
+
this.taskbarManager = undefined;
|
186
|
+
this.messagesBuilder = undefined;
|
187
|
+
}
|
188
|
+
resolveInMemoryBtns(taskbarButtons) {
|
189
|
+
const newTaskBarConfig = [...taskbarButtons];
|
190
|
+
if (this.mode === SIMPLE_CRUD_MODE.IN_MEMORY) {
|
191
|
+
newTaskBarConfig.splice(1, 1);
|
192
|
+
}
|
193
|
+
return newTaskBarConfig;
|
194
|
+
}
|
195
|
+
/**
|
196
|
+
* Usado para alternar a visão entre GRID e FORM externamente.
|
197
|
+
*/
|
198
|
+
async goToView(view) {
|
199
|
+
this._currentViewMode = view;
|
200
|
+
if (this._viewStack) {
|
201
|
+
this._viewStack.show(view);
|
202
|
+
}
|
203
|
+
}
|
204
|
+
actionClickListener(evt) {
|
205
|
+
const act = evt.detail;
|
206
|
+
if (act === TaskbarElement.GRID_MODE) {
|
207
|
+
this.goToView(VIEW_MODE.GRID);
|
208
|
+
}
|
209
|
+
else if (act === TaskbarElement.FORM_MODE) {
|
210
|
+
this.goToView(VIEW_MODE.FORM);
|
211
|
+
}
|
212
|
+
evt.stopPropagation();
|
213
|
+
}
|
214
|
+
onModeChange() {
|
215
|
+
if (this.mode == SIMPLE_CRUD_MODE.IN_MEMORY) {
|
216
|
+
this.initInMemoryDataUnit();
|
217
|
+
}
|
218
|
+
}
|
219
|
+
observeDataState(newValue, oldValue) {
|
220
|
+
if (ObjectUtils.objectToString(oldValue) != ObjectUtils.objectToString(newValue)) {
|
221
|
+
this.dataStateChange.emit(newValue);
|
222
|
+
}
|
223
|
+
}
|
224
|
+
componentWillRender() {
|
225
|
+
this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
|
226
|
+
}
|
227
|
+
componentWillLoad() {
|
228
|
+
this.processMetadata();
|
229
|
+
this.onModeChange();
|
230
|
+
}
|
231
|
+
getTaskBarId() {
|
232
|
+
var _a, _b, _c;
|
233
|
+
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
|
234
|
+
return "snkSimpleCrudTaskbar.finish_edition";
|
235
|
+
}
|
236
|
+
if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
|
237
|
+
!this.dataState.selectionInfo.isAllRecords() &&
|
238
|
+
((_c = this.dataState.selectionInfo.records) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
239
|
+
return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
|
240
|
+
}
|
241
|
+
return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
|
242
|
+
}
|
243
|
+
initInMemoryDataUnit() {
|
244
|
+
this._inMemoryLoader = new InMemoryLoader(this._metadata);
|
245
|
+
this.dataUnit = this._inMemoryLoader.dataUnit;
|
246
|
+
this.dataUnitReady.emit(this.dataUnit);
|
247
|
+
}
|
248
|
+
setMetadata(metadata) {
|
249
|
+
if (this._inMemoryLoader) {
|
250
|
+
this._inMemoryLoader.metadata = metadata;
|
251
|
+
}
|
252
|
+
else if (this.dataUnit) {
|
253
|
+
this.dataUnit.metadata = metadata;
|
254
|
+
}
|
255
|
+
return Promise.resolve();
|
256
|
+
}
|
257
|
+
setRecords(records) {
|
258
|
+
if (this._inMemoryLoader) {
|
259
|
+
this._inMemoryLoader.records = records;
|
260
|
+
}
|
261
|
+
else if (this.dataUnit) {
|
262
|
+
this.dataUnit.records = records;
|
263
|
+
}
|
264
|
+
return Promise.resolve();
|
265
|
+
}
|
266
|
+
getRecords() {
|
267
|
+
return Promise.resolve(this.dataUnit.records);
|
268
|
+
}
|
269
|
+
processMetadata() {
|
270
|
+
const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
|
271
|
+
const fieldMetadata = [];
|
272
|
+
const formConfig = { fields: [], emptyConfig: false };
|
273
|
+
fieldsMetadataElem.forEach(fieldElem => {
|
274
|
+
const field = {
|
275
|
+
name: fieldElem.getAttribute("name") || fieldElem.getAttribute("label"),
|
276
|
+
label: fieldElem.getAttribute("label"),
|
277
|
+
dataType: DataType[fieldElem.getAttribute("dataType")] || DataType.TEXT,
|
278
|
+
userInterface: UserInterface[fieldElem.getAttribute("userInterface")] || UserInterface.SHORTTEXT,
|
279
|
+
readOnly: fieldElem.getAttribute("readOnly") == "true",
|
280
|
+
required: fieldElem.getAttribute("required") == "true",
|
281
|
+
tab: fieldElem.getAttribute("tab") || undefined,
|
282
|
+
visible: fieldElem.getAttribute("visible") != "false"
|
283
|
+
};
|
284
|
+
const fieldConfig = { name: field.name, tab: field.tab, visible: field.visible };
|
285
|
+
formConfig.fields.push(fieldConfig);
|
286
|
+
fieldMetadata.push(field);
|
287
|
+
});
|
288
|
+
if (fieldMetadata.length > 0) {
|
289
|
+
if (!this.formConfig) {
|
290
|
+
this.formConfig = formConfig;
|
291
|
+
}
|
292
|
+
this._metadata = {
|
293
|
+
name: "SimpleCrud",
|
294
|
+
label: "SimpleCrud",
|
295
|
+
fields: fieldMetadata
|
296
|
+
};
|
297
|
+
}
|
298
|
+
}
|
299
|
+
onDataStateChange(evt) {
|
300
|
+
this.dataState = Object.assign({}, evt.detail);
|
301
|
+
}
|
302
|
+
getTaskBarDisabledButtons() {
|
303
|
+
var _a, _b;
|
304
|
+
const disabledButtons = [];
|
305
|
+
if (!((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.hasNext)) {
|
306
|
+
disabledButtons.push(TaskbarElement.NEXT);
|
307
|
+
}
|
308
|
+
if (!((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.hasPrevious)) {
|
309
|
+
disabledButtons.push(TaskbarElement.PREVIOUS);
|
310
|
+
}
|
311
|
+
return disabledButtons;
|
312
|
+
}
|
313
|
+
render() {
|
314
|
+
var _a;
|
315
|
+
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "simple-crud__taskbar 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, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), config: this.gridConfig, "no-header": true }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
316
|
+
}
|
317
|
+
get _element() { return getElement(this); }
|
318
|
+
static get watchers() { return {
|
319
|
+
"mode": ["onModeChange"],
|
320
|
+
"dataState": ["observeDataState"]
|
321
|
+
}; }
|
322
|
+
};
|
323
|
+
SnkSimpleCrud.style = snkSimpleCrudCss;
|
324
|
+
|
325
|
+
export { SnkSimpleBar as snk_simple_bar, SnkSimpleCrud as snk_simple_crud };
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-cfd4bb13.js';
|
2
2
|
import { d as draggable_bundle } from './draggable.bundle-41d56f06.js';
|
3
3
|
import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
4
|
-
import { C as CONFIG_EVENTS, K as KEY_EVENTS, b as TYPE_ACTIONS, T as TAB_NAMES } from './constants-
|
4
|
+
import { C as CONFIG_EVENTS, K as KEY_EVENTS, b as TYPE_ACTIONS, T as TAB_NAMES } from './constants-e916ccc3.js';
|
5
5
|
import './_commonjsHelpers-9943807e.js';
|
6
6
|
|
7
7
|
const snkTabConfigCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}.sc-snk-tab-config-h{--snk-tab-config--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--snk-tab-config--forward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--snk-tab-config__lower-bar--background-color:var(--color--disable-primary, #e5eaf0);--snk-tab-config__lower-bar--border:2px solid var(--color--disable-primary, #e5eaf0);--snk-tab-config__tab--color:var(--text--primary, #626e82);--snk-tab-config__tab--font-family:var(--font-pattern, \"Roboto\");--snk-tab-config__tab--font-size:var(--title--small, 14px);--snk-tab-config__tab--padding:var(--space--small, 6px) var(--space--medium, 12px);--snk-tab-config__tab-is-active--color:var(--color--primary, #008561);--snk-tab-config__tab-hover--color:var(--color--secondary, #383c45);--snk-tab-config__tab-is-focused--border:1px dashed var(--color--primary, #008561);--snk-tab-config__tab-label--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--snk-tab-config__tab-label--margin-bottom:var(--space--extra-small, 3px);--snk-tab-config__new-button-icon--color:var(--color--secondary-700, #1C1D22);--snk-tab-config__forward-button--background-color:var(--text--primary, #626e82);--snk-tab-config__forward-button-hover--background-color:var(--color--primary, #008561);--snk-tab-config__left-icon--padding-right:var(--space--small, 6px);--snk-tab-config__left-icon--color:var(--text--disable, #AFB6C0);--snk-tab-config__tab-label-disabled--color:var(--text--disable, #AFB6C0);--snk-tab-config__slot--margin-left:var(--space--small, 6px);display:flex;position:relative;width:100%;overflow:hidden}.tab-config__scroll.sc-snk-tab-config{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.tab-config__lower-bar.sc-snk-tab-config{position:absolute;left:0%;right:0%;top:91%;bottom:0%;border-radius:2px;background-color:var(--snk-tab-config__lower-bar--background-color);border:var(--snk-tab-config__lower-bar--border)}.tab-config__tab.sc-snk-tab-config{display:flex;border:none;background-color:unset;cursor:pointer;align-items:center;justify-content:center;min-width:fit-content;color:var(--snk-tab-config__tab--color);font-family:var(--snk-tab-config__tab--font-family);font-size:var(--snk-tab-config__tab--font-size);padding:var(--snk-tab-config__tab--padding)}.tab-config__tab.sc-snk-tab-config:focus,.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{outline:none}.tab-config__tab--is-active.sc-snk-tab-config{position:relative;color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab.sc-snk-tab-config:hover{color:var(--snk-tab-config__tab-hover--color)}.tab-config__tab--is-active.sc-snk-tab-config:hover{color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab--is-active.sc-snk-tab-config::after{content:\"\";position:absolute;width:100%;height:100%;clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out;background-color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab--is-focused.sc-snk-tab-config{border:var(--snk-tab-config__tab-is-focused--border)}.tab-config__tab-label.sc-snk-tab-config{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--snk-tab-config__tab-label--text-shadow);margin-bottom:var(--snk-tab-config__tab-label--margin-bottom)}.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config ez-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__new-button-icon--color)}.tab-config__backward-button.sc-snk-tab-config{left:0px;box-shadow:10px 10px 5px 5px white;background:white}.tab-config__forward-button.sc-snk-tab-config{box-shadow:10px 10px 5px 20px white;background:white}.tab-config__forward-button.sc-snk-tab-config::after,.tab-config__backward-button.sc-snk-tab-config::after{content:'';display:flex;width:10px;height:16px;background-color:var(--snk-tab-config__forward-button--background-color)}.tab-config__forward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--forward-icon);mask-image:var(--snk-tab-config--forward-icon)}.tab-config__backward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--backward-icon);mask-image:var(--snk-tab-config--backward-icon)}.tab-config__forward-button.sc-snk-tab-config:hover::after,.tab-config__backward-button.sc-snk-tab-config:hover::after{background-color:var(--snk-tab-config__forward-button-hover--background-color)}.tab-config__new-button.sc-snk-tab-config:hover ez-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__forward-button-hover--background-color)}.tab-config__hidden.sc-snk-tab-config{display:none}.tab-config__scroll.sc-snk-tab-config::-webkit-scrollbar{display:none}.tab-config__left-icon.sc-snk-tab-config{padding-right:var(--snk-tab-config__left-icon--padding-right);--ez-icon--color:var(--snk-tab-config__left-icon--color)}.tab-config__left-icon--eye-off.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__left-icon--color)}.tab-config__right-icon.sc-snk-tab-config{visibility:hidden;padding-left:var(--snk-tab-config__left-icon--padding-right)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{visibility:visible}.tab-config__tab--is-active.sc-snk-tab-config .tab-config__right-icon.sc-snk-tab-config{visibility:visible;--ez-icon--color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__tab-hover--color)}.tab-config__tab--is-active.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__tab-is-active--color)}.tab-config__actions-button.sc-snk-tab-config{--ez-actions-button__btn-action--min-width:100px;visibility:hidden;opacity:0;transition:visibility 1s linear, opacity 0.3s linear}.tab-config__tab.sc-snk-tab-config:hover .tab-config__actions-button.sc-snk-tab-config{visibility:visible;opacity:1;transition:visibility 0.2s linear, opacity 0.10s linear}[data-draggable-element].sc-snk-tab-config{cursor:grab}.tab-config__tab-label-disabled.sc-snk-tab-config{color:var(--snk-tab-config__tab-label-disabled--color)}.tab-config__slot.sc-snk-tab-config{margin-left:var(--snk-tab-config__slot--margin-left)}";
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-cfd4bb13.js';
|
2
2
|
import { StringUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { A as AuthorizationConfig } from './AuthorizationConfig-dcbd207a.js';
|
4
|
-
import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-
|
5
|
-
import { P as PresentationMode } from './index-
|
6
|
-
import './index-
|
4
|
+
import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-e6af3e93.js';
|
5
|
+
import { P as PresentationMode } from './index-507e19ec.js';
|
6
|
+
import './index-8efbf198.js';
|
7
7
|
|
8
8
|
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
|
9
9
|
|
@@ -24,7 +24,8 @@ const SnkTaskbar = class {
|
|
24
24
|
[TaskbarElement.SAVE]: "snkTaskbar.titleSave",
|
25
25
|
[TaskbarElement.GRID_MODE]: "snkTaskbar.titleGridMode",
|
26
26
|
[TaskbarElement.FORM_MODE]: "snkTaskbar.titleFormMode",
|
27
|
-
[TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator"
|
27
|
+
[TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator",
|
28
|
+
[TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
|
28
29
|
};
|
29
30
|
this._permissions = undefined;
|
30
31
|
this.configName = undefined;
|
@@ -131,7 +132,8 @@ const SnkTaskbar = class {
|
|
131
132
|
if (index > 1) {
|
132
133
|
className += "ez-padding-left--medium";
|
133
134
|
}
|
134
|
-
|
135
|
+
const taskbarElement = TaskbarElement[def.toString()];
|
136
|
+
if (taskbarElement) {
|
135
137
|
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList, this.configName, this.presentationMode);
|
136
138
|
}
|
137
139
|
else {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { h } from './index-cfd4bb13.js';
|
2
|
-
import { P as PresentationMode } from './index-
|
3
|
-
import { s as store } from './index-
|
2
|
+
import { P as PresentationMode } from './index-507e19ec.js';
|
3
|
+
import { s as store } from './index-8efbf198.js';
|
4
4
|
|
5
5
|
var TaskbarElement;
|
6
6
|
(function (TaskbarElement) {
|
@@ -19,6 +19,7 @@ var TaskbarElement;
|
|
19
19
|
TaskbarElement["DIVIDER"] = "DIVIDER";
|
20
20
|
TaskbarElement["CONFIGURATOR"] = "CONFIGURATOR";
|
21
21
|
TaskbarElement["DATA_EXPORTER"] = "DATA_EXPORTER";
|
22
|
+
TaskbarElement["ATTACH"] = "ATTACH";
|
22
23
|
})(TaskbarElement || (TaskbarElement = {}));
|
23
24
|
var AuthorizationElements;
|
24
25
|
(function (AuthorizationElements) {
|
@@ -91,6 +92,8 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
|
|
91
92
|
case TaskbarElement.DATA_EXPORTER:
|
92
93
|
const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
|
93
94
|
return h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId });
|
95
|
+
case TaskbarElement.ATTACH:
|
96
|
+
return iconButton("anexo", element, className, dataElementId, title, action, isEnabled);
|
94
97
|
}
|
95
98
|
};
|
96
99
|
function textButton(name, className, dataElementId, text, title, action, isEnabled) {
|
@@ -0,0 +1 @@
|
|
1
|
+
const a="br.com.sankhya.controls.ReportLauncher",e="global.porta.app.impressao";var o;!function(a){a[a.GRID=0]="GRID",a[a.FORM=1]="FORM",a[a.ATTACHMENT=2]="ATTACHMENT"}(o||(o={}));const r={add:"ADD",remove:"REMOVE",configuration:"CONFIGURATION"},t={UserInterface:{DATE:[{label:"Data atual",value:"${data}"}],DATETIME:[{label:"Data e hora atuais",value:"${datahora}"}],INTEGERNUMBER:[{label:"Código do usuário logado",value:"${usuario}"},{label:"Empresa do usuário logado",value:"${usuario.empresa}"},{label:"Vendedor para o usuário logado",value:"${usuario.vendedor}"},{label:"Cent. Resultado usuário logado",value:"${usuario.centroresultado}"}]}},s={fixed:"F",variable:"V"},l={closeModal:"ezCloseModal",cancelConfig:"cancelConfig",changeConfig:"changeConfig",configChanged:"configChanged",fieldChanged:"ezChange",dragStart:"sortable:start",dragSort:"sortable:sort",dragSorted:"sortable:sorted",dragStop:"sortable:stop"},n={enter:"Enter",arrowLeft:"ArrowLeft",arrowRight:"ArrowRight",tab:"Tab",escape:"Escape"},E={rename:"RENAME",hide:"HIDE",show:"SHOW",delete:"DELETE"},i={main:"__main"},u={LONGTEXT:"ez-text-area",FILE:"ez-upload",DATE:"ez-date-input",TIME:"ez-time",DATETIME:"ez-date-time-input",DEFAULT:"ez-text-input",SWITCH:"ez-check",CHECKBOX:"ez-check",OPTIONSELECTOR:"ez-combo-box",SEARCH:"ez-search",INTEGERNUMBER:"ez-number-input",DECIMALNUMBER:"ez-number-input"},d={none:{value:"NA",label:"N/A"},asc:{value:"ASC",label:"A-Z"},desc:{value:"DESC",label:"Z-A"}},c={methods:{PRINTERS_LIST:"pList",LOCAL_PRINTING:"localPrinting",IMPRESSAO_DIRETA:"impressaoDireta",IMPRESSAO_DIRETA_TEXTO:"impressaoDiretaTexto",INFO:"info",PDF_VIEWER:"pdfViewer",IMPORT_IMAGE:"importImage"}};var T;!function(a){a[a.SERVER=0]="SERVER",a[a.IN_MEMORY=1]="IN_MEMORY"}(T||(T={}));export{r as A,l as C,s as D,n as K,d as O,a as R,T as S,i as T,t as V,c as W,u as a,E as b,o as c,e as d}
|