@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-76625.0 → 0.0.0-bugfix-dev-KB-83282.0
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 +7 -1415
- package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +387 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +58 -184
- package/dist/cjs/ez-grid.cjs.entry.js +58 -0
- package/dist/cjs/ez-popover-core_2.cjs.entry.js +1504 -0
- package/dist/cjs/ez-search.cjs.entry.js +158 -28
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +6 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/ez-card-item/ez-card-item.css +3 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css +205 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +426 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -250
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +61 -194
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +3 -0
- package/dist/collection/components/ez-grid/ez-grid.js +56 -1
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +27 -33
- 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 +18 -77
- package/dist/collection/components/ez-search/ez-search.css +219 -0
- package/dist/collection/components/ez-search/ez-search.js +167 -28
- package/dist/custom-elements/index.d.ts +6 -6
- package/dist/custom-elements/index.js +468 -359
- package/dist/esm/ez-card-item_2.entry.js +7 -1415
- package/dist/esm/ez-combo-box-list_3.entry.js +381 -0
- package/dist/esm/ez-combo-box.entry.js +59 -185
- package/dist/esm/ez-grid.entry.js +59 -1
- package/dist/esm/ez-popover-core_2.entry.js +1499 -0
- package/dist/esm/ez-search.entry.js +159 -29
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +6 -6
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-3a009184.entry.js +1 -0
- package/dist/ezui/{p-a5950a0d.entry.js → p-53116373.entry.js} +46 -46
- package/dist/ezui/p-58783dcf.entry.js +1 -0
- package/dist/ezui/p-65f471bc.entry.js +1 -0
- package/dist/ezui/p-7bd15498.entry.js +1 -0
- package/dist/ezui/p-f5931caa.entry.js +1 -0
- package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +104 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +7 -16
- package/dist/types/components/ez-grid/ez-grid.d.ts +5 -0
- package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +4 -5
- package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +2 -12
- package/dist/types/components/ez-search/ez-search.d.ts +13 -3
- package/dist/types/components.d.ts +127 -66
- package/package.json +1 -1
- package/react/components.d.ts +1 -1
- package/react/components.js +1 -1
- package/react/components.js.map +1 -1
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +0 -236
- package/dist/cjs/ez-popover-plus_3.cjs.entry.js +0 -184
- package/dist/cjs/searchFormatters-b7e1ed1e.js +0 -23
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.css +0 -227
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.js +0 -289
- package/dist/collection/components/ez-search/utils/searchFormatters.js +0 -18
- package/dist/esm/ez-custom-form-input_2.entry.js +0 -231
- package/dist/esm/ez-popover-plus_3.entry.js +0 -178
- package/dist/esm/searchFormatters-8229207e.js +0 -20
- package/dist/ezui/p-31da1b57.entry.js +0 -1
- package/dist/ezui/p-37201156.entry.js +0 -1
- package/dist/ezui/p-40a60148.js +0 -1
- package/dist/ezui/p-64b461b3.entry.js +0 -1
- package/dist/ezui/p-b7706b43.entry.js +0 -1
- package/dist/ezui/p-dc8b36c3.entry.js +0 -1
- package/dist/types/components/ez-search/subcomponent/search-list/search-list.d.ts +0 -23
- package/dist/types/components/ez-search/utils/searchFormatters.d.ts +0 -2
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-a7b0c73d.js');
|
|
6
|
-
const ICustomRender = require('./ICustomRender-6fafffce.js');
|
|
7
|
-
const core = require('@sankhyalabs/core');
|
|
8
|
-
const ApplicationUtils = require('./ApplicationUtils-c9d1205c.js');
|
|
9
|
-
require('./DialogType-2114c337.js');
|
|
10
|
-
require('./CheckMode-ecb90b87.js');
|
|
11
|
-
|
|
12
|
-
const EzCustomFormInput = class {
|
|
13
|
-
constructor(hostRef) {
|
|
14
|
-
index.registerInstance(this, hostRef);
|
|
15
|
-
this.gui = undefined;
|
|
16
|
-
this.customEditor = undefined;
|
|
17
|
-
this.formViewField = undefined;
|
|
18
|
-
this.value = undefined;
|
|
19
|
-
this.detailContext = undefined;
|
|
20
|
-
this.builderFallback = undefined;
|
|
21
|
-
this.selectedRecord = undefined;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Aplica foco no campo.
|
|
25
|
-
*/
|
|
26
|
-
async setFocus() {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
(_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["setFocus"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Remove o foco do campo.
|
|
32
|
-
*/
|
|
33
|
-
async setBlur() {
|
|
34
|
-
var _a, _b;
|
|
35
|
-
(_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["setBlur"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Retorna se o conteúdo é inválido.
|
|
39
|
-
*/
|
|
40
|
-
async isInvalid() {
|
|
41
|
-
var _a, _b;
|
|
42
|
-
return ((_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["isInvalid"]) === null || _b === void 0 ? void 0 : _b.call(_a)) || false;
|
|
43
|
-
}
|
|
44
|
-
watchValue() {
|
|
45
|
-
this.handleValue(this.gui);
|
|
46
|
-
}
|
|
47
|
-
watchCustomEditor() {
|
|
48
|
-
this.getContent();
|
|
49
|
-
}
|
|
50
|
-
watchFormViewField(newValue, oldValue) {
|
|
51
|
-
if (!core.ObjectUtils.equals(newValue, oldValue))
|
|
52
|
-
this.getContent();
|
|
53
|
-
}
|
|
54
|
-
watchDetailContext() {
|
|
55
|
-
this.getContent();
|
|
56
|
-
}
|
|
57
|
-
watchBuilderFallback() {
|
|
58
|
-
this.getContent();
|
|
59
|
-
}
|
|
60
|
-
watchSelectedRecord(newValue, oldValue) {
|
|
61
|
-
const newRecordId = newValue === null || newValue === void 0 ? void 0 : newValue['__record__id__'];
|
|
62
|
-
const oldRecordId = oldValue === null || oldValue === void 0 ? void 0 : oldValue['__record__id__'];
|
|
63
|
-
if (newRecordId !== oldRecordId) {
|
|
64
|
-
this.getContent();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
getContent() {
|
|
68
|
-
var _a, _b, _c, _d, _e;
|
|
69
|
-
const fieldProps = new Map();
|
|
70
|
-
for (const prop in this.formViewField.props) {
|
|
71
|
-
fieldProps.set(prop, this.formViewField.props[prop]);
|
|
72
|
-
}
|
|
73
|
-
const params = {
|
|
74
|
-
value: this.value,
|
|
75
|
-
name: this.formViewField.name,
|
|
76
|
-
currentEditor: this.builderFallback(this.formViewField),
|
|
77
|
-
setValue: (value) => this.setValue(value),
|
|
78
|
-
getValue: this.getValue,
|
|
79
|
-
record: this.selectedRecord,
|
|
80
|
-
editorMetadata: {
|
|
81
|
-
label: this.formViewField.label,
|
|
82
|
-
hidden: ((_a = this.formViewField.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
|
|
83
|
-
userInterface: this.formViewField.userInterface,
|
|
84
|
-
options: (_b = this.formViewField.props) === null || _b === void 0 ? void 0 : _b.options,
|
|
85
|
-
props: this.formViewField.props ? fieldProps : undefined,
|
|
86
|
-
optionLoader: this.formViewField.optionLoader
|
|
87
|
-
},
|
|
88
|
-
source: ICustomRender.CustomEditorSource.FORM,
|
|
89
|
-
detailContext: this.detailContext
|
|
90
|
-
};
|
|
91
|
-
let gui = this.customEditor.getEditorElement(params);
|
|
92
|
-
if (!gui) {
|
|
93
|
-
gui = this.builderFallback(this.formViewField);
|
|
94
|
-
this.handleValue(gui);
|
|
95
|
-
this.gui = gui;
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
if (!(gui instanceof HTMLElement) && typeof gui !== 'string') {
|
|
99
|
-
this.handleValue(gui);
|
|
100
|
-
this.gui = gui;
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
if (typeof gui === 'string') {
|
|
104
|
-
gui = core.HTMLBuilder.parseElement(gui);
|
|
105
|
-
}
|
|
106
|
-
const value = (_e = (_d = (_c = this.value) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : this.value) !== null && _e !== void 0 ? _e : '';
|
|
107
|
-
gui.setAttribute('value', value);
|
|
108
|
-
this.gui = index.h("div", { key: core.StringUtils.generateUUID(), ref: el => el && el.appendChild(gui) });
|
|
109
|
-
}
|
|
110
|
-
setValue(value) {
|
|
111
|
-
this.value = value;
|
|
112
|
-
}
|
|
113
|
-
getValue() {
|
|
114
|
-
return this.value;
|
|
115
|
-
}
|
|
116
|
-
handleValue(gui) {
|
|
117
|
-
var _a;
|
|
118
|
-
//@ts-ignore
|
|
119
|
-
(_a = gui.$children$) === null || _a === void 0 ? void 0 : _a.forEach((child) => {
|
|
120
|
-
child.$attrs$.value = this.value;
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
componentWillLoad() {
|
|
124
|
-
this.getContent();
|
|
125
|
-
}
|
|
126
|
-
render() {
|
|
127
|
-
return (index.h(index.Host, null, this.gui));
|
|
128
|
-
}
|
|
129
|
-
static get watchers() { return {
|
|
130
|
-
"value": ["watchValue"],
|
|
131
|
-
"customEditor": ["watchCustomEditor"],
|
|
132
|
-
"formViewField": ["watchFormViewField"],
|
|
133
|
-
"detailContext": ["watchDetailContext"],
|
|
134
|
-
"builderFallback": ["watchBuilderFallback"],
|
|
135
|
-
"selectedRecord": ["watchSelectedRecord"]
|
|
136
|
-
}; }
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const ezTextEditCss = ":host{display:flex;align-items:center;gap:5px}.text-edit__form-input{width:auto;--ez-text-input__input--padding:0px}.text-edit__hidden-value{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}";
|
|
140
|
-
|
|
141
|
-
const EzTextEdit = class {
|
|
142
|
-
constructor(hostRef) {
|
|
143
|
-
index.registerInstance(this, hostRef);
|
|
144
|
-
this.saveEdition = index.createEvent(this, "saveEdition", 7);
|
|
145
|
-
this.cancelEdition = index.createEvent(this, "cancelEdition", 7);
|
|
146
|
-
this._newValue = undefined;
|
|
147
|
-
this.value = undefined;
|
|
148
|
-
this.styled = undefined;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Aplica foco no campo.
|
|
152
|
-
*/
|
|
153
|
-
async applyFocusSelect() {
|
|
154
|
-
this.calcSizeInput(this.value, true);
|
|
155
|
-
}
|
|
156
|
-
calcSizeInput(value, setSelect = false) {
|
|
157
|
-
var _a, _b;
|
|
158
|
-
const textInput = (_b = (_a = this._inputElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('input');
|
|
159
|
-
if (textInput != undefined) {
|
|
160
|
-
const sizeText = this.getWidthValue(value);
|
|
161
|
-
textInput.style.width = sizeText + 'px';
|
|
162
|
-
if (setSelect) {
|
|
163
|
-
setTimeout(() => textInput.select(), 100);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
getWidthValue(value) {
|
|
168
|
-
if (this._valueBasis != undefined) {
|
|
169
|
-
const span = this._valueBasis;
|
|
170
|
-
if (value != undefined) {
|
|
171
|
-
const cursorSpace = 2;
|
|
172
|
-
span.innerHTML = value;
|
|
173
|
-
return span.clientWidth > 0 ? (span.clientWidth + cursorSpace) : cursorSpace;
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
span.innerHTML = "";
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
return 0;
|
|
180
|
-
}
|
|
181
|
-
setStyledInput() {
|
|
182
|
-
var _a, _b;
|
|
183
|
-
let fontSize = "";
|
|
184
|
-
let fontWeight = "";
|
|
185
|
-
let fontFamily = "";
|
|
186
|
-
if (this.styled != undefined) {
|
|
187
|
-
fontSize = this.styled.fontSize;
|
|
188
|
-
fontWeight = this.styled.fontWeight;
|
|
189
|
-
fontFamily = this.styled.fontFamily;
|
|
190
|
-
}
|
|
191
|
-
const textInput = (_b = (_a = this._inputElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('input');
|
|
192
|
-
if (textInput != undefined) {
|
|
193
|
-
textInput.style.fontSize = fontSize;
|
|
194
|
-
textInput.style.fontWeight = fontWeight;
|
|
195
|
-
textInput.style.fontFamily = fontFamily;
|
|
196
|
-
}
|
|
197
|
-
const span = this._valueBasis;
|
|
198
|
-
if (span != undefined) {
|
|
199
|
-
span.style.fontSize = fontSize;
|
|
200
|
-
span.style.fontWeight = fontWeight;
|
|
201
|
-
span.style.fontFamily = fontFamily;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
handleSaveEdition() {
|
|
205
|
-
if (!this._newValue) {
|
|
206
|
-
ApplicationUtils.ApplicationUtils.alert("Aviso", "Não é possível salvar um campo em branco.").then(() => {
|
|
207
|
-
this.setNewValue(this.value, true);
|
|
208
|
-
});
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
this.saveEdition.emit({ value: this.value, newValue: this._newValue });
|
|
212
|
-
}
|
|
213
|
-
handleCancelEdition() {
|
|
214
|
-
this.cancelEdition.emit();
|
|
215
|
-
}
|
|
216
|
-
setNewValue(value, setSelect = false) {
|
|
217
|
-
this._newValue = value;
|
|
218
|
-
this.calcSizeInput(this._newValue, setSelect);
|
|
219
|
-
}
|
|
220
|
-
componentDidLoad() {
|
|
221
|
-
this.applyFocusSelect();
|
|
222
|
-
this.setNewValue(this.value);
|
|
223
|
-
}
|
|
224
|
-
componentDidRender() {
|
|
225
|
-
this.setStyledInput();
|
|
226
|
-
}
|
|
227
|
-
render() {
|
|
228
|
-
core.ElementIDUtils.addIDInfoIfNotExists(this._element, 'input');
|
|
229
|
-
return (index.h(index.Host, null, index.h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }), index.h("ez-text-input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("textInput"), onInput: () => { this.calcSizeInput(this._newValue); }, class: "text-edit__form-input", value: this._newValue, ref: (elem) => this._inputElement = elem, mode: "slim", onEzChange: (evt) => this.setNewValue(evt === null || evt === void 0 ? void 0 : evt.detail), noBorder: true }), index.h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }), index.h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.handleCancelEdition(); } })));
|
|
230
|
-
}
|
|
231
|
-
get _element() { return index.getElement(this); }
|
|
232
|
-
};
|
|
233
|
-
EzTextEdit.style = ezTextEditCss;
|
|
234
|
-
|
|
235
|
-
exports.ez_custom_form_input = EzCustomFormInput;
|
|
236
|
-
exports.ez_text_edit = EzTextEdit;
|
|
@@ -1,184 +0,0 @@
|
|
|
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
|
-
}
|
|
23
|
-
async observeOpened(newValue) {
|
|
24
|
-
if (newValue && !this._popOverCore) {
|
|
25
|
-
this.renderPopoverCore();
|
|
26
|
-
}
|
|
27
|
-
this._popOverCore.opened = newValue;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Atualiza a posição do popover.
|
|
31
|
-
*/
|
|
32
|
-
async updatePosition(top, left) {
|
|
33
|
-
await this._popOverCore.updatePosition(top, left);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Exibe o ez-popover.
|
|
37
|
-
*/
|
|
38
|
-
async show(top, left) {
|
|
39
|
-
if (!this._popOverCore) {
|
|
40
|
-
this.renderPopoverCore();
|
|
41
|
-
}
|
|
42
|
-
await this._popOverCore.show(top, left);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Ancora a exibição do popOver a um elemento HTML.
|
|
46
|
-
*/
|
|
47
|
-
async showUnder(element, options) {
|
|
48
|
-
if (!this._popOverCore) {
|
|
49
|
-
this.renderPopoverCore();
|
|
50
|
-
}
|
|
51
|
-
await this._popOverCore.showUnder(element, options);
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Oculta o ez-popover.
|
|
55
|
-
*/
|
|
56
|
-
async hide() {
|
|
57
|
-
var _a;
|
|
58
|
-
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.hide());
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Altera as opções.
|
|
62
|
-
*/
|
|
63
|
-
async setOptions(options) {
|
|
64
|
-
await this._popOverCore.setOptions(options);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Altera o elemento de ancoragem.
|
|
68
|
-
*/
|
|
69
|
-
async setAnchorElement(anchor) {
|
|
70
|
-
await this._popOverCore.setAnchorElement(anchor);
|
|
71
|
-
}
|
|
72
|
-
renderPopoverCore() {
|
|
73
|
-
this._popOverCore = document.createElement('ez-popover-core');
|
|
74
|
-
this._popOverCore.opened = this.opened;
|
|
75
|
-
this._popOverCore.anchorElement = this.anchorElement;
|
|
76
|
-
this._popOverCore.autoClose = this.autoClose;
|
|
77
|
-
this._popOverCore.boxWidth = this.boxWidth;
|
|
78
|
-
this._popOverCore.overlayType = this.overlayType;
|
|
79
|
-
this._popOverCore.options = this.options;
|
|
80
|
-
this._popOverCore.useAnchorSize = this.useAnchorSize;
|
|
81
|
-
this._popOverCore.addEventListener('ezVisibilityChange', ({ detail }) => {
|
|
82
|
-
this.ezVisibilityChange.emit(detail);
|
|
83
|
-
this.opened = detail;
|
|
84
|
-
});
|
|
85
|
-
this._popOverCore.appendChild(this._host.children.item(0));
|
|
86
|
-
document.body.appendChild(this._popOverCore);
|
|
87
|
-
}
|
|
88
|
-
render() {
|
|
89
|
-
return (index.h(index.Host, null, index.h("slot", null)));
|
|
90
|
-
}
|
|
91
|
-
get _host() { return index.getElement(this); }
|
|
92
|
-
static get watchers() { return {
|
|
93
|
-
"opened": ["observeOpened"]
|
|
94
|
-
}; }
|
|
95
|
-
};
|
|
96
|
-
EzPopoverPlus.style = ezPopoverPlusCss;
|
|
97
|
-
|
|
98
|
-
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)}";
|
|
99
|
-
|
|
100
|
-
const MultiSelectionBoxMessage = class {
|
|
101
|
-
constructor(hostRef) {
|
|
102
|
-
index.registerInstance(this, hostRef);
|
|
103
|
-
this.message = undefined;
|
|
104
|
-
}
|
|
105
|
-
render() {
|
|
106
|
-
return (index.h("div", { class: "multi-selection__message" }, index.h("span", { class: "multi-selection__text-message" }, this.message)));
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
MultiSelectionBoxMessage.style = multiSelectionBoxMessageCss;
|
|
110
|
-
|
|
111
|
-
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}}";
|
|
112
|
-
|
|
113
|
-
const SearchList = class {
|
|
114
|
-
constructor(hostRef) {
|
|
115
|
-
index.registerInstance(this, hostRef);
|
|
116
|
-
this.changeValue = index.createEvent(this, "changeValue", 7);
|
|
117
|
-
this.changePreSelection = index.createEvent(this, "changePreSelection", 7);
|
|
118
|
-
this._startHighlightTag = "<span class='card-item__highlight'>";
|
|
119
|
-
this._endHighlightTag = "</span>";
|
|
120
|
-
this.showLoading = undefined;
|
|
121
|
-
this.visibleOptions = [];
|
|
122
|
-
this.textEmptyList = undefined;
|
|
123
|
-
this.canShowListOptions = undefined;
|
|
124
|
-
this.value = undefined;
|
|
125
|
-
this.showOptionValue = true;
|
|
126
|
-
this.preSelection = undefined;
|
|
127
|
-
}
|
|
128
|
-
async nextOption() {
|
|
129
|
-
const newPreSelection = this.preSelection === undefined ? 0 : Math.min(this.preSelection + 1, this.visibleOptions.length - 1);
|
|
130
|
-
this.changePreSelection.emit(newPreSelection);
|
|
131
|
-
this.scrollToOption(this.visibleOptions[newPreSelection]);
|
|
132
|
-
}
|
|
133
|
-
async previousOption() {
|
|
134
|
-
const newPreSelection = this.preSelection === undefined ? 0 : Math.max(this.preSelection - 1, 0);
|
|
135
|
-
this.changePreSelection.emit(newPreSelection);
|
|
136
|
-
this.scrollToOption(this.visibleOptions[newPreSelection]);
|
|
137
|
-
}
|
|
138
|
-
selectOption(newOption) {
|
|
139
|
-
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) });
|
|
140
|
-
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) });
|
|
141
|
-
this.changeValue.emit(newOptionsFormatted);
|
|
142
|
-
}
|
|
143
|
-
createOption(detail) {
|
|
144
|
-
let { key, title } = detail;
|
|
145
|
-
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
146
|
-
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
147
|
-
title = core.StringUtils.decodeHtmlEntities(title);
|
|
148
|
-
const option = {
|
|
149
|
-
value: key === null || key === void 0 ? void 0 : key.replace(startHighlight, '').replace(endHighlight, ''),
|
|
150
|
-
label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
|
|
151
|
-
};
|
|
152
|
-
this.selectOption(option);
|
|
153
|
-
}
|
|
154
|
-
scrollToOption(opt) {
|
|
155
|
-
window.requestAnimationFrame(() => {
|
|
156
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
157
|
-
? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
|
|
158
|
-
: undefined;
|
|
159
|
-
if (liElem) {
|
|
160
|
-
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
buildItem(opt, index$1) {
|
|
165
|
-
opt.label = opt.label || opt.value;
|
|
166
|
-
const card = {
|
|
167
|
-
key: opt.value,
|
|
168
|
-
title: opt.label,
|
|
169
|
-
details: opt.details
|
|
170
|
-
};
|
|
171
|
-
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 }));
|
|
172
|
-
}
|
|
173
|
-
render() {
|
|
174
|
-
return (index.h(index.Host, null, index.h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this.showLoading
|
|
175
|
-
&& this.visibleOptions.length === 0
|
|
176
|
-
&& index.h("div", { class: "message" }, index.h("span", { class: "message__no-result" }, this.textEmptyList)), this.showLoading
|
|
177
|
-
&& index.h("div", { class: "message" }, index.h("div", { class: "message__loading" })), this.canShowListOptions && this.visibleOptions.map((opt, index) => this.buildItem(opt, index)))));
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
SearchList.style = searchListCss;
|
|
181
|
-
|
|
182
|
-
exports.ez_popover_plus = EzPopoverPlus;
|
|
183
|
-
exports.multi_selection_box_message = MultiSelectionBoxMessage;
|
|
184
|
-
exports.search_list = SearchList;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const START_HIGH_LIGHT_TAG = "<span class='card-item__highlight'>";
|
|
4
|
-
const END_HIGH_LIGHT_TAG = "</span>";
|
|
5
|
-
function replaceHighlight(value) {
|
|
6
|
-
const startHighlight = new RegExp(START_HIGH_LIGHT_TAG, 'g');
|
|
7
|
-
const endHighlight = new RegExp(END_HIGH_LIGHT_TAG, 'g');
|
|
8
|
-
const newValue = String(value !== null && value !== void 0 ? value : "").replace(startHighlight, '').replace(endHighlight, '');
|
|
9
|
-
return replaceQuotes(newValue);
|
|
10
|
-
}
|
|
11
|
-
function replaceQuotes(text) {
|
|
12
|
-
if (text == undefined) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
return String(text)
|
|
16
|
-
.replace(/&/g, '&')
|
|
17
|
-
.replace(/</g, '<')
|
|
18
|
-
.replace(/>/g, '>')
|
|
19
|
-
.replace(/"/g, '"');
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
exports.replaceHighlight = replaceHighlight;
|
|
23
|
-
exports.replaceQuotes = replaceQuotes;
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
/* list */
|
|
3
|
-
/*@doc Define a cor do texto da lista de opções.*/
|
|
4
|
-
--ez-search__list-title--primary: var(--title--primary, #2B3A54);
|
|
5
|
-
/*@doc Define a cor do texto do value da lista de opções.*/
|
|
6
|
-
--ez-search__list-text--primary: var(--text--primary, #626e82);
|
|
7
|
-
/*@doc Define a altura do box da lista de opções.*/
|
|
8
|
-
--ez-search__list-height: calc(var(--ez-search--font-size) + var(--ez-search--space--medium) + 4px);
|
|
9
|
-
/*@doc Define a largura mínima da lista de opções.*/
|
|
10
|
-
--ez-search__list-min-width: 64px;
|
|
11
|
-
|
|
12
|
-
/* scrollbar */
|
|
13
|
-
/*@doc Define a cor da barra de rolagem do componente.*/
|
|
14
|
-
--ez-search__scrollbar--color-default: var(--scrollbar--default, #626e82);
|
|
15
|
-
/*@doc Define a cor de fundo da barra de rolagem do componente.*/
|
|
16
|
-
--ez-search__scrollbar--color-background: var(--scrollbar--background, #E5EAF0);
|
|
17
|
-
/*@doc Define a cor do hover na barra de rolagem do componente.*/
|
|
18
|
-
--ez-search__scrollbar--color-hover: var(--scrollbar--hover, #2B3A54);
|
|
19
|
-
/*@doc Define a cor do active na barra de rolagem do componente.*/
|
|
20
|
-
--ez-search__scrollbar--color-clicked: var(--scrollbar--clicked, #a2abb9);
|
|
21
|
-
/*@doc Define o raio da borda da barra de rolagem do componente.*/
|
|
22
|
-
--ez-search__scrollbar--border-radius: var(--border--radius-small, 6px);
|
|
23
|
-
/*@doc Define a largura da barra de rolagem do componente.*/
|
|
24
|
-
--ez-search__scrollbar--width: var(--space--small, 6px);
|
|
25
|
-
|
|
26
|
-
/* general */
|
|
27
|
-
/*@doc Define o raio da borda do input quando pequeno.*/
|
|
28
|
-
--ez-search--border-radius-small: var(--border--radius-small, 6px);
|
|
29
|
-
/*@doc Define o tamanho da fonte dentro do input.*/
|
|
30
|
-
--ez-search--font-size: var(--text--medium, 14px);
|
|
31
|
-
/*@doc Define a família da fonte dentro do input.*/
|
|
32
|
-
--ez-search--font-family: var(--font-pattern, Arial);
|
|
33
|
-
/*@doc Define o peso da fonte dentro do input quando pesada.*/
|
|
34
|
-
--ez-search--font-weight--large: var(--text-weight--large, 500);
|
|
35
|
-
/*@doc Define o peso da fonte dentro do input quando média.*/
|
|
36
|
-
--ez-search--font-weight--medium: var(--text-weight--medium, 400);
|
|
37
|
-
/*@doc Define a cor de fundo dos itens da lista de opções.*/
|
|
38
|
-
--ez-search--background-medium: var(--background--medium, #f0f3f7);
|
|
39
|
-
/*@doc Define a altura da linha do texto dentro do input.*/
|
|
40
|
-
--ez-search--line-height: calc(var(--text--medium, 14px) + 4px);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.list-options {
|
|
44
|
-
position: relative;
|
|
45
|
-
z-index: var(--more-visible, 2);
|
|
46
|
-
margin: var(--space--small) 0px;
|
|
47
|
-
padding: 0px;
|
|
48
|
-
padding-inline-start: 0px;
|
|
49
|
-
box-sizing: border-box;
|
|
50
|
-
width: 100%;
|
|
51
|
-
height: 100%;
|
|
52
|
-
max-height: 350px;
|
|
53
|
-
min-width: 150px;
|
|
54
|
-
display: flex;
|
|
55
|
-
flex-direction: column;
|
|
56
|
-
scroll-behavior: smooth;
|
|
57
|
-
overflow-y: auto;
|
|
58
|
-
overflow-x: hidden;
|
|
59
|
-
scrollbar-width: thin;
|
|
60
|
-
|
|
61
|
-
/*public*/
|
|
62
|
-
scrollbar-color: var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background);
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.list-options::-webkit-scrollbar {
|
|
67
|
-
/*public*/
|
|
68
|
-
background-color: var(--scrollbar--background);
|
|
69
|
-
width: var(--space--small);
|
|
70
|
-
max-width: var(--space--small);
|
|
71
|
-
min-width: var(--space--small);
|
|
72
|
-
height: var(--space--small);
|
|
73
|
-
max-height: var(--space--small);
|
|
74
|
-
min-height: var(--space--small);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.list-options::-webkit-scrollbar-track {
|
|
78
|
-
/*public*/
|
|
79
|
-
background-color: var(--ez-search__scrollbar--color-background);
|
|
80
|
-
border-radius: var(--ez-search__scrollbar--border-radius);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.list-options::-webkit-scrollbar-thumb {
|
|
84
|
-
/*public*/
|
|
85
|
-
background-color: var(--ez-search__scrollbar--color-default);
|
|
86
|
-
border-radius: var(--ez-search__scrollbar--border-radius);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.list-options::-webkit-scrollbar-thumb:vertical:hover,
|
|
90
|
-
.list-options::-webkit-scrollbar-thumb:horizontal:hover {
|
|
91
|
-
/*public*/
|
|
92
|
-
background-color: var(--ez-search__scrollbar--color-hover);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.list-options::-webkit-scrollbar-thumb:vertical:active,
|
|
96
|
-
.list-options::-webkit-scrollbar-thumb:horizontal:active {
|
|
97
|
-
/*public*/
|
|
98
|
-
background-color: var(--ez-search__scrollbar--color-clicked);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.message {
|
|
102
|
-
text-align: center;
|
|
103
|
-
display: flex;
|
|
104
|
-
justify-content: center;
|
|
105
|
-
align-items: center;
|
|
106
|
-
list-style-type: none;
|
|
107
|
-
margin: var(--space--medium) 0px;
|
|
108
|
-
|
|
109
|
-
/*public*/
|
|
110
|
-
min-height: var(--ez-search__list-height);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.message__no-result {
|
|
114
|
-
/*public*/
|
|
115
|
-
color: var(--ez-search__list-title--primary);
|
|
116
|
-
font-family: var(--ez-search--font-family);
|
|
117
|
-
font-size: var(--ez-search--font-size);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.message__loading {
|
|
121
|
-
border-radius: 50%;
|
|
122
|
-
width: 14px;
|
|
123
|
-
height: 14px;
|
|
124
|
-
-webkit-animation: spin 1s linear infinite;
|
|
125
|
-
animation: spin 1s linear infinite;
|
|
126
|
-
|
|
127
|
-
/*public*/
|
|
128
|
-
border: 3px solid var(--ez-search__list-title--primary);
|
|
129
|
-
border-top: 3px solid transparent;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.item__value,
|
|
133
|
-
.item__label {
|
|
134
|
-
flex-basis: auto;
|
|
135
|
-
white-space: nowrap;
|
|
136
|
-
overflow: hidden;
|
|
137
|
-
text-overflow: ellipsis;
|
|
138
|
-
|
|
139
|
-
/*public*/
|
|
140
|
-
color: var(--ez-search__list-title--primary);
|
|
141
|
-
font-family: var(--ez-search--font-family);
|
|
142
|
-
font-size: var(--ez-search--font-size);
|
|
143
|
-
line-height: var(--ez-search--line-height);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.item__label {
|
|
147
|
-
/*public*/
|
|
148
|
-
font-weight: var(--ez-search--font-weight--medium);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.item__label--bold {
|
|
152
|
-
/*public*/
|
|
153
|
-
font-weight: var(--ez-search--font-weight--large);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.item__value {
|
|
157
|
-
text-align: center;
|
|
158
|
-
|
|
159
|
-
/*public*/
|
|
160
|
-
color: var(--ez-search__list-text--primary);
|
|
161
|
-
font-weight: var(--ez-search--font-weight--large);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.item__value--hidden {
|
|
165
|
-
visibility: hidden;
|
|
166
|
-
position: absolute;
|
|
167
|
-
white-space: nowrap;
|
|
168
|
-
z-index: -1;
|
|
169
|
-
top: 0;
|
|
170
|
-
left: 0;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.item__label {
|
|
174
|
-
text-align: left;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.item__list>li:hover {
|
|
178
|
-
/*public*/
|
|
179
|
-
background-color: var(--ez-search--background-medium);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.item {
|
|
183
|
-
display: flex;
|
|
184
|
-
align-items: center;
|
|
185
|
-
width: 100%;
|
|
186
|
-
box-sizing: border-box;
|
|
187
|
-
list-style-type: none;
|
|
188
|
-
cursor: pointer;
|
|
189
|
-
|
|
190
|
-
/*public*/
|
|
191
|
-
border-radius: var(--ez-search--border-radius-small);
|
|
192
|
-
gap: var(--space--small, 6px);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.preselected {
|
|
196
|
-
/*public*/
|
|
197
|
-
background-color: var(--background--medium);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
@-webkit-keyframes spin {
|
|
201
|
-
0% {
|
|
202
|
-
-webkit-transform: rotate(0deg);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
100% {
|
|
206
|
-
-webkit-transform: rotate(360deg);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
@keyframes spin {
|
|
211
|
-
0% {
|
|
212
|
-
transform: rotate(0deg);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
100% {
|
|
216
|
-
transform: rotate(360deg);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
@supports not (scrollbar-width: thin) {
|
|
221
|
-
|
|
222
|
-
/* Estilos para navegadores que NÃO suportam scrollbar-width */
|
|
223
|
-
.item {
|
|
224
|
-
/* Estilos alternativos, por exemplo, para navegadores que não suportam scrollbar-width */
|
|
225
|
-
padding-right: 8px;
|
|
226
|
-
}
|
|
227
|
-
}
|