zhihao-ui 1.2.12 → 1.2.13

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 (42) hide show
  1. package/dist/es/{BaseInfo-CX8jhSiU.js → BaseInfo-7jZU0u6I.js} +1 -1
  2. package/dist/es/{Button-Dayz-XVx.js → Button-B9P_SsZw.js} +2 -2
  3. package/dist/es/{DatePicker-vfIj425T.js → DatePicker-Cc2HzfbO.js} +22 -21
  4. package/dist/es/{DetailHeader-DrlhwY52.js → DetailHeader-DWSW65H4.js} +3 -3
  5. package/dist/es/{DetailSubTitle-QEEHnjR_.js → DetailSubTitle-BcmMobfK.js} +2 -2
  6. package/dist/es/{Dialog-CLQwwXs6.js → Dialog-CPGMb7bN.js} +7 -6
  7. package/dist/es/{DiyDataTable-CjU8lE1d.js → DiyDataTable-Dg2-p40F.js} +44 -40
  8. package/dist/es/{EditInfoPair-BAkhPrrp.js → EditInfoPair-DK6juMvt.js} +3 -3
  9. package/dist/es/{FileWrapper-WvZK7e6H.js → FileWrapper-DJK4gH30.js} +4 -4
  10. package/dist/es/{Grid-B8GjLkPJ.js → Grid-ChfF9Fgz.js} +1 -1
  11. package/dist/es/{InfoPair-CVRcV6zN.js → InfoPair-Ba3m95Ys.js} +3 -3
  12. package/dist/es/{Input-D3aG3Fqg.js → Input-nPdfvjre.js} +3 -3
  13. package/dist/es/{Loading-CJ0YVxxE.js → Loading-5GrMZQAf.js} +2 -2
  14. package/dist/es/{Map-CjPsc0XI.js → Map-Q8kvdbDZ.js} +3 -3
  15. package/dist/es/{MessageBox-CMjFYHiw.js → MessageBox-SFDDgn41.js} +2 -2
  16. package/dist/es/{MoneyInput-Ctz5oyHG.js → MoneyInput-DfIiKsPe.js} +5 -5
  17. package/dist/es/{PageHeadPanel-B13UDwTh.js → PageHeadPanel-BnA69dS-.js} +2 -2
  18. package/dist/es/Table-R_03lfSM.js +1111 -0
  19. package/dist/es/{ToolTips-ZGKTR5KG.js → ToolTips-BHQpNHPT.js} +3 -3
  20. package/dist/es/index.js +50 -47
  21. package/dist/es/{utils-DR-4CNcy.js → utils-BbabHGt0.js} +1 -1
  22. package/dist/es/{vendor-qv9XzgYI.js → vendor-CUDSGmu_.js} +13416 -11462
  23. package/dist/index.css +1 -1
  24. package/dist/types/components/DiyDataTable/DiyDataTable.vue.d.ts +12 -1
  25. package/dist/types/components/DiyDataTable/index.d.ts +9 -1
  26. package/dist/types/components/DiyDataTable/type.d.ts +2 -0
  27. package/dist/types/components/Table/components/ColSetting.vue.d.ts +41 -0
  28. package/dist/types/components/Table/components/SearchForm.vue.d.ts +57 -0
  29. package/dist/types/components/Table/components/SearchFormItem.vue.d.ts +32 -0
  30. package/dist/types/components/Table/components/TableColumn.vue.d.ts +17 -0
  31. package/dist/types/components/Table/components/tablePagination.vue.d.ts +21 -0
  32. package/dist/types/components/Table/hooks/useSelection.d.ts +17 -0
  33. package/dist/types/components/Table/hooks/useTable.d.ts +50 -0
  34. package/dist/types/components/Table/index.d.ts +2946 -0
  35. package/dist/types/components/Table/index.vue.d.ts +984 -0
  36. package/dist/types/components/Table/types.d.ts +78 -0
  37. package/dist/types/components/Table/utils.d.ts +55 -0
  38. package/dist/types/components/const.d.ts +4 -0
  39. package/dist/types/components/index.d.ts +1 -0
  40. package/dist/umd/index.css +1 -1
  41. package/dist/umd/index.umd.cjs +33 -28
  42. package/package.json +1 -1
