@aurodesignsystem/auro-formkit 2.1.0 → 2.2.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 +18 -2
- package/components/bibtemplate/dist/index.js +2 -2
- package/components/bibtemplate/dist/registered.js +2 -2
- 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.md +122 -19
- package/components/combobox/demo/api.min.js +160 -24
- package/components/combobox/demo/index.min.js +160 -24
- package/components/combobox/demo/readme.md +1 -1
- package/components/combobox/dist/auro-combobox.d.ts +42 -0
- package/components/combobox/dist/index.js +160 -24
- package/components/combobox/dist/registered.js +160 -24
- package/components/counter/README.md +1 -1
- package/components/counter/demo/api.md +113 -10
- package/components/counter/demo/api.min.js +178 -47
- package/components/counter/demo/index.min.js +178 -47
- package/components/counter/demo/readme.md +1 -1
- package/components/counter/dist/auro-counter-group.d.ts +55 -17
- package/components/counter/dist/index.js +178 -47
- package/components/counter/dist/registered.js +178 -47
- package/components/datepicker/README.md +1 -1
- package/components/datepicker/demo/api.md +61 -0
- package/components/datepicker/demo/api.min.js +162 -25
- package/components/datepicker/demo/index.min.js +162 -25
- package/components/datepicker/demo/readme.md +1 -1
- package/components/datepicker/dist/auro-datepicker.d.ts +42 -0
- package/components/datepicker/dist/index.js +162 -25
- package/components/datepicker/dist/registered.js +162 -25
- package/components/dropdown/README.md +1 -1
- package/components/dropdown/demo/api.md +166 -19
- package/components/dropdown/demo/api.min.js +106 -22
- package/components/dropdown/demo/index.min.js +106 -22
- package/components/dropdown/demo/readme.md +1 -1
- package/components/dropdown/dist/auro-dropdown.d.ts +63 -7
- package/components/dropdown/dist/index.js +106 -22
- package/components/dropdown/dist/registered.js +106 -22
- 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 +142 -17
- package/components/select/demo/api.min.js +160 -24
- package/components/select/demo/index.md +14 -0
- package/components/select/demo/index.min.js +160 -24
- package/components/select/demo/readme.md +2 -1
- package/components/select/dist/auro-select.d.ts +42 -0
- package/components/select/dist/index.js +160 -24
- package/components/select/dist/registered.js +160 -24
- package/package.json +1 -1
|
@@ -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
|
|
|
@@ -3340,10 +3340,16 @@ class AuroDropdown extends LitElement {
|
|
|
3340
3340
|
this.disabled = false;
|
|
3341
3341
|
this.error = false;
|
|
3342
3342
|
this.inset = false;
|
|
3343
|
-
this.placement = 'bottom-start';
|
|
3344
3343
|
this.rounded = false;
|
|
3345
3344
|
this.tabIndex = 0;
|
|
3346
3345
|
this.noToggle = false;
|
|
3346
|
+
this.labeled = true;
|
|
3347
|
+
|
|
3348
|
+
// floaterConfig
|
|
3349
|
+
this.placement = 'bottom-start';
|
|
3350
|
+
this.offset = 0;
|
|
3351
|
+
this.noFlip = false;
|
|
3352
|
+
this.autoPlacement = false;
|
|
3347
3353
|
|
|
3348
3354
|
/**
|
|
3349
3355
|
* @private
|
|
@@ -3365,16 +3371,6 @@ class AuroDropdown extends LitElement {
|
|
|
3365
3371
|
*/
|
|
3366
3372
|
this.floater = new AuroFloatingUI();
|
|
3367
3373
|
|
|
3368
|
-
/**
|
|
3369
|
-
* @private
|
|
3370
|
-
*/
|
|
3371
|
-
this.floaterConfig = {
|
|
3372
|
-
placement: 'bottom-start',
|
|
3373
|
-
flip: true,
|
|
3374
|
-
autoPlacement: false,
|
|
3375
|
-
offset: 0,
|
|
3376
|
-
};
|
|
3377
|
-
|
|
3378
3374
|
/**
|
|
3379
3375
|
* Generate unique names for dependency components.
|
|
3380
3376
|
*/
|
|
@@ -3396,6 +3392,18 @@ class AuroDropdown extends LitElement {
|
|
|
3396
3392
|
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion, AuroHelpText);
|
|
3397
3393
|
}
|
|
3398
3394
|
|
|
3395
|
+
/**
|
|
3396
|
+
* @ignore
|
|
3397
|
+
*/
|
|
3398
|
+
get floaterConfig() {
|
|
3399
|
+
return {
|
|
3400
|
+
placement: this.placement,
|
|
3401
|
+
flip: !this.noFlip,
|
|
3402
|
+
autoPlacement: this.autoPlacement,
|
|
3403
|
+
offset: this.offset,
|
|
3404
|
+
};
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3399
3407
|
/**
|
|
3400
3408
|
* Public method to hide the dropdown.
|
|
3401
3409
|
* @returns {void}
|
|
@@ -3416,6 +3424,15 @@ class AuroDropdown extends LitElement {
|
|
|
3416
3424
|
static get properties() {
|
|
3417
3425
|
return {
|
|
3418
3426
|
|
|
3427
|
+
/**
|
|
3428
|
+
* If declared, bib's position will be automatically calculated where to appear.
|
|
3429
|
+
* @default false
|
|
3430
|
+
*/
|
|
3431
|
+
autoPlacement: {
|
|
3432
|
+
type: Boolean,
|
|
3433
|
+
reflect: true
|
|
3434
|
+
},
|
|
3435
|
+
|
|
3419
3436
|
/**
|
|
3420
3437
|
* If declared, applies a border around the trigger slot.
|
|
3421
3438
|
*/
|
|
@@ -3496,11 +3513,11 @@ class AuroDropdown extends LitElement {
|
|
|
3496
3513
|
},
|
|
3497
3514
|
|
|
3498
3515
|
/**
|
|
3499
|
-
* If true, the dropdown bib is taking the fullscreen when it's open
|
|
3516
|
+
* If true, the dropdown bib is taking the fullscreen when it's open.
|
|
3500
3517
|
*/
|
|
3501
3518
|
isBibFullscreen: {
|
|
3502
3519
|
type: Boolean,
|
|
3503
|
-
reflect: true
|
|
3520
|
+
reflect: true
|
|
3504
3521
|
},
|
|
3505
3522
|
|
|
3506
3523
|
/**
|
|
@@ -3526,6 +3543,15 @@ class AuroDropdown extends LitElement {
|
|
|
3526
3543
|
reflect: true
|
|
3527
3544
|
},
|
|
3528
3545
|
|
|
3546
|
+
/**
|
|
3547
|
+
* Defines if there is a label preset.
|
|
3548
|
+
* @private
|
|
3549
|
+
*/
|
|
3550
|
+
labeled: {
|
|
3551
|
+
type: Boolean,
|
|
3552
|
+
reflect: true
|
|
3553
|
+
},
|
|
3554
|
+
|
|
3529
3555
|
/**
|
|
3530
3556
|
* If declared, the popover and trigger will be set to the same width.
|
|
3531
3557
|
*/
|
|
@@ -3534,6 +3560,16 @@ class AuroDropdown extends LitElement {
|
|
|
3534
3560
|
reflect: true
|
|
3535
3561
|
},
|
|
3536
3562
|
|
|
3563
|
+
/**
|
|
3564
|
+
* If declared, the bib will NOT flip to an alternate position
|
|
3565
|
+
* when there isn't enough space in the specified `placement`.
|
|
3566
|
+
* @default false
|
|
3567
|
+
*/
|
|
3568
|
+
noFlip: {
|
|
3569
|
+
type: Boolean,
|
|
3570
|
+
reflect: true
|
|
3571
|
+
},
|
|
3572
|
+
|
|
3537
3573
|
/**
|
|
3538
3574
|
* If declared, the dropdown will not hide when moving focus outside the element.
|
|
3539
3575
|
*/
|
|
@@ -3550,16 +3586,32 @@ class AuroDropdown extends LitElement {
|
|
|
3550
3586
|
reflect: true
|
|
3551
3587
|
},
|
|
3552
3588
|
|
|
3589
|
+
/**
|
|
3590
|
+
* Gap between the trigger element and bib.
|
|
3591
|
+
* @default 0
|
|
3592
|
+
*/
|
|
3593
|
+
offset: {
|
|
3594
|
+
type: Number,
|
|
3595
|
+
reflect: true
|
|
3596
|
+
},
|
|
3597
|
+
|
|
3553
3598
|
onSlotChange: {
|
|
3554
3599
|
type: Function,
|
|
3555
3600
|
reflect: false
|
|
3556
3601
|
},
|
|
3557
3602
|
|
|
3558
3603
|
/**
|
|
3559
|
-
*
|
|
3604
|
+
* Position where the bib should appear relative to the trigger.
|
|
3605
|
+
* Accepted values:
|
|
3606
|
+
* "top" | "right" | "bottom" | "left" |
|
|
3607
|
+
* "bottom-start" | "top-start" | "top-end" |
|
|
3608
|
+
* "right-start" | "right-end" | "bottom-end" |
|
|
3609
|
+
* "left-start" | "left-end"
|
|
3610
|
+
* @default bottom-start
|
|
3560
3611
|
*/
|
|
3561
3612
|
placement: {
|
|
3562
|
-
type: String
|
|
3613
|
+
type: String,
|
|
3614
|
+
reflect: true
|
|
3563
3615
|
},
|
|
3564
3616
|
|
|
3565
3617
|
/**
|
|
@@ -3605,6 +3657,7 @@ class AuroDropdown extends LitElement {
|
|
|
3605
3657
|
|
|
3606
3658
|
disconnectedCallback() {
|
|
3607
3659
|
super.disconnectedCallback();
|
|
3660
|
+
this.floater.disconnect();
|
|
3608
3661
|
}
|
|
3609
3662
|
|
|
3610
3663
|
updated(changedProperties) {
|
|
@@ -3734,13 +3787,21 @@ class AuroDropdown extends LitElement {
|
|
|
3734
3787
|
handleTriggerContentSlotChange(event) {
|
|
3735
3788
|
this.floater.handleTriggerTabIndex();
|
|
3736
3789
|
|
|
3737
|
-
const
|
|
3790
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
|
|
3791
|
+
|
|
3792
|
+
if (triggerSlot) {
|
|
3793
|
+
|
|
3794
|
+
const triggerContentNodes = triggerSlot.assignedNodes();
|
|
3795
|
+
|
|
3796
|
+
if (triggerContentNodes) {
|
|
3738
3797
|
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3798
|
+
triggerContentNodes.forEach((node) => {
|
|
3799
|
+
if (!this.triggerContentFocusable) {
|
|
3800
|
+
this.triggerContentFocusable = this.containsFocusableElement(node);
|
|
3801
|
+
}
|
|
3802
|
+
});
|
|
3742
3803
|
}
|
|
3743
|
-
}
|
|
3804
|
+
}
|
|
3744
3805
|
|
|
3745
3806
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3746
3807
|
|
|
@@ -3794,6 +3855,29 @@ class AuroDropdown extends LitElement {
|
|
|
3794
3855
|
}
|
|
3795
3856
|
}
|
|
3796
3857
|
|
|
3858
|
+
/**
|
|
3859
|
+
* @private
|
|
3860
|
+
* @method handleLabelSlotChange
|
|
3861
|
+
* @param {event} event - The event object representing the slot change.
|
|
3862
|
+
* @description Handles the slot change event for the label slot.
|
|
3863
|
+
*/
|
|
3864
|
+
handleLabelSlotChange (event) {
|
|
3865
|
+
|
|
3866
|
+
// Get the nodes from the event
|
|
3867
|
+
const nodes = event.target.assignedNodes();
|
|
3868
|
+
|
|
3869
|
+
// Guard clause for no nodes
|
|
3870
|
+
if (!nodes) {
|
|
3871
|
+
return;
|
|
3872
|
+
}
|
|
3873
|
+
|
|
3874
|
+
// Convert the nodes to a measurable array so we can get the length
|
|
3875
|
+
const nodesArr = Array.from(nodes);
|
|
3876
|
+
|
|
3877
|
+
// If the nodes array has a length, the dropdown is labeled
|
|
3878
|
+
this.labeled = nodesArr.length > 0;
|
|
3879
|
+
}
|
|
3880
|
+
|
|
3797
3881
|
// function that renders the HTML and CSS into the scope of the component
|
|
3798
3882
|
render() {
|
|
3799
3883
|
return html`
|
|
@@ -3808,7 +3892,7 @@ class AuroDropdown extends LitElement {
|
|
|
3808
3892
|
>
|
|
3809
3893
|
<div class="triggerContentWrapper">
|
|
3810
3894
|
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3811
|
-
<slot name="label"></slot>
|
|
3895
|
+
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
3812
3896
|
</label>
|
|
3813
3897
|
<div class="triggerContent">
|
|
3814
3898
|
<slot
|
|
@@ -4694,11 +4778,11 @@ class AuroBibtemplate extends LitElement {
|
|
|
4694
4778
|
return {
|
|
4695
4779
|
isFullscreen: {
|
|
4696
4780
|
type: Boolean,
|
|
4697
|
-
reflect: true
|
|
4781
|
+
reflect: true
|
|
4698
4782
|
},
|
|
4699
4783
|
large: {
|
|
4700
4784
|
type: Boolean,
|
|
4701
|
-
reflect: true
|
|
4785
|
+
reflect: true
|
|
4702
4786
|
}
|
|
4703
4787
|
};
|
|
4704
4788
|
}
|
|
@@ -4937,6 +5021,12 @@ class AuroSelect extends LitElement {
|
|
|
4937
5021
|
const idSubstrEnd = 8;
|
|
4938
5022
|
const idSubstrStart = 2;
|
|
4939
5023
|
|
|
5024
|
+
// floaterConfig
|
|
5025
|
+
this.placement = 'bottom-start';
|
|
5026
|
+
this.offset = 0;
|
|
5027
|
+
this.noFlip = false;
|
|
5028
|
+
this.autoPlacement = false;
|
|
5029
|
+
|
|
4940
5030
|
/**
|
|
4941
5031
|
* @private
|
|
4942
5032
|
*/
|
|
@@ -4993,6 +5083,15 @@ class AuroSelect extends LitElement {
|
|
|
4993
5083
|
static get properties() {
|
|
4994
5084
|
return {
|
|
4995
5085
|
|
|
5086
|
+
/**
|
|
5087
|
+
* If declared, bib's position will be automatically calculated where to appear.
|
|
5088
|
+
* @default false
|
|
5089
|
+
*/
|
|
5090
|
+
autoPlacement: {
|
|
5091
|
+
type: Boolean,
|
|
5092
|
+
reflect: true
|
|
5093
|
+
},
|
|
5094
|
+
|
|
4996
5095
|
/**
|
|
4997
5096
|
* When attribute is present, element shows disabled state.
|
|
4998
5097
|
*/
|
|
@@ -5036,6 +5135,16 @@ class AuroSelect extends LitElement {
|
|
|
5036
5135
|
reflect: true
|
|
5037
5136
|
},
|
|
5038
5137
|
|
|
5138
|
+
/**
|
|
5139
|
+
* If declared, the bib will NOT flip to an alternate position
|
|
5140
|
+
* when there isn't enough space in the specified `placement`.
|
|
5141
|
+
* @default false
|
|
5142
|
+
*/
|
|
5143
|
+
noFlip: {
|
|
5144
|
+
type: Boolean,
|
|
5145
|
+
reflect: true
|
|
5146
|
+
},
|
|
5147
|
+
|
|
5039
5148
|
/**
|
|
5040
5149
|
* If set, disables auto-validation on blur.
|
|
5041
5150
|
*/
|
|
@@ -5044,6 +5153,15 @@ class AuroSelect extends LitElement {
|
|
|
5044
5153
|
reflect: true
|
|
5045
5154
|
},
|
|
5046
5155
|
|
|
5156
|
+
/**
|
|
5157
|
+
* Gap between the trigger element and bib.
|
|
5158
|
+
* @default 0
|
|
5159
|
+
*/
|
|
5160
|
+
offset: {
|
|
5161
|
+
type: Number,
|
|
5162
|
+
reflect: true
|
|
5163
|
+
},
|
|
5164
|
+
|
|
5047
5165
|
/**
|
|
5048
5166
|
* @private
|
|
5049
5167
|
*/
|
|
@@ -5067,6 +5185,20 @@ class AuroSelect extends LitElement {
|
|
|
5067
5185
|
type: Array
|
|
5068
5186
|
},
|
|
5069
5187
|
|
|
5188
|
+
/**
|
|
5189
|
+
* Position where the bib should appear relative to the trigger.
|
|
5190
|
+
* Accepted values:
|
|
5191
|
+
* "top" | "right" | "bottom" | "left" |
|
|
5192
|
+
* "bottom-start" | "top-start" | "top-end" |
|
|
5193
|
+
* "right-start" | "right-end" | "bottom-end" |
|
|
5194
|
+
* "left-start" | "left-end"
|
|
5195
|
+
* @default bottom-start
|
|
5196
|
+
*/
|
|
5197
|
+
placement: {
|
|
5198
|
+
type: String,
|
|
5199
|
+
reflect: true
|
|
5200
|
+
},
|
|
5201
|
+
|
|
5070
5202
|
/**
|
|
5071
5203
|
* Populates the `required` attribute on the element. Used for client-side validation.
|
|
5072
5204
|
*/
|
|
@@ -5529,6 +5661,10 @@ class AuroSelect extends LitElement {
|
|
|
5529
5661
|
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
5530
5662
|
?matchWidth="${!this.flexMenuWidth}"
|
|
5531
5663
|
chevron
|
|
5664
|
+
.placement="${this.placement}"
|
|
5665
|
+
.offset="${this.offset}"
|
|
5666
|
+
?autoPlacement="${this.autoPlacement}"
|
|
5667
|
+
?noFlip="${this.noFlip}"
|
|
5532
5668
|
part="dropdown">
|
|
5533
5669
|
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
5534
5670
|
<span id="placeholder" class="${classMap(placeholderClass)}"><slot name="placeholder"></slot></span>
|
|
@@ -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
|
|
|
@@ -3340,10 +3340,16 @@ class AuroDropdown extends LitElement {
|
|
|
3340
3340
|
this.disabled = false;
|
|
3341
3341
|
this.error = false;
|
|
3342
3342
|
this.inset = false;
|
|
3343
|
-
this.placement = 'bottom-start';
|
|
3344
3343
|
this.rounded = false;
|
|
3345
3344
|
this.tabIndex = 0;
|
|
3346
3345
|
this.noToggle = false;
|
|
3346
|
+
this.labeled = true;
|
|
3347
|
+
|
|
3348
|
+
// floaterConfig
|
|
3349
|
+
this.placement = 'bottom-start';
|
|
3350
|
+
this.offset = 0;
|
|
3351
|
+
this.noFlip = false;
|
|
3352
|
+
this.autoPlacement = false;
|
|
3347
3353
|
|
|
3348
3354
|
/**
|
|
3349
3355
|
* @private
|
|
@@ -3365,16 +3371,6 @@ class AuroDropdown extends LitElement {
|
|
|
3365
3371
|
*/
|
|
3366
3372
|
this.floater = new AuroFloatingUI();
|
|
3367
3373
|
|
|
3368
|
-
/**
|
|
3369
|
-
* @private
|
|
3370
|
-
*/
|
|
3371
|
-
this.floaterConfig = {
|
|
3372
|
-
placement: 'bottom-start',
|
|
3373
|
-
flip: true,
|
|
3374
|
-
autoPlacement: false,
|
|
3375
|
-
offset: 0,
|
|
3376
|
-
};
|
|
3377
|
-
|
|
3378
3374
|
/**
|
|
3379
3375
|
* Generate unique names for dependency components.
|
|
3380
3376
|
*/
|
|
@@ -3396,6 +3392,18 @@ class AuroDropdown extends LitElement {
|
|
|
3396
3392
|
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion, AuroHelpText);
|
|
3397
3393
|
}
|
|
3398
3394
|
|
|
3395
|
+
/**
|
|
3396
|
+
* @ignore
|
|
3397
|
+
*/
|
|
3398
|
+
get floaterConfig() {
|
|
3399
|
+
return {
|
|
3400
|
+
placement: this.placement,
|
|
3401
|
+
flip: !this.noFlip,
|
|
3402
|
+
autoPlacement: this.autoPlacement,
|
|
3403
|
+
offset: this.offset,
|
|
3404
|
+
};
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3399
3407
|
/**
|
|
3400
3408
|
* Public method to hide the dropdown.
|
|
3401
3409
|
* @returns {void}
|
|
@@ -3416,6 +3424,15 @@ class AuroDropdown extends LitElement {
|
|
|
3416
3424
|
static get properties() {
|
|
3417
3425
|
return {
|
|
3418
3426
|
|
|
3427
|
+
/**
|
|
3428
|
+
* If declared, bib's position will be automatically calculated where to appear.
|
|
3429
|
+
* @default false
|
|
3430
|
+
*/
|
|
3431
|
+
autoPlacement: {
|
|
3432
|
+
type: Boolean,
|
|
3433
|
+
reflect: true
|
|
3434
|
+
},
|
|
3435
|
+
|
|
3419
3436
|
/**
|
|
3420
3437
|
* If declared, applies a border around the trigger slot.
|
|
3421
3438
|
*/
|
|
@@ -3496,11 +3513,11 @@ class AuroDropdown extends LitElement {
|
|
|
3496
3513
|
},
|
|
3497
3514
|
|
|
3498
3515
|
/**
|
|
3499
|
-
* If true, the dropdown bib is taking the fullscreen when it's open
|
|
3516
|
+
* If true, the dropdown bib is taking the fullscreen when it's open.
|
|
3500
3517
|
*/
|
|
3501
3518
|
isBibFullscreen: {
|
|
3502
3519
|
type: Boolean,
|
|
3503
|
-
reflect: true
|
|
3520
|
+
reflect: true
|
|
3504
3521
|
},
|
|
3505
3522
|
|
|
3506
3523
|
/**
|
|
@@ -3526,6 +3543,15 @@ class AuroDropdown extends LitElement {
|
|
|
3526
3543
|
reflect: true
|
|
3527
3544
|
},
|
|
3528
3545
|
|
|
3546
|
+
/**
|
|
3547
|
+
* Defines if there is a label preset.
|
|
3548
|
+
* @private
|
|
3549
|
+
*/
|
|
3550
|
+
labeled: {
|
|
3551
|
+
type: Boolean,
|
|
3552
|
+
reflect: true
|
|
3553
|
+
},
|
|
3554
|
+
|
|
3529
3555
|
/**
|
|
3530
3556
|
* If declared, the popover and trigger will be set to the same width.
|
|
3531
3557
|
*/
|
|
@@ -3534,6 +3560,16 @@ class AuroDropdown extends LitElement {
|
|
|
3534
3560
|
reflect: true
|
|
3535
3561
|
},
|
|
3536
3562
|
|
|
3563
|
+
/**
|
|
3564
|
+
* If declared, the bib will NOT flip to an alternate position
|
|
3565
|
+
* when there isn't enough space in the specified `placement`.
|
|
3566
|
+
* @default false
|
|
3567
|
+
*/
|
|
3568
|
+
noFlip: {
|
|
3569
|
+
type: Boolean,
|
|
3570
|
+
reflect: true
|
|
3571
|
+
},
|
|
3572
|
+
|
|
3537
3573
|
/**
|
|
3538
3574
|
* If declared, the dropdown will not hide when moving focus outside the element.
|
|
3539
3575
|
*/
|
|
@@ -3550,16 +3586,32 @@ class AuroDropdown extends LitElement {
|
|
|
3550
3586
|
reflect: true
|
|
3551
3587
|
},
|
|
3552
3588
|
|
|
3589
|
+
/**
|
|
3590
|
+
* Gap between the trigger element and bib.
|
|
3591
|
+
* @default 0
|
|
3592
|
+
*/
|
|
3593
|
+
offset: {
|
|
3594
|
+
type: Number,
|
|
3595
|
+
reflect: true
|
|
3596
|
+
},
|
|
3597
|
+
|
|
3553
3598
|
onSlotChange: {
|
|
3554
3599
|
type: Function,
|
|
3555
3600
|
reflect: false
|
|
3556
3601
|
},
|
|
3557
3602
|
|
|
3558
3603
|
/**
|
|
3559
|
-
*
|
|
3604
|
+
* Position where the bib should appear relative to the trigger.
|
|
3605
|
+
* Accepted values:
|
|
3606
|
+
* "top" | "right" | "bottom" | "left" |
|
|
3607
|
+
* "bottom-start" | "top-start" | "top-end" |
|
|
3608
|
+
* "right-start" | "right-end" | "bottom-end" |
|
|
3609
|
+
* "left-start" | "left-end"
|
|
3610
|
+
* @default bottom-start
|
|
3560
3611
|
*/
|
|
3561
3612
|
placement: {
|
|
3562
|
-
type: String
|
|
3613
|
+
type: String,
|
|
3614
|
+
reflect: true
|
|
3563
3615
|
},
|
|
3564
3616
|
|
|
3565
3617
|
/**
|
|
@@ -3605,6 +3657,7 @@ class AuroDropdown extends LitElement {
|
|
|
3605
3657
|
|
|
3606
3658
|
disconnectedCallback() {
|
|
3607
3659
|
super.disconnectedCallback();
|
|
3660
|
+
this.floater.disconnect();
|
|
3608
3661
|
}
|
|
3609
3662
|
|
|
3610
3663
|
updated(changedProperties) {
|
|
@@ -3734,13 +3787,21 @@ class AuroDropdown extends LitElement {
|
|
|
3734
3787
|
handleTriggerContentSlotChange(event) {
|
|
3735
3788
|
this.floater.handleTriggerTabIndex();
|
|
3736
3789
|
|
|
3737
|
-
const
|
|
3790
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
|
|
3791
|
+
|
|
3792
|
+
if (triggerSlot) {
|
|
3793
|
+
|
|
3794
|
+
const triggerContentNodes = triggerSlot.assignedNodes();
|
|
3795
|
+
|
|
3796
|
+
if (triggerContentNodes) {
|
|
3738
3797
|
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3798
|
+
triggerContentNodes.forEach((node) => {
|
|
3799
|
+
if (!this.triggerContentFocusable) {
|
|
3800
|
+
this.triggerContentFocusable = this.containsFocusableElement(node);
|
|
3801
|
+
}
|
|
3802
|
+
});
|
|
3742
3803
|
}
|
|
3743
|
-
}
|
|
3804
|
+
}
|
|
3744
3805
|
|
|
3745
3806
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3746
3807
|
|
|
@@ -3794,6 +3855,29 @@ class AuroDropdown extends LitElement {
|
|
|
3794
3855
|
}
|
|
3795
3856
|
}
|
|
3796
3857
|
|
|
3858
|
+
/**
|
|
3859
|
+
* @private
|
|
3860
|
+
* @method handleLabelSlotChange
|
|
3861
|
+
* @param {event} event - The event object representing the slot change.
|
|
3862
|
+
* @description Handles the slot change event for the label slot.
|
|
3863
|
+
*/
|
|
3864
|
+
handleLabelSlotChange (event) {
|
|
3865
|
+
|
|
3866
|
+
// Get the nodes from the event
|
|
3867
|
+
const nodes = event.target.assignedNodes();
|
|
3868
|
+
|
|
3869
|
+
// Guard clause for no nodes
|
|
3870
|
+
if (!nodes) {
|
|
3871
|
+
return;
|
|
3872
|
+
}
|
|
3873
|
+
|
|
3874
|
+
// Convert the nodes to a measurable array so we can get the length
|
|
3875
|
+
const nodesArr = Array.from(nodes);
|
|
3876
|
+
|
|
3877
|
+
// If the nodes array has a length, the dropdown is labeled
|
|
3878
|
+
this.labeled = nodesArr.length > 0;
|
|
3879
|
+
}
|
|
3880
|
+
|
|
3797
3881
|
// function that renders the HTML and CSS into the scope of the component
|
|
3798
3882
|
render() {
|
|
3799
3883
|
return html`
|
|
@@ -3808,7 +3892,7 @@ class AuroDropdown extends LitElement {
|
|
|
3808
3892
|
>
|
|
3809
3893
|
<div class="triggerContentWrapper">
|
|
3810
3894
|
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3811
|
-
<slot name="label"></slot>
|
|
3895
|
+
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
3812
3896
|
</label>
|
|
3813
3897
|
<div class="triggerContent">
|
|
3814
3898
|
<slot
|
|
@@ -4694,11 +4778,11 @@ class AuroBibtemplate extends LitElement {
|
|
|
4694
4778
|
return {
|
|
4695
4779
|
isFullscreen: {
|
|
4696
4780
|
type: Boolean,
|
|
4697
|
-
reflect: true
|
|
4781
|
+
reflect: true
|
|
4698
4782
|
},
|
|
4699
4783
|
large: {
|
|
4700
4784
|
type: Boolean,
|
|
4701
|
-
reflect: true
|
|
4785
|
+
reflect: true
|
|
4702
4786
|
}
|
|
4703
4787
|
};
|
|
4704
4788
|
}
|
|
@@ -4937,6 +5021,12 @@ class AuroSelect extends LitElement {
|
|
|
4937
5021
|
const idSubstrEnd = 8;
|
|
4938
5022
|
const idSubstrStart = 2;
|
|
4939
5023
|
|
|
5024
|
+
// floaterConfig
|
|
5025
|
+
this.placement = 'bottom-start';
|
|
5026
|
+
this.offset = 0;
|
|
5027
|
+
this.noFlip = false;
|
|
5028
|
+
this.autoPlacement = false;
|
|
5029
|
+
|
|
4940
5030
|
/**
|
|
4941
5031
|
* @private
|
|
4942
5032
|
*/
|
|
@@ -4993,6 +5083,15 @@ class AuroSelect extends LitElement {
|
|
|
4993
5083
|
static get properties() {
|
|
4994
5084
|
return {
|
|
4995
5085
|
|
|
5086
|
+
/**
|
|
5087
|
+
* If declared, bib's position will be automatically calculated where to appear.
|
|
5088
|
+
* @default false
|
|
5089
|
+
*/
|
|
5090
|
+
autoPlacement: {
|
|
5091
|
+
type: Boolean,
|
|
5092
|
+
reflect: true
|
|
5093
|
+
},
|
|
5094
|
+
|
|
4996
5095
|
/**
|
|
4997
5096
|
* When attribute is present, element shows disabled state.
|
|
4998
5097
|
*/
|
|
@@ -5036,6 +5135,16 @@ class AuroSelect extends LitElement {
|
|
|
5036
5135
|
reflect: true
|
|
5037
5136
|
},
|
|
5038
5137
|
|
|
5138
|
+
/**
|
|
5139
|
+
* If declared, the bib will NOT flip to an alternate position
|
|
5140
|
+
* when there isn't enough space in the specified `placement`.
|
|
5141
|
+
* @default false
|
|
5142
|
+
*/
|
|
5143
|
+
noFlip: {
|
|
5144
|
+
type: Boolean,
|
|
5145
|
+
reflect: true
|
|
5146
|
+
},
|
|
5147
|
+
|
|
5039
5148
|
/**
|
|
5040
5149
|
* If set, disables auto-validation on blur.
|
|
5041
5150
|
*/
|
|
@@ -5044,6 +5153,15 @@ class AuroSelect extends LitElement {
|
|
|
5044
5153
|
reflect: true
|
|
5045
5154
|
},
|
|
5046
5155
|
|
|
5156
|
+
/**
|
|
5157
|
+
* Gap between the trigger element and bib.
|
|
5158
|
+
* @default 0
|
|
5159
|
+
*/
|
|
5160
|
+
offset: {
|
|
5161
|
+
type: Number,
|
|
5162
|
+
reflect: true
|
|
5163
|
+
},
|
|
5164
|
+
|
|
5047
5165
|
/**
|
|
5048
5166
|
* @private
|
|
5049
5167
|
*/
|
|
@@ -5067,6 +5185,20 @@ class AuroSelect extends LitElement {
|
|
|
5067
5185
|
type: Array
|
|
5068
5186
|
},
|
|
5069
5187
|
|
|
5188
|
+
/**
|
|
5189
|
+
* Position where the bib should appear relative to the trigger.
|
|
5190
|
+
* Accepted values:
|
|
5191
|
+
* "top" | "right" | "bottom" | "left" |
|
|
5192
|
+
* "bottom-start" | "top-start" | "top-end" |
|
|
5193
|
+
* "right-start" | "right-end" | "bottom-end" |
|
|
5194
|
+
* "left-start" | "left-end"
|
|
5195
|
+
* @default bottom-start
|
|
5196
|
+
*/
|
|
5197
|
+
placement: {
|
|
5198
|
+
type: String,
|
|
5199
|
+
reflect: true
|
|
5200
|
+
},
|
|
5201
|
+
|
|
5070
5202
|
/**
|
|
5071
5203
|
* Populates the `required` attribute on the element. Used for client-side validation.
|
|
5072
5204
|
*/
|
|
@@ -5529,6 +5661,10 @@ class AuroSelect extends LitElement {
|
|
|
5529
5661
|
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
5530
5662
|
?matchWidth="${!this.flexMenuWidth}"
|
|
5531
5663
|
chevron
|
|
5664
|
+
.placement="${this.placement}"
|
|
5665
|
+
.offset="${this.offset}"
|
|
5666
|
+
?autoPlacement="${this.autoPlacement}"
|
|
5667
|
+
?noFlip="${this.noFlip}"
|
|
5532
5668
|
part="dropdown">
|
|
5533
5669
|
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
5534
5670
|
<span id="placeholder" class="${classMap(placeholderClass)}"><slot name="placeholder"></slot></span>
|
package/package.json
CHANGED