@okam/stack-ui 1.32.3 → 1.32.5

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 (331) hide show
  1. package/components/fields/Checkbox/index.d.ts +6 -0
  2. package/components/fields/CheckboxGroup/components/CheckboxGroupItem/index.d.ts +6 -0
  3. package/components/fields/Select/Select.d.ts +4 -1
  4. package/components/fields/Select/Select.interface.d.ts +1 -0
  5. package/components/fields/TextArea/index.d.ts +4 -1
  6. package/components/fields/TextInputField/index.d.ts +1 -1
  7. package/components/fields/TextInputField/interface.d.ts +1 -2
  8. package/index.d.ts +4 -2
  9. package/index.js +1 -1
  10. package/index.mjs +153 -151
  11. package/index124.js +1 -1
  12. package/index124.mjs +1 -1
  13. package/index125.js +1 -1
  14. package/index125.mjs +1 -1
  15. package/index139.js +1 -1
  16. package/index139.mjs +2 -2
  17. package/index140.js +1 -1
  18. package/index140.mjs +23 -23
  19. package/index141.js +1 -1
  20. package/index141.mjs +3 -3
  21. package/index146.js +1 -1
  22. package/index146.mjs +1 -1
  23. package/index150.js +1 -1
  24. package/index150.mjs +1 -1
  25. package/index151.js +1 -1
  26. package/index151.mjs +1 -1
  27. package/index153.js +1 -1
  28. package/index153.mjs +1 -1
  29. package/index154.js +1 -1
  30. package/index154.mjs +1 -1
  31. package/index155.js +1 -1
  32. package/index155.mjs +1 -1
  33. package/index156.js +1 -1
  34. package/index156.mjs +2 -2
  35. package/index158.js +1 -1
  36. package/index158.mjs +2 -2
  37. package/index159.js +1 -1
  38. package/index159.mjs +8 -8
  39. package/index16.js +1 -1
  40. package/index16.mjs +144 -67
  41. package/index17.js +1 -1
  42. package/index17.mjs +95 -26
  43. package/index173.js +1 -1
  44. package/index173.mjs +1 -1
  45. package/index175.js +1 -1
  46. package/index175.mjs +1 -1
  47. package/index176.js +1 -1
  48. package/index176.mjs +1 -1
  49. package/index177.js +1 -1
  50. package/index177.mjs +1 -1
  51. package/index178.js +1 -1
  52. package/index178.mjs +4 -4
  53. package/index179.js +1 -1
  54. package/index179.mjs +1 -1
  55. package/index198.js +1 -1
  56. package/index198.mjs +201 -70
  57. package/index199.js +1 -1
  58. package/index199.mjs +60 -91
  59. package/index20.js +1 -1
  60. package/index20.mjs +105 -31
  61. package/index200.js +1 -1
  62. package/index200.mjs +139 -151
  63. package/index201.js +1 -1
  64. package/index201.mjs +125 -72
  65. package/index202.js +1 -1
  66. package/index202.mjs +220 -38
  67. package/index203.js +1 -1
  68. package/index203.mjs +190 -5
  69. package/index204.js +1 -1
  70. package/index204.mjs +68 -60
  71. package/index205.js +1 -1
  72. package/index205.mjs +273 -53
  73. package/index206.js +1 -1
  74. package/index206.mjs +86 -191
  75. package/index207.js +1 -1
  76. package/index207.mjs +180 -56
  77. package/index208.js +1 -1
  78. package/index208.mjs +75 -134
  79. package/index209.js +1 -1
  80. package/index209.mjs +52 -118
  81. package/index21.js +1 -1
  82. package/index21.mjs +132 -59
  83. package/index210.js +1 -1
  84. package/index210.mjs +116 -214
  85. package/index211.js +1 -1
  86. package/index211.mjs +107 -181
  87. package/index212.js +1 -1
  88. package/index212.mjs +114 -61
  89. package/index213.js +1 -1
  90. package/index213.mjs +65 -272
  91. package/index214.js +1 -1
  92. package/index214.mjs +105 -93
  93. package/index215.js +1 -1
  94. package/index215.mjs +47 -183
  95. package/index216.js +1 -1
  96. package/index216.mjs +86 -77
  97. package/index217.js +1 -1
  98. package/index217.mjs +65 -53
  99. package/index218.js +1 -1
  100. package/index218.mjs +52 -122
  101. package/index219.js +1 -1
  102. package/index219.mjs +94 -111
  103. package/index22.js +1 -1
  104. package/index22.mjs +109 -102
  105. package/index220.js +5 -1
  106. package/index220.mjs +75 -117
  107. package/index221.js +1 -1
  108. package/index221.mjs +2016 -63
  109. package/index222.js +1 -1
  110. package/index222.mjs +54 -105
  111. package/index223.js +1 -1
  112. package/index223.mjs +186 -50
  113. package/index224.js +1 -1
  114. package/index224.mjs +68 -89
  115. package/index225.js +1 -1
  116. package/index225.mjs +93 -68
  117. package/index226.js +1 -1
  118. package/index226.mjs +151 -52
  119. package/index227.js +1 -1
  120. package/index227.mjs +72 -100
  121. package/index228.js +1 -5
  122. package/index228.mjs +40 -78
  123. package/index229.js +1 -1
  124. package/index229.mjs +5 -2025
  125. package/index230.js +1 -1
  126. package/index230.mjs +61 -59
  127. package/index231.js +1 -1
  128. package/index231.mjs +58 -187
  129. package/index266.js +1 -1
  130. package/index266.mjs +34 -34
  131. package/index270.js +1 -1
  132. package/index270.mjs +24 -48
  133. package/index271.js +1 -1
  134. package/index271.mjs +47 -9
  135. package/index272.js +1 -1
  136. package/index272.mjs +6 -16
  137. package/index273.js +1 -1
  138. package/index273.mjs +6 -16
  139. package/index274.js +1 -1
  140. package/index274.mjs +15 -16
  141. package/index275.js +1 -1
  142. package/index275.mjs +25 -16
  143. package/index276.js +1 -1
  144. package/index276.mjs +29 -16
  145. package/index277.js +1 -1
  146. package/index277.mjs +32 -16
  147. package/index278.js +1 -1
  148. package/index278.mjs +10 -16
  149. package/index279.js +1 -1
  150. package/index279.mjs +29 -16
  151. package/index280.js +1 -1
  152. package/index280.mjs +10 -16
  153. package/index281.js +1 -1
  154. package/index281.mjs +6 -16
  155. package/index282.js +1 -1
  156. package/index282.mjs +8 -16
  157. package/index283.js +1 -1
  158. package/index283.mjs +14 -16
  159. package/index284.js +1 -1
  160. package/index284.mjs +9 -16
  161. package/index285.js +1 -1
  162. package/index285.mjs +130 -15
  163. package/index286.js +1 -1
  164. package/index286.mjs +191 -16
  165. package/index287.js +1 -1
  166. package/index287.mjs +10 -16
  167. package/index288.js +1 -1
  168. package/index288.mjs +4 -16
  169. package/index289.js +1 -1
  170. package/index289.mjs +37 -16
  171. package/index290.js +1 -1
  172. package/index290.mjs +6 -16
  173. package/index291.js +1 -1
  174. package/index291.mjs +30 -16
  175. package/index292.js +1 -1
  176. package/index292.mjs +7 -16
  177. package/index293.js +1 -1
  178. package/index293.mjs +49 -16
  179. package/index294.js +1 -1
  180. package/index294.mjs +15 -15
  181. package/index295.js +1 -1
  182. package/index295.mjs +15 -15
  183. package/index296.js +1 -1
  184. package/index296.mjs +12 -12
  185. package/index297.js +1 -1
  186. package/index297.mjs +15 -15
  187. package/index298.js +1 -1
  188. package/index298.mjs +12 -12
  189. package/index299.js +1 -1
  190. package/index299.mjs +15 -15
  191. package/index300.js +1 -1
  192. package/index300.mjs +15 -15
  193. package/index301.js +1 -1
  194. package/index301.mjs +12 -12
  195. package/index302.js +1 -1
  196. package/index302.mjs +12 -12
  197. package/index303.js +1 -1
  198. package/index303.mjs +15 -15
  199. package/index304.js +1 -1
  200. package/index304.mjs +15 -15
  201. package/index305.js +1 -1
  202. package/index305.mjs +15 -15
  203. package/index306.js +1 -1
  204. package/index306.mjs +15 -130
  205. package/index307.js +1 -1
  206. package/index307.mjs +16 -191
  207. package/index308.js +1 -1
  208. package/index308.mjs +16 -10
  209. package/index309.js +1 -1
  210. package/index309.mjs +16 -4
  211. package/index310.js +1 -1
  212. package/index310.mjs +16 -37
  213. package/index311.js +1 -1
  214. package/index311.mjs +16 -6
  215. package/index312.js +1 -1
  216. package/index312.mjs +16 -30
  217. package/index313.js +1 -1
  218. package/index313.mjs +16 -7
  219. package/index314.js +1 -1
  220. package/index314.mjs +16 -25
  221. package/index315.js +1 -1
  222. package/index315.mjs +16 -48
  223. package/index316.js +1 -1
  224. package/index316.mjs +16 -6
  225. package/index317.js +1 -1
  226. package/index317.mjs +16 -6
  227. package/index318.js +1 -1
  228. package/index318.mjs +16 -15
  229. package/index319.js +1 -1
  230. package/index319.mjs +16 -25
  231. package/index320.js +1 -1
  232. package/index320.mjs +16 -29
  233. package/index321.js +1 -1
  234. package/index321.mjs +16 -32
  235. package/index322.js +1 -1
  236. package/index322.mjs +16 -29
  237. package/index323.js +1 -1
  238. package/index323.mjs +16 -10
  239. package/index324.js +1 -1
  240. package/index324.mjs +16 -6
  241. package/index325.js +1 -1
  242. package/index325.mjs +16 -8
  243. package/index326.js +1 -1
  244. package/index326.mjs +16 -14
  245. package/index327.js +1 -1
  246. package/index327.mjs +16 -9
  247. package/index328.js +1 -1
  248. package/index328.mjs +1 -1
  249. package/index332.js +1 -1
  250. package/index332.mjs +2 -2
  251. package/index333.js +1 -1
  252. package/index333.mjs +1 -1
  253. package/index339.js +1 -1
  254. package/index339.mjs +1 -1
  255. package/index340.js +1 -1
  256. package/index340.mjs +2 -2
  257. package/index345.js +1 -1
  258. package/index345.mjs +5 -117
  259. package/index346.js +1 -1
  260. package/index346.mjs +117 -71
  261. package/index347.js +1 -1
  262. package/index347.mjs +71 -7
  263. package/index348.js +1 -1
  264. package/index348.mjs +7 -7
  265. package/index349.js +1 -1
  266. package/index349.mjs +7 -7
  267. package/index350.js +1 -1
  268. package/index350.mjs +7 -7
  269. package/index351.js +1 -1
  270. package/index351.mjs +4 -4
  271. package/index352.js +1 -1
  272. package/index352.mjs +7 -7
  273. package/index353.js +1 -1
  274. package/index353.mjs +7 -7
  275. package/index354.js +1 -1
  276. package/index354.mjs +4 -4
  277. package/index355.js +1 -1
  278. package/index355.mjs +4 -4
  279. package/index356.js +1 -1
  280. package/index356.mjs +4 -4
  281. package/index357.js +1 -1
  282. package/index357.mjs +4 -4
  283. package/index358.js +1 -1
  284. package/index358.mjs +7 -7
  285. package/index359.js +1 -1
  286. package/index359.mjs +7 -7
  287. package/index360.js +1 -1
  288. package/index360.mjs +7 -7
  289. package/index361.js +1 -1
  290. package/index361.mjs +4 -4
  291. package/index362.js +1 -1
  292. package/index362.mjs +7 -7
  293. package/index363.js +1 -1
  294. package/index363.mjs +7 -7
  295. package/index364.js +1 -1
  296. package/index364.mjs +7 -7
  297. package/index365.js +1 -1
  298. package/index365.mjs +7 -7
  299. package/index366.js +1 -1
  300. package/index366.mjs +7 -7
  301. package/index367.js +1 -1
  302. package/index367.mjs +4 -4
  303. package/index368.js +1 -1
  304. package/index368.mjs +7 -7
  305. package/index369.js +1 -1
  306. package/index369.mjs +7 -7
  307. package/index370.js +1 -1
  308. package/index370.mjs +3 -3
  309. package/index371.js +1 -1
  310. package/index371.mjs +4 -4
  311. package/index372.js +1 -1
  312. package/index372.mjs +7 -7
  313. package/index373.js +1 -1
  314. package/index373.mjs +7 -7
  315. package/index374.js +1 -1
  316. package/index374.mjs +7 -7
  317. package/index375.js +1 -1
  318. package/index375.mjs +4 -4
  319. package/index376.js +1 -1
  320. package/index376.mjs +7 -7
  321. package/index377.js +1 -1
  322. package/index377.mjs +4 -4
  323. package/index378.js +1 -1
  324. package/index378.mjs +4 -4
  325. package/index379.js +1 -1
  326. package/index379.mjs +7 -7
  327. package/index380.js +1 -1
  328. package/index380.mjs +4 -4
  329. package/index381.js +1 -1
  330. package/index381.mjs +8 -6
  331. package/package.json +1 -1
