@sankhyalabs/sankhyablocks 1.4.0-beta.1 → 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-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-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-44ce5b90.entry.js +1 -0
- package/dist/sankhyablocks/p-521c96f0.entry.js +1 -0
- package/dist/sankhyablocks/p-6988f4a6.entry.js +1 -0
- 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 -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
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
2
|
-
import {
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-e4121713.js';
|
|
2
|
+
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
+
import { c as VIEW_MODE } from './constants-c6039d3d.js';
|
|
4
|
+
import { T as TaskbarElement } from './taskbar-elements-e2ed0536.js';
|
|
3
5
|
|
|
4
6
|
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
|
5
7
|
|
|
6
|
-
const GRID_MODE =
|
|
7
|
-
const FORM_MODE =
|
|
8
|
+
const GRID_MODE = VIEW_MODE.grid;
|
|
9
|
+
const FORM_MODE = VIEW_MODE.form;
|
|
8
10
|
const SnkCrud = class {
|
|
9
11
|
constructor(hostRef) {
|
|
10
12
|
registerInstance(this, hostRef);
|
|
11
13
|
this.actionClick = createEvent(this, "actionClick", 7);
|
|
12
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Usado para alternar a visão entre GRID e FORM externamente.
|
|
17
|
+
*/
|
|
18
|
+
async goToView(mode) {
|
|
19
|
+
this.executeAction(mode);
|
|
20
|
+
}
|
|
13
21
|
async gridToForm(keepFormMode = false) {
|
|
14
|
-
this._backToGrid = !keepFormMode && await this._viewStack.getSelectedIndex() === GRID_MODE;
|
|
15
|
-
this._viewStack.show(FORM_MODE);
|
|
22
|
+
this._backToGrid = !keepFormMode && await this._viewStack.getSelectedIndex() === GRID_MODE.index;
|
|
23
|
+
this._viewStack.show(FORM_MODE.index);
|
|
16
24
|
}
|
|
17
25
|
async executeAction(act) {
|
|
18
|
-
if (act ===
|
|
19
|
-
this._viewStack.show(GRID_MODE);
|
|
26
|
+
if (act === TaskbarElement.GRID_MODE) {
|
|
27
|
+
this._viewStack.show(GRID_MODE.index);
|
|
20
28
|
}
|
|
21
|
-
else if (act ===
|
|
22
|
-
this.gridToForm(act !==
|
|
29
|
+
else if (act === TaskbarElement.FORM_MODE || act === TaskbarElement.UPDATE) {
|
|
30
|
+
this.gridToForm(act !== TaskbarElement.UPDATE);
|
|
23
31
|
}
|
|
24
32
|
}
|
|
25
33
|
insertionModeHandler() {
|
|
@@ -27,7 +35,7 @@ const SnkCrud = class {
|
|
|
27
35
|
}
|
|
28
36
|
cancelHandler() {
|
|
29
37
|
if (this._backToGrid) {
|
|
30
|
-
this._viewStack.show(GRID_MODE);
|
|
38
|
+
this._viewStack.show(GRID_MODE.index);
|
|
31
39
|
}
|
|
32
40
|
}
|
|
33
41
|
componentWillLoad() {
|
|
@@ -57,7 +65,7 @@ const SnkCrud = class {
|
|
|
57
65
|
}
|
|
58
66
|
}
|
|
59
67
|
render() {
|
|
60
|
-
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, 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), recordsValidator: this.recordsValidator, taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail) }, h("slot", { name: "SnkFormTaskBar" })))));
|
|
68
|
+
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" })))));
|
|
61
69
|
}
|
|
62
70
|
get _element() { return getElement(this); }
|
|
63
71
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-e4121713.js';
|
|
2
|
+
import { Action, ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
+
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
|
+
import { O as OperationMap } from './SnkMessageBuilder-5792c260.js';
|
|
4
5
|
|
|
5
6
|
const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
|
|
6
7
|
|
|
@@ -16,10 +17,6 @@ const SnkDataUnit = class {
|
|
|
16
17
|
* Determina quantas linhas são retornadas por página
|
|
17
18
|
*/
|
|
18
19
|
this.pageSize = 150;
|
|
19
|
-
/**
|
|
20
|
-
* Quando ativada essa propriedade faz com que haja uma carga imediata no DataUnit
|
|
21
|
-
*/
|
|
22
|
-
this.autoLoad = true;
|
|
23
20
|
this._dataUnitObserver = (action) => {
|
|
24
21
|
const duState = {
|
|
25
22
|
insertionMode: false,
|
|
@@ -179,7 +176,7 @@ const SnkDataUnit = class {
|
|
|
179
176
|
}
|
|
180
177
|
else {
|
|
181
178
|
const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
|
|
182
|
-
ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, "delete", DialogType.
|
|
179
|
+
ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, "delete", DialogType.WARN)
|
|
183
180
|
.then((result) => resolve(result ? action : undefined));
|
|
184
181
|
}
|
|
185
182
|
}
|
|
@@ -241,11 +238,6 @@ const SnkDataUnit = class {
|
|
|
241
238
|
while (resolver = this._onDataUnitResolve.pop()) {
|
|
242
239
|
resolver(this.dataUnit);
|
|
243
240
|
}
|
|
244
|
-
if (this.autoLoad) {
|
|
245
|
-
setTimeout(() => {
|
|
246
|
-
this.dataUnit.loadData();
|
|
247
|
-
}, 500); //TODO: Ajustar para aguardar filterProvider do dataunit estar pronto.
|
|
248
|
-
}
|
|
249
241
|
}
|
|
250
242
|
}
|
|
251
243
|
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-e4121713.js';
|
|
2
|
+
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
+
import { A as ACTION_CONFIG } from './constants-c6039d3d.js';
|
|
4
|
+
import { T as TaskbarProcessor } from './taskbar-processor-aa6772c9.js';
|
|
5
|
+
import { C as ConfigurableElementsStorage } from './configurableElementsStorage-cdc144b5.js';
|
|
6
|
+
|
|
7
|
+
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}";
|
|
8
|
+
|
|
9
|
+
const SnkFieldConfig = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
registerInstance(this, hostRef);
|
|
12
|
+
this.ezClickIcon = createEvent(this, "ezClickIcon", 7);
|
|
13
|
+
/**
|
|
14
|
+
* Define se o popover de configuração está ativo.
|
|
15
|
+
*/
|
|
16
|
+
this.isConfigActive = false;
|
|
17
|
+
/**
|
|
18
|
+
* Define se o componente está em modo de inserção
|
|
19
|
+
*/
|
|
20
|
+
this.modeInsertion = true;
|
|
21
|
+
}
|
|
22
|
+
handleAction(evt, type) {
|
|
23
|
+
evt.preventDefault();
|
|
24
|
+
evt.stopPropagation();
|
|
25
|
+
const field = this.fieldConfig;
|
|
26
|
+
if (type !== ACTION_CONFIG.configuration) {
|
|
27
|
+
field.group = undefined;
|
|
28
|
+
}
|
|
29
|
+
this.ezClickIcon.emit({ field, type });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
33
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
|
34
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
35
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-form.msg.ts"
|
|
36
|
+
*/
|
|
37
|
+
getMessage(key) {
|
|
38
|
+
return this._application.messagesBuilder.getMessage(key, {});
|
|
39
|
+
}
|
|
40
|
+
componentWillLoad() {
|
|
41
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
if (this.fieldConfig == undefined) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
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 ?
|
|
48
|
+
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") })) :
|
|
49
|
+
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" })))));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
SnkFieldConfig.style = snkFieldConfigCss;
|
|
53
|
+
|
|
54
|
+
const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--small)}";
|
|
55
|
+
|
|
56
|
+
const SnkGrid = class {
|
|
57
|
+
constructor(hostRef) {
|
|
58
|
+
registerInstance(this, hostRef);
|
|
59
|
+
this.actionClick = createEvent(this, "actionClick", 7);
|
|
60
|
+
this.gridDoubleClick = createEvent(this, "gridDoubleClick", 7);
|
|
61
|
+
this.configChanged = createEvent(this, "configChanged", 7);
|
|
62
|
+
this._topTaskbarProcessor = new TaskbarProcessor({
|
|
63
|
+
"snkGridTopTaskbar": ["FORM_MODE", "CONFIGURATOR", "INSERT"]
|
|
64
|
+
});
|
|
65
|
+
this._headerTaskbarProcessor = new TaskbarProcessor({
|
|
66
|
+
"snkGridHeaderTaskbar.unselected": ["REFRESH"],
|
|
67
|
+
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Método responsável em abrir ou fechar o modal de configurações da grade.
|
|
72
|
+
*/
|
|
73
|
+
async setShowGridConfig(value) {
|
|
74
|
+
if (this._grid == undefined) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (value === true) {
|
|
78
|
+
this._grid.openGridConfig();
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
this._grid.closeGridConfig();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Método responsável por setar as configurações da grade.
|
|
86
|
+
*/
|
|
87
|
+
async setConfig(config) {
|
|
88
|
+
this._gridConfig = config;
|
|
89
|
+
}
|
|
90
|
+
changeConfig(config) {
|
|
91
|
+
this.configChanged.emit(config);
|
|
92
|
+
}
|
|
93
|
+
componentDidRender() {
|
|
94
|
+
ConfigurableElementsStorage.setGrid(this.configName, this._element);
|
|
95
|
+
}
|
|
96
|
+
componentWillLoad() {
|
|
97
|
+
let parent = this._element.parentElement;
|
|
98
|
+
while (parent) {
|
|
99
|
+
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
100
|
+
this._snkDataUnit = parent;
|
|
101
|
+
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
102
|
+
if (!this._dataUnit) {
|
|
103
|
+
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
104
|
+
this._dataUnit = evt.detail;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
|
|
108
|
+
this._dataState = evt.detail;
|
|
109
|
+
});
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
parent = parent.parentElement;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
componentWillRender() {
|
|
116
|
+
const headerTaskbarId = this._dataState && this._dataState.selectedRecords.length > 0 ? "snkGridHeaderTaskbar.selected" : "snkGridHeaderTaskbar.unselected";
|
|
117
|
+
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState);
|
|
118
|
+
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
|
|
119
|
+
}
|
|
120
|
+
render() {
|
|
121
|
+
if (!this._dataUnit) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
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" }))));
|
|
125
|
+
}
|
|
126
|
+
get _element() { return getElement(this); }
|
|
127
|
+
};
|
|
128
|
+
SnkGrid.style = snkGridCss;
|
|
129
|
+
|
|
130
|
+
export { SnkFieldConfig as snk_field_config, SnkGrid as snk_grid };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h,
|
|
2
|
-
import { F as FilterItemType } from './filter-item-type.enum-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-e4121713.js';
|
|
2
|
+
import { F as FilterItemType } from './filter-item-type.enum-a79b2fa8.js';
|
|
3
3
|
|
|
4
4
|
const SnkFilterBinarySelect = class {
|
|
5
5
|
constructor(hostRef) {
|
|
@@ -31,6 +31,9 @@ const SnkFilterBinarySelect = class {
|
|
|
31
31
|
this.value = undefined;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
async show() {
|
|
35
|
+
this._checkOne.setFocus();
|
|
36
|
+
}
|
|
34
37
|
render() {
|
|
35
38
|
if (!this.config || this.config.type !== FilterItemType.BINARY_SELECT) {
|
|
36
39
|
return undefined;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
2
|
-
import {
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-e4121713.js';
|
|
2
|
+
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
3
|
+
import { F as FilterItemType } from './filter-item-type.enum-a79b2fa8.js';
|
|
3
4
|
|
|
4
5
|
const SnkFilterDetail = class {
|
|
5
6
|
constructor(hostRef) {
|
|
6
7
|
registerInstance(this, hostRef);
|
|
7
8
|
this.filterChange = createEvent(this, "filterChange", 7);
|
|
8
9
|
}
|
|
10
|
+
async show() {
|
|
11
|
+
this._editor["show"]();
|
|
12
|
+
}
|
|
9
13
|
changeConfig(newConfig) {
|
|
10
14
|
this.filterChange.emit(newConfig);
|
|
11
15
|
}
|
|
@@ -21,6 +25,8 @@ const SnkFilterDetail = class {
|
|
|
21
25
|
return "snk-filter-search";
|
|
22
26
|
case FilterItemType.NUMBER:
|
|
23
27
|
return "snk-filter-number";
|
|
28
|
+
case FilterItemType.PERSONALIZED:
|
|
29
|
+
return "snk-filter-personalized";
|
|
24
30
|
}
|
|
25
31
|
return "snk-filter-text";
|
|
26
32
|
}
|
|
@@ -32,13 +38,64 @@ const SnkFilterDetail = class {
|
|
|
32
38
|
return undefined;
|
|
33
39
|
}
|
|
34
40
|
return ([
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()),
|
|
42
|
+
this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))
|
|
37
43
|
]);
|
|
38
44
|
}
|
|
45
|
+
buildIcon(title, iconName, action) {
|
|
46
|
+
return (h("button", { onClick: () => action(), class: "sc-snk-filter-bar snk-filter-item__editor-header-button" }, h("ez-icon", { title: title, iconName: iconName })));
|
|
47
|
+
}
|
|
48
|
+
apply() {
|
|
49
|
+
var _a;
|
|
50
|
+
let value = this._editor["value"];
|
|
51
|
+
let isValid = true;
|
|
52
|
+
if (this.config.type === FilterItemType.PERSONALIZED) {
|
|
53
|
+
const params = ((_a = this.config.props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || [];
|
|
54
|
+
const paramsCount = params.length;
|
|
55
|
+
if (paramsCount === 0) {
|
|
56
|
+
//Valor do filtro personalizado sem parametros deve ser um array vazio
|
|
57
|
+
value = [];
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
isValid = this.validateAllFilled(paramsCount, value);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (isValid) {
|
|
64
|
+
this.changeConfig(Object.assign(Object.assign({}, this.config), { value: value }));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/* WARNING: Temporário. Isso só está sendo feito até desconsiderar os parametros não informados para PersonalizedFilter*/
|
|
68
|
+
validateAllFilled(paramsCount, value) {
|
|
69
|
+
let isValid = true;
|
|
70
|
+
if (value != undefined && paramsCount > 1) {
|
|
71
|
+
if (paramsCount > value.length) {
|
|
72
|
+
isValid = false;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
value.forEach(item => {
|
|
76
|
+
if (item == undefined) {
|
|
77
|
+
isValid = false;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (!isValid) {
|
|
83
|
+
ApplicationUtils.alert("Filtro parcialmente preenchido", "Favor completar todas as informações do filtro.");
|
|
84
|
+
}
|
|
85
|
+
return isValid;
|
|
86
|
+
}
|
|
87
|
+
/* WARNING: Temporário.*/
|
|
88
|
+
clear() {
|
|
89
|
+
this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined }));
|
|
90
|
+
}
|
|
91
|
+
onKeyDonwListener(event) {
|
|
92
|
+
if (event.key === "Enter") {
|
|
93
|
+
this._applyButton.setFocus().then(() => this.apply());
|
|
94
|
+
}
|
|
95
|
+
}
|
|
39
96
|
render() {
|
|
40
97
|
const ContentEditor = this.getContentEditor();
|
|
41
|
-
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, value: this.config.value, config: this.config,
|
|
98
|
+
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt) }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" }), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
|
|
42
99
|
}
|
|
43
100
|
};
|
|
44
101
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
2
|
-
import { F as FilterItemType } from './filter-item-type.enum-
|
|
1
|
+
import { r as registerInstance, h } from './index-e4121713.js';
|
|
2
|
+
import { F as FilterItemType } from './filter-item-type.enum-a79b2fa8.js';
|
|
3
3
|
|
|
4
4
|
const SnkFilterMultiSelect = class {
|
|
5
5
|
constructor(hostRef) {
|
|
@@ -8,11 +8,14 @@ const SnkFilterMultiSelect = class {
|
|
|
8
8
|
ezChangeListener(evt) {
|
|
9
9
|
this.value = evt.detail.value;
|
|
10
10
|
}
|
|
11
|
+
async show() {
|
|
12
|
+
this._comboElement.setFocus();
|
|
13
|
+
}
|
|
11
14
|
render() {
|
|
12
15
|
if (!this.config || this.config.type !== FilterItemType.MULTI_SELECT) {
|
|
13
16
|
return undefined;
|
|
14
17
|
}
|
|
15
|
-
return (h("ez-combo-box", { label: this.config.label, value: this.config.value, options: this.config.props.options }));
|
|
18
|
+
return (h("ez-combo-box", { ref: ref => this._comboElement = ref, label: this.config.label, value: this.config.value, options: this.config.props.options }));
|
|
16
19
|
}
|
|
17
20
|
};
|
|
18
21
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
2
|
-
import { F as FilterItemType } from './filter-item-type.enum-
|
|
1
|
+
import { r as registerInstance, h } from './index-e4121713.js';
|
|
2
|
+
import { F as FilterItemType } from './filter-item-type.enum-a79b2fa8.js';
|
|
3
3
|
|
|
4
4
|
const SnkFilterPeriod = class {
|
|
5
5
|
constructor(hostRef) {
|
|
@@ -8,12 +8,15 @@ const SnkFilterPeriod = class {
|
|
|
8
8
|
ezChangeListener(evt) {
|
|
9
9
|
this.value = evt.detail;
|
|
10
10
|
}
|
|
11
|
+
async show() {
|
|
12
|
+
this._numberElement.setFocus();
|
|
13
|
+
}
|
|
11
14
|
render() {
|
|
12
15
|
var _a;
|
|
13
16
|
if (!this.config || this.config.type !== FilterItemType.NUMBER) {
|
|
14
17
|
return undefined;
|
|
15
18
|
}
|
|
16
|
-
return (h("ez-number-input", { label: this.config.label, value: this.config.value, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision }));
|
|
19
|
+
return (h("ez-number-input", { ref: ref => this._numberElement = ref, label: this.config.label, value: this.config.value, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision }));
|
|
17
20
|
}
|
|
18
21
|
};
|
|
19
22
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
2
|
-
import { F as FilterItemType } from './filter-item-type.enum-
|
|
1
|
+
import { r as registerInstance, h } from './index-e4121713.js';
|
|
2
|
+
import { F as FilterItemType } from './filter-item-type.enum-a79b2fa8.js';
|
|
3
3
|
|
|
4
4
|
const SnkFilterPeriod = class {
|
|
5
5
|
constructor(hostRef) {
|
|
@@ -22,6 +22,9 @@ const SnkFilterPeriod = class {
|
|
|
22
22
|
}
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
+
async show() {
|
|
26
|
+
this._startDate.setFocus();
|
|
27
|
+
}
|
|
25
28
|
render() {
|
|
26
29
|
if (!this.config || this.config.type !== FilterItemType.PERIOD) {
|
|
27
30
|
return undefined;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-e4121713.js';
|
|
2
|
+
import { UserInterface, ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
+
import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
4
|
+
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
+
import { F as FilterItemType } from './filter-item-type.enum-a79b2fa8.js';
|
|
6
|
+
|
|
7
|
+
const SnkFilterPersonalized = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
getValue(param, index) {
|
|
12
|
+
if (this.value && index >= 0 && index < this.value.length) {
|
|
13
|
+
const rawValue = this.value[index];
|
|
14
|
+
if (param.type === UserInterface.SEARCH) {
|
|
15
|
+
return rawValue;
|
|
16
|
+
}
|
|
17
|
+
return convertType(param.dataType, rawValue);
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
setValue(index, value) {
|
|
22
|
+
if (this.value == undefined) {
|
|
23
|
+
this.value = Array(index).fill(null);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.value = [...this.value];
|
|
27
|
+
}
|
|
28
|
+
this.value[index] = value;
|
|
29
|
+
if (this.value.filter(item => item != undefined).length == 0) {
|
|
30
|
+
this.value = null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
doSearch(mode, argument, param) {
|
|
34
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
36
|
+
application.executePreparedSearch(mode, argument, param.searchContext)
|
|
37
|
+
.then(result => {
|
|
38
|
+
resolve(result);
|
|
39
|
+
}).catch(reason => {
|
|
40
|
+
reject(reason);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
getParamsInterface() {
|
|
45
|
+
var _a, _b, _c;
|
|
46
|
+
const params = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.personalizedFilter) === null || _c === void 0 ? void 0 : _c.parameters;
|
|
47
|
+
return params.map((param, index) => {
|
|
48
|
+
var _a;
|
|
49
|
+
const elemId = 'param_' + index;
|
|
50
|
+
switch (param.type) {
|
|
51
|
+
case UserInterface.SEARCH:
|
|
52
|
+
return h("ez-search", { id: elemId, suppressEmptyOption: true, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail), label: param.label, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, param) });
|
|
53
|
+
case UserInterface.SWITCH:
|
|
54
|
+
case UserInterface.CHECKBOX:
|
|
55
|
+
const mode = UserInterface.SWITCH === param.type ? CheckMode.SWITCH : CheckMode.REGULAR;
|
|
56
|
+
return h("ez-check", { id: elemId, class: "ez-padding-bottom--medium", mode: mode, value: this.getValue(param, index), label: param.label, onEzChange: evt => this.setValue(index, evt.detail) });
|
|
57
|
+
case UserInterface.DECIMALNUMBER:
|
|
58
|
+
case UserInterface.INTEGERNUMBER:
|
|
59
|
+
return h("ez-number-input", { id: elemId, label: param.label, value: this.getValue(param, index), precision: (_a = param.props) === null || _a === void 0 ? void 0 : _a.precision, onEzChange: evt => this.setValue(index, evt.detail) });
|
|
60
|
+
case UserInterface.OPTIONSELECTOR:
|
|
61
|
+
return h("ez-combo-box", { id: elemId, label: param.label, value: this.getValue(param, index), options: param.options, onEzChange: evt => { var _a; return this.setValue(index, (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); } });
|
|
62
|
+
case UserInterface.DATE:
|
|
63
|
+
return h("ez-date-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
|
|
64
|
+
case UserInterface.DATETIME:
|
|
65
|
+
return h("ez-date-time-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
|
|
66
|
+
default:
|
|
67
|
+
return h("ez-text-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
async show() {
|
|
72
|
+
const elem = document.querySelector("#param_0");
|
|
73
|
+
if (elem) {
|
|
74
|
+
elem["setFocus"]();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
render() {
|
|
78
|
+
if (!this.config || this.config.type !== FilterItemType.PERSONALIZED) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
return (h(Host, null, this.getParamsInterface()));
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export { SnkFilterPersonalized as snk_filter_personalized };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
2
|
-
import {
|
|
3
|
-
import { F as FilterItemType } from './filter-item-type.enum-
|
|
1
|
+
import { r as registerInstance, h } from './index-e4121713.js';
|
|
2
|
+
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
+
import { F as FilterItemType } from './filter-item-type.enum-a79b2fa8.js';
|
|
4
4
|
|
|
5
5
|
const SnkFilterSearch = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -11,24 +11,18 @@ const SnkFilterSearch = class {
|
|
|
11
11
|
}
|
|
12
12
|
doSearch(mode, argument) {
|
|
13
13
|
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
14
|
-
if (this.fix) {
|
|
15
|
-
this.fix();
|
|
16
|
-
}
|
|
17
14
|
return new Promise((resolve, reject) => {
|
|
18
15
|
application.executePreparedSearch(mode, argument, this.config.props.searchContext)
|
|
19
16
|
.then(result => {
|
|
20
17
|
resolve(result);
|
|
21
|
-
if (this.unfix) {
|
|
22
|
-
this.unfix();
|
|
23
|
-
}
|
|
24
18
|
}).catch(reason => {
|
|
25
19
|
reject(reason);
|
|
26
|
-
if (this.unfix) {
|
|
27
|
-
this.unfix();
|
|
28
|
-
}
|
|
29
20
|
});
|
|
30
21
|
});
|
|
31
22
|
}
|
|
23
|
+
async show() {
|
|
24
|
+
this._searchInput.setFocus();
|
|
25
|
+
}
|
|
32
26
|
render() {
|
|
33
27
|
if (!this.config || this.config.type !== FilterItemType.SEARCH) {
|
|
34
28
|
return undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-e4121713.js';
|
|
2
2
|
|
|
3
3
|
const SnkFilterText = class {
|
|
4
4
|
constructor(hostRef) {
|
|
@@ -11,7 +11,7 @@ const SnkFilterText = class {
|
|
|
11
11
|
if (!this.config) {
|
|
12
12
|
return undefined;
|
|
13
13
|
}
|
|
14
|
-
return (h("ez-text-input", { label: this.config.label, value: this.config.value }));
|
|
14
|
+
return (h("ez-text-input", { ref: ref => this._textInputElement = ref, label: this.config.label, value: this.config.value }));
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
|