@aurodesignsystem-dev/auro-formkit 0.0.0-pr1309.1 → 0.0.0-pr1309.3
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/components/bibtemplate/dist/buttonVersion.d.ts +1 -1
- package/components/bibtemplate/dist/headerVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +6 -6
- package/components/bibtemplate/dist/registered.js +6 -6
- package/components/checkbox/demo/api.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/api.min.js +93 -88
- package/components/combobox/demo/index.html +5 -1
- package/components/combobox/demo/index.js +15 -0
- package/components/combobox/demo/index.min.js +98 -88
- package/components/combobox/dist/index.js +87 -82
- package/components/combobox/dist/registered.js +87 -82
- package/components/counter/demo/api.min.js +91 -86
- package/components/counter/demo/index.min.js +91 -86
- package/components/counter/dist/index.js +85 -80
- package/components/counter/dist/registered.js +85 -80
- package/components/datepicker/demo/api.md +2 -2
- package/components/datepicker/demo/api.min.js +93 -88
- package/components/datepicker/demo/index.min.js +93 -88
- package/components/datepicker/dist/buttonVersion.d.ts +1 -1
- package/components/datepicker/dist/index.js +89 -84
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +89 -84
- package/components/dropdown/README.md +2 -2
- package/components/dropdown/demo/api.html +3 -1
- package/components/dropdown/demo/api.js +20 -17
- package/components/dropdown/demo/api.md +49 -52
- package/components/dropdown/demo/api.min.js +154 -90
- package/components/dropdown/demo/index.html +3 -1
- package/components/dropdown/demo/index.js +10 -13
- package/components/dropdown/demo/index.md +6 -6
- package/components/dropdown/demo/index.min.js +109 -73
- package/components/dropdown/demo/readme.html +9 -1
- package/components/dropdown/demo/readme.md +2 -2
- package/components/dropdown/dist/index.js +76 -71
- package/components/dropdown/dist/registered.js +76 -71
- package/components/input/demo/api.min.js +2 -2
- package/components/input/demo/index.min.js +2 -2
- package/components/input/dist/buttonVersion.d.ts +1 -1
- package/components/input/dist/index.js +2 -2
- package/components/input/dist/registered.js +2 -2
- package/components/radio/demo/api.min.js +1 -1
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/api.min.js +89 -84
- package/components/select/demo/index.min.js +89 -84
- package/components/select/dist/index.js +83 -78
- package/components/select/dist/registered.js +83 -78
- package/custom-elements.json +1391 -1391
- package/package.json +5 -5
|
@@ -1,9 +1,63 @@
|
|
|
1
|
+
function errorExample() {
|
|
2
|
+
const btn = document.querySelector('#errorButton');
|
|
3
|
+
const dropdown = document.querySelector('#error');
|
|
4
|
+
|
|
5
|
+
btn?.addEventListener('click', () => {
|
|
6
|
+
dropdown?.hide();
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function inverseErrorExample() {
|
|
11
|
+
const btn = document.querySelector('#inverseErrorButton');
|
|
12
|
+
const dropdown = document.querySelector('#inverseError');
|
|
13
|
+
|
|
14
|
+
btn?.addEventListener('click', () => {
|
|
15
|
+
dropdown?.hide();
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function fullscreenBreakpointExample() {
|
|
20
|
+
const btn = document.querySelector('#fullscreenButton');
|
|
21
|
+
const dropdown = document.querySelector('#fullscreen');
|
|
22
|
+
|
|
23
|
+
btn?.addEventListener('click', () => {
|
|
24
|
+
dropdown?.hide();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function classicExample() {
|
|
29
|
+
const btn = document.querySelector('#classicButton');
|
|
30
|
+
const dropdown = document.querySelector('#classic');
|
|
31
|
+
|
|
32
|
+
btn?.addEventListener('click', () => {
|
|
33
|
+
dropdown?.hide();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function classicInverseExample() {
|
|
38
|
+
const btn = document.querySelector('#classicInverseButton');
|
|
39
|
+
const dropdown = document.querySelector('#classicInverse');
|
|
40
|
+
|
|
41
|
+
btn?.addEventListener('click', () => {
|
|
42
|
+
dropdown?.hide();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function matchWidthExample() {
|
|
47
|
+
const btn = document.querySelector('#matchWidthButton');
|
|
48
|
+
const dropdown = document.querySelector('#matchWidth');
|
|
49
|
+
|
|
50
|
+
btn?.addEventListener('click', () => {
|
|
51
|
+
dropdown?.hide();
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
1
55
|
function hideExample() {
|
|
2
56
|
const btn = document.querySelector('#hideExampleBtn');
|
|
3
57
|
const dropdown = document.querySelector('#hideExample');
|
|
4
58
|
|
|
5
|
-
btn
|
|
6
|
-
dropdown
|
|
59
|
+
btn?.addEventListener('click', () => {
|
|
60
|
+
dropdown?.hide();
|
|
7
61
|
});
|
|
8
62
|
}
|
|
9
63
|
|
|
@@ -11,16 +65,24 @@ function showExample() {
|
|
|
11
65
|
const triggerInput = document.querySelector('#showExampleTriggerInput');
|
|
12
66
|
const dropdownElem = document.querySelector('#showMethodExample');
|
|
13
67
|
|
|
14
|
-
triggerInput
|
|
15
|
-
dropdownElem
|
|
68
|
+
triggerInput?.addEventListener('keydown', () => {
|
|
69
|
+
dropdownElem?.show();
|
|
16
70
|
});
|
|
17
71
|
}
|
|
18
72
|
|
|
19
73
|
function inDialogExample() {
|
|
20
|
-
document.querySelector("#dropdown-dialog-opener")
|
|
74
|
+
const openBtn = document.querySelector("#dropdown-dialog-opener");
|
|
75
|
+
const closeBtn = document.querySelector("#in-dialog-dismiss-btn");
|
|
76
|
+
const dropdown = document.querySelector("#in-dialog-dropdown");
|
|
77
|
+
|
|
78
|
+
openBtn?.addEventListener("click", () => {
|
|
21
79
|
const dialog = document.querySelector("#dropdown-dialog");
|
|
22
80
|
dialog.open = true;
|
|
23
81
|
});
|
|
82
|
+
|
|
83
|
+
closeBtn?.addEventListener("click", () => {
|
|
84
|
+
dropdown?.hide();
|
|
85
|
+
});
|
|
24
86
|
}
|
|
25
87
|
|
|
26
88
|
/**
|
|
@@ -364,6 +426,71 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
364
426
|
return coords;
|
|
365
427
|
}
|
|
366
428
|
|
|
429
|
+
/**
|
|
430
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
431
|
+
* element is overflowing a given clipping boundary on each side.
|
|
432
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
433
|
+
* - negative = how many pixels left before it will overflow
|
|
434
|
+
* - 0 = lies flush with the boundary
|
|
435
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
436
|
+
*/
|
|
437
|
+
async function detectOverflow(state, options) {
|
|
438
|
+
var _await$platform$isEle;
|
|
439
|
+
if (options === void 0) {
|
|
440
|
+
options = {};
|
|
441
|
+
}
|
|
442
|
+
const {
|
|
443
|
+
x,
|
|
444
|
+
y,
|
|
445
|
+
platform,
|
|
446
|
+
rects,
|
|
447
|
+
elements,
|
|
448
|
+
strategy
|
|
449
|
+
} = state;
|
|
450
|
+
const {
|
|
451
|
+
boundary = 'clippingAncestors',
|
|
452
|
+
rootBoundary = 'viewport',
|
|
453
|
+
elementContext = 'floating',
|
|
454
|
+
altBoundary = false,
|
|
455
|
+
padding = 0
|
|
456
|
+
} = evaluate(options, state);
|
|
457
|
+
const paddingObject = getPaddingObject(padding);
|
|
458
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
459
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
460
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
461
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
462
|
+
boundary,
|
|
463
|
+
rootBoundary,
|
|
464
|
+
strategy
|
|
465
|
+
}));
|
|
466
|
+
const rect = elementContext === 'floating' ? {
|
|
467
|
+
x,
|
|
468
|
+
y,
|
|
469
|
+
width: rects.floating.width,
|
|
470
|
+
height: rects.floating.height
|
|
471
|
+
} : rects.reference;
|
|
472
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
473
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
474
|
+
x: 1,
|
|
475
|
+
y: 1
|
|
476
|
+
} : {
|
|
477
|
+
x: 1,
|
|
478
|
+
y: 1
|
|
479
|
+
};
|
|
480
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
481
|
+
elements,
|
|
482
|
+
rect,
|
|
483
|
+
offsetParent,
|
|
484
|
+
strategy
|
|
485
|
+
}) : rect);
|
|
486
|
+
return {
|
|
487
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
488
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
489
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
490
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
|
|
367
494
|
/**
|
|
368
495
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
369
496
|
* next to a given reference element.
|
|
@@ -393,6 +520,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
393
520
|
let middlewareData = {};
|
|
394
521
|
let resetCount = 0;
|
|
395
522
|
for (let i = 0; i < validMiddleware.length; i++) {
|
|
523
|
+
var _platform$detectOverf;
|
|
396
524
|
const {
|
|
397
525
|
name,
|
|
398
526
|
fn
|
|
@@ -410,7 +538,10 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
410
538
|
strategy,
|
|
411
539
|
middlewareData,
|
|
412
540
|
rects,
|
|
413
|
-
platform
|
|
541
|
+
platform: {
|
|
542
|
+
...platform,
|
|
543
|
+
detectOverflow: (_platform$detectOverf = platform.detectOverflow) != null ? _platform$detectOverf : detectOverflow
|
|
544
|
+
},
|
|
414
545
|
elements: {
|
|
415
546
|
reference,
|
|
416
547
|
floating
|
|
@@ -455,71 +586,6 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
455
586
|
};
|
|
456
587
|
};
|
|
457
588
|
|
|
458
|
-
/**
|
|
459
|
-
* Resolves with an object of overflow side offsets that determine how much the
|
|
460
|
-
* element is overflowing a given clipping boundary on each side.
|
|
461
|
-
* - positive = overflowing the boundary by that number of pixels
|
|
462
|
-
* - negative = how many pixels left before it will overflow
|
|
463
|
-
* - 0 = lies flush with the boundary
|
|
464
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
465
|
-
*/
|
|
466
|
-
async function detectOverflow(state, options) {
|
|
467
|
-
var _await$platform$isEle;
|
|
468
|
-
if (options === void 0) {
|
|
469
|
-
options = {};
|
|
470
|
-
}
|
|
471
|
-
const {
|
|
472
|
-
x,
|
|
473
|
-
y,
|
|
474
|
-
platform,
|
|
475
|
-
rects,
|
|
476
|
-
elements,
|
|
477
|
-
strategy
|
|
478
|
-
} = state;
|
|
479
|
-
const {
|
|
480
|
-
boundary = 'clippingAncestors',
|
|
481
|
-
rootBoundary = 'viewport',
|
|
482
|
-
elementContext = 'floating',
|
|
483
|
-
altBoundary = false,
|
|
484
|
-
padding = 0
|
|
485
|
-
} = evaluate(options, state);
|
|
486
|
-
const paddingObject = getPaddingObject(padding);
|
|
487
|
-
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
488
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
489
|
-
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
490
|
-
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
491
|
-
boundary,
|
|
492
|
-
rootBoundary,
|
|
493
|
-
strategy
|
|
494
|
-
}));
|
|
495
|
-
const rect = elementContext === 'floating' ? {
|
|
496
|
-
x,
|
|
497
|
-
y,
|
|
498
|
-
width: rects.floating.width,
|
|
499
|
-
height: rects.floating.height
|
|
500
|
-
} : rects.reference;
|
|
501
|
-
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
502
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
503
|
-
x: 1,
|
|
504
|
-
y: 1
|
|
505
|
-
} : {
|
|
506
|
-
x: 1,
|
|
507
|
-
y: 1
|
|
508
|
-
};
|
|
509
|
-
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
510
|
-
elements,
|
|
511
|
-
rect,
|
|
512
|
-
offsetParent,
|
|
513
|
-
strategy
|
|
514
|
-
}) : rect);
|
|
515
|
-
return {
|
|
516
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
517
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
518
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
519
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
|
|
523
589
|
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
524
590
|
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
|
|
525
591
|
return allowedPlacementsSortedByAlignment.filter(placement => {
|
|
@@ -559,7 +625,7 @@ const autoPlacement$1 = function (options) {
|
|
|
559
625
|
...detectOverflowOptions
|
|
560
626
|
} = evaluate(options, state);
|
|
561
627
|
const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
562
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
628
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
563
629
|
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
|
564
630
|
const currentPlacement = placements$1[currentIndex];
|
|
565
631
|
if (currentPlacement == null) {
|
|
@@ -673,7 +739,7 @@ const flip$1 = function (options) {
|
|
|
673
739
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
674
740
|
}
|
|
675
741
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
676
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
742
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
677
743
|
const overflows = [];
|
|
678
744
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
679
745
|
if (checkMainAxis) {
|
|
@@ -857,7 +923,8 @@ const shift$1 = function (options) {
|
|
|
857
923
|
const {
|
|
858
924
|
x,
|
|
859
925
|
y,
|
|
860
|
-
placement
|
|
926
|
+
placement,
|
|
927
|
+
platform
|
|
861
928
|
} = state;
|
|
862
929
|
const {
|
|
863
930
|
mainAxis: checkMainAxis = true,
|
|
@@ -880,7 +947,7 @@ const shift$1 = function (options) {
|
|
|
880
947
|
x,
|
|
881
948
|
y
|
|
882
949
|
};
|
|
883
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
950
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
884
951
|
const crossAxis = getSideAxis(getSide(placement));
|
|
885
952
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
886
953
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -3338,7 +3405,7 @@ class AuroHelpText extends i {
|
|
|
3338
3405
|
}
|
|
3339
3406
|
}
|
|
3340
3407
|
|
|
3341
|
-
var formkitVersion = '
|
|
3408
|
+
var formkitVersion = '202601292208';
|
|
3342
3409
|
|
|
3343
3410
|
class AuroElement extends i {
|
|
3344
3411
|
static get properties() {
|
|
@@ -4394,20 +4461,17 @@ AuroDropdown.register();
|
|
|
4394
4461
|
|
|
4395
4462
|
/* eslint-disable jsdoc/require-jsdoc, no-magic-numbers */
|
|
4396
4463
|
|
|
4397
|
-
function initExamples(
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
}, 100);
|
|
4409
|
-
}
|
|
4410
|
-
}
|
|
4464
|
+
function initExamples() {
|
|
4465
|
+
// javascript example function calls to be added here upon creation to test examples
|
|
4466
|
+
errorExample();
|
|
4467
|
+
inverseErrorExample();
|
|
4468
|
+
fullscreenBreakpointExample();
|
|
4469
|
+
classicExample();
|
|
4470
|
+
classicInverseExample();
|
|
4471
|
+
matchWidthExample();
|
|
4472
|
+
hideExample();
|
|
4473
|
+
showExample();
|
|
4474
|
+
inDialogExample();
|
|
4411
4475
|
}
|
|
4412
4476
|
|
|
4413
4477
|
export { initExamples };
|
|
@@ -51,7 +51,9 @@
|
|
|
51
51
|
<script type="module">
|
|
52
52
|
import { initExamples } from "./index.min.js";
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
window.addEventListener('load', () => {
|
|
55
|
+
initExamples();
|
|
56
|
+
});
|
|
55
57
|
</script>
|
|
56
58
|
<!-- If additional elements are needed for the demo, add them here. -->
|
|
57
59
|
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-icon@latest/+esm" type="module"></script>
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
/* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { classicExample } from '../apiExamples/classic/basic.js';
|
|
4
|
+
import { classicInverseExample } from '../apiExamples/classic/appearance-inverse.js';
|
|
5
|
+
import { customExample } from '../apiExamples/custom.js';
|
|
6
|
+
|
|
3
7
|
import { AuroDropdown } from '../src/auro-dropdown.js';
|
|
4
8
|
AuroDropdown.register();
|
|
5
9
|
AuroDropdown.register('custom-dropdown');
|
|
6
10
|
|
|
7
|
-
export function initExamples(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (initialCount <= 20) {
|
|
13
|
-
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
|
14
|
-
setTimeout(() => {
|
|
15
|
-
initExamples(initialCount + 1);
|
|
16
|
-
}, 100);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
11
|
+
export function initExamples() {
|
|
12
|
+
// javascript example function calls to be added here upon creation to test examples
|
|
13
|
+
classicExample();
|
|
14
|
+
classicInverseExample();
|
|
15
|
+
customExample();
|
|
19
16
|
}
|
|
@@ -94,7 +94,7 @@ The `auro-dropdown` element supports multiple layouts to fit different design ne
|
|
|
94
94
|
<div style="padding: var(--ds-size-150);">
|
|
95
95
|
Lorem ipsum solar
|
|
96
96
|
<br />
|
|
97
|
-
<auro-button
|
|
97
|
+
<auro-button id="classicButton">
|
|
98
98
|
Dismiss Dropdown
|
|
99
99
|
</auro-button>
|
|
100
100
|
</div>
|
|
@@ -117,7 +117,7 @@ The `auro-dropdown` element supports multiple layouts to fit different design ne
|
|
|
117
117
|
<div style="padding: var(--ds-size-150);">
|
|
118
118
|
Lorem ipsum solar
|
|
119
119
|
<br />
|
|
120
|
-
<auro-button
|
|
120
|
+
<auro-button id="classicButton">
|
|
121
121
|
Dismiss Dropdown
|
|
122
122
|
</auro-button>
|
|
123
123
|
</div>
|
|
@@ -134,11 +134,11 @@ The `auro-dropdown` element supports multiple layouts to fit different design ne
|
|
|
134
134
|
<div class="exampleWrapper--ondark">
|
|
135
135
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/classic/appearance-inverse.html) -->
|
|
136
136
|
<!-- The below content is automatically added from ./../apiExamples/classic/appearance-inverse.html -->
|
|
137
|
-
<auro-dropdown appearance="inverse" layout="classic" shape="classic" size="lg"
|
|
137
|
+
<auro-dropdown id="classicInverse" appearance="inverse" layout="classic" shape="classic" size="lg" chevron aria-label="Label content for screen reader">
|
|
138
138
|
<div style="padding: var(--ds-size-150);">
|
|
139
139
|
Lorem ipsum solar
|
|
140
140
|
<br />
|
|
141
|
-
<auro-button
|
|
141
|
+
<auro-button id="classicInverseButton">
|
|
142
142
|
Dismiss Dropdown
|
|
143
143
|
</auro-button>
|
|
144
144
|
</div>
|
|
@@ -157,11 +157,11 @@ The `auro-dropdown` element supports multiple layouts to fit different design ne
|
|
|
157
157
|
<!-- The below code snippet is automatically added from ./../apiExamples/classic/appearance-inverse.html -->
|
|
158
158
|
|
|
159
159
|
```html
|
|
160
|
-
<auro-dropdown appearance="inverse" layout="classic" shape="classic" size="lg"
|
|
160
|
+
<auro-dropdown id="classicInverse" appearance="inverse" layout="classic" shape="classic" size="lg" chevron aria-label="Label content for screen reader">
|
|
161
161
|
<div style="padding: var(--ds-size-150);">
|
|
162
162
|
Lorem ipsum solar
|
|
163
163
|
<br />
|
|
164
|
-
<auro-button
|
|
164
|
+
<auro-button id="classicInverseButton">
|
|
165
165
|
Dismiss Dropdown
|
|
166
166
|
</auro-button>
|
|
167
167
|
</div>
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
function classicExample() {
|
|
2
|
+
const btn = document.querySelector('#classicButton');
|
|
3
|
+
const dropdown = document.querySelector('#classic');
|
|
4
|
+
|
|
5
|
+
btn?.addEventListener('click', () => {
|
|
6
|
+
dropdown?.hide();
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function classicInverseExample() {
|
|
11
|
+
const btn = document.querySelector('#classicInverseButton');
|
|
12
|
+
const dropdown = document.querySelector('#classicInverse');
|
|
13
|
+
|
|
14
|
+
btn?.addEventListener('click', () => {
|
|
15
|
+
dropdown?.hide();
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function customExample() {
|
|
20
|
+
const btn = document.querySelector('#customCommonButton');
|
|
21
|
+
const dropdown = document.querySelector('#customCommon');
|
|
22
|
+
|
|
23
|
+
btn?.addEventListener('click', () => {
|
|
24
|
+
dropdown?.hide();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
1
28
|
/**
|
|
2
29
|
* @license
|
|
3
30
|
* Copyright 2017 Google LLC
|
|
@@ -339,6 +366,71 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
339
366
|
return coords;
|
|
340
367
|
}
|
|
341
368
|
|
|
369
|
+
/**
|
|
370
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
371
|
+
* element is overflowing a given clipping boundary on each side.
|
|
372
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
373
|
+
* - negative = how many pixels left before it will overflow
|
|
374
|
+
* - 0 = lies flush with the boundary
|
|
375
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
376
|
+
*/
|
|
377
|
+
async function detectOverflow(state, options) {
|
|
378
|
+
var _await$platform$isEle;
|
|
379
|
+
if (options === void 0) {
|
|
380
|
+
options = {};
|
|
381
|
+
}
|
|
382
|
+
const {
|
|
383
|
+
x,
|
|
384
|
+
y,
|
|
385
|
+
platform,
|
|
386
|
+
rects,
|
|
387
|
+
elements,
|
|
388
|
+
strategy
|
|
389
|
+
} = state;
|
|
390
|
+
const {
|
|
391
|
+
boundary = 'clippingAncestors',
|
|
392
|
+
rootBoundary = 'viewport',
|
|
393
|
+
elementContext = 'floating',
|
|
394
|
+
altBoundary = false,
|
|
395
|
+
padding = 0
|
|
396
|
+
} = evaluate(options, state);
|
|
397
|
+
const paddingObject = getPaddingObject(padding);
|
|
398
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
399
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
400
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
401
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
402
|
+
boundary,
|
|
403
|
+
rootBoundary,
|
|
404
|
+
strategy
|
|
405
|
+
}));
|
|
406
|
+
const rect = elementContext === 'floating' ? {
|
|
407
|
+
x,
|
|
408
|
+
y,
|
|
409
|
+
width: rects.floating.width,
|
|
410
|
+
height: rects.floating.height
|
|
411
|
+
} : rects.reference;
|
|
412
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
413
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
414
|
+
x: 1,
|
|
415
|
+
y: 1
|
|
416
|
+
} : {
|
|
417
|
+
x: 1,
|
|
418
|
+
y: 1
|
|
419
|
+
};
|
|
420
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
421
|
+
elements,
|
|
422
|
+
rect,
|
|
423
|
+
offsetParent,
|
|
424
|
+
strategy
|
|
425
|
+
}) : rect);
|
|
426
|
+
return {
|
|
427
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
428
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
429
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
430
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
|
|
342
434
|
/**
|
|
343
435
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
344
436
|
* next to a given reference element.
|
|
@@ -368,6 +460,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
368
460
|
let middlewareData = {};
|
|
369
461
|
let resetCount = 0;
|
|
370
462
|
for (let i = 0; i < validMiddleware.length; i++) {
|
|
463
|
+
var _platform$detectOverf;
|
|
371
464
|
const {
|
|
372
465
|
name,
|
|
373
466
|
fn
|
|
@@ -385,7 +478,10 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
385
478
|
strategy,
|
|
386
479
|
middlewareData,
|
|
387
480
|
rects,
|
|
388
|
-
platform
|
|
481
|
+
platform: {
|
|
482
|
+
...platform,
|
|
483
|
+
detectOverflow: (_platform$detectOverf = platform.detectOverflow) != null ? _platform$detectOverf : detectOverflow
|
|
484
|
+
},
|
|
389
485
|
elements: {
|
|
390
486
|
reference,
|
|
391
487
|
floating
|
|
@@ -430,71 +526,6 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
430
526
|
};
|
|
431
527
|
};
|
|
432
528
|
|
|
433
|
-
/**
|
|
434
|
-
* Resolves with an object of overflow side offsets that determine how much the
|
|
435
|
-
* element is overflowing a given clipping boundary on each side.
|
|
436
|
-
* - positive = overflowing the boundary by that number of pixels
|
|
437
|
-
* - negative = how many pixels left before it will overflow
|
|
438
|
-
* - 0 = lies flush with the boundary
|
|
439
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
440
|
-
*/
|
|
441
|
-
async function detectOverflow(state, options) {
|
|
442
|
-
var _await$platform$isEle;
|
|
443
|
-
if (options === void 0) {
|
|
444
|
-
options = {};
|
|
445
|
-
}
|
|
446
|
-
const {
|
|
447
|
-
x,
|
|
448
|
-
y,
|
|
449
|
-
platform,
|
|
450
|
-
rects,
|
|
451
|
-
elements,
|
|
452
|
-
strategy
|
|
453
|
-
} = state;
|
|
454
|
-
const {
|
|
455
|
-
boundary = 'clippingAncestors',
|
|
456
|
-
rootBoundary = 'viewport',
|
|
457
|
-
elementContext = 'floating',
|
|
458
|
-
altBoundary = false,
|
|
459
|
-
padding = 0
|
|
460
|
-
} = evaluate(options, state);
|
|
461
|
-
const paddingObject = getPaddingObject(padding);
|
|
462
|
-
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
463
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
464
|
-
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
465
|
-
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
466
|
-
boundary,
|
|
467
|
-
rootBoundary,
|
|
468
|
-
strategy
|
|
469
|
-
}));
|
|
470
|
-
const rect = elementContext === 'floating' ? {
|
|
471
|
-
x,
|
|
472
|
-
y,
|
|
473
|
-
width: rects.floating.width,
|
|
474
|
-
height: rects.floating.height
|
|
475
|
-
} : rects.reference;
|
|
476
|
-
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
477
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
478
|
-
x: 1,
|
|
479
|
-
y: 1
|
|
480
|
-
} : {
|
|
481
|
-
x: 1,
|
|
482
|
-
y: 1
|
|
483
|
-
};
|
|
484
|
-
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
485
|
-
elements,
|
|
486
|
-
rect,
|
|
487
|
-
offsetParent,
|
|
488
|
-
strategy
|
|
489
|
-
}) : rect);
|
|
490
|
-
return {
|
|
491
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
492
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
493
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
494
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
495
|
-
};
|
|
496
|
-
}
|
|
497
|
-
|
|
498
529
|
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
499
530
|
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
|
|
500
531
|
return allowedPlacementsSortedByAlignment.filter(placement => {
|
|
@@ -534,7 +565,7 @@ const autoPlacement$1 = function (options) {
|
|
|
534
565
|
...detectOverflowOptions
|
|
535
566
|
} = evaluate(options, state);
|
|
536
567
|
const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
537
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
568
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
538
569
|
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
|
539
570
|
const currentPlacement = placements$1[currentIndex];
|
|
540
571
|
if (currentPlacement == null) {
|
|
@@ -648,7 +679,7 @@ const flip$1 = function (options) {
|
|
|
648
679
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
649
680
|
}
|
|
650
681
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
651
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
682
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
652
683
|
const overflows = [];
|
|
653
684
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
654
685
|
if (checkMainAxis) {
|
|
@@ -832,7 +863,8 @@ const shift$1 = function (options) {
|
|
|
832
863
|
const {
|
|
833
864
|
x,
|
|
834
865
|
y,
|
|
835
|
-
placement
|
|
866
|
+
placement,
|
|
867
|
+
platform
|
|
836
868
|
} = state;
|
|
837
869
|
const {
|
|
838
870
|
mainAxis: checkMainAxis = true,
|
|
@@ -855,7 +887,7 @@ const shift$1 = function (options) {
|
|
|
855
887
|
x,
|
|
856
888
|
y
|
|
857
889
|
};
|
|
858
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
890
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
859
891
|
const crossAxis = getSideAxis(getSide(placement));
|
|
860
892
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
861
893
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -3313,7 +3345,7 @@ class AuroHelpText extends i {
|
|
|
3313
3345
|
}
|
|
3314
3346
|
}
|
|
3315
3347
|
|
|
3316
|
-
var formkitVersion = '
|
|
3348
|
+
var formkitVersion = '202601292208';
|
|
3317
3349
|
|
|
3318
3350
|
class AuroElement extends i {
|
|
3319
3351
|
static get properties() {
|
|
@@ -4366,11 +4398,15 @@ class AuroDropdown extends AuroElement {
|
|
|
4366
4398
|
}
|
|
4367
4399
|
|
|
4368
4400
|
/* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */
|
|
4369
|
-
|
|
4401
|
+
|
|
4370
4402
|
AuroDropdown.register();
|
|
4371
4403
|
AuroDropdown.register('custom-dropdown');
|
|
4372
4404
|
|
|
4373
|
-
function initExamples(
|
|
4405
|
+
function initExamples() {
|
|
4406
|
+
// javascript example function calls to be added here upon creation to test examples
|
|
4407
|
+
classicExample();
|
|
4408
|
+
classicInverseExample();
|
|
4409
|
+
customExample();
|
|
4374
4410
|
}
|
|
4375
4411
|
|
|
4376
4412
|
export { initExamples };
|