@tmagic/form 1.2.0 → 1.2.2

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.0",
2
+ "version": "1.2.2",
3
3
  "name": "@tmagic/form",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -36,8 +36,8 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@element-plus/icons-vue": "^2.0.9",
39
- "@tmagic/design": "1.2.0",
40
- "@tmagic/utils": "1.2.0",
39
+ "@tmagic/design": "1.2.2",
40
+ "@tmagic/utils": "1.2.2",
41
41
  "lodash-es": "^4.17.21",
42
42
  "sortablejs": "^1.14.0",
43
43
  "vue": "^3.2.37"
@@ -24,11 +24,12 @@
24
24
 
25
25
  <TMagicTableColumn
26
26
  label="操作"
27
- width="55"
27
+ :width="config.operateColWidth || 55"
28
28
  align="center"
29
29
  :fixed="config.fixed === false ? undefined : 'left'"
30
30
  >
31
31
  <template v-slot="scope">
32
+ <slot name="operateCol" :scope="scope"></slot>
32
33
  <TMagicIcon
33
34
  v-show="showDelete(scope.$index + 1 + pagecontext * pagesize - 1)"
34
35
  class="m-table-delete-icon"
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
package/src/schema.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -598,11 +598,11 @@ export interface PanelConfig extends FormItem, ContainerCommonConfig {
598
598
  schematic?: string;
599
599
  }
600
600
 
601
- export interface ColumnConfig extends FormItem, ContainerCommonConfig {
602
- name: string;
601
+ export interface ColumnConfig extends FormItem {
602
+ name?: string;
603
603
  label: string;
604
- width: string | number;
605
- sortable: boolean;
604
+ width?: string | number;
605
+ sortable?: boolean;
606
606
  [key: string]: any;
607
607
  }
608
608
 
@@ -622,6 +622,8 @@ export interface TableConfig extends FormItem {
622
622
  border?: boolean;
623
623
  /** 显示行号 */
624
624
  showIndex?: boolean;
625
+ /** 操作栏宽度 */
626
+ operateColWidth?: number | string;
625
627
  pagination?: boolean;
626
628
  enum?: any[];
627
629
  /** 是否显示添加按钮 */
@@ -642,7 +644,7 @@ export interface TableConfig extends FormItem {
642
644
  enableFullscreen?: boolean;
643
645
  fixed?: boolean;
644
646
  itemExtra?: string | FilterFunction;
645
- rowKey: string;
647
+ rowKey?: string;
646
648
  }
647
649
 
648
650
  export interface GroupListConfig extends FormItem {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
package/src/utils/form.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -148,6 +148,12 @@ declare const _default: {
148
148
  sortKey: string;
149
149
  }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
150
150
  $slots: {
151
+ operateCol: (_: {
152
+ scope: {
153
+ $index: any;
154
+ row: any;
155
+ };
156
+ }) => any;
151
157
  default: (_: {}) => any;
152
158
  };
153
159
  });
package/types/schema.d.ts CHANGED
@@ -485,11 +485,11 @@ export interface PanelConfig extends FormItem, ContainerCommonConfig {
485
485
  title?: string;
486
486
  schematic?: string;
487
487
  }
488
- export interface ColumnConfig extends FormItem, ContainerCommonConfig {
489
- name: string;
488
+ export interface ColumnConfig extends FormItem {
489
+ name?: string;
490
490
  label: string;
491
- width: string | number;
492
- sortable: boolean;
491
+ width?: string | number;
492
+ sortable?: boolean;
493
493
  [key: string]: any;
494
494
  }
495
495
  /**
@@ -508,6 +508,8 @@ export interface TableConfig extends FormItem {
508
508
  border?: boolean;
509
509
  /** 显示行号 */
510
510
  showIndex?: boolean;
511
+ /** 操作栏宽度 */
512
+ operateColWidth?: number | string;
511
513
  pagination?: boolean;
512
514
  enum?: any[];
513
515
  /** 是否显示添加按钮 */
@@ -528,7 +530,7 @@ export interface TableConfig extends FormItem {
528
530
  enableFullscreen?: boolean;
529
531
  fixed?: boolean;
530
532
  itemExtra?: string | FilterFunction;
531
- rowKey: string;
533
+ rowKey?: string;
532
534
  }
533
535
  export interface GroupListConfig extends FormItem {
534
536
  type: 'table' | 'groupList' | 'group-list';