@sankhyalabs/ezui 1.1.78 → 1.1.81
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/{AssetsUtils-dd585fba.js → AssetsUtils-02db4f46.js} +1 -1
- package/dist/cjs/ez-action-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-button_3.cjs.entry.js +520 -0
- package/dist/cjs/ez-calendar_14.cjs.entry.js +2598 -0
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/{ez-button_11.cjs.entry.js → ez-grid.cjs.entry.js} +14 -1410
- package/dist/cjs/ez-icon.cjs.entry.js +30 -0
- package/dist/cjs/ez-label-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal_2.cjs.entry.js +370 -0
- package/dist/cjs/ez-popover.cjs.entry.js +2 -2
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +3 -3
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/{index-4e4bae01.js → index-2003dec4.js} +0 -10
- package/dist/cjs/{index-40ebb2be.js → index-4fc4a0a4.js} +86 -63
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +0 -2
- package/dist/collection/components/ez-form/DataBinder.js +50 -0
- package/dist/collection/components/ez-form/ez-form.css +1 -15
- package/dist/collection/components/ez-form/ez-form.js +112 -427
- package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +46 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +11 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.js +14 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +9 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/FileInput.tpl.js +5 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.js +13 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.js +5 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/TextArea.tpl.js +5 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/TextInput.tpl.js +5 -0
- package/dist/collection/components/ez-form/store/form.slice.js +38 -0
- package/dist/collection/components/ez-form/structure/FormItem.js +11 -0
- package/dist/collection/components/ez-form/structure/FormSheet.js +5 -0
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +86 -0
- package/dist/collection/components/test-du/test-du.js +65 -23
- package/dist/custom-elements/index.d.ts +0 -12
- package/dist/custom-elements/index.js +462 -2104
- package/dist/esm/{AssetsUtils-3803e935.js → AssetsUtils-76ca41e1.js} +1 -1
- package/dist/esm/ez-action-chip.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-button_3.entry.js +514 -0
- package/dist/esm/ez-calendar_14.entry.js +2581 -0
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/{ez-button_11.entry.js → ez-grid.entry.js} +4 -1390
- package/dist/esm/ez-icon.entry.js +26 -0
- package/dist/esm/ez-label-chip.entry.js +1 -1
- package/dist/esm/ez-modal_2.entry.js +365 -0
- package/dist/esm/ez-popover.entry.js +2 -2
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +3 -3
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ezui.js +2 -2
- package/dist/esm/{index-1dacecd3.js → index-077c7fcf.js} +0 -10
- package/dist/esm/{index-ca8700cb.js → index-e31373d9.js} +85 -61
- package/dist/esm/loader.js +2 -2
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-516d0e0f.entry.js → p-0a2056d9.entry.js} +1 -1
- package/dist/ezui/{p-74f978db.entry.js → p-1c8d64d0.entry.js} +46 -46
- package/dist/ezui/p-1e36e3ff.entry.js +1 -0
- package/dist/ezui/p-446ec85b.js +1 -0
- package/dist/ezui/{p-a18a2d7b.entry.js → p-57ea4b84.entry.js} +1 -1
- package/dist/ezui/{p-5a86e18a.entry.js → p-6d157776.entry.js} +1 -1
- package/dist/ezui/p-7de3c95d.js +1 -0
- package/dist/ezui/p-8b9ef58b.entry.js +1 -0
- package/dist/ezui/{p-c6d469fc.entry.js → p-920bb8c9.entry.js} +1 -1
- package/dist/ezui/p-983bd291.js +1 -0
- package/dist/ezui/p-9dbf569a.entry.js +1 -0
- package/dist/ezui/p-a4a39579.entry.js +1 -0
- package/dist/ezui/{p-8d6cdd3e.entry.js → p-aef3394b.entry.js} +1 -1
- package/dist/ezui/p-d64a3939.entry.js +1 -0
- package/dist/ezui/{p-5da66d3e.entry.js → p-da31cd21.entry.js} +1 -1
- package/dist/ezui/{p-f3c5f27e.entry.js → p-da63000f.entry.js} +1 -1
- package/dist/types/components/ez-form/DataBinder.d.ts +10 -0
- package/dist/types/components/ez-form/ez-form.d.ts +25 -32
- package/dist/types/components/ez-form/fieldbuilder/FieldBuilder.d.ts +2 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.d.ts +3 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.d.ts +4 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +8 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/FileInput.tpl.d.ts +4 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +8 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.d.ts +4 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/TextArea.tpl.d.ts +4 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/TextInput.tpl.d.ts +4 -0
- package/dist/types/components/ez-form/store/form.slice.d.ts +24 -0
- package/dist/types/components/ez-form/structure/FormItem.d.ts +9 -0
- package/dist/types/components/ez-form/structure/FormSheet.d.ts +9 -0
- package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +27 -0
- package/dist/types/components/test-du/test-du.d.ts +8 -2
- package/dist/types/components.d.ts +9 -63
- package/package.json +2 -2
- package/react/components.d.ts +0 -2
- package/react/components.js +0 -2
- package/react/components.js.map +1 -1
- package/dist/cjs/ApplicationUtils-d1c1db56.js +0 -35
- package/dist/cjs/DataUnit-fdd7c70e.js +0 -474
- package/dist/cjs/DateUtils-716769e0.js +0 -46
- package/dist/cjs/ez-calendar.cjs.entry.js +0 -217
- package/dist/cjs/ez-collapsible-box_6.cjs.entry.js +0 -634
- package/dist/cjs/ez-combo-box.cjs.entry.js +0 -254
- package/dist/cjs/ez-date-time-input.cjs.entry.js +0 -133
- package/dist/cjs/ez-form.cjs.entry.js +0 -1838
- package/dist/cjs/ez-number-input.cjs.entry.js +0 -74
- package/dist/cjs/form-metadata.cjs.entry.js +0 -129
- package/dist/collection/components/ez-form/assets/trash-can-outline.svg +0 -3
- package/dist/collection/components/ez-form/store/Form.actions.js +0 -132
- package/dist/collection/components/ez-form/store/Form.reducer.js +0 -194
- package/dist/collection/components/ez-form/store/Form.selectors.js +0 -44
- package/dist/collection/components/ez-form/subcomponents/DataUnit.js +0 -301
- package/dist/collection/components/ez-form/subcomponents/FormMetadata.js +0 -8
- package/dist/collection/components/ez-form/subcomponents/css/place-holder.css +0 -24
- package/dist/collection/components/ez-form/subcomponents/form-metadata.js +0 -227
- package/dist/collection/components/ez-form/subcomponents/place-holder.js +0 -14
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +0 -95
- package/dist/collection/components/ez-form/subcomponents/structure/FieldSet.js +0 -27
- package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +0 -41
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +0 -37
- package/dist/esm/ApplicationUtils-01280a9d.js +0 -33
- package/dist/esm/DataUnit-1cd45202.js +0 -464
- package/dist/esm/DateUtils-0a1bbd7a.js +0 -44
- package/dist/esm/ez-calendar.entry.js +0 -213
- package/dist/esm/ez-collapsible-box_6.entry.js +0 -625
- package/dist/esm/ez-combo-box.entry.js +0 -250
- package/dist/esm/ez-date-time-input.entry.js +0 -129
- package/dist/esm/ez-form.entry.js +0 -1834
- package/dist/esm/ez-number-input.entry.js +0 -70
- package/dist/esm/form-metadata.entry.js +0 -125
- package/dist/ezui/assets/trash-can-outline.svg +0 -3
- package/dist/ezui/p-14bee38e.entry.js +0 -1
- package/dist/ezui/p-37a611ea.js +0 -1
- package/dist/ezui/p-3a09c678.entry.js +0 -1
- package/dist/ezui/p-43c15c94.entry.js +0 -1
- package/dist/ezui/p-7107d7ef.js +0 -1
- package/dist/ezui/p-72ff3c95.entry.js +0 -1
- package/dist/ezui/p-88f45a83.entry.js +0 -1
- package/dist/ezui/p-8f4851a6.js +0 -1
- package/dist/ezui/p-9dfd537e.js +0 -1
- package/dist/ezui/p-a0331955.entry.js +0 -1
- package/dist/ezui/p-a15093e3.entry.js +0 -1
- package/dist/ezui/p-a19f2af3.entry.js +0 -1
- package/dist/ezui/p-c89629eb.js +0 -1
- package/dist/ezui/p-da929c01.js +0 -1
- package/dist/types/components/ez-form/store/Form.actions.d.ts +0 -111
- package/dist/types/components/ez-form/store/Form.reducer.d.ts +0 -20
- package/dist/types/components/ez-form/store/Form.selectors.d.ts +0 -14
- package/dist/types/components/ez-form/subcomponents/DataUnit.d.ts +0 -91
- package/dist/types/components/ez-form/subcomponents/FormMetadata.d.ts +0 -24
- package/dist/types/components/ez-form/subcomponents/form-metadata.d.ts +0 -16
- package/dist/types/components/ez-form/subcomponents/place-holder.d.ts +0 -3
- package/dist/types/components/ez-form/subcomponents/structure/Field.d.ts +0 -11
- package/dist/types/components/ez-form/subcomponents/structure/FieldSet.d.ts +0 -13
- package/dist/types/components/ez-form/subcomponents/structure/FormSheet.d.ts +0 -14
- package/dist/types/components/ez-form/subcomponents/structure/NavigationBar.d.ts +0 -19
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-1dacecd3.js';
|
|
2
|
-
import { N as NumberUtils } from './index-ca8700cb.js';
|
|
3
|
-
import { C as CSSVarsUtils } from './CSSVarsUtils-aeee9825.js';
|
|
4
|
-
|
|
5
|
-
const ezNumberInputCss = ":host{display:block;width:100%}";
|
|
6
|
-
|
|
7
|
-
let EzNumberInput = class {
|
|
8
|
-
constructor(hostRef) {
|
|
9
|
-
registerInstance(this, hostRef);
|
|
10
|
-
this.ezChange = createEvent(this, "ezChange", 7);
|
|
11
|
-
/**
|
|
12
|
-
* Deixa o campo disponível ou não para uso.
|
|
13
|
-
*/
|
|
14
|
-
this.enabled = true;
|
|
15
|
-
}
|
|
16
|
-
setLabel() {
|
|
17
|
-
this._textInput.label = this.label;
|
|
18
|
-
}
|
|
19
|
-
setErrorMessage() {
|
|
20
|
-
this._textInput.errorMessage = this.errorMessage;
|
|
21
|
-
}
|
|
22
|
-
applyValueToInput() {
|
|
23
|
-
if (this._textInput) {
|
|
24
|
-
this._textInput.value = this.getTextValue(this.value);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
changeValue(newValue) {
|
|
28
|
-
this.errorMessage = "";
|
|
29
|
-
if (newValue && newValue !== this.value) {
|
|
30
|
-
this.value = newValue;
|
|
31
|
-
this.ezChange.emit(this.value);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
parseNumber() {
|
|
35
|
-
const parsedNumber = this._textInput.value ? NumberUtils.stringToNumber(this._textInput.value) : null;
|
|
36
|
-
if (parsedNumber != null && isNaN(parsedNumber)) {
|
|
37
|
-
this.errorMessage = "O valor digitado não é um número válido";
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
try {
|
|
41
|
-
this.changeValue(parsedNumber);
|
|
42
|
-
}
|
|
43
|
-
catch (e) {
|
|
44
|
-
this.errorMessage = e.message;
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
getTextValue(value) {
|
|
50
|
-
if (value) {
|
|
51
|
-
return this.precision > 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
|
|
52
|
-
}
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
componentDidLoad() {
|
|
56
|
-
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
57
|
-
}
|
|
58
|
-
render() {
|
|
59
|
-
return (h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage }));
|
|
60
|
-
}
|
|
61
|
-
get _elem() { return getElement(this); }
|
|
62
|
-
static get watchers() { return {
|
|
63
|
-
"label": ["setLabel"],
|
|
64
|
-
"errorMessage": ["setErrorMessage"],
|
|
65
|
-
"value": ["applyValueToInput"]
|
|
66
|
-
}; }
|
|
67
|
-
};
|
|
68
|
-
EzNumberInput.style = ezNumberInputCss;
|
|
69
|
-
|
|
70
|
-
export { EzNumberInput as ez_number_input };
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement, H as Host } from './index-1dacecd3.js';
|
|
2
|
-
import { g as DataUnit } from './DataUnit-1cd45202.js';
|
|
3
|
-
import './ApplicationUtils-01280a9d.js';
|
|
4
|
-
|
|
5
|
-
let FormMetadata = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
}
|
|
9
|
-
buildField(element) {
|
|
10
|
-
let label = element.getAttribute("label");
|
|
11
|
-
let name = element.getAttribute("name") || label;
|
|
12
|
-
let userInterface = element.getAttribute("ui") || "SHORTTEXT";
|
|
13
|
-
let properties = [];
|
|
14
|
-
if (userInterface === "OPTIONSELECTOR") {
|
|
15
|
-
if (!label) {
|
|
16
|
-
label = "Selecione uma das opções:";
|
|
17
|
-
}
|
|
18
|
-
const objOpts = {};
|
|
19
|
-
Array.from(element.getElementsByTagName("OPTION")).forEach((optElem, index) => {
|
|
20
|
-
const optValue = optElem.getAttribute("value") || index;
|
|
21
|
-
const optLabel = optElem.textContent;
|
|
22
|
-
objOpts[optValue] = optLabel;
|
|
23
|
-
});
|
|
24
|
-
properties.push({ name: "options", value: JSON.stringify(objOpts) });
|
|
25
|
-
}
|
|
26
|
-
else if (userInterface === "FILE") {
|
|
27
|
-
const urlElement = element.querySelector("URL");
|
|
28
|
-
const headersElement = element.querySelectorAll("HEADERS>HEADER");
|
|
29
|
-
if (urlElement) {
|
|
30
|
-
properties.push({ name: "URL", value: urlElement.textContent });
|
|
31
|
-
}
|
|
32
|
-
if (headersElement && headersElement.length > 0) {
|
|
33
|
-
const headers = {};
|
|
34
|
-
headersElement.forEach(header => {
|
|
35
|
-
headers[header.getAttribute("name")] = header.textContent;
|
|
36
|
-
});
|
|
37
|
-
properties.push({ name: "HEADERS", value: JSON.stringify(headers) });
|
|
38
|
-
}
|
|
39
|
-
this.addPropertyIfExists(properties, element, "maxfiles");
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
if (!label) {
|
|
43
|
-
label = element.textContent;
|
|
44
|
-
}
|
|
45
|
-
this.addPropertyIfExists(properties, element, "precision");
|
|
46
|
-
this.addPropertyIfExists(properties, element, "prettyprecision");
|
|
47
|
-
}
|
|
48
|
-
const defaultValue = element.getAttribute("defaultValue");
|
|
49
|
-
const required = element.getAttribute("required") === "true";
|
|
50
|
-
const readOnly = element.getAttribute("readonly") === "true";
|
|
51
|
-
return { name, userInterface, label, defaultValue, required, readOnly, properties };
|
|
52
|
-
}
|
|
53
|
-
addPropertyIfExists(properties, element, name) {
|
|
54
|
-
const value = element.getAttribute(name);
|
|
55
|
-
if (value) {
|
|
56
|
-
properties.push({ name, value });
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
buildFieldSet(dataUnit, element) {
|
|
60
|
-
const label = element.getAttribute("label");
|
|
61
|
-
const fields = Array.from(element.getElementsByTagName("FIELD")).map(f => {
|
|
62
|
-
const field = this.buildField(f);
|
|
63
|
-
dataUnit.addFieldMetadata(field);
|
|
64
|
-
return { name: field.name };
|
|
65
|
-
});
|
|
66
|
-
return { label, fields };
|
|
67
|
-
}
|
|
68
|
-
fromElements(elements, label, name, dataUnit, autoLoad) {
|
|
69
|
-
const form = {
|
|
70
|
-
name: name || label,
|
|
71
|
-
dataUnit,
|
|
72
|
-
label,
|
|
73
|
-
autoLoad
|
|
74
|
-
};
|
|
75
|
-
Array.from(elements).forEach(child => {
|
|
76
|
-
const tagName = child.tagName.toUpperCase();
|
|
77
|
-
switch (tagName) {
|
|
78
|
-
case "FIELD":
|
|
79
|
-
if (!form.items) {
|
|
80
|
-
form.items = [];
|
|
81
|
-
}
|
|
82
|
-
const f = this.buildField(child);
|
|
83
|
-
dataUnit.addFieldMetadata(f);
|
|
84
|
-
form.items.push({ name: f.name });
|
|
85
|
-
break;
|
|
86
|
-
case "FIELD-SET":
|
|
87
|
-
if (!form.items) {
|
|
88
|
-
form.items = [];
|
|
89
|
-
}
|
|
90
|
-
form.items.push(this.buildFieldSet(dataUnit, child));
|
|
91
|
-
break;
|
|
92
|
-
case "SUB-FORM":
|
|
93
|
-
if (!form.subForms) {
|
|
94
|
-
form.subForms = [];
|
|
95
|
-
}
|
|
96
|
-
const label = child.getAttribute("label") || "Subform " + (form.subForms.length + 1);
|
|
97
|
-
const name = child.getAttribute("name") || label;
|
|
98
|
-
const subDuName = child.getAttribute("dataunit");
|
|
99
|
-
let subDu;
|
|
100
|
-
if (subDuName) {
|
|
101
|
-
subDu = new DataUnit(subDuName, "noname", child.hasAttribute("many") ? "N" : "1");
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
subDu = dataUnit;
|
|
105
|
-
}
|
|
106
|
-
form.subForms.push(this.fromElements(child.children, label, name, subDu, child.getAttribute("autoload") === "true"));
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
return form;
|
|
111
|
-
}
|
|
112
|
-
connectedCallback() {
|
|
113
|
-
if (!this.dataunit) {
|
|
114
|
-
this.dataunit = "dataunit_" + (this.name || this.label || new Date().getTime());
|
|
115
|
-
}
|
|
116
|
-
const du = new DataUnit(this.dataunit, "noname", this.many ? "N" : "1");
|
|
117
|
-
this.metadata = this.fromElements(this._host.children, this.label, this.name, du, this.autoload);
|
|
118
|
-
}
|
|
119
|
-
render() {
|
|
120
|
-
return h(Host, null);
|
|
121
|
-
}
|
|
122
|
-
get _host() { return getElement(this); }
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export { FormMetadata as form_metadata };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg width="11" height="12" viewBox="0 0 11 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M3.333 0V0.667H0V2H0.667V10.667C0.667 11.0205 0.80744 11.3596 1.05743 11.6096C1.30741 11.8596 1.64647 12 2 12H8.667C9.02053 12 9.35959 11.8596 9.60957 11.6096C9.85956 11.3596 10 11.0205 10 10.667V2H10.667V0.667H7.333V0H3.333ZM2 2H8.667V10.667H2V2ZM3.333 3.333V9.333H4.667V3.333H3.333ZM6 3.333V9.333H7.333V3.333H6Z" fill="white"/>
|
|
3
|
-
</svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,c as e,f as r,h as l}from"./p-8f4851a6.js";import"./p-da929c01.js";import{F as t}from"./p-ddd0ef12.js";let i=class{constructor(r){a(this,r),this.ezChange=e(this,"ezChange",7),this._firstRender=!0,this._todayLabel="Hoje",this._weekDayLabels=["D","S","T","Q","Q","S","S"],this._monthLabels=["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],this._hoursLabel=["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"],this._minutosLabel=["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"],this.value=new Date,this.floating=!1,this.time=!1,this.showSeconds=!1}async show(a,e,r,l){this.floating&&(this._floatingID=t.float(this._box,this._container,{autoClose:!0,top:a,left:e,bottom:r,right:l}),window.requestAnimationFrame((()=>{this._box.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})))}async fitVertical(a,e){const r=this._container.getBoundingClientRect().bottom+this._calendarHeight;(window.innerHeight||document.documentElement.clientHeight)>r?this.show(a+"px",void 0,"unset"):this.show("unset",void 0,e+"px")}async hide(){void 0!==this._floatingID&&(t.close(this._floatingID),this._floatingID=void 0)}valueChanged(){this.value&&(this._currentPosition.setTime(this.value.getTime()),this._currentPosition.setDate(1))}getMonthLabel(){return this._monthLabels[this._currentPosition.getMonth()]+" "+this._currentPosition.getFullYear()}isSelectedDate(a){return!!this.value&&this.value.getDate()==a.getDate()&&this.value.getMonth()==a.getMonth()&&this.value.getFullYear()==a.getFullYear()}changeMonth(a){this._currentPosition.setMonth(this._currentPosition.getMonth()+a),r(this)}selectDate(a){let e=a;this.value&&(this.time||this.showSeconds)&&(e.setHours(this.value.getHours()),e.setMinutes(this.value.getMinutes()),e.setSeconds(this.showSeconds?this.value.getSeconds():0)),this.value=e,this.ezChange.emit()}selectHours(a){this.value||(this.value=new Date),this.value=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),a,this.value.getMinutes(),this.value.getSeconds()),this.ezChange.emit()}selectMinutes(a){this.value||(this.value=new Date),this.value=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.value.getHours(),a,this.value.getSeconds()),this.ezChange.emit()}selectSeconds(a){this.value||(this.value=new Date),this.value=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.value.getHours(),this.value.getMinutes(),a),this.ezChange.emit()}updateScroll(a){if(a){const{scrollHeight:e,clientHeight:r,scrollTop:l}=a;e-r-Math.ceil(l)>0?a.classList.add("endHidden"):a.classList.remove("endHidden")}}componentDidRender(){this.floating&&this._firstRender&&(this._calendarHeight=this._box.clientHeight,this._box.remove(),this._firstRender=!1),this.updateScroll(this._hoursScroll),this.updateScroll(this._minutesScroll),this.updateScroll(this._secondsScroll)}componentDidLoad(){(this.time||this.showSeconds)&&(this._hoursScroll.scrollTop=this._hoursSelect.offsetTop-64,this._minutesScroll.scrollTop=this._minutesSelect.offsetTop-64,this.showSeconds&&(this._secondsScroll.scrollTop=this._secondsSelect.offsetTop-64))}render(){null==this._currentPosition&&(this._currentPosition=new Date,this.value&&this._currentPosition.setTime(this.value.getTime()),this._currentPosition.setDate(1));const a=new Date;return a.setTime(this._currentPosition.getTime()),a.setDate(1-a.getDay()),l("section",{ref:a=>this._container=a},l("div",{ref:a=>this._box=a,style:{display:"flex"}},l("div",{class:"calendar"},l("div",{class:"calendar__header"},l("button",{class:"calendar__btn-previous",onClick:()=>this.changeMonth(-1)}),l("label",{class:"calendar__lbl-month"},this.getMonthLabel()),l("button",{class:"calendar__btn-next",onClick:()=>this.changeMonth(1)})),l("div",{class:"calendar__body"},l("div",{class:"calendar__line"},this._weekDayLabels.map((a=>l("div",{class:"calendar__cell calendar__cell--unselectable"},a)))),[0,7,14,21,28,35].map((e=>l("div",{class:"calendar__line"},[0,1,2,3,4,5,6].map((r=>{const t=new Date;t.setTime(a.getTime()),t.setDate(t.getDate()+e+r);let i="calendar__cell";return this._currentPosition.getMonth()!=t.getMonth()?i+=" calendar__cell--secondary":this.isSelectedDate(t)&&(i+=" calendar__cell--selected"),l("div",{class:i,onClick:()=>this.selectDate(t)},t.getDate())})))))),l("div",{class:"calendar__footer"},l("button",{class:"calendar__btn-today",onClick:()=>this.selectDate(new Date)},this._todayLabel))),(this.time||this.showSeconds)&&l("div",{class:"calendarTime"},l("div",{class:"calendarTime__header"},l("div",null,"H"),l("div",{class:"separatorTime"},":"),l("div",null,"M"),this.showSeconds&&l("div",{class:"separatorTime"},":"),this.showSeconds&&l("div",null,"S")),l("div",{class:"calendar__body ",style:{display:"flex",paddingLeft:"6px",paddingRight:"6px"}},l("div",{class:"calendar__column",ref:a=>this._hoursScroll=a,onScroll:()=>this.updateScroll(this._hoursScroll)},this._hoursLabel.map(((a,e)=>e===this.value.getHours()?l("div",{style:{display:"flex"},ref:a=>this._hoursSelect=a},l("div",{class:"calendar__cell calendar__cell--selected",onClick:()=>this.selectHours(e)},a),l("div",{class:"separatorTime"},":")):l("div",{style:{display:"flex"}},l("div",{class:"calendar__cell",onClick:()=>this.selectHours(e)},a),l("div",{class:"separatorTime"},":"))))),l("div",{class:"calendar__column",ref:a=>this._minutesScroll=a,onScroll:()=>this.updateScroll(this._minutesScroll)},this._minutosLabel.map(((a,e)=>e===this.value.getMinutes()?l("div",{style:{display:"flex"},ref:a=>this._minutesSelect=a},l("div",{class:"calendar__cell calendar__cell--selected",onClick:()=>this.selectMinutes(e)},a),this.showSeconds&&l("div",{class:"separatorTime"},":")):l("div",{style:{display:"flex"}},l("div",{class:"calendar__cell",onClick:()=>this.selectMinutes(e)},a),this.showSeconds&&l("div",{class:"separatorTime"},":"))))),this.showSeconds&&l("div",{class:"calendar__column",ref:a=>this._secondsScroll=a,onScroll:()=>this.updateScroll(this._secondsScroll)},this._minutosLabel.map(((a,e)=>e===this.value.getSeconds()?l("div",{class:"calendar__cell calendar__cell--selected",onClick:()=>this.selectSeconds(e),ref:a=>this._secondsSelect=a},a):l("div",{class:"calendar__cell",onClick:()=>this.selectSeconds(e)},a))))))))}static get watchers(){return{value:["valueChanged"]}}};i.style=':host{--ez-calendar--font-family:var(--font-pattern, Arial);--ez-calendar--color:var(--title--primary, #626e82);--ez-calendar--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-calendar__body--background-color:var(--background--xlight, #FFF);--ez-calendar__Time--background-color:var(--background--xlight, #FAFAFA);--ez-calendar__body--padding:var(--space--medium, 12px);--ez-calendar__body--border-radius:var(--border--radius-medium, 12px);--ez-calendar__body--shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-calendar__header-line--stroke:2px;--ez-calendar__header-line--color:var(--color--strokes, #C0C0C0);--ez-calendar__nav-btn--fill:var(--text--primary, #008561);--ez-calendar__nav-btn--hover--fill:var(--color--primary, #350404);--ez-calendar__nav-btn--width:10px;--ez-calendar__nav-btn--height:16px;--ez-calendar__nav-btn--previous-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z"/></svg>\');--ez-calendar__nav-btn--next-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z"/></svg>\');--ez-calendar__cell--margin:0px var(--space--small, 12px);--ez-calendar__cell--width:var(--space--large, 24px);--ez-calendar__cell--padding:var(--space--extra-small, 3px) 0px;--ez-calendar__cell--border-radius:var(--border--radius-small, 6px);--ez-calendar__cell--over--background-color:var(--color--strokes, #E2F4EF);--ez-calendar__cell--outset--color:var(--color--strokes, #C0C0C0);--ez-calendar__cell--selected--background-color:var(--color--primary, #008561);--ez-calendar__cell--selected--color:var(--color--inverted, #FFF);--ez-calendar__btn-today--color:var(--color--primary);--ez-calendar__btn-today--hover--background-color:var(--color--strokes, #E2F4EF);--ez-calendar__btn-today--border-radius:var(--border--radius-small, 6px);position:relative;display:flex;user-select:none}.calendar{z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-calendar__body--background-color);padding:var(--ez-calendar__body--padding);border-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__header{display:flex;justify-content:space-between;padding-bottom:var(--space--medium, 12px);margin:var(--space--small, 6px) var(--space--, 12px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color)}.calendar__btn-next,.calendar__btn-previous{outline:none;border:none;background-color:unset;cursor:pointer;padding:0px}.calendar__btn-next::after,.calendar__btn-previous::after{content:\'\';display:flex;background-color:var(--ez-calendar__nav-btn--fill);width:var(--ez-calendar__nav-btn--width);height:var(--ez-calendar__nav-btn--height)}.calendar__btn-previous::after{-webkit-mask-image:var(--ez-calendar__nav-btn--previous-image);mask-image:var(--ez-calendar__nav-btn--previous-image)}.calendar__btn-next::after{-webkit-mask-image:var(--ez-calendar__nav-btn--next-image);mask-image:var(--ez-calendar__nav-btn--next-image)}.calendar__btn-next:hover::after,.calendar__btn-previous:hover::after{background-color:var(--ez-calendar__nav-btn--hover--fill)}.calendar__lbl-month{font-weight:var(--text-weight--large, 600);font-size:var(--title--medium, 16px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__line{display:flex;padding:0px;margin:0px}.calendar__cell{display:flex;justify-content:center;align-content:center;cursor:pointer;font-size:var(--text--small, 12px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);padding:var(--ez-calendar__cell--padding);margin:var(--ez-calendar__cell--margin);min-width:var(--ez-calendar__cell--width);border-radius:var(--ez-calendar__cell--border-radius)}.calendar__cell:hover{background-color:var(--ez-calendar__cell--over--background-color)}.calendar__cell--secondary{color:var(--ez-calendar__cell--outset--color)}.calendar__cell--unselectable:hover{background-color:unset;border-radius:unset;cursor:unset}.calendar__cell--unselectable{font-weight:var(--text-weight--large, 600);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__cell--selected,.calendar__cell--selected:hover{background-color:var(--ez-calendar__cell--selected--background-color);color:var(--ez-calendar__cell--selected--color)}.calendar__body{padding:var(--space--small, 6px) 0px}.calendar__footer{display:flex;flex-direction:column}.calendar__btn-today{border:none;background-color:unset;cursor:pointer;font-weight:var(--text-weight--large, 600);font-size:var(--title--small);padding:var(--space--extra-small, 6px);font-family:var(--ez-calendar--font-family);text-shadow:var(--ez-calendar--text-shadow);color:var(--ez-calendar__btn-today--color);border-radius:var(--ez-calendar__btn-today--border-radius)}.calendar__btn-today:hover{background-color:var(--ez-calendar__btn-today--hover--background-color)}section{display:flex}.calendarTime{margin-left:-10px;display:flex;flex-direction:column;padding:12px 6px;padding-left:16px;padding-bottom:0px;background-color:var(--ez-calendar__Time--background-color);border-top-right-radius:var(--ez-calendar__body--border-radius);border-bottom-right-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__column{height:180px;padding:0px;margin:0px;overflow:auto}.calendar__column::-webkit-scrollbar{width:0px;max-width:0px;min-width:0px}.calendarTime__header{padding-left:6px;padding-right:6px;display:flex;justify-content:space-between;padding-bottom:var(--space--medium, 12px);margin:var(--space--small, 6px) var(--space--, 12px);font-weight:var(--text-weight--large, 600);font-size:var(--title--medium, 16px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.separatorTime{color:#A2ABB9}.endHidden{-webkit-mask-image:linear-gradient(180deg, #000 calc(100% - 48px), transparent 100%)}';export{i as ez_calendar}
|
package/dist/ezui/p-37a611ea.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as s,s as t}from"./p-8f4851a6.js";const a=a=>`${function(){if(!e){const s=document.querySelector("script[data-ezui-assets-url]");if(s){let a=s.dataset.ezuiAssetsUrl;a&&(a.startsWith("/")&&(a=window.location.origin+a),t(a))}e=!0}return s("../assets/actions-sprite.svg")}()}#${a}`;let e=!1;export{a as g}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as t,h as a}from"./p-8f4851a6.js";let i=class{constructor(a){o(this,a),this.applicationLoaded=t(this,"applicationLoaded",7)}componentWillLoad(){}componentDidLoad(){this.applicationLoaded.emit(!0)}render(){return a("div",null)}};i.style="";export{i as ez_application}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,r as registerInstance,f as forceUpdate,g as getElement}from"./p-8f4851a6.js";import{D as DependencyType,s as selectIsCollapsedFieldSet,c as collapseExpandGroup,a as selectCurrentTab,b as selectVisibleButtons,d as changeTab$1,f as formLoad,e as showHideNavigationButtons,g as DataUnit,i as invalidField$1}from"./p-9dfd537e.js";import{c as createCommonjsModule,g as getDefaultExportFromCjs}from"./p-da929c01.js";import{A as ApplicationUtils}from"./p-7107d7ef.js";import{D as DateUtils}from"./p-c89629eb.js";function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function formatProdErrorMessage(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var $$observable="function"==typeof Symbol&&Symbol.observable||"@@observable",randomString=function(){return Math.random().toString(36).substring(7).split("").join(".")},ActionTypes={INIT:"@@redux/INIT"+randomString(),REPLACE:"@@redux/REPLACE"+randomString(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+randomString()}};function isPlainObject(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function createStore(e,t,r){var n;if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(formatProdErrorMessage(0));if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error(formatProdErrorMessage(1));return r(createStore)(e,t)}if("function"!=typeof e)throw new Error(formatProdErrorMessage(2));var o=e,i=t,a=[],c=a,s=!1;function l(){c===a&&(c=a.slice())}function u(){if(s)throw new Error(formatProdErrorMessage(3));return i}function d(e){if("function"!=typeof e)throw new Error(formatProdErrorMessage(4));if(s)throw new Error(formatProdErrorMessage(5));var t=!0;return l(),c.push(e),function(){if(t){if(s)throw new Error(formatProdErrorMessage(6));t=!1,l();var r=c.indexOf(e);c.splice(r,1),a=null}}}function f(e){if(!isPlainObject(e))throw new Error(formatProdErrorMessage(7));if(void 0===e.type)throw new Error(formatProdErrorMessage(8));if(s)throw new Error(formatProdErrorMessage(9));try{s=!0,i=o(i,e)}finally{s=!1}for(var t=a=c,r=0;r<t.length;r++)(0,t[r])();return e}function b(e){if("function"!=typeof e)throw new Error(formatProdErrorMessage(10));o=e,f({type:ActionTypes.REPLACE})}function h(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(formatProdErrorMessage(11));function r(){e.next&&e.next(u())}return r(),{unsubscribe:t(r)}}})[$$observable]=function(){return this},e}return f({type:ActionTypes.INIT}),(n={dispatch:f,subscribe:d,getState:u,replaceReducer:b})[$$observable]=h,n}function assertReducerShape(e){Object.keys(e).forEach((function(t){var r=e[t];if(void 0===r(void 0,{type:ActionTypes.INIT}))throw new Error(formatProdErrorMessage(12));if(void 0===r(void 0,{type:ActionTypes.PROBE_UNKNOWN_ACTION()}))throw new Error(formatProdErrorMessage(13))}))}function combineReducers(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var o=t[n];"function"==typeof e[o]&&(r[o]=e[o])}var i,a=Object.keys(r);try{assertReducerShape(r)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var n=!1,o={},c=0;c<a.length;c++){var s=a[c],l=e[s],u=(0,r[s])(l,t);if(void 0===u)throw new Error(formatProdErrorMessage(14));o[s]=u,n=n||u!==l}return(n=n||a.length!==Object.keys(e).length)?o:e}}function compose(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function applyMiddleware(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return function(){var r=e.apply(void 0,arguments),n=function(){throw new Error(formatProdErrorMessage(15))},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return n=compose.apply(void 0,i)(r.dispatch),_objectSpread2(_objectSpread2({},r),{},{dispatch:n})}}}function createThunkMiddleware(e){return function(t){var r=t.dispatch,n=t.getState;return function(t){return function(o){return"function"==typeof o?o(r,n,e):t(o)}}}}var thunk=createThunkMiddleware();thunk.withExtraArgument=createThunkMiddleware;var actions=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ActionCreators=t.ActionTypes=void 0;var r={UNDO:"@@redux-undo/UNDO",REDO:"@@redux-undo/REDO",JUMP_TO_FUTURE:"@@redux-undo/JUMP_TO_FUTURE",JUMP_TO_PAST:"@@redux-undo/JUMP_TO_PAST",JUMP:"@@redux-undo/JUMP",CLEAR_HISTORY:"@@redux-undo/CLEAR_HISTORY"};t.ActionTypes=r,t.ActionCreators={undo:function(){return{type:r.UNDO}},redo:function(){return{type:r.REDO}},jumpToFuture:function(e){return{type:r.JUMP_TO_FUTURE,index:e}},jumpToPast:function(e){return{type:r.JUMP_TO_PAST,index:e}},jump:function(e){return{type:r.JUMP,index:e}},clearHistory:function(){return{type:r.CLEAR_HISTORY}}}})),helpers=createCommonjsModule((function(e,t){function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Array.isArray(e)?e:"string"==typeof e?[e]:t}Object.defineProperty(t,"__esModule",{value:!0}),t.parseActions=r,t.isHistory=function(e){return void 0!==e.present&&void 0!==e.future&&void 0!==e.past&&Array.isArray(e.future)&&Array.isArray(e.past)},t.includeAction=function(e){var t=r(e);return function(e){return t.indexOf(e.type)>=0}},t.excludeAction=function(e){var t=r(e);return function(e){return t.indexOf(e.type)<0}},t.combineFilters=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce((function(e,t){return function(r,n,o){return e(r,n,o)&&t(r,n,o)}}),(function(){return!0}))},t.groupByActionTypes=function(e){var t=r(e);return function(e){return t.indexOf(e.type)>=0?e.type:null}},t.newHistory=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{past:e,present:t,future:r,group:n,_latestUnfiltered:t,index:e.length,limit:e.length+r.length+1}}})),debug=createCommonjsModule((function(e,t){function r(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.set=function(e){n=e},t.start=function(e,t){o={header:[],prev:[],action:[],next:[],msgs:[]},n&&(console.group?(o.header=["%credux-undo","font-style: italic","action",e.type],o.action=s("action",a,e),o.prev=s("prev history",i,t)):(o.header=["redux-undo action",e.type],o.action=["action",e],o.prev=["prev history",t]))},t.end=function(e){var t,i,a,l,u,d,f,b,h,p,m,v,g,O,j;n&&(o.next=console.group?s("next history",c,e):["next history",e],m=o.header,v=o.prev,g=o.next,O=o.action,j=o.msgs,console.group?((t=console).groupCollapsed.apply(t,r(m)),(i=console).log.apply(i,r(v)),(a=console).log.apply(a,r(O)),(l=console).log.apply(l,r(g)),(u=console).log.apply(u,r(j)),console.groupEnd()):((d=console).log.apply(d,r(m)),(f=console).log.apply(f,r(v)),(b=console).log.apply(b,r(O)),(h=console).log.apply(h,r(g)),(p=console).log.apply(p,r(j))))},t.log=function(){if(n){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.msgs=o.msgs.concat([].concat(t,["\n"]))}};var i="#9E9E9E",a="#03A9F4",c="#4CAF50";function s(e,t,r){return["%c".concat(e),"color: ".concat(t,"; font-weight: bold"),r]}})),reducer=createCommonjsModule((function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.set(t.debug);var r,o=a({limit:void 0,filter:function(){return!0},groupBy:function(){return null},undoType:actions.ActionTypes.UNDO,redoType:actions.ActionTypes.REDO,jumpToPastType:actions.ActionTypes.JUMP_TO_PAST,jumpToFutureType:actions.ActionTypes.JUMP_TO_FUTURE,jumpType:actions.ActionTypes.JUMP,neverSkipReducer:!1,ignoreInitialState:!1,syncFilter:!1},t,{initTypes:(0,helpers.parseActions)(t.initTypes,["@@redux-undo/INIT"]),clearHistoryType:(0,helpers.parseActions)(t.clearHistoryType,[actions.ActionTypes.CLEAR_HISTORY])}),i=o.neverSkipReducer?function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return a({},t,{present:e.apply(void 0,[t.present,r].concat(o))})}:function(e){return e};return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.start(a,t);for(var c,s=t,p=arguments.length,m=new Array(p>2?p-2:0),v=2;v<p;v++)m[v-2]=arguments[v];if(!r){if(n.log("history is uninitialized"),void 0===t){var g={type:"@@redux-undo/CREATE_HISTORY"},O=e.apply(void 0,[t,g].concat(m));return s=l(O,o.ignoreInitialState),n.log("do not set initialState on probe actions"),n.end(s),s}(0,helpers.isHistory)(t)?(s=r=o.ignoreInitialState?t:(0,helpers.newHistory)(t.past,t.present,t.future),n.log("initialHistory initialized: initialState is a history",r)):(s=r=l(t,o.ignoreInitialState),n.log("initialHistory initialized: initialState is not a history",r))}switch(a.type){case void 0:return s;case o.undoType:return c=b(s,-1),n.log("perform undo"),n.end(c),i.apply(void 0,[c,a].concat(m));case o.redoType:return c=b(s,1),n.log("perform redo"),n.end(c),i.apply(void 0,[c,a].concat(m));case o.jumpToPastType:return c=f(s,a.index),n.log("perform jumpToPast to ".concat(a.index)),n.end(c),i.apply(void 0,[c,a].concat(m));case o.jumpToFutureType:return c=d(s,a.index),n.log("perform jumpToFuture to ".concat(a.index)),n.end(c),i.apply(void 0,[c,a].concat(m));case o.jumpType:return c=b(s,a.index),n.log("perform jump to ".concat(a.index)),n.end(c),i.apply(void 0,[c,a].concat(m));case h(a.type,o.clearHistoryType):return c=l(s.present,o.ignoreInitialState),n.log("perform clearHistory"),n.end(c),i.apply(void 0,[c,a].concat(m));default:if(c=e.apply(void 0,[s.present,a].concat(m)),o.initTypes.some((function(e){return e===a.type})))return n.log("reset history due to init action"),n.end(r),r;if(s._latestUnfiltered===c)return s;var j="function"==typeof o.filter&&!o.filter(a,c,s);if(j){var y=(0,helpers.newHistory)(s.past,c,s.future,s.group);return o.syncFilter||(y._latestUnfiltered=s._latestUnfiltered),n.log("filter ignored action, not storing it in past"),n.end(y),y}var E=o.groupBy(a,c,s);if(null!=E&&E===s.group){var w=(0,helpers.newHistory)(s.past,c,s.future,s.group);return n.log("groupBy grouped the action with the previous action"),n.end(w),w}return s=u(s,c,o.limit,E),n.log("inserted new state into history"),n.end(s),s}}};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var c=i?Object.getOwnPropertyDescriptor(e,a):null;c&&(c.get||c.set)?Object.defineProperty(n,a,c):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}(debug);function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function l(e,t){var r=(0,helpers.newHistory)([],e,[]);return t&&(r._latestUnfiltered=null),r}function u(e,t,r,o){var i=e.past.length+1;n.log("inserting",t),n.log("new free: ",r-i);var a=e._latestUnfiltered,c=e.past.slice(r&&r<=i?1:0),l=null!=a?[].concat(s(c),[a]):c;return(0,helpers.newHistory)(l,t,[],o)}function d(e,t){if(t<0||t>=e.future.length)return e;var r=e.future,n=e._latestUnfiltered,o=[].concat(s(e.past),[n],s(r.slice(0,t))),i=r[t],a=r.slice(t+1);return(0,helpers.newHistory)(o,i,a)}function f(e,t){if(t<0||t>=e.past.length)return e;var r=e.past,n=e.future,o=e._latestUnfiltered,i=r.slice(0,t),a=[].concat(s(r.slice(t+1)),[o],s(n));return(0,helpers.newHistory)(i,r[t],a)}function b(e,t){return t>0?d(e,t-1):t<0?f(e,e.past.length+t):e}function h(e,t){return t.indexOf(e)>-1?e:!e}})),lib=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ActionTypes",{enumerable:!0,get:function(){return actions.ActionTypes}}),Object.defineProperty(t,"ActionCreators",{enumerable:!0,get:function(){return actions.ActionCreators}}),Object.defineProperty(t,"parseActions",{enumerable:!0,get:function(){return helpers.parseActions}}),Object.defineProperty(t,"isHistory",{enumerable:!0,get:function(){return helpers.isHistory}}),Object.defineProperty(t,"includeAction",{enumerable:!0,get:function(){return helpers.includeAction}}),Object.defineProperty(t,"excludeAction",{enumerable:!0,get:function(){return helpers.excludeAction}}),Object.defineProperty(t,"combineFilters",{enumerable:!0,get:function(){return helpers.combineFilters}}),Object.defineProperty(t,"groupByActionTypes",{enumerable:!0,get:function(){return helpers.groupByActionTypes}}),Object.defineProperty(t,"newHistory",{enumerable:!0,get:function(){return helpers.newHistory}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.default}});var r,n=(r=reducer)&&r.__esModule?r:{default:r}}));const undoable=getDefaultExportFromCjs(lib),inicialHistState={currentTabIndex:{},currentRecordIndex:{},changes:{},collapsedGroups:{},newRecordIndex:{}},inicialNonHistState={dataLoading:{},invalidFields:{},visibleButtons:{previousVisible:!0,nextVisible:!0,addVisible:!0,removeVisible:!0,saveVisible:!0,cancelVisible:!0,reloadVisible:!1}};function formReducer(e=inicialHistState,t){switch(t.type){case"FORM/COLLAPSEGROUP":return collapseGroup(e,t.payload);case"FORM/CHANGETAB":return changeTab(e,t.payload.formId,t.payload.index);case"FORM/NAVIGATE":return navigate(e,t.payload);case"FORM/INSERT":return insertRecord(e,t.payload);case"FORM/CHANGEFIELD":return changeFieldValue(e,t.payload);case"FORM/CLEAREDITION":return clearEdition(e,t.payload);case"FORM/INVALIDFIELD":return navigateToInvalid(e,t.payload);default:return e}}function formNonHistoricReducer(e=inicialNonHistState,t){switch(t.type){case"FORM/DATALOADING":return dataLoading(e,t.payload);case"FORM/DATALOADED":return dataLoaded(e,t.payload);case"FORM/SAVINGCHANGES":return savingChanges(e,t.payload);case"FORM/CHANGESSAVED":return changesSaved(e,t.payload);case"FORM/REMOVINGRECORD":return removingRecord(e,t.payload);case"FORM/RECORDREMOVED":return recordRemoved(e,t.payload);case"FORM/INVALIDFIELD":return invalidField(e,t.payload);case"FORM/CLEAREDITION":return clearAllInvalidFields(e,t.payload);case"FORM/CHANGEFIELD":return clearInvalidField(e,t.payload);case"FORM/SHOWHIDENAVBTN":return showHideNavBtn(e,t.payload);default:return e}}function collapseGroup(e,{collapseId:t,collapsed:r}){const n=Object.assign({},e.collapsedGroups);return r?n[t]=!0:delete n[t],Object.assign(Object.assign({},e),{collapsedGroups:n})}function changeTab(e,t,r){const n=Object.assign({},e.currentTabIndex);return n[t]=r,Object.assign(Object.assign({},e),{currentTabIndex:n})}function navigate(e,{dataUnit:t,limit:r,backward:n}){const o=Object.assign({},e.currentRecordIndex)[t]||0;return gotoIndex(e,t,n?Math.max(r,o-1):Math.min(r,o+1))}function gotoIndex(e,t,r){const n=Object.assign({},e.currentRecordIndex);return n[t]=r,Object.assign(Object.assign({},e),{currentRecordIndex:n})}function insertRecord(e,{dataUnit:t,insertionIndex:r}){const n=Object.assign({},e.currentRecordIndex),o=Object.assign({},e.newRecordIndex);return n[t]=r,o[t]=(e.newRecordIndex[t]||0)+1,Object.assign(Object.assign({},e),{currentRecordIndex:n,newRecordIndex:o})}function changeFieldValue(e,{dataUnit:t,recordId:r,fieldName:n,value:o}){const i=Object.assign({},e.changes),a=Object.assign({},i[t]),c=Object.assign({},a[r]);c[n]=o,a[r]=c,i[t]=a;const s=Object.assign({},e.invalidFields),l=Object.assign({},s[t]),u=Object.assign({},l[r]);return delete u[n],l[r]=u,s[t]=l,Object.assign(Object.assign({},e),{changes:i,invalidFields:s,invalidFieldSelected:void 0})}function clearEdition(e,{dataUnit:t,recordsLimit:r}){const n=Object.assign({},e.changes),o=Object.assign({},e.newRecordIndex),i=Object.assign({},e.currentRecordIndex);return delete n[t],delete o[t],i[t]=Math.min(r,i[t]||0),Object.assign(Object.assign({},e),{changes:n,newRecordIndex:o,currentRecordIndex:i})}function navigateToInvalid(e,t){let r=Object.assign({},e);return void 0===r.invalidFieldSelected&&(r.invalidFieldSelected=!0,r=gotoIndex(r,t.dataUnit,t.recordIndex),r=changeTab(r,t.tabController,t.tabIndex)),r}function dataLoading(e,{dataUnit:t}){const r=Object.assign({},e.dataLoading);return r[t]=!0,Object.assign(Object.assign({},e),{dataLoading:r})}function dataLoaded(e,{dataUnit:t}){const r=Object.assign({},e.dataLoading);return delete r[t],Object.assign(Object.assign({},e),{dataLoading:r})}function savingChanges(e,{dataUnit:t}){const r=Object.assign({},e.dataLoading);return r[t]=!0,Object.assign(Object.assign({},e),{dataLoading:r})}function changesSaved(e,{dataUnit:t}){const r=Object.assign({},e.dataLoading);return delete r[t],Object.assign(Object.assign({},e),{dataLoading:r})}function removingRecord(e,{dataUnit:t}){const r=Object.assign({},e.dataLoading);return r[t]=!0,Object.assign(Object.assign({},e),{dataLoading:r})}function recordRemoved(e,{dataUnit:t}){const r=Object.assign({},e.dataLoading);return delete r[t],Object.assign(Object.assign({},e),{dataLoading:r})}function invalidField(e,{dataUnit:t,recordId:r,fieldName:n,errorMessage:o}){const i=Object.assign({},e.invalidFields),a=Object.assign({},i[t]),c=Object.assign({},a[r]);return c[n]=o,a[r]=c,i[t]=a,Object.assign(Object.assign({},e),{invalidFields:i})}function clearAllInvalidFields(e,{dataUnit:t}){const r=Object.assign({},e.invalidFields);return delete r[t],Object.assign(Object.assign({},e),{invalidFields:r})}function clearInvalidField(e,{dataUnit:t,recordId:r,fieldName:n}){const o=Object.assign({},e.invalidFields),i=Object.assign({},o[t]),a=Object.assign({},i[r]);return delete a[n],i[r]=a,o[t]=i,Object.assign(Object.assign({},e),{invalidFields:o})}function showHideNavBtn(e,{buttonName:t,status:r}){const n=Object.assign({},e.visibleButtons);return n[t]=r,Object.assign(Object.assign({},e),{visibleButtons:n})}function removeHandler(e){ApplicationUtils.confirm("Exclusão de registro","Tem certeza que deseja Remover?",null,!0).then((t=>{t&&e.remove()}))}function saveHandler(e){setTimeout((()=>{e.save()}),50)}const NavigationBar=({dataUnit:e,buttonProps:t,enabled:r})=>t.previousVisible||t.nextVisible||t.addVisible||t.removeVisible||t.saveVisible||t.cancelVisible||t.reloadVisible?h("div",{class:"col col--sd-12 align--right"},t.previousVisible?h("ez-button",{key:e.name+"_previous",title:"Registro anterior",mode:"icon",enabled:r&&e.hasPrevious(),onClick:()=>e.previous(),image:"/themes/default/images/icons/actions-sprite.svg#previous-circle-inverted",class:"button--secondary margin-right--medium"}):null,t.nextVisible?h("ez-button",{key:e.name+"_next",title:"Próximo registro",mode:"icon",enabled:r&&e.hasNext(),onClick:()=>e.next(),image:"/themes/default/images/icons/actions-sprite.svg#next-circle-inverted",class:"button--secondary margin-right--medium"}):null,t.removeVisible?h("ez-button",{key:e.name+"_remove",label:"Remover",enabled:r&&e.hasCurrentRecord(),onClick:()=>removeHandler(e),image:"/themes/default/images/icons/actions-sprite.svg#minus-circle-inverted",class:"button--secondary margin-right--medium"}):null,t.addVisible?h("ez-button",{key:e.name+"_add",label:"Adicionar",enabled:r,onClick:()=>e.insert(),class:"button--secondary margin-right--medium"}):null,t.reloadVisible?h("ez-button",{key:e.name+"_reload",title:"Recarregar",enabled:r,mode:"icon",onClick:()=>e.load(),image:"/themes/default/images/icons/actions-sprite.svg#rotate",class:"button--secondary margin-right--medium"}):null,t.cancelVisible?h("ez-button",{key:e.name+"_cancel",label:"Cancelar",enabled:r&&e.hasChanges(),onClick:()=>e.cancel(),class:"button--secondary margin-right--medium"}):null,t.saveVisible?h("ez-button",{key:e.name+"_save",label:"Salvar",enabled:r&&e.hasChanges(),onClick:()=>saveHandler(e),class:"button--primary margin-right--medium"}):null):null;function scrollToView(e,t){e&&window.requestAnimationFrame((()=>t.scrollIntoView()))}const Field=({dataUnit:e,field:t,forceScroll:r,enabled:n})=>{const{name:o,form:i}=t,{label:a,userInterface:c,properties:s,required:l,dependencies:u,readOnly:d}=e.getFieldMetadata(o),f=e.getValue(o)||null,b=e.isLoading(),p=l?`* ${a} (obrigatório)`:a,m=e.getErrorMessage(o),v=`${e.name}-${o}`,g=n&&!d,O=t=>{e.changeValue(o,t)};switch(c){case"LONGTEXT":return h("div",{class:"col col--sd-12 padding--small"},b?h("place-holder",null):h("ez-text-area",{value:f||"",label:p,onEzChange:e=>O(e.target.value),errorMessage:m,ref:e=>scrollToView(r,e),key:v,enabled:g}));case"CHECKBOX":case"SWITCH":return h("div",{class:"col col--sd-12 col--tb-3 padding--small align--middle padding-bottom--large"},b?h("place-holder",null):h("ez-check",{value:f,label:a,enabled:g,mode:"CHECKBOX"===c?"regular":"switch",onEzChange:e=>O(e.target.value),ref:e=>scrollToView(r,e),key:v}));case"OPTIONSELECTOR":const t=s?JSON.parse(getProp(s,"options")):{},n=Object.keys(t).map((e=>({value:e,label:t[e]})));return h("div",{class:"col col--sd-12 col--tb-3 padding--small"},b?h("place-holder",null):h("ez-combo-box",{value:f,label:p,enabled:g,onEzChange:e=>O(e.target.value),errorMessage:m,ref:e=>scrollToView(r,e),key:v,options:n}));case"SEARCH":const l={__MAIN_FORM:i,__DATA_UNIT:e.name,__FIELD_NAME:o};s.forEach((({name:e,value:t})=>{l[e]=t}));let d=[];return null==u||u.forEach((t=>{var r;if(t.type===DependencyType.SEARCHING&&(null===(r=t.masterFields)||void 0===r?void 0:r.length)>0){let r={expression:t.expression,paramNames:[...t.masterFields],paramResolver:t=>e.getValue(t)};d.push(r)}})),d.length>0&&(l.CRITERIA=d),h("div",{class:"col col--sd-12 col--tb-3 padding--small"},b?h("place-holder",null):h("ez-search",{value:f,label:p,enabled:g,onEzChange:e=>O(e.target.value),errorMessage:m,optionLoader:e=>{if(i)return i.loadSearch(e,l)},ref:e=>scrollToView(r,e),key:v}));case"FILE":const j=getProp(s,"URL"),y=getProp(s,"HEADERS"),E=y?JSON.parse(y):{},w=Number(getProp(s,"maxfiles")||0);return h("div",{class:"col col--sd-12 padding--small"},b?h("place-holder",null):h("ez-upload",{value:f,label:p,enabled:g,onEzChange:e=>O(e.detail),urlUpload:j,requestHeaders:E,maxFiles:w}));case"DATE":return h("div",{class:"col col--sd-12 col--tb-3 padding--small"},b?h("place-holder",null):h("ez-date-input",{value:f?DateUtils.clearTime(f):null,label:p,enabled:g,onEzChange:e=>O(e.target.value),errorMessage:m,ref:e=>scrollToView(r,e),key:v}));case"DECIMALNUMBER":case"INTEGERNUMBER":let M=0,T=0;return"DECIMALNUMBER"===c&&(M=Number(getProp(s,"precision")||2),T=Number(getProp(s,"prettyprecision")||M)),h("div",{class:"col col--sd-12 col--tb-3 padding--small"},b?h("place-holder",null):h("ez-numeric-input",{value:f||null,label:p,enabled:g,onEzChange:e=>O(e.target.value),errorMessage:m,precision:M,prettyprecision:T,ref:e=>scrollToView(r,e),key:v}));default:return h("div",{class:"col col--sd-12 col--tb-3 padding--small"},b?h("place-holder",null):h("ez-text-input",{value:f,label:p,enabled:g,loading:b,onInput:e=>O(e.target.value),errorMessage:m,ref:e=>scrollToView(r,e),key:v}))}};function getProp(e,t){var r;return e?null===(r=e.find((e=>e.name===t)))||void 0===r?void 0:r.value:null}const FieldSet=({store:e,formName:t,source:r,dataUnit:n,enabled:o})=>{const{label:i,fields:a}=r,c=t+i;let s,l=selectIsCollapsedFieldSet(e.getState(),t+i);return r.fields.forEach((e=>{if(void 0===s){const t=n.getErrorMessage(e.name);null!=t&&""!==t&&(s=e.name)}})),s&&(l=!1),h("div",{class:"col col--sd-12 padding--small"},h("div",{class:"row margin-top--large"},h("div",{class:"col col--sd-12 align--middle padding-horizontal--medium"},h("ez-collapsible-box",{value:l,label:i,onEzChange:()=>e.dispatch(collapseExpandGroup(c,!l))}),l?null:h("div",{class:"col col--sd-12"},a.map((e=>h(Field,{enabled:o,field:e,dataUnit:n,forceScroll:s===e.name})))))))};function buildFormItem(e,t,r,n,o){if("fields"in e)return h(FieldSet,{enabled:o,source:e,store:r,formName:t,dataUnit:n});const i=n.getErrorMessage(e.name);return h(Field,{enabled:o,field:e,dataUnit:n,forceScroll:null!=i&&""!==i})}const FormSheet=({store:e,parentName:t,source:r,parentDataUnit:n,dataUnitBuilder:o,enabled:i})=>{const a=selectCurrentTab(e.getState(),t),c=r.length>1?r.map((e=>h("ez-tab",{label:e.label,tabKey:e.name}))):null,{subForms:s,items:l,name:u}=r[a],d=o(r[a].dataUnit,n);r[a].dataUnit=d;const f=s&&s.length>0,b=d||n;let p=selectVisibleButtons(e.getState());return"1"===b.cardinality&&(p.addVisible=!1,p.removeVisible=!1,p.nextVisible=!1,p.previousVisible=!1),h("div",{class:"form-sheet"},c?h("ez-tabselector",{selectedIndex:a,selectedTab:u,onEzChange:r=>{e.dispatch(changeTab$1(t,r.target.selectedindex))}},c):null,d?h(NavigationBar,{enabled:i,dataUnit:d,buttonProps:p}):null,h("div",{class:"tab__container"},l?l.map((t=>buildFormItem(t,u,e,b,i))):null,f?h(FormSheet,{enabled:i,store:e,source:s,parentName:u,parentDataUnit:b,dataUnitBuilder:o}):null))},ezFormCss="ez-form{display:flex;flex-direction:column;width:100%}.form-sheet{display:flex;width:100%;flex-wrap:wrap;position:relative}.tab__container{display:flex;width:100%;flex-wrap:wrap;position:relative}";let EzForm=class{constructor(e){registerInstance(this,e),this.enabled=!0,this.loading=!1,this._dataUnits=new Map,this._duSources=new Map,this._tabPositionByField=new Map,this._duToLoad=[]}cleanPreparedMetadata(){this._preparedMetadata=void 0}async validate(){const e=Array.from(this._duSources.keys());for(let t=0;t<this._duSources.size;t++){const r=e[t];let n=this._dataUnits.get(r);if(void 0===n){const e=this._duSources.get(r);n=this.buildDataUnit(e,e.parentDUName)}if(!n.validateRecords())return!1}return!0}async getChanges(){let e=[];const t=Array.from(this._dataUnits.values());for(let r=0;r<this._dataUnits.size;r++){const n=t[r];if(!n.parentDU){const t=n.getChangesToSave();t&&(e=e.concat(t))}}return e}async changeFieldValue(e,t,r){const n=this._dataUnits.get(e);n&&n.changeValue(t,r)}validateRecords(e,t,r){const n={isValid:!0,message:""};if(this.ignoreSaveValidation&&"SAVE"===r)return n;const o=t=>{e.requiredFields.forEach((r=>{if((e=>!e.readOnly&&"SWITCH"!==e.userInterface&&"CHECKBOX"!==e.userInterface)(r)){const o=t.record__index,i=t[r.name];if(null==i||""===i){const i=this._tabPositionByField.get(e.name+r.name);this._store.dispatch(invalidField$1(i.tabName,i.index,e.name,o,t.record__id,r.name,"Essa informação é obrigatória")),n.isValid=!1,n.message="Há pelo menos um campo obrigatório não preenchido."}}}))};if(0===e.records.length)o({});else{let r={};t.forEach((e=>{o(e),r[e.record__id]=!0})),e.records.forEach((e=>{r[e.record__id]||o(e)}))}return n}loadMDFromExecutor(e){const t=this.parseExecutor(this.metadataExecutor);if(t){const r=t();r&&(r instanceof Promise?r.then((t=>{e(t)})):e(r))}}loadMDFromElement(e){const t=[];Array.from(this._host.children).forEach((e=>{"FORM-METADATA"===e.tagName&&t.push(e.metadata)})),e(t.length>0?t:null)}updateMetadata(e){if(e){const t=(e,r,n,o)=>{var i;r.items.forEach((t=>{if("fields"in t)t.fields.forEach((t=>{t.form=this,this._tabPositionByField.set(e+t.name,{tabName:n,index:o})}));else{const r=t;r.form=this,this._tabPositionByField.set(e+r.name,{tabName:n,index:o})}})),null===(i=r.subForms)||void 0===i||i.forEach(((n,o)=>{const i=n.dataUnit;i&&(this._duSources.set(i.name,i),i.parentDUName=e),t(i?i.name:e,n,r.name,o)}))};this._preparedMetadata=e.map(((e,r)=>{const n=e.dataUnit;e.autoLoad&&this._duToLoad.push(n),this.decorateDU(n);const o=n.name;return this._duSources.set(o,n),t(o,e,"__MAIN__FORM__",r),e})),this._store.dispatch(formLoad())}}parseExecutor(executor){return executor?executor instanceof Function?executor:eval(executor):null}componentWillRender(){if(void 0===this._store){const e=combineReducers({hist:undoable(formReducer),nonhist:formNonHistoricReducer});this._store=createStore(e,applyMiddleware(thunk)),this._store.subscribe((()=>{forceUpdate(this)})),this.slaveMode&&(this._store.dispatch(showHideNavigationButtons("saveVisible",!1)),this._store.dispatch(showHideNavigationButtons("cancelVisible",!1)),this._store.dispatch(showHideNavigationButtons("reloadVisible",!1)))}void 0===this._preparedMetadata&&(this.metadata?this.updateMetadata(this.metadata):(this.loadMDFromElement((e=>this.updateMetadata(e))),this._preparedMetadata||this.loadMDFromExecutor((e=>this.updateMetadata(e)))))}componentDidRender(){this._duToLoad.forEach((e=>e.load())),this._duToLoad=[]}loadSearch(e,t){const r=this.parseExecutor(this.fieldSearchExecutor);return r?r(e,t):[{value:0,label:"Sem resultados"}]}buildDataUnit(e,t){if(e){const{name:r,unitLabel:n,records:o,cardinality:i,fields:a}=e;if(!(e instanceof DataUnit)){let c;c=t instanceof DataUnit?t:this._dataUnits.get(t),(e=new DataUnit(r,n,i,c)).fields=a,this._dataUnits.set(e.name,e),o&&(e.records=o)}this.decorateDU(e)}return e}decorateDU(e){e.store=this._store,e.loadExecutor=this.parseExecutor(this.loadExecutor),e.saveExecutor=this.parseExecutor(this.saveExecutor),e.removeExecutor=this.parseExecutor(this.removeExecutor),e.recordsValidator=this}render(){return this.loading?h("place-holder",null):this._preparedMetadata?h(FormSheet,{enabled:this.enabled,store:this._store,source:this._preparedMetadata,parentName:"__MAIN__FORM__",dataUnitBuilder:(e,t)=>this.buildDataUnit(e,t)}):null}static get assetsDirs(){return["assets"]}get _host(){return getElement(this)}static get watchers(){return{metadata:["cleanPreparedMetadata"]}}};EzForm.style=ezFormCss;export{EzForm as ez_form}
|
package/dist/ezui/p-7107d7ef.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class t{static async showDialog(t,n,e=null,a,o=!1){return new Promise((s=>{let c=document.querySelector("ez-dialog");c||(c=document.createElement("ez-dialog"),window.document.body.appendChild(c)),c.show(t,n,o,a,e).then((t=>s(t)))}))}static async alert(n,e,a=null){return t.showDialog(n,e,a,!1,!1)}static async error(n,e,a=null){return t.showDialog(n,e,a,!1,!0)}static async confirm(n,e,a=null,o=!1){return t.showDialog(n,e,a,!0,o)}static async info(t){let n=document.querySelector("ez-toast");n||(n=document.createElement("ez-toast"),window.document.body.appendChild(n)),n.message=t,n.fadeTime=4e3,n.show()}}export{t as A}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,h as e,g as i}from"./p-8f4851a6.js";import{N as r}from"./p-da929c01.js";import{C as h}from"./p-8b099482.js";let a=class{constructor(e){t(this,e),this.ezChange=s(this,"ezChange",7),this.enabled=!0}setLabel(){this._textInput.label=this.label}setErrorMessage(){this._textInput.errorMessage=this.errorMessage}applyValueToInput(){this._textInput&&(this._textInput.value=this.getTextValue(this.value))}changeValue(t){this.errorMessage="",t&&t!==this.value&&(this.value=t,this.ezChange.emit(this.value))}parseNumber(){const t=this._textInput.value?r.stringToNumber(this._textInput.value):null;if(null!=t&&isNaN(t))this.errorMessage="O valor digitado não é um número válido";else try{this.changeValue(t)}catch(t){return void(this.errorMessage=t.message)}}getTextValue(t){return t?this.precision>0?r.format(t.toString(),Number(this.precision),Number(this.prettyPrecision)):t.toString():null}componentDidLoad(){h.applyVarsTextInput(this._elem,this._textInput)}render(){return e("ez-text-input",{ref:t=>this._textInput=t,onBlur:()=>this.parseNumber(),label:this.label,onEzChange:t=>t.stopPropagation(),value:this.getTextValue(this.value),restrict:this.precision>0?"0123456789-,.":"0123456789-",enabled:this.enabled,errorMessage:this.errorMessage})}get _elem(){return i(this)}static get watchers(){return{label:["setLabel"],errorMessage:["setErrorMessage"],value:["applyValueToInput"]}}};a.style=":host{display:block;width:100%}";export{a as ez_number_input}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t,g as a,H as s}from"./p-8f4851a6.js";import{g as r}from"./p-9dfd537e.js";import"./p-7107d7ef.js";let n=class{constructor(t){e(this,t)}buildField(e){let t=e.getAttribute("label"),a=e.getAttribute("name")||t,s=e.getAttribute("ui")||"SHORTTEXT",r=[];if("OPTIONSELECTOR"===s){t||(t="Selecione uma das opções:");const a={};Array.from(e.getElementsByTagName("OPTION")).forEach(((e,t)=>{const s=e.getAttribute("value")||t;a[s]=e.textContent})),r.push({name:"options",value:JSON.stringify(a)})}else if("FILE"===s){const t=e.querySelector("URL"),a=e.querySelectorAll("HEADERS>HEADER");if(t&&r.push({name:"URL",value:t.textContent}),a&&a.length>0){const e={};a.forEach((t=>{e[t.getAttribute("name")]=t.textContent})),r.push({name:"HEADERS",value:JSON.stringify(e)})}this.addPropertyIfExists(r,e,"maxfiles")}else t||(t=e.textContent),this.addPropertyIfExists(r,e,"precision"),this.addPropertyIfExists(r,e,"prettyprecision");return{name:a,userInterface:s,label:t,defaultValue:e.getAttribute("defaultValue"),required:"true"===e.getAttribute("required"),readOnly:"true"===e.getAttribute("readonly"),properties:r}}addPropertyIfExists(e,t,a){const s=t.getAttribute(a);s&&e.push({name:a,value:s})}buildFieldSet(e,t){return{label:t.getAttribute("label"),fields:Array.from(t.getElementsByTagName("FIELD")).map((t=>{const a=this.buildField(t);return e.addFieldMetadata(a),{name:a.name}}))}}fromElements(e,t,a,s,n){const i={name:a||t,dataUnit:s,label:t,autoLoad:n};return Array.from(e).forEach((e=>{switch(e.tagName.toUpperCase()){case"FIELD":i.items||(i.items=[]);const t=this.buildField(e);s.addFieldMetadata(t),i.items.push({name:t.name});break;case"FIELD-SET":i.items||(i.items=[]),i.items.push(this.buildFieldSet(s,e));break;case"SUB-FORM":i.subForms||(i.subForms=[]);const a=e.getAttribute("label")||"Subform "+(i.subForms.length+1),n=e.getAttribute("name")||a,l=e.getAttribute("dataunit");let o;o=l?new r(l,"noname",e.hasAttribute("many")?"N":"1"):s,i.subForms.push(this.fromElements(e.children,a,n,o,"true"===e.getAttribute("autoload")))}})),i}connectedCallback(){this.dataunit||(this.dataunit="dataunit_"+(this.name||this.label||(new Date).getTime()));const e=new r(this.dataunit,"noname",this.many?"N":"1");this.metadata=this.fromElements(this._host.children,this.label,this.name,e,this.autoload)}render(){return t(s,null)}get _host(){return a(this)}};export{n as form_metadata}
|
package/dist/ezui/p-8f4851a6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e,t,n=!1,l=!1;const s="undefined"!=typeof window?window:{},o=s.document||{head:{}},i={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},r=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),a="http://www.w3.org/1999/xlink",u=new WeakMap,f=e=>"sc-"+e.o,h={},p=e=>"object"==(e=typeof e)||"function"===e,d=(e,t,...n)=>{let l=null,s=null,o=!1,i=!1,r=[];const c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!p(l))&&(l+=""),o&&i?r[r.length-1].i+=l:r.push(o?y(null,l):l),i=o)};if(c(n),t){t.key&&(s=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,r,$);const a=y(e,null);return a.u=t,r.length>0&&(a.h=r),a.p=s,a},y=(e,t)=>({t:0,m:e,i:t,$:null,h:null,u:null,p:null}),m={},$={forEach:(e,t)=>e.map(w).forEach(t),map:(e,t)=>e.map(w).map(t).map(b)},w=e=>({vattrs:e.u,vchildren:e.h,vkey:e.p,vname:e.g,vtag:e.m,vtext:e.i}),b=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),d(e.vtag,t,...e.vchildren||[])}const t=y(e.vtag,e.vtext);return t.u=e.vattrs,t.h=e.vchildren,t.p=e.vkey,t.g=e.vname,t},g=(e,t,n,l,o,r)=>{if(n!==l){let c=Z(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,s=j(n),o=j(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(c||"o"!==t[0]||"n"!==t[1]){const s=p(l);if((c||s&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{let s=null==l?"":l;"list"===t?c=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}let i=!1;u!==(u=u.replace(/^xlink\:?/,""))&&(t=u,i=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(t)||(i?e.removeAttributeNS(a,t):e.removeAttribute(t)):(!c||4&r||o)&&!s&&(l=!0===l?"":l,i?e.setAttributeNS(a,t,l):e.setAttribute(t,l))}else t="-"===t[2]?t.slice(3):Z(s,u)?u.slice(2):u[2]+t.slice(3),n&&i.rel(e,t,n,!1),l&&i.ael(e,t,l,!1)}},v=/\s/,j=e=>e?e.split(v):[],k=(e,t,n,l)=>{const s=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.u||h,i=t.u||h;for(l in o)l in i||g(s,l,o[l],void 0,n,t.t);for(l in i)g(s,l,o[l],i[l],n,t.t)},S=(t,l,s)=>{let i,r,c=l.h[s],a=0;if(null!==c.i)i=c.$=o.createTextNode(c.i);else{if(n||(n="svg"===c.m),i=c.$=o.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",c.m),n&&"foreignObject"===c.m&&(n=!1),k(null,c,n),null!=e&&i["s-si"]!==e&&i.classList.add(i["s-si"]=e),c.h)for(a=0;a<c.h.length;++a)r=S(t,c,a),r&&i.appendChild(r);"svg"===c.m?n=!1:"foreignObject"===i.tagName&&(n=!0)}return i},O=(e,n,l,s,o,i)=>{let r,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=i;++o)s[o]&&(r=S(null,l,o),r&&(s[o].$=r,c.insertBefore(r,n)))},M=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.$,L(l),s.remove())},x=(e,t)=>e.m===t.m&&e.p===t.p,C=(e,t)=>{const l=t.$=e.$,s=e.h,o=t.h,i=t.m,r=t.i;null===r?(n="svg"===i||"foreignObject"!==i&&n,"slot"===i||k(e,t,n),null!==s&&null!==o?((e,t,n,l)=>{let s,o,i=0,r=0,c=0,a=0,u=t.length-1,f=t[0],h=t[u],p=l.length-1,d=l[0],y=l[p];for(;i<=u&&r<=p;)if(null==f)f=t[++i];else if(null==h)h=t[--u];else if(null==d)d=l[++r];else if(null==y)y=l[--p];else if(x(f,d))C(f,d),f=t[++i],d=l[++r];else if(x(h,y))C(h,y),h=t[--u],y=l[--p];else if(x(f,y))C(f,y),e.insertBefore(f.$,h.$.nextSibling),f=t[++i],y=l[--p];else if(x(h,d))C(h,d),e.insertBefore(h.$,f.$),h=t[--u],d=l[++r];else{for(c=-1,a=i;a<=u;++a)if(t[a]&&null!==t[a].p&&t[a].p===d.p){c=a;break}c>=0?(o=t[c],o.m!==d.m?s=S(t&&t[r],n,c):(C(o,d),t[c]=void 0,s=o.$),d=l[++r]):(s=S(t&&t[r],n,r),d=l[++r]),s&&f.$.parentNode.insertBefore(s,f.$)}i>u?O(e,null==l[p+1]?null:l[p+1].$,n,l,r,p):r>p&&M(t,i,u)})(l,s,t,o):null!==o?(null!==e.i&&(l.textContent=""),O(l,null,t,o,0,o.length-1)):null!==s&&M(s,0,s.length-1),n&&"svg"===i&&(n=!1)):e.i!==r&&(l.data=r)},L=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(L)},P=e=>Q(e).v,R=(e,t,n)=>{const l=P(e);return{emit:e=>E(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},E=(e,t,n)=>{const l=i.ce(t,n);return e.dispatchEvent(l),l},W=(e,t)=>{t&&!e.j&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.j=t)))},T=(e,t)=>{if(e.t|=16,!(4&e.t))return W(e,e.k),ue((()=>U(e,t)));e.t|=512},U=(e,t)=>{const n=e.S;let l;return t&&(l=z(n,"componentWillLoad")),l=N(l,(()=>z(n,"componentWillRender"))),N(l,(()=>A(e,n,t)))},A=async(e,t,n)=>{const l=e.v,s=l["s-rc"];n&&(e=>{const t=e.O,n=e.v,l=t.t,s=((e,t)=>{let n=f(t),l=le.get(n);if(e=11===e.nodeType?e:o,l)if("string"==typeof l){let t,s=u.get(e=e.head||e);s||u.set(e,s=new Set),s.has(n)||(t=o.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);D(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>F(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},D=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.v,o=n.O,i=n.M||y(null,null),r=(e=>e&&e.m===m)(l)?l:d(null,null,l);t=s.tagName,o.C&&(r.u=r.u||{},o.C.map((([e,t])=>r.u[t]=s[e]))),r.m=null,r.t|=4,n.M=r,r.$=i.$=s.shadowRoot||s,e=s["s-sc"],C(i,r)})(n,l)}catch(e){ee(e,n.v)}return null},F=e=>{const t=e.v,n=e.S,l=e.k;z(n,"componentDidRender"),64&e.t||(e.t|=64,V(t),z(n,"componentDidLoad"),e.L(t),l||q()),e.P(t),e.j&&(e.j(),e.j=void 0),512&e.t&&ae((()=>T(e,!1))),e.t&=-517},H=e=>{{const t=Q(e),n=t.v.isConnected;return n&&2==(18&t.t)&&T(t,!1),n}},q=()=>{V(o.documentElement),ae((()=>E(s,"appload",{detail:{namespace:"ezui"}})))},z=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){ee(e)}},N=(e,t)=>e&&e.then?e.then(t):t(),V=e=>e.classList.add("hydrated"),_=(e,t,n)=>{if(t.R){e.watchers&&(t.W=e.watchers);const l=Object.entries(t.R),s=e.prototype;if(l.map((([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(s,e,{get(){return((e,t)=>Q(this).T.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=Q(e),o=s.v,i=s.T.get(t),r=s.t,c=s.S;if(n=((e,t)=>null==e||p(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.R[t][0]),!(8&r&&void 0!==i||n===i)&&(s.T.set(t,n),c)){if(l.W&&128&r){const e=l.W[t];e&&e.map((e=>{try{c[e](n,i,t)}catch(e){ee(e,o)}}))}2==(18&r)&&T(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(s,e,{value(...t){const n=Q(this);return n.U.then((()=>n.S[e](...t)))}})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){i.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.C.push([e,s]),s}))}}return e},B=e=>{z(e,"connectedCallback")},G=(e,t={})=>{const n=[],l=t.exclude||[],r=s.customElements,a=o.head,u=a.querySelector("meta[charset]"),h=o.createElement("style"),p=[];let d,y=!0;Object.assign(i,t),i.l=new URL(t.resourcesUrl||"./",o.baseURI).href,e.map((e=>{e[1].map((t=>{const s={t:t[0],o:t[1],R:t[2],A:t[3]};s.R=t[2],s.C=[],s.W={};const o=s.o,a=class extends HTMLElement{constructor(e){super(e),Y(e=this,s),1&s.t&&e.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),y?p.push(this):i.jmp((()=>(e=>{if(0==(1&i.t)){const t=Q(e),n=t.O,l=()=>{};if(1&t.t)B(t.S);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){W(t,t.k=n);break}}n.R&&Object.entries(n.R).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=ne(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.W=s.watchers,_(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){ee(e)}t.t&=-9,t.t|=128,e(),B(t.S)}if(s.style){let e=s.style;const t=f(n);if(!le.has(t)){const l=()=>{};((e,t,n)=>{let l=le.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,le.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.k,i=()=>T(t,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){i.jmp((()=>{}))}componentOnReady(){return Q(this).D}};s.F=e[0],l.includes(o)||r.get(o)||(n.push(o),r.define(o,_(a,s,1)))}))})),h.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",h.setAttribute("data-styles",""),a.insertBefore(h,u?u.nextSibling:a.firstChild),y=!1,p.length?p.map((e=>e.connectedCallback())):i.jmp((()=>d=setTimeout(q,30)))},I=e=>{const t=new URL(e,i.l);return t.origin!==s.location.origin?t.href:t.pathname},J=e=>i.l=e,K=new WeakMap,Q=e=>K.get(e),X=(e,t)=>K.set(t.S=e,t),Y=(e,t)=>{const n={t:0,v:e,O:t,T:new Map};return n.U=new Promise((e=>n.P=e)),n.D=new Promise((e=>n.L=e)),e["s-p"]=[],e["s-rc"]=[],K.set(e,n)},Z=(e,t)=>t in e,ee=(e,t)=>(0,console.error)(e,t),te=new Map,ne=e=>{const t=e.o.replace(/-/g,"_"),n=e.F,l=te.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(te.set(n,e),e[t])),ee)},le=new Map,se=[],oe=[],ie=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&i.t?ae(ce):i.raf(ce))},re=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){ee(e)}e.length=0},ce=()=>{re(se),re(oe),(l=se.length>0)&&i.raf(ce)},ae=e=>r().then(e),ue=ie(oe,!0);export{m as H,I as a,G as b,R as c,H as f,P as g,d as h,r as p,X as r,J as s}
|
package/dist/ezui/p-9dfd537e.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as t}from"./p-7107d7ef.js";function s(t,s){return{type:"FORM/CHANGETAB",payload:{formId:t,index:s}}}function i(t,s){return{type:"FORM/CLEAREDITION",payload:{dataUnit:t,recordsLimit:s}}}function e(t,s){return{type:"FORM/COLLAPSEGROUP",payload:{collapseId:t,collapsed:s}}}function h(){return{type:"FORM/LOAD"}}function a(t){return{type:"FORM/DATALOADED",payload:{dataUnit:t}}}function r(t,s,i,e,h,a,r){return{type:"FORM/INVALIDFIELD",payload:{tabController:t,tabIndex:s,dataUnit:i,recordId:h,recordIndex:e,fieldName:a,errorMessage:r}}}function n(t,s){return{type:"FORM/SHOWHIDENAVBTN",payload:{buttonName:t,status:s}}}const o=(t,s)=>t.hist.present.currentTabIndex[s]||0,d=(t,s)=>t.hist.present.collapsedGroups[s],c=(t,s)=>t.hist.present.changes[s],u=(t,s)=>t.hist.present.currentRecordIndex[s]||0,l=(t,s)=>t.hist.present.newRecordIndex[s]||0,p=t=>t.nonhist.visibleButtons;class R{constructor(t,s,i="1",e=null){this.name=t,this.unitLabel=s,this.cardinality=i,this._children=[],this._fields=new Map,this._requiredFields=[],null!=e&&(e._children.push(this),this.parentDU=e,this.parentDUName=e.name)}set store(t){this._store=t}set fields(t){t&&t.forEach((t=>this.addFieldMetadata(t)))}addFieldMetadata(t){this._fields.set(t.name,t),t.required&&this._requiredFields.push(t)}getFieldMetadata(t){if(this._fields)return this._fields.get(t)}get requiredFields(){return this._requiredFields}isLoading(){return this._store.getState().nonhist.dataLoading[this.name]}hasChanges(){const t=this._store.getState();return void 0!==c(t,this.name)||l(t,this.name)>0}hasNext(){return u(this._store.getState(),this.name)<this.records.length-1}hasPrevious(){return u(this._store.getState(),this.name)>0}hasCurrentRecord(){return null!=this.getCurrentRecord()}previous(){this._store.dispatch({type:"FORM/NAVIGATE",payload:{dataUnit:this.name,limit:0,backward:!0}})}next(){this._store.dispatch({type:"FORM/NAVIGATE",payload:{dataUnit:this.name,limit:this.records.length,backward:!1}})}getValue(t){const s=this.getCurrentRecord();if(!s)return;const i=this.getRecordChanges(s);return i&&void 0!==i[t]?i[t]:s[t]||null}getErrorMessage(t){const s=this.getCurrentRecord();return((t,s,i,e)=>((t.nonhist.invalidFields[this.name]||{})[i]||{})[e]||"")(this._store.getState(),0,null==s?void 0:s.record__id,t)}changeValue(t,s){0==this.records.length&&this.insert(),this._changeDeboucing&&window.clearTimeout(this._changeDeboucing),this._changeDeboucing=window.setTimeout((()=>{const i=this.getCurrentRecord();this._store.dispatch(function(t,s,i,e){return{type:"FORM/CHANGEFIELD",payload:{dataUnit:t,recordId:s,fieldName:i,value:e}}}(this.name,i.record__id,t,s))}),100)}cancel(){this.records=this.records.filter((t=>!t.record__id.startsWith("NEW_"))),this._store.dispatch(i(this.name,this.records.length-1))}insert(){const t=this.records.length,s={record__id:"NEW_"+(l(this._store.getState(),this.name)+1)};this.bindToParent(s),this.records.push(s),this._store.dispatch(function(t,s){return{type:"FORM/INSERT",payload:{dataUnit:t,insertionIndex:s}}}(this.name,t))}buildChange(t){const s=c(this._store.getState(),this.name);let i;s&&(i=s[t.record__id]);let e=[];if(this._children.forEach((s=>{e=e.concat(s.getSubChanges(t.record__id))})),i||e.length>0){const s={__data__unit:this.name,__record__id:t.record__id,__sub__changes:e};return i&&Object.keys(i).forEach((()=>{})),s}}getSubChanges(t){const s=[];return this._records&&this._records.filter((s=>s.parent__record__id===t)).forEach((t=>{const i=this.buildChange(t);i&&s.push(i)})),s}getChangesToSave(){let t=[];return this._records&&this._records.forEach((s=>{const i=this.buildChange(s);i&&t.push(i)})),t}save(){if(!this.validateRecords("SAVE"))return;let s;this._store.dispatch({type:"FORM/SAVINGCHANGES",payload:{dataUnit:this.name}}),this.saveExecutor&&(s=this.saveExecutor(this.getChangesToSave())),s instanceof Promise?s.then((t=>this.processSaveResult(t))).catch((s=>{this._store.dispatch(a(this.name)),t.error("Falha ao tentar salvar",s)})):this.processSaveResult(s)}load(){let t;this._store.dispatch({type:"FORM/DATALOADING",payload:{dataUnit:this.name}}),this.loadExecutor&&(t=this.loadExecutor({dataUnit:this.name})),t instanceof Promise?t.then((t=>this.processLoadResult(t))):this.processLoadResult(t)}remove(){const t=u(this._store.getState(),this.name);let s;if(this._store.dispatch({type:"FORM/REMOVINGRECORD",payload:{dataUnit:this.name}}),this.removeExecutor){const t=this.getCurrentRecord();s=this.removeExecutor({dataUnit:this.name,recordId:t.record__id,record:t})}else s=!0;s&&(s instanceof Promise?s.then((s=>this.processRemoveResult(s,t))):this.processRemoveResult(s,t))}processSaveResult(t){t&&(t instanceof Array?t.forEach((t=>this.processSaveResult(t))):t.__data__unit===this.name&&"1"===this.cardinality&&(this.records=[this.buildRecordFromSaveResult(this.records[0],t)])),this._store.dispatch(i(this.name,this.records.length-1)),this._store.dispatch({type:"FORM/CHANGESSAVED",payload:{dataUnit:this.name}})}buildRecordFromSaveResult(t,s){const i=t?Object.assign({},t):{record__id:""};return Object.keys(s).forEach((t=>{t.startsWith("__")||(i[t]=s[t])})),i}processLoadResult(t){this.records=t,this._store.dispatch(i(this.name,this.records.length-1)),this._store.dispatch(a(this.name))}processRemoveResult(t,s){t&&(this.records.splice(s,1),this._store.dispatch(i(this.name,this.records.length-1))),this._store.dispatch({type:"FORM/RECORDREMOVED",payload:{dataUnit:this.name}})}set records(t){this._records=t,this.parentDU&&this._records.forEach((t=>this.bindToParent(t)))}bindToParent(t){if(this.parentDU){const s=this.parentDU.getCurrentRecord();s&&(t.parent__record__id=s.record__id)}}get records(){return this._records||(this._records=[]),this._records}getCurrentRecord(){const t=u(this._store.getState(),this.name);return this.records[t]}getRecordChanges(t){return void 0===t&&(t=this.getCurrentRecord()),t?((t,s,i)=>{const e=c(t,this.name);return e?e[i]:void 0})(this._store.getState(),0,t.record__id):void 0}validateRecords(s="UNKNOWN"){if(!this.recordsValidator)return!0;const i=c(this._store.getState(),this.name),e=[];this.records.forEach(((t,s)=>{const h=i?i[t.record__id]:void 0;h&&e.push(Object.assign(Object.assign(Object.assign({},t),h),{record__index:s,record__changedfields:Object.keys(h)}))}));const h=this.recordsValidator.validateRecords(this,e,s);return h.message&&t.info(h.message),h.isValid}}var O;!function(t){t.SEARCHING="SEARCHING",t.REQUIREMENT="REQUIREMENT",t.VISIBILITY="REQUIREMENT"}(O||(O={}));export{O as D,o as a,p as b,e as c,s as d,n as e,h as f,R as g,r as i,d as s}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as t,h as e,H as i,g as s}from"./p-8f4851a6.js";import"./p-da929c01.js";import{F as r}from"./p-ddd0ef12.js";import{C as a}from"./p-8b099482.js";let n=class{constructor(e){o(this,e),this.ezChange=t(this,"ezChange",7),this.enabled=!0,this.showSelectedValue=!1,this.showOptionValue=!1}internalUpdate(){this._inputElement&&(this._inputElement.value=this.getText()),this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}getText(){let o="";const t=this.getSelectedOption();return t&&(o=this.showSelectedValue?`${t.value} - ${t.label}`:t.label),o}getSelectedOption(){return"string"==typeof this.value||this.value instanceof String?this._visibleOptions.find((o=>o.value===this.value)):this.value}updateVisibleOptions(){let o=this._source||[];if(!this.searchMode&&this._criteria){const t=this._criteria.toUpperCase();o=o.filter((o=>o.label.toLocaleUpperCase().indexOf(t)>-1))}this._visibleOptions=[{value:void 0,label:""}].concat(o)}buildItem(o,t){return e("li",{class:t===this._preSelection?"item preselected":"item",id:`item_${o.value}`,onMouseDown:()=>this.selectOption(o),onMouseOver:()=>this._preSelection=void 0},e("span",{class:"item--label",title:o.label},o.label),this.showOptionValue?e("span",{class:"item--value",title:o.value},o.value):void 0)}showOptions(){this.enabled&&(this._floatingID=r.float(this._optionsList,this._listContainer,{autoClose:!0,top:this.errorMessage?"0px":"-17px"}),window.requestAnimationFrame((()=>{this._optionsList.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})))}hideOptions(){void 0!==this._floatingID&&r.close(this._floatingID),this._floatingID=void 0}isOptionsVisible(){return void 0!==this._floatingID&&r.isFloating(this._floatingID)}nextOption(){this.searchMode&&!this.isOptionsVisible()||(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection],!0))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection],!1)}scrollToOption(o,t){window.requestAnimationFrame((()=>{const e=this._optionsList.querySelector(`li#item_${o.value}`);if(e){const o=e.parentElement,i=o.getBoundingClientRect(),s=e.getBoundingClientRect();t&&s.bottom>i.bottom?o.scrollTop=s.top:!t&&s.top<i.top&&(o.scrollTop=0)}}))}selectCurrentOption(){void 0!==this._preSelection&&(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0)}selectOption(o){if(this.getSelectedOption()!==o){const t=(null==o?void 0:o.value)?o:void 0;this.value=t,this.errorMessage="",this.ezChange.emit(t)}else this.internalUpdate()}updateSource(o){o instanceof Promise?(o.then((o=>this.updateSource(o))),this.updateVisibleOptions()):(this._source=o,this.updateVisibleOptions())}loadOptions(o,t=""){this._criteria=t,this.updateSource(this.optionLoader?this.optionLoader({mode:o,argument:t}):this.options)}cancelPreselection(){!this._inputElement.value&&this.value?this.selectOption(void 0):this.internalUpdate()}componentWillLoad(){if(void 0===this.options){this.options=[];const o=this.el.querySelectorAll("option");o&&o.forEach((o=>{let t=o.innerText,e=o.getAttribute("value");e||(e=t),this.options.push({label:t,value:e}),o.hidden=!0}))}this.searchMode?this.updateSource([]):this.loadOptions("PRELOAD")}componentDidRender(){void 0===this._floatingID&&this._optionsList.remove()}componentDidLoad(){a.applyVarsTextInput(this.el,this._inputElement)}onTextInputChangeHandler(o){this._criteria||(this._inputElement.value=o.data);const t=o.target.value;this._criteria=t,this._criteria&&(this.searchMode?(this._changeDeboucingTimeout&&window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions("PREDICTIVE",t)}),200)):this.updateVisibleOptions(),this.showOptions())}onTextInputClickHandler(){this.searchMode||this.showOptions()}keyDownHandler(o){switch(o.key){case"ArrowDown":this.nextOption();break;case"ArrowUp":this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection()}o.stopPropagation()}onTextInputFocusOutHandler(){this.cancelPreselection()}render(){return e(i,null,e("ez-text-input",{ref:o=>this._inputElement=o,enabled:this.enabled,onInput:o=>this.onTextInputChangeHandler(o),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onEzChange:o=>o.stopPropagation(),onKeyDown:o=>this.keyDownHandler(o),label:this.label,value:this.getText(),errorMessage:this.errorMessage},e("button",this.searchMode?{disabled:!this.enabled,tabindex:-1,class:"btn-open-search",onClick:()=>{this.loadOptions("ADVANCED")},slot:"leftIcon"}:{disabled:!this.enabled,tabindex:-1,class:"btn-open-options",slot:"rightIcon",onClick:()=>this.showOptions()})),e("section",{class:"list-container",ref:o=>this._listContainer=o},e("div",{class:"options-list",ref:o=>this._optionsList=o},this._visibleOptions.map(((o,t)=>this.buildItem(o,t))))))}get el(){return s(this)}static get watchers(){return{value:["internalUpdate"]}}};n.style=':host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn-search--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-search-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-search-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__btn-options--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-options-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-options-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #919191);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium));--ez-combo-box__drop-down-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="16px"><path d="M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z"/></svg>\');--ez-combo-box__search-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="22px" width="22px"><path d="m 9.4,2.3 c 4.1,0 7.4,3.2 7.4,7.2 0,1.8 -0.7,3.4 -1.8,4.7 l 0.3,0.3 h 0.9 l 5.7,5.6 -1.7,1.7 -5.7,-5.6 V 15.3 L 14.3,15 C 13,16.1 11.3,16.7 9.5,16.7 5.3,16.7 2,13.5 2,9.5 2,5.5 5.3,2.3 9.4,2.3 m 0,2.2 c -2.9,0 -5.1,2.2 -5.1,5 0,2.8 2.3,5 5.1,5 2.8,0 5.1,-2.2 5.1,-5 0,-2.8 -2.2,-5 -5.1,-5 z"/></svg>\');--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}.list-container{position:relative;width:100%}.options-list{box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-combo-box--background-color--xlight);padding:var(--ez-combo-box--space--small);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);scroll-behavior:smooth;max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small));overflow:auto}.item{text-align:left;display:flex;justify-content:space-between;align-items:center;border-radius:var(--ez-combo-box--border-radius-small);padding:0 var(--ez-combo-box--space--small);list-style-type:none;min-height:var(--ez-combo-box__list-height)}.item--label{text-align:left;flex-basis:85%;flex-grow:1;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item--value{text-align:right;flex-basis:15%;flex-grow:0;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn-open-options{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-options:disabled{cursor:unset}.btn-open-options::after{content:\'\';display:flex;background-color:var(--ez-combo-box__btn-options--background-color);width:16px;height:16px;-webkit-mask-image:var(--ez-combo-box__drop-down-image);mask-image:var(--ez-combo-box__drop-down-image)}.btn-open-options:disabled:after{background-color:var(--ez-combo-box__btn-options-disabled--background-color)}.btn-open-options:enabled:hover::after{background-color:var(--ez-combo-box__btn-options-hover--background-color)}.btn-open-search{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-search:disabled{cursor:unset}.btn-open-search::after{content:\'\';display:flex;background-color:var(--ez-combo-box__btn-search--background-color);width:22px;height:22px;-webkit-mask-image:var(--ez-combo-box__search-image);mask-image:var(--ez-combo-box__search-image)}.btn-open-search:disabled:after{background-color:var(--ez-combo-box__btn-search-disabled--background-color)}.btn-open-search:enabled:hover::after{background-color:var(--ez-combo-box__btn-search-hover--background-color)}';export{n as ez_combo_box}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as n,g as a}from"./p-8f4851a6.js";import{T as r}from"./p-da929c01.js";import{D as s}from"./p-c89629eb.js";import{C as o}from"./p-8b099482.js";let c=class{constructor(i){t(this,i),this.ezChange=e(this,"ezChange",7),this.enabled=!0,this.showSeconds=!1}setLabel(){this._textInput.label=this.label}setErrorMessage(){this._textInput.errorMessage=this.errorMessage}applyValueToInput(){this._textInput&&(this._textInput.value=this.getTextValue(this.value))}onChangeKeyDown(t){const e=this._textInput.shadowRoot.querySelector("input");if("H"===t.key||"h"===t.key)this.changeValue(new Date);else if(t.shiftKey&&"Tab"===t.key){if(e.selectionStart>0){let i=e.value.lastIndexOf(" ",e.selectionStart);-1!==i&&(e.setSelectionRange(0,i),t.preventDefault())}}else if("Tab"===t.key&&e.value.length!==e.selectionEnd){let i=e.value.indexOf(" ",e.selectionEnd);i=-1===i?e.selectionEnd:i+1,e.setSelectionRange(i,e.value.length),t.preventDefault()}}onFocused(){const t=this._textInput.shadowRoot.querySelector("input");if(t.selectionStart!==t.selectionEnd){let e=t.value.indexOf(" ",t.selectionStart);e=-1===e?t.value.length:e,t.setSelectionRange(0,e)}}onClicked(){const t=this._textInput.shadowRoot.querySelector("input");let e=t.value.lastIndexOf(" ",t.selectionEnd);e=-1===e?0:e+1,e=e>t.selectionEnd?0:e;let i=0===e?t.value.indexOf(" "):t.value.length;t.setSelectionRange(e,i)}changeValue(t){this._textInput.errorMessage="",t!==this.value&&(this.value=t,this.ezChange.emit())}showCalendar(){this._calendar.fitVertical(this._textInput.errorMessage?0:-17,this._elem.clientHeight),this._calendar.style.visibility="inherit"}parseDate(){const t=this._textInput.value,e=t&&t.length>0?t.split(" "):[],i=e.length>0?e[0]:t,n=r.prepareValue(e[1]?e[1]:"",this.showSeconds),a=s.strToDate(i+(n&&" "+n));a||!t?this.changeValue(this.value===a?this.value:a):this._textInput.errorMessage="O valor digitado não é uma data válida"}getTextValue(t){return t?new Intl.DateTimeFormat("pt-BR",this.showSeconds?{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}:{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"}).format(t):null}componentDidLoad(){o.applyVarsTextInput(this._elem,this._textInput)}render(){return i(n,null,i("ez-text-input",{ref:t=>this._textInput=t,onBlur:()=>this.parseDate(),onKeyDown:t=>{this.onChangeKeyDown(t)},label:this.label,onEzChange:t=>t.stopPropagation(),value:this.getTextValue(this.value),restrict:"0123456789/: ",enabled:this.enabled,errorMessage:this.errorMessage,onFocus:()=>this.onFocused(),onClick:()=>this.onClicked()},i("button",{disabled:!this.enabled,tabindex:-1,class:"btn-open-cal",onClick:()=>this.showCalendar(),slot:"leftIcon"})),i("ez-calendar",{onEzChange:t=>{this.changeValue(this._calendar.value),t.stopPropagation()},floating:!0,ref:t=>this._calendar=t,time:!0,showSeconds:this.showSeconds}))}get _elem(){return a(this)}static get watchers(){return{label:["setLabel"],errorMessage:["setErrorMessage"],value:["applyValueToInput"]}}};c.style=':host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="15px"><path d="M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z"/></svg>\')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:unset}.btn-open-cal::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}';export{c as ez_date_time_input}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as a,g as o,f as r}from"./p-8f4851a6.js";import"./p-da929c01.js";import{D as l}from"./p-c89629eb.js";import{C as s}from"./p-8b099482.js";import{A as n}from"./p-7107d7ef.js";let d=class{constructor(i){t(this,i),this.ezChange=e(this,"ezChange",7),this.value=!1,this.headerSize="small",this.iconPlacement="left"}observeValue(){this.ezChange.emit()}async showHide(){this.value=!this.value}render(){return i(a,null,"right"==this.iconPlacement?i("div",{class:"collapsible-box__title"},i("label",{class:("right"==this.iconPlacement?"collapsible-box__label--icon-right ":"collapsible-box__label ")+(this.headerSize?"font--"+this.headerSize:""),onClick:()=>this.showHide(),title:this.label},this.label),i("button",{class:this.value?"collapsible-box__btn collapsible-box__btn--collapsed collapsible-box__btn--"+this.headerSize:"collapsible-box__btn collapsible-box__btn--"+this.headerSize,onClick:()=>this.showHide()})):i("div",{class:"collapsible-box__title"},i("button",{class:this.value?"collapsible-box__btn collapsible-box__btn--collapsed collapsible-box__btn--"+this.headerSize:"collapsible-box__btn collapsible-box__btn--"+this.headerSize,onClick:()=>this.showHide()}),i("label",{class:("right"==this.iconPlacement?"collapsible-box__label--icon-right ":"collapsible-box__label ")+(this.headerSize?"font--"+this.headerSize:""),onClick:()=>this.showHide(),title:this.label},this.label)),this.value?null:i("slot",null))}static get watchers(){return{value:["observeValue"]}}};d.style=':host{--ez-collapsible-box--height:42px;--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box__btn--image--xsmall:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="12px" width="7.5px"><path d="M 0,10.56 4.5967752,6.0000006 0,1.3800006 1.4516132,0 7.5,6.0000006 1.4516132,12 Z"/></svg>\');--ez-collapsible-box__btn--image--small:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="14px" width="8.68px"><path d="M 0,12.32 5.3200012,7.0000007 0,1.6100007 1.6800004,0 8.68,7.0000007 1.6800004,14 Z"/></svg>\');--ez-collapsible-box__btn--image--medium:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z"/></svg>\');--ez-collapsible-box__btn--image--large:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="18px" width="11.25px"><path d="M 0,15.84 6.8951628,9.0000009 0,2.0700009 2.1774198,0 11.25,9.0000009 2.1774198,18 Z"/></svg>\');--ez-collapsible-box__btn--image--xlarge:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="20px" width="12.5px"><path d="M 0,17.6 7.661292,10.000001 0,2.300001 2.4193553,0 12.5,10.000001 2.4193553,20 Z"/></svg>\');--ez-collapsible-box__btn--fill:var(--ez-collapsible-box--color);--ez-collapsible-box__btn--width:10px;--ez-collapsible-box__btn--height:16px;display:flex;flex-wrap:wrap;width:100%}.collapsible-box__title{width:100%;align-self:center;display:flex;box-sizing:border-box}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;width:100%;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight);color:var(--ez-collapsible-box--color)}.collapsible-box__label--icon-right{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight);color:var(--ez-collapsible-box--color)}.collapsible-box__btn{outline:none;border:none;background-color:unset;cursor:pointer;padding:1px 6px}.collapsible-box__btn::after{content:\'\';display:flex;background-color:var(--ez-collapsible-box__btn--fill);width:var(--ez-collapsible-box__btn--width);height:var(--ez-collapsible-box__btn--height);transition:transform var(--transition);transform:rotate(90deg)}.collapsible-box__btn--xsmall::after{width:7.5px;height:12px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--xsmall);mask-image:var(--ez-collapsible-box__btn--image--xsmall)}.collapsible-box__btn--small::after{width:8.68px;height:14px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--small);mask-image:var(--ez-collapsible-box__btn--image--small)}.collapsible-box__btn--medium::after{width:10px;height:16px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--medium);mask-image:var(--ez-collapsible-box__btn--image--medium)}.collapsible-box__btn--large::after{width:11.25px;height:18px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--large);mask-image:var(--ez-collapsible-box__btn--image--large)}.collapsible-box__btn--xlarge::after{width:12.5px;height:20px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--xlarge);mask-image:var(--ez-collapsible-box__btn--image--xlarge)}.collapsible-box__btn--collapsed::after{transform:rotate(0deg)}.font--xsmall{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--xlarge{font-size:20px}';let h=class{constructor(i){t(this,i),this.ezChange=e(this,"ezChange",7),this.enabled=!0}setLabel(){this._textInput.label=this.label}setErrorMessage(){this._textInput.errorMessage=this.errorMessage}applyValueToInput(){this._textInput&&(this._textInput.value=this.getTextValue(this.value))}changeValue(t){t=null==t?null:l.clearTime(t),this._textInput.errorMessage="",t!==this.value&&(this.value=t,this.ezChange.emit())}showCalendar(){this.parseDate(),this._calendar.value=this.value,this._calendar.fitVertical(this._textInput.errorMessage?0:-17,this._elem.clientHeight)}hideCalendar(){this.changeValue(this._calendar.value),this._calendar.hide()}parseDate(){const t=this._textInput.value,e=l.strToDate(t);e||!t?this.changeValue(this.value===e?this.value:e):this._textInput.errorMessage="O valor digitado não é uma data válida"}getTextValue(t){return t?new Intl.DateTimeFormat("pt-BR").format(t):null}componentDidLoad(){s.applyVarsTextInput(this._elem,this._textInput)}render(){return i(a,null,i("ez-text-input",{ref:t=>this._textInput=t,onBlur:()=>this.parseDate(),onKeyDown:t=>{"H"!==t.key&&"h"!==t.key||this.changeValue(new Date)},label:this.label,onEzChange:t=>t.stopPropagation(),value:this.getTextValue(this.value),restrict:"0123456789/",enabled:this.enabled,errorMessage:this.errorMessage},i("button",{disabled:!this.enabled,tabindex:-1,class:"btn-open-cal",onClick:()=>this.showCalendar(),slot:"leftIcon"})),i("ez-calendar",{onEzChange:t=>{this.hideCalendar(),t.stopPropagation()},floating:!0,ref:t=>this._calendar=t}))}get _elem(){return o(this)}static get watchers(){return{label:["setLabel"],errorMessage:["setErrorMessage"],value:["applyValueToInput"]}}};h.style=':host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="15px"><path d="M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z"/></svg>\')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:unset}.btn-open-cal::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}';let c=class{constructor(i){t(this,i),this.ezChange=e(this,"ezChange",7),this.showPopup=e(this,"showPopup",7),this.enabled=!0,this.showSelectedValue=!0,this.showOptionValue=!0}updateValue(){this._comboElement&&(this._comboElement.value=this.value)}onComboChange(t){t.stopPropagation(),this.value=t.detail,this.ezChange.emit(t.detail)}componentDidLoad(){s.applyVarsTextInput(this._elem,this._comboElement)}render(){return i("ez-combo-box",{ref:t=>this._comboElement=t,value:this.value,label:this.label,enabled:this.enabled,errorMessage:this.errorMessage,optionLoader:this.optionLoader,searchMode:!0,onEzChange:t=>this.onComboChange(t),showSelectedValue:this.showSelectedValue,showOptionValue:this.showOptionValue})}get _elem(){return o(this)}static get watchers(){return{value:["updateValue"]}}};c.style=":host{width:100%}";let p=class{constructor(i){t(this,i),this.ezChange=e(this,"ezChange",7),this.enabled=!0,this.rows=4}showError(){"string"==typeof this.errorMessage&&""!==this.errorMessage?(this._container.classList.add("hasError"),this._messageBoxElem.classList.add("hasError")):(this._container.classList.remove("hasError"),this._messageBoxElem.classList.remove("hasError"))}updateInputValue(){this._inputElem.value=this.value,this.handleChange(),this.adjustFloatingLabel(),this.ezChange.emit(this.value)}adjustFloatingLabel(){if(this.label){const t=this.value&&this.value.toString().length>0,e=this._labelElem.classList.contains("textarea__label--floated");t||this.isFocused()?e||this._labelElem.classList.add("textarea__label--floated"):e&&this._labelElem.classList.remove("textarea__label--floated")}}isFocused(){return null!==this._hostElement.shadowRoot.activeElement}async setFocus(){this._inputElem.focus()}async setBlur(){this._inputElem.blur()}handleFocusout(){this.adjustFloatingLabel(),this._container&&this._container.classList.contains("textarea--focus")&&this._container.classList.remove("textarea--focus")}handleChange(){this.errorMessage="",this.value=this._inputElem.value}handleFocus(){this.label&&this._labelElem&&!this._labelElem.classList.contains("textarea__label--floated")&&this._labelElem.classList.add("textarea__label--floated"),this._container&&!this._container.classList.contains("textarea--focus")&&this._container.classList.add("textarea--focus")}componentDidLoad(){this.showError(),this.adjustFloatingLabel()}render(){return i(a,null,i("div",{class:"textarea",ref:t=>this._container=t},this.label?i("label",{ref:t=>this._labelElem=t,class:this.enabled?"textarea__label":"textarea__label textarea__label--disabled",onClick:()=>this._inputElem.focus(),title:this.label},this.label):null,i("textarea",{onFocus:()=>this.handleFocus(),ref:t=>this._inputElem=t,value:this.value,disabled:!this.enabled,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()},onKeyDown:t=>t.stopPropagation(),rows:this.rows})),i("span",{class:"message-box",ref:t=>this._messageBoxElem=t,title:this.errorMessage},this.errorMessage))}get _hostElement(){return o(this)}static get watchers(){return{errorMessage:["showError"],value:["updateInputValue"]}}};p.style=":host{--text-area--width:100%;--text-area--border-radius:var(--border--radius-medium, 12px);--text-area--font-size:var(--text--medium, 14px);--text-area--font-family:var(--font-pattern, Arial);--text-area--font-weight:var(--text-weight--large, 500);--text-area--color:var(--title--primary, #000);--text-area__input--background-color:var(--background--medium, #e0e0e0);--text-area__input--border:var(--border--medium, 2px solid);--text-area__input--border-color:var(--text-area__input--background-color);--text-area__input--focus--border-color:var(--color--primary, #008561);--text-area__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--text-area__input--disabled--color:var(--text--disable, #AFB6C0);--text-area__input--error--border-color:#CC2936;--text-area__message_box--font-size:var(--text--small, 12px);--text-area__message_box--info--color:var(--color--success, #22085d);--text-area__message_box--error--color:var(--color--error, #FF0000);--text-area__label--floating--top:6px;--text-area__label--padding-top:12px;--text-area__label--padding-left:14px;--text-area__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--text-area--width)}textarea{box-sizing:border-box;border:none;resize:none;margin-top:calc(var(--space--medium, 12px) + 4px);width:100%;font-weight:var(--text-weight--large, 600);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);color:var(--text-area--color);padding:0;background:none}textarea:focus{outline:none}textarea:disabled{background-color:transparent;color:var(--text-area__input--disabled--color)}.textarea{width:100%;box-sizing:border-box;padding-left:var(--space--medium);padding-right:var(--space--extra-small);border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--border-color);background-color:var(--text-area__input--background-color)}.textarea--focus{border-color:var(--text-area__input--focus--border-color)}.textarea.hasError{color:var(--text-area--color);border-color:var(--text-area__input--error--border-color)}.message-box{min-height:16px;min-width:100%;margin-top:2px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--text-area--font-family);font-size:var(--text-area__message_box--font-size);color:var(--text-area__message_box--info--color)}.hasError{color:var(--text-area__message_box--error--color)}.textarea__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--text-area__label--padding-right));left:var(--text-area--space--medium);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color);top:var(--text-area__label--padding-top);left:var(--text-area__label--padding-left);padding-right:var(--text-area__label--padding-right)}.textarea__label--floated{font-family:var(--text-area--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--text-area__label--floating--top)}.textarea__label--disabled{color:var(--text-area__input--disabled--color)}";class b{constructor(t){this.file=t,this.size=t.size,this.name=t.name}abortUpload(){this._uploadingXhr&&(this._aborted=!0,this._uploadingXhr.abort(),this._uploadingXhr=void 0)}isUploading(){return void 0!==this._uploadingXhr}async upload(t,e,i){return new Promise(((a,o)=>{const r=new XMLHttpRequest;this._uploadingXhr=r,this._aborted=!1,this.progress=0,r.upload.onprogress=t=>{const e=t.loaded,a=t.total;this.progress=~~(e/a*100),i(this,e,a)},r.onreadystatechange=()=>{if(4==r.readyState){this._uploadingXhr=void 0;const t=r.status;this._aborted||(0===t?o("Servidor indisponível"):t>=500?o("Erro inesperado no servidor"):t>=400&&o("Operação não permitida"));const e=r.response;e&&a(JSON.parse(e))}},r.ontimeout=()=>{o("Tempo limite de transferência atingido.")};const l=new FormData;l.append("ARQUIVO",this.file,this.file.name),r.open("POST",t,!0),e&&e.forEach(((t,e)=>r.setRequestHeader(e,t))),r.send(l)}))}async delete(t,e,i){return new Promise(((a,o)=>{const r=new XMLHttpRequest;r.onreadystatechange=()=>{4==r.readyState&&(0===r.status?o("Servidor indisponível"):r.status>=500?o("Erro inesperado no servidor"):r.status>=400&&o("Operação não permitida"),a(!0))},r.ontimeout=()=>{o("Tempo limite de remoção atingido.")},r.open("DELETE",e,!0),i&&i.forEach(((t,e)=>r.setRequestHeader(e,t))),r.send(JSON.stringify(t))}))}}let x=class{constructor(i){t(this,i),this.ezChange=e(this,"ezChange",7),this._filePointers=new Map,this.enabled=!0}changeValue(t){t!==this._updatingValue&&(this._filePointers.forEach((t=>{this.isRemoteFile(t)&&t.abortUpload()})),this._filePointers=new Map,this.updateFilePointers()),this._updatingValue=void 0}updateFilePointers(){this.value&&this.value.forEach((t=>this._filePointers.set(t.name,t)))}normalizeRequestHeaders(){if(this._requestHeaders=new Map,"string"==typeof this.requestHeaders)try{this.requestHeaders=JSON.parse(this.requestHeaders)}catch(t){this.requestHeaders=void 0}for(var t in this.requestHeaders)this._requestHeaders.set(t,this.requestHeaders[t])}async addFiles(t){if(this.maxFiles>0){let e=this._filePointers.size;if(t.forEach((t=>{this._filePointers.has(t.name)||e++})),e>this.maxFiles)return void this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`)}Array.prototype.forEach.call(t,this.addFile.bind(this))}async addFile(t){const e=this._filePointers.get(t.name);e?n.confirm("Substituir arquivo",`Já existe um arquivo chamado "${t.name}". Deseja substituí-lo?`).then((i=>{i&&(this.isRemoteFile(e)&&e.abortUpload(),this.doAddFile(t))})):this.doAddFile(t)}async doAddFile(t){if(this.validateFile(t)){const e=new b(t);this._filePointers.set(t.name,e),e.upload(this.urlUpload,this._requestHeaders,(t=>this.updateFeedback(t))).then((t=>t.forEach((t=>this.finishUpload(t))))).catch((t=>this.showError(t))),r(this)}}finishUpload(t){this._filePointers.set(t.name,t),this.updateValue()}updateValue(){this._updatingValue=[],this._filePointers.forEach((t=>{this.isRemoteFile(t)||this._updatingValue.push(t)})),this.value=this._updatingValue,this.ezChange.emit(this.value)}buildProgressId(t){return`PROGRESS_${t.name.replace(/[^a-z0-9_]/gi,"_")}_${t.file.lastModified}`}updateFeedback(t){window.requestAnimationFrame((()=>{if(this._host){const e=this._host.shadowRoot.querySelector("#"+this.buildProgressId(t));e&&(e.value=t.progress)}}))}validateFile(t){return!this._filePointers.has(t.name)&&this.maxFiles>0&&this._filePointers.size>=this.maxFiles?(this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`),!1):0===t.size?(this.showError(`Erro de permissão: O arquivo "${t.name}" não pode ser enviado.`),!1):this.urlUpload?!(this.maxFileSize>=0&&t.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(t){n.alert("Enviando arquivo",t)}formatBytes(t,e=1){if(0===t)return"0 Bytes";const i=e<0?0:e,a=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,a)).toFixed(i))+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][a]}onFileInputChange(t){this.addFiles(Array.from(t.target.files)),this._fileInput.value=""}isRemoteFile(t){return"file"in t}removeFromList(t){this._filePointers.delete(t),this.updateValue()}removeFile(t){const e=this._filePointers.get(t);if(this.isRemoteFile(e))e.abortUpload(),this.removeFromList(t);else if(this.urlDelete){const i=new b(null);this._filePointers.set(e.name,i),i.delete(e,this.urlDelete,null).then((()=>this.removeFromList(t))).catch((t=>this.showError(t)))}else this.removeFromList(t)}openFilesDialog(){this.enabled&&this._fileInput.click()}componentDidLoad(){this.enabled&&this._dropZone&&window.FileList&&window.File&&(this._dropZone.addEventListener("dragover",(t=>{t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy",this._dropZone.style.background="#c2dbff"})),this._dropZone.addEventListener("drop",(t=>{t.stopPropagation(),t.preventDefault(),this.addFiles(Array.from(t.dataTransfer.files)),this._dropZone.style.background=""})),this._dropZone.addEventListener("dragleave",(()=>{this._dropZone.style.background=""})))}componentWillRender(){this.value&&this._filePointers.size<this.value.length&&this.updateFilePointers()}render(){return i("div",{ref:t=>this._dropZone=t,class:this.evalDisabledClass("iu","background--disabled")},i("div",{class:"iu__container",onClick:()=>this.openFilesDialog()},i("div",{class:"iu_header"},this.label?i("label",{class:this.evalDisabledClass("iu__label","text--disabled"),title:this.label},this.label):null,i("div",{class:this.evalDisabledClass("iu__icon-label","mouse-pointer--disabled")},i("button",{class:"iu__file-icon",disabled:!this.enabled}),i("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.buildFooter()),i("input",{ref:t=>this._fileInput=t,onChange:t=>this.onFileInputChange(t),type:"file",multiple:!0,hidden:!0}))}buildFooter(){if(0===this._filePointers.size)return null;const t=[];return this._filePointers.forEach((e=>t.push(this.buildFileItem(e)))),i("div",{class:"iu__footer"},t)}buildFileItem(t){const e=t.name,a=Number(t.progress),o=t.downloadURL,r=`${e} (${this.formatBytes(t.size)})`;return i("div",{class:"iu__item",key:e,onClick:t=>t.stopPropagation()},i("div",{class:"iu__item-label modificador"},i("div",{title:r,class:"col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle"},o?i("a",{href:o,download:!0},r):r)),isNaN(a)?null:i("div",{class:"col col--sd-4 col--stretch align--middle"},i("progress",{id:this.buildProgressId(t),value:a,max:"100"})),this.enabled?i("div",{class:"col col--stretch align--middle"},i("button",{class:"btn-cancel ",onClick:()=>this.removeFile(e)})):null)}evalDisabledClass(t,e){return this.enabled?t:`${t} ${e}`}get _host(){return o(this)}static get watchers(){return{value:["changeValue"],requestHeaders:["normalizeRequestHeaders"]}}};x.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--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;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}.text{font-family:"Sora", "Algerian";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--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;padding:var(--ez-upload--padding--large) 0px;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}.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%}}';let u=class{constructor(e){t(this,e)}render(){return i(a,null)}};u.style=":host{display:flex;width:100%;height:42px;border-radius:12px;background:var(--background--medium);background-image:linear-gradient(to right, var(--background--medium) 0%, var(--background--strong) 20%, var(--background--medium) 40%, var(--background--medium) 100%);background-repeat:no-repeat;background-size:800px 1000px;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:placeholderShimmer;animation-timing-function:linear}@keyframes placeholderShimmer{0%{background-position:-800px 0}100%{background-position:800px 0}}";export{d as ez_collapsible_box,h as ez_date_input,c as ez_search,p as ez_text_area,x as ez_upload,u as place_holder}
|
package/dist/ezui/p-c89629eb.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class e{static clearTime(t,r=!0){const d=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0);return r?e.adjustDLST(d):d}static strToDate(t,r=!0,d=!1){let a;if(a=d?/^(1[0-2]|0[1-9]|[1-9])[^\d]?(\d{2}|\d{4})(?:\s(\d{1,2}):(\d{1,2}):?(\d{0,2}))?$/.exec(t):/^(3[01]|[1-2]\d|0[1-9]|[1-9])[^\d]?(1[0-2]|0[1-9]|[1-9])[^\d]?(\d{2}|\d{4})(?:\s(\d{1,2}):(\d{1,2}):?(\d{0,2}))?$/.exec(t),!a)return;var s=d?1:Number(a[1]),u=Number(a[d?1:2]),n=Number(a[d?2:3]),m=Number(a[d?3:4]||0),b=Number(a[d?4:5]||0),c=Number(a[d?5:6]||0);n<100&&(n+=n<30?2e3:1900);let D=new Date(n,u-1,s,m,b,c,0);return!0!==r||d||0!=m||(D=e.adjustDLST(D)),D}static adjustDLST(e){return 23==e.getHours()?new Date(e.getFullYear(),e.getMonth(),e.getDate()+1,1,0,0,0):e}}export{e as D}
|