@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
@@ -10,8 +10,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
10
10
|
}
|
11
11
|
return t;
|
12
12
|
};
|
13
|
-
import FilterItemType from
|
14
|
-
import { ResourceFetcher } from
|
13
|
+
import FilterItemType from '../../../../components/snk-filter-bar/filter-item/filter-item-type.enum';
|
14
|
+
import { ResourceFetcher } from './resource-fetcher';
|
15
15
|
function normalizeValue(value, type) {
|
16
16
|
if (value == undefined) {
|
17
17
|
return value;
|
@@ -45,9 +45,9 @@ function normalizeValue(value, type) {
|
|
45
45
|
return value;
|
46
46
|
}
|
47
47
|
export default class FilterBarConfigFetcher extends ResourceFetcher {
|
48
|
-
|
49
|
-
|
50
|
-
const { id, value, fixed, visible, type } = item;
|
48
|
+
normalize(items) {
|
49
|
+
return items.map(item => {
|
50
|
+
const { id, value, fixed, visible, type, groupedItems } = item;
|
51
51
|
const stateItem = { id };
|
52
52
|
if (value) {
|
53
53
|
stateItem["value"] = normalizeValue(value, type);
|
@@ -55,12 +55,25 @@ export default class FilterBarConfigFetcher extends ResourceFetcher {
|
|
55
55
|
if (fixed) {
|
56
56
|
stateItem["fixed"] = fixed;
|
57
57
|
}
|
58
|
-
if (
|
59
|
-
|
58
|
+
if (groupedItems) {
|
59
|
+
if (groupedItems.length === 0) {
|
60
|
+
return;
|
61
|
+
}
|
62
|
+
if (groupedItems.filter(item => item.visible).length > 0) {
|
63
|
+
stateItem["visible"] = true;
|
64
|
+
}
|
65
|
+
stateItem["groupedItems"] = this.normalize(groupedItems);
|
66
|
+
}
|
67
|
+
else {
|
68
|
+
if (visible) {
|
69
|
+
stateItem["visible"] = true;
|
70
|
+
}
|
60
71
|
}
|
61
72
|
return stateItem;
|
62
|
-
});
|
63
|
-
|
73
|
+
}).filter(item => item != undefined);
|
74
|
+
}
|
75
|
+
saveConfig(items, resourceID, configName) {
|
76
|
+
return this.saveResource(this.normalize(items), this.getPath(resourceID, configName));
|
64
77
|
}
|
65
78
|
getConfig(resourceID, configName) {
|
66
79
|
return new Promise((accept, reject) => {
|
@@ -69,7 +82,7 @@ export default class FilterBarConfigFetcher extends ResourceFetcher {
|
|
69
82
|
let fieldsList;
|
70
83
|
if (configAsString) {
|
71
84
|
const filterBarConfig = JSON.parse(configAsString);
|
72
|
-
fieldsList = filterBarConfig.items;
|
85
|
+
fieldsList = this.buildFieldList(filterBarConfig.items);
|
73
86
|
}
|
74
87
|
accept(fieldsList || []);
|
75
88
|
})
|
@@ -81,8 +94,8 @@ export default class FilterBarConfigFetcher extends ResourceFetcher {
|
|
81
94
|
saveEntityListConfig(item, resourceID, configName) {
|
82
95
|
return new Promise((accept, reject) => {
|
83
96
|
this.getConfig(resourceID, configName).then(config => {
|
84
|
-
const state = config.map(({ id, value, fixed, visible, type }) => {
|
85
|
-
return Object.assign(Object.assign(Object.assign({ id }, (value && { value: normalizeValue(value, type) })), (fixed && { fixed })), (visible && { visible: true }));
|
97
|
+
const state = config.map(({ id, value, fixed, visible, type, groupedItems }) => {
|
98
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({ id }, (value && { value: normalizeValue(value, type) })), (fixed && { fixed })), (visible && { visible: true })), { groupedItems });
|
86
99
|
});
|
87
100
|
const index = state.findIndex(({ id }) => id === item.id);
|
88
101
|
const newItem = { id: item.id, value: normalizeValue(item.value, item.type), fixed: item.fixed, visible: true };
|
@@ -102,9 +115,19 @@ export default class FilterBarConfigFetcher extends ResourceFetcher {
|
|
102
115
|
});
|
103
116
|
});
|
104
117
|
}
|
118
|
+
buildFieldList(items) {
|
119
|
+
return items.map(item => {
|
120
|
+
var _a, _b;
|
121
|
+
if (item.type === FilterItemType.MULTI_LIST) {
|
122
|
+
const multiListValue = item.value;
|
123
|
+
item.value = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
|
124
|
+
}
|
125
|
+
return item;
|
126
|
+
});
|
127
|
+
}
|
105
128
|
getPath(resourceID, name) {
|
106
129
|
if (name) {
|
107
|
-
return `cfg://filter/FilterBarState:${resourceID}
|
130
|
+
return `cfg://filter/FilterBarState:${resourceID}.${name}`;
|
108
131
|
}
|
109
132
|
return `cfg://filter/FilterBarState:${resourceID}`;
|
110
133
|
}
|
@@ -5,8 +5,15 @@ export default class PersonalizedFilterFetcher {
|
|
5
5
|
this.templateByQuery = new Map();
|
6
6
|
this.buildTemplates();
|
7
7
|
}
|
8
|
+
resolveURI(resourceID, configName) {
|
9
|
+
let uri = "filter-assistent-config://" + resourceID;
|
10
|
+
if (configName) {
|
11
|
+
uri += "." + configName;
|
12
|
+
}
|
13
|
+
return uri;
|
14
|
+
}
|
8
15
|
buildTemplates() {
|
9
|
-
|
16
|
+
this.templateByQuery.set("fetchFilterFields", gql `
|
10
17
|
query($name: String!) {
|
11
18
|
$queryAlias$: fetchFilterFields(name: $name){
|
12
19
|
currentLink {
|
@@ -25,6 +32,7 @@ export default class PersonalizedFilterFetcher {
|
|
25
32
|
onlyDate
|
26
33
|
dataType
|
27
34
|
userInterface
|
35
|
+
entityName
|
28
36
|
properties {
|
29
37
|
name
|
30
38
|
value
|
@@ -32,8 +40,98 @@ export default class PersonalizedFilterFetcher {
|
|
32
40
|
}
|
33
41
|
}
|
34
42
|
}
|
35
|
-
|
36
|
-
this.templateByQuery.set("
|
43
|
+
`);
|
44
|
+
this.templateByQuery.set("fetchFilterAssistent", gql `
|
45
|
+
query($name: String!) {
|
46
|
+
$queryAlias$: fetchFilterAssistent(name: $name) {
|
47
|
+
id
|
48
|
+
name
|
49
|
+
active
|
50
|
+
expression
|
51
|
+
warningMessage
|
52
|
+
parameters {
|
53
|
+
entityName
|
54
|
+
fieldName
|
55
|
+
dataType
|
56
|
+
description
|
57
|
+
userInterface
|
58
|
+
label
|
59
|
+
searchContext {
|
60
|
+
entity
|
61
|
+
entityDescription
|
62
|
+
searchOptions {
|
63
|
+
rootEntity
|
64
|
+
descriptionFieldName
|
65
|
+
codeFieldName
|
66
|
+
showInactives
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
70
|
+
assistent
|
71
|
+
}
|
72
|
+
}`);
|
73
|
+
this.templateByQuery.set("savePersonalizedFilter", gql `
|
74
|
+
mutation($name: String!, $filterAssistent: InputFilterAssistent!) {
|
75
|
+
$queryAlias$: savePersonalizedFilter(name: $name, filterAssistent: $filterAssistent) {
|
76
|
+
id
|
77
|
+
name
|
78
|
+
}
|
79
|
+
}`);
|
80
|
+
this.templateByQuery.set("deletePersonalizedFilter", gql `
|
81
|
+
mutation($name: String!, $filterId: String!) {
|
82
|
+
$queryAlias$: deletePersonalizedFilter(name: $name, filterId: $filterId) {
|
83
|
+
id
|
84
|
+
name
|
85
|
+
}
|
86
|
+
}`);
|
87
|
+
}
|
88
|
+
async loadPersonalizedFilter(resourceID, filterID, configName) {
|
89
|
+
return new Promise((resolve, reject) => {
|
90
|
+
DataFetcher.get()
|
91
|
+
.callGraphQL({
|
92
|
+
values: { name: this.resolveURI(resourceID, configName) + "/" + filterID },
|
93
|
+
query: this.templateByQuery.get("fetchFilterAssistent"),
|
94
|
+
})
|
95
|
+
.then((resp) => {
|
96
|
+
resp.assistent = JSON.parse(resp.assistent);
|
97
|
+
resolve(resp);
|
98
|
+
})
|
99
|
+
.catch((error) => {
|
100
|
+
reject(error);
|
101
|
+
});
|
102
|
+
});
|
103
|
+
}
|
104
|
+
async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
105
|
+
let personalizedFilterParsed = JSON.parse(JSON.stringify(personalizedFilter));
|
106
|
+
personalizedFilterParsed.assistent = JSON.stringify(personalizedFilterParsed.assistent);
|
107
|
+
return new Promise((resolve, reject) => {
|
108
|
+
DataFetcher.get()
|
109
|
+
.callGraphQL({
|
110
|
+
values: { name: this.resolveURI(resourceID, configName), filterAssistent: personalizedFilterParsed },
|
111
|
+
query: this.templateByQuery.get("savePersonalizedFilter"),
|
112
|
+
})
|
113
|
+
.then((resp) => {
|
114
|
+
resolve(resp);
|
115
|
+
})
|
116
|
+
.catch((error) => {
|
117
|
+
reject(error);
|
118
|
+
});
|
119
|
+
});
|
120
|
+
}
|
121
|
+
async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
122
|
+
return new Promise((resolve, reject) => {
|
123
|
+
DataFetcher.get()
|
124
|
+
.callGraphQL({
|
125
|
+
values: { name: this.resolveURI(resourceID, configName), filterId: personalizedFilter.id },
|
126
|
+
query: this.templateByQuery.get("deletePersonalizedFilter"),
|
127
|
+
})
|
128
|
+
.then((resp) => {
|
129
|
+
resolve(resp);
|
130
|
+
})
|
131
|
+
.catch((error) => {
|
132
|
+
reject(error);
|
133
|
+
});
|
134
|
+
});
|
37
135
|
}
|
38
136
|
loadFields(uri) {
|
39
137
|
return new Promise((resolve, reject) => {
|
@@ -43,15 +141,19 @@ export default class PersonalizedFilterFetcher {
|
|
43
141
|
query: this.templateByQuery.get("fetchFilterFields"),
|
44
142
|
})
|
45
143
|
.then((resp) => {
|
144
|
+
var _a;
|
46
145
|
let fields = resp.fields;
|
47
146
|
for (const field of fields) {
|
48
|
-
if (Array.isArray(field.properties) && field.properties.length > 0
|
147
|
+
if (Array.isArray(field.properties) && field.properties.length > 0) {
|
49
148
|
const propertiesConvertedObject = field.properties.reduce((accumulator, prop) => {
|
50
149
|
accumulator[prop.name] = prop.value;
|
51
150
|
return accumulator;
|
52
151
|
}, {});
|
53
152
|
field.properties = propertiesConvertedObject;
|
54
153
|
}
|
154
|
+
if ((_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.options) {
|
155
|
+
field.properties.options = JSON.parse(field.properties.options);
|
156
|
+
}
|
55
157
|
}
|
56
158
|
resolve(Object.assign(Object.assign({}, resp), { fields: fields }));
|
57
159
|
})
|
@@ -24,6 +24,8 @@ const snkFilterBarMessages = {
|
|
24
24
|
"modalPersonalizedFilterTitle": "Filtro personalizado",
|
25
25
|
"modalPersonalizedFilterSubTitle": "Gerencie seus filtros",
|
26
26
|
"modalInfoTextCreateEditPersonalized": "Use o layout antigo para criar ou editar filtros, em breve traremos uma nova experiência",
|
27
|
+
"modalInfoTextCreateFilter": "Criar filtro personalizado",
|
28
|
+
"modalInfoTextNoFilterRegister": "Você não possui filtros cadastrados.",
|
27
29
|
"modalOkButtonLabel": "Aplicar",
|
28
30
|
"modalCancelButtonLabel": "Limpar",
|
29
31
|
"binarySelectTooltip": "Exibindo registros",
|
@@ -34,12 +36,23 @@ const snkFilterBarMessages = {
|
|
34
36
|
"labelStartDatePeriod": "Inicial",
|
35
37
|
"labelEndDatePeriod": "Final",
|
36
38
|
"filters": "Filtros",
|
39
|
+
"personalizedCount": "{{activeCount}} selecionado(s)",
|
37
40
|
"filterModal": {
|
38
41
|
"title": "Filtros",
|
39
42
|
"okButtonLabel": "Aplicar",
|
40
43
|
"cancelButtonLabel": "Limpar tudo",
|
41
44
|
"customFilters": "Filtros personalizados",
|
42
|
-
"quickFilters": "Filtros rápidos"
|
43
|
-
|
45
|
+
"quickFilters": "Filtros rápidos",
|
46
|
+
"validations": {
|
47
|
+
"notFullFilled": {
|
48
|
+
"title": "Filtro parcialmente preenchido",
|
49
|
+
"message": "Favor completar todas as informações do filtro."
|
50
|
+
},
|
51
|
+
"notSaved": {
|
52
|
+
"title": "Atenção",
|
53
|
+
"message": "As alterações realizadas não serão aplicadas.<br/><br/><b>Deseja mesmo continuar?</b>"
|
54
|
+
}
|
55
|
+
}
|
56
|
+
},
|
44
57
|
};
|
45
58
|
export default snkFilterBarMessages;
|
@@ -1,12 +1,58 @@
|
|
1
1
|
export const snkPersonalizedFilterMessages = {
|
2
2
|
info: {
|
3
|
+
titleEdit: "Editar filtro personalizado",
|
4
|
+
titleAdd: "Criar filtro personalizado",
|
5
|
+
titleCollapsible: "Expressão a ser aplicada (gerada pelo assistente)",
|
3
6
|
labelSearchField: "Buscar campo",
|
4
7
|
labelOperator: "Operador",
|
5
8
|
labelValueVarible: "Valor variável",
|
6
|
-
titleTooltip: "Ao ativar um valor variável, é possível inserir um valor diferente sempre que o filtro for aplicado"
|
9
|
+
titleTooltip: "Ao ativar um valor variável, é possível inserir um valor diferente sempre que o filtro for aplicado",
|
10
|
+
labelAddNewExpression: "Adicionar nova linha de expressão",
|
11
|
+
labelDeleteExpression: "Remover expressão",
|
12
|
+
labelDeleteItem: "Remover item",
|
13
|
+
labelDisabledAddGroupButton: "Filtros Personalizados possuem um limite de {{LIMIT_GROUP_LEVEL}} Grupos de Condições e Valores",
|
14
|
+
labelDisabledAddExpressionButton: "Preencha campos obrigatórios ou indique valores variáveis nas expressões do grupo antes de adicionar mais itens",
|
15
|
+
labelCancel: "Cancelar",
|
16
|
+
labelSave: "Salvar",
|
17
|
+
labelNameFilter: "Nome do filtro",
|
18
|
+
labelExpression: "Expressão SQL",
|
19
|
+
badgeVariable: "variável",
|
20
|
+
noDataFound: "Nenhum filtro encontrado"
|
7
21
|
},
|
8
|
-
|
22
|
+
confirmExpression: {
|
9
23
|
title: "Aviso",
|
10
24
|
description: `As informações da condição serão descartadas.</br></br><b>Gostaria de continuar?</b>`
|
25
|
+
},
|
26
|
+
confirmGroup: {
|
27
|
+
title: "Aviso",
|
28
|
+
description: `As informações do Grupo e suas Condições serão descartadas.</br></br><b>Gostaria de continuar?</b>`
|
29
|
+
},
|
30
|
+
confirmCancel: {
|
31
|
+
title: "Aviso",
|
32
|
+
description: `As alterações realizadas serão descartadas.</br></br><b>Gostaria de continuar?</b>`
|
33
|
+
},
|
34
|
+
operador: {
|
35
|
+
firstLevel: "A seleção será habilitada a partir da adição da segunda linha de regras.",
|
36
|
+
and: "Será verdadeiro se todas as condições forem obedecidas.",
|
37
|
+
or: "Será verdadeiro se qualquer uma das condições for obedecida."
|
38
|
+
},
|
39
|
+
error: {
|
40
|
+
title: "Atenção",
|
41
|
+
description: "Há pelo menos um campo obrigatório não preenchido."
|
42
|
+
},
|
43
|
+
confirmSave: {
|
44
|
+
title: "O filtro <b>{{name}}</b> foi salvo com sucesso"
|
45
|
+
},
|
46
|
+
deleteConfirm: {
|
47
|
+
title: "Aviso",
|
48
|
+
message: "Deseja realmente excluir o filtro '{{filterName}}'?"
|
49
|
+
},
|
50
|
+
listActions: {
|
51
|
+
edit: "Editar",
|
52
|
+
delete: "Excluir"
|
53
|
+
},
|
54
|
+
footerActions: {
|
55
|
+
clear: "Limpar",
|
56
|
+
create: "Criar filtro"
|
11
57
|
}
|
12
58
|
};
|
@@ -2,6 +2,7 @@ import { ApplicationContext } from '@sankhyalabs/core';
|
|
2
2
|
import { F as FormConfigFetcher } from './form-config-fetcher.js';
|
3
3
|
import { R as ResourceFetcher } from './resource-fetcher.js';
|
4
4
|
import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher.js';
|
5
|
+
import { d as dist, D as DataFetcher } from './DataFetcher.js';
|
5
6
|
|
6
7
|
class GridConfigFetcher extends ResourceFetcher {
|
7
8
|
constructor() {
|
@@ -43,6 +44,170 @@ class GridConfigFetcher extends ResourceFetcher {
|
|
43
44
|
}
|
44
45
|
}
|
45
46
|
|
47
|
+
class PersonalizedFilterFetcher {
|
48
|
+
constructor() {
|
49
|
+
this.templateByQuery = new Map();
|
50
|
+
this.buildTemplates();
|
51
|
+
}
|
52
|
+
resolveURI(resourceID, configName) {
|
53
|
+
let uri = "filter-assistent-config://" + resourceID;
|
54
|
+
if (configName) {
|
55
|
+
uri += "." + configName;
|
56
|
+
}
|
57
|
+
return uri;
|
58
|
+
}
|
59
|
+
buildTemplates() {
|
60
|
+
this.templateByQuery.set("fetchFilterFields", dist.gql `
|
61
|
+
query($name: String!) {
|
62
|
+
$queryAlias$: fetchFilterFields(name: $name){
|
63
|
+
currentLink {
|
64
|
+
description
|
65
|
+
uri
|
66
|
+
}
|
67
|
+
links {
|
68
|
+
description
|
69
|
+
uri
|
70
|
+
fieldCount
|
71
|
+
}
|
72
|
+
fields {
|
73
|
+
name
|
74
|
+
description
|
75
|
+
uri
|
76
|
+
onlyDate
|
77
|
+
dataType
|
78
|
+
userInterface
|
79
|
+
entityName
|
80
|
+
properties {
|
81
|
+
name
|
82
|
+
value
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
`);
|
88
|
+
this.templateByQuery.set("fetchFilterAssistent", dist.gql `
|
89
|
+
query($name: String!) {
|
90
|
+
$queryAlias$: fetchFilterAssistent(name: $name) {
|
91
|
+
id
|
92
|
+
name
|
93
|
+
active
|
94
|
+
expression
|
95
|
+
warningMessage
|
96
|
+
parameters {
|
97
|
+
entityName
|
98
|
+
fieldName
|
99
|
+
dataType
|
100
|
+
description
|
101
|
+
userInterface
|
102
|
+
label
|
103
|
+
searchContext {
|
104
|
+
entity
|
105
|
+
entityDescription
|
106
|
+
searchOptions {
|
107
|
+
rootEntity
|
108
|
+
descriptionFieldName
|
109
|
+
codeFieldName
|
110
|
+
showInactives
|
111
|
+
}
|
112
|
+
}
|
113
|
+
}
|
114
|
+
assistent
|
115
|
+
}
|
116
|
+
}`);
|
117
|
+
this.templateByQuery.set("savePersonalizedFilter", dist.gql `
|
118
|
+
mutation($name: String!, $filterAssistent: InputFilterAssistent!) {
|
119
|
+
$queryAlias$: savePersonalizedFilter(name: $name, filterAssistent: $filterAssistent) {
|
120
|
+
id
|
121
|
+
name
|
122
|
+
}
|
123
|
+
}`);
|
124
|
+
this.templateByQuery.set("deletePersonalizedFilter", dist.gql `
|
125
|
+
mutation($name: String!, $filterId: String!) {
|
126
|
+
$queryAlias$: deletePersonalizedFilter(name: $name, filterId: $filterId) {
|
127
|
+
id
|
128
|
+
name
|
129
|
+
}
|
130
|
+
}`);
|
131
|
+
}
|
132
|
+
async loadPersonalizedFilter(resourceID, filterID, configName) {
|
133
|
+
return new Promise((resolve, reject) => {
|
134
|
+
DataFetcher.get()
|
135
|
+
.callGraphQL({
|
136
|
+
values: { name: this.resolveURI(resourceID, configName) + "/" + filterID },
|
137
|
+
query: this.templateByQuery.get("fetchFilterAssistent"),
|
138
|
+
})
|
139
|
+
.then((resp) => {
|
140
|
+
resp.assistent = JSON.parse(resp.assistent);
|
141
|
+
resolve(resp);
|
142
|
+
})
|
143
|
+
.catch((error) => {
|
144
|
+
reject(error);
|
145
|
+
});
|
146
|
+
});
|
147
|
+
}
|
148
|
+
async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
149
|
+
let personalizedFilterParsed = JSON.parse(JSON.stringify(personalizedFilter));
|
150
|
+
personalizedFilterParsed.assistent = JSON.stringify(personalizedFilterParsed.assistent);
|
151
|
+
return new Promise((resolve, reject) => {
|
152
|
+
DataFetcher.get()
|
153
|
+
.callGraphQL({
|
154
|
+
values: { name: this.resolveURI(resourceID, configName), filterAssistent: personalizedFilterParsed },
|
155
|
+
query: this.templateByQuery.get("savePersonalizedFilter"),
|
156
|
+
})
|
157
|
+
.then((resp) => {
|
158
|
+
resolve(resp);
|
159
|
+
})
|
160
|
+
.catch((error) => {
|
161
|
+
reject(error);
|
162
|
+
});
|
163
|
+
});
|
164
|
+
}
|
165
|
+
async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
166
|
+
return new Promise((resolve, reject) => {
|
167
|
+
DataFetcher.get()
|
168
|
+
.callGraphQL({
|
169
|
+
values: { name: this.resolveURI(resourceID, configName), filterId: personalizedFilter.id },
|
170
|
+
query: this.templateByQuery.get("deletePersonalizedFilter"),
|
171
|
+
})
|
172
|
+
.then((resp) => {
|
173
|
+
resolve(resp);
|
174
|
+
})
|
175
|
+
.catch((error) => {
|
176
|
+
reject(error);
|
177
|
+
});
|
178
|
+
});
|
179
|
+
}
|
180
|
+
loadFields(uri) {
|
181
|
+
return new Promise((resolve, reject) => {
|
182
|
+
DataFetcher.get()
|
183
|
+
.callGraphQL({
|
184
|
+
values: { name: uri },
|
185
|
+
query: this.templateByQuery.get("fetchFilterFields"),
|
186
|
+
})
|
187
|
+
.then((resp) => {
|
188
|
+
var _a;
|
189
|
+
let fields = resp.fields;
|
190
|
+
for (const field of fields) {
|
191
|
+
if (Array.isArray(field.properties) && field.properties.length > 0) {
|
192
|
+
const propertiesConvertedObject = field.properties.reduce((accumulator, prop) => {
|
193
|
+
accumulator[prop.name] = prop.value;
|
194
|
+
return accumulator;
|
195
|
+
}, {});
|
196
|
+
field.properties = propertiesConvertedObject;
|
197
|
+
}
|
198
|
+
if ((_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.options) {
|
199
|
+
field.properties.options = JSON.parse(field.properties.options);
|
200
|
+
}
|
201
|
+
}
|
202
|
+
resolve(Object.assign(Object.assign({}, resp), { fields: fields }));
|
203
|
+
})
|
204
|
+
.catch((error) => {
|
205
|
+
reject(error);
|
206
|
+
});
|
207
|
+
});
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
46
211
|
const CONFIG_SOURCE = {
|
47
212
|
form: "form",
|
48
213
|
grid: "grid",
|
@@ -106,6 +271,19 @@ class ConfigStorage {
|
|
106
271
|
this.configById.delete(cacheID);
|
107
272
|
return this.gridConfigFetcher.saveConfig(config, name, this.resourceID);
|
108
273
|
}
|
274
|
+
static async loadPersonalizedFilter(filterId, configName) {
|
275
|
+
return this.personalizedFilterFetcher.loadPersonalizedFilter(this.resourceID, filterId, configName);
|
276
|
+
}
|
277
|
+
static async savePersonalizedFilter(personalizedFilter, configName) {
|
278
|
+
//Ao criar ou alterar um filtro personalizado,
|
279
|
+
//precisamos remover o cache do status da filterbar.
|
280
|
+
const cacheID = this.buildCacheID(configName, CONFIG_SOURCE.filterBar);
|
281
|
+
this.configById.delete(cacheID);
|
282
|
+
return this.personalizedFilterFetcher.savePersonalizedFilter(personalizedFilter, this.resourceID, configName);
|
283
|
+
}
|
284
|
+
static async removePersonalizedFilter(personalizedFilter, configName) {
|
285
|
+
return this.personalizedFilterFetcher.removePersonalizedFilter(personalizedFilter, this.resourceID, configName);
|
286
|
+
}
|
109
287
|
static buildCacheID(name, source) {
|
110
288
|
if (name == undefined) {
|
111
289
|
return `req_${source}_${this.resourceID}`;
|
@@ -117,5 +295,6 @@ ConfigStorage.configById = new Map();
|
|
117
295
|
ConfigStorage.filterBarConfigFetcher = new FilterBarConfigFetcher();
|
118
296
|
ConfigStorage.formConfigFetcher = new FormConfigFetcher();
|
119
297
|
ConfigStorage.gridConfigFetcher = new GridConfigFetcher();
|
298
|
+
ConfigStorage.personalizedFilterFetcher = new PersonalizedFilterFetcher();
|
120
299
|
|
121
|
-
export { ConfigStorage as C, GridConfigFetcher as G };
|
300
|
+
export { ConfigStorage as C, GridConfigFetcher as G, PersonalizedFilterFetcher as P };
|