@umbraco-ui/uui-combobox 1.12.1 → 1.13.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +38 -27
- package/lib/uui-combobox.element.d.ts +0 -1
- package/package.json +9 -9
package/lib/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
36
36
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
37
37
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
38
38
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
39
|
-
var _comboboxList, _phoneMediaQuery,
|
|
39
|
+
var _comboboxList, _phoneMediaQuery, _UUIComboboxElement_instances, onSlotChange_fn, _onPhoneChange, updateValue_fn, _onMouseDown, _onBlur, _onInput, _onInnerSlotChange, _onChange, _onToggle, _onOpen, _onClose, _onKeyDown, _onClear, _renderInput, _renderClearButton, _renderDropdown;
|
|
40
40
|
let UUIComboboxElement = class extends UUIFormControlMixin(LitElement, "") {
|
|
41
41
|
constructor() {
|
|
42
42
|
super(...arguments);
|
|
@@ -66,9 +66,9 @@ let UUIComboboxElement = class extends UUIFormControlMixin(LitElement, "") {
|
|
|
66
66
|
this.dispatchEvent(new UUIComboboxEvent(UUIComboboxEvent.SEARCH));
|
|
67
67
|
__privateGet(this, _onOpen).call(this);
|
|
68
68
|
});
|
|
69
|
-
__privateAdd(this,
|
|
69
|
+
__privateAdd(this, _onInnerSlotChange, () => {
|
|
70
70
|
if (this.value && this.value !== __privateGet(this, _comboboxList)?.value) {
|
|
71
|
-
__privateMethod(this, _UUIComboboxElement_instances, updateValue_fn).call(this
|
|
71
|
+
__privateMethod(this, _UUIComboboxElement_instances, updateValue_fn).call(this);
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
__privateAdd(this, _onChange, () => {
|
|
@@ -155,7 +155,7 @@ let UUIComboboxElement = class extends UUIFormControlMixin(LitElement, "") {
|
|
|
155
155
|
__privateAdd(this, _renderDropdown, () => {
|
|
156
156
|
return html`<div id="dropdown">
|
|
157
157
|
<uui-scroll-container tabindex="-1" id="scroll-container">
|
|
158
|
-
<slot></slot>
|
|
158
|
+
<slot @slotchange=${__privateMethod(this, _UUIComboboxElement_instances, onSlotChange_fn)}></slot>
|
|
159
159
|
</uui-scroll-container>
|
|
160
160
|
</div>`;
|
|
161
161
|
});
|
|
@@ -164,10 +164,10 @@ let UUIComboboxElement = class extends UUIFormControlMixin(LitElement, "") {
|
|
|
164
164
|
return super.value;
|
|
165
165
|
}
|
|
166
166
|
set value(newValue) {
|
|
167
|
+
super.value = newValue;
|
|
167
168
|
if (typeof newValue === "string") {
|
|
168
|
-
__privateMethod(this, _UUIComboboxElement_instances, updateValue_fn).call(this
|
|
169
|
+
__privateMethod(this, _UUIComboboxElement_instances, updateValue_fn).call(this);
|
|
169
170
|
}
|
|
170
|
-
super.value = newValue;
|
|
171
171
|
}
|
|
172
172
|
get search() {
|
|
173
173
|
return this._search;
|
|
@@ -217,23 +217,6 @@ let UUIComboboxElement = class extends UUIFormControlMixin(LitElement, "") {
|
|
|
217
217
|
this.removeEventListener("mousedown", __privateGet(this, _onMouseDown));
|
|
218
218
|
__privateGet(this, _phoneMediaQuery).removeEventListener("change", __privateGet(this, _onPhoneChange));
|
|
219
219
|
}
|
|
220
|
-
async firstUpdated() {
|
|
221
|
-
const list = this._comboboxListElements?.[0];
|
|
222
|
-
if (list) {
|
|
223
|
-
__privateSet(this, _comboboxList, list);
|
|
224
|
-
__privateGet(this, _comboboxList).for = this;
|
|
225
|
-
__privateGet(this, _comboboxList).addEventListener(
|
|
226
|
-
UUIComboboxListEvent.CHANGE,
|
|
227
|
-
__privateGet(this, _onChange)
|
|
228
|
-
);
|
|
229
|
-
__privateGet(this, _comboboxList).addEventListener(
|
|
230
|
-
UUIComboboxListEvent.INNER_SLOT_CHANGE,
|
|
231
|
-
__privateGet(this, _onSlotChange)
|
|
232
|
-
);
|
|
233
|
-
await this.updateComplete;
|
|
234
|
-
__privateMethod(this, _UUIComboboxElement_instances, updateValue_fn).call(this, this.value);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
220
|
getFormElement() {
|
|
238
221
|
return this._input;
|
|
239
222
|
}
|
|
@@ -272,11 +255,39 @@ let UUIComboboxElement = class extends UUIFormControlMixin(LitElement, "") {
|
|
|
272
255
|
};
|
|
273
256
|
_comboboxList = new WeakMap();
|
|
274
257
|
_phoneMediaQuery = new WeakMap();
|
|
275
|
-
_onPhoneChange = new WeakMap();
|
|
276
258
|
_UUIComboboxElement_instances = new WeakSet();
|
|
277
|
-
|
|
259
|
+
onSlotChange_fn = function() {
|
|
260
|
+
if (__privateGet(this, _comboboxList)) {
|
|
261
|
+
__privateGet(this, _comboboxList).removeEventListener(
|
|
262
|
+
UUIComboboxListEvent.CHANGE,
|
|
263
|
+
__privateGet(this, _onChange)
|
|
264
|
+
);
|
|
265
|
+
__privateGet(this, _comboboxList).removeEventListener(
|
|
266
|
+
UUIComboboxListEvent.INNER_SLOT_CHANGE,
|
|
267
|
+
__privateGet(this, _onInnerSlotChange)
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
const list = this._comboboxListElements?.[0];
|
|
271
|
+
if (list) {
|
|
272
|
+
__privateSet(this, _comboboxList, list);
|
|
273
|
+
__privateGet(this, _comboboxList).for = this;
|
|
274
|
+
__privateGet(this, _comboboxList).addEventListener(
|
|
275
|
+
UUIComboboxListEvent.CHANGE,
|
|
276
|
+
__privateGet(this, _onChange)
|
|
277
|
+
);
|
|
278
|
+
__privateGet(this, _comboboxList).addEventListener(
|
|
279
|
+
UUIComboboxListEvent.INNER_SLOT_CHANGE,
|
|
280
|
+
__privateGet(this, _onInnerSlotChange)
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
this.updateComplete.then(() => {
|
|
284
|
+
__privateMethod(this, _UUIComboboxElement_instances, updateValue_fn).call(this);
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
_onPhoneChange = new WeakMap();
|
|
288
|
+
updateValue_fn = function() {
|
|
278
289
|
if (__privateGet(this, _comboboxList)) {
|
|
279
|
-
__privateGet(this, _comboboxList).value = value;
|
|
290
|
+
__privateGet(this, _comboboxList).value = this.value;
|
|
280
291
|
requestAnimationFrame(
|
|
281
292
|
() => this._displayValue = __privateGet(this, _comboboxList).displayValue || ""
|
|
282
293
|
);
|
|
@@ -285,7 +296,7 @@ updateValue_fn = function(value) {
|
|
|
285
296
|
_onMouseDown = new WeakMap();
|
|
286
297
|
_onBlur = new WeakMap();
|
|
287
298
|
_onInput = new WeakMap();
|
|
288
|
-
|
|
299
|
+
_onInnerSlotChange = new WeakMap();
|
|
289
300
|
_onChange = new WeakMap();
|
|
290
301
|
_onToggle = new WeakMap();
|
|
291
302
|
_onOpen = new WeakMap();
|
|
@@ -60,7 +60,6 @@ export declare class UUIComboboxElement extends UUIComboboxElement_base {
|
|
|
60
60
|
private _isOpen;
|
|
61
61
|
connectedCallback(): void;
|
|
62
62
|
disconnectedCallback(): void;
|
|
63
|
-
protected firstUpdated(): Promise<void>;
|
|
64
63
|
protected getFormElement(): HTMLElement | undefined;
|
|
65
64
|
focus(): Promise<void>;
|
|
66
65
|
blur(): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-combobox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"custom-elements.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@umbraco-ui/uui-base": "1.
|
|
34
|
-
"@umbraco-ui/uui-button": "1.
|
|
35
|
-
"@umbraco-ui/uui-combobox-list": "1.
|
|
36
|
-
"@umbraco-ui/uui-icon": "1.
|
|
37
|
-
"@umbraco-ui/uui-popover-container": "1.
|
|
38
|
-
"@umbraco-ui/uui-scroll-container": "1.
|
|
39
|
-
"@umbraco-ui/uui-symbol-expand": "1.
|
|
33
|
+
"@umbraco-ui/uui-base": "1.13.0-rc.0",
|
|
34
|
+
"@umbraco-ui/uui-button": "1.13.0-rc.0",
|
|
35
|
+
"@umbraco-ui/uui-combobox-list": "1.13.0-rc.0",
|
|
36
|
+
"@umbraco-ui/uui-icon": "1.13.0-rc.0",
|
|
37
|
+
"@umbraco-ui/uui-popover-container": "1.13.0-rc.0",
|
|
38
|
+
"@umbraco-ui/uui-scroll-container": "1.13.0-rc.0",
|
|
39
|
+
"@umbraco-ui/uui-symbol-expand": "1.13.0-rc.0"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "npm run analyze && tsc --build && rollup -c rollup.config.js",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-combobox",
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "864afa6c182c2a73c479237732dadc1abc69a4a0"
|
|
51
51
|
}
|