@v1nt1248/3nclient-lib 0.0.41 → 0.1.0
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 +4 -4
- package/dist/components/index.d.ts +22 -38
- package/dist/components/ui3n-badge-simple.vue.d.ts +3 -3
- package/dist/components/ui3n-badge.vue.d.ts +2 -2
- package/dist/components/ui3n-breadcrumb.vue.d.ts +7 -7
- package/dist/components/ui3n-breadcrumbs.vue.d.ts +3 -3
- package/dist/components/ui3n-button.vue.d.ts +29 -4
- package/dist/components/ui3n-checkbox.vue.d.ts +3 -3
- package/dist/components/ui3n-chip.vue.d.ts +3 -3
- package/dist/components/ui3n-dialog.vue.d.ts +6 -5
- package/dist/components/ui3n-drop-files.vue.d.ts +23 -3
- package/dist/components/ui3n-emoji.vue.d.ts +3 -3
- package/dist/components/ui3n-icon.vue.d.ts +29 -3
- package/dist/components/ui3n-input.vue.d.ts +9 -9
- package/dist/components/ui3n-list.vue.d.ts +4 -4
- package/dist/components/ui3n-menu.vue.d.ts +3 -3
- package/dist/components/ui3n-notification.vue.d.ts +32 -2
- package/dist/components/ui3n-switch.vue.d.ts +55 -0
- package/dist/components/ui3n-table-sort-icon.vue.d.ts +1 -1
- package/dist/components/ui3n-table.vue.d.ts +4 -3
- package/dist/components/ui3n-tabs.vue.d.ts +3 -3
- package/dist/components/ui3n-text.vue.d.ts +29 -3
- package/dist/components/ui3n-virtual-scroll.vue.d.ts +12 -9
- package/dist/constants/types.d.ts +2 -4
- package/dist/directives/index.d.ts +3 -2
- package/dist/directives/ui3n-click-outside.d.ts +2 -1
- package/dist/directives/ui3n-html.d.ts +1 -0
- package/dist/index.d.ts +27 -29
- package/dist/plugins/dialogs.d.ts +3 -3
- package/dist/plugins/i18n.d.ts +2 -2
- package/dist/plugins/icons.d.ts +1 -0
- package/dist/plugins/index.d.ts +5 -8
- package/dist/plugins/notifications.d.ts +2 -2
- package/dist/plugins/store-dialogs.d.ts +2 -1
- package/dist/plugins/store-notifications.d.ts +2 -1
- package/dist/plugins/store-vue-bus.d.ts +2 -1
- package/dist/plugins/vue-bus.d.ts +3 -3
- package/dist/style.css +1 -1
- package/dist/tools/sqlite-on-3nstorage/index.d.ts +3 -2
- package/dist/tools/ui.helpers.d.ts +1 -0
- package/dist/ui-3n-lib.js +6953 -6615
- package/package.json +57 -58
- package/src/components/index.ts +47 -41
- package/src/components/ui3n-badge-simple.vue +35 -38
- package/src/components/ui3n-badge.vue +25 -25
- package/src/components/ui3n-breadcrumb.vue +44 -44
- package/src/components/ui3n-breadcrumbs.vue +19 -19
- package/src/components/ui3n-button.vue +240 -150
- package/src/components/ui3n-checkbox.vue +199 -158
- package/src/components/ui3n-chip.vue +96 -98
- package/src/components/ui3n-dialog.vue +225 -235
- package/src/components/ui3n-drop-files.vue +146 -154
- package/src/components/ui3n-emoji.vue +62 -64
- package/src/components/ui3n-icon.vue +32 -13
- package/src/components/ui3n-input.vue +239 -221
- package/src/components/ui3n-list.vue +92 -111
- package/src/components/ui3n-menu.vue +101 -100
- package/src/components/ui3n-notification.vue +182 -113
- package/src/components/ui3n-switch.vue +146 -0
- package/src/components/ui3n-table-sort-icon.vue +1 -2
- package/src/components/ui3n-table.vue +229 -223
- package/src/components/ui3n-tabs.vue +141 -148
- package/src/components/ui3n-text.vue +235 -146
- package/src/components/ui3n-virtual-scroll.vue +68 -68
- package/dist/stories/Ui3nBadge.stories.d.ts +0 -124
- package/dist/stories/Ui3nBreadcrumbs.stories.d.ts +0 -252
- package/dist/stories/Ui3nButton.stories.d.ts +0 -152
- package/dist/stories/Ui3nCheckbox.stories.d.ts +0 -186
- package/dist/stories/Ui3nChip.stories.d.ts +0 -562
- package/dist/stories/Ui3nDialog.stories.d.ts +0 -41
- package/dist/stories/Ui3nDropFiles.stories.d.ts +0 -73
- package/dist/stories/Ui3nEmoji.stories.d.ts +0 -39
- package/dist/stories/Ui3nIcon.stories.d.ts +0 -80
- package/dist/stories/Ui3nInput.stories.d.ts +0 -456
- package/dist/stories/Ui3nList.stories.d.ts +0 -54
- package/dist/stories/Ui3nTabs.stories.d.ts +0 -177
- package/dist/stories/data/data-to-list.d.ts +0 -8
- package/dist/stories/data/icons.d.ts +0 -1
|
@@ -1,83 +1,81 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} else if (wrapperElementHeight.value > 240) {
|
|
39
|
-
titleFontSize = 20
|
|
40
|
-
}
|
|
41
|
-
wrapperElement.value.style.setProperty('--dropzone-title-font', `${titleFontSize}px`)
|
|
2
|
+
import { onMounted, ref } from 'vue';
|
|
3
|
+
|
|
4
|
+
export interface Ui3nDropFilesProps {
|
|
5
|
+
title?: string;
|
|
6
|
+
text?: string;
|
|
7
|
+
additionalText?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface Ui3nDropFilesEmits {
|
|
11
|
+
(e: 'select', fileList: FileList): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const props = withDefaults(
|
|
15
|
+
defineProps<Ui3nDropFilesProps>(),
|
|
16
|
+
{
|
|
17
|
+
title: 'Upload',
|
|
18
|
+
text: '',
|
|
19
|
+
additionalText: '',
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
const emits = defineEmits<Ui3nDropFilesEmits>();
|
|
23
|
+
|
|
24
|
+
const wrapperElement = ref<HTMLDivElement | null>(null);
|
|
25
|
+
const wrapperElementHeight = ref(0);
|
|
26
|
+
const isOverDropPlace = ref(false);
|
|
27
|
+
const isOverDropZone = ref(false);
|
|
28
|
+
|
|
29
|
+
onMounted(() => {
|
|
30
|
+
if (wrapperElement.value) {
|
|
31
|
+
wrapperElementHeight.value = wrapperElement.value.clientHeight;
|
|
32
|
+
wrapperElement.value.style.setProperty('--dropzone-height', `${wrapperElementHeight.value}px`);
|
|
33
|
+
let titleFontSize = 12;
|
|
34
|
+
if (wrapperElementHeight.value > 100 && wrapperElementHeight.value <= 240) {
|
|
35
|
+
titleFontSize = 16;
|
|
36
|
+
} else if (wrapperElementHeight.value > 240) {
|
|
37
|
+
titleFontSize = 20;
|
|
42
38
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const onDragenter = (ev: MouseEvent) => {
|
|
46
|
-
ev.preventDefault()
|
|
47
|
-
isOverDropPlace.value = true
|
|
48
|
-
}
|
|
49
|
-
const onDragleave = (ev: MouseEvent) => {
|
|
50
|
-
ev.preventDefault()
|
|
51
|
-
isOverDropPlace.value = false
|
|
52
|
-
}
|
|
53
|
-
const onDropzoneDragover = (ev: MouseEvent) => {
|
|
54
|
-
ev.preventDefault()
|
|
55
|
-
ev.stopPropagation()
|
|
56
|
-
}
|
|
57
|
-
const onDropzoneDragenter = (ev: MouseEvent) => {
|
|
58
|
-
ev.preventDefault()
|
|
59
|
-
isOverDropZone.value = true
|
|
39
|
+
wrapperElement.value.style.setProperty('--dropzone-title-font', `${titleFontSize}px`);
|
|
60
40
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const onDragenter = (ev: MouseEvent) => {
|
|
44
|
+
ev.preventDefault();
|
|
45
|
+
isOverDropPlace.value = true;
|
|
46
|
+
};
|
|
47
|
+
const onDragleave = (ev: MouseEvent) => {
|
|
48
|
+
ev.preventDefault();
|
|
49
|
+
isOverDropPlace.value = false;
|
|
50
|
+
};
|
|
51
|
+
const onDropzoneDragover = (ev: MouseEvent) => {
|
|
52
|
+
ev.preventDefault();
|
|
53
|
+
ev.stopPropagation();
|
|
54
|
+
};
|
|
55
|
+
const onDropzoneDragenter = (ev: MouseEvent) => {
|
|
56
|
+
ev.preventDefault();
|
|
57
|
+
isOverDropZone.value = true;
|
|
58
|
+
};
|
|
59
|
+
const onDropzoneDragleave = (ev: MouseEvent) => {
|
|
60
|
+
ev.preventDefault();
|
|
61
|
+
isOverDropZone.value = false;
|
|
62
|
+
};
|
|
63
|
+
const onDrop = (ev: DragEvent) => {
|
|
64
|
+
ev.stopPropagation();
|
|
65
|
+
ev.preventDefault();
|
|
66
|
+
if (ev.dataTransfer!.files) {
|
|
67
|
+
emits('select', ev.dataTransfer!.files);
|
|
73
68
|
}
|
|
69
|
+
isOverDropPlace.value = false;
|
|
70
|
+
isOverDropZone.value = false;
|
|
71
|
+
};
|
|
74
72
|
</script>
|
|
75
73
|
|
|
76
74
|
<template>
|
|
77
75
|
<!-- eslint-disable max-len -->
|
|
78
76
|
<div
|
|
79
77
|
ref="wrapperElement"
|
|
80
|
-
class="
|
|
78
|
+
:class="$style.dropFiles"
|
|
81
79
|
@dragenter="onDragenter"
|
|
82
80
|
@dragleave="onDragleave"
|
|
83
81
|
>
|
|
@@ -85,17 +83,17 @@
|
|
|
85
83
|
|
|
86
84
|
<div
|
|
87
85
|
v-if="isOverDropPlace || isOverDropZone"
|
|
88
|
-
class="
|
|
86
|
+
:class="$style.dropzone"
|
|
89
87
|
@dragenter="onDropzoneDragenter"
|
|
90
88
|
@dragover="onDropzoneDragover"
|
|
91
89
|
@dragleave="onDropzoneDragleave"
|
|
92
90
|
@drop="onDrop"
|
|
93
91
|
>
|
|
94
|
-
<div class="
|
|
95
|
-
<h3 class="
|
|
96
|
-
{{
|
|
92
|
+
<div :class="$style.dropzoneBorder" />
|
|
93
|
+
<h3 :class="$style.dropzoneTitle">
|
|
94
|
+
{{ title }}
|
|
97
95
|
</h3>
|
|
98
|
-
<div class="
|
|
96
|
+
<div :class="$style.dropzoneIcon">
|
|
99
97
|
<svg
|
|
100
98
|
:width="wrapperElementHeight / 2"
|
|
101
99
|
:height="wrapperElementHeight / 2"
|
|
@@ -105,94 +103,88 @@
|
|
|
105
103
|
>
|
|
106
104
|
<path
|
|
107
105
|
d="M51 152C47.9333 152 45.3333 150.934 43.2 148.8C41.0667 146.667 40 144.067 40 141V119.8H46.2V141C46.2 142.2 46.7 143.3 47.7 144.3C48.7 145.3 49.8 145.8 51 145.8H141C142.2 145.8 143.3 145.3 144.3 144.3C145.3 143.3 145.8 142.2 145.8 141V119.8H152V141C152 144.067 150.933 146.667 148.8 148.8C146.667 150.934 144.067 152 141 152H51ZM93 122.4V49.2002L72.8 69.2002L68.4 65.0002L96 37.2002L123.6 65.0002L119.2 69.2002L99 49.2002V122.4H93Z"
|
|
108
|
-
fill="
|
|
106
|
+
fill="var(--color-icon-button-tritery-default)"
|
|
109
107
|
/>
|
|
110
108
|
</svg>
|
|
111
109
|
</div>
|
|
112
|
-
<div
|
|
113
|
-
v-if="props.text"
|
|
114
|
-
class="ui3n-drop-files__dropzone-text"
|
|
115
|
-
>
|
|
110
|
+
<div v-if="props.text" :class="$style.dropzoneText">
|
|
116
111
|
{{ props.text }}
|
|
117
112
|
</div>
|
|
118
|
-
<div
|
|
119
|
-
v-if="props.additionalText"
|
|
120
|
-
class="ui3n-drop-files__dropzone-additional"
|
|
121
|
-
>
|
|
113
|
+
<div v-if="props.additionalText" :class="$style.dropzoneText">
|
|
122
114
|
{{ props.additionalText }}
|
|
123
115
|
</div>
|
|
124
116
|
</div>
|
|
125
117
|
</div>
|
|
126
118
|
</template>
|
|
127
119
|
|
|
128
|
-
<style lang="scss"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
120
|
+
<style lang="scss" module>
|
|
121
|
+
.dropFiles {
|
|
122
|
+
--dropzone-height: 0;
|
|
123
|
+
--dropzone-title-font: 0;
|
|
124
|
+
|
|
125
|
+
position: relative;
|
|
126
|
+
box-sizing: border-box;
|
|
127
|
+
width: 100%;
|
|
128
|
+
height: 100%;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.dropzone {
|
|
132
|
+
box-sizing: border-box;
|
|
133
|
+
position: absolute;
|
|
134
|
+
background-color: var(--white-0);
|
|
135
|
+
display: flex;
|
|
136
|
+
flex-direction: column;
|
|
137
|
+
justify-content: center;
|
|
138
|
+
align-items: center;
|
|
139
|
+
inset: var(--spacing-xs) var(--spacing-s);
|
|
140
|
+
border-radius: var(--spacing-s);
|
|
141
|
+
z-index: 5;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.dropzoneBorder {
|
|
145
|
+
box-sizing: border-box;
|
|
146
|
+
position: absolute;
|
|
147
|
+
top: calc(var(--spacing-s) + 1px);
|
|
148
|
+
bottom: calc(var(--spacing-s) + 1px);
|
|
149
|
+
left: calc(var(--spacing-s) + 1px);
|
|
150
|
+
right: calc(var(--spacing-s) + 1px);
|
|
151
|
+
border-radius: var(--spacing-s);
|
|
152
|
+
border: 2px dashed var(--fill-s-focused);
|
|
153
|
+
pointer-events: none;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.dropzoneTitle {
|
|
157
|
+
margin: 0 0 var(--dropzone-title-font);
|
|
158
|
+
font-size: var(--dropzone-title-font);
|
|
159
|
+
font-weight: 600;
|
|
160
|
+
color: var(--fill-pressed);
|
|
161
|
+
pointer-events: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.dropzoneIcon {
|
|
165
|
+
position: relative;
|
|
166
|
+
width: calc(var(--dropzone-height) * 0.4);
|
|
167
|
+
height: calc(var(--dropzone-height) * 0.4);
|
|
168
|
+
border-radius: 50%;
|
|
169
|
+
background-color: var(--fill-s-focused);
|
|
170
|
+
display: flex;
|
|
171
|
+
justify-content: center;
|
|
172
|
+
align-items: center;
|
|
173
|
+
pointer-events: none;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.dropzoneText {
|
|
177
|
+
margin-top: var(--spacing-ml);
|
|
178
|
+
font-size: var(--font-12);
|
|
179
|
+
line-height: var(--font-16);
|
|
180
|
+
font-weight: 400;
|
|
181
|
+
color: var(--fill-pressed);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.dropzoneAdditional {
|
|
185
|
+
margin-top: var(--spacing-xs);
|
|
186
|
+
font-size: var(--font-12);
|
|
187
|
+
font-weight: 500;
|
|
188
|
+
color: var(--color-text-control-primary-default);
|
|
189
|
+
}
|
|
198
190
|
</style>
|
|
@@ -1,88 +1,86 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { computed, onMounted, ref, watch } from 'vue';
|
|
3
|
+
import { emoticons } from '../constants/emoticons';
|
|
4
4
|
|
|
5
|
+
export interface Ui3nEmojiProps {
|
|
6
|
+
emoji: string;
|
|
7
|
+
size?: string | number;
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
}
|
|
5
10
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
readonly?: boolean;
|
|
10
|
-
}
|
|
11
|
+
export interface Ui3nEmojiEmits {
|
|
12
|
+
(ev: 'click', value: Event): void;
|
|
13
|
+
}
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
const props = withDefaults(
|
|
16
|
+
defineProps<Ui3nEmojiProps>(),
|
|
17
|
+
{
|
|
18
|
+
size: 16,
|
|
19
|
+
readonly: false,
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
const emits = defineEmits<Ui3nEmojiEmits>();
|
|
15
23
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
size: 16,
|
|
20
|
-
readonly: false,
|
|
21
|
-
},
|
|
22
|
-
)
|
|
23
|
-
const emit = defineEmits<Ui3nEmojiEmits>()
|
|
24
|
+
const emojiElement = ref<HTMLDivElement | null>(null);
|
|
25
|
+
const emojiData = computed(() => emoticons[props.emoji]);
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
onMounted(() => {
|
|
28
|
+
if (emojiElement.value) {
|
|
29
|
+
emojiElement.value.style.setProperty('--emoji-size', `${props.size}px`);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
27
32
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
watch(
|
|
34
|
+
() => props.emoji,
|
|
35
|
+
newValue => {
|
|
36
|
+
if (!Object.keys(emoticons).includes(newValue)) {
|
|
37
|
+
console.error(`[Ui3nEmoji] Invalid emoticon: ${newValue}`);
|
|
31
38
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
() => props.emoji,
|
|
36
|
-
newValue => {
|
|
37
|
-
if (!Object.keys(emoticons).includes(newValue)) {
|
|
38
|
-
console.error(`[Ui3nEmoji] Invalid emoticon: ${newValue}`)
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
{ immediate: true },
|
|
42
|
-
)
|
|
39
|
+
},
|
|
40
|
+
{ immediate: true },
|
|
41
|
+
);
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
watch(
|
|
44
|
+
() => props.size,
|
|
45
|
+
(newValue, prevValue) => {
|
|
46
|
+
if (emojiElement.value && newValue && newValue !== prevValue) {
|
|
47
|
+
emojiElement.value.style.setProperty('--ui3n-emoji-size', `${newValue}px`);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
);
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
const onClick = (ev: Event) => {
|
|
53
|
+
ev.stopImmediatePropagation();
|
|
54
|
+
emits('click', ev);
|
|
55
|
+
};
|
|
57
56
|
</script>
|
|
58
57
|
|
|
59
58
|
<template>
|
|
60
59
|
<div
|
|
61
60
|
ref="emojiElement"
|
|
62
|
-
:class="[
|
|
63
|
-
'ui3n-emoji',
|
|
64
|
-
{ 'ui3n-emoji--readonly': props.readonly },
|
|
65
|
-
]"
|
|
61
|
+
:class="[$style.emoji, readonly && $style.readonly]"
|
|
66
62
|
v-on="readonly ? {} : { 'click': onClick }"
|
|
67
63
|
>
|
|
68
64
|
{{ emojiData && emojiData.value }}
|
|
69
65
|
</div>
|
|
70
66
|
</template>
|
|
71
67
|
|
|
72
|
-
<style lang="scss"
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
<style lang="scss" module>
|
|
69
|
+
.emoji {
|
|
70
|
+
--ui3n-emoji-size: 16px;
|
|
75
71
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
72
|
+
display: flex;
|
|
73
|
+
min-width: var(--ui3n-emoji-size);
|
|
74
|
+
width: var(--ui3n-emoji-size);
|
|
75
|
+
min-height: var(--ui3n-emoji-size);
|
|
76
|
+
height: var(--ui3n-emoji-size);
|
|
77
|
+
font-size: var(--ui3n-emoji-size);
|
|
78
|
+
justify-content: center;
|
|
79
|
+
align-items: center;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
}
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
83
|
+
.readonly {
|
|
84
|
+
cursor: default;
|
|
85
|
+
}
|
|
88
86
|
</style>
|
|
@@ -20,8 +20,17 @@
|
|
|
20
20
|
(ev: 'click', value: Event): void;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
const props =
|
|
24
|
-
|
|
23
|
+
const props = withDefaults(
|
|
24
|
+
defineProps<Ui3nIconProps>(),
|
|
25
|
+
{
|
|
26
|
+
title: '',
|
|
27
|
+
width: 16,
|
|
28
|
+
height: 16,
|
|
29
|
+
rotate: 0,
|
|
30
|
+
color: 'var(--color-icon-control-primary-default)',
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
const emits = defineEmits<Ui3nIconEmits>()
|
|
25
34
|
|
|
26
35
|
const onLoad = (value: any) => {
|
|
27
36
|
if (props.onLoad) {
|
|
@@ -29,23 +38,33 @@
|
|
|
29
38
|
}
|
|
30
39
|
}
|
|
31
40
|
const onClick = (ev: Event) => {
|
|
32
|
-
|
|
41
|
+
emits('click', ev)
|
|
33
42
|
}
|
|
34
43
|
</script>
|
|
35
44
|
|
|
36
45
|
<template>
|
|
37
46
|
<icon
|
|
38
|
-
:
|
|
39
|
-
:
|
|
40
|
-
:
|
|
41
|
-
:
|
|
42
|
-
:
|
|
43
|
-
:
|
|
44
|
-
:
|
|
45
|
-
:flip="
|
|
46
|
-
:
|
|
47
|
-
:
|
|
47
|
+
:class="$style.icon"
|
|
48
|
+
:icon="icon"
|
|
49
|
+
:title="title"
|
|
50
|
+
:inline="inline"
|
|
51
|
+
:width="width"
|
|
52
|
+
:height="height"
|
|
53
|
+
:horizontal-flip="horizontalFlip"
|
|
54
|
+
:vertical-flip="verticalFlip"
|
|
55
|
+
:flip="flip"
|
|
56
|
+
:rotate="rotate"
|
|
57
|
+
:color="color"
|
|
48
58
|
:on-load="onLoad"
|
|
49
59
|
@click="onClick"
|
|
50
60
|
/>
|
|
51
61
|
</template>
|
|
62
|
+
|
|
63
|
+
<style lang="scss" module>
|
|
64
|
+
.icon {
|
|
65
|
+
min-width: v-bind(width);
|
|
66
|
+
min-height: v-bind(height);
|
|
67
|
+
flex-grow: 0;
|
|
68
|
+
flex-shrink: 0;
|
|
69
|
+
}
|
|
70
|
+
</style>
|