@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
|
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
|
|
|
7
7
|
require('./ApplicationUtils-edc62c5c.js');
|
|
8
8
|
const CSSVarsUtils = require('./CSSVarsUtils-af809e73.js');
|
|
9
9
|
require('./DialogType-aa435c52.js');
|
|
10
|
-
require('./
|
|
10
|
+
require('./CheckMode-ecb90b87.js');
|
|
11
11
|
|
|
12
12
|
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}";
|
|
13
13
|
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8646c40d.js');
|
|
6
|
+
const CheckMode = require('./CheckMode-ecb90b87.js');
|
|
6
7
|
|
|
7
|
-
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.
|
|
8
|
+
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)}";
|
|
8
9
|
|
|
9
10
|
let EzCheck = class {
|
|
10
11
|
constructor(hostRef) {
|
|
@@ -20,16 +21,17 @@ let EzCheck = class {
|
|
|
20
21
|
* No modo "regular" a visualização é a tradicional de uma caixinha marcada/desmarcada.
|
|
21
22
|
* No modo "switch" o campo tem uma interface em formato de um pino liga/desliga.
|
|
22
23
|
*/
|
|
23
|
-
this.mode =
|
|
24
|
+
this.mode = CheckMode.CheckMode.REGULAR;
|
|
24
25
|
}
|
|
25
26
|
observeMode() {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this._inputElem.classList.
|
|
27
|
+
var _a;
|
|
28
|
+
if (((_a = this.mode) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === CheckMode.CheckMode.SWITCH) {
|
|
29
|
+
this._inputElem.classList.remove("regular-mode");
|
|
30
|
+
this._inputElem.classList.add("switch-mode");
|
|
29
31
|
}
|
|
30
32
|
else {
|
|
31
|
-
this._inputElem.classList.remove("
|
|
32
|
-
this._inputElem.classList.add("
|
|
33
|
+
this._inputElem.classList.remove("switch-mode");
|
|
34
|
+
this._inputElem.classList.add("regular-mode");
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
//---------------------------------------------
|
|
@@ -65,7 +67,7 @@ let EzCheck = class {
|
|
|
65
67
|
return classes;
|
|
66
68
|
}
|
|
67
69
|
render() {
|
|
68
|
-
return (index.h(index.Host, null, index.h("input", { type: "checkbox", class: "
|
|
70
|
+
return (index.h(index.Host, null, index.h("input", { type: "checkbox", class: "regular-mode", checked: this.value === true, onChange: () => { this.changeValue(); }, disabled: !this.enabled, ref: (el) => this._inputElem = el }), this.label ? index.h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) : undefined));
|
|
69
71
|
}
|
|
70
72
|
static get watchers() { return {
|
|
71
73
|
"mode": ["observeMode"]
|
|
@@ -5,8 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-8646c40d.js');
|
|
6
6
|
const ApplicationUtils = require('./ApplicationUtils-edc62c5c.js');
|
|
7
7
|
require('./DialogType-aa435c52.js');
|
|
8
|
-
require('./
|
|
9
|
-
require('@sankhyalabs/core');
|
|
8
|
+
require('./CheckMode-ecb90b87.js');
|
|
10
9
|
|
|
11
10
|
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}";
|
|
12
11
|
|
|
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
|
|
|
7
7
|
const ApplicationUtils = require('./ApplicationUtils-edc62c5c.js');
|
|
8
8
|
const CSSVarsUtils = require('./CSSVarsUtils-af809e73.js');
|
|
9
9
|
require('./DialogType-aa435c52.js');
|
|
10
|
-
require('./
|
|
10
|
+
require('./CheckMode-ecb90b87.js');
|
|
11
11
|
|
|
12
12
|
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)}}";
|
|
13
13
|
|
|
@@ -105,7 +105,14 @@ let EzComboBox = class {
|
|
|
105
105
|
if (currentValue) {
|
|
106
106
|
text = this.showSelectedValue ? `${currentValue.value} - ${currentValue.label}` : currentValue.label;
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
if (text == undefined) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
return String(text)
|
|
112
|
+
.replace(/&/g, '&')
|
|
113
|
+
.replace(/</g, '<')
|
|
114
|
+
.replace(/>/g, '>')
|
|
115
|
+
.replace(/"/g, '"');
|
|
109
116
|
}
|
|
110
117
|
getSelectedOption(value) {
|
|
111
118
|
if (typeof value === "string" || value instanceof String) {
|
|
@@ -4,17 +4,130 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8646c40d.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const
|
|
7
|
+
const CheckMode = require('./CheckMode-ecb90b87.js');
|
|
8
8
|
const ApplicationUtils = require('./ApplicationUtils-edc62c5c.js');
|
|
9
9
|
require('./DialogType-aa435c52.js');
|
|
10
10
|
|
|
11
|
+
const buildTextArea = ({ name, label, readOnly }) => {
|
|
12
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small", key: name },
|
|
13
|
+
index.h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const buildTextInput = ({ name, label, readOnly }) => {
|
|
17
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
18
|
+
index.h("ez-text-input", { label: label, "data-field-name": name, key: name, enabled: !readOnly })));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const buildSwitch = (fieldConfig) => {
|
|
22
|
+
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
|
|
23
|
+
};
|
|
24
|
+
const buildCheckBox = (fieldConfig) => {
|
|
25
|
+
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, false);
|
|
26
|
+
};
|
|
27
|
+
function buildField$1(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
28
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
|
|
29
|
+
index.h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.CheckMode.SWITCH : CheckMode.CheckMode.REGULAR, "data-field-name": fieldName, key: fieldName })));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const buildComboBox = ({ name, label, readOnly, required }, properties) => {
|
|
33
|
+
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
34
|
+
let options;
|
|
35
|
+
if (typeof prop === "string") {
|
|
36
|
+
const parsed = JSON.parse(prop);
|
|
37
|
+
options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
options = prop;
|
|
41
|
+
}
|
|
42
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
43
|
+
index.h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const buildSearch = ({ name, label, readOnly, required }) => {
|
|
47
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
48
|
+
index.h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const buildFile = ({ name, label, readOnly }) => {
|
|
52
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
53
|
+
index.h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const buildDate = ({ name, label, readOnly }) => {
|
|
57
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
58
|
+
index.h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
59
|
+
};
|
|
60
|
+
const buildTime = ({ name, label }) => {
|
|
61
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
62
|
+
index.h("ez-time-input", { label: label, "data-field-name": name, key: name })));
|
|
63
|
+
};
|
|
64
|
+
const buildTimeDate = ({ name, label }) => {
|
|
65
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
66
|
+
index.h("ez-date-time-input", { label: label, "data-field-name": name, key: name })));
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const buildDecimal = ({ name, label, readOnly }, properties) => {
|
|
70
|
+
const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
|
|
71
|
+
const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
|
|
72
|
+
return buildNumeric(name, label, readOnly, precision, prettyPrecision);
|
|
73
|
+
};
|
|
74
|
+
const buildInteger = ({ name, label, readOnly }) => {
|
|
75
|
+
return buildNumeric(name, label, readOnly, 0, 0);
|
|
76
|
+
};
|
|
77
|
+
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
|
|
78
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
79
|
+
index.h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const uiBuilders = new Map();
|
|
83
|
+
uiBuilders.set(core.UserInterface.LONGTEXT, buildTextArea);
|
|
84
|
+
uiBuilders.set(core.UserInterface.CHECKBOX, buildCheckBox);
|
|
85
|
+
uiBuilders.set(core.UserInterface.SWITCH, buildSwitch);
|
|
86
|
+
uiBuilders.set(core.UserInterface.OPTIONSELECTOR, buildComboBox);
|
|
87
|
+
uiBuilders.set(core.UserInterface.SEARCH, buildSearch);
|
|
88
|
+
uiBuilders.set(core.UserInterface.FILE, buildFile);
|
|
89
|
+
uiBuilders.set(core.UserInterface.DATE, buildDate);
|
|
90
|
+
uiBuilders.set(core.UserInterface.TIME, buildTime);
|
|
91
|
+
uiBuilders.set(core.UserInterface.DATETIME, buildTimeDate);
|
|
92
|
+
uiBuilders.set(core.UserInterface.DECIMALNUMBER, buildDecimal);
|
|
93
|
+
uiBuilders.set(core.UserInterface.INTEGERNUMBER, buildInteger);
|
|
94
|
+
const buildField = (field) => {
|
|
95
|
+
const descriptor = field.descriptor;
|
|
96
|
+
const config = Object.assign({}, field.config);
|
|
97
|
+
let builder;
|
|
98
|
+
let props;
|
|
99
|
+
if (descriptor) {
|
|
100
|
+
if (!config.label) {
|
|
101
|
+
config.label = descriptor.label;
|
|
102
|
+
}
|
|
103
|
+
if (!config.name) {
|
|
104
|
+
config.name = descriptor.name;
|
|
105
|
+
}
|
|
106
|
+
if (config.required === undefined) {
|
|
107
|
+
config.required = descriptor.required;
|
|
108
|
+
}
|
|
109
|
+
if (config.readOnly === undefined) {
|
|
110
|
+
config.readOnly = descriptor.readOnly;
|
|
111
|
+
}
|
|
112
|
+
props = descriptor.properties;
|
|
113
|
+
builder = uiBuilders.get(descriptor.userInterface);
|
|
114
|
+
}
|
|
115
|
+
if (config.required) {
|
|
116
|
+
config.label = `${config.label} (obrigatório) *`;
|
|
117
|
+
}
|
|
118
|
+
if (!builder) {
|
|
119
|
+
builder = buildTextInput;
|
|
120
|
+
}
|
|
121
|
+
return builder(config, props);
|
|
122
|
+
};
|
|
123
|
+
|
|
11
124
|
const FormItem = ({ source }) => {
|
|
12
125
|
if ("items" in source) {
|
|
13
126
|
const fieldSet = source;
|
|
14
|
-
return index.h("ez-collapsible-box", { label: source.label, "header-size": "large" }, fieldSet.items.map(fi =>
|
|
127
|
+
return index.h("ez-collapsible-box", { label: source.label, "header-size": "large" }, fieldSet.items.map(fi => buildField(fi)));
|
|
15
128
|
}
|
|
16
129
|
else {
|
|
17
|
-
return
|
|
130
|
+
return buildField(source);
|
|
18
131
|
}
|
|
19
132
|
};
|
|
20
133
|
|
|
@@ -6,7 +6,7 @@ const index = require('./index-8646c40d.js');
|
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const ApplicationUtils = require('./ApplicationUtils-edc62c5c.js');
|
|
8
8
|
require('./DialogType-aa435c52.js');
|
|
9
|
-
require('./
|
|
9
|
+
require('./CheckMode-ecb90b87.js');
|
|
10
10
|
|
|
11
11
|
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}";
|
|
12
12
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
-
"./components/ez-tabselector/ez-tabselector.js",
|
|
4
|
-
"./components/ez-form/ez-form.js",
|
|
5
|
-
"./components/ez-combo-box/ez-combo-box.js",
|
|
6
3
|
"./components/ez-actions-button/ez-actions-button.js",
|
|
7
4
|
"./components/ez-card-item/ez-card-item.js",
|
|
5
|
+
"./components/ez-combo-box/ez-combo-box.js",
|
|
6
|
+
"./components/ez-tabselector/ez-tabselector.js",
|
|
7
|
+
"./components/ez-form/ez-form.js",
|
|
8
8
|
"./components/ez-list/ez-list.js",
|
|
9
9
|
"./components/ez-radio-button/ez-radio-button.js",
|
|
10
10
|
"./components/ez-upload/ez-upload.js",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
|
|
116
116
|
/******** REGULAR MODE ********/
|
|
117
117
|
/*---------------------------unchecked------------------------------*/
|
|
118
|
-
input.
|
|
118
|
+
input.regular-mode {
|
|
119
119
|
/*private*/
|
|
120
120
|
display: flex;
|
|
121
121
|
flex-wrap: wrap;
|
|
@@ -135,12 +135,12 @@ input.regularMode {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
|
|
138
|
-
input.
|
|
138
|
+
input.regular-mode:enabled:hover {
|
|
139
139
|
/*public*/
|
|
140
140
|
background-color: var(--ez-check--hover--background-color);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
input.
|
|
143
|
+
input.regular-mode:enabled:focus {
|
|
144
144
|
/*private*/
|
|
145
145
|
outline: none;
|
|
146
146
|
|
|
@@ -148,13 +148,13 @@ input.regularMode:enabled:focus {
|
|
|
148
148
|
background-color: var(--ez-check--focus--background-color);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
input.
|
|
151
|
+
input.regular-mode:disabled {
|
|
152
152
|
/*private*/
|
|
153
153
|
cursor: auto;
|
|
154
154
|
background: none;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
input.
|
|
157
|
+
input.regular-mode::before {
|
|
158
158
|
/*private*/
|
|
159
159
|
box-sizing: border-box;
|
|
160
160
|
content: "";
|
|
@@ -167,35 +167,35 @@ input.regularMode::before {
|
|
|
167
167
|
border: var(--ez-check--border);
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
input.
|
|
170
|
+
input.regular-mode:disabled::before {
|
|
171
171
|
/*public*/
|
|
172
172
|
border: var(--ez-check--disabled--border);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
/*-------------------------------checked---------------------------------*/
|
|
176
|
-
input.
|
|
176
|
+
input.regular-mode:checked:enabled:hover {
|
|
177
177
|
/*public*/
|
|
178
178
|
background-color: var(--ez-check--checked--hover--background-color);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
input.
|
|
181
|
+
input.regular-mode:checked:enabled:focus {
|
|
182
182
|
/*public*/
|
|
183
183
|
background-color: var(--ez-check--checked--focus--background-color);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
input.
|
|
186
|
+
input.regular-mode:checked::before {
|
|
187
187
|
/*public*/
|
|
188
188
|
border: var(--ez-check--checked--border);
|
|
189
189
|
background-color: var(--ez-check--checked--background-color);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
input.
|
|
192
|
+
input.regular-mode:checked:disabled:before {
|
|
193
193
|
/*public*/
|
|
194
194
|
border: var(--ez-check--disabled--border);
|
|
195
195
|
background-color: var(--ez-check--checked--disabled--background-color);
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
input.
|
|
198
|
+
input.regular-mode:checked::after {
|
|
199
199
|
/*private*/
|
|
200
200
|
display: flex;
|
|
201
201
|
position: absolute;
|
|
@@ -209,14 +209,14 @@ input.regularMode:checked::after {
|
|
|
209
209
|
mask-image: var(--ez-check--check--image);
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
input.
|
|
212
|
+
input.regular-mode:checked:disabled::after {
|
|
213
213
|
/*public*/
|
|
214
214
|
background-color: var(--ez-check--check--disabled--background-color);
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
/******** SWITCH MODE ********/
|
|
218
218
|
/*-------------------------------OFF---------------------------------*/
|
|
219
|
-
input.
|
|
219
|
+
input.switch-mode {
|
|
220
220
|
/*private*/
|
|
221
221
|
flex-shrink: 0;
|
|
222
222
|
-webkit-appearance: none;
|
|
@@ -234,18 +234,18 @@ input.switchMode {
|
|
|
234
234
|
background-color: var(--ez-switch--background-color);
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
input.
|
|
237
|
+
input.switch-mode:disabled {
|
|
238
238
|
/*public*/
|
|
239
239
|
background-color: var(--ez-switch--disabled--background-color);
|
|
240
240
|
border: var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9);
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
input.
|
|
243
|
+
input.switch-mode:checked:disabled {
|
|
244
244
|
/*public*/
|
|
245
245
|
background-color: var(--ez-switch--disabled--checked--background-color);
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
input.
|
|
248
|
+
input.switch-mode::after {
|
|
249
249
|
/*private*/
|
|
250
250
|
content: "";
|
|
251
251
|
display: block;
|
|
@@ -264,14 +264,14 @@ input.switchMode::after {
|
|
|
264
264
|
background-color: var(--ez-switch--pin--background-color);
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
input.
|
|
267
|
+
input.switch-mode:disabled::after {
|
|
268
268
|
/*public*/
|
|
269
269
|
background-color: var(--ez-switch--pin--disabled--background-color);
|
|
270
270
|
border: var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9);
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
/*-------------------------------ON---------------------------------*/
|
|
274
|
-
input.
|
|
274
|
+
input.switch-mode:checked {
|
|
275
275
|
/*private*/
|
|
276
276
|
transition: background-color var(--transition), border var(--transition);
|
|
277
277
|
|
|
@@ -280,7 +280,7 @@ input.switchMode:checked {
|
|
|
280
280
|
border: var(--border--small, 1px solid) var(--color--primary, #008561);
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
input.
|
|
283
|
+
input.switch-mode::before {
|
|
284
284
|
/*private*/
|
|
285
285
|
display: block;
|
|
286
286
|
content: "";
|
|
@@ -297,19 +297,19 @@ input.switchMode::before {
|
|
|
297
297
|
background-color: var(--ez-switch--pin--focus--background-color);
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
input.
|
|
300
|
+
input.switch-mode:focus::before {
|
|
301
301
|
/*private*/
|
|
302
302
|
opacity: 0.24;
|
|
303
303
|
transition: opacity var(--transition);
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
input.
|
|
306
|
+
input.switch-mode:checked:focus::before {
|
|
307
307
|
/*private*/
|
|
308
308
|
background-color: var(--ez-switch--pin--checked--focus--background-color);
|
|
309
309
|
transform: translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width) + 2px));
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
-
input.
|
|
312
|
+
input.switch-mode:checked::after {
|
|
313
313
|
/*private*/
|
|
314
314
|
transition: transform var(--transition);
|
|
315
315
|
transition: background-color var(--transition);
|
|
@@ -322,7 +322,7 @@ input.switchMode:checked::after {
|
|
|
322
322
|
border: var(--border--small, 1px solid) var(--color--primary, #008561);
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
-
input.
|
|
325
|
+
input.switch-mode:checked:disabled::after {
|
|
326
326
|
/*public*/
|
|
327
327
|
background-color: var(--ez-switch--pin--checked--disabled--background-color);
|
|
328
328
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Component, Prop, h, Watch, Method, Event, Host } from '@stencil/core';
|
|
2
|
+
import { CheckMode } from './CheckMode';
|
|
2
3
|
export class EzCheck {
|
|
3
4
|
constructor() {
|
|
4
5
|
/**
|
|
@@ -11,16 +12,17 @@ export class EzCheck {
|
|
|
11
12
|
* No modo "regular" a visualização é a tradicional de uma caixinha marcada/desmarcada.
|
|
12
13
|
* No modo "switch" o campo tem uma interface em formato de um pino liga/desliga.
|
|
13
14
|
*/
|
|
14
|
-
this.mode =
|
|
15
|
+
this.mode = CheckMode.REGULAR;
|
|
15
16
|
}
|
|
16
17
|
observeMode() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
this._inputElem.classList.
|
|
18
|
+
var _a;
|
|
19
|
+
if (((_a = this.mode) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === CheckMode.SWITCH) {
|
|
20
|
+
this._inputElem.classList.remove("regular-mode");
|
|
21
|
+
this._inputElem.classList.add("switch-mode");
|
|
20
22
|
}
|
|
21
23
|
else {
|
|
22
|
-
this._inputElem.classList.remove("
|
|
23
|
-
this._inputElem.classList.add("
|
|
24
|
+
this._inputElem.classList.remove("switch-mode");
|
|
25
|
+
this._inputElem.classList.add("regular-mode");
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
//---------------------------------------------
|
|
@@ -57,7 +59,7 @@ export class EzCheck {
|
|
|
57
59
|
}
|
|
58
60
|
render() {
|
|
59
61
|
return (h(Host, null,
|
|
60
|
-
h("input", { type: "checkbox", class: "
|
|
62
|
+
h("input", { type: "checkbox", class: "regular-mode", checked: this.value === true, onChange: () => { this.changeValue(); }, disabled: !this.enabled, ref: (el) => this._inputElem = el }),
|
|
61
63
|
this.label ? h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) : undefined));
|
|
62
64
|
}
|
|
63
65
|
static get is() { return "ez-check"; }
|
|
@@ -137,7 +139,7 @@ export class EzCheck {
|
|
|
137
139
|
},
|
|
138
140
|
"attribute": "mode",
|
|
139
141
|
"reflect": true,
|
|
140
|
-
"defaultValue": "
|
|
142
|
+
"defaultValue": "CheckMode.REGULAR"
|
|
141
143
|
}
|
|
142
144
|
}; }
|
|
143
145
|
static get events() { return [{
|
|
@@ -93,7 +93,14 @@ export class EzComboBox {
|
|
|
93
93
|
if (currentValue) {
|
|
94
94
|
text = this.showSelectedValue ? `${currentValue.value} - ${currentValue.label}` : currentValue.label;
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
if (text == undefined) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
return String(text)
|
|
100
|
+
.replace(/&/g, '&')
|
|
101
|
+
.replace(/</g, '<')
|
|
102
|
+
.replace(/>/g, '>')
|
|
103
|
+
.replace(/"/g, '"');
|
|
97
104
|
}
|
|
98
105
|
getSelectedOption(value) {
|
|
99
106
|
if (typeof value === "string" || value instanceof String) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { CheckMode } from "../../../ez-check/CheckMode";
|
|
2
3
|
export const buildSwitch = (fieldConfig) => {
|
|
3
4
|
return buildField(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
|
|
4
5
|
};
|
|
@@ -7,5 +8,5 @@ export const buildCheckBox = (fieldConfig) => {
|
|
|
7
8
|
};
|
|
8
9
|
function buildField(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
9
10
|
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" },
|
|
10
|
-
h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ?
|
|
11
|
+
h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, key: fieldName })));
|
|
11
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as ApplicationUtils } from './ApplicationUtils';
|
|
2
2
|
export { default as CSSVarsUtils } from './CSSVarsUtils';
|
|
3
3
|
export { DialogType } from '../components/ez-dialog/DialogType';
|
|
4
|
-
export {
|
|
4
|
+
export { CheckMode } from '../components/ez-check/CheckMode';
|