@tmagic/table 1.3.0-alpha.0 → 1.3.0-alpha.10

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/src/Table.vue CHANGED
@@ -29,7 +29,7 @@
29
29
  <component
30
30
  width="40"
31
31
  type="selection"
32
- :is="tableColumnComponent.component"
32
+ :is="tableColumnComponent?.component || 'el-table-column'"
33
33
  :key="columnIndex"
34
34
  :selectable="item.selectable"
35
35
  ></component>
@@ -57,7 +57,7 @@
57
57
  </TMagicTable>
58
58
  </template>
59
59
 
60
- <script lang="ts" setup name="MTable">
60
+ <script lang="ts" setup>
61
61
  import { computed, ref } from 'vue';
62
62
  import { cloneDeep } from 'lodash-es';
63
63
 
@@ -68,6 +68,10 @@ import ExpandColumn from './ExpandColumn.vue';
68
68
  import PopoverColumn from './PopoverColumn.vue';
69
69
  import TextColumn from './TextColumn.vue';
70
70
 
71
+ defineOptions({
72
+ name: 'MTable',
73
+ });
74
+
71
75
  const props = withDefaults(
72
76
  defineProps<{
73
77
  data: any[];
@@ -110,7 +114,7 @@ const tMagicTable = ref<InstanceType<typeof TMagicTable>>();
110
114
 
111
115
  const editState = ref([]);
112
116
 
113
- const tableColumnComponent = getConfig('components').tableColumn;
117
+ const tableColumnComponent = getConfig('components')?.tableColumn;
114
118
  const selectionColumn = computed(() => {
115
119
  const column = props.columns.filter((item) => item.selection);
116
120
  return column.length ? column[0] : null;
@@ -57,12 +57,16 @@
57
57
  </TMagicTableColumn>
58
58
  </template>
59
59
 
60
- <script lang="ts" setup name="MTableColumn">
60
+ <script lang="ts" setup>
61
61
  import { TMagicButton, TMagicForm, TMagicTableColumn, TMagicTag } from '@tmagic/design';
62
62
 
63
63
  import { ColumnConfig } from './schema';
64
64
  import { formatter } from './utils';
65
65
 
66
+ defineOptions({
67
+ name: 'MTableColumn',
68
+ });
69
+
66
70
  withDefaults(
67
71
  defineProps<{
68
72
  config: ColumnConfig;
@@ -26,7 +26,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
26
26
  config: ColumnConfig;
27
27
  rowkeyName: string;
28
28
  editState: any;
29
- }>;
29
+ }, {}>;
30
30
  export default _default;
31
31
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
32
32
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -38,7 +38,10 @@ type __VLS_TypePropsToRuntimeProps<T> = {
38
38
  };
39
39
  };
40
40
  type __VLS_WithDefaults<P, D> = {
41
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
41
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
42
42
  default: D[K];
43
- } : P[K];
43
+ }> : P[K];
44
44
  };
45
+ type __VLS_Prettify<T> = {
46
+ [K in keyof T]: T[K];
47
+ } & {};
@@ -3,13 +3,13 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
3
3
  config: ColumnConfig;
4
4
  }>, {
5
5
  config: () => {};
6
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
6
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
7
7
  config: ColumnConfig;
8
8
  }>, {
9
9
  config: () => {};
10
10
  }>>>, {
11
11
  config: ColumnConfig;
12
- }>;
12
+ }, {}>;
13
13
  export default _default;
14
14
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
15
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -21,7 +21,10 @@ type __VLS_TypePropsToRuntimeProps<T> = {
21
21
  };
22
22
  };
23
23
  type __VLS_WithDefaults<P, D> = {
24
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
24
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
25
25
  default: D[K];
26
- } : P[K];
26
+ }> : P[K];
27
27
  };
28
+ type __VLS_Prettify<T> = {
29
+ [K in keyof T]: T[K];
30
+ } & {};
@@ -3,13 +3,13 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
3
3
  config: ColumnConfig;
4
4
  }>, {
5
5
  config: () => {};
6
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
6
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
7
7
  config: ColumnConfig;
8
8
  }>, {
9
9
  config: () => {};
10
10
  }>>>, {
11
11
  config: ColumnConfig;
12
- }>;
12
+ }, {}>;
13
13
  export default _default;
14
14
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
15
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -21,7 +21,10 @@ type __VLS_TypePropsToRuntimeProps<T> = {
21
21
  };
22
22
  };
23
23
  type __VLS_WithDefaults<P, D> = {
24
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
24
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
25
25
  default: D[K];
26
- } : P[K];
26
+ }> : P[K];
27
27
  };
28
+ type __VLS_Prettify<T> = {
29
+ [K in keyof T]: T[K];
30
+ } & {};
@@ -72,7 +72,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
72
72
  showHeader: boolean;
73
73
  defaultExpandAll: boolean;
74
74
  border: boolean;
75
- }>;
75
+ }, {}>;
76
76
  export default _default;
77
77
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
78
78
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -84,7 +84,10 @@ type __VLS_TypePropsToRuntimeProps<T> = {
84
84
  };
85
85
  };
86
86
  type __VLS_WithDefaults<P, D> = {
87
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
87
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
88
88
  default: D[K];
89
- } : P[K];
89
+ }> : P[K];
90
90
  };
91
+ type __VLS_Prettify<T> = {
92
+ [K in keyof T]: T[K];
93
+ } & {};
@@ -5,7 +5,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
5
5
  }>, {
6
6
  config: () => {};
7
7
  editState: () => {};
8
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
8
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
9
9
  config: ColumnConfig;
10
10
  editState?: any;
11
11
  }>, {
@@ -14,7 +14,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
14
14
  }>>>, {
15
15
  config: ColumnConfig;
16
16
  editState: any;
17
- }>;
17
+ }, {}>;
18
18
  export default _default;
19
19
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
20
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -26,7 +26,10 @@ type __VLS_TypePropsToRuntimeProps<T> = {
26
26
  };
27
27
  };
28
28
  type __VLS_WithDefaults<P, D> = {
29
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
29
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
30
30
  default: D[K];
31
- } : P[K];
31
+ }> : P[K];
32
32
  };
33
+ type __VLS_Prettify<T> = {
34
+ [K in keyof T]: T[K];
35
+ } & {};