@umbraco-ui/uui-combobox 1.7.1 → 1.8.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.
@@ -37,7 +37,7 @@
37
37
  },
38
38
  {
39
39
  "name": "value",
40
- "description": "Value of this form control.",
40
+ "description": "Value of this form control.\nIf you dont want the setFormValue to be called on the ElementInternals, then prevent calling this method, by not calling super.value = newValue in your implementation of the value setter method.",
41
41
  "type": "string",
42
42
  "default": "\"''\""
43
43
  },
@@ -122,7 +122,7 @@
122
122
  {
123
123
  "name": "value",
124
124
  "attribute": "value",
125
- "description": "Value of this form control.",
125
+ "description": "Value of this form control.\nIf you dont want the setFormValue to be called on the ElementInternals, then prevent calling this method, by not calling super.value = newValue in your implementation of the value setter method.",
126
126
  "type": "string",
127
127
  "default": "\"''\""
128
128
  },
@@ -166,7 +166,8 @@
166
166
  "type": "ValidityState"
167
167
  },
168
168
  {
169
- "name": "validationMessage"
169
+ "name": "validationMessage",
170
+ "type": "string"
170
171
  }
171
172
  ],
172
173
  "events": [
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { FormControlMixin } from '@umbraco-ui/uui-base/lib/mixins';
1
+ import { UUIFormControlMixin } from '@umbraco-ui/uui-base/lib/mixins';
2
2
  import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
3
3
  import { demandCustomElement } from '@umbraco-ui/uui-base/lib/utils';
4
4
  import { UUIComboboxListEvent } from '@umbraco-ui/uui-combobox-list/lib';
@@ -52,7 +52,7 @@ var __privateMethod = (obj, member, method) => {
52
52
  return method;
53
53
  };
54
54
  var _comboboxList, _phoneMediaQuery, _onPhoneChange, _updateValue, updateValue_fn, _onMouseDown, _onBlur, _onInput, _onSlotChange, _onChange, _onToggle, _onOpen, _onClose, _onKeyDown, _onClear, _renderInput, _renderClearButton, _renderDropdown;
55
- let UUIComboboxElement = class extends FormControlMixin(LitElement) {
55
+ let UUIComboboxElement = class extends UUIFormControlMixin(LitElement, "") {
56
56
  constructor() {
57
57
  super(...arguments);
58
58
  __privateAdd(this, _updateValue);
@@ -67,7 +67,7 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
67
67
  __privateAdd(this, _onPhoneChange, () => {
68
68
  this._isPhone = __privateGet(this, _phoneMediaQuery).matches;
69
69
  });
70
- __privateAdd(this, _onMouseDown, () => requestAnimationFrame(() => this._inputElement.focus()));
70
+ __privateAdd(this, _onMouseDown, () => requestAnimationFrame(() => this._input.focus()));
71
71
  __privateAdd(this, _onBlur, () => requestAnimationFrame(() => {
72
72
  if (!this.shadowRoot?.activeElement) {
73
73
  __privateGet(this, _onClose).call(this);
@@ -104,7 +104,7 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
104
104
  return;
105
105
  this.open = false;
106
106
  this.search = "";
107
- this._inputElement.value = this._displayValue;
107
+ this._input.value = this._displayValue;
108
108
  this.dispatchEvent(new UUIComboboxEvent(UUIComboboxEvent.SEARCH));
109
109
  });
110
110
  __privateAdd(this, _onKeyDown, (e) => {
@@ -126,8 +126,8 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
126
126
  e.stopImmediatePropagation();
127
127
  this.value = "";
128
128
  this.search = "";
129
- this._inputElement.value = this._displayValue;
130
- this._inputElement.focus();
129
+ this._input.value = this._displayValue;
130
+ this._input.focus();
131
131
  this.dispatchEvent(new UUIComboboxEvent(UUIComboboxEvent.SEARCH));
132
132
  this.dispatchEvent(new UUIComboboxEvent(UUIComboboxEvent.CHANGE));
133
133
  });
@@ -173,7 +173,7 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
173
173
  });
174
174
  }
175
175
  get value() {
176
- return this._value;
176
+ return super.value;
177
177
  }
178
178
  set value(newValue) {
179
179
  if (typeof newValue === "string") {
@@ -200,7 +200,7 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
200
200
  const popover = this._comboboxPopoverElement;
201
201
  if (popover) {
202
202
  if (newValue) {
203
- const width = this._inputElement.offsetWidth;
203
+ const width = this._input.offsetWidth;
204
204
  popover.style.setProperty("--popover-width", `${width}px`);
205
205
  popover.showPopover();
206
206
  } else {
@@ -248,7 +248,19 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
248
248
  }
249
249
  }
250
250
  getFormElement() {
251
- return this._inputElement;
251
+ return this._input;
252
+ }
253
+ async focus() {
254
+ await this.updateComplete;
255
+ this._input.focus();
256
+ }
257
+ async blur() {
258
+ await this.updateComplete;
259
+ this._input.blur();
260
+ }
261
+ async click() {
262
+ await this.updateComplete;
263
+ this._input.click();
252
264
  }
253
265
  render() {
254
266
  if (this._isPhone && this.open) {
@@ -386,7 +398,7 @@ __decorateClass([
386
398
  ], UUIComboboxElement.prototype, "disabled", 2);
387
399
  __decorateClass([
388
400
  query("#combobox-input")
389
- ], UUIComboboxElement.prototype, "_inputElement", 2);
401
+ ], UUIComboboxElement.prototype, "_input", 2);
390
402
  __decorateClass([
391
403
  query("#combobox-popover")
392
404
  ], UUIComboboxElement.prototype, "_comboboxPopoverElement", 2);
@@ -1,5 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
- declare const UUIComboboxElement_base: (new (...args: any[]) => import("@umbraco-ui/uui-base/lib/mixins").FormControlMixinInterface) & typeof LitElement;
2
+ declare const UUIComboboxElement_base: (new (...args: any[]) => import("@umbraco-ui/uui-base/lib/mixins").UUIFormControlMixinInterface<FormDataEntryValue | FormData, string>) & typeof LitElement;
3
3
  /**
4
4
  * @element uui-combobox
5
5
  * @fires {UUIComboboxEvent} input - fires when search input is changed
@@ -44,7 +44,7 @@ export declare class UUIComboboxElement extends UUIComboboxElement_base {
44
44
  * @default false
45
45
  */
46
46
  disabled: boolean;
47
- private _inputElement;
47
+ private _input;
48
48
  private _comboboxPopoverElement?;
49
49
  private _comboboxListElements?;
50
50
  private _displayValue;
@@ -55,6 +55,9 @@ export declare class UUIComboboxElement extends UUIComboboxElement_base {
55
55
  disconnectedCallback(): void;
56
56
  protected firstUpdated(): Promise<void>;
57
57
  protected getFormElement(): HTMLElement | undefined;
58
+ focus(): Promise<void>;
59
+ blur(): Promise<void>;
60
+ click(): Promise<void>;
58
61
  render(): import("lit-html").TemplateResult<1>;
59
62
  static styles: import("lit").CSSResult[];
60
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ui/uui-combobox",
3
- "version": "1.7.1",
3
+ "version": "1.8.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.7.0",
34
- "@umbraco-ui/uui-button": "1.7.1",
35
- "@umbraco-ui/uui-combobox-list": "1.7.0",
36
- "@umbraco-ui/uui-icon": "1.7.0",
37
- "@umbraco-ui/uui-popover-container": "1.7.0",
38
- "@umbraco-ui/uui-scroll-container": "1.7.0",
39
- "@umbraco-ui/uui-symbol-expand": "1.7.0"
33
+ "@umbraco-ui/uui-base": "1.8.0-rc.0",
34
+ "@umbraco-ui/uui-button": "1.8.0-rc.0",
35
+ "@umbraco-ui/uui-combobox-list": "1.8.0-rc.0",
36
+ "@umbraco-ui/uui-icon": "1.8.0-rc.0",
37
+ "@umbraco-ui/uui-popover-container": "1.8.0-rc.0",
38
+ "@umbraco-ui/uui-scroll-container": "1.8.0-rc.0",
39
+ "@umbraco-ui/uui-symbol-expand": "1.8.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": "48b40b1f5a550f89e731051c78f2c5aea9412c47"
50
+ "gitHead": "46d444c66217c9a3c74518d8ce4badc7f121bfdf"
51
51
  }