@umbraco-ui/uui-combobox 1.2.0 → 1.3.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/custom-elements.json +14 -1
- package/lib/UUIComboboxEvent.d.ts +1 -0
- package/lib/index.js +32 -5
- package/lib/uui-combobox.element.d.ts +8 -1
- package/package.json +8 -8
package/custom-elements.json
CHANGED
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
"type": " string ",
|
|
24
24
|
"default": "\"\\\"Close\\\"\""
|
|
25
25
|
},
|
|
26
|
+
{
|
|
27
|
+
"name": "disabled",
|
|
28
|
+
"description": "Disables the uui-combobox.",
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"default": "\"false\""
|
|
31
|
+
},
|
|
26
32
|
{
|
|
27
33
|
"name": "name",
|
|
28
34
|
"description": "This is a name property of the component.",
|
|
@@ -93,6 +99,13 @@
|
|
|
93
99
|
"type": " string ",
|
|
94
100
|
"default": "\"\\\"Close\\\"\""
|
|
95
101
|
},
|
|
102
|
+
{
|
|
103
|
+
"name": "disabled",
|
|
104
|
+
"attribute": "disabled",
|
|
105
|
+
"description": "Disables the uui-combobox.",
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"default": "\"false\""
|
|
108
|
+
},
|
|
96
109
|
{
|
|
97
110
|
"name": "formAssociated",
|
|
98
111
|
"description": "This is a static class field indicating that the element is can be used inside a native form and participate in its events.\nIt may require a polyfill, check support here https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals.\nRead more about form controls here https://web.dev/more-capable-form-controls/",
|
|
@@ -168,7 +181,7 @@
|
|
|
168
181
|
],
|
|
169
182
|
"slots": [
|
|
170
183
|
{
|
|
171
|
-
"name": "
|
|
184
|
+
"name": "",
|
|
172
185
|
"description": "for uui-combobox-list-options"
|
|
173
186
|
},
|
|
174
187
|
{
|
package/lib/index.js
CHANGED
|
@@ -7,7 +7,26 @@ import { LitElement, html, css } from 'lit';
|
|
|
7
7
|
import { property, query, queryAssignedElements, state } from 'lit/decorators.js';
|
|
8
8
|
import { UUIEvent } from '@umbraco-ui/uui-base/lib/events';
|
|
9
9
|
|
|
10
|
+
var __defProp$1 = Object.defineProperty;
|
|
11
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
12
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15
|
+
var __spreadValues = (a, b) => {
|
|
16
|
+
for (var prop in b || (b = {}))
|
|
17
|
+
if (__hasOwnProp.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
if (__getOwnPropSymbols)
|
|
20
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
21
|
+
if (__propIsEnum.call(b, prop))
|
|
22
|
+
__defNormalProp(a, prop, b[prop]);
|
|
23
|
+
}
|
|
24
|
+
return a;
|
|
25
|
+
};
|
|
10
26
|
class UUIComboboxEvent extends UUIEvent {
|
|
27
|
+
constructor(evName, eventInit = {}) {
|
|
28
|
+
super(evName, __spreadValues(__spreadValues({}, { bubbles: true }), eventInit));
|
|
29
|
+
}
|
|
11
30
|
}
|
|
12
31
|
UUIComboboxEvent.SEARCH = "search";
|
|
13
32
|
UUIComboboxEvent.CHANGE = "change";
|
|
@@ -28,6 +47,7 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
|
|
|
28
47
|
super(...arguments);
|
|
29
48
|
this.open = false;
|
|
30
49
|
this.closeLabel = "Close";
|
|
50
|
+
this.disabled = false;
|
|
31
51
|
this._displayValue = "";
|
|
32
52
|
this._search = "";
|
|
33
53
|
this._isPhone = false;
|
|
@@ -54,9 +74,8 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
|
|
|
54
74
|
this._updateValue(this.value);
|
|
55
75
|
}
|
|
56
76
|
};
|
|
57
|
-
this._onChange = (
|
|
77
|
+
this._onChange = () => {
|
|
58
78
|
var _a;
|
|
59
|
-
e.stopImmediatePropagation();
|
|
60
79
|
this.value = ((_a = this._comboboxList) == null ? void 0 : _a.value) || "";
|
|
61
80
|
this.search = this.value ? this.search : "";
|
|
62
81
|
this._onClose();
|
|
@@ -107,11 +126,12 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
|
|
|
107
126
|
type="text"
|
|
108
127
|
.value=${this._displayValue}
|
|
109
128
|
autocomplete="off"
|
|
129
|
+
.disabled=${this.disabled}
|
|
110
130
|
@click=${this._open}
|
|
111
131
|
@input=${this._onInput}
|
|
112
132
|
@keydown=${this._onKeyDown}>
|
|
113
133
|
<slot name="input-prepend" slot="prepend"></slot>
|
|
114
|
-
${this._renderClearButton()} ${this._renderCaret()}
|
|
134
|
+
${this.disabled ? "" : this._renderClearButton()} ${this._renderCaret()}
|
|
115
135
|
<slot name="input-append" slot="append"></slot>
|
|
116
136
|
</uui-input>`;
|
|
117
137
|
};
|
|
@@ -190,7 +210,7 @@ let UUIComboboxElement = class extends FormControlMixin(LitElement) {
|
|
|
190
210
|
this._onChange
|
|
191
211
|
);
|
|
192
212
|
this._comboboxList.addEventListener(
|
|
193
|
-
UUIComboboxListEvent.
|
|
213
|
+
UUIComboboxListEvent.INNER_SLOT_CHANGE,
|
|
194
214
|
this._onSlotChange
|
|
195
215
|
);
|
|
196
216
|
await this.updateComplete;
|
|
@@ -253,7 +273,7 @@ UUIComboboxElement.styles = [
|
|
|
253
273
|
var(--uui-color-surface,#fff)
|
|
254
274
|
);
|
|
255
275
|
border: 1px solid var(--uui-color-border,#d8d7d9);
|
|
256
|
-
border-radius: var(--uui-border-radius,
|
|
276
|
+
border-radius: var(--uui-border-radius,var(--uui-size-1));
|
|
257
277
|
width: 100%;
|
|
258
278
|
height: 100%;
|
|
259
279
|
box-sizing: border-box;
|
|
@@ -268,6 +288,10 @@ UUIComboboxElement.styles = [
|
|
|
268
288
|
margin-top: -1px;
|
|
269
289
|
}
|
|
270
290
|
|
|
291
|
+
:host([disabled]) #caret {
|
|
292
|
+
fill: var(--uui-color-disabled-contrast,var(--uui-palette-grey));
|
|
293
|
+
}
|
|
294
|
+
|
|
271
295
|
#phone-wrapper {
|
|
272
296
|
position: fixed;
|
|
273
297
|
inset: 0;
|
|
@@ -307,6 +331,9 @@ __decorateClass([
|
|
|
307
331
|
__decorateClass([
|
|
308
332
|
property({ type: String })
|
|
309
333
|
], UUIComboboxElement.prototype, "closeLabel", 2);
|
|
334
|
+
__decorateClass([
|
|
335
|
+
property({ type: Boolean, reflect: true })
|
|
336
|
+
], UUIComboboxElement.prototype, "disabled", 2);
|
|
310
337
|
__decorateClass([
|
|
311
338
|
query("#combobox-input")
|
|
312
339
|
], UUIComboboxElement.prototype, "_input", 2);
|
|
@@ -4,7 +4,7 @@ declare const UUIComboboxElement_base: (new (...args: any[]) => import("@umbraco
|
|
|
4
4
|
* @element uui-combobox
|
|
5
5
|
* @fires {UUIComboboxEvent} input - fires when search input is changed
|
|
6
6
|
* @fires {UUIComboboxEvent} change - fires when selection is changed
|
|
7
|
-
* @slot
|
|
7
|
+
* @slot - for uui-combobox-list-options
|
|
8
8
|
* @slot input-prepend - prepend for the uui-input
|
|
9
9
|
* @slot input-append - append for the uui-input
|
|
10
10
|
* @description - Filterable combobox
|
|
@@ -35,6 +35,13 @@ export declare class UUIComboboxElement extends UUIComboboxElement_base {
|
|
|
35
35
|
* @default "Close"
|
|
36
36
|
*/
|
|
37
37
|
closeLabel: string;
|
|
38
|
+
/**
|
|
39
|
+
* Disables the uui-combobox.
|
|
40
|
+
* @type {boolean}
|
|
41
|
+
* @attr
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
disabled: boolean;
|
|
38
45
|
private _input;
|
|
39
46
|
private _comboboxListElements?;
|
|
40
47
|
private _comboboxList;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-combobox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -30,20 +30,20 @@
|
|
|
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-scroll-container": "1.
|
|
33
|
+
"@umbraco-ui/uui-base": "1.3.0-rc.0",
|
|
34
|
+
"@umbraco-ui/uui-button": "1.3.0-rc.0",
|
|
35
|
+
"@umbraco-ui/uui-combobox-list": "1.3.0-rc.0",
|
|
36
|
+
"@umbraco-ui/uui-icon": "1.3.0-rc.0",
|
|
37
|
+
"@umbraco-ui/uui-scroll-container": "1.3.0-rc.0"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
|
|
41
|
-
"clean": "tsc --build --clean && rimraf dist lib/*.js lib/**/*.js custom-elements.json",
|
|
41
|
+
"clean": "tsc --build --clean && rimraf -g dist lib/*.js lib/**/*.js custom-elements.json",
|
|
42
42
|
"analyze": "web-component-analyzer **/*.element.ts --outFile custom-elements.json"
|
|
43
43
|
},
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-combobox",
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "45c3824056586d9817efb3f61dc0bef5478747f0"
|
|
49
49
|
}
|