@sankhyalabs/ezui 2.2.4 → 2.3.1

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.
Files changed (75) hide show
  1. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  2. package/dist/cjs/ez-combo-box.cjs.entry.js +2 -7
  3. package/dist/cjs/ez-date-input.cjs.entry.js +2 -10
  4. package/dist/cjs/ez-date-time-input.cjs.entry.js +2 -10
  5. package/dist/cjs/ez-filter-input.cjs.entry.js +2 -7
  6. package/dist/cjs/ez-form.cjs.entry.js +2 -2
  7. package/dist/cjs/ez-grid.cjs.entry.js +77 -2
  8. package/dist/cjs/ez-number-input.cjs.entry.js +2 -7
  9. package/dist/cjs/ez-search.cjs.entry.js +2 -7
  10. package/dist/cjs/ez-tabselector.cjs.entry.js +4 -4
  11. package/dist/cjs/ez-text-area.cjs.entry.js +2 -7
  12. package/dist/cjs/ez-text-edit.cjs.entry.js +2 -7
  13. package/dist/cjs/ez-text-input.cjs.entry.js +2 -7
  14. package/dist/cjs/ez-time-input.cjs.entry.js +2 -7
  15. package/dist/cjs/ezui.cjs.js +1 -1
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/collection/components/ez-chip/ez-chip.js +1 -1
  18. package/dist/collection/components/ez-combo-box/ez-combo-box.js +2 -7
  19. package/dist/collection/components/ez-date-input/ez-date-input.js +3 -11
  20. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +3 -11
  21. package/dist/collection/components/ez-filter-input/ez-filter-input.js +2 -7
  22. package/dist/collection/components/ez-form/ez-form.js +2 -2
  23. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +63 -1
  24. package/dist/collection/components/ez-grid/ez-grid.js +16 -2
  25. package/dist/collection/components/ez-number-input/ez-number-input.js +2 -7
  26. package/dist/collection/components/ez-search/ez-search.js +2 -7
  27. package/dist/collection/components/ez-tabselector/ez-tabselector.js +4 -4
  28. package/dist/collection/components/ez-text-area/ez-text-area.js +2 -7
  29. package/dist/collection/components/ez-text-edit/ez-text-edit.js +2 -7
  30. package/dist/collection/components/ez-text-input/ez-text-input.js +2 -7
  31. package/dist/collection/components/ez-time-input/ez-time-input.js +2 -7
  32. package/dist/custom-elements/index.js +105 -86
  33. package/dist/esm/ez-chip.entry.js +1 -1
  34. package/dist/esm/ez-combo-box.entry.js +2 -7
  35. package/dist/esm/ez-date-input.entry.js +2 -10
  36. package/dist/esm/ez-date-time-input.entry.js +2 -10
  37. package/dist/esm/ez-filter-input.entry.js +2 -7
  38. package/dist/esm/ez-form.entry.js +2 -2
  39. package/dist/esm/ez-grid.entry.js +77 -2
  40. package/dist/esm/ez-number-input.entry.js +2 -7
  41. package/dist/esm/ez-search.entry.js +2 -7
  42. package/dist/esm/ez-tabselector.entry.js +4 -4
  43. package/dist/esm/ez-text-area.entry.js +2 -7
  44. package/dist/esm/ez-text-edit.entry.js +2 -7
  45. package/dist/esm/ez-text-input.entry.js +2 -7
  46. package/dist/esm/ez-time-input.entry.js +2 -7
  47. package/dist/esm/ezui.js +1 -1
  48. package/dist/esm/loader.js +1 -1
  49. package/dist/ezui/ezui.esm.js +1 -1
  50. package/dist/ezui/{p-b484a0b3.entry.js → p-0fb5f4be.entry.js} +1 -1
  51. package/dist/ezui/{p-77b7b623.entry.js → p-19a38745.entry.js} +1 -1
  52. package/dist/ezui/p-66ebdf34.entry.js +1 -0
  53. package/dist/ezui/p-6bcf35fd.entry.js +1 -0
  54. package/dist/ezui/{p-587e8dca.entry.js → p-72d755a8.entry.js} +1 -1
  55. package/dist/ezui/p-7cf71eb3.entry.js +1 -0
  56. package/dist/ezui/{p-107aff56.entry.js → p-81fb0c90.entry.js} +1 -1
  57. package/dist/ezui/p-855f99f8.entry.js +1 -0
  58. package/dist/ezui/{p-a595dd4e.entry.js → p-89b2a151.entry.js} +1 -1
  59. package/dist/ezui/{p-8eae779b.entry.js → p-941d9bf9.entry.js} +1 -1
  60. package/dist/ezui/p-ac15d77e.entry.js +1 -0
  61. package/dist/ezui/p-c2ebc450.entry.js +1 -0
  62. package/dist/ezui/p-ca9a0a49.entry.js +1 -0
  63. package/dist/ezui/p-f4d2438e.entry.js +1 -0
  64. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +8 -0
  65. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +4 -0
  66. package/dist/types/components/ez-grid/ez-grid.d.ts +1 -0
  67. package/package.json +2 -2
  68. package/dist/ezui/p-019c7fc4.entry.js +0 -1
  69. package/dist/ezui/p-4b2595f4.entry.js +0 -1
  70. package/dist/ezui/p-6a8e7fb2.entry.js +0 -1
  71. package/dist/ezui/p-74e6c2a9.entry.js +0 -1
  72. package/dist/ezui/p-7b8d1f1c.entry.js +0 -1
  73. package/dist/ezui/p-c55f63c6.entry.js +0 -1
  74. package/dist/ezui/p-dff2b725.entry.js +0 -1
  75. package/dist/ezui/p-fe578dc0.entry.js +0 -1
