@sankhyalabs/sankhyablocks 5.19.1 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ConfigStorage-0a738cdc.js +304 -0
- package/dist/cjs/IExpressionItem-1090c3fd.js +7 -0
- package/dist/cjs/PersonalizedFilterUtils-7d959e91.js +229 -0
- package/dist/cjs/{SnkFormConfigManager-69df3f74.js → SnkFormConfigManager-a583f503.js} +1 -1
- package/dist/cjs/{SnkMessageBuilder-3b5b5614.js → SnkMessageBuilder-8a2d3f26.js} +65 -4
- package/dist/cjs/{filter-bar-config-fetcher-a14536bf.js → filter-bar-config-fetcher-75219599.js} +34 -11
- package/dist/cjs/{index-de79181a.js → index-59a3e2de.js} +1 -1
- package/dist/cjs/{index-f400b1d6.js → index-614af008.js} +2 -0
- package/dist/cjs/{index-21bd01e1.js → index-aaaa2af5.js} +6 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-actions-button.cjs.entry.js +2 -2
- package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +4 -4
- package/dist/cjs/snk-attach.cjs.entry.js +4 -4
- package/dist/cjs/snk-client-confirm.cjs.entry.js +1 -1
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +4 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +4 -4
- package/dist/cjs/{snk-data-unit-e9c20097.js → snk-data-unit-53fc9200.js} +2 -2
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +10 -10
- package/dist/cjs/snk-entity-list.cjs.entry.js +6 -4
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/snk-expression-group.cjs.entry.js +246 -0
- package/dist/cjs/{snk-filter-field-search_2.cjs.entry.js → snk-expression-item_3.cjs.entry.js} +327 -66
- package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +161 -72
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +54 -69
- package/dist/cjs/snk-filter-item.cjs.entry.js +21 -7
- package/dist/cjs/snk-filter-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +57 -29
- package/dist/cjs/snk-filter-modal.cjs.entry.js +66 -12
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +5 -3
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +135 -55
- package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +7 -7
- package/dist/cjs/{snk-guides-viewer-c8843478.js → snk-guides-viewer-10ffca10.js} +5 -5
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +166 -94
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-bar.cjs.entry.js +45 -0
- package/dist/cjs/{snk-simple-bar_2.cjs.entry.js → snk-simple-crud.cjs.entry.js} +5 -43
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +4 -4
- package/dist/cjs/{taskbar-elements-3be287d6.js → taskbar-elements-068aa945.js} +3 -3
- package/dist/cjs/{taskbar-processor-02f0fc84.js → taskbar-processor-6442c585.js} +1 -1
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +6 -4
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +34 -12
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +4 -2
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.css +66 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.js +370 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +52 -68
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +20 -6
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +1 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +110 -10
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +98 -27
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +21 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +100 -49
- package/dist/collection/components/snk-filter-bar/types/custom-element-filter.js +1 -0
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +22 -3
- package/dist/collection/components/snk-filter-bar/utils/filters-mock.js +96 -0
- package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css +1 -1
- package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js +27 -6
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css +39 -2
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +276 -30
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css +73 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js +443 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js +16 -24
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css +18 -4
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +131 -21
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionGroup.js +0 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.js +5 -1
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.js +1 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IPersonalizedFilter.js +1 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.js +3 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +1 -1
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +184 -15
- package/dist/collection/lib/@types/index.js +2 -0
- package/dist/collection/lib/configs/ConfigStorage.js +15 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +36 -13
- package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +106 -4
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +15 -2
- package/dist/collection/lib/message/resources/snk-filter-field-search.msg.js +2 -0
- package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +48 -2
- package/dist/components/ConfigStorage.js +180 -1
- package/dist/components/PersonalizedFilterUtils.js +227 -0
- package/dist/components/SnkMessageBuilder.js +65 -4
- package/dist/components/filter-bar-config-fetcher.js +34 -11
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +3 -1
- package/dist/components/snk-crud.js +65 -35
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-detail-view2.js +99 -44
- package/dist/components/snk-entity-list.js +6 -4
- package/dist/components/snk-expression-group.d.ts +11 -0
- package/dist/components/snk-expression-group.js +6 -0
- package/dist/components/snk-expression-group2.js +296 -0
- package/dist/components/snk-expression-item2.js +133 -46
- package/dist/components/snk-filter-bar2.js +195 -68
- package/dist/components/snk-filter-detail2.js +52 -68
- package/dist/components/snk-filter-field-search2.js +26 -5
- package/dist/components/snk-filter-item2.js +20 -6
- package/dist/components/snk-filter-modal-item2.js +54 -27
- package/dist/components/snk-filter-modal.js +68 -12
- package/dist/components/snk-filter-param-config2.js +3 -57
- package/dist/components/snk-filter-period.js +4 -2
- package/dist/components/snk-filter-personalized.js +139 -58
- package/dist/components/snk-grid2.js +52 -16
- package/dist/components/snk-personalized-filter.js +1 -153
- package/dist/components/snk-personalized-filter2.js +238 -0
- package/dist/esm/ConfigStorage-9f4d2e67.js +300 -0
- package/dist/esm/IExpressionItem-2e922b2c.js +7 -0
- package/dist/esm/PersonalizedFilterUtils-202cd721.js +227 -0
- package/dist/esm/{SnkFormConfigManager-e60367a0.js → SnkFormConfigManager-def999fe.js} +1 -1
- package/dist/esm/{SnkMessageBuilder-188a38bb.js → SnkMessageBuilder-cc4d1599.js} +65 -4
- package/dist/esm/{filter-bar-config-fetcher-edc48f4b.js → filter-bar-config-fetcher-bd2070a3.js} +34 -11
- package/dist/esm/{index-cfd4bb13.js → index-8c3d76a6.js} +6 -1
- package/dist/esm/{index-507e19ec.js → index-a255b326.js} +3 -1
- package/dist/esm/{index-8efbf198.js → index-d60ca0ac.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/sankhyablocks.js +3 -3
- package/dist/esm/snk-actions-button.entry.js +2 -2
- package/dist/esm/snk-actions-form.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +4 -4
- package/dist/esm/snk-attach.entry.js +4 -4
- package/dist/esm/snk-client-confirm.entry.js +1 -1
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +4 -4
- package/dist/esm/snk-data-exporter.entry.js +4 -4
- package/dist/esm/{snk-data-unit-79b1583a.js → snk-data-unit-97824457.js} +2 -2
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-detail-view.entry.js +10 -10
- package/dist/esm/snk-entity-list.entry.js +7 -5
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-expression-group.entry.js +242 -0
- package/dist/esm/{snk-filter-field-search_2.entry.js → snk-expression-item_3.entry.js} +326 -66
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +156 -67
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-detail.entry.js +55 -70
- package/dist/esm/snk-filter-item.entry.js +21 -7
- package/dist/esm/snk-filter-list.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +57 -29
- package/dist/esm/snk-filter-modal.entry.js +66 -12
- package/dist/esm/snk-filter-multi-select.entry.js +1 -1
- package/dist/esm/snk-filter-number.entry.js +1 -1
- package/dist/esm/snk-filter-period.entry.js +5 -3
- package/dist/esm/snk-filter-personalized.entry.js +135 -55
- package/dist/esm/snk-filter-search.entry.js +1 -1
- package/dist/esm/snk-filter-text.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form-summary.entry.js +1 -1
- package/dist/esm/snk-form-view.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid-config.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +7 -7
- package/dist/esm/{snk-guides-viewer-59d3a78c.js → snk-guides-viewer-0380f3df.js} +5 -5
- package/dist/esm/snk-guides-viewer.entry.js +9 -9
- package/dist/esm/snk-personalized-filter.entry.js +166 -94
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-select-box.entry.js +1 -1
- package/dist/esm/snk-simple-bar.entry.js +41 -0
- package/dist/esm/{snk-simple-bar_2.entry.js → snk-simple-crud.entry.js} +7 -44
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +4 -4
- package/dist/esm/{taskbar-elements-8ff33c26.js → taskbar-elements-26d0fba3.js} +3 -3
- package/dist/esm/{taskbar-processor-20de6616.js → taskbar-processor-dfef41a8.js} +1 -1
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/{p-f27dc5e9.entry.js → p-00d1cac4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b9667fbe.js → p-066ee142.js} +2 -2
- package/dist/sankhyablocks/p-09a058ba.entry.js +1 -0
- package/dist/sankhyablocks/{p-82bc4666.entry.js → p-0dec4d29.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1e6a95f5.entry.js → p-12632b8e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-384c4a6b.js → p-18b34bb4.js} +1 -1
- package/dist/sankhyablocks/{p-538c057a.entry.js → p-2ad89e28.entry.js} +1 -1
- package/dist/sankhyablocks/p-2d5108b3.js +1 -0
- package/dist/sankhyablocks/{p-ff398057.entry.js → p-34cd4b39.entry.js} +1 -1
- package/dist/sankhyablocks/p-36ecb6ab.js +1 -0
- package/dist/sankhyablocks/p-372e0185.entry.js +1 -0
- package/dist/sankhyablocks/p-3be34bd1.entry.js +1 -0
- package/dist/sankhyablocks/p-3d45107f.js +1 -0
- package/dist/sankhyablocks/{p-28c12f65.js → p-463e0936.js} +1 -1
- package/dist/sankhyablocks/{p-e701646c.entry.js → p-49d628d1.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e642bf7a.entry.js → p-50db4bc4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-093febff.entry.js → p-5427566a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6a02e236.js → p-590d8900.js} +1 -1
- package/dist/sankhyablocks/p-5a6c090e.entry.js +1 -0
- package/dist/sankhyablocks/p-639be4aa.entry.js +1 -0
- package/dist/sankhyablocks/{p-e2bb9c9a.entry.js → p-67a19b48.entry.js} +1 -1
- package/dist/sankhyablocks/{p-19692f92.js → p-69770075.js} +1 -1
- package/dist/sankhyablocks/p-6d4169fc.entry.js +1 -0
- package/dist/sankhyablocks/{p-0b40c655.js → p-708ee8ee.js} +1 -1
- package/dist/sankhyablocks/{p-9af04fc7.entry.js → p-718cc24b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2d0fc912.entry.js → p-7946512f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-900b2889.entry.js → p-7a5e1be7.entry.js} +1 -1
- package/dist/sankhyablocks/p-801b8858.js +68 -0
- package/dist/sankhyablocks/{p-80e52e85.entry.js → p-847b9506.entry.js} +1 -1
- package/dist/sankhyablocks/{p-56d70073.entry.js → p-8d541539.entry.js} +1 -1
- package/dist/sankhyablocks/{p-584a315a.entry.js → p-8e98a893.entry.js} +1 -1
- package/dist/sankhyablocks/p-9731180c.entry.js +1 -0
- package/dist/sankhyablocks/p-a6055eb9.entry.js +1 -0
- package/dist/sankhyablocks/{p-b680fa7a.entry.js → p-a655ea15.entry.js} +1 -1
- package/dist/sankhyablocks/{p-eae124e3.entry.js → p-a8b06801.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b25450ab.js → p-a8e5ded0.js} +1 -1
- package/dist/sankhyablocks/{p-6ac29569.entry.js → p-b66b99d9.entry.js} +1 -1
- package/dist/sankhyablocks/p-b7efc49a.entry.js +1 -0
- package/dist/sankhyablocks/{p-9c7f7214.entry.js → p-b91ee370.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e551b19a.entry.js → p-b940798f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-72e78de0.entry.js → p-bbefb3b2.entry.js} +1 -1
- package/dist/sankhyablocks/p-bdd61fa8.entry.js +1 -0
- package/dist/sankhyablocks/{p-f8c66aa3.entry.js → p-c06973e7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-257c71a7.entry.js → p-c17e19a2.entry.js} +1 -1
- package/dist/sankhyablocks/p-c6bf66e0.js +1 -0
- package/dist/sankhyablocks/p-cf90a195.entry.js +1 -0
- package/dist/sankhyablocks/{p-44c2ed16.entry.js → p-d11c5026.entry.js} +1 -1
- package/dist/sankhyablocks/p-d5145c3f.entry.js +1 -0
- package/dist/sankhyablocks/p-de328b00.entry.js +1 -0
- package/dist/sankhyablocks/{p-971abcc2.entry.js → p-e500863b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-22e44b9d.entry.js → p-e824aef2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4ce96831.entry.js → p-eb24c092.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4c2015a9.js → p-eb90de43.js} +1 -1
- package/dist/sankhyablocks/p-ebb8de34.entry.js +1 -0
- package/dist/sankhyablocks/{p-8652d177.entry.js → p-fc512cbe.entry.js} +1 -1
- package/dist/sankhyablocks/{p-786ae316.entry.js → p-fced1d89.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e0b4aec3.entry.js → p-fdb43927.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.d.ts +85 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +6 -6
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +18 -1
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +14 -6
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +10 -3
- package/dist/types/components/snk-filter-bar/types/custom-element-filter.d.ts +6 -0
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +10 -1
- package/dist/types/components/snk-filter-bar/utils/filters-mock.d.ts +92 -15
- package/dist/types/components/snk-filter-field-search/interfaces/index.d.ts +5 -11
- package/dist/types/components/snk-filter-field-search/snk-filter-field-search.d.ts +3 -0
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +39 -6
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.d.ts +82 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.d.ts +1 -1
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.d.ts +13 -1
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionGroup.d.ts +0 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.d.ts +23 -3
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.d.ts +21 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IPersonalizedFilter.d.ts +11 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.d.ts +3 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.d.ts +14 -2
- package/dist/types/components.d.ts +169 -10
- package/dist/types/lib/@types/index.d.ts +3 -1
- package/dist/types/lib/configs/ConfigStorage.d.ts +5 -0
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +4 -2
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +5 -0
- package/dist/types/lib/store/index.d.ts +1 -2
- package/package.json +5 -5
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ConfigStorage-f68c3607.js +0 -124
- package/dist/cjs/index-8d94b7e0.js +0 -7
- package/dist/cjs/snk-expression-item.cjs.entry.js +0 -213
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +0 -214
- package/dist/esm/ConfigStorage-e6c17998.js +0 -121
- package/dist/esm/index-620ac460.js +0 -7
- package/dist/esm/snk-expression-item.entry.js +0 -209
- package/dist/sankhyablocks/p-0b6ddb67.entry.js +0 -1
- package/dist/sankhyablocks/p-0c2afa63.entry.js +0 -1
- package/dist/sankhyablocks/p-343699ad.entry.js +0 -1
- package/dist/sankhyablocks/p-471568c7.entry.js +0 -1
- package/dist/sankhyablocks/p-6c2c71ca.js +0 -1
- package/dist/sankhyablocks/p-8ce9ea9f.entry.js +0 -1
- package/dist/sankhyablocks/p-8efb0f47.entry.js +0 -1
- package/dist/sankhyablocks/p-9a448ff9.entry.js +0 -1
- package/dist/sankhyablocks/p-9e50681c.entry.js +0 -1
- package/dist/sankhyablocks/p-9f66bc54.entry.js +0 -1
- package/dist/sankhyablocks/p-b1c02726.js +0 -1
- package/dist/sankhyablocks/p-b34d23fa.js +0 -1
- package/dist/sankhyablocks/p-c20dd153.entry.js +0 -1
- package/dist/sankhyablocks/p-cbb5c440.entry.js +0 -1
- package/dist/sankhyablocks/p-f3241ada.entry.js +0 -1
- package/dist/sankhyablocks/p-f4184ce7.js +0 -1
- package/dist/sankhyablocks/p-ff96b509.entry.js +0 -27
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +0 -40
@@ -1,12 +1,14 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
2
|
-
import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8c3d76a6.js';
|
2
|
+
import { ElementIDUtils, ApplicationContext, ObjectUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
4
|
-
import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
|
5
4
|
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
6
|
-
import {
|
7
|
-
import './
|
5
|
+
import { C as ConfigStorage } from './ConfigStorage-9f4d2e67.js';
|
6
|
+
import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
|
7
|
+
import './form-config-fetcher-cac8cd96.js';
|
8
8
|
import './DataFetcher-b3d8b2d5.js';
|
9
9
|
import './_commonjsHelpers-9943807e.js';
|
10
|
+
import './resource-fetcher-02642924.js';
|
11
|
+
import './filter-bar-config-fetcher-bd2070a3.js';
|
10
12
|
|
11
13
|
const snkFilterModalItemCss = ".grow{flex-grow:1}.gap{gap:4px}";
|
12
14
|
|
@@ -14,43 +16,63 @@ const SnkFilterModalItem = class {
|
|
14
16
|
constructor(hostRef) {
|
15
17
|
registerInstance(this, hostRef);
|
16
18
|
this.filterChange = createEvent(this, "filterChange", 7);
|
19
|
+
this.editPersonalizedFilter = createEvent(this, "editPersonalizedFilter", 7);
|
20
|
+
this.addPersonalizedFilter = createEvent(this, "addPersonalizedFilter", 7);
|
17
21
|
this.filterItem = undefined;
|
22
|
+
this.configName = undefined;
|
18
23
|
}
|
19
24
|
observeFilterItem(newValue) {
|
20
25
|
var _a, _b;
|
26
|
+
this._editor && (this._editor["config"] = newValue);
|
21
27
|
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
|
22
28
|
this.filterChange.emit(newValue);
|
23
|
-
|
29
|
+
//isso faz o filtro salvar o estado precocemente. Caso: Botão limpar filtro dispara dezenas de vezes
|
30
|
+
//this.saveConfig();
|
24
31
|
}
|
25
32
|
getContentEditorConfig() {
|
26
|
-
const
|
33
|
+
const props = { presentationMode: EPresentationMode.MODAL };
|
27
34
|
switch (this.filterItem.type) {
|
28
35
|
case FilterItemType.BINARY_SELECT:
|
29
|
-
return { tag: "snk-filter-binary-select",
|
36
|
+
return { tag: "snk-filter-binary-select", props };
|
30
37
|
case FilterItemType.MULTI_SELECT:
|
31
38
|
return { tag: "snk-filter-multi-select" };
|
32
39
|
case FilterItemType.PERIOD:
|
33
|
-
return { tag: "snk-filter-period",
|
40
|
+
return { tag: "snk-filter-period", props };
|
34
41
|
case FilterItemType.SEARCH:
|
35
42
|
return { tag: "snk-filter-search" };
|
36
43
|
case FilterItemType.NUMBER:
|
37
44
|
return { tag: "snk-filter-number" };
|
38
45
|
case FilterItemType.PERSONALIZED:
|
39
|
-
|
46
|
+
const snkFilterPersonalizedProps = {
|
47
|
+
tag: "snk-filter-personalized", props: {
|
48
|
+
onDeleteFilter: (event) => this.handleDeleteFilter(event.detail, FilterItemType.PERSONALIZED),
|
49
|
+
onEditFilter: (event) => this.editPersonalizedFilter.emit(event.detail),
|
50
|
+
onAddFilter: () => this.addPersonalizedFilter.emit(),
|
51
|
+
}
|
52
|
+
};
|
53
|
+
return snkFilterPersonalizedProps;
|
40
54
|
case FilterItemType.MULTI_LIST:
|
41
|
-
return { tag: "snk-entity-list",
|
55
|
+
return { tag: "snk-entity-list", props: { maxHeightList: "640px", rightListSlotBuilder: item => this.buildRightSlot(item) } };
|
42
56
|
}
|
43
57
|
return { tag: "snk-filter-text" };
|
44
58
|
}
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
59
|
+
isVisible(newValue) {
|
60
|
+
return !this.filterItem.visible ? newValue !== undefined : true;
|
61
|
+
}
|
62
|
+
updateFilterValue(data) {
|
63
|
+
const newValue = (data === null || data === void 0 ? void 0 : data.value) !== undefined ? data.value : data;
|
64
|
+
if (this.filterItem.groupedItems != undefined) {
|
65
|
+
this.filterItem = Object.assign(Object.assign({}, this.filterItem), { visible: newValue > 0, value: newValue, groupedItems: data.items });
|
66
|
+
}
|
67
|
+
else {
|
68
|
+
this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: newValue, visible: this.isVisible(newValue) });
|
50
69
|
}
|
70
|
+
this.saveConfig();
|
51
71
|
}
|
52
|
-
|
53
|
-
|
72
|
+
handleDeleteFilter(filter, filterItemType) {
|
73
|
+
if (filterItemType === FilterItemType.PERSONALIZED) {
|
74
|
+
ConfigStorage.removePersonalizedFilter(filter, this.configName);
|
75
|
+
}
|
54
76
|
}
|
55
77
|
componentDidLoad() {
|
56
78
|
if (this._element) {
|
@@ -61,25 +83,31 @@ const SnkFilterModalItem = class {
|
|
61
83
|
}
|
62
84
|
}
|
63
85
|
buildRightSlot(item) {
|
64
|
-
return h("ez-icon", { iconName: "delete", onClick: () => this.removeValueFromConfig(item) });
|
86
|
+
return (h("ez-icon", { iconName: "delete", onClick: () => this.removeValueFromConfig(item) }));
|
65
87
|
}
|
66
88
|
removeValueFromConfig(item) {
|
67
|
-
var _a, _b, _c
|
68
|
-
const index = (_b = (_a = this.filterItem) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.findIndex(
|
69
|
-
|
70
|
-
(
|
71
|
-
this.
|
89
|
+
var _a, _b, _c;
|
90
|
+
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);
|
91
|
+
const filterItemCopy = ObjectUtils.copy(this.filterItem);
|
92
|
+
(_c = filterItemCopy === null || filterItemCopy === void 0 ? void 0 : filterItemCopy.value) === null || _c === void 0 ? void 0 : _c.splice(index, 1);
|
93
|
+
this.updateFilterValue(filterItemCopy.value);
|
94
|
+
}
|
95
|
+
canShowDetailModal() {
|
96
|
+
const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType;
|
97
|
+
return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
|
72
98
|
}
|
73
99
|
saveConfig() {
|
74
|
-
|
75
|
-
(
|
100
|
+
//Precisa ser rediscutido... não podemos salvar configuração por conta própria. Não temos autonomia pra isso.
|
101
|
+
/*if(FilterItemType.MULTI_LIST !== this.filterItem.type) return;
|
102
|
+
|
103
|
+
this._application?.getResourceID().then(resourceId => {
|
76
104
|
const fetcher = new FilterBarConfigFetcher();
|
77
105
|
fetcher.saveEntityListConfig(this.filterItem, resourceId, this._application.configName);
|
78
|
-
})
|
106
|
+
});*/
|
79
107
|
}
|
80
108
|
render() {
|
81
|
-
const { tag: ContentEditor,
|
82
|
-
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 },
|
109
|
+
const { tag: ContentEditor, props } = this.getContentEditorConfig();
|
110
|
+
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)))));
|
83
111
|
}
|
84
112
|
get _element() { return getElement(this); }
|
85
113
|
static get watchers() { return {
|
@@ -1,26 +1,58 @@
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
1
|
+
import { r as registerInstance, h } from './index-8c3d76a6.js';
|
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 } from './filter-type.enum-a80c1b6b.js';
|
4
5
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
6
|
+
import { ObjectUtils } from '@sankhyalabs/core';
|
7
|
+
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-202cd721.js';
|
8
|
+
import './index-a255b326.js';
|
5
9
|
|
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}";
|
10
|
+
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
11
|
|
8
12
|
const SnkFilterModal = class {
|
9
13
|
constructor(hostRef) {
|
10
14
|
registerInstance(this, hostRef);
|
11
15
|
this.getMessage = undefined;
|
16
|
+
this.configName = undefined;
|
12
17
|
this.filters = undefined;
|
13
18
|
this.applyFilters = undefined;
|
14
19
|
this.clearAll = undefined;
|
15
20
|
this.closeModal = undefined;
|
21
|
+
this.addPersonalizedFilter = undefined;
|
22
|
+
this.editPersonalizedFilter = undefined;
|
16
23
|
}
|
17
24
|
getCustomMessage(key, params) {
|
18
25
|
var _a;
|
19
26
|
return (_a = this.getMessage) === null || _a === void 0 ? void 0 : _a.call(this, `snkFilterBar.filterModal.${key}`, params);
|
20
27
|
}
|
28
|
+
//TODO: tratar clear all dos filtros personalizados
|
21
29
|
handleClearAll() {
|
22
|
-
const
|
23
|
-
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);
|
24
56
|
}
|
25
57
|
modalActionListener(evt) {
|
26
58
|
const modalAction = evt.detail;
|
@@ -29,17 +61,32 @@ const SnkFilterModal = class {
|
|
29
61
|
this.handleClearAll();
|
30
62
|
break;
|
31
63
|
case ModalAction.OK:
|
32
|
-
this.
|
64
|
+
this.validatePersonalizedFilter();
|
65
|
+
break;
|
33
66
|
case ModalAction.CLOSE:
|
34
|
-
this.
|
67
|
+
this.handleClose();
|
68
|
+
break;
|
35
69
|
}
|
36
70
|
}
|
37
71
|
handleFilterChange(filterConfig) {
|
38
72
|
this.filters = this.filters.map(filter => filter.id === filterConfig.id ? filterConfig : filter);
|
39
73
|
}
|
40
|
-
|
74
|
+
handleClearFilterList(filterList) {
|
41
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);
|
42
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
|
+
}
|
43
90
|
uncheckFilterValues(valueList) {
|
44
91
|
valueList.forEach(value => {
|
45
92
|
if (!!value) {
|
@@ -49,7 +96,7 @@ const SnkFilterModal = class {
|
|
49
96
|
return valueList;
|
50
97
|
}
|
51
98
|
renderFilterItem(filterItem, fullRow) {
|
52
|
-
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() }));
|
53
100
|
}
|
54
101
|
mountFiltersLines(filters) {
|
55
102
|
const MAX_LINE_LENGTH = 2;
|
@@ -87,30 +134,37 @@ const SnkFilterModal = class {
|
|
87
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;
|
88
135
|
return;
|
89
136
|
}
|
137
|
+
if (item.groupedItems != undefined) {
|
138
|
+
countInformedItens = item.groupedItems.filter(item => item.visible).length;
|
139
|
+
return;
|
140
|
+
}
|
90
141
|
if (!!item.value) {
|
91
142
|
countInformedItens++;
|
92
143
|
}
|
93
144
|
});
|
94
145
|
return countInformedItens;
|
95
146
|
}
|
96
|
-
renderCollapsibleFilterBox(label, listItems) {
|
147
|
+
renderCollapsibleFilterBox(label, listItems, isSingleItem, shouldRenderFooter = true) {
|
97
148
|
if (!listItems.length)
|
98
149
|
return null;
|
99
150
|
const appliedFilters = this.getIformedFiltersCount(listItems);
|
100
151
|
const lines = this.mountFiltersLines(listItems);
|
101
|
-
return (h("ez-collapsible-box", { class: "snk-filter__modal-collapsible-box", headerSize: "medium", value: true, label: label }, !!appliedFilters &&
|
102
|
-
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) })))));
|
103
153
|
}
|
104
154
|
componentWillRender() {
|
105
155
|
this._modalTitle = this.getCustomMessage('title');
|
106
156
|
this._okButtonLabel = this.getCustomMessage('okButtonLabel');
|
107
157
|
this._cancelButtonLabel = this.getCustomMessage('cancelButtonLabel');
|
108
158
|
}
|
159
|
+
componentDidLoad() {
|
160
|
+
if (!this._originalFilterConfig)
|
161
|
+
this._originalFilterConfig = this.filters;
|
162
|
+
}
|
109
163
|
render() {
|
110
164
|
const customFilters = this.filters.filter(filter => filter.filterType === FilterType.CUSTOM_FILTER);
|
111
165
|
const quickFilters = this.filters.filter(filter => filter.filterType === FilterType.QUICK_FILTER);
|
112
166
|
const otherFilters = this.filters.filter(filter => filter.filterType === FilterType.OTHER_FILTERS);
|
113
|
-
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)))));
|
114
168
|
}
|
115
169
|
};
|
116
170
|
SnkFilterModal.style = snkFilterModalCss;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
1
|
+
import { r as registerInstance, c as createEvent, h, 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
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
1
|
+
import { r as registerInstance, c as createEvent, h, 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
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
1
|
+
import { r as registerInstance, c as createEvent, h, 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';
|
@@ -52,8 +52,10 @@ const SnkFilterPeriod = class {
|
|
52
52
|
}
|
53
53
|
}
|
54
54
|
componentWillLoad() {
|
55
|
-
|
56
|
-
|
55
|
+
if (this.getMessage) {
|
56
|
+
this._startDateLabel = this.getMessage('snkFilterBar.labelStartDatePeriod');
|
57
|
+
this._endDateLabel = this.getMessage('snkFilterBar.labelEndDatePeriod');
|
58
|
+
}
|
57
59
|
}
|
58
60
|
render() {
|
59
61
|
if (!this.config || this.config.type !== FilterItemType.PERIOD) {
|
@@ -1,50 +1,65 @@
|
|
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, F as Fragment, H as Host, g as getElement } from './index-8c3d76a6.js';
|
2
2
|
import { ElementIDUtils, UserInterface, ApplicationContext } from '@sankhyalabs/core';
|
3
|
-
import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
4
|
-
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
5
3
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
4
|
+
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
5
|
+
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
6
|
+
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
7
|
+
|
8
|
+
const snkFilterPersonalizedCss = ".sc-snk-filter-personalized-h{--snk-filter-personalized__max-height:21;--snk-filter-personalized__max-width:21.5}.SnkFilterPersonalized_list-container.sc-snk-filter-personalized{margin:0;padding:0;list-style:none;display:flex;flex-direction:column}.SnkFilterPersonalized_list-container-chip.sc-snk-filter-personalized{width:400px}.SnkFilterPersonalized_list-scroller.sc-snk-filter-personalized{display:block;max-height:calc(var(--space--2xl) * var(--snk-filter-personalized__max-height));cursor:auto;--ez-scroller__max-height:300px}.SnkFilterPersonalized_checkbox.sc-snk-filter-personalized{display:grid;grid-template-columns:auto auto;justify-content:start}.SnkFilterPersonalized_list-container.sc-snk-filter-personalized:has(.SnkFilterPersonalized_list-item--chip){gap:var(--space--small, 6px);max-width:calc(var(--space--md) * var(--snk-filter-personalized__max-width))}.SnkFilterPersonalized_list-item--modal.sc-snk-filter-personalized{display:flex;border-radius:var(--border--radius-regular)}.SnkFilterPersonalized_list-item--modal.sc-snk-filter-personalized:hover{background-color:var(--background--medium, #f0f3f7)}.SnkFilterPersonalized_list-actions.sc-snk-filter-personalized{display:none;align-items:center}.SnkFilterPersonalized_list-item--modal.sc-snk-filter-personalized:hover .SnkFilterPersonalized_list-actions.sc-snk-filter-personalized{display:flex}.SnkFilterPersonalized_list-item--chip.sc-snk-filter-personalized{display:flex;flex-direction:column;border:var(--border--small, 1px solid) var(--color-strokes, #DCE0E8);border-radius:var(--border--radius-regular)}.SnkFilterPersonalized_list-item--chip.sc-snk-filter-personalized .sc-snk-filter-personalized:first-of-type{gap:var(--space--3xs)}";
|
6
9
|
|
7
10
|
const SnkFilterPersonalized = class {
|
8
11
|
constructor(hostRef) {
|
9
12
|
registerInstance(this, hostRef);
|
13
|
+
this.deleteFilter = createEvent(this, "deleteFilter", 7);
|
14
|
+
this.editFilter = createEvent(this, "editFilter", 7);
|
15
|
+
this.addFilter = createEvent(this, "addFilter", 7);
|
10
16
|
this.valueChanged = createEvent(this, "valueChanged", 7);
|
17
|
+
this.originalItems = [];
|
18
|
+
this.messagesBuilder = undefined;
|
19
|
+
this.presentationMode = EPresentationMode.MODAL;
|
11
20
|
this.config = undefined;
|
12
21
|
this.value = undefined;
|
13
|
-
this.
|
14
|
-
this.unfix = undefined;
|
22
|
+
this.items = [];
|
15
23
|
}
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
24
|
+
/**
|
25
|
+
* Apresenta o componente
|
26
|
+
*/
|
27
|
+
async show() {
|
28
|
+
const elem = document.querySelector("#param_0");
|
29
|
+
if (elem)
|
30
|
+
elem["setFocus"]();
|
20
31
|
}
|
21
|
-
|
22
|
-
|
23
|
-
const rawValue = this.value[index];
|
24
|
-
if (param.type === UserInterface.SEARCH) {
|
25
|
-
return rawValue;
|
26
|
-
}
|
27
|
-
return convertType(param.dataType, rawValue);
|
28
|
-
}
|
29
|
-
return undefined;
|
32
|
+
configWatcher(newConfig) {
|
33
|
+
this.items = this.originalItems = newConfig.groupedItems || [];
|
30
34
|
}
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
if (this.
|
40
|
-
this.
|
41
|
-
|
42
|
-
|
35
|
+
/**
|
36
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
37
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
38
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
39
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-personalized-filter.msg.ts"
|
40
|
+
*/
|
41
|
+
getMessage(key, params) {
|
42
|
+
var _a;
|
43
|
+
if (this.messagesBuilder)
|
44
|
+
return this.messagesBuilder.getMessage(key, params);
|
45
|
+
if ((_a = this._application) === null || _a === void 0 ? void 0 : _a.messagesBuilder)
|
46
|
+
return this._application.messagesBuilder.getMessage(key, params);
|
47
|
+
}
|
48
|
+
getItemContent(item) {
|
49
|
+
var _a, _b;
|
50
|
+
const CheckboxElement = () => (h("ez-check", Object.assign({ class: "SnkFilterPersonalized_checkbox", id: `param_${item.id}`, key: item.id, compact: true, value: item.visible, label: item.label, onEzChange: ({ detail: visible }) => this.handleItemChange.bind(this)(visible, item.id) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`checkboxFilter_${item.id}`)}` })));
|
51
|
+
const isVariable = !!((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters.length);
|
52
|
+
return (h("div", { class: `${!this.isModalMode() ? "SnkFilterPersonalized_list-item--chip" : ""}` }, h("li", { class: `${this.isModalMode() ? "SnkFilterPersonalized_list-item--modal" : ""}` }, h("div", { class: "ez-flex ez-flex--align-items-center ez-margin-right--small ez-size-width--full" }, h(CheckboxElement, null), this.isModalMode() ?
|
53
|
+
h("div", { class: "SnkFilterPersonalized_list-actions" }, h("ez-button", { size: "small", mode: "icon", iconName: "edit", title: this.getMessage('snkPersonalizedFilter.listActions.edit'), onClick: () => this.editFilter.emit(item.id) }), h("ez-button", { size: "small", mode: "icon", iconName: "delete", title: this.getMessage('snkPersonalizedFilter.listActions.delete'), onClick: this.handleDeleteFilter.bind(this, item) }))
|
54
|
+
:
|
55
|
+
isVariable && (h("ez-badge", Object.assign({ class: "ez-badge--warning-subtle ez-margin-right--small", label: this.getMessage('snkPersonalizedFilter.info.badgeVariable'), size: "medium" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`variableBadge_${item.id}`)}` }))))), (item.visible && isVariable) && (h("div", { class: "ez-row ez-padding--small" }, this.getFormField(item)))));
|
56
|
+
}
|
57
|
+
isModalMode() {
|
58
|
+
return this.presentationMode === EPresentationMode.MODAL;
|
43
59
|
}
|
44
60
|
doSearch(mode, argument, param) {
|
45
|
-
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
46
61
|
return new Promise((resolve, reject) => {
|
47
|
-
|
62
|
+
this._application.executePreparedSearch(mode, argument, param.searchContext)
|
48
63
|
.then(result => {
|
49
64
|
resolve(result);
|
50
65
|
}).catch(reason => {
|
@@ -52,49 +67,114 @@ const SnkFilterPersonalized = class {
|
|
52
67
|
});
|
53
68
|
});
|
54
69
|
}
|
55
|
-
|
56
|
-
var _a, _b
|
57
|
-
const params = (
|
70
|
+
getFormField(parentItem) {
|
71
|
+
var _a, _b;
|
72
|
+
const params = (_b = (_a = parentItem === null || parentItem === void 0 ? void 0 : parentItem.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters;
|
58
73
|
return params.map((param, index) => {
|
59
|
-
var _a;
|
74
|
+
var _a, _b;
|
75
|
+
const formProp = Object.assign(Object.assign({}, param), { id: parentItem.id });
|
76
|
+
const value = (_a = parentItem.value) === null || _a === void 0 ? void 0 : _a[index];
|
60
77
|
const elemId = 'param_' + index;
|
61
|
-
switch (param.
|
78
|
+
switch (param.userInterface) {
|
62
79
|
case UserInterface.SEARCH:
|
63
|
-
return h("ez-search", { id: elemId, suppressEmptyOption: true, value:
|
80
|
+
return h("ez-search", { id: elemId, suppressEmptyOption: true, value: value, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp), label: param.label, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, param) });
|
64
81
|
case UserInterface.SWITCH:
|
65
82
|
case UserInterface.CHECKBOX:
|
66
|
-
const mode = UserInterface.SWITCH === param.
|
67
|
-
return h("ez-check", { id: elemId, class: "ez-padding-bottom--medium", mode: mode, value:
|
83
|
+
const mode = UserInterface.SWITCH === param.userInterface ? CheckMode.SWITCH : CheckMode.REGULAR;
|
84
|
+
return h("ez-check", { id: elemId, class: "ez-padding-bottom--medium", mode: mode, value: value, label: param.label, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
68
85
|
case UserInterface.DECIMALNUMBER:
|
69
86
|
case UserInterface.INTEGERNUMBER:
|
70
|
-
return h("ez-number-input", { id: elemId, label: param.label, value:
|
87
|
+
return h("ez-number-input", { id: elemId, label: param.label, value: value, precision: (_b = param.props) === null || _b === void 0 ? void 0 : _b.precision, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
71
88
|
case UserInterface.OPTIONSELECTOR:
|
72
|
-
return h("ez-combo-box", { id: elemId, label: param.label, value:
|
89
|
+
return h("ez-combo-box", { id: elemId, label: param.label, value: value, options: param.options, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
73
90
|
case UserInterface.DATE:
|
74
|
-
return h("ez-date-input", { id: elemId, label: param.label, value: this.
|
91
|
+
return h("ez-date-input", { id: elemId, label: param.label, value: this.parseDate(value), onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
75
92
|
case UserInterface.DATETIME:
|
76
|
-
return h("ez-date-time-input", { id: elemId, label: param.label, value: this.
|
93
|
+
return h("ez-date-time-input", { id: elemId, label: param.label, value: this.parseDate(value), onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
77
94
|
default:
|
78
|
-
return h("ez-text-input", { id: elemId, label: param.label, value:
|
95
|
+
return h("ez-text-input", { id: elemId, label: param.label, value: value, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
79
96
|
}
|
80
97
|
});
|
81
98
|
}
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
99
|
+
parseDate(objValue) {
|
100
|
+
if (typeof objValue === "string") {
|
101
|
+
let date = new Date(objValue);
|
102
|
+
date.setMinutes(date.getMinutes() + date.getTimezoneOffset());
|
103
|
+
return date;
|
104
|
+
}
|
105
|
+
return objValue;
|
106
|
+
}
|
107
|
+
getVisibleCount(items) {
|
108
|
+
return items.reduce((total, item) => {
|
109
|
+
if (!!item.visible)
|
110
|
+
return total + 1;
|
111
|
+
return total;
|
112
|
+
}, 0);
|
113
|
+
}
|
114
|
+
handleItemChange(visible, itemId) {
|
115
|
+
this.items = this.originalItems = this.originalItems.map(item => {
|
116
|
+
const isVisible = item.id === itemId ? visible : item.visible;
|
117
|
+
return Object.assign(Object.assign({}, item), { visible: isVisible, active: isVisible });
|
118
|
+
});
|
119
|
+
this.emitChange();
|
120
|
+
}
|
121
|
+
handleFilterChange({ detail: query = "" }) {
|
122
|
+
this.items = query ? this.originalItems.filter(item => item.label.toLowerCase().includes(query.toLowerCase())) : this.originalItems;
|
123
|
+
}
|
124
|
+
handleFilterItemChange(value, formProp) {
|
125
|
+
var _a;
|
126
|
+
const changedItem = this.items.find(({ id }) => id === formProp.id);
|
127
|
+
const { parameters = [] } = ((_a = changedItem.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) || {};
|
128
|
+
const indexToChangedParameter = parameters.findIndex(param => param.name === formProp.name);
|
129
|
+
parameters[indexToChangedParameter] = formProp;
|
130
|
+
changedItem.props.personalizedFilter.parameters = parameters;
|
131
|
+
if (!changedItem.value) {
|
132
|
+
changedItem.value = [];
|
89
133
|
}
|
134
|
+
changedItem.value[indexToChangedParameter] = value;
|
135
|
+
const updatedItems = [
|
136
|
+
...this.items,
|
137
|
+
changedItem
|
138
|
+
];
|
139
|
+
this.items = Array.from(new Set(updatedItems));
|
140
|
+
this.emitChange();
|
141
|
+
}
|
142
|
+
handleClearFilters() {
|
143
|
+
this.emitChange(true);
|
144
|
+
}
|
145
|
+
emitChange(clear = false) {
|
146
|
+
const items = this.items.map(item => (Object.assign(Object.assign({}, item), { visible: !clear && item.visible })));
|
147
|
+
const value = this.getVisibleCount(items);
|
148
|
+
this.valueChanged.emit({ value, items });
|
149
|
+
}
|
150
|
+
handleDeleteFilter(item) {
|
151
|
+
this._application.confirm(this.getMessage('snkPersonalizedFilter.deleteConfirm.title'), this.getMessage('snkPersonalizedFilter.deleteConfirm.message', { filterName: item.label })).then((actionConfirmed) => {
|
152
|
+
if (actionConfirmed) {
|
153
|
+
this.deleteFilter.emit(item);
|
154
|
+
this.items = this.originalItems = this.originalItems.filter(originalItem => originalItem.id !== item.id);
|
155
|
+
this.emitChange();
|
156
|
+
}
|
157
|
+
});
|
158
|
+
}
|
159
|
+
componentDidLoad() {
|
160
|
+
if (this._element)
|
161
|
+
ElementIDUtils.addIDInfoIfNotExists(this._element, 'filterContentEditor');
|
162
|
+
}
|
163
|
+
componentWillLoad() {
|
164
|
+
var _a;
|
165
|
+
this._application = ApplicationContext.getContextValue('__SNK__APPLICATION__');
|
166
|
+
this.items = this.originalItems = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.groupedItems) || [];
|
90
167
|
}
|
91
168
|
render() {
|
92
|
-
if (!this.config || this.config.type !== FilterItemType.PERSONALIZED)
|
169
|
+
if (!this.config || this.config.type !== FilterItemType.PERSONALIZED)
|
93
170
|
return undefined;
|
94
|
-
}
|
95
|
-
return (h(Host, null, this.getParamsInterface()));
|
171
|
+
return (h(Host, null, h("div", { class: "ez-margin-bottom--medium" }, this.presentationMode === EPresentationMode.MODAL && (h(Fragment, null, h("ez-filter-input", Object.assign({ label: this.config.label, onEzChange: this.handleFilterChange.bind(this) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("filterSearch")}` })), h("span", { class: "ez-text ez-title--small ez-title--primary" }, " ", this.config.detailTitle, " ")))), this.items.length ? (h("ez-scroller", { class: "SnkFilterPersonalized_list-scroller", direction: EzScrollDirection.VERTICAL }, h("ul", { class: `SnkFilterPersonalized_list-container ${!this.isModalMode() ? "SnkFilterPersonalized_list-container-chip" : ""}` }, this.items.map((itemConfig) => this.getItemContent(itemConfig))))) : (h("div", { class: "ez-margin--auto" }, h("span", { class: "ez-text ez-text--secondary ez-text--small" }, this.getMessage('snkPersonalizedFilter.info.noDataFound')))), this.presentationMode === EPresentationMode.MODAL && (h("div", { class: "ez-flex ez-flex--justify-end grow ez-margin-top--medium" }, h("ez-button", { class: "ez-button--tertiary", size: "medium", label: this.getMessage('snkPersonalizedFilter.footerActions.clear'), onClick: this.handleClearFilters.bind(this) }), h("ez-button", { class: "ez-button--secondary", size: "medium", label: this.getMessage('snkPersonalizedFilter.footerActions.create'), onClick: () => this.addFilter.emit() })))));
|
96
172
|
}
|
97
173
|
get _element() { return getElement(this); }
|
174
|
+
static get watchers() { return {
|
175
|
+
"config": ["configWatcher"]
|
176
|
+
}; }
|
98
177
|
};
|
178
|
+
SnkFilterPersonalized.style = snkFilterPersonalizedCss;
|
99
179
|
|
100
180
|
export { SnkFilterPersonalized as snk_filter_personalized };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
|
2
2
|
import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
4
4
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
|
4
4
|
const SnkFilterText = class {
|
@@ -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 { d as draggable_bundle } from './draggable.bundle-41d56f06.js';
|
3
3
|
import { ObjectUtils, ElementIDUtils, ArrayUtils, ApplicationContext } from '@sankhyalabs/core';
|
4
4
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
@@ -1,4 +1,4 @@
|
|
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 { ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
|
4
4
|
const BOUNDARY_FALSE_POSITIVE_VALUE = 14;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-8c3d76a6.js';
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { DataBinder } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
4
4
|
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
4
|
-
import './ConfigStorage-
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-def999fe.js';
|
4
|
+
import './ConfigStorage-9f4d2e67.js';
|
5
5
|
import './form-config-fetcher-cac8cd96.js';
|
6
6
|
import './DataFetcher-b3d8b2d5.js';
|
7
7
|
import './_commonjsHelpers-9943807e.js';
|
8
8
|
import './resource-fetcher-02642924.js';
|
9
|
-
import './filter-bar-config-fetcher-
|
9
|
+
import './filter-bar-config-fetcher-bd2070a3.js';
|
10
10
|
import './filter-item-type.enum-5028ed3f.js';
|
11
11
|
|
12
12
|
const snkFormCss = ".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";
|