@sankhyalabs/ezui 1.1.129 → 1.1.132
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-button.cjs.entry.js +10 -12
- package/dist/cjs/ez-form.cjs.entry.js +14 -3
- package/dist/cjs/ez-grid.cjs.entry.js +22 -12
- package/dist/cjs/ez-list.cjs.entry.js +11 -0
- package/dist/cjs/ez-modal.cjs.entry.js +6 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +10 -8
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/grid-config.cjs.entry.js +44 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-button/ez-button.css +73 -28
- package/dist/collection/components/ez-button/ez-button.js +15 -18
- package/dist/collection/components/ez-form/DataBinder.js +13 -2
- package/dist/collection/components/ez-form/ez-form.js +1 -1
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +6 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +10 -4
- package/dist/collection/components/ez-grid/ez-grid.js +22 -12
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +44 -2
- package/dist/collection/components/ez-list/ez-list.js +27 -0
- package/dist/collection/components/ez-modal/ez-modal.js +20 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +1 -1
- package/dist/collection/components/ez-text-input/ez-text-input.js +10 -8
- package/dist/custom-elements/index.js +119 -40
- package/dist/esm/ez-button.entry.js +10 -12
- package/dist/esm/ez-form.entry.js +14 -3
- package/dist/esm/ez-grid.entry.js +23 -13
- package/dist/esm/ez-list.entry.js +11 -0
- package/dist/esm/ez-modal.entry.js +6 -0
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +10 -8
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/grid-config.entry.js +44 -2
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-27db8fba.entry.js +1 -0
- package/dist/ezui/p-48ba92b2.entry.js +1 -0
- package/dist/ezui/p-4ded39c2.entry.js +1 -0
- package/dist/ezui/{p-2d165ca8.entry.js → p-a0e6f47b.entry.js} +7 -7
- package/dist/ezui/p-c8f9b691.entry.js +1 -0
- package/dist/ezui/{p-47fe4273.entry.js → p-cfa7378a.entry.js} +1 -1
- package/dist/ezui/p-d5c93280.entry.js +1 -0
- package/dist/ezui/p-d9bb2a96.entry.js +1 -0
- package/dist/types/components/ez-button/ez-button.d.ts +3 -3
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +4 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +3 -3
- package/dist/types/components/ez-grid/subcomponents/gridconfig/grid-config.d.ts +1 -0
- package/dist/types/components/ez-list/ez-list.d.ts +4 -0
- package/dist/types/components/ez-modal/ez-modal.d.ts +5 -0
- package/dist/types/components.d.ts +13 -4
- package/package.json +1 -1
- package/dist/ezui/p-495cdb4c.entry.js +0 -1
- package/dist/ezui/p-6d39b7ea.entry.js +0 -1
- package/dist/ezui/p-7d5b2ebf.entry.js +0 -1
- package/dist/ezui/p-c6b2b2e5.entry.js +0 -1
- package/dist/ezui/p-ef8f1275.entry.js +0 -1
- package/dist/ezui/p-f65302bb.entry.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLElement as HTMLElement$1, createEvent, h, forceUpdate, Host, getAssetPath, setAssetPath, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
2
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
3
|
-
import { FloatingManager, DateUtils, TimeFormatter, UserInterface, Action, ApplicationContext, DataUnitAction, DataUnit, DataType, StringUtils,
|
|
3
|
+
import { FloatingManager, DateUtils, TimeFormatter, UserInterface, Action, ApplicationContext, DataUnitAction, DataUnit, NumberUtils, DataType, StringUtils, MaskFormatter } from '@sankhyalabs/core';
|
|
4
4
|
import { UserInterface as UserInterface$1, SortMode } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
5
5
|
|
|
6
6
|
const ezActionChipCss = ":host{--ez-action-chip--height:36px;--ez-action-chip--border-radius:var(--border--radius-large, 24px);--ez-action-chip__border:1px solid;--ez-action-chip__border-color-strokes:var(--color--strokes, #DCE0E8);--ez-action-chip--font-size:var(--text--medium, 14px);--ez-action-chip--font-family:var(--font-pattern, Arial);--ez-action-chip--font-weight:var(--text-weight--large, 500);--ez-action-chip__label--title--primary:var(--title--primary, #919191);--ez-action-chip__label-color--disable-secondary:var(--color--disable-secondary, #F2F5F8);--ez-action-chip__label__default--background-color--hover:var(--color--primary-200, #f2faf8);--ez-action-chip__label__default--border-color--hover:var(--color--primary-600, #007a5a)}.label__container{width:fit-content;display:flex;flex-wrap:wrap;position:relative;background-color:#FFFFFF;align-items:center;align-self:center;cursor:pointer;color:var(--ez-action-chip__label--title--primary);fill:var(--ez-action-chip__label--title--primary);border:var(--ez-action-chip__border);border-radius:var(--ez-action-chip--border-radius);border-color:var(--ez-action-chip__border-color-strokes);padding-right:var(--space--medium, 12px);padding-left:var(--space--medium, 12px)}.label__container:hover{border-color:var(--ez-action-chip__label__default--border-color--hover);background-color:var(--ez-action-chip__label__default--background-color--hover)}label{display:flex;align-items:center;font-weight:var(--text-weight--large, 600);cursor:pointer;height:var(--ez-action-chip--height);font-family:var(--ez-action-chip--font-family);font-size:var(--ez-action-chip--font-size)}";
|
|
@@ -45,7 +45,7 @@ let EzApplication$1 = class extends HTMLElement$1 {
|
|
|
45
45
|
static get style() { return ezApplicationCss; }
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover
|
|
48
|
+
const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}";
|
|
49
49
|
|
|
50
50
|
let EzButton$1 = class extends HTMLElement$1 {
|
|
51
51
|
constructor() {
|
|
@@ -60,10 +60,6 @@ let EzButton$1 = class extends HTMLElement$1 {
|
|
|
60
60
|
* Define o modo de uso do botão; opções: icon, link e regular
|
|
61
61
|
*/
|
|
62
62
|
this.mode = "regular";
|
|
63
|
-
/**
|
|
64
|
-
* É possível escolher entre [small,medium,large] (somente para os modos "icon" e "link")
|
|
65
|
-
*/
|
|
66
|
-
this.size = "medium";
|
|
67
63
|
}
|
|
68
64
|
/**
|
|
69
65
|
* Realiza o foco no botão
|
|
@@ -77,8 +73,10 @@ let EzButton$1 = class extends HTMLElement$1 {
|
|
|
77
73
|
async setBlur() {
|
|
78
74
|
this._button.blur();
|
|
79
75
|
}
|
|
80
|
-
getIconSize() {
|
|
81
|
-
|
|
76
|
+
getIconSize(sizeParam = "medium") {
|
|
77
|
+
const sizeList = ["small", "medium", "large"];
|
|
78
|
+
const sizeLowerCase = this.size && this.size.toLowerCase();
|
|
79
|
+
return sizeList.includes(sizeLowerCase) ? sizeLowerCase : sizeParam;
|
|
82
80
|
}
|
|
83
81
|
handleSlotChange(ev) {
|
|
84
82
|
const slot = ev.target;
|
|
@@ -93,27 +91,27 @@ let EzButton$1 = class extends HTMLElement$1 {
|
|
|
93
91
|
}
|
|
94
92
|
}
|
|
95
93
|
else {
|
|
96
|
-
content.style.setProperty(
|
|
94
|
+
content.style.setProperty("--ez-icon--color", "var(--ez-icon--color)");
|
|
97
95
|
}
|
|
98
96
|
}
|
|
99
97
|
render() {
|
|
100
98
|
if (this.mode == "icon") {
|
|
101
|
-
return (h("button", { class: "icon " + this.
|
|
99
|
+
return (h("button", { class: "btn-icon " + ((this.getIconSize()) ? `btn-icon--${this.getIconSize()}` : ""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize(), onClick: evt => {
|
|
102
100
|
if (!this.enabled)
|
|
103
101
|
evt.stopPropagation();
|
|
104
102
|
} })));
|
|
105
103
|
}
|
|
106
104
|
else if (this.mode == "label-icon") {
|
|
107
|
-
return (h("div", { class: "label-icon" }, h("button", { class: "icon", type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size:
|
|
105
|
+
return (h("div", { class: "label-icon" }, h("button", { class: "btn-icon " + ((this.getIconSize()) ? `btn-icon--${this.getIconSize()}` : ""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize(), onClick: evt => {
|
|
108
106
|
if (!this.enabled)
|
|
109
107
|
evt.stopPropagation();
|
|
110
108
|
} })), h("label", { title: this.label }, this.label)));
|
|
111
109
|
}
|
|
112
110
|
else if (this.mode == "link") {
|
|
113
|
-
return (h("a", { class: this.
|
|
111
|
+
return (h("a", { class: this.getIconSize(), ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
114
112
|
}
|
|
115
113
|
else {
|
|
116
|
-
return (h("button", { type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
114
|
+
return (h("button", { class: this.getIconSize(""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
117
115
|
}
|
|
118
116
|
}
|
|
119
117
|
static get style() { return ezButtonCss; }
|
|
@@ -1795,7 +1793,12 @@ class DataBinder {
|
|
|
1795
1793
|
const oldValue = field["value"];
|
|
1796
1794
|
const newValue = this._dataUnit.getFieldValue(fieldName);
|
|
1797
1795
|
if (oldValue != newValue) {
|
|
1798
|
-
|
|
1796
|
+
if (newValue === undefined) {
|
|
1797
|
+
field.removeAttribute("value");
|
|
1798
|
+
}
|
|
1799
|
+
else {
|
|
1800
|
+
field["value"] = newValue;
|
|
1801
|
+
}
|
|
1799
1802
|
}
|
|
1800
1803
|
}
|
|
1801
1804
|
updateBind(fieldName, field) {
|
|
@@ -1803,7 +1806,13 @@ class DataBinder {
|
|
|
1803
1806
|
if (oldBind) {
|
|
1804
1807
|
oldBind.destroy();
|
|
1805
1808
|
}
|
|
1806
|
-
|
|
1809
|
+
const value = this._dataUnit.getFieldValue(fieldName);
|
|
1810
|
+
if (value === undefined) {
|
|
1811
|
+
field.removeAttribute("value");
|
|
1812
|
+
}
|
|
1813
|
+
else {
|
|
1814
|
+
field["value"] = value;
|
|
1815
|
+
}
|
|
1807
1816
|
this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, waitingChange) => this.changeStarted(fieldName, waitingChange), (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
|
|
1808
1817
|
this.bindSearchOptionsLoader(fieldName, field);
|
|
1809
1818
|
this.applyEzUploadContext(fieldName, field);
|
|
@@ -1930,7 +1939,7 @@ let EzForm$1 = class extends HTMLElement$1 {
|
|
|
1930
1939
|
.filter(f => f.dataset.required)
|
|
1931
1940
|
.map(f => f.dataset.fieldName)
|
|
1932
1941
|
.concat(metadata.getRequiredFields());
|
|
1933
|
-
const records = this.dataUnit.
|
|
1942
|
+
const records = this.dataUnit.getModifiedRecords();
|
|
1934
1943
|
for (let i = 0; i < records.length; i++) {
|
|
1935
1944
|
if (!this.validateRequired(requiredFields, records[i])) {
|
|
1936
1945
|
reject();
|
|
@@ -112386,19 +112395,24 @@ class AgGridController {
|
|
|
112386
112395
|
});
|
|
112387
112396
|
return optionSelected === null || optionSelected === void 0 ? void 0 : optionSelected.label;
|
|
112388
112397
|
}
|
|
112389
|
-
if ((source === null || source === void 0 ? void 0 : source.userInterface) ===
|
|
112390
|
-
if ((params === null || params === void 0 ? void 0 : params.value) === "S" || (params === null || params === void 0 ? void 0 : params.value) === true) {
|
|
112398
|
+
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.SWITCH) {
|
|
112399
|
+
if ((params === null || params === void 0 ? void 0 : params.value) === "S" || (params === null || params === void 0 ? void 0 : params.value) === true || (params === null || params === void 0 ? void 0 : params.value) === "true") {
|
|
112391
112400
|
return "Sim";
|
|
112392
112401
|
}
|
|
112393
|
-
else if ((params === null || params === void 0 ? void 0 : params.value) === "N" || (params === null || params === void 0 ? void 0 : params.value) === false) {
|
|
112402
|
+
else if ((params === null || params === void 0 ? void 0 : params.value) === "N" || (params === null || params === void 0 ? void 0 : params.value) === false || (params === null || params === void 0 ? void 0 : params.value) === "false") {
|
|
112394
112403
|
return "Não";
|
|
112395
112404
|
}
|
|
112396
112405
|
}
|
|
112397
|
-
if ((source === null || source === void 0 ? void 0 : source.userInterface) ===
|
|
112406
|
+
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.SEARCH) {
|
|
112398
112407
|
if (params.value !== undefined) {
|
|
112399
112408
|
return ((_a = params === null || params === void 0 ? void 0 : params.value) === null || _a === void 0 ? void 0 : _a.value) + " - " + ((_b = params === null || params === void 0 ? void 0 : params.value) === null || _b === void 0 ? void 0 : _b.label);
|
|
112400
112409
|
}
|
|
112401
112410
|
}
|
|
112411
|
+
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.DECIMALNUMBER) {
|
|
112412
|
+
if (params.value !== undefined) {
|
|
112413
|
+
return NumberUtils.format(params.value.toString(), 2, 2);
|
|
112414
|
+
}
|
|
112415
|
+
}
|
|
112402
112416
|
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.DATE || (source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.DATETIME) {
|
|
112403
112417
|
if (params.value !== undefined) {
|
|
112404
112418
|
return params.value.toLocaleDateString();
|
|
@@ -112504,7 +112518,12 @@ class DataUnitBridge {
|
|
|
112504
112518
|
this._dataUnit.metadata.fields.forEach(f => {
|
|
112505
112519
|
var _a;
|
|
112506
112520
|
if (f.visible !== false) {
|
|
112507
|
-
|
|
112521
|
+
const props = new Map();
|
|
112522
|
+
const properties = this._dataUnit.getField(f.name).properties;
|
|
112523
|
+
for (const value in properties) {
|
|
112524
|
+
props.set(value, properties[value]);
|
|
112525
|
+
}
|
|
112526
|
+
columnDefs.push({ label: f.label, name: f.name, userInterface: f.userInterface, options: (_a = this._dataUnit.getField(f.name).properties) === null || _a === void 0 ? void 0 : _a.options, props });
|
|
112508
112527
|
}
|
|
112509
112528
|
});
|
|
112510
112529
|
}
|
|
@@ -112526,7 +112545,7 @@ let EzGrid$1 = class extends HTMLElement$1 {
|
|
|
112526
112545
|
this.ezDoubleClick = createEvent(this, "ezDoubleClick", 7);
|
|
112527
112546
|
this.configChange = createEvent(this, "configChange", 7);
|
|
112528
112547
|
this._gridController = new AgGridController(false);
|
|
112529
|
-
this.
|
|
112548
|
+
this._popUpGridConfig = false;
|
|
112530
112549
|
/**
|
|
112531
112550
|
* Determina o número de linhas de cada página. Caso informado o valor -1
|
|
112532
112551
|
* não haverá paginação.
|
|
@@ -112700,18 +112719,18 @@ let EzGrid$1 = class extends HTMLElement$1 {
|
|
|
112700
112719
|
}
|
|
112701
112720
|
applyConfig(config) {
|
|
112702
112721
|
this._gridController.setColumnsState(config.columns);
|
|
112703
|
-
this.
|
|
112722
|
+
this.closeGridConfig();
|
|
112704
112723
|
}
|
|
112705
|
-
|
|
112706
|
-
this.
|
|
112724
|
+
closeGridConfig() {
|
|
112725
|
+
this._popUpGridConfig = false;
|
|
112707
112726
|
}
|
|
112708
|
-
|
|
112727
|
+
openGridConfig() {
|
|
112709
112728
|
this._gridConfig.columns = this._gridController.getColumnsState().filter(c => c.name);
|
|
112710
112729
|
this._gridConfig.selectedTab = "Colunas";
|
|
112711
|
-
this.
|
|
112730
|
+
this._popUpGridConfig = true;
|
|
112712
112731
|
}
|
|
112713
112732
|
render() {
|
|
112714
|
-
return (h(Host, null, h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container" }, this.getPaginationControl()
|
|
112733
|
+
return (h(Host, null, h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container" }, this.getPaginationControl())), h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), h("div", { class: "grid__footer" }), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("grid-config", { ref: ref => this._gridConfig = ref, config: this.config, selectedTab: "Colunas", onConfigFinish: evt => { this.applyConfig(evt.detail); this.configChange.emit(evt.detail); }, onConfigCancel: _evt => this.closeGridConfig() }))));
|
|
112715
112734
|
}
|
|
112716
112735
|
static get assetsDirs() { return ["../assets"]; }
|
|
112717
112736
|
static get watchers() { return {
|
|
@@ -112911,6 +112930,17 @@ let EzList$1 = class extends HTMLElement$1 {
|
|
|
112911
112930
|
this._listItemsHistory = [];
|
|
112912
112931
|
}
|
|
112913
112932
|
/**
|
|
112933
|
+
* Responsável por dar um scroll top no componente da lista.
|
|
112934
|
+
*/
|
|
112935
|
+
async scrollToTop() {
|
|
112936
|
+
if (this.useGroups) {
|
|
112937
|
+
this._element.shadowRoot.querySelector('.group-container').scrollTop = 0;
|
|
112938
|
+
}
|
|
112939
|
+
else {
|
|
112940
|
+
this._element.shadowRoot.querySelector('.items-container').scrollTop = 0;
|
|
112941
|
+
}
|
|
112942
|
+
}
|
|
112943
|
+
/**
|
|
112914
112944
|
* Recebe como argumento um ListItem {label: string} e um booleano que define se o componente deve fazer scroll para exibir o item específico (opcional).
|
|
112915
112945
|
*/
|
|
112916
112946
|
async setSelection(selectedItem, scrollToOption) {
|
|
@@ -113364,6 +113394,7 @@ let EzModal$1 = class extends HTMLElement$1 {
|
|
|
113364
113394
|
this.__registerHost();
|
|
113365
113395
|
this.__attachShadow();
|
|
113366
113396
|
this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
|
|
113397
|
+
this.ezOpenModal = createEvent(this, "ezOpenModal", 7);
|
|
113367
113398
|
/**
|
|
113368
113399
|
* Controle de exibição do Modal
|
|
113369
113400
|
*/
|
|
@@ -113397,6 +113428,11 @@ let EzModal$1 = class extends HTMLElement$1 {
|
|
|
113397
113428
|
componentDidLoad() {
|
|
113398
113429
|
this.handleopenedChange();
|
|
113399
113430
|
}
|
|
113431
|
+
componentDidRender() {
|
|
113432
|
+
if (this.opened) {
|
|
113433
|
+
this.ezOpenModal.emit();
|
|
113434
|
+
}
|
|
113435
|
+
}
|
|
113400
113436
|
onMouseDownHandler(event) {
|
|
113401
113437
|
if (this.closeOutsideClick && event.target === this._overlay) {
|
|
113402
113438
|
this.closeModal();
|
|
@@ -113458,7 +113494,7 @@ let EzNumberInput$1 = class extends HTMLElement$1 {
|
|
|
113458
113494
|
}
|
|
113459
113495
|
changeValue(newValue) {
|
|
113460
113496
|
this.errorMessage = "";
|
|
113461
|
-
if (newValue
|
|
113497
|
+
if (newValue !== this.value) {
|
|
113462
113498
|
this.value = newValue;
|
|
113463
113499
|
this.ezChange.emit(this.value);
|
|
113464
113500
|
}
|
|
@@ -114095,14 +114131,16 @@ let EzTextInput$1 = class extends HTMLElement$1 {
|
|
|
114095
114131
|
}
|
|
114096
114132
|
showError() {
|
|
114097
114133
|
var _a, _b;
|
|
114098
|
-
|
|
114099
|
-
|
|
114100
|
-
|
|
114101
|
-
|
|
114102
|
-
|
|
114103
|
-
|
|
114104
|
-
|
|
114105
|
-
|
|
114134
|
+
if (this._inputElem) {
|
|
114135
|
+
const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
|
|
114136
|
+
if (hasError) {
|
|
114137
|
+
this._inputElem.classList.add("hasError");
|
|
114138
|
+
(_a = this._messageBoxElem) === null || _a === void 0 ? void 0 : _a.classList.add("hasError");
|
|
114139
|
+
}
|
|
114140
|
+
else {
|
|
114141
|
+
this._inputElem.classList.remove("hasError");
|
|
114142
|
+
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove("hasError");
|
|
114143
|
+
}
|
|
114106
114144
|
}
|
|
114107
114145
|
}
|
|
114108
114146
|
prepareMask() {
|
|
@@ -114858,6 +114896,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
114858
114896
|
this._orderPriorityList = [];
|
|
114859
114897
|
this._columListItems = [];
|
|
114860
114898
|
this._selectedIndex = -1;
|
|
114899
|
+
this._dataChanged = false;
|
|
114861
114900
|
this.selectedTab = "Colunas";
|
|
114862
114901
|
}
|
|
114863
114902
|
/* Creation Methods */
|
|
@@ -114933,6 +114972,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
114933
114972
|
}
|
|
114934
114973
|
updateOrder(sortOrder, updatedItemLabel) {
|
|
114935
114974
|
var _a;
|
|
114975
|
+
this._dataChanged = true;
|
|
114936
114976
|
let newList = [...this.columns];
|
|
114937
114977
|
let newItem = newList.find(item => item.label === updatedItemLabel);
|
|
114938
114978
|
if (newItem) {
|
|
@@ -114961,6 +115001,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
114961
115001
|
switchColumnGroup(ev, switchedItem) {
|
|
114962
115002
|
ev.stopPropagation();
|
|
114963
115003
|
let newList = [...this._columListItems];
|
|
115004
|
+
this._dataChanged = true;
|
|
114964
115005
|
if (ev.detail === true) {
|
|
114965
115006
|
let hiddenGroup = newList.find(group => group.group === "Ocultas");
|
|
114966
115007
|
let index = hiddenGroup.items.findIndex(item => item.label === switchedItem.label);
|
|
@@ -115000,6 +115041,9 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
115000
115041
|
});
|
|
115001
115042
|
});
|
|
115002
115043
|
this.columns = newColumnList;
|
|
115044
|
+
this._dataChanged = false;
|
|
115045
|
+
this.closeConfig();
|
|
115046
|
+
ApplicationUtils.info("As configurações foram salvas com sucesso!");
|
|
115003
115047
|
this.save();
|
|
115004
115048
|
}
|
|
115005
115049
|
save() {
|
|
@@ -115182,13 +115226,46 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
115182
115226
|
return false;
|
|
115183
115227
|
}
|
|
115184
115228
|
closeConfig() {
|
|
115185
|
-
this.
|
|
115186
|
-
this.
|
|
115229
|
+
this._orderList.scrollToTop();
|
|
115230
|
+
this._columnList.scrollToTop();
|
|
115231
|
+
this._searchElement.value = "";
|
|
115232
|
+
if (this._dataChanged) {
|
|
115233
|
+
let options = {
|
|
115234
|
+
canClose: false,
|
|
115235
|
+
labelCancel: "Descartar",
|
|
115236
|
+
labelConfirm: "Salvar",
|
|
115237
|
+
btnConfirmDanger: false
|
|
115238
|
+
};
|
|
115239
|
+
ApplicationUtils.confirm("Aviso", "As alterações realizadas serão descartadas. Gostaria de salvar antes de sair?", null, false, options)
|
|
115240
|
+
.then(response => {
|
|
115241
|
+
if (!response) {
|
|
115242
|
+
this._dataChanged = false;
|
|
115243
|
+
this.configCancel.emit();
|
|
115244
|
+
this._orderList.clearHistory();
|
|
115245
|
+
}
|
|
115246
|
+
else {
|
|
115247
|
+
this.finish();
|
|
115248
|
+
}
|
|
115249
|
+
});
|
|
115250
|
+
}
|
|
115251
|
+
else {
|
|
115252
|
+
this.configCancel.emit();
|
|
115253
|
+
this._orderList.clearHistory();
|
|
115254
|
+
}
|
|
115187
115255
|
}
|
|
115188
115256
|
/* Handlers */
|
|
115189
115257
|
handleTabChange(ev) {
|
|
115190
115258
|
var _a;
|
|
115191
115259
|
if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
|
|
115260
|
+
if (this.selectedTab !== ev.target.selectedTab) {
|
|
115261
|
+
if (ev.target.selectedTab === "Colunas") {
|
|
115262
|
+
this._orderList.scrollToTop();
|
|
115263
|
+
}
|
|
115264
|
+
else if (ev.target.selectedTab === "Ordenação das linhas") {
|
|
115265
|
+
this._columnList.scrollToTop();
|
|
115266
|
+
}
|
|
115267
|
+
this._searchElement.value = "";
|
|
115268
|
+
}
|
|
115192
115269
|
if (ev.target.selectedTab === "Ordenação das linhas") {
|
|
115193
115270
|
this.createOrderList();
|
|
115194
115271
|
}
|
|
@@ -115200,6 +115277,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
115200
115277
|
if (ev.detail) {
|
|
115201
115278
|
let visibleItems = (_a = ev.detail.find(group => group.group === "Visíveis")) === null || _a === void 0 ? void 0 : _a.items;
|
|
115202
115279
|
if (visibleItems) {
|
|
115280
|
+
this._dataChanged = true;
|
|
115203
115281
|
this._orderListItems = visibleItems;
|
|
115204
115282
|
}
|
|
115205
115283
|
}
|
|
@@ -115208,6 +115286,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
115208
115286
|
if (ev.detail) {
|
|
115209
115287
|
let orderPriorityList = ev.detail;
|
|
115210
115288
|
if (orderPriorityList) {
|
|
115289
|
+
this._dataChanged = true;
|
|
115211
115290
|
this._orderPriorityList = orderPriorityList;
|
|
115212
115291
|
}
|
|
115213
115292
|
}
|
|
@@ -115322,7 +115401,7 @@ const EzDateTimeInput = /*@__PURE__*/proxyCustomElement(EzDateTimeInput$1, [1,"e
|
|
|
115322
115401
|
const EzDialog = /*@__PURE__*/proxyCustomElement(EzDialog$1, [1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"]}]);
|
|
115323
115402
|
const EzFilterInput = /*@__PURE__*/proxyCustomElement(EzFilterInput$1, [1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"loading":[516],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513]}]);
|
|
115324
115403
|
const EzForm = /*@__PURE__*/proxyCustomElement(EzForm$1, [0,"ez-form",{"dataUnit":[1040],"config":[16]}]);
|
|
115325
|
-
const EzGrid = /*@__PURE__*/proxyCustomElement(EzGrid$1, [6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"
|
|
115404
|
+
const EzGrid = /*@__PURE__*/proxyCustomElement(EzGrid$1, [6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpGridConfig":[32]}]);
|
|
115326
115405
|
const EzIcon = /*@__PURE__*/proxyCustomElement(EzIcon$1, [1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]);
|
|
115327
115406
|
const EzLabelChip = /*@__PURE__*/proxyCustomElement(EzLabelChip$1, [1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540]}]);
|
|
115328
115407
|
const EzList = /*@__PURE__*/proxyCustomElement(EzList$1, [1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32]}]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-bf1aef20.js';
|
|
2
2
|
|
|
3
|
-
const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover
|
|
3
|
+
const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}";
|
|
4
4
|
|
|
5
5
|
let EzButton = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -13,10 +13,6 @@ let EzButton = class {
|
|
|
13
13
|
* Define o modo de uso do botão; opções: icon, link e regular
|
|
14
14
|
*/
|
|
15
15
|
this.mode = "regular";
|
|
16
|
-
/**
|
|
17
|
-
* É possível escolher entre [small,medium,large] (somente para os modos "icon" e "link")
|
|
18
|
-
*/
|
|
19
|
-
this.size = "medium";
|
|
20
16
|
}
|
|
21
17
|
/**
|
|
22
18
|
* Realiza o foco no botão
|
|
@@ -30,8 +26,10 @@ let EzButton = class {
|
|
|
30
26
|
async setBlur() {
|
|
31
27
|
this._button.blur();
|
|
32
28
|
}
|
|
33
|
-
getIconSize() {
|
|
34
|
-
|
|
29
|
+
getIconSize(sizeParam = "medium") {
|
|
30
|
+
const sizeList = ["small", "medium", "large"];
|
|
31
|
+
const sizeLowerCase = this.size && this.size.toLowerCase();
|
|
32
|
+
return sizeList.includes(sizeLowerCase) ? sizeLowerCase : sizeParam;
|
|
35
33
|
}
|
|
36
34
|
handleSlotChange(ev) {
|
|
37
35
|
const slot = ev.target;
|
|
@@ -46,27 +44,27 @@ let EzButton = class {
|
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
else {
|
|
49
|
-
content.style.setProperty(
|
|
47
|
+
content.style.setProperty("--ez-icon--color", "var(--ez-icon--color)");
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
50
|
render() {
|
|
53
51
|
if (this.mode == "icon") {
|
|
54
|
-
return (h("button", { class: "icon " + this.
|
|
52
|
+
return (h("button", { class: "btn-icon " + ((this.getIconSize()) ? `btn-icon--${this.getIconSize()}` : ""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize(), onClick: evt => {
|
|
55
53
|
if (!this.enabled)
|
|
56
54
|
evt.stopPropagation();
|
|
57
55
|
} })));
|
|
58
56
|
}
|
|
59
57
|
else if (this.mode == "label-icon") {
|
|
60
|
-
return (h("div", { class: "label-icon" }, h("button", { class: "icon", type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size:
|
|
58
|
+
return (h("div", { class: "label-icon" }, h("button", { class: "btn-icon " + ((this.getIconSize()) ? `btn-icon--${this.getIconSize()}` : ""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize(), onClick: evt => {
|
|
61
59
|
if (!this.enabled)
|
|
62
60
|
evt.stopPropagation();
|
|
63
61
|
} })), h("label", { title: this.label }, this.label)));
|
|
64
62
|
}
|
|
65
63
|
else if (this.mode == "link") {
|
|
66
|
-
return (h("a", { class: this.
|
|
64
|
+
return (h("a", { class: this.getIconSize(), ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
67
65
|
}
|
|
68
66
|
else {
|
|
69
|
-
return (h("button", { type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
67
|
+
return (h("button", { class: this.getIconSize(""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
70
68
|
}
|
|
71
69
|
}
|
|
72
70
|
};
|
|
@@ -637,7 +637,12 @@ class DataBinder {
|
|
|
637
637
|
const oldValue = field["value"];
|
|
638
638
|
const newValue = this._dataUnit.getFieldValue(fieldName);
|
|
639
639
|
if (oldValue != newValue) {
|
|
640
|
-
|
|
640
|
+
if (newValue === undefined) {
|
|
641
|
+
field.removeAttribute("value");
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
field["value"] = newValue;
|
|
645
|
+
}
|
|
641
646
|
}
|
|
642
647
|
}
|
|
643
648
|
updateBind(fieldName, field) {
|
|
@@ -645,7 +650,13 @@ class DataBinder {
|
|
|
645
650
|
if (oldBind) {
|
|
646
651
|
oldBind.destroy();
|
|
647
652
|
}
|
|
648
|
-
|
|
653
|
+
const value = this._dataUnit.getFieldValue(fieldName);
|
|
654
|
+
if (value === undefined) {
|
|
655
|
+
field.removeAttribute("value");
|
|
656
|
+
}
|
|
657
|
+
else {
|
|
658
|
+
field["value"] = value;
|
|
659
|
+
}
|
|
649
660
|
this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, waitingChange) => this.changeStarted(fieldName, waitingChange), (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
|
|
650
661
|
this.bindSearchOptionsLoader(fieldName, field);
|
|
651
662
|
this.applyEzUploadContext(fieldName, field);
|
|
@@ -732,7 +743,7 @@ let EzForm = class {
|
|
|
732
743
|
.filter(f => f.dataset.required)
|
|
733
744
|
.map(f => f.dataset.fieldName)
|
|
734
745
|
.concat(metadata.getRequiredFields());
|
|
735
|
-
const records = this.dataUnit.
|
|
746
|
+
const records = this.dataUnit.getModifiedRecords();
|
|
736
747
|
for (let i = 0; i < records.length; i++) {
|
|
737
748
|
if (!this.validateRequired(requiredFields, records[i])) {
|
|
738
749
|
reject();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-bf1aef20.js';
|
|
2
|
-
import { DataType, Action } from '@sankhyalabs/core';
|
|
2
|
+
import { NumberUtils, DataType, Action } from '@sankhyalabs/core';
|
|
3
3
|
import { UserInterface, SortMode } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
4
4
|
|
|
5
5
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -110353,19 +110353,24 @@ class AgGridController {
|
|
|
110353
110353
|
});
|
|
110354
110354
|
return optionSelected === null || optionSelected === void 0 ? void 0 : optionSelected.label;
|
|
110355
110355
|
}
|
|
110356
|
-
if ((source === null || source === void 0 ? void 0 : source.userInterface) ===
|
|
110357
|
-
if ((params === null || params === void 0 ? void 0 : params.value) === "S" || (params === null || params === void 0 ? void 0 : params.value) === true) {
|
|
110356
|
+
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface.SWITCH) {
|
|
110357
|
+
if ((params === null || params === void 0 ? void 0 : params.value) === "S" || (params === null || params === void 0 ? void 0 : params.value) === true || (params === null || params === void 0 ? void 0 : params.value) === "true") {
|
|
110358
110358
|
return "Sim";
|
|
110359
110359
|
}
|
|
110360
|
-
else if ((params === null || params === void 0 ? void 0 : params.value) === "N" || (params === null || params === void 0 ? void 0 : params.value) === false) {
|
|
110360
|
+
else if ((params === null || params === void 0 ? void 0 : params.value) === "N" || (params === null || params === void 0 ? void 0 : params.value) === false || (params === null || params === void 0 ? void 0 : params.value) === "false") {
|
|
110361
110361
|
return "Não";
|
|
110362
110362
|
}
|
|
110363
110363
|
}
|
|
110364
|
-
if ((source === null || source === void 0 ? void 0 : source.userInterface) ===
|
|
110364
|
+
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface.SEARCH) {
|
|
110365
110365
|
if (params.value !== undefined) {
|
|
110366
110366
|
return ((_a = params === null || params === void 0 ? void 0 : params.value) === null || _a === void 0 ? void 0 : _a.value) + " - " + ((_b = params === null || params === void 0 ? void 0 : params.value) === null || _b === void 0 ? void 0 : _b.label);
|
|
110367
110367
|
}
|
|
110368
110368
|
}
|
|
110369
|
+
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface.DECIMALNUMBER) {
|
|
110370
|
+
if (params.value !== undefined) {
|
|
110371
|
+
return NumberUtils.format(params.value.toString(), 2, 2);
|
|
110372
|
+
}
|
|
110373
|
+
}
|
|
110369
110374
|
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface.DATE || (source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface.DATETIME) {
|
|
110370
110375
|
if (params.value !== undefined) {
|
|
110371
110376
|
return params.value.toLocaleDateString();
|
|
@@ -110471,7 +110476,12 @@ class DataUnitBridge {
|
|
|
110471
110476
|
this._dataUnit.metadata.fields.forEach(f => {
|
|
110472
110477
|
var _a;
|
|
110473
110478
|
if (f.visible !== false) {
|
|
110474
|
-
|
|
110479
|
+
const props = new Map();
|
|
110480
|
+
const properties = this._dataUnit.getField(f.name).properties;
|
|
110481
|
+
for (const value in properties) {
|
|
110482
|
+
props.set(value, properties[value]);
|
|
110483
|
+
}
|
|
110484
|
+
columnDefs.push({ label: f.label, name: f.name, userInterface: f.userInterface, options: (_a = this._dataUnit.getField(f.name).properties) === null || _a === void 0 ? void 0 : _a.options, props });
|
|
110475
110485
|
}
|
|
110476
110486
|
});
|
|
110477
110487
|
}
|
|
@@ -110492,7 +110502,7 @@ let EzGrid = class {
|
|
|
110492
110502
|
this.ezDoubleClick = createEvent(this, "ezDoubleClick", 7);
|
|
110493
110503
|
this.configChange = createEvent(this, "configChange", 7);
|
|
110494
110504
|
this._gridController = new AgGridController(false);
|
|
110495
|
-
this.
|
|
110505
|
+
this._popUpGridConfig = false;
|
|
110496
110506
|
/**
|
|
110497
110507
|
* Determina o número de linhas de cada página. Caso informado o valor -1
|
|
110498
110508
|
* não haverá paginação.
|
|
@@ -110666,18 +110676,18 @@ let EzGrid = class {
|
|
|
110666
110676
|
}
|
|
110667
110677
|
applyConfig(config) {
|
|
110668
110678
|
this._gridController.setColumnsState(config.columns);
|
|
110669
|
-
this.
|
|
110679
|
+
this.closeGridConfig();
|
|
110670
110680
|
}
|
|
110671
|
-
|
|
110672
|
-
this.
|
|
110681
|
+
closeGridConfig() {
|
|
110682
|
+
this._popUpGridConfig = false;
|
|
110673
110683
|
}
|
|
110674
|
-
|
|
110684
|
+
openGridConfig() {
|
|
110675
110685
|
this._gridConfig.columns = this._gridController.getColumnsState().filter(c => c.name);
|
|
110676
110686
|
this._gridConfig.selectedTab = "Colunas";
|
|
110677
|
-
this.
|
|
110687
|
+
this._popUpGridConfig = true;
|
|
110678
110688
|
}
|
|
110679
110689
|
render() {
|
|
110680
|
-
return (h(Host, null, h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container" }, this.getPaginationControl()
|
|
110690
|
+
return (h(Host, null, h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container" }, this.getPaginationControl())), h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), h("div", { class: "grid__footer" }), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("grid-config", { ref: ref => this._gridConfig = ref, config: this.config, selectedTab: "Colunas", onConfigFinish: evt => { this.applyConfig(evt.detail); this.configChange.emit(evt.detail); }, onConfigCancel: _evt => this.closeGridConfig() }))));
|
|
110681
110691
|
}
|
|
110682
110692
|
static get assetsDirs() { return ["../assets"]; }
|
|
110683
110693
|
static get watchers() { return {
|
|
@@ -55,6 +55,17 @@ let EzList = class {
|
|
|
55
55
|
this._listItemsHistory = [];
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
|
+
* Responsável por dar um scroll top no componente da lista.
|
|
59
|
+
*/
|
|
60
|
+
async scrollToTop() {
|
|
61
|
+
if (this.useGroups) {
|
|
62
|
+
this._element.shadowRoot.querySelector('.group-container').scrollTop = 0;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this._element.shadowRoot.querySelector('.items-container').scrollTop = 0;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
58
69
|
* Recebe como argumento um ListItem {label: string} e um booleano que define se o componente deve fazer scroll para exibir o item específico (opcional).
|
|
59
70
|
*/
|
|
60
71
|
async setSelection(selectedItem, scrollToOption) {
|
|
@@ -6,6 +6,7 @@ let EzModal = class {
|
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
8
|
this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
|
|
9
|
+
this.ezOpenModal = createEvent(this, "ezOpenModal", 7);
|
|
9
10
|
/**
|
|
10
11
|
* Controle de exibição do Modal
|
|
11
12
|
*/
|
|
@@ -39,6 +40,11 @@ let EzModal = class {
|
|
|
39
40
|
componentDidLoad() {
|
|
40
41
|
this.handleopenedChange();
|
|
41
42
|
}
|
|
43
|
+
componentDidRender() {
|
|
44
|
+
if (this.opened) {
|
|
45
|
+
this.ezOpenModal.emit();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
42
48
|
onMouseDownHandler(event) {
|
|
43
49
|
if (this.closeOutsideClick && event.target === this._overlay) {
|
|
44
50
|
this.closeModal();
|