@@ -184,21 +184,13 @@ export class EzDateTimeInput {
184
184
  componentDidLoad() {
185
185
  CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
186
186
  this.setInputValue();
187
- if (this._elem) {
188
- ElementIDUtils.addIDInfo(this._elem, 'input');
189
- if (this._textInput) {
190
- ElementIDUtils.addIDInfo(this._textInput, 'internal_input', { id: this._elem.getAttribute("data-element-id") });
191
- }
192
- if (this._calendar) {
193
- ElementIDUtils.addIDInfo(this._calendar, 'internal_calendar', { id: this._elem.getAttribute("data-element-id") });
194
- }
195
- }
196
187
  }
197
188
  render() {
189
+ let elementId = ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
198
190
  return (h(Host, null,
199
- h("ez-text-input", { ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, onKeyDown: event => { this.handleKeyDown(event); }, onBlur: () => this.handleBlur(), onInput: (evt) => this.handleInput(evt), onFocus: () => this.handleFocus(), onClick: () => this.handleClick() },
191
+ h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo(elementId, "textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, onKeyDown: event => { this.handleKeyDown(event); }, onBlur: () => this.handleBlur(), onInput: (evt) => this.handleInput(evt), onFocus: () => this.handleFocus(), onClick: () => this.handleClick() },
200
192
  h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })),
201
- h("ez-calendar", { onEzChange: (event) => { this.changeValue(this._calendar.value); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem, time: true, showSeconds: this.showSeconds })));
193
+ h("ez-calendar", { "data-element-id": ElementIDUtils.getInternalIDInfo(elementId, "calendar"), onEzChange: (event) => { this.changeValue(this._calendar.value); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem, time: true, showSeconds: this.showSeconds })));
202
194
  }
203
195
  static get is() { return "ez-date-time-input"; }
204
196
  static get encapsulation() { return "shadow"; }
@@ -55,15 +55,10 @@ export class EzFilterInput {
55
55
  }
56
56
  componentDidLoad() {
57
57
  CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
58
- if (this._elem) {
59
- ElementIDUtils.addIDInfo(this._elem, 'input');
60
- if (this._textInput) {
61
- ElementIDUtils.addIDInfo(this._textInput, 'internal_input', { id: this._elem.getAttribute("data-element-id") });
62
- }
63
- }
64
58
  }
65
59
  render() {
66
- return (h("ez-text-input", { ref: elem => this._textInput = elem, label: this.label, onEzChange: evt => this.changeValue(evt), value: this.value, enabled: this.enabled, errorMessage: this.errorMessage, restrict: this.restrict, loading: this.loading, mode: this.mode },
60
+ let elementId = ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
61
+ return (h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo(elementId, "textInput"), ref: elem => this._textInput = elem, label: this.label, onEzChange: evt => this.changeValue(evt), value: this.value, enabled: this.enabled, errorMessage: this.errorMessage, restrict: this.restrict, loading: this.loading, mode: this.mode },
67
62
  h("ez-icon", { slot: "leftIcon", iconName: "search" })));
68
63
  }
69
64
  static get is() { return "ez-filter-input"; }
