@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,172 +1,262 @@
|
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
2
|
+
import { onMounted, ref, watch } from 'vue';
|
|
3
|
+
import Ui3nIcon from './ui3n-icon.vue';
|
|
4
|
+
|
|
5
|
+
export interface Ui3nButtonProps {
|
|
6
|
+
type?: 'primary' | 'secondary' | 'tertiary' | 'icon' | 'custom';
|
|
7
|
+
size?: 'regular' | 'small';
|
|
8
|
+
textColor?: string;
|
|
9
|
+
color?: string;
|
|
10
|
+
elevation?: boolean;
|
|
11
|
+
icon?: string;
|
|
12
|
+
iconSize?: string | number;
|
|
13
|
+
iconColor?: string;
|
|
14
|
+
iconPosition?: 'left' | 'right';
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface Ui3nButtonEmits {
|
|
19
|
+
(ev: 'init', value: HTMLButtonElement): void;
|
|
20
|
+
(ev: 'click', value: Event): void;
|
|
21
|
+
(ev: 'focus', value: Event): void;
|
|
22
|
+
(ev: 'blur', value: Event): void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const props = withDefaults(
|
|
26
|
+
defineProps<Ui3nButtonProps>(),
|
|
27
|
+
{
|
|
28
|
+
type: 'primary',
|
|
29
|
+
size: 'regular',
|
|
30
|
+
iconPosition: 'right',
|
|
31
|
+
disabled: false,
|
|
32
|
+
},
|
|
33
|
+
);
|
|
34
|
+
const emits = defineEmits<Ui3nButtonEmits>();
|
|
35
|
+
|
|
36
|
+
const buttonEl = ref<HTMLButtonElement | null>(null);
|
|
37
|
+
|
|
38
|
+
watch(
|
|
39
|
+
[() => props.color, () => props.textColor],
|
|
40
|
+
(newValue: [string | undefined, string | undefined], prevValue: [string | undefined, string | undefined]) => {
|
|
41
|
+
if (!buttonEl.value) return;
|
|
42
|
+
|
|
43
|
+
const [prevColor, prevTextColor] = prevValue;
|
|
44
|
+
const [color, textColor] = newValue;
|
|
45
|
+
|
|
46
|
+
(props.type === 'custom' || props.type === 'icon')
|
|
47
|
+
&& color !== prevColor
|
|
48
|
+
&& buttonEl.value.style.setProperty('--ui3n-button-bg-color-custom', color ?? 'var(--color-bg-button-primary-default)');
|
|
49
|
+
|
|
50
|
+
props.type === 'custom'
|
|
51
|
+
&& textColor !== prevTextColor
|
|
52
|
+
&& buttonEl.value.style.setProperty('--ui3n-button-text-color-custom', textColor ?? 'var(--color-text-button-primary-default');
|
|
53
|
+
},
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
onMounted(() => {
|
|
57
|
+
if (!buttonEl.value) return;
|
|
58
|
+
|
|
59
|
+
(props.type === 'custom' || props.type === 'icon') && props.color && buttonEl.value.style.setProperty('--ui3n-button-bg-color-custom', props.color);
|
|
60
|
+
|
|
61
|
+
props.type === 'custom' && props.textColor && buttonEl.value.style.setProperty('--ui3n-button-text-color-custom', props.textColor);
|
|
62
|
+
|
|
63
|
+
emits('init', buttonEl.value);
|
|
64
|
+
});
|
|
59
65
|
</script>
|
|
60
66
|
|
|
61
67
|
<template>
|
|
62
68
|
<button
|
|
63
69
|
ref="buttonEl"
|
|
64
70
|
:class="[
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
$style.button,
|
|
72
|
+
$style[size],
|
|
73
|
+
$style[type],
|
|
74
|
+
icon && $style[`withIcon-${iconPosition}`],
|
|
75
|
+
elevation && $style.elevation,
|
|
67
76
|
]"
|
|
68
77
|
type="button"
|
|
69
|
-
:disabled="
|
|
78
|
+
:disabled="disabled"
|
|
70
79
|
@click="emits('click', $event)"
|
|
71
80
|
@focusin="emits('focus', $event)"
|
|
72
81
|
@focusout="emits('blur', $event)"
|
|
73
82
|
>
|
|
74
83
|
<ui3n-icon
|
|
75
|
-
v-if="
|
|
76
|
-
class="
|
|
77
|
-
:icon="
|
|
78
|
-
:width="
|
|
79
|
-
:height="
|
|
80
|
-
:color="
|
|
84
|
+
v-if="icon"
|
|
85
|
+
:class="$style.buttonIcon"
|
|
86
|
+
:icon="icon"
|
|
87
|
+
:width="iconSize || (size === 'small' ? 12 : 16)"
|
|
88
|
+
:height="iconSize || (size === 'small' ? 12 : 16)"
|
|
89
|
+
:color="iconColor || 'var(--color-text-button-primary-default)'"
|
|
81
90
|
/>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
'ui3n-button__text',
|
|
85
|
-
{ 'ui3n-button__text--margin': !isSlotEmpty && props.icon },
|
|
86
|
-
]"
|
|
87
|
-
>
|
|
91
|
+
|
|
92
|
+
<span v-if="type !== 'icon'" :class="$style.text">
|
|
88
93
|
<slot />
|
|
89
94
|
</span>
|
|
90
95
|
</button>
|
|
91
96
|
</template>
|
|
92
97
|
|
|
93
|
-
<style lang="scss"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
&--elevation {
|
|
126
|
-
@include elevation();
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
&:not([disabled]) {
|
|
130
|
-
&:hover {
|
|
131
|
-
box-shadow: 0 0 4px var(--shadow-key-ambient-opacity, rgba(0, 0, 0, 0.12));
|
|
132
|
-
|
|
133
|
-
.ui3n-button {
|
|
134
|
-
&__icon,
|
|
135
|
-
&__text {
|
|
136
|
-
opacity: 1;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
&__icon {
|
|
143
|
-
opacity: 0.85;
|
|
144
|
-
transition: opacity 0.2s ease-in-out;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
&__text {
|
|
148
|
-
display: flex;
|
|
149
|
-
opacity: 0.85;
|
|
150
|
-
transition: opacity 0.2s ease-in-out;
|
|
151
|
-
|
|
152
|
-
&--margin {
|
|
153
|
-
margin-left: 4px;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
&[disabled] {
|
|
158
|
-
opacity: 0.7;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
&:not(.ui3n-button--round) {
|
|
162
|
-
.ui3n-button {
|
|
163
|
-
&__icon,
|
|
164
|
-
&__text {
|
|
165
|
-
pointer-events: none
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
@include ripple(var(--ui3n-button-background));
|
|
98
|
+
<style lang="scss" module>
|
|
99
|
+
@import "../assets/styles/mixins";
|
|
100
|
+
|
|
101
|
+
.button {
|
|
102
|
+
--ui3n-button-padding: var(--spacing-m);
|
|
103
|
+
--ui3n-button-text-size: var(--font-12);
|
|
104
|
+
--ui3n-button-text-color-custom: var(--color-text-button-primary-default);
|
|
105
|
+
--ui3n-button-bg-color-custom: var(--color-bg-button-primary-default);
|
|
106
|
+
|
|
107
|
+
display: flex;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
align-items: center;
|
|
110
|
+
gap: var(--spacing-s);
|
|
111
|
+
border: none;
|
|
112
|
+
outline: none;
|
|
113
|
+
border-radius: var(--spacing-xs);
|
|
114
|
+
font-size: var(--ui3n-button-text-size);
|
|
115
|
+
font-weight: 600;
|
|
116
|
+
line-height: calc(var(--ui3n-button-text-size) * 1.25);
|
|
117
|
+
user-select: none;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.regular {
|
|
121
|
+
height: var(--spacing-l);
|
|
122
|
+
padding: 0 var(--spacing-m);
|
|
123
|
+
|
|
124
|
+
&.withIcon-left {
|
|
125
|
+
padding-left: var(--spacing-s);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&.withIcon-right {
|
|
129
|
+
padding-right: var(--spacing-s);
|
|
171
130
|
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.small {
|
|
134
|
+
height: var(--spacing-ml);
|
|
135
|
+
padding: 0 var(--spacing-s);
|
|
136
|
+
|
|
137
|
+
&.withIcon-left {
|
|
138
|
+
padding-left: var(--spacing-xs);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&.withIcon-right {
|
|
142
|
+
padding-right: var(--spacing-xs);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.primary {
|
|
147
|
+
background: var(--color-bg-button-primary-default);
|
|
148
|
+
color: var(--color-text-button-primary-default);
|
|
149
|
+
|
|
150
|
+
&:hover {
|
|
151
|
+
background: var(--color-bg-button-primary-hover);
|
|
152
|
+
color: var(--color-text-button-primary-hover);
|
|
153
|
+
@include ripple(var(--color-bg-button-primary-hover));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&[disabled] {
|
|
157
|
+
background: var(--color-bg-button-primary-disabled);
|
|
158
|
+
color: var(--color-text-button-primary-disabled);
|
|
159
|
+
pointer-events: none;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.secondary {
|
|
164
|
+
background: var(--color-bg-button-secondary-default);
|
|
165
|
+
color: var(--color-text-button-secondary-default);
|
|
166
|
+
|
|
167
|
+
&:hover {
|
|
168
|
+
background: var(--color-bg-button-secondary-hover);
|
|
169
|
+
color: var(--color-text-button-secondary-hover);
|
|
170
|
+
@include ripple(var(--color-bg-button-secondary-hover));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&[disabled] {
|
|
174
|
+
background: var(--color-bg-button-secondary-disabled);
|
|
175
|
+
color: var(--color-text-button-secondary-disabled);
|
|
176
|
+
pointer-events: none;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.tertiary {
|
|
181
|
+
background: transparent;
|
|
182
|
+
color: var(--color-text-button-secondary-default);
|
|
183
|
+
padding: 0;
|
|
184
|
+
|
|
185
|
+
&:hover {
|
|
186
|
+
background: transparent;
|
|
187
|
+
color: var(--color-text-button-secondary-hover);
|
|
188
|
+
text-decoration: underline;
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&[disabled] {
|
|
193
|
+
background: transparent;
|
|
194
|
+
color: var(--color-text-button-secondary-disabled);
|
|
195
|
+
pointer-events: none;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.icon {
|
|
200
|
+
--ui3n-button-icon-bg-color: hsl(from var(--ui3n-button-bg-color-custom) h s calc(l - 10));
|
|
201
|
+
|
|
202
|
+
background: var(--ui3n-button-bg-color-custom);
|
|
203
|
+
color: var(--ui3n-button-text-color-custom);
|
|
204
|
+
border-radius: 50%;
|
|
205
|
+
|
|
206
|
+
&.regular {
|
|
207
|
+
min-width: var(--spacing-l);
|
|
208
|
+
width: var(--spacing-l);
|
|
209
|
+
padding: 0;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&.small {
|
|
213
|
+
min-width: var(--spacing-ml);
|
|
214
|
+
width: var(--spacing-ml);
|
|
215
|
+
padding: 0;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&:hover {
|
|
219
|
+
background: var(--ui3n-button-icon-bg-color);
|
|
220
|
+
@include ripple(var(--ui3n-button-icon-bg-color));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&[disabled] {
|
|
224
|
+
opacity: 0.7;
|
|
225
|
+
pointer-events: none;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.custom {
|
|
230
|
+
--ui3n-button-custom-bg-color: hsl(from var(--ui3n-button-bg-color-custom) h s calc(l - 10));
|
|
231
|
+
|
|
232
|
+
background: var(--ui3n-button-bg-color-custom);
|
|
233
|
+
color: var(--ui3n-button-text-color-custom);
|
|
234
|
+
|
|
235
|
+
&:hover {
|
|
236
|
+
background: var(--ui3n-button-custom-bg-color);
|
|
237
|
+
@include ripple(var(--ui3n-button-custom-bg-color));
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
&[disabled] {
|
|
241
|
+
opacity: 0.7;
|
|
242
|
+
pointer-events: none;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.withIcon-left {
|
|
247
|
+
flex-direction: row;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.withIcon-right {
|
|
251
|
+
flex-direction: row-reverse;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.buttonIcon,
|
|
255
|
+
.text {
|
|
256
|
+
pointer-events: none;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.elevation {
|
|
260
|
+
@include elevation();
|
|
261
|
+
}
|
|
172
262
|
</style>
|