its_ui_vite 1.1.8 → 1.1.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "its_ui_vite",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "main": "./src/libIndex.js",
5
5
  "module": "./src/libIndex.js",
6
6
  "files": [
@@ -75,7 +75,7 @@
75
75
  />
76
76
  </component>
77
77
  </button>
78
- <div v-if="foundOptions.length < 1" :class="[classes.option, 'not-found']">
78
+ <div v-if="isNotFound" :class="[classes.option, 'not-found']">
79
79
  <span class="c-input2-select__list_item-text">
80
80
  {{ text.notFound }}
81
81
  </span>
@@ -267,6 +267,11 @@ const foundOptions = computed(() => {
267
267
  return findGroup;
268
268
  });
269
269
 
270
+ const isNotFound = computed(() => {
271
+ if (!foundOptions.value[0].options) return true;
272
+ return foundOptions.value.length < 2 && foundOptions.value[0]!.options?.length < 1
273
+ });
274
+
270
275
  watch(() => props.modelValue, (options: any[]) => {
271
276
  activeOptions.value.clear();
272
277
  oldActiveOptions.value.clear();
@@ -56,6 +56,7 @@ const scrollRail = ref<null | HTMLDivElement>(null);
56
56
 
57
57
  let observer: MutationObserver;
58
58
  let lockThumbDrag = ref<boolean>(true);
59
+ let isShow = ref<boolean>(false);
59
60
  let mousePosition: number = 0;
60
61
 
61
62
  onMounted(() => {
@@ -82,15 +83,6 @@ onUnmounted(() => {
82
83
  document.body.removeEventListener('mouseup', removeDragThumb);
83
84
  });
84
85
 
85
- const isShow = computed(() => {
86
- if (!root.value && !content.value) return false;
87
-
88
- const rootHeight = root.value!.offsetHeight || 0;
89
- const contentHeight = content.value!.offsetHeight || 0;
90
-
91
- return rootHeight < contentHeight;
92
- });
93
-
94
86
  function handleWheel(step: number) {
95
87
  if (!isShow.value) return;
96
88
 
@@ -111,10 +103,12 @@ function handleWheel(step: number) {
111
103
  }
112
104
 
113
105
  function handleContent() {
106
+ const rootHeight = root.value!.offsetHeight || 0;
107
+ const contentHeight = content.value!.offsetHeight || 0;
108
+
109
+ isShow.value = rootHeight < contentHeight;
114
110
  if (!isShow.value) return;
115
111
 
116
- const rootHeight = root.value?.offsetHeight || 1;
117
- const contentHeight = content.value?.offsetHeight || 1;
118
112
  const scrollRailHeight = scrollRail.value?.offsetHeight || 1;
119
113
 
120
114
  scrollStyle.value.thumbHeight = scrollRailHeight / (contentHeight / rootHeight);