@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.
Files changed (160) hide show
  1. package/components/Popover/index.d.ts +3 -1
  2. package/index.js +1 -1
  3. package/index10.js +1 -1
  4. package/index10.mjs +1 -0
  5. package/index102.js +1 -1
  6. package/index102.mjs +3 -3
  7. package/index103.js +1 -1
  8. package/index103.mjs +1 -1
  9. package/index110.js +1 -1
  10. package/index110.mjs +2 -2
  11. package/index116.js +1 -1
  12. package/index116.mjs +9 -9
  13. package/index117.js +1 -1
  14. package/index117.mjs +9 -9
  15. package/index121.js +1 -1
  16. package/index121.mjs +2 -2
  17. package/index127.js +1 -1
  18. package/index127.mjs +46 -12
  19. package/index128.js +1 -1
  20. package/index128.mjs +241 -46
  21. package/index129.js +2 -1
  22. package/index129.mjs +13 -241
  23. package/index13.js +1 -1
  24. package/index13.mjs +9 -8
  25. package/index130.js +1 -2
  26. package/index130.mjs +29 -12
  27. package/index131.js +1 -1
  28. package/index131.mjs +11 -29
  29. package/index132.js +1 -1
  30. package/index132.mjs +2 -2
  31. package/index135.js +1 -1
  32. package/index135.mjs +196 -58
  33. package/index136.js +1 -1
  34. package/index136.mjs +60 -90
  35. package/index137.js +1 -1
  36. package/index137.mjs +140 -32
  37. package/index138.js +1 -1
  38. package/index138.mjs +114 -116
  39. package/index139.js +1 -1
  40. package/index139.mjs +217 -27
  41. package/index140.js +1 -1
  42. package/index140.mjs +188 -122
  43. package/index141.js +1 -1
  44. package/index141.mjs +67 -132
  45. package/index142.js +1 -1
  46. package/index142.mjs +258 -14
  47. package/index143.js +1 -1
  48. package/index143.mjs +92 -90
  49. package/index144.js +1 -1
  50. package/index144.mjs +172 -104
  51. package/index145.js +1 -1
  52. package/index145.mjs +84 -5
  53. package/index146.js +1 -1
  54. package/index146.mjs +58 -3
  55. package/index147.js +1 -1
  56. package/index147.mjs +123 -122
  57. package/index148.js +1 -1
  58. package/index148.mjs +113 -26
  59. package/index149.js +1 -1
  60. package/index149.mjs +119 -48
  61. package/index150.js +1 -1
  62. package/index150.mjs +72 -44
  63. package/index151.js +1 -1
  64. package/index151.mjs +107 -34
  65. package/index152.js +1 -1
  66. package/index152.mjs +50 -111
  67. package/index153.js +1 -1
  68. package/index153.mjs +93 -77
  69. package/index154.js +1 -1
  70. package/index154.mjs +70 -101
  71. package/index155.js +1 -1
  72. package/index155.mjs +57 -98
  73. package/index156.js +1 -1
  74. package/index156.mjs +92 -192
  75. package/index157.js +5 -1
  76. package/index157.mjs +75 -59
  77. package/index158.js +1 -1
  78. package/index158.mjs +1995 -125
  79. package/index159.js +1 -1
  80. package/index159.mjs +56 -116
  81. package/index160.js +1 -1
  82. package/index160.mjs +185 -214
  83. package/index161.js +1 -1
  84. package/index161.mjs +58 -187
  85. package/index162.js +1 -1
  86. package/index162.mjs +89 -64
  87. package/index163.js +1 -1
  88. package/index163.mjs +32 -257
  89. package/index164.js +1 -1
  90. package/index164.mjs +117 -93
  91. package/index165.js +1 -1
  92. package/index165.mjs +27 -174
  93. package/index166.js +1 -1
  94. package/index166.mjs +123 -83
  95. package/index167.js +1 -1
  96. package/index167.mjs +132 -56
  97. package/index168.js +1 -1
  98. package/index168.mjs +14 -126
  99. package/index169.js +1 -1
  100. package/index169.mjs +92 -113
  101. package/index170.js +1 -1
  102. package/index170.mjs +103 -119
  103. package/index171.js +1 -1
  104. package/index171.mjs +5 -72
  105. package/index172.js +1 -1
  106. package/index172.mjs +3 -110
  107. package/index173.js +1 -1
  108. package/index173.mjs +124 -51
  109. package/index174.js +1 -1
  110. package/index174.mjs +29 -93
  111. package/index175.js +1 -1
  112. package/index175.mjs +51 -70
  113. package/index176.js +1 -1
  114. package/index176.mjs +44 -56
  115. package/index177.js +1 -1
  116. package/index177.mjs +36 -98
  117. package/index178.js +1 -5
  118. package/index178.mjs +111 -78
  119. package/index179.js +1 -1
  120. package/index179.mjs +74 -2008
  121. package/index180.js +1 -1
  122. package/index180.mjs +99 -57
  123. package/index181.js +1 -1
  124. package/index181.mjs +98 -189
  125. package/index182.js +1 -1
  126. package/index182.mjs +130 -5
  127. package/index183.js +1 -1
  128. package/index183.mjs +172 -123
  129. package/index184.js +1 -1
  130. package/index184.mjs +8 -178
  131. package/index185.js +1 -1
  132. package/index185.mjs +3 -9
  133. package/index186.js +1 -1
  134. package/index186.mjs +36 -3
  135. package/index187.js +1 -1
  136. package/index187.mjs +5 -36
  137. package/index188.js +1 -1
  138. package/index188.mjs +29 -5
  139. package/index189.js +1 -1
  140. package/index189.mjs +6 -29
  141. package/index190.js +1 -1
  142. package/index190.mjs +5 -6
  143. package/index191.js +1 -1
  144. package/index191.mjs +1 -1
  145. package/index2.js +1 -1
  146. package/index2.mjs +44 -43
  147. package/index23.js +1 -1
  148. package/index23.mjs +39 -38
  149. package/index24.js +1 -1
  150. package/index24.mjs +40 -39
  151. package/index6.js +1 -1
  152. package/index6.mjs +34 -34
  153. package/index88.js +1 -1
  154. package/index88.mjs +16 -13
  155. package/index98.js +1 -1
  156. package/index98.mjs +3 -3
  157. package/index99.js +1 -1
  158. package/index99.mjs +1 -1
  159. package/package.json +1 -1
  160. package/theme/DatePicker/index.d.ts +3 -2
