rayyy-vue-table-components 1.3.6 → 1.3.8

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.
@@ -10,7 +10,7 @@ type __VLS_Props = {
10
10
  readonly?: boolean;
11
11
  maxlength?: string | number;
12
12
  autocomplete?: string;
13
- dataCy?: string;
13
+ showSearch?: boolean;
14
14
  };
15
15
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
16
16
  "update:modelValue": (data: string | number | null | undefined) => any;
@@ -15,9 +15,11 @@ declare function __VLS_template(): {
15
15
  };
16
16
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
17
  declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
18
+ "click:back": () => any;
18
19
  "update:saveEdit": (value: boolean) => any;
19
20
  "update:cancelEdit": () => any;
20
21
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ "onClick:back"?: (() => any) | undefined;
21
23
  "onUpdate:saveEdit"?: ((value: boolean) => any) | undefined;
22
24
  "onUpdate:cancelEdit"?: (() => any) | undefined;
23
25
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,5 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  mainTitle: string;
3
+ showBack?: boolean | string | object;
3
4
  filterTitle: string;
4
5
  };
5
6
  declare function __VLS_template(): {
@@ -12,9 +13,11 @@ declare function __VLS_template(): {
12
13
  };
13
14
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
15
  declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
16
+ "click:back": () => any;
15
17
  submitEmit: () => any;
16
18
  resetEmit: () => any;
17
19
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
20
+ "onClick:back"?: (() => any) | undefined;
18
21
  onSubmitEmit?: (() => any) | undefined;
19
22
  onResetEmit?: (() => any) | undefined;
20
23
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -21,7 +21,7 @@ export interface BaseTableProps<T extends Record<string, unknown> = Record<strin
21
21
  showOverFlowTooltip?: boolean
22
22
  /** 匯總方法 */
23
23
  summaryMethod?: (param: {
24
- columns: TableColumnCtx<Record<string, unknown>>[];
24
+ columns: TableColumnCtx<Record<string, unknown>>[]
25
25
  data: T[]
26
26
  }) => (string | VNode)[]
27
27
  /** 行樣式類名 */
@@ -67,7 +67,10 @@ export interface SortTableProps<T extends Record<string, unknown> = Record<strin
67
67
  /** 是否顯示溢出提示 */
68
68
  showOverFlowTooltip?: boolean
69
69
  /** 匯總方法 */
70
- summaryMethod?: (param: { columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]; data: T[] }) => (string | import('vue').VNode)[]
70
+ summaryMethod?: (param: {
71
+ columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]
72
+ data: T[]
73
+ }) => (string | import('vue').VNode)[]
71
74
  /** 行樣式類名 */
72
75
  sortTableRowClassName?: (data: { row: T; rowIndex: number }) => string
73
76
  }
@@ -117,7 +120,10 @@ export interface TitleTableProps<T extends Record<string, unknown> = Record<stri
117
120
  /** 是否顯示溢出提示 */
118
121
  showOverFlowTooltip?: boolean
119
122
  /** 匯總方法 */
120
- summaryMethod?: (param: { columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]; data: T[] }) => (string | import('vue').VNode)[]
123
+ summaryMethod?: (param: {
124
+ columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]
125
+ data: T[]
126
+ }) => (string | import('vue').VNode)[]
121
127
  }
122
128
 
123
129
  /** TitleTable 組件 Emits 類型 */
@@ -186,7 +192,6 @@ export interface BaseBtnInstance {
186
192
  $emit: BaseBtnEmits
187
193
  }
188
194
 
189
-
190
195
  // ==================== 對話框相關組件類型 ====================
191
196
 
192
197
  // ==================== BaseDialog 組件類型 ====================
@@ -248,7 +253,10 @@ export interface TransferDialogEmits<T = Record<string, unknown>> {
248
253
  /** 提交事件 */
249
254
  (e: 'update:submit', data: import('./index').TableColumn<T>[]): void
250
255
  /** checkbox 狀態變更事件 */
251
- (e: 'update:checkChange', data: { columns: import('./index').TableColumn<T>[], checkList: string[] }): void
256
+ (
257
+ e: 'update:checkChange',
258
+ data: { columns: import('./index').TableColumn<T>[]; checkList: string[] },
259
+ ): void
252
260
  }
253
261
 
