@situaction/traq-ui-ste 1.1.10 → 1.1.12
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.
|
@@ -4,5 +4,8 @@ export interface ButtonControlledScrollProps {
|
|
|
4
4
|
items: React.ReactNode[];
|
|
5
5
|
iconLeft: ReactNode;
|
|
6
6
|
iconRight: ReactNode;
|
|
7
|
+
grabSpeed?: number;
|
|
8
|
+
scrollAmount?: number;
|
|
9
|
+
grabbable?: boolean;
|
|
7
10
|
}
|
|
8
11
|
export declare const ButtonControlledScroll: FC<ButtonControlledScrollProps>;
|
|
@@ -1,31 +1,54 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import '../../styles/ButtonControlledScroll.css';const
|
|
4
|
-
wrapper:
|
|
5
|
-
container:
|
|
6
|
-
btn:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { jsxs as N, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as l, useState as _, useEffect as D } from "react";
|
|
3
|
+
import '../../styles/ButtonControlledScroll.css';const k = "_wrapper_r0cby_6", E = "_container_r0cby_16", U = "_btn_r0cby_27", X = "_grab_r0cby_44", j = "_grabbing_r0cby_48", B = "_btnLeft_r0cby_54", O = "_btnRight_r0cby_59", n = {
|
|
4
|
+
wrapper: k,
|
|
5
|
+
container: E,
|
|
6
|
+
btn: U,
|
|
7
|
+
grab: X,
|
|
8
|
+
grabbing: j,
|
|
9
|
+
btnLeft: B,
|
|
10
|
+
btnRight: O
|
|
11
|
+
}, T = ({ items: h, iconLeft: p, iconRight: L, scrollAmount: m = 150, grabSpeed: v = 1.5, grabbable: c = !0 }) => {
|
|
12
|
+
const i = m, r = l(null), [M, S] = _(!1), [y, R] = _(!1), s = l(!1), f = l(0), u = l(0), w = (t) => {
|
|
13
|
+
if (c) {
|
|
14
|
+
const e = r.current;
|
|
15
|
+
if (!e) return;
|
|
16
|
+
s.current = !0, f.current = t.pageX - e.offsetLeft, u.current = e.scrollLeft, e.classList.add(n.grabbing);
|
|
17
|
+
}
|
|
18
|
+
}, x = (t) => {
|
|
19
|
+
if (c) {
|
|
20
|
+
const e = r.current;
|
|
21
|
+
if (!e || !s.current) return;
|
|
22
|
+
t.preventDefault();
|
|
23
|
+
const C = (t.pageX - e.offsetLeft - f.current) * v;
|
|
24
|
+
e.scrollLeft = u.current + C;
|
|
25
|
+
}
|
|
26
|
+
}, b = () => {
|
|
27
|
+
if (c) {
|
|
28
|
+
const t = r.current;
|
|
29
|
+
s.current = !1, t == null || t.classList.remove(n.grabbing);
|
|
30
|
+
}
|
|
31
|
+
}, $ = () => {
|
|
32
|
+
s.current && c && b();
|
|
33
|
+
}, a = () => {
|
|
34
|
+
const t = r.current;
|
|
35
|
+
t && (S(t.scrollLeft > 0), R(t.scrollLeft + t.clientWidth < t.scrollWidth));
|
|
36
|
+
}, d = (t) => {
|
|
37
|
+
const e = r.current;
|
|
38
|
+
if (!e) return;
|
|
39
|
+
const g = t === "left" ? -i : i;
|
|
40
|
+
e.scrollBy({ left: g, behavior: "smooth" });
|
|
18
41
|
};
|
|
19
|
-
return
|
|
20
|
-
const t =
|
|
42
|
+
return D(() => {
|
|
43
|
+
const t = r.current;
|
|
21
44
|
if (t)
|
|
22
|
-
return
|
|
23
|
-
}, []), /* @__PURE__ */
|
|
24
|
-
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
45
|
+
return a(), t.addEventListener("scroll", a), () => t.removeEventListener("scroll", a);
|
|
46
|
+
}, []), /* @__PURE__ */ N("div", { className: `${n.wrapper}`, children: [
|
|
47
|
+
M && /* @__PURE__ */ o("button", { className: `${n.btn} ${n.btnLeft} padding-xs-5`, onClick: () => d("left"), children: p }),
|
|
48
|
+
/* @__PURE__ */ o("div", { onMouseDown: w, onMouseLeave: $, onMouseMove: x, onMouseUp: b, className: `${n.container} ${c && n.grab}`, ref: r, children: h.map((t, e) => /* @__PURE__ */ o("div", { className: n.item, children: t }, e)) }),
|
|
49
|
+
y && /* @__PURE__ */ o("button", { className: `${n.btn} ${n.btnRight} padding-xs-5`, onClick: () => d("right"), children: L })
|
|
27
50
|
] });
|
|
28
51
|
};
|
|
29
52
|
export {
|
|
30
|
-
|
|
53
|
+
T as ButtonControlledScroll
|
|
31
54
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Export components **/
|
|
2
2
|
export { Button } from './components/button/Button';
|
|
3
|
+
export { ButtonControlledScroll } from './components/buttonControledScroll/ButtonControlledScroll';
|
|
3
4
|
export { Input } from './components/input/Input';
|
|
4
5
|
export { Tabs } from './components/tabs/Tabs';
|
|
5
6
|
export { IconButton } from './components/icon-button/IconButton';
|
package/dist/main.js
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
import { Button as e } from "./components/button/Button.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
2
|
+
import { ButtonControlledScroll as m } from "./components/buttonControledScroll/ButtonControlledScroll.js";
|
|
3
|
+
import { Input as x } from "./components/input/Input.js";
|
|
4
|
+
import { Tabs as n } from "./components/tabs/Tabs.js";
|
|
5
|
+
import { IconButton as l } from "./components/icon-button/IconButton.js";
|
|
6
|
+
import { Tag as a } from "./components/tag/Tag.js";
|
|
7
|
+
import { Title as u } from "./components/title/Title.js";
|
|
8
|
+
import { TagCounter as C } from "./components/tag-counter/TagCounter.js";
|
|
9
|
+
import { Checkbox as B } from "./components/checkbox/Checkbox.js";
|
|
10
|
+
import { Tooltip as b } from "./components/tooltip/Tooltip.js";
|
|
11
|
+
import { Select as s } from "./components/select/Select.js";
|
|
12
|
+
import { Calendar as S } from "./components/calendar/Calendar.js";
|
|
13
|
+
import { Accordion as v } from "./components/accordion/Accordion.js";
|
|
14
|
+
import { AccordionItem as j } from "./components/accordion/item/AccordionItem.js";
|
|
15
|
+
import { Card as w } from "./components/card/Card.js";
|
|
16
|
+
import { ThemeProvider as z, useTheme as D } from "./components/theme/ThemeContext.js";
|
|
16
17
|
import './styles/main.css';export {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
v as Accordion,
|
|
19
|
+
j as AccordionItem,
|
|
19
20
|
e as Button,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
m as ButtonControlledScroll,
|
|
22
|
+
S as Calendar,
|
|
23
|
+
w as Card,
|
|
24
|
+
B as Checkbox,
|
|
25
|
+
l as IconButton,
|
|
26
|
+
x as Input,
|
|
27
|
+
s as Select,
|
|
28
|
+
n as Tabs,
|
|
29
|
+
a as Tag,
|
|
30
|
+
C as TagCounter,
|
|
31
|
+
z as ThemeProvider,
|
|
32
|
+
u as Title,
|
|
33
|
+
b as Tooltip,
|
|
34
|
+
D as useTheme
|
|
33
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._wrapper_r0cby_6{position:relative;display:flex;align-items:center;width:100%;-webkit-user-select:none;user-select:none}._wrapper_r0cby_6 label{-webkit-user-select:none;user-select:none}._wrapper_r0cby_6 ._container_r0cby_16{display:flex;overflow-x:auto;gap:10px;padding:10px;width:100%;scroll-behavior:smooth}._wrapper_r0cby_6 ._container_r0cby_16::-webkit-scrollbar{display:none}._wrapper_r0cby_6 ._btn_r0cby_27{transition:.3s;display:flex;justify-content:center;align-items:center;width:30px;height:30px;padding:.375rem;border-radius:50%;border:1px solid var(--button-tertiary-default-border);background-color:var(--background-primary);position:absolute;cursor:pointer}._wrapper_r0cby_6 ._btn_r0cby_27 *{z-index:2}._wrapper_r0cby_6 ._grab_r0cby_44{cursor:grab;scroll-behavior:initial}._wrapper_r0cby_6 ._grabbing_r0cby_48{cursor:grabbing}._wrapper_r0cby_6 ._btn_r0cby_27:hover{background-color:var(--background-tooltip)}._wrapper_r0cby_6 ._btnLeft_r0cby_54{left:0;top:50%;transform:translateY(-50%)}._wrapper_r0cby_6 ._btnRight_r0cby_59{right:0;top:50%;transform:translateY(-50%)}
|