rayyy-vue-table-components 1.2.34 → 1.2.36

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.
@@ -1,7 +1,6 @@
1
1
  export { default as BaseTable } from './tables/BaseTable.vue';
2
2
  export { default as BaseBtn } from './items/BaseBtn.vue';
3
3
  export { default as BaseInput } from './form/BaseInput.vue';
4
- export { default as FilterBtn } from './items/FilterBtn.vue';
5
4
  export { default as BaseDialog } from './items/BaseDialog.vue';
6
5
  export { default as BaseForm } from './form/BaseForm.vue';
7
6
  export { default as BaseMultipleInput } from './form/BaseMultipleInput.vue';
@@ -12,11 +11,10 @@ export { default as TransferItem } from './transfer/transferItem.vue';
12
11
  export { default as FunctionHeader } from './layout/FunctionHeader.vue';
13
12
  export { default as MainPanel } from './layout/MainPanel.vue';
14
13
  export { default as SearchableListPanel } from './layout/SearchableListPanel.vue';
15
- export type { BaseTableProps, BaseTableEmits, BaseTableInstance, BaseBtnProps, BaseBtnEmits, BaseBtnInstance, BaseDialogProps, BaseDialogEmits, BaseDialogInstance, BaseInputProps, BaseInputEmits, BaseInputInstance, FilterBtnProps, FilterBtnEmits, FilterBtnInstance, BaseFormProps, BaseFormEmits, BaseFormInstance, SortTableProps, SortTableEmits, SortTableInstance, SearchBarProps, SearchBarEmits, SearchBarInstance, TransferDialogProps, TransferDialogEmits, TransferDialogInstance, TransferItemProps, TransferItemEmits, TransferItemInstance, MainPanelProps, MainPanelEmits, MainPanelInstance, FunctionHeaderProps, FunctionHeaderEmits, FunctionHeaderInstance, PluginOptions, VueTableComponentsPlugin, } from '../types/components';
14
+ export type { BaseTableProps, BaseTableEmits, BaseTableInstance, BaseBtnProps, BaseBtnEmits, BaseBtnInstance, BaseDialogProps, BaseDialogEmits, BaseDialogInstance, BaseInputProps, BaseInputEmits, BaseInputInstance, BaseFormProps, BaseFormEmits, BaseFormInstance, SortTableProps, SortTableEmits, SortTableInstance, SearchBarProps, SearchBarEmits, SearchBarInstance, SearchBarSlots, TransferDialogProps, TransferDialogEmits, TransferDialogInstance, TransferItemProps, TransferItemEmits, TransferItemInstance, MainPanelProps, MainPanelEmits, MainPanelInstance, FunctionHeaderProps, FunctionHeaderEmits, FunctionHeaderInstance, PluginOptions, VueTableComponentsPlugin, } from '../types/components';
16
15
  export type { default as BaseTableType } from './tables/BaseTable.vue';
17
16
  export type { default as BaseBtnType } from './items/BaseBtn.vue';
18
17
  export type { default as BaseInputType } from './form/BaseInput.vue';
19
- export type { default as FilterBtnType } from './items/FilterBtn.vue';
20
18
  export type { default as BaseDialogType } from './items/BaseDialog.vue';
21
19
  export type { default as BaseFormType } from './form/BaseForm.vue';
22
20
  export type { default as SortTableType } from './tables/SortTable.vue';
