@sankhyalabs/ezui 1.2.0-beta.21 → 1.2.0-beta.22
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/CheckMode-ecb90b87.js +7 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +10 -8
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -2
- package/dist/cjs/ez-combo-box.cjs.entry.js +9 -2
- package/dist/cjs/ez-form.cjs.entry.js +116 -3
- package/dist/cjs/ez-text-edit.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/ez-check/CheckMode.js +5 -0
- package/dist/collection/components/ez-check/ez-check.css +23 -23
- package/dist/collection/components/ez-check/ez-check.js +10 -8
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +8 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +2 -1
- package/dist/collection/utils/index.js +1 -1
- package/dist/custom-elements/index.js +137 -123
- package/dist/esm/CheckMode-bdb2ec19.js +7 -0
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +10 -8
- package/dist/esm/ez-collapsible-box.entry.js +1 -2
- package/dist/esm/ez-combo-box.entry.js +9 -2
- package/dist/esm/ez-form.entry.js +115 -2
- package/dist/esm/ez-text-edit.entry.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-dd257f17.entry.js → p-5bdb1a41.entry.js} +1 -1
- package/dist/ezui/p-659616e4.entry.js +1 -0
- package/dist/ezui/{p-6befd7e4.entry.js → p-77ec47ac.entry.js} +1 -1
- package/dist/ezui/p-ac1c0236.entry.js +1 -0
- package/dist/ezui/p-b853763b.js +1 -0
- package/dist/ezui/p-bd0c4789.entry.js +1 -0
- package/dist/ezui/p-e6971baf.entry.js +1 -0
- package/dist/types/components/ez-check/CheckMode.d.ts +4 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/FieldBuilder-cd3e45ed.js +0 -119
- package/dist/esm/FieldBuilder-9e9545fc.js +0 -117
- package/dist/ezui/p-4ad647fc.entry.js +0 -1
- package/dist/ezui/p-54ecd19a.js +0 -1
- package/dist/ezui/p-712bd293.entry.js +0 -1
- package/dist/ezui/p-d91527dc.entry.js +0 -1
- package/dist/ezui/p-e59adce6.entry.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HTMLElement as HTMLElement$1, createEvent, h, Host, forceUpdate, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
2
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
3
|
-
import {
|
|
3
|
+
import { FloatingManager, DateUtils as DateUtils$1, TimeFormatter, UserInterface, Action, WaitingChangeException, ApplicationContext, DataUnitAction, DataUnit, ObjectUtils as ObjectUtils$1, StringUtils as StringUtils$1, NumberUtils as NumberUtils$1, DataType, SortMode, MaskFormatter } from '@sankhyalabs/core';
|
|
4
4
|
|
|
5
5
|
var DialogType;
|
|
6
6
|
(function (DialogType) {
|
|
@@ -139,118 +139,11 @@ class CSSVarsUtils {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const buildTextInput = ({ name, label, readOnly }) => {
|
|
148
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
149
|
-
h("ez-text-input", { label: label, "data-field-name": name, key: name, enabled: !readOnly })));
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
const buildSwitch = (fieldConfig) => {
|
|
153
|
-
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
|
|
154
|
-
};
|
|
155
|
-
const buildCheckBox = (fieldConfig) => {
|
|
156
|
-
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, false);
|
|
157
|
-
};
|
|
158
|
-
function buildField$1(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
159
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
|
|
160
|
-
h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? "switch" : "regular", "data-field-name": fieldName, key: fieldName })));
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
const buildComboBox = ({ name, label, readOnly, required }, properties) => {
|
|
164
|
-
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
165
|
-
let options;
|
|
166
|
-
if (typeof prop === "string") {
|
|
167
|
-
const parsed = JSON.parse(prop);
|
|
168
|
-
options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
options = prop;
|
|
172
|
-
}
|
|
173
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
174
|
-
h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
const buildSearch = ({ name, label, readOnly, required }) => {
|
|
178
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
179
|
-
h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
const buildFile = ({ name, label, readOnly }) => {
|
|
183
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
184
|
-
h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
const buildDate = ({ name, label, readOnly }) => {
|
|
188
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
189
|
-
h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
190
|
-
};
|
|
191
|
-
const buildTime = ({ name, label }) => {
|
|
192
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
193
|
-
h("ez-time-input", { label: label, "data-field-name": name, key: name })));
|
|
194
|
-
};
|
|
195
|
-
const buildTimeDate = ({ name, label }) => {
|
|
196
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
197
|
-
h("ez-date-time-input", { label: label, "data-field-name": name, key: name })));
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
const buildDecimal = ({ name, label, readOnly }, properties) => {
|
|
201
|
-
const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
|
|
202
|
-
const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
|
|
203
|
-
return buildNumeric(name, label, readOnly, precision, prettyPrecision);
|
|
204
|
-
};
|
|
205
|
-
const buildInteger = ({ name, label, readOnly }) => {
|
|
206
|
-
return buildNumeric(name, label, readOnly, 0, 0);
|
|
207
|
-
};
|
|
208
|
-
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
|
|
209
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
210
|
-
h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
const uiBuilders = new Map();
|
|
214
|
-
uiBuilders.set(UserInterface.LONGTEXT, buildTextArea);
|
|
215
|
-
uiBuilders.set(UserInterface.CHECKBOX, buildCheckBox);
|
|
216
|
-
uiBuilders.set(UserInterface.SWITCH, buildSwitch);
|
|
217
|
-
uiBuilders.set(UserInterface.OPTIONSELECTOR, buildComboBox);
|
|
218
|
-
uiBuilders.set(UserInterface.SEARCH, buildSearch);
|
|
219
|
-
uiBuilders.set(UserInterface.FILE, buildFile);
|
|
220
|
-
uiBuilders.set(UserInterface.DATE, buildDate);
|
|
221
|
-
uiBuilders.set(UserInterface.TIME, buildTime);
|
|
222
|
-
uiBuilders.set(UserInterface.DATETIME, buildTimeDate);
|
|
223
|
-
uiBuilders.set(UserInterface.DECIMALNUMBER, buildDecimal);
|
|
224
|
-
uiBuilders.set(UserInterface.INTEGERNUMBER, buildInteger);
|
|
225
|
-
const buildField = (field) => {
|
|
226
|
-
const descriptor = field.descriptor;
|
|
227
|
-
const config = Object.assign({}, field.config);
|
|
228
|
-
let builder;
|
|
229
|
-
let props;
|
|
230
|
-
if (descriptor) {
|
|
231
|
-
if (!config.label) {
|
|
232
|
-
config.label = descriptor.label;
|
|
233
|
-
}
|
|
234
|
-
if (!config.name) {
|
|
235
|
-
config.name = descriptor.name;
|
|
236
|
-
}
|
|
237
|
-
if (config.required === undefined) {
|
|
238
|
-
config.required = descriptor.required;
|
|
239
|
-
}
|
|
240
|
-
if (config.readOnly === undefined) {
|
|
241
|
-
config.readOnly = descriptor.readOnly;
|
|
242
|
-
}
|
|
243
|
-
props = descriptor.properties;
|
|
244
|
-
builder = uiBuilders.get(descriptor.userInterface);
|
|
245
|
-
}
|
|
246
|
-
if (config.required) {
|
|
247
|
-
config.label = `${config.label} (obrigatório) *`;
|
|
248
|
-
}
|
|
249
|
-
if (!builder) {
|
|
250
|
-
builder = buildTextInput;
|
|
251
|
-
}
|
|
252
|
-
return builder(config, props);
|
|
253
|
-
};
|
|
142
|
+
var CheckMode;
|
|
143
|
+
(function (CheckMode) {
|
|
144
|
+
CheckMode["REGULAR"] = "REGULAR";
|
|
145
|
+
CheckMode["SWITCH"] = "SWITCH";
|
|
146
|
+
})(CheckMode || (CheckMode = {}));
|
|
254
147
|
|
|
255
148
|
const ezActionsButtonCss = ":host{--ez-actions-button__actions-list--border-radius:var(--border--radius-medium, 12px);--ez-actions-button__actions-list--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-actions-button__actions-list--background-color:var(--background--xlight, #fff);--ez-actions-button__actions-list--padding:var(--space-small, 6px);--ez-actions-button__actions-list--top-margin:var(--space-extra-small, 3px);--ez-actions-button__btn-action--min-width:400px;--ez-actions-button__btn-action--background-color:var(--background--xlight, #fff);display:flex;flex-direction:column;height:fit-content;user-select:none}.ez-actions-button__actions-list{display:flex;flex-direction:column;position:fixed;width:fit-content;height:fit-content;z-index:var(--more-visible, 2);padding:var(--ez-actions-button__actions-list--padding);margin-top:var(--ez-actions-button__actions-list--top-margin);background-color:var(--ez-actions-button__actions-list--background-color);border-radius:var(--ez-actions-button__actions-list--border-radius);box-shadow:var(--ez-actions-button__actions-list--box-shadow)}.ez-actions-button__btn-action{--ez-button--min-width:var(--ez-actions-button__btn-action--min-width);--ez-button--background-color:var(--ez-actions-button__btn-action--background-color)}.ez-actions-button__icon-left{margin-left:var(--space-small, 6px)}.ez-actions-button__icon-right{margin-right:var(--space-small, 6px)}.ez-actions-button__btn-transparent{--ez-button--background-color:transparent;--ez-button--hover--background-color:transparent;--ez-button--active--background-color:transparent;--ez-button--focus--border:none}.ez-actions-button__arrow{position:absolute;top:-13px;left:10px;border-left:10px solid transparent;border-right:10px solid transparent;border-bottom:15px solid var(--ez-actions-button__btn-action--background-color);width:0;height:0}";
|
|
256
149
|
|
|
@@ -745,7 +638,7 @@ let EzCardItem$1 = class extends HTMLElement$1 {
|
|
|
745
638
|
static get style() { return ezCardItemCss; }
|
|
746
639
|
};
|
|
747
640
|
|
|
748
|
-
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:19px;--ez-switch--pin--height:19px;--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--disabled--checked--background-color:var(--color--primary-300);--ez-switch--checked--background-color:var(--color--primary);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-primary);--ez-switch--pin--checked--background-color:var(--background--xlight);--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-switch--pin--border-color:var(--text--primary);--ez-switch--pin--disabled--border-color:var(--text--secondary);--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.
|
|
641
|
+
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:19px;--ez-switch--pin--height:19px;--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--disabled--checked--background-color:var(--color--primary-300);--ez-switch--checked--background-color:var(--color--primary);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-primary);--ez-switch--pin--checked--background-color:var(--background--xlight);--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-switch--pin--border-color:var(--text--primary);--ez-switch--pin--disabled--border-color:var(--text--secondary);--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.regular-mode{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.regular-mode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regular-mode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regular-mode:disabled{cursor:auto;background:none}input.regular-mode::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.regular-mode:disabled::before{border:var(--ez-check--disabled--border)}input.regular-mode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regular-mode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regular-mode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regular-mode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regular-mode: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.regular-mode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switch-mode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);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.switch-mode:disabled{background-color:var(--ez-switch--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switch-mode:checked:disabled{background-color:var(--ez-switch--disabled--checked--background-color)}input.switch-mode::after{content:\"\";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(-2px) translateY(-4px);border-radius:50%;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switch-mode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switch-mode: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.switch-mode::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) - 2px) / 2);background-color:var(--ez-switch--pin--focus--background-color)}input.switch-mode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switch-mode: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) + 2px))}input.switch-mode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-4px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switch-mode: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)}";
|
|
749
642
|
|
|
750
643
|
let EzCheck$1 = class extends HTMLElement$1 {
|
|
751
644
|
constructor() {
|
|
@@ -763,16 +656,17 @@ let EzCheck$1 = class extends HTMLElement$1 {
|
|
|
763
656
|
* No modo "regular" a visualização é a tradicional de uma caixinha marcada/desmarcada.
|
|
764
657
|
* No modo "switch" o campo tem uma interface em formato de um pino liga/desliga.
|
|
765
658
|
*/
|
|
766
|
-
this.mode =
|
|
659
|
+
this.mode = CheckMode.REGULAR;
|
|
767
660
|
}
|
|
768
661
|
observeMode() {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
this._inputElem.classList.
|
|
662
|
+
var _a;
|
|
663
|
+
if (((_a = this.mode) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === CheckMode.SWITCH) {
|
|
664
|
+
this._inputElem.classList.remove("regular-mode");
|
|
665
|
+
this._inputElem.classList.add("switch-mode");
|
|
772
666
|
}
|
|
773
667
|
else {
|
|
774
|
-
this._inputElem.classList.remove("
|
|
775
|
-
this._inputElem.classList.add("
|
|
668
|
+
this._inputElem.classList.remove("switch-mode");
|
|
669
|
+
this._inputElem.classList.add("regular-mode");
|
|
776
670
|
}
|
|
777
671
|
}
|
|
778
672
|
//---------------------------------------------
|
|
@@ -808,7 +702,7 @@ let EzCheck$1 = class extends HTMLElement$1 {
|
|
|
808
702
|
return classes;
|
|
809
703
|
}
|
|
810
704
|
render() {
|
|
811
|
-
return (h(Host, null, h("input", { type: "checkbox", class: "
|
|
705
|
+
return (h(Host, null, h("input", { type: "checkbox", class: "regular-mode", checked: this.value === true, onChange: () => { this.changeValue(); }, disabled: !this.enabled, ref: (el) => this._inputElem = el }), this.label ? h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) : undefined));
|
|
812
706
|
}
|
|
813
707
|
static get watchers() { return {
|
|
814
708
|
"mode": ["observeMode"]
|
|
@@ -1141,7 +1035,14 @@ let EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
1141
1035
|
if (currentValue) {
|
|
1142
1036
|
text = this.showSelectedValue ? `${currentValue.value} - ${currentValue.label}` : currentValue.label;
|
|
1143
1037
|
}
|
|
1144
|
-
|
|
1038
|
+
if (text == undefined) {
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1041
|
+
return String(text)
|
|
1042
|
+
.replace(/&/g, '&')
|
|
1043
|
+
.replace(/</g, '<')
|
|
1044
|
+
.replace(/>/g, '>')
|
|
1045
|
+
.replace(/"/g, '"');
|
|
1145
1046
|
}
|
|
1146
1047
|
getSelectedOption(value) {
|
|
1147
1048
|
if (typeof value === "string" || value instanceof String) {
|
|
@@ -2071,6 +1972,119 @@ let EzFilterInput$1 = class extends HTMLElement$1 {
|
|
|
2071
1972
|
static get style() { return ezFilterInputCss; }
|
|
2072
1973
|
};
|
|
2073
1974
|
|
|
1975
|
+
const buildTextArea = ({ name, label, readOnly }) => {
|
|
1976
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small", key: name },
|
|
1977
|
+
h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
|
|
1978
|
+
};
|
|
1979
|
+
|
|
1980
|
+
const buildTextInput = ({ name, label, readOnly }) => {
|
|
1981
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
1982
|
+
h("ez-text-input", { label: label, "data-field-name": name, key: name, enabled: !readOnly })));
|
|
1983
|
+
};
|
|
1984
|
+
|
|
1985
|
+
const buildSwitch = (fieldConfig) => {
|
|
1986
|
+
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
|
|
1987
|
+
};
|
|
1988
|
+
const buildCheckBox = (fieldConfig) => {
|
|
1989
|
+
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, false);
|
|
1990
|
+
};
|
|
1991
|
+
function buildField$1(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
1992
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
|
|
1993
|
+
h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, key: fieldName })));
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
const buildComboBox = ({ name, label, readOnly, required }, properties) => {
|
|
1997
|
+
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
1998
|
+
let options;
|
|
1999
|
+
if (typeof prop === "string") {
|
|
2000
|
+
const parsed = JSON.parse(prop);
|
|
2001
|
+
options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
|
|
2002
|
+
}
|
|
2003
|
+
else {
|
|
2004
|
+
options = prop;
|
|
2005
|
+
}
|
|
2006
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
2007
|
+
h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
|
|
2008
|
+
};
|
|
2009
|
+
|
|
2010
|
+
const buildSearch = ({ name, label, readOnly, required }) => {
|
|
2011
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
2012
|
+
h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
|
|
2013
|
+
};
|
|
2014
|
+
|
|
2015
|
+
const buildFile = ({ name, label, readOnly }) => {
|
|
2016
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
2017
|
+
h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
2018
|
+
};
|
|
2019
|
+
|
|
2020
|
+
const buildDate = ({ name, label, readOnly }) => {
|
|
2021
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
2022
|
+
h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
2023
|
+
};
|
|
2024
|
+
const buildTime = ({ name, label }) => {
|
|
2025
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
2026
|
+
h("ez-time-input", { label: label, "data-field-name": name, key: name })));
|
|
2027
|
+
};
|
|
2028
|
+
const buildTimeDate = ({ name, label }) => {
|
|
2029
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
2030
|
+
h("ez-date-time-input", { label: label, "data-field-name": name, key: name })));
|
|
2031
|
+
};
|
|
2032
|
+
|
|
2033
|
+
const buildDecimal = ({ name, label, readOnly }, properties) => {
|
|
2034
|
+
const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
|
|
2035
|
+
const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
|
|
2036
|
+
return buildNumeric(name, label, readOnly, precision, prettyPrecision);
|
|
2037
|
+
};
|
|
2038
|
+
const buildInteger = ({ name, label, readOnly }) => {
|
|
2039
|
+
return buildNumeric(name, label, readOnly, 0, 0);
|
|
2040
|
+
};
|
|
2041
|
+
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
|
|
2042
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
2043
|
+
h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
const uiBuilders = new Map();
|
|
2047
|
+
uiBuilders.set(UserInterface.LONGTEXT, buildTextArea);
|
|
2048
|
+
uiBuilders.set(UserInterface.CHECKBOX, buildCheckBox);
|
|
2049
|
+
uiBuilders.set(UserInterface.SWITCH, buildSwitch);
|
|
2050
|
+
uiBuilders.set(UserInterface.OPTIONSELECTOR, buildComboBox);
|
|
2051
|
+
uiBuilders.set(UserInterface.SEARCH, buildSearch);
|
|
2052
|
+
uiBuilders.set(UserInterface.FILE, buildFile);
|
|
2053
|
+
uiBuilders.set(UserInterface.DATE, buildDate);
|
|
2054
|
+
uiBuilders.set(UserInterface.TIME, buildTime);
|
|
2055
|
+
uiBuilders.set(UserInterface.DATETIME, buildTimeDate);
|
|
2056
|
+
uiBuilders.set(UserInterface.DECIMALNUMBER, buildDecimal);
|
|
2057
|
+
uiBuilders.set(UserInterface.INTEGERNUMBER, buildInteger);
|
|
2058
|
+
const buildField = (field) => {
|
|
2059
|
+
const descriptor = field.descriptor;
|
|
2060
|
+
const config = Object.assign({}, field.config);
|
|
2061
|
+
let builder;
|
|
2062
|
+
let props;
|
|
2063
|
+
if (descriptor) {
|
|
2064
|
+
if (!config.label) {
|
|
2065
|
+
config.label = descriptor.label;
|
|
2066
|
+
}
|
|
2067
|
+
if (!config.name) {
|
|
2068
|
+
config.name = descriptor.name;
|
|
2069
|
+
}
|
|
2070
|
+
if (config.required === undefined) {
|
|
2071
|
+
config.required = descriptor.required;
|
|
2072
|
+
}
|
|
2073
|
+
if (config.readOnly === undefined) {
|
|
2074
|
+
config.readOnly = descriptor.readOnly;
|
|
2075
|
+
}
|
|
2076
|
+
props = descriptor.properties;
|
|
2077
|
+
builder = uiBuilders.get(descriptor.userInterface);
|
|
2078
|
+
}
|
|
2079
|
+
if (config.required) {
|
|
2080
|
+
config.label = `${config.label} (obrigatório) *`;
|
|
2081
|
+
}
|
|
2082
|
+
if (!builder) {
|
|
2083
|
+
builder = buildTextInput;
|
|
2084
|
+
}
|
|
2085
|
+
return builder(config, props);
|
|
2086
|
+
};
|
|
2087
|
+
|
|
2074
2088
|
const FormItem = ({ source }) => {
|
|
2075
2089
|
if ("items" in source) {
|
|
2076
2090
|
const fieldSet = source;
|
|
@@ -3,7 +3,7 @@ import { FloatingManager } from '@sankhyalabs/core';
|
|
|
3
3
|
import './ApplicationUtils-205ac4bc.js';
|
|
4
4
|
import { C as CSSVarsUtils } from './CSSVarsUtils-00f67f32.js';
|
|
5
5
|
import './DialogType-4059dc4d.js';
|
|
6
|
-
import './
|
|
6
|
+
import './CheckMode-bdb2ec19.js';
|
|
7
7
|
|
|
8
8
|
const ezActionsButtonCss = ":host{--ez-actions-button__actions-list--border-radius:var(--border--radius-medium, 12px);--ez-actions-button__actions-list--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-actions-button__actions-list--background-color:var(--background--xlight, #fff);--ez-actions-button__actions-list--padding:var(--space-small, 6px);--ez-actions-button__actions-list--top-margin:var(--space-extra-small, 3px);--ez-actions-button__btn-action--min-width:400px;--ez-actions-button__btn-action--background-color:var(--background--xlight, #fff);display:flex;flex-direction:column;height:fit-content;user-select:none}.ez-actions-button__actions-list{display:flex;flex-direction:column;position:fixed;width:fit-content;height:fit-content;z-index:var(--more-visible, 2);padding:var(--ez-actions-button__actions-list--padding);margin-top:var(--ez-actions-button__actions-list--top-margin);background-color:var(--ez-actions-button__actions-list--background-color);border-radius:var(--ez-actions-button__actions-list--border-radius);box-shadow:var(--ez-actions-button__actions-list--box-shadow)}.ez-actions-button__btn-action{--ez-button--min-width:var(--ez-actions-button__btn-action--min-width);--ez-button--background-color:var(--ez-actions-button__btn-action--background-color)}.ez-actions-button__icon-left{margin-left:var(--space-small, 6px)}.ez-actions-button__icon-right{margin-right:var(--space-small, 6px)}.ez-actions-button__btn-transparent{--ez-button--background-color:transparent;--ez-button--hover--background-color:transparent;--ez-button--active--background-color:transparent;--ez-button--focus--border:none}.ez-actions-button__arrow{position:absolute;top:-13px;left:10px;border-left:10px solid transparent;border-right:10px solid transparent;border-bottom:15px solid var(--ez-actions-button__btn-action--background-color);width:0;height:0}";
|
|
9
9
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-7bc778b3.js';
|
|
2
|
+
import { C as CheckMode } from './CheckMode-bdb2ec19.js';
|
|
2
3
|
|
|
3
|
-
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:19px;--ez-switch--pin--height:19px;--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--disabled--checked--background-color:var(--color--primary-300);--ez-switch--checked--background-color:var(--color--primary);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-primary);--ez-switch--pin--checked--background-color:var(--background--xlight);--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-switch--pin--border-color:var(--text--primary);--ez-switch--pin--disabled--border-color:var(--text--secondary);--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.
|
|
4
|
+
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:19px;--ez-switch--pin--height:19px;--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--disabled--checked--background-color:var(--color--primary-300);--ez-switch--checked--background-color:var(--color--primary);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-primary);--ez-switch--pin--checked--background-color:var(--background--xlight);--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-switch--pin--border-color:var(--text--primary);--ez-switch--pin--disabled--border-color:var(--text--secondary);--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.regular-mode{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.regular-mode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regular-mode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regular-mode:disabled{cursor:auto;background:none}input.regular-mode::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.regular-mode:disabled::before{border:var(--ez-check--disabled--border)}input.regular-mode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regular-mode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regular-mode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regular-mode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regular-mode: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.regular-mode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switch-mode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);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.switch-mode:disabled{background-color:var(--ez-switch--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switch-mode:checked:disabled{background-color:var(--ez-switch--disabled--checked--background-color)}input.switch-mode::after{content:\"\";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(-2px) translateY(-4px);border-radius:50%;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switch-mode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switch-mode: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.switch-mode::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) - 2px) / 2);background-color:var(--ez-switch--pin--focus--background-color)}input.switch-mode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switch-mode: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) + 2px))}input.switch-mode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-4px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switch-mode: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)}";
|
|
4
5
|
|
|
5
6
|
let EzCheck = class {
|
|
6
7
|
constructor(hostRef) {
|
|
@@ -16,16 +17,17 @@ let EzCheck = class {
|
|
|
16
17
|
* No modo "regular" a visualização é a tradicional de uma caixinha marcada/desmarcada.
|
|
17
18
|
* No modo "switch" o campo tem uma interface em formato de um pino liga/desliga.
|
|
18
19
|
*/
|
|
19
|
-
this.mode =
|
|
20
|
+
this.mode = CheckMode.REGULAR;
|
|
20
21
|
}
|
|
21
22
|
observeMode() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this._inputElem.classList.
|
|
23
|
+
var _a;
|
|
24
|
+
if (((_a = this.mode) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === CheckMode.SWITCH) {
|
|
25
|
+
this._inputElem.classList.remove("regular-mode");
|
|
26
|
+
this._inputElem.classList.add("switch-mode");
|
|
25
27
|
}
|
|
26
28
|
else {
|
|
27
|
-
this._inputElem.classList.remove("
|
|
28
|
-
this._inputElem.classList.add("
|
|
29
|
+
this._inputElem.classList.remove("switch-mode");
|
|
30
|
+
this._inputElem.classList.add("regular-mode");
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
//---------------------------------------------
|
|
@@ -61,7 +63,7 @@ let EzCheck = class {
|
|
|
61
63
|
return classes;
|
|
62
64
|
}
|
|
63
65
|
render() {
|
|
64
|
-
return (h(Host, null, h("input", { type: "checkbox", class: "
|
|
66
|
+
return (h(Host, null, h("input", { type: "checkbox", class: "regular-mode", checked: this.value === true, onChange: () => { this.changeValue(); }, disabled: !this.enabled, ref: (el) => this._inputElem = el }), this.label ? h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) : undefined));
|
|
65
67
|
}
|
|
66
68
|
static get watchers() { return {
|
|
67
69
|
"mode": ["observeMode"]
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-7bc778b3.js';
|
|
2
2
|
import { A as ApplicationUtils } from './ApplicationUtils-205ac4bc.js';
|
|
3
3
|
import './DialogType-4059dc4d.js';
|
|
4
|
-
import './
|
|
5
|
-
import '@sankhyalabs/core';
|
|
4
|
+
import './CheckMode-bdb2ec19.js';
|
|
6
5
|
|
|
7
6
|
const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{display:flex;white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;gap:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.collapsible-box__label ez-icon{visibility:hidden;transition:0.25s linear}.collapsible-box__label:hover ez-icon{visibility:visible}.collapsible-box__text-edit{margin-left:6px}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--stretched{width:100%;justify-content:space-between}.collapsible-box__title--no-margin{margin-bottom:0}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";
|
|
8
7
|
|
|
@@ -3,7 +3,7 @@ import { FloatingManager } from '@sankhyalabs/core';
|
|
|
3
3
|
import { A as ApplicationUtils } from './ApplicationUtils-205ac4bc.js';
|
|
4
4
|
import { C as CSSVarsUtils } from './CSSVarsUtils-00f67f32.js';
|
|
5
5
|
import './DialogType-4059dc4d.js';
|
|
6
|
-
import './
|
|
6
|
+
import './CheckMode-bdb2ec19.js';
|
|
7
7
|
|
|
8
8
|
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--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #2B3A54);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--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--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__list-scrollbar--background-color-primary:var(--scrollbar--primary, #2B3A54);--ez-combo-box__list-scrollbar--background-color-secondary:var(--scrollbar--secondary, #E5EAF0);--ez-combo-box__list-scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__list-scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small));background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--ez-combo-box__list-scrollbar--background-color-primary) var(--ez-combo-box__list-scrollbar--background-color-secondary)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__list-scrollbar--background-color-secondary);border-radius:var(--ez-combo-box__list-scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__list-scrollbar--background-color-primary);border-radius:var(--ez-combo-box__list-scrollbar--border-radius)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__list-scrollbar--background-color-secondary);width:var(--ez-combo-box__list-scrollbar--width);max-width:var(--ez-combo-box__list-scrollbar--width);min-width:var(--ez-combo-box__list-scrollbar--width)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:0 var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:calc(var(--ez-combo-box__list-height) * 1.5)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:16px;height:16px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
|
|
9
9
|
|
|
@@ -101,7 +101,14 @@ let EzComboBox = class {
|
|
|
101
101
|
if (currentValue) {
|
|
102
102
|
text = this.showSelectedValue ? `${currentValue.value} - ${currentValue.label}` : currentValue.label;
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
if (text == undefined) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
return String(text)
|
|
108
|
+
.replace(/&/g, '&')
|
|
109
|
+
.replace(/</g, '<')
|
|
110
|
+
.replace(/>/g, '>')
|
|
111
|
+
.replace(/"/g, '"');
|
|
105
112
|
}
|
|
106
113
|
getSelectedOption(value) {
|
|
107
114
|
if (typeof value === "string" || value instanceof String) {
|
|
@@ -1,9 +1,122 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, f as forceUpdate, H as Host, g as getElement } from './index-7bc778b3.js';
|
|
2
|
-
import { Action, WaitingChangeException, ApplicationContext, DateUtils, DataUnitAction, DataUnit } from '@sankhyalabs/core';
|
|
3
|
-
import {
|
|
2
|
+
import { UserInterface, Action, WaitingChangeException, ApplicationContext, DateUtils, DataUnitAction, DataUnit } from '@sankhyalabs/core';
|
|
3
|
+
import { C as CheckMode } from './CheckMode-bdb2ec19.js';
|
|
4
4
|
import { A as ApplicationUtils } from './ApplicationUtils-205ac4bc.js';
|
|
5
5
|
import './DialogType-4059dc4d.js';
|
|
6
6
|
|
|
7
|
+
const buildTextArea = ({ name, label, readOnly }) => {
|
|
8
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small", key: name },
|
|
9
|
+
h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const buildTextInput = ({ name, label, readOnly }) => {
|
|
13
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
14
|
+
h("ez-text-input", { label: label, "data-field-name": name, key: name, enabled: !readOnly })));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const buildSwitch = (fieldConfig) => {
|
|
18
|
+
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
|
|
19
|
+
};
|
|
20
|
+
const buildCheckBox = (fieldConfig) => {
|
|
21
|
+
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, false);
|
|
22
|
+
};
|
|
23
|
+
function buildField$1(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
24
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
|
|
25
|
+
h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, key: fieldName })));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const buildComboBox = ({ name, label, readOnly, required }, properties) => {
|
|
29
|
+
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
30
|
+
let options;
|
|
31
|
+
if (typeof prop === "string") {
|
|
32
|
+
const parsed = JSON.parse(prop);
|
|
33
|
+
options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
options = prop;
|
|
37
|
+
}
|
|
38
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
39
|
+
h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const buildSearch = ({ name, label, readOnly, required }) => {
|
|
43
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
44
|
+
h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const buildFile = ({ name, label, readOnly }) => {
|
|
48
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
49
|
+
h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const buildDate = ({ name, label, readOnly }) => {
|
|
53
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
54
|
+
h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
55
|
+
};
|
|
56
|
+
const buildTime = ({ name, label }) => {
|
|
57
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
58
|
+
h("ez-time-input", { label: label, "data-field-name": name, key: name })));
|
|
59
|
+
};
|
|
60
|
+
const buildTimeDate = ({ name, label }) => {
|
|
61
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
62
|
+
h("ez-date-time-input", { label: label, "data-field-name": name, key: name })));
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const buildDecimal = ({ name, label, readOnly }, properties) => {
|
|
66
|
+
const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
|
|
67
|
+
const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
|
|
68
|
+
return buildNumeric(name, label, readOnly, precision, prettyPrecision);
|
|
69
|
+
};
|
|
70
|
+
const buildInteger = ({ name, label, readOnly }) => {
|
|
71
|
+
return buildNumeric(name, label, readOnly, 0, 0);
|
|
72
|
+
};
|
|
73
|
+
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
|
|
74
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
75
|
+
h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const uiBuilders = new Map();
|
|
79
|
+
uiBuilders.set(UserInterface.LONGTEXT, buildTextArea);
|
|
80
|
+
uiBuilders.set(UserInterface.CHECKBOX, buildCheckBox);
|
|
81
|
+
uiBuilders.set(UserInterface.SWITCH, buildSwitch);
|
|
82
|
+
uiBuilders.set(UserInterface.OPTIONSELECTOR, buildComboBox);
|
|
83
|
+
uiBuilders.set(UserInterface.SEARCH, buildSearch);
|
|
84
|
+
uiBuilders.set(UserInterface.FILE, buildFile);
|
|
85
|
+
uiBuilders.set(UserInterface.DATE, buildDate);
|
|
86
|
+
uiBuilders.set(UserInterface.TIME, buildTime);
|
|
87
|
+
uiBuilders.set(UserInterface.DATETIME, buildTimeDate);
|
|
88
|
+
uiBuilders.set(UserInterface.DECIMALNUMBER, buildDecimal);
|
|
89
|
+
uiBuilders.set(UserInterface.INTEGERNUMBER, buildInteger);
|
|
90
|
+
const buildField = (field) => {
|
|
91
|
+
const descriptor = field.descriptor;
|
|
92
|
+
const config = Object.assign({}, field.config);
|
|
93
|
+
let builder;
|
|
94
|
+
let props;
|
|
95
|
+
if (descriptor) {
|
|
96
|
+
if (!config.label) {
|
|
97
|
+
config.label = descriptor.label;
|
|
98
|
+
}
|
|
99
|
+
if (!config.name) {
|
|
100
|
+
config.name = descriptor.name;
|
|
101
|
+
}
|
|
102
|
+
if (config.required === undefined) {
|
|
103
|
+
config.required = descriptor.required;
|
|
104
|
+
}
|
|
105
|
+
if (config.readOnly === undefined) {
|
|
106
|
+
config.readOnly = descriptor.readOnly;
|
|
107
|
+
}
|
|
108
|
+
props = descriptor.properties;
|
|
109
|
+
builder = uiBuilders.get(descriptor.userInterface);
|
|
110
|
+
}
|
|
111
|
+
if (config.required) {
|
|
112
|
+
config.label = `${config.label} (obrigatório) *`;
|
|
113
|
+
}
|
|
114
|
+
if (!builder) {
|
|
115
|
+
builder = buildTextInput;
|
|
116
|
+
}
|
|
117
|
+
return builder(config, props);
|
|
118
|
+
};
|
|
119
|
+
|
|
7
120
|
const FormItem = ({ source }) => {
|
|
8
121
|
if ("items" in source) {
|
|
9
122
|
const fieldSet = source;
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host } from './index-7
|
|
|
2
2
|
import { StringUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { A as ApplicationUtils } from './ApplicationUtils-205ac4bc.js';
|
|
4
4
|
import './DialogType-4059dc4d.js';
|
|
5
|
-
import './
|
|
5
|
+
import './CheckMode-bdb2ec19.js';
|
|
6
6
|
|
|
7
7
|
const ezTextEditCss = ":host{display:flex;align-items:center;gap:5px}.text-edit__form-input{width:auto;--ez-text-input__input--padding:0px}.text-edit__hidden-value{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}";
|
|
8
8
|
|