@code0-tech/pictor 0.16.0 → 0.17.0
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/alert/Alert.style.css +1 -1
- package/dist/assets/components/avatar/Avatar.style.css +1 -1
- package/dist/assets/components/badge/Badge.style.css +1 -1
- package/dist/assets/components/breadcrumb/Breadcrumb.style.css +1 -1
- package/dist/assets/components/button/Button.style.css +1 -1
- package/dist/assets/components/button-group/ButtonGroup.style.css +1 -1
- package/dist/assets/components/card/Card.style.css +1 -1
- package/dist/assets/components/chart/Chart.style.css +1 -1
- package/dist/assets/components/command/Command.style.css +1 -1
- package/dist/assets/components/context-menu/ContextMenu.style.css +1 -1
- package/dist/assets/components/data-table/DataTable.style.css +1 -1
- package/dist/assets/components/dialog/Dialog.style.css +1 -1
- package/dist/assets/components/editor/Editor.styles.css +1 -1
- package/dist/assets/components/file-tabs/FileTabs.style.css +1 -1
- package/dist/assets/components/form/ColorInput.style.css +1 -1
- package/dist/assets/components/form/DateInput.style.css +1 -1
- package/dist/assets/components/form/EditorInput.style.css +1 -1
- package/dist/assets/components/form/Input.style.css +1 -1
- package/dist/assets/components/form/InputWrapper.style.css +1 -1
- package/dist/assets/components/form/SelectInput.style.css +1 -1
- package/dist/assets/components/json-view/JsonView.style.css +1 -1
- package/dist/assets/components/menu/Menu.style.css +1 -1
- package/dist/assets/components/resizable/Resizable.style.css +1 -1
- package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -1
- package/dist/assets/components/spacing/Spacing.style.css +1 -1
- package/dist/assets/components/tab/Tab.style.css +1 -1
- package/dist/assets/components/text/Text.style.css +1 -1
- package/dist/assets/components/toast/Toast.style.css +1 -1
- package/dist/assets/components/tooltip/Tooltip.style.css +1 -1
- package/dist/components/command/Command.js +35 -38
- package/dist/components/form/DateInput.js +82 -86
- package/dist/components/form/EditorInput.d.ts +26 -10
- package/dist/components/form/EditorInput.js +520 -148
- package/dist/components/form/EmailInput.js +16 -15
- package/dist/components/form/Input.d.ts +0 -20
- package/dist/components/form/Input.js +47 -432
- package/dist/components/form/InputWrapper.d.ts +0 -1
- package/dist/components/form/InputWrapper.js +52 -48
- package/dist/components/form/NumberInput.js +17 -16
- package/dist/components/form/PasswordInput.js +23 -22
- package/dist/components/form/TagInput.d.ts +30 -0
- package/dist/components/form/TagInput.js +117 -0
- package/dist/components/form/TextInput.js +12 -11
- package/dist/components/form/index.d.ts +1 -2
- package/dist/components/form/index.js +77 -70
- package/dist/components/layout/Layout.js +37 -37
- package/dist/components/menu/Menu.d.ts +2 -2
- package/dist/components/menu/Menu.js +87 -87
- package/dist/components/scroll-area/ScrollArea.js +1 -1
- package/dist/index.js +220 -213
- package/dist/utils/index.js +11 -11
- package/dist/utils/size.d.ts +3 -3
- package/dist/utils/size.js +12 -6
- package/package.json +1 -1
- package/dist/components/form/Input.syntax.hook.d.ts +0 -10
- package/dist/components/form/Input.syntax.hook.js +0 -14
- package/dist/components/form/InputContentEditable.hook.d.ts +0 -52
- package/dist/components/form/InputContentEditable.hook.js +0 -449
- package/dist/components/form/InputSuggestion.d.ts +0 -27
- package/dist/components/form/InputSuggestion.js +0 -218
|
@@ -1,62 +1,66 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsxs as E, jsx as a, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { c as N } from "../../_virtual/compiler-runtime.js";
|
|
3
3
|
import "../../utils/contextStore.js";
|
|
4
|
-
import
|
|
5
|
-
import { mergeComponentProps as
|
|
4
|
+
import g from "react";
|
|
5
|
+
import { mergeComponentProps as P } from "../../utils/component.js";
|
|
6
6
|
import "js-md5";
|
|
7
|
-
import { InputMessage as
|
|
8
|
-
import { InputLabel as
|
|
9
|
-
import { InputDescription as
|
|
7
|
+
import { InputMessage as k } from "./InputMessage.js";
|
|
8
|
+
import { InputLabel as C } from "./InputLabel.js";
|
|
9
|
+
import { InputDescription as D } from "./InputDescription.js";
|
|
10
10
|
import '../../assets/components/form/InputWrapper.style.css';/* empty css */
|
|
11
|
-
const
|
|
12
|
-
const e =
|
|
13
|
-
children:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} =
|
|
23
|
-
let
|
|
24
|
-
e[0] !==
|
|
25
|
-
const V = g, x = M === void 0 ? "icon" : M, y = T === void 0 ? "action" : T;
|
|
26
|
-
let v;
|
|
27
|
-
e[2] !== h ? (v = h === void 0 ? {
|
|
11
|
+
const S = g.forwardRef((F, W) => {
|
|
12
|
+
const e = N.c(22), {
|
|
13
|
+
children: v,
|
|
14
|
+
left: s,
|
|
15
|
+
right: p,
|
|
16
|
+
leftType: $,
|
|
17
|
+
rightType: x,
|
|
18
|
+
title: d,
|
|
19
|
+
description: c,
|
|
20
|
+
formValidation: m,
|
|
21
|
+
...f
|
|
22
|
+
} = F, b = $ === void 0 ? "icon" : $, _ = x === void 0 ? "action" : x;
|
|
23
|
+
let u;
|
|
24
|
+
e[0] !== m ? (u = m === void 0 ? {
|
|
28
25
|
valid: !0,
|
|
29
26
|
notValidMessage: null,
|
|
30
27
|
setValue: null
|
|
31
|
-
} :
|
|
32
|
-
const t =
|
|
28
|
+
} : m, e[0] = m, e[1] = u) : u = e[1];
|
|
29
|
+
const t = u, R = g.useId(), I = f.id ?? R, M = `${I}-label`, T = d ? void 0 : f["aria-label"] ?? f.placeholder, j = {
|
|
30
|
+
id: I,
|
|
31
|
+
...d ? {
|
|
32
|
+
"aria-labelledby": M
|
|
33
|
+
} : {},
|
|
34
|
+
...T ? {
|
|
35
|
+
"aria-label": T
|
|
36
|
+
} : {}
|
|
37
|
+
}, V = d && /* @__PURE__ */ a(C, { htmlFor: I, id: M, children: d });
|
|
33
38
|
let i;
|
|
34
|
-
e[
|
|
35
|
-
|
|
36
|
-
e[6] !== u ? (r = u && /* @__PURE__ */ a(F, { children: u }), e[6] = u, e[7] = r) : r = e[7];
|
|
37
|
-
const I = `input-wrapper ${t?.valid ? "" : "input-wrapper--not-valid"}`;
|
|
39
|
+
e[2] !== c ? (i = c && /* @__PURE__ */ a(D, { children: c }), e[2] = c, e[3] = i) : i = e[3];
|
|
40
|
+
const w = P(`input-wrapper ${t?.valid ? "" : "input-wrapper--not-valid"}`, f);
|
|
38
41
|
let l;
|
|
39
|
-
e[
|
|
42
|
+
e[4] !== s || e[5] !== b ? (l = s && /* @__PURE__ */ a("div", { className: `input-wrapper__left input__left--${b}`, children: s }), e[4] = s, e[5] = b, e[6] = l) : l = e[6];
|
|
43
|
+
const y = g.isValidElement(v) ? g.cloneElement(v, {
|
|
44
|
+
...j
|
|
45
|
+
}) : v;
|
|
46
|
+
let r;
|
|
47
|
+
e[7] !== p || e[8] !== _ ? (r = p && /* @__PURE__ */ a("div", { className: `input-wrapper__right input-wrapper__right--${_}`, children: p }), e[7] = p, e[8] = _, e[9] = r) : r = e[9];
|
|
40
48
|
let o;
|
|
41
|
-
e[11] !==
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
e[10] !== w || e[11] !== l || e[12] !== y || e[13] !== r ? (o = /* @__PURE__ */ E("div", { ...w, children: [
|
|
50
|
+
l,
|
|
51
|
+
y,
|
|
52
|
+
r
|
|
53
|
+
] }), e[10] = w, e[11] = l, e[12] = y, e[13] = r, e[14] = o) : o = e[14];
|
|
44
54
|
let n;
|
|
45
|
-
e[
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
] }), e[17] = w, e[18] = o, e[19] = p, e[20] = l, e[21] = n) : n = e[21];
|
|
50
|
-
let s;
|
|
51
|
-
e[22] !== t ? (s = !t?.valid && t?.notValidMessage && /* @__PURE__ */ a(D, { children: t.notValidMessage }), e[22] = t, e[23] = s) : s = e[23];
|
|
52
|
-
let _;
|
|
53
|
-
return e[24] !== n || e[25] !== s || e[26] !== i || e[27] !== r ? (_ = /* @__PURE__ */ $(R, { children: [
|
|
55
|
+
e[15] !== t ? (n = !t?.valid && t?.notValidMessage && /* @__PURE__ */ a(k, { children: t.notValidMessage }), e[15] = t, e[16] = n) : n = e[16];
|
|
56
|
+
let h;
|
|
57
|
+
return e[17] !== o || e[18] !== n || e[19] !== V || e[20] !== i ? (h = /* @__PURE__ */ E(L, { children: [
|
|
58
|
+
V,
|
|
54
59
|
i,
|
|
55
|
-
|
|
56
|
-
n
|
|
57
|
-
|
|
58
|
-
] }), e[24] = n, e[25] = s, e[26] = i, e[27] = r, e[28] = _) : _ = e[28], _;
|
|
60
|
+
o,
|
|
61
|
+
n
|
|
62
|
+
] }), e[17] = o, e[18] = n, e[19] = V, e[20] = i, e[21] = h) : h = e[21], h;
|
|
59
63
|
});
|
|
60
64
|
export {
|
|
61
|
-
|
|
65
|
+
S as InputWrapper
|
|
62
66
|
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Input as
|
|
4
|
-
import { IconMinus as a, IconPlus as
|
|
5
|
-
import { Button as
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import o from "react";
|
|
3
|
+
import { Input as l } from "./Input.js";
|
|
4
|
+
import { IconMinus as a, IconPlus as p } from "@tabler/icons-react";
|
|
5
|
+
import { Button as u } from "../button/Button.js";
|
|
6
|
+
import { ButtonGroup as e } from "../button-group/ButtonGroup.js";
|
|
7
|
+
const g = o.forwardRef((c, r) => {
|
|
8
|
+
r = r || o.useRef(null);
|
|
8
9
|
const {
|
|
9
|
-
step:
|
|
10
|
-
...
|
|
11
|
-
} =
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
|
|
14
|
-
}, children: /* @__PURE__ */
|
|
15
|
-
|
|
16
|
-
}, children: /* @__PURE__ */
|
|
10
|
+
step: n = 1,
|
|
11
|
+
...i
|
|
12
|
+
} = c;
|
|
13
|
+
return /* @__PURE__ */ t(l, { className: "number-input", right: /* @__PURE__ */ t(e, { color: "primary", children: /* @__PURE__ */ t(u, { color: "secondary", paddingSize: "xxs", onClick: () => {
|
|
14
|
+
r.current && (r.current.value || (r.current.value = "0"), r.current.value = (Number.parseInt(r.current.value) + n).toString());
|
|
15
|
+
}, children: /* @__PURE__ */ t(p, { size: 13 }) }) }), left: /* @__PURE__ */ t(e, { color: "primary", children: /* @__PURE__ */ t(u, { color: "secondary", paddingSize: "xxs", onClick: () => {
|
|
16
|
+
r.current && (r.current.value || (r.current.value = "0"), r.current.value = (Number.parseInt(r.current.value) - n).toString());
|
|
17
|
+
}, children: /* @__PURE__ */ t(a, { size: 13 }) }) }), leftType: "action", type: "number", ref: r, ...i });
|
|
17
18
|
});
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
g as NumberInput
|
|
20
21
|
};
|
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import { jsxs as l, Fragment as
|
|
1
|
+
import { jsxs as l, Fragment as w, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import c from "react";
|
|
3
3
|
import { Input as b } from "./Input.js";
|
|
4
4
|
import { IconEye as I, IconX as R } from "@tabler/icons-react";
|
|
5
5
|
import { Button as u } from "../button/Button.js";
|
|
6
|
-
import { clearInputElement as
|
|
7
|
-
import { Flex as
|
|
6
|
+
import { clearInputElement as z } from "./Input.utils.js";
|
|
7
|
+
import { Flex as P } from "../flex/Flex.js";
|
|
8
8
|
import { Progress as D } from "../progress/Progress.js";
|
|
9
9
|
import { InputMessage as A } from "./InputMessage.js";
|
|
10
|
-
|
|
10
|
+
import { ButtonGroup as B } from "../button-group/ButtonGroup.js";
|
|
11
|
+
const X = c.forwardRef((r, t) => {
|
|
11
12
|
t = t || c.useRef(null);
|
|
12
13
|
const {
|
|
13
14
|
clearable: p = !0,
|
|
14
15
|
visible: d = !0,
|
|
15
16
|
right: m,
|
|
16
|
-
formValidation:
|
|
17
|
+
formValidation: o,
|
|
17
18
|
...f
|
|
18
|
-
} = r,
|
|
19
|
-
d &&
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */ l(
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
formValidation:
|
|
24
|
-
setValue:
|
|
25
|
-
valid:
|
|
26
|
-
} :
|
|
19
|
+
} = r, g = (e) => (z(t.current), e.stopPropagation(), e.preventDefault(), !1), h = (e) => (t.current instanceof HTMLInputElement && (t.current.type === "password" ? t.current.type = "text" : t.current.type === "text" && (t.current.type = "password")), e.stopPropagation(), e.preventDefault(), !1), n = [m];
|
|
20
|
+
d && n.push(/* @__PURE__ */ s(u, { color: "secondary", paddingSize: "xxs", onClick: (e) => h(e), children: /* @__PURE__ */ s(I, { size: 13 }) })), p && n.push(/* @__PURE__ */ s(u, { color: "secondary", paddingSize: "xxs", onClick: (e) => g(e), children: /* @__PURE__ */ s(R, { size: 13 }) }));
|
|
21
|
+
const i = o?.notValidMessage ?? "", a = /^[1-5]+$/.test(i), x = i.length, y = Math.max(0, 5 - x) / 5 * 100;
|
|
22
|
+
return /* @__PURE__ */ l(w, { children: [
|
|
23
|
+
/* @__PURE__ */ s(b, { right: /* @__PURE__ */ s(B, { color: "primary", children: n }), rightType: "action", type: "password", ref: t, ...o ? {
|
|
24
|
+
formValidation: a ? {
|
|
25
|
+
setValue: o.setValue,
|
|
26
|
+
valid: o.valid
|
|
27
|
+
} : o
|
|
27
28
|
} : {}, ...f }),
|
|
28
|
-
|
|
29
|
+
a && !o?.valid && /* @__PURE__ */ l(P, { mt: 0.7, style: {
|
|
29
30
|
flexDirection: "column"
|
|
30
31
|
}, children: [
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ s(D, { value: y, max: 100, color: "linear-gradient(to right, #D90429 0%, #29BF12 100%)" }),
|
|
32
33
|
(() => {
|
|
33
|
-
const e = ["2", "3", "4", "5", "1"].find((
|
|
34
|
+
const e = ["2", "3", "4", "5", "1"].find((V) => i.includes(V));
|
|
34
35
|
if (!e) return null;
|
|
35
|
-
const
|
|
36
|
+
const M = {
|
|
36
37
|
1: "Must be at least 8 characters",
|
|
37
38
|
2: "Must include a lowercase letter",
|
|
38
39
|
3: "Must include an uppercase letter",
|
|
39
40
|
4: "Must include a number",
|
|
40
41
|
5: "Must include a special character"
|
|
41
42
|
}[e];
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ s(A, { children: M });
|
|
43
44
|
})()
|
|
44
45
|
] })
|
|
45
46
|
] });
|
|
46
|
-
}),
|
|
47
|
+
}), _ = (r) => {
|
|
47
48
|
if (!r) return "12345";
|
|
48
49
|
let t = null;
|
|
49
50
|
return r.length < 8 && (t = (t ?? "") + "1"), /[a-z]/.test(r) || (t = (t ?? "") + "2"), /[A-Z]/.test(r) || (t = (t ?? "") + "3"), /[0-9]/.test(r) || (t = (t ?? "") + "4"), /[^A-Za-z0-9]/.test(r) || (t = (t ?? "") + "5"), t;
|
|
50
51
|
};
|
|
51
52
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
X as PasswordInput,
|
|
54
|
+
_ as passwordValidation
|
|
54
55
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { EditorInputMenuProps, EditorInputSubMenuProps, EditorInputTriggerProps, EditorInputValueProps, EditorInputMenuItemProps } from './EditorInput';
|
|
3
|
+
import { InputWrapperProps } from './InputWrapper';
|
|
4
|
+
import { ValidationProps } from './useForm';
|
|
5
|
+
export interface TagValue {
|
|
6
|
+
value: any;
|
|
7
|
+
valueData?: any;
|
|
8
|
+
}
|
|
9
|
+
export interface TagSuggestion {
|
|
10
|
+
value: any;
|
|
11
|
+
valueData?: any;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface TagInputProps extends Omit<InputWrapperProps, "onChange">, ValidationProps<any> {
|
|
15
|
+
allowCustomValues?: boolean;
|
|
16
|
+
onChange?: (tags: TagValue[]) => void;
|
|
17
|
+
tagColor?: string;
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export type TagInputTriggerProps = EditorInputTriggerProps;
|
|
21
|
+
export type TagInputSubMenuProps = EditorInputSubMenuProps;
|
|
22
|
+
export type TagInputMenuProps = EditorInputMenuProps;
|
|
23
|
+
export type TagInputMenuItemProps = EditorInputMenuItemProps;
|
|
24
|
+
export type TagInputValueProps = EditorInputValueProps;
|
|
25
|
+
export declare const TagInput: React.FC<TagInputProps>;
|
|
26
|
+
export declare const TagInputMenu: React.FC<TagInputMenuProps>;
|
|
27
|
+
export declare const TagInputSubMenu: React.FC<TagInputSubMenuProps>;
|
|
28
|
+
export declare const TagInputMenuItem: React.FC<TagInputMenuItemProps>;
|
|
29
|
+
export declare const TagInputValue: React.FC<TagInputValueProps>;
|
|
30
|
+
export declare const TagInputTrigger: React.FC<TagInputTriggerProps>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx as l, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { c as I } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import K, { useState as N, useRef as V, useReducer as j, useCallback as A, useEffect as _, useMemo as B, useContext as F } from "react";
|
|
4
|
+
import { EditorInput as L, EditorInputMenu as U, EditorInputMenuItem as q, EditorInputSubMenu as z, EditorInputTrigger as G, EditorInputValue as H } from "./EditorInput.js";
|
|
5
|
+
import { Badge as J } from "../badge/Badge.js";
|
|
6
|
+
import { Text as Q } from "../text/Text.js";
|
|
7
|
+
const h = "⟦", d = "⟧", k = new RegExp(`${h}([^${d}]+)${d}`, "g"), W = new RegExp(`(${h}[^${d}]+${d})|([^${h}${d}]+)`, "g"), w = (e) => `${h}${String(e)}${d}`, X = (e) => e.slice(h.length, -d.length), R = (e) => e.map((t) => w(t.value)).join(""), Y = (e) => e.replace(k, "").trim(), Z = (e, t) => {
|
|
8
|
+
let n = !1;
|
|
9
|
+
const r = e.replace(W, (s, o, c) => o || (!n && c.trim() ? (n = !0, t) : ""));
|
|
10
|
+
return n ? r : r + t;
|
|
11
|
+
}, v = K.createContext(null), y = () => {
|
|
12
|
+
const e = F(v);
|
|
13
|
+
if (!e)
|
|
14
|
+
throw new Error("TagInput.* components must be used inside <TagInput>");
|
|
15
|
+
return e;
|
|
16
|
+
}, ct = (e) => {
|
|
17
|
+
const {
|
|
18
|
+
allowCustomValues: t = !1,
|
|
19
|
+
onChange: n,
|
|
20
|
+
formValidation: r,
|
|
21
|
+
tagColor: s = "primary",
|
|
22
|
+
value: o,
|
|
23
|
+
initialValue: c,
|
|
24
|
+
defaultValue: f,
|
|
25
|
+
children: p,
|
|
26
|
+
...g
|
|
27
|
+
} = e, u = o ?? c ?? f, [i, M] = N(() => R(u ?? [])), E = V(/* @__PURE__ */ new Map()), [, D] = j((a) => a + 1, 0), O = A((a, m) => {
|
|
28
|
+
E.current.set(a, m), D();
|
|
29
|
+
}, []), $ = V(u), S = (a) => {
|
|
30
|
+
const m = [...a.matchAll(k)].map(([, T]) => {
|
|
31
|
+
const C = E.current.get(T);
|
|
32
|
+
return {
|
|
33
|
+
value: C ? C.value : T,
|
|
34
|
+
valueData: C?.data
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
$.current = m, M(a), r?.setValue?.(m), n?.(m);
|
|
38
|
+
};
|
|
39
|
+
_(() => {
|
|
40
|
+
u !== $.current && ($.current = u, M(R(u ?? [])));
|
|
41
|
+
}, [u]);
|
|
42
|
+
const P = B(() => [{
|
|
43
|
+
pattern: k,
|
|
44
|
+
void: !0,
|
|
45
|
+
wrap: (a) => {
|
|
46
|
+
const m = X(a), T = E.current.get(m);
|
|
47
|
+
return T ? /* @__PURE__ */ l(b, { children: T.children }) : /* @__PURE__ */ l(J, { m: 0.01, color: s, children: /* @__PURE__ */ l(Q, { children: m }) });
|
|
48
|
+
}
|
|
49
|
+
}], [s]), x = {
|
|
50
|
+
search: Y(i),
|
|
51
|
+
allowCustomValues: t,
|
|
52
|
+
insertToken: (a) => S(Z(i, a)),
|
|
53
|
+
registerTag: O
|
|
54
|
+
};
|
|
55
|
+
return /* @__PURE__ */ l(v.Provider, { value: x, children: /* @__PURE__ */ l(L, { ...g, value: i, search: x.search, tokenRules: P, formValidation: r && {
|
|
56
|
+
valid: r.valid,
|
|
57
|
+
notValidMessage: r.notValidMessage
|
|
58
|
+
}, onChange: S, onSelect: (a) => x.insertToken(String(a)), children: p }) });
|
|
59
|
+
}, at = (e) => {
|
|
60
|
+
const t = I.c(2);
|
|
61
|
+
let n;
|
|
62
|
+
return t[0] !== e ? (n = /* @__PURE__ */ l(U, { ...e }), t[0] = e, t[1] = n) : n = t[1], n;
|
|
63
|
+
}, ut = (e) => {
|
|
64
|
+
const t = I.c(2);
|
|
65
|
+
let n;
|
|
66
|
+
return t[0] !== e ? (n = /* @__PURE__ */ l(z, { ...e }), t[0] = e, t[1] = n) : n = t[1], n;
|
|
67
|
+
}, it = ({
|
|
68
|
+
value: e,
|
|
69
|
+
data: t,
|
|
70
|
+
onlyOnce: n,
|
|
71
|
+
aliases: r,
|
|
72
|
+
children: s
|
|
73
|
+
}) => {
|
|
74
|
+
const {
|
|
75
|
+
registerTag: o
|
|
76
|
+
} = y(), c = V({
|
|
77
|
+
value: e,
|
|
78
|
+
data: t,
|
|
79
|
+
children: s
|
|
80
|
+
});
|
|
81
|
+
return c.current.value = e, c.current.data = t, c.current.children = s, _(() => o(String(e), c.current), [e, o]), /* @__PURE__ */ l(q, { value: w(e), data: t, onlyOnce: n, aliases: [String(e), ...r ?? []], children: s });
|
|
82
|
+
}, lt = (e) => {
|
|
83
|
+
const t = I.c(14);
|
|
84
|
+
let n, r;
|
|
85
|
+
t[0] !== e ? ({
|
|
86
|
+
onKeyDown: n,
|
|
87
|
+
...r
|
|
88
|
+
} = e, t[0] = e, t[1] = n, t[2] = r) : (n = t[1], r = t[2]);
|
|
89
|
+
const {
|
|
90
|
+
search: s,
|
|
91
|
+
allowCustomValues: o,
|
|
92
|
+
insertToken: c
|
|
93
|
+
} = y();
|
|
94
|
+
let f;
|
|
95
|
+
t[3] !== o || t[4] !== c || t[5] !== s ? (f = () => {
|
|
96
|
+
o && s && c(w(s));
|
|
97
|
+
}, t[3] = o, t[4] = c, t[5] = s, t[6] = f) : f = t[6];
|
|
98
|
+
const p = f;
|
|
99
|
+
let g;
|
|
100
|
+
t[7] !== o || t[8] !== p || t[9] !== n ? (g = (i) => {
|
|
101
|
+
(i.key === "Enter" && !i.defaultPrevented || i.key === "," && o) && (i.preventDefault(), p()), n?.(i);
|
|
102
|
+
}, t[7] = o, t[8] = p, t[9] = n, t[10] = g) : g = t[10];
|
|
103
|
+
let u;
|
|
104
|
+
return t[11] !== r || t[12] !== g ? (u = /* @__PURE__ */ l(H, { ...r, onKeyDown: g }), t[11] = r, t[12] = g, t[13] = u) : u = t[13], u;
|
|
105
|
+
}, gt = (e) => {
|
|
106
|
+
const t = I.c(2);
|
|
107
|
+
let n;
|
|
108
|
+
return t[0] !== e ? (n = /* @__PURE__ */ l(G, { ...e }), t[0] = e, t[1] = n) : n = t[1], n;
|
|
109
|
+
};
|
|
110
|
+
export {
|
|
111
|
+
ct as TagInput,
|
|
112
|
+
at as TagInputMenu,
|
|
113
|
+
it as TagInputMenuItem,
|
|
114
|
+
ut as TagInputSubMenu,
|
|
115
|
+
gt as TagInputTrigger,
|
|
116
|
+
lt as TagInputValue
|
|
117
|
+
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import i from "react";
|
|
3
|
-
import { Input as
|
|
4
|
-
import { IconX as
|
|
5
|
-
import { Button as
|
|
3
|
+
import { Input as p } from "./Input.js";
|
|
4
|
+
import { IconX as u } from "@tabler/icons-react";
|
|
5
|
+
import { Button as f } from "../button/Button.js";
|
|
6
6
|
import { clearInputElement as s } from "./Input.utils.js";
|
|
7
|
-
|
|
7
|
+
import { ButtonGroup as d } from "../button-group/ButtonGroup.js";
|
|
8
|
+
const b = i.forwardRef((o, t) => {
|
|
8
9
|
t = t || i.useRef(null);
|
|
9
10
|
const {
|
|
10
11
|
clearable: l = !1,
|
|
11
|
-
right:
|
|
12
|
+
right: c,
|
|
12
13
|
...m
|
|
13
|
-
} =
|
|
14
|
-
s(t.current),
|
|
15
|
-
}, n = [
|
|
16
|
-
return l && n.push(/* @__PURE__ */
|
|
14
|
+
} = o, a = (e) => {
|
|
15
|
+
s(t.current), o.onClear && o.onClear(e);
|
|
16
|
+
}, n = [c];
|
|
17
|
+
return l && n.push(/* @__PURE__ */ r(f, { color: "secondary", paddingSize: "xxs", onClick: (e) => a(e), children: /* @__PURE__ */ r(u, { size: 13 }) })), /* @__PURE__ */ r(p, { right: /* @__PURE__ */ r(d, { color: "primary", children: n }), type: "text", ref: t, ...m });
|
|
17
18
|
});
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
b as TextInput
|
|
20
21
|
};
|
|
@@ -8,7 +8,6 @@ export * from './Input';
|
|
|
8
8
|
export * from './InputDescription';
|
|
9
9
|
export * from './InputLabel';
|
|
10
10
|
export * from './InputMessage';
|
|
11
|
-
export * from './InputSuggestion';
|
|
12
11
|
export * from './NumberInput';
|
|
13
12
|
export * from './PasswordInput';
|
|
14
13
|
export * from './PinInput';
|
|
@@ -16,7 +15,7 @@ export * from './RadioGroup';
|
|
|
16
15
|
export * from './RadioInput';
|
|
17
16
|
export * from './SelectInput';
|
|
18
17
|
export * from './SwitchInput';
|
|
18
|
+
export * from './TagInput';
|
|
19
19
|
export * from './TextAreaInput';
|
|
20
20
|
export * from './TextInput';
|
|
21
21
|
export * from './useForm';
|
|
22
|
-
export * from './Input.syntax.hook';
|
|
@@ -1,80 +1,87 @@
|
|
|
1
|
-
import { CheckboxInput as
|
|
1
|
+
import { CheckboxInput as r } from "./CheckboxInput.js";
|
|
2
2
|
import { ColorInput as p, ColorInputContent as n, ColorInputControl as u, ColorInputSwatch as I, ColorInputTrigger as i, ColorInputValueText as l } from "./ColorInput.js";
|
|
3
|
-
import { DateInput as
|
|
4
|
-
import { EditorInput as c } from "./EditorInput.js";
|
|
5
|
-
import { EmailInput as
|
|
6
|
-
import { FileInput as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { InputDescription as
|
|
9
|
-
import { InputLabel as
|
|
10
|
-
import { InputMessage as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { TextAreaInput as
|
|
20
|
-
import { TextInput as
|
|
21
|
-
import { useForm as
|
|
22
|
-
import { buildDefaultSyntax as wt } from "./Input.syntax.hook.js";
|
|
3
|
+
import { DateInput as a, DateInputContent as x, DateInputControl as g, DateInputField as f, DateInputNextTrigger as T, DateInputPrevTrigger as d, DateInputTrigger as F } from "./DateInput.js";
|
|
4
|
+
import { EditorInput as S, EditorInputMenu as c, EditorInputMenuItem as D, EditorInputSubMenu as s, EditorInputTrigger as P, EditorInputValue as w } from "./EditorInput.js";
|
|
5
|
+
import { EmailInput as M, emailValidation as V } from "./EmailInput.js";
|
|
6
|
+
import { FileInput as h, FileInputContext as v, FileInputDropzone as N, FileInputHiddenInput as z, FileInputItem as G, FileInputItemDeleteTrigger as H, FileInputItemGroup as R, FileInputItemName as k, FileInputItemPreview as A, FileInputItemPreviewImage as L, FileInputItemSizeText as j, FileInputTrigger as q } from "./FileInput.js";
|
|
7
|
+
import { Input as B } from "./Input.js";
|
|
8
|
+
import { InputDescription as K } from "./InputDescription.js";
|
|
9
|
+
import { InputLabel as Q } from "./InputLabel.js";
|
|
10
|
+
import { InputMessage as W } from "./InputMessage.js";
|
|
11
|
+
import { NumberInput as Y } from "./NumberInput.js";
|
|
12
|
+
import { PasswordInput as _, passwordValidation as $ } from "./PasswordInput.js";
|
|
13
|
+
import { PinInput as et, PinInputField as rt, PinInputHiddenField as ot } from "./PinInput.js";
|
|
14
|
+
import { RadioGroup as nt } from "./RadioGroup.js";
|
|
15
|
+
import { RadioInput as It } from "./RadioInput.js";
|
|
16
|
+
import { SelectContent as lt, SelectInput as mt, SelectItem as at, SelectItemText as xt, SelectPortal as gt, SelectTrigger as ft, SelectValue as Tt, SelectViewport as dt } from "./SelectInput.js";
|
|
17
|
+
import { SwitchInput as Ct } from "./SwitchInput.js";
|
|
18
|
+
import { TagInput as ct, TagInputMenu as Dt, TagInputMenuItem as st, TagInputSubMenu as Pt, TagInputTrigger as wt, TagInputValue as Et } from "./TagInput.js";
|
|
19
|
+
import { TextAreaInput as Vt } from "./TextAreaInput.js";
|
|
20
|
+
import { TextInput as ht } from "./TextInput.js";
|
|
21
|
+
import { useForm as Nt } from "./useForm.js";
|
|
23
22
|
export {
|
|
24
|
-
|
|
23
|
+
r as CheckboxInput,
|
|
25
24
|
p as ColorInput,
|
|
26
25
|
n as ColorInputContent,
|
|
27
26
|
u as ColorInputControl,
|
|
28
27
|
I as ColorInputSwatch,
|
|
29
28
|
i as ColorInputTrigger,
|
|
30
29
|
l as ColorInputValueText,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
a as DateInput,
|
|
31
|
+
x as DateInputContent,
|
|
32
|
+
g as DateInputControl,
|
|
33
|
+
f as DateInputField,
|
|
34
|
+
T as DateInputNextTrigger,
|
|
36
35
|
d as DateInputPrevTrigger,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
G as
|
|
50
|
-
H as
|
|
51
|
-
R as
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
at as
|
|
71
|
-
|
|
72
|
-
gt as
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
36
|
+
F as DateInputTrigger,
|
|
37
|
+
S as EditorInput,
|
|
38
|
+
c as EditorInputMenu,
|
|
39
|
+
D as EditorInputMenuItem,
|
|
40
|
+
s as EditorInputSubMenu,
|
|
41
|
+
P as EditorInputTrigger,
|
|
42
|
+
w as EditorInputValue,
|
|
43
|
+
M as EmailInput,
|
|
44
|
+
h as FileInput,
|
|
45
|
+
v as FileInputContext,
|
|
46
|
+
N as FileInputDropzone,
|
|
47
|
+
z as FileInputHiddenInput,
|
|
48
|
+
G as FileInputItem,
|
|
49
|
+
H as FileInputItemDeleteTrigger,
|
|
50
|
+
R as FileInputItemGroup,
|
|
51
|
+
k as FileInputItemName,
|
|
52
|
+
A as FileInputItemPreview,
|
|
53
|
+
L as FileInputItemPreviewImage,
|
|
54
|
+
j as FileInputItemSizeText,
|
|
55
|
+
q as FileInputTrigger,
|
|
56
|
+
B as Input,
|
|
57
|
+
K as InputDescription,
|
|
58
|
+
Q as InputLabel,
|
|
59
|
+
W as InputMessage,
|
|
60
|
+
Y as NumberInput,
|
|
61
|
+
_ as PasswordInput,
|
|
62
|
+
et as PinInput,
|
|
63
|
+
rt as PinInputField,
|
|
64
|
+
ot as PinInputHiddenField,
|
|
65
|
+
nt as RadioGroup,
|
|
66
|
+
It as RadioInput,
|
|
67
|
+
lt as SelectContent,
|
|
68
|
+
mt as SelectInput,
|
|
69
|
+
at as SelectItem,
|
|
70
|
+
xt as SelectItemText,
|
|
71
|
+
gt as SelectPortal,
|
|
72
|
+
ft as SelectTrigger,
|
|
73
|
+
Tt as SelectValue,
|
|
74
|
+
dt as SelectViewport,
|
|
75
|
+
Ct as SwitchInput,
|
|
76
|
+
ct as TagInput,
|
|
77
|
+
Dt as TagInputMenu,
|
|
78
|
+
st as TagInputMenuItem,
|
|
79
|
+
Pt as TagInputSubMenu,
|
|
80
|
+
wt as TagInputTrigger,
|
|
81
|
+
Et as TagInputValue,
|
|
82
|
+
Vt as TextAreaInput,
|
|
83
|
+
ht as TextInput,
|
|
84
|
+
V as emailValidation,
|
|
85
|
+
$ as passwordValidation,
|
|
86
|
+
Nt as useForm
|
|
80
87
|
};
|