@okam/stack-ui 1.35.1 → 1.35.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.
Files changed (195) hide show
  1. package/components/fields/SearchField/interface.d.ts +1 -0
  2. package/index.d.ts +1 -0
  3. package/index103.js +1 -1
  4. package/index103.mjs +1 -1
  5. package/index105.js +1 -1
  6. package/index105.mjs +1 -1
  7. package/index106.js +1 -1
  8. package/index106.mjs +3 -3
  9. package/index107.js +1 -1
  10. package/index107.mjs +1 -1
  11. package/index112.js +1 -1
  12. package/index112.mjs +1 -1
  13. package/index115.js +1 -1
  14. package/index115.mjs +1 -1
  15. package/index122.js +1 -1
  16. package/index122.mjs +1 -1
  17. package/index123.js +1 -1
  18. package/index123.mjs +4 -4
  19. package/index124.js +1 -1
  20. package/index124.mjs +2 -2
  21. package/index139.js +1 -1
  22. package/index139.mjs +46 -12
  23. package/index140.js +1 -1
  24. package/index140.mjs +240 -11
  25. package/index141.js +2 -1
  26. package/index141.mjs +13 -57
  27. package/index142.js +1 -1
  28. package/index142.mjs +30 -46
  29. package/index143.js +1 -1
  30. package/index143.mjs +12 -241
  31. package/index144.js +1 -2
  32. package/index144.mjs +57 -13
  33. package/index145.js +1 -1
  34. package/index145.mjs +12 -30
  35. package/index167.js +1 -1
  36. package/index167.mjs +1 -1
  37. package/index18.js +1 -1
  38. package/index18.mjs +22 -22
  39. package/index195.js +1 -1
  40. package/index195.mjs +197 -134
  41. package/index196.js +1 -1
  42. package/index196.mjs +61 -194
  43. package/index197.js +1 -1
  44. package/index197.mjs +142 -21
  45. package/index198.js +1 -1
  46. package/index198.mjs +120 -45
  47. package/index199.js +1 -1
  48. package/index199.mjs +222 -46
  49. package/index200.js +1 -1
  50. package/index200.mjs +187 -94
  51. package/index201.js +1 -1
  52. package/index201.mjs +70 -72
  53. package/index202.js +1 -1
  54. package/index202.mjs +272 -61
  55. package/index203.js +1 -1
  56. package/index203.mjs +98 -7
  57. package/index204.js +1 -1
  58. package/index204.mjs +187 -10
  59. package/index205.js +1 -1
  60. package/index205.mjs +73 -192
  61. package/index206.js +1 -1
  62. package/index206.mjs +51 -57
  63. package/index207.js +1 -1
  64. package/index207.mjs +118 -135
  65. package/index208.js +1 -1
  66. package/index208.mjs +107 -115
  67. package/index209.js +1 -1
  68. package/index209.mjs +110 -212
  69. package/index210.js +1 -1
  70. package/index210.mjs +64 -182
  71. package/index211.js +1 -1
  72. package/index211.mjs +108 -67
  73. package/index212.js +1 -1
  74. package/index212.mjs +49 -276
  75. package/index213.js +1 -1
  76. package/index213.mjs +86 -91
  77. package/index214.js +1 -1
  78. package/index214.mjs +64 -182
  79. package/index215.js +1 -1
  80. package/index215.mjs +51 -79
  81. package/index216.js +1 -1
  82. package/index216.mjs +94 -53
  83. package/index217.js +5 -1
  84. package/index217.mjs +76 -122
  85. package/index218.js +1 -1
  86. package/index218.mjs +2014 -105
  87. package/index219.js +1 -1
  88. package/index219.mjs +57 -120
  89. package/index220.js +1 -1
  90. package/index220.mjs +186 -70
  91. package/index221.js +1 -1
  92. package/index221.mjs +137 -107
  93. package/index222.js +1 -1
  94. package/index222.mjs +197 -52
  95. package/index223.js +1 -1
  96. package/index223.mjs +22 -93
  97. package/index224.js +1 -1
  98. package/index224.mjs +46 -67
  99. package/index225.js +1 -1
  100. package/index225.mjs +47 -55
  101. package/index226.js +1 -1
  102. package/index226.mjs +96 -98
  103. package/index227.js +1 -5
  104. package/index227.mjs +72 -81
  105. package/index228.js +1 -1
  106. package/index228.mjs +58 -2015
  107. package/index229.js +1 -1
  108. package/index229.mjs +7 -59
  109. package/index230.js +1 -1
  110. package/index230.mjs +10 -187
  111. package/index233.js +1 -1
  112. package/index233.mjs +130 -4
  113. package/index234.js +1 -1
  114. package/index234.mjs +191 -5
  115. package/index235.js +1 -1
  116. package/index235.mjs +10 -5
  117. package/index236.js +1 -1
  118. package/index236.mjs +4 -5
  119. package/index237.js +1 -1
  120. package/index237.mjs +37 -5
  121. package/index238.js +1 -1
  122. package/index238.mjs +6 -5
  123. package/index239.js +1 -1
  124. package/index239.mjs +30 -5
  125. package/index240.js +1 -1
  126. package/index240.mjs +7 -5
  127. package/index241.js +1 -1
  128. package/index241.mjs +4 -4
  129. package/index242.js +1 -1
  130. package/index242.mjs +4 -4
  131. package/index243.js +1 -1
  132. package/index243.mjs +1 -1
  133. package/index244.js +1 -1
  134. package/index244.mjs +4 -4
  135. package/index245.js +1 -1
  136. package/index245.mjs +4 -4
  137. package/index246.js +1 -1
  138. package/index246.mjs +4 -4
  139. package/index247.js +1 -1
  140. package/index247.mjs +1 -1
  141. package/index248.js +1 -1
  142. package/index248.mjs +4 -4
  143. package/index249.js +1 -1
  144. package/index249.mjs +4 -4
  145. package/index250.js +1 -1
  146. package/index250.mjs +4 -4
  147. package/index251.js +1 -1
  148. package/index251.mjs +1 -1
  149. package/index252.js +1 -1
  150. package/index252.mjs +4 -4
  151. package/index253.js +1 -1
  152. package/index253.mjs +4 -4
  153. package/index254.js +1 -1
  154. package/index254.mjs +4 -4
  155. package/index255.js +1 -1
  156. package/index255.mjs +4 -4
  157. package/index256.js +1 -1
  158. package/index256.mjs +4 -4
  159. package/index257.js +1 -1
  160. package/index257.mjs +4 -4
  161. package/index258.js +1 -1
  162. package/index258.mjs +4 -4
  163. package/index259.js +1 -1
  164. package/index259.mjs +4 -4
  165. package/index260.js +1 -1
  166. package/index260.mjs +1 -1
  167. package/index261.js +1 -1
  168. package/index261.mjs +4 -4
  169. package/index262.js +1 -1
  170. package/index262.mjs +4 -4
  171. package/index263.js +1 -1
  172. package/index263.mjs +1 -1
  173. package/index264.js +1 -1
  174. package/index264.mjs +4 -4
  175. package/index265.js +1 -1
  176. package/index265.mjs +4 -4
  177. package/index266.js +1 -1
  178. package/index266.mjs +4 -4
  179. package/index267.js +1 -1
  180. package/index267.mjs +4 -130
  181. package/index268.js +1 -1
  182. package/index268.mjs +5 -191
  183. package/index269.js +1 -1
  184. package/index269.mjs +5 -10
  185. package/index270.js +1 -1
  186. package/index270.mjs +5 -4
  187. package/index271.js +1 -1
  188. package/index271.mjs +5 -37
  189. package/index272.js +1 -1
  190. package/index272.mjs +5 -6
  191. package/index273.js +1 -1
  192. package/index273.mjs +5 -30
  193. package/index274.js +1 -1
  194. package/index274.mjs +5 -7
  195. package/package.json +2 -28
