@sankhyalabs/sankhyablocks 5.19.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ConfigStorage-0a738cdc.js +304 -0
- package/dist/cjs/IExpressionItem-1090c3fd.js +7 -0
- package/dist/cjs/PersonalizedFilterUtils-7d959e91.js +229 -0
- package/dist/cjs/{SnkFormConfigManager-69df3f74.js → SnkFormConfigManager-a583f503.js} +1 -1
- package/dist/cjs/{SnkMessageBuilder-3b5b5614.js → SnkMessageBuilder-8a2d3f26.js} +65 -4
- package/dist/cjs/{filter-bar-config-fetcher-a14536bf.js → filter-bar-config-fetcher-75219599.js} +34 -11
- package/dist/cjs/{index-de79181a.js → index-59a3e2de.js} +1 -1
- package/dist/cjs/{index-f400b1d6.js → index-614af008.js} +2 -0
- package/dist/cjs/{index-21bd01e1.js → index-aaaa2af5.js} +6 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-actions-button.cjs.entry.js +2 -2
- package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +4 -4
- package/dist/cjs/snk-attach.cjs.entry.js +4 -4
- package/dist/cjs/snk-client-confirm.cjs.entry.js +2 -2
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +4 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +4 -4
- package/dist/cjs/{snk-data-unit-e9c20097.js → snk-data-unit-53fc9200.js} +2 -2
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +10 -10
- package/dist/cjs/snk-entity-list.cjs.entry.js +6 -4
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/snk-expression-group.cjs.entry.js +246 -0
- package/dist/cjs/{snk-filter-field-search_2.cjs.entry.js → snk-expression-item_3.cjs.entry.js} +327 -66
- package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +161 -72
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +54 -69
- package/dist/cjs/snk-filter-item.cjs.entry.js +21 -7
- package/dist/cjs/snk-filter-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +57 -29
- package/dist/cjs/snk-filter-modal.cjs.entry.js +66 -12
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +5 -3
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +135 -55
- package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +7 -7
- package/dist/cjs/{snk-guides-viewer-c8843478.js → snk-guides-viewer-10ffca10.js} +5 -5
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +166 -94
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-bar.cjs.entry.js +45 -0
- package/dist/cjs/{snk-simple-bar_2.cjs.entry.js → snk-simple-crud.cjs.entry.js} +5 -43
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +4 -4
- package/dist/cjs/{taskbar-elements-3be287d6.js → taskbar-elements-068aa945.js} +3 -3
- package/dist/cjs/{taskbar-processor-02f0fc84.js → taskbar-processor-6442c585.js} +1 -1
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/snk-actions-button/subcomponents/snk-client-confirm.js +1 -1
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +6 -4
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +34 -12
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +4 -2
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.css +66 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.js +370 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +52 -68
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +20 -6
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +1 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +110 -10
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +98 -27
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +21 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +100 -49
- package/dist/collection/components/snk-filter-bar/types/custom-element-filter.js +1 -0
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +22 -3
- package/dist/collection/components/snk-filter-bar/utils/filters-mock.js +96 -0
- package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css +1 -1
- package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js +27 -6
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css +39 -2
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +276 -30
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css +73 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js +443 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js +16 -24
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css +18 -4
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +131 -21
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionGroup.js +0 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.js +5 -1
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.js +1 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IPersonalizedFilter.js +1 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.js +3 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +1 -1
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +184 -15
- package/dist/collection/lib/@types/index.js +2 -0
- package/dist/collection/lib/configs/ConfigStorage.js +15 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +36 -13
- package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +106 -4
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +15 -2
- package/dist/collection/lib/message/resources/snk-filter-field-search.msg.js +2 -0
- package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +48 -2
- package/dist/components/ConfigStorage.js +180 -1
- package/dist/components/PersonalizedFilterUtils.js +227 -0
- package/dist/components/SnkMessageBuilder.js +65 -4
- package/dist/components/filter-bar-config-fetcher.js +34 -11
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +3 -1
- package/dist/components/snk-client-confirm.js +1 -1
- package/dist/components/snk-crud.js +65 -35
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-detail-view2.js +99 -44
- package/dist/components/snk-entity-list.js +6 -4
- package/dist/components/snk-expression-group.d.ts +11 -0
- package/dist/components/snk-expression-group.js +6 -0
- package/dist/components/snk-expression-group2.js +296 -0
- package/dist/components/snk-expression-item2.js +133 -46
- package/dist/components/snk-filter-bar2.js +195 -68
- package/dist/components/snk-filter-detail2.js +52 -68
- package/dist/components/snk-filter-field-search2.js +26 -5
- package/dist/components/snk-filter-item2.js +20 -6
- package/dist/components/snk-filter-modal-item2.js +54 -27
- package/dist/components/snk-filter-modal.js +68 -12
- package/dist/components/snk-filter-param-config2.js +3 -57
- package/dist/components/snk-filter-period.js +4 -2
- package/dist/components/snk-filter-personalized.js +139 -58
- package/dist/components/snk-grid2.js +52 -16
- package/dist/components/snk-personalized-filter.js +1 -153
- package/dist/components/snk-personalized-filter2.js +238 -0
- package/dist/esm/ConfigStorage-9f4d2e67.js +300 -0
- package/dist/esm/IExpressionItem-2e922b2c.js +7 -0
- package/dist/esm/PersonalizedFilterUtils-202cd721.js +227 -0
- package/dist/esm/{SnkFormConfigManager-e60367a0.js → SnkFormConfigManager-def999fe.js} +1 -1
- package/dist/esm/{SnkMessageBuilder-188a38bb.js → SnkMessageBuilder-cc4d1599.js} +65 -4
- package/dist/esm/{filter-bar-config-fetcher-edc48f4b.js → filter-bar-config-fetcher-bd2070a3.js} +34 -11
- package/dist/esm/{index-cfd4bb13.js → index-8c3d76a6.js} +6 -1
- package/dist/esm/{index-507e19ec.js → index-a255b326.js} +3 -1
- package/dist/esm/{index-8efbf198.js → index-d60ca0ac.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/sankhyablocks.js +3 -3
- package/dist/esm/snk-actions-button.entry.js +2 -2
- package/dist/esm/snk-actions-form.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +4 -4
- package/dist/esm/snk-attach.entry.js +4 -4
- package/dist/esm/snk-client-confirm.entry.js +2 -2
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +4 -4
- package/dist/esm/snk-data-exporter.entry.js +4 -4
- package/dist/esm/{snk-data-unit-79b1583a.js → snk-data-unit-97824457.js} +2 -2
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-detail-view.entry.js +10 -10
- package/dist/esm/snk-entity-list.entry.js +7 -5
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-expression-group.entry.js +242 -0
- package/dist/esm/{snk-filter-field-search_2.entry.js → snk-expression-item_3.entry.js} +326 -66
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +156 -67
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-detail.entry.js +55 -70
- package/dist/esm/snk-filter-item.entry.js +21 -7
- package/dist/esm/snk-filter-list.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +57 -29
- package/dist/esm/snk-filter-modal.entry.js +66 -12
- package/dist/esm/snk-filter-multi-select.entry.js +1 -1
- package/dist/esm/snk-filter-number.entry.js +1 -1
- package/dist/esm/snk-filter-period.entry.js +5 -3
- package/dist/esm/snk-filter-personalized.entry.js +135 -55
- package/dist/esm/snk-filter-search.entry.js +1 -1
- package/dist/esm/snk-filter-text.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form-summary.entry.js +1 -1
- package/dist/esm/snk-form-view.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid-config.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +7 -7
- package/dist/esm/{snk-guides-viewer-59d3a78c.js → snk-guides-viewer-0380f3df.js} +5 -5
- package/dist/esm/snk-guides-viewer.entry.js +9 -9
- package/dist/esm/snk-personalized-filter.entry.js +166 -94
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-select-box.entry.js +1 -1
- package/dist/esm/snk-simple-bar.entry.js +41 -0
- package/dist/esm/{snk-simple-bar_2.entry.js → snk-simple-crud.entry.js} +7 -44
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +4 -4
- package/dist/esm/{taskbar-elements-8ff33c26.js → taskbar-elements-26d0fba3.js} +3 -3
- package/dist/esm/{taskbar-processor-20de6616.js → taskbar-processor-dfef41a8.js} +1 -1
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/{p-f27dc5e9.entry.js → p-00d1cac4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b9667fbe.js → p-066ee142.js} +2 -2
- package/dist/sankhyablocks/p-09a058ba.entry.js +1 -0
- package/dist/sankhyablocks/{p-82bc4666.entry.js → p-0dec4d29.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1e6a95f5.entry.js → p-12632b8e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-384c4a6b.js → p-18b34bb4.js} +1 -1
- package/dist/sankhyablocks/{p-538c057a.entry.js → p-2ad89e28.entry.js} +1 -1
- package/dist/sankhyablocks/p-2d5108b3.js +1 -0
- package/dist/sankhyablocks/{p-ff398057.entry.js → p-34cd4b39.entry.js} +1 -1
- package/dist/sankhyablocks/p-36ecb6ab.js +1 -0
- package/dist/sankhyablocks/p-372e0185.entry.js +1 -0
- package/dist/sankhyablocks/p-3be34bd1.entry.js +1 -0
- package/dist/sankhyablocks/p-3d45107f.js +1 -0
- package/dist/sankhyablocks/{p-28c12f65.js → p-463e0936.js} +1 -1
- package/dist/sankhyablocks/{p-e701646c.entry.js → p-49d628d1.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e642bf7a.entry.js → p-50db4bc4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-093febff.entry.js → p-5427566a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6a02e236.js → p-590d8900.js} +1 -1
- package/dist/sankhyablocks/p-5a6c090e.entry.js +1 -0
- package/dist/sankhyablocks/p-639be4aa.entry.js +1 -0
- package/dist/sankhyablocks/{p-e2bb9c9a.entry.js → p-67a19b48.entry.js} +1 -1
- package/dist/sankhyablocks/{p-19692f92.js → p-69770075.js} +1 -1
- package/dist/sankhyablocks/p-6d4169fc.entry.js +1 -0
- package/dist/sankhyablocks/{p-0b40c655.js → p-708ee8ee.js} +1 -1
- package/dist/sankhyablocks/{p-9af04fc7.entry.js → p-718cc24b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2d0fc912.entry.js → p-7946512f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-900b2889.entry.js → p-7a5e1be7.entry.js} +1 -1
- package/dist/sankhyablocks/p-801b8858.js +68 -0
- package/dist/sankhyablocks/{p-80e52e85.entry.js → p-847b9506.entry.js} +1 -1
- package/dist/sankhyablocks/{p-56d70073.entry.js → p-8d541539.entry.js} +1 -1
- package/dist/sankhyablocks/{p-584a315a.entry.js → p-8e98a893.entry.js} +1 -1
- package/dist/sankhyablocks/p-9731180c.entry.js +1 -0
- package/dist/sankhyablocks/p-a6055eb9.entry.js +1 -0
- package/dist/sankhyablocks/{p-b680fa7a.entry.js → p-a655ea15.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b75ce8b8.entry.js → p-a8b06801.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b25450ab.js → p-a8e5ded0.js} +1 -1
- package/dist/sankhyablocks/{p-6ac29569.entry.js → p-b66b99d9.entry.js} +1 -1
- package/dist/sankhyablocks/p-b7efc49a.entry.js +1 -0
- package/dist/sankhyablocks/{p-9c7f7214.entry.js → p-b91ee370.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e551b19a.entry.js → p-b940798f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-72e78de0.entry.js → p-bbefb3b2.entry.js} +1 -1
- package/dist/sankhyablocks/p-bdd61fa8.entry.js +1 -0
- package/dist/sankhyablocks/{p-f8c66aa3.entry.js → p-c06973e7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-257c71a7.entry.js → p-c17e19a2.entry.js} +1 -1
- package/dist/sankhyablocks/p-c6bf66e0.js +1 -0
- package/dist/sankhyablocks/p-cf90a195.entry.js +1 -0
- package/dist/sankhyablocks/{p-44c2ed16.entry.js → p-d11c5026.entry.js} +1 -1
- package/dist/sankhyablocks/p-d5145c3f.entry.js +1 -0
- package/dist/sankhyablocks/p-de328b00.entry.js +1 -0
- package/dist/sankhyablocks/{p-971abcc2.entry.js → p-e500863b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-22e44b9d.entry.js → p-e824aef2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4ce96831.entry.js → p-eb24c092.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4c2015a9.js → p-eb90de43.js} +1 -1
- package/dist/sankhyablocks/p-ebb8de34.entry.js +1 -0
- package/dist/sankhyablocks/{p-8652d177.entry.js → p-fc512cbe.entry.js} +1 -1
- package/dist/sankhyablocks/{p-786ae316.entry.js → p-fced1d89.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e0b4aec3.entry.js → p-fdb43927.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.d.ts +85 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +6 -6
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +18 -1
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +14 -6
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +10 -3
- package/dist/types/components/snk-filter-bar/types/custom-element-filter.d.ts +6 -0
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +10 -1
- package/dist/types/components/snk-filter-bar/utils/filters-mock.d.ts +92 -15
- package/dist/types/components/snk-filter-field-search/interfaces/index.d.ts +5 -11
- package/dist/types/components/snk-filter-field-search/snk-filter-field-search.d.ts +3 -0
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +39 -6
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.d.ts +82 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.d.ts +1 -1
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.d.ts +13 -1
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionGroup.d.ts +0 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.d.ts +23 -3
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.d.ts +21 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IPersonalizedFilter.d.ts +11 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.d.ts +3 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.d.ts +14 -2
- package/dist/types/components.d.ts +169 -10
- package/dist/types/lib/@types/index.d.ts +3 -1
- package/dist/types/lib/configs/ConfigStorage.d.ts +5 -0
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +4 -2
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +5 -0
- package/dist/types/lib/store/index.d.ts +1 -2
- package/package.json +5 -5
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ConfigStorage-f68c3607.js +0 -124
- package/dist/cjs/index-8d94b7e0.js +0 -7
- package/dist/cjs/snk-expression-item.cjs.entry.js +0 -213
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +0 -214
- package/dist/esm/ConfigStorage-e6c17998.js +0 -121
- package/dist/esm/index-620ac460.js +0 -7
- package/dist/esm/snk-expression-item.entry.js +0 -209
- package/dist/sankhyablocks/p-0b6ddb67.entry.js +0 -1
- package/dist/sankhyablocks/p-0c2afa63.entry.js +0 -1
- package/dist/sankhyablocks/p-343699ad.entry.js +0 -1
- package/dist/sankhyablocks/p-471568c7.entry.js +0 -1
- package/dist/sankhyablocks/p-6c2c71ca.js +0 -1
- package/dist/sankhyablocks/p-8ce9ea9f.entry.js +0 -1
- package/dist/sankhyablocks/p-8efb0f47.entry.js +0 -1
- package/dist/sankhyablocks/p-9a448ff9.entry.js +0 -1
- package/dist/sankhyablocks/p-9e50681c.entry.js +0 -1
- package/dist/sankhyablocks/p-9f66bc54.entry.js +0 -1
- package/dist/sankhyablocks/p-b1c02726.js +0 -1
- package/dist/sankhyablocks/p-b34d23fa.js +0 -1
- package/dist/sankhyablocks/p-c20dd153.entry.js +0 -1
- package/dist/sankhyablocks/p-cbb5c440.entry.js +0 -1
- package/dist/sankhyablocks/p-f3241ada.entry.js +0 -1
- package/dist/sankhyablocks/p-f4184ce7.js +0 -1
- package/dist/sankhyablocks/p-ff96b509.entry.js +0 -27
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +0 -40
@@ -0,0 +1,304 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
const core = require('@sankhyalabs/core');
|
4
|
+
const formConfigFetcher = require('./form-config-fetcher-92bc8fe7.js');
|
5
|
+
const resourceFetcher = require('./resource-fetcher-2979b54b.js');
|
6
|
+
const filterBarConfigFetcher = require('./filter-bar-config-fetcher-75219599.js');
|
7
|
+
const DataFetcher = require('./DataFetcher-a9d0228f.js');
|
8
|
+
|
9
|
+
class GridConfigFetcher extends resourceFetcher.ResourceFetcher {
|
10
|
+
constructor() {
|
11
|
+
super(...arguments);
|
12
|
+
this.GRID_CONFIG_VERSION = "V3:";
|
13
|
+
}
|
14
|
+
getConfig(gridName, resourceID) {
|
15
|
+
const completePath = this.getPath(resourceID, gridName);
|
16
|
+
return new Promise((resolve, reject) => {
|
17
|
+
this.loadResource(completePath)
|
18
|
+
.then(loadedResource => {
|
19
|
+
let config = undefined;
|
20
|
+
if (loadedResource) {
|
21
|
+
config = JSON.parse(loadedResource);
|
22
|
+
}
|
23
|
+
resolve(config);
|
24
|
+
}).catch((error) => {
|
25
|
+
reject(error);
|
26
|
+
});
|
27
|
+
});
|
28
|
+
}
|
29
|
+
saveConfig(config, gridName, resourceID) {
|
30
|
+
const completePath = this.getPath(resourceID, gridName);
|
31
|
+
return new Promise((resolve, reject) => {
|
32
|
+
this.saveResource(config, completePath)
|
33
|
+
.then((resp) => {
|
34
|
+
resolve(JSON.parse(resp.resource));
|
35
|
+
})
|
36
|
+
.catch((error) => {
|
37
|
+
reject(error);
|
38
|
+
});
|
39
|
+
});
|
40
|
+
}
|
41
|
+
getPath(resourceID, name) {
|
42
|
+
if (name) {
|
43
|
+
return `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}/${name}`;
|
44
|
+
}
|
45
|
+
return `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
class PersonalizedFilterFetcher {
|
50
|
+
constructor() {
|
51
|
+
this.templateByQuery = new Map();
|
52
|
+
this.buildTemplates();
|
53
|
+
}
|
54
|
+
resolveURI(resourceID, configName) {
|
55
|
+
let uri = "filter-assistent-config://" + resourceID;
|
56
|
+
if (configName) {
|
57
|
+
uri += "." + configName;
|
58
|
+
}
|
59
|
+
return uri;
|
60
|
+
}
|
61
|
+
buildTemplates() {
|
62
|
+
this.templateByQuery.set("fetchFilterFields", DataFetcher.dist.gql `
|
63
|
+
query($name: String!) {
|
64
|
+
$queryAlias$: fetchFilterFields(name: $name){
|
65
|
+
currentLink {
|
66
|
+
description
|
67
|
+
uri
|
68
|
+
}
|
69
|
+
links {
|
70
|
+
description
|
71
|
+
uri
|
72
|
+
fieldCount
|
73
|
+
}
|
74
|
+
fields {
|
75
|
+
name
|
76
|
+
description
|
77
|
+
uri
|
78
|
+
onlyDate
|
79
|
+
dataType
|
80
|
+
userInterface
|
81
|
+
entityName
|
82
|
+
properties {
|
83
|
+
name
|
84
|
+
value
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
`);
|
90
|
+
this.templateByQuery.set("fetchFilterAssistent", DataFetcher.dist.gql `
|
91
|
+
query($name: String!) {
|
92
|
+
$queryAlias$: fetchFilterAssistent(name: $name) {
|
93
|
+
id
|
94
|
+
name
|
95
|
+
active
|
96
|
+
expression
|
97
|
+
warningMessage
|
98
|
+
parameters {
|
99
|
+
entityName
|
100
|
+
fieldName
|
101
|
+
dataType
|
102
|
+
description
|
103
|
+
userInterface
|
104
|
+
label
|
105
|
+
searchContext {
|
106
|
+
entity
|
107
|
+
entityDescription
|
108
|
+
searchOptions {
|
109
|
+
rootEntity
|
110
|
+
descriptionFieldName
|
111
|
+
codeFieldName
|
112
|
+
showInactives
|
113
|
+
}
|
114
|
+
}
|
115
|
+
}
|
116
|
+
assistent
|
117
|
+
}
|
118
|
+
}`);
|
119
|
+
this.templateByQuery.set("savePersonalizedFilter", DataFetcher.dist.gql `
|
120
|
+
mutation($name: String!, $filterAssistent: InputFilterAssistent!) {
|
121
|
+
$queryAlias$: savePersonalizedFilter(name: $name, filterAssistent: $filterAssistent) {
|
122
|
+
id
|
123
|
+
name
|
124
|
+
}
|
125
|
+
}`);
|
126
|
+
this.templateByQuery.set("deletePersonalizedFilter", DataFetcher.dist.gql `
|
127
|
+
mutation($name: String!, $filterId: String!) {
|
128
|
+
$queryAlias$: deletePersonalizedFilter(name: $name, filterId: $filterId) {
|
129
|
+
id
|
130
|
+
name
|
131
|
+
}
|
132
|
+
}`);
|
133
|
+
}
|
134
|
+
async loadPersonalizedFilter(resourceID, filterID, configName) {
|
135
|
+
return new Promise((resolve, reject) => {
|
136
|
+
DataFetcher.DataFetcher.get()
|
137
|
+
.callGraphQL({
|
138
|
+
values: { name: this.resolveURI(resourceID, configName) + "/" + filterID },
|
139
|
+
query: this.templateByQuery.get("fetchFilterAssistent"),
|
140
|
+
})
|
141
|
+
.then((resp) => {
|
142
|
+
resp.assistent = JSON.parse(resp.assistent);
|
143
|
+
resolve(resp);
|
144
|
+
})
|
145
|
+
.catch((error) => {
|
146
|
+
reject(error);
|
147
|
+
});
|
148
|
+
});
|
149
|
+
}
|
150
|
+
async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
151
|
+
let personalizedFilterParsed = JSON.parse(JSON.stringify(personalizedFilter));
|
152
|
+
personalizedFilterParsed.assistent = JSON.stringify(personalizedFilterParsed.assistent);
|
153
|
+
return new Promise((resolve, reject) => {
|
154
|
+
DataFetcher.DataFetcher.get()
|
155
|
+
.callGraphQL({
|
156
|
+
values: { name: this.resolveURI(resourceID, configName), filterAssistent: personalizedFilterParsed },
|
157
|
+
query: this.templateByQuery.get("savePersonalizedFilter"),
|
158
|
+
})
|
159
|
+
.then((resp) => {
|
160
|
+
resolve(resp);
|
161
|
+
})
|
162
|
+
.catch((error) => {
|
163
|
+
reject(error);
|
164
|
+
});
|
165
|
+
});
|
166
|
+
}
|
167
|
+
async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
168
|
+
return new Promise((resolve, reject) => {
|
169
|
+
DataFetcher.DataFetcher.get()
|
170
|
+
.callGraphQL({
|
171
|
+
values: { name: this.resolveURI(resourceID, configName), filterId: personalizedFilter.id },
|
172
|
+
query: this.templateByQuery.get("deletePersonalizedFilter"),
|
173
|
+
})
|
174
|
+
.then((resp) => {
|
175
|
+
resolve(resp);
|
176
|
+
})
|
177
|
+
.catch((error) => {
|
178
|
+
reject(error);
|
179
|
+
});
|
180
|
+
});
|
181
|
+
}
|
182
|
+
loadFields(uri) {
|
183
|
+
return new Promise((resolve, reject) => {
|
184
|
+
DataFetcher.DataFetcher.get()
|
185
|
+
.callGraphQL({
|
186
|
+
values: { name: uri },
|
187
|
+
query: this.templateByQuery.get("fetchFilterFields"),
|
188
|
+
})
|
189
|
+
.then((resp) => {
|
190
|
+
var _a;
|
191
|
+
let fields = resp.fields;
|
192
|
+
for (const field of fields) {
|
193
|
+
if (Array.isArray(field.properties) && field.properties.length > 0) {
|
194
|
+
const propertiesConvertedObject = field.properties.reduce((accumulator, prop) => {
|
195
|
+
accumulator[prop.name] = prop.value;
|
196
|
+
return accumulator;
|
197
|
+
}, {});
|
198
|
+
field.properties = propertiesConvertedObject;
|
199
|
+
}
|
200
|
+
if ((_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.options) {
|
201
|
+
field.properties.options = JSON.parse(field.properties.options);
|
202
|
+
}
|
203
|
+
}
|
204
|
+
resolve(Object.assign(Object.assign({}, resp), { fields: fields }));
|
205
|
+
})
|
206
|
+
.catch((error) => {
|
207
|
+
reject(error);
|
208
|
+
});
|
209
|
+
});
|
210
|
+
}
|
211
|
+
}
|
212
|
+
|
213
|
+
const CONFIG_SOURCE = {
|
214
|
+
form: "form",
|
215
|
+
grid: "grid",
|
216
|
+
filterBar: "filterBar"
|
217
|
+
};
|
218
|
+
class ConfigStorage {
|
219
|
+
static async get() {
|
220
|
+
if (!ConfigStorage.instance) {
|
221
|
+
const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
222
|
+
if (application != undefined) {
|
223
|
+
const configName = application.configName;
|
224
|
+
const resourceID = await application.getResourceID();
|
225
|
+
ConfigStorage.instance = new ConfigStorage();
|
226
|
+
ConfigStorage.resourceID = resourceID;
|
227
|
+
ConfigStorage.instance.loadFilterBarConfig(configName);
|
228
|
+
ConfigStorage.instance.loadFormConfig(configName);
|
229
|
+
ConfigStorage.instance.loadGridConfig(configName);
|
230
|
+
}
|
231
|
+
}
|
232
|
+
return this.instance;
|
233
|
+
}
|
234
|
+
async loadFilterBarConfig(name) {
|
235
|
+
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.filterBar);
|
236
|
+
if (!ConfigStorage.configById.has(cacheID)) {
|
237
|
+
ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(ConfigStorage.resourceID, name));
|
238
|
+
}
|
239
|
+
return ConfigStorage.configById.get(cacheID);
|
240
|
+
}
|
241
|
+
async loadFormConfig(name) {
|
242
|
+
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form);
|
243
|
+
if (!ConfigStorage.configById.has(cacheID)) {
|
244
|
+
ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, ConfigStorage.resourceID));
|
245
|
+
}
|
246
|
+
return ConfigStorage.configById.get(cacheID);
|
247
|
+
}
|
248
|
+
async loadGridConfig(name) {
|
249
|
+
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid);
|
250
|
+
if (!ConfigStorage.configById.has(cacheID)) {
|
251
|
+
ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, ConfigStorage.resourceID));
|
252
|
+
}
|
253
|
+
return ConfigStorage.configById.get(cacheID);
|
254
|
+
}
|
255
|
+
static async saveFilterBarConfig(config, name) {
|
256
|
+
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.filterBar);
|
257
|
+
this.configById.delete(cacheID);
|
258
|
+
return this.filterBarConfigFetcher.saveConfig(config, this.resourceID, name);
|
259
|
+
}
|
260
|
+
static async saveFormConfig(config, name) {
|
261
|
+
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.form);
|
262
|
+
this.configById.delete(cacheID);
|
263
|
+
return this.formConfigFetcher.saveConfig(config, name, this.resourceID);
|
264
|
+
}
|
265
|
+
static async saveCardState(config, name) {
|
266
|
+
return this.formConfigFetcher.saveCardState(config, name, this.resourceID);
|
267
|
+
}
|
268
|
+
static async saveGridConfig(config, name) {
|
269
|
+
if (config == undefined) {
|
270
|
+
return;
|
271
|
+
}
|
272
|
+
const cacheID = this.buildCacheID(name, CONFIG_SOURCE.grid);
|
273
|
+
this.configById.delete(cacheID);
|
274
|
+
return this.gridConfigFetcher.saveConfig(config, name, this.resourceID);
|
275
|
+
}
|
276
|
+
static async loadPersonalizedFilter(filterId, configName) {
|
277
|
+
return this.personalizedFilterFetcher.loadPersonalizedFilter(this.resourceID, filterId, configName);
|
278
|
+
}
|
279
|
+
static async savePersonalizedFilter(personalizedFilter, configName) {
|
280
|
+
//Ao criar ou alterar um filtro personalizado,
|
281
|
+
//precisamos remover o cache do status da filterbar.
|
282
|
+
const cacheID = this.buildCacheID(configName, CONFIG_SOURCE.filterBar);
|
283
|
+
this.configById.delete(cacheID);
|
284
|
+
return this.personalizedFilterFetcher.savePersonalizedFilter(personalizedFilter, this.resourceID, configName);
|
285
|
+
}
|
286
|
+
static async removePersonalizedFilter(personalizedFilter, configName) {
|
287
|
+
return this.personalizedFilterFetcher.removePersonalizedFilter(personalizedFilter, this.resourceID, configName);
|
288
|
+
}
|
289
|
+
static buildCacheID(name, source) {
|
290
|
+
if (name == undefined) {
|
291
|
+
return `req_${source}_${this.resourceID}`;
|
292
|
+
}
|
293
|
+
return `req_${source}_${name}_${this.resourceID}`;
|
294
|
+
}
|
295
|
+
}
|
296
|
+
ConfigStorage.configById = new Map();
|
297
|
+
ConfigStorage.filterBarConfigFetcher = new filterBarConfigFetcher.FilterBarConfigFetcher();
|
298
|
+
ConfigStorage.formConfigFetcher = new formConfigFetcher.FormConfigFetcher();
|
299
|
+
ConfigStorage.gridConfigFetcher = new GridConfigFetcher();
|
300
|
+
ConfigStorage.personalizedFilterFetcher = new PersonalizedFilterFetcher();
|
301
|
+
|
302
|
+
exports.ConfigStorage = ConfigStorage;
|
303
|
+
exports.GridConfigFetcher = GridConfigFetcher;
|
304
|
+
exports.PersonalizedFilterFetcher = PersonalizedFilterFetcher;
|
@@ -0,0 +1,229 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
const core = require('@sankhyalabs/core');
|
4
|
+
const index = require('./index-614af008.js');
|
5
|
+
const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
|
6
|
+
|
7
|
+
class PersonalizedFilterUtils {
|
8
|
+
/**
|
9
|
+
* Cria uma expressão de filtro a partir de um IExpressionItem.
|
10
|
+
* @param expressionItem - Objeto com os parâmetros necessários para montar a expressão.
|
11
|
+
* @returns Retorna a expressão de filtro.
|
12
|
+
*/
|
13
|
+
static buildFilterExpression(expressionItem, ignoreInvalidExpressions = false) {
|
14
|
+
if (expressionItem == undefined) {
|
15
|
+
return;
|
16
|
+
}
|
17
|
+
if (!this.validateExpressionItem(expressionItem) && ignoreInvalidExpressions) {
|
18
|
+
return "";
|
19
|
+
}
|
20
|
+
let value = this.buildVariableParameterValue(expressionItem);
|
21
|
+
let expression = expressionItem.expression || "";
|
22
|
+
let commas = "'";
|
23
|
+
if (expressionItem.paramVariable) {
|
24
|
+
commas = "";
|
25
|
+
}
|
26
|
+
switch (expressionItem.operand) {
|
27
|
+
case "IN":
|
28
|
+
expression += ` ${index.FilterOperand[expressionItem.operand]} (${value})`;
|
29
|
+
break;
|
30
|
+
case "NULL":
|
31
|
+
case "NOT_NULL":
|
32
|
+
expression += ` IS ${index.FilterOperand[expressionItem.operand]}`;
|
33
|
+
break;
|
34
|
+
case "LIKE":
|
35
|
+
expression += ` LIKE ${commas}%${value}%${commas}`;
|
36
|
+
break;
|
37
|
+
case "START_WITH":
|
38
|
+
expression += ` LIKE ${commas}${value}%${commas}`;
|
39
|
+
break;
|
40
|
+
case "FINISHED_WITH":
|
41
|
+
expression += ` LIKE ${commas}%${value}${commas}`;
|
42
|
+
break;
|
43
|
+
default:
|
44
|
+
value = isNaN(value) ? `${commas}${value}${commas}` : value;
|
45
|
+
expression += ` ${index.FilterOperand[expressionItem.operand]} ${value}`;
|
46
|
+
}
|
47
|
+
return expression;
|
48
|
+
}
|
49
|
+
/**
|
50
|
+
* Obtém o valor do parâmetro a partir de um IExpressionItem.
|
51
|
+
* @param expressionItem - Objeto com os parâmetros necessários para montar a expressão.
|
52
|
+
* @returns Retorna o valor do parâmetro.
|
53
|
+
*/
|
54
|
+
static buildVariableParameterValue(expressionItem) {
|
55
|
+
var _a;
|
56
|
+
if (expressionItem == undefined)
|
57
|
+
return;
|
58
|
+
if (expressionItem.paramVariable) {
|
59
|
+
return this.proccessVarialbeParameter(expressionItem);
|
60
|
+
}
|
61
|
+
if (expressionItem.operand !== index.FilterOperand.NULL && expressionItem.operand !== "NOT_NULL") {
|
62
|
+
let value = expressionItem.value;
|
63
|
+
const type = expressionItem.type;
|
64
|
+
/*
|
65
|
+
Precisamos validar o expressionItem.userInterface além do expressionItem.type
|
66
|
+
pois para filtros herdados do HTML5 não temos o tipo OBJECT, fazendo com que a expressão
|
67
|
+
fique inválida para campos do tipo pesquisa.
|
68
|
+
*/
|
69
|
+
if (core.UserInterface.SEARCH === expressionItem.userInterface || core.DataType.OBJECT == type) {
|
70
|
+
value = (_a = value === null || value === void 0 ? void 0 : value.value) !== null && _a !== void 0 ? _a : value;
|
71
|
+
}
|
72
|
+
if (core.DataType.NUMBER == type && value != undefined) {
|
73
|
+
value = core.NumberUtils.stringToNumber(value);
|
74
|
+
this.checkIsValidNumber(value);
|
75
|
+
}
|
76
|
+
else if (core.DataType.DATE == type) {
|
77
|
+
value = this.convertDataValue(value);
|
78
|
+
}
|
79
|
+
else if (core.DataType.BOOLEAN == type) {
|
80
|
+
value = value ? "S" : "N";
|
81
|
+
}
|
82
|
+
return value;
|
83
|
+
}
|
84
|
+
return expressionItem.operand;
|
85
|
+
}
|
86
|
+
static checkIsValidNumber(value) {
|
87
|
+
if (isNaN(value)) {
|
88
|
+
throw new Error('O valor informado não é um número válido.');
|
89
|
+
}
|
90
|
+
}
|
91
|
+
static proccessVarialbeParameter(expressionItem) {
|
92
|
+
if (expressionItem.systemConfig != undefined) {
|
93
|
+
const systemConfig = expressionItem.systemConfig;
|
94
|
+
return `?:{entidade=${systemConfig.entity || ""};campo=${systemConfig.fieldName || ""}}`;
|
95
|
+
}
|
96
|
+
if (expressionItem.userConfig != undefined) {
|
97
|
+
const userConfig = expressionItem.userConfig;
|
98
|
+
return `?:{desc=${userConfig.description || ""};tipo=${userConfig.type || ""}}`;
|
99
|
+
}
|
100
|
+
return `?:{entidade=${expressionItem.entityName || ""};campo=${expressionItem.fieldName || ""}}`;
|
101
|
+
}
|
102
|
+
static convertDataValue(value) {
|
103
|
+
if (typeof value == 'string') {
|
104
|
+
value = new Date(value);
|
105
|
+
}
|
106
|
+
return core.DateUtils.formatDate(value);
|
107
|
+
}
|
108
|
+
/*
|
109
|
+
* Cria uma expressão de filtro para um grupo de itens.
|
110
|
+
*/
|
111
|
+
static buildGroupExpression(expressionGroup, ignoreInvalidExpressions = false) {
|
112
|
+
var _a, _b;
|
113
|
+
if (!((_a = expressionGroup === null || expressionGroup === void 0 ? void 0 : expressionGroup.items) === null || _a === void 0 ? void 0 : _a.length))
|
114
|
+
return "";
|
115
|
+
const itemExpressions = expressionGroup.items.map((item) => this.buildFilterExpression(item, ignoreInvalidExpressions)).join(` ${expressionGroup.operand} `);
|
116
|
+
if (((_b = expressionGroup === null || expressionGroup === void 0 ? void 0 : expressionGroup.childrenGroups) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
117
|
+
const childGroupExpressions = expressionGroup.childrenGroups.map((children) => this.buildGroupExpression(children)).join(` ${expressionGroup.operand} `);
|
118
|
+
return `(${itemExpressions} ${expressionGroup.operand} (${childGroupExpressions}))`;
|
119
|
+
}
|
120
|
+
return `(${itemExpressions})`;
|
121
|
+
}
|
122
|
+
/*
|
123
|
+
* Valida se os campos das expressão estão válidas para serem criada ou editada.
|
124
|
+
*/
|
125
|
+
static validateFields(expressionGroup) {
|
126
|
+
const allItems = this.buildPlainExpressionItems(expressionGroup);
|
127
|
+
for (const item of allItems) {
|
128
|
+
const isValidItem = this.validateExpressionItem(item);
|
129
|
+
if (!isValidItem) {
|
130
|
+
return false;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
return true;
|
134
|
+
}
|
135
|
+
static buildPlainExpressionItems(expressionGroup) {
|
136
|
+
const { items = [], childrenGroups = [] } = expressionGroup || {};
|
137
|
+
const getItemsFromChildren = (childrenGroup) => {
|
138
|
+
return childrenGroup.reduce((listAcc, children) => {
|
139
|
+
var _a;
|
140
|
+
if (children.items)
|
141
|
+
listAcc = listAcc.concat(children.items);
|
142
|
+
if ((_a = children.childrenGroups) === null || _a === void 0 ? void 0 : _a.length) {
|
143
|
+
listAcc = listAcc.concat(getItemsFromChildren(children.childrenGroups));
|
144
|
+
}
|
145
|
+
return listAcc;
|
146
|
+
}, []);
|
147
|
+
};
|
148
|
+
return items.concat(getItemsFromChildren(childrenGroups));
|
149
|
+
}
|
150
|
+
static validateExpressionItem(expressionItem) {
|
151
|
+
const requiredFields = {
|
152
|
+
fieldName: (value) => !!value,
|
153
|
+
value: (value, byPassValue) => {
|
154
|
+
if (byPassValue)
|
155
|
+
return true;
|
156
|
+
return !!value;
|
157
|
+
},
|
158
|
+
operand: (value) => !!value
|
159
|
+
};
|
160
|
+
const isAllValidFields = Object.entries(requiredFields).every(entries => {
|
161
|
+
const [fieldName, validate] = entries;
|
162
|
+
const byPassValue = expressionItem.paramVariable || expressionItem.userInterface === 'SWITCH' || ["NULL", "NOT_NULL"].includes(expressionItem.operand);
|
163
|
+
return validate(expressionItem[fieldName], byPassValue);
|
164
|
+
});
|
165
|
+
return isAllValidFields;
|
166
|
+
}
|
167
|
+
static getNormalizedValue(params, value) {
|
168
|
+
return params.reduce((arrayValues, currentParam, index) => {
|
169
|
+
if (currentParam.dataType === core.DataType.BOOLEAN && (arrayValues == undefined || arrayValues[index] == undefined)) {
|
170
|
+
arrayValues = !!arrayValues && !Array.isArray(arrayValues) ? [arrayValues] : arrayValues || [];
|
171
|
+
arrayValues[index] = false;
|
172
|
+
}
|
173
|
+
return arrayValues;
|
174
|
+
}, value);
|
175
|
+
}
|
176
|
+
/*
|
177
|
+
* Valida se os filtros personalizados com campo variável são válido.
|
178
|
+
*/
|
179
|
+
static validateVariableValues(config, editorValue) {
|
180
|
+
if (!config)
|
181
|
+
return true;
|
182
|
+
let valuesArray = editorValue || config.value;
|
183
|
+
let isValid = true;
|
184
|
+
if (config.type === filterItemType_enum.FilterItemType.PERSONALIZED) {
|
185
|
+
const activeFilters = (config.groupedItems || []).filter(item => item.visible);
|
186
|
+
const allFilterWithVariableParams = activeFilters.filter(activeFilter => { var _a, _b, _c; return !!((_c = (_b = (_a = activeFilter.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters) === null || _c === void 0 ? void 0 : _c.length); });
|
187
|
+
const allParamsWithValues = allFilterWithVariableParams.flatMap(filter => { var _a; return (_a = filter.props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters; });
|
188
|
+
const valuesFromParams = allFilterWithVariableParams.flatMap(filter => {
|
189
|
+
const isBoolean = filter.props.personalizedFilter.parameters[0].dataType === core.DataType.BOOLEAN;
|
190
|
+
return isBoolean ? false : filter.value;
|
191
|
+
});
|
192
|
+
valuesArray = this.getNormalizedValue(allParamsWithValues, valuesArray);
|
193
|
+
isValid = allParamsWithValues.length === valuesFromParams.length && valuesFromParams.every(value => value != null);
|
194
|
+
}
|
195
|
+
return isValid;
|
196
|
+
}
|
197
|
+
/*
|
198
|
+
* Constroi uma lista parâmetros para todos os itens de grupos e subgrupos que são
|
199
|
+
* do tipo variavel;
|
200
|
+
*/
|
201
|
+
static buildVariableParameters(expressionGroup) {
|
202
|
+
var _a, _b, _c, _d;
|
203
|
+
const allItems = this.buildPlainExpressionItems(expressionGroup);
|
204
|
+
const allParams = [];
|
205
|
+
for (const item of allItems) {
|
206
|
+
if (!item.paramVariable) {
|
207
|
+
continue;
|
208
|
+
}
|
209
|
+
allParams.push({
|
210
|
+
entityName: item.entityName,
|
211
|
+
fieldName: item.fieldName,
|
212
|
+
dataType: item.type,
|
213
|
+
description: item.description,
|
214
|
+
userInterface: item.userInterface,
|
215
|
+
label: item.fieldLabel,
|
216
|
+
searchContext: {
|
217
|
+
entity: (_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.find(prop => prop.name == "ENTITYNAME")) === null || _b === void 0 ? void 0 : _b.value,
|
218
|
+
entityDescription: (_d = (_c = item.props) === null || _c === void 0 ? void 0 : _c.find(prop => prop.name == "DESCRIPTIONENTITY")) === null || _d === void 0 ? void 0 : _d.value,
|
219
|
+
searchOptions: {
|
220
|
+
showInactives: false
|
221
|
+
}
|
222
|
+
}
|
223
|
+
});
|
224
|
+
}
|
225
|
+
return allParams;
|
226
|
+
}
|
227
|
+
}
|
228
|
+
|
229
|
+
exports.PersonalizedFilterUtils = PersonalizedFilterUtils;
|
@@ -77,6 +77,8 @@ const snkFilterBarMessages = {
|
|
77
77
|
"modalPersonalizedFilterTitle": "Filtro personalizado",
|
78
78
|
"modalPersonalizedFilterSubTitle": "Gerencie seus filtros",
|
79
79
|
"modalInfoTextCreateEditPersonalized": "Use o layout antigo para criar ou editar filtros, em breve traremos uma nova experiência",
|
80
|
+
"modalInfoTextCreateFilter": "Criar filtro personalizado",
|
81
|
+
"modalInfoTextNoFilterRegister": "Você não possui filtros cadastrados.",
|
80
82
|
"modalOkButtonLabel": "Aplicar",
|
81
83
|
"modalCancelButtonLabel": "Limpar",
|
82
84
|
"binarySelectTooltip": "Exibindo registros",
|
@@ -87,13 +89,24 @@ const snkFilterBarMessages = {
|
|
87
89
|
"labelStartDatePeriod": "Inicial",
|
88
90
|
"labelEndDatePeriod": "Final",
|
89
91
|
"filters": "Filtros",
|
92
|
+
"personalizedCount": "{{activeCount}} selecionado(s)",
|
90
93
|
"filterModal": {
|
91
94
|
"title": "Filtros",
|
92
95
|
"okButtonLabel": "Aplicar",
|
93
96
|
"cancelButtonLabel": "Limpar tudo",
|
94
97
|
"customFilters": "Filtros personalizados",
|
95
|
-
"quickFilters": "Filtros rápidos"
|
96
|
-
|
98
|
+
"quickFilters": "Filtros rápidos",
|
99
|
+
"validations": {
|
100
|
+
"notFullFilled": {
|
101
|
+
"title": "Filtro parcialmente preenchido",
|
102
|
+
"message": "Favor completar todas as informações do filtro."
|
103
|
+
},
|
104
|
+
"notSaved": {
|
105
|
+
"title": "Atenção",
|
106
|
+
"message": "As alterações realizadas não serão aplicadas.<br/><br/><b>Deseja mesmo continuar?</b>"
|
107
|
+
}
|
108
|
+
}
|
109
|
+
},
|
97
110
|
};
|
98
111
|
|
99
112
|
const snkTaskbarMessages = {
|
@@ -314,6 +327,8 @@ const snkFilterFieldSearchMessages = {
|
|
314
327
|
searchLabel: "Buscar campo",
|
315
328
|
fieldLabel: "Campos de {{link}}",
|
316
329
|
linkLabel: "Categorias de {{link}}",
|
330
|
+
groupEmpty: "Não há categorias para seleção",
|
331
|
+
searchEmpty: "Nenhum resultado encontrado"
|
317
332
|
};
|
318
333
|
|
319
334
|
const snkSimpleBarMessages = {
|
@@ -349,14 +364,60 @@ const snkAttachMessages = {
|
|
349
364
|
|
350
365
|
const snkPersonalizedFilterMessages = {
|
351
366
|
info: {
|
367
|
+
titleEdit: "Editar filtro personalizado",
|
368
|
+
titleAdd: "Criar filtro personalizado",
|
369
|
+
titleCollapsible: "Expressão a ser aplicada (gerada pelo assistente)",
|
352
370
|
labelSearchField: "Buscar campo",
|
353
371
|
labelOperator: "Operador",
|
354
372
|
labelValueVarible: "Valor variável",
|
355
|
-
titleTooltip: "Ao ativar um valor variável, é possível inserir um valor diferente sempre que o filtro for aplicado"
|
373
|
+
titleTooltip: "Ao ativar um valor variável, é possível inserir um valor diferente sempre que o filtro for aplicado",
|
374
|
+
labelAddNewExpression: "Adicionar nova linha de expressão",
|
375
|
+
labelDeleteExpression: "Remover expressão",
|
376
|
+
labelDeleteItem: "Remover item",
|
377
|
+
labelDisabledAddGroupButton: "Filtros Personalizados possuem um limite de {{LIMIT_GROUP_LEVEL}} Grupos de Condições e Valores",
|
378
|
+
labelDisabledAddExpressionButton: "Preencha campos obrigatórios ou indique valores variáveis nas expressões do grupo antes de adicionar mais itens",
|
379
|
+
labelCancel: "Cancelar",
|
380
|
+
labelSave: "Salvar",
|
381
|
+
labelNameFilter: "Nome do filtro",
|
382
|
+
labelExpression: "Expressão SQL",
|
383
|
+
badgeVariable: "variável",
|
384
|
+
noDataFound: "Nenhum filtro encontrado"
|
356
385
|
},
|
357
|
-
|
386
|
+
confirmExpression: {
|
358
387
|
title: "Aviso",
|
359
388
|
description: `As informações da condição serão descartadas.</br></br><b>Gostaria de continuar?</b>`
|
389
|
+
},
|
390
|
+
confirmGroup: {
|
391
|
+
title: "Aviso",
|
392
|
+
description: `As informações do Grupo e suas Condições serão descartadas.</br></br><b>Gostaria de continuar?</b>`
|
393
|
+
},
|
394
|
+
confirmCancel: {
|
395
|
+
title: "Aviso",
|
396
|
+
description: `As alterações realizadas serão descartadas.</br></br><b>Gostaria de continuar?</b>`
|
397
|
+
},
|
398
|
+
operador: {
|
399
|
+
firstLevel: "A seleção será habilitada a partir da adição da segunda linha de regras.",
|
400
|
+
and: "Será verdadeiro se todas as condições forem obedecidas.",
|
401
|
+
or: "Será verdadeiro se qualquer uma das condições for obedecida."
|
402
|
+
},
|
403
|
+
error: {
|
404
|
+
title: "Atenção",
|
405
|
+
description: "Há pelo menos um campo obrigatório não preenchido."
|
406
|
+
},
|
407
|
+
confirmSave: {
|
408
|
+
title: "O filtro <b>{{name}}</b> foi salvo com sucesso"
|
409
|
+
},
|
410
|
+
deleteConfirm: {
|
411
|
+
title: "Aviso",
|
412
|
+
message: "Deseja realmente excluir o filtro '{{filterName}}'?"
|
413
|
+
},
|
414
|
+
listActions: {
|
415
|
+
edit: "Editar",
|
416
|
+
delete: "Excluir"
|
417
|
+
},
|
418
|
+
footerActions: {
|
419
|
+
clear: "Limpar",
|
420
|
+
create: "Criar filtro"
|
360
421
|
}
|
361
422
|
};
|
362
423
|
|