254
262
  /** TransferDialog 組件實例類型 */
@@ -284,7 +292,7 @@ export interface BaseInputProps {
284
292
  /** 自動完成 */
285
293
  autocomplete?: string
286
294
  /** 測試屬性 */
287
- dataCy?: string
295
+ showSearch?: boolean
288
296
  }
289
297
 
290
298
  /** BaseInput 組件 Emits 類型 */
@@ -303,7 +311,6 @@ export interface BaseInputInstance {
303
311
  $emit: BaseInputEmits
304
312
  }
305
313
 
306
-
307
314
  // ==================== BaseMultipleInput 組件類型 ====================
308
315
 
309
316
  /** BaseMultipleInput 組件 Props 類型 */
@@ -314,8 +321,6 @@ export interface BaseMultipleInputProps {
314
321
  type?: string
315
322
  /** 驗證規則函數 */
316
323
  validateRule?: (inputString: string) => boolean
317
- /** 測試屬性 */
318
- dataCy?: string
319
324
  }
320
325
 
321
326
  /** BaseMultipleInput 組件 Emits 類型 */
@@ -498,6 +503,8 @@ export interface DetailLayoutEmits {
498
503
  (e: 'update:saveEdit', value: boolean): void
499
504
  /** 取消編輯事件 */
500
505
  (e: 'update:cancelEdit'): void
506
+ /** 返回按鈕點擊事件 */
507
+ (e: 'click:back'): void
501
508
  }
502
509
 
503
510
  /** DetailLayout 組件實例類型 */
@@ -512,8 +519,10 @@ export interface DetailLayoutInstance {
512
519
 
513
520
  /** FilterLayout 組件 Props 類型 */
514
521
  export interface FilterLayoutProps {
515
- /** 主要標題 */
522
+ /** 標題 */
516
523
  mainTitle: string
524
+ /** 是否顯示返回按鈕 */
525
+ showBack?: boolean | string | object
517
526
  /** 篩選標題 */
518
527
  filterTitle: string
519
528
  }
@@ -524,6 +533,8 @@ export interface FilterLayoutEmits {
524
533
  (e: 'submitEmit'): void
525
534
  /** 重置篩選事件 */
526
535
  (e: 'resetEmit'): void
536
+ /** 返回按鈕點擊事件 */
537
+ (e: 'click:back'): void
527
538
  }
528
539
 
529
540
  /** FilterLayout 組件實例類型 */
@@ -636,7 +647,6 @@ export declare const BaseBtn: DefineComponent<
636
647
  install: (app: App) => void
637
648
  }
638
649
 
639
-
640
650
  /** BaseDialog 組件定義 */
641
651
  export declare const BaseDialog: DefineComponent<
642
652
  BaseDialogProps,
@@ -685,7 +695,6 @@ export declare const BaseInput: DefineComponent<
685
695
  install: (app: App) => void
686
696
  }
687
697
 
688
-
689
698
  /** BaseMultipleInput 組件定義 */
690
699
  export declare const BaseMultipleInput: DefineComponent<
691
700
  BaseMultipleInputProps,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rayyy-vue-table-components",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "description": "Vue 3 + Element Plus 表格組件庫",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
@@ -12,7 +12,7 @@ const props = defineProps<{
12
12
  readonly?: boolean
13
13
  maxlength?: string | number
14
14
  autocomplete?: string
15
- dataCy?: string
15
+ showSearch?: boolean
16
16
  }>()
17
17
 
