@lunejs/admin-ui 0.2.0 → 0.2.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/lib/api/codegen/graphql.d.ts +1 -0
- package/dist/lib/api/codegen/graphql.js +8 -8
- package/dist/lib/custom-fields/components/details/is-list/custom-field-is-list.js +6 -4
- package/dist/lib/custom-fields/components/details/use-form/form-schema.d.ts +1 -0
- package/dist/lib/custom-fields/components/details/use-form/form-schema.js +4 -3
- package/dist/lib/custom-fields/components/fields/custom-field.js +44 -36
- package/dist/lib/custom-fields/components/fields/rich-text.d.ts +8 -0
- package/dist/lib/custom-fields/components/fields/rich-text.js +17 -0
- package/dist/lib/custom-fields/components/fields/shared/primitive.d.ts +2 -1
- package/dist/lib/custom-fields/components/fields/shared/primitive.js +67 -61
- package/dist/lib/custom-fields/utils/custom-field.utils.js +63 -51
- package/dist/lib/translate/components/form/translate-form-row-data.d.ts +2 -1
- package/dist/lib/translate/components/form/translate-form-row-data.js +51 -19
- package/dist/lib/translate/components/form/translate-rich-text.d.ts +8 -0
- package/dist/lib/translate/components/form/translate-rich-text.js +65 -0
- package/dist/lib/translate/components/product-form/custom-fields/translate-product-custom-fields.js +95 -63
- package/dist/lib/translate/components/product-form/translate-product-form.js +19 -18
- package/dist/node_modules/@tiptap/core/dist/index.js +876 -872
- package/dist/node_modules/@tiptap/extensions/dist/index.js +288 -0
- package/dist/node_modules/@tiptap/react/dist/index.js +35 -34
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
- package/dist/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/layout-list.js +13 -0
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +86 -0
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js +204 -0
- package/dist/node_modules/prosemirror-history/dist/index.js +248 -0
- package/dist/node_modules/rope-sequence/dist/index.js +100 -0
- package/dist/shared/components/rich-editor/rich-editor.d.ts +3 -1
- package/dist/shared/components/rich-editor/rich-editor.js +40 -36
- package/dist/shared/components/rich-editor/toolbar/bold/rich-editor-toolbar-bold.js +10 -9
- package/dist/shared/components/rich-editor/toolbar/color/rich-editor-toolbar-color.js +1 -0
- package/dist/shared/components/rich-editor/toolbar/heading/rich-editor-toolbar-heading.js +1 -0
- package/dist/shared/components/rich-editor/toolbar/italic/rich-editor-toolbar-italic.js +5 -4
- package/dist/shared/components/rich-editor/toolbar/link/rich-editor-toolbar-link.js +8 -7
- package/dist/shared/components/rich-editor/toolbar/ol-list/rich-editor-toolbar-ul-list.js +1 -0
- package/dist/shared/components/rich-editor/toolbar/table/rich-editor-toolbar-table.js +9 -8
- package/dist/shared/components/rich-editor/toolbar/ul-list/rich-editor-toolbar-ul-list.js +7 -6
- package/dist/shared/components/rich-editor/toolbar/underline/rich-editor-toolbar-underline.js +3 -2
- package/package.json +1 -1
|
@@ -31,14 +31,16 @@ import "../../../../../packages/lune-ui/dist/components/toggle-group.js";
|
|
|
31
31
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-tooltip/dist/index.js";
|
|
32
32
|
import "../../../../../packages/lune-ui/dist/form/form.js";
|
|
33
33
|
import { FormSelect as a } from "../../../../../packages/lune-ui/dist/form/form-select.js";
|
|
34
|
-
import { CustomFieldType as
|
|
34
|
+
import { CustomFieldType as o } from "../../../../api/codegen/graphql.js";
|
|
35
35
|
import { useCustomFieldFormContext as u } from "../use-form/use-form.js";
|
|
36
36
|
import c from "../../../../../node_modules/lucide-react/dist/esm/icons/circle.js";
|
|
37
37
|
import f from "../../../../../node_modules/lucide-react/dist/esm/icons/list.js";
|
|
38
38
|
const Z = () => {
|
|
39
|
-
const { control: m, watch: r, definition: p, setValue: e } = u(),
|
|
40
|
-
() => [
|
|
41
|
-
|
|
39
|
+
const { control: m, watch: r, definition: p, setValue: e } = u(), i = r("type"), t = l(
|
|
40
|
+
() => [o.Boolean, o.MultiLineText, o.RichText].includes(
|
|
41
|
+
i
|
|
42
|
+
),
|
|
43
|
+
[i]
|
|
42
44
|
);
|
|
43
45
|
return n(() => {
|
|
44
46
|
t && e("quantity", "single");
|
|
@@ -14,6 +14,7 @@ export declare const CustomFieldDetailsSchema: z.ZodObject<{
|
|
|
14
14
|
MONEY: CustomFieldType.Money;
|
|
15
15
|
MULTI_LINE_TEXT: CustomFieldType.MultiLineText;
|
|
16
16
|
PRODUCT_REFERENCE: CustomFieldType.ProductReference;
|
|
17
|
+
RICH_TEXT: CustomFieldType.RichText;
|
|
17
18
|
SINGLE_LINE_TEXT: CustomFieldType.SingleLineText;
|
|
18
19
|
URL: CustomFieldType.Url;
|
|
19
20
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as t from "../../../../../node_modules/zod/v4/classic/external.js";
|
|
2
2
|
import { CustomFieldType as e } from "../../../../api/codegen/graphql.js";
|
|
3
3
|
import { FormMessages as o } from "../../../../../shared/forms/form-messages.js";
|
|
4
|
-
const
|
|
4
|
+
const r = t.object({
|
|
5
5
|
name: t.string().min(1, o.required),
|
|
6
6
|
type: t.enum(
|
|
7
7
|
[
|
|
@@ -17,7 +17,8 @@ const i = t.object({
|
|
|
17
17
|
e.SingleLineText,
|
|
18
18
|
e.CustomObjectReference,
|
|
19
19
|
e.Url,
|
|
20
|
-
e.Color
|
|
20
|
+
e.Color,
|
|
21
|
+
e.RichText
|
|
21
22
|
],
|
|
22
23
|
"Invalid type"
|
|
23
24
|
),
|
|
@@ -25,5 +26,5 @@ const i = t.object({
|
|
|
25
26
|
quantity: t.enum(["single", "multiple"])
|
|
26
27
|
});
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
r as CustomFieldDetailsSchema
|
|
29
30
|
};
|
|
@@ -1,94 +1,102 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
2
|
import { CustomFieldType as o } from "../../../api/codegen/graphql.js";
|
|
3
3
|
import { BooleanCustomField as C } from "./boolean.js";
|
|
4
4
|
import { ColorCustomField as u } from "./color.js";
|
|
5
5
|
import { CustomObjectReferenceCustomField as F } from "./custom-object.js";
|
|
6
|
-
import { DateCustomField as
|
|
7
|
-
import { DecimalCustomField as
|
|
6
|
+
import { DateCustomField as c } from "./date.js";
|
|
7
|
+
import { DecimalCustomField as y } from "./decimal.js";
|
|
8
8
|
import { ImageCustomField as l } from "./image.js";
|
|
9
|
-
import { IntegerCustomField as
|
|
10
|
-
import { MultiLineTextCustomField as
|
|
11
|
-
import { ProductReferenceCustomField as
|
|
12
|
-
import {
|
|
9
|
+
import { IntegerCustomField as x } from "./integer.js";
|
|
10
|
+
import { MultiLineTextCustomField as g } from "./multi-line-text.js";
|
|
11
|
+
import { ProductReferenceCustomField as s } from "./product-reference.js";
|
|
12
|
+
import { RichTextCustomField as T } from "./rich-text.js";
|
|
13
|
+
import { SingleLineTextCustomField as R } from "./single-line-text.js";
|
|
13
14
|
import { UrlCustomField as D } from "./url.js";
|
|
14
|
-
const
|
|
15
|
-
|
|
15
|
+
const w = ({ defaultValues: e, definition: r, onChange: t }) => r.type === o.SingleLineText ? /* @__PURE__ */ p(
|
|
16
|
+
R,
|
|
16
17
|
{
|
|
17
18
|
defaultValues: e,
|
|
18
|
-
onChange: (m) =>
|
|
19
|
+
onChange: (m) => t(r, m),
|
|
19
20
|
definition: r
|
|
20
21
|
}
|
|
21
|
-
) : r.type === o.MultiLineText ? /* @__PURE__ */
|
|
22
|
-
|
|
22
|
+
) : r.type === o.MultiLineText ? /* @__PURE__ */ p(
|
|
23
|
+
g,
|
|
24
|
+
{
|
|
25
|
+
defaultValue: e?.[0],
|
|
26
|
+
onChange: (m) => t(r, m),
|
|
27
|
+
definition: r
|
|
28
|
+
}
|
|
29
|
+
) : r.type === o.RichText ? /* @__PURE__ */ p(
|
|
30
|
+
T,
|
|
23
31
|
{
|
|
24
32
|
defaultValue: e?.[0],
|
|
25
|
-
onChange: (m) =>
|
|
33
|
+
onChange: (m) => t(r, m),
|
|
26
34
|
definition: r
|
|
27
35
|
}
|
|
28
|
-
) : r.type === o.Url ? /* @__PURE__ */
|
|
36
|
+
) : r.type === o.Url ? /* @__PURE__ */ p(
|
|
29
37
|
D,
|
|
30
38
|
{
|
|
31
39
|
defaultValues: e,
|
|
32
|
-
onChange: (m) =>
|
|
40
|
+
onChange: (m) => t(r, m),
|
|
33
41
|
definition: r
|
|
34
42
|
}
|
|
35
|
-
) : r.type === o.Color ? /* @__PURE__ */
|
|
43
|
+
) : r.type === o.Color ? /* @__PURE__ */ p(
|
|
36
44
|
u,
|
|
37
45
|
{
|
|
38
46
|
defaultValues: e,
|
|
39
|
-
onChange: (m) =>
|
|
47
|
+
onChange: (m) => t(r, m),
|
|
40
48
|
definition: r
|
|
41
49
|
}
|
|
42
|
-
) : r.type === o.Integer ? /* @__PURE__ */
|
|
43
|
-
|
|
50
|
+
) : r.type === o.Integer ? /* @__PURE__ */ p(
|
|
51
|
+
x,
|
|
44
52
|
{
|
|
45
53
|
defaultValues: e,
|
|
46
|
-
onChange: (m) =>
|
|
54
|
+
onChange: (m) => t(r, m),
|
|
47
55
|
definition: r
|
|
48
56
|
}
|
|
49
|
-
) : r.type === o.Decimal ? /* @__PURE__ */
|
|
50
|
-
|
|
57
|
+
) : r.type === o.Decimal ? /* @__PURE__ */ p(
|
|
58
|
+
y,
|
|
51
59
|
{
|
|
52
60
|
defaultValues: e,
|
|
53
|
-
onChange: (m) =>
|
|
61
|
+
onChange: (m) => t(r, m),
|
|
54
62
|
definition: r
|
|
55
63
|
}
|
|
56
|
-
) : r.type === o.Boolean ? /* @__PURE__ */
|
|
64
|
+
) : r.type === o.Boolean ? /* @__PURE__ */ p(
|
|
57
65
|
C,
|
|
58
66
|
{
|
|
59
67
|
defaultValues: e,
|
|
60
|
-
onChange: (m) =>
|
|
68
|
+
onChange: (m) => t(r, m),
|
|
61
69
|
definition: r
|
|
62
70
|
}
|
|
63
|
-
) : r.type === o.Date ? /* @__PURE__ */
|
|
64
|
-
|
|
71
|
+
) : r.type === o.Date ? /* @__PURE__ */ p(
|
|
72
|
+
c,
|
|
65
73
|
{
|
|
66
74
|
defaultValues: e,
|
|
67
|
-
onChange: (m) =>
|
|
75
|
+
onChange: (m) => t(r, m),
|
|
68
76
|
definition: r
|
|
69
77
|
}
|
|
70
|
-
) : r.type === o.Image ? /* @__PURE__ */
|
|
78
|
+
) : r.type === o.Image ? /* @__PURE__ */ p(
|
|
71
79
|
l,
|
|
72
80
|
{
|
|
73
81
|
defaultValues: e,
|
|
74
|
-
onChange: (m) =>
|
|
82
|
+
onChange: (m) => t(r, m),
|
|
75
83
|
definition: r
|
|
76
84
|
}
|
|
77
|
-
) : r.type === o.ProductReference ? /* @__PURE__ */
|
|
78
|
-
|
|
85
|
+
) : r.type === o.ProductReference ? /* @__PURE__ */ p(
|
|
86
|
+
s,
|
|
79
87
|
{
|
|
80
88
|
defaultValues: e,
|
|
81
|
-
onChange: (m) =>
|
|
89
|
+
onChange: (m) => t(r, m),
|
|
82
90
|
definition: r
|
|
83
91
|
}
|
|
84
|
-
) : r.type === o.CustomObjectReference ? /* @__PURE__ */
|
|
92
|
+
) : r.type === o.CustomObjectReference ? /* @__PURE__ */ p(
|
|
85
93
|
F,
|
|
86
94
|
{
|
|
87
95
|
defaultValues: e,
|
|
88
|
-
onChange: (m) =>
|
|
96
|
+
onChange: (m) => t(r, m),
|
|
89
97
|
definition: r
|
|
90
98
|
}
|
|
91
99
|
) : null;
|
|
92
100
|
export {
|
|
93
|
-
|
|
101
|
+
w as CustomField
|
|
94
102
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CommonCustomFieldDefinitionFragment } from '../../../api/types';
|
|
2
|
+
export declare const RichTextCustomField: ({ defaultValue, definition, onChange }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
type Props = {
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onChange: (value: null | string) => void;
|
|
6
|
+
definition: CommonCustomFieldDefinitionFragment;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { PrimitiveCustomField as s } from "./shared/primitive.js";
|
|
3
|
+
const a = ({ defaultValue: t, definition: e, onChange: o }) => /* @__PURE__ */ n(
|
|
4
|
+
s,
|
|
5
|
+
{
|
|
6
|
+
richtext: !0,
|
|
7
|
+
defaultValues: t ? [t] : [""],
|
|
8
|
+
definition: e,
|
|
9
|
+
onChange: (r) => {
|
|
10
|
+
const i = r.map((m) => m.value);
|
|
11
|
+
o(i[0] ?? null);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
export {
|
|
16
|
+
a as RichTextCustomField
|
|
17
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { CommonCustomFieldDefinitionFragment } from '../../../../api/types';
|
|
3
|
-
export declare const PrimitiveCustomField: ({ onChange, definition, placeholder, defaultValues, inputProps, mapOnSave, textarea, bool, date }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const PrimitiveCustomField: ({ onChange, definition, placeholder, defaultValues, inputProps, mapOnSave, textarea, bool, date, richtext }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
type Props = {
|
|
5
5
|
definition: CommonCustomFieldDefinitionFragment;
|
|
6
6
|
onChange: (items: {
|
|
@@ -13,6 +13,7 @@ type Props = {
|
|
|
13
13
|
textarea?: boolean;
|
|
14
14
|
bool?: boolean;
|
|
15
15
|
date?: boolean;
|
|
16
|
+
richtext?: boolean;
|
|
16
17
|
mapOnSave?: (items: {
|
|
17
18
|
id: string;
|
|
18
19
|
value: string;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useId as
|
|
3
|
-
import { isTruthy as
|
|
2
|
+
import { useId as F, useState as I } from "react";
|
|
3
|
+
import { isTruthy as w } from "../../../../../packages/lune-common/dist/index.js";
|
|
4
4
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-accordion/dist/index.js";
|
|
5
5
|
import { cn as z } from "../../../../../packages/lune-ui/dist/lib/utils.js";
|
|
6
6
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js";
|
|
7
|
-
import { Button as
|
|
7
|
+
import { Button as u } from "../../../../../packages/lune-ui/dist/components/button.js";
|
|
8
8
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-avatar/dist/index.js";
|
|
9
9
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-separator/dist/index.js";
|
|
10
|
-
import { Calendar as
|
|
10
|
+
import { Calendar as E } from "../../../../../packages/lune-ui/dist/components/calendar.js";
|
|
11
11
|
import "../../../../../packages/lune-ui/dist/components/chart.js";
|
|
12
12
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-checkbox/dist/index.js";
|
|
13
13
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-collapsible/dist/index.js";
|
|
14
14
|
import "../../../../../packages/lune-ui/dist/node_modules/cmdk/dist/index.js";
|
|
15
15
|
import "../../../../../packages/lune-ui/dist/components/dialog.js";
|
|
16
16
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js";
|
|
17
|
-
import { Input as
|
|
18
|
-
import { Textarea as
|
|
19
|
-
import { Label as
|
|
17
|
+
import { Input as N } from "../../../../../packages/lune-ui/dist/components/input.js";
|
|
18
|
+
import { Textarea as M } from "../../../../../packages/lune-ui/dist/components/textarea.js";
|
|
19
|
+
import { Label as P } from "../../../../../packages/lune-ui/dist/components/label.js";
|
|
20
20
|
import "../../../../../packages/lune-ui/dist/components/phone-input.js";
|
|
21
|
-
import { Popover as
|
|
21
|
+
import { Popover as x, PopoverTrigger as S, PopoverContent as j } from "../../../../../packages/lune-ui/dist/components/popover.js";
|
|
22
22
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-radio-group/dist/index.js";
|
|
23
|
-
import { Select as
|
|
23
|
+
import { Select as O, SelectTrigger as R, SelectValue as $, SelectContent as B, SelectItem as T } from "../../../../../packages/lune-ui/dist/components/select.js";
|
|
24
24
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-dialog/dist/index.js";
|
|
25
25
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-switch/dist/index.js";
|
|
26
26
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-tabs/dist/index.js";
|
|
@@ -30,69 +30,75 @@ import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-toggle
|
|
|
30
30
|
import "../../../../../packages/lune-ui/dist/components/toggle-group.js";
|
|
31
31
|
import "../../../../../packages/lune-ui/dist/node_modules/@radix-ui/react-tooltip/dist/index.js";
|
|
32
32
|
import "../../../../../packages/lune-ui/dist/form/form.js";
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import U from "
|
|
36
|
-
import
|
|
37
|
-
|
|
33
|
+
import { RichEditor as G } from "../../../../../shared/components/rich-editor/rich-editor.js";
|
|
34
|
+
import { useList as H } from "../../../../../shared/hooks/use-list.js";
|
|
35
|
+
import { CustomFieldPreviewContainer as U } from "./preview/custom-field-preview-container.js";
|
|
36
|
+
import { formatDate as V } from "../../../../../node_modules/date-fns/format.js";
|
|
37
|
+
import X from "../../../../../node_modules/lucide-react/dist/esm/icons/calendar.js";
|
|
38
|
+
import _ from "../../../../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
39
|
+
const Ae = ({
|
|
38
40
|
onChange: k,
|
|
39
|
-
definition:
|
|
40
|
-
placeholder:
|
|
41
|
-
defaultValues:
|
|
41
|
+
definition: s,
|
|
42
|
+
placeholder: i,
|
|
43
|
+
defaultValues: c,
|
|
42
44
|
inputProps: y,
|
|
43
|
-
mapOnSave:
|
|
44
|
-
textarea:
|
|
45
|
-
bool:
|
|
46
|
-
date:
|
|
45
|
+
mapOnSave: d,
|
|
46
|
+
textarea: v,
|
|
47
|
+
bool: h,
|
|
48
|
+
date: f,
|
|
49
|
+
richtext: m
|
|
47
50
|
}) => {
|
|
48
|
-
const
|
|
49
|
-
|
|
51
|
+
const g = F(), { items: n, build: L, append: C, remove: b, reset: A, update: o } = H(c ?? [""]), [t, D] = I(
|
|
52
|
+
c?.map((e) => L(e)) ?? []
|
|
50
53
|
);
|
|
51
54
|
return /* @__PURE__ */ l(
|
|
52
|
-
|
|
55
|
+
x,
|
|
53
56
|
{
|
|
54
57
|
onOpenChange: (e) => {
|
|
55
58
|
if (!e) {
|
|
56
|
-
const a =
|
|
57
|
-
D(a), k(a), A(a), a.length ||
|
|
59
|
+
const a = d ? n.filter((p) => w(p.value)).map(d) : n.filter((p) => w(p.value));
|
|
60
|
+
D(a), k(a), A(a), a.length || C("");
|
|
58
61
|
}
|
|
59
62
|
},
|
|
60
63
|
children: [
|
|
61
64
|
/* @__PURE__ */ l("div", { className: "group grid grid-cols-1 items-center gap-2 md:grid-cols-[25%_1fr] md:gap-4 cursor-default", children: [
|
|
62
|
-
/* @__PURE__ */ r(
|
|
63
|
-
/* @__PURE__ */ r(
|
|
64
|
-
|
|
65
|
+
/* @__PURE__ */ r(P, { htmlFor: g, className: "w-full", children: s.name }),
|
|
66
|
+
/* @__PURE__ */ r(S, { asChild: !0, children: m ? /* @__PURE__ */ r(U, { className: "px-2", children: t.map((e) => {
|
|
67
|
+
const a = document.createElement("div");
|
|
68
|
+
return a.innerHTML = e.value, a.textContent;
|
|
69
|
+
}) }) : /* @__PURE__ */ r(
|
|
70
|
+
N,
|
|
65
71
|
{
|
|
66
|
-
id:
|
|
67
|
-
value:
|
|
68
|
-
`, " ") :
|
|
72
|
+
id: g,
|
|
73
|
+
value: m ? t.map((e) => e.value).join(", ") : v ? t.map((e) => e.value).join(", ").replaceAll(`
|
|
74
|
+
`, " ") : h ? t.map(
|
|
69
75
|
(e) => `${e.value.charAt(0).toUpperCase()}${e.value.slice(1, e.value.length)}`
|
|
70
76
|
).join(", ").replaceAll(`
|
|
71
|
-
`, " ") :
|
|
77
|
+
`, " ") : f ? t.map((e) => e.value ? V(e.value, "PPP") : "").join(", ") : t.map((e) => e.value).join(", "),
|
|
72
78
|
readOnly: !0,
|
|
73
79
|
className: "w-full shrink-0 text-start dark:group-hover:bg-input/50 group-hover:bg-muted"
|
|
74
80
|
}
|
|
75
81
|
) })
|
|
76
82
|
] }),
|
|
77
|
-
/* @__PURE__ */ r(
|
|
78
|
-
/* @__PURE__ */ r(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
/* @__PURE__ */ r(j, { className: "w-auto min-w-72 max-w-lg", align: "start", children: /* @__PURE__ */ l("div", { className: "flex flex-col gap-2", children: [
|
|
84
|
+
/* @__PURE__ */ r(P, { children: s.name }),
|
|
85
|
+
n.map((e) => /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
86
|
+
m ? /* @__PURE__ */ r(G, { defaultValue: e.value, onChange: (a) => o(e.id, a) }) : v ? /* @__PURE__ */ r(
|
|
87
|
+
M,
|
|
82
88
|
{
|
|
83
|
-
placeholder:
|
|
89
|
+
placeholder: i,
|
|
84
90
|
value: e.value,
|
|
85
|
-
onChange: (a) =>
|
|
91
|
+
onChange: (a) => o(e.id, a.target.value)
|
|
86
92
|
}
|
|
87
|
-
) :
|
|
88
|
-
/* @__PURE__ */ r(
|
|
89
|
-
/* @__PURE__ */ l(
|
|
90
|
-
/* @__PURE__ */ r(
|
|
91
|
-
/* @__PURE__ */ r(
|
|
93
|
+
) : h ? /* @__PURE__ */ l(O, { value: e.value, onValueChange: (a) => o(e.id, a), children: [
|
|
94
|
+
/* @__PURE__ */ r(R, { children: /* @__PURE__ */ r($, { placeholder: i || "Select a value" }) }),
|
|
95
|
+
/* @__PURE__ */ l(B, { children: [
|
|
96
|
+
/* @__PURE__ */ r(T, { value: "true", children: "True" }),
|
|
97
|
+
/* @__PURE__ */ r(T, { value: "false", children: "False" })
|
|
92
98
|
] })
|
|
93
|
-
] }) :
|
|
94
|
-
/* @__PURE__ */ r(
|
|
95
|
-
|
|
99
|
+
] }) : f ? /* @__PURE__ */ l(x, { children: [
|
|
100
|
+
/* @__PURE__ */ r(S, { asChild: !0, children: /* @__PURE__ */ l(
|
|
101
|
+
u,
|
|
96
102
|
{
|
|
97
103
|
variant: "outline",
|
|
98
104
|
className: z(
|
|
@@ -100,47 +106,47 @@ const ke = ({
|
|
|
100
106
|
!e.value && "text-muted-foreground"
|
|
101
107
|
),
|
|
102
108
|
children: [
|
|
103
|
-
e.value ?
|
|
104
|
-
/* @__PURE__ */ r(
|
|
109
|
+
e.value ? V(new Date(e.value), "PPP") : /* @__PURE__ */ r("span", { children: i }),
|
|
110
|
+
/* @__PURE__ */ r(X, { size: 16, className: "opacity-50" })
|
|
105
111
|
]
|
|
106
112
|
}
|
|
107
113
|
) }),
|
|
108
|
-
/* @__PURE__ */ r(
|
|
109
|
-
|
|
114
|
+
/* @__PURE__ */ r(j, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ r(
|
|
115
|
+
E,
|
|
110
116
|
{
|
|
111
117
|
mode: "single",
|
|
112
118
|
defaultMonth: e.value ? new Date(e.value) : void 0,
|
|
113
119
|
selected: e.value ? new Date(e.value) : void 0,
|
|
114
|
-
onSelect: (a) =>
|
|
120
|
+
onSelect: (a) => o(e.id, a ? a.toISOString() : ""),
|
|
115
121
|
className: "h-81.25"
|
|
116
122
|
}
|
|
117
123
|
) })
|
|
118
124
|
] }) : /* @__PURE__ */ r(
|
|
119
|
-
|
|
125
|
+
N,
|
|
120
126
|
{
|
|
121
127
|
...y,
|
|
122
128
|
value: e.value,
|
|
123
|
-
placeholder:
|
|
124
|
-
onChange: (a) =>
|
|
129
|
+
placeholder: i,
|
|
130
|
+
onChange: (a) => o(e.id, a.target.value)
|
|
125
131
|
}
|
|
126
132
|
),
|
|
127
|
-
|
|
128
|
-
|
|
133
|
+
n.length > 1 && /* @__PURE__ */ r(
|
|
134
|
+
u,
|
|
129
135
|
{
|
|
130
136
|
variant: "ghost",
|
|
131
137
|
size: "icon",
|
|
132
138
|
onClick: () => b(e.id),
|
|
133
139
|
className: "shrink-0",
|
|
134
|
-
children: /* @__PURE__ */ r(
|
|
140
|
+
children: /* @__PURE__ */ r(_, {})
|
|
135
141
|
}
|
|
136
142
|
)
|
|
137
143
|
] }, e.id)),
|
|
138
|
-
|
|
144
|
+
s.isList && /* @__PURE__ */ r(u, { variant: "outline", size: "sm", onClick: () => C(""), className: "w-fit", children: "Add item" })
|
|
139
145
|
] }) })
|
|
140
146
|
]
|
|
141
147
|
}
|
|
142
148
|
);
|
|
143
149
|
};
|
|
144
150
|
export {
|
|
145
|
-
|
|
151
|
+
Ae as PrimitiveCustomField
|
|
146
152
|
};
|