imean-service-engine-htmx-plugin 2.10.1 → 2.11.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/dist/index.d.mts +78 -31
- package/dist/index.d.ts +78 -31
- package/dist/index.js +475 -212
- package/dist/index.mjs +475 -212
- package/docs/filter-schema-type-conversion.md +405 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -270,18 +270,24 @@ interface Feature {
|
|
|
270
270
|
}
|
|
271
271
|
/**
|
|
272
272
|
* 列表查询参数
|
|
273
|
+
* @template F 筛选条件的类型(从 filterSchema 推导)
|
|
273
274
|
*/
|
|
274
|
-
interface ListParams {
|
|
275
|
+
interface ListParams<F = Record<string, any>> {
|
|
275
276
|
/** 页码(从1开始) */
|
|
276
277
|
page?: number;
|
|
277
278
|
/** 每页数量 */
|
|
278
279
|
pageSize?: number;
|
|
280
|
+
/**
|
|
281
|
+
* Cassandra 风格分页游标
|
|
282
|
+
* 用于请求下一页(由上一次响应返回)
|
|
283
|
+
*/
|
|
284
|
+
pageState?: string;
|
|
279
285
|
/** 排序字段 */
|
|
280
286
|
sortBy?: string;
|
|
281
287
|
/** 排序方向 */
|
|
282
288
|
sortOrder?: "asc" | "desc";
|
|
283
289
|
/** 筛选条件 */
|
|
284
|
-
filters?:
|
|
290
|
+
filters?: F;
|
|
285
291
|
}
|
|
286
292
|
/**
|
|
287
293
|
* 列表查询结果
|
|
@@ -289,14 +295,19 @@ interface ListParams {
|
|
|
289
295
|
interface ListResult<T> {
|
|
290
296
|
/** 数据列表 */
|
|
291
297
|
items: T[];
|
|
292
|
-
/**
|
|
293
|
-
total
|
|
294
|
-
/**
|
|
295
|
-
page
|
|
298
|
+
/** 总数量(传统分页才有) */
|
|
299
|
+
total?: number;
|
|
300
|
+
/** 当前页码(传统分页才有) */
|
|
301
|
+
page?: number;
|
|
296
302
|
/** 每页数量 */
|
|
297
303
|
pageSize: number;
|
|
298
|
-
/**
|
|
299
|
-
totalPages
|
|
304
|
+
/** 总页数(传统分页才有) */
|
|
305
|
+
totalPages?: number;
|
|
306
|
+
/**
|
|
307
|
+
* Cassandra 风格分页游标
|
|
308
|
+
* 用于请求下一页
|
|
309
|
+
*/
|
|
310
|
+
pageState?: string | null;
|
|
300
311
|
}
|
|
301
312
|
/**
|
|
302
313
|
* 用户信息接口
|
|
@@ -540,6 +551,9 @@ declare abstract class BaseModelFeature<T extends ZodObject, M = z$1.infer<T>> e
|
|
|
540
551
|
* 表单操作类型
|
|
541
552
|
*/
|
|
542
553
|
type FormAction = "create" | "edit";
|
|
554
|
+
interface BaseFormFeatureOptions<T extends ZodObject = z$1.ZodObject, M = z$1.infer<T>> extends BaseModelFeatureOptions<T, M> {
|
|
555
|
+
actions?: ActionButton[];
|
|
556
|
+
}
|
|
543
557
|
/**
|
|
544
558
|
* 表单 Feature 基类
|
|
545
559
|
* 用于创建和编辑 Feature 的共同逻辑
|
|
@@ -570,6 +584,8 @@ declare abstract class BaseFormFeature<T extends ZodObject = z$1.ZodObject, M =
|
|
|
570
584
|
* 获取取消按钮的跳转 URL
|
|
571
585
|
*/
|
|
572
586
|
abstract getCancelUrl(context: FeatureContext): string | undefined;
|
|
587
|
+
protected options: BaseFormFeatureOptions<T, M>;
|
|
588
|
+
constructor(options: BaseFormFeatureOptions<T, M>);
|
|
573
589
|
/**
|
|
574
590
|
* 设置标题和描述到 context
|
|
575
591
|
*/
|
|
@@ -600,15 +616,15 @@ declare abstract class BaseFormFeature<T extends ZodObject = z$1.ZodObject, M =
|
|
|
600
616
|
* 默认创建 Feature
|
|
601
617
|
*/
|
|
602
618
|
declare class DefaultCreateFeature<T extends ZodObject = z$2.ZodObject, M = z$2.infer<T>> extends BaseFormFeature<T, M> {
|
|
603
|
-
private options;
|
|
604
619
|
private createItem;
|
|
605
|
-
constructor(
|
|
620
|
+
constructor(createOptions: Omit<BaseFormFeatureOptions<T, M>, "name" | "type" | "routes" | "render"> & {
|
|
606
621
|
schema: T;
|
|
607
622
|
createItem: (data: Partial<M>) => Promise<M>;
|
|
608
623
|
permission?: string;
|
|
609
624
|
dialogSize?: DialogSize;
|
|
610
625
|
closeOnBackdropClick?: boolean;
|
|
611
626
|
groups?: FieldGroup[];
|
|
627
|
+
actions?: ActionButton[];
|
|
612
628
|
});
|
|
613
629
|
getFormAction(): "create";
|
|
614
630
|
getSubmitUrl(context: FeatureContext): string;
|
|
@@ -662,10 +678,9 @@ declare class DefaultDetailFeature<T extends ZodObject = z$2.ZodObject, M = z$2.
|
|
|
662
678
|
* 默认编辑 Feature
|
|
663
679
|
*/
|
|
664
680
|
declare class DefaultEditFeature<T extends ZodObject = z$2.ZodObject, M = z$2.infer<T>, ID = keyof M> extends BaseFormFeature<T, M> {
|
|
665
|
-
private options;
|
|
666
681
|
private getItem;
|
|
667
682
|
private updateItem;
|
|
668
|
-
constructor(
|
|
683
|
+
constructor(editOptions: Omit<BaseModelFeatureOptions<T, M>, "name" | "type" | "routes" | "render" | "actions"> & {
|
|
669
684
|
schema: T;
|
|
670
685
|
getItem: (id: ID) => Promise<M | null | undefined>;
|
|
671
686
|
updateItem: (id: ID, data: Partial<M>) => Promise<M | null>;
|
|
@@ -686,20 +701,26 @@ declare class DefaultEditFeature<T extends ZodObject = z$2.ZodObject, M = z$2.in
|
|
|
686
701
|
* 默认列表 Feature
|
|
687
702
|
*/
|
|
688
703
|
|
|
704
|
+
/**
|
|
705
|
+
* 从 filterSchema 推导 filters 的类型
|
|
706
|
+
* 如果 filterSchema 是 optional,则 filters 也是 optional
|
|
707
|
+
*/
|
|
708
|
+
type InferFilterType<FSchema extends z$2.ZodObject<any> | undefined> = FSchema extends z$2.ZodObject<infer Shape> ? Partial<z$2.infer<FSchema>> : Record<string, any> | undefined;
|
|
689
709
|
/**
|
|
690
710
|
* 默认列表 Feature
|
|
691
711
|
*/
|
|
692
|
-
declare class DefaultListFeature<T extends ZodObject = z$2.ZodObject, M = z$2.infer<T>, ID = keyof M> extends BaseModelFeature<T, M> {
|
|
712
|
+
declare class DefaultListFeature<T extends ZodObject = z$2.ZodObject, M = z$2.infer<T>, ID = keyof M, FSchema extends z$2.ZodObject<any> | undefined = z$2.ZodObject<any> | undefined> extends BaseModelFeature<T, M> {
|
|
693
713
|
private options;
|
|
694
714
|
private getList;
|
|
695
715
|
private deleteItem?;
|
|
696
716
|
private filterSchema?;
|
|
697
717
|
private filterFields;
|
|
698
718
|
private openMode?;
|
|
699
|
-
constructor(options: Omit<BaseModelFeatureOptions<T, M>, "name" | "type" | "routes" | "render"
|
|
700
|
-
getList: (params: ListParams) => Promise<ListResult<M>>;
|
|
719
|
+
constructor(options: Omit<BaseModelFeatureOptions<T, M>, "name" | "type" | "routes" | "render"> & {
|
|
720
|
+
getList: (params: ListParams<InferFilterType<FSchema>>) => Promise<ListResult<M>>;
|
|
701
721
|
deleteItem?: (id: ID) => Promise<boolean>;
|
|
702
|
-
filterSchema?:
|
|
722
|
+
filterSchema?: FSchema;
|
|
723
|
+
actions?: ActionButton[];
|
|
703
724
|
openMode?: {
|
|
704
725
|
create?: OpenMode;
|
|
705
726
|
detail?: OpenMode;
|
|
@@ -756,9 +777,13 @@ declare function getUserInfo(ctx: Context, authProvider?: AuthProvider): Promise
|
|
|
756
777
|
*/
|
|
757
778
|
|
|
758
779
|
/**
|
|
759
|
-
*
|
|
780
|
+
* 解析列表查询参数(带 filterSchema 类型推导)
|
|
760
781
|
*/
|
|
761
|
-
declare function parseListParams(ctx: Context): ListParams
|
|
782
|
+
declare function parseListParams<FSchema extends z$2.ZodObject<any>>(ctx: Context, filterSchema: FSchema): ListParams<Partial<z$2.infer<FSchema>>>;
|
|
783
|
+
/**
|
|
784
|
+
* 解析列表查询参数(不带 filterSchema)
|
|
785
|
+
*/
|
|
786
|
+
declare function parseListParams(ctx: Context, filterSchema?: undefined): ListParams<Record<string, any> | undefined>;
|
|
762
787
|
|
|
763
788
|
/**
|
|
764
789
|
* 路径工具函数
|
|
@@ -837,18 +862,34 @@ interface ErrorAlertProps {
|
|
|
837
862
|
*/
|
|
838
863
|
declare function ErrorAlert(props: ErrorAlertProps): hono_jsx_jsx_dev_runtime.JSX.Element;
|
|
839
864
|
|
|
865
|
+
/**
|
|
866
|
+
* 动态筛选组件的类型定义
|
|
867
|
+
*/
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* 动态筛选组件 Props
|
|
871
|
+
*/
|
|
872
|
+
interface DynamicFiltersProps {
|
|
873
|
+
/** 可用的筛选字段 */
|
|
874
|
+
fields: FormField[];
|
|
875
|
+
/** 列表路径(用于提交筛选表单) */
|
|
876
|
+
listPath: string;
|
|
877
|
+
/** 当前筛选参数 */
|
|
878
|
+
currentFilters?: Record<string, any> | undefined;
|
|
879
|
+
}
|
|
880
|
+
|
|
840
881
|
interface FilterFormProps {
|
|
841
882
|
/** 筛选字段 */
|
|
842
883
|
fields: FormField[];
|
|
843
884
|
/** 列表路径(用于提交筛选表单) */
|
|
844
885
|
listPath: string;
|
|
845
886
|
/** 当前筛选参数 */
|
|
846
|
-
currentFilters?: Record<string, any
|
|
887
|
+
currentFilters?: Record<string, any> | undefined;
|
|
847
888
|
}
|
|
848
889
|
/**
|
|
849
|
-
*
|
|
890
|
+
* 动态筛选组件
|
|
850
891
|
*/
|
|
851
|
-
declare function
|
|
892
|
+
declare function DynamicFilters(props: FilterFormProps): hono_jsx_jsx_dev_runtime.JSX.Element | null;
|
|
852
893
|
|
|
853
894
|
/**
|
|
854
895
|
* 面包屑组件
|
|
@@ -911,10 +952,12 @@ interface TableProps<T = any> {
|
|
|
911
952
|
}>;
|
|
912
953
|
/** 分页信息 */
|
|
913
954
|
pagination?: {
|
|
914
|
-
page
|
|
955
|
+
page?: number;
|
|
915
956
|
pageSize: number;
|
|
916
|
-
total
|
|
917
|
-
totalPages
|
|
957
|
+
total?: number;
|
|
958
|
+
totalPages?: number;
|
|
959
|
+
nextPageState?: string | null;
|
|
960
|
+
itemCount?: number;
|
|
918
961
|
baseUrl: string;
|
|
919
962
|
currentParams?: Record<string, string | number | undefined>;
|
|
920
963
|
};
|
|
@@ -944,14 +987,18 @@ declare function Table<T extends {
|
|
|
944
987
|
* 分页组件
|
|
945
988
|
*/
|
|
946
989
|
interface PaginationProps {
|
|
947
|
-
/**
|
|
948
|
-
page
|
|
990
|
+
/** 当前页码(传统分页) */
|
|
991
|
+
page?: number;
|
|
949
992
|
/** 每页数量 */
|
|
950
993
|
pageSize: number;
|
|
951
|
-
/**
|
|
952
|
-
total
|
|
953
|
-
/**
|
|
954
|
-
totalPages
|
|
994
|
+
/** 总记录数(传统分页) */
|
|
995
|
+
total?: number;
|
|
996
|
+
/** 总页数(传统分页) */
|
|
997
|
+
totalPages?: number;
|
|
998
|
+
/** Cassandra 风格分页游标(用于下一页) */
|
|
999
|
+
nextPageState?: string | null;
|
|
1000
|
+
/** 当前页数据数量(游标分页用于展示) */
|
|
1001
|
+
itemCount?: number;
|
|
955
1002
|
/** 基础 URL */
|
|
956
1003
|
baseUrl: string;
|
|
957
1004
|
/** 当前查询参数(用于保留筛选条件等) */
|
|
@@ -1140,4 +1187,4 @@ interface SortableListProps {
|
|
|
1140
1187
|
*/
|
|
1141
1188
|
declare function SortableList(props: SortableListProps): hono_jsx_jsx_dev_runtime.JSX.Element;
|
|
1142
1189
|
|
|
1143
|
-
export { type ActionButton, type AuthProvider, BaseFeature, BaseFormFeature, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, Card, type CardProps, ColumnRenderer, CustomFeature, DefaultCreateFeature, DefaultDeleteFeature, DefaultDetailFeature, DefaultEditFeature, DefaultListFeature, DetailFieldRenderer, Dialog, type DialogProps, type DialogSize, EmptyState, type EmptyStateProps, ErrorAlert, type ErrorAlertProps, type Feature, type FeatureContext, type FeatureType, type FieldGroup, type FieldRenderer, type FieldRendererProps,
|
|
1190
|
+
export { type ActionButton, type AuthProvider, BaseFeature, BaseFormFeature, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, Card, type CardProps, ColumnRenderer, CustomFeature, DefaultCreateFeature, DefaultDeleteFeature, DefaultDetailFeature, DefaultEditFeature, DefaultListFeature, DetailFieldRenderer, Dialog, type DialogProps, type DialogSize, DynamicFilters, type DynamicFiltersProps, EmptyState, type EmptyStateProps, ErrorAlert, type ErrorAlertProps, type Feature, type FeatureContext, type FeatureType, type FieldGroup, type FieldRenderer, type FieldRendererProps, type FormAction, type FormField, type FormGroup, FragmentFeature, Header, type HeaderProps, HtmxAdminPlugin, type HtmxAdminPluginOptions, type ListParams, type ListResult, LoadingBar, type ModelField, type NavItemConfig, type Notification, type NotificationType$1 as NotificationType, ObjectEditor, type ObjectEditorProps, type OpenMode, type PageMetadata, PageModel, Pagination, type PaginationProps, PermissionDeniedContent, type PermissionDeniedContentProps, PermissionDeniedPage, type PermissionResult, type ResolvedHtmxAdminPluginOptions, SortableList, type SortableListProps, StringArrayEditor, type StringArrayEditorProps, Table, type TableProps, TagsEditor, type TagsEditorProps, type UserInfo, checkUserPermission, getUserInfo, modelNameToPath, parseListParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -270,18 +270,24 @@ interface Feature {
|
|
|
270
270
|
}
|
|
271
271
|
/**
|
|
272
272
|
* 列表查询参数
|
|
273
|
+
* @template F 筛选条件的类型(从 filterSchema 推导)
|
|
273
274
|
*/
|
|
274
|
-
interface ListParams {
|
|
275
|
+
interface ListParams<F = Record<string, any>> {
|
|
275
276
|
/** 页码(从1开始) */
|
|
276
277
|
page?: number;
|
|
277
278
|
/** 每页数量 */
|
|
278
279
|
pageSize?: number;
|
|
280
|
+
/**
|
|
281
|
+
* Cassandra 风格分页游标
|
|
282
|
+
* 用于请求下一页(由上一次响应返回)
|
|
283
|
+
*/
|
|
284
|
+
pageState?: string;
|
|
279
285
|
/** 排序字段 */
|
|
280
286
|
sortBy?: string;
|
|
281
287
|
/** 排序方向 */
|
|
282
288
|
sortOrder?: "asc" | "desc";
|
|
283
289
|
/** 筛选条件 */
|
|
284
|
-
filters?:
|
|
290
|
+
filters?: F;
|
|
285
291
|
}
|
|
286
292
|
/**
|
|
287
293
|
* 列表查询结果
|
|
@@ -289,14 +295,19 @@ interface ListParams {
|
|
|
289
295
|
interface ListResult<T> {
|
|
290
296
|
/** 数据列表 */
|
|
291
297
|
items: T[];
|
|
292
|
-
/**
|
|
293
|
-
total
|
|
294
|
-
/**
|
|
295
|
-
page
|
|
298
|
+
/** 总数量(传统分页才有) */
|
|
299
|
+
total?: number;
|
|
300
|
+
/** 当前页码(传统分页才有) */
|
|
301
|
+
page?: number;
|
|
296
302
|
/** 每页数量 */
|
|
297
303
|
pageSize: number;
|
|
298
|
-
/**
|
|
299
|
-
totalPages
|
|
304
|
+
/** 总页数(传统分页才有) */
|
|
305
|
+
totalPages?: number;
|
|
306
|
+
/**
|
|
307
|
+
* Cassandra 风格分页游标
|
|
308
|
+
* 用于请求下一页
|
|
309
|
+
*/
|
|
310
|
+
pageState?: string | null;
|
|
300
311
|
}
|
|
301
312
|
/**
|
|
302
313
|
* 用户信息接口
|
|
@@ -540,6 +551,9 @@ declare abstract class BaseModelFeature<T extends ZodObject, M = z$1.infer<T>> e
|
|
|
540
551
|
* 表单操作类型
|
|
541
552
|
*/
|
|
542
553
|
type FormAction = "create" | "edit";
|
|
554
|
+
interface BaseFormFeatureOptions<T extends ZodObject = z$1.ZodObject, M = z$1.infer<T>> extends BaseModelFeatureOptions<T, M> {
|
|
555
|
+
actions?: ActionButton[];
|
|
556
|
+
}
|
|
543
557
|
/**
|
|
544
558
|
* 表单 Feature 基类
|
|
545
559
|
* 用于创建和编辑 Feature 的共同逻辑
|
|
@@ -570,6 +584,8 @@ declare abstract class BaseFormFeature<T extends ZodObject = z$1.ZodObject, M =
|
|
|
570
584
|
* 获取取消按钮的跳转 URL
|
|
571
585
|
*/
|
|
572
586
|
abstract getCancelUrl(context: FeatureContext): string | undefined;
|
|
587
|
+
protected options: BaseFormFeatureOptions<T, M>;
|
|
588
|
+
constructor(options: BaseFormFeatureOptions<T, M>);
|
|
573
589
|
/**
|
|
574
590
|
* 设置标题和描述到 context
|
|
575
591
|
*/
|
|
@@ -600,15 +616,15 @@ declare abstract class BaseFormFeature<T extends ZodObject = z$1.ZodObject, M =
|
|
|
600
616
|
* 默认创建 Feature
|
|
601
617
|
*/
|
|
602
618
|
declare class DefaultCreateFeature<T extends ZodObject = z$2.ZodObject, M = z$2.infer<T>> extends BaseFormFeature<T, M> {
|
|
603
|
-
private options;
|
|
604
619
|
private createItem;
|
|
605
|
-
constructor(
|
|
620
|
+
constructor(createOptions: Omit<BaseFormFeatureOptions<T, M>, "name" | "type" | "routes" | "render"> & {
|
|
606
621
|
schema: T;
|
|
607
622
|
createItem: (data: Partial<M>) => Promise<M>;
|
|
608
623
|
permission?: string;
|
|
609
624
|
dialogSize?: DialogSize;
|
|
610
625
|
closeOnBackdropClick?: boolean;
|
|
611
626
|
groups?: FieldGroup[];
|
|
627
|
+
actions?: ActionButton[];
|
|
612
628
|
});
|
|
613
629
|
getFormAction(): "create";
|
|
614
630
|
getSubmitUrl(context: FeatureContext): string;
|
|
@@ -662,10 +678,9 @@ declare class DefaultDetailFeature<T extends ZodObject = z$2.ZodObject, M = z$2.
|
|
|
662
678
|
* 默认编辑 Feature
|
|
663
679
|
*/
|
|
664
680
|
declare class DefaultEditFeature<T extends ZodObject = z$2.ZodObject, M = z$2.infer<T>, ID = keyof M> extends BaseFormFeature<T, M> {
|
|
665
|
-
private options;
|
|
666
681
|
private getItem;
|
|
667
682
|
private updateItem;
|
|
668
|
-
constructor(
|
|
683
|
+
constructor(editOptions: Omit<BaseModelFeatureOptions<T, M>, "name" | "type" | "routes" | "render" | "actions"> & {
|
|
669
684
|
schema: T;
|
|
670
685
|
getItem: (id: ID) => Promise<M | null | undefined>;
|
|
671
686
|
updateItem: (id: ID, data: Partial<M>) => Promise<M | null>;
|
|
@@ -686,20 +701,26 @@ declare class DefaultEditFeature<T extends ZodObject = z$2.ZodObject, M = z$2.in
|
|
|
686
701
|
* 默认列表 Feature
|
|
687
702
|
*/
|
|
688
703
|
|
|
704
|
+
/**
|
|
705
|
+
* 从 filterSchema 推导 filters 的类型
|
|
706
|
+
* 如果 filterSchema 是 optional,则 filters 也是 optional
|
|
707
|
+
*/
|
|
708
|
+
type InferFilterType<FSchema extends z$2.ZodObject<any> | undefined> = FSchema extends z$2.ZodObject<infer Shape> ? Partial<z$2.infer<FSchema>> : Record<string, any> | undefined;
|
|
689
709
|
/**
|
|
690
710
|
* 默认列表 Feature
|
|
691
711
|
*/
|
|
692
|
-
declare class DefaultListFeature<T extends ZodObject = z$2.ZodObject, M = z$2.infer<T>, ID = keyof M> extends BaseModelFeature<T, M> {
|
|
712
|
+
declare class DefaultListFeature<T extends ZodObject = z$2.ZodObject, M = z$2.infer<T>, ID = keyof M, FSchema extends z$2.ZodObject<any> | undefined = z$2.ZodObject<any> | undefined> extends BaseModelFeature<T, M> {
|
|
693
713
|
private options;
|
|
694
714
|
private getList;
|
|
695
715
|
private deleteItem?;
|
|
696
716
|
private filterSchema?;
|
|
697
717
|
private filterFields;
|
|
698
718
|
private openMode?;
|
|
699
|
-
constructor(options: Omit<BaseModelFeatureOptions<T, M>, "name" | "type" | "routes" | "render"
|
|
700
|
-
getList: (params: ListParams) => Promise<ListResult<M>>;
|
|
719
|
+
constructor(options: Omit<BaseModelFeatureOptions<T, M>, "name" | "type" | "routes" | "render"> & {
|
|
720
|
+
getList: (params: ListParams<InferFilterType<FSchema>>) => Promise<ListResult<M>>;
|
|
701
721
|
deleteItem?: (id: ID) => Promise<boolean>;
|
|
702
|
-
filterSchema?:
|
|
722
|
+
filterSchema?: FSchema;
|
|
723
|
+
actions?: ActionButton[];
|
|
703
724
|
openMode?: {
|
|
704
725
|
create?: OpenMode;
|
|
705
726
|
detail?: OpenMode;
|
|
@@ -756,9 +777,13 @@ declare function getUserInfo(ctx: Context, authProvider?: AuthProvider): Promise
|
|
|
756
777
|
*/
|
|
757
778
|
|
|
758
779
|
/**
|
|
759
|
-
*
|
|
780
|
+
* 解析列表查询参数(带 filterSchema 类型推导)
|
|
760
781
|
*/
|
|
761
|
-
declare function parseListParams(ctx: Context): ListParams
|
|
782
|
+
declare function parseListParams<FSchema extends z$2.ZodObject<any>>(ctx: Context, filterSchema: FSchema): ListParams<Partial<z$2.infer<FSchema>>>;
|
|
783
|
+
/**
|
|
784
|
+
* 解析列表查询参数(不带 filterSchema)
|
|
785
|
+
*/
|
|
786
|
+
declare function parseListParams(ctx: Context, filterSchema?: undefined): ListParams<Record<string, any> | undefined>;
|
|
762
787
|
|
|
763
788
|
/**
|
|
764
789
|
* 路径工具函数
|
|
@@ -837,18 +862,34 @@ interface ErrorAlertProps {
|
|
|
837
862
|
*/
|
|
838
863
|
declare function ErrorAlert(props: ErrorAlertProps): hono_jsx_jsx_dev_runtime.JSX.Element;
|
|
839
864
|
|
|
865
|
+
/**
|
|
866
|
+
* 动态筛选组件的类型定义
|
|
867
|
+
*/
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* 动态筛选组件 Props
|
|
871
|
+
*/
|
|
872
|
+
interface DynamicFiltersProps {
|
|
873
|
+
/** 可用的筛选字段 */
|
|
874
|
+
fields: FormField[];
|
|
875
|
+
/** 列表路径(用于提交筛选表单) */
|
|
876
|
+
listPath: string;
|
|
877
|
+
/** 当前筛选参数 */
|
|
878
|
+
currentFilters?: Record<string, any> | undefined;
|
|
879
|
+
}
|
|
880
|
+
|
|
840
881
|
interface FilterFormProps {
|
|
841
882
|
/** 筛选字段 */
|
|
842
883
|
fields: FormField[];
|
|
843
884
|
/** 列表路径(用于提交筛选表单) */
|
|
844
885
|
listPath: string;
|
|
845
886
|
/** 当前筛选参数 */
|
|
846
|
-
currentFilters?: Record<string, any
|
|
887
|
+
currentFilters?: Record<string, any> | undefined;
|
|
847
888
|
}
|
|
848
889
|
/**
|
|
849
|
-
*
|
|
890
|
+
* 动态筛选组件
|
|
850
891
|
*/
|
|
851
|
-
declare function
|
|
892
|
+
declare function DynamicFilters(props: FilterFormProps): hono_jsx_jsx_dev_runtime.JSX.Element | null;
|
|
852
893
|
|
|
853
894
|
/**
|
|
854
895
|
* 面包屑组件
|
|
@@ -911,10 +952,12 @@ interface TableProps<T = any> {
|
|
|
911
952
|
}>;
|
|
912
953
|
/** 分页信息 */
|
|
913
954
|
pagination?: {
|
|
914
|
-
page
|
|
955
|
+
page?: number;
|
|
915
956
|
pageSize: number;
|
|
916
|
-
total
|
|
917
|
-
totalPages
|
|
957
|
+
total?: number;
|
|
958
|
+
totalPages?: number;
|
|
959
|
+
nextPageState?: string | null;
|
|
960
|
+
itemCount?: number;
|
|
918
961
|
baseUrl: string;
|
|
919
962
|
currentParams?: Record<string, string | number | undefined>;
|
|
920
963
|
};
|
|
@@ -944,14 +987,18 @@ declare function Table<T extends {
|
|
|
944
987
|
* 分页组件
|
|
945
988
|
*/
|
|
946
989
|
interface PaginationProps {
|
|
947
|
-
/**
|
|
948
|
-
page
|
|
990
|
+
/** 当前页码(传统分页) */
|
|
991
|
+
page?: number;
|
|
949
992
|
/** 每页数量 */
|
|
950
993
|
pageSize: number;
|
|
951
|
-
/**
|
|
952
|
-
total
|
|
953
|
-
/**
|
|
954
|
-
totalPages
|
|
994
|
+
/** 总记录数(传统分页) */
|
|
995
|
+
total?: number;
|
|
996
|
+
/** 总页数(传统分页) */
|
|
997
|
+
totalPages?: number;
|
|
998
|
+
/** Cassandra 风格分页游标(用于下一页) */
|
|
999
|
+
nextPageState?: string | null;
|
|
1000
|
+
/** 当前页数据数量(游标分页用于展示) */
|
|
1001
|
+
itemCount?: number;
|
|
955
1002
|
/** 基础 URL */
|
|
956
1003
|
baseUrl: string;
|
|
957
1004
|
/** 当前查询参数(用于保留筛选条件等) */
|
|
@@ -1140,4 +1187,4 @@ interface SortableListProps {
|
|
|
1140
1187
|
*/
|
|
1141
1188
|
declare function SortableList(props: SortableListProps): hono_jsx_jsx_dev_runtime.JSX.Element;
|
|
1142
1189
|
|
|
1143
|
-
export { type ActionButton, type AuthProvider, BaseFeature, BaseFormFeature, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, Card, type CardProps, ColumnRenderer, CustomFeature, DefaultCreateFeature, DefaultDeleteFeature, DefaultDetailFeature, DefaultEditFeature, DefaultListFeature, DetailFieldRenderer, Dialog, type DialogProps, type DialogSize, EmptyState, type EmptyStateProps, ErrorAlert, type ErrorAlertProps, type Feature, type FeatureContext, type FeatureType, type FieldGroup, type FieldRenderer, type FieldRendererProps,
|
|
1190
|
+
export { type ActionButton, type AuthProvider, BaseFeature, BaseFormFeature, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, Card, type CardProps, ColumnRenderer, CustomFeature, DefaultCreateFeature, DefaultDeleteFeature, DefaultDetailFeature, DefaultEditFeature, DefaultListFeature, DetailFieldRenderer, Dialog, type DialogProps, type DialogSize, DynamicFilters, type DynamicFiltersProps, EmptyState, type EmptyStateProps, ErrorAlert, type ErrorAlertProps, type Feature, type FeatureContext, type FeatureType, type FieldGroup, type FieldRenderer, type FieldRendererProps, type FormAction, type FormField, type FormGroup, FragmentFeature, Header, type HeaderProps, HtmxAdminPlugin, type HtmxAdminPluginOptions, type ListParams, type ListResult, LoadingBar, type ModelField, type NavItemConfig, type Notification, type NotificationType$1 as NotificationType, ObjectEditor, type ObjectEditorProps, type OpenMode, type PageMetadata, PageModel, Pagination, type PaginationProps, PermissionDeniedContent, type PermissionDeniedContentProps, PermissionDeniedPage, type PermissionResult, type ResolvedHtmxAdminPluginOptions, SortableList, type SortableListProps, StringArrayEditor, type StringArrayEditorProps, Table, type TableProps, TagsEditor, type TagsEditorProps, type UserInfo, checkUserPermission, getUserInfo, modelNameToPath, parseListParams };
|