@sankhyalabs/ezui 2.3.13 → 2.4.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-actions-button.cjs.entry.js +1 -0
- package/dist/cjs/ez-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-check.cjs.entry.js +1 -4
- package/dist/cjs/ez-chip.cjs.entry.js +1 -2
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +6 -2
- package/dist/cjs/ez-date-input.cjs.entry.js +2 -2
- package/dist/cjs/ez-date-time-input.cjs.entry.js +2 -2
- package/dist/cjs/ez-filter-input.cjs.entry.js +2 -2
- package/dist/cjs/ez-form.cjs.entry.js +8 -8
- package/dist/cjs/ez-grid.cjs.entry.js +3 -3
- package/dist/cjs/ez-icon.cjs.entry.js +4 -0
- package/dist/cjs/ez-list.cjs.entry.js +4 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +2 -2
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +2 -2
- package/dist/cjs/ez-tabselector.cjs.entry.js +5 -4
- package/dist/cjs/ez-text-area.cjs.entry.js +2 -2
- package/dist/cjs/ez-text-edit.cjs.entry.js +2 -2
- package/dist/cjs/ez-text-input.cjs.entry.js +4 -3
- package/dist/cjs/ez-time-input.cjs.entry.js +2 -2
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +2 -1
- package/dist/collection/components/ez-button/ez-button.js +2 -2
- package/dist/collection/components/ez-check/ez-check.js +1 -4
- package/dist/collection/components/ez-chip/ez-chip.js +1 -2
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +1 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +6 -2
- package/dist/collection/components/ez-date-input/ez-date-input.js +3 -3
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +3 -3
- package/dist/collection/components/ez-filter-input/ez-filter-input.js +2 -2
- package/dist/collection/components/ez-form/ez-form.js +4 -4
- package/dist/collection/components/ez-form/structure/FormItem.js +1 -1
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +3 -3
- package/dist/collection/components/ez-grid/ez-grid.js +3 -3
- package/dist/collection/components/ez-icon/ez-icon.js +6 -2
- package/dist/collection/components/ez-list/ez-list.js +4 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +2 -2
- package/dist/collection/components/ez-radio-button/ez-radio-button.js +1 -1
- package/dist/collection/components/ez-search/ez-search.js +2 -2
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +5 -4
- package/dist/collection/components/ez-text-area/ez-text-area.js +2 -2
- package/dist/collection/components/ez-text-edit/ez-text-edit.js +2 -2
- package/dist/collection/components/ez-text-input/ez-text-input.js +4 -3
- package/dist/collection/components/ez-time-input/ez-time-input.js +2 -2
- package/dist/custom-elements/index.js +56 -46
- package/dist/esm/ez-actions-button.entry.js +2 -1
- package/dist/esm/ez-button.entry.js +2 -2
- package/dist/esm/ez-check.entry.js +1 -4
- package/dist/esm/ez-chip.entry.js +1 -2
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +6 -2
- package/dist/esm/ez-date-input.entry.js +2 -2
- package/dist/esm/ez-date-time-input.entry.js +2 -2
- package/dist/esm/ez-filter-input.entry.js +2 -2
- package/dist/esm/ez-form.entry.js +8 -8
- package/dist/esm/ez-grid.entry.js +3 -3
- package/dist/esm/ez-icon.entry.js +6 -2
- package/dist/esm/ez-list.entry.js +4 -0
- package/dist/esm/ez-number-input.entry.js +2 -2
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +2 -2
- package/dist/esm/ez-tabselector.entry.js +5 -4
- package/dist/esm/ez-text-area.entry.js +2 -2
- package/dist/esm/ez-text-edit.entry.js +2 -2
- package/dist/esm/ez-text-input.entry.js +4 -3
- package/dist/esm/ez-time-input.entry.js +2 -2
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-81fb0c90.entry.js → p-01b79946.entry.js} +1 -1
- package/dist/ezui/p-05dbdaeb.entry.js +1 -0
- package/dist/ezui/{p-ccbe8272.entry.js → p-123a2bd5.entry.js} +1 -1
- package/dist/ezui/{p-941d9bf9.entry.js → p-1a89d3ff.entry.js} +1 -1
- package/dist/ezui/{p-ff5be174.entry.js → p-4c061e51.entry.js} +1 -1
- package/dist/ezui/p-590d9e91.entry.js +1 -0
- package/dist/ezui/p-5cb4b43b.entry.js +1 -0
- package/dist/ezui/p-6d0b9d3c.entry.js +1 -0
- package/dist/ezui/p-7b906805.entry.js +1 -0
- package/dist/ezui/p-7e496975.entry.js +1 -0
- package/dist/ezui/p-87ee59e8.entry.js +1 -0
- package/dist/ezui/p-9334a724.entry.js +1 -0
- package/dist/ezui/p-941e9792.entry.js +1 -0
- package/dist/ezui/p-9def6fd0.entry.js +1 -0
- package/dist/ezui/p-a2e55b33.entry.js +1 -0
- package/dist/ezui/p-a34b52f8.entry.js +1 -0
- package/dist/ezui/p-abcd17e6.entry.js +1 -0
- package/dist/ezui/{p-ede1328a.entry.js → p-ad5fe50b.entry.js} +1 -1
- package/dist/ezui/{p-72d755a8.entry.js → p-ea877274.entry.js} +1 -1
- package/dist/ezui/p-f2627de5.entry.js +1 -0
- package/dist/ezui/p-f2c4e811.entry.js +1 -0
- package/dist/types/components/ez-form/ez-form.d.ts +0 -1
- package/dist/types/components/ez-icon/ez-icon.d.ts +2 -0
- package/dist/types/components/ez-list/ez-list.d.ts +1 -0
- package/package.json +1 -1
- package/dist/ezui/p-1214c5ce.entry.js +0 -1
- package/dist/ezui/p-205fc8bc.entry.js +0 -1
- package/dist/ezui/p-66ebdf34.entry.js +0 -1
- package/dist/ezui/p-6acb7364.entry.js +0 -1
- package/dist/ezui/p-6bcf35fd.entry.js +0 -1
- package/dist/ezui/p-7cf71eb3.entry.js +0 -1
- package/dist/ezui/p-88d0fc06.entry.js +0 -1
- package/dist/ezui/p-8964287f.entry.js +0 -1
- package/dist/ezui/p-ac15d77e.entry.js +0 -1
- package/dist/ezui/p-c2ebc450.entry.js +0 -1
- package/dist/ezui/p-ca9a0a49.entry.js +0 -1
- package/dist/ezui/p-e2337c61.entry.js +0 -1
- package/dist/ezui/p-ec9decf2.entry.js +0 -1
- package/dist/ezui/p-f4d2438e.entry.js +0 -1
- package/dist/ezui/p-fcee02c6.entry.js +0 -1
|
@@ -122,7 +122,7 @@ let EzCollapsibleBox = class {
|
|
|
122
122
|
render() {
|
|
123
123
|
return (h("div", { class: "collapsible-box" }, h("div", { class: "collapsible-box__header" }, h("button", Object.assign({}, (!this._activeEditText ? { onClick: () => { this.showHide(); } } : null), { class: "collapsible-box__title collapsible-box__title--" + (this.headerAlign || "left") +
|
|
124
124
|
(this.iconPlacement === "right" ? " collapsible-box__title--icon-right" : "") +
|
|
125
|
-
(this.value ? " collapsible-box__title--no-margin" : "") }), h("ez-icon", { slot: "icon", "icon-name": "chevron-right", size: this.getHeaderSize(), class: "collapsible-box__icon collapsible-box__icon--" + this.getHeaderSize() + (this.value ? " collapsible-box__icon--collapsed" : "") }), !this._activeEditText ?
|
|
125
|
+
(this.value ? " collapsible-box__title--no-margin" : "") }), h("ez-icon", { slot: "icon", "icon-name": "chevron-right", size: this.getHeaderSize(), class: "collapsible-box__icon collapsible-box__icon--" + this.getHeaderSize() + (this.value ? " collapsible-box__icon--collapsed" : ""), id: "toggleCollapsible" }), !this._activeEditText ?
|
|
126
126
|
h("label", { class: "collapsible-box__label font--" + this.getHeaderSize(), title: this.label, ref: elem => this._refLabel = elem }, h("span", null, this.label), this.editable &&
|
|
127
127
|
h("ez-icon", { slot: "icon", "icon-name": "edit", onClick: (evt) => this.editLabel(evt), title: "Editar" }), this.removable &&
|
|
128
128
|
h("ez-icon", { slot: "icon", "icon-name": "delete", onClick: (evt) => this.confirmRemove(evt), title: "Remover" })) :
|
|
@@ -348,9 +348,13 @@ let EzComboBox = class {
|
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
componentDidRender() {
|
|
351
|
+
var _a;
|
|
351
352
|
if (this._floatingID === undefined) {
|
|
352
353
|
this._listWrapper.remove();
|
|
353
354
|
}
|
|
355
|
+
(_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
|
|
356
|
+
ElementIDUtils.addIDInfoIfNotExists(elem, "itemComboBox");
|
|
357
|
+
});
|
|
354
358
|
}
|
|
355
359
|
componentDidLoad() {
|
|
356
360
|
CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
@@ -447,8 +451,8 @@ let EzComboBox = class {
|
|
|
447
451
|
}
|
|
448
452
|
render() {
|
|
449
453
|
var _a;
|
|
450
|
-
|
|
451
|
-
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo(
|
|
454
|
+
ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
455
|
+
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot: this.searchMode ? "leftIcon" : "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, h("ez-icon", { iconName: this.searchMode ? "search" : "chevron-down" })), this.searchMode && ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value) && (this._criteria || this.value)
|
|
452
456
|
? h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
|
|
453
457
|
: undefined), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("div", { class: "list-options", ref: elem => this._optionsList = elem }, this._visibleOptions.length === 0
|
|
454
458
|
&& h("div", { class: "message" }, !this._showLoading && h("span", { class: "message__no-result" }, this._textEmptyList), this._showLoading && h("div", { class: "message__loading" })), this.showOptionValue
|
|
@@ -140,8 +140,8 @@ let EzDateInput = class {
|
|
|
140
140
|
this.setInputValue();
|
|
141
141
|
}
|
|
142
142
|
render() {
|
|
143
|
-
|
|
144
|
-
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo(
|
|
143
|
+
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
144
|
+
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: (evt) => this.handleInput(evt), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { "data-element-id": ElementIDUtils.getInternalIDInfo("calendar"), onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem })));
|
|
145
145
|
}
|
|
146
146
|
get _elem() { return getElement(this); }
|
|
147
147
|
static get watchers() { return {
|
|
@@ -195,8 +195,8 @@ let EzDateTimeInput = class {
|
|
|
195
195
|
this.setInputValue();
|
|
196
196
|
}
|
|
197
197
|
render() {
|
|
198
|
-
|
|
199
|
-
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo(
|
|
198
|
+
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
199
|
+
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("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() }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { "data-element-id": ElementIDUtils.getInternalIDInfo("calendar"), onEzChange: (event) => { this.changeValue(this._calendar.value); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem, time: true, showSeconds: this.showSeconds })));
|
|
200
200
|
}
|
|
201
201
|
get _elem() { return getElement(this); }
|
|
202
202
|
static get watchers() { return {
|
|
@@ -62,8 +62,8 @@ let EzFilterInput = class {
|
|
|
62
62
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
63
63
|
}
|
|
64
64
|
render() {
|
|
65
|
-
|
|
66
|
-
return (h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo(
|
|
65
|
+
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
66
|
+
return (h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("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, mode: this.mode }, h("ez-icon", { slot: "leftIcon", iconName: "search" })));
|
|
67
67
|
}
|
|
68
68
|
get _elem() { return getElement(this); }
|
|
69
69
|
static get watchers() { return {
|
|
@@ -114,7 +114,7 @@ const buildFromConfig = (config, dataUnit) => {
|
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
(_b = config === null || config === void 0 ? void 0 : config.fields) === null || _b === void 0 ? void 0 : _b.forEach((field) => {
|
|
117
|
-
var _a, _b, _c;
|
|
117
|
+
var _a, _b, _c, _d;
|
|
118
118
|
if (field.visible !== false) {
|
|
119
119
|
const tabConfig = getTabConfig(field.tab || "__main", sheets);
|
|
120
120
|
if (hiddenTabs.has(tabConfig.label)) {
|
|
@@ -130,10 +130,10 @@ const buildFromConfig = (config, dataUnit) => {
|
|
|
130
130
|
requiredFields.push(field.name);
|
|
131
131
|
}
|
|
132
132
|
const cleanOnCopy = field.cleanOnCopy == undefined ? (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy : field.cleanOnCopy;
|
|
133
|
-
if (cleanOnCopy || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum)) {
|
|
133
|
+
if (cleanOnCopy || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum) || ((_c = descriptor.properties) === null || _c === void 0 ? void 0 : _c.cleanOnCopy)) {
|
|
134
134
|
cleanOnCopyFields.push(field.name);
|
|
135
135
|
}
|
|
136
|
-
const defaultValue = field.defaultValue == undefined ? (
|
|
136
|
+
const defaultValue = field.defaultValue == undefined ? (_d = descriptor.properties) === null || _d === void 0 ? void 0 : _d.defaultValue : field.defaultValue;
|
|
137
137
|
if (defaultValue) {
|
|
138
138
|
defaultValues[field.name] = field.defaultValue;
|
|
139
139
|
}
|
|
@@ -270,7 +270,7 @@ const buildField = (field) => {
|
|
|
270
270
|
const FormItem = ({ source }) => {
|
|
271
271
|
if ("items" in source) {
|
|
272
272
|
const fieldSet = source;
|
|
273
|
-
return h("ez-collapsible-box", { label: source.label, "header-size": "large" }, fieldSet.items.map(fi => buildField(fi)));
|
|
273
|
+
return h("ez-collapsible-box", { label: source.label, "header-size": "large", key: source.label }, fieldSet.items.map(fi => buildField(fi)));
|
|
274
274
|
}
|
|
275
275
|
else {
|
|
276
276
|
return buildField(source);
|
|
@@ -948,10 +948,10 @@ let EzForm = class {
|
|
|
948
948
|
const tabs = allSheets.map((sheet, index) => {
|
|
949
949
|
return { tabKey: sheet.name, label: sheet.label, index };
|
|
950
950
|
});
|
|
951
|
-
const idTabSelector =
|
|
951
|
+
const idTabSelector = `selector`;
|
|
952
952
|
result.push(h("ez-tabselector", { tabs: this.buildIdTabSelector(tabs), onEzChange: (evt) => this._store.dispatch(changeTab(evt.detail)), selectedTab: currentSheet.name, "data-element-id": idTabSelector }));
|
|
953
953
|
}
|
|
954
|
-
const idFormSheet = `${
|
|
954
|
+
const idFormSheet = `${StringUtils.replaceAccentuatedChars(StringUtils.toCamelCase(currentSheet.label), false)}_selectorContainer`;
|
|
955
955
|
result.push(h(FormSheet, { store: this._store, source: currentSheet, dataElementId: idFormSheet }));
|
|
956
956
|
return result;
|
|
957
957
|
}
|
|
@@ -1016,7 +1016,7 @@ let EzForm = class {
|
|
|
1016
1016
|
this._staticFields = Array.from(this._element.querySelectorAll("[data-field-name]"));
|
|
1017
1017
|
this.processMetadata();
|
|
1018
1018
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
1019
|
-
|
|
1019
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
1020
1020
|
}
|
|
1021
1021
|
componentDidRender() {
|
|
1022
1022
|
this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")));
|
|
@@ -1029,7 +1029,7 @@ let EzForm = class {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
buildIdTabSelector(tabs) {
|
|
1031
1031
|
if (tabs) {
|
|
1032
|
-
tabs.forEach(tab => tab[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] =
|
|
1032
|
+
tabs.forEach(tab => tab[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = StringUtils.toCamelCase(tab.label));
|
|
1033
1033
|
}
|
|
1034
1034
|
return tabs;
|
|
1035
1035
|
}
|
|
@@ -115419,9 +115419,9 @@ let EzGrid = class {
|
|
|
115419
115419
|
}
|
|
115420
115420
|
buildDataElementId() {
|
|
115421
115421
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
115422
|
-
|
|
115423
|
-
const dtInfo = { id:
|
|
115424
|
-
ElementIDUtils.addIDInfo(this._refPaginationControl,
|
|
115422
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
115423
|
+
const dtInfo = { id: "ezGrid" };
|
|
115424
|
+
ElementIDUtils.addIDInfo(this._refPaginationControl, "pagination", dtInfo);
|
|
115425
115425
|
}
|
|
115426
115426
|
previousPage() {
|
|
115427
115427
|
if (this.dataUnit) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-7bc778b3.js';
|
|
2
|
-
import { StringUtils } from '@sankhyalabs/core';
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-7bc778b3.js';
|
|
2
|
+
import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
4
|
const ezIconCss = ":host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{color:var(--ez-icon--color)}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{font-family:'ez-icons' !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-icon-2chevron-down:before{content:\"\\ea01\"}.ez-icon-2chevron-up:before{content:\"\\ea02\"}.ez-icon-account-outline:before{content:\"\\ea03\"}.ez-icon-account:before{content:\"\\ea04\"}.ez-icon-actions-sprite:before{content:\"\\ea05\"}.ez-icon-alert-circle-inverted:before{content:\"\\ea06\"}.ez-icon-alert-circle:before{content:\"\\ea07\"}.ez-icon-alert-mail:before{content:\"\\ea08\"}.ez-icon-alert-popup:before{content:\"\\ea09\"}.ez-icon-anexo:before{content:\"\\ea0a\"}.ez-icon-apps:before{content:\"\\ea0b\"}.ez-icon-arrow_back:before{content:\"\\ea0c\"}.ez-icon-arrow_downward:before{content:\"\\ea0d\"}.ez-icon-balance:before{content:\"\\ea0e\"}.ez-icon-bell-inverted:before{content:\"\\ea0f\"}.ez-icon-bell:before{content:\"\\ea10\"}.ez-icon-boleto:before{content:\"\\ea11\"}.ez-icon-business-center:before{content:\"\\ea12\"}.ez-icon-calendar-clock:before{content:\"\\ea13\"}.ez-icon-calendar:before{content:\"\\ea14\"}.ez-icon-cash-remove:before{content:\"\\ea15\"}.ez-icon-check-circle-inverted:before{content:\"\\ea16\"}.ez-icon-check-circle:before{content:\"\\ea17\"}.ez-icon-check:before{content:\"\\ea18\"}.ez-icon-chevron-down:before{content:\"\\ea19\"}.ez-icon-chevron-left:before{content:\"\\ea1a\"}.ez-icon-chevron-right:before{content:\"\\ea1b\"}.ez-icon-chevron-up:before{content:\"\\ea1c\"}.ez-icon-circle--medium:before{content:\"\\ea1d\"}.ez-icon-circle:before{content:\"\\ea1e\"}.ez-icon-cleaning:before{content:\"\\ea1f\"}.ez-icon-clipboard:before{content:\"\\ea20\"}.ez-icon-close:before{content:\"\\ea21\"}.ez-icon-cobrar:before{content:\"\\ea22\"}.ez-icon-configuration:before{content:\"\\ea23\"}.ez-icon-copy:before{content:\"\\ea24\"}.ez-icon-credit_card:before{content:\"\\ea25\"}.ez-icon-crop:before{content:\"\\ea26\"}.ez-icon-custom:before{content:\"\\ea27\"}.ez-icon-delete:before{content:\"\\ea28\"}.ez-icon-description:before{content:\"\\ea29\"}.ez-icon-dot-notification:before{content:\"\\ea2a\"}.ez-icon-dots-horizontal:before{content:\"\\ea2b\"}.ez-icon-dots-vertical:before{content:\"\\ea2c\"}.ez-icon-drag-indicator:before{content:\"\\ea2d\"}.ez-icon-dual-chevron-down:before{content:\"\\ea2e\"}.ez-icon-dual-chevron-up:before{content:\"\\ea2f\"}.ez-icon-edit-file:before{content:\"\\ea30\"}.ez-icon-edit-table:before{content:\"\\ea31\"}.ez-icon-edit-time:before{content:\"\\ea32\"}.ez-icon-edit:before{content:\"\\ea33\"}.ez-icon-email:before{content:\"\\ea34\"}.ez-icon-expand:before{content:\"\\ea35\"}.ez-icon-extrato:before{content:\"\\ea36\"}.ez-icon-eye-off:before{content:\"\\ea37\"}.ez-icon-eye:before{content:\"\\ea38\"}.ez-icon-favorite:before{content:\"\\ea39\"}.ez-icon-file-download:before{content:\"\\ea3a\"}.ez-icon-file-upload:before{content:\"\\ea3b\"}.ez-icon-filter:before{content:\"\\ea3c\"}.ez-icon-find-file:before{content:\"\\ea3d\"}.ez-icon-find-page:before{content:\"\\ea3e\"}.ez-icon-format-color-fill:before{content:\"\\ea3f\"}.ez-icon-graph_bar:before{content:\"\\ea40\"}.ez-icon-handshake:before{content:\"\\ea41\"}.ez-icon-help-inverted:before{content:\"\\ea42\"}.ez-icon-help:before{content:\"\\ea43\"}.ez-icon-home:before{content:\"\\ea44\"}.ez-icon-icons104:before{content:\"\\ea45\"}.ez-icon-language:before{content:\"\\ea46\"}.ez-icon-launch:before{content:\"\\ea47\"}.ez-icon-lightbulb:before{content:\"\\ea48\"}.ez-icon-list:before{content:\"\\ea49\"}.ez-icon-location:before{content:\"\\ea4a\"}.ez-icon-lock-outline:before{content:\"\\ea4b\"}.ez-icon-lock:before{content:\"\\ea4c\"}.ez-icon-menu:before{content:\"\\ea4d\"}.ez-icon-mid:before{content:\"\\ea4e\"}.ez-icon-minus:before{content:\"\\ea4f\"}.ez-icon-money-off:before{content:\"\\ea50\"}.ez-icon-money:before{content:\"\\ea51\"}.ez-icon-more:before{content:\"\\ea52\"}.ez-icon-north-west:before{content:\"\\ea53\"}.ez-icon-number:before{content:\"\\ea54\"}.ez-icon-ordem-ascendente:before{content:\"\\ea55\"}.ez-icon-ordem-descendente:before{content:\"\\ea56\"}.ez-icon-parcelar:before{content:\"\\ea57\"}.ez-icon-pause:before{content:\"\\ea58\"}.ez-icon-payments:before{content:\"\\ea59\"}.ez-icon-play:before{content:\"\\ea5a\"}.ez-icon-plus:before{content:\"\\ea5b\"}.ez-icon-power:before{content:\"\\ea5c\"}.ez-icon-print:before{content:\"\\ea5d\"}.ez-icon-push-pin:before{content:\"\\ea5e\"}.ez-icon-receipt:before{content:\"\\ea5f\"}.ez-icon-restore:before{content:\"\\ea60\"}.ez-icon-return:before{content:\"\\ea61\"}.ez-icon-save:before{content:\"\\ea62\"}.ez-icon-search:before{content:\"\\ea63\"}.ez-icon-settings-inverted:before{content:\"\\ea64\"}.ez-icon-settings:before{content:\"\\ea65\"}.ez-icon-share:before{content:\"\\ea66\"}.ez-icon-shield:before{content:\"\\ea67\"}.ez-icon-south-east:before{content:\"\\ea68\"}.ez-icon-sync:before{content:\"\\ea69\"}.ez-icon-table:before{content:\"\\ea6a\"}.ez-icon-text:before{content:\"\\ea6b\"}.ez-icon-timeline:before{content:\"\\ea6c\"}.ez-icon-timer-outline:before{content:\"\\ea6d\"}.ez-icon-tune:before{content:\"\\ea6e\"}.ez-icon-un-pin:before{content:\"\\ea6f\"}.ez-icon-unfold_less:before{content:\"\\ea70\"}.ez-icon-unfold_more:before{content:\"\\ea71\"}.ez-icon-user-circle:before{content:\"\\ea72\"}.ez-icon-warning-outline:before{content:\"\\ea73\"}.ez-icon-warning_triangle:before{content:\"\\ea74\"}.ez-icon-whatshot:before{content:\"\\ea75\"}.x-small--font{font-size:12px}.small--font{font-size:16px}.medium--font{font-size:20px}.large--font{font-size:24px}.x-large--font{font-size:30px}";
|
|
5
5
|
|
|
@@ -28,9 +28,13 @@ let EzIcon = class {
|
|
|
28
28
|
return h("img", { class: this.size, src: this.href });
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
+
componentDidLoad() {
|
|
32
|
+
ElementIDUtils.addIDInfo(this._hostElement, "icon");
|
|
33
|
+
}
|
|
31
34
|
render() {
|
|
32
35
|
return (h(Host, null, this.getIconContent()));
|
|
33
36
|
}
|
|
37
|
+
get _hostElement() { return getElement(this); }
|
|
34
38
|
};
|
|
35
39
|
EzIcon.style = ezIconCss;
|
|
36
40
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-7bc778b3.js';
|
|
2
|
+
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
2
3
|
|
|
3
4
|
const ezListCss = ":host{--ez-list__host--z-index:var(--visible, 1);--ez-list__host--border-radius:var(--border--radius-medium, 12px);--ez-list__host--padding:var(--space--medium, 12px);--ez-list__icon--padding:var(--space--small, 6px);--ez-list__icon--color:#AFB6C0;--ez-list__item--margin:0 var(--space--small, 6px);--ez-list__item--color:var(--title--primary, #2b3a54);--ez-list__item--border-bottom:var(--border--small, 1px solid);--ez-list__item--border-color:var(--title--primary, #2b3a54);--ez-list__item--font-family:var(--font-pattern, \"Roboto\");--ez-list__item--font-size:var(--text--medium, 14px);--ez-list__selectable--padding-right:var(--space--small, 6px);--ez-list__selectable--padding-left:var(--space--small, 6px);--ez-list__selected-item--border-radius:var(--border--radius-small, 6px);--ez-list__selected-item--background-color:var(--color--primary-300, #E2F4EF);--ez-list__group--font-family:var(--font-pattern, \"Roboto\");--ez-list__group--font-size:var(--text--medium, 14px);--ez-list__group--font-weight:var(--text-weight--large, 600);--ez-list__group--padding-bottom:var(--space-small, 6px);--ez-list__group-overlay--font-family:var(--font-pattern, \"Roboto\");--ez-list__group-overlay--font-size:var(--text--medium, 14px);--ez-list__group-container-scrollbar--border-radius:var(--border--radius-small, 6px);--ez-list__group-container-scrollbar--width:var(--space--medium, 12px);--ez-list__group-container-scrollbar--background-color-primary:var(--scrollbar--primary, #2B3A54);--ez-list__group-container-scrollbar--background-color-secondary:var(--scrollbar--secondary, #E5EAF0);--ez-list__over--border--color:var(--color--primary, #008561);--ez-list__last-droppable-space--height:var(--space--small, 6px);--ez-list__draggable-scrollbar--border-radius:var(--border--radius-small, 6px);--ez-list__draggable-scrollbar--width:var(--space--medium, 12px);--ez-list__draggable-scrollbar--background-color-primary:var(--scrollbar--primary, #2B3A54);--ez-list__draggable-scrollbar--background-color-secondary:var(--scrollbar--secondary, #E5EAF0);--ez-list__draggable-list--padding-bottom:var(--space--small, 6px);--ez-list__draggable-icon--image:url('data:image/svg+xml;utf8,<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m 6.75,2.25 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z\"/></svg>');max-height:100%;width:100%;background-color:#fff;display:flex;z-index:var(--ez-list__host--z-index)}p{margin:0}.draggable{display:flex;align-items:center;border-top:1px dashed #fff;justify-content:space-between;background-color:#fff;font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);flex:1;width:100%}.dragging{background:#FFFFFF;border:1px solid #008561;box-sizing:border-box;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);border-radius:6px}.selectable{cursor:pointer;padding-right:var(--ez-list__selectable--padding-right);padding-left:var(--ez-list__selectable--padding-left)}.selectable-container{margin:0px !important}.item-content{display:flex;justify-content:flex-start;align-items:center;width:100%}.group-container .item-content{max-width:calc(100% - 41px)}.items-container .item-content{max-width:calc(100% - 100px)}.draggable-list{color:var(--text-color);padding:0;margin:0;width:100%;max-height:100%;scrollbar-width:thin;scrollbar-color:var(--ez-list__draggable-scrollbar--background-color-primary) var(--ez-list__draggable-scrollbar--background-color-secondary)}.draggable-list li{background-color:#fff;display:flex;margin:var(--ez-list__item--margin);font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);color:var(--ez-list__item--color);height:32px}.over{border-top:1px dashed var(--ez-list__over--border--color)}.last-droppable-space{height:var(--ez-list__last-droppable-space--height)}.draggable-selected{background-color:var(--background--strong) !important}.draggable-selected div:hover{background-color:var(--background--strong) !important}.draggable-list::-webkit-scrollbar-track{background-color:var(--ez-list__draggable-scrollbar--background-color-secondary)}.draggable-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__draggable-scrollbar--background-color-primary);border-radius:var(--ez-list__draggable-scrollbar--border-radius)}.draggable-list::-webkit-scrollbar{background-color:var(--ez-list__draggable-scrollbar--background-color-secondary);width:var(--ez-list__draggable-scrollbar--width);max-width:var(--ez-list__draggable-scrollbar--width);min-width:var(--ez-list__draggable-scrollbar--width)}.draggable-icon{align-items:flex-start;display:flex;outline:none;border:none;background-color:unset}.draggable-icon::after{content:'';display:flex;background-color:var(--ez-list__icon--color);width:18px;height:18px;-webkit-mask-image:var(--ez-list__draggable-icon--image);mask-image:var(--ez-list__draggable-icon--image)}*{box-sizing:border-box}.checkbox{width:fit-content}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.group-container{display:flex;flex-direction:column;max-height:100%;overflow-y:auto;outline:none;width:100%;scrollbar-width:thin;scrollbar-color:var(--ez-list__group-container-scrollbar--background-color-primary) var(--ez-list__group-container-scrollbar--background-color-secondary)}.group-name{font-family:var(--ez-list__group--font-family);font-size:var(--ez-list__group--font-size);font-weight:var(--ez-list__group--font-weight);padding-bottom:var(--ez-list__group--padding-bottom);-webkit-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;user-select:none}.group{display:flex;flex-direction:column}.group-container::-webkit-scrollbar-track{background-color:var(--ez-list__group-container-scrollbar--background-color-secondary)}.group-container::-webkit-scrollbar-thumb{background-color:var(--ez-list__group-container-scrollbar--background-color-primary);border-radius:var(--ez-list__group-container-scrollbar--border-radius)}.group-container::-webkit-scrollbar{background-color:var(--ez-list__group-container-scrollbar--background-color-secondary);width:var(--ez-list__group-container-scrollbar--width);max-width:var(--ez-list__group-container-scrollbar--width);min-width:var(--ez-list__group-container-scrollbar--width)}.section-container{display:flex;position:relative;height:100%}.items-container{width:100%;max-height:100%;overflow-y:auto;outline:none;scrollbar-width:thin;scrollbar-color:var(--ez-list__draggable-scrollbar--background-color-primary) var(--ez-list__draggable-scrollbar--background-color-secondary)}.group-items-container{width:100%;max-height:100%;height:100%;outline:none}.items-container::-webkit-scrollbar-track{background-color:var(--ez-list__draggable-scrollbar--background-color-secondary)}.items-container::-webkit-scrollbar-thumb{background-color:var(--ez-list__draggable-scrollbar--background-color-primary);border-radius:var(--ez-list__draggable-scrollbar--border-radius)}.items-container::-webkit-scrollbar{background-color:var(--ez-list__draggable-scrollbar--background-color-secondary);width:var(--ez-list__draggable-scrollbar--width);max-width:var(--ez-list__draggable-scrollbar--width);min-width:var(--ez-list__draggable-scrollbar--width)}.group-overlay{font-family:var(--ez-list__group-overlay--font-family);font-size:var(--ez-list__group-overlay--font-size);background:rgba(226, 244, 239, 0.8);border:1px solid #008561;border-radius:8px;position:absolute;display:none;place-items:center;top:0;bottom:0;left:0;right:0;z-index:2;margin:0;cursor:pointer}.presetedHeight{min-height:100px}.overlay-text{position:absolute;top:50%;left:50%;font-size:50px;color:white;transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%)}.selected-item{background:var(--ez-list__selected-item--background-color);border-radius:var(--ez-list__selected-item--border-radius)}.slot-item{align-items:flex-end}.overGroup{background:rgba(226, 244, 239, 0.8);border:1px solid #008561;box-sizing:border-box;border-radius:8px;padding-top:6px}";
|
|
4
5
|
|
|
@@ -162,6 +163,9 @@ let EzList = class {
|
|
|
162
163
|
componentWillRender() {
|
|
163
164
|
this.createList();
|
|
164
165
|
}
|
|
166
|
+
componentDidLoad() {
|
|
167
|
+
ElementIDUtils.addIDInfo(this._element);
|
|
168
|
+
}
|
|
165
169
|
onDrop(ev, dragEndItem) {
|
|
166
170
|
this.removeOverClass();
|
|
167
171
|
this.setSelection(undefined);
|
|
@@ -135,8 +135,8 @@ let EzNumberInput = class {
|
|
|
135
135
|
this.setInputValue();
|
|
136
136
|
}
|
|
137
137
|
render() {
|
|
138
|
-
|
|
139
|
-
return (h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo(
|
|
138
|
+
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
139
|
+
return (h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode }));
|
|
140
140
|
}
|
|
141
141
|
get _elem() { return getElement(this); }
|
|
142
142
|
static get watchers() { return {
|
|
@@ -42,7 +42,7 @@ let EzRadioButton = class {
|
|
|
42
42
|
this.ezChange.emit(this.value);
|
|
43
43
|
}
|
|
44
44
|
render() {
|
|
45
|
-
return (h(Host, null, this.label && h("label", { class: "label" }, this.label), h("div", { class: "form form--" + this.direction }, this._options.map((option, key) => h("div", { class: "form__group" }, h("input", { id: "rad" + key, class: "form__radio", name: "theradio", type: "radio", value: option.value, onChange: (ev) => { this.handleInputChange(ev); }, disabled: !this.enabled, checked: option.value === this.value }), h("label", { htmlFor: "rad" + key, class: "form__label" }, option.label))))));
|
|
45
|
+
return (h(Host, null, this.label && h("label", { class: "label" }, this.label), h("div", { class: "form form--" + this.direction }, this._options.map((option, key) => h("div", { class: "form__group" }, h("input", { id: "rad" + key, class: "form__radio", name: "theradio", type: "radio", value: option.value, onChange: (ev) => { this.handleInputChange(ev); }, disabled: !this.enabled, checked: option.value === this.value, "data-element-id": ElementIDUtils.getInternalIDInfo(`input_${option.value}`) }), h("label", { htmlFor: "rad" + key, class: "form__label" }, option.label))))));
|
|
46
46
|
}
|
|
47
47
|
get hostElement() { return getElement(this); }
|
|
48
48
|
};
|
|
@@ -69,8 +69,8 @@ let EzSearch = class {
|
|
|
69
69
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
|
|
70
70
|
}
|
|
71
71
|
render() {
|
|
72
|
-
|
|
73
|
-
return (h("ez-combo-box", { "data-element-id": ElementIDUtils.getInternalIDInfo(
|
|
72
|
+
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
73
|
+
return (h("ez-combo-box", { "data-element-id": ElementIDUtils.getInternalIDInfo("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
74
|
}
|
|
75
75
|
;
|
|
76
76
|
get _elem() { return getElement(this); }
|
|
@@ -72,7 +72,6 @@ let EzTabselector = class {
|
|
|
72
72
|
this.setFocusedBtn(false, tab.index);
|
|
73
73
|
}
|
|
74
74
|
componentWillRender() {
|
|
75
|
-
ElementIDUtils.addIDInfo(this._hostElem);
|
|
76
75
|
if (!this._processedTabs) {
|
|
77
76
|
this._processedTabs = [];
|
|
78
77
|
if (this.tabs) {
|
|
@@ -104,10 +103,12 @@ let EzTabselector = class {
|
|
|
104
103
|
this.updateScroll();
|
|
105
104
|
}
|
|
106
105
|
componentDidLoad() {
|
|
106
|
+
ElementIDUtils.addIDInfo(this._hostElem, "itemsSelector");
|
|
107
107
|
this._hostElem.shadowRoot.querySelectorAll('button[name="tab-button"]').forEach((elem) => {
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
108
|
+
var _a;
|
|
109
|
+
const label = (_a = elem.querySelector('span.tab-label')) === null || _a === void 0 ? void 0 : _a.innerText;
|
|
110
|
+
const dataInfo = { id: `${StringUtils.toCamelCase(label)}` };
|
|
111
|
+
ElementIDUtils.addIDInfo(elem, "itemSelector", dataInfo);
|
|
111
112
|
});
|
|
112
113
|
}
|
|
113
114
|
handleSlotChange(ev) {
|
|
@@ -141,10 +141,10 @@ let EzTextArea = class {
|
|
|
141
141
|
this.observeMode();
|
|
142
142
|
}
|
|
143
143
|
render() {
|
|
144
|
-
|
|
144
|
+
ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
|
|
145
145
|
return (h(Host, null, h("div", { class: "textarea", ref: (el) => this._container = el }, this.label && this.mode != "slim" ?
|
|
146
146
|
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)
|
|
147
|
-
: null, h("textarea", { onFocus: () => this.handleFocus(), "data-element-id": ElementIDUtils.getInternalIDInfo(
|
|
147
|
+
: null, h("textarea", { onFocus: () => this.handleFocus(), "data-element-id": ElementIDUtils.getInternalIDInfo("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 })), this.canShowError && this.mode != "slim" &&
|
|
148
148
|
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
149
149
|
}
|
|
150
150
|
get _hostElement() { return getElement(this); }
|
|
@@ -91,8 +91,8 @@ let EzTextEdit = class {
|
|
|
91
91
|
this.setStyledInput();
|
|
92
92
|
}
|
|
93
93
|
render() {
|
|
94
|
-
|
|
95
|
-
return (h(Host, null, h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }), h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo(
|
|
94
|
+
ElementIDUtils.addIDInfoIfNotExists(this._element, 'input');
|
|
95
|
+
return (h(Host, null, h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }), h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("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 }), h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }), h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.cancelEdition.emit(); } })));
|
|
96
96
|
}
|
|
97
97
|
get _element() { return getElement(this); }
|
|
98
98
|
};
|
|
@@ -192,6 +192,7 @@ let EzTextInput = class {
|
|
|
192
192
|
this._labelElem.classList.add("input__label--right");
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
+
slot.name && ElementIDUtils.addIDInfo(content, slot.name);
|
|
195
196
|
}
|
|
196
197
|
this.observeErrorMessage();
|
|
197
198
|
}
|
|
@@ -228,11 +229,11 @@ let EzTextInput = class {
|
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
231
|
render() {
|
|
231
|
-
|
|
232
|
+
ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
|
|
232
233
|
return (h(Host, null, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label && this.mode != "slim" ?
|
|
233
234
|
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)
|
|
234
|
-
: null, h("input", { "data-element-id": ElementIDUtils.getInternalIDInfo(
|
|
235
|
-
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
235
|
+
: null, h("input", { "data-element-id": ElementIDUtils.getInternalIDInfo("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(); } }), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.canShowError && this.mode != "slim" &&
|
|
236
|
+
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage, "data-element-id": ElementIDUtils.getInternalIDInfo("message_box") }, this.errorMessage)));
|
|
236
237
|
}
|
|
237
238
|
get _hostElement() { return getElement(this); }
|
|
238
239
|
static get watchers() { return {
|
|
@@ -149,8 +149,8 @@ let EzTimeInput = class {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
render() {
|
|
152
|
-
|
|
153
|
-
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo(
|
|
152
|
+
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
153
|
+
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("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 }, h("ez-icon", { slot: "leftIcon", iconName: "timer-outline" }))));
|
|
154
154
|
}
|
|
155
155
|
static get assetsDirs() { return ["../assets"]; }
|
|
156
156
|
get _elem() { return getElement(this); }
|
package/dist/ezui/ezui.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-3c7ea91b.js";(()=>{const o=import.meta.url,s={};return""!==o&&(s.resourcesUrl=new URL(".",o).href),e(s)})().then((e=>o([["p-
|
|
1
|
+
import{p as e,b as o}from"./p-3c7ea91b.js";(()=>{const o=import.meta.url,s={};return""!==o&&(s.resourcesUrl=new URL(".",o).href),e(s)})().then((e=>o([["p-a34b52f8",[[1,"ez-actions-button",{enabled:[516],actions:[1040],size:[513],showLabel:[516,"show-label"],displayIcon:[513,"display-icon"],checkOption:[516,"check-option"],value:[513],isTransparent:[516,"is-transparent"],arrowActive:[516,"arrow-active"],_selectedAction:[32],hideActions:[64],isOpened:[64]}]]],["p-f13f3123",[[1,"ez-dialog",{confirm:[1028],dialogType:[1025,"dialog-type"],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],show:[64]}]]],["p-123a2bd5",[[1,"ez-filter-input",{label:[1],value:[1537],enabled:[4],errorMessage:[1537,"error-message"],restrict:[1],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-4c061e51",[[6,"ez-grid",{multipleSelection:[4,"multiple-selection"],config:[1040],serverUrl:[1,"server-url"],dataUnit:[16],statusResolver:[16],_paginationInfo:[32],_paginationChangedByKeyboard:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64],quickFilter:[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-739d60d1",[[6,"ez-modal-container",{modalTitle:[1,"modal-title"],modalSubTitle:[1,"modal-sub-title"],showTitleBar:[4,"show-title-bar"],cancelButtonLabel:[1,"cancel-button-label"],okButtonLabel:[1,"ok-button-label"],cancelButtonStatus:[1,"cancel-button-status"],okButtonStatus:[1,"ok-button-status"]}]]],["p-9def6fd0",[[1,"ez-chip",{label:[513],enabled:[516],removePosition:[513,"remove-position"],mode:[513],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-1cc11468",[[0,"ez-application"]]],["p-3cfefc57",[[1,"ez-card-item",{item:[16]}]]],["p-6d0b9d3c",[[1,"ez-list",{dataSource:[1040],useGroups:[1540,"use-groups"],ezDraggable:[1028,"ez-draggable"],ezSelectable:[1028,"ez-selectable"],itemSlotBuilder:[1040],_listItems:[32],_listGroupItems:[32],clearHistory:[64],scrollToTop:[64],setSelection:[64],getSelection:[64],getList:[64]}]]],["p-f6111077",[[1,"ez-loading-bar",{_showLoading:[32],hide:[64],show:[64]}]]],["p-7c227b86",[[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}]]],["p-bffae598",[[1,"ez-popover",{autoClose:[516,"auto-close"],top:[1537],left:[1537],bottom:[1537],right:[1537],boxWidth:[513,"box-width"],opened:[1540],innerElement:[1537,"inner-element"],updatePosition:[64],show:[64],hide:[64]}]]],["p-cfcc23e6",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[516,"use-header"],heightMode:[513,"height-mode"],ezTitle:[1,"ez-title"]}]]],["p-5cb4b43b",[[1,"ez-radio-button",{value:[1544],options:[1040],enabled:[516],label:[513],direction:[1537]}]]],["p-e165c3ef",[[1,"ez-scroller",{direction:[1],locked:[4],activeShadow:[4,"active-shadow"],isFirefox:[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]]]],["p-482c3dd8",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-04fab1e9",[[0,"ez-view-stack",{show:[64],getSelectedIndex:[64]}]]],["p-9334a724",[[1,"ez-text-input",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],mask:[1],canShowError:[516,"can-show-error"],restrict:[1],mode:[513],noBorder:[516,"no-border"],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-abcd17e6",[[1,"ez-collapsible-box",{value:[1540],label:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],headerAlign:[513,"header-align"],removable:[516],editable:[516],conditionalSave:[16],_activeEditText:[32],showHide:[64],applyFocusTextEdit:[64],cancelEdition:[64]}]]],["p-ad5fe50b",[[1,"ez-search",{value:[1537],label:[1537],enabled:[1540],errorMessage:[1537,"error-message"],optionLoader:[16],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],suppressEmptyOption:[4,"suppress-empty-option"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-7e496975",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-7b906805",[[1,"ez-date-time-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-ea877274",[[1,"ez-time-input",{label:[513],value:[1026],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-1a89d3ff",[[1,"ez-number-input",{label:[1],value:[1538],enabled:[4],errorMessage:[1537,"error-message"],precision:[2],prettyPrecision:[2,"pretty-precision"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-941e9792",[[1,"ez-tabselector",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1],_processedTabs:[32]}]]],["p-f2c4e811",[[1,"ez-check",{label:[513],value:[1540],enabled:[1540],indeterminate:[516],mode:[513],getMode:[64],setFocus:[64]}]]],["p-f2627de5",[[1,"ez-text-area",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],rows:[1538],canShowError:[516,"can-show-error"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-a713a1aa",[[1,"ez-upload",{label:[1],enabled:[4],maxFileSize:[2,"max-file-size"],maxFiles:[2,"max-files"],requestHeaders:[8,"request-headers"],urlUpload:[1,"url-upload"],urlDelete:[1,"url-delete"],value:[1040],addFiles:[64],setFocus:[64],setBlur:[64]}]]],["p-01b79946",[[1,"ez-text-edit",{value:[1],styled:[16],_newValue:[32],applyFocusSelect:[64]}]]],["p-590d9e91",[[1,"ez-combo-box",{value:[1537],label:[513],enabled:[516],options:[1040],errorMessage:[1537,"error-message"],searchMode:[4,"search-mode"],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],suppressSearch:[4,"suppress-search"],optionLoader:[16],suppressEmptyOption:[4,"suppress-empty-option"],canShowError:[516,"can-show-error"],mode:[513],_preSelection:[32],_visibleOptions:[32],_startLoading:[32],_showLoading:[32],_criteria:[32],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-9d57e44a",[[1,"ez-calendar",{value:[1040],floating:[516],time:[516],showSeconds:[516,"show-seconds"],show:[64],fitVertical:[64],hide:[64]}]]],["p-87ee59e8",[[1,"ez-icon",{size:[513],href:[513],iconName:[513,"icon-name"]}]]],["p-a2e55b33",[[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],iconName:[513,"icon-name"],size:[513],setFocus:[64],setBlur:[64]}]]],["p-05dbdaeb",[[0,"ez-form",{dataUnit:[1040],config:[16],recordsValidator:[16],validate:[64]}]]]],e)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as n}from"./p-3c7ea91b.js";import{StringUtils as o,ElementIDUtils as l}from"@sankhyalabs/core";import{A as h}from"./p-0b44cf1c.js";import"./p-e1148f5c.js";import"./p-b853763b.js";let a=class{constructor(s){t(this,s),this.saveEdition=i(this,"saveEdition",7),this.cancelEdition=i(this,"cancelEdition",7)}async applyFocusSelect(){this.calcSizeInput(this.value,!0)}calcSizeInput(t,i=!1){var s,e;const n=null===(e=null===(s=this._inputElement)||void 0===s?void 0:s.shadowRoot)||void 0===e?void 0:e.querySelector("input");if(null!=n){const s=this.getWidthValue(t);n.style.width=s+"px",i&&setTimeout((()=>n.select()),100)}}getWidthValue(t){if(null!=this._valueBasis){const i=this._valueBasis;if(null!=t){const s=2;return i.innerHTML=t,i.clientWidth>0?i.clientWidth+s:s}i.innerHTML=""}return 0}setStyledInput(){var t,i;let s="",e="",n="";null!=this.styled&&(s=this.styled.fontSize,e=this.styled.fontWeight,n=this.styled.fontFamily);const o=null===(i=null===(t=this._inputElement)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("input");null!=o&&(o.style.fontSize=s,o.style.fontWeight=e,o.style.fontFamily=n);const l=this._valueBasis;null!=l&&(l.style.fontSize=s,l.style.fontWeight=e,l.style.fontFamily=n)}handleSaveEdition(){this._newValue===this.value||o.isEmpty(this._newValue)?this._newValue?this.cancelEdition.emit():h.alert("Aviso","Não é possível salvar um campo em branco.").then((()=>{this.setNewValue(this.value,!0)})):this.saveEdition.emit({value:this.value,newValue:this._newValue})}setNewValue(t,i=!1){this._newValue=t,this.calcSizeInput(this._newValue,i)}componentDidLoad(){this.applyFocusSelect(),this.setNewValue(this.value)}componentDidRender(){this.setStyledInput()}render(){
|
|
1
|
+
import{r as t,c as i,h as s,H as e,g as n}from"./p-3c7ea91b.js";import{StringUtils as o,ElementIDUtils as l}from"@sankhyalabs/core";import{A as h}from"./p-0b44cf1c.js";import"./p-e1148f5c.js";import"./p-b853763b.js";let a=class{constructor(s){t(this,s),this.saveEdition=i(this,"saveEdition",7),this.cancelEdition=i(this,"cancelEdition",7)}async applyFocusSelect(){this.calcSizeInput(this.value,!0)}calcSizeInput(t,i=!1){var s,e;const n=null===(e=null===(s=this._inputElement)||void 0===s?void 0:s.shadowRoot)||void 0===e?void 0:e.querySelector("input");if(null!=n){const s=this.getWidthValue(t);n.style.width=s+"px",i&&setTimeout((()=>n.select()),100)}}getWidthValue(t){if(null!=this._valueBasis){const i=this._valueBasis;if(null!=t){const s=2;return i.innerHTML=t,i.clientWidth>0?i.clientWidth+s:s}i.innerHTML=""}return 0}setStyledInput(){var t,i;let s="",e="",n="";null!=this.styled&&(s=this.styled.fontSize,e=this.styled.fontWeight,n=this.styled.fontFamily);const o=null===(i=null===(t=this._inputElement)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("input");null!=o&&(o.style.fontSize=s,o.style.fontWeight=e,o.style.fontFamily=n);const l=this._valueBasis;null!=l&&(l.style.fontSize=s,l.style.fontWeight=e,l.style.fontFamily=n)}handleSaveEdition(){this._newValue===this.value||o.isEmpty(this._newValue)?this._newValue?this.cancelEdition.emit():h.alert("Aviso","Não é possível salvar um campo em branco.").then((()=>{this.setNewValue(this.value,!0)})):this.saveEdition.emit({value:this.value,newValue:this._newValue})}setNewValue(t,i=!1){this._newValue=t,this.calcSizeInput(this._newValue,i)}componentDidLoad(){this.applyFocusSelect(),this.setNewValue(this.value)}componentDidRender(){this.setStyledInput()}render(){return l.addIDInfoIfNotExists(this._element,"input"),s(e,null,s("span",{class:"text-edit__hidden-value",ref:t=>this._valueBasis=t}),s("ez-text-input",{"data-element-id":l.getInternalIDInfo("textInput"),onInput:()=>{this.calcSizeInput(this._newValue)},class:"text-edit__form-input",value:this._newValue,ref:t=>this._inputElement=t,mode:"slim",onEzChange:t=>this.setNewValue(null==t?void 0:t.detail),noBorder:!0}),s("ez-button",{class:"text-edit__icon-check",mode:"icon",iconName:"check",size:"small",onClick:()=>{this.handleSaveEdition()}}),s("ez-button",{class:"text-edit__icon-close",mode:"icon",iconName:"close",size:"small",onClick:()=>{this.cancelEdition.emit()}}))}get _element(){return n(this)}};a.style=":host{display:flex;align-items:center;gap:5px}.text-edit__form-input{width:auto;--ez-text-input__input--padding:0px}.text-edit__hidden-value{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}";export{a as ez_text_edit}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,r as t,c as i,f as n,H as s,g as l}from"./p-3c7ea91b.js";import{UserInterface as r,Action as a,WaitingChangeException as o,ApplicationContext as c,StringUtils as d,DataUnitAction as h,DataUnit as u,ElementIDUtils as f}from"@sankhyalabs/core";import{C as b}from"./p-b853763b.js";import{A as p}from"./p-0b44cf1c.js";import"./p-e1148f5c.js";class m{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}getSheet(e){return this._sheets.get(e)}getAllSheets(){return this._sheets}addSheet(e){this._sheets.set(e.name,e),this._requiredFields=this._requiredFields.concat(e.requiredFields),this._cleanOnCopyFields=this._cleanOnCopyFields.concat(e.cleanOnCopyFields),this._defaultValues=e.defaultValues}getRequiredFields(){return this._requiredFields}getCleanOnCopyFields(){return this._cleanOnCopyFields}getDefaultValues(){return this._defaultValues}}const v=(e,t)=>!!e.required||(null==t?void 0:t.required);function z(e,t){return"__main"==e[0].label?-1:(e[0].order||1e4)-(t[0].order||1e4)}function y(e,t,i){const n={config:t,descriptor:i};let s=(null==t?void 0:t.group)||i.group;if(s){const t=`group::${s}`;e.has(t)?e.get(t).items.push(n):e.set(t,{label:s,items:[n]})}else e.set((null==t?void 0:t.name)||i.name,n)}const g=({name:t,label:i,readOnly:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-text-input",{label:i,"data-field-name":t,key:t,enabled:!n}));function _(t,i,n,s=!1){return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large"},e("ez-check",{enabled:!n,label:i,mode:s?b.SWITCH:b.REGULAR,"data-field-name":t,key:t}))}function w(t,i,n,s,l){return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-number-input",{enabled:!n,label:i,precision:s,prettyPrecision:l,"data-field-name":t,key:t}))}const O=new Map;O.set(r.LONGTEXT,(({name:t,label:i,readOnly:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small",key:t},e("ez-text-area",{enabled:!n,label:i,"data-field-name":t})))),O.set(r.CHECKBOX,(e=>_(e.name,e.label,e.readOnly,!1))),O.set(r.SWITCH,(e=>_(e.name,e.label,e.readOnly,!0))),O.set(r.OPTIONSELECTOR,(({name:t,label:i,readOnly:n,required:s},l)=>{const r=null==l?void 0:l.options;let a;if("string"==typeof r){const e=JSON.parse(r);a=Object.keys(e).map((t=>({value:t,label:e[t]})))}else a=r;return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-combo-box",{enabled:!n,suppressEmptyOption:s,label:i,"data-field-name":t,key:t,options:a}))})),O.set(r.SEARCH,(({name:t,label:i,readOnly:n,required:s})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-search",{enabled:!n,suppressEmptyOption:s,label:i,"data-field-name":t,key:t})))),O.set(r.FILE,(({name:t,label:i,readOnly:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-upload",{enabled:!n,label:i,"data-field-name":t,key:t})))),O.set(r.DATE,(({name:t,label:i,readOnly:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-input",{enabled:!n,label:i,"data-field-name":t,key:t})))),O.set(r.TIME,(({name:t,label:i,readOnly:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-time-input",{enabled:!n,label:i,"data-field-name":t,key:t})))),O.set(r.DATETIME,(({name:t,label:i,readOnly:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-time-input",{enabled:!n,label:i,"data-field-name":t,key:t})))),O.set(r.DECIMALNUMBER,(({name:e,label:t,readOnly:i},n)=>{const s=Number((null==n?void 0:n.precision)||2);return w(e,t,i,s,Number((null==n?void 0:n.prettyPrecision)||s))})),O.set(r.INTEGERNUMBER,(({name:e,label:t,readOnly:i})=>w(e,t,i,0,0)));const E=e=>{const t=e.descriptor,i=Object.assign({},e.config);let n,s;return t&&(i.label||(i.label=t.label),i.name||(i.name=t.name),i.required=v(t,i),i.readOnly=((e,t)=>!!e.readOnly||(null==t?void 0:t.readOnly))(t,i),s=t.properties,n=O.get(t.userInterface)),i.required&&(i.label=`${i.label} (obrigatório) *`),n||(n=g),n(i,s)},A=({source:t})=>"items"in t?e("ez-collapsible-box",{label:t.label,"header-size":"large",key:t.label},t.items.map((e=>E(e)))):E(t),C=({store:t,source:i,dataElementId:n})=>e("div",{class:"dynamic-content ez-box__container","data-element-id":n},e("div",{class:"ez-row ez-padding-vertical--small"},i.items.map((i=>e(A,{store:t,source:i})))));function j(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var x="function"==typeof Symbol&&Symbol.observable||"@@observable",M=function(){return Math.random().toString(36).substring(7).split("").join(".")},R={INIT:"@@redux/INIT"+M(),REPLACE:"@@redux/REPLACE"+M(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+M()}};function k(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function S(e,t,i){var n;if("function"==typeof t&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(j(0));if("function"==typeof t&&void 0===i&&(i=t,t=void 0),void 0!==i){if("function"!=typeof i)throw new Error(j(1));return i(S)(e,t)}if("function"!=typeof e)throw new Error(j(2));var s=e,l=t,r=[],a=r,o=!1;function c(){a===r&&(a=r.slice())}function d(){if(o)throw new Error(j(3));return l}function h(e){if("function"!=typeof e)throw new Error(j(4));if(o)throw new Error(j(5));var t=!0;return c(),a.push(e),function(){if(t){if(o)throw new Error(j(6));t=!1,c();var i=a.indexOf(e);a.splice(i,1),r=null}}}function u(e){if(!k(e))throw new Error(j(7));if(void 0===e.type)throw new Error(j(8));if(o)throw new Error(j(9));try{o=!0,l=s(l,e)}finally{o=!1}for(var t=r=a,i=0;i<t.length;i++)(0,t[i])();return e}function f(e){if("function"!=typeof e)throw new Error(j(10));s=e,u({type:R.REPLACE})}function b(){var e,t=h;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(j(11));function i(){e.next&&e.next(d())}return i(),{unsubscribe:t(i)}}})[x]=function(){return this},e}return u({type:R.INIT}),(n={dispatch:u,subscribe:h,getState:d,replaceReducer:f})[x]=b,n}const I={};function N(e=I,t){switch(t.type){case P.METADATA_LOADED:return Object.assign(Object.assign({},e),{formMetadata:t.payload,currentSheet:void 0});case P.CHANGE_TAB:return Object.assign(Object.assign({},e),{currentSheet:t.payload});default:return e}}function D(e){return e.formMetadata}var P;!function(e){e.METADATA_LOADED="FORM/METADATA_LOADED",e.CHANGE_TAB="FORM/CHANGE_TAB"}(P||(P={}));class L{constructor(e){this._invalidFields=new Map,this.onDataUnitEvent=e=>{var t;switch(e.type){case a.DATA_LOADED:case a.DATA_SAVED:case a.RECORDS_REMOVED:case a.RECORDS_ADDED:case a.RECORDS_COPIED:case a.EDITION_CANCELED:case a.SELECTION_CHANGED:case a.NEXT_SELECTED:case a.PREVIOUS_SELECTED:this.clearInvalid();case a.DATA_CHANGED:case a.CHANGE_UNDONE:case a.CHANGE_REDONE:case a.RECORD_LOADED:null===(t=this._fields)||void 0===t||t.forEach((e=>{this.updateValue(e.fieldName,e.field)}))}},this._fields=new Map,this._dataUnit=e,this._dataUnit.subscribe(this.onDataUnitEvent)}bind(e){e.forEach((e=>{this.updateBind(e.dataset.fieldName,e)}))}onDisconnectedCallback(){this._dataUnit.unsubscribe(this.onDataUnitEvent)}markInvalid(e){if(this._invalidFields.set(e.name,e),this._fields.has(e.name)){const t=this._fields.get(e.name).field;t.errorMessage||this.updateErrorMessage(e.name,t)}}clearInvalid(){this._invalidFields.clear(),this._fields.forEach((e=>{e.field.errorMessage=""}))}updateValue(e,t){const i=this._fields.get(e);try{i&&(i.listen=!1),t.value=this._dataUnit.getFieldValue(e),this.updateErrorMessage(e,t)}finally{i&&(i.listen=!0)}}updateErrorMessage(e,t){const i=this._invalidFields.get(e);i&&(t.errorMessage=i.message)}getErrorMessage(e){if(this._fields.has(e))return this._fields.get(e).field.errorMessage||null}updateBind(e,t){const i=this._fields.get(e);i&&i.destroy(),t.value=this._dataUnit.getFieldValue(e),this.updateErrorMessage(e,t),this._fields.set(e,T.create(e,t,((e,t)=>this.changeStarted(e,t)),(e=>this.cancelWaitingChange(e)),((e,t)=>this.setFieldValue(e,t)))),this.bindSearchOptionsLoader(e,t),this.applyEzUploadContext(e,t)}changeStarted(e,t){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),!t.blocking&&null==t.promise){const i=this._fields.get(e);i&&(t.promise=new Promise(((e,t)=>{i.waitingChangePromiseResolve=e,i.waitingChangePromiseReject=t})))}this._dataUnit.startChange(e,t)}cancelWaitingChange(e){if(this._dataUnit.waitingForChange(e)){this._dataUnit.cancelWaitingChange(e);const t=this._fields.get(e);t&&t.rejectWaitingChange(new o("Change canceled",e))}}setFieldValue(e,t){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._invalidFields.delete(e),this._dataUnit.setFieldValue(e,t),this._dataUnit.waitingForChange(e)){const t=this._fields.get(e);t&&t.acceptWaitingChange()}}bindSearchOptionsLoader(e,t){if("EZ-SEARCH"===t.nodeName&&null==t.optionLoader){const i=c.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");i&&(t.optionLoader=t=>i(t,e,this._dataUnit))}}applyEzUploadContext(e,t){var i,n;if("EZ-UPLOAD"===t.nodeName){t.urlUpload=c.getContextValue("__EZUI__UPLOAD__ADD__URL__"),t.urlDelete=c.getContextValue("__EZUI__UPLOAD__DEL__URL__");const s=this._dataUnit.getField(e),l=null===(i=s.properties)||void 0===i?void 0:i.DESTINATION;l&&(t.requestHeaders={XTRAINF:`{"destination": "${l}"}`}),t.maxFiles=(null===(n=s.properties)||void 0===n?void 0:n.MAX_FILES)||0}}}class T{constructor(){this.listen=!0,this.startChangeEventName="ezStartChange",this.cancelWaitingChangeEventName="ezCancelWaitingChange",this.changeEventName="ezChange"}destroy(){this.field.removeEventListener(this.startChangeEventName,this.startChangeListener),this.field.removeEventListener(this.cancelWaitingChangeEventName,this.cancelWaitingChangeListener),this.field.removeEventListener(this.changeEventName,this.changeListener)}acceptWaitingChange(){this.waitingChangePromiseResolve&&(this.waitingChangePromiseResolve(),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}rejectWaitingChange(e){this.waitingChangePromiseReject&&(this.waitingChangePromiseReject(e),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}static create(e,t,i,n,s){const l=new T;return l.field=t,l.fieldName=e,l.startChangeListener=t=>{l.listen&&i(e,t.detail)},l.field.addEventListener(l.startChangeEventName,l.startChangeListener),l.cancelWaitingChangeListener=()=>{l.listen&&n(e)},l.field.addEventListener(l.cancelWaitingChangeEventName,l.cancelWaitingChangeListener),l.changeListener=t=>{l.listen&&s(e,t.detail)},l.field.addEventListener(l.changeEventName,l.changeListener),l}}let U=class{constructor(e){t(this,e),this.ezReady=i(this,"ezReady",7),this.onDataUnitAction=e=>{e.type===a.METADATA_LOADED&&this.processMetadata()}}validate(){return new Promise(((e,t)=>{var i;const n=this.dataUnit.getModifiedRecords();for(let e=0;e<n.length;e++){const s=n[e],l=[];let r=this.validateRequired(s);if(r&&!r.isValid&&l.push(r),r=null===(i=this.recordsValidator)||void 0===i?void 0:i.validateRecord(this,s),r&&!r.isValid&&l.push(r),l.length>0){this.processValidationResult(l),t();break}}e()}))}observeConfig(){this.processMetadata()}validateRequired(e){const t=D(this._store.getState()),i=this._staticFields.filter((e=>e.dataset.required)).map((e=>e.dataset.fieldName)).concat(t.getRequiredFields()),n=[];if(new Set(i).forEach((t=>{const i=e[t];if(null==i||""===i){const e=this._dataBinder.getErrorMessage(t);n.push(e?{name:t,message:e}:{name:t,message:"Essa informação é obrigatória"})}})),n.length>0)return{isValid:!1,invalidFields:n,infoMessage:"Há pelo menos um campo obrigatório não preenchido."}}processValidationResult(e){e.forEach((e=>{const t=e.invalidFields;if(t&&t.forEach((e=>{this._dataBinder.markInvalid(e)})),e.infoMessage&&p.info(e.infoMessage),e.errorMessage){const{errorTitle:t,errorMessage:i}=e;p.error(t,i)}}))}getDynamicContent(){var t;const i=D(this._store.getState());if(!i)return null;const n=(s=null===(t=this._store)||void 0===t?void 0:t.getState()).currentSheet?s.formMetadata.getSheet(s.currentSheet):Array.from(s.formMetadata.getAllSheets().values())[0];var s;if(!n)return null;const l=Array.from(i.getAllSheets().values()),r=[];if(l.length>1){const t=l.map(((e,t)=>({tabKey:e.name,label:e.label,index:t}))),i="selector";r.push(e("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:e=>this._store.dispatch(function(e){return{type:P.CHANGE_TAB,payload:e.tabKey}}(e.detail)),selectedTab:n.name,"data-element-id":i}))}const a=`${d.replaceAccentuatedChars(d.toCamelCase(n.label),!1)}_selectorContainer`;return r.push(e(C,{store:this._store,source:n,dataElementId:a})),r}processMetadata(){if(!this.isStatic()&&this.dataUnit){const e=null!=this.config&&Object.values(this.config).length>0?((e,t)=>{var i,n;const s=new Map,l=new Map,r=[],a=[],o={};null===(i=null==e?void 0:e.tabs)||void 0===i||i.forEach((e=>{l.has(e.label)||!1!==e.visible||l.set(e.label,e)})),null===(n=null==e?void 0:e.fields)||void 0===n||n.forEach((e=>{var i,n,c,d;if(!1!==e.visible){const h=function(e,t){return("string"==typeof e?Array.from(t.keys()).find((t=>t.label===e)):e)||{label:e,visible:!0}}(e.tab||"__main",s);if(l.has(h.label))return;const u=t.getField(e.name);if(u&&h.visible){s.has(h)||s.set(h,new Map);const t=s.get(h);v(u,e)&&r.push(e.name),((null==e.cleanOnCopy?null===(i=u.properties)||void 0===i?void 0:i.cleanOnCopy:e.cleanOnCopy)||(null===(n=u.properties)||void 0===n?void 0:n.autoNum)||(null===(c=u.properties)||void 0===c?void 0:c.cleanOnCopy))&&a.push(e.name),(null==e.defaultValue?null===(d=u.properties)||void 0===d?void 0:d.defaultValue:e.defaultValue)&&(o[e.name]=e.defaultValue),y(t,e,u)}}}));const c=new m;return Array.from(s.entries()).sort(z).forEach((([e,t])=>{c.addSheet({label:"__main"===e.label?"Principal":e.label,name:e.label,items:Array.from(t.values()),requiredFields:r,cleanOnCopyFields:a,defaultValues:o})})),c})(this.config,this.dataUnit):(()=>{var e,t;const i=this.dataUnit.metadata,n=new m;if(i){const s=null===(e=i.fields)||void 0===e?void 0:e.filter((e=>!1!==e.visible)),l=new Map;null===(t=null==i?void 0:i.fields)||void 0===t||t.forEach((e=>{!1!==e.visible&&y(l,null,e)}));let r={};s.filter((e=>e.defaultValue)).map((e=>r[e.name]=e.defaultValue)),n.addSheet({label:i.label,name:i.name,items:Array.from(l.values()),requiredFields:s.filter((e=>e.required)).map((e=>e.name)),cleanOnCopyFields:s.filter((e=>{var t,i;return(null===(t=e.properties)||void 0===t?void 0:t.cleanOnCopy)||(null===(i=e.properties)||void 0===i?void 0:i.autoNum)})).map((e=>e.name)),defaultValues:r})}return n})();this._store.dispatch({type:P.METADATA_LOADED,payload:e})}}isStatic(){var e;return(null===(e=this._staticFields)||void 0===e?void 0:e.length)>0}interceptAction(e){if(e.type===a.RECORDS_COPIED){const t=D(this._store.getState()).getCleanOnCopyFields();if(t)return new h(a.RECORDS_COPIED,e.payload.map((e=>{const i=Object.assign({},e);return t.forEach((e=>delete i[e])),i})))}if(e.type===a.SAVING_DATA)return new Promise((t=>{this.validate().then((()=>t(e))).catch((()=>{}))}));if(e.type===a.RECORDS_ADDED){const t=D(this._store.getState()).getDefaultValues();if(t)return new h(a.RECORDS_ADDED,e.payload.map((e=>{const i=Object.assign({},e);for(const e in t){const n="formattedValue"in t[e]?t[e].formattedValue:t[e].value,s=null!=n?n:t[e],l="function"==typeof s?s():s;i[e]=this.dataUnit.valueFromString(e,l)}return i})))}return e}componentWillLoad(){void 0===this.dataUnit&&(this.dataUnit=new u("ez-form")),this.dataUnit.addInterceptor(this),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new L(this.dataUnit),this._store=S(N),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),f.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}componentDidRender(){this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]"))),this.ezReady.emit()}disconnectedCallback(){this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.removeInterceptor(this),this._dataBinder.onDisconnectedCallback()}buildIdTabSelector(e){return e&&e.forEach((e=>e[f.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=d.toCamelCase(e.label))),e}render(){return e(s,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return l(this)}static get watchers(){return{config:["observeConfig"]}}};U.style="ez-form{display:flex;flex-direction:column;width:100%}.dynamic-content ez-collapsible-box{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";export{U as ez_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as e,h as t,g as i}from"./p-3c7ea91b.js";import{ElementIDUtils as r}from"@sankhyalabs/core";import{C as a}from"./p-4a5e37a7.js";let h=class{constructor(t){s(this,t),this.ezChange=e(this,"ezChange",7),this.enabled=!0,this.mode="regular"}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){this._textInput&&(this._textInput.errorMessage=this.errorMessage)}observeValue(s,e){this._textInput&&s!=e&&(this._textInput.value=s,this.ezChange.emit(s))}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}changeValue(s){const e=s.detail;this.errorMessage="",e!==this.value&&(this.value=e)}componentDidLoad(){a.applyVarsTextInput(this._elem,this._textInput)}render(){
|
|
1
|
+
import{r as s,c as e,h as t,g as i}from"./p-3c7ea91b.js";import{ElementIDUtils as r}from"@sankhyalabs/core";import{C as a}from"./p-4a5e37a7.js";let h=class{constructor(t){s(this,t),this.ezChange=e(this,"ezChange",7),this.enabled=!0,this.mode="regular"}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){this._textInput&&(this._textInput.errorMessage=this.errorMessage)}observeValue(s,e){this._textInput&&s!=e&&(this._textInput.value=s,this.ezChange.emit(s))}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}changeValue(s){const e=s.detail;this.errorMessage="",e!==this.value&&(this.value=e)}componentDidLoad(){a.applyVarsTextInput(this._elem,this._textInput)}render(){return r.addIDInfoIfNotExists(this._elem,"input"),t("ez-text-input",{"data-element-id":r.getInternalIDInfo("textInput"),ref:s=>this._textInput=s,label:this.label,onEzChange:s=>this.changeValue(s),value:this.value,enabled:this.enabled,errorMessage:this.errorMessage,restrict:this.restrict,mode:this.mode},t("ez-icon",{slot:"leftIcon",iconName:"search"}))}get _elem(){return i(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};h.style=":host{display:block;width:100%}";export{h as ez_filter_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,g as e}from"./p-3c7ea91b.js";import{NumberUtils as h,ElementIDUtils as r}from"@sankhyalabs/core";import{C as a}from"./p-4a5e37a7.js";let o=class{constructor(i){t(this,i),this.ezChange=s(this,"ezChange",7),this.ezStartChange=s(this,"ezStartChange",7),this.ezCancelWaitingChange=s(this,"ezCancelWaitingChange",7),this._focused=!1,this.enabled=!0,this.mode="regular"}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||this.setInputValue())}observeValue(t,s){if(this._textInput&&t!=s){const i=this.validateValue(t);if(i!=this.validateValue(s)){const t=this.getTextValue(i)||"";(this._textInput.value||"")!==t&&(void 0===this.getParsedNumber(t)&&this._focused||(this._textInput.value=t,this._focused=!1,this.errorMessage="")),this.ezChange.emit(null===i?void 0:i)}}}validateValue(t){return isNaN(t)||void 0===t?null:t}getTextValue(t){if(null!=t)return this.precision>0?h.format(t.toString(),Number(this.precision),Number(this.prettyPrecision)):t.toString()}changeValue(t){this.errorMessage="",this.value!=t?this.value=void 0===t?null:t:(this.setInputValue(),this.ezCancelWaitingChange.emit())}setError(t){this.value=null,this.errorMessage=t,this.ezCancelWaitingChange.emit()}handleBlur(){const t=this.getParsedNumber();if(void 0!==t&&isNaN(t))this.setError("O valor digitado não é um número válido");else try{this.changeValue(t)}catch(t){return void this.setError(t.message)}}handleInput(){this.getParsedNumber()!==this.value&&(this._focused=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1}))}getParsedNumber(t){var s;return void 0===t&&(t=null===(s=this._textInput)||void 0===s?void 0:s.value),(null==t?void 0:t.trim())?h.stringToNumber(t):void 0}setInputValue(){const t=this.getTextValue(this.value)||"";(this._textInput.value||"")!==t&&(this._textInput.value=t)}componentDidLoad(){a.applyVarsTextInput(this._elem,this._textInput),this.setInputValue()}render(){
|
|
1
|
+
import{r as t,c as s,h as i,g as e}from"./p-3c7ea91b.js";import{NumberUtils as h,ElementIDUtils as r}from"@sankhyalabs/core";import{C as a}from"./p-4a5e37a7.js";let o=class{constructor(i){t(this,i),this.ezChange=s(this,"ezChange",7),this.ezStartChange=s(this,"ezStartChange",7),this.ezCancelWaitingChange=s(this,"ezCancelWaitingChange",7),this._focused=!1,this.enabled=!0,this.mode="regular"}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||this.setInputValue())}observeValue(t,s){if(this._textInput&&t!=s){const i=this.validateValue(t);if(i!=this.validateValue(s)){const t=this.getTextValue(i)||"";(this._textInput.value||"")!==t&&(void 0===this.getParsedNumber(t)&&this._focused||(this._textInput.value=t,this._focused=!1,this.errorMessage="")),this.ezChange.emit(null===i?void 0:i)}}}validateValue(t){return isNaN(t)||void 0===t?null:t}getTextValue(t){if(null!=t)return this.precision>0?h.format(t.toString(),Number(this.precision),Number(this.prettyPrecision)):t.toString()}changeValue(t){this.errorMessage="",this.value!=t?this.value=void 0===t?null:t:(this.setInputValue(),this.ezCancelWaitingChange.emit())}setError(t){this.value=null,this.errorMessage=t,this.ezCancelWaitingChange.emit()}handleBlur(){const t=this.getParsedNumber();if(void 0!==t&&isNaN(t))this.setError("O valor digitado não é um número válido");else try{this.changeValue(t)}catch(t){return void this.setError(t.message)}}handleInput(){this.getParsedNumber()!==this.value&&(this._focused=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1}))}getParsedNumber(t){var s;return void 0===t&&(t=null===(s=this._textInput)||void 0===s?void 0:s.value),(null==t?void 0:t.trim())?h.stringToNumber(t):void 0}setInputValue(){const t=this.getTextValue(this.value)||"";(this._textInput.value||"")!==t&&(this._textInput.value=t)}componentDidLoad(){a.applyVarsTextInput(this._elem,this._textInput),this.setInputValue()}render(){return r.addIDInfoIfNotExists(this._elem,"input"),i("ez-text-input",{"data-element-id":r.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"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})}get _elem(){return e(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};o.style=":host{display:block;width:100%}";export{o as ez_number_input}
|