package/index144.mjs CHANGED
@@ -1,109 +1,177 @@
1
- import { CalendarDateTime as w } from "./index140.mjs";
2
- import { constrain as x } from "./index141.mjs";
3
- import { GregorianCalendar as $, getExtendedYear as d } from "./index143.mjs";
4
- import { getLocalTimeZone as h } from "./index132.mjs";
5
- function u(e) {
6
- e = b(e, new $());
7
- let t = d(e.era, e.year);
8
- return y(t, e.month, e.day, e.hour, e.minute, e.second, e.millisecond);
9
- }
10
- function y(e, t, n, r, o, a, c) {
11
- let f = /* @__PURE__ */ new Date();
12
- return f.setUTCHours(r, o, a, c), f.setUTCFullYear(e, t - 1, n), f.getTime();
13
- }
14
- function l(e, t) {
15
- if (t === "UTC") return 0;
16
- if (e > 0 && t === h()) return new Date(e).getTimezoneOffset() * -6e4;
17
- let { year: n, month: r, day: o, hour: a, minute: c, second: f } = p(e, t);
18
- return y(n, r, o, a, c, f, 0) - Math.floor(e / 1e3) * 1e3;
19
- }
20
- const s = /* @__PURE__ */ new Map();
21
- function p(e, t) {
22
- let n = s.get(t);
23
- n || (n = new Intl.DateTimeFormat("en-US", {
24
- timeZone: t,
25
- hour12: !1,
26
- era: "short",
27
- year: "numeric",
28
- month: "numeric",
29
- day: "numeric",
30
- hour: "numeric",
31
- minute: "numeric",
32
- second: "numeric"
33
- }), s.set(t, n));
34
- let r = n.formatToParts(new Date(e)), o = {};
35
- for (let a of r) a.type !== "literal" && (o[a.type] = a.value);
36
- return {
37
- // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
38
- year: o.era === "BC" || o.era === "B" ? -o.year + 1 : +o.year,
39
- month: +o.month,
40
- day: +o.day,
41
- hour: o.hour === "24" ? 0 : +o.hour,
42
- minute: +o.minute,
43
- second: +o.second
1
+ import { c as v } from "./index185.mjs";
2
+ import { c as U, g as q, m as n } from "./index183.mjs";
3
+ function K(R) {
4
+ let {
5
+ swiper: i,
6
+ extendParams: I,
7
+ on: o
8
+ } = R;
9
+ I({
10
+ a11y: {
11
+ enabled: !0,
12
+ notificationClass: "swiper-notification",
13
+ prevSlideMessage: "Previous slide",
14
+ nextSlideMessage: "Next slide",
15
+ firstSlideMessage: "This is the first slide",
16
+ lastSlideMessage: "This is the last slide",
17
+ paginationBulletMessage: "Go to slide {{index}}",
18
+ slideLabelMessage: "{{index}} / {{slidesLength}}",
19
+ containerMessage: null,
20
+ containerRoleDescriptionMessage: null,
21
+ itemRoleDescriptionMessage: null,
22
+ slideRole: "group",
23
+ id: null
24
+ }
25
+ }), i.a11y = {
26
+ clicked: !1
44
27
  };
45
- }
46
- const m = 864e5;
47
- function D(e, t, n, r) {
48
- return (n === r ? [
49
- n
50
- ] : [
51
- n,
52
- r
53
- ]).filter((a) => g(e, t, a));
54
- }
55
- function g(e, t, n) {
56
- let r = p(n, t);
57
- return e.year === r.year && e.month === r.month && e.day === r.day && e.hour === r.hour && e.minute === r.minute && e.second === r.second;
58
- }
59
- function C(e, t, n = "compatible") {
60
- let r = v(e);
61
- if (t === "UTC") return u(r);
62
- if (t === h() && n === "compatible") {
63
- r = b(r, new $());
64
- let i = /* @__PURE__ */ new Date(), T = d(r.era, r.year);
65
- return i.setFullYear(T, r.month - 1, r.day), i.setHours(r.hour, r.minute, r.second, r.millisecond), i.getTime();
66
- }
67
- let o = u(r), a = l(o - m, t), c = l(o + m, t), f = D(r, t, o - a, o - c);
68
- if (f.length === 1) return f[0];
69
- if (f.length > 1) switch (n) {
70
- case "compatible":
71
- case "earlier":
72
- return f[0];
73
- case "later":
74
- return f[f.length - 1];
75
- case "reject":
76
- throw new RangeError("Multiple possible absolute times found");
77
- }
78
- switch (n) {
79
- case "earlier":
80
- return Math.min(o - a, o - c);
81
- case "compatible":
82
- case "later":
83
- return Math.max(o - a, o - c);
84
- case "reject":
85
- throw new RangeError("No such absolute time found");
28
+ let r = null;
29
+ function c(e) {
30
+ const a = r;
31
+ a.length !== 0 && (a.innerHTML = "", a.innerHTML = e);
86
32
  }
87
- }
88
- function P(e, t, n = "compatible") {
89
- return new Date(C(e, t, n));
90
- }
91
- function v(e, t) {
92
- let n = 0, r = 0, o = 0, a = 0;
93
- if ("timeZone" in e) ({ hour: n, minute: r, second: o, millisecond: a } = e);
94
- else if ("hour" in e && !t) return e;
95
- return t && ({ hour: n, minute: r, second: o, millisecond: a } = t), new w(e.calendar, e.era, e.year, e.month, e.day, n, r, o, a);
96
- }
97
- function b(e, t) {
98
- if (e.calendar.identifier === t.identifier) return e;
99
- let n = t.fromJulianDay(e.calendar.toJulianDay(e)), r = e.copy();
100
- return r.calendar = t, r.era = n.era, r.year = n.year, r.month = n.month, r.day = n.day, x(r), r;
33
+ function T(e) {
34
+ const a = () => Math.round(16 * Math.random()).toString(16);
35
+ return "x".repeat(e).replace(/x/g, a);
36
+ }
37
+ function p(e) {
38
+ e = n(e), e.forEach((a) => {
39
+ a.setAttribute("tabIndex", "0");
40
+ });
41
+ }
42
+ function b(e) {
43
+ e = n(e), e.forEach((a) => {
44
+ a.setAttribute("tabIndex", "-1");
45
+ });
46
+ }
47
+ function m(e, a) {
48
+ e = n(e), e.forEach((t) => {
49
+ t.setAttribute("role", a);
50
+ });
51
+ }
52
+ function h(e, a) {
53
+ e = n(e), e.forEach((t) => {
54
+ t.setAttribute("aria-roledescription", a);
55
+ });
56
+ }
57
+ function P(e, a) {
58
+ e = n(e), e.forEach((t) => {
59
+ t.setAttribute("aria-controls", a);
60
+ });
61
+ }
62
+ function f(e, a) {
63
+ e = n(e), e.forEach((t) => {
64
+ t.setAttribute("aria-label", a);
65
+ });
66
+ }
67
+ function D(e, a) {
68
+ e = n(e), e.forEach((t) => {
69
+ t.setAttribute("id", a);
70
+ });
71
+ }
72
+ function N(e, a) {
73
+ e = n(e), e.forEach((t) => {
74
+ t.setAttribute("aria-live", a);
75
+ });
76
+ }
77
+ function y(e) {
78
+ e = n(e), e.forEach((a) => {
79
+ a.setAttribute("aria-disabled", !0);
80
+ });
81
+ }
82
+ function M(e) {
83
+ e = n(e), e.forEach((a) => {
84
+ a.setAttribute("aria-disabled", !1);
85
+ });
86
+ }
87
+ function d(e) {
88
+ if (e.keyCode !== 13 && e.keyCode !== 32) return;
89
+ const a = i.params.a11y, t = e.target;
90
+ i.pagination && i.pagination.el && (t === i.pagination.el || i.pagination.el.contains(e.target)) && !e.target.matches(v(i.params.pagination.bulletClass)) || (i.navigation && i.navigation.nextEl && t === i.navigation.nextEl && (i.isEnd && !i.params.loop || i.slideNext(), i.isEnd ? c(a.lastSlideMessage) : c(a.nextSlideMessage)), i.navigation && i.navigation.prevEl && t === i.navigation.prevEl && (i.isBeginning && !i.params.loop || i.slidePrev(), i.isBeginning ? c(a.firstSlideMessage) : c(a.prevSlideMessage)), i.pagination && t.matches(v(i.params.pagination.bulletClass)) && t.click());
91
+ }
92
+ function B() {
93
+ if (i.params.loop || i.params.rewind || !i.navigation) return;
94
+ const {
95
+ nextEl: e,
96
+ prevEl: a
97
+ } = i.navigation;
98
+ a && (i.isBeginning ? (y(a), b(a)) : (M(a), p(a))), e && (i.isEnd ? (y(e), b(e)) : (M(e), p(e)));
99
+ }
100
+ function x() {
101
+ return i.pagination && i.pagination.bullets && i.pagination.bullets.length;
102
+ }
103
+ function L() {
104
+ return x() && i.params.pagination.clickable;
105
+ }
106
+ function F() {
107
+ const e = i.params.a11y;
108
+ x() && i.pagination.bullets.forEach((a) => {
109
+ i.params.pagination.clickable && (p(a), i.params.pagination.renderBullet || (m(a, "button"), f(a, e.paginationBulletMessage.replace(/\{\{index\}\}/, q(a) + 1)))), a.matches(v(i.params.pagination.bulletActiveClass)) ? a.setAttribute("aria-current", "true") : a.removeAttribute("aria-current");
110
+ });
111
+ }
112
+ const A = (e, a, t) => {
113
+ p(e), e.tagName !== "BUTTON" && (m(e, "button"), e.addEventListener("keydown", d)), f(e, t), P(e, a);
114
+ }, k = () => {
115
+ i.a11y.clicked = !0;
116
+ }, w = () => {
117
+ requestAnimationFrame(() => {
118
+ requestAnimationFrame(() => {
119
+ i.destroyed || (i.a11y.clicked = !1);
120
+ });
121
+ });
122
+ }, S = (e) => {
123
+ if (i.a11y.clicked) return;
124
+ const a = e.target.closest(`.${i.params.slideClass}, swiper-slide`);
125
+ if (!a || !i.slides.includes(a)) return;
126
+ const t = i.slides.indexOf(a) === i.activeIndex, s = i.params.watchSlidesProgress && i.visibleSlides && i.visibleSlides.includes(a);
127
+ t || s || e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents || (i.isHorizontal() ? i.el.scrollLeft = 0 : i.el.scrollTop = 0, i.slideTo(i.slides.indexOf(a), 0));
128
+ }, C = () => {
129
+ const e = i.params.a11y;
130
+ e.itemRoleDescriptionMessage && h(i.slides, e.itemRoleDescriptionMessage), e.slideRole && m(i.slides, e.slideRole);
131
+ const a = i.slides.length;
132
+ e.slideLabelMessage && i.slides.forEach((t, s) => {
133
+ const E = i.params.loop ? parseInt(t.getAttribute("data-swiper-slide-index"), 10) : s, l = e.slideLabelMessage.replace(/\{\{index\}\}/, E + 1).replace(/\{\{slidesLength\}\}/, a);
134
+ f(t, l);
135
+ });
136
+ }, O = () => {
137
+ const e = i.params.a11y;
138
+ i.el.append(r);
139
+ const a = i.el;
140
+ e.containerRoleDescriptionMessage && h(a, e.containerRoleDescriptionMessage), e.containerMessage && f(a, e.containerMessage);
141
+ const t = i.wrapperEl, s = e.id || t.getAttribute("id") || `swiper-wrapper-${T(16)}`, E = i.params.autoplay && i.params.autoplay.enabled ? "off" : "polite";
142
+ D(t, s), N(t, E), C();
143
+ let {
144
+ nextEl: l,
145
+ prevEl: g
146
+ } = i.navigation ? i.navigation : {};
147
+ l = n(l), g = n(g), l && l.forEach((u) => A(u, s, e.nextSlideMessage)), g && g.forEach((u) => A(u, s, e.prevSlideMessage)), L() && n(i.pagination.el).forEach((H) => {
148
+ H.addEventListener("keydown", d);
149
+ }), i.el.addEventListener("focus", S, !0), i.el.addEventListener("pointerdown", k, !0), i.el.addEventListener("pointerup", w, !0);
150
+ };
151
+ function G() {
152
+ r && r.remove();
153
+ let {
154
+ nextEl: e,
155
+ prevEl: a
156
+ } = i.navigation ? i.navigation : {};
157
+ e = n(e), a = n(a), e && e.forEach((t) => t.removeEventListener("keydown", d)), a && a.forEach((t) => t.removeEventListener("keydown", d)), L() && n(i.pagination.el).forEach((s) => {
158
+ s.removeEventListener("keydown", d);
159
+ }), i.el.removeEventListener("focus", S, !0), i.el.removeEventListener("pointerdown", k, !0), i.el.removeEventListener("pointerup", w, !0);
160
+ }
161
+ o("beforeInit", () => {
162
+ r = U("span", i.params.a11y.notificationClass), r.setAttribute("aria-live", "assertive"), r.setAttribute("aria-atomic", "true");
163
+ }), o("afterInit", () => {
164
+ i.params.a11y.enabled && O();
165
+ }), o("slidesLengthChange snapGridLengthChange slidesGridLengthChange", () => {
166
+ i.params.a11y.enabled && C();
167
+ }), o("fromEdge toEdge afterInit lock unlock", () => {
168
+ i.params.a11y.enabled && B();
169
+ }), o("paginationUpdate", () => {
170
+ i.params.a11y.enabled && F();
171
+ }), o("destroy", () => {
172
+ i.params.a11y.enabled && G();
173
+ });
101
174
  }
102
175
  export {
103
- u as epochFromDate,
104
- l as getTimeZoneOffset,
105
- C as toAbsolute,
106
- b as toCalendar,
107
- v as toCalendarDateTime,
108
- P as toDate
176
+ K as default
109
177
  };
package/index145.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index182.js");function t(e,i,_){r._check_private_redeclaration(e,i),i.set(e,_)}exports._=t;exports._class_private_field_init=t;
1
+ "use strict";const h=require("./index182.js");function $(w){let{swiper:e,extendParams:S,on:c}=w;S({history:{enabled:!1,root:"",replaceState:!1,key:"slides",keepQuery:!1}});let d=!1,o={};const u=t=>t.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,""),f=t=>{const l=h.a();let r;t?r=new URL(t):r=l.location;const a=r.pathname.slice(1).split("/").filter(i=>i!==""),n=a.length,s=a[n-2],p=a[n-1];return{key:s,value:p}},m=(t,l)=>{const r=h.a();if(!d||!e.params.history.enabled)return;let a;e.params.url?a=new URL(e.params.url):a=r.location;const n=e.slides[l];let s=u(n.getAttribute("data-history"));if(e.params.history.root.length>0){let i=e.params.history.root;i[i.length-1]==="/"&&(i=i.slice(0,i.length-1)),s=`${i}/${t?`${t}/`:""}${s}`}else a.pathname.includes(t)||(s=`${t?`${t}/`:""}${s}`);e.params.history.keepQuery&&(s+=a.search);const p=r.history.state;p&&p.value===s||(e.params.history.replaceState?r.history.replaceState({value:s},null,s):r.history.pushState({value:s},null,s))},g=(t,l,r)=>{if(l)for(let a=0,n=e.slides.length;a<n;a+=1){const s=e.slides[a];if(u(s.getAttribute("data-history"))===l){const i=e.getSlideIndex(s);e.slideTo(i,t,r)}}else e.slideTo(0,t,r)},y=()=>{o=f(e.params.url),g(e.params.speed,o.value,!1)},v=()=>{const t=h.a();if(e.params.history){if(!t.history||!t.history.pushState){e.params.history.enabled=!1,e.params.hashNavigation.enabled=!0;return}if(d=!0,o=f(e.params.url),!o.key&&!o.value){e.params.history.replaceState||t.addEventListener("popstate",y);return}g(0,o.value,e.params.runCallbacksOnInit),e.params.history.replaceState||t.addEventListener("popstate",y)}},b=()=>{const t=h.a();e.params.history.replaceState||t.removeEventListener("popstate",y)};c("init",()=>{e.params.history.enabled&&v()}),c("destroy",()=>{e.params.history.enabled&&b()}),c("transitionEnd _freeModeNoMomentumRelease",()=>{d&&m(e.params.history.key,e.activeIndex)}),c("slideChange",()=>{d&&e.params.cssMode&&m(e.params.history.key,e.activeIndex)})}module.exports=$;
package/index145.mjs CHANGED
@@ -1,8 +1,87 @@
1
- import { _check_private_redeclaration as t } from "./index182.mjs";
2
- function c(_, e, i) {
3
- t(_, e), e.set(_, i);
1
+ import { a as h } from "./index182.mjs";
2
+ function x(w) {
3
+ let {
4
+ swiper: e,
5
+ extendParams: S,
6
+ on: c
7
+ } = w;
8
+ S({
9
+ history: {
10
+ enabled: !1,
11
+ root: "",
12
+ replaceState: !1,
13
+ key: "slides",
14
+ keepQuery: !1
15
+ }
16
+ });
17
+ let d = !1, o = {};
18
+ const y = (t) => t.toString().replace(/\s+/g, "-").replace(/[^\w-]+/g, "").replace(/--+/g, "-").replace(/^-+/, "").replace(/-+$/, ""), u = (t) => {
19
+ const l = h();
20
+ let r;
21
+ t ? r = new URL(t) : r = l.location;
22
+ const a = r.pathname.slice(1).split("/").filter((i) => i !== ""), n = a.length, s = a[n - 2], p = a[n - 1];
23
+ return {
24
+ key: s,
25
+ value: p
26
+ };
27
+ }, m = (t, l) => {
28
+ const r = h();
29
+ if (!d || !e.params.history.enabled) return;
30
+ let a;
31
+ e.params.url ? a = new URL(e.params.url) : a = r.location;
32
+ const n = e.slides[l];
33
+ let s = y(n.getAttribute("data-history"));
34
+ if (e.params.history.root.length > 0) {
35
+ let i = e.params.history.root;
36
+ i[i.length - 1] === "/" && (i = i.slice(0, i.length - 1)), s = `${i}/${t ? `${t}/` : ""}${s}`;
37
+ } else a.pathname.includes(t) || (s = `${t ? `${t}/` : ""}${s}`);
38
+ e.params.history.keepQuery && (s += a.search);
39
+ const p = r.history.state;
40
+ p && p.value === s || (e.params.history.replaceState ? r.history.replaceState({
41
+ value: s
42
+ }, null, s) : r.history.pushState({
43
+ value: s
44
+ }, null, s));
45
+ }, g = (t, l, r) => {
46
+ if (l)
47
+ for (let a = 0, n = e.slides.length; a < n; a += 1) {
48
+ const s = e.slides[a];
49
+ if (y(s.getAttribute("data-history")) === l) {
50
+ const i = e.getSlideIndex(s);
51
+ e.slideTo(i, t, r);
52
+ }
53
+ }
54
+ else
55
+ e.slideTo(0, t, r);
56
+ }, f = () => {
57
+ o = u(e.params.url), g(e.params.speed, o.value, !1);
58
+ }, v = () => {
59
+ const t = h();
60
+ if (e.params.history) {
61
+ if (!t.history || !t.history.pushState) {
62
+ e.params.history.enabled = !1, e.params.hashNavigation.enabled = !0;
63
+ return;
64
+ }
65
+ if (d = !0, o = u(e.params.url), !o.key && !o.value) {
66
+ e.params.history.replaceState || t.addEventListener("popstate", f);
67
+ return;
68
+ }
69
+ g(0, o.value, e.params.runCallbacksOnInit), e.params.history.replaceState || t.addEventListener("popstate", f);
70
+ }
71
+ }, b = () => {
72
+ const t = h();
73
+ e.params.history.replaceState || t.removeEventListener("popstate", f);
74
+ };
75
+ c("init", () => {
76
+ e.params.history.enabled && v();
77
+ }), c("destroy", () => {
78
+ e.params.history.enabled && b();
79
+ }), c("transitionEnd _freeModeNoMomentumRelease", () => {
80
+ d && m(e.params.history.key, e.activeIndex);
81
+ }), c("slideChange", () => {
82
+ d && e.params.cssMode && m(e.params.history.key, e.activeIndex);
83
+ });
4
84
  }
5
85
  export {
6
- c as _,
7
- c as _class_private_field_init
86
+ x as default
8
87
  };
package/index146.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(e,t){return e-t*Math.floor(e/t)}exports.mod=o;
1
+ "use strict";const p=require("./index182.js"),S=require("./index183.js");function x(u){let{swiper:e,extendParams:v,emit:l,on:n}=u,r=!1;const h=p.g(),i=p.a();v({hashNavigation:{enabled:!1,replaceState:!1,watchState:!1,getSlideIndex(a,t){if(e.virtual&&e.params.virtual.enabled){const s=e.slides.filter(f=>f.getAttribute("data-hash")===t)[0];return s?parseInt(s.getAttribute("data-swiper-slide-index"),10):0}return e.getSlideIndex(S.e(e.slidesEl,`.${e.params.slideClass}[data-hash="${t}"], swiper-slide[data-hash="${t}"]`)[0])}}});const o=()=>{l("hashChange");const a=h.location.hash.replace("#",""),t=e.virtual&&e.params.virtual.enabled?e.slidesEl.querySelector(`[data-swiper-slide-index="${e.activeIndex}"]`):e.slides[e.activeIndex],s=t?t.getAttribute("data-hash"):"";if(a!==s){const d=e.params.hashNavigation.getSlideIndex(e,a);if(typeof d>"u"||Number.isNaN(d))return;e.slideTo(d)}},c=()=>{if(!r||!e.params.hashNavigation.enabled)return;const a=e.virtual&&e.params.virtual.enabled?e.slidesEl.querySelector(`[data-swiper-slide-index="${e.activeIndex}"]`):e.slides[e.activeIndex],t=a?a.getAttribute("data-hash")||a.getAttribute("data-history"):"";e.params.hashNavigation.replaceState&&i.history&&i.history.replaceState?(i.history.replaceState(null,null,`#${t}`||""),l("hashSet")):(h.location.hash=t||"",l("hashSet"))},g=()=>{if(!e.params.hashNavigation.enabled||e.params.history&&e.params.history.enabled)return;r=!0;const a=h.location.hash.replace("#","");if(a){const s=e.params.hashNavigation.getSlideIndex(e,a);e.slideTo(s||0,0,e.params.runCallbacksOnInit,!0)}e.params.hashNavigation.watchState&&i.addEventListener("hashchange",o)},m=()=>{e.params.hashNavigation.watchState&&i.removeEventListener("hashchange",o)};n("init",()=>{e.params.hashNavigation.enabled&&g()}),n("destroy",()=>{e.params.hashNavigation.enabled&&m()}),n("transitionEnd _freeModeNoMomentumRelease",()=>{r&&c()}),n("slideChange",()=>{r&&e.params.cssMode&&c()})}module.exports=x;
package/index146.mjs CHANGED
@@ -1,6 +1,61 @@
1
- function d(f, a) {
2
- return f - a * Math.floor(f / a);
1
+ import { g as f, a as S } from "./index182.mjs";
2
+ import { e as x } from "./index183.mjs";
3
+ function w(p) {
4
+ let {
5
+ swiper: e,
6
+ extendParams: u,
7
+ emit: l,
8
+ on: n
9
+ } = p, r = !1;
10
+ const h = f(), s = S();
11
+ u({
12
+ hashNavigation: {
13
+ enabled: !1,
14
+ replaceState: !1,
15
+ watchState: !1,
16
+ getSlideIndex(a, t) {
17
+ if (e.virtual && e.params.virtual.enabled) {
18
+ const i = e.slides.filter((v) => v.getAttribute("data-hash") === t)[0];
19
+ return i ? parseInt(i.getAttribute("data-swiper-slide-index"), 10) : 0;
20
+ }
21
+ return e.getSlideIndex(x(e.slidesEl, `.${e.params.slideClass}[data-hash="${t}"], swiper-slide[data-hash="${t}"]`)[0]);
22
+ }
23
+ }
24
+ });
25
+ const o = () => {
26
+ l("hashChange");
27
+ const a = h.location.hash.replace("#", ""), t = e.virtual && e.params.virtual.enabled ? e.slidesEl.querySelector(`[data-swiper-slide-index="${e.activeIndex}"]`) : e.slides[e.activeIndex], i = t ? t.getAttribute("data-hash") : "";
28
+ if (a !== i) {
29
+ const d = e.params.hashNavigation.getSlideIndex(e, a);
30
+ if (typeof d > "u" || Number.isNaN(d)) return;
31
+ e.slideTo(d);
32
+ }
33
+ }, c = () => {
34
+ if (!r || !e.params.hashNavigation.enabled) return;
35
+ const a = e.virtual && e.params.virtual.enabled ? e.slidesEl.querySelector(`[data-swiper-slide-index="${e.activeIndex}"]`) : e.slides[e.activeIndex], t = a ? a.getAttribute("data-hash") || a.getAttribute("data-history") : "";
36
+ e.params.hashNavigation.replaceState && s.history && s.history.replaceState ? (s.history.replaceState(null, null, `#${t}` || ""), l("hashSet")) : (h.location.hash = t || "", l("hashSet"));
37
+ }, m = () => {
38
+ if (!e.params.hashNavigation.enabled || e.params.history && e.params.history.enabled) return;
39
+ r = !0;
40
+ const a = h.location.hash.replace("#", "");
41
+ if (a) {
42
+ const i = e.params.hashNavigation.getSlideIndex(e, a);
43
+ e.slideTo(i || 0, 0, e.params.runCallbacksOnInit, !0);
44
+ }
45
+ e.params.hashNavigation.watchState && s.addEventListener("hashchange", o);
46
+ }, g = () => {
47
+ e.params.hashNavigation.watchState && s.removeEventListener("hashchange", o);
48
+ };
49
+ n("init", () => {
50
+ e.params.hashNavigation.enabled && m();
51
+ }), n("destroy", () => {
52
+ e.params.hashNavigation.enabled && g();
53
+ }), n("transitionEnd _freeModeNoMomentumRelease", () => {
54
+ r && c();
55
+ }), n("slideChange", () => {
56
+ r && e.params.cssMode && c();
57
+ });
3
58
  }
4
59
  export {
5
- d as mod
60
+ w as default
6
61
  };
package/index147.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index140.js"),D=require("./index143.js"),u=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],c=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],f=[1867,1911,1925,1988,2018],i=["meiji","taisho","showa","heisei","reiwa"];function h(e){const r=u.findIndex(([n,a,t])=>e.year<n||e.year===n&&e.month<a||e.year===n&&e.month===a&&e.day<t);return r===-1?u.length-1:r===0?0:r-1}function l(e){let r=f[i.indexOf(e.era)];if(!r)throw new Error("Unknown era: "+e.era);return new y.CalendarDate(e.year+r,e.month,e.day)}class M extends D.GregorianCalendar{fromJulianDay(r){let n=super.fromJulianDay(r),a=h(n);return new y.CalendarDate(this,i[a],n.year-f[a],n.month,n.day)}toJulianDay(r){return super.toJulianDay(l(r))}balanceDate(r){let n=l(r),a=h(n);i[a]!==r.era&&(r.era=i[a],r.year=n.year-f[a]),this.constrainDate(r)}constrainDate(r){let n=i.indexOf(r.era),a=c[n];if(a!=null){let[t,o,$]=a,s=t-f[n];r.year=Math.max(1,Math.min(s,r.year)),r.year===s&&(r.month=Math.min(o,r.month),r.month===o&&(r.day=Math.min($,r.day)))}if(r.year===1&&n>=0){let[,t,o]=u[n];r.month=Math.max(t,r.month),r.month===t&&(r.day=Math.max(o,r.day))}}getEras(){return i}getYearsInEra(r){let n=i.indexOf(r.era),a=u[n],t=u[n+1];if(t==null)return 9999-a[0]+1;let o=t[0]-a[0];return(r.month<t[1]||r.month===t[1]&&r.day<t[2])&&o++,o}getDaysInMonth(r){return super.getDaysInMonth(l(r))}getMinimumMonthInYear(r){let n=m(r);return n?n[1]:1}getMinimumDayInMonth(r){let n=m(r);return n&&r.month===n[1]?n[2]:1}constructor(...r){super(...r),this.identifier="japanese"}}function m(e){if(e.year===1){let r=i.indexOf(e.era);return u[r]}}exports.JapaneseCalendar=M;
1
+ "use strict";const S=require("./index182.js");function V(q){let{swiper:e,extendParams:x,on:s,emit:r,params:l}=q;e.autoplay={running:!1,paused:!1,timeLeft:0},x({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let y,E,w=l&&l.autoplay?l.autoplay.delay:3e3,g=l&&l.autoplay?l.autoplay.delay:3e3,n,f=new Date().getTime(),L,v,p,h,b,o,D;function O(t){!e||e.destroyed||!e.wrapperEl||t.target===e.wrapperEl&&(e.wrapperEl.removeEventListener("transitionend",O),!D&&u())}const M=()=>{if(e.destroyed||!e.autoplay.running)return;e.autoplay.paused?L=!0:L&&(g=n,L=!1);const t=e.autoplay.paused?n:f+g-new Date().getTime();e.autoplay.timeLeft=t,r("autoplayTimeLeft",t,t/w),E=requestAnimationFrame(()=>{M()})},B=()=>{let t;return e.virtual&&e.params.virtual.enabled?t=e.slides.filter(a=>a.classList.contains("swiper-slide-active"))[0]:t=e.slides[e.activeIndex],t?parseInt(t.getAttribute("data-swiper-autoplay"),10):void 0},T=t=>{if(e.destroyed||!e.autoplay.running)return;cancelAnimationFrame(E),M();let i=typeof t>"u"?e.params.autoplay.delay:t;w=e.params.autoplay.delay,g=e.params.autoplay.delay;const a=B();!Number.isNaN(a)&&a>0&&typeof t>"u"&&(i=a,w=a,g=a),n=i;const c=e.params.speed,N=()=>{!e||e.destroyed||(e.params.autoplay.reverseDirection?!e.isBeginning||e.params.loop||e.params.rewind?(e.slidePrev(c,!0,!0),r("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(e.slides.length-1,c,!0,!0),r("autoplay")):!e.isEnd||e.params.loop||e.params.rewind?(e.slideNext(c,!0,!0),r("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(0,c,!0,!0),r("autoplay")),e.params.cssMode&&(f=new Date().getTime(),requestAnimationFrame(()=>{T()})))};return i>0?(clearTimeout(y),y=setTimeout(()=>{N()},i)):requestAnimationFrame(()=>{N()}),i},I=()=>{f=new Date().getTime(),e.autoplay.running=!0,T(),r("autoplayStart")},m=()=>{e.autoplay.running=!1,clearTimeout(y),cancelAnimationFrame(E),r("autoplayStop")},d=(t,i)=>{if(e.destroyed||!e.autoplay.running)return;clearTimeout(y),t||(o=!0);const a=()=>{r("autoplayPause"),e.params.autoplay.waitForTransition?e.wrapperEl.addEventListener("transitionend",O):u()};if(e.autoplay.paused=!0,i){b&&(n=e.params.autoplay.delay),b=!1,a();return}n=(n||e.params.autoplay.delay)-(new Date().getTime()-f),!(e.isEnd&&n<0&&!e.params.loop)&&(n<0&&(n=0),a())},u=()=>{e.isEnd&&n<0&&!e.params.loop||e.destroyed||!e.autoplay.running||(f=new Date().getTime(),o?(o=!1,T(n)):T(),e.autoplay.paused=!1,r("autoplayResume"))},A=()=>{if(e.destroyed||!e.autoplay.running)return;const t=S.g();t.visibilityState==="hidden"&&(o=!0,d(!0)),t.visibilityState==="visible"&&u()},P=t=>{t.pointerType==="mouse"&&(o=!0,D=!0,!(e.animating||e.autoplay.paused)&&d(!0))},F=t=>{t.pointerType==="mouse"&&(D=!1,e.autoplay.paused&&u())},C=()=>{e.params.autoplay.pauseOnMouseEnter&&(e.el.addEventListener("pointerenter",P),e.el.addEventListener("pointerleave",F))},_=()=>{e.el.removeEventListener("pointerenter",P),e.el.removeEventListener("pointerleave",F)},R=()=>{S.g().addEventListener("visibilitychange",A)},j=()=>{S.g().removeEventListener("visibilitychange",A)};s("init",()=>{e.params.autoplay.enabled&&(C(),R(),I())}),s("destroy",()=>{_(),j(),e.autoplay.running&&m()}),s("_freeModeStaticRelease",()=>{(p||o)&&u()}),s("_freeModeNoMomentumRelease",()=>{e.params.autoplay.disableOnInteraction?m():d(!0,!0)}),s("beforeTransitionStart",(t,i,a)=>{e.destroyed||!e.autoplay.running||(a||!e.params.autoplay.disableOnInteraction?d(!0,!0):m())}),s("sliderFirstMove",()=>{if(!(e.destroyed||!e.autoplay.running)){if(e.params.autoplay.disableOnInteraction){m();return}v=!0,p=!1,o=!1,h=setTimeout(()=>{o=!0,p=!0,d(!0)},200)}}),s("touchEnd",()=>{if(!(e.destroyed||!e.autoplay.running||!v)){if(clearTimeout(h),clearTimeout(y),e.params.autoplay.disableOnInteraction){p=!1,v=!1;return}p&&e.params.cssMode&&u(),p=!1,v=!1}}),s("slideChange",()=>{e.destroyed||!e.autoplay.running||(b=!0)}),Object.assign(e.autoplay,{start:I,stop:m,pause:d,resume:u})}module.exports=V;