@rockshin/tao-ui 0.0.57 → 0.0.58
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/components/app/app-notices.js +10 -3
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/badge/badge.js +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +5 -1
- package/dist/components/calendar/calendar.js +4 -1
- package/dist/components/carousel/carousel.js +8 -2
- package/dist/components/collapse/collapse-panels.js +68 -67
- package/dist/components/date-picker/date-localization.js +12 -14
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/float-button/float-button.js +7 -5
- package/dist/components/image/image.js +135 -143
- package/dist/components/input/otp.js +6 -0
- package/dist/components/input/search.js +7 -5
- package/dist/components/list/list.js +106 -105
- package/dist/components/masonry/masonry.js +1 -1
- package/dist/components/pagination/pagination.d.ts +2 -0
- package/dist/components/pagination/pagination.js +4 -0
- package/dist/components/rate/rate.js +83 -72
- package/dist/components/scroll-area/scroll-area.css +1 -1
- package/dist/components/scroll-area/scroll-area.js +294 -222
- package/dist/components/select/use-select-selection.d.ts +1 -1
- package/dist/components/select/use-select-selection.js +60 -53
- package/dist/components/statistic/statistic.js +84 -78
- package/dist/components/steps/steps.js +1 -1
- package/dist/components/table/table.js +4 -1
- package/dist/components/upload/upload.js +2 -2
- package/dist/number-input/cursor.js +20 -8
- package/dist/number-input/format.js +12 -4
- package/dist/number-input/use-number-input.js +4 -1
- package/package.json +1 -1
|
@@ -5,8 +5,10 @@ import { useTaoConfig, useTaoDirection } from "../../provider/tao-provider.js";
|
|
|
5
5
|
import { getScrollLeft, setScrollLeft } from "../../utils/scroll-left.js";
|
|
6
6
|
import { cx } from "../../utils/semantic.js";
|
|
7
7
|
import "./scroll-area.css";
|
|
8
|
+
const scrollIdleDelay = 600;
|
|
9
|
+
const keyboardScrollStep = 40;
|
|
8
10
|
function ScrollArea(t0) {
|
|
9
|
-
const $ = c(
|
|
11
|
+
const $ = c(90);
|
|
10
12
|
const { children, type: t1, direction: t2, maxHeight, maxWidth, scrollbarSize: t3, scrollbarOffset: t4, scrollShadow: t5, onScroll: onScrollProp, onScrollEnd, scrollEndThreshold: t6, className, style, classNames, styles } = t0;
|
|
11
13
|
const type = void 0 === t1 ? "hover" : t1;
|
|
12
14
|
const direction = void 0 === t2 ? "vertical" : t2;
|
|
@@ -15,6 +17,8 @@ function ScrollArea(t0) {
|
|
|
15
17
|
const scrollShadow = void 0 === t5 ? false : t5;
|
|
16
18
|
const scrollEndThreshold = void 0 === t6 ? 10 : t6;
|
|
17
19
|
const viewportRef = useRef(null);
|
|
20
|
+
const showVertical = "horizontal" !== direction;
|
|
21
|
+
const showHorizontal = "vertical" !== direction;
|
|
18
22
|
let t7;
|
|
19
23
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
20
24
|
t7 = {
|
|
@@ -36,15 +40,29 @@ function ScrollArea(t0) {
|
|
|
36
40
|
const { locale } = useTaoConfig();
|
|
37
41
|
const firedScrollEnd = useRef(false);
|
|
38
42
|
const lastScrollTop = useRef(0);
|
|
43
|
+
const [scrolling, setScrolling] = useState(false);
|
|
44
|
+
const scrollTimer = useRef(void 0);
|
|
39
45
|
let t8;
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
let t9;
|
|
47
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
48
|
+
t8 = ()=>()=>clearTimeout(scrollTimer.current);
|
|
49
|
+
t9 = [];
|
|
50
|
+
$[1] = t8;
|
|
51
|
+
$[2] = t9;
|
|
52
|
+
} else {
|
|
53
|
+
t8 = $[1];
|
|
54
|
+
t9 = $[2];
|
|
55
|
+
}
|
|
56
|
+
useEffect(t8, t9);
|
|
57
|
+
let t10;
|
|
58
|
+
if ($[3] !== scrollEndThreshold || $[4] !== showHorizontal || $[5] !== showVertical || $[6] !== textDirection) {
|
|
59
|
+
t10 = ()=>{
|
|
42
60
|
const el = viewportRef.current;
|
|
43
61
|
if (!el) return;
|
|
44
62
|
const { scrollTop, scrollHeight, scrollWidth, clientHeight, clientWidth } = el;
|
|
45
63
|
const scrollLeft = getScrollLeft(el, getComputedStyle(el).direction || textDirection);
|
|
46
|
-
const hasV = scrollHeight > clientHeight + 1;
|
|
47
|
-
const hasH = scrollWidth > clientWidth + 1;
|
|
64
|
+
const hasV = showVertical && scrollHeight > clientHeight + 1;
|
|
65
|
+
const hasH = showHorizontal && scrollWidth > clientWidth + 1;
|
|
48
66
|
setScrollState({
|
|
49
67
|
hasVertical: hasV,
|
|
50
68
|
hasHorizontal: hasH,
|
|
@@ -57,20 +75,21 @@ function ScrollArea(t0) {
|
|
|
57
75
|
atLeft: scrollLeft <= 1,
|
|
58
76
|
atRight: scrollLeft + clientWidth >= scrollWidth - 1
|
|
59
77
|
});
|
|
60
|
-
const nearBottom =
|
|
78
|
+
const nearBottom = showVertical && scrollHeight > clientHeight && scrollTop + clientHeight >= scrollHeight - scrollEndThreshold;
|
|
61
79
|
if (!nearBottom) firedScrollEnd.current = false;
|
|
62
80
|
return nearBottom;
|
|
63
81
|
};
|
|
64
|
-
$[
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
|
|
82
|
+
$[3] = scrollEndThreshold;
|
|
83
|
+
$[4] = showHorizontal;
|
|
84
|
+
$[5] = showVertical;
|
|
85
|
+
$[6] = textDirection;
|
|
86
|
+
$[7] = t10;
|
|
87
|
+
} else t10 = $[7];
|
|
88
|
+
const updateScrollState = t10;
|
|
89
|
+
let t11;
|
|
90
|
+
let t12;
|
|
91
|
+
if ($[8] !== updateScrollState) {
|
|
92
|
+
t11 = ()=>{
|
|
74
93
|
const el_0 = viewportRef.current;
|
|
75
94
|
if (!el_0) return;
|
|
76
95
|
const observer = new ResizeObserver(updateScrollState);
|
|
@@ -90,61 +109,111 @@ function ScrollArea(t0) {
|
|
|
90
109
|
observer.disconnect();
|
|
91
110
|
};
|
|
92
111
|
};
|
|
93
|
-
|
|
112
|
+
t12 = [
|
|
94
113
|
updateScrollState
|
|
95
114
|
];
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
115
|
+
$[8] = updateScrollState;
|
|
116
|
+
$[9] = t11;
|
|
117
|
+
$[10] = t12;
|
|
99
118
|
} else {
|
|
100
|
-
|
|
101
|
-
|
|
119
|
+
t11 = $[9];
|
|
120
|
+
t12 = $[10];
|
|
102
121
|
}
|
|
103
|
-
useEffect(
|
|
104
|
-
let
|
|
105
|
-
if ($[
|
|
106
|
-
|
|
122
|
+
useEffect(t11, t12);
|
|
123
|
+
let t13;
|
|
124
|
+
if ($[11] !== onScrollEnd || $[12] !== onScrollProp || $[13] !== type || $[14] !== updateScrollState) {
|
|
125
|
+
t13 = (e)=>{
|
|
107
126
|
const scrollTop_0 = e.currentTarget.scrollTop;
|
|
108
127
|
const movedVertically = scrollTop_0 !== lastScrollTop.current;
|
|
109
128
|
lastScrollTop.current = scrollTop_0;
|
|
110
129
|
const nearBottom_0 = updateScrollState();
|
|
130
|
+
if ("auto" === type || "scroll" === type) {
|
|
131
|
+
setScrolling(true);
|
|
132
|
+
clearTimeout(scrollTimer.current);
|
|
133
|
+
scrollTimer.current = setTimeout(()=>setScrolling(false), scrollIdleDelay);
|
|
134
|
+
}
|
|
111
135
|
onScrollProp?.(e);
|
|
112
136
|
if (onScrollEnd && movedVertically && nearBottom_0 && !firedScrollEnd.current) {
|
|
113
137
|
firedScrollEnd.current = true;
|
|
114
138
|
onScrollEnd();
|
|
115
139
|
}
|
|
116
140
|
};
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
|
|
122
|
-
|
|
141
|
+
$[11] = onScrollEnd;
|
|
142
|
+
$[12] = onScrollProp;
|
|
143
|
+
$[13] = type;
|
|
144
|
+
$[14] = updateScrollState;
|
|
145
|
+
$[15] = t13;
|
|
146
|
+
} else t13 = $[15];
|
|
147
|
+
const handleScroll = t13;
|
|
148
|
+
let t14;
|
|
149
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
150
|
+
t14 = (axis, event)=>{
|
|
151
|
+
const viewport = viewportRef.current;
|
|
152
|
+
if (!viewport || event.defaultPrevented) return;
|
|
153
|
+
const vertical = "y" === axis;
|
|
154
|
+
const current = vertical ? viewport.scrollTop : getScrollLeft(viewport);
|
|
155
|
+
const page = vertical ? viewport.clientHeight : viewport.clientWidth;
|
|
156
|
+
const limit = (vertical ? viewport.scrollHeight : viewport.scrollWidth) - page;
|
|
157
|
+
const previous = vertical ? "ArrowUp" : "ArrowLeft";
|
|
158
|
+
const next = vertical ? "ArrowDown" : "ArrowRight";
|
|
159
|
+
let position;
|
|
160
|
+
switch(event.key){
|
|
161
|
+
case previous:
|
|
162
|
+
position = current - keyboardScrollStep;
|
|
163
|
+
break;
|
|
164
|
+
case next:
|
|
165
|
+
position = current + keyboardScrollStep;
|
|
166
|
+
break;
|
|
167
|
+
case "PageUp":
|
|
168
|
+
position = current - page;
|
|
169
|
+
break;
|
|
170
|
+
case "PageDown":
|
|
171
|
+
case "Enter":
|
|
172
|
+
case " ":
|
|
173
|
+
position = current + page;
|
|
174
|
+
break;
|
|
175
|
+
case "Home":
|
|
176
|
+
position = 0;
|
|
177
|
+
break;
|
|
178
|
+
case "End":
|
|
179
|
+
position = limit;
|
|
180
|
+
break;
|
|
181
|
+
default:
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
event.preventDefault();
|
|
185
|
+
const offset = Math.max(0, Math.min(limit, position));
|
|
186
|
+
if (vertical) viewport.scrollTop = offset;
|
|
187
|
+
else setScrollLeft(viewport, offset);
|
|
188
|
+
};
|
|
189
|
+
$[16] = t14;
|
|
190
|
+
} else t14 = $[16];
|
|
191
|
+
const handleTrackKeyDown = t14;
|
|
123
192
|
const activeDrag = useRef(null);
|
|
124
|
-
let
|
|
125
|
-
let
|
|
126
|
-
if ($[
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
193
|
+
let t15;
|
|
194
|
+
let t16;
|
|
195
|
+
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
196
|
+
t15 = ()=>()=>activeDrag.current?.cleanup();
|
|
197
|
+
t16 = [];
|
|
198
|
+
$[17] = t15;
|
|
199
|
+
$[18] = t16;
|
|
131
200
|
} else {
|
|
132
|
-
|
|
133
|
-
|
|
201
|
+
t15 = $[17];
|
|
202
|
+
t16 = $[18];
|
|
134
203
|
}
|
|
135
|
-
useEffect(
|
|
136
|
-
let
|
|
137
|
-
if ($[
|
|
138
|
-
|
|
204
|
+
useEffect(t15, t16);
|
|
205
|
+
let t17;
|
|
206
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
207
|
+
t17 = ()=>{
|
|
139
208
|
const drag = activeDrag.current;
|
|
140
209
|
if (drag && !viewportRef.current?.parentElement?.contains(drag.thumb)) drag.cleanup();
|
|
141
210
|
};
|
|
142
|
-
$[
|
|
143
|
-
} else
|
|
144
|
-
useEffect(
|
|
145
|
-
let
|
|
146
|
-
if ($[
|
|
147
|
-
|
|
211
|
+
$[19] = t17;
|
|
212
|
+
} else t17 = $[19];
|
|
213
|
+
useEffect(t17);
|
|
214
|
+
let t18;
|
|
215
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
216
|
+
t18 = (axis_0, e_0)=>{
|
|
148
217
|
if (0 !== e_0.button) return;
|
|
149
218
|
e_0.preventDefault();
|
|
150
219
|
e_0.stopPropagation();
|
|
@@ -155,20 +224,20 @@ function ScrollArea(t0) {
|
|
|
155
224
|
const ownerDocument = thumb.ownerDocument;
|
|
156
225
|
const track = thumb.parentElement;
|
|
157
226
|
if (!track) return;
|
|
158
|
-
const pos = "y" ===
|
|
159
|
-
const scroll = "y" ===
|
|
227
|
+
const pos = "y" === axis_0 ? e_0.clientY : e_0.clientX;
|
|
228
|
+
const scroll = "y" === axis_0 ? el_1.scrollTop : getScrollLeft(el_1);
|
|
160
229
|
const pointerId = e_0.pointerId;
|
|
161
230
|
const handleMove = (ev)=>{
|
|
162
231
|
if (ev.pointerId !== pointerId || !viewportRef.current) return;
|
|
163
|
-
const delta = ("y" ===
|
|
232
|
+
const delta = ("y" === axis_0 ? ev.clientY : ev.clientX) - pos;
|
|
164
233
|
const vp = viewportRef.current;
|
|
165
234
|
const trackRect = track.getBoundingClientRect();
|
|
166
235
|
const thumbRect = thumb.getBoundingClientRect();
|
|
167
|
-
const travel = "y" ===
|
|
168
|
-
const maxScroll = "y" ===
|
|
236
|
+
const travel = "y" === axis_0 ? trackRect.height - thumbRect.height : trackRect.width - thumbRect.width;
|
|
237
|
+
const maxScroll = "y" === axis_0 ? vp.scrollHeight - vp.clientHeight : vp.scrollWidth - vp.clientWidth;
|
|
169
238
|
if (travel <= 0 || maxScroll <= 0) return;
|
|
170
239
|
const nextScroll = Math.max(0, Math.min(maxScroll, scroll + delta / travel * maxScroll));
|
|
171
|
-
if ("y" ===
|
|
240
|
+
if ("y" === axis_0) vp.scrollTop = nextScroll;
|
|
172
241
|
else setScrollLeft(vp, nextScroll);
|
|
173
242
|
};
|
|
174
243
|
const cleanup = ()=>{
|
|
@@ -188,120 +257,119 @@ function ScrollArea(t0) {
|
|
|
188
257
|
ownerDocument.addEventListener("pointerup", handleEnd);
|
|
189
258
|
ownerDocument.addEventListener("pointercancel", handleEnd);
|
|
190
259
|
};
|
|
191
|
-
$[
|
|
192
|
-
} else
|
|
193
|
-
const handleThumbPointerDown =
|
|
194
|
-
let
|
|
195
|
-
if ($[
|
|
196
|
-
|
|
260
|
+
$[20] = t18;
|
|
261
|
+
} else t18 = $[20];
|
|
262
|
+
const handleThumbPointerDown = t18;
|
|
263
|
+
let t19;
|
|
264
|
+
if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
|
|
265
|
+
t19 = (axis_1, e_1)=>{
|
|
197
266
|
const el_2 = viewportRef.current;
|
|
198
267
|
if (!el_2) return;
|
|
199
268
|
if (e_1.target.hasAttribute("data-tao-scroll-thumb")) return;
|
|
200
269
|
const rect = e_1.currentTarget.getBoundingClientRect();
|
|
201
|
-
const trackSize = "y" ===
|
|
270
|
+
const trackSize = "y" === axis_1 ? rect.height : rect.width;
|
|
202
271
|
if (trackSize <= 0) return;
|
|
203
|
-
const clickPos = ("y" ===
|
|
204
|
-
if ("y" ===
|
|
272
|
+
const clickPos = ("y" === axis_1 ? e_1.clientY - rect.top : e_1.clientX - rect.left) / trackSize;
|
|
273
|
+
if ("y" === axis_1) el_2.scrollTop = clickPos * (el_2.scrollHeight - el_2.clientHeight);
|
|
205
274
|
else setScrollLeft(el_2, clickPos * (el_2.scrollWidth - el_2.clientWidth));
|
|
206
275
|
};
|
|
207
|
-
$[
|
|
208
|
-
} else
|
|
209
|
-
const handleTrackClick =
|
|
210
|
-
const
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
maxHeight: t17,
|
|
218
|
-
maxWidth: t18
|
|
219
|
-
};
|
|
220
|
-
$[17] = t17;
|
|
221
|
-
$[18] = t18;
|
|
222
|
-
$[19] = t19;
|
|
223
|
-
} else t19 = $[19];
|
|
224
|
-
const rootStyle = t19;
|
|
225
|
-
const t20 = showVertical ? "scroll" : "hidden";
|
|
226
|
-
const t21 = showHorizontal ? "scroll" : "hidden";
|
|
227
|
-
const t22 = styles?.viewport;
|
|
228
|
-
let t23;
|
|
229
|
-
if ($[20] !== t20 || $[21] !== t21 || $[22] !== t22) {
|
|
230
|
-
t23 = {
|
|
231
|
-
overflowY: t20,
|
|
232
|
-
overflowX: t21,
|
|
233
|
-
...t22
|
|
276
|
+
$[21] = t19;
|
|
277
|
+
} else t19 = $[21];
|
|
278
|
+
const handleTrackClick = t19;
|
|
279
|
+
const t20 = maxHeight ?? void 0;
|
|
280
|
+
const t21 = maxWidth ?? void 0;
|
|
281
|
+
let t22;
|
|
282
|
+
if ($[22] !== t20 || $[23] !== t21) {
|
|
283
|
+
t22 = {
|
|
284
|
+
maxHeight: t20,
|
|
285
|
+
maxWidth: t21
|
|
234
286
|
};
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
const t24 =
|
|
242
|
-
const t25 =
|
|
287
|
+
$[22] = t20;
|
|
288
|
+
$[23] = t21;
|
|
289
|
+
$[24] = t22;
|
|
290
|
+
} else t22 = $[24];
|
|
291
|
+
const rootStyle = t22;
|
|
292
|
+
const t23 = showVertical ? "scroll" : "hidden";
|
|
293
|
+
const t24 = showHorizontal ? "scroll" : "hidden";
|
|
294
|
+
const t25 = styles?.viewport;
|
|
243
295
|
let t26;
|
|
244
|
-
if ($[
|
|
296
|
+
if ($[25] !== t23 || $[26] !== t24 || $[27] !== t25) {
|
|
245
297
|
t26 = {
|
|
246
|
-
|
|
247
|
-
|
|
298
|
+
overflowY: t23,
|
|
299
|
+
overflowX: t24,
|
|
300
|
+
...t25
|
|
248
301
|
};
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
const
|
|
256
|
-
const
|
|
257
|
-
let
|
|
258
|
-
if ($[
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
302
|
+
$[25] = t23;
|
|
303
|
+
$[26] = t24;
|
|
304
|
+
$[27] = t25;
|
|
305
|
+
$[28] = t26;
|
|
306
|
+
} else t26 = $[28];
|
|
307
|
+
const viewportStyle = t26;
|
|
308
|
+
const t27 = `${scrollbarSize}px`;
|
|
309
|
+
const t28 = `${scrollbarOffset}px`;
|
|
310
|
+
let t29;
|
|
311
|
+
if ($[29] !== t27 || $[30] !== t28) {
|
|
312
|
+
t29 = {
|
|
313
|
+
"--tao-scrollbar-size": t27,
|
|
314
|
+
"--tao-scrollbar-offset": t28
|
|
315
|
+
};
|
|
316
|
+
$[29] = t27;
|
|
317
|
+
$[30] = t28;
|
|
318
|
+
$[31] = t29;
|
|
319
|
+
} else t29 = $[31];
|
|
320
|
+
const scrollbarVars = t29;
|
|
321
|
+
const t30 = scrolling || void 0;
|
|
322
|
+
const t31 = scrollState.hasVertical || void 0;
|
|
323
|
+
const t32 = scrollState.hasHorizontal || void 0;
|
|
324
|
+
const t33 = classNames?.root;
|
|
325
|
+
let t34;
|
|
326
|
+
if ($[32] !== className || $[33] !== t33) {
|
|
327
|
+
t34 = cx(t33, className);
|
|
328
|
+
$[32] = className;
|
|
329
|
+
$[33] = t33;
|
|
330
|
+
$[34] = t34;
|
|
331
|
+
} else t34 = $[34];
|
|
332
|
+
const t35 = styles?.root;
|
|
333
|
+
let t36;
|
|
334
|
+
if ($[35] !== rootStyle || $[36] !== scrollbarVars || $[37] !== style || $[38] !== t35) {
|
|
335
|
+
t36 = {
|
|
268
336
|
...rootStyle,
|
|
269
337
|
...scrollbarVars,
|
|
270
|
-
...
|
|
338
|
+
...t35,
|
|
271
339
|
...style
|
|
272
340
|
};
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
} else
|
|
279
|
-
const
|
|
280
|
-
let
|
|
281
|
-
if ($[
|
|
282
|
-
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
} else
|
|
286
|
-
let
|
|
287
|
-
if ($[
|
|
288
|
-
|
|
341
|
+
$[35] = rootStyle;
|
|
342
|
+
$[36] = scrollbarVars;
|
|
343
|
+
$[37] = style;
|
|
344
|
+
$[38] = t35;
|
|
345
|
+
$[39] = t36;
|
|
346
|
+
} else t36 = $[39];
|
|
347
|
+
const t37 = classNames?.viewport;
|
|
348
|
+
let t38;
|
|
349
|
+
if ($[40] !== t37) {
|
|
350
|
+
t38 = cx(t37);
|
|
351
|
+
$[40] = t37;
|
|
352
|
+
$[41] = t38;
|
|
353
|
+
} else t38 = $[41];
|
|
354
|
+
let t39;
|
|
355
|
+
if ($[42] !== children || $[43] !== handleScroll || $[44] !== t38 || $[45] !== viewportStyle) {
|
|
356
|
+
t39 = /*#__PURE__*/ jsx("div", {
|
|
289
357
|
ref: viewportRef,
|
|
290
358
|
"data-tao-scroll-viewport": "",
|
|
291
|
-
className:
|
|
359
|
+
className: t38,
|
|
292
360
|
style: viewportStyle,
|
|
293
361
|
onScroll: handleScroll,
|
|
294
362
|
children: children
|
|
295
363
|
});
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
} else
|
|
302
|
-
let
|
|
303
|
-
if ($[
|
|
304
|
-
|
|
364
|
+
$[42] = children;
|
|
365
|
+
$[43] = handleScroll;
|
|
366
|
+
$[44] = t38;
|
|
367
|
+
$[45] = viewportStyle;
|
|
368
|
+
$[46] = t39;
|
|
369
|
+
} else t39 = $[46];
|
|
370
|
+
let t40;
|
|
371
|
+
if ($[47] !== scrollShadow || $[48] !== scrollState.atBottom || $[49] !== scrollState.atTop || $[50] !== showVertical) {
|
|
372
|
+
t40 = scrollShadow && showVertical && /*#__PURE__*/ jsxs(Fragment, {
|
|
305
373
|
children: [
|
|
306
374
|
/*#__PURE__*/ jsx("div", {
|
|
307
375
|
"data-tao-scroll-shadow": "top",
|
|
@@ -313,15 +381,15 @@ function ScrollArea(t0) {
|
|
|
313
381
|
})
|
|
314
382
|
]
|
|
315
383
|
});
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
} else
|
|
322
|
-
let
|
|
323
|
-
if ($[
|
|
324
|
-
|
|
384
|
+
$[47] = scrollShadow;
|
|
385
|
+
$[48] = scrollState.atBottom;
|
|
386
|
+
$[49] = scrollState.atTop;
|
|
387
|
+
$[50] = showVertical;
|
|
388
|
+
$[51] = t40;
|
|
389
|
+
} else t40 = $[51];
|
|
390
|
+
let t41;
|
|
391
|
+
if ($[52] !== scrollShadow || $[53] !== scrollState.atLeft || $[54] !== scrollState.atRight || $[55] !== showHorizontal) {
|
|
392
|
+
t41 = scrollShadow && showHorizontal && /*#__PURE__*/ jsxs(Fragment, {
|
|
325
393
|
children: [
|
|
326
394
|
/*#__PURE__*/ jsx("div", {
|
|
327
395
|
"data-tao-scroll-shadow": "left",
|
|
@@ -333,15 +401,15 @@ function ScrollArea(t0) {
|
|
|
333
401
|
})
|
|
334
402
|
]
|
|
335
403
|
});
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
339
|
-
$[
|
|
340
|
-
$[
|
|
341
|
-
} else
|
|
342
|
-
let
|
|
343
|
-
if ($[
|
|
344
|
-
|
|
404
|
+
$[52] = scrollShadow;
|
|
405
|
+
$[53] = scrollState.atLeft;
|
|
406
|
+
$[54] = scrollState.atRight;
|
|
407
|
+
$[55] = showHorizontal;
|
|
408
|
+
$[56] = t41;
|
|
409
|
+
} else t41 = $[56];
|
|
410
|
+
let t42;
|
|
411
|
+
if ($[57] !== classNames?.scrollbar || $[58] !== classNames?.thumb || $[59] !== locale || $[60] !== scrollState.hasVertical || $[61] !== scrollState.thumbYOffset || $[62] !== scrollState.thumbYRatio || $[63] !== showVertical || $[64] !== styles?.scrollbar || $[65] !== styles?.thumb) {
|
|
412
|
+
t42 = showVertical && scrollState.hasVertical && /*#__PURE__*/ jsx("button", {
|
|
345
413
|
type: "button",
|
|
346
414
|
"data-tao-scrollbar": "",
|
|
347
415
|
"data-tao-orientation": "vertical",
|
|
@@ -349,6 +417,7 @@ function ScrollArea(t0) {
|
|
|
349
417
|
className: cx(classNames?.scrollbar),
|
|
350
418
|
style: styles?.scrollbar,
|
|
351
419
|
onClick: (e_2)=>handleTrackClick("y", e_2),
|
|
420
|
+
onKeyDown: (e_3)=>handleTrackKeyDown("y", e_3),
|
|
352
421
|
children: /*#__PURE__*/ jsx("div", {
|
|
353
422
|
"data-tao-scroll-thumb": "",
|
|
354
423
|
"data-tao-orientation": "vertical",
|
|
@@ -359,30 +428,31 @@ function ScrollArea(t0) {
|
|
|
359
428
|
transform: `translateY(-${100 * scrollState.thumbYOffset}%)`,
|
|
360
429
|
...styles?.thumb
|
|
361
430
|
},
|
|
362
|
-
onPointerDown: (
|
|
431
|
+
onPointerDown: (e_4)=>handleThumbPointerDown("y", e_4)
|
|
363
432
|
})
|
|
364
433
|
});
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
372
|
-
$[
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
} else
|
|
376
|
-
let
|
|
377
|
-
if ($[
|
|
378
|
-
|
|
434
|
+
$[57] = classNames?.scrollbar;
|
|
435
|
+
$[58] = classNames?.thumb;
|
|
436
|
+
$[59] = locale;
|
|
437
|
+
$[60] = scrollState.hasVertical;
|
|
438
|
+
$[61] = scrollState.thumbYOffset;
|
|
439
|
+
$[62] = scrollState.thumbYRatio;
|
|
440
|
+
$[63] = showVertical;
|
|
441
|
+
$[64] = styles?.scrollbar;
|
|
442
|
+
$[65] = styles?.thumb;
|
|
443
|
+
$[66] = t42;
|
|
444
|
+
} else t42 = $[66];
|
|
445
|
+
let t43;
|
|
446
|
+
if ($[67] !== classNames?.scrollbar || $[68] !== classNames?.thumb || $[69] !== locale || $[70] !== scrollState.hasHorizontal || $[71] !== scrollState.thumbXOffset || $[72] !== scrollState.thumbXRatio || $[73] !== showHorizontal || $[74] !== styles?.scrollbar || $[75] !== styles?.thumb) {
|
|
447
|
+
t43 = showHorizontal && scrollState.hasHorizontal && /*#__PURE__*/ jsx("button", {
|
|
379
448
|
type: "button",
|
|
380
449
|
"data-tao-scrollbar": "",
|
|
381
450
|
"data-tao-orientation": "horizontal",
|
|
382
451
|
"aria-label": locale.messages.scrollHorizontally,
|
|
383
452
|
className: cx(classNames?.scrollbar),
|
|
384
453
|
style: styles?.scrollbar,
|
|
385
|
-
onClick: (
|
|
454
|
+
onClick: (e_5)=>handleTrackClick("x", e_5),
|
|
455
|
+
onKeyDown: (e_6)=>handleTrackKeyDown("x", e_6),
|
|
386
456
|
children: /*#__PURE__*/ jsx("div", {
|
|
387
457
|
"data-tao-scroll-thumb": "",
|
|
388
458
|
"data-tao-orientation": "horizontal",
|
|
@@ -393,51 +463,53 @@ function ScrollArea(t0) {
|
|
|
393
463
|
transform: `translateX(-${100 * scrollState.thumbXOffset}%)`,
|
|
394
464
|
...styles?.thumb
|
|
395
465
|
},
|
|
396
|
-
onPointerDown: (
|
|
466
|
+
onPointerDown: (e_7)=>handleThumbPointerDown("x", e_7)
|
|
397
467
|
})
|
|
398
468
|
});
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
401
|
-
$[
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
409
|
-
} else
|
|
410
|
-
let
|
|
411
|
-
if ($[
|
|
412
|
-
|
|
469
|
+
$[67] = classNames?.scrollbar;
|
|
470
|
+
$[68] = classNames?.thumb;
|
|
471
|
+
$[69] = locale;
|
|
472
|
+
$[70] = scrollState.hasHorizontal;
|
|
473
|
+
$[71] = scrollState.thumbXOffset;
|
|
474
|
+
$[72] = scrollState.thumbXRatio;
|
|
475
|
+
$[73] = showHorizontal;
|
|
476
|
+
$[74] = styles?.scrollbar;
|
|
477
|
+
$[75] = styles?.thumb;
|
|
478
|
+
$[76] = t43;
|
|
479
|
+
} else t43 = $[76];
|
|
480
|
+
let t44;
|
|
481
|
+
if ($[77] !== directionRef || $[78] !== t30 || $[79] !== t31 || $[80] !== t32 || $[81] !== t34 || $[82] !== t36 || $[83] !== t39 || $[84] !== t40 || $[85] !== t41 || $[86] !== t42 || $[87] !== t43 || $[88] !== type) {
|
|
482
|
+
t44 = /*#__PURE__*/ jsxs("div", {
|
|
413
483
|
ref: directionRef,
|
|
414
484
|
"data-tao-scroll-area": "",
|
|
415
485
|
"data-tao-scroll-type": type,
|
|
416
|
-
"data-tao-
|
|
417
|
-
"data-tao-has-
|
|
418
|
-
|
|
419
|
-
|
|
486
|
+
"data-tao-scrolling": t30,
|
|
487
|
+
"data-tao-has-v": t31,
|
|
488
|
+
"data-tao-has-h": t32,
|
|
489
|
+
className: t34,
|
|
490
|
+
style: t36,
|
|
420
491
|
children: [
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
492
|
+
t39,
|
|
493
|
+
t40,
|
|
494
|
+
t41,
|
|
495
|
+
t42,
|
|
496
|
+
t43
|
|
426
497
|
]
|
|
427
498
|
});
|
|
428
|
-
$[
|
|
429
|
-
$[
|
|
430
|
-
$[
|
|
431
|
-
$[
|
|
432
|
-
$[
|
|
433
|
-
$[
|
|
434
|
-
$[
|
|
435
|
-
$[
|
|
436
|
-
$[
|
|
437
|
-
$[
|
|
438
|
-
$[
|
|
439
|
-
$[
|
|
440
|
-
|
|
441
|
-
|
|
499
|
+
$[77] = directionRef;
|
|
500
|
+
$[78] = t30;
|
|
501
|
+
$[79] = t31;
|
|
502
|
+
$[80] = t32;
|
|
503
|
+
$[81] = t34;
|
|
504
|
+
$[82] = t36;
|
|
505
|
+
$[83] = t39;
|
|
506
|
+
$[84] = t40;
|
|
507
|
+
$[85] = t41;
|
|
508
|
+
$[86] = t42;
|
|
509
|
+
$[87] = t43;
|
|
510
|
+
$[88] = type;
|
|
511
|
+
$[89] = t44;
|
|
512
|
+
} else t44 = $[89];
|
|
513
|
+
return t44;
|
|
442
514
|
}
|
|
443
515
|
export { ScrollArea };
|