@aurodesignsystem/auro-formkit 3.4.1-rc-602.2.1 → 3.5.0-rc-627.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.
- package/components/checkbox/demo/api.md +1 -1
- package/components/checkbox/demo/api.min.js +31 -8
- package/components/checkbox/demo/index.min.js +31 -8
- package/components/checkbox/dist/auro-checkbox.d.ts +13 -6
- package/components/checkbox/dist/index.js +31 -8
- package/components/checkbox/dist/registered.js +31 -8
- package/components/combobox/demo/api.md +25 -25
- package/components/combobox/demo/api.min.js +48 -13
- package/components/combobox/demo/index.min.js +48 -13
- package/components/combobox/dist/auro-combobox.d.ts +2 -4
- package/components/combobox/dist/index.js +47 -12
- package/components/combobox/dist/registered.js +47 -12
- package/components/counter/demo/api.min.js +14 -1
- package/components/counter/demo/index.min.js +14 -1
- package/components/counter/dist/index.js +14 -1
- package/components/counter/dist/registered.js +14 -1
- package/components/datepicker/demo/api.min.js +45 -12
- package/components/datepicker/demo/index.min.js +45 -12
- package/components/datepicker/dist/index.js +45 -12
- package/components/datepicker/dist/registered.js +45 -12
- package/components/form/demo/api.md +1 -5
- package/components/form/demo/api.min.js +8 -2
- package/components/form/demo/index.html +1 -0
- package/components/form/demo/index.md +321 -27
- package/components/form/demo/index.min.js +8 -2
- package/components/form/demo/registerDemoDeps.js +1 -0
- package/components/form/dist/auro-form.d.ts +12 -6
- package/components/form/dist/index.js +8 -2
- package/components/form/dist/registered.js +8 -2
- package/components/input/demo/api.md +1 -1
- package/components/input/demo/api.min.js +31 -11
- package/components/input/demo/index.min.js +31 -11
- package/components/input/dist/base-input.d.ts +13 -6
- package/components/input/dist/index.js +31 -11
- package/components/input/dist/registered.js +31 -11
- package/components/menu/demo/api.md +11 -17
- package/components/menu/demo/api.min.js +1 -1
- package/components/menu/demo/index.min.js +1 -1
- package/components/menu/dist/auro-menu.d.ts +1 -1
- package/components/menu/dist/index.js +1 -1
- package/components/menu/dist/registered.js +1 -1
- package/components/radio/demo/api.md +1 -1
- package/components/radio/demo/api.min.js +32 -4
- package/components/radio/demo/index.min.js +32 -4
- package/components/radio/dist/auro-radio.d.ts +14 -3
- package/components/radio/dist/index.js +32 -4
- package/components/radio/dist/registered.js +32 -4
- package/components/select/demo/api.html +15 -0
- package/components/select/demo/api.md +178 -0
- package/components/select/demo/api.min.js +84 -3
- package/components/select/demo/index.html +15 -0
- package/components/select/demo/index.md +177 -0
- package/components/select/demo/index.min.js +84 -3
- package/components/select/dist/auro-select.d.ts +27 -0
- package/components/select/dist/index.js +84 -2
- package/components/select/dist/registered.js +84 -2
- package/package.json +1 -1
|
@@ -4776,7 +4776,20 @@ class AuroFormValidation {
|
|
|
4776
4776
|
* The validityState definitions are located at https://developer.mozilla.org/en-US/docs/Web/API/ValidityState.
|
|
4777
4777
|
*/
|
|
4778
4778
|
|
|
4779
|
-
let hasValue =
|
|
4779
|
+
let hasValue = false;
|
|
4780
|
+
|
|
4781
|
+
// Check string for having a value
|
|
4782
|
+
if (typeof elem.value === "string") {
|
|
4783
|
+
hasValue = elem.value && elem.value.length > 0;
|
|
4784
|
+
}
|
|
4785
|
+
|
|
4786
|
+
// Check array value types for having a value
|
|
4787
|
+
if (Array.isArray(elem.value)) {
|
|
4788
|
+
hasValue = Boolean(
|
|
4789
|
+
elem.value.length > 0 &&
|
|
4790
|
+
elem.value.some((value) => typeof value === "string" && value.length > 0)
|
|
4791
|
+
);
|
|
4792
|
+
}
|
|
4780
4793
|
|
|
4781
4794
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
4782
4795
|
if (this.auroInputElements?.length === 2) {
|
|
@@ -4890,6 +4903,9 @@ class AuroFormValidation {
|
|
|
4890
4903
|
* @attr {Boolean} bordered - Applies bordered UI variant.
|
|
4891
4904
|
* @attr {Boolean} borderless - Applies borderless UI variant.
|
|
4892
4905
|
*
|
|
4906
|
+
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
4907
|
+
* @attr id
|
|
4908
|
+
*
|
|
4893
4909
|
* @slot helptext - Sets the help text displayed below the input.
|
|
4894
4910
|
* @slot label - Sets the label text for the input.
|
|
4895
4911
|
*
|
|
@@ -5080,13 +5096,6 @@ class BaseInput extends i {
|
|
|
5080
5096
|
reflect: true
|
|
5081
5097
|
},
|
|
5082
5098
|
|
|
5083
|
-
/**
|
|
5084
|
-
* Sets the unique ID of the element.
|
|
5085
|
-
*/
|
|
5086
|
-
id: {
|
|
5087
|
-
type: String
|
|
5088
|
-
},
|
|
5089
|
-
|
|
5090
5099
|
/** Exposes inputmode attribute for input. */
|
|
5091
5100
|
inputmode: {
|
|
5092
5101
|
type: String,
|
|
@@ -5307,6 +5316,16 @@ class BaseInput extends i {
|
|
|
5307
5316
|
type: Boolean,
|
|
5308
5317
|
reflect: true,
|
|
5309
5318
|
attribute: false
|
|
5319
|
+
},
|
|
5320
|
+
|
|
5321
|
+
/**
|
|
5322
|
+
* @private
|
|
5323
|
+
* id for input node
|
|
5324
|
+
*/
|
|
5325
|
+
inputId: {
|
|
5326
|
+
type: String,
|
|
5327
|
+
reflect: false,
|
|
5328
|
+
attribute: false
|
|
5310
5329
|
}
|
|
5311
5330
|
};
|
|
5312
5331
|
}
|
|
@@ -5338,6 +5357,7 @@ class BaseInput extends i {
|
|
|
5338
5357
|
if (this.tagName.toLowerCase() !== 'auro-input') {
|
|
5339
5358
|
this.setAttribute('auro-input', true);
|
|
5340
5359
|
}
|
|
5360
|
+
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
5341
5361
|
|
|
5342
5362
|
this.inputElement = this.renderRoot.querySelector('input');
|
|
5343
5363
|
this.labelElement = this.shadowRoot.querySelector('label');
|
|
@@ -7003,7 +7023,7 @@ class AuroInput extends BaseInput {
|
|
|
7003
7023
|
: undefined
|
|
7004
7024
|
}
|
|
7005
7025
|
</div>
|
|
7006
|
-
<label for=${this.
|
|
7026
|
+
<label for=${this.inputId} class="${e$2(labelClasses)}" part="label">
|
|
7007
7027
|
<slot name="label">
|
|
7008
7028
|
${this.label}
|
|
7009
7029
|
</slot>
|
|
@@ -7013,7 +7033,7 @@ class AuroInput extends BaseInput {
|
|
|
7013
7033
|
@input="${this.handleInput}"
|
|
7014
7034
|
@focusin="${this.handleFocusin}"
|
|
7015
7035
|
@blur="${this.handleBlur}"
|
|
7016
|
-
id="${this.
|
|
7036
|
+
id="${this.inputId}"
|
|
7017
7037
|
name="${o$3(this.name)}"
|
|
7018
7038
|
type="${this.type === 'password' && this.showPassword ? 'text' : this.getInputType(this.type)}"
|
|
7019
7039
|
pattern="${o$3(this.definePattern())}"
|
|
@@ -7081,7 +7101,7 @@ class AuroInput extends BaseInput {
|
|
|
7081
7101
|
variant="flat"
|
|
7082
7102
|
?onDark="${this.onDark}"
|
|
7083
7103
|
class="notificationBtn clearBtn"
|
|
7084
|
-
|
|
7104
|
+
arialabel="${i18n(this.lang, 'clearInput')}"
|
|
7085
7105
|
@click="${this.handleClickClear}">
|
|
7086
7106
|
<${this.iconTag}
|
|
7087
7107
|
customColor
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* @attr {Boolean} bordered - Applies bordered UI variant.
|
|
5
5
|
* @attr {Boolean} borderless - Applies borderless UI variant.
|
|
6
6
|
*
|
|
7
|
+
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
8
|
+
* @attr id
|
|
9
|
+
*
|
|
7
10
|
* @slot helptext - Sets the help text displayed below the input.
|
|
8
11
|
* @slot label - Sets the label text for the input.
|
|
9
12
|
*
|
|
@@ -101,12 +104,6 @@ export default class BaseInput extends LitElement {
|
|
|
101
104
|
type: BooleanConstructor;
|
|
102
105
|
reflect: boolean;
|
|
103
106
|
};
|
|
104
|
-
/**
|
|
105
|
-
* Sets the unique ID of the element.
|
|
106
|
-
*/
|
|
107
|
-
id: {
|
|
108
|
-
type: StringConstructor;
|
|
109
|
-
};
|
|
110
107
|
/** Exposes inputmode attribute for input. */
|
|
111
108
|
inputmode: {
|
|
112
109
|
type: StringConstructor;
|
|
@@ -295,6 +292,15 @@ export default class BaseInput extends LitElement {
|
|
|
295
292
|
* @private
|
|
296
293
|
*/
|
|
297
294
|
touched: boolean;
|
|
295
|
+
/**
|
|
296
|
+
* @private
|
|
297
|
+
* id for input node
|
|
298
|
+
*/
|
|
299
|
+
inputId: {
|
|
300
|
+
type: StringConstructor;
|
|
301
|
+
reflect: boolean;
|
|
302
|
+
attribute: boolean;
|
|
303
|
+
};
|
|
298
304
|
};
|
|
299
305
|
static get styles(): import("lit").CSSResult[];
|
|
300
306
|
icon: boolean;
|
|
@@ -346,6 +352,7 @@ export default class BaseInput extends LitElement {
|
|
|
346
352
|
};
|
|
347
353
|
uniqueId: string;
|
|
348
354
|
firstUpdated(): void;
|
|
355
|
+
inputId: string;
|
|
349
356
|
inputElement: HTMLInputElement;
|
|
350
357
|
labelElement: HTMLLabelElement;
|
|
351
358
|
format: any;
|
|
@@ -4700,7 +4700,20 @@ class AuroFormValidation {
|
|
|
4700
4700
|
* The validityState definitions are located at https://developer.mozilla.org/en-US/docs/Web/API/ValidityState.
|
|
4701
4701
|
*/
|
|
4702
4702
|
|
|
4703
|
-
let hasValue =
|
|
4703
|
+
let hasValue = false;
|
|
4704
|
+
|
|
4705
|
+
// Check string for having a value
|
|
4706
|
+
if (typeof elem.value === "string") {
|
|
4707
|
+
hasValue = elem.value && elem.value.length > 0;
|
|
4708
|
+
}
|
|
4709
|
+
|
|
4710
|
+
// Check array value types for having a value
|
|
4711
|
+
if (Array.isArray(elem.value)) {
|
|
4712
|
+
hasValue = Boolean(
|
|
4713
|
+
elem.value.length > 0 &&
|
|
4714
|
+
elem.value.some((value) => typeof value === "string" && value.length > 0)
|
|
4715
|
+
);
|
|
4716
|
+
}
|
|
4704
4717
|
|
|
4705
4718
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
4706
4719
|
if (this.auroInputElements?.length === 2) {
|
|
@@ -4814,6 +4827,9 @@ class AuroFormValidation {
|
|
|
4814
4827
|
* @attr {Boolean} bordered - Applies bordered UI variant.
|
|
4815
4828
|
* @attr {Boolean} borderless - Applies borderless UI variant.
|
|
4816
4829
|
*
|
|
4830
|
+
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
4831
|
+
* @attr id
|
|
4832
|
+
*
|
|
4817
4833
|
* @slot helptext - Sets the help text displayed below the input.
|
|
4818
4834
|
* @slot label - Sets the label text for the input.
|
|
4819
4835
|
*
|
|
@@ -5004,13 +5020,6 @@ class BaseInput extends LitElement {
|
|
|
5004
5020
|
reflect: true
|
|
5005
5021
|
},
|
|
5006
5022
|
|
|
5007
|
-
/**
|
|
5008
|
-
* Sets the unique ID of the element.
|
|
5009
|
-
*/
|
|
5010
|
-
id: {
|
|
5011
|
-
type: String
|
|
5012
|
-
},
|
|
5013
|
-
|
|
5014
5023
|
/** Exposes inputmode attribute for input. */
|
|
5015
5024
|
inputmode: {
|
|
5016
5025
|
type: String,
|
|
@@ -5231,6 +5240,16 @@ class BaseInput extends LitElement {
|
|
|
5231
5240
|
type: Boolean,
|
|
5232
5241
|
reflect: true,
|
|
5233
5242
|
attribute: false
|
|
5243
|
+
},
|
|
5244
|
+
|
|
5245
|
+
/**
|
|
5246
|
+
* @private
|
|
5247
|
+
* id for input node
|
|
5248
|
+
*/
|
|
5249
|
+
inputId: {
|
|
5250
|
+
type: String,
|
|
5251
|
+
reflect: false,
|
|
5252
|
+
attribute: false
|
|
5234
5253
|
}
|
|
5235
5254
|
};
|
|
5236
5255
|
}
|
|
@@ -5262,6 +5281,7 @@ class BaseInput extends LitElement {
|
|
|
5262
5281
|
if (this.tagName.toLowerCase() !== 'auro-input') {
|
|
5263
5282
|
this.setAttribute('auro-input', true);
|
|
5264
5283
|
}
|
|
5284
|
+
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
5265
5285
|
|
|
5266
5286
|
this.inputElement = this.renderRoot.querySelector('input');
|
|
5267
5287
|
this.labelElement = this.shadowRoot.querySelector('label');
|
|
@@ -6927,7 +6947,7 @@ class AuroInput extends BaseInput {
|
|
|
6927
6947
|
: undefined
|
|
6928
6948
|
}
|
|
6929
6949
|
</div>
|
|
6930
|
-
<label for=${this.
|
|
6950
|
+
<label for=${this.inputId} class="${classMap(labelClasses)}" part="label">
|
|
6931
6951
|
<slot name="label">
|
|
6932
6952
|
${this.label}
|
|
6933
6953
|
</slot>
|
|
@@ -6937,7 +6957,7 @@ class AuroInput extends BaseInput {
|
|
|
6937
6957
|
@input="${this.handleInput}"
|
|
6938
6958
|
@focusin="${this.handleFocusin}"
|
|
6939
6959
|
@blur="${this.handleBlur}"
|
|
6940
|
-
id="${this.
|
|
6960
|
+
id="${this.inputId}"
|
|
6941
6961
|
name="${ifDefined(this.name)}"
|
|
6942
6962
|
type="${this.type === 'password' && this.showPassword ? 'text' : this.getInputType(this.type)}"
|
|
6943
6963
|
pattern="${ifDefined(this.definePattern())}"
|
|
@@ -7005,7 +7025,7 @@ class AuroInput extends BaseInput {
|
|
|
7005
7025
|
variant="flat"
|
|
7006
7026
|
?onDark="${this.onDark}"
|
|
7007
7027
|
class="notificationBtn clearBtn"
|
|
7008
|
-
|
|
7028
|
+
arialabel="${i18n(this.lang, 'clearInput')}"
|
|
7009
7029
|
@click="${this.handleClickClear}">
|
|
7010
7030
|
<${this.iconTag}
|
|
7011
7031
|
customColor
|
|
@@ -4700,7 +4700,20 @@ class AuroFormValidation {
|
|
|
4700
4700
|
* The validityState definitions are located at https://developer.mozilla.org/en-US/docs/Web/API/ValidityState.
|
|
4701
4701
|
*/
|
|
4702
4702
|
|
|
4703
|
-
let hasValue =
|
|
4703
|
+
let hasValue = false;
|
|
4704
|
+
|
|
4705
|
+
// Check string for having a value
|
|
4706
|
+
if (typeof elem.value === "string") {
|
|
4707
|
+
hasValue = elem.value && elem.value.length > 0;
|
|
4708
|
+
}
|
|
4709
|
+
|
|
4710
|
+
// Check array value types for having a value
|
|
4711
|
+
if (Array.isArray(elem.value)) {
|
|
4712
|
+
hasValue = Boolean(
|
|
4713
|
+
elem.value.length > 0 &&
|
|
4714
|
+
elem.value.some((value) => typeof value === "string" && value.length > 0)
|
|
4715
|
+
);
|
|
4716
|
+
}
|
|
4704
4717
|
|
|
4705
4718
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
4706
4719
|
if (this.auroInputElements?.length === 2) {
|
|
@@ -4814,6 +4827,9 @@ class AuroFormValidation {
|
|
|
4814
4827
|
* @attr {Boolean} bordered - Applies bordered UI variant.
|
|
4815
4828
|
* @attr {Boolean} borderless - Applies borderless UI variant.
|
|
4816
4829
|
*
|
|
4830
|
+
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
4831
|
+
* @attr id
|
|
4832
|
+
*
|
|
4817
4833
|
* @slot helptext - Sets the help text displayed below the input.
|
|
4818
4834
|
* @slot label - Sets the label text for the input.
|
|
4819
4835
|
*
|
|
@@ -5004,13 +5020,6 @@ class BaseInput extends LitElement {
|
|
|
5004
5020
|
reflect: true
|
|
5005
5021
|
},
|
|
5006
5022
|
|
|
5007
|
-
/**
|
|
5008
|
-
* Sets the unique ID of the element.
|
|
5009
|
-
*/
|
|
5010
|
-
id: {
|
|
5011
|
-
type: String
|
|
5012
|
-
},
|
|
5013
|
-
|
|
5014
5023
|
/** Exposes inputmode attribute for input. */
|
|
5015
5024
|
inputmode: {
|
|
5016
5025
|
type: String,
|
|
@@ -5231,6 +5240,16 @@ class BaseInput extends LitElement {
|
|
|
5231
5240
|
type: Boolean,
|
|
5232
5241
|
reflect: true,
|
|
5233
5242
|
attribute: false
|
|
5243
|
+
},
|
|
5244
|
+
|
|
5245
|
+
/**
|
|
5246
|
+
* @private
|
|
5247
|
+
* id for input node
|
|
5248
|
+
*/
|
|
5249
|
+
inputId: {
|
|
5250
|
+
type: String,
|
|
5251
|
+
reflect: false,
|
|
5252
|
+
attribute: false
|
|
5234
5253
|
}
|
|
5235
5254
|
};
|
|
5236
5255
|
}
|
|
@@ -5262,6 +5281,7 @@ class BaseInput extends LitElement {
|
|
|
5262
5281
|
if (this.tagName.toLowerCase() !== 'auro-input') {
|
|
5263
5282
|
this.setAttribute('auro-input', true);
|
|
5264
5283
|
}
|
|
5284
|
+
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
5265
5285
|
|
|
5266
5286
|
this.inputElement = this.renderRoot.querySelector('input');
|
|
5267
5287
|
this.labelElement = this.shadowRoot.querySelector('label');
|
|
@@ -6927,7 +6947,7 @@ class AuroInput extends BaseInput {
|
|
|
6927
6947
|
: undefined
|
|
6928
6948
|
}
|
|
6929
6949
|
</div>
|
|
6930
|
-
<label for=${this.
|
|
6950
|
+
<label for=${this.inputId} class="${classMap(labelClasses)}" part="label">
|
|
6931
6951
|
<slot name="label">
|
|
6932
6952
|
${this.label}
|
|
6933
6953
|
</slot>
|
|
@@ -6937,7 +6957,7 @@ class AuroInput extends BaseInput {
|
|
|
6937
6957
|
@input="${this.handleInput}"
|
|
6938
6958
|
@focusin="${this.handleFocusin}"
|
|
6939
6959
|
@blur="${this.handleBlur}"
|
|
6940
|
-
id="${this.
|
|
6960
|
+
id="${this.inputId}"
|
|
6941
6961
|
name="${ifDefined(this.name)}"
|
|
6942
6962
|
type="${this.type === 'password' && this.showPassword ? 'text' : this.getInputType(this.type)}"
|
|
6943
6963
|
pattern="${ifDefined(this.definePattern())}"
|
|
@@ -7005,7 +7025,7 @@ class AuroInput extends BaseInput {
|
|
|
7005
7025
|
variant="flat"
|
|
7006
7026
|
?onDark="${this.onDark}"
|
|
7007
7027
|
class="notificationBtn clearBtn"
|
|
7008
|
-
|
|
7028
|
+
arialabel="${i18n(this.lang, 'clearInput')}"
|
|
7009
7029
|
@click="${this.handleClickClear}">
|
|
7010
7030
|
<${this.iconTag}
|
|
7011
7031
|
customColor
|
|
@@ -5,25 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
The auro-menu element provides users a way to select from a list of options.
|
|
7
7
|
|
|
8
|
-
## Attributes
|
|
9
|
-
|
|
10
|
-
| Attribute | Type | Description |
|
|
11
|
-
|------------------|---------------------------------|--------------------------------------------------|
|
|
12
|
-
| [optionselected](#optionselected) | `Array<HTMLElement>\|undefined` | An array of currently selected menu options. In single-select mode, the array will contain only one HTMLElement. `undefined` when no options are selected. |
|
|
13
|
-
|
|
14
8
|
## Properties
|
|
15
9
|
|
|
16
|
-
| Property | Attribute | Type
|
|
17
|
-
|
|
18
|
-
| [disabled](#disabled) | `disabled` | `boolean`
|
|
19
|
-
| [hasLoadingPlaceholder](#hasLoadingPlaceholder) | | `boolean`
|
|
20
|
-
| [loading](#loading) | `loading` | `boolean`
|
|
21
|
-
| [matchWord](#matchWord) | `matchword` | `string`
|
|
22
|
-
| [multiSelect](#multiSelect) | `multiselect` | `boolean`
|
|
23
|
-
| [noCheckmark](#noCheckmark) | `nocheckmark` | `boolean`
|
|
24
|
-
| [optionActive](#optionActive) | `optionactive` | `object`
|
|
25
|
-
| [optionSelected](#optionSelected) | `optionSelected` |
|
|
26
|
-
| [value](#value) | `value` | `Array<string>\|undefined`
|
|
10
|
+
| Property | Attribute | Type | Default | Description |
|
|
11
|
+
|-------------------------|------------------|---------------------------------|-------------|--------------------------------------------------|
|
|
12
|
+
| [disabled](#disabled) | `disabled` | `boolean` | | When true, the entire menu and all options are disabled; |
|
|
13
|
+
| [hasLoadingPlaceholder](#hasLoadingPlaceholder) | | `boolean` | | Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state. |
|
|
14
|
+
| [loading](#loading) | `loading` | `boolean` | false | When true, displays a loading state using the loadingIcon and loadingText slots if provided. |
|
|
15
|
+
| [matchWord](#matchWord) | `matchword` | `string` | "undefined" | Specifies a string used to highlight matched string parts in options. |
|
|
16
|
+
| [multiSelect](#multiSelect) | `multiselect` | `boolean` | false | When true, the selected option can be multiple options. |
|
|
17
|
+
| [noCheckmark](#noCheckmark) | `nocheckmark` | `boolean` | false | When true, selected option will not show the checkmark. |
|
|
18
|
+
| [optionActive](#optionActive) | `optionactive` | `object` | "undefined" | Specifies the current active menuOption. |
|
|
19
|
+
| [optionSelected](#optionSelected) | `optionSelected` | `Array<HTMLElement>\|undefined` | "undefined" | An array of currently selected menu options. In single-select mode, the array will contain only one HTMLElement. `undefined` when no options are selected. |
|
|
20
|
+
| [value](#value) | `value` | `Array<string>\|undefined` | "undefined" | Value selected for the menu. `undefined` when no selection has been made, otherwise an array of strings. In single-select mode, the array will contain only one value. |
|
|
27
21
|
|
|
28
22
|
## Methods
|
|
29
23
|
|
|
@@ -280,7 +280,7 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
280
280
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
281
281
|
/**
|
|
282
282
|
* The auro-menu element provides users a way to select from a list of options.
|
|
283
|
-
* @attr {Array<HTMLElement>|undefined}
|
|
283
|
+
* @attr {Array<HTMLElement>|undefined} optionSelected - An array of currently selected menu options. In single-select mode, the array will contain only one HTMLElement. `undefined` when no options are selected.
|
|
284
284
|
* @attr {object} optionactive - Specifies the current active menuOption.
|
|
285
285
|
* @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
|
|
286
286
|
* @attr {boolean} disabled - When true, the entire menu and all options are disabled;
|
|
@@ -240,7 +240,7 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
240
240
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
241
241
|
/**
|
|
242
242
|
* The auro-menu element provides users a way to select from a list of options.
|
|
243
|
-
* @attr {Array<HTMLElement>|undefined}
|
|
243
|
+
* @attr {Array<HTMLElement>|undefined} optionSelected - An array of currently selected menu options. In single-select mode, the array will contain only one HTMLElement. `undefined` when no options are selected.
|
|
244
244
|
* @attr {object} optionactive - Specifies the current active menuOption.
|
|
245
245
|
* @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
|
|
246
246
|
* @attr {boolean} disabled - When true, the entire menu and all options are disabled;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The auro-menu element provides users a way to select from a list of options.
|
|
3
|
-
* @attr {Array<HTMLElement>|undefined}
|
|
3
|
+
* @attr {Array<HTMLElement>|undefined} optionSelected - An array of currently selected menu options. In single-select mode, the array will contain only one HTMLElement. `undefined` when no options are selected.
|
|
4
4
|
* @attr {object} optionactive - Specifies the current active menuOption.
|
|
5
5
|
* @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
|
|
6
6
|
* @attr {boolean} disabled - When true, the entire menu and all options are disabled;
|
|
@@ -219,7 +219,7 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
219
219
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
220
220
|
/**
|
|
221
221
|
* The auro-menu element provides users a way to select from a list of options.
|
|
222
|
-
* @attr {Array<HTMLElement>|undefined}
|
|
222
|
+
* @attr {Array<HTMLElement>|undefined} optionSelected - An array of currently selected menu options. In single-select mode, the array will contain only one HTMLElement. `undefined` when no options are selected.
|
|
223
223
|
* @attr {object} optionactive - Specifies the current active menuOption.
|
|
224
224
|
* @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
|
|
225
225
|
* @attr {boolean} disabled - When true, the entire menu and all options are disabled;
|
|
@@ -219,7 +219,7 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
219
219
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
220
220
|
/**
|
|
221
221
|
* The auro-menu element provides users a way to select from a list of options.
|
|
222
|
-
* @attr {Array<HTMLElement>|undefined}
|
|
222
|
+
* @attr {Array<HTMLElement>|undefined} optionSelected - An array of currently selected menu options. In single-select mode, the array will contain only one HTMLElement. `undefined` when no options are selected.
|
|
223
223
|
* @attr {object} optionactive - Specifies the current active menuOption.
|
|
224
224
|
* @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
|
|
225
225
|
* @attr {boolean} disabled - When true, the entire menu and all options are disabled;
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
| [checked](#checked) | `checked` | `Boolean` | false | If set to true, the radio button will be filled. |
|
|
58
58
|
| [disabled](#disabled) | `disabled` | `Boolean` | false | If set to true, the radio button will be non-clickable. |
|
|
59
59
|
| [error](#error) | `error` | `Boolean` | false | If set to true, sets an error state on the radio button. |
|
|
60
|
-
| [id](#id) | `id` | `string` | |
|
|
60
|
+
| [id](#id) | `id` | `string` | | The id global attribute defines an identifier (ID) which must be unique in the whole document. |
|
|
61
61
|
| [label](#label) | `label` | `string` | | |
|
|
62
62
|
| [name](#name) | `name` | `string` | | |
|
|
63
63
|
| [onDark](#onDark) | `onDark` | `Boolean` | false | If set to true, the component will render with a dark theme. |
|
|
@@ -157,6 +157,10 @@ let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
|
157
157
|
* @attr {Boolean} error - If set to true, sets an error state on the radio button.
|
|
158
158
|
* @attr {Boolean} onDark - If set to true, the component will render with a dark theme.
|
|
159
159
|
* @event toggleSelected - Notifies that the component has toggled the checked/selected state.
|
|
160
|
+
*
|
|
161
|
+
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
162
|
+
* @attr id
|
|
163
|
+
*
|
|
160
164
|
* @event focusSelected - Notifies that the component has gained focus.
|
|
161
165
|
* @event auroRadio-blur - Notifies that the component has lost focus.
|
|
162
166
|
* @event resetRadio - Notifies that the component has reset the checked/selected state.
|
|
@@ -212,7 +216,6 @@ class AuroRadio extends i$2 {
|
|
|
212
216
|
type: Boolean,
|
|
213
217
|
reflect: true
|
|
214
218
|
},
|
|
215
|
-
id: { type: String },
|
|
216
219
|
label: { type: String },
|
|
217
220
|
name: { type: String },
|
|
218
221
|
value: { type: String },
|
|
@@ -229,6 +232,16 @@ class AuroRadio extends i$2 {
|
|
|
229
232
|
type: Boolean,
|
|
230
233
|
reflect: true,
|
|
231
234
|
attribute: false
|
|
235
|
+
},
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* @private
|
|
239
|
+
* id for input node
|
|
240
|
+
*/
|
|
241
|
+
inputId: {
|
|
242
|
+
type: String,
|
|
243
|
+
reflect: false,
|
|
244
|
+
attribute: false
|
|
232
245
|
}
|
|
233
246
|
};
|
|
234
247
|
}
|
|
@@ -364,6 +377,8 @@ class AuroRadio extends i$2 {
|
|
|
364
377
|
|
|
365
378
|
this.input = this.shadowRoot.querySelector('input');
|
|
366
379
|
|
|
380
|
+
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
381
|
+
|
|
367
382
|
this.addEventListener('click', () => {
|
|
368
383
|
this.input.click();
|
|
369
384
|
});
|
|
@@ -390,14 +405,14 @@ class AuroRadio extends i$2 {
|
|
|
390
405
|
aria-invalid="${this.invalid(this.error)}"
|
|
391
406
|
aria-required="${this.isRequired(this.required)}"
|
|
392
407
|
.checked="${this.checked}"
|
|
393
|
-
id="${
|
|
408
|
+
id="${this.inputId}"
|
|
394
409
|
name="${o$1(this.name)}"
|
|
395
410
|
type="radio"
|
|
396
411
|
.value="${this.value}"
|
|
397
412
|
tabIndex="-1"
|
|
398
413
|
/>
|
|
399
414
|
|
|
400
|
-
<label for="${
|
|
415
|
+
<label for="${this.inputId}" class="${e(labelClasses)}">
|
|
401
416
|
<slot>${this.label}</slot>
|
|
402
417
|
</label>
|
|
403
418
|
|
|
@@ -1075,7 +1090,20 @@ class AuroFormValidation {
|
|
|
1075
1090
|
* The validityState definitions are located at https://developer.mozilla.org/en-US/docs/Web/API/ValidityState.
|
|
1076
1091
|
*/
|
|
1077
1092
|
|
|
1078
|
-
let hasValue =
|
|
1093
|
+
let hasValue = false;
|
|
1094
|
+
|
|
1095
|
+
// Check string for having a value
|
|
1096
|
+
if (typeof elem.value === "string") {
|
|
1097
|
+
hasValue = elem.value && elem.value.length > 0;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
// Check array value types for having a value
|
|
1101
|
+
if (Array.isArray(elem.value)) {
|
|
1102
|
+
hasValue = Boolean(
|
|
1103
|
+
elem.value.length > 0 &&
|
|
1104
|
+
elem.value.some((value) => typeof value === "string" && value.length > 0)
|
|
1105
|
+
);
|
|
1106
|
+
}
|
|
1079
1107
|
|
|
1080
1108
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
1081
1109
|
if (this.auroInputElements?.length === 2) {
|
|
@@ -132,6 +132,10 @@ let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
|
132
132
|
* @attr {Boolean} error - If set to true, sets an error state on the radio button.
|
|
133
133
|
* @attr {Boolean} onDark - If set to true, the component will render with a dark theme.
|
|
134
134
|
* @event toggleSelected - Notifies that the component has toggled the checked/selected state.
|
|
135
|
+
*
|
|
136
|
+
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
137
|
+
* @attr id
|
|
138
|
+
*
|
|
135
139
|
* @event focusSelected - Notifies that the component has gained focus.
|
|
136
140
|
* @event auroRadio-blur - Notifies that the component has lost focus.
|
|
137
141
|
* @event resetRadio - Notifies that the component has reset the checked/selected state.
|
|
@@ -187,7 +191,6 @@ class AuroRadio extends i$2 {
|
|
|
187
191
|
type: Boolean,
|
|
188
192
|
reflect: true
|
|
189
193
|
},
|
|
190
|
-
id: { type: String },
|
|
191
194
|
label: { type: String },
|
|
192
195
|
name: { type: String },
|
|
193
196
|
value: { type: String },
|
|
@@ -204,6 +207,16 @@ class AuroRadio extends i$2 {
|
|
|
204
207
|
type: Boolean,
|
|
205
208
|
reflect: true,
|
|
206
209
|
attribute: false
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* @private
|
|
214
|
+
* id for input node
|
|
215
|
+
*/
|
|
216
|
+
inputId: {
|
|
217
|
+
type: String,
|
|
218
|
+
reflect: false,
|
|
219
|
+
attribute: false
|
|
207
220
|
}
|
|
208
221
|
};
|
|
209
222
|
}
|
|
@@ -339,6 +352,8 @@ class AuroRadio extends i$2 {
|
|
|
339
352
|
|
|
340
353
|
this.input = this.shadowRoot.querySelector('input');
|
|
341
354
|
|
|
355
|
+
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
356
|
+
|
|
342
357
|
this.addEventListener('click', () => {
|
|
343
358
|
this.input.click();
|
|
344
359
|
});
|
|
@@ -365,14 +380,14 @@ class AuroRadio extends i$2 {
|
|
|
365
380
|
aria-invalid="${this.invalid(this.error)}"
|
|
366
381
|
aria-required="${this.isRequired(this.required)}"
|
|
367
382
|
.checked="${this.checked}"
|
|
368
|
-
id="${
|
|
383
|
+
id="${this.inputId}"
|
|
369
384
|
name="${o$1(this.name)}"
|
|
370
385
|
type="radio"
|
|
371
386
|
.value="${this.value}"
|
|
372
387
|
tabIndex="-1"
|
|
373
388
|
/>
|
|
374
389
|
|
|
375
|
-
<label for="${
|
|
390
|
+
<label for="${this.inputId}" class="${e(labelClasses)}">
|
|
376
391
|
<slot>${this.label}</slot>
|
|
377
392
|
</label>
|
|
378
393
|
|
|
@@ -1050,7 +1065,20 @@ class AuroFormValidation {
|
|
|
1050
1065
|
* The validityState definitions are located at https://developer.mozilla.org/en-US/docs/Web/API/ValidityState.
|
|
1051
1066
|
*/
|
|
1052
1067
|
|
|
1053
|
-
let hasValue =
|
|
1068
|
+
let hasValue = false;
|
|
1069
|
+
|
|
1070
|
+
// Check string for having a value
|
|
1071
|
+
if (typeof elem.value === "string") {
|
|
1072
|
+
hasValue = elem.value && elem.value.length > 0;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
// Check array value types for having a value
|
|
1076
|
+
if (Array.isArray(elem.value)) {
|
|
1077
|
+
hasValue = Boolean(
|
|
1078
|
+
elem.value.length > 0 &&
|
|
1079
|
+
elem.value.some((value) => typeof value === "string" && value.length > 0)
|
|
1080
|
+
);
|
|
1081
|
+
}
|
|
1054
1082
|
|
|
1055
1083
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
1056
1084
|
if (this.auroInputElements?.length === 2) {
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
* @attr {Boolean} error - If set to true, sets an error state on the radio button.
|
|
6
6
|
* @attr {Boolean} onDark - If set to true, the component will render with a dark theme.
|
|
7
7
|
* @event toggleSelected - Notifies that the component has toggled the checked/selected state.
|
|
8
|
+
*
|
|
9
|
+
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
10
|
+
* @attr id
|
|
11
|
+
*
|
|
8
12
|
* @event focusSelected - Notifies that the component has gained focus.
|
|
9
13
|
* @event auroRadio-blur - Notifies that the component has lost focus.
|
|
10
14
|
* @event resetRadio - Notifies that the component has reset the checked/selected state.
|
|
@@ -33,9 +37,6 @@ export class AuroRadio extends LitElement {
|
|
|
33
37
|
type: BooleanConstructor;
|
|
34
38
|
reflect: boolean;
|
|
35
39
|
};
|
|
36
|
-
id: {
|
|
37
|
-
type: StringConstructor;
|
|
38
|
-
};
|
|
39
40
|
label: {
|
|
40
41
|
type: StringConstructor;
|
|
41
42
|
};
|
|
@@ -58,6 +59,15 @@ export class AuroRadio extends LitElement {
|
|
|
58
59
|
reflect: boolean;
|
|
59
60
|
attribute: boolean;
|
|
60
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* @private
|
|
64
|
+
* id for input node
|
|
65
|
+
*/
|
|
66
|
+
inputId: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
reflect: boolean;
|
|
69
|
+
attribute: boolean;
|
|
70
|
+
};
|
|
61
71
|
};
|
|
62
72
|
/**
|
|
63
73
|
* This will register this element with the browser.
|
|
@@ -128,6 +138,7 @@ export class AuroRadio extends LitElement {
|
|
|
128
138
|
private isRequired;
|
|
129
139
|
firstUpdated(): void;
|
|
130
140
|
input: HTMLInputElement;
|
|
141
|
+
inputId: string;
|
|
131
142
|
render(): import("lit-html").TemplateResult<1>;
|
|
132
143
|
}
|
|
133
144
|
import { LitElement } from "lit";
|