@sankhyalabs/sankhyablocks 10.1.0-dev.51 → 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-293bc3d2.js → SnkMultiSelectionListDataSource-0bc94d36.js} +71 -24
- 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 -229
- 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 +16 -11
- 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-b4ca3437.js → snk-guides-viewer-3054d541.js} +2 -2
- 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-crud/subcomponents/snk-detail-view/snk-detail-view.css +4 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +6 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +1 -1
- package/dist/collection/components/snk-crud/utils/taskbarUtils.js +14 -0
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +67 -20
- 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 +14 -7
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +22 -4
- package/dist/components/ContinuousInsertUtils.js +67 -20
- 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 -198
- package/dist/components/snk-detail-view2.js +8 -2
- 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-f6cabd15.js → SnkMultiSelectionListDataSource-9e9166ae.js} +71 -24
- 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 -204
- 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 +14 -9
- 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-cc37535b.js → snk-guides-viewer-95fefcaa.js} +2 -2
- 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-2c00b93d.js +1 -0
- 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-771b137e.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-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +1 -0
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +8 -0
- 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-0afc64df.entry.js +0 -1
- package/dist/sankhyablocks/p-10f27dc6.entry.js +0 -1
- package/dist/sankhyablocks/p-134702f6.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-33492640.entry.js +0 -1
- package/dist/sankhyablocks/p-3870748a.js +0 -28
- 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-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-95b36bd3.entry.js +0 -1
- package/dist/sankhyablocks/p-9e77e136.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-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-e8df1dea.entry.js +0 -1
- package/dist/sankhyablocks/p-ef9343c3.entry.js +0 -1
- package/dist/sankhyablocks/p-f1bbf065.entry.js +0 -1
- package/dist/sankhyablocks/p-f4184ce7.js +0 -1
- package/dist/sankhyablocks/p-fec88660.entry.js +0 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, forceUpdate, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { g as getIconName, d as defineCustomElement$1 } from './snk-dynaform-field-config2.js';
|
|
3
|
+
|
|
4
|
+
const snkDynaformFieldItemCss = ".sc-snk-dynaform-field-item-h{width:100%;display:flex;padding:12px 8px;border-radius:var(--border--radius-small, 4px);border:1px solid #dce0e8;cursor:grab;align-items:center;height:42px;max-height:42px;background:#FAFCFF}.full-width.sc-snk-dynaform-field-item-h{width:100%}ez-icon.sc-snk-dynaform-field-item{--ez-icon--color:#A2ABB9}.icons.sc-snk-dynaform-field-item{display:flex}.label.sc-snk-dynaform-field-item{display:flex;flex-grow:1;padding-left:8px;font-size:14px;align-items:center;gap:4px;height:22px}.label-text.sc-snk-dynaform-field-item{overflow:hidden;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;height:auto;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;display:-webkit-box;-o-text-overflow:ellipsis;text-overflow:ellipsis;word-break:break-word}.required-mark.sc-snk-dynaform-field-item{color:#cf3105;background:#F7E0E5;width:12px;height:12px;border-radius:50%;display:flex;align-items:center;justify-content:center;padding-top:5px;font-size:16px;align-self:self-start}.actions.sc-snk-dynaform-field-item{display:flex;flex-direction:row;align-content:center;gap:4px}ez-button.sc-snk-dynaform-field-item{width:24px;align-items:center;justify-content:center;display:flex}.sc-snk-dynaform-field-item-h .hiddeble.sc-snk-dynaform-field-item{transition:0.2s ease-in-out;visibility:hidden;opacity:0}.sc-snk-dynaform-field-item-h:hover .hiddeble.sc-snk-dynaform-field-item{visibility:visible;opacity:1}";
|
|
5
|
+
|
|
6
|
+
const SnkDynaformFieldItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.setFieldAsAvailable = createEvent(this, "setFieldAsAvailable", 7);
|
|
11
|
+
this.addFieldToGuide = createEvent(this, "addFieldToGuide", 7);
|
|
12
|
+
this.fieldDescriptor = undefined;
|
|
13
|
+
this.fieldConfig = undefined;
|
|
14
|
+
this.onLayoutConfig = false;
|
|
15
|
+
this.dataUnit = undefined;
|
|
16
|
+
this.messagesBuilder = undefined;
|
|
17
|
+
}
|
|
18
|
+
observeDataUnit() {
|
|
19
|
+
this.loadFieldDescriptor();
|
|
20
|
+
}
|
|
21
|
+
isRequired() {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
const fieldMD = this.dataUnit && this.dataUnit.getField((_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.name);
|
|
24
|
+
return (fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.required) === true || ((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.required) === true;
|
|
25
|
+
}
|
|
26
|
+
async showFieldConfig() {
|
|
27
|
+
var _a;
|
|
28
|
+
await ((_a = this._refFieldConfig) === null || _a === void 0 ? void 0 : _a.show(this._editIconRef));
|
|
29
|
+
}
|
|
30
|
+
renderFieldConfig() {
|
|
31
|
+
if (this.onLayoutConfig && this.dataUnit && this.messagesBuilder) {
|
|
32
|
+
return (h("snk-dynaform-field-config", { ref: (ref) => this._refFieldConfig = ref, fieldConfig: this.fieldConfig, dataUnit: this.dataUnit, fieldDescriptor: this.fieldDescriptor, messagesBuilder: this.messagesBuilder, onFieldConfigChanged: () => forceUpdate(this) }));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
getMessage(key, params) {
|
|
36
|
+
return this.messagesBuilder.getMessage(key, params);
|
|
37
|
+
}
|
|
38
|
+
renderActions() {
|
|
39
|
+
if (this.onLayoutConfig) {
|
|
40
|
+
return (h("div", { class: 'actions hiddeble' }, h("ez-button", { mode: "icon", class: "ez-button--tertiary", onClick: () => this.setFieldAsAvailable.emit(this.fieldConfig), size: "medium", iconName: 'minus', title: this.getMessage('snkFieldConfig.titleRemove') }), h("ez-button", { ref: ref => this._editIconRef = ref, mode: "icon", class: "ez-button--tertiary", onClick: this.showFieldConfig.bind(this), iconName: 'edit', size: "medium", title: this.getMessage('snkFieldConfig.titleEdit') })));
|
|
41
|
+
}
|
|
42
|
+
return (h("div", { class: 'actions hiddeble' }, h("ez-button", { mode: "icon", class: "ez-button--tertiary", onClick: () => this.addFieldToGuide.emit(this.fieldConfig), iconName: 'plus', size: "medium", title: this.getMessage('snkFieldConfig.titleAddToLayout') })));
|
|
43
|
+
}
|
|
44
|
+
loadFieldDescriptor() {
|
|
45
|
+
if (this.dataUnit) {
|
|
46
|
+
this.fieldDescriptor = this.dataUnit.getField(this.fieldConfig.name);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
renderRequiredMark() {
|
|
50
|
+
if (this.isRequired())
|
|
51
|
+
return h("span", { class: 'required-mark' }, "*");
|
|
52
|
+
}
|
|
53
|
+
componentWillLoad() {
|
|
54
|
+
this.loadFieldDescriptor();
|
|
55
|
+
}
|
|
56
|
+
getFieldLabel() {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
if ((_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.label)
|
|
59
|
+
return this.fieldConfig.label;
|
|
60
|
+
return (_b = this.fieldDescriptor) === null || _b === void 0 ? void 0 : _b.label;
|
|
61
|
+
}
|
|
62
|
+
render() {
|
|
63
|
+
var _a;
|
|
64
|
+
return (h(Host, { class: !this.onLayoutConfig ? 'full-width' : "" }, h("div", { class: 'icons' }, h("ez-icon", { iconName: "drag-indicator" }), h("ez-icon", { iconName: getIconName((_a = this.fieldDescriptor) === null || _a === void 0 ? void 0 : _a.userInterface) })), h("span", { class: 'label' }, h("span", { class: 'label-text', title: this.getFieldLabel() }, this.getFieldLabel()), this.renderRequiredMark()), this.renderActions(), this.renderFieldConfig()));
|
|
65
|
+
}
|
|
66
|
+
static get watchers() { return {
|
|
67
|
+
"dataUnit": ["observeDataUnit"]
|
|
68
|
+
}; }
|
|
69
|
+
static get style() { return snkDynaformFieldItemCss; }
|
|
70
|
+
}, [2, "snk-dynaform-field-item", {
|
|
71
|
+
"fieldConfig": [8, "field-config"],
|
|
72
|
+
"onLayoutConfig": [4, "on-layout-config"],
|
|
73
|
+
"dataUnit": [16],
|
|
74
|
+
"messagesBuilder": [1040],
|
|
75
|
+
"fieldDescriptor": [32]
|
|
76
|
+
}]);
|
|
77
|
+
function defineCustomElement() {
|
|
78
|
+
if (typeof customElements === "undefined") {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const components = ["snk-dynaform-field-item", "snk-dynaform-field-config"];
|
|
82
|
+
components.forEach(tagName => { switch (tagName) {
|
|
83
|
+
case "snk-dynaform-field-item":
|
|
84
|
+
if (!customElements.get(tagName)) {
|
|
85
|
+
customElements.define(tagName, SnkDynaformFieldItem);
|
|
86
|
+
}
|
|
87
|
+
break;
|
|
88
|
+
case "snk-dynaform-field-config":
|
|
89
|
+
if (!customElements.get(tagName)) {
|
|
90
|
+
defineCustomElement$1();
|
|
91
|
+
}
|
|
92
|
+
break;
|
|
93
|
+
} });
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { SnkDynaformFieldItem as S, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkDynaformFieldsLayout extends Components.SnkDynaformFieldsLayout, HTMLElement {}
|
|
4
|
+
export const SnkDynaformFieldsLayout: {
|
|
5
|
+
prototype: SnkDynaformFieldsLayout;
|
|
6
|
+
new (): SnkDynaformFieldsLayout;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { S as SnkDynaformFieldsLayout$1, d as defineCustomElement$1 } from './snk-dynaform-fields-layout2.js';
|
|
2
|
+
|
|
3
|
+
const SnkDynaformFieldsLayout = SnkDynaformFieldsLayout$1;
|
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
|
5
|
+
|
|
6
|
+
export { SnkDynaformFieldsLayout, defineCustomElement };
|
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { StringUtils, ObjectUtils } from '@sankhyalabs/core';
|
|
3
|
+
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
|
+
import { S as Sortable } from './sortable.esm.js';
|
|
5
|
+
import { T as TAB_NAMES, G as GROUP_NAMES } from './constants.js';
|
|
6
|
+
import { a as SORTABLE_PATH, b as getFieldsStructure, d as defineCustomElement$2, I as ID_AVAILABLE_FIELDS } from './snk-dynaform-field-config2.js';
|
|
7
|
+
import { d as defineCustomElement$1 } from './snk-dynaform-field-item2.js';
|
|
8
|
+
|
|
9
|
+
const snkDynaformFieldsLayoutCss = ".sc-snk-dynaform-fields-layout-h{display:flex;padding:12px;box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));border-radius:var(--border--radius-medium, 6px);height:100%;min-height:0;flex-direction:column;box-sizing:border-box}.is-main-section.sc-snk-dynaform-fields-layout-h{height:100%;border:1px solid var(--color--gray-90, #EAEAEA);flex:1 1 auto;min-height:0;flex-direction:row;overflow:auto}.is-main-section.sc-snk-dynaform-fields-layout-h .layout-container.sc-snk-dynaform-fields-layout{flex:1 1 auto;min-height:0;width:100%}.layout-container.sc-snk-dynaform-fields-layout{container-type:inline-size;display:flex;flex-direction:column;overflow:hidden;flex:1 1 auto;min-height:0;width:100%}.layout-container.sc-snk-dynaform-fields-layout>ez-scroller.sc-snk-dynaform-fields-layout{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}.guide-header.sc-snk-dynaform-fields-layout{display:flex;width:100%;font-size:20px;border-bottom:1px solid #dce0e8;margin-bottom:6px;align-items:center;height:45px}.guide-header.sc-snk-dynaform-fields-layout ez-button.sc-snk-dynaform-fields-layout{transition:all 0.2s ease-in-out;visibility:hidden;opacity:0}.guide-header.sc-snk-dynaform-fields-layout:hover ez-button.sc-snk-dynaform-fields-layout{visibility:visible;opacity:1}.guide-header-label.sc-snk-dynaform-fields-layout{display:block;padding:10px 0}.group-config.sc-snk-dynaform-fields-layout{padding:12px 0;display:flex;flex-direction:column;width:100%}.group-content.sc-snk-dynaform-fields-layout{display:grid;gap:12px;min-height:65px;width:100%;padding:6px 0;grid-template-columns:repeat(auto-fill, minmax(250px, 1fr))}.group-content.empty-content.sc-snk-dynaform-fields-layout{position:relative}.group-content.empty-content.sc-snk-dynaform-fields-layout::before{content:var(--empty-content-message, \"Arraste e solte um campo aqui\");color:#cbcfd7;font-size:16px;font-weight:500;text-align:center;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;transition:opacity 0.3s;height:100%;box-sizing:border-box;padding:10px;background:#f9f9f9;border:1px dashed #dce0e8;border-radius:6px}.no-group-container.sc-snk-dynaform-fields-layout{padding:12px 0;width:100%;border-bottom:1px solid #dce0e8}.no-group-container.sc-snk-dynaform-fields-layout::before{content:var(--no-group-message, \"Inclua estes campos nos grupos ou deixe-os separados no topo do formulário\");width:100%;display:block;font-size:16px;font-weight:400;color:#AFB6C0;padding-bottom:12px}.add-group-container.sc-snk-dynaform-fields-layout{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;padding-bottom:12px;gap:6px;cursor:pointer;justify-content:center;width:100%;height:55px}.no-guide-selected.sc-snk-dynaform-fields-layout{display:block;margin:auto;font-size:24px;color:#AFB6C0;font-weight:500}.message-container.sc-snk-dynaform-fields-layout{margin:auto;display:flex;flex-direction:column;justify-content:center;align-items:center}.message-config-detail.sc-snk-dynaform-fields-layout{display:block;margin:auto;font-size:var(--font-size--medium, 16px);color:#AFB6C0;font-weight:var(--font-weight--medium, 500)}.ghost.sc-snk-dynaform-fields-layout{opacity:.5;background:#c8fbe2}";
|
|
10
|
+
|
|
11
|
+
const SnkDynaformFieldsLayout = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.__registerHost();
|
|
15
|
+
this.isEditingGuideName = createEvent(this, "isEditingGuideName", 7);
|
|
16
|
+
this.isEditingGroupName = createEvent(this, "isEditingGroupName", 7);
|
|
17
|
+
this.layoutChanged = createEvent(this, "layoutChanged", 7);
|
|
18
|
+
this.setFieldListAsAvailable = createEvent(this, "setFieldListAsAvailable", 7);
|
|
19
|
+
this.guideRenamed = createEvent(this, "guideRenamed", 7);
|
|
20
|
+
this.ID_GROUPS = 'container-groups';
|
|
21
|
+
this.ID_FIELDS = 'container-fields';
|
|
22
|
+
this.reservedGuideNames = [TAB_NAMES.main.toLowerCase(), TAB_NAMES.general.toLocaleLowerCase()];
|
|
23
|
+
this.groupsListMemory = [];
|
|
24
|
+
this.groupsRefList = [];
|
|
25
|
+
this.sortableInstances = [];
|
|
26
|
+
this.isEditGuideNameActive = false;
|
|
27
|
+
this.selectedGuide = undefined;
|
|
28
|
+
this.groupsList = [];
|
|
29
|
+
this.guideNames = [];
|
|
30
|
+
this.dataUnit = undefined;
|
|
31
|
+
this.isMainSection = false;
|
|
32
|
+
this.messagesBuilder = undefined;
|
|
33
|
+
}
|
|
34
|
+
onMessagesBuilderChange() {
|
|
35
|
+
this.setCustomCSSProperties();
|
|
36
|
+
}
|
|
37
|
+
handleFieldConfigChanged({ detail: updatedField }) {
|
|
38
|
+
var _a;
|
|
39
|
+
if (((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.name) && updatedField.tab && updatedField.tab !== this.selectedGuide.name) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const groupToUpdate = this.groupsListMemory.find(g => g.name === updatedField.group);
|
|
43
|
+
if (!groupToUpdate)
|
|
44
|
+
return;
|
|
45
|
+
const updatedFields = groupToUpdate.fields.map(field => {
|
|
46
|
+
return (field.name === updatedField.name) ? updatedField : field;
|
|
47
|
+
});
|
|
48
|
+
const updatedGroupList = this.groupsListMemory.map(group => {
|
|
49
|
+
return (group.name === groupToUpdate.name)
|
|
50
|
+
? { name: group.name, fields: updatedFields }
|
|
51
|
+
: group;
|
|
52
|
+
});
|
|
53
|
+
this.applyGroupUpdate(updatedGroupList);
|
|
54
|
+
}
|
|
55
|
+
observeSelectedGuide() {
|
|
56
|
+
this.isEditGuideNameActive = false;
|
|
57
|
+
forceUpdate(this);
|
|
58
|
+
this.isEditingGroupName.emit(false);
|
|
59
|
+
}
|
|
60
|
+
observeGroupList(newValue) {
|
|
61
|
+
this.groupsListMemory = [...newValue];
|
|
62
|
+
}
|
|
63
|
+
observeIsEditGuideNameActive(newValue) {
|
|
64
|
+
this.isEditingGuideName.emit(newValue);
|
|
65
|
+
}
|
|
66
|
+
async addFieldToLayout(incomingField) {
|
|
67
|
+
incomingField.group = GROUP_NAMES.noGroup;
|
|
68
|
+
incomingField.tab = this.selectedGuide.name;
|
|
69
|
+
const fixedFieldsGroup = this.getFixedFieldsGroup();
|
|
70
|
+
const newFixedFieldsGroup = {
|
|
71
|
+
name: GROUP_NAMES.noGroup,
|
|
72
|
+
fields: fixedFieldsGroup ? [...fixedFieldsGroup.fields, incomingField] : [incomingField],
|
|
73
|
+
};
|
|
74
|
+
const updatedGroupListMemory = fixedFieldsGroup
|
|
75
|
+
? [newFixedFieldsGroup, ...this.groupsListMemory.slice(1)]
|
|
76
|
+
: [newFixedFieldsGroup, ...this.groupsListMemory];
|
|
77
|
+
this.applyGroupUpdate(updatedGroupListMemory);
|
|
78
|
+
}
|
|
79
|
+
getFixedFieldsGroup() {
|
|
80
|
+
return this.groupsListMemory.find(g => g.name === GROUP_NAMES.noGroup);
|
|
81
|
+
}
|
|
82
|
+
getMessage(key, params) {
|
|
83
|
+
return this.messagesBuilder.getMessage(key, params);
|
|
84
|
+
}
|
|
85
|
+
handleAddGroup() {
|
|
86
|
+
const newGroup = { name: this.buildNewGroupName(), fields: [] };
|
|
87
|
+
const updatedGroupsList = [...this.groupsListMemory, newGroup];
|
|
88
|
+
this.applyGroupUpdate(updatedGroupsList);
|
|
89
|
+
}
|
|
90
|
+
buildNewGroupName() {
|
|
91
|
+
var _a, _b;
|
|
92
|
+
const newGroupMessage = this.getMessage('snkFormConfig.form.newGroup');
|
|
93
|
+
const qtdWithNewGroupName = (_b = (_a = this.groupsListMemory.filter(g => g.name.includes(newGroupMessage))) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
94
|
+
return qtdWithNewGroupName === 0 ? newGroupMessage : `${newGroupMessage} (${qtdWithNewGroupName})`;
|
|
95
|
+
}
|
|
96
|
+
makeDynamicFieldsContainersDraggable() {
|
|
97
|
+
const draggableGroups = this.groupsList.filter((g) => g.name !== GROUP_NAMES.noGroup);
|
|
98
|
+
draggableGroups.forEach(group => {
|
|
99
|
+
this.makeFieldContainerDraggable(this.getFieldsContainerId(group.name));
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
getInstanceSuffix() {
|
|
103
|
+
var _a, _b;
|
|
104
|
+
return StringUtils.replaceBlankCharacters((_b = (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '');
|
|
105
|
+
}
|
|
106
|
+
getGroupsContainerId() {
|
|
107
|
+
return `${this.ID_GROUPS}-${this.getInstanceSuffix()}`;
|
|
108
|
+
}
|
|
109
|
+
getNoGroupContainerId() {
|
|
110
|
+
return `${GROUP_NAMES.noGroup}-${this.getInstanceSuffix()}`;
|
|
111
|
+
}
|
|
112
|
+
getFieldsContainerId(groupName) {
|
|
113
|
+
return `${this.ID_FIELDS}-${this.getInstanceSuffix()}-${StringUtils.replaceBlankCharacters(groupName)}`;
|
|
114
|
+
}
|
|
115
|
+
handleSortGroups(evt) {
|
|
116
|
+
var _a;
|
|
117
|
+
const htmlStructure = (_a = evt.to) === null || _a === void 0 ? void 0 : _a.children;
|
|
118
|
+
if (!htmlStructure)
|
|
119
|
+
return;
|
|
120
|
+
const groupsOrder = Array.from(htmlStructure).map(el => el.getAttribute('data-group-name'));
|
|
121
|
+
const updatedOrderGroupsList = [];
|
|
122
|
+
const fixedGroup = this.getFixedFieldsGroup();
|
|
123
|
+
if (fixedGroup) {
|
|
124
|
+
updatedOrderGroupsList.push(fixedGroup);
|
|
125
|
+
}
|
|
126
|
+
groupsOrder.forEach(groupName => {
|
|
127
|
+
const group = this.groupsListMemory.find(g => g.name === groupName);
|
|
128
|
+
if (group) {
|
|
129
|
+
updatedOrderGroupsList.push(group);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
this.applyGroupUpdate(updatedOrderGroupsList);
|
|
133
|
+
}
|
|
134
|
+
handleFieldsChanged(evt) {
|
|
135
|
+
let updatedGroupsList = [...this.groupsListMemory];
|
|
136
|
+
updatedGroupsList = [...this.handleFieldsOnGroupUpdate(updatedGroupsList, evt, SORTABLE_PATH.FROM)];
|
|
137
|
+
updatedGroupsList = [...this.handleFieldsOnGroupUpdate(updatedGroupsList, evt, SORTABLE_PATH.TO)];
|
|
138
|
+
this.applyGroupUpdate(updatedGroupsList);
|
|
139
|
+
}
|
|
140
|
+
applyGroupUpdate(updatedGroupList) {
|
|
141
|
+
var _a;
|
|
142
|
+
(_a = this.groupsRefList) === null || _a === void 0 ? void 0 : _a.forEach((group) => group === null || group === void 0 ? void 0 : group.cancelEdition());
|
|
143
|
+
if (ObjectUtils.equals(updatedGroupList, this.groupsListMemory)) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
this.groupsListMemory = [...updatedGroupList];
|
|
147
|
+
this.layoutChanged.emit(this.groupsListMemory);
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
handleFieldsOnGroupUpdate(groupList, evt, path) {
|
|
151
|
+
const element = evt[path];
|
|
152
|
+
if (!this.el.contains(element))
|
|
153
|
+
return groupList;
|
|
154
|
+
const isAvailableFields = element.id === ID_AVAILABLE_FIELDS;
|
|
155
|
+
return isAvailableFields ? groupList : this.updateGroupList(groupList, element, path, evt);
|
|
156
|
+
}
|
|
157
|
+
updateGroupList(groupList, element, path, evt) {
|
|
158
|
+
const groupName = element.getAttribute('data-group-name');
|
|
159
|
+
const updatedGroup = {
|
|
160
|
+
name: groupName,
|
|
161
|
+
fields: getFieldsStructure(evt, path, groupName, this.selectedGuide.name),
|
|
162
|
+
};
|
|
163
|
+
return this.upsertGroup(groupList, updatedGroup);
|
|
164
|
+
}
|
|
165
|
+
upsertGroup(groupList, newGroup) {
|
|
166
|
+
if (groupList.some(group => group.name === newGroup.name)) {
|
|
167
|
+
return this.replaceGroup(groupList, newGroup);
|
|
168
|
+
}
|
|
169
|
+
return newGroup.name === GROUP_NAMES.noGroup
|
|
170
|
+
? [newGroup, ...groupList]
|
|
171
|
+
: [...groupList, newGroup];
|
|
172
|
+
}
|
|
173
|
+
replaceGroup(groupList, newGroup) {
|
|
174
|
+
return groupList.map(group => group.name === newGroup.name ? newGroup : group);
|
|
175
|
+
}
|
|
176
|
+
destroySortableInstances() {
|
|
177
|
+
this.sortableInstances.forEach(instance => {
|
|
178
|
+
var _a;
|
|
179
|
+
try {
|
|
180
|
+
(_a = instance === null || instance === void 0 ? void 0 : instance.destroy) === null || _a === void 0 ? void 0 : _a.call(instance);
|
|
181
|
+
}
|
|
182
|
+
catch ( /* noop */_b) { /* noop */ }
|
|
183
|
+
});
|
|
184
|
+
this.sortableInstances = [];
|
|
185
|
+
}
|
|
186
|
+
makeGroupsDraggable() {
|
|
187
|
+
try {
|
|
188
|
+
const element = this.getContainerElement(this.getGroupsContainerId());
|
|
189
|
+
if (!element)
|
|
190
|
+
return;
|
|
191
|
+
this.sortableInstances.push(new Sortable(element, {
|
|
192
|
+
group: 'groups',
|
|
193
|
+
ghostClass: 'ghost',
|
|
194
|
+
direction: 'horizontal',
|
|
195
|
+
animation: 15,
|
|
196
|
+
onSort: (evt) => this.handleSortGroups(evt),
|
|
197
|
+
}));
|
|
198
|
+
}
|
|
199
|
+
catch (e) {
|
|
200
|
+
console.error(this.getMessage('snkFormConfig.errors.failMakeGroupsDraggable'), this.getGroupsContainerId());
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
makeFieldContainerDraggable(containerId) {
|
|
204
|
+
try {
|
|
205
|
+
const element = this.getContainerElement(containerId);
|
|
206
|
+
if (!element)
|
|
207
|
+
return;
|
|
208
|
+
this.sortableInstances.push(new Sortable(element, {
|
|
209
|
+
group: 'fields',
|
|
210
|
+
ghostClass: 'ghost',
|
|
211
|
+
direction: 'vertical',
|
|
212
|
+
animation: 15,
|
|
213
|
+
onAdd: (evt) => this.handleFieldsChanged(evt),
|
|
214
|
+
onRemove: (evt) => this.handleFieldsChanged(evt),
|
|
215
|
+
onSort: (evt) => this.handleFieldsChanged(evt),
|
|
216
|
+
}));
|
|
217
|
+
}
|
|
218
|
+
catch (e) {
|
|
219
|
+
console.error(this.getMessage('snkFormConfig.errors.failMakeFieldContainerDraggable'), containerId);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
getContainerElement(id) {
|
|
223
|
+
return this.el.querySelector(`[id="${id}"]`);
|
|
224
|
+
}
|
|
225
|
+
handleSetFieldAsAvailable(field) {
|
|
226
|
+
var _a;
|
|
227
|
+
const groupName = (_a = field.group) !== null && _a !== void 0 ? _a : GROUP_NAMES.noGroup;
|
|
228
|
+
const group = this.groupsListMemory.find(group => group.name === groupName);
|
|
229
|
+
const fields = group.fields.filter(f => f.name !== field.name);
|
|
230
|
+
const updatedGroup = { name: groupName, fields };
|
|
231
|
+
const updatedList = [...this.replaceGroup(this.groupsListMemory, updatedGroup)];
|
|
232
|
+
this.applyGroupUpdate(updatedList);
|
|
233
|
+
}
|
|
234
|
+
removeGroup(group) {
|
|
235
|
+
var _a, _b;
|
|
236
|
+
const groupFields = (_b = (_a = this.groupsListMemory.find(f => f.name === group.name)) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : [];
|
|
237
|
+
const updatedGroupList = [...this.groupsListMemory.filter(g => g.name !== group.name)];
|
|
238
|
+
if (this.applyGroupUpdate(updatedGroupList)) {
|
|
239
|
+
this.setFieldListAsAvailable.emit(groupFields);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
handleRenameGroup(editDetails) {
|
|
243
|
+
const { value: actualName, newValue: newGroupName } = editDetails.detail;
|
|
244
|
+
const updatedGroupList = this.groupsListMemory.map(group => {
|
|
245
|
+
if (group.name !== actualName)
|
|
246
|
+
return Object.assign({}, group);
|
|
247
|
+
const updatedFields = group.fields.map(f => {
|
|
248
|
+
return Object.assign(Object.assign({}, f), { group: newGroupName });
|
|
249
|
+
});
|
|
250
|
+
return { name: newGroupName, fields: updatedFields };
|
|
251
|
+
});
|
|
252
|
+
this.applyGroupUpdate(updatedGroupList);
|
|
253
|
+
}
|
|
254
|
+
canSaveGroup(newLabel, index) {
|
|
255
|
+
const hasOtherWithThisName = this.groupsList.some(group => {
|
|
256
|
+
var _a;
|
|
257
|
+
return ((_a = group.name) !== null && _a !== void 0 ? _a : '').toLocaleLowerCase() === (newLabel !== null && newLabel !== void 0 ? newLabel : '').toLocaleLowerCase();
|
|
258
|
+
});
|
|
259
|
+
if (!hasOtherWithThisName)
|
|
260
|
+
return true;
|
|
261
|
+
const title = this.getMessage('snkFormConfig.confirm.title');
|
|
262
|
+
const message = this.buildDuplicatedGroupNameContent(newLabel);
|
|
263
|
+
ApplicationUtils.alert(title, message).then(() => { var _a; return (_a = this.groupsRefList[index]) === null || _a === void 0 ? void 0 : _a.applyFocusTextEdit(); });
|
|
264
|
+
return false;
|
|
265
|
+
}
|
|
266
|
+
buildDuplicatedGroupNameContent(newLabel) {
|
|
267
|
+
const tabName = this.selectedGuide.name;
|
|
268
|
+
return `
|
|
269
|
+
${this.getMessage('snkFormConfig.alert.titleGroupExists')}
|
|
270
|
+
<b>${newLabel}</b>
|
|
271
|
+
${this.getMessage('snkFormConfig.alert.inTab')}
|
|
272
|
+
<b>${tabName === TAB_NAMES.main ? this.getMessage('snkFormConfig.form.mainArea') : tabName}</b>.
|
|
273
|
+
<br/><br/>
|
|
274
|
+
${this.getMessage('snkFormConfig.alert.infoValidTitle')}
|
|
275
|
+
`;
|
|
276
|
+
}
|
|
277
|
+
buildDuplicatedTabNameContent(newLabel) {
|
|
278
|
+
return `
|
|
279
|
+
${this.getMessage('snkFormConfig.alert.titleGuideExists')}
|
|
280
|
+
<b>${newLabel}</b>.
|
|
281
|
+
<br/><br/>
|
|
282
|
+
${this.getMessage('snkFormConfig.alert.infoValidTitle')}
|
|
283
|
+
`;
|
|
284
|
+
}
|
|
285
|
+
buildReservedTabNameContent(newLabel) {
|
|
286
|
+
return `
|
|
287
|
+
${this.getMessage('snkFormConfig.alert.titleGuideReservedName')}
|
|
288
|
+
<br/><br/>
|
|
289
|
+
<b>${newLabel}</b>.
|
|
290
|
+
<br/><br/>
|
|
291
|
+
${this.getMessage('snkFormConfig.alert.infoValidTitle')}
|
|
292
|
+
`;
|
|
293
|
+
}
|
|
294
|
+
renderFields(fields) {
|
|
295
|
+
if (fields.length === 0)
|
|
296
|
+
return;
|
|
297
|
+
return fields.map(field => (h("snk-dynaform-field-item", { key: field.name, fieldConfig: field, onLayoutConfig: true, dataUnit: this.dataUnit, messagesBuilder: this.messagesBuilder, onSetFieldAsAvailable: (e) => this.handleSetFieldAsAvailable(e.detail) })));
|
|
298
|
+
}
|
|
299
|
+
renderDraggableGroups() {
|
|
300
|
+
const draggableGroups = this.groupsList.filter(g => g.name !== GROUP_NAMES.noGroup);
|
|
301
|
+
return (draggableGroups.map((group, index) => {
|
|
302
|
+
var _a;
|
|
303
|
+
return (h("div", { key: group.name, class: 'group-config', "data-group-name": group.name }, h("ez-collapsible-box", { ref: ref => this.groupsRefList[index] = ref, label: group.name, headerSize: "large", editable: true, removable: true, "icon-placement": "left", onEzRemove: () => this.removeGroup(group), onEzSaveEditLabel: (event => this.handleRenameGroup(event)), onEzEditLabelMode: ({ detail }) => this.isEditingGroupName.emit(detail), conditionalSave: (newLabel) => this.canSaveGroup(newLabel, index) }, h("div", { id: this.getFieldsContainerId(group.name), class: `group-content ${!((_a = group.fields) === null || _a === void 0 ? void 0 : _a.length) ? 'empty-content' : ''}`, "data-group-name": group.name }, this.renderFields(group.fields)))));
|
|
304
|
+
}));
|
|
305
|
+
}
|
|
306
|
+
renderFixedFields() {
|
|
307
|
+
var _a, _b;
|
|
308
|
+
const noGroupFields = (_b = (_a = this.groupsList.find(g => g.name === GROUP_NAMES.noGroup)) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : [];
|
|
309
|
+
return this.renderFields(noGroupFields);
|
|
310
|
+
}
|
|
311
|
+
handleRenameGuide(editDetails) {
|
|
312
|
+
const { value: actualValue, newValue } = editDetails.detail;
|
|
313
|
+
this.isEditGuideNameActive = false;
|
|
314
|
+
if (newValue === actualValue) {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
const duplicatedName = this.guideNames.includes(newValue.toLowerCase());
|
|
318
|
+
const forbiddenName = this.reservedGuideNames.includes(newValue.toLowerCase());
|
|
319
|
+
if (forbiddenName || duplicatedName) {
|
|
320
|
+
const title = this.getMessage('snkFormConfig.confirm.title');
|
|
321
|
+
const message = forbiddenName ? this.buildReservedTabNameContent(newValue) : this.buildDuplicatedTabNameContent(newValue);
|
|
322
|
+
ApplicationUtils.alert(title, message).then(() => this._refTextEdit.applyFocusSelect());
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
this.guideRenamed.emit(newValue);
|
|
326
|
+
}
|
|
327
|
+
cancelEditGuideName() {
|
|
328
|
+
this.isEditGuideNameActive = false;
|
|
329
|
+
}
|
|
330
|
+
async startGuideNameEdition() {
|
|
331
|
+
this.isEditGuideNameActive = true;
|
|
332
|
+
setTimeout(async () => {
|
|
333
|
+
await this._refTextEdit.applyFocusSelect();
|
|
334
|
+
}, 200);
|
|
335
|
+
}
|
|
336
|
+
getTextEditStyle() {
|
|
337
|
+
return {
|
|
338
|
+
fontSize: '20px',
|
|
339
|
+
fontWeight: '500',
|
|
340
|
+
fontFamily: 'Roboto',
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
renderGuideName() {
|
|
344
|
+
var _a, _b;
|
|
345
|
+
if (this.isEditGuideNameActive) {
|
|
346
|
+
return (h("div", { class: 'guide-header' }, h("ez-text-edit", { class: "collapsible-box__text-edit", ref: ref => this._refTextEdit = ref, value: (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.label, styled: this.getTextEditStyle(), onSaveEdition: (ev) => this.handleRenameGuide(ev), onCancelEdition: () => this.cancelEditGuideName() })));
|
|
347
|
+
}
|
|
348
|
+
return (h("div", { class: 'guide-header' }, h("span", { class: 'guide-header-label' }, (_b = this.selectedGuide) === null || _b === void 0 ? void 0 : _b.label), this.renderEditGuideNameButton()));
|
|
349
|
+
}
|
|
350
|
+
renderEditGuideNameButton() {
|
|
351
|
+
var _a;
|
|
352
|
+
if (this.isMainSection || ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.name) === TAB_NAMES.main)
|
|
353
|
+
return;
|
|
354
|
+
return (h("ez-button", { mode: "icon", class: "ez-button--tertiary", onClick: () => this.startGuideNameEdition(), size: "medium", iconName: 'edit', title: this.getMessage('snkFormConfig.buttons.rename') }));
|
|
355
|
+
}
|
|
356
|
+
setCustomCSSProperties() {
|
|
357
|
+
document.documentElement.style.setProperty('--empty-content-message', `"${this.getMessage('snkFormConfig.form.labelDropField')}"`);
|
|
358
|
+
document.documentElement.style.setProperty('--no-group-message', `"${this.getMessage('snkFormConfig.form.subTitleInfo')}"`);
|
|
359
|
+
}
|
|
360
|
+
componentWillLoad() {
|
|
361
|
+
var _a;
|
|
362
|
+
this.groupsListMemory = [...((_a = this.groupsList) !== null && _a !== void 0 ? _a : [])];
|
|
363
|
+
}
|
|
364
|
+
componentDidRender() {
|
|
365
|
+
this.destroySortableInstances();
|
|
366
|
+
this.makeGroupsDraggable();
|
|
367
|
+
this.makeDynamicFieldsContainersDraggable();
|
|
368
|
+
this.makeFieldContainerDraggable(this.getNoGroupContainerId());
|
|
369
|
+
this.setCustomCSSProperties();
|
|
370
|
+
}
|
|
371
|
+
disconnectedCallback() {
|
|
372
|
+
this.destroySortableInstances();
|
|
373
|
+
}
|
|
374
|
+
render() {
|
|
375
|
+
var _a;
|
|
376
|
+
if (!this.selectedGuide) {
|
|
377
|
+
return (h(Host, { class: 'ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container' }, h("span", { class: 'no-guide-selected' }, this.getMessage('snkFormConfig.form.noGuideSelected'))));
|
|
378
|
+
}
|
|
379
|
+
if (this.selectedGuide.isCustom || this.selectedGuide.isDetail) {
|
|
380
|
+
return (h(Host, { class: 'ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container' }, h("div", { class: 'message-container' }, h("h1", { class: 'no-guide-selected' }, this.getMessage('snkFormConfig.form.canNotEditCustomGuide')), h("span", { class: 'message-config-detail' }, this.getMessage('snkFormConfig.form.canNotEditDetailGuide')))));
|
|
381
|
+
}
|
|
382
|
+
const isMain = this.isMainSection || ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.name) === TAB_NAMES.main;
|
|
383
|
+
const hostClass = `ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container${isMain ? ' is-main-section' : ''}`;
|
|
384
|
+
return (h(Host, { class: hostClass }, this.renderGuideName(), h("div", { class: 'layout-container' }, h("ez-scroller", { direction: 'vertical', activeShadow: true }, h("div", { class: 'no-group-container' }, h("div", { id: this.getNoGroupContainerId(), class: 'group-content', "data-group-name": GROUP_NAMES.noGroup }, this.renderFixedFields())), h("hr", null), h("div", { id: this.getGroupsContainerId(), class: 'groups-container' }, this.renderDraggableGroups()))), h("div", { class: 'add-group-container', onClick: this.handleAddGroup.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus" }), h("span", null, this.getMessage('snkFormConfig.form.createNewGroup')))));
|
|
385
|
+
}
|
|
386
|
+
get el() { return this; }
|
|
387
|
+
static get watchers() { return {
|
|
388
|
+
"messagesBuilder": ["onMessagesBuilderChange"],
|
|
389
|
+
"selectedGuide": ["observeSelectedGuide"],
|
|
390
|
+
"groupsList": ["observeGroupList"],
|
|
391
|
+
"isEditGuideNameActive": ["observeIsEditGuideNameActive"]
|
|
392
|
+
}; }
|
|
393
|
+
static get style() { return snkDynaformFieldsLayoutCss; }
|
|
394
|
+
}, [2, "snk-dynaform-fields-layout", {
|
|
395
|
+
"selectedGuide": [16],
|
|
396
|
+
"groupsList": [16],
|
|
397
|
+
"guideNames": [16],
|
|
398
|
+
"dataUnit": [16],
|
|
399
|
+
"isMainSection": [4, "is-main-section"],
|
|
400
|
+
"messagesBuilder": [1040],
|
|
401
|
+
"isEditGuideNameActive": [32],
|
|
402
|
+
"addFieldToLayout": [64]
|
|
403
|
+
}, [[16, "fieldConfigChanged", "handleFieldConfigChanged"]]]);
|
|
404
|
+
function defineCustomElement() {
|
|
405
|
+
if (typeof customElements === "undefined") {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
const components = ["snk-dynaform-fields-layout", "snk-dynaform-field-config", "snk-dynaform-field-item"];
|
|
409
|
+
components.forEach(tagName => { switch (tagName) {
|
|
410
|
+
case "snk-dynaform-fields-layout":
|
|
411
|
+
if (!customElements.get(tagName)) {
|
|
412
|
+
customElements.define(tagName, SnkDynaformFieldsLayout);
|
|
413
|
+
}
|
|
414
|
+
break;
|
|
415
|
+
case "snk-dynaform-field-config":
|
|
416
|
+
if (!customElements.get(tagName)) {
|
|
417
|
+
defineCustomElement$2();
|
|
418
|
+
}
|
|
419
|
+
break;
|
|
420
|
+
case "snk-dynaform-field-item":
|
|
421
|
+
if (!customElements.get(tagName)) {
|
|
422
|
+
defineCustomElement$1();
|
|
423
|
+
}
|
|
424
|
+
break;
|
|
425
|
+
} });
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export { SnkDynaformFieldsLayout as S, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkDynaformFieldsSelector extends Components.SnkDynaformFieldsSelector, HTMLElement {}
|
|
4
|
+
export const SnkDynaformFieldsSelector: {
|
|
5
|
+
prototype: SnkDynaformFieldsSelector;
|
|
6
|
+
new (): SnkDynaformFieldsSelector;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { S as SnkDynaformFieldsSelector$1, d as defineCustomElement$1 } from './snk-dynaform-fields-selector2.js';
|
|
2
|
+
|
|
3
|
+
const SnkDynaformFieldsSelector = SnkDynaformFieldsSelector$1;
|
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
|
5
|
+
|
|
6
|
+
export { SnkDynaformFieldsSelector, defineCustomElement };
|