@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
|
@@ -2731,7 +2731,7 @@ class AuroDropdownBib extends r {
|
|
|
2731
2731
|
|
|
2732
2732
|
var dropdownVersion = '3.0.0';
|
|
2733
2733
|
|
|
2734
|
-
var styleCss$1 = i$3`: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)}`;
|
|
2734
|
+
var styleCss$1 = i$3`: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)}`;
|
|
2735
2735
|
|
|
2736
2736
|
var colorCss$1 = i$3`.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)}`;
|
|
2737
2737
|
|
|
@@ -2991,10 +2991,16 @@ class AuroDropdown extends r {
|
|
|
2991
2991
|
this.disabled = false;
|
|
2992
2992
|
this.error = false;
|
|
2993
2993
|
this.inset = false;
|
|
2994
|
-
this.placement = 'bottom-start';
|
|
2995
2994
|
this.rounded = false;
|
|
2996
2995
|
this.tabIndex = 0;
|
|
2997
2996
|
this.noToggle = false;
|
|
2997
|
+
this.labeled = true;
|
|
2998
|
+
|
|
2999
|
+
// floaterConfig
|
|
3000
|
+
this.placement = 'bottom-start';
|
|
3001
|
+
this.offset = 0;
|
|
3002
|
+
this.noFlip = false;
|
|
3003
|
+
this.autoPlacement = false;
|
|
2998
3004
|
|
|
2999
3005
|
/**
|
|
3000
3006
|
* @private
|
|
@@ -3016,16 +3022,6 @@ class AuroDropdown extends r {
|
|
|
3016
3022
|
*/
|
|
3017
3023
|
this.floater = new AuroFloatingUI();
|
|
3018
3024
|
|
|
3019
|
-
/**
|
|
3020
|
-
* @private
|
|
3021
|
-
*/
|
|
3022
|
-
this.floaterConfig = {
|
|
3023
|
-
placement: 'bottom-start',
|
|
3024
|
-
flip: true,
|
|
3025
|
-
autoPlacement: false,
|
|
3026
|
-
offset: 0,
|
|
3027
|
-
};
|
|
3028
|
-
|
|
3029
3025
|
/**
|
|
3030
3026
|
* Generate unique names for dependency components.
|
|
3031
3027
|
*/
|
|
@@ -3047,6 +3043,18 @@ class AuroDropdown extends r {
|
|
|
3047
3043
|
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion, AuroHelpText);
|
|
3048
3044
|
}
|
|
3049
3045
|
|
|
3046
|
+
/**
|
|
3047
|
+
* @ignore
|
|
3048
|
+
*/
|
|
3049
|
+
get floaterConfig() {
|
|
3050
|
+
return {
|
|
3051
|
+
placement: this.placement,
|
|
3052
|
+
flip: !this.noFlip,
|
|
3053
|
+
autoPlacement: this.autoPlacement,
|
|
3054
|
+
offset: this.offset,
|
|
3055
|
+
};
|
|
3056
|
+
}
|
|
3057
|
+
|
|
3050
3058
|
/**
|
|
3051
3059
|
* Public method to hide the dropdown.
|
|
3052
3060
|
* @returns {void}
|
|
@@ -3067,6 +3075,15 @@ class AuroDropdown extends r {
|
|
|
3067
3075
|
static get properties() {
|
|
3068
3076
|
return {
|
|
3069
3077
|
|
|
3078
|
+
/**
|
|
3079
|
+
* If declared, bib's position will be automatically calculated where to appear.
|
|
3080
|
+
* @default false
|
|
3081
|
+
*/
|
|
3082
|
+
autoPlacement: {
|
|
3083
|
+
type: Boolean,
|
|
3084
|
+
reflect: true
|
|
3085
|
+
},
|
|
3086
|
+
|
|
3070
3087
|
/**
|
|
3071
3088
|
* If declared, applies a border around the trigger slot.
|
|
3072
3089
|
*/
|
|
@@ -3147,11 +3164,11 @@ class AuroDropdown extends r {
|
|
|
3147
3164
|
},
|
|
3148
3165
|
|
|
3149
3166
|
/**
|
|
3150
|
-
* If true, the dropdown bib is taking the fullscreen when it's open
|
|
3167
|
+
* If true, the dropdown bib is taking the fullscreen when it's open.
|
|
3151
3168
|
*/
|
|
3152
3169
|
isBibFullscreen: {
|
|
3153
3170
|
type: Boolean,
|
|
3154
|
-
reflect: true
|
|
3171
|
+
reflect: true
|
|
3155
3172
|
},
|
|
3156
3173
|
|
|
3157
3174
|
/**
|
|
@@ -3177,6 +3194,15 @@ class AuroDropdown extends r {
|
|
|
3177
3194
|
reflect: true
|
|
3178
3195
|
},
|
|
3179
3196
|
|
|
3197
|
+
/**
|
|
3198
|
+
* Defines if there is a label preset.
|
|
3199
|
+
* @private
|
|
3200
|
+
*/
|
|
3201
|
+
labeled: {
|
|
3202
|
+
type: Boolean,
|
|
3203
|
+
reflect: true
|
|
3204
|
+
},
|
|
3205
|
+
|
|
3180
3206
|
/**
|
|
3181
3207
|
* If declared, the popover and trigger will be set to the same width.
|
|
3182
3208
|
*/
|
|
@@ -3185,6 +3211,16 @@ class AuroDropdown extends r {
|
|
|
3185
3211
|
reflect: true
|
|
3186
3212
|
},
|
|
3187
3213
|
|
|
3214
|
+
/**
|
|
3215
|
+
* If declared, the bib will NOT flip to an alternate position
|
|
3216
|
+
* when there isn't enough space in the specified `placement`.
|
|
3217
|
+
* @default false
|
|
3218
|
+
*/
|
|
3219
|
+
noFlip: {
|
|
3220
|
+
type: Boolean,
|
|
3221
|
+
reflect: true
|
|
3222
|
+
},
|
|
3223
|
+
|
|
3188
3224
|
/**
|
|
3189
3225
|
* If declared, the dropdown will not hide when moving focus outside the element.
|
|
3190
3226
|
*/
|
|
@@ -3201,16 +3237,32 @@ class AuroDropdown extends r {
|
|
|
3201
3237
|
reflect: true
|
|
3202
3238
|
},
|
|
3203
3239
|
|
|
3240
|
+
/**
|
|
3241
|
+
* Gap between the trigger element and bib.
|
|
3242
|
+
* @default 0
|
|
3243
|
+
*/
|
|
3244
|
+
offset: {
|
|
3245
|
+
type: Number,
|
|
3246
|
+
reflect: true
|
|
3247
|
+
},
|
|
3248
|
+
|
|
3204
3249
|
onSlotChange: {
|
|
3205
3250
|
type: Function,
|
|
3206
3251
|
reflect: false
|
|
3207
3252
|
},
|
|
3208
3253
|
|
|
3209
3254
|
/**
|
|
3210
|
-
*
|
|
3255
|
+
* Position where the bib should appear relative to the trigger.
|
|
3256
|
+
* Accepted values:
|
|
3257
|
+
* "top" | "right" | "bottom" | "left" |
|
|
3258
|
+
* "bottom-start" | "top-start" | "top-end" |
|
|
3259
|
+
* "right-start" | "right-end" | "bottom-end" |
|
|
3260
|
+
* "left-start" | "left-end"
|
|
3261
|
+
* @default bottom-start
|
|
3211
3262
|
*/
|
|
3212
3263
|
placement: {
|
|
3213
|
-
type: String
|
|
3264
|
+
type: String,
|
|
3265
|
+
reflect: true
|
|
3214
3266
|
},
|
|
3215
3267
|
|
|
3216
3268
|
/**
|
|
@@ -3256,6 +3308,7 @@ class AuroDropdown extends r {
|
|
|
3256
3308
|
|
|
3257
3309
|
disconnectedCallback() {
|
|
3258
3310
|
super.disconnectedCallback();
|
|
3311
|
+
this.floater.disconnect();
|
|
3259
3312
|
}
|
|
3260
3313
|
|
|
3261
3314
|
updated(changedProperties) {
|
|
@@ -3385,13 +3438,21 @@ class AuroDropdown extends r {
|
|
|
3385
3438
|
handleTriggerContentSlotChange(event) {
|
|
3386
3439
|
this.floater.handleTriggerTabIndex();
|
|
3387
3440
|
|
|
3388
|
-
const
|
|
3441
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
|
|
3389
3442
|
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3443
|
+
if (triggerSlot) {
|
|
3444
|
+
|
|
3445
|
+
const triggerContentNodes = triggerSlot.assignedNodes();
|
|
3446
|
+
|
|
3447
|
+
if (triggerContentNodes) {
|
|
3448
|
+
|
|
3449
|
+
triggerContentNodes.forEach((node) => {
|
|
3450
|
+
if (!this.triggerContentFocusable) {
|
|
3451
|
+
this.triggerContentFocusable = this.containsFocusableElement(node);
|
|
3452
|
+
}
|
|
3453
|
+
});
|
|
3393
3454
|
}
|
|
3394
|
-
}
|
|
3455
|
+
}
|
|
3395
3456
|
|
|
3396
3457
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3397
3458
|
|
|
@@ -3445,6 +3506,29 @@ class AuroDropdown extends r {
|
|
|
3445
3506
|
}
|
|
3446
3507
|
}
|
|
3447
3508
|
|
|
3509
|
+
/**
|
|
3510
|
+
* @private
|
|
3511
|
+
* @method handleLabelSlotChange
|
|
3512
|
+
* @param {event} event - The event object representing the slot change.
|
|
3513
|
+
* @description Handles the slot change event for the label slot.
|
|
3514
|
+
*/
|
|
3515
|
+
handleLabelSlotChange (event) {
|
|
3516
|
+
|
|
3517
|
+
// Get the nodes from the event
|
|
3518
|
+
const nodes = event.target.assignedNodes();
|
|
3519
|
+
|
|
3520
|
+
// Guard clause for no nodes
|
|
3521
|
+
if (!nodes) {
|
|
3522
|
+
return;
|
|
3523
|
+
}
|
|
3524
|
+
|
|
3525
|
+
// Convert the nodes to a measurable array so we can get the length
|
|
3526
|
+
const nodesArr = Array.from(nodes);
|
|
3527
|
+
|
|
3528
|
+
// If the nodes array has a length, the dropdown is labeled
|
|
3529
|
+
this.labeled = nodesArr.length > 0;
|
|
3530
|
+
}
|
|
3531
|
+
|
|
3448
3532
|
// function that renders the HTML and CSS into the scope of the component
|
|
3449
3533
|
render() {
|
|
3450
3534
|
return u$1`
|
|
@@ -3459,7 +3543,7 @@ class AuroDropdown extends r {
|
|
|
3459
3543
|
>
|
|
3460
3544
|
<div class="triggerContentWrapper">
|
|
3461
3545
|
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3462
|
-
<slot name="label"></slot>
|
|
3546
|
+
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
3463
3547
|
</label>
|
|
3464
3548
|
<div class="triggerContent">
|
|
3465
3549
|
<slot
|
|
@@ -2706,7 +2706,7 @@ class AuroDropdownBib extends r {
|
|
|
2706
2706
|
|
|
2707
2707
|
var dropdownVersion = '3.0.0';
|
|
2708
2708
|
|
|
2709
|
-
var styleCss$1 = i$3`: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)}`;
|
|
2709
|
+
var styleCss$1 = i$3`: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)}`;
|
|
2710
2710
|
|
|
2711
2711
|
var colorCss$1 = i$3`.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)}`;
|
|
2712
2712
|
|
|
@@ -2966,10 +2966,16 @@ class AuroDropdown extends r {
|
|
|
2966
2966
|
this.disabled = false;
|
|
2967
2967
|
this.error = false;
|
|
2968
2968
|
this.inset = false;
|
|
2969
|
-
this.placement = 'bottom-start';
|
|
2970
2969
|
this.rounded = false;
|
|
2971
2970
|
this.tabIndex = 0;
|
|
2972
2971
|
this.noToggle = false;
|
|
2972
|
+
this.labeled = true;
|
|
2973
|
+
|
|
2974
|
+
// floaterConfig
|
|
2975
|
+
this.placement = 'bottom-start';
|
|
2976
|
+
this.offset = 0;
|
|
2977
|
+
this.noFlip = false;
|
|
2978
|
+
this.autoPlacement = false;
|
|
2973
2979
|
|
|
2974
2980
|
/**
|
|
2975
2981
|
* @private
|
|
@@ -2991,16 +2997,6 @@ class AuroDropdown extends r {
|
|
|
2991
2997
|
*/
|
|
2992
2998
|
this.floater = new AuroFloatingUI();
|
|
2993
2999
|
|
|
2994
|
-
/**
|
|
2995
|
-
* @private
|
|
2996
|
-
*/
|
|
2997
|
-
this.floaterConfig = {
|
|
2998
|
-
placement: 'bottom-start',
|
|
2999
|
-
flip: true,
|
|
3000
|
-
autoPlacement: false,
|
|
3001
|
-
offset: 0,
|
|
3002
|
-
};
|
|
3003
|
-
|
|
3004
3000
|
/**
|
|
3005
3001
|
* Generate unique names for dependency components.
|
|
3006
3002
|
*/
|
|
@@ -3022,6 +3018,18 @@ class AuroDropdown extends r {
|
|
|
3022
3018
|
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion, AuroHelpText);
|
|
3023
3019
|
}
|
|
3024
3020
|
|
|
3021
|
+
/**
|
|
3022
|
+
* @ignore
|
|
3023
|
+
*/
|
|
3024
|
+
get floaterConfig() {
|
|
3025
|
+
return {
|
|
3026
|
+
placement: this.placement,
|
|
3027
|
+
flip: !this.noFlip,
|
|
3028
|
+
autoPlacement: this.autoPlacement,
|
|
3029
|
+
offset: this.offset,
|
|
3030
|
+
};
|
|
3031
|
+
}
|
|
3032
|
+
|
|
3025
3033
|
/**
|
|
3026
3034
|
* Public method to hide the dropdown.
|
|
3027
3035
|
* @returns {void}
|
|
@@ -3042,6 +3050,15 @@ class AuroDropdown extends r {
|
|
|
3042
3050
|
static get properties() {
|
|
3043
3051
|
return {
|
|
3044
3052
|
|
|
3053
|
+
/**
|
|
3054
|
+
* If declared, bib's position will be automatically calculated where to appear.
|
|
3055
|
+
* @default false
|
|
3056
|
+
*/
|
|
3057
|
+
autoPlacement: {
|
|
3058
|
+
type: Boolean,
|
|
3059
|
+
reflect: true
|
|
3060
|
+
},
|
|
3061
|
+
|
|
3045
3062
|
/**
|
|
3046
3063
|
* If declared, applies a border around the trigger slot.
|
|
3047
3064
|
*/
|
|
@@ -3122,11 +3139,11 @@ class AuroDropdown extends r {
|
|
|
3122
3139
|
},
|
|
3123
3140
|
|
|
3124
3141
|
/**
|
|
3125
|
-
* If true, the dropdown bib is taking the fullscreen when it's open
|
|
3142
|
+
* If true, the dropdown bib is taking the fullscreen when it's open.
|
|
3126
3143
|
*/
|
|
3127
3144
|
isBibFullscreen: {
|
|
3128
3145
|
type: Boolean,
|
|
3129
|
-
reflect: true
|
|
3146
|
+
reflect: true
|
|
3130
3147
|
},
|
|
3131
3148
|
|
|
3132
3149
|
/**
|
|
@@ -3152,6 +3169,15 @@ class AuroDropdown extends r {
|
|
|
3152
3169
|
reflect: true
|
|
3153
3170
|
},
|
|
3154
3171
|
|
|
3172
|
+
/**
|
|
3173
|
+
* Defines if there is a label preset.
|
|
3174
|
+
* @private
|
|
3175
|
+
*/
|
|
3176
|
+
labeled: {
|
|
3177
|
+
type: Boolean,
|
|
3178
|
+
reflect: true
|
|
3179
|
+
},
|
|
3180
|
+
|
|
3155
3181
|
/**
|
|
3156
3182
|
* If declared, the popover and trigger will be set to the same width.
|
|
3157
3183
|
*/
|
|
@@ -3160,6 +3186,16 @@ class AuroDropdown extends r {
|
|
|
3160
3186
|
reflect: true
|
|
3161
3187
|
},
|
|
3162
3188
|
|
|
3189
|
+
/**
|
|
3190
|
+
* If declared, the bib will NOT flip to an alternate position
|
|
3191
|
+
* when there isn't enough space in the specified `placement`.
|
|
3192
|
+
* @default false
|
|
3193
|
+
*/
|
|
3194
|
+
noFlip: {
|
|
3195
|
+
type: Boolean,
|
|
3196
|
+
reflect: true
|
|
3197
|
+
},
|
|
3198
|
+
|
|
3163
3199
|
/**
|
|
3164
3200
|
* If declared, the dropdown will not hide when moving focus outside the element.
|
|
3165
3201
|
*/
|
|
@@ -3176,16 +3212,32 @@ class AuroDropdown extends r {
|
|
|
3176
3212
|
reflect: true
|
|
3177
3213
|
},
|
|
3178
3214
|
|
|
3215
|
+
/**
|
|
3216
|
+
* Gap between the trigger element and bib.
|
|
3217
|
+
* @default 0
|
|
3218
|
+
*/
|
|
3219
|
+
offset: {
|
|
3220
|
+
type: Number,
|
|
3221
|
+
reflect: true
|
|
3222
|
+
},
|
|
3223
|
+
|
|
3179
3224
|
onSlotChange: {
|
|
3180
3225
|
type: Function,
|
|
3181
3226
|
reflect: false
|
|
3182
3227
|
},
|
|
3183
3228
|
|
|
3184
3229
|
/**
|
|
3185
|
-
*
|
|
3230
|
+
* Position where the bib should appear relative to the trigger.
|
|
3231
|
+
* Accepted values:
|
|
3232
|
+
* "top" | "right" | "bottom" | "left" |
|
|
3233
|
+
* "bottom-start" | "top-start" | "top-end" |
|
|
3234
|
+
* "right-start" | "right-end" | "bottom-end" |
|
|
3235
|
+
* "left-start" | "left-end"
|
|
3236
|
+
* @default bottom-start
|
|
3186
3237
|
*/
|
|
3187
3238
|
placement: {
|
|
3188
|
-
type: String
|
|
3239
|
+
type: String,
|
|
3240
|
+
reflect: true
|
|
3189
3241
|
},
|
|
3190
3242
|
|
|
3191
3243
|
/**
|
|
@@ -3231,6 +3283,7 @@ class AuroDropdown extends r {
|
|
|
3231
3283
|
|
|
3232
3284
|
disconnectedCallback() {
|
|
3233
3285
|
super.disconnectedCallback();
|
|
3286
|
+
this.floater.disconnect();
|
|
3234
3287
|
}
|
|
3235
3288
|
|
|
3236
3289
|
updated(changedProperties) {
|
|
@@ -3360,13 +3413,21 @@ class AuroDropdown extends r {
|
|
|
3360
3413
|
handleTriggerContentSlotChange(event) {
|
|
3361
3414
|
this.floater.handleTriggerTabIndex();
|
|
3362
3415
|
|
|
3363
|
-
const
|
|
3416
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
|
|
3364
3417
|
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3418
|
+
if (triggerSlot) {
|
|
3419
|
+
|
|
3420
|
+
const triggerContentNodes = triggerSlot.assignedNodes();
|
|
3421
|
+
|
|
3422
|
+
if (triggerContentNodes) {
|
|
3423
|
+
|
|
3424
|
+
triggerContentNodes.forEach((node) => {
|
|
3425
|
+
if (!this.triggerContentFocusable) {
|
|
3426
|
+
this.triggerContentFocusable = this.containsFocusableElement(node);
|
|
3427
|
+
}
|
|
3428
|
+
});
|
|
3368
3429
|
}
|
|
3369
|
-
}
|
|
3430
|
+
}
|
|
3370
3431
|
|
|
3371
3432
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3372
3433
|
|
|
@@ -3420,6 +3481,29 @@ class AuroDropdown extends r {
|
|
|
3420
3481
|
}
|
|
3421
3482
|
}
|
|
3422
3483
|
|
|
3484
|
+
/**
|
|
3485
|
+
* @private
|
|
3486
|
+
* @method handleLabelSlotChange
|
|
3487
|
+
* @param {event} event - The event object representing the slot change.
|
|
3488
|
+
* @description Handles the slot change event for the label slot.
|
|
3489
|
+
*/
|
|
3490
|
+
handleLabelSlotChange (event) {
|
|
3491
|
+
|
|
3492
|
+
// Get the nodes from the event
|
|
3493
|
+
const nodes = event.target.assignedNodes();
|
|
3494
|
+
|
|
3495
|
+
// Guard clause for no nodes
|
|
3496
|
+
if (!nodes) {
|
|
3497
|
+
return;
|
|
3498
|
+
}
|
|
3499
|
+
|
|
3500
|
+
// Convert the nodes to a measurable array so we can get the length
|
|
3501
|
+
const nodesArr = Array.from(nodes);
|
|
3502
|
+
|
|
3503
|
+
// If the nodes array has a length, the dropdown is labeled
|
|
3504
|
+
this.labeled = nodesArr.length > 0;
|
|
3505
|
+
}
|
|
3506
|
+
|
|
3423
3507
|
// function that renders the HTML and CSS into the scope of the component
|
|
3424
3508
|
render() {
|
|
3425
3509
|
return u$1`
|
|
@@ -3434,7 +3518,7 @@ class AuroDropdown extends r {
|
|
|
3434
3518
|
>
|
|
3435
3519
|
<div class="triggerContentWrapper">
|
|
3436
3520
|
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3437
|
-
<slot name="label"></slot>
|
|
3521
|
+
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
3438
3522
|
</label>
|
|
3439
3523
|
<div class="triggerContent">
|
|
3440
3524
|
<slot
|
|
@@ -107,7 +107,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
107
107
|
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.
|
|
108
108
|
|
|
109
109
|
```html
|
|
110
|
-
<script type="module
|
|
110
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0/auro-dropdown/+esm"></script>
|
|
111
111
|
```
|
|
112
112
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
113
113
|
|
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export class AuroDropdown extends LitElement {
|
|
14
14
|
static get properties(): {
|
|
15
|
+
/**
|
|
16
|
+
* If declared, bib's position will be automatically calculated where to appear.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
autoPlacement: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
reflect: boolean;
|
|
22
|
+
};
|
|
15
23
|
/**
|
|
16
24
|
* If declared, applies a border around the trigger slot.
|
|
17
25
|
*/
|
|
@@ -82,7 +90,7 @@ export class AuroDropdown extends LitElement {
|
|
|
82
90
|
type: BooleanConstructor;
|
|
83
91
|
};
|
|
84
92
|
/**
|
|
85
|
-
* If true, the dropdown bib is taking the fullscreen when it's open
|
|
93
|
+
* If true, the dropdown bib is taking the fullscreen when it's open.
|
|
86
94
|
*/
|
|
87
95
|
isBibFullscreen: {
|
|
88
96
|
type: BooleanConstructor;
|
|
@@ -108,6 +116,14 @@ export class AuroDropdown extends LitElement {
|
|
|
108
116
|
type: StringConstructor;
|
|
109
117
|
reflect: boolean;
|
|
110
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* Defines if there is a label preset.
|
|
121
|
+
* @private
|
|
122
|
+
*/
|
|
123
|
+
labeled: {
|
|
124
|
+
type: BooleanConstructor;
|
|
125
|
+
reflect: boolean;
|
|
126
|
+
};
|
|
111
127
|
/**
|
|
112
128
|
* If declared, the popover and trigger will be set to the same width.
|
|
113
129
|
*/
|
|
@@ -115,6 +131,15 @@ export class AuroDropdown extends LitElement {
|
|
|
115
131
|
type: BooleanConstructor;
|
|
116
132
|
reflect: boolean;
|
|
117
133
|
};
|
|
134
|
+
/**
|
|
135
|
+
* If declared, the bib will NOT flip to an alternate position
|
|
136
|
+
* when there isn't enough space in the specified `placement`.
|
|
137
|
+
* @default false
|
|
138
|
+
*/
|
|
139
|
+
noFlip: {
|
|
140
|
+
type: BooleanConstructor;
|
|
141
|
+
reflect: boolean;
|
|
142
|
+
};
|
|
118
143
|
/**
|
|
119
144
|
* If declared, the dropdown will not hide when moving focus outside the element.
|
|
120
145
|
*/
|
|
@@ -129,15 +154,30 @@ export class AuroDropdown extends LitElement {
|
|
|
129
154
|
type: BooleanConstructor;
|
|
130
155
|
reflect: boolean;
|
|
131
156
|
};
|
|
157
|
+
/**
|
|
158
|
+
* Gap between the trigger element and bib.
|
|
159
|
+
* @default 0
|
|
160
|
+
*/
|
|
161
|
+
offset: {
|
|
162
|
+
type: NumberConstructor;
|
|
163
|
+
reflect: boolean;
|
|
164
|
+
};
|
|
132
165
|
onSlotChange: {
|
|
133
166
|
type: FunctionConstructor;
|
|
134
167
|
reflect: boolean;
|
|
135
168
|
};
|
|
136
169
|
/**
|
|
137
|
-
*
|
|
170
|
+
* Position where the bib should appear relative to the trigger.
|
|
171
|
+
* Accepted values:
|
|
172
|
+
* "top" | "right" | "bottom" | "left" |
|
|
173
|
+
* "bottom-start" | "top-start" | "top-end" |
|
|
174
|
+
* "right-start" | "right-end" | "bottom-end" |
|
|
175
|
+
* "left-start" | "left-end"
|
|
176
|
+
* @default bottom-start
|
|
138
177
|
*/
|
|
139
178
|
placement: {
|
|
140
179
|
type: StringConstructor;
|
|
180
|
+
reflect: boolean;
|
|
141
181
|
};
|
|
142
182
|
/**
|
|
143
183
|
* If declared, will apply border-radius to trigger and default slots.
|
|
@@ -185,9 +225,13 @@ export class AuroDropdown extends LitElement {
|
|
|
185
225
|
disabled: boolean;
|
|
186
226
|
error: boolean;
|
|
187
227
|
inset: boolean;
|
|
188
|
-
placement: string;
|
|
189
228
|
rounded: boolean;
|
|
190
229
|
noToggle: boolean;
|
|
230
|
+
labeled: boolean;
|
|
231
|
+
placement: string;
|
|
232
|
+
offset: number;
|
|
233
|
+
noFlip: boolean;
|
|
234
|
+
autoPlacement: boolean;
|
|
191
235
|
/**
|
|
192
236
|
* @private
|
|
193
237
|
*/
|
|
@@ -204,10 +248,6 @@ export class AuroDropdown extends LitElement {
|
|
|
204
248
|
* @private
|
|
205
249
|
*/
|
|
206
250
|
private floater;
|
|
207
|
-
/**
|
|
208
|
-
* @private
|
|
209
|
-
*/
|
|
210
|
-
private floaterConfig;
|
|
211
251
|
/**
|
|
212
252
|
* @private
|
|
213
253
|
*/
|
|
@@ -220,6 +260,15 @@ export class AuroDropdown extends LitElement {
|
|
|
220
260
|
* @private
|
|
221
261
|
*/
|
|
222
262
|
private helpTextTag;
|
|
263
|
+
/**
|
|
264
|
+
* @ignore
|
|
265
|
+
*/
|
|
266
|
+
get floaterConfig(): {
|
|
267
|
+
placement: string;
|
|
268
|
+
flip: boolean;
|
|
269
|
+
autoPlacement: boolean;
|
|
270
|
+
offset: number;
|
|
271
|
+
};
|
|
223
272
|
/**
|
|
224
273
|
* Public method to hide the dropdown.
|
|
225
274
|
* @returns {void}
|
|
@@ -279,6 +328,13 @@ export class AuroDropdown extends LitElement {
|
|
|
279
328
|
* @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
|
|
280
329
|
*/
|
|
281
330
|
private handleDefaultSlot;
|
|
331
|
+
/**
|
|
332
|
+
* @private
|
|
333
|
+
* @method handleLabelSlotChange
|
|
334
|
+
* @param {event} event - The event object representing the slot change.
|
|
335
|
+
* @description Handles the slot change event for the label slot.
|
|
336
|
+
*/
|
|
337
|
+
private handleLabelSlotChange;
|
|
282
338
|
render(): import("lit-html").TemplateResult;
|
|
283
339
|
}
|
|
284
340
|
import { LitElement } from "lit";
|