@sankhyalabs/sankhyablocks 1.4.0-beta.1 → 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-7717f1e4.js → SnkMessageBuilder-6c2f7bcd.js} +107 -131
- 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-e2e1bc5b.js → filter-item-type.enum-3daf58d3.js} +2 -0
- package/dist/cjs/form-config-fetcher-2de7c16a.js +6895 -0
- package/dist/cjs/{index-b0b676c5.js → index-20e8b68a.js} +165 -1473
- package/dist/cjs/loader.cjs.js +2 -18
- package/dist/cjs/sankhyablocks.cjs.js +4 -116
- package/dist/cjs/snk-application.cjs.entry.js +330 -7196
- 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 +21 -13
- package/dist/cjs/snk-data-unit.cjs.entry.js +24 -32
- package/dist/cjs/snk-field-config_2.cjs.entry.js +135 -0
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +5 -2
- package/dist/cjs/snk-filter-detail.cjs.entry.js +62 -5
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +6 -3
- package/dist/cjs/snk-filter-number.cjs.entry.js +6 -3
- package/dist/cjs/snk-filter-period.cjs.entry.js +5 -2
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +89 -0
- package/dist/cjs/snk-filter-search.cjs.entry.js +7 -13
- package/dist/cjs/snk-filter-text.cjs.entry.js +2 -2
- package/dist/cjs/snk-form-config.cjs.entry.js +957 -0
- package/dist/cjs/snk-form.cjs.entry.js +41 -28
- package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
- package/dist/cjs/snk-tab-config.cjs.entry.js +321 -0
- package/dist/cjs/{taskbar-elements-283c737e.js → taskbar-elements-9a4b1e19.js} +10 -6
- package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
- package/dist/collection/collection-manifest.json +29 -1
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +1 -1
- package/dist/collection/components/snk-application/snk-application.js +236 -37
- 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.js +46 -17
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +1 -28
- 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 +23 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +24 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +24 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +23 -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 +22 -38
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +2 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +80 -20
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +65 -31
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +85 -19
- 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 +39 -4
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +250 -141
- package/dist/collection/components/snk-form/snk-form.css +4 -0
- package/dist/collection/components/snk-form/snk-form.js +108 -30
- 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.js +94 -26
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +9 -5
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +35 -3
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +3 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +35 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +18 -10
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +106 -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/index.js +1 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +11 -2
- 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-filter-bar.msg.js +14 -2
- package/dist/collection/lib/message/resources/snk-form.msg.js +59 -2
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -1
- package/dist/collection/lib/utils/CrudUtils.js +73 -0
- package/dist/collection/lib/utils/constants.js +72 -0
- package/dist/components/SnkMessageBuilder.js +108 -131
- package/dist/components/_commonjsHelpers.js +17 -0
- package/dist/components/constants.js +74 -0
- package/dist/components/filter-item-type.enum.js +2 -0
- package/dist/{sankhyablocks/snk-application.entry.js → components/form-config-fetcher.js} +88 -1347
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +8 -4
- package/dist/components/snk-application2.js +313 -7173
- 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.js +76 -26
- package/dist/components/snk-data-unit.js +4 -13
- 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-bar2.js +354 -148
- package/dist/components/snk-filter-binary-select.js +5 -1
- package/dist/components/snk-filter-detail2.js +62 -5
- package/dist/components/snk-filter-item2.js +52 -33
- package/dist/components/snk-filter-list2.js +60 -22
- 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.js +6 -2
- package/dist/components/snk-filter-number.js +6 -2
- package/dist/components/snk-filter-period.js +5 -1
- 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.js +5 -12
- package/dist/components/snk-filter-text.js +1 -1
- 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-form2.js +79 -29
- package/dist/components/snk-grid2.js +57 -32
- package/dist/components/snk-pesquisa2.js +1 -1
- 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-taskbar2.js +28 -10
- package/dist/components/teste-pesquisa.js +1 -1
- package/dist/{sankhyablocks/SnkMessageBuilder-a7da466b.js → esm/SnkMessageBuilder-5792c260.js} +108 -131
- 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-61fbf80a.js → filter-item-type.enum-a79b2fa8.js} +2 -0
- package/dist/esm/form-config-fetcher-96c6c2dc.js +6889 -0
- package/dist/{sankhyablocks/index-2b4d2d14.js → esm/index-e4121713.js} +165 -1466
- package/dist/esm/loader.js +2 -18
- package/dist/esm/sankhyablocks.js +4 -116
- package/dist/esm/snk-application.entry.js +308 -7174
- 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 +20 -12
- package/dist/esm/snk-data-unit.entry.js +5 -13
- package/dist/esm/snk-field-config_2.entry.js +130 -0
- package/dist/esm/snk-filter-binary-select.entry.js +5 -2
- package/dist/esm/snk-filter-detail.entry.js +62 -5
- package/dist/esm/snk-filter-multi-select.entry.js +6 -3
- package/dist/esm/snk-filter-number.entry.js +6 -3
- package/dist/esm/snk-filter-period.entry.js +5 -2
- package/dist/esm/snk-filter-personalized.entry.js +85 -0
- package/dist/esm/snk-filter-search.entry.js +6 -12
- package/dist/esm/snk-filter-text.entry.js +2 -2
- package/dist/esm/snk-form-config.entry.js +953 -0
- package/dist/esm/snk-form.entry.js +40 -27
- package/dist/esm/snk-pesquisa.entry.js +2 -2
- package/dist/esm/snk-tab-config.entry.js +317 -0
- package/dist/{sankhyablocks/taskbar-elements-35d64ff9.js → esm/taskbar-elements-e2ed0536.js} +10 -6
- package/dist/esm/teste-pesquisa.entry.js +2 -2
- package/dist/sankhyablocks/index.esm.js +0 -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-44ce5b90.entry.js +1 -0
- package/dist/sankhyablocks/p-521c96f0.entry.js +1 -0
- package/dist/sankhyablocks/p-6988f4a6.entry.js +1 -0
- 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 -129
- package/dist/types/components/snk-application/snk-application.d.ts +38 -16
- 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 +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +1 -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 +4 -5
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +3 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +7 -1
- 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 +8 -3
- 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 +31 -17
- 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 +6 -5
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -3
- package/dist/types/components.d.ts +424 -24
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +21 -3
- 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/index.d.ts +1 -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-form.msg.d.ts +5 -2
- 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/package.json +4 -3
- package/react/components.d.ts +25 -0
- package/react/components.js +25 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-b8158822.js +0 -6
- package/dist/cjs/dom-36862b77.js +0 -75
- package/dist/cjs/index-02201bc9.js +0 -2397
- package/dist/cjs/shadow-css-346c0795.js +0 -389
- package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -278
- package/dist/cjs/snk-filter-item.cjs.entry.js +0 -154
- package/dist/cjs/snk-filter-list.cjs.entry.js +0 -91
- package/dist/cjs/snk-grid.cjs.entry.js +0 -79
- package/dist/cjs/snk-taskbar.cjs.entry.js +0 -160
- package/dist/components/index2.js +0 -2384
- package/dist/esm/SnkMessageBuilder-a7da466b.js +0 -303
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/css-shim-b3f2ee8d.js +0 -4
- package/dist/esm/dom-665d6011.js +0 -73
- package/dist/esm/index-2b4d2d14.js +0 -3262
- package/dist/esm/index-f1d3e4da.js +0 -2384
- package/dist/esm/shadow-css-b18e99d7.js +0 -387
- package/dist/esm/snk-filter-bar.entry.js +0 -274
- package/dist/esm/snk-filter-item.entry.js +0 -150
- package/dist/esm/snk-filter-list.entry.js +0 -87
- package/dist/esm/snk-grid.entry.js +0 -75
- package/dist/esm/snk-taskbar.entry.js +0 -156
- package/dist/esm/taskbar-elements-35d64ff9.js +0 -90
- package/dist/sankhyablocks/app-globals-0f993ce5.js +0 -3
- package/dist/sankhyablocks/css-shim-b3f2ee8d.js +0 -4
- package/dist/sankhyablocks/dom-665d6011.js +0 -73
- package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +0 -12
- package/dist/sankhyablocks/index-f1d3e4da.js +0 -2384
- package/dist/sankhyablocks/shadow-css-b18e99d7.js +0 -387
- package/dist/sankhyablocks/snk-crud.entry.js +0 -66
- package/dist/sankhyablocks/snk-data-unit.entry.js +0 -276
- package/dist/sankhyablocks/snk-filter-bar.entry.js +0 -274
- package/dist/sankhyablocks/snk-filter-binary-select.entry.js +0 -43
- package/dist/sankhyablocks/snk-filter-detail.entry.js +0 -45
- package/dist/sankhyablocks/snk-filter-item.entry.js +0 -150
- package/dist/sankhyablocks/snk-filter-list.entry.js +0 -87
- package/dist/sankhyablocks/snk-filter-multi-select.entry.js +0 -19
- package/dist/sankhyablocks/snk-filter-number.entry.js +0 -20
- package/dist/sankhyablocks/snk-filter-period.entry.js +0 -33
- package/dist/sankhyablocks/snk-filter-search.entry.js +0 -40
- package/dist/sankhyablocks/snk-filter-text.entry.js +0 -18
- package/dist/sankhyablocks/snk-form.entry.js +0 -129
- package/dist/sankhyablocks/snk-grid.entry.js +0 -75
- package/dist/sankhyablocks/snk-pesquisa.entry.js +0 -311
- package/dist/sankhyablocks/snk-taskbar.entry.js +0 -156
- package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +0 -45
- package/dist/sankhyablocks/teste-pesquisa.entry.js +0 -33
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
2
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
|
3
4
|
|
|
4
5
|
const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -7,6 +8,9 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
7
8
|
this.__registerHost();
|
|
8
9
|
this.filterChange = createEvent(this, "filterChange", 7);
|
|
9
10
|
}
|
|
11
|
+
async show() {
|
|
12
|
+
this._editor["show"]();
|
|
13
|
+
}
|
|
10
14
|
changeConfig(newConfig) {
|
|
11
15
|
this.filterChange.emit(newConfig);
|
|
12
16
|
}
|
|
@@ -22,6 +26,8 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
22
26
|
return "snk-filter-search";
|
|
23
27
|
case FilterItemType.NUMBER:
|
|
24
28
|
return "snk-filter-number";
|
|
29
|
+
case FilterItemType.PERSONALIZED:
|
|
30
|
+
return "snk-filter-personalized";
|
|
25
31
|
}
|
|
26
32
|
return "snk-filter-text";
|
|
27
33
|
}
|
|
@@ -33,18 +39,69 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
33
39
|
return undefined;
|
|
34
40
|
}
|
|
35
41
|
return ([
|
|
36
|
-
|
|
37
|
-
|
|
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 })))
|
|
38
44
|
]);
|
|
39
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
|
+
}
|
|
40
97
|
render() {
|
|
41
98
|
const ContentEditor = this.getContentEditor();
|
|
42
|
-
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,
|
|
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" }))));
|
|
43
100
|
}
|
|
44
101
|
}, [0, "snk-filter-detail", {
|
|
45
102
|
"config": [1040],
|
|
46
|
-
"
|
|
47
|
-
"
|
|
103
|
+
"getMessage": [16],
|
|
104
|
+
"show": [64]
|
|
48
105
|
}]);
|
|
49
106
|
function defineCustomElement() {
|
|
50
107
|
if (typeof customElements === "undefined") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { FloatingManager } from '@sankhyalabs/core';
|
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
|
4
4
|
import { d as defineCustomElement$1 } from './snk-filter-detail2.js';
|
|
5
5
|
|
|
@@ -8,46 +8,52 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
8
8
|
super();
|
|
9
9
|
this.__registerHost();
|
|
10
10
|
this.filterChange = createEvent(this, "filterChange", 7);
|
|
11
|
-
this.innerClickCheck = (
|
|
12
|
-
if (
|
|
11
|
+
this.innerClickCheck = (_floatingContainer, node) => {
|
|
12
|
+
if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
|
|
13
13
|
return true;
|
|
14
14
|
}
|
|
15
|
-
if (node && floatingContainer) {
|
|
16
|
-
if (!node.offsetParent) {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
let current = node;
|
|
20
|
-
do {
|
|
21
|
-
if (current === floatingContainer) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
} while ((current = current.offsetParent) != null);
|
|
25
|
-
}
|
|
26
15
|
this.detailIsVisible = false;
|
|
27
16
|
return false;
|
|
28
17
|
};
|
|
29
18
|
}
|
|
30
19
|
async showUp(open = false) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
this.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
+
});
|
|
41
37
|
}
|
|
42
38
|
getScrollOffset() {
|
|
43
|
-
|
|
39
|
+
const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
|
|
40
|
+
const rect = this._filterItemElement.getBoundingClientRect();
|
|
41
|
+
return `calc(${rect.left}px + ${padding})`;
|
|
44
42
|
}
|
|
45
|
-
hideDetail() {
|
|
46
|
-
if (this.
|
|
47
|
-
|
|
43
|
+
async hideDetail() {
|
|
44
|
+
if (this.detailIsVisible) {
|
|
45
|
+
if (this._floatingID != undefined) {
|
|
46
|
+
FloatingManager.close(this._floatingID);
|
|
47
|
+
}
|
|
48
48
|
}
|
|
49
|
+
}
|
|
50
|
+
onDetailCloseCallback() {
|
|
49
51
|
this._floatingID = undefined;
|
|
50
52
|
this.detailIsVisible = false;
|
|
53
|
+
if (this._closeCallback) {
|
|
54
|
+
this._closeCallback();
|
|
55
|
+
this._closeCallback = undefined;
|
|
56
|
+
}
|
|
51
57
|
}
|
|
52
58
|
//---------------------------------------------
|
|
53
59
|
// Event handlers
|
|
@@ -62,7 +68,7 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
62
68
|
this.hideDetail();
|
|
63
69
|
}
|
|
64
70
|
else {
|
|
65
|
-
this.
|
|
71
|
+
this.showUp(true);
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
evt.preventDefault();
|
|
@@ -122,6 +128,9 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
122
128
|
if (type === FilterItemType.SEARCH) {
|
|
123
129
|
return `${label}: ${value.value} - ${value.label}`;
|
|
124
130
|
}
|
|
131
|
+
if (type === FilterItemType.PERSONALIZED) {
|
|
132
|
+
return label;
|
|
133
|
+
}
|
|
125
134
|
return `${label}: ${value}`;
|
|
126
135
|
}
|
|
127
136
|
return label;
|
|
@@ -136,22 +145,32 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
136
145
|
filterChangeListener() {
|
|
137
146
|
this.hideDetail();
|
|
138
147
|
}
|
|
139
|
-
|
|
148
|
+
getRightIconName() {
|
|
140
149
|
if (this.config.value != undefined) {
|
|
141
150
|
return "close";
|
|
142
151
|
}
|
|
143
152
|
return this.detailIsVisible ? "chevron-up" : "chevron-down";
|
|
144
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
|
+
}
|
|
145
163
|
render() {
|
|
146
|
-
const leftIcon = this.
|
|
147
|
-
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.
|
|
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 }))));
|
|
148
166
|
}
|
|
149
167
|
get _filterItemElement() { return this; }
|
|
150
168
|
}, [0, "snk-filter-item", {
|
|
151
169
|
"config": [1040],
|
|
152
170
|
"getMessage": [16],
|
|
153
171
|
"detailIsVisible": [32],
|
|
154
|
-
"showUp": [64]
|
|
172
|
+
"showUp": [64],
|
|
173
|
+
"hideDetail": [64]
|
|
155
174
|
}, [[2, "click", "clickListener"], [2, "mousedown", "mouseDownListener"], [0, "filterChange", "filterChangeListener"]]]);
|
|
156
175
|
function defineCustomElement() {
|
|
157
176
|
if (typeof customElements === "undefined") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { FloatingManager, ArrayUtils } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
4
|
const SHOW_MORE_ITEM_NAME = "__SHOWMORE__";
|
|
5
5
|
const MAX_FILTERS = 5;
|
|
@@ -8,41 +8,43 @@ const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
8
8
|
super();
|
|
9
9
|
this.__registerHost();
|
|
10
10
|
this.snkItemSelected = createEvent(this, "snkItemSelected", 7);
|
|
11
|
-
this.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
let current = node;
|
|
17
|
-
do {
|
|
18
|
-
if (current === floatingContainer || current === this._element) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
} while ((current = current.offsetParent) != null);
|
|
11
|
+
this._preselection = -1;
|
|
12
|
+
this.innerClickCheck = (_floatingContainer, node) => {
|
|
13
|
+
if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
|
|
14
|
+
return true;
|
|
22
15
|
}
|
|
23
16
|
this._detailIsVisible = false;
|
|
24
17
|
return false;
|
|
25
18
|
};
|
|
26
19
|
}
|
|
27
|
-
|
|
28
|
-
this.
|
|
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
|
+
});
|
|
29
28
|
this._detailIsVisible = true;
|
|
30
29
|
this._showAll = false;
|
|
31
30
|
this._filterArgument = "";
|
|
31
|
+
this._filterInput.setFocus();
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
async hideDetail() {
|
|
34
34
|
if (this._floatingID != undefined) {
|
|
35
35
|
FloatingManager.close(this._floatingID);
|
|
36
36
|
}
|
|
37
|
+
}
|
|
38
|
+
onListCloseCallback() {
|
|
37
39
|
this._floatingID = undefined;
|
|
38
40
|
this._detailIsVisible = false;
|
|
39
41
|
}
|
|
40
42
|
buttonClick() {
|
|
41
43
|
if (this._detailIsVisible) {
|
|
42
|
-
this.
|
|
44
|
+
this.hideDetail();
|
|
43
45
|
}
|
|
44
46
|
else {
|
|
45
|
-
this.
|
|
47
|
+
this.showDetail();
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
componentDidRender() {
|
|
@@ -53,14 +55,15 @@ const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
buildItemElement(item) {
|
|
56
|
-
|
|
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)));
|
|
57
60
|
}
|
|
58
61
|
itemSelected(itemName) {
|
|
59
62
|
if (itemName === SHOW_MORE_ITEM_NAME) {
|
|
60
63
|
this._showAll = true;
|
|
61
64
|
}
|
|
62
65
|
else {
|
|
63
|
-
this.
|
|
66
|
+
this.hideDetail();
|
|
64
67
|
this.snkItemSelected.emit(itemName);
|
|
65
68
|
}
|
|
66
69
|
}
|
|
@@ -74,13 +77,47 @@ const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
74
77
|
items.splice(MAX_FILTERS);
|
|
75
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" });
|
|
76
79
|
}
|
|
80
|
+
this._selectableItemsCount = 0;
|
|
77
81
|
return h("div", { class: "sc-snk-filter-bar snk-filter-bar__filter-list-items-container" }, items.map(item => this.buildItemElement(item)));
|
|
78
82
|
}
|
|
79
83
|
getFooterItems() {
|
|
80
84
|
return this.items.filter(item => item.kind === "FOOTER");
|
|
81
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
|
+
}
|
|
82
119
|
render() {
|
|
83
|
-
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 }), this.getFilterItems(), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
|
|
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))));
|
|
84
121
|
}
|
|
85
122
|
get _element() { return this; }
|
|
86
123
|
}, [4, "snk-filter-list", {
|
|
@@ -92,8 +129,9 @@ const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
92
129
|
"findFilterText": [1, "find-filter-text"],
|
|
93
130
|
"buttonClass": [1, "button-class"],
|
|
94
131
|
"_filterArgument": [32],
|
|
95
|
-
"_showAll": [32]
|
|
96
|
-
|
|
132
|
+
"_showAll": [32],
|
|
133
|
+
"hideDetail": [64]
|
|
134
|
+
}, [[2, "keydown", "keyDownHandler"]]]);
|
|
97
135
|
function defineCustomElement() {
|
|
98
136
|
if (typeof customElements === "undefined") {
|
|
99
137
|
return;
|
|
@@ -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 };
|
|
@@ -9,15 +9,19 @@ const SnkFilterMultiSelect$1 = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
|
9
9
|
ezChangeListener(evt) {
|
|
10
10
|
this.value = evt.detail.value;
|
|
11
11
|
}
|
|
12
|
+
async show() {
|
|
13
|
+
this._comboElement.setFocus();
|
|
14
|
+
}
|
|
12
15
|
render() {
|
|
13
16
|
if (!this.config || this.config.type !== FilterItemType.MULTI_SELECT) {
|
|
14
17
|
return undefined;
|
|
15
18
|
}
|
|
16
|
-
return (h("ez-combo-box", { label: this.config.label, value: this.config.value, options: this.config.props.options }));
|
|
19
|
+
return (h("ez-combo-box", { ref: ref => this._comboElement = ref, label: this.config.label, value: this.config.value, options: this.config.props.options }));
|
|
17
20
|
}
|
|
18
21
|
}, [0, "snk-filter-multi-select", {
|
|
19
22
|
"value": [1544],
|
|
20
|
-
"config": [16]
|
|
23
|
+
"config": [16],
|
|
24
|
+
"show": [64]
|
|
21
25
|
}, [[0, "ezChange", "ezChangeListener"]]]);
|
|
22
26
|
function defineCustomElement$1() {
|
|
23
27
|
if (typeof customElements === "undefined") {
|
|
@@ -9,16 +9,20 @@ const SnkFilterPeriod = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
9
9
|
ezChangeListener(evt) {
|
|
10
10
|
this.value = evt.detail;
|
|
11
11
|
}
|
|
12
|
+
async show() {
|
|
13
|
+
this._numberElement.setFocus();
|
|
14
|
+
}
|
|
12
15
|
render() {
|
|
13
16
|
var _a;
|
|
14
17
|
if (!this.config || this.config.type !== FilterItemType.NUMBER) {
|
|
15
18
|
return undefined;
|
|
16
19
|
}
|
|
17
|
-
return (h("ez-number-input", { label: this.config.label, value: this.config.value, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision }));
|
|
20
|
+
return (h("ez-number-input", { ref: ref => this._numberElement = ref, label: this.config.label, value: this.config.value, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision }));
|
|
18
21
|
}
|
|
19
22
|
}, [0, "snk-filter-number", {
|
|
20
23
|
"config": [16],
|
|
21
|
-
"value": [2]
|
|
24
|
+
"value": [2],
|
|
25
|
+
"show": [64]
|
|
22
26
|
}, [[0, "ezChange", "ezChangeListener"]]]);
|
|
23
27
|
function defineCustomElement$1() {
|
|
24
28
|
if (typeof customElements === "undefined") {
|
|
@@ -23,6 +23,9 @@ const SnkFilterPeriod$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
23
23
|
}
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
+
async show() {
|
|
27
|
+
this._startDate.setFocus();
|
|
28
|
+
}
|
|
26
29
|
render() {
|
|
27
30
|
if (!this.config || this.config.type !== FilterItemType.PERIOD) {
|
|
28
31
|
return undefined;
|
|
@@ -31,7 +34,8 @@ const SnkFilterPeriod$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
31
34
|
}
|
|
32
35
|
}, [0, "snk-filter-period", {
|
|
33
36
|
"config": [16],
|
|
34
|
-
"value": [8]
|
|
37
|
+
"value": [8],
|
|
38
|
+
"show": [64]
|
|
35
39
|
}, [[0, "ezChange", "ezChangeListener"]]]);
|
|
36
40
|
function defineCustomElement$1() {
|
|
37
41
|
if (typeof customElements === "undefined") {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkFilterPersonalized extends Components.SnkFilterPersonalized, HTMLElement {}
|
|
4
|
+
export const SnkFilterPersonalized: {
|
|
5
|
+
prototype: SnkFilterPersonalized;
|
|
6
|
+
new (): SnkFilterPersonalized;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|