@v1nt1248/3nclient-lib 0.0.42 → 0.1.1
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 +7 -4
- package/dist/components/index.d.ts +23 -19
- package/dist/components/ui3n-badge-simple.vue.d.ts +2 -2
- package/dist/components/ui3n-badge.vue.d.ts +1 -1
- 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 +30 -4
- package/dist/components/ui3n-checkbox.vue.d.ts +2 -2
- package/dist/components/ui3n-chip.vue.d.ts +2 -2
- package/dist/components/ui3n-dialog.vue.d.ts +4 -4
- package/dist/components/ui3n-drop-files.vue.d.ts +23 -3
- package/dist/components/ui3n-emoji.vue.d.ts +2 -2
- package/dist/components/ui3n-icon.vue.d.ts +29 -3
- package/dist/components/ui3n-input.vue.d.ts +18 -11
- package/dist/components/ui3n-list.vue.d.ts +1 -1
- package/dist/components/ui3n-menu.vue.d.ts +2 -2
- package/dist/components/ui3n-notification.vue.d.ts +30 -1
- package/dist/components/ui3n-progress-circular.vue.d.ts +43 -0
- package/dist/components/ui3n-progress-linear.vue.d.ts +42 -0
- package/dist/components/ui3n-step-line-bar.vue.d.ts +30 -0
- 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 +2 -2
- package/dist/components/ui3n-tabs.vue.d.ts +2 -2
- package/dist/components/ui3n-text.vue.d.ts +29 -3
- package/dist/components/ui3n-virtual-scroll.vue.d.ts +9 -6
- package/dist/constants/types.d.ts +2 -4
- package/dist/directives/index.d.ts +1 -1
- package/dist/index.d.ts +31 -27
- package/dist/plugins/dialogs.d.ts +1 -1
- package/dist/plugins/index.d.ts +8 -8
- package/dist/plugins/notifications.d.ts +1 -1
- package/dist/plugins/vue-bus.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/tools/sqlite-on-3nstorage/index.d.ts +3 -3
- package/dist/ui-3n-lib.js +7273 -6748
- package/package.json +58 -59
- package/src/components/index.ts +59 -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 +246 -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 +283 -215
- 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-progress-circular.vue +188 -0
- package/src/components/ui3n-progress-linear.vue +119 -0
- package/src/components/ui3n-step-line-bar.vue +66 -0
- package/src/components/ui3n-switch.vue +146 -0
- package/src/components/ui3n-table-sort-icon.vue +1 -2
- package/src/components/ui3n-table.vue +233 -228
- 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
|
@@ -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>
|