@wordrhyme/auto-crud 1.14.1 → 1.14.2
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/README.md +2 -0
- package/dist/index.cjs +4 -9
- package/dist/index.d.cts +16 -16
- package/dist/index.js +4 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1788,6 +1788,8 @@ does not control detail layout, even with `view.presentation: 'table'`.
|
|
|
1788
1788
|
`view.overrides[field].index` takes precedence for detail-only ordering. Fields
|
|
1789
1789
|
hidden only in forms remain available in details; use detail ordering to place
|
|
1790
1790
|
read-only business fields next to related information or audit fields at the end.
|
|
1791
|
+
Field spans come from the shared form configuration; details do not expand arrays,
|
|
1792
|
+
objects or long-text fields to a full row automatically.
|
|
1791
1793
|
|
|
1792
1794
|
```tsx
|
|
1793
1795
|
<AutoCrudTable
|
package/dist/index.cjs
CHANGED
|
@@ -6268,15 +6268,10 @@ function AutoFormInner({ schema: zodSchema, initialValues, onSubmit, fields, ove
|
|
|
6268
6268
|
className: (0, __wordrhyme_shadcn.cn)(grid["x-component-props"]?.className, "gap-x-10 gap-y-7 py-2")
|
|
6269
6269
|
};
|
|
6270
6270
|
const properties = typeof grid.properties === "object" ? grid.properties : {};
|
|
6271
|
-
for (const property of Object.values(properties)) {
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
colon: false,
|
|
6276
|
-
...decoratorProps,
|
|
6277
|
-
className: (0, __wordrhyme_shadcn.cn)(fullWidth && decoratorProps?.gridSpan == null && "col-span-full", decoratorProps?.className)
|
|
6278
|
-
};
|
|
6279
|
-
}
|
|
6271
|
+
for (const property of Object.values(properties)) property["x-decorator-props"] = {
|
|
6272
|
+
colon: false,
|
|
6273
|
+
...property["x-decorator-props"]
|
|
6274
|
+
};
|
|
6280
6275
|
}
|
|
6281
6276
|
applyDataSourceReactions(nextSchema, mode === "view");
|
|
6282
6277
|
return nextSchema;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as positionActions, i as matchesPosition, n as actionPositionSchema, r as compareOrder, t as ActionPosition } from "./position-DoBV7yB6.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import { ComponentProps, ReactNode } from "react";
|
|
5
5
|
import * as _tanstack_react_table0 from "@tanstack/react-table";
|
|
@@ -676,7 +676,7 @@ declare function DataTable<TData>({
|
|
|
676
676
|
className,
|
|
677
677
|
classNames,
|
|
678
678
|
...props
|
|
679
|
-
}: DataTableProps<TData>):
|
|
679
|
+
}: DataTableProps<TData>): react_jsx_runtime8.JSX.Element;
|
|
680
680
|
//#endregion
|
|
681
681
|
//#region src/components/auto-crud/auto-table-action-bar.d.ts
|
|
682
682
|
/** 批量更新字段配置 */
|
|
@@ -765,7 +765,7 @@ declare function AutoTableActionBar<TData>({
|
|
|
765
765
|
extraActions,
|
|
766
766
|
actions,
|
|
767
767
|
deleteConfirmation
|
|
768
|
-
}: AutoTableActionBarProps<TData>):
|
|
768
|
+
}: AutoTableActionBarProps<TData>): react_jsx_runtime8.JSX.Element;
|
|
769
769
|
//#endregion
|
|
770
770
|
//#region src/lib/schema-bridge/types.d.ts
|
|
771
771
|
/**
|
|
@@ -1109,7 +1109,7 @@ declare function AutoTable<T extends z.ZodObject<z.ZodRawShape>>({
|
|
|
1109
1109
|
onSelectedRowsChange,
|
|
1110
1110
|
getSelectedRows,
|
|
1111
1111
|
exportTableRef
|
|
1112
|
-
}: AutoTableProps<T>):
|
|
1112
|
+
}: AutoTableProps<T>): react_jsx_runtime8.JSX.Element;
|
|
1113
1113
|
//#endregion
|
|
1114
1114
|
//#region src/components/auto-crud/auto-form.d.ts
|
|
1115
1115
|
type AutoFormProps<T extends z.ZodObject<z.ZodRawShape>> = {
|
|
@@ -1152,7 +1152,7 @@ declare function AutoFormInner<T extends z.ZodObject<z.ZodRawShape>>({
|
|
|
1152
1152
|
labelAlign,
|
|
1153
1153
|
labelWidth,
|
|
1154
1154
|
showSubmitButton
|
|
1155
|
-
}: AutoFormProps<T>, ref: React.Ref<AutoFormRef>):
|
|
1155
|
+
}: AutoFormProps<T>, ref: React.Ref<AutoFormRef>): react_jsx_runtime8.JSX.Element;
|
|
1156
1156
|
declare const AutoForm: <T extends z.ZodObject<z.ZodRawShape>>(props: AutoFormProps<T> & {
|
|
1157
1157
|
ref?: React.Ref<AutoFormRef>;
|
|
1158
1158
|
}) => ReturnType<typeof AutoFormInner>;
|
|
@@ -1622,7 +1622,7 @@ declare function AutoCrudTable<TSchema extends z.ZodObject<z.ZodRawShape>>({
|
|
|
1622
1622
|
locale: localeProp,
|
|
1623
1623
|
onCreate,
|
|
1624
1624
|
onExport
|
|
1625
|
-
}: AutoCrudTableProps<TSchema>):
|
|
1625
|
+
}: AutoCrudTableProps<TSchema>): react_jsx_runtime8.JSX.Element;
|
|
1626
1626
|
//#endregion
|
|
1627
1627
|
//#region src/components/auto-crud/auto-table-simple-filters.d.ts
|
|
1628
1628
|
interface AutoTableSimpleFiltersProps<TData> {
|
|
@@ -1638,7 +1638,7 @@ declare function AutoTableSimpleFilters<TData>({
|
|
|
1638
1638
|
filters: externalFilters,
|
|
1639
1639
|
onFiltersChange,
|
|
1640
1640
|
leading
|
|
1641
|
-
}: AutoTableSimpleFiltersProps<TData>):
|
|
1641
|
+
}: AutoTableSimpleFiltersProps<TData>): react_jsx_runtime8.JSX.Element | null;
|
|
1642
1642
|
//#endregion
|
|
1643
1643
|
//#region src/components/auto-crud/form-modal.d.ts
|
|
1644
1644
|
type ModalVariant = 'dialog' | 'sheet';
|
|
@@ -1687,7 +1687,7 @@ declare function CrudFormModal<T extends z.ZodObject<z.ZodRawShape>>({
|
|
|
1687
1687
|
labelAlign,
|
|
1688
1688
|
labelWidth,
|
|
1689
1689
|
className
|
|
1690
|
-
}: CrudFormModalProps<T> & CrudFormModalMode<T>):
|
|
1690
|
+
}: CrudFormModalProps<T> & CrudFormModalMode<T>): react_jsx_runtime8.JSX.Element;
|
|
1691
1691
|
//#endregion
|
|
1692
1692
|
//#region src/components/auto-crud/import-dialog.d.ts
|
|
1693
1693
|
interface ImportDialogProps {
|
|
@@ -1709,7 +1709,7 @@ declare function ImportDialog({
|
|
|
1709
1709
|
columns,
|
|
1710
1710
|
title,
|
|
1711
1711
|
locale
|
|
1712
|
-
}: ImportDialogProps):
|
|
1712
|
+
}: ImportDialogProps): react_jsx_runtime8.JSX.Element;
|
|
1713
1713
|
//#endregion
|
|
1714
1714
|
//#region src/components/auto-crud/export-dialog.d.ts
|
|
1715
1715
|
type ExportMode = 'selected' | 'filtered';
|
|
@@ -1729,7 +1729,7 @@ declare function ExportDialog({
|
|
|
1729
1729
|
selectedCount,
|
|
1730
1730
|
onExport,
|
|
1731
1731
|
canExportFiltered
|
|
1732
|
-
}: ExportDialogProps):
|
|
1732
|
+
}: ExportDialogProps): react_jsx_runtime8.JSX.Element;
|
|
1733
1733
|
//#endregion
|
|
1734
1734
|
//#region src/components/data-table/data-table-advanced-toolbar.d.ts
|
|
1735
1735
|
interface DataTableAdvancedToolbarProps<TData> extends React$1.ComponentProps<'div'> {
|
|
@@ -1740,7 +1740,7 @@ declare function DataTableAdvancedToolbar<TData>({
|
|
|
1740
1740
|
children,
|
|
1741
1741
|
className,
|
|
1742
1742
|
...props
|
|
1743
|
-
}: DataTableAdvancedToolbarProps<TData>):
|
|
1743
|
+
}: DataTableAdvancedToolbarProps<TData>): react_jsx_runtime8.JSX.Element;
|
|
1744
1744
|
//#endregion
|
|
1745
1745
|
//#region src/components/data-table/data-table-column-header.d.ts
|
|
1746
1746
|
interface DataTableColumnHeaderProps<TData, TValue> extends React.ComponentProps<typeof DropdownMenuTrigger> {
|
|
@@ -1752,7 +1752,7 @@ declare function DataTableColumnHeader<TData, TValue>({
|
|
|
1752
1752
|
label,
|
|
1753
1753
|
className,
|
|
1754
1754
|
...props
|
|
1755
|
-
}: DataTableColumnHeaderProps<TData, TValue>):
|
|
1755
|
+
}: DataTableColumnHeaderProps<TData, TValue>): react_jsx_runtime8.JSX.Element;
|
|
1756
1756
|
//#endregion
|
|
1757
1757
|
//#region src/components/data-table/data-table-faceted-filter.d.ts
|
|
1758
1758
|
interface DataTableFacetedFilterProps<TData, TValue> {
|
|
@@ -1766,7 +1766,7 @@ declare function DataTableFacetedFilter<TData, TValue>({
|
|
|
1766
1766
|
title,
|
|
1767
1767
|
options,
|
|
1768
1768
|
multiple
|
|
1769
|
-
}: DataTableFacetedFilterProps<TData, TValue>):
|
|
1769
|
+
}: DataTableFacetedFilterProps<TData, TValue>): react_jsx_runtime8.JSX.Element;
|
|
1770
1770
|
//#endregion
|
|
1771
1771
|
//#region src/components/data-table/data-table-pagination.d.ts
|
|
1772
1772
|
interface DataTablePaginationProps<TData> extends React.ComponentProps<'div'>, TablePaginationOptions {
|
|
@@ -1782,7 +1782,7 @@ declare function DataTablePagination<TData>({
|
|
|
1782
1782
|
pageJumpLabel,
|
|
1783
1783
|
className,
|
|
1784
1784
|
...props
|
|
1785
|
-
}: DataTablePaginationProps<TData>):
|
|
1785
|
+
}: DataTablePaginationProps<TData>): react_jsx_runtime8.JSX.Element;
|
|
1786
1786
|
//#endregion
|
|
1787
1787
|
//#region src/components/data-table/data-table-toolbar.d.ts
|
|
1788
1788
|
interface DataTableToolbarProps<TData> extends React$1.ComponentProps<'div'> {
|
|
@@ -1793,7 +1793,7 @@ declare function DataTableToolbar<TData>({
|
|
|
1793
1793
|
children,
|
|
1794
1794
|
className,
|
|
1795
1795
|
...props
|
|
1796
|
-
}: DataTableToolbarProps<TData>):
|
|
1796
|
+
}: DataTableToolbarProps<TData>): react_jsx_runtime8.JSX.Element;
|
|
1797
1797
|
//#endregion
|
|
1798
1798
|
//#region src/components/data-table/data-table-view-options.d.ts
|
|
1799
1799
|
interface DataTableViewOptionsProps<TData> extends PopoverContentProps {
|
|
@@ -1806,7 +1806,7 @@ declare function DataTableViewOptions<TData>({
|
|
|
1806
1806
|
disabled,
|
|
1807
1807
|
locale,
|
|
1808
1808
|
...props
|
|
1809
|
-
}: DataTableViewOptionsProps<TData>):
|
|
1809
|
+
}: DataTableViewOptionsProps<TData>): react_jsx_runtime8.JSX.Element;
|
|
1810
1810
|
//#endregion
|
|
1811
1811
|
//#region src/lib/crud-actions.d.ts
|
|
1812
1812
|
type CrudActionZone = 'toolbar' | 'row' | 'batch';
|
package/dist/index.js
CHANGED
|
@@ -6252,15 +6252,10 @@ function AutoFormInner({ schema: zodSchema, initialValues, onSubmit, fields, ove
|
|
|
6252
6252
|
className: cn$1(grid["x-component-props"]?.className, "gap-x-10 gap-y-7 py-2")
|
|
6253
6253
|
};
|
|
6254
6254
|
const properties = typeof grid.properties === "object" ? grid.properties : {};
|
|
6255
|
-
for (const property of Object.values(properties)) {
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
colon: false,
|
|
6260
|
-
...decoratorProps,
|
|
6261
|
-
className: cn$1(fullWidth && decoratorProps?.gridSpan == null && "col-span-full", decoratorProps?.className)
|
|
6262
|
-
};
|
|
6263
|
-
}
|
|
6255
|
+
for (const property of Object.values(properties)) property["x-decorator-props"] = {
|
|
6256
|
+
colon: false,
|
|
6257
|
+
...property["x-decorator-props"]
|
|
6258
|
+
};
|
|
6264
6259
|
}
|
|
6265
6260
|
applyDataSourceReactions(nextSchema, mode === "view");
|
|
6266
6261
|
return nextSchema;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordrhyme/auto-crud",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.14.
|
|
4
|
+
"version": "1.14.2",
|
|
5
5
|
"description": "Schema-first CRUD components with auto-generated tables and forms",
|
|
6
6
|
"author": "wordrhyme",
|
|
7
7
|
"license": "MIT",
|
|
@@ -96,9 +96,9 @@
|
|
|
96
96
|
"vitest": "^3.2.4",
|
|
97
97
|
"@internal/eslint-config": "0.3.0",
|
|
98
98
|
"@internal/tsconfig": "0.1.0",
|
|
99
|
-
"@internal/prettier-config": "0.0.1",
|
|
100
99
|
"@internal/tsdown-config": "0.1.0",
|
|
101
|
-
"@internal/vitest-config": "0.1.0"
|
|
100
|
+
"@internal/vitest-config": "0.1.0",
|
|
101
|
+
"@internal/prettier-config": "0.0.1"
|
|
102
102
|
},
|
|
103
103
|
"prettier": "@internal/prettier-config",
|
|
104
104
|
"scripts": {
|