@tmagic/table 1.2.0-beta.2 → 1.2.0-beta.4

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.
@@ -1,29 +1,94 @@
1
- import { PropType } from 'vue';
2
1
  import { ColumnConfig } from './schema';
3
- declare const _default: import("vue").DefineComponent<{
4
- config: {
5
- type: PropType<ColumnConfig>;
6
- default: () => {};
7
- required: true;
8
- };
9
- editState: {
10
- type: ObjectConstructor;
11
- default: () => void;
12
- };
13
- }, {
14
- formatter: (item: ColumnConfig, row: any) => any;
15
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
16
- config: {
17
- type: PropType<ColumnConfig>;
18
- default: () => {};
19
- required: true;
20
- };
21
- editState: {
22
- type: ObjectConstructor;
23
- default: () => void;
24
- };
25
- }>>, {
2
+ declare const _default: {
3
+ new (...args: any[]): {
4
+ $: import("vue").ComponentInternalInstance;
5
+ $data: {};
6
+ $props: Partial<{
7
+ config: ColumnConfig;
8
+ editState: any;
9
+ }> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
10
+ config: ColumnConfig;
11
+ editState?: any;
12
+ }>, {
13
+ config: () => {};
14
+ editState: () => {};
15
+ }>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "config" | "editState">;
16
+ $attrs: {
17
+ [x: string]: unknown;
18
+ };
19
+ $refs: {
20
+ [x: string]: unknown;
21
+ };
22
+ $slots: Readonly<{
23
+ [name: string]: import("vue").Slot | undefined;
24
+ }>;
25
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
26
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
27
+ $emit: (event: string, ...args: any[]) => void;
28
+ $el: any;
29
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
30
+ config: ColumnConfig;
31
+ editState?: any;
32
+ }>, {
33
+ config: () => {};
34
+ editState: () => {};
35
+ }>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
36
+ config: ColumnConfig;
37
+ editState: any;
38
+ }> & {
39
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
40
+ created?: ((() => void) | (() => void)[]) | undefined;
41
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
42
+ mounted?: ((() => void) | (() => void)[]) | undefined;
43
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
44
+ updated?: ((() => void) | (() => void)[]) | undefined;
45
+ activated?: ((() => void) | (() => void)[]) | undefined;
46
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
47
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
48
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
49
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
50
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
51
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
52
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
53
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
54
+ };
55
+ $forceUpdate: () => void;
56
+ $nextTick: typeof import("vue").nextTick;
57
+ $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
58
+ } & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
59
+ config: ColumnConfig;
60
+ editState?: any;
61
+ }>, {
62
+ config: () => {};
63
+ editState: () => {};
64
+ }>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
65
+ __isFragment?: undefined;
66
+ __isTeleport?: undefined;
67
+ __isSuspense?: undefined;
68
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
69
+ config: ColumnConfig;
70
+ editState?: any;
71
+ }>, {
72
+ config: () => {};
73
+ editState: () => {};
74
+ }>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
26
75
  config: ColumnConfig;
27
- editState: Record<string, any>;
28
- }>;
76
+ editState: any;
77
+ }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
78
+ $slots: {};
79
+ });
29
80
  export default _default;
81
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
82
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
83
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
84
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
85
+ } : {
86
+ type: import('vue').PropType<T[K]>;
87
+ required: true;
88
+ };
89
+ };
90
+ declare type __VLS_WithDefaults<P, D> = {
91
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
92
+ default: D[K];
93
+ } : P[K];
94
+ };
package/types/schema.d.ts CHANGED
@@ -17,23 +17,23 @@ export declare type ColumnConfig = {
17
17
  values?: FormValue;
18
18
  selection?: boolean | 'single';
19
19
  selectable?: (row: any, index: number) => boolean;
20
- label: string;
20
+ label?: string;
21
21
  fixed?: 'left' | 'right' | boolean;
22
22
  width?: number | string;
23
23
  actions?: ColumnActionConfig[];
24
- type: 'popover' | 'expand' | string | ((value: any, row: any) => string);
25
- text: string;
26
- prop: string;
27
- showHeader: boolean;
24
+ type?: 'popover' | 'expand' | string | ((value: any, row: any) => string);
25
+ text?: string;
26
+ prop?: string;
27
+ showHeader?: boolean;
28
28
  table?: ColumnConfig[];
29
29
  formatter?: 'datetime' | ((item: any, row: Record<string, any>) => any);
30
- popover: {
31
- placement: '';
32
- width: '';
33
- trigger: '';
34
- tableEmbed: '';
30
+ popover?: {
31
+ placement: string;
32
+ width: string;
33
+ trigger: string;
34
+ tableEmbed: string;
35
35
  };
36
36
  sortable?: boolean | 'custom';
37
37
  action?: 'tip' | 'actionLink' | 'img' | 'link' | 'tag';
38
- handler: (row: any) => void;
38
+ handler?: (row: any) => void;
39
39
  };