@sankhyalabs/ezui 5.20.0-dev.2 → 5.20.0-dev.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/README.md +4 -5
- package/dist/cjs/{CSSVarsUtils-b136a156.js → CSSVarsUtils-10c9d5b4.js} +13 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert-list.cjs.entry.js +33 -28
- package/dist/cjs/ez-card-item_3.cjs.entry.js +6 -5
- package/dist/cjs/ez-combo-box.cjs.entry.js +8 -7
- package/dist/cjs/ez-date-input.cjs.entry.js +4 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +4 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +34 -15
- package/dist/cjs/ez-grid.cjs.entry.js +85 -30
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +2 -10
- package/dist/cjs/ez-number-input.cjs.entry.js +4 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +7 -8
- package/dist/cjs/ez-split-button.cjs.entry.js +147 -0
- package/dist/cjs/ez-split-item.cjs.entry.js +20 -2
- package/dist/cjs/ez-split-panel.cjs.entry.js +15 -12
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/filter-column.cjs.entry.js +16 -5
- package/dist/cjs/index-a7b0c73d.js +8 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +33 -28
- package/dist/collection/components/ez-card-item/ez-card-item.css +39 -6
- package/dist/collection/components/ez-card-item/ez-card-item.js +22 -3
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +1 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +7 -6
- package/dist/collection/components/ez-date-input/ez-date-input.js +3 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +3 -0
- package/dist/collection/components/ez-form-view/ez-form-view.css +17 -1
- package/dist/collection/components/ez-form-view/ez-form-view.js +22 -5
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +3 -3
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +4 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +12 -11
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +15 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js +1 -3
- package/dist/collection/components/ez-grid/ez-grid.css +10 -1
- package/dist/collection/components/ez-grid/ez-grid.js +61 -10
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +16 -5
- package/dist/collection/components/ez-icon/ez-icon.css +1 -1
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +2 -10
- package/dist/collection/components/ez-number-input/ez-number-input.js +3 -0
- package/dist/collection/components/ez-popup/ez-popup.css +2 -5
- package/dist/collection/components/ez-search/ez-search.css +2 -1
- package/dist/collection/components/ez-search/ez-search.js +5 -6
- package/dist/collection/components/ez-split-button/ez-split-button.css +229 -0
- package/dist/collection/components/ez-split-button/ez-split-button.js +436 -0
- package/dist/collection/components/ez-split-button/test/dropdownItems.js +42 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.css +6 -7
- package/dist/collection/components/ez-split-panel/ez-split-panel.js +35 -14
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +47 -12
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +82 -2
- package/dist/collection/utils/CSSVarsUtils.js +13 -0
- package/dist/collection/utils/form/test/DataBinder.test.js +9 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +388 -124
- package/dist/esm/{CSSVarsUtils-a97cfa29.js → CSSVarsUtils-71ce76be.js} +13 -0
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-alert-list.entry.js +33 -28
- package/dist/esm/ez-card-item_3.entry.js +6 -5
- package/dist/esm/ez-combo-box.entry.js +8 -7
- package/dist/esm/ez-date-input.entry.js +4 -1
- package/dist/esm/ez-date-time-input.entry.js +4 -1
- package/dist/esm/ez-form-view.entry.js +35 -16
- package/dist/esm/ez-grid.entry.js +86 -31
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +2 -10
- package/dist/esm/ez-number-input.entry.js +4 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +7 -8
- package/dist/esm/ez-split-button.entry.js +143 -0
- package/dist/esm/ez-split-item.entry.js +20 -2
- package/dist/esm/ez-split-panel.entry.js +15 -12
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/filter-column.entry.js +16 -5
- package/dist/esm/index-baa5e267.js +8 -4
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-f56dd1da.entry.js → p-07cbffce.entry.js} +1 -1
- package/dist/ezui/p-13dbad96.entry.js +1 -0
- package/dist/ezui/p-2eb8f73b.entry.js +1 -0
- package/dist/ezui/{p-40f72de4.entry.js → p-784fe207.entry.js} +1 -1
- package/dist/ezui/{p-6e2f8e6b.entry.js → p-79bbf86d.entry.js} +2 -2
- package/dist/ezui/p-7af81663.entry.js +1 -0
- package/dist/ezui/p-801fd0f8.entry.js +1 -0
- package/dist/ezui/p-807560f0.entry.js +1 -0
- package/dist/ezui/p-940ed30b.entry.js +1 -0
- package/dist/ezui/{p-eb36f072.entry.js → p-99ead599.entry.js} +1 -1
- package/dist/ezui/{p-7eb3e1a5.js → p-9e11fc7b.js} +1 -1
- package/dist/ezui/p-9f1e89c9.entry.js +1 -0
- package/dist/ezui/{p-51c5e071.entry.js → p-abc23d6f.entry.js} +1 -1
- package/dist/ezui/p-af95cd16.entry.js +1 -0
- package/dist/ezui/{p-c0f1715f.entry.js → p-b567fa8c.entry.js} +1 -1
- package/dist/ezui/p-b9fbf4e7.entry.js +1 -0
- package/dist/ezui/p-baf80b13.entry.js +1 -0
- package/dist/ezui/p-db77a984.entry.js +1 -0
- package/dist/ezui/{p-9cad9b6e.entry.js → p-e85c48d7.entry.js} +1 -1
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +1 -1
- package/dist/types/components/ez-card-item/ez-card-item.d.ts +4 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +3 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +2 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +14 -2
- package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +4 -1
- package/dist/types/components/ez-multi-selection-list/ez-multi-selection-list.d.ts +0 -1
- package/dist/types/components/ez-split-button/ez-split-button.d.ts +89 -0
- package/dist/types/components/ez-split-button/test/dropdownItems.d.ts +2 -0
- package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +23 -0
- package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +27 -0
- package/dist/types/components.d.ts +155 -0
- package/dist/types/utils/CSSVarsUtils.d.ts +1 -0
- package/dist/types/utils/form/test/DataBinder.test.d.ts +1 -0
- package/package.json +13 -5
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridUtils.js +0 -8
- package/dist/ezui/p-133fae4a.entry.js +0 -1
- package/dist/ezui/p-24d3fede.entry.js +0 -1
- package/dist/ezui/p-43b03119.entry.js +0 -1
- package/dist/ezui/p-4a7f113d.entry.js +0 -1
- package/dist/ezui/p-596634e9.entry.js +0 -1
- package/dist/ezui/p-76ba9d67.entry.js +0 -1
- package/dist/ezui/p-796c1a88.entry.js +0 -1
- package/dist/ezui/p-af15c277.entry.js +0 -1
- package/dist/ezui/p-ba875f37.entry.js +0 -1
- package/dist/ezui/p-d6ffe679.entry.js +0 -1
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridUtils.d.ts +0 -1
|
@@ -210,14 +210,15 @@ export class EzComboBox {
|
|
|
210
210
|
const upperCriteria = this._criteria.toUpperCase();
|
|
211
211
|
opts = opts.filter(opt => opt.label.toLocaleUpperCase().indexOf(upperCriteria) > -1);
|
|
212
212
|
}
|
|
213
|
-
if (this.
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
this._visibleOptions = [{ value: undefined, label: "" }].concat(opts);
|
|
213
|
+
if (this.hasToAddEmptyoption(opts)) {
|
|
214
|
+
opts = [{ value: undefined, label: "" }].concat(opts);
|
|
218
215
|
}
|
|
216
|
+
this._visibleOptions = opts;
|
|
219
217
|
this._maxWidthValue = this.getMaxWidthValue();
|
|
220
218
|
}
|
|
219
|
+
hasToAddEmptyoption(opts) {
|
|
220
|
+
return !this.suppressEmptyOption && !opts.filter(opt => !opt.value).length;
|
|
221
|
+
}
|
|
221
222
|
getMaxWidthValue() {
|
|
222
223
|
var _a;
|
|
223
224
|
if (this.showOptionValue) {
|
|
@@ -358,7 +359,7 @@ export class EzComboBox {
|
|
|
358
359
|
}
|
|
359
360
|
else {
|
|
360
361
|
window.setTimeout(() => {
|
|
361
|
-
this.setInputValue();
|
|
362
|
+
this.setInputValue(false);
|
|
362
363
|
}, this._deboucingTime);
|
|
363
364
|
}
|
|
364
365
|
this.resetOptions();
|
|
@@ -152,6 +152,9 @@ export class EzDateTimeInput {
|
|
|
152
152
|
}
|
|
153
153
|
handleBlur() {
|
|
154
154
|
var _a, _b;
|
|
155
|
+
if (!this._changePending) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
155
158
|
try {
|
|
156
159
|
const strValue = ((_b = (_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.trim()) || "";
|
|
157
160
|
const newValue = this.getParsedDateTime();
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
display: flex;
|
|
3
|
-
flex-direction: row;
|
|
4
3
|
flex-wrap: wrap;
|
|
5
4
|
width: 100%;
|
|
5
|
+
|
|
6
|
+
/*@doc Define o tamanho mínimo dos itens do formulário.*/
|
|
7
|
+
--ez-form-view__item--min-width: 220px;
|
|
8
|
+
/*@doc Define o espaçamento entre itens do formulário.*/
|
|
9
|
+
--ez-form-view__item--sapce-width: 5px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.form-view__content{
|
|
13
|
+
display: grid;
|
|
14
|
+
grid-template-columns: repeat(auto-fill, minmax(var(--ez-form-view__item--min-width), 1fr));
|
|
15
|
+
gap: var(--ez-form-view__item--sapce-width);
|
|
16
|
+
width: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.input-full_width {
|
|
20
|
+
grid-column: 1 / -1;
|
|
21
|
+
width: 100%;
|
|
6
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Host, h } from '@stencil/core';
|
|
2
2
|
import { fieldBuilder } from './fieldbuilder/FieldBuilder';
|
|
3
|
-
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
+
import { ElementIDUtils, UserInterface } from '@sankhyalabs/core';
|
|
4
4
|
import { FormItems } from './structure';
|
|
5
5
|
export class EzFormView {
|
|
6
6
|
constructor() {
|
|
@@ -32,19 +32,36 @@ export class EzFormView {
|
|
|
32
32
|
const formItems = new FormItems(Array.from(this._element.querySelectorAll("[data-form-item]")));
|
|
33
33
|
this.formItemsReady.emit(formItems);
|
|
34
34
|
}
|
|
35
|
+
isItemFullWidth(userInterface) {
|
|
36
|
+
return [
|
|
37
|
+
UserInterface.FILE,
|
|
38
|
+
UserInterface.LONGTEXT
|
|
39
|
+
].includes(userInterface);
|
|
40
|
+
}
|
|
41
|
+
buildFormItemElement(item, classItem = "") {
|
|
42
|
+
if (this.isItemFullWidth(item.userInterface)) {
|
|
43
|
+
classItem += " input-full_width";
|
|
44
|
+
}
|
|
45
|
+
return h("div", { class: classItem }, fieldBuilder(item));
|
|
46
|
+
}
|
|
35
47
|
render() {
|
|
36
48
|
ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
|
|
37
49
|
if (this.fields == undefined) {
|
|
38
50
|
return;
|
|
39
51
|
}
|
|
40
|
-
|
|
52
|
+
let nonArrayGrup = [];
|
|
53
|
+
let formContent = Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
|
|
41
54
|
if (Array.isArray(value)) {
|
|
42
|
-
return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, value.map(fi =>
|
|
55
|
+
return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, h("div", { class: "form-view__content" }, value.map(fi => (this.buildFormItemElement(fi))))));
|
|
43
56
|
}
|
|
44
57
|
else {
|
|
45
|
-
|
|
58
|
+
nonArrayGrup.push(value);
|
|
46
59
|
}
|
|
47
|
-
})
|
|
60
|
+
});
|
|
61
|
+
// Filtra os elementos que não são arrays e os coloca dentro de uma única div
|
|
62
|
+
let nonArrayElements = nonArrayGrup.map((value) => this.buildFormItemElement(value));
|
|
63
|
+
let groupedNonArrayElements = h("div", { class: "form-view__content" }, nonArrayElements);
|
|
64
|
+
return (h(Host, null, groupedNonArrayElements, formContent));
|
|
48
65
|
}
|
|
49
66
|
static get is() { return "ez-form-view"; }
|
|
50
67
|
static get encapsulation() { return "scoped"; }
|
|
@@ -7,5 +7,5 @@ export const buildCheckBox = (field) => {
|
|
|
7
7
|
return buildField(field.name, field.label, field.readOnly, field.contextName, false);
|
|
8
8
|
};
|
|
9
9
|
function buildField(fieldName, fieldLabel, readOnly, contextName, switchMode) {
|
|
10
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
10
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" }, h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName })));
|
|
11
11
|
}
|
|
@@ -9,5 +9,5 @@ export const buildComboBox = ({ name, label, readOnly, required, props, contextN
|
|
|
9
9
|
else {
|
|
10
10
|
options = prop;
|
|
11
11
|
}
|
|
12
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
12
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, options: options, canShowError: canShowError })));
|
|
13
13
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export const buildDate = ({ name, label, readOnly, canShowError }) => {
|
|
3
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
3
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
|
|
4
4
|
};
|
|
5
5
|
export const buildTime = ({ name, label, readOnly, canShowError }) => {
|
|
6
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
6
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
|
|
7
7
|
};
|
|
8
8
|
export const buildDateTime = ({ name, label, readOnly, contextName, canShowError }) => {
|
|
9
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
9
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError })));
|
|
10
10
|
};
|
|
@@ -3,9 +3,11 @@ import { ObjectUtils } from "@sankhyalabs/core";
|
|
|
3
3
|
export const buildFile = ({ name, label, readOnly, contextName, props }) => {
|
|
4
4
|
const uploadProps = ObjectUtils.removeEmptyValues({
|
|
5
5
|
subTitle: props.subTitle,
|
|
6
|
-
requestHeaders: props.STORAGESTRATEGY
|
|
6
|
+
requestHeaders: Object.assign(Object.assign({}, (props.STORAGESTRATEGY && {
|
|
7
7
|
STORAGESTRATEGY: props.STORAGESTRATEGY
|
|
8
|
-
}
|
|
8
|
+
})), (props.INTERNAL_FILENAME && {
|
|
9
|
+
INTERNAL_FILENAME: props.INTERNAL_FILENAME
|
|
10
|
+
})),
|
|
9
11
|
});
|
|
10
12
|
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-upload", Object.assign({ enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name }, uploadProps))));
|
|
11
13
|
};
|
|
@@ -8,5 +8,5 @@ export const buildInteger = ({ name, label, readOnly, contextName, canShowError
|
|
|
8
8
|
return buildNumeric(name, label, readOnly, 0, 0, contextName, canShowError);
|
|
9
9
|
};
|
|
10
10
|
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision, contextName, canShowError) {
|
|
11
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
11
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName, canShowError: canShowError })));
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export const buildSearch = ({ name, label, readOnly, required, contextName, canShowError, optionLoader }) => {
|
|
3
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
3
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError, optionLoader: optionLoader })));
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export const buildTextInput = ({ name, label, readOnly, contextName, canShowError }) => {
|
|
3
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
3
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-text-input", { label: label, "data-field-name": name, "data-context-name": contextName, key: name, enabled: !readOnly, canShowError: canShowError })));
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApplicationContext, DataType, MaskFormatter, NumberUtils, SortMode, StringUtils, UserInterface } from '@sankhyalabs/core';
|
|
1
|
+
import { ApplicationContext, DataType, MaskFormatter, NumberUtils, SortMode, StringUtils, UserInterface, } from '@sankhyalabs/core';
|
|
2
2
|
import { Grid, } from 'ag-grid-community';
|
|
3
3
|
import { Grid as EnterpriseGrid, LicenseManager } from 'ag-grid-enterprise';
|
|
4
4
|
import DataSource from './DataSource';
|
|
@@ -6,8 +6,7 @@ import { EzGridCustomHeader } from './components/EzGridCustomHeader';
|
|
|
6
6
|
import { CellRendererStatus } from './components/cellRendererStatus';
|
|
7
7
|
import SelectionHeader from './components/selectionHeader';
|
|
8
8
|
import gridTerms from './i18n/pt-BR.js';
|
|
9
|
-
import {
|
|
10
|
-
import { calcFilterColumnLeftPosition } from './AgGridUtils';
|
|
9
|
+
import { DISTINCT_FILTER_NAME_PREFIX, EZ_GRID_LOADING_SOURCE } from '../../../../utils/constants';
|
|
11
10
|
import GridEditionManager from './GridEditionManager';
|
|
12
11
|
export default class AgGridController {
|
|
13
12
|
configFilterColumn(filterColumn) {
|
|
@@ -20,6 +19,10 @@ export default class AgGridController {
|
|
|
20
19
|
this._gridOptions.api.refreshHeader();
|
|
21
20
|
this._dataUnit.loadData(undefined, undefined, undefined, EZ_GRID_LOADING_SOURCE);
|
|
22
21
|
}
|
|
22
|
+
clearFilter() {
|
|
23
|
+
this._filteredColumns.clear();
|
|
24
|
+
this._gridOptions.api.refreshHeader();
|
|
25
|
+
}
|
|
23
26
|
showFilterColumn(configs) {
|
|
24
27
|
var _a;
|
|
25
28
|
(_a = this._filterColumn) === null || _a === void 0 ? void 0 : _a.show(configs);
|
|
@@ -38,7 +41,7 @@ export default class AgGridController {
|
|
|
38
41
|
this._idAttribName = '__record__id__';
|
|
39
42
|
this._gridConfig = [];
|
|
40
43
|
this._filteredColumns = new Map();
|
|
41
|
-
this._filterColumnleftPosition =
|
|
44
|
+
this._filterColumnleftPosition = 0;
|
|
42
45
|
this._enterprise = enterprise;
|
|
43
46
|
}
|
|
44
47
|
getGridConfig() {
|
|
@@ -164,11 +167,9 @@ export default class AgGridController {
|
|
|
164
167
|
this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
|
|
165
168
|
}
|
|
166
169
|
}
|
|
167
|
-
setFilterColumnLeftPosition(
|
|
168
|
-
if (
|
|
169
|
-
|
|
170
|
-
const leftString = ePopup.style.left.replace('px', '');
|
|
171
|
-
this._filterColumnleftPosition = `${calcFilterColumnLeftPosition(parseInt(leftString))}px`;
|
|
170
|
+
setFilterColumnLeftPosition({ type, ePopup }) {
|
|
171
|
+
if (type === 'columnMenu') {
|
|
172
|
+
this._filterColumnleftPosition = ePopup.getBoundingClientRect().left;
|
|
172
173
|
return;
|
|
173
174
|
}
|
|
174
175
|
}
|
|
@@ -608,10 +609,10 @@ export default class AgGridController {
|
|
|
608
609
|
tooltip: tooltip,
|
|
609
610
|
isSortable: propSortable,
|
|
610
611
|
hasFilter: () => this.hasFilterColumn(source.name),
|
|
611
|
-
showColumnFilter: (leftPosition
|
|
612
|
+
showColumnFilter: (leftPosition) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name), fromIcon: true }),
|
|
612
613
|
},
|
|
613
614
|
valueFormatter: params => {
|
|
614
|
-
if (params.value
|
|
615
|
+
if (params.value === undefined) {
|
|
615
616
|
return "";
|
|
616
617
|
}
|
|
617
618
|
if (params.value instanceof Promise) {
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { Action, ObjectUtils } from
|
|
1
|
+
import { Action, ObjectUtils } from '@sankhyalabs/core';
|
|
2
2
|
import { EZ_GRID_LOADING_SOURCE } from "../../../../utils/constants";
|
|
3
3
|
export default class DataSource {
|
|
4
|
+
updateLoadedRecords(action) {
|
|
5
|
+
const records = action.payload;
|
|
6
|
+
if ((records === null || records === void 0 ? void 0 : records.length) > 0) {
|
|
7
|
+
records.forEach(record => {
|
|
8
|
+
this._controller.changeValues(record, [record.__record__id__]);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
4
12
|
isSilentChange(action) {
|
|
5
13
|
//TODO: Provisorio p/ não atualizar a grade quando a alteração for apenas de campos transisntes
|
|
6
14
|
var _a, _b;
|
|
@@ -23,6 +31,9 @@ export default class DataSource {
|
|
|
23
31
|
break;
|
|
24
32
|
case Action.LOADING_DATA:
|
|
25
33
|
this._waitingForLoad = true;
|
|
34
|
+
if (EZ_GRID_LOADING_SOURCE !== action.payload.source) {
|
|
35
|
+
this._controller.clearFilter();
|
|
36
|
+
}
|
|
26
37
|
this._controller.refresh();
|
|
27
38
|
break;
|
|
28
39
|
case Action.DATA_LOADED:
|
|
@@ -53,6 +64,9 @@ export default class DataSource {
|
|
|
53
64
|
case Action.PREVIOUS_SELECTED:
|
|
54
65
|
this.updateSelection();
|
|
55
66
|
break;
|
|
67
|
+
case Action.RECORD_LOADED:
|
|
68
|
+
this.updateLoadedRecords(action);
|
|
69
|
+
break;
|
|
56
70
|
}
|
|
57
71
|
};
|
|
58
72
|
this._dataUnit = dataUnit;
|
package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { calcFilterColumnLeftPosition } from '../AgGridUtils';
|
|
2
1
|
export class EzGridCustomHeader {
|
|
3
2
|
init(agParams) {
|
|
4
3
|
var _a;
|
|
@@ -35,8 +34,7 @@ export class EzGridCustomHeader {
|
|
|
35
34
|
}
|
|
36
35
|
onClickFilter() {
|
|
37
36
|
var _a;
|
|
38
|
-
|
|
39
|
-
this.params.showColumnFilter(`${calcFilterColumnLeftPosition(iconLeft)}px`, true);
|
|
37
|
+
this.params.showColumnFilter((_a = this.filterButton) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().left);
|
|
40
38
|
}
|
|
41
39
|
configSortIcon() {
|
|
42
40
|
this.sortDownIcon.style.display = this.params.column.isSortDescending() ? 'flex' : 'none';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
grid-template-rows: auto 1fr auto;
|
|
5
5
|
height: 100%;
|
|
6
6
|
width: 100%;
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
/*public*/
|
|
9
9
|
/*@doc Define a cor de fundo do header do componente.*/
|
|
10
10
|
--ez-grid__header--background-color: var(--background--xlight, #FFF);
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
--ez-grid__selection-counter--z-index: var(--visible, 1);
|
|
13
13
|
/*@doc Define o sombreamento usado como borda.*/
|
|
14
14
|
--ez-grid__container--shadow: 0 0 16px 0 rgb(0 38 111 / 12%);
|
|
15
|
+
/*@doc Define altura mínima da grid */
|
|
16
|
+
--ez-grid--min-height: 300px;
|
|
17
|
+
|
|
18
|
+
min-height: var(--ez-grid--min-height);
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
.grid-header {
|
|
@@ -92,3 +96,8 @@
|
|
|
92
96
|
height: 0;
|
|
93
97
|
padding: 0;
|
|
94
98
|
}
|
|
99
|
+
|
|
100
|
+
.grid-header__pagination-label {
|
|
101
|
+
width: 100%;
|
|
102
|
+
white-space: nowrap
|
|
103
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ElementIDUtils, JSUtils,
|
|
1
|
+
import { ElementIDUtils, JSUtils, OverflowDirection, OverflowWatcher, StringUtils } from '@sankhyalabs/core';
|
|
2
2
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
3
|
-
import {
|
|
3
|
+
import { Host, h } from '@stencil/core';
|
|
4
|
+
import { ApplicationUtils } from '../../utils';
|
|
4
5
|
import AgGridController from './controller/ag-grid/AgGridController';
|
|
5
6
|
import { SelectionCounter } from './subcomponents/selection-counter';
|
|
6
|
-
import { ApplicationUtils } from '../../utils';
|
|
7
7
|
import InMemoryFilterColumnDataSource from './utils/InMemoryFilterColumnDataSource';
|
|
8
8
|
const windowInstace = window;
|
|
9
9
|
const matches = (text, filter) => {
|
|
10
|
-
const normalizedText = StringUtils.replaceAccentuatedCharsLower(text.toLocaleLowerCase());
|
|
10
|
+
const normalizedText = StringUtils.replaceAccentuatedCharsLower(text === null || text === void 0 ? void 0 : text.toLocaleLowerCase());
|
|
11
11
|
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(filter.toLocaleLowerCase());
|
|
12
|
-
return normalizedText.includes(normalizedFilter);
|
|
12
|
+
return normalizedText === null || normalizedText === void 0 ? void 0 : normalizedText.includes(normalizedFilter);
|
|
13
13
|
};
|
|
14
14
|
export class EzGrid {
|
|
15
15
|
constructor() {
|
|
@@ -251,11 +251,10 @@ export class EzGrid {
|
|
|
251
251
|
}
|
|
252
252
|
getPaginationControl() {
|
|
253
253
|
if (this._paginationInfo) {
|
|
254
|
-
const {
|
|
254
|
+
const { currentPage, hasMore } = this._paginationInfo;
|
|
255
255
|
return [
|
|
256
|
-
h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" },
|
|
257
|
-
h("
|
|
258
|
-
h("ez-button", { size: "small", iconName: "chevron-right", class: "ez-margin-right--medium", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }),
|
|
256
|
+
h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, h("span", { class: "grid-header__pagination-label" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())),
|
|
257
|
+
h("div", { ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })),
|
|
259
258
|
];
|
|
260
259
|
}
|
|
261
260
|
return null;
|
|
@@ -299,6 +298,55 @@ export class EzGrid {
|
|
|
299
298
|
this.setEvents();
|
|
300
299
|
this.componentReady.emit();
|
|
301
300
|
this._gridController.configFilterColumn(this._filterColumn);
|
|
301
|
+
this._initHeaderOverflowWatcher();
|
|
302
|
+
}
|
|
303
|
+
_getActualPageLabel() {
|
|
304
|
+
const { firstRecord, lastRecord } = this._paginationInfo;
|
|
305
|
+
return `${firstRecord}-${lastRecord}`;
|
|
306
|
+
}
|
|
307
|
+
_getRemainingPageLabel() {
|
|
308
|
+
const { total, count } = this._paginationInfo;
|
|
309
|
+
return `${total == undefined ? ` de ${count + 1} ou mais` : ` de ${total}`}`;
|
|
310
|
+
}
|
|
311
|
+
_getPaginationTooltip() {
|
|
312
|
+
return this._getActualPageLabel() + this._getRemainingPageLabel();
|
|
313
|
+
}
|
|
314
|
+
_updatePaginationTooltip() {
|
|
315
|
+
if (!this._refPaginationLabelTooltip) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
const alreadyDefined = this._refPaginationLabelTooltip.getAttribute('data-tooltip');
|
|
319
|
+
if (alreadyDefined) {
|
|
320
|
+
this._refPaginationLabelTooltip
|
|
321
|
+
.setAttribute('data-tooltip', this._getPaginationTooltip());
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
_initHeaderOverflowWatcher() {
|
|
325
|
+
this._headerOverflowWatcher = new OverflowWatcher(this._refHeader, (elementsOverflow) => {
|
|
326
|
+
if (!this._refPaginationLabel) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
if (elementsOverflow.length > 0) {
|
|
330
|
+
this._hidePaginationDescription();
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
this._showPaginationDescription();
|
|
334
|
+
}
|
|
335
|
+
}, OverflowDirection.HORIZONTAL, 20);
|
|
336
|
+
}
|
|
337
|
+
_hidePaginationDescription() {
|
|
338
|
+
this._refPaginationLabel.hidden = true;
|
|
339
|
+
this._refPaginationLabelTooltip.setAttribute('data-flow', 'bottom');
|
|
340
|
+
this._refPaginationLabelTooltip.setAttribute('data-tooltip', this._getPaginationTooltip());
|
|
341
|
+
}
|
|
342
|
+
;
|
|
343
|
+
_showPaginationDescription() {
|
|
344
|
+
this._refPaginationLabel.hidden = false;
|
|
345
|
+
this._refPaginationLabelTooltip.removeAttribute('data-flow');
|
|
346
|
+
this._refPaginationLabelTooltip.removeAttribute('data-tooltip');
|
|
347
|
+
}
|
|
348
|
+
disconnectedCallback() {
|
|
349
|
+
this._headerOverflowWatcher.destroy();
|
|
302
350
|
}
|
|
303
351
|
componentWillRender() {
|
|
304
352
|
this.configSelectionCounter();
|
|
@@ -322,7 +370,7 @@ export class EzGrid {
|
|
|
322
370
|
}
|
|
323
371
|
render() {
|
|
324
372
|
var _a;
|
|
325
|
-
return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position" }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container", ref: ref => (this._refPaginationControl = ref) }, this.getPaginationControl()))), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
|
|
373
|
+
return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position", ref: ref => (this._refHeader = ref) }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container", ref: ref => (this._refPaginationControl = ref) }, this.getPaginationControl()))), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
|
|
326
374
|
${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
|
|
327
375
|
` }, h(SelectionCounter, { selectionCount: this._selectionCount, currentPageSelected: this._currentPageSelected, paginationInfo: this._paginationInfo, canSelectAll: (_a = this.selectionToastConfig) === null || _a === void 0 ? void 0 : _a.canSelectAll, allRecordSelected: this._isAllSelection, onSelectAll: () => this.onSelectAllRecords(), onSelectPage: () => this.onSelectPageRecords(), onClearAll: () => this.onClearSelectedRecords(), onClose: () => (this._showSelectionCounter = false) })), h("div", { class: "grid__footer" }, h("slot", { name: "footer" }))));
|
|
328
376
|
}
|
|
@@ -887,6 +935,9 @@ export class EzGrid {
|
|
|
887
935
|
return [{
|
|
888
936
|
"propName": "config",
|
|
889
937
|
"methodName": "observeConfig"
|
|
938
|
+
}, {
|
|
939
|
+
"propName": "_paginationInfo",
|
|
940
|
+
"methodName": "_updatePaginationTooltip"
|
|
890
941
|
}];
|
|
891
942
|
}
|
|
892
943
|
static get listeners() {
|
|
@@ -13,6 +13,8 @@ export class FilterColumn {
|
|
|
13
13
|
this.TOP_POSITION_NO_TASKBAR = '32';
|
|
14
14
|
this.TOP_POSITION_NO_TASKBAR_HEADER_HIDDEN = '20';
|
|
15
15
|
this.DEFAULT_HEIGHT = 430;
|
|
16
|
+
this.FIX_MARGIN = 60;
|
|
17
|
+
this.FILTER_COLUMN_WIDTH = 330;
|
|
16
18
|
this.opened = true;
|
|
17
19
|
this.columnName = undefined;
|
|
18
20
|
this.columnLabel = undefined;
|
|
@@ -45,15 +47,24 @@ export class FilterColumn {
|
|
|
45
47
|
await this.ezPopoverElement.show(this.calcTopPosition(), this.calculateLeftPosition(configs));
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
|
-
calculateLeftPosition(
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
calculateLeftPosition({ leftPosition, fromIcon }) {
|
|
51
|
+
const leftPositionCalculated = this.calcFilterColumnLeftPosition(leftPosition);
|
|
52
|
+
if (!fromIcon) {
|
|
53
|
+
return `${leftPositionCalculated}px`;
|
|
51
54
|
}
|
|
52
55
|
const difference = this.ezPopoverElement.getBoundingClientRect().left;
|
|
53
|
-
const
|
|
54
|
-
const leftResolved = (leftReference + 16) - difference;
|
|
56
|
+
const leftResolved = (leftPositionCalculated + 16) - difference;
|
|
55
57
|
return `${(leftResolved > 0 ? leftResolved : 0)}px`;
|
|
56
58
|
}
|
|
59
|
+
calcFilterColumnLeftPosition(leftReference) {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
const gridReference = this.ezPopoverElement.closest("ez-grid");
|
|
62
|
+
const gridLimit = (_a = gridReference.getBoundingClientRect()) === null || _a === void 0 ? void 0 : _a.right;
|
|
63
|
+
const popoverDiff = (_b = this.ezPopoverElement.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.left;
|
|
64
|
+
const maxLeft = gridLimit - (this.FILTER_COLUMN_WIDTH + popoverDiff);
|
|
65
|
+
const leftInt = leftReference - (this.FIX_MARGIN + popoverDiff);
|
|
66
|
+
return leftInt > maxLeft ? maxLeft : leftInt;
|
|
67
|
+
}
|
|
57
68
|
buildIsTextSearch() {
|
|
58
69
|
var _a, _b;
|
|
59
70
|
const userInterface = (_b = (_a = this.fieldDescriptor) === null || _a === void 0 ? void 0 : _a.userInterface) !== null && _b !== void 0 ? _b : UserInterface.SHORTTEXT;
|
|
@@ -64,7 +64,7 @@ svg {
|
|
|
64
64
|
.ez-icon-alert-mail:before { content: "\ea08"; }
|
|
65
65
|
.ez-icon-alert-popup:before { content: "\ea09"; }
|
|
66
66
|
.ez-icon-anexo:before { content: "\ea0a"; }
|
|
67
|
-
.ez-icon-
|
|
67
|
+
.ez-icon-antecipacao:before { content: "\ea0b"; }
|
|
68
68
|
.ez-icon-apps:before { content: "\ea0c"; }
|
|
69
69
|
.ez-icon-arrow-forward:before { content: "\ea0d"; }
|
|
70
70
|
.ez-icon-arrow-upward:before { content: "\ea0e"; }
|
|
@@ -137,16 +137,8 @@ export class EzMuiltiSelectionList {
|
|
|
137
137
|
}
|
|
138
138
|
handleChangeSelectedItem(event) {
|
|
139
139
|
const { detail: itemCheckSelected } = event;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return Object.assign(Object.assign({}, item), { check: itemCheckSelected.check });
|
|
143
|
-
}
|
|
144
|
-
return item;
|
|
145
|
-
});
|
|
146
|
-
this.clearInputs();
|
|
147
|
-
}
|
|
148
|
-
clearInputs() {
|
|
149
|
-
this.filterInput ? (this.filterInput.value = '') : (this.searchInput.value = '');
|
|
140
|
+
const itemSelected = this.filteredOptions.find(item => item.label === itemCheckSelected.label);
|
|
141
|
+
itemSelected.check = itemCheckSelected.check;
|
|
150
142
|
}
|
|
151
143
|
buildViewList(hasDelete) {
|
|
152
144
|
return (h(Fragment, null, this.displayOptionToCheckAllItems && (h("ez-check", { ref: (element) => (this.checkInput = element), label: "Selecionar todos", class: "multi-selection__select-all", onEzChange: this.handleChangeSelectAllItems.bind(this) })), h("ez-list", { class: "multi-selection__list", dataSource: this.displayOptions, listMode: "check", hoverFeedback: true, onEzCheckChange: this.handleChangeSelectedItem.bind(this), itemSlotBuilder: hasDelete ? this.buildDeleteIconSlot.bind(this) : null })));
|
|
@@ -107,6 +107,9 @@ export class EzNumberInput {
|
|
|
107
107
|
this.ezCancelWaitingChange.emit();
|
|
108
108
|
}
|
|
109
109
|
handleBlur() {
|
|
110
|
+
if (!this._changePending) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
110
113
|
try {
|
|
111
114
|
const parsedNumber = this.getParsedNumber();
|
|
112
115
|
if (parsedNumber !== undefined && isNaN(parsedNumber)) {
|
|
@@ -77,17 +77,14 @@
|
|
|
77
77
|
|
|
78
78
|
.popup__content {
|
|
79
79
|
box-sizing: border-box;
|
|
80
|
-
|
|
80
|
+
height: 100%;
|
|
81
81
|
width: 100%;
|
|
82
|
-
display: grid;
|
|
83
|
-
grid-template-rows: auto 1fr;
|
|
84
82
|
}
|
|
85
83
|
|
|
86
84
|
.popup__expandable-content {
|
|
87
85
|
box-sizing: border-box;
|
|
88
86
|
width: 100%;
|
|
89
|
-
|
|
90
|
-
height: 100%;
|
|
87
|
+
height: calc(100% - 44px);
|
|
91
88
|
}
|
|
92
89
|
|
|
93
90
|
.popup__header {
|
|
@@ -115,6 +115,7 @@ ez-icon {
|
|
|
115
115
|
.list-container {
|
|
116
116
|
/*public*/
|
|
117
117
|
min-width: var(--ez-search__list-min-width);
|
|
118
|
+
overflow: auto;
|
|
118
119
|
|
|
119
120
|
/*private*/
|
|
120
121
|
position: relative;
|
|
@@ -130,6 +131,7 @@ ez-icon {
|
|
|
130
131
|
/*public*/
|
|
131
132
|
z-index: var(--more-visible, 2);
|
|
132
133
|
max-height: 350px;
|
|
134
|
+
min-width: 150px;
|
|
133
135
|
background-color: var(--ez-search--background-color--xlight);
|
|
134
136
|
border-radius: var(--ez-search--border-radius);
|
|
135
137
|
box-shadow: var(--shadow, 0px 0px 16px 0px #000);
|
|
@@ -195,7 +197,6 @@ ez-icon {
|
|
|
195
197
|
/*public*/
|
|
196
198
|
border-radius: var(--ez-search--border-radius-small);
|
|
197
199
|
padding: var(--ez-search--space--small);
|
|
198
|
-
min-height: var(--ez-search__list-height);
|
|
199
200
|
gap: var(--space--small, 6px);
|
|
200
201
|
}
|
|
201
202
|
|
|
@@ -187,10 +187,9 @@ export class EzSearch {
|
|
|
187
187
|
if (currentValue == undefined) {
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return currentValue.label ? `${currentValue.value} - ${currentValue.label}` : currentValue.value;
|
|
190
|
+
let text = (!this.showSelectedValue || currentValue.value == undefined) ? currentValue.label : `${currentValue.value} - ${currentValue.label}`;
|
|
191
|
+
text = text.replace(new RegExp(this._startHighlightTag, 'g'), '').replace(new RegExp(this._endHighlightTag, 'g'), '');
|
|
192
|
+
return text;
|
|
194
193
|
}
|
|
195
194
|
getText() {
|
|
196
195
|
const currentValue = this.getSelectedOption(this.value);
|
|
@@ -262,7 +261,7 @@ export class EzSearch {
|
|
|
262
261
|
title: opt.label,
|
|
263
262
|
details: opt.details
|
|
264
263
|
};
|
|
265
|
-
return h("div", { style: { "height": "100%" }, onMouseDown: () => this.createOption(card), onMouseOver: () => this._preSelection = index }, h("ez-card-item", { item: card }));
|
|
264
|
+
return h("div", { style: { "height": "100%" }, class: index === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.createOption(card), onMouseOver: () => this._preSelection = index }, h("ez-card-item", { item: card }));
|
|
266
265
|
}
|
|
267
266
|
showOptions() {
|
|
268
267
|
if (!this.enabled)
|
|
@@ -306,7 +305,7 @@ export class EzSearch {
|
|
|
306
305
|
}
|
|
307
306
|
scrollToOption(opt) {
|
|
308
307
|
window.requestAnimationFrame(() => {
|
|
309
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`
|
|
308
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`div#item_${opt.value.replace(/[<>\[\]#=]/g, '\\$&').replace(/:/g, '\\:')}`) : undefined;
|
|
310
309
|
if (liElem)
|
|
311
310
|
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
312
311
|
});
|