rayyy-vue-table-components 2.0.22 → 2.0.25

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,23 @@
1
+ import { ElOptions } from '../../types/OptionDto.ts';
2
+ export type Selection = string | string[];
3
+ type __VLS_Props = {
4
+ modelValue?: Selection;
5
+ options?: ElOptions[];
6
+ placeholder?: string;
7
+ collapseTags?: boolean;
8
+ collapseTagsTooltip?: boolean;
9
+ multiple?: boolean;
10
+ disabled?: boolean;
11
+ class?: string;
12
+ };
13
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
14
+ "update:modelValue": (data?: Selection | undefined) => any;
15
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ "onUpdate:modelValue"?: ((data?: Selection | undefined) => any) | undefined;
17
+ }>, {
18
+ class: string;
19
+ placeholder: string;
20
+ modelValue: Selection;
21
+ options: ElOptions[];
22
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
23
+ export default _default;
@@ -1,9 +1,9 @@
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 BaseSelector } from './form/BaseSelector.vue';
4
5
  export { default as BaseDialog } from './items/BaseDialog.vue';
5
6
  export { default as BaseWaringDialog } from './items/BaseWaringDialog.vue';
6
- export { default as BaseMultipleInput } from './form/BaseMultipleInput.vue';
7
7
  export { default as SortTable } from './tables/SortTable.vue';
8
8
  export { default as TitleTable } from './tables/TitleTable.vue';
9
9
  export { default as SearchBar } from './items/SearchBar.vue';
@@ -18,6 +18,7 @@ export type { BaseTableProps, BaseTableEmits, BaseTableInstance, BaseBtnProps, B
18
18
  export type { default as BaseTableType } from './tables/BaseTable.vue';
19
19
  export type { default as BaseBtnType } from './items/BaseBtn.vue';
20
20
  export type { default as BaseInputType } from './form/BaseInput.vue';
21
+ export type { default as BaseSelectorType } from './form/BaseSelector.vue';
21
22
  export type { default as BaseDialogType } from './items/BaseDialog.vue';
22
23
  export type { default as BaseWaringDialogType } from './items/BaseWaringDialog.vue';
23
24
  export type { default as SortTableType } from './tables/SortTable.vue';
@@ -26,7 +27,6 @@ export type { default as SearchBarType } from './items/SearchBar.vue';
26
27
  export type { default as TransferDialogType } from './transfer/TransferDialog.vue';
27
28
  export type { default as TransferItemType } from './transfer/transferItem.vue';
28
29
  export type { default as SearchableListPanelType } from './layout/SearchableListPanel.vue';
29
- export type { default as BaseMultipleInputType } from './form/BaseMultipleInput.vue';
30
30
  export type { default as FunctionHeaderType } from './layout/FunctionHeader.vue';
31
31
  export type { default as MainPanelType } from './layout/MainPanel.vue';
32
32
  export type { default as DetailLayoutType } from './layout/DetailLayout.vue';
@@ -2,15 +2,24 @@ 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 BaseSelector } from './components/form/BaseSelector.vue';
5
6
  import { default as BaseDialog } from './components/items/BaseDialog.vue';
7
+ import { default as BaseWaringDialog } from './components/items/BaseWaringDialog.vue';
6
8
  import { default as SortTable } from './components/tables/SortTable.vue';
7
9
  import { default as TitleTable } from './components/tables/TitleTable.vue';
8
10
  import { default as SearchBar } from './components/items/SearchBar.vue';
11
+ import { default as TransferDialog } from './components/transfer/TransferDialog.vue';
12
+ import { default as TransferItem } from './components/transfer/transferItem.vue';
13
+ import { default as FunctionHeader } from './components/layout/FunctionHeader.vue';
14
+ import { default as MainPanel } from './components/layout/MainPanel.vue';
15
+ import { default as SearchableListPanel } from './components/layout/SearchableListPanel.vue';
16
+ import { default as DetailLayout } from './components/layout/DetailLayout.vue';
17
+ import { default as FilterLayout } from './components/layout/FilterLayout.vue';
9
18
  export * from './types';
