@wordrhyme/auto-crud 1.2.4 → 1.2.5
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 +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +21 -21
- package/dist/index.d.ts +21 -21
- package/dist/index.js +2 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -696,10 +696,10 @@ type ToolbarCustomActionItem = {
|
|
|
696
696
|
|
|
697
697
|
### 工具栏扩展 Resolver
|
|
698
698
|
|
|
699
|
-
宿主应用可以通过 `
|
|
699
|
+
宿主应用可以通过 `setToolbarResolver` 为指定 CRUD 注入额外工具栏动作。resolver 是普通纯函数,不是 React Hook;不要在 resolver 内调用 `useRouter`、`useMemo` 等 React Hooks。
|
|
700
700
|
|
|
701
701
|
```tsx
|
|
702
|
-
import { AutoCrudTable,
|
|
702
|
+
import { AutoCrudTable, setToolbarResolver } from '@wordrhyme/auto-crud';
|
|
703
703
|
import type { AutoCrudToolbarResolver } from '@wordrhyme/auto-crud';
|
|
704
704
|
|
|
705
705
|
const toolbarResolver: AutoCrudToolbarResolver = (targetId, ownerActions, context) => {
|
|
@@ -714,7 +714,7 @@ const toolbarResolver: AutoCrudToolbarResolver = (targetId, ownerActions, contex
|
|
|
714
714
|
];
|
|
715
715
|
};
|
|
716
716
|
|
|
717
|
-
|
|
717
|
+
setToolbarResolver(toolbarResolver);
|
|
718
718
|
```
|
|
719
719
|
|
|
720
720
|
---
|
package/dist/index.cjs
CHANGED
|
@@ -6287,7 +6287,7 @@ function ImportDialog({ open, onOpenChange, onImport, columns = [], title, local
|
|
|
6287
6287
|
//#endregion
|
|
6288
6288
|
//#region src/components/auto-crud/auto-crud-table.tsx
|
|
6289
6289
|
let autoCrudToolbarResolver = null;
|
|
6290
|
-
function
|
|
6290
|
+
function setToolbarResolver(resolver) {
|
|
6291
6291
|
autoCrudToolbarResolver = resolver;
|
|
6292
6292
|
}
|
|
6293
6293
|
function getDefaultToolbarActions() {
|
|
@@ -8450,8 +8450,8 @@ exports.parseImportFile = parseImportFile;
|
|
|
8450
8450
|
exports.parseJSON = parseJSON;
|
|
8451
8451
|
exports.parseZodField = parseZodField;
|
|
8452
8452
|
exports.resolveLocale = resolveLocale;
|
|
8453
|
-
exports.setAutoCrudToolbarResolver = setAutoCrudToolbarResolver;
|
|
8454
8453
|
exports.setSearchParams = setSearchParams;
|
|
8454
|
+
exports.setToolbarResolver = setToolbarResolver;
|
|
8455
8455
|
exports.useAutoCrudResource = useAutoCrudResource;
|
|
8456
8456
|
exports.useDataTable = useDataTable;
|
|
8457
8457
|
exports.useQueryState = useQueryState;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import * as _tanstack_react_table0 from "@tanstack/react-table";
|
|
4
4
|
import { Column, ColumnDef, ColumnSort, Row, RowData, Table, TableOptions, TableState } from "@tanstack/react-table";
|
|
@@ -364,7 +364,7 @@ declare function AutoTableActionBar<TData>({
|
|
|
364
364
|
enableDelete,
|
|
365
365
|
extraActions,
|
|
366
366
|
actions
|
|
367
|
-
}: AutoTableActionBarProps<TData>):
|
|
367
|
+
}: AutoTableActionBarProps<TData>): react_jsx_runtime1.JSX.Element;
|
|
368
368
|
//#endregion
|
|
369
369
|
//#region src/lib/schema-bridge/types.d.ts
|
|
370
370
|
/**
|
|
@@ -535,7 +535,7 @@ declare function AutoTable<T extends z.ZodObject<z.ZodRawShape>>({
|
|
|
535
535
|
onSelectedCountChange,
|
|
536
536
|
onSelectedRowsChange,
|
|
537
537
|
getSelectedRows
|
|
538
|
-
}: AutoTableProps<T>):
|
|
538
|
+
}: AutoTableProps<T>): react_jsx_runtime1.JSX.Element;
|
|
539
539
|
//#endregion
|
|
540
540
|
//#region src/i18n/locale.d.ts
|
|
541
541
|
/**
|
|
@@ -837,7 +837,7 @@ interface AutoCrudToolbarContext {
|
|
|
837
837
|
openCreate?: () => void;
|
|
838
838
|
}
|
|
839
839
|
type AutoCrudToolbarResolver = (targetId: string, ownerActions: readonly ToolbarActionItem[], context: AutoCrudToolbarContext) => ToolbarActionItem[];
|
|
840
|
-
declare function
|
|
840
|
+
declare function setToolbarResolver(resolver: AutoCrudToolbarResolver | null): void;
|
|
841
841
|
/**
|
|
842
842
|
* AutoCrudTable Props 接口
|
|
843
843
|
*/
|
|
@@ -965,7 +965,7 @@ declare function AutoCrudTable<TSchema extends z.ZodObject<z.ZodRawShape>>({
|
|
|
965
965
|
toolbarActions,
|
|
966
966
|
locale: localeProp,
|
|
967
967
|
onCreate
|
|
968
|
-
}: AutoCrudTableProps<TSchema>):
|
|
968
|
+
}: AutoCrudTableProps<TSchema>): react_jsx_runtime1.JSX.Element;
|
|
969
969
|
//#endregion
|
|
970
970
|
//#region src/components/auto-crud/auto-form.d.ts
|
|
971
971
|
interface AutoFormProps<T extends z.ZodObject<z.ZodRawShape>> {
|
|
@@ -997,7 +997,7 @@ declare function AutoFormInner<T extends z.ZodObject<z.ZodRawShape>>({
|
|
|
997
997
|
labelAlign,
|
|
998
998
|
labelWidth,
|
|
999
999
|
showSubmitButton
|
|
1000
|
-
}: AutoFormProps<T>, ref: React.Ref<AutoFormRef>):
|
|
1000
|
+
}: AutoFormProps<T>, ref: React.Ref<AutoFormRef>): react_jsx_runtime1.JSX.Element;
|
|
1001
1001
|
declare const AutoForm: <T extends z.ZodObject<z.ZodRawShape>>(props: AutoFormProps<T> & {
|
|
1002
1002
|
ref?: React.Ref<AutoFormRef>;
|
|
1003
1003
|
}) => ReturnType<typeof AutoFormInner>;
|
|
@@ -1211,12 +1211,12 @@ declare const filterItemSchema: z.ZodObject<{
|
|
|
1211
1211
|
variant: z.ZodEnum<{
|
|
1212
1212
|
number: "number";
|
|
1213
1213
|
boolean: "boolean";
|
|
1214
|
-
text: "text";
|
|
1215
|
-
range: "range";
|
|
1216
1214
|
date: "date";
|
|
1217
|
-
|
|
1215
|
+
text: "text";
|
|
1218
1216
|
select: "select";
|
|
1219
1217
|
multiSelect: "multiSelect";
|
|
1218
|
+
dateRange: "dateRange";
|
|
1219
|
+
range: "range";
|
|
1220
1220
|
}>;
|
|
1221
1221
|
operator: z.ZodEnum<{
|
|
1222
1222
|
iLike: "iLike";
|
|
@@ -1299,7 +1299,7 @@ declare function AutoTableSimpleFilters<TData>({
|
|
|
1299
1299
|
filters: externalFilters,
|
|
1300
1300
|
onFiltersChange,
|
|
1301
1301
|
leading
|
|
1302
|
-
}: AutoTableSimpleFiltersProps<TData>):
|
|
1302
|
+
}: AutoTableSimpleFiltersProps<TData>): react_jsx_runtime1.JSX.Element | null;
|
|
1303
1303
|
//#endregion
|
|
1304
1304
|
//#region src/components/auto-crud/form-modal.d.ts
|
|
1305
1305
|
type ModalVariant = "dialog" | "sheet";
|
|
@@ -1341,7 +1341,7 @@ declare function CrudFormModal<T extends z.ZodObject<z.ZodRawShape>>({
|
|
|
1341
1341
|
labelAlign,
|
|
1342
1342
|
labelWidth,
|
|
1343
1343
|
className
|
|
1344
|
-
}: CrudFormModalProps<T>):
|
|
1344
|
+
}: CrudFormModalProps<T>): react_jsx_runtime1.JSX.Element;
|
|
1345
1345
|
//#endregion
|
|
1346
1346
|
//#region src/components/auto-crud/import-dialog.d.ts
|
|
1347
1347
|
interface ImportDialogProps {
|
|
@@ -1363,7 +1363,7 @@ declare function ImportDialog({
|
|
|
1363
1363
|
columns,
|
|
1364
1364
|
title,
|
|
1365
1365
|
locale
|
|
1366
|
-
}: ImportDialogProps):
|
|
1366
|
+
}: ImportDialogProps): react_jsx_runtime1.JSX.Element;
|
|
1367
1367
|
//#endregion
|
|
1368
1368
|
//#region src/components/auto-crud/export-dialog.d.ts
|
|
1369
1369
|
type ExportMode = "selected" | "filtered";
|
|
@@ -1383,7 +1383,7 @@ declare function ExportDialog({
|
|
|
1383
1383
|
selectedCount,
|
|
1384
1384
|
onExport,
|
|
1385
1385
|
canExportFiltered
|
|
1386
|
-
}: ExportDialogProps):
|
|
1386
|
+
}: ExportDialogProps): react_jsx_runtime1.JSX.Element;
|
|
1387
1387
|
//#endregion
|
|
1388
1388
|
//#region src/components/data-table/data-table.d.ts
|
|
1389
1389
|
interface DataTableProps<TData> extends React$1.ComponentProps<"div"> {
|
|
@@ -1396,7 +1396,7 @@ declare function DataTable<TData>({
|
|
|
1396
1396
|
children,
|
|
1397
1397
|
className,
|
|
1398
1398
|
...props
|
|
1399
|
-
}: DataTableProps<TData>):
|
|
1399
|
+
}: DataTableProps<TData>): react_jsx_runtime1.JSX.Element;
|
|
1400
1400
|
//#endregion
|
|
1401
1401
|
//#region src/components/data-table/data-table-advanced-toolbar.d.ts
|
|
1402
1402
|
interface DataTableAdvancedToolbarProps<TData> extends React$1.ComponentProps<"div"> {
|
|
@@ -1407,7 +1407,7 @@ declare function DataTableAdvancedToolbar<TData>({
|
|
|
1407
1407
|
children,
|
|
1408
1408
|
className,
|
|
1409
1409
|
...props
|
|
1410
|
-
}: DataTableAdvancedToolbarProps<TData>):
|
|
1410
|
+
}: DataTableAdvancedToolbarProps<TData>): react_jsx_runtime1.JSX.Element;
|
|
1411
1411
|
//#endregion
|
|
1412
1412
|
//#region src/components/data-table/data-table-column-header.d.ts
|
|
1413
1413
|
interface DataTableColumnHeaderProps<TData, TValue> extends React.ComponentProps<typeof DropdownMenuTrigger> {
|
|
@@ -1419,7 +1419,7 @@ declare function DataTableColumnHeader<TData, TValue>({
|
|
|
1419
1419
|
label,
|
|
1420
1420
|
className,
|
|
1421
1421
|
...props
|
|
1422
|
-
}: DataTableColumnHeaderProps<TData, TValue>):
|
|
1422
|
+
}: DataTableColumnHeaderProps<TData, TValue>): react_jsx_runtime1.JSX.Element;
|
|
1423
1423
|
//#endregion
|
|
1424
1424
|
//#region src/components/data-table/data-table-faceted-filter.d.ts
|
|
1425
1425
|
interface DataTableFacetedFilterProps<TData, TValue> {
|
|
@@ -1433,7 +1433,7 @@ declare function DataTableFacetedFilter<TData, TValue>({
|
|
|
1433
1433
|
title,
|
|
1434
1434
|
options,
|
|
1435
1435
|
multiple
|
|
1436
|
-
}: DataTableFacetedFilterProps<TData, TValue>):
|
|
1436
|
+
}: DataTableFacetedFilterProps<TData, TValue>): react_jsx_runtime1.JSX.Element;
|
|
1437
1437
|
//#endregion
|
|
1438
1438
|
//#region src/components/data-table/data-table-pagination.d.ts
|
|
1439
1439
|
interface DataTablePaginationProps<TData> extends React.ComponentProps<"div"> {
|
|
@@ -1445,7 +1445,7 @@ declare function DataTablePagination<TData>({
|
|
|
1445
1445
|
pageSizeOptions,
|
|
1446
1446
|
className,
|
|
1447
1447
|
...props
|
|
1448
|
-
}: DataTablePaginationProps<TData>):
|
|
1448
|
+
}: DataTablePaginationProps<TData>): react_jsx_runtime1.JSX.Element;
|
|
1449
1449
|
//#endregion
|
|
1450
1450
|
//#region src/components/data-table/data-table-toolbar.d.ts
|
|
1451
1451
|
interface DataTableToolbarProps<TData> extends React$1.ComponentProps<"div"> {
|
|
@@ -1456,7 +1456,7 @@ declare function DataTableToolbar<TData>({
|
|
|
1456
1456
|
children,
|
|
1457
1457
|
className,
|
|
1458
1458
|
...props
|
|
1459
|
-
}: DataTableToolbarProps<TData>):
|
|
1459
|
+
}: DataTableToolbarProps<TData>): react_jsx_runtime1.JSX.Element;
|
|
1460
1460
|
//#endregion
|
|
1461
1461
|
//#region src/components/data-table/data-table-view-options.d.ts
|
|
1462
1462
|
interface DataTableViewOptionsProps<TData> extends React$1.ComponentProps<typeof PopoverContent> {
|
|
@@ -1467,7 +1467,7 @@ declare function DataTableViewOptions<TData>({
|
|
|
1467
1467
|
table,
|
|
1468
1468
|
disabled,
|
|
1469
1469
|
...props
|
|
1470
|
-
}: DataTableViewOptionsProps<TData>):
|
|
1470
|
+
}: DataTableViewOptionsProps<TData>): react_jsx_runtime1.JSX.Element;
|
|
1471
1471
|
//#endregion
|
|
1472
1472
|
//#region src/components/ui/multi-combobox.d.ts
|
|
1473
1473
|
interface MultiComboboxOption {
|
|
@@ -1844,4 +1844,4 @@ declare function exportAllToCSV<T extends Record<string, unknown>>(data: T[], op
|
|
|
1844
1844
|
*/
|
|
1845
1845
|
declare function downloadCSVTemplate(headers: string[], filename?: string): void;
|
|
1846
1846
|
//#endregion
|
|
1847
|
-
export { type ActionItem, type ActionsColumnConfig, type AutoCrudDataSourceConfig, type AutoCrudDataSourceContext, type AutoCrudDataSourceEntry, type AutoCrudDataSourceLoader, type AutoCrudDataSourceRegistration, type AutoCrudFormComponentConfig, type AutoCrudLocale, type AutoCrudOption, AutoCrudTable, type AutoCrudTableProps, type AutoCrudToolbarContext, type AutoCrudToolbarResolver, AutoForm, type AutoQueryParams, AutoTable, AutoTableActionBar, AutoTableSimpleFilters, type BatchActionConfig, type BatchActionContext, type BatchActionItem, type BatchBuiltinActionItem, type BatchBuiltinActionType, type BatchCustomActionItem, type BatchUpdateField, type ColumnOverrides, type CreateFormSchemaOptions, type CreateTableSchemaOptions, CrudFormModal, type CrudHooks, type CrudOperationPermissions, type CrudPermissions, type DataSource, DataTable, DataTableAdvancedToolbar, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableRowAction, DataTableToolbar, DataTableViewOptions, type EnumOption, ExportDialog, type ExportDialogProps, type ExportMode, ExtendedColumnFilter, ExtendedColumnSort, type Field, type FieldOption, type FieldType, type Fields, type FilterConfig, FilterOperator, type FilterVariant, type FormSchemaOverrides, ImportDialog, type ImportDialogProps, type ImportResult, type JSONSchema, type JSONSchemaProperty, JoinOperator, type ListParams, type ListResult, type LocaleProp, MultiCombobox, type MultiComboboxOption, type MultiComboboxProps, type MultiComboboxTriggerRenderProps, Option, type ParsedImportData, type ParsedZodField, type Parser, QueryKeys, SchemaAdapter, type SimpleFieldConfig, type SimpleFieldsConfig, type ToastAdapter, type ToolbarActionConfig, type ToolbarActionItem, type ToolbarBuiltinActionItem, type ToolbarCustomActionItem, type UnifiedField, type UnifiedSchema, type UrlStateOptions, type UseAutoCrudResourceOptions, type UseAutoCrudResourceParams, type UseAutoCrudResourceReturn, cn, coerceRowValues, components, createActionsColumn, createEditFormSchema, createFormSchema, createMemoryDataSource, createSelectColumn, createTRPCDataSource, createTableSchema, dataSources, dataToCSV, deDE, downloadCSVTemplate, enUS, esES, exportAllToCSV, exportTableToCSV, formComponents, formatDate, frFR, generateCSVTemplate, getUrlParams, humanize, jaJP, koKR, noopToastAdapter, normalizeDataSourceConfig, normalizeOptions, parseAsArrayOf, parseAsInteger, parseAsString, parseAsStringEnum, parseCSV, parseImportFile, parseJSON, parseZodField, resolveLocale,
|
|
1847
|
+
export { type ActionItem, type ActionsColumnConfig, type AutoCrudDataSourceConfig, type AutoCrudDataSourceContext, type AutoCrudDataSourceEntry, type AutoCrudDataSourceLoader, type AutoCrudDataSourceRegistration, type AutoCrudFormComponentConfig, type AutoCrudLocale, type AutoCrudOption, AutoCrudTable, type AutoCrudTableProps, type AutoCrudToolbarContext, type AutoCrudToolbarResolver, AutoForm, type AutoQueryParams, AutoTable, AutoTableActionBar, AutoTableSimpleFilters, type BatchActionConfig, type BatchActionContext, type BatchActionItem, type BatchBuiltinActionItem, type BatchBuiltinActionType, type BatchCustomActionItem, type BatchUpdateField, type ColumnOverrides, type CreateFormSchemaOptions, type CreateTableSchemaOptions, CrudFormModal, type CrudHooks, type CrudOperationPermissions, type CrudPermissions, type DataSource, DataTable, DataTableAdvancedToolbar, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableRowAction, DataTableToolbar, DataTableViewOptions, type EnumOption, ExportDialog, type ExportDialogProps, type ExportMode, ExtendedColumnFilter, ExtendedColumnSort, type Field, type FieldOption, type FieldType, type Fields, type FilterConfig, FilterOperator, type FilterVariant, type FormSchemaOverrides, ImportDialog, type ImportDialogProps, type ImportResult, type JSONSchema, type JSONSchemaProperty, JoinOperator, type ListParams, type ListResult, type LocaleProp, MultiCombobox, type MultiComboboxOption, type MultiComboboxProps, type MultiComboboxTriggerRenderProps, Option, type ParsedImportData, type ParsedZodField, type Parser, QueryKeys, SchemaAdapter, type SimpleFieldConfig, type SimpleFieldsConfig, type ToastAdapter, type ToolbarActionConfig, type ToolbarActionItem, type ToolbarBuiltinActionItem, type ToolbarCustomActionItem, type UnifiedField, type UnifiedSchema, type UrlStateOptions, type UseAutoCrudResourceOptions, type UseAutoCrudResourceParams, type UseAutoCrudResourceReturn, cn, coerceRowValues, components, createActionsColumn, createEditFormSchema, createFormSchema, createMemoryDataSource, createSelectColumn, createTRPCDataSource, createTableSchema, dataSources, dataToCSV, deDE, downloadCSVTemplate, enUS, esES, exportAllToCSV, exportTableToCSV, formComponents, formatDate, frFR, generateCSVTemplate, getUrlParams, humanize, jaJP, koKR, noopToastAdapter, normalizeDataSourceConfig, normalizeOptions, parseAsArrayOf, parseAsInteger, parseAsString, parseAsStringEnum, parseCSV, parseImportFile, parseJSON, parseZodField, resolveLocale, setSearchParams, setToolbarResolver, useAutoCrudResource, useDataTable, useQueryState, useQueryStates, useReadableFilters, useUrlState, useUrlStates, zhCN };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as _tanstack_react_table0 from "@tanstack/react-table";
|
|
|
4
4
|
import { Column, ColumnDef, ColumnSort, Row, RowData, Table, TableOptions, TableState } from "@tanstack/react-table";
|
|
5
5
|
import { Command, DropdownMenuTrigger, PopoverContent } from "@pixpilot/shadcn";
|
|
6
6
|
import { ClassValue } from "clsx";
|
|
7
|
-
import * as
|
|
7
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { ISchema } from "@formily/json-schema";
|
|
10
10
|
|
|
@@ -364,7 +364,7 @@ declare function AutoTableActionBar<TData>({
|
|
|
364
364
|
enableDelete,
|
|
365
365
|
extraActions,
|
|
366
366
|
actions
|
|
367
|
-
}: AutoTableActionBarProps<TData>):
|
|
367
|
+
}: AutoTableActionBarProps<TData>): react_jsx_runtime2.JSX.Element;
|
|
368
368
|
//#endregion
|
|
369
369
|
//#region src/lib/schema-bridge/types.d.ts
|
|
370
370
|
/**
|
|
@@ -535,7 +535,7 @@ declare function AutoTable<T extends z.ZodObject<z.ZodRawShape>>({
|
|
|
535
535
|
onSelectedCountChange,
|
|
536
536
|
onSelectedRowsChange,
|
|
537
537
|
getSelectedRows
|
|
538
|
-
}: AutoTableProps<T>):
|
|
538
|
+
}: AutoTableProps<T>): react_jsx_runtime2.JSX.Element;
|
|
539
539
|
//#endregion
|
|
540
540
|
//#region src/i18n/locale.d.ts
|
|
541
541
|
/**
|
|
@@ -837,7 +837,7 @@ interface AutoCrudToolbarContext {
|
|
|
837
837
|
openCreate?: () => void;
|
|
838
838
|
}
|
|
839
839
|
type AutoCrudToolbarResolver = (targetId: string, ownerActions: readonly ToolbarActionItem[], context: AutoCrudToolbarContext) => ToolbarActionItem[];
|
|
840
|
-
declare function
|
|
840
|
+
declare function setToolbarResolver(resolver: AutoCrudToolbarResolver | null): void;
|
|
841
841
|
/**
|
|
842
842
|
* AutoCrudTable Props 接口
|
|
843
843
|
*/
|
|
@@ -965,7 +965,7 @@ declare function AutoCrudTable<TSchema extends z.ZodObject<z.ZodRawShape>>({
|
|
|
965
965
|
toolbarActions,
|
|
966
966
|
locale: localeProp,
|
|
967
967
|
onCreate
|
|
968
|
-
}: AutoCrudTableProps<TSchema>):
|
|
968
|
+
}: AutoCrudTableProps<TSchema>): react_jsx_runtime2.JSX.Element;
|
|
969
969
|
//#endregion
|
|
970
970
|
//#region src/components/auto-crud/auto-form.d.ts
|
|
971
971
|
interface AutoFormProps<T extends z.ZodObject<z.ZodRawShape>> {
|
|
@@ -997,7 +997,7 @@ declare function AutoFormInner<T extends z.ZodObject<z.ZodRawShape>>({
|
|
|
997
997
|
labelAlign,
|
|
998
998
|
labelWidth,
|
|
999
999
|
showSubmitButton
|
|
1000
|
-
}: AutoFormProps<T>, ref: React.Ref<AutoFormRef>):
|
|
1000
|
+
}: AutoFormProps<T>, ref: React.Ref<AutoFormRef>): react_jsx_runtime2.JSX.Element;
|
|
1001
1001
|
declare const AutoForm: <T extends z.ZodObject<z.ZodRawShape>>(props: AutoFormProps<T> & {
|
|
1002
1002
|
ref?: React.Ref<AutoFormRef>;
|
|
1003
1003
|
}) => ReturnType<typeof AutoFormInner>;
|
|
@@ -1211,12 +1211,12 @@ declare const filterItemSchema: z.ZodObject<{
|
|
|
1211
1211
|
variant: z.ZodEnum<{
|
|
1212
1212
|
number: "number";
|
|
1213
1213
|
boolean: "boolean";
|
|
1214
|
-
text: "text";
|
|
1215
|
-
range: "range";
|
|
1216
1214
|
date: "date";
|
|
1217
|
-
|
|
1215
|
+
text: "text";
|
|
1218
1216
|
select: "select";
|
|
1219
1217
|
multiSelect: "multiSelect";
|
|
1218
|
+
dateRange: "dateRange";
|
|
1219
|
+
range: "range";
|
|
1220
1220
|
}>;
|
|
1221
1221
|
operator: z.ZodEnum<{
|
|
1222
1222
|
iLike: "iLike";
|
|
@@ -1299,7 +1299,7 @@ declare function AutoTableSimpleFilters<TData>({
|
|
|
1299
1299
|
filters: externalFilters,
|
|
1300
1300
|
onFiltersChange,
|
|
1301
1301
|
leading
|
|
1302
|
-
}: AutoTableSimpleFiltersProps<TData>):
|
|
1302
|
+
}: AutoTableSimpleFiltersProps<TData>): react_jsx_runtime2.JSX.Element | null;
|
|
1303
1303
|
//#endregion
|
|
1304
1304
|
//#region src/components/auto-crud/form-modal.d.ts
|
|
1305
1305
|
type ModalVariant = "dialog" | "sheet";
|
|
@@ -1341,7 +1341,7 @@ declare function CrudFormModal<T extends z.ZodObject<z.ZodRawShape>>({
|
|
|
1341
1341
|
labelAlign,
|
|
1342
1342
|
labelWidth,
|
|
1343
1343
|
className
|
|
1344
|
-
}: CrudFormModalProps<T>):
|
|
1344
|
+
}: CrudFormModalProps<T>): react_jsx_runtime2.JSX.Element;
|
|
1345
1345
|
//#endregion
|
|
1346
1346
|
//#region src/components/auto-crud/import-dialog.d.ts
|
|
1347
1347
|
interface ImportDialogProps {
|
|
@@ -1363,7 +1363,7 @@ declare function ImportDialog({
|
|
|
1363
1363
|
columns,
|
|
1364
1364
|
title,
|
|
1365
1365
|
locale
|
|
1366
|
-
}: ImportDialogProps):
|
|
1366
|
+
}: ImportDialogProps): react_jsx_runtime2.JSX.Element;
|
|
1367
1367
|
//#endregion
|
|
1368
1368
|
//#region src/components/auto-crud/export-dialog.d.ts
|
|
1369
1369
|
type ExportMode = "selected" | "filtered";
|
|
@@ -1383,7 +1383,7 @@ declare function ExportDialog({
|
|
|
1383
1383
|
selectedCount,
|
|
1384
1384
|
onExport,
|
|
1385
1385
|
canExportFiltered
|
|
1386
|
-
}: ExportDialogProps):
|
|
1386
|
+
}: ExportDialogProps): react_jsx_runtime2.JSX.Element;
|
|
1387
1387
|
//#endregion
|
|
1388
1388
|
//#region src/components/data-table/data-table.d.ts
|
|
1389
1389
|
interface DataTableProps<TData> extends React$1.ComponentProps<"div"> {
|
|
@@ -1396,7 +1396,7 @@ declare function DataTable<TData>({
|
|
|
1396
1396
|
children,
|
|
1397
1397
|
className,
|
|
1398
1398
|
...props
|
|
1399
|
-
}: DataTableProps<TData>):
|
|
1399
|
+
}: DataTableProps<TData>): react_jsx_runtime2.JSX.Element;
|
|
1400
1400
|
//#endregion
|
|
1401
1401
|
//#region src/components/data-table/data-table-advanced-toolbar.d.ts
|
|
1402
1402
|
interface DataTableAdvancedToolbarProps<TData> extends React$1.ComponentProps<"div"> {
|
|
@@ -1407,7 +1407,7 @@ declare function DataTableAdvancedToolbar<TData>({
|
|
|
1407
1407
|
children,
|
|
1408
1408
|
className,
|
|
1409
1409
|
...props
|
|
1410
|
-
}: DataTableAdvancedToolbarProps<TData>):
|
|
1410
|
+
}: DataTableAdvancedToolbarProps<TData>): react_jsx_runtime2.JSX.Element;
|
|
1411
1411
|
//#endregion
|
|
1412
1412
|
//#region src/components/data-table/data-table-column-header.d.ts
|
|
1413
1413
|
interface DataTableColumnHeaderProps<TData, TValue> extends React.ComponentProps<typeof DropdownMenuTrigger> {
|
|
@@ -1419,7 +1419,7 @@ declare function DataTableColumnHeader<TData, TValue>({
|
|
|
1419
1419
|
label,
|
|
1420
1420
|
className,
|
|
1421
1421
|
...props
|
|
1422
|
-
}: DataTableColumnHeaderProps<TData, TValue>):
|
|
1422
|
+
}: DataTableColumnHeaderProps<TData, TValue>): react_jsx_runtime2.JSX.Element;
|
|
1423
1423
|
//#endregion
|
|
1424
1424
|
//#region src/components/data-table/data-table-faceted-filter.d.ts
|
|
1425
1425
|
interface DataTableFacetedFilterProps<TData, TValue> {
|
|
@@ -1433,7 +1433,7 @@ declare function DataTableFacetedFilter<TData, TValue>({
|
|
|
1433
1433
|
title,
|
|
1434
1434
|
options,
|
|
1435
1435
|
multiple
|
|
1436
|
-
}: DataTableFacetedFilterProps<TData, TValue>):
|
|
1436
|
+
}: DataTableFacetedFilterProps<TData, TValue>): react_jsx_runtime2.JSX.Element;
|
|
1437
1437
|
//#endregion
|
|
1438
1438
|
//#region src/components/data-table/data-table-pagination.d.ts
|
|
1439
1439
|
interface DataTablePaginationProps<TData> extends React.ComponentProps<"div"> {
|
|
@@ -1445,7 +1445,7 @@ declare function DataTablePagination<TData>({
|
|
|
1445
1445
|
pageSizeOptions,
|
|
1446
1446
|
className,
|
|
1447
1447
|
...props
|
|
1448
|
-
}: DataTablePaginationProps<TData>):
|
|
1448
|
+
}: DataTablePaginationProps<TData>): react_jsx_runtime2.JSX.Element;
|
|
1449
1449
|
//#endregion
|
|
1450
1450
|
//#region src/components/data-table/data-table-toolbar.d.ts
|
|
1451
1451
|
interface DataTableToolbarProps<TData> extends React$1.ComponentProps<"div"> {
|
|
@@ -1456,7 +1456,7 @@ declare function DataTableToolbar<TData>({
|
|
|
1456
1456
|
children,
|
|
1457
1457
|
className,
|
|
1458
1458
|
...props
|
|
1459
|
-
}: DataTableToolbarProps<TData>):
|
|
1459
|
+
}: DataTableToolbarProps<TData>): react_jsx_runtime2.JSX.Element;
|
|
1460
1460
|
//#endregion
|
|
1461
1461
|
//#region src/components/data-table/data-table-view-options.d.ts
|
|
1462
1462
|
interface DataTableViewOptionsProps<TData> extends React$1.ComponentProps<typeof PopoverContent> {
|
|
@@ -1467,7 +1467,7 @@ declare function DataTableViewOptions<TData>({
|
|
|
1467
1467
|
table,
|
|
1468
1468
|
disabled,
|
|
1469
1469
|
...props
|
|
1470
|
-
}: DataTableViewOptionsProps<TData>):
|
|
1470
|
+
}: DataTableViewOptionsProps<TData>): react_jsx_runtime2.JSX.Element;
|
|
1471
1471
|
//#endregion
|
|
1472
1472
|
//#region src/components/ui/multi-combobox.d.ts
|
|
1473
1473
|
interface MultiComboboxOption {
|
|
@@ -1844,4 +1844,4 @@ declare function exportAllToCSV<T extends Record<string, unknown>>(data: T[], op
|
|
|
1844
1844
|
*/
|
|
1845
1845
|
declare function downloadCSVTemplate(headers: string[], filename?: string): void;
|
|
1846
1846
|
//#endregion
|
|
1847
|
-
export { type ActionItem, type ActionsColumnConfig, type AutoCrudDataSourceConfig, type AutoCrudDataSourceContext, type AutoCrudDataSourceEntry, type AutoCrudDataSourceLoader, type AutoCrudDataSourceRegistration, type AutoCrudFormComponentConfig, type AutoCrudLocale, type AutoCrudOption, AutoCrudTable, type AutoCrudTableProps, type AutoCrudToolbarContext, type AutoCrudToolbarResolver, AutoForm, type AutoQueryParams, AutoTable, AutoTableActionBar, AutoTableSimpleFilters, type BatchActionConfig, type BatchActionContext, type BatchActionItem, type BatchBuiltinActionItem, type BatchBuiltinActionType, type BatchCustomActionItem, type BatchUpdateField, type ColumnOverrides, type CreateFormSchemaOptions, type CreateTableSchemaOptions, CrudFormModal, type CrudHooks, type CrudOperationPermissions, type CrudPermissions, type DataSource, DataTable, DataTableAdvancedToolbar, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableRowAction, DataTableToolbar, DataTableViewOptions, type EnumOption, ExportDialog, type ExportDialogProps, type ExportMode, ExtendedColumnFilter, ExtendedColumnSort, type Field, type FieldOption, type FieldType, type Fields, type FilterConfig, FilterOperator, type FilterVariant, type FormSchemaOverrides, ImportDialog, type ImportDialogProps, type ImportResult, type JSONSchema, type JSONSchemaProperty, JoinOperator, type ListParams, type ListResult, type LocaleProp, MultiCombobox, type MultiComboboxOption, type MultiComboboxProps, type MultiComboboxTriggerRenderProps, Option, type ParsedImportData, type ParsedZodField, type Parser, QueryKeys, SchemaAdapter, type SimpleFieldConfig, type SimpleFieldsConfig, type ToastAdapter, type ToolbarActionConfig, type ToolbarActionItem, type ToolbarBuiltinActionItem, type ToolbarCustomActionItem, type UnifiedField, type UnifiedSchema, type UrlStateOptions, type UseAutoCrudResourceOptions, type UseAutoCrudResourceParams, type UseAutoCrudResourceReturn, cn, coerceRowValues, components, createActionsColumn, createEditFormSchema, createFormSchema, createMemoryDataSource, createSelectColumn, createTRPCDataSource, createTableSchema, dataSources, dataToCSV, deDE, downloadCSVTemplate, enUS, esES, exportAllToCSV, exportTableToCSV, formComponents, formatDate, frFR, generateCSVTemplate, getUrlParams, humanize, jaJP, koKR, noopToastAdapter, normalizeDataSourceConfig, normalizeOptions, parseAsArrayOf, parseAsInteger, parseAsString, parseAsStringEnum, parseCSV, parseImportFile, parseJSON, parseZodField, resolveLocale,
|
|
1847
|
+
export { type ActionItem, type ActionsColumnConfig, type AutoCrudDataSourceConfig, type AutoCrudDataSourceContext, type AutoCrudDataSourceEntry, type AutoCrudDataSourceLoader, type AutoCrudDataSourceRegistration, type AutoCrudFormComponentConfig, type AutoCrudLocale, type AutoCrudOption, AutoCrudTable, type AutoCrudTableProps, type AutoCrudToolbarContext, type AutoCrudToolbarResolver, AutoForm, type AutoQueryParams, AutoTable, AutoTableActionBar, AutoTableSimpleFilters, type BatchActionConfig, type BatchActionContext, type BatchActionItem, type BatchBuiltinActionItem, type BatchBuiltinActionType, type BatchCustomActionItem, type BatchUpdateField, type ColumnOverrides, type CreateFormSchemaOptions, type CreateTableSchemaOptions, CrudFormModal, type CrudHooks, type CrudOperationPermissions, type CrudPermissions, type DataSource, DataTable, DataTableAdvancedToolbar, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableRowAction, DataTableToolbar, DataTableViewOptions, type EnumOption, ExportDialog, type ExportDialogProps, type ExportMode, ExtendedColumnFilter, ExtendedColumnSort, type Field, type FieldOption, type FieldType, type Fields, type FilterConfig, FilterOperator, type FilterVariant, type FormSchemaOverrides, ImportDialog, type ImportDialogProps, type ImportResult, type JSONSchema, type JSONSchemaProperty, JoinOperator, type ListParams, type ListResult, type LocaleProp, MultiCombobox, type MultiComboboxOption, type MultiComboboxProps, type MultiComboboxTriggerRenderProps, Option, type ParsedImportData, type ParsedZodField, type Parser, QueryKeys, SchemaAdapter, type SimpleFieldConfig, type SimpleFieldsConfig, type ToastAdapter, type ToolbarActionConfig, type ToolbarActionItem, type ToolbarBuiltinActionItem, type ToolbarCustomActionItem, type UnifiedField, type UnifiedSchema, type UrlStateOptions, type UseAutoCrudResourceOptions, type UseAutoCrudResourceParams, type UseAutoCrudResourceReturn, cn, coerceRowValues, components, createActionsColumn, createEditFormSchema, createFormSchema, createMemoryDataSource, createSelectColumn, createTRPCDataSource, createTableSchema, dataSources, dataToCSV, deDE, downloadCSVTemplate, enUS, esES, exportAllToCSV, exportTableToCSV, formComponents, formatDate, frFR, generateCSVTemplate, getUrlParams, humanize, jaJP, koKR, noopToastAdapter, normalizeDataSourceConfig, normalizeOptions, parseAsArrayOf, parseAsInteger, parseAsString, parseAsStringEnum, parseCSV, parseImportFile, parseJSON, parseZodField, resolveLocale, setSearchParams, setToolbarResolver, useAutoCrudResource, useDataTable, useQueryState, useQueryStates, useReadableFilters, useUrlState, useUrlStates, zhCN };
|
package/dist/index.js
CHANGED
|
@@ -6244,7 +6244,7 @@ function ImportDialog({ open, onOpenChange, onImport, columns = [], title, local
|
|
|
6244
6244
|
//#endregion
|
|
6245
6245
|
//#region src/components/auto-crud/auto-crud-table.tsx
|
|
6246
6246
|
let autoCrudToolbarResolver = null;
|
|
6247
|
-
function
|
|
6247
|
+
function setToolbarResolver(resolver) {
|
|
6248
6248
|
autoCrudToolbarResolver = resolver;
|
|
6249
6249
|
}
|
|
6250
6250
|
function getDefaultToolbarActions() {
|
|
@@ -8352,4 +8352,4 @@ function createMemoryDataSource(initialData = []) {
|
|
|
8352
8352
|
}
|
|
8353
8353
|
|
|
8354
8354
|
//#endregion
|
|
8355
|
-
export { AutoCrudTable, AutoForm, AutoTable, AutoTableActionBar, AutoTableSimpleFilters, CrudFormModal, DataTable, DataTableAdvancedToolbar, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableToolbar, DataTableViewOptions, ExportDialog, ImportDialog, MultiCombobox, SchemaAdapter, cn, coerceRowValues, components, createActionsColumn, createEditFormSchema, createFormSchema, createMemoryDataSource, createSelectColumn, createTRPCDataSource, createTableSchema, dataSources, dataToCSV, deDE, downloadCSVTemplate, enUS, esES, exportAllToCSV, exportTableToCSV, formComponents, formatDate, frFR, generateCSVTemplate, getUrlParams, humanize, jaJP, koKR, noopToastAdapter, normalizeDataSourceConfig, normalizeOptions, parseAsArrayOf, parseAsInteger, parseAsString, parseAsStringEnum, parseCSV, parseImportFile, parseJSON, parseZodField, resolveLocale,
|
|
8355
|
+
export { AutoCrudTable, AutoForm, AutoTable, AutoTableActionBar, AutoTableSimpleFilters, CrudFormModal, DataTable, DataTableAdvancedToolbar, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableToolbar, DataTableViewOptions, ExportDialog, ImportDialog, MultiCombobox, SchemaAdapter, cn, coerceRowValues, components, createActionsColumn, createEditFormSchema, createFormSchema, createMemoryDataSource, createSelectColumn, createTRPCDataSource, createTableSchema, dataSources, dataToCSV, deDE, downloadCSVTemplate, enUS, esES, exportAllToCSV, exportTableToCSV, formComponents, formatDate, frFR, generateCSVTemplate, getUrlParams, humanize, jaJP, koKR, noopToastAdapter, normalizeDataSourceConfig, normalizeOptions, parseAsArrayOf, parseAsInteger, parseAsString, parseAsStringEnum, parseCSV, parseImportFile, parseJSON, parseZodField, resolveLocale, setSearchParams, setToolbarResolver, useAutoCrudResource, useDataTable, useQueryState, useQueryStates, useReadableFilters, useUrlState, useUrlStates, zhCN };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordrhyme/auto-crud",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.5",
|
|
5
5
|
"description": "Schema-first CRUD components with auto-generated tables and forms",
|
|
6
6
|
"author": "wordrhyme",
|
|
7
7
|
"license": "MIT",
|
|
@@ -86,11 +86,11 @@
|
|
|
86
86
|
"tsdown": "^0.15.12",
|
|
87
87
|
"typescript": "^5.9.3",
|
|
88
88
|
"vitest": "^3.2.4",
|
|
89
|
-
"@internal/eslint-config": "0.3.0",
|
|
90
89
|
"@internal/prettier-config": "0.0.1",
|
|
90
|
+
"@internal/eslint-config": "0.3.0",
|
|
91
|
+
"@internal/tsconfig": "0.1.0",
|
|
91
92
|
"@internal/tsdown-config": "0.1.0",
|
|
92
|
-
"@internal/vitest-config": "0.1.0"
|
|
93
|
-
"@internal/tsconfig": "0.1.0"
|
|
93
|
+
"@internal/vitest-config": "0.1.0"
|
|
94
94
|
},
|
|
95
95
|
"prettier": "@internal/prettier-config",
|
|
96
96
|
"scripts": {
|