@v1nt1248/3nclient-lib 0.1.26 → 0.1.28
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-radio-group/types.d.ts +1 -1
- package/dist/components/ui3n-radio-group/ui3n-radio-group.vue.d.ts +0 -1
- package/dist/style.css +1 -1
- package/dist/ui3n-components.js +5457 -5447
- package/dist/ui3n-plugins.js +2057 -2049
- package/dist/variables.css +40 -0
- package/package.json +1 -1
- package/src/components/ui3n-badge/ui3n-badge-simple.vue +6 -6
- package/src/components/ui3n-badge/ui3n-badge.vue +6 -6
- package/src/components/ui3n-breadcrumbs/ui3n-breadcrumb.vue +17 -7
- package/src/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue +2 -2
- package/src/components/ui3n-button/ui3n-button.vue +30 -15
- package/src/components/ui3n-checkbox/ui3n-checkbox.vue +29 -10
- package/src/components/ui3n-chip/ui3n-chip.vue +19 -15
- package/src/components/ui3n-dialog/ui3n-dialog.vue +10 -10
- package/src/components/ui3n-drop-files/ui3n-drop-files.vue +17 -17
- package/src/components/ui3n-emoji/ui3n-emoji.vue +2 -2
- package/src/components/ui3n-input/ui3n-input.vue +73 -54
- package/src/components/ui3n-list/ui3n-list.vue +15 -15
- package/src/components/ui3n-menu/ui3n-menu.vue +7 -7
- package/src/components/ui3n-notification/ui3n-notification.vue +32 -23
- package/src/components/ui3n-progress/ui3n-progress-circular.vue +2 -2
- package/src/components/ui3n-progress/ui3n-progress-linear.vue +2 -2
- package/src/components/ui3n-radio-group/types.ts +1 -1
- package/src/components/ui3n-radio-group/ui3n-radio-group.vue +4 -5
- package/src/components/ui3n-radio-group/ui3n-radio.vue +3 -3
- package/src/components/ui3n-step-line-bar/ui3n-step-line-bar.vue +2 -2
- package/src/components/ui3n-switch/ui3n-switch.vue +2 -2
- package/src/components/ui3n-table/ui3n-table.vue +2 -2
- package/src/components/ui3n-tabs/ui3n-tabs.vue +2 -2
- package/src/components/ui3n-text/ui3n-text.vue +2 -2
- package/src/components/ui3n-tooltip/ui3n-tooltip.vue +2 -2
- package/src/components/ui3n-virtual-scroll/ui3n-virtual-scroll.vue +2 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { onMounted, ref } from 'vue';
|
|
3
3
|
import type { Ui3nDropFilesEmits, Ui3nDropFilesProps, Ui3nDropFilesSlots } from './types';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
withDefaults(
|
|
6
6
|
defineProps<Ui3nDropFilesProps>(),
|
|
7
7
|
{
|
|
8
8
|
title: 'Upload',
|
|
@@ -67,7 +67,7 @@ const onDrop = (ev: DragEvent) => {
|
|
|
67
67
|
<!-- eslint-disable max-len -->
|
|
68
68
|
<div
|
|
69
69
|
ref="wrapperElement"
|
|
70
|
-
:class="$style.
|
|
70
|
+
:class="$style.ui3nDropFiles"
|
|
71
71
|
@dragenter="onDragenter"
|
|
72
72
|
@dragleave="onDragleave"
|
|
73
73
|
>
|
|
@@ -75,17 +75,17 @@ const onDrop = (ev: DragEvent) => {
|
|
|
75
75
|
|
|
76
76
|
<div
|
|
77
77
|
v-if="isOverDropPlace || isOverDropZone"
|
|
78
|
-
:class="$style.
|
|
78
|
+
:class="$style.ui3nDropFilesDropzone"
|
|
79
79
|
@dragenter="onDropzoneDragenter"
|
|
80
80
|
@dragover="onDropzoneDragover"
|
|
81
81
|
@dragleave="onDropzoneDragleave"
|
|
82
82
|
@drop="onDrop"
|
|
83
83
|
>
|
|
84
|
-
<div :class="$style.
|
|
85
|
-
<h3 :class="$style.
|
|
84
|
+
<div :class="$style.ui3nDropFilesDropzoneBorder" />
|
|
85
|
+
<h3 :class="$style.ui3nDropFilesDropzoneTitle">
|
|
86
86
|
{{ title }}
|
|
87
87
|
</h3>
|
|
88
|
-
<div :class="$style.
|
|
88
|
+
<div :class="$style.ui3nDropFilesDropzoneIcon">
|
|
89
89
|
<svg
|
|
90
90
|
:width="wrapperElementHeight / 2"
|
|
91
91
|
:height="wrapperElementHeight / 2"
|
|
@@ -99,18 +99,18 @@ const onDrop = (ev: DragEvent) => {
|
|
|
99
99
|
/>
|
|
100
100
|
</svg>
|
|
101
101
|
</div>
|
|
102
|
-
<div v-if="
|
|
103
|
-
{{
|
|
102
|
+
<div v-if="text" :class="$style.ui3nDropFilesDropzoneText">
|
|
103
|
+
{{ text }}
|
|
104
104
|
</div>
|
|
105
|
-
<div v-if="
|
|
106
|
-
{{
|
|
105
|
+
<div v-if="additionalText" :class="$style.ui3nDropFilesDropzoneText">
|
|
106
|
+
{{ additionalText }}
|
|
107
107
|
</div>
|
|
108
108
|
</div>
|
|
109
109
|
</div>
|
|
110
110
|
</template>
|
|
111
111
|
|
|
112
112
|
<style lang="scss" module>
|
|
113
|
-
.
|
|
113
|
+
.ui3nDropFiles {
|
|
114
114
|
--dropzone-height: 0;
|
|
115
115
|
--dropzone-title-font: 0;
|
|
116
116
|
|
|
@@ -120,7 +120,7 @@ const onDrop = (ev: DragEvent) => {
|
|
|
120
120
|
height: 100%;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
.
|
|
123
|
+
.ui3nDropFilesDropzone {
|
|
124
124
|
box-sizing: border-box;
|
|
125
125
|
position: absolute;
|
|
126
126
|
background-color: var(--white-0);
|
|
@@ -133,7 +133,7 @@ const onDrop = (ev: DragEvent) => {
|
|
|
133
133
|
z-index: 5;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.
|
|
136
|
+
.ui3nDropFilesDropzoneBorder {
|
|
137
137
|
box-sizing: border-box;
|
|
138
138
|
position: absolute;
|
|
139
139
|
top: calc(var(--spacing-s) + 1px);
|
|
@@ -145,7 +145,7 @@ const onDrop = (ev: DragEvent) => {
|
|
|
145
145
|
pointer-events: none;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
.
|
|
148
|
+
.ui3nDropFilesDropzoneTitle {
|
|
149
149
|
margin: 0 0 var(--dropzone-title-font);
|
|
150
150
|
font-size: var(--dropzone-title-font);
|
|
151
151
|
font-weight: 600;
|
|
@@ -153,7 +153,7 @@ const onDrop = (ev: DragEvent) => {
|
|
|
153
153
|
pointer-events: none;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
.
|
|
156
|
+
.ui3nDropFilesDropzoneIcon {
|
|
157
157
|
position: relative;
|
|
158
158
|
width: calc(var(--dropzone-height) * 0.4);
|
|
159
159
|
height: calc(var(--dropzone-height) * 0.4);
|
|
@@ -165,7 +165,7 @@ const onDrop = (ev: DragEvent) => {
|
|
|
165
165
|
pointer-events: none;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
.
|
|
168
|
+
.ui3nDropFilesDropzoneText {
|
|
169
169
|
margin-top: var(--spacing-ml);
|
|
170
170
|
font-size: var(--font-12);
|
|
171
171
|
line-height: var(--font-16);
|
|
@@ -173,7 +173,7 @@ const onDrop = (ev: DragEvent) => {
|
|
|
173
173
|
color: var(--fill-pressed);
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
.
|
|
176
|
+
.ui3nDropFilesDropzoneAdditional {
|
|
177
177
|
margin-top: var(--spacing-xs);
|
|
178
178
|
font-size: var(--font-12);
|
|
179
179
|
font-weight: 500;
|
|
@@ -49,7 +49,7 @@ const onClick = (ev: Event) => {
|
|
|
49
49
|
<template>
|
|
50
50
|
<div
|
|
51
51
|
ref="emojiElement"
|
|
52
|
-
:class="[$style.
|
|
52
|
+
:class="[$style.Ui3nEmoji, readonly && $style.readonly]"
|
|
53
53
|
v-on="readonly ? {} : { 'click': onClick }"
|
|
54
54
|
>
|
|
55
55
|
{{ emojiData && emojiData.value }}
|
|
@@ -57,7 +57,7 @@ const onClick = (ev: Event) => {
|
|
|
57
57
|
</template>
|
|
58
58
|
|
|
59
59
|
<style lang="scss" module>
|
|
60
|
-
.
|
|
60
|
+
.Ui3nEmoji {
|
|
61
61
|
--ui3n-emoji-size: 16px;
|
|
62
62
|
|
|
63
63
|
display: flex;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
import { computed, onMounted, ref, watch } from 'vue';
|
|
3
|
+
import { computed, onMounted, ref, watch, useCssModule } from 'vue';
|
|
4
4
|
import Ui3nIcon from '../ui3n-icon/ui3n-icon.vue';
|
|
5
5
|
import Ui3nButton from '../ui3n-button/ui3n-button.vue';
|
|
6
6
|
import type { Ui3nInputEmits, Ui3nInputProps } from './types';
|
|
@@ -8,6 +8,8 @@ import type { Ui3nInputEmits, Ui3nInputProps } from './types';
|
|
|
8
8
|
const props = defineProps<Ui3nInputProps>();
|
|
9
9
|
const emits = defineEmits<Ui3nInputEmits>();
|
|
10
10
|
|
|
11
|
+
const $css = useCssModule();
|
|
12
|
+
|
|
11
13
|
const inputElement = ref<HTMLInputElement | null>(null);
|
|
12
14
|
const text = ref<string>('');
|
|
13
15
|
const isFocused = ref(false);
|
|
@@ -20,6 +22,7 @@ const cssIconColor = computed(() => {
|
|
|
20
22
|
|
|
21
23
|
return props.iconColor || 'var(--color-icon-control-primary-default)';
|
|
22
24
|
});
|
|
25
|
+
|
|
23
26
|
const isValid = computed(() => {
|
|
24
27
|
if (!text.value) {
|
|
25
28
|
return true;
|
|
@@ -28,28 +31,33 @@ const isValid = computed(() => {
|
|
|
28
31
|
return !errorMessage.value;
|
|
29
32
|
});
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
const mainCssClasses = computed(() => {
|
|
35
|
+
const val = [$css.ui3nInput];
|
|
36
|
+
props.label && val.push($css.withLabel);
|
|
37
|
+
props.icon && val.push($css.withIcon);
|
|
38
|
+
props.clearable && text.value && val.push($css.clearable);
|
|
39
|
+
props.disabled && val.push($css.disabled);
|
|
40
|
+
(!!errorMessage.value || props.displayStateMode === 'error') && val.push($css.error);
|
|
41
|
+
props.displayStateMode === 'success' && val.push($css.success);
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
return val;
|
|
37
44
|
});
|
|
38
45
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
text.value = val;
|
|
43
|
-
validate(text.value);
|
|
44
|
-
},
|
|
45
|
-
{ immediate: true },
|
|
46
|
-
);
|
|
46
|
+
const iconCssClasses = computed(() => {
|
|
47
|
+
const val = [$css.ui3nInputIcon];
|
|
48
|
+
props.disabled && val.push($css.ui3nInputIconDisabled);
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
return val;
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const messageCssClasses = computed(() => {
|
|
54
|
+
const val = [$css.ui3nInputFieldMessage];
|
|
55
|
+
(errorMessage.value || (props.displayStateMode === 'error' && !!props.displayStateMessage))
|
|
56
|
+
&& val.push($css.ui3nInputErrorMessage);
|
|
57
|
+
props.displayStateMode === 'success' && props.displayStateMessage && val.push($css.ui3nInputSuccessMessage);
|
|
58
|
+
|
|
59
|
+
return val;
|
|
60
|
+
});
|
|
53
61
|
|
|
54
62
|
function onFocus(event: Event) {
|
|
55
63
|
isFocused.value = true;
|
|
@@ -114,22 +122,37 @@ function validate(text: string) {
|
|
|
114
122
|
}
|
|
115
123
|
}
|
|
116
124
|
}
|
|
125
|
+
|
|
126
|
+
onMounted(() => {
|
|
127
|
+
if (props.autofocus && inputElement.value) {
|
|
128
|
+
inputElement.value.focus();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
emits('init', inputElement.value!);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
watch(
|
|
135
|
+
() => props.modelValue,
|
|
136
|
+
val => {
|
|
137
|
+
text.value = val;
|
|
138
|
+
validate(text.value);
|
|
139
|
+
},
|
|
140
|
+
{ immediate: true },
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
watch(
|
|
144
|
+
() => isValid.value,
|
|
145
|
+
val => emits('update:valid', val),
|
|
146
|
+
{ immediate: true },
|
|
147
|
+
);
|
|
117
148
|
</script>
|
|
118
149
|
|
|
119
150
|
<template>
|
|
120
151
|
<div
|
|
121
152
|
ref="wrapperElement"
|
|
122
|
-
:class="
|
|
123
|
-
$style.input,
|
|
124
|
-
label && $style.withLabel,
|
|
125
|
-
icon && $style.withIcon,
|
|
126
|
-
clearable && text && $style.clearable,
|
|
127
|
-
disabled && $style.disabled,
|
|
128
|
-
(!!errorMessage || (displayStateMode === 'error')) && $style.error,
|
|
129
|
-
displayStateMode === 'success' && $style.success,
|
|
130
|
-
]"
|
|
153
|
+
:class="mainCssClasses"
|
|
131
154
|
>
|
|
132
|
-
<label v-if="label" :class="$style.
|
|
155
|
+
<label v-if="label" :class="$style.ui3nInputLabel">
|
|
133
156
|
{{ label }}
|
|
134
157
|
</label>
|
|
135
158
|
|
|
@@ -140,7 +163,7 @@ function validate(text: string) {
|
|
|
140
163
|
:value="text"
|
|
141
164
|
:placeholder="placeholder"
|
|
142
165
|
:disabled="disabled"
|
|
143
|
-
:class="$style.
|
|
166
|
+
:class="$style.ui3nInputField"
|
|
144
167
|
@input="onInput"
|
|
145
168
|
@keydown.enter="onEnterKeydown"
|
|
146
169
|
@keydown.escape="onEscapeKeydown"
|
|
@@ -154,7 +177,7 @@ function validate(text: string) {
|
|
|
154
177
|
:icon="icon"
|
|
155
178
|
:width="16"
|
|
156
179
|
:height="16"
|
|
157
|
-
:class="
|
|
180
|
+
:class="iconCssClasses"
|
|
158
181
|
/>
|
|
159
182
|
|
|
160
183
|
<ui3n-icon
|
|
@@ -163,7 +186,7 @@ function validate(text: string) {
|
|
|
163
186
|
:width="16"
|
|
164
187
|
:height="16"
|
|
165
188
|
color="var(--success-content-default)"
|
|
166
|
-
:class="$style.
|
|
189
|
+
:class="$style.ui3nInputSuccessIcon"
|
|
167
190
|
/>
|
|
168
191
|
|
|
169
192
|
<ui3n-button
|
|
@@ -180,11 +203,7 @@ function validate(text: string) {
|
|
|
180
203
|
|
|
181
204
|
<div
|
|
182
205
|
v-if="errorMessage || displayStateMessage"
|
|
183
|
-
:class="
|
|
184
|
-
$style.fieldMessage,
|
|
185
|
-
(errorMessage || (displayStateMode === 'error' && !!displayStateMessage)) && $style.errorMessage,
|
|
186
|
-
displayStateMode === 'success' && displayStateMessage && $style.successMessage,
|
|
187
|
-
]"
|
|
206
|
+
:class="messageCssClasses"
|
|
188
207
|
>
|
|
189
208
|
{{ errorMessage || displayStateMessage }}
|
|
190
209
|
</div>
|
|
@@ -194,7 +213,7 @@ function validate(text: string) {
|
|
|
194
213
|
<style lang="scss" module>
|
|
195
214
|
@import "../../assets/styles/mixins";
|
|
196
215
|
|
|
197
|
-
.
|
|
216
|
+
.ui3nInput {
|
|
198
217
|
--ui3n-input-height: var(--spacing-l);
|
|
199
218
|
--ui3n-input-padding-left: var(--spacing-s);
|
|
200
219
|
--ui3n-input-padding-right: var(--spacing-s);
|
|
@@ -205,7 +224,7 @@ function validate(text: string) {
|
|
|
205
224
|
border-radius: var(--spacing-xs);
|
|
206
225
|
|
|
207
226
|
&:hover {
|
|
208
|
-
.
|
|
227
|
+
.ui3nInputField:not(:focus-within) {
|
|
209
228
|
background-color: var(--color-bg-control-secondary-hover);
|
|
210
229
|
|
|
211
230
|
&::placeholder {
|
|
@@ -215,18 +234,18 @@ function validate(text: string) {
|
|
|
215
234
|
}
|
|
216
235
|
|
|
217
236
|
&:focus-within {
|
|
218
|
-
.
|
|
237
|
+
.ui3nInputField {
|
|
219
238
|
background-color: var(--color-bg-control-secondary-focused);
|
|
220
239
|
outline: 1px solid var(--color-border-control-accent-focused);
|
|
221
240
|
}
|
|
222
241
|
|
|
223
|
-
.
|
|
242
|
+
.ui3nInputIcon {
|
|
224
243
|
color: v-bind(cssIconColor) !important;
|
|
225
244
|
}
|
|
226
245
|
}
|
|
227
246
|
}
|
|
228
247
|
|
|
229
|
-
.
|
|
248
|
+
.ui3nInputLabel {
|
|
230
249
|
display: block;
|
|
231
250
|
width: 100%;
|
|
232
251
|
font-size: var(--font-12);
|
|
@@ -236,7 +255,7 @@ function validate(text: string) {
|
|
|
236
255
|
margin-bottom: var(--spacing-xs);
|
|
237
256
|
}
|
|
238
257
|
|
|
239
|
-
.
|
|
258
|
+
.ui3nInputField {
|
|
240
259
|
display: block;
|
|
241
260
|
box-sizing: border-box;
|
|
242
261
|
width: 100%;
|
|
@@ -267,14 +286,14 @@ function validate(text: string) {
|
|
|
267
286
|
}
|
|
268
287
|
}
|
|
269
288
|
|
|
270
|
-
.
|
|
289
|
+
.ui3nInputIcon {
|
|
271
290
|
position: absolute;
|
|
272
291
|
left: var(--half-size, 4px);
|
|
273
292
|
top: calc((var(--ui3n-input-height) - 16px) / 2);
|
|
274
293
|
color: var(--color-icon-control-secondary-default) !important;
|
|
275
294
|
}
|
|
276
295
|
|
|
277
|
-
.
|
|
296
|
+
.ui3nInputIconDisabled {
|
|
278
297
|
color: v-bind(cssIconColor) !important;
|
|
279
298
|
}
|
|
280
299
|
|
|
@@ -285,18 +304,18 @@ function validate(text: string) {
|
|
|
285
304
|
z-index: 2;
|
|
286
305
|
}
|
|
287
306
|
|
|
288
|
-
.
|
|
307
|
+
.ui3nInputFieldMessage {
|
|
289
308
|
font-style: italic;
|
|
290
309
|
font-size: var(--font-10);
|
|
291
310
|
font-weight: 400;
|
|
292
311
|
line-height: 1.4;
|
|
293
312
|
margin-top: 2px;
|
|
294
313
|
|
|
295
|
-
&.
|
|
314
|
+
&.ui3nInputErrorMessage {
|
|
296
315
|
color: var(--error-content-default);
|
|
297
316
|
}
|
|
298
317
|
|
|
299
|
-
&.
|
|
318
|
+
&.ui3nInputSuccessMessage {
|
|
300
319
|
color: var(--success-content-default)
|
|
301
320
|
}
|
|
302
321
|
}
|
|
@@ -310,22 +329,22 @@ function validate(text: string) {
|
|
|
310
329
|
}
|
|
311
330
|
|
|
312
331
|
.error {
|
|
313
|
-
.
|
|
332
|
+
.ui3nInputLabel {
|
|
314
333
|
color: var(--error-content-default) !important;
|
|
315
334
|
}
|
|
316
335
|
|
|
317
|
-
.
|
|
336
|
+
.ui3nInputField {
|
|
318
337
|
outline: 1px solid var(--error-content-default) !important;
|
|
319
338
|
}
|
|
320
339
|
}
|
|
321
340
|
|
|
322
341
|
.success {
|
|
323
|
-
.
|
|
342
|
+
.ui3nInputLabel {
|
|
324
343
|
color: var(--success-content-default) !important;
|
|
325
344
|
}
|
|
326
345
|
}
|
|
327
346
|
|
|
328
|
-
.
|
|
347
|
+
.ui3nInputSuccessIcon {
|
|
329
348
|
position: absolute;
|
|
330
349
|
right: var(--spacing-s);
|
|
331
350
|
bottom: var(--spacing-s);
|
|
@@ -337,11 +356,11 @@ function validate(text: string) {
|
|
|
337
356
|
}
|
|
338
357
|
|
|
339
358
|
.withLabel {
|
|
340
|
-
.
|
|
359
|
+
.ui3nInputIcon {
|
|
341
360
|
top: calc((var(--ui3n-input-height) - 16px) / 2 + 20px);
|
|
342
361
|
}
|
|
343
362
|
|
|
344
|
-
.
|
|
363
|
+
.ui3nInputSuccessIcon {
|
|
345
364
|
bottom: auto;
|
|
346
365
|
top: calc((var(--ui3n-input-height) - 16px) / 2 + 20px);
|
|
347
366
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup generic="T extends { id?: string }">
|
|
2
2
|
import type { Ui3nListEmits, Ui3nListProps, Ui3nListSlots } from './types';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
withDefaults(defineProps<Ui3nListProps<T>>(), {
|
|
5
5
|
title: '',
|
|
6
6
|
sticky: true,
|
|
7
7
|
disabled: false,
|
|
@@ -12,16 +12,16 @@ defineSlots<Ui3nListSlots<T>>();
|
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<template>
|
|
15
|
-
<div ref="listElement" :class="$style.
|
|
16
|
-
<div :class="[$style.
|
|
15
|
+
<div ref="listElement" :class="$style.ui3nList">
|
|
16
|
+
<div :class="[$style.ui3nListTitle, sticky && $style.ui3nListTitleSticky]">
|
|
17
17
|
<slot name="title">
|
|
18
|
-
<div v-if="
|
|
18
|
+
<div v-if="title" :class="$style.ui3nListTitleContent">
|
|
19
19
|
{{ title }}
|
|
20
20
|
</div>
|
|
21
21
|
</slot>
|
|
22
22
|
</div>
|
|
23
23
|
|
|
24
|
-
<div :class="$style.
|
|
24
|
+
<div :class="$style.ui3nListContent">
|
|
25
25
|
<div
|
|
26
26
|
v-for="(item, index) in items"
|
|
27
27
|
:key="item.id ?? index"
|
|
@@ -29,7 +29,7 @@ defineSlots<Ui3nListSlots<T>>();
|
|
|
29
29
|
>
|
|
30
30
|
<slot name="item" :item="item" :index="index">
|
|
31
31
|
<div
|
|
32
|
-
:class="[$style.
|
|
32
|
+
:class="[$style.ui3nListItemContent, disabled && $style.ui3nListItemContentDisabled]"
|
|
33
33
|
@click.stop="emits('select', { value: item, index })"
|
|
34
34
|
>
|
|
35
35
|
{{ item }}
|
|
@@ -41,7 +41,7 @@ defineSlots<Ui3nListSlots<T>>();
|
|
|
41
41
|
</template>
|
|
42
42
|
|
|
43
43
|
<style lang="scss" module>
|
|
44
|
-
.
|
|
44
|
+
.ui3nList {
|
|
45
45
|
--ui3n-list-item-height: 28px;
|
|
46
46
|
--ui3n-list-bg-color: transparent;
|
|
47
47
|
|
|
@@ -55,23 +55,23 @@ defineSlots<Ui3nListSlots<T>>();
|
|
|
55
55
|
align-items: stretch;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
.
|
|
58
|
+
.ui3nListTitle {
|
|
59
59
|
position: relative;
|
|
60
60
|
top: 0;
|
|
61
61
|
z-index: 1;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
.
|
|
64
|
+
.ui3nListTitleSticky {
|
|
65
65
|
position: sticky;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
.
|
|
68
|
+
.ui3nListContent {
|
|
69
69
|
position: relative;
|
|
70
70
|
flex-grow: 1;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
.
|
|
74
|
-
.
|
|
73
|
+
.ui3nListTitleContent,
|
|
74
|
+
.ui3nListItem {
|
|
75
75
|
position: relative;
|
|
76
76
|
width: 100%;
|
|
77
77
|
min-height: var(--ui3n-list-item-height);
|
|
@@ -81,20 +81,20 @@ defineSlots<Ui3nListSlots<T>>();
|
|
|
81
81
|
align-items: center;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
.
|
|
84
|
+
.ui3nListTitleContent {
|
|
85
85
|
z-index: 1;
|
|
86
86
|
font-size: 16px;
|
|
87
87
|
font-weight: 600;
|
|
88
88
|
background-color: var(--ui3n-list-bg-color);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
.
|
|
91
|
+
.ui3nListItemContent {
|
|
92
92
|
font-size: 14px;
|
|
93
93
|
font-weight: 400;
|
|
94
94
|
cursor: pointer;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
.
|
|
97
|
+
.ui3nListItemContentDisabled {
|
|
98
98
|
pointer-events: none;
|
|
99
99
|
cursor: default;
|
|
100
100
|
}
|
|
@@ -69,10 +69,10 @@ watch(
|
|
|
69
69
|
</script>
|
|
70
70
|
|
|
71
71
|
<template>
|
|
72
|
-
<div ref="menuElement" :class="$style.
|
|
72
|
+
<div ref="menuElement" :class="$style.ui3nMenu">
|
|
73
73
|
<div
|
|
74
74
|
ref="menuTriggerElement"
|
|
75
|
-
:class="$style.
|
|
75
|
+
:class="$style.ui3nMenuTrigger"
|
|
76
76
|
@click.stop="toggleMenu"
|
|
77
77
|
>
|
|
78
78
|
<slot />
|
|
@@ -83,8 +83,8 @@ watch(
|
|
|
83
83
|
ref="menuContentElement"
|
|
84
84
|
v-click-outside="onClickOutside"
|
|
85
85
|
:style="floatingStyles"
|
|
86
|
-
:class="$style.
|
|
87
|
-
v-on="
|
|
86
|
+
:class="$style.ui3nMenuContent"
|
|
87
|
+
v-on="closeOnClick ? { click: onContentClick } : {}"
|
|
88
88
|
>
|
|
89
89
|
<slot name="menu" />
|
|
90
90
|
</div>
|
|
@@ -94,7 +94,7 @@ watch(
|
|
|
94
94
|
<style lang="scss" module>
|
|
95
95
|
@import "../../assets/styles/mixins";
|
|
96
96
|
|
|
97
|
-
.
|
|
97
|
+
.ui3nMenu {
|
|
98
98
|
--ui3n-menu-content-bg: var(--color-bg-control-secondary-default);
|
|
99
99
|
|
|
100
100
|
position: relative;
|
|
@@ -102,12 +102,12 @@ watch(
|
|
|
102
102
|
overflow: visible;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
.
|
|
105
|
+
.ui3nMenuTrigger {
|
|
106
106
|
position: relative;
|
|
107
107
|
max-width: max-content;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
.
|
|
110
|
+
.ui3nMenuContent {
|
|
111
111
|
position: absolute;
|
|
112
112
|
border-radius: 4px;
|
|
113
113
|
background-color: var(--ui3n-menu-content-bg);
|