package/index195.mjs CHANGED
@@ -1,143 +1,206 @@
1
- import { calculatePosition as D } from "./index196.mjs";
2
- import { useCloseOnScroll as G } from "./index197.mjs";
3
- import { useState as J, useRef as U, useEffect as K, useCallback as j } from "react";
4
- import { useLayoutEffect as z } from "./index153.mjs";
5
- import { useResizeObserver as k } from "./index168.mjs";
6
- import { useLocale as M } from "@react-aria/i18n";
7
- let e = typeof document < "u" ? window.visualViewport : null;
8
- function te(n) {
9
- let { direction: y } = M(), { arrowSize: w = 0, targetRef: c, overlayRef: i, scrollRef: s = i, placement: H = "bottom", containerPadding: P = 12, shouldFlip: L = !0, boundaryElement: $ = typeof document < "u" ? document.body : null, offset: C = 0, crossOffset: B = 0, shouldUpdatePosition: S = !0, isOpen: v = !0, onClose: p, maxHeight: b, arrowBoundaryOffset: T = 0 } = n, [t, I] = J(null), F = [
10
- S,
11
- H,
12
- i.current,
13
- c.current,
14
- s.current,
15
- P,
16
- L,
17
- $,
18
- C,
19
- B,
20
- v,
21
- y,
22
- b,
23
- T,
24
- w
25
- ], N = U(e == null ? void 0 : e.scale);
26
- K(() => {
27
- v && (N.current = e == null ? void 0 : e.scale);
28
- }, [
29
- v
30
- ]);
31
- let a = j(() => {
32
- if (S === !1 || !v || !i.current || !c.current || !$ || (e == null ? void 0 : e.scale) !== N.current) return;
33
- let o = null;
34
- if (s.current && s.current.contains(document.activeElement)) {
35
- var d;
36
- let r = (d = document.activeElement) === null || d === void 0 ? void 0 : d.getBoundingClientRect(), g = s.current.getBoundingClientRect();
37
- var u;
38
- if (o = {
39
- type: "top",
40
- offset: ((u = r == null ? void 0 : r.top) !== null && u !== void 0 ? u : 0) - g.top
41
- }, o.offset > g.height / 2) {
42
- o.type = "bottom";
43
- var R;
44
- o.offset = ((R = r == null ? void 0 : r.bottom) !== null && R !== void 0 ? R : 0) - g.bottom;
45
- }
46
- }
47
- let l = i.current;
48
- if (!b && i.current) {
49
- var O;
50
- l.style.top = "0px", l.style.bottom = "";
51
- var E;
52
- l.style.maxHeight = ((E = (O = window.visualViewport) === null || O === void 0 ? void 0 : O.height) !== null && E !== void 0 ? E : window.innerHeight) + "px";
1
+ import { g as q } from "./index233.mjs";
2
+ import { s as J, e as K, c as I } from "./index234.mjs";
3
+ function X(U) {
4
+ let {
5
+ swiper: e,
6
+ extendParams: z,
7
+ on: M,
8
+ emit: T
9
+ } = U;
10
+ z({
11
+ virtual: {
12
+ enabled: !1,
13
+ slides: [],
14
+ cache: !0,
15
+ renderSlide: null,
16
+ renderExternal: null,
17
+ renderExternalUpdate: !0,
18
+ addSlidesBefore: 0,
19
+ addSlidesAfter: 0
53
20
  }
54
- let f = D({
55
- placement: W(H, y),
56
- overlayNode: i.current,
57
- targetNode: c.current,
58
- scrollNode: s.current || i.current,
59
- padding: P,
60
- shouldFlip: L,
61
- boundaryElement: $,
62
- offset: C,
63
- crossOffset: B,
64
- maxHeight: b,
65
- arrowSize: w,
66
- arrowBoundaryOffset: T
21
+ });
22
+ let C;
23
+ const B = q();
24
+ e.virtual = {
25
+ cache: {},
26
+ from: void 0,
27
+ to: void 0,
28
+ slides: [],
29
+ offset: 0,
30
+ slidesGrid: []
31
+ };
32
+ const $ = B.createElement("div");
33
+ function G(i, a) {
34
+ const r = e.params.virtual;
35
+ if (r.cache && e.virtual.cache[a])
36
+ return e.virtual.cache[a];
37
+ let s;
38
+ return r.renderSlide ? (s = r.renderSlide.call(e, i, a), typeof s == "string" && ($.innerHTML = s, s = $.children[0])) : e.isElement ? s = I("swiper-slide") : s = I("div", e.params.slideClass), s.setAttribute("data-swiper-slide-index", a), r.renderSlide || (s.innerHTML = i), r.cache && (e.virtual.cache[a] = s), s;
39
+ }
40
+ function o(i, a) {
41
+ const {
42
+ slidesPerView: r,
43
+ slidesPerGroup: s,
44
+ centeredSlides: d,
45
+ loop: n,
46
+ initialSlide: w
47
+ } = e.params;
48
+ if (a && !n && w > 0)
49
+ return;
50
+ const {
51
+ addSlidesBefore: m,
52
+ addSlidesAfter: g
53
+ } = e.params.virtual, {
54
+ from: P,
55
+ to: E,
56
+ slides: c,
57
+ slidesGrid: F,
58
+ offset: N
59
+ } = e.virtual;
60
+ e.params.cssMode || e.updateActiveIndex();
61
+ const b = e.activeIndex || 0;
62
+ let A;
63
+ e.rtlTranslate ? A = "right" : A = e.isHorizontal() ? "left" : "top";
64
+ let x, f;
65
+ d ? (x = Math.floor(r / 2) + s + g, f = Math.floor(r / 2) + s + m) : (x = r + (s - 1) + g, f = (n ? r : s) + m);
66
+ let u = b - f, p = b + x;
67
+ n || (u = Math.max(u, 0), p = Math.min(p, c.length - 1));
68
+ let h = (e.slidesGrid[u] || 0) - (e.slidesGrid[0] || 0);
69
+ n && b >= f ? (u -= f, d || (h += e.slidesGrid[0])) : n && b < f && (u = -f, d && (h += e.slidesGrid[0])), Object.assign(e.virtual, {
70
+ from: u,
71
+ to: p,
72
+ offset: h,
73
+ slidesGrid: e.slidesGrid,
74
+ slidesBefore: f,
75
+ slidesAfter: x
67
76
  });
68
- if (f.position) {
69
- if (l.style.top = "", l.style.bottom = "", l.style.left = "", l.style.right = "", Object.keys(f.position).forEach((r) => l.style[r] = f.position[r] + "px"), l.style.maxHeight = f.maxHeight != null ? f.maxHeight + "px" : "", o && document.activeElement && s.current) {
70
- let r = document.activeElement.getBoundingClientRect(), g = s.current.getBoundingClientRect(), A = r[o.type] - g[o.type];
71
- s.current.scrollTop += A - o.offset;
72
- }
73
- I(f);
77
+ function j() {
78
+ e.updateSlides(), e.updateProgress(), e.updateSlidesClasses(), T("virtualUpdate");
74
79
  }
75
- }, F);
76
- z(a, F), Q(a), k({
77
- ref: i,
78
- onResize: a
79
- }), k({
80
- ref: c,
81
- onResize: a
82
- });
83
- let m = U(!1);
84
- z(() => {
85
- let o, d = () => {
86
- m.current = !0, clearTimeout(o), o = setTimeout(() => {
87
- m.current = !1;
88
- }, 500), a();
89
- }, u = () => {
90
- m.current && d();
91
- };
92
- return e == null || e.addEventListener("resize", d), e == null || e.addEventListener("scroll", u), () => {
93
- e == null || e.removeEventListener("resize", d), e == null || e.removeEventListener("scroll", u);
80
+ if (P === u && E === p && !i) {
81
+ e.slidesGrid !== F && h !== N && e.slides.forEach((t) => {
82
+ t.style[A] = `${h - Math.abs(e.cssOverflowAdjustment())}px`;
83
+ }), e.updateProgress(), T("virtualUpdate");
84
+ return;
85
+ }
86
+ if (e.params.virtual.renderExternal) {
87
+ e.params.virtual.renderExternal.call(e, {
88
+ offset: h,
89
+ from: u,
90
+ to: p,
91
+ slides: function() {
92
+ const l = [];
93
+ for (let v = u; v <= p; v += 1)
94
+ l.push(c[v]);
95
+ return l;
96
+ }()
97
+ }), e.params.virtual.renderExternalUpdate ? j() : T("virtualUpdate");
98
+ return;
99
+ }
100
+ const S = [], O = [], y = (t) => {
101
+ let l = t;
102
+ return t < 0 ? l = c.length + t : l >= c.length && (l = l - c.length), l;
94
103
  };
95
- }, [
96
- a
97
- ]);
98
- let q = j(() => {
99
- m.current || p == null || p();
100
- }, [
101
- p,
102
- m
103
- ]);
104
- G({
105
- triggerRef: c,
106
- isOpen: v,
107
- onClose: p && q
108
- });
109
- var h, x;
110
- return {
111
- overlayProps: {
112
- style: {
113
- position: "absolute",
114
- zIndex: 1e5,
115
- ...t == null ? void 0 : t.position,
116
- maxHeight: (h = t == null ? void 0 : t.maxHeight) !== null && h !== void 0 ? h : "100vh"
104
+ if (i)
105
+ e.slides.filter((t) => t.matches(`.${e.params.slideClass}, swiper-slide`)).forEach((t) => {
106
+ t.remove();
107
+ });
108
+ else
109
+ for (let t = P; t <= E; t += 1)
110
+ if (t < u || t > p) {
111
+ const l = y(t);
112
+ e.slides.filter((v) => v.matches(`.${e.params.slideClass}[data-swiper-slide-index="${l}"], swiper-slide[data-swiper-slide-index="${l}"]`)).forEach((v) => {
113
+ v.remove();
114
+ });
115
+ }
116
+ const R = n ? -c.length : 0, _ = n ? c.length * 2 : c.length;
117
+ for (let t = R; t < _; t += 1)
118
+ if (t >= u && t <= p) {
119
+ const l = y(t);
120
+ typeof E > "u" || i ? O.push(l) : (t > E && O.push(l), t < P && S.push(l));
117
121
  }
118
- },
119
- placement: (x = t == null ? void 0 : t.placement) !== null && x !== void 0 ? x : null,
120
- arrowProps: {
121
- "aria-hidden": "true",
122
- role: "presentation",
123
- style: {
124
- left: t == null ? void 0 : t.arrowOffsetLeft,
125
- top: t == null ? void 0 : t.arrowOffsetTop
122
+ if (O.forEach((t) => {
123
+ e.slidesEl.append(G(c[t], t));
124
+ }), n)
125
+ for (let t = S.length - 1; t >= 0; t -= 1) {
126
+ const l = S[t];
127
+ e.slidesEl.prepend(G(c[l], l));
126
128
  }
127
- },
128
- updatePosition: a
129
- };
130
- }
131
- function Q(n) {
132
- z(() => (window.addEventListener("resize", n, !1), () => {
133
- window.removeEventListener("resize", n, !1);
134
- }), [
135
- n
136
- ]);
137
- }
138
- function W(n, y) {
139
- return y === "rtl" ? n.replace("start", "right").replace("end", "left") : n.replace("start", "left").replace("end", "right");
129
+ else
130
+ S.sort((t, l) => l - t), S.forEach((t) => {
131
+ e.slidesEl.prepend(G(c[t], t));
132
+ });
133
+ K(e.slidesEl, ".swiper-slide, swiper-slide").forEach((t) => {
134
+ t.style[A] = `${h - Math.abs(e.cssOverflowAdjustment())}px`;
135
+ }), j();
136
+ }
137
+ function H(i) {
138
+ if (typeof i == "object" && "length" in i)
139
+ for (let a = 0; a < i.length; a += 1)
140
+ i[a] && e.virtual.slides.push(i[a]);
141
+ else
142
+ e.virtual.slides.push(i);
143
+ o(!0);
144
+ }
145
+ function L(i) {
146
+ const a = e.activeIndex;
147
+ let r = a + 1, s = 1;
148
+ if (Array.isArray(i)) {
149
+ for (let d = 0; d < i.length; d += 1)
150
+ i[d] && e.virtual.slides.unshift(i[d]);
151
+ r = a + i.length, s = i.length;
152
+ } else
153
+ e.virtual.slides.unshift(i);
154
+ if (e.params.virtual.cache) {
155
+ const d = e.virtual.cache, n = {};
156
+ Object.keys(d).forEach((w) => {
157
+ const m = d[w], g = m.getAttribute("data-swiper-slide-index");
158
+ g && m.setAttribute("data-swiper-slide-index", parseInt(g, 10) + s), n[parseInt(w, 10) + s] = m;
159
+ }), e.virtual.cache = n;
160
+ }
161
+ o(!0), e.slideTo(r, 0);
162
+ }
163
+ function V(i) {
164
+ if (typeof i > "u" || i === null) return;
165
+ let a = e.activeIndex;
166
+ if (Array.isArray(i))
167
+ for (let r = i.length - 1; r >= 0; r -= 1)
168
+ e.params.virtual.cache && (delete e.virtual.cache[i[r]], Object.keys(e.virtual.cache).forEach((s) => {
169
+ s > i && (e.virtual.cache[s - 1] = e.virtual.cache[s], e.virtual.cache[s - 1].setAttribute("data-swiper-slide-index", s - 1), delete e.virtual.cache[s]);
170
+ })), e.virtual.slides.splice(i[r], 1), i[r] < a && (a -= 1), a = Math.max(a, 0);
171
+ else
172
+ e.params.virtual.cache && (delete e.virtual.cache[i], Object.keys(e.virtual.cache).forEach((r) => {
173
+ r > i && (e.virtual.cache[r - 1] = e.virtual.cache[r], e.virtual.cache[r - 1].setAttribute("data-swiper-slide-index", r - 1), delete e.virtual.cache[r]);
174
+ })), e.virtual.slides.splice(i, 1), i < a && (a -= 1), a = Math.max(a, 0);
175
+ o(!0), e.slideTo(a, 0);
176
+ }
177
+ function D() {
178
+ e.virtual.slides = [], e.params.virtual.cache && (e.virtual.cache = {}), o(!0), e.slideTo(0, 0);
179
+ }
180
+ M("beforeInit", () => {
181
+ if (!e.params.virtual.enabled) return;
182
+ let i;
183
+ if (typeof e.passedParams.virtual.slides > "u") {
184
+ const a = [...e.slidesEl.children].filter((r) => r.matches(`.${e.params.slideClass}, swiper-slide`));
185
+ a && a.length && (e.virtual.slides = [...a], i = !0, a.forEach((r, s) => {
186
+ r.setAttribute("data-swiper-slide-index", s), e.virtual.cache[s] = r, r.remove();
187
+ }));
188
+ }
189
+ i || (e.virtual.slides = e.params.virtual.slides), e.classNames.push(`${e.params.containerModifierClass}virtual`), e.params.watchSlidesProgress = !0, e.originalParams.watchSlidesProgress = !0, o(!1, !0);
190
+ }), M("setTranslate", () => {
191
+ e.params.virtual.enabled && (e.params.cssMode && !e._immediateVirtual ? (clearTimeout(C), C = setTimeout(() => {
192
+ o();
193
+ }, 100)) : o());
194
+ }), M("init update resize", () => {
195
+ e.params.virtual.enabled && e.params.cssMode && J(e.wrapperEl, "--swiper-virtual-size", `${e.virtualSize}px`);
196
+ }), Object.assign(e.virtual, {
197
+ appendSlide: H,
198
+ prependSlide: L,
199
+ removeSlide: V,
200
+ removeAllSlides: D,
201
+ update: o
202
+ });
140
203
  }
141
204
  export {
142
- te as useOverlayPosition
205
+ X as default
143
206
  };
package/index196.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const it=require("./index164.js"),q=require("./index231.js"),x={top:"top",bottom:"top",left:"left",right:"left"},z={top:"bottom",bottom:"top",left:"right",right:"left"},ct={top:"left",left:"top"},j={top:"height",left:"width"},B={width:"totalWidth",height:"totalHeight"},H={};let $=typeof document<"u"?window.visualViewport:null;function G(e){let t=0,o=0,c=0,i=0,r=0,f=0,l={};var v;let p=((v=$==null?void 0:$.scale)!==null&&v!==void 0?v:1)>1;if(e.tagName==="BODY"){let h=document.documentElement;c=h.clientWidth,i=h.clientHeight;var s;t=(s=$==null?void 0:$.width)!==null&&s!==void 0?s:c;var d;o=(d=$==null?void 0:$.height)!==null&&d!==void 0?d:i,l.top=h.scrollTop||e.scrollTop,l.left=h.scrollLeft||e.scrollLeft,$&&(r=$.offsetTop,f=$.offsetLeft)}else({width:t,height:o,top:r,left:f}=M(e)),l.top=e.scrollTop,l.left=e.scrollLeft,c=t,i=o;if(it.isWebKit()&&(e.tagName==="BODY"||e.tagName==="HTML")&&p){l.top=0,l.left=0;var g;r=(g=$==null?void 0:$.pageTop)!==null&&g!==void 0?g:0;var n;f=(n=$==null?void 0:$.pageLeft)!==null&&n!==void 0?n:0}return{width:t,height:o,totalWidth:c,totalHeight:i,scroll:l,top:r,left:f}}function nt(e){return{top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}}function K(e,t,o,c,i,r,f){var l;let v=(l=i.scroll[e])!==null&&l!==void 0?l:0,p=c[j[e]],s=c.scroll[x[e]]+r,d=p+c.scroll[x[e]]-r,g=t-v+f[e]-c[x[e]],n=t-v+o+f[e]-c[x[e]];return g<s?s-g:n>d?Math.max(d-n,s-g):0}function rt(e){let t=window.getComputedStyle(e);return{top:parseInt(t.marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0}}function J(e){if(H[e])return H[e];let[t,o]=e.split(" "),c=x[t]||"right",i=ct[c];x[o]||(o="center");let r=j[c],f=j[i];return H[e]={placement:t,crossPlacement:o,axis:c,crossAxis:i,size:r,crossSize:f},H[e]}function Z(e,t,o,c,i,r,f,l,v,p){let{placement:s,crossPlacement:d,axis:g,crossAxis:n,size:h,crossSize:u}=c,a={};var w;a[n]=(w=e[n])!==null&&w!==void 0?w:0;var m,P,E,T;d==="center"?a[n]+=(((m=e[u])!==null&&m!==void 0?m:0)-((P=o[u])!==null&&P!==void 0?P:0))/2:d!==n&&(a[n]+=((E=e[u])!==null&&E!==void 0?E:0)-((T=o[u])!==null&&T!==void 0?T:0)),a[n]+=r;const _=e[n]-o[u]+v+p,S=e[n]+e[u]-v-p;if(a[n]=q.clamp(a[n],_,S),s===g){const L=l?f[h]:t[B[h]];a[z[g]]=Math.floor(L-e[g]+i)}else a[g]=Math.floor(e[g]+e[h]+i);return a}function at(e,t,o,c,i,r,f,l){const v=c?o.height:t[B.height];var p;let s=e.top!=null?o.top+e.top:o.top+(v-((p=e.bottom)!==null&&p!==void 0?p:0)-f);var d,g,n,h,u,a;let w=l!=="top"?Math.max(0,t.height+t.top+((d=t.scroll.top)!==null&&d!==void 0?d:0)-s-(((g=i.top)!==null&&g!==void 0?g:0)+((n=i.bottom)!==null&&n!==void 0?n:0)+r)):Math.max(0,s+f-(t.top+((h=t.scroll.top)!==null&&h!==void 0?h:0))-(((u=i.top)!==null&&u!==void 0?u:0)+((a=i.bottom)!==null&&a!==void 0?a:0)+r));return Math.min(t.height-r*2,w)}function Q(e,t,o,c,i,r){let{placement:f,axis:l,size:v}=r;var p,s;if(f===l)return Math.max(0,o[l]-e[l]-((p=e.scroll[l])!==null&&p!==void 0?p:0)+t[l]-((s=c[l])!==null&&s!==void 0?s:0)-c[z[l]]-i);var d;return Math.max(0,e[v]+e[l]+e.scroll[l]-t[l]-o[l]-o[v]-((d=c[l])!==null&&d!==void 0?d:0)-c[z[l]]-i)}function V(e,t,o,c,i,r,f,l,v,p,s,d,g,n,h,u){let a=J(e),{size:w,crossAxis:m,crossSize:P,placement:E,crossPlacement:T}=a,_=Z(t,l,o,a,s,d,p,g,h,u),S=s,L=Q(l,p,t,i,r+s,a);if(f&&c[w]>L){let X=J(`${z[E]} ${T}`),ot=Z(t,l,o,X,s,d,p,g,h,u);Q(l,p,t,i,r+s,X)>L&&(a=X,_=ot,S=s)}let b="bottom";a.axis==="top"?a.placement==="top"?b="top":a.placement==="bottom"&&(b="bottom"):a.crossAxis==="top"&&(a.crossPlacement==="top"?b="bottom":a.crossPlacement==="bottom"&&(b="top"));let I=K(m,_[m],o[P],l,v,r,p);_[m]+=I;let C=at(_,l,p,g,i,r,o.height,b);n&&n<C&&(C=n),o.height=Math.min(o.height,C),_=Z(t,l,o,a,S,d,p,g,h,u),I=K(m,_[m],o[P],l,v,r,p),_[m]+=I;let A={},k=t[m]+.5*t[P]-_[m]-i[x[m]];const D=h/2+u;var F,N,R,Y;const O=x[m]==="left"?((F=i.left)!==null&&F!==void 0?F:0)+((N=i.right)!==null&&N!==void 0?N:0):((R=i.top)!==null&&R!==void 0?R:0)+((Y=i.bottom)!==null&&Y!==void 0?Y:0),y=o[P]-O-h/2-u,tt=t[m]+h/2-(_[m]+i[x[m]]),et=t[m]+t[P]-h/2-(_[m]+i[x[m]]),lt=q.clamp(k,tt,et);return A[m]=q.clamp(lt,D,y),{position:_,maxHeight:C,arrowOffsetLeft:A.left,arrowOffsetTop:A.top,placement:a.placement}}function pt(e){let{placement:t,targetNode:o,overlayNode:c,scrollNode:i,padding:r,shouldFlip:f,boundaryElement:l,offset:v,crossOffset:p,maxHeight:s,arrowSize:d=0,arrowBoundaryOffset:g=0}=e,n=c instanceof HTMLElement?st(c):document.documentElement,h=n===document.documentElement;const u=window.getComputedStyle(n).position;let a=!!u&&u!=="static",w=h?M(o):U(o,n);if(!h){let{marginTop:A,marginLeft:k}=window.getComputedStyle(o);w.top+=parseInt(A,10)||0,w.left+=parseInt(k,10)||0}let m=M(c),P=rt(c);var E,T;m.width+=((E=P.left)!==null&&E!==void 0?E:0)+((T=P.right)!==null&&T!==void 0?T:0);var _,S;m.height+=((_=P.top)!==null&&_!==void 0?_:0)+((S=P.bottom)!==null&&S!==void 0?S:0);let L=nt(i),b=G(l),I=G(n),C=l.tagName==="BODY"?M(n):U(n,l);return n.tagName==="HTML"&&l.tagName==="BODY"&&(I.scroll.top=0,I.scroll.left=0),V(t,w,m,L,P,r,f,b,I,C,v,p,a,s,d,g)}function M(e){let{top:t,left:o,width:c,height:i}=e.getBoundingClientRect(),{scrollTop:r,scrollLeft:f,clientTop:l,clientLeft:v}=document.documentElement;return{top:t+r-l,left:o+f-v,width:c,height:i}}function U(e,t){let o=window.getComputedStyle(e),c;if(o.position==="fixed"){let{top:i,left:r,width:f,height:l}=e.getBoundingClientRect();c={top:i,left:r,width:f,height:l}}else{c=M(e);let i=M(t),r=window.getComputedStyle(t);i.top+=(parseInt(r.borderTopWidth,10)||0)-t.scrollTop,i.left+=(parseInt(r.borderLeftWidth,10)||0)-t.scrollLeft,c.top-=i.top,c.left-=i.left}return c.top-=parseInt(o.marginTop,10)||0,c.left-=parseInt(o.marginLeft,10)||0,c}function st(e){let t=e.offsetParent;if(t&&t===document.body&&window.getComputedStyle(t).position==="static"&&!W(t)&&(t=document.documentElement),t==null)for(t=e.parentElement;t&&!W(t);)t=t.parentElement;return t||document.documentElement}function W(e){let t=window.getComputedStyle(e);return t.transform!=="none"||/transform|perspective/.test(t.willChange)||t.filter!=="none"||t.contain==="paint"||"backdropFilter"in t&&t.backdropFilter!=="none"||"WebkitBackdropFilter"in t&&t.WebkitBackdropFilter!=="none"}exports.calculatePosition=pt;exports.calculatePositionInternal=V;
1
+ "use strict";const P=require("./index233.js"),b=require("./index234.js");function U(V){let{swiper:e,extendParams:x,on:y,emit:L}=V;const a=P.g(),m=P.a();e.keyboard={enabled:!1},x({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}});function g(N){if(!e.enabled)return;const{rtlTranslate:l}=e;let t=N;t.originalEvent&&(t=t.originalEvent);const i=t.keyCode||t.charCode,h=e.params.keyboard.pageUpDown,r=h&&i===33,o=h&&i===34,d=i===37,f=i===39,c=i===38,u=i===40;if(!e.allowSlideNext&&(e.isHorizontal()&&f||e.isVertical()&&u||o)||!e.allowSlidePrev&&(e.isHorizontal()&&d||e.isVertical()&&c||r))return!1;if(!(t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)&&!(a.activeElement&&a.activeElement.nodeName&&(a.activeElement.nodeName.toLowerCase()==="input"||a.activeElement.nodeName.toLowerCase()==="textarea"))){if(e.params.keyboard.onlyInViewport&&(r||o||d||f||c||u)){let D=!1;if(b.a(e.el,`.${e.params.slideClass}, swiper-slide`).length>0&&b.a(e.el,`.${e.params.slideActiveClass}`).length===0)return;const p=e.el,E=p.clientWidth,C=p.clientHeight,A=m.innerWidth,K=m.innerHeight,n=b.b(p);l&&(n.left-=p.scrollLeft);const H=[[n.left,n.top],[n.left+E,n.top],[n.left,n.top+C],[n.left+E,n.top+C]];for(let w=0;w<H.length;w+=1){const s=H[w];if(s[0]>=0&&s[0]<=A&&s[1]>=0&&s[1]<=K){if(s[0]===0&&s[1]===0)continue;D=!0}}if(!D)return}e.isHorizontal()?((r||o||d||f)&&(t.preventDefault?t.preventDefault():t.returnValue=!1),((o||f)&&!l||(r||d)&&l)&&e.slideNext(),((r||d)&&!l||(o||f)&&l)&&e.slidePrev()):((r||o||c||u)&&(t.preventDefault?t.preventDefault():t.returnValue=!1),(o||u)&&e.slideNext(),(r||c)&&e.slidePrev()),L("keyPress",i)}}function v(){e.keyboard.enabled||(a.addEventListener("keydown",g),e.keyboard.enabled=!0)}function k(){e.keyboard.enabled&&(a.removeEventListener("keydown",g),e.keyboard.enabled=!1)}y("init",()=>{e.params.keyboard.enabled&&v()}),y("destroy",()=>{e.keyboard.enabled&&k()}),Object.assign(e.keyboard,{enable:v,disable:k})}module.exports=U;
package/index196.mjs CHANGED
@@ -1,200 +1,67 @@
1
- import { isWebKit as ot } from "./index164.mjs";
2
- import { clamp as G } from "./index231.mjs";
3
- const P = {
4
- top: "top",
5
- bottom: "top",
6
- left: "left",
7
- right: "left"
8
- }, z = {
9
- top: "bottom",
10
- bottom: "top",
11
- left: "right",
12
- right: "left"
13
- }, it = {
14
- top: "left",
15
- left: "top"
16
- }, K = {
17
- top: "height",
18
- left: "width"
19
- }, B = {
20
- width: "totalWidth",
21
- height: "totalHeight"
22
- }, H = {};
23
- let u = typeof document < "u" ? window.visualViewport : null;
24
- function j(e) {
25
- let t = 0, o = 0, c = 0, i = 0, a = 0, f = 0, l = {};
26
- var $;
27
- let p = (($ = u == null ? void 0 : u.scale) !== null && $ !== void 0 ? $ : 1) > 1;
28
- if (e.tagName === "BODY") {
29
- let h = document.documentElement;
30
- c = h.clientWidth, i = h.clientHeight;
31
- var s;
32
- t = (s = u == null ? void 0 : u.width) !== null && s !== void 0 ? s : c;
33
- var g;
34
- o = (g = u == null ? void 0 : u.height) !== null && g !== void 0 ? g : i, l.top = h.scrollTop || e.scrollTop, l.left = h.scrollLeft || e.scrollLeft, u && (a = u.offsetTop, f = u.offsetLeft);
35
- } else
36
- ({ width: t, height: o, top: a, left: f } = M(e)), l.top = e.scrollTop, l.left = e.scrollLeft, c = t, i = o;
37
- if (ot() && (e.tagName === "BODY" || e.tagName === "HTML") && p) {
38
- l.top = 0, l.left = 0;
39
- var d;
40
- a = (d = u == null ? void 0 : u.pageTop) !== null && d !== void 0 ? d : 0;
41
- var r;
42
- f = (r = u == null ? void 0 : u.pageLeft) !== null && r !== void 0 ? r : 0;
1
+ import { g as K, a as U } from "./index233.mjs";
2
+ import { a as C, b as W } from "./index234.mjs";
3
+ function I(H) {
4
+ let {
5
+ swiper: e,
6
+ extendParams: V,
7
+ on: b,
8
+ emit: x
9
+ } = H;
10
+ const o = K(), m = U();
11
+ e.keyboard = {
12
+ enabled: !1
13
+ }, V({
14
+ keyboard: {
15
+ enabled: !1,
16
+ onlyInViewport: !0,
17
+ pageUpDown: !0
18
+ }
19
+ });
20
+ function y(L) {
21
+ if (!e.enabled) return;
22
+ const {
23
+ rtlTranslate: s
24
+ } = e;
25
+ let t = L;
26
+ t.originalEvent && (t = t.originalEvent);
27
+ const i = t.keyCode || t.charCode, k = e.params.keyboard.pageUpDown, r = k && i === 33, a = k && i === 34, d = i === 37, f = i === 39, c = i === 38, u = i === 40;
28
+ if (!e.allowSlideNext && (e.isHorizontal() && f || e.isVertical() && u || a) || !e.allowSlidePrev && (e.isHorizontal() && d || e.isVertical() && c || r))
29
+ return !1;
30
+ if (!(t.shiftKey || t.altKey || t.ctrlKey || t.metaKey) && !(o.activeElement && o.activeElement.nodeName && (o.activeElement.nodeName.toLowerCase() === "input" || o.activeElement.nodeName.toLowerCase() === "textarea"))) {
31
+ if (e.params.keyboard.onlyInViewport && (r || a || d || f || c || u)) {
32
+ let h = !1;
33
+ if (C(e.el, `.${e.params.slideClass}, swiper-slide`).length > 0 && C(e.el, `.${e.params.slideActiveClass}`).length === 0)
34
+ return;
35
+ const p = e.el, D = p.clientWidth, E = p.clientHeight, N = m.innerWidth, A = m.innerHeight, n = W(p);
36
+ s && (n.left -= p.scrollLeft);
37
+ const P = [[n.left, n.top], [n.left + D, n.top], [n.left, n.top + E], [n.left + D, n.top + E]];
38
+ for (let w = 0; w < P.length; w += 1) {
39
+ const l = P[w];
40
+ if (l[0] >= 0 && l[0] <= N && l[1] >= 0 && l[1] <= A) {
41
+ if (l[0] === 0 && l[1] === 0) continue;
42
+ h = !0;
43
+ }
44
+ }
45
+ if (!h) return;
46
+ }
47
+ e.isHorizontal() ? ((r || a || d || f) && (t.preventDefault ? t.preventDefault() : t.returnValue = !1), ((a || f) && !s || (r || d) && s) && e.slideNext(), ((r || d) && !s || (a || f) && s) && e.slidePrev()) : ((r || a || c || u) && (t.preventDefault ? t.preventDefault() : t.returnValue = !1), (a || u) && e.slideNext(), (r || c) && e.slidePrev()), x("keyPress", i);
48
+ }
43
49
  }
44
- return {
45
- width: t,
46
- height: o,
47
- totalWidth: c,
48
- totalHeight: i,
49
- scroll: l,
50
- top: a,
51
- left: f
52
- };
53
- }
54
- function ct(e) {
55
- return {
56
- top: e.scrollTop,
57
- left: e.scrollLeft,
58
- width: e.scrollWidth,
59
- height: e.scrollHeight
60
- };
61
- }
62
- function q(e, t, o, c, i, a, f) {
63
- var l;
64
- let $ = (l = i.scroll[e]) !== null && l !== void 0 ? l : 0, p = c[K[e]], s = c.scroll[P[e]] + a, g = p + c.scroll[P[e]] - a, d = t - $ + f[e] - c[P[e]], r = t - $ + o + f[e] - c[P[e]];
65
- return d < s ? s - d : r > g ? Math.max(g - r, s - d) : 0;
66
- }
67
- function rt(e) {
68
- let t = window.getComputedStyle(e);
69
- return {
70
- top: parseInt(t.marginTop, 10) || 0,
71
- bottom: parseInt(t.marginBottom, 10) || 0,
72
- left: parseInt(t.marginLeft, 10) || 0,
73
- right: parseInt(t.marginRight, 10) || 0
74
- };
75
- }
76
- function J(e) {
77
- if (H[e]) return H[e];
78
- let [t, o] = e.split(" "), c = P[t] || "right", i = it[c];
79
- P[o] || (o = "center");
80
- let a = K[c], f = K[i];
81
- return H[e] = {
82
- placement: t,
83
- crossPlacement: o,
84
- axis: c,
85
- crossAxis: i,
86
- size: a,
87
- crossSize: f
88
- }, H[e];
89
- }
90
- function Z(e, t, o, c, i, a, f, l, $, p) {
91
- let { placement: s, crossPlacement: g, axis: d, crossAxis: r, size: h, crossSize: v } = c, n = {};
92
- var w;
93
- n[r] = (w = e[r]) !== null && w !== void 0 ? w : 0;
94
- var m, x, E, T;
95
- g === "center" ? n[r] += (((m = e[v]) !== null && m !== void 0 ? m : 0) - ((x = o[v]) !== null && x !== void 0 ? x : 0)) / 2 : g !== r && (n[r] += ((E = e[v]) !== null && E !== void 0 ? E : 0) - ((T = o[v]) !== null && T !== void 0 ? T : 0)), n[r] += a;
96
- const _ = e[r] - o[v] + $ + p, I = e[r] + e[v] - $ - p;
97
- if (n[r] = G(n[r], _, I), s === d) {
98
- const b = l ? f[h] : t[B[h]];
99
- n[z[d]] = Math.floor(b - e[d] + i);
100
- } else n[d] = Math.floor(e[d] + e[h] + i);
101
- return n;
102
- }
103
- function at(e, t, o, c, i, a, f, l) {
104
- const $ = c ? o.height : t[B.height];
105
- var p;
106
- let s = e.top != null ? o.top + e.top : o.top + ($ - ((p = e.bottom) !== null && p !== void 0 ? p : 0) - f);
107
- var g, d, r, h, v, n;
108
- let w = l !== "top" ? (
109
- // We want the distance between the top of the overlay to the bottom of the boundary
110
- Math.max(0, t.height + t.top + ((g = t.scroll.top) !== null && g !== void 0 ? g : 0) - s - (((d = i.top) !== null && d !== void 0 ? d : 0) + ((r = i.bottom) !== null && r !== void 0 ? r : 0) + a))
111
- ) : Math.max(0, s + f - (t.top + ((h = t.scroll.top) !== null && h !== void 0 ? h : 0)) - (((v = i.top) !== null && v !== void 0 ? v : 0) + ((n = i.bottom) !== null && n !== void 0 ? n : 0) + a));
112
- return Math.min(t.height - a * 2, w);
113
- }
114
- function Q(e, t, o, c, i, a) {
115
- let { placement: f, axis: l, size: $ } = a;
116
- var p, s;
117
- if (f === l) return Math.max(0, o[l] - e[l] - ((p = e.scroll[l]) !== null && p !== void 0 ? p : 0) + t[l] - ((s = c[l]) !== null && s !== void 0 ? s : 0) - c[z[l]] - i);
118
- var g;
119
- return Math.max(0, e[$] + e[l] + e.scroll[l] - t[l] - o[l] - o[$] - ((g = c[l]) !== null && g !== void 0 ? g : 0) - c[z[l]] - i);
120
- }
121
- function nt(e, t, o, c, i, a, f, l, $, p, s, g, d, r, h, v) {
122
- let n = J(e), { size: w, crossAxis: m, crossSize: x, placement: E, crossPlacement: T } = n, _ = Z(t, l, o, n, s, g, p, d, h, v), I = s, b = Q(l, p, t, i, a + s, n);
123
- if (f && c[w] > b) {
124
- let X = J(`${z[E]} ${T}`), lt = Z(t, l, o, X, s, g, p, d, h, v);
125
- Q(l, p, t, i, a + s, X) > b && (n = X, _ = lt, I = s);
50
+ function g() {
51
+ e.keyboard.enabled || (o.addEventListener("keydown", y), e.keyboard.enabled = !0);
126
52
  }
127
- let L = "bottom";
128
- n.axis === "top" ? n.placement === "top" ? L = "top" : n.placement === "bottom" && (L = "bottom") : n.crossAxis === "top" && (n.crossPlacement === "top" ? L = "bottom" : n.crossPlacement === "bottom" && (L = "top"));
129
- let S = q(m, _[m], o[x], l, $, a, p);
130
- _[m] += S;
131
- let C = at(_, l, p, d, i, a, o.height, L);
132
- r && r < C && (C = r), o.height = Math.min(o.height, C), _ = Z(t, l, o, n, I, g, p, d, h, v), S = q(m, _[m], o[x], l, $, a, p), _[m] += S;
133
- let A = {}, k = t[m] + 0.5 * t[x] - _[m] - i[P[m]];
134
- const V = h / 2 + v;
135
- var F, N, R, Y;
136
- const D = P[m] === "left" ? ((F = i.left) !== null && F !== void 0 ? F : 0) + ((N = i.right) !== null && N !== void 0 ? N : 0) : ((R = i.top) !== null && R !== void 0 ? R : 0) + ((Y = i.bottom) !== null && Y !== void 0 ? Y : 0), O = o[x] - D - h / 2 - v, y = t[m] + h / 2 - (_[m] + i[P[m]]), tt = t[m] + t[x] - h / 2 - (_[m] + i[P[m]]), et = G(k, y, tt);
137
- return A[m] = G(et, V, O), {
138
- position: _,
139
- maxHeight: C,
140
- arrowOffsetLeft: A.left,
141
- arrowOffsetTop: A.top,
142
- placement: n.placement
143
- };
144
- }
145
- function dt(e) {
146
- let { placement: t, targetNode: o, overlayNode: c, scrollNode: i, padding: a, shouldFlip: f, boundaryElement: l, offset: $, crossOffset: p, maxHeight: s, arrowSize: g = 0, arrowBoundaryOffset: d = 0 } = e, r = c instanceof HTMLElement ? pt(c) : document.documentElement, h = r === document.documentElement;
147
- const v = window.getComputedStyle(r).position;
148
- let n = !!v && v !== "static", w = h ? M(o) : U(o, r);
149
- if (!h) {
150
- let { marginTop: A, marginLeft: k } = window.getComputedStyle(o);
151
- w.top += parseInt(A, 10) || 0, w.left += parseInt(k, 10) || 0;
53
+ function v() {
54
+ e.keyboard.enabled && (o.removeEventListener("keydown", y), e.keyboard.enabled = !1);
152
55
  }
153
- let m = M(c), x = rt(c);
154
- var E, T;
155
- m.width += ((E = x.left) !== null && E !== void 0 ? E : 0) + ((T = x.right) !== null && T !== void 0 ? T : 0);
156
- var _, I;
157
- m.height += ((_ = x.top) !== null && _ !== void 0 ? _ : 0) + ((I = x.bottom) !== null && I !== void 0 ? I : 0);
158
- let b = ct(i), L = j(l), S = j(r), C = l.tagName === "BODY" ? M(r) : U(r, l);
159
- return r.tagName === "HTML" && l.tagName === "BODY" && (S.scroll.top = 0, S.scroll.left = 0), nt(t, w, m, b, x, a, f, L, S, C, $, p, n, s, g, d);
160
- }
161
- function M(e) {
162
- let { top: t, left: o, width: c, height: i } = e.getBoundingClientRect(), { scrollTop: a, scrollLeft: f, clientTop: l, clientLeft: $ } = document.documentElement;
163
- return {
164
- top: t + a - l,
165
- left: o + f - $,
166
- width: c,
167
- height: i
168
- };
169
- }
170
- function U(e, t) {
171
- let o = window.getComputedStyle(e), c;
172
- if (o.position === "fixed") {
173
- let { top: i, left: a, width: f, height: l } = e.getBoundingClientRect();
174
- c = {
175
- top: i,
176
- left: a,
177
- width: f,
178
- height: l
179
- };
180
- } else {
181
- c = M(e);
182
- let i = M(t), a = window.getComputedStyle(t);
183
- i.top += (parseInt(a.borderTopWidth, 10) || 0) - t.scrollTop, i.left += (parseInt(a.borderLeftWidth, 10) || 0) - t.scrollLeft, c.top -= i.top, c.left -= i.left;
184
- }
185
- return c.top -= parseInt(o.marginTop, 10) || 0, c.left -= parseInt(o.marginLeft, 10) || 0, c;
186
- }
187
- function pt(e) {
188
- let t = e.offsetParent;
189
- if (t && t === document.body && window.getComputedStyle(t).position === "static" && !W(t) && (t = document.documentElement), t == null)
190
- for (t = e.parentElement; t && !W(t); ) t = t.parentElement;
191
- return t || document.documentElement;
192
- }
193
- function W(e) {
194
- let t = window.getComputedStyle(e);
195
- return t.transform !== "none" || /transform|perspective/.test(t.willChange) || t.filter !== "none" || t.contain === "paint" || "backdropFilter" in t && t.backdropFilter !== "none" || "WebkitBackdropFilter" in t && t.WebkitBackdropFilter !== "none";
56
+ b("init", () => {
57
+ e.params.keyboard.enabled && g();
58
+ }), b("destroy", () => {
59
+ e.keyboard.enabled && v();
60
+ }), Object.assign(e.keyboard, {
61
+ enable: g,
62
+ disable: v
63
+ });
196
64
  }
197
65
  export {
198
- dt as calculatePosition,
199
- nt as calculatePositionInternal
66
+ I as default
200
67
  };