@sankhyalabs/sankhyablocks 1.3.34 → 1.4.0-beta.10
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-6c2f7bcd.js +302 -0
- 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-3daf58d3.js +16 -0
- package/dist/cjs/form-config-fetcher-2de7c16a.js +6895 -0
- package/dist/cjs/{index-1133bc2a.js → index-20e8b68a.js} +964 -209
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/sankhyablocks.cjs.js +3 -3
- package/dist/cjs/snk-application.cjs.entry.js +680 -6994
- 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 +78 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +272 -0
- package/dist/cjs/snk-field-config_2.cjs.entry.js +135 -0
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +50 -0
- package/dist/cjs/snk-filter-detail.cjs.entry.js +106 -0
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +26 -0
- package/dist/cjs/snk-filter-number.cjs.entry.js +27 -0
- package/dist/cjs/snk-filter-period.cjs.entry.js +40 -0
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +89 -0
- package/dist/cjs/snk-filter-search.cjs.entry.js +38 -0
- package/dist/cjs/snk-filter-text.cjs.entry.js +22 -0
- package/dist/cjs/snk-form-config.cjs.entry.js +957 -0
- package/dist/cjs/snk-form.cjs.entry.js +146 -0
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-tab-config.cjs.entry.js +321 -0
- package/dist/cjs/taskbar-elements-9a4b1e19.js +97 -0
- package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +45 -2
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +9 -2
- package/dist/collection/components/snk-application/snk-application.js +1346 -642
- 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.css +6 -0
- package/dist/collection/components/snk-crud/snk-crud.js +232 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.css +6 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +517 -0
- 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 +111 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +87 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +88 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +101 -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 +102 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +63 -0
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +12 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +178 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +289 -0
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +299 -0
- 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 +149 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +462 -0
- package/dist/collection/components/snk-form/snk-form.css +38 -0
- package/dist/collection/components/snk-form/snk-form.js +336 -0
- 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.css +18 -0
- package/dist/collection/components/snk-grid/snk-grid.js +273 -0
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +80 -79
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +90 -0
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +43 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +339 -0
- package/dist/collection/components/teste-pesquisa/teste-pesquisa.js +12 -9
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +39 -14
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +87 -21
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +62 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +106 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -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/http/data-fetcher/fetchers/totals-fetcher.js +47 -0
- package/dist/collection/lib/index.js +2 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +130 -0
- 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-data-unit.msg.js +23 -0
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +30 -0
- package/dist/collection/lib/message/resources/snk-form.msg.js +67 -0
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +17 -0
- package/dist/collection/lib/utils/CrudUtils.js +73 -0
- package/dist/collection/lib/utils/constants.js +72 -0
- package/dist/components/SnkMessageBuilder.js +280 -0
- package/dist/components/_commonjsHelpers.js +17 -0
- package/dist/components/constants.js +74 -0
- package/dist/components/filter-item-type.enum.js +14 -0
- package/dist/components/form-config-fetcher.js +6889 -0
- package/dist/components/index.d.ts +26 -5
- package/dist/components/index.js +26 -0
- package/dist/components/snk-application2.js +681 -6980
- 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.d.ts +11 -0
- package/dist/components/snk-crud.js +183 -0
- package/dist/components/snk-data-unit.d.ts +11 -0
- package/dist/components/snk-data-unit.js +294 -0
- 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-bar.d.ts +11 -0
- package/dist/components/snk-filter-bar.js +6 -0
- package/dist/components/snk-filter-bar2.js +516 -0
- package/dist/components/snk-filter-binary-select.d.ts +11 -0
- package/dist/components/snk-filter-binary-select.js +67 -0
- package/dist/components/snk-filter-detail.d.ts +11 -0
- package/dist/components/snk-filter-detail.js +6 -0
- package/dist/components/snk-filter-detail2.js +120 -0
- package/dist/components/snk-filter-item.d.ts +11 -0
- package/dist/components/snk-filter-item.js +6 -0
- package/dist/components/snk-filter-item2.js +194 -0
- package/dist/components/snk-filter-list.d.ts +11 -0
- package/dist/components/snk-filter-list.js +6 -0
- package/dist/components/snk-filter-list2.js +149 -0
- 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.d.ts +11 -0
- package/dist/components/snk-filter-multi-select.js +43 -0
- package/dist/components/snk-filter-number.d.ts +11 -0
- package/dist/components/snk-filter-number.js +44 -0
- package/dist/components/snk-filter-period.d.ts +11 -0
- package/dist/components/snk-filter-period.js +57 -0
- 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.d.ts +11 -0
- package/dist/components/snk-filter-search.js +55 -0
- package/dist/components/snk-filter-text.d.ts +11 -0
- package/dist/components/snk-filter-text.js +38 -0
- 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-form.d.ts +11 -0
- package/dist/components/snk-form.js +6 -0
- package/dist/components/snk-form2.js +209 -0
- package/dist/components/snk-grid.d.ts +11 -0
- package/dist/components/snk-grid.js +6 -0
- package/dist/components/snk-grid2.js +152 -0
- 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-taskbar.d.ts +11 -0
- package/dist/components/snk-taskbar.js +6 -0
- package/dist/components/snk-taskbar2.js +282 -0
- package/dist/components/taskbar-processor.js +45 -0
- package/dist/esm/SnkMessageBuilder-5792c260.js +280 -0
- 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-a79b2fa8.js +14 -0
- package/dist/esm/form-config-fetcher-96c6c2dc.js +6889 -0
- package/dist/esm/{index-ffda6382.js → index-e4121713.js} +963 -210
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/sankhyablocks.js +3 -3
- package/dist/esm/snk-application.entry.js +667 -6981
- 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 +74 -0
- package/dist/esm/snk-data-unit.entry.js +268 -0
- package/dist/esm/snk-field-config_2.entry.js +130 -0
- package/dist/esm/snk-filter-binary-select.entry.js +46 -0
- package/dist/esm/snk-filter-detail.entry.js +102 -0
- package/dist/esm/snk-filter-multi-select.entry.js +22 -0
- package/dist/esm/snk-filter-number.entry.js +23 -0
- package/dist/esm/snk-filter-period.entry.js +36 -0
- package/dist/esm/snk-filter-personalized.entry.js +85 -0
- package/dist/esm/snk-filter-search.entry.js +34 -0
- package/dist/esm/snk-filter-text.entry.js +18 -0
- package/dist/esm/snk-form-config.entry.js +953 -0
- package/dist/esm/snk-form.entry.js +142 -0
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-tab-config.entry.js +317 -0
- package/dist/esm/taskbar-elements-e2ed0536.js +94 -0
- package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
- package/dist/esm/teste-pesquisa.entry.js +1 -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-1feabfc7.entry.js +1 -0
- package/dist/sankhyablocks/p-21c8929b.js +1 -0
- package/dist/sankhyablocks/p-2284c850.entry.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-2a7b4cb3.entry.js → p-44ce5b90.entry.js} +1 -1
- package/dist/sankhyablocks/p-521c96f0.entry.js +1 -0
- package/dist/sankhyablocks/{p-9520d78a.entry.js → p-6988f4a6.entry.js} +1 -1
- package/dist/sankhyablocks/p-776ff4d1.entry.js +1 -0
- package/dist/sankhyablocks/p-7b4a4a50.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/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/errorhandler/snk-error-handler.d.ts +1 -0
- package/dist/types/components/snk-application/snk-application.d.ts +178 -26
- 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 +13 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +9 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +9 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +15 -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 +11 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +8 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +11 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +20 -0
- 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 +45 -0
- 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 +65 -0
- 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 +30 -0
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +12 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +92 -0
- package/dist/types/components.d.ts +1100 -12
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +7 -6
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +21 -3
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +1 -1
- 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/http/data-fetcher/fetchers/totals-fetcher.d.ts +8 -0
- package/dist/types/lib/index.d.ts +2 -0
- package/dist/types/lib/message/SnkMessageBuilder.d.ts +42 -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-data-unit.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-form.msg.d.ts +5 -0
- package/dist/types/lib/message/resources/snk-taskbar.msg.d.ts +2 -0
- 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/dist/types/stencil-public-runtime.d.ts +15 -4
- package/loader/package.json +1 -0
- package/package.json +6 -5
- package/react/components.d.ts +23 -0
- package/react/components.js +23 -0
- package/react/components.js.map +1 -1
- package/dist/sankhyablocks/p-98e8490d.entry.js +0 -69
- package/dist/sankhyablocks/p-edcb9d8e.js +0 -2
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
+
import { V as VIEW_MODE } from './constants.js';
|
|
4
|
+
import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
|
|
5
|
+
import { d as defineCustomElement$f } from './snk-config-modal2.js';
|
|
6
|
+
import { d as defineCustomElement$e } from './snk-config-options2.js';
|
|
7
|
+
import { d as defineCustomElement$d } from './snk-configurator2.js';
|
|
8
|
+
import { d as defineCustomElement$c } from './snk-field-config2.js';
|
|
9
|
+
import { d as defineCustomElement$b } from './snk-filter-bar2.js';
|
|
10
|
+
import { d as defineCustomElement$a } from './snk-filter-detail2.js';
|
|
11
|
+
import { d as defineCustomElement$9 } from './snk-filter-item2.js';
|
|
12
|
+
import { d as defineCustomElement$8 } from './snk-filter-list2.js';
|
|
13
|
+
import { d as defineCustomElement$7 } from './snk-filter-modal2.js';
|
|
14
|
+
import { d as defineCustomElement$6 } from './snk-form2.js';
|
|
15
|
+
import { d as defineCustomElement$5 } from './snk-form-config2.js';
|
|
16
|
+
import { d as defineCustomElement$4 } from './snk-grid2.js';
|
|
17
|
+
import { d as defineCustomElement$3 } from './snk-tab-config2.js';
|
|
18
|
+
|
|
19
|
+
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
|
20
|
+
|
|
21
|
+
const GRID_MODE = VIEW_MODE.grid;
|
|
22
|
+
const FORM_MODE = VIEW_MODE.form;
|
|
23
|
+
const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
this.__registerHost();
|
|
27
|
+
this.actionClick = createEvent(this, "actionClick", 7);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Usado para alternar a visão entre GRID e FORM externamente.
|
|
31
|
+
*/
|
|
32
|
+
async goToView(mode) {
|
|
33
|
+
this.executeAction(mode);
|
|
34
|
+
}
|
|
35
|
+
async gridToForm(keepFormMode = false) {
|
|
36
|
+
this._backToGrid = !keepFormMode && await this._viewStack.getSelectedIndex() === GRID_MODE.index;
|
|
37
|
+
this._viewStack.show(FORM_MODE.index);
|
|
38
|
+
}
|
|
39
|
+
async executeAction(act) {
|
|
40
|
+
if (act === TaskbarElement.GRID_MODE) {
|
|
41
|
+
this._viewStack.show(GRID_MODE.index);
|
|
42
|
+
}
|
|
43
|
+
else if (act === TaskbarElement.FORM_MODE || act === TaskbarElement.UPDATE) {
|
|
44
|
+
this.gridToForm(act !== TaskbarElement.UPDATE);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
insertionModeHandler() {
|
|
48
|
+
this.gridToForm();
|
|
49
|
+
}
|
|
50
|
+
cancelHandler() {
|
|
51
|
+
if (this._backToGrid) {
|
|
52
|
+
this._viewStack.show(GRID_MODE.index);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
componentWillLoad() {
|
|
56
|
+
let parent = this._element.parentElement;
|
|
57
|
+
while (parent) {
|
|
58
|
+
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
59
|
+
this._snkDataUnit = parent;
|
|
60
|
+
this._snkDataUnit.addEventListener("insertionMode", () => this.insertionModeHandler());
|
|
61
|
+
this._snkDataUnit.addEventListener("cancelEdition", () => this.cancelHandler());
|
|
62
|
+
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
63
|
+
this._dataState = this._snkDataUnit.dataState;
|
|
64
|
+
if (!this._dataUnit) {
|
|
65
|
+
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
66
|
+
this._dataUnit = evt.detail;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
|
|
70
|
+
this._dataState = evt.detail;
|
|
71
|
+
});
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
parent = parent.parentElement;
|
|
75
|
+
}
|
|
76
|
+
if (!this.configName) {
|
|
77
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
78
|
+
this.configName = application.configName;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
render() {
|
|
82
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-configurator-parent": "snkConfigurator" }, h("stack-item", null, h("snk-grid", { configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList, statusResolver: this.statusResolver }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-form", { configName: this.configName, actionsList: this.actionsList, onExit: () => this._viewStack.show(GRID_MODE.index), recordsValidator: this.recordsValidator, taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail) }, h("slot", { name: "SnkFormTaskBar" })))));
|
|
83
|
+
}
|
|
84
|
+
get _element() { return this; }
|
|
85
|
+
static get style() { return snkCrudCss; }
|
|
86
|
+
}, [6, "snk-crud", {
|
|
87
|
+
"configName": [1025, "config-name"],
|
|
88
|
+
"actionsList": [16],
|
|
89
|
+
"taskbarManager": [16],
|
|
90
|
+
"recordsValidator": [16],
|
|
91
|
+
"statusResolver": [16],
|
|
92
|
+
"_dataUnit": [32],
|
|
93
|
+
"_dataState": [32],
|
|
94
|
+
"goToView": [64]
|
|
95
|
+
}]);
|
|
96
|
+
function defineCustomElement$1() {
|
|
97
|
+
if (typeof customElements === "undefined") {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const components = ["snk-crud", "snk-config-modal", "snk-config-options", "snk-configurator", "snk-field-config", "snk-filter-bar", "snk-filter-detail", "snk-filter-item", "snk-filter-list", "snk-filter-modal", "snk-form", "snk-form-config", "snk-grid", "snk-tab-config", "snk-taskbar"];
|
|
101
|
+
components.forEach(tagName => { switch (tagName) {
|
|
102
|
+
case "snk-crud":
|
|
103
|
+
if (!customElements.get(tagName)) {
|
|
104
|
+
customElements.define(tagName, SnkCrud$1);
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
case "snk-config-modal":
|
|
108
|
+
if (!customElements.get(tagName)) {
|
|
109
|
+
defineCustomElement$f();
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
case "snk-config-options":
|
|
113
|
+
if (!customElements.get(tagName)) {
|
|
114
|
+
defineCustomElement$e();
|
|
115
|
+
}
|
|
116
|
+
break;
|
|
117
|
+
case "snk-configurator":
|
|
118
|
+
if (!customElements.get(tagName)) {
|
|
119
|
+
defineCustomElement$d();
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
122
|
+
case "snk-field-config":
|
|
123
|
+
if (!customElements.get(tagName)) {
|
|
124
|
+
defineCustomElement$c();
|
|
125
|
+
}
|
|
126
|
+
break;
|
|
127
|
+
case "snk-filter-bar":
|
|
128
|
+
if (!customElements.get(tagName)) {
|
|
129
|
+
defineCustomElement$b();
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
132
|
+
case "snk-filter-detail":
|
|
133
|
+
if (!customElements.get(tagName)) {
|
|
134
|
+
defineCustomElement$a();
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
case "snk-filter-item":
|
|
138
|
+
if (!customElements.get(tagName)) {
|
|
139
|
+
defineCustomElement$9();
|
|
140
|
+
}
|
|
141
|
+
break;
|
|
142
|
+
case "snk-filter-list":
|
|
143
|
+
if (!customElements.get(tagName)) {
|
|
144
|
+
defineCustomElement$8();
|
|
145
|
+
}
|
|
146
|
+
break;
|
|
147
|
+
case "snk-filter-modal":
|
|
148
|
+
if (!customElements.get(tagName)) {
|
|
149
|
+
defineCustomElement$7();
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
case "snk-form":
|
|
153
|
+
if (!customElements.get(tagName)) {
|
|
154
|
+
defineCustomElement$6();
|
|
155
|
+
}
|
|
156
|
+
break;
|
|
157
|
+
case "snk-form-config":
|
|
158
|
+
if (!customElements.get(tagName)) {
|
|
159
|
+
defineCustomElement$5();
|
|
160
|
+
}
|
|
161
|
+
break;
|
|
162
|
+
case "snk-grid":
|
|
163
|
+
if (!customElements.get(tagName)) {
|
|
164
|
+
defineCustomElement$4();
|
|
165
|
+
}
|
|
166
|
+
break;
|
|
167
|
+
case "snk-tab-config":
|
|
168
|
+
if (!customElements.get(tagName)) {
|
|
169
|
+
defineCustomElement$3();
|
|
170
|
+
}
|
|
171
|
+
break;
|
|
172
|
+
case "snk-taskbar":
|
|
173
|
+
if (!customElements.get(tagName)) {
|
|
174
|
+
defineCustomElement$2();
|
|
175
|
+
}
|
|
176
|
+
break;
|
|
177
|
+
} });
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const SnkCrud = SnkCrud$1;
|
|
181
|
+
const defineCustomElement = defineCustomElement$1;
|
|
182
|
+
|
|
183
|
+
export { SnkCrud, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkDataUnit extends Components.SnkDataUnit, HTMLElement {}
|
|
4
|
+
export const SnkDataUnit: {
|
|
5
|
+
prototype: SnkDataUnit;
|
|
6
|
+
new (): SnkDataUnit;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { Action, ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
+
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
|
+
import { O as OperationMap } from './SnkMessageBuilder.js';
|
|
5
|
+
|
|
6
|
+
const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
|
|
7
|
+
|
|
8
|
+
const SnkDataUnit$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.dataStateChange = createEvent(this, "dataStateChange", 7);
|
|
13
|
+
this.dataUnitReady = createEvent(this, "dataUnitReady", 7);
|
|
14
|
+
this.insertionMode = createEvent(this, "insertionMode", 7);
|
|
15
|
+
this.cancelEdition = createEvent(this, "cancelEdition", 7);
|
|
16
|
+
this._onDataUnitResolve = [];
|
|
17
|
+
/**
|
|
18
|
+
* Determina quantas linhas são retornadas por página
|
|
19
|
+
*/
|
|
20
|
+
this.pageSize = 150;
|
|
21
|
+
this._dataUnitObserver = (action) => {
|
|
22
|
+
const duState = {
|
|
23
|
+
insertionMode: false,
|
|
24
|
+
hasNext: this.dataUnit.hasNext(),
|
|
25
|
+
hasPrevious: this.dataUnit.hasPrevious(),
|
|
26
|
+
copyMode: false,
|
|
27
|
+
isDirty: this.dataUnit.isDirty(),
|
|
28
|
+
hasDirtyRecords: this.dataUnit.hasDirtyRecords(),
|
|
29
|
+
selectedRecords: this.dataUnit.getSelectedRecords()
|
|
30
|
+
};
|
|
31
|
+
this.dataUnit.records.forEach(r => {
|
|
32
|
+
if (r.__record__id__.startsWith('NEW_')) {
|
|
33
|
+
duState.insertionMode = true;
|
|
34
|
+
duState.copyMode || (duState.copyMode = r['__record__source__id__'] != undefined);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
this.dataState = duState;
|
|
38
|
+
if (action.type === Action.DATA_SAVED) {
|
|
39
|
+
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
|
|
40
|
+
if (msg != undefined) {
|
|
41
|
+
this.showSuccessMessage(msg);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (action.type === Action.RECORDS_ADDED || action.type === Action.RECORDS_COPIED) {
|
|
45
|
+
this.insertionMode.emit();
|
|
46
|
+
}
|
|
47
|
+
if (action.type === Action.EDITION_CANCELED) {
|
|
48
|
+
this.cancelEdition.emit();
|
|
49
|
+
const cancelFinishMsg = this.getMessage("snkDataUnit.cancelInfo");
|
|
50
|
+
if (cancelFinishMsg != undefined) {
|
|
51
|
+
this.showSuccessMessage(cancelFinishMsg);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (action.type === Action.RECORDS_REMOVED) {
|
|
55
|
+
const removeFinishMsg = this.getMessage("snkDataUnit.removeInfo", action.payload.cachedRecords[0]);
|
|
56
|
+
if (removeFinishMsg != undefined) {
|
|
57
|
+
this.showSuccessMessage(removeFinishMsg);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
this._application.messagesBuilder.currentOperation = this.getMessageOperation();
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
observePageSize() {
|
|
64
|
+
if (this.dataUnit) {
|
|
65
|
+
this.dataUnit.pageSize = this.pageSize;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
observeDataUnitName(newValue, oldValue) {
|
|
69
|
+
if (oldValue != newValue) {
|
|
70
|
+
this.dataUnit = undefined;
|
|
71
|
+
this.dataUnitName = newValue;
|
|
72
|
+
this.loadDataUnit();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
observeEntityName(newValue, oldValue) {
|
|
76
|
+
if (oldValue != newValue) {
|
|
77
|
+
this.dataUnit = undefined;
|
|
78
|
+
this.entityName = newValue;
|
|
79
|
+
this.loadDataUnit();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
observeDataState(newValue, oldValue) {
|
|
83
|
+
if (oldValue != newValue) {
|
|
84
|
+
this.dataStateChange.emit(newValue);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
observeDataUnit() {
|
|
88
|
+
this.dataUnitReady.emit(this.dataUnit);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Pode-se obter o dataUnit através desse método. Outra forma, é ouvir o evento de
|
|
92
|
+
*
|
|
93
|
+
* @returns dataUnit
|
|
94
|
+
*/
|
|
95
|
+
async getDataUnit() {
|
|
96
|
+
return new Promise((resolve) => {
|
|
97
|
+
if (this.dataUnit) {
|
|
98
|
+
resolve(this.dataUnit);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
this._onDataUnitResolve.push(resolve);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
async interceptAction(action) {
|
|
106
|
+
return new Promise(resolve => {
|
|
107
|
+
switch (action.type) {
|
|
108
|
+
case Action.RECORDS_ADDED:
|
|
109
|
+
if (this.isAllowed("INSERT")) {
|
|
110
|
+
resolve(action);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenInsert"));
|
|
114
|
+
}
|
|
115
|
+
break;
|
|
116
|
+
case Action.RECORDS_COPIED:
|
|
117
|
+
if (this.isAllowed("CLONE")) {
|
|
118
|
+
resolve(action);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenClone"));
|
|
122
|
+
}
|
|
123
|
+
break;
|
|
124
|
+
case Action.DATA_CHANGED:
|
|
125
|
+
case Action.CHANGING_DATA:
|
|
126
|
+
if (this.isAllowed("UPDATE")) {
|
|
127
|
+
resolve(action);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
this.dataUnit.cancelEdition();
|
|
131
|
+
ApplicationUtils.alert(this.getMessage("snkDataUnit.forbidden"), this.getMessage("snkDataUnit.forbiddenUpdate"));
|
|
132
|
+
}
|
|
133
|
+
break;
|
|
134
|
+
case Action.SAVING_DATA:
|
|
135
|
+
if (this.beforeSave) {
|
|
136
|
+
const continueAction = this.beforeSave(this.dataUnit);
|
|
137
|
+
if (continueAction instanceof Promise) {
|
|
138
|
+
continueAction.then(result => resolve(result ? action : undefined));
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
resolve(continueAction ? action : undefined);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
resolve(action);
|
|
146
|
+
}
|
|
147
|
+
break;
|
|
148
|
+
case Action.DATA_SAVED:
|
|
149
|
+
if (this.afterSave) {
|
|
150
|
+
this.afterSave(this.dataUnit);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
resolve(action);
|
|
154
|
+
}
|
|
155
|
+
break;
|
|
156
|
+
case Action.EDITION_CANCELED:
|
|
157
|
+
if (this.dataState.hasDirtyRecords) {
|
|
158
|
+
const cancelConfirmation = this.getMessage("snkDataUnit.cancelConfirmation");
|
|
159
|
+
if (cancelConfirmation == undefined) {
|
|
160
|
+
resolve(action);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
const cancelConfirmationTitle = this.getMessage("snkDataUnit.cancelConfirmationTitle");
|
|
164
|
+
ApplicationUtils.confirm(cancelConfirmationTitle, cancelConfirmation)
|
|
165
|
+
.then((result) => resolve(result ? action : undefined));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
resolve(action);
|
|
170
|
+
}
|
|
171
|
+
break;
|
|
172
|
+
case Action.REMOVING_RECORDS:
|
|
173
|
+
if (this.isAllowed("REMOVE")) {
|
|
174
|
+
const removeConfirmation = this.getMessage("snkDataUnit.removeConfirmation");
|
|
175
|
+
if (removeConfirmation == undefined) {
|
|
176
|
+
resolve(action);
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
|
|
180
|
+
ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, "delete", DialogType.WARN)
|
|
181
|
+
.then((result) => resolve(result ? action : undefined));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenRemove"));
|
|
186
|
+
}
|
|
187
|
+
break;
|
|
188
|
+
default:
|
|
189
|
+
resolve(action);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
showSuccessMessage(message) {
|
|
194
|
+
ApplicationUtils.info(message, { iconName: "check" });
|
|
195
|
+
}
|
|
196
|
+
isAllowed(flag) {
|
|
197
|
+
return this._permissions ? this._permissions.isSup || this._permissions[flag] : false;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
201
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
|
202
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
203
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
|
|
204
|
+
*/
|
|
205
|
+
getMessage(key, params = undefined) {
|
|
206
|
+
if (!params) {
|
|
207
|
+
params = this.getMessageParams();
|
|
208
|
+
}
|
|
209
|
+
return this._application.messagesBuilder.getMessage(key, params);
|
|
210
|
+
}
|
|
211
|
+
getMessageParams() {
|
|
212
|
+
//TODO: Atualmente ainda não usamos o recurso de multiseleção do dataunit, mas no futuro
|
|
213
|
+
//precisaremos criar um mecanismo para oferecer todos os registros selecionados para a
|
|
214
|
+
//mensagem
|
|
215
|
+
return this.dataState.selectedRecords ? this.dataState.selectedRecords[0] : undefined;
|
|
216
|
+
}
|
|
217
|
+
getMessageOperation() {
|
|
218
|
+
if (this.dataState.copyMode) {
|
|
219
|
+
return OperationMap.CLONE;
|
|
220
|
+
}
|
|
221
|
+
if (this.dataState.insertionMode) {
|
|
222
|
+
return OperationMap.INSERT;
|
|
223
|
+
}
|
|
224
|
+
if (this.dataState.isDirty) {
|
|
225
|
+
return OperationMap.UPDATE;
|
|
226
|
+
}
|
|
227
|
+
return OperationMap.CLEAN;
|
|
228
|
+
}
|
|
229
|
+
async loadDataUnit() {
|
|
230
|
+
if (!this.dataUnit) {
|
|
231
|
+
if (this._application && this.entityName) {
|
|
232
|
+
const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
|
|
233
|
+
this.dataUnit = await this._application.getDataUnit(this.entityName, cacheName);
|
|
234
|
+
this.dataUnit.pageSize = this.pageSize;
|
|
235
|
+
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
236
|
+
this.dataUnit.addInterceptor(this);
|
|
237
|
+
this.dataUnit.subscribe(this._dataUnitObserver);
|
|
238
|
+
let resolver;
|
|
239
|
+
while (resolver = this._onDataUnitResolve.pop()) {
|
|
240
|
+
resolver(this.dataUnit);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
//---------------------------------------------
|
|
246
|
+
// Lifecycle web component
|
|
247
|
+
//---------------------------------------------
|
|
248
|
+
componentWillLoad() {
|
|
249
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
250
|
+
this._application.getAllAccess().then(access => this._permissions = access);
|
|
251
|
+
}
|
|
252
|
+
componentDidLoad() {
|
|
253
|
+
this.loadDataUnit();
|
|
254
|
+
}
|
|
255
|
+
render() {
|
|
256
|
+
return (h(Host, null));
|
|
257
|
+
}
|
|
258
|
+
get element() { return this; }
|
|
259
|
+
static get watchers() { return {
|
|
260
|
+
"pageSize": ["observePageSize"],
|
|
261
|
+
"dataUnitName": ["observeDataUnitName"],
|
|
262
|
+
"entityName": ["observeEntityName"],
|
|
263
|
+
"dataState": ["observeDataState"],
|
|
264
|
+
"dataUnit": ["observeDataUnit"]
|
|
265
|
+
}; }
|
|
266
|
+
static get style() { return snkDataUnitCss; }
|
|
267
|
+
}, [2, "snk-data-unit", {
|
|
268
|
+
"dataState": [1040],
|
|
269
|
+
"dataUnitName": [1, "data-unit-name"],
|
|
270
|
+
"entityName": [1, "entity-name"],
|
|
271
|
+
"pageSize": [2, "page-size"],
|
|
272
|
+
"dataUnit": [1040],
|
|
273
|
+
"beforeSave": [16],
|
|
274
|
+
"afterSave": [16],
|
|
275
|
+
"getDataUnit": [64]
|
|
276
|
+
}]);
|
|
277
|
+
function defineCustomElement$1() {
|
|
278
|
+
if (typeof customElements === "undefined") {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
const components = ["snk-data-unit"];
|
|
282
|
+
components.forEach(tagName => { switch (tagName) {
|
|
283
|
+
case "snk-data-unit":
|
|
284
|
+
if (!customElements.get(tagName)) {
|
|
285
|
+
customElements.define(tagName, SnkDataUnit$1);
|
|
286
|
+
}
|
|
287
|
+
break;
|
|
288
|
+
} });
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const SnkDataUnit = SnkDataUnit$1;
|
|
292
|
+
const defineCustomElement = defineCustomElement$1;
|
|
293
|
+
|
|
294
|
+
export { SnkDataUnit, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkFieldConfig extends Components.SnkFieldConfig, HTMLElement {}
|
|
4
|
+
export const SnkFieldConfig: {
|
|
5
|
+
prototype: SnkFieldConfig;
|
|
6
|
+
new (): SnkFieldConfig;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
+
import { A as ACTION_CONFIG } from './constants.js';
|
|
4
|
+
|
|
5
|
+
const snkFieldConfigCss = ".sc-snk-field-config-h{--snk-field-config--height:42px;--snk-field-config--width:100%;--snk-field-config__icon--width:48px;--snk-field-config--height--slim:32px;--snk-field-config--border-radius:var(--border--radius-medium, 12px);--snk-field-config--font-size:var(--text--medium, 14px);--snk-field-config--font-family:var(--font-pattern, Arial);--snk-field-config--font-weight:var(--text-weight--medium, 400);--snk-field-config--color:var(--title--primary, #000);--snk-field-config__input--background-color:var(--background--medium, #e0e0e0);--snk-field-config__input--border:var(--border--medium, 2px solid);--snk-field-config__input--border-color:var(--background--xlight, #fff);--snk-field-config__required--color:var(--color--error, #FF0000);--snk-field-config__transition--visibility:var(--transition, 0.2s linear);--snk-field-config__transition--opacity:var(--transition, 0.15s linear);display:flex;flex-wrap:wrap;position:relative;width:var(--snk-field-config--width)}.field-config.sc-snk-field-config{width:100%;box-sizing:border-box;display:flex;align-items:center;padding-left:var(--space--medium, 6px);font-weight:var(--snk-field-config--font-weight);height:var(--snk-field-config--height);border-radius:var(--snk-field-config--border-radius);font-family:var(--snk-field-config--font-family);font-size:var(--snk-field-config--font-size);border:var(--snk-field-config__input--border);border-color:var(--snk-field-config__input--border-color);background-color:var(--snk-field-config__input--background-color);color:var(--snk-field-config--color)}.field-config__config-popover.sc-snk-field-config{width:40px;margin-left:auto;z-index:var(--more-visible, 2)}.field-config__required-label.sc-snk-field-config{padding-left:var(--space--extra-small, 3px);color:var(--snk-field-config__required--color)}.field-config__add.sc-snk-field-config{display:flex;margin-left:auto;visibility:hidden;opacity:0;transition:visibility var(--snk-field-config__transition--visibility), opacity var(--snk-field-config__transition--opacity)}.field-config__options.sc-snk-field-config{display:flex;margin-left:auto;visibility:hidden;opacity:0;transition:visibility var(--snk-field-config__transition--visibility), opacity var(--snk-field-config__transition--opacity)}.field-config__options--is-active.sc-snk-field-config{display:flex;visibility:visible;opacity:1}.field-config__remove-icon.sc-snk-field-config{margin-right:-15px}.field-config.sc-snk-field-config:hover .field-config__options.sc-snk-field-config{display:flex;visibility:visible;opacity:1}.field-config.sc-snk-field-config:hover .field-config__add.sc-snk-field-config{visibility:visible;opacity:1}.field-config__draggable.sc-snk-field-config{padding-right:var(--space--small, 6px)}.field-config__config-outer-arrow.sc-snk-field-config{background-color:var(--color--secondary-200);clip-path:polygon(50% 0, 90% 100%, 10% 100%);border-radius:0.25em 0 0 0;width:30px;height:15px;padding-top:3px;border-bottom:1px solid #FFFFFF}.field-config__config-inner-arrow.sc-snk-field-config{background-color:#FFFFFF;clip-path:polygon(50% 0, 90% 100%, 10% 100%);border-radius:0.25em 0 0 0;width:30px;height:15px}.ez-box__container.sc-snk-field-config ez-collapsible-box.sc-snk-field-config{--snk-collapsible-box__header--padding-left:6px}ez-icon.sc-snk-field-config{--snk-icon--color:var(--snk-field-config--color)}ez-popover.sc-snk-field-config{--snk-popover__box--background-color:transparent;--snk-popover__box--box-shadow:none}.field-config__options.sc-snk-field-config ez-button.sc-snk-field-config{--snk-button--background-color:transparent;--snk-button--focus--border:none;--snk-button--focus--box-shadow:none}";
|
|
6
|
+
|
|
7
|
+
const SnkFieldConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.ezClickIcon = createEvent(this, "ezClickIcon", 7);
|
|
12
|
+
/**
|
|
13
|
+
* Define se o popover de configuração está ativo.
|
|
14
|
+
*/
|
|
15
|
+
this.isConfigActive = false;
|
|
16
|
+
/**
|
|
17
|
+
* Define se o componente está em modo de inserção
|
|
18
|
+
*/
|
|
19
|
+
this.modeInsertion = true;
|
|
20
|
+
}
|
|
21
|
+
handleAction(evt, type) {
|
|
22
|
+
evt.preventDefault();
|
|
23
|
+
evt.stopPropagation();
|
|
24
|
+
const field = this.fieldConfig;
|
|
25
|
+
if (type !== ACTION_CONFIG.configuration) {
|
|
26
|
+
field.group = undefined;
|
|
27
|
+
}
|
|
28
|
+
this.ezClickIcon.emit({ field, type });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
32
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
|
33
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
34
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-form.msg.ts"
|
|
35
|
+
*/
|
|
36
|
+
getMessage(key) {
|
|
37
|
+
return this._application.messagesBuilder.getMessage(key, {});
|
|
38
|
+
}
|
|
39
|
+
componentWillLoad() {
|
|
40
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
if (this.fieldConfig == undefined) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
return (h(Host, null, h("div", { class: "field-config" }, h("div", { class: "field-config__draggable" }, h("ez-icon", { iconName: "drag-indicator", size: "small" })), h("div", null, this.fieldConfig.label, this.fieldConfig.required && h("span", { class: "field-config__required-label" }, "*")), this.modeInsertion ?
|
|
47
|
+
h("div", { class: "field-config__add" }, h("ez-button", { onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.add), mode: "icon", class: "ez-button--tertiary", iconName: "plus", size: "large", title: this.getMessage("snkFieldConfig.titleAdd") })) :
|
|
48
|
+
h("div", { class: "field-config__options" + (this.isConfigActive ? " field-config__options--is-active" : " ") }, h("ez-button", { mode: "icon", class: "ez-button--tertiary field-config__remove-icon", onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.remove), iconName: "minus", size: "large", title: this.getMessage("snkFieldConfig.titleRemove") }), h("ez-button", { id: "buttonConfig_" + this.fieldConfig.name, mode: "icon", class: "ez-button--tertiary", onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.configuration), iconName: this.isConfigActive ? "chevron-up" : "settings-inverted", size: "large", title: this.getMessage("snkFieldConfig.titleConfigurations") }))), this.isConfigActive && h("div", { class: "field-config__config-popover" }, h("div", { class: "field-config__config-outer-arrow" }, h("div", { class: "field-config__config-inner-arrow" })))));
|
|
49
|
+
}
|
|
50
|
+
static get style() { return snkFieldConfigCss; }
|
|
51
|
+
}, [2, "snk-field-config", {
|
|
52
|
+
"isConfigActive": [16],
|
|
53
|
+
"fieldConfig": [16],
|
|
54
|
+
"modeInsertion": [516, "mode-insertion"]
|
|
55
|
+
}]);
|
|
56
|
+
function defineCustomElement() {
|
|
57
|
+
if (typeof customElements === "undefined") {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const components = ["snk-field-config"];
|
|
61
|
+
components.forEach(tagName => { switch (tagName) {
|
|
62
|
+
case "snk-field-config":
|
|
63
|
+
if (!customElements.get(tagName)) {
|
|
64
|
+
customElements.define(tagName, SnkFieldConfig);
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
} });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { SnkFieldConfig as S, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkFilterBar extends Components.SnkFilterBar, HTMLElement {}
|
|
4
|
+
export const SnkFilterBar: {
|
|
5
|
+
prototype: SnkFilterBar;
|
|
6
|
+
new (): SnkFilterBar;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|