jgy-public-component 0.0.4 → 0.0.6

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.
@@ -0,0 +1,47 @@
1
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ import { ApiFn } from './types';
3
+ declare const _default: DefineComponent<ExtractPropTypes<{
4
+ modelValue: PropType<boolean>;
5
+ title: {
6
+ type: PropType<string>;
7
+ default: string;
8
+ };
9
+ getFieldListApi: {
10
+ type: PropType<ApiFn>;
11
+ required: true;
12
+ };
13
+ importApi: {
14
+ type: PropType<(data: Record<string, any>[]) => Promise<any>>;
15
+ required: true;
16
+ };
17
+ excludeFields: {
18
+ type: PropType<string[]>;
19
+ default: () => string[];
20
+ };
21
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
22
+ success: () => void;
23
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
24
+ modelValue: PropType<boolean>;
25
+ title: {
26
+ type: PropType<string>;
27
+ default: string;
28
+ };
29
+ getFieldListApi: {
30
+ type: PropType<ApiFn>;
31
+ required: true;
32
+ };
33
+ importApi: {
34
+ type: PropType<(data: Record<string, any>[]) => Promise<any>>;
35
+ required: true;
36
+ };
37
+ excludeFields: {
38
+ type: PropType<string[]>;
39
+ default: () => string[];
40
+ };
41
+ }>> & Readonly<{
42
+ onSuccess?: (() => any) | undefined;
43
+ }>, {
44
+ title: string;
45
+ excludeFields: string[];
46
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
47
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as JImportExcel } from './JImportExcel';
2
+ export type { JImportExcelProps, ApiFn } from './types';
@@ -0,0 +1,12 @@
1
+ /** API 函数类型:接收任意参数,返回 Promise */
2
+ export type ApiFn = (...args: any[]) => Promise<any>;
3
+ export interface JImportExcelProps {
4
+ /** 获取字段列表的 API 函数,返回格式需包含 res.data.tableFieldsInfo: { key: label } */
5
+ getFieldListApi: ApiFn;
6
+ /** 导入数据的 API 函数,接收 Record<string, any>[] */
7
+ importApi: (data: Record<string, any>[]) => Promise<any>;
8
+ /** 要排除的字段名数组 */
9
+ excludeFields?: string[];
10
+ /** 弹窗标题 */
11
+ title?: string;
12
+ }
@@ -0,0 +1,80 @@
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, PropType } from 'vue';
2
+ declare function __VLS_template(): {
3
+ default?(_: {}): any;
4
+ actions?(_: {}): any;
5
+ };
6
+ declare const __VLS_component: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
7
+ selectedCount?: number;
8
+ addText?: string;
9
+ defaultVisible?: number;
10
+ showAdd?: boolean;
11
+ showBatchDelete?: boolean;
12
+ showSearch?: boolean;
13
+ showReset?: boolean;
14
+ }>, {
15
+ selectedCount: number;
16
+ addText: string;
17
+ defaultVisible: number;
18
+ showAdd: boolean;
19
+ showBatchDelete: boolean;
20
+ showSearch: boolean;
21
+ showReset: boolean;
22
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
23
+ search: () => void;
24
+ reset: () => void;
25
+ add: () => void;
26
+ batchDelete: () => void;
27
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
28
+ selectedCount?: number;
29
+ addText?: string;
30
+ defaultVisible?: number;
31
+ showAdd?: boolean;
32
+ showBatchDelete?: boolean;
33
+ showSearch?: boolean;
34
+ showReset?: boolean;
35
+ }>, {
36
+ selectedCount: number;
37
+ addText: string;
38
+ defaultVisible: number;
39
+ showAdd: boolean;
40
+ showBatchDelete: boolean;
41
+ showSearch: boolean;
42
+ showReset: boolean;
43
+ }>>> & Readonly<{
44
+ onSearch?: (() => any) | undefined;
45
+ onReset?: (() => any) | undefined;
46
+ onAdd?: (() => any) | undefined;
47
+ onBatchDelete?: (() => any) | undefined;
48
+ }>, {
49
+ selectedCount: number;
50
+ addText: string;
51
+ defaultVisible: number;
52
+ showAdd: boolean;
53
+ showBatchDelete: boolean;
54
+ showSearch: boolean;
55
+ showReset: boolean;
56
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
57
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
58
+ export default _default;
59
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
60
+ type __VLS_TypePropsToRuntimeProps<T> = {
61
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
62
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
63
+ } : {
64
+ type: PropType<T[K]>;
65
+ required: true;
66
+ };
67
+ };
68
+ type __VLS_WithDefaults<P, D> = {
69
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
70
+ default: D[K];
71
+ }> : P[K];
72
+ };
73
+ type __VLS_Prettify<T> = {
74
+ [K in keyof T]: T[K];
75
+ } & {};
76
+ type __VLS_WithTemplateSlots<T, S> = T & {
77
+ new (): {
78
+ $slots: S;
79
+ };
80
+ };
@@ -0,0 +1,2 @@
1
+ export { default as JSearchHeader } from './JSearchHeader';
2
+ export type { JSearchHeaderProps } from './types';
@@ -0,0 +1,9 @@
1
+ export interface JSearchHeaderProps {
2
+ selectedCount?: number;
3
+ addText?: string;
4
+ defaultVisible?: number;
5
+ showAdd?: boolean;
6
+ showBatchDelete?: boolean;
7
+ showSearch?: boolean;
8
+ showReset?: boolean;
9
+ }
@@ -47,15 +47,15 @@ declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VL
47
47
  uploadFn: undefined;
48
48
  }>>> & Readonly<{
49
49
  onSuccess?: ((url: string) => any) | undefined;
50
- "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
51
50
  onError?: ((error: any) => any) | undefined;
51
+ "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
52
52
  }>, {
53
53
  disabled: boolean;
54
54
  modelValue: string | string[];
55
+ accept: string;
55
56
  multiple: boolean;
56
57
  limit: number;
57
58
  maxSize: number;
58
- accept: string;
59
59
  tip: string;
60
60
  showTip: boolean;
61
61
  uploadFn: (file: File) => Promise<string>;
package/dist/index.d.ts CHANGED
@@ -2,12 +2,17 @@ import { App } from 'vue';
2
2
  import { JButton } from './components/JButton';
3
3
  import { JUploadImg } from './components/JUploadImg';
4
4
  import { JIconRender } from './components/JIconRender';
5
+ import { JSearchHeader } from './components/JSearchHeader';
6
+ import { JImportExcel } from './components/JImportExcel';
5
7
 
6
8
  declare const _default: {
7
9
  install: (app: App) => void;
8
10
  };
9
11
  export default _default;
10
- export { JButton, JUploadImg, JIconRender };
12
+ export { JButton, JUploadImg, JIconRender, JSearchHeader, JImportExcel };
13
+ export { toSnakeCase, toCamelCase, pick, omit, deepClone, filterEmpty, flatten, unflatten, toTableColumns } from './utils';
11
14
  export type { ButtonType, ButtonSize } from './components/JButton';
12
15
  export type { JUploadImgProps, JUploadImgEmits, ImageItem } from './components/JUploadImg';
13
16
  export type { JIconRenderProps } from './components/JIconRender';
17
+ export type { JSearchHeaderProps } from './components/JSearchHeader';
18
+ export type { JImportExcelProps, ApiFn } from './components/JImportExcel';