@adam-milo/ui 1.0.27 → 1.0.29
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/index.cjs +1 -1
- package/dist/index.js +3 -1
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +1 -1
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +1 -1
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +2 -2
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +1 -1
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +1 -1
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +43 -12
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +1 -1
- package/dist/index20.cjs +1 -0
- package/dist/index20.js +14 -0
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +20 -299
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +298 -13
- package/dist/index24.cjs +1 -0
- package/dist/index24.js +16 -0
- package/dist/{index26.cjs → index27.cjs} +1 -1
- package/dist/{index26.js → index27.js} +21 -21
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +2 -2
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +18 -3
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +3 -8
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +7 -66
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +66 -35
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +31 -56
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +60 -6
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +6 -208
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +203 -20
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +23 -202
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +204 -10
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +10 -289
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +288 -13
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +14 -39
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +36 -82
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +84 -9
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +8 -65
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +68 -3
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +3 -11
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +11 -31
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +30 -118
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +2 -2
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +120 -9
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +8 -14
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +14 -22
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +291 -33
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +22 -622
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +35 -35
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +620 -33
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +37 -5
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +36 -8
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +5 -3
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +8 -33
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +3 -178
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +31 -17
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +165 -706
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +16 -149
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +697 -149
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +146 -80
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +170 -44
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +85 -10
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +44 -16
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +10 -99
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +15 -7
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +99 -26
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +8 -34
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +27 -14
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +30 -41
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +13 -6
- package/dist/index88.cjs +1 -0
- package/dist/index88.js +48 -0
- package/dist/index89.cjs +1 -0
- package/dist/index89.js +9 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +2 -2
- package/dist/src/components/typography/text/Text.component.d.ts +93 -0
- package/dist/src/components/typography/text/Text.component.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index21.cjs +0 -1
- package/dist/index21.js +0 -22
- package/dist/index38.cjs +0 -1
- package/dist/index38.js +0 -21
- package/dist/index62.cjs +0 -1
- package/dist/index62.js +0 -297
- /package/dist/{index34.cjs → index35.cjs} +0 -0
- /package/dist/{index34.js → index35.js} +0 -0
package/dist/index75.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index68.cjs");function r(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const t=r(require("react"));var o=function(r){var o=r.sideCar,i=e.__rest(r,["sideCar"]);if(!o)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=o.read();if(!n)throw new Error("Sidecar medium not found");return t.createElement(n,e.__assign({},i))};o.isSideCarExport=!0,exports.exportSidecar=function(e,r){return e.useMedium(r),o};
|
package/dist/index75.js
CHANGED
|
@@ -1,154 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
x: v,
|
|
8
|
-
y: v
|
|
9
|
-
});
|
|
10
|
-
const oppositeSideMap = {
|
|
11
|
-
left: "right",
|
|
12
|
-
right: "left",
|
|
13
|
-
bottom: "top",
|
|
14
|
-
top: "bottom"
|
|
15
|
-
};
|
|
16
|
-
const oppositeAlignmentMap = {
|
|
17
|
-
start: "end",
|
|
18
|
-
end: "start"
|
|
19
|
-
};
|
|
20
|
-
function clamp(start, value, end) {
|
|
21
|
-
return max(start, min(value, end));
|
|
22
|
-
}
|
|
23
|
-
function evaluate(value, param) {
|
|
24
|
-
return typeof value === "function" ? value(param) : value;
|
|
25
|
-
}
|
|
26
|
-
function getSide(placement) {
|
|
27
|
-
return placement.split("-")[0];
|
|
28
|
-
}
|
|
29
|
-
function getAlignment(placement) {
|
|
30
|
-
return placement.split("-")[1];
|
|
31
|
-
}
|
|
32
|
-
function getOppositeAxis(axis) {
|
|
33
|
-
return axis === "x" ? "y" : "x";
|
|
34
|
-
}
|
|
35
|
-
function getAxisLength(axis) {
|
|
36
|
-
return axis === "y" ? "height" : "width";
|
|
37
|
-
}
|
|
38
|
-
const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
39
|
-
function getSideAxis(placement) {
|
|
40
|
-
return yAxisSides.has(getSide(placement)) ? "y" : "x";
|
|
41
|
-
}
|
|
42
|
-
function getAlignmentAxis(placement) {
|
|
43
|
-
return getOppositeAxis(getSideAxis(placement));
|
|
44
|
-
}
|
|
45
|
-
function getAlignmentSides(placement, rects, rtl) {
|
|
46
|
-
if (rtl === void 0) {
|
|
47
|
-
rtl = false;
|
|
1
|
+
import { __rest, __assign } from "./index68.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
var SideCar = function(_a) {
|
|
4
|
+
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
5
|
+
if (!sideCar) {
|
|
6
|
+
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
48
7
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
53
|
-
if (rects.reference[length] > rects.floating[length]) {
|
|
54
|
-
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
8
|
+
var Target = sideCar.read();
|
|
9
|
+
if (!Target) {
|
|
10
|
+
throw new Error("Sidecar medium not found");
|
|
55
11
|
}
|
|
56
|
-
return
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
function getOppositeAlignmentPlacement(placement) {
|
|
63
|
-
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
|
|
64
|
-
}
|
|
65
|
-
const lrPlacement = ["left", "right"];
|
|
66
|
-
const rlPlacement = ["right", "left"];
|
|
67
|
-
const tbPlacement = ["top", "bottom"];
|
|
68
|
-
const btPlacement = ["bottom", "top"];
|
|
69
|
-
function getSideList(side, isStart, rtl) {
|
|
70
|
-
switch (side) {
|
|
71
|
-
case "top":
|
|
72
|
-
case "bottom":
|
|
73
|
-
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
74
|
-
return isStart ? lrPlacement : rlPlacement;
|
|
75
|
-
case "left":
|
|
76
|
-
case "right":
|
|
77
|
-
return isStart ? tbPlacement : btPlacement;
|
|
78
|
-
default:
|
|
79
|
-
return [];
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
83
|
-
const alignment = getAlignment(placement);
|
|
84
|
-
let list = getSideList(getSide(placement), direction === "start", rtl);
|
|
85
|
-
if (alignment) {
|
|
86
|
-
list = list.map((side) => side + "-" + alignment);
|
|
87
|
-
if (flipAlignment) {
|
|
88
|
-
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return list;
|
|
92
|
-
}
|
|
93
|
-
function getOppositePlacement(placement) {
|
|
94
|
-
return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
|
|
95
|
-
}
|
|
96
|
-
function expandPaddingObject(padding) {
|
|
97
|
-
return {
|
|
98
|
-
top: 0,
|
|
99
|
-
right: 0,
|
|
100
|
-
bottom: 0,
|
|
101
|
-
left: 0,
|
|
102
|
-
...padding
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
function getPaddingObject(padding) {
|
|
106
|
-
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
107
|
-
top: padding,
|
|
108
|
-
right: padding,
|
|
109
|
-
bottom: padding,
|
|
110
|
-
left: padding
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
function rectToClientRect(rect) {
|
|
114
|
-
const {
|
|
115
|
-
x,
|
|
116
|
-
y,
|
|
117
|
-
width,
|
|
118
|
-
height
|
|
119
|
-
} = rect;
|
|
120
|
-
return {
|
|
121
|
-
width,
|
|
122
|
-
height,
|
|
123
|
-
top: y,
|
|
124
|
-
left: x,
|
|
125
|
-
right: x + width,
|
|
126
|
-
bottom: y + height,
|
|
127
|
-
x,
|
|
128
|
-
y
|
|
129
|
-
};
|
|
12
|
+
return React.createElement(Target, __assign({}, rest));
|
|
13
|
+
};
|
|
14
|
+
SideCar.isSideCarExport = true;
|
|
15
|
+
function exportSidecar(medium, exported) {
|
|
16
|
+
medium.useMedium(exported);
|
|
17
|
+
return SideCar;
|
|
130
18
|
}
|
|
131
19
|
export {
|
|
132
|
-
|
|
133
|
-
createCoords,
|
|
134
|
-
evaluate,
|
|
135
|
-
expandPaddingObject,
|
|
136
|
-
floor,
|
|
137
|
-
getAlignment,
|
|
138
|
-
getAlignmentAxis,
|
|
139
|
-
getAlignmentSides,
|
|
140
|
-
getAxisLength,
|
|
141
|
-
getExpandedPlacements,
|
|
142
|
-
getOppositeAlignmentPlacement,
|
|
143
|
-
getOppositeAxis,
|
|
144
|
-
getOppositeAxisPlacements,
|
|
145
|
-
getOppositePlacement,
|
|
146
|
-
getPaddingObject,
|
|
147
|
-
getSide,
|
|
148
|
-
getSideAxis,
|
|
149
|
-
max,
|
|
150
|
-
min,
|
|
151
|
-
rectToClientRect,
|
|
152
|
-
round,
|
|
153
|
-
sides
|
|
20
|
+
exportSidecar
|
|
154
21
|
};
|
package/dist/index76.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index77.cjs");function t(t,n,i){let{reference:a,floating:o}=t;const l=e.getSideAxis(n),r=e.getAlignmentAxis(n),s=e.getAxisLength(r),c=e.getSide(n),f="y"===l,m=a.x+a.width/2-o.width/2,g=a.y+a.height/2-o.height/2,d=a[s]/2-o[s]/2;let p;switch(c){case"top":p={x:m,y:a.y-o.height};break;case"bottom":p={x:m,y:a.y+a.height};break;case"right":p={x:a.x+a.width,y:g};break;case"left":p={x:a.x-o.width,y:g};break;default:p={x:a.x,y:a.y}}switch(e.getAlignment(n)){case"start":p[r]-=d*(i&&f?-1:1);break;case"end":p[r]+=d*(i&&f?-1:1)}return p}async function n(t,n){var i;void 0===n&&(n={});const{x:a,y:o,platform:l,rects:r,elements:s,strategy:c}=t,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:d=!1,padding:p=0}=e.evaluate(n,t),x=e.getPaddingObject(p),u=s[d?"floating"===g?"reference":"floating":g],y=e.rectToClientRect(await l.getClippingRect({element:null==(i=await(null==l.isElement?void 0:l.isElement(u)))||i?u:u.contextElement||await(null==l.getDocumentElement?void 0:l.getDocumentElement(s.floating)),boundary:f,rootBoundary:m,strategy:c})),h="floating"===g?{x:a,y:o,width:r.floating.width,height:r.floating.height}:r.reference,w=await(null==l.getOffsetParent?void 0:l.getOffsetParent(s.floating)),v=await(null==l.isElement?void 0:l.isElement(w))&&await(null==l.getScale?void 0:l.getScale(w))||{x:1,y:1},A=e.rectToClientRect(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:h,offsetParent:w,strategy:c}):h);return{top:(y.top-A.top+x.top)/v.y,bottom:(A.bottom-y.bottom+x.bottom)/v.y,left:(y.left-A.left+x.left)/v.x,right:(A.right-y.right+x.right)/v.x}}function i(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function a(t){return e.sides.some(e=>t[e]>=0)}const o=new Set(["left","top"]);exports.rectToClientRect=e.rectToClientRect,exports.arrow=t=>({name:"arrow",options:t,async fn(n){const{x:i,y:a,placement:o,rects:l,platform:r,elements:s,middlewareData:c}=n,{element:f,padding:m=0}=e.evaluate(t,n)||{};if(null==f)return{};const g=e.getPaddingObject(m),d={x:i,y:a},p=e.getAlignmentAxis(o),x=e.getAxisLength(p),u=await r.getDimensions(f),y="y"===p,h=y?"top":"left",w=y?"bottom":"right",v=y?"clientHeight":"clientWidth",A=l.reference[x]+l.reference[p]-d[p]-l.floating[x],b=d[p]-l.reference[p],S=await(null==r.getOffsetParent?void 0:r.getOffsetParent(f));let R=S?S[v]:0;R&&await(null==r.isElement?void 0:r.isElement(S))||(R=s.floating[v]||l.floating[x]);const O=A/2-b/2,P=R/2-u[x]/2-1,T=e.min(g[h],P),D=e.min(g[w],P),E=T,L=R-u[x]-D,k=R/2-u[x]/2+O,C=e.clamp(E,k,L),H=!c.arrow&&null!=e.getAlignment(o)&&k!==C&&l.reference[x]/2-(k<E?T:D)-u[x]/2<0,j=H?k<E?k-E:k-L:0;return{[p]:d[p]+j,data:{[p]:C,centerOffset:k-C-j,...H&&{alignmentOffset:j}},reset:H}}}),exports.computePosition=async(e,n,i)=>{const{placement:a="bottom",strategy:o="absolute",middleware:l=[],platform:r}=i,s=l.filter(Boolean),c=await(null==r.isRTL?void 0:r.isRTL(n));let f=await r.getElementRects({reference:e,floating:n,strategy:o}),{x:m,y:g}=t(f,a,c),d=a,p={},x=0;for(let u=0;u<s.length;u++){const{name:i,fn:l}=s[u],{x:y,y:h,data:w,reset:v}=await l({x:m,y:g,initialPlacement:a,placement:d,strategy:o,middlewareData:p,rects:f,platform:r,elements:{reference:e,floating:n}});m=null!=y?y:m,g=null!=h?h:g,p={...p,[i]:{...p[i],...w}},v&&x<=50&&(x++,"object"==typeof v&&(v.placement&&(d=v.placement),v.rects&&(f=!0===v.rects?await r.getElementRects({reference:e,floating:n,strategy:o}):v.rects),({x:m,y:g}=t(f,d,c))),u=-1)}return{x:m,y:g,placement:d,strategy:o,middlewareData:p}},exports.detectOverflow=n,exports.flip=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(i){var a,o;const{placement:l,middlewareData:r,rects:s,initialPlacement:c,platform:f,elements:m}=i,{mainAxis:g=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:y=!0,...h}=e.evaluate(t,i);if(null!=(a=r.arrow)&&a.alignmentOffset)return{};const w=e.getSide(l),v=e.getSideAxis(c),A=e.getSide(c)===c,b=await(null==f.isRTL?void 0:f.isRTL(m.floating)),S=p||(A||!y?[e.getOppositePlacement(c)]:e.getExpandedPlacements(c)),R="none"!==u;!p&&R&&S.push(...e.getOppositeAxisPlacements(c,y,u,b));const O=[c,...S],P=await n(i,h),T=[];let D=(null==(o=r.flip)?void 0:o.overflows)||[];if(g&&T.push(P[w]),d){const t=e.getAlignmentSides(l,s,b);T.push(P[t[0]],P[t[1]])}if(D=[...D,{placement:l,overflows:T}],!T.every(e=>e<=0)){var E,L;const t=((null==(E=r.flip)?void 0:E.index)||0)+1,n=O[t];if(n){if(!("alignment"===d&&v!==e.getSideAxis(n))||D.every(t=>e.getSideAxis(t.placement)!==v||t.overflows[0]>0))return{data:{index:t,overflows:D},reset:{placement:n}}}let i=null==(L=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:L.placement;if(!i)switch(x){case"bestFit":{var k;const t=null==(k=D.filter(t=>{if(R){const n=e.getSideAxis(t.placement);return n===v||"y"===n}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:k[0];t&&(i=t);break}case"initialPlacement":i=c}if(l!==i)return{reset:{placement:i}}}return{}}}},exports.hide=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(o){const{rects:l}=o,{strategy:r="referenceHidden",...s}=e.evaluate(t,o);switch(r){case"referenceHidden":{const e=i(await n(o,{...s,elementContext:"reference"}),l.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:a(e)}}}case"escaped":{const e=i(await n(o,{...s,altBoundary:!0}),l.floating);return{data:{escapedOffsets:e,escaped:a(e)}}}default:return{}}}}},exports.limitShift=function(t){return void 0===t&&(t={}),{options:t,fn(n){const{x:i,y:a,placement:l,rects:r,middlewareData:s}=n,{offset:c=0,mainAxis:f=!0,crossAxis:m=!0}=e.evaluate(t,n),g={x:i,y:a},d=e.getSideAxis(l),p=e.getOppositeAxis(d);let x=g[p],u=g[d];const y=e.evaluate(c,n),h="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(f){const e="y"===p?"height":"width",t=r.reference[p]-r.floating[e]+h.mainAxis,n=r.reference[p]+r.reference[e]-h.mainAxis;x<t?x=t:x>n&&(x=n)}if(m){var w,v;const t="y"===p?"width":"height",n=o.has(e.getSide(l)),i=r.reference[d]-r.floating[t]+(n&&(null==(w=s.offset)?void 0:w[d])||0)+(n?0:h.crossAxis),a=r.reference[d]+r.reference[t]+(n?0:(null==(v=s.offset)?void 0:v[d])||0)-(n?h.crossAxis:0);u<i?u=i:u>a&&(u=a)}return{[p]:x,[d]:u}}}},exports.offset=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(n){var i,a;const{x:l,y:r,placement:s,middlewareData:c}=n,f=await async function(t,n){const{placement:i,platform:a,elements:l}=t,r=await(null==a.isRTL?void 0:a.isRTL(l.floating)),s=e.getSide(i),c=e.getAlignment(i),f="y"===e.getSideAxis(i),m=o.has(s)?-1:1,g=r&&f?-1:1,d=e.evaluate(n,t);let{mainAxis:p,crossAxis:x,alignmentAxis:u}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&"number"==typeof u&&(x="end"===c?-1*u:u),f?{x:x*g,y:p*m}:{x:p*m,y:x*g}}(n,t);return s===(null==(i=c.offset)?void 0:i.placement)&&null!=(a=c.arrow)&&a.alignmentOffset?{}:{x:l+f.x,y:r+f.y,data:{...f,placement:s}}}}},exports.shift=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(i){const{x:a,y:o,placement:l}=i,{mainAxis:r=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...f}=e.evaluate(t,i),m={x:a,y:o},g=await n(i,f),d=e.getSideAxis(e.getSide(l)),p=e.getOppositeAxis(d);let x=m[p],u=m[d];if(r){const t="y"===p?"bottom":"right",n=x+g["y"===p?"top":"left"],i=x-g[t];x=e.clamp(n,x,i)}if(s){const t="y"===d?"bottom":"right",n=u+g["y"===d?"top":"left"],i=u-g[t];u=e.clamp(n,u,i)}const y=c.fn({...i,[p]:x,[d]:u});return{...y,data:{x:y.x-a,y:y.y-o,enabled:{[p]:r,[d]:s}}}}}},exports.size=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(i){var a,o;const{placement:l,rects:r,platform:s,elements:c}=i,{apply:f=()=>{},...m}=e.evaluate(t,i),g=await n(i,m),d=e.getSide(l),p=e.getAlignment(l),x="y"===e.getSideAxis(l),{width:u,height:y}=r.floating;let h,w;"top"===d||"bottom"===d?(h=d,w=p===(await(null==s.isRTL?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(w=d,h="end"===p?"top":"bottom");const v=y-g.top-g.bottom,A=u-g.left-g.right,b=e.min(y-g[h],v),S=e.min(u-g[w],A),R=!i.middlewareData.shift;let O=b,P=S;if(null!=(a=i.middlewareData.shift)&&a.enabled.x&&(P=A),null!=(o=i.middlewareData.shift)&&o.enabled.y&&(O=v),R&&!p){const t=e.max(g.left,0),n=e.max(g.right,0),i=e.max(g.top,0),a=e.max(g.bottom,0);x?P=u-2*(0!==t||0!==n?t+n:e.max(g.left,g.right)):O=y-2*(0!==i||0!==a?i+a:e.max(g.top,g.bottom))}await f({...i,availableWidth:P,availableHeight:O});const T=await s.getDimensions(c.floating);return u!==T.width||y!==T.height?{reset:{rects:!0}}:{}}}};
|