package/index21.mjs CHANGED
@@ -1,73 +1,146 @@
1
1
  "use client";
2
- import { jsxs as T, jsx as e } from "react/jsx-runtime";
3
- import { FocusRing as C } from "@react-aria/focus";
4
- import { isEmpty as $ } from "radashi";
5
- import { useRef as q } from "react";
6
- import { useTextField as y } from "react-aria";
7
- import { useFormContext as A, get as H } from "react-hook-form";
8
- import h from "./index64.mjs";
9
- import { useTranslation as P } from "./index72.mjs";
10
- import j from "./index3.mjs";
11
- const w = (r) => {
2
+ import { jsxs as j, jsx as o } from "react/jsx-runtime";
3
+ import { FocusRing as D } from "@react-aria/focus";
4
+ import { isEmpty as I } from "radashi";
5
+ import { useRef as P } from "react";
6
+ import { useTextField as C } from "react-aria";
7
+ import { useFormContext as H, Controller as _ } from "react-hook-form";
8
+ import T from "./index64.mjs";
9
+ import { useTranslation as w } from "./index72.mjs";
10
+ import G from "./index3.mjs";
11
+ const L = (n) => {
12
12
  const {
13
- id: s,
14
- label: u,
15
- name: a,
16
- placeholder: p,
17
- required: f,
18
- disabled: t = !1,
19
- errorMessage: o,
20
- ariaLabel: n,
21
- value: d,
22
- onBlur: i,
23
- onChange: R,
24
- fieldRef: l,
25
- themeName: m = "textarea",
26
- tokens: E,
27
- customTheme: g
28
- } = r, b = q(null), { errorMessageProps: M, inputProps: N, labelProps: v } = y(r, b), c = { ...E, isDisabled: t, isError: o != null }, F = h(`${m}.wrapper`, c, g), L = h(`${m}.input`, c, g), O = h(`${m}.label`, c, g), k = h(`${m}.container`, c, g);
29
- return /* @__PURE__ */ T("div", { children: [
30
- /* @__PURE__ */ T("div", { className: F, "aria-disabled": t, children: [
31
- u && /* @__PURE__ */ e("label", { className: O, ...v, children: u }),
32
- /* @__PURE__ */ e("div", { className: k, children: /* @__PURE__ */ e(C, { focusRingClass: "has-focus-ring", children: /* @__PURE__ */ e(
13
+ id: u,
14
+ label: e,
15
+ name: q,
16
+ placeholder: E,
17
+ required: x,
18
+ disabled: d = !1,
19
+ errorMessage: l,
20
+ ariaLabel: F,
21
+ value: c,
22
+ onBlur: m,
23
+ onChange: M,
24
+ fieldRef: p,
25
+ themeName: r = "textarea",
26
+ tokens: b,
27
+ customTheme: s
28
+ } = n, f = P(null), { errorMessageProps: N, inputProps: R, labelProps: O } = C(n, f), t = { ...b, isDisabled: d, isError: l != null }, a = T(`${r}.wrapper`, t, s), i = T(`${r}.input`, t, s), h = T(`${r}.label`, t, s), k = T(`${r}.container`, t, s);
29
+ return /* @__PURE__ */ j("div", { children: [
30
+ /* @__PURE__ */ j("div", { className: a, "aria-disabled": d ? "true" : "false", children: [
31
+ e && /* @__PURE__ */ o("label", { className: h, ...O, children: e }),
32
+ /* @__PURE__ */ o("div", { className: k, children: /* @__PURE__ */ o(D, { focusRingClass: "has-focus-ring", children: /* @__PURE__ */ o(
33
33
  "textarea",
34
34
  {
35
- ...N,
36
- ref: (x) => {
37
- l == null || l(x), b.current = x;
35
+ ...R,
36
+ ref: (g) => {
37
+ p == null || p(g), f.current = g;
38
38
  },
39
- className: L,
40
- placeholder: p,
41
- disabled: t,
42
- required: f,
43
- id: s,
44
- name: a,
45
- "aria-label": n,
46
- "aria-labelledby": s,
47
- value: d,
48
- onBlur: i,
49
- onChange: R
39
+ className: i,
40
+ placeholder: E,
41
+ disabled: d,
42
+ required: x,
43
+ id: u,
44
+ name: q,
45
+ "aria-label": F,
46
+ "aria-labelledby": u,
47
+ value: c,
48
+ onBlur: m,
49
+ onChange: M
50
50
  }
51
51
  ) }) })
52
52
  ] }),
53
- o && /* @__PURE__ */ e(j, { themeName: `${m}.errorMessage`, tokens: c, ...M, children: o })
53
+ l && /* @__PURE__ */ o(G, { themeName: `${r}.errorMessage`, tokens: t, ...N, children: l })
54
54
  ] });
55
- }, z = (r) => {
56
- const { name: s, required: u, minLength: a = 0, maxLength: p = 99999999, validation: f } = r, { register: t, formState: o } = A(), n = H(o.errors, s), d = (n == null ? void 0 : n.message) ?? void 0, { t: i } = P(), { ref: R, ...l } = t(s, {
57
- required: u ? i("FORM.ERROR.REQUIRED") ?? "required" : !1,
58
- minLength: {
59
- value: a,
60
- message: i("FORM.ERROR.MIN_LENGTH", { length: a })
55
+ }, Z = ({
56
+ name: n,
57
+ label: u,
58
+ rules: e,
59
+ tokens: q,
60
+ ariaLabel: E,
61
+ defaultValue: x = "",
62
+ placeholder: d = "",
63
+ themeName: l = "textarea",
64
+ isReadOnly: F = !1,
65
+ minLength: c,
66
+ maxLength: m,
67
+ required: M,
68
+ isRequired: p,
69
+ onChange: r,
70
+ onBlur: b,
71
+ children: s = null,
72
+ ...f
73
+ }) => {
74
+ const { control: N } = H(), { t: R } = w(), O = () => {
75
+ const a = Object.entries(f).filter(([i, h]) => i.startsWith("aria-"));
76
+ return Object.fromEntries(a);
77
+ }, t = {
78
+ required: M ?? p ? R("FORM.ERROR.REQUIRED") ?? "required" : !1,
79
+ ...c != null && {
80
+ minLength: {
81
+ value: c,
82
+ message: R("FORM.ERROR.MIN_LENGTH", { length: c })
83
+ }
61
84
  },
62
- maxLength: {
63
- value: p,
64
- message: i("FORM.ERROR.MAX_LENGTH", { length: a })
85
+ ...m != null && {
86
+ maxLength: {
87
+ value: m,
88
+ message: R("FORM.ERROR.MAX_LENGTH", { length: m })
89
+ }
65
90
  },
66
- ...f
67
- });
68
- return /* @__PURE__ */ e(w, { fieldRef: R, ...l, ...r, isError: !$(d), errorMessage: d });
91
+ ...e
92
+ };
93
+ return /* @__PURE__ */ o(
94
+ _,
95
+ {
96
+ name: n,
97
+ control: N,
98
+ rules: t,
99
+ disabled: e == null ? void 0 : e.disabled,
100
+ defaultValue: x,
101
+ render: ({ field: a, fieldState: i }) => {
102
+ var $;
103
+ const { ref: h, ...k } = a, g = !I(i.error), y = {
104
+ isDisabled: a.disabled ?? !1,
105
+ isRequired: (e == null ? void 0 : e.required) === !0 || (e == null ? void 0 : e.required) === "required",
106
+ isInvalid: i.invalid,
107
+ isError: g,
108
+ isReadOnly: F
109
+ }, A = {
110
+ ...q,
111
+ ...y
112
+ };
113
+ return /* @__PURE__ */ o(
114
+ L,
115
+ {
116
+ ...k,
117
+ ...y,
118
+ ...O(),
119
+ fieldRef: h,
120
+ name: n,
121
+ placeholder: d,
122
+ themeName: l,
123
+ label: u,
124
+ tokens: A,
125
+ ariaLabel: E,
126
+ isDisabled: a.disabled,
127
+ isRequired: (e == null ? void 0 : e.required) === !0 || (e == null ? void 0 : e.required) === "required",
128
+ isInvalid: i.invalid,
129
+ errorMessage: ($ = i.error) == null ? void 0 : $.message,
130
+ onChange: (v) => {
131
+ a.onChange(v), r == null || r(v);
132
+ },
133
+ onBlur: (v) => {
134
+ a.onBlur(), b == null || b(v);
135
+ },
136
+ children: s
137
+ }
138
+ );
139
+ }
140
+ }
141
+ );
69
142
  };
70
143
  export {
71
- z as ReactHookFormTextArea,
72
- w as default
144
+ Z as ReactHookFormTextArea,
145
+ L as default
73
146
  };
package/index210.js CHANGED
@@ -1 +1 @@
1
- "use strict";const $=require("./index309.js"),q=require("./index308.js"),f=require("./index307.js");function w(S){let{swiper:e,extendParams:H,on:u,emit:v}=S;const d="swiper-pagination";H({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:a=>a,formatFractionTotal:a=>a,bulletClass:`${d}-bullet`,bulletActiveClass:`${d}-bullet-active`,modifierClass:`${d}-`,currentClass:`${d}-current`,totalClass:`${d}-total`,hiddenClass:`${d}-hidden`,progressbarFillClass:`${d}-progressbar-fill`,progressbarOppositeClass:`${d}-progressbar-opposite`,clickableClass:`${d}-clickable`,lockClass:`${d}-lock`,horizontalClass:`${d}-horizontal`,verticalClass:`${d}-vertical`,paginationDisabledClass:`${d}-disabled`}}),e.pagination={el:null,bullets:[]};let b,m=0;function k(){return!e.params.pagination.el||!e.pagination.el||Array.isArray(e.pagination.el)&&e.pagination.el.length===0}function x(a,s){const{bulletActiveClass:i}=e.params.pagination;a&&(a=a[`${s==="prev"?"previous":"next"}ElementSibling`],a&&(a.classList.add(`${i}-${s}`),a=a[`${s==="prev"?"previous":"next"}ElementSibling`],a&&a.classList.add(`${i}-${s}-${s}`)))}function I(a,s,i){if(a=a%i,s=s%i,s===a+1)return"next";if(s===a-1)return"previous"}function D(a){const s=a.target.closest($.c(e.params.pagination.bulletClass));if(!s)return;a.preventDefault();const i=f.h(s)*e.params.slidesPerGroup;if(e.params.loop){if(e.realIndex===i)return;const t=I(e.realIndex,i,e.slides.length);t==="next"?e.slideNext():t==="previous"?e.slidePrev():e.slideToLoop(i)}else e.slideTo(i)}function h(){const a=e.rtl,s=e.params.pagination;if(k())return;let i=e.pagination.el;i=f.m(i);let t,c;const C=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.slides.length,z=e.params.loop?Math.ceil(C/e.params.slidesPerGroup):e.snapGrid.length;if(e.params.loop?(c=e.previousRealIndex||0,t=e.params.slidesPerGroup>1?Math.floor(e.realIndex/e.params.slidesPerGroup):e.realIndex):typeof e.snapIndex<"u"?(t=e.snapIndex,c=e.previousSnapIndex):(c=e.previousIndex||0,t=e.activeIndex||0),s.type==="bullets"&&e.pagination.bullets&&e.pagination.bullets.length>0){const l=e.pagination.bullets;let g,p,L;if(s.dynamicBullets&&(b=f.f(l[0],e.isHorizontal()?"width":"height"),i.forEach(n=>{n.style[e.isHorizontal()?"width":"height"]=`${b*(s.dynamicMainBullets+4)}px`}),s.dynamicMainBullets>1&&c!==void 0&&(m+=t-(c||0),m>s.dynamicMainBullets-1?m=s.dynamicMainBullets-1:m<0&&(m=0)),g=Math.max(t-m,0),p=g+(Math.min(l.length,s.dynamicMainBullets)-1),L=(p+g)/2),l.forEach(n=>{const r=[...["","-next","-next-next","-prev","-prev-prev","-main"].map(o=>`${s.bulletActiveClass}${o}`)].map(o=>typeof o=="string"&&o.includes(" ")?o.split(" "):o).flat();n.classList.remove(...r)}),i.length>1)l.forEach(n=>{const r=f.h(n);r===t?n.classList.add(...s.bulletActiveClass.split(" ")):e.isElement&&n.setAttribute("part","bullet"),s.dynamicBullets&&(r>=g&&r<=p&&n.classList.add(...`${s.bulletActiveClass}-main`.split(" ")),r===g&&x(n,"prev"),r===p&&x(n,"next"))});else{const n=l[t];if(n&&n.classList.add(...s.bulletActiveClass.split(" ")),e.isElement&&l.forEach((r,o)=>{r.setAttribute("part",o===t?"bullet-active":"bullet")}),s.dynamicBullets){const r=l[g],o=l[p];for(let y=g;y<=p;y+=1)l[y]&&l[y].classList.add(...`${s.bulletActiveClass}-main`.split(" "));x(r,"prev"),x(o,"next")}}if(s.dynamicBullets){const n=Math.min(l.length,s.dynamicMainBullets+4),r=(b*n-b)/2-L*b,o=a?"right":"left";l.forEach(y=>{y.style[e.isHorizontal()?o:"top"]=`${r}px`})}}i.forEach((l,g)=>{if(s.type==="fraction"&&(l.querySelectorAll($.c(s.currentClass)).forEach(p=>{p.textContent=s.formatFractionCurrent(t+1)}),l.querySelectorAll($.c(s.totalClass)).forEach(p=>{p.textContent=s.formatFractionTotal(z)})),s.type==="progressbar"){let p;s.progressbarOpposite?p=e.isHorizontal()?"vertical":"horizontal":p=e.isHorizontal()?"horizontal":"vertical";const L=(t+1)/z;let n=1,r=1;p==="horizontal"?n=L:r=L,l.querySelectorAll($.c(s.progressbarFillClass)).forEach(o=>{o.style.transform=`translate3d(0,0,0) scaleX(${n}) scaleY(${r})`,o.style.transitionDuration=`${e.params.speed}ms`})}s.type==="custom"&&s.renderCustom?(l.innerHTML=s.renderCustom(e,t+1,z),g===0&&v("paginationRender",l)):(g===0&&v("paginationRender",l),v("paginationUpdate",l)),e.params.watchOverflow&&e.enabled&&l.classList[e.isLocked?"add":"remove"](s.lockClass)})}function B(){const a=e.params.pagination;if(k())return;const s=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.grid&&e.params.grid.rows>1?e.slides.length/Math.ceil(e.params.grid.rows):e.slides.length;let i=e.pagination.el;i=f.m(i);let t="";if(a.type==="bullets"){let c=e.params.loop?Math.ceil(s/e.params.slidesPerGroup):e.snapGrid.length;e.params.freeMode&&e.params.freeMode.enabled&&c>s&&(c=s);for(let C=0;C<c;C+=1)a.renderBullet?t+=a.renderBullet.call(e,C,a.bulletClass):t+=`<${a.bulletElement} ${e.isElement?'part="bullet"':""} class="${a.bulletClass}"></${a.bulletElement}>`}a.type==="fraction"&&(a.renderFraction?t=a.renderFraction.call(e,a.currentClass,a.totalClass):t=`<span class="${a.currentClass}"></span> / <span class="${a.totalClass}"></span>`),a.type==="progressbar"&&(a.renderProgressbar?t=a.renderProgressbar.call(e,a.progressbarFillClass):t=`<span class="${a.progressbarFillClass}"></span>`),e.pagination.bullets=[],i.forEach(c=>{a.type!=="custom"&&(c.innerHTML=t||""),a.type==="bullets"&&e.pagination.bullets.push(...c.querySelectorAll($.c(a.bulletClass)))}),a.type!=="custom"&&v("paginationRender",i[0])}function A(){e.params.pagination=q.c(e,e.originalParams.pagination,e.params.pagination,{el:"swiper-pagination"});const a=e.params.pagination;if(!a.el)return;let s;typeof a.el=="string"&&e.isElement&&(s=e.el.querySelector(a.el)),!s&&typeof a.el=="string"&&(s=[...document.querySelectorAll(a.el)]),s||(s=a.el),!(!s||s.length===0)&&(e.params.uniqueNavElements&&typeof a.el=="string"&&Array.isArray(s)&&s.length>1&&(s=[...e.el.querySelectorAll(a.el)],s.length>1&&(s=s.filter(i=>f.a(i,".swiper")[0]===e.el)[0])),Array.isArray(s)&&s.length===1&&(s=s[0]),Object.assign(e.pagination,{el:s}),s=f.m(s),s.forEach(i=>{a.type==="bullets"&&a.clickable&&i.classList.add(...(a.clickableClass||"").split(" ")),i.classList.add(a.modifierClass+a.type),i.classList.add(e.isHorizontal()?a.horizontalClass:a.verticalClass),a.type==="bullets"&&a.dynamicBullets&&(i.classList.add(`${a.modifierClass}${a.type}-dynamic`),m=0,a.dynamicMainBullets<1&&(a.dynamicMainBullets=1)),a.type==="progressbar"&&a.progressbarOpposite&&i.classList.add(a.progressbarOppositeClass),a.clickable&&i.addEventListener("click",D),e.enabled||i.classList.add(a.lockClass)}))}function M(){const a=e.params.pagination;if(k())return;let s=e.pagination.el;s&&(s=f.m(s),s.forEach(i=>{i.classList.remove(a.hiddenClass),i.classList.remove(a.modifierClass+a.type),i.classList.remove(e.isHorizontal()?a.horizontalClass:a.verticalClass),a.clickable&&(i.classList.remove(...(a.clickableClass||"").split(" ")),i.removeEventListener("click",D))})),e.pagination.bullets&&e.pagination.bullets.forEach(i=>i.classList.remove(...a.bulletActiveClass.split(" ")))}u("changeDirection",()=>{if(!e.pagination||!e.pagination.el)return;const a=e.params.pagination;let{el:s}=e.pagination;s=f.m(s),s.forEach(i=>{i.classList.remove(a.horizontalClass,a.verticalClass),i.classList.add(e.isHorizontal()?a.horizontalClass:a.verticalClass)})}),u("init",()=>{e.params.pagination.enabled===!1?P():(A(),B(),h())}),u("activeIndexChange",()=>{typeof e.snapIndex>"u"&&h()}),u("snapIndexChange",()=>{h()}),u("snapGridLengthChange",()=>{B(),h()}),u("destroy",()=>{M()}),u("enable disable",()=>{let{el:a}=e.pagination;a&&(a=f.m(a),a.forEach(s=>s.classList[e.enabled?"remove":"add"](e.params.pagination.lockClass)))}),u("lock unlock",()=>{h()}),u("click",(a,s)=>{const i=s.target,t=f.m(e.pagination.el);if(e.params.pagination.el&&e.params.pagination.hideOnClick&&t&&t.length>0&&!i.classList.contains(e.params.pagination.bulletClass)){if(e.navigation&&(e.navigation.nextEl&&i===e.navigation.nextEl||e.navigation.prevEl&&i===e.navigation.prevEl))return;const c=t[0].classList.contains(e.params.pagination.hiddenClass);v(c===!0?"paginationShow":"paginationHide"),t.forEach(C=>C.classList.toggle(e.params.pagination.hiddenClass))}});const O=()=>{e.el.classList.remove(e.params.pagination.paginationDisabledClass);let{el:a}=e.pagination;a&&(a=f.m(a),a.forEach(s=>s.classList.remove(e.params.pagination.paginationDisabledClass))),A(),B(),h()},P=()=>{e.el.classList.add(e.params.pagination.paginationDisabledClass);let{el:a}=e.pagination;a&&(a=f.m(a),a.forEach(s=>s.classList.add(e.params.pagination.paginationDisabledClass))),M()};Object.assign(e.pagination,{enable:O,disable:P,render:B,update:h,init:A,destroy:M})}module.exports=w;
1
+ "use strict";const h=require("./index285.js");function V(q){let{swiper:e,extendParams:x,on:s,emit:r,params:u}=q;e.autoplay={running:!1,paused:!1,timeLeft:0},x({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let y,E,w=u&&u.autoplay?u.autoplay.delay:3e3,g=u&&u.autoplay?u.autoplay.delay:3e3,n,f=new Date().getTime(),b,v,p,D,L,o,S;function M(t){!e||e.destroyed||!e.wrapperEl||t.target===e.wrapperEl&&(e.wrapperEl.removeEventListener("transitionend",M),!(S||t.detail&&t.detail.bySwiperTouchMove)&&l())}const O=()=>{if(e.destroyed||!e.autoplay.running)return;e.autoplay.paused?b=!0:b&&(g=n,b=!1);const t=e.autoplay.paused?n:f+g-new Date().getTime();e.autoplay.timeLeft=t,r("autoplayTimeLeft",t,t/w),E=requestAnimationFrame(()=>{O()})},B=()=>{let t;return e.virtual&&e.params.virtual.enabled?t=e.slides.filter(a=>a.classList.contains("swiper-slide-active"))[0]:t=e.slides[e.activeIndex],t?parseInt(t.getAttribute("data-swiper-autoplay"),10):void 0},T=t=>{if(e.destroyed||!e.autoplay.running)return;cancelAnimationFrame(E),O();let i=typeof t>"u"?e.params.autoplay.delay:t;w=e.params.autoplay.delay,g=e.params.autoplay.delay;const a=B();!Number.isNaN(a)&&a>0&&typeof t>"u"&&(i=a,w=a,g=a),n=i;const c=e.params.speed,N=()=>{!e||e.destroyed||(e.params.autoplay.reverseDirection?!e.isBeginning||e.params.loop||e.params.rewind?(e.slidePrev(c,!0,!0),r("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(e.slides.length-1,c,!0,!0),r("autoplay")):!e.isEnd||e.params.loop||e.params.rewind?(e.slideNext(c,!0,!0),r("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(0,c,!0,!0),r("autoplay")),e.params.cssMode&&(f=new Date().getTime(),requestAnimationFrame(()=>{T()})))};return i>0?(clearTimeout(y),y=setTimeout(()=>{N()},i)):requestAnimationFrame(()=>{N()}),i},I=()=>{f=new Date().getTime(),e.autoplay.running=!0,T(),r("autoplayStart")},m=()=>{e.autoplay.running=!1,clearTimeout(y),cancelAnimationFrame(E),r("autoplayStop")},d=(t,i)=>{if(e.destroyed||!e.autoplay.running)return;clearTimeout(y),t||(o=!0);const a=()=>{r("autoplayPause"),e.params.autoplay.waitForTransition?e.wrapperEl.addEventListener("transitionend",M):l()};if(e.autoplay.paused=!0,i){L&&(n=e.params.autoplay.delay),L=!1,a();return}n=(n||e.params.autoplay.delay)-(new Date().getTime()-f),!(e.isEnd&&n<0&&!e.params.loop)&&(n<0&&(n=0),a())},l=()=>{e.isEnd&&n<0&&!e.params.loop||e.destroyed||!e.autoplay.running||(f=new Date().getTime(),o?(o=!1,T(n)):T(),e.autoplay.paused=!1,r("autoplayResume"))},A=()=>{if(e.destroyed||!e.autoplay.running)return;const t=h.g();t.visibilityState==="hidden"&&(o=!0,d(!0)),t.visibilityState==="visible"&&l()},P=t=>{t.pointerType==="mouse"&&(o=!0,S=!0,!(e.animating||e.autoplay.paused)&&d(!0))},F=t=>{t.pointerType==="mouse"&&(S=!1,e.autoplay.paused&&l())},C=()=>{e.params.autoplay.pauseOnMouseEnter&&(e.el.addEventListener("pointerenter",P),e.el.addEventListener("pointerleave",F))},_=()=>{e.el&&typeof e.el!="string"&&(e.el.removeEventListener("pointerenter",P),e.el.removeEventListener("pointerleave",F))},R=()=>{h.g().addEventListener("visibilitychange",A)},j=()=>{h.g().removeEventListener("visibilitychange",A)};s("init",()=>{e.params.autoplay.enabled&&(C(),R(),I())}),s("destroy",()=>{_(),j(),e.autoplay.running&&m()}),s("_freeModeStaticRelease",()=>{(p||o)&&l()}),s("_freeModeNoMomentumRelease",()=>{e.params.autoplay.disableOnInteraction?m():d(!0,!0)}),s("beforeTransitionStart",(t,i,a)=>{e.destroyed||!e.autoplay.running||(a||!e.params.autoplay.disableOnInteraction?d(!0,!0):m())}),s("sliderFirstMove",()=>{if(!(e.destroyed||!e.autoplay.running)){if(e.params.autoplay.disableOnInteraction){m();return}v=!0,p=!1,o=!1,D=setTimeout(()=>{o=!0,p=!0,d(!0)},200)}}),s("touchEnd",()=>{if(!(e.destroyed||!e.autoplay.running||!v)){if(clearTimeout(D),clearTimeout(y),e.params.autoplay.disableOnInteraction){p=!1,v=!1;return}p&&e.params.cssMode&&l(),p=!1,v=!1}}),s("slideChange",()=>{e.destroyed||!e.autoplay.running||(L=!0)}),Object.assign(e.autoplay,{start:I,stop:m,pause:d,resume:l})}module.exports=V;
package/index210.mjs CHANGED
@@ -1,227 +1,129 @@
1
- import { c as $ } from "./index309.mjs";
2
- import { c as F } from "./index308.mjs";
3
- import { m, f as E, h as S, a as T } from "./index307.mjs";
4
- function N(I) {
1
+ import { g as S } from "./index285.mjs";
2
+ function k(x) {
5
3
  let {
6
4
  swiper: e,
7
- extendParams: H,
8
- on: g,
9
- emit: v
10
- } = I;
11
- const d = "swiper-pagination";
12
- H({
13
- pagination: {
14
- el: null,
15
- bulletElement: "span",
16
- clickable: !1,
17
- hideOnClick: !1,
18
- renderBullet: null,
19
- renderProgressbar: null,
20
- renderFraction: null,
21
- renderCustom: null,
22
- progressbarOpposite: !1,
23
- type: "bullets",
24
- // 'bullets' or 'progressbar' or 'fraction' or 'custom'
25
- dynamicBullets: !1,
26
- dynamicMainBullets: 1,
27
- formatFractionCurrent: (a) => a,
28
- formatFractionTotal: (a) => a,
29
- bulletClass: `${d}-bullet`,
30
- bulletActiveClass: `${d}-bullet-active`,
31
- modifierClass: `${d}-`,
32
- currentClass: `${d}-current`,
33
- totalClass: `${d}-total`,
34
- hiddenClass: `${d}-hidden`,
35
- progressbarFillClass: `${d}-progressbar-fill`,
36
- progressbarOppositeClass: `${d}-progressbar-opposite`,
37
- clickableClass: `${d}-clickable`,
38
- lockClass: `${d}-lock`,
39
- horizontalClass: `${d}-horizontal`,
40
- verticalClass: `${d}-vertical`,
41
- paginationDisabledClass: `${d}-disabled`
5
+ extendParams: B,
6
+ on: s,
7
+ emit: r,
8
+ params: u
9
+ } = x;
10
+ e.autoplay = {
11
+ running: !1,
12
+ paused: !1,
13
+ timeLeft: 0
14
+ }, B({
15
+ autoplay: {
16
+ enabled: !1,
17
+ delay: 3e3,
18
+ waitForTransition: !0,
19
+ disableOnInteraction: !1,
20
+ stopOnLastSlide: !1,
21
+ reverseDirection: !1,
22
+ pauseOnMouseEnter: !1
42
23
  }
43
- }), e.pagination = {
44
- el: null,
45
- bullets: []
46
- };
47
- let b, u = 0;
48
- function k() {
49
- return !e.params.pagination.el || !e.pagination.el || Array.isArray(e.pagination.el) && e.pagination.el.length === 0;
50
- }
51
- function x(a, s) {
52
- const {
53
- bulletActiveClass: i
54
- } = e.params.pagination;
55
- a && (a = a[`${s === "prev" ? "previous" : "next"}ElementSibling`], a && (a.classList.add(`${i}-${s}`), a = a[`${s === "prev" ? "previous" : "next"}ElementSibling`], a && a.classList.add(`${i}-${s}-${s}`)));
56
- }
57
- function O(a, s, i) {
58
- if (a = a % i, s = s % i, s === a + 1)
59
- return "next";
60
- if (s === a - 1)
61
- return "previous";
24
+ });
25
+ let y, E, b = u && u.autoplay ? u.autoplay.delay : 3e3, g = u && u.autoplay ? u.autoplay.delay : 3e3, n, f = (/* @__PURE__ */ new Date()).getTime(), w, v, p, h, L, o, D;
26
+ function M(t) {
27
+ !e || e.destroyed || !e.wrapperEl || t.target === e.wrapperEl && (e.wrapperEl.removeEventListener("transitionend", M), !(D || t.detail && t.detail.bySwiperTouchMove) && l());
62
28
  }
63
- function D(a) {
64
- const s = a.target.closest($(e.params.pagination.bulletClass));
65
- if (!s)
29
+ const O = () => {
30
+ if (e.destroyed || !e.autoplay.running) return;
31
+ e.autoplay.paused ? w = !0 : w && (g = n, w = !1);
32
+ const t = e.autoplay.paused ? n : f + g - (/* @__PURE__ */ new Date()).getTime();
33
+ e.autoplay.timeLeft = t, r("autoplayTimeLeft", t, t / b), E = requestAnimationFrame(() => {
34
+ O();
35
+ });
36
+ }, C = () => {
37
+ let t;
38
+ return e.virtual && e.params.virtual.enabled ? t = e.slides.filter((a) => a.classList.contains("swiper-slide-active"))[0] : t = e.slides[e.activeIndex], t ? parseInt(t.getAttribute("data-swiper-autoplay"), 10) : void 0;
39
+ }, T = (t) => {
40
+ if (e.destroyed || !e.autoplay.running) return;
41
+ cancelAnimationFrame(E), O();
42
+ let i = typeof t > "u" ? e.params.autoplay.delay : t;
43
+ b = e.params.autoplay.delay, g = e.params.autoplay.delay;
44
+ const a = C();
45
+ !Number.isNaN(a) && a > 0 && typeof t > "u" && (i = a, b = a, g = a), n = i;
46
+ const c = e.params.speed, N = () => {
47
+ !e || e.destroyed || (e.params.autoplay.reverseDirection ? !e.isBeginning || e.params.loop || e.params.rewind ? (e.slidePrev(c, !0, !0), r("autoplay")) : e.params.autoplay.stopOnLastSlide || (e.slideTo(e.slides.length - 1, c, !0, !0), r("autoplay")) : !e.isEnd || e.params.loop || e.params.rewind ? (e.slideNext(c, !0, !0), r("autoplay")) : e.params.autoplay.stopOnLastSlide || (e.slideTo(0, c, !0, !0), r("autoplay")), e.params.cssMode && (f = (/* @__PURE__ */ new Date()).getTime(), requestAnimationFrame(() => {
48
+ T();
49
+ })));
50
+ };
51
+ return i > 0 ? (clearTimeout(y), y = setTimeout(() => {
52
+ N();
53
+ }, i)) : requestAnimationFrame(() => {
54
+ N();
55
+ }), i;
56
+ }, I = () => {
57
+ f = (/* @__PURE__ */ new Date()).getTime(), e.autoplay.running = !0, T(), r("autoplayStart");
58
+ }, m = () => {
59
+ e.autoplay.running = !1, clearTimeout(y), cancelAnimationFrame(E), r("autoplayStop");
60
+ }, d = (t, i) => {
61
+ if (e.destroyed || !e.autoplay.running) return;
62
+ clearTimeout(y), t || (o = !0);
63
+ const a = () => {
64
+ r("autoplayPause"), e.params.autoplay.waitForTransition ? e.wrapperEl.addEventListener("transitionend", M) : l();
65
+ };
66
+ if (e.autoplay.paused = !0, i) {
67
+ L && (n = e.params.autoplay.delay), L = !1, a();
66
68
  return;
67
- a.preventDefault();
68
- const i = S(s) * e.params.slidesPerGroup;
69
- if (e.params.loop) {
70
- if (e.realIndex === i) return;
71
- const t = O(e.realIndex, i, e.slides.length);
72
- t === "next" ? e.slideNext() : t === "previous" ? e.slidePrev() : e.slideToLoop(i);
73
- } else
74
- e.slideTo(i);
75
- }
76
- function h() {
77
- const a = e.rtl, s = e.params.pagination;
78
- if (k()) return;
79
- let i = e.pagination.el;
80
- i = m(i);
81
- let t, p;
82
- const C = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.slides.length, z = e.params.loop ? Math.ceil(C / e.params.slidesPerGroup) : e.snapGrid.length;
83
- if (e.params.loop ? (p = e.previousRealIndex || 0, t = e.params.slidesPerGroup > 1 ? Math.floor(e.realIndex / e.params.slidesPerGroup) : e.realIndex) : typeof e.snapIndex < "u" ? (t = e.snapIndex, p = e.previousSnapIndex) : (p = e.previousIndex || 0, t = e.activeIndex || 0), s.type === "bullets" && e.pagination.bullets && e.pagination.bullets.length > 0) {
84
- const l = e.pagination.bullets;
85
- let f, c, L;
86
- if (s.dynamicBullets && (b = E(l[0], e.isHorizontal() ? "width" : "height"), i.forEach((n) => {
87
- n.style[e.isHorizontal() ? "width" : "height"] = `${b * (s.dynamicMainBullets + 4)}px`;
88
- }), s.dynamicMainBullets > 1 && p !== void 0 && (u += t - (p || 0), u > s.dynamicMainBullets - 1 ? u = s.dynamicMainBullets - 1 : u < 0 && (u = 0)), f = Math.max(t - u, 0), c = f + (Math.min(l.length, s.dynamicMainBullets) - 1), L = (c + f) / 2), l.forEach((n) => {
89
- const r = [...["", "-next", "-next-next", "-prev", "-prev-prev", "-main"].map((o) => `${s.bulletActiveClass}${o}`)].map((o) => typeof o == "string" && o.includes(" ") ? o.split(" ") : o).flat();
90
- n.classList.remove(...r);
91
- }), i.length > 1)
92
- l.forEach((n) => {
93
- const r = S(n);
94
- r === t ? n.classList.add(...s.bulletActiveClass.split(" ")) : e.isElement && n.setAttribute("part", "bullet"), s.dynamicBullets && (r >= f && r <= c && n.classList.add(...`${s.bulletActiveClass}-main`.split(" ")), r === f && x(n, "prev"), r === c && x(n, "next"));
95
- });
96
- else {
97
- const n = l[t];
98
- if (n && n.classList.add(...s.bulletActiveClass.split(" ")), e.isElement && l.forEach((r, o) => {
99
- r.setAttribute("part", o === t ? "bullet-active" : "bullet");
100
- }), s.dynamicBullets) {
101
- const r = l[f], o = l[c];
102
- for (let y = f; y <= c; y += 1)
103
- l[y] && l[y].classList.add(...`${s.bulletActiveClass}-main`.split(" "));
104
- x(r, "prev"), x(o, "next");
105
- }
106
- }
107
- if (s.dynamicBullets) {
108
- const n = Math.min(l.length, s.dynamicMainBullets + 4), r = (b * n - b) / 2 - L * b, o = a ? "right" : "left";
109
- l.forEach((y) => {
110
- y.style[e.isHorizontal() ? o : "top"] = `${r}px`;
111
- });
112
- }
113
69
  }
114
- i.forEach((l, f) => {
115
- if (s.type === "fraction" && (l.querySelectorAll($(s.currentClass)).forEach((c) => {
116
- c.textContent = s.formatFractionCurrent(t + 1);
117
- }), l.querySelectorAll($(s.totalClass)).forEach((c) => {
118
- c.textContent = s.formatFractionTotal(z);
119
- })), s.type === "progressbar") {
120
- let c;
121
- s.progressbarOpposite ? c = e.isHorizontal() ? "vertical" : "horizontal" : c = e.isHorizontal() ? "horizontal" : "vertical";
122
- const L = (t + 1) / z;
123
- let n = 1, r = 1;
124
- c === "horizontal" ? n = L : r = L, l.querySelectorAll($(s.progressbarFillClass)).forEach((o) => {
125
- o.style.transform = `translate3d(0,0,0) scaleX(${n}) scaleY(${r})`, o.style.transitionDuration = `${e.params.speed}ms`;
126
- });
70
+ n = (n || e.params.autoplay.delay) - ((/* @__PURE__ */ new Date()).getTime() - f), !(e.isEnd && n < 0 && !e.params.loop) && (n < 0 && (n = 0), a());
71
+ }, l = () => {
72
+ e.isEnd && n < 0 && !e.params.loop || e.destroyed || !e.autoplay.running || (f = (/* @__PURE__ */ new Date()).getTime(), o ? (o = !1, T(n)) : T(), e.autoplay.paused = !1, r("autoplayResume"));
73
+ }, A = () => {
74
+ if (e.destroyed || !e.autoplay.running) return;
75
+ const t = S();
76
+ t.visibilityState === "hidden" && (o = !0, d(!0)), t.visibilityState === "visible" && l();
77
+ }, P = (t) => {
78
+ t.pointerType === "mouse" && (o = !0, D = !0, !(e.animating || e.autoplay.paused) && d(!0));
79
+ }, F = (t) => {
80
+ t.pointerType === "mouse" && (D = !1, e.autoplay.paused && l());
81
+ }, q = () => {
82
+ e.params.autoplay.pauseOnMouseEnter && (e.el.addEventListener("pointerenter", P), e.el.addEventListener("pointerleave", F));
83
+ }, R = () => {
84
+ e.el && typeof e.el != "string" && (e.el.removeEventListener("pointerenter", P), e.el.removeEventListener("pointerleave", F));
85
+ }, _ = () => {
86
+ S().addEventListener("visibilitychange", A);
87
+ }, j = () => {
88
+ S().removeEventListener("visibilitychange", A);
89
+ };
90
+ s("init", () => {
91
+ e.params.autoplay.enabled && (q(), _(), I());
92
+ }), s("destroy", () => {
93
+ R(), j(), e.autoplay.running && m();
94
+ }), s("_freeModeStaticRelease", () => {
95
+ (p || o) && l();
96
+ }), s("_freeModeNoMomentumRelease", () => {
97
+ e.params.autoplay.disableOnInteraction ? m() : d(!0, !0);
98
+ }), s("beforeTransitionStart", (t, i, a) => {
99
+ e.destroyed || !e.autoplay.running || (a || !e.params.autoplay.disableOnInteraction ? d(!0, !0) : m());
100
+ }), s("sliderFirstMove", () => {
101
+ if (!(e.destroyed || !e.autoplay.running)) {
102
+ if (e.params.autoplay.disableOnInteraction) {
103
+ m();
104
+ return;
127
105
  }
128
- s.type === "custom" && s.renderCustom ? (l.innerHTML = s.renderCustom(e, t + 1, z), f === 0 && v("paginationRender", l)) : (f === 0 && v("paginationRender", l), v("paginationUpdate", l)), e.params.watchOverflow && e.enabled && l.classList[e.isLocked ? "add" : "remove"](s.lockClass);
129
- });
130
- }
131
- function B() {
132
- const a = e.params.pagination;
133
- if (k()) return;
134
- const s = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.grid && e.params.grid.rows > 1 ? e.slides.length / Math.ceil(e.params.grid.rows) : e.slides.length;
135
- let i = e.pagination.el;
136
- i = m(i);
137
- let t = "";
138
- if (a.type === "bullets") {
139
- let p = e.params.loop ? Math.ceil(s / e.params.slidesPerGroup) : e.snapGrid.length;
140
- e.params.freeMode && e.params.freeMode.enabled && p > s && (p = s);
141
- for (let C = 0; C < p; C += 1)
142
- a.renderBullet ? t += a.renderBullet.call(e, C, a.bulletClass) : t += `<${a.bulletElement} ${e.isElement ? 'part="bullet"' : ""} class="${a.bulletClass}"></${a.bulletElement}>`;
106
+ v = !0, p = !1, o = !1, h = setTimeout(() => {
107
+ o = !0, p = !0, d(!0);
108
+ }, 200);
143
109
  }
144
- a.type === "fraction" && (a.renderFraction ? t = a.renderFraction.call(e, a.currentClass, a.totalClass) : t = `<span class="${a.currentClass}"></span> / <span class="${a.totalClass}"></span>`), a.type === "progressbar" && (a.renderProgressbar ? t = a.renderProgressbar.call(e, a.progressbarFillClass) : t = `<span class="${a.progressbarFillClass}"></span>`), e.pagination.bullets = [], i.forEach((p) => {
145
- a.type !== "custom" && (p.innerHTML = t || ""), a.type === "bullets" && e.pagination.bullets.push(...p.querySelectorAll($(a.bulletClass)));
146
- }), a.type !== "custom" && v("paginationRender", i[0]);
147
- }
148
- function A() {
149
- e.params.pagination = F(e, e.originalParams.pagination, e.params.pagination, {
150
- el: "swiper-pagination"
151
- });
152
- const a = e.params.pagination;
153
- if (!a.el) return;
154
- let s;
155
- typeof a.el == "string" && e.isElement && (s = e.el.querySelector(a.el)), !s && typeof a.el == "string" && (s = [...document.querySelectorAll(a.el)]), s || (s = a.el), !(!s || s.length === 0) && (e.params.uniqueNavElements && typeof a.el == "string" && Array.isArray(s) && s.length > 1 && (s = [...e.el.querySelectorAll(a.el)], s.length > 1 && (s = s.filter((i) => T(i, ".swiper")[0] === e.el)[0])), Array.isArray(s) && s.length === 1 && (s = s[0]), Object.assign(e.pagination, {
156
- el: s
157
- }), s = m(s), s.forEach((i) => {
158
- a.type === "bullets" && a.clickable && i.classList.add(...(a.clickableClass || "").split(" ")), i.classList.add(a.modifierClass + a.type), i.classList.add(e.isHorizontal() ? a.horizontalClass : a.verticalClass), a.type === "bullets" && a.dynamicBullets && (i.classList.add(`${a.modifierClass}${a.type}-dynamic`), u = 0, a.dynamicMainBullets < 1 && (a.dynamicMainBullets = 1)), a.type === "progressbar" && a.progressbarOpposite && i.classList.add(a.progressbarOppositeClass), a.clickable && i.addEventListener("click", D), e.enabled || i.classList.add(a.lockClass);
159
- }));
160
- }
161
- function M() {
162
- const a = e.params.pagination;
163
- if (k()) return;
164
- let s = e.pagination.el;
165
- s && (s = m(s), s.forEach((i) => {
166
- i.classList.remove(a.hiddenClass), i.classList.remove(a.modifierClass + a.type), i.classList.remove(e.isHorizontal() ? a.horizontalClass : a.verticalClass), a.clickable && (i.classList.remove(...(a.clickableClass || "").split(" ")), i.removeEventListener("click", D));
167
- })), e.pagination.bullets && e.pagination.bullets.forEach((i) => i.classList.remove(...a.bulletActiveClass.split(" ")));
168
- }
169
- g("changeDirection", () => {
170
- if (!e.pagination || !e.pagination.el) return;
171
- const a = e.params.pagination;
172
- let {
173
- el: s
174
- } = e.pagination;
175
- s = m(s), s.forEach((i) => {
176
- i.classList.remove(a.horizontalClass, a.verticalClass), i.classList.add(e.isHorizontal() ? a.horizontalClass : a.verticalClass);
177
- });
178
- }), g("init", () => {
179
- e.params.pagination.enabled === !1 ? P() : (A(), B(), h());
180
- }), g("activeIndexChange", () => {
181
- typeof e.snapIndex > "u" && h();
182
- }), g("snapIndexChange", () => {
183
- h();
184
- }), g("snapGridLengthChange", () => {
185
- B(), h();
186
- }), g("destroy", () => {
187
- M();
188
- }), g("enable disable", () => {
189
- let {
190
- el: a
191
- } = e.pagination;
192
- a && (a = m(a), a.forEach((s) => s.classList[e.enabled ? "remove" : "add"](e.params.pagination.lockClass)));
193
- }), g("lock unlock", () => {
194
- h();
195
- }), g("click", (a, s) => {
196
- const i = s.target, t = m(e.pagination.el);
197
- if (e.params.pagination.el && e.params.pagination.hideOnClick && t && t.length > 0 && !i.classList.contains(e.params.pagination.bulletClass)) {
198
- if (e.navigation && (e.navigation.nextEl && i === e.navigation.nextEl || e.navigation.prevEl && i === e.navigation.prevEl)) return;
199
- const p = t[0].classList.contains(e.params.pagination.hiddenClass);
200
- v(p === !0 ? "paginationShow" : "paginationHide"), t.forEach((C) => C.classList.toggle(e.params.pagination.hiddenClass));
110
+ }), s("touchEnd", () => {
111
+ if (!(e.destroyed || !e.autoplay.running || !v)) {
112
+ if (clearTimeout(h), clearTimeout(y), e.params.autoplay.disableOnInteraction) {
113
+ p = !1, v = !1;
114
+ return;
115
+ }
116
+ p && e.params.cssMode && l(), p = !1, v = !1;
201
117
  }
202
- });
203
- const w = () => {
204
- e.el.classList.remove(e.params.pagination.paginationDisabledClass);
205
- let {
206
- el: a
207
- } = e.pagination;
208
- a && (a = m(a), a.forEach((s) => s.classList.remove(e.params.pagination.paginationDisabledClass))), A(), B(), h();
209
- }, P = () => {
210
- e.el.classList.add(e.params.pagination.paginationDisabledClass);
211
- let {
212
- el: a
213
- } = e.pagination;
214
- a && (a = m(a), a.forEach((s) => s.classList.add(e.params.pagination.paginationDisabledClass))), M();
215
- };
216
- Object.assign(e.pagination, {
217
- enable: w,
218
- disable: P,
219
- render: B,
220
- update: h,
221
- init: A,
222
- destroy: M
118
+ }), s("slideChange", () => {
119
+ e.destroyed || !e.autoplay.running || (L = !0);
120
+ }), Object.assign(e.autoplay, {
121
+ start: I,
122
+ stop: m,
123
+ pause: d,
124
+ resume: l
223
125
  });
224
126
  }
225
127
  export {
226
- N as default
128
+ k as default
227
129
  };