nuxt-hs-ui 2.6.0 → 2.8.0

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.
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.15.0"
6
6
  },
7
- "version": "2.6.0",
7
+ "version": "2.8.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -12,9 +12,11 @@ import { twMerge } from "tailwind-merge";
12
12
  import { reactive, ref, watch, computed, useId, nextTick } from "#imports";
13
13
  // [ utils ]
14
14
  import { type ClassType, ClassTypeToString } from "../../utils/class-style";
15
+ import type { MultiLang } from "../../utils/multi-lang";
15
16
  // [ composables ]
16
17
  import { useHsFocus } from "../../composables/use-hs-focus";
17
18
  import { useHsToast } from "../../composables/use-hs-toast";
19
+ import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
18
20
  // [ Components ]
19
21
  import SelectImgIcon from "./select-img-icon.vue";
20
22
  // ----------------------------------------------------------------------------
@@ -41,7 +43,7 @@ type Props = {
41
43
  disabled?: boolean;
42
44
  // ----------------------------------------------------------------------------
43
45
  // 表示
44
- label?: string;
46
+ label?: MultiLang;
45
47
  warn?: string;
46
48
  warnTimeOut?: number;
47
49
  // ----------------------------------------------------------------------------
@@ -50,7 +52,7 @@ type Props = {
50
52
  // ----------------------------------------------------------------------------
51
53
  uiText?: {
52
54
  validError: {
53
- title: string;
55
+ title: MultiLang;
54
56
  };
55
57
  };
56
58
  };
@@ -80,7 +82,7 @@ const props = withDefaults(defineProps<Props>(), {
80
82
  uiText: () => {
81
83
  return {
82
84
  validError: {
83
- title: "入力値の警告",
85
+ title: { ja: "入力値の警告", en: "Input Value Warning" },
84
86
  },
85
87
  };
86
88
  },
@@ -101,6 +103,10 @@ type Emits = {
101
103
  };
102
104
  const emit = defineEmits<Emits>();
103
105
  // ----------------------------------------------------------------------------
106
+
107
+ const multiLang = useHsMultiLang();
108
+ const tx = multiLang.tx;
109
+ // ----------------------------------------------------------------------------
104
110
  // [ getCurrentInstance ]
105
111
  const uid = useId();
106
112
  // ----------------------------------------------------------------------------
@@ -292,7 +298,7 @@ const labelClass = computed(() => {
292
298
  :class-img-tag="props.classImgTag"
293
299
  />
294
300
  <div class="flex-1 min-w-[0] whitespace-pre-wrap break-words">
295
- {{ label }}
301
+ {{ tx(label) }}
296
302
  <slot />
297
303
  </div>
298
304
  <span
@@ -31,7 +31,7 @@ type Props = {
31
31
  // Input 種類別
32
32
  list: SelectItem[] | readonly SelectItem[];
33
33
  image?: boolean;
34
- nullText?: string;
34
+ nullText?: MultiLang;
35
35
  classRow?: ClassType;
36
36
  classCol?: ClassType;
37
37
  classItem?: ClassType;
@@ -56,10 +56,10 @@ type Props = {
56
56
  readonly?: boolean;
57
57
  // ----------------------------------------------------------------------------
58
58
  // 表示
59
- label?: string;
59
+ label?: MultiLang;
60
60
  // 表示-副情報
61
61
  require?: boolean;
62
- requireText?: string;
62
+ requireText?: MultiLang;
63
63
  warn?: string;
64
64
  warnTimeOut?: number;
65
65
  // ----------------------------------------------------------------------------
@@ -72,7 +72,7 @@ const props = withDefaults(defineProps<Props>(), {
72
72
  // Input 種類別
73
73
  order: false,
74
74
  image: false,
75
- nullText: "選択してください",
75
+ nullText: () => ({ ja: "選択してください", en: "" }),
76
76
  nullable: true,
77
77
  classRow: "",
78
78
  classCol: "",
@@ -102,7 +102,7 @@ const props = withDefaults(defineProps<Props>(), {
102
102
  label: "",
103
103
  // 表示-副情報
104
104
  require: false,
105
- requireText: "必須",
105
+ requireText: () => ({ ja: "必須", en: "" }),
106
106
  warn: "",
107
107
  warnTimeOut: 3000,
108
108
  // ----------------------------------------------------------------------------
@@ -314,7 +314,7 @@ const itemClass = computed(() => {
314
314
  :readonly="props.readonly"
315
315
  :label="props.label"
316
316
  :require="props.require"
317
- :require-text="props.requireText"
317
+ :require-text="tx(props.requireText).value"
318
318
  :warn="props.warn"
319
319
  :warn-time-out="props.warnTimeOut"
320
320
  :size="props.size"
@@ -29,6 +29,7 @@ import {
29
29
  import { Sleep } from "../../utils/com";
30
30
  import type { ClassType } from "../../utils/class-style";
31
31
  import { GetTimeShiftValue, Dayjs, DayjsInit } from "../../utils/dayjs";
32
+ import type { MultiLang } from "../../utils/multi-lang";
32
33
  // [ utils ]
33
34
 
34
35
  import { ja } from "../../types/flatpickr/ja";
@@ -59,6 +60,7 @@ const hsFocus = useHsFocus();
59
60
  const Toast = useHsToast();
60
61
  const multiLang = useHsMultiLang();
61
62
  const hsMisc = useHsMisc();
63
+ const tx = multiLang.tx;
62
64
  // ----------------------------------------------------------------------------
63
65
  // [ vueuse ]
64
66
  const isMounted = useMounted();
@@ -105,10 +107,10 @@ type Props = {
105
107
  readonly?: boolean;
106
108
  // ----------------------------------------------------------------------------
107
109
  // 表示
108
- label?: string;
110
+ label?: MultiLang;
109
111
  // 表示-副情報
110
112
  require?: boolean;
111
- requireText?: string;
113
+ requireText?: MultiLang;
112
114
  warn?: string;
113
115
  warnTimeOut?: number;
114
116
  // ----------------------------------------------------------------------------
@@ -117,8 +119,8 @@ type Props = {
117
119
  // ----------------------------------------------------------------------------
118
120
  uiText?: {
119
121
  error: {
120
- inputRangeTitle: string;
121
- inputRangeMessage: string;
122
+ inputRangeTitle: MultiLang;
123
+ inputRangeMessage: MultiLang;
122
124
  };
123
125
  };
124
126
  };
@@ -158,7 +160,7 @@ const props = withDefaults(defineProps<Props>(), {
158
160
  label: "",
159
161
  // 表示-副情報
160
162
  require: false,
161
- requireText: "必須",
163
+ requireText: () => ({ ja: "必須", en: "Required" }),
162
164
  warn: "",
163
165
  warnTimeOut: 3000,
164
166
  // ----------------------------------------------------------------------------
@@ -168,8 +170,11 @@ const props = withDefaults(defineProps<Props>(), {
168
170
  uiText: () => {
169
171
  return {
170
172
  error: {
171
- inputRangeTitle: "入力値エラー",
172
- inputRangeMessage: "入力範囲外です",
173
+ inputRangeTitle: { ja: "入力値の警告", en: "Input Value Warning" },
174
+ inputRangeMessage: {
175
+ ja: "入力範囲外です",
176
+ en: "Input is out of range",
177
+ },
173
178
  },
174
179
  };
175
180
  },
@@ -751,7 +756,7 @@ const computedIsFocusOpenBtn = computed(() => {
751
756
  :readonly="props.readonly"
752
757
  :label="props.label"
753
758
  :require="props.require"
754
- :require-text="props.requireText"
759
+ :require-text="tx(props.requireText).value"
755
760
  :warn="props.warn"
756
761
  :warn-time-out="props.warnTimeOut"
757
762
  :size="props.size"
@@ -12,8 +12,10 @@ import { twMerge } from "tailwind-merge";
12
12
  import { computed, useSlots } from "#imports";
13
13
  // [ utils ]
14
14
  import { type ClassType, ClassTypeToString } from "../../utils/class-style";
15
+ import type { MultiLang } from "../../utils/multi-lang";
15
16
  // [ composables ]
16
17
  import { useHsToast } from "../../composables/use-hs-toast";
18
+ import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
17
19
  // ----------------------------------------------------------------------------
18
20
  // [ Props ]
19
21
  type Props = {
@@ -34,10 +36,10 @@ type Props = {
34
36
  // ----------------------------------------------------------------------------
35
37
 
36
38
  // 表示
37
- label?: string;
39
+ label?: MultiLang;
38
40
  // 表示-副情報
39
41
  require?: boolean;
40
- requireText?: string;
42
+ requireText?: MultiLang;
41
43
  warn?: string;
42
44
  warnTimeOut?: number;
43
45
  // ----------------------------------------------------------------------------
@@ -64,7 +66,7 @@ const props = withDefaults(defineProps<Props>(), {
64
66
  label: "",
65
67
  // 表示-副情報
66
68
  require: false,
67
- requireText: "必須",
69
+ requireText: () => ({ ja: "必須", en: "Required" }),
68
70
  warn: "",
69
71
  warnTimeOut: 3000,
70
72
  // ----------------------------------------------------------------------------
@@ -82,6 +84,8 @@ const emit = defineEmits<Emits>();
82
84
 
83
85
  const toast = useHsToast();
84
86
 
87
+ const multiLang = useHsMultiLang();
88
+ const tx = multiLang.tx;
85
89
  // ----------------------------------------------------------------------------
86
90
  const baseClass = computed(() => {
87
91
  return [
@@ -161,9 +165,11 @@ const iconDisabled = computed(() => {
161
165
  return false;
162
166
  });
163
167
  // ----------------------------------------------------------------------------
168
+ const label = computed(() => tx(props.label).value);
169
+ // ----------------------------------------------------------------------------
164
170
  const slots = useSlots();
165
171
  const hasHeader = computed(() => {
166
- if (props.label.length !== 0) return true;
172
+ if (label.value.length !== 0) return true;
167
173
  if (props.require && !props.readonly) return true;
168
174
  // if (slots.label) return true;
169
175
  if (slots["label-prepend"]) return true;
@@ -191,11 +197,10 @@ const hasHeader = computed(() => {
191
197
  >
192
198
  <div
193
199
  class="grow-0 shrink-1 truncate leading-[1.5em]"
194
- :title="props.label"
200
+ :title="label"
195
201
  @click.stop="emit('header-label-click')"
196
202
  >
197
- <slot name="label-prepend" />{{ props.label
198
- }}<slot name="label-append" />
203
+ <slot name="label-prepend" />{{ label }}<slot name="label-append" />
199
204
  </div>
200
205
  <div class="flex-1"></div>
201
206
  <div class="flex-none flex gap-2">
@@ -205,7 +210,7 @@ const hasHeader = computed(() => {
205
210
  :class="headerIconClass"
206
211
  class="text-white bg-error"
207
212
  >
208
- <span data-type="require">{{ props.requireText }}</span>
213
+ <span data-type="require">{{ tx(props.requireText) }}</span>
209
214
  </div>
210
215
  </div>
211
216
  </div>
@@ -14,6 +14,8 @@ import { reactive, ref, watch, computed, useId } from "#imports";
14
14
  import { type ClassType, ClassTypeToString } from "../../utils/class-style";
15
15
  import type { SelectItem } from "../../utils/select-item";
16
16
  import { useDisplayList, type DisplaySelectItem } from "../../utils/select";
17
+ import type { MultiLang } from "../../utils/multi-lang";
18
+
17
19
  // [ composables ]
18
20
  import { useHsFocus } from "../../composables/use-hs-focus";
19
21
  import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
@@ -35,7 +37,7 @@ type Props = {
35
37
  order?: boolean;
36
38
  image?: boolean;
37
39
  loading?: boolean;
38
- nullText?: string;
40
+ nullText?: MultiLang;
39
41
  classCol?: ClassType;
40
42
  classRow?: ClassType;
41
43
  classImg?: ClassType;
@@ -62,10 +64,10 @@ type Props = {
62
64
  readonly?: boolean;
63
65
  // ----------------------------------------------------------------------------
64
66
  // 表示
65
- label?: string;
67
+ label?: MultiLang;
66
68
  // 表示-副情報
67
69
  require?: boolean;
68
- requireText?: string;
70
+ requireText?: MultiLang;
69
71
  warn?: string;
70
72
  warnTimeOut?: number;
71
73
  // ----------------------------------------------------------------------------
@@ -79,7 +81,7 @@ const props = withDefaults(defineProps<Props>(), {
79
81
  order: false,
80
82
  image: false,
81
83
  loading: false,
82
- nullText: "選択してください",
84
+ nullText: () => ({ ja: "選択してください", en: "Select..." }),
83
85
  nullable: false,
84
86
  classCol: "",
85
87
  classRow: "",
@@ -108,7 +110,7 @@ const props = withDefaults(defineProps<Props>(), {
108
110
  label: "",
109
111
  // 表示-副情報
110
112
  require: false,
111
- requireText: "必須",
113
+ requireText: () => ({ ja: "必須", en: "Required" }),
112
114
  warn: "",
113
115
  warnTimeOut: 3000,
114
116
  // ----------------------------------------------------------------------------
@@ -211,7 +213,7 @@ const displayList = computed<SelectItemShow[]>(() => {
211
213
  unKnownSelected: unKnownSelected.value,
212
214
  isShowHidden: isShowHidden.value,
213
215
  require: props.require || !props.nullable,
214
- nullText: props.nullText,
216
+ nullText: tx(props.nullText).value,
215
217
  }).map((row, index) => {
216
218
  return {
217
219
  ...row,
@@ -391,7 +393,7 @@ const inputClass = computed(() => {
391
393
  :readonly="props.readonly"
392
394
  :label="props.label"
393
395
  :require="props.require"
394
- :require-text="props.requireText"
396
+ :require-text="tx(props.requireText).value"
395
397
  :warn="props.warn"
396
398
  :warn-time-out="props.warnTimeOut"
397
399
  :size="props.size"
@@ -455,7 +457,7 @@ const inputClass = computed(() => {
455
457
  :class-img="props.classImg"
456
458
  :class-img-tag="props.classImgTag"
457
459
  />
458
- <div class="radio-text truncate">{{ nullText }}</div>
460
+ <div class="radio-text truncate">{{ tx(nullText) }}</div>
459
461
  </div>
460
462
  </div>
461
463
  </div>
@@ -13,6 +13,7 @@ import { reactive, ref, watch, computed, useId } from "#imports";
13
13
  import type { ClassType } from "../../utils/class-style";
14
14
  import type { SelectItem } from "../../utils/select-item";
15
15
  import { useDisplayList, type DisplaySelectItem } from "../../utils/select";
16
+ import type { MultiLang } from "../../utils/multi-lang";
16
17
  // [ composables ]
17
18
  import { useHsFocus } from "../../composables/use-hs-focus";
18
19
  import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
@@ -34,7 +35,7 @@ type Props = {
34
35
  list: SelectItem<IdType>[];
35
36
  order?: boolean;
36
37
  loading?: boolean;
37
- nullText?: string;
38
+ nullText?: MultiLang;
38
39
  image?: boolean;
39
40
  classImg?: ClassType;
40
41
  classImgTag?: ClassType;
@@ -60,10 +61,10 @@ type Props = {
60
61
  readonly?: boolean;
61
62
  // ----------------------------------------------------------------------------
62
63
  // 表示
63
- label?: string;
64
+ label?: MultiLang;
64
65
  // 表示-副情報
65
66
  require?: boolean;
66
- requireText?: string;
67
+ requireText?: MultiLang;
67
68
  warn?: string;
68
69
  warnTimeOut?: number;
69
70
  // ----------------------------------------------------------------------------
@@ -76,7 +77,7 @@ const props = withDefaults(defineProps<Props>(), {
76
77
  // Input 種類別
77
78
  order: false,
78
79
  loading: false,
79
- nullText: "選択してください",
80
+ nullText: () => ({ ja: "選択してください", en: "Select..." }),
80
81
  nullable: false,
81
82
  image: false,
82
83
  classImg: "",
@@ -104,7 +105,7 @@ const props = withDefaults(defineProps<Props>(), {
104
105
  label: "",
105
106
  // 表示-副情報
106
107
  require: false,
107
- requireText: "必須",
108
+ requireText: () => ({ ja: "必須", en: "Required" }),
108
109
  warn: "",
109
110
  warnTimeOut: 3000,
110
111
  // ----------------------------------------------------------------------------
@@ -200,7 +201,7 @@ const displayList = computed(() => {
200
201
  unKnownSelected: unKnownSelected.value,
201
202
  isShowHidden: isShowHidden.value,
202
203
  require: props.require || !props.nullable,
203
- nullText: props.nullText,
204
+ nullText: tx(props.nullText).value,
204
205
  });
205
206
  });
206
207
  // ----------------------------------------------------------------------------
@@ -290,7 +291,7 @@ const selectClose = () => {
290
291
  :readonly="props.readonly"
291
292
  :label="props.label"
292
293
  :require="props.require"
293
- :require-text="props.requireText"
294
+ :require-text="tx(props.requireText).value"
294
295
  :warn="props.warn"
295
296
  :warn-time-out="props.warnTimeOut"
296
297
  :size="props.size"
@@ -309,7 +310,7 @@ const selectClose = () => {
309
310
  class="absolute inset-0 flex items-center px-1 pointer-events-none text-[0.9em]"
310
311
  :class="[computedActivate ? 'opacity-30' : '']"
311
312
  >
312
- {{ props.nullText }}
313
+ {{ tx(props.nullText) }}
313
314
  </div>
314
315
  <v-select
315
316
  ref="inputElement"
@@ -14,6 +14,7 @@ import { reactive, ref, watch, computed, nextTick, useId } from "#imports";
14
14
 
15
15
  // [ utils ]
16
16
  import type { ClassType } from "../../utils/class-style";
17
+ import type { MultiLang } from "../../utils/multi-lang";
17
18
  // [ composables ]
18
19
  import { useHsFocus } from "../../composables/use-hs-focus";
19
20
  // [ Components ]
@@ -62,10 +63,10 @@ type Props = {
62
63
  readonly?: boolean;
63
64
  // ----------------------------------------------------------------------------
64
65
  // 表示
65
- label?: string;
66
+ label?: MultiLang;
66
67
  // 表示-副情報
67
68
  require?: boolean;
68
- requireText?: string;
69
+ requireText?: MultiLang;
69
70
  warn?: string;
70
71
  warnTimeOut?: number;
71
72
  // ----------------------------------------------------------------------------
@@ -105,7 +106,7 @@ const props = withDefaults(defineProps<Props>(), {
105
106
  label: "",
106
107
  // 表示-副情報
107
108
  require: false,
108
- requireText: "必須",
109
+ requireText: () => ({ ja: "必須", en: "Required" }),
109
110
  warn: "",
110
111
  warnTimeOut: 3000,
111
112
  // ----------------------------------------------------------------------------
@@ -12,9 +12,11 @@ import { twMerge } from "tailwind-merge";
12
12
  import { reactive, ref, watch, computed, useId, nextTick } from "#imports";
13
13
  // [ utils ]
14
14
  import type { ClassType } from "../../utils/class-style";
15
+ import type { MultiLang } from "../../utils/multi-lang";
15
16
  // [ composables ]
16
17
  import { useHsFocus } from "../../composables/use-hs-focus";
17
18
  import { useHsMisc } from "../../composables/use-hs-misc";
19
+ import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
18
20
  // [ Components ]
19
21
  import InputFrame from "./input-frame.vue";
20
22
  // ----------------------------------------------------------------------------
@@ -49,10 +51,10 @@ type Props = {
49
51
  readonly?: boolean;
50
52
  // ----------------------------------------------------------------------------
51
53
  // 表示
52
- label?: string;
54
+ label?: MultiLang;
53
55
  // 表示-副情報
54
56
  require?: boolean;
55
- requireText?: string;
57
+ requireText?: MultiLang;
56
58
  warn?: string;
57
59
  warnTimeOut?: number;
58
60
  // ----------------------------------------------------------------------------
@@ -60,7 +62,7 @@ type Props = {
60
62
  size?: "s" | "m" | "l";
61
63
  // ----------------------------------------------------------------------------
62
64
  uiText?: {
63
- rowsUnit: string;
65
+ rowsUnit: MultiLang;
64
66
  };
65
67
  };
66
68
  const props = withDefaults(defineProps<Props>(), {
@@ -92,17 +94,16 @@ const props = withDefaults(defineProps<Props>(), {
92
94
  label: "",
93
95
  // 表示-副情報
94
96
  require: false,
95
- requireText: "必須",
97
+ requireText: () => ({ ja: "必須", en: "Required" }),
96
98
  warn: "",
97
99
  warnTimeOut: 3000,
98
100
  // ----------------------------------------------------------------------------
99
101
  // 設定
100
102
  size: "m",
101
-
102
103
  // ----------------------------------------------------------------------------
103
104
  uiText: () => {
104
105
  return {
105
- rowsUnit: "行",
106
+ rowsUnit: { ja: "行", en: "Rows" },
106
107
  };
107
108
  },
108
109
  });
@@ -122,7 +123,12 @@ type Emits = {
122
123
  };
123
124
  const emit = defineEmits<Emits>();
124
125
  // ----------------------------------------------------------------------------
126
+
127
+ const multiLang = useHsMultiLang();
128
+ const tx = multiLang.tx;
129
+
125
130
  // [ getCurrentInstance ]
131
+
126
132
  const uid = useId();
127
133
  // ----------------------------------------------------------------------------
128
134
 
@@ -372,7 +378,7 @@ const textAreaClass = computed(() => {
372
378
  </div>
373
379
  <div v-if="props.maxRows !== 0" :class="[defaultClass, rowLabelClass]">
374
380
  {{ state.value.split("\n").length }} / {{ props.maxRows }}
375
- {{ props.uiText.rowsUnit }}
381
+ {{ tx(props.uiText.rowsUnit) }}
376
382
  </div>
377
383
  </template>
378
384
  <div
@@ -22,10 +22,12 @@ import {
22
22
  import type { ClassType } from "../../utils/class-style";
23
23
  import { InsertComma } from "../../utils/number";
24
24
  import { FloatNullable } from "../../utils/float";
25
+ import type { MultiLang } from "../../utils/multi-lang";
25
26
  // [ composables ]
26
27
  import { useHsFocus } from "../../composables/use-hs-focus";
27
28
  import { useHsToast } from "../../composables/use-hs-toast";
28
29
  import { useHsMisc } from "../../composables/use-hs-misc";
30
+ import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
29
31
  // [ Components ]
30
32
  import InputFrame from "./input-frame.vue";
31
33
  // ----------------------------------------------------------------------------
@@ -35,6 +37,9 @@ import InputFrame from "./input-frame.vue";
35
37
  const hsFocus = useHsFocus();
36
38
  const hsMisc = useHsMisc();
37
39
  const Toast = useHsToast();
40
+ const multiLang = useHsMultiLang();
41
+ const gt = multiLang.gt;
42
+
38
43
  // ----------------------------------------------------------------------------
39
44
  // [ Props ]
40
45
  type Props = {
@@ -70,10 +75,10 @@ type Props = {
70
75
  readonly?: boolean;
71
76
  // ----------------------------------------------------------------------------
72
77
  // 表示
73
- label?: string;
78
+ label?: MultiLang;
74
79
  // 表示-副情報
75
80
  require?: boolean;
76
- requireText?: string;
81
+ requireText?: MultiLang;
77
82
  warn?: string;
78
83
  warnTimeOut?: number;
79
84
  // ----------------------------------------------------------------------------
@@ -82,10 +87,10 @@ type Props = {
82
87
  // ----------------------------------------------------------------------------
83
88
  uiText?: {
84
89
  validError: {
85
- title: string;
86
- nullValue: string;
87
- minValue: string;
88
- maxValue: string;
90
+ title: MultiLang;
91
+ nullValue: MultiLang;
92
+ minValue: MultiLang;
93
+ maxValue: MultiLang;
89
94
  };
90
95
  };
91
96
  };
@@ -125,7 +130,7 @@ const props = withDefaults(defineProps<Props>(), {
125
130
  label: "",
126
131
  // 表示-副情報
127
132
  require: false,
128
- requireText: "必須",
133
+ requireText: () => ({ ja: "必須", en: "Required" }),
129
134
  warn: "",
130
135
  warnTimeOut: 3000,
131
136
  // ----------------------------------------------------------------------------
@@ -135,10 +140,19 @@ const props = withDefaults(defineProps<Props>(), {
135
140
  uiText: () => {
136
141
  return {
137
142
  validError: {
138
- title: "入力値の警告",
139
- nullValue: "数値以外は許可されていません。",
140
- minValue: "[{value}]以下の数値は入力できません",
141
- maxValue: "[{value}]以上の数値は入力できません",
143
+ title: { ja: "入力値の警告", en: "Input Value Warning" },
144
+ nullValue: {
145
+ ja: "数値以外は許可されていません。",
146
+ en: "Non-numeric values are not allowed.",
147
+ },
148
+ minValue: {
149
+ ja: "[{value}]以下の数値は入力できません",
150
+ en: "You cannot enter a number below {value}.",
151
+ },
152
+ maxValue: {
153
+ ja: "[{value}]以上の数値は入力できません",
154
+ en: "You cannot enter a number greater than {value}.",
155
+ },
142
156
  },
143
157
  };
144
158
  },
@@ -211,7 +225,7 @@ const validCheck = (
211
225
  return {
212
226
  result: false,
213
227
  value: 0,
214
- message: props.uiText.validError.nullValue,
228
+ message: gt(props.uiText.validError.nullValue),
215
229
  };
216
230
  } else {
217
231
  return { result: true, value: null, message: "" };
@@ -221,7 +235,7 @@ const validCheck = (
221
235
  return {
222
236
  result: false,
223
237
  value: props.min,
224
- message: props.uiText.validError.minValue.replace(
238
+ message: gt(props.uiText.validError.minValue).replace(
225
239
  /\{value\}/g,
226
240
  String(props.min)
227
241
  ),
@@ -231,7 +245,7 @@ const validCheck = (
231
245
  return {
232
246
  result: false,
233
247
  value: props.max,
234
- message: props.uiText.validError.maxValue.replace(
248
+ message: gt(props.uiText.validError.maxValue).replace(
235
249
  /\{value\}/g,
236
250
  String(props.min)
237
251
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-hs-ui",
3
- "version": "2.6.0",
3
+ "version": "2.8.0",
4
4
  "description": "My new Nuxt module",
5
5
  "repository": "https://github.com/hare-systems-ryo/nuxt-hs-ui",
6
6
  "license": "MIT",