nuxt-hs-ui 2.11.3 → 2.11.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.11.3",
7
+ "version": "2.11.5",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -9,7 +9,15 @@
9
9
  // [ tailwind ]
10
10
  import { twMerge } from "tailwind-merge";
11
11
  // [ NUXT ]
12
- import { reactive, ref, watch, computed, useId, nextTick } from "#imports";
12
+ import {
13
+ reactive,
14
+ ref,
15
+ watch,
16
+ computed,
17
+ useId,
18
+ nextTick,
19
+ type Ref,
20
+ } from "#imports";
13
21
  // [ utils ]
14
22
  import { type ClassType, ClassTypeToString } from "../../utils/class-style";
15
23
  import type { SelectItem } from "../../utils/select-item";
@@ -210,7 +218,30 @@ interface SelectItemShow extends DisplaySelectItem<IdType> {
210
218
  activate: boolean;
211
219
  i: number;
212
220
  }
213
- const displayList = ref<SelectItemShow[]>([]);
221
+ const displayList: Ref<SelectItemShow[]> = ref([]);
222
+
223
+ const setDisplayList = () => {
224
+ // console.log("setDisplayList");
225
+ displayList.value = useDisplayList<IdType>({
226
+ list: ObjectCopy(props.list).map((row) => {
227
+ return { ...row, text: gt(row.text) };
228
+ }),
229
+ id: props.data,
230
+ order: props.order,
231
+ unKnownData: unKnownData.value,
232
+ unKnownSelected: unKnownSelected.value,
233
+ isShowHidden: isShowHidden.value,
234
+ require: props.require || !props.nullable,
235
+ nullText: tx(props.nullText).value,
236
+ }).map((row, index) => {
237
+ return {
238
+ ...row,
239
+ elm: null,
240
+ activate: false,
241
+ i: index,
242
+ };
243
+ }) as SelectItemShow[];
244
+ };
214
245
 
215
246
  watch(
216
247
  () => [
@@ -223,48 +254,12 @@ watch(
223
254
  props.nullText,
224
255
  ],
225
256
  () => {
226
- displayList.value = useDisplayList<IdType>({
227
- list: ObjectCopy(props.list).map((row) => {
228
- return { ...row, text: gt(row.text) };
229
- }),
230
- id: props.data,
231
- order: props.order,
232
- unKnownData: unKnownData.value,
233
- unKnownSelected: unKnownSelected.value,
234
- isShowHidden: isShowHidden.value,
235
- require: props.require || !props.nullable,
236
- nullText: tx(props.nullText).value,
237
- }).map((row, index) => {
238
- return {
239
- ...row,
240
- elm: null,
241
- activate: false,
242
- i: index,
243
- };
244
- }) as SelectItemShow[];
257
+ nextTick(() => {
258
+ setDisplayList();
259
+ });
245
260
  },
246
261
  { immediate: true }
247
262
  );
248
-
249
- // const displayList = computed<SelectItemShow[]>(() => {
250
- // return useDisplayList<IdType>({
251
- // list: props.list,
252
- // id: props.data,
253
- // order: props.order,
254
- // unKnownData: unKnownData.value,
255
- // unKnownSelected: unKnownSelected.value,
256
- // isShowHidden: isShowHidden.value,
257
- // require: props.require || !props.nullable,
258
- // nullText: tx(props.nullText).value,
259
- // }).map((row, index) => {
260
- // return {
261
- // ...row,
262
- // elm: null,
263
- // activate: false,
264
- // i: index,
265
- // };
266
- // });
267
- // });
268
263
  // ----------------------------------------------------------------------------
269
264
 
270
265
  const checkData = (id: IdType | null) => {
@@ -395,6 +390,7 @@ const onKeyup = (event: KeyboardEvent) => {
395
390
  const setValue = async (row: SelectItemShow | null) => {
396
391
  if (props.disabled) return;
397
392
  if (props.readonly) return;
393
+ // console.log(row);
398
394
  displayData.value = row;
399
395
  };
400
396
 
@@ -518,7 +514,7 @@ const inputClass = computed(() => {
518
514
  :class="colClass"
519
515
  @mousedown="onMousedownItem"
520
516
  @mouseup="onMouseupItem(row.elm)"
521
- @click="setValue(row as SelectItemShow)"
517
+ @click="setValue(row)"
522
518
  >
523
519
  <div
524
520
  class="nac-radio"
@@ -416,7 +416,10 @@ const inputElement = ref<HTMLElement | null>(null);
416
416
  <!-- -->
417
417
  <!-- -->
418
418
  <template #selected-option="{ text, imgUrl, deleted, appendIcon }">
419
- <div class="flex items-baseline w-full max-w-full min-w-0">
419
+ <div
420
+ class="flex items-baseline w-full max-w-full min-w-0"
421
+ :class="loading ? 'opacity-0' : ''"
422
+ >
420
423
  <SelectImgIcon
421
424
  v-if="imgUrl && props.image"
422
425
  class="flex-none"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-hs-ui",
3
- "version": "2.11.3",
3
+ "version": "2.11.5",
4
4
  "description": "My new Nuxt module",
5
5
  "repository": "https://github.com/hare-systems-ryo/nuxt-hs-ui",
6
6
  "license": "MIT",