@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
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
min-width: 265px;
|
|
20
20
|
|
|
21
21
|
/*public*/
|
|
22
|
-
z-index: var(--more-visible,
|
|
22
|
+
z-index: var(--more-visible, 2);
|
|
23
23
|
background-color: var(--background--xlight, #fff);
|
|
24
24
|
border-radius: var(--border--radius-medium, 12px);
|
|
25
25
|
box-shadow: var(--shadow, 0px 0px 16px 0px #000);
|
|
@@ -46,7 +46,10 @@
|
|
|
46
46
|
|
|
47
47
|
.snk-filter-item__editor-header-button{
|
|
48
48
|
cursor: pointer;
|
|
49
|
-
|
|
49
|
+
background-color: transparent;
|
|
50
|
+
border: none;
|
|
51
|
+
padding: 3px;
|
|
52
|
+
outline-color: var(--color--primary);
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
.snk-filter-bar__divider{
|
|
@@ -62,6 +65,8 @@
|
|
|
62
65
|
.snk-filter-bar__filter-list-item{
|
|
63
66
|
cursor: pointer;
|
|
64
67
|
border-radius: var(--border--radius-small, 6px);
|
|
68
|
+
border: none;
|
|
69
|
+
background-color: transparent;
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
.snk-filter-bar__filter-list-item__label{
|
|
@@ -80,8 +85,8 @@
|
|
|
80
85
|
--ez-icon--color: var(--text--secondary);
|
|
81
86
|
}
|
|
82
87
|
|
|
83
|
-
.snk-filter-bar__filter-list-item
|
|
84
|
-
|
|
88
|
+
.snk-filter-bar__filter-list-item:focus-visible {
|
|
89
|
+
outline: none;
|
|
85
90
|
background-color: var(--background--medium);
|
|
86
91
|
}
|
|
87
92
|
|
|
@@ -111,4 +116,34 @@
|
|
|
111
116
|
left: 17px;
|
|
112
117
|
background-color: var(--icon--alert--color, #008561);
|
|
113
118
|
border-radius: 50%;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.snk-filter-bar__filter-modal-item{
|
|
122
|
+
--modal-item-border-width: 2px;
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: row;
|
|
125
|
+
margin-left: var(--modal-item-border-width);
|
|
126
|
+
border-radius: var(--border--radius-medium, 12px);
|
|
127
|
+
background-color: var(--background--medium, #f0f3f7);
|
|
128
|
+
border: none;
|
|
129
|
+
width: 100%;
|
|
130
|
+
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.snk-filter-bar__filter-modal-item:focus-visible{
|
|
134
|
+
outline: var(--color--primary) solid var(--modal-item-border-width);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.snk-filter-bar__filter-modal-item__check{
|
|
138
|
+
width: auto;
|
|
139
|
+
}
|
|
140
|
+
.snk-filter-bar__filter-modal-item__label{
|
|
141
|
+
font-weight: var(--text-weight--medium);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.snk-filter-bar__filter-modal-content{
|
|
145
|
+
display: grid;
|
|
146
|
+
grid-template-rows: auto auto 1fr auto;
|
|
147
|
+
width: 100%;
|
|
148
|
+
height: 100%;
|
|
114
149
|
}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { h, Host } from '@stencil/core';
|
|
2
|
-
import { ApplicationContext,
|
|
2
|
+
import { ApplicationContext, ErrorException, ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
|
3
3
|
import FilterItemType from './filter-item/filter-item-type.enum';
|
|
4
|
-
import {
|
|
4
|
+
import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
|
5
|
+
import buildFilter from './filter-item/dataunitfilter/data-unit-filter-builder';
|
|
5
6
|
const PERSONALIZED_FILTER = "PERSONALIZED_FILTER";
|
|
6
7
|
const DEFAULT_FILTER = "DEFAULT_FILTER";
|
|
7
8
|
const CLEAR_ALL_FILTERS = "CLEAR_ALL_FILTERS";
|
|
9
|
+
const ADD_FILTER = "ADD_FILTER";
|
|
10
|
+
const APPLIED_FILTERS = "APPLIED_FILTERS";
|
|
8
11
|
export class SnkFilterBar {
|
|
9
12
|
constructor() {
|
|
10
13
|
this._updateSequence = [];
|
|
14
|
+
this._loadingPending = false;
|
|
15
|
+
this._configUpdated = false;
|
|
16
|
+
this._pendingFilters = [];
|
|
11
17
|
this._calculateSortIndex = (item) => {
|
|
12
18
|
let index = item.hardFixed ? 1000000 : 0;
|
|
13
19
|
//campos Hard Fixed não variam a ordem
|
|
@@ -22,6 +28,54 @@ export class SnkFilterBar {
|
|
|
22
28
|
return this._calculateSortIndex(b) - this._calculateSortIndex(a);
|
|
23
29
|
};
|
|
24
30
|
}
|
|
31
|
+
observeFilterConfig(newValue, oldValue) {
|
|
32
|
+
if (oldValue != undefined && newValue == undefined) {
|
|
33
|
+
this._loadingPending = true;
|
|
34
|
+
this._configUpdated = true;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
const oldItems = new Map(oldValue ? oldValue.map(item => [item.id, item]) : undefined);
|
|
38
|
+
newValue.forEach(newItem => {
|
|
39
|
+
const oldItem = oldItems.get(newItem.id);
|
|
40
|
+
if (oldItem != undefined) {
|
|
41
|
+
this._configUpdated = this._configUpdated || ObjectUtils.objectToString(oldItem) != ObjectUtils.objectToString(newItem);
|
|
42
|
+
this._loadingPending = this._loadingPending || ObjectUtils.objectToString(oldItem.value) !== ObjectUtils.objectToString(newItem.value);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this._configUpdated = true;
|
|
46
|
+
this._loadingPending = this._loadingPending || newItem.value != undefined;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
this.processAfterUpdateConfig();
|
|
51
|
+
}
|
|
52
|
+
processPendingFilter() {
|
|
53
|
+
if (this._pendingFilters.length > 0 && this._currentPendingFilter == undefined) {
|
|
54
|
+
this._currentPendingFilter = this._element.querySelector("#filter-" + this._pendingFilters.pop());
|
|
55
|
+
if (this._currentPendingFilter) {
|
|
56
|
+
this._currentPendingFilter.showUp(true).then(() => {
|
|
57
|
+
this._currentPendingFilter = undefined;
|
|
58
|
+
this.processPendingFilter();
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (this._currentPendingFilter == undefined) {
|
|
63
|
+
this.processAfterUpdateConfig();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
processAfterUpdateConfig() {
|
|
67
|
+
if (this._pendingFilters.length > 0) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (this._loadingPending) {
|
|
71
|
+
this._loadingPending = false;
|
|
72
|
+
this.dataUnit.loadData();
|
|
73
|
+
}
|
|
74
|
+
if (this._configUpdated) {
|
|
75
|
+
this._configUpdated = false;
|
|
76
|
+
this._application.saveFilterBarConfig(this.filterConfig, this.configName);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
25
79
|
/**
|
|
26
80
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
27
81
|
* através de um pequeno modulo na estrutura da aplicação:
|
|
@@ -34,111 +88,43 @@ export class SnkFilterBar {
|
|
|
34
88
|
getFilter(_dataUnit) {
|
|
35
89
|
var _a;
|
|
36
90
|
const filters = [];
|
|
37
|
-
(_a = this.filterConfig) === null || _a === void 0 ? void 0 : _a.filter(item => item
|
|
38
|
-
const filter =
|
|
91
|
+
(_a = this.filterConfig) === null || _a === void 0 ? void 0 : _a.filter(item => this.isActiveFilter(item)).forEach(item => {
|
|
92
|
+
const filter = buildFilter(item);
|
|
39
93
|
if (filter) {
|
|
40
94
|
filters.push(filter);
|
|
41
95
|
}
|
|
42
96
|
});
|
|
43
97
|
return filters;
|
|
44
98
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (value && visible) {
|
|
48
|
-
if (type === FilterItemType.BINARY_SELECT) {
|
|
49
|
-
const options = props.options;
|
|
50
|
-
const selectedOption = options.find(opt => opt.name === value);
|
|
51
|
-
//FIXME: ajustar o backend para não exigir parametros
|
|
52
|
-
return { name: id, expression: selectedOption.expression, params: [] };
|
|
53
|
-
}
|
|
54
|
-
if (type === FilterItemType.MULTI_SELECT) {
|
|
55
|
-
return { name: id, expression: props.expression, params: [{ name: id, dataType: DataType.TEXT, value }] };
|
|
56
|
-
}
|
|
57
|
-
if (type === FilterItemType.PERIOD) {
|
|
58
|
-
let { end, start } = value;
|
|
59
|
-
if (typeof end === "string") {
|
|
60
|
-
end = new Date(end);
|
|
61
|
-
}
|
|
62
|
-
if (typeof start === "string") {
|
|
63
|
-
start = new Date(start);
|
|
64
|
-
}
|
|
65
|
-
const params = [];
|
|
66
|
-
let expression;
|
|
67
|
-
if (end && start) {
|
|
68
|
-
expression = props.expression.fullfill;
|
|
69
|
-
params.push({ name: `${id}.START`, dataType: DataType.DATE, value: toString(DataType.DATE, start) }, { name: `${id}.END`, dataType: DataType.DATE, value: toString(DataType.DATE, end) });
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
if (start) {
|
|
73
|
-
expression = props.expression.onlystart;
|
|
74
|
-
params.push({ name: id, dataType: DataType.DATE, value: toString(DataType.DATE, start) });
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
expression = props.expression.onlyend;
|
|
78
|
-
params.push({ name: id, dataType: DataType.DATE, value: toString(DataType.DATE, end) });
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return { name: id, expression, params };
|
|
82
|
-
}
|
|
83
|
-
if (type === FilterItemType.SEARCH) {
|
|
84
|
-
const expression = props.expression;
|
|
85
|
-
return { name: id, expression, params: [{ name: id, dataType: DataType.TEXT, value: toString(DataType.TEXT, value.value) }] };
|
|
86
|
-
}
|
|
87
|
-
if (type === FilterItemType.TEXT) {
|
|
88
|
-
const expression = props.expression;
|
|
89
|
-
return { name: id, expression, params: [{ name: id, dataType: DataType.TEXT, value: toString(DataType.TEXT, value) }] };
|
|
90
|
-
}
|
|
91
|
-
if (type === FilterItemType.NUMBER) {
|
|
92
|
-
const expression = props.expression;
|
|
93
|
-
return { name: id, expression, params: [{ name: id, dataType: DataType.NUMBER, value: toString(DataType.NUMBER, value) }] };
|
|
94
|
-
}
|
|
95
|
-
//No mapeamento dos outros tipos precisamos saber o tipo de dado.
|
|
96
|
-
}
|
|
97
|
-
return undefined;
|
|
99
|
+
isActiveFilter(item) {
|
|
100
|
+
return (item.visible && item.value != undefined) || item.type === FilterItemType.DEFAULT_FILTER;
|
|
98
101
|
}
|
|
99
|
-
|
|
100
|
-
this.
|
|
101
|
-
if (this.
|
|
102
|
-
this.
|
|
103
|
-
.then((filters) => {
|
|
104
|
-
this.filterConfig = filters;
|
|
105
|
-
})
|
|
106
|
-
.catch(reason => {
|
|
107
|
-
throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
|
|
108
|
-
});
|
|
102
|
+
registryFilterProvider() {
|
|
103
|
+
this.dataUnit.addFilterProvider(this);
|
|
104
|
+
if (this.filterConfig) {
|
|
105
|
+
this.dataUnit.loadData();
|
|
109
106
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if (this.dataUnit) {
|
|
117
|
-
this.dataUnit.addFilterProvider(this);
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
121
|
-
this.dataUnit = evt.detail;
|
|
122
|
-
this.dataUnit.addFilterProvider(this);
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
break;
|
|
107
|
+
}
|
|
108
|
+
itemFocused(selectedItem) {
|
|
109
|
+
this._element.querySelectorAll("snk-filter-item,snk-filter-list").forEach(item => {
|
|
110
|
+
if (item.id === selectedItem) {
|
|
111
|
+
if (item.tagName.toLowerCase() === "snk-filter-item" && item.getClientRects()[0].x < 0) {
|
|
112
|
+
item.scrollIntoView({ behavior: "auto", inline: 'nearest' });
|
|
126
113
|
}
|
|
127
114
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
115
|
+
else {
|
|
116
|
+
item["hideDetail"]();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
133
119
|
}
|
|
134
120
|
getFilterItems() {
|
|
135
121
|
const pinnedItems = [];
|
|
136
122
|
const unpinnedItems = [];
|
|
137
123
|
this.filterConfig
|
|
138
124
|
.filter(item => item.visible)
|
|
139
|
-
.sort((a, b) => this._filtersComparator(a, b))
|
|
140
125
|
.forEach((item, index) => {
|
|
141
|
-
const
|
|
126
|
+
const itemId = `filter-${item.id}`;
|
|
127
|
+
const filterItem = (h("snk-filter-item", { onFocusin: () => this.itemFocused(itemId), id: itemId, config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
142
128
|
if (item.fixed || item.hardFixed) {
|
|
143
129
|
pinnedItems.push(filterItem);
|
|
144
130
|
}
|
|
@@ -161,9 +147,6 @@ export class SnkFilterBar {
|
|
|
161
147
|
this._updateSequence.push(item.id);
|
|
162
148
|
}
|
|
163
149
|
}
|
|
164
|
-
filterChangeListener(evt) {
|
|
165
|
-
this.updateFilter(evt.detail);
|
|
166
|
-
}
|
|
167
150
|
normalizeItem(item) {
|
|
168
151
|
const normalized = Object.assign({}, item);
|
|
169
152
|
const optionals = ["props", "value", "hardFixed", "fixed"];
|
|
@@ -177,92 +160,207 @@ export class SnkFilterBar {
|
|
|
177
160
|
}
|
|
178
161
|
return normalized;
|
|
179
162
|
}
|
|
180
|
-
updateFilter(newItem
|
|
181
|
-
let needLoad = false;
|
|
182
|
-
let updated = false;
|
|
163
|
+
updateFilter(newItem) {
|
|
183
164
|
this.filterConfig = this.filterConfig.map(item => {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
return Object.assign(Object.assign({}, item), { value: undefined });
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
if (item.id === newItem.id) {
|
|
193
|
-
const normalizedOne = this.normalizeItem(item);
|
|
194
|
-
const normalizedTwo = this.normalizeItem(newItem);
|
|
195
|
-
updated = ObjectUtils.objectToString(normalizedOne) != ObjectUtils.objectToString(normalizedTwo);
|
|
196
|
-
needLoad = ObjectUtils.objectToString(normalizedOne.value) !== ObjectUtils.objectToString(normalizedTwo.value);
|
|
197
|
-
return newItem;
|
|
165
|
+
newItem = this.normalizeItem(newItem);
|
|
166
|
+
if (item.id === newItem.id) {
|
|
167
|
+
if (ObjectUtils.objectToString(item) != ObjectUtils.objectToString(newItem)) {
|
|
168
|
+
this.calculateUpdateSequence(newItem);
|
|
198
169
|
}
|
|
170
|
+
return newItem;
|
|
199
171
|
}
|
|
200
172
|
return item;
|
|
201
|
-
});
|
|
202
|
-
if (needLoad) {
|
|
203
|
-
this.dataUnit.loadData();
|
|
204
|
-
}
|
|
205
|
-
if (updated) {
|
|
206
|
-
this.calculateUpdateSequence(newItem);
|
|
207
|
-
this._application.saveFilterBarConfig(this.filterConfig, this.configName);
|
|
208
|
-
}
|
|
209
|
-
return needLoad;
|
|
173
|
+
}).sort((a, b) => this._filtersComparator(a, b));
|
|
210
174
|
}
|
|
211
175
|
getAddListItems() {
|
|
212
176
|
const hiddenItems = this.filterConfig
|
|
213
|
-
.filter(item => !item.visible)
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
]);
|
|
177
|
+
.filter(item => !item.visible && this.isListable(item));
|
|
178
|
+
const footerItems = [{ name: PERSONALIZED_FILTER, label: this.getMessage("snkFilterBar.customFilter"), iconName: "tune", kind: "FOOTER" }];
|
|
179
|
+
if (this.allowDefault) {
|
|
180
|
+
footerItems.push({ name: DEFAULT_FILTER, label: this.getMessage("snkFilterBar.defaultFilter"), iconName: "configuration", kind: "FOOTER" });
|
|
181
|
+
}
|
|
182
|
+
return hiddenItems.map(filter => { return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null }; })
|
|
183
|
+
.concat(footerItems);
|
|
221
184
|
}
|
|
222
185
|
getActiveClass() {
|
|
223
186
|
const filterApplied = this.filterConfig.filter(item => item.value != undefined).length > 0;
|
|
224
187
|
return filterApplied ? "sc-snk-filter-bar snk-filter-bar__filter-list-items-button--active" : "";
|
|
225
188
|
}
|
|
189
|
+
isListable(item, allowPersonalized = false) {
|
|
190
|
+
return item.type !== FilterItemType.DEFAULT_FILTER && (allowPersonalized || item.type !== FilterItemType.PERSONALIZED);
|
|
191
|
+
}
|
|
226
192
|
getAppliedListItems() {
|
|
227
193
|
const appliedItems = this.filterConfig
|
|
228
|
-
.filter(item => item.
|
|
229
|
-
.sort(this._filtersComparator);
|
|
194
|
+
.filter(item => this.isActiveFilter(item) && this.isListable(item, true));
|
|
230
195
|
return appliedItems.map(filter => {
|
|
231
196
|
return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null };
|
|
232
197
|
}).concat([
|
|
233
198
|
{ name: CLEAR_ALL_FILTERS, label: this.getMessage("snkFilterBar.clearAllFilters"), iconName: "cleaning", kind: "FOOTER" }
|
|
234
199
|
]);
|
|
235
200
|
}
|
|
201
|
+
addPersonalizedFilters(personalizedItems) {
|
|
202
|
+
const activeFilters = {};
|
|
203
|
+
personalizedItems.forEach(item => {
|
|
204
|
+
if (item.active) {
|
|
205
|
+
activeFilters[item.id] = true;
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
this.filterConfig = this.filterConfig.map(item => {
|
|
209
|
+
var _a, _b;
|
|
210
|
+
if (item.type === FilterItemType.PERSONALIZED) {
|
|
211
|
+
const visible = activeFilters[item.id];
|
|
212
|
+
if (!item.visible && visible) {
|
|
213
|
+
this.calculateUpdateSequence(item);
|
|
214
|
+
if (((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters) != undefined) {
|
|
215
|
+
this._pendingFilters.push(item.id);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return this.normalizeItem(visible ? Object.assign(Object.assign({}, item), { visible }) : Object.assign(Object.assign({}, item), { visible, value: undefined, fixed: undefined }));
|
|
219
|
+
}
|
|
220
|
+
return item;
|
|
221
|
+
}).sort((a, b) => this._filtersComparator(a, b));
|
|
222
|
+
}
|
|
223
|
+
openDefaultFilterModal() {
|
|
224
|
+
const filterModal = document.createElement("snk-filter-modal");
|
|
225
|
+
const defaultFilter = this.filterConfig.filter(item => item.type === FilterItemType.DEFAULT_FILTER);
|
|
226
|
+
filterModal.getMessage = (key, props) => this.getMessage(key, props);
|
|
227
|
+
filterModal.modalTitle = this.getMessage("snkFilterBar.modalDefaultFilterTitle");
|
|
228
|
+
filterModal.infoText = this.getMessage(defaultFilter.length == 0 ? "snkFilterBar.modalInfoTextCreateDefault" : "snkFilterBar.modalInfoTextEditDefault");
|
|
229
|
+
filterModal.items = defaultFilter.map(item => {
|
|
230
|
+
return { id: item.id, active: true, enabled: false, label: item.label };
|
|
231
|
+
});
|
|
232
|
+
filterModal.processModalAction = (_action) => {
|
|
233
|
+
this._application.closeModal();
|
|
234
|
+
};
|
|
235
|
+
this._application.showModal(filterModal);
|
|
236
|
+
}
|
|
237
|
+
openPersonalizedModal() {
|
|
238
|
+
const filterModal = document.createElement("snk-filter-modal");
|
|
239
|
+
const personalizedFilter = this.filterConfig
|
|
240
|
+
.filter(item => item.type === FilterItemType.PERSONALIZED)
|
|
241
|
+
.sort((itemA, itemB) => StringUtils.compare(itemA.label, itemB.label));
|
|
242
|
+
filterModal.getMessage = (key, props) => this.getMessage(key, props);
|
|
243
|
+
filterModal.modalTitle = this.getMessage("snkFilterBar.modalPersonalizedFilterTitle");
|
|
244
|
+
filterModal.modalSubTitle = this.getMessage("snkFilterBar.modalPersonalizedFilterSubTitle");
|
|
245
|
+
filterModal.okButtonLabel = this.getMessage("snkFilterBar.modalOkButtonLabel");
|
|
246
|
+
filterModal.cancelButtonLabel = this.getMessage("snkFilterBar.modalCancelButtonLabel");
|
|
247
|
+
filterModal.infoText = this.getMessage("snkFilterBar.modalInfoTextCreateEditPersonalized");
|
|
248
|
+
filterModal.useSearch = true;
|
|
249
|
+
filterModal.items = personalizedFilter.map(item => {
|
|
250
|
+
return { id: item.id, active: item.visible, enabled: true, label: item.label };
|
|
251
|
+
});
|
|
252
|
+
filterModal.processModalAction = (action) => {
|
|
253
|
+
if (action === ModalAction.CANCEL) {
|
|
254
|
+
// O Botão de cancelar, tem efeito específico:
|
|
255
|
+
// - Desmarcar todos os filtros personalizados.
|
|
256
|
+
filterModal.items = filterModal.items.map(item => {
|
|
257
|
+
return Object.assign(Object.assign({}, item), { active: false });
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
if (action === ModalAction.OK) {
|
|
262
|
+
this.addPersonalizedFilters(filterModal.items);
|
|
263
|
+
}
|
|
264
|
+
this._application.closeModal();
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
this._application.showModal(filterModal);
|
|
268
|
+
}
|
|
269
|
+
clearFilters() {
|
|
270
|
+
let changed = false;
|
|
271
|
+
this.filterConfig = this.filterConfig.map(item => {
|
|
272
|
+
if (item.value != undefined) {
|
|
273
|
+
changed = true;
|
|
274
|
+
}
|
|
275
|
+
return Object.assign(Object.assign({}, item), { value: undefined });
|
|
276
|
+
}).sort((a, b) => this._filtersComparator(a, b));
|
|
277
|
+
return changed;
|
|
278
|
+
}
|
|
279
|
+
loadPermitions() {
|
|
280
|
+
this._application.isUserSup().then(value => this.allowDefault = value);
|
|
281
|
+
}
|
|
282
|
+
loadConfigFromApplication() {
|
|
283
|
+
this._application.getFilterBarConfig(this.configName)
|
|
284
|
+
.then((filters) => {
|
|
285
|
+
this.filterConfig = filters.map(item => this.normalizeItem(item));
|
|
286
|
+
if (this.dataUnit) {
|
|
287
|
+
this.dataUnit.loadData();
|
|
288
|
+
}
|
|
289
|
+
})
|
|
290
|
+
.catch(reason => {
|
|
291
|
+
throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
attachDataUnit() {
|
|
295
|
+
if (this.dataUnit == undefined) {
|
|
296
|
+
let parent = this._element.parentElement;
|
|
297
|
+
while (parent) {
|
|
298
|
+
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
299
|
+
const snkDataUnit = parent;
|
|
300
|
+
this.dataUnit = snkDataUnit.dataUnit;
|
|
301
|
+
if (this.dataUnit) {
|
|
302
|
+
this.registryFilterProvider();
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
306
|
+
this.dataUnit = evt.detail;
|
|
307
|
+
this.registryFilterProvider();
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
parent = parent.parentElement;
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
this.registryFilterProvider();
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
filterChangeListener(evt) {
|
|
320
|
+
this.updateFilter(evt.detail);
|
|
321
|
+
}
|
|
236
322
|
addFilterHandler(itemName) {
|
|
237
323
|
const filterItem = this.filterConfig.find(currentFilter => currentFilter.id === itemName);
|
|
238
|
-
if (
|
|
324
|
+
if (itemName === PERSONALIZED_FILTER) {
|
|
325
|
+
this.openPersonalizedModal();
|
|
326
|
+
}
|
|
327
|
+
else if (itemName === DEFAULT_FILTER) {
|
|
328
|
+
this.openDefaultFilterModal();
|
|
329
|
+
}
|
|
330
|
+
else if (filterItem) {
|
|
331
|
+
this._pendingFilters.push(itemName);
|
|
239
332
|
this.updateFilter(Object.assign(Object.assign({}, filterItem), { visible: true }));
|
|
240
|
-
window.requestAnimationFrame(() => {
|
|
241
|
-
const itemElement = this._element.querySelector("#filter-" + itemName);
|
|
242
|
-
if (itemElement) {
|
|
243
|
-
itemElement.showUp();
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
333
|
}
|
|
247
334
|
}
|
|
248
335
|
appliedFilterHandler(itemName) {
|
|
249
336
|
if (itemName === CLEAR_ALL_FILTERS) {
|
|
250
|
-
if (this.
|
|
337
|
+
if (this.clearFilters()) {
|
|
251
338
|
this._application.info(this.getMessage("snkFilterBar.successfullyCleaned"), { iconName: "check" });
|
|
252
339
|
}
|
|
253
340
|
}
|
|
254
341
|
else {
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
257
|
-
|
|
342
|
+
const filterItemElement = this._element.querySelector("#filter-" + itemName);
|
|
343
|
+
if (filterItemElement) {
|
|
344
|
+
filterItemElement.showUp(true);
|
|
258
345
|
}
|
|
259
346
|
}
|
|
260
347
|
}
|
|
348
|
+
componentWillLoad() {
|
|
349
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
350
|
+
if (this._application) {
|
|
351
|
+
this.loadPermitions();
|
|
352
|
+
this.loadConfigFromApplication();
|
|
353
|
+
}
|
|
354
|
+
this.attachDataUnit();
|
|
355
|
+
}
|
|
356
|
+
componentDidRender() {
|
|
357
|
+
this.processPendingFilter();
|
|
358
|
+
}
|
|
261
359
|
render() {
|
|
262
360
|
if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
|
|
263
361
|
return undefined;
|
|
264
362
|
}
|
|
265
|
-
return (h(Host, null, h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), h("snk-filter-list", { items: this.getAppliedListItems(), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyAppliedFiltersList"), findFilterText: this.getMessage("snkFilterBar.findFilter"), iconName: "filter", class: "ez-padding-left--medium", buttonClass: this.getActiveClass(), onSnkItemSelected: evt => this.appliedFilterHandler(evt.detail) }), h("snk-filter-list", { items: this.getAddListItems(), label: this.getMessage("snkFilterBar.addFilter"), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyFiltersList"), findFilterText: this.getMessage("snkFilterBar.findField"), class: "ez-padding-left--medium", onSnkItemSelected: evt => this.addFilterHandler(evt.detail) }, h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
|
|
363
|
+
return (h(Host, null, h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), h("snk-filter-list", { id: APPLIED_FILTERS, onFocusin: () => this.itemFocused(APPLIED_FILTERS), items: this.getAppliedListItems(), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyAppliedFiltersList"), findFilterText: this.getMessage("snkFilterBar.findFilter"), iconName: "filter", class: "ez-padding-left--medium", buttonClass: this.getActiveClass(), onSnkItemSelected: evt => this.appliedFilterHandler(evt.detail) }), h("snk-filter-list", { id: ADD_FILTER, onFocusin: () => this.itemFocused(ADD_FILTER), items: this.getAddListItems(), label: this.getMessage("snkFilterBar.addFilter"), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyFiltersList"), findFilterText: this.getMessage("snkFilterBar.findField"), class: "ez-padding-left--medium", onSnkItemSelected: evt => this.addFilterHandler(evt.detail) }, h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
|
|
266
364
|
}
|
|
267
365
|
static get is() { return "snk-filter-bar"; }
|
|
268
366
|
static get encapsulation() { return "scoped"; }
|
|
@@ -340,7 +438,18 @@ export class SnkFilterBar {
|
|
|
340
438
|
}
|
|
341
439
|
};
|
|
342
440
|
}
|
|
441
|
+
static get states() {
|
|
442
|
+
return {
|
|
443
|
+
"allowDefault": {}
|
|
444
|
+
};
|
|
445
|
+
}
|
|
343
446
|
static get elementRef() { return "_element"; }
|
|
447
|
+
static get watchers() {
|
|
448
|
+
return [{
|
|
449
|
+
"propName": "filterConfig",
|
|
450
|
+
"methodName": "observeFilterConfig"
|
|
451
|
+
}];
|
|
452
|
+
}
|
|
344
453
|
static get listeners() {
|
|
345
454
|
return [{
|
|
346
455
|
"name": "filterChange",
|