@okam/stack-ui 1.35.0 → 1.35.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/components/fields/SearchField/interface.d.ts +1 -0
- package/components/fields/Select/Select.d.ts +1 -1
- package/index125.js +1 -1
- package/index125.mjs +9 -9
- package/index141.js +1 -1
- package/index141.mjs +23 -23
- package/index142.js +1 -1
- package/index142.mjs +3 -3
- package/index147.js +1 -1
- package/index147.mjs +1 -1
- package/index152.js +1 -1
- package/index152.mjs +1 -1
- package/index16.js +1 -1
- package/index16.mjs +133 -131
- package/index178.js +1 -1
- package/index178.mjs +122 -201
- package/index179.js +1 -1
- package/index179.mjs +130 -60
- package/index18.js +1 -1
- package/index18.mjs +22 -22
- package/index180.js +1 -1
- package/index180.mjs +44 -143
- package/index181.js +1 -1
- package/index181.mjs +14 -124
- package/index182.js +1 -1
- package/index182.mjs +87 -216
- package/index183.js +1 -1
- package/index183.mjs +102 -186
- package/index184.js +1 -1
- package/index184.mjs +4 -69
- package/index185.js +1 -1
- package/index185.mjs +3 -279
- package/index186.js +1 -1
- package/index186.mjs +119 -92
- package/index187.js +1 -1
- package/index187.mjs +23 -182
- package/index188.js +1 -1
- package/index188.mjs +51 -84
- package/index189.js +1 -1
- package/index189.mjs +44 -58
- package/index190.js +1 -1
- package/index190.mjs +35 -124
- package/index191.js +1 -1
- package/index191.mjs +110 -113
- package/index192.js +1 -1
- package/index192.mjs +74 -119
- package/index193.js +1 -1
- package/index193.mjs +101 -72
- package/index194.js +1 -1
- package/index194.mjs +98 -111
- package/index195.js +1 -1
- package/index195.mjs +197 -46
- package/index196.js +1 -1
- package/index196.mjs +57 -86
- package/index197.js +1 -1
- package/index197.mjs +138 -65
- package/index198.js +1 -1
- package/index198.mjs +121 -53
- package/index199.js +1 -1
- package/index199.mjs +218 -93
- package/index200.js +1 -5
- package/index200.mjs +187 -77
- package/index201.js +1 -1
- package/index201.mjs +60 -2016
- package/index202.js +1 -1
- package/index202.mjs +277 -57
- package/index203.js +1 -1
- package/index203.mjs +95 -185
- package/index204.js +1 -1
- package/index204.mjs +179 -115
- package/index205.js +1 -1
- package/index205.mjs +81 -131
- package/index206.js +1 -1
- package/index206.mjs +58 -44
- package/index207.js +1 -1
- package/index207.mjs +126 -14
- package/index208.js +1 -1
- package/index208.mjs +113 -92
- package/index209.js +1 -1
- package/index209.mjs +119 -103
- package/index210.js +1 -1
- package/index210.mjs +72 -4
- package/index211.js +1 -1
- package/index211.mjs +110 -3
- package/index212.js +1 -1
- package/index212.mjs +51 -124
- package/index213.js +1 -1
- package/index213.mjs +93 -29
- package/index214.js +1 -1
- package/index214.mjs +70 -51
- package/index215.js +1 -1
- package/index215.mjs +56 -44
- package/index216.js +1 -1
- package/index216.mjs +98 -36
- package/index217.js +5 -1
- package/index217.mjs +78 -111
- package/index218.js +1 -1
- package/index218.mjs +2021 -73
- package/index219.js +1 -1
- package/index219.mjs +57 -99
- package/index220.js +1 -1
- package/index220.mjs +189 -98
- package/index232.js +1 -1
- package/index232.mjs +4 -130
- package/index233.js +1 -1
- package/index233.mjs +123 -183
- package/index234.js +1 -1
- package/index234.mjs +189 -8
- package/index235.js +1 -1
- package/index235.mjs +9 -3
- package/index236.js +1 -1
- package/index236.mjs +3 -36
- package/index237.js +1 -1
- package/index237.mjs +36 -5
- package/index238.js +1 -1
- package/index238.mjs +5 -29
- package/index239.js +1 -1
- package/index239.mjs +29 -6
- package/index240.js +1 -1
- package/index240.mjs +6 -4
- package/package.json +2 -29
package/index182.mjs
CHANGED
|
@@ -1,227 +1,98 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
1
|
+
import { CalendarDate as m } from "./index178.mjs";
|
|
2
|
+
import { mod as s } from "./index185.mjs";
|
|
3
|
+
const p = 1721426;
|
|
4
|
+
function b(r, e, t, l) {
|
|
5
|
+
e = C(r, e);
|
|
6
|
+
let a = e - 1, n = -2;
|
|
7
|
+
return t <= 2 ? n = 0 : d(e) && (n = -1), p - 1 + 365 * a + Math.floor(a / 4) - Math.floor(a / 100) + Math.floor(a / 400) + Math.floor((367 * t - 362) / 12 + n + l);
|
|
8
|
+
}
|
|
9
|
+
function d(r) {
|
|
10
|
+
return r % 4 === 0 && (r % 100 !== 0 || r % 400 === 0);
|
|
11
|
+
}
|
|
12
|
+
function C(r, e) {
|
|
13
|
+
return r === "BC" ? 1 - e : e;
|
|
14
|
+
}
|
|
15
|
+
function Y(r) {
|
|
16
|
+
let e = "AD";
|
|
17
|
+
return r <= 0 && (e = "BC", r = 1 - r), [
|
|
18
|
+
e,
|
|
19
|
+
r
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
const B = {
|
|
23
|
+
standard: [
|
|
24
|
+
31,
|
|
25
|
+
28,
|
|
26
|
+
31,
|
|
27
|
+
30,
|
|
28
|
+
31,
|
|
29
|
+
30,
|
|
30
|
+
31,
|
|
31
|
+
31,
|
|
32
|
+
30,
|
|
33
|
+
31,
|
|
34
|
+
30,
|
|
35
|
+
31
|
|
36
|
+
],
|
|
37
|
+
leapyear: [
|
|
38
|
+
31,
|
|
39
|
+
29,
|
|
40
|
+
31,
|
|
41
|
+
30,
|
|
42
|
+
31,
|
|
43
|
+
30,
|
|
44
|
+
31,
|
|
45
|
+
31,
|
|
46
|
+
30,
|
|
47
|
+
31,
|
|
48
|
+
30,
|
|
49
|
+
31
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
class q {
|
|
53
|
+
fromJulianDay(e) {
|
|
54
|
+
let t = e, l = t - p, a = Math.floor(l / 146097), n = s(l, 146097), $ = Math.floor(n / 36524), i = s(n, 36524), y = Math.floor(i / 1461), x = s(i, 1461), u = Math.floor(x / 365), M = a * 400 + $ * 100 + y * 4 + u + ($ !== 4 && u !== 4 ? 1 : 0), [f, o] = Y(M), g = t - b(f, o, 1, 1), c = 2;
|
|
55
|
+
t < b(f, o, 3, 1) ? c = 0 : d(o) && (c = 1);
|
|
56
|
+
let h = Math.floor(((g + c) * 12 + 373) / 367), D = t - b(f, o, h, 1) + 1;
|
|
57
|
+
return new m(f, o, h, D);
|
|
58
|
+
}
|
|
59
|
+
toJulianDay(e) {
|
|
60
|
+
return b(e.era, e.year, e.month, e.day);
|
|
61
|
+
}
|
|
62
|
+
getDaysInMonth(e) {
|
|
63
|
+
return B[d(e.year) ? "leapyear" : "standard"][e.month - 1];
|
|
50
64
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} = e.params.pagination;
|
|
55
|
-
a && (a = a[`${s === "prev" ? "previous" : "next"}ElementSibling`], a && (a.classList.add(`${i}-${s}`), a = a[`${s === "prev" ? "previous" : "next"}ElementSibling`], a && a.classList.add(`${i}-${s}-${s}`)));
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
66
|
+
getMonthsInYear(e) {
|
|
67
|
+
return 12;
|
|
56
68
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return "next";
|
|
60
|
-
if (s === a - 1)
|
|
61
|
-
return "previous";
|
|
69
|
+
getDaysInYear(e) {
|
|
70
|
+
return d(e.year) ? 366 : 365;
|
|
62
71
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return;
|
|
67
|
-
a.preventDefault();
|
|
68
|
-
const i = S(s) * e.params.slidesPerGroup;
|
|
69
|
-
if (e.params.loop) {
|
|
70
|
-
if (e.realIndex === i) return;
|
|
71
|
-
const t = O(e.realIndex, i, e.slides.length);
|
|
72
|
-
t === "next" ? e.slideNext() : t === "previous" ? e.slidePrev() : e.slideToLoop(i);
|
|
73
|
-
} else
|
|
74
|
-
e.slideTo(i);
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
73
|
+
getYearsInEra(e) {
|
|
74
|
+
return 9999;
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
let t, p;
|
|
82
|
-
const C = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.slides.length, z = e.params.loop ? Math.ceil(C / e.params.slidesPerGroup) : e.snapGrid.length;
|
|
83
|
-
if (e.params.loop ? (p = e.previousRealIndex || 0, t = e.params.slidesPerGroup > 1 ? Math.floor(e.realIndex / e.params.slidesPerGroup) : e.realIndex) : typeof e.snapIndex < "u" ? (t = e.snapIndex, p = e.previousSnapIndex) : (p = e.previousIndex || 0, t = e.activeIndex || 0), s.type === "bullets" && e.pagination.bullets && e.pagination.bullets.length > 0) {
|
|
84
|
-
const l = e.pagination.bullets;
|
|
85
|
-
let f, c, L;
|
|
86
|
-
if (s.dynamicBullets && (b = E(l[0], e.isHorizontal() ? "width" : "height"), i.forEach((n) => {
|
|
87
|
-
n.style[e.isHorizontal() ? "width" : "height"] = `${b * (s.dynamicMainBullets + 4)}px`;
|
|
88
|
-
}), s.dynamicMainBullets > 1 && p !== void 0 && (u += t - (p || 0), u > s.dynamicMainBullets - 1 ? u = s.dynamicMainBullets - 1 : u < 0 && (u = 0)), f = Math.max(t - u, 0), c = f + (Math.min(l.length, s.dynamicMainBullets) - 1), L = (c + f) / 2), l.forEach((n) => {
|
|
89
|
-
const r = [...["", "-next", "-next-next", "-prev", "-prev-prev", "-main"].map((o) => `${s.bulletActiveClass}${o}`)].map((o) => typeof o == "string" && o.includes(" ") ? o.split(" ") : o).flat();
|
|
90
|
-
n.classList.remove(...r);
|
|
91
|
-
}), i.length > 1)
|
|
92
|
-
l.forEach((n) => {
|
|
93
|
-
const r = S(n);
|
|
94
|
-
r === t ? n.classList.add(...s.bulletActiveClass.split(" ")) : e.isElement && n.setAttribute("part", "bullet"), s.dynamicBullets && (r >= f && r <= c && n.classList.add(...`${s.bulletActiveClass}-main`.split(" ")), r === f && x(n, "prev"), r === c && x(n, "next"));
|
|
95
|
-
});
|
|
96
|
-
else {
|
|
97
|
-
const n = l[t];
|
|
98
|
-
if (n && n.classList.add(...s.bulletActiveClass.split(" ")), e.isElement && l.forEach((r, o) => {
|
|
99
|
-
r.setAttribute("part", o === t ? "bullet-active" : "bullet");
|
|
100
|
-
}), s.dynamicBullets) {
|
|
101
|
-
const r = l[f], o = l[c];
|
|
102
|
-
for (let y = f; y <= c; y += 1)
|
|
103
|
-
l[y] && l[y].classList.add(...`${s.bulletActiveClass}-main`.split(" "));
|
|
104
|
-
x(r, "prev"), x(o, "next");
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
if (s.dynamicBullets) {
|
|
108
|
-
const n = Math.min(l.length, s.dynamicMainBullets + 4), r = (b * n - b) / 2 - L * b, o = a ? "right" : "left";
|
|
109
|
-
l.forEach((y) => {
|
|
110
|
-
y.style[e.isHorizontal() ? o : "top"] = `${r}px`;
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
i.forEach((l, f) => {
|
|
115
|
-
if (s.type === "fraction" && (l.querySelectorAll($(s.currentClass)).forEach((c) => {
|
|
116
|
-
c.textContent = s.formatFractionCurrent(t + 1);
|
|
117
|
-
}), l.querySelectorAll($(s.totalClass)).forEach((c) => {
|
|
118
|
-
c.textContent = s.formatFractionTotal(z);
|
|
119
|
-
})), s.type === "progressbar") {
|
|
120
|
-
let c;
|
|
121
|
-
s.progressbarOpposite ? c = e.isHorizontal() ? "vertical" : "horizontal" : c = e.isHorizontal() ? "horizontal" : "vertical";
|
|
122
|
-
const L = (t + 1) / z;
|
|
123
|
-
let n = 1, r = 1;
|
|
124
|
-
c === "horizontal" ? n = L : r = L, l.querySelectorAll($(s.progressbarFillClass)).forEach((o) => {
|
|
125
|
-
o.style.transform = `translate3d(0,0,0) scaleX(${n}) scaleY(${r})`, o.style.transitionDuration = `${e.params.speed}ms`;
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
s.type === "custom" && s.renderCustom ? (l.innerHTML = s.renderCustom(e, t + 1, z), f === 0 && v("paginationRender", l)) : (f === 0 && v("paginationRender", l), v("paginationUpdate", l)), e.params.watchOverflow && e.enabled && l.classList[e.isLocked ? "add" : "remove"](s.lockClass);
|
|
129
|
-
});
|
|
76
|
+
getEras() {
|
|
77
|
+
return [
|
|
78
|
+
"BC",
|
|
79
|
+
"AD"
|
|
80
|
+
];
|
|
130
81
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (k()) return;
|
|
134
|
-
const s = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.grid && e.params.grid.rows > 1 ? e.slides.length / Math.ceil(e.params.grid.rows) : e.slides.length;
|
|
135
|
-
let i = e.pagination.el;
|
|
136
|
-
i = m(i);
|
|
137
|
-
let t = "";
|
|
138
|
-
if (a.type === "bullets") {
|
|
139
|
-
let p = e.params.loop ? Math.ceil(s / e.params.slidesPerGroup) : e.snapGrid.length;
|
|
140
|
-
e.params.freeMode && e.params.freeMode.enabled && p > s && (p = s);
|
|
141
|
-
for (let C = 0; C < p; C += 1)
|
|
142
|
-
a.renderBullet ? t += a.renderBullet.call(e, C, a.bulletClass) : t += `<${a.bulletElement} ${e.isElement ? 'part="bullet"' : ""} class="${a.bulletClass}"></${a.bulletElement}>`;
|
|
143
|
-
}
|
|
144
|
-
a.type === "fraction" && (a.renderFraction ? t = a.renderFraction.call(e, a.currentClass, a.totalClass) : t = `<span class="${a.currentClass}"></span> / <span class="${a.totalClass}"></span>`), a.type === "progressbar" && (a.renderProgressbar ? t = a.renderProgressbar.call(e, a.progressbarFillClass) : t = `<span class="${a.progressbarFillClass}"></span>`), e.pagination.bullets = [], i.forEach((p) => {
|
|
145
|
-
a.type !== "custom" && (p.innerHTML = t || ""), a.type === "bullets" && e.pagination.bullets.push(...p.querySelectorAll($(a.bulletClass)));
|
|
146
|
-
}), a.type !== "custom" && v("paginationRender", i[0]);
|
|
82
|
+
isInverseEra(e) {
|
|
83
|
+
return e.era === "BC";
|
|
147
84
|
}
|
|
148
|
-
|
|
149
|
-
e.
|
|
150
|
-
el: "swiper-pagination"
|
|
151
|
-
});
|
|
152
|
-
const a = e.params.pagination;
|
|
153
|
-
if (!a.el) return;
|
|
154
|
-
let s;
|
|
155
|
-
typeof a.el == "string" && e.isElement && (s = e.el.querySelector(a.el)), !s && typeof a.el == "string" && (s = [...document.querySelectorAll(a.el)]), s || (s = a.el), !(!s || s.length === 0) && (e.params.uniqueNavElements && typeof a.el == "string" && Array.isArray(s) && s.length > 1 && (s = [...e.el.querySelectorAll(a.el)], s.length > 1 && (s = s.filter((i) => T(i, ".swiper")[0] === e.el)[0])), Array.isArray(s) && s.length === 1 && (s = s[0]), Object.assign(e.pagination, {
|
|
156
|
-
el: s
|
|
157
|
-
}), s = m(s), s.forEach((i) => {
|
|
158
|
-
a.type === "bullets" && a.clickable && i.classList.add(...(a.clickableClass || "").split(" ")), i.classList.add(a.modifierClass + a.type), i.classList.add(e.isHorizontal() ? a.horizontalClass : a.verticalClass), a.type === "bullets" && a.dynamicBullets && (i.classList.add(`${a.modifierClass}${a.type}-dynamic`), u = 0, a.dynamicMainBullets < 1 && (a.dynamicMainBullets = 1)), a.type === "progressbar" && a.progressbarOpposite && i.classList.add(a.progressbarOppositeClass), a.clickable && i.addEventListener("click", D), e.enabled || i.classList.add(a.lockClass);
|
|
159
|
-
}));
|
|
85
|
+
balanceDate(e) {
|
|
86
|
+
e.year <= 0 && (e.era = e.era === "BC" ? "AD" : "BC", e.year = 1 - e.year);
|
|
160
87
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if (k()) return;
|
|
164
|
-
let s = e.pagination.el;
|
|
165
|
-
s && (s = m(s), s.forEach((i) => {
|
|
166
|
-
i.classList.remove(a.hiddenClass), i.classList.remove(a.modifierClass + a.type), i.classList.remove(e.isHorizontal() ? a.horizontalClass : a.verticalClass), a.clickable && (i.classList.remove(...(a.clickableClass || "").split(" ")), i.removeEventListener("click", D));
|
|
167
|
-
})), e.pagination.bullets && e.pagination.bullets.forEach((i) => i.classList.remove(...a.bulletActiveClass.split(" ")));
|
|
88
|
+
constructor() {
|
|
89
|
+
this.identifier = "gregory";
|
|
168
90
|
}
|
|
169
|
-
g("changeDirection", () => {
|
|
170
|
-
if (!e.pagination || !e.pagination.el) return;
|
|
171
|
-
const a = e.params.pagination;
|
|
172
|
-
let {
|
|
173
|
-
el: s
|
|
174
|
-
} = e.pagination;
|
|
175
|
-
s = m(s), s.forEach((i) => {
|
|
176
|
-
i.classList.remove(a.horizontalClass, a.verticalClass), i.classList.add(e.isHorizontal() ? a.horizontalClass : a.verticalClass);
|
|
177
|
-
});
|
|
178
|
-
}), g("init", () => {
|
|
179
|
-
e.params.pagination.enabled === !1 ? P() : (A(), B(), h());
|
|
180
|
-
}), g("activeIndexChange", () => {
|
|
181
|
-
typeof e.snapIndex > "u" && h();
|
|
182
|
-
}), g("snapIndexChange", () => {
|
|
183
|
-
h();
|
|
184
|
-
}), g("snapGridLengthChange", () => {
|
|
185
|
-
B(), h();
|
|
186
|
-
}), g("destroy", () => {
|
|
187
|
-
M();
|
|
188
|
-
}), g("enable disable", () => {
|
|
189
|
-
let {
|
|
190
|
-
el: a
|
|
191
|
-
} = e.pagination;
|
|
192
|
-
a && (a = m(a), a.forEach((s) => s.classList[e.enabled ? "remove" : "add"](e.params.pagination.lockClass)));
|
|
193
|
-
}), g("lock unlock", () => {
|
|
194
|
-
h();
|
|
195
|
-
}), g("click", (a, s) => {
|
|
196
|
-
const i = s.target, t = m(e.pagination.el);
|
|
197
|
-
if (e.params.pagination.el && e.params.pagination.hideOnClick && t && t.length > 0 && !i.classList.contains(e.params.pagination.bulletClass)) {
|
|
198
|
-
if (e.navigation && (e.navigation.nextEl && i === e.navigation.nextEl || e.navigation.prevEl && i === e.navigation.prevEl)) return;
|
|
199
|
-
const p = t[0].classList.contains(e.params.pagination.hiddenClass);
|
|
200
|
-
v(p === !0 ? "paginationShow" : "paginationHide"), t.forEach((C) => C.classList.toggle(e.params.pagination.hiddenClass));
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
const w = () => {
|
|
204
|
-
e.el.classList.remove(e.params.pagination.paginationDisabledClass);
|
|
205
|
-
let {
|
|
206
|
-
el: a
|
|
207
|
-
} = e.pagination;
|
|
208
|
-
a && (a = m(a), a.forEach((s) => s.classList.remove(e.params.pagination.paginationDisabledClass))), A(), B(), h();
|
|
209
|
-
}, P = () => {
|
|
210
|
-
e.el.classList.add(e.params.pagination.paginationDisabledClass);
|
|
211
|
-
let {
|
|
212
|
-
el: a
|
|
213
|
-
} = e.pagination;
|
|
214
|
-
a && (a = m(a), a.forEach((s) => s.classList.add(e.params.pagination.paginationDisabledClass))), M();
|
|
215
|
-
};
|
|
216
|
-
Object.assign(e.pagination, {
|
|
217
|
-
enable: w,
|
|
218
|
-
disable: P,
|
|
219
|
-
render: B,
|
|
220
|
-
update: h,
|
|
221
|
-
init: A,
|
|
222
|
-
destroy: M
|
|
223
|
-
});
|
|
224
91
|
}
|
|
225
92
|
export {
|
|
226
|
-
|
|
93
|
+
q as GregorianCalendar,
|
|
94
|
+
Y as fromExtendedYear,
|
|
95
|
+
C as getExtendedYear,
|
|
96
|
+
b as gregorianToJulianDay,
|
|
97
|
+
d as isLeapYear
|
|
227
98
|
};
|
package/index183.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index178.js"),D=require("./index179.js"),f=require("./index182.js"),m=require("./index180.js");function c(e){e=d(e,new f.GregorianCalendar);let t=f.getExtendedYear(e.era,e.year);return $(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function $(e,t,n,r,o,a,i){let u=new Date;return u.setUTCHours(r,o,a,i),u.setUTCFullYear(e,t-1,n),u.getTime()}function s(e,t){if(t==="UTC")return 0;if(e>0&&t===m.getLocalTimeZone())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:a,minute:i,second:u}=p(e,t);return $(n,r,o,a,i,u,0)-Math.floor(e/1e3)*1e3}const h=new Map;function p(e,t){let n=h.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),h.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let a of r)a.type!=="literal"&&(o[a.type]=a.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}const y=864e5;function C(e,t,n,r){return(n===r?[n]:[n,r]).filter(a=>v(e,t,a))}function v(e,t,n){let r=p(n,t);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}function b(e,t,n="compatible"){let r=T(e);if(t==="UTC")return c(r);if(t===m.getLocalTimeZone()&&n==="compatible"){r=d(r,new f.GregorianCalendar);let l=new Date,g=f.getExtendedYear(r.era,r.year);return l.setFullYear(g,r.month-1,r.day),l.setHours(r.hour,r.minute,r.second,r.millisecond),l.getTime()}let o=c(r),a=s(o-y,t),i=s(o+y,t),u=C(r,t,o-a,o-i);if(u.length===1)return u[0];if(u.length>1)switch(n){case"compatible":case"earlier":return u[0];case"later":return u[u.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(o-a,o-i);case"compatible":case"later":return Math.max(o-a,o-i);case"reject":throw new RangeError("No such absolute time found")}}function x(e,t,n="compatible"){return new Date(b(e,t,n))}function T(e,t){let n=0,r=0,o=0,a=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:a}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:a}=t),new w.CalendarDateTime(e.calendar,e.era,e.year,e.month,e.day,n,r,o,a)}function d(e,t){if(m.isEqualCalendar(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,D.constrain(r),r}exports.epochFromDate=c;exports.getTimeZoneOffset=s;exports.toAbsolute=b;exports.toCalendar=d;exports.toCalendarDateTime=T;exports.toDate=x;
|
package/index183.mjs
CHANGED
|
@@ -1,193 +1,109 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
import { CalendarDateTime as w } from "./index178.mjs";
|
|
2
|
+
import { constrain as x } from "./index179.mjs";
|
|
3
|
+
import { GregorianCalendar as $, getExtendedYear as d } from "./index182.mjs";
|
|
4
|
+
import { isEqualCalendar as D, getLocalTimeZone as h } from "./index180.mjs";
|
|
5
|
+
function i(e) {
|
|
6
|
+
e = y(e, new $());
|
|
7
|
+
let t = d(e.era, e.year);
|
|
8
|
+
return b(t, e.month, e.day, e.hour, e.minute, e.second, e.millisecond);
|
|
9
|
+
}
|
|
10
|
+
function b(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 b(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
|
|
30
44
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
} = s, {
|
|
53
|
-
dragEl: e,
|
|
54
|
-
el: a
|
|
55
|
-
} = l;
|
|
56
|
-
e.style.width = "", e.style.height = "", c = s.isHorizontal() ? a.offsetWidth : a.offsetHeight, D = s.size / (s.virtualSize + s.params.slidesOffsetBefore - (s.params.centeredSlides ? s.snapGrid[0] : 0)), s.params.scrollbar.dragSize === "auto" ? i = c * D : i = parseInt(s.params.scrollbar.dragSize, 10), s.isHorizontal() ? e.style.width = `${i}px` : e.style.height = `${i}px`, D >= 1 ? a.style.display = "none" : a.style.display = "", s.params.scrollbar.hide && (a.style.opacity = 0), s.params.watchOverflow && s.enabled && l.el.classList[s.isLocked ? "add" : "remove"](s.params.scrollbar.lockClass);
|
|
57
|
-
}
|
|
58
|
-
function w(l) {
|
|
59
|
-
return s.isHorizontal() ? l.clientX : l.clientY;
|
|
60
|
-
}
|
|
61
|
-
function T(l) {
|
|
62
|
-
const {
|
|
63
|
-
scrollbar: e,
|
|
64
|
-
rtlTranslate: a
|
|
65
|
-
} = s, {
|
|
66
|
-
el: r
|
|
67
|
-
} = e;
|
|
68
|
-
let t;
|
|
69
|
-
t = (w(l) - N(r)[s.isHorizontal() ? "left" : "top"] - (h !== null ? h : i / 2)) / (c - i), t = Math.max(Math.min(t, 1), 0), a && (t = 1 - t);
|
|
70
|
-
const n = s.minTranslate() + (s.maxTranslate() - s.minTranslate()) * t;
|
|
71
|
-
s.updateProgress(n), s.setTranslate(n), s.updateActiveIndex(), s.updateSlidesClasses();
|
|
72
|
-
}
|
|
73
|
-
function P(l) {
|
|
74
|
-
const e = s.params.scrollbar, {
|
|
75
|
-
scrollbar: a,
|
|
76
|
-
wrapperEl: r
|
|
77
|
-
} = s, {
|
|
78
|
-
el: t,
|
|
79
|
-
dragEl: n
|
|
80
|
-
} = a;
|
|
81
|
-
b = !0, h = l.target === n ? w(l) - l.target.getBoundingClientRect()[s.isHorizontal() ? "left" : "top"] : null, l.preventDefault(), l.stopPropagation(), r.style.transitionDuration = "100ms", n.style.transitionDuration = "100ms", T(l), clearTimeout(v), t.style.transitionDuration = "0ms", e.hide && (t.style.opacity = 1), s.params.cssMode && (s.wrapperEl.style["scroll-snap-type"] = "none"), g("scrollbarDragStart", l);
|
|
82
|
-
}
|
|
83
|
-
function M(l) {
|
|
84
|
-
const {
|
|
85
|
-
scrollbar: e,
|
|
86
|
-
wrapperEl: a
|
|
87
|
-
} = s, {
|
|
88
|
-
el: r,
|
|
89
|
-
dragEl: t
|
|
90
|
-
} = e;
|
|
91
|
-
b && (l.preventDefault && l.cancelable ? l.preventDefault() : l.returnValue = !1, T(l), a.style.transitionDuration = "0ms", r.style.transitionDuration = "0ms", t.style.transitionDuration = "0ms", g("scrollbarDragMove", l));
|
|
92
|
-
}
|
|
93
|
-
function O(l) {
|
|
94
|
-
const e = s.params.scrollbar, {
|
|
95
|
-
scrollbar: a,
|
|
96
|
-
wrapperEl: r
|
|
97
|
-
} = s, {
|
|
98
|
-
el: t
|
|
99
|
-
} = a;
|
|
100
|
-
b && (b = !1, s.params.cssMode && (s.wrapperEl.style["scroll-snap-type"] = "", r.style.transitionDuration = ""), e.hide && (clearTimeout(v), v = B(() => {
|
|
101
|
-
t.style.opacity = 0, t.style.transitionDuration = "400ms";
|
|
102
|
-
}, 1e3)), g("scrollbarDragEnd", l), e.snapOnRelease && s.slideToClosest());
|
|
103
|
-
}
|
|
104
|
-
function S(l) {
|
|
105
|
-
const {
|
|
106
|
-
scrollbar: e,
|
|
107
|
-
params: a
|
|
108
|
-
} = s, r = e.el;
|
|
109
|
-
if (!r) return;
|
|
110
|
-
const t = r, n = a.passiveListeners ? {
|
|
111
|
-
passive: !1,
|
|
112
|
-
capture: !1
|
|
113
|
-
} : !1, p = a.passiveListeners ? {
|
|
114
|
-
passive: !0,
|
|
115
|
-
capture: !1
|
|
116
|
-
} : !1;
|
|
117
|
-
if (!t) return;
|
|
118
|
-
const o = l === "on" ? "addEventListener" : "removeEventListener";
|
|
119
|
-
t[o]("pointerdown", P, n), y[o]("pointermove", M, n), y[o]("pointerup", O, p);
|
|
120
|
-
}
|
|
121
|
-
function $() {
|
|
122
|
-
!s.params.scrollbar.el || !s.scrollbar.el || S("on");
|
|
123
|
-
}
|
|
124
|
-
function q() {
|
|
125
|
-
!s.params.scrollbar.el || !s.scrollbar.el || S("off");
|
|
45
|
+
}
|
|
46
|
+
const m = 864e5;
|
|
47
|
+
function g(e, t, n, r) {
|
|
48
|
+
return (n === r ? [
|
|
49
|
+
n
|
|
50
|
+
] : [
|
|
51
|
+
n,
|
|
52
|
+
r
|
|
53
|
+
]).filter((a) => C(e, t, a));
|
|
54
|
+
}
|
|
55
|
+
function C(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 v(e, t, n = "compatible") {
|
|
60
|
+
let r = M(e);
|
|
61
|
+
if (t === "UTC") return i(r);
|
|
62
|
+
if (t === h() && n === "compatible") {
|
|
63
|
+
r = y(r, new $());
|
|
64
|
+
let u = /* @__PURE__ */ new Date(), T = d(r.era, r.year);
|
|
65
|
+
return u.setFullYear(T, r.month - 1, r.day), u.setHours(r.hour, r.minute, r.second, r.millisecond), u.getTime();
|
|
126
66
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
let r;
|
|
138
|
-
if (typeof a.el == "string" && s.isElement && (r = s.el.querySelector(a.el)), !r && typeof a.el == "string") {
|
|
139
|
-
if (r = y.querySelectorAll(a.el), !r.length) return;
|
|
140
|
-
} else r || (r = a.el);
|
|
141
|
-
s.params.uniqueNavElements && typeof a.el == "string" && r.length > 1 && e.querySelectorAll(a.el).length === 1 && (r = e.querySelector(a.el)), r.length > 0 && (r = r[0]), r.classList.add(s.isHorizontal() ? a.horizontalClass : a.verticalClass);
|
|
142
|
-
let t;
|
|
143
|
-
r && (t = r.querySelector(U(s.params.scrollbar.dragClass)), t || (t = j("div", s.params.scrollbar.dragClass), r.append(t))), Object.assign(l, {
|
|
144
|
-
el: r,
|
|
145
|
-
dragEl: t
|
|
146
|
-
}), a.draggable && $(), r && r.classList[s.enabled ? "remove" : "add"](...d(s.params.scrollbar.lockClass));
|
|
67
|
+
let o = i(r), a = l(o - m, t), c = l(o + m, t), f = g(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");
|
|
147
77
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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");
|
|
151
86
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
m();
|
|
167
|
-
}), f("setTransition", (l, e) => {
|
|
168
|
-
H(e);
|
|
169
|
-
}), f("enable disable", () => {
|
|
170
|
-
const {
|
|
171
|
-
el: l
|
|
172
|
-
} = s.scrollbar;
|
|
173
|
-
l && l.classList[s.enabled ? "remove" : "add"](...d(s.params.scrollbar.lockClass));
|
|
174
|
-
}), f("destroy", () => {
|
|
175
|
-
C();
|
|
176
|
-
});
|
|
177
|
-
const A = () => {
|
|
178
|
-
s.el.classList.remove(...d(s.params.scrollbar.scrollbarDisabledClass)), s.scrollbar.el && s.scrollbar.el.classList.remove(...d(s.params.scrollbar.scrollbarDisabledClass)), z(), u(), m();
|
|
179
|
-
}, L = () => {
|
|
180
|
-
s.el.classList.add(...d(s.params.scrollbar.scrollbarDisabledClass)), s.scrollbar.el && s.scrollbar.el.classList.add(...d(s.params.scrollbar.scrollbarDisabledClass)), C();
|
|
181
|
-
};
|
|
182
|
-
Object.assign(s.scrollbar, {
|
|
183
|
-
enable: A,
|
|
184
|
-
disable: L,
|
|
185
|
-
updateSize: u,
|
|
186
|
-
setTranslate: m,
|
|
187
|
-
init: z,
|
|
188
|
-
destroy: C
|
|
189
|
-
});
|
|
87
|
+
}
|
|
88
|
+
function P(e, t, n = "compatible") {
|
|
89
|
+
return new Date(v(e, t, n));
|
|
90
|
+
}
|
|
91
|
+
function M(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 y(e, t) {
|
|
98
|
+
if (D(e.calendar, t)) 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;
|
|
190
101
|
}
|
|
191
102
|
export {
|
|
192
|
-
|
|
103
|
+
i as epochFromDate,
|
|
104
|
+
l as getTimeZoneOffset,
|
|
105
|
+
v as toAbsolute,
|
|
106
|
+
y as toCalendar,
|
|
107
|
+
M as toCalendarDateTime,
|
|
108
|
+
P as toDate
|
|
193
109
|
};
|