nuxt-hs-ui 2.7.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 +1 -1
- package/dist/runtime/components/form/check-box.vue +10 -4
- package/dist/runtime/components/form/check-list.vue +1 -1
- package/dist/runtime/components/form/datepicker.vue +8 -5
- package/dist/runtime/components/form/input-frame.vue +6 -5
- package/dist/runtime/components/form/radio.vue +1 -1
- package/dist/runtime/components/form/select.vue +1 -1
- package/dist/runtime/components/form/text-box.vue +1 -1
- package/dist/runtime/components/form/textarea.vue +10 -5
- package/dist/runtime/components/form/value-box.vue +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -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?:
|
|
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:
|
|
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
|
|
@@ -107,7 +107,7 @@ type Props = {
|
|
|
107
107
|
readonly?: boolean;
|
|
108
108
|
// ----------------------------------------------------------------------------
|
|
109
109
|
// 表示
|
|
110
|
-
label?:
|
|
110
|
+
label?: MultiLang;
|
|
111
111
|
// 表示-副情報
|
|
112
112
|
require?: boolean;
|
|
113
113
|
requireText?: MultiLang;
|
|
@@ -119,8 +119,8 @@ type Props = {
|
|
|
119
119
|
// ----------------------------------------------------------------------------
|
|
120
120
|
uiText?: {
|
|
121
121
|
error: {
|
|
122
|
-
inputRangeTitle:
|
|
123
|
-
inputRangeMessage:
|
|
122
|
+
inputRangeTitle: MultiLang;
|
|
123
|
+
inputRangeMessage: MultiLang;
|
|
124
124
|
};
|
|
125
125
|
};
|
|
126
126
|
};
|
|
@@ -170,8 +170,11 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
170
170
|
uiText: () => {
|
|
171
171
|
return {
|
|
172
172
|
error: {
|
|
173
|
-
inputRangeTitle: "
|
|
174
|
-
inputRangeMessage:
|
|
173
|
+
inputRangeTitle: { ja: "入力値の警告", en: "Input Value Warning" },
|
|
174
|
+
inputRangeMessage: {
|
|
175
|
+
ja: "入力範囲外です",
|
|
176
|
+
en: "Input is out of range",
|
|
177
|
+
},
|
|
175
178
|
},
|
|
176
179
|
};
|
|
177
180
|
},
|
|
@@ -36,7 +36,7 @@ type Props = {
|
|
|
36
36
|
// ----------------------------------------------------------------------------
|
|
37
37
|
|
|
38
38
|
// 表示
|
|
39
|
-
label?:
|
|
39
|
+
label?: MultiLang;
|
|
40
40
|
// 表示-副情報
|
|
41
41
|
require?: boolean;
|
|
42
42
|
requireText?: MultiLang;
|
|
@@ -165,9 +165,11 @@ const iconDisabled = computed(() => {
|
|
|
165
165
|
return false;
|
|
166
166
|
});
|
|
167
167
|
// ----------------------------------------------------------------------------
|
|
168
|
+
const label = computed(() => tx(props.label).value);
|
|
169
|
+
// ----------------------------------------------------------------------------
|
|
168
170
|
const slots = useSlots();
|
|
169
171
|
const hasHeader = computed(() => {
|
|
170
|
-
if (
|
|
172
|
+
if (label.value.length !== 0) return true;
|
|
171
173
|
if (props.require && !props.readonly) return true;
|
|
172
174
|
// if (slots.label) return true;
|
|
173
175
|
if (slots["label-prepend"]) return true;
|
|
@@ -195,11 +197,10 @@ const hasHeader = computed(() => {
|
|
|
195
197
|
>
|
|
196
198
|
<div
|
|
197
199
|
class="grow-0 shrink-1 truncate leading-[1.5em]"
|
|
198
|
-
:title="
|
|
200
|
+
:title="label"
|
|
199
201
|
@click.stop="emit('header-label-click')"
|
|
200
202
|
>
|
|
201
|
-
<slot name="label-prepend" />{{
|
|
202
|
-
}}<slot name="label-append" />
|
|
203
|
+
<slot name="label-prepend" />{{ label }}<slot name="label-append" />
|
|
203
204
|
</div>
|
|
204
205
|
<div class="flex-1"></div>
|
|
205
206
|
<div class="flex-none flex gap-2">
|
|
@@ -16,6 +16,7 @@ import type { MultiLang } from "../../utils/multi-lang";
|
|
|
16
16
|
// [ composables ]
|
|
17
17
|
import { useHsFocus } from "../../composables/use-hs-focus";
|
|
18
18
|
import { useHsMisc } from "../../composables/use-hs-misc";
|
|
19
|
+
import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
|
|
19
20
|
// [ Components ]
|
|
20
21
|
import InputFrame from "./input-frame.vue";
|
|
21
22
|
// ----------------------------------------------------------------------------
|
|
@@ -50,7 +51,7 @@ type Props = {
|
|
|
50
51
|
readonly?: boolean;
|
|
51
52
|
// ----------------------------------------------------------------------------
|
|
52
53
|
// 表示
|
|
53
|
-
label?:
|
|
54
|
+
label?: MultiLang;
|
|
54
55
|
// 表示-副情報
|
|
55
56
|
require?: boolean;
|
|
56
57
|
requireText?: MultiLang;
|
|
@@ -61,7 +62,7 @@ type Props = {
|
|
|
61
62
|
size?: "s" | "m" | "l";
|
|
62
63
|
// ----------------------------------------------------------------------------
|
|
63
64
|
uiText?: {
|
|
64
|
-
rowsUnit:
|
|
65
|
+
rowsUnit: MultiLang;
|
|
65
66
|
};
|
|
66
67
|
};
|
|
67
68
|
const props = withDefaults(defineProps<Props>(), {
|
|
@@ -99,11 +100,10 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
99
100
|
// ----------------------------------------------------------------------------
|
|
100
101
|
// 設定
|
|
101
102
|
size: "m",
|
|
102
|
-
|
|
103
103
|
// ----------------------------------------------------------------------------
|
|
104
104
|
uiText: () => {
|
|
105
105
|
return {
|
|
106
|
-
rowsUnit: "行",
|
|
106
|
+
rowsUnit: { ja: "行", en: "Rows" },
|
|
107
107
|
};
|
|
108
108
|
},
|
|
109
109
|
});
|
|
@@ -123,7 +123,12 @@ type Emits = {
|
|
|
123
123
|
};
|
|
124
124
|
const emit = defineEmits<Emits>();
|
|
125
125
|
// ----------------------------------------------------------------------------
|
|
126
|
+
|
|
127
|
+
const multiLang = useHsMultiLang();
|
|
128
|
+
const tx = multiLang.tx;
|
|
129
|
+
|
|
126
130
|
// [ getCurrentInstance ]
|
|
131
|
+
|
|
127
132
|
const uid = useId();
|
|
128
133
|
// ----------------------------------------------------------------------------
|
|
129
134
|
|
|
@@ -373,7 +378,7 @@ const textAreaClass = computed(() => {
|
|
|
373
378
|
</div>
|
|
374
379
|
<div v-if="props.maxRows !== 0" :class="[defaultClass, rowLabelClass]">
|
|
375
380
|
{{ state.value.split("\n").length }} / {{ props.maxRows }}
|
|
376
|
-
{{ props.uiText.rowsUnit }}
|
|
381
|
+
{{ tx(props.uiText.rowsUnit) }}
|
|
377
382
|
</div>
|
|
378
383
|
</template>
|
|
379
384
|
<div
|