@umbraco-ui/uui-combobox 1.14.0-rc.4 → 1.14.1

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.
@@ -18,7 +18,7 @@
18
18
  "default": "\"false\""
19
19
  },
20
20
  {
21
- "name": "closeLabel",
21
+ "name": "close-label",
22
22
  "description": "Specifies the button label for the close button in mobile mode",
23
23
  "type": "string",
24
24
  "default": "\"\\\"Close\\\"\""
@@ -29,12 +29,24 @@
29
29
  "type": "boolean",
30
30
  "default": "\"false\""
31
31
  },
32
+ {
33
+ "name": "hide-expand-symbol",
34
+ "description": "Removes the expand symbol.",
35
+ "type": "boolean",
36
+ "default": "\"false\""
37
+ },
32
38
  {
33
39
  "name": "readonly",
34
40
  "description": "Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.",
35
41
  "type": "boolean",
36
42
  "default": "\"false\""
37
43
  },
44
+ {
45
+ "name": "placeholder",
46
+ "description": "Defines the input placeholder.",
47
+ "type": "string",
48
+ "default": "\"''\""
49
+ },
38
50
  {
39
51
  "name": "name",
40
52
  "description": "This is a name property of the component.",
@@ -95,7 +107,7 @@
95
107
  },
96
108
  {
97
109
  "name": "closeLabel",
98
- "attribute": "closeLabel",
110
+ "attribute": "close-label",
99
111
  "description": "Specifies the button label for the close button in mobile mode",
100
112
  "type": "string",
101
113
  "default": "\"\\\"Close\\\"\""
@@ -107,6 +119,13 @@
107
119
  "type": "boolean",
108
120
  "default": "\"false\""
109
121
  },
122
+ {
123
+ "name": "hideExpandSymbol",
124
+ "attribute": "hide-expand-symbol",
125
+ "description": "Removes the expand symbol.",
126
+ "type": "boolean",
127
+ "default": "\"false\""
128
+ },
110
129
  {
111
130
  "name": "readonly",
112
131
  "attribute": "readonly",
@@ -114,6 +133,13 @@
114
133
  "type": "boolean",
115
134
  "default": "\"false\""
116
135
  },
