@sankhyalabs/ezui 1.1.108 → 1.1.109
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/AssetsUtils-4909c6de.js +24 -0
- package/dist/cjs/ez-calendar_16.cjs.entry.js +46 -107
- package/dist/cjs/ez-grid.cjs.entry.js +9 -8
- package/dist/cjs/ez-modal_2.cjs.entry.js +3 -3
- package/dist/cjs/ez-popover.cjs.entry.js +4 -5
- package/dist/custom-elements/index.js +3 -1577
- package/dist/esm/AssetsUtils-9b1329a3.js +22 -0
- package/dist/esm/ez-calendar_16.entry.js +2 -63
- package/dist/esm/ez-grid.entry.js +2 -1
- package/dist/esm/ez-modal_2.entry.js +2 -2
- package/dist/esm/ez-popover.entry.js +1 -2
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-080045a0.entry.js +1 -0
- package/dist/ezui/p-477bb703.js +1 -0
- package/dist/ezui/{p-db1797d7.entry.js → p-a038e7a5.entry.js} +28 -28
- package/dist/ezui/p-ae7c92b7.entry.js +1 -0
- package/dist/ezui/p-eaeaea64.entry.js +1 -0
- package/package.json +7 -3
- package/dist/cjs/AssetsUtils-697927e8.js +0 -79
- package/dist/cjs/FloatingManager-751368a8.js +0 -126
- package/dist/cjs/UnitMetadata-de809a4b.js +0 -1346
- package/dist/esm/AssetsUtils-f75711ac.js +0 -76
- package/dist/esm/FloatingManager-ee1f7fdf.js +0 -124
- package/dist/esm/UnitMetadata-d300ae38.js +0 -1340
- package/dist/ezui/p-3e6fa4ca.entry.js +0 -1
- package/dist/ezui/p-47cf74f0.js +0 -1
- package/dist/ezui/p-780fbe22.entry.js +0 -1
- package/dist/ezui/p-81fc41a5.js +0 -1
- package/dist/ezui/p-b05feb1f.js +0 -1
- package/dist/ezui/p-c451d6e6.entry.js +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-88286449.js');
|
|
4
|
+
|
|
5
|
+
const getSpritePath = (sprite) => `${getContextAssetsPath("../assets/actions-sprite.svg")}#${sprite}`;
|
|
6
|
+
let ctxLoaded = false;
|
|
7
|
+
function getContextAssetsPath(resource) {
|
|
8
|
+
if (!ctxLoaded) {
|
|
9
|
+
const scriptElem = document.querySelector("script[data-ezui-assets-url]");
|
|
10
|
+
if (scriptElem) {
|
|
11
|
+
let assetsPath = scriptElem.dataset.ezuiAssetsUrl;
|
|
12
|
+
if (assetsPath) {
|
|
13
|
+
if (assetsPath.startsWith('/')) {
|
|
14
|
+
assetsPath = window.location.origin + assetsPath;
|
|
15
|
+
}
|
|
16
|
+
index.setAssetPath(assetsPath);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
ctxLoaded = true;
|
|
20
|
+
}
|
|
21
|
+
return index.getAssetPath(resource);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.getSpritePath = getSpritePath;
|
|
@@ -3,69 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-88286449.js');
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const AssetsUtils = require('./AssetsUtils-697927e8.js');
|
|
9
|
-
|
|
10
|
-
class DateUtils {
|
|
11
|
-
static clearTime(date, adjustDayLightSavingTime = true) {
|
|
12
|
-
const newDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0);
|
|
13
|
-
return adjustDayLightSavingTime ? DateUtils.adjustDLST(newDate) : newDate;
|
|
14
|
-
}
|
|
15
|
-
static strToDate(strValue, adjustDayLightSavingTime = true, monthYearMode = false) {
|
|
16
|
-
/** monthYearMode é um booleano para usar o formato MM/YYYY.
|
|
17
|
-
* Quando ativado, é retornado o primeiro dia do mês apenas para construir a data.
|
|
18
|
-
* Não há necessidade de verificar o horário de verão quando utilizado esse modo. */
|
|
19
|
-
let parts;
|
|
20
|
-
if (monthYearMode) {
|
|
21
|
-
parts = /^(1[0-2]|0[1-9]|[1-9])[^\d]?(\d{2}|\d{4})(?:\s(\d{1,2}):(\d{1,2}):?(\d{0,2}))?$/.exec(strValue);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
parts = /^(3[01]|[1-2]\d|0[1-9]|[1-9])[^\d]?(1[0-2]|0[1-9]|[1-9])[^\d]?(\d{2}|\d{4})(?:\s(\d{1,2}):(\d{1,2}):?(\d{0,2}))?$/.exec(strValue);
|
|
25
|
-
}
|
|
26
|
-
if (!parts) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
const day = monthYearMode ? 1 : Number(parts[1]);
|
|
30
|
-
const month = Number(parts[(monthYearMode ? 1 : 2)]);
|
|
31
|
-
let year = Number(parts[(monthYearMode ? 2 : 3)]);
|
|
32
|
-
const hour = Number(parts[(monthYearMode ? 3 : 4)] || 0);
|
|
33
|
-
const min = Number(parts[(monthYearMode ? 4 : 5)] || 0);
|
|
34
|
-
const sec = Number(parts[(monthYearMode ? 5 : 6)] || 0);
|
|
35
|
-
if (year < 100) {
|
|
36
|
-
year += year < 30 ? 2000 : 1900;
|
|
37
|
-
}
|
|
38
|
-
let date = new Date(year, month - 1, day, hour, min, sec, 0);
|
|
39
|
-
if (adjustDayLightSavingTime === true && !monthYearMode && hour == 0) {
|
|
40
|
-
date = DateUtils.adjustDLST(date);
|
|
41
|
-
}
|
|
42
|
-
return date;
|
|
43
|
-
}
|
|
44
|
-
static adjustDLST(date) {
|
|
45
|
-
//Work around para corrigir o Bug do horário de verão.
|
|
46
|
-
if (date.getHours() == 23) {
|
|
47
|
-
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1, 1, 0, 0, 0);
|
|
48
|
-
}
|
|
49
|
-
return date;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
class ApplicationContext {
|
|
54
|
-
static getContextValue(key) {
|
|
55
|
-
return ApplicationContext.getCtx()[key];
|
|
56
|
-
}
|
|
57
|
-
static setContextValue(key, value) {
|
|
58
|
-
ApplicationContext.getCtx()[key] = 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
|
-
}
|
|
6
|
+
const core = require('@sankhyalabs/core');
|
|
7
|
+
const AssetsUtils = require('./AssetsUtils-4909c6de.js');
|
|
69
8
|
|
|
70
9
|
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-container--z-index:var(--more-visible, 2);--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__container{display:flex;z-index:var(--more-visible, 2)}.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}.calendar-time{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}.calendar-time__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}";
|
|
71
10
|
|
|
@@ -105,7 +44,7 @@ let EzCalendar = class {
|
|
|
105
44
|
*/
|
|
106
45
|
async show(top, left, bottom, right) {
|
|
107
46
|
if (this.floating) {
|
|
108
|
-
this._floatingID =
|
|
47
|
+
this._floatingID = core.FloatingManager.float(this._box, this._container, { autoClose: true, top, left, bottom, right });
|
|
109
48
|
window.requestAnimationFrame(() => {
|
|
110
49
|
this._box.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
111
50
|
});
|
|
@@ -130,7 +69,7 @@ let EzCalendar = class {
|
|
|
130
69
|
*/
|
|
131
70
|
async hide() {
|
|
132
71
|
if (this._floatingID !== undefined) {
|
|
133
|
-
|
|
72
|
+
core.FloatingManager.close(this._floatingID);
|
|
134
73
|
this._floatingID = undefined;
|
|
135
74
|
}
|
|
136
75
|
}
|
|
@@ -493,19 +432,19 @@ let EzComboBox = class {
|
|
|
493
432
|
//posição errada no futuro. Preferi fazer simples no começo,
|
|
494
433
|
//porque não quis onerar o text input com essa funcionalidade...
|
|
495
434
|
const top = (this.errorMessage || !this.canShowError) ? "0px" : "-17px";
|
|
496
|
-
this._floatingID =
|
|
435
|
+
this._floatingID = core.FloatingManager.float(this._optionsList, this._listContainer, { autoClose: true, top });
|
|
497
436
|
window.requestAnimationFrame(() => {
|
|
498
437
|
this._optionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
499
438
|
});
|
|
500
439
|
}
|
|
501
440
|
hideOptions() {
|
|
502
441
|
if (this._floatingID !== undefined) {
|
|
503
|
-
|
|
442
|
+
core.FloatingManager.close(this._floatingID);
|
|
504
443
|
}
|
|
505
444
|
this._floatingID = undefined;
|
|
506
445
|
}
|
|
507
446
|
isOptionsVisible() {
|
|
508
|
-
return this._floatingID !== undefined &&
|
|
447
|
+
return this._floatingID !== undefined && core.FloatingManager.isFloating(this._floatingID);
|
|
509
448
|
}
|
|
510
449
|
nextOption() {
|
|
511
450
|
if (this.searchMode && !this.isOptionsVisible()) {
|
|
@@ -712,8 +651,8 @@ let EzDateInput = class {
|
|
|
712
651
|
}
|
|
713
652
|
changeValue(newValue) {
|
|
714
653
|
var _a;
|
|
715
|
-
newValue = newValue instanceof Date ? DateUtils.clearTime(newValue) : null;
|
|
716
|
-
this.value = this.value instanceof Date ? DateUtils.clearTime(this.value) : null;
|
|
654
|
+
newValue = newValue instanceof Date ? core.DateUtils.clearTime(newValue) : null;
|
|
655
|
+
this.value = this.value instanceof Date ? core.DateUtils.clearTime(this.value) : null;
|
|
717
656
|
this._textInput.errorMessage = "";
|
|
718
657
|
if ((newValue === null || newValue === void 0 ? void 0 : newValue.toString()) !== ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString())) {
|
|
719
658
|
this.value = newValue;
|
|
@@ -735,7 +674,7 @@ let EzDateInput = class {
|
|
|
735
674
|
}
|
|
736
675
|
parseDate() {
|
|
737
676
|
const strValue = this._textInput.value;
|
|
738
|
-
const parsedDate = DateUtils.strToDate(strValue);
|
|
677
|
+
const parsedDate = core.DateUtils.strToDate(strValue);
|
|
739
678
|
if (parsedDate || !strValue) {
|
|
740
679
|
if (this.value === parsedDate) {
|
|
741
680
|
this.changeValue(this.value);
|
|
@@ -864,9 +803,9 @@ let EzDateTimeInput = class {
|
|
|
864
803
|
const partsDateTime = (strValue && strValue.length > 0) ? strValue.split(" ") : [];
|
|
865
804
|
const onlyDate = partsDateTime.length > 0 ? partsDateTime[0] : strValue;
|
|
866
805
|
const onlyTime = partsDateTime[1] ? partsDateTime[1] : "";
|
|
867
|
-
const parsedTime =
|
|
806
|
+
const parsedTime = core.TimeFormatter.prepareValue(onlyTime, this.showSeconds);
|
|
868
807
|
const strDateTime = onlyDate + (parsedTime && " " + parsedTime);
|
|
869
|
-
const parsedDate = DateUtils.strToDate(strDateTime);
|
|
808
|
+
const parsedDate = core.DateUtils.strToDate(strDateTime);
|
|
870
809
|
if (parsedDate || !strValue) {
|
|
871
810
|
if (this.value === parsedDate) {
|
|
872
811
|
this.changeValue(this.value);
|
|
@@ -977,17 +916,17 @@ function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecisio
|
|
|
977
916
|
}
|
|
978
917
|
|
|
979
918
|
const uiBuilders = new Map();
|
|
980
|
-
uiBuilders.set(
|
|
981
|
-
uiBuilders.set(
|
|
982
|
-
uiBuilders.set(
|
|
983
|
-
uiBuilders.set(
|
|
984
|
-
uiBuilders.set(
|
|
985
|
-
uiBuilders.set(
|
|
986
|
-
uiBuilders.set(
|
|
987
|
-
uiBuilders.set(
|
|
988
|
-
uiBuilders.set(
|
|
989
|
-
uiBuilders.set(
|
|
990
|
-
uiBuilders.set(
|
|
919
|
+
uiBuilders.set(core.UserInterface.LONGTEXT, buildTextArea);
|
|
920
|
+
uiBuilders.set(core.UserInterface.CHECKBOX, buildCheckBox);
|
|
921
|
+
uiBuilders.set(core.UserInterface.SWITCH, buildSwitch);
|
|
922
|
+
uiBuilders.set(core.UserInterface.OPTIONSELECTOR, buildComboBox);
|
|
923
|
+
uiBuilders.set(core.UserInterface.SEARCH, buildSearch);
|
|
924
|
+
uiBuilders.set(core.UserInterface.FILE, buildFile);
|
|
925
|
+
uiBuilders.set(core.UserInterface.DATE, buildDate);
|
|
926
|
+
uiBuilders.set(core.UserInterface.TIME, buildTime);
|
|
927
|
+
uiBuilders.set(core.UserInterface.DATETIME, buildTimeDate);
|
|
928
|
+
uiBuilders.set(core.UserInterface.DECIMALNUMBER, buildDecimal);
|
|
929
|
+
uiBuilders.set(core.UserInterface.INTEGERNUMBER, buildInteger);
|
|
991
930
|
const buildField = (field) => {
|
|
992
931
|
const descriptor = field.descriptor;
|
|
993
932
|
const config = Object.assign({}, field.config);
|
|
@@ -1534,7 +1473,7 @@ class DataBinder {
|
|
|
1534
1473
|
}
|
|
1535
1474
|
bindSearchOptionsLoader(fieldName, field) {
|
|
1536
1475
|
if (field.nodeName === "EZ-SEARCH" && field["optionLoader"] === undefined) {
|
|
1537
|
-
const loader = ApplicationContext.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");
|
|
1476
|
+
const loader = core.ApplicationContext.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");
|
|
1538
1477
|
if (loader) {
|
|
1539
1478
|
field["optionLoader"] = (arg) => {
|
|
1540
1479
|
return loader(arg, fieldName, this._dataUnit);
|
|
@@ -1674,12 +1613,12 @@ let EzForm = class {
|
|
|
1674
1613
|
return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
1675
1614
|
}
|
|
1676
1615
|
interceptAction(action) {
|
|
1677
|
-
if (action.type ===
|
|
1616
|
+
if (action.type === core.Action.RECORDS_COPIED) {
|
|
1678
1617
|
const metadata = selectFormMetadata(this._store.getState());
|
|
1679
1618
|
const cleanFields = metadata.getCleanOnCopyFields();
|
|
1680
1619
|
if (cleanFields) {
|
|
1681
1620
|
const records = action.payload;
|
|
1682
|
-
return new
|
|
1621
|
+
return new core.DataUnitAction(core.Action.RECORDS_COPIED, records.map(record => {
|
|
1683
1622
|
const newRecord = Object.assign({}, record);
|
|
1684
1623
|
cleanFields.forEach(fieldName => delete newRecord[fieldName]);
|
|
1685
1624
|
return newRecord;
|
|
@@ -1690,11 +1629,11 @@ let EzForm = class {
|
|
|
1690
1629
|
}
|
|
1691
1630
|
componentWillLoad() {
|
|
1692
1631
|
if (this.dataUnit === undefined) {
|
|
1693
|
-
this.dataUnit = new
|
|
1632
|
+
this.dataUnit = new core.DataUnit("ez-form");
|
|
1694
1633
|
}
|
|
1695
1634
|
this.dataUnit.addInterceptor(this);
|
|
1696
1635
|
this.dataUnit.subscribe(action => {
|
|
1697
|
-
if (action.type ===
|
|
1636
|
+
if (action.type === core.Action.METADATA_LOADED) {
|
|
1698
1637
|
this.processMetadata();
|
|
1699
1638
|
}
|
|
1700
1639
|
});
|
|
@@ -1737,7 +1676,7 @@ let EzIcon = class {
|
|
|
1737
1676
|
if (this.isSprite()) {
|
|
1738
1677
|
return index.h("svg", { class: this.size, role: "img" }, index.h("use", { xlinkHref: this.href }));
|
|
1739
1678
|
}
|
|
1740
|
-
else if (!
|
|
1679
|
+
else if (!core.StringUtils.isEmpty(this.iconName)) {
|
|
1741
1680
|
return index.h("span", { class: `icon-content ${this.getIconClassName()} ${this.size}--font` });
|
|
1742
1681
|
}
|
|
1743
1682
|
else {
|
|
@@ -1792,7 +1731,7 @@ let EzNumberInput = class {
|
|
|
1792
1731
|
}
|
|
1793
1732
|
}
|
|
1794
1733
|
parseNumber() {
|
|
1795
|
-
const parsedNumber = this._textInput.value ?
|
|
1734
|
+
const parsedNumber = this._textInput.value ? core.NumberUtils.stringToNumber(this._textInput.value) : null;
|
|
1796
1735
|
if (parsedNumber != null && isNaN(parsedNumber)) {
|
|
1797
1736
|
this.errorMessage = "O valor digitado não é um número válido";
|
|
1798
1737
|
}
|
|
@@ -1808,7 +1747,7 @@ let EzNumberInput = class {
|
|
|
1808
1747
|
}
|
|
1809
1748
|
getTextValue(value) {
|
|
1810
1749
|
if (value) {
|
|
1811
|
-
return this.precision > 0 ?
|
|
1750
|
+
return this.precision > 0 ? core.NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
|
|
1812
1751
|
}
|
|
1813
1752
|
return null;
|
|
1814
1753
|
}
|
|
@@ -2210,7 +2149,7 @@ let EzTextInput = class {
|
|
|
2210
2149
|
prepareMask() {
|
|
2211
2150
|
if (this.mask) {
|
|
2212
2151
|
if (this._maskFormatter == undefined) {
|
|
2213
|
-
this._maskFormatter = new
|
|
2152
|
+
this._maskFormatter = new core.MaskFormatter(this.mask);
|
|
2214
2153
|
}
|
|
2215
2154
|
else {
|
|
2216
2155
|
this._maskFormatter.mask = this.mask;
|
|
@@ -2391,7 +2330,7 @@ let EzTimeInput = class {
|
|
|
2391
2330
|
prepareMask() {
|
|
2392
2331
|
if (this.showSeconds) {
|
|
2393
2332
|
if (this._maskFormatter == undefined) {
|
|
2394
|
-
this._maskFormatter = new
|
|
2333
|
+
this._maskFormatter = new core.MaskFormatter("##:##:##");
|
|
2395
2334
|
}
|
|
2396
2335
|
else {
|
|
2397
2336
|
this._maskFormatter.mask = "##:##:##";
|
|
@@ -2399,7 +2338,7 @@ let EzTimeInput = class {
|
|
|
2399
2338
|
}
|
|
2400
2339
|
else {
|
|
2401
2340
|
if (this._maskFormatter == undefined) {
|
|
2402
|
-
this._maskFormatter = new
|
|
2341
|
+
this._maskFormatter = new core.MaskFormatter("##:##");
|
|
2403
2342
|
}
|
|
2404
2343
|
else {
|
|
2405
2344
|
this._maskFormatter.mask = "##:##";
|
|
@@ -2433,14 +2372,14 @@ let EzTimeInput = class {
|
|
|
2433
2372
|
handleFocusout() {
|
|
2434
2373
|
this.errorMessage = "";
|
|
2435
2374
|
this.prepareValue(this.viewValue);
|
|
2436
|
-
if (!
|
|
2375
|
+
if (!core.TimeFormatter.validateTime(this.viewValue, this.showSeconds)) {
|
|
2437
2376
|
this.clearField();
|
|
2438
2377
|
this.errorMessage = "Favor inserir um horário válido.";
|
|
2439
2378
|
}
|
|
2440
2379
|
}
|
|
2441
2380
|
prepareValue(value) {
|
|
2442
2381
|
try {
|
|
2443
|
-
this.viewValue =
|
|
2382
|
+
this.viewValue = core.TimeFormatter.prepareValue(value, this.showSeconds);
|
|
2444
2383
|
}
|
|
2445
2384
|
catch (e) {
|
|
2446
2385
|
this.clearField();
|
|
@@ -2452,7 +2391,7 @@ let EzTimeInput = class {
|
|
|
2452
2391
|
}
|
|
2453
2392
|
handleChange() {
|
|
2454
2393
|
this.viewValue = this._inputElem.value;
|
|
2455
|
-
this.value =
|
|
2394
|
+
this.value = core.NumberUtils.stringToNumber(this.viewValue.replace(/\D/g, ""));
|
|
2456
2395
|
}
|
|
2457
2396
|
//---------------------------------------------
|
|
2458
2397
|
// Lifecycle web component
|
|
@@ -2844,7 +2783,7 @@ let TestDu = class {
|
|
|
2844
2783
|
private _ezSearch// : HTMLEzSearch
|
|
2845
2784
|
private _ezUpload// : HTMLEzUpload*/
|
|
2846
2785
|
componentWillLoad() {
|
|
2847
|
-
this.dataUnit = new
|
|
2786
|
+
this.dataUnit = new core.DataUnit("testes_com_formulario");
|
|
2848
2787
|
this.dataUnit.metadata = {
|
|
2849
2788
|
name: "dd://br.com.sankhya.fin.cad.movimentacaoFinanceira/Financeiro",
|
|
2850
2789
|
label: "Parceiro",
|
|
@@ -2852,31 +2791,31 @@ let TestDu = class {
|
|
|
2852
2791
|
{
|
|
2853
2792
|
name: "CODPARC",
|
|
2854
2793
|
label: "Parceiro",
|
|
2855
|
-
dataType:
|
|
2856
|
-
userInterface:
|
|
2794
|
+
dataType: core.DataType.NUMBER,
|
|
2795
|
+
userInterface: core.UserInterface.SEARCH,
|
|
2857
2796
|
required: true,
|
|
2858
2797
|
properties: {}
|
|
2859
2798
|
},
|
|
2860
2799
|
{
|
|
2861
2800
|
name: "RECDESP",
|
|
2862
2801
|
label: "Receita/Despesa",
|
|
2863
|
-
dataType:
|
|
2864
|
-
userInterface:
|
|
2802
|
+
dataType: core.DataType.TEXT,
|
|
2803
|
+
userInterface: core.UserInterface.OPTIONSELECTOR,
|
|
2865
2804
|
required: true,
|
|
2866
2805
|
properties: { options: `{"-1": "Despesa", "1": "Receita"}` }
|
|
2867
2806
|
},
|
|
2868
2807
|
{
|
|
2869
2808
|
name: "P",
|
|
2870
2809
|
label: "pera",
|
|
2871
|
-
dataType:
|
|
2872
|
-
userInterface:
|
|
2810
|
+
dataType: core.DataType.TEXT,
|
|
2811
|
+
userInterface: core.UserInterface.OPTIONSELECTOR,
|
|
2873
2812
|
properties: { options: `{"M": "Madura", "V": "Verde", "P": "Passada"}` }
|
|
2874
2813
|
},
|
|
2875
2814
|
{
|
|
2876
2815
|
name: "ME",
|
|
2877
2816
|
label: "ME",
|
|
2878
|
-
dataType:
|
|
2879
|
-
userInterface:
|
|
2817
|
+
dataType: core.DataType.NUMBER,
|
|
2818
|
+
userInterface: core.UserInterface.DECIMALNUMBER,
|
|
2880
2819
|
properties: { precision: 4, prettyPrecision: 1 }
|
|
2881
2820
|
}
|
|
2882
2821
|
]
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-88286449.js');
|
|
6
|
-
const
|
|
6
|
+
const core = require('@sankhyalabs/core');
|
|
7
|
+
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
7
8
|
|
|
8
9
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
9
10
|
|
|
@@ -110068,7 +110069,7 @@ class AgGridController {
|
|
|
110068
110069
|
if (sort) {
|
|
110069
110070
|
const field = this._dataUnit.getField(colId);
|
|
110070
110071
|
const mode = sort === "asc" ? UnitMetadata.SortMode.ASC : UnitMetadata.SortMode.DESC;
|
|
110071
|
-
const sortField = field ? { field: field.name, dataType: field.dataType, mode } : { field: colId, dataType:
|
|
110072
|
+
const sortField = field ? { field: field.name, dataType: field.dataType, mode } : { field: colId, dataType: core.DataType.TEXT, mode };
|
|
110072
110073
|
sortedColumns.push(sortField);
|
|
110073
110074
|
}
|
|
110074
110075
|
});
|
|
@@ -110353,14 +110354,14 @@ class DataUnitBridge {
|
|
|
110353
110354
|
}
|
|
110354
110355
|
processAction(action) {
|
|
110355
110356
|
switch (action.type) {
|
|
110356
|
-
case
|
|
110357
|
+
case core.Action.METADATA_LOADED:
|
|
110357
110358
|
this._gridController.setColumnsDef(this.buildColumnDefs(), true);
|
|
110358
110359
|
break;
|
|
110359
|
-
case
|
|
110360
|
-
case
|
|
110361
|
-
case
|
|
110362
|
-
case
|
|
110363
|
-
case
|
|
110360
|
+
case core.Action.RECORDS_REMOVED:
|
|
110361
|
+
case core.Action.EDITION_CANCELED:
|
|
110362
|
+
case core.Action.RECORDS_ADDED:
|
|
110363
|
+
case core.Action.RECORDS_COPIED:
|
|
110364
|
+
case core.Action.DATA_SAVED:
|
|
110364
110365
|
this._gridController.refresh();
|
|
110365
110366
|
break;
|
|
110366
110367
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-88286449.js');
|
|
6
|
-
const AssetsUtils = require('./AssetsUtils-
|
|
7
|
-
require('
|
|
6
|
+
const AssetsUtils = require('./AssetsUtils-4909c6de.js');
|
|
7
|
+
const core = require('@sankhyalabs/core');
|
|
8
8
|
|
|
9
9
|
const ezModalCss = ":host{--ez-modal-z-index:var(--most-visible, 3);--ez-modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;padding:var(--ez-modal-vertical-padding) 0;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;max-height:calc(100% - 48px);height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:24px;border-radius:12px 0px 0px 12px;box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
|
|
10
10
|
|
|
@@ -263,7 +263,7 @@ let GridConfig = class {
|
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
compareWords(column, searchingText) {
|
|
266
|
-
if (
|
|
266
|
+
if (core.StringUtils.replaceAccentuatedChars(column.label).indexOf(core.StringUtils.replaceAccentuatedChars(searchingText)) > -1) {
|
|
267
267
|
return true;
|
|
268
268
|
}
|
|
269
269
|
return false;
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-88286449.js');
|
|
6
|
-
require('
|
|
7
|
-
const FloatingManager = require('./FloatingManager-751368a8.js');
|
|
6
|
+
const core = require('@sankhyalabs/core');
|
|
8
7
|
|
|
9
8
|
const ezPopoverCss = ":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--more-visible, 1);position:relative;display:flex;user-select:none;width:100%}.box{z-index:var(--ez-popover__box--z-index);display:flex;flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.box--fit-content{width:fit-content}.box--full-width{width:100%}";
|
|
10
9
|
|
|
@@ -66,7 +65,7 @@ let EzPopover = class {
|
|
|
66
65
|
return !_container.lastElementChild.shadowRoot ? _container.contains(node) : _container.lastElementChild.shadowRoot.contains(node);
|
|
67
66
|
}
|
|
68
67
|
};
|
|
69
|
-
|
|
68
|
+
core.FloatingManager.updateFloatPosition(this._box, this._container, floatingOptions);
|
|
70
69
|
}
|
|
71
70
|
/**
|
|
72
71
|
* Faz com que o popover seja renderizado na DOM.
|
|
@@ -89,7 +88,7 @@ let EzPopover = class {
|
|
|
89
88
|
return !_container.lastElementChild.shadowRoot ? _container.contains(node) : _container.lastElementChild.shadowRoot.contains(node);
|
|
90
89
|
}
|
|
91
90
|
};
|
|
92
|
-
this._floatingID =
|
|
91
|
+
this._floatingID = core.FloatingManager.float(this._box, this._container, floatingOptions);
|
|
93
92
|
this.opened = true;
|
|
94
93
|
}
|
|
95
94
|
/**
|
|
@@ -97,7 +96,7 @@ let EzPopover = class {
|
|
|
97
96
|
*/
|
|
98
97
|
async hide() {
|
|
99
98
|
if (this._floatingID !== undefined) {
|
|
100
|
-
|
|
99
|
+
core.FloatingManager.close(this._floatingID);
|
|
101
100
|
this._floatingID = undefined;
|
|
102
101
|
this.opened = false;
|
|
103
102
|
}
|