@aurodesignsystem/auro-formkit 3.2.1 → 3.3.0-beta.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/CHANGELOG.md +7 -2
- package/components/combobox/demo/api.md +1 -1
- package/components/combobox/demo/api.min.js +26 -9
- package/components/combobox/demo/index.min.js +26 -9
- package/components/combobox/dist/auro-combobox.d.ts +5 -2
- package/components/combobox/dist/index.js +26 -9
- package/components/combobox/dist/registered.js +26 -9
- package/components/counter/demo/api.md +1 -1
- package/components/counter/demo/api.min.js +26 -5
- package/components/counter/demo/index.min.js +26 -5
- package/components/counter/dist/auro-counter-group.d.ts +5 -2
- package/components/counter/dist/index.js +26 -5
- package/components/counter/dist/registered.js +26 -5
- package/components/datepicker/demo/api.md +1 -0
- package/components/datepicker/demo/api.min.js +36 -4
- package/components/datepicker/demo/index.min.js +36 -4
- package/components/datepicker/dist/auro-datepicker.d.ts +13 -0
- package/components/datepicker/dist/index.js +36 -4
- package/components/datepicker/dist/registered.js +36 -4
- package/components/dropdown/demo/api.md +1 -1
- package/components/dropdown/demo/api.min.js +21 -3
- package/components/dropdown/demo/index.md +83 -0
- package/components/dropdown/demo/index.min.js +21 -3
- package/components/dropdown/dist/auro-dropdown.d.ts +12 -1
- package/components/dropdown/dist/index.js +21 -3
- package/components/dropdown/dist/registered.js +21 -3
- package/components/form/demo/autocomplete.html +15 -0
- package/components/select/demo/api.md +1 -1
- package/components/select/demo/api.min.js +26 -5
- package/components/select/demo/index.md +46 -1
- package/components/select/demo/index.min.js +26 -5
- package/components/select/dist/auro-select.d.ts +5 -2
- package/components/select/dist/index.js +26 -5
- package/components/select/dist/registered.js +26 -5
- package/package.json +1 -1
|
@@ -2653,6 +2653,7 @@ var tokensCss$1 = i$3`:host{--ds-auro-dropdown-label-text-color: var(--ds-basic-
|
|
|
2653
2653
|
|
|
2654
2654
|
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
2655
2655
|
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
2656
|
+
'xl',
|
|
2656
2657
|
'lg',
|
|
2657
2658
|
'md',
|
|
2658
2659
|
'sm',
|
|
@@ -2724,6 +2725,7 @@ class AuroDropdownBib extends r {
|
|
|
2724
2725
|
|
|
2725
2726
|
set mobileFullscreenBreakpoint(value) {
|
|
2726
2727
|
// verify the defined breakpoint is valid and exit out if not
|
|
2728
|
+
// 'disabled' is a design token breakpoint so it acts as our "undefined" value
|
|
2727
2729
|
const validatedValue = DESIGN_TOKEN_BREAKPOINT_OPTIONS.includes(value) ? value : undefined;
|
|
2728
2730
|
if (!validatedValue) {
|
|
2729
2731
|
this._mobileBreakpointValue = undefined;
|
|
@@ -3249,7 +3251,12 @@ class AuroDropdown extends r {
|
|
|
3249
3251
|
},
|
|
3250
3252
|
|
|
3251
3253
|
/**
|
|
3252
|
-
* Defines the screen size breakpoint (`
|
|
3254
|
+
* Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
|
|
3255
|
+
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
3256
|
+
*
|
|
3257
|
+
* When expanded, the dropdown will automatically display in fullscreen mode
|
|
3258
|
+
* if the screen size is equal to or smaller than the selected breakpoint.
|
|
3259
|
+
* @default sm
|
|
3253
3260
|
*/
|
|
3254
3261
|
fullscreenBreakpoint: {
|
|
3255
3262
|
type: String,
|
|
@@ -3389,6 +3396,15 @@ class AuroDropdown extends r {
|
|
|
3389
3396
|
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroDropdown);
|
|
3390
3397
|
}
|
|
3391
3398
|
|
|
3399
|
+
/**
|
|
3400
|
+
* Accessor for reusing the focusable entity query string.
|
|
3401
|
+
* @private
|
|
3402
|
+
* @returns {string}
|
|
3403
|
+
*/
|
|
3404
|
+
get focusableEntityQuery () {
|
|
3405
|
+
return 'auro-input, [auro-input], auro-button, [auro-button], button, input';
|
|
3406
|
+
}
|
|
3407
|
+
|
|
3392
3408
|
connectedCallback() {
|
|
3393
3409
|
super.connectedCallback();
|
|
3394
3410
|
}
|
|
@@ -3402,6 +3418,8 @@ class AuroDropdown extends r {
|
|
|
3402
3418
|
updated(changedProperties) {
|
|
3403
3419
|
this.floater.handleUpdate(changedProperties);
|
|
3404
3420
|
|
|
3421
|
+
// Note: `disabled` is not a breakpoint (it is not a screen size),
|
|
3422
|
+
// so it looks like we never consume this - however, dropdownBib handles this in the setter as "undefined"
|
|
3405
3423
|
if (changedProperties.has('fullscreenBreakpoint')) {
|
|
3406
3424
|
this.bibContent.mobileFullscreenBreakpoint = this.fullscreenBreakpoint;
|
|
3407
3425
|
}
|
|
@@ -3552,7 +3570,7 @@ class AuroDropdown extends r {
|
|
|
3552
3570
|
|
|
3553
3571
|
this.triggerContentSlot.forEach((node) => {
|
|
3554
3572
|
if (node.querySelectorAll) {
|
|
3555
|
-
const auroElements = node.querySelectorAll(
|
|
3573
|
+
const auroElements = node.querySelectorAll(this.focusableEntityQuery);
|
|
3556
3574
|
auroElements.forEach((auroEl) => {
|
|
3557
3575
|
auroEl.addEventListener('focus', this.bindFocusEventToTrigger);
|
|
3558
3576
|
auroEl.addEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -3573,7 +3591,7 @@ class AuroDropdown extends r {
|
|
|
3573
3591
|
|
|
3574
3592
|
this.triggerContentSlot.forEach((node) => {
|
|
3575
3593
|
if (node.querySelectorAll) {
|
|
3576
|
-
const auroElements = node.querySelectorAll(
|
|
3594
|
+
const auroElements = node.querySelectorAll(this.focusableEntityQuery);
|
|
3577
3595
|
auroElements.forEach((auroEl) => {
|
|
3578
3596
|
auroEl.removeEventListener('focus', this.bindFocusEventToTrigger);
|
|
3579
3597
|
auroEl.removeEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -411,6 +411,89 @@ To make the dropdown to be just big as the trigger's content, style the `auro-dr
|
|
|
411
411
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
412
412
|
</auro-accordion>
|
|
413
413
|
|
|
414
|
+
## Triggering a fullscreen dropdown
|
|
415
|
+
This example shows how to set a dropdown fullscreen breakpoint attribute. Most consuming components use `sm` by default, but
|
|
416
|
+
dropdown supports `xs`, `sm`, `md`, `lg`, `xl` and `disabled`, with `disabled` ensuring that the dropdown will never be fullscreen.
|
|
417
|
+
|
|
418
|
+
<div class="exampleWrapper">
|
|
419
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/fullscreen.html) -->
|
|
420
|
+
<!-- The below content is automatically added from ./../apiExamples/fullscreen.html -->
|
|
421
|
+
<h3>Never fullscreen</h3>
|
|
422
|
+
<auro-dropdown id="common-never-fullscreen" common aria-label="Label content for screen reader" fullscreenBreakpoint="disabled">
|
|
423
|
+
<div style="padding: var(--ds-size-150);">
|
|
424
|
+
Lorem ipsum solar
|
|
425
|
+
<br />
|
|
426
|
+
<auro-button onclick="document.querySelector('#common-never-fullscreen').hide()">
|
|
427
|
+
Dismiss Dropdown
|
|
428
|
+
</auro-button>
|
|
429
|
+
</div>
|
|
430
|
+
<span slot="helpText">
|
|
431
|
+
Help text
|
|
432
|
+
</span>
|
|
433
|
+
<div slot="trigger">
|
|
434
|
+
Trigger
|
|
435
|
+
</div>
|
|
436
|
+
</auro-dropdown>
|
|
437
|
+
<h3>Always fullscreen</h3>
|
|
438
|
+
<auro-dropdown id="common-always-fullscreen" common aria-label="Label content for screen reader" fullscreenBreakpoint="xl">
|
|
439
|
+
<div style="padding: var(--ds-size-150);">
|
|
440
|
+
Lorem ipsum solar
|
|
441
|
+
<br />
|
|
442
|
+
<auro-button onclick="document.querySelector('#common-always-fullscreen').hide()">
|
|
443
|
+
Dismiss Dropdown
|
|
444
|
+
</auro-button>
|
|
445
|
+
</div>
|
|
446
|
+
<span slot="helpText">
|
|
447
|
+
Help text
|
|
448
|
+
</span>
|
|
449
|
+
<div slot="trigger">
|
|
450
|
+
Trigger
|
|
451
|
+
</div>
|
|
452
|
+
</auro-dropdown>
|
|
453
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
454
|
+
</div>
|
|
455
|
+
<auro-accordion alignRight>
|
|
456
|
+
<span slot="trigger">See code</span>
|
|
457
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/fullscreen.html) -->
|
|
458
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/fullscreen.html -->
|
|
459
|
+
|
|
460
|
+
```html
|
|
461
|
+
<h3>Never fullscreen</h3>
|
|
462
|
+
<auro-dropdown id="common-never-fullscreen" common aria-label="Label content for screen reader" fullscreenBreakpoint="disabled">
|
|
463
|
+
<div style="padding: var(--ds-size-150);">
|
|
464
|
+
Lorem ipsum solar
|
|
465
|
+
<br />
|
|
466
|
+
<auro-button onclick="document.querySelector('#common-never-fullscreen').hide()">
|
|
467
|
+
Dismiss Dropdown
|
|
468
|
+
</auro-button>
|
|
469
|
+
</div>
|
|
470
|
+
<span slot="helpText">
|
|
471
|
+
Help text
|
|
472
|
+
</span>
|
|
473
|
+
<div slot="trigger">
|
|
474
|
+
Trigger
|
|
475
|
+
</div>
|
|
476
|
+
</auro-dropdown>
|
|
477
|
+
<h3>Always fullscreen</h3>
|
|
478
|
+
<auro-dropdown id="common-always-fullscreen" common aria-label="Label content for screen reader" fullscreenBreakpoint="xl">
|
|
479
|
+
<div style="padding: var(--ds-size-150);">
|
|
480
|
+
Lorem ipsum solar
|
|
481
|
+
<br />
|
|
482
|
+
<auro-button onclick="document.querySelector('#common-always-fullscreen').hide()">
|
|
483
|
+
Dismiss Dropdown
|
|
484
|
+
</auro-button>
|
|
485
|
+
</div>
|
|
486
|
+
<span slot="helpText">
|
|
487
|
+
Help text
|
|
488
|
+
</span>
|
|
489
|
+
<div slot="trigger">
|
|
490
|
+
Trigger
|
|
491
|
+
</div>
|
|
492
|
+
</auro-dropdown>
|
|
493
|
+
```
|
|
494
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
495
|
+
</auro-accordion>
|
|
496
|
+
|
|
414
497
|
## Supported standard and accessible interactions
|
|
415
498
|
|
|
416
499
|
The dropdown can be opened with the following actions:
|
|
@@ -2628,6 +2628,7 @@ var tokensCss$1 = i$3`:host{--ds-auro-dropdown-label-text-color: var(--ds-basic-
|
|
|
2628
2628
|
|
|
2629
2629
|
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
2630
2630
|
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
2631
|
+
'xl',
|
|
2631
2632
|
'lg',
|
|
2632
2633
|
'md',
|
|
2633
2634
|
'sm',
|
|
@@ -2699,6 +2700,7 @@ class AuroDropdownBib extends r {
|
|
|
2699
2700
|
|
|
2700
2701
|
set mobileFullscreenBreakpoint(value) {
|
|
2701
2702
|
// verify the defined breakpoint is valid and exit out if not
|
|
2703
|
+
// 'disabled' is a design token breakpoint so it acts as our "undefined" value
|
|
2702
2704
|
const validatedValue = DESIGN_TOKEN_BREAKPOINT_OPTIONS.includes(value) ? value : undefined;
|
|
2703
2705
|
if (!validatedValue) {
|
|
2704
2706
|
this._mobileBreakpointValue = undefined;
|
|
@@ -3224,7 +3226,12 @@ class AuroDropdown extends r {
|
|
|
3224
3226
|
},
|
|
3225
3227
|
|
|
3226
3228
|
/**
|
|
3227
|
-
* Defines the screen size breakpoint (`
|
|
3229
|
+
* Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
|
|
3230
|
+
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
3231
|
+
*
|
|
3232
|
+
* When expanded, the dropdown will automatically display in fullscreen mode
|
|
3233
|
+
* if the screen size is equal to or smaller than the selected breakpoint.
|
|
3234
|
+
* @default sm
|
|
3228
3235
|
*/
|
|
3229
3236
|
fullscreenBreakpoint: {
|
|
3230
3237
|
type: String,
|
|
@@ -3364,6 +3371,15 @@ class AuroDropdown extends r {
|
|
|
3364
3371
|
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroDropdown);
|
|
3365
3372
|
}
|
|
3366
3373
|
|
|
3374
|
+
/**
|
|
3375
|
+
* Accessor for reusing the focusable entity query string.
|
|
3376
|
+
* @private
|
|
3377
|
+
* @returns {string}
|
|
3378
|
+
*/
|
|
3379
|
+
get focusableEntityQuery () {
|
|
3380
|
+
return 'auro-input, [auro-input], auro-button, [auro-button], button, input';
|
|
3381
|
+
}
|
|
3382
|
+
|
|
3367
3383
|
connectedCallback() {
|
|
3368
3384
|
super.connectedCallback();
|
|
3369
3385
|
}
|
|
@@ -3377,6 +3393,8 @@ class AuroDropdown extends r {
|
|
|
3377
3393
|
updated(changedProperties) {
|
|
3378
3394
|
this.floater.handleUpdate(changedProperties);
|
|
3379
3395
|
|
|
3396
|
+
// Note: `disabled` is not a breakpoint (it is not a screen size),
|
|
3397
|
+
// so it looks like we never consume this - however, dropdownBib handles this in the setter as "undefined"
|
|
3380
3398
|
if (changedProperties.has('fullscreenBreakpoint')) {
|
|
3381
3399
|
this.bibContent.mobileFullscreenBreakpoint = this.fullscreenBreakpoint;
|
|
3382
3400
|
}
|
|
@@ -3527,7 +3545,7 @@ class AuroDropdown extends r {
|
|
|
3527
3545
|
|
|
3528
3546
|
this.triggerContentSlot.forEach((node) => {
|
|
3529
3547
|
if (node.querySelectorAll) {
|
|
3530
|
-
const auroElements = node.querySelectorAll(
|
|
3548
|
+
const auroElements = node.querySelectorAll(this.focusableEntityQuery);
|
|
3531
3549
|
auroElements.forEach((auroEl) => {
|
|
3532
3550
|
auroEl.addEventListener('focus', this.bindFocusEventToTrigger);
|
|
3533
3551
|
auroEl.addEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -3548,7 +3566,7 @@ class AuroDropdown extends r {
|
|
|
3548
3566
|
|
|
3549
3567
|
this.triggerContentSlot.forEach((node) => {
|
|
3550
3568
|
if (node.querySelectorAll) {
|
|
3551
|
-
const auroElements = node.querySelectorAll(
|
|
3569
|
+
const auroElements = node.querySelectorAll(this.focusableEntityQuery);
|
|
3552
3570
|
auroElements.forEach((auroEl) => {
|
|
3553
3571
|
auroEl.removeEventListener('focus', this.bindFocusEventToTrigger);
|
|
3554
3572
|
auroEl.removeEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -120,7 +120,12 @@ export class AuroDropdown extends LitElement {
|
|
|
120
120
|
type: BooleanConstructor;
|
|
121
121
|
};
|
|
122
122
|
/**
|
|
123
|
-
* Defines the screen size breakpoint (`
|
|
123
|
+
* Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
|
|
124
|
+
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
125
|
+
*
|
|
126
|
+
* When expanded, the dropdown will automatically display in fullscreen mode
|
|
127
|
+
* if the screen size is equal to or smaller than the selected breakpoint.
|
|
128
|
+
* @default sm
|
|
124
129
|
*/
|
|
125
130
|
fullscreenBreakpoint: {
|
|
126
131
|
type: StringConstructor;
|
|
@@ -320,6 +325,12 @@ export class AuroDropdown extends LitElement {
|
|
|
320
325
|
* @returns {void}
|
|
321
326
|
*/
|
|
322
327
|
show(): void;
|
|
328
|
+
/**
|
|
329
|
+
* Accessor for reusing the focusable entity query string.
|
|
330
|
+
* @private
|
|
331
|
+
* @returns {string}
|
|
332
|
+
*/
|
|
333
|
+
private get focusableEntityQuery();
|
|
323
334
|
updated(changedProperties: any): void;
|
|
324
335
|
firstUpdated(): void;
|
|
325
336
|
dropdownId: any;
|
|
@@ -2581,6 +2581,7 @@ var tokensCss$1 = css`:host{--ds-auro-dropdown-label-text-color: var(--ds-basic-
|
|
|
2581
2581
|
|
|
2582
2582
|
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
2583
2583
|
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
2584
|
+
'xl',
|
|
2584
2585
|
'lg',
|
|
2585
2586
|
'md',
|
|
2586
2587
|
'sm',
|
|
@@ -2652,6 +2653,7 @@ class AuroDropdownBib extends LitElement {
|
|
|
2652
2653
|
|
|
2653
2654
|
set mobileFullscreenBreakpoint(value) {
|
|
2654
2655
|
// verify the defined breakpoint is valid and exit out if not
|
|
2656
|
+
// 'disabled' is a design token breakpoint so it acts as our "undefined" value
|
|
2655
2657
|
const validatedValue = DESIGN_TOKEN_BREAKPOINT_OPTIONS.includes(value) ? value : undefined;
|
|
2656
2658
|
if (!validatedValue) {
|
|
2657
2659
|
this._mobileBreakpointValue = undefined;
|
|
@@ -3177,7 +3179,12 @@ class AuroDropdown extends LitElement {
|
|
|
3177
3179
|
},
|
|
3178
3180
|
|
|
3179
3181
|
/**
|
|
3180
|
-
* Defines the screen size breakpoint (`
|
|
3182
|
+
* Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
|
|
3183
|
+
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
3184
|
+
*
|
|
3185
|
+
* When expanded, the dropdown will automatically display in fullscreen mode
|
|
3186
|
+
* if the screen size is equal to or smaller than the selected breakpoint.
|
|
3187
|
+
* @default sm
|
|
3181
3188
|
*/
|
|
3182
3189
|
fullscreenBreakpoint: {
|
|
3183
3190
|
type: String,
|
|
@@ -3317,6 +3324,15 @@ class AuroDropdown extends LitElement {
|
|
|
3317
3324
|
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroDropdown);
|
|
3318
3325
|
}
|
|
3319
3326
|
|
|
3327
|
+
/**
|
|
3328
|
+
* Accessor for reusing the focusable entity query string.
|
|
3329
|
+
* @private
|
|
3330
|
+
* @returns {string}
|
|
3331
|
+
*/
|
|
3332
|
+
get focusableEntityQuery () {
|
|
3333
|
+
return 'auro-input, [auro-input], auro-button, [auro-button], button, input';
|
|
3334
|
+
}
|
|
3335
|
+
|
|
3320
3336
|
connectedCallback() {
|
|
3321
3337
|
super.connectedCallback();
|
|
3322
3338
|
}
|
|
@@ -3330,6 +3346,8 @@ class AuroDropdown extends LitElement {
|
|
|
3330
3346
|
updated(changedProperties) {
|
|
3331
3347
|
this.floater.handleUpdate(changedProperties);
|
|
3332
3348
|
|
|
3349
|
+
// Note: `disabled` is not a breakpoint (it is not a screen size),
|
|
3350
|
+
// so it looks like we never consume this - however, dropdownBib handles this in the setter as "undefined"
|
|
3333
3351
|
if (changedProperties.has('fullscreenBreakpoint')) {
|
|
3334
3352
|
this.bibContent.mobileFullscreenBreakpoint = this.fullscreenBreakpoint;
|
|
3335
3353
|
}
|
|
@@ -3480,7 +3498,7 @@ class AuroDropdown extends LitElement {
|
|
|
3480
3498
|
|
|
3481
3499
|
this.triggerContentSlot.forEach((node) => {
|
|
3482
3500
|
if (node.querySelectorAll) {
|
|
3483
|
-
const auroElements = node.querySelectorAll(
|
|
3501
|
+
const auroElements = node.querySelectorAll(this.focusableEntityQuery);
|
|
3484
3502
|
auroElements.forEach((auroEl) => {
|
|
3485
3503
|
auroEl.addEventListener('focus', this.bindFocusEventToTrigger);
|
|
3486
3504
|
auroEl.addEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -3501,7 +3519,7 @@ class AuroDropdown extends LitElement {
|
|
|
3501
3519
|
|
|
3502
3520
|
this.triggerContentSlot.forEach((node) => {
|
|
3503
3521
|
if (node.querySelectorAll) {
|
|
3504
|
-
const auroElements = node.querySelectorAll(
|
|
3522
|
+
const auroElements = node.querySelectorAll(this.focusableEntityQuery);
|
|
3505
3523
|
auroElements.forEach((auroEl) => {
|
|
3506
3524
|
auroEl.removeEventListener('focus', this.bindFocusEventToTrigger);
|
|
3507
3525
|
auroEl.removeEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -2581,6 +2581,7 @@ var tokensCss$1 = css`:host{--ds-auro-dropdown-label-text-color: var(--ds-basic-
|
|
|
2581
2581
|
|
|
2582
2582
|
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
2583
2583
|
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
2584
|
+
'xl',
|
|
2584
2585
|
'lg',
|
|
2585
2586
|
'md',
|
|
2586
2587
|
'sm',
|
|
@@ -2652,6 +2653,7 @@ class AuroDropdownBib extends LitElement {
|
|
|
2652
2653
|
|
|
2653
2654
|
set mobileFullscreenBreakpoint(value) {
|
|
2654
2655
|
// verify the defined breakpoint is valid and exit out if not
|
|
2656
|
+
// 'disabled' is a design token breakpoint so it acts as our "undefined" value
|
|
2655
2657
|
const validatedValue = DESIGN_TOKEN_BREAKPOINT_OPTIONS.includes(value) ? value : undefined;
|
|
2656
2658
|
if (!validatedValue) {
|
|
2657
2659
|
this._mobileBreakpointValue = undefined;
|
|
@@ -3177,7 +3179,12 @@ class AuroDropdown extends LitElement {
|
|
|
3177
3179
|
},
|
|
3178
3180
|
|
|
3179
3181
|
/**
|
|
3180
|
-
* Defines the screen size breakpoint (`
|
|
3182
|
+
* Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
|
|
3183
|
+
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
3184
|
+
*
|
|
3185
|
+
* When expanded, the dropdown will automatically display in fullscreen mode
|
|
3186
|
+
* if the screen size is equal to or smaller than the selected breakpoint.
|
|
3187
|
+
* @default sm
|
|
3181
3188
|
*/
|
|
3182
3189
|
fullscreenBreakpoint: {
|
|
3183
3190
|
type: String,
|
|
@@ -3317,6 +3324,15 @@ class AuroDropdown extends LitElement {
|
|
|
3317
3324
|
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroDropdown);
|
|
3318
3325
|
}
|
|
3319
3326
|
|
|
3327
|
+
/**
|
|
3328
|
+
* Accessor for reusing the focusable entity query string.
|
|
3329
|
+
* @private
|
|
3330
|
+
* @returns {string}
|
|
3331
|
+
*/
|
|
3332
|
+
get focusableEntityQuery () {
|
|
3333
|
+
return 'auro-input, [auro-input], auro-button, [auro-button], button, input';
|
|
3334
|
+
}
|
|
3335
|
+
|
|
3320
3336
|
connectedCallback() {
|
|
3321
3337
|
super.connectedCallback();
|
|
3322
3338
|
}
|
|
@@ -3330,6 +3346,8 @@ class AuroDropdown extends LitElement {
|
|
|
3330
3346
|
updated(changedProperties) {
|
|
3331
3347
|
this.floater.handleUpdate(changedProperties);
|
|
3332
3348
|
|
|
3349
|
+
// Note: `disabled` is not a breakpoint (it is not a screen size),
|
|
3350
|
+
// so it looks like we never consume this - however, dropdownBib handles this in the setter as "undefined"
|
|
3333
3351
|
if (changedProperties.has('fullscreenBreakpoint')) {
|
|
3334
3352
|
this.bibContent.mobileFullscreenBreakpoint = this.fullscreenBreakpoint;
|
|
3335
3353
|
}
|
|
@@ -3480,7 +3498,7 @@ class AuroDropdown extends LitElement {
|
|
|
3480
3498
|
|
|
3481
3499
|
this.triggerContentSlot.forEach((node) => {
|
|
3482
3500
|
if (node.querySelectorAll) {
|
|
3483
|
-
const auroElements = node.querySelectorAll(
|
|
3501
|
+
const auroElements = node.querySelectorAll(this.focusableEntityQuery);
|
|
3484
3502
|
auroElements.forEach((auroEl) => {
|
|
3485
3503
|
auroEl.addEventListener('focus', this.bindFocusEventToTrigger);
|
|
3486
3504
|
auroEl.addEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -3501,7 +3519,7 @@ class AuroDropdown extends LitElement {
|
|
|
3501
3519
|
|
|
3502
3520
|
this.triggerContentSlot.forEach((node) => {
|
|
3503
3521
|
if (node.querySelectorAll) {
|
|
3504
|
-
const auroElements = node.querySelectorAll(
|
|
3522
|
+
const auroElements = node.querySelectorAll(this.focusableEntityQuery);
|
|
3505
3523
|
auroElements.forEach((auroEl) => {
|
|
3506
3524
|
auroEl.removeEventListener('focus', this.bindFocusEventToTrigger);
|
|
3507
3525
|
auroEl.removeEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Demo page for auto-complete</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<!-- EVERY AUTOCOMPLETE OPTION, auro inputs -->
|
|
10
|
+
|
|
11
|
+
<!-- EVERY AUTOCOMPLETE OPTION, auro combobox -->
|
|
12
|
+
|
|
13
|
+
<!-- LOGIN FORM -->
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -20,7 +20,7 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
|
|
|
20
20
|
| [disabled](#disabled) | `disabled` | `boolean` | | When attribute is present, element shows disabled state. |
|
|
21
21
|
| [error](#error) | `error` | `string` | | When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value. |
|
|
22
22
|
| [flexMenuWidth](#flexMenuWidth) | `flexMenuWidth` | `boolean` | | If set, makes dropdown width match the size of the content, rather than the width of the trigger. |
|
|
23
|
-
| [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | `string` | "sm" | Defines the screen size breakpoint (`
|
|
23
|
+
| [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. |
|
|
24
24
|
| [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | `boolean` | | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600 |
|
|
25
25
|
| [multiSelect](#multiSelect) | `multiselect` | `boolean` | | Sets multi-select mode, allowing multiple options to be selected at once. |
|
|
26
26
|
| [noCheckmark](#noCheckmark) | `noCheckmark` | `boolean` | | When true, checkmark on selected option will no longer be present. |
|
|
@@ -3584,6 +3584,7 @@ var tokensCss$1$1 = i$5`:host{--ds-auro-dropdown-label-text-color: var(--ds-basi
|
|
|
3584
3584
|
|
|
3585
3585
|
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
3586
3586
|
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
3587
|
+
'xl',
|
|
3587
3588
|
'lg',
|
|
3588
3589
|
'md',
|
|
3589
3590
|
'sm',
|
|
@@ -3655,6 +3656,7 @@ class AuroDropdownBib extends r {
|
|
|
3655
3656
|
|
|
3656
3657
|
set mobileFullscreenBreakpoint(value) {
|
|
3657
3658
|
// verify the defined breakpoint is valid and exit out if not
|
|
3659
|
+
// 'disabled' is a design token breakpoint so it acts as our "undefined" value
|
|
3658
3660
|
const validatedValue = DESIGN_TOKEN_BREAKPOINT_OPTIONS.includes(value) ? value : undefined;
|
|
3659
3661
|
if (!validatedValue) {
|
|
3660
3662
|
this._mobileBreakpointValue = undefined;
|
|
@@ -4180,7 +4182,12 @@ class AuroDropdown extends r {
|
|
|
4180
4182
|
},
|
|
4181
4183
|
|
|
4182
4184
|
/**
|
|
4183
|
-
* Defines the screen size breakpoint (`
|
|
4185
|
+
* Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
|
|
4186
|
+
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
4187
|
+
*
|
|
4188
|
+
* When expanded, the dropdown will automatically display in fullscreen mode
|
|
4189
|
+
* if the screen size is equal to or smaller than the selected breakpoint.
|
|
4190
|
+
* @default sm
|
|
4184
4191
|
*/
|
|
4185
4192
|
fullscreenBreakpoint: {
|
|
4186
4193
|
type: String,
|
|
@@ -4320,6 +4327,15 @@ class AuroDropdown extends r {
|
|
|
4320
4327
|
AuroLibraryRuntimeUtils$1$1.prototype.registerComponent(name, AuroDropdown);
|
|
4321
4328
|
}
|
|
4322
4329
|
|
|
4330
|
+
/**
|
|
4331
|
+
* Accessor for reusing the focusable entity query string.
|
|
4332
|
+
* @private
|
|
4333
|
+
* @returns {string}
|
|
4334
|
+
*/
|
|
4335
|
+
get focusableEntityQuery () {
|
|
4336
|
+
return 'auro-input, [auro-input], auro-button, [auro-button], button, input';
|
|
4337
|
+
}
|
|
4338
|
+
|
|
4323
4339
|
connectedCallback() {
|
|
4324
4340
|
super.connectedCallback();
|
|
4325
4341
|
}
|
|
@@ -4333,6 +4349,8 @@ class AuroDropdown extends r {
|
|
|
4333
4349
|
updated(changedProperties) {
|
|
4334
4350
|
this.floater.handleUpdate(changedProperties);
|
|
4335
4351
|
|
|
4352
|
+
// Note: `disabled` is not a breakpoint (it is not a screen size),
|
|
4353
|
+
// so it looks like we never consume this - however, dropdownBib handles this in the setter as "undefined"
|
|
4336
4354
|
if (changedProperties.has('fullscreenBreakpoint')) {
|
|
4337
4355
|
this.bibContent.mobileFullscreenBreakpoint = this.fullscreenBreakpoint;
|
|
4338
4356
|
}
|
|
@@ -4483,7 +4501,7 @@ class AuroDropdown extends r {
|
|
|
4483
4501
|
|
|
4484
4502
|
this.triggerContentSlot.forEach((node) => {
|
|
4485
4503
|
if (node.querySelectorAll) {
|
|
4486
|
-
const auroElements = node.querySelectorAll(
|
|
4504
|
+
const auroElements = node.querySelectorAll(this.focusableEntityQuery);
|
|
4487
4505
|
auroElements.forEach((auroEl) => {
|
|
4488
4506
|
auroEl.addEventListener('focus', this.bindFocusEventToTrigger);
|
|
4489
4507
|
auroEl.addEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -4504,7 +4522,7 @@ class AuroDropdown extends r {
|
|
|
4504
4522
|
|
|
4505
4523
|
this.triggerContentSlot.forEach((node) => {
|
|
4506
4524
|
if (node.querySelectorAll) {
|
|
4507
|
-
const auroElements = node.querySelectorAll(
|
|
4525
|
+
const auroElements = node.querySelectorAll(this.focusableEntityQuery);
|
|
4508
4526
|
auroElements.forEach((auroEl) => {
|
|
4509
4527
|
auroEl.removeEventListener('focus', this.bindFocusEventToTrigger);
|
|
4510
4528
|
auroEl.removeEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -5728,8 +5746,11 @@ class AuroSelect extends r {
|
|
|
5728
5746
|
},
|
|
5729
5747
|
|
|
5730
5748
|
/**
|
|
5731
|
-
* Defines the screen size breakpoint (`
|
|
5732
|
-
*
|
|
5749
|
+
* Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
|
|
5750
|
+
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
5751
|
+
*
|
|
5752
|
+
* When expanded, the dropdown will automatically display in fullscreen mode
|
|
5753
|
+
* if the screen size is equal to or smaller than the selected breakpoint.
|
|
5733
5754
|
* @default sm
|
|
5734
5755
|
*/
|
|
5735
5756
|
fullscreenBreakpoint: {
|
|
@@ -379,7 +379,7 @@ Applying the `noCheckmark` attribute will prevent the checkmark icon from being
|
|
|
379
379
|
|
|
380
380
|
## Example with custom bib height
|
|
381
381
|
|
|
382
|
-
This example shows how to set a custom height for the bib from `<auro-dropdown>`.
|
|
382
|
+
This example shows how to set a custom height for the bib from `<auro-dropdown>`.
|
|
383
383
|
|
|
384
384
|
Custom height dimensions are set by using the `dropdownSize` CSS Part and then applying a `max-height` rule and value.
|
|
385
385
|
|
|
@@ -434,6 +434,51 @@ Custom height dimensions are set by using the `dropdownSize` CSS Part and then a
|
|
|
434
434
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
435
435
|
</auro-accordion>
|
|
436
436
|
|
|
437
|
+
## Example with fullscreen dropdown breakpoint override
|
|
438
|
+
|
|
439
|
+
This example overrides the default dropdown behavior to force a non-fullscreen view on any screen size. `disabled`
|
|
440
|
+
ensures that the dropdown will never be fullscreen.
|
|
441
|
+
Please use `xl` if you want the opposite behavior, where a dropdown is always fullscreen.
|
|
442
|
+
|
|
443
|
+
<div class="exampleWrapper">
|
|
444
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/forcedFullscreenDisabled.html) -->
|
|
445
|
+
<!-- The below content is automatically added from ./../apiExamples/forcedFullscreenDisabled.html -->
|
|
446
|
+
<auro-select fullscreenBreakpoint="disabled">
|
|
447
|
+
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
448
|
+
<span slot="label">Select Example</span>
|
|
449
|
+
<auro-menu>
|
|
450
|
+
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
451
|
+
<auro-menuoption value="price">Price</auro-menuoption>
|
|
452
|
+
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
453
|
+
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
454
|
+
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
455
|
+
<auro-menuoption value="prefer alaska">Prefer Alaska</auro-menuoption>
|
|
456
|
+
</auro-menu>
|
|
457
|
+
</auro-select>
|
|
458
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
459
|
+
</div>
|
|
460
|
+
<auro-accordion alignRight>
|
|
461
|
+
<span slot="trigger">See code</span>
|
|
462
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/forcedFullscreenDisabled.html) -->
|
|
463
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/forcedFullscreenDisabled.html -->
|
|
464
|
+
|
|
465
|
+
```html
|
|
466
|
+
<auro-select fullscreenBreakpoint="disabled">
|
|
467
|
+
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
468
|
+
<span slot="label">Select Example</span>
|
|
469
|
+
<auro-menu>
|
|
470
|
+
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
471
|
+
<auro-menuoption value="price">Price</auro-menuoption>
|
|
472
|
+
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
473
|
+
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
474
|
+
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
475
|
+
<auro-menuoption value="prefer alaska">Prefer Alaska</auro-menuoption>
|
|
476
|
+
</auro-menu>
|
|
477
|
+
</auro-select>
|
|
478
|
+
```
|
|
479
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
480
|
+
</auro-accordion>
|
|
481
|
+
|
|
437
482
|
## Error State
|
|
438
483
|
|
|
439
484
|
Use the `error` boolean attribute to toggle the error UI.
|