@sankhyalabs/ezui 4.12.4 → 4.13.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-dialog.cjs.entry.js +9 -4
- package/dist/cjs/ez-form-view.cjs.entry.js +8 -2
- package/dist/cjs/ez-upload.cjs.entry.js +4 -2
- package/dist/cjs/ez-view-stack.cjs.entry.js +2 -1
- package/dist/collection/components/ez-dialog/ez-dialog.js +9 -4
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +9 -2
- package/dist/collection/components/ez-upload/ez-upload.js +4 -2
- package/dist/collection/components/ez-view-stack/ez-view-stack.js +3 -2
- package/dist/custom-elements/index.js +23 -9
- package/dist/esm/ez-dialog.entry.js +9 -4
- package/dist/esm/ez-form-view.entry.js +9 -3
- package/dist/esm/ez-upload.entry.js +4 -2
- package/dist/esm/ez-view-stack.entry.js +3 -2
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-439168e8.entry.js +1 -0
- package/dist/ezui/p-6d794472.entry.js +1 -0
- package/dist/ezui/p-816a3218.entry.js +1 -0
- package/dist/ezui/p-9a58e143.entry.js +1 -0
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +2 -2
- package/dist/types/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.d.ts +1 -1
- package/package.json +1 -1
- package/dist/ezui/p-55cd357c.entry.js +0 -1
- package/dist/ezui/p-60e30f92.entry.js +0 -1
- package/dist/ezui/p-9243559c.entry.js +0 -1
- package/dist/ezui/p-a279fbc2.entry.js +0 -1
|
@@ -137,9 +137,6 @@ const EzDialog = class {
|
|
|
137
137
|
getClassTitleLabel(message) {
|
|
138
138
|
return this.getIconElement(message) == undefined ? "title title__label title__label--no-icon" : "title title__label";
|
|
139
139
|
}
|
|
140
|
-
componentDidRender() {
|
|
141
|
-
this.manageOverlay();
|
|
142
|
-
}
|
|
143
140
|
componentWillRender() {
|
|
144
141
|
if (!this._currentMessage) {
|
|
145
142
|
if (this._messageQueue.length > 0) {
|
|
@@ -155,9 +152,17 @@ const EzDialog = class {
|
|
|
155
152
|
componentDidLoad() {
|
|
156
153
|
core.ElementIDUtils.addIDInfo(this._element);
|
|
157
154
|
}
|
|
155
|
+
componentDidRender() {
|
|
156
|
+
this.manageOverlay();
|
|
157
|
+
const dialog = this._element.shadowRoot.querySelector('.overlay .dialog');
|
|
158
|
+
if (dialog instanceof HTMLDivElement) {
|
|
159
|
+
dialog.style.outline = 'none';
|
|
160
|
+
dialog.focus();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
158
163
|
render() {
|
|
159
164
|
if (this.opened && this._currentMessage) {
|
|
160
|
-
return (index.h("div", { class: "overlay", ref: ref => this._overlayRef = ref }, index.h("div", { class: "dialog" }, this.getTypeIndicatorElement(this._currentMessage), index.h("div", { class: this.getClassContainer(this._currentMessage) }, index.h("div", { class: "title__container" }, index.h("div", { class: "title__box" }, this.getIconElement(this._currentMessage), index.h("div", { class: this.getClassTitleLabel(this._currentMessage), innerHTML: this._currentMessage.title, "data-element-id": core.ElementIDUtils.getInternalIDInfo("title") })), index.h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false), "data-element-id": core.ElementIDUtils.getInternalIDInfo("buttonClose") })), index.h("div", { class: "message", innerHTML: this._currentMessage.message, "data-element-id": core.ElementIDUtils.getInternalIDInfo("message") }), this._currentMessage.confirm &&
|
|
165
|
+
return (index.h("div", { class: "overlay", ref: ref => this._overlayRef = ref }, index.h("div", { tabindex: "-1", class: "dialog" }, this.getTypeIndicatorElement(this._currentMessage), index.h("div", { class: this.getClassContainer(this._currentMessage) }, index.h("div", { class: "title__container" }, index.h("div", { class: "title__box" }, this.getIconElement(this._currentMessage), index.h("div", { class: this.getClassTitleLabel(this._currentMessage), innerHTML: this._currentMessage.title, "data-element-id": core.ElementIDUtils.getInternalIDInfo("title") })), index.h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false), "data-element-id": core.ElementIDUtils.getInternalIDInfo("buttonClose") })), index.h("div", { class: "message", innerHTML: this._currentMessage.message, "data-element-id": core.ElementIDUtils.getInternalIDInfo("message") }), this._currentMessage.confirm &&
|
|
161
166
|
index.h("div", { class: "button-yes-no__container" }, index.h("ez-button", { class: "button__cancel", "data-element-id": core.ElementIDUtils.getInternalIDInfo("cancel"), label: this._currentMessage.labelCancel, onClick: () => this.handleButtonClick(false) }), index.h("ez-button", { class: !this._currentMessage.btnConfirmDanger ? "button__confirm" : "button__confirm--danger", "data-element-id": core.ElementIDUtils.getInternalIDInfo("confirm"), label: this._currentMessage.labelConfirm, onClick: () => this.handleButtonClick(true) })), !this._currentMessage.confirm &&
|
|
162
167
|
index.h("div", { class: "button__confirm--container" }, index.h("ez-button", { label: 'Ok', "data-element-id": core.ElementIDUtils.getInternalIDInfo("ok"), class: "button__confirm", onClick: () => this.handleButtonClick(true) }))))));
|
|
163
168
|
}
|
|
@@ -45,9 +45,15 @@ const buildDateTime = ({ name, label, readOnly, contextName }) => {
|
|
|
45
45
|
index.h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name })));
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
const buildFile = ({ name, label, readOnly, contextName }) => {
|
|
48
|
+
const buildFile = ({ name, label, readOnly, contextName, props }) => {
|
|
49
|
+
const uploadProps = core.ObjectUtils.removeEmptyValues({
|
|
50
|
+
subTitle: props.subTitle,
|
|
51
|
+
requestHeaders: props.STORAGESTRATEGY ? {
|
|
52
|
+
STORAGESTRATEGY: props.STORAGESTRATEGY
|
|
53
|
+
} : null
|
|
54
|
+
});
|
|
49
55
|
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
50
|
-
index.h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name })));
|
|
56
|
+
index.h("ez-upload", Object.assign({ enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name }, uploadProps))));
|
|
51
57
|
};
|
|
52
58
|
|
|
53
59
|
const buildDecimal = ({ name, label, readOnly, props, contextName }) => {
|
|
@@ -137,7 +137,7 @@ const EzUpload = class {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
updateFilePointers() {
|
|
140
|
-
if (this.value) {
|
|
140
|
+
if (Array.isArray(this.value)) {
|
|
141
141
|
this.value.forEach(ezFile => this._filePointers.set(ezFile.name, ezFile));
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -344,6 +344,7 @@ const EzUpload = class {
|
|
|
344
344
|
if (this._host) {
|
|
345
345
|
core.ElementIDUtils.addIDInfo(this._host, 'input');
|
|
346
346
|
}
|
|
347
|
+
this.observeRequestHeaders();
|
|
347
348
|
}
|
|
348
349
|
componentWillRender() {
|
|
349
350
|
if (this.value) {
|
|
@@ -368,7 +369,8 @@ const EzUpload = class {
|
|
|
368
369
|
const fileName = item.name;
|
|
369
370
|
const progress = Number(item["progress"]);
|
|
370
371
|
const downloadURL = item["downloadURL"];
|
|
371
|
-
const
|
|
372
|
+
const size = item.size > 0 ? `(${this.formatBytes(item.size)})` : '';
|
|
373
|
+
const label = `${fileName} ${size}`;
|
|
372
374
|
return (index.h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() }, index.h("div", { class: "iu__item-label modificador" }, index.h("div", { title: label, class: "col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle" }, downloadURL ? index.h("a", { href: downloadURL, download: true }, label) : label)), isNaN(progress)
|
|
373
375
|
?
|
|
374
376
|
null
|
|
@@ -13,7 +13,7 @@ const EzViewStack = class {
|
|
|
13
13
|
/**
|
|
14
14
|
* Indetificador único do componente
|
|
15
15
|
*/
|
|
16
|
-
this._dataKey = '
|
|
16
|
+
this._dataKey = '';
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Exibe a visão de acordo com o índice.
|
|
@@ -53,6 +53,7 @@ const EzViewStack = class {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
componentWillRender() {
|
|
56
|
+
this._dataKey = 'id_'.concat(core.JSUtils.generateUUID());
|
|
56
57
|
if (!this._elemList) {
|
|
57
58
|
this._elemList = [];
|
|
58
59
|
this._focusedIndex = 0;
|
|
@@ -127,9 +127,6 @@ export class EzDialog {
|
|
|
127
127
|
getClassTitleLabel(message) {
|
|
128
128
|
return this.getIconElement(message) == undefined ? "title title__label title__label--no-icon" : "title title__label";
|
|
129
129
|
}
|
|
130
|
-
componentDidRender() {
|
|
131
|
-
this.manageOverlay();
|
|
132
|
-
}
|
|
133
130
|
componentWillRender() {
|
|
134
131
|
if (!this._currentMessage) {
|
|
135
132
|
if (this._messageQueue.length > 0) {
|
|
@@ -145,9 +142,17 @@ export class EzDialog {
|
|
|
145
142
|
componentDidLoad() {
|
|
146
143
|
ElementIDUtils.addIDInfo(this._element);
|
|
147
144
|
}
|
|
145
|
+
componentDidRender() {
|
|
146
|
+
this.manageOverlay();
|
|
147
|
+
const dialog = this._element.shadowRoot.querySelector('.overlay .dialog');
|
|
148
|
+
if (dialog instanceof HTMLDivElement) {
|
|
149
|
+
dialog.style.outline = 'none';
|
|
150
|
+
dialog.focus();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
148
153
|
render() {
|
|
149
154
|
if (this.opened && this._currentMessage) {
|
|
150
|
-
return (h("div", { class: "overlay", ref: ref => this._overlayRef = ref }, h("div", { class: "dialog" }, this.getTypeIndicatorElement(this._currentMessage), h("div", { class: this.getClassContainer(this._currentMessage) }, h("div", { class: "title__container" }, h("div", { class: "title__box" }, this.getIconElement(this._currentMessage), h("div", { class: this.getClassTitleLabel(this._currentMessage), innerHTML: this._currentMessage.title, "data-element-id": ElementIDUtils.getInternalIDInfo("title") })), h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false), "data-element-id": ElementIDUtils.getInternalIDInfo("buttonClose") })), h("div", { class: "message", innerHTML: this._currentMessage.message, "data-element-id": ElementIDUtils.getInternalIDInfo("message") }), this._currentMessage.confirm &&
|
|
155
|
+
return (h("div", { class: "overlay", ref: ref => this._overlayRef = ref }, h("div", { tabindex: "-1", class: "dialog" }, this.getTypeIndicatorElement(this._currentMessage), h("div", { class: this.getClassContainer(this._currentMessage) }, h("div", { class: "title__container" }, h("div", { class: "title__box" }, this.getIconElement(this._currentMessage), h("div", { class: this.getClassTitleLabel(this._currentMessage), innerHTML: this._currentMessage.title, "data-element-id": ElementIDUtils.getInternalIDInfo("title") })), h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false), "data-element-id": ElementIDUtils.getInternalIDInfo("buttonClose") })), h("div", { class: "message", innerHTML: this._currentMessage.message, "data-element-id": ElementIDUtils.getInternalIDInfo("message") }), this._currentMessage.confirm &&
|
|
151
156
|
h("div", { class: "button-yes-no__container" }, h("ez-button", { class: "button__cancel", "data-element-id": ElementIDUtils.getInternalIDInfo("cancel"), label: this._currentMessage.labelCancel, onClick: () => this.handleButtonClick(false) }), h("ez-button", { class: !this._currentMessage.btnConfirmDanger ? "button__confirm" : "button__confirm--danger", "data-element-id": ElementIDUtils.getInternalIDInfo("confirm"), label: this._currentMessage.labelConfirm, onClick: () => this.handleButtonClick(true) })), !this._currentMessage.confirm &&
|
|
152
157
|
h("div", { class: "button__confirm--container" }, h("ez-button", { label: 'Ok', "data-element-id": ElementIDUtils.getInternalIDInfo("ok"), class: "button__confirm", onClick: () => this.handleButtonClick(true) }))))));
|
|
153
158
|
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { ObjectUtils } from "@sankhyalabs/core";
|
|
3
|
+
export const buildFile = ({ name, label, readOnly, contextName, props }) => {
|
|
4
|
+
const uploadProps = ObjectUtils.removeEmptyValues({
|
|
5
|
+
subTitle: props.subTitle,
|
|
6
|
+
requestHeaders: props.STORAGESTRATEGY ? {
|
|
7
|
+
STORAGESTRATEGY: props.STORAGESTRATEGY
|
|
8
|
+
} : null
|
|
9
|
+
});
|
|
10
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-upload", Object.assign({ enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name }, uploadProps))));
|
|
4
11
|
};
|
|
@@ -31,7 +31,7 @@ export class EzUpload {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
updateFilePointers() {
|
|
34
|
-
if (this.value) {
|
|
34
|
+
if (Array.isArray(this.value)) {
|
|
35
35
|
this.value.forEach(ezFile => this._filePointers.set(ezFile.name, ezFile));
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -238,6 +238,7 @@ export class EzUpload {
|
|
|
238
238
|
if (this._host) {
|
|
239
239
|
ElementIDUtils.addIDInfo(this._host, 'input');
|
|
240
240
|
}
|
|
241
|
+
this.observeRequestHeaders();
|
|
241
242
|
}
|
|
242
243
|
componentWillRender() {
|
|
243
244
|
if (this.value) {
|
|
@@ -262,7 +263,8 @@ export class EzUpload {
|
|
|
262
263
|
const fileName = item.name;
|
|
263
264
|
const progress = Number(item["progress"]);
|
|
264
265
|
const downloadURL = item["downloadURL"];
|
|
265
|
-
const
|
|
266
|
+
const size = item.size > 0 ? `(${this.formatBytes(item.size)})` : '';
|
|
267
|
+
const label = `${fileName} ${size}`;
|
|
266
268
|
return (h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() }, h("div", { class: "iu__item-label modificador" }, h("div", { title: label, class: "col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle" }, downloadURL ? h("a", { href: downloadURL, download: true }, label) : label)), isNaN(progress)
|
|
267
269
|
?
|
|
268
270
|
null
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { h, Host } from '@stencil/core';
|
|
2
|
-
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { ElementIDUtils, JSUtils } from '@sankhyalabs/core';
|
|
3
3
|
export class EzViewStack {
|
|
4
4
|
constructor() {
|
|
5
5
|
/**
|
|
6
6
|
* Indetificador único do componente
|
|
7
7
|
*/
|
|
8
|
-
this._dataKey = '
|
|
8
|
+
this._dataKey = '';
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Exibe a visão de acordo com o índice.
|
|
@@ -46,6 +46,7 @@ export class EzViewStack {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
componentWillRender() {
|
|
49
|
+
this._dataKey = 'id_'.concat(JSUtils.generateUUID());
|
|
49
50
|
if (!this._elemList) {
|
|
50
51
|
this._elemList = [];
|
|
51
52
|
this._focusedIndex = 0;
|
|
@@ -3121,9 +3121,6 @@ const EzDialog$1 = class extends HTMLElement$1 {
|
|
|
3121
3121
|
getClassTitleLabel(message) {
|
|
3122
3122
|
return this.getIconElement(message) == undefined ? "title title__label title__label--no-icon" : "title title__label";
|
|
3123
3123
|
}
|
|
3124
|
-
componentDidRender() {
|
|
3125
|
-
this.manageOverlay();
|
|
3126
|
-
}
|
|
3127
3124
|
componentWillRender() {
|
|
3128
3125
|
if (!this._currentMessage) {
|
|
3129
3126
|
if (this._messageQueue.length > 0) {
|
|
@@ -3139,9 +3136,17 @@ const EzDialog$1 = class extends HTMLElement$1 {
|
|
|
3139
3136
|
componentDidLoad() {
|
|
3140
3137
|
ElementIDUtils.addIDInfo(this._element);
|
|
3141
3138
|
}
|
|
3139
|
+
componentDidRender() {
|
|
3140
|
+
this.manageOverlay();
|
|
3141
|
+
const dialog = this._element.shadowRoot.querySelector('.overlay .dialog');
|
|
3142
|
+
if (dialog instanceof HTMLDivElement) {
|
|
3143
|
+
dialog.style.outline = 'none';
|
|
3144
|
+
dialog.focus();
|
|
3145
|
+
}
|
|
3146
|
+
}
|
|
3142
3147
|
render() {
|
|
3143
3148
|
if (this.opened && this._currentMessage) {
|
|
3144
|
-
return (h("div", { class: "overlay", ref: ref => this._overlayRef = ref }, h("div", { class: "dialog" }, this.getTypeIndicatorElement(this._currentMessage), h("div", { class: this.getClassContainer(this._currentMessage) }, h("div", { class: "title__container" }, h("div", { class: "title__box" }, this.getIconElement(this._currentMessage), h("div", { class: this.getClassTitleLabel(this._currentMessage), innerHTML: this._currentMessage.title, "data-element-id": ElementIDUtils.getInternalIDInfo("title") })), h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false), "data-element-id": ElementIDUtils.getInternalIDInfo("buttonClose") })), h("div", { class: "message", innerHTML: this._currentMessage.message, "data-element-id": ElementIDUtils.getInternalIDInfo("message") }), this._currentMessage.confirm &&
|
|
3149
|
+
return (h("div", { class: "overlay", ref: ref => this._overlayRef = ref }, h("div", { tabindex: "-1", class: "dialog" }, this.getTypeIndicatorElement(this._currentMessage), h("div", { class: this.getClassContainer(this._currentMessage) }, h("div", { class: "title__container" }, h("div", { class: "title__box" }, this.getIconElement(this._currentMessage), h("div", { class: this.getClassTitleLabel(this._currentMessage), innerHTML: this._currentMessage.title, "data-element-id": ElementIDUtils.getInternalIDInfo("title") })), h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false), "data-element-id": ElementIDUtils.getInternalIDInfo("buttonClose") })), h("div", { class: "message", innerHTML: this._currentMessage.message, "data-element-id": ElementIDUtils.getInternalIDInfo("message") }), this._currentMessage.confirm &&
|
|
3145
3150
|
h("div", { class: "button-yes-no__container" }, h("ez-button", { class: "button__cancel", "data-element-id": ElementIDUtils.getInternalIDInfo("cancel"), label: this._currentMessage.labelCancel, onClick: () => this.handleButtonClick(false) }), h("ez-button", { class: !this._currentMessage.btnConfirmDanger ? "button__confirm" : "button__confirm--danger", "data-element-id": ElementIDUtils.getInternalIDInfo("confirm"), label: this._currentMessage.labelConfirm, onClick: () => this.handleButtonClick(true) })), !this._currentMessage.confirm &&
|
|
3146
3151
|
h("div", { class: "button__confirm--container" }, h("ez-button", { label: 'Ok', "data-element-id": ElementIDUtils.getInternalIDInfo("ok"), class: "button__confirm", onClick: () => this.handleButtonClick(true) }))))));
|
|
3147
3152
|
}
|
|
@@ -4352,9 +4357,15 @@ const buildDateTime = ({ name, label, readOnly, contextName }) => {
|
|
|
4352
4357
|
h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name })));
|
|
4353
4358
|
};
|
|
4354
4359
|
|
|
4355
|
-
const buildFile = ({ name, label, readOnly, contextName }) => {
|
|
4360
|
+
const buildFile = ({ name, label, readOnly, contextName, props }) => {
|
|
4361
|
+
const uploadProps = ObjectUtils$1.removeEmptyValues({
|
|
4362
|
+
subTitle: props.subTitle,
|
|
4363
|
+
requestHeaders: props.STORAGESTRATEGY ? {
|
|
4364
|
+
STORAGESTRATEGY: props.STORAGESTRATEGY
|
|
4365
|
+
} : null
|
|
4366
|
+
});
|
|
4356
4367
|
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
4357
|
-
h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name })));
|
|
4368
|
+
h("ez-upload", Object.assign({ enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name }, uploadProps))));
|
|
4358
4369
|
};
|
|
4359
4370
|
|
|
4360
4371
|
const buildDecimal = ({ name, label, readOnly, props, contextName }) => {
|
|
@@ -127681,7 +127692,7 @@ const EzUpload$1 = class extends HTMLElement$1 {
|
|
|
127681
127692
|
}
|
|
127682
127693
|
}
|
|
127683
127694
|
updateFilePointers() {
|
|
127684
|
-
if (this.value) {
|
|
127695
|
+
if (Array.isArray(this.value)) {
|
|
127685
127696
|
this.value.forEach(ezFile => this._filePointers.set(ezFile.name, ezFile));
|
|
127686
127697
|
}
|
|
127687
127698
|
}
|
|
@@ -127888,6 +127899,7 @@ const EzUpload$1 = class extends HTMLElement$1 {
|
|
|
127888
127899
|
if (this._host) {
|
|
127889
127900
|
ElementIDUtils.addIDInfo(this._host, 'input');
|
|
127890
127901
|
}
|
|
127902
|
+
this.observeRequestHeaders();
|
|
127891
127903
|
}
|
|
127892
127904
|
componentWillRender() {
|
|
127893
127905
|
if (this.value) {
|
|
@@ -127912,7 +127924,8 @@ const EzUpload$1 = class extends HTMLElement$1 {
|
|
|
127912
127924
|
const fileName = item.name;
|
|
127913
127925
|
const progress = Number(item["progress"]);
|
|
127914
127926
|
const downloadURL = item["downloadURL"];
|
|
127915
|
-
const
|
|
127927
|
+
const size = item.size > 0 ? `(${this.formatBytes(item.size)})` : '';
|
|
127928
|
+
const label = `${fileName} ${size}`;
|
|
127916
127929
|
return (h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() }, h("div", { class: "iu__item-label modificador" }, h("div", { title: label, class: "col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle" }, downloadURL ? h("a", { href: downloadURL, download: true }, label) : label)), isNaN(progress)
|
|
127917
127930
|
?
|
|
127918
127931
|
null
|
|
@@ -127943,7 +127956,7 @@ const EzViewStack$1 = class extends HTMLElement$1 {
|
|
|
127943
127956
|
/**
|
|
127944
127957
|
* Indetificador único do componente
|
|
127945
127958
|
*/
|
|
127946
|
-
this._dataKey = '
|
|
127959
|
+
this._dataKey = '';
|
|
127947
127960
|
}
|
|
127948
127961
|
/**
|
|
127949
127962
|
* Exibe a visão de acordo com o índice.
|
|
@@ -127983,6 +127996,7 @@ const EzViewStack$1 = class extends HTMLElement$1 {
|
|
|
127983
127996
|
}
|
|
127984
127997
|
}
|
|
127985
127998
|
componentWillRender() {
|
|
127999
|
+
this._dataKey = 'id_'.concat(JSUtils.generateUUID());
|
|
127986
128000
|
if (!this._elemList) {
|
|
127987
128001
|
this._elemList = [];
|
|
127988
128002
|
this._focusedIndex = 0;
|
|
@@ -133,9 +133,6 @@ const EzDialog = class {
|
|
|
133
133
|
getClassTitleLabel(message) {
|
|
134
134
|
return this.getIconElement(message) == undefined ? "title title__label title__label--no-icon" : "title title__label";
|
|
135
135
|
}
|
|
136
|
-
componentDidRender() {
|
|
137
|
-
this.manageOverlay();
|
|
138
|
-
}
|
|
139
136
|
componentWillRender() {
|
|
140
137
|
if (!this._currentMessage) {
|
|
141
138
|
if (this._messageQueue.length > 0) {
|
|
@@ -151,9 +148,17 @@ const EzDialog = class {
|
|
|
151
148
|
componentDidLoad() {
|
|
152
149
|
ElementIDUtils.addIDInfo(this._element);
|
|
153
150
|
}
|
|
151
|
+
componentDidRender() {
|
|
152
|
+
this.manageOverlay();
|
|
153
|
+
const dialog = this._element.shadowRoot.querySelector('.overlay .dialog');
|
|
154
|
+
if (dialog instanceof HTMLDivElement) {
|
|
155
|
+
dialog.style.outline = 'none';
|
|
156
|
+
dialog.focus();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
154
159
|
render() {
|
|
155
160
|
if (this.opened && this._currentMessage) {
|
|
156
|
-
return (h("div", { class: "overlay", ref: ref => this._overlayRef = ref }, h("div", { class: "dialog" }, this.getTypeIndicatorElement(this._currentMessage), h("div", { class: this.getClassContainer(this._currentMessage) }, h("div", { class: "title__container" }, h("div", { class: "title__box" }, this.getIconElement(this._currentMessage), h("div", { class: this.getClassTitleLabel(this._currentMessage), innerHTML: this._currentMessage.title, "data-element-id": ElementIDUtils.getInternalIDInfo("title") })), h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false), "data-element-id": ElementIDUtils.getInternalIDInfo("buttonClose") })), h("div", { class: "message", innerHTML: this._currentMessage.message, "data-element-id": ElementIDUtils.getInternalIDInfo("message") }), this._currentMessage.confirm &&
|
|
161
|
+
return (h("div", { class: "overlay", ref: ref => this._overlayRef = ref }, h("div", { tabindex: "-1", class: "dialog" }, this.getTypeIndicatorElement(this._currentMessage), h("div", { class: this.getClassContainer(this._currentMessage) }, h("div", { class: "title__container" }, h("div", { class: "title__box" }, this.getIconElement(this._currentMessage), h("div", { class: this.getClassTitleLabel(this._currentMessage), innerHTML: this._currentMessage.title, "data-element-id": ElementIDUtils.getInternalIDInfo("title") })), h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false), "data-element-id": ElementIDUtils.getInternalIDInfo("buttonClose") })), h("div", { class: "message", innerHTML: this._currentMessage.message, "data-element-id": ElementIDUtils.getInternalIDInfo("message") }), this._currentMessage.confirm &&
|
|
157
162
|
h("div", { class: "button-yes-no__container" }, h("ez-button", { class: "button__cancel", "data-element-id": ElementIDUtils.getInternalIDInfo("cancel"), label: this._currentMessage.labelCancel, onClick: () => this.handleButtonClick(false) }), h("ez-button", { class: !this._currentMessage.btnConfirmDanger ? "button__confirm" : "button__confirm--danger", "data-element-id": ElementIDUtils.getInternalIDInfo("confirm"), label: this._currentMessage.labelConfirm, onClick: () => this.handleButtonClick(true) })), !this._currentMessage.confirm &&
|
|
158
163
|
h("div", { class: "button__confirm--container" }, h("ez-button", { label: 'Ok', "data-element-id": ElementIDUtils.getInternalIDInfo("ok"), class: "button__confirm", onClick: () => this.handleButtonClick(true) }))))));
|
|
159
164
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-6fbf1820.js';
|
|
2
|
-
import { UserInterface, ElementIDUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { ObjectUtils, UserInterface, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { R as REQUIRED_INFO } from './constants-ca136201.js';
|
|
4
4
|
import { C as CheckMode } from './CheckMode-bdb2ec19.js';
|
|
5
5
|
|
|
@@ -41,9 +41,15 @@ const buildDateTime = ({ name, label, readOnly, contextName }) => {
|
|
|
41
41
|
h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name })));
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
const buildFile = ({ name, label, readOnly, contextName }) => {
|
|
44
|
+
const buildFile = ({ name, label, readOnly, contextName, props }) => {
|
|
45
|
+
const uploadProps = ObjectUtils.removeEmptyValues({
|
|
46
|
+
subTitle: props.subTitle,
|
|
47
|
+
requestHeaders: props.STORAGESTRATEGY ? {
|
|
48
|
+
STORAGESTRATEGY: props.STORAGESTRATEGY
|
|
49
|
+
} : null
|
|
50
|
+
});
|
|
45
51
|
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
46
|
-
h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name })));
|
|
52
|
+
h("ez-upload", Object.assign({ enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name }, uploadProps))));
|
|
47
53
|
};
|
|
48
54
|
|
|
49
55
|
const buildDecimal = ({ name, label, readOnly, props, contextName }) => {
|
|
@@ -133,7 +133,7 @@ const EzUpload = class {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
updateFilePointers() {
|
|
136
|
-
if (this.value) {
|
|
136
|
+
if (Array.isArray(this.value)) {
|
|
137
137
|
this.value.forEach(ezFile => this._filePointers.set(ezFile.name, ezFile));
|
|
138
138
|
}
|
|
139
139
|
}
|
|
@@ -340,6 +340,7 @@ const EzUpload = class {
|
|
|
340
340
|
if (this._host) {
|
|
341
341
|
ElementIDUtils.addIDInfo(this._host, 'input');
|
|
342
342
|
}
|
|
343
|
+
this.observeRequestHeaders();
|
|
343
344
|
}
|
|
344
345
|
componentWillRender() {
|
|
345
346
|
if (this.value) {
|
|
@@ -364,7 +365,8 @@ const EzUpload = class {
|
|
|
364
365
|
const fileName = item.name;
|
|
365
366
|
const progress = Number(item["progress"]);
|
|
366
367
|
const downloadURL = item["downloadURL"];
|
|
367
|
-
const
|
|
368
|
+
const size = item.size > 0 ? `(${this.formatBytes(item.size)})` : '';
|
|
369
|
+
const label = `${fileName} ${size}`;
|
|
368
370
|
return (h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() }, h("div", { class: "iu__item-label modificador" }, h("div", { title: label, class: "col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle" }, downloadURL ? h("a", { href: downloadURL, download: true }, label) : label)), isNaN(progress)
|
|
369
371
|
?
|
|
370
372
|
null
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement, H as Host } from './index-6fbf1820.js';
|
|
2
|
-
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { JSUtils, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
4
|
const ezViewStackCss = ":host{width:100%;height:100%}.ez-view-stack__container{width:100%;height:100%}";
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ const EzViewStack = class {
|
|
|
9
9
|
/**
|
|
10
10
|
* Indetificador único do componente
|
|
11
11
|
*/
|
|
12
|
-
this._dataKey = '
|
|
12
|
+
this._dataKey = '';
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Exibe a visão de acordo com o índice.
|
|
@@ -49,6 +49,7 @@ const EzViewStack = class {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
componentWillRender() {
|
|
52
|
+
this._dataKey = 'id_'.concat(JSUtils.generateUUID());
|
|
52
53
|
if (!this._elemList) {
|
|
53
54
|
this._elemList = [];
|
|
54
55
|
this._focusedIndex = 0;
|
package/dist/ezui/ezui.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-bfc7b8ca.js";export{s as setNonce}from"./p-bfc7b8ca.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-2756003d",[[1,"ez-guide-navigator",{open:[1540],selectedId:[1537,"selected-id"],items:[16],tooltipResolver:[16],filterText:[32],disableItem:[64],enableItem:[64],updateItem:[64],getItem:[64],getCurrentPath:[64],selectGuide:[64],getParent:[64]}]]],["p-370ad5c9",[[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-b01e05a1",[[1,"ez-breadcrumb",{items:[1040],fillMode:[1025,"fill-mode"],maxItems:[1026,"max-items"],positionEllipsis:[1026,"position-ellipsis"],visibleItems:[32],hiddenItems:[32],showDropdown:[32],collapseConfigPosition:[32]}]]],["p-
|
|
1
|
+
import{p as e,b as o}from"./p-bfc7b8ca.js";export{s as setNonce}from"./p-bfc7b8ca.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-2756003d",[[1,"ez-guide-navigator",{open:[1540],selectedId:[1537,"selected-id"],items:[16],tooltipResolver:[16],filterText:[32],disableItem:[64],enableItem:[64],updateItem:[64],getItem:[64],getCurrentPath:[64],selectGuide:[64],getParent:[64]}]]],["p-370ad5c9",[[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-b01e05a1",[[1,"ez-breadcrumb",{items:[1040],fillMode:[1025,"fill-mode"],maxItems:[1026,"max-items"],positionEllipsis:[1026,"position-ellipsis"],visibleItems:[32],hiddenItems:[32],showDropdown:[32],collapseConfigPosition:[32]}]]],["p-816a3218",[[1,"ez-dialog",{confirm:[1028],dialogType:[1025,"dialog-type"],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],beforeClose:[1040],show:[64]}]]],["p-3a41181c",[[6,"ez-grid",{multipleSelection:[4,"multiple-selection"],config:[1040],serverUrl:[1,"server-url"],dataUnit:[16],statusResolver:[16],_paginationInfo:[32],_paginationChangedByKeyboard:[32],_showSelectionCounter:[32],_isAllSelection:[32],_currentPageSelected:[32],_selectionCount:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64],quickFilter:[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-f71f0aa2",[[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-997b2df9",[[1,"ez-alert",{alertType:[513,"alert-type"]}]]],["p-6adf3791",[[1,"ez-badge",{size:[513],label:[513],iconLeft:[513,"icon-left"],iconRight:[513,"icon-right"],position:[1040],hasSlot:[32]}]]],["p-d892dc4f",[[1,"ez-chip",{label:[513],enabled:[516],removePosition:[513,"remove-position"],mode:[513],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-2f80d68c",[[1,"ez-file-item",{canRemove:[4,"can-remove"],fileName:[1,"file-name"],iconName:[1,"icon-name"],fileSize:[2,"file-size"],progress:[2]}]]],["p-11431283",[[1,"ez-list",{dataSource:[1040],listMode:[1,"list-mode"],useGroups:[1540,"use-groups"],ezDraggable:[1028,"ez-draggable"],ezSelectable:[1028,"ez-selectable"],itemSlotBuilder:[1040],hoverFeedback:[1028,"hover-feedback"],_listItems:[32],_listGroupItems:[32],clearHistory:[64],scrollToTop:[64],setSelection:[64],getSelection:[64],getList:[64]}]]],["p-e8e7ec07",[[0,"ez-application"]]],["p-848bc350",[[1,"ez-card-item",{item:[16]}]]],["p-1ac06223",[[1,"ez-loading-bar",{_showLoading:[32],hide:[64],show:[64]}]]],["p-a7892495",[[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],heightMode:[1,"height-mode"],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}]]],["p-62ebbd06",[[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"],overlayType:[513,"overlay-type"],updatePosition:[64],show:[64],hide:[64]}]]],["p-04a52868",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[516,"use-header"],heightMode:[513,"height-mode"],ezTitle:[1,"ez-title"]}]]],["p-6e453307",[[1,"ez-radio-button",{value:[1544],options:[1040],enabled:[516],label:[513],direction:[1537]}]]],["p-672c1fba",[[0,"ez-skeleton",{count:[2],variant:[1],width:[1],height:[1],marginBottom:[1,"margin-bottom"],animation:[1]}]]],["p-0c2187a1",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-6d794472",[[0,"ez-view-stack",{show:[64],getSelectedIndex:[64]}]]],["p-41e82662",[[1,"ez-dropdown",{items:[1040],value:[1040],itemBuilder:[16]}]]],["p-fc71f135",[[1,"ez-tabselector",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1],_processedTabs:[32]}]]],["p-c00e734a",[[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-805ee4c2",[[1,"ez-collapsible-box",{value:[1540],label:[513],subtitle:[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-5d8d9a2e",[[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-15e29287",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-751aa882",[[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-ff4141d8",[[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-a9f0f910",[[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-6f11ddf8",[[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-439168e8",[[1,"ez-upload",{label:[1],subtitle:[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-22b106d7",[[1,"ez-text-edit",{value:[1],styled:[16],_newValue:[32],applyFocusSelect:[64]}]]],["p-39d2dc1b",[[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-c99bca75",[[1,"ez-check",{label:[513],value:[1540],enabled:[1540],indeterminate:[1540],mode:[513],getMode:[64],setFocus:[64]}]]],["p-9a58e143",[[2,"ez-form-view",{fields:[16],showUp:[64]}]]],["p-4ebb1d15",[[1,"ez-filter-input",{label:[1],value:[1537],enabled:[4],errorMessage:[1537,"error-message"],restrict:[1],mode:[513],asyncSearch:[516,"async-search"],canShowError:[516,"can-show-error"],setFocus:[64],setBlur:[64],isInvalid:[64],setValue:[64],endSearch:[64]}],[1,"ez-tree",{items:[1040],value:[1040],selectedId:[1537,"selected-id"],iconResolver:[16],tooltipResolver:[16],_tree:[32],_waintingForLoad:[32],selectItem:[64],openItem:[64],disableItem:[64],enableItem:[64],addChild:[64],applyFilter:[64],updateItem:[64],getItem:[64],getCurrentPath:[64],getParent:[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{direction:[1],locked:[4],activeShadow:[4,"active-shadow"],isActive:[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["p-994c4934",[[1,"ez-calendar",{value:[1040],floating:[516],time:[516],showSeconds:[516,"show-seconds"],show:[64],fitVertical:[64],hide:[64]}]]],["p-1a902d0e",[[1,"ez-icon",{size:[513],href:[513],iconName:[513,"icon-name"]}]]],["p-9a9cca48",[[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],iconName:[513,"icon-name"],size:[513],setFocus:[64],setBlur:[64]},[[2,"click","clickListener"]]]]],["p-18d7de85",[[2,"ez-form",{dataUnit:[1040],config:[16],recordsValidator:[16],validate:[64]}]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as t,f as e,h as o,g as a}from"./p-bfc7b8ca.js";import{A as s}from"./p-41ce6f98.js";import{ElementIDUtils as d}from"@sankhyalabs/core";import"./p-ab574d59.js";class r{constructor(i){this.file=i,this.size=i.size,this.name=i.name}abortUpload(){this._uploadingXhr&&(this._aborted=!0,this._uploadingXhr.abort(),this._uploadingXhr=void 0)}isUploading(){return void 0!==this._uploadingXhr}async upload(i,t,e){return new Promise(((o,a)=>{const s=new XMLHttpRequest;this._uploadingXhr=s,this._aborted=!1,this.progress=0,s.upload.onprogress=i=>{const t=i.loaded,o=i.total;this.progress=~~(t/o*100),e(this,t,o)},s.onreadystatechange=()=>{if(4==s.readyState){this._uploadingXhr=void 0;const i=s.status;this._aborted||(0===i?a("Servidor indisponível"):i>=500?a("Erro inesperado no servidor"):i>=400&&a("Operação não permitida"));const t=s.response;if(t)try{o(JSON.parse(t))}catch(i){a(`Servidor não retornou um objeto válido: ${t}.\n${i}`)}}},s.ontimeout=()=>{a("Tempo limite de transferência atingido.")};const d=new FormData;d.append("ARQUIVO",this.file,this.file.name),s.open("POST",i,!0),t&&t.forEach(((i,t)=>s.setRequestHeader(t,i))),s.send(d)}))}async delete(i,t,e){return new Promise(((o,a)=>{const s=new XMLHttpRequest;s.onreadystatechange=()=>{4==s.readyState&&(0===s.status?a("Servidor indisponível"):s.status>=500?a("Erro inesperado no servidor"):s.status>=400&&a("Operação não permitida"),o(!0))},s.ontimeout=()=>{a("Tempo limite de remoção atingido.")},s.open("DELETE",t,!0),e&&e.forEach(((i,t)=>s.setRequestHeader(t,i))),s.send(JSON.stringify(i))}))}}const l=class{constructor(e){i(this,e),this.ezChange=t(this,"ezChange",7),this.ezStartChange=t(this,"ezStartChange",7),this.ezCancelWaitingChange=t(this,"ezCancelWaitingChange",7),this._filePointers=new Map,this.label=void 0,this.subtitle=void 0,this.enabled=!0,this.maxFileSize=void 0,this.maxFiles=void 0,this.requestHeaders=void 0,this.urlUpload=void 0,this.urlDelete=void 0,this.value=void 0}observeValue(i,t){(i!==this._updatingValue||null==i&&null!=t)&&(this._filePointers.forEach((i=>{this.isRemoteFile(i)&&i.abortUpload()})),this._filePointers=new Map,this.updateFilePointers(),this._updatingValue=void 0)}updateFilePointers(){Array.isArray(this.value)&&this.value.forEach((i=>this._filePointers.set(i.name,i)))}observeRequestHeaders(){if(this._requestHeaders=new Map,"string"==typeof this.requestHeaders)try{this.requestHeaders=JSON.parse(this.requestHeaders)}catch(i){this.requestHeaders=void 0}for(var i in this.requestHeaders)this._requestHeaders.set(i,this.requestHeaders[i])}async addFiles(i){if(this.maxFiles>0){let t=this._filePointers.size;if(i.forEach((i=>{this._filePointers.has(i.name)||t++})),t>this.maxFiles)return void this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`)}Array.prototype.forEach.call(i,this.addFile.bind(this))}async setFocus(){this._fileInput.focus()}async setBlur(){this._fileInput.blur()}async addFile(i){const t=this._filePointers.get(i.name);t?s.confirm("Substituir arquivo",`Já existe um arquivo chamado "${i.name}". Deseja substituí-lo?`).then((e=>{e&&(this.isRemoteFile(t)&&t.abortUpload(),this.doAddFile(i))})):this.doAddFile(i)}async doAddFile(i){try{if(this.validateFile(i)){this.ezStartChange.emit({waitmessage:"Há arquivos sendo enviados. Por favor aguarde a conclusão ou cancele o envio.",blocking:!0});const t=new r(i),o=this._filePointers.get(i.name);o&&this.isRemoteFile(o)&&o.abortUpload(),this._filePointers.set(i.name,t),t.upload(this.urlUpload,this._requestHeaders,(i=>this.updateFeedback(i))).then((i=>i.forEach((i=>this.finishUpload(t.name,i))))).catch((i=>{this.ezCancelWaitingChange.emit(),this.showError(i)})),e(this)}}catch(i){throw this.ezCancelWaitingChange.emit(),i}}finishUpload(i,t){this._filePointers.set(i,t),this.updateValue()}updateValue(){this._updatingValue=[],this._filePointers.forEach((i=>{this.isRemoteFile(i)||this._updatingValue.push(i)})),this._filePointers.size===this._updatingValue.length&&(this.value=this._updatingValue,this.ezChange.emit(this.value))}buildProgressId(i){return`PROGRESS_${i.name.replace(/[^a-z0-9_]/gi,"_")}_${i.file.lastModified}`}updateFeedback(i){window.requestAnimationFrame((()=>{if(this._host){const t=this._host.shadowRoot.querySelector("#"+this.buildProgressId(i));t&&(t.value=i.progress)}}))}validateFile(i){return!this._filePointers.has(i.name)&&this.maxFiles>0&&this._filePointers.size>=this.maxFiles?(this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`),!1):0===i.size?(this.showError(`Erro de permissão: O arquivo "${i.name}" não pode ser enviado.`),!1):this.urlUpload?!(this.maxFileSize>=0&&i.size>this.maxFileSize&&(this.showError("O tamanho máximo dos arquivos é de "+this.formatBytes(this.maxFileSize)),1)):(this.showError("Endereço de upload não informado"),!1)}showError(i){s.alert("Enviando arquivo",i)}formatBytes(i,t=1){if(0===i)return"0 Bytes";const e=t<0?0:t,o=Math.floor(Math.log(i)/Math.log(1024));return parseFloat((i/Math.pow(1024,o)).toFixed(e))+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][o]}onFileInputChange(i){this.addFiles(Array.from(i.target.files)),this._fileInput.value=""}isRemoteFile(i){return"file"in i}removeFromList(i){this._filePointers.delete(i),this.updateValue()}removeFile(i){const t=this._filePointers.get(i);if(this.isRemoteFile(t))t.abortUpload(),this.removeFromList(i);else if(this.urlDelete){const e=new r(null);this._filePointers.set(t.name,e),e.delete(t,this.urlDelete,null).then((()=>this.removeFromList(i))).catch((i=>this.showError(i)))}else this.removeFromList(i)}openFilesDialog(){this.enabled&&this._fileInput.click()}componentDidLoad(){this.enabled&&this._dropZone&&window.FileList&&window.File&&(this._dropZone.addEventListener("dragover",(i=>{i.stopPropagation(),i.preventDefault(),i.dataTransfer.dropEffect="copy",this._dropZone.style.background="#c2dbff"})),this._dropZone.addEventListener("drop",(i=>{i.stopPropagation(),i.preventDefault(),this.addFiles(Array.from(i.dataTransfer.files)),this._dropZone.style.background=""})),this._dropZone.addEventListener("dragleave",(()=>{this._dropZone.style.background=""}))),this._host&&d.addIDInfo(this._host,"input"),this.observeRequestHeaders()}componentWillRender(){this.value&&this._filePointers.size<this.value.length&&this.updateFilePointers()}render(){return o("div",{ref:i=>this._dropZone=i,class:this.evalDisabledClass("iu","background--disabled")},o("div",{class:"iu__container",onClick:()=>this.openFilesDialog()},o("div",{class:"iu_header"},this.label?o("label",{class:this.evalDisabledClass("iu__label","text--disabled"),title:this.label},this.label):null,o("div",{class:"padding-large"},o("div",{class:this.evalDisabledClass("iu__icon-label","mouse-pointer--disabled")},o("button",{class:"iu__file-icon",disabled:!this.enabled}),o("div",{class:this.evalDisabledClass("text text--center text--medium text--primary","text--disabled")},this.enabled?"Arraste e solte ou clique para adicionar arquivos":"Somente leitura")),this.subtitle&&o("div",{class:this.evalDisabledClass("padding-extra-small text text--center text--small text--secondary","text--disabled")},this.subtitle))),this.buildFooter()),o("input",{ref:i=>this._fileInput=i,onChange:i=>this.onFileInputChange(i),type:"file",multiple:!0,class:"appearanceNone"}))}buildFooter(){if(0===this._filePointers.size)return null;const i=[];return this._filePointers.forEach((t=>i.push(this.buildFileItem(t)))),o("div",{class:"iu__footer"},i)}buildFileItem(i){const t=i.name,e=Number(i.progress),a=i.downloadURL,s=i.size>0?`(${this.formatBytes(i.size)})`:"",d=`${t} ${s}`;return o("div",{class:"iu__item",key:t,onClick:i=>i.stopPropagation()},o("div",{class:"iu__item-label modificador"},o("div",{title:d,class:"col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle"},a?o("a",{href:a,download:!0},d):d)),isNaN(e)?null:o("div",{class:"col col--sd-4 col--stretch align--middle"},o("progress",{id:this.buildProgressId(i),value:e,max:"100"})),this.enabled?o("div",{class:"col col--stretch align--middle"},o("button",{class:"btn-cancel ",onClick:()=>this.removeFile(t)})):null)}evalDisabledClass(i,t){return this.enabled?i:`${i} ${t}`}get _host(){return a(this)}static get watchers(){return{value:["observeValue"],requestHeaders:["observeRequestHeaders"]}}};l.style=':host{--ez-upload--height:42px;--ez-upload--width:100%;--ez-upload__icon--width:48px;--ez-upload__container--background-color:var(--background--medium, #d2dce9);--ez-upload__color--primary:var(--color--primary, #008561);--ez-upload--padding--extra-small:var(--space--extra-small, 3px);--ez-upload--padding--small:var(--space--small, 6px);--ez-upload--padding--medium:var(--space--medium, 12px);--ez-upload--padding--large:var(--space--large, 24px);--ez-upload__border--color:var(--color-strokes, #DCE0E8);--ez-upload--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-upload--text--primary:var(--text-primary, #626e82);--ez-upload--text--secondary:var(--text-secondary, #a2abb9);--ez-upload--font-size:var(--text--medium, 14px);--ez-upload--font-family:var(--font-pattern, Arial);--ez-upload--font-weight:var(--text-weight--large, 500);--ez-upload__btn__cancel-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="8x" width="8px"><path d="M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z"/></svg>\');--ez-upload__file-icon-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="11x" width="9px"><path d="M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z"/></svg>\');display:flex;flex-wrap:wrap;position:relative;padding-bottom:16px;font-family:var(--ez-upload--font-family);font-size:var(--ez-upload--font-size);width:var(--ez-upload--width);font-weight:var(--ez-upload--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:var(--ez-upload--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--ez-upload--padding--medium) var(--ez-upload--padding--medium) var(--ez-upload--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--ez-upload--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--ez-upload__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--ez-upload__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.padding-large{padding:var(--ez-upload--padding--large) 0px}.padding-extra-small{padding:var(--ez-upload--padding--extra-small) 0px}.text{font-family:var(--font-pattern, "Roboto");text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.text--secondary{color:var(--ez-upload--text--secondary);text-shadow:var(--ez-upload--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--ez-upload__btn__cancel-image);mask-image:var(--ez-upload__btn__cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-upload--font-family);font-size:var(--text--extra-small);font-weight:var(--ez-upload--font-weight);color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:\'\';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--ez-upload__file-icon-image);mask-image:var(--ez-upload__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:unset}.appearanceNone{width:0px;height:0px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{l as ez_upload}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as i,g as s,H as e}from"./p-bfc7b8ca.js";import{JSUtils as h,ElementIDUtils as o}from"@sankhyalabs/core";const c=class{constructor(i){t(this,i),this._dataKey=""}async show(t){t!==this._focusedIndex&&0<=t&&t<this._totalStackItems&&(this.policyHideRemove(),this.policyShowAppend(t),this._focusedIndex=t)}async getSelectedIndex(){return this._focusedIndex}policyHideRemove(){let t=this._hostElem.querySelector(`#${this._dataKey}_el_${this._focusedIndex}`);this.checkElementVisibility(t)}policyShowAppend(t){let i=this._hostElem.querySelector(`#${this._dataKey}_el_${t}`);i?i.removeAttribute("style"):this._hostElem.append(this._elemList[t])}checkElementVisibility(t){"hide"!==t.getAttribute("hidePolicy")&&t.getAttribute("hidePolicy")?"remove"===t.getAttribute("hidePolicy")&&t.remove():t.setAttribute("style","display: none")}componentWillRender(){this._dataKey="id_".concat(h.generateUUID()),this._elemList||(this._elemList=[],this._focusedIndex=0,this._totalStackItems=0,this._hostElem.classList.add("ez-view-stack__container"),this._hostElem.querySelectorAll(":scope > stack-item").forEach(((t,i)=>{t.setAttribute("id",`${this._dataKey}_el_${i}`),0!==i&&this.checkElementVisibility(t),this._totalStackItems++,this._elemList.push(t)})))}componentDidLoad(){o.addIDInfo(this._hostElem)}disconectCallback(){this._hostElem=null,this._elemList=null}render(){return i(e,null)}get _hostElem(){return s(this)}};c.style=":host{width:100%;height:100%}.ez-view-stack__container{width:100%;height:100%}";export{c as ez_view_stack}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as t,f as o,h as a,g as e}from"./p-bfc7b8ca.js";import{D as l}from"./p-ab574d59.js";import{FloatingManager as d,ElementIDUtils as r}from"@sankhyalabs/core";class n{constructor(i,t,o,a,e,l,d,r,n,c){this.title=i,this.message=t,this.dialogType=o,this.confirm=a,this.icon=e,this.labelCancel=l,this.labelConfirm=d,this.btnConfirmDanger=r,this.callBack=n,this.beforeClose=c}}const c=class{constructor(o){i(this,o),this.ezCancel=t(this,"ezCancel",7),this.ezAccept=t(this,"ezAccept",7),this.labelConfirm="Sim",this.labelCancel="Não",this.btnConfirmDanger=!1,this._messageQueue=[],this._bodyOverflow="",this.confirm=!1,this.dialogType=void 0,this.message=void 0,this.opened=!1,this.personalizedIconPath=void 0,this.ezTitle=void 0,this.beforeClose=void 0}observeConfig(){this.manageOverflow()}manageOverflow(){this.opened&&(this._bodyOverflow=window.document.body.style.overflow),window.document.body.style.overflow=this.opened?"hidden":this._bodyOverflow}manageOverlay(){this.opened?this._overlayId=d.subscribeOverlayControl(this._overlayRef):d.unsubscribeOverlayControl(this._overlayRef||this._overlayId)}handleButtonClick(i){this._currentMessage.beforeClose&&!1===this._currentMessage.beforeClose(i)||(this.opened=this._messageQueue.length>0,this._currentMessage.callBack&&this._currentMessage.callBack(i),i?this.ezAccept.emit(i):this.ezCancel.emit(i),this._currentMessage=this._messageQueue.shift(),o(this))}async show(i,t,o,a,e,l,d,r,c){return this.opened=!0,new Promise((s=>{this._messageQueue.push(new n(i,t,o,a,e,l,d,r,s,c))}))}isCritical(i){return i===l.CRITICAL}getIconElement(i){if(i.dialogType!==l.DEFAULT)return a("ez-icon",{class:"changeable__icon "+this.getIconClass(i.dialogType),size:"small",iconName:this.getIconName(i)})}getIconClass(i){return this.isCritical(i)?"title-icon--critical":i===l.SUCCESS?"title-icon--success":i===l.WARN?"title-icon--warn":""}getIconName(i){return i.icon?i.icon:this.isCritical(i.dialogType)?"alert-circle-inverted":i.dialogType===l.WARN?"warning-outline":i.dialogType===l.SUCCESS?"check":void 0}getTypeIndicatorElement(i){if(i.dialogType!==l.DEFAULT)return a("div",{class:this.getClassIconIndicator(i.dialogType)})}getClassIconIndicator(i){return this.isCritical(i)?"dialog__critical--indicator":i==l.SUCCESS?"dialog__success--indicator":i==l.WARN?"dialog__warning--indicator":""}getClassContainer(i){return(i.dialogType||l.DEFAULT)===l.DEFAULT?"dialog__container dialog__container--default":"dialog__container"}getClassTitleLabel(i){return null==this.getIconElement(i)?"title title__label title__label--no-icon":"title title__label"}componentWillRender(){this._currentMessage||(this._messageQueue.length>0?this._currentMessage=this._messageQueue.pop():this.opened&&(this._currentMessage=new n(this.ezTitle,this.message,this.dialogType,this.confirm,this.personalizedIconPath,this.labelCancel,this.labelConfirm,this.btnConfirmDanger,null,this.beforeClose)))}componentDidLoad(){r.addIDInfo(this._element)}componentDidRender(){this.manageOverlay();const i=this._element.shadowRoot.querySelector(".overlay .dialog");i instanceof HTMLDivElement&&(i.style.outline="none",i.focus())}render(){return this.opened&&this._currentMessage?a("div",{class:"overlay",ref:i=>this._overlayRef=i},a("div",{tabindex:"-1",class:"dialog"},this.getTypeIndicatorElement(this._currentMessage),a("div",{class:this.getClassContainer(this._currentMessage)},a("div",{class:"title__container"},a("div",{class:"title__box"},this.getIconElement(this._currentMessage),a("div",{class:this.getClassTitleLabel(this._currentMessage),innerHTML:this._currentMessage.title,"data-element-id":r.getInternalIDInfo("title")})),a("button",{class:"btn-close",onClick:()=>this.handleButtonClick(!1),"data-element-id":r.getInternalIDInfo("buttonClose")})),a("div",{class:"message",innerHTML:this._currentMessage.message,"data-element-id":r.getInternalIDInfo("message")}),this._currentMessage.confirm&&a("div",{class:"button-yes-no__container"},a("ez-button",{class:"button__cancel","data-element-id":r.getInternalIDInfo("cancel"),label:this._currentMessage.labelCancel,onClick:()=>this.handleButtonClick(!1)}),a("ez-button",{class:this._currentMessage.btnConfirmDanger?"button__confirm--danger":"button__confirm","data-element-id":r.getInternalIDInfo("confirm"),label:this._currentMessage.labelConfirm,onClick:()=>this.handleButtonClick(!0)})),!this._currentMessage.confirm&&a("div",{class:"button__confirm--container"},a("ez-button",{label:"Ok","data-element-id":r.getInternalIDInfo("ok"),class:"button__confirm",onClick:()=>this.handleButtonClick(!0)}))))):null}get _element(){return e(this)}static get watchers(){return{opened:["observeConfig"]}}};c.style=':host{--dialog__container-padding:var(--space--large, 24px);--dialog__btn__close--background-color:var(--title--primary, #2b3a54);--dialog__btn__no--padding-right:var(--space--large, 24px);--dialog__btn__close__image:url(\'data:image/svg+xml;utf8,<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg%22%3E<path d="M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z"/></svg>\');--dialog__title--font-pattern:var(--font-pattern, "Roboto");--dialog__title--padding-left:var(--space--small, 6px);--dialog__title__container--padding-bottom:var(--space--medium, 12px);--dialog__title--weight--large:var(--text-weight--large, 600);--dialog__body--font-pattern:var(--font-pattern, "Roboto");--dialog__body--text-shadow:var(--text-shadow, "0 0 0 #353535, 0 0 1px transparent");--dialog__body--text-weight--medium:var(--text-weight--medium, 400);--dialog__body--padding-bottom:var(--space--large, 24px);--dialog__body--font-size:var(--text--medium, 14px);--dialog__body--color:var(--text--primary, #626e82);--dialog__icon--color:var(--text--inverted, #fff);--dialog__critical--background-color:var(--color--alert-error-800, #BD0025);--dialog__warning--background-color:var(--color--alert-warning-500, #EFB103);--dialog__success--background-color:var(--color--alert-success-500, #00523c);--dialog-z-index:var(--most-visible, 3);--dialog--warning__image:url(\'data: image/svg+xml;utf8,<svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><path d="M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895"/></svg>\');--dialog--critical__image:url(\'data: image/svg+xml;utf8,<svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg"><path d="M 7.6534493,6.4948538 12.762051,1.3864299 C 12.914368,1.2341297 13,1.027552 13,0.81215179 13,0.59676225 12.914369,0.39018443 12.762051,0.23787352 12.609733,0.08557341 12.40318,0 12.187747,0 11.972425,0 11.765762,0.08557341 11.613445,0.23787352 L 6.5048431,5.3462975 1.3961977,0.23787352 C 1.2438802,0.08557341 1.0373043,0 0.82189458,0 0.60649572,0 0.39990901,0.08557341 0.24759147,0.23787352 0.09527396,0.39018443 0.00970766,0.59676225 0.00970766,0.81215179 c 0,0.21540021 0.0855663,0.42197791 0.23788381,0.57427811 L 5.3562369,6.4948538 0.24759147,11.604381 c -0.0775121,0.07492 -0.13931586,0.164543 -0.18182835,0.263595 -0.04250169,0.09905 -0.064850182,0.205678 -0.0657357237,0.313391 -8.8554258e-4,0.107813 0.0197049337,0.214771 0.0605827337,0.314472 0.04086693,0.0998 0.10119858,0.190415 0.17746563,0.266625 0.0762779,0.07622 0.16695386,0.136398 0.26675594,0.177208 0.099802,0.04082 0.20672745,0.06127 0.31452961,0.06029 0.1078025,-9.53e-4 0.21433799,-0.0235 0.31337139,-0.06604 0.099045,-0.04265 0.1886052,-0.104571 0.263465,-0.182081 L 6.5048431,7.6434102 11.613445,12.751855 c 0.152317,0.152312 0.35898,0.237831 0.574302,0.237831 0.215433,0 0.421986,-0.08552 0.574304,-0.237831 C 12.914368,12.599545 13,12.393 13,12.177578 13,11.962157 12.91437,11.75561 12.762051,11.603299 Z"/></svg>\')}h2{margin-block-start:0;margin-block-end:0;margin-inline-start:0px;margin-inline-end:0px}.overlay{position:fixed;display:flex;top:0px;z-index:var(--dialog-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.dialog{display:flex;width:80%;position:absolute;top:50%;left:50%;margin-right:-50%;box-sizing:border-box;transform:translate(-50%, -50%);box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122)}@media screen and (min-width: 768px){.dialog{width:50%}}@media screen and (min-width: 992px){.dialog{width:33.33333%}}.dialog__container{width:100%;background:#FFFF;border-radius:0px 6px 6px 0px;box-sizing:border-box;padding:var(--dialog__container-padding)}.dialog__container--default{border-radius:6px 6px 6px 6px}.dialog__critical--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--dialog__critical--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__warning--background-color)}.dialog__success--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__success--background-color)}.message{font-size:var(--dialog__body--font-size);font-weight:var(--dialog__body--text-weight--medium);font-family:var(--dialog__body--font-pattern);text-shadow:var(--dialog__body--text-shadow);padding-bottom:var(--dialog__body--padding-bottom);color:var(--dialog__body--color);max-height:30vh;content-visibility:auto;margin-bottom:24px;overflow-y:auto}.changeable__icon{background:var(--dialog__warning--background-color);--ez-icon--color:var(--dialog__icon--color);display:grid;place-items:center;width:26px;height:26px;border-radius:50%}.changeable__icon.critical{background:var(--dialog__critical--background-color)}.title{display:flex;font-family:var(--dialog__title--font-pattern);margin:0;font-weight:var(--dialog__title--weight--large);line-height:0}.title__container{display:flex;padding-bottom:var(--dialog__title__container--padding-bottom)}.title__box{display:flex;width:100%;align-items:center;align-self:center}.title__label{padding-left:var(--dialog__title--padding-left)}.title__label--no-icon{padding-left:0}.title-icon--critical{background-color:var(--dialog__critical--background-color)}.title-icon--success{background-color:var(--dialog__success--background-color)}.title-icon--warn{background-color:var(--dialog__warning--background-color)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:\'\';display:flex;background-color:var(--dialog__btn__close--background-color);width:12px;height:12px;-webkit-mask-image:var(--dialog__btn__close__image);mask-image:var(--dialog__btn__close__image)}.title-icon::after{content:\'\';display:flex;background-color:#FFFF;width:15px;height:15px;-webkit-mask-image:var(--dialog--warning__image);mask-image:var(--dialog--warning__image)}.button-yes-no__container{display:flex;box-sizing:border-box;align-self:center;align-items:center;justify-content:flex-end}.button__cancel{padding-right:var(--dialog__btn__no--padding-right)}.button__confirm{--ez-button--background-color:var(--color--primary);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color--primary-600);--ez-button--hover-color:var(--color--inverted)}.button__confirm--danger{--ez-button--background-color:var(--color--alert-error-800, #BD0025);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color-alert--error-900, #a10020);--ez-button--hover-color:var(--color--inverted)}.button__confirm--container{display:flex;justify-content:flex-end}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{c as ez_dialog}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,r as a,c as l,H as t,g as n}from"./p-bfc7b8ca.js";import{ObjectUtils as o,UserInterface as d,ElementIDUtils as s}from"@sankhyalabs/core";import{R as i}from"./p-3f4ae3a3.js";import{C as r}from"./p-b853763b.js";function c(a,l,t,n,o){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:!t,label:l,mode:o?r.SWITCH:r.REGULAR,"data-field-name":a,"data-context-name":n,key:a}))}function m(a,l,t,n,o,d){return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-number-input",{enabled:!t,label:l,precision:n,prettyPrecision:o,"data-field-name":a,"data-context-name":d,key:a}))}const z=({name:a,label:l,readOnly:t,contextName:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-text-input",{label:l,"data-field-name":a,"data-context-name":n,key:a,enabled:!t})),b=new Map;b.set(d.CHECKBOX,(e=>c(e.name,e.label,e.readOnly,e.contextName,!1))),b.set(d.SWITCH,(e=>c(e.name,e.label,e.readOnly,e.contextName,!0))),b.set(d.OPTIONSELECTOR,(({name:a,label:l,readOnly:t,required:n,props:o,contextName:d})=>{const s=null==o?void 0:o.options;let i;if("string"==typeof s){const e=JSON.parse(s);i=Object.keys(e).map((a=>({value:a,label:e[a]})))}else i=s;return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-combo-box",{enabled:!t,suppressEmptyOption:n,label:l,"data-field-name":a,"data-context-name":d,key:a,options:i}))})),b.set(d.DATE,(({name:a,label:l,readOnly:t})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-input",{enabled:!t,label:l,"data-field-name":a,key:a})))),b.set(d.TIME,(({name:a,label:l,readOnly:t})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-time-input",{enabled:!t,label:l,"data-field-name":a,key:a})))),b.set(d.DATETIME,(({name:a,label:l,readOnly:t,contextName:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-time-input",{enabled:!t,label:l,"data-field-name":a,"data-context-name":n,key:a})))),b.set(d.FILE,(({name:a,label:l,readOnly:t,contextName:n,props:d})=>{const s=o.removeEmptyValues({subTitle:d.subTitle,requestHeaders:d.STORAGESTRATEGY?{STORAGESTRATEGY:d.STORAGESTRATEGY}:null});return e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-upload",Object.assign({enabled:!t,label:l,"data-field-name":a,"data-context-name":n,key:a},s)))})),b.set(d.DECIMALNUMBER,(({name:e,label:a,readOnly:l,props:t,contextName:n})=>{const o=Number((null==t?void 0:t.precision)||2);return m(e,a,l,o,Number((null==t?void 0:t.prettyPrecision)||o),n)})),b.set(d.INTEGERNUMBER,(({name:e,label:a,readOnly:l,contextName:t})=>m(e,a,l,0,0,t))),b.set(d.SEARCH,(({name:a,label:l,readOnly:t,required:n,contextName:o})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-search",{enabled:!t,suppressEmptyOption:n,label:l,"data-field-name":a,"data-context-name":o,key:a})))),b.set(d.LONGTEXT,(({name:a,label:l,readOnly:t,contextName:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small",key:a},e("ez-text-area",{enabled:!t,label:l,"data-field-name":a,"data-context-name":n}))));const p=e=>{const a=b.get(e.userInterface)||z,l=e.required?`${e.label}${i}`:e.label;return a(Object.assign(Object.assign({},e),{label:l}))},u=class{constructor(e){a(this,e),this.ezContentReady=l(this,"ezContentReady",7),this.fields=void 0}async showUp(){this._element.scrollIntoView({behavior:"smooth",block:"start"})}groupFields(e){const a=new Map;return e.forEach((e=>{const l=e.group;if(l){let t=a.get(l);null==t&&(t=[],a.set(l,t)),t.push(e)}else a.set(e.name,e)})),a}componentDidRender(){this.ezContentReady.emit(Array.from(this._element.querySelectorAll("[data-field-name]")))}render(){if(s.addIDInfoIfNotExists(this._element,"ezFormView"),null!=this.fields)return e(t,null,Array.from(this.groupFields(this.fields).entries()).map((([a,l])=>Array.isArray(l)?e("ez-collapsible-box",{id:`group-${a}`,label:a,"header-size":"large",key:a},l.map((e=>p(e)))):p(l))))}get _element(){return n(this)}};u.style=".sc-ez-form-view-h{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}";export{u as ez_form_view}
|
|
@@ -14,6 +14,7 @@ declare class Message {
|
|
|
14
14
|
constructor(title: string, message: string, dialogType: DialogType, confirm: boolean, icon: string, labelCancel: string, labelConfirm: string, btnConfirmDanger: boolean, callBack: Function, beforeClose: Function);
|
|
15
15
|
}
|
|
16
16
|
export declare class EzDialog {
|
|
17
|
+
_element: HTMLElement;
|
|
17
18
|
private labelConfirm;
|
|
18
19
|
private labelCancel;
|
|
19
20
|
private btnConfirmDanger;
|
|
@@ -22,7 +23,6 @@ export declare class EzDialog {
|
|
|
22
23
|
private _bodyOverflow;
|
|
23
24
|
private _overlayRef;
|
|
24
25
|
private _overlayId;
|
|
25
|
-
private _element;
|
|
26
26
|
/**
|
|
27
27
|
* Define se o ez-dialog será utilizado no modo de confirmação.
|
|
28
28
|
*/
|
|
@@ -75,9 +75,9 @@ export declare class EzDialog {
|
|
|
75
75
|
getClassIconIndicator(dialogType: DialogType): string;
|
|
76
76
|
getClassContainer(message: Message): "dialog__container dialog__container--default" | "dialog__container";
|
|
77
77
|
getClassTitleLabel(message: Message): "title title__label title__label--no-icon" | "title title__label";
|
|
78
|
-
componentDidRender(): void;
|
|
79
78
|
componentWillRender(): void;
|
|
80
79
|
componentDidLoad(): void;
|
|
80
|
+
componentDidRender(): void;
|
|
81
81
|
render(): any;
|
|
82
82
|
}
|
|
83
83
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IFormViewField } from "../../interfaces/IFormViewField";
|
|
2
|
-
export declare const buildFile: ({ name, label, readOnly, contextName }: IFormViewField) => HTMLElement;
|
|
2
|
+
export declare const buildFile: ({ name, label, readOnly, contextName, props }: IFormViewField) => HTMLElement;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,r as a,c as l,H as t,g as n}from"./p-bfc7b8ca.js";import{UserInterface as o,ElementIDUtils as d}from"@sankhyalabs/core";import{R as i}from"./p-3f4ae3a3.js";import{C as s}from"./p-b853763b.js";function r(a,l,t,n,o){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:!t,label:l,mode:o?s.SWITCH:s.REGULAR,"data-field-name":a,"data-context-name":n,key:a}))}function c(a,l,t,n,o,d){return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-number-input",{enabled:!t,label:l,precision:n,prettyPrecision:o,"data-field-name":a,"data-context-name":d,key:a}))}const m=({name:a,label:l,readOnly:t,contextName:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-text-input",{label:l,"data-field-name":a,"data-context-name":n,key:a,enabled:!t})),z=new Map;z.set(o.CHECKBOX,(e=>r(e.name,e.label,e.readOnly,e.contextName,!1))),z.set(o.SWITCH,(e=>r(e.name,e.label,e.readOnly,e.contextName,!0))),z.set(o.OPTIONSELECTOR,(({name:a,label:l,readOnly:t,required:n,props:o,contextName:d})=>{const i=null==o?void 0:o.options;let s;if("string"==typeof i){const e=JSON.parse(i);s=Object.keys(e).map((a=>({value:a,label:e[a]})))}else s=i;return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-combo-box",{enabled:!t,suppressEmptyOption:n,label:l,"data-field-name":a,"data-context-name":d,key:a,options:s}))})),z.set(o.DATE,(({name:a,label:l,readOnly:t})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-input",{enabled:!t,label:l,"data-field-name":a,key:a})))),z.set(o.TIME,(({name:a,label:l,readOnly:t})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-time-input",{enabled:!t,label:l,"data-field-name":a,key:a})))),z.set(o.DATETIME,(({name:a,label:l,readOnly:t,contextName:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-time-input",{enabled:!t,label:l,"data-field-name":a,"data-context-name":n,key:a})))),z.set(o.FILE,(({name:a,label:l,readOnly:t,contextName:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-upload",{enabled:!t,label:l,"data-field-name":a,"data-context-name":n,key:a})))),z.set(o.DECIMALNUMBER,(({name:e,label:a,readOnly:l,props:t,contextName:n})=>{const o=Number((null==t?void 0:t.precision)||2);return c(e,a,l,o,Number((null==t?void 0:t.prettyPrecision)||o),n)})),z.set(o.INTEGERNUMBER,(({name:e,label:a,readOnly:l,contextName:t})=>c(e,a,l,0,0,t))),z.set(o.SEARCH,(({name:a,label:l,readOnly:t,required:n,contextName:o})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-search",{enabled:!t,suppressEmptyOption:n,label:l,"data-field-name":a,"data-context-name":o,key:a})))),z.set(o.LONGTEXT,(({name:a,label:l,readOnly:t,contextName:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small",key:a},e("ez-text-area",{enabled:!t,label:l,"data-field-name":a,"data-context-name":n}))));const b=e=>{const a=z.get(e.userInterface)||m,l=e.required?`${e.label}${i}`:e.label;return a(Object.assign(Object.assign({},e),{label:l}))},p=class{constructor(e){a(this,e),this.ezContentReady=l(this,"ezContentReady",7),this.fields=void 0}async showUp(){this._element.scrollIntoView({behavior:"smooth",block:"start"})}groupFields(e){const a=new Map;return e.forEach((e=>{const l=e.group;if(l){let t=a.get(l);null==t&&(t=[],a.set(l,t)),t.push(e)}else a.set(e.name,e)})),a}componentDidRender(){this.ezContentReady.emit(Array.from(this._element.querySelectorAll("[data-field-name]")))}render(){if(d.addIDInfoIfNotExists(this._element,"ezFormView"),null!=this.fields)return e(t,null,Array.from(this.groupFields(this.fields).entries()).map((([a,l])=>Array.isArray(l)?e("ez-collapsible-box",{id:`group-${a}`,label:a,"header-size":"large",key:a},l.map((e=>b(e)))):b(l))))}get _element(){return n(this)}};p.style=".sc-ez-form-view-h{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}";export{p as ez_form_view}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,f as e,h as o,g as a}from"./p-bfc7b8ca.js";import{A as s}from"./p-41ce6f98.js";import{ElementIDUtils as d}from"@sankhyalabs/core";import"./p-ab574d59.js";class r{constructor(i){this.file=i,this.size=i.size,this.name=i.name}abortUpload(){this._uploadingXhr&&(this._aborted=!0,this._uploadingXhr.abort(),this._uploadingXhr=void 0)}isUploading(){return void 0!==this._uploadingXhr}async upload(i,t,e){return new Promise(((o,a)=>{const s=new XMLHttpRequest;this._uploadingXhr=s,this._aborted=!1,this.progress=0,s.upload.onprogress=i=>{const t=i.loaded,o=i.total;this.progress=~~(t/o*100),e(this,t,o)},s.onreadystatechange=()=>{if(4==s.readyState){this._uploadingXhr=void 0;const i=s.status;this._aborted||(0===i?a("Servidor indisponível"):i>=500?a("Erro inesperado no servidor"):i>=400&&a("Operação não permitida"));const t=s.response;if(t)try{o(JSON.parse(t))}catch(i){a(`Servidor não retornou um objeto válido: ${t}.\n${i}`)}}},s.ontimeout=()=>{a("Tempo limite de transferência atingido.")};const d=new FormData;d.append("ARQUIVO",this.file,this.file.name),s.open("POST",i,!0),t&&t.forEach(((i,t)=>s.setRequestHeader(t,i))),s.send(d)}))}async delete(i,t,e){return new Promise(((o,a)=>{const s=new XMLHttpRequest;s.onreadystatechange=()=>{4==s.readyState&&(0===s.status?a("Servidor indisponível"):s.status>=500?a("Erro inesperado no servidor"):s.status>=400&&a("Operação não permitida"),o(!0))},s.ontimeout=()=>{a("Tempo limite de remoção atingido.")},s.open("DELETE",t,!0),e&&e.forEach(((i,t)=>s.setRequestHeader(t,i))),s.send(JSON.stringify(i))}))}}const l=class{constructor(e){i(this,e),this.ezChange=t(this,"ezChange",7),this.ezStartChange=t(this,"ezStartChange",7),this.ezCancelWaitingChange=t(this,"ezCancelWaitingChange",7),this._filePointers=new Map,this.label=void 0,this.subtitle=void 0,this.enabled=!0,this.maxFileSize=void 0,this.maxFiles=void 0,this.requestHeaders=void 0,this.urlUpload=void 0,this.urlDelete=void 0,this.value=void 0}observeValue(i,t){(i!==this._updatingValue||null==i&&null!=t)&&(this._filePointers.forEach((i=>{this.isRemoteFile(i)&&i.abortUpload()})),this._filePointers=new Map,this.updateFilePointers(),this._updatingValue=void 0)}updateFilePointers(){this.value&&this.value.forEach((i=>this._filePointers.set(i.name,i)))}observeRequestHeaders(){if(this._requestHeaders=new Map,"string"==typeof this.requestHeaders)try{this.requestHeaders=JSON.parse(this.requestHeaders)}catch(i){this.requestHeaders=void 0}for(var i in this.requestHeaders)this._requestHeaders.set(i,this.requestHeaders[i])}async addFiles(i){if(this.maxFiles>0){let t=this._filePointers.size;if(i.forEach((i=>{this._filePointers.has(i.name)||t++})),t>this.maxFiles)return void this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`)}Array.prototype.forEach.call(i,this.addFile.bind(this))}async setFocus(){this._fileInput.focus()}async setBlur(){this._fileInput.blur()}async addFile(i){const t=this._filePointers.get(i.name);t?s.confirm("Substituir arquivo",`Já existe um arquivo chamado "${i.name}". Deseja substituí-lo?`).then((e=>{e&&(this.isRemoteFile(t)&&t.abortUpload(),this.doAddFile(i))})):this.doAddFile(i)}async doAddFile(i){try{if(this.validateFile(i)){this.ezStartChange.emit({waitmessage:"Há arquivos sendo enviados. Por favor aguarde a conclusão ou cancele o envio.",blocking:!0});const t=new r(i),o=this._filePointers.get(i.name);o&&this.isRemoteFile(o)&&o.abortUpload(),this._filePointers.set(i.name,t),t.upload(this.urlUpload,this._requestHeaders,(i=>this.updateFeedback(i))).then((i=>i.forEach((i=>this.finishUpload(t.name,i))))).catch((i=>{this.ezCancelWaitingChange.emit(),this.showError(i)})),e(this)}}catch(i){throw this.ezCancelWaitingChange.emit(),i}}finishUpload(i,t){this._filePointers.set(i,t),this.updateValue()}updateValue(){this._updatingValue=[],this._filePointers.forEach((i=>{this.isRemoteFile(i)||this._updatingValue.push(i)})),this._filePointers.size===this._updatingValue.length&&(this.value=this._updatingValue,this.ezChange.emit(this.value))}buildProgressId(i){return`PROGRESS_${i.name.replace(/[^a-z0-9_]/gi,"_")}_${i.file.lastModified}`}updateFeedback(i){window.requestAnimationFrame((()=>{if(this._host){const t=this._host.shadowRoot.querySelector("#"+this.buildProgressId(i));t&&(t.value=i.progress)}}))}validateFile(i){return!this._filePointers.has(i.name)&&this.maxFiles>0&&this._filePointers.size>=this.maxFiles?(this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`),!1):0===i.size?(this.showError(`Erro de permissão: O arquivo "${i.name}" não pode ser enviado.`),!1):this.urlUpload?!(this.maxFileSize>=0&&i.size>this.maxFileSize&&(this.showError("O tamanho máximo dos arquivos é de "+this.formatBytes(this.maxFileSize)),1)):(this.showError("Endereço de upload não informado"),!1)}showError(i){s.alert("Enviando arquivo",i)}formatBytes(i,t=1){if(0===i)return"0 Bytes";const e=t<0?0:t,o=Math.floor(Math.log(i)/Math.log(1024));return parseFloat((i/Math.pow(1024,o)).toFixed(e))+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][o]}onFileInputChange(i){this.addFiles(Array.from(i.target.files)),this._fileInput.value=""}isRemoteFile(i){return"file"in i}removeFromList(i){this._filePointers.delete(i),this.updateValue()}removeFile(i){const t=this._filePointers.get(i);if(this.isRemoteFile(t))t.abortUpload(),this.removeFromList(i);else if(this.urlDelete){const e=new r(null);this._filePointers.set(t.name,e),e.delete(t,this.urlDelete,null).then((()=>this.removeFromList(i))).catch((i=>this.showError(i)))}else this.removeFromList(i)}openFilesDialog(){this.enabled&&this._fileInput.click()}componentDidLoad(){this.enabled&&this._dropZone&&window.FileList&&window.File&&(this._dropZone.addEventListener("dragover",(i=>{i.stopPropagation(),i.preventDefault(),i.dataTransfer.dropEffect="copy",this._dropZone.style.background="#c2dbff"})),this._dropZone.addEventListener("drop",(i=>{i.stopPropagation(),i.preventDefault(),this.addFiles(Array.from(i.dataTransfer.files)),this._dropZone.style.background=""})),this._dropZone.addEventListener("dragleave",(()=>{this._dropZone.style.background=""}))),this._host&&d.addIDInfo(this._host,"input")}componentWillRender(){this.value&&this._filePointers.size<this.value.length&&this.updateFilePointers()}render(){return o("div",{ref:i=>this._dropZone=i,class:this.evalDisabledClass("iu","background--disabled")},o("div",{class:"iu__container",onClick:()=>this.openFilesDialog()},o("div",{class:"iu_header"},this.label?o("label",{class:this.evalDisabledClass("iu__label","text--disabled"),title:this.label},this.label):null,o("div",{class:"padding-large"},o("div",{class:this.evalDisabledClass("iu__icon-label","mouse-pointer--disabled")},o("button",{class:"iu__file-icon",disabled:!this.enabled}),o("div",{class:this.evalDisabledClass("text text--center text--medium text--primary","text--disabled")},this.enabled?"Arraste e solte ou clique para adicionar arquivos":"Somente leitura")),this.subtitle&&o("div",{class:this.evalDisabledClass("padding-extra-small text text--center text--small text--secondary","text--disabled")},this.subtitle))),this.buildFooter()),o("input",{ref:i=>this._fileInput=i,onChange:i=>this.onFileInputChange(i),type:"file",multiple:!0,class:"appearanceNone"}))}buildFooter(){if(0===this._filePointers.size)return null;const i=[];return this._filePointers.forEach((t=>i.push(this.buildFileItem(t)))),o("div",{class:"iu__footer"},i)}buildFileItem(i){const t=i.name,e=Number(i.progress),a=i.downloadURL,s=`${t} (${this.formatBytes(i.size)})`;return o("div",{class:"iu__item",key:t,onClick:i=>i.stopPropagation()},o("div",{class:"iu__item-label modificador"},o("div",{title:s,class:"col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle"},a?o("a",{href:a,download:!0},s):s)),isNaN(e)?null:o("div",{class:"col col--sd-4 col--stretch align--middle"},o("progress",{id:this.buildProgressId(i),value:e,max:"100"})),this.enabled?o("div",{class:"col col--stretch align--middle"},o("button",{class:"btn-cancel ",onClick:()=>this.removeFile(t)})):null)}evalDisabledClass(i,t){return this.enabled?i:`${i} ${t}`}get _host(){return a(this)}static get watchers(){return{value:["observeValue"],requestHeaders:["observeRequestHeaders"]}}};l.style=':host{--ez-upload--height:42px;--ez-upload--width:100%;--ez-upload__icon--width:48px;--ez-upload__container--background-color:var(--background--medium, #d2dce9);--ez-upload__color--primary:var(--color--primary, #008561);--ez-upload--padding--extra-small:var(--space--extra-small, 3px);--ez-upload--padding--small:var(--space--small, 6px);--ez-upload--padding--medium:var(--space--medium, 12px);--ez-upload--padding--large:var(--space--large, 24px);--ez-upload__border--color:var(--color-strokes, #DCE0E8);--ez-upload--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-upload--text--primary:var(--text-primary, #626e82);--ez-upload--text--secondary:var(--text-secondary, #a2abb9);--ez-upload--font-size:var(--text--medium, 14px);--ez-upload--font-family:var(--font-pattern, Arial);--ez-upload--font-weight:var(--text-weight--large, 500);--ez-upload__btn__cancel-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="8x" width="8px"><path d="M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z"/></svg>\');--ez-upload__file-icon-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="11x" width="9px"><path d="M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z"/></svg>\');display:flex;flex-wrap:wrap;position:relative;padding-bottom:16px;font-family:var(--ez-upload--font-family);font-size:var(--ez-upload--font-size);width:var(--ez-upload--width);font-weight:var(--ez-upload--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:var(--ez-upload--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--ez-upload--padding--medium) var(--ez-upload--padding--medium) var(--ez-upload--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--ez-upload--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--ez-upload__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--ez-upload__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.padding-large{padding:var(--ez-upload--padding--large) 0px}.padding-extra-small{padding:var(--ez-upload--padding--extra-small) 0px}.text{font-family:var(--font-pattern, "Roboto");text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.text--secondary{color:var(--ez-upload--text--secondary);text-shadow:var(--ez-upload--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--ez-upload__btn__cancel-image);mask-image:var(--ez-upload__btn__cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-upload--font-family);font-size:var(--text--extra-small);font-weight:var(--ez-upload--font-weight);color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:\'\';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--ez-upload__file-icon-image);mask-image:var(--ez-upload__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:unset}.appearanceNone{width:0px;height:0px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{l as ez_upload}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,f as o,h as a,g as e}from"./p-bfc7b8ca.js";import{D as l}from"./p-ab574d59.js";import{FloatingManager as d,ElementIDUtils as r}from"@sankhyalabs/core";class n{constructor(i,t,o,a,e,l,d,r,n,c){this.title=i,this.message=t,this.dialogType=o,this.confirm=a,this.icon=e,this.labelCancel=l,this.labelConfirm=d,this.btnConfirmDanger=r,this.callBack=n,this.beforeClose=c}}const c=class{constructor(o){i(this,o),this.ezCancel=t(this,"ezCancel",7),this.ezAccept=t(this,"ezAccept",7),this.labelConfirm="Sim",this.labelCancel="Não",this.btnConfirmDanger=!1,this._messageQueue=[],this._bodyOverflow="",this.confirm=!1,this.dialogType=void 0,this.message=void 0,this.opened=!1,this.personalizedIconPath=void 0,this.ezTitle=void 0,this.beforeClose=void 0}observeConfig(){this.manageOverflow()}manageOverflow(){this.opened&&(this._bodyOverflow=window.document.body.style.overflow),window.document.body.style.overflow=this.opened?"hidden":this._bodyOverflow}manageOverlay(){this.opened?this._overlayId=d.subscribeOverlayControl(this._overlayRef):d.unsubscribeOverlayControl(this._overlayRef||this._overlayId)}handleButtonClick(i){this._currentMessage.beforeClose&&!1===this._currentMessage.beforeClose(i)||(this.opened=this._messageQueue.length>0,this._currentMessage.callBack&&this._currentMessage.callBack(i),i?this.ezAccept.emit(i):this.ezCancel.emit(i),this._currentMessage=this._messageQueue.shift(),o(this))}async show(i,t,o,a,e,l,d,r,c){return this.opened=!0,new Promise((s=>{this._messageQueue.push(new n(i,t,o,a,e,l,d,r,s,c))}))}isCritical(i){return i===l.CRITICAL}getIconElement(i){if(i.dialogType!==l.DEFAULT)return a("ez-icon",{class:"changeable__icon "+this.getIconClass(i.dialogType),size:"small",iconName:this.getIconName(i)})}getIconClass(i){return this.isCritical(i)?"title-icon--critical":i===l.SUCCESS?"title-icon--success":i===l.WARN?"title-icon--warn":""}getIconName(i){return i.icon?i.icon:this.isCritical(i.dialogType)?"alert-circle-inverted":i.dialogType===l.WARN?"warning-outline":i.dialogType===l.SUCCESS?"check":void 0}getTypeIndicatorElement(i){if(i.dialogType!==l.DEFAULT)return a("div",{class:this.getClassIconIndicator(i.dialogType)})}getClassIconIndicator(i){return this.isCritical(i)?"dialog__critical--indicator":i==l.SUCCESS?"dialog__success--indicator":i==l.WARN?"dialog__warning--indicator":""}getClassContainer(i){return(i.dialogType||l.DEFAULT)===l.DEFAULT?"dialog__container dialog__container--default":"dialog__container"}getClassTitleLabel(i){return null==this.getIconElement(i)?"title title__label title__label--no-icon":"title title__label"}componentDidRender(){this.manageOverlay()}componentWillRender(){this._currentMessage||(this._messageQueue.length>0?this._currentMessage=this._messageQueue.pop():this.opened&&(this._currentMessage=new n(this.ezTitle,this.message,this.dialogType,this.confirm,this.personalizedIconPath,this.labelCancel,this.labelConfirm,this.btnConfirmDanger,null,this.beforeClose)))}componentDidLoad(){r.addIDInfo(this._element)}render(){return this.opened&&this._currentMessage?a("div",{class:"overlay",ref:i=>this._overlayRef=i},a("div",{class:"dialog"},this.getTypeIndicatorElement(this._currentMessage),a("div",{class:this.getClassContainer(this._currentMessage)},a("div",{class:"title__container"},a("div",{class:"title__box"},this.getIconElement(this._currentMessage),a("div",{class:this.getClassTitleLabel(this._currentMessage),innerHTML:this._currentMessage.title,"data-element-id":r.getInternalIDInfo("title")})),a("button",{class:"btn-close",onClick:()=>this.handleButtonClick(!1),"data-element-id":r.getInternalIDInfo("buttonClose")})),a("div",{class:"message",innerHTML:this._currentMessage.message,"data-element-id":r.getInternalIDInfo("message")}),this._currentMessage.confirm&&a("div",{class:"button-yes-no__container"},a("ez-button",{class:"button__cancel","data-element-id":r.getInternalIDInfo("cancel"),label:this._currentMessage.labelCancel,onClick:()=>this.handleButtonClick(!1)}),a("ez-button",{class:this._currentMessage.btnConfirmDanger?"button__confirm--danger":"button__confirm","data-element-id":r.getInternalIDInfo("confirm"),label:this._currentMessage.labelConfirm,onClick:()=>this.handleButtonClick(!0)})),!this._currentMessage.confirm&&a("div",{class:"button__confirm--container"},a("ez-button",{label:"Ok","data-element-id":r.getInternalIDInfo("ok"),class:"button__confirm",onClick:()=>this.handleButtonClick(!0)}))))):null}get _element(){return e(this)}static get watchers(){return{opened:["observeConfig"]}}};c.style=':host{--dialog__container-padding:var(--space--large, 24px);--dialog__btn__close--background-color:var(--title--primary, #2b3a54);--dialog__btn__no--padding-right:var(--space--large, 24px);--dialog__btn__close__image:url(\'data:image/svg+xml;utf8,<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg%22%3E<path d="M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z"/></svg>\');--dialog__title--font-pattern:var(--font-pattern, "Roboto");--dialog__title--padding-left:var(--space--small, 6px);--dialog__title__container--padding-bottom:var(--space--medium, 12px);--dialog__title--weight--large:var(--text-weight--large, 600);--dialog__body--font-pattern:var(--font-pattern, "Roboto");--dialog__body--text-shadow:var(--text-shadow, "0 0 0 #353535, 0 0 1px transparent");--dialog__body--text-weight--medium:var(--text-weight--medium, 400);--dialog__body--padding-bottom:var(--space--large, 24px);--dialog__body--font-size:var(--text--medium, 14px);--dialog__body--color:var(--text--primary, #626e82);--dialog__icon--color:var(--text--inverted, #fff);--dialog__critical--background-color:var(--color--alert-error-800, #BD0025);--dialog__warning--background-color:var(--color--alert-warning-500, #EFB103);--dialog__success--background-color:var(--color--alert-success-500, #00523c);--dialog-z-index:var(--most-visible, 3);--dialog--warning__image:url(\'data: image/svg+xml;utf8,<svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><path d="M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895"/></svg>\');--dialog--critical__image:url(\'data: image/svg+xml;utf8,<svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg"><path d="M 7.6534493,6.4948538 12.762051,1.3864299 C 12.914368,1.2341297 13,1.027552 13,0.81215179 13,0.59676225 12.914369,0.39018443 12.762051,0.23787352 12.609733,0.08557341 12.40318,0 12.187747,0 11.972425,0 11.765762,0.08557341 11.613445,0.23787352 L 6.5048431,5.3462975 1.3961977,0.23787352 C 1.2438802,0.08557341 1.0373043,0 0.82189458,0 0.60649572,0 0.39990901,0.08557341 0.24759147,0.23787352 0.09527396,0.39018443 0.00970766,0.59676225 0.00970766,0.81215179 c 0,0.21540021 0.0855663,0.42197791 0.23788381,0.57427811 L 5.3562369,6.4948538 0.24759147,11.604381 c -0.0775121,0.07492 -0.13931586,0.164543 -0.18182835,0.263595 -0.04250169,0.09905 -0.064850182,0.205678 -0.0657357237,0.313391 -8.8554258e-4,0.107813 0.0197049337,0.214771 0.0605827337,0.314472 0.04086693,0.0998 0.10119858,0.190415 0.17746563,0.266625 0.0762779,0.07622 0.16695386,0.136398 0.26675594,0.177208 0.099802,0.04082 0.20672745,0.06127 0.31452961,0.06029 0.1078025,-9.53e-4 0.21433799,-0.0235 0.31337139,-0.06604 0.099045,-0.04265 0.1886052,-0.104571 0.263465,-0.182081 L 6.5048431,7.6434102 11.613445,12.751855 c 0.152317,0.152312 0.35898,0.237831 0.574302,0.237831 0.215433,0 0.421986,-0.08552 0.574304,-0.237831 C 12.914368,12.599545 13,12.393 13,12.177578 13,11.962157 12.91437,11.75561 12.762051,11.603299 Z"/></svg>\')}h2{margin-block-start:0;margin-block-end:0;margin-inline-start:0px;margin-inline-end:0px}.overlay{position:fixed;display:flex;top:0px;z-index:var(--dialog-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.dialog{display:flex;width:80%;position:absolute;top:50%;left:50%;margin-right:-50%;box-sizing:border-box;transform:translate(-50%, -50%);box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122)}@media screen and (min-width: 768px){.dialog{width:50%}}@media screen and (min-width: 992px){.dialog{width:33.33333%}}.dialog__container{width:100%;background:#FFFF;border-radius:0px 6px 6px 0px;box-sizing:border-box;padding:var(--dialog__container-padding)}.dialog__container--default{border-radius:6px 6px 6px 6px}.dialog__critical--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--dialog__critical--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__warning--background-color)}.dialog__success--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__success--background-color)}.message{font-size:var(--dialog__body--font-size);font-weight:var(--dialog__body--text-weight--medium);font-family:var(--dialog__body--font-pattern);text-shadow:var(--dialog__body--text-shadow);padding-bottom:var(--dialog__body--padding-bottom);color:var(--dialog__body--color);max-height:30vh;content-visibility:auto;margin-bottom:24px;overflow-y:auto}.changeable__icon{background:var(--dialog__warning--background-color);--ez-icon--color:var(--dialog__icon--color);display:grid;place-items:center;width:26px;height:26px;border-radius:50%}.changeable__icon.critical{background:var(--dialog__critical--background-color)}.title{display:flex;font-family:var(--dialog__title--font-pattern);margin:0;font-weight:var(--dialog__title--weight--large);line-height:0}.title__container{display:flex;padding-bottom:var(--dialog__title__container--padding-bottom)}.title__box{display:flex;width:100%;align-items:center;align-self:center}.title__label{padding-left:var(--dialog__title--padding-left)}.title__label--no-icon{padding-left:0}.title-icon--critical{background-color:var(--dialog__critical--background-color)}.title-icon--success{background-color:var(--dialog__success--background-color)}.title-icon--warn{background-color:var(--dialog__warning--background-color)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:\'\';display:flex;background-color:var(--dialog__btn__close--background-color);width:12px;height:12px;-webkit-mask-image:var(--dialog__btn__close__image);mask-image:var(--dialog__btn__close__image)}.title-icon::after{content:\'\';display:flex;background-color:#FFFF;width:15px;height:15px;-webkit-mask-image:var(--dialog--warning__image);mask-image:var(--dialog--warning__image)}.button-yes-no__container{display:flex;box-sizing:border-box;align-self:center;align-items:center;justify-content:flex-end}.button__cancel{padding-right:var(--dialog__btn__no--padding-right)}.button__confirm{--ez-button--background-color:var(--color--primary);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color--primary-600);--ez-button--hover-color:var(--color--inverted)}.button__confirm--danger{--ez-button--background-color:var(--color--alert-error-800, #BD0025);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color-alert--error-900, #a10020);--ez-button--hover-color:var(--color--inverted)}.button__confirm--container{display:flex;justify-content:flex-end}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{c as ez_dialog}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,g as s,H as e}from"./p-bfc7b8ca.js";import{ElementIDUtils as h}from"@sankhyalabs/core";const o=class{constructor(i){t(this,i),this._dataKey="id_".concat(Date.now().toString())}async show(t){t!==this._focusedIndex&&0<=t&&t<this._totalStackItems&&(this.policyHideRemove(),this.policyShowAppend(t),this._focusedIndex=t)}async getSelectedIndex(){return this._focusedIndex}policyHideRemove(){let t=this._hostElem.querySelector(`#${this._dataKey}_el_${this._focusedIndex}`);this.checkElementVisibility(t)}policyShowAppend(t){let i=this._hostElem.querySelector(`#${this._dataKey}_el_${t}`);i?i.removeAttribute("style"):this._hostElem.append(this._elemList[t])}checkElementVisibility(t){"hide"!==t.getAttribute("hidePolicy")&&t.getAttribute("hidePolicy")?"remove"===t.getAttribute("hidePolicy")&&t.remove():t.setAttribute("style","display: none")}componentWillRender(){this._elemList||(this._elemList=[],this._focusedIndex=0,this._totalStackItems=0,this._hostElem.classList.add("ez-view-stack__container"),this._hostElem.querySelectorAll(":scope > stack-item").forEach(((t,i)=>{t.setAttribute("id",`${this._dataKey}_el_${i}`),0!==i&&this.checkElementVisibility(t),this._totalStackItems++,this._elemList.push(t)})))}componentDidLoad(){h.addIDInfo(this._hostElem)}disconectCallback(){this._hostElem=null,this._elemList=null}render(){return i(e,null)}get _hostElem(){return s(this)}};o.style=":host{width:100%;height:100%}.ez-view-stack__container{width:100%;height:100%}";export{o as ez_view_stack}
|