@adam-milo/ui 1.0.24 → 1.0.25
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 +36 -12
- package/dist/index19.cjs +1 -0
- package/dist/index19.js +14 -0
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +1 -1
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +20 -299
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +298 -13
- package/dist/index23.cjs +1 -0
- package/dist/index23.js +16 -0
- package/dist/{index25.cjs → index26.cjs} +1 -1
- package/dist/{index25.js → index26.js} +21 -21
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +2 -2
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +18 -3
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +3 -67
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +6 -34
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +64 -58
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +35 -6
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +53 -201
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +6 -25
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +190 -186
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +24 -9
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +193 -278
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +11 -15
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +287 -37
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +14 -85
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +38 -9
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +80 -62
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +11 -3
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +66 -9
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +3 -31
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +12 -120
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +30 -7
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +118 -13
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +2 -2
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +7 -293
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +14 -22
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +291 -33
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +22 -622
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +35 -35
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +620 -33
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +37 -5
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +36 -8
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +5 -3
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +8 -33
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +3 -178
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +31 -17
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +165 -706
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +16 -149
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +697 -149
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +146 -80
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +170 -44
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +44 -10
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +11 -17
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +14 -97
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +99 -8
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +82 -23
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +9 -14
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +25 -44
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +33 -5
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +12 -33
- package/dist/index86.cjs +1 -0
- package/dist/index86.js +48 -0
- package/dist/index87.cjs +1 -0
- package/dist/index87.js +9 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +2 -2
- package/dist/src/components/layout/container/Container.component.d.ts +26 -0
- package/dist/src/components/layout/container/Container.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/index20.cjs +0 -1
- package/dist/index20.js +0 -22
- package/dist/index36.cjs +0 -1
- package/dist/index36.js +0 -21
- package/dist/index39.cjs +0 -1
- package/dist/index39.js +0 -11
- /package/dist/{index33.cjs → index34.cjs} +0 -0
- /package/dist/{index33.js → index34.js} +0 -0
package/dist/index75.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=Math.min,e=Math.max,o=Math.round,n=Math.floor,r={left:"right",right:"left",bottom:"top",top:"bottom"},i={start:"end",end:"start"};function s(t){return t.split("-")[0]}function p(t){return t.split("-")[1]}function c(t){return"x"===t?"y":"x"}function u(t){return"y"===t?"height":"width"}const x=new Set(["top","bottom"]);function a(t){return x.has(s(t))?"y":"x"}function g(t){return c(a(t))}function f(t){return t.replace(/start|end/g,t=>i[t])}const l=["left","right"],m=["right","left"],h=["top","bottom"],d=["bottom","top"];function b(t){return t.replace(/left|right|bottom|top/g,t=>r[t])}function y(t){return{top:0,right:0,bottom:0,left:0,...t}}exports.clamp=function(o,n,r){return e(o,t(n,r))},exports.createCoords=t=>({x:t,y:t}),exports.evaluate=function(t,e){return"function"==typeof t?t(e):t},exports.expandPaddingObject=y,exports.floor=n,exports.getAlignment=p,exports.getAlignmentAxis=g,exports.getAlignmentSides=function(t,e,o){void 0===o&&(o=!1);const n=p(t),r=g(t),i=u(r);let s="x"===r?n===(o?"end":"start")?"right":"left":"start"===n?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=b(s)),[s,b(s)]},exports.getAxisLength=u,exports.getExpandedPlacements=function(t){const e=b(t);return[f(t),e,f(e)]},exports.getOppositeAlignmentPlacement=f,exports.getOppositeAxis=c,exports.getOppositeAxisPlacements=function(t,e,o,n){const r=p(t);let i=function(t,e,o){switch(t){case"top":case"bottom":return o?e?m:l:e?l:m;case"left":case"right":return e?h:d;default:return[]}}(s(t),"start"===o,n);return r&&(i=i.map(t=>t+"-"+r),e&&(i=i.concat(i.map(f)))),i},exports.getOppositePlacement=b,exports.getPaddingObject=function(t){return"number"!=typeof t?y(t):{top:t,right:t,bottom:t,left:t}},exports.getSide=s,exports.getSideAxis=a,exports.max=e,exports.min=t,exports.rectToClientRect=function(t){const{x:e,y:o,width:n,height:r}=t;return{width:n,height:r,top:o,left:e,right:e+n,bottom:o+r,x:e,y:o}},exports.round=o,exports.sides=["top","right","bottom","left"];
|
package/dist/index75.js
CHANGED
|
@@ -1,88 +1,154 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const sides = ["top", "right", "bottom", "left"];
|
|
2
|
+
const min = Math.min;
|
|
3
|
+
const max = Math.max;
|
|
4
|
+
const round = Math.round;
|
|
5
|
+
const floor = Math.floor;
|
|
6
|
+
const createCoords = (v) => ({
|
|
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;
|
|
48
|
+
}
|
|
49
|
+
const alignment = getAlignment(placement);
|
|
50
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
51
|
+
const length = getAxisLength(alignmentAxis);
|
|
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);
|
|
55
|
+
}
|
|
56
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
57
|
+
}
|
|
58
|
+
function getExpandedPlacements(placement) {
|
|
59
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
60
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
61
|
+
}
|
|
62
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
63
|
+
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
|
|
4
64
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 [];
|
|
8
80
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return buffer[buffer.length - 1];
|
|
18
|
-
}
|
|
19
|
-
return defaults;
|
|
20
|
-
},
|
|
21
|
-
useMedium: function(data) {
|
|
22
|
-
var item = middleware(data, assigned);
|
|
23
|
-
buffer.push(item);
|
|
24
|
-
return function() {
|
|
25
|
-
buffer = buffer.filter(function(x) {
|
|
26
|
-
return x !== item;
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
},
|
|
30
|
-
assignSyncMedium: function(cb) {
|
|
31
|
-
assigned = true;
|
|
32
|
-
while (buffer.length) {
|
|
33
|
-
var cbs = buffer;
|
|
34
|
-
buffer = [];
|
|
35
|
-
cbs.forEach(cb);
|
|
36
|
-
}
|
|
37
|
-
buffer = {
|
|
38
|
-
push: function(x) {
|
|
39
|
-
return cb(x);
|
|
40
|
-
},
|
|
41
|
-
filter: function() {
|
|
42
|
-
return buffer;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
|
-
assignMedium: function(cb) {
|
|
47
|
-
assigned = true;
|
|
48
|
-
var pendingQueue = [];
|
|
49
|
-
if (buffer.length) {
|
|
50
|
-
var cbs = buffer;
|
|
51
|
-
buffer = [];
|
|
52
|
-
cbs.forEach(cb);
|
|
53
|
-
pendingQueue = buffer;
|
|
54
|
-
}
|
|
55
|
-
var executeQueue = function() {
|
|
56
|
-
var cbs2 = pendingQueue;
|
|
57
|
-
pendingQueue = [];
|
|
58
|
-
cbs2.forEach(cb);
|
|
59
|
-
};
|
|
60
|
-
var cycle = function() {
|
|
61
|
-
return Promise.resolve().then(executeQueue);
|
|
62
|
-
};
|
|
63
|
-
cycle();
|
|
64
|
-
buffer = {
|
|
65
|
-
push: function(x) {
|
|
66
|
-
pendingQueue.push(x);
|
|
67
|
-
cycle();
|
|
68
|
-
},
|
|
69
|
-
filter: function(filter) {
|
|
70
|
-
pendingQueue = pendingQueue.filter(filter);
|
|
71
|
-
return buffer;
|
|
72
|
-
}
|
|
73
|
-
};
|
|
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));
|
|
74
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
|
|
75
103
|
};
|
|
76
|
-
return medium;
|
|
77
104
|
}
|
|
78
|
-
function
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
+
};
|
|
85
130
|
}
|
|
86
131
|
export {
|
|
87
|
-
|
|
132
|
+
clamp,
|
|
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
|
|
88
154
|
};
|
package/dist/index76.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";function e(){return"undefined"!=typeof window}function t(e){return r(e)?(e.nodeName||"").toLowerCase():"#document"}function n(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function o(e){var t;return null==(t=(r(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function r(t){return!!e()&&(t instanceof Node||t instanceof n(t).Node)}function s(t){return!!e()&&(t instanceof Element||t instanceof n(t).Element)}function c(t){return!!e()&&(t instanceof HTMLElement||t instanceof n(t).HTMLElement)}function i(t){return!(!e()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof n(t).ShadowRoot)}Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=new Set(["inline","contents"]);function u(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=g(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!l.has(r)}const a=new Set(["table","td","th"]);const f=[":popover-open",":modal"];function p(e){return f.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const d=["transform","translate","scale","rotate","perspective"],m=["transform","translate","scale","rotate","perspective","filter"],w=["paint","layout","strict","content"];function v(e){const t=x(),n=s(e)?g(e):e;return d.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||m.some(e=>(n.willChange||"").includes(e))||w.some(e=>(n.contain||"").includes(e))}function x(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const y=new Set(["html","body","#document"]);function S(e){return y.has(t(e))}function g(e){return n(e).getComputedStyle(e)}function h(e){if("html"===t(e))return e;const n=e.assignedSlot||e.parentNode||i(e)&&e.host||o(e);return i(n)?n.host:n}function b(e){const t=h(e);return S(t)?e.ownerDocument?e.ownerDocument.body:e.body:c(t)&&u(t)?t:b(t)}function E(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}exports.getComputedStyle=g,exports.getContainingBlock=function(e){let t=h(e);for(;c(t)&&!S(t);){if(v(t))return t;if(p(t))return null;t=h(t)}return null},exports.getDocumentElement=o,exports.getFrameElement=E,exports.getNearestOverflowAncestor=b,exports.getNodeName=t,exports.getNodeScroll=function(e){return s(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}},exports.getOverflowAncestors=function e(t,o,r){var s;void 0===o&&(o=[]),void 0===r&&(r=!0);const c=b(t),i=c===(null==(s=t.ownerDocument)?void 0:s.body),l=n(c);if(i){const t=E(l);return o.concat(l,l.visualViewport||[],u(c)?c:[],t&&r?e(t):[])}return o.concat(c,e(c,[],r))},exports.getParentNode=h,exports.getWindow=n,exports.isContainingBlock=v,exports.isElement=s,exports.isHTMLElement=c,exports.isLastTraversableNode=S,exports.isNode=r,exports.isOverflowElement=u,exports.isShadowRoot=i,exports.isTableElement=function(e){return a.has(t(e))},exports.isTopLayer=p,exports.isWebKit=x;
|
package/dist/index76.js
CHANGED
|
@@ -1,47 +1,173 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
function hasWindow() {
|
|
2
|
+
return typeof window !== "undefined";
|
|
3
|
+
}
|
|
4
|
+
function getNodeName(node) {
|
|
5
|
+
if (isNode(node)) {
|
|
6
|
+
return (node.nodeName || "").toLowerCase();
|
|
7
|
+
}
|
|
8
|
+
return "#document";
|
|
9
|
+
}
|
|
10
|
+
function getWindow(node) {
|
|
11
|
+
var _node$ownerDocument;
|
|
12
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
13
|
+
}
|
|
14
|
+
function getDocumentElement(node) {
|
|
15
|
+
var _ref;
|
|
16
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
17
|
+
}
|
|
18
|
+
function isNode(value) {
|
|
19
|
+
if (!hasWindow()) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
23
|
+
}
|
|
24
|
+
function isElement(value) {
|
|
25
|
+
if (!hasWindow()) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
29
|
+
}
|
|
30
|
+
function isHTMLElement(value) {
|
|
31
|
+
if (!hasWindow()) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
35
|
+
}
|
|
36
|
+
function isShadowRoot(value) {
|
|
37
|
+
if (!hasWindow() || typeof ShadowRoot === "undefined") {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
41
|
+
}
|
|
42
|
+
const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
43
|
+
function isOverflowElement(element) {
|
|
44
|
+
const {
|
|
45
|
+
overflow,
|
|
46
|
+
overflowX,
|
|
47
|
+
overflowY,
|
|
48
|
+
display
|
|
49
|
+
} = getComputedStyle(element);
|
|
50
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
|
|
51
|
+
}
|
|
52
|
+
const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
53
|
+
function isTableElement(element) {
|
|
54
|
+
return tableElements.has(getNodeName(element));
|
|
55
|
+
}
|
|
56
|
+
const topLayerSelectors = [":popover-open", ":modal"];
|
|
57
|
+
function isTopLayer(element) {
|
|
58
|
+
return topLayerSelectors.some((selector) => {
|
|
59
|
+
try {
|
|
60
|
+
return element.matches(selector);
|
|
61
|
+
} catch (_e) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
|
|
67
|
+
const willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
|
|
68
|
+
const containValues = ["paint", "layout", "strict", "content"];
|
|
69
|
+
function isContainingBlock(elementOrCss) {
|
|
70
|
+
const webkit = isWebKit();
|
|
71
|
+
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
72
|
+
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));
|
|
73
|
+
}
|
|
74
|
+
function getContainingBlock(element) {
|
|
75
|
+
let currentNode = getParentNode(element);
|
|
76
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
77
|
+
if (isContainingBlock(currentNode)) {
|
|
78
|
+
return currentNode;
|
|
79
|
+
} else if (isTopLayer(currentNode)) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
currentNode = getParentNode(currentNode);
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
function isWebKit() {
|
|
87
|
+
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
|
88
|
+
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
89
|
+
}
|
|
90
|
+
const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
91
|
+
function isLastTraversableNode(node) {
|
|
92
|
+
return lastTraversableNodeNames.has(getNodeName(node));
|
|
93
|
+
}
|
|
94
|
+
function getComputedStyle(element) {
|
|
95
|
+
return getWindow(element).getComputedStyle(element);
|
|
96
|
+
}
|
|
97
|
+
function getNodeScroll(element) {
|
|
98
|
+
if (isElement(element)) {
|
|
99
|
+
return {
|
|
100
|
+
scrollLeft: element.scrollLeft,
|
|
101
|
+
scrollTop: element.scrollTop
|
|
32
102
|
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
scrollLeft: element.scrollX,
|
|
106
|
+
scrollTop: element.scrollY
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function getParentNode(node) {
|
|
110
|
+
if (getNodeName(node) === "html") {
|
|
111
|
+
return node;
|
|
112
|
+
}
|
|
113
|
+
const result = (
|
|
114
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
115
|
+
node.assignedSlot || // DOM Element detected.
|
|
116
|
+
node.parentNode || // ShadowRoot detected.
|
|
117
|
+
isShadowRoot(node) && node.host || // Fallback.
|
|
118
|
+
getDocumentElement(node)
|
|
119
|
+
);
|
|
120
|
+
return isShadowRoot(result) ? result.host : result;
|
|
121
|
+
}
|
|
122
|
+
function getNearestOverflowAncestor(node) {
|
|
123
|
+
const parentNode = getParentNode(node);
|
|
124
|
+
if (isLastTraversableNode(parentNode)) {
|
|
125
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
126
|
+
}
|
|
127
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
128
|
+
return parentNode;
|
|
129
|
+
}
|
|
130
|
+
return getNearestOverflowAncestor(parentNode);
|
|
131
|
+
}
|
|
132
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
133
|
+
var _node$ownerDocument2;
|
|
134
|
+
if (list === void 0) {
|
|
135
|
+
list = [];
|
|
136
|
+
}
|
|
137
|
+
if (traverseIframes === void 0) {
|
|
138
|
+
traverseIframes = true;
|
|
139
|
+
}
|
|
140
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
141
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
142
|
+
const win = getWindow(scrollableAncestor);
|
|
143
|
+
if (isBody) {
|
|
144
|
+
const frameElement = getFrameElement(win);
|
|
145
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
146
|
+
}
|
|
147
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
148
|
+
}
|
|
149
|
+
function getFrameElement(win) {
|
|
150
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
151
|
+
}
|
|
43
152
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
153
|
+
getComputedStyle,
|
|
154
|
+
getContainingBlock,
|
|
155
|
+
getDocumentElement,
|
|
156
|
+
getFrameElement,
|
|
157
|
+
getNearestOverflowAncestor,
|
|
158
|
+
getNodeName,
|
|
159
|
+
getNodeScroll,
|
|
160
|
+
getOverflowAncestors,
|
|
161
|
+
getParentNode,
|
|
162
|
+
getWindow,
|
|
163
|
+
isContainingBlock,
|
|
164
|
+
isElement,
|
|
165
|
+
isHTMLElement,
|
|
166
|
+
isLastTraversableNode,
|
|
167
|
+
isNode,
|
|
168
|
+
isOverflowElement,
|
|
169
|
+
isShadowRoot,
|
|
170
|
+
isTableElement,
|
|
171
|
+
isTopLayer,
|
|
172
|
+
isWebKit
|
|
47
173
|
};
|
package/dist/index77.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),n=require("./index78.cjs"),e=require("./index69.cjs"),o=require("./index84.cjs");function c(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const e in t)if("default"!==e){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:()=>t[e]})}return n.default=t,Object.freeze(n)}const r=c(t);var a=n.styleSingleton(),i="data-scroll-locked",l=function(t,n,o,c){var r=t.left,a=t.top,l=t.right,d=t.gap;return void 0===o&&(o="margin"),"\n .".concat(e.noScrollbarsClassName," {\n overflow: hidden ").concat(c,";\n padding-right: ").concat(d,"px ").concat(c,";\n }\n body[").concat(i,"] {\n overflow: hidden ").concat(c,";\n overscroll-behavior: contain;\n ").concat([n&&"position: relative ".concat(c,";"),"margin"===o&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(l,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(d,"px ").concat(c,";\n "),"padding"===o&&"padding-right: ".concat(d,"px ").concat(c,";")].filter(Boolean).join(""),"\n }\n \n .").concat(e.zeroRightClassName," {\n right: ").concat(d,"px ").concat(c,";\n }\n \n .").concat(e.fullWidthClassName," {\n margin-right: ").concat(d,"px ").concat(c,";\n }\n \n .").concat(e.zeroRightClassName," .").concat(e.zeroRightClassName," {\n right: 0 ").concat(c,";\n }\n \n .").concat(e.fullWidthClassName," .").concat(e.fullWidthClassName," {\n margin-right: 0 ").concat(c,";\n }\n \n body[").concat(i,"] {\n ").concat(e.removedBarSizeVariable,": ").concat(d,"px;\n }\n")},d=function(){var t=parseInt(document.body.getAttribute(i)||"0",10);return isFinite(t)?t:0},s=function(){r.useEffect(function(){return document.body.setAttribute(i,(d()+1).toString()),function(){var t=d()-1;t<=0?document.body.removeAttribute(i):document.body.setAttribute(i,t.toString())}},[])};exports.RemoveScrollBar=function(t){var n=t.noRelative,e=t.noImportant,c=t.gapMode,i=void 0===c?"margin":c;s();var d=r.useMemo(function(){return o.getGapWidth(i)},[i]);return r.createElement(a,{styles:l(d,!n,i,e?"":"!important")})},exports.lockAttribute=i,exports.useLockAttribute=s;
|
package/dist/index77.js
CHANGED
|
@@ -1,13 +1,47 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { styleSingleton } from "./index78.js";
|
|
3
|
+
import { noScrollbarsClassName, zeroRightClassName, fullWidthClassName, removedBarSizeVariable } from "./index69.js";
|
|
4
|
+
import { getGapWidth } from "./index84.js";
|
|
5
|
+
var Style = styleSingleton();
|
|
6
|
+
var lockAttribute = "data-scroll-locked";
|
|
7
|
+
var getStyles = function(_a, allowRelative, gapMode, important) {
|
|
8
|
+
var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
|
|
9
|
+
if (gapMode === void 0) {
|
|
10
|
+
gapMode = "margin";
|
|
11
|
+
}
|
|
12
|
+
return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
|
|
13
|
+
allowRelative && "position: relative ".concat(important, ";"),
|
|
14
|
+
gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
|
|
15
|
+
gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
|
|
16
|
+
].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
|
|
17
|
+
};
|
|
18
|
+
var getCurrentUseCounter = function() {
|
|
19
|
+
var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
|
|
20
|
+
return isFinite(counter) ? counter : 0;
|
|
21
|
+
};
|
|
22
|
+
var useLockAttribute = function() {
|
|
23
|
+
React.useEffect(function() {
|
|
24
|
+
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
25
|
+
return function() {
|
|
26
|
+
var newCounter = getCurrentUseCounter() - 1;
|
|
27
|
+
if (newCounter <= 0) {
|
|
28
|
+
document.body.removeAttribute(lockAttribute);
|
|
29
|
+
} else {
|
|
30
|
+
document.body.setAttribute(lockAttribute, newCounter.toString());
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
34
|
+
};
|
|
35
|
+
var RemoveScrollBar = function(_a) {
|
|
36
|
+
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
37
|
+
useLockAttribute();
|
|
38
|
+
var gap = React.useMemo(function() {
|
|
39
|
+
return getGapWidth(gapMode);
|
|
40
|
+
}, [gapMode]);
|
|
41
|
+
return React.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
10
42
|
};
|
|
11
43
|
export {
|
|
12
|
-
|
|
44
|
+
RemoveScrollBar,
|
|
45
|
+
lockAttribute,
|
|
46
|
+
useLockAttribute
|
|
13
47
|
};
|
package/dist/index78.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index85.cjs");exports.styleSingleton=function(){var t=e.styleHookSingleton();return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}};
|
package/dist/index78.js
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
window.removeEventListener("test", options, options);
|
|
12
|
-
} catch (err) {
|
|
13
|
-
passiveSupported = false;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
1
|
+
import { styleHookSingleton } from "./index85.js";
|
|
2
|
+
var styleSingleton = function() {
|
|
3
|
+
var useStyle = styleHookSingleton();
|
|
4
|
+
var Sheet = function(_a) {
|
|
5
|
+
var styles = _a.styles, dynamic = _a.dynamic;
|
|
6
|
+
useStyle(styles, dynamic);
|
|
7
|
+
return null;
|
|
8
|
+
};
|
|
9
|
+
return Sheet;
|
|
10
|
+
};
|
|
17
11
|
export {
|
|
18
|
-
|
|
12
|
+
styleSingleton
|
|
19
13
|
};
|
package/dist/index79.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=!1;if("undefined"!=typeof window)try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(r){e=!1}var n=!!e&&{passive:!1};exports.nonPassive=n;
|