@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-81596.1 → 0.0.0-bugfix-dev-KB-87154.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ez-dropdown_2.cjs.entry.js → ez-dropdown.cjs.entry.js} +0 -61
- package/dist/cjs/ez-search-plus.cjs.entry.js +43 -14
- package/dist/cjs/ez-search-result-list.cjs.entry.js +2 -3
- package/dist/cjs/ez-skeleton.cjs.entry.js +67 -0
- package/dist/cjs/ez-text-input.cjs.entry.js +39 -27
- package/dist/cjs/ez-tooltip.cjs.entry.js +8 -3
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +6 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-search-plus/ez-search-plus.css +1 -1
- package/dist/collection/components/ez-search-plus/ez-search-plus.js +51 -19
- package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.css +4 -10
- package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.js +1 -2
- package/dist/collection/components/ez-text-input/ez-text-input.css +3 -1
- package/dist/collection/components/ez-text-input/ez-text-input.js +40 -26
- package/dist/collection/components/ez-tooltip/ez-tooltip.css +1 -0
- package/dist/collection/components/ez-tooltip/ez-tooltip.js +29 -6
- package/dist/custom-elements/index.js +94 -49
- package/dist/esm/{ez-dropdown_2.entry.js → ez-dropdown.entry.js} +1 -61
- package/dist/esm/ez-search-plus.entry.js +43 -14
- package/dist/esm/ez-search-result-list.entry.js +2 -3
- package/dist/esm/ez-skeleton.entry.js +63 -0
- package/dist/esm/ez-text-input.entry.js +39 -27
- package/dist/esm/ez-tooltip.entry.js +8 -3
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +6 -2
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-2a0b2c5e.entry.js +1 -0
- package/dist/ezui/p-2b4df33d.entry.js +1 -0
- package/dist/ezui/p-4cf0aaeb.entry.js +1 -0
- package/dist/ezui/{p-3176a6ef.entry.js → p-61ac2054.entry.js} +1 -1
- package/dist/ezui/p-6825bdc7.entry.js +1 -0
- package/dist/ezui/p-7742802c.entry.js +1 -0
- package/dist/types/components/ez-search-plus/ez-search-plus.d.ts +6 -4
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +6 -2
- package/dist/types/components/ez-tooltip/ez-tooltip.d.ts +6 -2
- package/dist/types/components.d.ts +19 -11
- package/package.json +1 -1
- package/dist/ezui/p-2f45506d.entry.js +0 -1
- package/dist/ezui/p-81145609.entry.js +0 -1
- package/dist/ezui/p-9142b27a.entry.js +0 -1
- package/dist/ezui/p-c5df78be.entry.js +0 -1
|
@@ -7,7 +7,7 @@ import './CheckMode-bdb2ec19.js';
|
|
|
7
7
|
import { S as SearchMode } from './types-6f6b2650.js';
|
|
8
8
|
import './FormLayout-54092963.js';
|
|
9
9
|
|
|
10
|
-
const ezSearchPlusCss = ":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)}.list-options{margin-top:0px;box-sizing:border-box;width:100%;height:100%;padding:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.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);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:not-allowed;color:var(--ez-search__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;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)}}@supports not (scrollbar-width: thin){.item{padding-right:8px}}.ez-search-plus__container{display:flex;flex-grow:1;gap:3px}.ez-search-plus__text-input{--ez-text-input--border-top-left-radius:0px;--ez-text-input--border-bottom-left-radius:0px}.ez-search-plus__code-input-no-border{--ez-text-input--border-top-right-radius:0px;--ez-text-input--border-bottom-right-radius:0px}.ez-search-plus__code-input{width:
|
|
10
|
+
const ezSearchPlusCss = ":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)}.list-options{margin-top:0px;box-sizing:border-box;width:100%;height:100%;padding:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.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);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:not-allowed;color:var(--ez-search__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;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)}}@supports not (scrollbar-width: thin){.item{padding-right:8px}}.ez-search-plus__container{display:flex;flex-grow:1;gap:3px}.ez-search-plus__text-input{--ez-text-input--border-top-left-radius:0px;--ez-text-input--border-bottom-left-radius:0px}.ez-search-plus__code-input-no-border{--ez-text-input--border-top-right-radius:0px;--ez-text-input--border-bottom-right-radius:0px}.ez-search-plus__code-input{max-width:85px}.ez-search-plus__code-input-full{width:100%}.description-input-container{width:100%}";
|
|
11
11
|
|
|
12
12
|
const EzSearchPlus = class {
|
|
13
13
|
constructor(hostRef) {
|
|
@@ -49,24 +49,29 @@ const EzSearchPlus = class {
|
|
|
49
49
|
async observeValue(newValue, oldValue) {
|
|
50
50
|
const newNormalizedValue = this.normalizeValueToCodeValue(newValue);
|
|
51
51
|
const oldNormalizedValue = this.normalizeValueToCodeValue(oldValue);
|
|
52
|
-
if (newNormalizedValue
|
|
53
|
-
return;
|
|
54
|
-
if (newNormalizedValue == undefined) {
|
|
52
|
+
if (newNormalizedValue === undefined) {
|
|
55
53
|
this.codeValue = undefined;
|
|
56
54
|
this.descriptionValue = undefined;
|
|
57
55
|
this.ezChange.emit(undefined);
|
|
58
56
|
return;
|
|
59
57
|
}
|
|
58
|
+
if (newNormalizedValue === oldNormalizedValue) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
60
61
|
this.codeValue = newNormalizedValue;
|
|
61
62
|
try {
|
|
62
63
|
this.descriptionValue = await this.normalizeCodeToDescriptionValue(newValue);
|
|
64
|
+
if (this.descriptionValue === null || this.descriptionValue === undefined) {
|
|
65
|
+
throw new Error("Valor não encontrado!");
|
|
66
|
+
}
|
|
63
67
|
}
|
|
64
68
|
catch (err) {
|
|
65
69
|
this.value = undefined;
|
|
66
70
|
console.warn("[EzSearchPlus] Erro ao obter descrição do registro.", err);
|
|
67
71
|
throw err;
|
|
68
72
|
}
|
|
69
|
-
this.
|
|
73
|
+
this.value = this.buildCurrentValue();
|
|
74
|
+
this.ezChange.emit(this.value);
|
|
70
75
|
}
|
|
71
76
|
canShowLoadSpinDescription() {
|
|
72
77
|
return this.isLoadingDescription;
|
|
@@ -200,6 +205,9 @@ const EzSearchPlus = class {
|
|
|
200
205
|
if (!loadedOption) {
|
|
201
206
|
return "";
|
|
202
207
|
}
|
|
208
|
+
if (Array.isArray(loadedOption)) {
|
|
209
|
+
return loadedOption[0].label;
|
|
210
|
+
}
|
|
203
211
|
return loadedOption.label;
|
|
204
212
|
}
|
|
205
213
|
finally {
|
|
@@ -241,7 +249,7 @@ const EzSearchPlus = class {
|
|
|
241
249
|
}
|
|
242
250
|
async handleTextInputChangeHandler(event) {
|
|
243
251
|
if (!this.searchDescriptionIsOpen) {
|
|
244
|
-
this._popover.
|
|
252
|
+
this._popover.showUnder(this.el);
|
|
245
253
|
}
|
|
246
254
|
const argument = event.target.value;
|
|
247
255
|
await this.debounceLoaderOptions(argument);
|
|
@@ -256,11 +264,31 @@ const EzSearchPlus = class {
|
|
|
256
264
|
}, this.SEARCH_DESCRIPTION_TIMEOUT);
|
|
257
265
|
});
|
|
258
266
|
}
|
|
267
|
+
updateKeyOption(option) {
|
|
268
|
+
return (Object.assign(Object.assign({}, option), { presentationValue: option.value, presentationLabel: option.label }));
|
|
269
|
+
}
|
|
270
|
+
parseSearchOptions(options = []) {
|
|
271
|
+
if (Array.isArray(options)) {
|
|
272
|
+
const firstOption = options[0];
|
|
273
|
+
if (!firstOption) {
|
|
274
|
+
return [];
|
|
275
|
+
}
|
|
276
|
+
if ("label" in firstOption || "value" in firstOption) {
|
|
277
|
+
return options.map((option) => this.updateKeyOption(option));
|
|
278
|
+
}
|
|
279
|
+
return options;
|
|
280
|
+
}
|
|
281
|
+
if ("label" in options || "value" in options) {
|
|
282
|
+
[this.updateKeyOption(options)];
|
|
283
|
+
}
|
|
284
|
+
return [options];
|
|
285
|
+
}
|
|
259
286
|
async processOptionsLoader(argument) {
|
|
260
287
|
try {
|
|
261
288
|
this.showLoading = true;
|
|
262
289
|
const searchArgument = { mode: SearchMode.PREDICTIVE, argument };
|
|
263
|
-
|
|
290
|
+
const options = await this.optionLoader(searchArgument);
|
|
291
|
+
this.visibleOptions = this.parseSearchOptions(options);
|
|
264
292
|
}
|
|
265
293
|
finally {
|
|
266
294
|
this.showLoading = false;
|
|
@@ -292,12 +320,13 @@ const EzSearchPlus = class {
|
|
|
292
320
|
await ((_a = this._searchList) === null || _a === void 0 ? void 0 : _a.selectCurrentItem());
|
|
293
321
|
}
|
|
294
322
|
async cancelSelection() {
|
|
295
|
-
var _a, _b, _c
|
|
296
|
-
|
|
297
|
-
|
|
323
|
+
var _a, _b, _c;
|
|
324
|
+
const label = typeof this.value === 'object' ? (_a = this.value) === null || _a === void 0 ? void 0 : _a.label : this.value;
|
|
325
|
+
if (this._textInputDescriptionValue && this._textInputDescriptionValue.value != label) {
|
|
326
|
+
this._textInputDescriptionValue.value = label;
|
|
298
327
|
}
|
|
299
|
-
await ((
|
|
300
|
-
(
|
|
328
|
+
await ((_b = this._searchList) === null || _b === void 0 ? void 0 : _b.cancelSelection());
|
|
329
|
+
(_c = this._popover) === null || _c === void 0 ? void 0 : _c.hide();
|
|
301
330
|
}
|
|
302
331
|
async handleInputTab() {
|
|
303
332
|
await this.cancelSelection();
|
|
@@ -350,10 +379,10 @@ const EzSearchPlus = class {
|
|
|
350
379
|
render() {
|
|
351
380
|
ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
352
381
|
return (h(Host, null, h("div", { class: "ez-search-plus__container" }, h("ez-text-input", { ref: elem => this._textInputCodeValue = elem, class: {
|
|
353
|
-
"ez-search-plus__code-input":
|
|
382
|
+
"ez-search-plus__code-input": !this.hideDescriptionInput,
|
|
354
383
|
"ez-search-plus__code-input-no-border": !this.hideDescriptionInput,
|
|
355
384
|
"ez-search-plus__code-input-full": this.hideDescriptionInput
|
|
356
|
-
}, "data-element-id": ElementIDUtils.getInternalIDInfo("codeInput"), "data-slave-mode": "true", enabled: !this.disableCodeInput && this.enabled, mode: this.mode, label: this.getCodLabel(), hasInvalid: !StringUtils.isEmpty(this.errorMessage), errorMessage: this.hideDescriptionInput ? this.errorMessage : "", value: this.codeValue, onFocusout: () => this.handleCodeInputFocusOut(), onFocus: () => this.handleCodeInputFocus() }, this.getLeftIconElement()), !this.hideDescriptionInput && h("div", { class: "description-input-container" }, h("ez-text-input", { ref: elem => this._textInputDescriptionValue = elem, tabIndex: -1, class: "ez-search-plus__text-input", "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), "data-slave-mode": "true", enabled: !this.disableDescriptionInput && this.enabled, label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode, value: this.descriptionValue, onInput: event => this.handleTextInputChangeHandler(event), onFocus: () => this.handleDescriptionInputFocus() }, this.getRightIconElement()), h("ez-popover-plus", { ref: elem => this._popover = elem, anchorElement: this.
|
|
385
|
+
}, "data-element-id": ElementIDUtils.getInternalIDInfo("codeInput"), "data-slave-mode": "true", enabled: !this.disableCodeInput && this.enabled, mode: this.mode, label: this.getCodLabel(), canShowError: this.canShowError, hasInvalid: !StringUtils.isEmpty(this.errorMessage), errorMessage: this.hideDescriptionInput ? this.errorMessage : "", value: this.codeValue, onFocusout: () => this.handleCodeInputFocusOut(), onFocus: () => this.handleCodeInputFocus() }, this.getLeftIconElement()), !this.hideDescriptionInput && (h("div", { class: "description-input-container" }, h("ez-text-input", { ref: elem => this._textInputDescriptionValue = elem, tabIndex: -1, class: "ez-search-plus__text-input", "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), "data-slave-mode": "true", enabled: !this.disableDescriptionInput && this.enabled, label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode, value: this.descriptionValue, onInput: event => this.handleTextInputChangeHandler(event), onFocus: () => this.handleDescriptionInputFocus() }, this.getRightIconElement()), h("ez-popover-plus", { ref: elem => this._popover = elem, anchorElement: this.el, autoClose: true, boxWidth: 'fit-content', overlayType: 'none', useAnchorSize: true, onEzVisibilityChange: (event) => this.searchDescriptionIsOpen = event.detail }, h("ez-search-result-list", { ref: (ref) => this._searchList = ref, showLoading: this.showLoading, visibleOptions: this.visibleOptions, value: this.value, showOptionValue: this.showOptionValue, onChangeValue: (evt) => this.handleSelectItem(evt) })))))));
|
|
357
386
|
}
|
|
358
387
|
get el() { return getElement(this); }
|
|
359
388
|
static get watchers() { return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-baa5e267.js';
|
|
2
2
|
import { StringUtils } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
|
-
const ezSearchResultListCss = ":host{--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__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--small, 6px);--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-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px)}.list-options{position:relative;z-index:var(--more-visible, 2);margin:var(--space--small) 0px;padding:0px;padding-inline-start:0px;box-sizing:border-box;width:100%;height:100%;max-height:350px;min-width:150px;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.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)}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;margin:var(--space--medium) 0px;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)}.
|
|
4
|
+
const ezSearchResultListCss = ":host{--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__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--small, 6px);--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-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px)}.list-options{position:relative;z-index:var(--more-visible, 2);margin:var(--space--small) 0px;padding:0px;padding-inline-start:0px;box-sizing:border-box;width:100%;height:100%;max-height:350px;min-width:150px;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.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)}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;margin:var(--space--medium) 0px;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)}.loading__container{display:flex;flex-direction:column;margin:var(--space--small)}.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}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.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);gap:var(--space--small, 6px)}.preselected{background-color:var(--background--medium)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@supports not (scrollbar-width: thin){.item{padding-right:8px}}";
|
|
5
5
|
|
|
6
6
|
const EzSearchResultList = class {
|
|
7
7
|
constructor(hostRef) {
|
|
@@ -85,8 +85,7 @@ const EzSearchResultList = class {
|
|
|
85
85
|
render() {
|
|
86
86
|
return (h(Host, null, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this.showLoading
|
|
87
87
|
&& this.visibleOptions.length === 0
|
|
88
|
-
&& h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this.showLoading
|
|
89
|
-
&& h("div", { class: "message" }, h("div", { class: "message__loading" })), this.canShowListOptions() && this.visibleOptions.map((opt, index) => this.buildItem(opt, index)))));
|
|
88
|
+
&& h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this.showLoading && (h("div", { class: "loading__container" }, h("ez-skeleton", { count: 4, height: '20px' }))), this.canShowListOptions() && this.visibleOptions.map((opt, index) => this.buildItem(opt, index)))));
|
|
90
89
|
}
|
|
91
90
|
};
|
|
92
91
|
EzSearchResultList.style = ezSearchResultListCss;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-baa5e267.js';
|
|
2
|
+
|
|
3
|
+
const ALLOWED_ANIMATIONS = ['progress', 'progress-dark', 'pulse', 'false'];
|
|
4
|
+
|
|
5
|
+
const ezSkeletonCss = ".skeleton {\n\tbackground: var(--skeleton-background, #eff1f6) no-repeat;\n\n\tborder-radius: var(--skeleton-border-radius, 4px);\n\twidth: var(--skeleton-width, 100%);\n\theight: var(--skeleton-height, 20px);\n\tdisplay: inline-block;\n\tmargin-bottom: var(--skeleton-margin-bottom, 0px);\t\n\tbox-sizing: border-box;\n\toutline: none;\n\toverflow: hidden;\n\tposition: relative;\n\t-webkit-will-change: transform;\n -moz-will-change: transform;\n\twill-change: transform;\n\n\t&:after,\n\t&:before {\n\t\tbox-sizing: border-box;\n\t}\n\n\t&.circle {\n\t\twidth: var(--skeleton-width, 40px);\n\t\theight: var(--skeleton-height, 40px);\n\t\tmargin-bottom: var(--skeleton-margin-bottom, 5px);\n\t\tborder-radius: var(--skeleton-border-radius, 50%);\n\t}\n\n\t&.rect {\n\t\tborder-radius: var(--skeleton-border-radius, 0px);\n\t}\n\n\t&.progress,\n\t&.progress-dark {\n\t\t-webkit-animation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n -moz-animation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n -ms-animation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n\t\tanimation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n\t\tbackground-size: 200px 100%;\n\t}\n\n\t&.progress {\n\t\tbackground-image: -webkit-linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));\n background-image: -moz-linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));\n background-image: -ms-linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));\n background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));\n\t}\n\n\t&.progress-dark {\n\t\tbackground-image: -webkit-linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2), transparent);\n background-image: -moz-linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2), transparent);\n background-image: -ms-linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2), transparent); \n\t\tbackground-image: linear-gradient(90deg,transparent,rgba(0, 0, 0, 0.2),transparent);\n\t}\n\n\t&.pulse {\n\t\t-webkit-animation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n -moz-animation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n -ms-animation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n\t\tanimation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n\t\tanimation-delay: 0.5s;\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t&.pulse,\n\t\t&.progress-dark,\n\t\t&.progress {\n\t\t\tanimation: none;\n\t\t}\n\n\t\t&.progress,\n\t\t&.progress-dark {\n\t\t\tbackground-image: none;\n\t\t}\n\t}\n}\n\n@-webkit-keyframes progress {\n 0% { background-position: -200px 0; }\n 100% { background-position: calc(200px + 100%) 0; }\n}\n@-moz-keyframes progress {\n 0% { background-position: -200px 0; }\n 100% { background-position: calc(200px + 100%) 0; }\n}\n@-ms-keyframes progress {\n 0% { background-position: -200px 0; }\n 100% { background-position: calc(200px + 100%) 0; }\n}\n@keyframes progress {\n\t0% { background-position: -200px 0; }\n\t100% { background-position: calc(200px + 100%) 0; }\n}\n\n@-webkit-keyframes pulse {\n 0% { opacity: 1; }\n 50% { opacity: 0.4; }\n 100% { opacity: 1; }\n}\n@-moz-keyframes pulse {\n 0% { opacity: 1; }\n 50% { opacity: 0.4; }\n 100% { opacity: 1; }\n}\n@-ms-keyframes pulse {\n 0% { opacity: 1; }\n 50% { opacity: 0.4; }\n 100% { opacity: 1; }\n}\n@keyframes pulse {\n\t0% { opacity: 1; }\n\t50% { opacity: 0.4; }\n\t100% { opacity: 1; }\n}";
|
|
6
|
+
|
|
7
|
+
const EzSkeleton = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.items = [];
|
|
11
|
+
this.count = 1;
|
|
12
|
+
this.variant = 'text';
|
|
13
|
+
this.width = null;
|
|
14
|
+
this.height = null;
|
|
15
|
+
this.marginBottom = null;
|
|
16
|
+
this.animation = 'progress';
|
|
17
|
+
}
|
|
18
|
+
componentWillLoad() {
|
|
19
|
+
this.init();
|
|
20
|
+
}
|
|
21
|
+
componentWillUpdate() {
|
|
22
|
+
this.init();
|
|
23
|
+
}
|
|
24
|
+
init() {
|
|
25
|
+
this.items.length = this.count;
|
|
26
|
+
this.items.fill(1);
|
|
27
|
+
if (!ALLOWED_ANIMATIONS.includes(this.animation)) {
|
|
28
|
+
this.animation = 'progress';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
get style() {
|
|
32
|
+
let dimenssionsStyles = {
|
|
33
|
+
width: null,
|
|
34
|
+
height: null,
|
|
35
|
+
marginBottom: null
|
|
36
|
+
};
|
|
37
|
+
if (this.width) {
|
|
38
|
+
dimenssionsStyles.width = this.width;
|
|
39
|
+
}
|
|
40
|
+
if (this.height) {
|
|
41
|
+
dimenssionsStyles.height = this.height;
|
|
42
|
+
}
|
|
43
|
+
if (this.marginBottom) {
|
|
44
|
+
dimenssionsStyles.marginBottom = this.marginBottom;
|
|
45
|
+
}
|
|
46
|
+
return dimenssionsStyles;
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
return this.items.map((_, index) => {
|
|
50
|
+
return (h("span", { key: index, class: {
|
|
51
|
+
circle: this.variant === 'circle',
|
|
52
|
+
rect: this.variant === 'rect',
|
|
53
|
+
progress: this.animation === 'progress',
|
|
54
|
+
'progress-dark': this.animation === 'progress-dark',
|
|
55
|
+
pulse: this.animation === 'pulse',
|
|
56
|
+
skeleton: true
|
|
57
|
+
}, "data-busy": "true", "data-valuemin": "0", "data-valuemax": "100", "data-valuetext": "Loading...", role: "progressbar", tabindex: "0", style: this.style }));
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
EzSkeleton.style = ezSkeletonCss;
|
|
62
|
+
|
|
63
|
+
export { EzSkeleton as ez_skeleton };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
|
|
2
2
|
import { MaskFormatter, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
|
-
const ezTextInputCss = ":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:30px;--ez-text-input--height--slim:32px;--ez-text-input__min-width:0px;--ez-text-input__max-width:100%;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--border-top-left-radius:var(--ez-text-input--border-radius);--ez-text-input--border-bottom-left-radius:var(--ez-text-input--border-radius);--ez-text-input--border-top-right-radius:var(--ez-text-input--border-radius);--ez-text-input--border-bottom-right-radius:var(--ez-text-input--border-radius);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #2B3A54);--ez-text-input__margin-bottom:var(--space--small);--ez-text-input__input--background-color:var(--background--light, #ffffff);--ez-text-input__input--border:var(--border--small, 1px solid);--ez-text-input__input--border-color:var(--color--strokes,#DCE0E8);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--background--medium, #F0F3F7);--ez-text-input__input--disabled--color:var(--text--primary, #626E82);--ez-text-input__input--error--border-color:var(--color-alert--error-800,#BD0025);--ez-text-input__input--noborder-color:white;--ez-text-input__input--padding:var(--space--medium, 6px);--ez-text-input__placeholder--color:var(--text--secondary, #a2abb9);--ez-text-input__tooltip_icon--error--color:var(--color-alert--error-800,#BD0025);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;--ez-text-input__input--focus--icon-color:var(--title--primary, #2B3A54);--ez-text-input__input--disabled--focus--icon-color:var(--text--primary, #626E82);--ez-text-input__tooltip-icon--spacing:var(--space--large);--ez-text-input__tooltip-icon---width:var(--space--large);--ez-text-input__tooltip-icon---horizontal-margin:var(--space--medium, 12px);--ez-text-input__tooltip-icon---vertical-margin:10px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width);min-width:var(--ez-text-input__min-width);max-width:var(--ez-text-input__max-width)}:host(.grid_editor){--ez-text-input--height--slim:25px}input{width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;height:var(--ez-text-input--height);border-top-left-radius:var(--ez-text-input--border-top-left-radius);border-bottom-left-radius:var(--ez-text-input--border-bottom-left-radius);border-top-right-radius:var(--ez-text-input--border-top-right-radius);border-bottom-right-radius:var(--ez-text-input--border-bottom-right-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color);font-weight:var(--ez-text-input--font-weight);padding:var(--ez-text-input__input--padding);margin-bottom:var(--ez-text-input__margin-bottom)}input.no--margin{--ez-text-input__margin-bottom:0}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--left.hasError{padding-right:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.icon--right.hasError{padding-right:calc(var(--ez-text-input__icon--width) + var(--ez-text-input__tooltip-icon--spacing))}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color);padding-right:calc(var(--ez-text-input__tooltip-icon---width) + (2*var(--ez-text-input__tooltip-icon---horizontal-margin)))}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:disabled,input:read-only{cursor:not-allowed}.hasError{color:var(--ez-text-input__tooltip_icon--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--
|
|
4
|
+
const ezTextInputCss = ":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:30px;--ez-text-input--height--slim:32px;--ez-text-input__min-width:0px;--ez-text-input__max-width:100%;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--border-top-left-radius:var(--ez-text-input--border-radius);--ez-text-input--border-bottom-left-radius:var(--ez-text-input--border-radius);--ez-text-input--border-top-right-radius:var(--ez-text-input--border-radius);--ez-text-input--border-bottom-right-radius:var(--ez-text-input--border-radius);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #2B3A54);--ez-text-input__margin-bottom:var(--space--small);--ez-text-input__input--background-color:var(--background--light, #ffffff);--ez-text-input__input--border:var(--border--small, 1px solid);--ez-text-input__input--border-color:var(--color--strokes,#DCE0E8);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--background--medium, #F0F3F7);--ez-text-input__input--disabled--color:var(--text--primary, #626E82);--ez-text-input__input--error--border-color:var(--color-alert--error-800,#BD0025);--ez-text-input__input--noborder-color:white;--ez-text-input__input--padding:var(--space--medium, 6px);--ez-text-input__placeholder--color:var(--text--secondary, #a2abb9);--ez-text-input__tooltip_icon--error--color:var(--color-alert--error-800,#BD0025);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;--ez-text-input__input--focus--icon-color:var(--title--primary, #2B3A54);--ez-text-input__input--disabled--focus--icon-color:var(--text--primary, #626E82);--ez-text-input__tooltip-icon--spacing:var(--space--large);--ez-text-input__tooltip-icon---width:var(--space--large);--ez-text-input__tooltip-icon---horizontal-margin:var(--space--medium, 12px);--ez-text-input__tooltip-icon---vertical-margin:10px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width);min-width:var(--ez-text-input__min-width);max-width:var(--ez-text-input__max-width)}:host(.grid_editor){--ez-text-input--height--slim:25px}input{width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;height:var(--ez-text-input--height);border-top-left-radius:var(--ez-text-input--border-top-left-radius);border-bottom-left-radius:var(--ez-text-input--border-bottom-left-radius);border-top-right-radius:var(--ez-text-input--border-top-right-radius);border-bottom-right-radius:var(--ez-text-input--border-bottom-right-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color);font-weight:var(--ez-text-input--font-weight);padding:var(--ez-text-input__input--padding);margin-bottom:var(--ez-text-input__margin-bottom)}input.no--margin{--ez-text-input__margin-bottom:0}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}input:focus{outline:none;border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--left.hasError{padding-right:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.icon--right.hasError{padding-right:calc(var(--ez-text-input__icon--width) + var(--ez-text-input__tooltip-icon--spacing))}input.hasError{color:var(--ez-text-input--color);border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--error--border-color);padding-right:calc(var(--ez-text-input__tooltip-icon---width) + (2*var(--ez-text-input__tooltip-icon---horizontal-margin)))}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:disabled,input:read-only{cursor:not-allowed}.hasError{color:var(--ez-text-input__tooltip_icon--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--elevation--24, 24);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label.hasError{width:calc(100% - 2*(var(--ez-text-input__tooltip-icon--spacing)))}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input__slim--title{font-size:16px;font-weight:bold}.input--slim::-webkit-input-placeholder,.input--slim:-moz-placeholder,.input--slim::-moz-placeholder,.input--slim:-ms-input-placeholder,.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input__placeholder--color)}.input--slim:disabled::-webkit-input-placeholder,.input--slim:disabled:-moz-placeholder,.input--slim:disabled::-moz-placeholder,.input--slim:disabled:-ms-input-placeholder,.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}input.input__slim--noborder{box-shadow:0 0 0 0;border:0 none;outline:0;background:var(--ez-text-input__input--noborder-color)}ez-icon.tooltip-icon{position:absolute;display:flex;align-items:center;justify-content:center;overflow:hidden;width:var(--ez-text-input__tooltip-icon---width);height:22px;margin:var(--ez-text-input__tooltip-icon---vertical-margin) var(--ez-text-input__tooltip-icon---horizontal-margin);top:0;right:0;z-index:var(--elevation--4);border-radius:var(--ez-text-input--border-radius)}ez-icon.tooltip-icon.rightIconSlot{right:var(--ez-text-input__tooltip-icon--spacing)}ez-icon.tooltip-icon.hasError{--ez-icon--color:var(--ez-text-input__tooltip_icon--error--color)}";
|
|
5
5
|
|
|
6
6
|
const EzTextInput = class {
|
|
7
7
|
constructor(hostRef) {
|
|
8
8
|
registerInstance(this, hostRef);
|
|
9
9
|
this.ezChange = createEvent(this, "ezChange", 7);
|
|
10
|
+
this._isOverflowing = false;
|
|
10
11
|
this.label = undefined;
|
|
11
12
|
this.value = undefined;
|
|
12
13
|
this.enabled = true;
|
|
@@ -22,29 +23,11 @@ const EzTextInput = class {
|
|
|
22
23
|
this.autoFocus = false;
|
|
23
24
|
this.hasRightSlotContent = false;
|
|
24
25
|
}
|
|
25
|
-
observeHasInvalid() {
|
|
26
|
-
if (
|
|
26
|
+
observeHasInvalid(newValue, oldValue) {
|
|
27
|
+
if (newValue === oldValue) {
|
|
27
28
|
return;
|
|
28
|
-
if (this.hasInvalid) {
|
|
29
|
-
this._inputElem.classList.add("hasError");
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
this._inputElem.classList.remove("hasError");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
observeErrorMessage() {
|
|
36
|
-
if (this._inputElem) {
|
|
37
|
-
this.isInvalid().then((hasError) => {
|
|
38
|
-
if (hasError) {
|
|
39
|
-
this._inputElem.classList.add("hasError");
|
|
40
|
-
// this._tooltipPositioningObserver?.observe(this._inputElem);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
this._inputElem.classList.remove("hasError");
|
|
44
|
-
// this.removeGlobalTooltip();
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
29
|
}
|
|
30
|
+
this.validateErrors();
|
|
48
31
|
}
|
|
49
32
|
observeMask() {
|
|
50
33
|
if (this.mask) {
|
|
@@ -62,6 +45,7 @@ const EzTextInput = class {
|
|
|
62
45
|
this._inputElem.value = this.value || "";
|
|
63
46
|
this.handleChange();
|
|
64
47
|
this.adjustFloatingLabel();
|
|
48
|
+
this.checkIsOverflowing();
|
|
65
49
|
if (!this.isSlaveMode()) {
|
|
66
50
|
this.errorMessage = "";
|
|
67
51
|
this.ezChange.emit(this.value);
|
|
@@ -72,6 +56,25 @@ const EzTextInput = class {
|
|
|
72
56
|
//---------------------------------------------
|
|
73
57
|
// Private methods
|
|
74
58
|
//---------------------------------------------
|
|
59
|
+
validateErrors() {
|
|
60
|
+
const hasErrorMessage = this.handleValidateErrorMessage(this.errorMessage);
|
|
61
|
+
const hasError = this.canShowError && (hasErrorMessage || this.hasInvalid);
|
|
62
|
+
this.updateClassError(hasError);
|
|
63
|
+
}
|
|
64
|
+
handleValidateErrorMessage(message = this.errorMessage) {
|
|
65
|
+
return typeof message === "string" && message.trim() !== "";
|
|
66
|
+
}
|
|
67
|
+
updateClassError(status) {
|
|
68
|
+
if (!this._inputElem) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (status) {
|
|
72
|
+
this._inputElem.classList.add("hasError");
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
this._inputElem.classList.remove("hasError");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
75
78
|
adjustFloatingLabel() {
|
|
76
79
|
if (this.label && this._labelElem) {
|
|
77
80
|
if (this._inputElem && !this._inputElem.classList.contains("input--with--label")) {
|
|
@@ -130,7 +133,7 @@ const EzTextInput = class {
|
|
|
130
133
|
* Retorna se o conteúdo é inválido.
|
|
131
134
|
*/
|
|
132
135
|
async isInvalid() {
|
|
133
|
-
return
|
|
136
|
+
return this.handleValidateErrorMessage();
|
|
134
137
|
}
|
|
135
138
|
//---------------------------------------------
|
|
136
139
|
// Event handlers
|
|
@@ -241,7 +244,7 @@ const EzTextInput = class {
|
|
|
241
244
|
}
|
|
242
245
|
slot.name && ElementIDUtils.addIDInfo(content, slot.name);
|
|
243
246
|
}
|
|
244
|
-
this.
|
|
247
|
+
this.validateErrors();
|
|
245
248
|
}
|
|
246
249
|
doFocus() {
|
|
247
250
|
if (this.label && this._labelElem && !this._labelElem.classList.contains("input__label--floated")) {
|
|
@@ -252,6 +255,13 @@ const EzTextInput = class {
|
|
|
252
255
|
getValue() {
|
|
253
256
|
return this.mask && this.cleanValueMask ? this.applyMask(this.value) : this.value;
|
|
254
257
|
}
|
|
258
|
+
checkIsOverflowing() {
|
|
259
|
+
if (this._inputElem) {
|
|
260
|
+
this._isOverflowing = this._inputElem.offsetWidth < this._inputElem.scrollWidth;
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
this._isOverflowing = false;
|
|
264
|
+
}
|
|
255
265
|
//---------------------------------------------
|
|
256
266
|
// Lifecycle web component
|
|
257
267
|
//---------------------------------------------
|
|
@@ -279,10 +289,11 @@ const EzTextInput = class {
|
|
|
279
289
|
}
|
|
280
290
|
componentDidLoad() {
|
|
281
291
|
var _a;
|
|
282
|
-
this.
|
|
292
|
+
this.validateErrors();
|
|
283
293
|
this.observeMask();
|
|
284
294
|
this.adjustFloatingLabel();
|
|
285
295
|
this.adjustBorderInput();
|
|
296
|
+
this.checkIsOverflowing();
|
|
286
297
|
if (this.autoFocus) {
|
|
287
298
|
requestAnimationFrame(() => {
|
|
288
299
|
this.setFocus({ selectText: true });
|
|
@@ -297,13 +308,14 @@ const EzTextInput = class {
|
|
|
297
308
|
ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
|
|
298
309
|
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" ?
|
|
299
310
|
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)
|
|
300
|
-
: 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.getValue(), disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), h("ez-tooltip", { anchoringElement: this._hostElement, message: this.getValue(),
|
|
311
|
+
: 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.getValue(), disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), h("ez-tooltip", { anchoringElement: this._hostElement, message: this.getValue(), active: this._isOverflowing, useAnchorSize: true }), this.canShowError && this.mode != "slim" && this.errorMessage &&
|
|
301
312
|
h("ez-tooltip", { type: "error", message: this.errorMessage }, 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); } }, " ")));
|
|
302
313
|
}
|
|
303
314
|
get _hostElement() { return getElement(this); }
|
|
304
315
|
static get watchers() { return {
|
|
305
316
|
"hasInvalid": ["observeHasInvalid"],
|
|
306
|
-
"errorMessage": ["
|
|
317
|
+
"errorMessage": ["observeHasInvalid"],
|
|
318
|
+
"canShowError": ["observeHasInvalid"],
|
|
307
319
|
"mask": ["observeMask"],
|
|
308
320
|
"value": ["observeValue"]
|
|
309
321
|
}; }
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, h, F as Fragment, g as getElement } from './inde
|
|
|
2
2
|
import { c as computePosition, o as offset, f as flip, s as shift, a as arrow } from './floating-ui.dom.esm-5d3da819.js';
|
|
3
3
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
4
4
|
|
|
5
|
-
const ezTooltipCss = ":host{--triangle-size:8px}.tooltip{position:absolute;z-index:var(--elevation--24);padding:var(--space--extra-small, 3px) var(--space--small, 6px);border-radius:var(--border--radius-small);box-sizing:border-box;font-family:var(--font-pattern\t, 'Roboto', sans-serif);font-size:var(--text--small, 12px);font-weight:var(--text-weight--medium, 400);text-align:center;display:none}.arrow{position:absolute;width:var(--triangle-size);height:var(--triangle-size);transform:rotate(45deg)}.default-tooltip{background:var(--title--primary, #2b3a54);color:var(--color--inverted)}.default-tooltip .arrow{background:var(--title--primary, #2b3a54)}.error-tooltip{background:var(--color-alert--error-800, #BD0025);color:var(--color--error-200, #F7E0E5)}.error-tooltip .arrow{background:var(--color-alert--error-800, #BD0025)}.success-tooltip{background:var(--color--success, #00cb94);color:var(--color--success-200, #EBFFFA)}.success-tooltip .arrow{background:var(--color--success, #00cb94)}.warning-tooltip{background:var(--color--warning, #f2d410);color:var(--color--warning-200, #FDF8D8)}.warning-tooltip .arrow{background:var(--color--warning, #f2d410)}";
|
|
5
|
+
const ezTooltipCss = ":host{--triangle-size:8px}.tooltip{position:absolute;z-index:var(--elevation--24);padding:var(--space--extra-small, 3px) var(--space--small, 6px);border-radius:var(--border--radius-small);box-sizing:border-box;font-family:var(--font-pattern\t, 'Roboto', sans-serif);font-size:var(--text--small, 12px);font-weight:var(--text-weight--medium, 400);text-align:center;width:max-content;display:none}.arrow{position:absolute;width:var(--triangle-size);height:var(--triangle-size);transform:rotate(45deg)}.default-tooltip{background:var(--title--primary, #2b3a54);color:var(--color--inverted)}.default-tooltip .arrow{background:var(--title--primary, #2b3a54)}.error-tooltip{background:var(--color-alert--error-800, #BD0025);color:var(--color--error-200, #F7E0E5)}.error-tooltip .arrow{background:var(--color-alert--error-800, #BD0025)}.success-tooltip{background:var(--color--success, #00cb94);color:var(--color--success-200, #EBFFFA)}.success-tooltip .arrow{background:var(--color--success, #00cb94)}.warning-tooltip{background:var(--color--warning, #f2d410);color:var(--color--warning-200, #FDF8D8)}.warning-tooltip .arrow{background:var(--color--warning, #f2d410)}";
|
|
6
6
|
|
|
7
7
|
const EzTooltip = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -15,7 +15,8 @@ const EzTooltip = class {
|
|
|
15
15
|
this.type = 'default';
|
|
16
16
|
this.debouncingTime = 500;
|
|
17
17
|
this.active = true;
|
|
18
|
-
this.
|
|
18
|
+
this.maxWidth = 200;
|
|
19
|
+
this.useAnchorSize = false;
|
|
19
20
|
}
|
|
20
21
|
watchAnchoringElement(newValue, oldValue) {
|
|
21
22
|
if (newValue) {
|
|
@@ -51,6 +52,10 @@ const EzTooltip = class {
|
|
|
51
52
|
if (!element || !this._opened) {
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
55
|
+
if (this.useAnchorSize) {
|
|
56
|
+
const anchorSize = element.getBoundingClientRect().width;
|
|
57
|
+
this._tooltipElement.style.width = `${anchorSize}px`;
|
|
58
|
+
}
|
|
54
59
|
await computePosition(element, this._tooltipElement, {
|
|
55
60
|
placement: this.placement,
|
|
56
61
|
middleware: [
|
|
@@ -112,7 +117,7 @@ const EzTooltip = class {
|
|
|
112
117
|
"tooltip": true,
|
|
113
118
|
[`${this.type}-tooltip`]: true,
|
|
114
119
|
}, style: {
|
|
115
|
-
|
|
120
|
+
maxWidth: (this.maxWidth && !this.useAnchorSize) ? `${this.maxWidth}px` : undefined,
|
|
116
121
|
}, role: "tooltip", "data-element-id": ElementIDUtils.getInternalIDInfo("tooltip") }), this.message, h("div", { ref: ref => this._arrowElement = ref, class: "arrow" })), h("slot", { onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
117
122
|
}
|
|
118
123
|
get _element() { return getElement(this); }
|