@jackbo_vip/admin-kit 1.0.19 → 1.0.21

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +1109 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -20,9 +20,14 @@ export { createIconifyIcon };
20
20
  // ==========================================
21
21
  // From @admin-kit/shared
22
22
  // ==========================================
23
+ export { StateHandler, VisibleDomRect, arraysEqual, bindMethods, capitalizeFirstLetter, cn, diff, downloadFileFromBase64, downloadFileFromBlob, downloadFileFromBlobPart, downloadFileFromImageUrl, downloadFileFromUrl, filterTree, formatDate, formatDateTime, getCurrentTimezone, getElementVisibleRect, getFirstNonNullOrUndefined, getNestedValue, getScrollbarWidth, getSystemTimezone, isBoolean, isDate, isDayjsObject, isEmpty, isHttpUrl, isMacOs, isNumber, isUndefined, isWindow, isWindowsOs, kebabToCamelCase, loadScript, mapTree, mergeWithArrayOverride, needsScrollbar, openRouteInNewWindow, openWindow, setCurrentTimezone, sortTree, startProgress, stopProgress, to, toCamelCase, toLowerCaseFirstLetter, traverseTreeValues, triggerDownload, triggerWindowResize, uniqueByField, updateCSSVariables, urlToBase64 };
23
24
  export { get, isEqual, set } from 'es-toolkit/compat';
24
25
  export { default as cloneDeep } from 'lodash.clonedeep';
26
+ export { IGlobalSharedState, globalShareState };
27
+ export { StorageManager };
28
+ export { convertToHsl, convertToHslCssVar, convertToRgb, generatorColorVariables, isDarkColor, isLightColor, isValidColor };
25
29
  export { TinyColor } from '@ctrl/tinycolor';
30
+ export { ADMIN_ANT_PREVIEW_URL, ADMIN_DOC_URL, ADMIN_ELE_PREVIEW_URL, ADMIN_GITHUB_URL, ADMIN_LOGO_URL, ADMIN_NAIVE_PREVIEW_URL, ADMIN_PREVIEW_URL, ADMIN_TD_PREVIEW_URL, CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT, CSS_VARIABLE_LAYOUT_CONTENT_WIDTH, CSS_VARIABLE_LAYOUT_FOOTER_HEIGHT, CSS_VARIABLE_LAYOUT_HEADER_HEIGHT, DEFAULT_NAMESPACE, ELEMENT_ID_MAIN_CONTENT };
26
31
  export { isFunction, isObject, isString } from '@vue/shared';
27
32
  export { createDefu as createMerge, defu as merge } from 'defu';
28
33
  export * from '@tanstack/vue-store';
