@umbraco-ui/uui-combobox 1.1.1 → 1.2.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 CHANGED
@@ -48,6 +48,12 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
48
48
  this.dispatchEvent(new UUIComboboxEvent(UUIComboboxEvent.SEARCH));
49
49
  this._open();
50
50
  };
51
+ this._onSlotChange = () => {
52
+ var _a;
53
+ if (this.value && this.value !== ((_a = this._comboboxList) == null ? void 0 : _a.value)) {
54
+ this._updateValue(this.value);
55
+ }
56
+ };
51
57
  this._onChange = (e) => {
52
58
  var _a;
53
59
  e.stopImmediatePropagation();
@@ -183,17 +189,20 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
183
189
  UUIComboboxListEvent.CHANGE,
184
190
  this._onChange
185
191
  );
186
- if (typeof this.value === "string") {
187
- await this.updateComplete;
188
- this._updateValue(this.value);
189
- }
192
+ this._comboboxList.addEventListener(
193
+ UUIComboboxListEvent.SLOT_CHANGE,
194
+ this._onSlotChange
195
+ );
196
+ await this.updateComplete;
197
+ this._updateValue(this.value);
190
198
  }
191
199
  }
192
200
  _updateValue(value) {
193
- var _a;
194
201
  if (this._comboboxList) {
195
202
  this._comboboxList.value = value;
196
- this._displayValue = ((_a = this._comboboxList) == null ? void 0 : _a.displayValue) || "";
203
+ requestAnimationFrame(
204
+ () => this._displayValue = this._comboboxList.displayValue || ""
205
+ );
197
206
  }
198
207
  }
199
208
  getFormElement() {
@@ -286,6 +295,9 @@ UUIComboboxElement.styles = [
286
295
  }
287
296
  `
288
297
  ];
298
+ __decorateClass([
299
+ property({ attribute: "value", reflect: true })
300
+ ], UUIComboboxElement.prototype, "value", 1);
289
301
  __decorateClass([
290
302
  property({ type: String })
291
303
  ], UUIComboboxElement.prototype, "search", 1);
@@ -0,0 +1,8 @@
1
+ import { LitElement } from 'lit';
2
+ export declare class UUIComboboxAsyncOptionsExampleElement extends LitElement {
3
+ _options: any[];
4
+ connectedCallback(): void;
5
+ private _fetchData;
6
+ preselected: string;
7
+ render(): import("lit-html").TemplateResult<1>;
8
+ }
@@ -51,6 +51,7 @@ export declare class UUIComboboxElement extends UUIComboboxElement_base {
51
51
  private _onMouseDown;
52
52
  private _onBlur;
53
53
  private _onInput;
54
+ private _onSlotChange;
54
55
  private _onChange;
55
56
  private _open;
56
57
  private _onClose;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ui/uui-combobox",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "Umbraco",
@@ -30,11 +30,11 @@
30
30
  "custom-elements.json"
31
31
  ],
32
32
  "dependencies": {
33
- "@umbraco-ui/uui-base": "1.0.0",
34
- "@umbraco-ui/uui-button": "1.0.0",
35
- "@umbraco-ui/uui-combobox-list": "1.0.0",
36
- "@umbraco-ui/uui-icon": "1.0.0",
37
- "@umbraco-ui/uui-scroll-container": "1.0.0"
33
+ "@umbraco-ui/uui-base": "1.1.0",
34
+ "@umbraco-ui/uui-button": "1.1.0",
35
+ "@umbraco-ui/uui-combobox-list": "1.1.0",
36
+ "@umbraco-ui/uui-icon": "1.1.0",
37
+ "@umbraco-ui/uui-scroll-container": "1.1.0"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
@@ -45,5 +45,5 @@
45
45
  "access": "public"
46
46
  },
47
47
  "homepage": "https://uui.umbraco.com/?path=/story/uui-combobox",
48
- "gitHead": "be41090c074658278069302f78f668ad362521fe"
48
+ "gitHead": "5159a81e353c893c30073cdbf2fdd94306477d6e"
49
49
  }