rayyy-vue-table-components 1.0.19 → 1.0.21

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,15 @@
1
+ import { TableColumn } from 'src/types';
2
+ export declare function setActiveColumn<T>(tableColumns: TableColumn<T>[]): {
3
+ checkActive: boolean;
4
+ prop?: string;
5
+ label: string;
6
+ width?: number | string;
7
+ type?: "selection" | "index" | "expand";
8
+ fixed?: boolean | "left" | "right";
9
+ align?: "center" | "left" | "right";
10
+ sortable?: boolean | "custom";
11
+ formatter?: ((row: T) => string) | undefined;
12
+ template?: ((row: T) => import('vue').VNode) | undefined;
13
+ minWidth?: number | string;
14
+ headerAlign?: "center" | "left" | "right";
15
+ }[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rayyy-vue-table-components",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "Vue 3 + Element Plus 表格組件庫",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
@@ -24,6 +24,10 @@
24
24
  "./types/components": {
25
25
  "types": "./src/types/components.d.ts",
26
26
  "import": "./src/types/components.d.ts"
27
+ },
28
+ "./utils": {
29
+ "types": "./src/utils/tableHelper.ts",
30
+ "import": "./src/utils/tableHelper.ts"
27
31
  }
28
32
  },
29
33
  "files": [
@@ -32,6 +36,7 @@
32
36
  "src/components/index.ts",
33
37
  "src/types/*",
34
38
  "src/types/components.d.ts",
39
+ "src/utils/*",
35
40
  "README.md"
36
41
  ],
37
42
  "keywords": [
@@ -1,23 +1,3 @@
1
- <template>
2
- <el-input
3
- v-model="v"
4
- :placeholder="props.placeholder"
5
- :type="props.type"
6
- :class="props.class"
7
- :show-password="props.showPassword"
8
- :disabled="props.disabled"
9
- :readonly="props.readonly"
10
- :maxlength="props.maxlength"
11
- :autocomplete="props.autocomplete"
12
- clearable
13
- @clear="handlerClear"
14
- >
15
- <template v-if="slots.prefix" #prefix>
16
- <slot name="prefix" class="h-4" />
17
- </template>
18
- <template v-if="slots.append" #append><slot name="append" /></template>
19
- </el-input>
20
- </template>
21
1
 
22
2
  <script lang="ts" setup>
23
3
  import { computed, useSlots } from 'vue'
@@ -50,3 +30,25 @@ const handlerClear = () => {
50
30
  emits('update:clearValue')
51
31
  }
52
32
  </script>
33
+
34
+
35
+ <template>
36
+ <el-input
37
+ v-model="v"
38
+ :placeholder="props.placeholder"
39
+ :type="props.type"
40
+ :class="props.class"
41
+ :show-password="props.showPassword"
42
+ :disabled="props.disabled"
43
+ :readonly="props.readonly"
44
+ :maxlength="props.maxlength"
45
+ :autocomplete="props.autocomplete"
46
+ clearable
47
+ @clear="handlerClear"
48
+ >
49
+ <template v-if="slots.prefix" #prefix>
50
+ <slot name="prefix" class="h-4" />
51
+ </template>
52
+ <template v-if="slots.append" #append><slot name="append" /></template>
53
+ </el-input>
54
+ </template>
@@ -0,0 +1,8 @@
1
+ import type { TableColumn } from 'src/types'
2
+
3
+ export function setActiveColumn<T>(tableColumns: TableColumn<T>[]) {
4
+ return tableColumns.map((col) => ({
5
+ ...col,
6
+ checkActive: true,
7
+ }))
8
+ }