@sankhyalabs/ezui 6.1.0-dev.14 → 6.1.0-dev.16
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-combo-box-list_4.cjs.entry.js +12 -5
- package/dist/cjs/ez-form.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +34 -27
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-form/ez-form.js +1 -1
- package/dist/collection/components/ez-rich-text/ez-rich-text.css +3 -8
- package/dist/collection/components/ez-rich-text/ez-rich-text.js +48 -21
- package/dist/collection/components/ez-text-area/ez-text-area.css +244 -212
- package/dist/collection/components/ez-text-area/ez-text-area.js +35 -28
- package/dist/custom-elements/index.js +48 -34
- package/dist/esm/ez-combo-box-list_4.entry.js +12 -5
- package/dist/esm/ez-form.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +34 -27
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-0d9856a4.entry.js → p-6bcf4ba2.entry.js} +1 -1
- package/dist/ezui/{p-5cda9526.entry.js → p-98ee5c31.entry.js} +1 -1
- package/dist/ezui/p-e7a7c594.entry.js +1 -0
- package/dist/types/components/ez-rich-text/ez-rich-text.d.ts +9 -4
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +6 -3
- package/dist/types/components.d.ts +18 -10
- package/package.json +1 -1
- package/dist/ezui/p-cb75eb46.entry.js +0 -1
|
@@ -10,7 +10,7 @@ export class EzTextArea {
|
|
|
10
10
|
this.errorMessage = undefined;
|
|
11
11
|
this.rows = 4;
|
|
12
12
|
this.canShowError = true;
|
|
13
|
-
this.mode =
|
|
13
|
+
this.mode = 'regular';
|
|
14
14
|
this.enableResize = true;
|
|
15
15
|
this.autoRows = false;
|
|
16
16
|
this.autoFocus = false;
|
|
@@ -33,10 +33,10 @@ export class EzTextArea {
|
|
|
33
33
|
if (this._inputElem) {
|
|
34
34
|
if (newValue != oldValue) {
|
|
35
35
|
if (this.canChangeValue()) {
|
|
36
|
-
this._inputElem.value = this.value ||
|
|
36
|
+
this._inputElem.value = this.value || '';
|
|
37
37
|
}
|
|
38
38
|
this.adjustFloatingLabel();
|
|
39
|
-
this.errorMessage =
|
|
39
|
+
this.errorMessage = '';
|
|
40
40
|
this.ezChange.emit(this.value);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -45,13 +45,13 @@ export class EzTextArea {
|
|
|
45
45
|
if (this._initialRows == undefined) {
|
|
46
46
|
this._initialRows = this.rows > 0 ? this.rows : undefined;
|
|
47
47
|
}
|
|
48
|
-
const rows = this._initialRows > 0 ? this._initialRows : this.mode !=
|
|
48
|
+
const rows = this._initialRows > 0 ? this._initialRows : this.mode != 'slim' ? 4 : 2;
|
|
49
49
|
if (rows !== this.rows) {
|
|
50
50
|
this.rows = rows;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
observeRows() {
|
|
54
|
-
const rows = this.rows > 0 ? this.rows : this.mode !=
|
|
54
|
+
const rows = this.rows > 0 ? this.rows : this.mode != 'slim' ? 4 : 2;
|
|
55
55
|
if (rows !== this.rows) {
|
|
56
56
|
this.updateRows(rows);
|
|
57
57
|
}
|
|
@@ -84,8 +84,8 @@ export class EzTextArea {
|
|
|
84
84
|
var _a, _b, _c, _d;
|
|
85
85
|
const selectionStart = this._inputElem.selectionStart;
|
|
86
86
|
const selectionEnd = this._inputElem.selectionEnd;
|
|
87
|
-
const textStart = (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.substring(0, selectionStart)) !== null && _b !== void 0 ? _b :
|
|
88
|
-
const textEnd = (_d = (_c = this.value) === null || _c === void 0 ? void 0 : _c.substring(selectionEnd)) !== null && _d !== void 0 ? _d :
|
|
87
|
+
const textStart = (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.substring(0, selectionStart)) !== null && _b !== void 0 ? _b : '';
|
|
88
|
+
const textEnd = (_d = (_c = this.value) === null || _c === void 0 ? void 0 : _c.substring(selectionEnd)) !== null && _d !== void 0 ? _d : '';
|
|
89
89
|
this.value = `${textStart}${text}${textEnd}`;
|
|
90
90
|
const newSelectionEnd = selectionStart + text.length;
|
|
91
91
|
const start = (selectionStart === selectionEnd) ? newSelectionEnd : selectionStart;
|
|
@@ -108,28 +108,28 @@ export class EzTextArea {
|
|
|
108
108
|
* Retorna se o conteúdo é inválido.
|
|
109
109
|
*/
|
|
110
110
|
async isInvalid() {
|
|
111
|
-
return typeof this.errorMessage ===
|
|
111
|
+
return typeof this.errorMessage === 'string' && this.errorMessage.trim() !== '';
|
|
112
112
|
}
|
|
113
113
|
//---------------------------------------------
|
|
114
114
|
// Private methods
|
|
115
115
|
//---------------------------------------------
|
|
116
116
|
canChangeValue() {
|
|
117
|
-
return this._inputElem && (this.value ||
|
|
117
|
+
return this._inputElem && (this.value || '') !== this._inputElem.value;
|
|
118
118
|
}
|
|
119
119
|
adjustFloatingLabel() {
|
|
120
120
|
if (this.forceLabelFloat)
|
|
121
121
|
return;
|
|
122
122
|
if (this.label && this._labelElem) {
|
|
123
123
|
const hasValue = this.value && this.value.toString().length > 0;
|
|
124
|
-
const containsFloatedClass = this._labelElem.classList.contains(
|
|
124
|
+
const containsFloatedClass = this._labelElem.classList.contains('textarea__label--floated');
|
|
125
125
|
if (hasValue || this.isFocused()) {
|
|
126
126
|
if (!containsFloatedClass) {
|
|
127
|
-
this._labelElem.classList.add(
|
|
127
|
+
this._labelElem.classList.add('textarea__label--floated');
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
else {
|
|
131
131
|
if (containsFloatedClass) {
|
|
132
|
-
this._labelElem.classList.remove(
|
|
132
|
+
this._labelElem.classList.remove('textarea__label--floated');
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}
|
|
@@ -178,8 +178,8 @@ export class EzTextArea {
|
|
|
178
178
|
//---------------------------------------------
|
|
179
179
|
handleFocusout() {
|
|
180
180
|
this.adjustFloatingLabel();
|
|
181
|
-
if (this._container && this._container.classList.contains(
|
|
182
|
-
this._container.classList.remove(
|
|
181
|
+
if (this._container && this._container.classList.contains('textarea--focus')) {
|
|
182
|
+
this._container.classList.remove('textarea--focus');
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
handleChange() {
|
|
@@ -188,11 +188,11 @@ export class EzTextArea {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
handleFocus() {
|
|
191
|
-
if (this.label && this._labelElem && !this._labelElem.classList.contains(
|
|
192
|
-
this._labelElem.classList.add(
|
|
191
|
+
if (this.label && this._labelElem && !this._labelElem.classList.contains('textarea__label--floated')) {
|
|
192
|
+
this._labelElem.classList.add('textarea__label--floated');
|
|
193
193
|
}
|
|
194
|
-
if (this._container && !this._container.classList.contains(
|
|
195
|
-
this._container.classList.add(
|
|
194
|
+
if (this._container && !this._container.classList.contains('textarea--focus')) {
|
|
195
|
+
this._container.classList.add('textarea--focus');
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
connectedCallback() {
|
|
@@ -205,7 +205,7 @@ export class EzTextArea {
|
|
|
205
205
|
buildPlaceholder() {
|
|
206
206
|
if (this.alternativePlaceholder)
|
|
207
207
|
return this.alternativePlaceholder;
|
|
208
|
-
return (this.mode ===
|
|
208
|
+
return (this.mode === 'slim' && this.label) ? this.label : '';
|
|
209
209
|
}
|
|
210
210
|
buildLabelClass() {
|
|
211
211
|
let classList = this.enabled ? 'textarea__label' : 'textarea__label textarea__label--disabled';
|
|
@@ -215,6 +215,19 @@ export class EzTextArea {
|
|
|
215
215
|
classList = classList + ' textarea__label--floated';
|
|
216
216
|
return classList;
|
|
217
217
|
}
|
|
218
|
+
renderErrorTooltip() {
|
|
219
|
+
if (!this.canShowError || this.mode == 'slim' || !this.errorMessage)
|
|
220
|
+
return;
|
|
221
|
+
return (h("div", { class: "tooltip-container" }, h("ez-tooltip", { type: "error", message: this.errorMessage }, h("ez-icon", { class: `tooltip-icon ${this.errorMessage ? 'hasError' : ''}`, "data-element-id": ElementIDUtils.getInternalIDInfo('tooltip-icon'), iconName: "alert-circle" }))));
|
|
222
|
+
}
|
|
223
|
+
renderLabel() {
|
|
224
|
+
if (!this.label || this.mode == 'slim')
|
|
225
|
+
return null;
|
|
226
|
+
return h("label", { ref: (el) => this._labelElem = el, class: this.buildLabelClass(), onClick: () => this._inputElem.focus(), title: this.label }, this.label);
|
|
227
|
+
}
|
|
228
|
+
renderTextArea() {
|
|
229
|
+
return h("textarea", { onFocus: () => this.handleFocus(), "data-element-id": ElementIDUtils.getInternalIDInfo('input'), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, class: { 'textarea--slim': this.mode === 'slim' }, placeholder: this.buildPlaceholder(), onInput: () => this.handleChange(), onFocusout: () => this.handleFocusout(), rows: this.rows });
|
|
230
|
+
}
|
|
218
231
|
//---------------------------------------------
|
|
219
232
|
// Lifecycle web component
|
|
220
233
|
//---------------------------------------------
|
|
@@ -230,13 +243,7 @@ export class EzTextArea {
|
|
|
230
243
|
}
|
|
231
244
|
render() {
|
|
232
245
|
ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
|
|
233
|
-
return (h(Host, null, h("div", { class: `textarea ${this.enabled ?
|
|
234
|
-
h("label", { ref: (el) => this._labelElem = el, class: this.buildLabelClass(), onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
235
|
-
: null, h("textarea", { onFocus: () => this.handleFocus(), "data-element-id": ElementIDUtils.getInternalIDInfo("input"), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, class: {
|
|
236
|
-
"textarea--slim": this.mode === "slim",
|
|
237
|
-
"textarea--resizable": this.enableResize
|
|
238
|
-
}, placeholder: this.buildPlaceholder(), onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, rows: this.rows })), this.canShowError && this.mode != "slim" &&
|
|
239
|
-
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
246
|
+
return (h(Host, null, h("div", { class: `textarea ${this.enabled ? '' : 'textarea--disabled'}`, ref: (el) => this._container = el }, this.renderLabel(), h("div", { class: `input-container ${this.enableResize ? 'textarea--resizable' : ""}` }, this.renderTextArea(), this.renderErrorTooltip()))));
|
|
240
247
|
}
|
|
241
248
|
static get is() { return "ez-text-area"; }
|
|
242
249
|
static get encapsulation() { return "shadow"; }
|
|
@@ -361,7 +368,7 @@ export class EzTextArea {
|
|
|
361
368
|
"type": "string",
|
|
362
369
|
"mutable": false,
|
|
363
370
|
"complexType": {
|
|
364
|
-
"original": "
|
|
371
|
+
"original": "'slim' | 'regular'",
|
|
365
372
|
"resolved": "\"regular\" | \"slim\"",
|
|
366
373
|
"references": {}
|
|
367
374
|
},
|
|
@@ -373,7 +380,7 @@ export class EzTextArea {
|
|
|
373
380
|
},
|
|
374
381
|
"attribute": "mode",
|
|
375
382
|
"reflect": true,
|
|
376
|
-
"defaultValue": "
|
|
383
|
+
"defaultValue": "'regular'"
|
|
377
384
|
},
|
|
378
385
|
"enableResize": {
|
|
379
386
|
"type": "boolean",
|
|
@@ -5958,7 +5958,7 @@ const EzForm$1 = class extends HTMLElement$1 {
|
|
|
5958
5958
|
}
|
|
5959
5959
|
};
|
|
5960
5960
|
this._fieldsProps = new Map();
|
|
5961
|
-
this._singleColumn =
|
|
5961
|
+
this._singleColumn = false;
|
|
5962
5962
|
this.dataUnit = undefined;
|
|
5963
5963
|
this.config = undefined;
|
|
5964
5964
|
this.recordsValidator = undefined;
|
|
@@ -78163,7 +78163,7 @@ const EzRadioButton$1 = class extends HTMLElement$1 {
|
|
|
78163
78163
|
static get style() { return ezRadioButtonCss; }
|
|
78164
78164
|
};
|
|
78165
78165
|
|
|
78166
|
-
const ezRichTextCss = ".sc-ez-rich-text-h{display:block;width:100%;font-family:Roboto;--ez-rich-text--box-shadow:0 0 3px 0 #DCE0E8;--ez-rich-text--shadow--outline:var(--shadow--outline) var(--color--strokes)}.editor-container.
|
|
78166
|
+
const ezRichTextCss = ".sc-ez-rich-text-h{display:block;width:100%;font-family:Roboto;--ez-rich-text--box-shadow:0 0 3px 0 #DCE0E8;--ez-rich-text--shadow--outline:var(--shadow--outline) var(--color--strokes)}.editor-container.sc-ez-rich-text{width:100%;overflow:hidden;border-radius:12px;border:1px solid #DCE0E8}ez-text-area.sc-ez-rich-text{--text-area__input--border:1px solid}.preview.sc-ez-rich-text{min-height:20px;padding:12px;resize:both;overflow:auto;max-width:100%;border-top:1px solid #DCE0E8}";
|
|
78167
78167
|
|
|
78168
78168
|
const EzRichText$1 = class extends HTMLElement$1 {
|
|
78169
78169
|
constructor() {
|
|
@@ -78174,12 +78174,13 @@ const EzRichText$1 = class extends HTMLElement$1 {
|
|
|
78174
78174
|
this.historyIndex = -1;
|
|
78175
78175
|
this.previewMode = false;
|
|
78176
78176
|
this.showPreview = true;
|
|
78177
|
-
this.showBorder = false;
|
|
78178
78177
|
this.value = '';
|
|
78179
78178
|
this.label = undefined;
|
|
78179
|
+
this.mode = "regular";
|
|
78180
78180
|
this.enabled = true;
|
|
78181
78181
|
this.rows = 6;
|
|
78182
78182
|
this.errorMessage = undefined;
|
|
78183
|
+
this.canShowError = true;
|
|
78183
78184
|
this.showConfigs = true;
|
|
78184
78185
|
this.showTextFormat = true;
|
|
78185
78186
|
this.showUndoRedo = true;
|
|
@@ -78189,6 +78190,11 @@ const EzRichText$1 = class extends HTMLElement$1 {
|
|
|
78189
78190
|
return;
|
|
78190
78191
|
this.ezChange.emit(newValue);
|
|
78191
78192
|
}
|
|
78193
|
+
observeErrorMessage(newValue) {
|
|
78194
|
+
if (newValue && this.previewMode) {
|
|
78195
|
+
this.previewMode = false;
|
|
78196
|
+
}
|
|
78197
|
+
}
|
|
78192
78198
|
async handleExecuteToolbarCommand(event) {
|
|
78193
78199
|
const { command, value } = event.detail;
|
|
78194
78200
|
await this.executeCommand(command, value);
|
|
@@ -78417,14 +78423,15 @@ const EzRichText$1 = class extends HTMLElement$1 {
|
|
|
78417
78423
|
if (this.previewMode) {
|
|
78418
78424
|
return (h("div", { id: 'rich-text-preview-container', class: "preview", innerHTML: this.getSanitizedValue() }));
|
|
78419
78425
|
}
|
|
78420
|
-
return h("ez-text-area", { ref: (el) => this.textAreaRef = el, label: this.label, value: this.value, enabled: this.enabled, rows: this.rows, mode:
|
|
78426
|
+
return h("ez-text-area", { ref: (el) => this.textAreaRef = el, label: this.label, value: this.value, enabled: this.enabled, rows: this.rows, mode: this.mode, canShowError: this.canShowError, errorMessage: this.errorMessage, onEzChange: this.handleTextAreaChanged.bind(this) });
|
|
78421
78427
|
}
|
|
78422
78428
|
render() {
|
|
78423
|
-
return (h(Host, null, h("div", { class:
|
|
78429
|
+
return (h(Host, null, h("div", { class: 'editor-container bordered' }, h("ez-rich-toolbar", { isPreviewMode: this.previewMode, showPreview: this.showPreview, showConfigs: this.showConfigs && this.enabled, showTextFormat: this.showTextFormat && this.enabled, showUndoRedo: this.showUndoRedo && this.enabled }), this.renderContent()), h("ez-link-builder", { ref: (el) => this.linkBuilderRef = el }), h("ez-simple-image-uploader", { ref: (el) => this.imageUploaderRef = el })));
|
|
78424
78430
|
}
|
|
78425
78431
|
get element() { return this; }
|
|
78426
78432
|
static get watchers() { return {
|
|
78427
|
-
"value": ["observeValue"]
|
|
78433
|
+
"value": ["observeValue"],
|
|
78434
|
+
"errorMessage": ["observeErrorMessage"]
|
|
78428
78435
|
}; }
|
|
78429
78436
|
static get style() { return ezRichTextCss; }
|
|
78430
78437
|
};
|
|
@@ -85093,7 +85100,7 @@ const EzTabselector$1 = class extends HTMLElement$1 {
|
|
|
85093
85100
|
static get style() { return ezTabselectorCss; }
|
|
85094
85101
|
};
|
|
85095
85102
|
|
|
85096
|
-
const ezTextAreaCss = ":host{--text-area--width:100%;--text-area--border-radius:var(--border--radius-medium, 12px);--text-area--font-size:var(--text--medium, 14px);--text-area--font-family:var(--font-pattern, Arial);--text-area--font-weight:var(--text-weight--medium, 400);--text-area--color:var(--title--primary, #2B3A54);--text-area__input--background-color:var(--background--light, #FFFFFF);--text-area__input--border:var(--border--medium, 2px solid);--text-area__input--border-color:var(--color--strokes
|
|
85103
|
+
const ezTextAreaCss = ":host{--text-area--width:100%;--text-area--border-radius:var(--border--radius-medium, 12px);--text-area--font-size:var(--text--medium, 14px);--text-area--font-family:var(--font-pattern, Arial);--text-area--font-weight:var(--text-weight--medium, 400);--text-area--color:var(--title--primary, #2B3A54);--text-area__input--background-color:var(--background--light, #FFFFFF);--text-area__input--border:var(--border--medium, 2px solid);--text-area__input--border-color:var(--color--strokes, #DCE0E8);--text-area__input--focus--border-color:var(--color--primary, #008561);--text-area__input--disabled--background-color:var(--background--medium, #F0F3F7);--text-area__input--disabled--color:var(--text--primary, #626E82);--text-area__input--disabled--border--color:var(--color--strokes, #DCE0E8);--text-area__input--error--border-color:var(--color-alert--error-800, #BD0025);--text-area__message_box--font-size:var(--text--small, 12px);--text-area__message_box--info--color:var(--color--success, #22085d);--text-area__message_box--error--color:var(--color-alert--error-800, #BD0025);--text-area__label--floating--top:6px;--text-area__label--padding-top:12px;--text-area__label--padding-left:14px;--text-area__label--padding-right:12px;--text-area__scrollbar--color-default:var(--scrollbar--default, #626e82);--text-area__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--text-area__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--text-area__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--text-area__scrollbar--border-radius:var(--border--radius-small, 6px);--text-area__scrollbar--width:var(--space--small, 6px);--ez-text-area__tooltip-icon--spacing:var(--space--large);--ez-text-area__tooltip-icon---width:var(--space--large);--ez-text-area__tooltip-icon---horizontal-margin:var(--space--medium, 12px);--ez-text-area__tooltip-icon---vertical-margin:10px;--ez-text-area__tooltip_icon--error--color:var(--color-alert--error-800, #BD0025);display:flex;flex-wrap:wrap;position:relative;width:var(--text-area--width)}textarea{display:flex;flex-direction:column;height:calc(100% - 16px);box-sizing:border-box;border:none;resize:none;width:100%;padding:0;background:none;min-height:42px;font-weight:var(--text-area--font-weight);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);color:var(--text-area--color);margin-top:calc(var(--space--medium, 12px) + 4px);scrollbar-width:thin;scrollbar-color:var(--text-area__scrollbar--color-clicked) var(--text-area__scrollbar--color-background)}textarea:focus{outline:none}textarea:disabled{background-color:transparent;color:var(--text-area__input--disabled--color);border:var(--text-area__input--disabled--border);cursor:not-allowed}textarea::-webkit-scrollbar{background-color:var(--text-area__scrollbar--color-background);width:var(--text-area__scrollbar--width);max-width:var(--text-area__scrollbar--width);min-width:var(--text-area__scrollbar--width)}textarea::-webkit-scrollbar-thumb{background-color:var(--text-area__scrollbar--color-default);border-radius:var(--text-area__scrollbar--border-radius)}textarea::-webkit-scrollbar-track{background-color:var(--text-area__scrollbar--color-background);border-radius:var(--text-area__scrollbar--border-radius)}textarea::-webkit-scrollbar-thumb:vertical:hover,textarea::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--text-area__scrollbar--color-hover)}textarea::-webkit-scrollbar-thumb:vertical:active,textarea::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--text-area__scrollbar--color-clicked)}.textarea{width:100%;min-height:42px;max-width:100%;box-sizing:border-box;padding-left:var(--space--medium);padding-right:var(--space--extra-small);border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--border-color);background-color:var(--text-area__input--background-color)}.textarea--disabled{border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--disabled--border--color);background-color:var(--text-area__input--disabled--background-color);cursor:not-allowed}.textarea--focus{border-color:var(--text-area__input--focus--border-color)}.textarea.hasError{color:var(--text-area--color);border-color:var(--text-area__input--error--border-color)}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--text-area--font-family);font-size:var(--text-area__message_box--font-size);color:var(--text-area__message_box--info--color)}.hasError{color:var(--text-area__message_box--error--color)}.textarea__label{box-sizing:border-box;position:absolute;z-index:var(--visible);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(--text-area__label--padding-right));left:var(--text-area--space--medium);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color);top:var(--text-area__label--padding-top);left:var(--text-area__label--padding-left);padding-right:var(--text-area__label--padding-right)}.textarea__label--floated{font-family:var(--text-area--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--text-area__label--floating--top)}.textarea__label--disabled{color:var(--text-area__input--disabled--color);cursor:not-allowed}.textarea--slim{margin-top:var(--space--small, 6px)}.textarea--slim::-webkit-input-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:-moz-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim::-moz-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:-ms-input-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim::placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:disabled::-webkit-input-placeholder,.textarea--slim:disabled:-moz-placeholder,.textarea--slim:disabled::-moz-placeholder,.textarea--slim:disabled:-ms-input-placeholder,.textarea--slim:disabled::placeholder{color:var(--text-area__input--disabled--color);cursor:not-allowed}ez-icon.tooltip-icon.hasError{--ez-icon--color:var(--ez-text-area__tooltip_icon--error--color)}.input-container{display:flex;align-items:center}.textarea--resizable{resize:vertical;overflow:auto;min-height:42px}";
|
|
85097
85104
|
|
|
85098
85105
|
const EzTextArea$1 = class extends HTMLElement$1 {
|
|
85099
85106
|
constructor() {
|
|
@@ -85109,7 +85116,7 @@ const EzTextArea$1 = class extends HTMLElement$1 {
|
|
|
85109
85116
|
this.errorMessage = undefined;
|
|
85110
85117
|
this.rows = 4;
|
|
85111
85118
|
this.canShowError = true;
|
|
85112
|
-
this.mode =
|
|
85119
|
+
this.mode = 'regular';
|
|
85113
85120
|
this.enableResize = true;
|
|
85114
85121
|
this.autoRows = false;
|
|
85115
85122
|
this.autoFocus = false;
|
|
@@ -85132,10 +85139,10 @@ const EzTextArea$1 = class extends HTMLElement$1 {
|
|
|
85132
85139
|
if (this._inputElem) {
|
|
85133
85140
|
if (newValue != oldValue) {
|
|
85134
85141
|
if (this.canChangeValue()) {
|
|
85135
|
-
this._inputElem.value = this.value ||
|
|
85142
|
+
this._inputElem.value = this.value || '';
|
|
85136
85143
|
}
|
|
85137
85144
|
this.adjustFloatingLabel();
|
|
85138
|
-
this.errorMessage =
|
|
85145
|
+
this.errorMessage = '';
|
|
85139
85146
|
this.ezChange.emit(this.value);
|
|
85140
85147
|
}
|
|
85141
85148
|
}
|
|
@@ -85144,13 +85151,13 @@ const EzTextArea$1 = class extends HTMLElement$1 {
|
|
|
85144
85151
|
if (this._initialRows == undefined) {
|
|
85145
85152
|
this._initialRows = this.rows > 0 ? this.rows : undefined;
|
|
85146
85153
|
}
|
|
85147
|
-
const rows = this._initialRows > 0 ? this._initialRows : this.mode !=
|
|
85154
|
+
const rows = this._initialRows > 0 ? this._initialRows : this.mode != 'slim' ? 4 : 2;
|
|
85148
85155
|
if (rows !== this.rows) {
|
|
85149
85156
|
this.rows = rows;
|
|
85150
85157
|
}
|
|
85151
85158
|
}
|
|
85152
85159
|
observeRows() {
|
|
85153
|
-
const rows = this.rows > 0 ? this.rows : this.mode !=
|
|
85160
|
+
const rows = this.rows > 0 ? this.rows : this.mode != 'slim' ? 4 : 2;
|
|
85154
85161
|
if (rows !== this.rows) {
|
|
85155
85162
|
this.updateRows(rows);
|
|
85156
85163
|
}
|
|
@@ -85183,8 +85190,8 @@ const EzTextArea$1 = class extends HTMLElement$1 {
|
|
|
85183
85190
|
var _a, _b, _c, _d;
|
|
85184
85191
|
const selectionStart = this._inputElem.selectionStart;
|
|
85185
85192
|
const selectionEnd = this._inputElem.selectionEnd;
|
|
85186
|
-
const textStart = (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.substring(0, selectionStart)) !== null && _b !== void 0 ? _b :
|
|
85187
|
-
const textEnd = (_d = (_c = this.value) === null || _c === void 0 ? void 0 : _c.substring(selectionEnd)) !== null && _d !== void 0 ? _d :
|
|
85193
|
+
const textStart = (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.substring(0, selectionStart)) !== null && _b !== void 0 ? _b : '';
|
|
85194
|
+
const textEnd = (_d = (_c = this.value) === null || _c === void 0 ? void 0 : _c.substring(selectionEnd)) !== null && _d !== void 0 ? _d : '';
|
|
85188
85195
|
this.value = `${textStart}${text}${textEnd}`;
|
|
85189
85196
|
const newSelectionEnd = selectionStart + text.length;
|
|
85190
85197
|
const start = (selectionStart === selectionEnd) ? newSelectionEnd : selectionStart;
|
|
@@ -85207,28 +85214,28 @@ const EzTextArea$1 = class extends HTMLElement$1 {
|
|
|
85207
85214
|
* Retorna se o conteúdo é inválido.
|
|
85208
85215
|
*/
|
|
85209
85216
|
async isInvalid() {
|
|
85210
|
-
return typeof this.errorMessage ===
|
|
85217
|
+
return typeof this.errorMessage === 'string' && this.errorMessage.trim() !== '';
|
|
85211
85218
|
}
|
|
85212
85219
|
//---------------------------------------------
|
|
85213
85220
|
// Private methods
|
|
85214
85221
|
//---------------------------------------------
|
|
85215
85222
|
canChangeValue() {
|
|
85216
|
-
return this._inputElem && (this.value ||
|
|
85223
|
+
return this._inputElem && (this.value || '') !== this._inputElem.value;
|
|
85217
85224
|
}
|
|
85218
85225
|
adjustFloatingLabel() {
|
|
85219
85226
|
if (this.forceLabelFloat)
|
|
85220
85227
|
return;
|
|
85221
85228
|
if (this.label && this._labelElem) {
|
|
85222
85229
|
const hasValue = this.value && this.value.toString().length > 0;
|
|
85223
|
-
const containsFloatedClass = this._labelElem.classList.contains(
|
|
85230
|
+
const containsFloatedClass = this._labelElem.classList.contains('textarea__label--floated');
|
|
85224
85231
|
if (hasValue || this.isFocused()) {
|
|
85225
85232
|
if (!containsFloatedClass) {
|
|
85226
|
-
this._labelElem.classList.add(
|
|
85233
|
+
this._labelElem.classList.add('textarea__label--floated');
|
|
85227
85234
|
}
|
|
85228
85235
|
}
|
|
85229
85236
|
else {
|
|
85230
85237
|
if (containsFloatedClass) {
|
|
85231
|
-
this._labelElem.classList.remove(
|
|
85238
|
+
this._labelElem.classList.remove('textarea__label--floated');
|
|
85232
85239
|
}
|
|
85233
85240
|
}
|
|
85234
85241
|
}
|
|
@@ -85277,8 +85284,8 @@ const EzTextArea$1 = class extends HTMLElement$1 {
|
|
|
85277
85284
|
//---------------------------------------------
|
|
85278
85285
|
handleFocusout() {
|
|
85279
85286
|
this.adjustFloatingLabel();
|
|
85280
|
-
if (this._container && this._container.classList.contains(
|
|
85281
|
-
this._container.classList.remove(
|
|
85287
|
+
if (this._container && this._container.classList.contains('textarea--focus')) {
|
|
85288
|
+
this._container.classList.remove('textarea--focus');
|
|
85282
85289
|
}
|
|
85283
85290
|
}
|
|
85284
85291
|
handleChange() {
|
|
@@ -85287,11 +85294,11 @@ const EzTextArea$1 = class extends HTMLElement$1 {
|
|
|
85287
85294
|
}
|
|
85288
85295
|
}
|
|
85289
85296
|
handleFocus() {
|
|
85290
|
-
if (this.label && this._labelElem && !this._labelElem.classList.contains(
|
|
85291
|
-
this._labelElem.classList.add(
|
|
85297
|
+
if (this.label && this._labelElem && !this._labelElem.classList.contains('textarea__label--floated')) {
|
|
85298
|
+
this._labelElem.classList.add('textarea__label--floated');
|
|
85292
85299
|
}
|
|
85293
|
-
if (this._container && !this._container.classList.contains(
|
|
85294
|
-
this._container.classList.add(
|
|
85300
|
+
if (this._container && !this._container.classList.contains('textarea--focus')) {
|
|
85301
|
+
this._container.classList.add('textarea--focus');
|
|
85295
85302
|
}
|
|
85296
85303
|
}
|
|
85297
85304
|
connectedCallback() {
|
|
@@ -85304,7 +85311,7 @@ const EzTextArea$1 = class extends HTMLElement$1 {
|
|
|
85304
85311
|
buildPlaceholder() {
|
|
85305
85312
|
if (this.alternativePlaceholder)
|
|
85306
85313
|
return this.alternativePlaceholder;
|
|
85307
|
-
return (this.mode ===
|
|
85314
|
+
return (this.mode === 'slim' && this.label) ? this.label : '';
|
|
85308
85315
|
}
|
|
85309
85316
|
buildLabelClass() {
|
|
85310
85317
|
let classList = this.enabled ? 'textarea__label' : 'textarea__label textarea__label--disabled';
|
|
@@ -85314,6 +85321,19 @@ const EzTextArea$1 = class extends HTMLElement$1 {
|
|
|
85314
85321
|
classList = classList + ' textarea__label--floated';
|
|
85315
85322
|
return classList;
|
|
85316
85323
|
}
|
|
85324
|
+
renderErrorTooltip() {
|
|
85325
|
+
if (!this.canShowError || this.mode == 'slim' || !this.errorMessage)
|
|
85326
|
+
return;
|
|
85327
|
+
return (h("div", { class: "tooltip-container" }, h("ez-tooltip", { type: "error", message: this.errorMessage }, h("ez-icon", { class: `tooltip-icon ${this.errorMessage ? 'hasError' : ''}`, "data-element-id": ElementIDUtils.getInternalIDInfo('tooltip-icon'), iconName: "alert-circle" }))));
|
|
85328
|
+
}
|
|
85329
|
+
renderLabel() {
|
|
85330
|
+
if (!this.label || this.mode == 'slim')
|
|
85331
|
+
return null;
|
|
85332
|
+
return h("label", { ref: (el) => this._labelElem = el, class: this.buildLabelClass(), onClick: () => this._inputElem.focus(), title: this.label }, this.label);
|
|
85333
|
+
}
|
|
85334
|
+
renderTextArea() {
|
|
85335
|
+
return h("textarea", { onFocus: () => this.handleFocus(), "data-element-id": ElementIDUtils.getInternalIDInfo('input'), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, class: { 'textarea--slim': this.mode === 'slim' }, placeholder: this.buildPlaceholder(), onInput: () => this.handleChange(), onFocusout: () => this.handleFocusout(), rows: this.rows });
|
|
85336
|
+
}
|
|
85317
85337
|
//---------------------------------------------
|
|
85318
85338
|
// Lifecycle web component
|
|
85319
85339
|
//---------------------------------------------
|
|
@@ -85329,13 +85349,7 @@ const EzTextArea$1 = class extends HTMLElement$1 {
|
|
|
85329
85349
|
}
|
|
85330
85350
|
render() {
|
|
85331
85351
|
ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
|
|
85332
|
-
return (h(Host, null, h("div", { class: `textarea ${this.enabled ?
|
|
85333
|
-
h("label", { ref: (el) => this._labelElem = el, class: this.buildLabelClass(), onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
85334
|
-
: null, h("textarea", { onFocus: () => this.handleFocus(), "data-element-id": ElementIDUtils.getInternalIDInfo("input"), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, class: {
|
|
85335
|
-
"textarea--slim": this.mode === "slim",
|
|
85336
|
-
"textarea--resizable": this.enableResize
|
|
85337
|
-
}, placeholder: this.buildPlaceholder(), onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, rows: this.rows })), this.canShowError && this.mode != "slim" &&
|
|
85338
|
-
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
85352
|
+
return (h(Host, null, h("div", { class: `textarea ${this.enabled ? '' : 'textarea--disabled'}`, ref: (el) => this._container = el }, this.renderLabel(), h("div", { class: `input-container ${this.enableResize ? 'textarea--resizable' : ""}` }, this.renderTextArea(), this.renderErrorTooltip()))));
|
|
85339
85353
|
}
|
|
85340
85354
|
get _hostElement() { return this; }
|
|
85341
85355
|
static get watchers() { return {
|
|
@@ -87548,7 +87562,7 @@ const EzPopoverCore = /*@__PURE__*/proxyCustomElement(EzPopoverCore$1, [1,"ez-po
|
|
|
87548
87562
|
const EzPopoverPlus = /*@__PURE__*/proxyCustomElement(EzPopoverPlus$1, [1,"ez-popover-plus",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"overlayType":[513,"overlay-type"],"anchorElement":[1537,"anchor-element"],"options":[1040],"useAnchorSize":[516,"use-anchor-size"],"minWidth":[514,"min-width"]}]);
|
|
87549
87563
|
const EzPopup = /*@__PURE__*/proxyCustomElement(EzPopup$1, [1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"],"enabledScroll":[4,"enabled-scroll"]}]);
|
|
87550
87564
|
const EzRadioButton = /*@__PURE__*/proxyCustomElement(EzRadioButton$1, [1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]);
|
|
87551
|
-
const EzRichText = /*@__PURE__*/proxyCustomElement(EzRichText$1, [2,"ez-rich-text",{"showPreview":[4,"show-preview"],"
|
|
87565
|
+
const EzRichText = /*@__PURE__*/proxyCustomElement(EzRichText$1, [2,"ez-rich-text",{"showPreview":[4,"show-preview"],"value":[1537],"label":[513],"mode":[513],"enabled":[516],"rows":[514],"errorMessage":[1537,"error-message"],"canShowError":[516,"can-show-error"],"showConfigs":[4,"show-configs"],"showTextFormat":[4,"show-text-format"],"showUndoRedo":[4,"show-undo-redo"],"previewMode":[32]},[[0,"executeToolbarCommand","handleExecuteToolbarCommand"]]]);
|
|
87552
87566
|
const EzRichToolbar = /*@__PURE__*/proxyCustomElement(EzRichToolbar$1, [2,"ez-rich-toolbar",{"showPreview":[4,"show-preview"],"isPreviewMode":[4,"is-preview-mode"],"showConfigs":[4,"show-configs"],"showTextFormat":[4,"show-text-format"],"showUndoRedo":[4,"show-undo-redo"]},[[0,"actionTriggered","handleActionTriggered"]]]);
|
|
87553
87567
|
const EzRichToolbarArrows = /*@__PURE__*/proxyCustomElement(EzRichToolbarArrows$1, [2,"ez-rich-toolbar-arrows"]);
|
|
87554
87568
|
const EzRichToolbarConfigs = /*@__PURE__*/proxyCustomElement(EzRichToolbarConfigs$1, [2,"ez-rich-toolbar-configs"]);
|
|
@@ -285,7 +285,7 @@ const EzCustomFormInput = class {
|
|
|
285
285
|
}; }
|
|
286
286
|
};
|
|
287
287
|
|
|
288
|
-
const ezRichTextCss = ".sc-ez-rich-text-h{display:block;width:100%;font-family:Roboto;--ez-rich-text--box-shadow:0 0 3px 0 #DCE0E8;--ez-rich-text--shadow--outline:var(--shadow--outline) var(--color--strokes)}.editor-container.
|
|
288
|
+
const ezRichTextCss = ".sc-ez-rich-text-h{display:block;width:100%;font-family:Roboto;--ez-rich-text--box-shadow:0 0 3px 0 #DCE0E8;--ez-rich-text--shadow--outline:var(--shadow--outline) var(--color--strokes)}.editor-container.sc-ez-rich-text{width:100%;overflow:hidden;border-radius:12px;border:1px solid #DCE0E8}ez-text-area.sc-ez-rich-text{--text-area__input--border:1px solid}.preview.sc-ez-rich-text{min-height:20px;padding:12px;resize:both;overflow:auto;max-width:100%;border-top:1px solid #DCE0E8}";
|
|
289
289
|
|
|
290
290
|
const EzRichText = class {
|
|
291
291
|
constructor(hostRef) {
|
|
@@ -295,12 +295,13 @@ const EzRichText = class {
|
|
|
295
295
|
this.historyIndex = -1;
|
|
296
296
|
this.previewMode = false;
|
|
297
297
|
this.showPreview = true;
|
|
298
|
-
this.showBorder = false;
|
|
299
298
|
this.value = '';
|
|
300
299
|
this.label = undefined;
|
|
300
|
+
this.mode = "regular";
|
|
301
301
|
this.enabled = true;
|
|
302
302
|
this.rows = 6;
|
|
303
303
|
this.errorMessage = undefined;
|
|
304
|
+
this.canShowError = true;
|
|
304
305
|
this.showConfigs = true;
|
|
305
306
|
this.showTextFormat = true;
|
|
306
307
|
this.showUndoRedo = true;
|
|
@@ -310,6 +311,11 @@ const EzRichText = class {
|
|
|
310
311
|
return;
|
|
311
312
|
this.ezChange.emit(newValue);
|
|
312
313
|
}
|
|
314
|
+
observeErrorMessage(newValue) {
|
|
315
|
+
if (newValue && this.previewMode) {
|
|
316
|
+
this.previewMode = false;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
313
319
|
async handleExecuteToolbarCommand(event) {
|
|
314
320
|
const { command, value } = event.detail;
|
|
315
321
|
await this.executeCommand(command, value);
|
|
@@ -538,14 +544,15 @@ const EzRichText = class {
|
|
|
538
544
|
if (this.previewMode) {
|
|
539
545
|
return (h("div", { id: 'rich-text-preview-container', class: "preview", innerHTML: this.getSanitizedValue() }));
|
|
540
546
|
}
|
|
541
|
-
return h("ez-text-area", { ref: (el) => this.textAreaRef = el, label: this.label, value: this.value, enabled: this.enabled, rows: this.rows, mode:
|
|
547
|
+
return h("ez-text-area", { ref: (el) => this.textAreaRef = el, label: this.label, value: this.value, enabled: this.enabled, rows: this.rows, mode: this.mode, canShowError: this.canShowError, errorMessage: this.errorMessage, onEzChange: this.handleTextAreaChanged.bind(this) });
|
|
542
548
|
}
|
|
543
549
|
render() {
|
|
544
|
-
return (h(Host, null, h("div", { class:
|
|
550
|
+
return (h(Host, null, h("div", { class: 'editor-container bordered' }, h("ez-rich-toolbar", { isPreviewMode: this.previewMode, showPreview: this.showPreview, showConfigs: this.showConfigs && this.enabled, showTextFormat: this.showTextFormat && this.enabled, showUndoRedo: this.showUndoRedo && this.enabled }), this.renderContent()), h("ez-link-builder", { ref: (el) => this.linkBuilderRef = el }), h("ez-simple-image-uploader", { ref: (el) => this.imageUploaderRef = el })));
|
|
545
551
|
}
|
|
546
552
|
get element() { return getElement(this); }
|
|
547
553
|
static get watchers() { return {
|
|
548
|
-
"value": ["observeValue"]
|
|
554
|
+
"value": ["observeValue"],
|
|
555
|
+
"errorMessage": ["observeErrorMessage"]
|
|
549
556
|
}; }
|
|
550
557
|
};
|
|
551
558
|
EzRichText.style = ezRichTextCss;
|