@vertexvis/ui 0.1.0-testing.4 → 0.1.0-testing.5
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-a321b3e1.js +353 -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 +352 -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-912f6e24.js +1 -0
- package/dist/components/p-92930f2a.js +1 -0
- package/dist/components/p-c2706288.js +1 -0
- package/dist/components/p-c4518377.entry.js +1 -0
- package/dist/components/p-ee496965.entry.js +1 -0
- package/dist/components/p-f064f911.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-6fad2f2e.js +351 -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 +2 -2
- 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
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { r as registerInstance, e as createEvent, h, H as Host, g as getElement } from './index-72f28b71.js';
|
|
2
|
+
import { c as classnames } from './index-9c609209.js';
|
|
3
|
+
import { g as generateInstanceFromTemplate } from './templates-797420bf.js';
|
|
4
|
+
|
|
5
|
+
const getWindowSelection = () => {
|
|
6
|
+
if (typeof window !== 'undefined') {
|
|
7
|
+
return window.getSelection();
|
|
8
|
+
}
|
|
9
|
+
return undefined;
|
|
10
|
+
};
|
|
11
|
+
const createDocumentRange = () => {
|
|
12
|
+
return document.createRange();
|
|
13
|
+
};
|
|
14
|
+
const createTextNode = (text) => {
|
|
15
|
+
return new Text(text != null && text !== '' ? text : ' ');
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const createResultUrn = (result) => {
|
|
19
|
+
return `${result.type}:${result.id}`;
|
|
20
|
+
};
|
|
21
|
+
const createSearchResultReplacement = (result, before, after) => {
|
|
22
|
+
const urn = createResultUrn(result);
|
|
23
|
+
return {
|
|
24
|
+
before: createTextNode(before),
|
|
25
|
+
beforeSpace: createTextNode(createHairSpace()),
|
|
26
|
+
result: createTextNode(urn),
|
|
27
|
+
afterSpace: after != null ? createTextNode(createNoBreakSpace()) : undefined,
|
|
28
|
+
after: after != null ? createTextNode(after) : undefined,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const getNodesForSearchResultReplacement = (replacement) => {
|
|
32
|
+
const keys = Object.keys(replacement);
|
|
33
|
+
return keys
|
|
34
|
+
.map((key) => replacement[key])
|
|
35
|
+
.filter((node) => node != null);
|
|
36
|
+
};
|
|
37
|
+
const trimNonstandardSpaces = (text) => {
|
|
38
|
+
return text.replace(/[\u200A]/g, '').replace(/[\u00A0]/g, ' ');
|
|
39
|
+
};
|
|
40
|
+
const createHairSpace = () => {
|
|
41
|
+
return String.fromCharCode(8202);
|
|
42
|
+
};
|
|
43
|
+
const createNoBreakSpace = () => {
|
|
44
|
+
return String.fromCharCode(160);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const searchBarCss = ".wrapper.sc-vertex-search-bar{display:flex;border:1px solid var(--vertex-ui-neutral-600);border-radius:0.5rem}.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}.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)}";
|
|
48
|
+
|
|
49
|
+
const SearchBar = class {
|
|
50
|
+
constructor(hostRef) {
|
|
51
|
+
registerInstance(this, hostRef);
|
|
52
|
+
this.searchChanged = createEvent(this, "searchChanged", 7);
|
|
53
|
+
this.inputChanged = createEvent(this, "inputChanged", 7);
|
|
54
|
+
this.resultReplaced = createEvent(this, "resultReplaced", 7);
|
|
55
|
+
this.inputFocus = createEvent(this, "inputFocus", 7);
|
|
56
|
+
this.inputBlur = createEvent(this, "inputBlur", 7);
|
|
57
|
+
this.rawElements = [];
|
|
58
|
+
this.isIdenticalElement = (child, other) => {
|
|
59
|
+
return (child === this.triggeredElement ||
|
|
60
|
+
this.getTextContent(child) === this.getTextContent(other));
|
|
61
|
+
};
|
|
62
|
+
this.getTextContent = (node) => {
|
|
63
|
+
var _a;
|
|
64
|
+
if (node instanceof HTMLElement) {
|
|
65
|
+
return node.innerText;
|
|
66
|
+
}
|
|
67
|
+
return (_a = node.textContent) !== null && _a !== void 0 ? _a : '';
|
|
68
|
+
};
|
|
69
|
+
this.handleCursorPositionUpdate = () => {
|
|
70
|
+
var _a, _b, _c;
|
|
71
|
+
const windowRange = (_a = getWindowSelection()) === null || _a === void 0 ? void 0 : _a.getRangeAt(0);
|
|
72
|
+
if (windowRange != null) {
|
|
73
|
+
if (!this.hasTriggered) {
|
|
74
|
+
const triggerText = this.readTriggerValue((_b = windowRange.commonAncestorContainer.textContent) !== null && _b !== void 0 ? _b : '', windowRange.startOffset);
|
|
75
|
+
if (triggerText != null) {
|
|
76
|
+
this.hasTriggered = true;
|
|
77
|
+
this.triggeredRange = windowRange;
|
|
78
|
+
this.triggeredElement = windowRange.commonAncestorContainer;
|
|
79
|
+
this.searchChanged.emit(triggerText.replace(this.triggerCharacter, ''));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else if (this.hasTriggered) {
|
|
83
|
+
const triggerText = this.readTriggerValue((_c = windowRange.commonAncestorContainer.textContent) !== null && _c !== void 0 ? _c : '', windowRange.startOffset);
|
|
84
|
+
if (triggerText != null) {
|
|
85
|
+
this.triggeredRange = windowRange;
|
|
86
|
+
this.triggeredElement = windowRange.commonAncestorContainer;
|
|
87
|
+
this.searchChanged.emit(triggerText.replace(this.triggerCharacter, ''));
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
this.hasTriggered = false;
|
|
91
|
+
this.triggeredRange = undefined;
|
|
92
|
+
this.triggeredElement = undefined;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
this.cursorPosition = this.getCursorPosition();
|
|
97
|
+
};
|
|
98
|
+
this.readTriggerValue = (value, fromIndex) => {
|
|
99
|
+
const adjustedValue = value.replace(String.fromCharCode(160), ' ');
|
|
100
|
+
const beforeSubstr = adjustedValue.substring(0, fromIndex);
|
|
101
|
+
const afterSubstr = adjustedValue.substring(fromIndex);
|
|
102
|
+
const adjustedBeforeSubstr = beforeSubstr.includes(this.triggerCharacter)
|
|
103
|
+
? beforeSubstr.substring(beforeSubstr.lastIndexOf(this.triggerCharacter))
|
|
104
|
+
: '';
|
|
105
|
+
const adjustedAfterSubstr = afterSubstr.substring(0, this.firstIndexOfBreakCharacter(afterSubstr));
|
|
106
|
+
const result = `${adjustedBeforeSubstr}${adjustedAfterSubstr}`;
|
|
107
|
+
return result.includes(this.triggerCharacter) &&
|
|
108
|
+
!this.includesBreakCharacter(result)
|
|
109
|
+
? result
|
|
110
|
+
: undefined;
|
|
111
|
+
};
|
|
112
|
+
this.includesBreakCharacter = (value) => {
|
|
113
|
+
return this.breakCharacters.some((bc) => value.includes(bc));
|
|
114
|
+
};
|
|
115
|
+
this.firstIndexOfBreakCharacter = (value) => {
|
|
116
|
+
const indices = this.breakCharacters
|
|
117
|
+
.map((bc) => value.indexOf(bc))
|
|
118
|
+
.filter((i) => i >= 0);
|
|
119
|
+
return indices.length > 0 ? Math.min(...indices) : value.length;
|
|
120
|
+
};
|
|
121
|
+
this.moveCursorToNodeEnd = (node, collapseToStart = false) => {
|
|
122
|
+
const selection = getWindowSelection();
|
|
123
|
+
if (selection != null) {
|
|
124
|
+
const range = createDocumentRange();
|
|
125
|
+
range.selectNodeContents(node);
|
|
126
|
+
range.collapse(collapseToStart);
|
|
127
|
+
selection.removeAllRanges();
|
|
128
|
+
selection.addRange(range);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
this.getContentAsString = () => {
|
|
132
|
+
if (this.contentEl != null) {
|
|
133
|
+
return trimNonstandardSpaces(Array.from(this.contentEl.childNodes).reduce((res, n) => {
|
|
134
|
+
var _a;
|
|
135
|
+
if (n instanceof HTMLElement &&
|
|
136
|
+
n.getAttribute('data-replaced') === 'true') {
|
|
137
|
+
return `${res}${n.getAttribute('data-original')}`;
|
|
138
|
+
}
|
|
139
|
+
else if (n instanceof HTMLElement) {
|
|
140
|
+
return `${res}${n.innerText}`;
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
return `${res}${(_a = n.textContent) !== null && _a !== void 0 ? _a : ''}`;
|
|
144
|
+
}
|
|
145
|
+
}, ''));
|
|
146
|
+
}
|
|
147
|
+
return '';
|
|
148
|
+
};
|
|
149
|
+
this.createReplacedElement = (original, data) => {
|
|
150
|
+
const template = this.hostEl.querySelector('template[slot="replaced"]');
|
|
151
|
+
if (template != null) {
|
|
152
|
+
const instance = generateInstanceFromTemplate(template);
|
|
153
|
+
instance.bindings.bind(data);
|
|
154
|
+
instance.element.id = data.id;
|
|
155
|
+
instance.element.style.display = 'inline-block';
|
|
156
|
+
instance.element.contentEditable = 'false';
|
|
157
|
+
instance.element.tabIndex = -1;
|
|
158
|
+
instance.element.setAttribute('data-replaced', 'true');
|
|
159
|
+
instance.element.setAttribute('data-original', original);
|
|
160
|
+
return instance.element;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
throw new Error('Replaced template not defined.');
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
this.variant = 'standard';
|
|
167
|
+
this.disabled = false;
|
|
168
|
+
this.triggerCharacter = '@';
|
|
169
|
+
this.breakCharacters = [' ', '\n'];
|
|
170
|
+
this.resultItems = undefined;
|
|
171
|
+
this.placement = 'bottom-start';
|
|
172
|
+
this.value = undefined;
|
|
173
|
+
this.placeholder = undefined;
|
|
174
|
+
this.replacements = [];
|
|
175
|
+
this.cursorPosition = { x: 0, y: 0 };
|
|
176
|
+
this.displayedElements = [];
|
|
177
|
+
this.hasTriggered = false;
|
|
178
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
179
|
+
this.handleKeyUp = this.handleKeyUp.bind(this);
|
|
180
|
+
this.handleResultClick = this.handleResultClick.bind(this);
|
|
181
|
+
this.handleClick = this.handleClick.bind(this);
|
|
182
|
+
this.handleWindowClick = this.handleWindowClick.bind(this);
|
|
183
|
+
this.handleInput = this.handleInput.bind(this);
|
|
184
|
+
this.handleBlur = this.handleBlur.bind(this);
|
|
185
|
+
this.handleFocus = this.handleFocus.bind(this);
|
|
186
|
+
this.handleCursorPositionUpdate =
|
|
187
|
+
this.handleCursorPositionUpdate.bind(this);
|
|
188
|
+
this.updateContent = this.updateContent.bind(this);
|
|
189
|
+
this.replaceContent = this.replaceContent.bind(this);
|
|
190
|
+
}
|
|
191
|
+
componentDidLoad() {
|
|
192
|
+
this.replaceContent(this.value);
|
|
193
|
+
}
|
|
194
|
+
connectedCallback() {
|
|
195
|
+
window.addEventListener('click', this.handleWindowClick);
|
|
196
|
+
}
|
|
197
|
+
disconnectedCallback() {
|
|
198
|
+
window.removeEventListener('click', this.handleWindowClick);
|
|
199
|
+
}
|
|
200
|
+
replaceContent(newValue, oldValue) {
|
|
201
|
+
if (newValue != null && newValue !== oldValue) {
|
|
202
|
+
const matches = newValue.match(/[a-z]*:[0-9a-z-]{36}/g);
|
|
203
|
+
const replacementsMap = this.replacements.reduce((map, r) => (Object.assign(Object.assign({}, map), { [createResultUrn(r)]: r })), {});
|
|
204
|
+
let nextSubstr = newValue;
|
|
205
|
+
const parts = matches != null
|
|
206
|
+
? matches === null || matches === void 0 ? void 0 : matches.reduce((res, m) => {
|
|
207
|
+
if (replacementsMap[m] != null) {
|
|
208
|
+
const urn = createResultUrn(replacementsMap[m]);
|
|
209
|
+
const index = nextSubstr.indexOf(urn);
|
|
210
|
+
const before = nextSubstr.substring(0, index);
|
|
211
|
+
const after = nextSubstr.substring(index + urn.length);
|
|
212
|
+
const replacement = createSearchResultReplacement(replacementsMap[m], before);
|
|
213
|
+
nextSubstr = after;
|
|
214
|
+
return [
|
|
215
|
+
...res,
|
|
216
|
+
replacement.before,
|
|
217
|
+
replacement.beforeSpace,
|
|
218
|
+
replacement.result,
|
|
219
|
+
];
|
|
220
|
+
}
|
|
221
|
+
return res;
|
|
222
|
+
}, [])
|
|
223
|
+
: [];
|
|
224
|
+
this.rawElements = [...parts, createTextNode(nextSubstr)];
|
|
225
|
+
this.updateContent();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
updateContent() {
|
|
229
|
+
if (this.contentEl != null) {
|
|
230
|
+
this.contentEl.innerHTML = '';
|
|
231
|
+
this.displayedElements = this.rawElements.map((el) => {
|
|
232
|
+
const raw = el instanceof HTMLElement ? el.innerText : el.textContent;
|
|
233
|
+
const replacement = this.replacements.find((r) => raw === null || raw === void 0 ? void 0 : raw.includes(r.id));
|
|
234
|
+
if (raw != null && replacement != null) {
|
|
235
|
+
const replacementElement = this.createReplacedElement(raw, replacement);
|
|
236
|
+
return replacementElement;
|
|
237
|
+
}
|
|
238
|
+
return el;
|
|
239
|
+
});
|
|
240
|
+
this.displayedElements.forEach((el) => {
|
|
241
|
+
var _a;
|
|
242
|
+
(_a = this.contentEl) === null || _a === void 0 ? void 0 : _a.appendChild(typeof el === 'string' ? createTextNode(el) : el);
|
|
243
|
+
});
|
|
244
|
+
if (this.lastReplacedSpace != null) {
|
|
245
|
+
this.moveCursorToNodeEnd(this.lastReplacedSpace);
|
|
246
|
+
}
|
|
247
|
+
this.inputChanged.emit(this.getContentAsString());
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
render() {
|
|
251
|
+
var _a;
|
|
252
|
+
const classes = classnames('wrapper', {
|
|
253
|
+
standard: this.variant === 'standard',
|
|
254
|
+
filled: this.variant === 'filled',
|
|
255
|
+
underlined: this.variant === 'underlined',
|
|
256
|
+
blank: this.variant === 'blank',
|
|
257
|
+
disabled: this.disabled,
|
|
258
|
+
});
|
|
259
|
+
return (h(Host, null, h("div", { class: classes }, h("span", { class: "content-input", role: "textbox", contentEditable: "true", "aria-multiline": "true", "data-placeholder": this.placeholder, ref: (el) => (this.contentEl = el), onKeyDown: this.handleKeyDown, onKeyUp: this.handleCursorPositionUpdate, onClick: this.handleCursorPositionUpdate, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur })), h("vertex-result-list", { position: this.cursorPosition, placement: this.placement, open: this.hasTriggered &&
|
|
260
|
+
this.resultItems != null &&
|
|
261
|
+
this.resultItems.length > 0, items: (_a = this.resultItems) !== null && _a !== void 0 ? _a : [], onEnterPressed: this.handleResultClick, onResultClick: this.handleResultClick }, h("slot", { name: "results" })), h("slot", { name: "replaced" })));
|
|
262
|
+
}
|
|
263
|
+
handleKeyDown(event) {
|
|
264
|
+
if (this.hasTriggered && this.breakCharacters.includes(event.key)) {
|
|
265
|
+
this.hasTriggered = false;
|
|
266
|
+
this.triggeredRange = undefined;
|
|
267
|
+
this.triggeredElement = undefined;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
handleKeyUp(event) {
|
|
271
|
+
this.handleCursorPositionUpdate();
|
|
272
|
+
this.cursorPosition = this.getCursorPosition();
|
|
273
|
+
}
|
|
274
|
+
async handleInput() {
|
|
275
|
+
this.inputChanged.emit(this.getContentAsString());
|
|
276
|
+
}
|
|
277
|
+
handleClick() {
|
|
278
|
+
this.handleCursorPositionUpdate();
|
|
279
|
+
}
|
|
280
|
+
handleWindowClick(event) {
|
|
281
|
+
if (event.target instanceof HTMLElement &&
|
|
282
|
+
event.target.getAttribute('data-replaced') === 'true' &&
|
|
283
|
+
event.target.nextSibling != null) {
|
|
284
|
+
this.moveCursorToNodeEnd(event.target.nextSibling, true);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
handleFocus(event) {
|
|
288
|
+
this.inputFocus.emit(event);
|
|
289
|
+
}
|
|
290
|
+
handleBlur(event) {
|
|
291
|
+
this.hasTriggered = false;
|
|
292
|
+
this.inputBlur.emit(event);
|
|
293
|
+
}
|
|
294
|
+
handleResultClick(event) {
|
|
295
|
+
var _a;
|
|
296
|
+
const triggeredRange = this.triggeredRange;
|
|
297
|
+
const triggeredElement = this.triggeredElement;
|
|
298
|
+
const value = triggeredElement instanceof HTMLElement
|
|
299
|
+
? triggeredElement.innerText
|
|
300
|
+
: triggeredElement === null || triggeredElement === void 0 ? void 0 : triggeredElement.textContent;
|
|
301
|
+
if (this.contentEl != null &&
|
|
302
|
+
triggeredRange != null &&
|
|
303
|
+
triggeredElement != null &&
|
|
304
|
+
value != null) {
|
|
305
|
+
const triggeredValue = (_a = this.readTriggerValue(value, triggeredRange.startOffset)) !== null && _a !== void 0 ? _a : '';
|
|
306
|
+
const split = value.split(triggeredValue);
|
|
307
|
+
const before = split[0];
|
|
308
|
+
const after = split[1];
|
|
309
|
+
const replacement = createSearchResultReplacement(event.detail, before, after);
|
|
310
|
+
this.lastReplacedSpace = replacement.afterSpace;
|
|
311
|
+
this.rawElements = Array.from(this.contentEl.childNodes).reduce((re, e) => {
|
|
312
|
+
// TODO: see if we can do anything about the collapse to single line in safari
|
|
313
|
+
if (this.isIdenticalElement(e, triggeredElement)) {
|
|
314
|
+
return [...re, ...getNodesForSearchResultReplacement(replacement)];
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
return [...re, e];
|
|
318
|
+
}
|
|
319
|
+
}, []);
|
|
320
|
+
this.hasTriggered = false;
|
|
321
|
+
this.replacements = [
|
|
322
|
+
...this.replacements.filter((r) => r.id !== event.detail.id),
|
|
323
|
+
event.detail,
|
|
324
|
+
];
|
|
325
|
+
this.resultReplaced.emit(event.detail);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
getCursorPosition() {
|
|
329
|
+
var _a;
|
|
330
|
+
const selection = getWindowSelection();
|
|
331
|
+
if (selection != null && selection.rangeCount > 0) {
|
|
332
|
+
const cursorBounds = selection.getRangeAt(0).getBoundingClientRect();
|
|
333
|
+
const contentBounds = (_a = this.contentEl) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
334
|
+
const cursorBottom = cursorBounds.bottom || (contentBounds === null || contentBounds === void 0 ? void 0 : contentBounds.bottom) || 0;
|
|
335
|
+
const cursorTop = cursorBounds.top || (contentBounds === null || contentBounds === void 0 ? void 0 : contentBounds.top) || 0;
|
|
336
|
+
return {
|
|
337
|
+
x: cursorBounds.left || (contentBounds === null || contentBounds === void 0 ? void 0 : contentBounds.left) || 0,
|
|
338
|
+
y: this.placement.includes('top') ? cursorTop : cursorBottom,
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
throw new Error('Unable to retrieve window selection.');
|
|
342
|
+
}
|
|
343
|
+
get hostEl() { return getElement(this); }
|
|
344
|
+
static get watchers() { return {
|
|
345
|
+
"value": ["replaceContent"],
|
|
346
|
+
"replacements": ["updateContent"]
|
|
347
|
+
}; }
|
|
348
|
+
};
|
|
349
|
+
SearchBar.style = searchBarCss;
|
|
350
|
+
|
|
351
|
+
export { SearchBar as S };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, e as createEvent, h, c as readTask, g as getElement } from './index-72f28b71.js';
|
|
2
2
|
import { c as classnames } from './index-9c609209.js';
|
|
3
3
|
|
|
4
|
-
const selectCss = ":host{--select-width:100
|
|
4
|
+
const selectCss = ":host{--select-width:100%;--select-option-white-space:normal}.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}.text{white-space:var(--select-option-white-space);overflow:hidden;text-overflow:ellipsis}.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)}.options>slot::slotted([data-selected=\"true\"]){display:none}vertex-popover{--transform-origin:top left;--open-animation-name:open-scale-y;--close-animation-name:close-scale-y}";
|
|
5
5
|
|
|
6
6
|
const GET_BOUNDS_DEBOUNCE_THRESHOLD = 200;
|
|
7
7
|
const Select = class {
|
|
@@ -14,6 +14,7 @@ const Select = class {
|
|
|
14
14
|
this.placeholder = 'Select an option...';
|
|
15
15
|
this.disabled = false;
|
|
16
16
|
this.animated = true;
|
|
17
|
+
this.hideSelected = true;
|
|
17
18
|
this.open = false;
|
|
18
19
|
this.position = undefined;
|
|
19
20
|
this.displayValue = undefined;
|
|
@@ -33,6 +34,9 @@ const Select = class {
|
|
|
33
34
|
if (this.value != null) {
|
|
34
35
|
this.handleUpdateValue(this.value);
|
|
35
36
|
}
|
|
37
|
+
else {
|
|
38
|
+
this.handleUpdateDisplayValue();
|
|
39
|
+
}
|
|
36
40
|
}
|
|
37
41
|
connectedCallback() {
|
|
38
42
|
window.addEventListener('resize', this.getBounds);
|
|
@@ -50,6 +54,13 @@ const Select = class {
|
|
|
50
54
|
}
|
|
51
55
|
this.controlled = value != null;
|
|
52
56
|
}
|
|
57
|
+
handleUpdateDisplayValue() {
|
|
58
|
+
var _a;
|
|
59
|
+
this.clearSelectedOptionFlag();
|
|
60
|
+
if (this.hideSelected) {
|
|
61
|
+
(_a = this.getSelectedOption()) === null || _a === void 0 ? void 0 : _a.setAttribute('data-selected', 'true');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
53
64
|
render() {
|
|
54
65
|
return (h("div", { class: classnames('root', {
|
|
55
66
|
disabled: this.disabled,
|
|
@@ -58,7 +69,7 @@ const Select = class {
|
|
|
58
69
|
}, onClick: !this.open && !this.disabled ? this.handleOpen : undefined }, h("div", { class: classnames('target', {
|
|
59
70
|
hidden: this.open,
|
|
60
71
|
disabled: this.disabled,
|
|
61
|
-
}) }, this.displayValue || this.placeholder, h("div", { class: "icon" }, h("vertex-icon", { name: "chevron-down", size: "sm" }))), h("vertex-popover", { position: this.position, open: this.open, animated: this.animated, resizeBehavior: "fixed", onDismissed: this.handleDismiss }, h("div", { class: classnames('options', {
|
|
72
|
+
}) }, h("div", { class: "text" }, this.displayValue || this.placeholder), h("div", { class: "icon" }, h("vertex-icon", { name: "chevron-down", size: "sm" }))), h("vertex-popover", { position: this.position, open: this.open, animated: this.animated, resizeBehavior: "fixed", onDismissed: this.handleDismiss }, h("div", { class: classnames('options', {
|
|
62
73
|
hidden: !this.open,
|
|
63
74
|
visible: this.open,
|
|
64
75
|
animated: this.animated,
|
|
@@ -66,7 +77,7 @@ const Select = class {
|
|
|
66
77
|
minWidth: this.width != null ? `${this.width}px` : 'var(--select-width)',
|
|
67
78
|
} }, h("div", { class: classnames('selected-option', {
|
|
68
79
|
disabled: this.disabled,
|
|
69
|
-
}), onClick: this.handleDismiss }, this.displayValue || this.placeholder, h("div", { class: "icon" }, h("vertex-icon", { name: "chevron-down", size: "sm" }))), h("slot", null)))));
|
|
80
|
+
}), onClick: this.handleDismiss }, h("div", { class: "text" }, this.displayValue || this.placeholder), h("div", { class: "icon" }, h("vertex-icon", { name: "chevron-down", size: "sm" }))), h("slot", null)))));
|
|
70
81
|
}
|
|
71
82
|
handleOpen() {
|
|
72
83
|
var _a, _b;
|
|
@@ -105,6 +116,15 @@ const Select = class {
|
|
|
105
116
|
this.removeListeners.forEach((l) => l());
|
|
106
117
|
this.removeListeners = [];
|
|
107
118
|
}
|
|
119
|
+
clearSelectedOptionFlag() {
|
|
120
|
+
var _a, _b;
|
|
121
|
+
(_b = (_a = this.slotElement) === null || _a === void 0 ? void 0 : _a.assignedElements) === null || _b === void 0 ? void 0 : _b.call(_a).forEach((e) => e.removeAttribute('data-selected'));
|
|
122
|
+
}
|
|
123
|
+
getSelectedOption() {
|
|
124
|
+
var _a, _b, _c;
|
|
125
|
+
const value = (_a = this.displayValue) !== null && _a !== void 0 ? _a : this.placeholder;
|
|
126
|
+
return (_c = (_b = this.slotElement) === null || _b === void 0 ? void 0 : _b.assignedElements) === null || _c === void 0 ? void 0 : _c.call(_b).find((e) => e.getAttribute('data-value') === value || e.innerHTML === value);
|
|
127
|
+
}
|
|
108
128
|
getBounds() {
|
|
109
129
|
if (this.getBoundsTimeout != null) {
|
|
110
130
|
clearTimeout(this.getBoundsTimeout);
|
|
@@ -128,7 +148,10 @@ const Select = class {
|
|
|
128
148
|
}
|
|
129
149
|
get hostElement() { return getElement(this); }
|
|
130
150
|
static get watchers() { return {
|
|
131
|
-
"value": ["handleUpdateValue"]
|
|
151
|
+
"value": ["handleUpdateValue"],
|
|
152
|
+
"displayValue": ["handleUpdateDisplayValue"],
|
|
153
|
+
"hideSelected": ["handleUpdateDisplayValue"],
|
|
154
|
+
"placeholder": ["handleUpdateDisplayValue"]
|
|
132
155
|
}; }
|
|
133
156
|
};
|
|
134
157
|
Select.style = selectCss;
|
|
@@ -79,6 +79,7 @@ const TextField = class {
|
|
|
79
79
|
render() {
|
|
80
80
|
var _a;
|
|
81
81
|
const classes = classnames('txt-wrapper', {
|
|
82
|
+
'txt-wrapper-border': !this.multiline,
|
|
82
83
|
'txt-standard': this.variant === 'standard',
|
|
83
84
|
'txt-filled': this.variant === 'filled',
|
|
84
85
|
'txt-underlined': this.variant === 'underlined',
|
|
@@ -2054,12 +2054,13 @@ function getBoundingClientRect(el) {
|
|
|
2054
2054
|
return el.getBoundingClientRect();
|
|
2055
2055
|
}
|
|
2056
2056
|
|
|
2057
|
-
const tooltipCss = ":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}.
|
|
2057
|
+
const tooltipCss = ":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}.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}";
|
|
2058
2058
|
|
|
2059
2059
|
const TOOLTIP_OPEN_DELAY = 500;
|
|
2060
2060
|
const Tooltip = class {
|
|
2061
2061
|
constructor(hostRef) {
|
|
2062
2062
|
registerInstance(this, hostRef);
|
|
2063
|
+
this.pointerEntered = false;
|
|
2063
2064
|
this.content = undefined;
|
|
2064
2065
|
this.disabled = undefined;
|
|
2065
2066
|
this.placement = 'bottom';
|
|
@@ -2068,32 +2069,40 @@ const Tooltip = class {
|
|
|
2068
2069
|
this.open = false;
|
|
2069
2070
|
this.handlePointerEnter = this.handlePointerEnter.bind(this);
|
|
2070
2071
|
this.handlePointerLeave = this.handlePointerLeave.bind(this);
|
|
2072
|
+
this.handleContentChange = this.handleContentChange.bind(this);
|
|
2073
|
+
this.handleDisabledChange = this.handleDisabledChange.bind(this);
|
|
2071
2074
|
this.tooltipId = `vertex-tooltip-${uuid.create()}`;
|
|
2072
2075
|
}
|
|
2073
2076
|
disconnectedCallback() {
|
|
2074
2077
|
this.removeElement();
|
|
2075
2078
|
this.clearOpenTimeout();
|
|
2079
|
+
this.pointerEntered = false;
|
|
2080
|
+
}
|
|
2081
|
+
handleContentChange() {
|
|
2082
|
+
if (this.internalContentElement != null) {
|
|
2083
|
+
this.updateContentElementChildren(this.internalContentElement);
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
handleDisabledChange() {
|
|
2087
|
+
if (this.internalContentElement != null) {
|
|
2088
|
+
this.updateContentElementClass(this.internalContentElement);
|
|
2089
|
+
}
|
|
2090
|
+
if (!this.disabled && this.pointerEntered) {
|
|
2091
|
+
this.handlePointerEnter();
|
|
2092
|
+
}
|
|
2076
2093
|
}
|
|
2077
2094
|
render() {
|
|
2078
2095
|
return (h(Host, null, h("div", { class: "target", ref: (el) => {
|
|
2079
2096
|
this.targetElement = el;
|
|
2080
2097
|
}, onPointerEnter: this.handlePointerEnter, onPointerLeave: this.handlePointerLeave }, h("slot", null)), h("div", { class: "content-hidden", ref: (el) => {
|
|
2081
2098
|
this.contentElement = el;
|
|
2082
|
-
} }, h("slot", { name: "content" }))));
|
|
2099
|
+
} }, h("slot", { name: "content", onSlotchange: this.handleContentChange }))));
|
|
2083
2100
|
}
|
|
2084
2101
|
addElement() {
|
|
2085
|
-
var _a;
|
|
2086
2102
|
if (this.targetElement != null) {
|
|
2087
2103
|
const popover = this.createPopoverElement(this.targetElement);
|
|
2088
2104
|
const content = this.createContentElement();
|
|
2089
|
-
this.
|
|
2090
|
-
(_a = getSlottedContent(this.contentElement)) !== null && _a !== void 0 ? _a : this.displayedSlottedContent;
|
|
2091
|
-
if (this.content != null) {
|
|
2092
|
-
content.innerText = this.content;
|
|
2093
|
-
}
|
|
2094
|
-
else if (this.displayedSlottedContent != null) {
|
|
2095
|
-
content.appendChild(this.displayedSlottedContent);
|
|
2096
|
-
}
|
|
2105
|
+
this.updateContentElementChildren(content);
|
|
2097
2106
|
popover.appendChild(content);
|
|
2098
2107
|
this.hostElement.ownerDocument.body.appendChild(popover);
|
|
2099
2108
|
}
|
|
@@ -2103,6 +2112,7 @@ const Tooltip = class {
|
|
|
2103
2112
|
if (popover != null) {
|
|
2104
2113
|
popover.remove();
|
|
2105
2114
|
}
|
|
2115
|
+
this.internalContentElement = undefined;
|
|
2106
2116
|
}
|
|
2107
2117
|
createPopoverElement(anchorElement) {
|
|
2108
2118
|
const popover = this.hostElement.ownerDocument.createElement('vertex-popover');
|
|
@@ -2117,25 +2127,50 @@ const Tooltip = class {
|
|
|
2117
2127
|
return popover;
|
|
2118
2128
|
}
|
|
2119
2129
|
createContentElement() {
|
|
2120
|
-
|
|
2121
|
-
|
|
2130
|
+
this.internalContentElement =
|
|
2131
|
+
this.hostElement.ownerDocument.createElement('div');
|
|
2132
|
+
this.internalContentElement.setAttribute('class', classnames('vertex-tooltip-content', {
|
|
2133
|
+
hidden: !this.open || this.disabled,
|
|
2134
|
+
}));
|
|
2135
|
+
return this.internalContentElement;
|
|
2136
|
+
}
|
|
2137
|
+
updateContentElementClass(element) {
|
|
2138
|
+
element.setAttribute('class', classnames('vertex-tooltip-content', {
|
|
2122
2139
|
hidden: !this.open || this.disabled,
|
|
2123
2140
|
}));
|
|
2124
|
-
|
|
2141
|
+
}
|
|
2142
|
+
updateContentElementChildren(element) {
|
|
2143
|
+
var _a;
|
|
2144
|
+
this.displayedSlottedContent =
|
|
2145
|
+
(_a = getSlottedContent(this.contentElement)) !== null && _a !== void 0 ? _a : this.displayedSlottedContent;
|
|
2146
|
+
if (this.content != null) {
|
|
2147
|
+
element.innerText = this.content;
|
|
2148
|
+
}
|
|
2149
|
+
else if (this.displayedSlottedContent != null) {
|
|
2150
|
+
element.appendChild(this.displayedSlottedContent);
|
|
2151
|
+
}
|
|
2125
2152
|
}
|
|
2126
2153
|
handlePointerEnter() {
|
|
2127
2154
|
if (this.openTimeout == null && !this.disabled) {
|
|
2128
|
-
this.
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
}, this.delay);
|
|
2155
|
+
this.createOpenTimeout();
|
|
2156
|
+
}
|
|
2157
|
+
else if (this.openTimeout == null) {
|
|
2158
|
+
this.pointerEntered = true;
|
|
2133
2159
|
}
|
|
2134
2160
|
}
|
|
2135
2161
|
handlePointerLeave() {
|
|
2136
2162
|
this.clearOpenTimeout();
|
|
2137
2163
|
this.removeElement();
|
|
2138
2164
|
this.open = false;
|
|
2165
|
+
this.pointerEntered = false;
|
|
2166
|
+
}
|
|
2167
|
+
createOpenTimeout() {
|
|
2168
|
+
this.openTimeout = setTimeout(() => {
|
|
2169
|
+
this.open = true;
|
|
2170
|
+
this.openTimeout = undefined;
|
|
2171
|
+
this.addElement();
|
|
2172
|
+
}, this.delay);
|
|
2173
|
+
this.pointerEntered = false;
|
|
2139
2174
|
}
|
|
2140
2175
|
clearOpenTimeout() {
|
|
2141
2176
|
if (this.openTimeout != null) {
|
|
@@ -2144,6 +2179,10 @@ const Tooltip = class {
|
|
|
2144
2179
|
}
|
|
2145
2180
|
}
|
|
2146
2181
|
get hostElement() { return getElement(this); }
|
|
2182
|
+
static get watchers() { return {
|
|
2183
|
+
"content": ["handleContentChange"],
|
|
2184
|
+
"disabled": ["handleDisabledChange"]
|
|
2185
|
+
}; }
|
|
2147
2186
|
};
|
|
2148
2187
|
Tooltip.style = tooltipCss;
|
|
2149
2188
|
|
|
@@ -126,11 +126,16 @@ export declare class Popover {
|
|
|
126
126
|
private viewportWidth?;
|
|
127
127
|
private viewportHeight?;
|
|
128
128
|
private resizeTimeout?;
|
|
129
|
+
private boundaryResizeObserver?;
|
|
129
130
|
private shouldUpdatePosition;
|
|
130
131
|
private updateDispose?;
|
|
131
132
|
private middleware;
|
|
132
133
|
private partialWindow;
|
|
133
134
|
constructor();
|
|
135
|
+
/**
|
|
136
|
+
* @internal
|
|
137
|
+
*/
|
|
138
|
+
resizeObserverFactory: (cb: (entries: ResizeObserverEntry[]) => void) => ResizeObserver;
|
|
134
139
|
connectedCallback(): void;
|
|
135
140
|
componentDidUpdate(): void;
|
|
136
141
|
componentDidLoad(): void;
|
|
@@ -140,6 +145,7 @@ export declare class Popover {
|
|
|
140
145
|
updateOpened(open?: boolean): void;
|
|
141
146
|
updateAnimated(): void;
|
|
142
147
|
updateMiddleware(): void;
|
|
148
|
+
updateResizeObserver(): void;
|
|
143
149
|
/**
|
|
144
150
|
* @private Used for internals or testing.
|
|
145
151
|
*/
|
|
@@ -152,5 +158,6 @@ export declare class Popover {
|
|
|
152
158
|
private getAnchorBoundsVirtualElement;
|
|
153
159
|
private handleResize;
|
|
154
160
|
private updateViewport;
|
|
161
|
+
private getOrCreateResizeObserver;
|
|
155
162
|
private getTransformClass;
|
|
156
163
|
}
|