@sankhyalabs/sankhyablocks 1.3.34 → 1.4.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/SnkMessageBuilder-6c2f7bcd.js +302 -0
- package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
- package/dist/cjs/configurableElementsStorage-93459c72.js +20 -0
- package/dist/cjs/constants-9056ca9e.js +84 -0
- package/dist/cjs/draggable.bundle-82a25c06.js +6886 -0
- package/dist/cjs/filter-item-type.enum-3daf58d3.js +16 -0
- package/dist/cjs/form-config-fetcher-2de7c16a.js +6895 -0
- package/dist/cjs/{index-1133bc2a.js → index-20e8b68a.js} +964 -209
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/sankhyablocks.cjs.js +3 -3
- package/dist/cjs/snk-application.cjs.entry.js +680 -6994
- package/dist/cjs/snk-config-modal.cjs.entry.js +62 -0
- package/dist/cjs/snk-config-options.cjs.entry.js +230 -0
- package/dist/cjs/snk-configurator_6.cjs.entry.js +1156 -0
- package/dist/cjs/snk-crud.cjs.entry.js +78 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +272 -0
- package/dist/cjs/snk-field-config_2.cjs.entry.js +135 -0
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +50 -0
- package/dist/cjs/snk-filter-detail.cjs.entry.js +106 -0
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +26 -0
- package/dist/cjs/snk-filter-number.cjs.entry.js +27 -0
- package/dist/cjs/snk-filter-period.cjs.entry.js +40 -0
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +89 -0
- package/dist/cjs/snk-filter-search.cjs.entry.js +38 -0
- package/dist/cjs/snk-filter-text.cjs.entry.js +22 -0
- package/dist/cjs/snk-form-config.cjs.entry.js +957 -0
- package/dist/cjs/snk-form.cjs.entry.js +146 -0
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-tab-config.cjs.entry.js +321 -0
- package/dist/cjs/taskbar-elements-9a4b1e19.js +97 -0
- package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +45 -2
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +9 -2
- package/dist/collection/components/snk-application/snk-application.js +1346 -642
- package/dist/collection/components/snk-configurator/snk-configurator.js +261 -0
- package/dist/collection/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.js +16 -0
- package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.css +122 -0
- package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.js +137 -0
- package/dist/collection/components/snk-crud/snk-crud.css +6 -0
- package/dist/collection/components/snk-crud/snk-crud.js +232 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.css +6 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +517 -0
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +100 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +111 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +87 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +88 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +101 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +180 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +102 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +63 -0
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +12 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +178 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +289 -0
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +299 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +222 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +149 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +462 -0
- package/dist/collection/components/snk-form/snk-form.css +38 -0
- package/dist/collection/components/snk-form/snk-form.js +336 -0
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.css +9 -0
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.js +315 -0
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.css +164 -0
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +140 -0
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.css +185 -0
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +1062 -0
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.css +272 -0
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +476 -0
- package/dist/collection/components/snk-grid/snk-grid.css +18 -0
- package/dist/collection/components/snk-grid/snk-grid.js +273 -0
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +80 -79
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +90 -0
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +43 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +339 -0
- package/dist/collection/components/teste-pesquisa/teste-pesquisa.js +12 -9
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +39 -14
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +87 -21
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +62 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +106 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +15 -15
- package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +9 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js +47 -0
- package/dist/collection/lib/index.js +2 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +130 -0
- package/dist/collection/lib/message/resources/crud-utils.msg.js +4 -0
- package/dist/collection/lib/message/resources/snk-configurator.msg.js +11 -0
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +23 -0
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +30 -0
- package/dist/collection/lib/message/resources/snk-form.msg.js +67 -0
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +17 -0
- package/dist/collection/lib/utils/CrudUtils.js +73 -0
- package/dist/collection/lib/utils/constants.js +72 -0
- package/dist/components/SnkMessageBuilder.js +280 -0
- package/dist/components/_commonjsHelpers.js +17 -0
- package/dist/components/constants.js +74 -0
- package/dist/components/filter-item-type.enum.js +14 -0
- package/dist/components/form-config-fetcher.js +6889 -0
- package/dist/components/index.d.ts +26 -5
- package/dist/components/index.js +26 -0
- package/dist/components/snk-application2.js +681 -6980
- package/dist/components/snk-config-modal.d.ts +11 -0
- package/dist/components/snk-config-modal.js +6 -0
- package/dist/components/snk-config-modal2.js +91 -0
- package/dist/components/snk-config-options.d.ts +11 -0
- package/dist/components/snk-config-options.js +6 -0
- package/dist/components/snk-config-options2.js +245 -0
- package/dist/components/snk-configurator.d.ts +11 -0
- package/dist/components/snk-configurator.js +6 -0
- package/dist/components/snk-configurator2.js +212 -0
- package/dist/components/snk-crud.d.ts +11 -0
- package/dist/components/snk-crud.js +183 -0
- package/dist/components/snk-data-unit.d.ts +11 -0
- package/dist/components/snk-data-unit.js +294 -0
- package/dist/components/snk-field-config.d.ts +11 -0
- package/dist/components/snk-field-config.js +6 -0
- package/dist/components/snk-field-config2.js +70 -0
- package/dist/components/snk-filter-bar.d.ts +11 -0
- package/dist/components/snk-filter-bar.js +6 -0
- package/dist/components/snk-filter-bar2.js +516 -0
- package/dist/components/snk-filter-binary-select.d.ts +11 -0
- package/dist/components/snk-filter-binary-select.js +67 -0
- package/dist/components/snk-filter-detail.d.ts +11 -0
- package/dist/components/snk-filter-detail.js +6 -0
- package/dist/components/snk-filter-detail2.js +120 -0
- package/dist/components/snk-filter-item.d.ts +11 -0
- package/dist/components/snk-filter-item.js +6 -0
- package/dist/components/snk-filter-item2.js +194 -0
- package/dist/components/snk-filter-list.d.ts +11 -0
- package/dist/components/snk-filter-list.js +6 -0
- package/dist/components/snk-filter-list2.js +149 -0
- package/dist/components/snk-filter-modal.d.ts +11 -0
- package/dist/components/snk-filter-modal.js +6 -0
- package/dist/components/snk-filter-modal2.js +84 -0
- package/dist/components/snk-filter-multi-select.d.ts +11 -0
- package/dist/components/snk-filter-multi-select.js +43 -0
- package/dist/components/snk-filter-number.d.ts +11 -0
- package/dist/components/snk-filter-number.js +44 -0
- package/dist/components/snk-filter-period.d.ts +11 -0
- package/dist/components/snk-filter-period.js +57 -0
- package/dist/components/snk-filter-personalized.d.ts +11 -0
- package/dist/components/snk-filter-personalized.js +108 -0
- package/dist/components/snk-filter-search.d.ts +11 -0
- package/dist/components/snk-filter-search.js +55 -0
- package/dist/components/snk-filter-text.d.ts +11 -0
- package/dist/components/snk-filter-text.js +38 -0
- package/dist/components/snk-form-config.d.ts +11 -0
- package/dist/components/snk-form-config.js +6 -0
- package/dist/components/snk-form-config2.js +996 -0
- package/dist/components/snk-form.d.ts +11 -0
- package/dist/components/snk-form.js +6 -0
- package/dist/components/snk-form2.js +209 -0
- package/dist/components/snk-grid.d.ts +11 -0
- package/dist/components/snk-grid.js +6 -0
- package/dist/components/snk-grid2.js +152 -0
- package/dist/components/snk-tab-config.d.ts +11 -0
- package/dist/components/snk-tab-config.js +6 -0
- package/dist/components/snk-tab-config2.js +7220 -0
- package/dist/components/snk-taskbar.d.ts +11 -0
- package/dist/components/snk-taskbar.js +6 -0
- package/dist/components/snk-taskbar2.js +282 -0
- package/dist/components/taskbar-processor.js +45 -0
- package/dist/esm/SnkMessageBuilder-5792c260.js +280 -0
- package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
- package/dist/esm/configurableElementsStorage-cdc144b5.js +18 -0
- package/dist/esm/constants-c6039d3d.js +74 -0
- package/dist/esm/draggable.bundle-41d56f06.js +6884 -0
- package/dist/esm/filter-item-type.enum-a79b2fa8.js +14 -0
- package/dist/esm/form-config-fetcher-96c6c2dc.js +6889 -0
- package/dist/esm/{index-ffda6382.js → index-e4121713.js} +963 -210
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/sankhyablocks.js +3 -3
- package/dist/esm/snk-application.entry.js +667 -6981
- package/dist/esm/snk-config-modal.entry.js +58 -0
- package/dist/esm/snk-config-options.entry.js +226 -0
- package/dist/esm/snk-configurator_6.entry.js +1147 -0
- package/dist/esm/snk-crud.entry.js +74 -0
- package/dist/esm/snk-data-unit.entry.js +268 -0
- package/dist/esm/snk-field-config_2.entry.js +130 -0
- package/dist/esm/snk-filter-binary-select.entry.js +46 -0
- package/dist/esm/snk-filter-detail.entry.js +102 -0
- package/dist/esm/snk-filter-multi-select.entry.js +22 -0
- package/dist/esm/snk-filter-number.entry.js +23 -0
- package/dist/esm/snk-filter-period.entry.js +36 -0
- package/dist/esm/snk-filter-personalized.entry.js +85 -0
- package/dist/esm/snk-filter-search.entry.js +34 -0
- package/dist/esm/snk-filter-text.entry.js +18 -0
- package/dist/esm/snk-form-config.entry.js +953 -0
- package/dist/esm/snk-form.entry.js +142 -0
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-tab-config.entry.js +317 -0
- package/dist/esm/taskbar-elements-e2ed0536.js +94 -0
- package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/p-029ae4e4.entry.js +1 -0
- package/dist/sankhyablocks/p-03f9c407.js +1 -0
- package/dist/sankhyablocks/p-112455b1.js +1 -0
- package/dist/sankhyablocks/p-12ad2a19.entry.js +1 -0
- package/dist/sankhyablocks/p-1feabfc7.entry.js +1 -0
- package/dist/sankhyablocks/p-21c8929b.js +1 -0
- package/dist/sankhyablocks/p-2284c850.entry.js +1 -0
- package/dist/sankhyablocks/p-2b891c4a.entry.js +1 -0
- package/dist/sankhyablocks/p-2dc76d79.entry.js +1 -0
- package/dist/sankhyablocks/p-361299e8.js +26 -0
- package/dist/sankhyablocks/p-3a276f3d.entry.js +1 -0
- package/dist/sankhyablocks/p-400cc777.entry.js +1 -0
- package/dist/sankhyablocks/{p-2a7b4cb3.entry.js → p-44ce5b90.entry.js} +1 -1
- package/dist/sankhyablocks/p-521c96f0.entry.js +1 -0
- package/dist/sankhyablocks/{p-9520d78a.entry.js → p-6988f4a6.entry.js} +1 -1
- package/dist/sankhyablocks/p-776ff4d1.entry.js +1 -0
- package/dist/sankhyablocks/p-7b4a4a50.entry.js +1 -0
- package/dist/sankhyablocks/p-9ba3df4c.js +2 -0
- package/dist/sankhyablocks/p-9dc4426d.entry.js +1 -0
- package/dist/sankhyablocks/p-9dd2b8cb.js +1 -0
- package/dist/sankhyablocks/p-a17a4fca.entry.js +1 -0
- package/dist/sankhyablocks/p-a5b26df2.js +1 -0
- package/dist/sankhyablocks/p-b6d6b172.js +1 -0
- package/dist/sankhyablocks/p-cc4bef9f.entry.js +1 -0
- package/dist/sankhyablocks/p-d50651a3.js +1 -0
- package/dist/sankhyablocks/p-d690b6b5.entry.js +75 -0
- package/dist/sankhyablocks/p-d9fbb26f.js +1 -0
- package/dist/sankhyablocks/p-deb1f523.entry.js +1 -0
- package/dist/sankhyablocks/p-e871aa92.entry.js +1 -0
- package/dist/sankhyablocks/p-e9beab79.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/errorhandler/snk-error-handler.d.ts +1 -0
- package/dist/types/components/snk-application/snk-application.d.ts +178 -26
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +46 -0
- package/dist/types/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.d.ts +8 -0
- package/dist/types/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.d.ts +38 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +50 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +92 -0
- package/dist/types/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +13 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +9 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +9 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +15 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +24 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +11 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +8 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +11 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +20 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +40 -0
- package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +45 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +26 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +65 -0
- package/dist/types/components/snk-form/snk-form.d.ts +71 -0
- package/dist/types/components/snk-form/subcomponents/snk-config-options/snk-config-options.d.ts +51 -0
- package/dist/types/components/snk-form/subcomponents/snk-field-config/snk-field-config.d.ts +32 -0
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +139 -0
- package/dist/types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.d.ts +97 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +59 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +30 -0
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +12 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +92 -0
- package/dist/types/components.d.ts +1100 -12
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +7 -6
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +21 -3
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +7 -7
- package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/totals-fetcher.d.ts +8 -0
- package/dist/types/lib/index.d.ts +2 -0
- package/dist/types/lib/message/SnkMessageBuilder.d.ts +42 -0
- package/dist/types/lib/message/resources/crud-utils.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-configurator.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-data-unit.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-form.msg.d.ts +5 -0
- package/dist/types/lib/message/resources/snk-taskbar.msg.d.ts +2 -0
- package/dist/types/lib/utils/CrudUtils.d.ts +6 -0
- package/dist/types/lib/utils/constants.d.ts +76 -0
- package/dist/types/lib/utils/pesquisa.d.ts +2 -1
- package/dist/types/stencil-public-runtime.d.ts +15 -4
- package/loader/package.json +1 -0
- package/package.json +6 -5
- package/react/components.d.ts +23 -0
- package/react/components.js +23 -0
- package/react/components.js.map +1 -1
- package/dist/sankhyablocks/p-98e8490d.entry.js +0 -69
- package/dist/sankhyablocks/p-edcb9d8e.js +0 -2
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
3
|
+
import { F as FilterItemType } from './filter-item-type.enum.js';
|
|
4
|
+
|
|
5
|
+
const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.filterChange = createEvent(this, "filterChange", 7);
|
|
10
|
+
}
|
|
11
|
+
async show() {
|
|
12
|
+
this._editor["show"]();
|
|
13
|
+
}
|
|
14
|
+
changeConfig(newConfig) {
|
|
15
|
+
this.filterChange.emit(newConfig);
|
|
16
|
+
}
|
|
17
|
+
getContentEditor() {
|
|
18
|
+
switch (this.config.type) {
|
|
19
|
+
case FilterItemType.BINARY_SELECT:
|
|
20
|
+
return "snk-filter-binary-select";
|
|
21
|
+
case FilterItemType.MULTI_SELECT:
|
|
22
|
+
return "snk-filter-multi-select";
|
|
23
|
+
case FilterItemType.PERIOD:
|
|
24
|
+
return "snk-filter-period";
|
|
25
|
+
case FilterItemType.SEARCH:
|
|
26
|
+
return "snk-filter-search";
|
|
27
|
+
case FilterItemType.NUMBER:
|
|
28
|
+
return "snk-filter-number";
|
|
29
|
+
case FilterItemType.PERSONALIZED:
|
|
30
|
+
return "snk-filter-personalized";
|
|
31
|
+
}
|
|
32
|
+
return "snk-filter-text";
|
|
33
|
+
}
|
|
34
|
+
removeItem() {
|
|
35
|
+
this.changeConfig(Object.assign(Object.assign({}, this.config), { visible: false, fixed: false, value: undefined }));
|
|
36
|
+
}
|
|
37
|
+
getPopUpHeaderButtons() {
|
|
38
|
+
if (this.config.hardFixed) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
return ([
|
|
42
|
+
this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()),
|
|
43
|
+
this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
buildIcon(title, iconName, action) {
|
|
47
|
+
return (h("button", { onClick: () => action(), class: "sc-snk-filter-bar snk-filter-item__editor-header-button" }, h("ez-icon", { title: title, iconName: iconName })));
|
|
48
|
+
}
|
|
49
|
+
apply() {
|
|
50
|
+
var _a;
|
|
51
|
+
let value = this._editor["value"];
|
|
52
|
+
let isValid = true;
|
|
53
|
+
if (this.config.type === FilterItemType.PERSONALIZED) {
|
|
54
|
+
const params = ((_a = this.config.props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || [];
|
|
55
|
+
const paramsCount = params.length;
|
|
56
|
+
if (paramsCount === 0) {
|
|
57
|
+
//Valor do filtro personalizado sem parametros deve ser um array vazio
|
|
58
|
+
value = [];
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
isValid = this.validateAllFilled(paramsCount, value);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (isValid) {
|
|
65
|
+
this.changeConfig(Object.assign(Object.assign({}, this.config), { value: value }));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/* WARNING: Temporário. Isso só está sendo feito até desconsiderar os parametros não informados para PersonalizedFilter*/
|
|
69
|
+
validateAllFilled(paramsCount, value) {
|
|
70
|
+
let isValid = true;
|
|
71
|
+
if (value != undefined && paramsCount > 1) {
|
|
72
|
+
if (paramsCount > value.length) {
|
|
73
|
+
isValid = false;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
value.forEach(item => {
|
|
77
|
+
if (item == undefined) {
|
|
78
|
+
isValid = false;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (!isValid) {
|
|
84
|
+
ApplicationUtils.alert("Filtro parcialmente preenchido", "Favor completar todas as informações do filtro.");
|
|
85
|
+
}
|
|
86
|
+
return isValid;
|
|
87
|
+
}
|
|
88
|
+
/* WARNING: Temporário.*/
|
|
89
|
+
clear() {
|
|
90
|
+
this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined }));
|
|
91
|
+
}
|
|
92
|
+
onKeyDonwListener(event) {
|
|
93
|
+
if (event.key === "Enter") {
|
|
94
|
+
this._applyButton.setFocus().then(() => this.apply());
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
render() {
|
|
98
|
+
const ContentEditor = this.getContentEditor();
|
|
99
|
+
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt) }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" }), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
|
|
100
|
+
}
|
|
101
|
+
}, [0, "snk-filter-detail", {
|
|
102
|
+
"config": [1040],
|
|
103
|
+
"getMessage": [16],
|
|
104
|
+
"show": [64]
|
|
105
|
+
}]);
|
|
106
|
+
function defineCustomElement() {
|
|
107
|
+
if (typeof customElements === "undefined") {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const components = ["snk-filter-detail"];
|
|
111
|
+
components.forEach(tagName => { switch (tagName) {
|
|
112
|
+
case "snk-filter-detail":
|
|
113
|
+
if (!customElements.get(tagName)) {
|
|
114
|
+
customElements.define(tagName, SnkFilterDetail);
|
|
115
|
+
}
|
|
116
|
+
break;
|
|
117
|
+
} });
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export { SnkFilterDetail as S, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkFilterItem extends Components.SnkFilterItem, HTMLElement {}
|
|
4
|
+
export const SnkFilterItem: {
|
|
5
|
+
prototype: SnkFilterItem;
|
|
6
|
+
new (): SnkFilterItem;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { FloatingManager } from '@sankhyalabs/core';
|
|
3
|
+
import { F as FilterItemType } from './filter-item-type.enum.js';
|
|
4
|
+
import { d as defineCustomElement$1 } from './snk-filter-detail2.js';
|
|
5
|
+
|
|
6
|
+
const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.filterChange = createEvent(this, "filterChange", 7);
|
|
11
|
+
this.innerClickCheck = (_floatingContainer, node) => {
|
|
12
|
+
if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
this.detailIsVisible = false;
|
|
16
|
+
return false;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async showUp(open = false) {
|
|
20
|
+
return new Promise(resolve => {
|
|
21
|
+
this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
|
|
22
|
+
if (open) {
|
|
23
|
+
this._closeCallback = resolve;
|
|
24
|
+
window.requestAnimationFrame(() => {
|
|
25
|
+
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, {
|
|
26
|
+
autoClose: true,
|
|
27
|
+
innerClickTest: this.innerClickCheck,
|
|
28
|
+
backClickListener: () => this.onDetailCloseCallback(),
|
|
29
|
+
left: this.getScrollOffset(),
|
|
30
|
+
useOverlay: true
|
|
31
|
+
});
|
|
32
|
+
this._popover.show();
|
|
33
|
+
this.detailIsVisible = true;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
getScrollOffset() {
|
|
39
|
+
const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
|
|
40
|
+
const rect = this._filterItemElement.getBoundingClientRect();
|
|
41
|
+
return `calc(${rect.left}px + ${padding})`;
|
|
42
|
+
}
|
|
43
|
+
async hideDetail() {
|
|
44
|
+
if (this.detailIsVisible) {
|
|
45
|
+
if (this._floatingID != undefined) {
|
|
46
|
+
FloatingManager.close(this._floatingID);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
onDetailCloseCallback() {
|
|
51
|
+
this._floatingID = undefined;
|
|
52
|
+
this.detailIsVisible = false;
|
|
53
|
+
if (this._closeCallback) {
|
|
54
|
+
this._closeCallback();
|
|
55
|
+
this._closeCallback = undefined;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//---------------------------------------------
|
|
59
|
+
// Event handlers
|
|
60
|
+
//---------------------------------------------
|
|
61
|
+
clickListener(evt) {
|
|
62
|
+
if ([this._chipElement, this._leftIconElement, this._rightIconElement].includes(evt.target)) {
|
|
63
|
+
if (evt.target === this._rightIconElement && this.config.value != undefined) {
|
|
64
|
+
this.filterChange.emit(Object.assign(Object.assign({}, this.config), { value: undefined }));
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
if (this.detailIsVisible) {
|
|
68
|
+
this.hideDetail();
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
this.showUp(true);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
evt.preventDefault();
|
|
75
|
+
evt.stopImmediatePropagation();
|
|
76
|
+
evt.stopPropagation();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
mouseDownListener(evt) {
|
|
80
|
+
if (this.detailIsVisible && [this._chipElement, this._leftIconElement, this._rightIconElement].includes(evt.target)) {
|
|
81
|
+
evt.preventDefault();
|
|
82
|
+
evt.stopImmediatePropagation();
|
|
83
|
+
evt.stopPropagation();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
getLabel() {
|
|
87
|
+
const { type, value, label, props } = this.config;
|
|
88
|
+
if (value) {
|
|
89
|
+
if (type === FilterItemType.BINARY_SELECT) {
|
|
90
|
+
const [optOne, optTwo] = props.options;
|
|
91
|
+
if (optOne.name === value) {
|
|
92
|
+
return optOne.label;
|
|
93
|
+
}
|
|
94
|
+
if (optTwo.name === value) {
|
|
95
|
+
return optTwo.label;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (type === FilterItemType.MULTI_SELECT) {
|
|
99
|
+
const opt = props.options.find(opt => opt.value === value);
|
|
100
|
+
return `${label}: ${opt.label}`;
|
|
101
|
+
}
|
|
102
|
+
if (type === FilterItemType.PERIOD) {
|
|
103
|
+
let { end, start } = value;
|
|
104
|
+
if (typeof end === "string") {
|
|
105
|
+
end = new Date(end);
|
|
106
|
+
end.setMinutes(end.getMinutes() + end.getTimezoneOffset());
|
|
107
|
+
}
|
|
108
|
+
if (typeof start === "string") {
|
|
109
|
+
start = new Date(start);
|
|
110
|
+
start.setMinutes(start.getMinutes() + start.getTimezoneOffset());
|
|
111
|
+
}
|
|
112
|
+
const dateFormater = new Intl.DateTimeFormat("pt-BR");
|
|
113
|
+
if (end && start) {
|
|
114
|
+
return `${label}: ${dateFormater.format(start)} a ${dateFormater.format(end)}`;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
if (start) {
|
|
118
|
+
return `${label}: A partir de ${dateFormater.format(start)}`;
|
|
119
|
+
}
|
|
120
|
+
else if (end) {
|
|
121
|
+
return `${label}: Até ${dateFormater.format(end)}`;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
return label;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (type === FilterItemType.SEARCH) {
|
|
129
|
+
return `${label}: ${value.value} - ${value.label}`;
|
|
130
|
+
}
|
|
131
|
+
if (type === FilterItemType.PERSONALIZED) {
|
|
132
|
+
return label;
|
|
133
|
+
}
|
|
134
|
+
return `${label}: ${value}`;
|
|
135
|
+
}
|
|
136
|
+
return label;
|
|
137
|
+
}
|
|
138
|
+
componentDidRender() {
|
|
139
|
+
if (this._floatingID == undefined) {
|
|
140
|
+
if (this._popover) {
|
|
141
|
+
this._popover.remove();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
filterChangeListener() {
|
|
146
|
+
this.hideDetail();
|
|
147
|
+
}
|
|
148
|
+
getRightIconName() {
|
|
149
|
+
if (this.config.value != undefined) {
|
|
150
|
+
return "close";
|
|
151
|
+
}
|
|
152
|
+
return this.detailIsVisible ? "chevron-up" : "chevron-down";
|
|
153
|
+
}
|
|
154
|
+
getLeftIconName() {
|
|
155
|
+
switch (this.config.type) {
|
|
156
|
+
case FilterItemType.PERIOD:
|
|
157
|
+
return "calendar";
|
|
158
|
+
case FilterItemType.PERSONALIZED:
|
|
159
|
+
return "tune";
|
|
160
|
+
}
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
render() {
|
|
164
|
+
const leftIcon = this.getLeftIconName();
|
|
165
|
+
return (h(Host, null, h("ez-chip", { ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.config.value != undefined }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem, key: this.config.id }))));
|
|
166
|
+
}
|
|
167
|
+
get _filterItemElement() { return this; }
|
|
168
|
+
}, [0, "snk-filter-item", {
|
|
169
|
+
"config": [1040],
|
|
170
|
+
"getMessage": [16],
|
|
171
|
+
"detailIsVisible": [32],
|
|
172
|
+
"showUp": [64],
|
|
173
|
+
"hideDetail": [64]
|
|
174
|
+
}, [[2, "click", "clickListener"], [2, "mousedown", "mouseDownListener"], [0, "filterChange", "filterChangeListener"]]]);
|
|
175
|
+
function defineCustomElement() {
|
|
176
|
+
if (typeof customElements === "undefined") {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const components = ["snk-filter-item", "snk-filter-detail"];
|
|
180
|
+
components.forEach(tagName => { switch (tagName) {
|
|
181
|
+
case "snk-filter-item":
|
|
182
|
+
if (!customElements.get(tagName)) {
|
|
183
|
+
customElements.define(tagName, SnkFilterItem);
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
case "snk-filter-detail":
|
|
187
|
+
if (!customElements.get(tagName)) {
|
|
188
|
+
defineCustomElement$1();
|
|
189
|
+
}
|
|
190
|
+
break;
|
|
191
|
+
} });
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export { SnkFilterItem as S, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkFilterList extends Components.SnkFilterList, HTMLElement {}
|
|
4
|
+
export const SnkFilterList: {
|
|
5
|
+
prototype: SnkFilterList;
|
|
6
|
+
new (): SnkFilterList;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { FloatingManager, 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
|
+
}
|
|
20
|
+
showDetail() {
|
|
21
|
+
this._preselection = -1;
|
|
22
|
+
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, {
|
|
23
|
+
autoClose: true,
|
|
24
|
+
innerClickTest: this.innerClickCheck,
|
|
25
|
+
backClickListener: () => this.onListCloseCallback(),
|
|
26
|
+
useOverlay: true
|
|
27
|
+
});
|
|
28
|
+
this._detailIsVisible = true;
|
|
29
|
+
this._showAll = false;
|
|
30
|
+
this._filterArgument = "";
|
|
31
|
+
this._filterInput.setFocus();
|
|
32
|
+
}
|
|
33
|
+
async hideDetail() {
|
|
34
|
+
if (this._floatingID != undefined) {
|
|
35
|
+
FloatingManager.close(this._floatingID);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
onListCloseCallback() {
|
|
39
|
+
this._floatingID = undefined;
|
|
40
|
+
this._detailIsVisible = false;
|
|
41
|
+
}
|
|
42
|
+
buttonClick() {
|
|
43
|
+
if (this._detailIsVisible) {
|
|
44
|
+
this.hideDetail();
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.showDetail();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
componentDidRender() {
|
|
51
|
+
if (this._floatingID == undefined) {
|
|
52
|
+
if (this._popover) {
|
|
53
|
+
this._popover.remove();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
buildItemElement(item) {
|
|
58
|
+
const itemId = ++this._selectableItemsCount;
|
|
59
|
+
return (h("button", { 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) }, 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)));
|
|
60
|
+
}
|
|
61
|
+
itemSelected(itemName) {
|
|
62
|
+
if (itemName === SHOW_MORE_ITEM_NAME) {
|
|
63
|
+
this._showAll = true;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this.hideDetail();
|
|
67
|
+
this.snkItemSelected.emit(itemName);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
getFilterItems() {
|
|
71
|
+
const items = this.items ? ArrayUtils.applyStringFilter(this._filterArgument, this.items.filter(item => item.kind === "FILTER")) : [];
|
|
72
|
+
if (items.length === 0) {
|
|
73
|
+
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);
|
|
74
|
+
}
|
|
75
|
+
const hideItems = !this._filterArgument && !this._showAll && (items.length > MAX_FILTERS + 1);
|
|
76
|
+
if (hideItems) {
|
|
77
|
+
items.splice(MAX_FILTERS);
|
|
78
|
+
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" });
|
|
79
|
+
}
|
|
80
|
+
this._selectableItemsCount = 0;
|
|
81
|
+
return h("div", { class: "sc-snk-filter-bar snk-filter-bar__filter-list-items-container" }, items.map(item => this.buildItemElement(item)));
|
|
82
|
+
}
|
|
83
|
+
getFooterItems() {
|
|
84
|
+
return this.items.filter(item => item.kind === "FOOTER");
|
|
85
|
+
}
|
|
86
|
+
keyDownHandler(event) {
|
|
87
|
+
switch (event.key) {
|
|
88
|
+
case "ArrowDown":
|
|
89
|
+
this.changePreselection(this._preselection + 1);
|
|
90
|
+
//Paramos a propagação do evento para evitar scroll indesejado
|
|
91
|
+
event.stopImmediatePropagation();
|
|
92
|
+
event.stopPropagation();
|
|
93
|
+
event.preventDefault();
|
|
94
|
+
break;
|
|
95
|
+
case "ArrowUp":
|
|
96
|
+
this.changePreselection(this._preselection - 1);
|
|
97
|
+
//Paramos a propagação do evento para evitar scroll indesejado
|
|
98
|
+
event.stopImmediatePropagation();
|
|
99
|
+
event.stopPropagation();
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
changePreselection(newSelection) {
|
|
105
|
+
if (newSelection < 0) {
|
|
106
|
+
newSelection = this._selectableItemsCount;
|
|
107
|
+
}
|
|
108
|
+
this._preselection = newSelection > this._selectableItemsCount ? 0 : newSelection;
|
|
109
|
+
if (this._preselection === 0) {
|
|
110
|
+
this._filterInput.setFocus();
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
const item = this._element.querySelector(`#filter-item${this._preselection}`);
|
|
114
|
+
if (item) {
|
|
115
|
+
item.focus();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
render() {
|
|
120
|
+
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, 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))));
|
|
121
|
+
}
|
|
122
|
+
get _element() { return this; }
|
|
123
|
+
}, [4, "snk-filter-list", {
|
|
124
|
+
"label": [1],
|
|
125
|
+
"iconName": [1, "icon-name"],
|
|
126
|
+
"items": [16],
|
|
127
|
+
"getMessage": [16],
|
|
128
|
+
"emptyText": [1, "empty-text"],
|
|
129
|
+
"findFilterText": [1, "find-filter-text"],
|
|
130
|
+
"buttonClass": [1, "button-class"],
|
|
131
|
+
"_filterArgument": [32],
|
|
132
|
+
"_showAll": [32],
|
|
133
|
+
"hideDetail": [64]
|
|
134
|
+
}, [[2, "keydown", "keyDownHandler"]]]);
|
|
135
|
+
function defineCustomElement() {
|
|
136
|
+
if (typeof customElements === "undefined") {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const components = ["snk-filter-list"];
|
|
140
|
+
components.forEach(tagName => { switch (tagName) {
|
|
141
|
+
case "snk-filter-list":
|
|
142
|
+
if (!customElements.get(tagName)) {
|
|
143
|
+
customElements.define(tagName, SnkFilterList);
|
|
144
|
+
}
|
|
145
|
+
break;
|
|
146
|
+
} });
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export { SnkFilterList as S, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkFilterModal extends Components.SnkFilterModal, HTMLElement {}
|
|
4
|
+
export const SnkFilterModal: {
|
|
5
|
+
prototype: SnkFilterModal;
|
|
6
|
+
new (): SnkFilterModal;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,84 @@
|
|
|
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 SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
}
|
|
11
|
+
updateValue(id, value = undefined) {
|
|
12
|
+
this.items = this.items.map(item => {
|
|
13
|
+
if (item.id === id && item.enabled) {
|
|
14
|
+
if (value == undefined) {
|
|
15
|
+
value = !item.active;
|
|
16
|
+
}
|
|
17
|
+
return Object.assign(Object.assign({}, item), { active: value });
|
|
18
|
+
}
|
|
19
|
+
return item;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
getActiveFiltersMsg() {
|
|
23
|
+
const activeFilters = this.items.filter(item => item.active).length;
|
|
24
|
+
if (activeFilters === 0) {
|
|
25
|
+
return this.getMessage("snkFilterBar.noActiveFilters");
|
|
26
|
+
}
|
|
27
|
+
return this.getMessage(activeFilters > 1 ? "snkFilterBar.activeFilters" : "snkFilterBar.activeFilter", { ACTIVE_FILTERS: activeFilters });
|
|
28
|
+
}
|
|
29
|
+
buildItems(list) {
|
|
30
|
+
return list.map(item => {
|
|
31
|
+
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)));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
itemKeyBoardSelect(event, item) {
|
|
35
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
36
|
+
this.updateValue(item.id);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
modalActionListener(evt) {
|
|
40
|
+
const modalAction = evt.detail;
|
|
41
|
+
if (modalAction === ModalAction.LOAD) {
|
|
42
|
+
if (this._filterInput) {
|
|
43
|
+
this._filterInput.setFocus();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.processModalAction(modalAction);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
const allowCancel = this.items.filter(item => item.active).length > 0;
|
|
52
|
+
const items = (this.items ? ArrayUtils.applyStringFilter(this._filterArgument, this.items) : []);
|
|
53
|
+
return (h("ez-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 ?
|
|
54
|
+
h("ez-filter-input", { ref: ref => this._filterInput = ref, label: this.getMessage("snkFilterBar.modalFindFilter"), onEzChange: (evt) => this._filterArgument = evt.detail })
|
|
55
|
+
:
|
|
56
|
+
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))));
|
|
57
|
+
}
|
|
58
|
+
}, [0, "snk-filter-modal", {
|
|
59
|
+
"getMessage": [16],
|
|
60
|
+
"items": [1040],
|
|
61
|
+
"modalTitle": [1, "modal-title"],
|
|
62
|
+
"modalSubTitle": [1, "modal-sub-title"],
|
|
63
|
+
"cancelButtonLabel": [1, "cancel-button-label"],
|
|
64
|
+
"okButtonLabel": [1, "ok-button-label"],
|
|
65
|
+
"infoText": [1, "info-text"],
|
|
66
|
+
"useSearch": [4, "use-search"],
|
|
67
|
+
"processModalAction": [16],
|
|
68
|
+
"_filterArgument": [32]
|
|
69
|
+
}]);
|
|
70
|
+
function defineCustomElement() {
|
|
71
|
+
if (typeof customElements === "undefined") {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const components = ["snk-filter-modal"];
|
|
75
|
+
components.forEach(tagName => { switch (tagName) {
|
|
76
|
+
case "snk-filter-modal":
|
|
77
|
+
if (!customElements.get(tagName)) {
|
|
78
|
+
customElements.define(tagName, SnkFilterModal);
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
} });
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { SnkFilterModal as S, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkFilterMultiSelect extends Components.SnkFilterMultiSelect, HTMLElement {}
|
|
4
|
+
export const SnkFilterMultiSelect: {
|
|
5
|
+
prototype: SnkFilterMultiSelect;
|
|
6
|
+
new (): SnkFilterMultiSelect;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { F as FilterItemType } from './filter-item-type.enum.js';
|
|
3
|
+
|
|
4
|
+
const SnkFilterMultiSelect$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
this.__registerHost();
|
|
8
|
+
}
|
|
9
|
+
ezChangeListener(evt) {
|
|
10
|
+
this.value = evt.detail.value;
|
|
11
|
+
}
|
|
12
|
+
async show() {
|
|
13
|
+
this._comboElement.setFocus();
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
if (!this.config || this.config.type !== FilterItemType.MULTI_SELECT) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return (h("ez-combo-box", { ref: ref => this._comboElement = ref, label: this.config.label, value: this.config.value, options: this.config.props.options }));
|
|
20
|
+
}
|
|
21
|
+
}, [0, "snk-filter-multi-select", {
|
|
22
|
+
"value": [1544],
|
|
23
|
+
"config": [16],
|
|
24
|
+
"show": [64]
|
|
25
|
+
}, [[0, "ezChange", "ezChangeListener"]]]);
|
|
26
|
+
function defineCustomElement$1() {
|
|
27
|
+
if (typeof customElements === "undefined") {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const components = ["snk-filter-multi-select"];
|
|
31
|
+
components.forEach(tagName => { switch (tagName) {
|
|
32
|
+
case "snk-filter-multi-select":
|
|
33
|
+
if (!customElements.get(tagName)) {
|
|
34
|
+
customElements.define(tagName, SnkFilterMultiSelect$1);
|
|
35
|
+
}
|
|
36
|
+
break;
|
|
37
|
+
} });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const SnkFilterMultiSelect = SnkFilterMultiSelect$1;
|
|
41
|
+
const defineCustomElement = defineCustomElement$1;
|
|
42
|
+
|
|
43
|
+
export { SnkFilterMultiSelect, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkFilterNumber extends Components.SnkFilterNumber, HTMLElement {}
|
|
4
|
+
export const SnkFilterNumber: {
|
|
5
|
+
prototype: SnkFilterNumber;
|
|
6
|
+
new (): SnkFilterNumber;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|