@aurodesignsystem/auro-formkit 5.2.2 → 5.3.0
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 +10 -3
- package/components/bibtemplate/dist/buttonVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +18 -83
- package/components/bibtemplate/dist/registered.js +18 -83
- package/components/checkbox/demo/api.min.js +14 -3
- package/components/checkbox/demo/index.min.js +14 -3
- package/components/checkbox/dist/index.js +14 -3
- package/components/checkbox/dist/registered.js +14 -3
- package/components/combobox/demo/api.js +2 -0
- package/components/combobox/demo/api.md +117 -3
- package/components/combobox/demo/api.min.js +445 -343
- package/components/combobox/demo/index.min.js +348 -265
- package/components/combobox/dist/auro-combobox.d.ts +18 -0
- package/components/combobox/dist/index.js +275 -212
- package/components/combobox/dist/registered.js +275 -212
- package/components/counter/demo/api.md +29 -1
- package/components/counter/demo/api.min.js +264 -240
- package/components/counter/demo/index.min.js +264 -240
- package/components/counter/dist/auro-counter-group.d.ts +9 -0
- package/components/counter/dist/index.js +183 -176
- package/components/counter/dist/registered.js +183 -176
- package/components/datepicker/demo/api.md +23 -1
- package/components/datepicker/demo/api.min.js +420 -447
- package/components/datepicker/demo/index.min.js +420 -447
- package/components/datepicker/dist/auro-datepicker.d.ts +9 -0
- package/components/datepicker/dist/buttonVersion.d.ts +1 -1
- package/components/datepicker/dist/index.js +241 -279
- package/components/datepicker/dist/registered.js +241 -279
- package/components/dropdown/demo/api.md +46 -2
- package/components/dropdown/demo/api.min.js +148 -16
- package/components/dropdown/demo/index.min.js +148 -16
- package/components/dropdown/dist/auro-dropdown.d.ts +12 -0
- package/components/dropdown/dist/index.js +118 -3
- package/components/dropdown/dist/registered.js +118 -3
- package/components/input/demo/api.min.js +35 -89
- package/components/input/demo/index.min.js +35 -89
- package/components/input/dist/buttonVersion.d.ts +1 -1
- package/components/input/dist/index.js +35 -89
- package/components/input/dist/registered.js +35 -89
- package/components/menu/demo/api.min.js +11 -2
- package/components/menu/demo/index.min.js +11 -2
- package/components/menu/dist/index.js +11 -2
- package/components/menu/dist/registered.js +11 -2
- package/components/radio/demo/api.min.js +18 -7
- package/components/radio/demo/index.min.js +18 -7
- package/components/radio/dist/index.js +18 -7
- package/components/radio/dist/registered.js +18 -7
- package/components/select/demo/api.md +29 -1
- package/components/select/demo/api.min.js +269 -150
- package/components/select/demo/index.min.js +269 -150
- package/components/select/dist/auro-select.d.ts +11 -0
- package/components/select/dist/index.js +199 -106
- package/components/select/dist/registered.js +199 -106
- package/package.json +5 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { unsafeStatic, literal, html as html$1 } from 'lit/static-html.js';
|
|
2
2
|
import { classMap } from 'lit/directives/class-map.js';
|
|
3
3
|
import { LitElement, css, html } from 'lit';
|
|
4
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
|
4
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
6
|
|
|
6
7
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
@@ -99,6 +100,9 @@ const oppositeAlignmentMap = {
|
|
|
99
100
|
start: 'end',
|
|
100
101
|
end: 'start'
|
|
101
102
|
};
|
|
103
|
+
function clamp(start, value, end) {
|
|
104
|
+
return max(start, min(value, end));
|
|
105
|
+
}
|
|
102
106
|
function evaluate(value, param) {
|
|
103
107
|
return typeof value === 'function' ? value(param) : value;
|
|
104
108
|
}
|
|
@@ -741,6 +745,84 @@ const offset$1 = function (options) {
|
|
|
741
745
|
};
|
|
742
746
|
};
|
|
743
747
|
|
|
748
|
+
/**
|
|
749
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
750
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
751
|
+
* @see https://floating-ui.com/docs/shift
|
|
752
|
+
*/
|
|
753
|
+
const shift$1 = function (options) {
|
|
754
|
+
if (options === void 0) {
|
|
755
|
+
options = {};
|
|
756
|
+
}
|
|
757
|
+
return {
|
|
758
|
+
name: 'shift',
|
|
759
|
+
options,
|
|
760
|
+
async fn(state) {
|
|
761
|
+
const {
|
|
762
|
+
x,
|
|
763
|
+
y,
|
|
764
|
+
placement
|
|
765
|
+
} = state;
|
|
766
|
+
const {
|
|
767
|
+
mainAxis: checkMainAxis = true,
|
|
768
|
+
crossAxis: checkCrossAxis = false,
|
|
769
|
+
limiter = {
|
|
770
|
+
fn: _ref => {
|
|
771
|
+
let {
|
|
772
|
+
x,
|
|
773
|
+
y
|
|
774
|
+
} = _ref;
|
|
775
|
+
return {
|
|
776
|
+
x,
|
|
777
|
+
y
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
...detectOverflowOptions
|
|
782
|
+
} = evaluate(options, state);
|
|
783
|
+
const coords = {
|
|
784
|
+
x,
|
|
785
|
+
y
|
|
786
|
+
};
|
|
787
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
788
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
789
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
790
|
+
let mainAxisCoord = coords[mainAxis];
|
|
791
|
+
let crossAxisCoord = coords[crossAxis];
|
|
792
|
+
if (checkMainAxis) {
|
|
793
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
794
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
795
|
+
const min = mainAxisCoord + overflow[minSide];
|
|
796
|
+
const max = mainAxisCoord - overflow[maxSide];
|
|
797
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
798
|
+
}
|
|
799
|
+
if (checkCrossAxis) {
|
|
800
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
801
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
802
|
+
const min = crossAxisCoord + overflow[minSide];
|
|
803
|
+
const max = crossAxisCoord - overflow[maxSide];
|
|
804
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
805
|
+
}
|
|
806
|
+
const limitedCoords = limiter.fn({
|
|
807
|
+
...state,
|
|
808
|
+
[mainAxis]: mainAxisCoord,
|
|
809
|
+
[crossAxis]: crossAxisCoord
|
|
810
|
+
});
|
|
811
|
+
return {
|
|
812
|
+
...limitedCoords,
|
|
813
|
+
data: {
|
|
814
|
+
x: limitedCoords.x - x,
|
|
815
|
+
y: limitedCoords.y - y,
|
|
816
|
+
enabled: {
|
|
817
|
+
[mainAxis]: checkMainAxis,
|
|
818
|
+
[crossAxis]: checkCrossAxis
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
};
|
|
825
|
+
|
|
744
826
|
function hasWindow() {
|
|
745
827
|
return typeof window !== 'undefined';
|
|
746
828
|
}
|
|
@@ -1573,6 +1655,13 @@ const offset = offset$1;
|
|
|
1573
1655
|
*/
|
|
1574
1656
|
const autoPlacement = autoPlacement$1;
|
|
1575
1657
|
|
|
1658
|
+
/**
|
|
1659
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
1660
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
1661
|
+
* @see https://floating-ui.com/docs/shift
|
|
1662
|
+
*/
|
|
1663
|
+
const shift = shift$1;
|
|
1664
|
+
|
|
1576
1665
|
/**
|
|
1577
1666
|
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
1578
1667
|
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
@@ -1771,6 +1860,7 @@ class AuroFloatingUI {
|
|
|
1771
1860
|
// Define the middlware for the floater configuration
|
|
1772
1861
|
const middleware = [
|
|
1773
1862
|
offset(this.element.floaterConfig?.offset || 0),
|
|
1863
|
+
...this.element.floaterConfig?.shift ? [shift()] : [], // Add shift middleware if shift is enabled.
|
|
1774
1864
|
...this.element.floaterConfig?.flip ? [flip()] : [], // Add flip middleware if flip is enabled.
|
|
1775
1865
|
...this.element.floaterConfig?.autoPlacement ? [autoPlacement()] : [], // Add autoPlacement middleware if autoPlacement is enabled.
|
|
1776
1866
|
];
|
|
@@ -2953,7 +3043,7 @@ class AuroIcon extends BaseIcon {
|
|
|
2953
3043
|
|
|
2954
3044
|
var iconVersion = '8.1.2';
|
|
2955
3045
|
|
|
2956
|
-
var styleCss$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}`;
|
|
3046
|
+
var styleCss$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}:host(:not([isfullscreen])) .container[class*=shape-rounded]{border-radius:16px}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}`;
|
|
2957
3047
|
|
|
2958
3048
|
var colorCss$2 = css`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
2959
3049
|
|
|
@@ -3156,7 +3246,7 @@ var shapeSizeCss = css`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic
|
|
|
3156
3246
|
|
|
3157
3247
|
var colorCss$1 = css`:host(:not([layout*=classic])){--ds-auro-dropdown-trigger-border-color: transparent}:host(:not([ondark])) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus-within,:host(:not([ondark])) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host(:not([ondark])) .wrapper:hover{--ds-auro-dropdown-trigger-background-color: var(--ds-auro-dropdown-trigger-hover-background-color)}:host(:not([onDark])[disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([ondark])[error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]) .label,:host([onDark]) .helpText{color:var(--ds-auro-dropdown-label-text-color)}:host([onDark]) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host([onDark]) .wrapper:focus-within,:host([onDark]) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark]) .wrapper:hover{--ds-auro-dropdown-trigger-background-color: var(--ds-auro-dropdown-trigger-hover-background-color)}:host([onDark][disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}:host([ondark][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
3158
3248
|
|
|
3159
|
-
var styleCss$1 = css`:host{position:relative;display:block;text-align:left;
|
|
3249
|
+
var styleCss$1 = css`:host{position:relative;display:block;text-align:left}[popover=manual]{overflow:visible;padding:0;border:inherit;margin:0;background:inherit;outline:inherit}:host([open]){z-index:var(--depth-tooltip, 400)}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([matchwidth]) #bibSizer{width:100%}`;
|
|
3160
3250
|
|
|
3161
3251
|
var classicColorCss = css``;
|
|
3162
3252
|
|
|
@@ -3514,6 +3604,9 @@ class AuroDropdown extends AuroElement {
|
|
|
3514
3604
|
/** @private */
|
|
3515
3605
|
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
3516
3606
|
|
|
3607
|
+
/** @private */
|
|
3608
|
+
this.bibElement = createRef();
|
|
3609
|
+
|
|
3517
3610
|
this.privateDefaults();
|
|
3518
3611
|
}
|
|
3519
3612
|
|
|
@@ -3552,6 +3645,7 @@ class AuroDropdown extends AuroElement {
|
|
|
3552
3645
|
this.placement = 'bottom-start';
|
|
3553
3646
|
this.offset = 0;
|
|
3554
3647
|
this.noFlip = false;
|
|
3648
|
+
this.shift = false;
|
|
3555
3649
|
this.autoPlacement = false;
|
|
3556
3650
|
|
|
3557
3651
|
/**
|
|
@@ -3616,6 +3710,7 @@ class AuroDropdown extends AuroElement {
|
|
|
3616
3710
|
return {
|
|
3617
3711
|
placement: this.placement,
|
|
3618
3712
|
flip: !this.noFlip,
|
|
3713
|
+
shift: this.shift,
|
|
3619
3714
|
autoPlacement: this.autoPlacement,
|
|
3620
3715
|
offset: this.offset,
|
|
3621
3716
|
};
|
|
@@ -3816,6 +3911,15 @@ class AuroDropdown extends AuroElement {
|
|
|
3816
3911
|
reflect: true
|
|
3817
3912
|
},
|
|
3818
3913
|
|
|
3914
|
+
/**
|
|
3915
|
+
* If declared, the dropdown will shift its position to avoid being cut off by the viewport.
|
|
3916
|
+
* @default false
|
|
3917
|
+
*/
|
|
3918
|
+
shift: {
|
|
3919
|
+
type: Boolean,
|
|
3920
|
+
reflect: true
|
|
3921
|
+
},
|
|
3922
|
+
|
|
3819
3923
|
/**
|
|
3820
3924
|
* If declared, the dropdown will not hide when moving focus outside the element.
|
|
3821
3925
|
*/
|
|
@@ -3950,6 +4054,14 @@ class AuroDropdown extends AuroElement {
|
|
|
3950
4054
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
3951
4055
|
this.handleTriggerContentSlotChange();
|
|
3952
4056
|
}
|
|
4057
|
+
|
|
4058
|
+
if (changedProperties.has('isPopoverVisible') && this.bibElement.value) {
|
|
4059
|
+
if (this.isPopoverVisible) {
|
|
4060
|
+
this.bibElement.value.showPopover();
|
|
4061
|
+
} else {
|
|
4062
|
+
this.bibElement.value.hidePopover();
|
|
4063
|
+
}
|
|
4064
|
+
}
|
|
3953
4065
|
}
|
|
3954
4066
|
|
|
3955
4067
|
/**
|
|
@@ -4290,7 +4402,10 @@ class AuroDropdown extends AuroElement {
|
|
|
4290
4402
|
id="bib"
|
|
4291
4403
|
shape="${this.shape}"
|
|
4292
4404
|
?data-show="${this.isPopoverVisible}"
|
|
4293
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
4405
|
+
?isfullscreen="${this.isBibFullscreen}"
|
|
4406
|
+
${ref(this.bibElement)}
|
|
4407
|
+
popover="manual"
|
|
4408
|
+
>
|
|
4294
4409
|
<div class="slotContent">
|
|
4295
4410
|
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4296
4411
|
</div>
|