@dotss/tictoccroc 0.1.0 → 0.1.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/shared/components/Calendar/Calendar.d.ts +1 -1
- package/dist/shared/components/Image/Image.d.ts +1 -1
- package/dist/shared/components/Masonry/Masonry.utils.d.ts +1 -1
- package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.d.ts +1 -1
- package/dist/shared/components/Swiper/Swiper.mjs +84 -69
- package/dist/shared/components/TimePicker/TimePicker.d.ts +1 -1
- package/dist/shared/hooks/useInView/useInView.d.ts +1 -1
- package/dist/shared/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +1 -2
- package/dist/teacher/profile/components/AvailableScheduleSection/AvailableScheduleSection.d.ts +1 -1
- package/dist/teacher/profile/components/CareNoteSection/CareNoteSection.d.ts +1 -1
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.d.ts +1 -1
- package/package.json +1 -1
|
@@ -7,5 +7,5 @@ export interface CalendarProps extends Omit<FlexboxProps, 'onChange' | 'value'>,
|
|
|
7
7
|
weekHeadInlineCSS?: FlexboxProps['inlineCSS'];
|
|
8
8
|
datePickerProps?: Omit<DatePickerProps, 'onChange' | 'value' | 'date'>;
|
|
9
9
|
}
|
|
10
|
-
declare const Calendar:
|
|
10
|
+
declare const Calendar: any;
|
|
11
11
|
export default Calendar;
|
|
@@ -20,5 +20,5 @@ export interface ImageProps extends Omit<HTMLProps<HTMLImageElement>, 'onError'>
|
|
|
20
20
|
enableErrorFallback?: boolean;
|
|
21
21
|
renderErrorFallback?: () => ReactNode;
|
|
22
22
|
}
|
|
23
|
-
declare const Image:
|
|
23
|
+
declare const Image: any;
|
|
24
24
|
export default Image;
|
|
@@ -7,7 +7,7 @@ export declare function getHorizontalLayoutRows(images: {
|
|
|
7
7
|
originalWidth?: number;
|
|
8
8
|
width: number;
|
|
9
9
|
height: number;
|
|
10
|
-
}[], blocks: ReactElement<MasonryBlockProps>[], rowCount: number, fallbackWidth: number): ReactElement<MasonryBlockProps
|
|
10
|
+
}[], blocks: ReactElement<MasonryBlockProps>[], rowCount: number, fallbackWidth: number): ReactElement<MasonryBlockProps>[][];
|
|
11
11
|
export declare function findNextFocusableElement(currentElement: HTMLDivElement, keyDirection: 'left' | 'right' | 'up' | 'down', candidates: (HTMLDivElement | null)[]): HTMLDivElement | null;
|
|
12
12
|
export declare function getNextIndexHorizontalFromRows(rows: HTMLDivElement[][], currentIndex: number, keyDirection: 'up' | 'down' | 'left' | 'right'): number | null;
|
|
13
13
|
export declare function findImageInChildren(children: ReactNode): ReactElement<ImageProps> | null;
|
|
@@ -17,5 +17,5 @@ export interface MasonryBlockProps extends FlexboxProps {
|
|
|
17
17
|
}>;
|
|
18
18
|
setInnerRef?: (ref: HTMLDivElement | null) => void;
|
|
19
19
|
}
|
|
20
|
-
declare const MasonryBlock:
|
|
20
|
+
declare const MasonryBlock: any;
|
|
21
21
|
export default MasonryBlock;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import { useState as w, useRef as
|
|
2
|
+
import { useState as w, useRef as m, Children as X, isValidElement as G, useCallback as dr, useEffect as M, cloneElement as vr } from "react";
|
|
3
3
|
import { Flexbox as rr } from "@dotss/ui";
|
|
4
4
|
import U from "../MediaDialog/MediaBlock/MediaBlock.mjs";
|
|
5
|
-
import { createSwipeEvent as
|
|
5
|
+
import { createSwipeEvent as C } from "./Swiper.utils.mjs";
|
|
6
6
|
import j from "./SwiperBlock/SwiperBlock.mjs";
|
|
7
7
|
function Pr({
|
|
8
8
|
children: B,
|
|
9
9
|
initialPage: T = 0,
|
|
10
10
|
onSwipe: s,
|
|
11
|
-
onSwiping:
|
|
12
|
-
loop:
|
|
11
|
+
onSwiping: W,
|
|
12
|
+
loop: h = !1,
|
|
13
13
|
disableSwipe: tr = !1,
|
|
14
14
|
renderPagination: q,
|
|
15
15
|
inlineCSS: er,
|
|
@@ -18,20 +18,20 @@ function Pr({
|
|
|
18
18
|
autoSwipeDuration: Q = 1e3,
|
|
19
19
|
...nr
|
|
20
20
|
}) {
|
|
21
|
-
const [
|
|
22
|
-
!t.current || !
|
|
23
|
-
},
|
|
21
|
+
const [k, $] = w(T), [c, cr] = w(1), t = m(null), A = m(0), Y = m(0), V = m(0), N = m(0), u = m(!1), f = m(!0), F = m(""), n = m(T), Z = m(!1), l = m(null), p = X.count(B), d = X.toArray(B).filter(G).filter((r) => r.type === j || r.type === U), D = p > 1 && !tr, sr = X.toArray(d == null ? void 0 : d[0]).filter(G).filter((r) => r.type === j || r.type === U), ur = X.toArray(d == null ? void 0 : d[(d == null ? void 0 : d.length) - 1]).filter(G).filter((r) => r.type === j || r.type === U), _ = (r, e, i) => {
|
|
22
|
+
!t.current || !D || (F.current = t.current.style.transform, Y.current = r, A.current = r + t.current.offsetWidth * (i + 1), V.current = e);
|
|
23
|
+
}, P = dr(
|
|
24
24
|
(r, e, i, {
|
|
25
|
-
isAutoSwiped:
|
|
25
|
+
isAutoSwiped: v = !1,
|
|
26
26
|
shouldFocus: a = !1
|
|
27
27
|
} = {}) => {
|
|
28
|
-
if (!t.current || !
|
|
28
|
+
if (!t.current || !D || !u.current || !f.current)
|
|
29
29
|
return;
|
|
30
|
-
f.current = !1, t.current.style.transition =
|
|
31
|
-
const o = e ||
|
|
32
|
-
if (Math.abs(
|
|
30
|
+
f.current = !1, t.current.style.transition = v ? `transform ${Q}ms` : "transform 0.2s", t.current.style.cursor = "grab", l.current && (t.current.removeEventListener("transitionend", l.current), l.current = null);
|
|
31
|
+
const o = e || k, y = i || A.current - t.current.offsetWidth * (o + 1) - r, g = t.current.offsetWidth * 0.1;
|
|
32
|
+
if (Math.abs(y) < g && !e) {
|
|
33
33
|
t.current.style.transform = F.current, u.current = !1, f.current = !0, s == null || s(
|
|
34
|
-
|
|
34
|
+
C({
|
|
35
35
|
realPage: n.current,
|
|
36
36
|
totalPages: c,
|
|
37
37
|
lastPage: n.current,
|
|
@@ -40,85 +40,100 @@ function Pr({
|
|
|
40
40
|
);
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
const I =
|
|
43
|
+
const I = y <= -g && o - 1 < 0, z = y >= g && o + 1 === c, fr = y >= g && o + 1 < c, mr = y <= -g && o - 1 >= 0;
|
|
44
44
|
if (I) {
|
|
45
45
|
n.current = c - 1, s == null || s(
|
|
46
|
-
|
|
47
|
-
), t.current.style.transform = "translate3d(0, 0, 0)", l.current = (
|
|
48
|
-
var
|
|
49
|
-
if (
|
|
46
|
+
C({ realPage: n.current, totalPages: c, lastPage: 0, isLoop: !0 })
|
|
47
|
+
), t.current.style.transform = "translate3d(0, 0, 0)", l.current = (x) => {
|
|
48
|
+
var b, E, L, R;
|
|
49
|
+
if (x.propertyName === "transform") {
|
|
50
50
|
if (!t.current) return;
|
|
51
|
-
t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${c}), 0, 0)`, $(c - 1), u.current = !1, f.current = !0, a
|
|
51
|
+
if (t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${c}), 0, 0)`, $(c - 1), u.current = !1, f.current = !0, a)
|
|
52
|
+
(L = (E = (b = t.current) == null ? void 0 : b.children) == null ? void 0 : E[c]) == null || L.focus();
|
|
53
|
+
else {
|
|
54
|
+
if (v) return;
|
|
55
|
+
(R = document.activeElement) == null || R.blur();
|
|
56
|
+
}
|
|
52
57
|
}
|
|
53
58
|
}, t.current.addEventListener("transitionend", l.current);
|
|
54
59
|
return;
|
|
55
60
|
} else if (z) {
|
|
56
61
|
n.current = 0, s == null || s(
|
|
57
|
-
|
|
62
|
+
C({
|
|
58
63
|
realPage: n.current,
|
|
59
64
|
totalPages: c,
|
|
60
65
|
lastPage: c - 1,
|
|
61
66
|
isLoop: !0
|
|
62
67
|
})
|
|
63
|
-
), t.current.style.transform = `translate3d(calc(-100% * ${o + 2}), 0, 0)`, l.current = (
|
|
64
|
-
var
|
|
65
|
-
if (
|
|
68
|
+
), t.current.style.transform = `translate3d(calc(-100% * ${o + 2}), 0, 0)`, l.current = (x) => {
|
|
69
|
+
var b, E, L, R;
|
|
70
|
+
if (x.propertyName === "transform") {
|
|
66
71
|
if (!t.current) return;
|
|
67
|
-
t.current.style.transition = "none", t.current.style.transform = "translate3d(-100%, 0, 0)", $(0), u.current = !1, f.current = !0, a
|
|
72
|
+
if (t.current.style.transition = "none", t.current.style.transform = "translate3d(-100%, 0, 0)", $(0), u.current = !1, f.current = !0, a)
|
|
73
|
+
(L = (E = (b = t.current) == null ? void 0 : b.children) == null ? void 0 : E[1]) == null || L.focus();
|
|
74
|
+
else {
|
|
75
|
+
if (v) return;
|
|
76
|
+
(R = document.activeElement) == null || R.blur();
|
|
77
|
+
}
|
|
68
78
|
}
|
|
69
79
|
}, t.current.addEventListener("transitionend", l.current);
|
|
70
80
|
return;
|
|
71
81
|
}
|
|
72
82
|
fr ? (n.current = o + 1, s == null || s(
|
|
73
|
-
|
|
83
|
+
C({
|
|
74
84
|
realPage: n.current,
|
|
75
85
|
totalPages: c,
|
|
76
86
|
lastPage: o,
|
|
77
87
|
isLoop: !0
|
|
78
88
|
})
|
|
79
|
-
), $(n.current), t.current.style.transform = `translate3d(calc(-100% * ${o + 2}), 0, 0)`) :
|
|
80
|
-
|
|
89
|
+
), $(n.current), t.current.style.transform = `translate3d(calc(-100% * ${o + 2}), 0, 0)`) : mr ? (n.current = o - 1, s == null || s(
|
|
90
|
+
C({
|
|
81
91
|
realPage: n.current,
|
|
82
92
|
totalPages: c,
|
|
83
93
|
lastPage: o,
|
|
84
94
|
isLoop: !1
|
|
85
95
|
})
|
|
86
96
|
), $(n.current), t.current.style.transform = `translate3d(calc(-100% * ${o}), 0, 0)`) : (s == null || s(
|
|
87
|
-
|
|
97
|
+
C({
|
|
88
98
|
realPage: n.current,
|
|
89
99
|
totalPages: c,
|
|
90
100
|
lastPage: n.current,
|
|
91
101
|
isLoop: !1
|
|
92
102
|
})
|
|
93
|
-
), t.current.style.transform = F.current), l.current = (
|
|
94
|
-
var
|
|
95
|
-
if (
|
|
103
|
+
), t.current.style.transform = F.current), l.current = (x) => {
|
|
104
|
+
var b, E;
|
|
105
|
+
if (x.propertyName === "transform") {
|
|
96
106
|
u.current = !1, f.current = !0;
|
|
97
|
-
const
|
|
98
|
-
(
|
|
107
|
+
const L = Array.from(((b = t.current) == null ? void 0 : b.children) ?? []).find(
|
|
108
|
+
(R) => R.getAttribute("aria-current") === "page"
|
|
99
109
|
);
|
|
100
|
-
a &&
|
|
110
|
+
if (a && L)
|
|
111
|
+
L.focus();
|
|
112
|
+
else {
|
|
113
|
+
if (v) return;
|
|
114
|
+
(E = document.activeElement) == null || E.blur();
|
|
115
|
+
}
|
|
101
116
|
}
|
|
102
117
|
}, t.current.addEventListener("transitionend", l.current);
|
|
103
118
|
},
|
|
104
|
-
[
|
|
119
|
+
[k, c, s, D, Q]
|
|
105
120
|
), ar = (r) => {
|
|
106
121
|
u.current = !0, _(r.clientX, r.clientY, n.current);
|
|
107
|
-
}, K = (r) =>
|
|
122
|
+
}, K = (r) => P(r.clientX), or = (r) => {
|
|
108
123
|
_(r.touches[0].clientX, r.touches[0].clientY, n.current);
|
|
109
|
-
}, O = (r) =>
|
|
124
|
+
}, O = (r) => P(r.changedTouches[0].clientX), lr = (r) => {
|
|
110
125
|
u.current = !0;
|
|
111
126
|
const e = r - 1;
|
|
112
|
-
$(e <= 0 ? 0 : e),
|
|
127
|
+
$(e <= 0 ? 0 : e), P(0, r);
|
|
113
128
|
}, ir = (r) => (e) => {
|
|
114
|
-
var i,
|
|
129
|
+
var i, v;
|
|
115
130
|
switch (e.key) {
|
|
116
131
|
case "ArrowRight": {
|
|
117
132
|
if (e.preventDefault(), u.current || !f.current) return;
|
|
118
133
|
const a = n.current === c - 1;
|
|
119
|
-
if (!
|
|
134
|
+
if (!h && a)
|
|
120
135
|
return;
|
|
121
|
-
u.current = !0,
|
|
136
|
+
u.current = !0, P(0, n.current, (((i = t.current) == null ? void 0 : i.offsetWidth) ?? 0) * 0.1, {
|
|
122
137
|
shouldFocus: !0
|
|
123
138
|
});
|
|
124
139
|
break;
|
|
@@ -126,9 +141,9 @@ function Pr({
|
|
|
126
141
|
case "ArrowLeft": {
|
|
127
142
|
if (e.preventDefault(), u.current || !f.current) return;
|
|
128
143
|
const a = n.current === 0;
|
|
129
|
-
if (!
|
|
144
|
+
if (!h && a)
|
|
130
145
|
return;
|
|
131
|
-
u.current = !0,
|
|
146
|
+
u.current = !0, P(0, n.current, -((((v = t.current) == null ? void 0 : v.offsetWidth) ?? 0) * 0.1), {
|
|
132
147
|
shouldFocus: !0
|
|
133
148
|
});
|
|
134
149
|
break;
|
|
@@ -145,22 +160,22 @@ function Pr({
|
|
|
145
160
|
r == null || r(e);
|
|
146
161
|
};
|
|
147
162
|
return M(() => {
|
|
148
|
-
const r = t.current, e = (a, o,
|
|
149
|
-
if (!t.current || !
|
|
150
|
-
N.current = a -
|
|
151
|
-
const
|
|
152
|
-
if (u.current = u.current || Math.abs(N.current) >
|
|
163
|
+
const r = t.current, e = (a, o, y) => {
|
|
164
|
+
if (!t.current || !D || !f.current) return;
|
|
165
|
+
N.current = a - A.current;
|
|
166
|
+
const g = 5;
|
|
167
|
+
if (u.current = u.current || Math.abs(N.current) > g && Math.abs(o - V.current) < g, u.current) {
|
|
153
168
|
const I = Y.current < a, z = Y.current > a;
|
|
154
|
-
if (!
|
|
169
|
+
if (!h && I && n.current === 0) {
|
|
155
170
|
u.current = !1;
|
|
156
171
|
return;
|
|
157
172
|
}
|
|
158
|
-
if (!
|
|
173
|
+
if (!h && z && n.current === c - 1) {
|
|
159
174
|
u.current = !1;
|
|
160
175
|
return;
|
|
161
176
|
}
|
|
162
|
-
|
|
163
|
-
|
|
177
|
+
y.cancelable && y.preventDefault(), W == null || W(
|
|
178
|
+
C({
|
|
164
179
|
realPage: n.current,
|
|
165
180
|
totalPages: c,
|
|
166
181
|
lastPage: n.current,
|
|
@@ -170,11 +185,11 @@ function Pr({
|
|
|
170
185
|
}
|
|
171
186
|
}, i = (a) => {
|
|
172
187
|
u.current && e(a.clientX, a.clientY, a);
|
|
173
|
-
},
|
|
174
|
-
return r && (r.addEventListener("mousemove", i), r.addEventListener("touchmove",
|
|
175
|
-
r && (r.removeEventListener("mousemove", i), r.removeEventListener("touchmove",
|
|
188
|
+
}, v = (a) => e(a.touches[0].clientX, a.touches[0].clientY, a);
|
|
189
|
+
return r && (r.addEventListener("mousemove", i), r.addEventListener("touchmove", v)), () => {
|
|
190
|
+
r && (r.removeEventListener("mousemove", i), r.removeEventListener("touchmove", v));
|
|
176
191
|
};
|
|
177
|
-
}, [
|
|
192
|
+
}, [D, W, h, c]), M(() => {
|
|
178
193
|
const r = t.current, e = (i) => {
|
|
179
194
|
f.current || (i.stopPropagation(), i.preventDefault());
|
|
180
195
|
};
|
|
@@ -187,13 +202,13 @@ function Pr({
|
|
|
187
202
|
l.current && r && (r.removeEventListener("transitionend", l.current), l.current = null);
|
|
188
203
|
};
|
|
189
204
|
}, []), M(() => {
|
|
190
|
-
cr(
|
|
191
|
-
}, [
|
|
192
|
-
t.current && !Z.current && (Z.current = !0, t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${
|
|
193
|
-
}, [T,
|
|
205
|
+
cr(p);
|
|
206
|
+
}, [p]), M(() => {
|
|
207
|
+
t.current && !Z.current && (Z.current = !0, t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${p < T + 1 ? p : T + 1}), 0, 0)`);
|
|
208
|
+
}, [T, p]), M(() => {
|
|
194
209
|
if (H) {
|
|
195
210
|
const r = setInterval(() => {
|
|
196
|
-
u.current || !f.current || t.current && (!
|
|
211
|
+
u.current || !f.current || t.current && (!h && n.current === c - 1 || document.activeElement && t.current && t.current.contains(document.activeElement) || (u.current = !0, P(0, n.current, (t.current.offsetWidth ?? 0) * 0.1, {
|
|
197
212
|
isAutoSwiped: !0
|
|
198
213
|
})));
|
|
199
214
|
}, J);
|
|
@@ -201,7 +216,7 @@ function Pr({
|
|
|
201
216
|
clearInterval(r);
|
|
202
217
|
};
|
|
203
218
|
}
|
|
204
|
-
}, [H, J,
|
|
219
|
+
}, [H, J, h, c, P]), /* @__PURE__ */ S(
|
|
205
220
|
rr,
|
|
206
221
|
{
|
|
207
222
|
flexGrow: 1,
|
|
@@ -228,10 +243,10 @@ function Pr({
|
|
|
228
243
|
onTouchCancel: O,
|
|
229
244
|
inlineCSS: {
|
|
230
245
|
"& > div:first-of-type": {
|
|
231
|
-
visibility:
|
|
246
|
+
visibility: h ? "visible" : "hidden"
|
|
232
247
|
},
|
|
233
248
|
"& > div:last-of-type": {
|
|
234
|
-
visibility:
|
|
249
|
+
visibility: h ? "visible" : "hidden"
|
|
235
250
|
}
|
|
236
251
|
},
|
|
237
252
|
style: {
|
|
@@ -241,14 +256,14 @@ function Pr({
|
|
|
241
256
|
},
|
|
242
257
|
children: [
|
|
243
258
|
ur,
|
|
244
|
-
|
|
259
|
+
d.map(
|
|
245
260
|
(r, e) => vr(r, {
|
|
246
261
|
role: "listitem",
|
|
247
|
-
tabIndex: e ===
|
|
262
|
+
tabIndex: e === k ? 0 : -1,
|
|
248
263
|
onKeyDown: ir(r.props.onKeyDown),
|
|
249
264
|
"aria-roledescription": "slide",
|
|
250
|
-
"aria-hidden": e !==
|
|
251
|
-
"aria-current": e ===
|
|
265
|
+
"aria-hidden": e !== k,
|
|
266
|
+
"aria-current": e === k ? "page" : void 0,
|
|
252
267
|
"aria-label": `${c}개 중 ${e + 1}번째 슬라이드`,
|
|
253
268
|
"aria-posinset": e + 1,
|
|
254
269
|
"aria-setsize": c,
|
|
@@ -259,7 +274,7 @@ function Pr({
|
|
|
259
274
|
]
|
|
260
275
|
}
|
|
261
276
|
),
|
|
262
|
-
typeof q == "function" && q({ page:
|
|
277
|
+
typeof q == "function" && q({ page: k, totalPages: c, onChange: lr })
|
|
263
278
|
]
|
|
264
279
|
}
|
|
265
280
|
);
|
|
@@ -19,5 +19,5 @@ export interface TimePickerProps extends Omit<FlexboxProps, 'onChange'> {
|
|
|
19
19
|
renderStartTimeLabel?: (item: TimePickerItem, isSelected: boolean) => ReactNode;
|
|
20
20
|
renderEndTimeLabel?: (item: TimePickerItem, isSelected: boolean) => ReactNode;
|
|
21
21
|
}
|
|
22
|
-
declare const TimePicker:
|
|
22
|
+
declare const TimePicker: any;
|
|
23
23
|
export default TimePicker;
|
package/dist/teacher/profile/components/AvailableScheduleSection/AvailableScheduleSection.d.ts
CHANGED
|
@@ -18,5 +18,5 @@ export interface AvailableScheduleSectionProps extends FlexboxProps {
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
declare const AvailableScheduleSection:
|
|
21
|
+
declare const AvailableScheduleSection: any;
|
|
22
22
|
export default AvailableScheduleSection;
|
|
@@ -3,5 +3,5 @@ export interface CareNoteSectionProps extends FlexboxProps {
|
|
|
3
3
|
totalCount: number;
|
|
4
4
|
onClickViewAll?: () => void;
|
|
5
5
|
}
|
|
6
|
-
declare const CareNoteSection:
|
|
6
|
+
declare const CareNoteSection: any;
|
|
7
7
|
export default CareNoteSection;
|
|
@@ -3,5 +3,5 @@ export interface ParentReviewSectionProps extends FlexboxProps {
|
|
|
3
3
|
totalCount: number;
|
|
4
4
|
onClickViewAll?: () => void;
|
|
5
5
|
}
|
|
6
|
-
declare const ParentReviewSection:
|
|
6
|
+
declare const ParentReviewSection: any;
|
|
7
7
|
export default ParentReviewSection;
|
package/package.json
CHANGED