@sankhyalabs/sankhyablocks 5.19.1 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ConfigStorage-0a738cdc.js +304 -0
- package/dist/cjs/IExpressionItem-1090c3fd.js +7 -0
- package/dist/cjs/PersonalizedFilterUtils-7d959e91.js +229 -0
- package/dist/cjs/{SnkFormConfigManager-69df3f74.js → SnkFormConfigManager-a583f503.js} +1 -1
- package/dist/cjs/{SnkMessageBuilder-3b5b5614.js → SnkMessageBuilder-8a2d3f26.js} +65 -4
- package/dist/cjs/{filter-bar-config-fetcher-a14536bf.js → filter-bar-config-fetcher-75219599.js} +34 -11
- package/dist/cjs/{index-de79181a.js → index-59a3e2de.js} +1 -1
- package/dist/cjs/{index-f400b1d6.js → index-614af008.js} +2 -0
- package/dist/cjs/{index-21bd01e1.js → index-aaaa2af5.js} +6 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-actions-button.cjs.entry.js +2 -2
- package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +4 -4
- package/dist/cjs/snk-attach.cjs.entry.js +4 -4
- package/dist/cjs/snk-client-confirm.cjs.entry.js +1 -1
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +4 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +4 -4
- package/dist/cjs/{snk-data-unit-e9c20097.js → snk-data-unit-53fc9200.js} +2 -2
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +10 -10
- package/dist/cjs/snk-entity-list.cjs.entry.js +6 -4
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/snk-expression-group.cjs.entry.js +246 -0
- package/dist/cjs/{snk-filter-field-search_2.cjs.entry.js → snk-expression-item_3.cjs.entry.js} +327 -66
- package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +161 -72
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +54 -69
- package/dist/cjs/snk-filter-item.cjs.entry.js +21 -7
- package/dist/cjs/snk-filter-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +57 -29
- package/dist/cjs/snk-filter-modal.cjs.entry.js +66 -12
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +5 -3
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +135 -55
- package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +7 -7
- package/dist/cjs/{snk-guides-viewer-c8843478.js → snk-guides-viewer-10ffca10.js} +5 -5
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +166 -94
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-bar.cjs.entry.js +45 -0
- package/dist/cjs/{snk-simple-bar_2.cjs.entry.js → snk-simple-crud.cjs.entry.js} +5 -43
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +4 -4
- package/dist/cjs/{taskbar-elements-3be287d6.js → taskbar-elements-068aa945.js} +3 -3
- package/dist/cjs/{taskbar-processor-02f0fc84.js → taskbar-processor-6442c585.js} +1 -1
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +6 -4
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +34 -12
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +4 -2
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.css +66 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.js +370 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +52 -68
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +20 -6
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +1 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +110 -10
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +98 -27
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +21 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +100 -49
- package/dist/collection/components/snk-filter-bar/types/custom-element-filter.js +1 -0
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +22 -3
- package/dist/collection/components/snk-filter-bar/utils/filters-mock.js +96 -0
- package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css +1 -1
- package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js +27 -6
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css +39 -2
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +276 -30
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css +73 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js +443 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js +16 -24
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css +18 -4
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +131 -21
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionGroup.js +0 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.js +5 -1
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.js +1 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IPersonalizedFilter.js +1 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.js +3 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +1 -1
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +184 -15
- package/dist/collection/lib/@types/index.js +2 -0
- package/dist/collection/lib/configs/ConfigStorage.js +15 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +36 -13
- package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +106 -4
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +15 -2
- package/dist/collection/lib/message/resources/snk-filter-field-search.msg.js +2 -0
- package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +48 -2
- package/dist/components/ConfigStorage.js +180 -1
- package/dist/components/PersonalizedFilterUtils.js +227 -0
- package/dist/components/SnkMessageBuilder.js +65 -4
- package/dist/components/filter-bar-config-fetcher.js +34 -11
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +3 -1
- package/dist/components/snk-crud.js +65 -35
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-detail-view2.js +99 -44
- package/dist/components/snk-entity-list.js +6 -4
- package/dist/components/snk-expression-group.d.ts +11 -0
- package/dist/components/snk-expression-group.js +6 -0
- package/dist/components/snk-expression-group2.js +296 -0
- package/dist/components/snk-expression-item2.js +133 -46
- package/dist/components/snk-filter-bar2.js +195 -68
- package/dist/components/snk-filter-detail2.js +52 -68
- package/dist/components/snk-filter-field-search2.js +26 -5
- package/dist/components/snk-filter-item2.js +20 -6
- package/dist/components/snk-filter-modal-item2.js +54 -27
- package/dist/components/snk-filter-modal.js +68 -12
- package/dist/components/snk-filter-param-config2.js +3 -57
- package/dist/components/snk-filter-period.js +4 -2
- package/dist/components/snk-filter-personalized.js +139 -58
- package/dist/components/snk-grid2.js +52 -16
- package/dist/components/snk-personalized-filter.js +1 -153
- package/dist/components/snk-personalized-filter2.js +238 -0
- package/dist/esm/ConfigStorage-9f4d2e67.js +300 -0
- package/dist/esm/IExpressionItem-2e922b2c.js +7 -0
- package/dist/esm/PersonalizedFilterUtils-202cd721.js +227 -0
- package/dist/esm/{SnkFormConfigManager-e60367a0.js → SnkFormConfigManager-def999fe.js} +1 -1
- package/dist/esm/{SnkMessageBuilder-188a38bb.js → SnkMessageBuilder-cc4d1599.js} +65 -4
- package/dist/esm/{filter-bar-config-fetcher-edc48f4b.js → filter-bar-config-fetcher-bd2070a3.js} +34 -11
- package/dist/esm/{index-cfd4bb13.js → index-8c3d76a6.js} +6 -1
- package/dist/esm/{index-507e19ec.js → index-a255b326.js} +3 -1
- package/dist/esm/{index-8efbf198.js → index-d60ca0ac.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/sankhyablocks.js +3 -3
- package/dist/esm/snk-actions-button.entry.js +2 -2
- package/dist/esm/snk-actions-form.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +4 -4
- package/dist/esm/snk-attach.entry.js +4 -4
- package/dist/esm/snk-client-confirm.entry.js +1 -1
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +4 -4
- package/dist/esm/snk-data-exporter.entry.js +4 -4
- package/dist/esm/{snk-data-unit-79b1583a.js → snk-data-unit-97824457.js} +2 -2
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-detail-view.entry.js +10 -10
- package/dist/esm/snk-entity-list.entry.js +7 -5
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-expression-group.entry.js +242 -0
- package/dist/esm/{snk-filter-field-search_2.entry.js → snk-expression-item_3.entry.js} +326 -66
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +156 -67
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-detail.entry.js +55 -70
- package/dist/esm/snk-filter-item.entry.js +21 -7
- package/dist/esm/snk-filter-list.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +57 -29
- package/dist/esm/snk-filter-modal.entry.js +66 -12
- package/dist/esm/snk-filter-multi-select.entry.js +1 -1
- package/dist/esm/snk-filter-number.entry.js +1 -1
- package/dist/esm/snk-filter-period.entry.js +5 -3
- package/dist/esm/snk-filter-personalized.entry.js +135 -55
- package/dist/esm/snk-filter-search.entry.js +1 -1
- package/dist/esm/snk-filter-text.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form-summary.entry.js +1 -1
- package/dist/esm/snk-form-view.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid-config.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +7 -7
- package/dist/esm/{snk-guides-viewer-59d3a78c.js → snk-guides-viewer-0380f3df.js} +5 -5
- package/dist/esm/snk-guides-viewer.entry.js +9 -9
- package/dist/esm/snk-personalized-filter.entry.js +166 -94
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-select-box.entry.js +1 -1
- package/dist/esm/snk-simple-bar.entry.js +41 -0
- package/dist/esm/{snk-simple-bar_2.entry.js → snk-simple-crud.entry.js} +7 -44
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +4 -4
- package/dist/esm/{taskbar-elements-8ff33c26.js → taskbar-elements-26d0fba3.js} +3 -3
- package/dist/esm/{taskbar-processor-20de6616.js → taskbar-processor-dfef41a8.js} +1 -1
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/{p-f27dc5e9.entry.js → p-00d1cac4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b9667fbe.js → p-066ee142.js} +2 -2
- package/dist/sankhyablocks/p-09a058ba.entry.js +1 -0
- package/dist/sankhyablocks/{p-82bc4666.entry.js → p-0dec4d29.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1e6a95f5.entry.js → p-12632b8e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-384c4a6b.js → p-18b34bb4.js} +1 -1
- package/dist/sankhyablocks/{p-538c057a.entry.js → p-2ad89e28.entry.js} +1 -1
- package/dist/sankhyablocks/p-2d5108b3.js +1 -0
- package/dist/sankhyablocks/{p-ff398057.entry.js → p-34cd4b39.entry.js} +1 -1
- package/dist/sankhyablocks/p-36ecb6ab.js +1 -0
- package/dist/sankhyablocks/p-372e0185.entry.js +1 -0
- package/dist/sankhyablocks/p-3be34bd1.entry.js +1 -0
- package/dist/sankhyablocks/p-3d45107f.js +1 -0
- package/dist/sankhyablocks/{p-28c12f65.js → p-463e0936.js} +1 -1
- package/dist/sankhyablocks/{p-e701646c.entry.js → p-49d628d1.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e642bf7a.entry.js → p-50db4bc4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-093febff.entry.js → p-5427566a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6a02e236.js → p-590d8900.js} +1 -1
- package/dist/sankhyablocks/p-5a6c090e.entry.js +1 -0
- package/dist/sankhyablocks/p-639be4aa.entry.js +1 -0
- package/dist/sankhyablocks/{p-e2bb9c9a.entry.js → p-67a19b48.entry.js} +1 -1
- package/dist/sankhyablocks/{p-19692f92.js → p-69770075.js} +1 -1
- package/dist/sankhyablocks/p-6d4169fc.entry.js +1 -0
- package/dist/sankhyablocks/{p-0b40c655.js → p-708ee8ee.js} +1 -1
- package/dist/sankhyablocks/{p-9af04fc7.entry.js → p-718cc24b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2d0fc912.entry.js → p-7946512f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-900b2889.entry.js → p-7a5e1be7.entry.js} +1 -1
- package/dist/sankhyablocks/p-801b8858.js +68 -0
- package/dist/sankhyablocks/{p-80e52e85.entry.js → p-847b9506.entry.js} +1 -1
- package/dist/sankhyablocks/{p-56d70073.entry.js → p-8d541539.entry.js} +1 -1
- package/dist/sankhyablocks/{p-584a315a.entry.js → p-8e98a893.entry.js} +1 -1
- package/dist/sankhyablocks/p-9731180c.entry.js +1 -0
- package/dist/sankhyablocks/p-a6055eb9.entry.js +1 -0
- package/dist/sankhyablocks/{p-b680fa7a.entry.js → p-a655ea15.entry.js} +1 -1
- package/dist/sankhyablocks/{p-eae124e3.entry.js → p-a8b06801.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b25450ab.js → p-a8e5ded0.js} +1 -1
- package/dist/sankhyablocks/{p-6ac29569.entry.js → p-b66b99d9.entry.js} +1 -1
- package/dist/sankhyablocks/p-b7efc49a.entry.js +1 -0
- package/dist/sankhyablocks/{p-9c7f7214.entry.js → p-b91ee370.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e551b19a.entry.js → p-b940798f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-72e78de0.entry.js → p-bbefb3b2.entry.js} +1 -1
- package/dist/sankhyablocks/p-bdd61fa8.entry.js +1 -0
- package/dist/sankhyablocks/{p-f8c66aa3.entry.js → p-c06973e7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-257c71a7.entry.js → p-c17e19a2.entry.js} +1 -1
- package/dist/sankhyablocks/p-c6bf66e0.js +1 -0
- package/dist/sankhyablocks/p-cf90a195.entry.js +1 -0
- package/dist/sankhyablocks/{p-44c2ed16.entry.js → p-d11c5026.entry.js} +1 -1
- package/dist/sankhyablocks/p-d5145c3f.entry.js +1 -0
- package/dist/sankhyablocks/p-de328b00.entry.js +1 -0
- package/dist/sankhyablocks/{p-971abcc2.entry.js → p-e500863b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-22e44b9d.entry.js → p-e824aef2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4ce96831.entry.js → p-eb24c092.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4c2015a9.js → p-eb90de43.js} +1 -1
- package/dist/sankhyablocks/p-ebb8de34.entry.js +1 -0
- package/dist/sankhyablocks/{p-8652d177.entry.js → p-fc512cbe.entry.js} +1 -1
- package/dist/sankhyablocks/{p-786ae316.entry.js → p-fced1d89.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e0b4aec3.entry.js → p-fdb43927.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.d.ts +85 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +6 -6
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +18 -1
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +14 -6
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +10 -3
- package/dist/types/components/snk-filter-bar/types/custom-element-filter.d.ts +6 -0
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +10 -1
- package/dist/types/components/snk-filter-bar/utils/filters-mock.d.ts +92 -15
- package/dist/types/components/snk-filter-field-search/interfaces/index.d.ts +5 -11
- package/dist/types/components/snk-filter-field-search/snk-filter-field-search.d.ts +3 -0
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +39 -6
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.d.ts +82 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.d.ts +1 -1
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.d.ts +13 -1
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionGroup.d.ts +0 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.d.ts +23 -3
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.d.ts +21 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IPersonalizedFilter.d.ts +11 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.d.ts +3 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.d.ts +14 -2
- package/dist/types/components.d.ts +169 -10
- package/dist/types/lib/@types/index.d.ts +3 -1
- package/dist/types/lib/configs/ConfigStorage.d.ts +5 -0
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +4 -2
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +5 -0
- package/dist/types/lib/store/index.d.ts +1 -2
- package/package.json +5 -5
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ConfigStorage-f68c3607.js +0 -124
- package/dist/cjs/index-8d94b7e0.js +0 -7
- package/dist/cjs/snk-expression-item.cjs.entry.js +0 -213
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +0 -214
- package/dist/esm/ConfigStorage-e6c17998.js +0 -121
- package/dist/esm/index-620ac460.js +0 -7
- package/dist/esm/snk-expression-item.entry.js +0 -209
- package/dist/sankhyablocks/p-0b6ddb67.entry.js +0 -1
- package/dist/sankhyablocks/p-0c2afa63.entry.js +0 -1
- package/dist/sankhyablocks/p-343699ad.entry.js +0 -1
- package/dist/sankhyablocks/p-471568c7.entry.js +0 -1
- package/dist/sankhyablocks/p-6c2c71ca.js +0 -1
- package/dist/sankhyablocks/p-8ce9ea9f.entry.js +0 -1
- package/dist/sankhyablocks/p-8efb0f47.entry.js +0 -1
- package/dist/sankhyablocks/p-9a448ff9.entry.js +0 -1
- package/dist/sankhyablocks/p-9e50681c.entry.js +0 -1
- package/dist/sankhyablocks/p-9f66bc54.entry.js +0 -1
- package/dist/sankhyablocks/p-b1c02726.js +0 -1
- package/dist/sankhyablocks/p-b34d23fa.js +0 -1
- package/dist/sankhyablocks/p-c20dd153.entry.js +0 -1
- package/dist/sankhyablocks/p-cbb5c440.entry.js +0 -1
- package/dist/sankhyablocks/p-f3241ada.entry.js +0 -1
- package/dist/sankhyablocks/p-f4184ce7.js +0 -1
- package/dist/sankhyablocks/p-ff96b509.entry.js +0 -27
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +0 -40
@@ -4,9 +4,17 @@ import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/
|
|
4
4
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
5
5
|
import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
6
6
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
7
|
+
import { F as FilterOperand } from './index2.js';
|
7
8
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
8
|
-
import {
|
9
|
-
import { d as defineCustomElement$
|
9
|
+
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
|
10
|
+
import { d as defineCustomElement$8 } from './snk-expression-group2.js';
|
11
|
+
import { d as defineCustomElement$7 } from './snk-expression-item2.js';
|
12
|
+
import { d as defineCustomElement$6 } from './snk-filter-detail2.js';
|
13
|
+
import { d as defineCustomElement$5 } from './snk-filter-field-search2.js';
|
14
|
+
import { d as defineCustomElement$4 } from './snk-filter-item2.js';
|
15
|
+
import { d as defineCustomElement$3 } from './snk-filter-param-config2.js';
|
16
|
+
import { d as defineCustomElement$2 } from './snk-personalized-filter2.js';
|
17
|
+
import { d as defineCustomElement$1 } from './snk-simple-bar2.js';
|
10
18
|
|
11
19
|
const buildFilter = (item) => {
|
12
20
|
switch (item.type) {
|
@@ -14,8 +22,8 @@ const buildFilter = (item) => {
|
|
14
22
|
return buildDefault(item);
|
15
23
|
case FilterItemType.BINARY_SELECT:
|
16
24
|
return buildBinary(item);
|
17
|
-
case FilterItemType.
|
18
|
-
return
|
25
|
+
case FilterItemType.MULTI_LIST:
|
26
|
+
return buildMultiList(item);
|
19
27
|
case FilterItemType.PERIOD:
|
20
28
|
return buildPeriod(item);
|
21
29
|
case FilterItemType.SEARCH:
|
@@ -39,9 +47,25 @@ function buildBinary(item) {
|
|
39
47
|
const selectedOption = options.find(opt => opt.name === value);
|
40
48
|
return { name: id, expression: selectedOption.expression, params: [] };
|
41
49
|
}
|
42
|
-
function
|
50
|
+
function buildMultiList(item) {
|
43
51
|
const { id, value, props } = item;
|
44
|
-
|
52
|
+
const parsedValues = parseMultiListValues(value);
|
53
|
+
if (parsedValues.length > 0) {
|
54
|
+
return {
|
55
|
+
name: id,
|
56
|
+
expression: props.expression,
|
57
|
+
params: [{
|
58
|
+
name: id,
|
59
|
+
dataType: DataType.TEXT,
|
60
|
+
value: JSON.stringify(parsedValues)
|
61
|
+
}]
|
62
|
+
};
|
63
|
+
}
|
64
|
+
}
|
65
|
+
function parseMultiListValues(multiListValue) {
|
66
|
+
var _a, _b;
|
67
|
+
const value = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
|
68
|
+
return value.filter(item => item === null || item === void 0 ? void 0 : item.check).map(({ id }) => Number.isNaN(+id) ? String(id) : Number(id));
|
45
69
|
}
|
46
70
|
function buildPeriod(item) {
|
47
71
|
const { id, value, props } = item;
|
@@ -86,12 +110,13 @@ function buildNumber(item) {
|
|
86
110
|
return { name: id, expression, params: [{ name: id, dataType: DataType.NUMBER, value: toString(DataType.NUMBER, value) }] };
|
87
111
|
}
|
88
112
|
function buildPersonalized(item) {
|
89
|
-
|
90
|
-
const
|
91
|
-
const
|
92
|
-
|
93
|
-
|
94
|
-
|
113
|
+
const { id, groupedItems = [] } = item;
|
114
|
+
const activeFilters = groupedItems.filter(groupItem => !!groupItem.visible);
|
115
|
+
const filters = activeFilters.map(item => {
|
116
|
+
var _a;
|
117
|
+
const expression = item.props.expression;
|
118
|
+
const params = (((_a = item.props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || []).map((param, index) => {
|
119
|
+
const valuesArray = Array.from(item.value || 0);
|
95
120
|
const dataType = param.dataType;
|
96
121
|
let paramValue = (index >= 0 && index < valuesArray.length ? valuesArray[index] : null);
|
97
122
|
if (paramValue != undefined && typeof paramValue === "object" && "value" in paramValue) {
|
@@ -101,30 +126,49 @@ function buildPersonalized(item) {
|
|
101
126
|
paramValue = false;
|
102
127
|
}
|
103
128
|
return { name: param.name, dataType, value: typeof paramValue === "string" ? paramValue : toString(dataType, paramValue) };
|
104
|
-
})
|
105
|
-
|
129
|
+
});
|
130
|
+
return { expression, name: item.id, params };
|
131
|
+
});
|
132
|
+
const expression = filters.map(filter => `(${filter.expression})`).join(` ${FilterOperand.AND} `);
|
133
|
+
const params = filters.flatMap(filter => filter.params);
|
134
|
+
return { name: id, expression, params };
|
106
135
|
}
|
107
136
|
|
108
137
|
class SnkFilterModalFactory {
|
109
|
-
constructor({ filterConfig, onComplete, getMessage }) {
|
138
|
+
constructor({ filterConfig, configName, onComplete, getMessage, onAddPersonalizedFilter, onEditPersonalizedFilter }) {
|
110
139
|
this._filterConfig = filterConfig;
|
140
|
+
this._configName = configName;
|
111
141
|
this._onComplete = onComplete;
|
112
142
|
this._getMessage = getMessage;
|
143
|
+
this._addPersonalizedFilterFn = onAddPersonalizedFilter;
|
144
|
+
this._editPersonalizedFilterFn = onEditPersonalizedFilter;
|
113
145
|
}
|
114
146
|
applyFilters(newFilterConfig) {
|
115
147
|
this._onComplete(newFilterConfig);
|
116
148
|
this._closeModal();
|
117
149
|
}
|
118
150
|
clearAll(filterConfigSnapshot) {
|
119
|
-
return filterConfigSnapshot.map(filterItem =>
|
151
|
+
return filterConfigSnapshot.map(filterItem => {
|
152
|
+
const copy = Object.assign({}, filterItem);
|
153
|
+
delete copy.value;
|
154
|
+
if (filterItem.type === FilterItemType.PERSONALIZED) {
|
155
|
+
copy.visible = false;
|
156
|
+
}
|
157
|
+
if (copy.groupedItems) {
|
158
|
+
copy.groupedItems = this.clearAll(copy.groupedItems);
|
159
|
+
}
|
160
|
+
return copy;
|
161
|
+
});
|
120
162
|
}
|
121
163
|
buildFilterModal() {
|
122
164
|
const filterModal = document.createElement("snk-filter-modal");
|
123
165
|
filterModal.filters = this._filterConfig;
|
166
|
+
filterModal.configName = this._configName;
|
124
167
|
filterModal.getMessage = this._getMessage.bind(this);
|
125
168
|
filterModal.applyFilters = this.applyFilters.bind(this);
|
126
|
-
filterModal.clearAll = this.clearAll.bind(this);
|
127
169
|
filterModal.closeModal = () => this._closeModal();
|
170
|
+
filterModal.addPersonalizedFilter = () => this._addPersonalizedFilterFn();
|
171
|
+
filterModal.editPersonalizedFilter = (id) => this._editPersonalizedFilterFn(id);
|
128
172
|
return filterModal;
|
129
173
|
}
|
130
174
|
async showModal() {
|
@@ -138,9 +182,12 @@ class SnkFilterModalFactory {
|
|
138
182
|
};
|
139
183
|
this._closeModal = await ApplicationUtils.showModal(modalProps);
|
140
184
|
}
|
185
|
+
async closeModal() {
|
186
|
+
this._closeModal();
|
187
|
+
}
|
141
188
|
}
|
142
189
|
|
143
|
-
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--most-visible, 3);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}";
|
190
|
+
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--more-visible, 2);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--most-visible, 3);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}";
|
144
191
|
|
145
192
|
const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
146
193
|
constructor() {
|
@@ -149,7 +196,8 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
149
196
|
this._updateSequence = [];
|
150
197
|
this._loadingPending = false;
|
151
198
|
this._configUpdated = false;
|
152
|
-
this.
|
199
|
+
this._pendingVariables = false;
|
200
|
+
this._customfiltersToBeUpdated = [];
|
153
201
|
this._calculateSortIndex = (item) => {
|
154
202
|
let index = item.hardFixed ? 1000000 : 0;
|
155
203
|
//campos Hard Fixed não variam a ordem
|
@@ -169,6 +217,8 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
169
217
|
this.messagesBuilder = undefined;
|
170
218
|
this.allowDefault = undefined;
|
171
219
|
this.scrollerLocked = false;
|
220
|
+
this.showPersonalizedFilter = false;
|
221
|
+
this.personalizedFilterId = undefined;
|
172
222
|
}
|
173
223
|
observeFilterConfig(newValue, oldValue) {
|
174
224
|
if (oldValue != undefined && newValue == undefined) {
|
@@ -177,17 +227,28 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
177
227
|
}
|
178
228
|
else {
|
179
229
|
const oldItems = new Map(oldValue ? oldValue.map(item => [item.id, item]) : undefined);
|
180
|
-
newValue.
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
230
|
+
if (oldItems.size === 0 && newValue.length > 0) {
|
231
|
+
this._loadingPending = true;
|
232
|
+
this._configUpdated = false;
|
233
|
+
}
|
234
|
+
else {
|
235
|
+
newValue.forEach(newItem => {
|
236
|
+
const oldItem = oldItems.get(newItem.id);
|
237
|
+
if (oldItem != undefined) {
|
238
|
+
this._configUpdated = this._configUpdated || ObjectUtils.objectToString(oldItem) != ObjectUtils.objectToString(newItem);
|
239
|
+
this._loadingPending = this._loadingPending || ObjectUtils.objectToString(oldItem.value) !== ObjectUtils.objectToString(newItem.value);
|
240
|
+
if (!this._loadingPending) {
|
241
|
+
const groupedChanged = ObjectUtils.objectToString(oldItem.groupedItems) != ObjectUtils.objectToString(newItem.groupedItems);
|
242
|
+
this._configUpdated = this._configUpdated || groupedChanged;
|
243
|
+
this._loadingPending = this._loadingPending || groupedChanged;
|
244
|
+
}
|
245
|
+
}
|
246
|
+
else {
|
247
|
+
this._configUpdated = true;
|
248
|
+
this._loadingPending = this._loadingPending || newItem.value != undefined;
|
249
|
+
}
|
250
|
+
});
|
251
|
+
}
|
191
252
|
}
|
192
253
|
this.processAfterUpdateConfig();
|
193
254
|
}
|
@@ -204,30 +265,31 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
204
265
|
}
|
205
266
|
}
|
206
267
|
processPendingFilter() {
|
207
|
-
if (this.
|
208
|
-
|
209
|
-
if (
|
210
|
-
|
211
|
-
this.
|
212
|
-
this.processPendingFilter();
|
268
|
+
if (this._pendingVariables) {
|
269
|
+
const popUp = this._element.querySelector("#filter-PERSONALIZED_FILTER_GROUP");
|
270
|
+
if (popUp) {
|
271
|
+
popUp.showUp(true).then(() => {
|
272
|
+
this.processAfterUpdateConfig();
|
213
273
|
});
|
214
274
|
}
|
215
275
|
}
|
216
|
-
|
276
|
+
else {
|
217
277
|
this.processAfterUpdateConfig();
|
218
278
|
}
|
219
279
|
}
|
220
|
-
processAfterUpdateConfig() {
|
221
|
-
if (this._pendingFilters.length > 0) {
|
222
|
-
return;
|
223
|
-
}
|
280
|
+
async processAfterUpdateConfig() {
|
224
281
|
if (this._loadingPending) {
|
225
|
-
this.
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
});
|
282
|
+
const personalizedFilter = this.filterConfig.find(item => {
|
283
|
+
if (item.type === FilterItemType.PERSONALIZED) {
|
284
|
+
return true;
|
285
|
+
}
|
230
286
|
});
|
287
|
+
this._pendingVariables = !PersonalizedFilterUtils.validateVariableValues(personalizedFilter);
|
288
|
+
if (this._pendingVariables) {
|
289
|
+
return;
|
290
|
+
}
|
291
|
+
this._loadingPending = false;
|
292
|
+
this.dataUnit.loadData();
|
231
293
|
}
|
232
294
|
if (this._configUpdated) {
|
233
295
|
this._configUpdated = false;
|
@@ -256,7 +318,14 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
256
318
|
return filters;
|
257
319
|
}
|
258
320
|
isActiveFilter(item) {
|
259
|
-
|
321
|
+
/*
|
322
|
+
- O filtro padrão também deve sempre ser condiderado ativo, pois, sempre deve
|
323
|
+
ser aplicado.
|
324
|
+
*/
|
325
|
+
if (item.type === FilterItemType.DEFAULT_FILTER) {
|
326
|
+
return true;
|
327
|
+
}
|
328
|
+
return item.visible && (item.groupedItems || item.value != undefined);
|
260
329
|
}
|
261
330
|
registryFilterProvider() {
|
262
331
|
this.dataUnit.addFilterProvider(this);
|
@@ -276,12 +345,16 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
276
345
|
}
|
277
346
|
});
|
278
347
|
}
|
348
|
+
filterActiveFilter(item) {
|
349
|
+
return item.visible || item.removalBlocked;
|
350
|
+
}
|
279
351
|
getFilterItems() {
|
280
352
|
const pinnedItems = [];
|
281
353
|
const unpinnedItems = [];
|
282
354
|
this.filterConfig
|
283
|
-
.filter(
|
355
|
+
.filter(this.filterActiveFilter)
|
284
356
|
.forEach((item, index) => {
|
357
|
+
item = ObjectUtils.copy(item);
|
285
358
|
const itemId = `filter-${item.id}`;
|
286
359
|
const filterItem = (h("snk-filter-item", { onVisibleChanged: (evt) => this.scrollerLocked = evt.detail, 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 }));
|
287
360
|
if (item.fixed || item.hardFixed) {
|
@@ -335,19 +408,16 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
335
408
|
this._application.isUserSup().then(value => this.allowDefault = value);
|
336
409
|
}
|
337
410
|
loadConfigFromStorage() {
|
338
|
-
|
339
|
-
|
340
|
-
.
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
})
|
349
|
-
.catch(reason => {
|
350
|
-
throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
|
411
|
+
return new Promise(accept => {
|
412
|
+
ConfigStorage.get().then(instance => {
|
413
|
+
instance.loadFilterBarConfig(this.configName)
|
414
|
+
.then((filters) => {
|
415
|
+
accept();
|
416
|
+
this.filterConfig = filters.map(item => this.normalizeItem(item));
|
417
|
+
})
|
418
|
+
.catch(reason => {
|
419
|
+
throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
|
420
|
+
});
|
351
421
|
});
|
352
422
|
});
|
353
423
|
}
|
@@ -387,12 +457,34 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
387
457
|
this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
|
388
458
|
};
|
389
459
|
const factoryParams = {
|
390
|
-
filterConfig: this.filterConfig,
|
460
|
+
filterConfig: ObjectUtils.copy(this.filterConfig),
|
461
|
+
configName: this.configName,
|
391
462
|
onComplete: callbackOnApplyFilter,
|
392
|
-
getMessage: (key, props) => this.getMessage(key, props)
|
463
|
+
getMessage: (key, props) => this.getMessage(key, props),
|
464
|
+
onAddPersonalizedFilter: () => this.addPersonalizedFilter(),
|
465
|
+
onEditPersonalizedFilter: (id) => this.editPersonalizedFilter(id)
|
393
466
|
};
|
394
|
-
|
395
|
-
await
|
467
|
+
this._filterModalFactory = new SnkFilterModalFactory(factoryParams);
|
468
|
+
await this._filterModalFactory.showModal();
|
469
|
+
}
|
470
|
+
addPersonalizedFilter() {
|
471
|
+
this._filterModalFactory.closeModal();
|
472
|
+
this.personalizedFilterId = undefined;
|
473
|
+
this.showPersonalizedFilter = true;
|
474
|
+
window.requestAnimationFrame(() => {
|
475
|
+
this._elPersonalizedFilter.createPersonalizedFilter();
|
476
|
+
});
|
477
|
+
}
|
478
|
+
editPersonalizedFilter(id) {
|
479
|
+
this._filterModalFactory.closeModal();
|
480
|
+
this.showPersonalizedFilter = true;
|
481
|
+
this.personalizedFilterId = id;
|
482
|
+
}
|
483
|
+
hidePersonalizedFilter() {
|
484
|
+
this.loadConfigFromStorage().then(() => {
|
485
|
+
this.personalizedFilterId = undefined;
|
486
|
+
this.showPersonalizedFilter = false;
|
487
|
+
});
|
396
488
|
}
|
397
489
|
componentWillLoad() {
|
398
490
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
@@ -409,7 +501,10 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
409
501
|
if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
|
410
502
|
return undefined;
|
411
503
|
}
|
412
|
-
|
504
|
+
if (this.showPersonalizedFilter) {
|
505
|
+
return h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.hidePersonalizedFilter(), entityUri: this.dataUnit.name, configName: this.configName });
|
506
|
+
}
|
507
|
+
return h(Host, null, h("ez-scroller", { direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, this.getFilterItems()), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" })));
|
413
508
|
}
|
414
509
|
get _element() { return this; }
|
415
510
|
static get watchers() { return {
|
@@ -423,25 +518,57 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
423
518
|
"messagesBuilder": [1040],
|
424
519
|
"allowDefault": [32],
|
425
520
|
"scrollerLocked": [32],
|
521
|
+
"showPersonalizedFilter": [32],
|
522
|
+
"personalizedFilterId": [32],
|
426
523
|
"reload": [64]
|
427
524
|
}, [[0, "filterChange", "filterChangeListener"]]]);
|
428
525
|
function defineCustomElement() {
|
429
526
|
if (typeof customElements === "undefined") {
|
430
527
|
return;
|
431
528
|
}
|
432
|
-
const components = ["snk-filter-bar", "snk-filter-detail", "snk-filter-item"];
|
529
|
+
const components = ["snk-filter-bar", "snk-expression-group", "snk-expression-item", "snk-filter-detail", "snk-filter-field-search", "snk-filter-item", "snk-filter-param-config", "snk-personalized-filter", "snk-simple-bar"];
|
433
530
|
components.forEach(tagName => { switch (tagName) {
|
434
531
|
case "snk-filter-bar":
|
435
532
|
if (!customElements.get(tagName)) {
|
436
533
|
customElements.define(tagName, SnkFilterBar);
|
437
534
|
}
|
438
535
|
break;
|
536
|
+
case "snk-expression-group":
|
537
|
+
if (!customElements.get(tagName)) {
|
538
|
+
defineCustomElement$8();
|
539
|
+
}
|
540
|
+
break;
|
541
|
+
case "snk-expression-item":
|
542
|
+
if (!customElements.get(tagName)) {
|
543
|
+
defineCustomElement$7();
|
544
|
+
}
|
545
|
+
break;
|
439
546
|
case "snk-filter-detail":
|
440
547
|
if (!customElements.get(tagName)) {
|
441
|
-
defineCustomElement$
|
548
|
+
defineCustomElement$6();
|
549
|
+
}
|
550
|
+
break;
|
551
|
+
case "snk-filter-field-search":
|
552
|
+
if (!customElements.get(tagName)) {
|
553
|
+
defineCustomElement$5();
|
442
554
|
}
|
443
555
|
break;
|
444
556
|
case "snk-filter-item":
|
557
|
+
if (!customElements.get(tagName)) {
|
558
|
+
defineCustomElement$4();
|
559
|
+
}
|
560
|
+
break;
|
561
|
+
case "snk-filter-param-config":
|
562
|
+
if (!customElements.get(tagName)) {
|
563
|
+
defineCustomElement$3();
|
564
|
+
}
|
565
|
+
break;
|
566
|
+
case "snk-personalized-filter":
|
567
|
+
if (!customElements.get(tagName)) {
|
568
|
+
defineCustomElement$2();
|
569
|
+
}
|
570
|
+
break;
|
571
|
+
case "snk-simple-bar":
|
445
572
|
if (!customElements.get(tagName)) {
|
446
573
|
defineCustomElement$1();
|
447
574
|
}
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, Host } from '@stencil/core/internal/client';
|
2
2
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
|
-
import { ApplicationContext, ElementIDUtils,
|
4
|
+
import { ApplicationContext, ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
5
5
|
import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher.js';
|
6
|
+
import { E as EPresentationMode } from './presentationMode.js';
|
7
|
+
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
|
6
8
|
|
7
9
|
const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
8
10
|
constructor() {
|
@@ -19,8 +21,9 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
19
21
|
var _a, _b;
|
20
22
|
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["show"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
21
23
|
}
|
22
|
-
observeConfig() {
|
24
|
+
observeConfig(newValue) {
|
23
25
|
var _a, _b;
|
26
|
+
this._editor && (this._editor["config"] = newValue);
|
24
27
|
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["reloadList"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
25
28
|
}
|
26
29
|
componentDidLoad() {
|
@@ -37,24 +40,37 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
37
40
|
getContentEditor() {
|
38
41
|
switch (this.config.type) {
|
39
42
|
case FilterItemType.BINARY_SELECT:
|
40
|
-
return "snk-filter-binary-select";
|
43
|
+
return { tag: "snk-filter-binary-select" };
|
41
44
|
case FilterItemType.MULTI_SELECT:
|
42
|
-
return "snk-filter-multi-select";
|
45
|
+
return { tag: "snk-filter-multi-select" };
|
43
46
|
case FilterItemType.PERIOD:
|
44
|
-
return "snk-filter-period";
|
47
|
+
return { tag: "snk-filter-period" };
|
45
48
|
case FilterItemType.SEARCH:
|
46
|
-
return "snk-filter-search";
|
49
|
+
return { tag: "snk-filter-search" };
|
47
50
|
case FilterItemType.NUMBER:
|
48
|
-
return "snk-filter-number";
|
51
|
+
return { tag: "snk-filter-number" };
|
49
52
|
case FilterItemType.PERSONALIZED:
|
50
|
-
|
53
|
+
const snkFilterPersonalizedProps = {
|
54
|
+
tag: "snk-filter-personalized", props: {
|
55
|
+
presentationMode: EPresentationMode.CHIP,
|
56
|
+
onValueChanged: ({ detail }) => {
|
57
|
+
const groupedItems = (detail === null || detail === void 0 ? void 0 : detail.items) || this.config.groupedItems;
|
58
|
+
this.config = Object.assign(Object.assign({}, this.config), { groupedItems, visible: (groupedItems || []).filter(item => item.visible).length > 0 });
|
59
|
+
}
|
60
|
+
}
|
61
|
+
};
|
62
|
+
return snkFilterPersonalizedProps;
|
51
63
|
case FilterItemType.MULTI_LIST:
|
52
|
-
return "snk-entity-list";
|
64
|
+
return { tag: "snk-entity-list" };
|
53
65
|
}
|
54
|
-
return "snk-filter-text";
|
66
|
+
return { tag: "snk-filter-text" };
|
55
67
|
}
|
56
68
|
removeItem() {
|
57
|
-
|
69
|
+
const removedConfig = Object.assign(Object.assign({}, this.config), { visible: false, fixed: false, value: undefined });
|
70
|
+
if (removedConfig.groupedItems != undefined) {
|
71
|
+
removedConfig.groupedItems = removedConfig.groupedItems.map(item => (Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined })));
|
72
|
+
}
|
73
|
+
this.changeConfig(removedConfig);
|
58
74
|
}
|
59
75
|
getPopUpHeaderButtons() {
|
60
76
|
return (h(Fragment, null, !this.config.removalBlocked && this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), !this.config.hardFixed && 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 })))));
|
@@ -69,69 +85,34 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
69
85
|
buttonElement.removeAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
70
86
|
ElementIDUtils.addIDInfoIfNotExists(buttonElement, "button", dataElement);
|
71
87
|
}
|
72
|
-
getNormalizedValue(params, value) {
|
73
|
-
return params.reduce((arrayValues, currentParam, index) => {
|
74
|
-
if (currentParam.dataType === DataType.BOOLEAN && (arrayValues == undefined || arrayValues[index] == undefined)) {
|
75
|
-
arrayValues = arrayValues || [];
|
76
|
-
arrayValues[index] = false;
|
77
|
-
}
|
78
|
-
return arrayValues;
|
79
|
-
}, value);
|
80
|
-
}
|
81
88
|
apply() {
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
if (this.config.type === FilterItemType.PERSONALIZED) {
|
86
|
-
const params = ((_a = this.config.props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || [];
|
87
|
-
value = this.getNormalizedValue(params, value);
|
88
|
-
const paramsCount = params.length;
|
89
|
-
if (paramsCount === 0) {
|
90
|
-
//Valor do filtro personalizado sem parametros deve ser um array vazio
|
91
|
-
value = [];
|
92
|
-
}
|
93
|
-
else {
|
94
|
-
isValid = this.validateAllFilled(paramsCount, value);
|
95
|
-
}
|
96
|
-
}
|
97
|
-
if (isValid) {
|
98
|
-
this.changeConfig(Object.assign(Object.assign({}, this.config), { value: value }));
|
89
|
+
const isValid = PersonalizedFilterUtils.validateVariableValues(this.config, this._editor["value"]);
|
90
|
+
if (!isValid) {
|
91
|
+
return ApplicationUtils.alert(this.getMessage('snkFilterBar.filterModal.validations.notFullFilled.title'), this.getMessage('snkFilterBar.filterModal.validations.notFullFilled.message'));
|
99
92
|
}
|
93
|
+
const valuesArray = this._editor["value"] || this.config.value;
|
94
|
+
this.changeConfig(Object.assign(Object.assign({}, this.config), { visible: this.isVisible(), value: valuesArray }));
|
100
95
|
}
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
if (value != undefined && paramsCount > 1) {
|
105
|
-
if (paramsCount > value.length) {
|
106
|
-
isValid = false;
|
107
|
-
}
|
108
|
-
else {
|
109
|
-
value.forEach(item => {
|
110
|
-
if (item == undefined) {
|
111
|
-
isValid = false;
|
112
|
-
}
|
113
|
-
});
|
114
|
-
}
|
96
|
+
isVisible() {
|
97
|
+
if (this.config.groupedItems && this.config.groupedItems.length > 0) {
|
98
|
+
return this.config.groupedItems.filter(item => item.visible).length > 0;
|
115
99
|
}
|
116
|
-
|
117
|
-
ApplicationUtils.alert("Filtro parcialmente preenchido", "Favor completar todas as informações do filtro.");
|
118
|
-
}
|
119
|
-
return isValid;
|
100
|
+
return true;
|
120
101
|
}
|
121
|
-
/* WARNING: Temporário.*/
|
122
102
|
clear() {
|
123
|
-
var _a
|
103
|
+
var _a;
|
124
104
|
if (FilterItemType.MULTI_LIST === this.config.type) {
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
});
|
129
|
-
(_b = this._editor) === null || _b === void 0 ? void 0 : _b['reloadList']();
|
105
|
+
const configCopy = ObjectUtils.copy(this.config);
|
106
|
+
(_a = configCopy.value) === null || _a === void 0 ? void 0 : _a.forEach(value => !!value && (value.check = false));
|
107
|
+
this.config = ObjectUtils.copy(configCopy);
|
130
108
|
}
|
131
109
|
else {
|
132
110
|
this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined }));
|
133
111
|
}
|
134
112
|
}
|
113
|
+
filterCanBeCleared() {
|
114
|
+
return this.config.type !== FilterItemType.PERSONALIZED;
|
115
|
+
}
|
135
116
|
onKeyDonwListener(event) {
|
136
117
|
if (event.key === "Enter") {
|
137
118
|
this._applyButton.setFocus().then(() => this.apply());
|
@@ -141,10 +122,13 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
141
122
|
return h("ez-icon", { iconName: "delete", onClick: () => this.removeValueFromConfig(item) });
|
142
123
|
}
|
143
124
|
removeValueFromConfig(item) {
|
144
|
-
var _a, _b
|
145
|
-
|
146
|
-
|
147
|
-
|
125
|
+
var _a, _b;
|
126
|
+
if (this.config) {
|
127
|
+
const configCopy = ObjectUtils.copy(this.config);
|
128
|
+
const index = (_a = configCopy.value) === null || _a === void 0 ? void 0 : _a.findIndex(i => (i === null || i === void 0 ? void 0 : i.id) === item.id);
|
129
|
+
(_b = configCopy.value) === null || _b === void 0 ? void 0 : _b.splice(index, 1);
|
130
|
+
this.config = ObjectUtils.copy(configCopy);
|
131
|
+
}
|
148
132
|
}
|
149
133
|
saveConfig(newConfig) {
|
150
134
|
var _a;
|
@@ -155,8 +139,8 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
155
139
|
});
|
156
140
|
}
|
157
141
|
render() {
|
158
|
-
const
|
159
|
-
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(
|
142
|
+
const { tag: CustomElement, props } = this.getContentEditor();
|
143
|
+
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(CustomElement, Object.assign({ maxHeightList: '240px', ref: ref => this._editor = ref, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt), "data-element-id": this._idContentEditor, getMessage: this.getMessage, onSaveConfig: evt => this.saveConfig(evt.detail), rightListSlotBuilder: item => this.buildRightSlot(item) }, props)), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, this.filterCanBeCleared() && (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" }))));
|
160
144
|
}
|
161
145
|
get _element() { return this; }
|
162
146
|
static get watchers() { return {
|