rayyy-vue-table-components 1.3.21 → 1.3.22

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.
@@ -33,6 +33,8 @@ export declare const i18n: import('vue-i18n').I18n<{
33
33
  "button.withIcon ": string;
34
34
  "button.add": string;
35
35
  "button.delete": string;
36
+ "common.save": string;
37
+ "common.discard": string;
36
38
  };
37
39
  'en-US': {
38
40
  "common.select": string;
@@ -68,6 +70,8 @@ export declare const i18n: import('vue-i18n').I18n<{
68
70
  "button.withIcon ": string;
69
71
  "button.add": string;
70
72
  "button.delete": string;
73
+ "common.save": string;
74
+ "common.discard": string;
71
75
  };
72
76
  }, {}, {}, string, false>;
73
77
  export declare const switchLanguage: (locale: "zh-TW" | "en-US") => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rayyy-vue-table-components",
3
- "version": "1.3.21",
3
+ "version": "1.3.22",
4
4
  "description": "Vue 3 + Element Plus 表格組件庫",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
@@ -1,7 +1,10 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
+ import { useI18n } from 'vue-i18n'
3
4
  import BaseDialog from './BaseDialog.vue'
4
5
 
6
+ const { t } = useI18n()
7
+
5
8
  const props = withDefaults(
6
9
  defineProps<{
7
10
  modelValue: boolean
@@ -11,8 +14,8 @@ const props = withDefaults(
11
14
  modalWidth?: string
12
15
  }>(),
13
16
  {
14
- waringText: '請問是否確認移除該使用者',
15
- titleText: '警告',
17
+ waringText: 'dialog.confirmRemoveUser',
18
+ titleText: 'common.warning',
16
19
  },
17
20
  )
18
21
 
@@ -33,7 +36,7 @@ const handleSubmit = () => {
33
36
  <template>
34
37
  <base-dialog
35
38
  v-model="dialogVisible"
36
- :title="titleText"
39
+ :title="t(titleText)"
37
40
  :custom-width="modalWidth"
38
41
  :is-waring="true"
39
42
  @click:submit="handleSubmit"
@@ -41,7 +44,7 @@ const handleSubmit = () => {
41
44
  <div class="w-full h-16 flex items-center justify-center flex-col">
42
45
  <slot>
43
46
  <p>{{ subWaringText }}</p>
44
- <p>{{ waringText }} ?</p>
47
+ <p>{{ t(waringText) }} ?</p>
45
48
  </slot>
46
49
  </div>
47
50
  </base-dialog>
@@ -1,7 +1,10 @@
1
1
  <script lang="ts" setup>
2
2
  import { ref, useAttrs } from 'vue'
3
+ import { useI18n } from 'vue-i18n'
3
4
  import BaseInput from '../form/BaseInput.vue'
4
5
 
6
+ const { t } = useI18n()
7
+
5
8
  defineProps<{
6
9
  showSearch?: boolean
7
10
  }>()
@@ -38,7 +41,7 @@ const resetFilter = () => {
38
41
  <div v-if="showSearch" class="search-input">
39
42
  <base-input
40
43
  v-model="keyword"
41
- placeholder="請輸入關鍵字搜尋列表"
44
+ :placeholder="t('search.placeholder')"
42
45
  :show-word-limit="true"
43
46
  @keydown.enter="doSearch"
44
47
  @update:clearValue="clearableClick"
@@ -1,5 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { MainPanel, BaseBtn, SearchableListPanel } from '@/components'
2
+ import { useI18n } from 'vue-i18n'
3
+ import { MainPanel, BaseBtn } from '@/components'
4
+
5
+ const { t } = useI18n()
3
6
 
4
7
  defineProps<{
5
8
  title: string
@@ -39,8 +42,8 @@ const handleBackClick = () => {
39
42
 
40
43
  <template #footer>
41
44
  <div class="border-t pt-4 w-full flex items-center justify-end" v-if="isEditable">
42
- <BaseBtn text="儲存" type="primary" is-fill @click="saveDetailEdit" />
43
- <BaseBtn text="捨棄" type="primary" @click="cancelDetailEdit" />
45
+ <BaseBtn :text="t('common.save')" type="primary" is-fill @click="saveDetailEdit" />
46
+ <BaseBtn :text="t('common.discard')" type="primary" @click="cancelDetailEdit" />
44
47
  </div>
45
48
  </template>
46
49
  </MainPanel>
@@ -1,6 +1,9 @@
1
1
  <script setup lang="ts">
2
+ import { useI18n } from 'vue-i18n'
2
3
  import { MainPanel, BaseBtn } from '@/components'
3
4
 
5
+ const { t } = useI18n()
6
+
4
7
  defineProps<{
5
8
  mainTitle: string
6
9
  showBack?: boolean | string | object
@@ -36,8 +39,8 @@ const handleBackClick = () => {
36
39
  </template>
37
40
  <template #footer>
38
41
  <div class="submit-row">
39
- <base-btn text="執行" is-fill type="primary" @click="doFilter" />
40
- <base-btn text="重設" type="primary" @click="resetFilter" />
42
+ <base-btn :text="t('common.execute')" is-fill type="primary" @click="doFilter" />
43
+ <base-btn :text="t('common.reset')" type="primary" @click="resetFilter" />
41
44
  </div>
42
45
  </template>
43
46
  </MainPanel>
@@ -1,9 +1,12 @@
1
1
  <script setup lang="ts" generic="T extends Record<string, unknown> = Record<string, unknown>">
2
2
  import type { VNode } from 'vue'
3
3
  import { computed } from 'vue'
4
+ import { useI18n } from 'vue-i18n'
4
5
  import type { TableColumnCtx } from 'element-plus'
5
6
  import type { SortChangValue, TableColumn } from '@/types'
6
7
 
8
+ const { t } = useI18n()
9
+
7
10
  type Props<T extends Record<string, unknown> = Record<string, unknown>> = {
8
11
  loading?: boolean
9
12
  data: T[]
@@ -79,7 +82,7 @@ const operatorWidth = computed(() => {
79
82
  <template>
80
83
  <el-table
81
84
  v-loading="loading"
82
- element-loading-text="數據加載中..."
85
+ :element-loading-text="t('common.loading')"
83
86
  :data="data"
84
87
  border
85
88
  :show-summary="showSummary"
@@ -127,7 +130,7 @@ const operatorWidth = computed(() => {
127
130
  @click="handleOperateClick(row, 'check')"
128
131
  v-if="showCheckBtn"
129
132
  >
130
- 查看
133
+ {{ t('common.view') }}
131
134
  </p>
132
135
  <el-divider direction="vertical" class="!mx-2" v-if="showCheckBtn && showEditBtn" />
133
136
  <p
@@ -135,7 +138,7 @@ const operatorWidth = computed(() => {
135
138
  @click="handleOperateClick(row, 'edit')"
136
139
  v-if="showEditBtn"
137
140
  >
138
- 编辑
141
+ {{ t('common.edit') }}
139
142
  </p>
140
143
  </div>
141
144
  </template>