rayyy-vue-table-components 2.0.44 → 2.0.46

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.
@@ -3,7 +3,6 @@ type __VLS_Props = {
3
3
  waringText?: string;
4
4
  subWaringText?: string;
5
5
  titleText?: string;
6
- modalWidth?: string;
7
6
  };
8
7
  declare function __VLS_template(): {
9
8
  attrs: Partial<{}>;
@@ -15,6 +15,7 @@ declare const _default: <T extends Record<string, unknown> = Record<string, unkn
15
15
  data: T[];
16
16
  columns: TableColumn<T>[];
17
17
  showSelection?: boolean;
18
+ showIndex?: boolean;
18
19
  showSummary?: boolean;
19
20
  showOverFlowTooltip?: boolean;
20
21
  summaryMethod?: ((param: {
@@ -15,6 +15,8 @@ export interface BaseTableProps<T extends Record<string, unknown> = Record<strin
15
15
  columns: TableColumn<T>[]
16
16
  /** 是否顯示選擇列 */
17
17
  showSelection?: boolean
18
+ /** 是否顯示索引列 */
19
+ showIndex?: boolean
18
20
  /** 是否顯示匯總行 */
19
21
  showSummary?: boolean
20
22
  /** 是否顯示溢出提示 */
@@ -230,8 +232,6 @@ export interface BaseDialogProps {
230
232
  subTitle?: string
231
233
  /** 關閉前回調 */
232
234
  beforeClose?: () => void
233
- /** 自定義寬度 */
234
- customWidth?: string
235
235
  /** 是否為警告對話框 */
236
236
  isWaring?: boolean
237
237
  /** 是否為主要對話框 */
@@ -272,8 +272,6 @@ export interface BaseWaringDialogProps {
272
272
  subWaringText?: string
273
273
  /** 標題文字 */
274
274
  titleText?: string
275
- /** 對話框寬度 */
276
- modalWidth?: string
277
275
  }
278
276
 
279
277
  /** BaseWaringDialog 組件 Emits 類型 */
@@ -325,7 +323,6 @@ export interface TransferDialogInstance<T = Record<string, unknown>> {
325
323
  $emit: TransferDialogEmits<T>
326
324
  }
327
325
 
328
-
329
326
  // ==================== BaseInput 組件類型 ====================
330
327
 
331
328
  /** BaseInput 組件 Props 類型 */
@@ -404,7 +401,6 @@ export interface BaseSelectorInstance {
404
401
  $emit: BaseSelectorEmits
405
402
  }
406
403
 
407
-
408
404
  // ==================== 搜尋相關組件類型 ====================
409
405
 
410
406
  // ==================== SearchBar 組件類型 ====================
@@ -799,7 +795,6 @@ export declare const BaseSelector: DefineComponent<
799
795
  install: (app: App) => void
800
796
  }
801
797
 
802
-
803
798
  /** SearchBar 組件定義 */
804
799
  export declare const SearchBar: DefineComponent<
805
800
  SearchBarProps,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rayyy-vue-table-components",
3
- "version": "2.0.44",
3
+ "version": "2.0.46",
4
4
  "description": "Vue 3 + Element Plus 表格組件庫",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
@@ -33,7 +33,7 @@ $colors: (
33
33
  --main-color-light-8: #b3def0;
34
34
  --main-color-light-9: #ccedf7;
35
35
  --main-color-dark-2: #005b96;
36
- --main-color-border: #606266;
36
+ --main-color-border: #c5c8cc;
37
37
 
38
38
  // 成功色系
39
39
  --el-color-success: #67c23a;
@@ -33,10 +33,8 @@ const v = computed({
33
33
  })
34
34
 
35
35
  const getWidth = computed(() => {
36
- if (width.value < 1000) {
37
- return '80%'
38
- } else if (props.customWidth) {
39
- return props.customWidth
36
+ if (width.value < 500) {
37
+ return '100%'
40
38
  }
41
39
  return '50%'
42
40
  })
@@ -6,12 +6,11 @@ import BaseDialog from './BaseDialog.vue'
6
6
  const { t } = useI18n()
7
7
 
8
8
  const props = defineProps<{
9
- modelValue: boolean
10
- waringText?: string
11
- subWaringText?: string
12
- titleText?: string
13
- modalWidth?: string
14
- }>()
9
+ modelValue: boolean
10
+ waringText?: string
11
+ subWaringText?: string
12
+ titleText?: string
13
+ }>()
15
14
 
16
15
  const emit = defineEmits<{
17
16
  (e: 'update:modelValue', value: boolean): void
@@ -31,7 +30,6 @@ const handleSubmit = () => {
31
30
  <base-dialog
32
31
  v-model="dialogVisible"
33
32
  :title="titleText || t('common.warning')"
34
- :custom-width="modalWidth"
35
33
  :is-waring="true"
36
34
  @click:submit="handleSubmit"
37
35
  >
@@ -13,6 +13,7 @@ type Props<T extends Record<string, unknown> = Record<string, unknown>> = {
13
13
  data: T[]
14
14
  columns: TableColumn<T>[]
15
15
  showSelection?: boolean
16
+ showIndex?: boolean
16
17
  showSummary?: boolean
17
18
  showOverFlowTooltip?: boolean
18
19
  summaryMethod?: (param: {
@@ -30,6 +31,7 @@ const props = withDefaults(defineProps<Props<T>>(), {
30
31
  loading: false,
31
32
  data: () => [],
32
33
  showSelection: false,
34
+ showIndex: false,
33
35
  showSummary: false,
34
36
  showOverFlowTooltip: false,
35
37
  showCheckBtn: false,
@@ -101,6 +103,9 @@ const operatorWidth = computed(() => {
101
103
  <!-- 選擇列 -->
102
104
  <el-table-column v-if="showSelection" type="selection" width="60" fixed="left" align="center" />
103
105
 
106
+ <!-- 索引列 -->
107
+ <el-table-column v-if="showIndex" type="index" width="60" fixed="left" align="center" label="No" />
108
+
104
109
  <!-- 數據列 -->
105
110
  <el-table-column v-for="(column, index) in columns" :key="index" v-bind="column">
106
111
  <template #default="{ row }">
@@ -16,6 +16,8 @@ export interface BaseTableProps<T extends Record<string, unknown> = Record<strin
16
16
  columns: TableColumn<T>[]
17
17
  /** 是否顯示選擇列 */
18
18
  showSelection?: boolean
19
+ /** 是否顯示索引列 */
20
+ showIndex?: boolean
19
21
  /** 是否顯示匯總行 */
20
22
  showSummary?: boolean
21
23
  /** 是否顯示溢出提示 */
@@ -231,8 +233,6 @@ export interface BaseDialogProps {
231
233
  subTitle?: string
232
234
  /** 關閉前回調 */
233
235
  beforeClose?: () => void
234
- /** 自定義寬度 */
235
- customWidth?: string
236
236
  /** 是否為警告對話框 */
237
237
  isWaring?: boolean
238
238
  /** 是否為主要對話框 */
@@ -273,8 +273,6 @@ export interface BaseWaringDialogProps {
273
273
  subWaringText?: string
274
274
  /** 標題文字 */
275
275
  titleText?: string
276
- /** 對話框寬度 */
277
- modalWidth?: string
278
276
  }
279
277
 
280
278
  /** BaseWaringDialog 組件 Emits 類型 */
@@ -326,7 +324,6 @@ export interface TransferDialogInstance<T = Record<string, unknown>> {
326
324
  $emit: TransferDialogEmits<T>
327
325
  }
328
326
 
329
-
330
327
  // ==================== BaseInput 組件類型 ====================
331
328
 
332
329
  /** BaseInput 組件 Props 類型 */
@@ -405,7 +402,6 @@ export interface BaseSelectorInstance {
405
402
  $emit: BaseSelectorEmits
406
403
  }
407
404
 
408
-
409
405
  // ==================== 搜尋相關組件類型 ====================
410
406
 
411
407
  // ==================== SearchBar 組件類型 ====================
@@ -800,7 +796,6 @@ export declare const BaseSelector: DefineComponent<
800
796
  install: (app: App) => void
801
797
  }
802
798
 
803
-
804
799
  /** SearchBar 組件定義 */
805
800
  export declare const SearchBar: DefineComponent<
806
801
  SearchBarProps,