@@ -8,7 +8,7 @@ declare function __VLS_template(): {
8
8
  attrs: Partial<{}>;
9
9
  slots: {
10
10
  button?(_: {}): any;
11
- filterBody?(_: {}): any;
11
+ 'customer-filter'?(_: {}): any;
12
12
  };
13
13
  refs: {};
14
14
  rootEl: HTMLDivElement;
@@ -2,13 +2,12 @@ import { App } from 'vue';
2
2
  import { default as BaseTable } from './components/tables/BaseTable.vue';
3
3
  import { default as BaseBtn } from './components/items/BaseBtn.vue';
4
4
  import { default as BaseInput } from './components/form/BaseInput.vue';
5
- import { default as FilterBtn } from './components/items/FilterBtn.vue';
6
5
  import { default as BaseDialog } from './components/items/BaseDialog.vue';
7
6
  import { default as SortTable } from './components/tables/SortTable.vue';
8
7
  import { default as SearchBar } from './components/items/SearchBar.vue';
9
8
  export * from './types';
10
9
  export * from './utils/tableHelper';
11
- export { BaseTable, BaseBtn, BaseInput, FilterBtn, BaseDialog, SortTable, SearchBar };
10
+ export { BaseTable, BaseBtn, BaseInput, BaseDialog, SortTable, SearchBar };
12
11
  export type { BaseTableProps, BaseTableEmits, BaseTableInstance, BaseBtnProps, BaseBtnEmits, BaseBtnInstance, BaseDialogProps, BaseDialogEmits, BaseDialogInstance, PluginOptions, VueTableComponentsPlugin, } from './types/components';
13
12
  export * from './components';
14
13
  export declare function install(app: App, options?: {
@@ -8,7 +8,6 @@ export declare const ROUTES: {
8
8
  readonly BASE_TABLE: "/demo/base-table";
9
9
  readonly BASE_BTN: "/demo/base-btn";
10
10
  readonly BASE_INPUT: "/demo/base-input";
11
- readonly FILTER_BTN: "/demo/filter-btn";
12
11
  readonly BASE_DIALOG: "/demo/base-dialog";
13
12
  readonly BASE_FORM: "/demo/base-form";
14
13
  readonly SORT_TABLE: "/demo/sort-table";
@@ -28,7 +27,6 @@ export declare const ROUTE_NAMES: {
28
27
  readonly BASE_TABLE: "BaseTable";
29
28
  readonly BASE_BTN: "BaseBtn";
30
29
  readonly BASE_INPUT: "BaseInput";
31
- readonly FILTER_BTN: "FilterBtn";
32
30
  readonly BASE_DIALOG: "BaseDialog";
33
31
  readonly BASE_FORM: "BaseForm";
34
32
  readonly SORT_TABLE: "SortTable";
@@ -138,31 +138,6 @@ export interface BaseBtnInstance {
138
138
  $emit: BaseBtnEmits
139
139
  }
140
140
 
141
- // ==================== FilterBtn 組件類型 ====================
142
-
143
- /** FilterBtn 組件 Props 類型 */
144
- export interface FilterBtnProps {
145
- /** 徽章數值 */
146
- badgeValue?: number
147
- /** 抽屜大小,預設為 '50%' */
148
- drawerSize?: string
149
- }
150
-
151
- /** FilterBtn 組件 Emits 類型 */
152
- export interface FilterBtnEmits {
153
- /** 重置事件 */
154
- (e: 'update:reset'): void
155
- /** 提交事件 */
156
- (e: 'update:submit'): void
157
- }
158
-
159
- /** FilterBtn 組件實例類型 */
160
- export interface FilterBtnInstance {
161
- /** 組件 Props */
162
- $props: FilterBtnProps
163
- /** 組件 Emits */
164
- $emit: FilterBtnEmits
165
- }
166
141
 
167
142
  // ==================== 對話框相關組件類型 ====================
168
143
 
@@ -374,6 +349,14 @@ export interface SearchBarInstance {
374
349
  $emit: SearchBarEmits
375
350
  }
376
351
 
352
+ /** SearchBar 組件 Slots 類型 */
353
+ export interface SearchBarSlots {
354
+ /** 按鈕 slot */
355
+ button: () => VNode[]
356
+ /** 自定義篩選 slot */
357
+ 'customer-filter': () => VNode[]
358
+ }
359
+
377
360
  // ==================== SearchableListPanel 組件類型 ====================
378
361
 
379
362
  /** SearchableListPanel 組件 Props 類型 */
@@ -574,21 +557,6 @@ export declare const BaseBtn: DefineComponent<
574
557
  install: (app: App) => void
575
558
  }
576
559
 
577
- /** FilterBtn 組件定義 */
578
- export declare const FilterBtn: DefineComponent<
579
- FilterBtnProps,
580
- {},
581
- {},
582
- {},
583
- {},
584
- {},
585
- {},
586
- {},
587
- FilterBtnEmits
588
- > & {
589
- /** 安裝方法 */
590
- install: (app: App) => void
591
- }
592
560
 
593
561
  /** BaseDialog 組件定義 */
594
562
  export declare const BaseDialog: DefineComponent<
@@ -678,7 +646,7 @@ export declare const SearchBar: DefineComponent<
678
646
  {},
679
647
  {},
680
648
  {},
681
- {},
649
+ SearchBarSlots,
682
650
  {},
683
651
  SearchBarEmits
684
652
  > & {
@@ -770,8 +738,6 @@ export interface VueTableComponentsPlugin {
770
738
  SortTable: typeof SortTable
771
739
  /** BaseBtn 組件 */
772
740
  BaseBtn: typeof BaseBtn
773
- /** FilterBtn 組件 */
774
- FilterBtn: typeof FilterBtn
775
741
  /** BaseDialog 組件 */
776
742
  BaseDialog: typeof BaseDialog
777
743
  /** TransferDialog 組件 */
@@ -801,7 +767,6 @@ declare module '@vue/runtime-core' {
801
767
  BaseTable: typeof BaseTable
802
768
  SortTable: typeof SortTable
803
769
  BaseBtn: typeof BaseBtn
804
- FilterBtn: typeof FilterBtn
805
770
  BaseDialog: typeof BaseDialog
806
771
  TransferDialog: typeof TransferDialog
807
772
  BaseInput: typeof BaseInput
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rayyy-vue-table-components",
3
- "version": "1.2.34",
3
+ "version": "1.2.36",
4
4
  "description": "Vue 3 + Element Plus 表格組件庫",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
@@ -18,52 +18,6 @@
18
18
  }
19
19
  }
20
20
 
21
- // ==================== FilterBtn 組件樣式 ====================
22
- .filter-btn {
23
- @apply text-sky-500;
24
-
25
- p {
26
- @apply text-primary-80 ml-2 text-base font-bold;
27
- }
28
-
29
- i {
30
- @apply text-xl;
31
- }
32
-
33
- .filter-icon {
34
- @apply w-5 h-5 stroke-primary;
35
- }
36
-
37
-
38
-
39
- &:hover {
40
- @apply text-white bg-sky-500;
41
-
42
- p {
43
- @apply text-white;
44
- }
45
-
46
- .filter-icon {
47
- @apply stroke-white;
48
- }
49
-
50
- .fill-icon path {
51
- @apply stroke-white ;
52
- }
53
- }
54
-
55
- &:disabled {
56
- @apply bg-white opacity-50;
57
-
58
- &:hover {
59
- @apply bg-white;
60
-
61
- p {
62
- @apply text-black/20;
63
- }
64
- }
65
- }
66
- }
67
21
 
68
22
  // ==================== TransferItem 組件樣式 ====================
69
23
  .transfer-item-wrapper {
@@ -102,14 +56,6 @@
102
56
  @apply cursor-pointer text-primary-dark text-xl flex items-center justify-center;
103
57
  }
104
58
 
105
- // FilterBtn 文字和圖標樣式
106
- .filter-btn-text {
107
- @apply text-primary-80 ml-2 text-base font-bold;
108
- }
109
-
110
- .filter-btn-icon {
111
- @apply text-xl;
112
- }
113
59
 
114
60
  // TransferDialog
115
61
  .transfer-sort-wrapper {
@@ -2,7 +2,6 @@
2
2
  export { default as BaseTable } from './tables/BaseTable.vue'
3
3
  export { default as BaseBtn } from './items/BaseBtn.vue'
4
4
  export { default as BaseInput } from './form/BaseInput.vue'
5
- export { default as FilterBtn } from './items/FilterBtn.vue'
6
5
  export { default as BaseDialog } from './items/BaseDialog.vue'
7
6
  export { default as BaseForm } from './form/BaseForm.vue'
8
7
  export { default as BaseMultipleInput } from './form/BaseMultipleInput.vue'
@@ -28,9 +27,6 @@ export type {
28
27
  BaseInputProps,
29
28
  BaseInputEmits,
30
29
  BaseInputInstance,
31
- FilterBtnProps,
32
- FilterBtnEmits,
33
- FilterBtnInstance,
34
30
  BaseFormProps,
35
31
  BaseFormEmits,
36
32
  BaseFormInstance,
@@ -40,6 +36,7 @@ export type {
40
36
  SearchBarProps,
41
37
  SearchBarEmits,
42
38
  SearchBarInstance,
39
+ SearchBarSlots,
43
40
  TransferDialogProps,
44
41
  TransferDialogEmits,
45
42
  TransferDialogInstance,
@@ -60,7 +57,6 @@ export type {
60
57
  export type { default as BaseTableType } from './tables/BaseTable.vue'
61
58
  export type { default as BaseBtnType } from './items/BaseBtn.vue'
62
59
  export type { default as BaseInputType } from './form/BaseInput.vue'
63
- export type { default as FilterBtnType } from './items/FilterBtn.vue'
64
60
  export type { default as BaseDialogType } from './items/BaseDialog.vue'
65
61
  export type { default as BaseFormType } from './form/BaseForm.vue'
66
62
  export type { default as SortTableType } from './tables/SortTable.vue'
@@ -1,7 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { ref, useAttrs } from 'vue'
3
3
  import BaseInput from '../form/BaseInput.vue'
4
- import FilterBtn from './FilterBtn.vue'
5
4
 
6
5
  defineProps<{
7
6
  showFilter?: boolean
@@ -48,16 +47,7 @@ const resetFilter = () => {
48
47
  class="search-input_inner"
49
48
  />
50
49
  </div>
51
-
52
- <div class="filter-customer" v-if="showFilter">
53
- <filter-btn
54
- :badge-value="badgeValue"
55
- @update:reset="resetFilter"
56
- :drawer-size="filterDrawerSize"
57
- >
58
- <slot name="filterBody" />
59
- </filter-btn>
60
- </div>
50
+ <slot name="customer-filter"> </slot>
61
51
  </div>
62
52
  </div>
63
53
  </template>
@@ -67,10 +57,6 @@ const resetFilter = () => {
67
57
  @apply flex-wrap;
68
58
  }
69
59
 
70
- .filter-customer {
71
- @apply flex ml-0.5;
72
- }
73
-
74
60
  .search-input {
75
61
  @apply w-64;
76
62
 
@@ -139,31 +139,6 @@ export interface BaseBtnInstance {
139
139
  $emit: BaseBtnEmits
140
140
  }
141
141
 
142
- // ==================== FilterBtn 組件類型 ====================
143
-
144
- /** FilterBtn 組件 Props 類型 */
145
- export interface FilterBtnProps {
146
- /** 徽章數值 */
147
- badgeValue?: number
148
- /** 抽屜大小,預設為 '50%' */
149
- drawerSize?: string
150
- }
151
-
152
- /** FilterBtn 組件 Emits 類型 */
153
- export interface FilterBtnEmits {
154
- /** 重置事件 */
155
- (e: 'update:reset'): void
156
- /** 提交事件 */
157
- (e: 'update:submit'): void
158
- }
159
-
160
- /** FilterBtn 組件實例類型 */
161
- export interface FilterBtnInstance {
162
- /** 組件 Props */
163
- $props: FilterBtnProps
164
- /** 組件 Emits */
165
- $emit: FilterBtnEmits
166
- }
167
142
 
168
143
  // ==================== 對話框相關組件類型 ====================
169
144
 
@@ -375,6 +350,14 @@ export interface SearchBarInstance {
375
350
  $emit: SearchBarEmits
376
351
  }
377
352
 
353
+ /** SearchBar 組件 Slots 類型 */
354
+ export interface SearchBarSlots {
355
+ /** 按鈕 slot */
356
+ button: () => VNode[]
357
+ /** 自定義篩選 slot */
358
+ 'customer-filter': () => VNode[]
359
+ }
360
+
378
361
  // ==================== SearchableListPanel 組件類型 ====================
379
362
 
380
363
  /** SearchableListPanel 組件 Props 類型 */
@@ -575,21 +558,6 @@ export declare const BaseBtn: DefineComponent<
575
558
  install: (app: App) => void
576
559
  }
577
560
 
578
- /** FilterBtn 組件定義 */
579
- export declare const FilterBtn: DefineComponent<
580
- FilterBtnProps,
581
- {},
582
- {},
583
- {},
584
- {},
585
- {},
586
- {},
587
- {},
588
- FilterBtnEmits
589
- > & {
590
- /** 安裝方法 */
591
- install: (app: App) => void
592
- }
593
561
 
594
562
  /** BaseDialog 組件定義 */
595
563
  export declare const BaseDialog: DefineComponent<
@@ -679,7 +647,7 @@ export declare const SearchBar: DefineComponent<
679
647
  {},
680
648
  {},
681
649
  {},
682
- {},
650
+ SearchBarSlots,
683
651
  {},
684
652
  SearchBarEmits
685
653
  > & {
@@ -771,8 +739,6 @@ export interface VueTableComponentsPlugin {
771
739
  SortTable: typeof SortTable
772
740
  /** BaseBtn 組件 */
773
741
  BaseBtn: typeof BaseBtn
774
- /** FilterBtn 組件 */
775
- FilterBtn: typeof FilterBtn
776
742
  /** BaseDialog 組件 */
777
743
  BaseDialog: typeof BaseDialog
778
744
  /** TransferDialog 組件 */
@@ -802,7 +768,6 @@ declare module '@vue/runtime-core' {
802
768
  BaseTable: typeof BaseTable
803
769
  SortTable: typeof SortTable
804
770
  BaseBtn: typeof BaseBtn
805
- FilterBtn: typeof FilterBtn
806
771
  BaseDialog: typeof BaseDialog
807
772
  TransferDialog: typeof TransferDialog
808
773
  BaseInput: typeof BaseInput
@@ -1,31 +0,0 @@
1
- type __VLS_Props = {
2
- badgeValue?: number;
3
- drawerSize?: string;
4
- };
5
- declare function __VLS_template(): {
6
- attrs: Partial<{}>;
7
- slots: {
8
- 'fill-filter'?(_: {}): any;
9
- 'filter-icon'?(_: {}): any;
10
- default?(_: {}): any;
11
- };
12
- refs: {};
13
- rootEl: any;
14
- };
15
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
17
- "update:reset": () => any;
18
- "update:submit": () => any;
19
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
20
- "onUpdate:reset"?: (() => any) | undefined;
21
- "onUpdate:submit"?: (() => any) | undefined;
22
- }>, {
23
- drawerSize: string;
24
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
25
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
26
- export default _default;
27
- type __VLS_WithTemplateSlots<T, S> = T & {
28
- new (): {
29
- $slots: S;
30
- };
31
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
2
- export default _default;
@@ -1,83 +0,0 @@
1
- <script lang="ts" setup>
2
- import { ref, useAttrs } from 'vue'
3
- import { BaseBtn } from '@/components'
4
- import { Search, Filter } from '@element-plus/icons-vue'
5
-
6
- const props = withDefaults(
7
- defineProps<{
8
- badgeValue?: number
9
- drawerSize?: string
10
- }>(),
11
- {
12
- drawerSize: '50%',
13
- },
14
- )
15
-
16
- // 獲取所有非 props 屬性
17
- const attrs = useAttrs()
18
-
19
- const showDrawer = ref(false)
20
-
21
- function onClickBtn() {
22
- showDrawer.value = !showDrawer.value
23
- }
24
-
25
- const emit = defineEmits<{
26
- (e: 'update:reset'): void
27
- (e: 'update:submit'): void
28
- }>()
29
-
30
- const resetValue = () => {
31
- emit('update:reset')
32
- }
33
- const submitFilter = () => {
34
- showDrawer.value = false
35
- }
36
- </script>
37
-
38
- <template>
39
- <base-btn v-bind="attrs" type="primary" class="filter-btn" @click="onClickBtn">
40
- <el-badge
41
- :value="badgeValue"
42
- class="!flex justify-center items-center"
43
- type="primary"
44
- v-if="badgeValue && badgeValue > 0"
45
- >
46
- <slot name="fill-filter">
47
- <el-icon class="filter-icon fill-icon">
48
- <Filter />
49
- </el-icon>
50
- </slot>
51
- </el-badge>
52
- <slot name="filter-icon" v-else>
53
- <el-icon class="filter-icon">
54
- <Filter />
55
- </el-icon>
56
- </slot>
57
- </base-btn>
58
- <el-drawer v-model="showDrawer" :size="drawerSize">
59
- <template #header>
60
- <div class="flex justify-center text-base text-black font-semibold">
61
- <span>查詢條件</span>
62
- </div>
63
- </template>
64
-
65
- <div class="flex justify-between items-center pb-5 font-semibold">
66
- <div class="text-base text-black/70">篩選條件</div>
67
- <div class="text-base text-primary cursor-pointer" @click="resetValue">重置</div>
68
- </div>
69
-
70
- <slot></slot>
71
-
72
- <template #footer>
73
- <base-btn type="primary" class="filter-btn" @click="submitFilter">
74
- <el-icon>
75
- <Search />
76
- </el-icon>
77
- <p>查詢</p>
78
- </base-btn>
79
- </template>
80
- </el-drawer>
81
- </template>
82
-
83
- <style scoped lang="scss"></style>