18
18
  const emits = defineEmits<{
@@ -47,7 +47,7 @@ const handlerClear = () => {
47
47
  clearable
48
48
  @clear="handlerClear"
49
49
  >
50
- <template #prefix>
50
+ <template #prefix v-if="showSearch">
51
51
  <div class="text-text-border w-full h-full flex items-center justify-center text-lg">
52
52
  <el-icon><Search /></el-icon>
53
53
  </div>
@@ -34,7 +34,6 @@ const props = withDefaults(
34
34
  multiple?: boolean
35
35
  disabled?: boolean
36
36
  class?: string
37
- dataCy?: string
38
37
  }>(),
39
38
  {
40
39
  modelValue: () => '',
@@ -39,6 +39,7 @@ const resetFilter = () => {
39
39
  <base-input
40
40
  v-model="keyword"
41
41
  placeholder="請輸入關鍵字搜尋列表"
42
+ :show-word-limit="true"
42
43
  @keydown.enter="doSearch"
43
44
  @update:clearValue="clearableClick"
44
45
  class="search-input_inner"
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { MainPanel, BaseBtn } from '@/components'
2
+ import { MainPanel, BaseBtn, SearchableListPanel } from '@/components'
3
3
 
4
4
  defineProps<{
5
5
  title: string
@@ -11,6 +11,7 @@ defineProps<{
11
11
  const emit = defineEmits<{
12
12
  (e: 'update:saveEdit', value: boolean): void
13
13
  (e: 'update:cancelEdit'): void
14
+ (e: 'click:back'): void
14
15
  }>()
15
16
 
16
17
  const saveDetailEdit = () => {
@@ -19,10 +20,13 @@ const saveDetailEdit = () => {
19
20
  const cancelDetailEdit = () => {
20
21
  emit('update:cancelEdit')
21
22
  }
23
+ const handleBackClick = () => {
24
+ emit('click:back')
25
+ }
22
26
  </script>
23
27
 
24
28
  <template>
25
- <MainPanel :title="title" :show-back="showBack">
29
+ <MainPanel :title="title" :show-back="showBack" @click:back="handleBackClick">
26
30
  <template #main>
27
31
  <div class="detail-container" v-loading="pageLoading">
28
32
  <slot name="detailHeader"></slot>
@@ -3,12 +3,14 @@ import { MainPanel, BaseBtn } from '@/components'
3
3
 
4
4
  defineProps<{
5
5
  mainTitle: string
6
+ showBack?: boolean | string | object
6
7
  filterTitle: string
7
8
  }>()
8
9
 
9
10
  const emit = defineEmits<{
10
11
  (e: 'submitEmit'): void
11
12
  (e: 'resetEmit'): void
13
+ (e: 'click:back'): void
12
14
  }>()
13
15
 
14
16
  const doFilter = () => {
@@ -17,10 +19,14 @@ const doFilter = () => {
17
19
  const resetFilter = () => {
18
20
  emit('resetEmit')
19
21
  }
22
+
23
+ const handleBackClick = () => {
24
+ emit('click:back')
25
+ }
20
26
  </script>
21
27
 
22
28
  <template>
23
- <main-panel :title="mainTitle">
29
+ <MainPanel :title="mainTitle" :show-back="showBack" @click:back="handleBackClick">
24
30
  <template #main>
25
31
  <div class="filter-container">
26
32
  <div class="filter-header">{{ filterTitle }}</div>
@@ -34,7 +40,7 @@ const resetFilter = () => {
34
40
  <base-btn text="重設" type="primary" @click="resetFilter" />
35
41
  </div>
36
42
  </template>
37
- </main-panel>
43
+ </MainPanel>
38
44
  </template>
39
45
 
40
46
  <style scoped>
@@ -22,7 +22,7 @@ export interface BaseTableProps<T extends Record<string, unknown> = Record<strin
22
22
  showOverFlowTooltip?: boolean
23
23
  /** 匯總方法 */
24
24
  summaryMethod?: (param: {
25
- columns: TableColumnCtx<Record<string, unknown>>[];
25
+ columns: TableColumnCtx<Record<string, unknown>>[]
26
26
  data: T[]
27
27
  }) => (string | VNode)[]
28
28
  /** 行樣式類名 */
@@ -68,7 +68,10 @@ export interface SortTableProps<T extends Record<string, unknown> = Record<strin
68
68
  /** 是否顯示溢出提示 */
69
69
  showOverFlowTooltip?: boolean
70
70
  /** 匯總方法 */
71
- summaryMethod?: (param: { columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]; data: T[] }) => (string | import('vue').VNode)[]
71
+ summaryMethod?: (param: {
72
+ columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]
73
+ data: T[]
74
+ }) => (string | import('vue').VNode)[]
72
75
  /** 行樣式類名 */
73
76
  sortTableRowClassName?: (data: { row: T; rowIndex: number }) => string
74
77
  }
@@ -118,7 +121,10 @@ export interface TitleTableProps<T extends Record<string, unknown> = Record<stri
118
121
  /** 是否顯示溢出提示 */
119
122
  showOverFlowTooltip?: boolean
120
123
  /** 匯總方法 */
121
- summaryMethod?: (param: { columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]; data: T[] }) => (string | import('vue').VNode)[]
124
+ summaryMethod?: (param: {
125
+ columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]
126
+ data: T[]
127
+ }) => (string | import('vue').VNode)[]
122
128
  }
123
129
 
124
130
  /** TitleTable 組件 Emits 類型 */
@@ -187,7 +193,6 @@ export interface BaseBtnInstance {
187
193
  $emit: BaseBtnEmits
188
194
  }
189
195
 
190
-
191
196
  // ==================== 對話框相關組件類型 ====================
192
197
 
193
198
  // ==================== BaseDialog 組件類型 ====================
@@ -249,7 +254,10 @@ export interface TransferDialogEmits<T = Record<string, unknown>> {
249
254
  /** 提交事件 */
250
255
  (e: 'update:submit', data: import('./index').TableColumn<T>[]): void
251
256
  /** checkbox 狀態變更事件 */
252
- (e: 'update:checkChange', data: { columns: import('./index').TableColumn<T>[], checkList: string[] }): void
257
+ (
258
+ e: 'update:checkChange',
259
+ data: { columns: import('./index').TableColumn<T>[]; checkList: string[] },
260
+ ): void
253
261
  }
254
262
 
255
263
  /** TransferDialog 組件實例類型 */
@@ -285,7 +293,7 @@ export interface BaseInputProps {
285
293
  /** 自動完成 */
286
294
  autocomplete?: string
287
295
  /** 測試屬性 */
288
- dataCy?: string
296
+ showSearch?: boolean
289
297
  }
290
298
 
291
299
  /** BaseInput 組件 Emits 類型 */
@@ -304,7 +312,6 @@ export interface BaseInputInstance {
304
312
  $emit: BaseInputEmits
305
313
  }
306
314
 
307
-
308
315
  // ==================== BaseMultipleInput 組件類型 ====================
309
316
 
310
317
  /** BaseMultipleInput 組件 Props 類型 */
@@ -315,8 +322,6 @@ export interface BaseMultipleInputProps {
315
322
  type?: string
316
323
  /** 驗證規則函數 */
317
324
  validateRule?: (inputString: string) => boolean
318
- /** 測試屬性 */
319
- dataCy?: string
320
325
  }
321
326
 
322
327
  /** BaseMultipleInput 組件 Emits 類型 */
@@ -499,6 +504,8 @@ export interface DetailLayoutEmits {
499
504
  (e: 'update:saveEdit', value: boolean): void
500
505
  /** 取消編輯事件 */
501
506
  (e: 'update:cancelEdit'): void
507
+ /** 返回按鈕點擊事件 */
508
+ (e: 'click:back'): void
502
509
  }
503
510
 
504
511
  /** DetailLayout 組件實例類型 */
@@ -513,8 +520,10 @@ export interface DetailLayoutInstance {
513
520
 
514
521
  /** FilterLayout 組件 Props 類型 */
515
522
  export interface FilterLayoutProps {
516
- /** 主要標題 */
523
+ /** 標題 */
517
524
  mainTitle: string
525
+ /** 是否顯示返回按鈕 */
526
+ showBack?: boolean | string | object
518
527
  /** 篩選標題 */
519
528
  filterTitle: string
520
529
  }
@@ -525,6 +534,8 @@ export interface FilterLayoutEmits {
525
534
  (e: 'submitEmit'): void
526
535
  /** 重置篩選事件 */
527
536
  (e: 'resetEmit'): void
537
+ /** 返回按鈕點擊事件 */
538
+ (e: 'click:back'): void
528
539
  }
529
540
 
530
541
  /** FilterLayout 組件實例類型 */
@@ -637,7 +648,6 @@ export declare const BaseBtn: DefineComponent<
637
648
  install: (app: App) => void
638
649
  }
639
650
 
640
-
641
651
  /** BaseDialog 組件定義 */
642
652
  export declare const BaseDialog: DefineComponent<
643
653
  BaseDialogProps,
@@ -686,7 +696,6 @@ export declare const BaseInput: DefineComponent<
686
696
  install: (app: App) => void
687
697
  }
688
698
 
689
-
690
699
  /** BaseMultipleInput 組件定義 */
691
700
  export declare const BaseMultipleInput: DefineComponent<
692
701
  BaseMultipleInputProps,