nuxt-hs-ui 2.9.4 → 2.9.5

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.9.4",
7
+ "version": "2.9.5",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -338,7 +338,7 @@ const selectClose = () => {
338
338
  <!-- -->
339
339
  <!-- -->
340
340
  <template #selected-option="{ text, imgUrl, deleted, appendIcon }">
341
- <div class="flex items-baseline w-full">
341
+ <div class="flex items-baseline w-full max-w-full min-w-0">
342
342
  <SelectImgIcon
343
343
  v-if="imgUrl && props.image"
344
344
  class="flex-none"
@@ -347,19 +347,26 @@ const selectClose = () => {
347
347
  :class-img="props.classImg"
348
348
  :class-img-tag="props.classImgTag"
349
349
  />
350
- <div class="flex-1 truncate">{{ tx(text) }}</div>
350
+ <div class="flex-1 truncate min-w-0">{{ tx(text) }}</div>
351
351
  <div v-if="deleted" class="text-error text-[0.7em] leading-[1em]">
352
352
  {{ tx({ ja: "削除済", en: "Deleted" }) }}
353
353
  </div>
354
354
  <!-- <div v-if="hidden" class="text-error text-[0.7em] leading-[1em]">
355
355
  {{ tx({ ja: "非表示", en: "Hidden" }) }}
356
356
  </div> -->
357
- <span v-if="appendIcon && typeof appendIcon === 'string'">
357
+ <div
358
+ v-if="appendIcon && typeof appendIcon === 'string'"
359
+ class="flex-none"
360
+ >
358
361
  <i :class="appendIcon"></i>
359
- </span>
360
- <span v-else-if="appendIcon && Array.isArray(appendIcon)">
362
+ </div>
363
+
364
+ <div
365
+ v-else-if="appendIcon && Array.isArray(appendIcon)"
366
+ class="flex-none"
367
+ >
361
368
  <i v-for="(c, i) in appendIcon" :key="i" :class="c"></i>
362
- </span>
369
+ </div>
363
370
  </div>
364
371
  </template>
365
372
  <template #option="{ text, imgUrl, deleted, hidden, appendIcon }">
@@ -438,6 +445,7 @@ const selectClose = () => {
438
445
  .v-select .vs__selected,
439
446
  .v-select .vs__selected-options {
440
447
  max-width: 100%;
448
+ min-width: 0;
441
449
  }
442
450
  .v-select .vs__search {
443
451
  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="props.rows"
401
+ :rows="_rows"
394
402
  :disabled="props.disabled || props.readonly"
395
403
  :tabindex="tabindex"
396
404
  @blur="onBlur()"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-hs-ui",
3
- "version": "2.9.4",
3
+ "version": "2.9.5",
4
4
  "description": "My new Nuxt module",
5
5
  "repository": "https://github.com/hare-systems-ryo/nuxt-hs-ui",
6
6
  "license": "MIT",