@sankhyalabs/ezui 5.21.0-dev.1 → 5.21.0-dev.10
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-alert-list.cjs.entry.js +6 -4
- package/dist/cjs/ez-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-form-view.cjs.entry.js +13 -0
- package/dist/cjs/ez-form.cjs.entry.js +28 -2
- package/dist/cjs/ez-grid.cjs.entry.js +108 -14
- package/dist/cjs/ez-modal-container.cjs.entry.js +15 -4
- package/dist/cjs/ez-modal.cjs.entry.js +7 -8
- package/dist/cjs/ez-number-input.cjs.entry.js +8 -1
- package/dist/cjs/ez-popup.cjs.entry.js +14 -8
- package/dist/cjs/ez-search.cjs.entry.js +5 -2
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +6 -4
- package/dist/collection/components/ez-button/ez-button.css +7 -0
- package/dist/collection/components/ez-button/ez-button.js +1 -1
- package/dist/collection/components/ez-form/ez-form.js +76 -2
- package/dist/collection/components/ez-form-view/ez-form-view.js +38 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +42 -2
- package/dist/collection/components/ez-grid/ez-grid.js +125 -2
- package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
- package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -11
- package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js +24 -0
- package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
- package/dist/collection/components/ez-modal/ez-modal.js +22 -9
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +23 -3
- package/dist/collection/components/ez-number-input/ez-number-input.js +11 -0
- package/dist/collection/components/ez-popup/ez-popup.js +14 -8
- package/dist/collection/components/ez-search/ez-search.js +5 -2
- package/dist/custom-elements/index.js +209 -48
- package/dist/esm/ez-alert-list.entry.js +6 -4
- package/dist/esm/ez-button.entry.js +2 -2
- package/dist/esm/ez-form-view.entry.js +13 -0
- package/dist/esm/ez-form.entry.js +28 -2
- package/dist/esm/ez-grid.entry.js +108 -14
- package/dist/esm/ez-modal-container.entry.js +16 -5
- package/dist/esm/ez-modal.entry.js +9 -10
- package/dist/esm/ez-number-input.entry.js +8 -1
- package/dist/esm/ez-popup.entry.js +15 -9
- package/dist/esm/ez-search.entry.js +5 -2
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-09de35a2.entry.js +1 -0
- package/dist/ezui/p-13d2fe2d.entry.js +1 -0
- package/dist/ezui/{p-384247cd.entry.js → p-1db718ab.entry.js} +1 -1
- package/dist/ezui/p-30775e7f.entry.js +1 -0
- package/dist/ezui/{p-2a1a0e04.entry.js → p-3a21618b.entry.js} +1 -1
- package/dist/ezui/p-7c770f14.entry.js +1 -0
- package/dist/ezui/{p-db77a984.entry.js → p-836cdfdf.entry.js} +1 -1
- package/dist/ezui/p-99f46950.entry.js +1 -0
- package/dist/ezui/p-d9401ea0.entry.js +1 -0
- package/dist/ezui/p-f3c526cc.entry.js +1 -0
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +2 -2
- package/dist/types/components/ez-form/ez-form.d.ts +12 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +4 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +10 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +5 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +18 -1
- package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
- package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
- package/dist/types/components/ez-grid/subcomponents/utils/selectionCounterUtils.d.ts +4 -0
- package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
- package/dist/types/components/ez-modal/ez-modal.d.ts +9 -1
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +3 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +1 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +3 -3
- package/dist/types/components.d.ts +37 -1
- package/package.json +1 -1
- package/dist/ezui/p-5e1d036e.entry.js +0 -1
- package/dist/ezui/p-5ef056ce.entry.js +0 -1
- package/dist/ezui/p-701231f0.entry.js +0 -1
- package/dist/ezui/p-9aefaa52.entry.js +0 -1
- package/dist/ezui/p-a1ec32ef.entry.js +0 -1
- package/dist/ezui/p-b041333c.entry.js +0 -1
- package/dist/ezui/p-b567fa8c.entry.js +0 -1
|
@@ -40,10 +40,12 @@ const EzAlertList = class {
|
|
|
40
40
|
/**
|
|
41
41
|
* Retorna o link para o titulo do alerta a partir do id.
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
getLinkActionClick(item) {
|
|
44
44
|
var _a;
|
|
45
|
-
const
|
|
46
|
-
|
|
45
|
+
const action = (_a = this.alerts.find((alert, index) => this.alertId(alert.title, index) === item.id)) === null || _a === void 0 ? void 0 : _a.onClickLink;
|
|
46
|
+
if (action)
|
|
47
|
+
return action;
|
|
48
|
+
return () => { };
|
|
47
49
|
}
|
|
48
50
|
/**
|
|
49
51
|
* Retorna o texto do título do alerta.
|
|
@@ -135,7 +137,7 @@ const EzAlertList = class {
|
|
|
135
137
|
(index.h("div", { ref: elem => (this._overlayRef = elem) }, index.h("div", { class: `alert-list__container ${this.expanded ? 'expanded' : ''}`, ref: elem => (this._container = elem) }, index.h("div", { class: "alert-list__content" }, index.h("div", { class: "alert-list__header" }, index.h("div", { class: "alert-list__title" }, `Avisos (${this.alerts.length})`), index.h("div", { class: "alert-list__header__buttons" }, this.enableExpand && (index.h("ez-button", { mode: "icon", size: "small", iconName: "expand", onClick: () => this.toggleExpandContainer(), "data-element-id": core.ElementIDUtils.getInternalIDInfo('expandButton'), title: this.expanded ? 'Resumir' : 'Expandir' })), index.h("ez-button", { mode: "icon", size: "small", iconName: "close", "data-element-id": core.ElementIDUtils.getInternalIDInfo('closeButton'), onClick: () => {
|
|
136
138
|
this.opened = false;
|
|
137
139
|
}, title: 'Fechar' }))), index.h("div", { class: "alert-list__expandable-content" }, index.h("ez-list", { itemSlotBuilder: this.itemRightSlotBuilder, hoverFeedback: true, itemLeftSlotBuilder: item => {
|
|
138
|
-
return (index.h("a", {
|
|
140
|
+
return (index.h("a", { onClick: this.getLinkActionClick(item), style: {
|
|
139
141
|
fontFamily: "var(--font-pattern, 'Roboto')",
|
|
140
142
|
fontSize: 'var(--text--medium, 14px)',
|
|
141
143
|
fontWeight: 'var(--text-weight--medium, 400)',
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-a7b0c73d.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
|
|
8
|
-
const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--width:'auto';--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:0px;--ez-button--padding-bottom:0px;--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--justify-content:center;--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{position:relative;display:flex;align-items:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-button--min-width);width:var(--ez-button--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);justify-content:var(--ez-button--justify-content)}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)}";
|
|
8
|
+
const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--width:'auto';--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:0px;--ez-button--padding-bottom:0px;--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--justify-content:center;--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-disabled-color:var(--color--disable-primary, '#e5eaf0');--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{position:relative;display:flex;align-items:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-button--min-width);width:var(--ez-button--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);justify-content:var(--ez-button--justify-content)}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)}a.disabled{color:var(--ez-button--link-disabled-color);cursor:not-allowed}";
|
|
9
9
|
|
|
10
10
|
const EzButton = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -74,7 +74,7 @@ const EzButton = class {
|
|
|
74
74
|
return (index.h("div", { class: "label-icon" }, index.h("button", { class: "btn-icon " + ((this.getIconSize()) ? `btn-icon--${this.getIconSize()}` : ""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, index.h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize() })), index.h("label", { title: this.label }, this.label)));
|
|
75
75
|
}
|
|
76
76
|
else if (this.mode == "link") {
|
|
77
|
-
return (index.h("a", { class: this.getIconSize()
|
|
77
|
+
return (index.h("a", { class: `${this.getIconSize()} ${!this.enabled ? "disabled" : ""}`, ref: (el) => this._button = el }, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
80
80
|
return (index.h("button", { class: this.getIconSize(""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
@@ -154,6 +154,19 @@ const EzFormView = class {
|
|
|
154
154
|
async showUp() {
|
|
155
155
|
this._element.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
156
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Altera/adiciona uma propriedade nos metados do campo.
|
|
159
|
+
*/
|
|
160
|
+
async setFieldProp(fieldName, propName, value) {
|
|
161
|
+
const fields = this.fields.map(field => {
|
|
162
|
+
if (field.name === fieldName) {
|
|
163
|
+
field.props = field.props || {};
|
|
164
|
+
field.props[propName] = value;
|
|
165
|
+
}
|
|
166
|
+
return field;
|
|
167
|
+
});
|
|
168
|
+
this.fields = [...fields];
|
|
169
|
+
}
|
|
157
170
|
groupFields(fields) {
|
|
158
171
|
const result = new Map();
|
|
159
172
|
fields.forEach(item => {
|
|
@@ -854,10 +854,12 @@ const EzForm = class {
|
|
|
854
854
|
this.processMetadata();
|
|
855
855
|
}
|
|
856
856
|
};
|
|
857
|
+
this._fieldsProps = new Map();
|
|
857
858
|
this.dataUnit = undefined;
|
|
858
859
|
this.config = undefined;
|
|
859
860
|
this.recordsValidator = undefined;
|
|
860
861
|
this.fieldToFocus = undefined;
|
|
862
|
+
this.onlyStaticFields = false;
|
|
861
863
|
}
|
|
862
864
|
/**
|
|
863
865
|
* Realiza validação no conteúdo de todos os campos.
|
|
@@ -868,6 +870,15 @@ const EzForm = class {
|
|
|
868
870
|
observeConfig() {
|
|
869
871
|
this.processMetadata();
|
|
870
872
|
}
|
|
873
|
+
/**
|
|
874
|
+
* Altera/adiciona uma propriedade nos metadados do campo.
|
|
875
|
+
*/
|
|
876
|
+
async setFieldProp(fieldName, propName, value) {
|
|
877
|
+
const newCustomFieldProps = new Map(this._fieldsProps);
|
|
878
|
+
const currentProps = this._fieldsProps.get(fieldName);
|
|
879
|
+
newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
|
|
880
|
+
this._fieldsProps = newCustomFieldProps;
|
|
881
|
+
}
|
|
871
882
|
getDynamicContent() {
|
|
872
883
|
var _a;
|
|
873
884
|
const formMD = selectFormMetadata(this._store.getState());
|
|
@@ -894,10 +905,10 @@ const EzForm = class {
|
|
|
894
905
|
}
|
|
895
906
|
this.ezFormSetFields.emit(fields);
|
|
896
907
|
const idFormSheet = `${core.StringUtils.replaceAccentuatedChars(core.StringUtils.toCamelCase(currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.label), false)}_selectorContainer`;
|
|
897
|
-
return (index.h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, index.h("ez-form-view", { class: "ez-row ez-padding-vertical--small", fields: fields })));
|
|
908
|
+
return (index.h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, index.h("ez-form-view", { ref: ref => this._formView = ref, class: "ez-row ez-padding-vertical--small", fields: fields })));
|
|
898
909
|
}
|
|
899
910
|
processMetadata() {
|
|
900
|
-
if (
|
|
911
|
+
if (this.bindFields() && this.dataUnit && this._store) {
|
|
901
912
|
const metadata = buildFormMetadata(this.config, this.dataUnit);
|
|
902
913
|
this._store.dispatch(loadMetadata(metadata));
|
|
903
914
|
}
|
|
@@ -906,6 +917,9 @@ const EzForm = class {
|
|
|
906
917
|
var _a;
|
|
907
918
|
return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
908
919
|
}
|
|
920
|
+
bindFields() {
|
|
921
|
+
return !this.isStatic() || this.onlyStaticFields === false;
|
|
922
|
+
}
|
|
909
923
|
componentWillLoad() {
|
|
910
924
|
if (this.dataUnit === undefined) {
|
|
911
925
|
this.dataUnit = new core.DataUnit("ez-form");
|
|
@@ -925,6 +939,7 @@ const EzForm = class {
|
|
|
925
939
|
this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")), this.dataUnit.dataUnitId, metadata, this.recordsValidator);
|
|
926
940
|
this.ezReady.emit();
|
|
927
941
|
this.handleFieldToFocus();
|
|
942
|
+
this.setFieldsProps();
|
|
928
943
|
}
|
|
929
944
|
handleFieldToFocus() {
|
|
930
945
|
var _a;
|
|
@@ -941,6 +956,17 @@ const EzForm = class {
|
|
|
941
956
|
this.ezFormRequestClearFieldToFocus.emit();
|
|
942
957
|
});
|
|
943
958
|
}
|
|
959
|
+
setFieldsProps() {
|
|
960
|
+
if (!this._formView) {
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
for (const [fieldName, props] of this._fieldsProps) {
|
|
964
|
+
for (const prop in props) {
|
|
965
|
+
this._formView.setFieldProp(fieldName, prop, props[prop]);
|
|
966
|
+
}
|
|
967
|
+
this._fieldsProps.delete(fieldName);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
944
970
|
disconnectedCallback() {
|
|
945
971
|
this.dataUnit.unsubscribe(this.onDataUnitAction);
|
|
946
972
|
this._dataBinder.onDisconnectedCallback();
|
|
@@ -119703,6 +119703,7 @@ class AgGridController {
|
|
|
119703
119703
|
this._gridConfig = [];
|
|
119704
119704
|
this._filteredColumns = new Map();
|
|
119705
119705
|
this._filterColumnleftPosition = 0;
|
|
119706
|
+
this._customFormatters = new Map();
|
|
119706
119707
|
this._enterprise = enterprise;
|
|
119707
119708
|
}
|
|
119708
119709
|
getGridConfig() {
|
|
@@ -119818,6 +119819,13 @@ class AgGridController {
|
|
|
119818
119819
|
headerCheckStatusGetter: () => this.getSelectionHeaderStatus(),
|
|
119819
119820
|
headerCheckStatusSetter: (selectAll) => this.updateSelectionForAll(selectAll),
|
|
119820
119821
|
},
|
|
119822
|
+
processCellForClipboard: this.processFormatterCellCallback,
|
|
119823
|
+
defaultExcelExportParams: {
|
|
119824
|
+
processCellCallback: this.processFormatterCellCallback
|
|
119825
|
+
},
|
|
119826
|
+
defaultCsvExportParams: {
|
|
119827
|
+
processCellCallback: this.processFormatterCellCallback
|
|
119828
|
+
}
|
|
119821
119829
|
};
|
|
119822
119830
|
this.defineRowModelType(this._gridOptions, options);
|
|
119823
119831
|
this.setOptionsEvents(this._gridOptions);
|
|
@@ -119841,7 +119849,25 @@ class AgGridController {
|
|
|
119841
119849
|
this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
|
|
119842
119850
|
}
|
|
119843
119851
|
this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
|
|
119852
|
+
this._customFormatters = options.customFormatters;
|
|
119853
|
+
}
|
|
119854
|
+
}
|
|
119855
|
+
processFormatterCellCallback(params) {
|
|
119856
|
+
const column = params.column.getColDef();
|
|
119857
|
+
if (typeof column.valueFormatter === 'function') {
|
|
119858
|
+
const valueParams = {
|
|
119859
|
+
value: params.value,
|
|
119860
|
+
data: params.node.data,
|
|
119861
|
+
node: params.node,
|
|
119862
|
+
colDef: column,
|
|
119863
|
+
column: params.column,
|
|
119864
|
+
api: params.api,
|
|
119865
|
+
columnApi: params.columnApi,
|
|
119866
|
+
context: params.context,
|
|
119867
|
+
};
|
|
119868
|
+
return column.valueFormatter(valueParams);
|
|
119844
119869
|
}
|
|
119870
|
+
return params.value;
|
|
119845
119871
|
}
|
|
119846
119872
|
setFilterColumnLeftPosition({ type, ePopup }) {
|
|
119847
119873
|
if (type === 'columnMenu') {
|
|
@@ -120191,7 +120217,7 @@ class AgGridController {
|
|
|
120191
120217
|
//Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
|
|
120192
120218
|
const columnsOffset = colDef.length - columns.length;
|
|
120193
120219
|
let sort = [];
|
|
120194
|
-
state.forEach((cfgColumn, index) => {
|
|
120220
|
+
state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
|
|
120195
120221
|
const colWidth = this.getColumnWidth(cfgColumn);
|
|
120196
120222
|
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
120197
120223
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
@@ -120294,6 +120320,13 @@ class AgGridController {
|
|
|
120294
120320
|
if (params.value instanceof Promise) {
|
|
120295
120321
|
return "Carregando...";
|
|
120296
120322
|
}
|
|
120323
|
+
const customFormatter = this._customFormatters.get(source.name);
|
|
120324
|
+
if (customFormatter) {
|
|
120325
|
+
const formattedValue = customFormatter.format(params.value, source, params.data.__record__id__);
|
|
120326
|
+
if (formattedValue) {
|
|
120327
|
+
return formattedValue;
|
|
120328
|
+
}
|
|
120329
|
+
}
|
|
120297
120330
|
if (this._dataUnit) {
|
|
120298
120331
|
return this._dataUnit.getFormattedValue(source.name, params.value);
|
|
120299
120332
|
}
|
|
@@ -120302,6 +120335,13 @@ class AgGridController {
|
|
|
120302
120335
|
cellStyle: this.getStyleByColumn(source),
|
|
120303
120336
|
});
|
|
120304
120337
|
}
|
|
120338
|
+
setCustomFormatters(customFormatters) {
|
|
120339
|
+
this._customFormatters = customFormatters;
|
|
120340
|
+
}
|
|
120341
|
+
refreshSelectedRows() {
|
|
120342
|
+
const selectedNodes = this._gridOptions.api.getSelectedNodes();
|
|
120343
|
+
this._gridOptions.api.redrawRows({ rowNodes: selectedNodes });
|
|
120344
|
+
}
|
|
120305
120345
|
getInitCellStyle() {
|
|
120306
120346
|
return {
|
|
120307
120347
|
'line-height': this.getRowHeight() - 1 + 'px',
|
|
@@ -120479,9 +120519,34 @@ class AgGridController {
|
|
|
120479
120519
|
}
|
|
120480
120520
|
}
|
|
120481
120521
|
|
|
120522
|
+
function enableSelectAll(total) {
|
|
120523
|
+
return total !== undefined;
|
|
120524
|
+
}
|
|
120525
|
+
function buildSelectAllLabel(allRecordSelected, count, total) {
|
|
120526
|
+
if (allRecordSelected)
|
|
120527
|
+
return 'Selecionar apenas a página atual';
|
|
120528
|
+
if (total === undefined)
|
|
120529
|
+
return `Carregando todos os ${count} registros`;
|
|
120530
|
+
return `Selecionar todos os ${total} registros`;
|
|
120531
|
+
}
|
|
120532
|
+
function buildSelectAllTitle(total) {
|
|
120533
|
+
if (enableSelectAll(total))
|
|
120534
|
+
return '';
|
|
120535
|
+
return 'Aguarde o carregamento para selecionar o registro de todas as páginas';
|
|
120536
|
+
}
|
|
120537
|
+
function getText(selectionCount, allSelectedRecords) {
|
|
120538
|
+
if (allSelectedRecords) {
|
|
120539
|
+
return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
|
|
120540
|
+
}
|
|
120541
|
+
if (selectionCount > 1) {
|
|
120542
|
+
return `Os <strong>${selectionCount} registros</strong> dessa página estão selecionados.`;
|
|
120543
|
+
}
|
|
120544
|
+
return "O único registro dessa página está selecionado";
|
|
120545
|
+
}
|
|
120546
|
+
|
|
120482
120547
|
const SelectionCounter = (props) => {
|
|
120483
120548
|
const { selectionCount, currentPageSelected, allRecordSelected, paginationInfo, canSelectAll, onSelectAll, onSelectPage, onClearAll, onClose } = props;
|
|
120484
|
-
const { total, hasMore } = paginationInfo || {};
|
|
120549
|
+
const { total, hasMore, count } = paginationInfo || {};
|
|
120485
120550
|
const shouldRenderSelectionButton = () => {
|
|
120486
120551
|
if ((!allRecordSelected && selectionCount === total) || (allRecordSelected && !hasMore))
|
|
120487
120552
|
return false;
|
|
@@ -120495,20 +120560,11 @@ const SelectionCounter = (props) => {
|
|
|
120495
120560
|
index.h("label", Object.assign({ innerHTML: getText(selectionCount, allRecordSelected), class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium ez-margin-top--medium" }, getElementID("ezGridSelectionCounter_label"))),
|
|
120496
120561
|
index.h("div", { class: "ez-flex ez-margin-right--medium" },
|
|
120497
120562
|
shouldRenderSelectionButton() &&
|
|
120498
|
-
index.h("ez-button", Object.assign({ class: "ez-margin-right--medium", label:
|
|
120499
|
-
index.h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
|
|
120563
|
+
index.h("ez-button", Object.assign({ title: buildSelectAllTitle(total), enabled: enableSelectAll(total), class: "ez-margin-right--medium", label: buildSelectAllLabel(allRecordSelected, count, total), mode: "link", onClick: allRecordSelected ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allRecordSelected ? "Page" : "All"}`))),
|
|
120564
|
+
index.h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar Sele\u00E7\u00E3o", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
|
|
120500
120565
|
index.h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")),
|
|
120501
120566
|
index.h("ez-icon", { iconName: "close" })))));
|
|
120502
120567
|
};
|
|
120503
|
-
function getText(selectionCount, allSelectedRecords) {
|
|
120504
|
-
if (allSelectedRecords) {
|
|
120505
|
-
return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
|
|
120506
|
-
}
|
|
120507
|
-
else {
|
|
120508
|
-
const pluralChar = selectionCount > 1 ? "s" : "";
|
|
120509
|
-
return `Há <strong>${selectionCount} registro${pluralChar}</strong> selecionado${pluralChar}.`;
|
|
120510
|
-
}
|
|
120511
|
-
}
|
|
120512
120568
|
function getElementID(sufix) {
|
|
120513
120569
|
return {
|
|
120514
120570
|
[core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: core.ElementIDUtils.getInternalIDInfo(sufix)
|
|
@@ -120695,6 +120751,7 @@ const EzGrid = class {
|
|
|
120695
120751
|
this._currentPageSelected = undefined;
|
|
120696
120752
|
this._selectionCount = undefined;
|
|
120697
120753
|
this._hasLeftButtons = false;
|
|
120754
|
+
this._customFormatters = new Map();
|
|
120698
120755
|
this.multipleSelection = undefined;
|
|
120699
120756
|
this.config = undefined;
|
|
120700
120757
|
this.selectionToastConfig = undefined;
|
|
@@ -120766,6 +120823,42 @@ const EzGrid = class {
|
|
|
120766
120823
|
async filterColumns(search) {
|
|
120767
120824
|
return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
|
|
120768
120825
|
}
|
|
120826
|
+
/**
|
|
120827
|
+
* Registra um formatador de valores para uma coluna da grid.
|
|
120828
|
+
*/
|
|
120829
|
+
async addCustomValueFormatter(columnName, customFormatter) {
|
|
120830
|
+
if (!columnName || !customFormatter) {
|
|
120831
|
+
return;
|
|
120832
|
+
}
|
|
120833
|
+
const newCustomFormatters = new Map(this._customFormatters);
|
|
120834
|
+
newCustomFormatters.set(columnName, customFormatter);
|
|
120835
|
+
this._customFormatters = newCustomFormatters;
|
|
120836
|
+
this._gridController.setCustomFormatters(newCustomFormatters);
|
|
120837
|
+
}
|
|
120838
|
+
/**
|
|
120839
|
+
* Remove o formatador de valores de uma coluna da grid.
|
|
120840
|
+
*/
|
|
120841
|
+
async removeCustomValueFormatter(columnName) {
|
|
120842
|
+
if (!columnName) {
|
|
120843
|
+
return;
|
|
120844
|
+
}
|
|
120845
|
+
const newCustomFormatters = new Map(this._customFormatters);
|
|
120846
|
+
newCustomFormatters.delete(columnName);
|
|
120847
|
+
this._customFormatters = newCustomFormatters;
|
|
120848
|
+
this._gridController.setCustomFormatters(newCustomFormatters);
|
|
120849
|
+
}
|
|
120850
|
+
/**
|
|
120851
|
+
* Atualiza linhas da grade.
|
|
120852
|
+
*/
|
|
120853
|
+
async refreshSelectedRows() {
|
|
120854
|
+
this._gridController.refreshSelectedRows();
|
|
120855
|
+
}
|
|
120856
|
+
/**
|
|
120857
|
+
* Retorna o formatador customizado da coluna caso exista.
|
|
120858
|
+
*/
|
|
120859
|
+
async getCustomValueFormatter(columnName) {
|
|
120860
|
+
return this._customFormatters.get(columnName);
|
|
120861
|
+
}
|
|
120769
120862
|
observeConfig(config) {
|
|
120770
120863
|
this._gridController.setColumnsState(config === null || config === void 0 ? void 0 : config.columns);
|
|
120771
120864
|
}
|
|
@@ -120967,7 +121060,8 @@ const EzGrid = class {
|
|
|
120967
121060
|
statusResolver: this.statusResolver,
|
|
120968
121061
|
useEnterLikeTab: this.useEnterLikeTab,
|
|
120969
121062
|
recordsValidator: this.recordsValidator,
|
|
120970
|
-
editionIsDisabled: () => !this.canEdit
|
|
121063
|
+
editionIsDisabled: () => !this.canEdit,
|
|
121064
|
+
customFormatters: this._customFormatters
|
|
120971
121065
|
});
|
|
120972
121066
|
if (this.config) {
|
|
120973
121067
|
this.observeConfig(this.config);
|
|
@@ -22,7 +22,7 @@ var ModalButtonStatus;
|
|
|
22
22
|
})(ModalButtonStatus || (ModalButtonStatus = {}));
|
|
23
23
|
const ModalButtonStatus$1 = ModalButtonStatus;
|
|
24
24
|
|
|
25
|
-
const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:clip;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x)}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
|
|
25
|
+
const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:clip;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header-container.sc-ez-modal-container{outline:none}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x)}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
|
|
26
26
|
|
|
27
27
|
const EzModalContainer = class {
|
|
28
28
|
constructor(hostRef) {
|
|
@@ -36,6 +36,12 @@ const EzModalContainer = class {
|
|
|
36
36
|
this.cancelButtonStatus = undefined;
|
|
37
37
|
this.okButtonStatus = undefined;
|
|
38
38
|
}
|
|
39
|
+
async handleEzModalAction(event) {
|
|
40
|
+
var _a;
|
|
41
|
+
if ((event === null || event === void 0 ? void 0 : event.target) && (event === null || event === void 0 ? void 0 : event.target) === ((_a = this._element) === null || _a === void 0 ? void 0 : _a.parentElement)) {
|
|
42
|
+
this.closeModal();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
39
45
|
cancelIsVisible() {
|
|
40
46
|
return (this.cancelButtonStatus !== ModalButtonStatus$1.HIDDEN && this.cancelButtonLabel != undefined);
|
|
41
47
|
}
|
|
@@ -45,11 +51,15 @@ const EzModalContainer = class {
|
|
|
45
51
|
componentDidLoad() {
|
|
46
52
|
window.requestAnimationFrame(() => {
|
|
47
53
|
this.ezModalAction.emit(ModalAction$1.LOAD);
|
|
54
|
+
this._modalRef.focus();
|
|
48
55
|
});
|
|
49
56
|
new core.KeyboardManager({ propagate: false, element: this._element })
|
|
50
57
|
.bind("Enter", this.ezModalAction.emit.bind(ModalAction$1.OK))
|
|
51
|
-
.bind("Escape", this.
|
|
52
|
-
.bind("Esc", this.
|
|
58
|
+
.bind("Escape", () => this.closeModal())
|
|
59
|
+
.bind("Esc", () => this.closeModal());
|
|
60
|
+
}
|
|
61
|
+
closeModal() {
|
|
62
|
+
this.ezModalAction.emit("CLOSE");
|
|
53
63
|
}
|
|
54
64
|
focusLast() {
|
|
55
65
|
if (this._okButton == undefined) {
|
|
@@ -61,8 +71,9 @@ const EzModalContainer = class {
|
|
|
61
71
|
this._closeButton.focus();
|
|
62
72
|
}
|
|
63
73
|
render() {
|
|
64
|
-
return (index.h(index.Host, null, index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), index.h("div",
|
|
74
|
+
return (index.h(index.Host, null, index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), index.h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (index.h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, index.h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, index.h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (index.h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), index.h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, index.h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), index.h("div", { class: "ez-modal-container__content" }, index.h("slot", null)), index.h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (index.h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (index.h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.OK) }))), index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
65
75
|
}
|
|
76
|
+
get _element() { return index.getElement(this); }
|
|
66
77
|
};
|
|
67
78
|
EzModalContainer.style = ezModalContainerCss;
|
|
68
79
|
|
|
@@ -12,11 +12,7 @@ const EzModal = class {
|
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
13
|
this.ezCloseModal = index.createEvent(this, "ezCloseModal", 7);
|
|
14
14
|
this.ezOpenModal = index.createEvent(this, "ezOpenModal", 7);
|
|
15
|
-
this.
|
|
16
|
-
if ((ev === null || ev === void 0 ? void 0 : ev.key) === "Escape" && this.closeEsc) {
|
|
17
|
-
this.closeModal();
|
|
18
|
-
}
|
|
19
|
-
};
|
|
15
|
+
this.ezModalAction = index.createEvent(this, "ezModalAction", 7);
|
|
20
16
|
this.modalSize = undefined;
|
|
21
17
|
this.align = undefined;
|
|
22
18
|
this.heightMode = "regular";
|
|
@@ -28,11 +24,9 @@ const EzModal = class {
|
|
|
28
24
|
observeOpened() {
|
|
29
25
|
if (this.opened) {
|
|
30
26
|
this._overlayId = core.FloatingManager.subscribeOverlayControl(this._modalRef);
|
|
31
|
-
document.addEventListener("keydown", this.handleKeyboardEvent);
|
|
32
27
|
}
|
|
33
28
|
else {
|
|
34
29
|
core.FloatingManager.unsubscribeOverlayControl(this._modalRef || this._overlayId);
|
|
35
|
-
document.removeEventListener("keydown", this.handleKeyboardEvent);
|
|
36
30
|
}
|
|
37
31
|
}
|
|
38
32
|
closeModal() {
|
|
@@ -41,6 +35,10 @@ const EzModal = class {
|
|
|
41
35
|
}
|
|
42
36
|
componentDidLoad() {
|
|
43
37
|
this.observeOpened();
|
|
38
|
+
new core.KeyboardManager({ propagate: false, element: this._element })
|
|
39
|
+
.bind("Enter", this.ezModalAction.emit.bind("OK"))
|
|
40
|
+
.bind("Escape", () => this.closeModal())
|
|
41
|
+
.bind("Esc", () => this.closeModal());
|
|
44
42
|
}
|
|
45
43
|
componentDidRender() {
|
|
46
44
|
if (this.opened) {
|
|
@@ -59,10 +57,11 @@ const EzModal = class {
|
|
|
59
57
|
const scrimType = `modal__screen-${this.scrim}`;
|
|
60
58
|
return (index.h(index.Host, null, this.opened
|
|
61
59
|
?
|
|
62
|
-
index.h("div", { ref: ref => this._modalRef = ref, class: `modal ${scrimType} ${regularVerticalPaddingClass}`, onMouseDown: evt => this.onMouseDownHandler(evt) }, index.h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, index.h("div", { class: `modal__content ${modalContentHeightMode} ${this.modalSize}` }, index.h("slot", null))))
|
|
60
|
+
index.h("div", { ref: ref => this._modalRef = ref, class: `modal ${scrimType} ${regularVerticalPaddingClass}`, onMouseDown: evt => this.onMouseDownHandler(evt), tabIndex: -1 }, index.h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, index.h("div", { class: `modal__content ${modalContentHeightMode} ${this.modalSize}` }, index.h("slot", null))))
|
|
63
61
|
:
|
|
64
62
|
undefined));
|
|
65
63
|
}
|
|
64
|
+
get _element() { return index.getElement(this); }
|
|
66
65
|
static get watchers() { return {
|
|
67
66
|
"opened": ["observeOpened"]
|
|
68
67
|
}; }
|
|
@@ -93,6 +93,11 @@ const EzNumberInput = class {
|
|
|
93
93
|
}
|
|
94
94
|
this._changePending = false;
|
|
95
95
|
}
|
|
96
|
+
observePrecision() {
|
|
97
|
+
if (this._textInput) {
|
|
98
|
+
this.setInputValue();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
96
101
|
validateValue(value) {
|
|
97
102
|
return isNaN(value) || value === undefined ? null : value;
|
|
98
103
|
}
|
|
@@ -176,7 +181,9 @@ const EzNumberInput = class {
|
|
|
176
181
|
static get watchers() { return {
|
|
177
182
|
"label": ["observeLabel"],
|
|
178
183
|
"errorMessage": ["observeErrorMessage"],
|
|
179
|
-
"value": ["observeValue"]
|
|
184
|
+
"value": ["observeValue"],
|
|
185
|
+
"precision": ["observePrecision"],
|
|
186
|
+
"prettyPrecision": ["observePrecision"]
|
|
180
187
|
}; }
|
|
181
188
|
};
|
|
182
189
|
EzNumberInput.style = ezNumberInputCss;
|
|
@@ -30,10 +30,18 @@ const EzPopup = class {
|
|
|
30
30
|
this.manageOverflow();
|
|
31
31
|
}
|
|
32
32
|
componentDidLoad() {
|
|
33
|
+
if (this.opened && this._popupRef) {
|
|
34
|
+
this._popupRef.focus();
|
|
35
|
+
}
|
|
33
36
|
new core.KeyboardManager({ propagate: false, element: this._element })
|
|
34
37
|
.bind("Enter", this.ezPopupAction.emit.bind("OK"))
|
|
35
|
-
.bind("Escape", () => this.
|
|
36
|
-
.bind("Esc", () => this.
|
|
38
|
+
.bind("Escape", () => this.closePopup())
|
|
39
|
+
.bind("Esc", () => this.closePopup());
|
|
40
|
+
}
|
|
41
|
+
closePopup() {
|
|
42
|
+
this.opened = false;
|
|
43
|
+
this.manageOverflow();
|
|
44
|
+
this.ezClosePopup.emit();
|
|
37
45
|
}
|
|
38
46
|
manageOverflow() {
|
|
39
47
|
if (this.opened) {
|
|
@@ -45,25 +53,23 @@ const EzPopup = class {
|
|
|
45
53
|
}
|
|
46
54
|
manageOverlay() {
|
|
47
55
|
if (this.opened) {
|
|
48
|
-
this._overlayId = core.FloatingManager.subscribeOverlayControl(this.
|
|
56
|
+
this._overlayId = core.FloatingManager.subscribeOverlayControl(this._popupRef);
|
|
49
57
|
}
|
|
50
58
|
else {
|
|
51
|
-
core.FloatingManager.unsubscribeOverlayControl(this.
|
|
59
|
+
core.FloatingManager.unsubscribeOverlayControl(this._popupRef || this._overlayId);
|
|
52
60
|
}
|
|
53
61
|
}
|
|
54
62
|
getGridSize() {
|
|
55
63
|
return this._sizeClasses[this.size] || this._sizeClasses["medium"];
|
|
56
64
|
}
|
|
57
65
|
componentDidRender() {
|
|
58
|
-
if (this._container) {
|
|
59
|
-
this._container.focus();
|
|
60
|
-
}
|
|
61
66
|
this.manageOverlay();
|
|
62
67
|
}
|
|
63
68
|
render() {
|
|
64
|
-
return (index.h(index.Host, null, this.opened ? (index.h("div", { class: "overlay", ref: ref => this.
|
|
69
|
+
return (index.h(index.Host, null, this.opened ? (index.h("div", { class: "overlay", ref: ref => this._popupRef = ref, tabIndex: -1 }, index.h("div", { class: "popup col " + this.getGridSize() }, index.h("div", { class: "popup__container " + (this.heightMode === "auto" ? "popup__container--auto" : "") }, index.h("div", { class: "popup__content" }, index.h("div", { class: "popup__header " + (this.useHeader ? "popup__header--padding" : "") }, this.useHeader &&
|
|
65
70
|
index.h(index.Fragment, null, !!this.ezTitle && index.h("div", { class: "popup__title" }, this.ezTitle), index.h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezClosePopup.emit(); } }))), index.h("div", { class: "popup__expandable-content" }, index.h("slot", null))))))) : undefined));
|
|
66
71
|
}
|
|
72
|
+
get _element() { return index.getElement(this); }
|
|
67
73
|
static get watchers() { return {
|
|
68
74
|
"opened": ["observeConfig"]
|
|
69
75
|
}; }
|
|
@@ -319,9 +319,12 @@ const EzSearch = class {
|
|
|
319
319
|
}
|
|
320
320
|
scrollToOption(opt) {
|
|
321
321
|
window.requestAnimationFrame(() => {
|
|
322
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
323
|
-
|
|
322
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
323
|
+
? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
|
|
324
|
+
: undefined;
|
|
325
|
+
if (liElem) {
|
|
324
326
|
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
327
|
+
}
|
|
325
328
|
});
|
|
326
329
|
}
|
|
327
330
|
selectCurrentOption() {
|