@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
|
@@ -2659,7 +2659,7 @@ class AuroDropdownBib extends LitElement {
|
|
|
2659
2659
|
|
|
2660
2660
|
var dropdownVersion = '3.0.0';
|
|
2661
2661
|
|
|
2662
|
-
var styleCss$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)}`;
|
|
2662
|
+
var styleCss$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)}`;
|
|
2663
2663
|
|
|
2664
2664
|
var colorCss$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)}`;
|
|
2665
2665
|
|
|
@@ -2919,10 +2919,16 @@ class AuroDropdown extends LitElement {
|
|
|
2919
2919
|
this.disabled = false;
|
|
2920
2920
|
this.error = false;
|
|
2921
2921
|
this.inset = false;
|
|
2922
|
-
this.placement = 'bottom-start';
|
|
2923
2922
|
this.rounded = false;
|
|
2924
2923
|
this.tabIndex = 0;
|
|
2925
2924
|
this.noToggle = false;
|
|
2925
|
+
this.labeled = true;
|
|
2926
|
+
|
|
2927
|
+
// floaterConfig
|
|
2928
|
+
this.placement = 'bottom-start';
|
|
2929
|
+
this.offset = 0;
|
|
2930
|
+
this.noFlip = false;
|
|
2931
|
+
this.autoPlacement = false;
|
|
2926
2932
|
|
|
2927
2933
|
/**
|
|
2928
2934
|
* @private
|
|
@@ -2944,16 +2950,6 @@ class AuroDropdown extends LitElement {
|
|
|
2944
2950
|
*/
|
|
2945
2951
|
this.floater = new AuroFloatingUI();
|
|
2946
2952
|
|
|
2947
|
-
/**
|
|
2948
|
-
* @private
|
|
2949
|
-
*/
|
|
2950
|
-
this.floaterConfig = {
|
|
2951
|
-
placement: 'bottom-start',
|
|
2952
|
-
flip: true,
|
|
2953
|
-
autoPlacement: false,
|
|
2954
|
-
offset: 0,
|
|
2955
|
-
};
|
|
2956
|
-
|
|
2957
2953
|
/**
|
|
2958
2954
|
* Generate unique names for dependency components.
|
|
2959
2955
|
*/
|
|
@@ -2975,6 +2971,18 @@ class AuroDropdown extends LitElement {
|
|
|
2975
2971
|
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion, AuroHelpText);
|
|
2976
2972
|
}
|
|
2977
2973
|
|
|
2974
|
+
/**
|
|
2975
|
+
* @ignore
|
|
2976
|
+
*/
|
|
2977
|
+
get floaterConfig() {
|
|
2978
|
+
return {
|
|
2979
|
+
placement: this.placement,
|
|
2980
|
+
flip: !this.noFlip,
|
|
2981
|
+
autoPlacement: this.autoPlacement,
|
|
2982
|
+
offset: this.offset,
|
|
2983
|
+
};
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2978
2986
|
/**
|
|
2979
2987
|
* Public method to hide the dropdown.
|
|
2980
2988
|
* @returns {void}
|
|
@@ -2995,6 +3003,15 @@ class AuroDropdown extends LitElement {
|
|
|
2995
3003
|
static get properties() {
|
|
2996
3004
|
return {
|
|
2997
3005
|
|
|
3006
|
+
/**
|
|
3007
|
+
* If declared, bib's position will be automatically calculated where to appear.
|
|
3008
|
+
* @default false
|
|
3009
|
+
*/
|
|
3010
|
+
autoPlacement: {
|
|
3011
|
+
type: Boolean,
|
|
3012
|
+
reflect: true
|
|
3013
|
+
},
|
|
3014
|
+
|
|
2998
3015
|
/**
|
|
2999
3016
|
* If declared, applies a border around the trigger slot.
|
|
3000
3017
|
*/
|
|
@@ -3075,11 +3092,11 @@ class AuroDropdown extends LitElement {
|
|
|
3075
3092
|
},
|
|
3076
3093
|
|
|
3077
3094
|
/**
|
|
3078
|
-
* If true, the dropdown bib is taking the fullscreen when it's open
|
|
3095
|
+
* If true, the dropdown bib is taking the fullscreen when it's open.
|
|
3079
3096
|
*/
|
|
3080
3097
|
isBibFullscreen: {
|
|
3081
3098
|
type: Boolean,
|
|
3082
|
-
reflect: true
|
|
3099
|
+
reflect: true
|
|
3083
3100
|
},
|
|
3084
3101
|
|
|
3085
3102
|
/**
|
|
@@ -3105,6 +3122,15 @@ class AuroDropdown extends LitElement {
|
|
|
3105
3122
|
reflect: true
|
|
3106
3123
|
},
|
|
3107
3124
|
|
|
3125
|
+
/**
|
|
3126
|
+
* Defines if there is a label preset.
|
|
3127
|
+
* @private
|
|
3128
|
+
*/
|
|
3129
|
+
labeled: {
|
|
3130
|
+
type: Boolean,
|
|
3131
|
+
reflect: true
|
|
3132
|
+
},
|
|
3133
|
+
|
|
3108
3134
|
/**
|
|
3109
3135
|
* If declared, the popover and trigger will be set to the same width.
|
|
3110
3136
|
*/
|
|
@@ -3113,6 +3139,16 @@ class AuroDropdown extends LitElement {
|
|
|
3113
3139
|
reflect: true
|
|
3114
3140
|
},
|
|
3115
3141
|
|
|
3142
|
+
/**
|
|
3143
|
+
* If declared, the bib will NOT flip to an alternate position
|
|
3144
|
+
* when there isn't enough space in the specified `placement`.
|
|
3145
|
+
* @default false
|
|
3146
|
+
*/
|
|
3147
|
+
noFlip: {
|
|
3148
|
+
type: Boolean,
|
|
3149
|
+
reflect: true
|
|
3150
|
+
},
|
|
3151
|
+
|
|
3116
3152
|
/**
|
|
3117
3153
|
* If declared, the dropdown will not hide when moving focus outside the element.
|
|
3118
3154
|
*/
|
|
@@ -3129,16 +3165,32 @@ class AuroDropdown extends LitElement {
|
|
|
3129
3165
|
reflect: true
|
|
3130
3166
|
},
|
|
3131
3167
|
|
|
3168
|
+
/**
|
|
3169
|
+
* Gap between the trigger element and bib.
|
|
3170
|
+
* @default 0
|
|
3171
|
+
*/
|
|
3172
|
+
offset: {
|
|
3173
|
+
type: Number,
|
|
3174
|
+
reflect: true
|
|
3175
|
+
},
|
|
3176
|
+
|
|
3132
3177
|
onSlotChange: {
|
|
3133
3178
|
type: Function,
|
|
3134
3179
|
reflect: false
|
|
3135
3180
|
},
|
|
3136
3181
|
|
|
3137
3182
|
/**
|
|
3138
|
-
*
|
|
3183
|
+
* Position where the bib should appear relative to the trigger.
|
|
3184
|
+
* Accepted values:
|
|
3185
|
+
* "top" | "right" | "bottom" | "left" |
|
|
3186
|
+
* "bottom-start" | "top-start" | "top-end" |
|
|
3187
|
+
* "right-start" | "right-end" | "bottom-end" |
|
|
3188
|
+
* "left-start" | "left-end"
|
|
3189
|
+
* @default bottom-start
|
|
3139
3190
|
*/
|
|
3140
3191
|
placement: {
|
|
3141
|
-
type: String
|
|
3192
|
+
type: String,
|
|
3193
|
+
reflect: true
|
|
3142
3194
|
},
|
|
3143
3195
|
|
|
3144
3196
|
/**
|
|
@@ -3184,6 +3236,7 @@ class AuroDropdown extends LitElement {
|
|
|
3184
3236
|
|
|
3185
3237
|
disconnectedCallback() {
|
|
3186
3238
|
super.disconnectedCallback();
|
|
3239
|
+
this.floater.disconnect();
|
|
3187
3240
|
}
|
|
3188
3241
|
|
|
3189
3242
|
updated(changedProperties) {
|
|
@@ -3313,13 +3366,21 @@ class AuroDropdown extends LitElement {
|
|
|
3313
3366
|
handleTriggerContentSlotChange(event) {
|
|
3314
3367
|
this.floater.handleTriggerTabIndex();
|
|
3315
3368
|
|
|
3316
|
-
const
|
|
3369
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
|
|
3317
3370
|
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3371
|
+
if (triggerSlot) {
|
|
3372
|
+
|
|
3373
|
+
const triggerContentNodes = triggerSlot.assignedNodes();
|
|
3374
|
+
|
|
3375
|
+
if (triggerContentNodes) {
|
|
3376
|
+
|
|
3377
|
+
triggerContentNodes.forEach((node) => {
|
|
3378
|
+
if (!this.triggerContentFocusable) {
|
|
3379
|
+
this.triggerContentFocusable = this.containsFocusableElement(node);
|
|
3380
|
+
}
|
|
3381
|
+
});
|
|
3321
3382
|
}
|
|
3322
|
-
}
|
|
3383
|
+
}
|
|
3323
3384
|
|
|
3324
3385
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3325
3386
|
|
|
@@ -3373,6 +3434,29 @@ class AuroDropdown extends LitElement {
|
|
|
3373
3434
|
}
|
|
3374
3435
|
}
|
|
3375
3436
|
|
|
3437
|
+
/**
|
|
3438
|
+
* @private
|
|
3439
|
+
* @method handleLabelSlotChange
|
|
3440
|
+
* @param {event} event - The event object representing the slot change.
|
|
3441
|
+
* @description Handles the slot change event for the label slot.
|
|
3442
|
+
*/
|
|
3443
|
+
handleLabelSlotChange (event) {
|
|
3444
|
+
|
|
3445
|
+
// Get the nodes from the event
|
|
3446
|
+
const nodes = event.target.assignedNodes();
|
|
3447
|
+
|
|
3448
|
+
// Guard clause for no nodes
|
|
3449
|
+
if (!nodes) {
|
|
3450
|
+
return;
|
|
3451
|
+
}
|
|
3452
|
+
|
|
3453
|
+
// Convert the nodes to a measurable array so we can get the length
|
|
3454
|
+
const nodesArr = Array.from(nodes);
|
|
3455
|
+
|
|
3456
|
+
// If the nodes array has a length, the dropdown is labeled
|
|
3457
|
+
this.labeled = nodesArr.length > 0;
|
|
3458
|
+
}
|
|
3459
|
+
|
|
3376
3460
|
// function that renders the HTML and CSS into the scope of the component
|
|
3377
3461
|
render() {
|
|
3378
3462
|
return html$1`
|
|
@@ -3387,7 +3471,7 @@ class AuroDropdown extends LitElement {
|
|
|
3387
3471
|
>
|
|
3388
3472
|
<div class="triggerContentWrapper">
|
|
3389
3473
|
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3390
|
-
<slot name="label"></slot>
|
|
3474
|
+
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
3391
3475
|
</label>
|
|
3392
3476
|
<div class="triggerContent">
|
|
3393
3477
|
<slot
|
|
@@ -2659,7 +2659,7 @@ class AuroDropdownBib extends LitElement {
|
|
|
2659
2659
|
|
|
2660
2660
|
var dropdownVersion = '3.0.0';
|
|
2661
2661
|
|
|
2662
|
-
var styleCss$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)}`;
|
|
2662
|
+
var styleCss$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)}`;
|
|
2663
2663
|
|
|
2664
2664
|
var colorCss$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)}`;
|
|
2665
2665
|
|
|
@@ -2919,10 +2919,16 @@ class AuroDropdown extends LitElement {
|
|
|
2919
2919
|
this.disabled = false;
|
|
2920
2920
|
this.error = false;
|
|
2921
2921
|
this.inset = false;
|
|
2922
|
-
this.placement = 'bottom-start';
|
|
2923
2922
|
this.rounded = false;
|
|
2924
2923
|
this.tabIndex = 0;
|
|
2925
2924
|
this.noToggle = false;
|
|
2925
|
+
this.labeled = true;
|
|
2926
|
+
|
|
2927
|
+
// floaterConfig
|
|
2928
|
+
this.placement = 'bottom-start';
|
|
2929
|
+
this.offset = 0;
|
|
2930
|
+
this.noFlip = false;
|
|
2931
|
+
this.autoPlacement = false;
|
|
2926
2932
|
|
|
2927
2933
|
/**
|
|
2928
2934
|
* @private
|
|
@@ -2944,16 +2950,6 @@ class AuroDropdown extends LitElement {
|
|
|
2944
2950
|
*/
|
|
2945
2951
|
this.floater = new AuroFloatingUI();
|
|
2946
2952
|
|
|
2947
|
-
/**
|
|
2948
|
-
* @private
|
|
2949
|
-
*/
|
|
2950
|
-
this.floaterConfig = {
|
|
2951
|
-
placement: 'bottom-start',
|
|
2952
|
-
flip: true,
|
|
2953
|
-
autoPlacement: false,
|
|
2954
|
-
offset: 0,
|
|
2955
|
-
};
|
|
2956
|
-
|
|
2957
2953
|
/**
|
|
2958
2954
|
* Generate unique names for dependency components.
|
|
2959
2955
|
*/
|
|
@@ -2975,6 +2971,18 @@ class AuroDropdown extends LitElement {
|
|
|
2975
2971
|
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion, AuroHelpText);
|
|
2976
2972
|
}
|
|
2977
2973
|
|
|
2974
|
+
/**
|
|
2975
|
+
* @ignore
|
|
2976
|
+
*/
|
|
2977
|
+
get floaterConfig() {
|
|
2978
|
+
return {
|
|
2979
|
+
placement: this.placement,
|
|
2980
|
+
flip: !this.noFlip,
|
|
2981
|
+
autoPlacement: this.autoPlacement,
|
|
2982
|
+
offset: this.offset,
|
|
2983
|
+
};
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2978
2986
|
/**
|
|
2979
2987
|
* Public method to hide the dropdown.
|
|
2980
2988
|
* @returns {void}
|
|
@@ -2995,6 +3003,15 @@ class AuroDropdown extends LitElement {
|
|
|
2995
3003
|
static get properties() {
|
|
2996
3004
|
return {
|
|
2997
3005
|
|
|
3006
|
+
/**
|
|
3007
|
+
* If declared, bib's position will be automatically calculated where to appear.
|
|
3008
|
+
* @default false
|
|
3009
|
+
*/
|
|
3010
|
+
autoPlacement: {
|
|
3011
|
+
type: Boolean,
|
|
3012
|
+
reflect: true
|
|
3013
|
+
},
|
|
3014
|
+
|
|
2998
3015
|
/**
|
|
2999
3016
|
* If declared, applies a border around the trigger slot.
|
|
3000
3017
|
*/
|
|
@@ -3075,11 +3092,11 @@ class AuroDropdown extends LitElement {
|
|
|
3075
3092
|
},
|
|
3076
3093
|
|
|
3077
3094
|
/**
|
|
3078
|
-
* If true, the dropdown bib is taking the fullscreen when it's open
|
|
3095
|
+
* If true, the dropdown bib is taking the fullscreen when it's open.
|
|
3079
3096
|
*/
|
|
3080
3097
|
isBibFullscreen: {
|
|
3081
3098
|
type: Boolean,
|
|
3082
|
-
reflect: true
|
|
3099
|
+
reflect: true
|
|
3083
3100
|
},
|
|
3084
3101
|
|
|
3085
3102
|
/**
|
|
@@ -3105,6 +3122,15 @@ class AuroDropdown extends LitElement {
|
|
|
3105
3122
|
reflect: true
|
|
3106
3123
|
},
|
|
3107
3124
|
|
|
3125
|
+
/**
|
|
3126
|
+
* Defines if there is a label preset.
|
|
3127
|
+
* @private
|
|
3128
|
+
*/
|
|
3129
|
+
labeled: {
|
|
3130
|
+
type: Boolean,
|
|
3131
|
+
reflect: true
|
|
3132
|
+
},
|
|
3133
|
+
|
|
3108
3134
|
/**
|
|
3109
3135
|
* If declared, the popover and trigger will be set to the same width.
|
|
3110
3136
|
*/
|
|
@@ -3113,6 +3139,16 @@ class AuroDropdown extends LitElement {
|
|
|
3113
3139
|
reflect: true
|
|
3114
3140
|
},
|
|
3115
3141
|
|
|
3142
|
+
/**
|
|
3143
|
+
* If declared, the bib will NOT flip to an alternate position
|
|
3144
|
+
* when there isn't enough space in the specified `placement`.
|
|
3145
|
+
* @default false
|
|
3146
|
+
*/
|
|
3147
|
+
noFlip: {
|
|
3148
|
+
type: Boolean,
|
|
3149
|
+
reflect: true
|
|
3150
|
+
},
|
|
3151
|
+
|
|
3116
3152
|
/**
|
|
3117
3153
|
* If declared, the dropdown will not hide when moving focus outside the element.
|
|
3118
3154
|
*/
|
|
@@ -3129,16 +3165,32 @@ class AuroDropdown extends LitElement {
|
|
|
3129
3165
|
reflect: true
|
|
3130
3166
|
},
|
|
3131
3167
|
|
|
3168
|
+
/**
|
|
3169
|
+
* Gap between the trigger element and bib.
|
|
3170
|
+
* @default 0
|
|
3171
|
+
*/
|
|
3172
|
+
offset: {
|
|
3173
|
+
type: Number,
|
|
3174
|
+
reflect: true
|
|
3175
|
+
},
|
|
3176
|
+
|
|
3132
3177
|
onSlotChange: {
|
|
3133
3178
|
type: Function,
|
|
3134
3179
|
reflect: false
|
|
3135
3180
|
},
|
|
3136
3181
|
|
|
3137
3182
|
/**
|
|
3138
|
-
*
|
|
3183
|
+
* Position where the bib should appear relative to the trigger.
|
|
3184
|
+
* Accepted values:
|
|
3185
|
+
* "top" | "right" | "bottom" | "left" |
|
|
3186
|
+
* "bottom-start" | "top-start" | "top-end" |
|
|
3187
|
+
* "right-start" | "right-end" | "bottom-end" |
|
|
3188
|
+
* "left-start" | "left-end"
|
|
3189
|
+
* @default bottom-start
|
|
3139
3190
|
*/
|
|
3140
3191
|
placement: {
|
|
3141
|
-
type: String
|
|
3192
|
+
type: String,
|
|
3193
|
+
reflect: true
|
|
3142
3194
|
},
|
|
3143
3195
|
|
|
3144
3196
|
/**
|
|
@@ -3184,6 +3236,7 @@ class AuroDropdown extends LitElement {
|
|
|
3184
3236
|
|
|
3185
3237
|
disconnectedCallback() {
|
|
3186
3238
|
super.disconnectedCallback();
|
|
3239
|
+
this.floater.disconnect();
|
|
3187
3240
|
}
|
|
3188
3241
|
|
|
3189
3242
|
updated(changedProperties) {
|
|
@@ -3313,13 +3366,21 @@ class AuroDropdown extends LitElement {
|
|
|
3313
3366
|
handleTriggerContentSlotChange(event) {
|
|
3314
3367
|
this.floater.handleTriggerTabIndex();
|
|
3315
3368
|
|
|
3316
|
-
const
|
|
3369
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
|
|
3317
3370
|
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3371
|
+
if (triggerSlot) {
|
|
3372
|
+
|
|
3373
|
+
const triggerContentNodes = triggerSlot.assignedNodes();
|
|
3374
|
+
|
|
3375
|
+
if (triggerContentNodes) {
|
|
3376
|
+
|
|
3377
|
+
triggerContentNodes.forEach((node) => {
|
|
3378
|
+
if (!this.triggerContentFocusable) {
|
|
3379
|
+
this.triggerContentFocusable = this.containsFocusableElement(node);
|
|
3380
|
+
}
|
|
3381
|
+
});
|
|
3321
3382
|
}
|
|
3322
|
-
}
|
|
3383
|
+
}
|
|
3323
3384
|
|
|
3324
3385
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3325
3386
|
|
|
@@ -3373,6 +3434,29 @@ class AuroDropdown extends LitElement {
|
|
|
3373
3434
|
}
|
|
3374
3435
|
}
|
|
3375
3436
|
|
|
3437
|
+
/**
|
|
3438
|
+
* @private
|
|
3439
|
+
* @method handleLabelSlotChange
|
|
3440
|
+
* @param {event} event - The event object representing the slot change.
|
|
3441
|
+
* @description Handles the slot change event for the label slot.
|
|
3442
|
+
*/
|
|
3443
|
+
handleLabelSlotChange (event) {
|
|
3444
|
+
|
|
3445
|
+
// Get the nodes from the event
|
|
3446
|
+
const nodes = event.target.assignedNodes();
|
|
3447
|
+
|
|
3448
|
+
// Guard clause for no nodes
|
|
3449
|
+
if (!nodes) {
|
|
3450
|
+
return;
|
|
3451
|
+
}
|
|
3452
|
+
|
|
3453
|
+
// Convert the nodes to a measurable array so we can get the length
|
|
3454
|
+
const nodesArr = Array.from(nodes);
|
|
3455
|
+
|
|
3456
|
+
// If the nodes array has a length, the dropdown is labeled
|
|
3457
|
+
this.labeled = nodesArr.length > 0;
|
|
3458
|
+
}
|
|
3459
|
+
|
|
3376
3460
|
// function that renders the HTML and CSS into the scope of the component
|
|
3377
3461
|
render() {
|
|
3378
3462
|
return html$1`
|
|
@@ -3387,7 +3471,7 @@ class AuroDropdown extends LitElement {
|
|
|
3387
3471
|
>
|
|
3388
3472
|
<div class="triggerContentWrapper">
|
|
3389
3473
|
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3390
|
-
<slot name="label"></slot>
|
|
3474
|
+
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
3391
3475
|
</label>
|
|
3392
3476
|
<div class="triggerContent">
|
|
3393
3477
|
<slot
|
|
@@ -109,7 +109,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
109
109
|
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.
|
|
110
110
|
|
|
111
111
|
```html
|
|
112
|
-
<script type="module
|
|
112
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0/auro-form/+esm"></script>
|
|
113
113
|
```
|
|
114
114
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
115
115
|
|
|
@@ -109,7 +109,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
109
109
|
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.
|
|
110
110
|
|
|
111
111
|
```html
|
|
112
|
-
<script type="module
|
|
112
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0/auro-form/+esm"></script>
|
|
113
113
|
```
|
|
114
114
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
115
115
|
|
|
@@ -99,7 +99,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
99
99
|
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.
|
|
100
100
|
|
|
101
101
|
```html
|
|
102
|
-
<script type="module
|
|
102
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0/auro-input/+esm"></script>
|
|
103
103
|
```
|
|
104
104
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
105
105
|
|
|
@@ -99,7 +99,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
99
99
|
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.
|
|
100
100
|
|
|
101
101
|
```html
|
|
102
|
-
<script type="module
|
|
102
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0/auro-input/+esm"></script>
|
|
103
103
|
```
|
|
104
104
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
105
105
|
|
|
@@ -110,7 +110,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
110
110
|
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
111
|
|
|
112
112
|
```html
|
|
113
|
-
<script type="module
|
|
113
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0/auro-menu/+esm"></script>
|
|
114
114
|
```
|
|
115
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
116
|
|
|
@@ -110,7 +110,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
110
110
|
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
111
|
|
|
112
112
|
```html
|
|
113
|
-
<script type="module
|
|
113
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0/auro-menu/+esm"></script>
|
|
114
114
|
```
|
|
115
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
116
|
|
|
@@ -100,7 +100,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
100
100
|
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.
|
|
101
101
|
|
|
102
102
|
```html
|
|
103
|
-
<script type="module
|
|
103
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0/auro-radio/+esm"></script>
|
|
104
104
|
```
|
|
105
105
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
106
106
|
|
|
@@ -100,7 +100,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
100
100
|
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.
|
|
101
101
|
|
|
102
102
|
```html
|
|
103
|
-
<script type="module
|
|
103
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0/auro-radio/+esm"></script>
|
|
104
104
|
```
|
|
105
105
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
106
106
|
|
|
@@ -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
|
|
114
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0/auro-select/+esm"></script>
|
|
114
115
|
```
|
|
115
116
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
117
|
|