@sankhyalabs/sankhyablocks 5.19.1 → 6.0.1
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 +162 -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 +67 -13
- 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 +15 -15
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +111 -11
- 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 +23 -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 +196 -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 +69 -13
- 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 +157 -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 +67 -13
- 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-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-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-cdfddb41.entry.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-f55450d5.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
@@ -0,0 +1,66 @@
|
|
1
|
+
:host {
|
2
|
+
/*@doc Define um valor personalizado para a altura*/
|
3
|
+
--snk-filter-personalized__max-height: 21;
|
4
|
+
/*@doc Define um valor personalizado para a largura*/
|
5
|
+
--snk-filter-personalized__max-width: 21.5;
|
6
|
+
}
|
7
|
+
|
8
|
+
.SnkFilterPersonalized_list-container {
|
9
|
+
margin: 0;
|
10
|
+
padding: 0;
|
11
|
+
list-style: none;
|
12
|
+
display: flex;
|
13
|
+
flex-direction: column;
|
14
|
+
}
|
15
|
+
|
16
|
+
.SnkFilterPersonalized_list-container-chip{
|
17
|
+
width: 400px;
|
18
|
+
}
|
19
|
+
|
20
|
+
.SnkFilterPersonalized_list-scroller {
|
21
|
+
display: block;
|
22
|
+
max-height: calc(var(--space--2xl) * var(--snk-filter-personalized__max-height));
|
23
|
+
cursor: auto;
|
24
|
+
--ez-scroller__max-height: 300px;
|
25
|
+
}
|
26
|
+
|
27
|
+
|
28
|
+
.SnkFilterPersonalized_checkbox {
|
29
|
+
display: grid;
|
30
|
+
grid-template-columns: auto auto;
|
31
|
+
justify-content: start;
|
32
|
+
}
|
33
|
+
|
34
|
+
.SnkFilterPersonalized_list-container:has(.SnkFilterPersonalized_list-item--chip) {
|
35
|
+
gap: var(--space--small, 6px);
|
36
|
+
max-width: calc(var(--space--md) * var(--snk-filter-personalized__max-width));
|
37
|
+
}
|
38
|
+
|
39
|
+
.SnkFilterPersonalized_list-item--modal {
|
40
|
+
display: flex;
|
41
|
+
border-radius: var(--border--radius-regular);
|
42
|
+
}
|
43
|
+
|
44
|
+
.SnkFilterPersonalized_list-item--modal:hover {
|
45
|
+
background-color: var(--background--medium, #f0f3f7);
|
46
|
+
}
|
47
|
+
|
48
|
+
.SnkFilterPersonalized_list-actions {
|
49
|
+
display: none;
|
50
|
+
align-items: center;
|
51
|
+
}
|
52
|
+
|
53
|
+
.SnkFilterPersonalized_list-item--modal:hover .SnkFilterPersonalized_list-actions {
|
54
|
+
display: flex;
|
55
|
+
}
|
56
|
+
|
57
|
+
.SnkFilterPersonalized_list-item--chip {
|
58
|
+
display: flex;
|
59
|
+
flex-direction: column;
|
60
|
+
border: var(--border--small, 1px solid) var(--color-strokes, #DCE0E8);
|
61
|
+
border-radius: var(--border--radius-regular);
|
62
|
+
}
|
63
|
+
|
64
|
+
.SnkFilterPersonalized_list-item--chip :first-of-type {
|
65
|
+
gap: var(--space--3xs);
|
66
|
+
}
|
@@ -0,0 +1,370 @@
|
|
1
|
+
import { ApplicationContext, ElementIDUtils, UserInterface } from '@sankhyalabs/core';
|
2
|
+
import { h, Host, Fragment } from '@stencil/core';
|
3
|
+
import FilterItemType from '../../filter-item-type.enum';
|
4
|
+
import { EPresentationMode } from '../enum/presentationMode';
|
5
|
+
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
6
|
+
import { CheckMode } from "@sankhyalabs/ezui/dist/collection/utils";
|
7
|
+
export class SnkFilterPersonalized {
|
8
|
+
constructor() {
|
9
|
+
this.originalItems = [];
|
10
|
+
this.messagesBuilder = undefined;
|
11
|
+
this.presentationMode = EPresentationMode.MODAL;
|
12
|
+
this.config = undefined;
|
13
|
+
this.value = undefined;
|
14
|
+
this.items = [];
|
15
|
+
}
|
16
|
+
/**
|
17
|
+
* Apresenta o componente
|
18
|
+
*/
|
19
|
+
async show() {
|
20
|
+
const elem = document.querySelector("#param_0");
|
21
|
+
if (elem)
|
22
|
+
elem["setFocus"]();
|
23
|
+
}
|
24
|
+
configWatcher(newConfig) {
|
25
|
+
this.items = this.originalItems = newConfig.groupedItems || [];
|
26
|
+
}
|
27
|
+
/**
|
28
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
29
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
30
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
31
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-personalized-filter.msg.ts"
|
32
|
+
*/
|
33
|
+
getMessage(key, params) {
|
34
|
+
var _a;
|
35
|
+
if (this.messagesBuilder)
|
36
|
+
return this.messagesBuilder.getMessage(key, params);
|
37
|
+
if ((_a = this._application) === null || _a === void 0 ? void 0 : _a.messagesBuilder)
|
38
|
+
return this._application.messagesBuilder.getMessage(key, params);
|
39
|
+
}
|
40
|
+
getItemContent(item) {
|
41
|
+
var _a, _b;
|
42
|
+
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}`)}` })));
|
43
|
+
const isVariable = !!((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters.length);
|
44
|
+
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() ?
|
45
|
+
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) }))
|
46
|
+
:
|
47
|
+
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)))));
|
48
|
+
}
|
49
|
+
isModalMode() {
|
50
|
+
return this.presentationMode === EPresentationMode.MODAL;
|
51
|
+
}
|
52
|
+
doSearch(mode, argument, param) {
|
53
|
+
return new Promise((resolve, reject) => {
|
54
|
+
this._application.executePreparedSearch(mode, argument, param.searchContext)
|
55
|
+
.then(result => {
|
56
|
+
resolve(result);
|
57
|
+
}).catch(reason => {
|
58
|
+
reject(reason);
|
59
|
+
});
|
60
|
+
});
|
61
|
+
}
|
62
|
+
getFormField(parentItem) {
|
63
|
+
var _a, _b;
|
64
|
+
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;
|
65
|
+
return params.map((param, index) => {
|
66
|
+
var _a, _b;
|
67
|
+
const formProp = Object.assign(Object.assign({}, param), { id: parentItem.id });
|
68
|
+
const value = (_a = parentItem.value) === null || _a === void 0 ? void 0 : _a[index];
|
69
|
+
const elemId = 'param_' + index;
|
70
|
+
switch (param.userInterface) {
|
71
|
+
case UserInterface.SEARCH:
|
72
|
+
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) });
|
73
|
+
case UserInterface.SWITCH:
|
74
|
+
case UserInterface.CHECKBOX:
|
75
|
+
const mode = UserInterface.SWITCH === param.userInterface ? CheckMode.SWITCH : CheckMode.REGULAR;
|
76
|
+
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) });
|
77
|
+
case UserInterface.DECIMALNUMBER:
|
78
|
+
case UserInterface.INTEGERNUMBER:
|
79
|
+
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) });
|
80
|
+
case UserInterface.OPTIONSELECTOR:
|
81
|
+
return h("ez-combo-box", { id: elemId, label: param.label, value: value, options: param.options, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
82
|
+
case UserInterface.DATE:
|
83
|
+
return h("ez-date-input", { id: elemId, label: param.label, value: this.parseDate(value), onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
84
|
+
case UserInterface.DATETIME:
|
85
|
+
return h("ez-date-time-input", { id: elemId, label: param.label, value: this.parseDate(value), onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
86
|
+
default:
|
87
|
+
return h("ez-text-input", { id: elemId, label: param.label, value: value, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
|
88
|
+
}
|
89
|
+
});
|
90
|
+
}
|
91
|
+
parseDate(objValue) {
|
92
|
+
if (typeof objValue === "string") {
|
93
|
+
let date = new Date(objValue);
|
94
|
+
date.setMinutes(date.getMinutes() + date.getTimezoneOffset());
|
95
|
+
return date;
|
96
|
+
}
|
97
|
+
return objValue;
|
98
|
+
}
|
99
|
+
getVisibleCount(items) {
|
100
|
+
return items.reduce((total, item) => {
|
101
|
+
if (!!item.visible)
|
102
|
+
return total + 1;
|
103
|
+
return total;
|
104
|
+
}, 0);
|
105
|
+
}
|
106
|
+
handleItemChange(visible, itemId) {
|
107
|
+
this.items = this.originalItems = this.originalItems.map(item => {
|
108
|
+
const isVisible = item.id === itemId ? visible : item.visible;
|
109
|
+
return Object.assign(Object.assign({}, item), { visible: isVisible, active: isVisible });
|
110
|
+
});
|
111
|
+
this.emitChange();
|
112
|
+
}
|
113
|
+
handleFilterChange({ detail: query = "" }) {
|
114
|
+
this.items = query ? this.originalItems.filter(item => item.label.toLowerCase().includes(query.toLowerCase())) : this.originalItems;
|
115
|
+
}
|
116
|
+
handleFilterItemChange(value, formProp) {
|
117
|
+
var _a;
|
118
|
+
const changedItem = this.items.find(({ id }) => id === formProp.id);
|
119
|
+
const { parameters = [] } = ((_a = changedItem.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) || {};
|
120
|
+
const indexToChangedParameter = parameters.findIndex(param => param.name === formProp.name);
|
121
|
+
parameters[indexToChangedParameter] = formProp;
|
122
|
+
changedItem.props.personalizedFilter.parameters = parameters;
|
123
|
+
if (!changedItem.value) {
|
124
|
+
changedItem.value = [];
|
125
|
+
}
|
126
|
+
changedItem.value[indexToChangedParameter] = value;
|
127
|
+
const updatedItems = [
|
128
|
+
...this.items,
|
129
|
+
changedItem
|
130
|
+
];
|
131
|
+
this.items = Array.from(new Set(updatedItems));
|
132
|
+
this.emitChange();
|
133
|
+
}
|
134
|
+
handleClearFilters() {
|
135
|
+
this.emitChange(true);
|
136
|
+
}
|
137
|
+
emitChange(clear = false) {
|
138
|
+
const items = this.items.map(item => (Object.assign(Object.assign({}, item), { visible: !clear && item.visible })));
|
139
|
+
const value = this.getVisibleCount(items);
|
140
|
+
this.valueChanged.emit({ value, items });
|
141
|
+
}
|
142
|
+
handleDeleteFilter(item) {
|
143
|
+
this._application.confirm(this.getMessage('snkPersonalizedFilter.deleteConfirm.title'), this.getMessage('snkPersonalizedFilter.deleteConfirm.message', { filterName: item.label })).then((actionConfirmed) => {
|
144
|
+
if (actionConfirmed) {
|
145
|
+
this.deleteFilter.emit(item);
|
146
|
+
this.items = this.originalItems = this.originalItems.filter(originalItem => originalItem.id !== item.id);
|
147
|
+
this.emitChange();
|
148
|
+
}
|
149
|
+
});
|
150
|
+
}
|
151
|
+
componentDidLoad() {
|
152
|
+
if (this._element)
|
153
|
+
ElementIDUtils.addIDInfoIfNotExists(this._element, 'filterContentEditor');
|
154
|
+
}
|
155
|
+
componentWillLoad() {
|
156
|
+
var _a;
|
157
|
+
this._application = ApplicationContext.getContextValue('__SNK__APPLICATION__');
|
158
|
+
this.items = this.originalItems = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.groupedItems) || [];
|
159
|
+
}
|
160
|
+
render() {
|
161
|
+
if (!this.config || this.config.type !== FilterItemType.PERSONALIZED)
|
162
|
+
return undefined;
|
163
|
+
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() })))));
|
164
|
+
}
|
165
|
+
static get is() { return "snk-filter-personalized"; }
|
166
|
+
static get encapsulation() { return "scoped"; }
|
167
|
+
static get originalStyleUrls() {
|
168
|
+
return {
|
169
|
+
"$": ["snk-filter-personalized.css"]
|
170
|
+
};
|
171
|
+
}
|
172
|
+
static get styleUrls() {
|
173
|
+
return {
|
174
|
+
"$": ["snk-filter-personalized.css"]
|
175
|
+
};
|
176
|
+
}
|
177
|
+
static get properties() {
|
178
|
+
return {
|
179
|
+
"messagesBuilder": {
|
180
|
+
"type": "unknown",
|
181
|
+
"mutable": true,
|
182
|
+
"complexType": {
|
183
|
+
"original": "SnkMessageBuilder",
|
184
|
+
"resolved": "SnkMessageBuilder",
|
185
|
+
"references": {
|
186
|
+
"SnkMessageBuilder": {
|
187
|
+
"location": "import",
|
188
|
+
"path": "../../../../../lib/message/SnkMessageBuilder"
|
189
|
+
}
|
190
|
+
}
|
191
|
+
},
|
192
|
+
"required": false,
|
193
|
+
"optional": false,
|
194
|
+
"docs": {
|
195
|
+
"tags": [],
|
196
|
+
"text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
|
197
|
+
}
|
198
|
+
},
|
199
|
+
"presentationMode": {
|
200
|
+
"type": "number",
|
201
|
+
"mutable": false,
|
202
|
+
"complexType": {
|
203
|
+
"original": "EPresentationMode",
|
204
|
+
"resolved": "EPresentationMode.CHIP | EPresentationMode.MODAL",
|
205
|
+
"references": {
|
206
|
+
"EPresentationMode": {
|
207
|
+
"location": "import",
|
208
|
+
"path": "../enum/presentationMode"
|
209
|
+
}
|
210
|
+
}
|
211
|
+
},
|
212
|
+
"required": false,
|
213
|
+
"optional": false,
|
214
|
+
"docs": {
|
215
|
+
"tags": [],
|
216
|
+
"text": "Controla o modo de apresenta\u00E7\u00E3o do componente, que pode ser configurado como modal ou chip."
|
217
|
+
},
|
218
|
+
"attribute": "presentation-mode",
|
219
|
+
"reflect": false,
|
220
|
+
"defaultValue": "EPresentationMode.MODAL"
|
221
|
+
},
|
222
|
+
"config": {
|
223
|
+
"type": "unknown",
|
224
|
+
"mutable": false,
|
225
|
+
"complexType": {
|
226
|
+
"original": "SnkFilterItemConfig",
|
227
|
+
"resolved": "SnkFilterItemConfig",
|
228
|
+
"references": {
|
229
|
+
"SnkFilterItemConfig": {
|
230
|
+
"location": "import",
|
231
|
+
"path": "../../snk-filter-item"
|
232
|
+
}
|
233
|
+
}
|
234
|
+
},
|
235
|
+
"required": false,
|
236
|
+
"optional": false,
|
237
|
+
"docs": {
|
238
|
+
"tags": [],
|
239
|
+
"text": "Configura\u00E7\u00E3o que define as op\u00E7\u00F5es e comportamento do componente."
|
240
|
+
}
|
241
|
+
},
|
242
|
+
"value": {
|
243
|
+
"type": "unknown",
|
244
|
+
"mutable": true,
|
245
|
+
"complexType": {
|
246
|
+
"original": "Array<IOption|boolean|string|number|Date>",
|
247
|
+
"resolved": "(string | number | boolean | Date | IOption)[]",
|
248
|
+
"references": {
|
249
|
+
"Array": {
|
250
|
+
"location": "global"
|
251
|
+
},
|
252
|
+
"IOption": {
|
253
|
+
"location": "import",
|
254
|
+
"path": "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box"
|
255
|
+
},
|
256
|
+
"Date": {
|
257
|
+
"location": "global"
|
258
|
+
}
|
259
|
+
}
|
260
|
+
},
|
261
|
+
"required": false,
|
262
|
+
"optional": false,
|
263
|
+
"docs": {
|
264
|
+
"tags": [],
|
265
|
+
"text": "Controla o valor do componente."
|
266
|
+
}
|
267
|
+
}
|
268
|
+
};
|
269
|
+
}
|
270
|
+
static get states() {
|
271
|
+
return {
|
272
|
+
"items": {}
|
273
|
+
};
|
274
|
+
}
|
275
|
+
static get events() {
|
276
|
+
return [{
|
277
|
+
"method": "deleteFilter",
|
278
|
+
"name": "deleteFilter",
|
279
|
+
"bubbles": true,
|
280
|
+
"cancelable": true,
|
281
|
+
"composed": true,
|
282
|
+
"docs": {
|
283
|
+
"tags": [],
|
284
|
+
"text": ""
|
285
|
+
},
|
286
|
+
"complexType": {
|
287
|
+
"original": "IPersonalizedFilter",
|
288
|
+
"resolved": "IPersonalizedFilter",
|
289
|
+
"references": {
|
290
|
+
"IPersonalizedFilter": {
|
291
|
+
"location": "import",
|
292
|
+
"path": "../../../../snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IPersonalizedFilter"
|
293
|
+
}
|
294
|
+
}
|
295
|
+
}
|
296
|
+
}, {
|
297
|
+
"method": "editFilter",
|
298
|
+
"name": "editFilter",
|
299
|
+
"bubbles": true,
|
300
|
+
"cancelable": true,
|
301
|
+
"composed": true,
|
302
|
+
"docs": {
|
303
|
+
"tags": [],
|
304
|
+
"text": ""
|
305
|
+
},
|
306
|
+
"complexType": {
|
307
|
+
"original": "string",
|
308
|
+
"resolved": "string",
|
309
|
+
"references": {}
|
310
|
+
}
|
311
|
+
}, {
|
312
|
+
"method": "addFilter",
|
313
|
+
"name": "addFilter",
|
314
|
+
"bubbles": true,
|
315
|
+
"cancelable": true,
|
316
|
+
"composed": true,
|
317
|
+
"docs": {
|
318
|
+
"tags": [],
|
319
|
+
"text": ""
|
320
|
+
},
|
321
|
+
"complexType": {
|
322
|
+
"original": "void",
|
323
|
+
"resolved": "void",
|
324
|
+
"references": {}
|
325
|
+
}
|
326
|
+
}, {
|
327
|
+
"method": "valueChanged",
|
328
|
+
"name": "valueChanged",
|
329
|
+
"bubbles": true,
|
330
|
+
"cancelable": true,
|
331
|
+
"composed": true,
|
332
|
+
"docs": {
|
333
|
+
"tags": [],
|
334
|
+
"text": "Emitido quando o valor do filtro \u00E9 alterado."
|
335
|
+
},
|
336
|
+
"complexType": {
|
337
|
+
"original": "any",
|
338
|
+
"resolved": "any",
|
339
|
+
"references": {}
|
340
|
+
}
|
341
|
+
}];
|
342
|
+
}
|
343
|
+
static get methods() {
|
344
|
+
return {
|
345
|
+
"show": {
|
346
|
+
"complexType": {
|
347
|
+
"signature": "() => Promise<void>",
|
348
|
+
"parameters": [],
|
349
|
+
"references": {
|
350
|
+
"Promise": {
|
351
|
+
"location": "global"
|
352
|
+
}
|
353
|
+
},
|
354
|
+
"return": "Promise<void>"
|
355
|
+
},
|
356
|
+
"docs": {
|
357
|
+
"text": "Apresenta o componente",
|
358
|
+
"tags": []
|
359
|
+
}
|
360
|
+
}
|
361
|
+
};
|
362
|
+
}
|
363
|
+
static get elementRef() { return "_element"; }
|
364
|
+
static get watchers() {
|
365
|
+
return [{
|
366
|
+
"propName": "config",
|
367
|
+
"methodName": "configWatcher"
|
368
|
+
}];
|
369
|
+
}
|
370
|
+
}
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import { h, Host, Fragment } from '@stencil/core';
|
2
2
|
import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
|
3
3
|
import FilterItemType from './filter-item-type.enum';
|
4
|
-
import { ElementIDUtils,
|
4
|
+
import { ElementIDUtils, ApplicationContext, ObjectUtils } from '@sankhyalabs/core';
|
5
5
|
import FilterBarConfigFetcher from '../../../lib/http/data-fetcher/fetchers/filter-bar-config-fetcher';
|
6
|
+
import { EPresentationMode } from './editors/enum/presentationMode';
|
7
|
+
import { PersonalizedFilterUtils } from '../../snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils';
|
6
8
|
export class SnkFilterDetail {
|
7
9
|
constructor() {
|
8
10
|
this.config = undefined;
|
@@ -15,8 +17,9 @@ export class SnkFilterDetail {
|
|
15
17
|
var _a, _b;
|
16
18
|
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["show"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
17
19
|
}
|
18
|
-
observeConfig() {
|
20
|
+
observeConfig(newValue) {
|
19
21
|
var _a, _b;
|
22
|
+
this._editor && (this._editor["config"] = newValue);
|
20
23
|
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["reloadList"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
21
24
|
}
|
22
25
|
componentDidLoad() {
|
@@ -33,24 +36,37 @@ export class SnkFilterDetail {
|
|
33
36
|
getContentEditor() {
|
34
37
|
switch (this.config.type) {
|
35
38
|
case FilterItemType.BINARY_SELECT:
|
36
|
-
return "snk-filter-binary-select";
|
39
|
+
return { tag: "snk-filter-binary-select" };
|
37
40
|
case FilterItemType.MULTI_SELECT:
|
38
|
-
return "snk-filter-multi-select";
|
41
|
+
return { tag: "snk-filter-multi-select" };
|
39
42
|
case FilterItemType.PERIOD:
|
40
|
-
return "snk-filter-period";
|
43
|
+
return { tag: "snk-filter-period" };
|
41
44
|
case FilterItemType.SEARCH:
|
42
|
-
return "snk-filter-search";
|
45
|
+
return { tag: "snk-filter-search" };
|
43
46
|
case FilterItemType.NUMBER:
|
44
|
-
return "snk-filter-number";
|
47
|
+
return { tag: "snk-filter-number" };
|
45
48
|
case FilterItemType.PERSONALIZED:
|
46
|
-
|
49
|
+
const snkFilterPersonalizedProps = {
|
50
|
+
tag: "snk-filter-personalized", props: {
|
51
|
+
presentationMode: EPresentationMode.CHIP,
|
52
|
+
onValueChanged: ({ detail }) => {
|
53
|
+
const groupedItems = (detail === null || detail === void 0 ? void 0 : detail.items) || this.config.groupedItems;
|
54
|
+
this.config = Object.assign(Object.assign({}, this.config), { groupedItems, visible: (groupedItems || []).filter(item => item.visible).length > 0 });
|
55
|
+
}
|
56
|
+
}
|
57
|
+
};
|
58
|
+
return snkFilterPersonalizedProps;
|
47
59
|
case FilterItemType.MULTI_LIST:
|
48
|
-
return "snk-entity-list";
|
60
|
+
return { tag: "snk-entity-list" };
|
49
61
|
}
|
50
|
-
return "snk-filter-text";
|
62
|
+
return { tag: "snk-filter-text" };
|
51
63
|
}
|
52
64
|
removeItem() {
|
53
|
-
|
65
|
+
const removedConfig = Object.assign(Object.assign({}, this.config), { visible: false, fixed: false, value: undefined });
|
66
|
+
if (removedConfig.groupedItems != undefined) {
|
67
|
+
removedConfig.groupedItems = removedConfig.groupedItems.map(item => (Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined })));
|
68
|
+
}
|
69
|
+
this.changeConfig(removedConfig);
|
54
70
|
}
|
55
71
|
getPopUpHeaderButtons() {
|
56
72
|
return (h(Fragment, null, !this.config.removalBlocked && this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), !this.config.hardFixed && this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))));
|
@@ -65,69 +81,34 @@ export class SnkFilterDetail {
|
|
65
81
|
buttonElement.removeAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
66
82
|
ElementIDUtils.addIDInfoIfNotExists(buttonElement, "button", dataElement);
|
67
83
|
}
|
68
|
-
getNormalizedValue(params, value) {
|
69
|
-
return params.reduce((arrayValues, currentParam, index) => {
|
70
|
-
if (currentParam.dataType === DataType.BOOLEAN && (arrayValues == undefined || arrayValues[index] == undefined)) {
|
71
|
-
arrayValues = arrayValues || [];
|
72
|
-
arrayValues[index] = false;
|
73
|
-
}
|
74
|
-
return arrayValues;
|
75
|
-
}, value);
|
76
|
-
}
|
77
84
|
apply() {
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
if (this.config.type === FilterItemType.PERSONALIZED) {
|
82
|
-
const params = ((_a = this.config.props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || [];
|
83
|
-
value = this.getNormalizedValue(params, value);
|
84
|
-
const paramsCount = params.length;
|
85
|
-
if (paramsCount === 0) {
|
86
|
-
//Valor do filtro personalizado sem parametros deve ser um array vazio
|
87
|
-
value = [];
|
88
|
-
}
|
89
|
-
else {
|
90
|
-
isValid = this.validateAllFilled(paramsCount, value);
|
91
|
-
}
|
92
|
-
}
|
93
|
-
if (isValid) {
|
94
|
-
this.changeConfig(Object.assign(Object.assign({}, this.config), { value: value }));
|
85
|
+
const isValid = PersonalizedFilterUtils.validateVariableValues(this.config, this._editor["value"]);
|
86
|
+
if (!isValid) {
|
87
|
+
return ApplicationUtils.alert(this.getMessage('snkFilterBar.filterModal.validations.notFullFilled.title'), this.getMessage('snkFilterBar.filterModal.validations.notFullFilled.message'));
|
95
88
|
}
|
89
|
+
const valuesArray = this._editor["value"] || this.config.value;
|
90
|
+
this.changeConfig(Object.assign(Object.assign({}, this.config), { visible: this.isVisible(), value: valuesArray }));
|
96
91
|
}
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
if (value != undefined && paramsCount > 1) {
|
101
|
-
if (paramsCount > value.length) {
|
102
|
-
isValid = false;
|
103
|
-
}
|
104
|
-
else {
|
105
|
-
value.forEach(item => {
|
106
|
-
if (item == undefined) {
|
107
|
-
isValid = false;
|
108
|
-
}
|
109
|
-
});
|
110
|
-
}
|
111
|
-
}
|
112
|
-
if (!isValid) {
|
113
|
-
ApplicationUtils.alert("Filtro parcialmente preenchido", "Favor completar todas as informações do filtro.");
|
92
|
+
isVisible() {
|
93
|
+
if (this.config.groupedItems && this.config.groupedItems.length > 0) {
|
94
|
+
return this.config.groupedItems.filter(item => item.visible).length > 0;
|
114
95
|
}
|
115
|
-
return
|
96
|
+
return true;
|
116
97
|
}
|
117
|
-
/* WARNING: Temporário.*/
|
118
98
|
clear() {
|
119
|
-
var _a
|
99
|
+
var _a;
|
120
100
|
if (FilterItemType.MULTI_LIST === this.config.type) {
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
});
|
125
|
-
(_b = this._editor) === null || _b === void 0 ? void 0 : _b['reloadList']();
|
101
|
+
const configCopy = ObjectUtils.copy(this.config);
|
102
|
+
(_a = configCopy.value) === null || _a === void 0 ? void 0 : _a.forEach(value => !!value && (value.check = false));
|
103
|
+
this.config = ObjectUtils.copy(configCopy);
|
126
104
|
}
|
127
105
|
else {
|
128
106
|
this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined }));
|
129
107
|
}
|
130
108
|
}
|
109
|
+
filterCanBeCleared() {
|
110
|
+
return this.config.type !== FilterItemType.PERSONALIZED;
|
111
|
+
}
|
131
112
|
onKeyDonwListener(event) {
|
132
113
|
if (event.key === "Enter") {
|
133
114
|
this._applyButton.setFocus().then(() => this.apply());
|
@@ -137,10 +118,13 @@ export class SnkFilterDetail {
|
|
137
118
|
return h("ez-icon", { iconName: "delete", onClick: () => this.removeValueFromConfig(item) });
|
138
119
|
}
|
139
120
|
removeValueFromConfig(item) {
|
140
|
-
var _a, _b
|
141
|
-
|
142
|
-
|
143
|
-
|
121
|
+
var _a, _b;
|
122
|
+
if (this.config) {
|
123
|
+
const configCopy = ObjectUtils.copy(this.config);
|
124
|
+
const index = (_a = configCopy.value) === null || _a === void 0 ? void 0 : _a.findIndex(i => (i === null || i === void 0 ? void 0 : i.id) === item.id);
|
125
|
+
(_b = configCopy.value) === null || _b === void 0 ? void 0 : _b.splice(index, 1);
|
126
|
+
this.config = ObjectUtils.copy(configCopy);
|
127
|
+
}
|
144
128
|
}
|
145
129
|
saveConfig(newConfig) {
|
146
130
|
var _a;
|
@@ -151,8 +135,8 @@ export class SnkFilterDetail {
|
|
151
135
|
});
|
152
136
|
}
|
153
137
|
render() {
|
154
|
-
const
|
155
|
-
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(
|
138
|
+
const { tag: CustomElement, props } = this.getContentEditor();
|
139
|
+
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(CustomElement, Object.assign({ maxHeightList: '240px', ref: ref => this._editor = ref, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt), "data-element-id": this._idContentEditor, getMessage: this.getMessage, onSaveConfig: evt => this.saveConfig(evt.detail), rightListSlotBuilder: item => this.buildRightSlot(item) }, props)), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, this.filterCanBeCleared() && (h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" })), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
|
156
140
|
}
|
157
141
|
static get is() { return "snk-filter-detail"; }
|
158
142
|
static get properties() {
|