@pixpilot/formily-shadcn 0.31.1 → 0.32.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/components/array-base/components/array-item-label.cjs +1 -1
- package/dist/components/array-base/components/array-item-label.js +1 -1
- package/dist/components/array-cards/item.cjs +5 -14
- package/dist/components/array-cards/item.js +5 -14
- package/dist/components/array-collapse/item.cjs +14 -28
- package/dist/components/array-collapse/item.js +14 -28
- package/dist/components/array-common/array-item-header-row.cjs +45 -0
- package/dist/components/array-common/array-item-header-row.js +41 -0
- package/dist/components/array-common/index.cjs +1 -0
- package/dist/components/array-common/index.js +1 -0
- package/dist/components/array-common/list-item.cjs +8 -17
- package/dist/components/array-common/list-item.js +8 -17
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/column.d.ts +2 -2
- package/dist/components/date-picker.d.cts +3 -3
- package/dist/components/date-picker.d.ts +3 -3
- package/dist/components/file-upload/file-upload-inline.d.cts +8 -8
- package/dist/components/file-upload/file-upload-inline.d.ts +8 -8
- package/dist/components/file-upload/file-upload.d.cts +8 -8
- package/dist/components/file-upload/file-upload.d.ts +8 -8
- package/dist/components/form-grid.d.ts +2 -2
- package/dist/components/form.d.ts +2 -2
- package/dist/components/icon-picker.d.cts +3 -3
- package/dist/components/icon-picker.d.ts +3 -3
- package/dist/components/icon-toggle.d.cts +2 -2
- package/dist/components/icon-toggle.d.ts +2 -2
- package/dist/components/input.d.ts +3 -3
- package/dist/components/number/number-input.d.ts +3 -3
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/row.d.ts +2 -2
- package/dist/components/schema-field/schema-field-basics.d.cts +244 -244
- package/dist/components/schema-field/schema-field-basics.d.ts +259 -259
- package/dist/components/schema-field/schema-field-extended.d.cts +550 -550
- package/dist/components/schema-field/schema-field-extended.d.ts +556 -556
- package/dist/components/schema-field/schema-field.d.cts +321 -321
- package/dist/components/schema-field/schema-field.d.ts +335 -335
- package/dist/components/separator.d.cts +2 -2
- package/dist/components/separator.d.ts +2 -2
- package/dist/components/slider/slider-input.d.cts +3 -3
- package/dist/components/slider/slider-input.d.ts +2 -2
- package/dist/components/slider/slider-select.d.cts +3 -3
- package/dist/components/slider/slider-select.d.ts +3 -3
- package/dist/components/slider/slider.d.cts +3 -3
- package/dist/components/slider/slider.d.ts +2 -2
- package/dist/components/switch.d.cts +2 -2
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/tags-input-inline.d.cts +2 -2
- package/dist/components/tags-input-inline.d.ts +2 -2
- package/dist/components/textarea.d.cts +2 -2
- package/dist/components/textarea.d.ts +2 -2
- package/package.json +4 -4
|
@@ -18,7 +18,7 @@ const ArrayItemLabel = (0, __formily_react.observer)(() => {
|
|
|
18
18
|
const displayLabel = itemField?.title ?? label;
|
|
19
19
|
const indexSuffix = itemField?.title == null && (typeof displayLabel === "string" || displayLabel == null) ? ` ${(index ?? 0) + 1}` : "";
|
|
20
20
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
21
|
-
className: "truncate font-medium",
|
|
21
|
+
className: "truncate font-medium block max-w-full",
|
|
22
22
|
title: `${displayLabel}${indexSuffix}`,
|
|
23
23
|
children: [displayLabel, indexSuffix]
|
|
24
24
|
});
|
|
@@ -14,7 +14,7 @@ const ArrayItemLabel = observer(() => {
|
|
|
14
14
|
const displayLabel = itemField?.title ?? label;
|
|
15
15
|
const indexSuffix = itemField?.title == null && (typeof displayLabel === "string" || displayLabel == null) ? ` ${(index ?? 0) + 1}` : "";
|
|
16
16
|
return /* @__PURE__ */ jsxs("span", {
|
|
17
|
-
className: "truncate font-medium",
|
|
17
|
+
className: "truncate font-medium block max-w-full",
|
|
18
18
|
title: `${displayLabel}${indexSuffix}`,
|
|
19
19
|
children: [displayLabel, indexSuffix]
|
|
20
20
|
});
|
|
@@ -3,8 +3,9 @@ const require_get_x_component_props = require('../../utils/get-x-component-props
|
|
|
3
3
|
require('../../utils/index.cjs');
|
|
4
4
|
const require_array_base = require('../array-base/array-base.cjs');
|
|
5
5
|
const require_is_array_component = require('../array-base/utils/is-array-component.cjs');
|
|
6
|
-
const require_component_context = require('../array-base/component-context.cjs');
|
|
7
6
|
require('../array-base/index.cjs');
|
|
7
|
+
const require_array_item_header_row = require('../array-common/array-item-header-row.cjs');
|
|
8
|
+
require('../array-common/index.cjs');
|
|
8
9
|
let __formily_react = require("@formily/react");
|
|
9
10
|
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
10
11
|
let react = require("react");
|
|
@@ -17,7 +18,6 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
17
18
|
//#region src/components/array-cards/item.tsx
|
|
18
19
|
const ArrayItem = react.default.memo(({ index, record }) => {
|
|
19
20
|
const schema = (0, __formily_react.useFieldSchema)();
|
|
20
|
-
const Components = require_component_context.useArrayComponents();
|
|
21
21
|
const items = schema?.items;
|
|
22
22
|
const { className: itemWrapperClassName,...itemWrapperRestProps } = require_get_x_component_props.getXComponentProps(items);
|
|
23
23
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_array_base.ArrayBase.Item, {
|
|
@@ -26,18 +26,9 @@ const ArrayItem = react.default.memo(({ index, record }) => {
|
|
|
26
26
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
27
27
|
...itemWrapperRestProps,
|
|
28
28
|
className: (0, __pixpilot_shadcn_ui.cn)("border rounded-lg p-4 space-y-2", itemWrapperClassName),
|
|
29
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
className: "flex-1",
|
|
33
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Components.ItemLabel, {
|
|
34
|
-
index,
|
|
35
|
-
schema: schema.items
|
|
36
|
-
})
|
|
37
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Components.OperationComponents, {
|
|
38
|
-
index,
|
|
39
|
-
schema: schema.items
|
|
40
|
-
}) })]
|
|
29
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_array_item_header_row.ArrayItemHeaderRow, {
|
|
30
|
+
schema: schema.items,
|
|
31
|
+
index
|
|
41
32
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
42
33
|
className: "space-y-4",
|
|
43
34
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.RecursionField, {
|
|
@@ -2,8 +2,9 @@ import { getXComponentProps } from "../../utils/get-x-component-props.js";
|
|
|
2
2
|
import "../../utils/index.js";
|
|
3
3
|
import { ArrayBase } from "../array-base/array-base.js";
|
|
4
4
|
import { isOperationComponent } from "../array-base/utils/is-array-component.js";
|
|
5
|
-
import { useArrayComponents } from "../array-base/component-context.js";
|
|
6
5
|
import "../array-base/index.js";
|
|
6
|
+
import { ArrayItemHeaderRow } from "../array-common/array-item-header-row.js";
|
|
7
|
+
import "../array-common/index.js";
|
|
7
8
|
import { RecursionField, useFieldSchema } from "@formily/react";
|
|
8
9
|
import React from "react";
|
|
9
10
|
import { cn } from "@pixpilot/shadcn-ui";
|
|
@@ -12,7 +13,6 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
12
13
|
//#region src/components/array-cards/item.tsx
|
|
13
14
|
const ArrayItem = React.memo(({ index, record }) => {
|
|
14
15
|
const schema = useFieldSchema();
|
|
15
|
-
const Components = useArrayComponents();
|
|
16
16
|
const items = schema?.items;
|
|
17
17
|
const { className: itemWrapperClassName,...itemWrapperRestProps } = getXComponentProps(items);
|
|
18
18
|
return /* @__PURE__ */ jsx(ArrayBase.Item, {
|
|
@@ -21,18 +21,9 @@ const ArrayItem = React.memo(({ index, record }) => {
|
|
|
21
21
|
children: /* @__PURE__ */ jsxs("div", {
|
|
22
22
|
...itemWrapperRestProps,
|
|
23
23
|
className: cn("border rounded-lg p-4 space-y-2", itemWrapperClassName),
|
|
24
|
-
children: [/* @__PURE__ */
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
className: "flex-1",
|
|
28
|
-
children: /* @__PURE__ */ jsx(Components.ItemLabel, {
|
|
29
|
-
index,
|
|
30
|
-
schema: schema.items
|
|
31
|
-
})
|
|
32
|
-
}), /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Components.OperationComponents, {
|
|
33
|
-
index,
|
|
34
|
-
schema: schema.items
|
|
35
|
-
}) })]
|
|
24
|
+
children: [/* @__PURE__ */ jsx(ArrayItemHeaderRow, {
|
|
25
|
+
schema: schema.items,
|
|
26
|
+
index
|
|
36
27
|
}), /* @__PURE__ */ jsx("div", {
|
|
37
28
|
className: "space-y-4",
|
|
38
29
|
children: /* @__PURE__ */ jsx(RecursionField, {
|
|
@@ -3,8 +3,8 @@ const require_validate_array_item_fields = require('../../utils/validate-array-i
|
|
|
3
3
|
const require_get_x_component_props = require('../../utils/get-x-component-props.cjs');
|
|
4
4
|
require('../../utils/index.cjs');
|
|
5
5
|
const require_array_base = require('../array-base/array-base.cjs');
|
|
6
|
-
const require_component_context = require('../array-base/component-context.cjs');
|
|
7
6
|
require('../array-base/index.cjs');
|
|
7
|
+
const require_array_item_header_row = require('../array-common/array-item-header-row.cjs');
|
|
8
8
|
const require_item_wrapper = require('../array-common/item-wrapper.cjs');
|
|
9
9
|
require('../array-common/index.cjs');
|
|
10
10
|
let __formily_react = require("@formily/react");
|
|
@@ -23,7 +23,6 @@ const ArrayCollapseItem = react.default.memo((props) => {
|
|
|
23
23
|
const { index, itemId, formCollapse, isOpen, isNewItem, onClick } = props;
|
|
24
24
|
const field = (0, __formily_react.useField)();
|
|
25
25
|
const schema = (0, __formily_react.useFieldSchema)();
|
|
26
|
-
const { ItemLabel, OperationComponents } = require_component_context.useArrayComponents();
|
|
27
26
|
const items = Array.isArray(schema.items) ? schema.items[0] ?? schema.items : schema.items;
|
|
28
27
|
const itemWrapperProps = require_get_x_component_props.getXComponentProps(items);
|
|
29
28
|
react.default.useEffect(() => {
|
|
@@ -46,32 +45,19 @@ const ArrayCollapseItem = react.default.memo((props) => {
|
|
|
46
45
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_item_wrapper.ItemWrapper, {
|
|
47
46
|
...itemWrapperProps,
|
|
48
47
|
index,
|
|
49
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.
|
|
50
|
-
className: "
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
className: "text-foreground flex items-center gap-2 font-medium",
|
|
63
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDownIcon, { className: (0, __pixpilot_shadcn.cn)("size-4 shrink-0 transition-transform duration-200", isOpen && "rotate-180") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItemLabel, {
|
|
64
|
-
schema,
|
|
65
|
-
index
|
|
66
|
-
})]
|
|
67
|
-
})
|
|
68
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
69
|
-
className: "flex items-center gap-1",
|
|
70
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OperationComponents, {
|
|
71
|
-
schema,
|
|
72
|
-
index
|
|
73
|
-
})
|
|
74
|
-
})]
|
|
48
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_array_item_header_row.ArrayItemHeaderRow, {
|
|
49
|
+
className: "px-3",
|
|
50
|
+
schema,
|
|
51
|
+
index,
|
|
52
|
+
contentClassName: "hover:no-underline py-4 text-sm font-medium transition-all text-foreground",
|
|
53
|
+
leading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDownIcon, { className: (0, __pixpilot_shadcn.cn)("size-4 shrink-0 transition-transform duration-200", isOpen && "rotate-180") }),
|
|
54
|
+
buttonProps: { onClick: () => {
|
|
55
|
+
onClick?.();
|
|
56
|
+
if (formCollapse.hasActiveKey(itemId)) require_validate_array_item_fields.validateArrayItemFields(field, index).then(() => {
|
|
57
|
+
formCollapse.removeActiveKey(itemId);
|
|
58
|
+
}).catch(() => {});
|
|
59
|
+
else formCollapse.addActiveKey(itemId);
|
|
60
|
+
} }
|
|
75
61
|
}), isOpen && items && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
76
62
|
className: "border-t px-3 pb-4",
|
|
77
63
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -2,8 +2,8 @@ import { validateArrayItemFields } from "../../utils/validate-array-item-fields.
|
|
|
2
2
|
import { getXComponentProps } from "../../utils/get-x-component-props.js";
|
|
3
3
|
import "../../utils/index.js";
|
|
4
4
|
import { ArrayBase } from "../array-base/array-base.js";
|
|
5
|
-
import { useArrayComponents } from "../array-base/component-context.js";
|
|
6
5
|
import "../array-base/index.js";
|
|
6
|
+
import { ArrayItemHeaderRow } from "../array-common/array-item-header-row.js";
|
|
7
7
|
import { ItemWrapper } from "../array-common/item-wrapper.js";
|
|
8
8
|
import "../array-common/index.js";
|
|
9
9
|
import { RecursionField, useField, useFieldSchema } from "@formily/react";
|
|
@@ -17,7 +17,6 @@ const ArrayCollapseItem = React.memo((props) => {
|
|
|
17
17
|
const { index, itemId, formCollapse, isOpen, isNewItem, onClick } = props;
|
|
18
18
|
const field = useField();
|
|
19
19
|
const schema = useFieldSchema();
|
|
20
|
-
const { ItemLabel, OperationComponents } = useArrayComponents();
|
|
21
20
|
const items = Array.isArray(schema.items) ? schema.items[0] ?? schema.items : schema.items;
|
|
22
21
|
const itemWrapperProps = getXComponentProps(items);
|
|
23
22
|
React.useEffect(() => {
|
|
@@ -40,32 +39,19 @@ const ArrayCollapseItem = React.memo((props) => {
|
|
|
40
39
|
}), /* @__PURE__ */ jsxs(ItemWrapper, {
|
|
41
40
|
...itemWrapperProps,
|
|
42
41
|
index,
|
|
43
|
-
children: [/* @__PURE__ */
|
|
44
|
-
className: "
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
className: "text-foreground flex items-center gap-2 font-medium",
|
|
57
|
-
children: [/* @__PURE__ */ jsx(ChevronDownIcon, { className: cn("size-4 shrink-0 transition-transform duration-200", isOpen && "rotate-180") }), /* @__PURE__ */ jsx(ItemLabel, {
|
|
58
|
-
schema,
|
|
59
|
-
index
|
|
60
|
-
})]
|
|
61
|
-
})
|
|
62
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
63
|
-
className: "flex items-center gap-1",
|
|
64
|
-
children: /* @__PURE__ */ jsx(OperationComponents, {
|
|
65
|
-
schema,
|
|
66
|
-
index
|
|
67
|
-
})
|
|
68
|
-
})]
|
|
42
|
+
children: [/* @__PURE__ */ jsx(ArrayItemHeaderRow, {
|
|
43
|
+
className: "px-3",
|
|
44
|
+
schema,
|
|
45
|
+
index,
|
|
46
|
+
contentClassName: "hover:no-underline py-4 text-sm font-medium transition-all text-foreground",
|
|
47
|
+
leading: /* @__PURE__ */ jsx(ChevronDownIcon, { className: cn("size-4 shrink-0 transition-transform duration-200", isOpen && "rotate-180") }),
|
|
48
|
+
buttonProps: { onClick: () => {
|
|
49
|
+
onClick?.();
|
|
50
|
+
if (formCollapse.hasActiveKey(itemId)) validateArrayItemFields(field, index).then(() => {
|
|
51
|
+
formCollapse.removeActiveKey(itemId);
|
|
52
|
+
}).catch(() => {});
|
|
53
|
+
else formCollapse.addActiveKey(itemId);
|
|
54
|
+
} }
|
|
69
55
|
}), isOpen && items && /* @__PURE__ */ jsx("div", {
|
|
70
56
|
className: "border-t px-3 pb-4",
|
|
71
57
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_component_context = require('../array-base/component-context.cjs');
|
|
3
|
+
require('../array-base/index.cjs');
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
8
|
+
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
9
|
+
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
10
|
+
|
|
11
|
+
//#region src/components/array-common/array-item-header-row.tsx
|
|
12
|
+
const ArrayItemHeaderRow = react.default.memo(({ schema, index, className, contentClassName, operationsClassName, leading, label, operations, buttonProps, showOperations = true }) => {
|
|
13
|
+
const { ItemLabel, OperationComponents } = require_component_context.useArrayComponents();
|
|
14
|
+
const labelNode = label ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItemLabel, {
|
|
15
|
+
schema,
|
|
16
|
+
index
|
|
17
|
+
});
|
|
18
|
+
const operationsNode = operations ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OperationComponents, {
|
|
19
|
+
schema,
|
|
20
|
+
index
|
|
21
|
+
});
|
|
22
|
+
const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [leading, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23
|
+
className: "min-w-0 flex-1",
|
|
24
|
+
children: labelNode
|
|
25
|
+
})] });
|
|
26
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
27
|
+
className: (0, __pixpilot_shadcn.cn)("flex items-center gap-2", className),
|
|
28
|
+
children: [buttonProps ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
29
|
+
...buttonProps,
|
|
30
|
+
type: buttonProps.type ?? "button",
|
|
31
|
+
className: (0, __pixpilot_shadcn.cn)("flex flex-1 min-w-0 items-center gap-2", contentClassName, buttonProps.className),
|
|
32
|
+
children: content
|
|
33
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
34
|
+
className: (0, __pixpilot_shadcn.cn)("flex flex-1 min-w-0 items-center gap-2", contentClassName),
|
|
35
|
+
children: content
|
|
36
|
+
}), showOperations && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
37
|
+
className: (0, __pixpilot_shadcn.cn)("flex items-center gap-1 shrink-0", operationsClassName),
|
|
38
|
+
children: operationsNode
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
ArrayItemHeaderRow.displayName = "ArrayItemHeaderRow";
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
exports.ArrayItemHeaderRow = ArrayItemHeaderRow;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useArrayComponents } from "../array-base/component-context.js";
|
|
2
|
+
import "../array-base/index.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { cn } from "@pixpilot/shadcn";
|
|
6
|
+
|
|
7
|
+
//#region src/components/array-common/array-item-header-row.tsx
|
|
8
|
+
const ArrayItemHeaderRow = React.memo(({ schema, index, className, contentClassName, operationsClassName, leading, label, operations, buttonProps, showOperations = true }) => {
|
|
9
|
+
const { ItemLabel, OperationComponents } = useArrayComponents();
|
|
10
|
+
const labelNode = label ?? /* @__PURE__ */ jsx(ItemLabel, {
|
|
11
|
+
schema,
|
|
12
|
+
index
|
|
13
|
+
});
|
|
14
|
+
const operationsNode = operations ?? /* @__PURE__ */ jsx(OperationComponents, {
|
|
15
|
+
schema,
|
|
16
|
+
index
|
|
17
|
+
});
|
|
18
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [leading, /* @__PURE__ */ jsx("div", {
|
|
19
|
+
className: "min-w-0 flex-1",
|
|
20
|
+
children: labelNode
|
|
21
|
+
})] });
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
23
|
+
className: cn("flex items-center gap-2", className),
|
|
24
|
+
children: [buttonProps ? /* @__PURE__ */ jsx("button", {
|
|
25
|
+
...buttonProps,
|
|
26
|
+
type: buttonProps.type ?? "button",
|
|
27
|
+
className: cn("flex flex-1 min-w-0 items-center gap-2", contentClassName, buttonProps.className),
|
|
28
|
+
children: content
|
|
29
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
30
|
+
className: cn("flex flex-1 min-w-0 items-center gap-2", contentClassName),
|
|
31
|
+
children: content
|
|
32
|
+
}), showOperations && /* @__PURE__ */ jsx("div", {
|
|
33
|
+
className: cn("flex items-center gap-1 shrink-0", operationsClassName),
|
|
34
|
+
children: operationsNode
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
ArrayItemHeaderRow.displayName = "ArrayItemHeaderRow";
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
export { ArrayItemHeaderRow };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_array_base = require('../array-base/array-base.cjs');
|
|
3
|
-
const require_component_context = require('../array-base/component-context.cjs');
|
|
4
3
|
require('../array-base/index.cjs');
|
|
4
|
+
const require_array_item_header_row = require('./array-item-header-row.cjs');
|
|
5
5
|
const require_item_wrapper = require('./item-wrapper.cjs');
|
|
6
6
|
let __formily_react = require("@formily/react");
|
|
7
7
|
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
@@ -19,7 +19,6 @@ __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
|
19
19
|
*/
|
|
20
20
|
const ListItem = react.default.memo(({ itemKey, index, record, isNew }) => {
|
|
21
21
|
const schema = (0, __formily_react.useFieldSchema)();
|
|
22
|
-
const { OperationComponents, ItemLabel } = require_component_context.useArrayComponents();
|
|
23
22
|
const isNewItem = isNew;
|
|
24
23
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_array_base.ArrayBase.Item, {
|
|
25
24
|
index,
|
|
@@ -30,22 +29,14 @@ const ListItem = react.default.memo(({ itemKey, index, record, isNew }) => {
|
|
|
30
29
|
schema: schema.items,
|
|
31
30
|
name: index
|
|
32
31
|
})
|
|
33
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
34
|
-
className: (0, __pixpilot_shadcn.cn)("
|
|
32
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_item_wrapper.ItemWrapper, {
|
|
33
|
+
className: (0, __pixpilot_shadcn.cn)("px-3 pl-4 py-2", isNewItem && "hidden"),
|
|
35
34
|
index,
|
|
36
|
-
children:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
})
|
|
42
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
43
|
-
className: "flex items-center gap-1",
|
|
44
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OperationComponents, {
|
|
45
|
-
schema,
|
|
46
|
-
index
|
|
47
|
-
})
|
|
48
|
-
})]
|
|
35
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_array_item_header_row.ArrayItemHeaderRow, {
|
|
36
|
+
schema,
|
|
37
|
+
index,
|
|
38
|
+
contentClassName: "text-foreground font-medium"
|
|
39
|
+
})
|
|
49
40
|
})]
|
|
50
41
|
}, itemKey);
|
|
51
42
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ArrayBase } from "../array-base/array-base.js";
|
|
2
|
-
import { useArrayComponents } from "../array-base/component-context.js";
|
|
3
2
|
import "../array-base/index.js";
|
|
3
|
+
import { ArrayItemHeaderRow } from "./array-item-header-row.js";
|
|
4
4
|
import { ItemWrapper } from "./item-wrapper.js";
|
|
5
5
|
import { RecursionField, useFieldSchema } from "@formily/react";
|
|
6
6
|
import React from "react";
|
|
@@ -14,7 +14,6 @@ import { cn } from "@pixpilot/shadcn";
|
|
|
14
14
|
*/
|
|
15
15
|
const ListItem = React.memo(({ itemKey, index, record, isNew }) => {
|
|
16
16
|
const schema = useFieldSchema();
|
|
17
|
-
const { OperationComponents, ItemLabel } = useArrayComponents();
|
|
18
17
|
const isNewItem = isNew;
|
|
19
18
|
return /* @__PURE__ */ jsxs(ArrayBase.Item, {
|
|
20
19
|
index,
|
|
@@ -25,22 +24,14 @@ const ListItem = React.memo(({ itemKey, index, record, isNew }) => {
|
|
|
25
24
|
schema: schema.items,
|
|
26
25
|
name: index
|
|
27
26
|
})
|
|
28
|
-
}), /* @__PURE__ */
|
|
29
|
-
className: cn("
|
|
27
|
+
}), /* @__PURE__ */ jsx(ItemWrapper, {
|
|
28
|
+
className: cn("px-3 pl-4 py-2", isNewItem && "hidden"),
|
|
30
29
|
index,
|
|
31
|
-
children:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})
|
|
37
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
38
|
-
className: "flex items-center gap-1",
|
|
39
|
-
children: /* @__PURE__ */ jsx(OperationComponents, {
|
|
40
|
-
schema,
|
|
41
|
-
index
|
|
42
|
-
})
|
|
43
|
-
})]
|
|
30
|
+
children: /* @__PURE__ */ jsx(ArrayItemHeaderRow, {
|
|
31
|
+
schema,
|
|
32
|
+
index,
|
|
33
|
+
contentClassName: "text-foreground font-medium"
|
|
34
|
+
})
|
|
44
35
|
})]
|
|
45
36
|
}, itemKey);
|
|
46
37
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react0 from "react";
|
|
2
2
|
import * as _radix_ui_react_checkbox0 from "@radix-ui/react-checkbox";
|
|
3
3
|
|
|
4
4
|
//#region src/components/checkbox.d.ts
|
|
@@ -6,6 +6,6 @@ import * as _radix_ui_react_checkbox0 from "@radix-ui/react-checkbox";
|
|
|
6
6
|
* Formily-connected Checkbox component
|
|
7
7
|
* Maps Formily field checked state to shadcn Checkbox
|
|
8
8
|
*/
|
|
9
|
-
declare const Checkbox:
|
|
9
|
+
declare const Checkbox: react0.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_checkbox0.CheckboxProps & react0.RefAttributes<HTMLButtonElement>>, "ref"> & react0.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Checkbox };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/column.d.ts
|
|
5
5
|
interface IColumnProps {
|
|
@@ -36,6 +36,6 @@ interface IColumnProps {
|
|
|
36
36
|
declare function Column({
|
|
37
37
|
className,
|
|
38
38
|
children
|
|
39
|
-
}: IColumnProps):
|
|
39
|
+
}: IColumnProps): react_jsx_runtime0.JSX.Element;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { Column };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react2 from "react";
|
|
2
2
|
import { DatePickerProps } from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/date-picker.d.ts
|
|
5
|
-
declare const DatePicker:
|
|
5
|
+
declare const DatePicker: react2.ForwardRefExoticComponent<Partial<{
|
|
6
6
|
value?: Date;
|
|
7
7
|
onChange?: (date: Date | undefined) => void;
|
|
8
8
|
placeholder?: string;
|
|
9
|
-
} & Omit<DatePickerProps, "onSelect" | "selected" | "mode">> &
|
|
9
|
+
} & Omit<DatePickerProps, "onSelect" | "selected" | "mode">> & react2.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { DatePicker };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react2 from "react";
|
|
2
2
|
import { DatePickerProps } from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/date-picker.d.ts
|
|
5
|
-
declare const DatePicker$1:
|
|
5
|
+
declare const DatePicker$1: react2.ForwardRefExoticComponent<Partial<{
|
|
6
6
|
value?: Date;
|
|
7
7
|
onChange?: (date: Date | undefined) => void;
|
|
8
8
|
placeholder?: string;
|
|
9
|
-
} & Omit<DatePickerProps, "onSelect" | "selected" | "mode">> &
|
|
9
|
+
} & Omit<DatePickerProps, "onSelect" | "selected" | "mode">> & react2.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { DatePicker$1 as DatePicker };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _pixpilot_shadcn_ui306 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/file-upload/file-upload-inline.d.ts
|
|
5
5
|
|
|
@@ -7,14 +7,14 @@ import * as _pixpilot_shadcn_ui1 from "@pixpilot/shadcn-ui";
|
|
|
7
7
|
* Formily-connected FileUploadInline component
|
|
8
8
|
* Automatically connects shadcn FileUploadInline to Formily field state
|
|
9
9
|
*/
|
|
10
|
-
declare const FileUploadInline: React.ForwardRefExoticComponent<(Omit<Partial<
|
|
10
|
+
declare const FileUploadInline: React.ForwardRefExoticComponent<(Omit<Partial<_pixpilot_shadcn_ui306.FileUploadInlineBaseProps & {
|
|
11
11
|
multiple: true;
|
|
12
|
-
value?:
|
|
13
|
-
onChange?:
|
|
14
|
-
} &
|
|
12
|
+
value?: _pixpilot_shadcn_ui306.FileMetadata[];
|
|
13
|
+
onChange?: _pixpilot_shadcn_ui306.OnChangeMultipleFiles;
|
|
14
|
+
} & _pixpilot_shadcn_ui306.FileUploadBaseProps>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui306.FileUploadInlineBaseProps & {
|
|
15
15
|
multiple?: false;
|
|
16
|
-
value?:
|
|
17
|
-
onChange?:
|
|
18
|
-
} &
|
|
16
|
+
value?: _pixpilot_shadcn_ui306.FileMetadata | null;
|
|
17
|
+
onChange?: _pixpilot_shadcn_ui306.OnChangeSingleFile;
|
|
18
|
+
} & _pixpilot_shadcn_ui306.FileUploadBaseProps>, "ref">) & React.RefAttributes<unknown>>;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { FileUploadInline };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _pixpilot_shadcn_ui1 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/file-upload/file-upload-inline.d.ts
|
|
5
5
|
|
|
@@ -7,14 +7,14 @@ import * as _pixpilot_shadcn_ui400 from "@pixpilot/shadcn-ui";
|
|
|
7
7
|
* Formily-connected FileUploadInline component
|
|
8
8
|
* Automatically connects shadcn FileUploadInline to Formily field state
|
|
9
9
|
*/
|
|
10
|
-
declare const FileUploadInline$1: React.ForwardRefExoticComponent<(Omit<Partial<
|
|
10
|
+
declare const FileUploadInline$1: React.ForwardRefExoticComponent<(Omit<Partial<_pixpilot_shadcn_ui1.FileUploadInlineBaseProps & {
|
|
11
11
|
multiple: true;
|
|
12
|
-
value?:
|
|
13
|
-
onChange?:
|
|
14
|
-
} &
|
|
12
|
+
value?: _pixpilot_shadcn_ui1.FileMetadata[];
|
|
13
|
+
onChange?: _pixpilot_shadcn_ui1.OnChangeMultipleFiles;
|
|
14
|
+
} & _pixpilot_shadcn_ui1.FileUploadBaseProps>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui1.FileUploadInlineBaseProps & {
|
|
15
15
|
multiple?: false;
|
|
16
|
-
value?:
|
|
17
|
-
onChange?:
|
|
18
|
-
} &
|
|
16
|
+
value?: _pixpilot_shadcn_ui1.FileMetadata | null;
|
|
17
|
+
onChange?: _pixpilot_shadcn_ui1.OnChangeSingleFile;
|
|
18
|
+
} & _pixpilot_shadcn_ui1.FileUploadBaseProps>, "ref">) & React.RefAttributes<unknown>>;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { FileUploadInline$1 as FileUploadInline };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _pixpilot_shadcn_ui1 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/file-upload/file-upload.d.ts
|
|
5
5
|
|
|
@@ -7,14 +7,14 @@ import * as _pixpilot_shadcn_ui9 from "@pixpilot/shadcn-ui";
|
|
|
7
7
|
* Formily-connected FileUploadInline component
|
|
8
8
|
* Automatically connects shadcn FileUploadInline to Formily field state
|
|
9
9
|
*/
|
|
10
|
-
declare const FileUpload: React.ForwardRefExoticComponent<(Omit<Partial<
|
|
10
|
+
declare const FileUpload: React.ForwardRefExoticComponent<(Omit<Partial<_pixpilot_shadcn_ui1.FileUploadInlineBaseProps & {
|
|
11
11
|
multiple: true;
|
|
12
|
-
value?:
|
|
13
|
-
onChange?:
|
|
14
|
-
} &
|
|
12
|
+
value?: _pixpilot_shadcn_ui1.FileMetadata[];
|
|
13
|
+
onChange?: _pixpilot_shadcn_ui1.OnChangeMultipleFiles;
|
|
14
|
+
} & _pixpilot_shadcn_ui1.FileUploadBaseProps>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui1.FileUploadInlineBaseProps & {
|
|
15
15
|
multiple?: false;
|
|
16
|
-
value?:
|
|
17
|
-
onChange?:
|
|
18
|
-
} &
|
|
16
|
+
value?: _pixpilot_shadcn_ui1.FileMetadata | null;
|
|
17
|
+
onChange?: _pixpilot_shadcn_ui1.OnChangeSingleFile;
|
|
18
|
+
} & _pixpilot_shadcn_ui1.FileUploadBaseProps>, "ref">) & React.RefAttributes<unknown>>;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { FileUpload };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _pixpilot_shadcn_ui9 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/file-upload/file-upload.d.ts
|
|
5
5
|
|
|
@@ -7,14 +7,14 @@ import * as _pixpilot_shadcn_ui408 from "@pixpilot/shadcn-ui";
|
|
|
7
7
|
* Formily-connected FileUploadInline component
|
|
8
8
|
* Automatically connects shadcn FileUploadInline to Formily field state
|
|
9
9
|
*/
|
|
10
|
-
declare const FileUpload$1: React.ForwardRefExoticComponent<(Omit<Partial<
|
|
10
|
+
declare const FileUpload$1: React.ForwardRefExoticComponent<(Omit<Partial<_pixpilot_shadcn_ui9.FileUploadInlineBaseProps & {
|
|
11
11
|
multiple: true;
|
|
12
|
-
value?:
|
|
13
|
-
onChange?:
|
|
14
|
-
} &
|
|
12
|
+
value?: _pixpilot_shadcn_ui9.FileMetadata[];
|
|
13
|
+
onChange?: _pixpilot_shadcn_ui9.OnChangeMultipleFiles;
|
|
14
|
+
} & _pixpilot_shadcn_ui9.FileUploadBaseProps>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui9.FileUploadInlineBaseProps & {
|
|
15
15
|
multiple?: false;
|
|
16
|
-
value?:
|
|
17
|
-
onChange?:
|
|
18
|
-
} &
|
|
16
|
+
value?: _pixpilot_shadcn_ui9.FileMetadata | null;
|
|
17
|
+
onChange?: _pixpilot_shadcn_ui9.OnChangeSingleFile;
|
|
18
|
+
} & _pixpilot_shadcn_ui9.FileUploadBaseProps>, "ref">) & React.RefAttributes<unknown>>;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { FileUpload$1 as FileUpload };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/form-grid.d.ts
|
|
5
5
|
interface IFormGridProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
@@ -7,6 +7,6 @@ declare function FormGrid({
|
|
|
7
7
|
className,
|
|
8
8
|
children,
|
|
9
9
|
...rest
|
|
10
|
-
}: IFormGridProps):
|
|
10
|
+
}: IFormGridProps): react_jsx_runtime0.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { FormGrid };
|