@sankhyalabs/ezui 5.21.4 → 5.22.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ICustomRender-6fafffce.js +13 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -0
- package/dist/cjs/ez-chart.cjs.entry.js +435 -0
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -0
- package/dist/cjs/{ez-text-edit.cjs.entry.js → ez-custom-form-input_2.cjs.entry.js} +99 -0
- package/dist/cjs/ez-form-view.cjs.entry.js +37 -5
- package/dist/cjs/ez-form.cjs.entry.js +81 -2
- package/dist/cjs/ez-grid.cjs.entry.js +312 -40
- package/dist/cjs/ez-list.cjs.entry.js +10 -2
- package/dist/cjs/ez-modal-container.cjs.entry.js +2 -1
- package/dist/cjs/ez-modal.cjs.entry.js +7 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +37 -31
- package/dist/cjs/ez-scroller_2.cjs.entry.js +222 -0
- package/dist/cjs/ez-search.cjs.entry.js +40 -33
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +92 -0
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -0
- package/dist/cjs/ez-tabselector.cjs.entry.js +8 -2
- package/dist/cjs/{ez-scroller_3.cjs.entry.js → ez-tree.cjs.entry.js} +0 -215
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +16 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/ez-chart/components/BarChart.js +27 -0
- package/dist/collection/components/ez-chart/components/ColumnChart.js +27 -0
- package/dist/collection/components/ez-chart/components/DonutChart.js +42 -0
- package/dist/collection/components/ez-chart/components/LineChart.js +27 -0
- package/dist/collection/components/ez-chart/components/PieChart.js +45 -0
- package/dist/collection/components/ez-chart/components/index.js +5 -0
- package/dist/collection/components/ez-chart/ez-chart.css +5 -0
- package/dist/collection/components/ez-chart/ez-chart.js +286 -0
- package/dist/collection/components/ez-chart/interfaces/ChartAxis.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartContext.js +14 -0
- package/dist/collection/components/ez-chart/interfaces/ChartOptions.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartSerie.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartStrategies.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartType.js +8 -0
- package/dist/collection/components/ez-chart/interfaces/index.js +5 -0
- package/dist/collection/components/ez-chart/test/mock-chart.js +137 -0
- package/dist/collection/components/ez-chart/types/BaseHighChartsRender.js +146 -0
- package/dist/collection/components/ez-form/ez-form.js +130 -4
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +278 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js +110 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +51 -22
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +6 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +36 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +59 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +10 -3
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +3 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js +40 -0
- package/dist/collection/components/ez-grid/ez-grid.js +235 -12
- package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
- package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
- package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
- package/dist/collection/components/ez-list/ez-list.js +28 -2
- package/dist/collection/components/ez-modal/ez-modal.js +25 -1
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +20 -1
- package/dist/collection/components/ez-number-input/ez-number-input.js +46 -31
- package/dist/collection/components/ez-search/ez-search.js +39 -33
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +6 -2
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +1 -1
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css +180 -0
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.js +293 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.js +5 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.js +6 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.js +6 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/index.js +3 -0
- package/dist/collection/components/ez-sidebar-navigator/messages/constants.js +5 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +34 -2
- package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js +5 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js +1 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRender.js +5 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js +1 -0
- package/dist/collection/utils/form/DataBinder.js +31 -1
- package/dist/collection/utils/form/test/DataBinder.test.js +41 -4
- package/dist/collection/utils/form/test/resources/metadataTest.js +15 -0
- package/dist/collection/utils/index.js +2 -0
- package/dist/custom-elements/index.d.ts +18 -0
- package/dist/custom-elements/index.js +1173 -127
- package/dist/esm/ICustomRender-875b5a40.js +13 -0
- package/dist/esm/ez-actions-button.entry.js +1 -0
- package/dist/esm/ez-chart.entry.js +431 -0
- package/dist/esm/ez-collapsible-box.entry.js +1 -0
- package/dist/esm/ez-combo-box.entry.js +1 -0
- package/dist/esm/{ez-text-edit.entry.js → ez-custom-form-input_2.entry.js} +101 -3
- package/dist/esm/ez-form-view.entry.js +37 -5
- package/dist/esm/ez-form.entry.js +82 -3
- package/dist/esm/ez-grid.entry.js +312 -40
- package/dist/esm/ez-list.entry.js +10 -2
- package/dist/esm/ez-modal-container.entry.js +2 -1
- package/dist/esm/ez-modal.entry.js +7 -1
- package/dist/esm/ez-number-input.entry.js +38 -32
- package/dist/esm/ez-scroller_2.entry.js +217 -0
- package/dist/esm/ez-search.entry.js +40 -33
- package/dist/esm/ez-sidebar-navigator.entry.js +88 -0
- package/dist/esm/ez-split-item.entry.js +1 -0
- package/dist/esm/ez-tabselector.entry.js +8 -2
- package/dist/esm/{ez-scroller_3.entry.js → ez-tree.entry.js} +3 -216
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +16 -4
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-2097d0cf.entry.js +1 -0
- package/dist/ezui/{p-9fbb0f01.entry.js → p-32e553e5.entry.js} +2 -2
- package/dist/ezui/p-34b6916c.entry.js +1 -0
- package/dist/ezui/p-3b4eeeb6.entry.js +1 -0
- package/dist/ezui/p-42533ea4.entry.js +1 -0
- package/dist/ezui/p-4607fb89.js +1 -0
- package/dist/ezui/p-4d5235f1.entry.js +1 -0
- package/dist/ezui/p-5b205c80.entry.js +1 -0
- package/dist/ezui/p-7922142b.entry.js +1 -0
- package/dist/ezui/p-84e439b9.entry.js +1 -0
- package/dist/ezui/p-8888d9ed.entry.js +1 -0
- package/dist/ezui/p-922ac38b.entry.js +1 -0
- package/dist/ezui/p-a31b9c90.entry.js +1 -0
- package/dist/ezui/p-aba3da00.entry.js +1 -0
- package/dist/ezui/p-bcb53f27.entry.js +1 -0
- package/dist/ezui/p-c0d9c4f8.entry.js +1 -0
- package/dist/ezui/p-cdc472cc.entry.js +1 -0
- package/dist/ezui/p-ecc2c1ec.entry.js +1 -0
- package/dist/ezui/p-fcf0acce.entry.js +1 -0
- package/dist/types/components/ez-chart/components/BarChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/ColumnChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/DonutChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/LineChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/PieChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/index.d.ts +5 -0
- package/dist/types/components/ez-chart/ez-chart.d.ts +58 -0
- package/dist/types/components/ez-chart/interfaces/ChartAxis.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/ChartContext.d.ts +11 -0
- package/dist/types/components/ez-chart/interfaces/ChartOptions.d.ts +10 -0
- package/dist/types/components/ez-chart/interfaces/ChartSerie.d.ts +20 -0
- package/dist/types/components/ez-chart/interfaces/ChartStrategies.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/ChartType.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/index.d.ts +5 -0
- package/dist/types/components/ez-chart/types/BaseHighChartsRender.d.ts +15 -0
- package/dist/types/components/ez-form/ez-form.d.ts +20 -1
- package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +48 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +16 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +37 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +13 -4
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +19 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +14 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +6 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +15 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellRender.d.ts +10 -0
- package/dist/types/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.d.ts +6 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +34 -1
- package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
- package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
- package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
- package/dist/types/components/ez-list/ez-list.d.ts +5 -0
- package/dist/types/components/ez-modal/ez-modal.d.ts +5 -0
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +4 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +3 -0
- package/dist/types/components/ez-search/ez-search.d.ts +4 -2
- package/dist/types/components/ez-sidebar-navigator/ez-sidebar-navigator.d.ts +57 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.d.ts +4 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.d.ts +5 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.d.ts +5 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/index.d.ts +3 -0
- package/dist/types/components/ez-sidebar-navigator/messages/constants.d.ts +5 -0
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +2 -1
- package/dist/types/components.d.ts +351 -5
- package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +31 -0
- package/dist/types/utils/customEditor/interfaces/ICustomEditorInfo.d.ts +5 -0
- package/dist/types/utils/customRender/interfaces/ICustomRender.d.ts +29 -0
- package/dist/types/utils/customRender/interfaces/ICustomRenderInfo.d.ts +5 -0
- package/dist/types/utils/form/DataBinder.d.ts +5 -0
- package/dist/types/utils/form/test/resources/metadataTest.d.ts +2 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/package.json +2 -1
- package/react/components.d.ts +3 -0
- package/react/components.js +3 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-0447d17c.entry.js +0 -1
- package/dist/ezui/p-20ec22c0.entry.js +0 -1
- package/dist/ezui/p-2a1a0e04.entry.js +0 -1
- package/dist/ezui/p-2dcb50d4.entry.js +0 -1
- package/dist/ezui/p-30775e7f.entry.js +0 -1
- package/dist/ezui/p-41ac6cd9.entry.js +0 -1
- package/dist/ezui/p-637f69f2.entry.js +0 -1
- package/dist/ezui/p-786559c5.entry.js +0 -1
- package/dist/ezui/p-91f626d3.entry.js +0 -1
- package/dist/ezui/p-99ead599.entry.js +0 -1
- package/dist/ezui/p-b567fa8c.entry.js +0 -1
- package/dist/ezui/p-bae3d0aa.entry.js +0 -1
- package/dist/ezui/p-db77a984.entry.js +0 -1
- package/dist/ezui/p-f3c526cc.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementIDUtils, NumberUtils } from "@sankhyalabs/core";
|
|
1
|
+
import { ElementIDUtils, NumberUtils, StringUtils } from "@sankhyalabs/core";
|
|
2
2
|
import { h } from "@stencil/core";
|
|
3
3
|
import CSSVarsUtils from "../../utils/CSSVarsUtils";
|
|
4
4
|
export class EzNumberInput {
|
|
@@ -6,6 +6,7 @@ export class EzNumberInput {
|
|
|
6
6
|
this._focused = false;
|
|
7
7
|
this._changePending = false;
|
|
8
8
|
this._valuePromiseCallbacks = [];
|
|
9
|
+
this._value = undefined;
|
|
9
10
|
this.label = undefined;
|
|
10
11
|
this.value = undefined;
|
|
11
12
|
this.enabled = true;
|
|
@@ -61,35 +62,42 @@ export class EzNumberInput {
|
|
|
61
62
|
}
|
|
62
63
|
observeValue(newValue, oldValue) {
|
|
63
64
|
if (this._textInput && newValue != oldValue) {
|
|
64
|
-
|
|
65
|
-
const oldValueValidated = this.validateValue(oldValue);
|
|
66
|
-
if (newValueValidated === null) {
|
|
67
|
-
this._textInput.value = '';
|
|
68
|
-
}
|
|
69
|
-
if (newValueValidated != oldValueValidated) {
|
|
70
|
-
const textValue = this.getTextValue(newValueValidated) || '';
|
|
71
|
-
if ((this._textInput.value || '') !== textValue) {
|
|
72
|
-
const parsedNumber = this.getParsedNumber(textValue);
|
|
73
|
-
if (parsedNumber !== undefined || !this._focused) {
|
|
74
|
-
this._textInput.value = textValue;
|
|
75
|
-
this._focused = false;
|
|
76
|
-
this.errorMessage = "";
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const valueEmitted = newValueValidated === null ? undefined : newValueValidated;
|
|
80
|
-
this.ezChange.emit(valueEmitted);
|
|
81
|
-
}
|
|
65
|
+
this.handleNewValue(newValue, oldValue);
|
|
82
66
|
}
|
|
83
67
|
this._changePending = false;
|
|
84
68
|
}
|
|
69
|
+
observePrecision() {
|
|
70
|
+
if (this._textInput) {
|
|
71
|
+
this.setInputValue();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
handleNewValue(newValue, oldValue) {
|
|
75
|
+
const newValueValidated = this.validateValue(newValue);
|
|
76
|
+
const oldValueValidated = this.validateValue(oldValue);
|
|
77
|
+
if (newValueValidated === null) {
|
|
78
|
+
this._value = '';
|
|
79
|
+
}
|
|
80
|
+
if (newValueValidated === oldValueValidated) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const textValue = this.getTextValue(newValueValidated) || '';
|
|
84
|
+
const parsedNumber = this.getParsedNumber(textValue);
|
|
85
|
+
if ((this._value || '') !== textValue && (parsedNumber !== undefined || !this._focused)) {
|
|
86
|
+
this._value = textValue;
|
|
87
|
+
this._focused = false;
|
|
88
|
+
this.errorMessage = "";
|
|
89
|
+
}
|
|
90
|
+
const valueEmitted = newValueValidated === null ? undefined : newValueValidated;
|
|
91
|
+
this.ezChange.emit(valueEmitted);
|
|
92
|
+
}
|
|
85
93
|
validateValue(value) {
|
|
86
94
|
return isNaN(value) || value === undefined ? null : value;
|
|
87
95
|
}
|
|
88
96
|
getTextValue(value) {
|
|
89
|
-
if (value
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
return
|
|
97
|
+
if (value == undefined)
|
|
98
|
+
return undefined;
|
|
99
|
+
let textValue = this.precision >= 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
|
|
100
|
+
return (this.precision === 0) ? StringUtils.replaceAll(textValue, ".", "") : textValue;
|
|
93
101
|
}
|
|
94
102
|
changeValue(newValue) {
|
|
95
103
|
this.errorMessage = "";
|
|
@@ -140,17 +148,13 @@ export class EzNumberInput {
|
|
|
140
148
|
this.ezStartChange.emit({ waitmessage: "", blocking: false });
|
|
141
149
|
}
|
|
142
150
|
}
|
|
143
|
-
getParsedNumber(value) {
|
|
144
|
-
var _a;
|
|
145
|
-
if (value === void 0) {
|
|
146
|
-
value = (_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value;
|
|
147
|
-
}
|
|
151
|
+
getParsedNumber(value = this._textInput.value) {
|
|
148
152
|
return (value === null || value === void 0 ? void 0 : value.trim()) ? NumberUtils.stringToNumber(value) : undefined;
|
|
149
153
|
}
|
|
150
154
|
setInputValue() {
|
|
151
155
|
const textValue = this.getTextValue(this.value) || '';
|
|
152
|
-
if ((this.
|
|
153
|
-
this.
|
|
156
|
+
if ((this._value || '') !== textValue) {
|
|
157
|
+
this._value = textValue;
|
|
154
158
|
}
|
|
155
159
|
}
|
|
156
160
|
componentDidLoad() {
|
|
@@ -159,7 +163,7 @@ export class EzNumberInput {
|
|
|
159
163
|
}
|
|
160
164
|
render() {
|
|
161
165
|
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
162
|
-
return (h("ez-text-input", { class: "number__input", "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, canShowError: this.canShowError }));
|
|
166
|
+
return (h("ez-text-input", { class: "number__input", "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, canShowError: this.canShowError, value: this._value }));
|
|
163
167
|
}
|
|
164
168
|
static get is() { return "ez-number-input"; }
|
|
165
169
|
static get encapsulation() { return "shadow"; }
|
|
@@ -316,6 +320,11 @@ export class EzNumberInput {
|
|
|
316
320
|
}
|
|
317
321
|
};
|
|
318
322
|
}
|
|
323
|
+
static get states() {
|
|
324
|
+
return {
|
|
325
|
+
"_value": {}
|
|
326
|
+
};
|
|
327
|
+
}
|
|
319
328
|
static get events() {
|
|
320
329
|
return [{
|
|
321
330
|
"method": "ezChange",
|
|
@@ -455,6 +464,12 @@ export class EzNumberInput {
|
|
|
455
464
|
}, {
|
|
456
465
|
"propName": "value",
|
|
457
466
|
"methodName": "observeValue"
|
|
467
|
+
}, {
|
|
468
|
+
"propName": "precision",
|
|
469
|
+
"methodName": "observePrecision"
|
|
470
|
+
}, {
|
|
471
|
+
"propName": "prettyPrecision",
|
|
472
|
+
"methodName": "observePrecision"
|
|
458
473
|
}];
|
|
459
474
|
}
|
|
460
475
|
}
|
|
@@ -12,7 +12,6 @@ export class EzSearch {
|
|
|
12
12
|
this._tabPressed = false;
|
|
13
13
|
this._textEmptyList = "Nenhum resultado encontrado";
|
|
14
14
|
this._textEmptySearch = "Nenhum resultado de {0} encontrado";
|
|
15
|
-
this._lookupMode = false;
|
|
16
15
|
this._startHighlightTag = "<span class='card-item__highlight'>";
|
|
17
16
|
this._endHighlightTag = "</span>";
|
|
18
17
|
this._preSelection = undefined;
|
|
@@ -42,36 +41,30 @@ export class EzSearch {
|
|
|
42
41
|
var _a;
|
|
43
42
|
if (this._textInput) {
|
|
44
43
|
this._textInput.errorMessage = this.errorMessage;
|
|
45
|
-
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
44
|
+
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim()) && this.errorMessage) {
|
|
46
45
|
this.setInputValue();
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const currentValue = this.getSelectedOption(this.value);
|
|
60
|
-
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
61
|
-
this.value = newValueSelected;
|
|
62
|
-
}
|
|
63
|
-
if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
|
|
64
|
-
this.setInputValue();
|
|
65
|
-
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
66
|
-
if (!this._lookupMode) {
|
|
67
|
-
this.ezChange.emit(valueEmitted);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
this.resetOptions();
|
|
49
|
+
validateNewValue(newValue, oldValue) {
|
|
50
|
+
const getValue = (val) => typeof val === 'object' ? val === null || val === void 0 ? void 0 : val.value : val;
|
|
51
|
+
return (getValue(newValue) !== getValue(oldValue));
|
|
52
|
+
}
|
|
53
|
+
async observeValue(newValue, oldValue) {
|
|
54
|
+
if (this._textInput && newValue !== oldValue && this.validateNewValue(newValue, oldValue)) {
|
|
55
|
+
if (typeof newValue === "string") {
|
|
56
|
+
await this.handleValueAsString(newValue);
|
|
57
|
+
return;
|
|
71
58
|
}
|
|
72
|
-
|
|
73
|
-
|
|
59
|
+
const newValueSelected = this.getSelectedOption(newValue);
|
|
60
|
+
const currentValue = this.getSelectedOption(this._currentValue);
|
|
61
|
+
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
62
|
+
this._currentValue = newValueSelected;
|
|
63
|
+
this.setInputValue();
|
|
64
|
+
const valueEmitted = newValueSelected !== null && newValueSelected !== void 0 ? newValueSelected : undefined;
|
|
65
|
+
this.ezChange.emit(valueEmitted);
|
|
74
66
|
}
|
|
67
|
+
this.resetOptions();
|
|
75
68
|
}
|
|
76
69
|
}
|
|
77
70
|
observeOptions(newOptions, oldOptions) {
|
|
@@ -140,6 +133,16 @@ export class EzSearch {
|
|
|
140
133
|
});
|
|
141
134
|
}
|
|
142
135
|
}
|
|
136
|
+
async handleValueAsString(value) {
|
|
137
|
+
if (this.getSelectedOption(value)) {
|
|
138
|
+
this.setInputValue();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
await this.loadDescriptionValue(value);
|
|
142
|
+
this.setInputValue();
|
|
143
|
+
this.ezChange.emit(this.value);
|
|
144
|
+
this._currentValue = this.value;
|
|
145
|
+
}
|
|
143
146
|
updateListPosition() {
|
|
144
147
|
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
145
148
|
const elementRect = this._listWrapper.getBoundingClientRect();
|
|
@@ -195,7 +198,7 @@ export class EzSearch {
|
|
|
195
198
|
return text;
|
|
196
199
|
}
|
|
197
200
|
getText() {
|
|
198
|
-
const currentValue = this.getSelectedOption(this.
|
|
201
|
+
const currentValue = this.getSelectedOption(this._currentValue);
|
|
199
202
|
const text = this.getFormattedText(currentValue);
|
|
200
203
|
if (text == undefined) {
|
|
201
204
|
return;
|
|
@@ -370,6 +373,7 @@ export class EzSearch {
|
|
|
370
373
|
|| (currentValue == undefined && newOptionsReplaced != undefined && "value" in newOptionsReplaced)) {
|
|
371
374
|
const adjustedOpt = !(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value) ? undefined : newOptionsReplaced;
|
|
372
375
|
this.value = adjustedOpt;
|
|
376
|
+
this._currentValue = adjustedOpt;
|
|
373
377
|
}
|
|
374
378
|
else {
|
|
375
379
|
this.setInputValue();
|
|
@@ -390,7 +394,7 @@ export class EzSearch {
|
|
|
390
394
|
}
|
|
391
395
|
}
|
|
392
396
|
cancelPreselection() {
|
|
393
|
-
if (!this._textInput.value && this.
|
|
397
|
+
if (!this._textInput.value && this._currentValue) {
|
|
394
398
|
this.selectOption(undefined);
|
|
395
399
|
}
|
|
396
400
|
else {
|
|
@@ -411,6 +415,7 @@ export class EzSearch {
|
|
|
411
415
|
}
|
|
412
416
|
clearSearch() {
|
|
413
417
|
this.value = null;
|
|
418
|
+
this._currentValue = null;
|
|
414
419
|
}
|
|
415
420
|
controlListWithOnlyOne() {
|
|
416
421
|
var _a, _b;
|
|
@@ -440,11 +445,11 @@ export class EzSearch {
|
|
|
440
445
|
if (StringUtils.isEmpty(this.value)) {
|
|
441
446
|
return;
|
|
442
447
|
}
|
|
443
|
-
|
|
444
|
-
if (typeof value === "object") {
|
|
448
|
+
if (!this.validateNewValue(this.value, this._currentValue)) {
|
|
445
449
|
return;
|
|
446
450
|
}
|
|
447
|
-
|
|
451
|
+
let value = this.value;
|
|
452
|
+
if (typeof value === "object") {
|
|
448
453
|
return;
|
|
449
454
|
}
|
|
450
455
|
this.loadDescriptionValue(value);
|
|
@@ -481,8 +486,8 @@ export class EzSearch {
|
|
|
481
486
|
this.showNoResultMessage();
|
|
482
487
|
return;
|
|
483
488
|
}
|
|
484
|
-
this.
|
|
485
|
-
this.value =
|
|
489
|
+
this._currentValue = value ? Object.assign(Object.assign({}, value), { value: this.replaceHighlight(value.value), label: this.replaceHighlight(value.label) }) : value;
|
|
490
|
+
this.value = this._currentValue;
|
|
486
491
|
}
|
|
487
492
|
loadOptionValue(argument) {
|
|
488
493
|
var _a;
|
|
@@ -541,6 +546,7 @@ export class EzSearch {
|
|
|
541
546
|
this.validateDescriptionValue();
|
|
542
547
|
}
|
|
543
548
|
componentDidLoad() {
|
|
549
|
+
this._currentValue = this.value;
|
|
544
550
|
CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
545
551
|
this.setInputValue(false);
|
|
546
552
|
this._resizeObserver = new ResizeObserver((entries) => {
|
|
@@ -584,7 +590,7 @@ export class EzSearch {
|
|
|
584
590
|
if (argument) {
|
|
585
591
|
this._showLoading = false;
|
|
586
592
|
this.clearSource();
|
|
587
|
-
if (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch) {
|
|
593
|
+
if (this.ignoreLimitCharsToSearch || !isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch) {
|
|
588
594
|
this._showLoading = true;
|
|
589
595
|
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
590
596
|
this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
|
|
@@ -43,15 +43,19 @@ button {
|
|
|
43
43
|
box-shadow: var(--ez-sidebar-button--box-shadow);
|
|
44
44
|
padding: 0;
|
|
45
45
|
cursor: pointer;
|
|
46
|
+
align-items: center;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
span {
|
|
49
50
|
width: var(--ez-sidebar-button--width);
|
|
50
51
|
height: var(--ez-sidebar-button--height);
|
|
51
|
-
margin: var(--ez-sidebar-button--space--medium)
|
|
52
|
+
margin: var(--ez-sidebar-button--space--medium) 0 var(--ez-sidebar-button--space--medium) 0;
|
|
52
53
|
background: var(--ez-sidebar-button--background-color--primary);
|
|
53
54
|
border-radius: 0 var(--ez-sidebar-button--border--radius-small) var(--ez-sidebar-button--border--radius-small) 0;
|
|
54
55
|
}
|
|
56
|
+
ez-icon {
|
|
57
|
+
--ez-icon--color: var(--ez-sidebar-button--background-color--primary);
|
|
58
|
+
}
|
|
55
59
|
|
|
56
60
|
button:hover {
|
|
57
61
|
box-shadow: var(--ez-sidebar-button--hover--box-shadow);
|
|
@@ -59,5 +63,5 @@ button:hover {
|
|
|
59
63
|
|
|
60
64
|
button:hover span {
|
|
61
65
|
width: var(--ez-sidebar-button--hover--width);
|
|
62
|
-
margin: var(--ez-sidebar-button--space--medium)
|
|
66
|
+
margin: var(--ez-sidebar-button--space--medium) 0 var(--ez-sidebar-button--space--medium) 0;
|
|
63
67
|
}
|
|
@@ -11,7 +11,7 @@ export class EzSidebarButton {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
return (h("button", { type: "button", onClick: () => { this.ezClick.emit(); }, ref: (el) => this._button = el }, h("span", null)));
|
|
14
|
+
return (h("button", { type: "button", onClick: () => { this.ezClick.emit(); }, ref: (el) => this._button = el }, h("span", null), h("ez-icon", { iconName: "chevron-right" })));
|
|
15
15
|
}
|
|
16
16
|
static get is() { return "ez-sidebar-button"; }
|
|
17
17
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
/* Label Container */
|
|
3
|
+
/*@doc Define o espaçamento da esquerda do container*/
|
|
4
|
+
--ez-sidebar-navigator--padding-left: var(--space--xs, 12px);
|
|
5
|
+
/*@doc Define o espaçamento da direita do container*/
|
|
6
|
+
--ez-sidebar-navigator--padding-right: var(--space--xs, 12px);
|
|
7
|
+
/*@doc Define o espaçamento entre o cabeçalho conteúdo e rodapé*/
|
|
8
|
+
--ez-sidebar-navigator--gap: var(--space--xs, 12px);
|
|
9
|
+
/*@doc Define a cor de shadow box do container de label*/
|
|
10
|
+
--ez-sidebar-navigator--box-shadow: var(--shadow, 0px 0px 24px 0px #000);
|
|
11
|
+
/*@doc Define a cor de fundo do container de label*/
|
|
12
|
+
--ez-sidebar-navigator--background-color: var(--color--inverted);
|
|
13
|
+
/*@doc Define o border radius do container de label*/
|
|
14
|
+
--ez-sidebar-navigator--border-radius: 0px var(--border--radius-medium) var(--border--radius-medium) 0px;
|
|
15
|
+
/*@doc Força uma altura especifica para o sidebar, o padrão é 100% da tela*/
|
|
16
|
+
--ez-sidebar-navigator--height: calc(100vh - var(--space--lg, 24px));
|
|
17
|
+
|
|
18
|
+
/*Labels Header */
|
|
19
|
+
/*@doc Define o espaçamento entre os componente do cabeçalho*/
|
|
20
|
+
--ez-sidebar-navigator--header-gap: var(--space--xs, 12px);
|
|
21
|
+
|
|
22
|
+
/*Labels Footer */
|
|
23
|
+
/*@doc Define o espaçamento entre os componente do rodadé*/
|
|
24
|
+
--ez-sidebar-navigator--footer-gap: var(--space--xs, 12px);
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/* Title */
|
|
28
|
+
/*@doc Define a fonte do título do componente */
|
|
29
|
+
--ez-ez-sidebar-navigator__title--font-family: var(--font-pattern, "Roboto");
|
|
30
|
+
/*@doc Define o tamanho da fonte do título do componente.*/
|
|
31
|
+
--ez-ez-sidebar-navigator__title--font-size: var(--title--medium, 16px);
|
|
32
|
+
/*@doc Define a cor da fonte do título do componente.*/
|
|
33
|
+
--ez-ez-sidebar-navigator__title--color: var(--title--primary, #2b3a54);
|
|
34
|
+
/*@doc Define o peso da fonte do título do componente.*/
|
|
35
|
+
--ez-ez-sidebar-navigator__title--font-weight: var(--text-weight--extra-large, 700);
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.inverted {
|
|
40
|
+
/* private */
|
|
41
|
+
transform: rotate(180deg);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ez-sidebar-navigator {
|
|
45
|
+
/* private */
|
|
46
|
+
display: -webkit-box;
|
|
47
|
+
display: -ms-flexbox;
|
|
48
|
+
display: flex;
|
|
49
|
+
-webkit-box-orient: vertical;
|
|
50
|
+
-webkit-box-direction: normal;
|
|
51
|
+
-ms-flex-direction: column;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
height: var(--ez-sidebar-navigator--height);
|
|
54
|
+
padding-top: var(--space--xs, 12px);
|
|
55
|
+
padding-bottom: var(--space--xs, 12px);
|
|
56
|
+
|
|
57
|
+
/* public */
|
|
58
|
+
gap: var(--ez-sidebar-navigator--gap);
|
|
59
|
+
padding-left: var(--ez-sidebar-navigator--padding-left);
|
|
60
|
+
padding-right: var(--ez-sidebar-navigator--padding-right);
|
|
61
|
+
background-color: var(--ez-sidebar-navigator--background-color);
|
|
62
|
+
-webkit-box-shadow: var(--ez-sidebar-navigator--box-shadow);
|
|
63
|
+
box-shadow: var(--ez-sidebar-navigator--box-shadow);
|
|
64
|
+
border-radius: var(--ez-sidebar-navigator--border-radius);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ez-sidebar-navigator__header {
|
|
68
|
+
/* private */
|
|
69
|
+
display: -webkit-box;
|
|
70
|
+
display: -ms-flexbox;
|
|
71
|
+
display: flex;
|
|
72
|
+
-webkit-box-align: center;
|
|
73
|
+
-ms-flex-align: center;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: space-between;
|
|
76
|
+
|
|
77
|
+
/* public */
|
|
78
|
+
gap: var(--ez-sidebar-navigator--header-gap);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ez-sidebar-navigator__content {
|
|
82
|
+
height: 100%;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ez-sidebar-navigator__footer {
|
|
86
|
+
/* private */
|
|
87
|
+
display: -webkit-box;
|
|
88
|
+
display: -ms-flexbox;
|
|
89
|
+
display: flex;
|
|
90
|
+
-webkit-box-align: center;
|
|
91
|
+
-ms-flex-align: center;
|
|
92
|
+
align-items: center;
|
|
93
|
+
|
|
94
|
+
/* public */
|
|
95
|
+
gap: var(--ez-sidebar-navigator--footer-gap);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ez-sidebar-navigator__title {
|
|
99
|
+
/* private */
|
|
100
|
+
white-space: nowrap;
|
|
101
|
+
text-overflow: ellipsis;
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
|
|
104
|
+
/* public */
|
|
105
|
+
font-family: var(--ez-ez-sidebar-navigator__title--font-family);
|
|
106
|
+
font-size: var(--ez-ez-sidebar-navigator__title--font-size);
|
|
107
|
+
font-weight: var(--ez-ez-sidebar-navigator__title--font-weight);
|
|
108
|
+
color: var(--ez-ez-sidebar-navigator__title--color);
|
|
109
|
+
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ez-sidebar-navigator__end {
|
|
113
|
+
/* private */
|
|
114
|
+
display: -webkit-box;
|
|
115
|
+
display: -ms-flexbox;
|
|
116
|
+
display: flex;
|
|
117
|
+
-webkit-box-align: center;
|
|
118
|
+
-ms-flex-align: center;
|
|
119
|
+
align-items: center;
|
|
120
|
+
margin-left: auto;
|
|
121
|
+
/* public */
|
|
122
|
+
gap: var(--ez-sidebar-navigator--gap);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.dynamic {
|
|
126
|
+
position: absolute;
|
|
127
|
+
z-index: var(--most-visible , 4);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.fixed {
|
|
131
|
+
position: relative;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.hidden {
|
|
135
|
+
display: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.show {
|
|
139
|
+
animation: fadeIn .1s ease-in-out 1;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@keyframes fadeIn {
|
|
143
|
+
from {
|
|
144
|
+
transform: translate(-100%);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.sm {
|
|
149
|
+
/* private */
|
|
150
|
+
width: 240px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.md {
|
|
154
|
+
/* private */
|
|
155
|
+
width: 280px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.lg {
|
|
159
|
+
/* private */
|
|
160
|
+
width: 320px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@media screen and (max-width: 991px) {
|
|
164
|
+
.responsive {
|
|
165
|
+
/* private */
|
|
166
|
+
width: 240px;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
@media screen and (min-width: 992px) {
|
|
170
|
+
.responsive {
|
|
171
|
+
/* private */
|
|
172
|
+
width: 280px;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
@media screen and (min-width: 1200px) {
|
|
176
|
+
.responsive {
|
|
177
|
+
/* private */
|
|
178
|
+
width: 320px;
|
|
179
|
+
}
|
|
180
|
+
}
|