@umbraco-ui/uui-combobox 1.0.0-rc.3 → 1.1.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 +19 -28
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { FormControlMixin } from '@umbraco-ui/uui-base/lib/mixins';
|
|
1
2
|
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
|
|
2
3
|
import { demandCustomElement } from '@umbraco-ui/uui-base/lib/utils';
|
|
3
|
-
import { property, query, queryAssignedElements, state } from 'lit/decorators.js';
|
|
4
|
-
import { LitElement, html, css } from 'lit';
|
|
5
|
-
import { UUIEvent } from '@umbraco-ui/uui-base/lib/events';
|
|
6
4
|
import { UUIComboboxListEvent } from '@umbraco-ui/uui-combobox-list/lib';
|
|
7
|
-
import { FormControlMixin } from '@umbraco-ui/uui-base/lib/mixins';
|
|
8
5
|
import { iconRemove } from '@umbraco-ui/uui-icon-registry-essential/lib/svgs';
|
|
6
|
+
import { LitElement, html, css } from 'lit';
|
|
7
|
+
import { property, query, queryAssignedElements, state } from 'lit/decorators.js';
|
|
8
|
+
import { UUIEvent } from '@umbraco-ui/uui-base/lib/events';
|
|
9
9
|
|
|
10
10
|
class UUIComboboxEvent extends UUIEvent {
|
|
11
11
|
}
|
|
@@ -31,7 +31,8 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
|
|
|
31
31
|
this._search = "";
|
|
32
32
|
this._onMouseDown = () => requestAnimationFrame(() => this._input.focus());
|
|
33
33
|
this._onBlur = () => requestAnimationFrame(() => {
|
|
34
|
-
|
|
34
|
+
var _a;
|
|
35
|
+
if (!((_a = this.shadowRoot) == null ? void 0 : _a.activeElement)) {
|
|
35
36
|
this._onClose();
|
|
36
37
|
}
|
|
37
38
|
});
|
|
@@ -83,6 +84,7 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
|
|
|
83
84
|
this.value = "";
|
|
84
85
|
this.search = "";
|
|
85
86
|
this._input.value = this._displayValue;
|
|
87
|
+
this._input.focus();
|
|
86
88
|
this.dispatchEvent(new UUIComboboxEvent(UUIComboboxEvent.SEARCH));
|
|
87
89
|
this.dispatchEvent(new UUIComboboxEvent(UUIComboboxEvent.CHANGE));
|
|
88
90
|
};
|
|
@@ -108,21 +110,20 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
|
|
|
108
110
|
</svg>`;
|
|
109
111
|
};
|
|
110
112
|
this._renderClearButton = () => {
|
|
111
|
-
return html`<uui-button
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
</uui-button>`;
|
|
113
|
+
return this.value || this.search ? html`<uui-button
|
|
114
|
+
id="clear-button"
|
|
115
|
+
@click=${this._onClear}
|
|
116
|
+
@keydown=${this._onClear}
|
|
117
|
+
label="clear"
|
|
118
|
+
slot="append"
|
|
119
|
+
compact
|
|
120
|
+
style="height: 100%;">
|
|
121
|
+
<uui-icon name="remove" .fallback=${iconRemove.strings[0]}></uui-icon>
|
|
122
|
+
</uui-button>` : "";
|
|
122
123
|
};
|
|
123
124
|
this._renderDropdown = () => {
|
|
124
125
|
return html`<div id="dropdown" slot="popover">
|
|
125
|
-
<uui-scroll-container id="scroll-container">
|
|
126
|
+
<uui-scroll-container tabindex="-1" id="scroll-container">
|
|
126
127
|
<slot></slot>
|
|
127
128
|
</uui-scroll-container>
|
|
128
129
|
</div>`;
|
|
@@ -156,6 +157,7 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
|
|
|
156
157
|
demandCustomElement(this, "uui-button");
|
|
157
158
|
demandCustomElement(this, "uui-combobox-list");
|
|
158
159
|
demandCustomElement(this, "uui-scroll-container");
|
|
160
|
+
demandCustomElement(this, "uui-popover");
|
|
159
161
|
}
|
|
160
162
|
disconnectedCallback() {
|
|
161
163
|
super.disconnectedCallback();
|
|
@@ -231,17 +233,6 @@ UUIComboboxElement.styles = [
|
|
|
231
233
|
box-shadow: var(--uui-shadow-depth-3,0 10px 20px rgba(0,0,0,0.19) , 0 6px 6px rgba(0,0,0,0.23));
|
|
232
234
|
}
|
|
233
235
|
|
|
234
|
-
#clear-button {
|
|
235
|
-
pointer-events: none;
|
|
236
|
-
opacity: 0;
|
|
237
|
-
transition: opacity 120ms;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
#clear-button.--show {
|
|
241
|
-
pointer-events: auto;
|
|
242
|
-
opacity: 1;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
236
|
#caret {
|
|
246
237
|
margin-right: var(--uui-size-3, 9px);
|
|
247
238
|
display: flex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-combobox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.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.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"
|
|
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": "
|
|
48
|
+
"gitHead": "6bd054ecff37c2b7ddfe2beed0f83bf29c58501d"
|
|
49
49
|
}
|