10
19
  export * from './utils/tableHelper';
11
20
  export { useI18n, setLocale, useComponentElementLocale } from './utils/i18n';
12
21
  export * from './locales';
13
- export { BaseTable, BaseBtn, BaseInput, BaseDialog, SortTable, TitleTable, SearchBar };
22
+ export { BaseTable, BaseBtn, BaseInput, BaseSelector, BaseDialog, BaseWaringDialog, SortTable, TitleTable, SearchBar, TransferDialog, TransferItem, FunctionHeader, MainPanel, SearchableListPanel, DetailLayout, FilterLayout };
14
23
  export type { BaseTableProps, BaseTableEmits, BaseTableInstance, BaseBtnProps, BaseBtnEmits, BaseBtnInstance, BaseDialogProps, BaseDialogEmits, BaseDialogInstance, PluginOptions, VueTableComponentsPlugin, } from './types/components';
15
24
  export * from './components';
16
25
  export declare function install(app: App, options?: {
@@ -5,10 +5,10 @@ export declare const ROUTES: {
5
5
  readonly INSTALL_GUIDE: "/install-guide";
6
6
  readonly DOCS_CENTER: "/docs-center";
7
7
  readonly SEARCHABLE_LIST_PANEL: "/demo/searchable-list-panel";
8
- readonly BASE_MULTIPLE_INPUT: "/demo/base-multiple-input";
9
8
  readonly TRANSFER_DIALOG: "/demo/transfer-dialog";
10
9
  readonly BASE_BTN: "/demo/base-btn";
11
10
  readonly BASE_INPUT: "/demo/base-input";
11
+ readonly BASE_SELECTOR: "/demo/base-selector";
12
12
  readonly BASE_DIALOG: "/demo/base-dialog";
13
13
  readonly BASE_WARING_DIALOG: "/demo/base-waring-dialog";
14
14
  readonly BASE_FORM: "/demo/base-form";
@@ -28,10 +28,10 @@ export declare const ROUTE_NAMES: {
28
28
  readonly INSTALL_GUIDE: "InstallGuide";
29
29
  readonly DOCS_CENTER: "DocsCenter";
30
30
  readonly SEARCHABLE_LIST_PANEL: "SearchableListPanel";
31
- readonly BASE_MULTIPLE_INPUT: "BaseMultipleInput";
32
31
  readonly TRANSFER_DIALOG: "TransferDialog";
33
32
  readonly BASE_BTN: "BaseBtn";
34
33
  readonly BASE_INPUT: "BaseInput";
34
+ readonly BASE_SELECTOR: "BaseSelector";
35
35
  readonly BASE_DIALOG: "BaseDialog";
36
36
  readonly BASE_WARING_DIALOG: "BaseWaringDialog";
37
37
  readonly TABLE: "Table";
@@ -369,34 +369,43 @@ export interface BaseInputInstance {
369
369
  $emit: BaseInputEmits
370
370
  }
371
371
 
372
- // ==================== BaseMultipleInput 組件類型 ====================
372
+ // ==================== BaseSelector 組件類型 ====================
373
373
 
374
- /** BaseMultipleInput 組件 Props 類型 */
375
- export interface BaseMultipleInputProps {
376
- /** 模型值(字符串數組) */
377
- modelValue: string[]
378
- /** 輸入框類型 */
379
- type?: string
380
- /** 驗證規則函數 */
381
- validateRule?: (inputString: string) => boolean
374
+ /** BaseSelector 組件 Props 類型 */
375
+ export interface BaseSelectorProps {
376
+ /** 模型值 */
377
+ modelValue?: string | string[]
378
+ /** 選項數據 */
379
+ options?: Array<{ value: string; label: string }>
380
+ /** 佔位符 */
381
+ placeholder?: string
382
+ /** 是否折疊標籤 */
383
+ collapseTags?: boolean
384
+ /** 是否顯示折疊標籤提示 */
385
+ collapseTagsTooltip?: boolean
386
+ /** 是否多選 */
387
+ multiple?: boolean
388
+ /** 是否禁用 */
389
+ disabled?: boolean
390
+ /** 自定義 CSS 類名 */
391
+ class?: string
382
392
  }
383
393
 
384
- /** BaseMultipleInput 組件 Emits 類型 */
385
- export interface BaseMultipleInputEmits {
386
- /** 更新模型值事件 */
387
- (e: 'update:modelValue', val: string[]): void
388
- /** 輸入錯誤事件 */
389
- (e: 'inputError'): void
394
+ /** BaseSelector 組件 Emits 類型 */
395
+ export interface BaseSelectorEmits {
396
+ /** 模型值更新事件 */
397
+ 'update:modelValue': (value?: string | string[]) => void
390
398
  }
391
399
 
392
- /** BaseMultipleInput 組件實例類型 */
393
- export interface BaseMultipleInputInstance {
400
+ /** BaseSelector 組件實例類型 */
401
+ export interface BaseSelectorInstance {
394
402
  /** 組件 Props */
395
- $props: BaseMultipleInputProps
403
+ $props: BaseSelectorProps
396
404
  /** 組件 Emits */
397
- $emit: BaseMultipleInputEmits
405
+ $emit: BaseSelectorEmits
398
406
  }
399
407
 
408
+
400
409
  // ==================== 搜尋相關組件類型 ====================
401
410
 
402
411
  // ==================== SearchBar 組件類型 ====================
@@ -774,9 +783,10 @@ export declare const BaseInput: DefineComponent<
774
783
  install: (app: App) => void
775
784
  }
776
785
 
777
- /** BaseMultipleInput 組件定義 */
778
- export declare const BaseMultipleInput: DefineComponent<
779
- BaseMultipleInputProps,
786
+ /** BaseSelector 組件定義 */
787
+ export declare const BaseSelector: DefineComponent<
788
+ BaseSelectorProps,
789
+ {},
780
790
  {},
781
791
  {},
782
792
  {},
@@ -784,12 +794,13 @@ export declare const BaseMultipleInput: DefineComponent<
784
794
  {},
785
795
  {},
786
796
  {},
787
- BaseMultipleInputEmits
797
+ BaseSelectorEmits
788
798
  > & {
789
799
  /** 安裝方法 */
790
800
  install: (app: App) => void
791
801
  }
792
802
 
803
+
793
804
  /** SearchBar 組件定義 */
794
805
  export declare const SearchBar: DefineComponent<
795
806
  SearchBarProps,
@@ -934,8 +945,8 @@ export interface VueTableComponentsPlugin {
934
945
  TransferDialog: typeof TransferDialog
935
946
  /** BaseInput 組件 */
936
947
  BaseInput: typeof BaseInput
937
- /** BaseMultipleInput 組件 */
938
- BaseMultipleInput: typeof BaseMultipleInput
948
+ /** BaseSelector 組件 */
949
+ BaseSelector: typeof BaseSelector
939
950
  /** SearchBar 組件 */
940
951
  SearchBar: typeof SearchBar
941
952
  /** SearchableListPanel 組件 */
@@ -964,7 +975,7 @@ declare module '@vue/runtime-core' {
964
975
  BaseWaringDialog: typeof BaseWaringDialog
965
976
  TransferDialog: typeof TransferDialog
966
977
  BaseInput: typeof BaseInput
967
- BaseMultipleInput: typeof BaseMultipleInput
978
+ BaseSelector: typeof BaseSelector
968
979
  SearchBar: typeof SearchBar
969
980
  SearchableListPanel: typeof SearchableListPanel
970
981
  FunctionHeader: typeof FunctionHeader
@@ -1,2 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
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
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rayyy-vue-table-components",
3
- "version": "2.0.22",
3
+ "version": "2.0.25",
4
4
  "description": "Vue 3 + Element Plus 表格組件庫",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
@@ -46,3 +46,9 @@
46
46
  @apply w-fit;
47
47
  @apply text-blue-10;
48
48
  }
49
+
50
+
51
+
52
+ .my-select-popper {
53
+ z-index: 4000 !important; /* 比 dialog 高即可 */
54
+ }
@@ -1,29 +1,6 @@
1
- <template>
2
- <el-select
3
- v-bind="attrs"
4
- :model-value="modelValue"
5
- :class="props.class"
6
- :placeholder="props.placeholder || t('common.select')"
7
- :clearable="props.clearable"
8
- :collapse-tags="props.collapseTags"
9
- :collapse-tags-tooltip="props.collapseTagsTooltip"
10
- :multiple="props.multiple"
11
- :disabled="props.disabled"
12
- :reserve-keyword="false"
13
- filterable
14
- @update:model-value="updateValue"
15
- >
16
- <el-option v-for="it in options" :key="it.label" :label="it.label" :value="it.value" />
17
- </el-select>
18
- </template>
19
-
20
1
  <script lang="ts" setup>
21
- import { useAttrs } from 'vue'
22
- import { useI18n } from 'vue-i18n'
23
2
  import type { ElOptions } from '@/types/OptionDto.ts'
24
3
 
25
- const { t } = useI18n()
26
-
27
4
  export type Selection = string | string[]
28
5
 
29
6
  const props = withDefaults(
@@ -31,7 +8,6 @@ const props = withDefaults(
31
8
  modelValue?: Selection
32
9
  options?: ElOptions[]
33
10
  placeholder?: string
34
- clearable?: boolean
35
11
  collapseTags?: boolean
36
12
  collapseTagsTooltip?: boolean
37
13
  multiple?: boolean
@@ -41,14 +17,11 @@ const props = withDefaults(
41
17
  {
42
18
  modelValue: () => '',
43
19
  options: () => [{ value: '', label: '' }],
44
- placeholder: '',
20
+ placeholder: '請選擇',
45
21
  class: 'w-full',
46
22
  },
47
23
  )
48
24
 
49
- // 獲取所有非 props 屬性
50
- const attrs = useAttrs()
51
-
52
25
  const emits = defineEmits<{
53
26
  (e: 'update:modelValue', data?: Selection): void
54
27
  }>()
@@ -57,9 +30,29 @@ function updateValue(val: Selection) {
57
30
  let value: Selection | undefined = val
58
31
 
59
32
  if (typeof value === 'string' && !value) {
33
+ // el-select 元件裡包的是 input,所以當清空時預設會給 string,故把空字串轉成 undefined
60
34
  value = undefined
61
35
  }
62
36
 
63
37
  emits('update:modelValue', value)
64
38
  }
65
39
  </script>
40
+
41
+ <template>
42
+ <el-select
43
+ :model-value="modelValue"
44
+ :class="props.class"
45
+ :placeholder="props.placeholder"
46
+ :clearable="true"
47
+ :collapse-tags="props.collapseTags"
48
+ :collapse-tags-tooltip="props.collapseTagsTooltip"
49
+ :multiple="props.multiple"
50
+ :disabled="props.disabled"
51
+ :reserve-keyword="false"
52
+ filterable
53
+ @update:model-value="updateValue"
54
+ popper-class="my-select-popper"
55
+ >
56
+ <el-option v-for="it in options" :key="it.label" :label="it.label" :value="it.value" />
57
+ </el-select>
58
+ </template>
@@ -2,9 +2,9 @@
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 BaseSelector } from './form/BaseSelector.vue'
5
6
  export { default as BaseDialog } from './items/BaseDialog.vue'
6
7
  export { default as BaseWaringDialog } from './items/BaseWaringDialog.vue'
7
- export { default as BaseMultipleInput } from './form/BaseMultipleInput.vue'
8
8
  export { default as SortTable } from './tables/SortTable.vue'
9
9
  export { default as TitleTable } from './tables/TitleTable.vue'
10
10
  export { default as SearchBar } from './items/SearchBar.vue'
@@ -89,6 +89,7 @@ export type {
89
89
  export type { default as BaseTableType } from './tables/BaseTable.vue'
90
90
  export type { default as BaseBtnType } from './items/BaseBtn.vue'
91
91
  export type { default as BaseInputType } from './form/BaseInput.vue'
92
+ export type { default as BaseSelectorType } from './form/BaseSelector.vue'
92
93
  export type { default as BaseDialogType } from './items/BaseDialog.vue'
93
94
  export type { default as BaseWaringDialogType } from './items/BaseWaringDialog.vue'
94
95
  export type { default as SortTableType } from './tables/SortTable.vue'
@@ -97,7 +98,6 @@ export type { default as SearchBarType } from './items/SearchBar.vue'
97
98
  export type { default as TransferDialogType } from './transfer/TransferDialog.vue'
98
99
  export type { default as TransferItemType } from './transfer/transferItem.vue'
99
100
  export type { default as SearchableListPanelType } from './layout/SearchableListPanel.vue'
100
- export type { default as BaseMultipleInputType } from './form/BaseMultipleInput.vue'
101
101
  export type { default as FunctionHeaderType } from './layout/FunctionHeader.vue'
102
102
  export type { default as MainPanelType } from './layout/MainPanel.vue'
103
103
  export type { default as DetailLayoutType } from './layout/DetailLayout.vue'
@@ -56,14 +56,15 @@ const buttonClass = computed(() => {
56
56
 
57
57
  <style scoped lang="scss">
58
58
  .el-button {
59
- @apply text-sm;
59
+ font-size: 0.875rem;
60
+ line-height: 1.25rem;
60
61
 
61
62
  :deep(span) {
62
- @apply font-bold #{!important};
63
+ font-weight: 700 !important;
63
64
  }
64
65
 
65
66
  &:focus-visible {
66
- @apply outline-none #{!important};
67
+ outline: none !important;
67
68
  }
68
69
 
69
70
  // 主要按钮样式
@@ -109,5 +110,136 @@ const buttonClass = computed(() => {
109
110
  --el-button-disabled-text-color: var(--el-text-color-placeholder);
110
111
  --el-button-text-color: var(--el-text-color-regular);
111
112
  }
113
+
114
+ // 成功按钮样式
115
+ &--success {
116
+ --el-button-bg-color: var(--el-fill-color-blank);
117
+ --el-button-border-color: var(--el-color-success);
118
+ --el-button-hover-bg-color: var(--el-color-success);
119
+ --el-button-hover-border-color: var(--el-color-success);
120
+ --el-button-hover-text-color: var(--el-fill-color-blank);
121
+ --el-button-active-bg-color: var(--el-color-success-dark-2);
122
+ --el-button-active-border-color: var(--el-color-success-dark-2);
123
+ --el-button-disabled-bg-color: var(--el-fill-color-blank);
124
+ --el-button-disabled-border-color: var(--el-color-success-light-7);
125
+ --el-button-disabled-text-color: var(--el-color-success-light-7);
126
+ --el-button-text-color: var(--el-color-success);
127
+
128
+ &.is-fill {
129
+ --el-button-bg-color: var(--el-color-success);
130
+ --el-button-border-color: var(--el-color-success);
131
+ --el-button-hover-bg-color: var(--el-color-success-dark-2);
132
+ --el-button-hover-border-color: var(--el-color-success-dark-2);
133
+ --el-button-active-bg-color: var(--el-color-success-dark-2);
134
+ --el-button-active-border-color: var(--el-color-success-dark-2);
135
+ --el-button-disabled-bg-color: var(--el-color-success-light-7);
136
+ --el-button-disabled-border-color: var(--el-color-success-light-7);
137
+ --el-button-text-color: var(--el-fill-color-blank);
138
+ --el-button-hover-text-color: var(--el-fill-color-blank);
139
+ }
140
+ }
141
+
142
+ // 警告按钮样式
143
+ &--warning {
144
+ --el-button-bg-color: var(--el-fill-color-blank);
145
+ --el-button-border-color: var(--el-color-warning);
146
+ --el-button-hover-bg-color: var(--el-color-warning);
147
+ --el-button-hover-border-color: var(--el-color-warning);
148
+ --el-button-hover-text-color: var(--el-fill-color-blank);
149
+ --el-button-active-bg-color: var(--el-color-warning-dark-2);
150
+ --el-button-active-border-color: var(--el-color-warning-dark-2);
151
+ --el-button-disabled-bg-color: var(--el-fill-color-blank);
152
+ --el-button-disabled-border-color: var(--el-color-warning-light-7);
153
+ --el-button-disabled-text-color: var(--el-color-warning-light-7);
154
+ --el-button-text-color: var(--el-color-warning);
155
+
156
+ &.is-fill {
157
+ --el-button-bg-color: var(--el-color-warning);
158
+ --el-button-border-color: var(--el-color-warning);
159
+ --el-button-hover-bg-color: var(--el-color-warning-dark-2);
160
+ --el-button-hover-border-color: var(--el-color-warning-dark-2);
161
+ --el-button-active-bg-color: var(--el-color-warning-dark-2);
162
+ --el-button-active-border-color: var(--el-color-warning-dark-2);
163
+ --el-button-disabled-bg-color: var(--el-color-warning-light-7);
164
+ --el-button-disabled-border-color: var(--el-color-warning-light-7);
165
+ --el-button-text-color: var(--el-fill-color-blank);
166
+ --el-button-hover-text-color: var(--el-fill-color-blank);
167
+ }
168
+ }
169
+
170
+ // 危险按钮样式
171
+ &--danger {
172
+ --el-button-bg-color: var(--el-fill-color-blank);
173
+ --el-button-border-color: var(--el-color-danger);
174
+ --el-button-hover-bg-color: var(--el-color-danger);
175
+ --el-button-hover-border-color: var(--el-color-danger);
176
+ --el-button-hover-text-color: var(--el-fill-color-blank);
177
+ --el-button-active-bg-color: var(--el-color-danger-dark-2);
178
+ --el-button-active-border-color: var(--el-color-danger-dark-2);
179
+ --el-button-disabled-bg-color: var(--el-fill-color-blank);
180
+ --el-button-disabled-border-color: var(--el-color-danger-light-7);
181
+ --el-button-disabled-text-color: var(--el-color-danger-light-7);
182
+ --el-button-text-color: var(--el-color-danger);
183
+
184
+ &.is-fill {
185
+ --el-button-bg-color: var(--el-color-danger);
186
+ --el-button-border-color: var(--el-color-danger);
187
+ --el-button-hover-bg-color: var(--el-color-danger-dark-2);
188
+ --el-button-hover-border-color: var(--el-color-danger-dark-2);
189
+ --el-button-active-bg-color: var(--el-color-danger-dark-2);
190
+ --el-button-active-border-color: var(--el-color-danger-dark-2);
191
+ --el-button-disabled-bg-color: var(--el-color-danger-light-7);
192
+ --el-button-disabled-border-color: var(--el-color-danger-light-7);
193
+ --el-button-text-color: var(--el-fill-color-blank);
194
+ --el-button-hover-text-color: var(--el-fill-color-blank);
195
+ }
196
+ }
197
+
198
+ // 信息按钮样式
199
+ &--info {
200
+ --el-button-bg-color: var(--el-fill-color-blank);
201
+ --el-button-border-color: var(--el-color-info);
202
+ --el-button-hover-bg-color: var(--el-color-info);
203
+ --el-button-hover-border-color: var(--el-color-info);
204
+ --el-button-hover-text-color: var(--el-fill-color-blank);
205
+ --el-button-active-bg-color: var(--el-color-info-dark-2);
206
+ --el-button-active-border-color: var(--el-color-info-dark-2);
207
+ --el-button-disabled-bg-color: var(--el-fill-color-blank);
208
+ --el-button-disabled-border-color: var(--el-color-info-light-7);
209
+ --el-button-disabled-text-color: var(--el-color-info-light-7);
210
+ --el-button-text-color: var(--el-color-info);
211
+
212
+ &.is-fill {
213
+ --el-button-bg-color: var(--el-color-info);
214
+ --el-button-border-color: var(--el-color-info);
215
+ --el-button-hover-bg-color: var(--el-color-info-dark-2);
216
+ --el-button-hover-border-color: var(--el-color-info-dark-2);
217
+ --el-button-active-bg-color: var(--el-color-info-dark-2);
218
+ --el-button-active-border-color: var(--el-color-info-dark-2);
219
+ --el-button-disabled-bg-color: var(--el-color-info-light-7);
220
+ --el-button-disabled-border-color: var(--el-color-info-light-7);
221
+ --el-button-text-color: var(--el-fill-color-blank);
222
+ --el-button-hover-text-color: var(--el-fill-color-blank);
223
+ }
224
+ }
225
+
226
+ // 通用禁用样式
227
+ &.is-disabled {
228
+ cursor: not-allowed;
229
+ opacity: 0.6;
230
+
231
+ &:hover {
232
+ transform: none;
233
+ }
234
+
235
+ &:active {
236
+ transform: none;
237
+ }
238
+ }
239
+
240
+ // 填充樣式的禁用狀態 - 使用白色文字
241
+ &.is-fill.is-disabled {
242
+ color: white !important;
243
+ }
112
244
  }
113
245
  </style>
@@ -55,18 +55,13 @@ const showPager = computed(() => {
55
55
  }
56
56
  })
57
57
 
58
- // 在 computed 外部調用,保持引用穩定
59
- const fallbackLocale = useComponentElementLocale()
60
-
61
58
  // 優先使用 prop,沒有 prop 則使用 composable
62
59
  const elementLocale = computed(() => {
63
- // 檢查 props.locale 是否為真正的 Language 對象(不是預設值)
64
- if (props.locale && typeof props.locale === 'object' && 'name' in props.locale) {
60
+ if (props.locale) {
65
61
  return props.locale
66
62
  }
67
-
68
- // 使用 fallbackLocale
69
- return fallbackLocale.value
63
+ // 回退:使用簡化的 composable
64
+ return useComponentElementLocale().value
70
65
  })
71
66
  </script>
72
67
 
@@ -370,34 +370,43 @@ export interface BaseInputInstance {
370
370
  $emit: BaseInputEmits
371
371
  }
372
372
 
373
- // ==================== BaseMultipleInput 組件類型 ====================
373
+ // ==================== BaseSelector 組件類型 ====================
374
374
 
375
- /** BaseMultipleInput 組件 Props 類型 */
376
- export interface BaseMultipleInputProps {
377
- /** 模型值(字符串數組) */
378
- modelValue: string[]
379
- /** 輸入框類型 */
380
- type?: string
381
- /** 驗證規則函數 */
382
- validateRule?: (inputString: string) => boolean
375
+ /** BaseSelector 組件 Props 類型 */
376
+ export interface BaseSelectorProps {
377
+ /** 模型值 */
378
+ modelValue?: string | string[]
379
+ /** 選項數據 */
380
+ options?: Array<{ value: string; label: string }>
381
+ /** 佔位符 */
382
+ placeholder?: string
383
+ /** 是否折疊標籤 */
384
+ collapseTags?: boolean
385
+ /** 是否顯示折疊標籤提示 */
386
+ collapseTagsTooltip?: boolean
387
+ /** 是否多選 */
388
+ multiple?: boolean
389
+ /** 是否禁用 */
390
+ disabled?: boolean
391
+ /** 自定義 CSS 類名 */
392
+ class?: string
383
393
  }
384
394
 
385
- /** BaseMultipleInput 組件 Emits 類型 */
386
- export interface BaseMultipleInputEmits {
387
- /** 更新模型值事件 */
388
- (e: 'update:modelValue', val: string[]): void
389
- /** 輸入錯誤事件 */
390
- (e: 'inputError'): void
395
+ /** BaseSelector 組件 Emits 類型 */
396
+ export interface BaseSelectorEmits {
397
+ /** 模型值更新事件 */
398
+ 'update:modelValue': (value?: string | string[]) => void
391
399
  }
392
400
 
393
- /** BaseMultipleInput 組件實例類型 */
394
- export interface BaseMultipleInputInstance {
401
+ /** BaseSelector 組件實例類型 */
402
+ export interface BaseSelectorInstance {
395
403
  /** 組件 Props */
396
- $props: BaseMultipleInputProps
404
+ $props: BaseSelectorProps
397
405
  /** 組件 Emits */
398
- $emit: BaseMultipleInputEmits
406
+ $emit: BaseSelectorEmits
399
407
  }
400
408
 
409
+
401
410
  // ==================== 搜尋相關組件類型 ====================
402
411
 
403
412
  // ==================== SearchBar 組件類型 ====================
@@ -775,9 +784,10 @@ export declare const BaseInput: DefineComponent<
775
784
  install: (app: App) => void
776
785
  }
777
786
 
778
- /** BaseMultipleInput 組件定義 */
779
- export declare const BaseMultipleInput: DefineComponent<
780
- BaseMultipleInputProps,
787
+ /** BaseSelector 組件定義 */
788
+ export declare const BaseSelector: DefineComponent<
789
+ BaseSelectorProps,
790
+ {},
781
791
  {},
782
792
  {},
783
793
  {},
@@ -785,12 +795,13 @@ export declare const BaseMultipleInput: DefineComponent<
785
795
  {},
786
796
  {},
787
797
  {},
788
- BaseMultipleInputEmits
798
+ BaseSelectorEmits
789
799
  > & {
790
800
  /** 安裝方法 */
791
801
  install: (app: App) => void
792
802
  }
793
803
 
804
+
794
805
  /** SearchBar 組件定義 */
795
806
  export declare const SearchBar: DefineComponent<
796
807
  SearchBarProps,
@@ -935,8 +946,8 @@ export interface VueTableComponentsPlugin {
935
946
  TransferDialog: typeof TransferDialog
936
947
  /** BaseInput 組件 */
937
948
  BaseInput: typeof BaseInput
938
- /** BaseMultipleInput 組件 */
939
- BaseMultipleInput: typeof BaseMultipleInput
949
+ /** BaseSelector 組件 */
950
+ BaseSelector: typeof BaseSelector
940
951
  /** SearchBar 組件 */
941
952
  SearchBar: typeof SearchBar
942
953
  /** SearchableListPanel 組件 */
@@ -965,7 +976,7 @@ declare module '@vue/runtime-core' {
965
976
  BaseWaringDialog: typeof BaseWaringDialog
966
977
  TransferDialog: typeof TransferDialog
967
978
  BaseInput: typeof BaseInput
968
- BaseMultipleInput: typeof BaseMultipleInput
979
+ BaseSelector: typeof BaseSelector
969
980
  SearchBar: typeof SearchBar
970
981
  SearchableListPanel: typeof SearchableListPanel
971
982
  FunctionHeader: typeof FunctionHeader
package/src/utils/i18n.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { createI18n, type I18n, type Composer } from 'vue-i18n'
2
- import { getCurrentInstance, computed } from 'vue'
2
+ import { computed } from 'vue'
3
3
  import { messages } from '../locales'
4
4
  import zhTw from 'element-plus/es/locale/lang/zh-tw'
5
- import enUs from 'element-plus/es/locale/lang/en'
6
5
 
7
6
  // 內部 i18n 實例
8
7
  let internalI18n: I18n | null = null