@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.3 → 0.0.0-pr624.31
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/bibtemplate/dist/auro-bibtemplate.d.ts +13 -2
- package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +1292 -79
- package/components/bibtemplate/dist/registered.js +1292 -79
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/api.md +47 -14
- package/components/checkbox/demo/api.min.js +35 -29
- package/components/checkbox/demo/index.md +2 -2
- package/components/checkbox/demo/index.min.js +35 -29
- package/components/checkbox/demo/readme.md +1 -1
- package/components/checkbox/dist/auro-checkbox-group.d.ts +1 -1
- package/components/checkbox/dist/auro-checkbox.d.ts +3 -3
- package/components/checkbox/dist/index.js +35 -29
- package/components/checkbox/dist/registered.js +35 -29
- package/components/combobox/demo/api.md +101 -2
- package/components/combobox/demo/api.min.js +2935 -794
- package/components/combobox/demo/index.md +6 -30
- package/components/combobox/demo/index.min.js +2935 -794
- package/components/combobox/dist/auro-combobox.d.ts +45 -16
- package/components/combobox/dist/index.js +2832 -832
- package/components/combobox/dist/registered.js +2832 -832
- package/components/counter/demo/api.md +21 -19
- package/components/counter/demo/api.min.js +3648 -929
- package/components/counter/demo/index.md +99 -34
- package/components/counter/demo/index.min.js +3648 -929
- package/components/counter/dist/auro-counter-button.d.ts +2 -0
- package/components/counter/dist/auro-counter-group.d.ts +105 -6
- package/components/counter/dist/auro-counter.d.ts +6 -0
- package/components/counter/dist/helptextVersion.d.ts +2 -0
- package/components/counter/dist/iconVersion.d.ts +1 -1
- package/components/counter/dist/index.js +3648 -929
- package/components/counter/dist/registered.js +3648 -929
- package/components/datepicker/demo/api.md +36 -19
- package/components/datepicker/demo/api.min.js +14662 -10980
- package/components/datepicker/demo/index.md +80 -0
- package/components/datepicker/demo/index.min.js +14662 -10980
- package/components/datepicker/dist/auro-datepicker.d.ts +71 -3
- package/components/datepicker/dist/buttonVersion.d.ts +1 -1
- package/components/datepicker/dist/iconVersion.d.ts +2 -0
- package/components/datepicker/dist/index.js +11706 -8024
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +11706 -8024
- package/components/dropdown/demo/api.md +6 -7
- package/components/dropdown/demo/api.min.js +238 -144
- package/components/dropdown/demo/index.md +57 -9
- package/components/dropdown/demo/index.min.js +238 -144
- package/components/dropdown/dist/auro-dropdown.d.ts +10 -9
- package/components/dropdown/dist/auro-dropdownBib.d.ts +22 -0
- package/components/dropdown/dist/index.js +238 -144
- package/components/dropdown/dist/registered.js +238 -144
- package/components/form/demo/api.min.js +1 -1
- package/components/form/demo/index.min.js +1 -1
- package/components/form/dist/index.js +1 -1
- package/components/form/dist/registered.js +1 -1
- package/components/helptext/dist/index.js +2 -2
- package/components/helptext/dist/registered.js +2 -2
- package/components/input/README.md +1 -1
- package/components/input/demo/api.md +133 -97
- package/components/input/demo/api.min.js +972 -269
- package/components/input/demo/index.md +14 -14
- package/components/input/demo/index.min.js +971 -268
- package/components/input/demo/readme.md +1 -1
- package/components/input/dist/auro-input.d.ts +197 -15
- package/components/input/dist/base-input.d.ts +32 -8
- package/components/input/dist/buttonVersion.d.ts +1 -1
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +971 -268
- package/components/input/dist/registered.js +971 -268
- package/components/layoutElement/dist/index.js +13 -10
- package/components/menu/demo/api.html +38 -0
- package/components/menu/demo/api.md +68 -7
- package/components/menu/demo/api.min.js +278 -42
- package/components/menu/demo/index.min.js +278 -42
- package/components/menu/dist/auro-menu.d.ts +28 -5
- package/components/menu/dist/auro-menuoption.d.ts +15 -3
- package/components/menu/dist/iconVersion.d.ts +1 -1
- package/components/menu/dist/index.js +278 -42
- package/components/menu/dist/registered.js +278 -42
- package/components/menu/dist/styles/default/color-menuoption-css.d.ts +2 -0
- package/components/menu/dist/styles/default/style-menu-css.d.ts +2 -0
- package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
- package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
- package/components/radio/demo/api.md +7 -7
- package/components/radio/demo/api.min.js +16 -13
- package/components/radio/demo/index.min.js +16 -13
- package/components/radio/dist/auro-radio-group.d.ts +1 -1
- package/components/radio/dist/auro-radio.d.ts +1 -1
- package/components/radio/dist/index.js +16 -13
- package/components/radio/dist/registered.js +16 -13
- package/components/select/demo/api.js +2 -0
- package/components/select/demo/api.md +124 -13
- package/components/select/demo/api.min.js +2802 -538
- package/components/select/demo/index.html +1 -0
- package/components/select/demo/index.md +325 -763
- package/components/select/demo/index.min.js +2795 -543
- package/components/select/dist/auro-select.d.ts +112 -11
- package/components/select/dist/helptextVersion.d.ts +2 -0
- package/components/select/dist/index.js +2538 -427
- package/components/select/dist/registered.js +2538 -427
- package/components/select/dist/styles/shapeSize-css.d.ts +2 -0
- package/components/select/dist/styles/tokens-css.d.ts +2 -0
- package/package.json +6 -4
- /package/components/{dropdown/dist/styles/default/bibColors-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/{dropdown → datepicker}/dist/styles/default/color-css.d.ts +0 -0
- /package/components/{dropdown/dist/styles/default/bibStyles-css.d.ts → datepicker/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/{dropdown/dist/styles/default/style-css.d.ts → datepicker/dist/styles/snowflake/color-css.d.ts} +0 -0
- /package/components/{dropdown/dist/styles → datepicker/dist/styles/snowflake}/style-css.d.ts +0 -0
- /package/components/{menu/dist/styles/color-menu-css.d.ts → dropdown/dist/styles/classic/bibColors-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/color-menuoption-css.d.ts → dropdown/dist/styles/classic/bibStyles-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/style-menu-css.d.ts → dropdown/dist/styles/classic/color-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/style-menuoption-css.d.ts → dropdown/dist/styles/classic/style-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{tokens-css.d.ts → default/color-menu-css.d.ts} +0 -0
|
@@ -214,8 +214,8 @@ class AuroRadio extends i$2 {
|
|
|
214
214
|
},
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
|
+
* ID for input node.
|
|
217
218
|
* @private
|
|
218
|
-
* id for input node
|
|
219
219
|
*/
|
|
220
220
|
inputId: {
|
|
221
221
|
type: String,
|
|
@@ -472,9 +472,10 @@ class DateFormatter {
|
|
|
472
472
|
/**
|
|
473
473
|
* Convert a date object to string format.
|
|
474
474
|
* @param {Object} date - Date to convert to string.
|
|
475
|
-
* @
|
|
475
|
+
* @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
|
|
476
|
+
* @returns {String} Returns the date as a string.
|
|
476
477
|
*/
|
|
477
|
-
this.getDateAsString = (date) => date.toLocaleDateString(
|
|
478
|
+
this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
|
|
478
479
|
year: "numeric",
|
|
479
480
|
month: "2-digit",
|
|
480
481
|
day: "2-digit",
|
|
@@ -666,7 +667,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
|
|
|
666
667
|
const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
|
|
667
668
|
|
|
668
669
|
// Get the date string of the date object we created from the string date
|
|
669
|
-
const actualDateStr = dateFormatter.getDateAsString(dateObj);
|
|
670
|
+
const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
|
|
670
671
|
|
|
671
672
|
// Guard Clause: Generated date matches date string input
|
|
672
673
|
if (expectedDateStr !== actualDateStr) {
|
|
@@ -1110,7 +1111,9 @@ class AuroFormValidation {
|
|
|
1110
1111
|
elem.validity = this.auroInputElements[0].validity;
|
|
1111
1112
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
1112
1113
|
|
|
1113
|
-
|
|
1114
|
+
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1115
|
+
// combobox's 2nd input will have noValidate set true.
|
|
1116
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !this.auroInputElements[1].noValidate) {
|
|
1114
1117
|
elem.validity = this.auroInputElements[1].validity;
|
|
1115
1118
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
1116
1119
|
}
|
|
@@ -1230,9 +1233,9 @@ class AuroDependencyVersioning {
|
|
|
1230
1233
|
}
|
|
1231
1234
|
}
|
|
1232
1235
|
|
|
1233
|
-
var colorCss = i$5`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-
|
|
1236
|
+
var colorCss = i$5`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
1234
1237
|
|
|
1235
|
-
var styleCss = i$5`.helptext-wrapper{display:none;font-size:
|
|
1238
|
+
var styleCss = i$5`.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
1236
1239
|
|
|
1237
1240
|
var tokensCss = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
1238
1241
|
|
|
@@ -1458,7 +1461,7 @@ var helpTextVersion = '1.0.0';
|
|
|
1458
1461
|
* @attr {Object} optionSelected - Specifies the current selected radio button.
|
|
1459
1462
|
* @csspart radio-group - Apply css to the fieldset element in the shadow DOM
|
|
1460
1463
|
* @slot {HTMLSlotElement} legend - Allows for the legend to be overridden.
|
|
1461
|
-
* @slot {HTMLSlotElement} optionalLabel - Allows
|
|
1464
|
+
* @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
1462
1465
|
* @slot {HTMLSlotElement} helpText - Allows for the helper text to be overridden.
|
|
1463
1466
|
* @event auroFormElement-validated - Notifies that the element has been validated.
|
|
1464
1467
|
* @event input - Notifies every time the value prop of the element is changed.
|
|
@@ -1614,7 +1617,7 @@ class AuroRadioGroup extends i$2 {
|
|
|
1614
1617
|
|
|
1615
1618
|
this.optionSelected = event.target;
|
|
1616
1619
|
|
|
1617
|
-
this.validation.validate(this);
|
|
1620
|
+
this.validation.validate(this, this.optionSelected !== undefined);
|
|
1618
1621
|
}
|
|
1619
1622
|
|
|
1620
1623
|
/**
|
|
@@ -1881,10 +1884,10 @@ class AuroRadioGroup extends i$2 {
|
|
|
1881
1884
|
|
|
1882
1885
|
return u`
|
|
1883
1886
|
<fieldset class="${e(groupClasses)}" part="radio-group">
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1887
|
+
<legend>
|
|
1888
|
+
<slot name="legend"></slot>
|
|
1889
|
+
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
1890
|
+
</legend>
|
|
1888
1891
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
1889
1892
|
</fieldset>
|
|
1890
1893
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @attr {Object} optionSelected - Specifies the current selected radio button.
|
|
11
11
|
* @csspart radio-group - Apply css to the fieldset element in the shadow DOM
|
|
12
12
|
* @slot {HTMLSlotElement} legend - Allows for the legend to be overridden.
|
|
13
|
-
* @slot {HTMLSlotElement} optionalLabel - Allows
|
|
13
|
+
* @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
14
14
|
* @slot {HTMLSlotElement} helpText - Allows for the helper text to be overridden.
|
|
15
15
|
* @event auroFormElement-validated - Notifies that the element has been validated.
|
|
16
16
|
* @event input - Notifies every time the value prop of the element is changed.
|
|
@@ -174,8 +174,8 @@ class AuroRadio extends LitElement {
|
|
|
174
174
|
},
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
|
+
* ID for input node.
|
|
177
178
|
* @private
|
|
178
|
-
* id for input node
|
|
179
179
|
*/
|
|
180
180
|
inputId: {
|
|
181
181
|
type: String,
|
|
@@ -425,9 +425,10 @@ class DateFormatter {
|
|
|
425
425
|
/**
|
|
426
426
|
* Convert a date object to string format.
|
|
427
427
|
* @param {Object} date - Date to convert to string.
|
|
428
|
-
* @
|
|
428
|
+
* @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
|
|
429
|
+
* @returns {String} Returns the date as a string.
|
|
429
430
|
*/
|
|
430
|
-
this.getDateAsString = (date) => date.toLocaleDateString(
|
|
431
|
+
this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
|
|
431
432
|
year: "numeric",
|
|
432
433
|
month: "2-digit",
|
|
433
434
|
day: "2-digit",
|
|
@@ -619,7 +620,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
|
|
|
619
620
|
const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
|
|
620
621
|
|
|
621
622
|
// Get the date string of the date object we created from the string date
|
|
622
|
-
const actualDateStr = dateFormatter.getDateAsString(dateObj);
|
|
623
|
+
const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
|
|
623
624
|
|
|
624
625
|
// Guard Clause: Generated date matches date string input
|
|
625
626
|
if (expectedDateStr !== actualDateStr) {
|
|
@@ -1063,7 +1064,9 @@ class AuroFormValidation {
|
|
|
1063
1064
|
elem.validity = this.auroInputElements[0].validity;
|
|
1064
1065
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
1065
1066
|
|
|
1066
|
-
|
|
1067
|
+
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1068
|
+
// combobox's 2nd input will have noValidate set true.
|
|
1069
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !this.auroInputElements[1].noValidate) {
|
|
1067
1070
|
elem.validity = this.auroInputElements[1].validity;
|
|
1068
1071
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
1069
1072
|
}
|
|
@@ -1183,9 +1186,9 @@ class AuroDependencyVersioning {
|
|
|
1183
1186
|
}
|
|
1184
1187
|
}
|
|
1185
1188
|
|
|
1186
|
-
var colorCss = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-
|
|
1189
|
+
var colorCss = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
1187
1190
|
|
|
1188
|
-
var styleCss = css`.helptext-wrapper{display:none;font-size:
|
|
1191
|
+
var styleCss = css`.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
1189
1192
|
|
|
1190
1193
|
var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
1191
1194
|
|
|
@@ -1411,7 +1414,7 @@ var helpTextVersion = '1.0.0';
|
|
|
1411
1414
|
* @attr {Object} optionSelected - Specifies the current selected radio button.
|
|
1412
1415
|
* @csspart radio-group - Apply css to the fieldset element in the shadow DOM
|
|
1413
1416
|
* @slot {HTMLSlotElement} legend - Allows for the legend to be overridden.
|
|
1414
|
-
* @slot {HTMLSlotElement} optionalLabel - Allows
|
|
1417
|
+
* @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
1415
1418
|
* @slot {HTMLSlotElement} helpText - Allows for the helper text to be overridden.
|
|
1416
1419
|
* @event auroFormElement-validated - Notifies that the element has been validated.
|
|
1417
1420
|
* @event input - Notifies every time the value prop of the element is changed.
|
|
@@ -1567,7 +1570,7 @@ class AuroRadioGroup extends LitElement {
|
|
|
1567
1570
|
|
|
1568
1571
|
this.optionSelected = event.target;
|
|
1569
1572
|
|
|
1570
|
-
this.validation.validate(this);
|
|
1573
|
+
this.validation.validate(this, this.optionSelected !== undefined);
|
|
1571
1574
|
}
|
|
1572
1575
|
|
|
1573
1576
|
/**
|
|
@@ -1834,10 +1837,10 @@ class AuroRadioGroup extends LitElement {
|
|
|
1834
1837
|
|
|
1835
1838
|
return html$1`
|
|
1836
1839
|
<fieldset class="${classMap(groupClasses)}" part="radio-group">
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1840
|
+
<legend>
|
|
1841
|
+
<slot name="legend"></slot>
|
|
1842
|
+
${this.required ? undefined : html$1`<slot name="optionalLabel"> (optional)</slot>`}
|
|
1843
|
+
</legend>
|
|
1841
1844
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
1842
1845
|
</fieldset>
|
|
1843
1846
|
|
|
@@ -174,8 +174,8 @@ class AuroRadio extends LitElement {
|
|
|
174
174
|
},
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
|
+
* ID for input node.
|
|
177
178
|
* @private
|
|
178
|
-
* id for input node
|
|
179
179
|
*/
|
|
180
180
|
inputId: {
|
|
181
181
|
type: String,
|
|
@@ -425,9 +425,10 @@ class DateFormatter {
|
|
|
425
425
|
/**
|
|
426
426
|
* Convert a date object to string format.
|
|
427
427
|
* @param {Object} date - Date to convert to string.
|
|
428
|
-
* @
|
|
428
|
+
* @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
|
|
429
|
+
* @returns {String} Returns the date as a string.
|
|
429
430
|
*/
|
|
430
|
-
this.getDateAsString = (date) => date.toLocaleDateString(
|
|
431
|
+
this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
|
|
431
432
|
year: "numeric",
|
|
432
433
|
month: "2-digit",
|
|
433
434
|
day: "2-digit",
|
|
@@ -619,7 +620,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
|
|
|
619
620
|
const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
|
|
620
621
|
|
|
621
622
|
// Get the date string of the date object we created from the string date
|
|
622
|
-
const actualDateStr = dateFormatter.getDateAsString(dateObj);
|
|
623
|
+
const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
|
|
623
624
|
|
|
624
625
|
// Guard Clause: Generated date matches date string input
|
|
625
626
|
if (expectedDateStr !== actualDateStr) {
|
|
@@ -1063,7 +1064,9 @@ class AuroFormValidation {
|
|
|
1063
1064
|
elem.validity = this.auroInputElements[0].validity;
|
|
1064
1065
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
1065
1066
|
|
|
1066
|
-
|
|
1067
|
+
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1068
|
+
// combobox's 2nd input will have noValidate set true.
|
|
1069
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !this.auroInputElements[1].noValidate) {
|
|
1067
1070
|
elem.validity = this.auroInputElements[1].validity;
|
|
1068
1071
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
1069
1072
|
}
|
|
@@ -1183,9 +1186,9 @@ class AuroDependencyVersioning {
|
|
|
1183
1186
|
}
|
|
1184
1187
|
}
|
|
1185
1188
|
|
|
1186
|
-
var colorCss = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-
|
|
1189
|
+
var colorCss = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
1187
1190
|
|
|
1188
|
-
var styleCss = css`.helptext-wrapper{display:none;font-size:
|
|
1191
|
+
var styleCss = css`.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
1189
1192
|
|
|
1190
1193
|
var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
1191
1194
|
|
|
@@ -1411,7 +1414,7 @@ var helpTextVersion = '1.0.0';
|
|
|
1411
1414
|
* @attr {Object} optionSelected - Specifies the current selected radio button.
|
|
1412
1415
|
* @csspart radio-group - Apply css to the fieldset element in the shadow DOM
|
|
1413
1416
|
* @slot {HTMLSlotElement} legend - Allows for the legend to be overridden.
|
|
1414
|
-
* @slot {HTMLSlotElement} optionalLabel - Allows
|
|
1417
|
+
* @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
1415
1418
|
* @slot {HTMLSlotElement} helpText - Allows for the helper text to be overridden.
|
|
1416
1419
|
* @event auroFormElement-validated - Notifies that the element has been validated.
|
|
1417
1420
|
* @event input - Notifies every time the value prop of the element is changed.
|
|
@@ -1567,7 +1570,7 @@ class AuroRadioGroup extends LitElement {
|
|
|
1567
1570
|
|
|
1568
1571
|
this.optionSelected = event.target;
|
|
1569
1572
|
|
|
1570
|
-
this.validation.validate(this);
|
|
1573
|
+
this.validation.validate(this, this.optionSelected !== undefined);
|
|
1571
1574
|
}
|
|
1572
1575
|
|
|
1573
1576
|
/**
|
|
@@ -1834,10 +1837,10 @@ class AuroRadioGroup extends LitElement {
|
|
|
1834
1837
|
|
|
1835
1838
|
return html$1`
|
|
1836
1839
|
<fieldset class="${classMap(groupClasses)}" part="radio-group">
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1840
|
+
<legend>
|
|
1841
|
+
<slot name="legend"></slot>
|
|
1842
|
+
${this.required ? undefined : html$1`<slot name="optionalLabel"> (optional)</slot>`}
|
|
1843
|
+
</legend>
|
|
1841
1844
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
1842
1845
|
</fieldset>
|
|
1843
1846
|
|
|
@@ -5,6 +5,7 @@ import { valueAlertExample } from "../apiExamples/valueAlert.js";
|
|
|
5
5
|
import { inDialogExample } from '../apiExamples/inDialog';
|
|
6
6
|
import { resetStateExample } from "../apiExamples/resetState";
|
|
7
7
|
import { auroMenuLoadingExample } from "../apiExamples/loading";
|
|
8
|
+
import { valueTextExample } from '../apiExamples/valueText.js';
|
|
8
9
|
|
|
9
10
|
/* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */
|
|
10
11
|
import { AuroSelect } from '../src/auro-select.js';
|
|
@@ -24,6 +25,7 @@ export function initExamples(initCount) {
|
|
|
24
25
|
inDialogExample();
|
|
25
26
|
resetStateExample();
|
|
26
27
|
auroMenuLoadingExample();
|
|
28
|
+
valueTextExample();
|
|
27
29
|
} catch (err) {
|
|
28
30
|
if (initCount <= 20) {
|
|
29
31
|
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
|
@@ -20,9 +20,11 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
|
|
|
20
20
|
| [autocomplete](#autocomplete) | `autocomplete` | `string` | | If declared, sets the autocomplete attribute for the select element. |
|
|
21
21
|
| [disabled](#disabled) | `disabled` | `boolean` | | When attribute is present, element shows disabled state. |
|
|
22
22
|
| [error](#error) | `error` | `string` | | When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value. |
|
|
23
|
-
| [
|
|
23
|
+
| [forceDisplayValue](#forceDisplayValue) | `forceDisplayValue` | `boolean` | false | If declared, the label and value will be visually hidden and the displayValue will render 100% of the time. |
|
|
24
24
|
| [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | `string` | "sm" | Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)<br />at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.<br /><br />When expanded, the dropdown will automatically display in fullscreen mode<br />if the screen size is equal to or smaller than the selected breakpoint. |
|
|
25
25
|
| [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | `boolean` | | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600. |
|
|
26
|
+
| [layout](#layout) | | `string` | "snowflake" | |
|
|
27
|
+
| [matchWidth](#matchWidth) | `matchWidth` | `boolean` | false | If declared, the popover and trigger will be set to the same width. |
|
|
26
28
|
| [multiSelect](#multiSelect) | `multiselect` | `boolean` | | Sets multi-select mode, allowing multiple options to be selected at once. |
|
|
27
29
|
| [name](#name) | `name` | `string` | | The name for the select element. |
|
|
28
30
|
| [noCheckmark](#noCheckmark) | `noCheckmark` | `boolean` | | When true, checkmark on selected option will no longer be present. |
|
|
@@ -31,28 +33,33 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
|
|
|
31
33
|
| [offset](#offset) | `offset` | `number` | "0" | Gap between the trigger element and bib. |
|
|
32
34
|
| [onDark](#onDark) | `onDark` | `boolean` | | If declared, onDark styles will be applied to the trigger. |
|
|
33
35
|
| [optionSelected](#optionSelected) | `optionSelected` | `HTMLElement\|Array<HTMLElement>` | | Specifies the current selected menuOption. Default type is `HTMLElement`, changing to `Array<HTMLElement>` when `multiSelect` is true. |
|
|
34
|
-
| [placement](#placement) | `placement` | `string` | "bottom-start" | Position where the bib should appear relative to the trigger.<br />Accepted values:<br />"top" \| "right" \| "bottom" \| "left" \|<br />"bottom-start" \| "top-start" \| "top-end" \|<br />"right-start" \| "right-end" \| "bottom-end" \|<br />"left-start" \| "left-end" |
|
|
36
|
+
| [placement](#placement) | `placement` | `string` | "bottom-start" | Position where the bib should appear relative to the trigger.<br />Accepted values:<br />"top" \| "right" \| "bottom" \| "left" \|<br />"bottom-start" \| "top-start" \| "top-end" \|<br />"right-start" \| "right-end" \| "bottom-end" \|<br />"left-start" \| "left-end". |
|
|
35
37
|
| [required](#required) | `required` | `boolean` | | Populates the `required` attribute on the element. Used for client-side validation. |
|
|
36
38
|
| [setCustomValidity](#setCustomValidity) | `setCustomValidity` | `string` | | Sets a custom help text message to display for all validityStates. |
|
|
37
39
|
| [setCustomValidityCustomError](#setCustomValidityCustomError) | `setCustomValidityCustomError` | `string` | | Custom help text message to display when validity = `customError`. |
|
|
38
40
|
| [setCustomValidityValueMissing](#setCustomValidityValueMissing) | `setCustomValidityValueMissing` | `string` | | Custom help text message to display when validity = `valueMissing`. |
|
|
41
|
+
| [shape](#shape) | | `string` | "snowflake" | |
|
|
42
|
+
| [size](#size) | | `string` | "xl" | |
|
|
39
43
|
| [validity](#validity) | `validity` | `string` | | Specifies the `validityState` this element is in. |
|
|
40
44
|
| [value](#value) | `value` | `String\|Array<String>` | | Value selected for the component. Default type is `String`, changing to `Array<String>` when `multiSelect` is true. |
|
|
41
45
|
|
|
42
46
|
## Methods
|
|
43
47
|
|
|
44
|
-
| Method
|
|
45
|
-
|
|
46
|
-
| [
|
|
47
|
-
| [
|
|
48
|
+
| Method | Type | Description |
|
|
49
|
+
|----------------------|----------------------------------------|--------------------------------------------------|
|
|
50
|
+
| [renderAriaHtml](#renderAriaHtml) | `(): TemplateResult` | |
|
|
51
|
+
| [renderBACKUP](#renderBACKUP) | `(): TemplateResult` | |
|
|
52
|
+
| [renderNativeSelect](#renderNativeSelect) | `(): TemplateResult` | |
|
|
53
|
+
| [reset](#reset) | `(): void` | Resets component to initial state. |
|
|
54
|
+
| [validate](#validate) | `(force?: boolean \| undefined): void` | Validates value.<br /><br />**force**: Whether to force validation. |
|
|
48
55
|
|
|
49
56
|
## Events
|
|
50
57
|
|
|
51
|
-
| Event | Type
|
|
52
|
-
|
|
53
|
-
| `auroFormElement-validated` |
|
|
54
|
-
| `auroSelect-valueSet` | `CustomEvent<any>`
|
|
55
|
-
| [input](#input) | `CustomEvent<any>` | Notifies every time the value prop of the element is changed. |
|
|
58
|
+
| Event | Type | Description |
|
|
59
|
+
|-----------------------------|--------------------------------------------------|--------------------------------------------------|
|
|
60
|
+
| `auroFormElement-validated` | | Notifies that the `validity` and `errorMessage` values have changed. |
|
|
61
|
+
| `auroSelect-valueSet` | `CustomEvent<any>` | Notifies that the component has a new value set. |
|
|
62
|
+
| [input](#input) | `CustomEvent<{ optionSelected: any; value: any; }>` | Notifies every time the value prop of the element is changed. The updated `value` and `optionSelected` will be delivered in `detail` object. |
|
|
56
63
|
|
|
57
64
|
## Slots
|
|
58
65
|
|
|
@@ -60,9 +67,12 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
|
|
|
60
67
|
|---------------------------|--------------------------------------------------|
|
|
61
68
|
| | Default slot for the menu content. |
|
|
62
69
|
| `bib.fullscreen.headline` | Defines the headline to display above menu-options |
|
|
70
|
+
| [displayValue](#displayValue) | Allows custom HTML content to display the selected value when select is not focused. |
|
|
63
71
|
| [helpText](#helpText) | Defines the content of the helpText. |
|
|
64
72
|
| [label](#label) | Defines the content of the label. |
|
|
65
|
-
| [
|
|
73
|
+
| [optionalLabel](#optionalLabel) | Allows overriding the optional display text "(optional)", which appears next to the label. |
|
|
74
|
+
| [placeholder](#placeholder) | Defines the content of the placeholder to be shown when there is no value |
|
|
75
|
+
| [valueText](#valueText) | Dropdown value text display. |
|
|
66
76
|
|
|
67
77
|
## CSS Shadow Parts
|
|
68
78
|
|
|
@@ -439,6 +449,50 @@ When the validity check fails the validityState, equals `valueMissing`. The erro
|
|
|
439
449
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
440
450
|
</auro-accordion>
|
|
441
451
|
|
|
452
|
+
### Custom optional label <a name="optionalLabel"></a>
|
|
453
|
+
The `<auro-select>` supports an `optionalLabel` slot, where users can can override the default `(optional)` notification text.
|
|
454
|
+
|
|
455
|
+
<div class="exampleWrapper">
|
|
456
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/optionalLabel.html) -->
|
|
457
|
+
<!-- The below content is automatically added from ./../apiExamples/optionalLabel.html -->
|
|
458
|
+
<auro-select>
|
|
459
|
+
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
460
|
+
<span slot="label">Please select a preference</span>
|
|
461
|
+
<span slot="optionalLabel" style="color: grey; font-size: small"> - optional</span>
|
|
462
|
+
<auro-menu>
|
|
463
|
+
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
464
|
+
<auro-menuoption value="price">Price</auro-menuoption>
|
|
465
|
+
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
466
|
+
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
467
|
+
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
468
|
+
<auro-menuoption value="prefer alaska">Prefer Alaska</auro-menuoption>
|
|
469
|
+
</auro-menu>
|
|
470
|
+
</auro-select>
|
|
471
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
472
|
+
</div>
|
|
473
|
+
<auro-accordion alignRight>
|
|
474
|
+
<span slot="trigger">See code</span>
|
|
475
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/optionalLabel.html) -->
|
|
476
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/optionalLabel.html -->
|
|
477
|
+
|
|
478
|
+
```html
|
|
479
|
+
<auro-select>
|
|
480
|
+
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
481
|
+
<span slot="label">Please select a preference</span>
|
|
482
|
+
<span slot="optionalLabel" style="color: grey; font-size: small"> - optional</span>
|
|
483
|
+
<auro-menu>
|
|
484
|
+
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
485
|
+
<auro-menuoption value="price">Price</auro-menuoption>
|
|
486
|
+
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
487
|
+
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
488
|
+
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
489
|
+
<auro-menuoption value="prefer alaska">Prefer Alaska</auro-menuoption>
|
|
490
|
+
</auro-menu>
|
|
491
|
+
</auro-select>
|
|
492
|
+
```
|
|
493
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
494
|
+
</auro-accordion>
|
|
495
|
+
|
|
442
496
|
#### error <a name="error"></a>
|
|
443
497
|
Use the `error` boolean attribute to toggle the error UI.
|
|
444
498
|
|
|
@@ -730,7 +784,7 @@ Use the `label` slot to give your users contextual information about their selec
|
|
|
730
784
|
</auro-accordion>
|
|
731
785
|
|
|
732
786
|
#### helpText <a name="helpText"></a>
|
|
733
|
-
Use the `
|
|
787
|
+
Use the `helpText` slot to provide additional information back to your user about their selection option(s).
|
|
734
788
|
|
|
735
789
|
<div class="exampleWrapper">
|
|
736
790
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/helpText.html) -->
|
|
@@ -1033,6 +1087,63 @@ export function auroMenuLoadingExample() {
|
|
|
1033
1087
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1034
1088
|
</auro-accordion>
|
|
1035
1089
|
|
|
1090
|
+
### valueText <a name="valueText"></a>
|
|
1091
|
+
The label for selected option can be customized using `valueText` slot.
|
|
1092
|
+
This slot can be manipulated on the `input` event which delivers the new value and selected `auro-menuoption` element in the `detail` object.
|
|
1093
|
+
|
|
1094
|
+
<div class="exampleWrapper">
|
|
1095
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/valueText.html) -->
|
|
1096
|
+
<!-- The below content is automatically added from ./../apiExamples/valueText.html -->
|
|
1097
|
+
<auro-select id="valueTextExample" autocomplete="address-level1">
|
|
1098
|
+
<span slot="bib.fullscreen.headline">Select Your Gender</span>
|
|
1099
|
+
<span slot="label">Gender</span>
|
|
1100
|
+
<span slot="valueText"></span>
|
|
1101
|
+
<auro-menu>
|
|
1102
|
+
<auro-menuoption value="m" data-display="Male">M - Male</auro-menuoption>
|
|
1103
|
+
<auro-menuoption value="f" data-display="Female">F - Female</auro-menuoption>
|
|
1104
|
+
<auro-menuoption value="x" data-display="Unspecified">X - Unspecified</auro-menuoption>
|
|
1105
|
+
<auro-menuoption value="u" data-display="Undisclosed">U - Undisclosed</auro-menuoption>
|
|
1106
|
+
</auro-menu>
|
|
1107
|
+
</auro-select>
|
|
1108
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1109
|
+
</div>
|
|
1110
|
+
<auro-accordion alignRight>
|
|
1111
|
+
<span slot="trigger">See code</span>
|
|
1112
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/valueText.js) -->
|
|
1113
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/valueText.js -->
|
|
1114
|
+
|
|
1115
|
+
```js
|
|
1116
|
+
export function valueTextExample() {
|
|
1117
|
+
const onValueTextSelectInput = (e) => {
|
|
1118
|
+
const valueText = e.target.querySelector("[slot=valueText]");
|
|
1119
|
+
|
|
1120
|
+
valueText.textContent = e.detail.optionSelected.dataset.display;
|
|
1121
|
+
};
|
|
1122
|
+
|
|
1123
|
+
const select = document.querySelector("#valueTextExample");
|
|
1124
|
+
select.addEventListener('input', onValueTextSelectInput);
|
|
1125
|
+
}
|
|
1126
|
+
```
|
|
1127
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1128
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/valueText.html) -->
|
|
1129
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/valueText.html -->
|
|
1130
|
+
|
|
1131
|
+
```html
|
|
1132
|
+
<auro-select id="valueTextExample" autocomplete="address-level1">
|
|
1133
|
+
<span slot="bib.fullscreen.headline">Select Your Gender</span>
|
|
1134
|
+
<span slot="label">Gender</span>
|
|
1135
|
+
<span slot="valueText"></span>
|
|
1136
|
+
<auro-menu>
|
|
1137
|
+
<auro-menuoption value="m" data-display="Male">M - Male</auro-menuoption>
|
|
1138
|
+
<auro-menuoption value="f" data-display="Female">F - Female</auro-menuoption>
|
|
1139
|
+
<auro-menuoption value="x" data-display="Unspecified">X - Unspecified</auro-menuoption>
|
|
1140
|
+
<auro-menuoption value="u" data-display="Undisclosed">U - Undisclosed</auro-menuoption>
|
|
1141
|
+
</auro-menu>
|
|
1142
|
+
</auro-select>
|
|
1143
|
+
```
|
|
1144
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1145
|
+
</auro-accordion>
|
|
1146
|
+
|
|
1036
1147
|
### Customized bib position
|
|
1037
1148
|
The bib position can be customized with `placement`, `offset`, `flip`, `autoPlacement` attributes.
|
|
1038
1149
|
|