@sankhyalabs/ezui 1.2.0-beta.19 → 1.2.0-beta.20
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/FieldBuilder-cd3e45ed.js +119 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +64 -12
- package/dist/cjs/ez-button.cjs.entry.js +12 -10
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +85 -6
- package/dist/cjs/ez-combo-box.cjs.entry.js +10 -6
- package/dist/cjs/ez-date-input.cjs.entry.js +8 -13
- package/dist/cjs/ez-date-time-input.cjs.entry.js +8 -13
- package/dist/cjs/ez-form.cjs.entry.js +41 -131
- package/dist/cjs/ez-grid-config.cjs.entry.js +2 -3
- package/dist/cjs/ez-grid.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-tabselector.cjs.entry.js +7 -5
- package/dist/cjs/ez-text-area.cjs.entry.js +6 -6
- package/dist/cjs/ez-text-edit.cjs.entry.js +103 -0
- package/dist/cjs/ez-text-input.cjs.entry.js +11 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/ez-actions-button/ez-actions-button.css +49 -20
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +219 -23
- package/dist/collection/components/ez-button/ez-button.css +0 -6
- package/dist/collection/components/ez-button/ez-button.js +11 -9
- package/dist/collection/components/ez-calendar/ez-calendar.css +17 -20
- package/dist/collection/components/ez-chip/ez-chip.css +3 -2
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +16 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +226 -7
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +1 -22
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +17 -14
- package/dist/collection/components/ez-date-input/ez-date-input.js +8 -13
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +8 -13
- package/dist/collection/components/ez-form/ez-form.js +22 -13
- package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +1 -1
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +24 -14
- package/dist/collection/components/ez-grid/ez-grid.js +17 -1
- package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.css +36 -25
- package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.js +1 -2
- package/dist/collection/components/ez-grid/subcomponents/ez-select-box/ez-select-box.js +5 -4
- package/dist/collection/components/ez-list/ez-list.css +9 -1
- package/dist/collection/components/ez-popover/ez-popover.css +1 -1
- package/dist/collection/components/ez-radio-button/ez-radio-button.css +16 -5
- package/dist/collection/components/ez-radio-button/ez-radio-button.js +1 -1
- package/dist/collection/components/ez-search/ez-search.js +6 -6
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +9 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +7 -3
- package/dist/collection/components/ez-text-area/ez-text-area.css +6 -3
- package/dist/collection/components/ez-text-area/ez-text-area.js +5 -5
- package/dist/collection/components/ez-text-edit/ez-text-edit.css +19 -0
- package/dist/collection/components/ez-text-edit/ez-text-edit.js +188 -0
- package/dist/collection/components/ez-text-input/ez-text-input.css +18 -2
- package/dist/collection/components/ez-text-input/ez-text-input.js +28 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +467 -217
- package/dist/esm/FieldBuilder-9e9545fc.js +117 -0
- package/dist/esm/ez-actions-button.entry.js +64 -12
- package/dist/esm/ez-button.entry.js +12 -10
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +86 -7
- package/dist/esm/ez-combo-box.entry.js +10 -6
- package/dist/esm/ez-date-input.entry.js +8 -13
- package/dist/esm/ez-date-time-input.entry.js +9 -14
- package/dist/esm/ez-form.entry.js +40 -130
- package/dist/esm/ez-grid-config.entry.js +2 -3
- package/dist/esm/ez-grid.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +2 -2
- package/dist/esm/ez-tabselector.entry.js +7 -5
- package/dist/esm/ez-text-area.entry.js +6 -6
- package/dist/esm/ez-text-edit.entry.js +99 -0
- package/dist/esm/ez-text-input.entry.js +11 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-2cc6dd66.entry.js +1 -0
- package/dist/ezui/p-2ccad880.entry.js +1 -0
- package/dist/ezui/p-333d79c4.entry.js +1 -0
- package/dist/ezui/{p-1d47487a.entry.js → p-3c87845d.entry.js} +1 -1
- package/dist/ezui/p-4ad647fc.entry.js +1 -0
- package/dist/ezui/p-54ecd19a.js +1 -0
- package/dist/ezui/{p-b2cf7db2.entry.js → p-63d567cc.entry.js} +1 -1
- package/dist/ezui/p-6befd7e4.entry.js +1 -0
- package/dist/ezui/p-712bd293.entry.js +1 -0
- package/dist/ezui/{p-ce824077.entry.js → p-72c75a43.entry.js} +1 -1
- package/dist/ezui/{p-81eb2738.entry.js → p-802d23d9.entry.js} +1 -1
- package/dist/ezui/p-bca406db.entry.js +1 -0
- package/dist/ezui/p-be06251d.entry.js +1 -0
- package/dist/ezui/{p-e7d03a0d.entry.js → p-bffae598.entry.js} +1 -1
- package/dist/ezui/p-d91527dc.entry.js +1 -0
- package/dist/ezui/p-dd257f17.entry.js +1 -0
- package/dist/ezui/p-e1f2b5da.entry.js +1 -0
- package/dist/ezui/p-e230bfd2.entry.js +1 -0
- package/dist/ezui/p-e697ffd5.entry.js +1 -0
- package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +42 -9
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +46 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +15 -5
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +0 -1
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +0 -1
- package/dist/types/components/ez-form/DataBinder.d.ts +2 -2
- package/dist/types/components/ez-form/ez-form.d.ts +21 -11
- package/dist/types/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.d.ts +3 -3
- package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +2 -5
- package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +3 -3
- package/dist/types/components/ez-grid/ez-grid.d.ts +1 -1
- package/dist/types/components/ez-grid/subcomponents/ez-select-box/ez-select-box.d.ts +2 -6
- package/dist/types/components/ez-search/ez-search.d.ts +3 -3
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +2 -0
- package/dist/types/components/ez-text-edit/ez-text-edit.d.ts +39 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +5 -0
- package/dist/types/components.d.ts +177 -26
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +5 -3
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-21c0531b.entry.js +0 -1
- package/dist/ezui/p-2f02347d.entry.js +0 -1
- package/dist/ezui/p-416bedbe.entry.js +0 -1
- package/dist/ezui/p-52085ae4.entry.js +0 -1
- package/dist/ezui/p-5fe7e960.entry.js +0 -1
- package/dist/ezui/p-62110996.entry.js +0 -1
- package/dist/ezui/p-a27dafa4.entry.js +0 -1
- package/dist/ezui/p-aba3fa6c.entry.js +0 -1
- package/dist/ezui/p-abc21959.entry.js +0 -1
- package/dist/ezui/p-c019e137.entry.js +0 -1
- package/dist/ezui/p-d0671e14.entry.js +0 -1
- package/dist/ezui/p-e0f06d73.entry.js +0 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const core = require('@sankhyalabs/core');
|
|
4
|
+
const index = require('./index-8646c40d.js');
|
|
5
|
+
|
|
6
|
+
const buildTextArea = ({ name, label, readOnly }) => {
|
|
7
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small", key: name },
|
|
8
|
+
index.h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const buildTextInput = ({ name, label, readOnly }) => {
|
|
12
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
13
|
+
index.h("ez-text-input", { label: label, "data-field-name": name, key: name, enabled: !readOnly })));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const buildSwitch = (fieldConfig) => {
|
|
17
|
+
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
|
|
18
|
+
};
|
|
19
|
+
const buildCheckBox = (fieldConfig) => {
|
|
20
|
+
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, false);
|
|
21
|
+
};
|
|
22
|
+
function buildField$1(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
23
|
+
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" },
|
|
24
|
+
index.h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? "switch" : "regular", "data-field-name": fieldName, key: fieldName })));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const buildComboBox = ({ name, label, readOnly, required }, properties) => {
|
|
28
|
+
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
29
|
+
let options;
|
|
30
|
+
if (typeof prop === "string") {
|
|
31
|
+
const parsed = JSON.parse(prop);
|
|
32
|
+
options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
options = prop;
|
|
36
|
+
}
|
|
37
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
38
|
+
index.h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const buildSearch = ({ name, label, readOnly, required }) => {
|
|
42
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
43
|
+
index.h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const buildFile = ({ name, label, readOnly }) => {
|
|
47
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
48
|
+
index.h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const buildDate = ({ name, label, readOnly }) => {
|
|
52
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
53
|
+
index.h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
54
|
+
};
|
|
55
|
+
const buildTime = ({ name, label }) => {
|
|
56
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
57
|
+
index.h("ez-time-input", { label: label, "data-field-name": name, key: name })));
|
|
58
|
+
};
|
|
59
|
+
const buildTimeDate = ({ name, label }) => {
|
|
60
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
61
|
+
index.h("ez-date-time-input", { label: label, "data-field-name": name, key: name })));
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const buildDecimal = ({ name, label, readOnly }, properties) => {
|
|
65
|
+
const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
|
|
66
|
+
const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
|
|
67
|
+
return buildNumeric(name, label, readOnly, precision, prettyPrecision);
|
|
68
|
+
};
|
|
69
|
+
const buildInteger = ({ name, label, readOnly }) => {
|
|
70
|
+
return buildNumeric(name, label, readOnly, 0, 0);
|
|
71
|
+
};
|
|
72
|
+
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
|
|
73
|
+
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
74
|
+
index.h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const uiBuilders = new Map();
|
|
78
|
+
uiBuilders.set(core.UserInterface.LONGTEXT, buildTextArea);
|
|
79
|
+
uiBuilders.set(core.UserInterface.CHECKBOX, buildCheckBox);
|
|
80
|
+
uiBuilders.set(core.UserInterface.SWITCH, buildSwitch);
|
|
81
|
+
uiBuilders.set(core.UserInterface.OPTIONSELECTOR, buildComboBox);
|
|
82
|
+
uiBuilders.set(core.UserInterface.SEARCH, buildSearch);
|
|
83
|
+
uiBuilders.set(core.UserInterface.FILE, buildFile);
|
|
84
|
+
uiBuilders.set(core.UserInterface.DATE, buildDate);
|
|
85
|
+
uiBuilders.set(core.UserInterface.TIME, buildTime);
|
|
86
|
+
uiBuilders.set(core.UserInterface.DATETIME, buildTimeDate);
|
|
87
|
+
uiBuilders.set(core.UserInterface.DECIMALNUMBER, buildDecimal);
|
|
88
|
+
uiBuilders.set(core.UserInterface.INTEGERNUMBER, buildInteger);
|
|
89
|
+
const buildField = (field) => {
|
|
90
|
+
const descriptor = field.descriptor;
|
|
91
|
+
const config = Object.assign({}, field.config);
|
|
92
|
+
let builder;
|
|
93
|
+
let props;
|
|
94
|
+
if (descriptor) {
|
|
95
|
+
if (!config.label) {
|
|
96
|
+
config.label = descriptor.label;
|
|
97
|
+
}
|
|
98
|
+
if (!config.name) {
|
|
99
|
+
config.name = descriptor.name;
|
|
100
|
+
}
|
|
101
|
+
if (config.required === undefined) {
|
|
102
|
+
config.required = descriptor.required;
|
|
103
|
+
}
|
|
104
|
+
if (config.readOnly === undefined) {
|
|
105
|
+
config.readOnly = descriptor.readOnly;
|
|
106
|
+
}
|
|
107
|
+
props = descriptor.properties;
|
|
108
|
+
builder = uiBuilders.get(descriptor.userInterface);
|
|
109
|
+
}
|
|
110
|
+
if (config.required) {
|
|
111
|
+
config.label = `${config.label} (obrigatório) *`;
|
|
112
|
+
}
|
|
113
|
+
if (!builder) {
|
|
114
|
+
builder = buildTextInput;
|
|
115
|
+
}
|
|
116
|
+
return builder(config, props);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
exports.buildField = buildField;
|
|
@@ -7,8 +7,9 @@ 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('./FieldBuilder-cd3e45ed.js');
|
|
10
11
|
|
|
11
|
-
const ezActionsButtonCss = ":host{--ez-actions-
|
|
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}";
|
|
12
13
|
|
|
13
14
|
let EzActionsButton = class {
|
|
14
15
|
constructor(hostRef) {
|
|
@@ -18,14 +19,31 @@ let EzActionsButton = class {
|
|
|
18
19
|
* Deixa o campo disponível ou não para interação com usuário.
|
|
19
20
|
*/
|
|
20
21
|
this.enabled = true;
|
|
22
|
+
/**
|
|
23
|
+
* Define se o label será apresentado no display do componente.
|
|
24
|
+
*/
|
|
25
|
+
this.showLabel = false;
|
|
26
|
+
/**
|
|
27
|
+
* Define se na opção selecionada apresentará um ícone de check.
|
|
28
|
+
*/
|
|
29
|
+
this.checkOption = false;
|
|
30
|
+
/**
|
|
31
|
+
* Define se o background do botão será transparent.
|
|
32
|
+
*/
|
|
33
|
+
this.isTransparent = false;
|
|
34
|
+
/**
|
|
35
|
+
* Define se o elemento contará com a seta de orientação
|
|
36
|
+
*/
|
|
37
|
+
this.arrowActive = false;
|
|
21
38
|
this.innerClickCheck = (floatingContainer, node) => {
|
|
39
|
+
var _a;
|
|
22
40
|
if (node && floatingContainer) {
|
|
23
41
|
if (node === floatingContainer) {
|
|
24
42
|
return true;
|
|
25
43
|
}
|
|
26
44
|
const children = floatingContainer.children;
|
|
27
45
|
for (let i = 0; i < children.length; i++) {
|
|
28
|
-
if (children[i].shadowRoot.contains(node)) {
|
|
46
|
+
if ((_a = children[i].shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(node)) {
|
|
29
47
|
return true;
|
|
30
48
|
}
|
|
31
49
|
}
|
|
@@ -33,25 +51,44 @@ let EzActionsButton = class {
|
|
|
33
51
|
return false;
|
|
34
52
|
};
|
|
35
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Oculta a lista de ações
|
|
56
|
+
*/
|
|
57
|
+
async hideActions() {
|
|
58
|
+
if (this._floatingID != undefined) {
|
|
59
|
+
core.FloatingManager.close(this._floatingID);
|
|
60
|
+
}
|
|
61
|
+
this._floatingID = undefined;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Verifica se a lista de ações está oculta
|
|
65
|
+
*/
|
|
66
|
+
async isOpened() {
|
|
67
|
+
return this._floatingID != undefined;
|
|
68
|
+
}
|
|
36
69
|
showActions() {
|
|
70
|
+
var _a, _b;
|
|
37
71
|
if (!this.enabled) {
|
|
38
72
|
return;
|
|
39
73
|
}
|
|
40
|
-
|
|
74
|
+
const boundingHost = (_a = this._element) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
75
|
+
let posLeft = boundingHost ? (boundingHost.x - (this.arrowActive ? 5 : 0)) + "px" : null;
|
|
76
|
+
let options = { autoClose: true, innerClickTest: this.innerClickCheck, isFixed: true, left: posLeft };
|
|
77
|
+
this._floatingID = core.FloatingManager.float(this._actionsList, this._listContainer, options);
|
|
41
78
|
const docWidth = document.body.clientWidth;
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
|
|
79
|
+
const boundingList = (_b = this._actionsList) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
|
80
|
+
if ((boundingList === null || boundingList === void 0 ? void 0 : boundingList.right) > docWidth) {
|
|
81
|
+
posLeft = (docWidth - boundingList.width) + "px";
|
|
82
|
+
options = { autoClose: true, innerClickTest: this.innerClickCheck, left: posLeft };
|
|
83
|
+
core.FloatingManager.updateFloatPosition(this._actionsList, this._listContainer, options);
|
|
45
84
|
}
|
|
46
85
|
window.requestAnimationFrame(() => {
|
|
47
86
|
this._actionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
48
87
|
});
|
|
49
88
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
this._floatingID = undefined;
|
|
89
|
+
hasLabelOrCheckOption() {
|
|
90
|
+
var _a;
|
|
91
|
+
return (this.showLabel || this.checkOption) && ((_a = this.actions) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
55
92
|
}
|
|
56
93
|
//---------------------------------------------
|
|
57
94
|
// Event handlers
|
|
@@ -60,6 +97,7 @@ let EzActionsButton = class {
|
|
|
60
97
|
this.showActions();
|
|
61
98
|
}
|
|
62
99
|
actionClick(action) {
|
|
100
|
+
this._selectedAction = action;
|
|
63
101
|
this.hideActions();
|
|
64
102
|
this.ezAction.emit(action);
|
|
65
103
|
}
|
|
@@ -90,9 +128,23 @@ let EzActionsButton = class {
|
|
|
90
128
|
if (this._floatingID == undefined) {
|
|
91
129
|
this._actionsList.remove();
|
|
92
130
|
}
|
|
131
|
+
if (this.hasLabelOrCheckOption()) {
|
|
132
|
+
if (!!this.value) {
|
|
133
|
+
this._selectedAction = this.actions.find((action) => action.value === this.value);
|
|
134
|
+
}
|
|
135
|
+
else if (!!!this._selectedAction) {
|
|
136
|
+
this._selectedAction = this.actions[0];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
93
139
|
}
|
|
94
140
|
render() {
|
|
95
|
-
|
|
141
|
+
var _a;
|
|
142
|
+
return (index.h(index.Host, null, index.h("ez-button", { ref: elem => this._button = elem, class: this.isTransparent ? "ez-actions-button__btn-transparent" : "", label: this.showLabel && ((_a = this._selectedAction) === null || _a === void 0 ? void 0 : _a.label), enabled: this.enabled, mode: this.showLabel ? "" : "icon", iconName: this.showLabel ? "" : this.iconName || "dots-vertical", size: this.size, onClick: () => this.handlerButtonClick() }, this.showLabel &&
|
|
143
|
+
index.h("ez-icon", { class: "ez-actions-button__icon-left", slot: "rightIcon", iconName: this.iconName || "dots-vertical" })), index.h("section", { class: "ez-actions-button__list-container", ref: elem => this._listContainer = elem }, index.h("div", { class: "ez-actions-button__actions-list", ref: elem => this._actionsList = elem }, this.arrowActive && index.h("div", { class: "ez-actions-button__arrow" }), this.actions.map(action => {
|
|
144
|
+
var _a;
|
|
145
|
+
return index.h("ez-button", { class: "ez-actions-button__btn-action", size: "small", label: action.label, onClick: () => this.actionClick(action) }, this.checkOption && ((_a = this._selectedAction) === null || _a === void 0 ? void 0 : _a.value) === action.value &&
|
|
146
|
+
index.h("ez-icon", { class: "ez-actions-button__icon-right", slot: "leftIcon", iconName: "check" }));
|
|
147
|
+
})))));
|
|
96
148
|
}
|
|
97
149
|
get _element() { return index.getElement(this); }
|
|
98
150
|
};
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8646c40d.js');
|
|
6
6
|
|
|
7
|
-
const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:0px;--ez-button--padding-bottom:0px;--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:
|
|
7
|
+
const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:0px;--ez-button--padding-bottom:0px;--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}";
|
|
8
8
|
|
|
9
9
|
let EzButton = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -38,18 +38,20 @@ let EzButton = class {
|
|
|
38
38
|
handleSlotChange(ev) {
|
|
39
39
|
const slot = ev.target;
|
|
40
40
|
const content = slot.assignedElements()[0];
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
if (!!content) {
|
|
42
|
+
if (this.mode == "link") {
|
|
43
|
+
content.style.display = "inline";
|
|
44
|
+
if (slot.name == "leftIcon") {
|
|
45
|
+
content.style.paddingRight = "var(--ez-button__inline__icon--padding)";
|
|
46
|
+
}
|
|
47
|
+
else if (slot.name == "rightIcon") {
|
|
48
|
+
content.style.paddingLeft = "var(--ez-button__inline__icon--padding)";
|
|
49
|
+
}
|
|
45
50
|
}
|
|
46
|
-
else
|
|
47
|
-
content.style.
|
|
51
|
+
else {
|
|
52
|
+
content.style.setProperty("--ez-icon--color", "var(--ez-icon--color)");
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
|
-
else {
|
|
51
|
-
content.style.setProperty("--ez-icon--color", "var(--ez-icon--color)");
|
|
52
|
-
}
|
|
53
55
|
}
|
|
54
56
|
render() {
|
|
55
57
|
if (this.mode == "icon") {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-8646c40d.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
|
|
8
|
-
const ezCalendarCss = ":host{--ez-calendar--font-family:var(--font-pattern, Arial);--ez-calendar--color:var(--title--primary, #626e82);--ez-calendar--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-calendar__body--background-color:var(--background--xlight, #FFF);--ez-calendar__time--background-color:var(--background--xlight, #FAFAFA);--ez-calendar__body--padding:var(--space--medium, 12px) var(--space--small, 6px);--ez-calendar__body--border-radius:var(--border--radius-medium, 12px);--ez-calendar__body--shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-container--z-index:var(--more-visible, 2);--ez-calendar__header-line--stroke:1px;--ez-calendar__header-line--color:var(--color--strokes, #C0C0C0);--ez-calendar__nav-btn--fill:var(--text--primary, #008561);--ez-calendar__nav-btn--hover--fill:var(--color--primary, #350404);--ez-calendar__nav-btn--width:10px;--ez-calendar__nav-btn--height:16px;--ez-calendar__nav-btn--previous-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--ez-calendar__nav-btn--next-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--ez-calendar__cell--margin:0px 1.5px;--ez-calendar__cell--width:var(--space--large, 24px);--ez-calendar__cell--padding:1.5px 0px;--ez-calendar__cell--border-radius:var(--border--radius-small, 6px);--ez-calendar__cell--over--background-color:var(--color--primary, #E2F4EF);--ez-calendar__cell--over--color:var(--color--primary-300, #008561);--ez-calendar__cell--outset--color:var(--color--disable-primary, #E5EAF0);--ez-calendar__cell--selected--background-color:var(--color--primary, #008561);--ez-calendar__cell--selected--color:var(--color--inverted, #FFF);--ez-calendar__btn-today--color:var(--color--primary);--ez-calendar__btn-today--hover--background-color:var(--color--primary-300, #E2F4EF);--ez-calendar__btn-today--border-radius:var(--border--radius-small, 6px);position:relative;display:flex;user-select:none}.calendar__container{display:flex;z-index:var(--more-visible, 2)}.calendar{z-index:var(--more-visible, 2);
|
|
8
|
+
const ezCalendarCss = ":host{--ez-calendar--font-family:var(--font-pattern, Arial);--ez-calendar--color:var(--title--primary, #626e82);--ez-calendar--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-calendar__body--background-color:var(--background--xlight, #FFF);--ez-calendar__time--background-color:var(--background--xlight, #FAFAFA);--ez-calendar__body--padding:var(--space--medium, 12px) var(--space--small, 6px);--ez-calendar__body--border-radius:var(--border--radius-medium, 12px);--ez-calendar__body--shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-container--z-index:var(--more-visible, 2);--ez-calendar__header-line--stroke:1px;--ez-calendar__header-line--color:var(--color--strokes, #C0C0C0);--ez-calendar__nav-btn--fill:var(--text--primary, #008561);--ez-calendar__nav-btn--hover--fill:var(--color--primary, #350404);--ez-calendar__nav-btn--width:10px;--ez-calendar__nav-btn--height:16px;--ez-calendar__nav-btn--previous-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--ez-calendar__nav-btn--next-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--ez-calendar__cell--margin:0px 1.5px;--ez-calendar__cell--width:var(--space--large, 24px);--ez-calendar__cell--padding:1.5px 0px;--ez-calendar__cell--border-radius:var(--border--radius-small, 6px);--ez-calendar__cell--over--background-color:var(--color--primary, #E2F4EF);--ez-calendar__cell--over--color:var(--color--primary-300, #008561);--ez-calendar__cell--outset--color:var(--color--disable-primary, #E5EAF0);--ez-calendar__cell--selected--background-color:var(--color--primary, #008561);--ez-calendar__cell--selected--color:var(--color--inverted, #FFF);--ez-calendar__btn-today--color:var(--color--primary);--ez-calendar__btn-today--hover--background-color:var(--color--primary-300, #E2F4EF);--ez-calendar__btn-today--border-radius:var(--border--radius-small, 6px);position:relative;display:flex;user-select:none}.calendar__container{display:flex;z-index:var(--more-visible, 2)}.calendar{display:flex;flex-direction:column;z-index:var(--more-visible, 2);background-color:var(--ez-calendar__body--background-color);padding:var(--ez-calendar__body--padding);border-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__header{display:flex;justify-content:space-between;padding-bottom:var(--space--small, 6px);margin:0px var(--space--, 12px) var(--space--small, 6px) var(--space--, 12px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color)}.calendar__btn-next,.calendar__btn-previous{outline:none;border:none;background-color:unset;cursor:pointer;padding:0px}.calendar__btn-next::after,.calendar__btn-previous::after{content:'';display:flex;background-color:var(--ez-calendar__nav-btn--fill);width:var(--ez-calendar__nav-btn--width);height:var(--ez-calendar__nav-btn--height)}.calendar__btn-previous::after{-webkit-mask-image:var(--ez-calendar__nav-btn--previous-image);mask-image:var(--ez-calendar__nav-btn--previous-image)}.calendar__btn-next::after{-webkit-mask-image:var(--ez-calendar__nav-btn--next-image);mask-image:var(--ez-calendar__nav-btn--next-image)}.calendar__btn-next:hover::after,.calendar__btn-previous:hover::after{background-color:var(--ez-calendar__nav-btn--hover--fill)}.calendar__lbl-month{font-weight:var(--text-weight--extra-large, 700);font-size:var(--title--small, 14px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__line{display:flex;padding:0px;margin:0px}.calendar__cell{display:flex;justify-content:center;align-content:center;cursor:pointer;font-size:var(--text--extra-small, 10px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);padding:var(--ez-calendar__cell--padding);margin:var(--ez-calendar__cell--margin);min-width:var(--ez-calendar__cell--width);border-radius:var(--ez-calendar__cell--border-radius)}.calendar__cell:hover{background-color:var(--ez-calendar__cell--over--background-color);color:var(--ez-calendar__cell--over--color)}.calendar__cell--secondary{color:var(--ez-calendar__cell--outset--color)}.calendar__cell--unselectable:hover{background-color:unset;border-radius:unset;cursor:unset;color:var(--ez-calendar--color)}.calendar__cell--unselectable{font-weight:var(--text-weight--large, 600);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__cell--selected,.calendar__cell--selected:hover{background-color:var(--ez-calendar__cell--selected--background-color);color:var(--ez-calendar__cell--selected--color)}.calendar__footer{display:flex;flex-direction:column}.calendar__btn-today{border:none;background-color:unset;cursor:pointer;padding:0px;font-weight:var(--text-weight--large, 600);font-size:var(--title--extra-small, 12px);font-family:var(--ez-calendar--font-family);text-shadow:var(--ez-calendar--text-shadow);color:var(--ez-calendar__btn-today--color);border-radius:var(--ez-calendar__btn-today--border-radius)}.calendar__btn-today:hover{background-color:var(--ez-calendar__btn-today--hover--background-color)}section{display:flex}.calendar-time{margin-left:-10px;display:flex;flex-direction:column;padding:12px 0px 0px 10px;background-color:var(--ez-calendar__time--background-color);border-top-right-radius:var(--ez-calendar__body--border-radius);border-bottom-right-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__column{height:136px;padding:0px;margin:0px;overflow:auto}.calendar__column::-webkit-scrollbar{width:0px;max-width:0px;min-width:0px}.calendar-time__header{display:flex;justify-content:space-between;padding-left:var(--space--small, 6px);padding-right:var(--space--small, 6px);padding-bottom:var(--space--small, 6px);margin:0px var(--space--, 12px) var(--space--small, 6px) var(--space--, 12px);font-weight:var(--text-weight--extra-large, 700);font-size:var(--title--small, 14px);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.separatorTime{color:#A2ABB9;padding:0px 1px;line-height:16px;font-size:17px;font-weight:normal}.endHidden{-webkit-mask-image:linear-gradient(180deg, #000 calc(100% - 48px), transparent 100%)}.calendar__column .calendar__cell{margin:0px;padding:1.5px 1.5px}";
|
|
9
9
|
|
|
10
10
|
let EzCalendar = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8646c40d.js');
|
|
6
6
|
|
|
7
|
-
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;white-space:nowrap;align-items:center;
|
|
7
|
+
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;white-space:nowrap;align-items:center;cursor:pointer;user-select:none;color:var(--ez-label-chip__label--title--primary);height:var(--ez-label-chip--height);font-family:var(--ez-label-chip__label--font-family);font-size:var(--ez-label-chip__label--font-size);font-weight:var(--ez-label-chip__label--font-weight)}.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:max-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);outline-color:var(--ez-label-chip__label__container--default--border-color--active)}.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}";
|
|
8
8
|
|
|
9
9
|
let EzChip = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -3,13 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8646c40d.js');
|
|
6
|
+
const ApplicationUtils = require('./ApplicationUtils-edc62c5c.js');
|
|
7
|
+
require('./DialogType-aa435c52.js');
|
|
8
|
+
require('./FieldBuilder-cd3e45ed.js');
|
|
9
|
+
require('@sankhyalabs/core');
|
|
6
10
|
|
|
7
|
-
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}";
|
|
11
|
+
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
12
|
|
|
9
13
|
let EzCollapsibleBox = class {
|
|
10
14
|
constructor(hostRef) {
|
|
11
15
|
index.registerInstance(this, hostRef);
|
|
12
16
|
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
17
|
+
this.ezRemove = index.createEvent(this, "ezRemove", 7);
|
|
18
|
+
this.ezSaveEditLabel = index.createEvent(this, "ezSaveEditLabel", 7);
|
|
19
|
+
this.ezEditLabelMode = index.createEvent(this, "ezEditLabelMode", 7);
|
|
20
|
+
this._activeEditText = false;
|
|
13
21
|
/**
|
|
14
22
|
* Valor externalizado que garante a exibição ou não do componente.
|
|
15
23
|
*/
|
|
@@ -26,9 +34,14 @@ let EzCollapsibleBox = class {
|
|
|
26
34
|
* Define se o titulo irá ocupar toda a largura do componente.
|
|
27
35
|
*/
|
|
28
36
|
this.stretchTitle = false;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Ativa o ícone para remoção do componente.
|
|
39
|
+
*/
|
|
40
|
+
this.removable = false;
|
|
41
|
+
/**
|
|
42
|
+
* Ativa o ícone para edição do componente.
|
|
43
|
+
*/
|
|
44
|
+
this.editable = false;
|
|
32
45
|
}
|
|
33
46
|
/**
|
|
34
47
|
* Esconde ou revela o conteúdo do componente.
|
|
@@ -36,6 +49,23 @@ let EzCollapsibleBox = class {
|
|
|
36
49
|
async showHide() {
|
|
37
50
|
this.value = !this.value;
|
|
38
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Aplica focus no campo de edição de título.
|
|
54
|
+
*/
|
|
55
|
+
async applyFocusTextEdit() {
|
|
56
|
+
var _a;
|
|
57
|
+
(_a = this._refTextEdit) === null || _a === void 0 ? void 0 : _a.applyFocusSelect();
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Fecha a edição de título.
|
|
61
|
+
*/
|
|
62
|
+
async cancelEdition() {
|
|
63
|
+
this._activeEditText = false;
|
|
64
|
+
this.ezEditLabelMode.emit(this._activeEditText);
|
|
65
|
+
}
|
|
66
|
+
observeCollapsedValue() {
|
|
67
|
+
this.ezChange.emit(this.value);
|
|
68
|
+
}
|
|
39
69
|
/**
|
|
40
70
|
* Retorna o tamanho configurado do texto e do ícone.
|
|
41
71
|
*/
|
|
@@ -46,12 +76,61 @@ let EzCollapsibleBox = class {
|
|
|
46
76
|
const sizeCustom = sizeAlias.includes(sizeLowerCase) ? sizeLowerCase.replace('x', 'x-') : sizeLowerCase;
|
|
47
77
|
return sizeList.includes(sizeCustom) ? sizeCustom : "small";
|
|
48
78
|
}
|
|
79
|
+
removeElement() {
|
|
80
|
+
this._hostElement && this._hostElement.remove();
|
|
81
|
+
this.ezRemove.emit(this);
|
|
82
|
+
}
|
|
83
|
+
editLabel(evt) {
|
|
84
|
+
evt.preventDefault();
|
|
85
|
+
evt.stopPropagation();
|
|
86
|
+
this._activeEditText = true;
|
|
87
|
+
this.ezEditLabelMode.emit(this._activeEditText);
|
|
88
|
+
}
|
|
89
|
+
confirmRemove(evt) {
|
|
90
|
+
evt.preventDefault();
|
|
91
|
+
evt.stopPropagation();
|
|
92
|
+
ApplicationUtils.ApplicationUtils.confirm("Aviso", `Deseja realmente remover o grupo <b>${this.label}</b>?`)
|
|
93
|
+
.then((canRemove) => {
|
|
94
|
+
if (canRemove) {
|
|
95
|
+
this.removeElement();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
saveEditionText(editDetails) {
|
|
100
|
+
const { newValue } = editDetails.detail;
|
|
101
|
+
let canSave = true;
|
|
102
|
+
if (this.conditionalSave) {
|
|
103
|
+
canSave = this.conditionalSave(newValue);
|
|
104
|
+
}
|
|
105
|
+
if (this.label !== newValue && canSave) {
|
|
106
|
+
this.label = newValue;
|
|
107
|
+
this._activeEditText = false;
|
|
108
|
+
this.ezSaveEditLabel.emit(editDetails.detail);
|
|
109
|
+
this.ezEditLabelMode.emit(this._activeEditText);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
getStyledLabel() {
|
|
113
|
+
if (this._refLabel == undefined) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
let styledLabel = {
|
|
117
|
+
fontSize: window.getComputedStyle(this._refLabel).getPropertyValue('font-size'),
|
|
118
|
+
fontWeight: window.getComputedStyle(this._refLabel).getPropertyValue('font-weight'),
|
|
119
|
+
fontFamily: window.getComputedStyle(this._refLabel).getPropertyValue('font-family')
|
|
120
|
+
};
|
|
121
|
+
return styledLabel;
|
|
122
|
+
}
|
|
49
123
|
render() {
|
|
50
|
-
return (index.h("div", { class: "collapsible-box" }, index.h("div", { class: "collapsible-box__header" }, index.h("button", { onClick: () => this.showHide(), class: "collapsible-box__title" +
|
|
124
|
+
return (index.h("div", { class: "collapsible-box" }, index.h("div", { class: "collapsible-box__header" }, index.h("button", Object.assign({}, (!this._activeEditText ? { onClick: () => { this.showHide(); } } : null), { class: "collapsible-box__title" +
|
|
51
125
|
(this.iconPlacement === "right" ? " collapsible-box__title--icon-right" : "") +
|
|
52
126
|
(this.stretchTitle ? " collapsible-box__title--stretched" : "") +
|
|
53
|
-
(this.value ? " collapsible-box__title--no-margin" : "") }, index.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" : "") }),
|
|
127
|
+
(this.value ? " collapsible-box__title--no-margin" : "") }), index.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" : "") }), !this._activeEditText ?
|
|
128
|
+
index.h("label", { class: "collapsible-box__label font--" + this.getHeaderSize(), title: this.label, ref: elem => this._refLabel = elem }, index.h("span", null, this.label), this.editable &&
|
|
129
|
+
index.h("ez-icon", { slot: "icon", "icon-name": "edit", onClick: (evt) => this.editLabel(evt), title: "Editar" }), this.removable &&
|
|
130
|
+
index.h("ez-icon", { slot: "icon", "icon-name": "delete", onClick: (evt) => this.confirmRemove(evt), title: "Remover" })) :
|
|
131
|
+
index.h("ez-text-edit", { class: "collapsible-box__text-edit", ref: ref => this._refTextEdit = ref, value: this.label, styled: this.getStyledLabel(), onSaveEdition: (ev) => this.saveEditionText(ev), onCancelEdition: () => this.cancelEdition() }))), index.h("div", { class: "collapsible-box__content" + (this.value ? "" : " collapsible-box__content--show") }, index.h("slot", null))));
|
|
54
132
|
}
|
|
133
|
+
get _hostElement() { return index.getElement(this); }
|
|
55
134
|
static get watchers() { return {
|
|
56
135
|
"value": ["observeCollapsedValue"]
|
|
57
136
|
}; }
|
|
@@ -7,8 +7,9 @@ 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('./FieldBuilder-cd3e45ed.js');
|
|
10
11
|
|
|
11
|
-
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)}.
|
|
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)}}";
|
|
12
13
|
|
|
13
14
|
let EzComboBox = class {
|
|
14
15
|
constructor(hostRef) {
|
|
@@ -141,11 +142,11 @@ let EzComboBox = class {
|
|
|
141
142
|
return 0;
|
|
142
143
|
}
|
|
143
144
|
getWidthValue(value) {
|
|
144
|
-
if (this._itemValueBasis) {
|
|
145
|
+
if (this._itemValueBasis != undefined) {
|
|
145
146
|
const span = this._itemValueBasis;
|
|
146
|
-
if (value) {
|
|
147
|
+
if (value != undefined) {
|
|
147
148
|
span.innerHTML = value;
|
|
148
|
-
return span.clientWidth > 0 ? (span.clientWidth +
|
|
149
|
+
return span.clientWidth > 0 ? (span.clientWidth + 2) : 0;
|
|
149
150
|
}
|
|
150
151
|
else {
|
|
151
152
|
span.innerHTML = "";
|
|
@@ -154,8 +155,9 @@ let EzComboBox = class {
|
|
|
154
155
|
return 0;
|
|
155
156
|
}
|
|
156
157
|
buildItem(opt, index$1) {
|
|
158
|
+
const widthValue = this.showOptionValue && this._maxWidthValue > 0 ? `${this._maxWidthValue}px` : '';
|
|
157
159
|
return index.h("li", { class: index$1 === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = undefined }, this.showOptionValue
|
|
158
|
-
? index.h("span", { class: "item__value", title: opt.value, style: { width:
|
|
160
|
+
? index.h("span", { class: "item__value", title: opt.value, style: { width: widthValue, minWidth: widthValue, maxWidth: widthValue } }, opt.value)
|
|
159
161
|
: undefined, index.h("span", { class: "item__label", title: opt.label }, opt.label));
|
|
160
162
|
}
|
|
161
163
|
showOptions() {
|
|
@@ -255,6 +257,7 @@ let EzComboBox = class {
|
|
|
255
257
|
}
|
|
256
258
|
else {
|
|
257
259
|
this.setInputValue();
|
|
260
|
+
this.hideOptions();
|
|
258
261
|
}
|
|
259
262
|
if (this.searchMode) {
|
|
260
263
|
this._visibleOptions = [];
|
|
@@ -267,7 +270,8 @@ let EzComboBox = class {
|
|
|
267
270
|
this._criteria = argument;
|
|
268
271
|
this._startLoading = true;
|
|
269
272
|
if (this.optionLoader) {
|
|
270
|
-
|
|
273
|
+
const searchArgument = { mode, argument };
|
|
274
|
+
this.updateSource(this.optionLoader(searchArgument));
|
|
271
275
|
}
|
|
272
276
|
else {
|
|
273
277
|
this.updateSource(this.options);
|