@sankhyalabs/ezui 5.21.2 → 5.22.0-dev.2
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 +34 -3
- package/dist/cjs/ez-form.cjs.entry.js +77 -2
- package/dist/cjs/ez-grid.cjs.entry.js +313 -39
- package/dist/cjs/ez-list.cjs.entry.js +10 -2
- 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 +39 -32
- 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-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-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 +35 -1
- 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 +237 -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-number-input/ez-number-input.js +46 -31
- package/dist/collection/components/ez-search/ez-search.js +38 -32
- 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/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 +26 -0
- 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 +1147 -117
- 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 +34 -3
- package/dist/esm/ez-form.entry.js +78 -3
- package/dist/esm/ez-grid.entry.js +313 -39
- package/dist/esm/ez-list.entry.js +10 -2
- 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 +39 -32
- package/dist/esm/ez-sidebar-navigator.entry.js +88 -0
- package/dist/esm/ez-split-item.entry.js +1 -0
- 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-12ae1104.entry.js +1 -0
- package/dist/ezui/p-2097d0cf.entry.js +1 -0
- package/dist/ezui/p-3b4eeeb6.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-5056284a.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-fbee26ec.entry.js → p-816cece6.entry.js} +2 -2
- 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-9ab22a07.entry.js +1 -0
- package/dist/ezui/p-a31b9c90.entry.js +1 -0
- package/dist/ezui/p-bcb53f27.entry.js +1 -0
- package/dist/ezui/p-ecc2c1ec.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-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 +35 -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-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.d.ts +334 -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 +3 -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-637f69f2.entry.js +0 -1
- package/dist/ezui/p-786559c5.entry.js +0 -1
- package/dist/ezui/p-7c770f14.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
|
@@ -17,6 +17,7 @@ const EzNumberInput = class {
|
|
|
17
17
|
this._focused = false;
|
|
18
18
|
this._changePending = false;
|
|
19
19
|
this._valuePromiseCallbacks = [];
|
|
20
|
+
this._value = undefined;
|
|
20
21
|
this.label = undefined;
|
|
21
22
|
this.value = undefined;
|
|
22
23
|
this.enabled = true;
|
|
@@ -72,35 +73,42 @@ const EzNumberInput = class {
|
|
|
72
73
|
}
|
|
73
74
|
observeValue(newValue, oldValue) {
|
|
74
75
|
if (this._textInput && newValue != oldValue) {
|
|
75
|
-
|
|
76
|
-
const oldValueValidated = this.validateValue(oldValue);
|
|
77
|
-
if (newValueValidated === null) {
|
|
78
|
-
this._textInput.value = '';
|
|
79
|
-
}
|
|
80
|
-
if (newValueValidated != oldValueValidated) {
|
|
81
|
-
const textValue = this.getTextValue(newValueValidated) || '';
|
|
82
|
-
if ((this._textInput.value || '') !== textValue) {
|
|
83
|
-
const parsedNumber = this.getParsedNumber(textValue);
|
|
84
|
-
if (parsedNumber !== undefined || !this._focused) {
|
|
85
|
-
this._textInput.value = textValue;
|
|
86
|
-
this._focused = false;
|
|
87
|
-
this.errorMessage = "";
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
const valueEmitted = newValueValidated === null ? undefined : newValueValidated;
|
|
91
|
-
this.ezChange.emit(valueEmitted);
|
|
92
|
-
}
|
|
76
|
+
this.handleNewValue(newValue, oldValue);
|
|
93
77
|
}
|
|
94
78
|
this._changePending = false;
|
|
95
79
|
}
|
|
80
|
+
observePrecision() {
|
|
81
|
+
if (this._textInput) {
|
|
82
|
+
this.setInputValue();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
handleNewValue(newValue, oldValue) {
|
|
86
|
+
const newValueValidated = this.validateValue(newValue);
|
|
87
|
+
const oldValueValidated = this.validateValue(oldValue);
|
|
88
|
+
if (newValueValidated === null) {
|
|
89
|
+
this._value = '';
|
|
90
|
+
}
|
|
91
|
+
if (newValueValidated === oldValueValidated) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const textValue = this.getTextValue(newValueValidated) || '';
|
|
95
|
+
const parsedNumber = this.getParsedNumber(textValue);
|
|
96
|
+
if ((this._value || '') !== textValue && (parsedNumber !== undefined || !this._focused)) {
|
|
97
|
+
this._value = textValue;
|
|
98
|
+
this._focused = false;
|
|
99
|
+
this.errorMessage = "";
|
|
100
|
+
}
|
|
101
|
+
const valueEmitted = newValueValidated === null ? undefined : newValueValidated;
|
|
102
|
+
this.ezChange.emit(valueEmitted);
|
|
103
|
+
}
|
|
96
104
|
validateValue(value) {
|
|
97
105
|
return isNaN(value) || value === undefined ? null : value;
|
|
98
106
|
}
|
|
99
107
|
getTextValue(value) {
|
|
100
|
-
if (value
|
|
101
|
-
return
|
|
102
|
-
|
|
103
|
-
return
|
|
108
|
+
if (value == undefined)
|
|
109
|
+
return undefined;
|
|
110
|
+
let textValue = this.precision >= 0 ? core.NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
|
|
111
|
+
return (this.precision === 0) ? core.StringUtils.replaceAll(textValue, ".", "") : textValue;
|
|
104
112
|
}
|
|
105
113
|
changeValue(newValue) {
|
|
106
114
|
this.errorMessage = "";
|
|
@@ -151,17 +159,13 @@ const EzNumberInput = class {
|
|
|
151
159
|
this.ezStartChange.emit({ waitmessage: "", blocking: false });
|
|
152
160
|
}
|
|
153
161
|
}
|
|
154
|
-
getParsedNumber(value) {
|
|
155
|
-
var _a;
|
|
156
|
-
if (value === void 0) {
|
|
157
|
-
value = (_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value;
|
|
158
|
-
}
|
|
162
|
+
getParsedNumber(value = this._textInput.value) {
|
|
159
163
|
return (value === null || value === void 0 ? void 0 : value.trim()) ? core.NumberUtils.stringToNumber(value) : undefined;
|
|
160
164
|
}
|
|
161
165
|
setInputValue() {
|
|
162
166
|
const textValue = this.getTextValue(this.value) || '';
|
|
163
|
-
if ((this.
|
|
164
|
-
this.
|
|
167
|
+
if ((this._value || '') !== textValue) {
|
|
168
|
+
this._value = textValue;
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
171
|
componentDidLoad() {
|
|
@@ -170,13 +174,15 @@ const EzNumberInput = class {
|
|
|
170
174
|
}
|
|
171
175
|
render() {
|
|
172
176
|
core.ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
173
|
-
return (index.h("ez-text-input", { class: "number__input", "data-element-id": core.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 }));
|
|
177
|
+
return (index.h("ez-text-input", { class: "number__input", "data-element-id": core.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 }));
|
|
174
178
|
}
|
|
175
179
|
get _elem() { return index.getElement(this); }
|
|
176
180
|
static get watchers() { return {
|
|
177
181
|
"label": ["observeLabel"],
|
|
178
182
|
"errorMessage": ["observeErrorMessage"],
|
|
179
|
-
"value": ["observeValue"]
|
|
183
|
+
"value": ["observeValue"],
|
|
184
|
+
"precision": ["observePrecision"],
|
|
185
|
+
"prettyPrecision": ["observePrecision"]
|
|
180
186
|
}; }
|
|
181
187
|
};
|
|
182
188
|
EzNumberInput.style = ezNumberInputCss;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-a7b0c73d.js');
|
|
6
|
+
const core = require('@sankhyalabs/core');
|
|
7
|
+
const EzScrollDirection = require('./EzScrollDirection-b2c99895.js');
|
|
8
|
+
|
|
9
|
+
const ezScrollerCss = ":host{--ez-scroller--box-shadow-color:var(--background--body, #fafcff);--ez-scroller__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-scroller__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-scroller__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-scroller__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-scroller__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-scroller__scrollbar--width:var(--space--small, 6px);--ez-scroller__max-height:unset;display:flex;cursor:grab;width:100%;overflow:hidden}.dragging{cursor:grabbing}.ez-scroller__container{display:flex;overflow-y:hidden;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:transparent transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked),.ez-scroller__container:not(.ez-scroller__container--locked):hover{scrollbar-color:var(--ez-scroller__scrollbar--color-clicked) var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container--both{overflow-y:scroll;overflow-x:scroll;flex-wrap:wrap}.ez-scroller__container--horizontal{overflow-x:scroll;flex-direction:row}.ez-scroller__container--vertical{overflow-y:scroll;flex-direction:column;max-height:var(--ez-scroller__max-height)}.ez-scroller__container::-webkit-scrollbar{background-color:transparent;width:var(--ez-scroller__scrollbar--width);height:var(--ez-scroller__scrollbar--width);max-width:var(--ez-scroller__scrollbar--width);min-width:var(--ez-scroller__scrollbar--width)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar{background-color:var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container::-webkit-scrollbar-track{visibility:hidden;background-color:transparent;border-radius:var(--ez-scroller__scrollbar--border-radius)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-track,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-track{background-color:var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container::-webkit-scrollbar-thumb{background-color:transparent;border-radius:var(--ez-scroller__scrollbar--border-radius)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb{background-color:var(--ez-scroller__scrollbar--color-default)}.ez-scroller__container::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container::-webkit-scrollbar-thumb:horizontal:hover{background-color:transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:horizontal:hover,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-scroller__scrollbar--color-hover)}.ez-scroller__container::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container::-webkit-scrollbar-thumb:horizontal:active{background-color:transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:horizontal:active,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-scroller__scrollbar--color-clicked)}.ez-scroller__wrapper{display:flex;position:relative;width:100%;height:auto}.ez-scroller__wrapper--horizontal{flex-direction:row}.ez-scroller__wrapper--vertical{flex-direction:column}.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--shadow-end::after{content:\"\";display:flex;position:absolute;z-index:1}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-end::after{width:24px;min-height:calc(100% - 10px)}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-start::before{left:0;background:linear-gradient(to right, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-end::after{right:0;background:linear-gradient(to left, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-end::after{min-width:calc(100% - 10px);height:24px}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-start::before{top:0;background:linear-gradient(to bottom, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-end::after{bottom:0;background:linear-gradient(to top, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}";
|
|
10
|
+
|
|
11
|
+
const EzScroller = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this._shadowStart = "ez-scroller__wrapper--shadow-start";
|
|
15
|
+
this._shadowEnd = "ez-scroller__wrapper--shadow-end";
|
|
16
|
+
this.isActive = false;
|
|
17
|
+
this.direction = undefined;
|
|
18
|
+
this.locked = false;
|
|
19
|
+
this.activeShadow = false;
|
|
20
|
+
}
|
|
21
|
+
//---------------------------------------------
|
|
22
|
+
// Private methods
|
|
23
|
+
//---------------------------------------------
|
|
24
|
+
getContainerClass() {
|
|
25
|
+
return `ez-scroller__container ez-scroller__container--${this.direction}
|
|
26
|
+
${this.locked || !this.isActive ? " ez-scroller__container--locked" : ""}
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
getWrapperClass() {
|
|
30
|
+
return `ez-scroller__wrapper ez-scroller__wrapper--${this.direction}`;
|
|
31
|
+
}
|
|
32
|
+
finishDrag() {
|
|
33
|
+
if (this._controller) {
|
|
34
|
+
this._container.classList.remove("dragging");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
updateScroller() {
|
|
38
|
+
const container = this._container;
|
|
39
|
+
if (container == undefined) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
let remainingScroll;
|
|
43
|
+
if (this.direction === EzScrollDirection.EzScrollDirection.HORIZONTAL) {
|
|
44
|
+
const { scrollWidth, clientWidth, scrollLeft } = container;
|
|
45
|
+
remainingScroll = scrollWidth - clientWidth - Math.ceil(scrollLeft);
|
|
46
|
+
this._startHidden = container.scrollLeft > 0;
|
|
47
|
+
}
|
|
48
|
+
else if (this.direction === EzScrollDirection.EzScrollDirection.VERTICAL) {
|
|
49
|
+
const { scrollHeight, clientHeight, scrollTop } = container;
|
|
50
|
+
remainingScroll = scrollHeight - clientHeight - Math.ceil(scrollTop);
|
|
51
|
+
this._startHidden = container.scrollTop > 0;
|
|
52
|
+
}
|
|
53
|
+
this._endHidden = remainingScroll > 0;
|
|
54
|
+
this.isActive = this._startHidden || this._endHidden || this.isActiveScroller();
|
|
55
|
+
this.updateShadow();
|
|
56
|
+
}
|
|
57
|
+
updateShadow() {
|
|
58
|
+
const wrapper = this._wrapper;
|
|
59
|
+
if (!this.activeShadow || wrapper == undefined) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const shadowPositions = ["", "start", "end", "middle"];
|
|
63
|
+
const currentPosition = shadowPositions[Number(this._startHidden) | Number(this._endHidden) << 1];
|
|
64
|
+
if (currentPosition === "start") {
|
|
65
|
+
wrapper.classList.add(this._shadowStart);
|
|
66
|
+
wrapper.classList.remove(this._shadowEnd);
|
|
67
|
+
}
|
|
68
|
+
else if (currentPosition === "end") {
|
|
69
|
+
wrapper.classList.remove(this._shadowStart);
|
|
70
|
+
wrapper.classList.add(this._shadowEnd);
|
|
71
|
+
}
|
|
72
|
+
else if (currentPosition === "middle") {
|
|
73
|
+
wrapper.classList.add(this._shadowStart);
|
|
74
|
+
wrapper.classList.add(this._shadowEnd);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
wrapper.classList.remove(this._shadowStart);
|
|
78
|
+
wrapper.classList.remove(this._shadowEnd);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
configResize() {
|
|
82
|
+
const container = this._container;
|
|
83
|
+
if (container == undefined) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (this._resizeObserver != undefined) {
|
|
87
|
+
this._resizeObserver.unobserve(container);
|
|
88
|
+
}
|
|
89
|
+
this._resizeObserver = new ResizeObserver(core.JSUtils.debounce(this.updateScroller.bind(this), 200));
|
|
90
|
+
this._resizeObserver.observe(container);
|
|
91
|
+
}
|
|
92
|
+
getContainerElement() {
|
|
93
|
+
return index.h("div", { ref: ref => this._container = ref, class: this.getContainerClass() }, index.h("slot", null));
|
|
94
|
+
}
|
|
95
|
+
isActiveScroller() {
|
|
96
|
+
if (this._container == undefined) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
return this._container.scrollWidth > this._container.clientWidth
|
|
100
|
+
|| this._container.scrollHeight > this._container.clientHeight;
|
|
101
|
+
}
|
|
102
|
+
//---------------------------------------------
|
|
103
|
+
// Event handlers
|
|
104
|
+
//---------------------------------------------
|
|
105
|
+
clickListener(evt) {
|
|
106
|
+
if (this._controller && this._controller.didScroll()) {
|
|
107
|
+
evt.preventDefault();
|
|
108
|
+
evt.stopPropagation();
|
|
109
|
+
evt.stopImmediatePropagation();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
mouseDownHandler(evt) {
|
|
113
|
+
if (this.locked) {
|
|
114
|
+
this.finishDrag();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (!this._controller) {
|
|
118
|
+
this._controller = new ScrollCtrl(this._container);
|
|
119
|
+
}
|
|
120
|
+
this._controller.startDragg(evt);
|
|
121
|
+
this._container.classList.add("dragging");
|
|
122
|
+
}
|
|
123
|
+
mouseUpHandler() {
|
|
124
|
+
this.finishDrag();
|
|
125
|
+
}
|
|
126
|
+
mouseMoveHandler(evt) {
|
|
127
|
+
if (this.locked) {
|
|
128
|
+
this.finishDrag();
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (this._controller) {
|
|
132
|
+
if (evt.buttons === 0) {
|
|
133
|
+
this.finishDrag();
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
this._controller.doScroll(evt);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
componentDidRender() {
|
|
141
|
+
var _a, _b;
|
|
142
|
+
if (this._container == undefined) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (this.direction === EzScrollDirection.EzScrollDirection.BOTH) {
|
|
146
|
+
(_a = this._wrapper) === null || _a === void 0 ? void 0 : _a.classList.remove(this._shadowStart);
|
|
147
|
+
(_b = this._wrapper) === null || _b === void 0 ? void 0 : _b.classList.remove(this._shadowEnd);
|
|
148
|
+
this.isActive = this.isActiveScroller();
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this._container.onscroll = this.updateScroller.bind(this);
|
|
152
|
+
this.configResize();
|
|
153
|
+
this.updateScroller();
|
|
154
|
+
}
|
|
155
|
+
render() {
|
|
156
|
+
return (index.h(index.Host, null, this.activeShadow
|
|
157
|
+
? index.h("div", { ref: ref => this._wrapper = ref, class: this.getWrapperClass() }, this.getContainerElement())
|
|
158
|
+
: this.getContainerElement()));
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
class ScrollCtrl {
|
|
162
|
+
constructor(scrollablePanel) {
|
|
163
|
+
this.scrollablePanel = scrollablePanel;
|
|
164
|
+
}
|
|
165
|
+
startDragg(evt) {
|
|
166
|
+
this.startX = this.measureX(evt);
|
|
167
|
+
this.startY = this.measureY(evt);
|
|
168
|
+
this.scrollWidth = 0;
|
|
169
|
+
this.scrollHeight = 0;
|
|
170
|
+
}
|
|
171
|
+
measureX(e) {
|
|
172
|
+
return e.pageX - this.scrollablePanel.offsetLeft;
|
|
173
|
+
}
|
|
174
|
+
measureY(e) {
|
|
175
|
+
return e.pageY - this.scrollablePanel.offsetTop;
|
|
176
|
+
}
|
|
177
|
+
doScroll(e) {
|
|
178
|
+
const x = this.measureX(e);
|
|
179
|
+
const y = this.measureY(e);
|
|
180
|
+
if (x != this.startX || y != this.startY) {
|
|
181
|
+
const scrollX = x - this.startX;
|
|
182
|
+
const scrollY = y - this.startY;
|
|
183
|
+
this.startX += scrollX;
|
|
184
|
+
this.startY += scrollY;
|
|
185
|
+
this.scrollWidth += Math.abs(scrollX);
|
|
186
|
+
this.scrollHeight += Math.abs(scrollY);
|
|
187
|
+
this.scrollablePanel.scrollLeft = Math.max(0, this.scrollablePanel.scrollLeft - scrollX);
|
|
188
|
+
this.scrollablePanel.scrollTop = Math.max(0, this.scrollablePanel.scrollTop - scrollY);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
didScroll() {
|
|
192
|
+
const tollerance = 5;
|
|
193
|
+
return this.scrollHeight > tollerance || this.scrollWidth > tollerance;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
EzScroller.style = ezScrollerCss;
|
|
197
|
+
|
|
198
|
+
const ezSidebarButtonCss = ":host{position:relative;--ez-sidebar-button--width:6px;--ez-sidebar-button--hover--width:12px;--ez-sidebar-button--height:96px;--ez-sidebar-button--background-color--xlight:var(--background--xlight, #fff);--ez-sidebar-button--background-color--primary:var(--color--primary);--ez-sidebar-button--space--small:var(--space--small, 6px);--ez-sidebar-button--space--medium:var(--space--medium, 12px);--ez-sidebar-button--box-shadow:var(--shadow--small, 0px 0px 16px rgba(0, 38, 111, 0.07));--ez-sidebar-button--hover--box-shadow:var(--shadow--hard, 0px 0px 16px rgba(43, 58, 84, 0.24));--ez-sidebar-button--border--radius-small:var(--border--radius-small);--ez-sidebar-button--border--radius-medium:var(--border--radius-medium)}button{position:absolute;display:flex;background:var(--ez-sidebar-button--background-color--xlight);border:0;border-radius:0 var(--ez-sidebar-button--border--radius-medium) var(--ez-sidebar-button--border--radius-medium) 0;box-shadow:var(--ez-sidebar-button--box-shadow);padding:0;cursor:pointer;align-items:center}span{width:var(--ez-sidebar-button--width);height:var(--ez-sidebar-button--height);margin:var(--ez-sidebar-button--space--medium) 0 var(--ez-sidebar-button--space--medium) 0;background:var(--ez-sidebar-button--background-color--primary);border-radius:0 var(--ez-sidebar-button--border--radius-small) var(--ez-sidebar-button--border--radius-small) 0}ez-icon{--ez-icon--color:var(--ez-sidebar-button--background-color--primary)}button:hover{box-shadow:var(--ez-sidebar-button--hover--box-shadow)}button:hover span{width:var(--ez-sidebar-button--hover--width);margin:var(--ez-sidebar-button--space--medium) 0 var(--ez-sidebar-button--space--medium) 0}";
|
|
199
|
+
|
|
200
|
+
const EzSidebarButton = class {
|
|
201
|
+
constructor(hostRef) {
|
|
202
|
+
index.registerInstance(this, hostRef);
|
|
203
|
+
this.ezClick = index.createEvent(this, "ezClick", 7);
|
|
204
|
+
}
|
|
205
|
+
componentDidLoad() {
|
|
206
|
+
if (this._element) {
|
|
207
|
+
core.ElementIDUtils.addIDInfo(this._element);
|
|
208
|
+
}
|
|
209
|
+
if (this._button) {
|
|
210
|
+
const dataInfo = { id: 'embedded' };
|
|
211
|
+
core.ElementIDUtils.addIDInfo(this._button, 'button', dataInfo);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
render() {
|
|
215
|
+
return (index.h("button", { type: "button", onClick: () => { this.ezClick.emit(); }, ref: (el) => this._button = el }, index.h("span", null), index.h("ez-icon", { iconName: "chevron-right" })));
|
|
216
|
+
}
|
|
217
|
+
get _element() { return index.getElement(this); }
|
|
218
|
+
};
|
|
219
|
+
EzSidebarButton.style = ezSidebarButtonCss;
|
|
220
|
+
|
|
221
|
+
exports.ez_scroller = EzScroller;
|
|
222
|
+
exports.ez_sidebar_button = EzSidebarButton;
|
|
@@ -8,6 +8,7 @@ const core = require('@sankhyalabs/core');
|
|
|
8
8
|
const ApplicationUtils = require('./ApplicationUtils-c9d1205c.js');
|
|
9
9
|
require('./DialogType-2114c337.js');
|
|
10
10
|
require('./CheckMode-ecb90b87.js');
|
|
11
|
+
require('./ICustomRender-6fafffce.js');
|
|
11
12
|
const constants = require('./constants-2714478b.js');
|
|
12
13
|
|
|
13
14
|
const ezSearchCss = ":host{--ez-search--height:42px;--ez-search--width:100%;--ez-search__icon--width:48px;--ez-search--border-radius:var(--border--radius-medium, 12px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-color--xlight:var(--background--xlight, #fff);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-search__input--background-color:var(--background--medium, #e0e0e0);--ez-search__input--border:var(--border--medium, 2px solid);--ez-search__input--border-color:var(--ez-search__input--background-color);--ez-search__input--focus--border-color:var(--color--primary, #008561);--ez-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-search__input--error--border-color:#CC2936;--ez-search__btn--color:var(--title--primary, #2B3A54);--ez-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-search__label--color:var(--title--primary, #2B3A54);--ez-search__list-title--primary:var(--title--primary, #2B3A54);--ez-search__list-text--primary:var(--text--primary, #626e82);--ez-search__list-height:calc(var(--ez-search--font-size) + var(--ez-search--space--medium) + 4px);--ez-search__list-min-width:64px;--ez-search--space--medium:var(--space--medium, 12px);--ez-search--space--small:var(--space--small, 6px);--ez-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-search__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-search--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{min-width:var(--ez-search__list-min-width);overflow:auto;position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:350px;min-width:150px;background-color:var(--ez-search--background-color--xlight);border-radius:var(--ez-search--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-search--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;padding:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-search__scrollbar--color-background);width:var(--ez-search__scrollbar--width);max-width:var(--ez-search__scrollbar--width);min-width:var(--ez-search__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-search__scrollbar--color-background);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-search__scrollbar--color-default);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-search__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-search__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-search--border-radius-small);padding:var(--ez-search--space--small);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size);line-height:var(--ez-search--line-height)}.item__label{font-weight:var(--ez-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-search__list-text--primary);font-weight:var(--ez-search--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-search__list-height)}.message__no-result{color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-search__list-title--primary);border-top:3px solid transparent}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-search__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-search__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-search__btn-disabled--color)}.btn:hover{color:var(--ez-search__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
|
|
@@ -23,7 +24,6 @@ const EzSearch = class {
|
|
|
23
24
|
this._tabPressed = false;
|
|
24
25
|
this._textEmptyList = "Nenhum resultado encontrado";
|
|
25
26
|
this._textEmptySearch = "Nenhum resultado de {0} encontrado";
|
|
26
|
-
this._lookupMode = false;
|
|
27
27
|
this._startHighlightTag = "<span class='card-item__highlight'>";
|
|
28
28
|
this._endHighlightTag = "</span>";
|
|
29
29
|
this._preSelection = undefined;
|
|
@@ -52,36 +52,30 @@ const EzSearch = class {
|
|
|
52
52
|
var _a;
|
|
53
53
|
if (this._textInput) {
|
|
54
54
|
this._textInput.errorMessage = this.errorMessage;
|
|
55
|
-
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
55
|
+
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim()) && this.errorMessage) {
|
|
56
56
|
this.setInputValue();
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const currentValue = this.getSelectedOption(this.value);
|
|
70
|
-
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
71
|
-
this.value = newValueSelected;
|
|
72
|
-
}
|
|
73
|
-
if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
|
|
74
|
-
this.setInputValue();
|
|
75
|
-
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
76
|
-
if (!this._lookupMode) {
|
|
77
|
-
this.ezChange.emit(valueEmitted);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
this.resetOptions();
|
|
60
|
+
validateNewValue(newValue, oldValue) {
|
|
61
|
+
const getValue = (val) => typeof val === 'object' ? val === null || val === void 0 ? void 0 : val.value : val;
|
|
62
|
+
return (getValue(newValue) !== getValue(oldValue));
|
|
63
|
+
}
|
|
64
|
+
async observeValue(newValue, oldValue) {
|
|
65
|
+
if (this._textInput && newValue !== oldValue && this.validateNewValue(newValue, oldValue)) {
|
|
66
|
+
if (typeof newValue === "string") {
|
|
67
|
+
await this.handleValueAsString(newValue);
|
|
68
|
+
return;
|
|
81
69
|
}
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
const newValueSelected = this.getSelectedOption(newValue);
|
|
71
|
+
const currentValue = this.getSelectedOption(this._currentValue);
|
|
72
|
+
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
73
|
+
this._currentValue = newValueSelected;
|
|
74
|
+
this.setInputValue();
|
|
75
|
+
const valueEmitted = newValueSelected !== null && newValueSelected !== void 0 ? newValueSelected : undefined;
|
|
76
|
+
this.ezChange.emit(valueEmitted);
|
|
84
77
|
}
|
|
78
|
+
this.resetOptions();
|
|
85
79
|
}
|
|
86
80
|
}
|
|
87
81
|
observeOptions(newOptions, oldOptions) {
|
|
@@ -148,6 +142,16 @@ const EzSearch = class {
|
|
|
148
142
|
});
|
|
149
143
|
}
|
|
150
144
|
}
|
|
145
|
+
async handleValueAsString(value) {
|
|
146
|
+
if (this.getSelectedOption(value)) {
|
|
147
|
+
this.setInputValue();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
await this.loadDescriptionValue(value);
|
|
151
|
+
this.setInputValue();
|
|
152
|
+
this.ezChange.emit(this.value);
|
|
153
|
+
this._currentValue = this.value;
|
|
154
|
+
}
|
|
151
155
|
updateListPosition() {
|
|
152
156
|
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
153
157
|
const elementRect = this._listWrapper.getBoundingClientRect();
|
|
@@ -203,7 +207,7 @@ const EzSearch = class {
|
|
|
203
207
|
return text;
|
|
204
208
|
}
|
|
205
209
|
getText() {
|
|
206
|
-
const currentValue = this.getSelectedOption(this.
|
|
210
|
+
const currentValue = this.getSelectedOption(this._currentValue);
|
|
207
211
|
const text = this.getFormattedText(currentValue);
|
|
208
212
|
if (text == undefined) {
|
|
209
213
|
return;
|
|
@@ -378,6 +382,7 @@ const EzSearch = class {
|
|
|
378
382
|
|| (currentValue == undefined && newOptionsReplaced != undefined && "value" in newOptionsReplaced)) {
|
|
379
383
|
const adjustedOpt = !(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value) ? undefined : newOptionsReplaced;
|
|
380
384
|
this.value = adjustedOpt;
|
|
385
|
+
this._currentValue = adjustedOpt;
|
|
381
386
|
}
|
|
382
387
|
else {
|
|
383
388
|
this.setInputValue();
|
|
@@ -398,7 +403,7 @@ const EzSearch = class {
|
|
|
398
403
|
}
|
|
399
404
|
}
|
|
400
405
|
cancelPreselection() {
|
|
401
|
-
if (!this._textInput.value && this.
|
|
406
|
+
if (!this._textInput.value && this._currentValue) {
|
|
402
407
|
this.selectOption(undefined);
|
|
403
408
|
}
|
|
404
409
|
else {
|
|
@@ -419,6 +424,7 @@ const EzSearch = class {
|
|
|
419
424
|
}
|
|
420
425
|
clearSearch() {
|
|
421
426
|
this.value = null;
|
|
427
|
+
this._currentValue = null;
|
|
422
428
|
}
|
|
423
429
|
controlListWithOnlyOne() {
|
|
424
430
|
var _a, _b;
|
|
@@ -448,11 +454,11 @@ const EzSearch = class {
|
|
|
448
454
|
if (core.StringUtils.isEmpty(this.value)) {
|
|
449
455
|
return;
|
|
450
456
|
}
|
|
451
|
-
|
|
452
|
-
if (typeof value === "object") {
|
|
457
|
+
if (!this.validateNewValue(this.value, this._currentValue)) {
|
|
453
458
|
return;
|
|
454
459
|
}
|
|
455
|
-
|
|
460
|
+
let value = this.value;
|
|
461
|
+
if (typeof value === "object") {
|
|
456
462
|
return;
|
|
457
463
|
}
|
|
458
464
|
this.loadDescriptionValue(value);
|
|
@@ -489,8 +495,8 @@ const EzSearch = class {
|
|
|
489
495
|
this.showNoResultMessage();
|
|
490
496
|
return;
|
|
491
497
|
}
|
|
492
|
-
this.
|
|
493
|
-
this.value =
|
|
498
|
+
this._currentValue = value ? Object.assign(Object.assign({}, value), { value: this.replaceHighlight(value.value), label: this.replaceHighlight(value.label) }) : value;
|
|
499
|
+
this.value = this._currentValue;
|
|
494
500
|
}
|
|
495
501
|
loadOptionValue(argument) {
|
|
496
502
|
var _a;
|
|
@@ -549,6 +555,7 @@ const EzSearch = class {
|
|
|
549
555
|
this.validateDescriptionValue();
|
|
550
556
|
}
|
|
551
557
|
componentDidLoad() {
|
|
558
|
+
this._currentValue = this.value;
|
|
552
559
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
553
560
|
this.setInputValue(false);
|
|
554
561
|
this._resizeObserver = new ResizeObserver((entries) => {
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-a7b0c73d.js');
|
|
6
|
+
const core = require('@sankhyalabs/core');
|
|
7
|
+
const EzScrollDirection = require('./EzScrollDirection-b2c99895.js');
|
|
8
|
+
|
|
9
|
+
var ModeMenuEnum;
|
|
10
|
+
(function (ModeMenuEnum) {
|
|
11
|
+
ModeMenuEnum["FLOAT"] = "float";
|
|
12
|
+
ModeMenuEnum["FIXED"] = "fixed";
|
|
13
|
+
})(ModeMenuEnum || (ModeMenuEnum = {}));
|
|
14
|
+
|
|
15
|
+
var SizeMenuEnum;
|
|
16
|
+
(function (SizeMenuEnum) {
|
|
17
|
+
SizeMenuEnum["SMALL"] = "sm";
|
|
18
|
+
SizeMenuEnum["MEDIUM"] = "md";
|
|
19
|
+
SizeMenuEnum["LARGE"] = "lg";
|
|
20
|
+
})(SizeMenuEnum || (SizeMenuEnum = {}));
|
|
21
|
+
|
|
22
|
+
var TypeMenuEnum;
|
|
23
|
+
(function (TypeMenuEnum) {
|
|
24
|
+
TypeMenuEnum["FLOAT"] = "float";
|
|
25
|
+
TypeMenuEnum["FIXED"] = "fixed";
|
|
26
|
+
TypeMenuEnum["DYNAMIC"] = "dynamic";
|
|
27
|
+
})(TypeMenuEnum || (TypeMenuEnum = {}));
|
|
28
|
+
|
|
29
|
+
const MESSAGES = {
|
|
30
|
+
HIDE_MENU: 'Ocultar menu',
|
|
31
|
+
UN_PIN_MENU: 'Desafixar menu',
|
|
32
|
+
PUSH_PIN_MENU: 'Fixar menu',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const ezSidebarNavigatorCss = ":host{--ez-sidebar-navigator--padding-left:var(--space--xs, 12px);--ez-sidebar-navigator--padding-right:var(--space--xs, 12px);--ez-sidebar-navigator--gap:var(--space--xs, 12px);--ez-sidebar-navigator--box-shadow:var(--shadow, 0px 0px 24px 0px #000);--ez-sidebar-navigator--background-color:var(--color--inverted);--ez-sidebar-navigator--border-radius:0px var(--border--radius-medium) var(--border--radius-medium) 0px;--ez-sidebar-navigator--height:calc(100vh - var(--space--lg, 24px));--ez-sidebar-navigator--header-gap:var(--space--xs, 12px);--ez-sidebar-navigator--footer-gap:var(--space--xs, 12px);--ez-ez-sidebar-navigator__title--font-family:var(--font-pattern, \"Roboto\");--ez-ez-sidebar-navigator__title--font-size:var(--title--medium, 16px);--ez-ez-sidebar-navigator__title--color:var(--title--primary, #2b3a54);--ez-ez-sidebar-navigator__title--font-weight:var(--text-weight--extra-large, 700)}.inverted{transform:rotate(180deg)}.ez-sidebar-navigator{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:var(--ez-sidebar-navigator--height);padding-top:var(--space--xs, 12px);padding-bottom:var(--space--xs, 12px);gap:var(--ez-sidebar-navigator--gap);padding-left:var(--ez-sidebar-navigator--padding-left);padding-right:var(--ez-sidebar-navigator--padding-right);background-color:var(--ez-sidebar-navigator--background-color);-webkit-box-shadow:var(--ez-sidebar-navigator--box-shadow);box-shadow:var(--ez-sidebar-navigator--box-shadow);border-radius:var(--ez-sidebar-navigator--border-radius)}.ez-sidebar-navigator__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;justify-content:space-between;gap:var(--ez-sidebar-navigator--header-gap)}.ez-sidebar-navigator__content{height:100%}.ez-sidebar-navigator__footer{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:var(--ez-sidebar-navigator--footer-gap)}.ez-sidebar-navigator__title{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-family:var(--ez-ez-sidebar-navigator__title--font-family);font-size:var(--ez-ez-sidebar-navigator__title--font-size);font-weight:var(--ez-ez-sidebar-navigator__title--font-weight);color:var(--ez-ez-sidebar-navigator__title--color)}.ez-sidebar-navigator__end{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-left:auto;gap:var(--ez-sidebar-navigator--gap)}.dynamic{position:absolute;z-index:var(--most-visible\t, 4)}.fixed{position:relative}.hidden{display:none}.show{animation:fadeIn .1s ease-in-out 1}@keyframes fadeIn{from{transform:translate(-100%)}}.sm{width:240px}.md{width:280px}.lg{width:320px}@media screen and (max-width: 991px){.responsive{width:240px}}@media screen and (min-width: 992px){.responsive{width:280px}}@media screen and (min-width: 1200px){.responsive{width:320px}}";
|
|
36
|
+
|
|
37
|
+
const EzSidebarNavigator = class {
|
|
38
|
+
constructor(hostRef) {
|
|
39
|
+
index.registerInstance(this, hostRef);
|
|
40
|
+
this.ezChangeMode = index.createEvent(this, "ezChangeMode", 7);
|
|
41
|
+
this.handleToggleSidebar = () => {
|
|
42
|
+
this.open = !this.open;
|
|
43
|
+
};
|
|
44
|
+
this.handleToggleMode = () => {
|
|
45
|
+
this.mode = this.mode === ModeMenuEnum.FIXED ? ModeMenuEnum.FLOAT : ModeMenuEnum.FIXED;
|
|
46
|
+
this.ezChangeMode.emit(this.mode);
|
|
47
|
+
};
|
|
48
|
+
this.type = TypeMenuEnum.DYNAMIC;
|
|
49
|
+
this.mode = ModeMenuEnum.FLOAT;
|
|
50
|
+
this.size = SizeMenuEnum.SMALL;
|
|
51
|
+
this.isResponsive = false;
|
|
52
|
+
this.titleMenu = "";
|
|
53
|
+
this.showCollapseMenu = true;
|
|
54
|
+
this.showFixedButton = true;
|
|
55
|
+
this.open = false;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Método para fixar/desafixar o menu, emitindo o evento ezChangeMode.
|
|
59
|
+
*/
|
|
60
|
+
async changeModeMenu() {
|
|
61
|
+
if (this.type === TypeMenuEnum.DYNAMIC) {
|
|
62
|
+
this.handleToggleMode();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Método para fechar o menu automaticamente após uma ação, fluxo, etc.
|
|
67
|
+
*/
|
|
68
|
+
async closeSidebar() {
|
|
69
|
+
this.open = false;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Método para abrir o menu automaticamente após uma ação, fluxo, etc.
|
|
73
|
+
*/
|
|
74
|
+
async openSidebar() {
|
|
75
|
+
this.open = true;
|
|
76
|
+
}
|
|
77
|
+
componentDidLoad() {
|
|
78
|
+
if (this.type === TypeMenuEnum.FIXED) {
|
|
79
|
+
this.mode = ModeMenuEnum.FIXED;
|
|
80
|
+
this.open = true;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
render() {
|
|
84
|
+
core.ElementIDUtils.addIDInfoIfNotExists(this._element);
|
|
85
|
+
return (index.h(index.Host, null, index.h("ez-sidebar-button", { class: this.open ? "hidden" : "", onEzClick: this.mode === ModeMenuEnum.FIXED ? this.handleToggleSidebar : undefined, onMouseEnter: this.mode === ModeMenuEnum.FLOAT ? this.handleToggleSidebar : undefined, "aria-controls": "navigator", "aria-expanded": this.open, "data-element-id": core.ElementIDUtils.getInternalIDInfo("openButton") }), this.open ? (index.h("aside", { tabIndex: -1, id: "navigator", class: `ez-col ez-col--sd-12 ez-col--tb-3 ez-sidebar-navigator ${this.mode === ModeMenuEnum.FLOAT ? 'dynamic' : 'fixed'} ${this.isResponsive ? 'responsive' : this.size} ${!this.open ? "hidden" : "show"}`, "data-element-id": core.ElementIDUtils.getInternalIDInfo("sidebar"), onMouseLeave: this.type !== TypeMenuEnum.FIXED && this.mode === ModeMenuEnum.FLOAT ? this.handleToggleSidebar : undefined }, index.h("header", { class: "ez-sidebar-navigator__header" }, index.h("slot", { name: "start" }), this.titleMenu !== '' && (index.h("div", { class: "ez-sidebar-navigator__title", title: this.titleMenu }, this.titleMenu)), !this.titleMenu && (index.h("slot", { name: "content" })), index.h("div", { class: "ez-sidebar-navigator__end" }, index.h("slot", { name: "end" }), (this.type === TypeMenuEnum.DYNAMIC && this.showFixedButton) && (index.h("ez-button", { onClick: this.handleToggleMode, mode: "icon", size: "small", iconName: this.mode === ModeMenuEnum.FIXED ? "un-pin" : "push-pin", title: this.mode === ModeMenuEnum.FIXED ? MESSAGES.UN_PIN_MENU : MESSAGES.PUSH_PIN_MENU, "aria-label": this.mode === ModeMenuEnum.FIXED ? MESSAGES.UN_PIN_MENU : MESSAGES.PUSH_PIN_MENU, "aria-controls": "navigator", "data-element-id": core.ElementIDUtils.getInternalIDInfo("pinButton") })), (this.mode === ModeMenuEnum.FIXED && this.showCollapseMenu) && (index.h("ez-button", { onClick: this.handleToggleSidebar, class: "inverted", mode: "icon", size: "small", iconName: "show_menu", title: MESSAGES.HIDE_MENU, "aria-label": MESSAGES.HIDE_MENU, "aria-controls": "navigator", "data-element-id": core.ElementIDUtils.getInternalIDInfo("closeButton") })))), this.titleMenu && (index.h("slot", { name: "content" })), index.h("ez-scroller", { class: "ez-sidebar-navigator__content", direction: EzScrollDirection.EzScrollDirection.VERTICAL, activeShadow: true }, index.h("slot", null)), index.h("footer", { class: "ez-sidebar-navigator__footer" }, index.h("slot", { name: "footer" }))))
|
|
86
|
+
: undefined));
|
|
87
|
+
}
|
|
88
|
+
get _element() { return index.getElement(this); }
|
|
89
|
+
};
|
|
90
|
+
EzSidebarNavigator.style = ezSidebarNavigatorCss;
|
|
91
|
+
|
|
92
|
+
exports.ez_sidebar_navigator = EzSidebarNavigator;
|
|
@@ -8,6 +8,7 @@ const CSSVarsUtils = require('./CSSVarsUtils-10c9d5b4.js');
|
|
|
8
8
|
require('./DialogType-2114c337.js');
|
|
9
9
|
require('./CheckMode-ecb90b87.js');
|
|
10
10
|
require('@sankhyalabs/core');
|
|
11
|
+
require('./ICustomRender-6fafffce.js');
|
|
11
12
|
|
|
12
13
|
const ezSplitItemCss = ".box_split-item{background-color:var(--background--xlight);width:100%;height:100%;border-radius:var(--border--radius-medium);box-shadow:var(--shadow);flex-direction:column;overflow:hidden;display:flex;padding:var(--space--nano)}.box_split-item>.ez-split-item--content{overflow:auto}.expanded__item{position:absolute;z-index:var(--more-visible);top:0;left:0;width:100%;height:100%}.ez-split-item--header{display:flex;align-items:center;justify-content:space-between}.ez-split-item--header-title{flex:1;white-space:nowrap;overflow:hidden}.ez-split-item--header-title h3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.ez-split-item--header-buttons{display:flex;align-items:center}.ez-split-item--content{display:block;height:100%}h3.ez-margin--small{margin-left:var(--space--small)}";
|
|
13
14
|
|