@sankhyalabs/sankhyablocks 1.4.0-beta.1 → 1.4.0-beta.11
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/{SnkMessageBuilder-7717f1e4.js → SnkMessageBuilder-6c2f7bcd.js} +107 -131
- package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
- package/dist/cjs/configurableElementsStorage-93459c72.js +20 -0
- package/dist/cjs/constants-9056ca9e.js +84 -0
- package/dist/cjs/draggable.bundle-82a25c06.js +6886 -0
- package/dist/cjs/{filter-item-type.enum-e2e1bc5b.js → filter-item-type.enum-3daf58d3.js} +2 -0
- package/dist/cjs/form-config-fetcher-2de7c16a.js +6895 -0
- package/dist/cjs/{index-b0b676c5.js → index-20e8b68a.js} +165 -1473
- package/dist/cjs/loader.cjs.js +2 -18
- package/dist/cjs/sankhyablocks.cjs.js +4 -116
- package/dist/cjs/snk-application.cjs.entry.js +330 -7196
- package/dist/cjs/snk-config-modal.cjs.entry.js +62 -0
- package/dist/cjs/snk-config-options.cjs.entry.js +230 -0
- package/dist/cjs/snk-configurator_6.cjs.entry.js +1156 -0
- package/dist/cjs/snk-crud.cjs.entry.js +21 -13
- package/dist/cjs/snk-data-unit.cjs.entry.js +24 -32
- package/dist/cjs/snk-field-config_2.cjs.entry.js +135 -0
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +5 -2
- package/dist/cjs/snk-filter-detail.cjs.entry.js +62 -5
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +6 -3
- package/dist/cjs/snk-filter-number.cjs.entry.js +6 -3
- package/dist/cjs/snk-filter-period.cjs.entry.js +5 -2
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +89 -0
- package/dist/cjs/snk-filter-search.cjs.entry.js +7 -13
- package/dist/cjs/snk-filter-text.cjs.entry.js +2 -2
- package/dist/cjs/snk-form-config.cjs.entry.js +957 -0
- package/dist/cjs/snk-form.cjs.entry.js +41 -28
- package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
- package/dist/cjs/snk-tab-config.cjs.entry.js +321 -0
- package/dist/cjs/{taskbar-elements-283c737e.js → taskbar-elements-9a4b1e19.js} +10 -6
- package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
- package/dist/collection/collection-manifest.json +29 -1
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +1 -1
- package/dist/collection/components/snk-application/snk-application.js +236 -37
- package/dist/collection/components/snk-configurator/snk-configurator.js +261 -0
- package/dist/collection/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.js +16 -0
- package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.css +122 -0
- package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.js +137 -0
- package/dist/collection/components/snk-crud/snk-crud.js +46 -17
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +1 -28
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +100 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +23 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +24 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +24 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +23 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +180 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +22 -38
- 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/filter-item-type.enum.js +2 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +80 -20
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +65 -31
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +85 -19
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +222 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +39 -4
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +250 -141
- package/dist/collection/components/snk-form/snk-form.css +4 -0
- package/dist/collection/components/snk-form/snk-form.js +108 -30
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.css +9 -0
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.js +315 -0
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.css +164 -0
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +140 -0
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.css +185 -0
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +1062 -0
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.css +272 -0
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +476 -0
- package/dist/collection/components/snk-grid/snk-grid.js +94 -26
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +9 -5
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +35 -3
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +3 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +35 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +18 -10
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +106 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +15 -15
- package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +9 -1
- package/dist/collection/lib/index.js +1 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +11 -2
- package/dist/collection/lib/message/resources/crud-utils.msg.js +4 -0
- package/dist/collection/lib/message/resources/snk-configurator.msg.js +11 -0
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +14 -2
- package/dist/collection/lib/message/resources/snk-form.msg.js +59 -2
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -1
- package/dist/collection/lib/utils/CrudUtils.js +73 -0
- package/dist/collection/lib/utils/constants.js +72 -0
- package/dist/components/SnkMessageBuilder.js +108 -131
- package/dist/components/_commonjsHelpers.js +17 -0
- package/dist/components/constants.js +74 -0
- package/dist/components/filter-item-type.enum.js +2 -0
- package/dist/{sankhyablocks/snk-application.entry.js → components/form-config-fetcher.js} +88 -1347
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +8 -4
- package/dist/components/snk-application2.js +313 -7173
- package/dist/components/snk-config-modal.d.ts +11 -0
- package/dist/components/snk-config-modal.js +6 -0
- package/dist/components/snk-config-modal2.js +91 -0
- package/dist/components/snk-config-options.d.ts +11 -0
- package/dist/components/snk-config-options.js +6 -0
- package/dist/components/snk-config-options2.js +245 -0
- package/dist/components/snk-configurator.d.ts +11 -0
- package/dist/components/snk-configurator.js +6 -0
- package/dist/components/snk-configurator2.js +212 -0
- package/dist/components/snk-crud.js +76 -26
- package/dist/components/snk-data-unit.js +4 -13
- package/dist/components/snk-field-config.d.ts +11 -0
- package/dist/components/snk-field-config.js +6 -0
- package/dist/components/snk-field-config2.js +70 -0
- package/dist/components/snk-filter-bar2.js +354 -148
- package/dist/components/snk-filter-binary-select.js +5 -1
- package/dist/components/snk-filter-detail2.js +62 -5
- package/dist/components/snk-filter-item2.js +52 -33
- package/dist/components/snk-filter-list2.js +60 -22
- package/dist/components/snk-filter-modal.d.ts +11 -0
- package/dist/components/snk-filter-modal.js +6 -0
- package/dist/components/snk-filter-modal2.js +84 -0
- package/dist/components/snk-filter-multi-select.js +6 -2
- package/dist/components/snk-filter-number.js +6 -2
- package/dist/components/snk-filter-period.js +5 -1
- package/dist/components/snk-filter-personalized.d.ts +11 -0
- package/dist/components/snk-filter-personalized.js +108 -0
- package/dist/components/snk-filter-search.js +5 -12
- package/dist/components/snk-filter-text.js +1 -1
- package/dist/components/snk-form-config.d.ts +11 -0
- package/dist/components/snk-form-config.js +6 -0
- package/dist/components/snk-form-config2.js +996 -0
- package/dist/components/snk-form2.js +79 -29
- package/dist/components/snk-grid2.js +57 -32
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-tab-config.d.ts +11 -0
- package/dist/components/snk-tab-config.js +6 -0
- package/dist/components/snk-tab-config2.js +7220 -0
- package/dist/components/snk-taskbar2.js +28 -10
- package/dist/components/teste-pesquisa.js +1 -1
- package/dist/{sankhyablocks/SnkMessageBuilder-a7da466b.js → esm/SnkMessageBuilder-5792c260.js} +108 -131
- package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
- package/dist/esm/configurableElementsStorage-cdc144b5.js +18 -0
- package/dist/esm/constants-c6039d3d.js +74 -0
- package/dist/esm/draggable.bundle-41d56f06.js +6884 -0
- package/dist/esm/{filter-item-type.enum-61fbf80a.js → filter-item-type.enum-a79b2fa8.js} +2 -0
- package/dist/esm/form-config-fetcher-96c6c2dc.js +6889 -0
- package/dist/{sankhyablocks/index-2b4d2d14.js → esm/index-e4121713.js} +165 -1466
- package/dist/esm/loader.js +2 -18
- package/dist/esm/sankhyablocks.js +4 -116
- package/dist/esm/snk-application.entry.js +308 -7174
- package/dist/esm/snk-config-modal.entry.js +58 -0
- package/dist/esm/snk-config-options.entry.js +226 -0
- package/dist/esm/snk-configurator_6.entry.js +1147 -0
- package/dist/esm/snk-crud.entry.js +20 -12
- package/dist/esm/snk-data-unit.entry.js +5 -13
- package/dist/esm/snk-field-config_2.entry.js +130 -0
- package/dist/esm/snk-filter-binary-select.entry.js +5 -2
- package/dist/esm/snk-filter-detail.entry.js +62 -5
- package/dist/esm/snk-filter-multi-select.entry.js +6 -3
- package/dist/esm/snk-filter-number.entry.js +6 -3
- package/dist/esm/snk-filter-period.entry.js +5 -2
- package/dist/esm/snk-filter-personalized.entry.js +85 -0
- package/dist/esm/snk-filter-search.entry.js +6 -12
- package/dist/esm/snk-filter-text.entry.js +2 -2
- package/dist/esm/snk-form-config.entry.js +953 -0
- package/dist/esm/snk-form.entry.js +40 -27
- package/dist/esm/snk-pesquisa.entry.js +2 -2
- package/dist/esm/snk-tab-config.entry.js +317 -0
- package/dist/{sankhyablocks/taskbar-elements-35d64ff9.js → esm/taskbar-elements-e2ed0536.js} +10 -6
- package/dist/esm/teste-pesquisa.entry.js +2 -2
- package/dist/sankhyablocks/index.esm.js +0 -1
- package/dist/sankhyablocks/p-029ae4e4.entry.js +1 -0
- package/dist/sankhyablocks/p-03f9c407.js +1 -0
- package/dist/sankhyablocks/p-112455b1.js +1 -0
- package/dist/sankhyablocks/p-12ad2a19.entry.js +1 -0
- package/dist/sankhyablocks/p-21c8929b.js +1 -0
- package/dist/sankhyablocks/p-2b891c4a.entry.js +1 -0
- package/dist/sankhyablocks/p-2dc76d79.entry.js +1 -0
- package/dist/sankhyablocks/p-361299e8.js +26 -0
- package/dist/sankhyablocks/p-3a276f3d.entry.js +1 -0
- package/dist/sankhyablocks/p-400cc777.entry.js +1 -0
- package/dist/sankhyablocks/p-44ce5b90.entry.js +1 -0
- package/dist/sankhyablocks/p-521c96f0.entry.js +1 -0
- package/dist/sankhyablocks/p-60eef7cd.entry.js +1 -0
- package/dist/sankhyablocks/p-6988f4a6.entry.js +1 -0
- package/dist/sankhyablocks/p-6a4162bd.entry.js +1 -0
- package/dist/sankhyablocks/p-776ff4d1.entry.js +1 -0
- package/dist/sankhyablocks/p-9ba3df4c.js +2 -0
- package/dist/sankhyablocks/p-9dc4426d.entry.js +1 -0
- package/dist/sankhyablocks/p-9dd2b8cb.js +1 -0
- package/dist/sankhyablocks/p-a17a4fca.entry.js +1 -0
- package/dist/sankhyablocks/p-a5b26df2.js +1 -0
- package/dist/sankhyablocks/p-b6d6b172.js +1 -0
- package/dist/sankhyablocks/p-cc4bef9f.entry.js +1 -0
- package/dist/sankhyablocks/p-d50651a3.js +1 -0
- package/dist/sankhyablocks/p-d690b6b5.entry.js +75 -0
- package/dist/sankhyablocks/p-d9fbb26f.js +1 -0
- package/dist/sankhyablocks/p-deb1f523.entry.js +1 -0
- package/dist/sankhyablocks/p-e871aa92.entry.js +1 -0
- package/dist/sankhyablocks/p-e9beab79.entry.js +1 -0
- package/dist/sankhyablocks/p-f37cdeb5.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -129
- package/dist/types/components/snk-application/snk-application.d.ts +38 -16
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +46 -0
- package/dist/types/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.d.ts +8 -0
- package/dist/types/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.d.ts +38 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +50 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +92 -0
- package/dist/types/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +2 -0
- 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/editors/snk-filter-personalized.d.ts +24 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +4 -5
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +3 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +7 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +40 -0
- package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +8 -3
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +26 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +31 -17
- package/dist/types/components/snk-form/snk-form.d.ts +71 -0
- package/dist/types/components/snk-form/subcomponents/snk-config-options/snk-config-options.d.ts +51 -0
- package/dist/types/components/snk-form/subcomponents/snk-field-config/snk-field-config.d.ts +32 -0
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +139 -0
- package/dist/types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.d.ts +97 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +59 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +6 -5
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -3
- package/dist/types/components.d.ts +424 -24
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +21 -3
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +7 -7
- package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +1 -0
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/lib/message/resources/crud-utils.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-configurator.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-form.msg.d.ts +5 -2
- package/dist/types/lib/utils/CrudUtils.d.ts +6 -0
- package/dist/types/lib/utils/constants.d.ts +76 -0
- package/dist/types/lib/utils/pesquisa.d.ts +2 -1
- package/package.json +4 -3
- package/react/components.d.ts +25 -0
- package/react/components.js +25 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-b8158822.js +0 -6
- package/dist/cjs/dom-36862b77.js +0 -75
- package/dist/cjs/index-02201bc9.js +0 -2397
- package/dist/cjs/shadow-css-346c0795.js +0 -389
- package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -278
- package/dist/cjs/snk-filter-item.cjs.entry.js +0 -154
- package/dist/cjs/snk-filter-list.cjs.entry.js +0 -91
- package/dist/cjs/snk-grid.cjs.entry.js +0 -79
- package/dist/cjs/snk-taskbar.cjs.entry.js +0 -160
- package/dist/components/index2.js +0 -2384
- package/dist/esm/SnkMessageBuilder-a7da466b.js +0 -303
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/css-shim-b3f2ee8d.js +0 -4
- package/dist/esm/dom-665d6011.js +0 -73
- package/dist/esm/index-2b4d2d14.js +0 -3262
- package/dist/esm/index-f1d3e4da.js +0 -2384
- package/dist/esm/shadow-css-b18e99d7.js +0 -387
- package/dist/esm/snk-filter-bar.entry.js +0 -274
- package/dist/esm/snk-filter-item.entry.js +0 -150
- package/dist/esm/snk-filter-list.entry.js +0 -87
- package/dist/esm/snk-grid.entry.js +0 -75
- package/dist/esm/snk-taskbar.entry.js +0 -156
- package/dist/esm/taskbar-elements-35d64ff9.js +0 -90
- package/dist/sankhyablocks/app-globals-0f993ce5.js +0 -3
- package/dist/sankhyablocks/css-shim-b3f2ee8d.js +0 -4
- package/dist/sankhyablocks/dom-665d6011.js +0 -73
- package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +0 -12
- package/dist/sankhyablocks/index-f1d3e4da.js +0 -2384
- package/dist/sankhyablocks/shadow-css-b18e99d7.js +0 -387
- package/dist/sankhyablocks/snk-crud.entry.js +0 -66
- package/dist/sankhyablocks/snk-data-unit.entry.js +0 -276
- package/dist/sankhyablocks/snk-filter-bar.entry.js +0 -274
- package/dist/sankhyablocks/snk-filter-binary-select.entry.js +0 -43
- package/dist/sankhyablocks/snk-filter-detail.entry.js +0 -45
- package/dist/sankhyablocks/snk-filter-item.entry.js +0 -150
- package/dist/sankhyablocks/snk-filter-list.entry.js +0 -87
- package/dist/sankhyablocks/snk-filter-multi-select.entry.js +0 -19
- package/dist/sankhyablocks/snk-filter-number.entry.js +0 -20
- package/dist/sankhyablocks/snk-filter-period.entry.js +0 -33
- package/dist/sankhyablocks/snk-filter-search.entry.js +0 -40
- package/dist/sankhyablocks/snk-filter-text.entry.js +0 -18
- package/dist/sankhyablocks/snk-form.entry.js +0 -129
- package/dist/sankhyablocks/snk-grid.entry.js +0 -75
- package/dist/sankhyablocks/snk-pesquisa.entry.js +0 -311
- package/dist/sankhyablocks/snk-taskbar.entry.js +0 -156
- package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +0 -45
- package/dist/sankhyablocks/teste-pesquisa.entry.js +0 -33
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
import { h, Host, Fragment } from "@stencil/core";
|
|
2
|
+
import { Sortable } from '@shopify/draggable';
|
|
3
|
+
import { ApplicationContext } from "@sankhyalabs/core";
|
|
4
|
+
import { CONFIG_EVENTS, KEY_EVENTS, TAB_NAMES, TYPE_ACTIONS } from "../../../../lib/utils/constants";
|
|
5
|
+
export class SnkTabConfig {
|
|
6
|
+
constructor() {
|
|
7
|
+
this._refTabActions = [];
|
|
8
|
+
this._actionsHide = [];
|
|
9
|
+
this._actionsShow = [];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
13
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
|
14
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
15
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-form.msg.ts"
|
|
16
|
+
*/
|
|
17
|
+
getMessage(key, params) {
|
|
18
|
+
return this._application.messagesBuilder.getMessage(key, params);
|
|
19
|
+
}
|
|
20
|
+
controlSortableTab() {
|
|
21
|
+
if (this._sortableTab) {
|
|
22
|
+
this._sortableTab.destroy();
|
|
23
|
+
}
|
|
24
|
+
this._sortableTab = new Sortable(this._hostElem.querySelectorAll('[data-draggable-parent="tab"]'), {
|
|
25
|
+
draggable: '[data-draggable-element="tab"]',
|
|
26
|
+
mirror: {
|
|
27
|
+
constrainDimensions: true
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
this._sortableTab.on(CONFIG_EVENTS.dragStart, (evt) => this.controlStartDraggingTab(evt));
|
|
31
|
+
this._sortableTab.on(CONFIG_EVENTS.dragStop, (evt) => this.controlStopDraggingTab(evt));
|
|
32
|
+
}
|
|
33
|
+
controlStartDraggingTab(evt) {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
const mouseEvent = (_a = evt === null || evt === void 0 ? void 0 : evt.dragEvent) === null || _a === void 0 ? void 0 : _a.originalEvent;
|
|
36
|
+
const targetElement = mouseEvent === null || mouseEvent === void 0 ? void 0 : mouseEvent.target;
|
|
37
|
+
const targetName = (_b = targetElement === null || targetElement === void 0 ? void 0 : targetElement.tagName) === null || _b === void 0 ? void 0 : _b.toUpperCase();
|
|
38
|
+
if (this._activeEditText === true || targetName === "EZ-ACTIONS-BUTTON") {
|
|
39
|
+
evt === null || evt === void 0 ? void 0 : evt.cancel();
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
this.canStartDrag.emit();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
controlStopDraggingTab(evt) {
|
|
46
|
+
const updateTimer = 500;
|
|
47
|
+
if (evt.data.newIndex !== evt.data.oldIndex) {
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
const newIndex = (evt.data.newIndex || 0) + 1;
|
|
50
|
+
this.ezOrderChange.emit(newIndex);
|
|
51
|
+
}, updateTimer);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
handleTabClick(tab) {
|
|
55
|
+
this.selectedIndex = tab.index;
|
|
56
|
+
this._focusedIndex = tab.index;
|
|
57
|
+
this.selectedTab = tab.tabKey;
|
|
58
|
+
this.ezTabChange.emit(tab);
|
|
59
|
+
this.setFocusedBtn(false, tab.index);
|
|
60
|
+
this.setFocusedTab(tab.index);
|
|
61
|
+
}
|
|
62
|
+
handleSlotChange(ev) {
|
|
63
|
+
const slot = ev.target;
|
|
64
|
+
const content = slot.assignedElements()[0];
|
|
65
|
+
if (content) {
|
|
66
|
+
content.classList.add("tab-config__slot");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
scrollBackward() {
|
|
70
|
+
const container = this._scrollContainer;
|
|
71
|
+
if (container) {
|
|
72
|
+
container.scrollLeft -= container.clientWidth;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
scrollFoward() {
|
|
76
|
+
const container = this._scrollContainer;
|
|
77
|
+
if (container) {
|
|
78
|
+
let lastTab = null;
|
|
79
|
+
container.querySelectorAll(".tab-config__tab").forEach((tab) => {
|
|
80
|
+
if (tab.getBoundingClientRect().right < container.clientWidth) {
|
|
81
|
+
lastTab = tab;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
container.scrollLeft = lastTab.offsetLeft + lastTab.offsetWidth;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
updateScroll() {
|
|
88
|
+
const container = this._scrollContainer;
|
|
89
|
+
if (container) {
|
|
90
|
+
const { scrollWidth, clientWidth, scrollLeft } = container;
|
|
91
|
+
const remainingScroll = scrollWidth - clientWidth - Math.ceil(scrollLeft);
|
|
92
|
+
this._startHidden = container.scrollLeft > 0;
|
|
93
|
+
this._endHidden = remainingScroll > 0;
|
|
94
|
+
if (this._startHidden) {
|
|
95
|
+
this._backwardButton.classList.remove("tab-config__hidden");
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
this._backwardButton.classList.add("tab-config__hidden");
|
|
99
|
+
}
|
|
100
|
+
if (this._endHidden) {
|
|
101
|
+
this._forwardButton.classList.remove("tab-config__hidden");
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
this._forwardButton.classList.add("tab-config__hidden");
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
domScrollHandler() {
|
|
109
|
+
window.clearTimeout(this._scrollCallBackScroll);
|
|
110
|
+
this._scrollCallBackScroll = window.setTimeout(() => { this.updateScroll(); }, 200);
|
|
111
|
+
}
|
|
112
|
+
setFocusedTab(index) {
|
|
113
|
+
window.clearTimeout(this._scrollCallBackFocus);
|
|
114
|
+
this._scrollCallBackFocus = window.setTimeout(() => {
|
|
115
|
+
const tabtoscroll = this._scrollContainer.querySelector(`#tab${index}`);
|
|
116
|
+
tabtoscroll.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
117
|
+
}, 200);
|
|
118
|
+
}
|
|
119
|
+
controlKeyEventEnter(evt) {
|
|
120
|
+
evt.preventDefault();
|
|
121
|
+
const selectedTab = this._processedTabs[this._focusedIndex];
|
|
122
|
+
this.handleTabClick(selectedTab);
|
|
123
|
+
this.setFocusedTab(selectedTab.index);
|
|
124
|
+
}
|
|
125
|
+
controlKeyEventArrow(evt) {
|
|
126
|
+
let operator = undefined;
|
|
127
|
+
if (evt.key === KEY_EVENTS.arrowLeft) {
|
|
128
|
+
operator = false;
|
|
129
|
+
}
|
|
130
|
+
else if (evt.key === KEY_EVENTS.arrowRight) {
|
|
131
|
+
operator = true;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (this._focusedIndex === undefined) {
|
|
137
|
+
if (operator === false) {
|
|
138
|
+
this._focusedIndex = this.selectedIndex !== undefined ? this.selectedIndex - 1 : undefined;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
this._focusedIndex = this.selectedIndex !== undefined ? this.selectedIndex + 1 : undefined;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
if (operator === false) {
|
|
146
|
+
this._focusedIndex = this._focusedIndex - 1;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
this._focusedIndex = this._focusedIndex + 1;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (this._focusedIndex < 0) {
|
|
153
|
+
this._focusedIndex = 0;
|
|
154
|
+
}
|
|
155
|
+
else if (this._focusedIndex > this._processedTabs.length - 1) {
|
|
156
|
+
this._focusedIndex = this._processedTabs.length - 1;
|
|
157
|
+
}
|
|
158
|
+
this.setFocusedBtn(true, this._focusedIndex);
|
|
159
|
+
this.setFocusedTab(this._focusedIndex);
|
|
160
|
+
}
|
|
161
|
+
controlKeyEventEscape(evt) {
|
|
162
|
+
evt.preventDefault();
|
|
163
|
+
const currentTab = this._processedTabs[this.selectedIndex];
|
|
164
|
+
this._focusedIndex = undefined;
|
|
165
|
+
this.handleTabClick(currentTab);
|
|
166
|
+
this.setFocusedTab(this.selectedIndex);
|
|
167
|
+
}
|
|
168
|
+
setFocusedParam(evt) {
|
|
169
|
+
if (this._activeEditText === true || evt == undefined) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (evt.key === KEY_EVENTS.enter) {
|
|
173
|
+
this.controlKeyEventEnter(evt);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (evt.key === KEY_EVENTS.arrowLeft || evt.key === KEY_EVENTS.arrowRight) {
|
|
177
|
+
this.controlKeyEventArrow(evt);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (evt.key === KEY_EVENTS.tab || evt.key === KEY_EVENTS.escape) {
|
|
181
|
+
this.controlKeyEventEscape(evt);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
setFocusedBtn(visible, parameter) {
|
|
186
|
+
const tabsButtons = this._scrollContainer.querySelectorAll(".tab-config__tab");
|
|
187
|
+
tabsButtons.forEach((el) => {
|
|
188
|
+
el.classList.remove("tab-config__tab--is-focused");
|
|
189
|
+
if (el.id === "tab" + parameter && visible) {
|
|
190
|
+
el.classList.add("tab-config__tab--is-focused");
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
getStyledLabel(tabId) {
|
|
195
|
+
const tabElem = this._hostElem.querySelector(`#${tabId}`);
|
|
196
|
+
if (tabElem == undefined) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
let styledLabel = {
|
|
200
|
+
fontSize: window.getComputedStyle(tabElem).getPropertyValue('font-size'),
|
|
201
|
+
fontWeight: window.getComputedStyle(tabElem).getPropertyValue('font-weight'),
|
|
202
|
+
fontFamily: window.getComputedStyle(tabElem).getPropertyValue('font-family')
|
|
203
|
+
};
|
|
204
|
+
return styledLabel;
|
|
205
|
+
}
|
|
206
|
+
cancelEditText() {
|
|
207
|
+
var _a;
|
|
208
|
+
this._activeEditText = false;
|
|
209
|
+
if (this._scrollContainer != undefined) {
|
|
210
|
+
(_a = this._scrollContainer.querySelector('.tab-config__tab--is-active')) === null || _a === void 0 ? void 0 : _a.focus();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
handleActions(actionSelect, tab) {
|
|
214
|
+
const { value: typeAction } = actionSelect.detail;
|
|
215
|
+
if (typeAction === TYPE_ACTIONS.rename) {
|
|
216
|
+
this._activeEditText = true;
|
|
217
|
+
this._activeEditTextIndex = tab.index;
|
|
218
|
+
}
|
|
219
|
+
else if (typeAction === TYPE_ACTIONS.hide || typeAction === TYPE_ACTIONS.show) {
|
|
220
|
+
this.hideTab.emit(tab);
|
|
221
|
+
}
|
|
222
|
+
else if (typeAction === TYPE_ACTIONS.delete) {
|
|
223
|
+
this.deleteTab.emit(tab);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
handleSaveEditionText(editDetails) {
|
|
227
|
+
const { value, newValue } = editDetails.detail;
|
|
228
|
+
this._processedTabs.forEach((tab) => {
|
|
229
|
+
if (tab.label === value) {
|
|
230
|
+
tab.label = newValue;
|
|
231
|
+
this.cancelEditText();
|
|
232
|
+
this.editionTitleTab.emit(editDetails);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
onHideActions(index) {
|
|
237
|
+
const elementActionsBtn = this._refTabActions[index];
|
|
238
|
+
if (elementActionsBtn) {
|
|
239
|
+
elementActionsBtn.isOpened().then((isOpened) => {
|
|
240
|
+
if (isOpened) {
|
|
241
|
+
elementActionsBtn === null || elementActionsBtn === void 0 ? void 0 : elementActionsBtn.hideActions();
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
componentWillLoad() {
|
|
247
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
248
|
+
if (this._application != undefined) {
|
|
249
|
+
this._actionsHide = [
|
|
250
|
+
{ value: TYPE_ACTIONS.rename, label: this.getMessage("snkTabConfig.labelRename") },
|
|
251
|
+
{ value: TYPE_ACTIONS.hide, label: this.getMessage("snkTabConfig.labelHide") },
|
|
252
|
+
{ value: TYPE_ACTIONS.delete, label: this.getMessage("snkTabConfig.labelDelete") }
|
|
253
|
+
];
|
|
254
|
+
this._actionsShow = [
|
|
255
|
+
{ value: TYPE_ACTIONS.rename, label: this.getMessage("snkTabConfig.labelRename") },
|
|
256
|
+
{ value: TYPE_ACTIONS.show, label: this.getMessage("snkTabConfig.labelShow") },
|
|
257
|
+
{ value: TYPE_ACTIONS.delete, label: this.getMessage("snkTabConfig.labelDelete") }
|
|
258
|
+
];
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
componentWillRender() {
|
|
262
|
+
if (this._processedTabs == undefined) {
|
|
263
|
+
this._processedTabs = [];
|
|
264
|
+
if (this.tabs) {
|
|
265
|
+
this.tabs.split(",").forEach((label) => {
|
|
266
|
+
label = label.trim();
|
|
267
|
+
this._processedTabs.push({ label, tabKey: label, index: this._processedTabs.length });
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
this._hostElem.querySelectorAll("snk-tab").forEach((elem) => {
|
|
271
|
+
const tabKey = elem.getAttribute("tabKey");
|
|
272
|
+
const label = elem.getAttribute("label") !== TAB_NAMES.main ? elem.getAttribute("label") : this.getMessage("snkFormConfig.form.mainArea");
|
|
273
|
+
const visible = elem.hasAttribute("visible");
|
|
274
|
+
const tab = { label, tabKey, index: this._processedTabs.length, visible };
|
|
275
|
+
const content = elem.firstChild;
|
|
276
|
+
if (content) {
|
|
277
|
+
content.setAttribute("slot", "tab" + tab.index);
|
|
278
|
+
this._hostElem.appendChild(content);
|
|
279
|
+
}
|
|
280
|
+
this._processedTabs.push(tab);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
componentDidRender() {
|
|
285
|
+
this.updateScroll();
|
|
286
|
+
this.controlSortableTab();
|
|
287
|
+
}
|
|
288
|
+
render() {
|
|
289
|
+
return (h(Host, null, h("button", { class: "tab-config__backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), h("div", { class: "tab-config__lower-bar" }), h("div", { class: "tab-config__scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev), "data-draggable-parent": "tab" }, this._processedTabs.map((tab, index) => {
|
|
290
|
+
const tabId = "tab" + index;
|
|
291
|
+
const isSelected = index === this.selectedIndex || (this.selectedTab && tab.tabKey === this.selectedTab);
|
|
292
|
+
if (isSelected) {
|
|
293
|
+
this.selectedTab = tab.tabKey;
|
|
294
|
+
this.selectedIndex = index;
|
|
295
|
+
}
|
|
296
|
+
return h("button", { id: tabId, class: `tab-config__tab${isSelected ? " tab-config__tab--is-active" : ""}`, onClick: () => this.handleTabClick(tab), onDblClick: () => { this._activeEditText = true; this._activeEditTextIndex = index; }, "data-draggable-element": index > 0 ? "tab" : "", onMouseLeave: () => this.onHideActions(index) }, (this._activeEditText === true && this._activeEditTextIndex === index && index > 0) ||
|
|
297
|
+
h(Fragment, null, index > 0 && h("ez-icon", { iconName: tab.leftIcon || "drag-indicator", class: "tab-config__left-icon" }), (tab.visible === false && index > 0) && h("ez-icon", { iconName: tab.leftIcon || "eye-off", class: "tab-config__left-icon tab-config__left-icon--eye-off" }), h("span", { class: "tab-config__tab-label" + (tab.visible === false && index > 0 ? " tab-config__tab-label-disabled" : ""), title: tab.label }, tab.label), index > 0 &&
|
|
298
|
+
h("ez-actions-button", { class: "tab-config__actions-button", size: "small", ref: elem => this._refTabActions[index] = elem, actions: tab.visible === false ? this._actionsShow : this._actionsHide, isTransparent: true, arrowActive: true, onEzAction: (ev) => this.handleActions(ev, tab) }), h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } })), (this._activeEditText === true && index > 0 && this._activeEditTextIndex === index) &&
|
|
299
|
+
h("ez-text-edit", { value: tab.label, styled: this.getStyledLabel(tabId), class: "tab-config__edit-text", onSaveEdition: (ev) => this.handleSaveEditionText(ev), onCancelEdition: () => this.cancelEditText() }));
|
|
300
|
+
})), h("button", { class: "tab-config__forward-button", ref: (el) => this._forwardButton = el, onClick: () => this.scrollFoward() })));
|
|
301
|
+
}
|
|
302
|
+
static get is() { return "snk-tab-config"; }
|
|
303
|
+
static get encapsulation() { return "scoped"; }
|
|
304
|
+
static get originalStyleUrls() {
|
|
305
|
+
return {
|
|
306
|
+
"$": ["snk-tab-config.css"]
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
static get styleUrls() {
|
|
310
|
+
return {
|
|
311
|
+
"$": ["snk-tab-config.css"]
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
static get properties() {
|
|
315
|
+
return {
|
|
316
|
+
"selectedIndex": {
|
|
317
|
+
"type": "number",
|
|
318
|
+
"mutable": true,
|
|
319
|
+
"complexType": {
|
|
320
|
+
"original": "number",
|
|
321
|
+
"resolved": "number",
|
|
322
|
+
"references": {}
|
|
323
|
+
},
|
|
324
|
+
"required": false,
|
|
325
|
+
"optional": false,
|
|
326
|
+
"docs": {
|
|
327
|
+
"tags": [],
|
|
328
|
+
"text": "Define o index da aba selecionada."
|
|
329
|
+
},
|
|
330
|
+
"attribute": "selected-index",
|
|
331
|
+
"reflect": true
|
|
332
|
+
},
|
|
333
|
+
"selectedTab": {
|
|
334
|
+
"type": "string",
|
|
335
|
+
"mutable": true,
|
|
336
|
+
"complexType": {
|
|
337
|
+
"original": "string",
|
|
338
|
+
"resolved": "string",
|
|
339
|
+
"references": {}
|
|
340
|
+
},
|
|
341
|
+
"required": false,
|
|
342
|
+
"optional": false,
|
|
343
|
+
"docs": {
|
|
344
|
+
"tags": [],
|
|
345
|
+
"text": "Define a aba selecionada."
|
|
346
|
+
},
|
|
347
|
+
"attribute": "selected-tab",
|
|
348
|
+
"reflect": true
|
|
349
|
+
},
|
|
350
|
+
"tabs": {
|
|
351
|
+
"type": "string",
|
|
352
|
+
"mutable": false,
|
|
353
|
+
"complexType": {
|
|
354
|
+
"original": "string",
|
|
355
|
+
"resolved": "string",
|
|
356
|
+
"references": {}
|
|
357
|
+
},
|
|
358
|
+
"required": false,
|
|
359
|
+
"optional": false,
|
|
360
|
+
"docs": {
|
|
361
|
+
"tags": [],
|
|
362
|
+
"text": "Define o nome das abas do componente, separadas por v\u00EDrgulas \",\"."
|
|
363
|
+
},
|
|
364
|
+
"attribute": "tabs",
|
|
365
|
+
"reflect": false
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
static get states() {
|
|
370
|
+
return {
|
|
371
|
+
"_processedTabs": {},
|
|
372
|
+
"_activeEditText": {},
|
|
373
|
+
"_activeEditTextIndex": {},
|
|
374
|
+
"_actionsHide": {},
|
|
375
|
+
"_actionsShow": {}
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
static get events() {
|
|
379
|
+
return [{
|
|
380
|
+
"method": "ezTabChange",
|
|
381
|
+
"name": "ezTabChange",
|
|
382
|
+
"bubbles": true,
|
|
383
|
+
"cancelable": true,
|
|
384
|
+
"composed": true,
|
|
385
|
+
"docs": {
|
|
386
|
+
"tags": [],
|
|
387
|
+
"text": "Evento emitido ao clicar para abrir o popup (ezTabChange).\nO detail desse evento carrega tanto o tabKey quanto o index da aba\nselecionada."
|
|
388
|
+
},
|
|
389
|
+
"complexType": {
|
|
390
|
+
"original": "ITab",
|
|
391
|
+
"resolved": "ITab",
|
|
392
|
+
"references": {
|
|
393
|
+
"ITab": {
|
|
394
|
+
"location": "local"
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}, {
|
|
399
|
+
"method": "editionTitleTab",
|
|
400
|
+
"name": "editionTitleTab",
|
|
401
|
+
"bubbles": true,
|
|
402
|
+
"cancelable": true,
|
|
403
|
+
"composed": true,
|
|
404
|
+
"docs": {
|
|
405
|
+
"tags": [],
|
|
406
|
+
"text": "Evento emitido ao salvar uma altera\u00E7\u00E3o realizada no t\u00EDtulo da tab"
|
|
407
|
+
},
|
|
408
|
+
"complexType": {
|
|
409
|
+
"original": "any",
|
|
410
|
+
"resolved": "any",
|
|
411
|
+
"references": {}
|
|
412
|
+
}
|
|
413
|
+
}, {
|
|
414
|
+
"method": "deleteTab",
|
|
415
|
+
"name": "deleteTab",
|
|
416
|
+
"bubbles": true,
|
|
417
|
+
"cancelable": true,
|
|
418
|
+
"composed": true,
|
|
419
|
+
"docs": {
|
|
420
|
+
"tags": [],
|
|
421
|
+
"text": "Evento emitido ao deletar uma aba."
|
|
422
|
+
},
|
|
423
|
+
"complexType": {
|
|
424
|
+
"original": "any",
|
|
425
|
+
"resolved": "any",
|
|
426
|
+
"references": {}
|
|
427
|
+
}
|
|
428
|
+
}, {
|
|
429
|
+
"method": "hideTab",
|
|
430
|
+
"name": "hideTab",
|
|
431
|
+
"bubbles": true,
|
|
432
|
+
"cancelable": true,
|
|
433
|
+
"composed": true,
|
|
434
|
+
"docs": {
|
|
435
|
+
"tags": [],
|
|
436
|
+
"text": "Evento emitido ao ocultar uma aba."
|
|
437
|
+
},
|
|
438
|
+
"complexType": {
|
|
439
|
+
"original": "any",
|
|
440
|
+
"resolved": "any",
|
|
441
|
+
"references": {}
|
|
442
|
+
}
|
|
443
|
+
}, {
|
|
444
|
+
"method": "ezOrderChange",
|
|
445
|
+
"name": "ezOrderChange",
|
|
446
|
+
"bubbles": true,
|
|
447
|
+
"cancelable": true,
|
|
448
|
+
"composed": true,
|
|
449
|
+
"docs": {
|
|
450
|
+
"tags": [],
|
|
451
|
+
"text": "Evento emitido ao mover a aba mudando a sua ordem."
|
|
452
|
+
},
|
|
453
|
+
"complexType": {
|
|
454
|
+
"original": "number",
|
|
455
|
+
"resolved": "number",
|
|
456
|
+
"references": {}
|
|
457
|
+
}
|
|
458
|
+
}, {
|
|
459
|
+
"method": "canStartDrag",
|
|
460
|
+
"name": "canStartDrag",
|
|
461
|
+
"bubbles": true,
|
|
462
|
+
"cancelable": true,
|
|
463
|
+
"composed": true,
|
|
464
|
+
"docs": {
|
|
465
|
+
"tags": [],
|
|
466
|
+
"text": "Evento emitido ao ocultar uma aba."
|
|
467
|
+
},
|
|
468
|
+
"complexType": {
|
|
469
|
+
"original": "any",
|
|
470
|
+
"resolved": "any",
|
|
471
|
+
"references": {}
|
|
472
|
+
}
|
|
473
|
+
}];
|
|
474
|
+
}
|
|
475
|
+
static get elementRef() { return "_hostElem"; }
|
|
476
|
+
}
|
|
@@ -1,38 +1,43 @@
|
|
|
1
|
-
import { ApplicationContext } from '@sankhyalabs/core';
|
|
2
1
|
import { h } from '@stencil/core';
|
|
3
|
-
import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
|
|
4
2
|
import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
|
3
|
+
import ConfigurableElementsStorage from '../snk-configurator/subcomponents/configModalProvider/configurableElementsStorage';
|
|
5
4
|
export class SnkGrid {
|
|
6
5
|
constructor() {
|
|
7
6
|
this._topTaskbarProcessor = new TaskbarProcessor({
|
|
8
|
-
"snkGridTopTaskbar": ["FORM_MODE", "
|
|
7
|
+
"snkGridTopTaskbar": ["FORM_MODE", "CONFIGURATOR", "INSERT"]
|
|
9
8
|
});
|
|
10
9
|
this._headerTaskbarProcessor = new TaskbarProcessor({
|
|
11
10
|
"snkGridHeaderTaskbar.unselected": ["REFRESH"],
|
|
12
11
|
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
|
|
13
12
|
});
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Método responsável em abrir ou fechar o modal de configurações da grade.
|
|
16
|
+
*/
|
|
17
|
+
async setShowGridConfig(value) {
|
|
18
|
+
if (this._grid == undefined) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (value === true) {
|
|
17
22
|
this._grid.openGridConfig();
|
|
18
23
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const snkApplication = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
22
|
-
if (snkApplication) {
|
|
23
|
-
snkApplication.saveGridConfig(config);
|
|
24
|
+
else {
|
|
25
|
+
this._grid.closeGridConfig();
|
|
24
26
|
}
|
|
25
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Método responsável por setar as configurações da grade.
|
|
30
|
+
*/
|
|
31
|
+
async setConfig(config) {
|
|
32
|
+
this._gridConfig = config;
|
|
33
|
+
}
|
|
34
|
+
changeConfig(config) {
|
|
35
|
+
this.configChanged.emit(config);
|
|
36
|
+
}
|
|
37
|
+
componentDidRender() {
|
|
38
|
+
ConfigurableElementsStorage.setGrid(this.configName, this._element);
|
|
39
|
+
}
|
|
26
40
|
componentWillLoad() {
|
|
27
|
-
const snkApplication = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
28
|
-
if (snkApplication) {
|
|
29
|
-
snkApplication.loadGridConfig(this.configName).then(cfg => {
|
|
30
|
-
this._gridConfig = cfg;
|
|
31
|
-
this._configLoaded = true;
|
|
32
|
-
});
|
|
33
|
-
//Forçamos a carga dos acessos pra aproveitar a request inicial.
|
|
34
|
-
snkApplication.getAllAccess();
|
|
35
|
-
}
|
|
36
41
|
let parent = this._element.parentElement;
|
|
37
42
|
while (parent) {
|
|
38
43
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
@@ -57,10 +62,10 @@ export class SnkGrid {
|
|
|
57
62
|
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
|
|
58
63
|
}
|
|
59
64
|
render() {
|
|
60
|
-
if (!this.
|
|
65
|
+
if (!this._dataUnit) {
|
|
61
66
|
return undefined;
|
|
62
67
|
}
|
|
63
|
-
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-padding-bottom--medium ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium",
|
|
68
|
+
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-padding-bottom--medium ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.changeConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver }, h("snk-taskbar", { dataUnit: this._dataUnit, buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" }))));
|
|
64
69
|
}
|
|
65
70
|
static get is() { return "snk-grid"; }
|
|
66
71
|
static get encapsulation() { return "scoped"; }
|
|
@@ -137,7 +142,7 @@ export class SnkGrid {
|
|
|
137
142
|
}
|
|
138
143
|
},
|
|
139
144
|
"statusResolver": {
|
|
140
|
-
"type": "
|
|
145
|
+
"type": "unknown",
|
|
141
146
|
"mutable": false,
|
|
142
147
|
"complexType": {
|
|
143
148
|
"original": "IStatusResolver",
|
|
@@ -154,16 +159,13 @@ export class SnkGrid {
|
|
|
154
159
|
"docs": {
|
|
155
160
|
"tags": [],
|
|
156
161
|
"text": "Configura\u00E7\u00E3o do valor da coluna de status.\nExemplo: { \"RECDESP\": { \"-1\" : \"#BD0025\", \"1\" : \"#157A00\" } }"
|
|
157
|
-
}
|
|
158
|
-
"attribute": "status-resolver",
|
|
159
|
-
"reflect": false
|
|
162
|
+
}
|
|
160
163
|
}
|
|
161
164
|
};
|
|
162
165
|
}
|
|
163
166
|
static get states() {
|
|
164
167
|
return {
|
|
165
168
|
"_dataUnit": {},
|
|
166
|
-
"_configLoaded": {},
|
|
167
169
|
"_dataState": {},
|
|
168
170
|
"_gridConfig": {}
|
|
169
171
|
};
|
|
@@ -199,7 +201,73 @@ export class SnkGrid {
|
|
|
199
201
|
"resolved": "void",
|
|
200
202
|
"references": {}
|
|
201
203
|
}
|
|
204
|
+
}, {
|
|
205
|
+
"method": "configChanged",
|
|
206
|
+
"name": "configChanged",
|
|
207
|
+
"bubbles": true,
|
|
208
|
+
"cancelable": true,
|
|
209
|
+
"composed": true,
|
|
210
|
+
"docs": {
|
|
211
|
+
"tags": [],
|
|
212
|
+
"text": "Evento disparado quando as configura\u00E7\u00F5es s\u00E3o alteradas."
|
|
213
|
+
},
|
|
214
|
+
"complexType": {
|
|
215
|
+
"original": "IGridConfig",
|
|
216
|
+
"resolved": "IGridConfig",
|
|
217
|
+
"references": {
|
|
218
|
+
"IGridConfig": {
|
|
219
|
+
"location": "import",
|
|
220
|
+
"path": "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
202
224
|
}];
|
|
203
225
|
}
|
|
226
|
+
static get methods() {
|
|
227
|
+
return {
|
|
228
|
+
"setShowGridConfig": {
|
|
229
|
+
"complexType": {
|
|
230
|
+
"signature": "(value: boolean) => Promise<void>",
|
|
231
|
+
"parameters": [{
|
|
232
|
+
"tags": [],
|
|
233
|
+
"text": ""
|
|
234
|
+
}],
|
|
235
|
+
"references": {
|
|
236
|
+
"Promise": {
|
|
237
|
+
"location": "global"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"return": "Promise<void>"
|
|
241
|
+
},
|
|
242
|
+
"docs": {
|
|
243
|
+
"text": "M\u00E9todo respons\u00E1vel em abrir ou fechar o modal de configura\u00E7\u00F5es da grade.",
|
|
244
|
+
"tags": []
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"setConfig": {
|
|
248
|
+
"complexType": {
|
|
249
|
+
"signature": "(config: IGridConfig) => Promise<void>",
|
|
250
|
+
"parameters": [{
|
|
251
|
+
"tags": [],
|
|
252
|
+
"text": ""
|
|
253
|
+
}],
|
|
254
|
+
"references": {
|
|
255
|
+
"Promise": {
|
|
256
|
+
"location": "global"
|
|
257
|
+
},
|
|
258
|
+
"IGridConfig": {
|
|
259
|
+
"location": "import",
|
|
260
|
+
"path": "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"return": "Promise<void>"
|
|
264
|
+
},
|
|
265
|
+
"docs": {
|
|
266
|
+
"text": "M\u00E9todo respons\u00E1vel por setar as configura\u00E7\u00F5es da grade.",
|
|
267
|
+
"tags": []
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
}
|
|
204
272
|
static get elementRef() { return "_element"; }
|
|
205
273
|
}
|