@aurodesignsystem/auro-formkit 2.1.0-beta.3 → 2.1.0-beta.5
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/CHANGELOG.md +14 -0
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/readme.md +1 -1
- package/components/combobox/README.md +1 -1
- package/components/combobox/demo/api.min.js +50 -8
- package/components/combobox/demo/index.min.js +50 -8
- package/components/combobox/demo/readme.md +1 -1
- package/components/combobox/dist/index.js +50 -8
- package/components/combobox/dist/registered.js +50 -8
- package/components/counter/README.md +1 -1
- package/components/counter/demo/api.min.js +52 -10
- package/components/counter/demo/index.min.js +52 -10
- package/components/counter/demo/readme.md +1 -1
- package/components/counter/dist/index.js +52 -10
- package/components/counter/dist/registered.js +52 -10
- package/components/datepicker/README.md +1 -1
- package/components/datepicker/demo/api.min.js +50 -8
- package/components/datepicker/demo/index.min.js +50 -8
- package/components/datepicker/demo/readme.md +1 -1
- package/components/datepicker/dist/index.js +50 -8
- package/components/datepicker/dist/registered.js +50 -8
- package/components/dropdown/README.md +1 -1
- package/components/dropdown/demo/api.md +1 -1
- package/components/dropdown/demo/api.min.js +50 -8
- package/components/dropdown/demo/index.min.js +50 -8
- package/components/dropdown/demo/readme.md +1 -1
- package/components/dropdown/dist/auro-dropdown.d.ts +17 -1
- package/components/dropdown/dist/index.js +50 -8
- package/components/dropdown/dist/registered.js +50 -8
- package/components/form/README.md +1 -1
- package/components/form/demo/readme.md +1 -1
- package/components/input/README.md +1 -1
- package/components/input/demo/readme.md +1 -1
- package/components/menu/README.md +1 -1
- package/components/menu/demo/readme.md +1 -1
- package/components/radio/README.md +1 -1
- package/components/radio/demo/readme.md +1 -1
- package/components/select/README.md +2 -1
- package/components/select/demo/api.md +22 -0
- package/components/select/demo/api.min.js +50 -8
- package/components/select/demo/index.md +14 -0
- package/components/select/demo/index.min.js +50 -8
- package/components/select/demo/readme.md +2 -1
- package/components/select/dist/index.js +50 -8
- package/components/select/dist/registered.js +50 -8
- package/package.json +1 -1
|
@@ -75,6 +75,7 @@ A baseline `auro-select` using `auro-menu` and `auro-menuoption` elements.
|
|
|
75
75
|
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
76
76
|
<auro-select>
|
|
77
77
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
78
|
+
<span slot="label">Select Example</span>
|
|
78
79
|
<auro-menu>
|
|
79
80
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
80
81
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -94,6 +95,7 @@ A baseline `auro-select` using `auro-menu` and `auro-menuoption` elements.
|
|
|
94
95
|
```html
|
|
95
96
|
<auro-select>
|
|
96
97
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
98
|
+
<span slot="label">Select Example</span>
|
|
97
99
|
<auro-menu>
|
|
98
100
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
99
101
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -186,6 +188,7 @@ When the validity check fails the validityState, equals `valueMissing`. The erro
|
|
|
186
188
|
<!-- The below content is automatically added from ./../apiExamples/required.html -->
|
|
187
189
|
<auro-select required setCustomValidityValueMissing="Custom required validation error message.">
|
|
188
190
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
191
|
+
<span slot="label">required field</span>
|
|
189
192
|
<label slot="placeholder">Placeholder Text</label>
|
|
190
193
|
<auro-menu>
|
|
191
194
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
@@ -206,6 +209,7 @@ When the validity check fails the validityState, equals `valueMissing`. The erro
|
|
|
206
209
|
```html
|
|
207
210
|
<auro-select required setCustomValidityValueMissing="Custom required validation error message.">
|
|
208
211
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
212
|
+
<span slot="label">required field</span>
|
|
209
213
|
<label slot="placeholder">Placeholder Text</label>
|
|
210
214
|
<auro-menu>
|
|
211
215
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
@@ -234,6 +238,7 @@ A custom error message can be set using the `error` attribute, or it can be used
|
|
|
234
238
|
<auro-select id="errorExample" error="Custom error message">
|
|
235
239
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
236
240
|
<label slot="placeholder">Placeholder Text</label>
|
|
241
|
+
<span slot="label">error Select Example</span>
|
|
237
242
|
<auro-menu>
|
|
238
243
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
239
244
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -257,6 +262,7 @@ A custom error message can be set using the `error` attribute, or it can be used
|
|
|
257
262
|
<auro-select id="errorExample" error="Custom error message">
|
|
258
263
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
259
264
|
<label slot="placeholder">Placeholder Text</label>
|
|
265
|
+
<span slot="label">error Select Example</span>
|
|
260
266
|
<auro-menu>
|
|
261
267
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
262
268
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -279,6 +285,7 @@ Use the `disabled` boolean attribute to toggle the disabled UI.
|
|
|
279
285
|
<auro-select disabled>
|
|
280
286
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
281
287
|
<label slot="placeholder">Placeholder Text</label>
|
|
288
|
+
<span slot="label">disabled select example</span>
|
|
282
289
|
<auro-menu>
|
|
283
290
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
284
291
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -299,6 +306,7 @@ Use the `disabled` boolean attribute to toggle the disabled UI.
|
|
|
299
306
|
<auro-select disabled>
|
|
300
307
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
301
308
|
<label slot="placeholder">Placeholder Text</label>
|
|
309
|
+
<span slot="label">disabled select example</span>
|
|
302
310
|
<auro-menu>
|
|
303
311
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
304
312
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -321,6 +329,7 @@ Sets multi-select mode, allowing multiple options to be selected at once.
|
|
|
321
329
|
<auro-select multiselect>
|
|
322
330
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
323
331
|
<label slot="placeholder">Select one or more options</label>
|
|
332
|
+
<span slot="label">multiselect select example</span>
|
|
324
333
|
<auro-menu>
|
|
325
334
|
<auro-menuoption value="1">Option 1</auro-menuoption>
|
|
326
335
|
<auro-menuoption value="2">Option 2</auro-menuoption>
|
|
@@ -338,6 +347,7 @@ Sets multi-select mode, allowing multiple options to be selected at once.
|
|
|
338
347
|
<auro-select multiselect>
|
|
339
348
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
340
349
|
<label slot="placeholder">Select one or more options</label>
|
|
350
|
+
<span slot="label">multiselect select example</span>
|
|
341
351
|
<auro-menu>
|
|
342
352
|
<auro-menuoption value="1">Option 1</auro-menuoption>
|
|
343
353
|
<auro-menuoption value="2">Option 2</auro-menuoption>
|
|
@@ -355,6 +365,7 @@ Use the `flexMenuWidth` boolean attribute to toggle the width of the `<auro-sele
|
|
|
355
365
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/flexMenuWidth.html) -->
|
|
356
366
|
<!-- The below content is automatically added from ../apiExamples/flexMenuWidth.html -->
|
|
357
367
|
<auro-select flexMenuWidth id="flexMenuWidthExample">
|
|
368
|
+
<span slot="label">flexMenuWidth select example</span>
|
|
358
369
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
359
370
|
<label slot="placeholder">Placeholder Text</label>
|
|
360
371
|
<auro-menu>
|
|
@@ -379,6 +390,7 @@ Use the `flexMenuWidth` boolean attribute to toggle the width of the `<auro-sele
|
|
|
379
390
|
|
|
380
391
|
```html
|
|
381
392
|
<auro-select flexMenuWidth id="flexMenuWidthExample">
|
|
393
|
+
<span slot="label">flexMenuWidth select example</span>
|
|
382
394
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
383
395
|
<label slot="placeholder">Placeholder Text</label>
|
|
384
396
|
<auro-menu>
|
|
@@ -452,6 +464,7 @@ Use the `helptext` slot to provide additional information back to your user abou
|
|
|
452
464
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
453
465
|
<label slot="placeholder">Placeholder Text</label>
|
|
454
466
|
<span slot="helpText">Custom help text message.</span>
|
|
467
|
+
<span slot="label">helpText select example</span>
|
|
455
468
|
<auro-menu>
|
|
456
469
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
457
470
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -473,6 +486,7 @@ Use the `helptext` slot to provide additional information back to your user abou
|
|
|
473
486
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
474
487
|
<label slot="placeholder">Placeholder Text</label>
|
|
475
488
|
<span slot="helpText">Custom help text message.</span>
|
|
489
|
+
<span slot="label">helpText select example</span>
|
|
476
490
|
<auro-menu>
|
|
477
491
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
478
492
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -560,6 +574,7 @@ The following example illustrates how a user may query the `element.value` or `e
|
|
|
560
574
|
<auro-select id="valueExtraction">
|
|
561
575
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
562
576
|
<label slot="placeholder">Placeholder Text</label>
|
|
577
|
+
<span slot="label">Select Example</span>
|
|
563
578
|
<auro-menu>
|
|
564
579
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
565
580
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -581,6 +596,7 @@ The following example illustrates how a user may query the `element.value` or `e
|
|
|
581
596
|
<auro-select id="valueExtraction">
|
|
582
597
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
583
598
|
<label slot="placeholder">Placeholder Text</label>
|
|
599
|
+
<span slot="label">Select Example</span>
|
|
584
600
|
<auro-menu>
|
|
585
601
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
586
602
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -622,6 +638,7 @@ This example programmatically adds the `error` state when a user selects an opti
|
|
|
622
638
|
<auro-select id="primaryError">
|
|
623
639
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
624
640
|
<label slot="placeholder">Placeholder Text</label>
|
|
641
|
+
<span slot="label">Select Example</span>
|
|
625
642
|
<auro-menu>
|
|
626
643
|
<auro-menuoption value="1">1</auro-menuoption>
|
|
627
644
|
<auro-menuoption value="2">2</auro-menuoption>
|
|
@@ -642,6 +659,7 @@ This example programmatically adds the `error` state when a user selects an opti
|
|
|
642
659
|
<auro-select id="primaryError">
|
|
643
660
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
644
661
|
<label slot="placeholder">Placeholder Text</label>
|
|
662
|
+
<span slot="label">Select Example</span>
|
|
645
663
|
<auro-menu>
|
|
646
664
|
<auro-menuoption value="1">1</auro-menuoption>
|
|
647
665
|
<auro-menuoption value="2">2</auro-menuoption>
|
|
@@ -754,6 +772,7 @@ To support fullcreen bib, setting `bib.fullscreen.headline` is **STRONGLY RECOMM
|
|
|
754
772
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/fullscreenBreakpoint.html) -->
|
|
755
773
|
<!-- The below content is automatically added from ./../apiExamples/fullscreenBreakpoint.html -->
|
|
756
774
|
<auro-select fullscreenBreakpoint="lg">
|
|
775
|
+
<span slot="label">Select Example</span>
|
|
757
776
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
758
777
|
<auro-menu>
|
|
759
778
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
@@ -773,6 +792,7 @@ To support fullcreen bib, setting `bib.fullscreen.headline` is **STRONGLY RECOMM
|
|
|
773
792
|
|
|
774
793
|
```html
|
|
775
794
|
<auro-select fullscreenBreakpoint="lg">
|
|
795
|
+
<span slot="label">Select Example</span>
|
|
776
796
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
777
797
|
<auro-menu>
|
|
778
798
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
@@ -866,6 +886,7 @@ The following example listens for the `auroMenu-selectedOption` event. Once trig
|
|
|
866
886
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/valueAlert.html) -->
|
|
867
887
|
<!-- The below content is automatically added from ./../apiExamples/valueAlert.html -->
|
|
868
888
|
<auro-select id="valueAlert">
|
|
889
|
+
<span slot="label">Select Example</span>
|
|
869
890
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
870
891
|
<label slot="placeholder">Placeholder Text</label>
|
|
871
892
|
<auro-menu id="valueAlertMenu">
|
|
@@ -886,6 +907,7 @@ The following example listens for the `auroMenu-selectedOption` event. Once trig
|
|
|
886
907
|
|
|
887
908
|
```html
|
|
888
909
|
<auro-select id="valueAlert">
|
|
910
|
+
<span slot="label">Select Example</span>
|
|
889
911
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
890
912
|
<label slot="placeholder">Placeholder Text</label>
|
|
891
913
|
<auro-menu id="valueAlertMenu">
|
|
@@ -3231,7 +3231,7 @@ class AuroDropdownBib extends r {
|
|
|
3231
3231
|
|
|
3232
3232
|
var dropdownVersion$1 = '3.0.0';
|
|
3233
3233
|
|
|
3234
|
-
var styleCss$1$2 = i$5`:host{position:relative;display:inline-block;max-width:100%}:host([fluid]){display:block}#bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}.label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}.label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}.trigger{position:relative;display:flex;align-items:center}.trigger[showBorder]{border-width:1px;border-style:solid;cursor:pointer;outline-style:solid;outline-width:1px}@media(hover: hover){.trigger:hover{cursor:pointer}}.triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}#showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}#showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}#showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}:host([disabled]){pointer-events:none}:host([inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([common]) .trigger,:host([inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([common]) .trigger,:host([rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
|
|
3234
|
+
var styleCss$1$2 = i$5`:host{position:relative;display:inline-block;max-width:100%}:host([fluid]){display:block}#bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}.label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}.label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}.trigger{position:relative;display:flex;align-items:center}.trigger[showBorder]{border-width:1px;border-style:solid;cursor:pointer;outline-style:solid;outline-width:1px}@media(hover: hover){.trigger:hover{cursor:pointer}}.triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}#showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}#showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}#showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}:host([disabled]){pointer-events:none}:host([inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([common]) .trigger,:host([inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([inset][bordered][labeled]) .trigger{padding:var(--ds-size-100, 0.5rem) var(--ds-size-150, 0.75rem)}:host([common]) .trigger,:host([rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
|
|
3235
3235
|
|
|
3236
3236
|
var colorCss$1$2 = i$5`.label{color:var(--ds-auro-dropdown-label-text-color)}.trigger{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-container-color);color:var(--ds-auro-dropdown-trigger-text-color);outline-color:var(--ds-auro-dropdown-trigger-outline-color)}.trigger:focus-within,.trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-active-default, #0074c8);--ds-auro-dropdown-trigger-outline-color: var(--ds-color-border-active-default, #0074c8)}.trigger:focus-within:not(:active){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-focus-default, #2c67b5);--ds-auro-dropdown-trigger-outline-color: var(--ds-color-border-ui-focus-default, #2c67b5)}.trigger:hover{--ds-auro-dropdown-trigger-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-color-text-ui-disabled-default, #adadad);--ds-auro-dropdown-label-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host([common]),:host([bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-primary-default, #585e67)}:host([common]) .trigger:active,:host([common]) .trigger:focus-within,:host([bordered]) .trigger:active,:host([bordered]) .trigger:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-focus-default, #2c67b5)}:host([error]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-error-default, #cc1816)}:host([error]) .trigger{outline:solid 1px var(--ds-auro-dropdown-trigger-border-color)}:host([error]) .trigger:focus-within,:host([error]) .trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-active-default, #0074c8)}:host([error]) .trigger:active{box-shadow:none;outline:none}:host([disabled][common]),:host([disabled][bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-disabled-default, #adadad)}`;
|
|
3237
3237
|
|
|
@@ -3495,6 +3495,7 @@ class AuroDropdown extends r {
|
|
|
3495
3495
|
this.rounded = false;
|
|
3496
3496
|
this.tabIndex = 0;
|
|
3497
3497
|
this.noToggle = false;
|
|
3498
|
+
this.labeled = true;
|
|
3498
3499
|
|
|
3499
3500
|
/**
|
|
3500
3501
|
* @private
|
|
@@ -3647,7 +3648,7 @@ class AuroDropdown extends r {
|
|
|
3647
3648
|
},
|
|
3648
3649
|
|
|
3649
3650
|
/**
|
|
3650
|
-
* If true, the dropdown bib is taking the fullscreen when it's open
|
|
3651
|
+
* If true, the dropdown bib is taking the fullscreen when it's open.
|
|
3651
3652
|
*/
|
|
3652
3653
|
isBibFullscreen: {
|
|
3653
3654
|
type: Boolean,
|
|
@@ -3677,6 +3678,15 @@ class AuroDropdown extends r {
|
|
|
3677
3678
|
reflect: true
|
|
3678
3679
|
},
|
|
3679
3680
|
|
|
3681
|
+
/**
|
|
3682
|
+
* Defines if there is a label preset.
|
|
3683
|
+
* @private
|
|
3684
|
+
*/
|
|
3685
|
+
labeled: {
|
|
3686
|
+
type: Boolean,
|
|
3687
|
+
reflect: true
|
|
3688
|
+
},
|
|
3689
|
+
|
|
3680
3690
|
/**
|
|
3681
3691
|
* If declared, the popover and trigger will be set to the same width.
|
|
3682
3692
|
*/
|
|
@@ -3756,6 +3766,7 @@ class AuroDropdown extends r {
|
|
|
3756
3766
|
|
|
3757
3767
|
disconnectedCallback() {
|
|
3758
3768
|
super.disconnectedCallback();
|
|
3769
|
+
this.floater.disconnect();
|
|
3759
3770
|
}
|
|
3760
3771
|
|
|
3761
3772
|
updated(changedProperties) {
|
|
@@ -3885,13 +3896,21 @@ class AuroDropdown extends r {
|
|
|
3885
3896
|
handleTriggerContentSlotChange(event) {
|
|
3886
3897
|
this.floater.handleTriggerTabIndex();
|
|
3887
3898
|
|
|
3888
|
-
const
|
|
3899
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
|
|
3889
3900
|
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3901
|
+
if (triggerSlot) {
|
|
3902
|
+
|
|
3903
|
+
const triggerContentNodes = triggerSlot.assignedNodes();
|
|
3904
|
+
|
|
3905
|
+
if (triggerContentNodes) {
|
|
3906
|
+
|
|
3907
|
+
triggerContentNodes.forEach((node) => {
|
|
3908
|
+
if (!this.triggerContentFocusable) {
|
|
3909
|
+
this.triggerContentFocusable = this.containsFocusableElement(node);
|
|
3910
|
+
}
|
|
3911
|
+
});
|
|
3893
3912
|
}
|
|
3894
|
-
}
|
|
3913
|
+
}
|
|
3895
3914
|
|
|
3896
3915
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3897
3916
|
|
|
@@ -3945,6 +3964,29 @@ class AuroDropdown extends r {
|
|
|
3945
3964
|
}
|
|
3946
3965
|
}
|
|
3947
3966
|
|
|
3967
|
+
/**
|
|
3968
|
+
* @private
|
|
3969
|
+
* @method handleLabelSlotChange
|
|
3970
|
+
* @param {event} event - The event object representing the slot change.
|
|
3971
|
+
* @description Handles the slot change event for the label slot.
|
|
3972
|
+
*/
|
|
3973
|
+
handleLabelSlotChange (event) {
|
|
3974
|
+
|
|
3975
|
+
// Get the nodes from the event
|
|
3976
|
+
const nodes = event.target.assignedNodes();
|
|
3977
|
+
|
|
3978
|
+
// Guard clause for no nodes
|
|
3979
|
+
if (!nodes) {
|
|
3980
|
+
return;
|
|
3981
|
+
}
|
|
3982
|
+
|
|
3983
|
+
// Convert the nodes to a measurable array so we can get the length
|
|
3984
|
+
const nodesArr = Array.from(nodes);
|
|
3985
|
+
|
|
3986
|
+
// If the nodes array has a length, the dropdown is labeled
|
|
3987
|
+
this.labeled = nodesArr.length > 0;
|
|
3988
|
+
}
|
|
3989
|
+
|
|
3948
3990
|
// function that renders the HTML and CSS into the scope of the component
|
|
3949
3991
|
render() {
|
|
3950
3992
|
return u`
|
|
@@ -3959,7 +4001,7 @@ class AuroDropdown extends r {
|
|
|
3959
4001
|
>
|
|
3960
4002
|
<div class="triggerContentWrapper">
|
|
3961
4003
|
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3962
|
-
<slot name="label"></slot>
|
|
4004
|
+
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
3963
4005
|
</label>
|
|
3964
4006
|
<div class="triggerContent">
|
|
3965
4007
|
<slot
|
|
@@ -22,6 +22,7 @@ A baseline `<auro-select>` using `<auro-menu>` and `<auro-menuoption>` elements.
|
|
|
22
22
|
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
23
23
|
<auro-select>
|
|
24
24
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
25
|
+
<span slot="label">Select Example</span>
|
|
25
26
|
<auro-menu>
|
|
26
27
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
27
28
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -41,6 +42,7 @@ A baseline `<auro-select>` using `<auro-menu>` and `<auro-menuoption>` elements.
|
|
|
41
42
|
```html
|
|
42
43
|
<auro-select>
|
|
43
44
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
45
|
+
<span slot="label">Select Example</span>
|
|
44
46
|
<auro-menu>
|
|
45
47
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
46
48
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -154,6 +156,7 @@ Displays an `<auro-select>` element with `<auro-icon>` elements in each option.
|
|
|
154
156
|
<auro-select>
|
|
155
157
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
156
158
|
<label slot="placeholder">Placeholder Text</label>
|
|
159
|
+
<span slot="label">Select Example</span>
|
|
157
160
|
<auro-menu>
|
|
158
161
|
<auro-menuoption value="air">
|
|
159
162
|
<auro-icon label customColor category="health" name="air">Air</auro-icon>
|
|
@@ -183,6 +186,7 @@ Displays an `<auro-select>` element with `<auro-icon>` elements in each option.
|
|
|
183
186
|
<auro-select>
|
|
184
187
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
185
188
|
<label slot="placeholder">Placeholder Text</label>
|
|
189
|
+
<span slot="label">Select Example</span>
|
|
186
190
|
<auro-menu>
|
|
187
191
|
<auro-menuoption value="air">
|
|
188
192
|
<auro-icon label customColor category="health" name="air">Air</auro-icon>
|
|
@@ -215,6 +219,7 @@ This example shows nesting `<auro-menu>` elements to create submenus.
|
|
|
215
219
|
<auro-select>
|
|
216
220
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
217
221
|
<label slot="placeholder">Placeholder Text</label>
|
|
222
|
+
<span slot="label">Select Example</span>
|
|
218
223
|
<auro-menu>
|
|
219
224
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
220
225
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -258,6 +263,7 @@ This example shows nesting `<auro-menu>` elements to create submenus.
|
|
|
258
263
|
<auro-select>
|
|
259
264
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
260
265
|
<label slot="placeholder">Placeholder Text</label>
|
|
266
|
+
<span slot="label">Select Example</span>
|
|
261
267
|
<auro-menu>
|
|
262
268
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
263
269
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -304,6 +310,7 @@ Applying the `noCheckmark` attribute will prevent the checkmark icon from being
|
|
|
304
310
|
<auro-select nocheckmark>
|
|
305
311
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
306
312
|
<label slot="placeholder">Placeholder Text</label>
|
|
313
|
+
<span slot="label">nocheckmark Select Example</span>
|
|
307
314
|
<auro-menu>
|
|
308
315
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
309
316
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -324,6 +331,7 @@ Applying the `noCheckmark` attribute will prevent the checkmark icon from being
|
|
|
324
331
|
<auro-select nocheckmark>
|
|
325
332
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
326
333
|
<label slot="placeholder">Placeholder Text</label>
|
|
334
|
+
<span slot="label">nocheckmark Select Example</span>
|
|
327
335
|
<auro-menu>
|
|
328
336
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
329
337
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -349,6 +357,7 @@ Custom height dimensions are set by using the `dropdownSize` CSS Part and then a
|
|
|
349
357
|
<auro-select id="customBibHeightExample">
|
|
350
358
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
351
359
|
<label slot="placeholder">Placeholder Text</label>
|
|
360
|
+
<span slot="label">Select Example</span>
|
|
352
361
|
<auro-menu>
|
|
353
362
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
354
363
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -374,6 +383,7 @@ Custom height dimensions are set by using the `dropdownSize` CSS Part and then a
|
|
|
374
383
|
<auro-select id="customBibHeightExample">
|
|
375
384
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
376
385
|
<label slot="placeholder">Placeholder Text</label>
|
|
386
|
+
<span slot="label">Select Example</span>
|
|
377
387
|
<auro-menu>
|
|
378
388
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
379
389
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -400,6 +410,7 @@ Use the `error` boolean attribute to toggle the error UI.
|
|
|
400
410
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/error.html) -->
|
|
401
411
|
<!-- The below content is automatically added from ./../apiExamples/error.html -->
|
|
402
412
|
<auro-select error="Custom error message">
|
|
413
|
+
<span slot="label">error select example</span>
|
|
403
414
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
404
415
|
<label slot="placeholder">Placeholder Text</label>
|
|
405
416
|
<auro-menu>
|
|
@@ -420,6 +431,7 @@ Use the `error` boolean attribute to toggle the error UI.
|
|
|
420
431
|
|
|
421
432
|
```html
|
|
422
433
|
<auro-select error="Custom error message">
|
|
434
|
+
<span slot="label">error select example</span>
|
|
423
435
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
424
436
|
<label slot="placeholder">Placeholder Text</label>
|
|
425
437
|
<auro-menu>
|
|
@@ -445,6 +457,7 @@ Use the `disabled` boolean attribute to toggle the disabled UI.
|
|
|
445
457
|
<auro-select disabled>
|
|
446
458
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
447
459
|
<label slot="placeholder">Placeholder Text</label>
|
|
460
|
+
<span slot="label">disabled select example</span>
|
|
448
461
|
<auro-menu>
|
|
449
462
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
450
463
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -465,6 +478,7 @@ Use the `disabled` boolean attribute to toggle the disabled UI.
|
|
|
465
478
|
<auro-select disabled>
|
|
466
479
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
467
480
|
<label slot="placeholder">Placeholder Text</label>
|
|
481
|
+
<span slot="label">disabled select example</span>
|
|
468
482
|
<auro-menu>
|
|
469
483
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
470
484
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -3127,7 +3127,7 @@ class AuroDropdownBib extends r {
|
|
|
3127
3127
|
|
|
3128
3128
|
var dropdownVersion$1 = '3.0.0';
|
|
3129
3129
|
|
|
3130
|
-
var styleCss$1$2 = i$5`:host{position:relative;display:inline-block;max-width:100%}:host([fluid]){display:block}#bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}.label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}.label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}.trigger{position:relative;display:flex;align-items:center}.trigger[showBorder]{border-width:1px;border-style:solid;cursor:pointer;outline-style:solid;outline-width:1px}@media(hover: hover){.trigger:hover{cursor:pointer}}.triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}#showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}#showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}#showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}:host([disabled]){pointer-events:none}:host([inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([common]) .trigger,:host([inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([common]) .trigger,:host([rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
|
|
3130
|
+
var styleCss$1$2 = i$5`:host{position:relative;display:inline-block;max-width:100%}:host([fluid]){display:block}#bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}.label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}.label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}.trigger{position:relative;display:flex;align-items:center}.trigger[showBorder]{border-width:1px;border-style:solid;cursor:pointer;outline-style:solid;outline-width:1px}@media(hover: hover){.trigger:hover{cursor:pointer}}.triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}#showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}#showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}#showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}:host([disabled]){pointer-events:none}:host([inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([common]) .trigger,:host([inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([inset][bordered][labeled]) .trigger{padding:var(--ds-size-100, 0.5rem) var(--ds-size-150, 0.75rem)}:host([common]) .trigger,:host([rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
|
|
3131
3131
|
|
|
3132
3132
|
var colorCss$1$2 = i$5`.label{color:var(--ds-auro-dropdown-label-text-color)}.trigger{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-container-color);color:var(--ds-auro-dropdown-trigger-text-color);outline-color:var(--ds-auro-dropdown-trigger-outline-color)}.trigger:focus-within,.trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-active-default, #0074c8);--ds-auro-dropdown-trigger-outline-color: var(--ds-color-border-active-default, #0074c8)}.trigger:focus-within:not(:active){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-focus-default, #2c67b5);--ds-auro-dropdown-trigger-outline-color: var(--ds-color-border-ui-focus-default, #2c67b5)}.trigger:hover{--ds-auro-dropdown-trigger-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-color-text-ui-disabled-default, #adadad);--ds-auro-dropdown-label-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host([common]),:host([bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-primary-default, #585e67)}:host([common]) .trigger:active,:host([common]) .trigger:focus-within,:host([bordered]) .trigger:active,:host([bordered]) .trigger:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-focus-default, #2c67b5)}:host([error]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-error-default, #cc1816)}:host([error]) .trigger{outline:solid 1px var(--ds-auro-dropdown-trigger-border-color)}:host([error]) .trigger:focus-within,:host([error]) .trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-active-default, #0074c8)}:host([error]) .trigger:active{box-shadow:none;outline:none}:host([disabled][common]),:host([disabled][bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-disabled-default, #adadad)}`;
|
|
3133
3133
|
|
|
@@ -3391,6 +3391,7 @@ class AuroDropdown extends r {
|
|
|
3391
3391
|
this.rounded = false;
|
|
3392
3392
|
this.tabIndex = 0;
|
|
3393
3393
|
this.noToggle = false;
|
|
3394
|
+
this.labeled = true;
|
|
3394
3395
|
|
|
3395
3396
|
/**
|
|
3396
3397
|
* @private
|
|
@@ -3543,7 +3544,7 @@ class AuroDropdown extends r {
|
|
|
3543
3544
|
},
|
|
3544
3545
|
|
|
3545
3546
|
/**
|
|
3546
|
-
* If true, the dropdown bib is taking the fullscreen when it's open
|
|
3547
|
+
* If true, the dropdown bib is taking the fullscreen when it's open.
|
|
3547
3548
|
*/
|
|
3548
3549
|
isBibFullscreen: {
|
|
3549
3550
|
type: Boolean,
|
|
@@ -3573,6 +3574,15 @@ class AuroDropdown extends r {
|
|
|
3573
3574
|
reflect: true
|
|
3574
3575
|
},
|
|
3575
3576
|
|
|
3577
|
+
/**
|
|
3578
|
+
* Defines if there is a label preset.
|
|
3579
|
+
* @private
|
|
3580
|
+
*/
|
|
3581
|
+
labeled: {
|
|
3582
|
+
type: Boolean,
|
|
3583
|
+
reflect: true
|
|
3584
|
+
},
|
|
3585
|
+
|
|
3576
3586
|
/**
|
|
3577
3587
|
* If declared, the popover and trigger will be set to the same width.
|
|
3578
3588
|
*/
|
|
@@ -3652,6 +3662,7 @@ class AuroDropdown extends r {
|
|
|
3652
3662
|
|
|
3653
3663
|
disconnectedCallback() {
|
|
3654
3664
|
super.disconnectedCallback();
|
|
3665
|
+
this.floater.disconnect();
|
|
3655
3666
|
}
|
|
3656
3667
|
|
|
3657
3668
|
updated(changedProperties) {
|
|
@@ -3781,13 +3792,21 @@ class AuroDropdown extends r {
|
|
|
3781
3792
|
handleTriggerContentSlotChange(event) {
|
|
3782
3793
|
this.floater.handleTriggerTabIndex();
|
|
3783
3794
|
|
|
3784
|
-
const
|
|
3795
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
|
|
3785
3796
|
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3797
|
+
if (triggerSlot) {
|
|
3798
|
+
|
|
3799
|
+
const triggerContentNodes = triggerSlot.assignedNodes();
|
|
3800
|
+
|
|
3801
|
+
if (triggerContentNodes) {
|
|
3802
|
+
|
|
3803
|
+
triggerContentNodes.forEach((node) => {
|
|
3804
|
+
if (!this.triggerContentFocusable) {
|
|
3805
|
+
this.triggerContentFocusable = this.containsFocusableElement(node);
|
|
3806
|
+
}
|
|
3807
|
+
});
|
|
3789
3808
|
}
|
|
3790
|
-
}
|
|
3809
|
+
}
|
|
3791
3810
|
|
|
3792
3811
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3793
3812
|
|
|
@@ -3841,6 +3860,29 @@ class AuroDropdown extends r {
|
|
|
3841
3860
|
}
|
|
3842
3861
|
}
|
|
3843
3862
|
|
|
3863
|
+
/**
|
|
3864
|
+
* @private
|
|
3865
|
+
* @method handleLabelSlotChange
|
|
3866
|
+
* @param {event} event - The event object representing the slot change.
|
|
3867
|
+
* @description Handles the slot change event for the label slot.
|
|
3868
|
+
*/
|
|
3869
|
+
handleLabelSlotChange (event) {
|
|
3870
|
+
|
|
3871
|
+
// Get the nodes from the event
|
|
3872
|
+
const nodes = event.target.assignedNodes();
|
|
3873
|
+
|
|
3874
|
+
// Guard clause for no nodes
|
|
3875
|
+
if (!nodes) {
|
|
3876
|
+
return;
|
|
3877
|
+
}
|
|
3878
|
+
|
|
3879
|
+
// Convert the nodes to a measurable array so we can get the length
|
|
3880
|
+
const nodesArr = Array.from(nodes);
|
|
3881
|
+
|
|
3882
|
+
// If the nodes array has a length, the dropdown is labeled
|
|
3883
|
+
this.labeled = nodesArr.length > 0;
|
|
3884
|
+
}
|
|
3885
|
+
|
|
3844
3886
|
// function that renders the HTML and CSS into the scope of the component
|
|
3845
3887
|
render() {
|
|
3846
3888
|
return u`
|
|
@@ -3855,7 +3897,7 @@ class AuroDropdown extends r {
|
|
|
3855
3897
|
>
|
|
3856
3898
|
<div class="triggerContentWrapper">
|
|
3857
3899
|
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3858
|
-
<slot name="label"></slot>
|
|
3900
|
+
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
3859
3901
|
</label>
|
|
3860
3902
|
<div class="triggerContent">
|
|
3861
3903
|
<slot
|
|
@@ -85,6 +85,7 @@ This configuration enables proper module resolution for the component's TypeScri
|
|
|
85
85
|
```html
|
|
86
86
|
<auro-select>
|
|
87
87
|
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
88
|
+
<span slot="label">Select Example</span>
|
|
88
89
|
<auro-menu>
|
|
89
90
|
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
90
91
|
<auro-menuoption value="price">Price</auro-menuoption>
|
|
@@ -110,7 +111,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
110
111
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
111
112
|
|
|
112
113
|
```html
|
|
113
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.
|
|
114
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.4/auro-select/+esm"></script>
|
|
114
115
|
```
|
|
115
116
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
117
|
|
|
@@ -3080,7 +3080,7 @@ class AuroDropdownBib extends LitElement {
|
|
|
3080
3080
|
|
|
3081
3081
|
var dropdownVersion$1 = '3.0.0';
|
|
3082
3082
|
|
|
3083
|
-
var styleCss$1$1 = css`:host{position:relative;display:inline-block;max-width:100%}:host([fluid]){display:block}#bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}.label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}.label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}.trigger{position:relative;display:flex;align-items:center}.trigger[showBorder]{border-width:1px;border-style:solid;cursor:pointer;outline-style:solid;outline-width:1px}@media(hover: hover){.trigger:hover{cursor:pointer}}.triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}#showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}#showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}#showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}:host([disabled]){pointer-events:none}:host([inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([common]) .trigger,:host([inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([common]) .trigger,:host([rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
|
|
3083
|
+
var styleCss$1$1 = css`:host{position:relative;display:inline-block;max-width:100%}:host([fluid]){display:block}#bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}.label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}.label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}.trigger{position:relative;display:flex;align-items:center}.trigger[showBorder]{border-width:1px;border-style:solid;cursor:pointer;outline-style:solid;outline-width:1px}@media(hover: hover){.trigger:hover{cursor:pointer}}.triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}#showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}#showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}#showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}:host([disabled]){pointer-events:none}:host([inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([common]) .trigger,:host([inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([inset][bordered][labeled]) .trigger{padding:var(--ds-size-100, 0.5rem) var(--ds-size-150, 0.75rem)}:host([common]) .trigger,:host([rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
|
|
3084
3084
|
|
|
3085
3085
|
var colorCss$1$1 = css`.label{color:var(--ds-auro-dropdown-label-text-color)}.trigger{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-container-color);color:var(--ds-auro-dropdown-trigger-text-color);outline-color:var(--ds-auro-dropdown-trigger-outline-color)}.trigger:focus-within,.trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-active-default, #0074c8);--ds-auro-dropdown-trigger-outline-color: var(--ds-color-border-active-default, #0074c8)}.trigger:focus-within:not(:active){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-focus-default, #2c67b5);--ds-auro-dropdown-trigger-outline-color: var(--ds-color-border-ui-focus-default, #2c67b5)}.trigger:hover{--ds-auro-dropdown-trigger-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-color-text-ui-disabled-default, #adadad);--ds-auro-dropdown-label-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host([common]),:host([bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-primary-default, #585e67)}:host([common]) .trigger:active,:host([common]) .trigger:focus-within,:host([bordered]) .trigger:active,:host([bordered]) .trigger:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-focus-default, #2c67b5)}:host([error]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-error-default, #cc1816)}:host([error]) .trigger{outline:solid 1px var(--ds-auro-dropdown-trigger-border-color)}:host([error]) .trigger:focus-within,:host([error]) .trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-active-default, #0074c8)}:host([error]) .trigger:active{box-shadow:none;outline:none}:host([disabled][common]),:host([disabled][bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-disabled-default, #adadad)}`;
|
|
3086
3086
|
|
|
@@ -3344,6 +3344,7 @@ class AuroDropdown extends LitElement {
|
|
|
3344
3344
|
this.rounded = false;
|
|
3345
3345
|
this.tabIndex = 0;
|
|
3346
3346
|
this.noToggle = false;
|
|
3347
|
+
this.labeled = true;
|
|
3347
3348
|
|
|
3348
3349
|
/**
|
|
3349
3350
|
* @private
|
|
@@ -3496,7 +3497,7 @@ class AuroDropdown extends LitElement {
|
|
|
3496
3497
|
},
|
|
3497
3498
|
|
|
3498
3499
|
/**
|
|
3499
|
-
* If true, the dropdown bib is taking the fullscreen when it's open
|
|
3500
|
+
* If true, the dropdown bib is taking the fullscreen when it's open.
|
|
3500
3501
|
*/
|
|
3501
3502
|
isBibFullscreen: {
|
|
3502
3503
|
type: Boolean,
|
|
@@ -3526,6 +3527,15 @@ class AuroDropdown extends LitElement {
|
|
|
3526
3527
|
reflect: true
|
|
3527
3528
|
},
|
|
3528
3529
|
|
|
3530
|
+
/**
|
|
3531
|
+
* Defines if there is a label preset.
|
|
3532
|
+
* @private
|
|
3533
|
+
*/
|
|
3534
|
+
labeled: {
|
|
3535
|
+
type: Boolean,
|
|
3536
|
+
reflect: true
|
|
3537
|
+
},
|
|
3538
|
+
|
|
3529
3539
|
/**
|
|
3530
3540
|
* If declared, the popover and trigger will be set to the same width.
|
|
3531
3541
|
*/
|
|
@@ -3605,6 +3615,7 @@ class AuroDropdown extends LitElement {
|
|
|
3605
3615
|
|
|
3606
3616
|
disconnectedCallback() {
|
|
3607
3617
|
super.disconnectedCallback();
|
|
3618
|
+
this.floater.disconnect();
|
|
3608
3619
|
}
|
|
3609
3620
|
|
|
3610
3621
|
updated(changedProperties) {
|
|
@@ -3734,13 +3745,21 @@ class AuroDropdown extends LitElement {
|
|
|
3734
3745
|
handleTriggerContentSlotChange(event) {
|
|
3735
3746
|
this.floater.handleTriggerTabIndex();
|
|
3736
3747
|
|
|
3737
|
-
const
|
|
3748
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
|
|
3738
3749
|
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3750
|
+
if (triggerSlot) {
|
|
3751
|
+
|
|
3752
|
+
const triggerContentNodes = triggerSlot.assignedNodes();
|
|
3753
|
+
|
|
3754
|
+
if (triggerContentNodes) {
|
|
3755
|
+
|
|
3756
|
+
triggerContentNodes.forEach((node) => {
|
|
3757
|
+
if (!this.triggerContentFocusable) {
|
|
3758
|
+
this.triggerContentFocusable = this.containsFocusableElement(node);
|
|
3759
|
+
}
|
|
3760
|
+
});
|
|
3742
3761
|
}
|
|
3743
|
-
}
|
|
3762
|
+
}
|
|
3744
3763
|
|
|
3745
3764
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3746
3765
|
|
|
@@ -3794,6 +3813,29 @@ class AuroDropdown extends LitElement {
|
|
|
3794
3813
|
}
|
|
3795
3814
|
}
|
|
3796
3815
|
|
|
3816
|
+
/**
|
|
3817
|
+
* @private
|
|
3818
|
+
* @method handleLabelSlotChange
|
|
3819
|
+
* @param {event} event - The event object representing the slot change.
|
|
3820
|
+
* @description Handles the slot change event for the label slot.
|
|
3821
|
+
*/
|
|
3822
|
+
handleLabelSlotChange (event) {
|
|
3823
|
+
|
|
3824
|
+
// Get the nodes from the event
|
|
3825
|
+
const nodes = event.target.assignedNodes();
|
|
3826
|
+
|
|
3827
|
+
// Guard clause for no nodes
|
|
3828
|
+
if (!nodes) {
|
|
3829
|
+
return;
|
|
3830
|
+
}
|
|
3831
|
+
|
|
3832
|
+
// Convert the nodes to a measurable array so we can get the length
|
|
3833
|
+
const nodesArr = Array.from(nodes);
|
|
3834
|
+
|
|
3835
|
+
// If the nodes array has a length, the dropdown is labeled
|
|
3836
|
+
this.labeled = nodesArr.length > 0;
|
|
3837
|
+
}
|
|
3838
|
+
|
|
3797
3839
|
// function that renders the HTML and CSS into the scope of the component
|
|
3798
3840
|
render() {
|
|
3799
3841
|
return html`
|
|
@@ -3808,7 +3850,7 @@ class AuroDropdown extends LitElement {
|
|
|
3808
3850
|
>
|
|
3809
3851
|
<div class="triggerContentWrapper">
|
|
3810
3852
|
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3811
|
-
<slot name="label"></slot>
|
|
3853
|
+
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
3812
3854
|
</label>
|
|
3813
3855
|
<div class="triggerContent">
|
|
3814
3856
|
<slot
|