@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,133 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { onMounted } from 'vue';
|
|
3
|
+
import Ui3nIcon from './ui3n-icon.vue';
|
|
4
|
+
import Ui3nButton from './ui3n-button.vue';
|
|
5
|
+
import type { Ui3nNotificationProps } from '../constants';
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(
|
|
8
|
+
defineProps<Ui3nNotificationProps>(),
|
|
9
|
+
{
|
|
10
|
+
type: 'info',
|
|
11
|
+
position: 'center',
|
|
12
|
+
duration: 0,
|
|
13
|
+
withIcon: true,
|
|
14
|
+
onOpen: () => void (0),
|
|
15
|
+
onClose: () => void (0),
|
|
16
|
+
},
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const stylesByTypes = {
|
|
20
|
+
success: {
|
|
21
|
+
color: 'var(--success-content-default)',
|
|
22
|
+
icon: 'warning',
|
|
23
|
+
iconColor: 'var(--success-fill-default)',
|
|
24
|
+
iconRotate: 0,
|
|
25
|
+
},
|
|
26
|
+
warning: {
|
|
27
|
+
color: 'var(--warning-content-default)',
|
|
28
|
+
icon: 'warning',
|
|
29
|
+
iconColor: 'var(--warning-fill-default)',
|
|
30
|
+
iconRotate: 0,
|
|
31
|
+
},
|
|
32
|
+
info: {
|
|
33
|
+
color: 'var(--info-content-default)',
|
|
34
|
+
icon: 'info',
|
|
35
|
+
iconColor: 'var(--info-fill-default)',
|
|
36
|
+
iconRotate: 90,
|
|
37
|
+
},
|
|
38
|
+
error: {
|
|
39
|
+
color: 'var(--error-content-default)',
|
|
40
|
+
icon: 'info',
|
|
41
|
+
iconColor: 'var(--error-fill-default)',
|
|
42
|
+
iconRotate: 90,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
onMounted(() => {
|
|
47
|
+
if (props.duration > 500) {
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
props.onClose();
|
|
50
|
+
}, props.duration);
|
|
26
51
|
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const closeNotification = () => {
|
|
55
|
+
props.onClose();
|
|
56
|
+
};
|
|
27
57
|
</script>
|
|
28
58
|
|
|
29
59
|
<template>
|
|
30
60
|
<div
|
|
31
|
-
:id="
|
|
32
|
-
:class="[
|
|
33
|
-
'ui3n-notification',
|
|
34
|
-
`ui3n-notification--${params.type}`,
|
|
35
|
-
`ui3n-notification--${params.position}`,
|
|
36
|
-
{
|
|
37
|
-
'ui3n-notification--with-icon': params.icon,
|
|
38
|
-
},
|
|
39
|
-
]"
|
|
61
|
+
:id="id"
|
|
62
|
+
:class="[$style.notification, $style[`${type}Type`], $style[`${position}Position`], withIcon && $style.withIcon]"
|
|
40
63
|
>
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
64
|
+
<div v-if="withIcon" :class="$style.icon">
|
|
65
|
+
<ui3n-icon
|
|
66
|
+
:icon="stylesByTypes[type].icon"
|
|
67
|
+
width="16"
|
|
68
|
+
height="16"
|
|
69
|
+
:rotate="stylesByTypes[type].iconRotate"
|
|
70
|
+
:color="stylesByTypes[type].iconColor"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
48
73
|
|
|
49
|
-
|
|
50
|
-
|
|
74
|
+
|
|
75
|
+
<div :class="$style.content">
|
|
76
|
+
{{ content }}
|
|
51
77
|
</div>
|
|
52
78
|
|
|
53
79
|
<ui3n-button
|
|
54
80
|
v-if="!props.duration"
|
|
55
|
-
|
|
81
|
+
type="icon"
|
|
82
|
+
size="small"
|
|
56
83
|
color="transparent"
|
|
57
84
|
icon="close"
|
|
58
|
-
icon-
|
|
59
|
-
|
|
60
|
-
class="ui3n-notification__close"
|
|
85
|
+
:icon-color="stylesByTypes[type].color"
|
|
86
|
+
:class="$style.closeBtn"
|
|
61
87
|
@click="closeNotification"
|
|
62
88
|
/>
|
|
63
89
|
</div>
|
|
64
90
|
</template>
|
|
65
91
|
|
|
66
|
-
<style lang="scss"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
92
|
+
<style lang="scss" module>
|
|
93
|
+
.notification {
|
|
94
|
+
--ui3n-notification-width: 380px;
|
|
95
|
+
|
|
96
|
+
display: flex;
|
|
97
|
+
position: relative;
|
|
98
|
+
z-index: 5000;
|
|
99
|
+
border-radius: var(--spacing-s);
|
|
100
|
+
outline: 1px solid var(--color-border-control-tritery-default);
|
|
101
|
+
padding: var(--spacing-m);
|
|
102
|
+
max-width: var(--ui3n-notification-width);
|
|
103
|
+
margin-bottom: var(--spacing-s);
|
|
104
|
+
justify-content: center;
|
|
105
|
+
align-items: center;
|
|
106
|
+
gap: var(--spacing-s);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.withIcon {
|
|
110
|
+
justify-content: flex-start;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.icon {
|
|
114
|
+
position: relative;
|
|
115
|
+
min-width: var(--spacing-l);
|
|
116
|
+
width: var(--spacing-l);
|
|
117
|
+
min-height: var(--spacing-l);
|
|
118
|
+
height: var(--spacing-l);
|
|
119
|
+
border-radius: 50%;
|
|
120
|
+
display: flex;
|
|
121
|
+
justify-content: center;
|
|
122
|
+
align-items: center;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.content {
|
|
126
|
+
position: relative;
|
|
127
|
+
flex-grow: 2;
|
|
128
|
+
font-size: var(--font-12);
|
|
129
|
+
font-weight: 500;
|
|
130
|
+
line-height: var(--font-16);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.closeBtn {
|
|
134
|
+
position: absolute;
|
|
135
|
+
z-index: 1;
|
|
136
|
+
top: 0;
|
|
137
|
+
right: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.infoType {
|
|
141
|
+
background-color: var(--info-fill-default);
|
|
142
|
+
|
|
143
|
+
.icon {
|
|
144
|
+
background-color: var(--info-content-default);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.content {
|
|
148
|
+
color: var(--info-content-default);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.successType {
|
|
153
|
+
background-color: var(--success-fill-default);
|
|
154
|
+
|
|
155
|
+
.icon {
|
|
156
|
+
background-color: var(--success-content-default);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.content {
|
|
160
|
+
color: var(--success-content-default);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.warningType {
|
|
165
|
+
background-color: var(--warning-fill-default);
|
|
166
|
+
|
|
167
|
+
.icon {
|
|
168
|
+
background-color: var(--warning-content-default);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.content {
|
|
172
|
+
color: var(--warning-content-default);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.errorType {
|
|
177
|
+
background-color: var(--error-fill-default);
|
|
178
|
+
|
|
179
|
+
.icon {
|
|
180
|
+
background-color: var(--error-content-default);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.content {
|
|
184
|
+
color: var(--error-content-default);
|
|
132
185
|
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.leftPosition {
|
|
189
|
+
margin-left: 0;
|
|
190
|
+
margin-right: auto;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.centerPosition {
|
|
194
|
+
margin-left: auto;
|
|
195
|
+
margin-right: auto;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.rightPosition {
|
|
199
|
+
margin-left: auto;
|
|
200
|
+
margin-right: 0;
|
|
201
|
+
}
|
|
133
202
|
</style>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { onMounted, ref, watch, useSlots } from 'vue';
|
|
3
|
+
|
|
4
|
+
export interface Ui3nSwitchProps {
|
|
5
|
+
modelValue: boolean;
|
|
6
|
+
size?: number | string;
|
|
7
|
+
color?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface Ui3nSwitchEmits {
|
|
12
|
+
(ev: 'change', value: boolean): void;
|
|
13
|
+
(ev: 'update:modelValue', value: boolean): void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface Ui3nSwitchSlots {
|
|
17
|
+
default: () => any;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const props = withDefaults(
|
|
21
|
+
defineProps<Ui3nSwitchProps>(),
|
|
22
|
+
{
|
|
23
|
+
size: 16,
|
|
24
|
+
color: 'var(--color-icon-control-accent-default)',
|
|
25
|
+
disabled: false,
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const emits = defineEmits<Ui3nSwitchEmits>();
|
|
30
|
+
|
|
31
|
+
defineSlots<Ui3nSwitchSlots>();
|
|
32
|
+
|
|
33
|
+
const slots = useSlots();
|
|
34
|
+
const switchEl = ref<HTMLDivElement | null>(null);
|
|
35
|
+
const val = ref<boolean>(false);
|
|
36
|
+
|
|
37
|
+
onMounted(() => {
|
|
38
|
+
if (switchEl.value) {
|
|
39
|
+
switchEl.value.style.setProperty('--ui3n-switch-color', `${props.color}`);
|
|
40
|
+
props.size && switchEl.value.style.setProperty('--ui3n-switch-size', `${props.size}px`);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
watch(
|
|
45
|
+
() => props.modelValue,
|
|
46
|
+
newValue => val.value = newValue,
|
|
47
|
+
{ immediate: true },
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
function change() {
|
|
51
|
+
val.value = !val.value;
|
|
52
|
+
emits('change', val.value);
|
|
53
|
+
emits('update:modelValue', val.value);
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<template>
|
|
58
|
+
<div
|
|
59
|
+
ref="switchEl"
|
|
60
|
+
:class="[$style.switch, val && $style.checked, !slots.default && $style.noLabel, disabled && $style.disabled]"
|
|
61
|
+
>
|
|
62
|
+
<Transition>
|
|
63
|
+
<div :class="$style.body" @click="change">
|
|
64
|
+
<div :class="[$style.dot, val ? $style.right : $style.left]" />
|
|
65
|
+
</div>
|
|
66
|
+
</Transition>
|
|
67
|
+
|
|
68
|
+
<div :class="$style.label">
|
|
69
|
+
<slot />
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<style lang="scss" module>
|
|
75
|
+
.switch {
|
|
76
|
+
--ui3n-switch-size: 16px;
|
|
77
|
+
--ui3n-switch-color: var(--color-icon-control-accent-default);
|
|
78
|
+
--ui3n-switch-off-color: var(--color-bg-table-cell-pressed);
|
|
79
|
+
--ui3n-switch-font-size: 12px;
|
|
80
|
+
--ui3n-switch-font-color: var(--color-text-control-primary-default);
|
|
81
|
+
--ui3n-switch-font-weight: 500;
|
|
82
|
+
|
|
83
|
+
position: relative;
|
|
84
|
+
display: flex;
|
|
85
|
+
justify-content: flex-start;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: var(--spacing-s);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.body {
|
|
91
|
+
position: relative;
|
|
92
|
+
background-color: var(--ui3n-switch-off-color);
|
|
93
|
+
height: var(--ui3n-switch-size);
|
|
94
|
+
width: calc(var(--ui3n-switch-size) * 2);
|
|
95
|
+
border-radius: var(--ui3n-switch-size);
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.checked {
|
|
100
|
+
.body {
|
|
101
|
+
background-color: var(--ui3n-switch-color);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.dot {
|
|
105
|
+
border-color: var(--ui3n-switch-color);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.noLabel {
|
|
110
|
+
gap: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.dot {
|
|
114
|
+
--ui3n-switch-dot-size: calc(var(--ui3n-switch-size) / 4 * 3);
|
|
115
|
+
|
|
116
|
+
position: absolute;
|
|
117
|
+
width: var(--ui3n-switch-dot-size);
|
|
118
|
+
height: var(--ui3n-switch-dot-size);
|
|
119
|
+
border-radius: 50%;
|
|
120
|
+
background-color: var(--white-0);
|
|
121
|
+
top: 0;
|
|
122
|
+
margin: calc(var(--ui3n-switch-size) / 8);
|
|
123
|
+
transition: all 250ms ease-in-out;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.left {
|
|
127
|
+
left: 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.right {
|
|
131
|
+
left: calc(100% - var(--ui3n-switch-size));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.label {
|
|
135
|
+
font-size: var(--ui3n-switch-font-size);
|
|
136
|
+
font-weight: var(--ui3n-switch-font-weight);
|
|
137
|
+
color: var(--ui3n-switch-font-color);
|
|
138
|
+
user-select: none;
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.disabled {
|
|
143
|
+
opacity: 0.7;
|
|
144
|
+
pointer-events: none;
|
|
145
|
+
}
|
|
146
|
+
</style>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
const props = defineProps<Ui3nTableSortIconProps>()
|
|
12
12
|
|
|
13
13
|
const iconSize = computed(() => props.size ? +props.size : 16)
|
|
14
|
-
const iconColor = computed(() => props.color || 'var(--
|
|
14
|
+
const iconColor = computed(() => props.color || 'var(--color-icon-table-primary-default)')
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<template>
|
|
@@ -20,6 +20,5 @@
|
|
|
20
20
|
:width="iconSize"
|
|
21
21
|
:height="iconSize"
|
|
22
22
|
:color="iconColor"
|
|
23
|
-
class="ui3n-table-sort-icon"
|
|
24
23
|
/>
|
|
25
24
|
</template>
|