@sankhyalabs/ezui 7.1.0-dev.21 → 7.1.0-dev.23
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-4fb87a9e.js → ApplicationUtils-006ca96f.js} +1 -1
- package/dist/cjs/FormLayout-fe8da83c.js +9 -0
- package/dist/cjs/{app-globals-cb31a206.js → app-globals-5cb12916.js} +1 -1
- package/dist/cjs/{ez-combo-box-list_5.cjs.entry.js → classic-search-list_7.cjs.entry.js} +212 -5
- package/dist/cjs/ez-actions-button.cjs.entry.js +4 -3
- package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-avatar.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-combo-box.cjs.entry.js +36 -15
- package/dist/cjs/ez-classic-date-input.cjs.entry.js +201 -0
- package/dist/cjs/ez-classic-date-time-input.cjs.entry.js +246 -0
- package/dist/cjs/ez-classic-input.cjs.entry.js +99 -18
- package/dist/cjs/ez-classic-number-input.cjs.entry.js +205 -0
- package/dist/cjs/ez-classic-search-plus.cjs.entry.js +407 -0
- package/dist/cjs/ez-classic-search.cjs.entry.js +683 -0
- package/dist/cjs/ez-classic-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-time-input.cjs.entry.js +197 -0
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +4 -3
- package/dist/cjs/ez-combo-box.cjs.entry.js +4 -3
- 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-double-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +121 -35
- package/dist/cjs/ez-form.cjs.entry.js +11 -7
- package/dist/cjs/ez-grid.cjs.entry.js +7 -6
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.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-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-pagination.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-search-plus.cjs.entry.js +7 -6
- package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +10 -9
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ez-sortable-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-spinner.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +13 -14
- package/dist/cjs/ez-split-item.cjs.entry.js +4 -3
- package/dist/cjs/ez-text-input.cjs.entry.js +37 -0
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +2 -2
- package/dist/cjs/ezui.cjs.js +3 -3
- package/dist/cjs/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/{index-e61642ff.js → index-350d0fa0.js} +30 -0
- package/dist/cjs/index-a7b0c73d.js +42 -18
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{search-column-51e50b59.js → search-column-fbf680d7.js} +10 -5
- package/dist/cjs/searchFormatters-051f8677.js +23 -0
- package/dist/cjs/{FormLayout-18853e70.js → types-6a5df0c7.js} +0 -6
- package/dist/collection/collection-manifest.json +58 -5
- package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.css +5 -0
- package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.js +77 -18
- package/dist/collection/components/ez-classic-date-input/ez-classic-date-input.css +44 -0
- package/dist/collection/components/ez-classic-date-input/ez-classic-date-input.js +541 -0
- package/dist/collection/components/ez-classic-date-time-input/ez-classic-date-time-input.css +44 -0
- package/dist/collection/components/ez-classic-date-time-input/ez-classic-date-time-input.js +586 -0
- package/dist/collection/components/ez-classic-input/ez-classic-input.css +33 -5
- package/dist/collection/components/ez-classic-input/ez-classic-input.js +155 -19
- package/dist/collection/components/ez-classic-number-input/ez-classic-number-input.css +16 -0
- package/dist/collection/components/ez-classic-number-input/ez-classic-number-input.js +583 -0
- package/dist/collection/components/ez-classic-search/ez-classic-search.css +126 -0
- package/dist/collection/components/ez-classic-search/ez-classic-search.js +1330 -0
- package/dist/collection/components/ez-classic-search/subcomponent/classic-search-list/classic-search-list.css +227 -0
- package/dist/collection/components/ez-classic-search/subcomponent/classic-search-list/classic-search-list.js +316 -0
- package/dist/collection/components/ez-classic-search/utils/searchFormatters.js +18 -0
- package/dist/collection/components/ez-classic-search-plus/ez-classic-search-plus.css +406 -0
- package/dist/collection/components/ez-classic-search-plus/ez-classic-search-plus.js +988 -0
- package/dist/collection/components/ez-classic-search-plus/subcomponent/ez-search-result-list/ez-classic-search-result-list.css +221 -0
- package/dist/collection/components/ez-classic-search-plus/subcomponent/ez-search-result-list/ez-classic-search-result-list.js +298 -0
- package/dist/collection/components/ez-classic-text-area/ez-classic-text-area.css +1 -0
- package/dist/collection/components/ez-classic-time-input/ez-classic-time-input.css +14 -0
- package/dist/collection/components/ez-classic-time-input/ez-classic-time-input.js +511 -0
- package/dist/collection/components/ez-form/ez-form.js +9 -5
- package/dist/collection/components/ez-form-view/ez-form-view.css +8 -3
- package/dist/collection/components/ez-form-view/ez-form-view.js +40 -4
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +6 -3
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +9 -6
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +8 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +30 -6
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +12 -5
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/RichText.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +9 -3
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.js +8 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js +7 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +8 -1
- package/dist/collection/components/ez-form-view/structure/index.js +1 -1
- package/dist/collection/components/ez-icon/ez-icon.css +1 -0
- package/dist/collection/components/ez-rich-text/ez-rich-text.js +2 -3
- package/dist/collection/components/ez-split-button/ez-split-button.js +18 -13
- package/dist/collection/components/ez-text-input/ez-text-input.js +38 -1
- package/dist/collection/utils/form/DataBinder.js +2 -2
- package/dist/collection/utils/form/interfaces/FormLayout.js +3 -1
- package/dist/collection/utils/i18n/locales/en-us.js +10 -0
- package/dist/collection/utils/i18n/locales/es-es.js +10 -0
- package/dist/collection/utils/i18n/locales/pt-br.js +10 -0
- package/dist/collection/utils/searchColumn/search-column.js +6 -1
- package/dist/custom-elements/index.d.ts +48 -0
- package/dist/custom-elements/index.js +2722 -337
- package/dist/esm/{ApplicationUtils-985c24ae.js → ApplicationUtils-0c5cb207.js} +1 -1
- package/dist/esm/FormLayout-bda67973.js +9 -0
- package/dist/esm/{app-globals-75f8a758.js → app-globals-1db10325.js} +1 -1
- package/dist/esm/{ez-combo-box-list_5.entry.js → classic-search-list_7.entry.js} +212 -7
- package/dist/esm/ez-actions-button.entry.js +4 -3
- package/dist/esm/ez-alert-list.entry.js +1 -1
- package/dist/esm/ez-avatar.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-classic-combo-box.entry.js +36 -15
- package/dist/esm/ez-classic-date-input.entry.js +197 -0
- package/dist/esm/ez-classic-date-time-input.entry.js +242 -0
- package/dist/esm/ez-classic-input.entry.js +100 -19
- package/dist/esm/ez-classic-number-input.entry.js +201 -0
- package/dist/esm/ez-classic-search-plus.entry.js +403 -0
- package/dist/esm/ez-classic-search.entry.js +679 -0
- package/dist/esm/ez-classic-text-area.entry.js +1 -1
- package/dist/esm/ez-classic-time-input.entry.js +193 -0
- package/dist/esm/ez-collapsible-box.entry.js +4 -3
- package/dist/esm/ez-combo-box.entry.js +4 -3
- 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-double-list.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +121 -35
- package/dist/esm/ez-form.entry.js +11 -7
- package/dist/esm/ez-grid.entry.js +5 -4
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-link-builder_6.entry.js +1 -1
- package/dist/esm/ez-list.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-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-pagination.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-search-plus.entry.js +4 -3
- package/dist/esm/ez-search-result-list.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +4 -3
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-skeleton.entry.js +1 -1
- package/dist/esm/ez-sortable-list.entry.js +1 -1
- package/dist/esm/ez-spinner.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +13 -14
- package/dist/esm/ez-split-item.entry.js +4 -3
- package/dist/esm/ez-text-input.entry.js +37 -0
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +2 -2
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-a3b24b5d.js → index-225aa0c3.js} +30 -0
- package/dist/esm/index-baa5e267.js +42 -18
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{search-column-0c42248b.js → search-column-40a78cac.js} +10 -5
- package/dist/esm/searchFormatters-6d9b06e4.js +20 -0
- package/dist/esm/{FormLayout-071d324c.js → types-6f6b2650.js} +1 -7
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-1c3f43e8.entry.js → p-0248846f.entry.js} +1 -1
- package/dist/ezui/p-0625743b.entry.js +1 -0
- package/dist/ezui/p-07fb22c3.entry.js +1 -0
- package/dist/ezui/p-26cd4c2e.entry.js +1 -0
- package/dist/ezui/{p-2fd16ff2.entry.js → p-2da9faf1.entry.js} +1 -1
- package/dist/ezui/{p-1bf40959.entry.js → p-34d459e4.entry.js} +1 -1
- package/dist/ezui/p-44183c39.entry.js +1 -0
- package/dist/ezui/p-47e4a8ce.js +1 -0
- package/dist/ezui/p-4af745e1.entry.js +1 -0
- package/dist/ezui/{p-6c484770.entry.js → p-4c2a4435.entry.js} +1 -1
- package/dist/ezui/{p-782fe2e3.entry.js → p-4c76b365.entry.js} +1 -1
- package/dist/ezui/p-4e576bb9.entry.js +1 -0
- package/dist/ezui/{p-5e6de2c1.entry.js → p-4e869617.entry.js} +1 -1
- package/dist/ezui/{p-0e325699.entry.js → p-4f7ad3ee.entry.js} +1 -1
- package/dist/ezui/{p-582c3f90.entry.js → p-544605c4.entry.js} +1 -1
- package/dist/ezui/p-556bf329.entry.js +1 -0
- package/dist/ezui/{p-2676e2a3.entry.js → p-56565777.entry.js} +1 -1
- package/dist/ezui/p-57b68d43.entry.js +1 -0
- package/dist/ezui/p-5895e687.js +1 -0
- package/dist/ezui/{p-714452c7.entry.js → p-5abb220b.entry.js} +1 -1
- package/dist/ezui/p-619225ce.entry.js +1 -0
- package/dist/ezui/p-679a2942.entry.js +1 -0
- package/dist/ezui/{p-474076b3.js → p-6a794336.js} +1 -1
- package/dist/ezui/{p-4ea5c8a7.entry.js → p-6ac056d7.entry.js} +1 -1
- package/dist/ezui/p-7134726a.entry.js +1 -0
- package/dist/ezui/{p-67f9fadb.entry.js → p-729bd1be.entry.js} +1 -1
- package/dist/ezui/p-7953ecb9.entry.js +1 -0
- package/dist/ezui/{p-e2e0dd76.entry.js → p-7edc3ef7.entry.js} +1 -1
- package/dist/ezui/p-88a115b3.js +1 -0
- package/dist/ezui/{p-f45ddc1f.entry.js → p-8e5f1c74.entry.js} +1 -1
- package/dist/ezui/p-951b32a1.entry.js +1 -0
- package/dist/ezui/{p-9568a93d.entry.js → p-97312709.entry.js} +1 -1
- package/dist/ezui/{p-0ec5c128.js → p-9825c1d2.js} +1 -1
- package/dist/ezui/p-987185c4.entry.js +1 -0
- package/dist/ezui/p-a0f51b99.entry.js +1 -0
- package/dist/ezui/p-a3bad8f8.entry.js +1 -0
- package/dist/ezui/{p-6570ca10.entry.js → p-a4351519.entry.js} +1 -1
- package/dist/ezui/{p-7624767b.entry.js → p-a872c642.entry.js} +1 -1
- package/dist/ezui/p-b0a716ef.entry.js +1 -0
- package/dist/ezui/p-b36475f9.entry.js +1 -0
- package/dist/ezui/{p-2b23906a.entry.js → p-b705b342.entry.js} +1 -1
- package/dist/ezui/{p-9771ea3c.entry.js → p-b8078832.entry.js} +1 -1
- package/dist/ezui/p-c0ae79fa.entry.js +1 -0
- package/dist/ezui/{p-98218fbc.js → p-c178730b.js} +1 -1
- package/dist/ezui/{p-a1a63294.entry.js → p-c56ee8c0.entry.js} +1 -1
- package/dist/ezui/{p-3d71e8e1.entry.js → p-cd8be0c7.entry.js} +1 -1
- package/dist/ezui/{p-a13e65a4.entry.js → p-ce0a0036.entry.js} +1 -1
- package/dist/ezui/{p-0aafbc30.entry.js → p-df802548.entry.js} +1 -1
- package/dist/ezui/p-e2689b33.entry.js +1 -0
- package/dist/ezui/{p-dc192d01.entry.js → p-e2972977.entry.js} +1 -1
- package/dist/ezui/{p-47d9256e.entry.js → p-e3a42f47.entry.js} +1 -1
- package/dist/ezui/p-e3cd5080.entry.js +1 -0
- package/dist/ezui/{p-28af6826.entry.js → p-e493ad57.entry.js} +1 -1
- package/dist/ezui/{p-3fcf79c7.entry.js → p-f5552540.entry.js} +1 -1
- package/dist/ezui/p-ff4312d5.js +1 -0
- package/dist/types/components/ez-classic-combo-box/ez-classic-combo-box.d.ts +9 -3
- package/dist/types/components/ez-classic-date-input/ez-classic-date-input.d.ts +91 -0
- package/dist/types/components/ez-classic-date-time-input/ez-classic-date-time-input.d.ts +95 -0
- package/dist/types/components/ez-classic-input/ez-classic-input.d.ts +18 -1
- package/dist/types/components/ez-classic-number-input/ez-classic-number-input.d.ts +101 -0
- package/dist/types/components/ez-classic-search/ez-classic-search.d.ts +219 -0
- package/dist/types/components/ez-classic-search/subcomponent/classic-search-list/classic-search-list.d.ts +29 -0
- package/dist/types/components/ez-classic-search/utils/searchFormatters.d.ts +2 -0
- package/dist/types/components/ez-classic-search-plus/ez-classic-search-plus.d.ts +186 -0
- package/dist/types/components/ez-classic-search-plus/subcomponent/ez-search-result-list/ez-classic-search-result-list.d.ts +29 -0
- package/dist/types/components/ez-form/ez-form.d.ts +1 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +7 -0
- package/dist/types/components/ez-form-view/fieldbuilder/FieldBuilder.d.ts +7 -2
- package/dist/types/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.d.ts +3 -2
- package/dist/types/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +5 -4
- package/dist/types/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.d.ts +3 -2
- package/dist/types/components/ez-form-view/fieldbuilder/templates/RichText.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-split-button/ez-split-button.d.ts +1 -2
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +4 -0
- package/dist/types/components.d.ts +2967 -1814
- package/dist/types/utils/form/interfaces/FormLayout.d.ts +3 -1
- package/dist/types/utils/i18n/locales/en-us.d.ts +10 -0
- package/dist/types/utils/i18n/locales/es-es.d.ts +10 -0
- package/dist/types/utils/i18n/locales/pt-br.d.ts +10 -0
- package/dist/types/utils/i18n/translations.d.ts +30 -0
- package/package.json +1 -1
- package/react/components.d.ts +8 -0
- package/react/components.js +8 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-2e5de2a7.entry.js +0 -1
- package/dist/ezui/p-30ffb9ed.js +0 -1
- package/dist/ezui/p-48effc69.entry.js +0 -1
- package/dist/ezui/p-6a982147.js +0 -1
- package/dist/ezui/p-6d7f2fdc.entry.js +0 -1
- package/dist/ezui/p-6f466aec.entry.js +0 -1
- package/dist/ezui/p-7fe97ef5.entry.js +0 -1
- package/dist/ezui/p-8709c4f6.entry.js +0 -1
- package/dist/ezui/p-8a8006e6.entry.js +0 -1
- package/dist/ezui/p-8d626d2b.entry.js +0 -1
- package/dist/ezui/p-9b2e6438.entry.js +0 -1
- package/dist/ezui/p-9d004e22.entry.js +0 -1
- package/dist/ezui/p-c711900a.entry.js +0 -1
- package/dist/ezui/p-dee18824.entry.js +0 -1
- package/dist/ezui/p-e4a579f2.entry.js +0 -1
- package/dist/ezui/p-e82a12c6.entry.js +0 -1
- package/dist/ezui/p-f1bbf23f.entry.js +0 -1
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { TimeFormatter, MaskFormatter, NumberUtils, ElementIDUtils } from "@sankhyalabs/core";
|
|
3
|
+
import CSSVarsUtils from "../../utils/CSSVarsUtils";
|
|
4
|
+
import initI18n from '../../utils/i18n';
|
|
5
|
+
export class EzClassicTimeInput {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.label = undefined;
|
|
8
|
+
this.value = undefined;
|
|
9
|
+
this.enabled = true;
|
|
10
|
+
this.errorMessage = undefined;
|
|
11
|
+
this.showSeconds = false;
|
|
12
|
+
this.mode = "regular";
|
|
13
|
+
this.size = "default";
|
|
14
|
+
this.required = false;
|
|
15
|
+
this.canShowError = true;
|
|
16
|
+
this.autoFocus = false;
|
|
17
|
+
this.alternativePlaceholder = undefined;
|
|
18
|
+
}
|
|
19
|
+
observeErrorMessage() {
|
|
20
|
+
var _a;
|
|
21
|
+
if (this._textInput) {
|
|
22
|
+
this._textInput.errorMessage = this.errorMessage;
|
|
23
|
+
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
24
|
+
this.prepareValue(this._viewValue);
|
|
25
|
+
if ((this._textInput.value || '') !== this._viewValue) {
|
|
26
|
+
this._textInput.value = this._viewValue;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
observeShowSeconds() {
|
|
32
|
+
if (this.showSeconds) {
|
|
33
|
+
this.prepareMask("##:##:##");
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.prepareMask("##:##");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
observeValue(newValue, oldValue) {
|
|
40
|
+
if (this._textInput && newValue != oldValue) {
|
|
41
|
+
let newValueValidated = this.validateValue(newValue);
|
|
42
|
+
const oldValueValidated = this.validateValue(oldValue);
|
|
43
|
+
if (newValueValidated != oldValueValidated) {
|
|
44
|
+
this._viewValue = newValueValidated == undefined ? "" : newValueValidated.toString();
|
|
45
|
+
this.prepareValue(this._viewValue);
|
|
46
|
+
if (this._viewValue && !TimeFormatter.validateTime(this._viewValue, this.showSeconds)) {
|
|
47
|
+
this.setError(this.i18n("ez-classic-time-input.invalidTime"));
|
|
48
|
+
newValueValidated = undefined;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.setError("");
|
|
52
|
+
}
|
|
53
|
+
const valueEmitted = newValueValidated === null ? undefined : newValueValidated;
|
|
54
|
+
this.ezChange.emit(valueEmitted);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//---------------------------------------------
|
|
59
|
+
// Private methods
|
|
60
|
+
//---------------------------------------------
|
|
61
|
+
prepareMask(mask) {
|
|
62
|
+
if (this._maskFormatter == undefined) {
|
|
63
|
+
this._maskFormatter = new MaskFormatter(mask);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this._maskFormatter.mask = mask;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
validateValue(value) {
|
|
70
|
+
return isNaN(value) || value === undefined ? null : value;
|
|
71
|
+
}
|
|
72
|
+
setError(msg) {
|
|
73
|
+
this.errorMessage = msg;
|
|
74
|
+
if (this._textInput && (msg === null || msg === void 0 ? void 0 : msg.trim())) {
|
|
75
|
+
this.ezCancelWaitingChange.emit();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//---------------------------------------------
|
|
79
|
+
// Public methods
|
|
80
|
+
//---------------------------------------------
|
|
81
|
+
getViewValue() {
|
|
82
|
+
return this._viewValue;
|
|
83
|
+
}
|
|
84
|
+
prepareValue(value) {
|
|
85
|
+
try {
|
|
86
|
+
this._viewValue = TimeFormatter.prepareValue(value, this.showSeconds);
|
|
87
|
+
if (this._textInput && this._textInput.value !== this._viewValue) {
|
|
88
|
+
this._textInput.value = this._viewValue;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
catch (e) {
|
|
92
|
+
this.setError(e.message);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Aplica o foco no campo.
|
|
97
|
+
*/
|
|
98
|
+
async setFocus({ selectText }) {
|
|
99
|
+
this._textInput.setFocus({ selectText });
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Remove o foco do campo.
|
|
103
|
+
*/
|
|
104
|
+
async setBlur() {
|
|
105
|
+
this._textInput.setBlur();
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Retorna se o conteúdo é inválido.
|
|
109
|
+
*/
|
|
110
|
+
async isInvalid() {
|
|
111
|
+
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
112
|
+
}
|
|
113
|
+
//---------------------------------------------
|
|
114
|
+
// Event handlers
|
|
115
|
+
//---------------------------------------------
|
|
116
|
+
handleBlur() {
|
|
117
|
+
if (this._textInput) {
|
|
118
|
+
this._viewValue = this._textInput.value;
|
|
119
|
+
this.prepareValue(this._viewValue);
|
|
120
|
+
const value = NumberUtils.stringToNumber(this._viewValue.replace(/\D/g, ""));
|
|
121
|
+
this.value = ['string', 'number'].includes(typeof value) ? value : null;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
handleInput() {
|
|
125
|
+
const textInputValue = this._textInput.value;
|
|
126
|
+
if (!['string', 'number'].includes(typeof textInputValue))
|
|
127
|
+
return;
|
|
128
|
+
const parsedNumber = NumberUtils.stringToNumber(textInputValue.replace(/\D/g, ""));
|
|
129
|
+
if (parsedNumber !== this.value) {
|
|
130
|
+
this.ezStartChange.emit({ waitmessage: "", blocking: false });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//---------------------------------------------
|
|
134
|
+
// Lifecycle web component
|
|
135
|
+
//---------------------------------------------
|
|
136
|
+
async componentWillLoad() {
|
|
137
|
+
this.i18n = await initI18n();
|
|
138
|
+
this.observeShowSeconds();
|
|
139
|
+
if (this.value) {
|
|
140
|
+
this.prepareValue(this.value.toString());
|
|
141
|
+
}
|
|
142
|
+
else if (this._viewValue) {
|
|
143
|
+
this.prepareValue(this._viewValue);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
componentDidLoad() {
|
|
147
|
+
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
148
|
+
if (this.autoFocus) {
|
|
149
|
+
requestAnimationFrame(() => {
|
|
150
|
+
this.setFocus({ selectText: true });
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
render() {
|
|
155
|
+
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
156
|
+
const inputProps = {
|
|
157
|
+
class: "time__input",
|
|
158
|
+
"data-element-id": ElementIDUtils.getInternalIDInfo("textInput"),
|
|
159
|
+
ref: (el) => this._textInput = el,
|
|
160
|
+
"data-slave-mode": "true",
|
|
161
|
+
value: this._viewValue,
|
|
162
|
+
enabled: this.enabled,
|
|
163
|
+
label: this.label,
|
|
164
|
+
restrict: "0123456789:",
|
|
165
|
+
onBlur: () => this.handleBlur(),
|
|
166
|
+
onInput: () => this.handleInput(),
|
|
167
|
+
errorMessage: this.errorMessage,
|
|
168
|
+
mode: this.mode,
|
|
169
|
+
size: this.size,
|
|
170
|
+
canShowError: this.canShowError,
|
|
171
|
+
alternativePlaceholder: this.alternativePlaceholder,
|
|
172
|
+
required: this.required
|
|
173
|
+
};
|
|
174
|
+
return (h(Host, null, h("ez-classic-input", Object.assign({}, inputProps, { leftIconName: "timer-outline" }))));
|
|
175
|
+
}
|
|
176
|
+
static get is() { return "ez-classic-time-input"; }
|
|
177
|
+
static get encapsulation() { return "shadow"; }
|
|
178
|
+
static get originalStyleUrls() {
|
|
179
|
+
return {
|
|
180
|
+
"$": ["ez-classic-time-input.css"]
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
static get styleUrls() {
|
|
184
|
+
return {
|
|
185
|
+
"$": ["ez-classic-time-input.css"]
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
static get assetsDirs() { return ["../assets"]; }
|
|
189
|
+
static get properties() {
|
|
190
|
+
return {
|
|
191
|
+
"label": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"mutable": false,
|
|
194
|
+
"complexType": {
|
|
195
|
+
"original": "string",
|
|
196
|
+
"resolved": "string",
|
|
197
|
+
"references": {}
|
|
198
|
+
},
|
|
199
|
+
"required": false,
|
|
200
|
+
"optional": false,
|
|
201
|
+
"docs": {
|
|
202
|
+
"tags": [],
|
|
203
|
+
"text": "Texto a ser apresentado como t\u00EDtulo do campo."
|
|
204
|
+
},
|
|
205
|
+
"attribute": "label",
|
|
206
|
+
"reflect": true
|
|
207
|
+
},
|
|
208
|
+
"value": {
|
|
209
|
+
"type": "number",
|
|
210
|
+
"mutable": true,
|
|
211
|
+
"complexType": {
|
|
212
|
+
"original": "number",
|
|
213
|
+
"resolved": "number",
|
|
214
|
+
"references": {}
|
|
215
|
+
},
|
|
216
|
+
"required": false,
|
|
217
|
+
"optional": false,
|
|
218
|
+
"docs": {
|
|
219
|
+
"tags": [],
|
|
220
|
+
"text": "Define o valor do campo."
|
|
221
|
+
},
|
|
222
|
+
"attribute": "value",
|
|
223
|
+
"reflect": false
|
|
224
|
+
},
|
|
225
|
+
"enabled": {
|
|
226
|
+
"type": "boolean",
|
|
227
|
+
"mutable": false,
|
|
228
|
+
"complexType": {
|
|
229
|
+
"original": "boolean",
|
|
230
|
+
"resolved": "boolean",
|
|
231
|
+
"references": {}
|
|
232
|
+
},
|
|
233
|
+
"required": false,
|
|
234
|
+
"optional": false,
|
|
235
|
+
"docs": {
|
|
236
|
+
"tags": [],
|
|
237
|
+
"text": "Se false o usu\u00E1rio n\u00E3o pode interagir com o campo."
|
|
238
|
+
},
|
|
239
|
+
"attribute": "enabled",
|
|
240
|
+
"reflect": true,
|
|
241
|
+
"defaultValue": "true"
|
|
242
|
+
},
|
|
243
|
+
"errorMessage": {
|
|
244
|
+
"type": "string",
|
|
245
|
+
"mutable": true,
|
|
246
|
+
"complexType": {
|
|
247
|
+
"original": "string",
|
|
248
|
+
"resolved": "string",
|
|
249
|
+
"references": {}
|
|
250
|
+
},
|
|
251
|
+
"required": false,
|
|
252
|
+
"optional": false,
|
|
253
|
+
"docs": {
|
|
254
|
+
"tags": [],
|
|
255
|
+
"text": "Define uma mensagem de orienta\u00E7\u00E3o ao usu\u00E1rio, colocando o campo em modo inv\u00E1lido."
|
|
256
|
+
},
|
|
257
|
+
"attribute": "error-message",
|
|
258
|
+
"reflect": true
|
|
259
|
+
},
|
|
260
|
+
"showSeconds": {
|
|
261
|
+
"type": "boolean",
|
|
262
|
+
"mutable": false,
|
|
263
|
+
"complexType": {
|
|
264
|
+
"original": "boolean",
|
|
265
|
+
"resolved": "boolean",
|
|
266
|
+
"references": {}
|
|
267
|
+
},
|
|
268
|
+
"required": false,
|
|
269
|
+
"optional": false,
|
|
270
|
+
"docs": {
|
|
271
|
+
"tags": [],
|
|
272
|
+
"text": "Se true considera segundos."
|
|
273
|
+
},
|
|
274
|
+
"attribute": "show-seconds",
|
|
275
|
+
"reflect": true,
|
|
276
|
+
"defaultValue": "false"
|
|
277
|
+
},
|
|
278
|
+
"mode": {
|
|
279
|
+
"type": "string",
|
|
280
|
+
"mutable": false,
|
|
281
|
+
"complexType": {
|
|
282
|
+
"original": "\"slim\" | \"regular\"",
|
|
283
|
+
"resolved": "\"regular\" | \"slim\"",
|
|
284
|
+
"references": {}
|
|
285
|
+
},
|
|
286
|
+
"required": false,
|
|
287
|
+
"optional": false,
|
|
288
|
+
"docs": {
|
|
289
|
+
"tags": [],
|
|
290
|
+
"text": "Define o tamanho do campo."
|
|
291
|
+
},
|
|
292
|
+
"attribute": "mode",
|
|
293
|
+
"reflect": true,
|
|
294
|
+
"defaultValue": "\"regular\""
|
|
295
|
+
},
|
|
296
|
+
"size": {
|
|
297
|
+
"type": "string",
|
|
298
|
+
"mutable": false,
|
|
299
|
+
"complexType": {
|
|
300
|
+
"original": "\"default\" | \"small\" | \"xsmall\"",
|
|
301
|
+
"resolved": "\"default\" | \"small\" | \"xsmall\"",
|
|
302
|
+
"references": {}
|
|
303
|
+
},
|
|
304
|
+
"required": false,
|
|
305
|
+
"optional": true,
|
|
306
|
+
"docs": {
|
|
307
|
+
"tags": [],
|
|
308
|
+
"text": "Tamanho do input"
|
|
309
|
+
},
|
|
310
|
+
"attribute": "size",
|
|
311
|
+
"reflect": false,
|
|
312
|
+
"defaultValue": "\"default\""
|
|
313
|
+
},
|
|
314
|
+
"required": {
|
|
315
|
+
"type": "boolean",
|
|
316
|
+
"mutable": false,
|
|
317
|
+
"complexType": {
|
|
318
|
+
"original": "boolean",
|
|
319
|
+
"resolved": "boolean",
|
|
320
|
+
"references": {}
|
|
321
|
+
},
|
|
322
|
+
"required": false,
|
|
323
|
+
"optional": true,
|
|
324
|
+
"docs": {
|
|
325
|
+
"tags": [],
|
|
326
|
+
"text": "Define se o campo \u00E9 obrigat\u00F3rio"
|
|
327
|
+
},
|
|
328
|
+
"attribute": "required",
|
|
329
|
+
"reflect": false,
|
|
330
|
+
"defaultValue": "false"
|
|
331
|
+
},
|
|
332
|
+
"canShowError": {
|
|
333
|
+
"type": "boolean",
|
|
334
|
+
"mutable": false,
|
|
335
|
+
"complexType": {
|
|
336
|
+
"original": "boolean",
|
|
337
|
+
"resolved": "boolean",
|
|
338
|
+
"references": {}
|
|
339
|
+
},
|
|
340
|
+
"required": false,
|
|
341
|
+
"optional": false,
|
|
342
|
+
"docs": {
|
|
343
|
+
"tags": [],
|
|
344
|
+
"text": "Se false deixa de exibir a mensagem de erro dentro do campo."
|
|
345
|
+
},
|
|
346
|
+
"attribute": "can-show-error",
|
|
347
|
+
"reflect": true,
|
|
348
|
+
"defaultValue": "true"
|
|
349
|
+
},
|
|
350
|
+
"autoFocus": {
|
|
351
|
+
"type": "boolean",
|
|
352
|
+
"mutable": false,
|
|
353
|
+
"complexType": {
|
|
354
|
+
"original": "boolean",
|
|
355
|
+
"resolved": "boolean",
|
|
356
|
+
"references": {}
|
|
357
|
+
},
|
|
358
|
+
"required": false,
|
|
359
|
+
"optional": false,
|
|
360
|
+
"docs": {
|
|
361
|
+
"tags": [],
|
|
362
|
+
"text": "Se true o campo de texto receber\u00E1 o foco ao ser renderizado."
|
|
363
|
+
},
|
|
364
|
+
"attribute": "auto-focus",
|
|
365
|
+
"reflect": false,
|
|
366
|
+
"defaultValue": "false"
|
|
367
|
+
},
|
|
368
|
+
"alternativePlaceholder": {
|
|
369
|
+
"type": "string",
|
|
370
|
+
"mutable": false,
|
|
371
|
+
"complexType": {
|
|
372
|
+
"original": "string",
|
|
373
|
+
"resolved": "string",
|
|
374
|
+
"references": {}
|
|
375
|
+
},
|
|
376
|
+
"required": false,
|
|
377
|
+
"optional": false,
|
|
378
|
+
"docs": {
|
|
379
|
+
"tags": [],
|
|
380
|
+
"text": "Texto alternativo ser apresentado como t\u00EDtulo do campo."
|
|
381
|
+
},
|
|
382
|
+
"attribute": "alternative-placeholder",
|
|
383
|
+
"reflect": false
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
static get events() {
|
|
388
|
+
return [{
|
|
389
|
+
"method": "ezChange",
|
|
390
|
+
"name": "ezChange",
|
|
391
|
+
"bubbles": true,
|
|
392
|
+
"cancelable": true,
|
|
393
|
+
"composed": true,
|
|
394
|
+
"docs": {
|
|
395
|
+
"tags": [],
|
|
396
|
+
"text": "Emitido quando acontece a altera\u00E7\u00E3o de valor do campo."
|
|
397
|
+
},
|
|
398
|
+
"complexType": {
|
|
399
|
+
"original": "number",
|
|
400
|
+
"resolved": "number",
|
|
401
|
+
"references": {}
|
|
402
|
+
}
|
|
403
|
+
}, {
|
|
404
|
+
"method": "ezStartChange",
|
|
405
|
+
"name": "ezStartChange",
|
|
406
|
+
"bubbles": true,
|
|
407
|
+
"cancelable": true,
|
|
408
|
+
"composed": true,
|
|
409
|
+
"docs": {
|
|
410
|
+
"tags": [],
|
|
411
|
+
"text": "Emitido ao iniciar a altera\u00E7\u00E3o (digita\u00E7\u00E3o incompleta)."
|
|
412
|
+
},
|
|
413
|
+
"complexType": {
|
|
414
|
+
"original": "WaitingChange",
|
|
415
|
+
"resolved": "WaitingChange",
|
|
416
|
+
"references": {
|
|
417
|
+
"WaitingChange": {
|
|
418
|
+
"location": "import",
|
|
419
|
+
"path": "@sankhyalabs/core"
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}, {
|
|
424
|
+
"method": "ezCancelWaitingChange",
|
|
425
|
+
"name": "ezCancelWaitingChange",
|
|
426
|
+
"bubbles": true,
|
|
427
|
+
"cancelable": true,
|
|
428
|
+
"composed": true,
|
|
429
|
+
"docs": {
|
|
430
|
+
"tags": [],
|
|
431
|
+
"text": "Emitido quando n\u00E3o foi poss\u00EDvel completar a altera\u00E7\u00E3o entre o evento ezStartChange e ezChange."
|
|
432
|
+
},
|
|
433
|
+
"complexType": {
|
|
434
|
+
"original": "void",
|
|
435
|
+
"resolved": "void",
|
|
436
|
+
"references": {}
|
|
437
|
+
}
|
|
438
|
+
}];
|
|
439
|
+
}
|
|
440
|
+
static get methods() {
|
|
441
|
+
return {
|
|
442
|
+
"setFocus": {
|
|
443
|
+
"complexType": {
|
|
444
|
+
"signature": "({ selectText }: TFocusOptions) => Promise<void>",
|
|
445
|
+
"parameters": [{
|
|
446
|
+
"tags": [],
|
|
447
|
+
"text": ""
|
|
448
|
+
}],
|
|
449
|
+
"references": {
|
|
450
|
+
"Promise": {
|
|
451
|
+
"location": "global"
|
|
452
|
+
},
|
|
453
|
+
"TFocusOptions": {
|
|
454
|
+
"location": "global"
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
"return": "Promise<void>"
|
|
458
|
+
},
|
|
459
|
+
"docs": {
|
|
460
|
+
"text": "Aplica o foco no campo.",
|
|
461
|
+
"tags": []
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
"setBlur": {
|
|
465
|
+
"complexType": {
|
|
466
|
+
"signature": "() => Promise<void>",
|
|
467
|
+
"parameters": [],
|
|
468
|
+
"references": {
|
|
469
|
+
"Promise": {
|
|
470
|
+
"location": "global"
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
"return": "Promise<void>"
|
|
474
|
+
},
|
|
475
|
+
"docs": {
|
|
476
|
+
"text": "Remove o foco do campo.",
|
|
477
|
+
"tags": []
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
"isInvalid": {
|
|
481
|
+
"complexType": {
|
|
482
|
+
"signature": "() => Promise<boolean>",
|
|
483
|
+
"parameters": [],
|
|
484
|
+
"references": {
|
|
485
|
+
"Promise": {
|
|
486
|
+
"location": "global"
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
"return": "Promise<boolean>"
|
|
490
|
+
},
|
|
491
|
+
"docs": {
|
|
492
|
+
"text": "Retorna se o conte\u00FAdo \u00E9 inv\u00E1lido.",
|
|
493
|
+
"tags": []
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
static get elementRef() { return "_elem"; }
|
|
499
|
+
static get watchers() {
|
|
500
|
+
return [{
|
|
501
|
+
"propName": "errorMessage",
|
|
502
|
+
"methodName": "observeErrorMessage"
|
|
503
|
+
}, {
|
|
504
|
+
"propName": "showSeconds",
|
|
505
|
+
"methodName": "observeShowSeconds"
|
|
506
|
+
}, {
|
|
507
|
+
"propName": "value",
|
|
508
|
+
"methodName": "observeValue"
|
|
509
|
+
}];
|
|
510
|
+
}
|
|
511
|
+
}
|
|
@@ -19,6 +19,7 @@ export class EzForm {
|
|
|
19
19
|
};
|
|
20
20
|
this._fieldsProps = new Map();
|
|
21
21
|
this._singleColumn = false;
|
|
22
|
+
this._formLayout = undefined;
|
|
22
23
|
this.dataUnit = undefined;
|
|
23
24
|
this.config = undefined;
|
|
24
25
|
this.recordsValidator = undefined;
|
|
@@ -84,7 +85,7 @@ export class EzForm {
|
|
|
84
85
|
}
|
|
85
86
|
this.ezFormSetFields.emit(fields);
|
|
86
87
|
const idFormSheet = `${StringUtils.replaceAccentuatedChars(StringUtils.toCamelCase(currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.label), false)}_selectorContainer`;
|
|
87
|
-
return (h("div", { class: "dynamic-content ez-box--no-outline", "data-element-id": idFormSheet, ref: elem => (this._container = elem), tabindex: "0" }, h("ez-popover", { ref: elem => (this._ezPopoverSearchField = elem), overlayType: "none" }, this.renderFieldColumn()), h("ez-form-view", { ref: (element) => (this._formView = element), class: "ez-row ez-padding-vertical--small", fields: fields, singleColumn: this._singleColumn, selectedRecord: this.dataUnit.getSelectedRecord(), customUiBuilders: this.customUiBuilders })));
|
|
88
|
+
return (h("div", { class: "dynamic-content ez-box--no-outline", "data-element-id": idFormSheet, ref: elem => (this._container = elem), tabindex: "0" }, h("ez-popover", { ref: elem => (this._ezPopoverSearchField = elem), overlayType: "none" }, this.renderFieldColumn()), h("ez-form-view", { ref: (element) => (this._formView = element), class: "ez-row ez-padding-vertical--small", fields: fields, singleColumn: this._singleColumn, formLayout: this._formLayout, selectedRecord: this.dataUnit.getSelectedRecord(), customUiBuilders: this.customUiBuilders })));
|
|
88
89
|
}
|
|
89
90
|
renderFieldColumn() {
|
|
90
91
|
if (this._fieldSearch != undefined) {
|
|
@@ -168,18 +169,20 @@ export class EzForm {
|
|
|
168
169
|
this._i18n = await initI18n();
|
|
169
170
|
}
|
|
170
171
|
async setSingleColumn(layoutFormConfig) {
|
|
171
|
-
this._singleColumn = (layoutFormConfig === null || layoutFormConfig === void 0 ? void 0 : layoutFormConfig.config) === FormLayout.CASCADE;
|
|
172
|
+
this._singleColumn = (layoutFormConfig === null || layoutFormConfig === void 0 ? void 0 : layoutFormConfig.config) === FormLayout.CASCADE || (layoutFormConfig === null || layoutFormConfig === void 0 ? void 0 : layoutFormConfig.config) === FormLayout.CLASSIC_CASCADE;
|
|
173
|
+
this._formLayout = layoutFormConfig === null || layoutFormConfig === void 0 ? void 0 : layoutFormConfig.config;
|
|
172
174
|
}
|
|
173
175
|
async registerNotifyListeners(layoutFormConfig) {
|
|
174
176
|
if (!layoutFormConfig)
|
|
175
177
|
return;
|
|
176
178
|
layoutFormConfig.onConfigChange((config) => {
|
|
177
|
-
if (config === FormLayout.CASCADE) {
|
|
179
|
+
if (config === FormLayout.CASCADE || config === FormLayout.CLASSIC_CASCADE) {
|
|
178
180
|
this._singleColumn = true;
|
|
179
181
|
}
|
|
180
182
|
else {
|
|
181
183
|
this._singleColumn = false;
|
|
182
184
|
}
|
|
185
|
+
this._formLayout = config;
|
|
183
186
|
});
|
|
184
187
|
}
|
|
185
188
|
componentDidRender() {
|
|
@@ -393,7 +396,7 @@ export class EzForm {
|
|
|
393
396
|
"mutable": false,
|
|
394
397
|
"complexType": {
|
|
395
398
|
"original": "UiFieldBuilders",
|
|
396
|
-
"resolved": "Map<UserInterface, (field: IFormViewField) => HTMLElement>",
|
|
399
|
+
"resolved": "Map<UserInterface, (field: IFormViewField, context?: IFieldBuilderContext) => HTMLElement>",
|
|
397
400
|
"references": {
|
|
398
401
|
"UiFieldBuilders": {
|
|
399
402
|
"location": "import",
|
|
@@ -414,7 +417,8 @@ export class EzForm {
|
|
|
414
417
|
static get states() {
|
|
415
418
|
return {
|
|
416
419
|
"_fieldsProps": {},
|
|
417
|
-
"_singleColumn": {}
|
|
420
|
+
"_singleColumn": {},
|
|
421
|
+
"_formLayout": {}
|
|
418
422
|
};
|
|
419
423
|
}
|
|
420
424
|
static get events() {
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
/*@doc Define o tamanho máximo dos itens do formulário.*/
|
|
10
10
|
--ez-form-view__item--max-width: 440px;
|
|
11
11
|
|
|
12
|
-
/*@doc Define o
|
|
13
|
-
--ez-form-view__item--
|
|
12
|
+
/*@doc Define o colunas entre itens do formulário.*/
|
|
13
|
+
--ez-form-view__item--gap: var(--space--14, 14px);
|
|
14
|
+
|
|
14
15
|
/*@doc Define o padding do formulário.*/
|
|
15
16
|
--ez-form-view__item--padding: var(--space--small);
|
|
16
17
|
}
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
.form-view__content{
|
|
19
20
|
display: grid;
|
|
20
21
|
grid-template-columns: repeat(auto-fill, minmax(var(--ez-form-view__item--min-width), 1fr));
|
|
21
|
-
gap: var(--ez-form-view__item--
|
|
22
|
+
gap: var(--ez-form-view__item--gap);
|
|
22
23
|
padding-inline: var(--ez-form-view__item--padding);
|
|
23
24
|
width: 100%;
|
|
24
25
|
}
|
|
@@ -30,4 +31,8 @@
|
|
|
30
31
|
.input-full_width {
|
|
31
32
|
grid-column: 1 / -1;
|
|
32
33
|
width: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
*:has(*) + ez-collapsible-box {
|
|
37
|
+
margin-top: var(--space--16, 16px);
|
|
33
38
|
}
|
|
@@ -4,10 +4,12 @@ import { ElementIDUtils, UserInterface } from '@sankhyalabs/core';
|
|
|
4
4
|
import { FormItems } from './structure';
|
|
5
5
|
export class EzFormView {
|
|
6
6
|
constructor() {
|
|
7
|
+
this.MAIN_GROUP_NAME = "__main";
|
|
7
8
|
this._customEditors = new Map();
|
|
8
9
|
this.fields = undefined;
|
|
9
10
|
this.selectedRecord = undefined;
|
|
10
11
|
this.singleColumn = false;
|
|
12
|
+
this.formLayout = undefined;
|
|
11
13
|
this.customUiBuilders = new Map();
|
|
12
14
|
}
|
|
13
15
|
async showUp() {
|
|
@@ -36,10 +38,18 @@ export class EzFormView {
|
|
|
36
38
|
});
|
|
37
39
|
this.fields = [...fields];
|
|
38
40
|
}
|
|
41
|
+
getGroupByField(field) {
|
|
42
|
+
var _a, _b;
|
|
43
|
+
const group = (_a = field.group) !== null && _a !== void 0 ? _a : (_b = field.props) === null || _b === void 0 ? void 0 : _b["UITabName"];
|
|
44
|
+
if (group && group !== this.MAIN_GROUP_NAME) {
|
|
45
|
+
return group;
|
|
46
|
+
}
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
39
49
|
groupFields(fields) {
|
|
40
50
|
const result = new Map();
|
|
41
51
|
fields.forEach(item => {
|
|
42
|
-
const groupLabel = item
|
|
52
|
+
const groupLabel = this.getGroupByField(item);
|
|
43
53
|
if (groupLabel) {
|
|
44
54
|
let groupFields = result.get(groupLabel);
|
|
45
55
|
if (groupFields == undefined) {
|
|
@@ -72,12 +82,16 @@ export class EzFormView {
|
|
|
72
82
|
if (this.isItemFullWidth(item.userInterface)) {
|
|
73
83
|
classItem += " input-full_width";
|
|
74
84
|
}
|
|
85
|
+
const context = {
|
|
86
|
+
formLayout: this.formLayout,
|
|
87
|
+
size: "xsmall",
|
|
88
|
+
};
|
|
75
89
|
if (this._customEditors.has(item.name)) {
|
|
76
90
|
const value = (_a = this._formElements.map(el => ({ name: el.dataset.fieldName, value: el['value'] })).find(field => field.name === item.name)) === null || _a === void 0 ? void 0 : _a.value;
|
|
77
91
|
const customEditor = this._customEditors.get(item.name).customEditor;
|
|
78
|
-
return h("div", { class: classItem }, h("ez-custom-form-input", { "data-field-name": item.name, customEditor: customEditor, formViewField: item, builderFallback: (field) => fieldBuilder(field, this.customUiBuilders), value: value, selectedRecord: this.selectedRecord }));
|
|
92
|
+
return h("div", { class: classItem }, h("ez-custom-form-input", { "data-field-name": item.name, customEditor: customEditor, formViewField: item, builderFallback: (field) => fieldBuilder(field, this.customUiBuilders, context), value: value, selectedRecord: this.selectedRecord }));
|
|
79
93
|
}
|
|
80
|
-
return h("div", { class: classItem }, fieldBuilder(item, this.customUiBuilders));
|
|
94
|
+
return h("div", { class: classItem }, fieldBuilder(item, this.customUiBuilders, context));
|
|
81
95
|
}
|
|
82
96
|
render() {
|
|
83
97
|
ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
|
|
@@ -173,12 +187,34 @@ export class EzFormView {
|
|
|
173
187
|
"reflect": false,
|
|
174
188
|
"defaultValue": "false"
|
|
175
189
|
},
|
|
190
|
+
"formLayout": {
|
|
191
|
+
"type": "number",
|
|
192
|
+
"mutable": false,
|
|
193
|
+
"complexType": {
|
|
194
|
+
"original": "FormLayout",
|
|
195
|
+
"resolved": "FormLayout.CASCADE | FormLayout.CLASSIC_CASCADE | FormLayout.CLASSIC_SIDE_BY_SIDE | FormLayout.SIDE_BY_SIDE",
|
|
196
|
+
"references": {
|
|
197
|
+
"FormLayout": {
|
|
198
|
+
"location": "import",
|
|
199
|
+
"path": "../../utils/form/interfaces/FormLayout"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"required": false,
|
|
204
|
+
"optional": true,
|
|
205
|
+
"docs": {
|
|
206
|
+
"tags": [],
|
|
207
|
+
"text": "Define o layout do formul\u00E1rio."
|
|
208
|
+
},
|
|
209
|
+
"attribute": "form-layout",
|
|
210
|
+
"reflect": false
|
|
211
|
+
},
|
|
176
212
|
"customUiBuilders": {
|
|
177
213
|
"type": "unknown",
|
|
178
214
|
"mutable": false,
|
|
179
215
|
"complexType": {
|
|
180
216
|
"original": "UiFieldBuilders",
|
|
181
|
-
"resolved": "Map<UserInterface, (field: IFormViewField) => HTMLElement>",
|
|
217
|
+
"resolved": "Map<UserInterface, (field: IFormViewField, context?: IFieldBuilderContext) => HTMLElement>",
|
|
182
218
|
"references": {
|
|
183
219
|
"UiFieldBuilders": {
|
|
184
220
|
"location": "import",
|