@code0-tech/pictor 0.10.9 → 0.11.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/dist/assets/components/context-menu/ContextMenu.style.css +1 -1
- package/dist/assets/components/form/EditorInput.style.css +1 -1
- package/dist/assets/components/menu/Menu.style.css +1 -1
- package/dist/assets/components/scroll-area/ScrollArea.style.css +1 -1
- package/dist/assets/components/tooltip/Tooltip.style.css +1 -1
- package/dist/components/context-menu/ContextMenu.js +109 -90
- package/dist/components/form/EditorInput.d.ts +19 -8
- package/dist/components/form/EditorInput.js +164 -72
- package/dist/components/form/InputSuggestion.d.ts +1 -1
- package/dist/components/form/useForm.js +61 -46
- package/dist/components/menu/Menu.js +112 -93
- package/dist/components/scroll-area/ScrollArea.d.ts +8 -0
- package/dist/components/scroll-area/ScrollArea.js +70 -39
- package/dist/components/tooltip/Tooltip.js +53 -43
- package/dist/index.js +71 -70
- package/package.json +11 -5
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
3
|
-
return (e =
|
|
1
|
+
import y, { useState as P, useRef as v, useCallback as j, useEffect as I } from "react";
|
|
2
|
+
function h(s, e, t) {
|
|
3
|
+
return (e = _(e)) in s ? Object.defineProperty(s, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : s[e] = t, s;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
var e =
|
|
5
|
+
function _(s) {
|
|
6
|
+
var e = B(s, "string");
|
|
7
7
|
return typeof e == "symbol" ? e : e + "";
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
if (typeof
|
|
11
|
-
var t =
|
|
9
|
+
function B(s, e) {
|
|
10
|
+
if (typeof s != "object" || !s) return s;
|
|
11
|
+
var t = s[Symbol.toPrimitive];
|
|
12
12
|
if (t !== void 0) {
|
|
13
|
-
var
|
|
14
|
-
if (typeof
|
|
13
|
+
var n = t.call(s, e);
|
|
14
|
+
if (typeof n != "object") return n;
|
|
15
15
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16
16
|
}
|
|
17
|
-
return (e === "string" ? String : Number)(
|
|
17
|
+
return (e === "string" ? String : Number)(s);
|
|
18
18
|
}
|
|
19
|
-
class
|
|
20
|
-
constructor(e, t,
|
|
21
|
-
|
|
19
|
+
class w {
|
|
20
|
+
constructor(e, t, n, V = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map()) {
|
|
21
|
+
h(this, "changeValue", void 0), h(this, "currentValues", void 0), h(this, "currentValidations", void 0), h(this, "shouldValidate", void 0), h(this, "cachedMessages", void 0), h(this, "cachedSetters", void 0), h(this, "cachedProps", void 0), this.changeValue = e, this.currentValues = t, this.currentValidations = n, this.shouldValidate = V, this.cachedMessages = l, this.cachedSetters = r, this.cachedProps = a;
|
|
22
22
|
}
|
|
23
23
|
isValid() {
|
|
24
24
|
if (!this.currentValidations) return !0;
|
|
@@ -30,49 +30,64 @@ class p {
|
|
|
30
30
|
return !0;
|
|
31
31
|
}
|
|
32
32
|
getInputProps(e) {
|
|
33
|
-
const t = this.currentValues[e],
|
|
34
|
-
let
|
|
35
|
-
|
|
33
|
+
const t = this.currentValues[e], n = t ?? null, V = e, l = this.currentValidations && this.currentValidations[e] ? this.currentValidations[e] : (d) => null;
|
|
34
|
+
let r = null;
|
|
35
|
+
this.shouldValidate.has(e) ? (r = l(t, this.currentValues), this.cachedMessages.set(e, r)) : r = this.cachedMessages.get(e) ?? null;
|
|
36
|
+
const a = !!(this.currentValidations && this.currentValidations[e]), u = this.cachedProps.get(e);
|
|
37
|
+
if (u && Object.is(u.value, n) && u.message === r && u.required === a)
|
|
38
|
+
return u.props;
|
|
39
|
+
let c = this.cachedSetters.get(e);
|
|
40
|
+
if (!c) {
|
|
41
|
+
const d = this.changeValue;
|
|
42
|
+
c = (o) => {
|
|
43
|
+
d(V, o);
|
|
44
|
+
}, this.cachedSetters.set(e, c);
|
|
45
|
+
}
|
|
46
|
+
const p = {
|
|
36
47
|
// @ts-ignore – z.B. wenn dein Input `defaultValue` kennt
|
|
37
|
-
defaultValue:
|
|
38
|
-
initialValue:
|
|
48
|
+
defaultValue: n ?? void 0,
|
|
49
|
+
initialValue: n ?? void 0,
|
|
39
50
|
formValidation: {
|
|
40
|
-
setValue:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
notValidMessage: a,
|
|
44
|
-
valid: a === null
|
|
51
|
+
setValue: c,
|
|
52
|
+
notValidMessage: r,
|
|
53
|
+
valid: r === null
|
|
45
54
|
},
|
|
46
|
-
...
|
|
55
|
+
...a ? {
|
|
47
56
|
required: !0
|
|
48
57
|
} : {}
|
|
49
58
|
};
|
|
59
|
+
return this.cachedProps.set(e, {
|
|
60
|
+
value: n,
|
|
61
|
+
message: r,
|
|
62
|
+
required: a,
|
|
63
|
+
props: p
|
|
64
|
+
}), p;
|
|
50
65
|
}
|
|
51
66
|
}
|
|
52
|
-
const
|
|
67
|
+
const N = (s) => {
|
|
53
68
|
const {
|
|
54
69
|
initialValues: e,
|
|
55
70
|
validate: t = {},
|
|
56
|
-
truthyValidationBeforeSubmit:
|
|
57
|
-
useInitialValidation:
|
|
58
|
-
onSubmit:
|
|
59
|
-
} =
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
...
|
|
64
|
-
[
|
|
65
|
-
},
|
|
66
|
-
}, []), [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, [
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
}, [
|
|
74
|
-
return [
|
|
71
|
+
truthyValidationBeforeSubmit: n = !0,
|
|
72
|
+
useInitialValidation: V = !0,
|
|
73
|
+
onSubmit: l
|
|
74
|
+
} = s, r = y.useMemo(() => e, [e]), [a, u] = P(r), c = v(/* @__PURE__ */ new Map()), p = v(/* @__PURE__ */ new Map()), d = v(/* @__PURE__ */ new Map()), o = v(a);
|
|
75
|
+
o.current = a;
|
|
76
|
+
const g = j((i, m) => {
|
|
77
|
+
o.current = {
|
|
78
|
+
...o.current,
|
|
79
|
+
[i]: m
|
|
80
|
+
}, u(o.current);
|
|
81
|
+
}, []), [O, M] = P(() => new w(g, a, t, V ? new Map(Object.keys(r).map((i) => [i, !0])) : /* @__PURE__ */ new Map(), c.current, p.current, d.current)), b = v(!1);
|
|
82
|
+
I(() => {
|
|
83
|
+
o.current = r, u(r), b.current && d.current.clear(), b.current = !0, M(new w(g, r, t, V ? new Map(Object.keys(r).map((i) => [i, !0])) : /* @__PURE__ */ new Map(), c.current, p.current, d.current));
|
|
84
|
+
}, [r]);
|
|
85
|
+
const R = j((i, m = !0) => {
|
|
86
|
+
const f = o.current, F = i && new Set(Object.keys(f)).has(String(i)) ? /* @__PURE__ */ new Map([[i, !0]]) : new Map(Object.keys(f).map((q) => [String(q), !0])), S = new w(g, f, t, F, c.current, p.current, d.current);
|
|
87
|
+
M(S), m && !new Set(Object.keys(f)).has(String(i)) && l && (!n || S.isValid()) && l(f);
|
|
88
|
+
}, [g, t, l, n]);
|
|
89
|
+
return [O, R, a];
|
|
75
90
|
};
|
|
76
91
|
export {
|
|
77
|
-
|
|
92
|
+
N as useForm
|
|
78
93
|
};
|
|
@@ -1,123 +1,142 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { c as r } from "../../_virtual/compiler-runtime.js";
|
|
3
3
|
import '../../assets/components/menu/Menu.style.css';/* empty css */
|
|
4
4
|
import "../../utils/contextStore.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { mergeComponentProps as
|
|
6
|
+
import { mergeComponentProps as u } from "../../utils/component.js";
|
|
7
7
|
import "js-md5";
|
|
8
|
-
import { DropdownMenuItem as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
e[0] !== o ? (n = r("menu", o), e[0] = o, e[1] = n) : n = e[1];
|
|
13
|
-
const c = n;
|
|
8
|
+
import { DropdownMenuItem as a, DropdownMenuLabel as w, DropdownMenu as b, DropdownMenuTrigger as g, DropdownMenuPortal as $, DropdownMenuArrow as D, DropdownMenuCheckboxItem as h, DropdownMenuGroup as S, DropdownMenuItemIndicator as I, DropdownMenuSeparator as C, DropdownMenuSub as x, DropdownMenuSubTrigger as T, DropdownMenuContent as A, DropdownMenuSubContent as k } from "@radix-ui/react-dropdown-menu";
|
|
9
|
+
import { AutoScrollArea as M } from "../scroll-area/ScrollArea.js";
|
|
10
|
+
const z = (l) => {
|
|
11
|
+
const e = r.c(4);
|
|
14
12
|
let t;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const e = l.c(4);
|
|
13
|
+
e[0] !== l ? (t = u("menu", l), e[0] = l, e[1] = t) : t = e[1];
|
|
14
|
+
const o = t;
|
|
18
15
|
let n;
|
|
19
|
-
e[
|
|
20
|
-
|
|
16
|
+
return e[2] !== o ? (n = /* @__PURE__ */ c(b, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
17
|
+
}, B = (l) => {
|
|
18
|
+
const e = r.c(4);
|
|
21
19
|
let t;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const e = l.c(4);
|
|
20
|
+
e[0] !== l ? (t = u("menu__trigger", l), e[0] = l, e[1] = t) : t = e[1];
|
|
21
|
+
const o = t;
|
|
25
22
|
let n;
|
|
26
|
-
e[
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return e[2] !== c ? (t = /* @__PURE__ */ u(g, { ...c }), e[2] = c, e[3] = t) : t = e[3], t;
|
|
30
|
-
}, R = (o) => {
|
|
31
|
-
const e = l.c(6), n = o.align, c = `menu__content menu__content--${o.color ?? "primary"}`;
|
|
23
|
+
return e[2] !== o ? (n = /* @__PURE__ */ c(g, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
24
|
+
}, F = (l) => {
|
|
25
|
+
const e = r.c(4);
|
|
32
26
|
let t;
|
|
33
|
-
e[0] !==
|
|
34
|
-
const
|
|
35
|
-
let s;
|
|
36
|
-
return e[3] !== o.align || e[4] !== i ? (s = /* @__PURE__ */ u(f, { align: n, ...i }), e[3] = o.align, e[4] = i, e[5] = s) : s = e[5], s;
|
|
37
|
-
}, q = (o) => {
|
|
38
|
-
const e = l.c(4);
|
|
27
|
+
e[0] !== l ? (t = u("menu__portal", l), e[0] = l, e[1] = t) : t = e[1];
|
|
28
|
+
const o = t;
|
|
39
29
|
let n;
|
|
40
|
-
e[
|
|
41
|
-
|
|
30
|
+
return e[2] !== o ? (n = /* @__PURE__ */ c($, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
31
|
+
}, H = (l) => {
|
|
32
|
+
const e = r.c(12);
|
|
33
|
+
let t, o, n, s;
|
|
34
|
+
if (e[0] !== l) {
|
|
35
|
+
const {
|
|
36
|
+
children: _,
|
|
37
|
+
...d
|
|
38
|
+
} = l;
|
|
39
|
+
o = _, t = A, s = l.align, n = u(`menu__content menu__content--${l.color ?? "primary"}`, d), e[0] = l, e[1] = t, e[2] = o, e[3] = n, e[4] = s;
|
|
40
|
+
} else
|
|
41
|
+
t = e[1], o = e[2], n = e[3], s = e[4];
|
|
42
|
+
const m = n;
|
|
43
|
+
let i;
|
|
44
|
+
e[5] !== o ? (i = /* @__PURE__ */ c(M, { children: o }), e[5] = o, e[6] = i) : i = e[6];
|
|
45
|
+
let f;
|
|
46
|
+
return e[7] !== t || e[8] !== s || e[9] !== m || e[10] !== i ? (f = /* @__PURE__ */ c(t, { align: s, ...m, children: i }), e[7] = t, e[8] = s, e[9] = m, e[10] = i, e[11] = f) : f = e[11], f;
|
|
47
|
+
}, J = (l) => {
|
|
48
|
+
const e = r.c(4);
|
|
42
49
|
let t;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const e = l.c(4);
|
|
50
|
+
e[0] !== l ? (t = u("menu__label", l), e[0] = l, e[1] = t) : t = e[1];
|
|
51
|
+
const o = t;
|
|
46
52
|
let n;
|
|
47
|
-
e[
|
|
48
|
-
|
|
53
|
+
return e[2] !== o ? (n = /* @__PURE__ */ c(w, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
54
|
+
}, K = (l) => {
|
|
55
|
+
const e = r.c(4);
|
|
49
56
|
let t;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const e = l.c(4);
|
|
57
|
+
e[0] !== l ? (t = u("menu__item", l), e[0] = l, e[1] = t) : t = e[1];
|
|
58
|
+
const o = t;
|
|
53
59
|
let n;
|
|
54
|
-
e[
|
|
55
|
-
|
|
60
|
+
return e[2] !== o ? (n = /* @__PURE__ */ c(a, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
61
|
+
}, N = (l) => {
|
|
62
|
+
const e = r.c(4);
|
|
56
63
|
let t;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const e = l.c(4);
|
|
64
|
+
e[0] !== l ? (t = u("menu__group", l), e[0] = l, e[1] = t) : t = e[1];
|
|
65
|
+
const o = t;
|
|
60
66
|
let n;
|
|
61
|
-
e[
|
|
62
|
-
|
|
67
|
+
return e[2] !== o ? (n = /* @__PURE__ */ c(S, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
68
|
+
}, O = (l) => {
|
|
69
|
+
const e = r.c(4);
|
|
63
70
|
let t;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const e = l.c(4);
|
|
71
|
+
e[0] !== l ? (t = u("menu__sub", l), e[0] = l, e[1] = t) : t = e[1];
|
|
72
|
+
const o = t;
|
|
67
73
|
let n;
|
|
68
|
-
e[
|
|
69
|
-
|
|
74
|
+
return e[2] !== o ? (n = /* @__PURE__ */ c(x, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
75
|
+
}, Q = (l) => {
|
|
76
|
+
const e = r.c(4);
|
|
70
77
|
let t;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const e = l.c(5), n = `menu__sub-content menu__sub-content--${o.color ?? "primary"}`;
|
|
74
|
-
let c;
|
|
75
|
-
e[0] !== o || e[1] !== n ? (c = r(n, o), e[0] = o, e[1] = n, e[2] = c) : c = e[2];
|
|
76
|
-
const t = c;
|
|
77
|
-
let i;
|
|
78
|
-
return e[3] !== t ? (i = /* @__PURE__ */ u(S, { ...t }), e[3] = t, e[4] = i) : i = e[4], i;
|
|
79
|
-
}, J = (o) => {
|
|
80
|
-
const e = l.c(4);
|
|
78
|
+
e[0] !== l ? (t = u("menu__sub-trigger", l), e[0] = l, e[1] = t) : t = e[1];
|
|
79
|
+
const o = t;
|
|
81
80
|
let n;
|
|
82
|
-
e[
|
|
83
|
-
|
|
81
|
+
return e[2] !== o ? (n = /* @__PURE__ */ c(T, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
82
|
+
}, U = (l) => {
|
|
83
|
+
const e = r.c(10);
|
|
84
|
+
let t, o, n;
|
|
85
|
+
if (e[0] !== l) {
|
|
86
|
+
const {
|
|
87
|
+
children: f,
|
|
88
|
+
..._
|
|
89
|
+
} = l;
|
|
90
|
+
o = f, t = k, n = u(`menu__sub-content menu__sub-content--${l.color ?? "primary"}`, _), e[0] = l, e[1] = t, e[2] = o, e[3] = n;
|
|
91
|
+
} else
|
|
92
|
+
t = e[1], o = e[2], n = e[3];
|
|
93
|
+
const s = n;
|
|
94
|
+
let m;
|
|
95
|
+
e[4] !== o ? (m = /* @__PURE__ */ c(M, { children: o }), e[4] = o, e[5] = m) : m = e[5];
|
|
96
|
+
let i;
|
|
97
|
+
return e[6] !== t || e[7] !== s || e[8] !== m ? (i = /* @__PURE__ */ c(t, { ...s, children: m }), e[6] = t, e[7] = s, e[8] = m, e[9] = i) : i = e[9], i;
|
|
98
|
+
}, V = (l) => {
|
|
99
|
+
const e = r.c(4);
|
|
84
100
|
let t;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const e = l.c(4);
|
|
101
|
+
e[0] !== l ? (t = u("menu__separator", l), e[0] = l, e[1] = t) : t = e[1];
|
|
102
|
+
const o = t;
|
|
88
103
|
let n;
|
|
89
|
-
e[
|
|
90
|
-
|
|
104
|
+
return e[2] !== o ? (n = /* @__PURE__ */ c(C, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
105
|
+
}, W = (l) => {
|
|
106
|
+
const e = r.c(4);
|
|
91
107
|
let t;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const e = l.c(4);
|
|
108
|
+
e[0] !== l ? (t = u("menu__checkbox-item", l), e[0] = l, e[1] = t) : t = e[1];
|
|
109
|
+
const o = t;
|
|
95
110
|
let n;
|
|
96
|
-
e[
|
|
97
|
-
|
|
111
|
+
return e[2] !== o ? (n = /* @__PURE__ */ c(h, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
112
|
+
}, X = (l) => {
|
|
113
|
+
const e = r.c(4);
|
|
98
114
|
let t;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const e = l.c(4);
|
|
115
|
+
e[0] !== l ? (t = u("menu__item-indicator", l), e[0] = l, e[1] = t) : t = e[1];
|
|
116
|
+
const o = t;
|
|
102
117
|
let n;
|
|
103
|
-
e[
|
|
104
|
-
|
|
118
|
+
return e[2] !== o ? (n = /* @__PURE__ */ c(I, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
119
|
+
}, Y = (l) => {
|
|
120
|
+
const e = r.c(4);
|
|
105
121
|
let t;
|
|
106
|
-
|
|
122
|
+
e[0] !== l ? (t = u("menu__arrow", l), e[0] = l, e[1] = t) : t = e[1];
|
|
123
|
+
const o = t;
|
|
124
|
+
let n;
|
|
125
|
+
return e[2] !== o ? (n = /* @__PURE__ */ c(D, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
107
126
|
};
|
|
108
127
|
export {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
128
|
+
z as Menu,
|
|
129
|
+
Y as MenuArrow,
|
|
130
|
+
W as MenuCheckboxItem,
|
|
131
|
+
H as MenuContent,
|
|
132
|
+
N as MenuGroup,
|
|
133
|
+
K as MenuItem,
|
|
134
|
+
X as MenuItemIndicator,
|
|
135
|
+
J as MenuLabel,
|
|
136
|
+
F as MenuPortal,
|
|
137
|
+
V as MenuSeparator,
|
|
138
|
+
O as MenuSub,
|
|
139
|
+
U as MenuSubContent,
|
|
140
|
+
Q as MenuSubTrigger,
|
|
141
|
+
B as MenuTrigger
|
|
123
142
|
};
|
|
@@ -11,3 +11,11 @@ export declare const ScrollAreaViewport: React.FC<ScrollAreaViewportProps>;
|
|
|
11
11
|
export declare const ScrollAreaScrollbar: React.FC<ScrollAreaScrollbarProps>;
|
|
12
12
|
export declare const ScrollAreaThumb: React.FC<ScrollAreaThumbProps>;
|
|
13
13
|
export declare const ScrollAreaCorner: React.FC<ScrollAreaCornerProps>;
|
|
14
|
+
export type AutoScrollAreaProps = ScrollAreaProps;
|
|
15
|
+
/**
|
|
16
|
+
* ScrollArea that sizes itself to its content and scrolls once the content
|
|
17
|
+
* exceeds the available height of the surrounding Radix popper (menus,
|
|
18
|
+
* sub menus, tooltips). Used internally by MenuContent, MenuSubContent,
|
|
19
|
+
* ContextMenuContent, ContextMenuSubContent and TooltipContent.
|
|
20
|
+
*/
|
|
21
|
+
export declare const AutoScrollArea: React.FC<AutoScrollAreaProps>;
|
|
@@ -1,46 +1,77 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "../../_virtual/compiler-runtime.js";
|
|
1
|
+
import { jsx as o, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import A from "react";
|
|
3
4
|
import "../../utils/contextStore.js";
|
|
4
|
-
import "react";
|
|
5
5
|
import { mergeComponentProps as a } from "../../utils/component.js";
|
|
6
6
|
import "js-md5";
|
|
7
|
-
import * as
|
|
7
|
+
import * as s from "@radix-ui/react-scroll-area";
|
|
8
8
|
import '../../assets/components/scroll-area/ScrollArea.style.css';/* empty css */
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
return
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
let
|
|
20
|
-
return
|
|
21
|
-
},
|
|
22
|
-
const
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
let
|
|
26
|
-
return
|
|
27
|
-
},
|
|
28
|
-
const
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
let
|
|
32
|
-
return
|
|
33
|
-
},
|
|
34
|
-
const
|
|
35
|
-
let
|
|
36
|
-
|
|
37
|
-
let
|
|
38
|
-
return
|
|
9
|
+
const y = (l) => {
|
|
10
|
+
const e = n.c(4);
|
|
11
|
+
let t;
|
|
12
|
+
e[0] !== l ? (t = a("scroll-area", l), e[0] = l, e[1] = t) : t = e[1];
|
|
13
|
+
let r;
|
|
14
|
+
return e[2] !== t ? (r = /* @__PURE__ */ o(s.ScrollArea, { ...t }), e[2] = t, e[3] = r) : r = e[3], r;
|
|
15
|
+
}, C = (l) => {
|
|
16
|
+
const e = n.c(4);
|
|
17
|
+
let t;
|
|
18
|
+
e[0] !== l ? (t = a("scroll-area__viewport", l), e[0] = l, e[1] = t) : t = e[1];
|
|
19
|
+
let r;
|
|
20
|
+
return e[2] !== t ? (r = /* @__PURE__ */ o(s.ScrollAreaViewport, { ...t }), e[2] = t, e[3] = r) : r = e[3], r;
|
|
21
|
+
}, j = (l) => {
|
|
22
|
+
const e = n.c(4);
|
|
23
|
+
let t;
|
|
24
|
+
e[0] !== l ? (t = a("scroll-area__scrollbar", l), e[0] = l, e[1] = t) : t = e[1];
|
|
25
|
+
let r;
|
|
26
|
+
return e[2] !== t ? (r = /* @__PURE__ */ o(s.ScrollAreaScrollbar, { ...t }), e[2] = t, e[3] = r) : r = e[3], r;
|
|
27
|
+
}, E = (l) => {
|
|
28
|
+
const e = n.c(4);
|
|
29
|
+
let t;
|
|
30
|
+
e[0] !== l ? (t = a("scroll-area__thumb", l), e[0] = l, e[1] = t) : t = e[1];
|
|
31
|
+
let r;
|
|
32
|
+
return e[2] !== t ? (r = /* @__PURE__ */ o(s.ScrollAreaThumb, { ...t }), e[2] = t, e[3] = r) : r = e[3], r;
|
|
33
|
+
}, P = (l) => {
|
|
34
|
+
const e = n.c(4);
|
|
35
|
+
let t;
|
|
36
|
+
e[0] !== l ? (t = a("scroll-area__corner", l), e[0] = l, e[1] = t) : t = e[1];
|
|
37
|
+
let r;
|
|
38
|
+
return e[2] !== t ? (r = /* @__PURE__ */ o(s.ScrollAreaCorner, { ...t }), e[2] = t, e[3] = r) : r = e[3], r;
|
|
39
|
+
}, k = (l) => {
|
|
40
|
+
const e = n.c(14);
|
|
41
|
+
let t, r, i;
|
|
42
|
+
e[0] !== l ? ({
|
|
43
|
+
children: t,
|
|
44
|
+
mah: i,
|
|
45
|
+
...r
|
|
46
|
+
} = l, e[0] = l, e[1] = t, e[2] = r, e[3] = i) : (t = e[1], r = e[2], i = e[3]);
|
|
47
|
+
const S = i === void 0 ? "var(--radix-popper-available-height, 100vh)" : i, b = A.useRef(null), [d, $] = A.useState();
|
|
48
|
+
let f, m;
|
|
49
|
+
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = () => {
|
|
50
|
+
const v = b.current;
|
|
51
|
+
if (!v)
|
|
52
|
+
return;
|
|
53
|
+
const x = new ResizeObserver((g) => {
|
|
54
|
+
const R = g[0];
|
|
55
|
+
R && $(R.contentRect.height);
|
|
56
|
+
});
|
|
57
|
+
return x.observe(v), () => x.disconnect();
|
|
58
|
+
}, m = [], e[4] = f, e[5] = m) : (f = e[4], m = e[5]), A.useLayoutEffect(f, m);
|
|
59
|
+
const _ = d !== void 0 ? `${d}px` : void 0;
|
|
60
|
+
let c;
|
|
61
|
+
e[6] !== t ? (c = /* @__PURE__ */ o(C, { children: /* @__PURE__ */ o("div", { ref: b, children: t }) }), e[6] = t, e[7] = c) : c = e[7];
|
|
62
|
+
let u;
|
|
63
|
+
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ o(j, { orientation: "vertical", children: /* @__PURE__ */ o(E, {}) }), e[8] = u) : u = e[8];
|
|
64
|
+
let h;
|
|
65
|
+
return e[9] !== S || e[10] !== r || e[11] !== _ || e[12] !== c ? (h = /* @__PURE__ */ w(y, { className: "scroll-area--auto", mah: S, h: _, ...r, children: [
|
|
66
|
+
c,
|
|
67
|
+
u
|
|
68
|
+
] }), e[9] = S, e[10] = r, e[11] = _, e[12] = c, e[13] = h) : h = e[13], h;
|
|
39
69
|
};
|
|
40
70
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
71
|
+
k as AutoScrollArea,
|
|
72
|
+
y as ScrollArea,
|
|
73
|
+
P as ScrollAreaCorner,
|
|
74
|
+
j as ScrollAreaScrollbar,
|
|
75
|
+
E as ScrollAreaThumb,
|
|
76
|
+
C as ScrollAreaViewport
|
|
46
77
|
};
|
|
@@ -1,51 +1,61 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { c as m } from "../../_virtual/compiler-runtime.js";
|
|
3
3
|
import "../../utils/contextStore.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { mergeComponentProps as
|
|
5
|
+
import { mergeComponentProps as f } from "../../utils/component.js";
|
|
6
6
|
import "js-md5";
|
|
7
|
-
import * as
|
|
7
|
+
import * as s from "@radix-ui/react-tooltip";
|
|
8
8
|
import '../../assets/components/tooltip/Tooltip.style.css';/* empty css */
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return t[2] !== l ? (e = /* @__PURE__ */ r(c.TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ r(c.Tooltip, { ...l }) }), t[2] = l, t[3] = e) : e = t[3], e;
|
|
16
|
-
}, x = (o) => {
|
|
17
|
-
const t = s.c(4);
|
|
18
|
-
let i;
|
|
19
|
-
t[0] !== o ? (i = a("tooltip__trigger", o), t[0] = o, t[1] = i) : i = t[1];
|
|
20
|
-
const l = i;
|
|
21
|
-
let e;
|
|
22
|
-
return t[2] !== l ? (e = /* @__PURE__ */ r(c.TooltipTrigger, { ...l }), t[2] = l, t[3] = e) : e = t[3], e;
|
|
23
|
-
}, P = (o) => {
|
|
24
|
-
const t = s.c(4);
|
|
25
|
-
let i;
|
|
26
|
-
t[0] !== o ? (i = a("tooltip__portal", o), t[0] = o, t[1] = i) : i = t[1];
|
|
27
|
-
const l = i;
|
|
28
|
-
let e;
|
|
29
|
-
return t[2] !== l ? (e = /* @__PURE__ */ r(c.TooltipPortal, { ...l }), t[2] = l, t[3] = e) : e = t[3], e;
|
|
30
|
-
}, p = (o) => {
|
|
31
|
-
const t = s.c(6), i = o.align, l = `tooltip__content tooltip__content--${o.color ?? "tertiary"}`;
|
|
32
|
-
let e;
|
|
33
|
-
t[0] !== o || t[1] !== l ? (e = a(l, o), t[0] = o, t[1] = l, t[2] = e) : e = t[2];
|
|
34
|
-
const n = e;
|
|
35
|
-
let m;
|
|
36
|
-
return t[3] !== o.align || t[4] !== n ? (m = /* @__PURE__ */ r(c.TooltipContent, { align: i, ...n }), t[3] = o.align, t[4] = n, t[5] = m) : m = t[5], m;
|
|
37
|
-
}, y = (o) => {
|
|
38
|
-
const t = s.c(5), i = `tooltip__arrow tooltip__arrow--${o.color ?? "tertiary"}}`;
|
|
9
|
+
import { AutoScrollArea as p } from "../scroll-area/ScrollArea.js";
|
|
10
|
+
const y = (i) => {
|
|
11
|
+
const t = m.c(4);
|
|
12
|
+
let o;
|
|
13
|
+
t[0] !== i ? (o = f("tooltip", i), t[0] = i, t[1] = o) : o = t[1];
|
|
14
|
+
const e = o;
|
|
39
15
|
let l;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
16
|
+
return t[2] !== e ? (l = /* @__PURE__ */ n(s.TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ n(s.Tooltip, { ...e }) }), t[2] = e, t[3] = l) : l = t[3], l;
|
|
17
|
+
}, C = (i) => {
|
|
18
|
+
const t = m.c(4);
|
|
19
|
+
let o;
|
|
20
|
+
t[0] !== i ? (o = f("tooltip__trigger", i), t[0] = i, t[1] = o) : o = t[1];
|
|
21
|
+
const e = o;
|
|
22
|
+
let l;
|
|
23
|
+
return t[2] !== e ? (l = /* @__PURE__ */ n(s.TooltipTrigger, { ...e }), t[2] = e, t[3] = l) : l = t[3], l;
|
|
24
|
+
}, R = (i) => {
|
|
25
|
+
const t = m.c(4);
|
|
26
|
+
let o;
|
|
27
|
+
t[0] !== i ? (o = f("tooltip__portal", i), t[0] = i, t[1] = o) : o = t[1];
|
|
28
|
+
const e = o;
|
|
29
|
+
let l;
|
|
30
|
+
return t[2] !== e ? (l = /* @__PURE__ */ n(s.TooltipPortal, { ...e }), t[2] = e, t[3] = l) : l = t[3], l;
|
|
31
|
+
}, j = (i) => {
|
|
32
|
+
const t = m.c(12);
|
|
33
|
+
let o, e, l, r;
|
|
34
|
+
if (t[0] !== i) {
|
|
35
|
+
const {
|
|
36
|
+
children: _,
|
|
37
|
+
...g
|
|
38
|
+
} = i;
|
|
39
|
+
e = _, o = s.TooltipContent, r = i.align, l = f(`tooltip__content tooltip__content--${i.color ?? "tertiary"}`, g), t[0] = i, t[1] = o, t[2] = e, t[3] = l, t[4] = r;
|
|
40
|
+
} else
|
|
41
|
+
o = t[1], e = t[2], l = t[3], r = t[4];
|
|
42
|
+
const T = l;
|
|
43
|
+
let c;
|
|
44
|
+
t[5] !== e ? (c = /* @__PURE__ */ n(p, { children: e }), t[5] = e, t[6] = c) : c = t[6];
|
|
45
|
+
let a;
|
|
46
|
+
return t[7] !== o || t[8] !== r || t[9] !== T || t[10] !== c ? (a = /* @__PURE__ */ n(o, { align: r, ...T, children: c }), t[7] = o, t[8] = r, t[9] = T, t[10] = c, t[11] = a) : a = t[11], a;
|
|
47
|
+
}, v = (i) => {
|
|
48
|
+
const t = m.c(5), o = `tooltip__arrow tooltip__arrow--${i.color ?? "tertiary"}}`;
|
|
49
|
+
let e;
|
|
50
|
+
t[0] !== i || t[1] !== o ? (e = f(o, i), t[0] = i, t[1] = o, t[2] = e) : e = t[2];
|
|
51
|
+
const l = e;
|
|
52
|
+
let r;
|
|
53
|
+
return t[3] !== l ? (r = /* @__PURE__ */ n(s.TooltipArrow, { ...l }), t[3] = l, t[4] = r) : r = t[4], r;
|
|
44
54
|
};
|
|
45
55
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
y as Tooltip,
|
|
57
|
+
v as TooltipArrow,
|
|
58
|
+
j as TooltipContent,
|
|
59
|
+
R as TooltipPortal,
|
|
60
|
+
C as TooltipTrigger
|
|
51
61
|
};
|