@v1nt1248/3nclient-lib 0.1.81 → 0.1.82
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 +2 -0
- package/dist/components/ui3n-menu/ui3n-menu.vue.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/ui3n-components.js +2074 -2061
- package/package.json +1 -1
- package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +16 -9
- package/src/components/ui3n-menu/types.ts +2 -0
- package/src/components/ui3n-menu/ui3n-menu.vue +18 -4
package/package.json
CHANGED
|
@@ -244,12 +244,19 @@
|
|
|
244
244
|
|
|
245
245
|
<template>
|
|
246
246
|
<div :class="$style.ui3nAutocomplete">
|
|
247
|
-
<ui3n-menu
|
|
247
|
+
<ui3n-menu
|
|
248
|
+
v-model="isMenuOpen"
|
|
249
|
+
:offset-x="2"
|
|
250
|
+
:offset-y="4"
|
|
251
|
+
:content-border-radius="[0, 0, 8, 8]"
|
|
252
|
+
:disabled="disabled"
|
|
253
|
+
>
|
|
248
254
|
<div ref="activatorEl" :class="$style.trigger">
|
|
249
255
|
<template v-if="chips">
|
|
250
256
|
<template v-for="(item, index) in modelValue" :key="item.id">
|
|
251
257
|
<slot name="chip" :item="item" :index="index">
|
|
252
258
|
<ui3n-chip
|
|
259
|
+
height="32"
|
|
253
260
|
round
|
|
254
261
|
closeable
|
|
255
262
|
@close="onChipClose(item)"
|
|
@@ -315,7 +322,7 @@
|
|
|
315
322
|
|
|
316
323
|
<style lang="scss" module>
|
|
317
324
|
.ui3nAutocomplete {
|
|
318
|
-
--autocomplete-min-height: var(--spacing-
|
|
325
|
+
--autocomplete-min-height: var(--spacing-l);
|
|
319
326
|
|
|
320
327
|
position: relative;
|
|
321
328
|
width: 100%;
|
|
@@ -349,7 +356,7 @@
|
|
|
349
356
|
flex-grow: 1;
|
|
350
357
|
height: var(--autocomplete-min-height);
|
|
351
358
|
font-size: var(--font-12);
|
|
352
|
-
line-height: var(--
|
|
359
|
+
line-height: var(--autocomplete-min-height);
|
|
353
360
|
font-weight: 400;
|
|
354
361
|
color: var(--color-text-control-primary-default);
|
|
355
362
|
background-color: transparent;
|
|
@@ -362,19 +369,19 @@
|
|
|
362
369
|
|
|
363
370
|
&:hover,
|
|
364
371
|
&:focus {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
&:not(.inputWithError) {
|
|
368
|
-
border: 1px solid var(--color-border-control-accent-focused);
|
|
369
|
-
}
|
|
372
|
+
background-color: var(--color-bg-control-secondary-default);
|
|
373
|
+
}
|
|
370
374
|
|
|
375
|
+
&.inputWithError {
|
|
376
|
+
height: calc(var(--autocomplete-min-height) - 2px);
|
|
377
|
+
padding: 0 calc(var(--spacing-s) - 1px);
|
|
371
378
|
border: 1px solid var(--error-content-default);
|
|
372
379
|
}
|
|
373
380
|
}
|
|
374
381
|
|
|
375
382
|
.body {
|
|
376
383
|
position: relative;
|
|
377
|
-
background-color: var(--color-bg-
|
|
384
|
+
background-color: var(--color-bg-block-primary-default);
|
|
378
385
|
padding: var(--spacing-xs);
|
|
379
386
|
}
|
|
380
387
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { ref, watch } from 'vue';
|
|
2
|
+
import { computed, ref, watch } from 'vue';
|
|
3
3
|
import { autoUpdate, flip, useFloating, offset, shift } from '@floating-ui/vue';
|
|
4
4
|
import { default as vClickOutside } from '../../directives/ui3n-click-outside';
|
|
5
5
|
import type { Ui3nMenuEmits, Ui3nMenuProps, Ui3nMenuSlots } from './types';
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
positionStrategy: 'absolute',
|
|
9
9
|
offsetX: 0,
|
|
10
10
|
offsetY: 0,
|
|
11
|
+
contentBorderRadius: 4,
|
|
12
|
+
zIndex: 1000,
|
|
11
13
|
closeOnClick: true,
|
|
12
14
|
closeOnClickOutside: true,
|
|
13
15
|
disabled: false,
|
|
@@ -20,6 +22,16 @@
|
|
|
20
22
|
const menuContentElement = ref<HTMLDivElement | null>(null);
|
|
21
23
|
const isShow = ref(false);
|
|
22
24
|
|
|
25
|
+
const contentBorderRadiusCss = computed(() => {
|
|
26
|
+
if (typeof props.contentBorderRadius === 'number') {
|
|
27
|
+
return `${props.contentBorderRadius}px`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const [tl, tr, br, bl] = props.contentBorderRadius;
|
|
31
|
+
return `${tl}px ${tr}px ${br}px ${bl}px`;
|
|
32
|
+
});
|
|
33
|
+
const zIndexCss = computed(() => props.zIndex);
|
|
34
|
+
|
|
23
35
|
const { floatingStyles, isPositioned } = useFloating(
|
|
24
36
|
menuTriggerElement,
|
|
25
37
|
menuContentElement,
|
|
@@ -112,6 +124,7 @@
|
|
|
112
124
|
|
|
113
125
|
.ui3nMenu {
|
|
114
126
|
--ui3n-menu-content-bg: var(--color-bg-control-secondary-default);
|
|
127
|
+
--ui3n-menu-content-border-raduis: v-bind(contentBorderRadiusCss);
|
|
115
128
|
|
|
116
129
|
position: relative;
|
|
117
130
|
max-width: max-content;
|
|
@@ -130,9 +143,10 @@
|
|
|
130
143
|
|
|
131
144
|
.ui3nMenuContent {
|
|
132
145
|
position: absolute;
|
|
133
|
-
border-radius:
|
|
146
|
+
border-radius: var(--ui3n-menu-content-border-raduis);
|
|
134
147
|
background-color: var(--ui3n-menu-content-bg);
|
|
135
|
-
z-index:
|
|
136
|
-
|
|
148
|
+
z-index: v-bind(zIndexCss);
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
@include mixins.dropShadow();
|
|
137
151
|
}
|
|
138
152
|
</style>
|