@sankhyalabs/sankhyablocks 10.1.0-dev.5 → 10.1.0-dev.50
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/LICENSE +4 -1
- package/dist/cjs/{ConfigStorage-72f34bd4.js → ConfigStorage-a1fab5ca.js} +19 -2
- package/dist/cjs/ContinuousInsertUtils-1ae0c6ac.js +41 -0
- package/dist/cjs/{DataFetcher-991b0349.js → DataFetcher-384d2ce8.js} +2 -2751
- package/dist/cjs/{FormConfigHelper-e253a418.js → FormConfigHelper-28fe4668.js} +3 -1
- package/dist/cjs/{ISave-ebf6b4ed.js → ISave-ecbe9336.js} +1 -1
- package/dist/cjs/ImageUtils-d6139911.js +144 -0
- package/dist/cjs/{PersonalizedFilterUtils-7259cf65.js → PersonalizedFilterUtils-eccb267a.js} +13 -0
- package/dist/cjs/{SnkFormConfigManager-cdbb29d4.js → SnkFormConfigManager-44386305.js} +5 -5
- package/dist/cjs/SnkMessageBuilder-a9300ebe.js +2833 -0
- package/dist/cjs/{SnkMultiSelectionListDataSource-011bec79.js → SnkMultiSelectionListDataSource-293bc3d2.js} +61 -47
- package/dist/cjs/{auth-fetcher-c3cac878.js → auth-fetcher-6b134ec4.js} +1 -1
- package/dist/cjs/config-header.cjs.entry.js +1 -1
- package/dist/cjs/configs-button.cjs.entry.js +1 -1
- package/dist/cjs/css-shim-a27d231b.js +6 -0
- package/dist/cjs/{dataunit-fetcher-8bf469e7.js → dataunit-fetcher-b9822794.js} +66 -6
- package/dist/cjs/dom-ff96a4bc.js +75 -0
- package/dist/cjs/field-config_2.cjs.entry.js +3 -3
- package/dist/cjs/fields-layout.cjs.entry.js +6 -6
- package/dist/cjs/fields-selector.cjs.entry.js +3 -3
- package/dist/cjs/{form-config-fetcher-c7af90d8.js → form-config-fetcher-45d1964c.js} +19 -1
- package/dist/cjs/guides-configurator.cjs.entry.js +3 -3
- package/dist/cjs/{index-1cf293c1.js → index-1894343a.js} +1529 -177
- package/dist/cjs/{index-13d05f03.js → index-f0fe7e6e.js} +90 -21
- package/dist/cjs/loader.cjs.js +16 -2
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +6 -5
- package/dist/cjs/sankhyablocks.cjs.js +132 -4
- package/dist/cjs/shadow-css-7e3e0ab1.js +389 -0
- package/dist/cjs/snk-actions-button_9.cjs.entry.js +166 -116
- package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +29 -9
- package/dist/cjs/snk-attach.cjs.entry.js +63 -25
- package/dist/cjs/snk-client-confirm.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator.cjs.entry.js +3 -1
- package/dist/cjs/snk-crud.cjs.entry.js +350 -109
- package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +1 -1
- package/dist/cjs/snk-custom-slot-guide.cjs.entry.js +40 -0
- package/dist/cjs/snk-data-exporter.cjs.entry.js +9 -7
- package/dist/cjs/{snk-data-unit-7d587ad5.js → snk-data-unit-4b6dc396.js} +21 -12
- package/dist/cjs/snk-data-unit.cjs.entry.js +5 -4
- package/dist/cjs/snk-default-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +19 -20
- package/dist/cjs/snk-entity-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-entity-search.cjs.entry.js +211 -0
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +2 -2
- package/dist/cjs/snk-expression-group_2.cjs.entry.js +2 -2
- package/dist/cjs/{snk-filter-advanced-mode_2.cjs.entry.js → snk-filter-advanced-mode_3.cjs.entry.js} +41 -3
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +147 -94
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +5 -4
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +11 -7
- package/dist/cjs/snk-filter-period.cjs.entry.js +14 -7
- package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +2 -2
- package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +70 -8
- package/dist/cjs/snk-form_2.cjs.entry.js +22 -11
- package/dist/cjs/snk-grid.cjs.entry.js +67 -34
- package/dist/cjs/{snk-guides-viewer-366d5c32.js → snk-guides-viewer-b4ca3437.js} +78 -214
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +11 -18
- package/dist/cjs/snk-image-input.cjs.entry.js +160 -0
- package/dist/cjs/snk-layout-form-config.cjs.entry.js +72 -0
- package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +1 -1
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +8 -7
- package/dist/cjs/snk-pesquisa.cjs.entry.js +6 -6
- package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +30 -35
- package/dist/cjs/snk-taskbar.cjs.entry.js +183 -126
- package/dist/cjs/{sortable.esm-9a110bb7.js → sortable.esm-b87669ab.js} +76 -90
- package/dist/cjs/taskbar-elements-80eddec8.js +152 -0
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +9 -0
- package/dist/collection/components/snk-actions-button/actions/executor/launch-screen.executor.js +6 -3
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +27 -3
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +1 -0
- package/dist/collection/components/snk-application/snk-application.js +20 -2
- package/dist/collection/components/snk-attach/snk-attach.css +29 -7
- package/dist/collection/components/snk-attach/snk-attach.js +94 -19
- package/dist/collection/components/snk-configurator/snk-configurator.js +2 -0
- package/dist/collection/components/snk-crud/snk-crud.css +50 -0
- package/dist/collection/components/snk-crud/snk-crud.js +165 -98
- package/dist/collection/components/snk-crud/subcomponents/GuideBuilder.js +1 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +5 -5
- package/dist/collection/components/snk-crud/subcomponents/snk-entity-search.css +17 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-entity-search.js +330 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +90 -8
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +22 -8
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +90 -205
- package/dist/collection/components/snk-crud/utils/taskbarUtils.js +144 -0
- package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.css +3 -0
- package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.js +95 -0
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +1 -1
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +20 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +9 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +13 -9
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +14 -7
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css +5 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +28 -2
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +7 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +22 -8
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -6
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +166 -78
- package/dist/collection/components/snk-form-config/FormConfigHelper.js +3 -1
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +3 -3
- package/dist/collection/components/snk-form-config/field-item/field-config/field-config.css +1 -0
- package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css +16 -0
- package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js +4 -4
- package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css +3 -4
- package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js +2 -2
- package/dist/collection/components/snk-form-config/snk-form-config.js +15 -5
- package/dist/collection/components/snk-grid/snk-grid.css +24 -3
- package/dist/collection/components/snk-grid/snk-grid.js +174 -22
- package/dist/collection/components/snk-grid-config/snk-grid-config.js +153 -51
- package/dist/collection/components/snk-image-input/snk-image-input.css +3 -0
- package/dist/collection/components/snk-image-input/snk-image-input.js +338 -0
- package/dist/collection/components/snk-image-input/utils/ImageUtils.js +135 -0
- package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js +1 -1
- package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.js +1 -1
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +1 -1
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +13 -0
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +0 -4
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +35 -23
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css +8 -0
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +38 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +54 -37
- package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js +27 -1
- package/dist/collection/components/snk-taskbar/processor/simple-taskbar-processor.js +55 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +44 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +248 -132
- package/dist/collection/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.css +12 -0
- package/dist/collection/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.js +19 -0
- package/dist/collection/lib/configs/ConfigStorage.js +5 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +40 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +24 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +12 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +18 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +11 -2
- package/dist/collection/lib/message/messageResourceEnUSUtils.js +2 -0
- package/dist/collection/lib/message/messageResourceEsESUtils.js +2 -0
- package/dist/collection/lib/message/messageResourcePtBRUtils.js +2 -0
- package/dist/collection/lib/message/resources/en-us/snk-crud.msg.js +9 -1
- package/dist/collection/lib/message/resources/en-us/snk-form.msg.js +1 -0
- package/dist/collection/lib/message/resources/en-us/snk-image-input.msg.js +11 -0
- package/dist/collection/lib/message/resources/en-us/snk-layout-form-config.msg.js +10 -2
- package/dist/collection/lib/message/resources/es-es/snk-crud.msg.js +9 -1
- package/dist/collection/lib/message/resources/es-es/snk-form.msg.js +1 -0
- package/dist/collection/lib/message/resources/es-es/snk-image-input.msg.js +11 -0
- package/dist/collection/lib/message/resources/es-es/snk-layout-form-config.msg.js +8 -0
- package/dist/collection/lib/message/resources/pt-br/snk-configurator.msg.js +1 -1
- package/dist/collection/lib/message/resources/pt-br/snk-crud.msg.js +9 -1
- package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js +1 -0
- package/dist/collection/lib/message/resources/pt-br/snk-image-input.msg.js +11 -0
- package/dist/collection/lib/message/resources/pt-br/snk-layout-form-config.msg.js +10 -2
- package/dist/components/ConfigStorage.js +17 -0
- package/dist/components/ContinuousInsertUtils.js +1 -1
- package/dist/components/DataFetcher.js +3 -2731
- package/dist/components/PersonalizedFilterUtils.js +13 -0
- package/dist/components/SnkFormConfigManager.js +3 -3
- package/dist/components/SnkMessageBuilder.js +2831 -0
- package/dist/components/dataunit-fetcher.js +65 -5
- package/dist/components/field-config2.js +4 -2
- package/dist/components/fields-layout2.js +4 -4
- package/dist/components/form-config-fetcher.js +18 -0
- package/dist/components/guides-configurator2.js +2 -2
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index2.js +90 -21
- package/dist/components/snk-actions-button2.js +12 -6
- package/dist/components/snk-application2.js +22 -2
- package/dist/components/snk-attach2.js +70 -28
- package/dist/components/snk-configurator2.js +2 -0
- package/dist/components/snk-crud.js +433 -176
- package/dist/components/snk-custom-slot-guide.d.ts +11 -0
- package/dist/components/snk-custom-slot-guide.js +55 -0
- package/dist/components/snk-data-exporter2.js +3 -1
- package/dist/components/snk-data-unit2.js +10 -1
- package/dist/components/snk-detail-view2.js +213 -318
- package/dist/components/snk-entity-search.d.ts +11 -0
- package/dist/components/snk-entity-search.js +6 -0
- package/dist/components/snk-entity-search2.js +231 -0
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-filter-bar2.js +116 -80
- package/dist/components/snk-filter-detail2.js +1 -1
- package/dist/components/snk-filter-item2.js +9 -3
- package/dist/components/snk-filter-modal2.js +22 -9
- package/dist/components/snk-filter-number.js +12 -8
- package/dist/components/snk-filter-period.js +13 -6
- package/dist/components/snk-filter-text.js +1 -1
- package/dist/components/snk-form-config2.js +15 -5
- package/dist/components/snk-form-view2.js +79 -10
- package/dist/components/snk-grid-config2.js +109 -50
- package/dist/components/snk-grid2.js +107 -63
- package/dist/components/snk-image-input.d.ts +11 -0
- package/dist/components/snk-image-input.js +6 -0
- package/dist/components/snk-image-input2.js +316 -0
- package/dist/components/snk-layout-form-config2.js +1 -1
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-pesquisa2.js +0 -1
- package/dist/components/snk-simple-crud2.js +47 -46
- package/dist/components/snk-taskbar-skeleton.d.ts +11 -0
- package/dist/components/snk-taskbar-skeleton.js +6 -0
- package/dist/components/snk-taskbar-skeleton2.js +29 -0
- package/dist/components/snk-taskbar2.js +256 -176
- package/dist/components/snk-view-representation2.js +1 -1
- package/dist/components/sortable.esm.js +76 -90
- package/dist/components/taskbar-actions-button2.js +21 -2
- package/dist/components/taskbar-split-button2.js +10 -1
- package/dist/esm/{ConfigStorage-22324b6b.js → ConfigStorage-76872695.js} +19 -2
- package/dist/esm/ContinuousInsertUtils-bce77dc1.js +39 -0
- package/dist/esm/{DataFetcher-450828a0.js → DataFetcher-e60f8d53.js} +3 -2731
- package/dist/esm/{FormConfigHelper-e89ca25c.js → FormConfigHelper-d09669f3.js} +3 -1
- package/dist/esm/{ISave-61153166.js → ISave-4929c071.js} +1 -1
- package/dist/esm/ImageUtils-efbea0e4.js +138 -0
- package/dist/esm/{PersonalizedFilterUtils-2db38ff2.js → PersonalizedFilterUtils-d2439a9a.js} +13 -0
- package/dist/esm/{SnkFormConfigManager-b5a92e12.js → SnkFormConfigManager-83f6b22f.js} +5 -5
- package/dist/esm/SnkMessageBuilder-1eb7a1af.js +2831 -0
- package/dist/esm/{SnkMultiSelectionListDataSource-d7ce2e54.js → SnkMultiSelectionListDataSource-f6cabd15.js} +55 -41
- package/dist/esm/{auth-fetcher-eef9d01e.js → auth-fetcher-1a31c1e4.js} +1 -1
- package/dist/esm/config-header.entry.js +1 -1
- package/dist/esm/configs-button.entry.js +1 -1
- package/dist/esm/css-shim-9f2d321e.js +4 -0
- package/dist/esm/{dataunit-fetcher-da9596f6.js → dataunit-fetcher-c176e002.js} +65 -5
- package/dist/esm/dom-64053c71.js +73 -0
- package/dist/esm/field-config_2.entry.js +3 -3
- package/dist/esm/fields-layout.entry.js +6 -6
- package/dist/esm/fields-selector.entry.js +3 -3
- package/dist/esm/{form-config-fetcher-8d0a5e1c.js → form-config-fetcher-b44b2727.js} +19 -1
- package/dist/esm/guides-configurator.entry.js +3 -3
- package/dist/esm/{index-479e1293.js → index-04f73a26.js} +1521 -177
- package/dist/esm/{index-446f9341.js → index-ea250be6.js} +90 -21
- package/dist/esm/loader.js +17 -3
- package/dist/esm/pesquisa-grid_2.entry.js +6 -5
- package/dist/esm/sankhyablocks.js +133 -5
- package/dist/esm/shadow-css-98135883.js +387 -0
- package/dist/esm/snk-actions-button_9.entry.js +167 -117
- package/dist/esm/snk-actions-form.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +28 -8
- package/dist/esm/snk-attach.entry.js +62 -24
- package/dist/esm/snk-client-confirm.entry.js +1 -1
- package/dist/esm/snk-configurator.entry.js +3 -1
- package/dist/esm/snk-crud.entry.js +342 -101
- package/dist/esm/snk-custom-slot-elements.entry.js +1 -1
- package/dist/esm/snk-custom-slot-guide.entry.js +36 -0
- package/dist/esm/snk-data-exporter.entry.js +9 -7
- package/dist/esm/{snk-data-unit-99616a07.js → snk-data-unit-d8cfa950.js} +12 -3
- package/dist/esm/snk-data-unit.entry.js +5 -4
- package/dist/esm/snk-default-filter.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +17 -18
- package/dist/esm/snk-entity-list.entry.js +1 -1
- package/dist/esm/snk-entity-search.entry.js +207 -0
- package/dist/esm/snk-exporter-email-sender.entry.js +2 -2
- package/dist/esm/snk-expression-group_2.entry.js +2 -2
- package/dist/esm/{snk-filter-advanced-mode_2.entry.js → snk-filter-advanced-mode_3.entry.js} +41 -4
- package/dist/esm/snk-filter-bar_4.entry.js +148 -95
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
- package/dist/esm/snk-filter-detail.entry.js +3 -3
- package/dist/esm/snk-filter-field-search_2.entry.js +2 -2
- package/dist/esm/snk-filter-modal-item.entry.js +5 -4
- package/dist/esm/snk-filter-multi-select.entry.js +1 -1
- package/dist/esm/snk-filter-number.entry.js +11 -7
- package/dist/esm/snk-filter-period.entry.js +14 -7
- package/dist/esm/snk-filter-search.entry.js +1 -1
- package/dist/esm/snk-filter-text.entry.js +2 -2
- package/dist/esm/snk-form-summary.entry.js +1 -1
- package/dist/esm/snk-form-view.entry.js +71 -9
- package/dist/esm/snk-form_2.entry.js +22 -11
- package/dist/esm/snk-grid.entry.js +64 -31
- package/dist/esm/{snk-guides-viewer-240de636.js → snk-guides-viewer-cc37535b.js} +79 -215
- package/dist/esm/snk-guides-viewer.entry.js +11 -18
- package/dist/esm/snk-image-input.entry.js +156 -0
- package/dist/esm/snk-layout-form-config.entry.js +68 -0
- package/dist/esm/snk-personalized-filter-editor.entry.js +1 -1
- package/dist/esm/snk-personalized-filter.entry.js +8 -7
- package/dist/esm/snk-pesquisa.entry.js +6 -6
- package/dist/esm/snk-print-selector.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +28 -33
- package/dist/esm/snk-taskbar.entry.js +184 -127
- package/dist/esm/{sortable.esm-842f85a3.js → sortable.esm-bc277c12.js} +76 -90
- package/dist/esm/taskbar-elements-63651ca7.js +149 -0
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/{p-7f7fe6c4.entry.js → p-0a160fb5.entry.js} +1 -1
- package/dist/sankhyablocks/p-0afc64df.entry.js +1 -0
- package/dist/sankhyablocks/p-10f27dc6.entry.js +1 -0
- package/dist/sankhyablocks/p-134702f6.entry.js +1 -0
- package/dist/sankhyablocks/{p-162bddae.entry.js → p-175c9576.entry.js} +1 -1
- package/dist/sankhyablocks/p-20f03230.entry.js +1 -0
- package/dist/sankhyablocks/p-26f1919e.entry.js +1 -0
- package/dist/sankhyablocks/p-2af8aca3.js +1 -0
- package/dist/sankhyablocks/p-2c9d0870.js +2 -0
- package/dist/sankhyablocks/{p-cb4343c4.entry.js → p-2cc2526e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-75af335e.entry.js → p-2ebda226.entry.js} +1 -1
- package/dist/sankhyablocks/p-3072136e.js +1 -0
- package/dist/sankhyablocks/p-33492640.entry.js +1 -0
- package/dist/sankhyablocks/{p-002d4d2b.js → p-3704bf1b.js} +1 -1
- package/dist/sankhyablocks/p-3870748a.js +28 -0
- package/dist/sankhyablocks/p-3a35917e.entry.js +1 -0
- package/dist/sankhyablocks/{p-7d6f1285.js → p-3c990841.js} +2 -2
- package/dist/sankhyablocks/{p-49ddc27a.entry.js → p-438a225f.entry.js} +1 -1
- package/dist/sankhyablocks/p-4d04bc75.entry.js +1 -0
- package/dist/sankhyablocks/{p-840fb68c.js → p-4f7adf97.js} +2 -2
- package/dist/sankhyablocks/p-554c0e54.js +1 -0
- package/dist/sankhyablocks/{p-27482793.entry.js → p-5aae5c74.entry.js} +1 -1
- package/dist/sankhyablocks/p-68c1a093.js +1 -0
- package/dist/sankhyablocks/p-6ae7543b.entry.js +1 -0
- package/dist/sankhyablocks/p-6e278003.js +60 -0
- package/dist/sankhyablocks/{p-825098c1.entry.js → p-752c57f4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e258de96.entry.js → p-76729994.entry.js} +1 -1
- package/dist/sankhyablocks/p-771b137e.js +1 -0
- package/dist/sankhyablocks/p-77f608bc.entry.js +1 -0
- package/dist/sankhyablocks/p-7ad91135.entry.js +1 -0
- package/dist/sankhyablocks/p-82bcb4cf.entry.js +1 -0
- package/dist/sankhyablocks/p-855ccf64.entry.js +1 -0
- package/dist/sankhyablocks/{p-118c221e.js → p-8b4d6719.js} +1 -1
- package/dist/sankhyablocks/{p-3d41f5a8.entry.js → p-8d946600.entry.js} +1 -1
- package/dist/sankhyablocks/p-8fe740b7.entry.js +11 -0
- package/dist/sankhyablocks/{p-96d45943.entry.js → p-90ae6c2e.entry.js} +1 -1
- package/dist/sankhyablocks/p-95af0bb1.entry.js +1 -0
- package/dist/sankhyablocks/{p-0b9a42ad.entry.js → p-9742ea0e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2fdac5e6.entry.js → p-9e109f5e.entry.js} +1 -1
- package/dist/sankhyablocks/p-9e77e136.js +1 -0
- package/dist/sankhyablocks/p-9e7dc97d.entry.js +1 -0
- package/dist/sankhyablocks/p-a2a9f520.entry.js +1 -0
- package/dist/sankhyablocks/p-a46ac091.js +1 -0
- package/dist/sankhyablocks/p-a73b6b00.js +1 -0
- package/dist/sankhyablocks/p-a905712a.entry.js +1 -0
- package/dist/sankhyablocks/{p-92cfc028.js → p-ab5e12fa.js} +1 -1
- package/dist/sankhyablocks/{p-180716b2.entry.js → p-ae326d06.entry.js} +1 -1
- package/dist/sankhyablocks/p-af673291.js +1 -0
- package/dist/sankhyablocks/p-aff2d081.entry.js +1 -0
- package/dist/sankhyablocks/p-b0a357b4.entry.js +1 -0
- package/dist/sankhyablocks/p-b555ce38.entry.js +1 -0
- package/dist/sankhyablocks/p-bab4cde4.entry.js +1 -0
- package/dist/sankhyablocks/p-c0d6a821.entry.js +1 -0
- package/dist/sankhyablocks/p-c3ec6642.js +19 -0
- package/dist/sankhyablocks/p-ca3728c0.entry.js +1 -0
- package/dist/sankhyablocks/p-cbb8e351.js +7 -0
- package/dist/sankhyablocks/{p-c3dbf441.entry.js → p-cc64239c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-471b34f4.entry.js → p-cd00a3d1.entry.js} +1 -1
- package/dist/sankhyablocks/p-ce8ccd72.entry.js +1 -0
- package/dist/sankhyablocks/{p-4c763b10.entry.js → p-d657f71f.entry.js} +1 -1
- package/dist/sankhyablocks/p-d9ec8c4b.entry.js +1 -0
- package/dist/sankhyablocks/p-da455c82.js +12 -0
- package/dist/sankhyablocks/p-e5a3711f.js +1 -0
- package/dist/sankhyablocks/{p-9a63f3f7.entry.js → p-e737fd5a.entry.js} +1 -1
- package/dist/sankhyablocks/p-e8df1dea.entry.js +1 -0
- package/dist/sankhyablocks/p-ee56dda6.entry.js +1 -0
- package/dist/sankhyablocks/p-ef9343c3.entry.js +1 -0
- package/dist/sankhyablocks/{p-667cab42.entry.js → p-f152ef98.entry.js} +1 -1
- package/dist/sankhyablocks/p-f5ad0720.js +1 -0
- package/dist/sankhyablocks/{p-7e250432.entry.js → p-f7170e10.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7345782c.entry.js → p-f921270b.entry.js} +1 -1
- package/dist/sankhyablocks/p-fec88660.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +4 -0
- package/dist/types/components/snk-application/snk-application.d.ts +1 -1
- package/dist/types/components/snk-attach/snk-attach.d.ts +22 -4
- package/dist/types/components/snk-crud/snk-crud.d.ts +33 -11
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +1 -1
- package/dist/types/components/snk-crud/subcomponents/snk-entity-search.d.ts +62 -0
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +12 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +13 -25
- package/dist/types/components/snk-crud/utils/taskbarUtils.d.ts +13 -0
- package/dist/types/components/snk-custom-slot-guide/snk-custom-slot-guide.d.ts +16 -0
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +4 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +5 -1
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +2 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +33 -16
- package/dist/types/components/snk-form-config/FormConfigHelper.d.ts +1 -1
- package/dist/types/components/snk-form-config/fields-layout/fields-layout.d.ts +2 -2
- package/dist/types/components/snk-form-config/guides-configurator/guides-configurator.d.ts +1 -1
- package/dist/types/components/snk-form-config/snk-form-config.d.ts +2 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +29 -1
- package/dist/types/components/snk-grid-config/snk-grid-config.d.ts +11 -0
- package/dist/types/components/snk-image-input/snk-image-input.d.ts +57 -0
- package/dist/types/components/snk-image-input/utils/ImageUtils.d.ts +15 -0
- package/dist/types/components/snk-personalized-filter/interfaces/IParameter.d.ts +1 -0
- package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +0 -1
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -1
- package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +6 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +29 -2
- package/dist/types/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.d.ts +5 -0
- package/dist/types/components/snk-taskbar/processor/simple-taskbar-processor.d.ts +31 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +32 -21
- package/dist/types/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.d.ts +3 -0
- package/dist/types/components.d.ts +347 -5
- package/dist/types/lib/configs/ConfigStorage.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +1 -0
- package/dist/types/lib/message/resources/en-us/snk-image-input.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-image-input.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-image-input.msg.d.ts +1 -0
- package/package.json +7 -8
- package/react/components.d.ts +4 -0
- package/react/components.js +4 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/snk-simple-bar.cjs.entry.js +0 -45
- package/dist/cjs/taskbar-elements-fb5d1e08.js +0 -132
- package/dist/cjs/taskbar-processor-2fba34a8.js +0 -53
- package/dist/esm/snk-simple-bar.entry.js +0 -41
- package/dist/esm/taskbar-elements-faaf5d8f.js +0 -129
- package/dist/esm/taskbar-processor-3436124c.js +0 -51
- package/dist/sankhyablocks/p-093f58fa.entry.js +0 -1
- package/dist/sankhyablocks/p-0948dc0a.entry.js +0 -11
- package/dist/sankhyablocks/p-1a0caadb.js +0 -1
- package/dist/sankhyablocks/p-1a9c5684.entry.js +0 -1
- package/dist/sankhyablocks/p-1d589380.entry.js +0 -1
- package/dist/sankhyablocks/p-21107f0d.entry.js +0 -1
- package/dist/sankhyablocks/p-28f50632.js +0 -1
- package/dist/sankhyablocks/p-39be771c.js +0 -1
- package/dist/sankhyablocks/p-3ed04f0d.entry.js +0 -1
- package/dist/sankhyablocks/p-4963dd2a.entry.js +0 -1
- package/dist/sankhyablocks/p-51833248.js +0 -7
- package/dist/sankhyablocks/p-55798617.js +0 -1
- package/dist/sankhyablocks/p-55f6fef2.entry.js +0 -1
- package/dist/sankhyablocks/p-56f16390.entry.js +0 -1
- package/dist/sankhyablocks/p-58683e28.js +0 -60
- package/dist/sankhyablocks/p-5ea893c5.entry.js +0 -1
- package/dist/sankhyablocks/p-60dd1d27.entry.js +0 -1
- package/dist/sankhyablocks/p-62aef37a.js +0 -1
- package/dist/sankhyablocks/p-62e9b9b8.entry.js +0 -1
- package/dist/sankhyablocks/p-669bb869.entry.js +0 -1
- package/dist/sankhyablocks/p-6ee2ca7a.entry.js +0 -1
- package/dist/sankhyablocks/p-7cac3870.entry.js +0 -1
- package/dist/sankhyablocks/p-86e54841.entry.js +0 -1
- package/dist/sankhyablocks/p-88b337fe.entry.js +0 -1
- package/dist/sankhyablocks/p-91005a00.entry.js +0 -1
- package/dist/sankhyablocks/p-91a9abb6.entry.js +0 -1
- package/dist/sankhyablocks/p-988afe78.js +0 -1
- package/dist/sankhyablocks/p-ada013c0.entry.js +0 -1
- package/dist/sankhyablocks/p-b7e891cc.entry.js +0 -1
- package/dist/sankhyablocks/p-b987e15d.js +0 -1
- package/dist/sankhyablocks/p-c35fc941.js +0 -26
- package/dist/sankhyablocks/p-c4fcf1fb.entry.js +0 -1
- package/dist/sankhyablocks/p-c98c79c3.entry.js +0 -1
- package/dist/sankhyablocks/p-cadf4846.entry.js +0 -1
- package/dist/sankhyablocks/p-d8d8169b.js +0 -2
- package/dist/sankhyablocks/p-e91c3c57.entry.js +0 -1
- package/dist/sankhyablocks/p-ea729922.entry.js +0 -1
- package/dist/sankhyablocks/p-ec5fbad8.js +0 -1
- package/dist/sankhyablocks/p-f5e942b7.entry.js +0 -1
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import { Action as DUAction,
|
|
2
|
-
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
1
|
+
import { Action as DUAction, KeyboardManager, ObjectUtils } from '@sankhyalabs/core';
|
|
3
2
|
import { buildFieldSearch, SHORTCUT_SEARCH_FIELD } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
3
|
import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
|
5
4
|
import { Fragment, h } from '@stencil/core';
|
|
6
|
-
import { PresentationMode } from '../../../lib';
|
|
7
5
|
import { VIEW_MODE } from '../../../lib/utils/constants';
|
|
8
6
|
import { SnkFormConfigManager } from '../../snk-form-config/SnkFormConfigManager';
|
|
9
7
|
import { TaskbarElement } from '../../snk-taskbar/elements/taskbar-elements';
|
|
10
|
-
import TaskbarProcessor from '../../snk-taskbar/processor/taskbar-processor';
|
|
11
8
|
const FORM_NAME_PREFIX = "__FORM:";
|
|
12
9
|
export class SnkGuidesViewer {
|
|
13
10
|
constructor() {
|
|
14
11
|
this._guideBuilders = new Map();
|
|
15
|
-
this.CUSTOM_GUIDE_ID_PREFIX = "CUSTOM_GUIDE_";
|
|
16
|
-
this.CUSTOM_GUIDE_DATA_CUSTOM_ID = "CUSTOM_GUIDE";
|
|
17
12
|
this.dataUnit = undefined;
|
|
18
13
|
this.dataState = undefined;
|
|
19
14
|
this.configName = undefined;
|
|
@@ -47,8 +42,12 @@ export class SnkGuidesViewer {
|
|
|
47
42
|
observeDataUnit() {
|
|
48
43
|
this.loadGuides(true);
|
|
49
44
|
}
|
|
50
|
-
observeFormConfigManager(value) {
|
|
51
|
-
|
|
45
|
+
async observeFormConfigManager(value) {
|
|
46
|
+
const showFormConfig = !!value;
|
|
47
|
+
await this._viewStack.show(showFormConfig ?
|
|
48
|
+
GUIDES_VIEWER_VIEW_MODE.CONFIG :
|
|
49
|
+
GUIDES_VIEWER_VIEW_MODE.GUIDES);
|
|
50
|
+
this.formConfigVisibilityChanged.emit(showFormConfig);
|
|
52
51
|
}
|
|
53
52
|
observeDataState(newValue, oldValue) {
|
|
54
53
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -98,7 +97,8 @@ export class SnkGuidesViewer {
|
|
|
98
97
|
* Atribui o foco para o componente.
|
|
99
98
|
*/
|
|
100
99
|
async setFocus() {
|
|
101
|
-
|
|
100
|
+
var _a;
|
|
101
|
+
(_a = this._container) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* Recarrega os guias baseada nos metadados atuais.
|
|
@@ -159,6 +159,13 @@ export class SnkGuidesViewer {
|
|
|
159
159
|
item.tooltip = this.getMessage("snkCrud.detail.tooltip.needSingleSelection");
|
|
160
160
|
item.disabled = true;
|
|
161
161
|
}
|
|
162
|
+
if (sheet.isCustom && sheet.ctxProps) {
|
|
163
|
+
Object.entries(sheet.ctxProps).forEach(([key, value]) => {
|
|
164
|
+
if (value !== undefined) {
|
|
165
|
+
item[key] = value;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
162
169
|
guides.push(item);
|
|
163
170
|
});
|
|
164
171
|
this._guides = guides;
|
|
@@ -194,63 +201,6 @@ export class SnkGuidesViewer {
|
|
|
194
201
|
});
|
|
195
202
|
}
|
|
196
203
|
}
|
|
197
|
-
getTaskBarId() {
|
|
198
|
-
var _a;
|
|
199
|
-
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
|
|
200
|
-
return TASKBAR_ID.FINISH_EDITION;
|
|
201
|
-
}
|
|
202
|
-
if (this.dataUnit.isMultipleEdition) {
|
|
203
|
-
return TASKBAR_ID.MUTIPLE_EDITION;
|
|
204
|
-
}
|
|
205
|
-
return TASKBAR_ID.REGULAR;
|
|
206
|
-
}
|
|
207
|
-
loadTaskbarProcessor() {
|
|
208
|
-
const taskbarIDs = {};
|
|
209
|
-
taskbarIDs[TASKBAR_ID.REGULAR] = this.buildBtnsRegularMode();
|
|
210
|
-
taskbarIDs[TASKBAR_ID.FINISH_EDITION] = [TaskbarElement.CANCEL, TaskbarElement.SAVE, this.handleAddGridMode()];
|
|
211
|
-
taskbarIDs[TASKBAR_ID.MUTIPLE_EDITION] = [TaskbarElement.CANCEL];
|
|
212
|
-
this._taskbarProcessor = new TaskbarProcessor(taskbarIDs);
|
|
213
|
-
this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.buildDisabledButtons(), this.buildInvisibleButtons());
|
|
214
|
-
}
|
|
215
|
-
buildBtnsRegularMode() {
|
|
216
|
-
var _a, _b;
|
|
217
|
-
const btnsRegularMode = [
|
|
218
|
-
TaskbarElement.ATTACH, TaskbarElement.CLONE, TaskbarElement.REMOVE, TaskbarElement.MORE_OPTIONS,
|
|
219
|
-
TaskbarElement.ACTIONS_BUTTON, TaskbarElement.DIVIDER, TaskbarElement.GRID_MODE, TaskbarElement.CONFIGURATOR,
|
|
220
|
-
];
|
|
221
|
-
if (((_b = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) === null || _b === void 0 ? void 0 : _b.length) <= 1) {
|
|
222
|
-
btnsRegularMode.unshift(TaskbarElement.PREVIOUS, TaskbarElement.NEXT, TaskbarElement.DIVIDER);
|
|
223
|
-
}
|
|
224
|
-
if (this.presentationMode == PresentationMode.SECONDARY) {
|
|
225
|
-
btnsRegularMode.unshift(TaskbarElement.INSERT);
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
btnsRegularMode.push(TaskbarElement.INSERT);
|
|
229
|
-
}
|
|
230
|
-
return btnsRegularMode;
|
|
231
|
-
}
|
|
232
|
-
buildDisabledButtons() {
|
|
233
|
-
var _a, _b, _c, _d, _e, _f;
|
|
234
|
-
const disabledButtons = [];
|
|
235
|
-
if (!((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.hasPrevious))
|
|
236
|
-
disabledButtons.push(TaskbarElement.PREVIOUS);
|
|
237
|
-
if (!((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.hasNext))
|
|
238
|
-
disabledButtons.push(TaskbarElement.NEXT);
|
|
239
|
-
if (((_d = (_c = this.dataState) === null || _c === void 0 ? void 0 : _c.selectionInfo) === null || _d === void 0 ? void 0 : _d.length) > 1)
|
|
240
|
-
disabledButtons.push(TaskbarElement.CLONE);
|
|
241
|
-
if ((_f = (_e = this.dataState) === null || _e === void 0 ? void 0 : _e.selectionInfo) === null || _f === void 0 ? void 0 : _f.isAllRecords())
|
|
242
|
-
disabledButtons.push(TaskbarElement.REMOVE);
|
|
243
|
-
return disabledButtons;
|
|
244
|
-
}
|
|
245
|
-
handleAddGridMode() {
|
|
246
|
-
return this.enableGridInsert ? TaskbarElement.GRID_MODE : "";
|
|
247
|
-
}
|
|
248
|
-
buildInvisibleButtons() {
|
|
249
|
-
const invisibleButtons = [];
|
|
250
|
-
if (this.dataState && this.dataState.selectionInfo.mode === SelectionMode.ALL_RECORDS)
|
|
251
|
-
invisibleButtons.push(TaskbarElement.ACTIONS_BUTTON);
|
|
252
|
-
return invisibleButtons;
|
|
253
|
-
}
|
|
254
204
|
static updateContentCard(formName, cardConfig, propertyChanged, configManager) {
|
|
255
205
|
return configManager.saveCardState(formName, cardConfig, propertyChanged);
|
|
256
206
|
}
|
|
@@ -273,7 +223,7 @@ export class SnkGuidesViewer {
|
|
|
273
223
|
if (sheet == undefined) {
|
|
274
224
|
return;
|
|
275
225
|
}
|
|
276
|
-
return h("snk-form-view", { levelPath: params.levelPath, label: sheet.label, name: formName, fields: sheet.fields, formMetadata: params.formMetadata, dataUnit: params.dataUnit, recordsValidator: params.recordsValidator, contracted: (cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.presentation) === "CONTRACTED", fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_b = (_a = params.formConfig) === null || _a === void 0 ? void 0 : _a.summary) === null || _b === void 0 ? void 0 : _b.get(formName), fieldToFocus: params.fieldToFocus, key: formName, onSnkRequestClearFieldToFocus: _ => { var _a; return (_a = params.onRequestClearFieldToFocus) === null || _a === void 0 ? void 0 : _a.call(params); }, customEditors: params.propsCustomEditor, fieldsProps: params.fieldsProps });
|
|
226
|
+
return h("snk-form-view", { levelPath: params.levelPath, label: sheet.label, name: formName, fields: sheet.fields, formMetadata: params.formMetadata, dataUnit: params.dataUnit, recordsValidator: params.recordsValidator, contracted: (cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.presentation) === "CONTRACTED", fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_b = (_a = params.formConfig) === null || _a === void 0 ? void 0 : _a.summary) === null || _b === void 0 ? void 0 : _b.get(formName), fieldToFocus: params.fieldToFocus, key: formName, onSnkRequestClearFieldToFocus: _ => { var _a; return (_a = params.onRequestClearFieldToFocus) === null || _a === void 0 ? void 0 : _a.call(params); }, customEditors: params.propsCustomEditor, fieldsProps: params.fieldsProps, entityPath: params.entityPath });
|
|
277
227
|
})));
|
|
278
228
|
}
|
|
279
229
|
wrapDetail(levels, content) {
|
|
@@ -295,11 +245,13 @@ export class SnkGuidesViewer {
|
|
|
295
245
|
}
|
|
296
246
|
getContent() {
|
|
297
247
|
if (!this.selectedGuide) {
|
|
248
|
+
this.snkShowGuide.emit(undefined);
|
|
298
249
|
return;
|
|
299
250
|
}
|
|
300
251
|
const guideId = this.selectedGuide.id;
|
|
252
|
+
this.snkShowGuide.emit(guideId);
|
|
301
253
|
if (this.isCustomGuide(guideId)) {
|
|
302
|
-
return h("
|
|
254
|
+
return h("slot", { name: guideId });
|
|
303
255
|
}
|
|
304
256
|
const levels = guideId.split("::");
|
|
305
257
|
const currentLevel = levels.pop();
|
|
@@ -310,16 +262,13 @@ export class SnkGuidesViewer {
|
|
|
310
262
|
}
|
|
311
263
|
return this.buildFormViewGuideContent(guideId);
|
|
312
264
|
}
|
|
313
|
-
buildCustomGuideContainerId(guideId) {
|
|
314
|
-
return `${this.CUSTOM_GUIDE_ID_PREFIX}${guideId}`;
|
|
315
|
-
}
|
|
316
265
|
buildFormViewGuideContent(cardId) {
|
|
317
266
|
var _a, _b, _c, _d;
|
|
318
267
|
const sheet = this._masterFormMetadata.getSheet(cardId);
|
|
319
268
|
if (!sheet)
|
|
320
269
|
return;
|
|
321
270
|
const cardConfig = (_b = (_a = this.masterFormConfig) === null || _a === void 0 ? void 0 : _a.cardsState) === null || _b === void 0 ? void 0 : _b.get(cardId);
|
|
322
|
-
return (h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_d = (_c = this.masterFormConfig) === null || _c === void 0 ? void 0 : _c.summary) === null || _d === void 0 ? void 0 : _d.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: cardId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps, fieldSearch: this._fieldSearch
|
|
271
|
+
return (h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_d = (_c = this.masterFormConfig) === null || _c === void 0 ? void 0 : _c.summary) === null || _d === void 0 ? void 0 : _d.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: cardId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps, fieldSearch: this._fieldSearch, entityPath: this.entityPath }));
|
|
323
272
|
}
|
|
324
273
|
isDetailGuide(childEntityName, levels) {
|
|
325
274
|
return childEntityName || levels.length > 0;
|
|
@@ -342,26 +291,6 @@ export class SnkGuidesViewer {
|
|
|
342
291
|
var _a;
|
|
343
292
|
return (_a = this.customGuidesConfig) === null || _a === void 0 ? void 0 : _a.map(g => g.id).includes(guideId);
|
|
344
293
|
}
|
|
345
|
-
attachCustomGuideInView() {
|
|
346
|
-
//As guias customizadas ficam em slots reservados na DOM e
|
|
347
|
-
// precisam ser acessadas via querySelector e colocadas no container correto na view.
|
|
348
|
-
var _a;
|
|
349
|
-
const guideId = (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id;
|
|
350
|
-
if (!this.isCustomGuide(guideId))
|
|
351
|
-
return;
|
|
352
|
-
const customGuideSlot = document.querySelector(`#${guideId}`);
|
|
353
|
-
const customGuideElement = customGuideSlot === null || customGuideSlot === void 0 ? void 0 : customGuideSlot.firstElementChild;
|
|
354
|
-
const customGuideViewContainer = document.querySelector(`#${this.buildCustomGuideContainerId(guideId)}`);
|
|
355
|
-
if (!customGuideElement || !customGuideViewContainer)
|
|
356
|
-
return;
|
|
357
|
-
customGuideViewContainer.appendChild(customGuideElement);
|
|
358
|
-
}
|
|
359
|
-
onBreadcrumbClickHandler(item) {
|
|
360
|
-
if ((item === null || item === void 0 ? void 0 : item.id) == undefined) {
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
this._guideNavigator.selectGuide(item.id);
|
|
364
|
-
}
|
|
365
294
|
updateSelectedGuideHandler(currentItem) {
|
|
366
295
|
this._guideHasChanged = this.selectedGuide != currentItem;
|
|
367
296
|
this.selectedGuide = currentItem;
|
|
@@ -370,15 +299,13 @@ export class SnkGuidesViewer {
|
|
|
370
299
|
});
|
|
371
300
|
this.resetGuideBadge(currentItem);
|
|
372
301
|
}
|
|
373
|
-
changeGuideHandler(guideName) {
|
|
374
|
-
var _a;
|
|
375
|
-
(_a = this._guideNavigator) === null || _a === void 0 ? void 0 : _a.selectGuide(guideName);
|
|
376
|
-
}
|
|
377
302
|
clearFieldToFocusHandler() {
|
|
378
303
|
this._fieldToGetFocus = undefined;
|
|
379
304
|
}
|
|
380
305
|
resetGuideBadge(selectedGuide) {
|
|
381
306
|
var _a;
|
|
307
|
+
if (!selectedGuide)
|
|
308
|
+
return;
|
|
382
309
|
this._guides = [...(_a = this._guides) === null || _a === void 0 ? void 0 : _a.map(guide => {
|
|
383
310
|
if (this.canClearGuideBadge(guide, selectedGuide.id)) {
|
|
384
311
|
return Object.assign(Object.assign({}, guide), { badge: null });
|
|
@@ -437,85 +364,13 @@ export class SnkGuidesViewer {
|
|
|
437
364
|
this.addFormLegacyConfigName();
|
|
438
365
|
this._configManager.loadConfig();
|
|
439
366
|
}
|
|
440
|
-
componentWillRender() {
|
|
441
|
-
this.detachCustomGuideFromView();
|
|
442
|
-
}
|
|
443
|
-
detachCustomGuideFromView() {
|
|
444
|
-
// Antes de cada renderização, o componente remove a guia customizada da view
|
|
445
|
-
// e a coloca de volta no slot reservado na DOM para que não seja perdida sua referência.
|
|
446
|
-
if (!this.customGuidesConfig || this.customGuidesConfig.length === 0)
|
|
447
|
-
return;
|
|
448
|
-
const viewCustomGuideContainer = this._element.querySelector(`[data-custom-id="${this.CUSTOM_GUIDE_DATA_CUSTOM_ID}"]`);
|
|
449
|
-
const reservedSlotId = viewCustomGuideContainer === null || viewCustomGuideContainer === void 0 ? void 0 : viewCustomGuideContainer.getAttribute('data-reserved-slot-id');
|
|
450
|
-
if (!(viewCustomGuideContainer === null || viewCustomGuideContainer === void 0 ? void 0 : viewCustomGuideContainer.hasChildNodes()) || !reservedSlotId)
|
|
451
|
-
return;
|
|
452
|
-
const customGuideReservedSlot = document.querySelector(`#${reservedSlotId}`);
|
|
453
|
-
const customGuideElement = viewCustomGuideContainer === null || viewCustomGuideContainer === void 0 ? void 0 : viewCustomGuideContainer.firstElementChild;
|
|
454
|
-
if (!customGuideReservedSlot || !customGuideElement)
|
|
455
|
-
return;
|
|
456
|
-
customGuideReservedSlot.appendChild(customGuideElement);
|
|
457
|
-
}
|
|
458
367
|
componentDidRender() {
|
|
459
|
-
var _a;
|
|
460
|
-
if (this.isCustomGuide((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
461
|
-
this.attachCustomGuideInView();
|
|
462
|
-
}
|
|
463
368
|
if (!this._guideHasChanged) {
|
|
464
369
|
return;
|
|
465
370
|
}
|
|
466
|
-
|
|
467
|
-
this._currentDetail.showUp();
|
|
468
|
-
}
|
|
469
|
-
else {
|
|
470
|
-
if (this._mainForm) {
|
|
471
|
-
this._mainForm.showUp();
|
|
472
|
-
}
|
|
473
|
-
}
|
|
371
|
+
window.scrollTo(0, 0);
|
|
474
372
|
this._guideHasChanged = false;
|
|
475
373
|
}
|
|
476
|
-
getFieldsSearch(item) {
|
|
477
|
-
if (this._fieldSearch == undefined || this._hasToCreateFieldSearch) {
|
|
478
|
-
this._hasToCreateFieldSearch = false;
|
|
479
|
-
this._fieldSearch = buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option));
|
|
480
|
-
}
|
|
481
|
-
return this._fieldSearch;
|
|
482
|
-
}
|
|
483
|
-
fieldsOptionLoader(argument) {
|
|
484
|
-
return Promise.resolve(this._configManager.getFieldsList(argument)
|
|
485
|
-
.map(field => ({ value: field.name, label: field.label })));
|
|
486
|
-
}
|
|
487
|
-
onSelectField(option) {
|
|
488
|
-
if (option == undefined) {
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
491
|
-
this._fieldToGetFocus = option.value;
|
|
492
|
-
const fieldGuideName = this.getGuideName(option.value);
|
|
493
|
-
if (fieldGuideName !== this.selectedGuide.id) {
|
|
494
|
-
this.changeGuideHandler(fieldGuideName);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
getActionsList() {
|
|
498
|
-
var _a;
|
|
499
|
-
const hardList = [];
|
|
500
|
-
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
|
501
|
-
return hardList.concat((_a = this.taskbarManager.getMoreOptions(this.getTaskBarId(), this.configName, this.dataState, this.actionsList)) !== null && _a !== void 0 ? _a : []);
|
|
502
|
-
}
|
|
503
|
-
return hardList.concat(this.actionsList);
|
|
504
|
-
}
|
|
505
|
-
getSettingsListForm() {
|
|
506
|
-
const hardList = [{
|
|
507
|
-
value: StringUtils.generateUUID(),
|
|
508
|
-
label: this.getMessage("snkCrud.findColumn"),
|
|
509
|
-
disableCloseOnSelect: true,
|
|
510
|
-
eagerInitialize: true,
|
|
511
|
-
itemBuilder: (_, item) => this.getFieldsSearch(item)
|
|
512
|
-
}];
|
|
513
|
-
return hardList;
|
|
514
|
-
}
|
|
515
|
-
buildTaskBar() {
|
|
516
|
-
var _a;
|
|
517
|
-
return h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.getActionsList(), actionsSettingsList: this.getSettingsListForm(), messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? TaskbarElement.SAVE : TaskbarElement.INSERT, "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS", additionalSlotId: "GUIDES_VIEWER_DYNAMIC_SEARCH", alignRigth: true }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GUIDES_VIEWER_DYNAMIC_SEARCH" })));
|
|
518
|
-
}
|
|
519
374
|
async dataUnitActionHandler(action) {
|
|
520
375
|
var _a;
|
|
521
376
|
switch (action.type) {
|
|
@@ -570,30 +425,42 @@ export class SnkGuidesViewer {
|
|
|
570
425
|
}
|
|
571
426
|
return "";
|
|
572
427
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
return (_b = (_a = this.getCustomTitle) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : this.getMessage("snkCrud.title");
|
|
576
|
-
}
|
|
577
|
-
getTitleTooltip() {
|
|
578
|
-
if (!this.dataUnit.isMultipleEdition)
|
|
579
|
-
return;
|
|
580
|
-
return this.buildRecordIdsArray();
|
|
428
|
+
getCustomGuidesConfig() {
|
|
429
|
+
return this._currentDetail ? [] : this.customGuidesConfig;
|
|
581
430
|
}
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
431
|
+
getFieldsSearch() {
|
|
432
|
+
if (this._fieldSearch == undefined || this._hasToCreateFieldSearch) {
|
|
433
|
+
this._hasToCreateFieldSearch = false;
|
|
434
|
+
const item = {
|
|
435
|
+
label: this.getMessage("snkSimpleCrud.findFields"),
|
|
436
|
+
value: "findFields",
|
|
437
|
+
};
|
|
438
|
+
this._fieldSearch = buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option));
|
|
587
439
|
}
|
|
588
|
-
|
|
589
|
-
return `[${labels.join(", ")}]`;
|
|
440
|
+
return this._fieldSearch;
|
|
590
441
|
}
|
|
591
|
-
|
|
592
|
-
return
|
|
442
|
+
fieldsOptionLoader(argument) {
|
|
443
|
+
return Promise.resolve(this._configManager.getFieldsList(argument)
|
|
444
|
+
.map(field => ({ value: field.name, label: field.label })));
|
|
445
|
+
}
|
|
446
|
+
changeGuideHandler(guideName) {
|
|
447
|
+
var _a;
|
|
448
|
+
(_a = this._guideNavigator) === null || _a === void 0 ? void 0 : _a.selectGuide(guideName);
|
|
449
|
+
}
|
|
450
|
+
onSelectField(option) {
|
|
451
|
+
if (option == undefined) {
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
this._fieldToGetFocus = option.value;
|
|
455
|
+
const fieldGuideName = this.getGuideName(option.value);
|
|
456
|
+
if (fieldGuideName !== this.selectedGuide.id) {
|
|
457
|
+
this.changeGuideHandler(fieldGuideName);
|
|
458
|
+
}
|
|
593
459
|
}
|
|
594
460
|
componentDidLoad() {
|
|
595
461
|
this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
|
|
596
462
|
this.initKeyboardManager();
|
|
463
|
+
this.getFieldsSearch();
|
|
597
464
|
}
|
|
598
465
|
disconnectedCallback() {
|
|
599
466
|
var _a;
|
|
@@ -607,31 +474,35 @@ export class SnkGuidesViewer {
|
|
|
607
474
|
await this._mainForm.showSearchField();
|
|
608
475
|
}, { description: this.getMessage("snkSimpleCrud.findFields"), element: this._element });
|
|
609
476
|
}
|
|
610
|
-
|
|
611
|
-
var _a, _b;
|
|
477
|
+
renderFormConfig() {
|
|
612
478
|
if (this._formEditorConfigManager != undefined) {
|
|
613
479
|
return (h("snk-form-config", { ref: ref => this._container = ref, tabindex: -1, dataUnit: this._formEditorDataUnit, messagesBuilder: this.messagesBuilder, configManager: this._formEditorConfigManager, onConfigClose: () => this._formEditorConfigManager = null, customGuidesConfig: this.getCustomGuidesConfig() }));
|
|
614
480
|
}
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
this.
|
|
619
|
-
const showGuides = this._guides && (this._guides.length > 1);
|
|
620
|
-
return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge", title: this.getTitleTooltip() }, this.getTitle()), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
|
|
621
|
-
h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
|
|
481
|
+
}
|
|
482
|
+
renderGuidesNavigator(showGuides) {
|
|
483
|
+
var _a;
|
|
484
|
+
return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabIndex: -1 }, h("div", { class: "snk-guides-viewer__container" }, showGuides ?
|
|
622
485
|
h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
|
|
623
486
|
:
|
|
624
487
|
h("div", null), h("div", { class: "snk-guides-viewer__detail-container" }, SnkGuidesViewer.buildFixedForms({
|
|
625
488
|
formConfig: this.masterFormConfig,
|
|
626
489
|
formMetadata: this._masterFormMetadata,
|
|
627
|
-
selectedForm: (
|
|
490
|
+
selectedForm: (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id,
|
|
628
491
|
dataUnit: this.dataUnit,
|
|
629
492
|
recordsValidator: this.recordsValidator,
|
|
630
493
|
fieldToFocus: this._fieldToGetFocus,
|
|
631
494
|
onRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this),
|
|
632
495
|
propsCustomEditor: this._customEditors,
|
|
633
|
-
fieldsProps: this._fieldsProps
|
|
634
|
-
|
|
496
|
+
fieldsProps: this._fieldsProps,
|
|
497
|
+
entityPath: this.entityPath
|
|
498
|
+
}), this.getContent())), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID, layoutFormConfig: false, disableNumberingConfig: true })));
|
|
499
|
+
}
|
|
500
|
+
render() {
|
|
501
|
+
if (!this.dataUnit || !this._configManager.isLoaded) {
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
const showGuides = this._guides && (this._guides.length > 1);
|
|
505
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "guides-viewer-stack" }, h("stack-item", null, this.renderGuidesNavigator(showGuides)), h("stack-item", null, this.renderFormConfig())));
|
|
635
506
|
}
|
|
636
507
|
static get is() { return "snk-guides-viewer"; }
|
|
637
508
|
static get encapsulation() { return "scoped"; }
|
|
@@ -786,7 +657,7 @@ export class SnkGuidesViewer {
|
|
|
786
657
|
},
|
|
787
658
|
"selectedGuide": {
|
|
788
659
|
"type": "unknown",
|
|
789
|
-
"mutable":
|
|
660
|
+
"mutable": true,
|
|
790
661
|
"complexType": {
|
|
791
662
|
"original": "IGuideItem",
|
|
792
663
|
"resolved": "IGuideItem",
|
|
@@ -1026,6 +897,21 @@ export class SnkGuidesViewer {
|
|
|
1026
897
|
}
|
|
1027
898
|
static get events() {
|
|
1028
899
|
return [{
|
|
900
|
+
"method": "snkShowGuide",
|
|
901
|
+
"name": "snkShowGuide",
|
|
902
|
+
"bubbles": true,
|
|
903
|
+
"cancelable": true,
|
|
904
|
+
"composed": true,
|
|
905
|
+
"docs": {
|
|
906
|
+
"tags": [],
|
|
907
|
+
"text": "Emitido quando a uma gua \u00E9 exibida no formul\u00E1rio."
|
|
908
|
+
},
|
|
909
|
+
"complexType": {
|
|
910
|
+
"original": "string",
|
|
911
|
+
"resolved": "string",
|
|
912
|
+
"references": {}
|
|
913
|
+
}
|
|
914
|
+
}, {
|
|
1029
915
|
"method": "snkMasterFormConfigChange",
|
|
1030
916
|
"name": "snkMasterFormConfigChange",
|
|
1031
917
|
"bubbles": true,
|
|
@@ -1284,9 +1170,8 @@ export class SnkGuidesViewer {
|
|
|
1284
1170
|
}];
|
|
1285
1171
|
}
|
|
1286
1172
|
}
|
|
1287
|
-
var
|
|
1288
|
-
(function (
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
})(TASKBAR_ID || (TASKBAR_ID = {}));
|
|
1173
|
+
var GUIDES_VIEWER_VIEW_MODE;
|
|
1174
|
+
(function (GUIDES_VIEWER_VIEW_MODE) {
|
|
1175
|
+
GUIDES_VIEWER_VIEW_MODE[GUIDES_VIEWER_VIEW_MODE["GUIDES"] = 0] = "GUIDES";
|
|
1176
|
+
GUIDES_VIEWER_VIEW_MODE[GUIDES_VIEWER_VIEW_MODE["CONFIG"] = 1] = "CONFIG";
|
|
1177
|
+
})(GUIDES_VIEWER_VIEW_MODE || (GUIDES_VIEWER_VIEW_MODE = {}));
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { PresentationMode } from "../../../lib";
|
|
2
|
+
import { VIEW_MODE } from "../../../lib/utils/constants";
|
|
3
|
+
import { TaskbarElement } from "../../snk-taskbar/elements/taskbar-elements";
|
|
4
|
+
export const DEFAULT_TASKBAR_BUTTONS = [
|
|
5
|
+
TaskbarElement.FORM_MODE,
|
|
6
|
+
TaskbarElement.PREVIOUS,
|
|
7
|
+
TaskbarElement.NEXT,
|
|
8
|
+
TaskbarElement.REFRESH,
|
|
9
|
+
TaskbarElement.SPACER,
|
|
10
|
+
TaskbarElement.ACTIONS_BUTTON,
|
|
11
|
+
TaskbarElement.DATA_EXPORTER,
|
|
12
|
+
TaskbarElement.ATTACH,
|
|
13
|
+
TaskbarElement.CLONE,
|
|
14
|
+
TaskbarElement.UPDATE,
|
|
15
|
+
TaskbarElement.REMOVE,
|
|
16
|
+
TaskbarElement.INSERT,
|
|
17
|
+
TaskbarElement.CONFIGURATOR,
|
|
18
|
+
TaskbarElement.MORE_OPTIONS,
|
|
19
|
+
];
|
|
20
|
+
export var CustomTaskbarButton;
|
|
21
|
+
(function (CustomTaskbarButton) {
|
|
22
|
+
CustomTaskbarButton["FILTER"] = "FILTER";
|
|
23
|
+
CustomTaskbarButton["ENTITY_SEARCH"] = "ENTITY_SEARCH";
|
|
24
|
+
})(CustomTaskbarButton || (CustomTaskbarButton = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Insere os botões customizados à esquerda do elemento SPACER na lista de botões.
|
|
27
|
+
* Caso o SPACER não seja encontrado, os botões são inseridos no início da lista.
|
|
28
|
+
*/
|
|
29
|
+
function insertCustomButtonsBeforeSpacer(buttons, customButtons) {
|
|
30
|
+
const spacerIndex = buttons.findIndex(btn => btn === TaskbarElement.SPACER || (typeof btn === 'string' && btn === 'SPACER'));
|
|
31
|
+
if (spacerIndex > -1) {
|
|
32
|
+
return [
|
|
33
|
+
...buttons.slice(0, spacerIndex),
|
|
34
|
+
...customButtons,
|
|
35
|
+
...buttons.slice(spacerIndex),
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
return [...customButtons, ...buttons];
|
|
39
|
+
}
|
|
40
|
+
export function buildNativeTaskbarManager(currentViewMode, mergeTaskbarManager, messagesBuilder) {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
const CUSTOM_BUTTONS = [
|
|
43
|
+
{
|
|
44
|
+
name: CustomTaskbarButton.FILTER,
|
|
45
|
+
hint: (_a = messagesBuilder === null || messagesBuilder === void 0 ? void 0 : messagesBuilder.getMessage("snkCrud.customButtons.filter")) !== null && _a !== void 0 ? _a : "Abre o painel de filtros",
|
|
46
|
+
iconName: "filter",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: CustomTaskbarButton.ENTITY_SEARCH,
|
|
50
|
+
hint: (_b = messagesBuilder === null || messagesBuilder === void 0 ? void 0 : messagesBuilder.getMessage("snkCrud.customButtons.entitySearch")) !== null && _b !== void 0 ? _b : "Busca na entidade",
|
|
51
|
+
iconName: "search",
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
const EDITION_MODE_BUTTONS = [
|
|
55
|
+
TaskbarElement.CANCEL,
|
|
56
|
+
TaskbarElement.SAVE,
|
|
57
|
+
];
|
|
58
|
+
return {
|
|
59
|
+
getButtons: (taskbarID, dataState, defaultButtons) => {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
if (!taskbarID) {
|
|
62
|
+
console.warn('taskbarID não fornecido');
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
const isInEditionMode = (dataState === null || dataState === void 0 ? void 0 : dataState.insertionMode) || (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty);
|
|
66
|
+
if (isInEditionMode) {
|
|
67
|
+
return EDITION_MODE_BUTTONS;
|
|
68
|
+
}
|
|
69
|
+
if (currentViewMode === VIEW_MODE.FORM) {
|
|
70
|
+
const indexFormMode = defaultButtons.indexOf(TaskbarElement.FORM_MODE);
|
|
71
|
+
if (indexFormMode > -1) {
|
|
72
|
+
defaultButtons = [
|
|
73
|
+
...defaultButtons.slice(0, indexFormMode),
|
|
74
|
+
TaskbarElement.GRID_MODE,
|
|
75
|
+
...defaultButtons.slice(indexFormMode + 1)
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (((_b = (_a = dataState === null || dataState === void 0 ? void 0 : dataState.selectionInfo) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.length) > 1) {
|
|
80
|
+
const indexUpdate = defaultButtons.indexOf(TaskbarElement.UPDATE);
|
|
81
|
+
if (indexUpdate > -1) {
|
|
82
|
+
defaultButtons = [
|
|
83
|
+
...defaultButtons.slice(0, indexUpdate),
|
|
84
|
+
TaskbarElement.UPDATE_MULTIPLE,
|
|
85
|
+
...defaultButtons.slice(indexUpdate + 1)
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const defaultsWithCustomButtons = insertCustomButtonsBeforeSpacer(defaultButtons, CUSTOM_BUTTONS);
|
|
90
|
+
if (mergeTaskbarManager === null || mergeTaskbarManager === void 0 ? void 0 : mergeTaskbarManager.getButtons) {
|
|
91
|
+
return mergeTaskbarManager.getButtons(taskbarID, dataState, defaultsWithCustomButtons);
|
|
92
|
+
}
|
|
93
|
+
return defaultsWithCustomButtons;
|
|
94
|
+
},
|
|
95
|
+
isEnabled: (_, dataState, buttonName, originalValue) => {
|
|
96
|
+
var _a;
|
|
97
|
+
if (!dataState) {
|
|
98
|
+
return originalValue;
|
|
99
|
+
}
|
|
100
|
+
const hasSelectedRecord = dataState.selectedRecord !== undefined;
|
|
101
|
+
const buttonsRequiringSelection = [
|
|
102
|
+
TaskbarElement.UPDATE,
|
|
103
|
+
TaskbarElement.REMOVE,
|
|
104
|
+
TaskbarElement.ATTACH,
|
|
105
|
+
TaskbarElement.CLONE,
|
|
106
|
+
];
|
|
107
|
+
if (!hasSelectedRecord && buttonsRequiringSelection.includes(buttonName)) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
return (_a = mergeTaskbarManager === null || mergeTaskbarManager === void 0 ? void 0 : mergeTaskbarManager.isEnabled(_, dataState, buttonName, originalValue)) !== null && _a !== void 0 ? _a : originalValue;
|
|
111
|
+
},
|
|
112
|
+
getMoreOptions(taskbarId, configName, dataState, currentActions) {
|
|
113
|
+
var _a;
|
|
114
|
+
return (_a = mergeTaskbarManager === null || mergeTaskbarManager === void 0 ? void 0 : mergeTaskbarManager.getMoreOptions) === null || _a === void 0 ? void 0 : _a.call(mergeTaskbarManager, taskbarId, configName, dataState, currentActions);
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export function getHeaderTaskbarId(dataState, presentationMode) {
|
|
119
|
+
var _a;
|
|
120
|
+
const hasSelectedRecord = dataState && !!((_a = dataState.selectionInfo) === null || _a === void 0 ? void 0 : _a.length);
|
|
121
|
+
const taskbarIdPrefixLookup = {
|
|
122
|
+
primary: "snkGridHeaderTaskbar",
|
|
123
|
+
secondary: "snkGridHeaderTaskbar",
|
|
124
|
+
singleTaskbar: "snkGridHeaderTaskbar.singleTaskbar",
|
|
125
|
+
};
|
|
126
|
+
const taskbarIdPrefix = taskbarIdPrefixLookup[presentationMode];
|
|
127
|
+
let headerTaskbarId = hasSelectedRecord ? `${taskbarIdPrefix}.selected` : `${taskbarIdPrefix}.unselected`;
|
|
128
|
+
if ((dataState === null || dataState === void 0 ? void 0 : dataState.isDirty) && presentationMode === PresentationMode.SINGLE_TASKBAR) {
|
|
129
|
+
headerTaskbarId = "snkGridHeaderTaskbar.singleTaskbar.finish_edition";
|
|
130
|
+
}
|
|
131
|
+
return headerTaskbarId;
|
|
132
|
+
}
|
|
133
|
+
export function getTopTaskBarId(dataState, presentationMode) {
|
|
134
|
+
const suffixLookup = {
|
|
135
|
+
primary: '',
|
|
136
|
+
secondary: '.secondary',
|
|
137
|
+
singleTaskbar: '.singleTaskbar',
|
|
138
|
+
};
|
|
139
|
+
const sufix = suffixLookup[presentationMode];
|
|
140
|
+
if (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty) {
|
|
141
|
+
return `snkGridTopTaskbar.finish_edition${sufix}`;
|
|
142
|
+
}
|
|
143
|
+
return `snkGridTopTaskbar.regular${sufix}`;
|
|
144
|
+
}
|