@v1nt1248/3nclient-lib 0.1.53 → 0.1.55
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/index.d.ts +3 -1
- package/dist/components/ui3n-editable/types.d.ts +38 -0
- package/dist/components/ui3n-editable/ui3n-editable.vue.d.ts +20 -0
- package/dist/components/ui3n-editable/useContentEditable.d.ts +12 -0
- package/dist/directives/ui3n-title.d.ts +19 -0
- package/dist/index.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/ui3n-components.d.ts +2 -0
- package/dist/ui3n-components.js +8123 -7928
- package/dist/ui3n-plugins.js +2962 -6634
- package/dist/ui3n-utils.js +2019 -5465
- package/dist/utils/common.d.ts +6 -5
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/selection.d.ts +3 -0
- package/dist/variables.css +18 -0
- package/package.json +7 -6
- package/src/components/index.ts +5 -0
- package/src/components/ui3n-button/ui3n-button.vue +1 -1
- package/src/components/ui3n-editable/types.ts +42 -0
- package/src/components/ui3n-editable/ui3n-content-editable.vue +73 -0
- package/src/components/ui3n-editable/ui3n-editable.vue +296 -0
- package/src/components/ui3n-editable/useContentEditable.ts +153 -0
- package/src/components/ui3n-emoji/ui3n-emoji.vue +55 -55
- package/src/components/ui3n-table/ui3n-table.vue +12 -4
- package/src/components/ui3n-tooltip/ui3n-tooltip.vue +1 -1
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, onMounted, ref, watch } from 'vue';
|
|
3
|
-
import { emoticons } from '@/constants/emoticons';
|
|
4
|
-
import type { Ui3nEmojiEmits, Ui3nEmojiProps } from './types';
|
|
2
|
+
import { computed, onMounted, ref, watch } from 'vue';
|
|
3
|
+
import { emoticons } from '@/constants/emoticons';
|
|
4
|
+
import type { Ui3nEmojiEmits, Ui3nEmojiProps } from './types';
|
|
5
5
|
|
|
6
|
-
const props = withDefaults(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
);
|
|
13
|
-
const emits = defineEmits<Ui3nEmojiEmits>();
|
|
6
|
+
const props = withDefaults(
|
|
7
|
+
defineProps<Ui3nEmojiProps>(),
|
|
8
|
+
{
|
|
9
|
+
size: 16,
|
|
10
|
+
readonly: false,
|
|
11
|
+
},
|
|
12
|
+
);
|
|
13
|
+
const emits = defineEmits<Ui3nEmojiEmits>();
|
|
14
14
|
|
|
15
|
-
const emojiElement = ref<HTMLDivElement | null>(null);
|
|
16
|
-
const emojiData = computed(() => emoticons[props.emoji]);
|
|
15
|
+
const emojiElement = ref<HTMLDivElement | null>(null);
|
|
16
|
+
const emojiData = computed(() => emoticons[props.emoji]);
|
|
17
17
|
|
|
18
|
-
onMounted(() => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
watch(
|
|
25
|
-
() => props.emoji,
|
|
26
|
-
newValue => {
|
|
27
|
-
if (!Object.keys(emoticons).includes(newValue)) {
|
|
28
|
-
console.error(`[Ui3nEmoji] Invalid emoticon: ${newValue}`);
|
|
18
|
+
onMounted(() => {
|
|
19
|
+
if (emojiElement.value) {
|
|
20
|
+
emojiElement.value.style.setProperty('--emoji-size', `${props.size}px`);
|
|
29
21
|
}
|
|
30
|
-
}
|
|
31
|
-
{ immediate: true },
|
|
32
|
-
);
|
|
22
|
+
});
|
|
33
23
|
|
|
34
|
-
watch(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
watch(
|
|
25
|
+
() => props.emoji,
|
|
26
|
+
newValue => {
|
|
27
|
+
if (!Object.keys(emoticons).includes(newValue)) {
|
|
28
|
+
console.error(`[Ui3nEmoji] Invalid emoticon: ${newValue}`);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{ immediate: true },
|
|
32
|
+
);
|
|
42
33
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
watch(
|
|
35
|
+
() => props.size,
|
|
36
|
+
(newValue, prevValue) => {
|
|
37
|
+
if (emojiElement.value && newValue && newValue !== prevValue) {
|
|
38
|
+
emojiElement.value.style.setProperty('--ui3n-emoji-size', `${newValue}px`);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const onClick = (ev: Event) => {
|
|
44
|
+
ev.stopImmediatePropagation();
|
|
45
|
+
emits('click', ev);
|
|
46
|
+
};
|
|
47
47
|
</script>
|
|
48
48
|
|
|
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,21 +57,21 @@ const onClick = (ev: Event) => {
|
|
|
57
57
|
</template>
|
|
58
58
|
|
|
59
59
|
<style lang="scss" module>
|
|
60
|
-
.
|
|
61
|
-
|
|
60
|
+
.ui3nEmoji {
|
|
61
|
+
--ui3n-emoji-size: 16px;
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
63
|
+
display: flex;
|
|
64
|
+
min-width: var(--ui3n-emoji-size);
|
|
65
|
+
width: var(--ui3n-emoji-size);
|
|
66
|
+
min-height: var(--ui3n-emoji-size);
|
|
67
|
+
height: var(--ui3n-emoji-size);
|
|
68
|
+
font-size: var(--ui3n-emoji-size);
|
|
69
|
+
justify-content: center;
|
|
70
|
+
align-items: center;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
73
|
|
|
74
|
-
.readonly {
|
|
75
|
-
|
|
76
|
-
}
|
|
74
|
+
.readonly {
|
|
75
|
+
cursor: default;
|
|
76
|
+
}
|
|
77
77
|
</style>
|
|
@@ -116,7 +116,12 @@
|
|
|
116
116
|
<div
|
|
117
117
|
v-for="(row, rowIndex) in body.content"
|
|
118
118
|
:key="getRowKey(row, rowIndex)"
|
|
119
|
-
:class="[
|
|
119
|
+
:class="[
|
|
120
|
+
$style.row,
|
|
121
|
+
$slots['row'] && $style.customRow,
|
|
122
|
+
isRowSelected(row) && $style.selected,
|
|
123
|
+
config.selectable && $style.selectable,
|
|
124
|
+
]"
|
|
120
125
|
>
|
|
121
126
|
<slot
|
|
122
127
|
name="row"
|
|
@@ -282,14 +287,17 @@
|
|
|
282
287
|
position: relative;
|
|
283
288
|
width: 100%;
|
|
284
289
|
min-height: var(--ui3n-table-body-row-height);
|
|
285
|
-
display: grid;
|
|
286
|
-
grid-template-columns: var(--ui3n-table-columns-width);
|
|
287
|
-
padding-left: var(--spacing-m);
|
|
288
290
|
border-left: 1px solid var(--color-border-table-primary-default);
|
|
289
291
|
border-right: 1px solid var(--color-border-table-primary-default);
|
|
290
292
|
border-bottom: 1px solid var(--color-border-block-primary-default);
|
|
291
293
|
background-color: transparent;
|
|
292
294
|
|
|
295
|
+
&:not(.customRow) {
|
|
296
|
+
padding-left: var(--spacing-m);
|
|
297
|
+
display: grid;
|
|
298
|
+
grid-template-columns: var(--ui3n-table-columns-width);
|
|
299
|
+
}
|
|
300
|
+
|
|
293
301
|
&.selectable {
|
|
294
302
|
cursor: pointer;
|
|
295
303
|
}
|
|
@@ -103,10 +103,10 @@ watch(isPositioned, val => {
|
|
|
103
103
|
</div>
|
|
104
104
|
|
|
105
105
|
<div
|
|
106
|
+
v-if="showTooltip"
|
|
106
107
|
ref="floatingEl"
|
|
107
108
|
:class="$style.floating"
|
|
108
109
|
:style="floatingStyles"
|
|
109
|
-
v-if="showTooltip"
|
|
110
110
|
>
|
|
111
111
|
<slot name="content">
|
|
112
112
|
<div :class="$style.content">
|