@wikicasa-dev/components 2.1.28-alpha.0 → 2.1.28-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/UIKit/AccessibleSelect.js +1 -1
- package/dist/UIKit/Accordion/BaseAccordion.js +1 -1
- package/dist/UIKit/Accordion/BaseAccordionBtn.js +1 -1
- package/dist/UIKit/Accordion/BaseAccordionContent.js +1 -1
- package/dist/UIKit/Accordion/BaseAccordionItem.js +1 -1
- package/dist/UIKit/BaseAlert.d.ts +1 -1
- package/dist/UIKit/BaseAlert.js +2 -2
- package/dist/UIKit/BaseAutocomplete.js +1 -1
- package/dist/UIKit/BaseBadge.js +2 -2
- package/dist/UIKit/BaseBreadcrumb.js +1 -1
- package/dist/UIKit/BaseButton.js +1 -1
- package/dist/UIKit/BaseCard.js +2 -2
- package/dist/UIKit/BaseComplexToggle.d.ts +1 -1
- package/dist/UIKit/BaseComplexToggle.js +5 -5
- package/dist/UIKit/BaseDropDown.js +1 -1
- package/dist/UIKit/BaseFloatingLabel.js +2 -2
- package/dist/UIKit/BaseIcon.js +2 -2
- package/dist/UIKit/BaseInput.js +2 -2
- package/dist/UIKit/BaseModal.js +2 -2
- package/dist/UIKit/BasePagination.js +1 -1
- package/dist/UIKit/BasePaper.js +2 -2
- package/dist/UIKit/BaseSelect/SelectItem.js +1 -1
- package/dist/UIKit/BaseSlider.js +2 -2
- package/dist/UIKit/BaseSnackbar.js +2 -2
- package/dist/UIKit/BaseTextarea.js +2 -2
- package/dist/UIKit/BaseToggle.js +2 -2
- package/dist/UIKit/BaseTooltip.js +2 -2
- package/dist/UIKit/BaseUploadFile.js +1 -1
- package/dist/UIKit/Checkbox/CheckboxBtn.js +2 -2
- package/dist/UIKit/Checkbox/CheckboxGroup.js +1 -1
- package/dist/UIKit/Radio/RadioButton.js +1 -1
- package/dist/UIKit/Radio/RadioGroup.js +1 -1
- package/dist/UIKit/ShimmerLoader/BaseShimmerLoader.js +2 -2
- package/dist/UIKit/ShimmerLoader/ShimmerMultiLine.js +1 -1
- package/dist/UIKit/Slider/SimpleSlider.js +2 -2
- package/dist/UIKit/StaticSpinner.js +2 -2
- package/dist/UIKit/Tab/BaseTab.js +1 -1
- package/dist/UIKit/Tab/BaseTabList.js +1 -1
- package/dist/UIKit/Tab/BaseTabPanel.js +1 -1
- package/dist/UIKit/Tab/BaseTabView.js +1 -1
- package/dist/assets/{packages/components/lib → lib}/UIKit/BaseComplexToggle.css +1 -1
- package/dist/chart/DoughnutChart.js +1 -1
- package/dist/chart/LineChart.js +1 -1
- package/dist/components/IntersectionObserver/IntersectionObservable.js +1 -1
- package/dist/components/IntersectionObserver/IntersectionObserver.js +1 -1
- package/dist/components/carousel/SwiperCarousel.js +3 -3
- package/dist/index.js +30 -30
- package/dist/lazyModules/Swiper/autoplay.js +5 -0
- package/dist/lazyModules/Swiper/controller.js +5 -0
- package/dist/lazyModules/Swiper/free-mode.js +5 -0
- package/dist/lazyModules/Swiper/keyboard.js +5 -0
- package/dist/lazyModules/Swiper/navigation.js +5 -0
- package/dist/lazyModules/Swiper/pagination.js +5 -0
- package/dist/lazyModules/Swiper/thumbs.js +5 -0
- package/dist/{packages/components/lib → lib}/UIKit/AccessibleSelect.vue.js +16 -17
- package/dist/lib/UIKit/Accordion/BaseAccordion.vue.js +31 -0
- package/dist/{packages/components/lib → lib}/UIKit/Accordion/BaseAccordionBtn.vue.js +4 -4
- package/dist/{packages/components/lib → lib}/UIKit/Accordion/BaseAccordionItem.vue.js +1 -1
- package/dist/{packages/components/lib → lib}/UIKit/BaseAutocomplete.vue.js +9 -12
- package/dist/{packages/components/lib → lib}/UIKit/BaseBreadcrumb.vue.js +1 -1
- package/dist/{packages/components/lib → lib}/UIKit/BaseButton.vue.js +1 -1
- package/dist/{packages/components/lib → lib}/UIKit/BaseDropDown.vue.js +5 -5
- package/dist/{packages/components/lib → lib}/UIKit/BaseInput.vue.js +2 -2
- package/dist/{packages/components/lib → lib}/UIKit/BaseModal.vue.js +14 -18
- package/dist/{packages/components/lib → lib}/UIKit/BasePagination.vue.js +1 -1
- package/dist/{packages/components/lib → lib}/UIKit/BaseSlider.vue.js +1 -1
- package/dist/{packages/components/lib → lib}/UIKit/BaseSnackbar.vue.js +1 -1
- package/dist/{packages/components/lib → lib}/UIKit/BaseTextarea.vue.js +2 -2
- package/dist/{packages/components/lib → lib}/UIKit/BaseUploadFile.vue.js +1 -1
- package/dist/{packages/components/lib → lib}/UIKit/Checkbox/CheckboxGroup.vue.js +18 -22
- package/dist/{packages/components/lib → lib}/UIKit/ShimmerLoader/ShimmerMultiLine.vue.js +1 -1
- package/dist/{packages/components/lib → lib}/chart/DoughnutChart.vue.js +1 -1
- package/dist/{packages/components/lib → lib}/chart/LineChart.vue.js +1 -1
- package/dist/{packages/components/lib → lib}/components/carousel/SwiperCarousel.vue.js +32 -35
- package/package.json +7 -3
- package/dist/_virtual/polyline.js +0 -2
- package/dist/assets/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/autoplay.css +0 -0
- package/dist/assets/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/free-mode.css +0 -1
- package/dist/assets/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/navigation.css +0 -1
- package/dist/assets/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/pagination.css +0 -1
- package/dist/assets/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/zoom.css +0 -1
- package/dist/assets/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/swiper.css +0 -1
- package/dist/node_modules/.pnpm/@wikicasa-dev_svg-icons@1.2.24-alpha.0_vue@3.5.25_typescript@5.9.3_/node_modules/@wikicasa-dev/svg-icons/dist/ArrowIcon.js +0 -28
- package/dist/node_modules/.pnpm/@wikicasa-dev_svg-icons@1.2.24-alpha.0_vue@3.5.25_typescript@5.9.3_/node_modules/@wikicasa-dev/svg-icons/dist/CloseIcon.js +0 -38
- package/dist/node_modules/.pnpm/@wikicasa-dev_svg-icons@1.2.24-alpha.0_vue@3.5.25_typescript@5.9.3_/node_modules/@wikicasa-dev/svg-icons/dist/DefaultValues-CpabIgVz.js +0 -9
- package/dist/node_modules/.pnpm/@wikicasa-dev_svg-icons@1.2.24-alpha.0_vue@3.5.25_typescript@5.9.3_/node_modules/@wikicasa-dev/svg-icons/dist/WarningIconRounded.js +0 -40
- package/dist/node_modules/.pnpm/@wikicasa-dev_utilities@1.1.22_date-fns@4.1.0_google-polyline@1.0.3_js-cookie@3.0.5/node_modules/@wikicasa-dev/utilities/dist/utils/ArrayUtils.js +0 -4
- package/dist/node_modules/.pnpm/@wikicasa-dev_utilities@1.1.22_date-fns@4.1.0_google-polyline@1.0.3_js-cookie@3.0.5/node_modules/@wikicasa-dev/utilities/dist/utils/DeviceDetectionUtils.js +0 -4
- package/dist/node_modules/.pnpm/@wikicasa-dev_utilities@1.1.22_date-fns@4.1.0_google-polyline@1.0.3_js-cookie@3.0.5/node_modules/@wikicasa-dev/utilities/dist/utils/FunctionUtils.js +0 -15
- package/dist/node_modules/.pnpm/@wikicasa-dev_utilities@1.1.22_date-fns@4.1.0_google-polyline@1.0.3_js-cookie@3.0.5/node_modules/@wikicasa-dev/utilities/dist/utils/GenericUtils.js +0 -12
- package/dist/node_modules/.pnpm/@wikicasa-dev_utilities@1.1.22_date-fns@4.1.0_google-polyline@1.0.3_js-cookie@3.0.5/node_modules/@wikicasa-dev/utilities/dist/utils/ObjectUtils.js +0 -10
- package/dist/node_modules/.pnpm/@wikicasa-dev_utilities@1.1.22_date-fns@4.1.0_google-polyline@1.0.3_js-cookie@3.0.5/node_modules/@wikicasa-dev/utilities/dist/utils/StringUtils.js +0 -4
- package/dist/node_modules/.pnpm/@wikicasa-dev_vue-composables@0.0.25_vue@3.5.25_typescript@5.9.3_/node_modules/@wikicasa-dev/vue-composables/dist/useKeyboardController.js +0 -41
- package/dist/node_modules/.pnpm/google-polyline@1.0.3/node_modules/google-polyline/lib/decode.js +0 -22
- package/dist/node_modules/.pnpm/google-polyline@1.0.3/node_modules/google-polyline/lib/encode.js +0 -34
- package/dist/node_modules/.pnpm/google-polyline@1.0.3/node_modules/google-polyline/lib/polyline.js +0 -12
- package/dist/node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.js +0 -70
- package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/autoplay.js +0 -128
- package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/controller.js +0 -100
- package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/free-mode.js +0 -123
- package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/keyboard.js +0 -66
- package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/navigation.js +0 -136
- package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/pagination.js +0 -226
- package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/thumbs.js +0 -120
- package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/zoom.js +0 -309
- package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/classes-to-selector.js +0 -6
- package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/create-element-if-not-defined.js +0 -12
- package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/ssr-window.esm.js +0 -134
- package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/utils.js +0 -88
- package/dist/packages/components/lazyModules/Swiper/autoplay.js +0 -5
- package/dist/packages/components/lazyModules/Swiper/controller.js +0 -5
- package/dist/packages/components/lazyModules/Swiper/free-mode.js +0 -5
- package/dist/packages/components/lazyModules/Swiper/keyboard.js +0 -5
- package/dist/packages/components/lazyModules/Swiper/navigation.js +0 -5
- package/dist/packages/components/lazyModules/Swiper/pagination.js +0 -5
- package/dist/packages/components/lazyModules/Swiper/thumbs.js +0 -5
- package/dist/packages/components/lib/UIKit/Accordion/BaseAccordion.vue.js +0 -34
- /package/dist/assets/{packages/components/lib → lib}/UIKit/BaseAlert.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/BaseBadge.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/BaseCard.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/BaseFloatingLabel.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/BaseIcon.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/BaseInput.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/BaseModal.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/BasePaper.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/BaseSlider.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/BaseSnackbar.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/BaseTextarea.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/BaseToggle.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/BaseTooltip.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/Checkbox/CheckboxBtn.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/ShimmerLoader/BaseShimmerLoader.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/Slider/SimpleSlider.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/UIKit/StaticSpinner.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/components/carousel/SwiperCarousel.css +0 -0
- /package/dist/assets/{packages/components/lib → lib}/components/carousel/SwiperCarousel2.css +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/Accordion/BaseAccordionContent.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/BaseAlert.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/BaseBadge.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/BaseCard.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/BaseComplexToggle.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/BaseFloatingLabel.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/BaseIcon.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/BasePaper.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/BaseSelect/SelectItem.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/BaseToggle.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/BaseTooltip.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/Checkbox/CheckboxBtn.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/Radio/RadioButton.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/Radio/RadioGroup.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/ShimmerLoader/BaseShimmerLoader.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/Slider/SimpleSlider.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/StaticSpinner.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/Tab/BaseTab.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/Tab/BaseTabList.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/Tab/BaseTabPanel.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/UIKit/Tab/BaseTabView.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/components/IntersectionObserver/IntersectionObservable.vue.js +0 -0
- /package/dist/{packages/components/lib → lib}/components/IntersectionObserver/IntersectionObserver.vue.js +0 -0
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { c as $ } from "../shared/classes-to-selector.js";
|
|
2
|
-
import { c as E } from "../shared/create-element-if-not-defined.js";
|
|
3
|
-
import { m, d as q, s as S, i as G, j as P } from "../shared/utils.js";
|
|
4
|
-
function N({
|
|
5
|
-
swiper: a,
|
|
6
|
-
extendParams: O,
|
|
7
|
-
on: u,
|
|
8
|
-
emit: v
|
|
9
|
-
}) {
|
|
10
|
-
const f = "swiper-pagination";
|
|
11
|
-
O({
|
|
12
|
-
pagination: {
|
|
13
|
-
el: null,
|
|
14
|
-
bulletElement: "span",
|
|
15
|
-
clickable: !1,
|
|
16
|
-
hideOnClick: !1,
|
|
17
|
-
renderBullet: null,
|
|
18
|
-
renderProgressbar: null,
|
|
19
|
-
renderFraction: null,
|
|
20
|
-
renderCustom: null,
|
|
21
|
-
progressbarOpposite: !1,
|
|
22
|
-
type: "bullets",
|
|
23
|
-
// 'bullets' or 'progressbar' or 'fraction' or 'custom'
|
|
24
|
-
dynamicBullets: !1,
|
|
25
|
-
dynamicMainBullets: 1,
|
|
26
|
-
formatFractionCurrent: (t) => t,
|
|
27
|
-
formatFractionTotal: (t) => t,
|
|
28
|
-
bulletClass: `${f}-bullet`,
|
|
29
|
-
bulletActiveClass: `${f}-bullet-active`,
|
|
30
|
-
modifierClass: `${f}-`,
|
|
31
|
-
currentClass: `${f}-current`,
|
|
32
|
-
totalClass: `${f}-total`,
|
|
33
|
-
hiddenClass: `${f}-hidden`,
|
|
34
|
-
progressbarFillClass: `${f}-progressbar-fill`,
|
|
35
|
-
progressbarOppositeClass: `${f}-progressbar-opposite`,
|
|
36
|
-
clickableClass: `${f}-clickable`,
|
|
37
|
-
lockClass: `${f}-lock`,
|
|
38
|
-
horizontalClass: `${f}-horizontal`,
|
|
39
|
-
verticalClass: `${f}-vertical`,
|
|
40
|
-
paginationDisabledClass: `${f}-disabled`
|
|
41
|
-
}
|
|
42
|
-
}), a.pagination = {
|
|
43
|
-
el: null,
|
|
44
|
-
bullets: []
|
|
45
|
-
};
|
|
46
|
-
let b, p = 0;
|
|
47
|
-
function k() {
|
|
48
|
-
return !a.params.pagination.el || !a.pagination.el || Array.isArray(a.pagination.el) && a.pagination.el.length === 0;
|
|
49
|
-
}
|
|
50
|
-
function x(t, l) {
|
|
51
|
-
const {
|
|
52
|
-
bulletActiveClass: e
|
|
53
|
-
} = a.params.pagination;
|
|
54
|
-
t && (t = t[`${l === "prev" ? "previous" : "next"}ElementSibling`], t && (t.classList.add(`${e}-${l}`), t = t[`${l === "prev" ? "previous" : "next"}ElementSibling`], t && t.classList.add(`${e}-${l}-${l}`)));
|
|
55
|
-
}
|
|
56
|
-
function H(t, l, e) {
|
|
57
|
-
if (t = t % e, l = l % e, l === t + 1)
|
|
58
|
-
return "next";
|
|
59
|
-
if (l === t - 1)
|
|
60
|
-
return "previous";
|
|
61
|
-
}
|
|
62
|
-
function D(t) {
|
|
63
|
-
const l = t.target.closest($(a.params.pagination.bulletClass));
|
|
64
|
-
if (!l)
|
|
65
|
-
return;
|
|
66
|
-
t.preventDefault();
|
|
67
|
-
const e = P(l) * a.params.slidesPerGroup;
|
|
68
|
-
if (a.params.loop) {
|
|
69
|
-
if (a.realIndex === e) return;
|
|
70
|
-
const n = H(a.realIndex, e, a.slides.length);
|
|
71
|
-
n === "next" ? a.slideNext() : n === "previous" ? a.slidePrev() : a.slideToLoop(e);
|
|
72
|
-
} else
|
|
73
|
-
a.slideTo(e);
|
|
74
|
-
}
|
|
75
|
-
function h() {
|
|
76
|
-
const t = a.rtl, l = a.params.pagination;
|
|
77
|
-
if (k()) return;
|
|
78
|
-
let e = a.pagination.el;
|
|
79
|
-
e = m(e);
|
|
80
|
-
let n, c;
|
|
81
|
-
const C = a.virtual && a.params.virtual.enabled ? a.virtual.slides.length : a.slides.length, z = a.params.loop ? Math.ceil(C / a.params.slidesPerGroup) : a.snapGrid.length;
|
|
82
|
-
if (a.params.loop ? (c = a.previousRealIndex || 0, n = a.params.slidesPerGroup > 1 ? Math.floor(a.realIndex / a.params.slidesPerGroup) : a.realIndex) : typeof a.snapIndex < "u" ? (n = a.snapIndex, c = a.previousSnapIndex) : (c = a.previousIndex || 0, n = a.activeIndex || 0), l.type === "bullets" && a.pagination.bullets && a.pagination.bullets.length > 0) {
|
|
83
|
-
const s = a.pagination.bullets;
|
|
84
|
-
let g, d, L;
|
|
85
|
-
if (l.dynamicBullets && (b = G(s[0], a.isHorizontal() ? "width" : "height"), e.forEach((i) => {
|
|
86
|
-
i.style[a.isHorizontal() ? "width" : "height"] = `${b * (l.dynamicMainBullets + 4)}px`;
|
|
87
|
-
}), l.dynamicMainBullets > 1 && c !== void 0 && (p += n - (c || 0), p > l.dynamicMainBullets - 1 ? p = l.dynamicMainBullets - 1 : p < 0 && (p = 0)), g = Math.max(n - p, 0), d = g + (Math.min(s.length, l.dynamicMainBullets) - 1), L = (d + g) / 2), s.forEach((i) => {
|
|
88
|
-
const o = [...["", "-next", "-next-next", "-prev", "-prev-prev", "-main"].map((r) => `${l.bulletActiveClass}${r}`)].map((r) => typeof r == "string" && r.includes(" ") ? r.split(" ") : r).flat();
|
|
89
|
-
i.classList.remove(...o);
|
|
90
|
-
}), e.length > 1)
|
|
91
|
-
s.forEach((i) => {
|
|
92
|
-
const o = P(i);
|
|
93
|
-
o === n ? i.classList.add(...l.bulletActiveClass.split(" ")) : a.isElement && i.setAttribute("part", "bullet"), l.dynamicBullets && (o >= g && o <= d && i.classList.add(...`${l.bulletActiveClass}-main`.split(" ")), o === g && x(i, "prev"), o === d && x(i, "next"));
|
|
94
|
-
});
|
|
95
|
-
else {
|
|
96
|
-
const i = s[n];
|
|
97
|
-
if (i && i.classList.add(...l.bulletActiveClass.split(" ")), a.isElement && s.forEach((o, r) => {
|
|
98
|
-
o.setAttribute("part", r === n ? "bullet-active" : "bullet");
|
|
99
|
-
}), l.dynamicBullets) {
|
|
100
|
-
const o = s[g], r = s[d];
|
|
101
|
-
for (let y = g; y <= d; y += 1)
|
|
102
|
-
s[y] && s[y].classList.add(...`${l.bulletActiveClass}-main`.split(" "));
|
|
103
|
-
x(o, "prev"), x(r, "next");
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (l.dynamicBullets) {
|
|
107
|
-
const i = Math.min(s.length, l.dynamicMainBullets + 4), o = (b * i - b) / 2 - L * b, r = t ? "right" : "left";
|
|
108
|
-
s.forEach((y) => {
|
|
109
|
-
y.style[a.isHorizontal() ? r : "top"] = `${o}px`;
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
e.forEach((s, g) => {
|
|
114
|
-
if (l.type === "fraction" && (s.querySelectorAll($(l.currentClass)).forEach((d) => {
|
|
115
|
-
d.textContent = l.formatFractionCurrent(n + 1);
|
|
116
|
-
}), s.querySelectorAll($(l.totalClass)).forEach((d) => {
|
|
117
|
-
d.textContent = l.formatFractionTotal(z);
|
|
118
|
-
})), l.type === "progressbar") {
|
|
119
|
-
let d;
|
|
120
|
-
l.progressbarOpposite ? d = a.isHorizontal() ? "vertical" : "horizontal" : d = a.isHorizontal() ? "horizontal" : "vertical";
|
|
121
|
-
const L = (n + 1) / z;
|
|
122
|
-
let i = 1, o = 1;
|
|
123
|
-
d === "horizontal" ? i = L : o = L, s.querySelectorAll($(l.progressbarFillClass)).forEach((r) => {
|
|
124
|
-
r.style.transform = `translate3d(0,0,0) scaleX(${i}) scaleY(${o})`, r.style.transitionDuration = `${a.params.speed}ms`;
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
l.type === "custom" && l.renderCustom ? (S(s, l.renderCustom(a, n + 1, z)), g === 0 && v("paginationRender", s)) : (g === 0 && v("paginationRender", s), v("paginationUpdate", s)), a.params.watchOverflow && a.enabled && s.classList[a.isLocked ? "add" : "remove"](l.lockClass);
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
function B() {
|
|
131
|
-
const t = a.params.pagination;
|
|
132
|
-
if (k()) return;
|
|
133
|
-
const l = a.virtual && a.params.virtual.enabled ? a.virtual.slides.length : a.grid && a.params.grid.rows > 1 ? a.slides.length / Math.ceil(a.params.grid.rows) : a.slides.length;
|
|
134
|
-
let e = a.pagination.el;
|
|
135
|
-
e = m(e);
|
|
136
|
-
let n = "";
|
|
137
|
-
if (t.type === "bullets") {
|
|
138
|
-
let c = a.params.loop ? Math.ceil(l / a.params.slidesPerGroup) : a.snapGrid.length;
|
|
139
|
-
a.params.freeMode && a.params.freeMode.enabled && c > l && (c = l);
|
|
140
|
-
for (let C = 0; C < c; C += 1)
|
|
141
|
-
t.renderBullet ? n += t.renderBullet.call(a, C, t.bulletClass) : n += `<${t.bulletElement} ${a.isElement ? 'part="bullet"' : ""} class="${t.bulletClass}"></${t.bulletElement}>`;
|
|
142
|
-
}
|
|
143
|
-
t.type === "fraction" && (t.renderFraction ? n = t.renderFraction.call(a, t.currentClass, t.totalClass) : n = `<span class="${t.currentClass}"></span> / <span class="${t.totalClass}"></span>`), t.type === "progressbar" && (t.renderProgressbar ? n = t.renderProgressbar.call(a, t.progressbarFillClass) : n = `<span class="${t.progressbarFillClass}"></span>`), a.pagination.bullets = [], e.forEach((c) => {
|
|
144
|
-
t.type !== "custom" && S(c, n || ""), t.type === "bullets" && a.pagination.bullets.push(...c.querySelectorAll($(t.bulletClass)));
|
|
145
|
-
}), t.type !== "custom" && v("paginationRender", e[0]);
|
|
146
|
-
}
|
|
147
|
-
function A() {
|
|
148
|
-
a.params.pagination = E(a, a.originalParams.pagination, a.params.pagination, {
|
|
149
|
-
el: "swiper-pagination"
|
|
150
|
-
});
|
|
151
|
-
const t = a.params.pagination;
|
|
152
|
-
if (!t.el) return;
|
|
153
|
-
let l;
|
|
154
|
-
typeof t.el == "string" && a.isElement && (l = a.el.querySelector(t.el)), !l && typeof t.el == "string" && (l = [...document.querySelectorAll(t.el)]), l || (l = t.el), !(!l || l.length === 0) && (a.params.uniqueNavElements && typeof t.el == "string" && Array.isArray(l) && l.length > 1 && (l = [...a.el.querySelectorAll(t.el)], l.length > 1 && (l = l.find((e) => q(e, ".swiper")[0] === a.el))), Array.isArray(l) && l.length === 1 && (l = l[0]), Object.assign(a.pagination, {
|
|
155
|
-
el: l
|
|
156
|
-
}), l = m(l), l.forEach((e) => {
|
|
157
|
-
t.type === "bullets" && t.clickable && e.classList.add(...(t.clickableClass || "").split(" ")), e.classList.add(t.modifierClass + t.type), e.classList.add(a.isHorizontal() ? t.horizontalClass : t.verticalClass), t.type === "bullets" && t.dynamicBullets && (e.classList.add(`${t.modifierClass}${t.type}-dynamic`), p = 0, t.dynamicMainBullets < 1 && (t.dynamicMainBullets = 1)), t.type === "progressbar" && t.progressbarOpposite && e.classList.add(t.progressbarOppositeClass), t.clickable && e.addEventListener("click", D), a.enabled || e.classList.add(t.lockClass);
|
|
158
|
-
}));
|
|
159
|
-
}
|
|
160
|
-
function M() {
|
|
161
|
-
const t = a.params.pagination;
|
|
162
|
-
if (k()) return;
|
|
163
|
-
let l = a.pagination.el;
|
|
164
|
-
l && (l = m(l), l.forEach((e) => {
|
|
165
|
-
e.classList.remove(t.hiddenClass), e.classList.remove(t.modifierClass + t.type), e.classList.remove(a.isHorizontal() ? t.horizontalClass : t.verticalClass), t.clickable && (e.classList.remove(...(t.clickableClass || "").split(" ")), e.removeEventListener("click", D));
|
|
166
|
-
})), a.pagination.bullets && a.pagination.bullets.forEach((e) => e.classList.remove(...t.bulletActiveClass.split(" ")));
|
|
167
|
-
}
|
|
168
|
-
u("changeDirection", () => {
|
|
169
|
-
if (!a.pagination || !a.pagination.el) return;
|
|
170
|
-
const t = a.params.pagination;
|
|
171
|
-
let {
|
|
172
|
-
el: l
|
|
173
|
-
} = a.pagination;
|
|
174
|
-
l = m(l), l.forEach((e) => {
|
|
175
|
-
e.classList.remove(t.horizontalClass, t.verticalClass), e.classList.add(a.isHorizontal() ? t.horizontalClass : t.verticalClass);
|
|
176
|
-
});
|
|
177
|
-
}), u("init", () => {
|
|
178
|
-
a.params.pagination.enabled === !1 ? I() : (A(), B(), h());
|
|
179
|
-
}), u("activeIndexChange", () => {
|
|
180
|
-
typeof a.snapIndex > "u" && h();
|
|
181
|
-
}), u("snapIndexChange", () => {
|
|
182
|
-
h();
|
|
183
|
-
}), u("snapGridLengthChange", () => {
|
|
184
|
-
B(), h();
|
|
185
|
-
}), u("destroy", () => {
|
|
186
|
-
M();
|
|
187
|
-
}), u("enable disable", () => {
|
|
188
|
-
let {
|
|
189
|
-
el: t
|
|
190
|
-
} = a.pagination;
|
|
191
|
-
t && (t = m(t), t.forEach((l) => l.classList[a.enabled ? "remove" : "add"](a.params.pagination.lockClass)));
|
|
192
|
-
}), u("lock unlock", () => {
|
|
193
|
-
h();
|
|
194
|
-
}), u("click", (t, l) => {
|
|
195
|
-
const e = l.target, n = m(a.pagination.el);
|
|
196
|
-
if (a.params.pagination.el && a.params.pagination.hideOnClick && n && n.length > 0 && !e.classList.contains(a.params.pagination.bulletClass)) {
|
|
197
|
-
if (a.navigation && (a.navigation.nextEl && e === a.navigation.nextEl || a.navigation.prevEl && e === a.navigation.prevEl)) return;
|
|
198
|
-
const c = n[0].classList.contains(a.params.pagination.hiddenClass);
|
|
199
|
-
v(c === !0 ? "paginationShow" : "paginationHide"), n.forEach((C) => C.classList.toggle(a.params.pagination.hiddenClass));
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
const F = () => {
|
|
203
|
-
a.el.classList.remove(a.params.pagination.paginationDisabledClass);
|
|
204
|
-
let {
|
|
205
|
-
el: t
|
|
206
|
-
} = a.pagination;
|
|
207
|
-
t && (t = m(t), t.forEach((l) => l.classList.remove(a.params.pagination.paginationDisabledClass))), A(), B(), h();
|
|
208
|
-
}, I = () => {
|
|
209
|
-
a.el.classList.add(a.params.pagination.paginationDisabledClass);
|
|
210
|
-
let {
|
|
211
|
-
el: t
|
|
212
|
-
} = a.pagination;
|
|
213
|
-
t && (t = m(t), t.forEach((l) => l.classList.add(a.params.pagination.paginationDisabledClass))), M();
|
|
214
|
-
};
|
|
215
|
-
Object.assign(a.pagination, {
|
|
216
|
-
enable: F,
|
|
217
|
-
disable: I,
|
|
218
|
-
render: B,
|
|
219
|
-
update: h,
|
|
220
|
-
init: A,
|
|
221
|
-
destroy: M
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
export {
|
|
225
|
-
N as default
|
|
226
|
-
};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { g as T } from "../shared/ssr-window.esm.js";
|
|
2
|
-
import { p as I, e as g } from "../shared/utils.js";
|
|
3
|
-
function P({
|
|
4
|
-
swiper: e,
|
|
5
|
-
extendParams: p,
|
|
6
|
-
on: m
|
|
7
|
-
}) {
|
|
8
|
-
p({
|
|
9
|
-
thumbs: {
|
|
10
|
-
swiper: null,
|
|
11
|
-
multipleActiveThumbs: !0,
|
|
12
|
-
autoScrollOffset: 0,
|
|
13
|
-
slideThumbActiveClass: "swiper-slide-thumb-active",
|
|
14
|
-
thumbsContainerClass: "swiper-thumbs"
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
let f = !1, h = !1;
|
|
18
|
-
e.thumbs = {
|
|
19
|
-
swiper: null
|
|
20
|
-
};
|
|
21
|
-
function x() {
|
|
22
|
-
const t = e.thumbs.swiper;
|
|
23
|
-
if (!t || t.destroyed) return;
|
|
24
|
-
const s = t.clickedIndex, r = t.clickedSlide;
|
|
25
|
-
if (r && r.classList.contains(e.params.thumbs.slideThumbActiveClass) || typeof s > "u" || s === null) return;
|
|
26
|
-
let a;
|
|
27
|
-
t.params.loop ? a = parseInt(t.clickedSlide.getAttribute("data-swiper-slide-index"), 10) : a = s, e.params.loop ? e.slideToLoop(a) : e.slideTo(a);
|
|
28
|
-
}
|
|
29
|
-
function c() {
|
|
30
|
-
const {
|
|
31
|
-
thumbs: t
|
|
32
|
-
} = e.params;
|
|
33
|
-
if (f) return !1;
|
|
34
|
-
f = !0;
|
|
35
|
-
const s = e.constructor;
|
|
36
|
-
if (t.swiper instanceof s) {
|
|
37
|
-
if (t.swiper.destroyed)
|
|
38
|
-
return f = !1, !1;
|
|
39
|
-
e.thumbs.swiper = t.swiper, Object.assign(e.thumbs.swiper.originalParams, {
|
|
40
|
-
watchSlidesProgress: !0,
|
|
41
|
-
slideToClickedSlide: !1
|
|
42
|
-
}), Object.assign(e.thumbs.swiper.params, {
|
|
43
|
-
watchSlidesProgress: !0,
|
|
44
|
-
slideToClickedSlide: !1
|
|
45
|
-
}), e.thumbs.swiper.update();
|
|
46
|
-
} else if (I(t.swiper)) {
|
|
47
|
-
const r = Object.assign({}, t.swiper);
|
|
48
|
-
Object.assign(r, {
|
|
49
|
-
watchSlidesProgress: !0,
|
|
50
|
-
slideToClickedSlide: !1
|
|
51
|
-
}), e.thumbs.swiper = new s(r), h = !0;
|
|
52
|
-
}
|
|
53
|
-
return e.thumbs.swiper.el.classList.add(e.params.thumbs.thumbsContainerClass), e.thumbs.swiper.on("tap", x), !0;
|
|
54
|
-
}
|
|
55
|
-
function o(t) {
|
|
56
|
-
const s = e.thumbs.swiper;
|
|
57
|
-
if (!s || s.destroyed) return;
|
|
58
|
-
const r = s.params.slidesPerView === "auto" ? s.slidesPerViewDynamic() : s.params.slidesPerView;
|
|
59
|
-
let a = 1;
|
|
60
|
-
const n = e.params.thumbs.slideThumbActiveClass;
|
|
61
|
-
if (e.params.slidesPerView > 1 && !e.params.centeredSlides && (a = e.params.slidesPerView), e.params.thumbs.multipleActiveThumbs || (a = 1), a = Math.floor(a), s.slides.forEach((i) => i.classList.remove(n)), s.params.loop || s.params.virtual && s.params.virtual.enabled)
|
|
62
|
-
for (let i = 0; i < a; i += 1)
|
|
63
|
-
g(s.slidesEl, `[data-swiper-slide-index="${e.realIndex + i}"]`).forEach((l) => {
|
|
64
|
-
l.classList.add(n);
|
|
65
|
-
});
|
|
66
|
-
else
|
|
67
|
-
for (let i = 0; i < a; i += 1)
|
|
68
|
-
s.slides[e.realIndex + i] && s.slides[e.realIndex + i].classList.add(n);
|
|
69
|
-
const d = e.params.thumbs.autoScrollOffset, u = d && !s.params.loop;
|
|
70
|
-
if (e.realIndex !== s.realIndex || u) {
|
|
71
|
-
const i = s.activeIndex;
|
|
72
|
-
let l, b;
|
|
73
|
-
if (s.params.loop) {
|
|
74
|
-
const v = s.slides.find((S) => S.getAttribute("data-swiper-slide-index") === `${e.realIndex}`);
|
|
75
|
-
l = s.slides.indexOf(v), b = e.activeIndex > e.previousIndex ? "next" : "prev";
|
|
76
|
-
} else
|
|
77
|
-
l = e.realIndex, b = l > e.previousIndex ? "next" : "prev";
|
|
78
|
-
u && (l += b === "next" ? d : -1 * d), s.visibleSlidesIndexes && s.visibleSlidesIndexes.indexOf(l) < 0 && (s.params.centeredSlides ? l > i ? l = l - Math.floor(r / 2) + 1 : l = l + Math.floor(r / 2) - 1 : l > i && s.params.slidesPerGroup, s.slideTo(l, t ? 0 : void 0));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
m("beforeInit", () => {
|
|
82
|
-
const {
|
|
83
|
-
thumbs: t
|
|
84
|
-
} = e.params;
|
|
85
|
-
if (!(!t || !t.swiper))
|
|
86
|
-
if (typeof t.swiper == "string" || t.swiper instanceof HTMLElement) {
|
|
87
|
-
const s = T(), r = () => {
|
|
88
|
-
const n = typeof t.swiper == "string" ? s.querySelector(t.swiper) : t.swiper;
|
|
89
|
-
if (n && n.swiper)
|
|
90
|
-
t.swiper = n.swiper, c(), o(!0);
|
|
91
|
-
else if (n) {
|
|
92
|
-
const d = `${e.params.eventsPrefix}init`, u = (i) => {
|
|
93
|
-
t.swiper = i.detail[0], n.removeEventListener(d, u), c(), o(!0), t.swiper.update(), e.update();
|
|
94
|
-
};
|
|
95
|
-
n.addEventListener(d, u);
|
|
96
|
-
}
|
|
97
|
-
return n;
|
|
98
|
-
}, a = () => {
|
|
99
|
-
if (e.destroyed) return;
|
|
100
|
-
r() || requestAnimationFrame(a);
|
|
101
|
-
};
|
|
102
|
-
requestAnimationFrame(a);
|
|
103
|
-
} else
|
|
104
|
-
c(), o(!0);
|
|
105
|
-
}), m("slideChange update resize observerUpdate", () => {
|
|
106
|
-
o();
|
|
107
|
-
}), m("setTransition", (t, s) => {
|
|
108
|
-
const r = e.thumbs.swiper;
|
|
109
|
-
!r || r.destroyed || r.setTransition(s);
|
|
110
|
-
}), m("beforeDestroy", () => {
|
|
111
|
-
const t = e.thumbs.swiper;
|
|
112
|
-
!t || t.destroyed || h && t.destroy();
|
|
113
|
-
}), Object.assign(e.thumbs, {
|
|
114
|
-
init: c,
|
|
115
|
-
update: o
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
export {
|
|
119
|
-
P as default
|
|
120
|
-
};
|
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
import { a as he } from "../shared/ssr-window.esm.js";
|
|
2
|
-
import { e as oe, d as G, f as se, l as re } from "../shared/utils.js";
|
|
3
|
-
function ve({
|
|
4
|
-
swiper: n,
|
|
5
|
-
extendParams: le,
|
|
6
|
-
on: p,
|
|
7
|
-
emit: ce
|
|
8
|
-
}) {
|
|
9
|
-
const x = he();
|
|
10
|
-
le({
|
|
11
|
-
zoom: {
|
|
12
|
-
enabled: !1,
|
|
13
|
-
limitToOriginalSize: !1,
|
|
14
|
-
maxRatio: 3,
|
|
15
|
-
minRatio: 1,
|
|
16
|
-
panOnMouseMove: !1,
|
|
17
|
-
toggle: !0,
|
|
18
|
-
containerClass: "swiper-zoom-container",
|
|
19
|
-
zoomedSlideClass: "swiper-slide-zoomed"
|
|
20
|
-
}
|
|
21
|
-
}), n.zoom = {
|
|
22
|
-
enabled: !1
|
|
23
|
-
};
|
|
24
|
-
let u = 1, H = !1, C = !1, v = {
|
|
25
|
-
x: 0,
|
|
26
|
-
y: 0
|
|
27
|
-
};
|
|
28
|
-
const k = -3;
|
|
29
|
-
let S, T;
|
|
30
|
-
const s = [], t = {
|
|
31
|
-
originX: 0,
|
|
32
|
-
originY: 0,
|
|
33
|
-
slideEl: void 0,
|
|
34
|
-
slideWidth: void 0,
|
|
35
|
-
slideHeight: void 0,
|
|
36
|
-
imageEl: void 0,
|
|
37
|
-
imageWrapEl: void 0,
|
|
38
|
-
maxRatio: 3
|
|
39
|
-
}, e = {
|
|
40
|
-
isTouched: void 0,
|
|
41
|
-
isMoved: void 0,
|
|
42
|
-
currentX: void 0,
|
|
43
|
-
currentY: void 0,
|
|
44
|
-
minX: void 0,
|
|
45
|
-
minY: void 0,
|
|
46
|
-
maxX: void 0,
|
|
47
|
-
maxY: void 0,
|
|
48
|
-
width: void 0,
|
|
49
|
-
height: void 0,
|
|
50
|
-
startX: void 0,
|
|
51
|
-
startY: void 0,
|
|
52
|
-
touchesStart: {},
|
|
53
|
-
touchesCurrent: {}
|
|
54
|
-
}, l = {
|
|
55
|
-
x: void 0,
|
|
56
|
-
y: void 0,
|
|
57
|
-
prevPositionX: void 0,
|
|
58
|
-
prevPositionY: void 0,
|
|
59
|
-
prevTime: void 0
|
|
60
|
-
};
|
|
61
|
-
let P = 1;
|
|
62
|
-
Object.defineProperty(n.zoom, "scale", {
|
|
63
|
-
get() {
|
|
64
|
-
return P;
|
|
65
|
-
},
|
|
66
|
-
set(a) {
|
|
67
|
-
if (P !== a) {
|
|
68
|
-
const o = t.imageEl, i = t.slideEl;
|
|
69
|
-
ce("zoomChange", a, o, i);
|
|
70
|
-
}
|
|
71
|
-
P = a;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
function Z() {
|
|
75
|
-
if (s.length < 2) return 1;
|
|
76
|
-
const a = s[0].pageX, o = s[0].pageY, i = s[1].pageX, r = s[1].pageY;
|
|
77
|
-
return Math.sqrt((i - a) ** 2 + (r - o) ** 2);
|
|
78
|
-
}
|
|
79
|
-
function _() {
|
|
80
|
-
const a = n.params.zoom, o = t.imageWrapEl.getAttribute("data-swiper-zoom") || a.maxRatio;
|
|
81
|
-
if (a.limitToOriginalSize && t.imageEl && t.imageEl.naturalWidth) {
|
|
82
|
-
const i = t.imageEl.naturalWidth / t.imageEl.offsetWidth;
|
|
83
|
-
return Math.min(i, o);
|
|
84
|
-
}
|
|
85
|
-
return o;
|
|
86
|
-
}
|
|
87
|
-
function me() {
|
|
88
|
-
if (s.length < 2) return {
|
|
89
|
-
x: null,
|
|
90
|
-
y: null
|
|
91
|
-
};
|
|
92
|
-
const a = t.imageEl.getBoundingClientRect();
|
|
93
|
-
return [(s[0].pageX + (s[1].pageX - s[0].pageX) / 2 - a.x - x.scrollX) / u, (s[0].pageY + (s[1].pageY - s[0].pageY) / 2 - a.y - x.scrollY) / u];
|
|
94
|
-
}
|
|
95
|
-
function ue() {
|
|
96
|
-
return n.isElement ? "swiper-slide" : `.${n.params.slideClass}`;
|
|
97
|
-
}
|
|
98
|
-
function M(a) {
|
|
99
|
-
const o = ue();
|
|
100
|
-
return !!(a.target.matches(o) || n.slides.filter((i) => i.contains(a.target)).length > 0);
|
|
101
|
-
}
|
|
102
|
-
function j(a) {
|
|
103
|
-
const o = `.${n.params.zoom.containerClass}`;
|
|
104
|
-
return !!(a.target.matches(o) || [...n.hostEl.querySelectorAll(o)].filter((i) => i.contains(a.target)).length > 0);
|
|
105
|
-
}
|
|
106
|
-
function B(a) {
|
|
107
|
-
if (a.pointerType === "mouse" && s.splice(0, s.length), !M(a)) return;
|
|
108
|
-
const o = n.params.zoom;
|
|
109
|
-
if (S = !1, T = !1, s.push(a), !(s.length < 2)) {
|
|
110
|
-
if (S = !0, t.scaleStart = Z(), !t.slideEl) {
|
|
111
|
-
t.slideEl = a.target.closest(`.${n.params.slideClass}, swiper-slide`), t.slideEl || (t.slideEl = n.slides[n.activeIndex]);
|
|
112
|
-
let i = t.slideEl.querySelector(`.${o.containerClass}`);
|
|
113
|
-
if (i && (i = i.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]), t.imageEl = i, i ? t.imageWrapEl = G(t.imageEl, `.${o.containerClass}`)[0] : t.imageWrapEl = void 0, !t.imageWrapEl) {
|
|
114
|
-
t.imageEl = void 0;
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
t.maxRatio = _();
|
|
118
|
-
}
|
|
119
|
-
if (t.imageEl) {
|
|
120
|
-
const [i, r] = me();
|
|
121
|
-
t.originX = i, t.originY = r, t.imageEl.style.transitionDuration = "0ms";
|
|
122
|
-
}
|
|
123
|
-
H = !0;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
function F(a) {
|
|
127
|
-
if (!M(a)) return;
|
|
128
|
-
const o = n.params.zoom, i = n.zoom, r = s.findIndex((c) => c.pointerId === a.pointerId);
|
|
129
|
-
r >= 0 && (s[r] = a), !(s.length < 2) && (T = !0, t.scaleMove = Z(), t.imageEl && (i.scale = t.scaleMove / t.scaleStart * u, i.scale > t.maxRatio && (i.scale = t.maxRatio - 1 + (i.scale - t.maxRatio + 1) ** 0.5), i.scale < o.minRatio && (i.scale = o.minRatio + 1 - (o.minRatio - i.scale + 1) ** 0.5), t.imageEl.style.transform = `translate3d(0,0,0) scale(${i.scale})`));
|
|
130
|
-
}
|
|
131
|
-
function J(a) {
|
|
132
|
-
if (!M(a) || a.pointerType === "mouse" && a.type === "pointerout") return;
|
|
133
|
-
const o = n.params.zoom, i = n.zoom, r = s.findIndex((c) => c.pointerId === a.pointerId);
|
|
134
|
-
r >= 0 && s.splice(r, 1), !(!S || !T) && (S = !1, T = !1, t.imageEl && (i.scale = Math.max(Math.min(i.scale, t.maxRatio), o.minRatio), t.imageEl.style.transitionDuration = `${n.params.speed}ms`, t.imageEl.style.transform = `translate3d(0,0,0) scale(${i.scale})`, u = i.scale, H = !1, i.scale > 1 && t.slideEl ? t.slideEl.classList.add(`${o.zoomedSlideClass}`) : i.scale <= 1 && t.slideEl && t.slideEl.classList.remove(`${o.zoomedSlideClass}`), i.scale === 1 && (t.originX = 0, t.originY = 0, t.slideEl = void 0)));
|
|
135
|
-
}
|
|
136
|
-
let K;
|
|
137
|
-
function L() {
|
|
138
|
-
n.touchEventsData.preventTouchMoveFromPointerMove = !1;
|
|
139
|
-
}
|
|
140
|
-
function de() {
|
|
141
|
-
clearTimeout(K), n.touchEventsData.preventTouchMoveFromPointerMove = !0, K = setTimeout(() => {
|
|
142
|
-
n.destroyed || L();
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
function fe(a) {
|
|
146
|
-
const o = n.device;
|
|
147
|
-
if (!t.imageEl || e.isTouched) return;
|
|
148
|
-
o.android && a.cancelable && a.preventDefault(), e.isTouched = !0;
|
|
149
|
-
const i = s.length > 0 ? s[0] : a;
|
|
150
|
-
e.touchesStart.x = i.pageX, e.touchesStart.y = i.pageY;
|
|
151
|
-
}
|
|
152
|
-
function N(a) {
|
|
153
|
-
const i = a.pointerType === "mouse" && n.params.zoom.panOnMouseMove;
|
|
154
|
-
if (!M(a) || !j(a))
|
|
155
|
-
return;
|
|
156
|
-
const r = n.zoom;
|
|
157
|
-
if (!t.imageEl)
|
|
158
|
-
return;
|
|
159
|
-
if (!e.isTouched || !t.slideEl) {
|
|
160
|
-
i && U(a);
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
if (i) {
|
|
164
|
-
U(a);
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
e.isMoved || (e.width = t.imageEl.offsetWidth || t.imageEl.clientWidth, e.height = t.imageEl.offsetHeight || t.imageEl.clientHeight, e.startX = re(t.imageWrapEl, "x") || 0, e.startY = re(t.imageWrapEl, "y") || 0, t.slideWidth = t.slideEl.offsetWidth, t.slideHeight = t.slideEl.offsetHeight, t.imageWrapEl.style.transitionDuration = "0ms");
|
|
168
|
-
const c = e.width * r.scale, g = e.height * r.scale;
|
|
169
|
-
if (e.minX = Math.min(t.slideWidth / 2 - c / 2, 0), e.maxX = -e.minX, e.minY = Math.min(t.slideHeight / 2 - g / 2, 0), e.maxY = -e.minY, e.touchesCurrent.x = s.length > 0 ? s[0].pageX : a.pageX, e.touchesCurrent.y = s.length > 0 ? s[0].pageY : a.pageY, Math.max(Math.abs(e.touchesCurrent.x - e.touchesStart.x), Math.abs(e.touchesCurrent.y - e.touchesStart.y)) > 5 && (n.allowClick = !1), !e.isMoved && !H) {
|
|
170
|
-
if (n.isHorizontal() && (Math.floor(e.minX) === Math.floor(e.startX) && e.touchesCurrent.x < e.touchesStart.x || Math.floor(e.maxX) === Math.floor(e.startX) && e.touchesCurrent.x > e.touchesStart.x)) {
|
|
171
|
-
e.isTouched = !1, L();
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
if (!n.isHorizontal() && (Math.floor(e.minY) === Math.floor(e.startY) && e.touchesCurrent.y < e.touchesStart.y || Math.floor(e.maxY) === Math.floor(e.startY) && e.touchesCurrent.y > e.touchesStart.y)) {
|
|
175
|
-
e.isTouched = !1, L();
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
a.cancelable && a.preventDefault(), a.stopPropagation(), de(), e.isMoved = !0;
|
|
180
|
-
const f = (r.scale - u) / (t.maxRatio - n.params.zoom.minRatio), {
|
|
181
|
-
originX: E,
|
|
182
|
-
originY: m
|
|
183
|
-
} = t;
|
|
184
|
-
e.currentX = e.touchesCurrent.x - e.touchesStart.x + e.startX + f * (e.width - E * 2), e.currentY = e.touchesCurrent.y - e.touchesStart.y + e.startY + f * (e.height - m * 2), e.currentX < e.minX && (e.currentX = e.minX + 1 - (e.minX - e.currentX + 1) ** 0.8), e.currentX > e.maxX && (e.currentX = e.maxX - 1 + (e.currentX - e.maxX + 1) ** 0.8), e.currentY < e.minY && (e.currentY = e.minY + 1 - (e.minY - e.currentY + 1) ** 0.8), e.currentY > e.maxY && (e.currentY = e.maxY - 1 + (e.currentY - e.maxY + 1) ** 0.8), l.prevPositionX || (l.prevPositionX = e.touchesCurrent.x), l.prevPositionY || (l.prevPositionY = e.touchesCurrent.y), l.prevTime || (l.prevTime = Date.now()), l.x = (e.touchesCurrent.x - l.prevPositionX) / (Date.now() - l.prevTime) / 2, l.y = (e.touchesCurrent.y - l.prevPositionY) / (Date.now() - l.prevTime) / 2, Math.abs(e.touchesCurrent.x - l.prevPositionX) < 2 && (l.x = 0), Math.abs(e.touchesCurrent.y - l.prevPositionY) < 2 && (l.y = 0), l.prevPositionX = e.touchesCurrent.x, l.prevPositionY = e.touchesCurrent.y, l.prevTime = Date.now(), t.imageWrapEl.style.transform = `translate3d(${e.currentX}px, ${e.currentY}px,0)`;
|
|
185
|
-
}
|
|
186
|
-
function ge() {
|
|
187
|
-
const a = n.zoom;
|
|
188
|
-
if (s.length = 0, !t.imageEl) return;
|
|
189
|
-
if (!e.isTouched || !e.isMoved) {
|
|
190
|
-
e.isTouched = !1, e.isMoved = !1;
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
e.isTouched = !1, e.isMoved = !1;
|
|
194
|
-
let o = 300, i = 300;
|
|
195
|
-
const r = l.x * o, c = e.currentX + r, g = l.y * i, h = e.currentY + g;
|
|
196
|
-
l.x !== 0 && (o = Math.abs((c - e.currentX) / l.x)), l.y !== 0 && (i = Math.abs((h - e.currentY) / l.y));
|
|
197
|
-
const f = Math.max(o, i);
|
|
198
|
-
e.currentX = c, e.currentY = h;
|
|
199
|
-
const E = e.width * a.scale, m = e.height * a.scale;
|
|
200
|
-
e.minX = Math.min(t.slideWidth / 2 - E / 2, 0), e.maxX = -e.minX, e.minY = Math.min(t.slideHeight / 2 - m / 2, 0), e.maxY = -e.minY, e.currentX = Math.max(Math.min(e.currentX, e.maxX), e.minX), e.currentY = Math.max(Math.min(e.currentY, e.maxY), e.minY), t.imageWrapEl.style.transitionDuration = `${f}ms`, t.imageWrapEl.style.transform = `translate3d(${e.currentX}px, ${e.currentY}px,0)`;
|
|
201
|
-
}
|
|
202
|
-
function Q() {
|
|
203
|
-
const a = n.zoom;
|
|
204
|
-
t.slideEl && n.activeIndex !== n.slides.indexOf(t.slideEl) && (t.imageEl && (t.imageEl.style.transform = "translate3d(0,0,0) scale(1)"), t.imageWrapEl && (t.imageWrapEl.style.transform = "translate3d(0,0,0)"), t.slideEl.classList.remove(`${n.params.zoom.zoomedSlideClass}`), a.scale = 1, u = 1, t.slideEl = void 0, t.imageEl = void 0, t.imageWrapEl = void 0, t.originX = 0, t.originY = 0);
|
|
205
|
-
}
|
|
206
|
-
function U(a) {
|
|
207
|
-
if (u <= 1 || !t.imageWrapEl || !M(a) || !j(a)) return;
|
|
208
|
-
const o = x.getComputedStyle(t.imageWrapEl).transform, i = new x.DOMMatrix(o);
|
|
209
|
-
if (!C) {
|
|
210
|
-
C = !0, v.x = a.clientX, v.y = a.clientY, e.startX = i.e, e.startY = i.f, e.width = t.imageEl.offsetWidth || t.imageEl.clientWidth, e.height = t.imageEl.offsetHeight || t.imageEl.clientHeight, t.slideWidth = t.slideEl.offsetWidth, t.slideHeight = t.slideEl.offsetHeight;
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
const r = (a.clientX - v.x) * k, c = (a.clientY - v.y) * k, g = e.width * u, h = e.height * u, f = t.slideWidth, E = t.slideHeight, m = Math.min(f / 2 - g / 2, 0), d = -m, z = Math.min(E / 2 - h / 2, 0), b = -z, X = Math.max(Math.min(e.startX + r, d), m), Y = Math.max(Math.min(e.startY + c, b), z);
|
|
214
|
-
t.imageWrapEl.style.transitionDuration = "0ms", t.imageWrapEl.style.transform = `translate3d(${X}px, ${Y}px, 0)`, v.x = a.clientX, v.y = a.clientY, e.startX = X, e.startY = Y, e.currentX = X, e.currentY = Y;
|
|
215
|
-
}
|
|
216
|
-
function V(a) {
|
|
217
|
-
const o = n.zoom, i = n.params.zoom;
|
|
218
|
-
if (!t.slideEl) {
|
|
219
|
-
a && a.target && (t.slideEl = a.target.closest(`.${n.params.slideClass}, swiper-slide`)), t.slideEl || (n.params.virtual && n.params.virtual.enabled && n.virtual ? t.slideEl = oe(n.slidesEl, `.${n.params.slideActiveClass}`)[0] : t.slideEl = n.slides[n.activeIndex]);
|
|
220
|
-
let W = t.slideEl.querySelector(`.${i.containerClass}`);
|
|
221
|
-
W && (W = W.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]), t.imageEl = W, W ? t.imageWrapEl = G(t.imageEl, `.${i.containerClass}`)[0] : t.imageWrapEl = void 0;
|
|
222
|
-
}
|
|
223
|
-
if (!t.imageEl || !t.imageWrapEl) return;
|
|
224
|
-
n.params.cssMode && (n.wrapperEl.style.overflow = "hidden", n.wrapperEl.style.touchAction = "none"), t.slideEl.classList.add(`${i.zoomedSlideClass}`);
|
|
225
|
-
let r, c, g, h, f, E, m, d, z, b, X, Y, $, D, R, I, O, A;
|
|
226
|
-
typeof e.touchesStart.x > "u" && a ? (r = a.pageX, c = a.pageY) : (r = e.touchesStart.x, c = e.touchesStart.y);
|
|
227
|
-
const q = u, y = typeof a == "number" ? a : null;
|
|
228
|
-
u === 1 && y && (r = void 0, c = void 0, e.touchesStart.x = void 0, e.touchesStart.y = void 0);
|
|
229
|
-
const ie = _();
|
|
230
|
-
o.scale = y || ie, u = y || ie, a && !(u === 1 && y) ? (O = t.slideEl.offsetWidth, A = t.slideEl.offsetHeight, g = se(t.slideEl).left + x.scrollX, h = se(t.slideEl).top + x.scrollY, f = g + O / 2 - r, E = h + A / 2 - c, z = t.imageEl.offsetWidth || t.imageEl.clientWidth, b = t.imageEl.offsetHeight || t.imageEl.clientHeight, X = z * o.scale, Y = b * o.scale, $ = Math.min(O / 2 - X / 2, 0), D = Math.min(A / 2 - Y / 2, 0), R = -$, I = -D, q > 0 && y && typeof e.currentX == "number" && typeof e.currentY == "number" ? (m = e.currentX * o.scale / q, d = e.currentY * o.scale / q) : (m = f * o.scale, d = E * o.scale), m < $ && (m = $), m > R && (m = R), d < D && (d = D), d > I && (d = I)) : (m = 0, d = 0), y && o.scale === 1 && (t.originX = 0, t.originY = 0), e.currentX = m, e.currentY = d, t.imageWrapEl.style.transitionDuration = "300ms", t.imageWrapEl.style.transform = `translate3d(${m}px, ${d}px,0)`, t.imageEl.style.transitionDuration = "300ms", t.imageEl.style.transform = `translate3d(0,0,0) scale(${o.scale})`;
|
|
231
|
-
}
|
|
232
|
-
function w() {
|
|
233
|
-
const a = n.zoom, o = n.params.zoom;
|
|
234
|
-
if (!t.slideEl) {
|
|
235
|
-
n.params.virtual && n.params.virtual.enabled && n.virtual ? t.slideEl = oe(n.slidesEl, `.${n.params.slideActiveClass}`)[0] : t.slideEl = n.slides[n.activeIndex];
|
|
236
|
-
let i = t.slideEl.querySelector(`.${o.containerClass}`);
|
|
237
|
-
i && (i = i.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]), t.imageEl = i, i ? t.imageWrapEl = G(t.imageEl, `.${o.containerClass}`)[0] : t.imageWrapEl = void 0;
|
|
238
|
-
}
|
|
239
|
-
!t.imageEl || !t.imageWrapEl || (n.params.cssMode && (n.wrapperEl.style.overflow = "", n.wrapperEl.style.touchAction = ""), a.scale = 1, u = 1, e.currentX = void 0, e.currentY = void 0, e.touchesStart.x = void 0, e.touchesStart.y = void 0, t.imageWrapEl.style.transitionDuration = "300ms", t.imageWrapEl.style.transform = "translate3d(0,0,0)", t.imageEl.style.transitionDuration = "300ms", t.imageEl.style.transform = "translate3d(0,0,0) scale(1)", t.slideEl.classList.remove(`${o.zoomedSlideClass}`), t.slideEl = void 0, t.originX = 0, t.originY = 0, n.params.zoom.panOnMouseMove && (v = {
|
|
240
|
-
x: 0,
|
|
241
|
-
y: 0
|
|
242
|
-
}, C && (C = !1, e.startX = 0, e.startY = 0)));
|
|
243
|
-
}
|
|
244
|
-
function ee(a) {
|
|
245
|
-
const o = n.zoom;
|
|
246
|
-
o.scale && o.scale !== 1 ? w() : V(a);
|
|
247
|
-
}
|
|
248
|
-
function te() {
|
|
249
|
-
const a = n.params.passiveListeners ? {
|
|
250
|
-
passive: !0,
|
|
251
|
-
capture: !1
|
|
252
|
-
} : !1, o = n.params.passiveListeners ? {
|
|
253
|
-
passive: !1,
|
|
254
|
-
capture: !0
|
|
255
|
-
} : !0;
|
|
256
|
-
return {
|
|
257
|
-
passiveListener: a,
|
|
258
|
-
activeListenerWithCapture: o
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
function ae() {
|
|
262
|
-
const a = n.zoom;
|
|
263
|
-
if (a.enabled) return;
|
|
264
|
-
a.enabled = !0;
|
|
265
|
-
const {
|
|
266
|
-
passiveListener: o,
|
|
267
|
-
activeListenerWithCapture: i
|
|
268
|
-
} = te();
|
|
269
|
-
n.wrapperEl.addEventListener("pointerdown", B, o), n.wrapperEl.addEventListener("pointermove", F, i), ["pointerup", "pointercancel", "pointerout"].forEach((r) => {
|
|
270
|
-
n.wrapperEl.addEventListener(r, J, o);
|
|
271
|
-
}), n.wrapperEl.addEventListener("pointermove", N, i);
|
|
272
|
-
}
|
|
273
|
-
function ne() {
|
|
274
|
-
const a = n.zoom;
|
|
275
|
-
if (!a.enabled) return;
|
|
276
|
-
a.enabled = !1;
|
|
277
|
-
const {
|
|
278
|
-
passiveListener: o,
|
|
279
|
-
activeListenerWithCapture: i
|
|
280
|
-
} = te();
|
|
281
|
-
n.wrapperEl.removeEventListener("pointerdown", B, o), n.wrapperEl.removeEventListener("pointermove", F, i), ["pointerup", "pointercancel", "pointerout"].forEach((r) => {
|
|
282
|
-
n.wrapperEl.removeEventListener(r, J, o);
|
|
283
|
-
}), n.wrapperEl.removeEventListener("pointermove", N, i);
|
|
284
|
-
}
|
|
285
|
-
p("init", () => {
|
|
286
|
-
n.params.zoom.enabled && ae();
|
|
287
|
-
}), p("destroy", () => {
|
|
288
|
-
ne();
|
|
289
|
-
}), p("touchStart", (a, o) => {
|
|
290
|
-
n.zoom.enabled && fe(o);
|
|
291
|
-
}), p("touchEnd", (a, o) => {
|
|
292
|
-
n.zoom.enabled && ge();
|
|
293
|
-
}), p("doubleTap", (a, o) => {
|
|
294
|
-
!n.animating && n.params.zoom.enabled && n.zoom.enabled && n.params.zoom.toggle && ee(o);
|
|
295
|
-
}), p("transitionEnd", () => {
|
|
296
|
-
n.zoom.enabled && n.params.zoom.enabled && Q();
|
|
297
|
-
}), p("slideChange", () => {
|
|
298
|
-
n.zoom.enabled && n.params.zoom.enabled && n.params.cssMode && Q();
|
|
299
|
-
}), Object.assign(n.zoom, {
|
|
300
|
-
enable: ae,
|
|
301
|
-
disable: ne,
|
|
302
|
-
in: V,
|
|
303
|
-
out: w,
|
|
304
|
-
toggle: ee
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
export {
|
|
308
|
-
ve as default
|
|
309
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { e as i, c as m } from "./utils.js";
|
|
2
|
-
function o(f, a, n, l) {
|
|
3
|
-
return f.params.createElements && Object.keys(l).forEach((e) => {
|
|
4
|
-
if (!n[e] && n.auto === !0) {
|
|
5
|
-
let t = i(f.el, `.${l[e]}`)[0];
|
|
6
|
-
t || (t = m("div", l[e]), t.className = l[e], f.el.append(t)), n[e] = t, a[e] = t;
|
|
7
|
-
}
|
|
8
|
-
}), n;
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
o as c
|
|
12
|
-
};
|