@@ -106,7 +106,7 @@ export class EzForm {
106
106
  const idTabSelector = `${this._dataElementIdEzForm}_internal_tabSelector`;
107
107
  result.push(h("ez-tabselector", { tabs: this.buildIdTabSelector(tabs), onEzChange: (evt) => this._store.dispatch(changeTab(evt.detail)), selectedTab: currentSheet.name, "data-element-id": idTabSelector }));
108
108
  }
109
- const idFormSheet = `${this._dataElementIdEzForm}_${StringUtils.toCamelCase(currentSheet.label)}`;
109
+ const idFormSheet = `${this._dataElementIdEzForm}_${StringUtils.replaceAccentuatedChars(StringUtils.toCamelCase(currentSheet.label), false)}`;
110
110
  result.push(h(FormSheet, { store: this._store, source: currentSheet, dataElementId: idFormSheet }));
111
111
  return result;
112
112
  }
@@ -184,7 +184,7 @@ export class EzForm {
184
184
  }
185
185
  buildIdTabSelector(tabs) {
186
186
  if (tabs) {
187
- tabs.forEach(tab => tab["data-element-id"] = `${this._dataElementIdEzForm}_${StringUtils.toCamelCase(tab.label)}`);
187
+ tabs.forEach(tab => tab[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `${this._dataElementIdEzForm}_${StringUtils.toCamelCase(tab.label)}`);
188
188
  }
189
189
  return tabs;
190
190
  }
@@ -54,6 +54,7 @@ export default class AgGridController {
54
54
  sortingOrder: ['desc', 'asc', null],
55
55
  columnDefs: this._colDefs,
56
56
  blockLoadDebounceMillis: this.BLOCK_LOAD_DEBOUNCE,
57
+ navigateToNextCell: this.navigateToNextCell.bind(this),
57
58
  getRowNodeId: this._dataUnit ? (params) => typeof params === "string" ? params : params[this._idAttribName] : undefined,
58
59
  getMainMenuItems: (params) => {
59
60
  const column = params.column;
@@ -93,6 +94,45 @@ export default class AgGridController {
93
94
  getRowHeight() {
94
95
  return this.DEFAULT_ROW_HEIGHT;
95
96
  }
97
+ navigateToNextCell(params) {
98
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
99
+ switch (params.key) {
100
+ case 'ArrowUp':
101
+ if (((_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.hasPrevious()) === false) {
102
+ return null;
103
+ }
104
+ this._gridOptions.api.deselectAll();
105
+ if (((_b = params.nextCellPosition) === null || _b === void 0 ? void 0 : _b.rowIndex) < 0) {
106
+ (_c = this._dataUnit) === null || _c === void 0 ? void 0 : _c.previousRecord();
107
+ return null;
108
+ }
109
+ else {
110
+ (_d = this._dataUnit) === null || _d === void 0 ? void 0 : _d.setSelectionByIndex([params.nextCellPosition.rowIndex]);
111
+ return params.nextCellPosition;
112
+ }
113
+ case 'ArrowDown':
114
+ if (((_e = this._dataUnit) === null || _e === void 0 ? void 0 : _e.hasNext()) === false) {
115
+ return null;
116
+ }
117
+ this._gridOptions.api.deselectAll();
118
+ if ((_f = params.nextCellPosition) === null || _f === void 0 ? void 0 : _f.rowIndex) {
119
+ (_g = this._dataUnit) === null || _g === void 0 ? void 0 : _g.setSelectionByIndex([params.nextCellPosition.rowIndex]);
120
+ }
121
+ else {
122
+ (_h = this._dataUnit) === null || _h === void 0 ? void 0 : _h.nextRecord();
123
+ }
124
+ return params.nextCellPosition;
125
+ case "ArrowLeft":
126
+ case "ArrowRight":
127
+ if (((_j = params.nextCellPosition) === null || _j === void 0 ? void 0 : _j.column.colDef.headerName) !== "") {
128
+ return params.nextCellPosition;
129
+ }
130
+ else {
131
+ return null;
132
+ }
133
+ }
134
+ return null;
135
+ }
96
136
  setOptionsEvents(opt) {
97
137
  opt.onSortChanged = e => this.onCallStateChange("sort", e);
98
138
  opt.onColumnResized = e => this.onCallStateChange("columnResize", e);
@@ -153,7 +193,14 @@ export default class AgGridController {
153
193
  throw new Error("Erro interno: Grid ainda não inicializado.");
154
194
  }
155
195
  this._gridOptions.api.forEachNode(node => {
156
- node.setSelected(rowIds && rowIds.includes(node.id));
196
+ var _a;
197
+ if (rowIds && rowIds.includes(node.id)) {
198
+ node.setSelected(true);
199
+ (_a = this._gridOptions.api) === null || _a === void 0 ? void 0 : _a.ensureNodeVisible(node);
200
+ }
201
+ else {
202
+ node.setSelected(false);
203
+ }
157
204
  });
158
205
  const selectionHeader = this._gridOptions.context.selectionHeader;
159
206
  if (selectionHeader) {
@@ -199,6 +246,21 @@ export default class AgGridController {
199
246
  }
200
247
  this._gridOptions.api.refreshServerSide({ purge: false });
201
248
  }
249
+ setFocusFirstRow() {
250
+ const firstRow = this._gridOptions.api.getDisplayedRowAtIndex(0);
251
+ this.setFocusOnRow(firstRow.rowIndex);
252
+ }
253
+ setFocusLastRow() {
254
+ const lastRow = this._gridOptions.api.getDisplayedRowAtIndex(this._gridOptions.api.getLastDisplayedRow());
255
+ this.setFocusOnRow(lastRow.rowIndex);
256
+ }
257
+ setFocusOnRow(rowIndex) {
258
+ let displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
259
+ let firstCell = displayedColumns.find((column) => column.getColDef().headerName !== "");
260
+ this._gridOptions.api.ensureColumnVisible(firstCell);
261
+ this._gridOptions.api.ensureIndexVisible(rowIndex);
262
+ this._gridOptions.api.setFocusedCell(rowIndex, firstCell);
263
+ }
202
264
  setColumnsDef(cols) {
203
265
  const newColDefs = [Object.assign({ colId: this.CHECK_BOX_COL_ID, headerName: "", checkboxSelection: true, width: 28, suppressMovable: true, suppressAutoSize: true, suppressMenu: true, lockPosition: true, pinned: true }, this._multipleSelection && { headerComponent: "ezGridHeaderComponent", headerClass: "ag-column-select-header" })];
204
266
  if (this._statusResolver != undefined) {
@@ -4,6 +4,7 @@ import AgGridController from "./controller/ag-grid/AgGridController";
4
4
  export class EzGrid {
5
5
  constructor() {
6
6
  this._gridController = new AgGridController(false);
7
+ this._paginationChangedByKeyboard = true;
7
8
  }
8
9
  /**
9
10
  * Método responsável por receber a definição das colunas
@@ -128,7 +129,17 @@ export class EzGrid {
128
129
  this._gridController.initDatagrid(this._container, {
129
130
  onColumnStateChange: (type, state, info) => this.onColumnStateChange(type, state, info),
130
131
  onSelectionChange: (selection) => this.ezSelectionChange.emit(selection),
131
- onPaginationChange: (paginationInfo) => this._paginationInfo = paginationInfo,
132
+ onPaginationChange: (paginationInfo) => {
133
+ var _a;
134
+ if (((_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.currentPage) > paginationInfo.currentPage && this._paginationChangedByKeyboard) {
135
+ this._gridController.setFocusLastRow();
136
+ }
137
+ else {
138
+ this._gridController.setFocusFirstRow();
139
+ this._paginationChangedByKeyboard = true;
140
+ }
141
+ this._paginationInfo = paginationInfo;
142
+ },
132
143
  onDoubleClick: (row) => {
133
144
  this.ezDoubleClick.emit(row);
134
145
  },
@@ -151,11 +162,13 @@ export class EzGrid {
151
162
  previousPage() {
152
163
  if (this.dataUnit) {
153
164
  this.dataUnit.previousPage();
165
+ this._paginationChangedByKeyboard = false;
154
166
  }
155
167
  }
156
168
  nextPage() {
157
169
  if (this.dataUnit) {
158
170
  this.dataUnit.nextPage();
171
+ this._paginationChangedByKeyboard = false;
159
172
  }
160
173
  }
161
174
  getPaginationControl() {
@@ -289,7 +302,8 @@ export class EzGrid {
289
302
  }
290
303
  }; }
291
304
  static get states() { return {
292
- "_paginationInfo": {}
305
+ "_paginationInfo": {},
306
+ "_paginationChangedByKeyboard": {}
293
307
  }; }
294
308
  static get events() { return [{
295
309
  "method": "ezColumnStateChange",
@@ -124,15 +124,10 @@ export class EzNumberInput {
124
124
  componentDidLoad() {
125
125
  CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
126
126
  this.setInputValue();
127
- if (this._elem) {
128
- ElementIDUtils.addIDInfo(this._elem, 'input');
129
- if (this._textInput) {
130
- ElementIDUtils.addIDInfo(this._textInput, 'internal_input', { id: this._elem.getAttribute("data-element-id") });
131
- }
132
- }
133
127
  }
134
128
  render() {
135
- return (h("ez-text-input", { 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 }));
129
+ let elementId = ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
130
+ return (h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo(elementId, "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 }));
136
131
  }
137
132
  static get is() { return "ez-number-input"; }
138
133
  static get encapsulation() { return "shadow"; }
@@ -62,15 +62,10 @@ export class EzSearch {
62
62
  }
63
63
  componentDidLoad() {
64
64
  CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
65
- if (this._elem) {
66
- ElementIDUtils.addIDInfo(this._elem, 'input');
67
- if (this._comboElement) {
68
- ElementIDUtils.addIDInfo(this._comboElement, 'internal_input', { id: this._elem.getAttribute("data-element-id") });
69
- }
70
- }
71
65
  }
72
66
  render() {
73
- return (h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.optionLoader, searchMode: true, onEzChange: event => this.onComboChange(event), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue, suppressEmptyOption: this.suppressEmptyOption, mode: this.mode }));
67
+ let elementId = ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
68
+ return (h("ez-combo-box", { "data-element-id": ElementIDUtils.getInternalIDInfo(elementId, "combo"), ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.optionLoader, searchMode: true, onEzChange: event => this.onComboChange(event), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue, suppressEmptyOption: this.suppressEmptyOption, mode: this.mode }));
74
69
  }
75
70
  ;
76
71
  static get is() { return "ez-search"; }
@@ -100,7 +100,7 @@ export class EzTabselector {
100
100
  }
101
101
  componentDidLoad() {
102
102
  this._hostElem.shadowRoot.querySelectorAll('button[name="tab-button"]').forEach((elem) => {
103
- const elemIdTabSelector = this._hostElem.getAttribute("data-element-id");
103
+ const elemIdTabSelector = this._hostElem.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
104
104
  const dataInfo = { id: `${elemIdTabSelector}_${StringUtils.toCamelCase(elem.id)}` };
105
105
  ElementIDUtils.addIDInfo(elem, null, dataInfo);
106
106
  });
@@ -193,10 +193,10 @@ export class EzTabselector {
193
193
  }
194
194
  buildElementIdTab(tabs) {
195
195
  tabs.forEach(tab => {
196
- if (!tab.hasOwnProperty("data-element-id")) {
197
- const elemIdTabSelector = this._hostElem.getAttribute("data-element-id");
196
+ if (!tab.hasOwnProperty(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME)) {
197
+ const elemIdTabSelector = this._hostElem.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
198
198
  const dataElementID = `${elemIdTabSelector}_${StringUtils.toCamelCase(tab.tabKey)}`;
199
- tab["data-element-id"] = dataElementID;
199
+ tab[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = dataElementID;
200
200
  }
201
201
  });
202
202
  }
@@ -134,20 +134,15 @@ export class EzTextArea {
134
134
  this.observeErrorMessage();
135
135
  this.adjustFloatingLabel();
136
136
  this.observeMode();
137
- if (this._hostElement) {
138
- ElementIDUtils.addIDInfo(this._hostElement, 'input');
139
- if (this._inputElem) {
140
- ElementIDUtils.addIDInfo(this._inputElem, 'internal_input', { id: this._hostElement.getAttribute("data-element-id") });
141
- }
142
- }
143
137
  }
144
138
  render() {
139
+ let elementId = ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
145
140
  return (h(Host, null,
146
141
  h("div", { class: "textarea", ref: (el) => this._container = el },
147
142
  this.label && this.mode != "slim" ?
148
143
  h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "textarea__label" : "textarea__label textarea__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
149
144
  : null,
150
- h("textarea", { onFocus: () => this.handleFocus(), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, class: this.mode === "slim" ? "textarea--slim" : "", placeholder: this.mode === "slim" && this.label ? this.label : "", onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, onKeyDown: event => event.stopPropagation(), rows: this.rows })),
145
+ h("textarea", { onFocus: () => this.handleFocus(), "data-element-id": ElementIDUtils.getInternalIDInfo(elementId, "input"), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, class: this.mode === "slim" ? "textarea--slim" : "", placeholder: this.mode === "slim" && this.label ? this.label : "", onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, onKeyDown: event => event.stopPropagation(), rows: this.rows })),
151
146
  this.canShowError && this.mode != "slim" &&
152
147
  h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
153
148
  }
@@ -76,20 +76,15 @@ export class EzTextEdit {
76
76
  componentDidLoad() {
77
77
  this.applyFocusSelect();
78
78
  this.setNewValue(this.value);
79
- if (this._element) {
80
- ElementIDUtils.addIDInfo(this._element, 'input');
81
- if (this._inputElement) {
82
- ElementIDUtils.addIDInfo(this._inputElement, 'internal_input', { id: this._element.getAttribute("data-element-id") });
83
- }
84
- }
85
79
  }
86
80
  componentDidRender() {
87
81
  this.setStyledInput();
88
82
  }
89
83
  render() {
84
+ let elementId = ElementIDUtils.addIDInfoIfNotExists(this._element, 'input');
90
85
  return (h(Host, null,
91
86
  h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }),
92
- h("ez-text-input", { onInput: () => { this.calcSizeInput(this._newValue); }, class: "text-edit__form-input", value: this._newValue, ref: (elem) => this._inputElement = elem, mode: "slim", onEzChange: (evt) => this.setNewValue(evt === null || evt === void 0 ? void 0 : evt.detail), noBorder: true }),
87
+ h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo(elementId, "textInput"), onInput: () => { this.calcSizeInput(this._newValue); }, class: "text-edit__form-input", value: this._newValue, ref: (elem) => this._inputElement = elem, mode: "slim", onEzChange: (evt) => this.setNewValue(evt === null || evt === void 0 ? void 0 : evt.detail), noBorder: true }),
93
88
  h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }),
94
89
  h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.cancelEdition.emit(); } })));
95
90
  }
@@ -204,12 +204,6 @@ export class EzTextInput {
204
204
  this.observeMask();
205
205
  this.adjustFloatingLabel();
206
206
  this.adjustBorderInput();
207
- if (this._hostElement) {
208
- ElementIDUtils.addIDInfo(this._hostElement, 'input');
209
- if (this._inputElem) {
210
- ElementIDUtils.addIDInfo(this._inputElem, 'internal_input', { id: this._hostElement.getAttribute("data-element-id") });
211
- }
212
- }
213
207
  }
214
208
  componentWillLoad() {
215
209
  this.observeMask();
@@ -229,12 +223,13 @@ export class EzTextInput {
229
223
  }
230
224
  }
231
225
  render() {
226
+ let elementId = ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
232
227
  return (h(Host, null,
233
228
  h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }),
234
229
  this.label && this.mode != "slim" ?
235
230
  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)
236
231
  : null,
237
- h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "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(); } }),
232
+ h("input", { "data-element-id": ElementIDUtils.getInternalIDInfo(elementId, "input"), onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "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(); } }),
238
233
  h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }),
239
234
  this.canShowError && this.mode != "slim" &&
240
235
  h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
@@ -131,12 +131,6 @@ export class EzTimeInput {
131
131
  //---------------------------------------------
132
132
  componentDidLoad() {
133
133
  CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
134
- if (this._elem) {
135
- ElementIDUtils.addIDInfo(this._elem, 'input');
136
- if (this._textInput) {
137
- ElementIDUtils.addIDInfo(this._textInput, 'internal_input', { id: this._elem.getAttribute("data-element-id") });
138
- }
139
- }
140
134
  }
141
135
  componentWillLoad() {
142
136
  this.observeShowSeconds();
@@ -148,8 +142,9 @@ export class EzTimeInput {
148
142
  }
149
143
  }
150
144
  render() {
145
+ let elementId = ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
151
146
  return (h(Host, null,
152
- h("ez-text-input", { ref: (el) => this._textInput = el, "data-slave-mode": "true", value: this._viewValue, enabled: this.enabled, label: this.label, restrict: "0123456789:", onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), errorMessage: this.errorMessage, mode: this.mode },
147
+ h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo(elementId, "textInput"), ref: (el) => this._textInput = el, "data-slave-mode": "true", value: this._viewValue, enabled: this.enabled, label: this.label, restrict: "0123456789:", onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), errorMessage: this.errorMessage, mode: this.mode },
153
148
  h("ez-icon", { slot: "leftIcon", iconName: "timer-outline" }))));
154
149
  }
155
150
  static get is() { return "ez-time-input"; }