@wordrhyme/auto-crud 1.0.8 → 1.0.9

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/index.cjs CHANGED
@@ -6977,7 +6977,10 @@ function useAutoCrudResource({ router, schema, query: queryTransform, options =
6977
6977
  filters,
6978
6978
  queryTransform
6979
6979
  ]);
6980
- const listQuery = router.list.useQuery(queryInput, { placeholderData: keepPreviousData });
6980
+ const listQuery = router.list.useQuery(queryInput, {
6981
+ placeholderData: keepPreviousData,
6982
+ staleTime: 0
6983
+ });
6981
6984
  const createMutation = router.create.useMutation();
6982
6985
  const updateMutation = router.update.useMutation();
6983
6986
  const deleteMutation = router.delete.useMutation();
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
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";
@@ -314,7 +314,7 @@ declare function AutoTableActionBar<TData>({
314
314
  enableExport,
315
315
  enableDelete,
316
316
  extraActions
317
- }: AutoTableActionBarProps<TData>): react_jsx_runtime2.JSX.Element;
317
+ }: AutoTableActionBarProps<TData>): react_jsx_runtime1.JSX.Element;
318
318
  //#endregion
319
319
  //#region src/lib/schema-bridge/types.d.ts
320
320
  /**
@@ -470,7 +470,7 @@ declare function AutoTable<T extends z.ZodObject<z.ZodRawShape>>({
470
470
  enableExport,
471
471
  onSelectedCountChange,
472
472
  getSelectedRows
473
- }: AutoTableProps<T>): react_jsx_runtime2.JSX.Element;
473
+ }: AutoTableProps<T>): react_jsx_runtime1.JSX.Element;
474
474
  //#endregion
475
475
  //#region src/i18n/locale.d.ts
476
476
  /**
@@ -797,7 +797,7 @@ declare function AutoCrudTable<TSchema extends z.ZodObject<z.ZodRawShape>>({
797
797
  toolbarActions,
798
798
  locale: localeProp,
799
799
  onCreate
800
- }: AutoCrudTableProps<TSchema>): react_jsx_runtime2.JSX.Element;
800
+ }: AutoCrudTableProps<TSchema>): react_jsx_runtime1.JSX.Element;
801
801
  //#endregion
802
802
  //#region src/components/auto-crud/auto-form.d.ts
803
803
  interface AutoFormProps<T extends z.ZodObject<z.ZodRawShape>> {
@@ -829,7 +829,7 @@ declare function AutoFormInner<T extends z.ZodObject<z.ZodRawShape>>({
829
829
  labelAlign,
830
830
  labelWidth,
831
831
  showSubmitButton
832
- }: AutoFormProps<T>, ref: React.Ref<AutoFormRef>): react_jsx_runtime2.JSX.Element;
832
+ }: AutoFormProps<T>, ref: React.Ref<AutoFormRef>): react_jsx_runtime1.JSX.Element;
833
833
  declare const AutoForm: <T extends z.ZodObject<z.ZodRawShape>>(props: AutoFormProps<T> & {
834
834
  ref?: React.Ref<AutoFormRef>;
835
835
  }) => ReturnType<typeof AutoFormInner>;
@@ -1127,7 +1127,7 @@ declare function AutoTableSimpleFilters<TData>({
1127
1127
  shallow,
1128
1128
  filters: externalFilters,
1129
1129
  onFiltersChange
1130
- }: AutoTableSimpleFiltersProps<TData>): react_jsx_runtime2.JSX.Element | null;
1130
+ }: AutoTableSimpleFiltersProps<TData>): react_jsx_runtime1.JSX.Element | null;
1131
1131
  //#endregion
1132
1132
  //#region src/components/auto-crud/form-modal.d.ts
1133
1133
  type ModalVariant = "dialog" | "sheet";
@@ -1169,7 +1169,7 @@ declare function CrudFormModal<T extends z.ZodObject<z.ZodRawShape>>({
1169
1169
  labelAlign,
1170
1170
  labelWidth,
1171
1171
  className
1172
- }: CrudFormModalProps<T>): react_jsx_runtime2.JSX.Element;
1172
+ }: CrudFormModalProps<T>): react_jsx_runtime1.JSX.Element;
1173
1173
  //#endregion
1174
1174
  //#region src/components/auto-crud/import-dialog.d.ts
1175
1175
  interface ImportDialogProps {
@@ -1191,7 +1191,7 @@ declare function ImportDialog({
1191
1191
  columns,
1192
1192
  title,
1193
1193
  locale
1194
- }: ImportDialogProps): react_jsx_runtime2.JSX.Element;
1194
+ }: ImportDialogProps): react_jsx_runtime1.JSX.Element;
1195
1195
  //#endregion
1196
1196
  //#region src/components/auto-crud/export-dialog.d.ts
1197
1197
  type ExportMode = "selected" | "filtered";
@@ -1211,7 +1211,7 @@ declare function ExportDialog({
1211
1211
  selectedCount,
1212
1212
  onExport,
1213
1213
  canExportFiltered
1214
- }: ExportDialogProps): react_jsx_runtime2.JSX.Element;
1214
+ }: ExportDialogProps): react_jsx_runtime1.JSX.Element;
1215
1215
  //#endregion
1216
1216
  //#region src/components/data-table/data-table.d.ts
1217
1217
  interface DataTableProps<TData> extends React$1.ComponentProps<"div"> {
@@ -1224,7 +1224,7 @@ declare function DataTable<TData>({
1224
1224
  children,
1225
1225
  className,
1226
1226
  ...props
1227
- }: DataTableProps<TData>): react_jsx_runtime2.JSX.Element;
1227
+ }: DataTableProps<TData>): react_jsx_runtime1.JSX.Element;
1228
1228
  //#endregion
1229
1229
  //#region src/components/data-table/data-table-advanced-toolbar.d.ts
1230
1230
  interface DataTableAdvancedToolbarProps<TData> extends React$1.ComponentProps<"div"> {
@@ -1235,7 +1235,7 @@ declare function DataTableAdvancedToolbar<TData>({
1235
1235
  children,
1236
1236
  className,
1237
1237
  ...props
1238
- }: DataTableAdvancedToolbarProps<TData>): react_jsx_runtime2.JSX.Element;
1238
+ }: DataTableAdvancedToolbarProps<TData>): react_jsx_runtime1.JSX.Element;
1239
1239
  //#endregion
1240
1240
  //#region src/components/data-table/data-table-column-header.d.ts
1241
1241
  interface DataTableColumnHeaderProps<TData, TValue> extends React.ComponentProps<typeof DropdownMenuTrigger> {
@@ -1247,7 +1247,7 @@ declare function DataTableColumnHeader<TData, TValue>({
1247
1247
  label,
1248
1248
  className,
1249
1249
  ...props
1250
- }: DataTableColumnHeaderProps<TData, TValue>): react_jsx_runtime2.JSX.Element;
1250
+ }: DataTableColumnHeaderProps<TData, TValue>): react_jsx_runtime1.JSX.Element;
1251
1251
  //#endregion
1252
1252
  //#region src/components/data-table/data-table-faceted-filter.d.ts
1253
1253
  interface DataTableFacetedFilterProps<TData, TValue> {
@@ -1261,7 +1261,7 @@ declare function DataTableFacetedFilter<TData, TValue>({
1261
1261
  title,
1262
1262
  options,
1263
1263
  multiple
1264
- }: DataTableFacetedFilterProps<TData, TValue>): react_jsx_runtime2.JSX.Element;
1264
+ }: DataTableFacetedFilterProps<TData, TValue>): react_jsx_runtime1.JSX.Element;
1265
1265
  //#endregion
1266
1266
  //#region src/components/data-table/data-table-pagination.d.ts
1267
1267
  interface DataTablePaginationProps<TData> extends React.ComponentProps<"div"> {
@@ -1273,7 +1273,7 @@ declare function DataTablePagination<TData>({
1273
1273
  pageSizeOptions,
1274
1274
  className,
1275
1275
  ...props
1276
- }: DataTablePaginationProps<TData>): react_jsx_runtime2.JSX.Element;
1276
+ }: DataTablePaginationProps<TData>): react_jsx_runtime1.JSX.Element;
1277
1277
  //#endregion
1278
1278
  //#region src/components/data-table/data-table-toolbar.d.ts
1279
1279
  interface DataTableToolbarProps<TData> extends React$1.ComponentProps<"div"> {
@@ -1284,7 +1284,7 @@ declare function DataTableToolbar<TData>({
1284
1284
  children,
1285
1285
  className,
1286
1286
  ...props
1287
- }: DataTableToolbarProps<TData>): react_jsx_runtime2.JSX.Element;
1287
+ }: DataTableToolbarProps<TData>): react_jsx_runtime1.JSX.Element;
1288
1288
  //#endregion
1289
1289
  //#region src/components/data-table/data-table-view-options.d.ts
1290
1290
  interface DataTableViewOptionsProps<TData> extends React$1.ComponentProps<typeof PopoverContent> {
@@ -1295,7 +1295,7 @@ declare function DataTableViewOptions<TData>({
1295
1295
  table,
1296
1296
  disabled,
1297
1297
  ...props
1298
- }: DataTableViewOptionsProps<TData>): react_jsx_runtime2.JSX.Element;
1298
+ }: DataTableViewOptionsProps<TData>): react_jsx_runtime1.JSX.Element;
1299
1299
  //#endregion
1300
1300
  //#region src/hooks/use-data-table.d.ts
1301
1301
  interface UseDataTableProps<TData> extends Omit<TableOptions<TData>, "state" | "pageCount" | "getCoreRowModel" | "manualFiltering" | "manualPagination" | "manualSorting">, Required<Pick<TableOptions<TData>, "pageCount">> {
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as _tanstack_react_table0 from "@tanstack/react-table";
3
3
  import { Column, ColumnDef, ColumnSort, Row, RowData, Table, TableOptions, TableState } from "@tanstack/react-table";
4
4
  import { DropdownMenuTrigger, PopoverContent } from "@pixpilot/shadcn";
5
5
  import { ClassValue } from "clsx";
6
- import * as react_jsx_runtime12 from "react/jsx-runtime";
6
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
7
7
  import { z } from "zod";
8
8
  import { ISchema } from "@formily/json-schema";
9
9
 
@@ -314,7 +314,7 @@ declare function AutoTableActionBar<TData>({
314
314
  enableExport,
315
315
  enableDelete,
316
316
  extraActions
317
- }: AutoTableActionBarProps<TData>): react_jsx_runtime12.JSX.Element;
317
+ }: AutoTableActionBarProps<TData>): react_jsx_runtime2.JSX.Element;
318
318
  //#endregion
319
319
  //#region src/lib/schema-bridge/types.d.ts
320
320
  /**
@@ -470,7 +470,7 @@ declare function AutoTable<T extends z.ZodObject<z.ZodRawShape>>({
470
470
  enableExport,
471
471
  onSelectedCountChange,
472
472
  getSelectedRows
473
- }: AutoTableProps<T>): react_jsx_runtime12.JSX.Element;
473
+ }: AutoTableProps<T>): react_jsx_runtime2.JSX.Element;
474
474
  //#endregion
475
475
  //#region src/i18n/locale.d.ts
476
476
  /**
@@ -797,7 +797,7 @@ declare function AutoCrudTable<TSchema extends z.ZodObject<z.ZodRawShape>>({
797
797
  toolbarActions,
798
798
  locale: localeProp,
799
799
  onCreate
800
- }: AutoCrudTableProps<TSchema>): react_jsx_runtime12.JSX.Element;
800
+ }: AutoCrudTableProps<TSchema>): react_jsx_runtime2.JSX.Element;
801
801
  //#endregion
802
802
  //#region src/components/auto-crud/auto-form.d.ts
803
803
  interface AutoFormProps<T extends z.ZodObject<z.ZodRawShape>> {
@@ -829,7 +829,7 @@ declare function AutoFormInner<T extends z.ZodObject<z.ZodRawShape>>({
829
829
  labelAlign,
830
830
  labelWidth,
831
831
  showSubmitButton
832
- }: AutoFormProps<T>, ref: React.Ref<AutoFormRef>): react_jsx_runtime12.JSX.Element;
832
+ }: AutoFormProps<T>, ref: React.Ref<AutoFormRef>): react_jsx_runtime2.JSX.Element;
833
833
  declare const AutoForm: <T extends z.ZodObject<z.ZodRawShape>>(props: AutoFormProps<T> & {
834
834
  ref?: React.Ref<AutoFormRef>;
835
835
  }) => ReturnType<typeof AutoFormInner>;
@@ -1127,7 +1127,7 @@ declare function AutoTableSimpleFilters<TData>({
1127
1127
  shallow,
1128
1128
  filters: externalFilters,
1129
1129
  onFiltersChange
1130
- }: AutoTableSimpleFiltersProps<TData>): react_jsx_runtime12.JSX.Element | null;
1130
+ }: AutoTableSimpleFiltersProps<TData>): react_jsx_runtime2.JSX.Element | null;
1131
1131
  //#endregion
1132
1132
  //#region src/components/auto-crud/form-modal.d.ts
1133
1133
  type ModalVariant = "dialog" | "sheet";
@@ -1169,7 +1169,7 @@ declare function CrudFormModal<T extends z.ZodObject<z.ZodRawShape>>({
1169
1169
  labelAlign,
1170
1170
  labelWidth,
1171
1171
  className
1172
- }: CrudFormModalProps<T>): react_jsx_runtime12.JSX.Element;
1172
+ }: CrudFormModalProps<T>): react_jsx_runtime2.JSX.Element;
1173
1173
  //#endregion
1174
1174
  //#region src/components/auto-crud/import-dialog.d.ts
1175
1175
  interface ImportDialogProps {
@@ -1191,7 +1191,7 @@ declare function ImportDialog({
1191
1191
  columns,
1192
1192
  title,
1193
1193
  locale
1194
- }: ImportDialogProps): react_jsx_runtime12.JSX.Element;
1194
+ }: ImportDialogProps): react_jsx_runtime2.JSX.Element;
1195
1195
  //#endregion
1196
1196
  //#region src/components/auto-crud/export-dialog.d.ts
1197
1197
  type ExportMode = "selected" | "filtered";
@@ -1211,7 +1211,7 @@ declare function ExportDialog({
1211
1211
  selectedCount,
1212
1212
  onExport,
1213
1213
  canExportFiltered
1214
- }: ExportDialogProps): react_jsx_runtime12.JSX.Element;
1214
+ }: ExportDialogProps): react_jsx_runtime2.JSX.Element;
1215
1215
  //#endregion
1216
1216
  //#region src/components/data-table/data-table.d.ts
1217
1217
  interface DataTableProps<TData> extends React$1.ComponentProps<"div"> {
@@ -1224,7 +1224,7 @@ declare function DataTable<TData>({
1224
1224
  children,
1225
1225
  className,
1226
1226
  ...props
1227
- }: DataTableProps<TData>): react_jsx_runtime12.JSX.Element;
1227
+ }: DataTableProps<TData>): react_jsx_runtime2.JSX.Element;
1228
1228
  //#endregion
1229
1229
  //#region src/components/data-table/data-table-advanced-toolbar.d.ts
1230
1230
  interface DataTableAdvancedToolbarProps<TData> extends React$1.ComponentProps<"div"> {
@@ -1235,7 +1235,7 @@ declare function DataTableAdvancedToolbar<TData>({
1235
1235
  children,
1236
1236
  className,
1237
1237
  ...props
1238
- }: DataTableAdvancedToolbarProps<TData>): react_jsx_runtime12.JSX.Element;
1238
+ }: DataTableAdvancedToolbarProps<TData>): react_jsx_runtime2.JSX.Element;
1239
1239
  //#endregion
1240
1240
  //#region src/components/data-table/data-table-column-header.d.ts
1241
1241
  interface DataTableColumnHeaderProps<TData, TValue> extends React.ComponentProps<typeof DropdownMenuTrigger> {
@@ -1247,7 +1247,7 @@ declare function DataTableColumnHeader<TData, TValue>({
1247
1247
  label,
1248
1248
  className,
1249
1249
  ...props
1250
- }: DataTableColumnHeaderProps<TData, TValue>): react_jsx_runtime12.JSX.Element;
1250
+ }: DataTableColumnHeaderProps<TData, TValue>): react_jsx_runtime2.JSX.Element;
1251
1251
  //#endregion
1252
1252
  //#region src/components/data-table/data-table-faceted-filter.d.ts
1253
1253
  interface DataTableFacetedFilterProps<TData, TValue> {
@@ -1261,7 +1261,7 @@ declare function DataTableFacetedFilter<TData, TValue>({
1261
1261
  title,
1262
1262
  options,
1263
1263
  multiple
1264
- }: DataTableFacetedFilterProps<TData, TValue>): react_jsx_runtime12.JSX.Element;
1264
+ }: DataTableFacetedFilterProps<TData, TValue>): react_jsx_runtime2.JSX.Element;
1265
1265
  //#endregion
1266
1266
  //#region src/components/data-table/data-table-pagination.d.ts
1267
1267
  interface DataTablePaginationProps<TData> extends React.ComponentProps<"div"> {
@@ -1273,7 +1273,7 @@ declare function DataTablePagination<TData>({
1273
1273
  pageSizeOptions,
1274
1274
  className,
1275
1275
  ...props
1276
- }: DataTablePaginationProps<TData>): react_jsx_runtime12.JSX.Element;
1276
+ }: DataTablePaginationProps<TData>): react_jsx_runtime2.JSX.Element;
1277
1277
  //#endregion
1278
1278
  //#region src/components/data-table/data-table-toolbar.d.ts
1279
1279
  interface DataTableToolbarProps<TData> extends React$1.ComponentProps<"div"> {
@@ -1284,7 +1284,7 @@ declare function DataTableToolbar<TData>({
1284
1284
  children,
1285
1285
  className,
1286
1286
  ...props
1287
- }: DataTableToolbarProps<TData>): react_jsx_runtime12.JSX.Element;
1287
+ }: DataTableToolbarProps<TData>): react_jsx_runtime2.JSX.Element;
1288
1288
  //#endregion
1289
1289
  //#region src/components/data-table/data-table-view-options.d.ts
1290
1290
  interface DataTableViewOptionsProps<TData> extends React$1.ComponentProps<typeof PopoverContent> {
@@ -1295,7 +1295,7 @@ declare function DataTableViewOptions<TData>({
1295
1295
  table,
1296
1296
  disabled,
1297
1297
  ...props
1298
- }: DataTableViewOptionsProps<TData>): react_jsx_runtime12.JSX.Element;
1298
+ }: DataTableViewOptionsProps<TData>): react_jsx_runtime2.JSX.Element;
1299
1299
  //#endregion
1300
1300
  //#region src/hooks/use-data-table.d.ts
1301
1301
  interface UseDataTableProps<TData> extends Omit<TableOptions<TData>, "state" | "pageCount" | "getCoreRowModel" | "manualFiltering" | "manualPagination" | "manualSorting">, Required<Pick<TableOptions<TData>, "pageCount">> {
package/dist/index.js CHANGED
@@ -6935,7 +6935,10 @@ function useAutoCrudResource({ router, schema, query: queryTransform, options =
6935
6935
  filters,
6936
6936
  queryTransform
6937
6937
  ]);
6938
- const listQuery = router.list.useQuery(queryInput, { placeholderData: keepPreviousData });
6938
+ const listQuery = router.list.useQuery(queryInput, {
6939
+ placeholderData: keepPreviousData,
6940
+ staleTime: 0
6941
+ });
6939
6942
  const createMutation = router.create.useMutation();
6940
6943
  const updateMutation = router.update.useMutation();
6941
6944
  const deleteMutation = router.delete.useMutation();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wordrhyme/auto-crud",
3
3
  "type": "module",
4
- "version": "1.0.8",
4
+ "version": "1.0.9",
5
5
  "description": "Schema-first CRUD components with auto-generated tables and forms",
6
6
  "author": "wordrhyme",
7
7
  "license": "MIT",
@@ -71,6 +71,7 @@
71
71
  },
72
72
  "devDependencies": {
73
73
  "@tanstack/react-query": "^5.90.15",
74
+ "@testing-library/react": "^16.3.0",
74
75
  "@trpc/server": "^11.0.0",
75
76
  "@types/node": "^22.19.3",
76
77
  "@types/react": "^19.2.7",
@@ -84,8 +85,8 @@
84
85
  "@internal/eslint-config": "0.3.0",
85
86
  "@internal/prettier-config": "0.0.1",
86
87
  "@internal/tsconfig": "0.1.0",
87
- "@internal/tsdown-config": "0.1.0",
88
- "@internal/vitest-config": "0.1.0"
88
+ "@internal/vitest-config": "0.1.0",
89
+ "@internal/tsdown-config": "0.1.0"
89
90
  },
90
91
  "prettier": "@internal/prettier-config",
91
92
  "scripts": {