@sankhyalabs/ezui 2.11.0 → 2.12.0
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/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +140 -0
- package/dist/cjs/ez-form.cjs.entry.js +228 -330
- package/dist/cjs/ez-grid.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-sidebar-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +6 -3
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-edit.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +109 -22
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/{index-fb179d74.js → index-5e208fa5.js} +8 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-form/{structure/FormSheetMetadata.js → FormMetadata.js} +39 -54
- package/dist/collection/components/ez-form/ez-form.css +7 -1
- package/dist/collection/components/ez-form/ez-form.js +128 -19
- package/dist/collection/components/ez-form/interfaces/IDefaultConfig.js +1 -0
- package/dist/collection/components/ez-form/interfaces/IFieldConfig.js +1 -0
- package/dist/collection/components/ez-form/interfaces/IFormConfig.js +1 -0
- package/dist/collection/components/ez-form/interfaces/IFormSheetMetadata.js +1 -0
- package/dist/collection/components/ez-form/interfaces/IInvalidField.js +1 -0
- package/dist/collection/components/ez-form/interfaces/IRecordValidator.js +1 -0
- package/dist/collection/components/ez-form/interfaces/ITabConfig.js +1 -0
- package/dist/collection/components/ez-form/interfaces/IValidationResult.js +1 -0
- package/dist/collection/components/ez-form/interfaces/index.js +1 -0
- package/dist/collection/components/ez-form/store/form.slice.js +6 -2
- package/dist/collection/components/ez-form-view/ez-form-view.css +6 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js +71 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +26 -0
- package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/CheckBox.tpl.js +4 -4
- package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/ComboBox.tpl.js +2 -2
- package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/DateInput.tpl.js +1 -1
- package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/NumberInput.tpl.js +3 -3
- package/dist/collection/components/ez-form-view/interfaces/IFormViewField.js +1 -0
- package/dist/collection/components/ez-form-view/interfaces/index.js +1 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +5 -2
- package/dist/collection/components/ez-tree/ez-tree.css +8 -6
- package/dist/collection/components/ez-tree/ez-tree.js +89 -11
- package/dist/collection/components/ez-tree/subcomponents/DefaultTooltipResolver.js +3 -0
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +4 -4
- package/dist/collection/components/ez-tree/subcomponents/index.js +1 -0
- package/dist/collection/components/ez-tree/types/Node.js +26 -4
- package/dist/collection/components/ez-tree/types/Tree.js +23 -2
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +478 -355
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-alert.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-breadcrumb.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-dropdown.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +136 -0
- package/dist/esm/ez-form.entry.js +229 -331
- package/dist/esm/ez-grid.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-sidebar-button.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +6 -3
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-edit.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +109 -22
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +2 -2
- package/dist/esm/{index-b77dcd0d.js → index-c5203f95.js} +8 -0
- package/dist/esm/loader.js +2 -2
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-22f06920.entry.js → p-0c3f7bf2.entry.js} +1 -1
- package/dist/ezui/{p-46c3cd8e.entry.js → p-0cd0545d.entry.js} +1 -1
- package/dist/ezui/{p-e881ec6d.entry.js → p-1a27bb9f.entry.js} +1 -1
- package/dist/ezui/{p-e9b4b3bd.entry.js → p-1b94b9dc.entry.js} +1 -1
- package/dist/ezui/{p-42f85e36.entry.js → p-20c01161.entry.js} +1 -1
- package/dist/ezui/{p-6c43b275.entry.js → p-24717f87.entry.js} +1 -1
- package/dist/ezui/{p-52a18a6c.entry.js → p-3320768e.entry.js} +1 -1
- package/dist/ezui/{p-6cdfe0db.entry.js → p-36ed5c45.entry.js} +1 -1
- package/dist/ezui/{p-b5efd273.entry.js → p-3b2091dd.entry.js} +1 -1
- package/dist/ezui/{p-42376b77.entry.js → p-47bcc678.entry.js} +1 -1
- package/dist/ezui/{p-5e3079cb.entry.js → p-47ca5e09.entry.js} +1 -1
- package/dist/ezui/{p-6a53943d.entry.js → p-4c444816.entry.js} +1 -1
- package/dist/ezui/{p-fe1f0c92.entry.js → p-608d13e8.entry.js} +1 -1
- package/dist/ezui/{p-d04f3bb1.entry.js → p-626b8940.entry.js} +1 -1
- package/dist/ezui/{p-bdb5e325.entry.js → p-6630eca2.entry.js} +1 -1
- package/dist/ezui/{p-b7a8708e.entry.js → p-67b9a2cb.entry.js} +1 -1
- package/dist/ezui/{p-7e9ab877.entry.js → p-6dec5cfa.entry.js} +1 -1
- package/dist/ezui/{p-5d19cd0d.entry.js → p-6f9aba86.entry.js} +1 -1
- package/dist/ezui/p-7799666d.entry.js +1 -0
- package/dist/ezui/{p-6ccf5720.js → p-7b80df03.js} +1 -1
- package/dist/ezui/{p-87dd65ba.entry.js → p-7d42065a.entry.js} +1 -1
- package/dist/ezui/{p-f58201e8.entry.js → p-81897c04.entry.js} +1 -1
- package/dist/ezui/{p-74a3f9d8.entry.js → p-91f8c816.entry.js} +1 -1
- package/dist/ezui/p-97d2d2f6.entry.js +1 -0
- package/dist/ezui/{p-4b93860c.entry.js → p-98c448c9.entry.js} +1 -1
- package/dist/ezui/{p-f8f87959.entry.js → p-99aea44b.entry.js} +1 -1
- package/dist/ezui/p-a4b4645d.entry.js +1 -0
- package/dist/ezui/{p-e3743d12.entry.js → p-ab5eee38.entry.js} +1 -1
- package/dist/ezui/{p-7d8e693d.entry.js → p-ad7151e0.entry.js} +1 -1
- package/dist/ezui/{p-2686fa5b.entry.js → p-ad8b7412.entry.js} +1 -1
- package/dist/ezui/{p-ba7b2b8f.entry.js → p-b2e861cb.entry.js} +1 -1
- package/dist/ezui/{p-8c273b22.entry.js → p-b2efb22c.entry.js} +1 -1
- package/dist/ezui/{p-9171043f.entry.js → p-b5557d33.entry.js} +1 -1
- package/dist/ezui/p-ba03ac61.entry.js +1 -0
- package/dist/ezui/{p-a4405e80.entry.js → p-bc324ee8.entry.js} +1 -1
- package/dist/ezui/{p-07d07b75.entry.js → p-bd9792e2.entry.js} +1 -1
- package/dist/ezui/{p-21782390.entry.js → p-bf8a633d.entry.js} +1 -1
- package/dist/ezui/{p-620e71e2.entry.js → p-c071db26.entry.js} +1 -1
- package/dist/ezui/{p-b9d91679.entry.js → p-c3529df3.entry.js} +1 -1
- package/dist/ezui/{p-297d4378.entry.js → p-ca7435a6.entry.js} +1 -1
- package/dist/ezui/{p-e628c8bd.entry.js → p-e203c89f.entry.js} +1 -1
- package/dist/ezui/{p-a7380524.entry.js → p-fc97f773.entry.js} +1 -1
- package/dist/types/components/ez-form/DataBinder.d.ts +1 -1
- package/dist/types/components/ez-form/FormMetadata.d.ts +16 -0
- package/dist/types/components/ez-form/ez-form.d.ts +21 -43
- package/dist/types/components/ez-form/interfaces/IDefaultConfig.d.ts +5 -0
- package/dist/types/components/ez-form/interfaces/IFieldConfig.d.ts +13 -0
- package/dist/types/components/ez-form/interfaces/IFormConfig.d.ts +7 -0
- package/dist/types/components/ez-form/interfaces/IFormSheetMetadata.d.ts +9 -0
- package/dist/types/components/ez-form/interfaces/IInvalidField.d.ts +4 -0
- package/dist/types/components/ez-form/interfaces/IRecordValidator.d.ts +6 -0
- package/dist/types/components/ez-form/interfaces/ITabConfig.d.ts +5 -0
- package/dist/types/components/ez-form/interfaces/IValidationResult.d.ts +8 -0
- package/dist/types/components/ez-form/interfaces/index.d.ts +8 -0
- package/dist/types/components/ez-form/store/form.slice.d.ts +5 -3
- package/dist/types/components/ez-form-view/fieldbuilder/FieldBuilder.d.ts +2 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.d.ts +3 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.d.ts +2 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +4 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.d.ts +2 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.d.ts +3 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +2 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.d.ts +2 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +2 -0
- package/dist/types/components/ez-form-view/interfaces/IFormViewField.d.ts +10 -0
- package/dist/types/components/ez-form-view/interfaces/index.d.ts +1 -0
- package/dist/types/components/ez-tree/ez-tree.d.ts +13 -0
- package/dist/types/components/ez-tree/interfaces/ITreeItem.d.ts +1 -0
- package/dist/types/components/ez-tree/subcomponents/DefaultTooltipResolver.d.ts +2 -0
- package/dist/types/components/ez-tree/subcomponents/TreeItem.d.ts +2 -0
- package/dist/types/components/ez-tree/subcomponents/index.d.ts +1 -0
- package/dist/types/components/ez-tree/types/Node.d.ts +1 -0
- package/dist/types/components/ez-tree/types/Tree.d.ts +1 -0
- package/dist/types/components.d.ts +65 -2
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +0 -48
- package/dist/collection/components/ez-form/structure/FormItem.js +0 -11
- package/dist/collection/components/ez-form/structure/FormSheet.js +0 -6
- package/dist/ezui/p-98c78c29.entry.js +0 -1
- package/dist/ezui/p-99e07a6b.entry.js +0 -1
- package/dist/ezui/p-a928ea8d.entry.js +0 -1
- package/dist/types/components/ez-form/fieldbuilder/FieldBuilder.d.ts +0 -2
- package/dist/types/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.d.ts +0 -3
- package/dist/types/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.d.ts +0 -6
- package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +0 -15
- package/dist/types/components/ez-form/fieldbuilder/tpl/FileInput.tpl.d.ts +0 -5
- package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +0 -7
- package/dist/types/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.d.ts +0 -6
- package/dist/types/components/ez-form/fieldbuilder/tpl/TextArea.tpl.d.ts +0 -5
- package/dist/types/components/ez-form/fieldbuilder/tpl/TextInput.tpl.d.ts +0 -5
- package/dist/types/components/ez-form/structure/FormItem.d.ts +0 -9
- package/dist/types/components/ez-form/structure/FormSheet.d.ts +0 -10
- package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +0 -35
- /package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/FileInput.tpl.js +0 -0
- /package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/SearchInput.tpl.js +0 -0
- /package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/TextArea.tpl.js +0 -0
- /package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/TextInput.tpl.js +0 -0
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-5e208fa5.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.13.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["ez-actions-button.cjs",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"isOpened":[64]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"show":[64]}]]],["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["ez-alert.cjs",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["ez-breadcrumb.cjs",[[1,"ez-breadcrumb",{"items":[1040]}]]],["ez-chip.cjs",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-dropdown.cjs",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]}]]],["ez-file-item.cjs",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["ez-
|
|
17
|
+
return index.bootstrapLazy([["ez-actions-button.cjs",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"isOpened":[64]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"show":[64]}]]],["ez-filter-input.cjs",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["ez-modal-container.cjs",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]}]]],["ez-alert.cjs",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["ez-breadcrumb.cjs",[[1,"ez-breadcrumb",{"items":[1040]}]]],["ez-chip.cjs",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-dropdown.cjs",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]}]]],["ez-file-item.cjs",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-card-item.cjs",[[1,"ez-card-item",{"item":[16]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-loading-bar.cjs",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]]],["ez-radio-button.cjs",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["ez-scroller.cjs",[[1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]]]],["ez-sidebar-button.cjs",[[1,"ez-sidebar-button"]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["ez-view-stack.cjs",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["ez-tree.cjs",[[1,"ez-tree",{"items":[16],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64]},[[2,"keydown","onKeyDownListener"]]]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-text-edit.cjs",[[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-form-view.cjs",[[2,"ez-form-view",{"fields":[16]}]]],["ez-form.cjs",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"multiLevel":[4,"multi-level"],"levelResolver":[16],"contentBuilder":[16],"validate":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"./components/ez-dropdown/ez-dropdown.js",
|
|
24
24
|
"./components/ez-file-item/ez-file-item.js",
|
|
25
25
|
"./components/ez-filter-input/ez-filter-input.js",
|
|
26
|
+
"./components/ez-form-view/ez-form-view.js",
|
|
26
27
|
"./components/ez-grid/ez-grid.js",
|
|
27
28
|
"./components/ez-icon/ez-icon.js",
|
|
28
29
|
"./components/ez-loading-bar/ez-loading-bar.js",
|
package/dist/collection/components/ez-form/{structure/FormSheetMetadata.js → FormMetadata.js}
RENAMED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UserInterface } from "@sankhyalabs/core";
|
|
1
2
|
export class FormMetadata {
|
|
2
3
|
constructor() {
|
|
3
4
|
this._sheets = new Map();
|
|
@@ -27,40 +28,20 @@ export class FormMetadata {
|
|
|
27
28
|
return this._defaultValues;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
|
-
export const isRequiredField = (descriptor, config) => {
|
|
31
|
-
if (descriptor.required) {
|
|
32
|
-
//Se for required pelo descritor não olha pra configuração.
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
return config === null || config === void 0 ? void 0 : config.required;
|
|
36
|
-
};
|
|
37
|
-
export const isReadOnlyField = (descriptor, config) => {
|
|
38
|
-
if (descriptor.readOnly) {
|
|
39
|
-
//Se for readOnly pelo descritor não olha pra configuração.
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
return config === null || config === void 0 ? void 0 : config.readOnly;
|
|
43
|
-
};
|
|
44
31
|
export const buildFromDataUnit = (dataUnit) => {
|
|
45
|
-
var _a, _b;
|
|
46
32
|
const unitMD = dataUnit.metadata;
|
|
47
33
|
const metadata = new FormMetadata();
|
|
48
34
|
if (unitMD) {
|
|
49
|
-
const visibleFields = (
|
|
50
|
-
const
|
|
51
|
-
(_b = unitMD === null || unitMD === void 0 ? void 0 : unitMD.fields) === null || _b === void 0 ? void 0 : _b.forEach((descriptor) => {
|
|
52
|
-
if (descriptor.visible !== false) {
|
|
53
|
-
resolveFieldGroup(items, null, descriptor);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
35
|
+
const visibleFields = (unitMD.fields || []).filter(descriptor => descriptor.visible !== false);
|
|
36
|
+
const fields = visibleFields.map(descriptor => buildFormField(descriptor));
|
|
56
37
|
let defaultValues = {};
|
|
57
38
|
visibleFields
|
|
58
39
|
.filter(descriptor => descriptor.defaultValue)
|
|
59
|
-
.
|
|
40
|
+
.forEach((descriptor) => defaultValues[descriptor.name] = descriptor.defaultValue);
|
|
60
41
|
metadata.addSheet({
|
|
61
|
-
label: unitMD.label,
|
|
62
42
|
name: unitMD.name,
|
|
63
|
-
|
|
43
|
+
label: unitMD.label,
|
|
44
|
+
fields,
|
|
64
45
|
requiredFields: visibleFields
|
|
65
46
|
.filter(descriptor => descriptor.required)
|
|
66
47
|
.map(descriptor => descriptor.name),
|
|
@@ -72,29 +53,6 @@ export const buildFromDataUnit = (dataUnit) => {
|
|
|
72
53
|
}
|
|
73
54
|
return metadata;
|
|
74
55
|
};
|
|
75
|
-
function getTabConfig(tab, sheets) {
|
|
76
|
-
const tabConfig = (typeof tab === "string" ? Array.from(sheets.keys()).find(t => t.label === tab) : tab);
|
|
77
|
-
return tabConfig || { label: tab, visible: true };
|
|
78
|
-
}
|
|
79
|
-
function sortTabs(a, b) {
|
|
80
|
-
return a[0].label == '__main' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
|
|
81
|
-
}
|
|
82
|
-
function resolveFieldGroup(items, field, descriptor) {
|
|
83
|
-
const fieldMD = { config: field, descriptor: descriptor };
|
|
84
|
-
let group = (field === null || field === void 0 ? void 0 : field.group) || descriptor.group;
|
|
85
|
-
if (group) {
|
|
86
|
-
const key = `group::${group}`;
|
|
87
|
-
if (!items.has(key)) {
|
|
88
|
-
items.set(key, { label: group, items: [fieldMD] });
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
items.get(key).items.push(fieldMD);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
items.set((field === null || field === void 0 ? void 0 : field.name) || descriptor.name, fieldMD);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
56
|
export const buildFromConfig = (config, dataUnit) => {
|
|
99
57
|
var _a, _b;
|
|
100
58
|
const sheets = new Map();
|
|
@@ -117,10 +75,11 @@ export const buildFromConfig = (config, dataUnit) => {
|
|
|
117
75
|
const descriptor = dataUnit.getField(field.name);
|
|
118
76
|
if (descriptor && tabConfig.visible) {
|
|
119
77
|
if (!sheets.has(tabConfig)) {
|
|
120
|
-
sheets.set(tabConfig,
|
|
78
|
+
sheets.set(tabConfig, []);
|
|
121
79
|
}
|
|
122
|
-
const
|
|
123
|
-
|
|
80
|
+
const formField = buildFormField(descriptor, field);
|
|
81
|
+
sheets.get(tabConfig).push(formField);
|
|
82
|
+
if (formField.required) {
|
|
124
83
|
requiredFields.push(field.name);
|
|
125
84
|
}
|
|
126
85
|
const cleanOnCopy = field.cleanOnCopy == undefined ? (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy : field.cleanOnCopy;
|
|
@@ -131,18 +90,17 @@ export const buildFromConfig = (config, dataUnit) => {
|
|
|
131
90
|
if (defaultValue) {
|
|
132
91
|
defaultValues[field.name] = field.defaultValue;
|
|
133
92
|
}
|
|
134
|
-
resolveFieldGroup(tabItens, field, descriptor);
|
|
135
93
|
}
|
|
136
94
|
}
|
|
137
95
|
});
|
|
138
96
|
const metadata = new FormMetadata();
|
|
139
97
|
Array.from(sheets.entries())
|
|
140
98
|
.sort(sortTabs)
|
|
141
|
-
.forEach(([key,
|
|
99
|
+
.forEach(([key, fields]) => {
|
|
142
100
|
metadata.addSheet({
|
|
143
101
|
label: (key.label === "__main") ? "Principal" : key.label,
|
|
144
102
|
name: key.label,
|
|
145
|
-
|
|
103
|
+
fields,
|
|
146
104
|
requiredFields,
|
|
147
105
|
cleanOnCopyFields,
|
|
148
106
|
defaultValues
|
|
@@ -150,3 +108,30 @@ export const buildFromConfig = (config, dataUnit) => {
|
|
|
150
108
|
});
|
|
151
109
|
return metadata;
|
|
152
110
|
};
|
|
111
|
+
const buildFormField = (descriptor, config) => {
|
|
112
|
+
let { name, label, group } = Object.assign({}, config);
|
|
113
|
+
let { readOnly, required } = Object.assign({}, config);
|
|
114
|
+
let props;
|
|
115
|
+
let userInterface;
|
|
116
|
+
if (descriptor) {
|
|
117
|
+
label = label || descriptor.label;
|
|
118
|
+
name = name || descriptor.name;
|
|
119
|
+
required = descriptor.required || (config === null || config === void 0 ? void 0 : config.required);
|
|
120
|
+
readOnly = descriptor.readOnly || (config === null || config === void 0 ? void 0 : config.readOnly);
|
|
121
|
+
props = descriptor.properties;
|
|
122
|
+
userInterface = descriptor.userInterface;
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
name, label, group,
|
|
126
|
+
readOnly, required,
|
|
127
|
+
props,
|
|
128
|
+
userInterface: userInterface || UserInterface.SHORTTEXT
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
const getTabConfig = (tab, sheets) => {
|
|
132
|
+
const tabConfig = (typeof tab === "string" ? Array.from(sheets.keys()).find(t => t.label === tab) : tab);
|
|
133
|
+
return tabConfig || { label: tab, visible: true };
|
|
134
|
+
};
|
|
135
|
+
const sortTabs = (a, b) => {
|
|
136
|
+
return a[0].label == '__main' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
|
|
137
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
:host {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: 100%;
|
|
@@ -7,4 +7,10 @@ ez-form {
|
|
|
7
7
|
.dynamic-content ez-collapsible-box {
|
|
8
8
|
--ez-collapsible-box__header--padding-right: var(--space-small, 6px);
|
|
9
9
|
--ez-collapsible-box__header--padding-left: var(--space-small, 6px);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.multi-level__container {
|
|
13
|
+
display: grid;
|
|
14
|
+
grid-template-columns: minmax(20%, 300px) auto;
|
|
15
|
+
width: 100%;
|
|
10
16
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { FormSheet } from "./structure/FormSheet";
|
|
4
|
-
import { buildFromConfig, buildFromDataUnit } from "./structure/FormSheetMetadata";
|
|
1
|
+
import { Action, DataUnit, DataUnitAction, ElementIDUtils, StringUtils } from "@sankhyalabs/core";
|
|
2
|
+
import { Component, Element, Event, Host, Method, Prop, Watch, forceUpdate, h } from "@stencil/core";
|
|
5
3
|
import { createStore } from "redux";
|
|
6
|
-
import { formReducer, selectCurrentSheet, selectFormMetadata, loadMetadata, changeTab } from "./store/form.slice";
|
|
7
|
-
import DataBinder from "./DataBinder";
|
|
8
4
|
import ApplicationUtils from "../../utils/ApplicationUtils";
|
|
5
|
+
import DataBinder from "./DataBinder";
|
|
6
|
+
import { changeTab, formReducer, loadMetadata, selectCurrentSheet, selectCurrentSheetId, selectFormMetadata } from "./store/form.slice";
|
|
7
|
+
import { buildFromConfig, buildFromDataUnit } from "./FormMetadata";
|
|
9
8
|
export class EzForm {
|
|
10
9
|
constructor() {
|
|
11
10
|
this.onDataUnitAction = (action) => {
|
|
@@ -85,17 +84,43 @@ export class EzForm {
|
|
|
85
84
|
}
|
|
86
85
|
});
|
|
87
86
|
}
|
|
87
|
+
resolveLevel(items) {
|
|
88
|
+
if (!this.levelResolver) {
|
|
89
|
+
return items;
|
|
90
|
+
}
|
|
91
|
+
return this.levelResolver(items);
|
|
92
|
+
}
|
|
93
|
+
getMultiLevelContent(sheets, currentSheet, currentSheetId) {
|
|
94
|
+
const treeItems = this.resolveLevel(sheets.map(sheet => {
|
|
95
|
+
const item = {
|
|
96
|
+
id: sheet.name,
|
|
97
|
+
label: sheet.label
|
|
98
|
+
};
|
|
99
|
+
return item;
|
|
100
|
+
}));
|
|
101
|
+
return (h("div", { class: "multi-level__container" },
|
|
102
|
+
h("div", null,
|
|
103
|
+
h("ez-tree", { selectedId: currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.name, items: treeItems, onEzChange: (evt) => {
|
|
104
|
+
var _a;
|
|
105
|
+
const selectedItem = (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.id;
|
|
106
|
+
if (selectedItem && selectedItem !== (currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.name)) {
|
|
107
|
+
this._store.dispatch(changeTab(selectedItem));
|
|
108
|
+
}
|
|
109
|
+
} })),
|
|
110
|
+
h("div", null, this.buildFormContent(currentSheetId, currentSheet))));
|
|
111
|
+
}
|
|
88
112
|
getDynamicContent() {
|
|
89
|
-
var _a;
|
|
113
|
+
var _a, _b;
|
|
90
114
|
const formMD = selectFormMetadata(this._store.getState());
|
|
91
115
|
if (!formMD)
|
|
92
116
|
return null;
|
|
93
|
-
const currentSheet = selectCurrentSheet((_a = this._store) === null || _a === void 0 ? void 0 : _a.getState());
|
|
94
|
-
if (!currentSheet) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
117
|
const allSheets = Array.from(formMD.getAllSheets().values());
|
|
98
|
-
const
|
|
118
|
+
const currentSheetId = selectCurrentSheetId((_a = this._store) === null || _a === void 0 ? void 0 : _a.getState());
|
|
119
|
+
const currentSheet = selectCurrentSheet((_b = this._store) === null || _b === void 0 ? void 0 : _b.getState());
|
|
120
|
+
if (this.multiLevel) {
|
|
121
|
+
return this.getMultiLevelContent(allSheets, currentSheet, currentSheetId);
|
|
122
|
+
}
|
|
123
|
+
let result = [];
|
|
99
124
|
if (allSheets.length > 1) {
|
|
100
125
|
const tabs = allSheets.map((sheet, index) => {
|
|
101
126
|
return { tabKey: sheet.name, label: sheet.label, index };
|
|
@@ -103,12 +128,26 @@ export class EzForm {
|
|
|
103
128
|
const idTabSelector = `selector`;
|
|
104
129
|
result.push(h("ez-tabselector", { tabs: this.buildIdTabSelector(tabs), onEzChange: (evt) => this._store.dispatch(changeTab(evt.detail)), selectedTab: currentSheet.name, "data-element-id": idTabSelector }));
|
|
105
130
|
}
|
|
106
|
-
|
|
107
|
-
result.push(h(FormSheet, { store: this._store, source: currentSheet, dataElementId: idFormSheet }));
|
|
131
|
+
result = result.concat(this.buildFormContent(currentSheetId, currentSheet));
|
|
108
132
|
return result;
|
|
109
133
|
}
|
|
134
|
+
buildFormContent(sheetId, currentSheet) {
|
|
135
|
+
const fields = currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.fields;
|
|
136
|
+
if (this.contentBuilder != undefined) {
|
|
137
|
+
const customContent = this.contentBuilder(sheetId, fields);
|
|
138
|
+
if (customContent != undefined) {
|
|
139
|
+
return h("div", { "innerHTML": customContent });
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (currentSheet == undefined) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const idFormSheet = `${StringUtils.replaceAccentuatedChars(StringUtils.toCamelCase(currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.label), false)}_selectorContainer`;
|
|
146
|
+
return (h("div", { class: "dynamic-content ez-box__container", "data-element-id": idFormSheet },
|
|
147
|
+
h("ez-form-view", { class: "ez-row ez-padding-vertical--small", fields: fields })));
|
|
148
|
+
}
|
|
110
149
|
processMetadata() {
|
|
111
|
-
if (!this.isStatic() && this.dataUnit) {
|
|
150
|
+
if (!this.isStatic() && this.dataUnit && this._store) {
|
|
112
151
|
const metadata = this.config != undefined && Object.values(this.config).length > 0 ? buildFromConfig(this.config, this.dataUnit) : buildFromDataUnit(this.dataUnit);
|
|
113
152
|
this._store.dispatch(loadMetadata(metadata));
|
|
114
153
|
}
|
|
@@ -148,7 +187,7 @@ export class EzForm {
|
|
|
148
187
|
}
|
|
149
188
|
if (action.type === Action.RECORDS_ADDED) {
|
|
150
189
|
const metadata = selectFormMetadata(this._store.getState());
|
|
151
|
-
const defaultValues = metadata.getDefaultValues();
|
|
190
|
+
const defaultValues = metadata === null || metadata === void 0 ? void 0 : metadata.getDefaultValues();
|
|
152
191
|
if (defaultValues) {
|
|
153
192
|
const records = action.payload;
|
|
154
193
|
return new DataUnitAction(Action.RECORDS_ADDED, records.map(record => {
|
|
@@ -197,6 +236,7 @@ export class EzForm {
|
|
|
197
236
|
return (h(Host, null, this.isStatic() ? null : this.getDynamicContent()));
|
|
198
237
|
}
|
|
199
238
|
static get is() { return "ez-form"; }
|
|
239
|
+
static get encapsulation() { return "scoped"; }
|
|
200
240
|
static get originalStyleUrls() { return {
|
|
201
241
|
"$": ["ez-form.css"]
|
|
202
242
|
}; }
|
|
@@ -232,7 +272,8 @@ export class EzForm {
|
|
|
232
272
|
"resolved": "IFormConfig",
|
|
233
273
|
"references": {
|
|
234
274
|
"IFormConfig": {
|
|
235
|
-
"location": "
|
|
275
|
+
"location": "import",
|
|
276
|
+
"path": "./interfaces"
|
|
236
277
|
}
|
|
237
278
|
}
|
|
238
279
|
},
|
|
@@ -251,7 +292,8 @@ export class EzForm {
|
|
|
251
292
|
"resolved": "IRecordValidator",
|
|
252
293
|
"references": {
|
|
253
294
|
"IRecordValidator": {
|
|
254
|
-
"location": "
|
|
295
|
+
"location": "import",
|
|
296
|
+
"path": "./interfaces"
|
|
255
297
|
}
|
|
256
298
|
}
|
|
257
299
|
},
|
|
@@ -261,6 +303,72 @@ export class EzForm {
|
|
|
261
303
|
"tags": [],
|
|
262
304
|
"text": "Define um validador respons\u00E1vel pela integridade dos registros."
|
|
263
305
|
}
|
|
306
|
+
},
|
|
307
|
+
"multiLevel": {
|
|
308
|
+
"type": "boolean",
|
|
309
|
+
"mutable": false,
|
|
310
|
+
"complexType": {
|
|
311
|
+
"original": "boolean",
|
|
312
|
+
"resolved": "boolean",
|
|
313
|
+
"references": {}
|
|
314
|
+
},
|
|
315
|
+
"required": false,
|
|
316
|
+
"optional": false,
|
|
317
|
+
"docs": {
|
|
318
|
+
"tags": [],
|
|
319
|
+
"text": "Habilita o modo de organiza\u00E7\u00E3o com v\u00E1rios n\u00EDveis."
|
|
320
|
+
},
|
|
321
|
+
"attribute": "multi-level",
|
|
322
|
+
"reflect": false
|
|
323
|
+
},
|
|
324
|
+
"levelResolver": {
|
|
325
|
+
"type": "unknown",
|
|
326
|
+
"mutable": false,
|
|
327
|
+
"complexType": {
|
|
328
|
+
"original": "(items: Array<ITreeItem>) => Array<ITreeItem>",
|
|
329
|
+
"resolved": "(items: ITreeItem[]) => ITreeItem[]",
|
|
330
|
+
"references": {
|
|
331
|
+
"Array": {
|
|
332
|
+
"location": "global"
|
|
333
|
+
},
|
|
334
|
+
"ITreeItem": {
|
|
335
|
+
"location": "import",
|
|
336
|
+
"path": "../ez-tree/interfaces/ITreeItem"
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"required": false,
|
|
341
|
+
"optional": false,
|
|
342
|
+
"docs": {
|
|
343
|
+
"tags": [],
|
|
344
|
+
"text": "Define um resolvedor de n\u00EDvel no modo `multiLevel`."
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
"contentBuilder": {
|
|
348
|
+
"type": "unknown",
|
|
349
|
+
"mutable": false,
|
|
350
|
+
"complexType": {
|
|
351
|
+
"original": "(selectedTab: string, fields: Array<IFormViewField>) => HTMLElement | string",
|
|
352
|
+
"resolved": "(selectedTab: string, fields: IFormViewField[]) => string | HTMLElement",
|
|
353
|
+
"references": {
|
|
354
|
+
"Array": {
|
|
355
|
+
"location": "global"
|
|
356
|
+
},
|
|
357
|
+
"IFormViewField": {
|
|
358
|
+
"location": "import",
|
|
359
|
+
"path": "../ez-form-view/interfaces"
|
|
360
|
+
},
|
|
361
|
+
"HTMLElement": {
|
|
362
|
+
"location": "global"
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
"required": false,
|
|
367
|
+
"optional": false,
|
|
368
|
+
"docs": {
|
|
369
|
+
"tags": [],
|
|
370
|
+
"text": "Define um construtor. Isso permite personalizar o conte\u00FAdo do formul\u00E1rio"
|
|
371
|
+
}
|
|
264
372
|
}
|
|
265
373
|
}; }
|
|
266
374
|
static get events() { return [{
|
|
@@ -296,7 +404,8 @@ export class EzForm {
|
|
|
296
404
|
"path": "@sankhyalabs/core"
|
|
297
405
|
},
|
|
298
406
|
"IValidationResult": {
|
|
299
|
-
"location": "
|
|
407
|
+
"location": "import",
|
|
408
|
+
"path": "./interfaces"
|
|
300
409
|
}
|
|
301
410
|
},
|
|
302
411
|
"return": "Promise<void>"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -20,15 +20,19 @@ export function loadMetadata(formMetadata) {
|
|
|
20
20
|
export function changeTab(currentSheet) {
|
|
21
21
|
return {
|
|
22
22
|
type: FormActions.CHANGE_TAB,
|
|
23
|
-
payload: currentSheet.tabKey
|
|
23
|
+
payload: typeof currentSheet === "string" ? currentSheet : currentSheet.tabKey
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
/////////////////////////////// SELECTORS ///////////////////////////////
|
|
27
27
|
export function selectFormMetadata(state) {
|
|
28
28
|
return state.formMetadata;
|
|
29
29
|
}
|
|
30
|
+
export function selectCurrentSheetId(state) {
|
|
31
|
+
return state.currentSheet;
|
|
32
|
+
}
|
|
30
33
|
export function selectCurrentSheet(state) {
|
|
31
|
-
|
|
34
|
+
const currentSheetId = selectCurrentSheetId(state);
|
|
35
|
+
return currentSheetId ? state.formMetadata.getSheet(currentSheetId) : Array.from(state.formMetadata.getAllSheets().values())[0];
|
|
32
36
|
}
|
|
33
37
|
/////////////////////////////// TYPES ///////////////////////////////
|
|
34
38
|
var FormActions;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Component, Element, Host, Prop, h } from '@stencil/core';
|
|
2
|
+
import { fieldBuilder } from './fieldbuilder/FieldBuilder';
|
|
3
|
+
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
4
|
+
export class EzFormView {
|
|
5
|
+
groupFields(fields) {
|
|
6
|
+
const result = new Map();
|
|
7
|
+
fields.forEach(item => {
|
|
8
|
+
const groupLabel = item.group;
|
|
9
|
+
if (groupLabel) {
|
|
10
|
+
let groupFields = result.get(groupLabel);
|
|
11
|
+
if (groupFields == undefined) {
|
|
12
|
+
groupFields = [];
|
|
13
|
+
result.set(groupLabel, groupFields);
|
|
14
|
+
}
|
|
15
|
+
groupFields.push(item);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
result.set(item.name, item);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
|
|
25
|
+
if (this.fields == undefined) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
return (h(Host, null, Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
|
|
29
|
+
if (Array.isArray(value)) {
|
|
30
|
+
return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, value.map(fi => fieldBuilder(fi))));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return fieldBuilder(value);
|
|
34
|
+
}
|
|
35
|
+
})));
|
|
36
|
+
}
|
|
37
|
+
static get is() { return "ez-form-view"; }
|
|
38
|
+
static get encapsulation() { return "scoped"; }
|
|
39
|
+
static get originalStyleUrls() { return {
|
|
40
|
+
"$": ["ez-form-view.css"]
|
|
41
|
+
}; }
|
|
42
|
+
static get styleUrls() { return {
|
|
43
|
+
"$": ["ez-form-view.css"]
|
|
44
|
+
}; }
|
|
45
|
+
static get properties() { return {
|
|
46
|
+
"fields": {
|
|
47
|
+
"type": "unknown",
|
|
48
|
+
"mutable": false,
|
|
49
|
+
"complexType": {
|
|
50
|
+
"original": "Array<IFormViewField>",
|
|
51
|
+
"resolved": "IFormViewField[]",
|
|
52
|
+
"references": {
|
|
53
|
+
"Array": {
|
|
54
|
+
"location": "global"
|
|
55
|
+
},
|
|
56
|
+
"IFormViewField": {
|
|
57
|
+
"location": "import",
|
|
58
|
+
"path": "./interfaces/IFormViewField"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"required": false,
|
|
63
|
+
"optional": false,
|
|
64
|
+
"docs": {
|
|
65
|
+
"tags": [],
|
|
66
|
+
"text": "Define a lista de metadados usada para criar os campos de user interface."
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}; }
|
|
70
|
+
static get elementRef() { return "_element"; }
|
|
71
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UserInterface } from "@sankhyalabs/core";
|
|
2
|
+
import { buildCheckBox, buildSwitch } from "./templates/CheckBox.tpl";
|
|
3
|
+
import { buildComboBox } from "./templates/ComboBox.tpl";
|
|
4
|
+
import { buildDate, buildTime, buildDateTime } from "./templates/DateInput.tpl";
|
|
5
|
+
import { buildFile } from "./templates/FileInput.tpl";
|
|
6
|
+
import { buildDecimal, buildInteger } from "./templates/NumberInput.tpl";
|
|
7
|
+
import { buildSearch } from "./templates/SearchInput.tpl";
|
|
8
|
+
import { buildTextArea } from "./templates/TextArea.tpl";
|
|
9
|
+
import { buildTextInput } from "./templates/TextInput.tpl";
|
|
10
|
+
const uiBuilders = new Map();
|
|
11
|
+
uiBuilders.set(UserInterface.CHECKBOX, buildCheckBox);
|
|
12
|
+
uiBuilders.set(UserInterface.SWITCH, buildSwitch);
|
|
13
|
+
uiBuilders.set(UserInterface.OPTIONSELECTOR, buildComboBox);
|
|
14
|
+
uiBuilders.set(UserInterface.DATE, buildDate);
|
|
15
|
+
uiBuilders.set(UserInterface.TIME, buildTime);
|
|
16
|
+
uiBuilders.set(UserInterface.DATETIME, buildDateTime);
|
|
17
|
+
uiBuilders.set(UserInterface.FILE, buildFile);
|
|
18
|
+
uiBuilders.set(UserInterface.DECIMALNUMBER, buildDecimal);
|
|
19
|
+
uiBuilders.set(UserInterface.INTEGERNUMBER, buildInteger);
|
|
20
|
+
uiBuilders.set(UserInterface.SEARCH, buildSearch);
|
|
21
|
+
uiBuilders.set(UserInterface.LONGTEXT, buildTextArea);
|
|
22
|
+
export const fieldBuilder = (field) => {
|
|
23
|
+
const builder = uiBuilders.get(field.userInterface) || buildTextInput;
|
|
24
|
+
const label = field.required ? `${field.label} (obrigatório) *` : field.label;
|
|
25
|
+
return builder(Object.assign(Object.assign({}, field), { label }));
|
|
26
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { CheckMode } from "../../../ez-check/CheckMode";
|
|
3
|
-
export const buildSwitch = (
|
|
4
|
-
return buildField(
|
|
3
|
+
export const buildSwitch = (field) => {
|
|
4
|
+
return buildField(field.name, field.label, field.readOnly, true);
|
|
5
5
|
};
|
|
6
|
-
export const buildCheckBox = (
|
|
7
|
-
return buildField(
|
|
6
|
+
export const buildCheckBox = (field) => {
|
|
7
|
+
return buildField(field.name, field.label, field.readOnly, false);
|
|
8
8
|
};
|
|
9
9
|
function buildField(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
10
10
|
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildComboBox = ({ name, label, readOnly, required }
|
|
3
|
-
const prop =
|
|
2
|
+
export const buildComboBox = ({ name, label, readOnly, required, props }) => {
|
|
3
|
+
const prop = props === null || props === void 0 ? void 0 : props.options;
|
|
4
4
|
let options;
|
|
5
5
|
if (typeof prop === "string") {
|
|
6
6
|
const parsed = JSON.parse(prop);
|