@sankhyalabs/sankhyablocks 10.1.0-dev.52 → 10.1.0-dev.53
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-a1fab5ca.js → ConfigStorage-4201dd3d.js} +2 -2
- package/dist/cjs/{DataFetcher-384d2ce8.js → DataFetcher-b3a8075d.js} +2830 -2
- package/dist/cjs/FormConfigHelper-c5f5473a.js +342 -0
- package/dist/cjs/{ISave-ecbe9336.js → ISave-4674c283.js} +1 -1
- package/dist/cjs/{PersonalizedFilterUtils-eccb267a.js → PersonalizedFilterUtils-263e4d24.js} +52 -5
- package/dist/cjs/{SnkFormConfigManager-44386305.js → SnkFormConfigManager-c3a49038.js} +2 -2
- package/dist/cjs/{SnkMultiSelectionListDataSource-d341dd02.js → SnkMultiSelectionListDataSource-0bc94d36.js} +4 -4
- package/dist/cjs/{auth-fetcher-6b134ec4.js → auth-fetcher-0ecc53ff.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-b9822794.js → dataunit-fetcher-bcbc38c0.js} +2 -3
- package/dist/cjs/{filter-type.enum-2bb46d2a.js → filter-type.enum-b3b388af.js} +7 -0
- package/dist/cjs/{form-config-fetcher-45d1964c.js → form-config-fetcher-f80dbc3b.js} +23 -5
- package/dist/cjs/index-1894343a.js +24 -36
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -5
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_9.cjs.entry.js +5 -6
- package/dist/cjs/snk-application.cjs.entry.js +7 -8
- package/dist/cjs/snk-attach_11.cjs.entry.js +2950 -0
- package/dist/cjs/snk-crud.cjs.entry.js +31 -243
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -6
- package/dist/cjs/{snk-data-unit-4b6dc396.js → snk-data-unit-3b94547d.js} +11 -11
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -4
- package/dist/cjs/snk-detail-view.cjs.entry.js +9 -10
- package/dist/cjs/snk-dynaform-config-header_5.cjs.entry.js +739 -0
- package/dist/cjs/snk-dynaform-detail-view_2.cjs.entry.js +938 -0
- package/dist/cjs/snk-dynaform-field-config_2.cjs.entry.js +327 -0
- package/dist/cjs/snk-dynaform-guides-view-e98f7f3a.js +747 -0
- package/dist/cjs/snk-dynaform-guides-view.cjs.entry.js +23 -0
- package/dist/cjs/snk-dynaform.cjs.entry.js +675 -0
- package/dist/cjs/{snk-expression-group_2.cjs.entry.js → snk-expression-group_4.cjs.entry.js} +421 -18
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +41 -44
- package/dist/cjs/snk-form_2.cjs.entry.js +4 -5
- package/dist/cjs/snk-grid.cjs.entry.js +7 -8
- package/dist/cjs/{snk-guides-viewer-8e7a503b.js → snk-guides-viewer-3054d541.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +5 -6
- package/dist/cjs/snk-layout-form-config.cjs.entry.js +4 -5
- package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -5
- package/dist/cjs/taskbarUtils-38748460.js +231 -0
- package/dist/collection/collection-manifest.json +17 -0
- package/dist/collection/components/snk-dynaform/interfaces/PropsCustomEditor.js +1 -0
- package/dist/collection/components/snk-dynaform/interfaces/PropsCustomRender.js +1 -0
- package/dist/collection/components/snk-dynaform/snk-dynaform.css +64 -0
- package/dist/collection/components/snk-dynaform/snk-dynaform.js +1657 -0
- package/dist/collection/components/snk-dynaform/subcomponents/CardFormResizeObserver.js +26 -0
- package/dist/collection/components/snk-dynaform/subcomponents/GuideBuilder.js +51 -0
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.css +112 -0
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.js +992 -0
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.css +64 -0
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.js +588 -0
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-guides-view/snk-dynaform-guides-view.css +98 -0
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-guides-view/snk-dynaform-guides-view.js +1167 -0
- package/dist/collection/components/snk-dynaform-form-config/FormConfigHelper.js +325 -0
- package/dist/collection/components/snk-dynaform-form-config/SnkFormConfigManager.js +212 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.css +17 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.js +236 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.css +41 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.js +170 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.css +22 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.js +408 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-item.css +88 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-item.js +209 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.css +167 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.js +655 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.css +42 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.js +171 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-form-config.css +66 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-form-config.js +557 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.css +80 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.js +326 -0
- package/dist/collection/components/snk-grid/snk-grid.css +4 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +22 -4
- package/dist/components/form-config-fetcher.js +22 -4
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.js +12 -0
- package/dist/components/snk-crud.js +1 -212
- package/dist/components/snk-dynaform-config-header.d.ts +11 -0
- package/dist/components/snk-dynaform-config-header.js +6 -0
- package/dist/components/snk-dynaform-config-header2.js +103 -0
- package/dist/components/snk-dynaform-configs-button.d.ts +11 -0
- package/dist/components/snk-dynaform-configs-button.js +6 -0
- package/dist/components/snk-dynaform-configs-button2.js +76 -0
- package/dist/components/snk-dynaform-detail-view.d.ts +11 -0
- package/dist/components/snk-dynaform-detail-view.js +6 -0
- package/dist/components/snk-dynaform-detail-view2.js +1835 -0
- package/dist/components/snk-dynaform-field-config.d.ts +11 -0
- package/dist/components/snk-dynaform-field-config.js +6 -0
- package/dist/components/snk-dynaform-field-config2.js +605 -0
- package/dist/components/snk-dynaform-field-item.d.ts +11 -0
- package/dist/components/snk-dynaform-field-item.js +6 -0
- package/dist/components/snk-dynaform-field-item2.js +96 -0
- package/dist/components/snk-dynaform-fields-layout.d.ts +11 -0
- package/dist/components/snk-dynaform-fields-layout.js +6 -0
- package/dist/components/snk-dynaform-fields-layout2.js +428 -0
- package/dist/components/snk-dynaform-fields-selector.d.ts +11 -0
- package/dist/components/snk-dynaform-fields-selector.js +6 -0
- package/dist/components/snk-dynaform-fields-selector2.js +104 -0
- package/dist/components/snk-dynaform-form-config.d.ts +11 -0
- package/dist/components/snk-dynaform-form-config.js +6 -0
- package/dist/components/snk-dynaform-form-config2.js +430 -0
- package/dist/components/snk-dynaform-form-view.d.ts +11 -0
- package/dist/components/snk-dynaform-form-view.js +6 -0
- package/dist/components/snk-dynaform-form-view2.js +270 -0
- package/dist/components/snk-dynaform-guides-configurator.d.ts +11 -0
- package/dist/components/snk-dynaform-guides-configurator.js +6 -0
- package/dist/components/snk-dynaform-guides-configurator2.js +173 -0
- package/dist/components/snk-dynaform-guides-view.d.ts +11 -0
- package/dist/components/snk-dynaform-guides-view.js +6 -0
- package/dist/components/snk-dynaform.d.ts +11 -0
- package/dist/components/snk-dynaform.js +1003 -0
- package/dist/components/snk-grid2.js +1 -1
- package/dist/components/taskbarUtils.js +224 -0
- package/dist/esm/{ConfigStorage-76872695.js → ConfigStorage-e834d1ea.js} +2 -2
- package/dist/esm/{DataFetcher-e60f8d53.js → DataFetcher-5ed0a377.js} +2830 -3
- package/dist/esm/FormConfigHelper-efc29480.js +328 -0
- package/dist/esm/{ISave-4929c071.js → ISave-5b46d691.js} +1 -1
- package/dist/esm/{PersonalizedFilterUtils-d2439a9a.js → PersonalizedFilterUtils-45b5803c.js} +49 -2
- package/dist/esm/{SnkFormConfigManager-83f6b22f.js → SnkFormConfigManager-bfd575c2.js} +2 -2
- package/dist/esm/{SnkMultiSelectionListDataSource-18abafb1.js → SnkMultiSelectionListDataSource-9e9166ae.js} +4 -4
- package/dist/esm/{auth-fetcher-1a31c1e4.js → auth-fetcher-5283045d.js} +1 -1
- package/dist/esm/{dataunit-fetcher-c176e002.js → dataunit-fetcher-3b1ca96e.js} +1 -2
- package/dist/esm/{filter-type.enum-f6a8fe23.js → filter-type.enum-62b7fe88.js} +8 -1
- package/dist/esm/{form-config-fetcher-b44b2727.js → form-config-fetcher-db1bf140.js} +23 -5
- package/dist/esm/index-04f73a26.js +24 -36
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +4 -5
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_9.entry.js +5 -6
- package/dist/esm/snk-application.entry.js +6 -7
- package/dist/esm/snk-attach_11.entry.js +2936 -0
- package/dist/esm/snk-crud.entry.js +6 -218
- package/dist/esm/snk-data-exporter.entry.js +5 -6
- package/dist/esm/{snk-data-unit-d8cfa950.js → snk-data-unit-dfde62cb.js} +2 -2
- package/dist/esm/snk-data-unit.entry.js +3 -4
- package/dist/esm/snk-detail-view.entry.js +7 -8
- package/dist/esm/snk-dynaform-config-header_5.entry.js +731 -0
- package/dist/esm/snk-dynaform-detail-view_2.entry.js +933 -0
- package/dist/esm/snk-dynaform-field-config_2.entry.js +322 -0
- package/dist/esm/snk-dynaform-guides-view-1f1455d6.js +744 -0
- package/dist/esm/snk-dynaform-guides-view.entry.js +15 -0
- package/dist/esm/snk-dynaform.entry.js +671 -0
- package/dist/esm/{snk-expression-group_2.entry.js → snk-expression-group_4.entry.js} +405 -4
- package/dist/esm/snk-filter-bar_4.entry.js +5 -8
- package/dist/esm/snk-form_2.entry.js +4 -5
- package/dist/esm/snk-grid.entry.js +7 -8
- package/dist/esm/{snk-guides-viewer-adf39ea2.js → snk-guides-viewer-95fefcaa.js} +1 -1
- package/dist/esm/snk-guides-viewer.entry.js +5 -6
- package/dist/esm/snk-layout-form-config.entry.js +4 -5
- package/dist/esm/snk-pesquisa.entry.js +4 -5
- package/dist/esm/taskbarUtils-8501d09e.js +225 -0
- package/dist/sankhyablocks/p-0dbd53d9.js +1 -0
- package/dist/sankhyablocks/{p-f5ad0720.js → p-19d1ca14.js} +1 -1
- package/dist/sankhyablocks/{p-ab5e12fa.js → p-1cc4cf61.js} +1 -1
- package/dist/sankhyablocks/p-1edd6be6.entry.js +1 -0
- package/dist/sankhyablocks/p-22ddc1a5.entry.js +1 -0
- package/dist/sankhyablocks/p-24b059ee.entry.js +1 -0
- package/dist/sankhyablocks/{p-5c250661.js → p-2c00b93d.js} +1 -1
- package/dist/sankhyablocks/p-3623fddf.entry.js +1 -0
- package/dist/sankhyablocks/p-43c94ba5.entry.js +1 -0
- package/dist/sankhyablocks/p-449dfe55.entry.js +1 -0
- package/dist/sankhyablocks/p-451b5bcc.entry.js +1 -0
- package/dist/sankhyablocks/p-46d7e2de.js +1 -0
- package/dist/sankhyablocks/{p-3c990841.js → p-51e853f2.js} +1 -1
- package/dist/sankhyablocks/p-58709cf9.js +1 -0
- package/dist/sankhyablocks/p-589016e2.entry.js +1 -0
- package/dist/sankhyablocks/p-5d02c032.js +1 -0
- package/dist/sankhyablocks/p-5d50f59a.entry.js +1 -0
- package/dist/sankhyablocks/p-61776b68.entry.js +1 -0
- package/dist/sankhyablocks/p-6b8a1ec3.js +1 -0
- package/dist/sankhyablocks/p-7038cf62.entry.js +1 -0
- package/dist/sankhyablocks/{p-b1bb4cf1.js → p-70c2ee5c.js} +1 -1
- package/dist/sankhyablocks/p-7628e04f.entry.js +1 -0
- package/dist/sankhyablocks/p-7798788b.entry.js +1 -0
- package/dist/sankhyablocks/p-77c26de0.js +1 -0
- package/dist/sankhyablocks/p-7c34a0f7.entry.js +1 -0
- package/dist/sankhyablocks/p-a4a0d9b7.entry.js +1 -0
- package/dist/sankhyablocks/{p-4f7adf97.js → p-b1bf9564.js} +1 -1
- package/dist/sankhyablocks/p-b4c2a99c.entry.js +1 -0
- package/dist/sankhyablocks/p-b75af274.entry.js +1 -0
- package/dist/sankhyablocks/p-c538bd6c.entry.js +1 -0
- package/dist/sankhyablocks/{p-3704bf1b.js → p-d5810110.js} +1 -1
- package/dist/sankhyablocks/p-d7fd447e.entry.js +1 -0
- package/dist/sankhyablocks/p-d88278f8.js +28 -0
- package/dist/sankhyablocks/p-f076d742.js +60 -0
- package/dist/sankhyablocks/{p-8fe740b7.entry.js → p-f1ef090f.entry.js} +2 -2
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-dynaform/interfaces/PropsCustomEditor.d.ts +4 -0
- package/dist/types/components/snk-dynaform/interfaces/PropsCustomRender.d.ts +4 -0
- package/dist/types/components/snk-dynaform/subcomponents/CardFormResizeObserver.d.ts +1 -0
- package/dist/types/components/snk-dynaform/subcomponents/GuideBuilder.d.ts +14 -0
- package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.d.ts +158 -0
- package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.d.ts +107 -0
- package/dist/types/components/snk-dynaform-form-config/FormConfigHelper.d.ts +36 -0
- package/dist/types/components/snk-dynaform-form-config/SnkFormConfigManager.d.ts +35 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.d.ts +23 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.d.ts +19 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.d.ts +56 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.d.ts +74 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.d.ts +21 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-form-config.d.ts +95 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.d.ts +35 -0
- package/dist/types/components.d.ts +2403 -1322
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +1 -0
- package/package.json +1 -1
- package/react/components.d.ts +12 -0
- package/react/components.js +12 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/SnkMessageBuilder-a9300ebe.js +0 -2833
- package/dist/cjs/default-filters-a09bf82b.js +0 -8
- package/dist/cjs/index-62760a9c.js +0 -49
- package/dist/cjs/index-8d94b7e0.js +0 -7
- package/dist/cjs/snk-attach.cjs.entry.js +0 -948
- package/dist/cjs/snk-default-filter.cjs.entry.js +0 -77
- package/dist/cjs/snk-filter-advanced-mode_3.cjs.entry.js +0 -99
- package/dist/cjs/snk-filter-detail.cjs.entry.js +0 -198
- package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +0 -408
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +0 -109
- package/dist/cjs/snk-image-input.cjs.entry.js +0 -160
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +0 -358
- package/dist/cjs/snk-simple-crud.cjs.entry.js +0 -865
- package/dist/esm/SnkMessageBuilder-1eb7a1af.js +0 -2831
- package/dist/esm/default-filters-50105e43.js +0 -8
- package/dist/esm/index-620ac460.js +0 -7
- package/dist/esm/index-8acbae97.js +0 -49
- package/dist/esm/snk-attach.entry.js +0 -944
- package/dist/esm/snk-default-filter.entry.js +0 -73
- package/dist/esm/snk-filter-advanced-mode_3.entry.js +0 -93
- package/dist/esm/snk-filter-detail.entry.js +0 -194
- package/dist/esm/snk-filter-field-search_2.entry.js +0 -403
- package/dist/esm/snk-filter-modal-item.entry.js +0 -105
- package/dist/esm/snk-image-input.entry.js +0 -156
- package/dist/esm/snk-personalized-filter.entry.js +0 -354
- package/dist/esm/snk-simple-crud.entry.js +0 -861
- package/dist/sankhyablocks/p-0a4cdcde.entry.js +0 -1
- package/dist/sankhyablocks/p-0afc64df.entry.js +0 -1
- package/dist/sankhyablocks/p-10f27dc6.entry.js +0 -1
- package/dist/sankhyablocks/p-20f03230.entry.js +0 -1
- package/dist/sankhyablocks/p-2af8aca3.js +0 -1
- package/dist/sankhyablocks/p-3870748a.js +0 -28
- package/dist/sankhyablocks/p-3d294185.entry.js +0 -1
- package/dist/sankhyablocks/p-438a225f.entry.js +0 -1
- package/dist/sankhyablocks/p-4d04bc75.entry.js +0 -1
- package/dist/sankhyablocks/p-554c0e54.js +0 -1
- package/dist/sankhyablocks/p-57c184a2.entry.js +0 -1
- package/dist/sankhyablocks/p-68c1a093.js +0 -1
- package/dist/sankhyablocks/p-6a4b21dd.js +0 -1
- package/dist/sankhyablocks/p-6ae7543b.entry.js +0 -1
- package/dist/sankhyablocks/p-6e278003.js +0 -60
- package/dist/sankhyablocks/p-82bcb4cf.entry.js +0 -1
- package/dist/sankhyablocks/p-84345e7a.js +0 -1
- package/dist/sankhyablocks/p-95af0bb1.entry.js +0 -1
- package/dist/sankhyablocks/p-a905712a.entry.js +0 -1
- package/dist/sankhyablocks/p-aff2d081.entry.js +0 -1
- package/dist/sankhyablocks/p-b0a357b4.entry.js +0 -1
- package/dist/sankhyablocks/p-b568c1d4.js +0 -1
- package/dist/sankhyablocks/p-bab4cde4.entry.js +0 -1
- package/dist/sankhyablocks/p-bd3c1aaa.entry.js +0 -1
- package/dist/sankhyablocks/p-cc64239c.entry.js +0 -1
- package/dist/sankhyablocks/p-cd00a3d1.entry.js +0 -1
- package/dist/sankhyablocks/p-d9ec8c4b.entry.js +0 -1
- package/dist/sankhyablocks/p-dbdbb77a.entry.js +0 -1
- package/dist/sankhyablocks/p-e8df1dea.entry.js +0 -1
- package/dist/sankhyablocks/p-ef9343c3.entry.js +0 -1
- package/dist/sankhyablocks/p-f4184ce7.js +0 -1
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-1894343a.js');
|
|
6
|
-
const core = require('@sankhyalabs/core');
|
|
7
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-a9300ebe.js');
|
|
8
|
-
const ImageUtils = require('./ImageUtils-d6139911.js');
|
|
9
|
-
|
|
10
|
-
const snkImageInputCss = ":host{display:block}";
|
|
11
|
-
|
|
12
|
-
const SnkImageInput = class {
|
|
13
|
-
constructor(hostRef) {
|
|
14
|
-
index.registerInstance(this, hostRef);
|
|
15
|
-
this.imageError = index.createEvent(this, "imageError", 7);
|
|
16
|
-
this.dataUnitObserver = async (action) => {
|
|
17
|
-
var _a;
|
|
18
|
-
const actionsMoveSelection = [core.Action.NEXT_SELECTED, core.Action.PREVIOUS_SELECTED];
|
|
19
|
-
if (actionsMoveSelection.includes(action.type)) {
|
|
20
|
-
await this.loadImage();
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const selection = ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.selection) || [];
|
|
24
|
-
if (action.type === core.Action.SELECTION_CHANGED && selection.length > 0) {
|
|
25
|
-
await this.loadImage();
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (action.type === core.Action.RECORDS_ADDED) {
|
|
29
|
-
await this.clearImage();
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (action.type === core.Action.EDITION_CANCELED) {
|
|
33
|
-
await this.loadImage();
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
this.dataUnit = undefined;
|
|
38
|
-
this.fieldName = undefined;
|
|
39
|
-
this.entityName = undefined;
|
|
40
|
-
this.enabled = true;
|
|
41
|
-
this.acceptType = undefined;
|
|
42
|
-
this.maxSize = undefined;
|
|
43
|
-
this.label = undefined;
|
|
44
|
-
this.imageValue = undefined;
|
|
45
|
-
this.loading = true;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Força o reload da imagem
|
|
49
|
-
*/
|
|
50
|
-
async reloadImage(pks) {
|
|
51
|
-
await this.loadImage(pks);
|
|
52
|
-
}
|
|
53
|
-
getMessage(key, params) {
|
|
54
|
-
if (!this.messagesBuilder) {
|
|
55
|
-
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder();
|
|
56
|
-
}
|
|
57
|
-
return this.messagesBuilder.getMessage(key, params);
|
|
58
|
-
}
|
|
59
|
-
async clearImage() {
|
|
60
|
-
var _a;
|
|
61
|
-
(_a = this._loadAbortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
62
|
-
this.imageValue = undefined;
|
|
63
|
-
}
|
|
64
|
-
async handleImageChange(event) {
|
|
65
|
-
const base64 = event.detail;
|
|
66
|
-
if (!base64) {
|
|
67
|
-
await this.clearImage();
|
|
68
|
-
await this.updatedataUnitField(true);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const blob = await ImageUtils.base64ToBlob(base64);
|
|
72
|
-
if (this.maxSize && blob.size > this.maxSize * 1024) {
|
|
73
|
-
const errorMsg = this.getMessage('snkImageInput.errorImageSize') + this.maxSize + '(KB)';
|
|
74
|
-
this.imageError.emit(errorMsg);
|
|
75
|
-
if (this.application) {
|
|
76
|
-
await this.application.error(this.getMessage('snkImageInput.errorTitle'), errorMsg);
|
|
77
|
-
}
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
this.imageValue = base64;
|
|
81
|
-
await ImageUtils.sessionFileUpload(blob, this.entityName, this.fieldName);
|
|
82
|
-
await this.updatedataUnitField();
|
|
83
|
-
}
|
|
84
|
-
async updatedataUnitField(deleted = false) {
|
|
85
|
-
if (!this.dataUnit || !this.dataUnit.getSelectedRecord()) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (deleted) {
|
|
89
|
-
await this.dataUnit.setFieldValue(this.fieldName, 'deletado');
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
await this.dataUnit.setFieldValue(this.fieldName, `$file.session.key{${ImageUtils.buildFileKey(this.entityName, this.fieldName)}}`);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
async handleImageError(event) {
|
|
96
|
-
this.imageError.emit(event.detail);
|
|
97
|
-
if (this.application) {
|
|
98
|
-
await this.application.error(this.getMessage('snkImageInput.errorTitle'), event.detail);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
getPksFromDataUnit() {
|
|
102
|
-
if (!this.dataUnit) {
|
|
103
|
-
return undefined;
|
|
104
|
-
}
|
|
105
|
-
const selectedRecord = this.dataUnit.getSelectedRecord();
|
|
106
|
-
if (!selectedRecord) {
|
|
107
|
-
return undefined;
|
|
108
|
-
}
|
|
109
|
-
const fieldValue = selectedRecord[this.fieldName];
|
|
110
|
-
if (!fieldValue) {
|
|
111
|
-
return undefined;
|
|
112
|
-
}
|
|
113
|
-
try {
|
|
114
|
-
const pk = JSON.parse(fieldValue);
|
|
115
|
-
return pk;
|
|
116
|
-
}
|
|
117
|
-
catch (error) {
|
|
118
|
-
console.error('Error parsing PK from data unit field:', error);
|
|
119
|
-
return undefined;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
async loadImage(pks) {
|
|
123
|
-
var _a, _b;
|
|
124
|
-
(_a = this._loadAbortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
125
|
-
const controller = new AbortController();
|
|
126
|
-
this._loadAbortController = controller;
|
|
127
|
-
this.loading = true;
|
|
128
|
-
if (this.dataUnit && this.entityName) {
|
|
129
|
-
pks = (_b = pks !== null && pks !== void 0 ? pks : this.getPksFromDataUnit()) !== null && _b !== void 0 ? _b : ImageUtils.getPKs(this.dataUnit);
|
|
130
|
-
const image = await ImageUtils.downloadImage(pks, this.fieldName, this.entityName, controller.signal);
|
|
131
|
-
if (controller.signal.aborted)
|
|
132
|
-
return;
|
|
133
|
-
this.imageValue = image;
|
|
134
|
-
}
|
|
135
|
-
this.loading = false;
|
|
136
|
-
}
|
|
137
|
-
async componentWillLoad() {
|
|
138
|
-
this.application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
139
|
-
if (!this.messagesBuilder) {
|
|
140
|
-
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder();
|
|
141
|
-
}
|
|
142
|
-
if (this.dataUnit) {
|
|
143
|
-
this.dataUnit.subscribe(this.dataUnitObserver);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
disconnectedCallback() {
|
|
147
|
-
if (this.dataUnit) {
|
|
148
|
-
this.dataUnit.unsubscribe(this.dataUnitObserver);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
async componentDidLoad() {
|
|
152
|
-
await this.loadImage();
|
|
153
|
-
}
|
|
154
|
-
render() {
|
|
155
|
-
return (index.h(index.Host, null, index.h("ez-image-input", { enabled: this.enabled, label: this.label, name: this.fieldName, value: this.imageValue, maxFileSize: this.maxSize ? this.maxSize * 1024 : undefined, accept: this.acceptType || 'image/png,image/jpeg,image/gif', onEzChange: (e) => this.handleImageChange(e), onEzError: (e) => this.handleImageError(e), loading: this.loading })));
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
SnkImageInput.style = snkImageInputCss;
|
|
159
|
-
|
|
160
|
-
exports.snk_image_input = SnkImageInput;
|
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-1894343a.js');
|
|
6
|
-
const core = require('@sankhyalabs/core');
|
|
7
|
-
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-eccb267a.js');
|
|
8
|
-
const ConfigStorage = require('./ConfigStorage-a1fab5ca.js');
|
|
9
|
-
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
10
|
-
const index$1 = require('./index-62760a9c.js');
|
|
11
|
-
const index$2 = require('./index-f0fe7e6e.js');
|
|
12
|
-
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
13
|
-
require('./form-config-fetcher-45d1964c.js');
|
|
14
|
-
require('./DataFetcher-384d2ce8.js');
|
|
15
|
-
require('./PrintUtils-bcaeb82f.js');
|
|
16
|
-
require('./SnkMessageBuilder-a9300ebe.js');
|
|
17
|
-
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
18
|
-
|
|
19
|
-
const snkPersonalizedFilterCss = ".sc-snk-personalized-filter-h{display:flex;height:100%;padding:var(--space--large, 24px);--snk-personalized-filter--width:100%;--snk-personalized-filter--height:100%;--snk-personalized-filter--background-color-line:var(--color--disable-secondary);--snk-personalized-filter--margin-line:var(--border--radius-medium, 12px)}.snk-personalized-filter.sc-snk-personalized-filter{height:var(--snk-personalized-filter--width);width:var(--snk-personalized-filter--height)}.snk-personalized-filter__header-actions.sc-snk-personalized-filter{display:flex;gap:var(--space--medium)}.snk-personalized-filter__group.sc-snk-personalized-filter{flex:1}.snk-personalized-filter__expression-input--line.sc-snk-personalized-filter{width:100%;height:2px;background-color:var(--snk-personalized-filter--background-color-line);margin-top:var(--snk-personalized-filter--margin-line);margin-bottom:var(--snk-personalized-filter--margin-line)}.ez-box__main.sc-snk-personalized-filter{height:90%}.snk-personalized-filter__button-mode.sc-snk-personalized-filter{height:35px}";
|
|
20
|
-
|
|
21
|
-
const SnkPersonalizedFilter = class {
|
|
22
|
-
constructor(hostRef) {
|
|
23
|
-
index.registerInstance(this, hostRef);
|
|
24
|
-
this.ezCancel = index.createEvent(this, "ezCancel", 7);
|
|
25
|
-
this.ezSave = index.createEvent(this, "ezSave", 7);
|
|
26
|
-
this.ezAfterSave = index.createEvent(this, "ezAfterSave", 7);
|
|
27
|
-
this._personalizedFilterFetcher = new ConfigStorage.PersonalizedFilterFetcher();
|
|
28
|
-
this._filterMetadataStorage = new Map();
|
|
29
|
-
this._dataSourceFetcher = {
|
|
30
|
-
fetchData: async (entity) => {
|
|
31
|
-
let entityURI = entity === null || entity === void 0 ? void 0 : entity.uri;
|
|
32
|
-
if (core.StringUtils.isEmpty(entityURI)) {
|
|
33
|
-
entityURI = this.entityUri;
|
|
34
|
-
}
|
|
35
|
-
if (!this._filterMetadataStorage.has(entityURI)) {
|
|
36
|
-
const filterMetadata = await this._personalizedFilterFetcher.loadFields(entityURI);
|
|
37
|
-
this._filterMetadataStorage.set(entityURI, filterMetadata);
|
|
38
|
-
}
|
|
39
|
-
return this._filterMetadataStorage.get(entityURI);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
this._filterAssistentMode = true;
|
|
43
|
-
this._filterAssistent = undefined;
|
|
44
|
-
this.messagesBuilder = undefined;
|
|
45
|
-
this.entityUri = undefined;
|
|
46
|
-
this.filterId = undefined;
|
|
47
|
-
this.configName = undefined;
|
|
48
|
-
this.resourceID = undefined;
|
|
49
|
-
this.isDefaultFilter = false;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Cria um novo filtro personalizado caso não exista nenhum.
|
|
53
|
-
* @method
|
|
54
|
-
* @returns {Promise<void>}
|
|
55
|
-
*/
|
|
56
|
-
async createPersonalizedFilter() {
|
|
57
|
-
const newPersonalizedFilter = {
|
|
58
|
-
name: "",
|
|
59
|
-
active: true,
|
|
60
|
-
expression: "",
|
|
61
|
-
parameters: [],
|
|
62
|
-
assistent: {
|
|
63
|
-
id: core.StringUtils.generateUUID(),
|
|
64
|
-
items: [
|
|
65
|
-
{
|
|
66
|
-
id: core.StringUtils.generateUUID(),
|
|
67
|
-
entityName: "",
|
|
68
|
-
fieldName: "",
|
|
69
|
-
description: "",
|
|
70
|
-
fieldLabel: this.getMessage("snkPersonalizedFilter.info.labelDefaultValue"),
|
|
71
|
-
type: undefined,
|
|
72
|
-
expression: undefined,
|
|
73
|
-
operand: undefined,
|
|
74
|
-
paramVariable: false,
|
|
75
|
-
value: undefined,
|
|
76
|
-
systemConfig: null,
|
|
77
|
-
userConfig: null
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
childrenGroups: [],
|
|
81
|
-
operand: index$1.FilterGroupCondition.AND
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
if (this.isDefaultFilter) {
|
|
85
|
-
this.buildDataDefaultFilter(newPersonalizedFilter);
|
|
86
|
-
}
|
|
87
|
-
this._originalFilterAssistent = core.ObjectUtils.copy(newPersonalizedFilter);
|
|
88
|
-
this._filterAssistent = core.ObjectUtils.copy(newPersonalizedFilter);
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Carrega o filtro personalizado com base no identificador informado.
|
|
92
|
-
* @watch filterId
|
|
93
|
-
* @param newValue Novo valor do filtroId.
|
|
94
|
-
* @param oldValue Valor anterior do filtroId.
|
|
95
|
-
*/
|
|
96
|
-
loadFilter(newValue, oldValue) {
|
|
97
|
-
if (newValue == null || oldValue == newValue || this.resourceID == undefined) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
if (newValue === index$1.DefaultFilter.id) {
|
|
101
|
-
ConfigStorage.ConfigStorage.loadDefaultFilter(newValue, this.resourceID, this.configName)
|
|
102
|
-
.then((resp) => {
|
|
103
|
-
const personalizedFilter = this.applyDefaultValues(resp);
|
|
104
|
-
this._filterAssistent = personalizedFilter;
|
|
105
|
-
this._originalFilterAssistent = core.ObjectUtils.copy(personalizedFilter);
|
|
106
|
-
this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
|
|
107
|
-
});
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
ConfigStorage.ConfigStorage.loadPersonalizedFilter(newValue, this.resourceID, this.configName)
|
|
111
|
-
.then((resp) => {
|
|
112
|
-
const personalizedFilter = this.applyDefaultValues(resp);
|
|
113
|
-
this._filterAssistent = personalizedFilter;
|
|
114
|
-
this._originalFilterAssistent = core.ObjectUtils.copy(personalizedFilter);
|
|
115
|
-
this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
componentWillLoad() {
|
|
119
|
-
var _a;
|
|
120
|
-
if (index$2.store.get(`filterFieldsDataSource.${this.entityUri}`) == undefined) {
|
|
121
|
-
index$2.store.set(`filterFieldsDataSource.${this.entityUri}`, this._dataSourceFetcher);
|
|
122
|
-
}
|
|
123
|
-
if (!this.messagesBuilder) {
|
|
124
|
-
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
125
|
-
this.messagesBuilder = (_a = this._application) === null || _a === void 0 ? void 0 : _a.messagesBuilder;
|
|
126
|
-
}
|
|
127
|
-
this.loadFilter(this.filterId, undefined);
|
|
128
|
-
}
|
|
129
|
-
componentDidRender() {
|
|
130
|
-
var _a;
|
|
131
|
-
(_a = this._viewStackRef) === null || _a === void 0 ? void 0 : _a.show(this._filterAssistentMode ? 0 : 1);
|
|
132
|
-
if (this._elButtonMode) {
|
|
133
|
-
this._elButtonMode.setAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME, core.ElementIDUtils.getInternalIDInfo(`${this._filterAssistentMode ? "advancedMode_ezButton" : "assistentMode_ezButton"}`));
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
buildDataDefaultFilter(data) {
|
|
137
|
-
data.name = index$1.DefaultFilter.name;
|
|
138
|
-
data.id = index$1.DefaultFilter.id;
|
|
139
|
-
}
|
|
140
|
-
getMessage(key, params) {
|
|
141
|
-
return this._application.messagesBuilder.getMessage(key, params);
|
|
142
|
-
}
|
|
143
|
-
async saveFilter() {
|
|
144
|
-
let response;
|
|
145
|
-
if (this.isDefaultFilter) {
|
|
146
|
-
response = await ConfigStorage.ConfigStorage.saveDefaultFilter(this._filterAssistent, this.resourceID, this.configName);
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
response = await ConfigStorage.ConfigStorage.savePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName);
|
|
150
|
-
}
|
|
151
|
-
this._elButtonSave.enabled = false;
|
|
152
|
-
const messageToken = !!this._filterAssistent.id ? 'confirmEdit' : 'confirmSave';
|
|
153
|
-
utils.ApplicationUtils.info(this.getMessage(`snkPersonalizedFilter.${messageToken}.title`), { iconName: "check" });
|
|
154
|
-
const updatedFilterAssistent = Object.assign(Object.assign({}, response), this._filterAssistent);
|
|
155
|
-
updatedFilterAssistent.parameters = PersonalizedFilterUtils.PersonalizedFilterUtils.buildVariableParameters(this._filterAssistent.assistent);
|
|
156
|
-
this._originalFilterAssistent = core.ObjectUtils.copy(updatedFilterAssistent);
|
|
157
|
-
this._filterAssistent = core.ObjectUtils.copy(updatedFilterAssistent);
|
|
158
|
-
this.ezAfterSave.emit();
|
|
159
|
-
}
|
|
160
|
-
removeFilter() {
|
|
161
|
-
ConfigStorage.ConfigStorage.removePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName);
|
|
162
|
-
}
|
|
163
|
-
hasChangesToSave() {
|
|
164
|
-
return JSON.stringify(this._filterAssistent) === JSON.stringify(this._originalFilterAssistent);
|
|
165
|
-
}
|
|
166
|
-
async handleSave() {
|
|
167
|
-
if (this._filterAssistentMode) {
|
|
168
|
-
const isValid = PersonalizedFilterUtils.PersonalizedFilterUtils.validateFields(this._filterAssistent.assistent);
|
|
169
|
-
if (!isValid || !this._filterAssistent.name)
|
|
170
|
-
return this._application.error(this.getMessage("snkPersonalizedFilter.error.title"), this.getMessage("snkPersonalizedFilter.error.description"));
|
|
171
|
-
this.saveAssistentMode();
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
if (!this._filterAssistent.expression || !this._filterAssistent.name)
|
|
175
|
-
return this._application.error(this.getMessage("snkPersonalizedFilter.error.title"), this.getMessage("snkPersonalizedFilter.error.description"));
|
|
176
|
-
const isValidExpressionForAdvancedMode = await this.validateExpressionBeforeSaving();
|
|
177
|
-
if (!isValidExpressionForAdvancedMode)
|
|
178
|
-
return;
|
|
179
|
-
this.saveAdvancedMode();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
saveAssistentMode() {
|
|
183
|
-
const { assistent, expression } = this._filterAssistent;
|
|
184
|
-
const expressionQuery = !!assistent ? PersonalizedFilterUtils.PersonalizedFilterUtils.buildGroupExpression(assistent) : expression;
|
|
185
|
-
this._filterAssistent.expression = expressionQuery;
|
|
186
|
-
this.ezSave.emit(expressionQuery);
|
|
187
|
-
this.saveFilter();
|
|
188
|
-
}
|
|
189
|
-
saveAdvancedMode() {
|
|
190
|
-
if (this._originalFilterAssistent.expression !== this._filterAssistent.expression && this._filterAssistent.assistent) {
|
|
191
|
-
utils.ApplicationUtils.confirm(this.getMessage("snkPersonalizedFilter.confirmSaveModeAdvanced.title"), this.getMessage("snkPersonalizedFilter.confirmSaveModeAdvanced.description"))
|
|
192
|
-
.then((confirm) => {
|
|
193
|
-
if (!confirm)
|
|
194
|
-
return;
|
|
195
|
-
this.saveAndTransformToAdvancedMode();
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
else if (!this._filterAssistent.assistent) {
|
|
199
|
-
this.saveAndTransformToAdvancedMode();
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
this.saveAssistentMode();
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
saveAndTransformToAdvancedMode() {
|
|
206
|
-
this._filterAssistent.assistent = undefined;
|
|
207
|
-
this.ezSave.emit(this._filterAssistent.expression);
|
|
208
|
-
this.saveFilter();
|
|
209
|
-
}
|
|
210
|
-
async validateExpressionBeforeSaving() {
|
|
211
|
-
const { valid, message = "" } = await this._personalizedFilterFetcher.validatePersonalizedFilter(this.entityUri, this._filterAssistent.expression);
|
|
212
|
-
valid || this._application.error(this.getMessage("snkPersonalizedFilter.errorValidation.title"), message.replace(/.*Exception: /, ''));
|
|
213
|
-
return valid;
|
|
214
|
-
}
|
|
215
|
-
handleCancel() {
|
|
216
|
-
if (this.hasChangesToSave()) {
|
|
217
|
-
return this.ezCancel.emit();
|
|
218
|
-
}
|
|
219
|
-
utils.ApplicationUtils.confirm(this.getMessage("snkPersonalizedFilter.confirmCancel.title"), this.getMessage("snkPersonalizedFilter.confirmCancel.description"))
|
|
220
|
-
.then((canCancel) => {
|
|
221
|
-
var _a;
|
|
222
|
-
if (!canCancel)
|
|
223
|
-
return;
|
|
224
|
-
this._filterAssistent = core.ObjectUtils.copy((_a = this._originalFilterAssistent) !== null && _a !== void 0 ? _a : {});
|
|
225
|
-
this.ezCancel.emit();
|
|
226
|
-
this._elButtonSave.enabled = false;
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
handleTitleChange(name) {
|
|
230
|
-
this._filterAssistent = Object.assign(Object.assign({}, this._filterAssistent), { name });
|
|
231
|
-
this._elButtonSave.enabled = !this.hasChangesToSave();
|
|
232
|
-
}
|
|
233
|
-
applyDefaultValues(personalizedFilter) {
|
|
234
|
-
this.addLabelToItems(personalizedFilter);
|
|
235
|
-
this.addFilterGroupCondition(personalizedFilter);
|
|
236
|
-
return personalizedFilter;
|
|
237
|
-
}
|
|
238
|
-
addFilterGroupCondition(personalizedFilter) {
|
|
239
|
-
if (personalizedFilter.assistent && !personalizedFilter.assistent.operand) {
|
|
240
|
-
personalizedFilter.assistent.operand = index$1.FilterGroupCondition.AND;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
;
|
|
244
|
-
addLabelToItems(personalizedFilter) {
|
|
245
|
-
//Workaround: Alguns filtros foram salvos sem o fieldLabel. Para evitar transtornos
|
|
246
|
-
//tentamos usar o fieldLabel que pode estar informado no parametro.
|
|
247
|
-
if (personalizedFilter.assistent && personalizedFilter.assistent.items && personalizedFilter.assistent.items.length > 0) {
|
|
248
|
-
personalizedFilter.assistent.items.forEach(item => {
|
|
249
|
-
if (item.fieldLabel == undefined) {
|
|
250
|
-
const param = (personalizedFilter.parameters || []).find(param => param.fieldName === item.fieldName);
|
|
251
|
-
if (param) {
|
|
252
|
-
item.fieldLabel = param.label;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
handleExpressionChangeAdvancedMode(expression) {
|
|
259
|
-
this._filterAssistent = Object.assign(Object.assign({}, this._filterAssistent), { expression });
|
|
260
|
-
this._elButtonSave.enabled = !this.hasChangesToSave();
|
|
261
|
-
}
|
|
262
|
-
handleChangeFilterAssistentMode(filterAssistent) {
|
|
263
|
-
this._elButtonSave.enabled = !this.hasChangesToSave();
|
|
264
|
-
this._filterAssistent = Object.assign({}, filterAssistent);
|
|
265
|
-
}
|
|
266
|
-
selectField(fieldName) {
|
|
267
|
-
if (!('name' in fieldName))
|
|
268
|
-
return;
|
|
269
|
-
const fieldExpression = this.buildExpression(fieldName.entityName, fieldName.name, fieldName.entityPath);
|
|
270
|
-
const textAreaElement = this._elAdvancedMode.querySelector('ez-text-area');
|
|
271
|
-
textAreaElement.appendTextToSelection(fieldExpression);
|
|
272
|
-
}
|
|
273
|
-
buildExpression(entityName, fieldName, entityPath) {
|
|
274
|
-
if (entityPath.length > 0) {
|
|
275
|
-
entityPath.shift();
|
|
276
|
-
}
|
|
277
|
-
return entityPath.length > 0 ? `${entityPath.join("->")}->${fieldName}` : `${entityName}.${fieldName}`;
|
|
278
|
-
}
|
|
279
|
-
onAddField(target) {
|
|
280
|
-
const textAreaElement = this._elAdvancedMode.querySelector('ez-text-area');
|
|
281
|
-
const options = { horizontalGap: 0, verticalGap: 12, fromRight: true };
|
|
282
|
-
textAreaElement.setFocus();
|
|
283
|
-
target.setBlur();
|
|
284
|
-
if (this._elFilterFieldSearch)
|
|
285
|
-
this._elFilterFieldSearch.show(target, options);
|
|
286
|
-
}
|
|
287
|
-
renderButtonAddField() {
|
|
288
|
-
if (this._filterAssistentMode)
|
|
289
|
-
return;
|
|
290
|
-
return (index.h(index.Fragment, null, index.h("ez-button", { class: "snk-personalized-filter__button-mode", label: this.getMessage("snkPersonalizedFilter.info.addField"), enabled: true, onClick: (evt) => this.onAddField(evt.target) }, index.h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: "plus" })), index.h("snk-filter-field-search", { class: "ez-padding-left--medium", ref: ref => this._elFilterFieldSearch = ref, onEzSelectFilterItem: (evt) => this.selectField(evt.detail), fieldsDataSource: this._dataSourceFetcher })));
|
|
291
|
-
}
|
|
292
|
-
buildContainerPersonalizedFilter() {
|
|
293
|
-
return (index.h("ez-view-stack", { ref: (ref) => this._viewStackRef = ref }, index.h("stack-item", null, this._filterAssistentMode &&
|
|
294
|
-
index.h("snk-filter-assistent-mode", { filterAssistent: this._filterAssistent, messagesBuilder: this.messagesBuilder, filterId: this.filterId, entityUri: this.entityUri, application: this._application, onEzChangeFilter: (ev) => this.handleChangeFilterAssistentMode(ev.detail), isDefaultFilter: this.isDefaultFilter })), index.h("stack-item", null, index.h("snk-filter-advanced-mode", { ref: (ref) => this._elAdvancedMode = ref, filterAssistent: this._filterAssistent, application: this._application, onEzExpressionChange: (ev) => this.handleExpressionChangeAdvancedMode(ev.detail) }))));
|
|
295
|
-
}
|
|
296
|
-
handleModeChange() {
|
|
297
|
-
var _a, _b;
|
|
298
|
-
if (this._filterAssistentMode) {
|
|
299
|
-
utils.ApplicationUtils.confirm(this.getMessage("snkPersonalizedFilter.confirmChangeModeAssistent.title"), this.getMessage("snkPersonalizedFilter.confirmChangeModeAssistent.description"))
|
|
300
|
-
.then((canCancel) => {
|
|
301
|
-
if (!canCancel)
|
|
302
|
-
return;
|
|
303
|
-
this._filterAssistentMode = !this._filterAssistentMode;
|
|
304
|
-
if (!this.hasChangesToSave()) {
|
|
305
|
-
const expression = PersonalizedFilterUtils.PersonalizedFilterUtils.buildGroupExpression(this._filterAssistent.assistent);
|
|
306
|
-
this._filterAssistent.expression = expression;
|
|
307
|
-
this._elButtonSave.enabled = !this.hasChangesToSave();
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
else {
|
|
312
|
-
if (((_a = this._filterAssistent) === null || _a === void 0 ? void 0 : _a.expression) === ((_b = this._originalFilterAssistent) === null || _b === void 0 ? void 0 : _b.expression)) {
|
|
313
|
-
this._filterAssistentMode = !this._filterAssistentMode;
|
|
314
|
-
}
|
|
315
|
-
else {
|
|
316
|
-
const expressionBefore = this._filterAssistent.expression;
|
|
317
|
-
const expression = PersonalizedFilterUtils.PersonalizedFilterUtils.buildGroupExpression(this._filterAssistent.assistent);
|
|
318
|
-
if (expressionBefore !== expression) {
|
|
319
|
-
utils.ApplicationUtils.confirm(this.getMessage("snkPersonalizedFilter.confirmChangeModeAdvanced.title"), this.getMessage("snkPersonalizedFilter.confirmChangeModeAdvanced.description"))
|
|
320
|
-
.then((canCancel) => {
|
|
321
|
-
if (!canCancel)
|
|
322
|
-
return;
|
|
323
|
-
this._filterAssistent = Object.assign(Object.assign({}, this._filterAssistent), { expression });
|
|
324
|
-
this._filterAssistentMode = !this._filterAssistentMode;
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
this._filterAssistentMode = !this._filterAssistentMode;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
buildTitle() {
|
|
334
|
-
if (this.isDefaultFilter && !this.filterId) {
|
|
335
|
-
return this.getMessage("snkPersonalizedFilter.info.titleCreateDefault");
|
|
336
|
-
}
|
|
337
|
-
if (this.isDefaultFilter && this.filterId) {
|
|
338
|
-
return this.getMessage("snkPersonalizedFilter.info.titleEditDefault");
|
|
339
|
-
}
|
|
340
|
-
if (this.filterId) {
|
|
341
|
-
return this.getMessage("snkPersonalizedFilter.info.titleEdit");
|
|
342
|
-
}
|
|
343
|
-
return this.getMessage("snkPersonalizedFilter.info.titleAdd");
|
|
344
|
-
}
|
|
345
|
-
render() {
|
|
346
|
-
var _a, _b, _c, _d;
|
|
347
|
-
if (!((_a = this._filterAssistent) === null || _a === void 0 ? void 0 : _a.assistent) && this._filterAssistentMode) {
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
return (index.h(index.Host, null, index.h("div", { class: "snk-personalized-filter" }, index.h("div", null, index.h("snk-simple-bar", { label: this.buildTitle(), onExit: () => this.handleCancel() }, index.h("div", { class: "snk-personalized-filter__header-actions", slot: "rightSlot" }, index.h("ez-button", { label: this.getMessage("snkPersonalizedFilter.info.labelCancel"), onClick: () => this.handleCancel() }), index.h("ez-button", { ref: (el) => this._elButtonSave = el, enabled: false, class: "ez-button--primary", label: this.getMessage("snkPersonalizedFilter.info.labelSave"), onClick: this.handleSave.bind(this) })))), index.h("div", { class: "ez-box ez-margin-bottom--medium ez-box__main" }, index.h("div", { class: "ez-box__container" }, index.h("div", { class: "ez-flex ez-flex--column ez-size-width--full" }, index.h("div", { class: "ez-flex" }, index.h("ez-tooltip", { message: this.getMessage("snkPersonalizedFilter.info.textInputDisabled"), active: this.isDefaultFilter }, index.h("ez-text-input", { class: "ez-padding-right--medium", label: this.getMessage("snkPersonalizedFilter.info.labelNameFilter"), value: (_b = this._filterAssistent) === null || _b === void 0 ? void 0 : _b.name, onEzChange: (evt) => this.handleTitleChange(evt.detail), enabled: !this.isDefaultFilter })), this.renderButtonAddField(), index.h("ez-button", { ref: (el) => this._elButtonMode = el, class: "snk-personalized-filter__button-mode", label: this._filterAssistentMode ? this.getMessage("snkPersonalizedFilter.info.activeModeAdvanced") : this.getMessage("snkPersonalizedFilter.info.activeModeAssistent"), onClick: () => this.handleModeChange(), "data-tooltip": !(this._filterAssistentMode || ((_c = this._filterAssistent) === null || _c === void 0 ? void 0 : _c.assistent)) ? this.getMessage("snkPersonalizedFilter.info.tooltipDisabledAssistentMode") : undefined, "data-flow": "bottom", enabled: (!this._filterAssistent.name || Boolean(this._filterAssistentMode || ((_d = this._filterAssistent) === null || _d === void 0 ? void 0 : _d.assistent))) })), this.buildContainerPersonalizedFilter()))))));
|
|
351
|
-
}
|
|
352
|
-
static get watchers() { return {
|
|
353
|
-
"filterId": ["loadFilter"]
|
|
354
|
-
}; }
|
|
355
|
-
};
|
|
356
|
-
SnkPersonalizedFilter.style = snkPersonalizedFilterCss;
|
|
357
|
-
|
|
358
|
-
exports.snk_personalized_filter = SnkPersonalizedFilter;
|