@sankhyalabs/sankhyablocks 5.5.0 → 5.7.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-26da04f7.js → SnkMessageBuilder-056d1c24.js} +23 -1
- package/dist/cjs/{filter-item-type.enum-3daf58d3.js → filter-item-type.enum-aa823a00.js} +1 -0
- package/dist/cjs/filter-type.enum-b14ce507.js +11 -0
- package/dist/cjs/index-8d94b7e0.js +7 -0
- package/dist/cjs/index-de79181a.js +201 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/presentationMode-52ec3bdd.js +7 -0
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-attach.cjs.entry.js +2 -1
- package/dist/cjs/snk-crud.cjs.entry.js +2 -1
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-c43df27b.js → snk-data-unit-289081c4.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +4 -3
- package/dist/cjs/snk-expression-item.cjs.entry.js +213 -0
- package/dist/cjs/snk-filter-bar.cjs.entry.js +52 -140
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +8 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +435 -0
- package/dist/cjs/snk-filter-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +66 -0
- package/dist/cjs/snk-filter-modal.cjs.entry.js +72 -49
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +11 -2
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-search.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +2 -0
- package/dist/cjs/snk-grid.cjs.entry.js +3 -2
- package/dist/cjs/{snk-guides-viewer-e6a65393.js → snk-guides-viewer-9784c527.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -2
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +126 -0
- package/dist/cjs/snk-simple-bar_2.cjs.entry.js +2 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -1
- package/dist/cjs/taskbar-elements-bc2598f9.js +118 -0
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/presentationMode.js +5 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +47 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +50 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +1 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +31 -2
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +116 -156
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.css +4 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +115 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +19 -142
- package/dist/collection/components/snk-filter-bar/types/filter-type.enum.js +7 -0
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +36 -0
- package/dist/collection/components/snk-filter-bar/utils/filters-mock.js +315 -0
- package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js +62 -69
- 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/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +63 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +2 -0
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +9 -1
- package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +12 -0
- package/dist/collection/lib/store/index.js +2 -1
- package/dist/components/SnkMessageBuilder.js +23 -1
- package/dist/components/filter-item-type.enum.js +1 -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/presentationMode.js +7 -0
- package/dist/components/snk-crud.js +22 -34
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-detail-view2.js +24 -46
- 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-bar2.js +57 -157
- package/dist/components/snk-filter-binary-select.js +9 -1
- 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-list.js +171 -1
- package/dist/components/snk-filter-modal-item.d.ts +11 -0
- package/dist/components/snk-filter-modal-item.js +6 -0
- package/dist/components/snk-filter-modal-item2.js +85 -0
- package/dist/components/snk-filter-modal.js +118 -1
- package/dist/components/snk-filter-multi-select.js +3 -1
- package/dist/components/snk-filter-number.js +3 -1
- 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-filter-period.js +12 -2
- package/dist/components/snk-filter-personalized.js +3 -1
- package/dist/components/snk-filter-search.js +3 -1
- package/dist/components/snk-filter-text.js +3 -1
- package/dist/components/snk-grid2.js +12 -23
- package/dist/components/snk-personalized-filter.d.ts +11 -0
- package/dist/components/snk-personalized-filter.js +158 -0
- package/dist/components/snk-taskbar2.js +3 -197
- package/dist/esm/{SnkMessageBuilder-7a9392e6.js → SnkMessageBuilder-23272e07.js} +23 -1
- package/dist/esm/{filter-item-type.enum-a79b2fa8.js → filter-item-type.enum-5028ed3f.js} +1 -0
- package/dist/esm/filter-type.enum-a80c1b6b.js +9 -0
- package/dist/esm/{index-6519a79e.js → index-507e19ec.js} +1 -1
- package/dist/esm/index-620ac460.js +7 -0
- package/dist/esm/index-8efbf198.js +199 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/presentationMode-783bbf9d.js +7 -0
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-attach.entry.js +3 -2
- package/dist/esm/snk-crud.entry.js +3 -2
- package/dist/esm/snk-data-exporter.entry.js +3 -3
- package/dist/esm/{snk-data-unit-f9e4c694.js → snk-data-unit-34dc5371.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +5 -4
- package/dist/esm/snk-expression-item.entry.js +209 -0
- package/dist/esm/snk-filter-bar.entry.js +53 -141
- package/dist/esm/snk-filter-binary-select.entry.js +9 -2
- package/dist/esm/snk-filter-detail.entry.js +1 -1
- package/dist/esm/snk-filter-field-search_2.entry.js +430 -0
- package/dist/esm/snk-filter-item.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +62 -0
- package/dist/esm/snk-filter-modal.entry.js +73 -50
- package/dist/esm/snk-filter-multi-select.entry.js +4 -2
- package/dist/esm/snk-filter-number.entry.js +4 -2
- package/dist/esm/snk-filter-period.entry.js +12 -3
- package/dist/esm/snk-filter-personalized.entry.js +4 -2
- package/dist/esm/snk-filter-search.entry.js +4 -2
- package/dist/esm/snk-filter-text.entry.js +3 -1
- package/dist/esm/snk-grid.entry.js +3 -2
- package/dist/esm/{snk-guides-viewer-62a9f74d.js → snk-guides-viewer-4d12f268.js} +2 -2
- package/dist/esm/snk-guides-viewer.entry.js +4 -3
- package/dist/esm/snk-personalized-filter.entry.js +122 -0
- package/dist/esm/snk-simple-bar_2.entry.js +3 -2
- package/dist/esm/snk-taskbar.entry.js +3 -2
- package/dist/esm/taskbar-elements-e6af3e93.js +115 -0
- package/dist/sankhyablocks/p-0110b7da.entry.js +1 -0
- package/dist/sankhyablocks/p-1a68fb59.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-f2223502.js → p-3db1d3de.js} +1 -1
- package/dist/sankhyablocks/p-433dfa63.entry.js +1 -0
- package/dist/sankhyablocks/p-45ee8b22.entry.js +1 -0
- package/dist/sankhyablocks/{p-f132e371.js → p-4c2015a9.js} +1 -1
- package/dist/sankhyablocks/p-4ce96831.entry.js +1 -0
- package/dist/sankhyablocks/p-4eefe631.entry.js +1 -0
- package/dist/sankhyablocks/{p-9dd2b8cb.js → p-584d7212.js} +1 -1
- package/dist/sankhyablocks/{p-a412992c.entry.js → p-64b03506.entry.js} +1 -1
- package/dist/sankhyablocks/p-6a02e236.js +1 -0
- package/dist/sankhyablocks/p-7695c404.entry.js +1 -0
- package/dist/sankhyablocks/p-786ae316.entry.js +1 -0
- package/dist/sankhyablocks/p-82bc97da.entry.js +1 -0
- package/dist/sankhyablocks/p-8bdf5e57.entry.js +1 -0
- package/dist/sankhyablocks/p-8efb0f47.entry.js +1 -0
- package/dist/sankhyablocks/p-9af04fc7.entry.js +1 -0
- package/dist/sankhyablocks/{p-3a2ce158.entry.js → p-a1c58536.entry.js} +1 -1
- package/dist/sankhyablocks/{p-afba9bbe.entry.js → p-bdbb2672.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b2523981.entry.js → p-c1ab16d0.entry.js} +2 -2
- package/dist/sankhyablocks/{p-aeffd219.js → p-ccd26e3a.js} +1 -1
- package/dist/sankhyablocks/p-d410f45a.js +1 -0
- package/dist/sankhyablocks/p-d9804798.js +1 -0
- package/dist/sankhyablocks/p-df8f13b4.entry.js +1 -0
- package/dist/sankhyablocks/p-e2bb9c9a.entry.js +1 -0
- package/dist/sankhyablocks/p-e9f42525.entry.js +1 -0
- package/dist/sankhyablocks/p-ed3d6ab4.entry.js +1 -0
- package/dist/sankhyablocks/p-ee1381f4.entry.js +1 -0
- package/dist/sankhyablocks/p-f4184ce7.js +1 -0
- package/dist/sankhyablocks/p-f5f36fbb.js +1 -0
- package/dist/sankhyablocks/p-fd4ed40a.entry.js +1 -0
- package/dist/sankhyablocks/p-ff96b509.entry.js +27 -0
- package/dist/sankhyablocks/p-ffac37d5.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/editors/enum/presentationMode.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +5 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +2 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +3 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +37 -0
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +17 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +2 -11
- package/dist/types/components/snk-filter-bar/types/filter-type.enum.d.ts +6 -0
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +20 -0
- package/dist/types/components/snk-filter-bar/utils/filters-mock.d.ts +186 -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.d.ts +196 -63
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +7 -0
- package/dist/types/lib/message/resources/snk-personalized-filter.msg.d.ts +1 -0
- package/dist/types/lib/store/index.d.ts +1 -0
- 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/taskbar-elements-80285601.js +0 -313
- package/dist/components/snk-filter-list2.js +0 -173
- package/dist/components/snk-filter-modal2.js +0 -97
- package/dist/esm/taskbar-elements-055ba1ad.js +0 -309
- package/dist/sankhyablocks/p-4512cc6c.entry.js +0 -1
- package/dist/sankhyablocks/p-5cbbe1f7.entry.js +0 -1
- package/dist/sankhyablocks/p-5e62a17b.entry.js +0 -1
- package/dist/sankhyablocks/p-5fc55684.entry.js +0 -1
- package/dist/sankhyablocks/p-63d01871.entry.js +0 -1
- package/dist/sankhyablocks/p-73e830cf.entry.js +0 -1
- package/dist/sankhyablocks/p-741b00ef.entry.js +0 -1
- package/dist/sankhyablocks/p-79d22df0.entry.js +0 -1
- package/dist/sankhyablocks/p-86d29b6f.entry.js +0 -1
- package/dist/sankhyablocks/p-92a0fca4.js +0 -1
- package/dist/sankhyablocks/p-93d8fe00.entry.js +0 -1
- package/dist/sankhyablocks/p-999d1953.entry.js +0 -1
- package/dist/sankhyablocks/p-ad51bf1c.entry.js +0 -1
- package/dist/sankhyablocks/p-c336170d.entry.js +0 -1
- package/dist/sankhyablocks/p-c3efd4eb.entry.js +0 -1
- package/dist/sankhyablocks/p-d5c9c1f8.entry.js +0 -1
- package/dist/sankhyablocks/p-ebe876f5.entry.js +0 -1
- package/dist/sankhyablocks/p-ed438690.js +0 -1
- package/dist/sankhyablocks/p-ee82c157.entry.js +0 -1
- package/dist/sankhyablocks/p-f3d0c744.entry.js +0 -1
- package/dist/sankhyablocks/p-fac37198.entry.js +0 -1
@@ -1,313 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const index = require('./index-21bd01e1.js');
|
4
|
-
const index$1 = require('./index-f400b1d6.js');
|
5
|
-
|
6
|
-
const appendToMap = (map, propName, value) => {
|
7
|
-
const items = map.get(propName);
|
8
|
-
if (!items) {
|
9
|
-
map.set(propName, [value]);
|
10
|
-
}
|
11
|
-
else if (!items.includes(value)) {
|
12
|
-
items.push(value);
|
13
|
-
}
|
14
|
-
};
|
15
|
-
const debounce = (fn, ms) => {
|
16
|
-
let timeoutId;
|
17
|
-
return (...args) => {
|
18
|
-
if (timeoutId) {
|
19
|
-
clearTimeout(timeoutId);
|
20
|
-
}
|
21
|
-
timeoutId = setTimeout(() => {
|
22
|
-
timeoutId = 0;
|
23
|
-
fn(...args);
|
24
|
-
}, ms);
|
25
|
-
};
|
26
|
-
};
|
27
|
-
|
28
|
-
/**
|
29
|
-
* Check if a possible element isConnected.
|
30
|
-
* The property might not be there, so we check for it.
|
31
|
-
*
|
32
|
-
* We want it to return true if isConnected is not a property,
|
33
|
-
* otherwise we would remove these elements and would not update.
|
34
|
-
*
|
35
|
-
* Better leak in Edge than to be useless.
|
36
|
-
*/
|
37
|
-
const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
38
|
-
const cleanupElements = debounce((map) => {
|
39
|
-
for (let key of map.keys()) {
|
40
|
-
map.set(key, map.get(key).filter(isConnected));
|
41
|
-
}
|
42
|
-
}, 2000);
|
43
|
-
const stencilSubscription = () => {
|
44
|
-
if (typeof index.getRenderingRef !== 'function') {
|
45
|
-
// If we are not in a stencil project, we do nothing.
|
46
|
-
// This function is not really exported by @stencil/core.
|
47
|
-
return {};
|
48
|
-
}
|
49
|
-
const elmsToUpdate = new Map();
|
50
|
-
return {
|
51
|
-
dispose: () => elmsToUpdate.clear(),
|
52
|
-
get: (propName) => {
|
53
|
-
const elm = index.getRenderingRef();
|
54
|
-
if (elm) {
|
55
|
-
appendToMap(elmsToUpdate, propName, elm);
|
56
|
-
}
|
57
|
-
},
|
58
|
-
set: (propName) => {
|
59
|
-
const elements = elmsToUpdate.get(propName);
|
60
|
-
if (elements) {
|
61
|
-
elmsToUpdate.set(propName, elements.filter(index.forceUpdate));
|
62
|
-
}
|
63
|
-
cleanupElements(elmsToUpdate);
|
64
|
-
},
|
65
|
-
reset: () => {
|
66
|
-
elmsToUpdate.forEach((elms) => elms.forEach(index.forceUpdate));
|
67
|
-
cleanupElements(elmsToUpdate);
|
68
|
-
},
|
69
|
-
};
|
70
|
-
};
|
71
|
-
|
72
|
-
const unwrap = (val) => (typeof val === 'function' ? val() : val);
|
73
|
-
const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
|
74
|
-
const unwrappedState = unwrap(defaultState);
|
75
|
-
let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
|
76
|
-
const handlers = {
|
77
|
-
dispose: [],
|
78
|
-
get: [],
|
79
|
-
set: [],
|
80
|
-
reset: [],
|
81
|
-
};
|
82
|
-
const reset = () => {
|
83
|
-
var _a;
|
84
|
-
// When resetting the state, the default state may be a function - unwrap it to invoke it.
|
85
|
-
// otherwise, the state won't be properly reset
|
86
|
-
states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
|
87
|
-
handlers.reset.forEach((cb) => cb());
|
88
|
-
};
|
89
|
-
const dispose = () => {
|
90
|
-
// Call first dispose as resetting the state would
|
91
|
-
// cause less updates ;)
|
92
|
-
handlers.dispose.forEach((cb) => cb());
|
93
|
-
reset();
|
94
|
-
};
|
95
|
-
const get = (propName) => {
|
96
|
-
handlers.get.forEach((cb) => cb(propName));
|
97
|
-
return states.get(propName);
|
98
|
-
};
|
99
|
-
const set = (propName, value) => {
|
100
|
-
const oldValue = states.get(propName);
|
101
|
-
if (shouldUpdate(value, oldValue, propName)) {
|
102
|
-
states.set(propName, value);
|
103
|
-
handlers.set.forEach((cb) => cb(propName, value, oldValue));
|
104
|
-
}
|
105
|
-
};
|
106
|
-
const state = (typeof Proxy === 'undefined'
|
107
|
-
? {}
|
108
|
-
: new Proxy(unwrappedState, {
|
109
|
-
get(_, propName) {
|
110
|
-
return get(propName);
|
111
|
-
},
|
112
|
-
ownKeys(_) {
|
113
|
-
return Array.from(states.keys());
|
114
|
-
},
|
115
|
-
getOwnPropertyDescriptor() {
|
116
|
-
return {
|
117
|
-
enumerable: true,
|
118
|
-
configurable: true,
|
119
|
-
};
|
120
|
-
},
|
121
|
-
has(_, propName) {
|
122
|
-
return states.has(propName);
|
123
|
-
},
|
124
|
-
set(_, propName, value) {
|
125
|
-
set(propName, value);
|
126
|
-
return true;
|
127
|
-
},
|
128
|
-
}));
|
129
|
-
const on = (eventName, callback) => {
|
130
|
-
handlers[eventName].push(callback);
|
131
|
-
return () => {
|
132
|
-
removeFromArray(handlers[eventName], callback);
|
133
|
-
};
|
134
|
-
};
|
135
|
-
const onChange = (propName, cb) => {
|
136
|
-
const unSet = on('set', (key, newValue) => {
|
137
|
-
if (key === propName) {
|
138
|
-
cb(newValue);
|
139
|
-
}
|
140
|
-
});
|
141
|
-
// We need to unwrap the defaultState because it might be a function.
|
142
|
-
// Otherwise we might not be sending the right reset value.
|
143
|
-
const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
|
144
|
-
return () => {
|
145
|
-
unSet();
|
146
|
-
unReset();
|
147
|
-
};
|
148
|
-
};
|
149
|
-
const use = (...subscriptions) => {
|
150
|
-
const unsubs = subscriptions.reduce((unsubs, subscription) => {
|
151
|
-
if (subscription.set) {
|
152
|
-
unsubs.push(on('set', subscription.set));
|
153
|
-
}
|
154
|
-
if (subscription.get) {
|
155
|
-
unsubs.push(on('get', subscription.get));
|
156
|
-
}
|
157
|
-
if (subscription.reset) {
|
158
|
-
unsubs.push(on('reset', subscription.reset));
|
159
|
-
}
|
160
|
-
if (subscription.dispose) {
|
161
|
-
unsubs.push(on('dispose', subscription.dispose));
|
162
|
-
}
|
163
|
-
return unsubs;
|
164
|
-
}, []);
|
165
|
-
return () => unsubs.forEach((unsub) => unsub());
|
166
|
-
};
|
167
|
-
const forceUpdate = (key) => {
|
168
|
-
const oldValue = states.get(key);
|
169
|
-
handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
|
170
|
-
};
|
171
|
-
return {
|
172
|
-
state,
|
173
|
-
get,
|
174
|
-
set,
|
175
|
-
on,
|
176
|
-
onChange,
|
177
|
-
use,
|
178
|
-
dispose,
|
179
|
-
reset,
|
180
|
-
forceUpdate,
|
181
|
-
};
|
182
|
-
};
|
183
|
-
const removeFromArray = (array, item) => {
|
184
|
-
const index = array.indexOf(item);
|
185
|
-
if (index >= 0) {
|
186
|
-
array[index] = array[array.length - 1];
|
187
|
-
array.length--;
|
188
|
-
}
|
189
|
-
};
|
190
|
-
|
191
|
-
const createStore = (defaultState, shouldUpdate) => {
|
192
|
-
const map = createObservableMap(defaultState, shouldUpdate);
|
193
|
-
map.use(stencilSubscription());
|
194
|
-
return map;
|
195
|
-
};
|
196
|
-
|
197
|
-
const store = createStore({
|
198
|
-
exporterProviders: {}
|
199
|
-
});
|
200
|
-
|
201
|
-
exports.TaskbarElement = void 0;
|
202
|
-
(function (TaskbarElement) {
|
203
|
-
TaskbarElement["PREVIOUS"] = "PREVIOUS";
|
204
|
-
TaskbarElement["NEXT"] = "NEXT";
|
205
|
-
TaskbarElement["REFRESH"] = "REFRESH";
|
206
|
-
TaskbarElement["UPDATE"] = "UPDATE";
|
207
|
-
TaskbarElement["CLONE"] = "CLONE";
|
208
|
-
TaskbarElement["REMOVE"] = "REMOVE";
|
209
|
-
TaskbarElement["INSERT"] = "INSERT";
|
210
|
-
TaskbarElement["CANCEL"] = "CANCEL";
|
211
|
-
TaskbarElement["SAVE"] = "SAVE";
|
212
|
-
TaskbarElement["GRID_MODE"] = "GRID_MODE";
|
213
|
-
TaskbarElement["FORM_MODE"] = "FORM_MODE";
|
214
|
-
TaskbarElement["MORE_OPTIONS"] = "MORE_OPTIONS";
|
215
|
-
TaskbarElement["DIVIDER"] = "DIVIDER";
|
216
|
-
TaskbarElement["CONFIGURATOR"] = "CONFIGURATOR";
|
217
|
-
TaskbarElement["DATA_EXPORTER"] = "DATA_EXPORTER";
|
218
|
-
TaskbarElement["ATTACH"] = "ATTACH";
|
219
|
-
})(exports.TaskbarElement || (exports.TaskbarElement = {}));
|
220
|
-
exports.AuthorizationElements = void 0;
|
221
|
-
(function (AuthorizationElements) {
|
222
|
-
AuthorizationElements["UPDATE"] = "UPDATE";
|
223
|
-
AuthorizationElements["CLONE"] = "CLONE";
|
224
|
-
AuthorizationElements["REMOVE"] = "REMOVE";
|
225
|
-
AuthorizationElements["INSERT"] = "INSERT";
|
226
|
-
AuthorizationElements["CONFIGURATOR"] = "CONFIGURATOR";
|
227
|
-
})(exports.AuthorizationElements || (exports.AuthorizationElements = {}));
|
228
|
-
exports.VisibleWhenForbidden = void 0;
|
229
|
-
(function (VisibleWhenForbidden) {
|
230
|
-
VisibleWhenForbidden["CONFIGURATOR"] = "CONFIGURATOR";
|
231
|
-
})(exports.VisibleWhenForbidden || (exports.VisibleWhenForbidden = {}));
|
232
|
-
const buildCustomButton = (def, className, dataElementId, action, isEnabled) => {
|
233
|
-
const { hint, text, iconName } = def;
|
234
|
-
if (iconName) {
|
235
|
-
if (text) {
|
236
|
-
return iconTextButton(iconName, def.name, className, dataElementId, hint, text, action, isEnabled);
|
237
|
-
}
|
238
|
-
else {
|
239
|
-
return iconButton(iconName, def.name, className, dataElementId, hint, action, isEnabled);
|
240
|
-
}
|
241
|
-
}
|
242
|
-
else {
|
243
|
-
return textButton(def.name, className, dataElementId, text, hint, action, isEnabled);
|
244
|
-
}
|
245
|
-
};
|
246
|
-
const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, configName, presentationMode) => {
|
247
|
-
var _a;
|
248
|
-
const title = getTitle(element);
|
249
|
-
switch (element) {
|
250
|
-
case exports.TaskbarElement.PREVIOUS:
|
251
|
-
return iconButton("chevron-left", element, className, dataElementId, title, action, isEnabled);
|
252
|
-
case exports.TaskbarElement.NEXT:
|
253
|
-
return iconButton("chevron-right", element, className, dataElementId, title, action, isEnabled);
|
254
|
-
case exports.TaskbarElement.REFRESH:
|
255
|
-
return iconButton("sync", element, className, dataElementId, title, action, isEnabled);
|
256
|
-
case exports.TaskbarElement.UPDATE:
|
257
|
-
return iconButton("edit", element, className, dataElementId, title, action, isEnabled);
|
258
|
-
case exports.TaskbarElement.CLONE:
|
259
|
-
return iconButton("copy", element, className, dataElementId, title, action, isEnabled);
|
260
|
-
case exports.TaskbarElement.REMOVE:
|
261
|
-
return iconButton("delete", element, className, dataElementId, title, action, isEnabled);
|
262
|
-
case exports.TaskbarElement.INSERT:
|
263
|
-
if (presentationMode === index$1.PresentationMode.PRIMARY) {
|
264
|
-
return iconTextButton("plus", element, className, dataElementId, title, title, action, isEnabled);
|
265
|
-
}
|
266
|
-
else {
|
267
|
-
return iconButton("plus", element, className, dataElementId, title, action, isEnabled);
|
268
|
-
}
|
269
|
-
case exports.TaskbarElement.CANCEL:
|
270
|
-
return textButton(element, className, dataElementId, title, title, action, isEnabled);
|
271
|
-
case exports.TaskbarElement.SAVE:
|
272
|
-
if (presentationMode === index$1.PresentationMode.PRIMARY) {
|
273
|
-
return iconTextButton("save", element, className, dataElementId, title, title, action, isEnabled);
|
274
|
-
}
|
275
|
-
else {
|
276
|
-
return iconButton("save", element, className, dataElementId, title, action, isEnabled);
|
277
|
-
}
|
278
|
-
case exports.TaskbarElement.GRID_MODE:
|
279
|
-
return iconButton("table", element, className, dataElementId, title, action, isEnabled);
|
280
|
-
case exports.TaskbarElement.FORM_MODE:
|
281
|
-
return iconButton("list", element, className, dataElementId, title, action, isEnabled);
|
282
|
-
case exports.TaskbarElement.CONFIGURATOR:
|
283
|
-
return iconButton("settings-inverted", element, className, dataElementId, title, action, isEnabled);
|
284
|
-
case exports.TaskbarElement.MORE_OPTIONS:
|
285
|
-
return actionButton(element, className, dataElementId, title, action, isEnabled, actions);
|
286
|
-
case exports.TaskbarElement.DIVIDER:
|
287
|
-
return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
|
288
|
-
case exports.TaskbarElement.DATA_EXPORTER:
|
289
|
-
const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
|
290
|
-
return index.h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId });
|
291
|
-
case exports.TaskbarElement.ATTACH:
|
292
|
-
return iconButton("anexo", element, className, dataElementId, title, action, isEnabled);
|
293
|
-
}
|
294
|
-
};
|
295
|
-
function textButton(name, className, dataElementId, text, title, action, isEnabled) {
|
296
|
-
return index.h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
|
297
|
-
}
|
298
|
-
function iconButton(iconName, name, className, dataElementId, title, action, isEnabled) {
|
299
|
-
return index.h("ez-button", { title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
300
|
-
}
|
301
|
-
function iconTextButton(iconName, name, className, dataElementId, text, title, action, isEnabled) {
|
302
|
-
return index.h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
|
303
|
-
index.h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
304
|
-
}
|
305
|
-
function actionButton(element, className, dataElementId, title, action, isEnabled, actions) {
|
306
|
-
return actions && actions.length > 0
|
307
|
-
? index.h("ez-actions-button", { title: title, size: "small", "data-element-id": dataElementId, arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
|
308
|
-
: undefined;
|
309
|
-
}
|
310
|
-
|
311
|
-
exports.buildCustomButton = buildCustomButton;
|
312
|
-
exports.buildElem = buildElem;
|
313
|
-
exports.store = store;
|
@@ -1,173 +0,0 @@
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
-
import { FloatingManager, ElementIDUtils, ArrayUtils } from '@sankhyalabs/core';
|
3
|
-
|
4
|
-
const SHOW_MORE_ITEM_NAME = "__SHOWMORE__";
|
5
|
-
const MAX_FILTERS = 5;
|
6
|
-
const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
7
|
-
constructor() {
|
8
|
-
super();
|
9
|
-
this.__registerHost();
|
10
|
-
this.snkItemSelected = createEvent(this, "snkItemSelected", 7);
|
11
|
-
this._preselection = -1;
|
12
|
-
this.innerClickCheck = (_floatingContainer, node) => {
|
13
|
-
if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
|
14
|
-
return true;
|
15
|
-
}
|
16
|
-
this._detailIsVisible = false;
|
17
|
-
return false;
|
18
|
-
};
|
19
|
-
this._filterArgument = undefined;
|
20
|
-
this._showAll = undefined;
|
21
|
-
this.label = undefined;
|
22
|
-
this.iconName = undefined;
|
23
|
-
this.items = undefined;
|
24
|
-
this.getMessage = undefined;
|
25
|
-
this.emptyText = undefined;
|
26
|
-
this.findFilterText = undefined;
|
27
|
-
this.buttonClass = undefined;
|
28
|
-
}
|
29
|
-
showDetail() {
|
30
|
-
this._preselection = -1;
|
31
|
-
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, {
|
32
|
-
autoClose: true,
|
33
|
-
innerClickTest: this.innerClickCheck,
|
34
|
-
backClickListener: () => this.onListCloseCallback(),
|
35
|
-
useOverlay: true
|
36
|
-
});
|
37
|
-
this._detailIsVisible = true;
|
38
|
-
this._showAll = false;
|
39
|
-
this._filterArgument = "";
|
40
|
-
this._filterInput.setFocus();
|
41
|
-
}
|
42
|
-
/**
|
43
|
-
* Oculta os detalhes do componente snk-filter-list.
|
44
|
-
*/
|
45
|
-
async hideDetail() {
|
46
|
-
if (this._floatingID != undefined) {
|
47
|
-
FloatingManager.close(this._floatingID);
|
48
|
-
}
|
49
|
-
}
|
50
|
-
onListCloseCallback() {
|
51
|
-
this._floatingID = undefined;
|
52
|
-
this._detailIsVisible = false;
|
53
|
-
}
|
54
|
-
buttonClick() {
|
55
|
-
if (this._detailIsVisible) {
|
56
|
-
this.hideDetail();
|
57
|
-
}
|
58
|
-
else {
|
59
|
-
this.showDetail();
|
60
|
-
}
|
61
|
-
}
|
62
|
-
componentDidLoad() {
|
63
|
-
if (this._element) {
|
64
|
-
ElementIDUtils.addIDInfo(this._element);
|
65
|
-
}
|
66
|
-
}
|
67
|
-
componentDidRender() {
|
68
|
-
if (this._floatingID == undefined) {
|
69
|
-
if (this._popover) {
|
70
|
-
this._popover.remove();
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}
|
74
|
-
buildIdElement(buttonElement, name) {
|
75
|
-
if (!buttonElement)
|
76
|
-
return;
|
77
|
-
const dataElement = { id: name };
|
78
|
-
buttonElement.removeAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
79
|
-
ElementIDUtils.addIDInfoIfNotExists(buttonElement, "filterItemList", dataElement);
|
80
|
-
}
|
81
|
-
buildItemElement(item) {
|
82
|
-
const itemId = ++this._selectableItemsCount;
|
83
|
-
return (h("button", { ref: elem => elem && this.buildIdElement(elem, item.label), id: `filter-item${itemId}`, onFocusin: () => this._preselection = itemId, class: `ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item`, onClick: () => this.itemSelected(item.name), name: item.label, key: itemId }, item.iconName ? h("ez-icon", { iconName: item.iconName, size: "small", class: `ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${item.iconClass || ""}` }) : undefined, h("div", { class: `ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${item.labelClass || ""}` }, item.label)));
|
84
|
-
}
|
85
|
-
itemSelected(itemName) {
|
86
|
-
if (itemName === SHOW_MORE_ITEM_NAME) {
|
87
|
-
this._showAll = true;
|
88
|
-
}
|
89
|
-
else {
|
90
|
-
this.hideDetail();
|
91
|
-
this.snkItemSelected.emit(itemName);
|
92
|
-
}
|
93
|
-
}
|
94
|
-
getFilterItems() {
|
95
|
-
const items = this.items ? ArrayUtils.applyStringFilter(this._filterArgument, this.items.filter(item => item.kind === "FILTER")) : [];
|
96
|
-
if (items.length === 0) {
|
97
|
-
return h("div", { class: "ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-items-container--empty" }, this.emptyText);
|
98
|
-
}
|
99
|
-
const hideItems = !this._filterArgument && !this._showAll && (items.length > MAX_FILTERS + 1);
|
100
|
-
if (hideItems) {
|
101
|
-
items.splice(MAX_FILTERS);
|
102
|
-
items.push({ kind: "INTERNAL", label: "Mostrar mais", iconName: "dots-horizontal", name: SHOW_MORE_ITEM_NAME, iconClass: "snk-filter-bar__filter-list-item__icon--secondary", labelClass: "snk-filter-bar__filter-list-item__label--secondary" });
|
103
|
-
}
|
104
|
-
this._selectableItemsCount = 0;
|
105
|
-
return h("div", { class: "sc-snk-filter-bar snk-filter-bar__filter-list-items-container" }, items.map(item => this.buildItemElement(item)));
|
106
|
-
}
|
107
|
-
getFooterItems() {
|
108
|
-
return this.items.filter(item => item.kind === "FOOTER");
|
109
|
-
}
|
110
|
-
keyDownHandler(event) {
|
111
|
-
switch (event.key) {
|
112
|
-
case "ArrowDown":
|
113
|
-
this.changePreselection(this._preselection + 1);
|
114
|
-
//Paramos a propagação do evento para evitar scroll indesejado
|
115
|
-
event.stopImmediatePropagation();
|
116
|
-
event.stopPropagation();
|
117
|
-
event.preventDefault();
|
118
|
-
break;
|
119
|
-
case "ArrowUp":
|
120
|
-
this.changePreselection(this._preselection - 1);
|
121
|
-
//Paramos a propagação do evento para evitar scroll indesejado
|
122
|
-
event.stopImmediatePropagation();
|
123
|
-
event.stopPropagation();
|
124
|
-
event.preventDefault();
|
125
|
-
break;
|
126
|
-
}
|
127
|
-
}
|
128
|
-
changePreselection(newSelection) {
|
129
|
-
if (newSelection < 0) {
|
130
|
-
newSelection = this._selectableItemsCount;
|
131
|
-
}
|
132
|
-
this._preselection = newSelection > this._selectableItemsCount ? 0 : newSelection;
|
133
|
-
if (this._preselection === 0) {
|
134
|
-
this._filterInput.setFocus();
|
135
|
-
}
|
136
|
-
else {
|
137
|
-
const item = this._element.querySelector(`#filter-item${this._preselection}`);
|
138
|
-
if (item) {
|
139
|
-
item.focus();
|
140
|
-
}
|
141
|
-
}
|
142
|
-
}
|
143
|
-
render() {
|
144
|
-
return (h(Host, { class: "ez-flex ez-flex--column" }, h("ez-button", { class: this.buttonClass, label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, h("slot", { name: "leftIcon" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, h("ez-filter-input", { ref: ref => this._filterInput = ref, "data-element-id": "serachFilters", mode: "slim", label: this.findFilterText, value: this._filterArgument, onEzChange: (evt) => this._filterArgument = evt.detail, onFocus: () => this._preselection = 0 }), this.getFilterItems(), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
|
145
|
-
}
|
146
|
-
get _element() { return this; }
|
147
|
-
}, [4, "snk-filter-list", {
|
148
|
-
"label": [1],
|
149
|
-
"iconName": [1, "icon-name"],
|
150
|
-
"items": [16],
|
151
|
-
"getMessage": [16],
|
152
|
-
"emptyText": [1, "empty-text"],
|
153
|
-
"findFilterText": [1, "find-filter-text"],
|
154
|
-
"buttonClass": [1, "button-class"],
|
155
|
-
"_filterArgument": [32],
|
156
|
-
"_showAll": [32],
|
157
|
-
"hideDetail": [64]
|
158
|
-
}, [[2, "keydown", "keyDownHandler"]]]);
|
159
|
-
function defineCustomElement() {
|
160
|
-
if (typeof customElements === "undefined") {
|
161
|
-
return;
|
162
|
-
}
|
163
|
-
const components = ["snk-filter-list"];
|
164
|
-
components.forEach(tagName => { switch (tagName) {
|
165
|
-
case "snk-filter-list":
|
166
|
-
if (!customElements.get(tagName)) {
|
167
|
-
customElements.define(tagName, SnkFilterList);
|
168
|
-
}
|
169
|
-
break;
|
170
|
-
} });
|
171
|
-
}
|
172
|
-
|
173
|
-
export { SnkFilterList as S, defineCustomElement as d };
|
@@ -1,97 +0,0 @@
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
2
|
-
import { ModalAction, ModalButtonStatus } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
3
|
-
import { ArrayUtils } from '@sankhyalabs/core';
|
4
|
-
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
5
|
-
|
6
|
-
const snkFilterModalCss = ".snk-filter__modal-container{width:359px;max-width:359px}";
|
7
|
-
|
8
|
-
const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
9
|
-
constructor() {
|
10
|
-
super();
|
11
|
-
this.__registerHost();
|
12
|
-
this._filterArgument = undefined;
|
13
|
-
this.getMessage = undefined;
|
14
|
-
this.items = undefined;
|
15
|
-
this.modalTitle = undefined;
|
16
|
-
this.modalSubTitle = undefined;
|
17
|
-
this.cancelButtonLabel = undefined;
|
18
|
-
this.okButtonLabel = undefined;
|
19
|
-
this.infoText = undefined;
|
20
|
-
this.useSearch = undefined;
|
21
|
-
this.processModalAction = undefined;
|
22
|
-
}
|
23
|
-
updateValue(id, value = undefined) {
|
24
|
-
this.items = this.items.map(item => {
|
25
|
-
if (item.id === id && item.enabled) {
|
26
|
-
if (value == undefined) {
|
27
|
-
value = !item.active;
|
28
|
-
}
|
29
|
-
return Object.assign(Object.assign({}, item), { active: value });
|
30
|
-
}
|
31
|
-
return item;
|
32
|
-
});
|
33
|
-
}
|
34
|
-
getActiveFiltersMsg() {
|
35
|
-
const activeFilters = this.items.filter(item => item.active).length;
|
36
|
-
if (activeFilters === 0) {
|
37
|
-
return this.getMessage("snkFilterBar.noActiveFilters");
|
38
|
-
}
|
39
|
-
return this.getMessage(activeFilters > 1 ? "snkFilterBar.activeFilters" : "snkFilterBar.activeFilter", { ACTIVE_FILTERS: activeFilters });
|
40
|
-
}
|
41
|
-
buildItems(list) {
|
42
|
-
return list.map(item => {
|
43
|
-
return (h("button", { onClick: () => this.updateValue(item.id), class: "ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small" }, h("ez-check", { id: `checkbox_${item.id}`, tabIndex: -1, class: "sc-snk-filter-bar snk-filter-bar__filter-modal-item__check", onEzChange: evt => this.updateValue(item.id, evt.detail), enabled: item.enabled, value: item.active, mode: CheckMode.SWITCH }), h("div", { class: "ez-text ez-title--primary ez-text--medium ez-margin-left--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item__label" }, item.label)));
|
44
|
-
});
|
45
|
-
}
|
46
|
-
itemKeyBoardSelect(event, item) {
|
47
|
-
if (event.key === "Enter" || event.key === " ") {
|
48
|
-
this.updateValue(item.id);
|
49
|
-
}
|
50
|
-
}
|
51
|
-
modalActionListener(evt) {
|
52
|
-
const modalAction = evt.detail;
|
53
|
-
if (modalAction === ModalAction.LOAD) {
|
54
|
-
if (this._filterInput) {
|
55
|
-
this._filterInput.setFocus();
|
56
|
-
}
|
57
|
-
}
|
58
|
-
else {
|
59
|
-
this.processModalAction(modalAction);
|
60
|
-
}
|
61
|
-
}
|
62
|
-
render() {
|
63
|
-
const allowCancel = this.items.filter(item => item.active).length > 0;
|
64
|
-
const items = (this.items ? ArrayUtils.applyStringFilter(this._filterArgument, this.items) : []);
|
65
|
-
return (h("ez-modal-container", { class: "snk-filter__modal-container", modalTitle: this.modalTitle, modalSubTitle: this.modalSubTitle, cancelButtonLabel: this.cancelButtonLabel, okButtonLabel: this.okButtonLabel, onEzModalAction: evt => this.modalActionListener(evt), cancelButtonStatus: allowCancel ? ModalButtonStatus.ENABLED : ModalButtonStatus.DISABLED }, h("div", { class: "sc-snk-filter-bar snk-filter-bar__filter-modal-content" }, h("div", null, this.useSearch ?
|
66
|
-
h("ez-filter-input", { ref: ref => this._filterInput = ref, label: this.getMessage("snkFilterBar.modalFindFilter"), onEzChange: (evt) => this._filterArgument = evt.detail })
|
67
|
-
:
|
68
|
-
undefined), items.length > 0 ? h("div", { class: "ez-text ez-text--medium ez-text--primary ez-padding-bottom--small" }, this.getActiveFiltersMsg()) : undefined, h("div", null, this.buildItems(items)), h("div", { class: "ez-text ez-text--large ez-align--middle ez-text--secondary ez-text--center ez-padding-bottom--large" }, this.infoText))));
|
69
|
-
}
|
70
|
-
static get style() { return snkFilterModalCss; }
|
71
|
-
}, [0, "snk-filter-modal", {
|
72
|
-
"getMessage": [16],
|
73
|
-
"items": [1040],
|
74
|
-
"modalTitle": [1, "modal-title"],
|
75
|
-
"modalSubTitle": [1, "modal-sub-title"],
|
76
|
-
"cancelButtonLabel": [1, "cancel-button-label"],
|
77
|
-
"okButtonLabel": [1, "ok-button-label"],
|
78
|
-
"infoText": [1, "info-text"],
|
79
|
-
"useSearch": [4, "use-search"],
|
80
|
-
"processModalAction": [16],
|
81
|
-
"_filterArgument": [32]
|
82
|
-
}]);
|
83
|
-
function defineCustomElement() {
|
84
|
-
if (typeof customElements === "undefined") {
|
85
|
-
return;
|
86
|
-
}
|
87
|
-
const components = ["snk-filter-modal"];
|
88
|
-
components.forEach(tagName => { switch (tagName) {
|
89
|
-
case "snk-filter-modal":
|
90
|
-
if (!customElements.get(tagName)) {
|
91
|
-
customElements.define(tagName, SnkFilterModal);
|
92
|
-
}
|
93
|
-
break;
|
94
|
-
} });
|
95
|
-
}
|
96
|
-
|
97
|
-
export { SnkFilterModal as S, defineCustomElement as d };
|