nuxt-hs-ui 2.9.4 → 2.9.6
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
|
@@ -26,6 +26,7 @@ import Btn from "../form/btn.vue";
|
|
|
26
26
|
const hsFocus = useHsFocus();
|
|
27
27
|
const multiLang = useHsMultiLang();
|
|
28
28
|
const tx = multiLang.tx;
|
|
29
|
+
const gt = multiLang.gt;
|
|
29
30
|
|
|
30
31
|
// ----------------------------------------------------------------------------
|
|
31
32
|
// [ Props ]
|
|
@@ -197,7 +198,9 @@ const includeHidden = computed(() => {
|
|
|
197
198
|
/** 選択肢 */
|
|
198
199
|
const displayList = computed(() => {
|
|
199
200
|
return useDisplayList<IdType>({
|
|
200
|
-
list: props.list
|
|
201
|
+
list: props.list.map((row) => {
|
|
202
|
+
return { ...row, text: gt(row.text) };
|
|
203
|
+
}),
|
|
201
204
|
id: props.data,
|
|
202
205
|
order: props.order,
|
|
203
206
|
unKnownData: unKnownData.value,
|
|
@@ -338,7 +341,7 @@ const selectClose = () => {
|
|
|
338
341
|
<!-- -->
|
|
339
342
|
<!-- -->
|
|
340
343
|
<template #selected-option="{ text, imgUrl, deleted, appendIcon }">
|
|
341
|
-
<div class="flex items-baseline w-full">
|
|
344
|
+
<div class="flex items-baseline w-full max-w-full min-w-0">
|
|
342
345
|
<SelectImgIcon
|
|
343
346
|
v-if="imgUrl && props.image"
|
|
344
347
|
class="flex-none"
|
|
@@ -347,19 +350,26 @@ const selectClose = () => {
|
|
|
347
350
|
:class-img="props.classImg"
|
|
348
351
|
:class-img-tag="props.classImgTag"
|
|
349
352
|
/>
|
|
350
|
-
<div class="flex-1 truncate">{{
|
|
353
|
+
<div class="flex-1 truncate min-w-0">{{ text }}</div>
|
|
351
354
|
<div v-if="deleted" class="text-error text-[0.7em] leading-[1em]">
|
|
352
355
|
{{ tx({ ja: "削除済", en: "Deleted" }) }}
|
|
353
356
|
</div>
|
|
354
357
|
<!-- <div v-if="hidden" class="text-error text-[0.7em] leading-[1em]">
|
|
355
358
|
{{ tx({ ja: "非表示", en: "Hidden" }) }}
|
|
356
359
|
</div> -->
|
|
357
|
-
<
|
|
360
|
+
<div
|
|
361
|
+
v-if="appendIcon && typeof appendIcon === 'string'"
|
|
362
|
+
class="flex-none"
|
|
363
|
+
>
|
|
358
364
|
<i :class="appendIcon"></i>
|
|
359
|
-
</
|
|
360
|
-
|
|
365
|
+
</div>
|
|
366
|
+
|
|
367
|
+
<div
|
|
368
|
+
v-else-if="appendIcon && Array.isArray(appendIcon)"
|
|
369
|
+
class="flex-none"
|
|
370
|
+
>
|
|
361
371
|
<i v-for="(c, i) in appendIcon" :key="i" :class="c"></i>
|
|
362
|
-
</
|
|
372
|
+
</div>
|
|
363
373
|
</div>
|
|
364
374
|
</template>
|
|
365
375
|
<template #option="{ text, imgUrl, deleted, hidden, appendIcon }">
|
|
@@ -371,7 +381,7 @@ const selectClose = () => {
|
|
|
371
381
|
:class-img="props.classImg"
|
|
372
382
|
:class-img-tag="props.classImgTag"
|
|
373
383
|
/>
|
|
374
|
-
<div class="flex-1 truncate">{{
|
|
384
|
+
<div class="flex-1 truncate">{{ text }}</div>
|
|
375
385
|
<div v-if="deleted" class="text-error text-[0.7em] leading-[1em]">
|
|
376
386
|
{{ tx({ ja: "削除済", en: "Deleted" }) }}
|
|
377
387
|
</div>
|
|
@@ -438,6 +448,7 @@ const selectClose = () => {
|
|
|
438
448
|
.v-select .vs__selected,
|
|
439
449
|
.v-select .vs__selected-options {
|
|
440
450
|
max-width: 100%;
|
|
451
|
+
min-width: 0;
|
|
441
452
|
}
|
|
442
453
|
.v-select .vs__search {
|
|
443
454
|
margin: 0 !important;
|
|
@@ -30,6 +30,7 @@ type Props = {
|
|
|
30
30
|
rows?: number;
|
|
31
31
|
maxRows?: number;
|
|
32
32
|
maxLen?: number;
|
|
33
|
+
autosize?: boolean;
|
|
33
34
|
// ----------------------------------------------------------------------------
|
|
34
35
|
data: string | null;
|
|
35
36
|
diff?: string | null | undefined;
|
|
@@ -71,6 +72,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
71
72
|
rows: 5,
|
|
72
73
|
maxRows: 0,
|
|
73
74
|
maxLen: 0,
|
|
75
|
+
autosize: false,
|
|
74
76
|
// ----------------------------------------------------------------------------
|
|
75
77
|
diff: undefined,
|
|
76
78
|
tabindex: undefined,
|
|
@@ -139,6 +141,7 @@ interface State {
|
|
|
139
141
|
const state = reactive<State>({
|
|
140
142
|
value: "",
|
|
141
143
|
});
|
|
144
|
+
|
|
142
145
|
// ----------------------------------------------------------------------------
|
|
143
146
|
watch(
|
|
144
147
|
() => props.data,
|
|
@@ -342,6 +345,11 @@ const textAreaClass = computed(() => {
|
|
|
342
345
|
),
|
|
343
346
|
];
|
|
344
347
|
});
|
|
348
|
+
|
|
349
|
+
const _rows = computed(() => {
|
|
350
|
+
if (!props.autosize) return props.rows;
|
|
351
|
+
return Math.max(state.value.split("\n").length, props.rows);
|
|
352
|
+
});
|
|
345
353
|
</script>
|
|
346
354
|
|
|
347
355
|
<template>
|
|
@@ -390,7 +398,7 @@ const textAreaClass = computed(() => {
|
|
|
390
398
|
v-model="state.value"
|
|
391
399
|
type="text"
|
|
392
400
|
:class="textAreaClass"
|
|
393
|
-
:rows="
|
|
401
|
+
:rows="_rows"
|
|
394
402
|
:disabled="props.disabled || props.readonly"
|
|
395
403
|
:tabindex="tabindex"
|
|
396
404
|
@blur="onBlur()"
|