136
+ {
137
+ "name": "placeholder",
138
+ "attribute": "placeholder",
139
+ "description": "Defines the input placeholder.",
140
+ "type": "string",
141
+ "default": "\"''\""
142
+ },
117
143
  {
118
144
  "name": "styles",
119
145
  "type": "CSSResult[]",
package/lib/index.js CHANGED
@@ -43,7 +43,9 @@ let UUIComboboxElement = class extends UUIFormControlMixin(LitElement, "") {
43
43
  __privateAdd(this, _UUIComboboxElement_instances);
44
44
  this.closeLabel = "Close";
45
45
  this.disabled = false;
46
+ this.hideExpandSymbol = false;
46
47
  this.readonly = false;
48
+ this.placeholder = "";
47
49
  __privateAdd(this, _comboboxList);
48
50
  __privateAdd(this, _phoneMediaQuery);
49
51
  this._displayValue = "";
@@ -123,6 +125,7 @@ let UUIComboboxElement = class extends UUIFormControlMixin(LitElement, "") {
123
125
  label="combobox-input"
124
126
  type="text"
125
127
  .value=${this._displayValue}
128
+ .placeholder=${this.placeholder}
126
129
  autocomplete="off"
127
130
  .disabled=${this.disabled}
128
131
  .readonly=${this.readonly}
@@ -132,25 +135,27 @@ let UUIComboboxElement = class extends UUIFormControlMixin(LitElement, "") {
132
135
  @keydown=${__privateGet(this, _onKeyDown)}>
133
136
  <slot name="input-prepend" slot="prepend"></slot>
134
137
  ${__privateGet(this, _renderClearButton).call(this)}
135
- <div id="expand-symbol-wrapper" slot="append">
136
- <uui-symbol-expand .open=${this._isOpen}></uui-symbol-expand>
137
- </div>
138
+ ${this.hideExpandSymbol ? nothing : html`<div id="expand-symbol-wrapper" slot="append">
139
+ <uui-symbol-expand .open=${this._isOpen}></uui-symbol-expand>
140
+ </div>`}
138
141
  <slot name="input-append" slot="append"></slot>
139
142
  </uui-input>`;
140
143
  });
141
144
  __privateAdd(this, _renderClearButton, () => {
142
145
  if (this.disabled) return nothing;
143
146
  if (this.readonly) return nothing;
144
- return this.value || this.search ? html`<uui-button
145
- id="clear-button"
146
- @click=${__privateGet(this, _onClear)}
147
- @keydown=${__privateGet(this, _onClear)}
148
- label="clear"
149
- slot="append"
150
- compact
151
- style="height: 100%;">
152
- <uui-icon name="remove" .fallback=${iconRemove.strings[0]}></uui-icon>
153
- </uui-button>` : "";
147
+ return html`<uui-button
148
+ id="clear-button"
149
+ @click=${__privateGet(this, _onClear)}
150
+ @keydown=${__privateGet(this, _onClear)}
151
+ label="clear"
152
+ slot="append"
153
+ compact
154
+ style="height: 100%;"
155
+ tabindex=${this.value || this.search ? "" : "-1"}
156
+ class=${this.value || this.search ? "visible" : ""}>
157
+ <uui-icon name="remove" .fallback=${iconRemove.strings[0]}></uui-icon>
158
+ </uui-button>`;
154
159
  });
155
160
  __privateAdd(this, _renderDropdown, () => {
156
161
  return html`<div id="dropdown">
@@ -333,6 +338,17 @@ UUIComboboxElement.styles = [
333
338
  justify-content: center;
334
339
  }
335
340
 
341
+ #clear-button {
342
+ opacity: 0;
343
+ transition: opacity 80ms;
344
+ }
345
+
346
+ :host(:not([disabled]):not([readonly]):focus-within)
347
+ #clear-button.visible,
348
+ :host(:not([disabled]):not([readonly]):hover) #clear-button.visible {
349
+ opacity: 1;
350
+ }
351
+
336
352
  #dropdown {
337
353
  overflow: hidden;
338
354
  z-index: -1;
@@ -388,14 +404,20 @@ __decorateClass([
388
404
  property({ type: Boolean })
389
405
  ], UUIComboboxElement.prototype, "open", 1);
390
406
  __decorateClass([
391
- property({ type: String })
407
+ property({ type: String, attribute: "close-label" })
392
408
  ], UUIComboboxElement.prototype, "closeLabel", 2);
393
409
  __decorateClass([
394
410
  property({ type: Boolean, reflect: true })
395
411
  ], UUIComboboxElement.prototype, "disabled", 2);
412
+ __decorateClass([
413
+ property({ type: Boolean, reflect: false, attribute: "hide-expand-symbol" })
414
+ ], UUIComboboxElement.prototype, "hideExpandSymbol", 2);
396
415
  __decorateClass([
397
416
  property({ type: Boolean, reflect: true })
398
417
  ], UUIComboboxElement.prototype, "readonly", 2);
418
+ __decorateClass([
419
+ property()
420
+ ], UUIComboboxElement.prototype, "placeholder", 2);
399
421
  __decorateClass([
400
422
  query("#combobox-input")
401
423
  ], UUIComboboxElement.prototype, "_input", 2);
@@ -44,6 +44,13 @@ export declare class UUIComboboxElement extends UUIComboboxElement_base {
44
44
  * @default false
45
45
  */
46
46
  disabled: boolean;
47
+ /**
48
+ * Removes the expand symbol.
49
+ * @type {boolean}
50
+ * @attr
51
+ * @default false
52
+ */
53
+ hideExpandSymbol: boolean;
47
54
  /**
48
55
  * Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
49
56
  * @type {boolean}
@@ -51,6 +58,13 @@ export declare class UUIComboboxElement extends UUIComboboxElement_base {
51
58
  * @default false
52
59
  */
53
60
  readonly: boolean;
61
+ /**
62
+ * Defines the input placeholder.
63
+ * @type {string}
64
+ * @attr
65
+ * @default ''
66
+ */
67
+ placeholder: string;
54
68
  private _input;
55
69
  private _comboboxPopoverElement?;
56
70
  private _comboboxListElements?;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ui/uui-combobox",
3
- "version": "1.14.0-rc.4",
3
+ "version": "1.14.1",
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.14.0-rc.4",
34
- "@umbraco-ui/uui-button": "1.14.0-rc.4",
35
- "@umbraco-ui/uui-combobox-list": "1.14.0-rc.4",
36
- "@umbraco-ui/uui-icon": "1.14.0-rc.4",
37
- "@umbraco-ui/uui-popover-container": "1.14.0-rc.4",
38
- "@umbraco-ui/uui-scroll-container": "1.14.0-rc.4",
39
- "@umbraco-ui/uui-symbol-expand": "1.14.0-rc.4"
33
+ "@umbraco-ui/uui-base": "1.14.1",
34
+ "@umbraco-ui/uui-button": "1.14.1",
35
+ "@umbraco-ui/uui-combobox-list": "1.14.1",
36
+ "@umbraco-ui/uui-icon": "1.14.1",
37
+ "@umbraco-ui/uui-popover-container": "1.14.1",
38
+ "@umbraco-ui/uui-scroll-container": "1.14.1",
39
+ "@umbraco-ui/uui-symbol-expand": "1.14.1"
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": "8f89db559dfdb60e8afd8a0dc297e2f248f2fb9d"
50
+ "gitHead": "1dc16cf95e7f45ee85c8000c4932e827466e5229"
51
51
  }