@sankhyalabs/ezui 1.1.141 → 1.1.144
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 +1 -1
- package/dist/cjs/ez-card-item.cjs.entry.js +44 -0
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +3 -2
- package/dist/cjs/ez-combo-box.cjs.entry.js +41 -20
- package/dist/cjs/ez-date-input.cjs.entry.js +16 -5
- package/dist/cjs/ez-date-time-input.cjs.entry.js +7 -1
- package/dist/cjs/ez-form.cjs.entry.js +74 -21
- package/dist/cjs/ez-grid.cjs.entry.js +2 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +8 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +35 -22
- package/dist/cjs/ez-text-input.cjs.entry.js +11 -9
- package/dist/cjs/ez-time-input.cjs.entry.js +5 -0
- package/dist/cjs/ez-upload.cjs.entry.js +28 -9
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-button/ez-button.css +6 -0
- package/dist/collection/components/ez-card-item/ez-card-item.css +115 -0
- package/dist/collection/components/ez-card-item/ez-card-item.js +86 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +4 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +2 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +43 -21
- package/dist/collection/components/ez-date-input/ez-date-input.js +49 -5
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +40 -1
- package/dist/collection/components/ez-form/DataBinder.js +54 -8
- package/dist/collection/components/ez-form/ez-form.js +14 -7
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +7 -7
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +2 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +41 -1
- package/dist/collection/components/ez-text-area/ez-text-area.js +35 -22
- package/dist/collection/components/ez-text-input/ez-text-input.js +11 -9
- package/dist/collection/components/ez-time-input/ez-time-input.js +38 -0
- package/dist/collection/components/ez-upload/RemoteFile.js +6 -1
- package/dist/collection/components/ez-upload/ez-upload.js +36 -8
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +275 -94
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-card-item.entry.js +40 -0
- package/dist/esm/ez-collapsible-box.entry.js +3 -2
- package/dist/esm/ez-combo-box.entry.js +41 -20
- package/dist/esm/ez-date-input.entry.js +16 -5
- package/dist/esm/ez-date-time-input.entry.js +7 -1
- package/dist/esm/ez-form.entry.js +75 -22
- package/dist/esm/ez-grid.entry.js +2 -0
- package/dist/esm/ez-number-input.entry.js +8 -1
- package/dist/esm/ez-text-area.entry.js +35 -22
- package/dist/esm/ez-text-input.entry.js +11 -9
- package/dist/esm/ez-time-input.entry.js +5 -0
- package/dist/esm/ez-upload.entry.js +28 -9
- 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-024df41e.entry.js +1 -0
- package/dist/ezui/p-140f7085.entry.js +1 -0
- package/dist/ezui/p-24e98dc1.entry.js +1 -0
- package/dist/ezui/p-49fdfa4b.entry.js +1 -0
- package/dist/ezui/p-4fdceb7d.entry.js +1 -0
- package/dist/ezui/p-5a05f1ea.entry.js +1 -0
- package/dist/ezui/p-6395ed55.entry.js +1 -0
- package/dist/ezui/{p-1b2bf15d.entry.js → p-6816c9ee.entry.js} +1 -1
- package/dist/ezui/p-7746460e.entry.js +1 -0
- package/dist/ezui/p-b524dfca.entry.js +1 -0
- package/dist/ezui/{p-8cb2c629.entry.js → p-c15d4d6f.entry.js} +1 -1
- package/dist/ezui/p-c77c0022.entry.js +1 -0
- package/dist/ezui/p-ec21ecce.entry.js +1 -0
- package/dist/types/components/ez-card-item/ez-card-item.d.ts +23 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +5 -1
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +12 -1
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +11 -0
- package/dist/types/components/ez-form/DataBinder.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +11 -0
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +4 -3
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +1 -1
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +10 -0
- package/dist/types/components/ez-upload/ez-upload.d.ts +5 -0
- package/dist/types/components.d.ts +53 -0
- package/package.json +2 -2
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-248361f5.entry.js +0 -1
- package/dist/ezui/p-347b145b.entry.js +0 -1
- package/dist/ezui/p-9b82c2fe.entry.js +0 -1
- package/dist/ezui/p-b8d64970.entry.js +0 -1
- package/dist/ezui/p-c620258b.entry.js +0 -1
- package/dist/ezui/p-cabe3671.entry.js +0 -1
- package/dist/ezui/p-cb73bee7.entry.js +0 -1
- package/dist/ezui/p-db0981c1.entry.js +0 -1
- package/dist/ezui/p-dd6f4872.entry.js +0 -1
- package/dist/ezui/p-ec8419f1.entry.js +0 -1
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-c15a9551.js');
|
|
6
6
|
|
|
7
|
-
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)}";
|
|
7
|
+
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:focus{outline:none;outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}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
8
|
|
|
9
9
|
let EzButton = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-c15a9551.js');
|
|
6
|
+
|
|
7
|
+
const ezCardItemCss = ":host{--ez-card-item--font-size:var(--text--medium, 14px);--ez-card-item--font-family:var(--font-pattern, Arial);--ez-card-item--font-weight:var(--text-weight--medium, 400);--ez-card-item--font-weight-large:var(--text-weight--large, 600);--ez-card-item--color:var(--title--primary, #626e82);--ez-card-item__detail-label--color:var(--text--secondary, #A2ABB9);--ez-card-item__detail--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__title--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__highlight--color:var(--color--primary-300, #E2F4EF);width:100%;display:flex;cursor:pointer}.card-item{display:flex;flex-direction:column;width:100%;cursor:pointer;padding:12px;z-index:0;position:relative}.card-item:hover{background:#F0F3F7;border-radius:12px}.card-item__title{line-height:18px;cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight-large);color:var(--ez-card-item--color);padding-bottom:var(--ez-card-item__title--padding-bottom)}.card-item__details{display:flex;cursor:pointer;justify-content:space-between;gap:var(--space--small, 6px)}.card-item__details-left{cursor:pointer;width:50%}.card-item__details-right{width:50%;cursor:pointer}.card-item__detail:not(:last-child){cursor:pointer;padding-bottom:var(--ez-card-item__detail--padding-bottom)}.card-item__detail-label{cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item__detail-label--color)}.card-item__detail-value{cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item--color)}.card-item__highlight{position:relative;border-radius:8px;z-index:-1;background-color:var(--ez-card-item__highlight--color);outline:2px solid var(--ez-card-item__highlight--color);box-shadow:-4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color)}";
|
|
8
|
+
|
|
9
|
+
let EzCardItem = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.ezClick = index.createEvent(this, "ezClick", 7);
|
|
13
|
+
}
|
|
14
|
+
componentWillRender() {
|
|
15
|
+
this.createDetailList();
|
|
16
|
+
}
|
|
17
|
+
createDetailList() {
|
|
18
|
+
var _a, _b, _c;
|
|
19
|
+
this._details = { detailsLeft: [], detailsRight: [] };
|
|
20
|
+
let cont = 0;
|
|
21
|
+
if ((_a = this.item) === null || _a === void 0 ? void 0 : _a.details) {
|
|
22
|
+
for (const attribute in this.item.details) {
|
|
23
|
+
cont < 3 ?
|
|
24
|
+
this._details.detailsLeft.push({ label: attribute, value: (_b = this.item.details[attribute]) === null || _b === void 0 ? void 0 : _b.toString() }) :
|
|
25
|
+
this._details.detailsRight.push({ label: attribute, value: (_c = this.item.details[attribute]) === null || _c === void 0 ? void 0 : _c.toString() });
|
|
26
|
+
cont++;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
buildDetailContent(detail) {
|
|
31
|
+
return index.h("div", { class: "card-item__detail" }, index.h("label", { class: "card-item__detail-label" }, detail.label), ": ", index.h("label", { class: "card-item__detail-value", innerHTML: detail.value }));
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return (index.h(index.Host, null, this.item &&
|
|
35
|
+
index.h("div", { class: "card-item", onClick: () => { this.ezClick.emit(this.item); } }, index.h("label", { class: "card-item__title", innerHTML: this.item.key + ' - ' + this.item.title }), index.h("div", { class: "card-item__details" }, index.h("div", { class: "card-item__details-left" }, this._details.detailsLeft.map(detail => {
|
|
36
|
+
return this.buildDetailContent(detail);
|
|
37
|
+
})), index.h("div", { class: "card-item__details-right" }, this._details.detailsRight.map(detail => {
|
|
38
|
+
return this.buildDetailContent(detail);
|
|
39
|
+
}))))));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
EzCardItem.style = ezCardItemCss;
|
|
43
|
+
|
|
44
|
+
exports.ez_card_item = EzCardItem;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-c15a9551.js');
|
|
6
6
|
|
|
7
|
-
const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--stretched{width:100%;justify-content:space-between}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";
|
|
7
|
+
const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--stretched{width:100%;justify-content:space-between}.collapsible-box__title--no-margin{margin-bottom:0}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";
|
|
8
8
|
|
|
9
9
|
let EzCollapsibleBox = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -49,7 +49,8 @@ let EzCollapsibleBox = class {
|
|
|
49
49
|
render() {
|
|
50
50
|
return (index.h("div", { class: "collapsible-box" }, index.h("div", { class: "collapsible-box__header" }, index.h("button", { onClick: () => this.showHide(), class: "collapsible-box__title" +
|
|
51
51
|
(this.iconPlacement === "right" ? " collapsible-box__title--icon-right" : "") +
|
|
52
|
-
(this.stretchTitle ? " collapsible-box__title--stretched" : "")
|
|
52
|
+
(this.stretchTitle ? " collapsible-box__title--stretched" : "") +
|
|
53
|
+
(this.value ? " collapsible-box__title--no-margin" : "") }, index.h("ez-icon", { slot: "icon", "icon-name": "chevron-right", size: this.getHeaderSize(), class: "collapsible-box__icon collapsible-box__icon--" + this.getHeaderSize() + (this.value ? " collapsible-box__icon--collapsed" : "") }), index.h("label", { class: "collapsible-box__label font--" + this.getHeaderSize(), title: this.label }, this.label))), index.h("div", { class: "collapsible-box__content" + (this.value ? "" : " collapsible-box__content--show") }, index.h("slot", null))));
|
|
53
54
|
}
|
|
54
55
|
static get watchers() { return {
|
|
55
56
|
"value": ["observeCollapsedValue"]
|
|
@@ -12,6 +12,9 @@ let EzComboBox = class {
|
|
|
12
12
|
constructor(hostRef) {
|
|
13
13
|
index.registerInstance(this, hostRef);
|
|
14
14
|
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
15
|
+
this._limitCharsToSearch = 3;
|
|
16
|
+
this._deboucingTime = 300;
|
|
17
|
+
this._startLoading = false;
|
|
15
18
|
/**
|
|
16
19
|
* Deixa o campo disponível ou não para interação com usuário.
|
|
17
20
|
*/
|
|
@@ -148,19 +151,8 @@ let EzComboBox = class {
|
|
|
148
151
|
this._preSelection = undefined;
|
|
149
152
|
}
|
|
150
153
|
}
|
|
151
|
-
selectOption(opt) {
|
|
152
|
-
const currentOpt = this.getSelectedOption();
|
|
153
|
-
if (currentOpt !== opt) {
|
|
154
|
-
const adjustedOpt = !(opt === null || opt === void 0 ? void 0 : opt.value) ? undefined : opt;
|
|
155
|
-
this.value = adjustedOpt;
|
|
156
|
-
this.errorMessage = "";
|
|
157
|
-
this.ezChange.emit(adjustedOpt);
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
this.observeValue();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
154
|
updateSource(source) {
|
|
155
|
+
this._startLoading = false;
|
|
164
156
|
if (source instanceof Promise) {
|
|
165
157
|
source.then(result => this.updateSource(result));
|
|
166
158
|
this.updateVisibleOptions();
|
|
@@ -171,12 +163,26 @@ let EzComboBox = class {
|
|
|
171
163
|
this.updateVisibleOptions();
|
|
172
164
|
}
|
|
173
165
|
else {
|
|
174
|
-
this.
|
|
166
|
+
this.selectOption(source);
|
|
175
167
|
}
|
|
176
168
|
}
|
|
177
169
|
}
|
|
170
|
+
selectOption(newOption) {
|
|
171
|
+
var _a, _b;
|
|
172
|
+
const currentOpt = this.getSelectedOption();
|
|
173
|
+
if (((_a = currentOpt === null || currentOpt === void 0 ? void 0 : currentOpt.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOption === null || newOption === void 0 ? void 0 : newOption.value) === null || _b === void 0 ? void 0 : _b.toString())) {
|
|
174
|
+
const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
|
|
175
|
+
this.value = adjustedOpt;
|
|
176
|
+
this.errorMessage = "";
|
|
177
|
+
this.ezChange.emit(this.value);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
this.observeValue();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
178
183
|
loadOptions(mode, argument = "") {
|
|
179
184
|
this._criteria = argument;
|
|
185
|
+
this._startLoading = true;
|
|
180
186
|
if (this.optionLoader) {
|
|
181
187
|
this.updateSource(this.optionLoader({ mode, argument }));
|
|
182
188
|
}
|
|
@@ -233,25 +239,40 @@ let EzComboBox = class {
|
|
|
233
239
|
this.searchMode ? this.loadOptions("ADVANCED") : this.showOptions();
|
|
234
240
|
}
|
|
235
241
|
onTextInputChangeHandler(event) {
|
|
242
|
+
var _a;
|
|
243
|
+
this.clearDeboucingTimeout();
|
|
244
|
+
if (this._startLoading) {
|
|
245
|
+
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
246
|
+
this.onTextInputChangeHandler(event);
|
|
247
|
+
}, this._deboucingTime);
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
236
250
|
if (!this._criteria) {
|
|
237
251
|
this._inputElement.value = event.data;
|
|
238
252
|
}
|
|
239
|
-
const argument = event.target.value;
|
|
253
|
+
const argument = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.trim();
|
|
254
|
+
const argumentNumber = Number(argument || undefined);
|
|
240
255
|
this._criteria = argument;
|
|
241
|
-
if (this.
|
|
256
|
+
if (argument && (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch)) {
|
|
242
257
|
if (this.searchMode) {
|
|
243
|
-
if (this._changeDeboucingTimeout) {
|
|
244
|
-
window.clearTimeout(this._changeDeboucingTimeout);
|
|
245
|
-
}
|
|
246
258
|
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
247
|
-
this.loadOptions("PREDICTIVE", argument);
|
|
248
|
-
},
|
|
259
|
+
this.loadOptions("PREDICTIVE", isNaN(argumentNumber) ? argument : argumentNumber.toString());
|
|
260
|
+
}, this._deboucingTime);
|
|
249
261
|
}
|
|
250
262
|
else {
|
|
251
263
|
this.updateVisibleOptions();
|
|
252
264
|
}
|
|
253
265
|
this.showOptions();
|
|
254
266
|
}
|
|
267
|
+
else {
|
|
268
|
+
this.hideOptions();
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
clearDeboucingTimeout() {
|
|
272
|
+
if (this._changeDeboucingTimeout) {
|
|
273
|
+
window.clearTimeout(this._changeDeboucingTimeout);
|
|
274
|
+
this._changeDeboucingTimeout = undefined;
|
|
275
|
+
}
|
|
255
276
|
}
|
|
256
277
|
onTextInputClickHandler() {
|
|
257
278
|
if (!this.searchMode) {
|
|
@@ -12,6 +12,8 @@ let EzDateInput = class {
|
|
|
12
12
|
constructor(hostRef) {
|
|
13
13
|
index.registerInstance(this, hostRef);
|
|
14
14
|
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
15
|
+
this.ezStartChange = index.createEvent(this, "ezStartChange", 7);
|
|
16
|
+
this.ezCancelWaitingChange = index.createEvent(this, "ezCancelWaitingChange", 7);
|
|
15
17
|
/**
|
|
16
18
|
* Deixa o campo disponível ou não para uso.
|
|
17
19
|
*/
|
|
@@ -25,11 +27,16 @@ let EzDateInput = class {
|
|
|
25
27
|
this._textInput.label = this.label;
|
|
26
28
|
}
|
|
27
29
|
observeErrorMessage() {
|
|
28
|
-
this._textInput.errorMessage = this.errorMessage;
|
|
29
|
-
}
|
|
30
|
-
observeValue() {
|
|
31
30
|
if (this._textInput) {
|
|
32
|
-
this._textInput.
|
|
31
|
+
this._textInput.errorMessage = this.errorMessage;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
observeValue(newValue, oldValue) {
|
|
35
|
+
if (newValue != oldValue) {
|
|
36
|
+
if (this._textInput) {
|
|
37
|
+
this.errorMessage = "";
|
|
38
|
+
this._textInput.value = this.getTextValue(this.value);
|
|
39
|
+
}
|
|
33
40
|
}
|
|
34
41
|
}
|
|
35
42
|
/**
|
|
@@ -79,12 +86,16 @@ let EzDateInput = class {
|
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
else {
|
|
89
|
+
this.ezCancelWaitingChange.emit();
|
|
82
90
|
this._textInput.errorMessage = "O valor digitado não é uma data válida";
|
|
83
91
|
}
|
|
84
92
|
}
|
|
85
93
|
getTextValue(d) {
|
|
86
94
|
return d ? new Intl.DateTimeFormat("pt-BR").format(d) : undefined;
|
|
87
95
|
}
|
|
96
|
+
startChange() {
|
|
97
|
+
this.ezStartChange.emit({ waitmessage: "", blocking: false });
|
|
98
|
+
}
|
|
88
99
|
componentDidLoad() {
|
|
89
100
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
90
101
|
}
|
|
@@ -92,7 +103,7 @@ let EzDateInput = class {
|
|
|
92
103
|
return (index.h(index.Host, null, index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => {
|
|
93
104
|
if (event.key === "H" || event.key === "h")
|
|
94
105
|
this.changeValue(new Date());
|
|
95
|
-
}, label: this.label, value: this.getTextValue(this.value), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true }, index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), index.h("ez-calendar", { onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem })));
|
|
106
|
+
}, label: this.label, value: this.getTextValue(this.value), onInput: () => this.startChange(), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true }, index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), index.h("ez-calendar", { onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem })));
|
|
96
107
|
}
|
|
97
108
|
get _elem() { return index.getElement(this); }
|
|
98
109
|
static get watchers() { return {
|
|
@@ -12,6 +12,8 @@ let EzDateTimeInput = class {
|
|
|
12
12
|
constructor(hostRef) {
|
|
13
13
|
index.registerInstance(this, hostRef);
|
|
14
14
|
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
15
|
+
this.ezStartChange = index.createEvent(this, "ezStartChange", 7);
|
|
16
|
+
this.ezCancelWaitingChange = index.createEvent(this, "ezCancelWaitingChange", 7);
|
|
15
17
|
/**
|
|
16
18
|
* Deixa o campo disponível ou não para uso.
|
|
17
19
|
*/
|
|
@@ -117,6 +119,7 @@ let EzDateTimeInput = class {
|
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
else {
|
|
122
|
+
this.ezCancelWaitingChange.emit();
|
|
120
123
|
this._textInput.errorMessage = "O valor digitado não é uma data válida";
|
|
121
124
|
}
|
|
122
125
|
}
|
|
@@ -131,11 +134,14 @@ let EzDateTimeInput = class {
|
|
|
131
134
|
};
|
|
132
135
|
return d ? (new Intl.DateTimeFormat('pt-BR', this.showSeconds ? optionsSecond : options).format(d)) : undefined;
|
|
133
136
|
}
|
|
137
|
+
startChange() {
|
|
138
|
+
this.ezStartChange.emit({ waitmessage: "", blocking: false });
|
|
139
|
+
}
|
|
134
140
|
componentDidLoad() {
|
|
135
141
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
136
142
|
}
|
|
137
143
|
render() {
|
|
138
|
-
return (index.h(index.Host, null, index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => { this.onChangeKeyDown(event); }, label: this.label, value: this.getTextValue(this.value), restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, onFocus: () => this.onFocused(), onClick: () => this.onClicked(), slaveMode: true }, index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), index.h("ez-calendar", { onEzChange: (event) => { this.changeValue(this._calendar.value); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem, time: true, showSeconds: this.showSeconds })));
|
|
144
|
+
return (index.h(index.Host, null, index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => { this.onChangeKeyDown(event); }, label: this.label, value: this.getTextValue(this.value), restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, onInput: () => this.startChange(), onFocus: () => this.onFocused(), onClick: () => this.onClicked(), slaveMode: true }, index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), index.h("ez-calendar", { onEzChange: (event) => { this.changeValue(this._calendar.value); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem, time: true, showSeconds: this.showSeconds })));
|
|
139
145
|
}
|
|
140
146
|
get _elem() { return index.getElement(this); }
|
|
141
147
|
static get watchers() { return {
|
|
@@ -181,7 +181,7 @@ const buildFromDataUnit = (dataUnit) => {
|
|
|
181
181
|
.filter(descriptor => descriptor.required)
|
|
182
182
|
.map(descriptor => descriptor.name),
|
|
183
183
|
cleanOnCopyFields: visibleFields
|
|
184
|
-
.filter(descriptor => { var _a; return (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy; })
|
|
184
|
+
.filter(descriptor => { var _a, _b; return ((_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy) || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum); })
|
|
185
185
|
.map(descriptor => descriptor.name),
|
|
186
186
|
defaultValues
|
|
187
187
|
});
|
|
@@ -193,7 +193,7 @@ function getTabConfig(tab, sheets) {
|
|
|
193
193
|
return tabConfig || { label: tab, visible: true };
|
|
194
194
|
}
|
|
195
195
|
function sortTabs(a, b) {
|
|
196
|
-
return a[0].label == '
|
|
196
|
+
return a[0].label == '__main' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
|
|
197
197
|
}
|
|
198
198
|
const buildFromConfig = (fields, dataUnit) => {
|
|
199
199
|
const sheets = new Map();
|
|
@@ -201,9 +201,9 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
201
201
|
const cleanOnCopyFields = [];
|
|
202
202
|
const defaultValues = {};
|
|
203
203
|
fields.forEach(config => {
|
|
204
|
-
var _a, _b;
|
|
204
|
+
var _a, _b, _c;
|
|
205
205
|
if (config.visible !== false) {
|
|
206
|
-
const tabConfig = getTabConfig(config.tab || "
|
|
206
|
+
const tabConfig = getTabConfig(config.tab || "__main", sheets);
|
|
207
207
|
const descriptor = dataUnit.getField(config.name);
|
|
208
208
|
if (descriptor && tabConfig.visible) {
|
|
209
209
|
if (!sheets.has(tabConfig)) {
|
|
@@ -214,11 +214,11 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
214
214
|
if (isRequired) {
|
|
215
215
|
requiredFields.push(config.name);
|
|
216
216
|
}
|
|
217
|
-
const clearOnCopy = config.cleanOnCopy === undefined ? (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy : config.cleanOnCopy;
|
|
217
|
+
const clearOnCopy = config.cleanOnCopy === undefined ? (((_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy) || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum)) : config.cleanOnCopy;
|
|
218
218
|
if (clearOnCopy) {
|
|
219
219
|
cleanOnCopyFields.push(config.name);
|
|
220
220
|
}
|
|
221
|
-
const defaultValue = config.defaultValue === undefined ? (
|
|
221
|
+
const defaultValue = config.defaultValue === undefined ? (_c = descriptor.properties) === null || _c === void 0 ? void 0 : _c.defaultValue : config.defaultValue;
|
|
222
222
|
if (defaultValue) {
|
|
223
223
|
defaultValues[config.name] = config.defaultValue;
|
|
224
224
|
}
|
|
@@ -244,7 +244,7 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
244
244
|
.sort(sortTabs)
|
|
245
245
|
.forEach(([key, value]) => {
|
|
246
246
|
metadata.addSheet({
|
|
247
|
-
label: key.label,
|
|
247
|
+
label: (key.label === "__main") ? "Principal" : key.label,
|
|
248
248
|
name: key.label,
|
|
249
249
|
items: Array.from(value.values()),
|
|
250
250
|
requiredFields,
|
|
@@ -654,11 +654,7 @@ class DataBinder {
|
|
|
654
654
|
this._dataUnit.unsubscribe(this.onDataUnitEvent);
|
|
655
655
|
}
|
|
656
656
|
updateValue(fieldName, field) {
|
|
657
|
-
|
|
658
|
-
const newValue = this._dataUnit.getFieldValue(fieldName);
|
|
659
|
-
if (oldValue != newValue) {
|
|
660
|
-
field["value"] = newValue;
|
|
661
|
-
}
|
|
657
|
+
field["value"] = this._dataUnit.getFieldValue(fieldName);
|
|
662
658
|
}
|
|
663
659
|
updateBind(fieldName, field) {
|
|
664
660
|
const oldBind = this._fields.get(fieldName);
|
|
@@ -666,21 +662,53 @@ class DataBinder {
|
|
|
666
662
|
oldBind.destroy();
|
|
667
663
|
}
|
|
668
664
|
field["value"] = this._dataUnit.getFieldValue(fieldName);
|
|
669
|
-
this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, waitingChange) => this.changeStarted(fieldName, waitingChange), (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
|
|
665
|
+
this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, waitingChange) => this.changeStarted(fieldName, waitingChange), (fieldName) => this.cancelWaitingChange(fieldName), (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
|
|
670
666
|
this.bindSearchOptionsLoader(fieldName, field);
|
|
671
667
|
this.applyEzUploadContext(fieldName, field);
|
|
672
668
|
}
|
|
673
669
|
changeStarted(fieldName, waitingChange) {
|
|
670
|
+
/**
|
|
671
|
+
* se o waitingChange não é blocante, add um event listener pra
|
|
672
|
+
* fazer o accept da promise
|
|
673
|
+
*
|
|
674
|
+
* se não tiver promise no waitingChange, eu crio uma e resolvo no bind
|
|
675
|
+
*
|
|
676
|
+
*
|
|
677
|
+
*/
|
|
674
678
|
if (this._dataUnit.records.length === 0) {
|
|
675
679
|
this._dataUnit.addRecord();
|
|
676
680
|
}
|
|
681
|
+
if (!waitingChange.blocking && waitingChange.promise == undefined) {
|
|
682
|
+
const bind = this._fields.get(fieldName);
|
|
683
|
+
if (bind) {
|
|
684
|
+
waitingChange.promise = new Promise((resolve, reject) => {
|
|
685
|
+
bind.waitingChangePromiseResolve = resolve;
|
|
686
|
+
bind.waitingChangePromiseReject = reject;
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
}
|
|
677
690
|
this._dataUnit.startChange(fieldName, waitingChange);
|
|
678
691
|
}
|
|
692
|
+
cancelWaitingChange(fieldName) {
|
|
693
|
+
if (this._dataUnit.waitingForChange(fieldName)) {
|
|
694
|
+
this._dataUnit.cancelWaitingChange(fieldName);
|
|
695
|
+
const bind = this._fields.get(fieldName);
|
|
696
|
+
if (bind) {
|
|
697
|
+
bind.rejectWaitingChange(new core.WaitingChangeException("Change canceled", fieldName));
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
679
701
|
setFieldValue(fieldName, newValue) {
|
|
680
702
|
if (this._dataUnit.records.length === 0) {
|
|
681
703
|
this._dataUnit.addRecord();
|
|
682
704
|
}
|
|
683
705
|
this._dataUnit.setFieldValue(fieldName, newValue);
|
|
706
|
+
if (this._dataUnit.waitingForChange(fieldName)) {
|
|
707
|
+
const bind = this._fields.get(fieldName);
|
|
708
|
+
if (bind) {
|
|
709
|
+
bind.acceptWaitingChange();
|
|
710
|
+
}
|
|
711
|
+
}
|
|
684
712
|
}
|
|
685
713
|
bindSearchOptionsLoader(fieldName, field) {
|
|
686
714
|
if (field.nodeName === "EZ-SEARCH" && field["optionLoader"] == undefined) {
|
|
@@ -709,18 +737,36 @@ class DataBinder {
|
|
|
709
737
|
class Bind {
|
|
710
738
|
constructor() {
|
|
711
739
|
this.startChangeEventName = "ezStartChange";
|
|
740
|
+
this.cancelWaitingChangeEventName = "ezCancelWaitingChange";
|
|
712
741
|
this.changeEventName = "ezChange";
|
|
713
742
|
}
|
|
714
743
|
destroy() {
|
|
715
744
|
this.field.removeEventListener(this.startChangeEventName, this.startChangeListener);
|
|
745
|
+
this.field.removeEventListener(this.cancelWaitingChangeEventName, this.cancelWaitingChangeListener);
|
|
716
746
|
this.field.removeEventListener(this.changeEventName, this.changeListener);
|
|
717
747
|
}
|
|
718
|
-
|
|
748
|
+
acceptWaitingChange() {
|
|
749
|
+
if (this.waitingChangePromiseResolve) {
|
|
750
|
+
this.waitingChangePromiseResolve();
|
|
751
|
+
this.waitingChangePromiseReject = undefined;
|
|
752
|
+
this.waitingChangePromiseResolve = undefined;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
rejectWaitingChange(reason) {
|
|
756
|
+
if (this.waitingChangePromiseReject) {
|
|
757
|
+
this.waitingChangePromiseReject(reason);
|
|
758
|
+
this.waitingChangePromiseReject = undefined;
|
|
759
|
+
this.waitingChangePromiseResolve = undefined;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
static create(fieldName, field, startChangeCallback, cancelWaitingChangeCallback, changeCallback) {
|
|
719
763
|
const b = new Bind();
|
|
720
764
|
b.field = field;
|
|
721
765
|
b.fieldName = fieldName;
|
|
722
766
|
b.startChangeListener = (evt) => { startChangeCallback(fieldName, evt.detail); };
|
|
723
767
|
b.field.addEventListener(b.startChangeEventName, b.startChangeListener);
|
|
768
|
+
b.cancelWaitingChangeListener = () => { cancelWaitingChangeCallback(fieldName); };
|
|
769
|
+
b.field.addEventListener(b.cancelWaitingChangeEventName, b.cancelWaitingChangeListener);
|
|
724
770
|
b.changeListener = (evt) => { changeCallback(fieldName, evt.detail); };
|
|
725
771
|
b.field.addEventListener(b.changeEventName, b.changeListener);
|
|
726
772
|
return b;
|
|
@@ -770,12 +816,20 @@ let EzForm = class {
|
|
|
770
816
|
requiredFields.forEach(field => {
|
|
771
817
|
const value = record[field];
|
|
772
818
|
const fieldElem = this._element.querySelector(`[data-field-name=${field}]`);
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
819
|
+
/**
|
|
820
|
+
* TODO: fieldElem vai ser vazio quando o campo está em uma aba que
|
|
821
|
+
* está escondida.
|
|
822
|
+
* Temos que tratar esse caso para apresentar a mensagem de erro
|
|
823
|
+
* na aba, isso será tratado no card: https://sankhya.atlassian.net/browse/SKA-44182
|
|
824
|
+
*/
|
|
825
|
+
if (fieldElem) {
|
|
826
|
+
if (value === null || value === undefined || value === "") {
|
|
827
|
+
invalidFields.push(field);
|
|
828
|
+
fieldElem["errorMessage"] = "Essa informação é obrigatória";
|
|
829
|
+
}
|
|
830
|
+
else {
|
|
831
|
+
fieldElem["errorMessage"] = "";
|
|
832
|
+
}
|
|
779
833
|
}
|
|
780
834
|
});
|
|
781
835
|
const isValid = invalidFields.length === 0;
|
|
@@ -825,7 +879,6 @@ let EzForm = class {
|
|
|
825
879
|
}
|
|
826
880
|
}
|
|
827
881
|
if (action.type === core.Action.RECORDS_ADDED) {
|
|
828
|
-
debugger;
|
|
829
882
|
const metadata = selectFormMetadata(this._store.getState());
|
|
830
883
|
const defaultValues = metadata.getDefaultValues();
|
|
831
884
|
if (defaultValues) {
|
|
@@ -110066,6 +110066,7 @@ class AgGridController {
|
|
|
110066
110066
|
this.DEFAULT_ROW_HEIGHT = 25;
|
|
110067
110067
|
this.CHECK_BOX_COL_ID = "checkBoxColumn";
|
|
110068
110068
|
this.RECORD_ARCHIVE_COL_ID = "__RECORD_ARCHIVE__";
|
|
110069
|
+
this.BLOCK_LOAD_DEBOUNCE = 400;
|
|
110069
110070
|
this._menuItems = [];
|
|
110070
110071
|
this._idAttribName = "__record__id__";
|
|
110071
110072
|
this._isFirstRecordOfPage = true;
|
|
@@ -110109,6 +110110,7 @@ class AgGridController {
|
|
|
110109
110110
|
rowSelection: this._multipleSelection ? "multiple" : "single",
|
|
110110
110111
|
serverSideDatasource: this._dataSource,
|
|
110111
110112
|
sortingOrder: ['desc', 'asc', null],
|
|
110113
|
+
blockLoadDebounceMillis: this.BLOCK_LOAD_DEBOUNCE,
|
|
110112
110114
|
getRowNodeId: this._dataUnit ? (params) => typeof params === "string" ? params : params[this._idAttribName] : undefined,
|
|
110113
110115
|
getMainMenuItems: (params) => {
|
|
110114
110116
|
const column = params.column;
|
|
@@ -12,6 +12,8 @@ let EzNumberInput = class {
|
|
|
12
12
|
constructor(hostRef) {
|
|
13
13
|
index.registerInstance(this, hostRef);
|
|
14
14
|
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
15
|
+
this.ezStartChange = index.createEvent(this, "ezStartChange", 7);
|
|
16
|
+
this.ezCancelWaitingChange = index.createEvent(this, "ezCancelWaitingChange", 7);
|
|
15
17
|
/**
|
|
16
18
|
* Deixa o campo disponível ou não para uso.
|
|
17
19
|
*/
|
|
@@ -61,6 +63,7 @@ let EzNumberInput = class {
|
|
|
61
63
|
parseNumber() {
|
|
62
64
|
const parsedNumber = this._textInput.value ? core.NumberUtils.stringToNumber(this._textInput.value) : undefined;
|
|
63
65
|
if (parsedNumber !== undefined && isNaN(parsedNumber)) {
|
|
66
|
+
this.ezCancelWaitingChange.emit();
|
|
64
67
|
this.errorMessage = "O valor digitado não é um número válido";
|
|
65
68
|
}
|
|
66
69
|
else {
|
|
@@ -68,6 +71,7 @@ let EzNumberInput = class {
|
|
|
68
71
|
this.changeValue(parsedNumber);
|
|
69
72
|
}
|
|
70
73
|
catch (e) {
|
|
74
|
+
this.ezCancelWaitingChange.emit();
|
|
71
75
|
this.errorMessage = e.message;
|
|
72
76
|
return;
|
|
73
77
|
}
|
|
@@ -79,11 +83,14 @@ let EzNumberInput = class {
|
|
|
79
83
|
}
|
|
80
84
|
return undefined;
|
|
81
85
|
}
|
|
86
|
+
startChange() {
|
|
87
|
+
this.ezStartChange.emit({ waitmessage: "", blocking: false });
|
|
88
|
+
}
|
|
82
89
|
componentDidLoad() {
|
|
83
90
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
84
91
|
}
|
|
85
92
|
render() {
|
|
86
|
-
return (index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true }));
|
|
93
|
+
return (index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onInput: () => this.startChange(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true }));
|
|
87
94
|
}
|
|
88
95
|
get _elem() { return index.getElement(this); }
|
|
89
96
|
static get watchers() { return {
|
|
@@ -39,11 +39,17 @@ let EzTextArea = class {
|
|
|
39
39
|
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove('hasError');
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
observeValue() {
|
|
43
|
-
this._inputElem
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
observeValue(newValue, oldValue) {
|
|
43
|
+
if (this._inputElem) {
|
|
44
|
+
if (newValue != oldValue) {
|
|
45
|
+
if (this.canChangeValue()) {
|
|
46
|
+
this._inputElem.value = this.value || "";
|
|
47
|
+
}
|
|
48
|
+
this.adjustFloatingLabel();
|
|
49
|
+
this.errorMessage = "";
|
|
50
|
+
this.ezChange.emit(this.value);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
47
53
|
}
|
|
48
54
|
observeMode() {
|
|
49
55
|
if (this._initialRows == undefined) {
|
|
@@ -61,6 +67,27 @@ let EzTextArea = class {
|
|
|
61
67
|
this._initialRows = rows;
|
|
62
68
|
}
|
|
63
69
|
}
|
|
70
|
+
//---------------------------------------------
|
|
71
|
+
// Public methods
|
|
72
|
+
//---------------------------------------------
|
|
73
|
+
/**
|
|
74
|
+
* Faz o foco no componente de input
|
|
75
|
+
*/
|
|
76
|
+
async setFocus() {
|
|
77
|
+
this._inputElem.focus();
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Remove o foco no componente de input
|
|
81
|
+
*/
|
|
82
|
+
async setBlur() {
|
|
83
|
+
this._inputElem.blur();
|
|
84
|
+
}
|
|
85
|
+
//---------------------------------------------
|
|
86
|
+
// Private methods
|
|
87
|
+
//---------------------------------------------
|
|
88
|
+
canChangeValue() {
|
|
89
|
+
return this._inputElem && (this.value || "") !== this._inputElem.value;
|
|
90
|
+
}
|
|
64
91
|
adjustFloatingLabel() {
|
|
65
92
|
if (this.label && this._labelElem) {
|
|
66
93
|
const hasValue = this.value && this.value.toString().length > 0;
|
|
@@ -81,21 +108,6 @@ let EzTextArea = class {
|
|
|
81
108
|
return this._hostElement.shadowRoot.activeElement !== null;
|
|
82
109
|
}
|
|
83
110
|
//---------------------------------------------
|
|
84
|
-
// Public methods
|
|
85
|
-
//---------------------------------------------
|
|
86
|
-
/**
|
|
87
|
-
* Faz o foco no componente de input
|
|
88
|
-
*/
|
|
89
|
-
async setFocus() {
|
|
90
|
-
this._inputElem.focus();
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Remove o foco no componente de input
|
|
94
|
-
*/
|
|
95
|
-
async setBlur() {
|
|
96
|
-
this._inputElem.blur();
|
|
97
|
-
}
|
|
98
|
-
//---------------------------------------------
|
|
99
111
|
// Event handlers
|
|
100
112
|
//---------------------------------------------
|
|
101
113
|
handleFocusout() {
|
|
@@ -105,8 +117,9 @@ let EzTextArea = class {
|
|
|
105
117
|
}
|
|
106
118
|
}
|
|
107
119
|
handleChange() {
|
|
108
|
-
this.
|
|
109
|
-
|
|
120
|
+
if (this.canChangeValue()) {
|
|
121
|
+
this.value = this._inputElem.value;
|
|
122
|
+
}
|
|
110
123
|
}
|
|
111
124
|
handleFocus() {
|
|
112
125
|
if (this.label && this._labelElem && !this._labelElem.classList.contains("textarea__label--floated")) {
|