@v1nt1248/3nclient-lib 0.1.82 → 0.1.84
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/components/ui3n-menu/types.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/ui3n-components.js +2308 -2299
- package/package.json +1 -1
- package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +18 -5
- package/src/components/ui3n-chip/ui3n-chip.vue +13 -3
- package/src/components/ui3n-menu/types.ts +1 -0
- package/src/components/ui3n-menu/ui3n-menu.vue +1 -1
package/package.json
CHANGED
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
|
|
78
78
|
return props.returnObject
|
|
79
79
|
? !(ids.value as string[]).includes(item.id as string)
|
|
80
|
-
: !(ids.value as Array<T[keyof T]>).includes(item
|
|
80
|
+
: !(ids.value as Array<T[keyof T]>).includes(item[props.itemValue]);
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
|
|
89
89
|
return props.returnObject
|
|
90
90
|
? !(ids.value as string[]).includes(item.id as string)
|
|
91
|
-
: !(ids.value as Array<T[keyof T]>).includes(item
|
|
91
|
+
: !(ids.value as Array<T[keyof T]>).includes(item[props.itemValue]);
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
94
|
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
isNewValueValid.value = !props.newValueValidator ? true : props.newValueValidator(query.value);
|
|
188
188
|
emits('valid:new-value', isNewValueValid.value);
|
|
189
189
|
if (isNewValueValid.value) {
|
|
190
|
-
const item =
|
|
190
|
+
const item = {
|
|
191
191
|
id: getRandomId(6),
|
|
192
192
|
[props.itemTitle]: query.value,
|
|
193
193
|
[props.itemValue]: query.value,
|
|
@@ -248,6 +248,7 @@
|
|
|
248
248
|
v-model="isMenuOpen"
|
|
249
249
|
:offset-x="2"
|
|
250
250
|
:offset-y="4"
|
|
251
|
+
position-autoupdate
|
|
251
252
|
:content-border-radius="[0, 0, 8, 8]"
|
|
252
253
|
:disabled="disabled"
|
|
253
254
|
>
|
|
@@ -290,7 +291,11 @@
|
|
|
290
291
|
</div>
|
|
291
292
|
|
|
292
293
|
<template #menu>
|
|
293
|
-
<div
|
|
294
|
+
<div
|
|
295
|
+
v-if="!isEmpty(filteredItems) || (isEmpty(filteredItems) && noDataText)"
|
|
296
|
+
ref="menuBodyEl"
|
|
297
|
+
:class="$style.body"
|
|
298
|
+
>
|
|
294
299
|
<template v-if="size(filteredItems)">
|
|
295
300
|
<template v-for="(item, index) in filteredItems" :key="item.id">
|
|
296
301
|
<div
|
|
@@ -303,7 +308,10 @@
|
|
|
303
308
|
@click.stop.prevent="onItemClick(item)"
|
|
304
309
|
>
|
|
305
310
|
<slot name="item" :item="item" :index="index" :query="query">
|
|
306
|
-
<
|
|
311
|
+
<div
|
|
312
|
+
v-ui3n-html="markSearch(item[props.itemTitle] as string, query)"
|
|
313
|
+
:class="$style.simpleItem"
|
|
314
|
+
/>
|
|
307
315
|
</slot>
|
|
308
316
|
</div>
|
|
309
317
|
</template>
|
|
@@ -411,6 +419,11 @@
|
|
|
411
419
|
}
|
|
412
420
|
}
|
|
413
421
|
|
|
422
|
+
.simpleItem {
|
|
423
|
+
position: relative;
|
|
424
|
+
width: max-content;
|
|
425
|
+
}
|
|
426
|
+
|
|
414
427
|
.noData {
|
|
415
428
|
display: flex;
|
|
416
429
|
min-height: var(--spacing-l);
|
|
@@ -24,14 +24,24 @@ const slots = useSlots();
|
|
|
24
24
|
const $css = useCssModule();
|
|
25
25
|
|
|
26
26
|
const height = computed(() => `${props.height}px`);
|
|
27
|
-
const iconHeight = computed(() =>
|
|
28
|
-
|
|
27
|
+
const iconHeight = computed(() => Number(props.height) - 4);
|
|
28
|
+
|
|
29
29
|
const maxWidth = computed(() => `${props.maxWidth}px`);
|
|
30
30
|
const bgColor = computed(() => props.color);
|
|
31
31
|
const textSize = computed(() => `${props.textSize}px`);
|
|
32
32
|
const textColor = computed(() => props.textColor);
|
|
33
33
|
const hasLeftSlot = computed(() => !!slots.left);
|
|
34
34
|
|
|
35
|
+
const padding = computed(() => {
|
|
36
|
+
const padValue = Math.round(Number(props.height) / 3);
|
|
37
|
+
|
|
38
|
+
if (hasLeftSlot.value) {
|
|
39
|
+
return `0 ${padValue}px 0 4px`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return `0 ${padValue}px`;
|
|
43
|
+
});
|
|
44
|
+
|
|
35
45
|
const mainCssClasses = computed(() => {
|
|
36
46
|
const val = [$css.ui3nChip];
|
|
37
47
|
|
|
@@ -76,7 +86,7 @@ function onClick() {
|
|
|
76
86
|
position: relative;
|
|
77
87
|
display: flex;
|
|
78
88
|
height: v-bind('height');
|
|
79
|
-
padding:
|
|
89
|
+
padding: v-bind('padding');
|
|
80
90
|
width: max-content;
|
|
81
91
|
max-width: v-bind('maxWidth');
|
|
82
92
|
background-color: v-bind('bgColor');
|