@@ -462,6 +467,7 @@ export type { AccessModeType, AnyFunction, AnyNormalFunction, AnyPromiseFunction
462
467
  // ==========================================
463
468
  import * as vue from 'vue';
464
469
  import { CSSProperties, Ref, ComputedRef } from 'vue';
470
+ import Sortable, { SortableOptions } from 'sortablejs';
465
471
  export { default as Sortable } from 'sortablejs';
466
472
  export { useEmitAsProps, useForwardExpose, useForwardProps, useForwardPropsEmits } from 'reka-ui';
467
473
 
@@ -543,11 +549,1114 @@ export type { UseNamespaceReturn };
543
549
  // ==========================================
544
550
  // From @admin-kit/form-ui
545
551
  // ==========================================
552
+ export { setupAdminForm };
553
+ import type { FieldOptions, FormContext, GenericObject } from 'vee-validate';
554
+ import type { ZodTypeAny } from 'zod';
555
+ import type { Component, HtmlHTMLAttributes, Ref } from 'vue';
556
+ export type FormLayout = 'horizontal' | 'inline' | 'vertical';
557
+ export type BaseFormComponentType = 'DefaultButton' | 'PrimaryButton' | 'AdminCheckbox' | 'AdminInput' | 'AdminInputPassword' | 'AdminPinInput' | 'AdminSelect' | (Record<never, never> & string);
558
+ type Breakpoints = '2xl:' | '3xl:' | '' | 'lg:' | 'md:' | 'sm:' | 'xl:';
559
+ type GridCols = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
560
+ export type WrapperClassType = `${Breakpoints}grid-cols-${GridCols}` | (Record<never, never> & string);
561
+ export type FormItemClassType = `${Breakpoints}cols-end-${'auto' | GridCols}` | `${Breakpoints}cols-span-${'auto' | 'full' | GridCols}` | `${Breakpoints}cols-start-${'auto' | GridCols}` | (Record<never, never> & string) | WrapperClassType;
562
+ export type FormFieldOptions = Partial<FieldOptions & {
563
+ validateOnBlur?: boolean;
564
+ validateOnChange?: boolean;
565
+ validateOnInput?: boolean;
566
+ validateOnModelUpdate?: boolean;
567
+ }>;
568
+ export interface FormShape {
569
+ /** 默认值 */
570
+ default?: any;
571
+ /** 字段名 */
572
+ fieldName: string;
573
+ /** 是否必填 */
574
+ required?: boolean;
575
+ rules?: ZodTypeAny;
576
+ }
577
+ export type MaybeComponentPropKey = 'options' | 'placeholder' | 'title' | keyof HtmlHTMLAttributes | (Record<never, never> & string);
578
+ export type MaybeComponentProps = {
579
+ [K in MaybeComponentPropKey]?: any;
580
+ };
581
+ export type FormActions = FormContext<GenericObject>;
582
+ export type CustomRenderType = (() => Component | string) | string;
583
+ export type FormSchemaRuleType = 'required' | 'selectRequired' | null | (Record<never, never> & string) | ZodTypeAny;
584
+ type FormItemDependenciesCondition<T = boolean | PromiseLike<boolean>> = (value: Partial<Record<string, any>>, actions: FormActions) => T;
585
+ type FormItemDependenciesConditionWithRules = (value: Partial<Record<string, any>>, actions: FormActions) => FormSchemaRuleType | PromiseLike<FormSchemaRuleType>;
586
+ type FormItemDependenciesConditionWithProps = (value: Partial<Record<string, any>>, actions: FormActions) => MaybeComponentProps | PromiseLike<MaybeComponentProps>;
587
+ export interface FormItemDependencies {
588
+ /**
589
+ * 组件参数
590
+ * @returns 组件参数
591
+ */
592
+ componentProps?: FormItemDependenciesConditionWithProps;
593
+ /**
594
+ * 是否禁用
595
+ * @returns 是否禁用
596
+ */
597
+ disabled?: boolean | FormItemDependenciesCondition;
598
+ /**
599
+ * 是否渲染(删除dom)
600
+ * @returns 是否渲染
601
+ */
602
+ if?: boolean | FormItemDependenciesCondition;
603
+ /**
604
+ * 是否必填
605
+ * @returns 是否必填
606
+ */
607
+ required?: FormItemDependenciesCondition;
608
+ /**
609
+ * 字段规则
610
+ */
611
+ rules?: FormItemDependenciesConditionWithRules;
612
+ /**
613
+ * 是否隐藏(Css)
614
+ * @returns 是否隐藏
615
+ */
616
+ show?: boolean | FormItemDependenciesCondition;
617
+ /**
618
+ * 任意触发都会执行
619
+ */
620
+ trigger?: FormItemDependenciesCondition<void>;
621
+ /**
622
+ * 触发字段
623
+ */
624
+ triggerFields: string[];
625
+ }
626
+ type ComponentProps = ((value: Partial<Record<string, any>>, actions: FormActions) => MaybeComponentProps) | MaybeComponentProps;
627
+ export interface FormCommonConfig {
628
+ /**
629
+ * 在Label后显示一个冒号
630
+ */
631
+ colon?: boolean;
632
+ /**
633
+ * 所有表单项的props
634
+ */
635
+ componentProps?: ComponentProps;
636
+ /**
637
+ * 所有表单项的控件样式
638
+ */
639
+ controlClass?: string;
640
+ /**
641
+ * 所有表单项的禁用状态
642
+ * @default false
643
+ */
644
+ disabled?: boolean;
645
+ /**
646
+ * 是否禁用所有表单项的change事件监听
647
+ * @default true
648
+ */
649
+ disabledOnChangeListener?: boolean;
650
+ /**
651
+ * 是否禁用所有表单项的input事件监听
652
+ * @default true
653
+ */
654
+ disabledOnInputListener?: boolean;
655
+ /**
656
+ * 所有表单项的空状态值,默认都是undefined,naive-ui的空状态值是null
657
+ */
658
+ emptyStateValue?: null | undefined;
659
+ /**
660
+ * 所有表单项的控件样式
661
+ * @default {}
662
+ */
663
+ formFieldProps?: FormFieldOptions;
664
+ /**
665
+ * 所有表单项的栅格布局,支持函数形式
666
+ * @default ""
667
+ */
668
+ formItemClass?: (() => string) | string;
669
+ /**
670
+ * 隐藏所有表单项label
671
+ * @default false
672
+ */
673
+ hideLabel?: boolean;
674
+ /**
675
+ * 是否隐藏必填标记
676
+ * @default false
677
+ */
678
+ hideRequiredMark?: boolean;
679
+ /**
680
+ * 所有表单项的label样式
681
+ * @default ""
682
+ */
683
+ labelClass?: string;
684
+ /**
685
+ * 所有表单项的label宽度
686
+ */
687
+ labelWidth?: number;
688
+ /**
689
+ * 所有表单项的model属性名
690
+ * @default "modelValue"
691
+ */
692
+ modelPropName?: string;
693
+ /**
694
+ * 所有表单项的wrapper样式
695
+ */
696
+ wrapperClass?: string;
697
+ }
698
+ type RenderComponentContentType = (value: Partial<Record<string, any>>, api: FormActions) => Record<string, any>;
699
+ export type HandleSubmitFn = (values: Record<string, any>) => Promise<void> | void;
700
+ export type HandleResetFn = (values: Record<string, any>) => Promise<void> | void;
701
+ export type FieldMappingTime = [
702
+ string,
703
+ [
704
+ string,
705
+ string
706
+ ],
707
+ (((value: any, fieldName: string) => any) | [string, string] | null | string)?
708
+ ][];
709
+ export type ArrayToStringFields = Array<[string[], string?] | string | string[]>;
710
+ export interface FormSchema<T extends BaseFormComponentType = BaseFormComponentType> extends FormCommonConfig {
711
+ /** 组件 */
712
+ component: Component | T;
713
+ /** 组件参数 */
714
+ componentProps?: ComponentProps;
715
+ /** 默认值 */
716
+ defaultValue?: any;
717
+ /** 依赖 */
718
+ dependencies?: FormItemDependencies;
719
+ /** 描述 */
720
+ description?: CustomRenderType;
721
+ /** 字段名 */
722
+ fieldName: string;
723
+ /** 帮助信息 */
724
+ help?: CustomRenderType;
725
+ /** 是否隐藏表单项 */
726
+ hide?: boolean;
727
+ /** 表单项 */
728
+ label?: CustomRenderType;
729
+ renderComponentContent?: RenderComponentContentType;
730
+ /** 字段规则 */
731
+ rules?: FormSchemaRuleType;
732
+ /** 后缀 */
733
+ suffix?: CustomRenderType;
734
+ }
735
+ export interface FormFieldProps extends FormSchema {
736
+ required?: boolean;
737
+ }
738
+ export interface FormRenderProps<T extends BaseFormComponentType = BaseFormComponentType> {
739
+ /**
740
+ * 表单字段数组映射字符串配置 默认使用","
741
+ */
742
+ arrayToStringFields?: ArrayToStringFields;
743
+ /**
744
+ * 是否折叠,在showCollapseButton=true下生效
745
+ * true:折叠 false:展开
746
+ */
747
+ collapsed?: boolean;
748
+ /**
749
+ * 折叠时保持行数
750
+ * @default 1
751
+ */
752
+ collapsedRows?: number;
753
+ /**
754
+ * 是否触发resize事件
755
+ * @default false
756
+ */
757
+ collapseTriggerResize?: boolean;
758
+ /**
759
+ * 表单项通用后备配置,当子项目没配置时使用这里的配置,子项目配置优先级高于此配置
760
+ */
761
+ commonConfig?: FormCommonConfig;
762
+ /**
763
+ * 紧凑模式(移除表单每一项底部为校验信息预留的空间)
764
+ */
765
+ compact?: boolean;
766
+ /**
767
+ * 组件v-model事件绑定
768
+ */
769
+ componentBindEventMap?: Partial<Record<BaseFormComponentType, string>>;
770
+ /**
771
+ * 组件集合
772
+ */
773
+ componentMap: Record<BaseFormComponentType, Component>;
774
+ /**
775
+ * 表单字段映射到时间格式
776
+ */
777
+ fieldMappingTime?: FieldMappingTime;
778
+ /**
779
+ * 表单实例
780
+ */
781
+ form?: FormContext<GenericObject>;
782
+ /**
783
+ * 表单项布局
784
+ */
785
+ layout?: FormLayout;
786
+ /**
787
+ * 表单定义
788
+ */
789
+ schema?: FormSchema<T>[];
790
+ /**
791
+ * 是否显示展开/折叠
792
+ */
793
+ showCollapseButton?: boolean;
794
+ /**
795
+ * 格式化日期
796
+ */
797
+ /**
798
+ * 表单栅格布局
799
+ * @default "grid-cols-1"
800
+ */
801
+ wrapperClass?: WrapperClassType;
802
+ }
803
+ export interface ActionButtonOptions extends AdminButtonProps {
804
+ [key: string]: any;
805
+ content?: MaybeComputedRef<string>;
806
+ show?: boolean;
807
+ }
808
+ export interface AdminFormProps<T extends BaseFormComponentType = BaseFormComponentType> extends Omit<FormRenderProps<T>, 'componentBindEventMap' | 'componentMap' | 'form'> {
809
+ /**
810
+ * 操作按钮是否反转(提交按钮前置)
811
+ */
812
+ actionButtonsReverse?: boolean;
813
+ /**
814
+ * 操作按钮组的样式
815
+ * newLine: 在新行显示。rowEnd: 在行内显示,靠右对齐(默认)。inline: 使用grid默认样式
816
+ */
817
+ actionLayout?: 'inline' | 'newLine' | 'rowEnd';
818
+ /**
819
+ * 操作按钮组显示位置,默认靠右显示
820
+ */
821
+ actionPosition?: 'center' | 'left' | 'right';
822
+ /**
823
+ * 表单操作区域class
824
+ */
825
+ actionWrapperClass?: ClassType;
826
+ /**
827
+ * 表单字段数组映射字符串配置 默认使用","
828
+ */
829
+ arrayToStringFields?: ArrayToStringFields;
830
+ /**
831
+ * 表单字段映射
832
+ */
833
+ fieldMappingTime?: FieldMappingTime;
834
+ /**
835
+ * 表单收起展开状态变化回调
836
+ */
837
+ handleCollapsedChange?: (collapsed: boolean) => void;
838
+ /**
839
+ * 表单重置回调
840
+ */
841
+ handleReset?: HandleResetFn;
842
+ /**
843
+ * 表单提交回调
844
+ */
845
+ handleSubmit?: HandleSubmitFn;
846
+ /**
847
+ * 表单值变化回调
848
+ */
849
+ handleValuesChange?: (values: Record<string, any>, fieldsChanged: string[]) => void;
850
+ /**
851
+ * 重置按钮参数
852
+ */
853
+ resetButtonOptions?: ActionButtonOptions;
854
+ /**
855
+ * 验证失败时是否自动滚动到第一个错误字段
856
+ * @default false
857
+ */
858
+ scrollToFirstError?: boolean;
859
+ /**
860
+ * 是否显示默认操作按钮
861
+ * @default true
862
+ */
863
+ showDefaultActions?: boolean;
864
+ /**
865
+ * 提交按钮参数
866
+ */
867
+ submitButtonOptions?: ActionButtonOptions;
868
+ /**
869
+ * 是否在字段值改变时提交表单
870
+ * @default false
871
+ */
872
+ submitOnChange?: boolean;
873
+ /**
874
+ * 是否在回车时提交表单
875
+ * @default false
876
+ */
877
+ submitOnEnter?: boolean;
878
+ }
879
+ export type ExtendedFormApi = FormApi & {
880
+ useStore: <T = NoInfer<AdminFormProps>>(selector?: (state: NoInfer<AdminFormProps>) => T) => Readonly<Ref<T>>;
881
+ };
882
+ export interface AdminFormAdapterOptions<T extends BaseFormComponentType = BaseFormComponentType> {
883
+ config?: {
884
+ baseModelPropName?: string;
885
+ disabledOnChangeListener?: boolean;
886
+ disabledOnInputListener?: boolean;
887
+ emptyStateValue?: null | undefined;
888
+ modelPropNameMap?: Partial<Record<T, string>>;
889
+ };
890
+ defineRules?: {
891
+ required?: (value: any, params: any, ctx: Record<string, any>) => boolean | string;
892
+ selectRequired?: (value: any, params: any, ctx: Record<string, any>) => boolean | string;
893
+ };
894
+ }
895
+ export {};
896
+ export declare function useAdminForm<T extends BaseFormComponentType = BaseFormComponentType>(options: AdminFormProps<T>): readonly [import("vue").DefineSetupFnComponent<AdminFormProps<BaseFormComponentType>, {}, {}, AdminFormProps<BaseFormComponentType> & {}, import("vue").PublicProps>, ExtendedFormApi];
546
897
  export * as z from 'zod';
547
898
 
548
899
 
900
+ // ==========================================
901
+ // From @admin-kit/layout-ui
902
+ // ==========================================
903
+ interface AdminLayoutProps {
904
+ /**
905
+ * 内容区域定宽
906
+ * @default 'wide'
907
+ */
908
+ contentCompact?: ContentCompactType;
909
+ /**
910
+ * 定宽布局宽度
911
+ * @default 1200
912
+ */
913
+ contentCompactWidth?: number;
914
+ /**
915
+ * padding
916
+ * @default 16
917
+ */
918
+ contentPadding?: number;
919
+ /**
920
+ * paddingBottom
921
+ * @default 16
922
+ */
923
+ contentPaddingBottom?: number;
924
+ /**
925
+ * paddingLeft
926
+ * @default 16
927
+ */
928
+ contentPaddingLeft?: number;
929
+ /**
930
+ * paddingRight
931
+ * @default 16
932
+ */
933
+ contentPaddingRight?: number;
934
+ /**
935
+ * paddingTop
936
+ * @default 16
937
+ */
938
+ contentPaddingTop?: number;
939
+ /**
940
+ * footer 是否可见
941
+ * @default false
942
+ */
943
+ footerEnable?: boolean;
944
+ /**
945
+ * footer 是否固定
946
+ * @default true
947
+ */
948
+ footerFixed?: boolean;
949
+ /**
950
+ * footer 高度
951
+ * @default 32
952
+ */
953
+ footerHeight?: number;
954
+ /**
955
+ * header高度
956
+ * @default 48
957
+ */
958
+ headerHeight?: number;
959
+ /**
960
+ * 顶栏是否隐藏
961
+ * @default false
962
+ */
963
+ headerHidden?: boolean;
964
+ /**
965
+ * header 显示模式
966
+ * @default 'fixed'
967
+ */
968
+ headerMode?: LayoutHeaderModeType;
969
+ /**
970
+ * header 顶栏主题
971
+ */
972
+ headerTheme?: ThemeModeType;
973
+ /**
974
+ * 是否显示header切换侧边栏按钮
975
+ * @default
976
+ */
977
+ headerToggleSidebarButton?: boolean;
978
+ /**
979
+ * header是否显示
980
+ * @default true
981
+ */
982
+ headerVisible?: boolean;
983
+ /**
984
+ * 是否移动端显示
985
+ * @default false
986
+ */
987
+ isMobile?: boolean;
988
+ /**
989
+ * 布局方式
990
+ * sidebar-nav 侧边菜单布局
991
+ * header-nav 顶部菜单布局
992
+ * mixed-nav 侧边&顶部菜单布局
993
+ * sidebar-mixed-nav 侧边混合菜单布局
994
+ * full-content 全屏内容布局
995
+ * @default sidebar-nav
996
+ */
997
+ layout?: LayoutType;
998
+ /**
999
+ * 侧边菜单折叠状态
1000
+ * @default false
1001
+ */
1002
+ sidebarCollapse?: boolean;
1003
+ /**
1004
+ * 侧边菜单折叠按钮
1005
+ * @default true
1006
+ */
1007
+ sidebarCollapsedButton?: boolean;
1008
+ /**
1009
+ * 侧边菜单是否折叠时,是否显示title
1010
+ * @default true
1011
+ */
1012
+ sidebarCollapseShowTitle?: boolean;
1013
+ /**
1014
+ * 侧边栏是否可见
1015
+ * @default true
1016
+ */
1017
+ sidebarEnable?: boolean;
1018
+ /**
1019
+ * 侧边菜单折叠额外宽度
1020
+ * @default 48
1021
+ */
1022
+ sidebarExtraCollapsedWidth?: number;
1023
+ /**
1024
+ * 侧边菜单折叠按钮是否固定
1025
+ * @default true
1026
+ */
1027
+ sidebarFixedButton?: boolean;
1028
+ /**
1029
+ * 侧边栏是否隐藏
1030
+ * @default false
1031
+ */
1032
+ sidebarHidden?: boolean;
1033
+ /**
1034
+ * 混合侧边栏宽度
1035
+ * @default 80
1036
+ */
1037
+ sidebarMixedWidth?: number;
1038
+ /**
1039
+ * 侧边栏
1040
+ * @default dark
1041
+ */
1042
+ sidebarTheme?: ThemeModeType;
1043
+ /**
1044
+ * 侧边栏宽度
1045
+ * @default 210
1046
+ */
1047
+ sidebarWidth?: number;
1048
+ /**
1049
+ * 侧边菜单折叠宽度
1050
+ * @default 48
1051
+ */
1052
+ sideCollapseWidth?: number;
1053
+ /**
1054
+ * tab是否可见
1055
+ * @default true
1056
+ */
1057
+ tabbarEnable?: boolean;
1058
+ /**
1059
+ * tab高度
1060
+ * @default 30
1061
+ */
1062
+ tabbarHeight?: number;
1063
+ /**
1064
+ * zIndex
1065
+ * @default 100
1066
+ */
1067
+ zIndex?: number;
1068
+ }
1069
+ export type { AdminLayoutProps };
1070
+ export { default as AdminLayout };
1071
+
1072
+
1073
+ // ==========================================
1074
+ // From @admin-kit/menu-ui
1075
+ // ==========================================
1076
+ export { default as MenuBadge };
1077
+ interface NormalMenuProps {
1078
+ /**
1079
+ * 菜单数据
1080
+ */
1081
+ activePath?: string;
1082
+ /**
1083
+ * 是否折叠
1084
+ */
1085
+ collapse?: boolean;
1086
+ /**
1087
+ * 菜单项
1088
+ */
1089
+ menus?: MenuRecordRaw[];
1090
+ /**
1091
+ * @zh_CN 是否圆润风格
1092
+ * @default true
1093
+ */
1094
+ rounded?: boolean;
1095
+ /**
1096
+ * 主题
1097
+ */
1098
+ theme?: 'dark' | 'light';
1099
+ }
1100
+ export type { NormalMenuProps };
1101
+ export { default as NormalMenu };
1102
+ export { default as Menu };
1103
+ import type { Component, Ref } from 'vue';
1104
+ interface MenuProps {
1105
+ /**
1106
+ * @zh_CN 是否开启手风琴模式
1107
+ * @default true
1108
+ */
1109
+ accordion?: boolean;
1110
+ /**
1111
+ * @zh_CN 菜单是否折叠
1112
+ * @default false
1113
+ */
1114
+ collapse?: boolean;
1115
+ /**
1116
+ * @zh_CN 菜单折叠时是否显示菜单名称
1117
+ * @default false
1118
+ */
1119
+ collapseShowTitle?: boolean;
1120
+ /**
1121
+ * @zh_CN 默认激活的菜单
1122
+ */
1123
+ defaultActive?: string;
1124
+ /**
1125
+ * @zh_CN 默认展开的菜单
1126
+ */
1127
+ defaultOpeneds?: string[];
1128
+ /**
1129
+ * @zh_CN 菜单模式
1130
+ * @default vertical
1131
+ */
1132
+ mode?: 'horizontal' | 'vertical';
1133
+ /**
1134
+ * @zh_CN 是否圆润风格
1135
+ * @default true
1136
+ */
1137
+ rounded?: boolean;
1138
+ /**
1139
+ * @zh_CN 是否自动滚动到激活的菜单项
1140
+ * @default false
1141
+ */
1142
+ scrollToActive?: boolean;
1143
+ /**
1144
+ * @zh_CN 菜单主题
1145
+ * @default dark
1146
+ */
1147
+ theme?: ThemeModeType;
1148
+ }
1149
+ interface SubMenuProps extends MenuRecordBadgeRaw {
1150
+ /**
1151
+ * @zh_CN 激活图标
1152
+ */
1153
+ activeIcon?: string;
1154
+ /**
1155
+ * @zh_CN 是否禁用
1156
+ */
1157
+ disabled?: boolean;
1158
+ /**
1159
+ * @zh_CN 图标
1160
+ */
1161
+ icon?: Component | string;
1162
+ /**
1163
+ * @zh_CN submenu 名称
1164
+ */
1165
+ path: string;
1166
+ }
1167
+ interface MenuItemProps extends MenuRecordBadgeRaw {
1168
+ /**
1169
+ * @zh_CN 图标
1170
+ */
1171
+ activeIcon?: string;
1172
+ /**
1173
+ * @zh_CN 是否禁用
1174
+ */
1175
+ disabled?: boolean;
1176
+ /**
1177
+ * @zh_CN 图标
1178
+ */
1179
+ icon?: Component | string;
1180
+ /**
1181
+ * @zh_CN menuitem 名称
1182
+ */
1183
+ path: string;
1184
+ }
1185
+ interface MenuItemRegistered {
1186
+ active: boolean;
1187
+ parentPaths: string[];
1188
+ path: string;
1189
+ }
1190
+ interface MenuItemClicked {
1191
+ parentPaths: string[];
1192
+ path: string;
1193
+ }
1194
+ interface MenuProvider {
1195
+ activePath?: string;
1196
+ addMenuItem: (item: MenuItemRegistered) => void;
1197
+ addSubMenu: (item: MenuItemRegistered) => void;
1198
+ closeMenu: (path: string, parentLinks: string[]) => void;
1199
+ handleMenuItemClick: (item: MenuItemClicked) => void;
1200
+ handleSubMenuClick: (subMenu: MenuItemRegistered) => void;
1201
+ isMenuPopup: boolean;
1202
+ items: Record<string, MenuItemRegistered>;
1203
+ openedMenus: string[];
1204
+ openMenu: (path: string, parentLinks: string[]) => void;
1205
+ props: MenuProps;
1206
+ removeMenuItem: (item: MenuItemRegistered) => void;
1207
+ removeSubMenu: (item: MenuItemRegistered) => void;
1208
+ subMenus: Record<string, MenuItemRegistered>;
1209
+ theme: string;
1210
+ }
1211
+ interface SubMenuProvider {
1212
+ addSubMenu: (item: MenuItemRegistered) => void;
1213
+ handleMouseleave?: (deepDispatch: boolean) => void;
1214
+ level: number;
1215
+ mouseInChild: Ref<boolean>;
1216
+ removeSubMenu: (item: MenuItemRegistered) => void;
1217
+ }
1218
+ export type { MenuItemClicked, MenuItemProps, MenuItemRegistered, MenuProps, MenuProvider, SubMenuProps, SubMenuProvider, };
1219
+
1220
+
1221
+ // ==========================================
1222
+ // From @admin-kit/popup-ui
1223
+ // ==========================================
1224
+ import type { Component, VNode, VNodeArrayChildren } from 'vue';
1225
+ export type IconType = 'error' | 'info' | 'question' | 'success' | 'warning';
1226
+ export type BeforeCloseScope = {
1227
+ isConfirm: boolean;
1228
+ };
1229
+ export type AlertProps = {
1230
+ /** 关闭前的回调,如果返回false,则终止关闭 */
1231
+ beforeClose?: (scope: BeforeCloseScope) => boolean | Promise<boolean | undefined> | undefined;
1232
+ /** 边框 */
1233
+ bordered?: boolean;
1234
+ /**
1235
+ * 按钮对齐方式
1236
+ * @default 'end'
1237
+ */
1238
+ buttonAlign?: 'center' | 'end' | 'start';
1239
+ /** 取消按钮的标题 */
1240
+ cancelText?: string;
1241
+ /** 是否居中显示 */
1242
+ centered?: boolean;
1243
+ /** 确认按钮的标题 */
1244
+ confirmText?: string;
1245
+ /** 弹窗容器的额外样式 */
1246
+ containerClass?: string;
1247
+ /** 弹窗提示内容 */
1248
+ content: Component | string;
1249
+ /** 弹窗内容的额外样式 */
1250
+ contentClass?: string;
1251
+ /** 执行beforeClose回调期间,在内容区域显示一个loading遮罩*/
1252
+ contentMasking?: boolean;
1253
+ /** 弹窗底部内容(与按钮在同一个容器中) */
1254
+ footer?: Component | string;
1255
+ /** 弹窗的图标(在标题的前面) */
1256
+ icon?: Component | IconType;
1257
+ /**
1258
+ * 弹窗遮罩模糊效果
1259
+ */
1260
+ overlayBlur?: number;
1261
+ /** 是否显示取消按钮 */
1262
+ showCancel?: boolean;
1263
+ /** 弹窗标题 */
1264
+ title?: string;
1265
+ };
1266
+ /** Prompt属性 */
1267
+ export type PromptProps<T = any> = {
1268
+ /** 关闭前的回调,如果返回false,则终止关闭 */
1269
+ beforeClose?: (scope: {
1270
+ isConfirm: boolean;
1271
+ value: T | undefined;
1272
+ }) => boolean | Promise<boolean | undefined> | undefined;
1273
+ /** 用于接受用户输入的组件 */
1274
+ component?: Component;
1275
+ /** 输入组件的属性 */
1276
+ componentProps?: Recordable<any>;
1277
+ /** 输入组件的插槽 */
1278
+ componentSlots?: (() => any) | Recordable<unknown> | VNode | VNodeArrayChildren;
1279
+ /** 默认值 */
1280
+ defaultValue?: T;
1281
+ /** 输入组件的值属性名 */
1282
+ modelPropName?: string;
1283
+ } & Omit<AlertProps, 'beforeClose'>;
1284
+ /**
1285
+ * Alert上下文
1286
+ */
1287
+ export type AlertContext = {
1288
+ /** 执行取消操作 */
1289
+ doCancel: () => void;
1290
+ /** 执行确认操作 */
1291
+ doConfirm: () => void;
1292
+ };
1293
+ export declare const injectAlertContext: <T extends AlertContext | null | undefined = AlertContext>(fallback?: T | undefined) => T extends null ? AlertContext | null : AlertContext, provideAlertContext: (contextValue: AlertContext) => AlertContext;
1294
+ /**
1295
+ * 获取Alert上下文
1296
+ * @returns AlertContext
1297
+ */
1298
+ export declare function useAlertContext(): AlertContext;
1299
+ export { useAlertContext };
1300
+ export { default as Alert };
1301
+ export { adminAlert as alert, clearAllAlerts, adminConfirm as confirm, adminPrompt as prompt, };
1302
+ import type { Component, Ref } from 'vue';
1303
+ export type DrawerPlacement = 'bottom' | 'left' | 'right' | 'top';
1304
+ export type CloseIconPlacement = 'left' | 'right';
1305
+ export interface DrawerProps {
1306
+ /**
1307
+ * 是否挂载到内容区域
1308
+ * @default false
1309
+ */
1310
+ appendToMain?: boolean;
1311
+ /**
1312
+ * 取消按钮文字
1313
+ */
1314
+ cancelText?: string;
1315
+ class?: ClassType;
1316
+ /**
1317
+ * 是否显示关闭按钮
1318
+ * @default true
1319
+ */
1320
+ closable?: boolean;
1321
+ /**
1322
+ * 关闭按钮的位置
1323
+ */
1324
+ closeIconPlacement?: CloseIconPlacement;
1325
+ /**
1326
+ * 点击弹窗遮罩是否关闭弹窗
1327
+ * @default true
1328
+ */
1329
+ closeOnClickModal?: boolean;
1330
+ /**
1331
+ * 按下 ESC 键是否关闭弹窗
1332
+ * @default true
1333
+ */
1334
+ closeOnPressEscape?: boolean;
1335
+ /**
1336
+ * 确定按钮 loading
1337
+ * @default false
1338
+ */
1339
+ confirmLoading?: boolean;
1340
+ /**
1341
+ * 确定按钮文字
1342
+ */
1343
+ confirmText?: string;
1344
+ contentClass?: string;
1345
+ /**
1346
+ * 弹窗描述
1347
+ */
1348
+ description?: string;
1349
+ /**
1350
+ * 在关闭时销毁抽屉
1351
+ */
1352
+ destroyOnClose?: boolean;
1353
+ /**
1354
+ * 是否显示底部
1355
+ * @default true
1356
+ */
1357
+ footer?: boolean;
1358
+ /**
1359
+ * 弹窗底部样式
1360
+ */
1361
+ footerClass?: ClassType;
1362
+ /**
1363
+ * 是否显示顶栏
1364
+ * @default true
1365
+ */
1366
+ header?: boolean;
1367
+ /**
1368
+ * 弹窗头部样式
1369
+ */
1370
+ headerClass?: ClassType;
1371
+ /**
1372
+ * 弹窗是否显示
1373
+ * @default false
1374
+ */
1375
+ loading?: boolean;
1376
+ /**
1377
+ * 是否显示遮罩
1378
+ * @default true
1379
+ */
1380
+ modal?: boolean;
1381
+ /**
1382
+ * 是否自动聚焦
1383
+ */
1384
+ openAutoFocus?: boolean;
1385
+ /**
1386
+ * 弹窗遮罩模糊效果
1387
+ */
1388
+ overlayBlur?: number;
1389
+ /**
1390
+ * 抽屉位置
1391
+ * @default right
1392
+ */
1393
+ placement?: DrawerPlacement;
1394
+ /**
1395
+ * 是否显示取消按钮
1396
+ * @default true
1397
+ */
1398
+ showCancelButton?: boolean;
1399
+ /**
1400
+ * 是否显示确认按钮
1401
+ * @default true
1402
+ */
1403
+ showConfirmButton?: boolean;
1404
+ /**
1405
+ * 提交中(锁定抽屉状态)
1406
+ */
1407
+ submitting?: boolean;
1408
+ /**
1409
+ * 弹窗标题
1410
+ */
1411
+ title?: string;
1412
+ /**
1413
+ * 弹窗标题提示
1414
+ */
1415
+ titleTooltip?: string;
1416
+ /**
1417
+ * 抽屉层级
1418
+ */
1419
+ zIndex?: number;
1420
+ }
1421
+ export interface DrawerState extends DrawerProps {
1422
+ /** 弹窗打开状态 */
1423
+ isOpen?: boolean;
1424
+ /**
1425
+ * 共享数据
1426
+ */
1427
+ sharedData?: Record<string, any>;
1428
+ }
1429
+ export type ExtendedDrawerApi = DrawerApi & {
1430
+ useStore: <T = NoInfer<DrawerState>>(selector?: (state: NoInfer<DrawerState>) => T) => Readonly<Ref<T>>;
1431
+ };
1432
+ export interface DrawerApiOptions extends DrawerState {
1433
+ /**
1434
+ * 独立的抽屉组件
1435
+ */
1436
+ connectedComponent?: Component;
1437
+ /**
1438
+ * 关闭前的回调,返回 false 可以阻止关闭
1439
+ * @returns
1440
+ */
1441
+ onBeforeClose?: () => MaybePromise<boolean | undefined>;
1442
+ /**
1443
+ * 点击取消按钮的回调
1444
+ */
1445
+ onCancel?: () => void;
1446
+ /**
1447
+ * 弹窗关闭动画结束的回调
1448
+ * @returns
1449
+ */
1450
+ onClosed?: () => void;
1451
+ /**
1452
+ * 点击确定按钮的回调
1453
+ */
1454
+ onConfirm?: () => void;
1455
+ /**
1456
+ * 弹窗状态变化回调
1457
+ * @param isOpen
1458
+ * @returns
1459
+ */
1460
+ onOpenChange?: (isOpen: boolean) => void;
1461
+ /**
1462
+ * 弹窗打开动画结束的回调
1463
+ * @returns
1464
+ */
1465
+ onOpened?: () => void;
1466
+ }
1467
+ export { default as AdminDrawer };
1468
+ export { setDefaultDrawerProps, useAdminDrawer };
1469
+ import type { Component, Ref } from 'vue';
1470
+ export interface ModalProps {
1471
+ /**
1472
+ * 动画类型
1473
+ * @default 'slide'
1474
+ */
1475
+ animationType?: 'scale' | 'slide';
1476
+ /**
1477
+ * 是否要挂载到内容区域
1478
+ * @default false
1479
+ */
1480
+ appendToMain?: boolean;
1481
+ /**
1482
+ * 是否显示边框
1483
+ * @default false
1484
+ */
1485
+ bordered?: boolean;
1486
+ /**
1487
+ * 取消按钮文字
1488
+ */
1489
+ cancelText?: string;
1490
+ /**
1491
+ * 是否居中
1492
+ * @default false
1493
+ */
1494
+ centered?: boolean;
1495
+ class?: string;
1496
+ /**
1497
+ * 是否显示右上角的关闭按钮
1498
+ * @default true
1499
+ */
1500
+ closable?: boolean;
1501
+ /**
1502
+ * 点击弹窗遮罩是否关闭弹窗
1503
+ * @default true
1504
+ */
1505
+ closeOnClickModal?: boolean;
1506
+ /**
1507
+ * 按下 ESC 键是否关闭弹窗
1508
+ * @default true
1509
+ */
1510
+ closeOnPressEscape?: boolean;
1511
+ /**
1512
+ * 禁用确认按钮
1513
+ */
1514
+ confirmDisabled?: boolean;
1515
+ /**
1516
+ * 确定按钮 loading
1517
+ * @default false
1518
+ */
1519
+ confirmLoading?: boolean;
1520
+ /**
1521
+ * 确定按钮文字
1522
+ */
1523
+ confirmText?: string;
1524
+ contentClass?: string;
1525
+ /**
1526
+ * 弹窗描述
1527
+ */
1528
+ description?: string;
1529
+ /**
1530
+ * 在关闭时销毁弹窗
1531
+ */
1532
+ destroyOnClose?: boolean;
1533
+ /**
1534
+ * 是否可拖拽
1535
+ * @default false
1536
+ */
1537
+ draggable?: boolean;
1538
+ /**
1539
+ * 是否显示底部
1540
+ * @default true
1541
+ */
1542
+ footer?: boolean;
1543
+ footerClass?: string;
1544
+ /**
1545
+ * 是否全屏
1546
+ * @default false
1547
+ */
1548
+ fullscreen?: boolean;
1549
+ /**
1550
+ * 是否显示全屏按钮
1551
+ * @default true
1552
+ */
1553
+ fullscreenButton?: boolean;
1554
+ /**
1555
+ * 是否显示顶栏
1556
+ * @default true
1557
+ */
1558
+ header?: boolean;
1559
+ headerClass?: string;
1560
+ /**
1561
+ * 弹窗是否显示
1562
+ * @default false
1563
+ */
1564
+ loading?: boolean;
1565
+ /**
1566
+ * 是否显示遮罩
1567
+ * @default true
1568
+ */
1569
+ modal?: boolean;
1570
+ /**
1571
+ * 是否自动聚焦
1572
+ */
1573
+ openAutoFocus?: boolean;
1574
+ /**
1575
+ * 弹窗遮罩模糊效果
1576
+ */
1577
+ overlayBlur?: number;
1578
+ /**
1579
+ * 是否显示取消按钮
1580
+ * @default true
1581
+ */
1582
+ showCancelButton?: boolean;
1583
+ /**
1584
+ * 是否显示确认按钮
1585
+ * @default true
1586
+ */
1587
+ showConfirmButton?: boolean;
1588
+ /**
1589
+ * 提交中(锁定弹窗状态)
1590
+ */
1591
+ submitting?: boolean;
1592
+ /**
1593
+ * 弹窗标题
1594
+ */
1595
+ title?: string;
1596
+ /**
1597
+ * 弹窗标题提示
1598
+ */
1599
+ titleTooltip?: string;
1600
+ /**
1601
+ * 弹窗层级
1602
+ */
1603
+ zIndex?: number;
1604
+ }
1605
+ export interface ModalState extends ModalProps {
1606
+ /** 弹窗打开状态 */
1607
+ isOpen?: boolean;
1608
+ /**
1609
+ * 共享数据
1610
+ */
1611
+ sharedData?: Record<string, any>;
1612
+ }
1613
+ export type ExtendedModalApi = ModalApi & {
1614
+ useStore: <T = NoInfer<ModalState>>(selector?: (state: NoInfer<ModalState>) => T) => Readonly<Ref<T>>;
1615
+ };
1616
+ export interface ModalApiOptions extends ModalState {
1617
+ /**
1618
+ * 独立的弹窗组件
1619
+ */
1620
+ connectedComponent?: Component;
1621
+ /**
1622
+ * 关闭前的回调,返回 false 可以阻止关闭
1623
+ * @returns
1624
+ */
1625
+ onBeforeClose?: () => MaybePromise<boolean | undefined>;
1626
+ /**
1627
+ * 点击取消按钮的回调
1628
+ */
1629
+ onCancel?: () => void;
1630
+ /**
1631
+ * 弹窗关闭动画结束的回调
1632
+ * @returns
1633
+ */
1634
+ onClosed?: () => void;
1635
+ /**
1636
+ * 点击确定按钮的回调
1637
+ */
1638
+ onConfirm?: () => void;
1639
+ /**
1640
+ * 弹窗状态变化回调
1641
+ * @param isOpen
1642
+ * @returns
1643
+ */
1644
+ onOpenChange?: (isOpen: boolean) => void;
1645
+ /**
1646
+ * 弹窗打开动画结束的回调
1647
+ * @returns
1648
+ */
1649
+ onOpened?: () => void;
1650
+ }
1651
+ export { default as AdminModal };
1652
+ export { setDefaultModalProps, useAdminModal };
1653
+
1654
+
549
1655
  // ==========================================
550
1656
  // From @admin-kit/tabs-ui
551
1657
  // ==========================================
1658
+ export { default as TabsToolMore };
1659
+ export { default as TabsToolScreen };
1660
+ export { default as TabsView };
552
1661
  export type { IContextMenuItem } from '@admin-kit/shadcn-ui';
553
1662
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackbo_vip/admin-kit",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "A comprehensive Vue 3 admin UI component library with TypeScript support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",