@sankhyalabs/ezui 1.1.95 → 1.1.98
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/{StringUtils-0ba09df4.js → AssetsUtils-69356e76.js} +22 -0
- package/dist/cjs/UnitMetadata-63c56042.js +1311 -0
- package/dist/cjs/{ez-calendar_14.cjs.entry.js → ez-calendar_16.cjs.entry.js} +235 -39
- package/dist/cjs/ez-grid.cjs.entry.js +38 -19
- package/dist/cjs/ez-modal_2.cjs.entry.js +3 -4
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-check/ez-check.css +3 -2
- package/dist/collection/components/ez-form/DataBinder.js +13 -0
- package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +2 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +4 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.js +1 -1
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +6 -3
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +2 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +4 -2
- package/dist/collection/components/ez-icon/ez-icon.css +5 -0
- package/dist/custom-elements/index.js +227 -6318
- package/dist/esm/{StringUtils-cbf10229.js → AssetsUtils-0e207bec.js} +22 -1
- package/dist/esm/UnitMetadata-109880b0.js +1305 -0
- package/dist/esm/{ez-calendar_14.entry.js → ez-calendar_16.entry.js} +202 -8
- package/dist/esm/ez-grid.entry.js +23 -4
- package/dist/esm/ez-modal_2.entry.js +2 -3
- package/dist/esm/ez-popover.entry.js +1 -1
- 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-1386e4d5.entry.js +1 -0
- package/dist/ezui/{p-6714a1b2.entry.js → p-18de871c.entry.js} +10 -10
- package/dist/ezui/p-9fab5606.js +1 -0
- package/dist/ezui/p-a30309ce.entry.js +1 -0
- package/dist/ezui/{p-2617733e.entry.js → p-afb820c1.entry.js} +1 -1
- package/dist/ezui/p-ec7c1b86.js +1 -0
- package/dist/types/components/ez-form/DataBinder.d.ts +1 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +4 -0
- package/package.json +2 -2
- package/dist/cjs/AssetsUtils-4909c6de.js +0 -24
- package/dist/cjs/CSSVarsUtils-8fbdf2e0.js +0 -19
- package/dist/cjs/ez-icon.cjs.entry.js +0 -42
- package/dist/cjs/ez-time-input.cjs.entry.js +0 -118
- package/dist/cjs/index-6164b259.js +0 -7460
- package/dist/esm/AssetsUtils-9b1329a3.js +0 -22
- package/dist/esm/CSSVarsUtils-667e0016.js +0 -17
- package/dist/esm/ez-icon.entry.js +0 -38
- package/dist/esm/ez-time-input.entry.js +0 -114
- package/dist/esm/index-74a9c220.js +0 -7452
- package/dist/ezui/p-0a8018c2.entry.js +0 -1
- package/dist/ezui/p-2f84ba72.js +0 -1
- package/dist/ezui/p-477bb703.js +0 -1
- package/dist/ezui/p-a943d501.entry.js +0 -1
- package/dist/ezui/p-b139372f.entry.js +0 -1
- package/dist/ezui/p-c6762896.js +0 -1
- package/dist/ezui/p-d54c157f.js +0 -1
- package/dist/ezui/p-ef393d36.entry.js +0 -1
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-88286449.js');
|
|
6
|
-
const
|
|
6
|
+
const UnitMetadata = require('./UnitMetadata-63c56042.js');
|
|
7
7
|
const FloatingManager = require('./FloatingManager-6cfeb947.js');
|
|
8
|
-
const
|
|
8
|
+
const AssetsUtils = require('./AssetsUtils-69356e76.js');
|
|
9
9
|
|
|
10
10
|
class DateUtils {
|
|
11
11
|
static clearTime(date, adjustDayLightSavingTime = true) {
|
|
@@ -50,6 +50,23 @@ class DateUtils {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
class ApplicationContext {
|
|
54
|
+
static getContextValue(key) {
|
|
55
|
+
return ApplicationContext.getCtx()[key].deref();
|
|
56
|
+
}
|
|
57
|
+
static setContextValue(key, value) {
|
|
58
|
+
ApplicationContext.getCtx()[key] = new WeakRef(value);
|
|
59
|
+
}
|
|
60
|
+
static getCtx() {
|
|
61
|
+
let ctx = window.___snkcore___ctx___;
|
|
62
|
+
if (!ctx) {
|
|
63
|
+
ctx = {};
|
|
64
|
+
window.___snkcore___ctx___ = ctx;
|
|
65
|
+
}
|
|
66
|
+
return ctx;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
53
70
|
const ezCalendarCss = ":host{--ez-calendar--font-family:var(--font-pattern, Arial);--ez-calendar--color:var(--title--primary, #626e82);--ez-calendar--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-calendar__body--background-color:var(--background--xlight, #FFF);--ez-calendar__Time--background-color:var(--background--xlight, #FAFAFA);--ez-calendar__body--padding:var(--space--medium, 12px) var(--space--small, 6px);--ez-calendar__body--border-radius:var(--border--radius-medium, 12px);--ez-calendar__body--shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-calendar__header-line--stroke:1px;--ez-calendar__header-line--color:var(--color--strokes, #C0C0C0);--ez-calendar__nav-btn--fill:var(--text--primary, #008561);--ez-calendar__nav-btn--hover--fill:var(--color--primary, #350404);--ez-calendar__nav-btn--width:10px;--ez-calendar__nav-btn--height:16px;--ez-calendar__nav-btn--previous-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--ez-calendar__nav-btn--next-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--ez-calendar__cell--margin:0px 1.5px;--ez-calendar__cell--width:var(--space--large, 24px);--ez-calendar__cell--padding:1.5px 0px;--ez-calendar__cell--border-radius:var(--border--radius-small, 6px);--ez-calendar__cell--over--background-color:var(--color--primary, #E2F4EF);--ez-calendar__cell--over--color:var(--color--primary-300, #008561);--ez-calendar__cell--outset--color:var(--color--disable-primary, #E5EAF0);--ez-calendar__cell--selected--background-color:var(--color--primary, #008561);--ez-calendar__cell--selected--color:var(--color--inverted, #FFF);--ez-calendar__btn-today--color:var(--color--primary);--ez-calendar__btn-today--hover--background-color:var(--color--primary-300, #E2F4EF);--ez-calendar__btn-today--border-radius:var(--border--radius-small, 6px);position:relative;display:flex;user-select:none}.calendar{z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-calendar__body--background-color);padding:var(--ez-calendar__body--padding);border-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__header{display:flex;justify-content:space-between;padding-bottom:var(--space--small, 6px);margin:0px var(--space--, 12px) var(--space--small, 6px) var(--space--, 12px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color)}.calendar__btn-next,.calendar__btn-previous{outline:none;border:none;background-color:unset;cursor:pointer;padding:0px}.calendar__btn-next::after,.calendar__btn-previous::after{content:'';display:flex;background-color:var(--ez-calendar__nav-btn--fill);width:var(--ez-calendar__nav-btn--width);height:var(--ez-calendar__nav-btn--height)}.calendar__btn-previous::after{-webkit-mask-image:var(--ez-calendar__nav-btn--previous-image);mask-image:var(--ez-calendar__nav-btn--previous-image)}.calendar__btn-next::after{-webkit-mask-image:var(--ez-calendar__nav-btn--next-image);mask-image:var(--ez-calendar__nav-btn--next-image)}.calendar__btn-next:hover::after,.calendar__btn-previous:hover::after{background-color:var(--ez-calendar__nav-btn--hover--fill)}.calendar__lbl-month{font-weight:var(--text-weight--extra-large, 700);font-size:var(--title--small, 14px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__line{display:flex;padding:0px;margin:0px}.calendar__cell{display:flex;justify-content:center;align-content:center;cursor:pointer;font-size:var(--text--extra-small, 10px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);padding:var(--ez-calendar__cell--padding);margin:var(--ez-calendar__cell--margin);min-width:var(--ez-calendar__cell--width);border-radius:var(--ez-calendar__cell--border-radius)}.calendar__cell:hover{background-color:var(--ez-calendar__cell--over--background-color);color:var(--ez-calendar__cell--over--color)}.calendar__cell--secondary{color:var(--ez-calendar__cell--outset--color)}.calendar__cell--unselectable:hover{background-color:unset;border-radius:unset;cursor:unset}.calendar__cell--unselectable{font-weight:var(--text-weight--large, 600);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__cell--selected,.calendar__cell--selected:hover{background-color:var(--ez-calendar__cell--selected--background-color);color:var(--ez-calendar__cell--selected--color)}.calendar__footer{display:flex;flex-direction:column}.calendar__btn-today{border:none;background-color:unset;cursor:pointer;font-weight:var(--text-weight--large, 600);font-size:var(--title--extra-small, 12px);padding:0px;font-family:var(--ez-calendar--font-family);text-shadow:var(--ez-calendar--text-shadow);color:var(--ez-calendar__btn-today--color);border-radius:var(--ez-calendar__btn-today--border-radius)}.calendar__btn-today:hover{background-color:var(--ez-calendar__btn-today--hover--background-color)}section{display:flex}.calendarTime{margin-left:-10px;display:flex;flex-direction:column;padding:12px 0px 0px 10px;background-color:var(--ez-calendar__Time--background-color);border-top-right-radius:var(--ez-calendar__body--border-radius);border-bottom-right-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__column{height:136px;padding:0px;margin:0px;overflow:auto}.calendar__column::-webkit-scrollbar{width:0px;max-width:0px;min-width:0px}.calendarTime__header{padding-left:var(--space--small, 6px);padding-right:var(--space--small, 6px);display:flex;justify-content:space-between;padding-bottom:var(--space--small, 6px);margin:0px var(--space--, 12px) var(--space--small, 6px) var(--space--, 12px);font-weight:var(--text-weight--extra-large, 700);font-size:var(--title--small, 14px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.separatorTime{color:#A2ABB9;padding:0px 1px;line-height:16px;font-size:17px;font-weight:normal}.endHidden{-webkit-mask-image:linear-gradient(180deg, #000 calc(100% - 48px), transparent 100%)}.calendar__column .calendar__cell{margin:0px;padding:1.5px 1.5px}";
|
|
54
71
|
|
|
55
72
|
let EzCalendar = class {
|
|
@@ -265,7 +282,7 @@ let EzCalendar = class {
|
|
|
265
282
|
};
|
|
266
283
|
EzCalendar.style = ezCalendarCss;
|
|
267
284
|
|
|
268
|
-
const ezCheckCss = ":host{--ez-check--box--width:18px;--ez-check--box--height:18px;--ez-check--width:calc(var(--ez-check--box--width) + 14px);--ez-check--height:calc(var(--ez-check--box--width) + 14px);--ez-check--border-radius:var(--border--radius-small);--ez-check--checked--background-color:var(--color--primary-200);--ez-check--focus--background-color:var(--color--strokes, #FFFFFF);--ez-check--hover--background-color:var(--background--medium);--ez-check--checked--disabled--background-color:var(--color--disable-secondary);--ez-check--border:var(--border--medium) var(--title--primary);--ez-check--disabled--border:var(--border--medium) var(--color--strokes);--ez-check--checked--border:var(--border--medium) var(--color--primary);--ez-check--checked--hover--background-color:var(--color--primary-200);--ez-check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--ez-check--check--image:url('data:image/svg+xml;utf8,<svg width=\"8\" height=\"7\" viewBox=\"0 0 8 7\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z\"/></svg>');--ez-check--check--background-color:var(--color--primary);--ez-check--check--disabled--background-color:var(--color--strokes);--ez-switch--slider--width:34px;--ez-switch--slider--height:14px;--ez-switch--pin--width:20px;--ez-switch--pin--height:20px;--ez-switch--focus--width:32px;--ez-switch--focus--height:32px;--ez-switch--background-color:var(--color--strokes);--ez-switch--disabled--background-color:var(--color--disable-secondary);--ez-switch--checked--background-color:var(--color--primary-300);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-secondary);--ez-switch--pin--checked--background-color:var(--color--primary);--ez-switch--pin--checked--disabled--background-color:#E8F7F4;--ez-switch--pin--focus--background-color:var(--text--disable);--ez-switch--pin--checked--focus--background-color:var(--color--primary);--ez-check--label--font-size:var(--text--medium, 14px);--ez-check--label--font-family:var(--font-pattern, Arial);--ez-check--label--color:var(--title--primary, #000);--ez-check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;width:100%;align-items:center;margin:0}input.regularMode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--ez-check--width);height:var(--ez-check--height)}input.regularMode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regularMode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regularMode:disabled{cursor:auto;background:none}input.regularMode::before{box-sizing:border-box;content:\"\";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regularMode:disabled::before{border:var(--ez-check--disabled--border)}input.regularMode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regularMode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regularMode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regularMode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regularMode:checked::after{display:flex;position:absolute;content:\"\";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regularMode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switchMode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:var(--border--small
|
|
285
|
+
const ezCheckCss = ":host{--ez-check--box--width:18px;--ez-check--box--height:18px;--ez-check--width:calc(var(--ez-check--box--width) + 14px);--ez-check--height:calc(var(--ez-check--box--width) + 14px);--ez-check--border-radius:var(--border--radius-small);--ez-check--checked--background-color:var(--color--primary-200);--ez-check--focus--background-color:var(--color--strokes, #FFFFFF);--ez-check--hover--background-color:var(--background--medium);--ez-check--checked--disabled--background-color:var(--color--disable-secondary);--ez-check--border:var(--border--medium) var(--title--primary);--ez-check--disabled--border:var(--border--medium) var(--color--strokes);--ez-check--checked--border:var(--border--medium) var(--color--primary);--ez-check--checked--hover--background-color:var(--color--primary-200);--ez-check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--ez-check--check--image:url('data:image/svg+xml;utf8,<svg width=\"8\" height=\"7\" viewBox=\"0 0 8 7\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z\"/></svg>');--ez-check--check--background-color:var(--color--primary);--ez-check--check--disabled--background-color:var(--color--strokes);--ez-switch--slider--width:34px;--ez-switch--slider--height:14px;--ez-switch--pin--width:20px;--ez-switch--pin--height:20px;--ez-switch--focus--width:32px;--ez-switch--focus--height:32px;--ez-switch--background-color:var(--color--strokes);--ez-switch--disabled--background-color:var(--color--disable-secondary);--ez-switch--checked--background-color:var(--color--primary-300);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-secondary);--ez-switch--pin--checked--background-color:var(--color--primary);--ez-switch--pin--checked--disabled--background-color:#E8F7F4;--ez-switch--pin--focus--background-color:var(--text--disable);--ez-switch--pin--checked--focus--background-color:var(--color--primary);--ez-check--label--font-size:var(--text--medium, 14px);--ez-check--label--font-family:var(--font-pattern, Arial);--ez-check--label--color:var(--title--primary, #000);--ez-check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;width:100%;align-items:center;margin:0}input.regularMode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--ez-check--width);height:var(--ez-check--height)}input.regularMode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regularMode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regularMode:disabled{cursor:auto;background:none}input.regularMode::before{box-sizing:border-box;content:\"\";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regularMode:disabled::before{border:var(--ez-check--disabled--border)}input.regularMode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regularMode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regularMode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regularMode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regularMode:checked::after{display:flex;position:absolute;content:\"\";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regularMode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switchMode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:var(--border--small, 1px solid) var(--text--secondary, #a2abb9);transition:background-color var(--transition);width:var(--ez-switch--slider--width);height:var(--ez-switch--slider--height);background-color:var(--ez-switch--background-color)}input.switchMode:disabled{background-color:var(--ez-switch--disabled--background-color)}input.switchMode::after{content:\"\";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transform:translateX(-2px) translateY(-3px);border-radius:50%;width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switchMode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color)}input.switchMode:checked{transition:background-color var(--transition), border var(--transition);background-color:var(--ez-switch--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switchMode::before{display:block;content:\"\";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--ez-switch--focus--width);height:var(--ez-switch--focus--height);top:calc((var(--ez-switch--slider--height) - var(--ez-switch--focus--height)) / 2);left:calc((var(--ez-switch--pin--width) - var(--ez-switch--focus--width))/2);background-color:var(--ez-switch--pin--focus--background-color)}input.switchMode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switchMode:checked:focus::before{background-color:var(--ez-switch--pin--checked--focus--background-color);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width)))}input.switchMode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-3px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color)}input.switchMode:checked:disabled::after{background-color:var(--ez-switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-check--label--color);text-shadow:var(--text-shadow);font-size:var(--ez-check--label--font-size);font-family:var(--ez-check--label--font-family);cursor:default;padding-left:var(--space--small)}.label--disabled{color:var(--ez-check--label--disabled--color)}";
|
|
269
286
|
|
|
270
287
|
let EzCheck = class {
|
|
271
288
|
constructor(hostRef) {
|
|
@@ -371,6 +388,22 @@ let EzCollapsibleBox = class {
|
|
|
371
388
|
};
|
|
372
389
|
EzCollapsibleBox.style = ezCollapsibleBoxCss;
|
|
373
390
|
|
|
391
|
+
class CSSVarsUtils {
|
|
392
|
+
static applyVarsTextInput(host, child) {
|
|
393
|
+
if (child) {
|
|
394
|
+
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--background-color');
|
|
395
|
+
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--border-color');
|
|
396
|
+
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input--height');
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
static applyIfExists(host, element, varName) {
|
|
400
|
+
const prop = getComputedStyle(host).getPropertyValue(varName);
|
|
401
|
+
if (prop) {
|
|
402
|
+
element.style.setProperty(varName, prop);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
374
407
|
const ezComboBoxCss = ":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn-search--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-search-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-search-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__btn-options--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-options-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-options-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #919191);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium));--ez-combo-box__drop-down-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"16px\"><path d=\"M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z\"/></svg>');--ez-combo-box__search-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"22px\" width=\"22px\"><path d=\"m 9.4,2.3 c 4.1,0 7.4,3.2 7.4,7.2 0,1.8 -0.7,3.4 -1.8,4.7 l 0.3,0.3 h 0.9 l 5.7,5.6 -1.7,1.7 -5.7,-5.6 V 15.3 L 14.3,15 C 13,16.1 11.3,16.7 9.5,16.7 5.3,16.7 2,13.5 2,9.5 2,5.5 5.3,2.3 9.4,2.3 m 0,2.2 c -2.9,0 -5.1,2.2 -5.1,5 0,2.8 2.3,5 5.1,5 2.8,0 5.1,-2.2 5.1,-5 0,-2.8 -2.2,-5 -5.1,-5 z\"/></svg>');--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}.list-container{position:relative;width:100%}.options-list{box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-combo-box--background-color--xlight);padding:var(--ez-combo-box--space--small);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);scroll-behavior:smooth;max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small));overflow:auto}.item{text-align:left;display:flex;justify-content:space-between;align-items:center;border-radius:var(--ez-combo-box--border-radius-small);padding:0 var(--ez-combo-box--space--small);list-style-type:none;min-height:var(--ez-combo-box__list-height)}.item--label{text-align:left;flex-basis:85%;flex-grow:1;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item--value{text-align:right;flex-basis:15%;flex-grow:0;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn-open-options{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-options:disabled{cursor:unset}.btn-open-options::after{content:'';display:flex;background-color:var(--ez-combo-box__btn-options--background-color);width:16px;height:16px;-webkit-mask-image:var(--ez-combo-box__drop-down-image);mask-image:var(--ez-combo-box__drop-down-image)}.btn-open-options:disabled:after{background-color:var(--ez-combo-box__btn-options-disabled--background-color)}.btn-open-options:enabled:hover::after{background-color:var(--ez-combo-box__btn-options-hover--background-color)}.btn-open-search{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-search:disabled{cursor:unset}.btn-open-search::after{content:'';display:flex;background-color:var(--ez-combo-box__btn-search--background-color);width:22px;height:22px;-webkit-mask-image:var(--ez-combo-box__search-image);mask-image:var(--ez-combo-box__search-image)}.btn-open-search:disabled:after{background-color:var(--ez-combo-box__btn-search-disabled--background-color)}.btn-open-search:enabled:hover::after{background-color:var(--ez-combo-box__btn-search-hover--background-color)}";
|
|
375
408
|
|
|
376
409
|
let EzComboBox = class {
|
|
@@ -564,7 +597,7 @@ let EzComboBox = class {
|
|
|
564
597
|
}
|
|
565
598
|
}
|
|
566
599
|
componentDidLoad() {
|
|
567
|
-
CSSVarsUtils.
|
|
600
|
+
CSSVarsUtils.applyVarsTextInput(this.el, this._inputElement);
|
|
568
601
|
}
|
|
569
602
|
//---------------------------------------------
|
|
570
603
|
// Event handlers
|
|
@@ -690,7 +723,7 @@ let EzDateInput = class {
|
|
|
690
723
|
return d ? new Intl.DateTimeFormat("pt-BR").format(d) : null;
|
|
691
724
|
}
|
|
692
725
|
componentDidLoad() {
|
|
693
|
-
CSSVarsUtils.
|
|
726
|
+
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
694
727
|
}
|
|
695
728
|
render() {
|
|
696
729
|
return (index.h(index.Host, null, index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => {
|
|
@@ -789,7 +822,7 @@ let EzDateTimeInput = class {
|
|
|
789
822
|
const partsDateTime = (strValue && strValue.length > 0) ? strValue.split(" ") : [];
|
|
790
823
|
const onlyDate = partsDateTime.length > 0 ? partsDateTime[0] : strValue;
|
|
791
824
|
const onlyTime = partsDateTime[1] ? partsDateTime[1] : "";
|
|
792
|
-
const parsedTime =
|
|
825
|
+
const parsedTime = UnitMetadata.TimeFormatter.prepareValue(onlyTime, this.showSeconds);
|
|
793
826
|
const strDateTime = onlyDate + (parsedTime && " " + parsedTime);
|
|
794
827
|
const parsedDate = DateUtils.strToDate(strDateTime);
|
|
795
828
|
if (parsedDate || !strValue) {
|
|
@@ -816,7 +849,7 @@ let EzDateTimeInput = class {
|
|
|
816
849
|
return d ? (new Intl.DateTimeFormat('pt-BR', this.showSeconds ? optionsSecond : options).format(d)) : null;
|
|
817
850
|
}
|
|
818
851
|
componentDidLoad() {
|
|
819
|
-
CSSVarsUtils.
|
|
852
|
+
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
820
853
|
}
|
|
821
854
|
render() {
|
|
822
855
|
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, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, onFocus: () => this.onFocused(), onClick: () => this.onClicked() }, 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 })));
|
|
@@ -867,7 +900,7 @@ const buildComboBox = ({ name, label, readOnly }, properties) => {
|
|
|
867
900
|
|
|
868
901
|
const buildSearch = ({ name, label, readOnly }) => {
|
|
869
902
|
return (index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
870
|
-
index.h("ez-search", { enabled: !readOnly, label: label,
|
|
903
|
+
index.h("ez-search", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
871
904
|
};
|
|
872
905
|
|
|
873
906
|
const buildFile = ({ name, label, readOnly }) => {
|
|
@@ -879,6 +912,10 @@ const buildDate = ({ name, label, readOnly }) => {
|
|
|
879
912
|
return (index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
880
913
|
index.h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
881
914
|
};
|
|
915
|
+
const buildTime = ({ name, label }) => {
|
|
916
|
+
return (index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
917
|
+
index.h("ez-time-input", { label: label, "data-field-name": name, key: name })));
|
|
918
|
+
};
|
|
882
919
|
const buildTimeDate = ({ name, label }) => {
|
|
883
920
|
return (index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
884
921
|
index.h("ez-date-time-input", { label: label, "data-field-name": name, key: name })));
|
|
@@ -898,16 +935,17 @@ function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecisio
|
|
|
898
935
|
}
|
|
899
936
|
|
|
900
937
|
const uiBuilders = new Map();
|
|
901
|
-
uiBuilders.set(
|
|
902
|
-
uiBuilders.set(
|
|
903
|
-
uiBuilders.set(
|
|
904
|
-
uiBuilders.set(
|
|
905
|
-
uiBuilders.set(
|
|
906
|
-
uiBuilders.set(
|
|
907
|
-
uiBuilders.set(
|
|
908
|
-
uiBuilders.set(
|
|
909
|
-
uiBuilders.set(
|
|
910
|
-
uiBuilders.set(
|
|
938
|
+
uiBuilders.set(UnitMetadata.UserInterface.LONGTEXT, buildTextArea);
|
|
939
|
+
uiBuilders.set(UnitMetadata.UserInterface.CHECKBOX, buildCheckBox);
|
|
940
|
+
uiBuilders.set(UnitMetadata.UserInterface.SWITCH, buildSwitch);
|
|
941
|
+
uiBuilders.set(UnitMetadata.UserInterface.OPTIONSELECTOR, buildComboBox);
|
|
942
|
+
uiBuilders.set(UnitMetadata.UserInterface.SEARCH, buildSearch);
|
|
943
|
+
uiBuilders.set(UnitMetadata.UserInterface.FILE, buildFile);
|
|
944
|
+
uiBuilders.set(UnitMetadata.UserInterface.DATE, buildDate);
|
|
945
|
+
uiBuilders.set(UnitMetadata.UserInterface.TIME, buildTime);
|
|
946
|
+
uiBuilders.set(UnitMetadata.UserInterface.DATETIME, buildTimeDate);
|
|
947
|
+
uiBuilders.set(UnitMetadata.UserInterface.DECIMALNUMBER, buildDecimal);
|
|
948
|
+
uiBuilders.set(UnitMetadata.UserInterface.INTEGERNUMBER, buildInteger);
|
|
911
949
|
const buildField = (field) => {
|
|
912
950
|
const descriptor = field.descriptor;
|
|
913
951
|
const config = Object.assign({}, field.config);
|
|
@@ -996,6 +1034,10 @@ const buildFromDataUnit = (dataUnit) => {
|
|
|
996
1034
|
}
|
|
997
1035
|
return metadata;
|
|
998
1036
|
};
|
|
1037
|
+
function getTabConfig(tab, sheets) {
|
|
1038
|
+
const tabConfig = (typeof tab === "string" ? Array.from(sheets.keys()).find(t => t.label === tab) : tab);
|
|
1039
|
+
return tabConfig || { label: tab, visible: true };
|
|
1040
|
+
}
|
|
999
1041
|
const buildFromConfig = (fields, dataUnit) => {
|
|
1000
1042
|
const sheets = new Map();
|
|
1001
1043
|
const requiredFields = [];
|
|
@@ -1003,13 +1045,13 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
1003
1045
|
fields.forEach(config => {
|
|
1004
1046
|
var _a;
|
|
1005
1047
|
if (config.visible !== false) {
|
|
1006
|
-
const
|
|
1007
|
-
const tabConfig = (typeof tab === "string" ? { label: tab, visible: true } : tab);
|
|
1048
|
+
const tabConfig = getTabConfig(config.tab || "Geral", sheets);
|
|
1008
1049
|
const descriptor = dataUnit.getField(config.name);
|
|
1009
1050
|
if (descriptor && tabConfig.visible) {
|
|
1010
1051
|
if (!sheets.has(tabConfig)) {
|
|
1011
1052
|
sheets.set(tabConfig, new Map());
|
|
1012
1053
|
}
|
|
1054
|
+
const tabItens = sheets.get(tabConfig);
|
|
1013
1055
|
const isRequired = config.required === undefined ? descriptor.required : config.required;
|
|
1014
1056
|
if (isRequired) {
|
|
1015
1057
|
requiredFields.push(config.name);
|
|
@@ -1018,7 +1060,6 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
1018
1060
|
if (clearOnCopy) {
|
|
1019
1061
|
cleanOnCopyFields.push(config.name);
|
|
1020
1062
|
}
|
|
1021
|
-
const tabItens = sheets.get(tabConfig);
|
|
1022
1063
|
const fieldMD = { config, descriptor };
|
|
1023
1064
|
const group = config.group;
|
|
1024
1065
|
if (group) {
|
|
@@ -1440,6 +1481,7 @@ class DataBinder {
|
|
|
1440
1481
|
oldBind.destroy();
|
|
1441
1482
|
}
|
|
1442
1483
|
this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
|
|
1484
|
+
this.bindSearchOptionsLoader(fieldName, field);
|
|
1443
1485
|
}
|
|
1444
1486
|
setFieldValue(fieldName, newValue) {
|
|
1445
1487
|
if (this._dataUnit.records.length === 0) {
|
|
@@ -1447,6 +1489,17 @@ class DataBinder {
|
|
|
1447
1489
|
}
|
|
1448
1490
|
this._dataUnit.setFieldValue(fieldName, newValue);
|
|
1449
1491
|
}
|
|
1492
|
+
bindSearchOptionsLoader(fieldName, field) {
|
|
1493
|
+
if (field.nodeName === "EZ-SEARCH" && field["optionLoader"] === undefined) {
|
|
1494
|
+
const loader = ApplicationContext.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");
|
|
1495
|
+
if (loader) {
|
|
1496
|
+
const fm = this._dataUnit.getField(fieldName);
|
|
1497
|
+
field["optionLoader"] = (arg) => {
|
|
1498
|
+
loader(arg, fm.properties, this._dataUnit);
|
|
1499
|
+
};
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1450
1503
|
}
|
|
1451
1504
|
class Bind {
|
|
1452
1505
|
destroy() {
|
|
@@ -1572,12 +1625,12 @@ let EzForm = class {
|
|
|
1572
1625
|
return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
1573
1626
|
}
|
|
1574
1627
|
interceptAction(action) {
|
|
1575
|
-
if (action.type ===
|
|
1628
|
+
if (action.type === UnitMetadata.Action.RECORDS_COPIED) {
|
|
1576
1629
|
const metadata = selectFormMetadata(this._store.getState());
|
|
1577
1630
|
const cleanFields = metadata.getCleanOnCopyFields();
|
|
1578
1631
|
if (cleanFields) {
|
|
1579
1632
|
const records = action.payload;
|
|
1580
|
-
return new
|
|
1633
|
+
return new UnitMetadata.DataUnitAction(UnitMetadata.Action.RECORDS_COPIED, records.map(record => {
|
|
1581
1634
|
const newRecord = Object.assign({}, record);
|
|
1582
1635
|
cleanFields.forEach(fieldName => delete newRecord[fieldName]);
|
|
1583
1636
|
return newRecord;
|
|
@@ -1588,11 +1641,11 @@ let EzForm = class {
|
|
|
1588
1641
|
}
|
|
1589
1642
|
componentWillLoad() {
|
|
1590
1643
|
if (this.dataUnit === undefined) {
|
|
1591
|
-
this.dataUnit = new
|
|
1644
|
+
this.dataUnit = new UnitMetadata.DataUnit("ez-form");
|
|
1592
1645
|
}
|
|
1593
1646
|
this.dataUnit.addInterceptor(this);
|
|
1594
1647
|
this.dataUnit.subscribe(action => {
|
|
1595
|
-
if (action.type ===
|
|
1648
|
+
if (action.type === UnitMetadata.Action.METADATA_LOADED) {
|
|
1596
1649
|
this.processMetadata();
|
|
1597
1650
|
}
|
|
1598
1651
|
});
|
|
@@ -1612,6 +1665,39 @@ let EzForm = class {
|
|
|
1612
1665
|
};
|
|
1613
1666
|
EzForm.style = ezFormCss;
|
|
1614
1667
|
|
|
1668
|
+
const ezIconCss = ":host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{color:var(--ez-icon--color)}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{font-family:'ez-icons' !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-icon-account-outline:before{content:\"\\ea01\"}.ez-icon-account:before{content:\"\\ea02\"}.ez-icon-alert-circle-inverted:before{content:\"\\ea03\"}.ez-icon-alert-circle:before{content:\"\\ea04\"}.ez-icon-alert-mail:before{content:\"\\ea05\"}.ez-icon-alert-outline:before{content:\"\\ea06\"}.ez-icon-alert-popup:before{content:\"\\ea07\"}.ez-icon-apps:before{content:\"\\ea08\"}.ez-icon-arrow_back:before{content:\"\\ea09\"}.ez-icon-bell-inverted:before{content:\"\\ea0a\"}.ez-icon-bell:before{content:\"\\ea0b\"}.ez-icon-business-center:before{content:\"\\ea0c\"}.ez-icon-calendar-text:before{content:\"\\ea0d\"}.ez-icon-calendar:before{content:\"\\ea0e\"}.ez-icon-check-circle-inverted:before{content:\"\\ea0f\"}.ez-icon-check-circle:before{content:\"\\ea10\"}.ez-icon-check:before{content:\"\\ea11\"}.ez-icon-chevron-down:before{content:\"\\ea12\"}.ez-icon-chevron-left:before{content:\"\\ea13\"}.ez-icon-chevron-right:before{content:\"\\ea14\"}.ez-icon-chevron-up:before{content:\"\\ea15\"}.ez-icon-circle--medium:before{content:\"\\ea16\"}.ez-icon-circle:before{content:\"\\ea17\"}.ez-icon-clipboard:before{content:\"\\ea18\"}.ez-icon-close-circle-inverted:before{content:\"\\ea19\"}.ez-icon-close-circle:before{content:\"\\ea1a\"}.ez-icon-close:before{content:\"\\ea1b\"}.ez-icon-comment-inverted:before{content:\"\\ea1c\"}.ez-icon-comment:before{content:\"\\ea1d\"}.ez-icon-configuration:before{content:\"\\ea1e\"}.ez-icon-copy:before{content:\"\\ea1f\"}.ez-icon-crop:before{content:\"\\ea20\"}.ez-icon-delete:before{content:\"\\ea21\"}.ez-icon-description:before{content:\"\\ea22\"}.ez-icon-dot-notification:before{content:\"\\ea23\"}.ez-icon-dots-horizontal:before{content:\"\\ea24\"}.ez-icon-dots-vertical:before{content:\"\\ea25\"}.ez-icon-drag-indicator:before{content:\"\\ea26\"}.ez-icon-edit-file:before{content:\"\\ea27\"}.ez-icon-edit-table:before{content:\"\\ea28\"}.ez-icon-edit-time:before{content:\"\\ea29\"}.ez-icon-edit:before{content:\"\\ea2a\"}.ez-icon-email-inverted:before{content:\"\\ea2b\"}.ez-icon-email:before{content:\"\\ea2c\"}.ez-icon-error-octagon:before{content:\"\\ea2d\"}.ez-icon-expand:before{content:\"\\ea2e\"}.ez-icon-eye-off:before{content:\"\\ea2f\"}.ez-icon-eye:before{content:\"\\ea30\"}.ez-icon-favorite:before{content:\"\\ea31\"}.ez-icon-file-download:before{content:\"\\ea32\"}.ez-icon-file-upload:before{content:\"\\ea33\"}.ez-icon-filter:before{content:\"\\ea34\"}.ez-icon-find-file:before{content:\"\\ea35\"}.ez-icon-find-page:before{content:\"\\ea36\"}.ez-icon-format-color-fill:before{content:\"\\ea37\"}.ez-icon-help-circle-outline:before{content:\"\\ea38\"}.ez-icon-help-inverted:before{content:\"\\ea39\"}.ez-icon-help:before{content:\"\\ea3a\"}.ez-icon-home:before{content:\"\\ea3b\"}.ez-icon-language:before{content:\"\\ea3c\"}.ez-icon-launch:before{content:\"\\ea3d\"}.ez-icon-lightbulb:before{content:\"\\ea3e\"}.ez-icon-list:before{content:\"\\ea3f\"}.ez-icon-loading:before{content:\"\\ea40\"}.ez-icon-lock-outline:before{content:\"\\ea41\"}.ez-icon-lock:before{content:\"\\ea42\"}.ez-icon-menu:before{content:\"\\ea43\"}.ez-icon-minus-circle-inverted:before{content:\"\\ea44\"}.ez-icon-minus:before{content:\"\\ea45\"}.ez-icon-money-off:before{content:\"\\ea46\"}.ez-icon-money:before{content:\"\\ea47\"}.ez-icon-north-west:before{content:\"\\ea48\"}.ez-icon-pause:before{content:\"\\ea49\"}.ez-icon-payments:before{content:\"\\ea4a\"}.ez-icon-play:before{content:\"\\ea4b\"}.ez-icon-plus-circle-inverted:before{content:\"\\ea4c\"}.ez-icon-plus-circle:before{content:\"\\ea4d\"}.ez-icon-plus:before{content:\"\\ea4e\"}.ez-icon-power:before{content:\"\\ea4f\"}.ez-icon-push-pin:before{content:\"\\ea50\"}.ez-icon-restore:before{content:\"\\ea51\"}.ez-icon-return:before{content:\"\\ea52\"}.ez-icon-rotate:before{content:\"\\ea53\"}.ez-icon-save:before{content:\"\\ea54\"}.ez-icon-search:before{content:\"\\ea55\"}.ez-icon-settings-inverted:before{content:\"\\ea56\"}.ez-icon-settings:before{content:\"\\ea57\"}.ez-icon-share:before{content:\"\\ea58\"}.ez-icon-shield:before{content:\"\\ea59\"}.ez-icon-south-east:before{content:\"\\ea5a\"}.ez-icon-success-circle:before{content:\"\\ea5b\"}.ez-icon-sync:before{content:\"\\ea5c\"}.ez-icon-table:before{content:\"\\ea5d\"}.ez-icon-timer-outline:before{content:\"\\ea5e\"}.ez-icon-user-circle:before{content:\"\\ea5f\"}.ez-icon-warning-minus:before{content:\"\\ea60\"}.ez-icon-warning-triangle:before{content:\"\\ea61\"}.x-small--font{font-size:12px}.small--font{font-size:16px}.medium--font{font-size:20px}.large--font{font-size:24px}.x-large--font{font-size:30px}";
|
|
1669
|
+
|
|
1670
|
+
let EzIcon = class {
|
|
1671
|
+
constructor(hostRef) {
|
|
1672
|
+
index.registerInstance(this, hostRef);
|
|
1673
|
+
/**
|
|
1674
|
+
* Tamanho do ícone
|
|
1675
|
+
*/
|
|
1676
|
+
this.size = 'medium';
|
|
1677
|
+
}
|
|
1678
|
+
isSprite() {
|
|
1679
|
+
return this.href && this.href.indexOf('#') > -1;
|
|
1680
|
+
}
|
|
1681
|
+
getIconClassName() {
|
|
1682
|
+
return `ez-icon-${this.iconName}`;
|
|
1683
|
+
}
|
|
1684
|
+
getIconContent() {
|
|
1685
|
+
if (this.isSprite()) {
|
|
1686
|
+
return index.h("svg", { class: this.size, role: "img" }, index.h("use", { xlinkHref: this.href }));
|
|
1687
|
+
}
|
|
1688
|
+
else if (!AssetsUtils.StringUtils.isEmpty(this.iconName)) {
|
|
1689
|
+
return index.h("span", { class: `icon-content ${this.getIconClassName()} ${this.size}--font` });
|
|
1690
|
+
}
|
|
1691
|
+
else {
|
|
1692
|
+
return index.h("img", { class: this.size, src: this.href });
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
render() {
|
|
1696
|
+
return (index.h(index.Host, null, this.getIconContent()));
|
|
1697
|
+
}
|
|
1698
|
+
};
|
|
1699
|
+
EzIcon.style = ezIconCss;
|
|
1700
|
+
|
|
1615
1701
|
const ezNumberInputCss = ":host{display:block;width:100%}";
|
|
1616
1702
|
|
|
1617
1703
|
let EzNumberInput = class {
|
|
@@ -1642,7 +1728,7 @@ let EzNumberInput = class {
|
|
|
1642
1728
|
}
|
|
1643
1729
|
}
|
|
1644
1730
|
parseNumber() {
|
|
1645
|
-
const parsedNumber = this._textInput.value ?
|
|
1731
|
+
const parsedNumber = this._textInput.value ? UnitMetadata.NumberUtils.stringToNumber(this._textInput.value) : null;
|
|
1646
1732
|
if (parsedNumber != null && isNaN(parsedNumber)) {
|
|
1647
1733
|
this.errorMessage = "O valor digitado não é um número válido";
|
|
1648
1734
|
}
|
|
@@ -1658,12 +1744,12 @@ let EzNumberInput = class {
|
|
|
1658
1744
|
}
|
|
1659
1745
|
getTextValue(value) {
|
|
1660
1746
|
if (value) {
|
|
1661
|
-
return this.precision > 0 ?
|
|
1747
|
+
return this.precision > 0 ? UnitMetadata.NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
|
|
1662
1748
|
}
|
|
1663
1749
|
return null;
|
|
1664
1750
|
}
|
|
1665
1751
|
componentDidLoad() {
|
|
1666
|
-
CSSVarsUtils.
|
|
1752
|
+
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
1667
1753
|
}
|
|
1668
1754
|
render() {
|
|
1669
1755
|
return (index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage }));
|
|
@@ -1708,7 +1794,7 @@ let EzSearch = class {
|
|
|
1708
1794
|
this.ezChange.emit(evt.detail);
|
|
1709
1795
|
}
|
|
1710
1796
|
componentDidLoad() {
|
|
1711
|
-
CSSVarsUtils.
|
|
1797
|
+
CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
|
|
1712
1798
|
}
|
|
1713
1799
|
render() {
|
|
1714
1800
|
return (index.h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.optionLoader, searchMode: true, onEzChange: evt => this.onComboChange(evt), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue }));
|
|
@@ -2048,7 +2134,7 @@ let EzTextInput = class {
|
|
|
2048
2134
|
prepareMask() {
|
|
2049
2135
|
if (this.mask) {
|
|
2050
2136
|
if (this._maskFormatter == undefined) {
|
|
2051
|
-
this._maskFormatter = new
|
|
2137
|
+
this._maskFormatter = new UnitMetadata.MaskFormatter(this.mask);
|
|
2052
2138
|
}
|
|
2053
2139
|
else {
|
|
2054
2140
|
this._maskFormatter.mask = this.mask;
|
|
@@ -2212,6 +2298,114 @@ let EzTextInput = class {
|
|
|
2212
2298
|
};
|
|
2213
2299
|
EzTextInput.style = ezTextInputCss;
|
|
2214
2300
|
|
|
2301
|
+
const ezTimeInputCss = ":host{display:flex;flex-wrap:wrap;position:relative;width:100%}";
|
|
2302
|
+
|
|
2303
|
+
let EzTimeInput = class {
|
|
2304
|
+
constructor(hostRef) {
|
|
2305
|
+
index.registerInstance(this, hostRef);
|
|
2306
|
+
/**
|
|
2307
|
+
* Deixa o campo disponível ou não para digitação.
|
|
2308
|
+
*/
|
|
2309
|
+
this.enabled = true;
|
|
2310
|
+
/**
|
|
2311
|
+
* Define se o componente irá ou não considerar os segundos
|
|
2312
|
+
*/
|
|
2313
|
+
this.showSeconds = false;
|
|
2314
|
+
}
|
|
2315
|
+
prepareMask() {
|
|
2316
|
+
if (this.showSeconds) {
|
|
2317
|
+
if (this._maskFormatter == undefined) {
|
|
2318
|
+
this._maskFormatter = new UnitMetadata.MaskFormatter("##:##:##");
|
|
2319
|
+
}
|
|
2320
|
+
else {
|
|
2321
|
+
this._maskFormatter.mask = "##:##:##";
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
else {
|
|
2325
|
+
if (this._maskFormatter == undefined) {
|
|
2326
|
+
this._maskFormatter = new UnitMetadata.MaskFormatter("##:##");
|
|
2327
|
+
}
|
|
2328
|
+
else {
|
|
2329
|
+
this._maskFormatter.mask = "##:##";
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
onValueChanged() {
|
|
2334
|
+
if (this.value === NaN) {
|
|
2335
|
+
this.value = undefined;
|
|
2336
|
+
this.handleFocusout();
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
//---------------------------------------------
|
|
2340
|
+
// Public methods
|
|
2341
|
+
//---------------------------------------------
|
|
2342
|
+
/**
|
|
2343
|
+
* Faz o foco no componente de input
|
|
2344
|
+
*/
|
|
2345
|
+
async setFocus() {
|
|
2346
|
+
this._inputElem.focus();
|
|
2347
|
+
}
|
|
2348
|
+
/**
|
|
2349
|
+
* Remove o foco no componente de input
|
|
2350
|
+
*/
|
|
2351
|
+
async setBlur() {
|
|
2352
|
+
this._inputElem.blur();
|
|
2353
|
+
}
|
|
2354
|
+
//---------------------------------------------
|
|
2355
|
+
// Event handlers
|
|
2356
|
+
//---------------------------------------------
|
|
2357
|
+
handleFocusout() {
|
|
2358
|
+
this.errorMessage = "";
|
|
2359
|
+
this.prepareValue(this.viewValue);
|
|
2360
|
+
if (!UnitMetadata.TimeFormatter.validateTime(this.viewValue, this.showSeconds)) {
|
|
2361
|
+
this.clearField();
|
|
2362
|
+
this.errorMessage = "Favor inserir um horário válido.";
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
prepareValue(value) {
|
|
2366
|
+
try {
|
|
2367
|
+
this.viewValue = UnitMetadata.TimeFormatter.prepareValue(value, this.showSeconds);
|
|
2368
|
+
}
|
|
2369
|
+
catch (e) {
|
|
2370
|
+
this.clearField();
|
|
2371
|
+
this.errorMessage = e.message;
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
clearField() {
|
|
2375
|
+
this.viewValue = this.value = undefined;
|
|
2376
|
+
}
|
|
2377
|
+
handleChange() {
|
|
2378
|
+
this.viewValue = this._inputElem.value;
|
|
2379
|
+
this.value = UnitMetadata.NumberUtils.stringToNumber(this.viewValue.replace(/\D/g, ""));
|
|
2380
|
+
}
|
|
2381
|
+
//---------------------------------------------
|
|
2382
|
+
// Lifecycle web component
|
|
2383
|
+
//---------------------------------------------
|
|
2384
|
+
componentDidLoad() {
|
|
2385
|
+
this.onValueChanged();
|
|
2386
|
+
CSSVarsUtils.applyVarsTextInput(this._elem, this._inputElem);
|
|
2387
|
+
}
|
|
2388
|
+
componentWillLoad() {
|
|
2389
|
+
this.prepareMask();
|
|
2390
|
+
if (this.value) {
|
|
2391
|
+
this.prepareValue(this.value.toString());
|
|
2392
|
+
}
|
|
2393
|
+
else if (this.viewValue) {
|
|
2394
|
+
this.prepareValue(this.viewValue);
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
render() {
|
|
2398
|
+
return (index.h(index.Host, null, index.h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage }, index.h("ez-icon", { slot: "leftIcon", href: AssetsUtils.getSpritePath("timer-outline") }))));
|
|
2399
|
+
}
|
|
2400
|
+
static get assetsDirs() { return ["../assets"]; }
|
|
2401
|
+
get _elem() { return index.getElement(this); }
|
|
2402
|
+
static get watchers() { return {
|
|
2403
|
+
"showSeconds": ["prepareMask"],
|
|
2404
|
+
"value": ["onValueChanged"]
|
|
2405
|
+
}; }
|
|
2406
|
+
};
|
|
2407
|
+
EzTimeInput.style = ezTimeInputCss;
|
|
2408
|
+
|
|
2215
2409
|
class RemoteFile {
|
|
2216
2410
|
constructor(file) {
|
|
2217
2411
|
this.file = file;
|
|
@@ -2555,7 +2749,7 @@ let TestDu = class {
|
|
|
2555
2749
|
index.registerInstance(this, hostRef);
|
|
2556
2750
|
}
|
|
2557
2751
|
componentWillLoad() {
|
|
2558
|
-
this.dataUnit = new
|
|
2752
|
+
this.dataUnit = new UnitMetadata.DataUnit("testes_com_formulario");
|
|
2559
2753
|
this.dataUnit.metadata = {
|
|
2560
2754
|
name: "dd://br.com.sankhya.fin.cad.movimentacaoFinanceira/Financeiro",
|
|
2561
2755
|
label: "Parceiro",
|
|
@@ -2563,31 +2757,31 @@ let TestDu = class {
|
|
|
2563
2757
|
{
|
|
2564
2758
|
name: "CODPARC",
|
|
2565
2759
|
label: "Parceiro",
|
|
2566
|
-
dataType:
|
|
2567
|
-
userInterface:
|
|
2760
|
+
dataType: UnitMetadata.DataType.NUMBER,
|
|
2761
|
+
userInterface: UnitMetadata.UserInterface.SEARCH,
|
|
2568
2762
|
required: true,
|
|
2569
2763
|
properties: {}
|
|
2570
2764
|
},
|
|
2571
2765
|
{
|
|
2572
2766
|
name: "RECDESP",
|
|
2573
2767
|
label: "Receita/Despesa",
|
|
2574
|
-
dataType:
|
|
2575
|
-
userInterface:
|
|
2768
|
+
dataType: UnitMetadata.DataType.TEXT,
|
|
2769
|
+
userInterface: UnitMetadata.UserInterface.OPTIONSELECTOR,
|
|
2576
2770
|
required: true,
|
|
2577
2771
|
properties: { options: `{"-1": "Despesa", "1": "Receita"}` }
|
|
2578
2772
|
},
|
|
2579
2773
|
{
|
|
2580
2774
|
name: "P",
|
|
2581
2775
|
label: "pera",
|
|
2582
|
-
dataType:
|
|
2583
|
-
userInterface:
|
|
2776
|
+
dataType: UnitMetadata.DataType.TEXT,
|
|
2777
|
+
userInterface: UnitMetadata.UserInterface.OPTIONSELECTOR,
|
|
2584
2778
|
properties: { options: `{"M": "Madura", "V": "Verde", "P": "Passada"}` }
|
|
2585
2779
|
},
|
|
2586
2780
|
{
|
|
2587
2781
|
name: "ME",
|
|
2588
2782
|
label: "ME",
|
|
2589
|
-
dataType:
|
|
2590
|
-
userInterface:
|
|
2783
|
+
dataType: UnitMetadata.DataType.NUMBER,
|
|
2784
|
+
userInterface: UnitMetadata.UserInterface.DECIMALNUMBER,
|
|
2591
2785
|
properties: { precision: 4, prettyPrecision: 1 }
|
|
2592
2786
|
}
|
|
2593
2787
|
]
|
|
@@ -2616,10 +2810,12 @@ exports.ez_combo_box = EzComboBox;
|
|
|
2616
2810
|
exports.ez_date_input = EzDateInput;
|
|
2617
2811
|
exports.ez_date_time_input = EzDateTimeInput;
|
|
2618
2812
|
exports.ez_form = EzForm;
|
|
2813
|
+
exports.ez_icon = EzIcon;
|
|
2619
2814
|
exports.ez_number_input = EzNumberInput;
|
|
2620
2815
|
exports.ez_search = EzSearch;
|
|
2621
2816
|
exports.ez_tabselector = EzTabselector;
|
|
2622
2817
|
exports.ez_text_area = EzTextArea;
|
|
2623
2818
|
exports.ez_text_input = EzTextInput;
|
|
2819
|
+
exports.ez_time_input = EzTimeInput;
|
|
2624
2820
|
exports.ez_upload = EzUpload;
|
|
2625
2821
|
exports.test_du = TestDu;
|