@sankhyalabs/ezui 1.2.0-beta.6 → 1.2.0-beta.7
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/{ApplicationUtils-483c0a9e.js → ApplicationUtils-2ac1b73e.js} +2 -1
- package/dist/cjs/ApplicationUtils-475b50d9.js +63 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/css-shim-3bfdba4f.js +6 -0
- package/dist/cjs/dom-8ac1ad03.js +75 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +7 -6
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +4 -4
- package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +7 -6
- package/dist/cjs/ez-date-input.cjs.entry.js +6 -6
- package/dist/cjs/ez-date-time-input.cjs.entry.js +4 -4
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +460 -49
- package/dist/cjs/ez-grid-config.cjs.entry.js +5 -5
- package/dist/cjs/ez-grid.cjs.entry.js +1153 -989
- package/dist/cjs/ez-icon.cjs.entry.js +3 -3
- package/dist/cjs/ez-list.cjs.entry.js +3 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +4 -4
- package/dist/cjs/ez-popover.cjs.entry.js +5 -5
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-select-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +2 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +3 -3
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -7
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +2 -2
- package/dist/cjs/ez-view-stack.cjs.entry.js +2 -1
- package/dist/cjs/ezui.cjs.js +112 -4
- package/dist/cjs/index-0ad7c3e4.js +6 -0
- package/dist/cjs/index-2ec1da82.js +2307 -0
- package/dist/cjs/index-d9c5cb88.js +3068 -0
- package/dist/cjs/loader.cjs.js +18 -2
- package/dist/cjs/shadow-css-41d9783d.js +390 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/utils/ApplicationUtils.js +2 -1
- package/dist/custom-elements/index.js +3844 -967
- package/dist/esm/ApplicationUtils-30a69eb0.js +61 -0
- package/dist/esm/{ApplicationUtils-5f87ae60.js → ApplicationUtils-a4a76132.js} +2 -1
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/css-shim-20dbffa5.js +4 -0
- package/dist/esm/dom-c5ed0ba5.js +73 -0
- package/dist/esm/ez-actions-button.entry.js +4 -3
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +2 -2
- package/dist/esm/ez-card-item.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +4 -3
- package/dist/esm/ez-date-input.entry.js +2 -2
- package/dist/esm/ez-date-time-input.entry.js +2 -2
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +426 -15
- package/dist/esm/ez-grid-config.entry.js +3 -3
- package/dist/esm/ez-grid.entry.js +1119 -955
- package/dist/esm/ez-icon.entry.js +2 -2
- package/dist/esm/ez-list.entry.js +3 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +2 -2
- package/dist/esm/ez-popover.entry.js +2 -2
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-select-box.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +2 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +2 -2
- package/dist/esm/ez-time-input.entry.js +2 -2
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +2 -2
- package/dist/esm/ez-view-stack.entry.js +2 -1
- package/dist/esm/ezui.js +112 -4
- package/dist/esm/index-12b43518.js +3 -0
- package/dist/esm/index-1e9d524f.js +3031 -0
- package/dist/esm/index-b96183c8.js +2295 -0
- package/dist/esm/loader.js +18 -2
- package/dist/esm/shadow-css-8c625855.js +388 -0
- package/dist/ezui/ApplicationUtils-30a69eb0.js +61 -0
- package/dist/ezui/CSSVarsUtils-499b75c2.js +53 -0
- package/dist/ezui/DialogType-72afa679.js +8 -0
- package/dist/ezui/app-globals-0f993ce5.js +3 -0
- package/dist/ezui/css-shim-20dbffa5.js +4 -0
- package/dist/ezui/dom-c5ed0ba5.js +73 -0
- package/dist/ezui/ez-actions-button.entry.js +98 -0
- package/dist/ezui/ez-application.entry.js +22 -0
- package/dist/ezui/ez-button.entry.js +73 -0
- package/dist/ezui/ez-calendar.entry.js +219 -0
- package/dist/ezui/ez-card-item.entry.js +40 -0
- package/dist/ezui/ez-check.entry.js +72 -0
- package/dist/ezui/ez-chip.entry.js +97 -0
- package/dist/ezui/ez-collapsible-box.entry.js +57 -0
- package/dist/ezui/ez-combo-box.entry.js +439 -0
- package/dist/ezui/ez-date-input.entry.js +159 -0
- package/dist/ezui/ez-date-time-input.entry.js +214 -0
- package/dist/ezui/ez-dialog.entry.js +108 -0
- package/dist/ezui/ez-filter-input.entry.js +75 -0
- package/dist/ezui/ez-form.entry.js +1395 -0
- package/dist/ezui/ez-grid-config.entry.js +433 -0
- package/dist/ezui/ez-grid.entry.js +115419 -0
- package/dist/ezui/ez-icon.entry.js +37 -0
- package/dist/ezui/ez-list.entry.js +516 -0
- package/dist/ezui/ez-loading-bar.entry.js +24 -0
- package/dist/ezui/ez-modal.entry.js +67 -0
- package/dist/ezui/ez-number-input.entry.js +148 -0
- package/dist/ezui/ez-popover.entry.js +141 -0
- package/dist/ezui/ez-popup.entry.js +49 -0
- package/dist/ezui/ez-radio-button.entry.js +45 -0
- package/dist/ezui/ez-scroller.entry.js +101 -0
- package/dist/ezui/ez-search.entry.js +83 -0
- package/dist/ezui/ez-select-box.entry.js +18 -0
- package/dist/ezui/ez-tabselector.entry.js +195 -0
- package/dist/ezui/ez-text-area.entry.js +158 -0
- package/dist/ezui/ez-text-input.entry.js +235 -0
- package/dist/ezui/ez-time-input.entry.js +164 -0
- package/dist/ezui/ez-toast.entry.js +84 -0
- package/dist/ezui/ez-upload.entry.js +379 -0
- package/dist/ezui/ez-view-stack.entry.js +74 -0
- package/dist/ezui/ezui.esm.js +125 -1
- package/dist/ezui/index-12b43518.js +3 -0
- package/dist/ezui/index-1e9d524f.js +3031 -0
- package/dist/ezui/index-b96183c8.js +2295 -0
- package/dist/ezui/index.esm.js +1 -0
- package/dist/ezui/{p-72ab066f.entry.js → p-4eb273f8.entry.js} +1 -1
- package/dist/ezui/p-adbe4188.js +1 -0
- package/dist/ezui/{p-6cfe20a0.entry.js → p-af43be42.entry.js} +1 -1
- package/dist/ezui/{p-47e06040.entry.js → p-c9d2060e.entry.js} +1 -1
- package/dist/ezui/{p-3ae441ec.entry.js → p-d836f546.entry.js} +1 -1
- package/dist/ezui/{p-7fe1ac9a.entry.js → p-e55fc20f.entry.js} +1 -1
- package/dist/ezui/shadow-css-8c625855.js +388 -0
- package/package.json +1 -1
- package/dist/ezui/p-898b9906.js +0 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { r as registerInstance, e as createEvent, h, f as Host } from './index-1e9d524f.js';
|
|
2
|
+
|
|
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.regularMode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--ez-check--width);height:var(--ez-check--height)}input.regularMode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regularMode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regularMode:disabled{cursor:auto;background:none}input.regularMode::before{box-sizing:border-box;content:\"\";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regularMode:disabled::before{border:var(--ez-check--disabled--border)}input.regularMode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regularMode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regularMode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regularMode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regularMode:checked::after{display:flex;position:absolute;content:\"\";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regularMode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switchMode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:var(--border--small, 1px solid) var(--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.switchMode:disabled{background-color:var(--ez-switch--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switchMode:checked:disabled{background-color:var(--ez-switch--disabled--checked--background-color)}input.switchMode::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.switchMode: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.switchMode:checked{transition:background-color var(--transition), border var(--transition);background-color:var(--ez-switch--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switchMode::before{display:block;content:\"\";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--ez-switch--focus--width);height:var(--ez-switch--focus--height);top:calc((var(--ez-switch--slider--height) - var(--ez-switch--focus--height)) / 2);left:calc((var(--ez-switch--pin--width) - var(--ez-switch--focus--width) - 2px) / 2);background-color:var(--ez-switch--pin--focus--background-color)}input.switchMode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switchMode:checked:focus::before{background-color:var(--ez-switch--pin--checked--focus--background-color);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width) + 2px))}input.switchMode: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.switchMode:checked:disabled::after{background-color:var(--ez-switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-check--label--color);text-shadow:var(--text-shadow);font-size:var(--ez-check--label--font-size);font-family:var(--ez-check--label--font-family);cursor:default;padding-left:var(--space--small)}.label--disabled{color:var(--ez-check--label--disabled--color)}";
|
|
4
|
+
|
|
5
|
+
let EzCheck = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.ezChange = createEvent(this, "ezChange", 7);
|
|
9
|
+
/**
|
|
10
|
+
* Deixa o campo disponível ou não para interação com o usuário.
|
|
11
|
+
*/
|
|
12
|
+
this.enabled = true;
|
|
13
|
+
/**
|
|
14
|
+
* Existem dois modos de visualização: regular e switch.
|
|
15
|
+
* Se esta propriedade for omitida, o componete assume o formato "regular".
|
|
16
|
+
* No modo "regular" a visualização é a tradicional de uma caixinha marcada/desmarcada.
|
|
17
|
+
* No modo "switch" o campo tem uma interface em formato de um pino liga/desliga.
|
|
18
|
+
*/
|
|
19
|
+
this.mode = "regular";
|
|
20
|
+
}
|
|
21
|
+
observeMode() {
|
|
22
|
+
if (this.mode === "switch") {
|
|
23
|
+
this._inputElem.classList.remove("regularMode");
|
|
24
|
+
this._inputElem.classList.add("switchMode");
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
this._inputElem.classList.remove("switchMode");
|
|
28
|
+
this._inputElem.classList.add("regularMode");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//---------------------------------------------
|
|
32
|
+
// Public methods
|
|
33
|
+
//---------------------------------------------
|
|
34
|
+
/**
|
|
35
|
+
* Devolve o modo escolhido para o componente
|
|
36
|
+
*/
|
|
37
|
+
async getMode() {
|
|
38
|
+
return this.mode;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Faz o foco no componente de input
|
|
42
|
+
*/
|
|
43
|
+
async setFocus() {
|
|
44
|
+
this._inputElem.focus();
|
|
45
|
+
}
|
|
46
|
+
componentDidLoad() {
|
|
47
|
+
this.observeMode();
|
|
48
|
+
}
|
|
49
|
+
changeValue() {
|
|
50
|
+
if (!this.enabled) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
this.value = !this.value;
|
|
54
|
+
this.ezChange.emit(this.value);
|
|
55
|
+
}
|
|
56
|
+
getLabelClasses() {
|
|
57
|
+
let classes = "label";
|
|
58
|
+
if (!this.enabled) {
|
|
59
|
+
classes += " label--disabled";
|
|
60
|
+
}
|
|
61
|
+
return classes;
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
return (h(Host, null, h("input", { type: "checkbox", class: "regularMode", 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
|
+
}
|
|
66
|
+
static get watchers() { return {
|
|
67
|
+
"mode": ["observeMode"]
|
|
68
|
+
}; }
|
|
69
|
+
};
|
|
70
|
+
EzCheck.style = ezCheckCss;
|
|
71
|
+
|
|
72
|
+
export { EzCheck as ez_check };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { r as registerInstance, e as createEvent, h } from './index-1e9d524f.js';
|
|
2
|
+
|
|
3
|
+
const ezChipCss = ":host{--ez-label-chip--height:30px;--ez-label-chip__label--font-size:var(--text--medium, 14px);--ez-label-chip__label--font-family:var(--font-pattern, Arial);--ez-label-chip__label--font-weight:var(--text-weight--medium, 400);--ez-label-chip__label--space--medium:var(--space--medium, 12px);--ez-label-chip__label--title--primary:var(--title--primary, #2B3A54);--ez-label-chip__label--text--primary:var(--text--primary, #626e82);--ez-label-chip__label__container--border-radius:var(--border--radius-large, 24px);--ez-label-chip__label__container--border:1px solid;--ez-label-chip__label__container--border-color-strokes:var(--color--strokes, #DCE0E8);--ez-label-chip__label__container--color-primary:var(--color--primary, #008561);--ez-label-chip__label__container-color--disable-secondary:var(--color--disable-secondary, #F2F5F8);--ez-label-chip__label__container--background-color:var(--color--primary-300);--ez-label-chip__label__container--border-color:#0085610F;--ez-label-chip__label__container--default--border-color--active:var(--color--primary, #007a5a);--ez-label-chip__label__container--default--background-color--hover:var(--color--primary-300, #f2faf8);--ez-label-chip__label__container--default--color--hover:var(--color--primary, #f2faf8);--ez-label-chip__label__container--text--disabled:var(--text--disable, #AFB6C0);--ez-label-chip__label__container--default--border-color--active:var(--color--primary)}.lbl{display:flex;align-items:center;font-weight:var(--ez-label-chip__label--font-weight);cursor:pointer;color:var(--ez-label-chip__label--title--primary);user-select:none;height:var(--ez-label-chip--height);font-family:var(--ez-label-chip__label--font-family);font-size:var(--ez-label-chip__label--font-size)}.lbl--active{color:var(--ez-label-chip__label__container--default--color--hover)}.lbl--disabled{color:var(--ez-label-chip__label__container--text--disabled)}.label__container{cursor:pointer;width:fit-content;display:flex;flex-wrap:wrap;align-items:center;background-color:#FFFFFF;color:var(--ez-label-chip__label--text--primary);fill:var(--ez-label-chip__label--text--primary);--ez-icon--color:var(--ez-label-chip__label--text--primary);border:var(--ez-label-chip__label__container--border);border-radius:var(--ez-label-chip__label__container--border-radius);border-color:var(--ez-label-chip__label__container--border-color-strokes);padding-right:var(--ez-label-chip__label--space--medium);padding-left:var(--ez-label-chip__label--space--medium)}.label__content{display:flex;align-items:center;flex-wrap:wrap;--ez-icon--color:var(--ez-label-chip__label--text--primary)}.label__container--disabled{cursor:default;border-color:var(--ez-label-chip__label__container-color--disable-secondary);background-color:var(--ez-label-chip__label__container-color--disable-secondary);fill:var(--ez-label-chip__label__container--text--disabled);color:var(--ez-label-chip__label__container--text--disabled);--ez-icon--color:var(--ez-label-chip__label__container--text--disabled)}.label__container--active{border-color:var(--ez-label-chip__label__container--default--background-color--hover);background-color:var(--ez-label-chip__label__container--default--background-color--hover);color:var(--ez-label-chip__label__container--default--color--hover);fill:var(--ez-label-chip__label__container--default--color--hover);--ez-icon--color:var(--ez-label-chip__label__container--default--color--hover)}.label__container:hover{border-color:var(--ez-label-chip__label__container--default--border-color--active)}.label__container--disabled:hover{cursor:default;border:var(--ez-label-chip__label__container--border);border-color:var(--ez-label-chip__label__container-color--disable-secondary);background-color:var(--ez-label-chip__label__container-color--disable-secondary);fill:var(--ez-label-chip__label__container--text--disabled);color:var(--ez-label-chip__label__container--text--disabled);--ez-icon--color:var(--ez-label-chip__label__container--text--disabled)}.label__content__icon{display:flex;cursor:pointer;color:var(--ez-label-chip__label--text--primary);fill:var(--ez-label-chip__label--text--primary);--ez-icon--color:var(--ez-label-chip__label--text--primary)}.label__container--row-reverse{flex-direction:row-reverse}.label__container .btn-close{padding:0px 0px 0px 8px}.label__container--row-reverse .btn-close{padding:0px 8px 0px 0px}.cursor-disable{cursor:default}ez-icon{--ez-icon--color:inherit}";
|
|
4
|
+
|
|
5
|
+
let EzChip = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.valueChange = createEvent(this, "valueChange", 7);
|
|
9
|
+
this.removeChip = createEvent(this, "removeChip", 7);
|
|
10
|
+
this.actionClick = createEvent(this, "actionClick", 7);
|
|
11
|
+
/**
|
|
12
|
+
* Deixa o componente disponível ou não para seleção.
|
|
13
|
+
*/
|
|
14
|
+
this.enabled = true;
|
|
15
|
+
/**
|
|
16
|
+
* Indica se o componente está ou não ativado.
|
|
17
|
+
*/
|
|
18
|
+
this.value = false;
|
|
19
|
+
}
|
|
20
|
+
//---------------------------------------------
|
|
21
|
+
// Public methods
|
|
22
|
+
//---------------------------------------------
|
|
23
|
+
/**
|
|
24
|
+
* Faz o foco no componente de input
|
|
25
|
+
*/
|
|
26
|
+
async setFocus() {
|
|
27
|
+
this._labelElem.focus();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Remove o foco no componente de input
|
|
31
|
+
*/
|
|
32
|
+
async setBlur() {
|
|
33
|
+
this._labelElem.blur();
|
|
34
|
+
}
|
|
35
|
+
//---------------------------------------------
|
|
36
|
+
// Event handlers
|
|
37
|
+
//---------------------------------------------
|
|
38
|
+
handleSlotChange(ev) {
|
|
39
|
+
const slot = ev.target;
|
|
40
|
+
const content = slot.assignedElements()[0];
|
|
41
|
+
content.style.setProperty("--ez-icon--color", "var(--ez-icon--color)");
|
|
42
|
+
}
|
|
43
|
+
handleValueChange() {
|
|
44
|
+
this.swichState();
|
|
45
|
+
this.valueChange.emit(this.value);
|
|
46
|
+
}
|
|
47
|
+
handleClick(ev) {
|
|
48
|
+
const target = ev.target;
|
|
49
|
+
if (!this.enabled)
|
|
50
|
+
return;
|
|
51
|
+
if (this.mode === "action")
|
|
52
|
+
return this.actionClick.emit();
|
|
53
|
+
if (target.tagName.toLowerCase() !== "ez-icon")
|
|
54
|
+
return this.handleValueChange();
|
|
55
|
+
if (target.classList.contains("btn-close"))
|
|
56
|
+
return this.removeChip.emit();
|
|
57
|
+
}
|
|
58
|
+
swichState() {
|
|
59
|
+
if (this.enabled) {
|
|
60
|
+
this.value = !this.value;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
observeValue() {
|
|
64
|
+
(this.value && this.mode !== "action") ? this._divElem.classList.add("label__container--active") : this._divElem.classList.remove("label__container--active");
|
|
65
|
+
}
|
|
66
|
+
observeEnabled() {
|
|
67
|
+
if (this.enabled) {
|
|
68
|
+
this._divElem.classList.remove("label__container--disabled");
|
|
69
|
+
this._labelElem.classList.remove("lbl--disabled");
|
|
70
|
+
this._labelElem.classList.remove("cursor-disable");
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
this._divElem.classList.add("label__container--disabled");
|
|
74
|
+
this._labelElem.classList.add("lbl--disabled");
|
|
75
|
+
this._labelElem.classList.add("cursor-disable");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//---------------------------------------------
|
|
79
|
+
// Lifecycle web component
|
|
80
|
+
//---------------------------------------------
|
|
81
|
+
componentDidLoad() {
|
|
82
|
+
if (this._divElem) {
|
|
83
|
+
this.observeValue();
|
|
84
|
+
this.observeEnabled();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
render() {
|
|
88
|
+
return (h("div", { onClick: (ev) => this.handleClick(ev), class: "label__container" + (this.removePosition === "left" ? " label__container--row-reverse" : ""), ref: (el) => this._divElem = el }, h("div", { class: "label__content" }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), h("label", { class: "lbl " + (this.value ? "lbl--active " : ""), ref: (el) => this._labelElem = el }, this.label), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })), this.mode !== 'action' && this.removePosition && h("ez-icon", { class: "btn-close", size: "small", "icon-name": "close" })));
|
|
89
|
+
}
|
|
90
|
+
static get watchers() { return {
|
|
91
|
+
"value": ["observeValue"],
|
|
92
|
+
"enabled": ["observeEnabled"]
|
|
93
|
+
}; }
|
|
94
|
+
};
|
|
95
|
+
EzChip.style = ezChipCss;
|
|
96
|
+
|
|
97
|
+
export { EzChip as ez_chip };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { r as registerInstance, e as createEvent, h } from './index-1e9d524f.js';
|
|
2
|
+
|
|
3
|
+
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{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left: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__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}";
|
|
4
|
+
|
|
5
|
+
let EzCollapsibleBox = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.ezChange = createEvent(this, "ezChange", 7);
|
|
9
|
+
/**
|
|
10
|
+
* Valor externalizado que garante a exibição ou não do componente.
|
|
11
|
+
*/
|
|
12
|
+
this.value = false;
|
|
13
|
+
/**
|
|
14
|
+
* Define o tamanho do texto e do ícone do componente.
|
|
15
|
+
*/
|
|
16
|
+
this.headerSize = "small";
|
|
17
|
+
/**
|
|
18
|
+
* Define o local onde o ícone será renderizado.
|
|
19
|
+
*/
|
|
20
|
+
this.iconPlacement = "left";
|
|
21
|
+
/**
|
|
22
|
+
* Define se o titulo irá ocupar toda a largura do componente.
|
|
23
|
+
*/
|
|
24
|
+
this.stretchTitle = false;
|
|
25
|
+
}
|
|
26
|
+
observeCollapsedValue() {
|
|
27
|
+
this.ezChange.emit(this.value);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Esconde ou revela o conteúdo do componente.
|
|
31
|
+
*/
|
|
32
|
+
async showHide() {
|
|
33
|
+
this.value = !this.value;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Retorna o tamanho configurado do texto e do ícone.
|
|
37
|
+
*/
|
|
38
|
+
getHeaderSize() {
|
|
39
|
+
const sizeAlias = ["xsmall", "xlarge"];
|
|
40
|
+
const sizeList = ["x-small", "small", "medium", "large", "x-large"];
|
|
41
|
+
const sizeLowerCase = this.headerSize && this.headerSize.toLowerCase();
|
|
42
|
+
const sizeCustom = sizeAlias.includes(sizeLowerCase) ? sizeLowerCase.replace('x', 'x-') : sizeLowerCase;
|
|
43
|
+
return sizeList.includes(sizeCustom) ? sizeCustom : "small";
|
|
44
|
+
}
|
|
45
|
+
render() {
|
|
46
|
+
return (h("div", { class: "collapsible-box" }, h("div", { class: "collapsible-box__header" }, h("button", { onClick: () => this.showHide(), class: "collapsible-box__title" +
|
|
47
|
+
(this.iconPlacement === "right" ? " collapsible-box__title--icon-right" : "") +
|
|
48
|
+
(this.stretchTitle ? " collapsible-box__title--stretched" : "") +
|
|
49
|
+
(this.value ? " collapsible-box__title--no-margin" : "") }, h("ez-icon", { slot: "icon", "icon-name": "chevron-right", size: this.getHeaderSize(), class: "collapsible-box__icon collapsible-box__icon--" + this.getHeaderSize() + (this.value ? " collapsible-box__icon--collapsed" : "") }), h("label", { class: "collapsible-box__label font--" + this.getHeaderSize(), title: this.label }, this.label))), h("div", { class: "collapsible-box__content" + (this.value ? "" : " collapsible-box__content--show") }, h("slot", null))));
|
|
50
|
+
}
|
|
51
|
+
static get watchers() { return {
|
|
52
|
+
"value": ["observeCollapsedValue"]
|
|
53
|
+
}; }
|
|
54
|
+
};
|
|
55
|
+
EzCollapsibleBox.style = ezCollapsibleBoxCss;
|
|
56
|
+
|
|
57
|
+
export { EzCollapsibleBox as ez_collapsible_box };
|