@@ -0,0 +1,78 @@
1
+ import { VNode, ComponentPublicInstance, Ref } from 'vue';
2
+ import { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults';
3
+ import { ZhTableProps, default as ZhTableType } from './index.vue';
4
+
5
+ export interface EnumProps {
6
+ label?: string;
7
+ value?: string | number | boolean | any[];
8
+ disabled?: boolean;
9
+ tagType?: string;
10
+ children?: EnumProps[];
11
+ [key: string]: any;
12
+ }
13
+ export type TypeProps = "index" | "selection" | "radio" | "expand" | "sort" | "input";
14
+ export type SearchType = "input" | "input-number" | "select" | "select-v2" | "tree-select" | "cascader" | "date-picker" | "time-picker" | "time-select" | "switch" | "slider";
15
+ export type SearchRenderScope = {
16
+ searchParam: {
17
+ [key: string]: any;
18
+ };
19
+ placeholder: string;
20
+ clearable: boolean;
21
+ options: EnumProps[];
22
+ data: EnumProps[];
23
+ };
24
+ export type SearchProps = {
25
+ el?: SearchType;
26
+ label?: string;
27
+ props?: any;
28
+ key?: string;
29
+ tooltip?: string;
30
+ order?: number;
31
+ defaultValue?: string | number | boolean | null | any[] | Ref<any>;
32
+ render?: (scope: SearchRenderScope) => VNode;
33
+ width?: number | ((value: any) => number);
34
+ isShow?: boolean;
35
+ } & Partial<Record<BreakPoint, Responsive>>;
36
+ export type FieldNamesProps = {
37
+ label: string;
38
+ value: string;
39
+ children?: string;
40
+ };
41
+ export type RenderScope<T> = {
42
+ row: T;
43
+ $index: number;
44
+ column: TableColumnCtx<T>;
45
+ [key: string]: any;
46
+ };
47
+ export type HeaderRenderScope<T> = {
48
+ $index: number;
49
+ column: TableColumnCtx<T>;
50
+ [key: string]: any;
51
+ };
52
+ export interface ColumnProps<T = any> extends Partial<Omit<TableColumnCtx<T>, "type" | "children" | "renderCell" | "renderHeader">> {
53
+ type?: TypeProps;
54
+ blurCallback?: (rowData?: any, weight?: number) => void | Promise<void>;
55
+ tag?: boolean | Ref<boolean>;
56
+ isShow?: boolean | Ref<boolean>;
57
+ search?: SearchProps | undefined;
58
+ enum?: EnumProps[] | Ref<EnumProps[]> | ((params?: any) => Promise<any>);
59
+ isFilterEnum?: boolean | Ref<boolean>;
60
+ fieldNames?: FieldNamesProps;
61
+ headerRender?: (scope: HeaderRenderScope<T>) => VNode;
62
+ render?: (scope: RenderScope<T>) => VNode | string;
63
+ _children?: ColumnProps<T>[];
64
+ click?: (row: any, index: number) => void;
65
+ isCustomDisable?: boolean;
66
+ wrap?: boolean;
67
+ }
68
+ export interface SortChangeEvent {
69
+ column: TableColumnCtx<any>;
70
+ prop: string;
71
+ order: "ascending" | "descending" | null;
72
+ }
73
+ export type ProTableInstance = Omit<InstanceType<typeof ZhTableType>, keyof ComponentPublicInstance | keyof ZhTableProps>;
74
+ export type BreakPoint = "xs" | "sm" | "md" | "lg" | "xl";
75
+ export type Responsive = {
76
+ span?: number;
77
+ offset?: number;
78
+ };
@@ -0,0 +1,55 @@
1
+ import { FieldNamesProps, ColumnProps } from './types';
2
+
3
+ /**
4
+ * @description 递归查找 callValue 对应的 enum 值
5
+ * */
6
+ export declare function findItemNested(enumData: any, callValue: any, value: string, children: string): any;
7
+ export declare function getValueByProp(data: any, prop: string, defaultValue?: any): any;
8
+ export declare const $get: typeof getValueByProp;
9
+ /**
10
+ * @description 处理 prop,当 prop 为多级嵌套时 ==> 返回最后一级 prop
11
+ * @param {String} prop 当前 prop
12
+ * */
13
+ export declare function handleProp(prop: string): string;
14
+ /**
15
+ * @description 根据枚举列表查询当需要的数据(如果指定了 label 和 value 的 key值,会自动识别格式化)
16
+ * @param {String} callValue 当前单元格值
17
+ * @param {Array} enumData 字典列表
18
+ * @param {Array} fieldNames label && value && children 的 key 值
19
+ * @param {String} type 过滤类型(目前只有 tag)
20
+ * */
21
+ export declare function filterEnum(callValue: any, enumData?: any, fieldNames?: FieldNamesProps, type?: "tag"): any;
22
+ /**
23
+ * @description 根据枚举列表查询当需要的数据对象(如果指定了 label 和 value 的 key值,会自动识别格式化)
24
+ * @param {String} callValue 当前单元格值
25
+ * @param {Array} enumData 字典列表
26
+ * @param {Array} fieldNames label && value && children 的 key 值
27
+ * */
28
+ export declare function filterEnumObj(callValue: any, enumData?: any, fieldNames?: FieldNamesProps): {
29
+ [key: string]: any;
30
+ };
31
+ /**
32
+ * @description 处理 ProTable 值为数组 || 无数据
33
+ * @param {*} callValue 需要处理的值
34
+ * */
35
+ export declare function formatValue(callValue: any): any;
36
+ /**
37
+ * @description 处理 prop 为多级嵌套的情况,返回的数据 (列如: prop: user.name)
38
+ * @param {Object} row 当前行数据
39
+ * @param {String} prop 当前 prop
40
+ * */
41
+ export declare function handleRowAccordingToProp(row: {
42
+ [key: string]: any;
43
+ }, prop: string): any;
44
+ export declare const getWidthByText: (text: string, fontSize?: number) => number;
45
+ interface ColumnSettingMap {
46
+ [key: string]: ColumnProps[];
47
+ }
48
+ export declare const useColSetting: (customColumnCacheKey?: string) => {
49
+ getMap: () => ColumnSettingMap;
50
+ setMap: (map: ColumnSettingMap) => void;
51
+ getColumnCache: (key: string) => ColumnProps[];
52
+ setColumnCache: (key: string, value: ColumnProps[]) => void;
53
+ removeColumnCache: (key: string) => void;
54
+ };
55
+ export {};
@@ -2,3 +2,7 @@ export declare const DEFAULT_VALUE = "--";
2
2
  export declare const LOG_DATE_FORMAT_T = "YYYY-MM-DDTHH:mm:ss";
3
3
  export declare const LOG_DATE_FORMAT_END = "YYYY-MM-DDT23:59:59";
4
4
  export declare const DATE_PICKER_FORMAT = "YYYY-MM-DD";
5
+ /**
6
+ * 图片CDN地址
7
+ */
8
+ export declare const CDN_URL = "https://static.zhihaoscm.cn/";
@@ -18,3 +18,4 @@ export * from './BaseInfo';
18
18
  export * from './DetailHeader';
19
19
  export * from './DiyDataTable';
20
20
  export * from './Map';
21
+ export * from './Table';