@sankhyalabs/ezui 1.1.75 → 1.1.76
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-action-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-button_16.cjs.entry.js +127 -119
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-label-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +21 -2
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/{index-4d2896bb.js → index-9431aeeb.js} +2 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/ez-button/ez-button.css +62 -43
- package/dist/collection/components/ez-button/ez-button.js +9 -2
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +34 -34
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +12 -12
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +2 -2
- package/dist/collection/components/ez-date-input/ez-date-input.css +17 -3
- package/dist/collection/components/ez-date-input/ez-date-input.js +2 -2
- package/dist/collection/components/ez-form/ez-form.js +37 -35
- package/dist/collection/components/ez-form/store/Form.actions.js +16 -16
- package/dist/collection/components/ez-form/store/Form.reducer.js +17 -17
- package/dist/collection/components/ez-form/subcomponents/DataUnit.js +8 -8
- package/dist/collection/components/ez-form/subcomponents/form-metadata.js +12 -12
- package/dist/collection/components/ez-form/subcomponents/place-holder.js +1 -1
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +21 -21
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +7 -7
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.css +4 -4
- package/dist/collection/components/ez-text-input/ez-text-input.css +60 -60
- package/dist/collection/components/ez-text-input/ez-text-input.js +16 -16
- package/dist/collection/components/ez-time-input/ez-time-input.js +3 -2
- package/dist/collection/utils/AssetsUtils.js +19 -0
- package/dist/custom-elements/index.js +149 -122
- package/dist/esm/ez-action-chip.entry.js +1 -1
- package/dist/esm/ez-button_16.entry.js +127 -119
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-label-chip.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +21 -2
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ezui.js +2 -2
- package/dist/esm/{index-33153059.js → index-fd3c8023.js} +2 -1
- package/dist/esm/loader.js +2 -2
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-67410dfa.entry.js → p-11ae4ae7.entry.js} +1 -1
- package/dist/ezui/{p-50464bdf.entry.js → p-47fa3d6c.entry.js} +1 -1
- package/dist/ezui/{p-0d476efb.entry.js → p-66954a04.entry.js} +1 -1
- package/dist/ezui/{p-47406a6e.entry.js → p-823ff0a0.entry.js} +1 -1
- package/dist/ezui/{p-7f3bc6d9.entry.js → p-8ab6168f.entry.js} +1 -1
- package/dist/ezui/{p-15743b09.entry.js → p-9c1fb51c.entry.js} +1 -1
- package/dist/ezui/{p-061d21ba.entry.js → p-9d85125b.entry.js} +1 -1
- package/dist/ezui/{p-34d288d0.entry.js → p-a0b6eee2.entry.js} +1 -1
- package/dist/ezui/p-a7b546b2.entry.js +1 -0
- package/dist/ezui/p-c833c94f.entry.js +1 -0
- package/dist/ezui/{p-8818da66.entry.js → p-d443f020.entry.js} +1 -1
- package/dist/ezui/{p-4df6f855.js → p-e0ab3746.js} +1 -1
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +3 -3
- package/dist/types/components/ez-form/ez-form.d.ts +9 -9
- package/dist/types/components/ez-form/subcomponents/DataUnit.d.ts +1 -1
- package/dist/types/components/ez-form/subcomponents/form-metadata.d.ts +1 -1
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +1 -1
- package/dist/types/components.d.ts +18 -18
- package/dist/types/utils/AssetsUtils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/ezui/p-46d07e59.entry.js +0 -1
- package/dist/ezui/p-7be54779.entry.js +0 -1
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-9431aeeb.js');
|
|
6
6
|
const RequestMetadata = require('./RequestMetadata-2cd01e8a.js');
|
|
7
7
|
const FloatingManager = require('./FloatingManager-6cfeb947.js');
|
|
8
8
|
const CSSVarsUtils = require('./CSSVarsUtils-f8827674.js');
|
|
9
9
|
|
|
10
|
-
const ezButtonCss = ":host{--button--min-width:100px;--button--height:42px;--button__icon--width:18px;--button__inline__icon--padding:12px;--button--padding-top:var(--space--medium, 12px);--button--padding-bottom:var(--space--medium, 12px);--button--padding-right:var(--space--large, 24px);--button--padding-left:var(--space--large, 24px);--button--color:var(--text--primary, #FFF);--button--font-size:var(--text--medium, 14px);--button--font-family:var(--font-pattern, Arial);--button--font-weight:var(--text-weight--large);--button--background-color:var(--background--medium, #c0c0c0);--button--border-radius:var(--border--radius-large, 12px);--button--border:none;--button--hover--background-color:var(--background--strong, var(--button--background-color));--button--disabled-color:var(--text--disable);--button--disabled--background-color:var(--color--disable-secondary);--button--focus--border:var(--button--border);--button--focus--box-shadow:none;--button--link-color:var(--title--primary, '#C0C0C0')}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(--button--min-width);height:var(--button--height);font-family:var(--button--font-family);font-size:var(--button--font-size);font-weight:var(--button--font-weight);padding:var(--button--padding-top) var(--button--padding-right) var(--button--padding-bottom) var(--button--padding-left);border-radius:var(--button--border-radius);background-color:var(--button--background-color);color:var(--button--color);fill:var(--button--color);border:var(--button--border)}button:hover{background-color:var(--button--hover--background-color)}button:focus{outline:none;border:var(--button--focus--border);box-shadow:var(--button--focus--box-shadow)}button:disabled{background-color:var(--button--disabled--background-color);color:var(--button--disabled-color);fill:var(--button--disabled-color);border:none;cursor:no-drop}button.icon{width:42px;min-width:42px;height:42px;padding:0px}a{font-family:var(--button--font-family);font-size:var(--button--font-size);font-weight:var(--button--font-weight);color:var(--button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}";
|
|
10
|
+
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(--text--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--background-color:var(--background--strong, 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(--ez-button--border);--ez-button--focus--box-shadow:none;--ez-button--link-color:var(--title--primary, '#C0C0C0')}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:hover{background-color:var(--ez-button--hover--background-color)}button:focus{outline:none;border:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;cursor:no-drop}button.icon{width:42px;min-width:42px;height:42px;padding:0px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--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)}a{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--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}";
|
|
11
11
|
|
|
12
12
|
let EzButton = class {
|
|
13
13
|
constructor(hostRef) {
|
|
@@ -27,10 +27,10 @@ let EzButton = class {
|
|
|
27
27
|
if (this.mode == "link") {
|
|
28
28
|
content.style.display = "inline";
|
|
29
29
|
if (slot.name == "leftIcon") {
|
|
30
|
-
content.style.paddingRight = "var(--button__inline__icon--padding)";
|
|
30
|
+
content.style.paddingRight = "var(--ez-button__inline__icon--padding)";
|
|
31
31
|
}
|
|
32
32
|
else if (slot.name == "rightIcon") {
|
|
33
|
-
content.style.paddingLeft = "var(--button__inline__icon--padding)";
|
|
33
|
+
content.style.paddingLeft = "var(--ez-button__inline__icon--padding)";
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
@@ -44,6 +44,12 @@ let EzButton = class {
|
|
|
44
44
|
evt.stopPropagation();
|
|
45
45
|
} })));
|
|
46
46
|
}
|
|
47
|
+
else if (this.mode == "label-icon") {
|
|
48
|
+
return (index.h("div", { class: "label-icon" }, index.h("button", { class: "icon", type: "button", disabled: !this.enabled }, index.h("ez-icon", { class: "icon", href: this.image, size: "large", onClick: evt => {
|
|
49
|
+
if (!this.enabled)
|
|
50
|
+
evt.stopPropagation();
|
|
51
|
+
} })), index.h("label", { title: this.label }, this.label)));
|
|
52
|
+
}
|
|
47
53
|
else if (this.mode == "link") {
|
|
48
54
|
return (index.h("a", null, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
49
55
|
}
|
|
@@ -278,7 +284,7 @@ let EzCheck = class {
|
|
|
278
284
|
};
|
|
279
285
|
EzCheck.style = ezCheckCss;
|
|
280
286
|
|
|
281
|
-
const ezCollapsibleBoxCss = ":host{--collapsible-box--height:42px;--collapsible-box--font-size:var(--title--medium, 14px);--collapsible-box--font-family:var(--font-pattern, Arial);--collapsible-box--font-weight:var(--text-weight--large, 600);--collapsible-box--color:var(--title--primary);--collapsible-box__btn--image--xsmall:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"12px\" width=\"7.5px\"><path d=\"M 0,10.56 4.5967752,6.0000006 0,1.3800006 1.4516132,0 7.5,6.0000006 1.4516132,12 Z\"/></svg>');--collapsible-box__btn--image--small:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"14px\" width=\"8.68px\"><path d=\"M 0,12.32 5.3200012,7.0000007 0,1.6100007 1.6800004,0 8.68,7.0000007 1.6800004,14 Z\"/></svg>');--collapsible-box__btn--image--medium:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--collapsible-box__btn--image--large:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"18px\" width=\"11.25px\"><path d=\"M 0,15.84 6.8951628,9.0000009 0,2.0700009 2.1774198,0 11.25,9.0000009 2.1774198,18 Z\"/></svg>');--collapsible-box__btn--image--xlarge:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"20px\" width=\"12.5px\"><path d=\"M 0,17.6 7.661292,10.000001 0,2.300001 2.4193553,0 12.5,10.000001 2.4193553,20 Z\"/></svg>');--collapsible-box__btn--fill:var(--collapsible-box--color);--collapsible-box__btn--width:10px;--collapsible-box__btn--height:16px;display:flex;flex-wrap:wrap;width:100%}.collapsible-box__title{width:100%;align-self:center;display:flex;box-sizing:border-box}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;width:100%;font-family:var(--collapsible-box--font-family);font-size:var(--collapsible-box--font-size);font-weight:var(--collapsible-box--font-weight);color:var(--collapsible-box--color)}.collapsible-box__label--icon-right{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;font-family:var(--collapsible-box--font-family);font-size:var(--collapsible-box--font-size);font-weight:var(--collapsible-box--font-weight);color:var(--collapsible-box--color)}.collapsible-box__btn{outline:none;border:none;background-color:unset;cursor:pointer;padding:1px 6px}.collapsible-box__btn::after{content:'';display:flex;background-color:var(--collapsible-box__btn--fill);width:var(--collapsible-box__btn--width);height:var(--collapsible-box__btn--height);transition:transform var(--transition);transform:rotate(90deg)}.collapsible-box__btn--xsmall::after{width:7.5px;height:12px;-webkit-mask-image:var(--collapsible-box__btn--image--xsmall);mask-image:var(--collapsible-box__btn--image--xsmall)}.collapsible-box__btn--small::after{width:8.68px;height:14px;-webkit-mask-image:var(--collapsible-box__btn--image--small);mask-image:var(--collapsible-box__btn--image--small)}.collapsible-box__btn--medium::after{width:10px;height:16px;-webkit-mask-image:var(--collapsible-box__btn--image--medium);mask-image:var(--collapsible-box__btn--image--medium)}.collapsible-box__btn--large::after{width:11.25px;height:18px;-webkit-mask-image:var(--collapsible-box__btn--image--large);mask-image:var(--collapsible-box__btn--image--large)}.collapsible-box__btn--xlarge::after{width:12.5px;height:20px;-webkit-mask-image:var(--collapsible-box__btn--image--xlarge);mask-image:var(--collapsible-box__btn--image--xlarge)}.collapsible-box__btn--collapsed::after{transform:rotate(0deg)}.font--xsmall{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--xlarge{font-size:20px}";
|
|
287
|
+
const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--height:42px;--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box__btn--image--xsmall:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"12px\" width=\"7.5px\"><path d=\"M 0,10.56 4.5967752,6.0000006 0,1.3800006 1.4516132,0 7.5,6.0000006 1.4516132,12 Z\"/></svg>');--ez-collapsible-box__btn--image--small:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"14px\" width=\"8.68px\"><path d=\"M 0,12.32 5.3200012,7.0000007 0,1.6100007 1.6800004,0 8.68,7.0000007 1.6800004,14 Z\"/></svg>');--ez-collapsible-box__btn--image--medium:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--ez-collapsible-box__btn--image--large:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"18px\" width=\"11.25px\"><path d=\"M 0,15.84 6.8951628,9.0000009 0,2.0700009 2.1774198,0 11.25,9.0000009 2.1774198,18 Z\"/></svg>');--ez-collapsible-box__btn--image--xlarge:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"20px\" width=\"12.5px\"><path d=\"M 0,17.6 7.661292,10.000001 0,2.300001 2.4193553,0 12.5,10.000001 2.4193553,20 Z\"/></svg>');--ez-collapsible-box__btn--fill:var(--ez-collapsible-box--color);--ez-collapsible-box__btn--width:10px;--ez-collapsible-box__btn--height:16px;display:flex;flex-wrap:wrap;width:100%}.collapsible-box__title{width:100%;align-self:center;display:flex;box-sizing:border-box}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;width:100%;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight);color:var(--ez-collapsible-box--color)}.collapsible-box__label--icon-right{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight);color:var(--ez-collapsible-box--color)}.collapsible-box__btn{outline:none;border:none;background-color:unset;cursor:pointer;padding:1px 6px}.collapsible-box__btn::after{content:'';display:flex;background-color:var(--ez-collapsible-box__btn--fill);width:var(--ez-collapsible-box__btn--width);height:var(--ez-collapsible-box__btn--height);transition:transform var(--transition);transform:rotate(90deg)}.collapsible-box__btn--xsmall::after{width:7.5px;height:12px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--xsmall);mask-image:var(--ez-collapsible-box__btn--image--xsmall)}.collapsible-box__btn--small::after{width:8.68px;height:14px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--small);mask-image:var(--ez-collapsible-box__btn--image--small)}.collapsible-box__btn--medium::after{width:10px;height:16px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--medium);mask-image:var(--ez-collapsible-box__btn--image--medium)}.collapsible-box__btn--large::after{width:11.25px;height:18px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--large);mask-image:var(--ez-collapsible-box__btn--image--large)}.collapsible-box__btn--xlarge::after{width:12.5px;height:20px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--xlarge);mask-image:var(--ez-collapsible-box__btn--image--xlarge)}.collapsible-box__btn--collapsed::after{transform:rotate(0deg)}.font--xsmall{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--xlarge{font-size:20px}";
|
|
282
288
|
|
|
283
289
|
let EzCollapsibleBox = class {
|
|
284
290
|
constructor(hostRef) {
|
|
@@ -291,11 +297,11 @@ let EzCollapsibleBox = class {
|
|
|
291
297
|
/**
|
|
292
298
|
* Define o tamanho do texto e do ícone do componente.
|
|
293
299
|
*/
|
|
294
|
-
this.
|
|
300
|
+
this.headerSize = "small";
|
|
295
301
|
/**
|
|
296
302
|
* Define o local onde o ícone será renderizado.
|
|
297
303
|
*/
|
|
298
|
-
this.
|
|
304
|
+
this.iconPlacement = "left";
|
|
299
305
|
}
|
|
300
306
|
observeValue() {
|
|
301
307
|
this.ezChange.emit();
|
|
@@ -307,10 +313,10 @@ let EzCollapsibleBox = class {
|
|
|
307
313
|
this.value = !this.value;
|
|
308
314
|
}
|
|
309
315
|
render() {
|
|
310
|
-
return (index.h(index.Host, null, this.
|
|
311
|
-
index.h("div", { class: "collapsible-box__title" }, index.h("label", { class: (this.
|
|
316
|
+
return (index.h(index.Host, null, this.iconPlacement == "right" ?
|
|
317
|
+
index.h("div", { class: "collapsible-box__title" }, index.h("label", { class: (this.iconPlacement == "right" ? "collapsible-box__label--icon-right " : "collapsible-box__label ") + (this.headerSize ? "font--" + this.headerSize : ""), onClick: () => this.showHide(), title: this.label }, this.label), index.h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.headerSize : "collapsible-box__btn " + "collapsible-box__btn--" + this.headerSize, onClick: () => this.showHide() }))
|
|
312
318
|
:
|
|
313
|
-
index.h("div", { class: "collapsible-box__title" }, index.h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.
|
|
319
|
+
index.h("div", { class: "collapsible-box__title" }, index.h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.headerSize : "collapsible-box__btn " + "collapsible-box__btn--" + this.headerSize, onClick: () => this.showHide() }), index.h("label", { class: (this.iconPlacement == "right" ? "collapsible-box__label--icon-right " : "collapsible-box__label ") + (this.headerSize ? "font--" + this.headerSize : ""), onClick: () => this.showHide(), title: this.label }, this.label)), !this.value ? index.h("slot", null) : null));
|
|
314
320
|
}
|
|
315
321
|
static get watchers() { return {
|
|
316
322
|
"value": ["observeValue"]
|
|
@@ -318,7 +324,7 @@ let EzCollapsibleBox = class {
|
|
|
318
324
|
};
|
|
319
325
|
EzCollapsibleBox.style = ezCollapsibleBoxCss;
|
|
320
326
|
|
|
321
|
-
const ezComboBoxCss = ":host{--combo-box--height:42px;--combo-box--width:100%;--combo-box__icon--width:48px;--combo-box--border-radius:var(--border--radius-medium, 12px);--combo-box--border-radius-small:var(--border--radius-small, 6px);--combo-box--font-size:var(--text--medium, 14px);--combo-box--font-family:var(--font-pattern, Arial);--combo-box--font-weight--large:var(--text-weight--large, 500);--combo-box--font-weight--medium:var(--text-weight--medium, 400);--combo-box--background-color--xlight:var(--background--xlight, #fff);--combo-box__input--background-color:var(--background--medium, #e0e0e0);--combo-box__input--border:var(--border--medium, 2px solid);--combo-box__input--border-color:var(--combo-box__input--background-color);--combo-box__input--focus--border-color:var(--color--primary, #008561);--combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--combo-box__input--error--border-color:#CC2936;--combo-box__label--color:var(--title--primary, #919191);--combo-box__list-text--primary:var(--text--primary, #626e82);--combo-box__list-height:calc(var(--combo-box--font-size) + var(--combo-box--space--medium));--combo-box--drop-down__image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"16px\"><path d=\"M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z\"/></svg>');--combo-box--search__image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"22px\" width=\"22px\"><path d=\"m 9.4,2.3 c 4.1,0 7.4,3.2 7.4,7.2 0,1.8 -0.7,3.4 -1.8,4.7 l 0.3,0.3 h 0.9 l 5.7,5.6 -1.7,1.7 -5.7,-5.6 V 15.3 L 14.3,15 C 13,16.1 11.3,16.7 9.5,16.7 5.3,16.7 2,13.5 2,9.5 2,5.5 5.3,2.3 9.4,2.3 m 0,2.2 c -2.9,0 -5.1,2.2 -5.1,5 0,2.8 2.3,5 5.1,5 2.8,0 5.1,-2.2 5.1,-5 0,-2.8 -2.2,-5 -5.1,-5 z\"/></svg>');--combo-box--space--medium:var(--space--medium, 12px);--combo-box--space--small:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--combo-box--width)}ez-text-input{--
|
|
327
|
+
const ezComboBoxCss = ":host{--combo-box--height:42px;--combo-box--width:100%;--combo-box__icon--width:48px;--combo-box--border-radius:var(--border--radius-medium, 12px);--combo-box--border-radius-small:var(--border--radius-small, 6px);--combo-box--font-size:var(--text--medium, 14px);--combo-box--font-family:var(--font-pattern, Arial);--combo-box--font-weight--large:var(--text-weight--large, 500);--combo-box--font-weight--medium:var(--text-weight--medium, 400);--combo-box--background-color--xlight:var(--background--xlight, #fff);--combo-box__input--background-color:var(--background--medium, #e0e0e0);--combo-box__input--border:var(--border--medium, 2px solid);--combo-box__input--border-color:var(--combo-box__input--background-color);--combo-box__input--focus--border-color:var(--color--primary, #008561);--combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--combo-box__input--error--border-color:#CC2936;--combo-box__label--color:var(--title--primary, #919191);--combo-box__list-text--primary:var(--text--primary, #626e82);--combo-box__list-height:calc(var(--combo-box--font-size) + var(--combo-box--space--medium));--combo-box--drop-down__image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"16px\"><path d=\"M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z\"/></svg>');--combo-box--search__image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"22px\" width=\"22px\"><path d=\"m 9.4,2.3 c 4.1,0 7.4,3.2 7.4,7.2 0,1.8 -0.7,3.4 -1.8,4.7 l 0.3,0.3 h 0.9 l 5.7,5.6 -1.7,1.7 -5.7,-5.6 V 15.3 L 14.3,15 C 13,16.1 11.3,16.7 9.5,16.7 5.3,16.7 2,13.5 2,9.5 2,5.5 5.3,2.3 9.4,2.3 m 0,2.2 c -2.9,0 -5.1,2.2 -5.1,5 0,2.8 2.3,5 5.1,5 2.8,0 5.1,-2.2 5.1,-5 0,-2.8 -2.2,-5 -5.1,-5 z\"/></svg>');--combo-box--space--medium:var(--space--medium, 12px);--combo-box--space--small:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--combo-box--width)}ez-text-input{--ez-text-input__input--background-color:var(--combo-box__input--background-color, #FFFFFF);--ez-text-input__input--border-color:var(--combo-box__input--border-color, #DCE0E8)}.list-container{position:relative;width:100%}.options-list{box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--combo-box--background-color--xlight);padding:var(--combo-box--space--small);border-radius:var(--combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);scroll-behavior:smooth;max-height:calc(4*var(--combo-box__list-height) + 2*var(--combo-box--space--small));overflow:auto}.item{text-align:left;display:flex;justify-content:space-between;align-items:center;border-radius:var(--combo-box--border-radius-small);padding:0 var(--combo-box--space--small);list-style-type:none;min-height:var(--combo-box__list-height)}.item--label{text-align:left;flex-basis:85%;flex-grow:1;color:var(--combo-box__list-text--primary);font-weight:var(--combo-box--font-weight--large);font-family:var(--combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item--value{text-align:right;flex-basis:15%;flex-grow:0;color:var(--combo-box__list-text--primary);font-weight:var(--combo-box--font-weight--large);font-family:var(--combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}li:hover{background-color:var(--background--medium)}.preselected{background-color:var(--background--medium)}.btn-open-options{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-options:disabled{cursor:unset}.btn-open-options::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:16px;height:16px;-webkit-mask-image:var(--combo-box--drop-down__image);mask-image:var(--combo-box--drop-down__image)}.btn-open-options:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-options:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}.btn-open-search{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-search:disabled{cursor:unset}.btn-open-search::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:22px;height:22px;-webkit-mask-image:var(--combo-box--search__image);mask-image:var(--combo-box--search__image)}.btn-open-search:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-search:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}";
|
|
322
328
|
|
|
323
329
|
let EzComboBox = class {
|
|
324
330
|
constructor(hostRef) {
|
|
@@ -558,7 +564,7 @@ let EzComboBox = class {
|
|
|
558
564
|
};
|
|
559
565
|
EzComboBox.style = ezComboBoxCss;
|
|
560
566
|
|
|
561
|
-
const ezDateInputCss = ":host{display:block;width:100%;--
|
|
567
|
+
const ezDateInputCss = ":host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"15px\"><path d=\"M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z\"/></svg>')}.text-input{--ez-text-input__input--background-color:inherit;--ez-text-input__input--border-color:inherit}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:unset}.btn-open-cal::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}";
|
|
562
568
|
|
|
563
569
|
let EzDateInput = class {
|
|
564
570
|
constructor(hostRef) {
|
|
@@ -617,14 +623,14 @@ let EzDateInput = class {
|
|
|
617
623
|
}
|
|
618
624
|
}
|
|
619
625
|
getTextValue(d) {
|
|
620
|
-
return d ? new Intl.DateTimeFormat(
|
|
626
|
+
return d ? new Intl.DateTimeFormat("pt-BR").format(d) : null;
|
|
621
627
|
}
|
|
622
628
|
componentDidLoad() {
|
|
623
629
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
624
630
|
}
|
|
625
631
|
render() {
|
|
626
632
|
return (index.h(index.Host, null, index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => {
|
|
627
|
-
if (event.key ===
|
|
633
|
+
if (event.key === "H" || event.key === "h")
|
|
628
634
|
this.changeValue(new Date());
|
|
629
635
|
}, label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage }, 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 })));
|
|
630
636
|
}
|
|
@@ -1215,19 +1221,19 @@ thunk.withExtraArgument = createThunkMiddleware;
|
|
|
1215
1221
|
|
|
1216
1222
|
function changeFieldValue$1(dataUnit, recordId, fieldName, value) {
|
|
1217
1223
|
return {
|
|
1218
|
-
type:
|
|
1224
|
+
type: "FORM/CHANGEFIELD",
|
|
1219
1225
|
payload: { dataUnit, recordId, fieldName, value }
|
|
1220
1226
|
};
|
|
1221
1227
|
}
|
|
1222
1228
|
function changeTab$1(formId, index) {
|
|
1223
1229
|
return {
|
|
1224
|
-
type:
|
|
1230
|
+
type: "FORM/CHANGETAB",
|
|
1225
1231
|
payload: { formId, index }
|
|
1226
1232
|
};
|
|
1227
1233
|
}
|
|
1228
1234
|
function clearEdition$1(dataUnit, recordsLimit) {
|
|
1229
1235
|
return {
|
|
1230
|
-
type:
|
|
1236
|
+
type: "FORM/CLEAREDITION",
|
|
1231
1237
|
payload: {
|
|
1232
1238
|
dataUnit,
|
|
1233
1239
|
recordsLimit
|
|
@@ -1236,13 +1242,13 @@ function clearEdition$1(dataUnit, recordsLimit) {
|
|
|
1236
1242
|
}
|
|
1237
1243
|
function collapseExpandGroup(collapseId, collapsed) {
|
|
1238
1244
|
return {
|
|
1239
|
-
type:
|
|
1245
|
+
type: "FORM/COLLAPSEGROUP",
|
|
1240
1246
|
payload: { collapseId, collapsed }
|
|
1241
1247
|
};
|
|
1242
1248
|
}
|
|
1243
1249
|
function previousRecord(dataUnit) {
|
|
1244
1250
|
return {
|
|
1245
|
-
type:
|
|
1251
|
+
type: "FORM/NAVIGATE",
|
|
1246
1252
|
payload: {
|
|
1247
1253
|
dataUnit,
|
|
1248
1254
|
limit: 0,
|
|
@@ -1252,7 +1258,7 @@ function previousRecord(dataUnit) {
|
|
|
1252
1258
|
}
|
|
1253
1259
|
function nextRecord(dataUnit, limit) {
|
|
1254
1260
|
return {
|
|
1255
|
-
type:
|
|
1261
|
+
type: "FORM/NAVIGATE",
|
|
1256
1262
|
payload: {
|
|
1257
1263
|
dataUnit,
|
|
1258
1264
|
limit,
|
|
@@ -1262,7 +1268,7 @@ function nextRecord(dataUnit, limit) {
|
|
|
1262
1268
|
}
|
|
1263
1269
|
function insertRecord$1(dataUnit, insertionIndex) {
|
|
1264
1270
|
return {
|
|
1265
|
-
type:
|
|
1271
|
+
type: "FORM/INSERT",
|
|
1266
1272
|
payload: {
|
|
1267
1273
|
dataUnit,
|
|
1268
1274
|
insertionIndex
|
|
@@ -1271,12 +1277,12 @@ function insertRecord$1(dataUnit, insertionIndex) {
|
|
|
1271
1277
|
}
|
|
1272
1278
|
function formLoad() {
|
|
1273
1279
|
return {
|
|
1274
|
-
type:
|
|
1280
|
+
type: "FORM/LOAD"
|
|
1275
1281
|
};
|
|
1276
1282
|
}
|
|
1277
1283
|
function dataLoading$1(dataUnit) {
|
|
1278
1284
|
return {
|
|
1279
|
-
type:
|
|
1285
|
+
type: "FORM/DATALOADING",
|
|
1280
1286
|
payload: {
|
|
1281
1287
|
dataUnit
|
|
1282
1288
|
}
|
|
@@ -1284,7 +1290,7 @@ function dataLoading$1(dataUnit) {
|
|
|
1284
1290
|
}
|
|
1285
1291
|
function savingChanges$1(dataUnit) {
|
|
1286
1292
|
return {
|
|
1287
|
-
type:
|
|
1293
|
+
type: "FORM/SAVINGCHANGES",
|
|
1288
1294
|
payload: {
|
|
1289
1295
|
dataUnit
|
|
1290
1296
|
}
|
|
@@ -1292,7 +1298,7 @@ function savingChanges$1(dataUnit) {
|
|
|
1292
1298
|
}
|
|
1293
1299
|
function dataLoaded$1(dataUnit) {
|
|
1294
1300
|
return {
|
|
1295
|
-
type:
|
|
1301
|
+
type: "FORM/DATALOADED",
|
|
1296
1302
|
payload: {
|
|
1297
1303
|
dataUnit
|
|
1298
1304
|
}
|
|
@@ -1300,7 +1306,7 @@ function dataLoaded$1(dataUnit) {
|
|
|
1300
1306
|
}
|
|
1301
1307
|
function changesSaved$1(dataUnit) {
|
|
1302
1308
|
return {
|
|
1303
|
-
type:
|
|
1309
|
+
type: "FORM/CHANGESSAVED",
|
|
1304
1310
|
payload: {
|
|
1305
1311
|
dataUnit
|
|
1306
1312
|
}
|
|
@@ -1308,7 +1314,7 @@ function changesSaved$1(dataUnit) {
|
|
|
1308
1314
|
}
|
|
1309
1315
|
function removingRecord$1(dataUnit) {
|
|
1310
1316
|
return {
|
|
1311
|
-
type:
|
|
1317
|
+
type: "FORM/REMOVINGRECORD",
|
|
1312
1318
|
payload: {
|
|
1313
1319
|
dataUnit
|
|
1314
1320
|
}
|
|
@@ -1316,7 +1322,7 @@ function removingRecord$1(dataUnit) {
|
|
|
1316
1322
|
}
|
|
1317
1323
|
function recordRemoved$1(dataUnit) {
|
|
1318
1324
|
return {
|
|
1319
|
-
type:
|
|
1325
|
+
type: "FORM/RECORDREMOVED",
|
|
1320
1326
|
payload: {
|
|
1321
1327
|
dataUnit
|
|
1322
1328
|
}
|
|
@@ -1324,7 +1330,7 @@ function recordRemoved$1(dataUnit) {
|
|
|
1324
1330
|
}
|
|
1325
1331
|
function invalidField$1(tabController, tabIndex, dataUnit, recordIndex, recordId, fieldName, errorMessage) {
|
|
1326
1332
|
return {
|
|
1327
|
-
type:
|
|
1333
|
+
type: "FORM/INVALIDFIELD",
|
|
1328
1334
|
payload: {
|
|
1329
1335
|
tabController,
|
|
1330
1336
|
tabIndex,
|
|
@@ -1338,7 +1344,7 @@ function invalidField$1(tabController, tabIndex, dataUnit, recordIndex, recordId
|
|
|
1338
1344
|
}
|
|
1339
1345
|
function showHideNavigationButtons(buttonName, status) {
|
|
1340
1346
|
return {
|
|
1341
|
-
type:
|
|
1347
|
+
type: "FORM/SHOWHIDENAVBTN",
|
|
1342
1348
|
payload: {
|
|
1343
1349
|
buttonName,
|
|
1344
1350
|
status
|
|
@@ -1999,19 +2005,19 @@ const inicialNonHistState = {
|
|
|
1999
2005
|
};
|
|
2000
2006
|
function formReducer(state = inicialHistState, action) {
|
|
2001
2007
|
switch (action.type) {
|
|
2002
|
-
case
|
|
2008
|
+
case "FORM/COLLAPSEGROUP":
|
|
2003
2009
|
return collapseGroup(state, action.payload);
|
|
2004
|
-
case
|
|
2010
|
+
case "FORM/CHANGETAB":
|
|
2005
2011
|
return changeTab(state, action.payload.formId, action.payload.index);
|
|
2006
|
-
case
|
|
2012
|
+
case "FORM/NAVIGATE":
|
|
2007
2013
|
return navigate(state, action.payload);
|
|
2008
|
-
case
|
|
2014
|
+
case "FORM/INSERT":
|
|
2009
2015
|
return insertRecord(state, action.payload);
|
|
2010
|
-
case
|
|
2016
|
+
case "FORM/CHANGEFIELD":
|
|
2011
2017
|
return changeFieldValue(state, action.payload);
|
|
2012
|
-
case
|
|
2018
|
+
case "FORM/CLEAREDITION":
|
|
2013
2019
|
return clearEdition(state, action.payload);
|
|
2014
|
-
case
|
|
2020
|
+
case "FORM/INVALIDFIELD":
|
|
2015
2021
|
return navigateToInvalid(state, action.payload);
|
|
2016
2022
|
default:
|
|
2017
2023
|
return state;
|
|
@@ -2019,25 +2025,25 @@ function formReducer(state = inicialHistState, action) {
|
|
|
2019
2025
|
}
|
|
2020
2026
|
function formNonHistoricReducer(state = inicialNonHistState, action) {
|
|
2021
2027
|
switch (action.type) {
|
|
2022
|
-
case
|
|
2028
|
+
case "FORM/DATALOADING":
|
|
2023
2029
|
return dataLoading(state, action.payload);
|
|
2024
|
-
case
|
|
2030
|
+
case "FORM/DATALOADED":
|
|
2025
2031
|
return dataLoaded(state, action.payload);
|
|
2026
|
-
case
|
|
2032
|
+
case "FORM/SAVINGCHANGES":
|
|
2027
2033
|
return savingChanges(state, action.payload);
|
|
2028
|
-
case
|
|
2034
|
+
case "FORM/CHANGESSAVED":
|
|
2029
2035
|
return changesSaved(state, action.payload);
|
|
2030
|
-
case
|
|
2036
|
+
case "FORM/REMOVINGRECORD":
|
|
2031
2037
|
return removingRecord(state, action.payload);
|
|
2032
|
-
case
|
|
2038
|
+
case "FORM/RECORDREMOVED":
|
|
2033
2039
|
return recordRemoved(state, action.payload);
|
|
2034
|
-
case
|
|
2040
|
+
case "FORM/INVALIDFIELD":
|
|
2035
2041
|
return invalidField(state, action.payload);
|
|
2036
|
-
case
|
|
2042
|
+
case "FORM/CLEAREDITION":
|
|
2037
2043
|
return clearAllInvalidFields(state, action.payload);
|
|
2038
|
-
case
|
|
2044
|
+
case "FORM/CHANGEFIELD":
|
|
2039
2045
|
return clearInvalidField(state, action.payload);
|
|
2040
|
-
case
|
|
2046
|
+
case "FORM/SHOWHIDENAVBTN":
|
|
2041
2047
|
return showHideNavBtn(state, action.payload);
|
|
2042
2048
|
default:
|
|
2043
2049
|
return state;
|
|
@@ -2227,13 +2233,13 @@ const NavigationBar = ({ dataUnit: du, buttonProps, enabled }) => {
|
|
|
2227
2233
|
|| buttonProps.cancelVisible
|
|
2228
2234
|
|| buttonProps.reloadVisible) {
|
|
2229
2235
|
return index.h("div", { class: "col col--sd-12 align--right" },
|
|
2230
|
-
buttonProps.previousVisible ? index.h("ez-button", { key: du.name +
|
|
2231
|
-
buttonProps.nextVisible ? index.h("ez-button", { key: du.name +
|
|
2232
|
-
buttonProps.removeVisible ? index.h("ez-button", { key: du.name +
|
|
2233
|
-
buttonProps.addVisible ? index.h("ez-button", { key: du.name +
|
|
2234
|
-
buttonProps.reloadVisible ? index.h("ez-button", { key: du.name +
|
|
2235
|
-
buttonProps.cancelVisible ? index.h("ez-button", { key: du.name +
|
|
2236
|
-
buttonProps.saveVisible ? index.h("ez-button", { key: du.name +
|
|
2236
|
+
buttonProps.previousVisible ? index.h("ez-button", { key: du.name + "_previous", title: "Registro anterior", mode: "icon", enabled: enabled && du.hasPrevious(), onClick: () => du.previous(), image: "/themes/default/images/icons/actions-sprite.svg#previous-circle-inverted", class: "button--secondary margin-right--medium" }) : null,
|
|
2237
|
+
buttonProps.nextVisible ? index.h("ez-button", { key: du.name + "_next", title: "Pr\u00F3ximo registro", mode: "icon", enabled: enabled && du.hasNext(), onClick: () => du.next(), image: "/themes/default/images/icons/actions-sprite.svg#next-circle-inverted", class: "button--secondary margin-right--medium" }) : null,
|
|
2238
|
+
buttonProps.removeVisible ? index.h("ez-button", { key: du.name + "_remove", label: "Remover", enabled: enabled && du.hasCurrentRecord(), onClick: () => removeHandler(du), image: "/themes/default/images/icons/actions-sprite.svg#minus-circle-inverted", class: "button--secondary margin-right--medium" }) : null,
|
|
2239
|
+
buttonProps.addVisible ? index.h("ez-button", { key: du.name + "_add", label: "Adicionar", enabled: enabled, onClick: () => du.insert(), class: "button--secondary margin-right--medium" }) : null,
|
|
2240
|
+
buttonProps.reloadVisible ? index.h("ez-button", { key: du.name + "_reload", title: "Recarregar", enabled: enabled, mode: "icon", onClick: () => du.load(), image: "/themes/default/images/icons/actions-sprite.svg#rotate", class: "button--secondary margin-right--medium" }) : null,
|
|
2241
|
+
buttonProps.cancelVisible ? index.h("ez-button", { key: du.name + "_cancel", label: "Cancelar", enabled: enabled && du.hasChanges(), onClick: () => du.cancel(), class: "button--secondary margin-right--medium" }) : null,
|
|
2242
|
+
buttonProps.saveVisible ? index.h("ez-button", { key: du.name + "_save", label: "Salvar", enabled: enabled && du.hasChanges(), onClick: () => saveHandler(du), class: "button--primary margin-right--medium" }) : null);
|
|
2237
2243
|
}
|
|
2238
2244
|
else {
|
|
2239
2245
|
return null;
|
|
@@ -2279,7 +2285,7 @@ const selectErrorMessage = (state, dataUnit, recordId, fieldName) => {
|
|
|
2279
2285
|
const selectVisibleButtons = state => state.nonhist.visibleButtons;
|
|
2280
2286
|
|
|
2281
2287
|
class DataUnit {
|
|
2282
|
-
constructor(name, unitLabel, cardinality =
|
|
2288
|
+
constructor(name, unitLabel, cardinality = "1", parentDU = null) {
|
|
2283
2289
|
this.name = name;
|
|
2284
2290
|
this.unitLabel = unitLabel;
|
|
2285
2291
|
this.cardinality = cardinality;
|
|
@@ -2362,13 +2368,13 @@ class DataUnit {
|
|
|
2362
2368
|
}, 100);
|
|
2363
2369
|
}
|
|
2364
2370
|
cancel() {
|
|
2365
|
-
this.records = this.records.filter(r => !r.record__id.startsWith(
|
|
2371
|
+
this.records = this.records.filter(r => !r.record__id.startsWith("NEW_"));
|
|
2366
2372
|
this._store.dispatch(clearEdition$1(this.name, this.records.length - 1));
|
|
2367
2373
|
}
|
|
2368
2374
|
insert() {
|
|
2369
2375
|
const insertionIndex = this.records.length;
|
|
2370
2376
|
const newRecordIndex = selectNewRecordIndex(this._store.getState(), this.name);
|
|
2371
|
-
const newRecord = { record__id:
|
|
2377
|
+
const newRecord = { record__id: "NEW_" + (newRecordIndex + 1) };
|
|
2372
2378
|
this.bindToParent(newRecord);
|
|
2373
2379
|
this.records.push(newRecord);
|
|
2374
2380
|
this._store.dispatch(insertRecord$1(this.name, insertionIndex));
|
|
@@ -2481,7 +2487,7 @@ class DataUnit {
|
|
|
2481
2487
|
}
|
|
2482
2488
|
else {
|
|
2483
2489
|
if (result.__data__unit === this.name) {
|
|
2484
|
-
if (this.cardinality ===
|
|
2490
|
+
if (this.cardinality === "1") {
|
|
2485
2491
|
this.records = [this.buildRecordFromSaveResult(this.records[0], result)];
|
|
2486
2492
|
}
|
|
2487
2493
|
}
|
|
@@ -2492,7 +2498,7 @@ class DataUnit {
|
|
|
2492
2498
|
this._store.dispatch(changesSaved$1(this.name));
|
|
2493
2499
|
}
|
|
2494
2500
|
buildRecordFromSaveResult(baseRecord, saveResult) {
|
|
2495
|
-
const newRecord = baseRecord ? Object.assign({}, baseRecord) : { record__id:
|
|
2501
|
+
const newRecord = baseRecord ? Object.assign({}, baseRecord) : { record__id: "" };
|
|
2496
2502
|
Object.keys(saveResult).forEach(attrib => {
|
|
2497
2503
|
if (!attrib.startsWith("__")) {
|
|
2498
2504
|
newRecord[attrib] = saveResult[attrib];
|
|
@@ -2586,19 +2592,19 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
2586
2592
|
dataUnit.changeValue(name, newValue);
|
|
2587
2593
|
};
|
|
2588
2594
|
switch (userInterface) {
|
|
2589
|
-
case
|
|
2595
|
+
case "LONGTEXT":
|
|
2590
2596
|
return index.h("div", { class: "col col--sd-12 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2591
|
-
index.h("ez-text-area", { value: value ||
|
|
2592
|
-
case
|
|
2593
|
-
case
|
|
2597
|
+
index.h("ez-text-area", { value: value || "", label: formattedLabel, onEzChange: evt => changeFieldHandler(evt.target["value"]), errorMessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key, enabled: isEnabled }));
|
|
2598
|
+
case "CHECKBOX":
|
|
2599
|
+
case "SWITCH":
|
|
2594
2600
|
return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small align--middle padding-bottom--large" }, loadingData ? index.h("place-holder", null) :
|
|
2595
|
-
index.h("ez-check", { value: value, label: label, enabled: isEnabled, mode: userInterface === "CHECKBOX" ? "regular" : "switch", onEzChange: (event) => changeFieldHandler(event.target[
|
|
2596
|
-
case
|
|
2597
|
-
const optsObj = properties ? JSON.parse(getProp(properties,
|
|
2601
|
+
index.h("ez-check", { value: value, label: label, enabled: isEnabled, mode: userInterface === "CHECKBOX" ? "regular" : "switch", onEzChange: (event) => changeFieldHandler(event.target["value"]), ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
2602
|
+
case "OPTIONSELECTOR":
|
|
2603
|
+
const optsObj = properties ? JSON.parse(getProp(properties, "options")) : {};
|
|
2598
2604
|
const normalized = Object.keys(optsObj).map(key => { return { value: key, label: optsObj[key] }; });
|
|
2599
2605
|
return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2600
|
-
index.h("ez-combo-box", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target[
|
|
2601
|
-
case
|
|
2606
|
+
index.h("ez-combo-box", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target["value"]), errorMessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key, options: normalized }));
|
|
2607
|
+
case "SEARCH":
|
|
2602
2608
|
const context = {
|
|
2603
2609
|
__MAIN_FORM: form,
|
|
2604
2610
|
__DATA_UNIT: dataUnit.name,
|
|
@@ -2622,38 +2628,38 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
2622
2628
|
}
|
|
2623
2629
|
});
|
|
2624
2630
|
if (criteriaList.length > 0) {
|
|
2625
|
-
context[
|
|
2631
|
+
context["CRITERIA"] = criteriaList;
|
|
2626
2632
|
}
|
|
2627
2633
|
return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2628
|
-
index.h("ez-search", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target[
|
|
2634
|
+
index.h("ez-search", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target["value"]), errorMessage: errorMessage, optionLoader: (argument) => {
|
|
2629
2635
|
if (form) {
|
|
2630
2636
|
return form.loadSearch(argument, context);
|
|
2631
2637
|
}
|
|
2632
2638
|
}, ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
2633
|
-
case
|
|
2634
|
-
const target = getProp(properties,
|
|
2635
|
-
const strHeaders = getProp(properties,
|
|
2639
|
+
case "FILE":
|
|
2640
|
+
const target = getProp(properties, "URL");
|
|
2641
|
+
const strHeaders = getProp(properties, "HEADERS");
|
|
2636
2642
|
const headers = strHeaders ? JSON.parse(strHeaders) : {};
|
|
2637
2643
|
const maxfiles = Number(getProp(properties, "maxfiles") || 0);
|
|
2638
2644
|
return (index.h("div", { class: "col col--sd-12 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2639
2645
|
index.h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail), urlUpload: target, requestHeaders: headers, maxFiles: maxfiles })));
|
|
2640
|
-
case
|
|
2646
|
+
case "DATE":
|
|
2641
2647
|
return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2642
|
-
index.h("ez-date-input", { value: !value ? null : DateUtils.clearTime(value), label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target[
|
|
2643
|
-
case
|
|
2644
|
-
case
|
|
2648
|
+
index.h("ez-date-input", { value: !value ? null : DateUtils.clearTime(value), label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target["value"]), errorMessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
2649
|
+
case "DECIMALNUMBER":
|
|
2650
|
+
case "INTEGERNUMBER":
|
|
2645
2651
|
let precision = 0;
|
|
2646
2652
|
let prettyPrecision = 0;
|
|
2647
|
-
if (userInterface ===
|
|
2653
|
+
if (userInterface === "DECIMALNUMBER") {
|
|
2648
2654
|
precision = Number(getProp(properties, "precision") || 2);
|
|
2649
2655
|
prettyPrecision = Number(getProp(properties, "prettyprecision") || precision);
|
|
2650
2656
|
}
|
|
2651
2657
|
return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2652
|
-
index.h("ez-numeric-input", { value: !value ? null : value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target[
|
|
2658
|
+
index.h("ez-numeric-input", { value: !value ? null : value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target["value"]), errorMessage: errorMessage, precision: precision, prettyprecision: prettyPrecision, ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
2653
2659
|
//IMAGE, DATETIME, ELAPSEDTIME, PASSWORD, MASKEDTEXT, HTML
|
|
2654
2660
|
default:
|
|
2655
2661
|
return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2656
|
-
index.h("ez-text-input", { value: value, label: formattedLabel, enabled: isEnabled, loading: loadingData, onInput: (event) => changeFieldHandler(event.target[
|
|
2662
|
+
index.h("ez-text-input", { value: value, label: formattedLabel, enabled: isEnabled, loading: loadingData, onInput: (event) => changeFieldHandler(event.target["value"]), errorMessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
2657
2663
|
}
|
|
2658
2664
|
};
|
|
2659
2665
|
function getProp(properties, name) {
|
|
@@ -2737,8 +2743,9 @@ let EzForm = class {
|
|
|
2737
2743
|
this._preparedMetadata = undefined;
|
|
2738
2744
|
}
|
|
2739
2745
|
async validate() {
|
|
2746
|
+
const duSourcesNames = Array.from(this._duSources.keys());
|
|
2740
2747
|
for (let i = 0; i < this._duSources.size; i++) {
|
|
2741
|
-
const duName =
|
|
2748
|
+
const duName = duSourcesNames[i];
|
|
2742
2749
|
let du = this._dataUnits.get(duName);
|
|
2743
2750
|
if (du === undefined) {
|
|
2744
2751
|
const source = this._duSources.get(duName);
|
|
@@ -2752,8 +2759,9 @@ let EzForm = class {
|
|
|
2752
2759
|
}
|
|
2753
2760
|
async getChanges() {
|
|
2754
2761
|
let allChanges = [];
|
|
2762
|
+
const dataUnits = Array.from(this._dataUnits.values());
|
|
2755
2763
|
for (let i = 0; i < this._dataUnits.size; i++) {
|
|
2756
|
-
const du =
|
|
2764
|
+
const du = dataUnits[i];
|
|
2757
2765
|
//Só devemos buscar as alterações de DU raiz, pois os sub DUs serão enviados junto.
|
|
2758
2766
|
if (!du.parentDU) {
|
|
2759
2767
|
const duChanges = du.getChangesToSave();
|
|
@@ -2771,15 +2779,15 @@ let EzForm = class {
|
|
|
2771
2779
|
}
|
|
2772
2780
|
}
|
|
2773
2781
|
validateRecords(dataUnit, records, triggedBy) {
|
|
2774
|
-
const result = { isValid: true, message:
|
|
2775
|
-
if (this.
|
|
2782
|
+
const result = { isValid: true, message: "" };
|
|
2783
|
+
if (this.ignoreSaveValidation && triggedBy === "SAVE") {
|
|
2776
2784
|
return result;
|
|
2777
2785
|
}
|
|
2778
2786
|
const validateField = (field) => {
|
|
2779
2787
|
if (field.readOnly) {
|
|
2780
2788
|
return false;
|
|
2781
2789
|
}
|
|
2782
|
-
if (field.userInterface ===
|
|
2790
|
+
if (field.userInterface === "SWITCH" || field.userInterface === "CHECKBOX") {
|
|
2783
2791
|
return false;
|
|
2784
2792
|
}
|
|
2785
2793
|
return true;
|
|
@@ -2790,7 +2798,7 @@ let EzForm = class {
|
|
|
2790
2798
|
const recordIndex = record["record__index"];
|
|
2791
2799
|
const fieldName = field.name;
|
|
2792
2800
|
const fieldValue = record[fieldName];
|
|
2793
|
-
if (fieldValue === null || fieldValue === undefined || fieldValue ===
|
|
2801
|
+
if (fieldValue === null || fieldValue === undefined || fieldValue === "") {
|
|
2794
2802
|
const tabPosition = this._tabPositionByField.get(dataUnit.name + field.name);
|
|
2795
2803
|
this._store.dispatch(invalidField$1(tabPosition.tabName, tabPosition.index, dataUnit.name, recordIndex, record.record__id, field.name, "Essa informação é obrigatória"));
|
|
2796
2804
|
result.isValid = false;
|
|
@@ -2817,7 +2825,7 @@ let EzForm = class {
|
|
|
2817
2825
|
return result;
|
|
2818
2826
|
}
|
|
2819
2827
|
loadMDFromExecutor(callBack) {
|
|
2820
|
-
const loadMetadataFunction = this.parseExecutor(this.
|
|
2828
|
+
const loadMetadataFunction = this.parseExecutor(this.metadataExecutor);
|
|
2821
2829
|
if (loadMetadataFunction) {
|
|
2822
2830
|
const result = loadMetadataFunction();
|
|
2823
2831
|
if (result) {
|
|
@@ -2897,7 +2905,7 @@ let EzForm = class {
|
|
|
2897
2905
|
});
|
|
2898
2906
|
this._store = createStore(rootReducer, applyMiddleware(thunk));
|
|
2899
2907
|
this._store.subscribe(() => { index.forceUpdate(this); });
|
|
2900
|
-
if (this.
|
|
2908
|
+
if (this.slaveMode) {
|
|
2901
2909
|
this._store.dispatch(showHideNavigationButtons("saveVisible", false));
|
|
2902
2910
|
this._store.dispatch(showHideNavigationButtons("cancelVisible", false));
|
|
2903
2911
|
this._store.dispatch(showHideNavigationButtons("reloadVisible", false));
|
|
@@ -2920,12 +2928,12 @@ let EzForm = class {
|
|
|
2920
2928
|
this._duToLoad = [];
|
|
2921
2929
|
}
|
|
2922
2930
|
loadSearch(argument, context) {
|
|
2923
|
-
const fieldSearchExecutor = this.parseExecutor(this.
|
|
2931
|
+
const fieldSearchExecutor = this.parseExecutor(this.fieldSearchExecutor);
|
|
2924
2932
|
if (fieldSearchExecutor) {
|
|
2925
2933
|
return fieldSearchExecutor(argument, context);
|
|
2926
2934
|
}
|
|
2927
2935
|
else {
|
|
2928
|
-
return [{ value: 0, label:
|
|
2936
|
+
return [{ value: 0, label: "Sem resultados" }];
|
|
2929
2937
|
}
|
|
2930
2938
|
}
|
|
2931
2939
|
buildDataUnit(dataUnit, parentDataUnit) {
|
|
@@ -2952,9 +2960,9 @@ let EzForm = class {
|
|
|
2952
2960
|
}
|
|
2953
2961
|
decorateDU(dataUnit) {
|
|
2954
2962
|
dataUnit.store = this._store;
|
|
2955
|
-
dataUnit.loadExecutor = this.parseExecutor(this.
|
|
2956
|
-
dataUnit.saveExecutor = this.parseExecutor(this.
|
|
2957
|
-
dataUnit.removeExecutor = this.parseExecutor(this.
|
|
2963
|
+
dataUnit.loadExecutor = this.parseExecutor(this.loadExecutor);
|
|
2964
|
+
dataUnit.saveExecutor = this.parseExecutor(this.saveExecutor);
|
|
2965
|
+
dataUnit.removeExecutor = this.parseExecutor(this.removeExecutor);
|
|
2958
2966
|
dataUnit.recordsValidator = this;
|
|
2959
2967
|
}
|
|
2960
2968
|
render() {
|
|
@@ -2996,7 +3004,7 @@ let EzIcon = class {
|
|
|
2996
3004
|
};
|
|
2997
3005
|
EzIcon.style = ezIconCss;
|
|
2998
3006
|
|
|
2999
|
-
const ezNumericInputCss = ":host{display:block;width:100%;--
|
|
3007
|
+
const ezNumericInputCss = ":host{display:block;width:100%;--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color)}.text-input{--ez-text-input__input--background-color:inherit;--ez-text-input__input--border-color:inherit}";
|
|
3000
3008
|
|
|
3001
3009
|
let EzNumericInput = class {
|
|
3002
3010
|
constructor(hostRef) {
|
|
@@ -3398,7 +3406,7 @@ let EzTextArea = class {
|
|
|
3398
3406
|
};
|
|
3399
3407
|
EzTextArea.style = ezTextAreaCss;
|
|
3400
3408
|
|
|
3401
|
-
const ezTextInputCss = ":host{--text-input--height:42px;--text-input--width:100%;--text-input__icon--width:48px;--text-input--border-radius:var(--border--radius-medium, 12px);--text-input--font-size:var(--text--medium, 14px);--text-input--font-family:var(--font-pattern, Arial);--text-input--font-weight:var(--text-weight--large, 500);--text-input--color:var(--title--primary, #000);--text-input__input--background-color:var(--background--medium, #e0e0e0);--text-input__input--border:var(--border--medium, 2px solid);--text-input__input--border-color:var(--text-input__input--background-color);--text-input__input--focus--border-color:var(--color--alert-cold-800, #042EFF);--text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--text-input__input--disabled--color:var(--text--disable, #AFB6C0);--text-input__input--error--border-color:#CC2936;--text-input__message_box--font-size:var(--text--small, 12px);--text-input__message_box--info--color:var(--color--success, #22085d);--text-input__message_box--error--color:var(--color--error, #FF0000);--text-input__label--floating--top:6px;--text-input__label--padding-top:12px;--text-input__label--padding-left:14px;--text-input__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--text-input--width)}input{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);font-weight:var(--text-weight--large, 600);height:var(--text-input--height);border-radius:var(--text-input--border-radius);font-family:var(--text-input--font-family);font-size:var(--text-input--font-size);border:var(--text-input__input--border);border-color:var(--text-input__input--border-color);background-color:var(--text-input__input--background-color);color:var(--text-input--color)}input:disabled{background-color:var(--text-input__input--disabled--background-color);color:var(--text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--text-input__input--focus--border-color)}input.icon--left{padding-left:var(--text-input__icon--width)}input.icon--right{padding-right:var(--text-input__icon--width)}input.hasError{color:var(--text-input--color);border-color:var(--text-input__input--error--border-color)}input.text--right{text-align:right}.message-box{display:flex;min-height:16px;min-width:100%;margin-top:2px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--text-input--font-family);font-size:var(--text-input__message_box--font-size);color:var(--text-input__message_box--info--color)}.hasError{color:var(--text-input__message_box--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--text-input__label--padding-right));left:var(--text-input--space--medium);font-family:var(--text-input--font-family);font-size:var(--text-input--font-size);font-weight:var(--text-input--font-weight);color:var(--text-input--color);top:var(--text-input__label--padding-top);left:var(--text-input__label--padding-left);padding-right:var(--text-input__label--padding-right)}.input__label--floated{font-family:var(--text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--text-input__label--floating--top)}.input__label--disabled{color:var(--text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--text-input__icon--width) + 2px);width:calc(100% - var(--text-input__icon--width))}.input__label--right{right:var(--text-input__icon--width);width:calc(100% - var(--text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--text-input__icon--width) + 2px);width:calc(100% - var(--text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}";
|
|
3409
|
+
const ezTextInputCss = ":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--large, 500);--ez-text-input--color:var(--title--primary, #000);--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border:var(--border--medium, 2px solid);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color);--ez-text-input__input--focus--border-color:var(--color--alert-cold-800, #042EFF);--ez-text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-text-input__input--disabled--color:var(--text--disable, #AFB6C0);--ez-text-input__input--error--border-color:#CC2936;--ez-text-input__message_box--font-size:var(--text--small, 12px);--ez-text-input__message_box--info--color:var(--color--success, #22085d);--ez-text-input__message_box--error--color:var(--color--error, #FF0000);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width)}input{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);font-weight:var(--text-weight--large, 600);height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color)}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color)}input.text--right{text-align:right}.message-box{display:flex;min-height:16px;min-width:100%;margin-top:2px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input__message_box--font-size);color:var(--ez-text-input__message_box--info--color)}.hasError{color:var(--ez-text-input__message_box--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}";
|
|
3402
3410
|
|
|
3403
3411
|
let EzTextInput = class {
|
|
3404
3412
|
constructor(hostRef) {
|
|
@@ -3410,14 +3418,14 @@ let EzTextInput = class {
|
|
|
3410
3418
|
this.enabled = true;
|
|
3411
3419
|
}
|
|
3412
3420
|
showError() {
|
|
3413
|
-
const hasError = typeof this.errorMessage ===
|
|
3421
|
+
const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
|
|
3414
3422
|
if (hasError) {
|
|
3415
|
-
this._inputElem.classList.add(
|
|
3416
|
-
this._messageBoxElem.classList.add(
|
|
3423
|
+
this._inputElem.classList.add("hasError");
|
|
3424
|
+
this._messageBoxElem.classList.add("hasError");
|
|
3417
3425
|
}
|
|
3418
3426
|
else {
|
|
3419
|
-
this._inputElem.classList.remove(
|
|
3420
|
-
this._messageBoxElem.classList.remove(
|
|
3427
|
+
this._inputElem.classList.remove("hasError");
|
|
3428
|
+
this._messageBoxElem.classList.remove("hasError");
|
|
3421
3429
|
}
|
|
3422
3430
|
}
|
|
3423
3431
|
prepareMask() {
|
|
@@ -3435,7 +3443,7 @@ let EzTextInput = class {
|
|
|
3435
3443
|
this._inputElem.value = this.value;
|
|
3436
3444
|
}
|
|
3437
3445
|
this.handleChange();
|
|
3438
|
-
this.ezChange.emit();
|
|
3446
|
+
this.ezChange.emit(this.value);
|
|
3439
3447
|
this.adjustFloatingLabel();
|
|
3440
3448
|
}
|
|
3441
3449
|
adjustFloatingLabel() {
|
|
@@ -3520,22 +3528,22 @@ let EzTextInput = class {
|
|
|
3520
3528
|
content.style.justifyContent = "center";
|
|
3521
3529
|
content.style.overflow = "hidden";
|
|
3522
3530
|
content.style.top = "0px";
|
|
3523
|
-
content.style.width = "var(--text-input__icon--width)";
|
|
3524
|
-
content.style.height = "var(--text-input--height)";
|
|
3531
|
+
content.style.width = "var(--ez-text-input__icon--width)";
|
|
3532
|
+
content.style.height = "var(--ez-text-input--height)";
|
|
3525
3533
|
if (slot.name == "leftIcon") {
|
|
3526
3534
|
content.style.left = "0px";
|
|
3527
|
-
content.style.borderRadius = "var(--text-input--border-radius) 0 0 var(--text-input--border-radius)";
|
|
3528
|
-
this._inputElem.classList.add(
|
|
3535
|
+
content.style.borderRadius = "var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)";
|
|
3536
|
+
this._inputElem.classList.add("icon--left");
|
|
3529
3537
|
if (this._labelElem) {
|
|
3530
|
-
this._labelElem.classList.add(
|
|
3538
|
+
this._labelElem.classList.add("input__label--left");
|
|
3531
3539
|
}
|
|
3532
3540
|
}
|
|
3533
3541
|
else if (slot.name == "rightIcon") {
|
|
3534
3542
|
content.style.right = "0px";
|
|
3535
|
-
content.style.borderRadius = "0 var(--text-input--border-radius) var(--text-input--border-radius) 0";
|
|
3536
|
-
this._inputElem.classList.add(
|
|
3543
|
+
content.style.borderRadius = "0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0";
|
|
3544
|
+
this._inputElem.classList.add("icon--right");
|
|
3537
3545
|
if (this._labelElem) {
|
|
3538
|
-
this._labelElem.classList.add(
|
|
3546
|
+
this._labelElem.classList.add("input__label--right");
|
|
3539
3547
|
}
|
|
3540
3548
|
}
|
|
3541
3549
|
}
|
|
@@ -3935,7 +3943,7 @@ let FormMetadata = class {
|
|
|
3935
3943
|
label = "Selecione uma das opções:";
|
|
3936
3944
|
}
|
|
3937
3945
|
const objOpts = {};
|
|
3938
|
-
Array.from(element.getElementsByTagName(
|
|
3946
|
+
Array.from(element.getElementsByTagName("OPTION")).forEach((optElem, index) => {
|
|
3939
3947
|
const optValue = optElem.getAttribute("value") || index;
|
|
3940
3948
|
const optLabel = optElem.textContent;
|
|
3941
3949
|
objOpts[optValue] = optLabel;
|
|
@@ -3943,15 +3951,15 @@ let FormMetadata = class {
|
|
|
3943
3951
|
properties.push({ name: "options", value: JSON.stringify(objOpts) });
|
|
3944
3952
|
}
|
|
3945
3953
|
else if (userInterface === "FILE") {
|
|
3946
|
-
const urlElement = element.querySelector(
|
|
3947
|
-
const headersElement = element.querySelectorAll(
|
|
3954
|
+
const urlElement = element.querySelector("URL");
|
|
3955
|
+
const headersElement = element.querySelectorAll("HEADERS>HEADER");
|
|
3948
3956
|
if (urlElement) {
|
|
3949
3957
|
properties.push({ name: "URL", value: urlElement.textContent });
|
|
3950
3958
|
}
|
|
3951
3959
|
if (headersElement && headersElement.length > 0) {
|
|
3952
3960
|
const headers = {};
|
|
3953
3961
|
headersElement.forEach(header => {
|
|
3954
|
-
headers[header.getAttribute(
|
|
3962
|
+
headers[header.getAttribute("name")] = header.textContent;
|
|
3955
3963
|
});
|
|
3956
3964
|
properties.push({ name: "HEADERS", value: JSON.stringify(headers) });
|
|
3957
3965
|
}
|
|
@@ -3977,7 +3985,7 @@ let FormMetadata = class {
|
|
|
3977
3985
|
}
|
|
3978
3986
|
buildFieldSet(dataUnit, element) {
|
|
3979
3987
|
const label = element.getAttribute("label");
|
|
3980
|
-
const fields = Array.from(element.getElementsByTagName(
|
|
3988
|
+
const fields = Array.from(element.getElementsByTagName("FIELD")).map(f => {
|
|
3981
3989
|
const field = this.buildField(f);
|
|
3982
3990
|
dataUnit.addFieldMetadata(field);
|
|
3983
3991
|
return { name: field.name };
|
|
@@ -3994,7 +4002,7 @@ let FormMetadata = class {
|
|
|
3994
4002
|
Array.from(elements).forEach(child => {
|
|
3995
4003
|
const tagName = child.tagName.toUpperCase();
|
|
3996
4004
|
switch (tagName) {
|
|
3997
|
-
case
|
|
4005
|
+
case "FIELD":
|
|
3998
4006
|
if (!form.items) {
|
|
3999
4007
|
form.items = [];
|
|
4000
4008
|
}
|
|
@@ -4002,13 +4010,13 @@ let FormMetadata = class {
|
|
|
4002
4010
|
dataUnit.addFieldMetadata(f);
|
|
4003
4011
|
form.items.push({ name: f.name });
|
|
4004
4012
|
break;
|
|
4005
|
-
case
|
|
4013
|
+
case "FIELD-SET":
|
|
4006
4014
|
if (!form.items) {
|
|
4007
4015
|
form.items = [];
|
|
4008
4016
|
}
|
|
4009
4017
|
form.items.push(this.buildFieldSet(dataUnit, child));
|
|
4010
4018
|
break;
|
|
4011
|
-
case
|
|
4019
|
+
case "SUB-FORM":
|
|
4012
4020
|
if (!form.subForms) {
|
|
4013
4021
|
form.subForms = [];
|
|
4014
4022
|
}
|
|
@@ -4017,7 +4025,7 @@ let FormMetadata = class {
|
|
|
4017
4025
|
const subDuName = child.getAttribute("dataunit");
|
|
4018
4026
|
let subDu;
|
|
4019
4027
|
if (subDuName) {
|
|
4020
|
-
subDu = new DataUnit(subDuName,
|
|
4028
|
+
subDu = new DataUnit(subDuName, "noname", child.hasAttribute("many") ? "N" : "1");
|
|
4021
4029
|
}
|
|
4022
4030
|
else {
|
|
4023
4031
|
subDu = dataUnit;
|
|
@@ -4032,7 +4040,7 @@ let FormMetadata = class {
|
|
|
4032
4040
|
if (!this.dataunit) {
|
|
4033
4041
|
this.dataunit = "dataunit_" + (this.name || this.label || new Date().getTime());
|
|
4034
4042
|
}
|
|
4035
|
-
const du = new DataUnit(this.dataunit,
|
|
4043
|
+
const du = new DataUnit(this.dataunit, "noname", this.many ? "N" : "1");
|
|
4036
4044
|
this.metadata = this.fromElements(this._host.children, this.label, this.name, du, this.autoload);
|
|
4037
4045
|
}
|
|
4038
4046
|
render() {
|