@alxgrn/telefrag-ui 0.0.52 → 0.0.53
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as y, jsx as
|
|
1
|
+
import { jsxs as y, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as k, useState as s, useEffect as H } from "react";
|
|
3
3
|
import R from "../label/Label.js";
|
|
4
4
|
import { Menu as N } from "../../ui/menu/Menu.js";
|
|
@@ -30,26 +30,28 @@ import O from "../../icons/Check.js";
|
|
|
30
30
|
/* empty css */
|
|
31
31
|
/* empty css */
|
|
32
32
|
const xr = ({
|
|
33
|
-
id:
|
|
34
|
-
value:
|
|
33
|
+
id: d,
|
|
34
|
+
value: m,
|
|
35
35
|
step: x = 1,
|
|
36
|
-
onChange:
|
|
36
|
+
onChange: o,
|
|
37
37
|
label: g,
|
|
38
38
|
top: M,
|
|
39
39
|
bottom: b,
|
|
40
40
|
required: $ = !1,
|
|
41
|
-
disabled:
|
|
41
|
+
disabled: p = !1
|
|
42
42
|
}) => {
|
|
43
|
-
const
|
|
43
|
+
const a = k(null), c = k(null), [n, C] = s(""), [l, I] = s(""), [j, w] = s([]), [z, E] = s([]), [S, u] = s(!1), [T, f] = s(!1);
|
|
44
44
|
H(() => {
|
|
45
|
-
let [r, t] =
|
|
46
|
-
r = parseInt(r), t = parseInt(t), (isNaN(r) || r < 0 || r > 23) && (r = 0), (isNaN(t) || t < 0 || t > 59) && (t = 0), r = `0${r}`.slice(-2), t = `0${t}`.slice(-2), C(r), I(t)
|
|
47
|
-
|
|
45
|
+
let [r, t] = m.split(":");
|
|
46
|
+
r = parseInt(r), t = parseInt(t), (isNaN(r) || r < 0 || r > 23) && (r = 0), (isNaN(t) || t < 0 || t > 59) && (t = 0), r = `0${r}`.slice(-2), t = `0${t}`.slice(-2), C(r), I(t);
|
|
47
|
+
const i = `${r}:${t}`;
|
|
48
|
+
i !== m && o && o(i);
|
|
49
|
+
}, [m, o]), H(() => {
|
|
48
50
|
const r = [], t = [];
|
|
49
|
-
for (let
|
|
50
|
-
r.push(`0${
|
|
51
|
-
for (let
|
|
52
|
-
t.push(`0${
|
|
51
|
+
for (let i = 0; i < 24; i++)
|
|
52
|
+
r.push(`0${i}`.slice(-2));
|
|
53
|
+
for (let i = 0; i < 60; i += x)
|
|
54
|
+
t.push(`0${i}`.slice(-2));
|
|
53
55
|
w(r), E(t);
|
|
54
56
|
}, [x]);
|
|
55
57
|
const h = () => !!($ && (!n || !l)), v = () => {
|
|
@@ -59,74 +61,74 @@ const xr = ({
|
|
|
59
61
|
backgroundColor: "var(--alxgrn-input-bg-error)"
|
|
60
62
|
};
|
|
61
63
|
}, F = (r) => {
|
|
62
|
-
|
|
64
|
+
u(!1), o && o(`${r.text ?? ""}:${l}`);
|
|
63
65
|
}, L = (r) => {
|
|
64
|
-
|
|
66
|
+
f(!1), o && o(`${n}:${r.text ?? ""}`);
|
|
65
67
|
};
|
|
66
68
|
return /* @__PURE__ */ y("div", { className: "FormItem", children: [
|
|
67
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ e(
|
|
68
70
|
R,
|
|
69
71
|
{
|
|
70
72
|
top: M,
|
|
71
73
|
bottom: b,
|
|
72
74
|
label: g,
|
|
73
75
|
required: $,
|
|
74
|
-
disabled:
|
|
76
|
+
disabled: p,
|
|
75
77
|
error: h(),
|
|
76
78
|
children: /* @__PURE__ */ y("div", { className: "Time", children: [
|
|
77
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ e(
|
|
78
80
|
"input",
|
|
79
81
|
{
|
|
80
|
-
id: `${
|
|
81
|
-
ref:
|
|
82
|
+
id: `${d}-hor`,
|
|
83
|
+
ref: a,
|
|
82
84
|
type: "text",
|
|
83
85
|
value: n,
|
|
84
86
|
style: v(),
|
|
85
|
-
disabled: !!
|
|
86
|
-
onClick: () =>
|
|
87
|
+
disabled: !!p,
|
|
88
|
+
onClick: () => u(!0),
|
|
87
89
|
readOnly: !0
|
|
88
90
|
}
|
|
89
91
|
),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ e("div", { children: ":" }),
|
|
93
|
+
/* @__PURE__ */ e(
|
|
92
94
|
"input",
|
|
93
95
|
{
|
|
94
|
-
id: `${
|
|
95
|
-
ref:
|
|
96
|
+
id: `${d}-min`,
|
|
97
|
+
ref: c,
|
|
96
98
|
type: "text",
|
|
97
99
|
value: l,
|
|
98
100
|
style: v(),
|
|
99
|
-
disabled: !!
|
|
100
|
-
onClick: () =>
|
|
101
|
+
disabled: !!p,
|
|
102
|
+
onClick: () => f(!0),
|
|
101
103
|
readOnly: !0
|
|
102
104
|
}
|
|
103
105
|
)
|
|
104
106
|
] })
|
|
105
107
|
}
|
|
106
108
|
),
|
|
107
|
-
|
|
109
|
+
a.current && /* @__PURE__ */ e(
|
|
108
110
|
N,
|
|
109
111
|
{
|
|
110
|
-
parent:
|
|
112
|
+
parent: a.current,
|
|
111
113
|
isOpen: S,
|
|
112
|
-
onClose: () =>
|
|
114
|
+
onClose: () => u(!1),
|
|
113
115
|
horizontal: "inner-left",
|
|
114
116
|
margin: "var(--alxgrn-unit-small)",
|
|
115
|
-
items: j.map((r) => ({ id: r, text: r, icon: r === n ? /* @__PURE__ */
|
|
117
|
+
items: j.map((r) => ({ id: r, text: r, icon: r === n ? /* @__PURE__ */ e(O, {}) : /* @__PURE__ */ e("div", { className: "empty" }) })),
|
|
116
118
|
onClick: F,
|
|
117
119
|
maxHeight: "auto",
|
|
118
120
|
width: "auto"
|
|
119
121
|
}
|
|
120
122
|
),
|
|
121
|
-
|
|
123
|
+
c.current && /* @__PURE__ */ e(
|
|
122
124
|
N,
|
|
123
125
|
{
|
|
124
|
-
parent:
|
|
126
|
+
parent: c.current,
|
|
125
127
|
isOpen: T,
|
|
126
|
-
onClose: () =>
|
|
128
|
+
onClose: () => f(!1),
|
|
127
129
|
horizontal: "inner-right",
|
|
128
130
|
margin: "var(--alxgrn-unit-small)",
|
|
129
|
-
items: z.map((r) => ({ id: r, text: r, icon: r === l ? /* @__PURE__ */
|
|
131
|
+
items: z.map((r) => ({ id: r, text: r, icon: r === l ? /* @__PURE__ */ e(O, {}) : /* @__PURE__ */ e("div", { className: "empty" }) })),
|
|
130
132
|
onClick: L,
|
|
131
133
|
maxHeight: "auto",
|
|
132
134
|
width: "auto"
|
package/package.json
CHANGED