@rockshin/tao-ui 0.0.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.
- package/LICENSE +21 -0
- package/README.md +65 -0
- package/dist/components/button/button.css +1055 -0
- package/dist/components/button/button.d.ts +15 -0
- package/dist/components/button/button.js +93 -0
- package/dist/components/checkbox/checkbox.css +1035 -0
- package/dist/components/checkbox/checkbox.d.ts +33 -0
- package/dist/components/checkbox/checkbox.js +312 -0
- package/dist/components/date-picker/calendar/calendar-grid.d.ts +18 -0
- package/dist/components/date-picker/calendar/calendar-grid.js +173 -0
- package/dist/components/date-picker/calendar/calendar-header.d.ts +10 -0
- package/dist/components/date-picker/calendar/calendar-header.js +336 -0
- package/dist/components/date-picker/calendar/month-grid.d.ts +9 -0
- package/dist/components/date-picker/calendar/month-grid.js +61 -0
- package/dist/components/date-picker/calendar/time-panel.d.ts +12 -0
- package/dist/components/date-picker/calendar/time-panel.js +233 -0
- package/dist/components/date-picker/calendar/use-calendar.d.ts +15 -0
- package/dist/components/date-picker/calendar/use-calendar.js +24 -0
- package/dist/components/date-picker/calendar/year-grid.d.ts +9 -0
- package/dist/components/date-picker/calendar/year-grid.js +60 -0
- package/dist/components/date-picker/date-picker.css +1799 -0
- package/dist/components/date-picker/date-picker.d.ts +29 -0
- package/dist/components/date-picker/date-picker.js +663 -0
- package/dist/components/date-picker/presets.d.ts +9 -0
- package/dist/components/date-picker/presets.js +36 -0
- package/dist/components/date-picker/range-picker.d.ts +30 -0
- package/dist/components/date-picker/range-picker.js +432 -0
- package/dist/components/date-picker/types.d.ts +39 -0
- package/dist/components/date-picker/types.js +7 -0
- package/dist/components/drawer/drawer.css +1112 -0
- package/dist/components/drawer/drawer.d.ts +17 -0
- package/dist/components/drawer/drawer.js +184 -0
- package/dist/components/form-actions/form-actions.d.ts +12 -0
- package/dist/components/form-actions/form-actions.js +42 -0
- package/dist/components/form-field/form-field.d.ts +17 -0
- package/dist/components/form-field/form-field.js +101 -0
- package/dist/components/form-field/form.css +1036 -0
- package/dist/components/form-section/form-section.d.ts +14 -0
- package/dist/components/form-section/form-section.js +92 -0
- package/dist/components/input/input.css +1185 -0
- package/dist/components/input/input.d.ts +15 -0
- package/dist/components/input/input.js +143 -0
- package/dist/components/pagination/pagination.css +1099 -0
- package/dist/components/pagination/pagination.d.ts +22 -0
- package/dist/components/pagination/pagination.js +310 -0
- package/dist/components/radio/radio.css +1045 -0
- package/dist/components/radio/radio.d.ts +34 -0
- package/dist/components/radio/radio.js +215 -0
- package/dist/components/scroll-area/scroll-area.css +1099 -0
- package/dist/components/scroll-area/scroll-area.d.ts +33 -0
- package/dist/components/scroll-area/scroll-area.js +375 -0
- package/dist/components/select/mobile-select.css +1044 -0
- package/dist/components/select/mobile-select.d.ts +19 -0
- package/dist/components/select/mobile-select.js +224 -0
- package/dist/components/select/select.css +1327 -0
- package/dist/components/select/select.d.ts +32 -0
- package/dist/components/select/select.js +532 -0
- package/dist/components/select/use-is-mobile.d.ts +1 -0
- package/dist/components/select/use-is-mobile.js +30 -0
- package/dist/components/splitter/splitter.css +1104 -0
- package/dist/components/splitter/splitter.d.ts +33 -0
- package/dist/components/splitter/splitter.js +451 -0
- package/dist/components/switch/switch.css +1170 -0
- package/dist/components/switch/switch.d.ts +19 -0
- package/dist/components/switch/switch.js +143 -0
- package/dist/components/table/table.css +1255 -0
- package/dist/components/table/table.d.ts +73 -0
- package/dist/components/table/table.js +1022 -0
- package/dist/components/tabs/tabs.css +1076 -0
- package/dist/components/tabs/tabs.d.ts +24 -0
- package/dist/components/tabs/tabs.js +256 -0
- package/dist/components/tag/tag.css +1124 -0
- package/dist/components/tag/tag.d.ts +33 -0
- package/dist/components/tag/tag.js +237 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +23 -0
- package/dist/layouts/form-layout/form-layout.d.ts +6 -0
- package/dist/layouts/form-layout/form-layout.js +18 -0
- package/dist/layouts/stack/layout.css +1003 -0
- package/dist/layouts/stack/stack.d.ts +9 -0
- package/dist/layouts/stack/stack.js +27 -0
- package/dist/number-input/cursor.d.ts +9 -0
- package/dist/number-input/cursor.js +44 -0
- package/dist/number-input/format.d.ts +5 -0
- package/dist/number-input/format.js +50 -0
- package/dist/number-input/index.d.ts +5 -0
- package/dist/number-input/index.js +2 -0
- package/dist/number-input/number-input.d.ts +9 -0
- package/dist/number-input/number-input.js +101 -0
- package/dist/number-input/percentage.d.ts +3 -0
- package/dist/number-input/percentage.js +28 -0
- package/dist/number-input/types.d.ts +5 -0
- package/dist/number-input/types.js +0 -0
- package/dist/number-input/use-number-input.d.ts +30 -0
- package/dist/number-input/use-number-input.js +211 -0
- package/dist/number-input/validate.d.ts +3 -0
- package/dist/number-input/validate.js +17 -0
- package/dist/provider/tao-provider.d.ts +42 -0
- package/dist/provider/tao-provider.js +67 -0
- package/dist/theme/control.css +1061 -0
- package/dist/theme/theme.css +957 -0
- package/dist/utils/semantic.d.ts +10 -0
- package/dist/utils/semantic.js +5 -0
- package/llms.txt +67 -0
- package/package.json +97 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode, type UIEvent } from 'react';
|
|
2
|
+
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
3
|
+
import './scroll-area.css';
|
|
4
|
+
export type ScrollAreaSemanticPart = 'root' | 'viewport' | 'scrollbar' | 'thumb';
|
|
5
|
+
export type ScrollAreaType = 'auto' | 'always' | 'hover' | 'scroll';
|
|
6
|
+
export interface ScrollAreaProps {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** Scrollbar visibility behavior */
|
|
9
|
+
type?: ScrollAreaType;
|
|
10
|
+
/** Scroll direction */
|
|
11
|
+
direction?: 'vertical' | 'horizontal' | 'both';
|
|
12
|
+
/** Max height — enables vertical scroll */
|
|
13
|
+
maxHeight?: number | string;
|
|
14
|
+
/** Max width — enables horizontal scroll */
|
|
15
|
+
maxWidth?: number | string;
|
|
16
|
+
/** Scrollbar size in px */
|
|
17
|
+
scrollbarSize?: number;
|
|
18
|
+
/** Offset from edges in px */
|
|
19
|
+
scrollbarOffset?: number;
|
|
20
|
+
/** Show scroll shadows at edges */
|
|
21
|
+
scrollShadow?: boolean;
|
|
22
|
+
/** Callback on scroll */
|
|
23
|
+
onScroll?: (e: UIEvent<HTMLDivElement>) => void;
|
|
24
|
+
/** Callback when scrolled to bottom (threshold in px) */
|
|
25
|
+
onScrollEnd?: () => void;
|
|
26
|
+
/** Threshold in px for onScrollEnd */
|
|
27
|
+
scrollEndThreshold?: number;
|
|
28
|
+
className?: string;
|
|
29
|
+
style?: CSSProperties;
|
|
30
|
+
classNames?: SemanticClassNames<ScrollAreaSemanticPart>;
|
|
31
|
+
styles?: SemanticStyles<ScrollAreaSemanticPart>;
|
|
32
|
+
}
|
|
33
|
+
export declare function ScrollArea({ children, type, direction, maxHeight, maxWidth, scrollbarSize, scrollbarOffset, scrollShadow, onScroll: onScrollProp, onScrollEnd, scrollEndThreshold, className, style, classNames, styles, }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { cx } from "../../utils/semantic.js";
|
|
5
|
+
import "./scroll-area.css";
|
|
6
|
+
function ScrollArea(t0) {
|
|
7
|
+
const $ = c(74);
|
|
8
|
+
const { children, type: t1, direction: t2, maxHeight, maxWidth, scrollbarSize: t3, scrollbarOffset: t4, scrollShadow: t5, onScroll: onScrollProp, onScrollEnd, scrollEndThreshold: t6, className, style, classNames, styles } = t0;
|
|
9
|
+
const type = void 0 === t1 ? "hover" : t1;
|
|
10
|
+
const direction = void 0 === t2 ? "vertical" : t2;
|
|
11
|
+
const scrollbarSize = void 0 === t3 ? 6 : t3;
|
|
12
|
+
const scrollbarOffset = void 0 === t4 ? 2 : t4;
|
|
13
|
+
const scrollShadow = void 0 === t5 ? false : t5;
|
|
14
|
+
const scrollEndThreshold = void 0 === t6 ? 10 : t6;
|
|
15
|
+
const viewportRef = useRef(null);
|
|
16
|
+
let t7;
|
|
17
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
18
|
+
t7 = {
|
|
19
|
+
hasVertical: false,
|
|
20
|
+
hasHorizontal: false,
|
|
21
|
+
thumbYRatio: 0,
|
|
22
|
+
thumbXRatio: 0,
|
|
23
|
+
thumbYOffset: 0,
|
|
24
|
+
thumbXOffset: 0,
|
|
25
|
+
atTop: true,
|
|
26
|
+
atBottom: true,
|
|
27
|
+
atLeft: true,
|
|
28
|
+
atRight: true
|
|
29
|
+
};
|
|
30
|
+
$[0] = t7;
|
|
31
|
+
} else t7 = $[0];
|
|
32
|
+
const [scrollState, setScrollState] = useState(t7);
|
|
33
|
+
let t8;
|
|
34
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
35
|
+
t8 = ()=>{
|
|
36
|
+
const el = viewportRef.current;
|
|
37
|
+
if (!el) return;
|
|
38
|
+
const { scrollTop, scrollLeft, scrollHeight, scrollWidth, clientHeight, clientWidth } = el;
|
|
39
|
+
const hasV = scrollHeight > clientHeight + 1;
|
|
40
|
+
const hasH = scrollWidth > clientWidth + 1;
|
|
41
|
+
setScrollState({
|
|
42
|
+
hasVertical: hasV,
|
|
43
|
+
hasHorizontal: hasH,
|
|
44
|
+
thumbYRatio: hasV ? clientHeight / scrollHeight : 0,
|
|
45
|
+
thumbXRatio: hasH ? clientWidth / scrollWidth : 0,
|
|
46
|
+
thumbYOffset: hasV ? scrollTop / (scrollHeight - clientHeight) : 0,
|
|
47
|
+
thumbXOffset: hasH ? scrollLeft / (scrollWidth - clientWidth) : 0,
|
|
48
|
+
atTop: scrollTop <= 1,
|
|
49
|
+
atBottom: scrollTop + clientHeight >= scrollHeight - 1,
|
|
50
|
+
atLeft: scrollLeft <= 1,
|
|
51
|
+
atRight: scrollLeft + clientWidth >= scrollWidth - 1
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
$[1] = t8;
|
|
55
|
+
} else t8 = $[1];
|
|
56
|
+
const updateScrollState = t8;
|
|
57
|
+
let t10;
|
|
58
|
+
let t9;
|
|
59
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
60
|
+
t9 = ()=>{
|
|
61
|
+
const el_0 = viewportRef.current;
|
|
62
|
+
if (!el_0) return;
|
|
63
|
+
updateScrollState();
|
|
64
|
+
const observer = new ResizeObserver(()=>updateScrollState());
|
|
65
|
+
observer.observe(el_0);
|
|
66
|
+
if (el_0.firstElementChild) observer.observe(el_0.firstElementChild);
|
|
67
|
+
return ()=>observer.disconnect();
|
|
68
|
+
};
|
|
69
|
+
t10 = [
|
|
70
|
+
updateScrollState
|
|
71
|
+
];
|
|
72
|
+
$[2] = t10;
|
|
73
|
+
$[3] = t9;
|
|
74
|
+
} else {
|
|
75
|
+
t10 = $[2];
|
|
76
|
+
t9 = $[3];
|
|
77
|
+
}
|
|
78
|
+
useEffect(t9, t10);
|
|
79
|
+
const firedScrollEnd = useRef(false);
|
|
80
|
+
let t11;
|
|
81
|
+
if ($[4] !== onScrollEnd || $[5] !== onScrollProp || $[6] !== scrollEndThreshold) {
|
|
82
|
+
t11 = (e)=>{
|
|
83
|
+
updateScrollState();
|
|
84
|
+
onScrollProp?.(e);
|
|
85
|
+
if (onScrollEnd) {
|
|
86
|
+
const el_1 = e.currentTarget;
|
|
87
|
+
const { scrollTop: scrollTop_0, scrollHeight: scrollHeight_0, clientHeight: clientHeight_0 } = el_1;
|
|
88
|
+
const nearBottom = scrollTop_0 + clientHeight_0 >= scrollHeight_0 - scrollEndThreshold;
|
|
89
|
+
if (nearBottom && !firedScrollEnd.current) {
|
|
90
|
+
firedScrollEnd.current = true;
|
|
91
|
+
onScrollEnd();
|
|
92
|
+
} else if (!nearBottom) firedScrollEnd.current = false;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
$[4] = onScrollEnd;
|
|
96
|
+
$[5] = onScrollProp;
|
|
97
|
+
$[6] = scrollEndThreshold;
|
|
98
|
+
$[7] = t11;
|
|
99
|
+
} else t11 = $[7];
|
|
100
|
+
const handleScroll = t11;
|
|
101
|
+
const dragging = useRef(null);
|
|
102
|
+
let t12;
|
|
103
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
104
|
+
t12 = (axis, e_0)=>{
|
|
105
|
+
e_0.preventDefault();
|
|
106
|
+
e_0.stopPropagation();
|
|
107
|
+
const el_2 = viewportRef.current;
|
|
108
|
+
if (!el_2) return;
|
|
109
|
+
const pos = "y" === axis ? e_0.clientY : e_0.clientX;
|
|
110
|
+
const scroll = "y" === axis ? el_2.scrollTop : el_2.scrollLeft;
|
|
111
|
+
dragging.current = {
|
|
112
|
+
axis,
|
|
113
|
+
startPos: pos,
|
|
114
|
+
startScroll: scroll
|
|
115
|
+
};
|
|
116
|
+
const handleMove = (ev)=>{
|
|
117
|
+
if (!dragging.current || !viewportRef.current) return;
|
|
118
|
+
const { axis: a, startPos: sp, startScroll: ss } = dragging.current;
|
|
119
|
+
const delta = ("y" === a ? ev.clientY : ev.clientX) - sp;
|
|
120
|
+
const vp = viewportRef.current;
|
|
121
|
+
const trackSize = "y" === a ? vp.clientHeight : vp.clientWidth;
|
|
122
|
+
const contentSize = "y" === a ? vp.scrollHeight : vp.scrollWidth;
|
|
123
|
+
const scrollDelta = delta / trackSize * contentSize;
|
|
124
|
+
if ("y" === a) vp.scrollTop = ss + scrollDelta;
|
|
125
|
+
else vp.scrollLeft = ss + scrollDelta;
|
|
126
|
+
};
|
|
127
|
+
const handleUp = ()=>{
|
|
128
|
+
dragging.current = null;
|
|
129
|
+
document.removeEventListener("pointermove", handleMove);
|
|
130
|
+
document.removeEventListener("pointerup", handleUp);
|
|
131
|
+
};
|
|
132
|
+
document.addEventListener("pointermove", handleMove);
|
|
133
|
+
document.addEventListener("pointerup", handleUp);
|
|
134
|
+
};
|
|
135
|
+
$[8] = t12;
|
|
136
|
+
} else t12 = $[8];
|
|
137
|
+
const handleThumbPointerDown = t12;
|
|
138
|
+
let t13;
|
|
139
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
140
|
+
t13 = (axis_0, e_1)=>{
|
|
141
|
+
const el_3 = viewportRef.current;
|
|
142
|
+
if (!el_3) return;
|
|
143
|
+
if (e_1.target.hasAttribute("data-tao-scroll-thumb")) return;
|
|
144
|
+
const rect = e_1.currentTarget.getBoundingClientRect();
|
|
145
|
+
const clickPos = "y" === axis_0 ? (e_1.clientY - rect.top) / rect.height : (e_1.clientX - rect.left) / rect.width;
|
|
146
|
+
if ("y" === axis_0) el_3.scrollTop = clickPos * (el_3.scrollHeight - el_3.clientHeight);
|
|
147
|
+
else el_3.scrollLeft = clickPos * (el_3.scrollWidth - el_3.clientWidth);
|
|
148
|
+
};
|
|
149
|
+
$[9] = t13;
|
|
150
|
+
} else t13 = $[9];
|
|
151
|
+
const handleTrackClick = t13;
|
|
152
|
+
const showVertical = "vertical" === direction || "both" === direction;
|
|
153
|
+
const showHorizontal = "horizontal" === direction || "both" === direction;
|
|
154
|
+
const t14 = maxHeight ?? void 0;
|
|
155
|
+
const t15 = maxWidth ?? void 0;
|
|
156
|
+
let t16;
|
|
157
|
+
if ($[10] !== t14 || $[11] !== t15) {
|
|
158
|
+
t16 = {
|
|
159
|
+
maxHeight: t14,
|
|
160
|
+
maxWidth: t15
|
|
161
|
+
};
|
|
162
|
+
$[10] = t14;
|
|
163
|
+
$[11] = t15;
|
|
164
|
+
$[12] = t16;
|
|
165
|
+
} else t16 = $[12];
|
|
166
|
+
const rootStyle = t16;
|
|
167
|
+
const t17 = showVertical ? "scroll" : "hidden";
|
|
168
|
+
const t18 = showHorizontal ? "scroll" : "hidden";
|
|
169
|
+
const t19 = styles?.viewport;
|
|
170
|
+
let t20;
|
|
171
|
+
if ($[13] !== t17 || $[14] !== t18 || $[15] !== t19) {
|
|
172
|
+
t20 = {
|
|
173
|
+
overflowY: t17,
|
|
174
|
+
overflowX: t18,
|
|
175
|
+
...t19
|
|
176
|
+
};
|
|
177
|
+
$[13] = t17;
|
|
178
|
+
$[14] = t18;
|
|
179
|
+
$[15] = t19;
|
|
180
|
+
$[16] = t20;
|
|
181
|
+
} else t20 = $[16];
|
|
182
|
+
const viewportStyle = t20;
|
|
183
|
+
const t21 = `${scrollbarSize}px`;
|
|
184
|
+
const t22 = `${scrollbarOffset}px`;
|
|
185
|
+
let t23;
|
|
186
|
+
if ($[17] !== t21 || $[18] !== t22) {
|
|
187
|
+
t23 = {
|
|
188
|
+
"--tao-scrollbar-size": t21,
|
|
189
|
+
"--tao-scrollbar-offset": t22
|
|
190
|
+
};
|
|
191
|
+
$[17] = t21;
|
|
192
|
+
$[18] = t22;
|
|
193
|
+
$[19] = t23;
|
|
194
|
+
} else t23 = $[19];
|
|
195
|
+
const scrollbarVars = t23;
|
|
196
|
+
const t24 = scrollState.hasVertical || void 0;
|
|
197
|
+
const t25 = scrollState.hasHorizontal || void 0;
|
|
198
|
+
const t26 = classNames?.root;
|
|
199
|
+
let t27;
|
|
200
|
+
if ($[20] !== className || $[21] !== t26) {
|
|
201
|
+
t27 = cx(t26, className);
|
|
202
|
+
$[20] = className;
|
|
203
|
+
$[21] = t26;
|
|
204
|
+
$[22] = t27;
|
|
205
|
+
} else t27 = $[22];
|
|
206
|
+
const t28 = styles?.root;
|
|
207
|
+
let t29;
|
|
208
|
+
if ($[23] !== rootStyle || $[24] !== scrollbarVars || $[25] !== style || $[26] !== t28) {
|
|
209
|
+
t29 = {
|
|
210
|
+
...rootStyle,
|
|
211
|
+
...scrollbarVars,
|
|
212
|
+
...t28,
|
|
213
|
+
...style
|
|
214
|
+
};
|
|
215
|
+
$[23] = rootStyle;
|
|
216
|
+
$[24] = scrollbarVars;
|
|
217
|
+
$[25] = style;
|
|
218
|
+
$[26] = t28;
|
|
219
|
+
$[27] = t29;
|
|
220
|
+
} else t29 = $[27];
|
|
221
|
+
const t30 = classNames?.viewport;
|
|
222
|
+
let t31;
|
|
223
|
+
if ($[28] !== t30) {
|
|
224
|
+
t31 = cx(t30);
|
|
225
|
+
$[28] = t30;
|
|
226
|
+
$[29] = t31;
|
|
227
|
+
} else t31 = $[29];
|
|
228
|
+
let t32;
|
|
229
|
+
if ($[30] !== children || $[31] !== handleScroll || $[32] !== t31 || $[33] !== viewportStyle) {
|
|
230
|
+
t32 = /*#__PURE__*/ jsx("div", {
|
|
231
|
+
ref: viewportRef,
|
|
232
|
+
"data-tao-scroll-viewport": "",
|
|
233
|
+
className: t31,
|
|
234
|
+
style: viewportStyle,
|
|
235
|
+
onScroll: handleScroll,
|
|
236
|
+
children: children
|
|
237
|
+
});
|
|
238
|
+
$[30] = children;
|
|
239
|
+
$[31] = handleScroll;
|
|
240
|
+
$[32] = t31;
|
|
241
|
+
$[33] = viewportStyle;
|
|
242
|
+
$[34] = t32;
|
|
243
|
+
} else t32 = $[34];
|
|
244
|
+
let t33;
|
|
245
|
+
if ($[35] !== scrollShadow || $[36] !== scrollState.atBottom || $[37] !== scrollState.atTop || $[38] !== showVertical) {
|
|
246
|
+
t33 = scrollShadow && showVertical && /*#__PURE__*/ jsxs(Fragment, {
|
|
247
|
+
children: [
|
|
248
|
+
/*#__PURE__*/ jsx("div", {
|
|
249
|
+
"data-tao-scroll-shadow": "top",
|
|
250
|
+
"data-tao-visible": !scrollState.atTop || void 0
|
|
251
|
+
}),
|
|
252
|
+
/*#__PURE__*/ jsx("div", {
|
|
253
|
+
"data-tao-scroll-shadow": "bottom",
|
|
254
|
+
"data-tao-visible": !scrollState.atBottom || void 0
|
|
255
|
+
})
|
|
256
|
+
]
|
|
257
|
+
});
|
|
258
|
+
$[35] = scrollShadow;
|
|
259
|
+
$[36] = scrollState.atBottom;
|
|
260
|
+
$[37] = scrollState.atTop;
|
|
261
|
+
$[38] = showVertical;
|
|
262
|
+
$[39] = t33;
|
|
263
|
+
} else t33 = $[39];
|
|
264
|
+
let t34;
|
|
265
|
+
if ($[40] !== scrollShadow || $[41] !== scrollState.atLeft || $[42] !== scrollState.atRight || $[43] !== showHorizontal) {
|
|
266
|
+
t34 = scrollShadow && showHorizontal && /*#__PURE__*/ jsxs(Fragment, {
|
|
267
|
+
children: [
|
|
268
|
+
/*#__PURE__*/ jsx("div", {
|
|
269
|
+
"data-tao-scroll-shadow": "left",
|
|
270
|
+
"data-tao-visible": !scrollState.atLeft || void 0
|
|
271
|
+
}),
|
|
272
|
+
/*#__PURE__*/ jsx("div", {
|
|
273
|
+
"data-tao-scroll-shadow": "right",
|
|
274
|
+
"data-tao-visible": !scrollState.atRight || void 0
|
|
275
|
+
})
|
|
276
|
+
]
|
|
277
|
+
});
|
|
278
|
+
$[40] = scrollShadow;
|
|
279
|
+
$[41] = scrollState.atLeft;
|
|
280
|
+
$[42] = scrollState.atRight;
|
|
281
|
+
$[43] = showHorizontal;
|
|
282
|
+
$[44] = t34;
|
|
283
|
+
} else t34 = $[44];
|
|
284
|
+
let t35;
|
|
285
|
+
if ($[45] !== classNames?.scrollbar || $[46] !== classNames?.thumb || $[47] !== scrollState.hasVertical || $[48] !== scrollState.thumbYOffset || $[49] !== scrollState.thumbYRatio || $[50] !== showVertical || $[51] !== styles?.scrollbar || $[52] !== styles?.thumb) {
|
|
286
|
+
t35 = showVertical && scrollState.hasVertical && /*#__PURE__*/ jsx("div", {
|
|
287
|
+
"data-tao-scrollbar": "",
|
|
288
|
+
"data-tao-orientation": "vertical",
|
|
289
|
+
className: cx(classNames?.scrollbar),
|
|
290
|
+
style: styles?.scrollbar,
|
|
291
|
+
onClick: (e_2)=>handleTrackClick("y", e_2),
|
|
292
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
293
|
+
"data-tao-scroll-thumb": "",
|
|
294
|
+
"data-tao-orientation": "vertical",
|
|
295
|
+
className: cx(classNames?.thumb),
|
|
296
|
+
style: {
|
|
297
|
+
height: `${Math.max(100 * scrollState.thumbYRatio, 10)}%`,
|
|
298
|
+
top: `${scrollState.thumbYOffset * (1 - scrollState.thumbYRatio) * 100}%`,
|
|
299
|
+
...styles?.thumb
|
|
300
|
+
},
|
|
301
|
+
onPointerDown: (e_3)=>handleThumbPointerDown("y", e_3)
|
|
302
|
+
})
|
|
303
|
+
});
|
|
304
|
+
$[45] = classNames?.scrollbar;
|
|
305
|
+
$[46] = classNames?.thumb;
|
|
306
|
+
$[47] = scrollState.hasVertical;
|
|
307
|
+
$[48] = scrollState.thumbYOffset;
|
|
308
|
+
$[49] = scrollState.thumbYRatio;
|
|
309
|
+
$[50] = showVertical;
|
|
310
|
+
$[51] = styles?.scrollbar;
|
|
311
|
+
$[52] = styles?.thumb;
|
|
312
|
+
$[53] = t35;
|
|
313
|
+
} else t35 = $[53];
|
|
314
|
+
let t36;
|
|
315
|
+
if ($[54] !== classNames?.scrollbar || $[55] !== classNames?.thumb || $[56] !== scrollState.hasHorizontal || $[57] !== scrollState.thumbXOffset || $[58] !== scrollState.thumbXRatio || $[59] !== showHorizontal || $[60] !== styles?.scrollbar || $[61] !== styles?.thumb) {
|
|
316
|
+
t36 = showHorizontal && scrollState.hasHorizontal && /*#__PURE__*/ jsx("div", {
|
|
317
|
+
"data-tao-scrollbar": "",
|
|
318
|
+
"data-tao-orientation": "horizontal",
|
|
319
|
+
className: cx(classNames?.scrollbar),
|
|
320
|
+
style: styles?.scrollbar,
|
|
321
|
+
onClick: (e_4)=>handleTrackClick("x", e_4),
|
|
322
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
323
|
+
"data-tao-scroll-thumb": "",
|
|
324
|
+
"data-tao-orientation": "horizontal",
|
|
325
|
+
className: cx(classNames?.thumb),
|
|
326
|
+
style: {
|
|
327
|
+
width: `${Math.max(100 * scrollState.thumbXRatio, 10)}%`,
|
|
328
|
+
left: `${scrollState.thumbXOffset * (1 - scrollState.thumbXRatio) * 100}%`,
|
|
329
|
+
...styles?.thumb
|
|
330
|
+
},
|
|
331
|
+
onPointerDown: (e_5)=>handleThumbPointerDown("x", e_5)
|
|
332
|
+
})
|
|
333
|
+
});
|
|
334
|
+
$[54] = classNames?.scrollbar;
|
|
335
|
+
$[55] = classNames?.thumb;
|
|
336
|
+
$[56] = scrollState.hasHorizontal;
|
|
337
|
+
$[57] = scrollState.thumbXOffset;
|
|
338
|
+
$[58] = scrollState.thumbXRatio;
|
|
339
|
+
$[59] = showHorizontal;
|
|
340
|
+
$[60] = styles?.scrollbar;
|
|
341
|
+
$[61] = styles?.thumb;
|
|
342
|
+
$[62] = t36;
|
|
343
|
+
} else t36 = $[62];
|
|
344
|
+
let t37;
|
|
345
|
+
if ($[63] !== t24 || $[64] !== t25 || $[65] !== t27 || $[66] !== t29 || $[67] !== t32 || $[68] !== t33 || $[69] !== t34 || $[70] !== t35 || $[71] !== t36 || $[72] !== type) {
|
|
346
|
+
t37 = /*#__PURE__*/ jsxs("div", {
|
|
347
|
+
"data-tao-scroll-area": "",
|
|
348
|
+
"data-tao-scroll-type": type,
|
|
349
|
+
"data-tao-has-v": t24,
|
|
350
|
+
"data-tao-has-h": t25,
|
|
351
|
+
className: t27,
|
|
352
|
+
style: t29,
|
|
353
|
+
children: [
|
|
354
|
+
t32,
|
|
355
|
+
t33,
|
|
356
|
+
t34,
|
|
357
|
+
t35,
|
|
358
|
+
t36
|
|
359
|
+
]
|
|
360
|
+
});
|
|
361
|
+
$[63] = t24;
|
|
362
|
+
$[64] = t25;
|
|
363
|
+
$[65] = t27;
|
|
364
|
+
$[66] = t29;
|
|
365
|
+
$[67] = t32;
|
|
366
|
+
$[68] = t33;
|
|
367
|
+
$[69] = t34;
|
|
368
|
+
$[70] = t35;
|
|
369
|
+
$[71] = t36;
|
|
370
|
+
$[72] = type;
|
|
371
|
+
$[73] = t37;
|
|
372
|
+
} else t37 = $[73];
|
|
373
|
+
return t37;
|
|
374
|
+
}
|
|
375
|
+
export { ScrollArea };
|