@sankhyalabs/ezui 5.22.0-dev.96 → 5.22.0-dev.97
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/ez-card-item_2.cjs.entry.js +1416 -7
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover-plus_3.cjs.entry.js +198 -0
- package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +28 -158
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/searchFormatters-b7e1ed1e.js +23 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ez-card-item/ez-card-item.css +1 -3
- package/dist/collection/components/ez-chip/ez-chip.css +5 -1
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +49 -2
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +2 -2
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +72 -12
- package/dist/collection/components/ez-scroller/ez-scroller.css +3 -0
- package/dist/collection/components/ez-search/ez-search.css +0 -219
- package/dist/collection/components/ez-search/ez-search.js +28 -167
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.css +227 -0
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.js +289 -0
- package/dist/collection/components/ez-search/utils/searchFormatters.js +18 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +169 -177
- package/dist/esm/ez-card-item_2.entry.js +1416 -7
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-popover-plus_3.entry.js +192 -0
- package/dist/esm/ez-scroller_2.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +29 -159
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/searchFormatters-8229207e.js +20 -0
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-288631d1.entry.js +1 -0
- package/dist/ezui/p-31da1b57.entry.js +1 -0
- package/dist/ezui/p-40a60148.js +1 -0
- package/dist/ezui/p-5aca7386.entry.js +1 -0
- package/dist/ezui/p-b7706b43.entry.js +1 -0
- package/dist/ezui/{p-17be134a.entry.js → p-e06a9886.entry.js} +1 -1
- package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +9 -1
- package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +12 -2
- package/dist/types/components/ez-search/ez-search.d.ts +3 -13
- package/dist/types/components/ez-search/subcomponent/search-list/search-list.d.ts +23 -0
- package/dist/types/components/ez-search/utils/searchFormatters.d.ts +2 -0
- package/dist/types/components.d.ts +72 -4
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ez-popover-core_2.cjs.entry.js +0 -1504
- package/dist/esm/ez-popover-core_2.entry.js +0 -1499
- package/dist/ezui/p-58783dcf.entry.js +0 -1
- package/dist/ezui/p-65f471bc.entry.js +0 -1
- package/dist/ezui/p-7bd15498.entry.js +0 -1
- package/dist/ezui/p-990b4318.entry.js +0 -1
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-a7b0c73d.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
|
|
8
|
-
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:focus{outline:
|
|
8
|
+
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);--ez-label-chip__label__container--default--margin-top:var(--space-extra-small, 3px)}.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);margin-top:var(--ez-label-chip__label__container--default--margin-top)}.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:focus{outline:none;box-shadow:0 0 0 2px 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}";
|
|
9
9
|
|
|
10
10
|
const EzChip = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-a7b0c73d.js');
|
|
6
|
+
const core = require('@sankhyalabs/core');
|
|
7
|
+
const searchFormatters = require('./searchFormatters-b7e1ed1e.js');
|
|
8
|
+
|
|
9
|
+
const ezPopoverPlusCss = ":host{display:none}";
|
|
10
|
+
|
|
11
|
+
const EzPopoverPlus = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.ezVisibilityChange = index.createEvent(this, "ezVisibilityChange", 7);
|
|
15
|
+
this.autoClose = true;
|
|
16
|
+
this.boxWidth = "fit-content";
|
|
17
|
+
this.opened = false;
|
|
18
|
+
this.overlayType = "light";
|
|
19
|
+
this.anchorElement = undefined;
|
|
20
|
+
this.options = { horizontalGap: 0, verticalGap: 0, fromRight: false };
|
|
21
|
+
this.useAnchorSize = false;
|
|
22
|
+
this.minWidth = 150;
|
|
23
|
+
}
|
|
24
|
+
listenerEzVisibilityChange({ detail }) {
|
|
25
|
+
this.ezVisibilityChange.emit(detail);
|
|
26
|
+
}
|
|
27
|
+
async observeOpened(newValue) {
|
|
28
|
+
if (newValue && !this._popOverCore) {
|
|
29
|
+
this.renderPopoverCore();
|
|
30
|
+
}
|
|
31
|
+
this._popOverCore.opened = newValue;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Atualiza a posição do popover.
|
|
35
|
+
*/
|
|
36
|
+
async updatePosition(top, left) {
|
|
37
|
+
var _a;
|
|
38
|
+
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.updatePosition(top, left));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Exibe o ez-popover.
|
|
42
|
+
*/
|
|
43
|
+
async show(top, left) {
|
|
44
|
+
if (!this._popOverCore) {
|
|
45
|
+
this.renderPopoverCore();
|
|
46
|
+
}
|
|
47
|
+
await this._popOverCore.show(top, left);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Ancora a exibição do popOver a um elemento HTML.
|
|
51
|
+
*/
|
|
52
|
+
async showUnder(element, options) {
|
|
53
|
+
if (!this._popOverCore) {
|
|
54
|
+
this.renderPopoverCore();
|
|
55
|
+
}
|
|
56
|
+
await this._popOverCore.showUnder(element, options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Oculta o ez-popover.
|
|
60
|
+
*/
|
|
61
|
+
async hide() {
|
|
62
|
+
var _a;
|
|
63
|
+
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.hide());
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Altera as opções.
|
|
67
|
+
*/
|
|
68
|
+
async setOptions(options) {
|
|
69
|
+
var _a;
|
|
70
|
+
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.setOptions(options));
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Altera o elemento de ancoragem.
|
|
74
|
+
*/
|
|
75
|
+
async setAnchorElement(anchor) {
|
|
76
|
+
var _a;
|
|
77
|
+
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.setAnchorElement(anchor));
|
|
78
|
+
}
|
|
79
|
+
renderPopoverCore() {
|
|
80
|
+
this._popOverCore = document.createElement('ez-popover-core');
|
|
81
|
+
this._popOverCore.opened = this.opened;
|
|
82
|
+
this._popOverCore.anchorElement = this.anchorElement;
|
|
83
|
+
this._popOverCore.autoClose = this.autoClose;
|
|
84
|
+
this._popOverCore.boxWidth = this.boxWidth;
|
|
85
|
+
this._popOverCore.overlayType = this.overlayType;
|
|
86
|
+
this._popOverCore.options = this.options;
|
|
87
|
+
this._popOverCore.useAnchorSize = this.useAnchorSize;
|
|
88
|
+
this._popOverCore.minWidth = this.minWidth;
|
|
89
|
+
this._popOverCore.addEventListener('ezVisibilityChange', ({ detail }) => {
|
|
90
|
+
this.ezVisibilityChange.emit(detail);
|
|
91
|
+
this.opened = detail;
|
|
92
|
+
});
|
|
93
|
+
const firstChild = this._host.children.item(0);
|
|
94
|
+
if (firstChild) {
|
|
95
|
+
this._popOverCore.appendChild(firstChild);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
console.warn('O slot do popover está vazio. Adicione conteúdo ao slot para exibição correta.');
|
|
99
|
+
}
|
|
100
|
+
document.body.appendChild(this._popOverCore);
|
|
101
|
+
}
|
|
102
|
+
render() {
|
|
103
|
+
return (index.h(index.Host, null, index.h("slot", null)));
|
|
104
|
+
}
|
|
105
|
+
get _host() { return index.getElement(this); }
|
|
106
|
+
static get watchers() { return {
|
|
107
|
+
"opened": ["observeOpened"]
|
|
108
|
+
}; }
|
|
109
|
+
};
|
|
110
|
+
EzPopoverPlus.style = ezPopoverPlusCss;
|
|
111
|
+
|
|
112
|
+
const multiSelectionBoxMessageCss = ".multi-selection__message{display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;min-height:320px;text-align:center}.multi-selection__text-message{margin-top:-30px;font-family:var(--font-pattern);font-size:var(--text--meduim);padding:var(--space-xs);color:var(--text--primary)}";
|
|
113
|
+
|
|
114
|
+
const MultiSelectionBoxMessage = class {
|
|
115
|
+
constructor(hostRef) {
|
|
116
|
+
index.registerInstance(this, hostRef);
|
|
117
|
+
this.message = undefined;
|
|
118
|
+
}
|
|
119
|
+
render() {
|
|
120
|
+
return (index.h("div", { class: "multi-selection__message" }, index.h("span", { class: "multi-selection__text-message" }, this.message)));
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
MultiSelectionBoxMessage.style = multiSelectionBoxMessageCss;
|
|
124
|
+
|
|
125
|
+
const searchListCss = ":host{--ez-search__list-title--primary:var(--title--primary, #2B3A54);--ez-search__list-text--primary:var(--text--primary, #626e82);--ez-search__list-height:calc(var(--ez-search--font-size) + var(--ez-search--space--medium) + 4px);--ez-search__list-min-width:64px;--ez-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-search__scrollbar--width:var(--space--small, 6px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px)}.list-options{position:relative;z-index:var(--more-visible, 2);margin:var(--space--small) 0px;padding:0px;padding-inline-start:0px;box-sizing:border-box;width:100%;height:100%;max-height:350px;min-width:150px;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-search__scrollbar--color-background);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-search__scrollbar--color-default);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-search__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-search__scrollbar--color-clicked)}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;margin:var(--space--medium) 0px;min-height:var(--ez-search__list-height)}.message__no-result{color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-search__list-title--primary);border-top:3px solid transparent}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size);line-height:var(--ez-search--line-height)}.item__label{font-weight:var(--ez-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-search__list-text--primary);font-weight:var(--ez-search--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-search--border-radius-small);gap:var(--space--small, 6px)}.preselected{background-color:var(--background--medium)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@supports not (scrollbar-width: thin){.item{padding-right:8px}}";
|
|
126
|
+
|
|
127
|
+
const SearchList = class {
|
|
128
|
+
constructor(hostRef) {
|
|
129
|
+
index.registerInstance(this, hostRef);
|
|
130
|
+
this.changeValue = index.createEvent(this, "changeValue", 7);
|
|
131
|
+
this.changePreSelection = index.createEvent(this, "changePreSelection", 7);
|
|
132
|
+
this._startHighlightTag = "<span class='card-item__highlight'>";
|
|
133
|
+
this._endHighlightTag = "</span>";
|
|
134
|
+
this.showLoading = undefined;
|
|
135
|
+
this.visibleOptions = [];
|
|
136
|
+
this.textEmptyList = undefined;
|
|
137
|
+
this.canShowListOptions = undefined;
|
|
138
|
+
this.value = undefined;
|
|
139
|
+
this.showOptionValue = true;
|
|
140
|
+
this.preSelection = undefined;
|
|
141
|
+
}
|
|
142
|
+
async nextOption() {
|
|
143
|
+
const newPreSelection = this.preSelection === undefined ? 0 : Math.min(this.preSelection + 1, this.visibleOptions.length - 1);
|
|
144
|
+
this.changePreSelection.emit(newPreSelection);
|
|
145
|
+
this.scrollToOption(this.visibleOptions[newPreSelection]);
|
|
146
|
+
}
|
|
147
|
+
async previousOption() {
|
|
148
|
+
const newPreSelection = this.preSelection === undefined ? 0 : Math.max(this.preSelection - 1, 0);
|
|
149
|
+
this.changePreSelection.emit(newPreSelection);
|
|
150
|
+
this.scrollToOption(this.visibleOptions[newPreSelection]);
|
|
151
|
+
}
|
|
152
|
+
selectOption(newOption) {
|
|
153
|
+
const newOptionsReplaced = Object.assign(Object.assign({}, newOption), { value: searchFormatters.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.value), label: searchFormatters.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.label) });
|
|
154
|
+
const newOptionsFormatted = Object.assign(Object.assign({}, newOptionsReplaced), { value: searchFormatters.replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value), label: searchFormatters.replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.label) });
|
|
155
|
+
this.changeValue.emit(newOptionsFormatted);
|
|
156
|
+
}
|
|
157
|
+
createOption(detail) {
|
|
158
|
+
let { key, title } = detail;
|
|
159
|
+
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
160
|
+
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
161
|
+
title = core.StringUtils.decodeHtmlEntities(title);
|
|
162
|
+
const option = {
|
|
163
|
+
value: key === null || key === void 0 ? void 0 : key.replace(startHighlight, '').replace(endHighlight, ''),
|
|
164
|
+
label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
|
|
165
|
+
};
|
|
166
|
+
this.selectOption(option);
|
|
167
|
+
}
|
|
168
|
+
scrollToOption(opt) {
|
|
169
|
+
window.requestAnimationFrame(() => {
|
|
170
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
171
|
+
? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
|
|
172
|
+
: undefined;
|
|
173
|
+
if (liElem) {
|
|
174
|
+
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
buildItem(opt, index$1) {
|
|
179
|
+
opt.label = opt.label || opt.value;
|
|
180
|
+
const card = {
|
|
181
|
+
key: opt.value,
|
|
182
|
+
title: opt.label,
|
|
183
|
+
details: opt.details
|
|
184
|
+
};
|
|
185
|
+
return index.h("div", { style: { "height": "100%" }, class: index$1 === this.preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.createOption(card), onMouseOver: () => this.changePreSelection.emit(index$1) }, index.h("ez-card-item", { item: card, compacted: true, enableKey: this.showOptionValue }));
|
|
186
|
+
}
|
|
187
|
+
render() {
|
|
188
|
+
return (index.h(index.Host, null, index.h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this.showLoading
|
|
189
|
+
&& this.visibleOptions.length === 0
|
|
190
|
+
&& index.h("div", { class: "message" }, index.h("span", { class: "message__no-result" }, this.textEmptyList)), this.showLoading
|
|
191
|
+
&& index.h("div", { class: "message" }, index.h("div", { class: "message__loading" })), this.canShowListOptions && this.visibleOptions.map((opt, index) => this.buildItem(opt, index)))));
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
SearchList.style = searchListCss;
|
|
195
|
+
|
|
196
|
+
exports.ez_popover_plus = EzPopoverPlus;
|
|
197
|
+
exports.multi_selection_box_message = MultiSelectionBoxMessage;
|
|
198
|
+
exports.search_list = SearchList;
|
|
@@ -6,7 +6,7 @@ const index = require('./index-a7b0c73d.js');
|
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const EzScrollDirection = require('./EzScrollDirection-b2c99895.js');
|
|
8
8
|
|
|
9
|
-
const ezScrollerCss = ":host{--ez-scroller--box-shadow-color:var(--background--body, #fafcff);--ez-scroller__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-scroller__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-scroller__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-scroller__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-scroller__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-scroller__scrollbar--width:var(--space--small, 6px);--ez-scroller__max-height:unset;display:flex;cursor:grab;width:100%;overflow:hidden}.dragging{cursor:grabbing}.ez-scroller__container{display:flex;overflow-y:hidden;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:transparent transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked),.ez-scroller__container:not(.ez-scroller__container--locked):hover{scrollbar-color:var(--ez-scroller__scrollbar--color-clicked) var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container--both{overflow-y:scroll;overflow-x:scroll;flex-wrap:wrap}.ez-scroller__container--horizontal{overflow-x:scroll;flex-direction:row}.ez-scroller__container--vertical{overflow-y:scroll;flex-direction:column;width:100%;max-height:var(--ez-scroller__max-height)}.ez-scroller__container::-webkit-scrollbar{background-color:transparent;width:var(--ez-scroller__scrollbar--width);height:var(--ez-scroller__scrollbar--width);max-width:var(--ez-scroller__scrollbar--width);min-width:var(--ez-scroller__scrollbar--width)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar{background-color:var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container::-webkit-scrollbar-track{visibility:hidden;background-color:transparent;border-radius:var(--ez-scroller__scrollbar--border-radius)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-track,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-track{background-color:var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container::-webkit-scrollbar-thumb{background-color:transparent;border-radius:var(--ez-scroller__scrollbar--border-radius)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb{background-color:var(--ez-scroller__scrollbar--color-default)}.ez-scroller__container::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container::-webkit-scrollbar-thumb:horizontal:hover{background-color:transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:horizontal:hover,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-scroller__scrollbar--color-hover)}.ez-scroller__container::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container::-webkit-scrollbar-thumb:horizontal:active{background-color:transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:horizontal:active,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-scroller__scrollbar--color-clicked)}.ez-scroller__wrapper{display:flex;position:relative;width:100%;height:auto}.ez-scroller__wrapper--horizontal{flex-direction:row}.ez-scroller__wrapper--vertical{flex-direction:column}.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--shadow-end::after{content:\"\";display:flex;position:absolute;z-index:1}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-end::after{width:24px;min-height:calc(100% - 10px)}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-start::before{left:0;background:linear-gradient(to right, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-end::after{right:0;background:linear-gradient(to left, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-end::after{min-width:calc(100% - 10px);height:24px}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-start::before{top:0;background:linear-gradient(to bottom, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-end::after{bottom:0;background:linear-gradient(to top, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}";
|
|
9
|
+
const ezScrollerCss = ":host{--ez-scroller--box-shadow-color:var(--background--body, #fafcff);--ez-scroller__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-scroller__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-scroller__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-scroller__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-scroller__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-scroller__scrollbar--width:var(--space--small, 6px);--ez-scroller__max-height:unset;--ez-scroller__scrollbar--padding-right:var(--space-extra-small, 3px);display:flex;cursor:grab;width:100%;overflow:hidden}.dragging{cursor:grabbing}.ez-scroller__container{display:flex;overflow-y:hidden;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:transparent transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked),.ez-scroller__container:not(.ez-scroller__container--locked):hover{scrollbar-color:var(--ez-scroller__scrollbar--color-clicked) var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container--both{overflow-y:scroll;overflow-x:scroll;flex-wrap:wrap}.ez-scroller__container--horizontal{overflow-x:scroll;flex-direction:row;padding-right:var(--ez-scroller__scrollbar--padding-right)}.ez-scroller__container--vertical{overflow-y:scroll;flex-direction:column;width:100%;max-height:var(--ez-scroller__max-height)}.ez-scroller__container::-webkit-scrollbar{background-color:transparent;width:var(--ez-scroller__scrollbar--width);height:var(--ez-scroller__scrollbar--width);max-width:var(--ez-scroller__scrollbar--width);min-width:var(--ez-scroller__scrollbar--width)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar{background-color:var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container::-webkit-scrollbar-track{visibility:hidden;background-color:transparent;border-radius:var(--ez-scroller__scrollbar--border-radius)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-track,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-track{background-color:var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container::-webkit-scrollbar-thumb{background-color:transparent;border-radius:var(--ez-scroller__scrollbar--border-radius)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb{background-color:var(--ez-scroller__scrollbar--color-default)}.ez-scroller__container::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container::-webkit-scrollbar-thumb:horizontal:hover{background-color:transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:horizontal:hover,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-scroller__scrollbar--color-hover)}.ez-scroller__container::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container::-webkit-scrollbar-thumb:horizontal:active{background-color:transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:horizontal:active,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-scroller__scrollbar--color-clicked)}.ez-scroller__wrapper{display:flex;position:relative;width:100%;height:auto}.ez-scroller__wrapper--horizontal{flex-direction:row}.ez-scroller__wrapper--vertical{flex-direction:column}.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--shadow-end::after{content:\"\";display:flex;position:absolute;z-index:1}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-end::after{width:24px;min-height:calc(100% - 10px)}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-start::before{left:0;background:linear-gradient(to right, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-end::after{right:0;background:linear-gradient(to left, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-end::after{min-width:calc(100% - 10px);height:24px}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-start::before{top:0;background:linear-gradient(to bottom, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-end::after{bottom:0;background:linear-gradient(to top, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}";
|
|
10
10
|
|
|
11
11
|
const EzScroller = class {
|
|
12
12
|
constructor(hostRef) {
|
|
@@ -10,8 +10,9 @@ require('./DialogType-2114c337.js');
|
|
|
10
10
|
require('./CheckMode-ecb90b87.js');
|
|
11
11
|
require('./ICustomRender-6fafffce.js');
|
|
12
12
|
const constants = require('./constants-2714478b.js');
|
|
13
|
+
const searchFormatters = require('./searchFormatters-b7e1ed1e.js');
|
|
13
14
|
|
|
14
|
-
const ezSearchCss = ":host{--ez-search--height:42px;--ez-search--width:100%;--ez-search__icon--width:48px;--ez-search--border-radius:var(--border--radius-medium, 12px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-color--xlight:var(--background--xlight, #fff);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-search__input--background-color:var(--background--medium, #e0e0e0);--ez-search__input--border:var(--border--medium, 2px solid);--ez-search__input--border-color:var(--ez-search__input--background-color);--ez-search__input--focus--border-color:var(--color--primary, #008561);--ez-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-search__input--error--border-color:#CC2936;--ez-search__btn--color:var(--title--primary, #2B3A54);--ez-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-search__label--color:var(--title--primary, #2B3A54);--ez-
|
|
15
|
+
const ezSearchCss = ":host{--ez-search--height:42px;--ez-search--width:100%;--ez-search__icon--width:48px;--ez-search--border-radius:var(--border--radius-medium, 12px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-color--xlight:var(--background--xlight, #fff);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-search__input--background-color:var(--background--medium, #e0e0e0);--ez-search__input--border:var(--border--medium, 2px solid);--ez-search__input--border-color:var(--ez-search__input--background-color);--ez-search__input--focus--border-color:var(--color--primary, #008561);--ez-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-search__input--error--border-color:#CC2936;--ez-search__btn--color:var(--title--primary, #2B3A54);--ez-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-search__label--color:var(--title--primary, #2B3A54);--ez-search--space--medium:var(--space--medium, 12px);--ez-search--space--small:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-search--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)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-search__btn--color)}.btn:disabled{cursor:not-allowed;color:var(--ez-search__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;color:var(--ez-search__btn-disabled--color)}.btn:hover{color:var(--ez-search__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}";
|
|
15
16
|
|
|
16
17
|
const EzSearch = class {
|
|
17
18
|
constructor(hostRef) {
|
|
@@ -145,20 +146,6 @@ const EzSearch = class {
|
|
|
145
146
|
async clearValue() {
|
|
146
147
|
this.clearSearch();
|
|
147
148
|
}
|
|
148
|
-
scrollListener() {
|
|
149
|
-
var _a;
|
|
150
|
-
if (this._floatingID == undefined) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
if ((_a = this.listOptionsPosition) === null || _a === void 0 ? void 0 : _a.hardPosition) {
|
|
154
|
-
this.hideOptions();
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
window.requestAnimationFrame(() => {
|
|
158
|
-
this.updateListPosition();
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
149
|
async handleValueAsString(value) {
|
|
163
150
|
if (this.getSelectedOption(value)) {
|
|
164
151
|
this.setInputValue();
|
|
@@ -172,49 +159,6 @@ const EzSearch = class {
|
|
|
172
159
|
this.ezChange.emit(this.value);
|
|
173
160
|
this._currentValue = this.value;
|
|
174
161
|
}
|
|
175
|
-
updateListPosition() {
|
|
176
|
-
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
177
|
-
const elementRect = this._listWrapper.getBoundingClientRect();
|
|
178
|
-
const containerRect = this._listContainer.getBoundingClientRect();
|
|
179
|
-
const textInputRect = this._textInput.getBoundingClientRect();
|
|
180
|
-
const limitHeight = bottomLimit || window.innerHeight;
|
|
181
|
-
const neededHeight = containerRect.bottom + elementRect.height;
|
|
182
|
-
if (!fromBottom && (elementRect.top < 0 || neededHeight > limitHeight)) {
|
|
183
|
-
fromBottom = true;
|
|
184
|
-
}
|
|
185
|
-
if (!hardPosition) {
|
|
186
|
-
verticalPosition = verticalPosition || 0;
|
|
187
|
-
horizontalPosition = horizontalPosition || 0;
|
|
188
|
-
if (fromBottom) {
|
|
189
|
-
verticalPosition = window.innerHeight - textInputRect.top + verticalPosition;
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
verticalPosition += containerRect.top;
|
|
193
|
-
}
|
|
194
|
-
if (fromRight) {
|
|
195
|
-
horizontalPosition = window.innerWidth - textInputRect.right + horizontalPosition;
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
horizontalPosition += containerRect.left;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
if (verticalPosition != undefined) {
|
|
202
|
-
this._listWrapper.style[fromBottom ? "bottom" : "top"] = `${verticalPosition}px`;
|
|
203
|
-
this._listWrapper.style[fromBottom ? "top" : "bottom"] = "";
|
|
204
|
-
}
|
|
205
|
-
if (horizontalPosition != undefined) {
|
|
206
|
-
this._listWrapper.style[fromRight ? "right" : "left"] = `${horizontalPosition}px`;
|
|
207
|
-
this._listWrapper.style[fromRight ? "left" : "right"] = "";
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
getListPosition() {
|
|
211
|
-
if (this.listOptionsPosition) {
|
|
212
|
-
return this.listOptionsPosition;
|
|
213
|
-
}
|
|
214
|
-
return {
|
|
215
|
-
verticalPosition: 6
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
162
|
isDifferentValues(firstValue, secondValue) {
|
|
219
163
|
return core.ObjectUtils.objectToString(firstValue || {}) !== core.ObjectUtils.objectToString(secondValue || {});
|
|
220
164
|
}
|
|
@@ -229,24 +173,14 @@ const EzSearch = class {
|
|
|
229
173
|
getText() {
|
|
230
174
|
const currentValue = this.getSelectedOption(this._currentValue);
|
|
231
175
|
const text = this.getFormattedText(currentValue);
|
|
232
|
-
return
|
|
233
|
-
}
|
|
234
|
-
replaceQuotes(text) {
|
|
235
|
-
if (text == undefined) {
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
return String(text)
|
|
239
|
-
.replace(/&/g, '&')
|
|
240
|
-
.replace(/</g, '<')
|
|
241
|
-
.replace(/>/g, '>')
|
|
242
|
-
.replace(/"/g, '"');
|
|
176
|
+
return searchFormatters.replaceQuotes(text);
|
|
243
177
|
}
|
|
244
178
|
getSelectedOption(value) {
|
|
245
179
|
if (typeof value === "string" || value instanceof String) {
|
|
246
180
|
return this._visibleOptions.find(o => o.value === value);
|
|
247
181
|
}
|
|
248
182
|
if (value) {
|
|
249
|
-
return Object.assign(Object.assign({}, value), { value:
|
|
183
|
+
return Object.assign(Object.assign({}, value), { value: searchFormatters.replaceHighlight(value === null || value === void 0 ? void 0 : value.value), label: searchFormatters.replaceHighlight(value === null || value === void 0 ? void 0 : value.label) });
|
|
250
184
|
}
|
|
251
185
|
return value;
|
|
252
186
|
}
|
|
@@ -284,75 +218,19 @@ const EzSearch = class {
|
|
|
284
218
|
}
|
|
285
219
|
return 0;
|
|
286
220
|
}
|
|
287
|
-
createOption(detail) {
|
|
288
|
-
let { key, title } = detail;
|
|
289
|
-
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
290
|
-
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
291
|
-
title = core.StringUtils.decodeHtmlEntities(title);
|
|
292
|
-
const option = {
|
|
293
|
-
value: key === null || key === void 0 ? void 0 : key.replace(startHighlight, '').replace(endHighlight, ''),
|
|
294
|
-
label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
|
|
295
|
-
};
|
|
296
|
-
this.selectOption(option);
|
|
297
|
-
}
|
|
298
|
-
buildItem(opt, index$1) {
|
|
299
|
-
opt.label = opt.label || opt.value;
|
|
300
|
-
const card = {
|
|
301
|
-
key: opt.value,
|
|
302
|
-
title: opt.label,
|
|
303
|
-
details: opt.details
|
|
304
|
-
};
|
|
305
|
-
return index.h("div", { style: { "height": "100%" }, class: index$1 === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.createOption(card), onMouseOver: () => this._preSelection = index$1 }, index.h("ez-card-item", { item: card, compacted: true, enableKey: this.showOptionValue }));
|
|
306
|
-
}
|
|
307
221
|
showOptions() {
|
|
308
222
|
if (!this.enabled)
|
|
309
223
|
return;
|
|
310
224
|
if (this.isOptionsVisible()) {
|
|
311
225
|
return;
|
|
312
226
|
}
|
|
313
|
-
|
|
314
|
-
this._resizeObserver.observe(this._textInput);
|
|
315
|
-
this._floatingID = core.FloatingManager.float(this._listWrapper, this._listContainer, { autoClose: false, isFixed: true, backClickListener: () => this.hideOptions() });
|
|
316
|
-
this.setFocus();
|
|
317
|
-
window.requestAnimationFrame(() => {
|
|
318
|
-
this.updateListPosition();
|
|
319
|
-
if (!this.listOptionsPosition) {
|
|
320
|
-
this._listWrapper.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
321
|
-
}
|
|
322
|
-
});
|
|
227
|
+
this._ezPopOverPlusElement.showUnder(this._textInput);
|
|
323
228
|
}
|
|
324
229
|
hideOptions() {
|
|
325
|
-
|
|
326
|
-
core.FloatingManager.close(this._floatingID);
|
|
327
|
-
}
|
|
328
|
-
this._floatingID = undefined;
|
|
329
|
-
if (!!this._resizeObserver)
|
|
330
|
-
this._resizeObserver.unobserve(this._textInput);
|
|
230
|
+
this._ezPopOverPlusElement.hide();
|
|
331
231
|
}
|
|
332
232
|
isOptionsVisible() {
|
|
333
|
-
return this.
|
|
334
|
-
}
|
|
335
|
-
nextOption() {
|
|
336
|
-
if (!this.isOptionsVisible()) {
|
|
337
|
-
return;
|
|
338
|
-
}
|
|
339
|
-
this.showOptions();
|
|
340
|
-
this._preSelection = this._preSelection === undefined ? 0 : Math.min(this._preSelection + 1, this._visibleOptions.length - 1);
|
|
341
|
-
this.scrollToOption(this._visibleOptions[this._preSelection]);
|
|
342
|
-
}
|
|
343
|
-
previousOption() {
|
|
344
|
-
this._preSelection = this._preSelection === undefined ? 0 : Math.max(this._preSelection - 1, 0);
|
|
345
|
-
this.scrollToOption(this._visibleOptions[this._preSelection]);
|
|
346
|
-
}
|
|
347
|
-
scrollToOption(opt) {
|
|
348
|
-
window.requestAnimationFrame(() => {
|
|
349
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
350
|
-
? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
|
|
351
|
-
: undefined;
|
|
352
|
-
if (liElem) {
|
|
353
|
-
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
354
|
-
}
|
|
355
|
-
});
|
|
233
|
+
return this._ezPopOverPlusElement.opened;
|
|
356
234
|
}
|
|
357
235
|
selectCurrentOption() {
|
|
358
236
|
if (this._preSelection !== undefined) {
|
|
@@ -395,17 +273,11 @@ const EzSearch = class {
|
|
|
395
273
|
this._source = [];
|
|
396
274
|
this.updateVisibleOptions();
|
|
397
275
|
}
|
|
398
|
-
replaceHighlight(value) {
|
|
399
|
-
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
400
|
-
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
401
|
-
const newValue = String(value !== null && value !== void 0 ? value : "").replace(startHighlight, '').replace(endHighlight, '');
|
|
402
|
-
return this.replaceQuotes(newValue);
|
|
403
|
-
}
|
|
404
276
|
selectOption(newOption, focusOnInput = true) {
|
|
405
277
|
var _a, _b;
|
|
406
278
|
const currentValue = this.getSelectedOption(this.value);
|
|
407
|
-
const newOptionsReplaced = Object.assign(Object.assign({}, newOption), { value:
|
|
408
|
-
const newOptionsFormatted = Object.assign(Object.assign({}, newOptionsReplaced), { value:
|
|
279
|
+
const newOptionsReplaced = Object.assign(Object.assign({}, newOption), { value: searchFormatters.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.value), label: searchFormatters.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.label) });
|
|
280
|
+
const newOptionsFormatted = Object.assign(Object.assign({}, newOptionsReplaced), { value: searchFormatters.replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value), label: searchFormatters.replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.label) });
|
|
409
281
|
if ((((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOptionsFormatted === null || newOptionsFormatted === void 0 ? void 0 : newOptionsFormatted.value) === null || _b === void 0 ? void 0 : _b.toString()))
|
|
410
282
|
|| (currentValue == undefined && newOptionsFormatted != undefined && "value" in newOptionsFormatted)) {
|
|
411
283
|
const adjustedOpt = !(newOptionsFormatted === null || newOptionsFormatted === void 0 ? void 0 : newOptionsFormatted.value) ? undefined : newOptionsFormatted;
|
|
@@ -515,7 +387,7 @@ const EzSearch = class {
|
|
|
515
387
|
this.showNoResultMessage();
|
|
516
388
|
return;
|
|
517
389
|
}
|
|
518
|
-
this._currentValue = value ? Object.assign(Object.assign({}, value), { value:
|
|
390
|
+
this._currentValue = value ? Object.assign(Object.assign({}, value), { value: searchFormatters.replaceHighlight(value.value), label: searchFormatters.replaceHighlight(value.label) }) : value;
|
|
519
391
|
this.value = this._currentValue;
|
|
520
392
|
this.setTextInputValue();
|
|
521
393
|
}
|
|
@@ -524,7 +396,7 @@ const EzSearch = class {
|
|
|
524
396
|
if (this.value === undefined || this.value === null)
|
|
525
397
|
return;
|
|
526
398
|
const textValue = (typeof this.value === 'string') ? this.value : this.getFormattedText(this.value);
|
|
527
|
-
this._textInput.value =
|
|
399
|
+
this._textInput.value = searchFormatters.replaceQuotes(textValue);
|
|
528
400
|
}
|
|
529
401
|
}
|
|
530
402
|
loadOptionValue(argument) {
|
|
@@ -561,7 +433,7 @@ const EzSearch = class {
|
|
|
561
433
|
return;
|
|
562
434
|
}
|
|
563
435
|
let text = this.getFormattedText(this.value);
|
|
564
|
-
text =
|
|
436
|
+
text = searchFormatters.replaceQuotes(text);
|
|
565
437
|
this._textInput.value = text;
|
|
566
438
|
}
|
|
567
439
|
//---------------------------------------------
|
|
@@ -588,9 +460,6 @@ const EzSearch = class {
|
|
|
588
460
|
}
|
|
589
461
|
componentDidRender() {
|
|
590
462
|
var _a;
|
|
591
|
-
if (this._floatingID === undefined) {
|
|
592
|
-
this._listWrapper.remove();
|
|
593
|
-
}
|
|
594
463
|
(_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
|
|
595
464
|
core.ElementIDUtils.addIDInfoIfNotExists(elem, "itemSearch");
|
|
596
465
|
});
|
|
@@ -602,10 +471,6 @@ const EzSearch = class {
|
|
|
602
471
|
window.requestAnimationFrame(() => {
|
|
603
472
|
if (!Array.isArray(entries) || !entries.length)
|
|
604
473
|
return;
|
|
605
|
-
const { clientWidth } = this._listContainer;
|
|
606
|
-
if (clientWidth > 0 && !!this._listWrapper) {
|
|
607
|
-
this._listWrapper.style.width = `${clientWidth}px`;
|
|
608
|
-
}
|
|
609
474
|
});
|
|
610
475
|
});
|
|
611
476
|
await this.handleInitialValue();
|
|
@@ -672,7 +537,7 @@ const EzSearch = class {
|
|
|
672
537
|
this._changeDeboucingTimeout = null;
|
|
673
538
|
}
|
|
674
539
|
}
|
|
675
|
-
keyDownHandler(event) {
|
|
540
|
+
async keyDownHandler(event) {
|
|
676
541
|
this._tabPressed = false;
|
|
677
542
|
if (event.ctrlKey) {
|
|
678
543
|
if (event.key === "f" || event.key === "F") {
|
|
@@ -688,15 +553,20 @@ const EzSearch = class {
|
|
|
688
553
|
switch (event.key) {
|
|
689
554
|
case "ArrowDown":
|
|
690
555
|
event.stopPropagation();
|
|
691
|
-
if (this.canShowListOptions())
|
|
556
|
+
if (this.canShowListOptions()) {
|
|
692
557
|
event.preventDefault();
|
|
693
|
-
|
|
558
|
+
}
|
|
559
|
+
if (!this.isOptionsVisible()) {
|
|
560
|
+
this.showOptions();
|
|
561
|
+
}
|
|
562
|
+
await this._searchList.nextOption();
|
|
694
563
|
break;
|
|
695
564
|
case "ArrowUp":
|
|
696
565
|
event.stopPropagation();
|
|
697
|
-
if (this.canShowListOptions())
|
|
566
|
+
if (this.canShowListOptions()) {
|
|
698
567
|
event.preventDefault();
|
|
699
|
-
|
|
568
|
+
}
|
|
569
|
+
await this._searchList.previousOption();
|
|
700
570
|
break;
|
|
701
571
|
case "Enter":
|
|
702
572
|
this.handleEventPropagation(event);
|
|
@@ -718,7 +588,7 @@ const EzSearch = class {
|
|
|
718
588
|
}
|
|
719
589
|
//O evento deve ter sua propagação interrompida, apenas se a lista de opções estiver sendo exibida.
|
|
720
590
|
handleEventPropagation(event) {
|
|
721
|
-
if (this.
|
|
591
|
+
if (this._ezPopOverPlusElement.opened && this.stopPropagateEnterKeyEvent) {
|
|
722
592
|
event.stopPropagation();
|
|
723
593
|
}
|
|
724
594
|
}
|
|
@@ -730,17 +600,17 @@ const EzSearch = class {
|
|
|
730
600
|
return !this._showLoading && this._visibleOptions.length > 0;
|
|
731
601
|
}
|
|
732
602
|
canShowLoadSpinDescription() {
|
|
733
|
-
return this._showLoadingDescription && this.
|
|
603
|
+
return this._showLoadingDescription && !this._ezPopOverPlusElement.opened;
|
|
604
|
+
}
|
|
605
|
+
onChangePreSelection(value) {
|
|
606
|
+
this._preSelection = value;
|
|
734
607
|
}
|
|
735
608
|
render() {
|
|
736
609
|
var _a;
|
|
737
610
|
core.ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
738
611
|
return (index.h(index.Host, null, index.h("ez-text-input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("textInput"), class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, index.h("button", { class: "btn", slot: "leftIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, this.canShowLoadSpinDescription() ? index.h("div", { class: "message__loading" }) : index.h("ez-icon", { iconName: "search" })), (((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value) && (this._criteria || this.value) || this.ensureClearButtonVisible)
|
|
739
612
|
? index.h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, index.h("ez-icon", { iconName: "close" }))
|
|
740
|
-
: undefined), index.h("
|
|
741
|
-
&& this._visibleOptions.length === 0
|
|
742
|
-
&& index.h("div", { class: "message" }, index.h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
|
|
743
|
-
&& index.h("div", { class: "message" }, index.h("div", { class: "message__loading" })), index.h("span", { class: "item__value item__value--hidden", ref: elem => this._itemValueBasis = elem }), this.canShowListOptions() && this._visibleOptions.map((opt, index) => this.buildItem(opt, index)))))));
|
|
613
|
+
: undefined), index.h("ez-popover-plus", { ref: elem => this._ezPopOverPlusElement = elem, autoClose: false, overlayType: "none", useAnchorSize: true, anchorElement: [this._textInput, this.el] }, index.h("search-list", { ref: (ref) => this._searchList = ref, showLoading: this._showLoading, visibleOptions: this._visibleOptions, textEmptyList: this._textEmptyList, canShowListOptions: this.canShowListOptions(), value: this.value, showOptionValue: this.showOptionValue, preSelection: this._preSelection, onChangeValue: ({ detail }) => this.selectOption(detail), onChangePreSelection: ({ detail }) => this.onChangePreSelection(detail) }))));
|
|
744
614
|
}
|
|
745
615
|
get el() { return index.getElement(this); }
|
|
746
616
|
static get watchers() { return {
|