@vertexvis/ui 0.1.0-testing.4 → 0.1.0-testing.6
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/components.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +6 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{popover-d9ec8e10.js → popover-942209b8.js} +23 -1
- package/dist/cjs/{result-list-1e592c3c.js → result-list-241ffe8d.js} +46 -2
- package/dist/cjs/search-bar-e101ba43.js +398 -0
- package/dist/cjs/{select-0eb7203f.js → select-5f8aecfe.js} +27 -4
- package/dist/cjs/{text-field-0397fb34.js → text-field-bccbde1f.js} +1 -0
- package/dist/cjs/{tooltip-02e24a48.js → tooltip-e9f63631.js} +58 -19
- package/dist/cjs/vertex-popover.cjs.entry.js +1 -1
- package/dist/cjs/vertex-result-list.cjs.entry.js +1 -1
- package/dist/cjs/vertex-search-bar.cjs.entry.js +1 -1
- package/dist/cjs/vertex-select.cjs.entry.js +1 -1
- package/dist/cjs/vertex-textfield.cjs.entry.js +1 -1
- package/dist/cjs/vertex-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/menu/menu.js +1 -1
- package/dist/collection/components/popover/popover.js +51 -0
- package/dist/collection/components/result-list/result-list.js +47 -3
- package/dist/collection/components/search-bar/dom.js +12 -0
- package/dist/collection/components/search-bar/lib.js +23 -15
- package/dist/collection/components/search-bar/search-bar.css +2 -29
- package/dist/collection/components/search-bar/search-bar.js +353 -326
- package/dist/collection/components/select/select.css +16 -0
- package/dist/collection/components/select/select.js +49 -2
- package/dist/collection/components/text-field/text-field.js +1 -0
- package/dist/collection/components/tooltip/tooltip.css +0 -4
- package/dist/collection/components/tooltip/tooltip.js +62 -18
- package/dist/collection/util/templates/element-pool.js +19 -1
- package/dist/components/components.css +1 -1
- package/dist/components/components.esm.js +1 -1
- package/dist/components/index.esm.js +1 -1
- package/dist/components/p-0b1cdc8a.entry.js +1 -0
- package/dist/components/p-406e73da.entry.js +1 -0
- package/dist/components/p-43b1b3f9.js +1 -0
- package/dist/components/p-606596de.entry.js +1 -0
- package/dist/components/p-6b862967.js +1 -0
- package/dist/components/p-7cfb3736.entry.js +1 -0
- package/dist/components/p-8393b6a7.js +1 -0
- package/dist/components/p-912f6e24.js +1 -0
- package/dist/components/p-92930f2a.js +1 -0
- package/dist/components/p-c2706288.js +1 -0
- package/dist/components/p-ee496965.entry.js +1 -0
- package/dist/components/p-f51fef1d.entry.js +1 -0
- package/dist/esm/components.js +1 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{popover-67c88e4b.js → popover-6e806354.js} +23 -1
- package/dist/esm/{result-list-36cfb08a.js → result-list-16c6afbd.js} +46 -2
- package/dist/esm/search-bar-12d91ad5.js +396 -0
- package/dist/esm/{select-75ed5653.js → select-d4e135b7.js} +27 -4
- package/dist/esm/{text-field-e542da25.js → text-field-32ac877e.js} +1 -0
- package/dist/esm/{tooltip-b4d2a889.js → tooltip-933da261.js} +58 -19
- package/dist/esm/vertex-popover.entry.js +1 -1
- package/dist/esm/vertex-result-list.entry.js +1 -1
- package/dist/esm/vertex-search-bar.entry.js +1 -1
- package/dist/esm/vertex-select.entry.js +1 -1
- package/dist/esm/vertex-textfield.entry.js +1 -1
- package/dist/esm/vertex-tooltip.entry.js +1 -1
- package/dist/types/components/popover/popover.d.ts +7 -0
- package/dist/types/components/result-list/result-list.d.ts +9 -1
- package/dist/types/components/search-bar/dom.d.ts +3 -0
- package/dist/types/components/search-bar/lib.d.ts +12 -6
- package/dist/types/components/search-bar/search-bar.d.ts +98 -41
- package/dist/types/components/select/select.d.ts +8 -0
- package/dist/types/components/tooltip/tooltip.d.ts +7 -0
- package/dist/types/components.d.ts +81 -16
- package/dist/types/util/templates/element-pool.d.ts +10 -1
- package/package.json +4 -3
- package/dist/cjs/search-bar-bb40cfa7.js +0 -290
- package/dist/components/p-19318fee.entry.js +0 -1
- package/dist/components/p-209db2ba.entry.js +0 -1
- package/dist/components/p-2bb3b235.js +0 -1
- package/dist/components/p-4224c2ad.js +0 -1
- package/dist/components/p-52739247.js +0 -1
- package/dist/components/p-552c128f.js +0 -1
- package/dist/components/p-6505cdb3.js +0 -1
- package/dist/components/p-ae6a3c46.entry.js +0 -1
- package/dist/components/p-bd11e7d1.js +0 -1
- package/dist/components/p-c8dd68a1.entry.js +0 -1
- package/dist/components/p-e576818b.entry.js +0 -1
- package/dist/components/p-ebabee40.entry.js +0 -1
- package/dist/esm/search-bar-59cc151d.js +0 -288
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-6a92256c.js');
|
|
4
|
-
const index$1 = require('./index-e1b40fa6.js');
|
|
5
|
-
const templates = require('./templates-e7b3ffbb.js');
|
|
6
|
-
|
|
7
|
-
const getWindowSelection = () => {
|
|
8
|
-
if (typeof window !== 'undefined') {
|
|
9
|
-
return window.getSelection();
|
|
10
|
-
}
|
|
11
|
-
return undefined;
|
|
12
|
-
};
|
|
13
|
-
const createDocumentRange = () => {
|
|
14
|
-
return document.createRange();
|
|
15
|
-
};
|
|
16
|
-
const isTextNode = (node) => {
|
|
17
|
-
return node instanceof Text;
|
|
18
|
-
};
|
|
19
|
-
const isHtmlElement = (target) => {
|
|
20
|
-
return target instanceof HTMLElement;
|
|
21
|
-
};
|
|
22
|
-
const isReplacedElement = (el) => {
|
|
23
|
-
return (el === null || el === void 0 ? void 0 : el.getAttribute('data-replaced')) === 'true';
|
|
24
|
-
};
|
|
25
|
-
const createTextNode = (text) => {
|
|
26
|
-
return new Text(text != null && text !== '' ? text : ' ');
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const searchBarCss = ".wrapper.sc-vertex-search-bar{display:flex;align-items:center;width:100%;box-sizing:border-box;background:none;border:1px solid transparent;border-radius:4px;font-family:var(--vertex-ui-font-family);font-size:0.875rem;line-height:1.4}.test-mention.sc-vertex-search-bar{display:inline-block;color:blue}.hidden.sc-vertex-search-bar{visibility:hidden}.content-input.sc-vertex-search-bar{width:100%;box-sizing:border-box;padding:6px 0.5em 7px;border:1px solid transparent;background:none;font-family:var(--vertex-ui-font-family);font-weight:var(--vertex-ui-font-weight-base);font-size:0.875rem;line-height:1.4;white-space:pre-line}.textarea.sc-vertex-search-bar{overflow:hidden;outline:none;box-shadow:none;resize:none}.content-input.sc-vertex-search-bar:focus{outline:none}.standard.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-400);color:var(--vertex-ui-neutral-800)}.standard.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-500)}.standard.sc-vertex-search-bar:hover:not(.disabled),.standard.sc-vertex-search-bar:focus{border-color:var(--vertex-ui-neutral-500)}.standard.disabled.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-200)}.standard.disabled.sc-vertex-search-bar,.standard.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.blank.sc-vertex-search-bar{color:var(--vertex-ui-neutral-800)}.blank.sc-vertex-search-bar:not(:hover) .content-input.sc-vertex-search-bar:focus{border-color:var(--vertex-ui-neutral-400);border-radius:4px}.blank.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-500)}.blank.sc-vertex-search-bar:hover:not(.disabled) .content-input.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-400);border-radius:4px}.blank.disabled.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-200)}.blank.disabled.sc-vertex-search-bar,.blank.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.filled.sc-vertex-search-bar{background-color:var(--vertex-ui-neutral-200);border-color:var(--vertex-ui-neutral-200);color:var(--vertex-ui-neutral-800)}.filled.disabled.sc-vertex-search-bar,.filled.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.filled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-700)}.filled.sc-vertex-search-bar:hover:not(.disabled),.filled.sc-vertex-search-bar:focus{border-bottom-color:var(--vertex-ui-blue-600)}.filled.disabled.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-100)}.filled.disabled.sc-vertex-search-bar,.filled.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.underlined.sc-vertex-search-bar{background-color:var(--vertex-ui-white);border-color:var(--vertex-ui-white) var(--vertex-ui-white) var(--vertex-ui-neutral-400) var(--vertex-ui-white);color:var(--vertex-ui-neutral-800)}.underlined.disabled.sc-vertex-search-bar,.underlined.disabled.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.underlined.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-700)}.underlined.sc-vertex-search-bar:hover:not(.disabled),.underlined.sc-vertex-search-bar:focus{background-color:var(--vertex-ui-neutral-200);border-color:var(--vertex-ui-neutral-200);border-bottom-color:var(--vertex-ui-blue-600)}.underlined.disabled.sc-vertex-search-bar{border-bottom-color:var(--vertex-ui-neutral-200)}.underlined.disabled.sc-vertex-search-bar,.underlined.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.underlined.has-error.sc-vertex-search-bar{border-bottom-color:var(--vertex-ui-red-600)}";
|
|
30
|
-
|
|
31
|
-
const SearchBar = class {
|
|
32
|
-
constructor(hostRef) {
|
|
33
|
-
index.registerInstance(this, hostRef);
|
|
34
|
-
this.triggerCharacterPressed = index.createEvent(this, "triggerCharacterPressed", 7);
|
|
35
|
-
this.valueChanged = index.createEvent(this, "valueChanged", 7);
|
|
36
|
-
this.inputFocus = index.createEvent(this, "inputFocus", 7);
|
|
37
|
-
this.inputBlur = index.createEvent(this, "inputBlur", 7);
|
|
38
|
-
this.resultsEnterPressed = index.createEvent(this, "resultsEnterPressed", 7);
|
|
39
|
-
this.handleKeyDown = (event) => {
|
|
40
|
-
if ((this.triggerCharacters.includes(event.key) ||
|
|
41
|
-
this.triggerCharacter === event.key) &&
|
|
42
|
-
this.triggerKey == null) {
|
|
43
|
-
this.triggerKey = event.key;
|
|
44
|
-
this.updateCursorPosition();
|
|
45
|
-
this.triggerCharacterPressed.emit('');
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
this.restartTriggerInput();
|
|
49
|
-
}
|
|
50
|
-
if (event.key === 'Backspace') {
|
|
51
|
-
const selection = getWindowSelection();
|
|
52
|
-
if (selection && (selection === null || selection === void 0 ? void 0 : selection.rangeCount) > 0) {
|
|
53
|
-
const range = selection.getRangeAt(0);
|
|
54
|
-
range.deleteContents();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
this.valueChanged.emit();
|
|
58
|
-
};
|
|
59
|
-
this.handleKeyUp = (event) => {
|
|
60
|
-
if (event.key === 'Backspace') {
|
|
61
|
-
this.updateTriggerState(this.getSelectionSubstring());
|
|
62
|
-
}
|
|
63
|
-
if (event.key === 'Enter') {
|
|
64
|
-
this.clearTriggerState();
|
|
65
|
-
}
|
|
66
|
-
this.valueChanged.emit();
|
|
67
|
-
};
|
|
68
|
-
this.updateTriggerValue = (data) => {
|
|
69
|
-
var _a, _b, _c, _d, _e;
|
|
70
|
-
if (this.triggerKey != null &&
|
|
71
|
-
this.triggerRange != null &&
|
|
72
|
-
this.triggerRange.startContainer === this.triggerRange.endContainer) {
|
|
73
|
-
const triggerRangeNode = this.triggerRange.startContainer;
|
|
74
|
-
if (isTextNode(triggerRangeNode)) {
|
|
75
|
-
const before = createTextNode((_a = triggerRangeNode.textContent) === null || _a === void 0 ? void 0 : _a.slice(0, this.triggerRange.startOffset - 1));
|
|
76
|
-
const after = createTextNode((_b = triggerRangeNode.textContent) === null || _b === void 0 ? void 0 : _b.slice(this.triggerRange.endOffset));
|
|
77
|
-
const replaced = this.createReplacedElement(data);
|
|
78
|
-
(_c = triggerRangeNode.parentElement) === null || _c === void 0 ? void 0 : _c.insertBefore(before, triggerRangeNode);
|
|
79
|
-
(_d = triggerRangeNode.parentElement) === null || _d === void 0 ? void 0 : _d.insertBefore(after, triggerRangeNode.nextSibling);
|
|
80
|
-
(_e = triggerRangeNode.parentElement) === null || _e === void 0 ? void 0 : _e.insertBefore(replaced, after);
|
|
81
|
-
triggerRangeNode.remove();
|
|
82
|
-
this.moveCursorToNodeEnd(after, true);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
this.triggerText = () => {
|
|
87
|
-
var _a, _b;
|
|
88
|
-
if (this.triggerKey != null &&
|
|
89
|
-
this.triggerRange != null &&
|
|
90
|
-
this.triggerRange.startContainer === this.triggerRange.endContainer) {
|
|
91
|
-
const triggerRangeNode = this.triggerRange.startContainer;
|
|
92
|
-
return ((_b = (_a = triggerRangeNode.textContent) === null || _a === void 0 ? void 0 : _a.slice(this.triggerRange.startOffset, this.triggerRange.endOffset)) !== null && _b !== void 0 ? _b : '');
|
|
93
|
-
}
|
|
94
|
-
return '';
|
|
95
|
-
};
|
|
96
|
-
this.restartTriggerInput = () => {
|
|
97
|
-
this.clearTriggerTimeout();
|
|
98
|
-
this.triggerTimeout = setTimeout(() => {
|
|
99
|
-
if (this.triggerRange != null && this.triggerKey != null) {
|
|
100
|
-
this.triggerCharacterPressed.emit(this.triggerText());
|
|
101
|
-
}
|
|
102
|
-
this.triggerTimeout = undefined;
|
|
103
|
-
}, this.debounce);
|
|
104
|
-
};
|
|
105
|
-
this.clearTriggerTimeout = () => {
|
|
106
|
-
if (this.triggerTimeout != null) {
|
|
107
|
-
clearTimeout(this.triggerTimeout);
|
|
108
|
-
this.triggerTimeout = undefined;
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
this.updateCursorPosition = () => {
|
|
112
|
-
var _a;
|
|
113
|
-
const selection = getWindowSelection();
|
|
114
|
-
if (selection != null && selection.rangeCount > 0) {
|
|
115
|
-
const cursorBounds = selection.getRangeAt(0).getBoundingClientRect();
|
|
116
|
-
const inputBounds = (_a = this.contentEl) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
117
|
-
const cursorBottom = cursorBounds.bottom || (inputBounds === null || inputBounds === void 0 ? void 0 : inputBounds.bottom) || 0;
|
|
118
|
-
const cursorTop = cursorBounds.top || (inputBounds === null || inputBounds === void 0 ? void 0 : inputBounds.top) || 0;
|
|
119
|
-
this.cursorPosition = {
|
|
120
|
-
x: cursorBounds.left || (inputBounds === null || inputBounds === void 0 ? void 0 : inputBounds.left) || 0,
|
|
121
|
-
y: this.placement.includes('top') ? cursorTop : cursorBottom,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
this.moveCursorToNodeEnd = (node, collapseToStart = false) => {
|
|
126
|
-
const selection = getWindowSelection();
|
|
127
|
-
if (selection != null) {
|
|
128
|
-
const range = createDocumentRange();
|
|
129
|
-
range.selectNodeContents(node);
|
|
130
|
-
range.collapse(collapseToStart);
|
|
131
|
-
selection.removeAllRanges();
|
|
132
|
-
selection.addRange(range);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
this.updateInputCursorPosition = (target) => {
|
|
136
|
-
if (isHtmlElement(target)) {
|
|
137
|
-
const targetElement = isReplacedElement(target.parentElement)
|
|
138
|
-
? target.parentElement
|
|
139
|
-
: target;
|
|
140
|
-
if (isReplacedElement(targetElement)) {
|
|
141
|
-
this.insertAdjacentTextNode(targetElement);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
this.createReplacedElement = (data) => {
|
|
146
|
-
const template = this.hostEl.querySelector('template[slot="replaced"]');
|
|
147
|
-
if (template != null) {
|
|
148
|
-
const instance = templates.generateInstanceFromTemplate(template);
|
|
149
|
-
instance.bindings.bind(data);
|
|
150
|
-
instance.element.style.display = 'inline-block';
|
|
151
|
-
instance.element.contentEditable = 'false';
|
|
152
|
-
instance.element.setAttribute('data-replaced', 'true');
|
|
153
|
-
return instance.element;
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
throw new Error('Replaced template not defined.');
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
this.handleSelectionChange = () => {
|
|
160
|
-
this.updateTriggerState(this.getSelectionSubstring());
|
|
161
|
-
};
|
|
162
|
-
this.getSelectionSubstring = () => {
|
|
163
|
-
var _a;
|
|
164
|
-
const selection = getWindowSelection();
|
|
165
|
-
if (selection != null && selection.rangeCount > 0) {
|
|
166
|
-
const range = selection.getRangeAt(0);
|
|
167
|
-
this.updateTriggerRange();
|
|
168
|
-
if (range != null &&
|
|
169
|
-
range.startOffset === range.endOffset &&
|
|
170
|
-
isTextNode(range.startContainer) &&
|
|
171
|
-
range.startContainer.textContent != null &&
|
|
172
|
-
!isReplacedElement(range.startContainer.parentElement) &&
|
|
173
|
-
((_a = this.contentEl) === null || _a === void 0 ? void 0 : _a.contains(range.startContainer))) {
|
|
174
|
-
return range.startContainer.textContent.slice(this.lastIndexOfBreakCharacter(range.startContainer.textContent.slice(0, range.startOffset)) + 1, range.startOffset);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return '';
|
|
178
|
-
};
|
|
179
|
-
this.insertAdjacentTextNode = (el) => {
|
|
180
|
-
el.insertAdjacentText('afterend', '');
|
|
181
|
-
if (el.nextSibling != null) {
|
|
182
|
-
this.moveCursorToNodeEnd(el.nextSibling);
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
this.updateTriggerState = (text) => {
|
|
186
|
-
const triggers = this.triggerCharacter != null
|
|
187
|
-
? [...this.triggerCharacters, this.triggerCharacter]
|
|
188
|
-
: this.triggerCharacters;
|
|
189
|
-
const trigger = triggers.find((tc) => text.includes(tc));
|
|
190
|
-
if (trigger != null) {
|
|
191
|
-
this.restartTriggerInput();
|
|
192
|
-
this.triggerKey = trigger;
|
|
193
|
-
this.updateTriggerRange();
|
|
194
|
-
if (this.cursorPosition == null) {
|
|
195
|
-
this.updateCursorPosition();
|
|
196
|
-
}
|
|
197
|
-
this.open = true;
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
this.clearTriggerState();
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
this.updateTriggerRange = () => {
|
|
204
|
-
var _a;
|
|
205
|
-
const selection = getWindowSelection();
|
|
206
|
-
if (selection != null && selection.rangeCount > 0) {
|
|
207
|
-
const range = selection.getRangeAt(0);
|
|
208
|
-
if (this.triggerKey != null) {
|
|
209
|
-
this.triggerRange = (_a = this.triggerRange) !== null && _a !== void 0 ? _a : range.cloneRange();
|
|
210
|
-
this.triggerRange.setEnd(range.endContainer, range.endOffset);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
this.clearTriggerState = () => {
|
|
215
|
-
this.triggerKey = undefined;
|
|
216
|
-
this.triggerRange = undefined;
|
|
217
|
-
this.cursorPosition = undefined;
|
|
218
|
-
this.open = false;
|
|
219
|
-
this.clearTriggerTimeout();
|
|
220
|
-
};
|
|
221
|
-
this.lastIndexOfBreakCharacter = (search) => {
|
|
222
|
-
const index = this.breakCharacters.reduce((index, bc) => {
|
|
223
|
-
const searchIndex = search
|
|
224
|
-
.replace(String.fromCharCode(160), ' ')
|
|
225
|
-
.lastIndexOf(bc);
|
|
226
|
-
return searchIndex > index ? searchIndex : index;
|
|
227
|
-
}, -1);
|
|
228
|
-
return index;
|
|
229
|
-
};
|
|
230
|
-
this.handleFocus = (ev) => {
|
|
231
|
-
this.inputFocus.emit(ev);
|
|
232
|
-
};
|
|
233
|
-
this.handleBlur = (ev) => {
|
|
234
|
-
this.open = false;
|
|
235
|
-
this.inputBlur.emit(ev);
|
|
236
|
-
};
|
|
237
|
-
this.handleInputPointerEvent = (ev) => {
|
|
238
|
-
if (ev.target != null) {
|
|
239
|
-
this.updateInputCursorPosition(ev.target);
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
this.handleResultPointerDown = (ev) => {
|
|
243
|
-
ev.preventDefault();
|
|
244
|
-
};
|
|
245
|
-
this.variant = 'standard';
|
|
246
|
-
this.resultItems = undefined;
|
|
247
|
-
this.triggerCharacters = [];
|
|
248
|
-
this.triggerCharacter = undefined;
|
|
249
|
-
this.breakCharacters = [' '];
|
|
250
|
-
this.debounce = 100;
|
|
251
|
-
this.placeholder = undefined;
|
|
252
|
-
this.placement = 'bottom-start';
|
|
253
|
-
this.cursorPosition = undefined;
|
|
254
|
-
this.open = false;
|
|
255
|
-
this.triggerKey = undefined;
|
|
256
|
-
this.triggerRange = undefined;
|
|
257
|
-
}
|
|
258
|
-
componentWillLoad() {
|
|
259
|
-
document.addEventListener('selectionchange', this.handleSelectionChange);
|
|
260
|
-
}
|
|
261
|
-
disconnectedCallback() {
|
|
262
|
-
document.removeEventListener('selectionchange', this.handleSelectionChange);
|
|
263
|
-
}
|
|
264
|
-
async replaceTriggeredValue(data) {
|
|
265
|
-
this.updateTriggerValue(data);
|
|
266
|
-
this.clearTriggerState();
|
|
267
|
-
this.valueChanged.emit();
|
|
268
|
-
}
|
|
269
|
-
async getEditableContent() {
|
|
270
|
-
var _a;
|
|
271
|
-
return (_a = this.contentEl) === null || _a === void 0 ? void 0 : _a.childNodes;
|
|
272
|
-
}
|
|
273
|
-
render() {
|
|
274
|
-
var _a;
|
|
275
|
-
const classes = index$1.classnames('wrapper', {
|
|
276
|
-
standard: this.variant === 'standard',
|
|
277
|
-
filled: this.variant === 'filled',
|
|
278
|
-
underlined: this.variant === 'underlined',
|
|
279
|
-
blank: this.variant === 'blank',
|
|
280
|
-
});
|
|
281
|
-
return (index.h(index.Host, null, index.h("div", { class: classes }, index.h("span", { class: "content-input", ref: (ref) => (this.contentEl = ref), role: "textbox", contenteditable: "true", "aria-multiline": "true", "data-placeholder": this.placeholder, onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp, onBlur: this.handleBlur, onFocus: this.handleFocus, onPointerDown: this.handleInputPointerEvent, onPointerUp: this.handleInputPointerEvent })), index.h("vertex-result-list", { position: this.cursorPosition, placement: this.placement, open: this.open &&
|
|
282
|
-
this.resultItems != null &&
|
|
283
|
-
this.resultItems.length > 0 &&
|
|
284
|
-
this.cursorPosition != null, items: (_a = this.resultItems) !== null && _a !== void 0 ? _a : [], onPointerDown: this.handleResultPointerDown, onEnterPressed: (event) => this.resultsEnterPressed.emit(event.detail) }, index.h("slot", { name: "results" })), index.h("slot", { name: "replaced" })));
|
|
285
|
-
}
|
|
286
|
-
get hostEl() { return index.getElement(this); }
|
|
287
|
-
};
|
|
288
|
-
SearchBar.style = searchBarCss;
|
|
289
|
-
|
|
290
|
-
exports.SearchBar = SearchBar;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{R as vertex_result_list}from"./p-52739247.js";import"./p-6834631c.js";import"./p-fe062eb0.js";import"./p-1356f525.js";import"./p-59032668.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{T as vertex_textfield}from"./p-bd11e7d1.js";import"./p-6834631c.js";import"./p-fe062eb0.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as n,H as r,g as e}from"./p-6834631c.js";import{_ as i,a as o}from"./p-59032668.js";import{c as u}from"./p-fe062eb0.js";import{a as s}from"./p-b2c7b113.js";var c;c=Error,i((function t(n){var r=c.call(this,"Validation error mapping object.")||this;return r.errors=n,Object.setPrototypeOf(r,t.prototype),r}),c);var a,f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={exports:{}};!function(t,n){var r="__lodash_hash_undefined__",e=9007199254740991,i="[object Arguments]",o="[object Array]",u="[object Boolean]",s="[object Date]",c="[object Error]",a="[object Function]",h="[object Map]",l="[object Number]",v="[object Object]",d="[object Promise]",p="[object RegExp]",b="[object Set]",y="[object String]",g="[object WeakMap]",j="[object ArrayBuffer]",m="[object DataView]",w=/^\[object .+?Constructor\]$/,x=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[i]=_[o]=_[j]=_[u]=_[m]=_[s]=_[c]=_[a]=_[h]=_[l]=_[v]=_[p]=_[b]=_[y]=_[g]=!1;var B="object"==typeof f&&f&&f.Object===Object&&f,I="object"==typeof self&&self&&self.Object===Object&&self,O=B||I||Function("return this")(),E=n&&!n.nodeType&&n,A=E&&t&&!t.nodeType&&t,P=A&&A.exports===E,$=P&&B.process,k=function(){try{return $&&$.binding&&$.binding("util")}catch(t){}}(),S=k&&k.isTypedArray;function C(t,n){for(var r=-1,e=null==t?0:t.length;++r<e;)if(n(t[r],r,t))return!0;return!1}function T(t){var n=-1,r=Array(t.size);return t.forEach((function(t,e){r[++n]=[e,t]})),r}function M(t){var n=-1,r=Array(t.size);return t.forEach((function(t){r[++n]=t})),r}var U,D,F,L=Array.prototype,V=Object.prototype,R=O["__core-js_shared__"],N=Function.prototype.toString,W=V.hasOwnProperty,z=(U=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"",G=V.toString,H=RegExp("^"+N.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),q=P?O.Buffer:void 0,J=O.Symbol,K=O.Uint8Array,Q=V.propertyIsEnumerable,X=L.splice,Y=J?J.toStringTag:void 0,Z=Object.getOwnPropertySymbols,tt=q?q.isBuffer:void 0,nt=(D=Object.keys,F=Object,function(t){return D(F(t))}),rt=Et(O,"DataView"),et=Et(O,"Map"),it=Et(O,"Promise"),ot=Et(O,"Set"),ut=Et(O,"WeakMap"),st=Et(Object,"create"),ct=kt(rt),at=kt(et),ft=kt(it),ht=kt(ot),lt=kt(ut),vt=J?J.prototype:void 0,dt=vt?vt.valueOf:void 0;function pt(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function bt(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function yt(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function gt(t){var n=-1,r=null==t?0:t.length;for(this.__data__=new yt;++n<r;)this.add(t[n])}function jt(t){var n=this.__data__=new bt(t);this.size=n.size}function mt(t,n){for(var r=t.length;r--;)if(St(t[r][0],n))return r;return-1}function wt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Y&&Y in Object(t)?function(t){var n=W.call(t,Y),r=t[Y];try{t[Y]=void 0;var e=!0}catch(t){}var i=G.call(t);return e&&(n?t[Y]=r:delete t[Y]),i}(t):function(t){return G.call(t)}(t)}function xt(t){return Lt(t)&&wt(t)==i}function _t(t,n,r,e,a){return t===n||(null==t||null==n||!Lt(t)&&!Lt(n)?t!=t&&n!=n:function(t,n,r,e,a,f){var d=Tt(t),g=Tt(n),w=d?o:Pt(t),x=g?o:Pt(n),_=(w=w==i?v:w)==v,B=(x=x==i?v:x)==v,I=w==x;if(I&&Mt(t)){if(!Mt(n))return!1;d=!0,_=!1}if(I&&!_)return f||(f=new jt),d||Vt(t)?Bt(t,n,r,e,a,f):function(t,n,r,e,i,o,a){switch(r){case m:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case j:return!(t.byteLength!=n.byteLength||!o(new K(t),new K(n)));case u:case s:case l:return St(+t,+n);case c:return t.name==n.name&&t.message==n.message;case p:case y:return t==n+"";case h:var f=T;case b:if(f||(f=M),t.size!=n.size&&!(1&e))return!1;var v=a.get(t);if(v)return v==n;e|=2,a.set(t,n);var d=Bt(f(t),f(n),e,i,o,a);return a.delete(t),d;case"[object Symbol]":if(dt)return dt.call(t)==dt.call(n)}return!1}(t,n,w,r,e,a,f);if(!(1&r)){var O=_&&W.call(t,"__wrapped__"),E=B&&W.call(n,"__wrapped__");if(O||E){var A=O?t.value():t,P=E?n.value():n;return f||(f=new jt),a(A,P,r,e,f)}}return!!I&&(f||(f=new jt),function(t,n,r,e,i,o){var u=1&r,s=It(t),c=s.length;if(c!=It(n).length&&!u)return!1;for(var a=c;a--;){var f=s[a];if(!(u?f in n:W.call(n,f)))return!1}var h=o.get(t);if(h&&o.get(n))return h==n;var l=!0;o.set(t,n),o.set(n,t);for(var v=u;++a<c;){var d=t[f=s[a]],p=n[f];if(e)var b=u?e(p,d,f,n,t,o):e(d,p,f,t,n,o);if(!(void 0===b?d===p||i(d,p,r,e,o):b)){l=!1;break}v||(v="constructor"==f)}if(l&&!v){var y=t.constructor,g=n.constructor;y==g||!("constructor"in t)||!("constructor"in n)||"function"==typeof y&&y instanceof y&&"function"==typeof g&&g instanceof g||(l=!1)}return o.delete(t),o.delete(n),l}(t,n,r,e,a,f))}(t,n,r,e,_t,a))}function Bt(t,n,r,e,i,o){var u=1&r,s=t.length,c=n.length;if(s!=c&&!(u&&c>s))return!1;var a=o.get(t);if(a&&o.get(n))return a==n;var f=-1,h=!0,l=2&r?new gt:void 0;for(o.set(t,n),o.set(n,t);++f<s;){var v=t[f],d=n[f];if(e)var p=u?e(d,v,f,n,t,o):e(v,d,f,t,n,o);if(void 0!==p){if(p)continue;h=!1;break}if(l){if(!C(n,(function(t,n){if(!l.has(n)&&(v===t||i(v,t,r,e,o)))return l.push(n)}))){h=!1;break}}else if(v!==d&&!i(v,d,r,e,o)){h=!1;break}}return o.delete(t),o.delete(n),h}function It(t){return function(t,n,r){var e=n(t);return Tt(t)?e:function(t,n){for(var r=-1,e=n.length,i=t.length;++r<e;)t[i+r]=n[r];return t}(e,r(t))}(t,Rt,At)}function Ot(t,n){var r,e,i=t.__data__;return("string"==(e=typeof(r=n))||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==r:null===r)?i["string"==typeof n?"string":"hash"]:i.map}function Et(t,n){var r=function(t,n){return null==t?void 0:t[n]}(t,n);return function(t){return!(!Ft(t)||function(t){return!!z&&z in t}(t))&&(Ut(t)?H:w).test(kt(t))}(r)?r:void 0}pt.prototype.clear=function(){this.__data__=st?st(null):{},this.size=0},pt.prototype.delete=function(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n},pt.prototype.get=function(t){var n=this.__data__;if(st){var e=n[t];return e===r?void 0:e}return W.call(n,t)?n[t]:void 0},pt.prototype.has=function(t){var n=this.__data__;return st?void 0!==n[t]:W.call(n,t)},pt.prototype.set=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=st&&void 0===n?r:n,this},bt.prototype.clear=function(){this.__data__=[],this.size=0},bt.prototype.delete=function(t){var n=this.__data__,r=mt(n,t);return!(r<0||(r==n.length-1?n.pop():X.call(n,r,1),--this.size,0))},bt.prototype.get=function(t){var n=this.__data__,r=mt(n,t);return r<0?void 0:n[r][1]},bt.prototype.has=function(t){return mt(this.__data__,t)>-1},bt.prototype.set=function(t,n){var r=this.__data__,e=mt(r,t);return e<0?(++this.size,r.push([t,n])):r[e][1]=n,this},yt.prototype.clear=function(){this.size=0,this.__data__={hash:new pt,map:new(et||bt),string:new pt}},yt.prototype.delete=function(t){var n=Ot(this,t).delete(t);return this.size-=n?1:0,n},yt.prototype.get=function(t){return Ot(this,t).get(t)},yt.prototype.has=function(t){return Ot(this,t).has(t)},yt.prototype.set=function(t,n){var r=Ot(this,t),e=r.size;return r.set(t,n),this.size+=r.size==e?0:1,this},gt.prototype.add=gt.prototype.push=function(t){return this.__data__.set(t,r),this},gt.prototype.has=function(t){return this.__data__.has(t)},jt.prototype.clear=function(){this.__data__=new bt,this.size=0},jt.prototype.delete=function(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r},jt.prototype.get=function(t){return this.__data__.get(t)},jt.prototype.has=function(t){return this.__data__.has(t)},jt.prototype.set=function(t,n){var r=this.__data__;if(r instanceof bt){var e=r.__data__;if(!et||e.length<199)return e.push([t,n]),this.size=++r.size,this;r=this.__data__=new yt(e)}return r.set(t,n),this.size=r.size,this};var At=Z?function(t){return null==t?[]:(t=Object(t),function(n){for(var r=-1,e=null==n?0:n.length,i=0,o=[];++r<e;){var u=n[r];Q.call(t,u)&&(o[i++]=u)}return o}(Z(t)))}:function(){return[]},Pt=wt;function $t(t,n){return!!(n=null==n?e:n)&&("number"==typeof t||x.test(t))&&t>-1&&t%1==0&&t<n}function kt(t){if(null!=t){try{return N.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function St(t,n){return t===n||t!=t&&n!=n}(rt&&Pt(new rt(new ArrayBuffer(1)))!=m||et&&Pt(new et)!=h||it&&Pt(it.resolve())!=d||ot&&Pt(new ot)!=b||ut&&Pt(new ut)!=g)&&(Pt=function(t){var n=wt(t),r=n==v?t.constructor:void 0,e=r?kt(r):"";if(e)switch(e){case ct:return m;case at:return h;case ft:return d;case ht:return b;case lt:return g}return n});var Ct=xt(function(){return arguments}())?xt:function(t){return Lt(t)&&W.call(t,"callee")&&!Q.call(t,"callee")},Tt=Array.isArray,Mt=tt||function(){return!1};function Ut(t){if(!Ft(t))return!1;var n=wt(t);return n==a||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}function Dt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}function Ft(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}function Lt(t){return null!=t&&"object"==typeof t}var Vt=S?function(t){return function(n){return t(n)}}(S):function(t){return Lt(t)&&Dt(t.length)&&!!_[wt(t)]};function Rt(t){return null!=(n=t)&&Dt(n.length)&&!Ut(n)?function(t,n){var r=Tt(t),e=!r&&Ct(t),i=!r&&!e&&Mt(t),o=!r&&!e&&!i&&Vt(t),u=r||e||i||o,s=u?function(t,n){for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);return e}(t.length,String):[],c=s.length;for(var a in t)!n&&!W.call(t,a)||u&&("length"==a||i&&("offset"==a||"parent"==a)||o&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||$t(a,c))||s.push(a);return s}(t):function(t){if((n=t)!==("function"==typeof(r=n&&n.constructor)&&r.prototype||V))return nt(t);var n,r,e=[];for(var i in Object(t))W.call(t,i)&&"constructor"!=i&&e.push(i);return e}(t);var n}t.exports=function(t,n){return _t(t,n)}}(h,h.exports);var l=new Uint8Array(16);function v(){if(!a&&!(a="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(l)}var d=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function p(t){return"string"==typeof t&&d.test(t)}for(var b=[],y=0;y<256;++y)b.push((y+256).toString(16).substr(1));function g(t,n,r){var e=(t=t||{}).random||(t.rng||v)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,n){r=r||0;for(var i=0;i<16;++i)n[r+i]=e[i];return n}return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(b[t[n+0]]+b[t[n+1]]+b[t[n+2]]+b[t[n+3]]+"-"+b[t[n+4]]+b[t[n+5]]+"-"+b[t[n+6]]+b[t[n+7]]+"-"+b[t[n+8]]+b[t[n+9]]+"-"+b[t[n+10]]+b[t[n+11]]+b[t[n+12]]+b[t[n+13]]+b[t[n+14]]+b[t[n+15]]).toLowerCase();if(!p(r))throw TypeError("Stringified UUID is invalid");return r}(e)}var j=Object.freeze({__proto__:null,create:function(){return g()},fromMsbLsb:function(t,n){function r(t,n){var r=BigInt(1)<<n*BigInt(4);return(r|t&r-BigInt(1)).toString(16).substring(1)}var e="string"==typeof t?BigInt(t):t,i="string"==typeof n?BigInt(n):n,o=r(e>>BigInt(32),BigInt(8)),u=r(e>>BigInt(16),BigInt(4)),s=r(e,BigInt(4)),c=r(i>>BigInt(48),BigInt(4)),a=r(i,BigInt(12));return"".concat(o,"-").concat(u,"-").concat(s,"-").concat(c,"-").concat(a)},toMsbLsb:function(t){var n=o(t.split("-"),5),r=n[0],e=n[1],i=n[2],u=n[3],s=n[4];if(null==r||null==e||null==i||null==u||null==s)throw new Error("Invalid UUID string ".concat(t));var c=BigInt.asIntN(64,BigInt("0x".concat(r+e+i))),a=BigInt.asIntN(64,BigInt("0x".concat(u+s)));return{msb:c.toString(),lsb:a.toString()}}});const m=class{constructor(n){t(this,n),this.content=void 0,this.disabled=void 0,this.placement="bottom",this.delay=500,this.animated=!0,this.open=!1,this.handlePointerEnter=this.handlePointerEnter.bind(this),this.handlePointerLeave=this.handlePointerLeave.bind(this),this.tooltipId=`vertex-tooltip-${j.create()}`}disconnectedCallback(){this.removeElement(),this.clearOpenTimeout()}render(){return n(r,null,n("div",{class:"target",ref:t=>{this.targetElement=t},onPointerEnter:this.handlePointerEnter,onPointerLeave:this.handlePointerLeave},n("slot",null)),n("div",{class:"content-hidden",ref:t=>{this.contentElement=t}},n("slot",{name:"content"})))}addElement(){var t;if(null!=this.targetElement){const n=this.createPopoverElement(this.targetElement),r=this.createContentElement();this.displayedSlottedContent=null!==(t=s(this.contentElement))&&void 0!==t?t:this.displayedSlottedContent,null!=this.content?r.innerText=this.content:null!=this.displayedSlottedContent&&r.appendChild(this.displayedSlottedContent),n.appendChild(r),this.hostElement.ownerDocument.body.appendChild(n)}}removeElement(){const t=this.hostElement.ownerDocument.getElementById(this.tooltipId);null!=t&&t.remove()}createPopoverElement(t){const n=this.hostElement.ownerDocument.createElement("vertex-popover");return n.id=this.tooltipId,n.setAttribute("class","vertex-tooltip-popover"),n.open=this.open,n.resizeBehavior="fixed",n.backdrop=!1,n.placement=this.placement,n.animated=this.animated,n.anchorBounds=t.getBoundingClientRect(),n}createContentElement(){const t=this.hostElement.ownerDocument.createElement("div");return t.setAttribute("class",u("vertex-tooltip-content",{hidden:!this.open||this.disabled})),t}handlePointerEnter(){null!=this.openTimeout||this.disabled||(this.openTimeout=setTimeout((()=>{this.open=!0,this.openTimeout=void 0,this.addElement()}),this.delay))}handlePointerLeave(){this.clearOpenTimeout(),this.removeElement(),this.open=!1}clearOpenTimeout(){null!=this.openTimeout&&(clearTimeout(this.openTimeout),this.openTimeout=void 0)}get hostElement(){return e(this)}};m.style=":host{--tooltip-width:auto;--tooltip-white-space:normal;display:flex}.popover{width:100%;height:100%}.target{display:flex;width:100%;height:100%}.content-hidden{display:none}.content-hidden{display:none}.tooltip{display:flex;justify-content:center;text-align:center;width:var(--tooltip-width);font-family:var(--vertex-ui-font-family);font-size:var(--vertex-ui-text-xxs);background-color:var(--vertex-ui-neutral-700);color:var(--vertex-ui-white);padding:0.25rem 0.5rem;border-radius:4px;pointer-events:none;white-space:var(--tooltip-white-space);user-select:none}.tooltip.hidden{display:none}";export{m as T}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,e as t,h as r,H as s,g as i}from"./p-6834631c.js";import{c as a}from"./p-fe062eb0.js";import{g as n}from"./p-1356f525.js";const o=()=>{if("undefined"!=typeof window)return window.getSelection()},l=e=>e instanceof Text,h=e=>"true"===(null==e?void 0:e.getAttribute("data-replaced")),c=e=>new Text(null!=e&&""!==e?e:" "),d=class{constructor(r){e(this,r),this.triggerCharacterPressed=t(this,"triggerCharacterPressed",7),this.valueChanged=t(this,"valueChanged",7),this.inputFocus=t(this,"inputFocus",7),this.inputBlur=t(this,"inputBlur",7),this.resultsEnterPressed=t(this,"resultsEnterPressed",7),this.handleKeyDown=e=>{if(!this.triggerCharacters.includes(e.key)&&this.triggerCharacter!==e.key||null!=this.triggerKey?this.restartTriggerInput():(this.triggerKey=e.key,this.updateCursorPosition(),this.triggerCharacterPressed.emit("")),"Backspace"===e.key){const e=o();e&&(null==e?void 0:e.rangeCount)>0&&e.getRangeAt(0).deleteContents()}this.valueChanged.emit()},this.handleKeyUp=e=>{"Backspace"===e.key&&this.updateTriggerState(this.getSelectionSubstring()),"Enter"===e.key&&this.clearTriggerState(),this.valueChanged.emit()},this.updateTriggerValue=e=>{var t,r,s,i,a;if(null!=this.triggerKey&&null!=this.triggerRange&&this.triggerRange.startContainer===this.triggerRange.endContainer){const n=this.triggerRange.startContainer;if(l(n)){const o=c(null===(t=n.textContent)||void 0===t?void 0:t.slice(0,this.triggerRange.startOffset-1)),l=c(null===(r=n.textContent)||void 0===r?void 0:r.slice(this.triggerRange.endOffset)),h=this.createReplacedElement(e);null===(s=n.parentElement)||void 0===s||s.insertBefore(o,n),null===(i=n.parentElement)||void 0===i||i.insertBefore(l,n.nextSibling),null===(a=n.parentElement)||void 0===a||a.insertBefore(h,l),n.remove(),this.moveCursorToNodeEnd(l,!0)}}},this.triggerText=()=>{var e,t;return null!=this.triggerKey&&null!=this.triggerRange&&this.triggerRange.startContainer===this.triggerRange.endContainer&&null!==(t=null===(e=this.triggerRange.startContainer.textContent)||void 0===e?void 0:e.slice(this.triggerRange.startOffset,this.triggerRange.endOffset))&&void 0!==t?t:""},this.restartTriggerInput=()=>{this.clearTriggerTimeout(),this.triggerTimeout=setTimeout((()=>{null!=this.triggerRange&&null!=this.triggerKey&&this.triggerCharacterPressed.emit(this.triggerText()),this.triggerTimeout=void 0}),this.debounce)},this.clearTriggerTimeout=()=>{null!=this.triggerTimeout&&(clearTimeout(this.triggerTimeout),this.triggerTimeout=void 0)},this.updateCursorPosition=()=>{var e;const t=o();if(null!=t&&t.rangeCount>0){const r=t.getRangeAt(0).getBoundingClientRect(),s=null===(e=this.contentEl)||void 0===e?void 0:e.getBoundingClientRect(),i=r.bottom||(null==s?void 0:s.bottom)||0,a=r.top||(null==s?void 0:s.top)||0;this.cursorPosition={x:r.left||(null==s?void 0:s.left)||0,y:this.placement.includes("top")?a:i}}},this.moveCursorToNodeEnd=(e,t=!1)=>{const r=o();if(null!=r){const s=document.createRange();s.selectNodeContents(e),s.collapse(t),r.removeAllRanges(),r.addRange(s)}},this.updateInputCursorPosition=e=>{if((e=>e instanceof HTMLElement)(e)){const t=h(e.parentElement)?e.parentElement:e;h(t)&&this.insertAdjacentTextNode(t)}},this.createReplacedElement=e=>{const t=this.hostEl.querySelector('template[slot="replaced"]');if(null!=t){const r=n(t);return r.bindings.bind(e),r.element.style.display="inline-block",r.element.contentEditable="false",r.element.setAttribute("data-replaced","true"),r.element}throw new Error("Replaced template not defined.")},this.handleSelectionChange=()=>{this.updateTriggerState(this.getSelectionSubstring())},this.getSelectionSubstring=()=>{var e;const t=o();if(null!=t&&t.rangeCount>0){const r=t.getRangeAt(0);if(this.updateTriggerRange(),null!=r&&r.startOffset===r.endOffset&&l(r.startContainer)&&null!=r.startContainer.textContent&&!h(r.startContainer.parentElement)&&(null===(e=this.contentEl)||void 0===e?void 0:e.contains(r.startContainer)))return r.startContainer.textContent.slice(this.lastIndexOfBreakCharacter(r.startContainer.textContent.slice(0,r.startOffset))+1,r.startOffset)}return""},this.insertAdjacentTextNode=e=>{e.insertAdjacentText("afterend",""),null!=e.nextSibling&&this.moveCursorToNodeEnd(e.nextSibling)},this.updateTriggerState=e=>{const t=(null!=this.triggerCharacter?[...this.triggerCharacters,this.triggerCharacter]:this.triggerCharacters).find((t=>e.includes(t)));null!=t?(this.restartTriggerInput(),this.triggerKey=t,this.updateTriggerRange(),null==this.cursorPosition&&this.updateCursorPosition(),this.open=!0):this.clearTriggerState()},this.updateTriggerRange=()=>{var e;const t=o();if(null!=t&&t.rangeCount>0){const r=t.getRangeAt(0);null!=this.triggerKey&&(this.triggerRange=null!==(e=this.triggerRange)&&void 0!==e?e:r.cloneRange(),this.triggerRange.setEnd(r.endContainer,r.endOffset))}},this.clearTriggerState=()=>{this.triggerKey=void 0,this.triggerRange=void 0,this.cursorPosition=void 0,this.open=!1,this.clearTriggerTimeout()},this.lastIndexOfBreakCharacter=e=>this.breakCharacters.reduce(((t,r)=>{const s=e.replace(String.fromCharCode(160)," ").lastIndexOf(r);return s>t?s:t}),-1),this.handleFocus=e=>{this.inputFocus.emit(e)},this.handleBlur=e=>{this.open=!1,this.inputBlur.emit(e)},this.handleInputPointerEvent=e=>{null!=e.target&&this.updateInputCursorPosition(e.target)},this.handleResultPointerDown=e=>{e.preventDefault()},this.variant="standard",this.resultItems=void 0,this.triggerCharacters=[],this.triggerCharacter=void 0,this.breakCharacters=[" "],this.debounce=100,this.placeholder=void 0,this.placement="bottom-start",this.cursorPosition=void 0,this.open=!1,this.triggerKey=void 0,this.triggerRange=void 0}componentWillLoad(){document.addEventListener("selectionchange",this.handleSelectionChange)}disconnectedCallback(){document.removeEventListener("selectionchange",this.handleSelectionChange)}async replaceTriggeredValue(e){this.updateTriggerValue(e),this.clearTriggerState(),this.valueChanged.emit()}async getEditableContent(){var e;return null===(e=this.contentEl)||void 0===e?void 0:e.childNodes}render(){var e;const t=a("wrapper",{standard:"standard"===this.variant,filled:"filled"===this.variant,underlined:"underlined"===this.variant,blank:"blank"===this.variant});return r(s,null,r("div",{class:t},r("span",{class:"content-input",ref:e=>this.contentEl=e,role:"textbox",contenteditable:"true","aria-multiline":"true","data-placeholder":this.placeholder,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onBlur:this.handleBlur,onFocus:this.handleFocus,onPointerDown:this.handleInputPointerEvent,onPointerUp:this.handleInputPointerEvent})),r("vertex-result-list",{position:this.cursorPosition,placement:this.placement,open:this.open&&null!=this.resultItems&&this.resultItems.length>0&&null!=this.cursorPosition,items:null!==(e=this.resultItems)&&void 0!==e?e:[],onPointerDown:this.handleResultPointerDown,onEnterPressed:e=>this.resultsEnterPressed.emit(e.detail)},r("slot",{name:"results"})),r("slot",{name:"replaced"}))}get hostEl(){return i(this)}};d.style=".wrapper.sc-vertex-search-bar{display:flex;align-items:center;width:100%;box-sizing:border-box;background:none;border:1px solid transparent;border-radius:4px;font-family:var(--vertex-ui-font-family);font-size:0.875rem;line-height:1.4}.test-mention.sc-vertex-search-bar{display:inline-block;color:blue}.hidden.sc-vertex-search-bar{visibility:hidden}.content-input.sc-vertex-search-bar{width:100%;box-sizing:border-box;padding:6px 0.5em 7px;border:1px solid transparent;background:none;font-family:var(--vertex-ui-font-family);font-weight:var(--vertex-ui-font-weight-base);font-size:0.875rem;line-height:1.4;white-space:pre-line}.textarea.sc-vertex-search-bar{overflow:hidden;outline:none;box-shadow:none;resize:none}.content-input.sc-vertex-search-bar:focus{outline:none}.standard.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-400);color:var(--vertex-ui-neutral-800)}.standard.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-500)}.standard.sc-vertex-search-bar:hover:not(.disabled),.standard.sc-vertex-search-bar:focus{border-color:var(--vertex-ui-neutral-500)}.standard.disabled.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-200)}.standard.disabled.sc-vertex-search-bar,.standard.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.blank.sc-vertex-search-bar{color:var(--vertex-ui-neutral-800)}.blank.sc-vertex-search-bar:not(:hover) .content-input.sc-vertex-search-bar:focus{border-color:var(--vertex-ui-neutral-400);border-radius:4px}.blank.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-500)}.blank.sc-vertex-search-bar:hover:not(.disabled) .content-input.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-400);border-radius:4px}.blank.disabled.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-200)}.blank.disabled.sc-vertex-search-bar,.blank.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.filled.sc-vertex-search-bar{background-color:var(--vertex-ui-neutral-200);border-color:var(--vertex-ui-neutral-200);color:var(--vertex-ui-neutral-800)}.filled.disabled.sc-vertex-search-bar,.filled.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.filled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-700)}.filled.sc-vertex-search-bar:hover:not(.disabled),.filled.sc-vertex-search-bar:focus{border-bottom-color:var(--vertex-ui-blue-600)}.filled.disabled.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-100)}.filled.disabled.sc-vertex-search-bar,.filled.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.underlined.sc-vertex-search-bar{background-color:var(--vertex-ui-white);border-color:var(--vertex-ui-white) var(--vertex-ui-white) var(--vertex-ui-neutral-400) var(--vertex-ui-white);color:var(--vertex-ui-neutral-800)}.underlined.disabled.sc-vertex-search-bar,.underlined.disabled.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.underlined.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-700)}.underlined.sc-vertex-search-bar:hover:not(.disabled),.underlined.sc-vertex-search-bar:focus{background-color:var(--vertex-ui-neutral-200);border-color:var(--vertex-ui-neutral-200);border-bottom-color:var(--vertex-ui-blue-600)}.underlined.disabled.sc-vertex-search-bar{border-bottom-color:var(--vertex-ui-neutral-200)}.underlined.disabled.sc-vertex-search-bar,.underlined.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.underlined.has-error.sc-vertex-search-bar{border-bottom-color:var(--vertex-ui-red-600)}";export{d as S}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,e as s,h as i,H as h,g as e}from"./p-6834631c.js";import{c as n}from"./p-fe062eb0.js";import{g as o}from"./p-1356f525.js";class l{constructor(t,s){this.container=t,this.elementFactory=s,this.instanceMap=new Map,this.elements=[]}swapHeadToTail(t){const s=this.elements.splice(0,t);return this.elements.splice(this.elements.length,0,...s),this.elements.concat()}swapTailToHead(t){const s=this.elements.splice(-t,t);return this.elements.splice(0,0,...s),this.elements.concat()}updateElements(t){const s=t-this.elements.length;if(s>0)for(let t=0;t<s;t++)this.createElement();else for(let t=0;t<-s;t++)this.deleteElement();return this.elements.concat()}updateData(t){this.elements.forEach(((s,i)=>{const h=this.instanceMap.get(s),e=t(i);null==h||h.bindings.bind(e)}))}updateElementFactory(t){this.elementFactory=t,this.updateElements(0)}iterateElements(t){this.elements.forEach(((s,i)=>{const h=this.instanceMap.get(s);if(null==h)throw new Error("Binding not found for element.");t(s,h.bindings,i)}))}createElement(){const t=this.elementFactory();return this.elements.push(t.element),this.instanceMap.set(t.element,t),this.container.append(t.element),t}deleteElement(){const t=this.elements.pop();null!=t&&(this.instanceMap.delete(t),t.remove())}}const r=(t,s,i)=>{null==t||t.scrollTo({top:null!=s&&null!=i?s*i:0})},a=class{constructor(i){t(this,i),this.enterPressed=s(this,"enterPressed",7),this.computeResultHeight=()=>{if(null==this.computedResultHeight){const t=this.hostEl.querySelector('*[slot="result"]');null!=t&&(this.resultHeight=t.clientHeight,this.computedResultHeight=t.clientHeight)}},this.ensureTemplateDefined=()=>{const t=this.hostEl.querySelector("template");if(null==t){const t=document.createElement("template");t.innerHTML='\n <div class="result">{{data.value}}</div>\n ',this.hostEl.appendChild(t),this.stateMap.resultTemplate=t}else this.stateMap.resultTemplate=t},this.createResultPool=()=>{this.stateMap.resultPool=new l(this.hostEl,(()=>this.createResultInstance()))},this.createResultInstance=()=>{if(null!=this.stateMap.resultTemplate){const t=o(this.stateMap.resultTemplate);return t.element.slot="result",t}throw new Error("Result template not defined.")},this.layoutResults=()=>{var t,s,i,h;const e=this.viewportEndIndex-this.viewportStartIndex+1,n=this.viewportStartIndex-this.lastStartIndex;this.lastStartIndex=this.viewportStartIndex,null===(t=this.stateMap.resultPool)||void 0===t||t.updateElements(e),n>0?null===(s=this.stateMap.resultPool)||void 0===s||s.swapHeadToTail(n):null===(i=this.stateMap.resultPool)||void 0===i||i.swapTailToHead(-n),null===(h=this.stateMap.resultPool)||void 0===h||h.iterateElements(((t,s,i)=>{const h=this.parsedResults[i+this.viewportStartIndex];null!=h&&(t.style.position="absolute",t.style.boxSizing="border-box",t.style.top=(this.viewportStartIndex+i)*this.resultHeight+"px",t.style.width="100%",t.setAttribute("is-focused",`${this.viewportStartIndex+i===this.lastFocusedIndex}`),s.bind(h))}))},this.handleScroll=t=>{this.scrollTop=t.target.scrollTop},this.handleKeyDown=t=>{this.open&&("ArrowUp"===t.key?(t.preventDefault(),this.lastFocusedIndex=Math.min(0,this.lastFocusedIndex-1),r(this.resultsScrollEl,this.lastFocusedIndex,this.resultHeight)):"ArrowDown"===t.key&&(t.preventDefault(),this.lastFocusedIndex=Math.min(this.lastFocusedIndex+1,this.items.length),r(this.resultsScrollEl,this.lastFocusedIndex,this.resultHeight)),"Enter"===t.key&&null!=this.lastFocusedIndex&&(t.preventDefault(),this.enterPressed.emit(this.items[this.lastFocusedIndex]),this.lastFocusedIndex=0,r(this.resultsScrollEl)))},this.items=[],this.itemsJson=void 0,this.viewportStartIndex=0,this.viewportEndIndex=0,this.resultHeight=32,this.overScanCount=25,this.placement="bottom-start",this.position=void 0,this.open=!1,this.listHeight=void 0,this.parsedResults=[],this.scrollTop=0,this.lastStartIndex=0,this.lastFocusedIndex=0,this.stateMap={}}handleResultsChanged(t){"string"==typeof t?this.parsedResults=JSON.parse(t):null!=t&&(this.parsedResults=t)}handleOpenChanged(){this.open||0===this.scrollTop||r(this.resultsScrollEl)}componentWillLoad(){var t;this.resizeObserver=new ResizeObserver((()=>{this.listHeight=void 0})),window.addEventListener("keydown",this.handleKeyDown),this.ensureTemplateDefined(),this.createResultPool(),this.handleResultsChanged(null!==(t=this.itemsJson)&&void 0!==t?t:this.items)}componentDidLoad(){this.resizeObserver.observe(this.hostEl)}componentWillRender(){this.computeViewportResults()}componentDidRender(){this.layoutResults(),this.computeResultHeight()}disconnectedCallback(){this.resizeObserver.disconnect(),window.removeEventListener("keydown",this.handleKeyDown)}render(){return i(h,null,i("div",{class:n("wrapper",{hidden:!this.open||null==this.computedResultHeight})},i("vertex-popover",{position:this.position,placement:this.placement,open:this.open,backdrop:!1},i("div",{class:"results-scroll",ref:t=>this.resultsScrollEl=t,onScroll:this.handleScroll},i("div",{class:"results",style:{height:this.parsedResults.length*this.resultHeight+"px"}},i("slot",null),i("slot",{name:"result"}))))))}computeViewportResults(){const t=this.getListHeight();if(null!=t&&this.resultHeight>0){const s=Math.ceil(t/this.resultHeight),i=Math.floor(this.scrollTop/this.resultHeight),h=i+s,e=Math.max(0,i-this.overScanCount),n=Math.min(this.parsedResults.length-1,h+this.overScanCount);this.viewportStartIndex=e,this.viewportEndIndex=n}}getListHeight(){return null==this.listHeight&&(this.listHeight=this.hostEl.clientHeight),this.listHeight}get hostEl(){return e(this)}static get watchers(){return{items:["handleResultsChanged"],open:["handleOpenChanged"]}}};a.style=":host{--max-height:300px;--width:500px;--box-shadow:0 2px 5px rgba(0, 0, 0, 0.5)}.hidden{visibility:hidden;position:fixed;pointer-events:none}.results{position:relative;height:100%}.results-scroll{overflow-y:auto;max-height:var(--max-height);width:var(--width);box-shadow:var(--box-shadow);background-color:white}";export{a as R}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,e as t,h as s,c as e,g as o}from"./p-6834631c.js";import{c as n}from"./p-fe062eb0.js";const r=class{constructor(s){i(this,s),this.optionChanged=t(this,"optionChanged",7),this.removeListeners=[],this.controlled=!1,this.value=void 0,this.placeholder="Select an option...",this.disabled=!1,this.animated=!0,this.open=!1,this.position=void 0,this.displayValue=void 0,this.resizeObserverFactory=i=>new ResizeObserver(i),this.handleOpen=this.handleOpen.bind(this),this.handleDismiss=this.handleDismiss.bind(this),this.getBounds=this.getBounds.bind(this)}componentDidLoad(){var i;this.resizeObserver=this.resizeObserverFactory((()=>this.getBounds())),null!=this.rootRef&&this.resizeObserver.observe(this.rootRef),this.slotElement=(null===(i=this.hostElement.shadowRoot)||void 0===i?void 0:i.querySelector("slot"))||void 0,null!=this.value&&this.handleUpdateValue(this.value)}connectedCallback(){window.addEventListener("resize",this.getBounds)}disconnectedCallback(){var i;null===(i=this.resizeObserver)||void 0===i||i.disconnect(),window.removeEventListener("resize",this.getBounds),this.removeOptionListeners()}handleUpdateValue(i){null!=i&&i!==this.internalValue&&(this.internalValue=i,this.updateDisplayValue(i)),this.controlled=null!=i}render(){return s("div",{class:n("root",{disabled:this.disabled}),ref:i=>{this.rootRef=i},onClick:this.open||this.disabled?void 0:this.handleOpen},s("div",{class:n("target",{hidden:this.open,disabled:this.disabled})},this.displayValue||this.placeholder,s("div",{class:"icon"},s("vertex-icon",{name:"chevron-down",size:"sm"}))),s("vertex-popover",{position:this.position,open:this.open,animated:this.animated,resizeBehavior:"fixed",onDismissed:this.handleDismiss},s("div",{class:n("options",{hidden:!this.open,visible:this.open,animated:this.animated}),style:{minWidth:null!=this.width?`${this.width}px`:"var(--select-width)"}},s("div",{class:n("selected-option",{disabled:this.disabled}),onClick:this.handleDismiss},this.displayValue||this.placeholder,s("div",{class:"icon"},s("vertex-icon",{name:"chevron-down",size:"sm"}))),s("slot",null))))}handleOpen(){var i,t;null===(t=null===(i=this.slotElement)||void 0===i?void 0:i.assignedElements)||void 0===t||t.call(i).forEach((i=>{const t=()=>{var t;const s=i.getAttribute("data-value")||i.innerHTML,e=s!==this.internalValue;this.handleDismiss(),this.controlled||(this.displayValue=i.innerHTML,this.internalValue=s),e&&(null===(t=this.optionChanged)||void 0===t||t.emit(s))};i.addEventListener("click",t),this.removeListeners=[...this.removeListeners,()=>i.removeEventListener("click",t)]})),this.open=!0}handleDismiss(){this.removeOptionListeners(),this.open=!1}updateDisplayValue(i){var t,s;const e=null===(s=null===(t=this.slotElement)||void 0===t?void 0:t.assignedElements)||void 0===s?void 0:s.call(t).find((t=>t.getAttribute("data-value")===i||t.innerHTML===i));this.displayValue=null==e?void 0:e.innerHTML}removeOptionListeners(){this.removeListeners.forEach((i=>i())),this.removeListeners=[]}getBounds(){null!=this.getBoundsTimeout&&(clearTimeout(this.getBoundsTimeout),this.getBoundsTimeout=void 0),this.getBoundsTimeout=setTimeout((()=>{this.getBoundsTimeout=void 0,e((()=>{var i;const t=null===(i=this.rootRef)||void 0===i?void 0:i.getBoundingClientRect();null!=t&&(this.position={x:t.x,y:t.y},this.width=t.width)}))}),200)}get hostElement(){return o(this)}static get watchers(){return{value:["handleUpdateValue"]}}};r.style=":host{--select-width:100%}.root{display:inline-block;color:var(--vertex-ui-neutral-700);width:var(--select-width);font-family:var(--vertex-ui-font-family);font-size:var(--vertex-ui-text-base);overflow:hidden;user-select:none}.root:not(.disabled):hover{color:var(--vertex-ui-neutral-800)}.root.disabled{color:var(--vertex-ui-neutral-400)}.target,.selected-option{background-color:var(--vertex-ui-neutral-200);width:100%;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;padding:0.375rem 0.75rem 0.375rem 0.75rem}.target.hidden{box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%),\n 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%)}.selected-option.disabled,.target.disabled{background-color:var(--vertex-ui-neutral-100);cursor:default}.target{border-radius:4px}.icon{padding-left:1rem;margin-left:auto}.options{position:relative;cursor:pointer;background-color:var(--vertex-ui-white);border-radius:4px;padding:0.25rem 0;top:-0.25rem;box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%),\n 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%)}.options.animated{transition:opacity 0.1s ease-in 0.05s;opacity:0}.options.hidden{background-color:transparent}.options.visible{opacity:1}.options>*,.options>slot::slotted(*){padding:0.375rem 0.75rem 0.375rem 0.75rem}.options.hidden>*,.options.hidden>slot::slotted(*){opacity:0}.options>slot::slotted(:hover){background-color:var(--vertex-ui-neutral-200)}vertex-popover{--transform-origin:top left;--open-animation-name:open-scale-y;--close-animation-name:close-scale-y}";export{r as S}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,e as n,h as e,H as i,g as o}from"./p-6834631c.js";import{c as r}from"./p-fe062eb0.js";const s=Math.min,a=Math.max,l=Math.round,c=Math.floor,u=t=>({x:t,y:t}),f={left:"right",right:"left",bottom:"top",top:"bottom"},h={start:"end",end:"start"};function d(t,n,e){return a(t,s(n,e))}function m(t,n){return"function"==typeof t?t(n):t}function p(t){return t.split("-")[0]}function v(t){return t.split("-")[1]}function y(t){return"x"===t?"y":"x"}function g(t){return"y"===t?"height":"width"}function w(t){return["top","bottom"].includes(p(t))?"y":"x"}function b(t){return y(w(t))}function x(t){return t.replace(/start|end/g,(t=>h[t]))}function A(t){return t.replace(/left|right|bottom|top/g,(t=>f[t]))}function k(t){const{x:n,y:e,width:i,height:o}=t;return{width:i,height:o,top:e,left:n,right:n+i,bottom:e+o,x:n,y:e}}function R(t,n,e){let{reference:i,floating:o}=t;const r=w(n),s=b(n),a=g(s),l=p(n),c="y"===r,u=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,h=i[a]/2-o[a]/2;let d;switch(l){case"top":d={x:u,y:i.y-o.height};break;case"bottom":d={x:u,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-o.width,y:f};break;default:d={x:i.x,y:i.y}}switch(v(n)){case"start":d[s]-=h*(e&&c?-1:1);break;case"end":d[s]+=h*(e&&c?-1:1)}return d}async function S(t,n){var e;void 0===n&&(n={});const{x:i,y:o,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=m(n,t),p=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(d),v=a[h?"floating"===f?"reference":"floating":f],y=k(await r.getClippingRect({element:null==(e=await(null==r.isElement?void 0:r.isElement(v)))||e?v:v.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),g="floating"===f?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),b=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},x=k(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:w,strategy:l}):g);return{top:(y.top-x.top+p.top)/b.y,bottom:(x.bottom-y.bottom+p.bottom)/b.y,left:(y.left-x.left+p.left)/b.x,right:(x.right-y.right+p.right)/b.x}}function P(t){return O(t)?(t.nodeName||"").toLowerCase():"#document"}function M(t){var n;return(null==t||null==(n=t.ownerDocument)?void 0:n.defaultView)||window}function C(t){var n;return null==(n=(O(t)?t.ownerDocument:t.document)||window.document)?void 0:n.documentElement}function O(t){return t instanceof Node||t instanceof M(t).Node}function T(t){return t instanceof Element||t instanceof M(t).Element}function z(t){return t instanceof HTMLElement||t instanceof M(t).HTMLElement}function D(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof M(t).ShadowRoot)}function F(t){const{overflow:n,overflowX:e,overflowY:i,display:o}=j(t);return/auto|scroll|overlay|hidden|clip/.test(n+i+e)&&!["inline","contents"].includes(o)}function B(t){return["table","td","th"].includes(P(t))}function E(t){const n=L(),e=j(t);return"none"!==e.transform||"none"!==e.perspective||!!e.containerType&&"normal"!==e.containerType||!n&&!!e.backdropFilter&&"none"!==e.backdropFilter||!n&&!!e.filter&&"none"!==e.filter||["transform","perspective","filter"].some((t=>(e.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(e.contain||"").includes(t)))}function L(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function $(t){return["html","body","#document"].includes(P(t))}function j(t){return M(t).getComputedStyle(t)}function X(t){return T(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Y(t){if("html"===P(t))return t;const n=t.assignedSlot||t.parentNode||D(t)&&t.host||C(t);return D(n)?n.host:n}function N(t){const n=Y(t);return $(n)?t.ownerDocument?t.ownerDocument.body:t.body:z(n)&&F(n)?n:N(n)}function I(t,n,e){var i;void 0===n&&(n=[]),void 0===e&&(e=!0);const o=N(t),r=o===(null==(i=t.ownerDocument)?void 0:i.body),s=M(o);return r?n.concat(s,s.visualViewport||[],F(o)?o:[],s.frameElement&&e?I(s.frameElement):[]):n.concat(o,I(o,[],e))}function V(t){const n=j(t);let e=parseFloat(n.width)||0,i=parseFloat(n.height)||0;const o=z(t),r=o?t.offsetWidth:e,s=o?t.offsetHeight:i,a=l(e)!==r||l(i)!==s;return a&&(e=r,i=s),{width:e,height:i,$:a}}function q(t){return T(t)?t:t.contextElement}function H(t){const n=q(t);if(!z(n))return u(1);const e=n.getBoundingClientRect(),{width:i,height:o,$:r}=V(n);let s=(r?l(e.width):e.width)/i,a=(r?l(e.height):e.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const U=u(0);function J(t){const n=M(t);return L()&&n.visualViewport?{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}:U}function W(t,n,e,i){void 0===n&&(n=!1),void 0===e&&(e=!1);const o=t.getBoundingClientRect(),r=q(t);let s=u(1);n&&(i?T(i)&&(s=H(i)):s=H(t));const a=function(t,n,e){return void 0===n&&(n=!1),!(!e||n&&e!==M(t))&&n}(r,e,i)?J(r):u(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,f=o.width/s.x,h=o.height/s.y;if(r){const t=M(r),n=i&&T(i)?M(i):i;let e=t,o=e.frameElement;for(;o&&i&&n!==e;){const t=H(o),n=o.getBoundingClientRect(),i=j(o),r=n.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,s=n.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,f*=t.x,h*=t.y,l+=r,c+=s,e=M(o),o=e.frameElement}}return k({width:f,height:h,x:l,y:c})}const _=[":popover-open",":modal"];function G(t){return _.some((n=>{try{return t.matches(n)}catch(t){return!1}}))}function K(t){return W(C(t)).left+X(t).scrollLeft}function Q(t,n,e){let i;if("viewport"===n)i=function(t,n){const e=M(t),i=C(t),o=e.visualViewport;let r=i.clientWidth,s=i.clientHeight,a=0,l=0;if(o){r=o.width,s=o.height;const t=L();(!t||t&&"fixed"===n)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:s,x:a,y:l}}(t,e);else if("document"===n)i=function(t){const n=C(t),e=X(t),i=t.ownerDocument.body,o=a(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),r=a(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight);let s=-e.scrollLeft+K(t);const l=-e.scrollTop;return"rtl"===j(i).direction&&(s+=a(n.clientWidth,i.clientWidth)-o),{width:o,height:r,x:s,y:l}}(C(t));else if(T(n))i=function(t,n){const e=W(t,!0,"fixed"===n),i=e.top+t.clientTop,o=e.left+t.clientLeft,r=z(t)?H(t):u(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:o*r.x,y:i*r.y}}(n,e);else{const e=J(t);i={...n,x:n.x-e.x,y:n.y-e.y}}return k(i)}function Z(t,n){const e=Y(t);return!(e===n||!T(e)||$(e))&&("fixed"===j(e).position||Z(e,n))}function tt(t,n,e){const i=z(n),o=C(n),r="fixed"===e,s=W(t,!0,r,n);let a={scrollLeft:0,scrollTop:0};const l=u(0);if(i||!i&&!r)if(("body"!==P(n)||F(o))&&(a=X(n)),i){const t=W(n,!0,r,n);l.x=t.x+n.clientLeft,l.y=t.y+n.clientTop}else o&&(l.x=K(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function nt(t){return"static"===j(t).position}function et(t,n){return z(t)&&"fixed"!==j(t).position?n?n(t):t.offsetParent:null}function it(t,n){const e=M(t);if(G(t))return e;if(!z(t)){let n=Y(t);for(;n&&!$(n);){if(T(n)&&!nt(n))return n;n=Y(n)}return e}let i=et(t,n);for(;i&&B(i)&&nt(i);)i=et(i,n);return i&&$(i)&&nt(i)&&!E(i)?e:i||function(t){let n=Y(t);for(;z(n)&&!$(n);){if(E(n))return n;n=Y(n)}return null}(t)||e}const ot={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:n,rect:e,offsetParent:i,strategy:o}=t;const r="fixed"===o,s=C(i),a=!!n&&G(n.floating);if(i===s||a&&r)return e;let l={scrollLeft:0,scrollTop:0},c=u(1);const f=u(0),h=z(i);if((h||!h&&!r)&&(("body"!==P(i)||F(s))&&(l=X(i)),z(i))){const t=W(i);c=H(i),f.x=t.x+i.clientLeft,f.y=t.y+i.clientTop}return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+f.x,y:e.y*c.y-l.scrollTop*c.y+f.y}},getDocumentElement:C,getClippingRect:function(t){let{element:n,boundary:e,rootBoundary:i,strategy:o}=t;const r=[..."clippingAncestors"===e?G(n)?[]:function(t,n){const e=n.get(t);if(e)return e;let i=I(t,[],!1).filter((t=>T(t)&&"body"!==P(t))),o=null;const r="fixed"===j(t).position;let s=r?Y(t):t;for(;T(s)&&!$(s);){const n=j(s),e=E(s);e||"fixed"!==n.position||(o=null),(r?!e&&!o:!e&&"static"===n.position&&o&&["absolute","fixed"].includes(o.position)||F(s)&&!e&&Z(t,s))?i=i.filter((t=>t!==s)):o=n,s=Y(s)}return n.set(t,i),i}(n,this._c):[].concat(e),i],l=r.reduce(((t,e)=>{const i=Q(n,e,o);return t.top=a(i.top,t.top),t.right=s(i.right,t.right),t.bottom=s(i.bottom,t.bottom),t.left=a(i.left,t.left),t}),Q(n,r[0],o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:it,getElementRects:async function(t){const n=this.getOffsetParent||it,e=this.getDimensions,i=await e(t.floating);return{reference:tt(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:n,height:e}=V(t);return{width:n,height:e}},getScale:H,isElement:T,isRTL:function(t){return"rtl"===j(t).direction}};const rt=S,st=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(n){const{x:e,y:i,placement:o}=n,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:t=>{let{x:n,y:e}=t;return{x:n,y:e}}},...l}=m(t,n),c={x:e,y:i},u=await S(n,l),f=w(p(o)),h=y(f);let v=c[h],g=c[f];r&&(v=d(v+u["y"===h?"top":"left"],v,v-u["y"===h?"bottom":"right"])),s&&(g=d(g+u["y"===f?"top":"left"],g,g-u["y"===f?"bottom":"right"]));const b=a.fn({...n,[h]:v,[f]:g});return{...b,data:{x:b.x-e,y:b.y-i}}}}},at=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(n){var e,i;const{placement:o,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=n,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:w=!0,...k}=m(t,n);if(null!=(e=r.arrow)&&e.alignmentOffset)return{};const R=p(o),P=p(a)===a,M=await(null==l.isRTL?void 0:l.isRTL(c.floating)),C=h||(P||!w?[A(a)]:function(t){const n=A(t);return[x(t),n,x(n)]}(a));h||"none"===y||C.push(...function(t,n,e,i){const o=v(t);let r=function(t,n,e){const i=["left","right"],o=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return e?n?o:i:n?i:o;case"left":case"right":return n?r:s;default:return[]}}(p(t),"start"===e,i);return o&&(r=r.map((t=>t+"-"+o)),n&&(r=r.concat(r.map(x)))),r}(a,w,y,M));const O=[a,...C],T=await S(n,k),z=[];let D=(null==(i=r.flip)?void 0:i.overflows)||[];if(u&&z.push(T[R]),f){const t=function(t,n,e){void 0===e&&(e=!1);const i=v(t),o=b(t),r=g(o);let s="x"===o?i===(e?"end":"start")?"right":"left":"start"===i?"bottom":"top";return n.reference[r]>n.floating[r]&&(s=A(s)),[s,A(s)]}(o,s,M);z.push(T[t[0]],T[t[1]])}if(D=[...D,{placement:o,overflows:z}],!z.every((t=>t<=0))){var F,B;const t=((null==(F=r.flip)?void 0:F.index)||0)+1,n=O[t];if(n)return{data:{index:t,overflows:D},reset:{placement:n}};let e=null==(B=D.filter((t=>t.overflows[0]<=0)).sort(((t,n)=>t.overflows[1]-n.overflows[1]))[0])?void 0:B.placement;if(!e)switch(d){case"bestFit":{var E;const t=null==(E=D.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,n)=>t+n),0)])).sort(((t,n)=>t[1]-n[1]))[0])?void 0:E[0];t&&(e=t);break}case"initialPlacement":e=a}if(o!==e)return{reset:{placement:e}}}return{}}}};function lt(t,n,e){return[(i=null!=t?t:4,void 0===i&&(i=0),{name:"offset",options:i,async fn(t){var n,e;const{x:o,y:r,placement:s,middlewareData:a}=t,l=await async function(t,n){const{placement:e,platform:i,elements:o}=t,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),s=p(e),a=v(e),l="y"===w(e),c=["left","top"].includes(s)?-1:1,u=r&&l?-1:1,f=m(n,t);let{mainAxis:h,crossAxis:d,alignmentAxis:y}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&"number"==typeof y&&(d="end"===a?-1*y:y),l?{x:d*u,y:h*c}:{x:h*c,y:d*u}}(t,i);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(e=a.arrow)&&e.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:s}}}}),null==n&&at(e),st(),null!=n&&ct(n)].filter((t=>"boolean"!=typeof t));var i}function ct(t){return{name:"boundaryContain",fn:async n=>{const e=await rt(n,t);return{x:n.x+(e.left>0?e.left:0)-(e.right>0?e.right:0),y:n.y+(e.top>0?e.top:0)-(e.bottom>0?e.bottom:0)}}}}const ut=class{constructor(e){t(this,e),this.dismissed=n(this,"dismissed",7),this.shouldUpdatePosition=!1,this.middleware=[],this.partialWindow=window,this.open=!1,this.placement="bottom-start",this.position=void 0,this.anchorBounds=void 0,this.backdrop=!0,this.animated=!1,this.anchorSelector=void 0,this.boundarySelector=void 0,this.resizeBehavior="dynamic",this.overflowBehavior=void 0,this.flipBehavior=void 0,this.offsetBehavior=void 0,this.updateOnResize=!1,this.opened=!1,this.computedPlacement=this.placement,this.updateListener=this.updateListener.bind(this),this.handlePositionUpdate=this.handlePositionUpdate.bind(this),this.handleResize=this.handleResize.bind(this),this.setWindow=this.setWindow.bind(this)}connectedCallback(){this.updatePosition(this.position)}componentDidUpdate(){this.shouldUpdatePosition&&(this.shouldUpdatePosition=!1,null!=this.updateDispose?this.handlePositionUpdate():this.updateListener())}componentDidLoad(){this.updateViewport(),this.handleMiddlewareChange(),this.updateListener(),"dynamic"===this.resizeBehavior&&window.addEventListener("resize",this.handleResize)}disconnectedCallback(){this.viewportWidth=void 0,this.viewportHeight=void 0,this.opened=!1,"dynamic"===this.resizeBehavior&&window.removeEventListener("resize",this.handleResize)}updatePosition(t){null!=t&&(this.anchorPosition="object"==typeof t?t:JSON.parse(t),this.shouldUpdatePosition=!0)}updatePlacement(){this.updatePosition(this.position)}updateOpened(t){t&&(this.opened=!0),this.updateListener()}updateAnimated(){this.opened=this.open}updateMiddleware(){this.handleMiddlewareChange()}setWindow(t){this.partialWindow=t}render(){var t,n;return e(i,null,this.open&&this.backdrop&&e("div",{class:"backdrop",onPointerDown:()=>{this.open=!1,this.dismissed.emit()}}),this.anchorPosition&&e("div",{ref:t=>this.anchorPointRef=t,class:"anchor",style:{left:`${(null===(t=this.anchorPosition)||void 0===t?void 0:t.x)||0}px`,top:`${(null===(n=this.anchorPosition)||void 0===n?void 0:n.y)||0}px`}}),e("slot",{name:"anchor"}),e("div",{ref:t=>this.wrapperRef=t,class:r("popper",{hidden:!this.open,open:this.open})},e("div",{class:r("content",{"hidden-animated":!this.open&&this.opened&&this.animated,"open-animated":this.open&&this.animated},this.getTransformClass()),onAnimationEnd:()=>{this.opened=this.open}},e("slot",null))))}updateListener(){var t,n,e,i;const o=null!==(n=null!==(t=this.getSlottedAnchorElement())&&void 0!==t?t:this.anchorPointRef)&&void 0!==n?n:this.getAnchorBoundsVirtualElement();this.open&&null!=o&&null!=this.wrapperRef?(null===(e=this.updateDispose)||void 0===e||e.call(this),this.updateDispose=function(t,n,e,i){void 0===i&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:f=!1}=i,h=q(t),d=o||r?[...h?I(h):[],...I(n)]:[];d.forEach((t=>{o&&t.addEventListener("scroll",e,{passive:!0}),r&&t.addEventListener("resize",e)}));const m=h&&u?function(t,n){let e,i=null;const o=C(t);function r(){var t;clearTimeout(e),null==(t=i)||t.disconnect(),i=null}return function l(u,f){void 0===u&&(u=!1),void 0===f&&(f=1),r();const{left:h,top:d,width:m,height:p}=t.getBoundingClientRect();if(u||n(),!m||!p)return;const v={rootMargin:-c(d)+"px "+-c(o.clientWidth-(h+m))+"px "+-c(o.clientHeight-(d+p))+"px "+-c(h)+"px",threshold:a(0,s(1,f))||1};let y=!0;function g(t){const n=t[0].intersectionRatio;if(n!==f){if(!y)return l();n?l(!1,n):e=setTimeout((()=>{l(!1,1e-7)}),1e3)}y=!1}try{i=new IntersectionObserver(g,{...v,root:o.ownerDocument})}catch(t){i=new IntersectionObserver(g,v)}i.observe(t)}(!0),r}(h,e):null;let p,v=-1,y=null;l&&(y=new ResizeObserver((t=>{let[i]=t;i&&i.target===h&&y&&(y.unobserve(n),cancelAnimationFrame(v),v=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(n)}))),e()})),h&&!f&&y.observe(h),y.observe(n));let g=f?W(t):null;return f&&function n(){const i=W(t);!g||i.x===g.x&&i.y===g.y&&i.width===g.width&&i.height===g.height||e(),g=i,p=requestAnimationFrame(n)}(),e(),()=>{var t;d.forEach((t=>{o&&t.removeEventListener("scroll",e),r&&t.removeEventListener("resize",e)})),null==m||m(),null==(t=y)||t.disconnect(),y=null,f&&cancelAnimationFrame(p)}}(o,this.wrapperRef,this.handlePositionUpdate),this.handlePositionUpdate()):null===(i=this.updateDispose)||void 0===i||i.call(this)}async handlePositionUpdate(){var t,n,e;const i=null!==(n=null!==(t=this.getSlottedAnchorElement())&&void 0!==t?t:this.anchorPointRef)&&void 0!==n?n:this.getAnchorBoundsVirtualElement();if(null!=i&&null!=this.wrapperRef){const t=await async function(t,n,e,i){return await((t,n,e)=>{const i=new Map,o={platform:ot,...e},r={...o.platform,_c:i};return(async(t,n,e)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=e,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(n));let c=await s.getElementRects({reference:t,floating:n,strategy:o}),{x:u,y:f}=R(c,i,l),h=i,d={},m=0;for(let e=0;e<a.length;e++){const{name:r,fn:p}=a[e],{x:v,y,data:g,reset:w}=await p({x:u,y:f,initialPlacement:i,placement:h,strategy:o,middlewareData:d,rects:c,platform:s,elements:{reference:t,floating:n}});u=null!=v?v:u,f=null!=y?y:f,d={...d,[r]:{...d[r],...g}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(h=w.placement),w.rects&&(c=!0===w.rects?await s.getElementRects({reference:t,floating:n,strategy:o}):w.rects),({x:u,y:f}=R(c,h,l))),e=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:d}})(t,n,{...o,platform:r})})(t,n,{placement:e,middleware:i,strategy:"fixed"})}(i,this.wrapperRef,this.placement,this.middleware);this.computedPlacement=t.placement,null===(e=this.wrapperRef)||void 0===e||e.setAttribute("style",`left: ${t.x}px; top: ${t.y}px;`)}}handleMiddlewareChange(){var t,n,e;const i=null!=(null!==(t=this.getSlottedAnchorElement())&&void 0!==t?t:this.getAnchorBoundsVirtualElement())?4:0,o=null!=this.boundarySelector&&null!==(n=document.querySelector(this.boundarySelector))&&void 0!==n?n:void 0;this.middleware=lt(null!==(e=this.offsetBehavior)&&void 0!==e?e:i,null!=o?Object.assign({boundary:o},this.overflowBehavior):this.overflowBehavior,this.flipBehavior),this.updateListener()}getSlottedAnchorElement(){var t,n,e;if(null!=this.anchorSelector)return(null===(t=this.hostElement.shadowRoot)||void 0===t?void 0:t.querySelector(this.anchorSelector))||this.hostElement.querySelector(this.anchorSelector)||void 0;{const t=(null===(n=this.hostElement.shadowRoot)||void 0===n?void 0:n.querySelector('slot[name="anchor"]'))||void 0;if(null===(e=null==t?void 0:t.assignedElements)||void 0===e?void 0:e.call(t).length)return null==t?void 0:t.assignedElements()[0]}}getAnchorBoundsVirtualElement(){if(null!=this.anchorBounds)return{getBoundingClientRect:()=>DOMRect.fromRect(this.anchorBounds)}}handleResize(){null!=this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.open&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=void 0,null!=this.anchorPosition&&null!=this.viewportWidth&&null!=this.viewportHeight&&(this.position={x:this.partialWindow.innerWidth*(this.anchorPosition.x/this.viewportWidth),y:this.partialWindow.innerHeight*(this.anchorPosition.y/this.viewportHeight)}),this.updateViewport()}),200))}updateViewport(){this.viewportWidth=this.partialWindow.innerWidth,this.viewportHeight=this.partialWindow.innerHeight}getTransformClass(){if(this.animated)switch(this.computedPlacement){case"top":return"center-bottom";case"top-start":case"right-end":return"left-bottom";case"top-end":case"left-end":return"right-bottom";case"bottom":return"center-top";case"bottom-start":case"right-start":return"left-top";case"bottom-end":case"left-start":return"right-top";case"right":return"left-center";case"left":return"right-center"}}get hostElement(){return o(this)}static get watchers(){return{position:["updatePosition"],placement:["updatePlacement"],open:["updateOpened"],animated:["updateAnimated"],boundarySelector:["updateMiddleware"],overflowBehavior:["updateMiddleware"],flipBehavior:["updateMiddleware"],offsetBehavior:["updateMiddleware"]}}};ut.style=":host{--open-animation-name:open-scale-all;--open-animation:var(--open-animation-name) 0.1s ease-out 1;--close-animation-name:close-scale-all;--close-animation:var(--close-animation-name) 0.2s ease-in-out 1;--transform-origin:var(--none)}.open-animated{animation:var(--open-animation)}.hidden-animated{animation:var(--close-animation)}.hidden>.content{opacity:0;width:0;height:0;visibility:hidden}.hidden{pointer-events:none}.open{z-index:var(--vertex-ui-context-menu-layer)}.anchor{position:fixed}.backdrop{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:var(--backdrop-color, white);opacity:var(--backdrop-opacity, 0);z-index:var(--vertex-ui-context-menu-layer)}.popper{position:fixed}.center-bottom{transform-origin:var(--transform-origin, center bottom)}.left-bottom{transform-origin:var(--transform-origin, left bottom)}.right-bottom{transform-origin:var(--transform-origin, right bottom)}.center-top{transform-origin:var(--transform-origin, center top)}.left-top{transform-origin:var(--transform-origin, left top)}.right-top{transform-origin:var(--transform-origin, right top)}.left-center{transform-origin:var(--transform-origin, left center)}.left-top{transform-origin:var(--transform-origin, left top)}.left-bottom{transform-origin:var(--transform-origin, left bottom)}.right-center{transform-origin:var(--transform-origin, right center)}.right-top{transform-origin:var(--transform-origin, right top)}.right-bottom{transform-origin:var(--transform-origin, right bottom)}@keyframes open-fade-in{from{opacity:0}to{opacity:1}}@keyframes close-fade-out{from{visibility:visible;height:auto;width:auto;opacity:1}to{opacity:0;height:auto;width:auto}}@keyframes open-scale-all{from{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes close-scale-all{from{visibility:visible;height:auto;width:auto;opacity:1;transform:scale(1)}to{opacity:0;height:auto;width:auto;transform:scale(0)}}@keyframes open-scale-y{from{opacity:0;transform:scaleY(0)}to{opacity:1;transform:scaleY(1)}}@keyframes close-scale-y{from{visibility:visible;height:auto;width:auto;opacity:1;transform:scaleY(1)}to{opacity:0;height:auto;width:auto;transform:scaleY(0)}}@keyframes open-scale-x{from{opacity:0;transform:scaleX(0)}to{opacity:1;transform:scaleX(1)}}@keyframes close-scale-x{from{visibility:visible;height:auto;width:auto;opacity:1;transform:scaleX(1)}to{opacity:0;height:auto;width:auto;transform:scaleX(0)}}";export{ut as P}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{S as vertex_search_bar}from"./p-4224c2ad.js";import"./p-6834631c.js";import"./p-fe062eb0.js";import"./p-1356f525.js";import"./p-59032668.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,e as s,h as i,g as h}from"./p-6834631c.js";import{c as e}from"./p-fe062eb0.js";const l=class{constructor(i){t(this,i),this.inputFocus=s(this,"inputFocus",7),this.inputBlur=s(this,"inputBlur",7),this.inputInput=s(this,"inputInput",7),this.inputChange=s(this,"inputChange",7),this.textFieldKeyDown=s(this,"textFieldKeyDown",7),this.inputAutofill=s(this,"inputAutofill",7),this.handleFocus=t=>{this.inputFocus.emit(t)},this.handleBlur=t=>{this.inputBlur.emit(t)},this.handleKeyDown=t=>{"Enter"===t.key&&null!=this.nearbyForm?this.nearbyForm.dispatchEvent(new CustomEvent("submit",{bubbles:!0,cancelable:!0})):this.textFieldKeyDown.emit(t)},this.handleChanged=()=>{this.inputChange.emit({value:this.nativeInput.value})},this.handleInput=()=>{this.inputInput.emit({value:this.nativeInput.value})},this.type="text",this.name=void 0,this.variant="standard",this.fontSize="standard",this.multiline=!1,this.minRows=1,this.maxRows=void 0,this.placeholder=void 0,this.autoFocus=void 0,this.autoComplete=void 0,this.autoCorrect=void 0,this.value="",this.disabled=void 0,this.hasError=void 0}componentDidLoad(){var t;this.autoFocus&&(null===(t=this.nativeInput)||void 0===t||t.focus())}async updateInput(t){null!=this.nativeInput&&(this.nativeInput.value=t)}async blurInput(){var t;null===(t=this.nativeInput)||void 0===t||t.blur()}async getInputValue(){return this.nativeInput.value}async selectAll(){this.nativeInput.select()}render(){var t;const s=e("txt-wrapper",{"txt-standard":"standard"===this.variant,"txt-filled":"filled"===this.variant,"txt-underlined":"underlined"===this.variant,"txt-blank":"blank"===this.variant,"txt-size-standard":"standard"===this.fontSize,"txt-size-sm":"sm"===this.fontSize,"txt-size-md":"md"===this.fontSize,"txt-size-lg":"lg"===this.fontSize,"txt-size-xl":"xl"===this.fontSize,"txt-size-xxl":"xxl"===this.fontSize,disabled:this.disabled,"has-error":this.hasError}),h={class:"txt","data-testid":"text-field",name:this.name,ref:t=>{null!=t&&(this.nativeInput=t)},autoComplete:this.autoComplete,autoFocus:this.autoFocus,disabled:this.disabled,placeholder:this.placeholder,value:this.value||"",onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onInput:this.handleInput,onChange:this.handleChanged,onAnimationStart:t=>{["onAutoFillStart","onAutoFillCancel"].includes(t.animationName)&&this.inputAutofill.emit({value:this.nativeInput.value})}};return i("div",{class:s},i("div",{class:"txt-slot"},i("slot",{name:"left"})),this.multiline?i("vertex-auto-resize-textarea",{maxRows:this.maxRows,minRows:this.minRows,initialValue:(null===(t=this.value)||void 0===t?void 0:t.toString())||""},i("textarea",Object.assign({},h,{class:e(h.class,"txt-textarea",s),rows:this.minRows}))):i("input",Object.assign({},h,{type:this.type})),i("div",{class:"txt-slot"},i("slot",{name:"right"})))}connectedCallback(){null!=this.hostElement&&(this.nearbyForm=this.hostElement.closest("form"))}get hostElement(){return h(this)}};export{l as T}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{T as vertex_tooltip}from"./p-2bb3b235.js";import"./p-6834631c.js";import"./p-59032668.js";import"./p-fe062eb0.js";import"./p-b2c7b113.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{P as vertex_popover}from"./p-6505cdb3.js";import"./p-6834631c.js";import"./p-fe062eb0.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{S as vertex_select}from"./p-552c128f.js";import"./p-6834631c.js";import"./p-fe062eb0.js";
|