@okam/stack-ui 1.30.0 → 1.30.1
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/components/Popover/index.d.ts +3 -1
- package/index.js +1 -1
- package/index10.js +1 -1
- package/index10.mjs +1 -0
- package/index102.js +1 -1
- package/index102.mjs +3 -3
- package/index103.js +1 -1
- package/index103.mjs +1 -1
- package/index110.js +1 -1
- package/index110.mjs +2 -2
- package/index116.js +1 -1
- package/index116.mjs +9 -9
- package/index117.js +1 -1
- package/index117.mjs +9 -9
- package/index121.js +1 -1
- package/index121.mjs +2 -2
- package/index127.js +1 -1
- package/index127.mjs +46 -12
- package/index128.js +1 -1
- package/index128.mjs +241 -46
- package/index129.js +2 -1
- package/index129.mjs +13 -241
- package/index13.js +1 -1
- package/index13.mjs +9 -8
- package/index130.js +1 -2
- package/index130.mjs +29 -12
- package/index131.js +1 -1
- package/index131.mjs +11 -29
- package/index132.js +1 -1
- package/index132.mjs +2 -2
- package/index135.js +1 -1
- package/index135.mjs +196 -58
- package/index136.js +1 -1
- package/index136.mjs +60 -90
- package/index137.js +1 -1
- package/index137.mjs +140 -32
- package/index138.js +1 -1
- package/index138.mjs +114 -116
- package/index139.js +1 -1
- package/index139.mjs +217 -27
- package/index140.js +1 -1
- package/index140.mjs +188 -122
- package/index141.js +1 -1
- package/index141.mjs +67 -132
- package/index142.js +1 -1
- package/index142.mjs +258 -14
- package/index143.js +1 -1
- package/index143.mjs +92 -90
- package/index144.js +1 -1
- package/index144.mjs +172 -104
- package/index145.js +1 -1
- package/index145.mjs +84 -5
- package/index146.js +1 -1
- package/index146.mjs +58 -3
- package/index147.js +1 -1
- package/index147.mjs +123 -122
- package/index148.js +1 -1
- package/index148.mjs +113 -26
- package/index149.js +1 -1
- package/index149.mjs +119 -48
- package/index150.js +1 -1
- package/index150.mjs +72 -44
- package/index151.js +1 -1
- package/index151.mjs +107 -34
- package/index152.js +1 -1
- package/index152.mjs +50 -111
- package/index153.js +1 -1
- package/index153.mjs +93 -77
- package/index154.js +1 -1
- package/index154.mjs +70 -101
- package/index155.js +1 -1
- package/index155.mjs +57 -98
- package/index156.js +1 -1
- package/index156.mjs +92 -192
- package/index157.js +5 -1
- package/index157.mjs +75 -59
- package/index158.js +1 -1
- package/index158.mjs +1995 -125
- package/index159.js +1 -1
- package/index159.mjs +56 -116
- package/index160.js +1 -1
- package/index160.mjs +185 -214
- package/index161.js +1 -1
- package/index161.mjs +58 -187
- package/index162.js +1 -1
- package/index162.mjs +89 -64
- package/index163.js +1 -1
- package/index163.mjs +32 -257
- package/index164.js +1 -1
- package/index164.mjs +117 -93
- package/index165.js +1 -1
- package/index165.mjs +27 -174
- package/index166.js +1 -1
- package/index166.mjs +123 -83
- package/index167.js +1 -1
- package/index167.mjs +132 -56
- package/index168.js +1 -1
- package/index168.mjs +14 -126
- package/index169.js +1 -1
- package/index169.mjs +92 -113
- package/index170.js +1 -1
- package/index170.mjs +103 -119
- package/index171.js +1 -1
- package/index171.mjs +5 -72
- package/index172.js +1 -1
- package/index172.mjs +3 -110
- package/index173.js +1 -1
- package/index173.mjs +124 -51
- package/index174.js +1 -1
- package/index174.mjs +29 -93
- package/index175.js +1 -1
- package/index175.mjs +51 -70
- package/index176.js +1 -1
- package/index176.mjs +44 -56
- package/index177.js +1 -1
- package/index177.mjs +36 -98
- package/index178.js +1 -5
- package/index178.mjs +111 -78
- package/index179.js +1 -1
- package/index179.mjs +74 -2008
- package/index180.js +1 -1
- package/index180.mjs +99 -57
- package/index181.js +1 -1
- package/index181.mjs +98 -189
- package/index182.js +1 -1
- package/index182.mjs +130 -5
- package/index183.js +1 -1
- package/index183.mjs +172 -123
- package/index184.js +1 -1
- package/index184.mjs +8 -178
- package/index185.js +1 -1
- package/index185.mjs +3 -9
- package/index186.js +1 -1
- package/index186.mjs +36 -3
- package/index187.js +1 -1
- package/index187.mjs +5 -36
- package/index188.js +1 -1
- package/index188.mjs +29 -5
- package/index189.js +1 -1
- package/index189.mjs +6 -29
- package/index190.js +1 -1
- package/index190.mjs +5 -6
- package/index191.js +1 -1
- package/index191.mjs +1 -1
- package/index2.js +1 -1
- package/index2.mjs +44 -43
- package/index23.js +1 -1
- package/index23.mjs +39 -38
- package/index24.js +1 -1
- package/index24.mjs +40 -39
- package/index6.js +1 -1
- package/index6.mjs +34 -34
- package/index88.js +1 -1
- package/index88.mjs +16 -13
- package/index98.js +1 -1
- package/index98.mjs +3 -3
- package/index99.js +1 -1
- package/index99.mjs +1 -1
- package/package.json +1 -1
- package/theme/DatePicker/index.d.ts +3 -2
package/index138.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const k=require("./index184.js"),l=require("./index183.js");function w(h){let{swiper:a,extendParams:x,on:r,emit:d}=h;x({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),a.navigation={nextEl:null,prevEl:null};function m(i){let n;return i&&typeof i=="string"&&a.isElement&&(n=a.el.querySelector(i),n)?n:(i&&(typeof i=="string"&&(n=[...document.querySelectorAll(i)]),a.params.uniqueNavElements&&typeof i=="string"&&n.length>1&&a.el.querySelectorAll(i).length===1&&(n=a.el.querySelector(i))),i&&!n?i:n)}function p(i,n){const t=a.params.navigation;i=l.m(i),i.forEach(e=>{e&&(e.classList[n?"add":"remove"](...t.disabledClass.split(" ")),e.tagName==="BUTTON"&&(e.disabled=n),a.params.watchOverflow&&a.enabled&&e.classList[a.isLocked?"add":"remove"](t.lockClass))})}function o(){const{nextEl:i,prevEl:n}=a.navigation;if(a.params.loop){p(n,!1),p(i,!1);return}p(n,a.isBeginning&&!a.params.rewind),p(i,a.isEnd&&!a.params.rewind)}function u(i){i.preventDefault(),!(a.isBeginning&&!a.params.loop&&!a.params.rewind)&&(a.slidePrev(),d("navigationPrev"))}function E(i){i.preventDefault(),!(a.isEnd&&!a.params.loop&&!a.params.rewind)&&(a.slideNext(),d("navigationNext"))}function g(){const i=a.params.navigation;if(a.params.navigation=k.c(a,a.originalParams.navigation,a.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!(i.nextEl||i.prevEl))return;let n=m(i.nextEl),t=m(i.prevEl);Object.assign(a.navigation,{nextEl:n,prevEl:t}),n=l.m(n),t=l.m(t);const e=(s,c)=>{s&&s.addEventListener("click",c==="next"?E:u),!a.enabled&&s&&s.classList.add(...i.lockClass.split(" "))};n.forEach(s=>e(s,"next")),t.forEach(s=>e(s,"prev"))}function v(){let{nextEl:i,prevEl:n}=a.navigation;i=l.m(i),n=l.m(n);const t=(e,s)=>{e.removeEventListener("click",s==="next"?E:u),e.classList.remove(...a.params.navigation.disabledClass.split(" "))};i.forEach(e=>t(e,"next")),n.forEach(e=>t(e,"prev"))}r("init",()=>{a.params.navigation.enabled===!1?b():(g(),o())}),r("toEdge fromEdge lock unlock",()=>{o()}),r("destroy",()=>{v()}),r("enable disable",()=>{let{nextEl:i,prevEl:n}=a.navigation;if(i=l.m(i),n=l.m(n),a.enabled){o();return}[...i,...n].filter(t=>!!t).forEach(t=>t.classList.add(a.params.navigation.lockClass))}),r("click",(i,n)=>{let{nextEl:t,prevEl:e}=a.navigation;t=l.m(t),e=l.m(e);const s=n.target;if(a.params.navigation.hideOnClick&&!e.includes(s)&&!t.includes(s)){if(a.pagination&&a.params.pagination&&a.params.pagination.clickable&&(a.pagination.el===s||a.pagination.el.contains(s)))return;let c;t.length?c=t[0].classList.contains(a.params.navigation.hiddenClass):e.length&&(c=e[0].classList.contains(a.params.navigation.hiddenClass)),d(c===!0?"navigationShow":"navigationHide"),[...t,...e].filter(f=>!!f).forEach(f=>f.classList.toggle(a.params.navigation.hiddenClass))}});const C=()=>{a.el.classList.remove(...a.params.navigation.navigationDisabledClass.split(" ")),g(),o()},b=()=>{a.el.classList.add(...a.params.navigation.navigationDisabledClass.split(" ")),v()};Object.assign(a.navigation,{enable:C,disable:b,update:o,init:g,destroy:v})}module.exports=w;
|
package/index138.mjs
CHANGED
|
@@ -1,124 +1,122 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
isInvalid: !1,
|
|
20
|
-
validationDetails: D,
|
|
21
|
-
validationErrors: []
|
|
22
|
-
}, B = O({}), h = "__formValidationState" + Date.now();
|
|
23
|
-
function P(a) {
|
|
24
|
-
if (a[h]) {
|
|
25
|
-
let { realtimeValidation: e, displayValidation: t, updateValidation: i, resetValidation: o, commitValidation: l } = a[h];
|
|
26
|
-
return {
|
|
27
|
-
realtimeValidation: e,
|
|
28
|
-
displayValidation: t,
|
|
29
|
-
updateValidation: i,
|
|
30
|
-
resetValidation: o,
|
|
31
|
-
commitValidation: l
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
return Q(a);
|
|
35
|
-
}
|
|
36
|
-
function Q(a) {
|
|
37
|
-
let { isInvalid: e, validationState: t, name: i, value: o, builtinValidation: l, validate: d, validationBehavior: n = "aria" } = a;
|
|
38
|
-
t && (e || (e = t === "invalid"));
|
|
39
|
-
let v = e !== void 0 ? {
|
|
40
|
-
isInvalid: e,
|
|
41
|
-
validationErrors: [],
|
|
42
|
-
validationDetails: L
|
|
43
|
-
} : null, V = I(() => C(Y(d, o)), [
|
|
44
|
-
d,
|
|
45
|
-
o
|
|
46
|
-
]);
|
|
47
|
-
l != null && l.validationDetails.valid && (l = null);
|
|
48
|
-
let s = U(B), A = I(() => i ? Array.isArray(i) ? i.flatMap((r) => S(s[r])) : S(s[i]) : [], [
|
|
49
|
-
s,
|
|
50
|
-
i
|
|
51
|
-
]), [M, _] = f(s), [x, m] = f(!1);
|
|
52
|
-
s !== M && (_(s), m(!1));
|
|
53
|
-
let $ = I(() => C(x ? [] : A), [
|
|
54
|
-
x,
|
|
55
|
-
A
|
|
56
|
-
]), g = T(c), [b, E] = f(c), u = T(c), w = () => {
|
|
57
|
-
if (!F) return;
|
|
58
|
-
p(!1);
|
|
59
|
-
let r = V || l || g.current;
|
|
60
|
-
y(r, u.current) || (u.current = r, E(r));
|
|
61
|
-
}, [F, p] = f(!1);
|
|
62
|
-
return R(w), {
|
|
63
|
-
realtimeValidation: v || $ || V || l || c,
|
|
64
|
-
displayValidation: n === "native" ? v || $ || b : v || $ || V || l || b,
|
|
65
|
-
updateValidation(r) {
|
|
66
|
-
n === "aria" && !y(b, r) ? E(r) : g.current = r;
|
|
67
|
-
},
|
|
68
|
-
resetValidation() {
|
|
69
|
-
let r = c;
|
|
70
|
-
y(r, u.current) || (u.current = r, E(r)), n === "native" && p(!1), m(!0);
|
|
71
|
-
},
|
|
72
|
-
commitValidation() {
|
|
73
|
-
n === "native" && p(!0), m(!0);
|
|
1
|
+
import { c as k } from "./index184.mjs";
|
|
2
|
+
import { m as l } from "./index183.mjs";
|
|
3
|
+
function y(h) {
|
|
4
|
+
let {
|
|
5
|
+
swiper: a,
|
|
6
|
+
extendParams: x,
|
|
7
|
+
on: r,
|
|
8
|
+
emit: p
|
|
9
|
+
} = h;
|
|
10
|
+
x({
|
|
11
|
+
navigation: {
|
|
12
|
+
nextEl: null,
|
|
13
|
+
prevEl: null,
|
|
14
|
+
hideOnClick: !1,
|
|
15
|
+
disabledClass: "swiper-button-disabled",
|
|
16
|
+
hiddenClass: "swiper-button-hidden",
|
|
17
|
+
lockClass: "swiper-button-lock",
|
|
18
|
+
navigationDisabledClass: "swiper-navigation-disabled"
|
|
74
19
|
}
|
|
20
|
+
}), a.navigation = {
|
|
21
|
+
nextEl: null,
|
|
22
|
+
prevEl: null
|
|
75
23
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
a
|
|
80
|
-
] : [];
|
|
81
|
-
}
|
|
82
|
-
function Y(a, e) {
|
|
83
|
-
if (typeof a == "function") {
|
|
84
|
-
let t = a(e);
|
|
85
|
-
if (t && typeof t != "boolean") return S(t);
|
|
24
|
+
function m(i) {
|
|
25
|
+
let n;
|
|
26
|
+
return i && typeof i == "string" && a.isElement && (n = a.el.querySelector(i), n) ? n : (i && (typeof i == "string" && (n = [...document.querySelectorAll(i)]), a.params.uniqueNavElements && typeof i == "string" && n.length > 1 && a.el.querySelectorAll(i).length === 1 && (n = a.el.querySelector(i))), i && !n ? i : n);
|
|
86
27
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
validationErrors: a,
|
|
93
|
-
validationDetails: L
|
|
94
|
-
} : null;
|
|
95
|
-
}
|
|
96
|
-
function y(a, e) {
|
|
97
|
-
return a === e ? !0 : a && e && a.isInvalid === e.isInvalid && a.validationErrors.length === e.validationErrors.length && a.validationErrors.every((t, i) => t === e.validationErrors[i]) && Object.entries(a.validationDetails).every(([t, i]) => e.validationDetails[t] === i);
|
|
98
|
-
}
|
|
99
|
-
function k(...a) {
|
|
100
|
-
let e = /* @__PURE__ */ new Set(), t = !1, i = {
|
|
101
|
-
...D
|
|
102
|
-
};
|
|
103
|
-
for (let d of a) {
|
|
104
|
-
var o, l;
|
|
105
|
-
for (let n of d.validationErrors) e.add(n);
|
|
106
|
-
t || (t = d.isInvalid);
|
|
107
|
-
for (let n in i) (o = i)[l = n] || (o[l] = d.validationDetails[n]);
|
|
28
|
+
function d(i, n) {
|
|
29
|
+
const t = a.params.navigation;
|
|
30
|
+
i = l(i), i.forEach((e) => {
|
|
31
|
+
e && (e.classList[n ? "add" : "remove"](...t.disabledClass.split(" ")), e.tagName === "BUTTON" && (e.disabled = n), a.params.watchOverflow && a.enabled && e.classList[a.isLocked ? "add" : "remove"](t.lockClass));
|
|
32
|
+
});
|
|
108
33
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
34
|
+
function o() {
|
|
35
|
+
const {
|
|
36
|
+
nextEl: i,
|
|
37
|
+
prevEl: n
|
|
38
|
+
} = a.navigation;
|
|
39
|
+
if (a.params.loop) {
|
|
40
|
+
d(n, !1), d(i, !1);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
d(n, a.isBeginning && !a.params.rewind), d(i, a.isEnd && !a.params.rewind);
|
|
44
|
+
}
|
|
45
|
+
function u(i) {
|
|
46
|
+
i.preventDefault(), !(a.isBeginning && !a.params.loop && !a.params.rewind) && (a.slidePrev(), p("navigationPrev"));
|
|
47
|
+
}
|
|
48
|
+
function E(i) {
|
|
49
|
+
i.preventDefault(), !(a.isEnd && !a.params.loop && !a.params.rewind) && (a.slideNext(), p("navigationNext"));
|
|
50
|
+
}
|
|
51
|
+
function g() {
|
|
52
|
+
const i = a.params.navigation;
|
|
53
|
+
if (a.params.navigation = k(a, a.originalParams.navigation, a.params.navigation, {
|
|
54
|
+
nextEl: "swiper-button-next",
|
|
55
|
+
prevEl: "swiper-button-prev"
|
|
56
|
+
}), !(i.nextEl || i.prevEl)) return;
|
|
57
|
+
let n = m(i.nextEl), t = m(i.prevEl);
|
|
58
|
+
Object.assign(a.navigation, {
|
|
59
|
+
nextEl: n,
|
|
60
|
+
prevEl: t
|
|
61
|
+
}), n = l(n), t = l(t);
|
|
62
|
+
const e = (s, c) => {
|
|
63
|
+
s && s.addEventListener("click", c === "next" ? E : u), !a.enabled && s && s.classList.add(...i.lockClass.split(" "));
|
|
64
|
+
};
|
|
65
|
+
n.forEach((s) => e(s, "next")), t.forEach((s) => e(s, "prev"));
|
|
66
|
+
}
|
|
67
|
+
function v() {
|
|
68
|
+
let {
|
|
69
|
+
nextEl: i,
|
|
70
|
+
prevEl: n
|
|
71
|
+
} = a.navigation;
|
|
72
|
+
i = l(i), n = l(n);
|
|
73
|
+
const t = (e, s) => {
|
|
74
|
+
e.removeEventListener("click", s === "next" ? E : u), e.classList.remove(...a.params.navigation.disabledClass.split(" "));
|
|
75
|
+
};
|
|
76
|
+
i.forEach((e) => t(e, "next")), n.forEach((e) => t(e, "prev"));
|
|
77
|
+
}
|
|
78
|
+
r("init", () => {
|
|
79
|
+
a.params.navigation.enabled === !1 ? b() : (g(), o());
|
|
80
|
+
}), r("toEdge fromEdge lock unlock", () => {
|
|
81
|
+
o();
|
|
82
|
+
}), r("destroy", () => {
|
|
83
|
+
v();
|
|
84
|
+
}), r("enable disable", () => {
|
|
85
|
+
let {
|
|
86
|
+
nextEl: i,
|
|
87
|
+
prevEl: n
|
|
88
|
+
} = a.navigation;
|
|
89
|
+
if (i = l(i), n = l(n), a.enabled) {
|
|
90
|
+
o();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
[...i, ...n].filter((t) => !!t).forEach((t) => t.classList.add(a.params.navigation.lockClass));
|
|
94
|
+
}), r("click", (i, n) => {
|
|
95
|
+
let {
|
|
96
|
+
nextEl: t,
|
|
97
|
+
prevEl: e
|
|
98
|
+
} = a.navigation;
|
|
99
|
+
t = l(t), e = l(e);
|
|
100
|
+
const s = n.target;
|
|
101
|
+
if (a.params.navigation.hideOnClick && !e.includes(s) && !t.includes(s)) {
|
|
102
|
+
if (a.pagination && a.params.pagination && a.params.pagination.clickable && (a.pagination.el === s || a.pagination.el.contains(s))) return;
|
|
103
|
+
let c;
|
|
104
|
+
t.length ? c = t[0].classList.contains(a.params.navigation.hiddenClass) : e.length && (c = e[0].classList.contains(a.params.navigation.hiddenClass)), p(c === !0 ? "navigationShow" : "navigationHide"), [...t, ...e].filter((f) => !!f).forEach((f) => f.classList.toggle(a.params.navigation.hiddenClass));
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
const C = () => {
|
|
108
|
+
a.el.classList.remove(...a.params.navigation.navigationDisabledClass.split(" ")), g(), o();
|
|
109
|
+
}, b = () => {
|
|
110
|
+
a.el.classList.add(...a.params.navigation.navigationDisabledClass.split(" ")), v();
|
|
115
111
|
};
|
|
112
|
+
Object.assign(a.navigation, {
|
|
113
|
+
enable: C,
|
|
114
|
+
disable: b,
|
|
115
|
+
update: o,
|
|
116
|
+
init: g,
|
|
117
|
+
destroy: v
|
|
118
|
+
});
|
|
116
119
|
}
|
|
117
120
|
export {
|
|
118
|
-
|
|
119
|
-
B as FormValidationContext,
|
|
120
|
-
D as VALID_VALIDITY_STATE,
|
|
121
|
-
k as mergeValidation,
|
|
122
|
-
h as privateValidationStateProp,
|
|
123
|
-
P as useFormValidationState
|
|
121
|
+
y as default
|
|
124
122
|
};
|
package/index139.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const $=require("./index185.js"),O=require("./index184.js"),f=require("./index183.js");function q(D){let{swiper:e,extendParams:H,on:m,emit:v}=D;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,u=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){const s=a.target.closest($.c(e.params.pagination.bulletClass));if(!s)return;a.preventDefault();const i=f.g(s)*e.params.slidesPerGroup;if(e.params.loop){if(e.realIndex===i)return;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&&(u+=t-(c||0),u>s.dynamicMainBullets-1?u=s.dynamicMainBullets-1:u<0&&(u=0)),g=Math.max(t-u,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.g(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=O.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`),u=0,a.dynamicMainBullets<1&&(a.dynamicMainBullets=1)),a.type==="progressbar"&&a.progressbarOpposite&&i.classList.add(a.progressbarOppositeClass),a.clickable&&i.addEventListener("click",I),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",I))})),e.pagination.bullets&&e.pagination.bullets.forEach(i=>i.classList.remove(...a.bulletActiveClass.split(" ")))}m("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)})}),m("init",()=>{e.params.pagination.enabled===!1?S():(A(),B(),h())}),m("activeIndexChange",()=>{typeof e.snapIndex>"u"&&h()}),m("snapIndexChange",()=>{h()}),m("snapGridLengthChange",()=>{B(),h()}),m("destroy",()=>{M()}),m("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)))}),m("lock unlock",()=>{h()}),m("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 P=()=>{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()},S=()=>{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:P,disable:S,render:B,update:h,init:A,destroy:M})}module.exports=q;
|
package/index139.mjs
CHANGED
|
@@ -1,30 +1,220 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { c as $ } from "./index185.mjs";
|
|
2
|
+
import { c as w } from "./index184.mjs";
|
|
3
|
+
import { m, f as F, g as P, a as E } from "./index183.mjs";
|
|
4
|
+
function R(D) {
|
|
5
|
+
let {
|
|
6
|
+
swiper: e,
|
|
7
|
+
extendParams: H,
|
|
8
|
+
on: g,
|
|
9
|
+
emit: v
|
|
10
|
+
} = D;
|
|
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`
|
|
42
|
+
}
|
|
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: t
|
|
54
|
+
} = e.params.pagination;
|
|
55
|
+
a && (a = a[`${s === "prev" ? "previous" : "next"}ElementSibling`], a && (a.classList.add(`${t}-${s}`), a = a[`${s === "prev" ? "previous" : "next"}ElementSibling`], a && a.classList.add(`${t}-${s}-${s}`)));
|
|
56
|
+
}
|
|
57
|
+
function I(a) {
|
|
58
|
+
const s = a.target.closest($(e.params.pagination.bulletClass));
|
|
59
|
+
if (!s)
|
|
60
|
+
return;
|
|
61
|
+
a.preventDefault();
|
|
62
|
+
const t = P(s) * e.params.slidesPerGroup;
|
|
63
|
+
if (e.params.loop) {
|
|
64
|
+
if (e.realIndex === t) return;
|
|
65
|
+
e.slideToLoop(t);
|
|
66
|
+
} else
|
|
67
|
+
e.slideTo(t);
|
|
68
|
+
}
|
|
69
|
+
function h() {
|
|
70
|
+
const a = e.rtl, s = e.params.pagination;
|
|
71
|
+
if (k()) return;
|
|
72
|
+
let t = e.pagination.el;
|
|
73
|
+
t = m(t);
|
|
74
|
+
let i, p;
|
|
75
|
+
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;
|
|
76
|
+
if (e.params.loop ? (p = e.previousRealIndex || 0, i = e.params.slidesPerGroup > 1 ? Math.floor(e.realIndex / e.params.slidesPerGroup) : e.realIndex) : typeof e.snapIndex < "u" ? (i = e.snapIndex, p = e.previousSnapIndex) : (p = e.previousIndex || 0, i = e.activeIndex || 0), s.type === "bullets" && e.pagination.bullets && e.pagination.bullets.length > 0) {
|
|
77
|
+
const l = e.pagination.bullets;
|
|
78
|
+
let f, c, L;
|
|
79
|
+
if (s.dynamicBullets && (b = F(l[0], e.isHorizontal() ? "width" : "height"), t.forEach((n) => {
|
|
80
|
+
n.style[e.isHorizontal() ? "width" : "height"] = `${b * (s.dynamicMainBullets + 4)}px`;
|
|
81
|
+
}), s.dynamicMainBullets > 1 && p !== void 0 && (u += i - (p || 0), u > s.dynamicMainBullets - 1 ? u = s.dynamicMainBullets - 1 : u < 0 && (u = 0)), f = Math.max(i - u, 0), c = f + (Math.min(l.length, s.dynamicMainBullets) - 1), L = (c + f) / 2), l.forEach((n) => {
|
|
82
|
+
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();
|
|
83
|
+
n.classList.remove(...r);
|
|
84
|
+
}), t.length > 1)
|
|
85
|
+
l.forEach((n) => {
|
|
86
|
+
const r = P(n);
|
|
87
|
+
r === i ? 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"));
|
|
88
|
+
});
|
|
89
|
+
else {
|
|
90
|
+
const n = l[i];
|
|
91
|
+
if (n && n.classList.add(...s.bulletActiveClass.split(" ")), e.isElement && l.forEach((r, o) => {
|
|
92
|
+
r.setAttribute("part", o === i ? "bullet-active" : "bullet");
|
|
93
|
+
}), s.dynamicBullets) {
|
|
94
|
+
const r = l[f], o = l[c];
|
|
95
|
+
for (let y = f; y <= c; y += 1)
|
|
96
|
+
l[y] && l[y].classList.add(...`${s.bulletActiveClass}-main`.split(" "));
|
|
97
|
+
x(r, "prev"), x(o, "next");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (s.dynamicBullets) {
|
|
101
|
+
const n = Math.min(l.length, s.dynamicMainBullets + 4), r = (b * n - b) / 2 - L * b, o = a ? "right" : "left";
|
|
102
|
+
l.forEach((y) => {
|
|
103
|
+
y.style[e.isHorizontal() ? o : "top"] = `${r}px`;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
t.forEach((l, f) => {
|
|
108
|
+
if (s.type === "fraction" && (l.querySelectorAll($(s.currentClass)).forEach((c) => {
|
|
109
|
+
c.textContent = s.formatFractionCurrent(i + 1);
|
|
110
|
+
}), l.querySelectorAll($(s.totalClass)).forEach((c) => {
|
|
111
|
+
c.textContent = s.formatFractionTotal(z);
|
|
112
|
+
})), s.type === "progressbar") {
|
|
113
|
+
let c;
|
|
114
|
+
s.progressbarOpposite ? c = e.isHorizontal() ? "vertical" : "horizontal" : c = e.isHorizontal() ? "horizontal" : "vertical";
|
|
115
|
+
const L = (i + 1) / z;
|
|
116
|
+
let n = 1, r = 1;
|
|
117
|
+
c === "horizontal" ? n = L : r = L, l.querySelectorAll($(s.progressbarFillClass)).forEach((o) => {
|
|
118
|
+
o.style.transform = `translate3d(0,0,0) scaleX(${n}) scaleY(${r})`, o.style.transitionDuration = `${e.params.speed}ms`;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
s.type === "custom" && s.renderCustom ? (l.innerHTML = s.renderCustom(e, i + 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);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function B() {
|
|
125
|
+
const a = e.params.pagination;
|
|
126
|
+
if (k()) return;
|
|
127
|
+
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;
|
|
128
|
+
let t = e.pagination.el;
|
|
129
|
+
t = m(t);
|
|
130
|
+
let i = "";
|
|
131
|
+
if (a.type === "bullets") {
|
|
132
|
+
let p = e.params.loop ? Math.ceil(s / e.params.slidesPerGroup) : e.snapGrid.length;
|
|
133
|
+
e.params.freeMode && e.params.freeMode.enabled && p > s && (p = s);
|
|
134
|
+
for (let C = 0; C < p; C += 1)
|
|
135
|
+
a.renderBullet ? i += a.renderBullet.call(e, C, a.bulletClass) : i += `<${a.bulletElement} ${e.isElement ? 'part="bullet"' : ""} class="${a.bulletClass}"></${a.bulletElement}>`;
|
|
136
|
+
}
|
|
137
|
+
a.type === "fraction" && (a.renderFraction ? i = a.renderFraction.call(e, a.currentClass, a.totalClass) : i = `<span class="${a.currentClass}"></span> / <span class="${a.totalClass}"></span>`), a.type === "progressbar" && (a.renderProgressbar ? i = a.renderProgressbar.call(e, a.progressbarFillClass) : i = `<span class="${a.progressbarFillClass}"></span>`), e.pagination.bullets = [], t.forEach((p) => {
|
|
138
|
+
a.type !== "custom" && (p.innerHTML = i || ""), a.type === "bullets" && e.pagination.bullets.push(...p.querySelectorAll($(a.bulletClass)));
|
|
139
|
+
}), a.type !== "custom" && v("paginationRender", t[0]);
|
|
140
|
+
}
|
|
141
|
+
function A() {
|
|
142
|
+
e.params.pagination = w(e, e.originalParams.pagination, e.params.pagination, {
|
|
143
|
+
el: "swiper-pagination"
|
|
144
|
+
});
|
|
145
|
+
const a = e.params.pagination;
|
|
146
|
+
if (!a.el) return;
|
|
147
|
+
let s;
|
|
148
|
+
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((t) => E(t, ".swiper")[0] === e.el)[0])), Array.isArray(s) && s.length === 1 && (s = s[0]), Object.assign(e.pagination, {
|
|
149
|
+
el: s
|
|
150
|
+
}), s = m(s), s.forEach((t) => {
|
|
151
|
+
a.type === "bullets" && a.clickable && t.classList.add(...(a.clickableClass || "").split(" ")), t.classList.add(a.modifierClass + a.type), t.classList.add(e.isHorizontal() ? a.horizontalClass : a.verticalClass), a.type === "bullets" && a.dynamicBullets && (t.classList.add(`${a.modifierClass}${a.type}-dynamic`), u = 0, a.dynamicMainBullets < 1 && (a.dynamicMainBullets = 1)), a.type === "progressbar" && a.progressbarOpposite && t.classList.add(a.progressbarOppositeClass), a.clickable && t.addEventListener("click", I), e.enabled || t.classList.add(a.lockClass);
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
function M() {
|
|
155
|
+
const a = e.params.pagination;
|
|
156
|
+
if (k()) return;
|
|
157
|
+
let s = e.pagination.el;
|
|
158
|
+
s && (s = m(s), s.forEach((t) => {
|
|
159
|
+
t.classList.remove(a.hiddenClass), t.classList.remove(a.modifierClass + a.type), t.classList.remove(e.isHorizontal() ? a.horizontalClass : a.verticalClass), a.clickable && (t.classList.remove(...(a.clickableClass || "").split(" ")), t.removeEventListener("click", I));
|
|
160
|
+
})), e.pagination.bullets && e.pagination.bullets.forEach((t) => t.classList.remove(...a.bulletActiveClass.split(" ")));
|
|
161
|
+
}
|
|
162
|
+
g("changeDirection", () => {
|
|
163
|
+
if (!e.pagination || !e.pagination.el) return;
|
|
164
|
+
const a = e.params.pagination;
|
|
165
|
+
let {
|
|
166
|
+
el: s
|
|
167
|
+
} = e.pagination;
|
|
168
|
+
s = m(s), s.forEach((t) => {
|
|
169
|
+
t.classList.remove(a.horizontalClass, a.verticalClass), t.classList.add(e.isHorizontal() ? a.horizontalClass : a.verticalClass);
|
|
170
|
+
});
|
|
171
|
+
}), g("init", () => {
|
|
172
|
+
e.params.pagination.enabled === !1 ? S() : (A(), B(), h());
|
|
173
|
+
}), g("activeIndexChange", () => {
|
|
174
|
+
typeof e.snapIndex > "u" && h();
|
|
175
|
+
}), g("snapIndexChange", () => {
|
|
176
|
+
h();
|
|
177
|
+
}), g("snapGridLengthChange", () => {
|
|
178
|
+
B(), h();
|
|
179
|
+
}), g("destroy", () => {
|
|
180
|
+
M();
|
|
181
|
+
}), g("enable disable", () => {
|
|
182
|
+
let {
|
|
183
|
+
el: a
|
|
184
|
+
} = e.pagination;
|
|
185
|
+
a && (a = m(a), a.forEach((s) => s.classList[e.enabled ? "remove" : "add"](e.params.pagination.lockClass)));
|
|
186
|
+
}), g("lock unlock", () => {
|
|
187
|
+
h();
|
|
188
|
+
}), g("click", (a, s) => {
|
|
189
|
+
const t = s.target, i = m(e.pagination.el);
|
|
190
|
+
if (e.params.pagination.el && e.params.pagination.hideOnClick && i && i.length > 0 && !t.classList.contains(e.params.pagination.bulletClass)) {
|
|
191
|
+
if (e.navigation && (e.navigation.nextEl && t === e.navigation.nextEl || e.navigation.prevEl && t === e.navigation.prevEl)) return;
|
|
192
|
+
const p = i[0].classList.contains(e.params.pagination.hiddenClass);
|
|
193
|
+
v(p === !0 ? "paginationShow" : "paginationHide"), i.forEach((C) => C.classList.toggle(e.params.pagination.hiddenClass));
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
const O = () => {
|
|
197
|
+
e.el.classList.remove(e.params.pagination.paginationDisabledClass);
|
|
198
|
+
let {
|
|
199
|
+
el: a
|
|
200
|
+
} = e.pagination;
|
|
201
|
+
a && (a = m(a), a.forEach((s) => s.classList.remove(e.params.pagination.paginationDisabledClass))), A(), B(), h();
|
|
202
|
+
}, S = () => {
|
|
203
|
+
e.el.classList.add(e.params.pagination.paginationDisabledClass);
|
|
204
|
+
let {
|
|
205
|
+
el: a
|
|
206
|
+
} = e.pagination;
|
|
207
|
+
a && (a = m(a), a.forEach((s) => s.classList.add(e.params.pagination.paginationDisabledClass))), M();
|
|
208
|
+
};
|
|
209
|
+
Object.assign(e.pagination, {
|
|
210
|
+
enable: O,
|
|
211
|
+
disable: S,
|
|
212
|
+
render: B,
|
|
213
|
+
update: h,
|
|
214
|
+
init: A,
|
|
215
|
+
destroy: M
|
|
216
|
+
});
|
|
27
217
|
}
|
|
28
218
|
export {
|
|
29
|
-
|
|
219
|
+
R as default
|
|
30
220
|
};
|
package/index140.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const A=require("./index182.js"),n=require("./index183.js"),I=require("./index184.js"),j=require("./index185.js");function B(x){let{swiper:s,extendParams:q,on:f,emit:g}=x;const y=A.g();let b=!1,w=null,h=null,v,i,p,D;q({scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag",scrollbarDisabledClass:"swiper-scrollbar-disabled",horizontalClass:"swiper-scrollbar-horizontal",verticalClass:"swiper-scrollbar-vertical"}}),s.scrollbar={el:null,dragEl:null};function u(){if(!s.params.scrollbar.el||!s.scrollbar.el)return;const{scrollbar:l,rtlTranslate:a}=s,{dragEl:r,el:e}=l,t=s.params.scrollbar,c=s.params.loop?s.progressLoop:s.progress;let d=i,o=(p-i)*c;a?(o=-o,o>0?(d=i-o,o=0):-o+i>p&&(d=p+o)):o<0?(d=i+o,o=0):o+i>p&&(d=p-o),s.isHorizontal()?(r.style.transform=`translate3d(${o}px, 0, 0)`,r.style.width=`${d}px`):(r.style.transform=`translate3d(0px, ${o}px, 0)`,r.style.height=`${d}px`),t.hide&&(clearTimeout(w),e.style.opacity=1,w=setTimeout(()=>{e.style.opacity=0,e.style.transitionDuration="400ms"},1e3))}function H(l){!s.params.scrollbar.el||!s.scrollbar.el||(s.scrollbar.dragEl.style.transitionDuration=`${l}ms`)}function m(){if(!s.params.scrollbar.el||!s.scrollbar.el)return;const{scrollbar:l}=s,{dragEl:a,el:r}=l;a.style.width="",a.style.height="",p=s.isHorizontal()?r.offsetWidth:r.offsetHeight,D=s.size/(s.virtualSize+s.params.slidesOffsetBefore-(s.params.centeredSlides?s.snapGrid[0]:0)),s.params.scrollbar.dragSize==="auto"?i=p*D:i=parseInt(s.params.scrollbar.dragSize,10),s.isHorizontal()?a.style.width=`${i}px`:a.style.height=`${i}px`,D>=1?r.style.display="none":r.style.display="",s.params.scrollbar.hide&&(r.style.opacity=0),s.params.watchOverflow&&s.enabled&&l.el.classList[s.isLocked?"add":"remove"](s.params.scrollbar.lockClass)}function E(l){return s.isHorizontal()?l.clientX:l.clientY}function S(l){const{scrollbar:a,rtlTranslate:r}=s,{el:e}=a;let t;t=(E(l)-n.b(e)[s.isHorizontal()?"left":"top"]-(v!==null?v:i/2))/(p-i),t=Math.max(Math.min(t,1),0),r&&(t=1-t);const c=s.minTranslate()+(s.maxTranslate()-s.minTranslate())*t;s.updateProgress(c),s.setTranslate(c),s.updateActiveIndex(),s.updateSlidesClasses()}function k(l){const a=s.params.scrollbar,{scrollbar:r,wrapperEl:e}=s,{el:t,dragEl:c}=r;b=!0,v=l.target===c?E(l)-l.target.getBoundingClientRect()[s.isHorizontal()?"left":"top"]:null,l.preventDefault(),l.stopPropagation(),e.style.transitionDuration="100ms",c.style.transitionDuration="100ms",S(l),clearTimeout(h),t.style.transitionDuration="0ms",a.hide&&(t.style.opacity=1),s.params.cssMode&&(s.wrapperEl.style["scroll-snap-type"]="none"),g("scrollbarDragStart",l)}function P(l){const{scrollbar:a,wrapperEl:r}=s,{el:e,dragEl:t}=a;b&&(l.preventDefault?l.preventDefault():l.returnValue=!1,S(l),r.style.transitionDuration="0ms",e.style.transitionDuration="0ms",t.style.transitionDuration="0ms",g("scrollbarDragMove",l))}function M(l){const a=s.params.scrollbar,{scrollbar:r,wrapperEl:e}=s,{el:t}=r;b&&(b=!1,s.params.cssMode&&(s.wrapperEl.style["scroll-snap-type"]="",e.style.transitionDuration=""),a.hide&&(clearTimeout(h),h=n.n(()=>{t.style.opacity=0,t.style.transitionDuration="400ms"},1e3)),g("scrollbarDragEnd",l),a.snapOnRelease&&s.slideToClosest())}function L(l){const{scrollbar:a,params:r}=s,e=a.el;if(!e)return;const t=e,c=r.passiveListeners?{passive:!1,capture:!1}:!1,d=r.passiveListeners?{passive:!0,capture:!1}:!1;if(!t)return;const o=l==="on"?"addEventListener":"removeEventListener";t[o]("pointerdown",k,c),y[o]("pointermove",P,c),y[o]("pointerup",M,d)}function $(){!s.params.scrollbar.el||!s.scrollbar.el||L("on")}function O(){!s.params.scrollbar.el||!s.scrollbar.el||L("off")}function z(){const{scrollbar:l,el:a}=s;s.params.scrollbar=I.c(s,s.originalParams.scrollbar,s.params.scrollbar,{el:"swiper-scrollbar"});const r=s.params.scrollbar;if(!r.el)return;let e;if(typeof r.el=="string"&&s.isElement&&(e=s.el.querySelector(r.el)),!e&&typeof r.el=="string"){if(e=y.querySelectorAll(r.el),!e.length)return}else e||(e=r.el);s.params.uniqueNavElements&&typeof r.el=="string"&&e.length>1&&a.querySelectorAll(r.el).length===1&&(e=a.querySelector(r.el)),e.length>0&&(e=e[0]),e.classList.add(s.isHorizontal()?r.horizontalClass:r.verticalClass);let t;e&&(t=e.querySelector(j.c(s.params.scrollbar.dragClass)),t||(t=n.c("div",s.params.scrollbar.dragClass),e.append(t))),Object.assign(l,{el:e,dragEl:t}),r.draggable&&$(),e&&e.classList[s.enabled?"remove":"add"](...n.h(s.params.scrollbar.lockClass))}function C(){const l=s.params.scrollbar,a=s.scrollbar.el;a&&a.classList.remove(...n.h(s.isHorizontal()?l.horizontalClass:l.verticalClass)),O()}f("changeDirection",()=>{if(!s.scrollbar||!s.scrollbar.el)return;const l=s.params.scrollbar;let{el:a}=s.scrollbar;a=n.m(a),a.forEach(r=>{r.classList.remove(l.horizontalClass,l.verticalClass),r.classList.add(s.isHorizontal()?l.horizontalClass:l.verticalClass)})}),f("init",()=>{s.params.scrollbar.enabled===!1?T():(z(),m(),u())}),f("update resize observerUpdate lock unlock changeDirection",()=>{m()}),f("setTranslate",()=>{u()}),f("setTransition",(l,a)=>{H(a)}),f("enable disable",()=>{const{el:l}=s.scrollbar;l&&l.classList[s.enabled?"remove":"add"](...n.h(s.params.scrollbar.lockClass))}),f("destroy",()=>{C()});const R=()=>{s.el.classList.remove(...n.h(s.params.scrollbar.scrollbarDisabledClass)),s.scrollbar.el&&s.scrollbar.el.classList.remove(...n.h(s.params.scrollbar.scrollbarDisabledClass)),z(),m(),u()},T=()=>{s.el.classList.add(...n.h(s.params.scrollbar.scrollbarDisabledClass)),s.scrollbar.el&&s.scrollbar.el.classList.add(...n.h(s.params.scrollbar.scrollbarDisabledClass)),C()};Object.assign(s.scrollbar,{enable:R,disable:T,updateSize:m,setTranslate:u,init:z,destroy:C})}module.exports=B;
|