@sankhyalabs/ezui 1.1.86 → 1.1.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-button_11.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box_7.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +33 -2
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/{index-789fa661.js → index-a92e6d04.js} +1 -0
- package/dist/collection/components/ez-form/ez-form.js +17 -1
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +16 -1
- package/dist/custom-elements/index.js +32 -1
- package/dist/esm/ez-button_11.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-collapsible-box_7.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +33 -2
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/{index-461f1302.js → index-4fb1605f.js} +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-88e84ff2.entry.js → p-27a35580.entry.js} +1 -1
- package/dist/ezui/{p-8b7a4a16.entry.js → p-3e79877f.entry.js} +1 -1
- package/dist/ezui/p-4e08b842.entry.js +1 -0
- package/dist/ezui/{p-b1d7488d.entry.js → p-535771b6.entry.js} +1 -1
- package/dist/ezui/{p-cc448554.entry.js → p-826b6c4d.entry.js} +1 -1
- package/dist/ezui/{p-ca6240ff.entry.js → p-b796d351.entry.js} +1 -1
- package/dist/ezui/{p-d93a3e2b.entry.js → p-eefc1f9d.entry.js} +1 -1
- package/dist/ezui/{p-7c4d4946.js → p-f0137439.js} +1 -1
- package/dist/types/components/ez-form/ez-form.d.ts +4 -2
- package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +3 -0
- package/package.json +1 -1
- package/dist/ezui/p-9f98c4d1.entry.js +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0bce1636.js');
|
|
6
|
-
const index$1 = require('./index-
|
|
6
|
+
const index$1 = require('./index-a92e6d04.js');
|
|
7
7
|
const AssetsUtils = require('./AssetsUtils-caf95dab.js');
|
|
8
8
|
|
|
9
9
|
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{padding:0px}button.small{width:32px;min-width:32px;height:32px}button.medium{width:42px;min-width:42px;height:42px}button.large{width:52px;min-width:52px;height:52px}.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;}";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0bce1636.js');
|
|
6
|
-
require('./index-
|
|
6
|
+
require('./index-a92e6d04.js');
|
|
7
7
|
const FloatingManager = require('./FloatingManager-6cfeb947.js');
|
|
8
8
|
|
|
9
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);--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:2px;--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 var(--space--small, 12px);--ez-calendar__cell--width:var(--space--large, 24px);--ez-calendar__cell--padding:var(--space--extra-small, 3px) 0px;--ez-calendar__cell--border-radius:var(--border--radius-small, 6px);--ez-calendar__cell--over--background-color:var(--color--strokes, #E2F4EF);--ez-calendar__cell--outset--color:var(--color--strokes, #C0C0C0);--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--strokes, #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--medium, 12px);margin: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--large, 600);font-size:var(--title--medium, 16px);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--small, 12px);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)}.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__body{padding:var(--space--small, 6px) 0px}.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--small);padding:var(--space--extra-small, 6px);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 6px;padding-left:16px;padding-bottom:0px;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:180px;padding:0px;margin:0px;overflow:auto}.calendar__column::-webkit-scrollbar{width:0px;max-width:0px;min-width:0px}.calendarTime__header{padding-left:6px;padding-right:6px;display:flex;justify-content:space-between;padding-bottom:var(--space--medium, 12px);margin:var(--space--small, 6px) var(--space--, 12px);font-weight:var(--text-weight--large, 600);font-size:var(--title--medium, 16px);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}.endHidden{-webkit-mask-image:linear-gradient(180deg, #000 calc(100% - 48px), transparent 100%)}";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0bce1636.js');
|
|
6
|
-
const index$1 = require('./index-
|
|
6
|
+
const index$1 = require('./index-a92e6d04.js');
|
|
7
7
|
const CSSVarsUtils = require('./CSSVarsUtils-66e86394.js');
|
|
8
8
|
const ApplicationUtils = require('./ApplicationUtils-d1c1db56.js');
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0bce1636.js');
|
|
6
|
-
require('./index-
|
|
6
|
+
require('./index-a92e6d04.js');
|
|
7
7
|
const FloatingManager = require('./FloatingManager-6cfeb947.js');
|
|
8
8
|
const CSSVarsUtils = require('./CSSVarsUtils-66e86394.js');
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0bce1636.js');
|
|
6
|
-
const index$1 = require('./index-
|
|
6
|
+
const index$1 = require('./index-a92e6d04.js');
|
|
7
7
|
const ApplicationUtils = require('./ApplicationUtils-d1c1db56.js');
|
|
8
8
|
|
|
9
9
|
const buildTextArea = ({ name, label }) => {
|
|
@@ -129,6 +129,7 @@ class FormMetadata {
|
|
|
129
129
|
constructor() {
|
|
130
130
|
this._sheets = new Map();
|
|
131
131
|
this._requiredFields = [];
|
|
132
|
+
this._cleanOnCopyFields = [];
|
|
132
133
|
}
|
|
133
134
|
getSheet(name) {
|
|
134
135
|
return this._sheets.get(name);
|
|
@@ -139,10 +140,14 @@ class FormMetadata {
|
|
|
139
140
|
addSheet(sheet) {
|
|
140
141
|
this._sheets.set(sheet.name, sheet);
|
|
141
142
|
this._requiredFields = this._requiredFields.concat(sheet.requiredFields);
|
|
143
|
+
this._cleanOnCopyFields = this._cleanOnCopyFields.concat(sheet.cleanOnCopyFields);
|
|
142
144
|
}
|
|
143
145
|
getRequiredFields() {
|
|
144
146
|
return this._requiredFields;
|
|
145
147
|
}
|
|
148
|
+
getCleanOnCopyFields() {
|
|
149
|
+
return this._cleanOnCopyFields;
|
|
150
|
+
}
|
|
146
151
|
}
|
|
147
152
|
const buildFromDataUnit = (dataUnit) => {
|
|
148
153
|
var _a;
|
|
@@ -156,6 +161,9 @@ const buildFromDataUnit = (dataUnit) => {
|
|
|
156
161
|
items: visibleFields.map(descriptor => { return { descriptor }; }),
|
|
157
162
|
requiredFields: visibleFields
|
|
158
163
|
.filter(descriptor => descriptor.required)
|
|
164
|
+
.map(descriptor => descriptor.name),
|
|
165
|
+
cleanOnCopyFields: visibleFields
|
|
166
|
+
.filter(descriptor => { var _a; return (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy; })
|
|
159
167
|
.map(descriptor => descriptor.name)
|
|
160
168
|
});
|
|
161
169
|
}
|
|
@@ -164,7 +172,9 @@ const buildFromDataUnit = (dataUnit) => {
|
|
|
164
172
|
const buildFromConfig = (fields, dataUnit) => {
|
|
165
173
|
const sheets = new Map();
|
|
166
174
|
const requiredFields = [];
|
|
175
|
+
const cleanOnCopyFields = [];
|
|
167
176
|
fields.forEach(config => {
|
|
177
|
+
var _a;
|
|
168
178
|
if (config.visible !== false) {
|
|
169
179
|
const tab = config.tab || "Geral";
|
|
170
180
|
const descriptor = dataUnit.getField(config.name);
|
|
@@ -176,6 +186,10 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
176
186
|
if (isRequired) {
|
|
177
187
|
requiredFields.push(config.name);
|
|
178
188
|
}
|
|
189
|
+
const clearOnCopy = config.cleanOnCopy === undefined ? (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy : config.cleanOnCopy;
|
|
190
|
+
if (clearOnCopy) {
|
|
191
|
+
cleanOnCopyFields.push(config.name);
|
|
192
|
+
}
|
|
179
193
|
const tabItens = sheets.get(tab);
|
|
180
194
|
const fieldMD = { config, descriptor };
|
|
181
195
|
const group = config.group;
|
|
@@ -200,7 +214,8 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
200
214
|
label: key,
|
|
201
215
|
name: key,
|
|
202
216
|
items: Array.from(value.values()),
|
|
203
|
-
requiredFields
|
|
217
|
+
requiredFields,
|
|
218
|
+
cleanOnCopyFields
|
|
204
219
|
});
|
|
205
220
|
});
|
|
206
221
|
return metadata;
|
|
@@ -694,10 +709,26 @@ let EzForm = class {
|
|
|
694
709
|
var _a;
|
|
695
710
|
return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
696
711
|
}
|
|
712
|
+
interceptAction(action) {
|
|
713
|
+
if (action.type === index$1.Action.RECORDS_COPIED) {
|
|
714
|
+
const metadata = selectFormMetadata(this._store.getState());
|
|
715
|
+
const cleanFields = metadata.getCleanOnCopyFields();
|
|
716
|
+
if (cleanFields) {
|
|
717
|
+
const records = action.payload;
|
|
718
|
+
return new index$1.DataUnitAction(index$1.Action.RECORDS_COPIED, records.map(record => {
|
|
719
|
+
const newRecord = Object.assign({}, record);
|
|
720
|
+
cleanFields.forEach(fieldName => delete newRecord[fieldName]);
|
|
721
|
+
return newRecord;
|
|
722
|
+
}));
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
return action;
|
|
726
|
+
}
|
|
697
727
|
componentWillLoad() {
|
|
698
728
|
if (this.dataUnit === undefined) {
|
|
699
729
|
this.dataUnit = new index$1.DataUnit("ez-form");
|
|
700
730
|
}
|
|
731
|
+
this.dataUnit.addInterceptor(this);
|
|
701
732
|
this.dataUnit.subscribe(action => {
|
|
702
733
|
if (action.type === index$1.Action.METADATA_LOADED) {
|
|
703
734
|
this.processMetadata();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0bce1636.js');
|
|
6
|
-
require('./index-
|
|
6
|
+
require('./index-a92e6d04.js');
|
|
7
7
|
const FloatingManager = require('./FloatingManager-6cfeb947.js');
|
|
8
8
|
|
|
9
9
|
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%}";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0bce1636.js');
|
|
6
|
-
const index$1 = require('./index-
|
|
6
|
+
const index$1 = require('./index-a92e6d04.js');
|
|
7
7
|
const CSSVarsUtils = require('./CSSVarsUtils-66e86394.js');
|
|
8
8
|
const AssetsUtils = require('./AssetsUtils-caf95dab.js');
|
|
9
9
|
|
|
@@ -7452,6 +7452,7 @@ function HeadersInstanceToPlainObject(headers) {
|
|
|
7452
7452
|
});
|
|
7453
7453
|
|
|
7454
7454
|
exports.DataUnit = DataUnit;
|
|
7455
|
+
exports.DataUnitAction = DataUnitAction;
|
|
7455
7456
|
exports.MaskFormatter = MaskFormatter;
|
|
7456
7457
|
exports.NumberUtils = NumberUtils;
|
|
7457
7458
|
exports.TimeFormatter = TimeFormatter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, h, Host, Prop, Element, forceUpdate, Method } from "@stencil/core";
|
|
2
|
-
import { DataUnit, Action } from "@sankhyalabs/core";
|
|
2
|
+
import { DataUnit, Action, DataUnitAction } from "@sankhyalabs/core";
|
|
3
3
|
import { FormSheet } from "./structure/FormSheet";
|
|
4
4
|
import { buildFromConfig, buildFromDataUnit } from "./structure/FormSheetMetadata";
|
|
5
5
|
import { createStore } from "redux";
|
|
@@ -76,10 +76,26 @@ export class EzForm {
|
|
|
76
76
|
var _a;
|
|
77
77
|
return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
78
78
|
}
|
|
79
|
+
interceptAction(action) {
|
|
80
|
+
if (action.type === Action.RECORDS_COPIED) {
|
|
81
|
+
const metadata = selectFormMetadata(this._store.getState());
|
|
82
|
+
const cleanFields = metadata.getCleanOnCopyFields();
|
|
83
|
+
if (cleanFields) {
|
|
84
|
+
const records = action.payload;
|
|
85
|
+
return new DataUnitAction(Action.RECORDS_COPIED, records.map(record => {
|
|
86
|
+
const newRecord = Object.assign({}, record);
|
|
87
|
+
cleanFields.forEach(fieldName => delete newRecord[fieldName]);
|
|
88
|
+
return newRecord;
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return action;
|
|
93
|
+
}
|
|
79
94
|
componentWillLoad() {
|
|
80
95
|
if (this.dataUnit === undefined) {
|
|
81
96
|
this.dataUnit = new DataUnit("ez-form");
|
|
82
97
|
}
|
|
98
|
+
this.dataUnit.addInterceptor(this);
|
|
83
99
|
this.dataUnit.subscribe(action => {
|
|
84
100
|
if (action.type === Action.METADATA_LOADED) {
|
|
85
101
|
this.processMetadata();
|
|
@@ -2,6 +2,7 @@ export class FormMetadata {
|
|
|
2
2
|
constructor() {
|
|
3
3
|
this._sheets = new Map();
|
|
4
4
|
this._requiredFields = [];
|
|
5
|
+
this._cleanOnCopyFields = [];
|
|
5
6
|
}
|
|
6
7
|
getSheet(name) {
|
|
7
8
|
return this._sheets.get(name);
|
|
@@ -12,10 +13,14 @@ export class FormMetadata {
|
|
|
12
13
|
addSheet(sheet) {
|
|
13
14
|
this._sheets.set(sheet.name, sheet);
|
|
14
15
|
this._requiredFields = this._requiredFields.concat(sheet.requiredFields);
|
|
16
|
+
this._cleanOnCopyFields = this._cleanOnCopyFields.concat(sheet.cleanOnCopyFields);
|
|
15
17
|
}
|
|
16
18
|
getRequiredFields() {
|
|
17
19
|
return this._requiredFields;
|
|
18
20
|
}
|
|
21
|
+
getCleanOnCopyFields() {
|
|
22
|
+
return this._cleanOnCopyFields;
|
|
23
|
+
}
|
|
19
24
|
}
|
|
20
25
|
export const buildFromDataUnit = (dataUnit) => {
|
|
21
26
|
var _a;
|
|
@@ -29,6 +34,9 @@ export const buildFromDataUnit = (dataUnit) => {
|
|
|
29
34
|
items: visibleFields.map(descriptor => { return { descriptor }; }),
|
|
30
35
|
requiredFields: visibleFields
|
|
31
36
|
.filter(descriptor => descriptor.required)
|
|
37
|
+
.map(descriptor => descriptor.name),
|
|
38
|
+
cleanOnCopyFields: visibleFields
|
|
39
|
+
.filter(descriptor => { var _a; return (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy; })
|
|
32
40
|
.map(descriptor => descriptor.name)
|
|
33
41
|
});
|
|
34
42
|
}
|
|
@@ -37,7 +45,9 @@ export const buildFromDataUnit = (dataUnit) => {
|
|
|
37
45
|
export const buildFromConfig = (fields, dataUnit) => {
|
|
38
46
|
const sheets = new Map();
|
|
39
47
|
const requiredFields = [];
|
|
48
|
+
const cleanOnCopyFields = [];
|
|
40
49
|
fields.forEach(config => {
|
|
50
|
+
var _a;
|
|
41
51
|
if (config.visible !== false) {
|
|
42
52
|
const tab = config.tab || "Geral";
|
|
43
53
|
const descriptor = dataUnit.getField(config.name);
|
|
@@ -49,6 +59,10 @@ export const buildFromConfig = (fields, dataUnit) => {
|
|
|
49
59
|
if (isRequired) {
|
|
50
60
|
requiredFields.push(config.name);
|
|
51
61
|
}
|
|
62
|
+
const clearOnCopy = config.cleanOnCopy === undefined ? (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy : config.cleanOnCopy;
|
|
63
|
+
if (clearOnCopy) {
|
|
64
|
+
cleanOnCopyFields.push(config.name);
|
|
65
|
+
}
|
|
52
66
|
const tabItens = sheets.get(tab);
|
|
53
67
|
const fieldMD = { config, descriptor };
|
|
54
68
|
const group = config.group;
|
|
@@ -73,7 +87,8 @@ export const buildFromConfig = (fields, dataUnit) => {
|
|
|
73
87
|
label: key,
|
|
74
88
|
name: key,
|
|
75
89
|
items: Array.from(value.values()),
|
|
76
|
-
requiredFields
|
|
90
|
+
requiredFields,
|
|
91
|
+
cleanOnCopyFields
|
|
77
92
|
});
|
|
78
93
|
});
|
|
79
94
|
return metadata;
|
|
@@ -8770,6 +8770,7 @@ class FormMetadata {
|
|
|
8770
8770
|
constructor() {
|
|
8771
8771
|
this._sheets = new Map();
|
|
8772
8772
|
this._requiredFields = [];
|
|
8773
|
+
this._cleanOnCopyFields = [];
|
|
8773
8774
|
}
|
|
8774
8775
|
getSheet(name) {
|
|
8775
8776
|
return this._sheets.get(name);
|
|
@@ -8780,10 +8781,14 @@ class FormMetadata {
|
|
|
8780
8781
|
addSheet(sheet) {
|
|
8781
8782
|
this._sheets.set(sheet.name, sheet);
|
|
8782
8783
|
this._requiredFields = this._requiredFields.concat(sheet.requiredFields);
|
|
8784
|
+
this._cleanOnCopyFields = this._cleanOnCopyFields.concat(sheet.cleanOnCopyFields);
|
|
8783
8785
|
}
|
|
8784
8786
|
getRequiredFields() {
|
|
8785
8787
|
return this._requiredFields;
|
|
8786
8788
|
}
|
|
8789
|
+
getCleanOnCopyFields() {
|
|
8790
|
+
return this._cleanOnCopyFields;
|
|
8791
|
+
}
|
|
8787
8792
|
}
|
|
8788
8793
|
const buildFromDataUnit = (dataUnit) => {
|
|
8789
8794
|
var _a;
|
|
@@ -8797,6 +8802,9 @@ const buildFromDataUnit = (dataUnit) => {
|
|
|
8797
8802
|
items: visibleFields.map(descriptor => { return { descriptor }; }),
|
|
8798
8803
|
requiredFields: visibleFields
|
|
8799
8804
|
.filter(descriptor => descriptor.required)
|
|
8805
|
+
.map(descriptor => descriptor.name),
|
|
8806
|
+
cleanOnCopyFields: visibleFields
|
|
8807
|
+
.filter(descriptor => { var _a; return (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy; })
|
|
8800
8808
|
.map(descriptor => descriptor.name)
|
|
8801
8809
|
});
|
|
8802
8810
|
}
|
|
@@ -8805,7 +8813,9 @@ const buildFromDataUnit = (dataUnit) => {
|
|
|
8805
8813
|
const buildFromConfig = (fields, dataUnit) => {
|
|
8806
8814
|
const sheets = new Map();
|
|
8807
8815
|
const requiredFields = [];
|
|
8816
|
+
const cleanOnCopyFields = [];
|
|
8808
8817
|
fields.forEach(config => {
|
|
8818
|
+
var _a;
|
|
8809
8819
|
if (config.visible !== false) {
|
|
8810
8820
|
const tab = config.tab || "Geral";
|
|
8811
8821
|
const descriptor = dataUnit.getField(config.name);
|
|
@@ -8817,6 +8827,10 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
8817
8827
|
if (isRequired) {
|
|
8818
8828
|
requiredFields.push(config.name);
|
|
8819
8829
|
}
|
|
8830
|
+
const clearOnCopy = config.cleanOnCopy === undefined ? (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy : config.cleanOnCopy;
|
|
8831
|
+
if (clearOnCopy) {
|
|
8832
|
+
cleanOnCopyFields.push(config.name);
|
|
8833
|
+
}
|
|
8820
8834
|
const tabItens = sheets.get(tab);
|
|
8821
8835
|
const fieldMD = { config, descriptor };
|
|
8822
8836
|
const group = config.group;
|
|
@@ -8841,7 +8855,8 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
8841
8855
|
label: key,
|
|
8842
8856
|
name: key,
|
|
8843
8857
|
items: Array.from(value.values()),
|
|
8844
|
-
requiredFields
|
|
8858
|
+
requiredFields,
|
|
8859
|
+
cleanOnCopyFields
|
|
8845
8860
|
});
|
|
8846
8861
|
});
|
|
8847
8862
|
return metadata;
|
|
@@ -9368,10 +9383,26 @@ let EzForm$1 = class extends HTMLElement$1 {
|
|
|
9368
9383
|
var _a;
|
|
9369
9384
|
return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
9370
9385
|
}
|
|
9386
|
+
interceptAction(action) {
|
|
9387
|
+
if (action.type === Action.RECORDS_COPIED) {
|
|
9388
|
+
const metadata = selectFormMetadata(this._store.getState());
|
|
9389
|
+
const cleanFields = metadata.getCleanOnCopyFields();
|
|
9390
|
+
if (cleanFields) {
|
|
9391
|
+
const records = action.payload;
|
|
9392
|
+
return new DataUnitAction(Action.RECORDS_COPIED, records.map(record => {
|
|
9393
|
+
const newRecord = Object.assign({}, record);
|
|
9394
|
+
cleanFields.forEach(fieldName => delete newRecord[fieldName]);
|
|
9395
|
+
return newRecord;
|
|
9396
|
+
}));
|
|
9397
|
+
}
|
|
9398
|
+
}
|
|
9399
|
+
return action;
|
|
9400
|
+
}
|
|
9371
9401
|
componentWillLoad() {
|
|
9372
9402
|
if (this.dataUnit === undefined) {
|
|
9373
9403
|
this.dataUnit = new DataUnit("ez-form");
|
|
9374
9404
|
}
|
|
9405
|
+
this.dataUnit.addInterceptor(this);
|
|
9375
9406
|
this.dataUnit.subscribe(action => {
|
|
9376
9407
|
if (action.type === Action.METADATA_LOADED) {
|
|
9377
9408
|
this.processMetadata();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, c as createEvent, H as Host, g as getElement } from './index-d80a8d1f.js';
|
|
2
|
-
import { c as createCommonjsModule, a as commonjsGlobal, A as Action, M as MaskFormatter, D as DataUnit, b as DataType, U as UserInterface } from './index-
|
|
2
|
+
import { c as createCommonjsModule, a as commonjsGlobal, A as Action, M as MaskFormatter, D as DataUnit, b as DataType, U as UserInterface } from './index-4fb1605f.js';
|
|
3
3
|
import { g as getSpritePath } from './AssetsUtils-9b1d9c38.js';
|
|
4
4
|
|
|
5
5
|
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{padding:0px}button.small{width:32px;min-width:32px;height:32px}button.medium{width:42px;min-width:42px;height:42px}button.large{width:52px;min-width:52px;height:52px}.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;}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h } from './index-d80a8d1f.js';
|
|
2
|
-
import './index-
|
|
2
|
+
import './index-4fb1605f.js';
|
|
3
3
|
import { F as FloatingManager } from './FloatingManager-bb90ef41.js';
|
|
4
4
|
|
|
5
5
|
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);--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:2px;--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 var(--space--small, 12px);--ez-calendar__cell--width:var(--space--large, 24px);--ez-calendar__cell--padding:var(--space--extra-small, 3px) 0px;--ez-calendar__cell--border-radius:var(--border--radius-small, 6px);--ez-calendar__cell--over--background-color:var(--color--strokes, #E2F4EF);--ez-calendar__cell--outset--color:var(--color--strokes, #C0C0C0);--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--strokes, #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--medium, 12px);margin: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--large, 600);font-size:var(--title--medium, 16px);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--small, 12px);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)}.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__body{padding:var(--space--small, 6px) 0px}.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--small);padding:var(--space--extra-small, 6px);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 6px;padding-left:16px;padding-bottom:0px;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:180px;padding:0px;margin:0px;overflow:auto}.calendar__column::-webkit-scrollbar{width:0px;max-width:0px;min-width:0px}.calendarTime__header{padding-left:6px;padding-right:6px;display:flex;justify-content:space-between;padding-bottom:var(--space--medium, 12px);margin:var(--space--small, 6px) var(--space--, 12px);font-weight:var(--text-weight--large, 600);font-size:var(--title--medium, 16px);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}.endHidden{-webkit-mask-image:linear-gradient(180deg, #000 calc(100% - 48px), transparent 100%)}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement, f as forceUpdate } from './index-d80a8d1f.js';
|
|
2
|
-
import { T as TimeFormatter, N as NumberUtils } from './index-
|
|
2
|
+
import { T as TimeFormatter, N as NumberUtils } from './index-4fb1605f.js';
|
|
3
3
|
import { C as CSSVarsUtils } from './CSSVarsUtils-aeee9825.js';
|
|
4
4
|
import { A as ApplicationUtils } from './ApplicationUtils-01280a9d.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-d80a8d1f.js';
|
|
2
|
-
import './index-
|
|
2
|
+
import './index-4fb1605f.js';
|
|
3
3
|
import { F as FloatingManager } from './FloatingManager-bb90ef41.js';
|
|
4
4
|
import { C as CSSVarsUtils } from './CSSVarsUtils-aeee9825.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, r as registerInstance, f as forceUpdate, H as Host, g as getElement } from './index-d80a8d1f.js';
|
|
2
|
-
import { U as UserInterface,
|
|
2
|
+
import { U as UserInterface, A as Action, d as DataUnitAction, D as DataUnit } from './index-4fb1605f.js';
|
|
3
3
|
import { A as ApplicationUtils } from './ApplicationUtils-01280a9d.js';
|
|
4
4
|
|
|
5
5
|
const buildTextArea = ({ name, label }) => {
|
|
@@ -125,6 +125,7 @@ class FormMetadata {
|
|
|
125
125
|
constructor() {
|
|
126
126
|
this._sheets = new Map();
|
|
127
127
|
this._requiredFields = [];
|
|
128
|
+
this._cleanOnCopyFields = [];
|
|
128
129
|
}
|
|
129
130
|
getSheet(name) {
|
|
130
131
|
return this._sheets.get(name);
|
|
@@ -135,10 +136,14 @@ class FormMetadata {
|
|
|
135
136
|
addSheet(sheet) {
|
|
136
137
|
this._sheets.set(sheet.name, sheet);
|
|
137
138
|
this._requiredFields = this._requiredFields.concat(sheet.requiredFields);
|
|
139
|
+
this._cleanOnCopyFields = this._cleanOnCopyFields.concat(sheet.cleanOnCopyFields);
|
|
138
140
|
}
|
|
139
141
|
getRequiredFields() {
|
|
140
142
|
return this._requiredFields;
|
|
141
143
|
}
|
|
144
|
+
getCleanOnCopyFields() {
|
|
145
|
+
return this._cleanOnCopyFields;
|
|
146
|
+
}
|
|
142
147
|
}
|
|
143
148
|
const buildFromDataUnit = (dataUnit) => {
|
|
144
149
|
var _a;
|
|
@@ -152,6 +157,9 @@ const buildFromDataUnit = (dataUnit) => {
|
|
|
152
157
|
items: visibleFields.map(descriptor => { return { descriptor }; }),
|
|
153
158
|
requiredFields: visibleFields
|
|
154
159
|
.filter(descriptor => descriptor.required)
|
|
160
|
+
.map(descriptor => descriptor.name),
|
|
161
|
+
cleanOnCopyFields: visibleFields
|
|
162
|
+
.filter(descriptor => { var _a; return (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy; })
|
|
155
163
|
.map(descriptor => descriptor.name)
|
|
156
164
|
});
|
|
157
165
|
}
|
|
@@ -160,7 +168,9 @@ const buildFromDataUnit = (dataUnit) => {
|
|
|
160
168
|
const buildFromConfig = (fields, dataUnit) => {
|
|
161
169
|
const sheets = new Map();
|
|
162
170
|
const requiredFields = [];
|
|
171
|
+
const cleanOnCopyFields = [];
|
|
163
172
|
fields.forEach(config => {
|
|
173
|
+
var _a;
|
|
164
174
|
if (config.visible !== false) {
|
|
165
175
|
const tab = config.tab || "Geral";
|
|
166
176
|
const descriptor = dataUnit.getField(config.name);
|
|
@@ -172,6 +182,10 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
172
182
|
if (isRequired) {
|
|
173
183
|
requiredFields.push(config.name);
|
|
174
184
|
}
|
|
185
|
+
const clearOnCopy = config.cleanOnCopy === undefined ? (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy : config.cleanOnCopy;
|
|
186
|
+
if (clearOnCopy) {
|
|
187
|
+
cleanOnCopyFields.push(config.name);
|
|
188
|
+
}
|
|
175
189
|
const tabItens = sheets.get(tab);
|
|
176
190
|
const fieldMD = { config, descriptor };
|
|
177
191
|
const group = config.group;
|
|
@@ -196,7 +210,8 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
196
210
|
label: key,
|
|
197
211
|
name: key,
|
|
198
212
|
items: Array.from(value.values()),
|
|
199
|
-
requiredFields
|
|
213
|
+
requiredFields,
|
|
214
|
+
cleanOnCopyFields
|
|
200
215
|
});
|
|
201
216
|
});
|
|
202
217
|
return metadata;
|
|
@@ -690,10 +705,26 @@ let EzForm = class {
|
|
|
690
705
|
var _a;
|
|
691
706
|
return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
692
707
|
}
|
|
708
|
+
interceptAction(action) {
|
|
709
|
+
if (action.type === Action.RECORDS_COPIED) {
|
|
710
|
+
const metadata = selectFormMetadata(this._store.getState());
|
|
711
|
+
const cleanFields = metadata.getCleanOnCopyFields();
|
|
712
|
+
if (cleanFields) {
|
|
713
|
+
const records = action.payload;
|
|
714
|
+
return new DataUnitAction(Action.RECORDS_COPIED, records.map(record => {
|
|
715
|
+
const newRecord = Object.assign({}, record);
|
|
716
|
+
cleanFields.forEach(fieldName => delete newRecord[fieldName]);
|
|
717
|
+
return newRecord;
|
|
718
|
+
}));
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
return action;
|
|
722
|
+
}
|
|
693
723
|
componentWillLoad() {
|
|
694
724
|
if (this.dataUnit === undefined) {
|
|
695
725
|
this.dataUnit = new DataUnit("ez-form");
|
|
696
726
|
}
|
|
727
|
+
this.dataUnit.addInterceptor(this);
|
|
697
728
|
this.dataUnit.subscribe(action => {
|
|
698
729
|
if (action.type === Action.METADATA_LOADED) {
|
|
699
730
|
this.processMetadata();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-d80a8d1f.js';
|
|
2
|
-
import './index-
|
|
2
|
+
import './index-4fb1605f.js';
|
|
3
3
|
import { F as FloatingManager } from './FloatingManager-bb90ef41.js';
|
|
4
4
|
|
|
5
5
|
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%}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-d80a8d1f.js';
|
|
2
|
-
import { M as MaskFormatter, T as TimeFormatter, N as NumberUtils } from './index-
|
|
2
|
+
import { M as MaskFormatter, T as TimeFormatter, N as NumberUtils } from './index-4fb1605f.js';
|
|
3
3
|
import { C as CSSVarsUtils } from './CSSVarsUtils-aeee9825.js';
|
|
4
4
|
import { g as getSpritePath } from './AssetsUtils-9b1d9c38.js';
|
|
5
5
|
|
|
@@ -7449,4 +7449,4 @@ function HeadersInstanceToPlainObject(headers) {
|
|
|
7449
7449
|
//# sourceMappingURL=index.js.map
|
|
7450
7450
|
});
|
|
7451
7451
|
|
|
7452
|
-
export { Action as A, DataUnit as D, MaskFormatter as M, NumberUtils as N, TimeFormatter as T, UserInterface as U, commonjsGlobal as a, DataType as b, createCommonjsModule as c };
|
|
7452
|
+
export { Action as A, DataUnit as D, MaskFormatter as M, NumberUtils as N, TimeFormatter as T, UserInterface as U, commonjsGlobal as a, DataType as b, createCommonjsModule as c, DataUnitAction as d };
|
package/dist/ezui/ezui.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as
|
|
1
|
+
import{p as e,b as s}from"./p-7c101b34.js";(()=>{const s=import.meta.url,a={};return""!==s&&(a.resourcesUrl=new URL(".",s).href),e(a)})().then((e=>s([["p-4e08b842",[[0,"ez-form",{dataUnit:[1040],config:[16],submit:[64],cancel:[64],validate:[64]}]]],["p-091b27f2",[[1,"ez-dialog",{confirm:[1028],critical:[1028],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],handleButtonClick:[64],show:[64]}]]],["p-eefc1f9d",[[1,"ez-time-input",{label:[513],viewValue:[1537,"view-value"],value:[1026],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],setFocus:[64],setBlur:[64]}]]],["p-6206515e",[[1,"ez-action-chip",{label:[513],enabled:[516]}]]],["p-39218c31",[[0,"ez-application"]]],["p-19d8a928",[[1,"ez-label-chip",{label:[513],enabled:[516],removable:[516],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-826b6c4d",[[1,"ez-popover",{autoClose:[516,"auto-close"],top:[1537],left:[1537],bottom:[1537],right:[1537],boxWidth:[513,"box-width"],opened:[1540],updatePosition:[64],show:[64],hide:[64]}]]],["p-a52b3368",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[1540,"use-header"],ezTitle:[1,"ez-title"]}]]],["p-b678dc80",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],show:[64]}]]],["p-535771b6",[[1,"ez-calendar",{value:[1040],floating:[516],time:[516],showSeconds:[516,"show-seconds"],show:[64],fitVertical:[64],hide:[64]}]]],["p-b796d351",[[0,"test-du"],[2,"ez-grid",{multipleSelection:[4,"multiple-selection"],pageSize:[2,"page-size"],serverUrl:[1,"server-url"],dataUnit:[16],_navigationHasPrevious:[32],_navigationHasNext:[32],_navigationFirstRow:[32],_navigationLastRow:[32],_navigationTotalRows:[32],_popUpVisible:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64]}],[2,"grid-config",{selectedTab:[1025,"selected-tab"],columns:[1040]}],[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}],[1,"ez-list",{dataSource:[1040],useGroups:[1540,"use-groups"],ezDraggable:[1028,"ez-draggable"],ezSelectable:[1028,"ez-selectable"],itemSlotBuilder:[1040],_listItems:[32],_listGroupItems:[32],setSelection:[64],getSelection:[64],getList:[64]}],[1,"select-box",{selectedOption:[1,"selected-option"]}],[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],size:[513]}],[1,"ez-check",{label:[513],value:[1540],enabled:[516],mode:[513],getMode:[64],setFocus:[64]}],[1,"ez-tabselector",{selectedIndex:[1537,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1]}],[1,"ez-icon",{size:[513],href:[513]}],[1,"ez-text-input",{label:[513],value:[1537],enabled:[516],loading:[516],errorMessage:[1537,"error-message"],mask:[1],restrict:[1],setFocus:[64],setBlur:[64]}]]],["p-3e79877f",[[1,"ez-combo-box",{value:[1537],label:[513],enabled:[516],options:[1040],errorMessage:[1537,"error-message"],searchMode:[4,"search-mode"],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],optionLoader:[16],_preSelection:[32],_visibleOptions:[32]}]]],["p-27a35580",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"]}],[1,"ez-date-time-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"]}],[1,"ez-search",{value:[1537],label:[1537],enabled:[1540],errorMessage:[1537,"error-message"],optionLoader:[16],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"]}],[1,"ez-number-input",{label:[1],value:[1538],enabled:[4],errorMessage:[1537,"error-message"],precision:[2],prettyPrecision:[2,"pretty-precision"]}],[1,"ez-collapsible-box",{value:[1540],label:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],showHide:[64]}],[1,"ez-text-area",{label:[513],value:[1537],enabled:[516],loading:[516],errorMessage:[1537,"error-message"],rows:[1538],setFocus:[64],setBlur:[64]}],[1,"ez-upload",{label:[1],enabled:[4],maxFileSize:[2,"max-file-size"],maxFiles:[2,"max-files"],requestHeaders:[8,"request-headers"],urlUpload:[1,"url-upload"],urlDelete:[1,"url-delete"],value:[1040],addFiles:[64]}]]]],e)));
|