@sankhyalabs/ezui 1.2.0-beta.8 → 2.0.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/{ApplicationUtils-2ac1b73e.js → ApplicationUtils-edc62c5c.js} +4 -1
- package/dist/cjs/CheckMode-ecb90b87.js +7 -0
- package/dist/cjs/{DialogType-a1e288e6.js → DialogType-aa435c52.js} +1 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +68 -17
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +13 -11
- package/dist/cjs/ez-calendar.cjs.entry.js +5 -5
- package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +11 -9
- package/dist/cjs/ez-chip.cjs.entry.js +17 -7
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +85 -7
- package/dist/cjs/ez-combo-box.cjs.entry.js +51 -20
- package/dist/cjs/ez-date-input.cjs.entry.js +13 -18
- package/dist/cjs/ez-date-time-input.cjs.entry.js +12 -17
- package/dist/cjs/ez-dialog.cjs.entry.js +43 -8
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +99 -486
- package/dist/cjs/ez-grid-config.cjs.entry.js +8 -9
- package/dist/cjs/ez-grid.cjs.entry.js +1073 -1168
- package/dist/cjs/ez-icon.cjs.entry.js +3 -3
- package/dist/cjs/ez-list.cjs.entry.js +2 -4
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +58 -0
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +4 -4
- package/dist/cjs/ez-popover.cjs.entry.js +6 -6
- package/dist/cjs/ez-popup.cjs.entry.js +8 -4
- package/dist/cjs/ez-radio-button.cjs.entry.js +3 -3
- package/dist/cjs/ez-scroller.cjs.entry.js +2 -2
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-select-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +8 -7
- package/dist/cjs/ez-text-area.cjs.entry.js +7 -7
- package/dist/cjs/ez-text-edit.cjs.entry.js +103 -0
- package/dist/cjs/ez-text-input.cjs.entry.js +14 -4
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -7
- package/dist/cjs/ez-toast.cjs.entry.js +2 -2
- package/dist/cjs/ez-upload.cjs.entry.js +4 -4
- package/dist/cjs/ez-view-stack.cjs.entry.js +10 -7
- package/dist/cjs/ezui.cjs.js +4 -112
- package/dist/cjs/loader.cjs.js +2 -18
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.css +49 -20
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +219 -23
- package/dist/collection/components/ez-button/ez-button.css +0 -6
- package/dist/collection/components/ez-button/ez-button.js +11 -9
- package/dist/collection/components/ez-calendar/ez-calendar.css +17 -20
- package/dist/collection/components/ez-check/CheckMode.js +5 -0
- package/dist/collection/components/ez-check/ez-check.css +23 -24
- package/dist/collection/components/ez-check/ez-check.js +10 -8
- package/dist/collection/components/ez-chip/ez-chip.css +4 -2
- package/dist/collection/components/ez-chip/ez-chip.js +16 -6
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +16 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +226 -7
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +1 -22
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +51 -20
- package/dist/collection/components/ez-date-input/ez-date-input.js +8 -13
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +8 -13
- package/dist/collection/components/ez-dialog/DialogType.js +1 -0
- package/dist/collection/components/ez-dialog/ez-dialog.css +19 -25
- package/dist/collection/components/ez-dialog/ez-dialog.js +41 -6
- package/dist/collection/components/ez-form/DataBinder.js +1 -0
- package/dist/collection/components/ez-form/ez-form.js +22 -13
- package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +3 -3
- package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +2 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +4 -4
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +25 -15
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +3 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +51 -15
- package/dist/collection/components/ez-grid/controller/ag-grid/components/cellRenderer.js +31 -0
- package/dist/collection/components/ez-grid/ez-grid.js +40 -3
- package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.css +38 -27
- package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.js +1 -2
- package/dist/collection/components/ez-grid/subcomponents/ez-select-box/ez-select-box.js +5 -4
- package/dist/collection/components/ez-list/ez-list.css +12 -4
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +38 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +190 -0
- package/dist/collection/components/ez-modal-container/index.js +2 -0
- package/dist/collection/components/ez-modal-container/modal-action.js +8 -0
- package/dist/collection/components/ez-modal-container/modal-button-status.js +7 -0
- package/dist/collection/components/ez-popover/ez-popover.css +1 -1
- package/dist/collection/components/ez-popup/ez-popup.css +6 -1
- package/dist/collection/components/ez-popup/ez-popup.js +26 -4
- package/dist/collection/components/ez-radio-button/ez-radio-button.css +16 -5
- package/dist/collection/components/ez-radio-button/ez-radio-button.js +1 -1
- package/dist/collection/components/ez-scroller/ez-scroller.css +3 -2
- package/dist/collection/components/ez-search/ez-search.js +6 -6
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +10 -1
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +7 -3
- package/dist/collection/components/ez-text-area/ez-text-area.css +6 -3
- package/dist/collection/components/ez-text-area/ez-text-area.js +5 -5
- package/dist/collection/components/ez-text-edit/ez-text-edit.css +19 -0
- package/dist/collection/components/ez-text-edit/ez-text-edit.js +188 -0
- package/dist/collection/components/ez-text-input/ez-text-input.css +18 -2
- package/dist/collection/components/ez-text-input/ez-text-input.js +28 -0
- package/dist/collection/components/ez-toast/ez-toast.css +1 -1
- package/dist/collection/components/ez-upload/ez-upload.css +1 -1
- package/dist/collection/components/ez-view-stack/ez-view-stack.js +12 -6
- package/dist/collection/utils/ApplicationUtils.js +3 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +1595 -4005
- package/dist/{ezui/ApplicationUtils-30a69eb0.js → esm/ApplicationUtils-205ac4bc.js} +4 -2
- package/dist/esm/CheckMode-bdb2ec19.js +7 -0
- package/dist/esm/{DialogType-72afa679.js → DialogType-4059dc4d.js} +1 -0
- package/dist/esm/ez-actions-button.entry.js +68 -17
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +13 -11
- package/dist/esm/ez-calendar.entry.js +3 -3
- package/dist/esm/ez-card-item.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +11 -9
- package/dist/esm/ez-chip.entry.js +17 -7
- package/dist/esm/ez-collapsible-box.entry.js +85 -7
- package/dist/esm/ez-combo-box.entry.js +48 -17
- package/dist/esm/ez-date-input.entry.js +10 -15
- package/dist/esm/ez-date-time-input.entry.js +10 -15
- package/dist/esm/ez-dialog.entry.js +43 -8
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +65 -452
- package/dist/esm/ez-grid-config.entry.js +6 -7
- package/dist/esm/ez-grid.entry.js +1039 -1134
- package/dist/esm/ez-icon.entry.js +2 -2
- package/dist/esm/ez-list.entry.js +2 -4
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +54 -0
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +2 -2
- package/dist/esm/ez-popover.entry.js +3 -3
- package/dist/esm/ez-popup.entry.js +8 -4
- package/dist/esm/ez-radio-button.entry.js +3 -3
- package/dist/esm/ez-scroller.entry.js +2 -2
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-select-box.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +8 -7
- package/dist/esm/ez-text-area.entry.js +7 -7
- package/dist/esm/ez-text-edit.entry.js +99 -0
- package/dist/esm/ez-text-input.entry.js +13 -3
- package/dist/esm/ez-time-input.entry.js +2 -2
- package/dist/esm/ez-toast.entry.js +2 -2
- package/dist/esm/ez-upload.entry.js +4 -4
- package/dist/esm/ez-view-stack.entry.js +10 -7
- package/dist/esm/ezui.js +4 -112
- package/dist/esm/loader.js +2 -18
- package/dist/ezui/ezui.esm.js +1 -125
- package/dist/ezui/index.esm.js +0 -1
- package/dist/ezui/p-04a41a44.entry.js +1 -0
- package/dist/ezui/p-0b44cf1c.js +1 -0
- package/dist/ezui/p-0c7203d5.entry.js +1 -0
- package/dist/ezui/p-2213da1f.entry.js +1 -0
- package/dist/ezui/p-2c6398b3.entry.js +1 -0
- package/dist/ezui/p-2ccad880.entry.js +1 -0
- package/dist/ezui/p-333d79c4.entry.js +1 -0
- package/dist/ezui/p-3987f8d8.entry.js +1 -0
- package/dist/ezui/{p-81eb2738.entry.js → p-42c6493e.entry.js} +1 -1
- package/dist/ezui/{p-b4ad3b15.entry.js → p-482c3dd8.entry.js} +1 -1
- package/dist/ezui/p-5bdb1a41.entry.js +1 -0
- package/dist/ezui/{p-b2cf7db2.entry.js → p-63d567cc.entry.js} +1 -1
- package/dist/ezui/p-659616e4.entry.js +1 -0
- package/dist/ezui/p-6608b9a5.entry.js +1 -0
- package/dist/ezui/p-77ec47ac.entry.js +1 -0
- package/dist/ezui/p-9b9ebf95.entry.js +1 -0
- package/dist/ezui/{p-88bfdea4.entry.js → p-ae5af8f9.entry.js} +1 -1
- package/dist/ezui/p-b853763b.js +1 -0
- package/dist/ezui/p-be06251d.entry.js +1 -0
- package/dist/ezui/{p-e7d03a0d.entry.js → p-bffae598.entry.js} +1 -1
- package/dist/ezui/p-cd4677d4.entry.js +1 -0
- package/dist/ezui/p-cfcc23e6.entry.js +1 -0
- package/dist/ezui/p-dfcf55e0.entry.js +1 -0
- package/dist/ezui/p-e1148f5c.js +1 -0
- package/dist/ezui/p-e1f2b5da.entry.js +1 -0
- package/dist/ezui/p-e230bfd2.entry.js +1 -0
- package/dist/ezui/{p-867aac16.entry.js → p-e3ee814c.entry.js} +1 -1
- package/dist/ezui/p-e697ffd5.entry.js +1 -0
- package/dist/ezui/{p-4eb273f8.entry.js → p-efa32bcc.entry.js} +1 -1
- package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +42 -9
- package/dist/types/components/ez-check/CheckMode.d.ts +4 -0
- package/dist/types/components/ez-chip/ez-chip.d.ts +2 -1
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +46 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +15 -5
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +0 -1
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +0 -1
- package/dist/types/components/ez-dialog/DialogType.d.ts +1 -0
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +3 -0
- package/dist/types/components/ez-form/DataBinder.d.ts +2 -2
- package/dist/types/components/ez-form/ez-form.d.ts +21 -11
- package/dist/types/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.d.ts +3 -3
- package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +4 -2
- package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +2 -5
- package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +3 -3
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +4 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/cellRenderer.d.ts +9 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +8 -3
- package/dist/types/components/ez-grid/subcomponents/ez-select-box/ez-select-box.d.ts +2 -6
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +47 -0
- package/dist/types/components/ez-modal-container/index.d.ts +2 -0
- package/dist/types/components/ez-modal-container/modal-action.d.ts +7 -0
- package/dist/types/components/ez-modal-container/modal-button-status.d.ts +6 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +4 -0
- package/dist/types/components/ez-search/ez-search.d.ts +3 -3
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +2 -0
- package/dist/types/components/ez-text-edit/ez-text-edit.d.ts +39 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +5 -0
- package/dist/types/components/ez-view-stack/ez-view-stack.d.ts +5 -1
- package/dist/types/components.d.ts +274 -28
- package/dist/types/utils/ApplicationUtils.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +5 -5
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ApplicationUtils-475b50d9.js +0 -63
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-3bfdba4f.js +0 -6
- package/dist/cjs/dom-8ac1ad03.js +0 -75
- package/dist/cjs/index-2ec1da82.js +0 -2307
- package/dist/cjs/index-55178184.js +0 -6
- package/dist/cjs/index-d9c5cb88.js +0 -3068
- package/dist/cjs/shadow-css-41d9783d.js +0 -390
- package/dist/esm/ApplicationUtils-30a69eb0.js +0 -61
- package/dist/esm/ApplicationUtils-a4a76132.js +0 -60
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/css-shim-20dbffa5.js +0 -4
- package/dist/esm/dom-c5ed0ba5.js +0 -73
- package/dist/esm/index-1e9d524f.js +0 -3031
- package/dist/esm/index-b96183c8.js +0 -2295
- package/dist/esm/index-f32470b5.js +0 -3
- package/dist/esm/shadow-css-8c625855.js +0 -388
- package/dist/ezui/CSSVarsUtils-00f67f32.js +0 -70
- package/dist/ezui/DialogType-72afa679.js +0 -8
- package/dist/ezui/app-globals-0f993ce5.js +0 -3
- package/dist/ezui/css-shim-20dbffa5.js +0 -4
- package/dist/ezui/dom-c5ed0ba5.js +0 -73
- package/dist/ezui/ez-actions-button.entry.js +0 -98
- package/dist/ezui/ez-application.entry.js +0 -22
- package/dist/ezui/ez-button.entry.js +0 -73
- package/dist/ezui/ez-calendar.entry.js +0 -219
- package/dist/ezui/ez-card-item.entry.js +0 -40
- package/dist/ezui/ez-check.entry.js +0 -72
- package/dist/ezui/ez-chip.entry.js +0 -97
- package/dist/ezui/ez-collapsible-box.entry.js +0 -57
- package/dist/ezui/ez-combo-box.entry.js +0 -439
- package/dist/ezui/ez-date-input.entry.js +0 -159
- package/dist/ezui/ez-date-time-input.entry.js +0 -214
- package/dist/ezui/ez-dialog.entry.js +0 -108
- package/dist/ezui/ez-filter-input.entry.js +0 -75
- package/dist/ezui/ez-form.entry.js +0 -1395
- package/dist/ezui/ez-grid-config.entry.js +0 -433
- package/dist/ezui/ez-grid.entry.js +0 -115419
- package/dist/ezui/ez-icon.entry.js +0 -37
- package/dist/ezui/ez-list.entry.js +0 -516
- package/dist/ezui/ez-loading-bar.entry.js +0 -24
- package/dist/ezui/ez-modal.entry.js +0 -67
- package/dist/ezui/ez-number-input.entry.js +0 -148
- package/dist/ezui/ez-popover.entry.js +0 -141
- package/dist/ezui/ez-popup.entry.js +0 -49
- package/dist/ezui/ez-radio-button.entry.js +0 -45
- package/dist/ezui/ez-scroller.entry.js +0 -101
- package/dist/ezui/ez-search.entry.js +0 -83
- package/dist/ezui/ez-select-box.entry.js +0 -18
- package/dist/ezui/ez-tabselector.entry.js +0 -195
- package/dist/ezui/ez-text-area.entry.js +0 -158
- package/dist/ezui/ez-text-input.entry.js +0 -235
- package/dist/ezui/ez-time-input.entry.js +0 -164
- package/dist/ezui/ez-toast.entry.js +0 -84
- package/dist/ezui/ez-upload.entry.js +0 -379
- package/dist/ezui/ez-view-stack.entry.js +0 -74
- package/dist/ezui/index-1e9d524f.js +0 -3031
- package/dist/ezui/index-b96183c8.js +0 -2295
- package/dist/ezui/index-f32470b5.js +0 -3
- package/dist/ezui/p-2f02347d.entry.js +0 -1
- package/dist/ezui/p-416bedbe.entry.js +0 -1
- package/dist/ezui/p-544f0c63.entry.js +0 -1
- package/dist/ezui/p-62110996.entry.js +0 -1
- package/dist/ezui/p-719e9ef9.entry.js +0 -1
- package/dist/ezui/p-787fbdfe.js +0 -1
- package/dist/ezui/p-9d5be6a7.entry.js +0 -1
- package/dist/ezui/p-a27dafa4.entry.js +0 -1
- package/dist/ezui/p-aba3fa6c.entry.js +0 -1
- package/dist/ezui/p-adbe4188.js +0 -1
- package/dist/ezui/p-af43be42.entry.js +0 -1
- package/dist/ezui/p-b7467ad6.entry.js +0 -1
- package/dist/ezui/p-c019e137.entry.js +0 -1
- package/dist/ezui/p-c9d2060e.entry.js +0 -1
- package/dist/ezui/p-cccd8cde.entry.js +0 -1
- package/dist/ezui/p-d0671e14.entry.js +0 -1
- package/dist/ezui/p-e0f06d73.entry.js +0 -1
- package/dist/ezui/p-e59adce6.entry.js +0 -1
- package/dist/ezui/p-ed835b36.entry.js +0 -1
- package/dist/ezui/shadow-css-8c625855.js +0 -388
|
@@ -93,7 +93,14 @@ export class EzComboBox {
|
|
|
93
93
|
if (currentValue) {
|
|
94
94
|
text = this.showSelectedValue ? `${currentValue.value} - ${currentValue.label}` : currentValue.label;
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
if (text == undefined) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
return String(text)
|
|
100
|
+
.replace(/&/g, '&')
|
|
101
|
+
.replace(/</g, '<')
|
|
102
|
+
.replace(/>/g, '>')
|
|
103
|
+
.replace(/"/g, '"');
|
|
97
104
|
}
|
|
98
105
|
getSelectedOption(value) {
|
|
99
106
|
if (typeof value === "string" || value instanceof String) {
|
|
@@ -130,11 +137,11 @@ export class EzComboBox {
|
|
|
130
137
|
return 0;
|
|
131
138
|
}
|
|
132
139
|
getWidthValue(value) {
|
|
133
|
-
if (this._itemValueBasis) {
|
|
140
|
+
if (this._itemValueBasis != undefined) {
|
|
134
141
|
const span = this._itemValueBasis;
|
|
135
|
-
if (value) {
|
|
142
|
+
if (value != undefined) {
|
|
136
143
|
span.innerHTML = value;
|
|
137
|
-
return span.clientWidth > 0 ? (span.clientWidth +
|
|
144
|
+
return span.clientWidth > 0 ? (span.clientWidth + 2) : 0;
|
|
138
145
|
}
|
|
139
146
|
else {
|
|
140
147
|
span.innerHTML = "";
|
|
@@ -143,9 +150,10 @@ export class EzComboBox {
|
|
|
143
150
|
return 0;
|
|
144
151
|
}
|
|
145
152
|
buildItem(opt, index) {
|
|
153
|
+
const widthValue = this.showOptionValue && this._maxWidthValue > 0 ? `${this._maxWidthValue}px` : '';
|
|
146
154
|
return h("li", { class: index === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = undefined },
|
|
147
155
|
this.showOptionValue
|
|
148
|
-
? h("span", { class: "item__value", title: opt.value, style: { width:
|
|
156
|
+
? h("span", { class: "item__value", title: opt.value, style: { width: widthValue, minWidth: widthValue, maxWidth: widthValue } }, opt.value)
|
|
149
157
|
: undefined,
|
|
150
158
|
h("span", { class: "item__label", title: opt.label }, opt.label));
|
|
151
159
|
}
|
|
@@ -185,7 +193,7 @@ export class EzComboBox {
|
|
|
185
193
|
}
|
|
186
194
|
scrollToOption(opt, down) {
|
|
187
195
|
window.requestAnimationFrame(() => {
|
|
188
|
-
const liElem = this._optionsList.querySelector(`li#item_${opt.value}`);
|
|
196
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`li#item_${opt.value}`) : undefined;
|
|
189
197
|
if (liElem) {
|
|
190
198
|
const parent = liElem.parentElement;
|
|
191
199
|
const parentRect = parent.getBoundingClientRect();
|
|
@@ -246,6 +254,7 @@ export class EzComboBox {
|
|
|
246
254
|
}
|
|
247
255
|
else {
|
|
248
256
|
this.setInputValue();
|
|
257
|
+
this.hideOptions();
|
|
249
258
|
}
|
|
250
259
|
if (this.searchMode) {
|
|
251
260
|
this._visibleOptions = [];
|
|
@@ -258,7 +267,8 @@ export class EzComboBox {
|
|
|
258
267
|
this._criteria = argument;
|
|
259
268
|
this._startLoading = true;
|
|
260
269
|
if (this.optionLoader) {
|
|
261
|
-
|
|
270
|
+
const searchArgument = { mode, argument };
|
|
271
|
+
this.updateSource(this.optionLoader(searchArgument));
|
|
262
272
|
}
|
|
263
273
|
else {
|
|
264
274
|
this.updateSource(this.options);
|
|
@@ -327,7 +337,7 @@ export class EzComboBox {
|
|
|
327
337
|
this.updateSource([]);
|
|
328
338
|
}
|
|
329
339
|
else {
|
|
330
|
-
this.loadOptions(
|
|
340
|
+
this.loadOptions(SearchMode.PRELOAD);
|
|
331
341
|
}
|
|
332
342
|
}
|
|
333
343
|
componentDidRender() {
|
|
@@ -343,7 +353,7 @@ export class EzComboBox {
|
|
|
343
353
|
// Event handlers
|
|
344
354
|
//---------------------------------------------
|
|
345
355
|
handlerIconClick() {
|
|
346
|
-
this.searchMode ? this.loadOptions(
|
|
356
|
+
this.searchMode ? this.loadOptions(SearchMode.ADVANCED) : this.showOptions();
|
|
347
357
|
}
|
|
348
358
|
onTextInputChangeHandler(event) {
|
|
349
359
|
var _a;
|
|
@@ -365,7 +375,7 @@ export class EzComboBox {
|
|
|
365
375
|
this._showLoading = true;
|
|
366
376
|
this.clearSource();
|
|
367
377
|
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
368
|
-
this.loadOptions(
|
|
378
|
+
this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
|
|
369
379
|
}, this._deboucingTime);
|
|
370
380
|
}
|
|
371
381
|
else {
|
|
@@ -390,6 +400,17 @@ export class EzComboBox {
|
|
|
390
400
|
}
|
|
391
401
|
keyDownHandler(event) {
|
|
392
402
|
this._tabPressed = false;
|
|
403
|
+
if (event.ctrlKey) {
|
|
404
|
+
if (event.key === "f" || event.key === "F") {
|
|
405
|
+
this.loadOptions(SearchMode.ADVANCED);
|
|
406
|
+
//ATENÇÃO: Ctrl + F tem ação específica nos browsers
|
|
407
|
+
//nesse caso, como vamos abrir o popup de busca avançada,
|
|
408
|
+
//não é interessante deixar o evento propagar;
|
|
409
|
+
event.stopPropagation();
|
|
410
|
+
event.stopImmediatePropagation();
|
|
411
|
+
event.preventDefault();
|
|
412
|
+
}
|
|
413
|
+
}
|
|
393
414
|
switch (event.key) {
|
|
394
415
|
case "ArrowDown":
|
|
395
416
|
this.nextOption();
|
|
@@ -408,7 +429,11 @@ export class EzComboBox {
|
|
|
408
429
|
this.controlListWithOnlyOne();
|
|
409
430
|
break;
|
|
410
431
|
}
|
|
411
|
-
|
|
432
|
+
//ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
|
|
433
|
+
//Por exemplo, quando o usuário dá um Enter, além de selecionar
|
|
434
|
+
//um valor, também significa que a ateração finalizou,
|
|
435
|
+
//e o contexto pode reagir (fechar um popup por exemplo).
|
|
436
|
+
//event.stopPropagation();
|
|
412
437
|
}
|
|
413
438
|
onTextInputFocusOutHandler() {
|
|
414
439
|
this.cancelPreselection();
|
|
@@ -448,10 +473,10 @@ export class EzComboBox {
|
|
|
448
473
|
"type": "string",
|
|
449
474
|
"mutable": true,
|
|
450
475
|
"complexType": {
|
|
451
|
-
"original": "
|
|
452
|
-
"resolved": "
|
|
476
|
+
"original": "IOption | string",
|
|
477
|
+
"resolved": "IOption | string",
|
|
453
478
|
"references": {
|
|
454
|
-
"
|
|
479
|
+
"IOption": {
|
|
455
480
|
"location": "local"
|
|
456
481
|
}
|
|
457
482
|
}
|
|
@@ -504,13 +529,13 @@ export class EzComboBox {
|
|
|
504
529
|
"type": "unknown",
|
|
505
530
|
"mutable": true,
|
|
506
531
|
"complexType": {
|
|
507
|
-
"original": "Array<
|
|
508
|
-
"resolved": "
|
|
532
|
+
"original": "Array<IOption>",
|
|
533
|
+
"resolved": "IOption[]",
|
|
509
534
|
"references": {
|
|
510
535
|
"Array": {
|
|
511
536
|
"location": "global"
|
|
512
537
|
},
|
|
513
|
-
"
|
|
538
|
+
"IOption": {
|
|
514
539
|
"location": "local"
|
|
515
540
|
}
|
|
516
541
|
}
|
|
@@ -702,10 +727,10 @@ export class EzComboBox {
|
|
|
702
727
|
"text": "Evento que \u00E9 disparado ao alterar o valor do componente"
|
|
703
728
|
},
|
|
704
729
|
"complexType": {
|
|
705
|
-
"original": "
|
|
706
|
-
"resolved": "
|
|
730
|
+
"original": "IOption",
|
|
731
|
+
"resolved": "IOption",
|
|
707
732
|
"references": {
|
|
708
|
-
"
|
|
733
|
+
"IOption": {
|
|
709
734
|
"location": "local"
|
|
710
735
|
}
|
|
711
736
|
}
|
|
@@ -770,3 +795,9 @@ export class EzComboBox {
|
|
|
770
795
|
"methodName": "observeValue"
|
|
771
796
|
}]; }
|
|
772
797
|
}
|
|
798
|
+
var SearchMode;
|
|
799
|
+
(function (SearchMode) {
|
|
800
|
+
SearchMode["ADVANCED"] = "ADVANCED";
|
|
801
|
+
SearchMode["PRELOAD"] = "PRELOAD";
|
|
802
|
+
SearchMode["PREDICTIVE"] = "PREDICTIVE";
|
|
803
|
+
})(SearchMode || (SearchMode = {}));
|
|
@@ -29,8 +29,8 @@ export class EzDateInput {
|
|
|
29
29
|
}
|
|
30
30
|
observeValue(newValue, oldValue) {
|
|
31
31
|
if (this._textInput && newValue != oldValue) {
|
|
32
|
-
const newValueValidated =
|
|
33
|
-
const oldValueValidated =
|
|
32
|
+
const newValueValidated = DateUtils.validateDate(newValue);
|
|
33
|
+
const oldValueValidated = DateUtils.validateDate(oldValue);
|
|
34
34
|
if ((newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime()) !== (oldValueValidated === null || oldValueValidated === void 0 ? void 0 : oldValueValidated.getTime())) {
|
|
35
35
|
const textValue = this.getTextValue(newValueValidated) || '';
|
|
36
36
|
const parsedDate = DateUtils.strToDate(textValue);
|
|
@@ -63,8 +63,8 @@ export class EzDateInput {
|
|
|
63
63
|
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
64
64
|
}
|
|
65
65
|
changeValue(newValue) {
|
|
66
|
-
const currentValue =
|
|
67
|
-
const newValueValidated =
|
|
66
|
+
const currentValue = DateUtils.validateDate(this.value);
|
|
67
|
+
const newValueValidated = DateUtils.validateDate(newValue);
|
|
68
68
|
if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.getTime()) !== (newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime())) {
|
|
69
69
|
this.value = newValueValidated;
|
|
70
70
|
}
|
|
@@ -87,8 +87,8 @@ export class EzDateInput {
|
|
|
87
87
|
const newValue = DateUtils.strToDate(strValue);
|
|
88
88
|
if (newValue || !strValue) {
|
|
89
89
|
this.errorMessage = "";
|
|
90
|
-
const currentValue =
|
|
91
|
-
const newValueValidated =
|
|
90
|
+
const currentValue = DateUtils.validateDate(this.value);
|
|
91
|
+
const newValueValidated = DateUtils.validateDate(newValue);
|
|
92
92
|
if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.getTime()) === (newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime())) {
|
|
93
93
|
if (newValueValidated) {
|
|
94
94
|
this._textInput.value = this.getTextValue(newValueValidated) || '';
|
|
@@ -112,8 +112,8 @@ export class EzDateInput {
|
|
|
112
112
|
handleInput(event) {
|
|
113
113
|
const strValue = this._textInput.value;
|
|
114
114
|
const newValue = DateUtils.strToDate(strValue);
|
|
115
|
-
const currentValue =
|
|
116
|
-
const newValueValidated =
|
|
115
|
+
const currentValue = DateUtils.validateDate(this.value);
|
|
116
|
+
const newValueValidated = DateUtils.validateDate(newValue);
|
|
117
117
|
if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.getTime()) !== (newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime())) {
|
|
118
118
|
this._focused = true;
|
|
119
119
|
this.ezStartChange.emit({ waitmessage: "", blocking: false });
|
|
@@ -122,11 +122,6 @@ export class EzDateInput {
|
|
|
122
122
|
this.changeValue(new Date());
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
validateValue(value) {
|
|
126
|
-
return value instanceof Date && !isNaN(value.valueOf())
|
|
127
|
-
? DateUtils.clearTime(value)
|
|
128
|
-
: undefined;
|
|
129
|
-
}
|
|
130
125
|
setInputValue() {
|
|
131
126
|
const textValue = this.getTextValue(this.value) || '';
|
|
132
127
|
if ((this._textInput.value || '') !== textValue) {
|
|
@@ -33,8 +33,8 @@ export class EzDateTimeInput {
|
|
|
33
33
|
}
|
|
34
34
|
observeValue(newValue, oldValue) {
|
|
35
35
|
if (this._textInput && newValue != oldValue) {
|
|
36
|
-
const newValueValidated =
|
|
37
|
-
const oldValueValidated =
|
|
36
|
+
const newValueValidated = DateUtils.validateDate(newValue, true);
|
|
37
|
+
const oldValueValidated = DateUtils.validateDate(oldValue, true);
|
|
38
38
|
if ((newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime()) !== (oldValueValidated === null || oldValueValidated === void 0 ? void 0 : oldValueValidated.getTime())) {
|
|
39
39
|
const textValue = this.getTextValue(newValueValidated) || '';
|
|
40
40
|
const parsedDate = this.getParsedDateTime(textValue);
|
|
@@ -103,8 +103,8 @@ export class EzDateTimeInput {
|
|
|
103
103
|
input.setSelectionRange(selectIni, selectFin);
|
|
104
104
|
}
|
|
105
105
|
changeValue(newValue) {
|
|
106
|
-
const currentValue =
|
|
107
|
-
const newValueValidated =
|
|
106
|
+
const currentValue = DateUtils.validateDate(this.value, true);
|
|
107
|
+
const newValueValidated = DateUtils.validateDate(newValue, true);
|
|
108
108
|
if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.getTime()) !== (newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime())) {
|
|
109
109
|
this.value = newValueValidated;
|
|
110
110
|
}
|
|
@@ -133,8 +133,8 @@ export class EzDateTimeInput {
|
|
|
133
133
|
const newValue = this.getParsedDateTime();
|
|
134
134
|
if (newValue || !strValue) {
|
|
135
135
|
this.errorMessage = "";
|
|
136
|
-
const currentValue =
|
|
137
|
-
const newValueValidated =
|
|
136
|
+
const currentValue = DateUtils.validateDate(this.value, true);
|
|
137
|
+
const newValueValidated = DateUtils.validateDate(newValue, true);
|
|
138
138
|
if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.getTime()) === (newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime())) {
|
|
139
139
|
if (newValueValidated) {
|
|
140
140
|
this._textInput.value = this.getTextValue(newValueValidated) || '';
|
|
@@ -163,15 +163,10 @@ export class EzDateTimeInput {
|
|
|
163
163
|
};
|
|
164
164
|
return d ? (new Intl.DateTimeFormat('pt-BR', this.showSeconds ? optionsSecond : options).format(d)) : undefined;
|
|
165
165
|
}
|
|
166
|
-
validateValue(value) {
|
|
167
|
-
return value instanceof Date && !isNaN(value.valueOf())
|
|
168
|
-
? value
|
|
169
|
-
: undefined;
|
|
170
|
-
}
|
|
171
166
|
handleInput(event) {
|
|
172
167
|
const newValue = this.getParsedDateTime();
|
|
173
|
-
const currentValue =
|
|
174
|
-
const newValueValidated =
|
|
168
|
+
const currentValue = DateUtils.validateDate(this.value, true);
|
|
169
|
+
const newValueValidated = DateUtils.validateDate(newValue, true);
|
|
175
170
|
if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.getTime()) !== (newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime())) {
|
|
176
171
|
this._focused = true;
|
|
177
172
|
this.ezStartChange.emit({ waitmessage: "", blocking: false });
|
|
@@ -40,10 +40,12 @@
|
|
|
40
40
|
/* Ícones */
|
|
41
41
|
/*@doc Define a cor dos ícones dos indicadores de modo.*/
|
|
42
42
|
--dialog__icon--color: var(--text--inverted, #fff);
|
|
43
|
-
/*@doc Define a cor
|
|
43
|
+
/*@doc Define a cor do indicador do dialog de erro.*/
|
|
44
44
|
--dialog__critical--background-color: var(--color--alert-error-800, #BD0025);
|
|
45
|
-
/*@doc Define a cor
|
|
45
|
+
/*@doc Define a cor do indicador do dialog de alert.*/
|
|
46
46
|
--dialog__warning--background-color: var(--color--alert-warning-500, #EFB103);
|
|
47
|
+
/*@doc Define a cor do indicador do dialog de sucesso.*/
|
|
48
|
+
--dialog__success--background-color: var(--color--alert-success-500, #00523c);
|
|
47
49
|
|
|
48
50
|
/*@doc Define a camada que o dialog será exibido.*/
|
|
49
51
|
--dialog-z-index: var(--most-visible, 3);
|
|
@@ -123,6 +125,13 @@ h2 {
|
|
|
123
125
|
background-color: var(--dialog__warning--background-color);
|
|
124
126
|
}
|
|
125
127
|
|
|
128
|
+
.dialog__success--indicator{
|
|
129
|
+
width: 12px;
|
|
130
|
+
border-radius: 6px 0px 0px 6px;
|
|
131
|
+
box-sizing: border-box;
|
|
132
|
+
background-color: var(--dialog__success--background-color);
|
|
133
|
+
}
|
|
134
|
+
|
|
126
135
|
.message {
|
|
127
136
|
font-size: var(--dialog__body--font-size);
|
|
128
137
|
font-weight: var(--dialog__body--text-weight--medium);
|
|
@@ -178,23 +187,18 @@ h2 {
|
|
|
178
187
|
padding-left: 0;
|
|
179
188
|
}
|
|
180
189
|
|
|
181
|
-
.title-icon {
|
|
182
|
-
outline: none;
|
|
183
|
-
border: none;
|
|
184
|
-
background-color: var(--dialog__warning--background-color);
|
|
185
|
-
width: 26px;
|
|
186
|
-
height: 26px;
|
|
187
|
-
border-radius: 100%;
|
|
188
|
-
padding: 0;
|
|
189
|
-
display: flex;
|
|
190
|
-
justify-content: center;
|
|
191
|
-
align-items: center;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
190
|
.title-icon--critical {
|
|
195
191
|
background-color: var(--dialog__critical--background-color);
|
|
196
192
|
}
|
|
197
193
|
|
|
194
|
+
.title-icon--success {
|
|
195
|
+
background-color: var(--dialog__success--background-color);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.title-icon--warn {
|
|
199
|
+
background-color: var(--dialog__warning--background-color);
|
|
200
|
+
}
|
|
201
|
+
|
|
198
202
|
.btn-close {
|
|
199
203
|
justify-content: flex-end;
|
|
200
204
|
align-self: flex-start;
|
|
@@ -227,16 +231,6 @@ h2 {
|
|
|
227
231
|
mask-image: var(--dialog--warning__image);
|
|
228
232
|
}
|
|
229
233
|
|
|
230
|
-
.title-icon--critical::after {
|
|
231
|
-
content: '';
|
|
232
|
-
display: flex;
|
|
233
|
-
background-color: #FFFF;
|
|
234
|
-
width: 13px;
|
|
235
|
-
height: 13px;
|
|
236
|
-
-webkit-mask-image: var(--dialog--critical__image);
|
|
237
|
-
mask-image: var(--dialog--critical__image);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
234
|
.button-yes-no__container {
|
|
241
235
|
display: flex;
|
|
242
236
|
box-sizing: border-box;
|
|
@@ -55,19 +55,54 @@ export class EzDialog {
|
|
|
55
55
|
return dialogType === DialogType.CRITICAL;
|
|
56
56
|
}
|
|
57
57
|
getIconElement(message) {
|
|
58
|
-
if (message.icon) {
|
|
59
|
-
return h("ez-icon", { class: this.isCritical(message.dialogType) ? "changeable__icon critical" : "changeable__icon", size: "small", iconName: message.icon });
|
|
60
|
-
}
|
|
61
58
|
if (message.dialogType === DialogType.DEFAULT) {
|
|
62
59
|
return;
|
|
63
60
|
}
|
|
64
|
-
return h("
|
|
61
|
+
return h("ez-icon", { class: "changeable__icon " + this.getIconClass(message.dialogType), size: "small", iconName: this.getIconName(message) });
|
|
62
|
+
}
|
|
63
|
+
getIconClass(dialogType) {
|
|
64
|
+
if (this.isCritical(dialogType)) {
|
|
65
|
+
return "title-icon--critical";
|
|
66
|
+
}
|
|
67
|
+
else if (dialogType === DialogType.SUCCESS) {
|
|
68
|
+
return "title-icon--success";
|
|
69
|
+
}
|
|
70
|
+
else if (dialogType === DialogType.WARN) {
|
|
71
|
+
return "title-icon--warn";
|
|
72
|
+
}
|
|
73
|
+
return "";
|
|
74
|
+
}
|
|
75
|
+
getIconName(message) {
|
|
76
|
+
if (message.icon) {
|
|
77
|
+
return message.icon;
|
|
78
|
+
}
|
|
79
|
+
else if (this.isCritical(message.dialogType)) {
|
|
80
|
+
return "alert-circle-inverted";
|
|
81
|
+
}
|
|
82
|
+
else if (message.dialogType === DialogType.WARN) {
|
|
83
|
+
return "warning-outline";
|
|
84
|
+
}
|
|
85
|
+
else if (message.dialogType === DialogType.SUCCESS) {
|
|
86
|
+
return "check";
|
|
87
|
+
}
|
|
65
88
|
}
|
|
66
89
|
getTypeIndicatorElement(message) {
|
|
67
90
|
if (message.dialogType === DialogType.DEFAULT) {
|
|
68
91
|
return;
|
|
69
92
|
}
|
|
70
|
-
return h("div", { class: this.
|
|
93
|
+
return h("div", { class: this.getClassIconIndicator(message.dialogType) });
|
|
94
|
+
}
|
|
95
|
+
getClassIconIndicator(dialogType) {
|
|
96
|
+
if (this.isCritical(dialogType)) {
|
|
97
|
+
return "dialog__critical--indicator";
|
|
98
|
+
}
|
|
99
|
+
else if (dialogType == DialogType.SUCCESS) {
|
|
100
|
+
return "dialog__success--indicator";
|
|
101
|
+
}
|
|
102
|
+
else if (dialogType == DialogType.WARN) {
|
|
103
|
+
return "dialog__warning--indicator";
|
|
104
|
+
}
|
|
105
|
+
return "";
|
|
71
106
|
}
|
|
72
107
|
getClassContainer(message) {
|
|
73
108
|
const type = message.dialogType || DialogType.DEFAULT;
|
|
@@ -142,7 +177,7 @@ export class EzDialog {
|
|
|
142
177
|
"mutable": true,
|
|
143
178
|
"complexType": {
|
|
144
179
|
"original": "DialogType",
|
|
145
|
-
"resolved": "DialogType.CRITICAL | DialogType.DEFAULT | DialogType.WARN",
|
|
180
|
+
"resolved": "DialogType.CRITICAL | DialogType.DEFAULT | DialogType.SUCCESS | DialogType.WARN",
|
|
146
181
|
"references": {
|
|
147
182
|
"DialogType": {
|
|
148
183
|
"location": "import",
|
|
@@ -18,6 +18,7 @@ export default class DataBinder {
|
|
|
18
18
|
case Action.DATA_CHANGED:
|
|
19
19
|
case Action.CHANGE_UNDONE:
|
|
20
20
|
case Action.CHANGE_REDONE:
|
|
21
|
+
case Action.RECORD_LOADED:
|
|
21
22
|
(_a = this._fields) === null || _a === void 0 ? void 0 : _a.forEach(field => {
|
|
22
23
|
this.updateValue(field.fieldName, field.field);
|
|
23
24
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, h, Host, Prop, Element, forceUpdate, Method, Watch, Event } from "@stencil/core";
|
|
2
|
-
import { DataUnit, Action, DataUnitAction } from "@sankhyalabs/core";
|
|
2
|
+
import { DataUnit, Action, DataUnitAction, DateUtils } from "@sankhyalabs/core";
|
|
3
3
|
import { FormSheet } from "./structure/FormSheet";
|
|
4
4
|
import { buildFromConfig, buildFromDataUnit } from "./structure/FormSheetMetadata";
|
|
5
5
|
import { createStore } from "redux";
|
|
@@ -101,7 +101,7 @@ export class EzForm {
|
|
|
101
101
|
}
|
|
102
102
|
processMetadata() {
|
|
103
103
|
if (!this.isStatic() && this.dataUnit) {
|
|
104
|
-
const metadata = this.config
|
|
104
|
+
const metadata = this.config != undefined ? buildFromConfig(this.config, this.dataUnit) : buildFromDataUnit(this.dataUnit);
|
|
105
105
|
this._store.dispatch(loadMetadata(metadata));
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -109,6 +109,16 @@ export class EzForm {
|
|
|
109
109
|
var _a;
|
|
110
110
|
return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
111
111
|
}
|
|
112
|
+
getValidatedValue(value) {
|
|
113
|
+
switch (value) {
|
|
114
|
+
case "${data}":
|
|
115
|
+
return DateUtils.getToday();
|
|
116
|
+
case "${datahora}":
|
|
117
|
+
return DateUtils.getToday(true);
|
|
118
|
+
default:
|
|
119
|
+
return value;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
112
122
|
interceptAction(action) {
|
|
113
123
|
if (action.type === Action.RECORDS_COPIED) {
|
|
114
124
|
const metadata = selectFormMetadata(this._store.getState());
|
|
@@ -137,7 +147,9 @@ export class EzForm {
|
|
|
137
147
|
return new DataUnitAction(Action.RECORDS_ADDED, records.map(record => {
|
|
138
148
|
const newRecord = Object.assign({}, record);
|
|
139
149
|
for (const field in defaultValues) {
|
|
140
|
-
|
|
150
|
+
const defaultValue = defaultValues[field].value;
|
|
151
|
+
const fieldValue = defaultValue != undefined ? defaultValue : defaultValues[field];
|
|
152
|
+
newRecord[field] = this.dataUnit.valueFromString(field, this.getValidatedValue(fieldValue));
|
|
141
153
|
}
|
|
142
154
|
return newRecord;
|
|
143
155
|
}));
|
|
@@ -201,13 +213,10 @@ export class EzForm {
|
|
|
201
213
|
"type": "unknown",
|
|
202
214
|
"mutable": false,
|
|
203
215
|
"complexType": {
|
|
204
|
-
"original": "
|
|
205
|
-
"resolved": "
|
|
216
|
+
"original": "IFormConfig",
|
|
217
|
+
"resolved": "IFormConfig",
|
|
206
218
|
"references": {
|
|
207
|
-
"
|
|
208
|
-
"location": "global"
|
|
209
|
-
},
|
|
210
|
-
"FieldConfig": {
|
|
219
|
+
"IFormConfig": {
|
|
211
220
|
"location": "local"
|
|
212
221
|
}
|
|
213
222
|
}
|
|
@@ -223,10 +232,10 @@ export class EzForm {
|
|
|
223
232
|
"type": "unknown",
|
|
224
233
|
"mutable": false,
|
|
225
234
|
"complexType": {
|
|
226
|
-
"original": "
|
|
227
|
-
"resolved": "
|
|
235
|
+
"original": "IRecordValidator",
|
|
236
|
+
"resolved": "IRecordValidator",
|
|
228
237
|
"references": {
|
|
229
|
-
"
|
|
238
|
+
"IRecordValidator": {
|
|
230
239
|
"location": "local"
|
|
231
240
|
}
|
|
232
241
|
}
|
|
@@ -303,7 +312,7 @@ export class EzForm {
|
|
|
303
312
|
"location": "import",
|
|
304
313
|
"path": "@sankhyalabs/core"
|
|
305
314
|
},
|
|
306
|
-
"
|
|
315
|
+
"IValidationResult": {
|
|
307
316
|
"location": "local"
|
|
308
317
|
}
|
|
309
318
|
},
|
|
@@ -31,17 +31,17 @@ export const buildField = (field) => {
|
|
|
31
31
|
if (!config.name) {
|
|
32
32
|
config.name = descriptor.name;
|
|
33
33
|
}
|
|
34
|
-
if (config.required ===
|
|
34
|
+
if (config.required == undefined || descriptor.required === true) {
|
|
35
35
|
config.required = descriptor.required;
|
|
36
36
|
}
|
|
37
|
-
if (config.readOnly ===
|
|
37
|
+
if (config.readOnly == undefined || descriptor.readOnly === true) {
|
|
38
38
|
config.readOnly = descriptor.readOnly;
|
|
39
39
|
}
|
|
40
40
|
props = descriptor.properties;
|
|
41
41
|
builder = uiBuilders.get(descriptor.userInterface);
|
|
42
42
|
}
|
|
43
43
|
if (config.required) {
|
|
44
|
-
config.label =
|
|
44
|
+
config.label = `${config.label} (obrigatório) *`;
|
|
45
45
|
}
|
|
46
46
|
if (!builder) {
|
|
47
47
|
builder = buildTextInput;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { CheckMode } from "../../../ez-check/CheckMode";
|
|
2
3
|
export const buildSwitch = (fieldConfig) => {
|
|
3
4
|
return buildField(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
|
|
4
5
|
};
|
|
@@ -7,5 +8,5 @@ export const buildCheckBox = (fieldConfig) => {
|
|
|
7
8
|
};
|
|
8
9
|
function buildField(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
9
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" },
|
|
10
|
-
h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ?
|
|
11
|
+
h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, key: fieldName })));
|
|
11
12
|
}
|
|
@@ -3,11 +3,11 @@ export const buildDate = ({ name, label, readOnly }) => {
|
|
|
3
3
|
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
4
4
|
h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
5
5
|
};
|
|
6
|
-
export const buildTime = ({ name, label }) => {
|
|
6
|
+
export const buildTime = ({ name, label, readOnly }) => {
|
|
7
7
|
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
8
|
-
h("ez-time-input", { label: label, "data-field-name": name, key: name })));
|
|
8
|
+
h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
9
9
|
};
|
|
10
|
-
export const buildTimeDate = ({ name, label }) => {
|
|
10
|
+
export const buildTimeDate = ({ name, label, readOnly }) => {
|
|
11
11
|
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
12
|
-
h("ez-date-time-input", { label: label, "data-field-name": name, key: name })));
|
|
12
|
+
h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
13
13
|
};
|
|
@@ -59,35 +59,45 @@ function getTabConfig(tab, sheets) {
|
|
|
59
59
|
function sortTabs(a, b) {
|
|
60
60
|
return a[0].label == '__main' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
|
|
61
61
|
}
|
|
62
|
-
export const buildFromConfig = (
|
|
62
|
+
export const buildFromConfig = (config, dataUnit) => {
|
|
63
|
+
var _a, _b;
|
|
63
64
|
const sheets = new Map();
|
|
65
|
+
const hiddenTabs = new Map();
|
|
64
66
|
const requiredFields = [];
|
|
65
67
|
const cleanOnCopyFields = [];
|
|
66
68
|
const defaultValues = {};
|
|
67
|
-
|
|
69
|
+
(_a = config === null || config === void 0 ? void 0 : config.tabs) === null || _a === void 0 ? void 0 : _a.forEach((tab) => {
|
|
70
|
+
if (!hiddenTabs.has(tab.label) && tab.visible === false) {
|
|
71
|
+
hiddenTabs.set(tab.label, tab);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
(_b = config === null || config === void 0 ? void 0 : config.fields) === null || _b === void 0 ? void 0 : _b.forEach((field) => {
|
|
68
75
|
var _a, _b, _c;
|
|
69
|
-
if (
|
|
70
|
-
const tabConfig = getTabConfig(
|
|
71
|
-
|
|
76
|
+
if (field.visible !== false) {
|
|
77
|
+
const tabConfig = getTabConfig(field.tab || "__main", sheets);
|
|
78
|
+
if (hiddenTabs.has(tabConfig.label)) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const descriptor = dataUnit.getField(field.name);
|
|
72
82
|
if (descriptor && tabConfig.visible) {
|
|
73
83
|
if (!sheets.has(tabConfig)) {
|
|
74
84
|
sheets.set(tabConfig, new Map());
|
|
75
85
|
}
|
|
76
86
|
const tabItens = sheets.get(tabConfig);
|
|
77
|
-
const isRequired =
|
|
87
|
+
const isRequired = field.required == undefined ? descriptor.required : field.required;
|
|
78
88
|
if (isRequired) {
|
|
79
|
-
requiredFields.push(
|
|
89
|
+
requiredFields.push(field.name);
|
|
80
90
|
}
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
cleanOnCopyFields.push(
|
|
91
|
+
const cleanOnCopy = field.cleanOnCopy == undefined ? (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy : field.cleanOnCopy;
|
|
92
|
+
if (cleanOnCopy || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum)) {
|
|
93
|
+
cleanOnCopyFields.push(field.name);
|
|
84
94
|
}
|
|
85
|
-
const defaultValue =
|
|
95
|
+
const defaultValue = field.defaultValue == undefined ? (_c = descriptor.properties) === null || _c === void 0 ? void 0 : _c.defaultValue : field.defaultValue;
|
|
86
96
|
if (defaultValue) {
|
|
87
|
-
defaultValues[
|
|
97
|
+
defaultValues[field.name] = field.defaultValue;
|
|
88
98
|
}
|
|
89
|
-
const fieldMD = { config, descriptor };
|
|
90
|
-
const group =
|
|
99
|
+
const fieldMD = { config: field, descriptor };
|
|
100
|
+
const group = field.group;
|
|
91
101
|
if (group) {
|
|
92
102
|
const key = `group::${group}`;
|
|
93
103
|
if (!tabItens.has(key)) {
|
|
@@ -98,7 +108,7 @@ export const buildFromConfig = (fields, dataUnit) => {
|
|
|
98
108
|
}
|
|
99
109
|
}
|
|
100
110
|
else {
|
|
101
|
-
tabItens.set(
|
|
111
|
+
tabItens.set(field.name, fieldMD);
|
|
102
112
|
}
|
|
103
113
|
}
|
|
104
114
|
}
|
|
@@ -26,6 +26,9 @@ export default class DataUnitBridge {
|
|
|
26
26
|
const changes = Object.assign({}, action.payload);
|
|
27
27
|
delete changes.records;
|
|
28
28
|
this._gridController.changeValues(changes, action.payload.records);
|
|
29
|
+
break;
|
|
30
|
+
case Action.RECORD_LOADED:
|
|
31
|
+
this._gridController.changeValues(changes, action.payload.records);
|
|
29
32
|
}
|
|
30
33
|
};
|
|
31
34
|
this._gridController = gridController;
|