@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
@@ -33,6 +33,7 @@ const ListItem = ({ userInterface, description }) => {
|
|
33
33
|
const snkFilterFieldSearchCss = ".sc-snk-filter-field-search-h{--snk-filter-field-search--container-width:468px;--snk-filter-field-search--container-height:322px}.snk-filter-field-search__container.sc-snk-filter-field-search{display:flex;flex-direction:column;padding:var(--space--medium);width:var(--snk-filter-field-search--container-width);height:var(--snk-filter-field-search--container-height)}.snk-filter-field-search__section.sc-snk-filter-field-search{display:grid;grid-template-columns:1fr 1fr;place-items:flex-start;overflow:hidden;gap:var(--space--small)}.snk-filter-field-search__input.sc-snk-filter-field-search{margin-bottom:var(--space--medium)}.snk-filter-field-search__list_container.sc-snk-filter-field-search{display:flex;flex-direction:column}.snk-filter-field-search__list.sc-snk-filter-field-search{overflow-y:auto}";
|
34
34
|
|
35
35
|
const SNK_CONTEXT_KEY = "__SNK__APPLICATION__";
|
36
|
+
const ENTITY_NAME_PATTERN = /\w+:\/\/(\w+)/;
|
36
37
|
const SnkFilterFieldSearch = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
37
38
|
constructor() {
|
38
39
|
super();
|
@@ -47,6 +48,8 @@ const SnkFilterFieldSearch = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
47
48
|
this.breadcrumbItems = [];
|
48
49
|
this.linkItems = [];
|
49
50
|
this.fieldItems = [];
|
51
|
+
this.searchEmpty = false;
|
52
|
+
this.groupEmpty = false;
|
50
53
|
}
|
51
54
|
/**
|
52
55
|
* Realiza a abertura do componente e faz a primeira carga
|
@@ -68,6 +71,7 @@ const SnkFilterFieldSearch = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
68
71
|
this.handleFilterChange(filterText);
|
69
72
|
}
|
70
73
|
async loadData() {
|
74
|
+
var _a, _b;
|
71
75
|
this._isLoading = true;
|
72
76
|
let metadata;
|
73
77
|
if (this._currentLink != undefined) {
|
@@ -85,14 +89,15 @@ const SnkFilterFieldSearch = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
85
89
|
this.mapDataSourceToLinkItems();
|
86
90
|
this.mapDataSourceToFieldItems();
|
87
91
|
this._isLoading = false;
|
88
|
-
this._ezFieldList.scrollToTop();
|
89
|
-
this._ezLinkList.scrollToTop();
|
92
|
+
(_a = this._ezFieldList) === null || _a === void 0 ? void 0 : _a.scrollToTop();
|
93
|
+
(_b = this._ezLinkList) === null || _b === void 0 ? void 0 : _b.scrollToTop();
|
90
94
|
}
|
91
95
|
mapDataSourceToLinkItems() {
|
92
96
|
var _a;
|
93
97
|
const { links } = this._currentMetadata;
|
94
98
|
const filterLinkLabelMessage = this.getMessage('snkFilterFieldSearch.linkLabel', { link: (_a = this._currentLink) === null || _a === void 0 ? void 0 : _a.description });
|
95
99
|
const items = links.map(link => (Object.assign({ label: link.description }, link)));
|
100
|
+
this.groupEmpty = Boolean(items.length === 0);
|
96
101
|
this.linkItems = [{
|
97
102
|
group: filterLinkLabelMessage,
|
98
103
|
items,
|
@@ -103,7 +108,7 @@ const SnkFilterFieldSearch = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
103
108
|
}
|
104
109
|
mapDataSourceToFieldItems() {
|
105
110
|
var _a;
|
106
|
-
const
|
111
|
+
const fields = this._currentMetadata.fields;
|
107
112
|
const filterFieldLabelMessage = this.getMessage('snkFilterFieldSearch.fieldLabel', { link: (_a = this._currentLink) === null || _a === void 0 ? void 0 : _a.description });
|
108
113
|
const filteredFields = fields.filter(field => {
|
109
114
|
if (!this._currentLink)
|
@@ -113,6 +118,7 @@ const SnkFilterFieldSearch = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
113
118
|
return searchableByDescription || searchableByName;
|
114
119
|
});
|
115
120
|
const items = filteredFields.map(field => (Object.assign({ label: field.description }, field)));
|
121
|
+
this.searchEmpty = Boolean(this._filterText && items.length === 0);
|
116
122
|
this.fieldItems = [{
|
117
123
|
group: filterFieldLabelMessage,
|
118
124
|
items
|
@@ -140,10 +146,17 @@ const SnkFilterFieldSearch = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
140
146
|
this.ezSelectFilterItem.emit(selectedItem);
|
141
147
|
this.loadData();
|
142
148
|
}
|
149
|
+
getEntityFromBreadCrumbItem(item) {
|
150
|
+
const result = ENTITY_NAME_PATTERN.exec(item.uri);
|
151
|
+
if (!result) {
|
152
|
+
return undefined;
|
153
|
+
}
|
154
|
+
return result[1];
|
155
|
+
}
|
143
156
|
handleSelectField({ detail: item }) {
|
144
157
|
var _a;
|
145
158
|
const breadcrumbPath = this.breadcrumbItems.map(breadcrumbItem => breadcrumbItem.label).join('>>');
|
146
|
-
const selectedField = Object.assign(Object.assign({}, item), { type: SelectedItemType.FIELD, path: `${breadcrumbPath} >> ${item.description}` });
|
159
|
+
const selectedField = Object.assign(Object.assign({}, item), { type: SelectedItemType.FIELD, entityPath: this.breadcrumbItems.map(item => this.getEntityFromBreadCrumbItem(item)).filter(item => item != undefined), path: `${breadcrumbPath} >> ${item.description}` });
|
147
160
|
this.ezSelectFilterItem.emit(selectedField);
|
148
161
|
(_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.hide();
|
149
162
|
}
|
@@ -179,7 +192,13 @@ const SnkFilterFieldSearch = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
179
192
|
render() {
|
180
193
|
var _a;
|
181
194
|
const searchLabelMessage = this.getMessage('snkFilterFieldSearch.searchLabel');
|
182
|
-
return (h("ez-popover", Object.assign({ ref: (el) => this._ezPopover = el, role: "dialog", overlayType: "none", "aria-hidden": !((_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.opened) }, this.getElementID('EzPopover')), h("div", { class: "snk-filter-field-search__container" }, h("header", { class: "snk-filter-field-search__header" }, this.searchable && !!searchLabelMessage && (h("ez-filter-input", Object.assign({ class: "snk-filter-field-search__input", label: searchLabelMessage, asyncSearch: true, canShowError: false, onEzSearching: (event) => this.handleFilterChange.bind(this)(event.detail), "aria-label": searchLabelMessage, "aria-required": "false", "aria-invalid": "false" }, this.getElementID('EzFilterInput')))), this.breadcrumbItems.length > 0 && (h("ez-breadcrumb", Object.assign({ items: this.breadcrumbItems, onSelectedItem: this.handleSelectLink.bind(this), role: "navigation", "aria-current": "step" }, this.getElementID('EzBreadcrumb')))), h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" })), h("section", { class:
|
195
|
+
return (h("ez-popover", Object.assign({ ref: (el) => this._ezPopover = el, role: "dialog", overlayType: "none", "aria-hidden": !((_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.opened) }, this.getElementID('EzPopover')), h("div", { class: "snk-filter-field-search__container" }, h("header", { class: "snk-filter-field-search__header" }, this.searchable && !!searchLabelMessage && (h("ez-filter-input", Object.assign({ class: "snk-filter-field-search__input", label: searchLabelMessage, asyncSearch: true, canShowError: false, onEzSearching: (event) => this.handleFilterChange.bind(this)(event.detail), "aria-label": searchLabelMessage, "aria-required": "false", "aria-invalid": "false" }, this.getElementID('EzFilterInput')))), this.breadcrumbItems.length > 0 && (h("ez-breadcrumb", Object.assign({ items: this.breadcrumbItems, onSelectedItem: this.handleSelectLink.bind(this), role: "navigation", "aria-current": "step" }, this.getElementID('EzBreadcrumb')))), h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" })), h("section", { class: `snk-filter-field-search__section ${(this.groupEmpty && this.searchEmpty) && " ez-margin--auto"}` }, this.groupEmpty ?
|
196
|
+
h("div", { class: "ez-margin--auto" }, h("span", { class: "ez-text ez-text--secondary ez-text--medium" }, this.getMessage('snkFilterFieldSearch.groupEmpty')))
|
197
|
+
:
|
198
|
+
h("ez-list", Object.assign({ ref: (el) => this._ezLinkList = el, class: "snk-filter-field-search__list", id: "filterLinkList", useGroups: true, dataSource: this.linkItems, onEzSelectItem: this.handleSelectLink.bind(this), hoverFeedback: true, ezSelectable: true, itemSlotBuilder: listItem => h("ez-badge", { label: listItem.fieldCount }), "aria-describedby": "filterLinkLabel" }, this.getElementID('EzListLinks'))), this.searchEmpty ?
|
199
|
+
h("div", { class: "ez-margin--auto" }, h("span", { class: "ez-text ez-text--secondary ez-text--medium" }, this.getMessage('snkFilterFieldSearch.searchEmpty')))
|
200
|
+
:
|
201
|
+
h("ez-list", Object.assign({ ref: (el) => this._ezFieldList = el, class: "snk-filter-field-search__list", id: "filterFieldList", useGroups: true, dataSource: this.fieldItems, onEzSelectItem: this.handleSelectField.bind(this), hoverFeedback: true, ezSelectable: true, itemSlotBuilder: ListItem, "aria-describedby": "filterFieldLabel" }, this.getElementID('EzListFields')))))));
|
183
202
|
}
|
184
203
|
static get style() { return snkFilterFieldSearchCss; }
|
185
204
|
}, [2, "snk-filter-field-search", {
|
@@ -188,6 +207,8 @@ const SnkFilterFieldSearch = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
188
207
|
"breadcrumbItems": [32],
|
189
208
|
"linkItems": [32],
|
190
209
|
"fieldItems": [32],
|
210
|
+
"searchEmpty": [32],
|
211
|
+
"groupEmpty": [32],
|
191
212
|
"show": [64],
|
192
213
|
"applyFilter": [64]
|
193
214
|
}]);
|
@@ -8,7 +8,7 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
8
8
|
super();
|
9
9
|
this.__registerHost();
|
10
10
|
this.visibleChanged = createEvent(this, "visibleChanged", 7);
|
11
|
-
this.filterChange = createEvent(this, "filterChange",
|
11
|
+
this.filterChange = createEvent(this, "filterChange", 3);
|
12
12
|
this.innerClickCheck = (_floatingContainer, node) => {
|
13
13
|
if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
|
14
14
|
return true;
|
@@ -118,8 +118,8 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
118
118
|
}
|
119
119
|
getLabel(isTooltipLabel = false) {
|
120
120
|
var _a;
|
121
|
-
const { type, value, label, props } = this.config;
|
122
|
-
if (value) {
|
121
|
+
const { type, value, label, props, groupedItems = [] } = this.config;
|
122
|
+
if (value || groupedItems.length) {
|
123
123
|
if (type === FilterItemType.BINARY_SELECT) {
|
124
124
|
const [optOne, optTwo] = props.options;
|
125
125
|
const tooltip = this.getMessage('snkFilterBar.binarySelectTooltip');
|
@@ -171,7 +171,14 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
171
171
|
return `${label}: ${value.value} - ${value.label}`;
|
172
172
|
}
|
173
173
|
if (type === FilterItemType.PERSONALIZED) {
|
174
|
-
|
174
|
+
const activeCount = groupedItems.reduce((total, item) => {
|
175
|
+
if (!!item.visible)
|
176
|
+
return total + 1;
|
177
|
+
return total;
|
178
|
+
}, 0);
|
179
|
+
if (activeCount <= 0)
|
180
|
+
return label;
|
181
|
+
return `${label}: ${this.getMessage('snkFilterBar.personalizedCount', { activeCount })}`;
|
175
182
|
}
|
176
183
|
if (type === FilterItemType.MULTI_LIST) {
|
177
184
|
const selectedOptions = ((_a = value.elements) !== null && _a !== void 0 ? _a : value).filter(item => item === null || item === void 0 ? void 0 : item.check);
|
@@ -237,10 +244,17 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
237
244
|
}
|
238
245
|
return undefined;
|
239
246
|
}
|
240
|
-
|
247
|
+
getEnabledChip() {
|
241
248
|
var _a, _b, _c, _d;
|
249
|
+
if (this.config.type === FilterItemType.PERSONALIZED) {
|
250
|
+
const { groupedItems = [] } = this.config;
|
251
|
+
return groupedItems.some(item => item.visible);
|
252
|
+
}
|
253
|
+
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);
|
254
|
+
}
|
255
|
+
render() {
|
242
256
|
const leftIcon = this.getLeftIconName();
|
243
|
-
return (h(Host, Object.assign({}, this.applyTooltip()), h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value:
|
257
|
+
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 }))));
|
244
258
|
}
|
245
259
|
get _filterItemElement() { return this; }
|
246
260
|
static get watchers() { return {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
-
import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
2
|
+
import { ElementIDUtils, ApplicationContext, ObjectUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
4
|
import { E as EPresentationMode } from './presentationMode.js';
|
5
|
-
import {
|
5
|
+
import { C as ConfigStorage } from './ConfigStorage.js';
|
6
6
|
|
7
7
|
var FilterType;
|
8
8
|
(function (FilterType) {
|
@@ -19,43 +19,63 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
19
19
|
super();
|
20
20
|
this.__registerHost();
|
21
21
|
this.filterChange = createEvent(this, "filterChange", 7);
|
22
|
+
this.editPersonalizedFilter = createEvent(this, "editPersonalizedFilter", 7);
|
23
|
+
this.addPersonalizedFilter = createEvent(this, "addPersonalizedFilter", 7);
|
22
24
|
this.filterItem = undefined;
|
25
|
+
this.configName = undefined;
|
23
26
|
}
|
24
27
|
observeFilterItem(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
|
this.filterChange.emit(newValue);
|
28
|
-
|
32
|
+
//isso faz o filtro salvar o estado precocemente. Caso: Botão limpar filtro dispara dezenas de vezes
|
33
|
+
//this.saveConfig();
|
29
34
|
}
|
30
35
|
getContentEditorConfig() {
|
31
|
-
const
|
36
|
+
const props = { presentationMode: EPresentationMode.MODAL };
|
32
37
|
switch (this.filterItem.type) {
|
33
38
|
case FilterItemType.BINARY_SELECT:
|
34
|
-
return { tag: "snk-filter-binary-select",
|
39
|
+
return { tag: "snk-filter-binary-select", props };
|
35
40
|
case FilterItemType.MULTI_SELECT:
|
36
41
|
return { tag: "snk-filter-multi-select" };
|
37
42
|
case FilterItemType.PERIOD:
|
38
|
-
return { tag: "snk-filter-period",
|
43
|
+
return { tag: "snk-filter-period", props };
|
39
44
|
case FilterItemType.SEARCH:
|
40
45
|
return { tag: "snk-filter-search" };
|
41
46
|
case FilterItemType.NUMBER:
|
42
47
|
return { tag: "snk-filter-number" };
|
43
48
|
case FilterItemType.PERSONALIZED:
|
44
|
-
|
49
|
+
const snkFilterPersonalizedProps = {
|
50
|
+
tag: "snk-filter-personalized", props: {
|
51
|
+
onDeleteFilter: (event) => this.handleDeleteFilter(event.detail, FilterItemType.PERSONALIZED),
|
52
|
+
onEditFilter: (event) => this.editPersonalizedFilter.emit(event.detail),
|
53
|
+
onAddFilter: () => this.addPersonalizedFilter.emit(),
|
54
|
+
}
|
55
|
+
};
|
56
|
+
return snkFilterPersonalizedProps;
|
45
57
|
case FilterItemType.MULTI_LIST:
|
46
|
-
return { tag: "snk-entity-list",
|
58
|
+
return { tag: "snk-entity-list", props: { maxHeightList: "640px", rightListSlotBuilder: item => this.buildRightSlot(item) } };
|
47
59
|
}
|
48
60
|
return { tag: "snk-filter-text" };
|
49
61
|
}
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
62
|
+
isVisible(newValue) {
|
63
|
+
return !this.filterItem.visible ? newValue !== undefined : true;
|
64
|
+
}
|
65
|
+
updateFilterValue(data) {
|
66
|
+
const newValue = (data === null || data === void 0 ? void 0 : data.value) !== undefined ? data.value : data;
|
67
|
+
if (this.filterItem.groupedItems != undefined) {
|
68
|
+
this.filterItem = Object.assign(Object.assign({}, this.filterItem), { visible: newValue > 0, value: newValue, groupedItems: data.items });
|
69
|
+
}
|
70
|
+
else {
|
71
|
+
this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: newValue, visible: this.isVisible(newValue) });
|
55
72
|
}
|
73
|
+
this.saveConfig();
|
56
74
|
}
|
57
|
-
|
58
|
-
|
75
|
+
handleDeleteFilter(filter, filterItemType) {
|
76
|
+
if (filterItemType === FilterItemType.PERSONALIZED) {
|
77
|
+
ConfigStorage.removePersonalizedFilter(filter, this.configName);
|
78
|
+
}
|
59
79
|
}
|
60
80
|
componentDidLoad() {
|
61
81
|
if (this._element) {
|
@@ -66,25 +86,31 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
66
86
|
}
|
67
87
|
}
|
68
88
|
buildRightSlot(item) {
|
69
|
-
return h("ez-icon", { iconName: "delete", onClick: () => this.removeValueFromConfig(item) });
|
89
|
+
return (h("ez-icon", { iconName: "delete", onClick: () => this.removeValueFromConfig(item) }));
|
70
90
|
}
|
71
91
|
removeValueFromConfig(item) {
|
72
|
-
var _a, _b, _c
|
73
|
-
const index = (_b = (_a = this.filterItem) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.findIndex(
|
74
|
-
|
75
|
-
(
|
76
|
-
this.
|
92
|
+
var _a, _b, _c;
|
93
|
+
const index = (_b = (_a = this.filterItem) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.findIndex(({ id }) => id === item.id);
|
94
|
+
const filterItemCopy = ObjectUtils.copy(this.filterItem);
|
95
|
+
(_c = filterItemCopy === null || filterItemCopy === void 0 ? void 0 : filterItemCopy.value) === null || _c === void 0 ? void 0 : _c.splice(index, 1);
|
96
|
+
this.updateFilterValue(filterItemCopy.value);
|
97
|
+
}
|
98
|
+
canShowDetailModal() {
|
99
|
+
const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType$1;
|
100
|
+
return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
|
77
101
|
}
|
78
102
|
saveConfig() {
|
79
|
-
|
80
|
-
(
|
103
|
+
//Precisa ser rediscutido... não podemos salvar configuração por conta própria. Não temos autonomia pra isso.
|
104
|
+
/*if(FilterItemType.MULTI_LIST !== this.filterItem.type) return;
|
105
|
+
|
106
|
+
this._application?.getResourceID().then(resourceId => {
|
81
107
|
const fetcher = new FilterBarConfigFetcher();
|
82
108
|
fetcher.saveEntityListConfig(this.filterItem, resourceId, this._application.configName);
|
83
|
-
})
|
109
|
+
});*/
|
84
110
|
}
|
85
111
|
render() {
|
86
|
-
const { tag: ContentEditor,
|
87
|
-
return (h(Host, null, h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-title ez-title--small ez-title--primary grow" }, this.filterItem.detailModal))), h(ContentEditor, Object.assign({ ref: ref => this._editor = ref, config: this.filterItem, value: this.filterItem.value, onValueChanged: (event) => this.updateFilterValue(event.detail), "data-element-id": this._idContentEditor },
|
112
|
+
const { tag: ContentEditor, props } = this.getContentEditorConfig();
|
113
|
+
return (h(Host, null, h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-title ez-title--small ez-title--primary grow" }, this.filterItem.detailModal))), h(ContentEditor, Object.assign({ ref: ref => this._editor = ref, config: this.filterItem, value: this.filterItem.value, onValueChanged: (event) => this.updateFilterValue(event.detail), "data-element-id": this._idContentEditor }, props)))));
|
88
114
|
}
|
89
115
|
get _element() { return this; }
|
90
116
|
static get watchers() { return {
|
@@ -92,7 +118,8 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
92
118
|
}; }
|
93
119
|
static get style() { return snkFilterModalItemCss; }
|
94
120
|
}, [0, "snk-filter-modal-item", {
|
95
|
-
"filterItem": [1040]
|
121
|
+
"filterItem": [1040],
|
122
|
+
"configName": [1025, "config-name"]
|
96
123
|
}]);
|
97
124
|
function defineCustomElement() {
|
98
125
|
if (typeof customElements === "undefined") {
|
@@ -1,27 +1,58 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
2
2
|
import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
3
|
+
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
3
4
|
import { F as FilterType, d as defineCustomElement$2 } from './snk-filter-modal-item2.js';
|
4
5
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
6
|
+
import { ObjectUtils } from '@sankhyalabs/core';
|
7
|
+
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
|
5
8
|
|
6
|
-
const snkFilterModalCss = "ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter__modal-container{width:344px;max-width:344px;overflow:hidden}.snk-filter__modal-content{display:flex;flex-direction:column;gap:12px;max-height:760px;overflow-x:clip;overflow-y:auto;padding-right:4px}.snk-filter__modal-content::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.snk-filter__modal-collapsible-box{border:1px solid #DCE0E8;border-radius:var(--border--radius-medium);padding:12px 6px}";
|
9
|
+
const snkFilterModalCss = "ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter__modal-container{width:344px;max-width:344px;min-width:344px;overflow:hidden}.snk-filter__modal-content{display:flex;flex-direction:column;gap:12px;max-height:760px;overflow-x:clip;overflow-y:auto;padding-right:4px}.snk-filter__modal-content::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.snk-filter__modal-collapsible-box{border:1px solid #DCE0E8;border-radius:var(--border--radius-medium);padding:12px 6px}";
|
7
10
|
|
8
11
|
const SnkFilterModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
9
12
|
constructor() {
|
10
13
|
super();
|
11
14
|
this.__registerHost();
|
12
15
|
this.getMessage = undefined;
|
16
|
+
this.configName = undefined;
|
13
17
|
this.filters = undefined;
|
14
18
|
this.applyFilters = undefined;
|
15
19
|
this.clearAll = undefined;
|
16
20
|
this.closeModal = undefined;
|
21
|
+
this.addPersonalizedFilter = undefined;
|
22
|
+
this.editPersonalizedFilter = undefined;
|
17
23
|
}
|
18
24
|
getCustomMessage(key, params) {
|
19
25
|
var _a;
|
20
26
|
return (_a = this.getMessage) === null || _a === void 0 ? void 0 : _a.call(this, `snkFilterBar.filterModal.${key}`, params);
|
21
27
|
}
|
28
|
+
//TODO: tratar clear all dos filtros personalizados
|
22
29
|
handleClearAll() {
|
23
|
-
const
|
24
|
-
this.filters
|
30
|
+
const quickFilters = this.filters.filter(filter => filter.filterType === FilterType.QUICK_FILTER);
|
31
|
+
const otherFilters = this.filters.filter(filter => filter.filterType === FilterType.OTHER_FILTERS);
|
32
|
+
this.handleClearFilterList(quickFilters);
|
33
|
+
otherFilters.forEach(this.handleClearSigleFilter.bind(this));
|
34
|
+
if (this.clearAll) {
|
35
|
+
this.filters = this.clearAll(this.filters);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
handleClose() {
|
39
|
+
const hasChangesToSave = JSON.stringify(this.filters) !== JSON.stringify(this._originalFilterConfig);
|
40
|
+
if (!hasChangesToSave) {
|
41
|
+
this.closeModal();
|
42
|
+
return;
|
43
|
+
}
|
44
|
+
return ApplicationUtils.confirm(this.getCustomMessage('validations.notSaved.title'), this.getCustomMessage('validations.notSaved.message')).then((cancelAction) => {
|
45
|
+
if (cancelAction)
|
46
|
+
this.closeModal();
|
47
|
+
});
|
48
|
+
}
|
49
|
+
validatePersonalizedFilter() {
|
50
|
+
const filterPersonalized = this.filters.find(filter => filter.filterType === FilterType.CUSTOM_FILTER);
|
51
|
+
const isValid = PersonalizedFilterUtils.validateVariableValues(filterPersonalized);
|
52
|
+
if (!isValid) {
|
53
|
+
return ApplicationUtils.alert(this.getCustomMessage('validations.notFullFilled.title'), this.getCustomMessage('validations.notFullFilled.message'));
|
54
|
+
}
|
55
|
+
this.applyFilters(this.filters);
|
25
56
|
}
|
26
57
|
modalActionListener(evt) {
|
27
58
|
const modalAction = evt.detail;
|
@@ -30,17 +61,32 @@ const SnkFilterModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
30
61
|
this.handleClearAll();
|
31
62
|
break;
|
32
63
|
case ModalAction.OK:
|
33
|
-
this.
|
64
|
+
this.validatePersonalizedFilter();
|
65
|
+
break;
|
34
66
|
case ModalAction.CLOSE:
|
35
|
-
this.
|
67
|
+
this.handleClose();
|
68
|
+
break;
|
36
69
|
}
|
37
70
|
}
|
38
71
|
handleFilterChange(filterConfig) {
|
39
72
|
this.filters = this.filters.map(filter => filter.id === filterConfig.id ? filterConfig : filter);
|
40
73
|
}
|
41
|
-
|
74
|
+
handleClearFilterList(filterList) {
|
42
75
|
this.filters = this.filters.map(filter => filterList.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: FilterItemType.MULTI_LIST === filter.type ? this.uncheckFilterValues(filter.value) : undefined })) : filter);
|
43
76
|
}
|
77
|
+
handleClearSigleFilter(filterItem) {
|
78
|
+
if (FilterItemType.MULTI_LIST === filterItem.type) {
|
79
|
+
let filterItemCopy = ObjectUtils.copy(filterItem);
|
80
|
+
this.uncheckFilterValues(filterItemCopy.value);
|
81
|
+
const filterListCopy = ObjectUtils.copy(this.filters);
|
82
|
+
const index = filterListCopy.findIndex(item => item.id === filterItem.id);
|
83
|
+
filterListCopy.splice(index, 1, filterItemCopy);
|
84
|
+
this.filters = ObjectUtils.copy(filterListCopy);
|
85
|
+
}
|
86
|
+
else {
|
87
|
+
this.filters.find(filter => filter.id === filterItem.id).value = undefined;
|
88
|
+
}
|
89
|
+
}
|
44
90
|
uncheckFilterValues(valueList) {
|
45
91
|
valueList.forEach(value => {
|
46
92
|
if (!!value) {
|
@@ -50,7 +96,7 @@ const SnkFilterModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
50
96
|
return valueList;
|
51
97
|
}
|
52
98
|
renderFilterItem(filterItem, fullRow) {
|
53
|
-
return (h("snk-filter-modal-item", { class: fullRow ? 'ez-col ez-col--sd-12' : 'ez-col ez-col--sd-6 ez-padding--small', filterItem: filterItem, onFilterChange: (event) => this.handleFilterChange(event.detail) }));
|
99
|
+
return (h("snk-filter-modal-item", { class: fullRow ? 'ez-col ez-col--sd-12' : 'ez-col ez-col--sd-6 ez-padding--small', filterItem: filterItem, configName: this.configName, onFilterChange: (event) => this.handleFilterChange(event.detail), onEditPersonalizedFilter: evt => this.editPersonalizedFilter(evt.detail), onAddPersonalizedFilter: () => this.addPersonalizedFilter() }));
|
54
100
|
}
|
55
101
|
mountFiltersLines(filters) {
|
56
102
|
const MAX_LINE_LENGTH = 2;
|
@@ -88,38 +134,48 @@ const SnkFilterModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
88
134
|
countInformedItens += (_e = (_d = (_c = ((_b = (_a = item.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : item.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) !== null && _e !== void 0 ? _e : 0;
|
89
135
|
return;
|
90
136
|
}
|
137
|
+
if (item.groupedItems != undefined) {
|
138
|
+
countInformedItens = item.groupedItems.filter(item => item.visible).length;
|
139
|
+
return;
|
140
|
+
}
|
91
141
|
if (!!item.value) {
|
92
142
|
countInformedItens++;
|
93
143
|
}
|
94
144
|
});
|
95
145
|
return countInformedItens;
|
96
146
|
}
|
97
|
-
renderCollapsibleFilterBox(label, listItems) {
|
147
|
+
renderCollapsibleFilterBox(label, listItems, isSingleItem, shouldRenderFooter = true) {
|
98
148
|
if (!listItems.length)
|
99
149
|
return null;
|
100
150
|
const appliedFilters = this.getIformedFiltersCount(listItems);
|
101
151
|
const lines = this.mountFiltersLines(listItems);
|
102
|
-
return (h("ez-collapsible-box", { class: "snk-filter__modal-collapsible-box", headerSize: "medium", value: true, label: label }, !!appliedFilters &&
|
103
|
-
h("ez-badge", { class: "ez-badge--primary-subtle", slot: "rightSlot", label: appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.toString() }), lines.map(this.renderFilterLine.bind(this)), h("div", { class: "ez-flex ez-flex--justify-end grow" }, h("ez-button", { class: "ez-button--tertiary", size: "medium", label: "Limpar", onClick: () => this.handleClearFilters(listItems) }))));
|
152
|
+
return (h("ez-collapsible-box", { class: "snk-filter__modal-collapsible-box", headerSize: "medium", value: true, label: label }, !!appliedFilters && (h("ez-badge", { class: "ez-badge--primary-subtle", slot: "rightSlot", label: appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.toString() })), lines.map(this.renderFilterLine.bind(this)), shouldRenderFooter && (h("div", { class: "ez-flex ez-flex--justify-end grow" }, h("ez-button", { class: "ez-button--tertiary", size: "medium", label: "Limpar", onClick: () => isSingleItem ? this.handleClearSigleFilter(listItems[0]) : this.handleClearFilterList(listItems) })))));
|
104
153
|
}
|
105
154
|
componentWillRender() {
|
106
155
|
this._modalTitle = this.getCustomMessage('title');
|
107
156
|
this._okButtonLabel = this.getCustomMessage('okButtonLabel');
|
108
157
|
this._cancelButtonLabel = this.getCustomMessage('cancelButtonLabel');
|
109
158
|
}
|
159
|
+
componentDidLoad() {
|
160
|
+
if (!this._originalFilterConfig)
|
161
|
+
this._originalFilterConfig = this.filters;
|
162
|
+
}
|
110
163
|
render() {
|
111
164
|
const customFilters = this.filters.filter(filter => filter.filterType === FilterType.CUSTOM_FILTER);
|
112
165
|
const quickFilters = this.filters.filter(filter => filter.filterType === FilterType.QUICK_FILTER);
|
113
166
|
const otherFilters = this.filters.filter(filter => filter.filterType === FilterType.OTHER_FILTERS);
|
114
|
-
return (h("ez-modal-container", { class: "snk-filter__modal-container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, h("div", { class: "snk-filter__modal-content" }, this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter])))));
|
167
|
+
return (h("ez-modal-container", { class: "snk-filter__modal-container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, h("div", { class: "snk-filter__modal-content ez-col--sd-12" }, this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters, false, false), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters, false), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter], true)))));
|
115
168
|
}
|
116
169
|
static get style() { return snkFilterModalCss; }
|
117
170
|
}, [0, "snk-filter-modal", {
|
118
171
|
"getMessage": [16],
|
172
|
+
"configName": [1025, "config-name"],
|
119
173
|
"filters": [1040],
|
120
174
|
"applyFilters": [16],
|
121
175
|
"clearAll": [16],
|
122
|
-
"closeModal": [16]
|
176
|
+
"closeModal": [16],
|
177
|
+
"addPersonalizedFilter": [16],
|
178
|
+
"editPersonalizedFilter": [16]
|
123
179
|
}]);
|
124
180
|
function defineCustomElement$1() {
|
125
181
|
if (typeof customElements === "undefined") {
|
@@ -1,62 +1,8 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
2
2
|
import { StringUtils, DataType, ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
4
|
-
import {
|
5
|
-
|
6
|
-
class PersonalizedFilterUtils {
|
7
|
-
/**
|
8
|
-
* Cria uma expressão de filtro a partir de um IExpressionItem.
|
9
|
-
* @param expressionItem - Objeto com os parâmetros necessários para montar a expressão.
|
10
|
-
* @returns Retorna a expressão de filtro.
|
11
|
-
*/
|
12
|
-
static buildFilterExpression(expressionItem) {
|
13
|
-
if (expressionItem == undefined) {
|
14
|
-
return;
|
15
|
-
}
|
16
|
-
const value = this.buildVariableParameterValue(expressionItem);
|
17
|
-
let expression = expressionItem.expression || "";
|
18
|
-
switch (expressionItem.operand) {
|
19
|
-
case FilterOperand.IN:
|
20
|
-
expression += ` ${expressionItem.operand} (${value})`;
|
21
|
-
break;
|
22
|
-
case FilterOperand.NULL:
|
23
|
-
case FilterOperand.NOT_NULL:
|
24
|
-
expression += ` IS ${value}`;
|
25
|
-
break;
|
26
|
-
case FilterOperand.LIKE:
|
27
|
-
expression += ` LIKE '%${value}%'`;
|
28
|
-
break;
|
29
|
-
case FilterOperand.START_WITH:
|
30
|
-
expression += ` LIKE '${value}%'`;
|
31
|
-
break;
|
32
|
-
case FilterOperand.FINISHED_WITH:
|
33
|
-
expression += ` LIKE '%${value}'`;
|
34
|
-
break;
|
35
|
-
default:
|
36
|
-
expression += ` ${expressionItem.operand} ${value}`;
|
37
|
-
}
|
38
|
-
return expression;
|
39
|
-
}
|
40
|
-
/**
|
41
|
-
* Obtém o valor do parâmetro a partir de um IExpressionItem.
|
42
|
-
* @param expressionItem - Objeto com os parâmetros necessários para montar a expressão.
|
43
|
-
* @returns Retorna o valor do parâmetro.
|
44
|
-
*/
|
45
|
-
static buildVariableParameterValue(expressionItem) {
|
46
|
-
if (expressionItem == undefined) {
|
47
|
-
return;
|
48
|
-
}
|
49
|
-
if (expressionItem.systemConfig != undefined) {
|
50
|
-
const systemConfig = expressionItem.systemConfig;
|
51
|
-
return `?:{entidade=${systemConfig.entity || ""};campo=${systemConfig.fieldName || ""}}`;
|
52
|
-
}
|
53
|
-
if (expressionItem.userConfig != undefined) {
|
54
|
-
const userConfig = expressionItem.userConfig;
|
55
|
-
return `?:{desc=${userConfig.description || ""};tipo=${userConfig.type || ""}}`;
|
56
|
-
}
|
57
|
-
return `?:{entidade=${expressionItem.entityName || ""};campo=${expressionItem.fieldName || ""}}`;
|
58
|
-
}
|
59
|
-
}
|
4
|
+
import { c as FilterConfigType, d as FilterEntities, e as FilterUserConfigTypes } from './index2.js';
|
5
|
+
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
|
60
6
|
|
61
7
|
const snkFilterParamConfigCss = ":host{--snk-filter-param-config__expression--color:var(--title--primary, #2b3a54);display:flex;position:relative}.snk-filter-param-config__expression{--text-area__input--disabled--color:var(--snk-filter-param-config__expression--color)}";
|
62
8
|
|
@@ -201,7 +147,7 @@ const SnkFilterParamConfig = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
201
147
|
};
|
202
148
|
}
|
203
149
|
onSearch({ mode, argument }, entity) {
|
204
|
-
if (this._application == undefined) {
|
150
|
+
if (this._application == undefined || !this._opened) {
|
205
151
|
return;
|
206
152
|
}
|
207
153
|
const isField = entity === FilterEntities.FIELD;
|
@@ -53,8 +53,10 @@ const SnkFilterPeriod$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
53
53
|
}
|
54
54
|
}
|
55
55
|
componentWillLoad() {
|
56
|
-
|
57
|
-
|
56
|
+
if (this.getMessage) {
|
57
|
+
this._startDateLabel = this.getMessage('snkFilterBar.labelStartDatePeriod');
|
58
|
+
this._endDateLabel = this.getMessage('snkFilterBar.labelEndDatePeriod');
|
59
|
+
}
|
58
60
|
}
|
59
61
|
render() {
|
60
62
|
if (!this.config || this.config.type !== FilterItemType.PERIOD) {
|