@wordrhyme/auto-crud 1.4.4 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/dist/index.cjs +69 -16
- package/dist/index.d.cts +28 -20
- package/dist/index.d.ts +12 -4
- package/dist/index.js +70 -18
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1021,6 +1021,29 @@ export default function TasksPage() {
|
|
|
1021
1021
|
|
|
1022
1022
|
## 🧰 工具函数
|
|
1023
1023
|
|
|
1024
|
+
### 配置日期展示策略
|
|
1025
|
+
|
|
1026
|
+
通过 `setDateFormatter` 可以让 AutoCrud 内部日期跟随宿主的语言和时区策略:
|
|
1027
|
+
|
|
1028
|
+
```typescript
|
|
1029
|
+
import { setDateFormatter } from '@wordrhyme/auto-crud';
|
|
1030
|
+
|
|
1031
|
+
const disposeDateFormatter = setDateFormatter((date, options) =>
|
|
1032
|
+
new Intl.DateTimeFormat(getCurrentLocale(), {
|
|
1033
|
+
...options,
|
|
1034
|
+
timeZone: getCurrentTimeZone(),
|
|
1035
|
+
}).format(date),
|
|
1036
|
+
);
|
|
1037
|
+
|
|
1038
|
+
// 应用卸载时移除当前注册
|
|
1039
|
+
disposeDateFormatter();
|
|
1040
|
+
|
|
1041
|
+
// 传入 undefined 可清空全部注册
|
|
1042
|
+
setDateFormatter(undefined);
|
|
1043
|
+
```
|
|
1044
|
+
|
|
1045
|
+
`setDateFormatter` 是进程/运行时级配置,建议在应用启动时注册一个稳定的 formatter。多个注册可以重叠,清理函数只移除对应注册,允许乱序清理。SSR 场景不要在每个请求中重复调用 setter;如需按请求选择语言或时区,应由稳定 formatter 通过宿主提供的并发安全上下文读取当前请求策略。
|
|
1046
|
+
|
|
1024
1047
|
### Schema Bridge - 核心转换函数
|
|
1025
1048
|
|
|
1026
1049
|
```typescript
|
|
@@ -1396,7 +1419,8 @@ export type { DataSource, ListParams, ListResult } from './lib/data-source';
|
|
|
1396
1419
|
|
|
1397
1420
|
// 工具函数
|
|
1398
1421
|
export { cn } from './lib/utils';
|
|
1399
|
-
export { formatDate } from './lib/format';
|
|
1422
|
+
export { formatDate, setDateFormatter } from './lib/format';
|
|
1423
|
+
export type { DateFormatter } from './lib/format';
|
|
1400
1424
|
export { humanize } from './lib/humanize';
|
|
1401
1425
|
```
|
|
1402
1426
|
|
package/dist/index.cjs
CHANGED
|
@@ -380,9 +380,77 @@ function getDefaultFilterOperator(filterVariant) {
|
|
|
380
380
|
return getFilterOperators(filterVariant)[0]?.value ?? (filterVariant === "text" ? "iLike" : "eq");
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
+
//#endregion
|
|
384
|
+
//#region src/lib/format.ts
|
|
385
|
+
let hostDateFormatters = [];
|
|
386
|
+
let dateFormatterVersion = 0;
|
|
387
|
+
const dateFormatterListeners = /* @__PURE__ */ new Set();
|
|
388
|
+
function notifyDateFormatterChange() {
|
|
389
|
+
dateFormatterVersion += 1;
|
|
390
|
+
dateFormatterListeners.forEach((listener) => listener());
|
|
391
|
+
}
|
|
392
|
+
function subscribeDateFormatter(listener) {
|
|
393
|
+
dateFormatterListeners.add(listener);
|
|
394
|
+
return () => {
|
|
395
|
+
dateFormatterListeners.delete(listener);
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
function getDateFormatterVersion() {
|
|
399
|
+
return dateFormatterVersion;
|
|
400
|
+
}
|
|
401
|
+
function useDateFormatterVersion() {
|
|
402
|
+
return (0, react.useSyncExternalStore)(subscribeDateFormatter, getDateFormatterVersion, getDateFormatterVersion);
|
|
403
|
+
}
|
|
404
|
+
function getHostDateFormatter() {
|
|
405
|
+
return hostDateFormatters[hostDateFormatters.length - 1]?.formatter;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Register the host's process-wide date presentation policy without coupling
|
|
409
|
+
* AutoCrud to locale or timezone selection. The returned cleanup removes only
|
|
410
|
+
* this registration, so overlapping registrations may be disposed out of order.
|
|
411
|
+
* Passing undefined clears every registration.
|
|
412
|
+
*/
|
|
413
|
+
function setDateFormatter(formatter) {
|
|
414
|
+
if (formatter === void 0) {
|
|
415
|
+
const hadFormatter = hostDateFormatters.length > 0;
|
|
416
|
+
hostDateFormatters = [];
|
|
417
|
+
if (hadFormatter) notifyDateFormatterChange();
|
|
418
|
+
return () => void 0;
|
|
419
|
+
}
|
|
420
|
+
const registration = {
|
|
421
|
+
formatter,
|
|
422
|
+
token: Symbol("date-formatter")
|
|
423
|
+
};
|
|
424
|
+
hostDateFormatters.push(registration);
|
|
425
|
+
notifyDateFormatterChange();
|
|
426
|
+
return () => {
|
|
427
|
+
const currentFormatter = getHostDateFormatter();
|
|
428
|
+
const previousLength = hostDateFormatters.length;
|
|
429
|
+
hostDateFormatters = hostDateFormatters.filter(({ token }) => token !== registration.token);
|
|
430
|
+
if (hostDateFormatters.length !== previousLength && getHostDateFormatter() !== currentFormatter) notifyDateFormatterChange();
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
function formatDate(date, opts = {}) {
|
|
434
|
+
if (date === void 0) return "";
|
|
435
|
+
try {
|
|
436
|
+
const value = new Date(date);
|
|
437
|
+
const options = {
|
|
438
|
+
month: opts.month ?? "long",
|
|
439
|
+
day: opts.day ?? "numeric",
|
|
440
|
+
year: opts.year ?? "numeric",
|
|
441
|
+
...opts
|
|
442
|
+
};
|
|
443
|
+
const hostDateFormatter = getHostDateFormatter();
|
|
444
|
+
return hostDateFormatter ? hostDateFormatter(value, options) : new Intl.DateTimeFormat("en-US", options).format(value);
|
|
445
|
+
} catch {
|
|
446
|
+
return "";
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
383
450
|
//#endregion
|
|
384
451
|
//#region src/components/data-table/data-table.tsx
|
|
385
452
|
function DataTable({ table, actionBar, children, className,...props }) {
|
|
453
|
+
useDateFormatterVersion();
|
|
386
454
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
387
455
|
className: cn("flex w-full flex-col gap-2.5 overflow-auto", className),
|
|
388
456
|
...props,
|
|
@@ -921,22 +989,6 @@ function useDebouncedCallback(callback, delay) {
|
|
|
921
989
|
}, [handleCallback, delay]);
|
|
922
990
|
}
|
|
923
991
|
|
|
924
|
-
//#endregion
|
|
925
|
-
//#region src/lib/format.ts
|
|
926
|
-
function formatDate(date, opts = {}) {
|
|
927
|
-
if (!date) return "";
|
|
928
|
-
try {
|
|
929
|
-
return new Intl.DateTimeFormat("en-US", {
|
|
930
|
-
month: opts.month ?? "long",
|
|
931
|
-
day: opts.day ?? "numeric",
|
|
932
|
-
year: opts.year ?? "numeric",
|
|
933
|
-
...opts
|
|
934
|
-
}).format(new Date(date));
|
|
935
|
-
} catch (_err) {
|
|
936
|
-
return "";
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
|
|
940
992
|
//#endregion
|
|
941
993
|
//#region src/components/data-table/data-table-filter-list.tsx
|
|
942
994
|
const DEBOUNCE_MS$2 = 300;
|
|
@@ -8546,6 +8598,7 @@ exports.parseImportFile = parseImportFile;
|
|
|
8546
8598
|
exports.parseJSON = parseJSON;
|
|
8547
8599
|
exports.parseZodField = parseZodField;
|
|
8548
8600
|
exports.resolveLocale = resolveLocale;
|
|
8601
|
+
exports.setDateFormatter = setDateFormatter;
|
|
8549
8602
|
exports.setSearchParams = setSearchParams;
|
|
8550
8603
|
exports.setToolbarResolver = setToolbarResolver;
|
|
8551
8604
|
exports.useAutoCrudResource = useAutoCrudResource;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { JsonSchemaFormScope } from "@wordrhyme/formily-shadcn";
|
|
4
4
|
import * as _tanstack_react_table0 from "@tanstack/react-table";
|
|
@@ -411,7 +411,7 @@ declare function AutoTableActionBar<TData>({
|
|
|
411
411
|
extraActions,
|
|
412
412
|
actions,
|
|
413
413
|
deleteConfirmation
|
|
414
|
-
}: AutoTableActionBarProps<TData>):
|
|
414
|
+
}: AutoTableActionBarProps<TData>): react_jsx_runtime3.JSX.Element;
|
|
415
415
|
//#endregion
|
|
416
416
|
//#region src/lib/schema-bridge/types.d.ts
|
|
417
417
|
/**
|
|
@@ -587,7 +587,7 @@ declare function AutoTable<T extends z.ZodObject<z.ZodRawShape>>({
|
|
|
587
587
|
onSelectedCountChange,
|
|
588
588
|
onSelectedRowsChange,
|
|
589
589
|
getSelectedRows
|
|
590
|
-
}: AutoTableProps<T>):
|
|
590
|
+
}: AutoTableProps<T>): react_jsx_runtime3.JSX.Element;
|
|
591
591
|
//#endregion
|
|
592
592
|
//#region src/i18n/locale.d.ts
|
|
593
593
|
/**
|
|
@@ -1079,7 +1079,7 @@ declare function AutoCrudTable<TSchema extends z.ZodObject<z.ZodRawShape>>({
|
|
|
1079
1079
|
toolbarActions,
|
|
1080
1080
|
locale: localeProp,
|
|
1081
1081
|
onCreate
|
|
1082
|
-
}: AutoCrudTableProps<TSchema>):
|
|
1082
|
+
}: AutoCrudTableProps<TSchema>): react_jsx_runtime3.JSX.Element;
|
|
1083
1083
|
//#endregion
|
|
1084
1084
|
//#region src/components/auto-crud/auto-form.d.ts
|
|
1085
1085
|
interface AutoFormProps<T extends z.ZodObject<z.ZodRawShape>> {
|
|
@@ -1118,7 +1118,7 @@ declare function AutoFormInner<T extends z.ZodObject<z.ZodRawShape>>({
|
|
|
1118
1118
|
labelAlign,
|
|
1119
1119
|
labelWidth,
|
|
1120
1120
|
showSubmitButton
|
|
1121
|
-
}: AutoFormProps<T>, ref: React.Ref<AutoFormRef>):
|
|
1121
|
+
}: AutoFormProps<T>, ref: React.Ref<AutoFormRef>): react_jsx_runtime3.JSX.Element;
|
|
1122
1122
|
declare const AutoForm: <T extends z.ZodObject<z.ZodRawShape>>(props: AutoFormProps<T> & {
|
|
1123
1123
|
ref?: React.Ref<AutoFormRef>;
|
|
1124
1124
|
}) => ReturnType<typeof AutoFormInner>;
|
|
@@ -1434,7 +1434,7 @@ declare function AutoTableSimpleFilters<TData>({
|
|
|
1434
1434
|
filters: externalFilters,
|
|
1435
1435
|
onFiltersChange,
|
|
1436
1436
|
leading
|
|
1437
|
-
}: AutoTableSimpleFiltersProps<TData>):
|
|
1437
|
+
}: AutoTableSimpleFiltersProps<TData>): react_jsx_runtime3.JSX.Element | null;
|
|
1438
1438
|
//#endregion
|
|
1439
1439
|
//#region src/components/auto-crud/form-modal.d.ts
|
|
1440
1440
|
type ModalVariant = 'dialog' | 'sheet';
|
|
@@ -1478,7 +1478,7 @@ declare function CrudFormModal<T extends z.ZodObject<z.ZodRawShape>>({
|
|
|
1478
1478
|
labelAlign,
|
|
1479
1479
|
labelWidth,
|
|
1480
1480
|
className
|
|
1481
|
-
}: CrudFormModalProps<T>):
|
|
1481
|
+
}: CrudFormModalProps<T>): react_jsx_runtime3.JSX.Element;
|
|
1482
1482
|
//#endregion
|
|
1483
1483
|
//#region src/components/auto-crud/import-dialog.d.ts
|
|
1484
1484
|
interface ImportDialogProps {
|
|
@@ -1500,7 +1500,7 @@ declare function ImportDialog({
|
|
|
1500
1500
|
columns,
|
|
1501
1501
|
title,
|
|
1502
1502
|
locale
|
|
1503
|
-
}: ImportDialogProps):
|
|
1503
|
+
}: ImportDialogProps): react_jsx_runtime3.JSX.Element;
|
|
1504
1504
|
//#endregion
|
|
1505
1505
|
//#region src/components/auto-crud/export-dialog.d.ts
|
|
1506
1506
|
type ExportMode = 'selected' | 'filtered';
|
|
@@ -1520,7 +1520,7 @@ declare function ExportDialog({
|
|
|
1520
1520
|
selectedCount,
|
|
1521
1521
|
onExport,
|
|
1522
1522
|
canExportFiltered
|
|
1523
|
-
}: ExportDialogProps):
|
|
1523
|
+
}: ExportDialogProps): react_jsx_runtime3.JSX.Element;
|
|
1524
1524
|
//#endregion
|
|
1525
1525
|
//#region src/components/data-table/data-table.d.ts
|
|
1526
1526
|
interface DataTableProps<TData> extends React$1.ComponentProps<'div'> {
|
|
@@ -1533,7 +1533,7 @@ declare function DataTable<TData>({
|
|
|
1533
1533
|
children,
|
|
1534
1534
|
className,
|
|
1535
1535
|
...props
|
|
1536
|
-
}: DataTableProps<TData>):
|
|
1536
|
+
}: DataTableProps<TData>): react_jsx_runtime3.JSX.Element;
|
|
1537
1537
|
//#endregion
|
|
1538
1538
|
//#region src/components/data-table/data-table-advanced-toolbar.d.ts
|
|
1539
1539
|
interface DataTableAdvancedToolbarProps<TData> extends React$1.ComponentProps<'div'> {
|
|
@@ -1544,7 +1544,7 @@ declare function DataTableAdvancedToolbar<TData>({
|
|
|
1544
1544
|
children,
|
|
1545
1545
|
className,
|
|
1546
1546
|
...props
|
|
1547
|
-
}: DataTableAdvancedToolbarProps<TData>):
|
|
1547
|
+
}: DataTableAdvancedToolbarProps<TData>): react_jsx_runtime3.JSX.Element;
|
|
1548
1548
|
//#endregion
|
|
1549
1549
|
//#region src/components/data-table/data-table-column-header.d.ts
|
|
1550
1550
|
interface DataTableColumnHeaderProps<TData, TValue> extends React.ComponentProps<typeof DropdownMenuTrigger> {
|
|
@@ -1556,7 +1556,7 @@ declare function DataTableColumnHeader<TData, TValue>({
|
|
|
1556
1556
|
label,
|
|
1557
1557
|
className,
|
|
1558
1558
|
...props
|
|
1559
|
-
}: DataTableColumnHeaderProps<TData, TValue>):
|
|
1559
|
+
}: DataTableColumnHeaderProps<TData, TValue>): react_jsx_runtime3.JSX.Element;
|
|
1560
1560
|
//#endregion
|
|
1561
1561
|
//#region src/components/data-table/data-table-faceted-filter.d.ts
|
|
1562
1562
|
interface DataTableFacetedFilterProps<TData, TValue> {
|
|
@@ -1570,7 +1570,7 @@ declare function DataTableFacetedFilter<TData, TValue>({
|
|
|
1570
1570
|
title,
|
|
1571
1571
|
options,
|
|
1572
1572
|
multiple
|
|
1573
|
-
}: DataTableFacetedFilterProps<TData, TValue>):
|
|
1573
|
+
}: DataTableFacetedFilterProps<TData, TValue>): react_jsx_runtime3.JSX.Element;
|
|
1574
1574
|
//#endregion
|
|
1575
1575
|
//#region src/components/data-table/data-table-pagination.d.ts
|
|
1576
1576
|
interface DataTablePaginationProps<TData> extends React.ComponentProps<'div'> {
|
|
@@ -1582,7 +1582,7 @@ declare function DataTablePagination<TData>({
|
|
|
1582
1582
|
pageSizeOptions,
|
|
1583
1583
|
className,
|
|
1584
1584
|
...props
|
|
1585
|
-
}: DataTablePaginationProps<TData>):
|
|
1585
|
+
}: DataTablePaginationProps<TData>): react_jsx_runtime3.JSX.Element;
|
|
1586
1586
|
//#endregion
|
|
1587
1587
|
//#region src/components/data-table/data-table-toolbar.d.ts
|
|
1588
1588
|
interface DataTableToolbarProps<TData> extends React$1.ComponentProps<'div'> {
|
|
@@ -1593,7 +1593,7 @@ declare function DataTableToolbar<TData>({
|
|
|
1593
1593
|
children,
|
|
1594
1594
|
className,
|
|
1595
1595
|
...props
|
|
1596
|
-
}: DataTableToolbarProps<TData>):
|
|
1596
|
+
}: DataTableToolbarProps<TData>): react_jsx_runtime3.JSX.Element;
|
|
1597
1597
|
//#endregion
|
|
1598
1598
|
//#region src/components/data-table/data-table-view-options.d.ts
|
|
1599
1599
|
interface DataTableViewOptionsProps<TData> extends React$1.ComponentProps<typeof PopoverContent> {
|
|
@@ -1604,7 +1604,7 @@ declare function DataTableViewOptions<TData>({
|
|
|
1604
1604
|
table,
|
|
1605
1605
|
disabled,
|
|
1606
1606
|
...props
|
|
1607
|
-
}: DataTableViewOptionsProps<TData>):
|
|
1607
|
+
}: DataTableViewOptionsProps<TData>): react_jsx_runtime3.JSX.Element;
|
|
1608
1608
|
//#endregion
|
|
1609
1609
|
//#region src/lib/crud-actions.d.ts
|
|
1610
1610
|
type CrudActionZone = 'toolbar' | 'row' | 'batch';
|
|
@@ -1898,10 +1898,15 @@ declare function createMemoryDataSource<T extends {
|
|
|
1898
1898
|
id: string | number;
|
|
1899
1899
|
}>(initialData?: T[]): DataSource<T>;
|
|
1900
1900
|
//#endregion
|
|
1901
|
-
//#region src/lib/utils.d.ts
|
|
1902
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
1903
|
-
//#endregion
|
|
1904
1901
|
//#region src/lib/format.d.ts
|
|
1902
|
+
type DateFormatter = (date: Date, options: Intl.DateTimeFormatOptions) => string;
|
|
1903
|
+
/**
|
|
1904
|
+
* Register the host's process-wide date presentation policy without coupling
|
|
1905
|
+
* AutoCrud to locale or timezone selection. The returned cleanup removes only
|
|
1906
|
+
* this registration, so overlapping registrations may be disposed out of order.
|
|
1907
|
+
* Passing undefined clears every registration.
|
|
1908
|
+
*/
|
|
1909
|
+
declare function setDateFormatter(formatter?: DateFormatter): () => void;
|
|
1905
1910
|
declare function formatDate(date: Date | string | number | undefined, opts?: Intl.DateTimeFormatOptions): string;
|
|
1906
1911
|
//#endregion
|
|
1907
1912
|
//#region src/lib/humanize.d.ts
|
|
@@ -1915,6 +1920,9 @@ declare function formatDate(date: Date | string | number | undefined, opts?: Int
|
|
|
1915
1920
|
*/
|
|
1916
1921
|
declare function humanize(str: string): string;
|
|
1917
1922
|
//#endregion
|
|
1923
|
+
//#region src/lib/utils.d.ts
|
|
1924
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
1925
|
+
//#endregion
|
|
1918
1926
|
//#region src/lib/import.d.ts
|
|
1919
1927
|
interface ParsedImportData {
|
|
1920
1928
|
headers: string[];
|
|
@@ -1979,4 +1987,4 @@ declare function exportAllToCSV<T extends Record<string, unknown>>(data: T[], op
|
|
|
1979
1987
|
*/
|
|
1980
1988
|
declare function downloadCSVTemplate(headers: string[], filename?: string): void;
|
|
1981
1989
|
//#endregion
|
|
1982
|
-
export { type ActionConfig, type ActionItem, type ActionsColumnConfig, type AutoCrudActionConfig, type AutoCrudActionsConfig, type AutoCrudDataSourceConfig, type AutoCrudDataSourceContext, type AutoCrudDataSourceEntry, type AutoCrudDataSourceLoader, type AutoCrudDataSourceRegistration, type AutoCrudFormComponentConfig, type AutoCrudLocale, type AutoCrudOption, type AutoCrudQueryCapabilities, type AutoCrudRowActionContext, AutoCrudTable, type AutoCrudTableProps, type AutoCrudToolbarContext, type AutoCrudToolbarResolver, AutoForm, type AutoFormProps, 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, type CrudActionBase, type CrudActionEntry, type CrudActionRegistration, type CrudActionZone, 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, type RowActionConfig, type RowActionItem, type RowBuiltinActionItem, type RowBuiltinActionType, type RowCustomActionItem, SchemaAdapter, Select, type SelectMode, type SelectOption, type SelectProps, type SelectSearchableDynamicProps, type SelectSearchableMultipleProps, type SelectSearchableProps, type SelectSearchableSingleProps, type SelectSimpleProps, type SelectTriggerRenderProps, type SimpleFieldConfig, type SimpleFieldsConfig, type ToastAdapter, type ToolbarActionConfig, type ToolbarActionItem, type ToolbarBuiltinActionItem, type ToolbarBuiltinActionType, type ToolbarCustomActionItem, type UnifiedField, type UnifiedSchema, type UrlStateOptions, type UseAutoCrudResourceOptions, type UseAutoCrudResourceParams, type UseAutoCrudResourceReturn, cn, coerceRowValues, components, createActionsColumn, createEditFormSchema, createFormSchema, createMemoryDataSource, createSelectColumn, createTRPCDataSource, createTableSchema, crudActions, 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 };
|
|
1990
|
+
export { type ActionConfig, type ActionItem, type ActionsColumnConfig, type AutoCrudActionConfig, type AutoCrudActionsConfig, type AutoCrudDataSourceConfig, type AutoCrudDataSourceContext, type AutoCrudDataSourceEntry, type AutoCrudDataSourceLoader, type AutoCrudDataSourceRegistration, type AutoCrudFormComponentConfig, type AutoCrudLocale, type AutoCrudOption, type AutoCrudQueryCapabilities, type AutoCrudRowActionContext, AutoCrudTable, type AutoCrudTableProps, type AutoCrudToolbarContext, type AutoCrudToolbarResolver, AutoForm, type AutoFormProps, 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, type CrudActionBase, type CrudActionEntry, type CrudActionRegistration, type CrudActionZone, CrudFormModal, type CrudHooks, type CrudOperationPermissions, type CrudPermissions, type DataSource, DataTable, DataTableAdvancedToolbar, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableRowAction, DataTableToolbar, DataTableViewOptions, type DateFormatter, 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, type RowActionConfig, type RowActionItem, type RowBuiltinActionItem, type RowBuiltinActionType, type RowCustomActionItem, SchemaAdapter, Select, type SelectMode, type SelectOption, type SelectProps, type SelectSearchableDynamicProps, type SelectSearchableMultipleProps, type SelectSearchableProps, type SelectSearchableSingleProps, type SelectSimpleProps, type SelectTriggerRenderProps, type SimpleFieldConfig, type SimpleFieldsConfig, type ToastAdapter, type ToolbarActionConfig, type ToolbarActionItem, type ToolbarBuiltinActionItem, type ToolbarBuiltinActionType, type ToolbarCustomActionItem, type UnifiedField, type UnifiedSchema, type UrlStateOptions, type UseAutoCrudResourceOptions, type UseAutoCrudResourceParams, type UseAutoCrudResourceReturn, cn, coerceRowValues, components, createActionsColumn, createEditFormSchema, createFormSchema, createMemoryDataSource, createSelectColumn, createTRPCDataSource, createTableSchema, crudActions, 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, setDateFormatter, setSearchParams, setToolbarResolver, useAutoCrudResource, useDataTable, useQueryState, useQueryStates, useReadableFilters, useUrlState, useUrlStates, zhCN };
|
package/dist/index.d.ts
CHANGED
|
@@ -1898,10 +1898,15 @@ declare function createMemoryDataSource<T extends {
|
|
|
1898
1898
|
id: string | number;
|
|
1899
1899
|
}>(initialData?: T[]): DataSource<T>;
|
|
1900
1900
|
//#endregion
|
|
1901
|
-
//#region src/lib/utils.d.ts
|
|
1902
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
1903
|
-
//#endregion
|
|
1904
1901
|
//#region src/lib/format.d.ts
|
|
1902
|
+
type DateFormatter = (date: Date, options: Intl.DateTimeFormatOptions) => string;
|
|
1903
|
+
/**
|
|
1904
|
+
* Register the host's process-wide date presentation policy without coupling
|
|
1905
|
+
* AutoCrud to locale or timezone selection. The returned cleanup removes only
|
|
1906
|
+
* this registration, so overlapping registrations may be disposed out of order.
|
|
1907
|
+
* Passing undefined clears every registration.
|
|
1908
|
+
*/
|
|
1909
|
+
declare function setDateFormatter(formatter?: DateFormatter): () => void;
|
|
1905
1910
|
declare function formatDate(date: Date | string | number | undefined, opts?: Intl.DateTimeFormatOptions): string;
|
|
1906
1911
|
//#endregion
|
|
1907
1912
|
//#region src/lib/humanize.d.ts
|
|
@@ -1915,6 +1920,9 @@ declare function formatDate(date: Date | string | number | undefined, opts?: Int
|
|
|
1915
1920
|
*/
|
|
1916
1921
|
declare function humanize(str: string): string;
|
|
1917
1922
|
//#endregion
|
|
1923
|
+
//#region src/lib/utils.d.ts
|
|
1924
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
1925
|
+
//#endregion
|
|
1918
1926
|
//#region src/lib/import.d.ts
|
|
1919
1927
|
interface ParsedImportData {
|
|
1920
1928
|
headers: string[];
|
|
@@ -1979,4 +1987,4 @@ declare function exportAllToCSV<T extends Record<string, unknown>>(data: T[], op
|
|
|
1979
1987
|
*/
|
|
1980
1988
|
declare function downloadCSVTemplate(headers: string[], filename?: string): void;
|
|
1981
1989
|
//#endregion
|
|
1982
|
-
export { type ActionConfig, type ActionItem, type ActionsColumnConfig, type AutoCrudActionConfig, type AutoCrudActionsConfig, type AutoCrudDataSourceConfig, type AutoCrudDataSourceContext, type AutoCrudDataSourceEntry, type AutoCrudDataSourceLoader, type AutoCrudDataSourceRegistration, type AutoCrudFormComponentConfig, type AutoCrudLocale, type AutoCrudOption, type AutoCrudQueryCapabilities, type AutoCrudRowActionContext, AutoCrudTable, type AutoCrudTableProps, type AutoCrudToolbarContext, type AutoCrudToolbarResolver, AutoForm, type AutoFormProps, 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, type CrudActionBase, type CrudActionEntry, type CrudActionRegistration, type CrudActionZone, 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, type RowActionConfig, type RowActionItem, type RowBuiltinActionItem, type RowBuiltinActionType, type RowCustomActionItem, SchemaAdapter, Select, type SelectMode, type SelectOption, type SelectProps, type SelectSearchableDynamicProps, type SelectSearchableMultipleProps, type SelectSearchableProps, type SelectSearchableSingleProps, type SelectSimpleProps, type SelectTriggerRenderProps, type SimpleFieldConfig, type SimpleFieldsConfig, type ToastAdapter, type ToolbarActionConfig, type ToolbarActionItem, type ToolbarBuiltinActionItem, type ToolbarBuiltinActionType, type ToolbarCustomActionItem, type UnifiedField, type UnifiedSchema, type UrlStateOptions, type UseAutoCrudResourceOptions, type UseAutoCrudResourceParams, type UseAutoCrudResourceReturn, cn, coerceRowValues, components, createActionsColumn, createEditFormSchema, createFormSchema, createMemoryDataSource, createSelectColumn, createTRPCDataSource, createTableSchema, crudActions, 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 };
|
|
1990
|
+
export { type ActionConfig, type ActionItem, type ActionsColumnConfig, type AutoCrudActionConfig, type AutoCrudActionsConfig, type AutoCrudDataSourceConfig, type AutoCrudDataSourceContext, type AutoCrudDataSourceEntry, type AutoCrudDataSourceLoader, type AutoCrudDataSourceRegistration, type AutoCrudFormComponentConfig, type AutoCrudLocale, type AutoCrudOption, type AutoCrudQueryCapabilities, type AutoCrudRowActionContext, AutoCrudTable, type AutoCrudTableProps, type AutoCrudToolbarContext, type AutoCrudToolbarResolver, AutoForm, type AutoFormProps, 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, type CrudActionBase, type CrudActionEntry, type CrudActionRegistration, type CrudActionZone, CrudFormModal, type CrudHooks, type CrudOperationPermissions, type CrudPermissions, type DataSource, DataTable, DataTableAdvancedToolbar, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableRowAction, DataTableToolbar, DataTableViewOptions, type DateFormatter, 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, type RowActionConfig, type RowActionItem, type RowBuiltinActionItem, type RowBuiltinActionType, type RowCustomActionItem, SchemaAdapter, Select, type SelectMode, type SelectOption, type SelectProps, type SelectSearchableDynamicProps, type SelectSearchableMultipleProps, type SelectSearchableProps, type SelectSearchableSingleProps, type SelectSimpleProps, type SelectTriggerRenderProps, type SimpleFieldConfig, type SimpleFieldsConfig, type ToastAdapter, type ToolbarActionConfig, type ToolbarActionItem, type ToolbarBuiltinActionItem, type ToolbarBuiltinActionType, type ToolbarCustomActionItem, type UnifiedField, type UnifiedSchema, type UrlStateOptions, type UseAutoCrudResourceOptions, type UseAutoCrudResourceParams, type UseAutoCrudResourceReturn, cn, coerceRowValues, components, createActionsColumn, createEditFormSchema, createFormSchema, createMemoryDataSource, createSelectColumn, createTRPCDataSource, createTableSchema, crudActions, 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, setDateFormatter, setSearchParams, setToolbarResolver, useAutoCrudResource, useDataTable, useQueryState, useQueryStates, useReadableFilters, useUrlState, useUrlStates, zhCN };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef, useState } from "react";
|
|
2
|
+
import { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
3
3
|
import { ArrowDownUp, BadgeCheck, CalendarIcon, Check, CheckCircle2, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, ChevronsLeft, ChevronsRight, ChevronsUpDown, CommandIcon, Download, Ellipsis, EyeOff, FileDown, FileSpreadsheetIcon, GripVertical, ListFilter, ListFilterIcon, Loader2, PlusCircle, RefreshCw, Settings2, Text, Trash2, Upload, X, XCircle } from "lucide-react";
|
|
4
4
|
import { flexRender, getCoreRowModel, getFacetedMinMaxValues, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from "@tanstack/react-table";
|
|
5
5
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, Badge, Button, Calendar, Checkbox, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, Input, Label, Popover, PopoverContent, PopoverTrigger, Select as Select$1, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, Slider, Switch, Table as Table$1, TableBody, TableCell, TableHead, TableHeader, TableRow, cn as cn$1 } from "@wordrhyme/shadcn";
|
|
@@ -343,9 +343,77 @@ function getDefaultFilterOperator(filterVariant) {
|
|
|
343
343
|
return getFilterOperators(filterVariant)[0]?.value ?? (filterVariant === "text" ? "iLike" : "eq");
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region src/lib/format.ts
|
|
348
|
+
let hostDateFormatters = [];
|
|
349
|
+
let dateFormatterVersion = 0;
|
|
350
|
+
const dateFormatterListeners = /* @__PURE__ */ new Set();
|
|
351
|
+
function notifyDateFormatterChange() {
|
|
352
|
+
dateFormatterVersion += 1;
|
|
353
|
+
dateFormatterListeners.forEach((listener) => listener());
|
|
354
|
+
}
|
|
355
|
+
function subscribeDateFormatter(listener) {
|
|
356
|
+
dateFormatterListeners.add(listener);
|
|
357
|
+
return () => {
|
|
358
|
+
dateFormatterListeners.delete(listener);
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
function getDateFormatterVersion() {
|
|
362
|
+
return dateFormatterVersion;
|
|
363
|
+
}
|
|
364
|
+
function useDateFormatterVersion() {
|
|
365
|
+
return useSyncExternalStore(subscribeDateFormatter, getDateFormatterVersion, getDateFormatterVersion);
|
|
366
|
+
}
|
|
367
|
+
function getHostDateFormatter() {
|
|
368
|
+
return hostDateFormatters[hostDateFormatters.length - 1]?.formatter;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Register the host's process-wide date presentation policy without coupling
|
|
372
|
+
* AutoCrud to locale or timezone selection. The returned cleanup removes only
|
|
373
|
+
* this registration, so overlapping registrations may be disposed out of order.
|
|
374
|
+
* Passing undefined clears every registration.
|
|
375
|
+
*/
|
|
376
|
+
function setDateFormatter(formatter) {
|
|
377
|
+
if (formatter === void 0) {
|
|
378
|
+
const hadFormatter = hostDateFormatters.length > 0;
|
|
379
|
+
hostDateFormatters = [];
|
|
380
|
+
if (hadFormatter) notifyDateFormatterChange();
|
|
381
|
+
return () => void 0;
|
|
382
|
+
}
|
|
383
|
+
const registration = {
|
|
384
|
+
formatter,
|
|
385
|
+
token: Symbol("date-formatter")
|
|
386
|
+
};
|
|
387
|
+
hostDateFormatters.push(registration);
|
|
388
|
+
notifyDateFormatterChange();
|
|
389
|
+
return () => {
|
|
390
|
+
const currentFormatter = getHostDateFormatter();
|
|
391
|
+
const previousLength = hostDateFormatters.length;
|
|
392
|
+
hostDateFormatters = hostDateFormatters.filter(({ token }) => token !== registration.token);
|
|
393
|
+
if (hostDateFormatters.length !== previousLength && getHostDateFormatter() !== currentFormatter) notifyDateFormatterChange();
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
function formatDate(date, opts = {}) {
|
|
397
|
+
if (date === void 0) return "";
|
|
398
|
+
try {
|
|
399
|
+
const value = new Date(date);
|
|
400
|
+
const options = {
|
|
401
|
+
month: opts.month ?? "long",
|
|
402
|
+
day: opts.day ?? "numeric",
|
|
403
|
+
year: opts.year ?? "numeric",
|
|
404
|
+
...opts
|
|
405
|
+
};
|
|
406
|
+
const hostDateFormatter = getHostDateFormatter();
|
|
407
|
+
return hostDateFormatter ? hostDateFormatter(value, options) : new Intl.DateTimeFormat("en-US", options).format(value);
|
|
408
|
+
} catch {
|
|
409
|
+
return "";
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
346
413
|
//#endregion
|
|
347
414
|
//#region src/components/data-table/data-table.tsx
|
|
348
415
|
function DataTable({ table, actionBar, children, className,...props }) {
|
|
416
|
+
useDateFormatterVersion();
|
|
349
417
|
return /* @__PURE__ */ jsxs("div", {
|
|
350
418
|
className: cn("flex w-full flex-col gap-2.5 overflow-auto", className),
|
|
351
419
|
...props,
|
|
@@ -884,22 +952,6 @@ function useDebouncedCallback(callback, delay) {
|
|
|
884
952
|
}, [handleCallback, delay]);
|
|
885
953
|
}
|
|
886
954
|
|
|
887
|
-
//#endregion
|
|
888
|
-
//#region src/lib/format.ts
|
|
889
|
-
function formatDate(date, opts = {}) {
|
|
890
|
-
if (!date) return "";
|
|
891
|
-
try {
|
|
892
|
-
return new Intl.DateTimeFormat("en-US", {
|
|
893
|
-
month: opts.month ?? "long",
|
|
894
|
-
day: opts.day ?? "numeric",
|
|
895
|
-
year: opts.year ?? "numeric",
|
|
896
|
-
...opts
|
|
897
|
-
}).format(new Date(date));
|
|
898
|
-
} catch (_err) {
|
|
899
|
-
return "";
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
|
|
903
955
|
//#endregion
|
|
904
956
|
//#region src/components/data-table/data-table-filter-list.tsx
|
|
905
957
|
const DEBOUNCE_MS$2 = 300;
|
|
@@ -8442,4 +8494,4 @@ function createMemoryDataSource(initialData = []) {
|
|
|
8442
8494
|
}
|
|
8443
8495
|
|
|
8444
8496
|
//#endregion
|
|
8445
|
-
export { AutoCrudTable, AutoForm, AutoTable, AutoTableActionBar, AutoTableSimpleFilters, CrudFormModal, DataTable, DataTableAdvancedToolbar, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableToolbar, DataTableViewOptions, ExportDialog, ImportDialog, MultiCombobox, SchemaAdapter, Select, cn, coerceRowValues, components, createActionsColumn, createEditFormSchema, createFormSchema, createMemoryDataSource, createSelectColumn, createTRPCDataSource, createTableSchema, crudActions, 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 };
|
|
8497
|
+
export { AutoCrudTable, AutoForm, AutoTable, AutoTableActionBar, AutoTableSimpleFilters, CrudFormModal, DataTable, DataTableAdvancedToolbar, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableToolbar, DataTableViewOptions, ExportDialog, ImportDialog, MultiCombobox, SchemaAdapter, Select, cn, coerceRowValues, components, createActionsColumn, createEditFormSchema, createFormSchema, createMemoryDataSource, createSelectColumn, createTRPCDataSource, createTableSchema, crudActions, 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, setDateFormatter, 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.
|
|
4
|
+
"version": "1.5.1",
|
|
5
5
|
"description": "Schema-first CRUD components with auto-generated tables and forms",
|
|
6
6
|
"author": "wordrhyme",
|
|
7
7
|
"license": "MIT",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"tailwind-merge": "^3.5.0",
|
|
64
64
|
"vaul": "^1.1.2",
|
|
65
65
|
"@wordrhyme/formily-shadcn": "1.13.2",
|
|
66
|
-
"@wordrhyme/shadcn": "1.
|
|
67
|
-
"@wordrhyme/shadcn
|
|
66
|
+
"@wordrhyme/shadcn-ui": "1.32.7",
|
|
67
|
+
"@wordrhyme/shadcn": "1.3.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@storybook/react": "^8.6.18",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"tsdown": "^0.15.12",
|
|
85
85
|
"typescript": "^5.9.3",
|
|
86
86
|
"vitest": "^3.2.4",
|
|
87
|
+
"@internal/prettier-config": "0.0.1",
|
|
87
88
|
"@internal/eslint-config": "0.3.0",
|
|
88
89
|
"@internal/tsconfig": "0.1.0",
|
|
89
|
-
"@internal/prettier-config": "0.0.1",
|
|
90
90
|
"@internal/tsdown-config": "0.1.0",
|
|
91
91
|
"@internal/vitest-config": "0.1.0"
|
|
92
92
|
},
|