@sankhyalabs/ezui 5.19.1 → 5.20.0-dev.2
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-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert-list.cjs.entry.js +79 -23
- package/dist/cjs/ez-alert.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-badge.cjs.entry.js +1 -1
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item_3.cjs.entry.js +182 -0
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +12 -156
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown.cjs.entry.js +10 -4
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +1 -1
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller_3.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +612 -32
- package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-edit.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/{index-1064511f.js → index-a7b0c73d.js} +4 -6
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/ez-alert-list/ez-alert-list.css +15 -1
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +80 -22
- package/dist/collection/components/ez-card-item/ez-card-item.css +16 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +12 -173
- package/dist/collection/components/ez-dropdown/ez-dropdown.js +32 -3
- package/dist/collection/components/ez-search/ez-search.css +330 -0
- package/dist/collection/components/ez-search/ez-search.js +689 -55
- package/dist/custom-elements/index.js +716 -221
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-alert-list.entry.js +79 -23
- package/dist/esm/ez-alert.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-badge.entry.js +1 -1
- package/dist/esm/ez-breadcrumb.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item_3.entry.js +176 -0
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +13 -157
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-dropdown.entry.js +10 -4
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +1 -1
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller_3.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +613 -33
- package/dist/esm/ez-skeleton.entry.js +1 -1
- package/dist/esm/ez-split-item.entry.js +1 -1
- package/dist/esm/ez-split-panel.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-edit.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-296b8458.js → index-baa5e267.js} +4 -6
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-5cef0264.entry.js → p-0306dff7.entry.js} +1 -1
- package/dist/ezui/{p-871c1a07.entry.js → p-0447d17c.entry.js} +1 -1
- package/dist/ezui/p-072e6347.entry.js +1 -0
- package/dist/ezui/p-133fae4a.entry.js +1 -0
- package/dist/ezui/{p-f4208819.entry.js → p-17be134a.entry.js} +1 -1
- package/dist/ezui/{p-cd19a6f8.entry.js → p-1e7a8633.entry.js} +1 -1
- package/dist/ezui/{p-60ba28ea.entry.js → p-1f50fa05.entry.js} +1 -1
- package/dist/ezui/{p-245a44ed.entry.js → p-20ec22c0.entry.js} +1 -1
- package/dist/ezui/{p-e318d280.js → p-23a36bb6.js} +1 -1
- package/dist/ezui/{p-ce035beb.entry.js → p-24d3fede.entry.js} +1 -1
- package/dist/ezui/{p-8252d9b5.entry.js → p-2a1a0e04.entry.js} +1 -1
- package/dist/ezui/{p-22208198.entry.js → p-40f72de4.entry.js} +1 -1
- package/dist/ezui/p-43b03119.entry.js +1 -0
- package/dist/ezui/{p-9b347f04.entry.js → p-44caad9a.entry.js} +1 -1
- package/dist/ezui/{p-7319c253.entry.js → p-49456b34.entry.js} +1 -1
- package/dist/ezui/{p-7fd54841.entry.js → p-4a7f113d.entry.js} +1 -1
- package/dist/ezui/{p-99692afa.entry.js → p-51c5e071.entry.js} +1 -1
- package/dist/ezui/{p-ccb4ccd9.entry.js → p-555c9018.entry.js} +1 -1
- package/dist/ezui/{p-d43b22f3.entry.js → p-596634e9.entry.js} +1 -1
- package/dist/ezui/{p-52dd8b4c.entry.js → p-5bd5e68f.entry.js} +1 -1
- package/dist/ezui/{p-a01068e1.entry.js → p-5d692ed1.entry.js} +1 -1
- package/dist/ezui/{p-95426f93.entry.js → p-5d86cca9.entry.js} +1 -1
- package/dist/ezui/{p-62304715.entry.js → p-5e1d036e.entry.js} +1 -1
- package/dist/ezui/{p-7525e604.entry.js → p-5ed81457.entry.js} +1 -1
- package/dist/ezui/{p-c49dbf23.entry.js → p-650e4b6d.entry.js} +1 -1
- package/dist/ezui/{p-4b988ee7.entry.js → p-6e2f8e6b.entry.js} +1 -1
- package/dist/ezui/{p-f55d75e7.entry.js → p-6e429cff.entry.js} +1 -1
- package/dist/ezui/p-76ba9d67.entry.js +1 -0
- package/dist/ezui/{p-0b902469.entry.js → p-77a4bd35.entry.js} +1 -1
- package/dist/ezui/{p-b6867f19.entry.js → p-796c1a88.entry.js} +1 -1
- package/dist/ezui/{p-5d6f2550.entry.js → p-85c8baae.entry.js} +1 -1
- package/dist/ezui/{p-fa571a4e.entry.js → p-8becebf8.entry.js} +1 -1
- package/dist/ezui/{p-d3b5228e.entry.js → p-8defa6d3.entry.js} +1 -1
- package/dist/ezui/{p-391de0e4.entry.js → p-9050d2cd.entry.js} +1 -1
- package/dist/ezui/{p-028f264f.entry.js → p-9cad9b6e.entry.js} +1 -1
- package/dist/ezui/{p-b11f035c.entry.js → p-9f5fa3f9.entry.js} +1 -1
- package/dist/ezui/{p-d81917fd.entry.js → p-a08b309b.entry.js} +1 -1
- package/dist/ezui/{p-2da09f70.entry.js → p-a80b1287.entry.js} +1 -1
- package/dist/ezui/{p-a42fe2ce.entry.js → p-af15c277.entry.js} +1 -1
- package/dist/ezui/{p-32b4163f.entry.js → p-b041333c.entry.js} +1 -1
- package/dist/ezui/p-ba875f37.entry.js +1 -0
- package/dist/ezui/p-bc2f844e.entry.js +1 -0
- package/dist/ezui/{p-e2dfd935.entry.js → p-c0f1715f.entry.js} +1 -1
- package/dist/ezui/{p-83885b21.entry.js → p-cc2dc4f4.entry.js} +1 -1
- package/dist/ezui/{p-76d16a24.entry.js → p-d6ffe679.entry.js} +1 -1
- package/dist/ezui/{p-3e7cc8a4.entry.js → p-eb36f072.entry.js} +1 -1
- package/dist/ezui/{p-d20ed286.entry.js → p-f56dd1da.entry.js} +1 -1
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +32 -3
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +0 -15
- package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +5 -0
- package/dist/types/components/ez-search/ez-search.d.ts +100 -10
- package/dist/types/components.d.ts +27 -14
- package/dist/types/utils/interfaces/AbstractFieldMetadata.d.ts +2 -1
- package/dist/types/utils/interfaces/IAction.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/ez-card-item.cjs.entry.js +0 -52
- package/dist/cjs/ez-filter-input_2.cjs.entry.js +0 -137
- package/dist/esm/ez-card-item.entry.js +0 -48
- package/dist/esm/ez-filter-input_2.entry.js +0 -132
- package/dist/ezui/p-47afb974.entry.js +0 -1
- package/dist/ezui/p-59bcb27c.entry.js +0 -1
- package/dist/ezui/p-74049254.entry.js +0 -1
- package/dist/ezui/p-87e85160.entry.js +0 -1
- package/dist/ezui/p-d51aa09b.entry.js +0 -1
- package/dist/ezui/p-f8653522.entry.js +0 -1
- package/dist/ezui/p-ffa8ec98.entry.js +0 -1
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-1064511f.js');
|
|
6
|
-
const core = require('@sankhyalabs/core');
|
|
7
|
-
const CSSVarsUtils = require('./CSSVarsUtils-b136a156.js');
|
|
8
|
-
|
|
9
|
-
const ezFilterInputCss = ":host{display:block;width:100%}";
|
|
10
|
-
|
|
11
|
-
const EzFilterInput = class {
|
|
12
|
-
constructor(hostRef) {
|
|
13
|
-
index.registerInstance(this, hostRef);
|
|
14
|
-
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
15
|
-
this.ezSearching = index.createEvent(this, "ezSearching", 7);
|
|
16
|
-
this.ezFocusIn = index.createEvent(this, "ezFocusIn", 7);
|
|
17
|
-
this._searchingText = "";
|
|
18
|
-
this.handleFocus = () => {
|
|
19
|
-
if (this._searchingText === "") {
|
|
20
|
-
this._textInput.value = "";
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
this._textInput.value = this._searchingText;
|
|
24
|
-
}
|
|
25
|
-
this.ezFocusIn.emit();
|
|
26
|
-
};
|
|
27
|
-
this.label = undefined;
|
|
28
|
-
this.value = undefined;
|
|
29
|
-
this.enabled = true;
|
|
30
|
-
this.errorMessage = undefined;
|
|
31
|
-
this.restrict = undefined;
|
|
32
|
-
this.mode = "regular";
|
|
33
|
-
this.asyncSearch = false;
|
|
34
|
-
this.canShowError = true;
|
|
35
|
-
}
|
|
36
|
-
observeLabel() {
|
|
37
|
-
if (this._textInput) {
|
|
38
|
-
this._textInput.label = this.label;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
observeErrorMessage() {
|
|
42
|
-
if (this._textInput) {
|
|
43
|
-
this._textInput.errorMessage = this.errorMessage;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
observeValue(newValue, oldValue) {
|
|
47
|
-
if (this._textInput && newValue != oldValue) {
|
|
48
|
-
this._textInput.value = newValue;
|
|
49
|
-
this.ezChange.emit(newValue);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Aplica o foco no campo.
|
|
54
|
-
*/
|
|
55
|
-
async setFocus() {
|
|
56
|
-
this._textInput.setFocus();
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Remove o foco do campo.
|
|
60
|
-
*/
|
|
61
|
-
async setBlur() {
|
|
62
|
-
this._textInput.setBlur();
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Retorna se o conteúdo é inválido.
|
|
66
|
-
*/
|
|
67
|
-
async isInvalid() {
|
|
68
|
-
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Método responsável por setar um novo valor ao campo.
|
|
72
|
-
*/
|
|
73
|
-
async setValue(newValue) {
|
|
74
|
-
if (!this.asyncSearch || this._textInput == undefined) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (newValue !== this.value) {
|
|
78
|
-
this.value = newValue;
|
|
79
|
-
this._searchingText = "";
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
this._textInput.value = newValue;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Método responsável por resetar o valor do campo para o ultimo valor inputado.
|
|
87
|
-
*/
|
|
88
|
-
async endSearch() {
|
|
89
|
-
if (!this.asyncSearch || this._textInput == undefined) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (this._textInput.value !== this.value) {
|
|
93
|
-
this._textInput.value = this.value;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
handleChange(evt) {
|
|
97
|
-
const newValue = evt.detail;
|
|
98
|
-
this.errorMessage = "";
|
|
99
|
-
if (this.asyncSearch) {
|
|
100
|
-
this._searchingText = newValue;
|
|
101
|
-
this.ezSearching.emit(newValue);
|
|
102
|
-
}
|
|
103
|
-
else if (newValue !== this.value) {
|
|
104
|
-
this.value = newValue;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
componentDidLoad() {
|
|
108
|
-
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
109
|
-
}
|
|
110
|
-
render() {
|
|
111
|
-
core.ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
112
|
-
return (index.h("ez-text-input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, label: this.label, onEzChange: evt => this.handleChange(evt), value: this.value, enabled: this.enabled, errorMessage: this.errorMessage, restrict: this.restrict, mode: this.mode, onFocusin: this.handleFocus, canShowError: this.canShowError }, index.h("ez-icon", { slot: "leftIcon", iconName: "search" })));
|
|
113
|
-
}
|
|
114
|
-
get _elem() { return index.getElement(this); }
|
|
115
|
-
static get watchers() { return {
|
|
116
|
-
"label": ["observeLabel"],
|
|
117
|
-
"errorMessage": ["observeErrorMessage"],
|
|
118
|
-
"value": ["observeValue"]
|
|
119
|
-
}; }
|
|
120
|
-
};
|
|
121
|
-
EzFilterInput.style = ezFilterInputCss;
|
|
122
|
-
|
|
123
|
-
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)}";
|
|
124
|
-
|
|
125
|
-
const MultiSelectionBoxMessage = class {
|
|
126
|
-
constructor(hostRef) {
|
|
127
|
-
index.registerInstance(this, hostRef);
|
|
128
|
-
this.message = undefined;
|
|
129
|
-
}
|
|
130
|
-
render() {
|
|
131
|
-
return (index.h("div", { class: "multi-selection__message" }, index.h("span", { class: "multi-selection__text-message" }, this.message)));
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
MultiSelectionBoxMessage.style = multiSelectionBoxMessageCss;
|
|
135
|
-
|
|
136
|
-
exports.ez_filter_input = EzFilterInput;
|
|
137
|
-
exports.multi_selection_box_message = MultiSelectionBoxMessage;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-296b8458.js';
|
|
2
|
-
import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
-
|
|
4
|
-
const ezCardItemCss = ":host{--ez-card-item--font-size:var(--text--medium, 14px);--ez-card-item--font-family:var(--font-pattern, Arial);--ez-card-item--font-weight:var(--text-weight--medium, 400);--ez-card-item--font-weight-large:var(--text-weight--large, 600);--ez-card-item--color:var(--title--primary, #2B3A54);--ez-card-item__key--color:var(--text--primary, #626e82);--ez-card-item__detail-label--color:var(--text--secondary, #A2ABB9);--ez-card-item__detail--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__title--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__highlight--color:var(--color--primary-300, #E2F4EF);width:100%;display:flex;cursor:pointer}.card-item{display:flex;flex-direction:column;width:100%;cursor:pointer;padding:12px;z-index:0;position:relative}.card-item:hover{background:#F0F3F7;border-radius:12px}.card-item__title{display:flex;align-items:center;line-height:18px;cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight-large);color:var(--ez-card-item--color);padding-bottom:var(--ez-card-item__title--padding-bottom);gap:var(--space--small, 6px)}.card-item__key{color:var(--ez-card-item__key--color)}.card-item__details{display:flex;cursor:pointer;justify-content:space-between;gap:var(--space--small, 6px)}.card-item__details-left{cursor:pointer;width:50%}.card-item__details-right{width:50%;cursor:pointer}.card-item__detail:not(:last-child){cursor:pointer;padding-bottom:var(--ez-card-item__detail--padding-bottom)}.card-item__detail-label{cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item__detail-label--color)}.card-item__detail-value{cursor:pointer;line-break:anywhere;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item--color)}.card-item__highlight{position:relative;border-radius:8px;z-index:-1;background-color:var(--ez-card-item__highlight--color);outline:2px solid var(--ez-card-item__highlight--color);box-shadow:-4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color)}";
|
|
5
|
-
|
|
6
|
-
const EzCardItem = class {
|
|
7
|
-
constructor(hostRef) {
|
|
8
|
-
registerInstance(this, hostRef);
|
|
9
|
-
this.ezClick = createEvent(this, "ezClick", 7);
|
|
10
|
-
this.item = undefined;
|
|
11
|
-
}
|
|
12
|
-
componentWillRender() {
|
|
13
|
-
this.createDetailList();
|
|
14
|
-
}
|
|
15
|
-
componentDidLoad() {
|
|
16
|
-
var _a, _b;
|
|
17
|
-
const dataInfo = { id: StringUtils.toCamelCase(((_a = this.item) === null || _a === void 0 ? void 0 : _a.key) || ((_b = this.item) === null || _b === void 0 ? void 0 : _b.title) || "") };
|
|
18
|
-
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
19
|
-
}
|
|
20
|
-
createDetailList() {
|
|
21
|
-
var _a, _b, _c;
|
|
22
|
-
this._details = { detailsLeft: [], detailsRight: [] };
|
|
23
|
-
let cont = 0;
|
|
24
|
-
if ((_a = this.item) === null || _a === void 0 ? void 0 : _a.details) {
|
|
25
|
-
for (const attribute in this.item.details) {
|
|
26
|
-
cont < 3 ?
|
|
27
|
-
this._details.detailsLeft.push({ label: attribute, value: (_b = this.item.details[attribute]) === null || _b === void 0 ? void 0 : _b.toString() }) :
|
|
28
|
-
this._details.detailsRight.push({ label: attribute, value: (_c = this.item.details[attribute]) === null || _c === void 0 ? void 0 : _c.toString() });
|
|
29
|
-
cont++;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
buildDetailContent(detail) {
|
|
34
|
-
return h("div", { class: "card-item__detail" }, h("label", { class: "card-item__detail-label" }, detail.label), ": ", h("label", { class: "card-item__detail-value", innerHTML: detail.value }));
|
|
35
|
-
}
|
|
36
|
-
render() {
|
|
37
|
-
return (h(Host, null, this.item &&
|
|
38
|
-
h("div", { class: "card-item", onClick: () => { this.ezClick.emit(this.item); } }, h("label", { class: "card-item__title" }, h("span", { class: "card-item__key", innerHTML: this.item.key }), h("span", { innerHTML: this.item.title })), h("div", { class: "card-item__details" }, h("div", { class: "card-item__details-left" }, this._details.detailsLeft.map(detail => {
|
|
39
|
-
return this.buildDetailContent(detail);
|
|
40
|
-
})), h("div", { class: "card-item__details-right" }, this._details.detailsRight.map(detail => {
|
|
41
|
-
return this.buildDetailContent(detail);
|
|
42
|
-
}))))));
|
|
43
|
-
}
|
|
44
|
-
get _element() { return getElement(this); }
|
|
45
|
-
};
|
|
46
|
-
EzCardItem.style = ezCardItemCss;
|
|
47
|
-
|
|
48
|
-
export { EzCardItem as ez_card_item };
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-296b8458.js';
|
|
2
|
-
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { C as CSSVarsUtils } from './CSSVarsUtils-a97cfa29.js';
|
|
4
|
-
|
|
5
|
-
const ezFilterInputCss = ":host{display:block;width:100%}";
|
|
6
|
-
|
|
7
|
-
const EzFilterInput = class {
|
|
8
|
-
constructor(hostRef) {
|
|
9
|
-
registerInstance(this, hostRef);
|
|
10
|
-
this.ezChange = createEvent(this, "ezChange", 7);
|
|
11
|
-
this.ezSearching = createEvent(this, "ezSearching", 7);
|
|
12
|
-
this.ezFocusIn = createEvent(this, "ezFocusIn", 7);
|
|
13
|
-
this._searchingText = "";
|
|
14
|
-
this.handleFocus = () => {
|
|
15
|
-
if (this._searchingText === "") {
|
|
16
|
-
this._textInput.value = "";
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
this._textInput.value = this._searchingText;
|
|
20
|
-
}
|
|
21
|
-
this.ezFocusIn.emit();
|
|
22
|
-
};
|
|
23
|
-
this.label = undefined;
|
|
24
|
-
this.value = undefined;
|
|
25
|
-
this.enabled = true;
|
|
26
|
-
this.errorMessage = undefined;
|
|
27
|
-
this.restrict = undefined;
|
|
28
|
-
this.mode = "regular";
|
|
29
|
-
this.asyncSearch = false;
|
|
30
|
-
this.canShowError = true;
|
|
31
|
-
}
|
|
32
|
-
observeLabel() {
|
|
33
|
-
if (this._textInput) {
|
|
34
|
-
this._textInput.label = this.label;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
observeErrorMessage() {
|
|
38
|
-
if (this._textInput) {
|
|
39
|
-
this._textInput.errorMessage = this.errorMessage;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
observeValue(newValue, oldValue) {
|
|
43
|
-
if (this._textInput && newValue != oldValue) {
|
|
44
|
-
this._textInput.value = newValue;
|
|
45
|
-
this.ezChange.emit(newValue);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Aplica o foco no campo.
|
|
50
|
-
*/
|
|
51
|
-
async setFocus() {
|
|
52
|
-
this._textInput.setFocus();
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Remove o foco do campo.
|
|
56
|
-
*/
|
|
57
|
-
async setBlur() {
|
|
58
|
-
this._textInput.setBlur();
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Retorna se o conteúdo é inválido.
|
|
62
|
-
*/
|
|
63
|
-
async isInvalid() {
|
|
64
|
-
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Método responsável por setar um novo valor ao campo.
|
|
68
|
-
*/
|
|
69
|
-
async setValue(newValue) {
|
|
70
|
-
if (!this.asyncSearch || this._textInput == undefined) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (newValue !== this.value) {
|
|
74
|
-
this.value = newValue;
|
|
75
|
-
this._searchingText = "";
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
this._textInput.value = newValue;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Método responsável por resetar o valor do campo para o ultimo valor inputado.
|
|
83
|
-
*/
|
|
84
|
-
async endSearch() {
|
|
85
|
-
if (!this.asyncSearch || this._textInput == undefined) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (this._textInput.value !== this.value) {
|
|
89
|
-
this._textInput.value = this.value;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
handleChange(evt) {
|
|
93
|
-
const newValue = evt.detail;
|
|
94
|
-
this.errorMessage = "";
|
|
95
|
-
if (this.asyncSearch) {
|
|
96
|
-
this._searchingText = newValue;
|
|
97
|
-
this.ezSearching.emit(newValue);
|
|
98
|
-
}
|
|
99
|
-
else if (newValue !== this.value) {
|
|
100
|
-
this.value = newValue;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
componentDidLoad() {
|
|
104
|
-
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
105
|
-
}
|
|
106
|
-
render() {
|
|
107
|
-
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
108
|
-
return (h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, label: this.label, onEzChange: evt => this.handleChange(evt), value: this.value, enabled: this.enabled, errorMessage: this.errorMessage, restrict: this.restrict, mode: this.mode, onFocusin: this.handleFocus, canShowError: this.canShowError }, h("ez-icon", { slot: "leftIcon", iconName: "search" })));
|
|
109
|
-
}
|
|
110
|
-
get _elem() { return getElement(this); }
|
|
111
|
-
static get watchers() { return {
|
|
112
|
-
"label": ["observeLabel"],
|
|
113
|
-
"errorMessage": ["observeErrorMessage"],
|
|
114
|
-
"value": ["observeValue"]
|
|
115
|
-
}; }
|
|
116
|
-
};
|
|
117
|
-
EzFilterInput.style = ezFilterInputCss;
|
|
118
|
-
|
|
119
|
-
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)}";
|
|
120
|
-
|
|
121
|
-
const MultiSelectionBoxMessage = class {
|
|
122
|
-
constructor(hostRef) {
|
|
123
|
-
registerInstance(this, hostRef);
|
|
124
|
-
this.message = undefined;
|
|
125
|
-
}
|
|
126
|
-
render() {
|
|
127
|
-
return (h("div", { class: "multi-selection__message" }, h("span", { class: "multi-selection__text-message" }, this.message)));
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
MultiSelectionBoxMessage.style = multiSelectionBoxMessageCss;
|
|
131
|
-
|
|
132
|
-
export { EzFilterInput as ez_filter_input, MultiSelectionBoxMessage as multi_selection_box_message };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as a,g as r}from"./p-e318d280.js";import{StringUtils as l,ElementIDUtils as o}from"@sankhyalabs/core";const d=class{constructor(i){t(this,i),this.ezClick=e(this,"ezClick",7),this.item=void 0}componentWillRender(){this.createDetailList()}componentDidLoad(){var t,e;const i={id:l.toCamelCase((null===(t=this.item)||void 0===t?void 0:t.key)||(null===(e=this.item)||void 0===e?void 0:e.title)||"")};o.addIDInfo(this._element,null,i)}createDetailList(){var t,e,i;this._details={detailsLeft:[],detailsRight:[]};let a=0;if(null===(t=this.item)||void 0===t?void 0:t.details)for(const t in this.item.details)a<3?this._details.detailsLeft.push({label:t,value:null===(e=this.item.details[t])||void 0===e?void 0:e.toString()}):this._details.detailsRight.push({label:t,value:null===(i=this.item.details[t])||void 0===i?void 0:i.toString()}),a++}buildDetailContent(t){return i("div",{class:"card-item__detail"},i("label",{class:"card-item__detail-label"},t.label),": ",i("label",{class:"card-item__detail-value",innerHTML:t.value}))}render(){return i(a,null,this.item&&i("div",{class:"card-item",onClick:()=>{this.ezClick.emit(this.item)}},i("label",{class:"card-item__title"},i("span",{class:"card-item__key",innerHTML:this.item.key}),i("span",{innerHTML:this.item.title})),i("div",{class:"card-item__details"},i("div",{class:"card-item__details-left"},this._details.detailsLeft.map((t=>this.buildDetailContent(t)))),i("div",{class:"card-item__details-right"},this._details.detailsRight.map((t=>this.buildDetailContent(t)))))))}get _element(){return r(this)}};d.style=":host{--ez-card-item--font-size:var(--text--medium, 14px);--ez-card-item--font-family:var(--font-pattern, Arial);--ez-card-item--font-weight:var(--text-weight--medium, 400);--ez-card-item--font-weight-large:var(--text-weight--large, 600);--ez-card-item--color:var(--title--primary, #2B3A54);--ez-card-item__key--color:var(--text--primary, #626e82);--ez-card-item__detail-label--color:var(--text--secondary, #A2ABB9);--ez-card-item__detail--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__title--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__highlight--color:var(--color--primary-300, #E2F4EF);width:100%;display:flex;cursor:pointer}.card-item{display:flex;flex-direction:column;width:100%;cursor:pointer;padding:12px;z-index:0;position:relative}.card-item:hover{background:#F0F3F7;border-radius:12px}.card-item__title{display:flex;align-items:center;line-height:18px;cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight-large);color:var(--ez-card-item--color);padding-bottom:var(--ez-card-item__title--padding-bottom);gap:var(--space--small, 6px)}.card-item__key{color:var(--ez-card-item__key--color)}.card-item__details{display:flex;cursor:pointer;justify-content:space-between;gap:var(--space--small, 6px)}.card-item__details-left{cursor:pointer;width:50%}.card-item__details-right{width:50%;cursor:pointer}.card-item__detail:not(:last-child){cursor:pointer;padding-bottom:var(--ez-card-item__detail--padding-bottom)}.card-item__detail-label{cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item__detail-label--color)}.card-item__detail-value{cursor:pointer;line-break:anywhere;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item--color)}.card-item__highlight{position:relative;border-radius:8px;z-index:-1;background-color:var(--ez-card-item__highlight--color);outline:2px solid var(--ez-card-item__highlight--color);box-shadow:-4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color)}";export{d as ez_card_item}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,H as i,g as r}from"./p-e318d280.js";import{FloatingManager as l,ElementIDUtils as a}from"@sankhyalabs/core";const s=class{constructor(e){t(this,e),this.alerts=[],this.enableDragAndDrop=void 0,this.enableExpand=void 0,this.itemRightSlotBuilder=void 0,this.opened=!0,this.expanded=!1}observeOpened(){this.manageOverlay()}async manageOverlay(){this.opened?this._overlayId=l.float(this._container,this._overlayRef,{autoClose:!1,isFixed:!this.enableDragAndDrop,bottom:"10px",right:"10px"}):(l.close(this._overlayId),this._overlayId=void 0)}componentDidRender(){this.manageOverlay(),this.opened&&this._container.focus()}componentWillLoad(){this.dataElementId=a.addIDInfo(this._element,"EzAlertList")}alertId(t,e){return`alert-${e}-${(t=>{var e;return null!==(e=null==t?void 0:t.split(" ").join("-"))&&void 0!==e?e:""})(t)}`}getAlertTitle(t){var e;return null===(e=this.alerts.find(((e,i)=>this.alertId(e.title,i)===t)))||void 0===e?void 0:e.title}getTitleText(t){var e;const i=null!==(e=this.getAlertTitle(t.id))&&void 0!==e?e:"";return`${i}${i&&t.label?":":""}`}render(){return e(i,Object.assign({},{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:this.dataElementId}),e("div",{ref:t=>this._overlayRef=t},e("div",{class:"alert-list__container",ref:t=>this._container=t},e("div",{class:"alert-list__content"},e("div",{class:"alert-list__header"},e("div",{class:"alert-list__title"},`Avisos (${this.alerts.length})`),e("div",{class:"alert-list__header__buttons"},e("ez-button",{mode:"icon",size:"small",iconName:"expand","data-element-id":a.getInternalIDInfo("expandButton"),onClick:()=>{},title:this.expanded?"Resumir":"Expandir"}),e("ez-button",{mode:"icon",size:"small",iconName:"close","data-element-id":a.getInternalIDInfo("closeButton"),onClick:()=>{this.opened=!1},title:"Fechar"}))),e("div",{class:"alert-list__expandable-content"},e("ez-list",{hoverFeedback:!0,itemLeftSlotBuilder:t=>e("a",{href:"#",style:{fontFamily:"var(--font-pattern, 'Roboto')",fontSize:"var(--text--medium, 14px)",fontWeight:"var(--text-weight--medium, 400)",color:"var(--color--primary, #008561)",marginRight:"4px",cursor:"pointer",display:"flex",width:"max-content",textDecoration:"none"}},this.getTitleText(t)),dataSource:this.alerts.map(((t,e)=>{var i;return{id:this.alertId(t.title,e),label:null!==(i=t.detail)&&void 0!==i?i:""}}))}))))))}get _element(){return r(this)}static get watchers(){return{opened:["observeOpened"]}}};s.style=':host{display:flex;--ez-alert-list__container--width:680px;--ez-alert-list__container--height:220px;--ez-alert-list__title--font-family:var(--font-pattern, "Roboto");--ez-alert-list__title--font-size:var(--title--large, 20px);--ez-alert-list__title--color:var(--title--primary, #2b3a54);--ez-alert-list__title--font-weight:var(--text-weight--extra-large, 700);--ez-list__item--border-bottom:var(--border--small, 1px solid);--ez-list__item--border-bottom-color:var(--color--strokes, #DCE0E8);--ez-list__item--white-space:break-space}.alert-list__content{display:flex;flex-direction:column;gap:var(--space--xs);margin:var(--space--large, 24px);width:100%}.alert-list__container{z-index:var(--more-visible--2x, 3);display:flex;height:var(--ez-alert-list__container--height);width:var(--ez-alert-list__container--width);border-radius:var(--border--radius-medium);background-color:var(--background--xlight);box-shadow:0px 8px 24px 0px rgba(0, 38, 111, 0.1)}.alert-list__header{width:100%;display:flex;align-items:center;justify-content:space-between}.alert-list__title{font-family:var(--ez-alert-list__title--font-family);font-size:var(--ez-alert-list__title--font-size);font-weight:var(--ez-alert-list__title--font-weight);color:var(--ez-alert-list__title--color)}.alert-list__header__buttons{display:flex;gap:var(--space--xs)}.alert-list__expandable-content{overflow-y:auto;scrollbar-width:thin}';export{s as ez_alert_list}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as o,r,c as e,H as d,g as n}from"./p-e318d280.js";import{ElementIDUtils as i,ObjectUtils as l}from"@sankhyalabs/core";const t=({item:r,hasIcon:e,hasChildren:d,isLockedLevels:n,onSubActionClick:i})=>o("div",{class:"ez-dropdown__item-wrapper",title:r.label},a(r,e),o("span",{class:"ez-dropdown__item-label"},r.label),s(r,d,n,i)),a=(r,e)=>{if(null!=r&&e)return o("ez-icon",r.iconName?Object.assign({class:"ez-dropdown__icon-left",iconName:r.iconName,size:"medium"},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${r.id}_ezDropdownItemIcon`}):{class:"ez-dropdown__icon-left ez-dropdown__hidden",size:"medium"})},s=(r,e,d,n)=>{var l,t;if(null!=r){if(!(null===(l=r.children)||void 0===l?void 0:l.length)&&null!=r.subAction&&Object.keys(r.subAction).length>0)return o("span",Object.assign({onClick:()=>n(r),title:r.subAction.label,class:`ez-dropdown__link ez-dropdown__link--${r.subAction.type||"primary"}`},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${r.subAction.id}_ezDropdownItemSubAction`}),r.subAction.label);if(!d&&e)return(null===(t=r.children)||void 0===t?void 0:t.length)>0?o("ez-icon",Object.assign({class:"ez-dropdown__icon-right",iconName:"chevron-right",size:"medium"},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${r.id}_ezDropdownIconOpenChildren`})):o("ez-icon",{class:"ez-dropdown__icon-right ez-dropdown__hidden",size:"medium"})}};class p{constructor(){}show(o){const r=null==o?void 0:o.querySelector(".ez-dropdown__submenu");null!=o&&null!=r&&(r.classList.remove("ez-dropdown__submenu--hide"),this.setPosition(o),this.setScrollContainer(o),this.setMaxHeight(r))}hide(o){if(null==o)return;const r=o.querySelector(".ez-dropdown__submenu:not(.ez-dropdown__submenu--hide)");this.reset(r),this.hideChild(r)}hideChild(o){null!=o&&o.querySelectorAll(".ez-dropdown__submenu").forEach((o=>{this.reset(o)}))}setPosition(o){const r=null==o?void 0:o.querySelector(".ez-dropdown__submenu"),e=null==o?void 0:o.closest(".ez-dropdown");if(null==r||null==e)return;r.style.top=this.getPositionTop(o),r.style.left=this.getPositionRight(e);const d=null==r?void 0:r.getBoundingClientRect(),n=document.body.clientWidth;(null==d?void 0:d.right)>n&&this.updatePosition(e,r)}setMaxHeight(o){var r;const e=(null==o?void 0:o.shadowRoot)||o,d=null==e?void 0:e.querySelector(".ez-dropdown"),n=document.body.clientHeight;let i,l;if(null!=(null==e?void 0:e.tagName)?(i=e,l=null==i?void 0:i.getBoundingClientRect()):l=null==d?void 0:d.getBoundingClientRect(),null!=d&&null!=l){if(l.y+l.height>n)if(null!=i){const o=i.closest(".ez-dropdown"),e=null==o?void 0:o.getBoundingClientRect(),t=parseFloat((null===(r=getComputedStyle(i))||void 0===r?void 0:r.marginTop)||"0");if(null==o||null==e)return;e.y+l.height>n?(i.style.top=e.y-t+"px",d.style.maxHeight=n-e.y+"px"):i.style.top=n-l.height-t+"px"}else{let o=n-l.y;o<0&&(o=l.height-n),d.style.maxHeight=o+"px"}this.setSpacerContainer(d)}}setSpacerContainer(o){const r=null==o?void 0:o.querySelector(".ez-dropdown__container");null!=r&&(r.scrollHeight>r.clientHeight?r.classList.add("ez-dropdown__container--spacer"):r.classList.remove("ez-dropdown__container--spacer"))}reset(o){if(null==o)return;o.classList.add("ez-dropdown__submenu--hide"),o.style.left="",o.style.top="";const r=o.querySelector(".ez-dropdown");this.resetDropdown(r)}resetDropdown(o){null!=o&&(o.style.maxHeight="",this.setSpacerContainer(o))}setScrollContainer(o){const r=null==o?void 0:o.closest(".ez-dropdown__container");null!=r&&(r.onscroll=this.onScrollContainer.bind(this))}onScrollContainer(o){this.hideChild(null==o?void 0:o.target)}getPositionTop(o){const r=null==o?void 0:o.getBoundingClientRect();if(null!=r)return r.y+"px"}getPositionRight(o){const r=null==o?void 0:o.getBoundingClientRect();if(null!=r)return r.x+r.width+"px"}getPositionLeft(o,r){const e=null==o?void 0:o.getBoundingClientRect(),d=null==r?void 0:r.getBoundingClientRect();if(null!=e&&null!=d)return e.x-d.width+"px"}updatePosition(o,r){const e=null==o?void 0:o.getBoundingClientRect(),d=null==r?void 0:r.getBoundingClientRect();null!=e&&null!=d&&e.x<d.right&&(r.style.left=this.getPositionLeft(o,r),this.updatePosition(o,r))}}const c=class{constructor(o){r(this,o),this.ezClick=e(this,"ezClick",7),this.ezSubActionClick=e(this,"ezSubActionClick",7),this._itemList={},this._submenuList=[],this._openedMenuList={},this._levelLimits=3,this.items=[],this.value=void 0,this.itemBuilder=void 0}defaultItemBuilder(r,e,d,n){return o(t,{item:r,hasIcon:d,hasChildren:n,isLockedLevels:e,onSubActionClick:this.onSubActionClick.bind(this)})}getMaxOrder(o){return null==o||0===o.length?-1:Math.max(...o.map((o=>{var r;const e=null===(r=o.group)||void 0===r?void 0:r.order;return null!=e&&e>=0?e:-1})))}hasIcon(o){return null==o?void 0:o.some((o=>""!==(o.iconName||"")))}hasGroup(o){return null==o?void 0:o.some((o=>""!==(o.group||"")))}hasChildren(o){return null==o?void 0:o.some((o=>(o.children||[]).length>0))}isLockedLevels(o){return!!this._levelLimits&&o===this._levelLimits+1}getItemsByGroup(o,r){let e={};const d=this.getMaxOrder(o);return o.forEach((o=>{const n=o.group&&null!=o.group.label?o.group.label||"noGroup":o.group||"noGroup";let i=e[n];null==i&&(i={items:[],order:o.group&&null!=o.group.order?o.group.order:o.group?d+1:d+2}),this.validateItem(o,r),i.items.push(o),e[n]=i})),l.sortByProperty(e,"order")}validateItem(o,r){if(null==this._itemList&&(this._itemList={}),null==o.type&&(o.type="item"),null==o.id){const e=`level_${r}_${o.type}`,d=Object.keys(this._itemList).filter((o=>o.includes(e))).length;o.id=`${e}_${d+1}`}null==o.label&&(o.label=""),null!=o.subAction&&(null==o.subAction.id&&(o.subAction.id=`subAction_${o.id}`),null==o.subAction.label&&(o.subAction.label="")),null==this._itemList[o.id]&&(this._itemList[o.id]={})}getContainerItemBuilder(r,e){if(null==this.itemBuilder)return;const d=this.itemBuilder(r,e);return null!=d?"string"!=typeof d?o("div",{class:"ez-dropdown__item-builder"},d):o("div",{class:"ez-dropdown__item-builder",innerHTML:d}):void 0}getItemsRender(r,e,d,n){if(null==r)return;let l=e,t=!1;return n&&(l++,t=this.isLockedLevels(l)),r.map((r=>{var a;return"divider"!==r.type?o("div",Object.assign({ref:o=>this._itemList[r.id]=o,class:"ez-dropdown__item","data-level":e},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:i.getInternalIDInfo(`${r.id}_ezDropdownItem`)}),o("div",{class:"ez-dropdown__item-content",onClick:o=>this.onItemClick(o,r),onMouseOver:o=>this.onShowSubmenu(o,r)},this.itemBuilder?this.getContainerItemBuilder(r,e):this.defaultItemBuilder(r,t,d,n)),(null===(a=r.children)||void 0===a?void 0:a.length)>0&&!t&&n&&o("div",{ref:o=>this._submenuList.push(o),class:"ez-dropdown__submenu ez-dropdown__submenu--hide"},this.renderDropdown(r.children,l))):o("hr",Object.assign({class:"ez-dropdown__divider"},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:i.getInternalIDInfo(`${r.id}_ezDropdownDivider`)}))}))}renderDropdown(r=this.items,e=1){if(null==r||this.isLockedLevels(e))return;const d=this.getItemsByGroup(r,e),n=this.hasGroup(r),l=this.hasIcon(r),t=this.hasChildren(r);return o("div",{class:"ez-dropdown ez-dropdown__max-height","data-level":e},o("div",{class:"ez-dropdown__container"},Object.keys(d).map((r=>o("div",Object.assign({class:"ez-dropdown__group"},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:i.getInternalIDInfo(`${r}_ezDropdownGroup`)}),"noGroup"!==r&&o("label",{class:"ez-dropdown__group-label",title:r},r),n&&"noGroup"===r&&o("hr",Object.assign({class:"ez-dropdown__divider"},{[i.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:i.getInternalIDInfo(`${r}_ezDropdownDivider`)})),this.getItemsRender(d[r].items,e,l,t))))))}hasOpenedSubmenu(o){const r=Object.keys(this._openedMenuList);return r.includes(o.toString())||r.some((r=>Number(r)>o))}hasSubmenuOpened(){var o;return null===(o=this._submenuList)||void 0===o?void 0:o.some((o=>!o.classList.contains("ez-dropdown__submenu--hide")))}setEvents(){document.removeEventListener("click",this.onHideAllSubmenu.bind(this)),document.addEventListener("click",this.onHideAllSubmenu.bind(this)),document.removeEventListener("scroll",this.onSubmenuReposition.bind(this)),document.addEventListener("scroll",this.onSubmenuReposition.bind(this))}onShowSubmenu(o,r){var e;if(null==o)return;const d=this._itemList[r.id];if(!(null==d?void 0:d.classList.contains("ez-dropdown__item")))return;const n=Number(d.dataset.level||"0");this.hasOpenedSubmenu(n)&&(this._submenuControl.hide(this._openedMenuList[n]),delete this._openedMenuList[n]),(null===(e=r.children)||void 0===e?void 0:e.length)&&(this._openedMenuList[d.dataset.level]=d,this._submenuControl.show(d))}onItemClick(o,r){const e=null==o?void 0:o.target;(null==e?void 0:e.classList.contains("ez-dropdown__link"))||(this.value=r,this.ezClick.emit(r))}onSubActionClick(o){this.ezSubActionClick.emit(o.subAction)}onHideAllSubmenu(o){const r=null==o?void 0:o.target;this.hasSubmenuOpened()&&(null==r||!r.closest(".ez-dropdown")&&"EZ-DROPDOWN"!==r.tagName)&&(this._openedMenuList={},this._submenuList.forEach(this._submenuControl.reset.bind(this._submenuControl)))}onSubmenuReposition(){null!=this._openedMenuList&&Object.keys(this._openedMenuList).forEach((o=>{this._submenuControl.setPosition(this._openedMenuList[o])}))}componentDidLoad(){i.addIDInfo(this._element),this._submenuControl=new p,this._submenuControl.setMaxHeight(this._element)}componentDidUpdate(){this._submenuControl.setMaxHeight(this._element)}componentDidRender(){this.setEvents()}render(){return o(d,null,this.renderDropdown())}get _element(){return n(this)}};c.style=":host{--ez-dropdown--z-index:var(--more-visible, 2);--ez-dropdown--padding:var(--space--small, 6px);--ez-dropdown--box-shadow:var(--shadow--medium, 0px 8px 24px rgba(0, 38, 111, 0.1));--ez-dropdown--border-radius:var(--border--radius-medium, 12px);--ez-dropdown--background-color:var(--background--xlight, #fff);--ez-dropdown--font-family:var(--font-pattern, 'Roboto');--ez-dropdown--max-height:415px;--ez-dropdown__item--padding:var(--space--small, 6px);--ez-dropdown__item--gap:var(--space--small, 6px);--ez-dropdown__item--border-radius:var(--border--radius-small, 6px);--ez-dropdown__item--color:var(--title--primary, #2b3a54);--ez-dropdown__item--font-weight:var(--text-weight--medium, 400);--ez-dropdown__item--font-size:var(--text--medium, 14px);--ez-dropdown__item--line-height:calc(var(--ez-dropdown__item--font-size) + 4px);--ez-dropdown__item--background-color:var(--background--medium, #f0f3f7);--ez-dropdown__item--transition:var(--transition, .2s linear);--ez-dropdown__item-label--margin-right:var(--space--medium, 12px);--ez-dropdown__icon--size:var(--icon--medium, 18px);--ez-dropdown__divider--background-color:var(--color--disable-secondary, #f2f5f8);--ez-dropdown__divider--margin:var(--space--extra-small, 3px) 0;--ez-dropdown__group-label--color:var(--text--secondary, #A2ABB9);--ez-dropdown__group-label--font-weight:var(--text-weight--large, 600);--ez-dropdown__group-label--font-size:var(--text--small, 12px);--ez-dropdown__group-label--line-height:var(--text--medium, 14px);--ez-dropdown__group-label--padding:var(--space--small, 6px);--ez-dropdown__submenu--z-index:var(--most-visible, 3);--ez-dropdown__link--font-weight:var(--text-weight--large, 600);--ez-dropdown__link--primary--color:var(--color--primary, #008561);--ez-dropdown__link--critical--color:var(--color-alert--error-800, #BD0025);--ez-dropdown__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-dropdown__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-dropdown__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-dropdown__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-dropdown__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-dropdown__scrollbar--width:var(--space--small, 6px);--ez-dropdown__scrollbar--padding-right:var(--space--extra-small, 3px);display:flex;flex-direction:column;height:fit-content;user-select:none;box-sizing:border-box;position:fixed;z-index:var(--ez-dropdown--z-index)}:host *{box-sizing:border-box}.ez-dropdown{display:flex;padding:var(--ez-dropdown--padding);box-shadow:var(--ez-dropdown--box-shadow);border-radius:var(--ez-dropdown--border-radius);background-color:var(--ez-dropdown--background-color);max-width:var(--ez-dropdown--max-width)}.ez-dropdown__max-height{max-height:var(--ez-dropdown--max-height)}.ez-dropdown *{font-family:var(--ez-dropdown--font-family)}.ez-dropdown__container{display:flex;flex-direction:column;overflow-y:auto;scrollbar-width:thin;flex:auto;scrollbar-color:var(--ez-dropdown__scrollbar--color-clicked) var(--ez-dropdown__scrollbar--color-background)}.ez-dropdown__container::-webkit-scrollbar{background-color:var(--ez-dropdown__scrollbar--color-background);width:var(--ez-dropdown__scrollbar--width);max-width:var(--ez-dropdown__scrollbar--width);min-width:var(--ez-dropdown__scrollbar--width)}.ez-dropdown__container::-webkit-scrollbar-track{background-color:var(--ez-dropdown__scrollbar--color-background);border-radius:var(--ez-dropdown__scrollbar--border-radius)}.ez-dropdown__container::-webkit-scrollbar-thumb{background-color:var(--ez-dropdown__scrollbar--color-default);border-radius:var(--ez-dropdown__scrollbar--border-radius)}.ez-dropdown__container::-webkit-scrollbar-thumb:vertical:hover,.ez-dropdown__container::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-dropdown__scrollbar--color-hover)}.ez-dropdown__container::-webkit-scrollbar-thumb:vertical:active,.ez-dropdown__container::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-dropdown__scrollbar--color-clicked)}.ez-dropdown__container--spacer{padding-right:var(--ez-dropdown__scrollbar--padding-right)}.ez-dropdown__item{display:flex;align-items:center;background-color:transparent;border-radius:var(--ez-dropdown__item--border-radius);transition:var(--ez-dropdown__item--transition)}.ez-dropdown__item:hover{background-color:var(--ez-dropdown__item--background-color)}.ez-dropdown__item-wrapper{display:flex;align-items:center;position:relative;cursor:pointer;width:100%;margin:0;white-space:nowrap;gap:var(--ez-dropdown__item--gap);color:var(--ez-dropdown__item--color);font-weight:var(--ez-dropdown__item--font-weight);font-size:var(--ez-dropdown__item--font-size);line-height:var(--ez-dropdown__item--line-height);padding:var(--ez-dropdown__item--padding)}.ez-dropdown__item-wrapper ez-icon{display:flex;justify-content:center;align-items:center;width:var(--ez-dropdown__icon--size);height:var(--ez-dropdown__icon--size);min-width:var(--ez-dropdown__icon--size);min-height:var(--ez-dropdown__icon--size)}.ez-dropdown__item-content{display:flex;align-items:center;flex:auto;overflow:hidden;gap:var(--ez-dropdown__item--gap)}.ez-dropdown__item-label{text-align:left;text-overflow:ellipsis;overflow:hidden;flex:auto}.ez-dropdown__item-label:not(:last-child){margin-right:var(--ez-dropdown__item-label--margin-right)}.ez-dropdown__item-content+.ez-dropdown__link{margin-left:var(--ez-dropdown__item-label--margin-right);margin-right:var(--ez-dropdown__item--padding)}.ez-dropdown__item-builder{flex:auto}.ez-dropdown__divider{width:100%;height:2px;border-radius:1px;border:none;display:block;background-color:var(--ez-dropdown__divider--background-color);margin:var(--ez-dropdown__divider--margin)}.ez-dropdown__hidden{visibility:hidden}.ez-dropdown__group{display:flex;flex-direction:column}.ez-dropdown__group-label{display:block;width:100%;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ez-dropdown__group-label--color);font-weight:var(--ez-dropdown__group-label--font-weight);font-size:var(--ez-dropdown__group-label--font-size);line-height:var(--ez-dropdown__group-label--line-height);padding:var(--ez-dropdown__group-label--padding)}.ez-dropdown__icon-right{margin-left:auto}.ez-dropdown__submenu{position:fixed;z-index:var(--ez-dropdown__submenu--z-index);margin-top:calc(var(--ez-dropdown__item--padding) * -1)}.ez-dropdown__submenu--hide{display:none}.ez-dropdown__link{display:block;margin-left:auto;cursor:pointer;text-overflow:ellipsis;overflow:hidden;font-weight:var(--ez-dropdown__link--font-weight);max-width:calc(var(--ez-dropdown--max-width) * 0.43)}.ez-dropdown__link--primary{color:var(--ez-dropdown__link--primary--color)}.ez-dropdown__link--critical{color:var(--ez-dropdown__link--critical--color)}.ez-dropdown__link:hover{text-decoration:underline}";export{c as ez_dropdown}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,h as e,g as i}from"./p-e318d280.js";import{ElementIDUtils as h}from"@sankhyalabs/core";import{C as r}from"./p-7eb3e1a5.js";const a=class{constructor(e){t(this,e),this.ezChange=s(this,"ezChange",7),this.ezSearching=s(this,"ezSearching",7),this.ezFocusIn=s(this,"ezFocusIn",7),this._searchingText="",this.handleFocus=()=>{this._textInput.value=""===this._searchingText?"":this._searchingText,this.ezFocusIn.emit()},this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.restrict=void 0,this.mode="regular",this.asyncSearch=!1,this.canShowError=!0}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){this._textInput&&(this._textInput.errorMessage=this.errorMessage)}observeValue(t,s){this._textInput&&t!=s&&(this._textInput.value=t,this.ezChange.emit(t))}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async setValue(t){this.asyncSearch&&null!=this._textInput&&(t!==this.value?(this.value=t,this._searchingText=""):this._textInput.value=t)}async endSearch(){this.asyncSearch&&null!=this._textInput&&this._textInput.value!==this.value&&(this._textInput.value=this.value)}handleChange(t){const s=t.detail;this.errorMessage="",this.asyncSearch?(this._searchingText=s,this.ezSearching.emit(s)):s!==this.value&&(this.value=s)}componentDidLoad(){r.applyVarsTextInput(this._elem,this._textInput)}render(){return h.addIDInfoIfNotExists(this._elem,"input"),e("ez-text-input",{"data-element-id":h.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,label:this.label,onEzChange:t=>this.handleChange(t),value:this.value,enabled:this.enabled,errorMessage:this.errorMessage,restrict:this.restrict,mode:this.mode,onFocusin:this.handleFocus,canShowError:this.canShowError},e("ez-icon",{slot:"leftIcon",iconName:"search"}))}get _elem(){return i(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};a.style=":host{display:block;width:100%}";const n=class{constructor(s){t(this,s),this.message=void 0}render(){return e("div",{class:"multi-selection__message"},e("span",{class:"multi-selection__text-message"},this.message))}};n.style=".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)}";export{a as ez_filter_input,n as multi_selection_box_message}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as t,h as i}from"./p-e318d280.js";const s=class{constructor(i){o(this,i),this.applicationLoaded=t(this,"applicationLoaded",7)}componentWillLoad(){}componentDidLoad(){this.applicationLoaded.emit(!0)}render(){return i("div",null)}};s.style="";export{s as ez_application}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,c as t,h as i,g as e}from"./p-e318d280.js";import{C as h}from"./p-7eb3e1a5.js";import{ElementIDUtils as o}from"@sankhyalabs/core";const r=class{constructor(i){s(this,i),this.ezChange=t(this,"ezChange",7),this.value=void 0,this.label=void 0,this.enabled=!0,this.errorMessage=void 0,this.optionLoader=void 0,this.showSelectedValue=!0,this.showOptionValue=!0,this.suppressEmptyOption=!1,this.mode="regular",this.canShowError=!0,this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.ignoreLimitCharsToSearch=!1}observeErrorMessage(){this._comboElement&&(this._comboElement.errorMessage=this.errorMessage)}observeValue(){this._comboElement&&(this._comboElement.value=this.value)}async setFocus(){this._comboElement.setFocus()}async setBlur(){this._comboElement.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async clearValue(){var s,t;null===(t=null===(s=this._comboElement)||void 0===s?void 0:s.clearValue)||void 0===t||t.call(s)}async getValueAsync(){var s;return null===(s=this._comboElement)||void 0===s?void 0:s.getValueAsync()}onComboChange(s){s.stopPropagation(),this.value=s.detail,this.ezChange.emit(s.detail),this.errorMessage!==this._comboElement.errorMessage&&(this.errorMessage=this._comboElement.errorMessage)}componentDidLoad(){h.applyVarsTextInput(this._elem,this._comboElement)}render(){return o.addIDInfoIfNotExists(this._elem,"input"),i("ez-combo-box",{"data-element-id":o.getInternalIDInfo("combo"),ref:s=>this._comboElement=s,value:this.value,label:this.label,enabled:this.enabled,errorMessage:this.errorMessage,hideErrorOnFocusOut:this.hideErrorOnFocusOut,optionLoader:this.optionLoader,searchMode:!0,onEzChange:s=>this.onComboChange(s),showSelectedValue:this.showSelectedValue,showOptionValue:this.showOptionValue,suppressEmptyOption:this.suppressEmptyOption,mode:this.mode,canShowError:this.canShowError,listOptionsPosition:this.listOptionsPosition,isTextSearch:this.isTextSearch,limitCharsToSearch:this.ignoreLimitCharsToSearch?0:3})}get _elem(){return e(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"]}}};r.style=":host{width:100%}";export{r as ez_search}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,h as o,H as s,g as e}from"./p-e318d280.js";import{ObjectUtils as r,FloatingManager as l,StringUtils as a,ElementIDUtils as h}from"@sankhyalabs/core";import{A as n}from"./p-2187f86c.js";import{C as c}from"./p-7eb3e1a5.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{R as b}from"./p-05e1f4e7.js";const d=class{constructor(o){i(this,o),this.ezChange=t(this,"ezChange",7),this._changeDeboucingTimeout=null,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._textEmptyList="Nenhum resultado encontrado",this._textEmptySearch="Nenhum resultado de {0} encontrado",this._lookupMode=!1,this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._criteria=void 0,this.limitCharsToSearch=3,this.value=void 0,this.label=void 0,this.enabled=!0,this.options=void 0,this.errorMessage=void 0,this.searchMode=void 0,this.showSelectedValue=!1,this.showOptionValue=!1,this.suppressSearch=!1,this.optionLoader=void 0,this.suppressEmptyOption=!1,this.canShowError=!0,this.mode="regular",this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1}observeErrorMessage(){var i;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(i=this.errorMessage)||void 0===i?void 0:i.trim())||this.setInputValue())}observeValue(i,t){if(this._textInput&&i!=t)try{if(this.searchMode&&"string"==typeof i)return void this.setInputValue();const o=this.getSelectedOption(i),s=this.getSelectedOption(t),e=this.getSelectedOption(this.value);this.isDifferentValues(e,o)&&(this.value=o),this.isDifferentValues(o,s)&&(this.setInputValue(),this._lookupMode||this.ezChange.emit(null===o?void 0:o)),this.resetOptions()}finally{this._lookupMode=!1}}observeOptions(i,t){(null==i?void 0:i.join(""))!==(null==t?void 0:t.join(""))&&this.loadOptions(m.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?i=>{let t=setInterval((()=>{this._showLoading||(clearInterval(t),i(this.value))}),100)}:i=>i(this.value))}async setFocus(){this._textInput&&this._textInput.setFocus()}async setBlur(){this._textInput&&this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async clearValue(){this.clearSearch()}scrollListener(){var i;null!=this._floatingID&&((null===(i=this.listOptionsPosition)||void 0===i?void 0:i.hardPosition)?this.hideOptions():window.requestAnimationFrame((()=>{this.updateListPosition()})))}updateListPosition(){let{verticalPosition:i,horizontalPosition:t,fromBottom:o,fromRight:s,bottomLimit:e,hardPosition:r}=this.getListPosition();const l=this._listWrapper.getBoundingClientRect(),a=this._listContainer.getBoundingClientRect(),h=this._textInput.getBoundingClientRect(),n=e||window.innerHeight;!o&&(l.top<0||a.bottom+l.height>n)&&(o=!0),r||(i=i||0,t=t||0,o?i=window.innerHeight-h.top+i:i+=a.top,s?t=window.innerWidth-h.right+t:t+=a.left),null!=i&&(this._listWrapper.style[o?"bottom":"top"]=`${i}px`,this._listWrapper.style[o?"top":"bottom"]=""),null!=t&&(this._listWrapper.style[s?"right":"left"]=`${t}px`,this._listWrapper.style[s?"left":"right"]="")}getListPosition(){return this.listOptionsPosition?this.listOptionsPosition:{verticalPosition:this.errorMessage||!this.canShowError||"slim"===this.mode?6:-13}}isDifferentValues(i,t){return r.objectToString(i||{})!==r.objectToString(t||{})}getFormattedText(i){if(null!=i)return this.showSelectedValue&&null!=i.value?i.label?`${i.value} - ${i.label}`:i.value:i.label}getText(){const i=this.getSelectedOption(this.value),t=this.getFormattedText(i);if(null!=t)return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}getSelectedOption(i){return"string"==typeof i||i instanceof String?this._visibleOptions.find((t=>t.value===i)):i}updateVisibleOptions(){let i=this._source||[];if(!this.searchMode&&this._criteria){const t=this._criteria.toUpperCase();i=i.filter((i=>i.label.toLocaleUpperCase().indexOf(t)>-1))}this._visibleOptions=this.suppressEmptyOption?i:[{value:void 0,label:""}].concat(i),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var i;if(this.showOptionValue){const t=[];return null===(i=this._visibleOptions)||void 0===i||i.forEach((i=>{const o=this.getWidthValue(i.value);t.includes(o)||t.push(o)})),t.length>1?Math.max(...t):0}return 0}getWidthValue(i){if(null!=this._itemValueBasis){const t=this._itemValueBasis;if(null!=i)return t.innerHTML=i,t.clientWidth>0?t.clientWidth+2:0;t.innerHTML=""}return 0}buildItem(i,t){const s=this.showOptionValue&&this._maxWidthValue>0?`${this._maxWidthValue}px`:"";return i.label=i.label||i.value,o("li",{class:t===this._preSelection?"item preselected":"item",id:`item_${i.value}`,onMouseDown:()=>this.selectOption(i),onMouseOver:()=>this._preSelection=t},this.showOptionValue?o("span",{class:"item__value",title:i.value,style:{width:s,minWidth:s,maxWidth:s}},i.value):void 0,o("span",{class:"item__label "+(this.showOptionValue?"item__label--bold":""),title:i.label},i.label))}showOptions(){this.enabled&&(this.isOptionsVisible()||(this._resizeObserver&&this._resizeObserver.observe(this._textInput),this._floatingID=l.float(this._listWrapper,this._listContainer,{autoClose:!0,isFixed:!0,backClickListener:()=>this.hideOptions()}),this.setFocus(),window.requestAnimationFrame((()=>{this.updateListPosition(),this.listOptionsPosition||this._listWrapper.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}))))}hideOptions(){void 0!==this._floatingID&&l.close(this._floatingID),this._floatingID=void 0,this._resizeObserver&&this._resizeObserver.unobserve(this._textInput)}isOptionsVisible(){return void 0!==this._floatingID&&l.isFloating(this._floatingID)}nextOption(){this.searchMode&&!this.isOptionsVisible()||(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection]))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection])}scrollToOption(i){window.requestAnimationFrame((()=>{const t=(null==i?void 0:i.value)?this._optionsList.querySelector(`li#item_${i.value.replace(/[<>\[\]#=]/g,"\\$&").replace(/:/g,"\\:")}`):void 0;t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})}))}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(i){this._startLoading=!1,i instanceof Promise?(this._showLoading=!0,i.then((i=>{this._showLoading=!1,this.updateSource(i)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(i)?(this._source=i,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch())):this.selectOption(i))}clearSource(){this._source=[],this.updateVisibleOptions()}selectOption(i){var t,o;const s=this.getSelectedOption(this.value);(null===(t=null==s?void 0:s.value)||void 0===t?void 0:t.toString())!==(null===(o=null==i?void 0:i.value)||void 0===o?void 0:o.toString())||null==s&&null!=i&&"value"in i?this.value=(null==i?void 0:i.value)?i:void 0:this.resetOptions(),this.searchMode&&(this._visibleOptions=[],this.clearSource())}loadOptions(i,t=""){this._criteria=t,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:i,argument:t}):this.options)}cancelPreselection(){!this._textInput.value&&this.value?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue()}),this._deboucingTime),this.resetOptions()}setInputValue(i=!0){const t=this.getText();(this._textInput.value||"")!==t&&(this._textInput.value=t,i&&(this.errorMessage=null))}clearSearch(){this.value=null}controlListWithOnlyOne(){var i;if(this.searchMode){const t=null===(i=this._visibleOptions)||void 0===i?void 0:i.filter((i=>""!==i.label&&null!=i.value));1===(null==t?void 0:t.length)&&this.selectOption(t[0])}}controlEmptySearch(){var i;this.searchMode&&((null===(i=this._visibleOptions)||void 0===i?void 0:i.length)?this.controlListWithOnlyOne():(this.clearSearch(),n.info(this._textEmptyList)))}validateDescriptionValue(){if(!this.searchMode||a.isEmpty(this.value))return;let i=this.value;"object"!=typeof i&&(a.isEmpty(i)||this.loadDescriptionValue(i))}async loadDescriptionValue(i){var t,o;if(null==i)return;if((null===(t=this.options)||void 0===t?void 0:t.length)>0)return void this.loadOptionValue(i);const s={mode:m.PREDICTIVE,argument:i},e=await(null===(o=this.optionLoader)||void 0===o?void 0:o.call(this,s));null!=e&&(e instanceof Promise?e.then((i=>{this.setDescriptionValue(i)})):this.setDescriptionValue(e))}setDescriptionValue(i){const t=(null==i?void 0:i[0])||i;null!=t&&Object.keys(t).length?(this._lookupMode=!0,this.value=t):this.showNoResultMessage()}loadOptionValue(i){var t;const o=null===(t=this.options)||void 0===t?void 0:t.find((t=>t.value===i));null!=o?this.selectOption(o):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),n.info(this._textEmptySearch.replace("{0}",this.getFieldLabel()))}getFieldLabel(){var i;return null===(i=this.label)||void 0===i?void 0:i.replace(b,"").toUpperCase()}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}componentWillLoad(){if(void 0===this.options){this.options=[];const i=this.el.querySelectorAll("option");i&&i.forEach((i=>{let t=i.innerText,o=i.getAttribute("value");o||(o=t),this.options.push({label:t,value:o}),i.hidden=!0}))}this.searchMode?this.updateSource([]):this.loadOptions(m.PRELOAD)}componentDidRender(){var i;void 0===this._floatingID&&this._listWrapper.remove(),null===(i=this._optionsList)||void 0===i||i.querySelectorAll(".item").forEach((i=>{h.addIDInfoIfNotExists(i,"itemComboBox")})),this.validateDescriptionValue()}componentDidLoad(){c.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1),this._resizeObserver=new ResizeObserver((i=>{window.requestAnimationFrame((()=>{if(!Array.isArray(i)||!i.length)return;const{clientWidth:t}=this._listContainer;t>0&&this._listWrapper&&(this._listWrapper.style.width=`${t}px`)}))}))}handlerIconClick(){this.searchMode?this.loadOptions(m.ADVANCED):this.showOptions()}buildNumberArgument(i){return this.isTextSearch?NaN:Number(i||void 0)}onTextInputChangeHandler(i){var t;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(i)}),this._deboucingTime));const o=null===(t=i.target.value)||void 0===t?void 0:t.trim();if(this._criteria||(this._textInput.value=i.data||o),this._criteria=o,o)if(this.searchMode){this._showLoading=!1,this.clearSource();const i=o.length>=this.limitCharsToSearch,t=this.buildNumberArgument(o);i||!isNaN(t)?(this._showLoading=!0,this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(m.PREDICTIVE,isNaN(t)?o:t.toString())}),this._deboucingTime),this.showOptions()):this.hideOptions()}else this.updateVisibleOptions(),this.showOptions();else this.hideOptions(),this.searchMode?(this._showLoading=!1,this.clearSource()):this.updateVisibleOptions()}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}onTextInputClickHandler(){this.searchMode||this.showOptions()}keyDownHandler(i){switch(this._tabPressed=!1,i.ctrlKey&&("f"!==i.key&&"F"!==i.key||(this.loadOptions(m.ADVANCED),i.stopPropagation(),i.stopImmediatePropagation(),i.preventDefault())),i.key){case"ArrowDown":this.nextOption(),i.stopPropagation();break;case"ArrowUp":this.previousOption(),i.stopPropagation();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne()}}onTextInputFocusOutHandler(){this.hideErrorOnFocusOut&&this.cancelPreselection()}canShowListOptions(){return!this._showLoading&&this._visibleOptions.length>0}render(){var i;return h.addIDInfoIfNotExists(this.el,"input"),o(s,null,o("ez-text-input",{"data-element-id":h.getInternalIDInfo("textInput"),class:this.suppressSearch?"suppressed-search-input":"",ref:i=>this._textInput=i,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:i=>this.onTextInputChangeHandler(i),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:i=>this.keyDownHandler(i),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode},o("button",{class:"btn",slot:this.searchMode?"leftIcon":"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},o("ez-icon",{iconName:this.searchMode?"search":"chevron-down"})),this.searchMode&&(null===(i=this._textInput)||void 0===i?void 0:i.value)&&(this._criteria||this.value)?o("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},o("ez-icon",{iconName:"close"})):void 0),o("section",{class:"list-container",ref:i=>this._listContainer=i},o("div",{class:"list-wrapper",ref:i=>this._listWrapper=i},o("ul",{class:"list-options",ref:i=>this._optionsList=i},!this._showLoading&&0===this._visibleOptions.length&&o("div",{class:"message"},o("span",{class:"message__no-result"},this._textEmptyList)),this._showLoading&&o("div",{class:"message"},o("div",{class:"message__loading"})),this.showOptionValue?o("span",{class:"item__value item__value--hidden",ref:i=>this._itemValueBasis=i}):void 0,this.canShowListOptions()&&this._visibleOptions.map(((i,t)=>this.buildItem(i,t)))))))}get el(){return e(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],options:["observeOptions"]}}};var m;!function(i){i.ADVANCED="ADVANCED",i.PRELOAD="PRELOAD",i.PREDICTIVE="PREDICTIVE"}(m||(m={})),d.style=":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box--line-height:calc(var(--text--medium, 14px) + 4px);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #2B3A54);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium) + 4px);--ez-combo-box__list-min-width:64px;--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-combo-box__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-combo-box__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-combo-box__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-combo-box__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{min-width:var(--ez-combo-box__list-min-width);position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small) + 9px);background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;padding:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-combo-box__scrollbar--color-clicked) var(--ez-combo-box__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__scrollbar--color-background);width:var(--ez-combo-box__scrollbar--width);max-width:var(--ez-combo-box__scrollbar--width);min-width:var(--ez-combo-box__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__scrollbar--color-background);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__scrollbar--color-default);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-combo-box__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-combo-box__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size);line-height:var(--ez-combo-box--line-height)}.item__label{font-weight:var(--ez-combo-box--font-weight--medium)}.item__label--bold{font-weight:var(--ez-combo-box--font-weight--large)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--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}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-combo-box__list-height)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{d as ez_combo_box}
|