@swisspost/design-system-components 9.0.1 → 9.0.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/dist/cjs/index.cjs.js +17 -17
- package/dist/cjs/{package-93f142ae.js → package-5ee5fe83.js} +1 -1
- package/dist/cjs/{post-accordion-60af96cf.js → post-accordion-9b899815.js} +1 -1
- package/dist/cjs/{post-accordion-item-744c881d.js → post-accordion-item-b6c9964a.js} +1 -1
- package/dist/cjs/post-accordion-item.cjs.entry.js +2 -2
- package/dist/cjs/post-accordion.cjs.entry.js +2 -2
- package/dist/cjs/{post-alert-2a768f58.js → post-alert-268a495d.js} +1 -1
- package/dist/cjs/post-alert.cjs.entry.js +2 -2
- package/dist/cjs/{post-card-control-197c8e44.js → post-card-control-68ae617e.js} +1 -1
- package/dist/cjs/post-card-control.cjs.entry.js +2 -2
- package/dist/cjs/{post-collapsible-trigger-3de8fe4e.js → post-collapsible-trigger-261c2f39.js} +10 -3
- package/dist/cjs/post-collapsible_2.cjs.entry.js +2 -2
- package/dist/cjs/{post-icon-df629079.js → post-icon-8d216122.js} +1 -1
- package/dist/cjs/post-icon.cjs.entry.js +2 -2
- package/dist/cjs/{post-logo-7caeb918.js → post-logo-10605a3e.js} +1 -1
- package/dist/cjs/post-logo.cjs.entry.js +2 -2
- package/dist/cjs/{post-popover-090c3d01.js → post-popover-107fb291.js} +1 -1
- package/dist/cjs/post-popover.cjs.entry.js +2 -2
- package/dist/cjs/{post-popovercontainer-872681bf.js → post-popovercontainer-c0ff61d0.js} +99 -48
- package/dist/cjs/post-popovercontainer.cjs.entry.js +2 -2
- package/dist/cjs/{post-rating-21f9c46d.js → post-rating-88558157.js} +1 -1
- package/dist/cjs/post-rating.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-header-422d0f03.js → post-tab-header-d37d1e70.js} +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-panel-dd58f425.js → post-tab-panel-cf6187fa.js} +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/{post-tabs-83191b9a.js → post-tabs-bca7d2d7.js} +1 -1
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/{post-tag-c72183f2.js → post-tag-407cfc5b.js} +1 -1
- package/dist/cjs/post-tag.cjs.entry.js +2 -2
- package/dist/cjs/{post-tooltip-782f020b.js → post-tooltip-d8f4cd0d.js} +2 -2
- package/dist/cjs/{post-tooltip-trigger-b2aeb636.js → post-tooltip-trigger-94e84223.js} +15 -16
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +2 -2
- package/dist/cjs/post-tooltip.cjs.entry.js +2 -2
- package/dist/collection/animations/collapse.js +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +10 -3
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +14 -15
- package/dist/components/package.js +1 -1
- package/dist/components/post-collapsible2.js +9 -2
- package/dist/components/post-popovercontainer2.js +98 -47
- package/dist/components/post-tooltip-trigger2.js +14 -15
- package/dist/components/post-tooltip2.js +1 -1
- package/dist/docs.json +1 -1
- package/dist/esm/index.js +17 -17
- package/dist/esm/{package-45827c3b.js → package-8f0ae314.js} +1 -1
- package/dist/esm/{post-accordion-bcfe7e61.js → post-accordion-18fa6132.js} +1 -1
- package/dist/esm/{post-accordion-item-8869c90b.js → post-accordion-item-419fcfe2.js} +1 -1
- package/dist/esm/post-accordion-item.entry.js +2 -2
- package/dist/esm/post-accordion.entry.js +2 -2
- package/dist/esm/{post-alert-21fd0068.js → post-alert-253b376b.js} +1 -1
- package/dist/esm/post-alert.entry.js +2 -2
- package/dist/esm/{post-card-control-60c132dc.js → post-card-control-0010aad4.js} +1 -1
- package/dist/esm/post-card-control.entry.js +2 -2
- package/dist/esm/{post-collapsible-trigger-3168178e.js → post-collapsible-trigger-66131243.js} +10 -3
- package/dist/esm/post-collapsible_2.entry.js +2 -2
- package/dist/esm/{post-icon-2e2e18ad.js → post-icon-b054352c.js} +1 -1
- package/dist/esm/post-icon.entry.js +2 -2
- package/dist/esm/{post-logo-f364eb72.js → post-logo-38005da6.js} +1 -1
- package/dist/esm/post-logo.entry.js +2 -2
- package/dist/esm/{post-popover-697201cd.js → post-popover-b6200ea0.js} +1 -1
- package/dist/esm/post-popover.entry.js +2 -2
- package/dist/esm/{post-popovercontainer-2b5f37fb.js → post-popovercontainer-dced2841.js} +99 -48
- package/dist/esm/post-popovercontainer.entry.js +2 -2
- package/dist/esm/{post-rating-0fd5de37.js → post-rating-a3b7e183.js} +1 -1
- package/dist/esm/post-rating.entry.js +2 -2
- package/dist/esm/{post-tab-header-c8898fa2.js → post-tab-header-49bdb6b7.js} +1 -1
- package/dist/esm/post-tab-header.entry.js +2 -2
- package/dist/esm/{post-tab-panel-6b1219e0.js → post-tab-panel-2be8c912.js} +1 -1
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/{post-tabs-b8ff3c5d.js → post-tabs-0695851c.js} +1 -1
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/{post-tag-83470f28.js → post-tag-92e433d8.js} +1 -1
- package/dist/esm/post-tag.entry.js +2 -2
- package/dist/esm/{post-tooltip-aa745743.js → post-tooltip-b7c47a15.js} +2 -2
- package/dist/esm/{post-tooltip-trigger-ce0b4106.js → post-tooltip-trigger-d6fae10a.js} +15 -16
- package/dist/esm/post-tooltip-trigger.entry.js +2 -2
- package/dist/esm/post-tooltip.entry.js +2 -2
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/{p-7bbcc8ee.js → p-067e9412.js} +1 -1
- package/dist/post-components/p-0a59a271.entry.js +1 -0
- package/dist/post-components/{p-9409f729.js → p-20e1604b.js} +1 -1
- package/dist/post-components/p-22506477.entry.js +1 -0
- package/dist/post-components/{p-58cbb854.entry.js → p-248aaa99.entry.js} +1 -1
- package/dist/post-components/p-26d034ef.entry.js +1 -0
- package/dist/post-components/{p-56ca6bb5.js → p-27080bfb.js} +1 -1
- package/dist/post-components/{p-d582cc10.js → p-2fb07f77.js} +1 -1
- package/dist/post-components/{p-bafc0491.js → p-3369da47.js} +1 -1
- package/dist/post-components/{p-5f08d625.js → p-420b004b.js} +2 -2
- package/dist/post-components/p-45c6f495.js +1 -0
- package/dist/post-components/p-50eeae43.entry.js +1 -0
- package/dist/post-components/p-51537cc0.entry.js +1 -0
- package/dist/post-components/p-54468eb1.js +1 -0
- package/dist/post-components/{p-b46e2451.js → p-59cbed23.js} +1 -1
- package/dist/post-components/p-61808438.entry.js +1 -0
- package/dist/post-components/p-65392ded.entry.js +1 -0
- package/dist/post-components/p-667d7521.entry.js +1 -0
- package/dist/post-components/p-72500d90.entry.js +1 -0
- package/dist/post-components/{p-ffd75503.js → p-815f19ca.js} +1 -1
- package/dist/post-components/p-8217faac.js +1 -0
- package/dist/post-components/p-a05b39f5.js +1 -0
- package/dist/post-components/p-bd58b67d.entry.js +1 -0
- package/dist/post-components/{p-1a48d1b0.js → p-d376359a.js} +1 -1
- package/dist/post-components/{p-799cf60e.js → p-e45ba9a7.js} +1 -1
- package/dist/post-components/{p-a07846ea.js → p-e568d74d.js} +1 -1
- package/dist/post-components/p-e5b6268f.entry.js +1 -0
- package/dist/post-components/p-ee55eec3.entry.js +1 -0
- package/dist/post-components/p-efd36fcb.js +1 -0
- package/dist/post-components/p-f589212f.entry.js +1 -0
- package/dist/post-components/p-f6a89108.entry.js +1 -0
- package/dist/post-components/p-f81fe53a.entry.js +1 -0
- package/dist/post-components/{p-755b2746.js → p-feeb3e96.js} +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/animations/collapse.d.ts +1 -0
- package/loaders/package.js +1 -1
- package/loaders/post-collapsible2.js +9 -2
- package/loaders/post-popovercontainer2.js +98 -47
- package/loaders/post-tooltip-trigger.js +14 -15
- package/loaders/post-tooltip.js +1 -1
- package/package.json +2 -2
- package/dist/post-components/p-08dc45bb.entry.js +0 -1
- package/dist/post-components/p-2b61a526.entry.js +0 -1
- package/dist/post-components/p-3f5bf5d9.entry.js +0 -1
- package/dist/post-components/p-40e5bb56.entry.js +0 -1
- package/dist/post-components/p-5c557e64.js +0 -1
- package/dist/post-components/p-5ce2abc9.entry.js +0 -1
- package/dist/post-components/p-7069ac74.entry.js +0 -1
- package/dist/post-components/p-7cdf9571.entry.js +0 -1
- package/dist/post-components/p-7e4181ce.entry.js +0 -1
- package/dist/post-components/p-a4560368.js +0 -1
- package/dist/post-components/p-a503cb2c.entry.js +0 -1
- package/dist/post-components/p-b7207224.js +0 -1
- package/dist/post-components/p-c078fd94.entry.js +0 -1
- package/dist/post-components/p-c0aebe5e.entry.js +0 -1
- package/dist/post-components/p-c7e4acde.js +0 -1
- package/dist/post-components/p-ca71a3ff.entry.js +0 -1
- package/dist/post-components/p-e49f57c0.entry.js +0 -1
- package/dist/post-components/p-eb712f9b.entry.js +0 -1
- package/dist/post-components/p-eebd060d.js +0 -1
- package/dist/post-components/p-f7cead60.entry.js +0 -1
|
@@ -25,14 +25,11 @@ export class PostTooltipTrigger {
|
|
|
25
25
|
validateControlFor() {
|
|
26
26
|
checkType(this.for, // The actual property value
|
|
27
27
|
'string', // The expected type
|
|
28
|
-
'The "for" property must be a string'
|
|
29
|
-
);
|
|
28
|
+
'The "for" property must be a string');
|
|
30
29
|
}
|
|
31
30
|
get tooltip() {
|
|
32
31
|
const ref = document.getElementById(this.for);
|
|
33
|
-
return (ref === null || ref === void 0 ? void 0 : ref.localName) === 'post-tooltip'
|
|
34
|
-
? ref
|
|
35
|
-
: null;
|
|
32
|
+
return (ref === null || ref === void 0 ? void 0 : ref.localName) === 'post-tooltip' ? ref : null;
|
|
36
33
|
}
|
|
37
34
|
componentDidLoad() {
|
|
38
35
|
this.setupTrigger();
|
|
@@ -140,22 +137,24 @@ export class PostTooltipTrigger {
|
|
|
140
137
|
handleLeave(event) {
|
|
141
138
|
const newTarget = event.relatedTarget;
|
|
142
139
|
if ((this.tooltip && newTarget && this.tooltip.contains(newTarget)) ||
|
|
143
|
-
|
|
140
|
+
newTarget === this.trigger) {
|
|
144
141
|
return;
|
|
145
142
|
}
|
|
146
143
|
this.interestLostHandler();
|
|
147
144
|
}
|
|
148
145
|
interestHandler() {
|
|
149
146
|
var _a;
|
|
150
|
-
if (this.
|
|
151
|
-
this.
|
|
152
|
-
|
|
147
|
+
if (this.trigger) {
|
|
148
|
+
if (this.delay > 0) {
|
|
149
|
+
this.delayTimeout = window.setTimeout(() => {
|
|
150
|
+
var _a;
|
|
151
|
+
(_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.show(this.trigger);
|
|
152
|
+
this.delayTimeout = null;
|
|
153
|
+
}, this.delay);
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
153
156
|
(_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.show(this.trigger);
|
|
154
|
-
|
|
155
|
-
}, this.delay);
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
(_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.show(this.trigger);
|
|
157
|
+
}
|
|
159
158
|
}
|
|
160
159
|
}
|
|
161
160
|
interestLostHandler() {
|
|
@@ -167,7 +166,7 @@ export class PostTooltipTrigger {
|
|
|
167
166
|
(_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.hide();
|
|
168
167
|
}
|
|
169
168
|
render() {
|
|
170
|
-
return (h(Host, { key: '
|
|
169
|
+
return (h(Host, { key: '5e30c67f3ac854cb8c589978319ded51673c3380', "data-version": version }, h("slot", { key: '3aea5ba44638a4b2b904125c10bd22b9c20474f3', onSlotchange: () => this.handleSlotChange() })));
|
|
171
170
|
}
|
|
172
171
|
static get is() { return "post-tooltip-trigger"; }
|
|
173
172
|
static get encapsulation() { return "shadow"; }
|
|
@@ -39,7 +39,14 @@ const PostCollapsible = /*@__PURE__*/ proxyCustomElement(class PostCollapsible e
|
|
|
39
39
|
}
|
|
40
40
|
collapsedChange() {
|
|
41
41
|
checkEmptyOrType(this.collapsed, 'boolean', 'The `collapsed` property of the `post-collapsible` must be a boolean.');
|
|
42
|
-
|
|
42
|
+
if (!this.isLoaded) {
|
|
43
|
+
const expandedKeyframe = { height: 'auto', overflow: 'visible' };
|
|
44
|
+
Object.assign(this.host.style, this.collapsed ? collapsedKeyframe : expandedKeyframe);
|
|
45
|
+
this.isOpen = !this.collapsed;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
void this.toggle(!this.collapsed);
|
|
49
|
+
}
|
|
43
50
|
}
|
|
44
51
|
componentDidLoad() {
|
|
45
52
|
this.collapsedChange();
|
|
@@ -73,7 +80,7 @@ const PostCollapsible = /*@__PURE__*/ proxyCustomElement(class PostCollapsible e
|
|
|
73
80
|
triggers.forEach(trigger => trigger.update());
|
|
74
81
|
}
|
|
75
82
|
render() {
|
|
76
|
-
return (h(Host, { key: '
|
|
83
|
+
return (h(Host, { key: 'ca849a2c9845cca621404f364dfd3973e3883309', "data-version": version }, h("slot", { key: '276f555d524d9c22856146611df3de69303511e4' })));
|
|
77
84
|
}
|
|
78
85
|
get host() { return this; }
|
|
79
86
|
static get watchers() { return {
|
|
@@ -45,8 +45,9 @@ function getOppositeAxis(axis) {
|
|
|
45
45
|
function getAxisLength(axis) {
|
|
46
46
|
return axis === 'y' ? 'height' : 'width';
|
|
47
47
|
}
|
|
48
|
+
const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
|
|
48
49
|
function getSideAxis(placement) {
|
|
49
|
-
return
|
|
50
|
+
return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
|
|
50
51
|
}
|
|
51
52
|
function getAlignmentAxis(placement) {
|
|
52
53
|
return getOppositeAxis(getSideAxis(placement));
|
|
@@ -71,19 +72,19 @@ function getExpandedPlacements(placement) {
|
|
|
71
72
|
function getOppositeAlignmentPlacement(placement) {
|
|
72
73
|
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
73
74
|
}
|
|
75
|
+
const lrPlacement = ['left', 'right'];
|
|
76
|
+
const rlPlacement = ['right', 'left'];
|
|
77
|
+
const tbPlacement = ['top', 'bottom'];
|
|
78
|
+
const btPlacement = ['bottom', 'top'];
|
|
74
79
|
function getSideList(side, isStart, rtl) {
|
|
75
|
-
const lr = ['left', 'right'];
|
|
76
|
-
const rl = ['right', 'left'];
|
|
77
|
-
const tb = ['top', 'bottom'];
|
|
78
|
-
const bt = ['bottom', 'top'];
|
|
79
80
|
switch (side) {
|
|
80
81
|
case 'top':
|
|
81
82
|
case 'bottom':
|
|
82
|
-
if (rtl) return isStart ?
|
|
83
|
-
return isStart ?
|
|
83
|
+
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
84
|
+
return isStart ? lrPlacement : rlPlacement;
|
|
84
85
|
case 'left':
|
|
85
86
|
case 'right':
|
|
86
|
-
return isStart ?
|
|
87
|
+
return isStart ? tbPlacement : btPlacement;
|
|
87
88
|
default:
|
|
88
89
|
return [];
|
|
89
90
|
}
|
|
@@ -323,9 +324,10 @@ async function detectOverflow(state, options) {
|
|
|
323
324
|
strategy
|
|
324
325
|
}));
|
|
325
326
|
const rect = elementContext === 'floating' ? {
|
|
326
|
-
...rects.floating,
|
|
327
327
|
x,
|
|
328
|
-
y
|
|
328
|
+
y,
|
|
329
|
+
width: rects.floating.width,
|
|
330
|
+
height: rects.floating.height
|
|
329
331
|
} : rects.reference;
|
|
330
332
|
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
331
333
|
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
@@ -575,10 +577,12 @@ const flip$1 = function (options) {
|
|
|
575
577
|
return {};
|
|
576
578
|
}
|
|
577
579
|
const side = getSide(placement);
|
|
580
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
578
581
|
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
579
582
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
580
583
|
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
581
|
-
|
|
584
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
585
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
582
586
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
583
587
|
}
|
|
584
588
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
@@ -603,16 +607,22 @@ const flip$1 = function (options) {
|
|
|
603
607
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
604
608
|
const nextPlacement = placements[nextIndex];
|
|
605
609
|
if (nextPlacement) {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
610
|
+
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
611
|
+
if (!ignoreCrossAxisOverflow ||
|
|
612
|
+
// We leave the current main axis only if every placement on that axis
|
|
613
|
+
// overflows the main axis.
|
|
614
|
+
overflowsData.every(d => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {
|
|
615
|
+
// Try next placement and re-run the lifecycle.
|
|
616
|
+
return {
|
|
617
|
+
data: {
|
|
618
|
+
index: nextIndex,
|
|
619
|
+
overflows: overflowsData
|
|
620
|
+
},
|
|
621
|
+
reset: {
|
|
622
|
+
placement: nextPlacement
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
}
|
|
616
626
|
}
|
|
617
627
|
|
|
618
628
|
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
@@ -624,8 +634,17 @@ const flip$1 = function (options) {
|
|
|
624
634
|
switch (fallbackStrategy) {
|
|
625
635
|
case 'bestFit':
|
|
626
636
|
{
|
|
627
|
-
var _overflowsData$
|
|
628
|
-
const placement = (_overflowsData$
|
|
637
|
+
var _overflowsData$filter2;
|
|
638
|
+
const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
|
|
639
|
+
if (hasFallbackAxisSideDirection) {
|
|
640
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
641
|
+
return currentSideAxis === initialSideAxis ||
|
|
642
|
+
// Create a bias to the `y` side axis due to horizontal
|
|
643
|
+
// reading directions favoring greater width.
|
|
644
|
+
currentSideAxis === 'y';
|
|
645
|
+
}
|
|
646
|
+
return true;
|
|
647
|
+
}).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
629
648
|
if (placement) {
|
|
630
649
|
resetPlacement = placement;
|
|
631
650
|
}
|
|
@@ -849,6 +868,8 @@ const inline$1 = function (options) {
|
|
|
849
868
|
};
|
|
850
869
|
};
|
|
851
870
|
|
|
871
|
+
const originSides = /*#__PURE__*/new Set(['left', 'top']);
|
|
872
|
+
|
|
852
873
|
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
853
874
|
// Derivable.
|
|
854
875
|
|
|
@@ -862,9 +883,11 @@ async function convertValueToCoords(state, options) {
|
|
|
862
883
|
const side = getSide(placement);
|
|
863
884
|
const alignment = getAlignment(placement);
|
|
864
885
|
const isVertical = getSideAxis(placement) === 'y';
|
|
865
|
-
const mainAxisMulti =
|
|
886
|
+
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
866
887
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
867
888
|
const rawValue = evaluate(options, state);
|
|
889
|
+
|
|
890
|
+
// eslint-disable-next-line prefer-const
|
|
868
891
|
let {
|
|
869
892
|
mainAxis,
|
|
870
893
|
crossAxis,
|
|
@@ -874,10 +897,9 @@ async function convertValueToCoords(state, options) {
|
|
|
874
897
|
crossAxis: 0,
|
|
875
898
|
alignmentAxis: null
|
|
876
899
|
} : {
|
|
877
|
-
mainAxis: 0,
|
|
878
|
-
crossAxis: 0,
|
|
879
|
-
alignmentAxis:
|
|
880
|
-
...rawValue
|
|
900
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
901
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
902
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
881
903
|
};
|
|
882
904
|
if (alignment && typeof alignmentAxis === 'number') {
|
|
883
905
|
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
@@ -999,7 +1021,11 @@ const shift$1 = function (options) {
|
|
|
999
1021
|
...limitedCoords,
|
|
1000
1022
|
data: {
|
|
1001
1023
|
x: limitedCoords.x - x,
|
|
1002
|
-
y: limitedCoords.y - y
|
|
1024
|
+
y: limitedCoords.y - y,
|
|
1025
|
+
enabled: {
|
|
1026
|
+
[mainAxis]: checkMainAxis,
|
|
1027
|
+
[crossAxis]: checkCrossAxis
|
|
1028
|
+
}
|
|
1003
1029
|
}
|
|
1004
1030
|
};
|
|
1005
1031
|
}
|
|
@@ -1057,7 +1083,7 @@ const limitShift$1 = function (options) {
|
|
|
1057
1083
|
if (checkCrossAxis) {
|
|
1058
1084
|
var _middlewareData$offse, _middlewareData$offse2;
|
|
1059
1085
|
const len = mainAxis === 'y' ? 'width' : 'height';
|
|
1060
|
-
const isOriginSide =
|
|
1086
|
+
const isOriginSide = originSides.has(getSide(placement));
|
|
1061
1087
|
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
1062
1088
|
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
1063
1089
|
if (crossAxisCoord < limitMin) {
|
|
@@ -1088,6 +1114,7 @@ const size$1 = function (options) {
|
|
|
1088
1114
|
name: 'size',
|
|
1089
1115
|
options,
|
|
1090
1116
|
async fn(state) {
|
|
1117
|
+
var _state$middlewareData, _state$middlewareData2;
|
|
1091
1118
|
const {
|
|
1092
1119
|
placement,
|
|
1093
1120
|
rects,
|
|
@@ -1115,17 +1142,18 @@ const size$1 = function (options) {
|
|
|
1115
1142
|
widthSide = side;
|
|
1116
1143
|
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
|
1117
1144
|
}
|
|
1118
|
-
const
|
|
1119
|
-
const
|
|
1145
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
1146
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
1147
|
+
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
1148
|
+
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
1120
1149
|
const noShift = !state.middlewareData.shift;
|
|
1121
1150
|
let availableHeight = overflowAvailableHeight;
|
|
1122
1151
|
let availableWidth = overflowAvailableWidth;
|
|
1123
|
-
if (
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
|
|
1152
|
+
if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
|
|
1153
|
+
availableWidth = maximumClippingWidth;
|
|
1154
|
+
}
|
|
1155
|
+
if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
|
|
1156
|
+
availableHeight = maximumClippingHeight;
|
|
1129
1157
|
}
|
|
1130
1158
|
if (noShift && !alignment) {
|
|
1131
1159
|
const xMin = max(overflow.left, 0);
|
|
@@ -1156,6 +1184,9 @@ const size$1 = function (options) {
|
|
|
1156
1184
|
};
|
|
1157
1185
|
};
|
|
1158
1186
|
|
|
1187
|
+
function hasWindow() {
|
|
1188
|
+
return typeof window !== 'undefined';
|
|
1189
|
+
}
|
|
1159
1190
|
function getNodeName(node) {
|
|
1160
1191
|
if (isNode(node)) {
|
|
1161
1192
|
return (node.nodeName || '').toLowerCase();
|
|
@@ -1174,21 +1205,30 @@ function getDocumentElement(node) {
|
|
|
1174
1205
|
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
1175
1206
|
}
|
|
1176
1207
|
function isNode(value) {
|
|
1208
|
+
if (!hasWindow()) {
|
|
1209
|
+
return false;
|
|
1210
|
+
}
|
|
1177
1211
|
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
1178
1212
|
}
|
|
1179
1213
|
function isElement(value) {
|
|
1214
|
+
if (!hasWindow()) {
|
|
1215
|
+
return false;
|
|
1216
|
+
}
|
|
1180
1217
|
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
1181
1218
|
}
|
|
1182
1219
|
function isHTMLElement(value) {
|
|
1220
|
+
if (!hasWindow()) {
|
|
1221
|
+
return false;
|
|
1222
|
+
}
|
|
1183
1223
|
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
1184
1224
|
}
|
|
1185
1225
|
function isShadowRoot(value) {
|
|
1186
|
-
|
|
1187
|
-
if (typeof ShadowRoot === 'undefined') {
|
|
1226
|
+
if (!hasWindow() || typeof ShadowRoot === 'undefined') {
|
|
1188
1227
|
return false;
|
|
1189
1228
|
}
|
|
1190
1229
|
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
1191
1230
|
}
|
|
1231
|
+
const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
|
|
1192
1232
|
function isOverflowElement(element) {
|
|
1193
1233
|
const {
|
|
1194
1234
|
overflow,
|
|
@@ -1196,26 +1236,32 @@ function isOverflowElement(element) {
|
|
|
1196
1236
|
overflowY,
|
|
1197
1237
|
display
|
|
1198
1238
|
} = getComputedStyle(element);
|
|
1199
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !
|
|
1239
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
|
|
1200
1240
|
}
|
|
1241
|
+
const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
|
|
1201
1242
|
function isTableElement(element) {
|
|
1202
|
-
return
|
|
1243
|
+
return tableElements.has(getNodeName(element));
|
|
1203
1244
|
}
|
|
1245
|
+
const topLayerSelectors = [':popover-open', ':modal'];
|
|
1204
1246
|
function isTopLayer(element) {
|
|
1205
|
-
return
|
|
1247
|
+
return topLayerSelectors.some(selector => {
|
|
1206
1248
|
try {
|
|
1207
1249
|
return element.matches(selector);
|
|
1208
|
-
} catch (
|
|
1250
|
+
} catch (_e) {
|
|
1209
1251
|
return false;
|
|
1210
1252
|
}
|
|
1211
1253
|
});
|
|
1212
1254
|
}
|
|
1255
|
+
const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
|
|
1256
|
+
const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
|
|
1257
|
+
const containValues = ['paint', 'layout', 'strict', 'content'];
|
|
1213
1258
|
function isContainingBlock(elementOrCss) {
|
|
1214
1259
|
const webkit = isWebKit();
|
|
1215
1260
|
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
1216
1261
|
|
|
1217
1262
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1218
|
-
|
|
1263
|
+
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
1264
|
+
return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));
|
|
1219
1265
|
}
|
|
1220
1266
|
function getContainingBlock(element) {
|
|
1221
1267
|
let currentNode = getParentNode(element);
|
|
@@ -1233,8 +1279,9 @@ function isWebKit() {
|
|
|
1233
1279
|
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
1234
1280
|
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
1235
1281
|
}
|
|
1282
|
+
const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
|
|
1236
1283
|
function isLastTraversableNode(node) {
|
|
1237
|
-
return
|
|
1284
|
+
return lastTraversableNodeNames.has(getNodeName(node));
|
|
1238
1285
|
}
|
|
1239
1286
|
function getComputedStyle(element) {
|
|
1240
1287
|
return getWindow(element).getComputedStyle(element);
|
|
@@ -1288,10 +1335,14 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
1288
1335
|
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
1289
1336
|
const win = getWindow(scrollableAncestor);
|
|
1290
1337
|
if (isBody) {
|
|
1291
|
-
|
|
1338
|
+
const frameElement = getFrameElement(win);
|
|
1339
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
1292
1340
|
}
|
|
1293
1341
|
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
1294
1342
|
}
|
|
1343
|
+
function getFrameElement(win) {
|
|
1344
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
1345
|
+
}
|
|
1295
1346
|
|
|
1296
1347
|
function getCssDimensions(element) {
|
|
1297
1348
|
const css = getComputedStyle(element);
|
|
@@ -4796,14 +4796,11 @@ const PostTooltipTrigger = /*@__PURE__*/ proxyCustomElement(class PostTooltipTri
|
|
|
4796
4796
|
validateControlFor() {
|
|
4797
4797
|
checkType(this.for, // The actual property value
|
|
4798
4798
|
'string', // The expected type
|
|
4799
|
-
'The "for" property must be a string'
|
|
4800
|
-
);
|
|
4799
|
+
'The "for" property must be a string');
|
|
4801
4800
|
}
|
|
4802
4801
|
get tooltip() {
|
|
4803
4802
|
const ref = document.getElementById(this.for);
|
|
4804
|
-
return (ref === null || ref === void 0 ? void 0 : ref.localName) === 'post-tooltip'
|
|
4805
|
-
? ref
|
|
4806
|
-
: null;
|
|
4803
|
+
return (ref === null || ref === void 0 ? void 0 : ref.localName) === 'post-tooltip' ? ref : null;
|
|
4807
4804
|
}
|
|
4808
4805
|
componentDidLoad() {
|
|
4809
4806
|
this.setupTrigger();
|
|
@@ -4911,22 +4908,24 @@ const PostTooltipTrigger = /*@__PURE__*/ proxyCustomElement(class PostTooltipTri
|
|
|
4911
4908
|
handleLeave(event) {
|
|
4912
4909
|
const newTarget = event.relatedTarget;
|
|
4913
4910
|
if ((this.tooltip && newTarget && this.tooltip.contains(newTarget)) ||
|
|
4914
|
-
|
|
4911
|
+
newTarget === this.trigger) {
|
|
4915
4912
|
return;
|
|
4916
4913
|
}
|
|
4917
4914
|
this.interestLostHandler();
|
|
4918
4915
|
}
|
|
4919
4916
|
interestHandler() {
|
|
4920
4917
|
var _a;
|
|
4921
|
-
if (this.
|
|
4922
|
-
this.
|
|
4923
|
-
|
|
4918
|
+
if (this.trigger) {
|
|
4919
|
+
if (this.delay > 0) {
|
|
4920
|
+
this.delayTimeout = window.setTimeout(() => {
|
|
4921
|
+
var _a;
|
|
4922
|
+
(_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.show(this.trigger);
|
|
4923
|
+
this.delayTimeout = null;
|
|
4924
|
+
}, this.delay);
|
|
4925
|
+
}
|
|
4926
|
+
else {
|
|
4924
4927
|
(_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.show(this.trigger);
|
|
4925
|
-
|
|
4926
|
-
}, this.delay);
|
|
4927
|
-
}
|
|
4928
|
-
else {
|
|
4929
|
-
(_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.show(this.trigger);
|
|
4928
|
+
}
|
|
4930
4929
|
}
|
|
4931
4930
|
}
|
|
4932
4931
|
interestLostHandler() {
|
|
@@ -4938,7 +4937,7 @@ const PostTooltipTrigger = /*@__PURE__*/ proxyCustomElement(class PostTooltipTri
|
|
|
4938
4937
|
(_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.hide();
|
|
4939
4938
|
}
|
|
4940
4939
|
render() {
|
|
4941
|
-
return (h(Host, { key: '
|
|
4940
|
+
return (h(Host, { key: '5e30c67f3ac854cb8c589978319ded51673c3380', "data-version": version$1 }, h("slot", { key: '3aea5ba44638a4b2b904125c10bd22b9c20474f3', onSlotchange: () => this.handleSlotChange() })));
|
|
4942
4941
|
}
|
|
4943
4942
|
get host() { return this; }
|
|
4944
4943
|
static get watchers() { return {
|
|
@@ -3,7 +3,7 @@ import { v as version } from './package.js';
|
|
|
3
3
|
import { c as checkType } from './check-type.js';
|
|
4
4
|
import { d as defineCustomElement$1 } from './post-popovercontainer2.js';
|
|
5
5
|
|
|
6
|
-
const postTooltipCss = ":host{display:none;--post-contrast-color:#fff;--post-bg-rgb:51, 51, 51}:host([open]){display:block}post-popovercontainer[arrow]::after{position:absolute;content:\"\";inset:-13px;z-index:-1}post-popovercontainer>div{padding:.25rem .5rem;max-width:
|
|
6
|
+
const postTooltipCss = ":host{display:none;--post-contrast-color:#fff;--post-bg-rgb:51, 51, 51}:host([open]){display:block}post-popovercontainer[arrow]::after{position:absolute;content:\"\";inset:-13px;z-index:-1}post-popovercontainer>div{padding:.25rem .5rem;max-width:280px;min-height:32px;word-wrap:break-word;white-space:normal}";
|
|
7
7
|
const PostTooltipStyle0 = postTooltipCss;
|
|
8
8
|
|
|
9
9
|
const PostTooltip = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends HTMLElement {
|
package/dist/docs.json
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export { P as PostAccordion } from './post-accordion-
|
|
2
|
-
export { P as PostAccordionItem } from './post-accordion-item-
|
|
3
|
-
export { P as PostAlert } from './post-alert-
|
|
4
|
-
export { P as PostCardControl } from './post-card-control-
|
|
5
|
-
export { P as PostCollapsible, a as PostCollapsibleTrigger } from './post-collapsible-trigger-
|
|
6
|
-
export { P as PostIcon } from './post-icon-
|
|
7
|
-
export { P as PostLogo } from './post-logo-
|
|
8
|
-
export { P as PostPopover } from './post-popover-
|
|
9
|
-
export { P as PostPopovercontainer } from './post-popovercontainer-
|
|
10
|
-
export { P as PostRating } from './post-rating-
|
|
11
|
-
export { P as PostTabs } from './post-tabs-
|
|
12
|
-
export { P as PostTabHeader } from './post-tab-header-
|
|
13
|
-
export { P as PostTabPanel } from './post-tab-panel-
|
|
14
|
-
export { P as PostTooltip } from './post-tooltip-
|
|
15
|
-
export { P as PostTooltipTrigger } from './post-tooltip-trigger-
|
|
16
|
-
export { P as PostTag } from './post-tag-
|
|
1
|
+
export { P as PostAccordion } from './post-accordion-18fa6132.js';
|
|
2
|
+
export { P as PostAccordionItem } from './post-accordion-item-419fcfe2.js';
|
|
3
|
+
export { P as PostAlert } from './post-alert-253b376b.js';
|
|
4
|
+
export { P as PostCardControl } from './post-card-control-0010aad4.js';
|
|
5
|
+
export { P as PostCollapsible, a as PostCollapsibleTrigger } from './post-collapsible-trigger-66131243.js';
|
|
6
|
+
export { P as PostIcon } from './post-icon-b054352c.js';
|
|
7
|
+
export { P as PostLogo } from './post-logo-38005da6.js';
|
|
8
|
+
export { P as PostPopover } from './post-popover-b6200ea0.js';
|
|
9
|
+
export { P as PostPopovercontainer } from './post-popovercontainer-dced2841.js';
|
|
10
|
+
export { P as PostRating } from './post-rating-a3b7e183.js';
|
|
11
|
+
export { P as PostTabs } from './post-tabs-0695851c.js';
|
|
12
|
+
export { P as PostTabHeader } from './post-tab-header-49bdb6b7.js';
|
|
13
|
+
export { P as PostTabPanel } from './post-tab-panel-2be8c912.js';
|
|
14
|
+
export { P as PostTooltip } from './post-tooltip-b7c47a15.js';
|
|
15
|
+
export { P as PostTooltipTrigger } from './post-tooltip-trigger-d6fae10a.js';
|
|
16
|
+
export { P as PostTag } from './post-tag-92e433d8.js';
|
|
17
17
|
import './index-e1b64755.js';
|
|
18
|
-
import './package-
|
|
18
|
+
import './package-8f0ae314.js';
|
|
19
19
|
import './heading-levels-5b7b4349.js';
|
|
20
20
|
import './check-one-of-6b3ef8eb.js';
|
|
21
21
|
import './index-69587a51.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-e1b64755.js';
|
|
2
|
-
import { v as version } from './package-
|
|
2
|
+
import { v as version } from './package-8f0ae314.js';
|
|
3
3
|
import { H as HEADING_LEVELS } from './heading-levels-5b7b4349.js';
|
|
4
4
|
import { c as checkOneOf } from './check-one-of-6b3ef8eb.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-e1b64755.js';
|
|
2
|
-
import { v as version } from './package-
|
|
2
|
+
import { v as version } from './package-8f0ae314.js';
|
|
3
3
|
import { H as HEADING_LEVELS } from './heading-levels-5b7b4349.js';
|
|
4
4
|
import { c as checkEmptyOrOneOf } from './index-69587a51.js';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { P as post_accordion_item } from './post-accordion-item-
|
|
1
|
+
export { P as post_accordion_item } from './post-accordion-item-419fcfe2.js';
|
|
2
2
|
import './index-e1b64755.js';
|
|
3
|
-
import './package-
|
|
3
|
+
import './package-8f0ae314.js';
|
|
4
4
|
import './heading-levels-5b7b4349.js';
|
|
5
5
|
import './index-69587a51.js';
|
|
6
6
|
import './constants-8d548297.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { P as post_accordion } from './post-accordion-
|
|
1
|
+
export { P as post_accordion } from './post-accordion-18fa6132.js';
|
|
2
2
|
import './index-e1b64755.js';
|
|
3
|
-
import './package-
|
|
3
|
+
import './package-8f0ae314.js';
|
|
4
4
|
import './heading-levels-5b7b4349.js';
|
|
5
5
|
import './check-one-of-6b3ef8eb.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-e1b64755.js';
|
|
2
|
-
import { v as version } from './package-
|
|
2
|
+
import { v as version } from './package-8f0ae314.js';
|
|
3
3
|
import { f as fadeOut } from './fade-7fd71785.js';
|
|
4
4
|
import { a as checkEmptyOrPattern, c as checkEmptyOrOneOf } from './index-69587a51.js';
|
|
5
5
|
import { c as checkType } from './check-type-8828dbe4.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { P as post_alert } from './post-alert-
|
|
1
|
+
export { P as post_alert } from './post-alert-253b376b.js';
|
|
2
2
|
import './index-e1b64755.js';
|
|
3
|
-
import './package-
|
|
3
|
+
import './package-8f0ae314.js';
|
|
4
4
|
import './fade-7fd71785.js';
|
|
5
5
|
import './index-69587a51.js';
|
|
6
6
|
import './constants-8d548297.js';
|