@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-77074.0 → 0.0.0-bugfix-dev-KB-75047.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/DataBinder-3b083480.js +445 -0
- package/dist/cjs/FocusResolver-885f2173.js +35 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert-list.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-badge.cjs.entry.js +1 -1
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item_3.cjs.entry.js +13 -20
- package/dist/cjs/ez-chart.cjs.entry.js +2 -2
- 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 +49 -13
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +5 -4
- package/dist/cjs/ez-date-input.cjs.entry.js +9 -3
- package/dist/cjs/ez-date-time-input.cjs.entry.js +9 -3
- package/dist/cjs/ez-dialog.cjs.entry.js +10 -2
- package/dist/cjs/ez-dropdown_2.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 +3 -3
- package/dist/cjs/ez-form.cjs.entry.js +6 -326
- package/dist/cjs/ez-grid.cjs.entry.js +14615 -70501
- 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-list.cjs.entry.js +152 -101
- 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 +2 -2
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +9 -2
- package/dist/cjs/ez-popover.cjs.entry.js +2 -2
- package/dist/cjs/ez-popup.cjs.entry.js +2 -2
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +69 -20
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +67 -5
- package/dist/cjs/ez-text-input.cjs.entry.js +80 -8
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -1
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +1 -1
- 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/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/{index-a7b0c73d.js → index-9e5554cb.js} +3 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ez-button/ez-button.css +2 -2
- package/dist/collection/components/ez-card-item/ez-card-item.css +14 -5
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +12 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +76 -15
- package/dist/collection/components/ez-date-input/ez-date-input.js +35 -4
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +35 -4
- package/dist/collection/components/ez-dialog/ez-dialog.js +9 -1
- package/dist/collection/components/ez-filter-input/ez-filter-input.css +0 -11
- package/dist/collection/components/ez-filter-input/ez-filter-input.js +22 -52
- package/dist/collection/components/ez-form/ez-form.js +1 -0
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +3 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +96 -27
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +8 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +164 -46
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +7 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js +4 -1
- package/dist/collection/components/ez-grid/ez-grid.js +90 -3
- package/dist/collection/components/ez-list/ez-list.css +5 -5
- package/dist/collection/components/ez-list/ez-list.js +152 -170
- package/dist/collection/components/ez-modal/ez-modal.css +4 -0
- package/dist/collection/components/ez-modal/ez-modal.js +2 -2
- package/dist/collection/components/ez-number-input/ez-number-input.css +8 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +25 -0
- package/dist/collection/components/ez-popover/ez-popover.css +3 -10
- package/dist/collection/components/ez-popup/ez-popup.js +1 -1
- package/dist/collection/components/ez-search/ez-search.css +1 -1
- package/dist/collection/components/ez-search/ez-search.js +95 -21
- package/dist/collection/components/ez-split-button/ez-split-button.css +2 -2
- package/dist/collection/components/ez-text-area/ez-text-area.css +49 -0
- package/dist/collection/components/ez-text-area/ez-text-area.js +102 -2
- package/dist/collection/components/ez-text-input/ez-text-input.css +33 -53
- package/dist/collection/components/ez-text-input/ez-text-input.js +88 -6
- package/dist/collection/components/ez-time-input/ez-time-input.js +24 -0
- package/dist/collection/utils/FocusResolver.js +31 -0
- package/dist/collection/utils/ResponsiveInputUtils.js +26 -0
- package/dist/collection/utils/form/DataBinder.js +18 -3
- package/dist/collection/utils/form/FormMetadata.js +1 -1
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
- package/dist/custom-elements/index.js +15360 -70903
- package/dist/esm/DataBinder-02fa9bb9.js +441 -0
- package/dist/esm/FocusResolver-1ccbf850.js +33 -0
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-alert-list.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-badge.entry.js +1 -1
- package/dist/esm/ez-breadcrumb.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +2 -2
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item_3.entry.js +13 -20
- package/dist/esm/ez-chart.entry.js +2 -2
- 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 +50 -14
- package/dist/esm/ez-custom-form-input_2.entry.js +5 -4
- package/dist/esm/ez-date-input.entry.js +9 -3
- package/dist/esm/ez-date-time-input.entry.js +9 -3
- package/dist/esm/ez-dialog.entry.js +10 -2
- package/dist/esm/ez-dropdown_2.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +3 -3
- package/dist/esm/ez-form.entry.js +5 -325
- package/dist/esm/ez-grid.entry.js +14585 -70471
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +153 -102
- 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 +2 -2
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +9 -2
- package/dist/esm/ez-popover.entry.js +2 -2
- package/dist/esm/ez-popup.entry.js +2 -2
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller_2.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +69 -20
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +2 -2
- package/dist/esm/ez-split-item.entry.js +1 -1
- package/dist/esm/ez-split-panel.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +67 -5
- package/dist/esm/ez-text-input.entry.js +80 -8
- package/dist/esm/ez-time-input.entry.js +7 -1
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-baa5e267.js → index-5a720e56.js} +3 -1
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
- package/dist/ezui/p-076e868b.entry.js +1 -0
- package/dist/ezui/p-0e1cc2d1.entry.js +1 -0
- package/dist/ezui/{p-1285c902.entry.js → p-11b09aa1.entry.js} +1 -1
- package/dist/ezui/{p-77a4bd35.entry.js → p-11bfeca3.entry.js} +1 -1
- package/dist/ezui/p-16e21a40.entry.js +1 -0
- package/dist/ezui/p-1af7fae4.entry.js +1 -0
- package/dist/ezui/{p-8888d9ed.entry.js → p-1b08bf3c.entry.js} +1 -1
- package/dist/ezui/{p-a2e5b8c3.entry.js → p-2f53435e.entry.js} +1 -1
- package/dist/ezui/{p-baf80b13.entry.js → p-30951bd7.entry.js} +1 -1
- package/dist/ezui/p-33675dae.entry.js +1 -0
- package/dist/ezui/p-3af64edd.entry.js +1 -0
- package/dist/ezui/p-3cc9b84a.entry.js +1 -0
- package/dist/ezui/p-3d38bfea.entry.js +1 -0
- package/dist/ezui/{p-7bc07c31.entry.js → p-3f8c33e0.entry.js} +1 -1
- package/dist/ezui/p-455e737c.js +1 -0
- package/dist/ezui/{p-6d79930d.entry.js → p-554522db.entry.js} +1 -1
- package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
- package/dist/ezui/p-6bda82d1.entry.js +1 -0
- package/dist/ezui/p-6d31c43c.entry.js +1 -0
- package/dist/ezui/p-6ec40dec.entry.js +1 -0
- package/dist/ezui/p-6f0422ff.entry.js +309 -0
- package/dist/ezui/{p-5ed81457.entry.js → p-6fc26622.entry.js} +1 -1
- package/dist/ezui/{p-f9e551de.entry.js → p-70f1c812.entry.js} +1 -1
- package/dist/ezui/{p-555c9018.entry.js → p-7567ccdd.entry.js} +1 -1
- package/dist/ezui/p-7de7baa3.entry.js +1 -0
- package/dist/ezui/p-7f5afb1f.entry.js +1 -0
- package/dist/ezui/{p-1e7a8633.entry.js → p-81461d2f.entry.js} +1 -1
- package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
- package/dist/ezui/{p-bcb53f27.entry.js → p-868b56f7.entry.js} +1 -1
- package/dist/ezui/p-8f026744.entry.js +1 -0
- package/dist/ezui/{p-09de35a2.entry.js → p-91ccae0c.entry.js} +1 -1
- package/dist/ezui/{p-c0d9c4f8.entry.js → p-92748142.entry.js} +1 -1
- package/dist/ezui/{p-c4320a39.entry.js → p-a563df31.entry.js} +1 -1
- package/dist/ezui/{p-990b4318.entry.js → p-a921e3e7.entry.js} +1 -1
- package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
- package/dist/ezui/{p-c3045972.entry.js → p-b858fc6e.entry.js} +1 -1
- package/dist/ezui/{p-e347df9c.entry.js → p-bef7daac.entry.js} +1 -1
- package/dist/ezui/p-bfc30e61.entry.js +1 -0
- package/dist/ezui/p-bfc59380.entry.js +1 -0
- package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
- package/dist/ezui/p-d27b4b3e.entry.js +1 -0
- package/dist/ezui/p-d960a031.entry.js +1 -0
- package/dist/ezui/p-dc628ed3.js +1 -0
- package/dist/ezui/p-dfca5946.entry.js +1 -0
- package/dist/ezui/{p-7fdd479f.entry.js → p-e18d9e6a.entry.js} +1 -1
- package/dist/ezui/{p-23a36bb6.js → p-e4c7eb39.js} +2 -2
- package/dist/ezui/{p-0306dff7.entry.js → p-e6b38ade.entry.js} +1 -1
- package/dist/ezui/{p-90bcd2ba.entry.js → p-e7395eae.entry.js} +1 -1
- package/dist/ezui/p-e80dcf86.entry.js +1 -0
- package/dist/ezui/{p-650e4b6d.entry.js → p-f1c2c19e.entry.js} +1 -1
- package/dist/ezui/{p-6e429cff.entry.js → p-fc194825.entry.js} +1 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +7 -1
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +6 -1
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +6 -1
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +2 -0
- package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +4 -11
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +12 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +7 -2
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +2 -1
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +19 -7
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +3 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +11 -1
- package/dist/types/components/ez-list/ez-list.d.ts +3 -26
- package/dist/types/components/ez-modal/ez-modal.d.ts +1 -1
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +4 -0
- package/dist/types/components/ez-search/ez-search.d.ts +10 -2
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +17 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +9 -0
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +4 -0
- package/dist/types/components.d.ts +109 -44
- package/dist/types/utils/FocusResolver.d.ts +5 -0
- package/dist/types/utils/ResponsiveInputUtils.d.ts +6 -0
- package/dist/types/utils/form/DataBinder.d.ts +3 -0
- package/package.json +11 -4
- package/dist/cjs/RecordValidationProcessor-10846595.js +0 -108
- package/dist/esm/RecordValidationProcessor-9c6cc267.js +0 -105
- package/dist/ezui/p-10820c20.entry.js +0 -1
- package/dist/ezui/p-188f1c4c.entry.js +0 -1
- package/dist/ezui/p-49456b34.entry.js +0 -1
- package/dist/ezui/p-5a90d7d1.entry.js +0 -1
- package/dist/ezui/p-5b205c80.entry.js +0 -1
- package/dist/ezui/p-62732269.entry.js +0 -1
- package/dist/ezui/p-86b6aa01.entry.js +0 -1
- package/dist/ezui/p-9d9ecb7c.entry.js +0 -1
- package/dist/ezui/p-abce5219.entry.js +0 -1
- package/dist/ezui/p-b3b94f72.entry.js +0 -1
- package/dist/ezui/p-b95632e8.entry.js +0 -1
- package/dist/ezui/p-bc2f844e.entry.js +0 -1
- package/dist/ezui/p-bcd47eda.entry.js +0 -1
- package/dist/ezui/p-c3c3d640.entry.js +0 -304
- package/dist/ezui/p-cdc472cc.entry.js +0 -1
- package/dist/ezui/p-d2c06f38.entry.js +0 -1
- package/dist/ezui/p-d8f64bb7.entry.js +0 -1
- package/dist/ezui/p-dc4ada32.entry.js +0 -1
- package/dist/ezui/p-e85c48d7.entry.js +0 -1
- package/dist/ezui/p-f299c608.entry.js +0 -1
- package/dist/ezui/p-f42855b9.js +0 -1
- package/dist/ezui/p-f80ac647.entry.js +0 -1
|
@@ -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-9e5554cb.js');
|
|
6
6
|
const CSSVarsUtils = require('./CSSVarsUtils-10c9d5b4.js');
|
|
7
7
|
const core = require('@sankhyalabs/core');
|
|
8
8
|
const ApplicationUtils = require('./ApplicationUtils-c9d1205c.js');
|
|
@@ -50,7 +50,8 @@ const EzSearch = class {
|
|
|
50
50
|
this.options = undefined;
|
|
51
51
|
this.suppressSearch = false;
|
|
52
52
|
this.ensureClearButtonVisible = false;
|
|
53
|
-
this.suppressPreLoad =
|
|
53
|
+
this.suppressPreLoad = true;
|
|
54
|
+
this.autoFocus = false;
|
|
54
55
|
}
|
|
55
56
|
observeErrorMessage() {
|
|
56
57
|
var _a;
|
|
@@ -61,12 +62,25 @@ const EzSearch = class {
|
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
}
|
|
65
|
+
getValue(val) {
|
|
66
|
+
return typeof val === 'object' ? val === null || val === void 0 ? void 0 : val.value : val;
|
|
67
|
+
}
|
|
64
68
|
validateNewValue(newValue, oldValue) {
|
|
65
|
-
const
|
|
66
|
-
|
|
69
|
+
const parsedNewValue = this.getValue(newValue);
|
|
70
|
+
const parsedOldValue = this.getValue(oldValue);
|
|
71
|
+
const newValueIsValid = parsedNewValue !== "[object Object]" && !!parsedNewValue;
|
|
72
|
+
const oldValueIsValid = parsedOldValue !== "[object Object]" && !!parsedOldValue;
|
|
73
|
+
const valuesIsDifferent = parsedNewValue !== parsedOldValue;
|
|
74
|
+
if (!oldValueIsValid && newValueIsValid) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
if (newValueIsValid && oldValueIsValid && valuesIsDifferent) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
67
81
|
}
|
|
68
82
|
async observeValue(newValue, oldValue) {
|
|
69
|
-
if (this._textInput &&
|
|
83
|
+
if (this._textInput && this.validateNewValue(newValue, oldValue)) {
|
|
70
84
|
if (typeof newValue === "string") {
|
|
71
85
|
await this.handleValueAsString(newValue);
|
|
72
86
|
return;
|
|
@@ -109,9 +123,9 @@ const EzSearch = class {
|
|
|
109
123
|
/**
|
|
110
124
|
* Aplica o foco no campo.
|
|
111
125
|
*/
|
|
112
|
-
async setFocus() {
|
|
126
|
+
async setFocus(options) {
|
|
113
127
|
if (this._textInput) {
|
|
114
|
-
this._textInput.setFocus();
|
|
128
|
+
this._textInput.setFocus(options);
|
|
115
129
|
}
|
|
116
130
|
}
|
|
117
131
|
/**
|
|
@@ -154,6 +168,9 @@ const EzSearch = class {
|
|
|
154
168
|
return;
|
|
155
169
|
}
|
|
156
170
|
await this.loadDescriptionValue(value);
|
|
171
|
+
if (!this._currentValue) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
157
174
|
this.setInputValue();
|
|
158
175
|
this.ezChange.emit(this.value);
|
|
159
176
|
this._currentValue = this.value;
|
|
@@ -209,7 +226,7 @@ const EzSearch = class {
|
|
|
209
226
|
return;
|
|
210
227
|
}
|
|
211
228
|
let text = (!this.showSelectedValue || currentValue.value == undefined) ? currentValue.label : currentValue.label ? `${currentValue.value} - ${currentValue.label}` : currentValue.value;
|
|
212
|
-
text = text.replace(new RegExp(this._startHighlightTag, 'g'), '').replace(new RegExp(this._endHighlightTag, 'g'), '');
|
|
229
|
+
text = text === null || text === void 0 ? void 0 : text.replace(new RegExp(this._startHighlightTag, 'g'), '').replace(new RegExp(this._endHighlightTag, 'g'), '');
|
|
213
230
|
return text;
|
|
214
231
|
}
|
|
215
232
|
getText() {
|
|
@@ -384,15 +401,16 @@ const EzSearch = class {
|
|
|
384
401
|
replaceHighlight(value) {
|
|
385
402
|
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
386
403
|
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
387
|
-
return (value !== null && value !== void 0 ? value : "").replace(startHighlight, '').replace(endHighlight, '');
|
|
404
|
+
return String(value !== null && value !== void 0 ? value : "").replace(startHighlight, '').replace(endHighlight, '');
|
|
388
405
|
}
|
|
389
|
-
selectOption(newOption) {
|
|
406
|
+
selectOption(newOption, focusOnInput = true) {
|
|
390
407
|
var _a, _b;
|
|
391
408
|
const currentValue = this.getSelectedOption(this.value);
|
|
392
409
|
const newOptionsReplaced = Object.assign(Object.assign({}, newOption), { value: this.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.value), label: this.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.label) });
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
410
|
+
const newOptionsFormatted = Object.assign(Object.assign({}, newOptionsReplaced), { value: this.replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value), label: this.replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.label) });
|
|
411
|
+
if ((((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOptionsFormatted === null || newOptionsFormatted === void 0 ? void 0 : newOptionsFormatted.value) === null || _b === void 0 ? void 0 : _b.toString()))
|
|
412
|
+
|| (currentValue == undefined && newOptionsFormatted != undefined && "value" in newOptionsFormatted)) {
|
|
413
|
+
const adjustedOpt = !(newOptionsFormatted === null || newOptionsFormatted === void 0 ? void 0 : newOptionsFormatted.value) ? undefined : newOptionsFormatted;
|
|
396
414
|
this.value = adjustedOpt;
|
|
397
415
|
this._currentValue = adjustedOpt;
|
|
398
416
|
}
|
|
@@ -402,6 +420,11 @@ const EzSearch = class {
|
|
|
402
420
|
}
|
|
403
421
|
this._visibleOptions = [];
|
|
404
422
|
this.clearSource();
|
|
423
|
+
if (focusOnInput) {
|
|
424
|
+
setTimeout(() => {
|
|
425
|
+
this.setFocus();
|
|
426
|
+
}, 0);
|
|
427
|
+
}
|
|
405
428
|
}
|
|
406
429
|
loadOptions(mode, argument = "") {
|
|
407
430
|
this._criteria = argument;
|
|
@@ -438,7 +461,7 @@ const EzSearch = class {
|
|
|
438
461
|
this.value = null;
|
|
439
462
|
this._currentValue = null;
|
|
440
463
|
}
|
|
441
|
-
controlListWithOnlyOne() {
|
|
464
|
+
controlListWithOnlyOne(focusOnInput = true) {
|
|
442
465
|
var _a, _b;
|
|
443
466
|
const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
|
|
444
467
|
if ((source === null || source === void 0 ? void 0 : source.length) > 0) {
|
|
@@ -449,7 +472,7 @@ const EzSearch = class {
|
|
|
449
472
|
value: (_b = source[0].value) === null || _b === void 0 ? void 0 : _b.replace(startHighlight, '').replace(endHighlight, ''),
|
|
450
473
|
label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
|
|
451
474
|
};
|
|
452
|
-
this.selectOption(option);
|
|
475
|
+
this.selectOption(option, focusOnInput);
|
|
453
476
|
}
|
|
454
477
|
}
|
|
455
478
|
controlEmptySearch() {
|
|
@@ -530,6 +553,19 @@ const EzSearch = class {
|
|
|
530
553
|
this._preSelection = undefined;
|
|
531
554
|
this.updateVisibleOptions();
|
|
532
555
|
}
|
|
556
|
+
async handleInitialValue() {
|
|
557
|
+
const valueIsValid = !!this.getValue(this.value);
|
|
558
|
+
if (!valueIsValid) {
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
if (typeof this.value === "string") {
|
|
562
|
+
await this.handleValueAsString(this.value);
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
let text = this.getFormattedText(this.value);
|
|
566
|
+
text = this.replaceQuotes(text);
|
|
567
|
+
this._textInput.value = text;
|
|
568
|
+
}
|
|
533
569
|
//---------------------------------------------
|
|
534
570
|
// Lifecycle web component
|
|
535
571
|
//---------------------------------------------
|
|
@@ -561,10 +597,9 @@ const EzSearch = class {
|
|
|
561
597
|
core.ElementIDUtils.addIDInfoIfNotExists(elem, "itemSearch");
|
|
562
598
|
});
|
|
563
599
|
}
|
|
564
|
-
componentDidLoad() {
|
|
600
|
+
async componentDidLoad() {
|
|
565
601
|
this._currentValue = this.value;
|
|
566
602
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
567
|
-
this.setInputValue(false);
|
|
568
603
|
this._resizeObserver = new ResizeObserver((entries) => {
|
|
569
604
|
window.requestAnimationFrame(() => {
|
|
570
605
|
if (!Array.isArray(entries) || !entries.length)
|
|
@@ -575,6 +610,16 @@ const EzSearch = class {
|
|
|
575
610
|
}
|
|
576
611
|
});
|
|
577
612
|
});
|
|
613
|
+
await this.handleInitialValue();
|
|
614
|
+
if (this.autoFocus) {
|
|
615
|
+
requestAnimationFrame(() => {
|
|
616
|
+
this.setFocus({ selectText: true });
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
disconnectedCallback() {
|
|
621
|
+
var _a;
|
|
622
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
578
623
|
}
|
|
579
624
|
//---------------------------------------------
|
|
580
625
|
// Event handlers
|
|
@@ -644,12 +689,16 @@ const EzSearch = class {
|
|
|
644
689
|
}
|
|
645
690
|
switch (event.key) {
|
|
646
691
|
case "ArrowDown":
|
|
647
|
-
this.nextOption();
|
|
648
692
|
event.stopPropagation();
|
|
693
|
+
if (this.canShowListOptions())
|
|
694
|
+
event.preventDefault();
|
|
695
|
+
this.nextOption();
|
|
649
696
|
break;
|
|
650
697
|
case "ArrowUp":
|
|
651
|
-
this.previousOption();
|
|
652
698
|
event.stopPropagation();
|
|
699
|
+
if (this.canShowListOptions())
|
|
700
|
+
event.preventDefault();
|
|
701
|
+
this.previousOption();
|
|
653
702
|
break;
|
|
654
703
|
case "Enter":
|
|
655
704
|
this.handleEventPropagation(event);
|
|
@@ -660,7 +709,7 @@ const EzSearch = class {
|
|
|
660
709
|
break;
|
|
661
710
|
case "Tab":
|
|
662
711
|
this._tabPressed = true;
|
|
663
|
-
this.controlListWithOnlyOne();
|
|
712
|
+
this.controlListWithOnlyOne(false);
|
|
664
713
|
break;
|
|
665
714
|
}
|
|
666
715
|
//ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
|
|
@@ -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-9e5554cb.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const EzScrollDirection = require('./EzScrollDirection-b2c99895.js');
|
|
8
8
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-9e5554cb.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
|
|
8
|
-
const ezSplitButtonCss = ":host{--ez-split-button--min-width:24;--ez-split-button--width:'auto';--ez-split-button__medium--height:32px;--ez-split-button__large--height:42px;--ez-split-button__medium-icon--width:40px;--ez-split-button__large-icon--width:44px;--ez-split-button__inline__icon--gap:6px;--ez-split-button__label--padding-top:0px;--ez-split-button__label--padding-bottom:0px;--ez-split-button__right-button--padding-left:8px;--ez-split-button--color:var(--title--primary, #2B3A54);--ez-split-button--font-size:var(--text--small, 12px);--ez-split-button--font-family:var(--font-pattern, Arial);--ez-split-button--font-weight:var(--text-weight--large);--ez-split-button--background-color:var(--background--light, #ffffff);--ez-split-button--border-radius:var(--border--radius-large, 24px);--ez-split-button--border:1px solid var(--color--strokes);--ez-split-button--justify-content:center;--ez-split-button--hover-color:var(--color--primary-600, #007a5a);--ez-split-button--hover--background-color:var(--background--light, #ffffff);--ez-split-button--disabled-color:var(--text--
|
|
8
|
+
const ezSplitButtonCss = ":host{--ez-split-button--min-width:24;--ez-split-button--width:'auto';--ez-split-button__medium--height:32px;--ez-split-button__large--height:42px;--ez-split-button__medium-icon--width:40px;--ez-split-button__large-icon--width:44px;--ez-split-button__inline__icon--gap:6px;--ez-split-button__label--padding-top:0px;--ez-split-button__label--padding-bottom:0px;--ez-split-button__right-button--padding-left:8px;--ez-split-button--color:var(--title--primary, #2B3A54);--ez-split-button--font-size:var(--text--small, 12px);--ez-split-button--font-family:var(--font-pattern, Arial);--ez-split-button--font-weight:var(--text-weight--large);--ez-split-button--background-color:var(--background--light, #ffffff);--ez-split-button--border-radius:var(--border--radius-large, 24px);--ez-split-button--border:1px solid var(--color--strokes);--ez-split-button--justify-content:center;--ez-split-button--hover-color:var(--color--primary-600, #007a5a);--ez-split-button--hover--background-color:var(--background--light, #ffffff);--ez-split-button--disabled-color:var(--text--primary);--ez-split-button--disabled--background-color:var(--background--medium);--ez-split-button--focus--border:var(--border--medium, 2px) var(--color--primary-300);--ez-split-button--focus--box-shadow:none;--ez-split-button--active-color:var(--color--primary-700);--ez-split-button--active--background-color:var(--background--strong)}ez-icon{--ez-icon--color:inherit}button{position:relative;display:flex;align-items:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-split-button--min-width);width:var(--ez-split-button--width);height:var(--ez-split-button__medium--height);font-family:var(--ez-split-button--font-family);font-size:var(--ez-split-button--font-size);font-weight:var(--ez-split-button--font-weight);padding:var(--ez-split-button__label--padding-top) 0 var(--ez-split-button__label--padding-bottom) 0;border-top-left-radius:var(--ez-split-button--border-radius);border-bottom-left-radius:var(--ez-split-button--border-radius);background-color:var(--ez-split-button--background-color);color:var(--ez-split-button--color);fill:var(--ez-split-button--color);border:none;justify-content:var(--ez-split-button--justify-content)}label{cursor:pointer}button:active{outline:none;box-shadow:none;background-color:var(--ez-split-button--active--background-color);color:var(--ez-split-button--active-color);fill:var(--ez-split-button--active-color);--ez-icon--color:var(--ez-split-button--active-color)}.ez-split-button__left-button{border:var(--ez-split-button--border);border-right:none}.ez-split-button__right-button{border:var(--ez-split-button--border);border-left:none}.ez-split-button__left-button:focus{box-shadow:0 0 0 2px var(--color--primary-300), \n 0 2px 0 0 var(--color--primary-300), \n 0 -2px 0 0 var(--color--primary-300);}.ez-split-button__right-button:focus{box-shadow:2px 0 0 0 var(--color--primary-300), \n 0 2px 0 0 var(--color--primary-300), \n 0 -2px 0 0 var(--color--primary-300);}.ez-split-button__left-button:hover,.ez-split-button__right-button:hover{outline:none;background-color:var(--ez-split-button--hover--background-color);color:var(--ez-split-button--hover-color);fill:var(--ez-split-button--hover-color);--ez-icon--color:var(--ez-split-button--hover-color)}.ez-split-button__left-button:active,.ez-split-button__right-button:active{outline:none;box-shadow:none;background-color:var(--ez-split-button--active--background-color);color:var(--ez-split-button--active-color);fill:var(--ez-split-button--active-color);--ez-icon--color:var(--ez-split-button--active-color)}.ez-split-button__left-button:disabled,.ez-split-button__left-button:disabled label,.ez-split-button__right-button:disabled{background-color:var(--ez-split-button--disabled--background-color);color:var(--ez-split-button--disabled-color);fill:var(--ez-split-button--disabled-color);border:none;--ez-icon--color:var(--ez-split-button--disabled-color);cursor:not-allowed}.ez-split-button__left-button:disabled{border:var(--ez-split-button--disabled-border);border-right:none}.ez-split-button__right-button:disabled{border:var(--ez-split-button--disabled-border);border-left:none}button.large{height:var(--ez-split-button__large--height)}button.medium{height:var(--ez-split-button__medium--height)}.default label{padding:var(--ez-split-button__label--padding-top) 12px var(--ez-split-button__label--padding-bottom) 20px}.icon-left{gap:var(--ez-split-button__inline__icon--gap)}.icon-left label{padding-right:12px}.icon-left ez-icon{padding-left:20px}.icon-only{padding-left:12px;padding-right:12px}.ez-split-button__right-button{border-top-right-radius:var(--ez-split-button--border-radius);border-bottom-right-radius:var(--ez-split-button--border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-right:var(--ez-split-button--border)}.ez-split-button__right-button--medium{min-width:var(--ez-split-button__medium-icon--width)}.ez-split-button__right-button--large{min-width:var(--ez-split-button__large-icon--width)}.ez-split-button__right-button--divider{top:10%;bottom:10%}.ez-split-button__right-button--divider:before{content:\"\";position:absolute;left:0;border-left:1px solid rgba(0, 0, 0, 20%);border-radius:2px;height:75%}.btn-icon--medium{min-width:--ez-split-button__medium-icon--width}.btn-icon--large{min-width:--ez-split-button__large-icon--width}.ez-split-button__right-button-container{position:absolute;left:0;padding-left:var(--ez-split-button__right-button--padding-left)}.label-icon{display:flex;flex-direction:row;align-items:center;color:var(--ez-split-button--color)}.label-icon:active{color:var(--ez-split-button--active-color);fill:var(--ez-split-button--active-color);--ez-icon--color:var(--ez-split-button--active-color)}.dropdown{display:flex}.dropdown-content{display:block;position:absolute;background-color:#f1f1f1;min-width:160px;z-index:--ez-elevation--8;border-radius:var(--ez-split-button--border-radius)}.dropdown-content>ez-dropdown{position:relative}";
|
|
9
9
|
|
|
10
10
|
const EzSplitButton = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -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-9e5554cb.js');
|
|
6
6
|
require('./ApplicationUtils-c9d1205c.js');
|
|
7
7
|
const CSSVarsUtils = require('./CSSVarsUtils-10c9d5b4.js');
|
|
8
8
|
require('./DialogType-2114c337.js');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index$1 = require('./index-
|
|
5
|
+
const index$1 = require('./index-9e5554cb.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
|
|
8
8
|
var numeric = function (value, unit) { return Number(value.slice(0, -1 * unit.length)); };
|
|
@@ -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-9e5554cb.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
|
|
8
8
|
const ezTabselectorCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}:host{display:flex;position:relative;width:100%;overflow:hidden;--tabselector--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--tabselector--forward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>')}.scroll{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.scroll.startHidden{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.scroll.middle{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.scroll.endHidden{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab{display:flex;border:none;background-color:unset;min-width:100px;max-width:260px;cursor:pointer;padding:6px 12px;align-items:center;justify-content:center;color:var(--text--primary, #626e82);font-family:var(--font-pattern, \"Roboto\");font-size:var(--title--small, 14px);flex-shrink:0}.tab:focus,.forward-button,.backward-button{outline:none}.is-active{position:relative;color:var(--color--primary, #008561)}.is-active::after{content:\"\";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.is-focused{border:1px dashed var(--color--primary, #000000c5)}.tab-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow);margin-bottom:var(--space--extra-small, 3px)}.forward-button,.backward-button{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.backward-button{left:0px}.forward-button::after,.backward-button::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:10px;height:16px}.forward-button::after{-webkit-mask-image:var(--tabselector--forward-icon);mask-image:var(--tabselector--forward-icon)}.backward-button::after{-webkit-mask-image:var(--tabselector--backward-icon);mask-image:var(--tabselector--backward-icon)}.forward-button:hover::after,.backward-button:hover::after{background-color:var(--color--primary, #4e4e4e)}.hidden{display:none}.scroll::-webkit-scrollbar{display:none}.left-icon{padding-right:var(--space--small)}.right-icon{padding-left:var(--space--small)}";
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-9e5554cb.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
|
|
8
|
-
const ezTextAreaCss = ":host{--text-area--width:100%;--text-area--border-radius:var(--border--radius-medium, 12px);--text-area--font-size:var(--text--medium, 14px);--text-area--font-family:var(--font-pattern, Arial);--text-area--font-weight:var(--text-weight--medium, 400);--text-area--color:var(--title--primary, #2B3A54);--text-area__input--background-color:var(--background--light, #FFFFFF);--text-area__input--border:var(--border--medium, 2px solid);--text-area__input--border-color:var(--color--strokes,#DCE0E8);--text-area__input--focus--border-color:var(--color--primary, #008561);--text-area__input--disabled--background-color:var(--background--medium, #F0F3F7);--text-area__input--disabled--color:var(--text--primary, #626E82);--text-area__input--disabled--border--color:var(--color--strokes,#DCE0E8);--text-area__input--error--border-color:var(--color-alert--error-800,#BD0025);--text-area__message_box--font-size:var(--text--small, 12px);--text-area__message_box--info--color:var(--color--success, #22085d);--text-area__message_box--error--color:var(--color-alert--error-800,#BD0025);--text-area__label--floating--top:6px;--text-area__label--padding-top:12px;--text-area__label--padding-left:14px;--text-area__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--text-area--width)}textarea{box-sizing:border-box;border:none;resize:none;width:100%;padding:0;background:none;font-weight:var(--text-area--font-weight);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);color:var(--text-area--color);margin-top:calc(var(--space--medium, 12px) + 4px)}textarea:focus{outline:none}textarea:disabled{background-color:transparent;color:var(--text-area__input--disabled--color);border:var(--text-area__input--disabled--border);cursor:not-allowed}.textarea{width:100%;box-sizing:border-box;padding-left:var(--space--medium);padding-right:var(--space--extra-small);border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--border-color);background-color:var(--text-area__input--background-color)}.textarea--disabled{border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--disabled--border--color);background-color:var(--text-area__input--disabled--background-color);cursor:not-allowed}.textarea--resizable{resize:both}.textarea--focus{border-color:var(--text-area__input--focus--border-color)}.textarea.hasError{color:var(--text-area--color);border-color:var(--text-area__input--error--border-color)}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--text-area--font-family);font-size:var(--text-area__message_box--font-size);color:var(--text-area__message_box--info--color)}.hasError{color:var(--text-area__message_box--error--color)}.textarea__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--text-area__label--padding-right));left:var(--text-area--space--medium);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color);top:var(--text-area__label--padding-top);left:var(--text-area__label--padding-left);padding-right:var(--text-area__label--padding-right)}.textarea__label--floated{font-family:var(--text-area--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--text-area__label--floating--top)}.textarea__label--disabled{color:var(--text-area__input--disabled--color);cursor:not-allowed}.textarea--slim{margin-top:var(--space--small, 6px)}.textarea--slim::-webkit-input-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:-moz-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim::-moz-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:-ms-input-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim::placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:disabled::-webkit-input-placeholder,.textarea--slim:disabled:-moz-placeholder,.textarea--slim:disabled::-moz-placeholder,.textarea--slim:disabled:-ms-input-placeholder,.textarea--slim:disabled::placeholder{color:var(--text-area__input--disabled--color);cursor:not-allowed}";
|
|
8
|
+
const ezTextAreaCss = ":host{--text-area--width:100%;--text-area--border-radius:var(--border--radius-medium, 12px);--text-area--font-size:var(--text--medium, 14px);--text-area--font-family:var(--font-pattern, Arial);--text-area--font-weight:var(--text-weight--medium, 400);--text-area--color:var(--title--primary, #2B3A54);--text-area__input--background-color:var(--background--light, #FFFFFF);--text-area__input--border:var(--border--medium, 2px solid);--text-area__input--border-color:var(--color--strokes,#DCE0E8);--text-area__input--focus--border-color:var(--color--primary, #008561);--text-area__input--disabled--background-color:var(--background--medium, #F0F3F7);--text-area__input--disabled--color:var(--text--primary, #626E82);--text-area__input--disabled--border--color:var(--color--strokes,#DCE0E8);--text-area__input--error--border-color:var(--color-alert--error-800,#BD0025);--text-area__message_box--font-size:var(--text--small, 12px);--text-area__message_box--info--color:var(--color--success, #22085d);--text-area__message_box--error--color:var(--color-alert--error-800,#BD0025);--text-area__label--floating--top:6px;--text-area__label--padding-top:12px;--text-area__label--padding-left:14px;--text-area__label--padding-right:12px;--text-area__scrollbar--color-default:var(--scrollbar--default, #626e82);--text-area__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--text-area__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--text-area__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--text-area__scrollbar--border-radius:var(--border--radius-small, 6px);--text-area__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--text-area--width)}textarea{box-sizing:border-box;border:none;resize:none;width:100%;padding:0;background:none;font-weight:var(--text-area--font-weight);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);color:var(--text-area--color);margin-top:calc(var(--space--medium, 12px) + 4px);scrollbar-width:thin;scrollbar-color:var(--text-area__scrollbar--color-clicked) var(--text-area__scrollbar--color-background)}textarea:focus{outline:none}textarea:disabled{background-color:transparent;color:var(--text-area__input--disabled--color);border:var(--text-area__input--disabled--border);cursor:not-allowed}textarea::-webkit-scrollbar{background-color:var(--text-area__scrollbar--color-background);width:var(--text-area__scrollbar--width);max-width:var(--text-area__scrollbar--width);min-width:var(--text-area__scrollbar--width)}textarea::-webkit-scrollbar-thumb{background-color:var(--text-area__scrollbar--color-default);border-radius:var(--text-area__scrollbar--border-radius)}textarea::-webkit-scrollbar-track{background-color:var(--text-area__scrollbar--color-background);border-radius:var(--text-area__scrollbar--border-radius)}textarea::-webkit-scrollbar-thumb:vertical:hover,textarea::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--text-area__scrollbar--color-hover)}textarea::-webkit-scrollbar-thumb:vertical:active,textarea::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--text-area__scrollbar--color-clicked)}.textarea{width:100%;box-sizing:border-box;padding-left:var(--space--medium);padding-right:var(--space--extra-small);border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--border-color);background-color:var(--text-area__input--background-color)}.textarea--disabled{border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--disabled--border--color);background-color:var(--text-area__input--disabled--background-color);cursor:not-allowed}.textarea--resizable{resize:both}.textarea--focus{border-color:var(--text-area__input--focus--border-color)}.textarea.hasError{color:var(--text-area--color);border-color:var(--text-area__input--error--border-color)}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--text-area--font-family);font-size:var(--text-area__message_box--font-size);color:var(--text-area__message_box--info--color)}.hasError{color:var(--text-area__message_box--error--color)}.textarea__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--text-area__label--padding-right));left:var(--text-area--space--medium);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color);top:var(--text-area__label--padding-top);left:var(--text-area__label--padding-left);padding-right:var(--text-area__label--padding-right)}.textarea__label--floated{font-family:var(--text-area--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--text-area__label--floating--top)}.textarea__label--disabled{color:var(--text-area__input--disabled--color);cursor:not-allowed}.textarea--slim{margin-top:var(--space--small, 6px)}.textarea--slim::-webkit-input-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:-moz-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim::-moz-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:-ms-input-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim::placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:disabled::-webkit-input-placeholder,.textarea--slim:disabled:-moz-placeholder,.textarea--slim:disabled::-moz-placeholder,.textarea--slim:disabled:-ms-input-placeholder,.textarea--slim:disabled::placeholder{color:var(--text-area__input--disabled--color);cursor:not-allowed}";
|
|
9
9
|
|
|
10
10
|
const EzTextArea = class {
|
|
11
11
|
constructor(hostRef) {
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
13
|
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
14
|
+
this.LINE_HEIGHT = 24;
|
|
15
|
+
this.HEIGHT_RATIO = 1.4;
|
|
14
16
|
this.label = undefined;
|
|
15
17
|
this.value = undefined;
|
|
16
18
|
this.enabled = true;
|
|
@@ -19,6 +21,8 @@ const EzTextArea = class {
|
|
|
19
21
|
this.canShowError = true;
|
|
20
22
|
this.mode = "regular";
|
|
21
23
|
this.enableResize = false;
|
|
24
|
+
this.autoRows = false;
|
|
25
|
+
this.autoFocus = false;
|
|
22
26
|
}
|
|
23
27
|
observeErrorMessage() {
|
|
24
28
|
var _a, _b, _c, _d;
|
|
@@ -56,8 +60,17 @@ const EzTextArea = class {
|
|
|
56
60
|
observeRows() {
|
|
57
61
|
const rows = this.rows > 0 ? this.rows : this.mode != "slim" ? 4 : 2;
|
|
58
62
|
if (rows !== this.rows) {
|
|
59
|
-
this.rows
|
|
60
|
-
|
|
63
|
+
this.updateRows(rows);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
observeAutoRows() {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
if (this.autoRows) {
|
|
69
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
70
|
+
this.initializeResizeObserver();
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
(_b = this._resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
61
74
|
}
|
|
62
75
|
}
|
|
63
76
|
//---------------------------------------------
|
|
@@ -126,6 +139,42 @@ const EzTextArea = class {
|
|
|
126
139
|
isFocused() {
|
|
127
140
|
return this._hostElement.shadowRoot.activeElement !== null;
|
|
128
141
|
}
|
|
142
|
+
updateRows(newRows) {
|
|
143
|
+
this.rows = newRows;
|
|
144
|
+
this._initialRows = newRows;
|
|
145
|
+
}
|
|
146
|
+
calculateMaxRows() {
|
|
147
|
+
const parentElement = this._hostElement.parentElement;
|
|
148
|
+
if (!parentElement) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const height = Math.max((parentElement === null || parentElement === void 0 ? void 0 : parentElement.clientHeight) || 0, this.LINE_HEIGHT);
|
|
152
|
+
if (height > 0) {
|
|
153
|
+
const maxRows = Math.floor(height / this.LINE_HEIGHT * this.HEIGHT_RATIO);
|
|
154
|
+
if (maxRows !== this.rows) {
|
|
155
|
+
this.updateRows(maxRows);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
initializeResizeObserver() {
|
|
160
|
+
if (!this.autoRows) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const parentElement = this._hostElement.parentElement;
|
|
164
|
+
if (parentElement) {
|
|
165
|
+
try {
|
|
166
|
+
if (this._resizeObserver != undefined) {
|
|
167
|
+
this._resizeObserver.unobserve(parentElement);
|
|
168
|
+
}
|
|
169
|
+
this._resizeObserver = new ResizeObserver(this.calculateMaxRows.bind(this));
|
|
170
|
+
this._resizeObserver.observe(parentElement);
|
|
171
|
+
}
|
|
172
|
+
catch (e) {
|
|
173
|
+
console.warn(e);
|
|
174
|
+
}
|
|
175
|
+
this.calculateMaxRows();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
129
178
|
//---------------------------------------------
|
|
130
179
|
// Event handlers
|
|
131
180
|
//---------------------------------------------
|
|
@@ -148,6 +197,13 @@ const EzTextArea = class {
|
|
|
148
197
|
this._container.classList.add("textarea--focus");
|
|
149
198
|
}
|
|
150
199
|
}
|
|
200
|
+
connectedCallback() {
|
|
201
|
+
this.initializeResizeObserver();
|
|
202
|
+
}
|
|
203
|
+
disconnectedCallback() {
|
|
204
|
+
var _a;
|
|
205
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
206
|
+
}
|
|
151
207
|
//---------------------------------------------
|
|
152
208
|
// Lifecycle web component
|
|
153
209
|
//---------------------------------------------
|
|
@@ -155,6 +211,11 @@ const EzTextArea = class {
|
|
|
155
211
|
this.observeErrorMessage();
|
|
156
212
|
this.adjustFloatingLabel();
|
|
157
213
|
this.observeMode();
|
|
214
|
+
if (this.autoFocus) {
|
|
215
|
+
requestAnimationFrame(() => {
|
|
216
|
+
this.setFocus();
|
|
217
|
+
});
|
|
218
|
+
}
|
|
158
219
|
}
|
|
159
220
|
render() {
|
|
160
221
|
core.ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
|
|
@@ -171,7 +232,8 @@ const EzTextArea = class {
|
|
|
171
232
|
"errorMessage": ["observeErrorMessage"],
|
|
172
233
|
"value": ["observeValue"],
|
|
173
234
|
"mode": ["observeMode"],
|
|
174
|
-
"rows": ["observeRows"]
|
|
235
|
+
"rows": ["observeRows"],
|
|
236
|
+
"autoRows": ["observeAutoRows"]
|
|
175
237
|
}; }
|
|
176
238
|
};
|
|
177
239
|
EzTextArea.style = ezTextAreaCss;
|
|
@@ -2,10 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-9e5554cb.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Aplica comportamento de elipses a um input caso o texto ultrapasse o tamanho disponível.
|
|
10
|
+
*
|
|
11
|
+
* @param inputElement A referência ao elemento input (HTMLInputElement).
|
|
12
|
+
*/
|
|
13
|
+
const applyEllipsisToInput = (inputElement) => {
|
|
14
|
+
if (!inputElement || !inputElement.style) {
|
|
15
|
+
console.error('[applyEllipsisToInput] Referência ao elemento input é inválida.');
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
inputElement.style.textOverflow = 'ellipsis';
|
|
19
|
+
inputElement.style.overflow = 'hidden';
|
|
20
|
+
inputElement.style.whiteSpace = 'nowrap';
|
|
21
|
+
const adjustEllipsis = () => {
|
|
22
|
+
const value = inputElement.value || '';
|
|
23
|
+
const isOverflowing = inputElement.scrollWidth > inputElement.clientWidth;
|
|
24
|
+
if (isOverflowing) {
|
|
25
|
+
inputElement.setAttribute('title', value);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
inputElement.removeAttribute('title');
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
inputElement.addEventListener('input', adjustEllipsis);
|
|
32
|
+
adjustEllipsis();
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const ezTextInputCss = ":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--height--slim:32px;--ez-text-input__min-width:0px;--ez-text-input__max-width:100%;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #2B3A54);--ez-text-input__input--background-color:var(--background--light, #ffffff);--ez-text-input__input--border:var(--border--small, 1px solid);--ez-text-input__input--border-color:var(--color--strokes,#DCE0E8);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--background--medium, #F0F3F7);--ez-text-input__input--disabled--color:var(--text--primary, #626E82);--ez-text-input__input--error--border-color:var(--color-alert--error-800,#BD0025);--ez-text-input__input--noborder-color:white;--ez-text-input__input--padding:var(--space--medium, 6px);--ez-text-input__placeholder--color:var(--text--secondary, #a2abb9);--ez-text-input__message_box--font-size:var(--text--extra-small, 10px);--ez-text-input__message_box--info--color:var(--color--success, #22085d);--ez-text-input__message_box--error--color:var(--color-alert--error-800,#BD0025);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;--ez-text-input__input--focus--icon-color:var(--title--primary, #2B3A54);--ez-text-input__input--disabled--focus--icon-color:var(--text--primary, #626E82);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width);min-width:var(--ez-text-input__min-width);max-width:var(--ez-text-input__max-width)}:host(.grid_editor){--ez-text-input--height--slim:25px}input{width:100%;box-sizing:border-box;height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color);font-weight:var(--ez-text-input--font-weight);padding:var(--ez-text-input__input--padding)}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color)}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:disabled,input:read-only{cursor:not-allowed}.message-box{min-height:14px;min-width:100%;margin-top:3px;line-height:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input__message_box--font-size);color:var(--ez-text-input__message_box--info--color)}.hasError{color:var(--ez-text-input__message_box--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input__slim--title{font-size:16px;font-weight:bold}.input--slim::-webkit-input-placeholder,.input--slim:-moz-placeholder,.input--slim::-moz-placeholder,.input--slim:-ms-input-placeholder,.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input__placeholder--color)}.input--slim:disabled::-webkit-input-placeholder,.input--slim:disabled:-moz-placeholder,.input--slim:disabled::-moz-placeholder,.input--slim:disabled:-ms-input-placeholder,.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}input.input__slim--noborder{box-shadow:0 0 0 0;border:0 none;outline:0;background:var(--ez-text-input__input--noborder-color)}";
|
|
9
36
|
|
|
10
37
|
const EzTextInput = class {
|
|
11
38
|
constructor(hostRef) {
|
|
@@ -16,11 +43,13 @@ const EzTextInput = class {
|
|
|
16
43
|
this.enabled = true;
|
|
17
44
|
this.errorMessage = undefined;
|
|
18
45
|
this.mask = undefined;
|
|
46
|
+
this.cleanValueMask = false;
|
|
19
47
|
this.canShowError = true;
|
|
20
48
|
this.restrict = undefined;
|
|
21
49
|
this.mode = "regular";
|
|
22
50
|
this.noBorder = false;
|
|
23
51
|
this.password = false;
|
|
52
|
+
this.autoFocus = false;
|
|
24
53
|
}
|
|
25
54
|
observeErrorMessage() {
|
|
26
55
|
if (this._inputElem) {
|
|
@@ -130,7 +159,12 @@ const EzTextInput = class {
|
|
|
130
159
|
const value = this._inputElem.value;
|
|
131
160
|
if (value && this._maskFormatter) {
|
|
132
161
|
try {
|
|
133
|
-
|
|
162
|
+
if (this.cleanValueMask) {
|
|
163
|
+
this.applyMask(value);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
this._inputElem.value = this._maskFormatter.format(value);
|
|
167
|
+
}
|
|
134
168
|
}
|
|
135
169
|
catch (e) {
|
|
136
170
|
this.errorMessage = e.message;
|
|
@@ -148,8 +182,34 @@ const EzTextInput = class {
|
|
|
148
182
|
}
|
|
149
183
|
controlChangeValue() {
|
|
150
184
|
if (this._inputElem && (this.value || '') !== this._inputElem.value) {
|
|
151
|
-
this.
|
|
185
|
+
if (this.cleanValueMask) {
|
|
186
|
+
this.value = this._maskFormatter.removeMask(this._inputElem.value);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
this.value = this._inputElem.value;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
applyMask(value) {
|
|
194
|
+
if (!value || value === "")
|
|
195
|
+
return value;
|
|
196
|
+
if (this._maskFormatter) {
|
|
197
|
+
try {
|
|
198
|
+
const formattedValue = this._maskFormatter.applyMask(this._maskFormatter.removeMask(value));
|
|
199
|
+
if (this._inputElem) {
|
|
200
|
+
this._inputElem.value = formattedValue;
|
|
201
|
+
return this._inputElem.value;
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
this.value = formattedValue;
|
|
205
|
+
return this.value;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
catch (e) {
|
|
209
|
+
this.errorMessage = e.message;
|
|
210
|
+
}
|
|
152
211
|
}
|
|
212
|
+
return value;
|
|
153
213
|
}
|
|
154
214
|
handleChange() {
|
|
155
215
|
if (!this._inputElem) {
|
|
@@ -174,9 +234,9 @@ const EzTextInput = class {
|
|
|
174
234
|
content.style.justifyContent = "center";
|
|
175
235
|
content.style.overflow = "hidden";
|
|
176
236
|
content.style.top = "0px";
|
|
237
|
+
content.style.width = "var(--ez-text-input__icon--width)";
|
|
177
238
|
content.style.height = this.mode != "slim" ? "var(--ez-text-input--height)" : "var(--ez-text-input--height--slim)";
|
|
178
239
|
if (slot.name == "leftIcon") {
|
|
179
|
-
content.style.width = "var(--ez-text-input__icon--left--width)";
|
|
180
240
|
content.style.left = "0px";
|
|
181
241
|
content.style.borderRadius = "var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)";
|
|
182
242
|
this._inputElem.classList.add("icon--left");
|
|
@@ -186,7 +246,6 @@ const EzTextInput = class {
|
|
|
186
246
|
this._contentLeftSlot = content;
|
|
187
247
|
}
|
|
188
248
|
else if (slot.name == "rightIcon") {
|
|
189
|
-
content.style.width = "var(--ez-text-input__icon--right--width)";
|
|
190
249
|
content.style.right = "0px";
|
|
191
250
|
content.style.borderRadius = "0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0";
|
|
192
251
|
this._inputElem.classList.add("icon--right");
|
|
@@ -212,16 +271,29 @@ const EzTextInput = class {
|
|
|
212
271
|
this.observeMask();
|
|
213
272
|
this.adjustFloatingLabel();
|
|
214
273
|
this.adjustBorderInput();
|
|
274
|
+
if (this.autoFocus) {
|
|
275
|
+
requestAnimationFrame(() => {
|
|
276
|
+
this.setFocus({ selectText: true });
|
|
277
|
+
});
|
|
278
|
+
}
|
|
215
279
|
this._inputElem.addEventListener('focus', () => {
|
|
216
280
|
this._inputElem.setSelectionRange(0, this._inputElem.value.length);
|
|
217
281
|
});
|
|
282
|
+
if (this._inputElem) {
|
|
283
|
+
applyEllipsisToInput(this._inputElem);
|
|
284
|
+
}
|
|
218
285
|
}
|
|
219
286
|
componentWillLoad() {
|
|
220
287
|
this.observeMask();
|
|
221
288
|
if (this.value) {
|
|
222
289
|
if (this._maskFormatter) {
|
|
223
290
|
try {
|
|
224
|
-
|
|
291
|
+
if (this.cleanValueMask) {
|
|
292
|
+
this.applyMask(this.value);
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
this.value = this._maskFormatter.format(this.value);
|
|
296
|
+
}
|
|
225
297
|
}
|
|
226
298
|
catch (e) {
|
|
227
299
|
this.errorMessage = e.message;
|
|
@@ -237,7 +309,7 @@ const EzTextInput = class {
|
|
|
237
309
|
core.ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
|
|
238
310
|
return (index.h(index.Host, { style: this._hostElement.classList.contains("grid_editor") ? { "height": "100%" } : null }, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label && this.mode != "slim" ?
|
|
239
311
|
index.h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "input__label" : "input__label input__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
240
|
-
: null, index.h("input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("input"), onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: this.password ? "password" : "text", class: this.mode === "slim" ? "input--slim" : "", placeholder: this.mode === "slim" && this.label ? this.label : "", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.canShowError && this.mode != "slim" &&
|
|
312
|
+
: null, index.h("input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("input"), onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: this.password ? "password" : "text", class: this.mode === "slim" ? "input--slim" : "", placeholder: this.mode === "slim" && this.label ? this.label : "", value: this.mask && this.cleanValueMask ? this.applyMask(this.value) : this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.canShowError && this.mode != "slim" &&
|
|
241
313
|
index.h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage, "data-element-id": core.ElementIDUtils.getInternalIDInfo("message_box") }, this.errorMessage)));
|
|
242
314
|
}
|
|
243
315
|
get _hostElement() { return index.getElement(this); }
|
|
@@ -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-9e5554cb.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const CSSVarsUtils = require('./CSSVarsUtils-10c9d5b4.js');
|
|
8
8
|
|
|
@@ -21,6 +21,7 @@ const EzTimeInput = class {
|
|
|
21
21
|
this.showSeconds = false;
|
|
22
22
|
this.mode = "regular";
|
|
23
23
|
this.canShowError = true;
|
|
24
|
+
this.autoFocus = false;
|
|
24
25
|
}
|
|
25
26
|
observeErrorMessage() {
|
|
26
27
|
var _a;
|
|
@@ -141,6 +142,11 @@ const EzTimeInput = class {
|
|
|
141
142
|
//---------------------------------------------
|
|
142
143
|
componentDidLoad() {
|
|
143
144
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
145
|
+
if (this.autoFocus) {
|
|
146
|
+
requestAnimationFrame(() => {
|
|
147
|
+
this.setFocus({ selectText: true });
|
|
148
|
+
});
|
|
149
|
+
}
|
|
144
150
|
}
|
|
145
151
|
componentWillLoad() {
|
|
146
152
|
this.observeShowSeconds();
|