@sankhyalabs/ezui 5.22.0-dev.54 → 5.22.0-dev.56
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/ez-actions-button.cjs.entry.js +4 -3
- package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-badge.cjs.entry.js +1 -1
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item_3.cjs.entry.js +1 -1
- package/dist/cjs/ez-chart.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +2 -2
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +2 -2
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +12 -12
- package/dist/cjs/ez-form.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +4 -3
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +2 -2
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +85 -25
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-tooltip.cjs.entry.js +55 -0
- package/dist/cjs/ez-tree.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/{index-a7b0c73d.js → index-9e5554cb.js} +7 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +3 -2
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +1 -1
- package/dist/collection/components/ez-form-view/ez-form-view.css +5 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +3 -3
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +1 -1
- package/dist/collection/components/ez-grid/ez-grid.css +11 -0
- package/dist/collection/components/ez-grid/ez-grid.js +20 -1
- package/dist/collection/components/ez-search/ez-search.js +1 -1
- package/dist/collection/components/ez-text-input/ez-text-input.css +56 -24
- package/dist/collection/components/ez-text-input/ez-text-input.js +88 -23
- package/dist/collection/components/ez-tooltip/ez-tooltip.css +20 -0
- package/dist/collection/components/ez-tooltip/ez-tooltip.js +116 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +157 -44
- package/dist/esm/ez-actions-button.entry.js +4 -3
- package/dist/esm/ez-alert-list.entry.js +1 -1
- package/dist/esm/ez-alert.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-badge.entry.js +1 -1
- package/dist/esm/ez-breadcrumb.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item_3.entry.js +1 -1
- package/dist/esm/ez-chart.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +2 -2
- package/dist/esm/ez-custom-form-input_2.entry.js +2 -2
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-dropdown_2.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +12 -12
- package/dist/esm/ez-form.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +4 -3
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller_2.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +2 -2
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +1 -1
- package/dist/esm/ez-split-item.entry.js +1 -1
- package/dist/esm/ez-split-panel.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +85 -25
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-tooltip.entry.js +51 -0
- package/dist/esm/ez-tree.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-baa5e267.js → index-5a720e56.js} +7 -1
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
- package/dist/ezui/{p-77a4bd35.entry.js → p-11bfeca3.entry.js} +1 -1
- package/dist/ezui/{p-d0ca26fe.entry.js → p-16e21a40.entry.js} +1 -1
- package/dist/ezui/{p-8888d9ed.entry.js → p-1b08bf3c.entry.js} +1 -1
- package/dist/ezui/{p-7409eeaa.entry.js → p-2f53435e.entry.js} +1 -1
- package/dist/ezui/{p-baf80b13.entry.js → p-30951bd7.entry.js} +1 -1
- package/dist/ezui/{p-15d7af92.entry.js → p-33675dae.entry.js} +1 -1
- package/dist/ezui/{p-7ed30844.entry.js → p-397e3026.entry.js} +1 -1
- package/dist/ezui/p-3af64edd.entry.js +1 -0
- package/dist/ezui/{p-2b46b37b.entry.js → p-3c10cd94.entry.js} +1 -1
- package/dist/ezui/{p-0db68715.entry.js → p-3cc9b84a.entry.js} +1 -1
- package/dist/ezui/{p-0a75bb05.entry.js → p-3d38bfea.entry.js} +1 -1
- package/dist/ezui/{p-4575d511.entry.js → p-46a46507.entry.js} +1 -1
- package/dist/ezui/{p-6d79930d.entry.js → p-554522db.entry.js} +1 -1
- package/dist/ezui/p-66c982c6.entry.js +1 -0
- package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
- package/dist/ezui/{p-fec696ab.entry.js → p-6bda82d1.entry.js} +1 -1
- package/dist/ezui/{p-2bb2a0c4.entry.js → p-6d31c43c.entry.js} +1 -1
- package/dist/ezui/p-6d8b3298.entry.js +1 -0
- package/dist/ezui/p-6ec40dec.entry.js +1 -0
- package/dist/ezui/{p-5ed81457.entry.js → p-6fc26622.entry.js} +1 -1
- package/dist/ezui/{p-f9e551de.entry.js → p-70f1c812.entry.js} +1 -1
- package/dist/ezui/{p-555c9018.entry.js → p-7567ccdd.entry.js} +1 -1
- package/dist/ezui/p-78feb299.entry.js +1 -0
- package/dist/ezui/{p-bfad39eb.entry.js → p-7f5afb1f.entry.js} +1 -1
- package/dist/ezui/{p-1e7a8633.entry.js → p-81461d2f.entry.js} +1 -1
- package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
- package/dist/ezui/{p-cd2e78f0.entry.js → p-8f026744.entry.js} +1 -1
- package/dist/ezui/{p-09de35a2.entry.js → p-91ccae0c.entry.js} +1 -1
- package/dist/ezui/{p-c0d9c4f8.entry.js → p-92748142.entry.js} +1 -1
- package/dist/ezui/p-9c3ba1ae.entry.js +1 -0
- package/dist/ezui/{p-c4320a39.entry.js → p-a563df31.entry.js} +1 -1
- package/dist/ezui/{p-990b4318.entry.js → p-a921e3e7.entry.js} +1 -1
- package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
- package/dist/ezui/{p-c3045972.entry.js → p-b858fc6e.entry.js} +1 -1
- package/dist/ezui/{p-e347df9c.entry.js → p-bef7daac.entry.js} +1 -1
- package/dist/ezui/{p-ffd246f5.entry.js → p-bfc30e61.entry.js} +1 -1
- package/dist/ezui/{p-19098a3f.entry.js → p-bfc59380.entry.js} +1 -1
- package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
- package/dist/ezui/{p-039a95bd.entry.js → p-d27b4b3e.entry.js} +1 -1
- package/dist/ezui/p-d85a0835.entry.js +1 -0
- package/dist/ezui/{p-43b41d3e.entry.js → p-dc4b35fb.entry.js} +2 -2
- package/dist/ezui/{p-a80b1287.entry.js → p-dfca5946.entry.js} +1 -1
- package/dist/ezui/{p-7fdd479f.entry.js → p-e18d9e6a.entry.js} +1 -1
- package/dist/ezui/{p-23a36bb6.js → p-e4c7eb39.js} +2 -2
- package/dist/ezui/{p-0306dff7.entry.js → p-e6b38ade.entry.js} +1 -1
- package/dist/ezui/{p-90bcd2ba.entry.js → p-e7395eae.entry.js} +1 -1
- package/dist/ezui/p-ec5f987d.entry.js +1 -0
- package/dist/ezui/{p-3175fe8c.entry.js → p-efbe0b73.entry.js} +1 -1
- package/dist/ezui/{p-650e4b6d.entry.js → p-f1c2c19e.entry.js} +1 -1
- package/dist/ezui/{p-6e429cff.entry.js → p-fc194825.entry.js} +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +6 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +15 -2
- package/dist/types/components/ez-tooltip/ez-tooltip.d.ts +21 -0
- package/dist/types/components.d.ts +41 -0
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-151fc744.entry.js +0 -1
- package/dist/ezui/p-7fde6c1d.entry.js +0 -1
- package/dist/ezui/p-8481a08a.entry.js +0 -1
- package/dist/ezui/p-a5b91a77.entry.js +0 -1
- package/dist/ezui/p-bc2f844e.entry.js +0 -1
- package/dist/ezui/p-bcb53f27.entry.js +0 -1
- package/dist/ezui/p-dc8b36c3.entry.js +0 -1
|
@@ -15,18 +15,19 @@ export class EzTextInput {
|
|
|
15
15
|
this.noBorder = false;
|
|
16
16
|
this.password = false;
|
|
17
17
|
this.autoFocus = false;
|
|
18
|
+
this.hasRightSlotContent = false;
|
|
18
19
|
}
|
|
19
20
|
observeErrorMessage() {
|
|
20
21
|
if (this._inputElem) {
|
|
21
22
|
this.isInvalid().then((hasError) => {
|
|
22
|
-
var _a
|
|
23
|
+
var _a;
|
|
23
24
|
if (hasError) {
|
|
24
25
|
this._inputElem.classList.add("hasError");
|
|
25
|
-
(_a = this.
|
|
26
|
+
(_a = this._tooltipPositioningObserver) === null || _a === void 0 ? void 0 : _a.observe(this._inputElem);
|
|
26
27
|
}
|
|
27
28
|
else {
|
|
28
29
|
this._inputElem.classList.remove("hasError");
|
|
29
|
-
|
|
30
|
+
this.removeGlobalTooltip();
|
|
30
31
|
}
|
|
31
32
|
});
|
|
32
33
|
}
|
|
@@ -190,8 +191,10 @@ export class EzTextInput {
|
|
|
190
191
|
this.controlChangeValue();
|
|
191
192
|
}
|
|
192
193
|
handleSlotChange(ev) {
|
|
194
|
+
var _a;
|
|
193
195
|
const slot = ev.target;
|
|
194
196
|
const content = slot.assignedElements()[0];
|
|
197
|
+
this.hasRightSlotContent = false;
|
|
195
198
|
if (content) {
|
|
196
199
|
content.style.position = "absolute";
|
|
197
200
|
content.style.display = "flex";
|
|
@@ -217,6 +220,10 @@ export class EzTextInput {
|
|
|
217
220
|
if (this._labelElem) {
|
|
218
221
|
this._labelElem.classList.add("input__label--right");
|
|
219
222
|
}
|
|
223
|
+
if (this._tooltipIconElem) {
|
|
224
|
+
this._tooltipIconElem.classList.add("rightIconSlot");
|
|
225
|
+
}
|
|
226
|
+
this.hasRightSlotContent = ((_a = content.children) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
220
227
|
}
|
|
221
228
|
slot.name && ElementIDUtils.addIDInfo(content, slot.name);
|
|
222
229
|
}
|
|
@@ -228,26 +235,39 @@ export class EzTextInput {
|
|
|
228
235
|
}
|
|
229
236
|
this.adjustColorContentSlot("var(--ez-text-input__input--focus--icon-color)");
|
|
230
237
|
}
|
|
238
|
+
renderGlobalTooltip() {
|
|
239
|
+
const tooltip = document.createElement('ez-tooltip');
|
|
240
|
+
tooltip.errorMessage = this.errorMessage;
|
|
241
|
+
tooltip.anchoringElement = this._tooltipIconElem;
|
|
242
|
+
document.body.appendChild(tooltip);
|
|
243
|
+
this._tooltipElem = tooltip;
|
|
244
|
+
}
|
|
245
|
+
removeGlobalTooltip() {
|
|
246
|
+
var _a;
|
|
247
|
+
if (!this._tooltipElem)
|
|
248
|
+
return;
|
|
249
|
+
this._tooltipElem.remove();
|
|
250
|
+
this._tooltipElem = undefined;
|
|
251
|
+
(_a = this._tooltipPositioningObserver) === null || _a === void 0 ? void 0 : _a.unobserve(this._inputElem);
|
|
252
|
+
}
|
|
253
|
+
createTooltipPositioningObserver() {
|
|
254
|
+
const observer = new ResizeObserver(() => {
|
|
255
|
+
if (!this._tooltipElem)
|
|
256
|
+
return;
|
|
257
|
+
if (!this._tooltipIconElem)
|
|
258
|
+
return;
|
|
259
|
+
clearTimeout(this._observerDebounceTimeout);
|
|
260
|
+
this._observerDebounceTimeout = setTimeout(async () => {
|
|
261
|
+
if (this._tooltipElem) {
|
|
262
|
+
await this._tooltipElem.positionTooltip();
|
|
263
|
+
}
|
|
264
|
+
}, 200);
|
|
265
|
+
});
|
|
266
|
+
this._tooltipPositioningObserver = observer;
|
|
267
|
+
}
|
|
231
268
|
//---------------------------------------------
|
|
232
269
|
// Lifecycle web component
|
|
233
270
|
//---------------------------------------------
|
|
234
|
-
componentDidLoad() {
|
|
235
|
-
this.observeErrorMessage();
|
|
236
|
-
this.observeMask();
|
|
237
|
-
this.adjustFloatingLabel();
|
|
238
|
-
this.adjustBorderInput();
|
|
239
|
-
if (this.autoFocus) {
|
|
240
|
-
requestAnimationFrame(() => {
|
|
241
|
-
this.setFocus({ selectText: true });
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
this._inputElem.addEventListener('focus', () => {
|
|
245
|
-
this._inputElem.setSelectionRange(0, this._inputElem.value.length);
|
|
246
|
-
});
|
|
247
|
-
if (this._inputElem) {
|
|
248
|
-
applyEllipsisToInput(this._inputElem);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
271
|
componentWillLoad() {
|
|
252
272
|
this.observeMask();
|
|
253
273
|
if (this.value) {
|
|
@@ -270,12 +290,52 @@ export class EzTextInput {
|
|
|
270
290
|
}
|
|
271
291
|
}
|
|
272
292
|
}
|
|
293
|
+
componentDidLoad() {
|
|
294
|
+
var _a, _b;
|
|
295
|
+
this.observeErrorMessage();
|
|
296
|
+
this.observeMask();
|
|
297
|
+
this.adjustFloatingLabel();
|
|
298
|
+
this.adjustBorderInput();
|
|
299
|
+
if (this.autoFocus) {
|
|
300
|
+
requestAnimationFrame(() => {
|
|
301
|
+
this.setFocus({ selectText: true });
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
(_a = this._inputElem) === null || _a === void 0 ? void 0 : _a.addEventListener('focus', () => {
|
|
305
|
+
var _a;
|
|
306
|
+
this._inputElem.setSelectionRange(0, (_a = this._inputElem) === null || _a === void 0 ? void 0 : _a.value.length);
|
|
307
|
+
});
|
|
308
|
+
this.createTooltipPositioningObserver();
|
|
309
|
+
if (this._inputElem) {
|
|
310
|
+
(_b = this._tooltipPositioningObserver) === null || _b === void 0 ? void 0 : _b.observe(this._inputElem);
|
|
311
|
+
applyEllipsisToInput(this._inputElem);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
componentDidRender() {
|
|
315
|
+
if (this._tooltipIconElem && !this._tooltipElem) {
|
|
316
|
+
this.renderGlobalTooltip();
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
componentDidUpdate() {
|
|
320
|
+
if (this._tooltipIconElem && this._tooltipElem) {
|
|
321
|
+
this._tooltipElem.positionTooltip();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
disconnectedCallback() {
|
|
325
|
+
if (this._tooltipPositioningObserver) {
|
|
326
|
+
this._tooltipPositioningObserver.disconnect();
|
|
327
|
+
}
|
|
328
|
+
if (this._observerDebounceTimeout) {
|
|
329
|
+
clearTimeout(this._observerDebounceTimeout);
|
|
330
|
+
}
|
|
331
|
+
this.removeGlobalTooltip();
|
|
332
|
+
}
|
|
273
333
|
render() {
|
|
274
334
|
ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
|
|
275
335
|
return (h(Host, { style: this._hostElement.classList.contains("grid_editor") ? { "height": "100%" } : null }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label && this.mode != "slim" ?
|
|
276
|
-
h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "input__label" : "input__label input__label--disabled"
|
|
277
|
-
: null, h("input", { "data-element-id": ElementIDUtils.getInternalIDInfo("input"), onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: this.password ? "password" : "text", class: this.mode === "slim" ? "input--slim" : "", placeholder: this.mode === "slim" && this.label ? this.label : "", value: this.mask && this.cleanValueMask ? this.applyMask(this.value) : this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }),
|
|
278
|
-
h("
|
|
336
|
+
h("label", { ref: (el) => this._labelElem = el, class: `${this.enabled ? "input__label" : "input__label input__label--disabled"} ${this.errorMessage ? "hasError" : ""}`, onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
337
|
+
: null, h("input", { "data-element-id": ElementIDUtils.getInternalIDInfo("input"), onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: this.password ? "password" : "text", class: this.mode === "slim" ? "input--slim" : "", placeholder: this.mode === "slim" && this.label ? this.label : "", value: this.mask && this.cleanValueMask ? this.applyMask(this.value) : this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), this.canShowError && this.mode != "slim" && this.errorMessage &&
|
|
338
|
+
h("ez-icon", { class: `tooltip-icon ${this.errorMessage ? "hasError" : ""} ${this.hasRightSlotContent ? "rightIconSlot" : ""}`, "data-element-id": ElementIDUtils.getInternalIDInfo("tooltip-icon"), ref: (el) => this._tooltipIconElem = el, iconName: "alert-circle" }), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }, " ")));
|
|
279
339
|
}
|
|
280
340
|
static get is() { return "ez-text-input"; }
|
|
281
341
|
static get encapsulation() { return "shadow"; }
|
|
@@ -504,6 +564,11 @@ export class EzTextInput {
|
|
|
504
564
|
}
|
|
505
565
|
};
|
|
506
566
|
}
|
|
567
|
+
static get states() {
|
|
568
|
+
return {
|
|
569
|
+
"hasRightSlotContent": {}
|
|
570
|
+
};
|
|
571
|
+
}
|
|
507
572
|
static get events() {
|
|
508
573
|
return [{
|
|
509
574
|
"method": "ezChange",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
position: absolute;
|
|
3
|
+
z-index: var(--elevation--24);
|
|
4
|
+
background: var(--color-alert--error-800, #BD0025);
|
|
5
|
+
padding: var(--space--extra-small, 3px) var(--space--small, 6px);
|
|
6
|
+
color: var(--color--inverted);
|
|
7
|
+
border-radius: var(--border--radius-small);
|
|
8
|
+
display: none; /* Initially hide the tooltip */
|
|
9
|
+
transform: translateX(calc(-50% + 12px)) translateY(8px);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.tooltip::after{
|
|
13
|
+
--triangle-size: 8px;
|
|
14
|
+
content: '';
|
|
15
|
+
right: 50%;
|
|
16
|
+
border: var(--triangle-size) solid transparent;
|
|
17
|
+
border-bottom-color: var(--color-alert--error-800, #BD0025);
|
|
18
|
+
position: absolute;
|
|
19
|
+
transform: translateX(calc(50%)) translateY(-100%);
|
|
20
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { ElementIDUtils } from "@sankhyalabs/core";
|
|
2
|
+
import { h } from "@stencil/core";
|
|
3
|
+
export class EzTooltip {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.errorMessage = undefined;
|
|
6
|
+
this.anchoringElement = undefined;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* TODO: Implementar a possibilidade de definir a posição do tooltip.
|
|
10
|
+
*/
|
|
11
|
+
// @Prop() tooltipSide: 'left' | 'right' | 'top' | 'bottom' = 'bottom';
|
|
12
|
+
/**
|
|
13
|
+
* Reposiciona o tooltip de acordo com a posição do elemento de ancoragem.
|
|
14
|
+
*/
|
|
15
|
+
async positionTooltip() {
|
|
16
|
+
const anchorRect = this.anchoringElement.getBoundingClientRect();
|
|
17
|
+
const top = (anchorRect.bottom + window.scrollY);
|
|
18
|
+
const left = (anchorRect.left + window.scrollX);
|
|
19
|
+
this._element.style.top = `${top}px`;
|
|
20
|
+
this._element.style.left = `${left}px`;
|
|
21
|
+
}
|
|
22
|
+
setEvents() {
|
|
23
|
+
window.addEventListener('scroll', () => {
|
|
24
|
+
this.positionTooltip();
|
|
25
|
+
}, { capture: true });
|
|
26
|
+
window.addEventListener('resize', () => {
|
|
27
|
+
this.positionTooltip();
|
|
28
|
+
}, { capture: true });
|
|
29
|
+
this.anchoringElement.addEventListener('mouseover', () => {
|
|
30
|
+
this._element.style.display = 'block';
|
|
31
|
+
});
|
|
32
|
+
this.anchoringElement.addEventListener('mouseout', () => {
|
|
33
|
+
this._element.style.display = 'none';
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
componentDidLoad() {
|
|
37
|
+
this.positionTooltip();
|
|
38
|
+
this.setEvents();
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
return (h("div", { inert: true, class: "tooltip", role: "tooltip", "data-element-id": ElementIDUtils.getInternalIDInfo("tooltip") }, this.errorMessage));
|
|
42
|
+
}
|
|
43
|
+
static get is() { return "ez-tooltip"; }
|
|
44
|
+
static get encapsulation() { return "shadow"; }
|
|
45
|
+
static get originalStyleUrls() {
|
|
46
|
+
return {
|
|
47
|
+
"$": ["ez-tooltip.css"]
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
static get styleUrls() {
|
|
51
|
+
return {
|
|
52
|
+
"$": ["ez-tooltip.css"]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
static get properties() {
|
|
56
|
+
return {
|
|
57
|
+
"errorMessage": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"mutable": false,
|
|
60
|
+
"complexType": {
|
|
61
|
+
"original": "string",
|
|
62
|
+
"resolved": "string",
|
|
63
|
+
"references": {}
|
|
64
|
+
},
|
|
65
|
+
"required": false,
|
|
66
|
+
"optional": false,
|
|
67
|
+
"docs": {
|
|
68
|
+
"tags": [],
|
|
69
|
+
"text": "Mensagem de erro que ser\u00E1 apresentada no tooltip."
|
|
70
|
+
},
|
|
71
|
+
"attribute": "error-message",
|
|
72
|
+
"reflect": false
|
|
73
|
+
},
|
|
74
|
+
"anchoringElement": {
|
|
75
|
+
"type": "unknown",
|
|
76
|
+
"mutable": false,
|
|
77
|
+
"complexType": {
|
|
78
|
+
"original": "HTMLElement",
|
|
79
|
+
"resolved": "HTMLElement",
|
|
80
|
+
"references": {
|
|
81
|
+
"HTMLElement": {
|
|
82
|
+
"location": "global"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"required": false,
|
|
87
|
+
"optional": false,
|
|
88
|
+
"docs": {
|
|
89
|
+
"tags": [],
|
|
90
|
+
"text": "Elemento HTML que ser\u00E1 utilizado como ancoragem do tooltip."
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
static get methods() {
|
|
96
|
+
return {
|
|
97
|
+
"positionTooltip": {
|
|
98
|
+
"complexType": {
|
|
99
|
+
"signature": "() => Promise<void>",
|
|
100
|
+
"parameters": [],
|
|
101
|
+
"references": {
|
|
102
|
+
"Promise": {
|
|
103
|
+
"location": "global"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"return": "Promise<void>"
|
|
107
|
+
},
|
|
108
|
+
"docs": {
|
|
109
|
+
"text": "Reposiciona o tooltip de acordo com a posi\u00E7\u00E3o do elemento de ancoragem.",
|
|
110
|
+
"tags": []
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
static get elementRef() { return "_element"; }
|
|
116
|
+
}
|
|
@@ -296,6 +296,12 @@ export const EzToast: {
|
|
|
296
296
|
new (): EzToast;
|
|
297
297
|
};
|
|
298
298
|
|
|
299
|
+
interface EzTooltip extends Components.EzTooltip, HTMLElement {}
|
|
300
|
+
export const EzTooltip: {
|
|
301
|
+
prototype: EzTooltip;
|
|
302
|
+
new (): EzTooltip;
|
|
303
|
+
};
|
|
304
|
+
|
|
299
305
|
interface EzTree extends Components.EzTree, HTMLElement {}
|
|
300
306
|
export const EzTree: {
|
|
301
307
|
prototype: EzTree;
|