@sankhyalabs/sankhyablocks 5.19.0 → 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 +2 -2
- 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-actions-button/subcomponents/snk-client-confirm.js +1 -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-client-confirm.js +1 -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 +2 -2
- 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-b75ce8b8.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
@@ -1,15 +1,17 @@
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-8c3d76a6.js';
|
2
2
|
import { DataType, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
4
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
4
|
+
import { C as ConfigStorage } from './ConfigStorage-9f4d2e67.js';
|
5
5
|
import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
6
6
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
7
|
+
import { F as FilterOperand } from './index-a255b326.js';
|
7
8
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
9
|
+
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-202cd721.js';
|
8
10
|
import './form-config-fetcher-cac8cd96.js';
|
9
11
|
import './DataFetcher-b3d8b2d5.js';
|
10
12
|
import './_commonjsHelpers-9943807e.js';
|
11
13
|
import './resource-fetcher-02642924.js';
|
12
|
-
import './filter-bar-config-fetcher-
|
14
|
+
import './filter-bar-config-fetcher-bd2070a3.js';
|
13
15
|
|
14
16
|
const buildFilter = (item) => {
|
15
17
|
switch (item.type) {
|
@@ -17,8 +19,8 @@ const buildFilter = (item) => {
|
|
17
19
|
return buildDefault(item);
|
18
20
|
case FilterItemType.BINARY_SELECT:
|
19
21
|
return buildBinary(item);
|
20
|
-
case FilterItemType.
|
21
|
-
return
|
22
|
+
case FilterItemType.MULTI_LIST:
|
23
|
+
return buildMultiList(item);
|
22
24
|
case FilterItemType.PERIOD:
|
23
25
|
return buildPeriod(item);
|
24
26
|
case FilterItemType.SEARCH:
|
@@ -42,9 +44,25 @@ function buildBinary(item) {
|
|
42
44
|
const selectedOption = options.find(opt => opt.name === value);
|
43
45
|
return { name: id, expression: selectedOption.expression, params: [] };
|
44
46
|
}
|
45
|
-
function
|
47
|
+
function buildMultiList(item) {
|
46
48
|
const { id, value, props } = item;
|
47
|
-
|
49
|
+
const parsedValues = parseMultiListValues(value);
|
50
|
+
if (parsedValues.length > 0) {
|
51
|
+
return {
|
52
|
+
name: id,
|
53
|
+
expression: props.expression,
|
54
|
+
params: [{
|
55
|
+
name: id,
|
56
|
+
dataType: DataType.TEXT,
|
57
|
+
value: JSON.stringify(parsedValues)
|
58
|
+
}]
|
59
|
+
};
|
60
|
+
}
|
61
|
+
}
|
62
|
+
function parseMultiListValues(multiListValue) {
|
63
|
+
var _a, _b;
|
64
|
+
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;
|
65
|
+
return value.filter(item => item === null || item === void 0 ? void 0 : item.check).map(({ id }) => Number.isNaN(+id) ? String(id) : Number(id));
|
48
66
|
}
|
49
67
|
function buildPeriod(item) {
|
50
68
|
const { id, value, props } = item;
|
@@ -89,12 +107,13 @@ function buildNumber(item) {
|
|
89
107
|
return { name: id, expression, params: [{ name: id, dataType: DataType.NUMBER, value: toString(DataType.NUMBER, value) }] };
|
90
108
|
}
|
91
109
|
function buildPersonalized(item) {
|
92
|
-
|
93
|
-
const
|
94
|
-
const
|
95
|
-
|
96
|
-
|
97
|
-
|
110
|
+
const { id, groupedItems = [] } = item;
|
111
|
+
const activeFilters = groupedItems.filter(groupItem => !!groupItem.visible);
|
112
|
+
const filters = activeFilters.map(item => {
|
113
|
+
var _a;
|
114
|
+
const expression = item.props.expression;
|
115
|
+
const params = (((_a = item.props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || []).map((param, index) => {
|
116
|
+
const valuesArray = Array.from(item.value || 0);
|
98
117
|
const dataType = param.dataType;
|
99
118
|
let paramValue = (index >= 0 && index < valuesArray.length ? valuesArray[index] : null);
|
100
119
|
if (paramValue != undefined && typeof paramValue === "object" && "value" in paramValue) {
|
@@ -104,30 +123,49 @@ function buildPersonalized(item) {
|
|
104
123
|
paramValue = false;
|
105
124
|
}
|
106
125
|
return { name: param.name, dataType, value: typeof paramValue === "string" ? paramValue : toString(dataType, paramValue) };
|
107
|
-
})
|
108
|
-
|
126
|
+
});
|
127
|
+
return { expression, name: item.id, params };
|
128
|
+
});
|
129
|
+
const expression = filters.map(filter => `(${filter.expression})`).join(` ${FilterOperand.AND} `);
|
130
|
+
const params = filters.flatMap(filter => filter.params);
|
131
|
+
return { name: id, expression, params };
|
109
132
|
}
|
110
133
|
|
111
134
|
class SnkFilterModalFactory {
|
112
|
-
constructor({ filterConfig, onComplete, getMessage }) {
|
135
|
+
constructor({ filterConfig, configName, onComplete, getMessage, onAddPersonalizedFilter, onEditPersonalizedFilter }) {
|
113
136
|
this._filterConfig = filterConfig;
|
137
|
+
this._configName = configName;
|
114
138
|
this._onComplete = onComplete;
|
115
139
|
this._getMessage = getMessage;
|
140
|
+
this._addPersonalizedFilterFn = onAddPersonalizedFilter;
|
141
|
+
this._editPersonalizedFilterFn = onEditPersonalizedFilter;
|
116
142
|
}
|
117
143
|
applyFilters(newFilterConfig) {
|
118
144
|
this._onComplete(newFilterConfig);
|
119
145
|
this._closeModal();
|
120
146
|
}
|
121
147
|
clearAll(filterConfigSnapshot) {
|
122
|
-
return filterConfigSnapshot.map(filterItem =>
|
148
|
+
return filterConfigSnapshot.map(filterItem => {
|
149
|
+
const copy = Object.assign({}, filterItem);
|
150
|
+
delete copy.value;
|
151
|
+
if (filterItem.type === FilterItemType.PERSONALIZED) {
|
152
|
+
copy.visible = false;
|
153
|
+
}
|
154
|
+
if (copy.groupedItems) {
|
155
|
+
copy.groupedItems = this.clearAll(copy.groupedItems);
|
156
|
+
}
|
157
|
+
return copy;
|
158
|
+
});
|
123
159
|
}
|
124
160
|
buildFilterModal() {
|
125
161
|
const filterModal = document.createElement("snk-filter-modal");
|
126
162
|
filterModal.filters = this._filterConfig;
|
163
|
+
filterModal.configName = this._configName;
|
127
164
|
filterModal.getMessage = this._getMessage.bind(this);
|
128
165
|
filterModal.applyFilters = this.applyFilters.bind(this);
|
129
|
-
filterModal.clearAll = this.clearAll.bind(this);
|
130
166
|
filterModal.closeModal = () => this._closeModal();
|
167
|
+
filterModal.addPersonalizedFilter = () => this._addPersonalizedFilterFn();
|
168
|
+
filterModal.editPersonalizedFilter = (id) => this._editPersonalizedFilterFn(id);
|
131
169
|
return filterModal;
|
132
170
|
}
|
133
171
|
async showModal() {
|
@@ -141,9 +179,12 @@ class SnkFilterModalFactory {
|
|
141
179
|
};
|
142
180
|
this._closeModal = await ApplicationUtils.showModal(modalProps);
|
143
181
|
}
|
182
|
+
async closeModal() {
|
183
|
+
this._closeModal();
|
184
|
+
}
|
144
185
|
}
|
145
186
|
|
146
|
-
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%}";
|
187
|
+
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%}";
|
147
188
|
|
148
189
|
const SnkFilterBar = class {
|
149
190
|
constructor(hostRef) {
|
@@ -151,7 +192,8 @@ const SnkFilterBar = class {
|
|
151
192
|
this._updateSequence = [];
|
152
193
|
this._loadingPending = false;
|
153
194
|
this._configUpdated = false;
|
154
|
-
this.
|
195
|
+
this._pendingVariables = false;
|
196
|
+
this._customfiltersToBeUpdated = [];
|
155
197
|
this._calculateSortIndex = (item) => {
|
156
198
|
let index = item.hardFixed ? 1000000 : 0;
|
157
199
|
//campos Hard Fixed não variam a ordem
|
@@ -171,6 +213,8 @@ const SnkFilterBar = class {
|
|
171
213
|
this.messagesBuilder = undefined;
|
172
214
|
this.allowDefault = undefined;
|
173
215
|
this.scrollerLocked = false;
|
216
|
+
this.showPersonalizedFilter = false;
|
217
|
+
this.personalizedFilterId = undefined;
|
174
218
|
}
|
175
219
|
observeFilterConfig(newValue, oldValue) {
|
176
220
|
if (oldValue != undefined && newValue == undefined) {
|
@@ -179,17 +223,28 @@ const SnkFilterBar = class {
|
|
179
223
|
}
|
180
224
|
else {
|
181
225
|
const oldItems = new Map(oldValue ? oldValue.map(item => [item.id, item]) : undefined);
|
182
|
-
newValue.
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
226
|
+
if (oldItems.size === 0 && newValue.length > 0) {
|
227
|
+
this._loadingPending = true;
|
228
|
+
this._configUpdated = false;
|
229
|
+
}
|
230
|
+
else {
|
231
|
+
newValue.forEach(newItem => {
|
232
|
+
const oldItem = oldItems.get(newItem.id);
|
233
|
+
if (oldItem != undefined) {
|
234
|
+
this._configUpdated = this._configUpdated || ObjectUtils.objectToString(oldItem) != ObjectUtils.objectToString(newItem);
|
235
|
+
this._loadingPending = this._loadingPending || ObjectUtils.objectToString(oldItem.value) !== ObjectUtils.objectToString(newItem.value);
|
236
|
+
if (!this._loadingPending) {
|
237
|
+
const groupedChanged = ObjectUtils.objectToString(oldItem.groupedItems) != ObjectUtils.objectToString(newItem.groupedItems);
|
238
|
+
this._configUpdated = this._configUpdated || groupedChanged;
|
239
|
+
this._loadingPending = this._loadingPending || groupedChanged;
|
240
|
+
}
|
241
|
+
}
|
242
|
+
else {
|
243
|
+
this._configUpdated = true;
|
244
|
+
this._loadingPending = this._loadingPending || newItem.value != undefined;
|
245
|
+
}
|
246
|
+
});
|
247
|
+
}
|
193
248
|
}
|
194
249
|
this.processAfterUpdateConfig();
|
195
250
|
}
|
@@ -206,30 +261,31 @@ const SnkFilterBar = class {
|
|
206
261
|
}
|
207
262
|
}
|
208
263
|
processPendingFilter() {
|
209
|
-
if (this.
|
210
|
-
|
211
|
-
if (
|
212
|
-
|
213
|
-
this.
|
214
|
-
this.processPendingFilter();
|
264
|
+
if (this._pendingVariables) {
|
265
|
+
const popUp = this._element.querySelector("#filter-PERSONALIZED_FILTER_GROUP");
|
266
|
+
if (popUp) {
|
267
|
+
popUp.showUp(true).then(() => {
|
268
|
+
this.processAfterUpdateConfig();
|
215
269
|
});
|
216
270
|
}
|
217
271
|
}
|
218
|
-
|
272
|
+
else {
|
219
273
|
this.processAfterUpdateConfig();
|
220
274
|
}
|
221
275
|
}
|
222
|
-
processAfterUpdateConfig() {
|
223
|
-
if (this._pendingFilters.length > 0) {
|
224
|
-
return;
|
225
|
-
}
|
276
|
+
async processAfterUpdateConfig() {
|
226
277
|
if (this._loadingPending) {
|
227
|
-
this.
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
});
|
278
|
+
const personalizedFilter = this.filterConfig.find(item => {
|
279
|
+
if (item.type === FilterItemType.PERSONALIZED) {
|
280
|
+
return true;
|
281
|
+
}
|
232
282
|
});
|
283
|
+
this._pendingVariables = !PersonalizedFilterUtils.validateVariableValues(personalizedFilter);
|
284
|
+
if (this._pendingVariables) {
|
285
|
+
return;
|
286
|
+
}
|
287
|
+
this._loadingPending = false;
|
288
|
+
this.dataUnit.loadData();
|
233
289
|
}
|
234
290
|
if (this._configUpdated) {
|
235
291
|
this._configUpdated = false;
|
@@ -258,7 +314,14 @@ const SnkFilterBar = class {
|
|
258
314
|
return filters;
|
259
315
|
}
|
260
316
|
isActiveFilter(item) {
|
261
|
-
|
317
|
+
/*
|
318
|
+
- O filtro padrão também deve sempre ser condiderado ativo, pois, sempre deve
|
319
|
+
ser aplicado.
|
320
|
+
*/
|
321
|
+
if (item.type === FilterItemType.DEFAULT_FILTER) {
|
322
|
+
return true;
|
323
|
+
}
|
324
|
+
return item.visible && (item.groupedItems || item.value != undefined);
|
262
325
|
}
|
263
326
|
registryFilterProvider() {
|
264
327
|
this.dataUnit.addFilterProvider(this);
|
@@ -278,12 +341,16 @@ const SnkFilterBar = class {
|
|
278
341
|
}
|
279
342
|
});
|
280
343
|
}
|
344
|
+
filterActiveFilter(item) {
|
345
|
+
return item.visible || item.removalBlocked;
|
346
|
+
}
|
281
347
|
getFilterItems() {
|
282
348
|
const pinnedItems = [];
|
283
349
|
const unpinnedItems = [];
|
284
350
|
this.filterConfig
|
285
|
-
.filter(
|
351
|
+
.filter(this.filterActiveFilter)
|
286
352
|
.forEach((item, index) => {
|
353
|
+
item = ObjectUtils.copy(item);
|
287
354
|
const itemId = `filter-${item.id}`;
|
288
355
|
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 }));
|
289
356
|
if (item.fixed || item.hardFixed) {
|
@@ -337,19 +404,16 @@ const SnkFilterBar = class {
|
|
337
404
|
this._application.isUserSup().then(value => this.allowDefault = value);
|
338
405
|
}
|
339
406
|
loadConfigFromStorage() {
|
340
|
-
|
341
|
-
|
342
|
-
.
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
})
|
351
|
-
.catch(reason => {
|
352
|
-
throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
|
407
|
+
return new Promise(accept => {
|
408
|
+
ConfigStorage.get().then(instance => {
|
409
|
+
instance.loadFilterBarConfig(this.configName)
|
410
|
+
.then((filters) => {
|
411
|
+
accept();
|
412
|
+
this.filterConfig = filters.map(item => this.normalizeItem(item));
|
413
|
+
})
|
414
|
+
.catch(reason => {
|
415
|
+
throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
|
416
|
+
});
|
353
417
|
});
|
354
418
|
});
|
355
419
|
}
|
@@ -389,12 +453,34 @@ const SnkFilterBar = class {
|
|
389
453
|
this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
|
390
454
|
};
|
391
455
|
const factoryParams = {
|
392
|
-
filterConfig: this.filterConfig,
|
456
|
+
filterConfig: ObjectUtils.copy(this.filterConfig),
|
457
|
+
configName: this.configName,
|
393
458
|
onComplete: callbackOnApplyFilter,
|
394
|
-
getMessage: (key, props) => this.getMessage(key, props)
|
459
|
+
getMessage: (key, props) => this.getMessage(key, props),
|
460
|
+
onAddPersonalizedFilter: () => this.addPersonalizedFilter(),
|
461
|
+
onEditPersonalizedFilter: (id) => this.editPersonalizedFilter(id)
|
395
462
|
};
|
396
|
-
|
397
|
-
await
|
463
|
+
this._filterModalFactory = new SnkFilterModalFactory(factoryParams);
|
464
|
+
await this._filterModalFactory.showModal();
|
465
|
+
}
|
466
|
+
addPersonalizedFilter() {
|
467
|
+
this._filterModalFactory.closeModal();
|
468
|
+
this.personalizedFilterId = undefined;
|
469
|
+
this.showPersonalizedFilter = true;
|
470
|
+
window.requestAnimationFrame(() => {
|
471
|
+
this._elPersonalizedFilter.createPersonalizedFilter();
|
472
|
+
});
|
473
|
+
}
|
474
|
+
editPersonalizedFilter(id) {
|
475
|
+
this._filterModalFactory.closeModal();
|
476
|
+
this.showPersonalizedFilter = true;
|
477
|
+
this.personalizedFilterId = id;
|
478
|
+
}
|
479
|
+
hidePersonalizedFilter() {
|
480
|
+
this.loadConfigFromStorage().then(() => {
|
481
|
+
this.personalizedFilterId = undefined;
|
482
|
+
this.showPersonalizedFilter = false;
|
483
|
+
});
|
398
484
|
}
|
399
485
|
componentWillLoad() {
|
400
486
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
@@ -411,7 +497,10 @@ const SnkFilterBar = class {
|
|
411
497
|
if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
|
412
498
|
return undefined;
|
413
499
|
}
|
414
|
-
|
500
|
+
if (this.showPersonalizedFilter) {
|
501
|
+
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 });
|
502
|
+
}
|
503
|
+
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" })));
|
415
504
|
}
|
416
505
|
get _element() { return getElement(this); }
|
417
506
|
static get watchers() { return {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8c3d76a6.js';
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
4
4
|
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
@@ -1,11 +1,14 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-8c3d76a6.js';
|
2
2
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
4
|
-
import { ApplicationContext, ElementIDUtils,
|
5
|
-
import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher-
|
4
|
+
import { ApplicationContext, ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
5
|
+
import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher-bd2070a3.js';
|
6
|
+
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
7
|
+
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-202cd721.js';
|
6
8
|
import './resource-fetcher-02642924.js';
|
7
9
|
import './DataFetcher-b3d8b2d5.js';
|
8
10
|
import './_commonjsHelpers-9943807e.js';
|
11
|
+
import './index-a255b326.js';
|
9
12
|
|
10
13
|
const SnkFilterDetail = class {
|
11
14
|
constructor(hostRef) {
|
@@ -21,8 +24,9 @@ const SnkFilterDetail = class {
|
|
21
24
|
var _a, _b;
|
22
25
|
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["show"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
23
26
|
}
|
24
|
-
observeConfig() {
|
27
|
+
observeConfig(newValue) {
|
25
28
|
var _a, _b;
|
29
|
+
this._editor && (this._editor["config"] = newValue);
|
26
30
|
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["reloadList"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
27
31
|
}
|
28
32
|
componentDidLoad() {
|
@@ -39,24 +43,37 @@ const SnkFilterDetail = class {
|
|
39
43
|
getContentEditor() {
|
40
44
|
switch (this.config.type) {
|
41
45
|
case FilterItemType.BINARY_SELECT:
|
42
|
-
return "snk-filter-binary-select";
|
46
|
+
return { tag: "snk-filter-binary-select" };
|
43
47
|
case FilterItemType.MULTI_SELECT:
|
44
|
-
return "snk-filter-multi-select";
|
48
|
+
return { tag: "snk-filter-multi-select" };
|
45
49
|
case FilterItemType.PERIOD:
|
46
|
-
return "snk-filter-period";
|
50
|
+
return { tag: "snk-filter-period" };
|
47
51
|
case FilterItemType.SEARCH:
|
48
|
-
return "snk-filter-search";
|
52
|
+
return { tag: "snk-filter-search" };
|
49
53
|
case FilterItemType.NUMBER:
|
50
|
-
return "snk-filter-number";
|
54
|
+
return { tag: "snk-filter-number" };
|
51
55
|
case FilterItemType.PERSONALIZED:
|
52
|
-
|
56
|
+
const snkFilterPersonalizedProps = {
|
57
|
+
tag: "snk-filter-personalized", props: {
|
58
|
+
presentationMode: EPresentationMode.CHIP,
|
59
|
+
onValueChanged: ({ detail }) => {
|
60
|
+
const groupedItems = (detail === null || detail === void 0 ? void 0 : detail.items) || this.config.groupedItems;
|
61
|
+
this.config = Object.assign(Object.assign({}, this.config), { groupedItems, visible: (groupedItems || []).filter(item => item.visible).length > 0 });
|
62
|
+
}
|
63
|
+
}
|
64
|
+
};
|
65
|
+
return snkFilterPersonalizedProps;
|
53
66
|
case FilterItemType.MULTI_LIST:
|
54
|
-
return "snk-entity-list";
|
67
|
+
return { tag: "snk-entity-list" };
|
55
68
|
}
|
56
|
-
return "snk-filter-text";
|
69
|
+
return { tag: "snk-filter-text" };
|
57
70
|
}
|
58
71
|
removeItem() {
|
59
|
-
|
72
|
+
const removedConfig = Object.assign(Object.assign({}, this.config), { visible: false, fixed: false, value: undefined });
|
73
|
+
if (removedConfig.groupedItems != undefined) {
|
74
|
+
removedConfig.groupedItems = removedConfig.groupedItems.map(item => (Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined })));
|
75
|
+
}
|
76
|
+
this.changeConfig(removedConfig);
|
60
77
|
}
|
61
78
|
getPopUpHeaderButtons() {
|
62
79
|
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 })))));
|
@@ -71,69 +88,34 @@ const SnkFilterDetail = class {
|
|
71
88
|
buttonElement.removeAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
72
89
|
ElementIDUtils.addIDInfoIfNotExists(buttonElement, "button", dataElement);
|
73
90
|
}
|
74
|
-
getNormalizedValue(params, value) {
|
75
|
-
return params.reduce((arrayValues, currentParam, index) => {
|
76
|
-
if (currentParam.dataType === DataType.BOOLEAN && (arrayValues == undefined || arrayValues[index] == undefined)) {
|
77
|
-
arrayValues = arrayValues || [];
|
78
|
-
arrayValues[index] = false;
|
79
|
-
}
|
80
|
-
return arrayValues;
|
81
|
-
}, value);
|
82
|
-
}
|
83
91
|
apply() {
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
if (this.config.type === FilterItemType.PERSONALIZED) {
|
88
|
-
const params = ((_a = this.config.props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || [];
|
89
|
-
value = this.getNormalizedValue(params, value);
|
90
|
-
const paramsCount = params.length;
|
91
|
-
if (paramsCount === 0) {
|
92
|
-
//Valor do filtro personalizado sem parametros deve ser um array vazio
|
93
|
-
value = [];
|
94
|
-
}
|
95
|
-
else {
|
96
|
-
isValid = this.validateAllFilled(paramsCount, value);
|
97
|
-
}
|
98
|
-
}
|
99
|
-
if (isValid) {
|
100
|
-
this.changeConfig(Object.assign(Object.assign({}, this.config), { value: value }));
|
92
|
+
const isValid = PersonalizedFilterUtils.validateVariableValues(this.config, this._editor["value"]);
|
93
|
+
if (!isValid) {
|
94
|
+
return ApplicationUtils.alert(this.getMessage('snkFilterBar.filterModal.validations.notFullFilled.title'), this.getMessage('snkFilterBar.filterModal.validations.notFullFilled.message'));
|
101
95
|
}
|
96
|
+
const valuesArray = this._editor["value"] || this.config.value;
|
97
|
+
this.changeConfig(Object.assign(Object.assign({}, this.config), { visible: this.isVisible(), value: valuesArray }));
|
102
98
|
}
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
if (value != undefined && paramsCount > 1) {
|
107
|
-
if (paramsCount > value.length) {
|
108
|
-
isValid = false;
|
109
|
-
}
|
110
|
-
else {
|
111
|
-
value.forEach(item => {
|
112
|
-
if (item == undefined) {
|
113
|
-
isValid = false;
|
114
|
-
}
|
115
|
-
});
|
116
|
-
}
|
99
|
+
isVisible() {
|
100
|
+
if (this.config.groupedItems && this.config.groupedItems.length > 0) {
|
101
|
+
return this.config.groupedItems.filter(item => item.visible).length > 0;
|
117
102
|
}
|
118
|
-
|
119
|
-
ApplicationUtils.alert("Filtro parcialmente preenchido", "Favor completar todas as informações do filtro.");
|
120
|
-
}
|
121
|
-
return isValid;
|
103
|
+
return true;
|
122
104
|
}
|
123
|
-
/* WARNING: Temporário.*/
|
124
105
|
clear() {
|
125
|
-
var _a
|
106
|
+
var _a;
|
126
107
|
if (FilterItemType.MULTI_LIST === this.config.type) {
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
});
|
131
|
-
(_b = this._editor) === null || _b === void 0 ? void 0 : _b['reloadList']();
|
108
|
+
const configCopy = ObjectUtils.copy(this.config);
|
109
|
+
(_a = configCopy.value) === null || _a === void 0 ? void 0 : _a.forEach(value => !!value && (value.check = false));
|
110
|
+
this.config = ObjectUtils.copy(configCopy);
|
132
111
|
}
|
133
112
|
else {
|
134
113
|
this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined }));
|
135
114
|
}
|
136
115
|
}
|
116
|
+
filterCanBeCleared() {
|
117
|
+
return this.config.type !== FilterItemType.PERSONALIZED;
|
118
|
+
}
|
137
119
|
onKeyDonwListener(event) {
|
138
120
|
if (event.key === "Enter") {
|
139
121
|
this._applyButton.setFocus().then(() => this.apply());
|
@@ -143,10 +125,13 @@ const SnkFilterDetail = class {
|
|
143
125
|
return h("ez-icon", { iconName: "delete", onClick: () => this.removeValueFromConfig(item) });
|
144
126
|
}
|
145
127
|
removeValueFromConfig(item) {
|
146
|
-
var _a, _b
|
147
|
-
|
148
|
-
|
149
|
-
|
128
|
+
var _a, _b;
|
129
|
+
if (this.config) {
|
130
|
+
const configCopy = ObjectUtils.copy(this.config);
|
131
|
+
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);
|
132
|
+
(_b = configCopy.value) === null || _b === void 0 ? void 0 : _b.splice(index, 1);
|
133
|
+
this.config = ObjectUtils.copy(configCopy);
|
134
|
+
}
|
150
135
|
}
|
151
136
|
saveConfig(newConfig) {
|
152
137
|
var _a;
|
@@ -157,8 +142,8 @@ const SnkFilterDetail = class {
|
|
157
142
|
});
|
158
143
|
}
|
159
144
|
render() {
|
160
|
-
const
|
161
|
-
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(
|
145
|
+
const { tag: CustomElement, props } = this.getContentEditor();
|
146
|
+
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" }))));
|
162
147
|
}
|
163
148
|
get _element() { return getElement(this); }
|
164
149
|
static get watchers() { return {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8c3d76a6.js';
|
2
2
|
import { FloatingManager, DateUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
4
4
|
|
@@ -6,7 +6,7 @@ const SnkFilterItem = class {
|
|
6
6
|
constructor(hostRef) {
|
7
7
|
registerInstance(this, hostRef);
|
8
8
|
this.visibleChanged = createEvent(this, "visibleChanged", 7);
|
9
|
-
this.filterChange = createEvent(this, "filterChange",
|
9
|
+
this.filterChange = createEvent(this, "filterChange", 3);
|
10
10
|
this.innerClickCheck = (_floatingContainer, node) => {
|
11
11
|
if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
|
12
12
|
return true;
|
@@ -116,8 +116,8 @@ const SnkFilterItem = class {
|
|
116
116
|
}
|
117
117
|
getLabel(isTooltipLabel = false) {
|
118
118
|
var _a;
|
119
|
-
const { type, value, label, props } = this.config;
|
120
|
-
if (value) {
|
119
|
+
const { type, value, label, props, groupedItems = [] } = this.config;
|
120
|
+
if (value || groupedItems.length) {
|
121
121
|
if (type === FilterItemType.BINARY_SELECT) {
|
122
122
|
const [optOne, optTwo] = props.options;
|
123
123
|
const tooltip = this.getMessage('snkFilterBar.binarySelectTooltip');
|
@@ -169,7 +169,14 @@ const SnkFilterItem = class {
|
|
169
169
|
return `${label}: ${value.value} - ${value.label}`;
|
170
170
|
}
|
171
171
|
if (type === FilterItemType.PERSONALIZED) {
|
172
|
-
|
172
|
+
const activeCount = groupedItems.reduce((total, item) => {
|
173
|
+
if (!!item.visible)
|
174
|
+
return total + 1;
|
175
|
+
return total;
|
176
|
+
}, 0);
|
177
|
+
if (activeCount <= 0)
|
178
|
+
return label;
|
179
|
+
return `${label}: ${this.getMessage('snkFilterBar.personalizedCount', { activeCount })}`;
|
173
180
|
}
|
174
181
|
if (type === FilterItemType.MULTI_LIST) {
|
175
182
|
const selectedOptions = ((_a = value.elements) !== null && _a !== void 0 ? _a : value).filter(item => item === null || item === void 0 ? void 0 : item.check);
|
@@ -235,10 +242,17 @@ const SnkFilterItem = class {
|
|
235
242
|
}
|
236
243
|
return undefined;
|
237
244
|
}
|
238
|
-
|
245
|
+
getEnabledChip() {
|
239
246
|
var _a, _b, _c, _d;
|
247
|
+
if (this.config.type === FilterItemType.PERSONALIZED) {
|
248
|
+
const { groupedItems = [] } = this.config;
|
249
|
+
return groupedItems.some(item => item.visible);
|
250
|
+
}
|
251
|
+
return (FilterItemType.MULTI_LIST != this.config.type && this.config.value != undefined) || (((_d = (_c = ((_b = (_a = this.config.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : this.config.value)) === null || _c === void 0 ? void 0 : _c.filter(value => value === null || value === void 0 ? void 0 : value.check)) === null || _d === void 0 ? void 0 : _d.length) > 0);
|
252
|
+
}
|
253
|
+
render() {
|
240
254
|
const leftIcon = this.getLeftIconName();
|
241
|
-
return (h(Host, Object.assign({}, this.applyTooltip()), h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value:
|
255
|
+
return (h(Host, Object.assign({}, this.applyTooltip()), h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
|
242
256
|
}
|
243
257
|
get _filterItemElement() { return getElement(this); }
|
244
258
|
static get watchers() { return {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8c3d76a6.js';
|
2
2
|
import { FloatingManager, ElementIDUtils, ArrayUtils } from '@sankhyalabs/core';
|
3
3
|
|
4
4
|
const SHOW_MORE_ITEM_NAME = "__SHOWMORE__";
|