@v1nt1248/3nclient-lib 0.2.33 → 0.2.35
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/README.md +5 -0
- package/dist/components/ui3n-dialog/types.d.ts +1 -1
- package/dist/components/ui3n-editable/types.d.ts +1 -1
- package/dist/components/ui3n-editable/ui3n-editable.vue.d.ts +1 -1
- package/dist/components/ui3n-editable/useContentEditable.d.ts +1 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/useDblClickHandler.d.ts +3 -0
- package/dist/directives/index.d.ts +2 -1
- package/dist/directives/ui3n-long-press.d.ts +27 -0
- package/dist/index.d.ts +3 -2
- package/dist/style.css +1 -1
- package/dist/types/directives.types.d.ts +7 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/ui3n-components.d.ts +4 -1
- package/dist/ui3n-components.js +4879 -4810
- package/dist/ui3n-plugins.d.ts +1 -2
- package/dist/ui3n-plugins.js +2 -2
- package/dist/ui3n-utils.js +154 -144
- package/dist/utils/files/create-video-thumbnail.d.ts +1 -1
- package/dist/utils/for-vue/try-on-scope-dispose.d.ts +2 -0
- package/dist/utils/for-vue/unref-element.d.ts +2 -0
- package/dist/utils/index.d.ts +3 -1
- package/package.json +18 -13
- package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +32 -9
- package/src/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue +14 -14
- package/src/components/ui3n-button/ui3n-button.vue +229 -226
- package/src/components/ui3n-checkbox/ui3n-checkbox.vue +30 -7
- package/src/components/ui3n-chip/ui3n-chip.vue +113 -109
- package/src/components/ui3n-dialog/types.ts +1 -1
- package/src/components/ui3n-dialog/ui3n-dialog.vue +7 -8
- package/src/components/ui3n-editable/types.ts +1 -1
- package/src/components/ui3n-editable/ui3n-editable.vue +34 -12
- package/src/components/ui3n-editable/useContentEditable.ts +6 -3
- package/src/components/ui3n-icon/ui3n-icon.vue +1 -1
- package/src/components/ui3n-input/ui3n-input.vue +272 -273
- package/src/components/ui3n-input-file/ui3n-input-file.vue +2 -2
- package/src/components/ui3n-list/ui3n-list.vue +70 -60
- package/src/components/ui3n-menu/ui3n-menu.vue +1 -1
- package/src/components/ui3n-notification/ui3n-notification.vue +4 -1
- package/src/components/ui3n-progress/ui3n-progress-circular.vue +168 -147
- package/src/components/ui3n-progress/ui3n-progress-linear.vue +77 -73
- package/src/components/ui3n-radio-group/ui3n-radio.vue +178 -177
- package/src/components/ui3n-step-line-bar/ui3n-step-line-bar.vue +50 -46
- package/src/components/ui3n-switch/ui3n-switch.vue +114 -116
- package/src/components/ui3n-table/composables/useTable.ts +17 -9
- package/src/components/ui3n-table/ui3n-table-sort-icon.vue +9 -6
- package/src/components/ui3n-table/ui3n-table.vue +7 -5
- package/src/components/ui3n-text/ui3n-text.vue +157 -215
- package/src/components/ui3n-tooltip/ui3n-tooltip.vue +4 -5
- package/src/components/types/index.ts +0 -15
- /package/dist/{components/types/index.d.ts → types/components.types.d.ts} +0 -0
- /package/dist/{plugins/types.d.ts → types/plugins.types.d.ts} +0 -0
- /package/dist/utils/{for-we3n.d.ts → for-web3n.d.ts} +0 -0
|
@@ -1,101 +1,105 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, onMounted, ref, watch } from 'vue';
|
|
3
|
-
import { patchTextareaMaxRowsSupport } from '@/utils';
|
|
4
|
-
import type { Ui3nTextEmits, Ui3nTextProps } from './types';
|
|
5
|
-
|
|
6
|
-
const props = withDefaults(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
);
|
|
16
|
-
const emit = defineEmits<Ui3nTextEmits>();
|
|
17
|
-
|
|
18
|
-
const textareaElement = ref<HTMLTextAreaElement | null>(null);
|
|
19
|
-
const isFocused = ref(false);
|
|
20
|
-
const errorMessage = ref('');
|
|
21
|
-
|
|
22
|
-
const isValid = computed(() => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return !errorMessage.value;
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
onMounted(() => {
|
|
31
|
-
if (textareaElement.value) {
|
|
32
|
-
patchTextareaMaxRowsSupport(textareaElement.value!);
|
|
33
|
-
emit('init', textareaElement.value!);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
2
|
+
import { computed, onMounted, ref, watch } from 'vue';
|
|
3
|
+
import { patchTextareaMaxRowsSupport } from '@/utils';
|
|
4
|
+
import type { Ui3nTextEmits, Ui3nTextProps } from './types';
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(
|
|
7
|
+
defineProps<Ui3nTextProps>(),
|
|
8
|
+
{
|
|
9
|
+
rows: 6,
|
|
10
|
+
maxRows: 6,
|
|
11
|
+
label: '',
|
|
12
|
+
placeholder: '',
|
|
13
|
+
disabled: false,
|
|
14
|
+
},
|
|
15
|
+
);
|
|
16
|
+
const emit = defineEmits<Ui3nTextEmits>();
|
|
17
|
+
|
|
18
|
+
const textareaElement = ref<HTMLTextAreaElement | null>(null);
|
|
19
|
+
const isFocused = ref(false);
|
|
20
|
+
const errorMessage = ref('');
|
|
21
|
+
|
|
22
|
+
const isValid = computed(() => {
|
|
23
|
+
if (!props.text) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
36
26
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
val => emit('update:valid', val),
|
|
40
|
-
{ immediate: true },
|
|
41
|
-
);
|
|
27
|
+
return !errorMessage.value;
|
|
28
|
+
});
|
|
42
29
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
30
|
+
onMounted(() => {
|
|
31
|
+
if (textareaElement.value) {
|
|
32
|
+
patchTextareaMaxRowsSupport(textareaElement.value!);
|
|
33
|
+
emit('init', textareaElement.value!);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
watch(
|
|
38
|
+
() => isValid.value,
|
|
39
|
+
val => emit('update:valid', val),
|
|
40
|
+
{ immediate: true },
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
function validate(text: string) {
|
|
44
|
+
errorMessage.value = '';
|
|
45
|
+
if (props.rules && props.rules.length) {
|
|
46
|
+
for (const validateFunction of props.rules) {
|
|
47
|
+
if (typeof validateFunction === 'function') {
|
|
48
|
+
const res = validateFunction(text);
|
|
49
|
+
if (typeof res === 'string') {
|
|
50
|
+
errorMessage.value += res;
|
|
51
|
+
}
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
}
|
|
56
56
|
|
|
57
|
-
function onFocus(event: Event) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
57
|
+
function onFocus(event: Event) {
|
|
58
|
+
isFocused.value = true;
|
|
59
|
+
emit('focus', event);
|
|
60
|
+
}
|
|
61
61
|
|
|
62
|
-
function onBlur(event: Event) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
62
|
+
function onBlur(event: Event) {
|
|
63
|
+
isFocused.value = false;
|
|
64
|
+
const value = (event.target as HTMLInputElement).value;
|
|
65
|
+
validate(value);
|
|
66
|
+
emit('blur', event);
|
|
67
|
+
emit('change', value);
|
|
68
|
+
emit('update:text', value);
|
|
69
|
+
}
|
|
70
70
|
|
|
71
|
-
function onInput(event: Event) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
71
|
+
function onInput(event: Event) {
|
|
72
|
+
const value = (event.target as HTMLInputElement).value;
|
|
73
|
+
validate(value);
|
|
74
|
+
emit('update:text', value);
|
|
75
|
+
emit('input', value);
|
|
76
|
+
}
|
|
77
77
|
|
|
78
|
-
function onEnterKeydown(event: KeyboardEvent) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
78
|
+
function onEnterKeydown(event: KeyboardEvent) {
|
|
79
|
+
const { altKey, ctrlKey, shiftKey, metaKey, target } = event;
|
|
80
|
+
const value = (target as HTMLInputElement).value;
|
|
81
|
+
validate(value);
|
|
82
|
+
emit('update:text', value);
|
|
83
|
+
emit('enter', { value, altKey, ctrlKey, shiftKey, metaKey });
|
|
84
|
+
}
|
|
85
85
|
|
|
86
|
-
function onEscapeKeydown(event: KeyboardEvent) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
86
|
+
function onEscapeKeydown(event: KeyboardEvent) {
|
|
87
|
+
const value = (event.target as HTMLInputElement).value;
|
|
88
|
+
validate(value);
|
|
89
|
+
emit('update:text', value);
|
|
90
|
+
emit('escape', event);
|
|
91
|
+
}
|
|
92
92
|
</script>
|
|
93
93
|
|
|
94
94
|
<template>
|
|
95
95
|
<div :class="[$style.ui3nText, disabled && $style.disabled, isFocused && $style.focused]">
|
|
96
|
-
<label
|
|
96
|
+
<label
|
|
97
|
+
v-if="label"
|
|
98
|
+
:class="$style.label"
|
|
99
|
+
>
|
|
97
100
|
{{ label }}
|
|
98
101
|
</label>
|
|
102
|
+
|
|
99
103
|
<div :class="$style.body">
|
|
100
104
|
<textarea
|
|
101
105
|
ref="textareaElement"
|
|
@@ -118,160 +122,98 @@ function onEscapeKeydown(event: KeyboardEvent) {
|
|
|
118
122
|
</template>
|
|
119
123
|
|
|
120
124
|
<style lang="scss" module>
|
|
121
|
-
.ui3nText {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.label {
|
|
129
|
-
display: block;
|
|
130
|
-
width: 100%;
|
|
131
|
-
font-size: var(--font-12);
|
|
132
|
-
line-height: var(--font-16);
|
|
133
|
-
font-weight: 600;
|
|
134
|
-
color: var(--color-text-control-primary-default);
|
|
135
|
-
margin-bottom: var(--spacing-xs);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.body {
|
|
139
|
-
position: relative;
|
|
140
|
-
width: 100%;
|
|
141
|
-
padding: var(--spacing-s) 0;
|
|
142
|
-
background-color: var(--color-bg-control-secondary-default);
|
|
143
|
-
border-radius: var(--spacing-xs);
|
|
144
|
-
transition: all 0.2s ease-in-out;
|
|
125
|
+
.ui3nText {
|
|
126
|
+
position: relative;
|
|
127
|
+
width: 100%;
|
|
128
|
+
border-radius: var(--spacing-xs);
|
|
129
|
+
padding: 1px;
|
|
130
|
+
}
|
|
145
131
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
132
|
+
.label {
|
|
133
|
+
display: block;
|
|
134
|
+
width: 100%;
|
|
135
|
+
font-size: var(--font-12);
|
|
136
|
+
line-height: var(--font-16);
|
|
137
|
+
font-weight: 600;
|
|
138
|
+
color: var(--color-text-control-primary-default);
|
|
139
|
+
margin-bottom: var(--spacing-xs);
|
|
140
|
+
}
|
|
149
141
|
|
|
150
|
-
|
|
142
|
+
.body {
|
|
143
|
+
position: relative;
|
|
144
|
+
width: 100%;
|
|
145
|
+
padding: var(--spacing-s) 0;
|
|
146
|
+
background-color: var(--color-bg-control-secondary-default);
|
|
147
|
+
border-radius: var(--spacing-xs);
|
|
148
|
+
transition: all 0.2s ease-in-out;
|
|
149
|
+
|
|
150
|
+
&:hover {
|
|
151
|
+
&:not(:focus-within) {
|
|
151
152
|
background-color: var(--color-bg-control-secondary-hover);
|
|
152
153
|
|
|
153
|
-
|
|
154
|
-
color: var(--color-
|
|
154
|
+
.content {
|
|
155
|
+
background-color: var(--color-bg-control-secondary-hover);
|
|
156
|
+
|
|
157
|
+
&::placeholder {
|
|
158
|
+
color: var(--color-text-control-secondary-hover);
|
|
159
|
+
}
|
|
155
160
|
}
|
|
156
161
|
}
|
|
157
162
|
}
|
|
158
163
|
}
|
|
159
|
-
}
|
|
160
164
|
|
|
161
|
-
.content {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
font-size: var(--font-13);
|
|
173
|
-
line-height: var(--font-16);
|
|
174
|
-
font-weight: 400;
|
|
175
|
-
color: var(--color-text-control-primary-default);
|
|
176
|
-
transition: all 0.2s ease-in-out;
|
|
177
|
-
|
|
178
|
-
&::placeholder {
|
|
179
|
-
color: var(--color-text-control-secondary-default);
|
|
180
|
-
font-style: italic;
|
|
165
|
+
.content {
|
|
166
|
+
resize: none;
|
|
167
|
+
display: block;
|
|
168
|
+
border: none;
|
|
169
|
+
box-sizing: border-box;
|
|
170
|
+
position: relative;
|
|
171
|
+
width: 100%;
|
|
172
|
+
border-radius: var(--spacing-xs);
|
|
173
|
+
background-color: var(--color-bg-control-secondary-default);
|
|
174
|
+
padding: 0 var(--spacing-s);
|
|
175
|
+
font-family: Manrope, sans-serif;
|
|
181
176
|
font-size: var(--font-13);
|
|
182
177
|
line-height: var(--font-16);
|
|
183
178
|
font-weight: 400;
|
|
184
|
-
|
|
179
|
+
color: var(--color-text-control-primary-default);
|
|
180
|
+
transition: all 0.2s ease-in-out;
|
|
181
|
+
|
|
182
|
+
&::placeholder {
|
|
183
|
+
color: var(--color-text-control-secondary-default);
|
|
184
|
+
font-style: italic;
|
|
185
|
+
font-size: var(--font-13);
|
|
186
|
+
line-height: var(--font-16);
|
|
187
|
+
font-weight: 400;
|
|
188
|
+
}
|
|
185
189
|
|
|
186
|
-
|
|
187
|
-
|
|
190
|
+
&:focus-within {
|
|
191
|
+
outline: none;
|
|
192
|
+
}
|
|
188
193
|
}
|
|
189
|
-
}
|
|
190
194
|
|
|
191
|
-
.disabled {
|
|
192
|
-
|
|
193
|
-
|
|
195
|
+
.disabled {
|
|
196
|
+
pointer-events: none;
|
|
197
|
+
user-select: none;
|
|
194
198
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
199
|
+
.body {
|
|
200
|
+
background-color: var(--color-bg-control-secondary-disabled);
|
|
201
|
+
}
|
|
198
202
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
203
|
+
.content {
|
|
204
|
+
background-color: var(--color-bg-control-secondary-disabled);
|
|
205
|
+
color: var(--color-text-control-secondary-disabled);
|
|
206
|
+
}
|
|
202
207
|
}
|
|
203
|
-
}
|
|
204
208
|
|
|
205
|
-
.focused {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
209
|
+
.focused {
|
|
210
|
+
.body {
|
|
211
|
+
background-color: var(--color-bg-control-secondary-focused);
|
|
212
|
+
outline: 1px solid var(--color-border-control-accent-focused);
|
|
213
|
+
}
|
|
210
214
|
|
|
211
|
-
|
|
212
|
-
|
|
215
|
+
.content {
|
|
216
|
+
background-color: var(--color-bg-control-secondary-focused);
|
|
217
|
+
}
|
|
213
218
|
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
//.ui3n-text {
|
|
217
|
-
// position: relative;
|
|
218
|
-
// width: 100%;
|
|
219
|
-
//
|
|
220
|
-
// &__label {
|
|
221
|
-
// display: block;
|
|
222
|
-
// width: 100%;
|
|
223
|
-
// font-size: var(--font-12, 12px);
|
|
224
|
-
// font-weight: 600;
|
|
225
|
-
// color: var(--black-90, #212121);
|
|
226
|
-
// margin-bottom: calc(var(--base-size, 8px) / 2);
|
|
227
|
-
// }
|
|
228
|
-
//
|
|
229
|
-
// &__body {
|
|
230
|
-
// position: relative;
|
|
231
|
-
// width: 100%;
|
|
232
|
-
// padding: var(--base-size, 8px) 0;
|
|
233
|
-
// background-color: var(--gray-50, #f2f2f2);
|
|
234
|
-
// border-radius: 4px;
|
|
235
|
-
// }
|
|
236
|
-
//
|
|
237
|
-
// &__content {
|
|
238
|
-
// resize: none;
|
|
239
|
-
// display: block;
|
|
240
|
-
// box-sizing: border-box;
|
|
241
|
-
// position: relative;
|
|
242
|
-
// width: 100%;
|
|
243
|
-
// border-radius: 4px;
|
|
244
|
-
// background-color: var(--gray-50, #f2f2f2);
|
|
245
|
-
// padding: 0 var(--base-size, 8px);
|
|
246
|
-
// font-family: OpenSans, sans-serif;
|
|
247
|
-
// font-size: var(--font-13, 13px);
|
|
248
|
-
// font-weight: 400;
|
|
249
|
-
// line-height: var(--font-16, 16px);
|
|
250
|
-
// color: var(--black-90, #212121);
|
|
251
|
-
// border: none;
|
|
252
|
-
//
|
|
253
|
-
// &::placeholder {
|
|
254
|
-
// font-size: var(--font-13, 13px);
|
|
255
|
-
// font-weight: 300;
|
|
256
|
-
// font-style: italic;
|
|
257
|
-
// color: var(--gray-90, #212121);
|
|
258
|
-
// }
|
|
259
|
-
// }
|
|
260
|
-
//
|
|
261
|
-
// &--disabled {
|
|
262
|
-
// pointer-events: none;
|
|
263
|
-
// user-select: none;
|
|
264
|
-
// opacity: 0.5;
|
|
265
|
-
// }
|
|
266
|
-
//
|
|
267
|
-
// &--focused {
|
|
268
|
-
// .ui3n-text {
|
|
269
|
-
// &__body, &__content {
|
|
270
|
-
// background-color: var(--blue-main-20, #d8edfd);
|
|
271
|
-
// outline: none;
|
|
272
|
-
// border: none;
|
|
273
|
-
// }
|
|
274
|
-
// }
|
|
275
|
-
// }
|
|
276
|
-
//}
|
|
277
219
|
</style>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
/* eslint-disable vue/no-multiple-template-root */
|
|
3
2
|
import { computed, getCurrentInstance, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
|
4
|
-
import type { Nullable } from '@/
|
|
3
|
+
import type { Nullable } from '@/types';
|
|
5
4
|
import type { Ui3nTooltipProps, Ui3nTooltipEmits, Ui3nTooltipSlots } from './types';
|
|
6
5
|
import { arrow, autoUpdate, offset, useFloating } from '@floating-ui/vue';
|
|
7
6
|
|
|
@@ -150,9 +149,9 @@
|
|
|
150
149
|
ref="floatingArrowEl"
|
|
151
150
|
:class="[$style.arrow, $style[`arrow-${mainPlacement}`]]"
|
|
152
151
|
:style="{
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
left: middlewareData.arrow?.x != null ? `${middlewareData.arrow?.x}px` : '',
|
|
153
|
+
top: middlewareData.arrow?.y != null ? `${middlewareData.arrow?.y}px` : '',
|
|
154
|
+
}"
|
|
156
155
|
/>
|
|
157
156
|
</div>
|
|
158
157
|
</slot>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { VNodeProps, AllowedComponentProps } from 'vue';
|
|
2
|
-
|
|
3
|
-
export type ExtractComponentProps<TComponent> = TComponent extends new () => {
|
|
4
|
-
$props: infer P;
|
|
5
|
-
}
|
|
6
|
-
? Omit<P, keyof VNodeProps | keyof AllowedComponentProps>
|
|
7
|
-
: never;
|
|
8
|
-
|
|
9
|
-
export type Nullable<T> = T | null;
|
|
10
|
-
|
|
11
|
-
export type Ui3nIconField = {
|
|
12
|
-
icon: string;
|
|
13
|
-
size?: string | number;
|
|
14
|
-
color?: string;
|
|
15
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|