@v1nt1248/3nclient-lib 0.1.1 → 0.1.3
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 +3 -0
- package/dist/components/index.d.ts +5 -4
- package/dist/components/ui3n-badge-simple.vue.d.ts +13 -13
- package/dist/components/ui3n-badge.vue.d.ts +18 -16
- package/dist/components/ui3n-breadcrumb.vue.d.ts +15 -13
- package/dist/components/ui3n-breadcrumbs.vue.d.ts +17 -15
- package/dist/components/ui3n-button.vue.d.ts +22 -19
- package/dist/components/ui3n-checkbox.vue.d.ts +17 -15
- package/dist/components/ui3n-chip.vue.d.ts +18 -16
- package/dist/components/ui3n-dialog.vue.d.ts +4 -5
- package/dist/components/ui3n-drop-files.vue.d.ts +16 -14
- package/dist/components/ui3n-emoji.vue.d.ts +11 -11
- package/dist/components/ui3n-icon.vue.d.ts +12 -12
- package/dist/components/ui3n-input.vue.d.ts +4 -4
- package/dist/components/ui3n-list.vue.d.ts +12 -39
- package/dist/components/ui3n-menu/types.d.ts +20 -0
- package/dist/components/{ui3n-menu.vue.d.ts → ui3n-menu/ui3n-menu.vue.d.ts} +18 -30
- package/dist/components/ui3n-notification.vue.d.ts +14 -15
- package/dist/components/ui3n-progress-circular.vue.d.ts +13 -13
- package/dist/components/ui3n-progress-linear.vue.d.ts +13 -13
- package/dist/components/ui3n-step-line-bar.vue.d.ts +11 -11
- package/dist/components/ui3n-switch.vue.d.ts +15 -13
- package/dist/components/ui3n-table/composables/useTable.d.ts +26 -0
- package/dist/components/ui3n-table/types.d.ts +65 -0
- package/dist/components/ui3n-table/ui3n-table.vue.d.ts +22 -0
- package/dist/components/ui3n-table-sort-icon.vue.d.ts +2 -2
- package/dist/components/ui3n-tabs.vue.d.ts +18 -16
- package/dist/components/ui3n-text.vue.d.ts +13 -13
- package/dist/components/ui3n-tooltip/types.d.ts +25 -0
- package/dist/components/ui3n-virtual-scroll.vue.d.ts +6 -28
- package/dist/directives/index.d.ts +0 -1
- package/dist/directives/ui3n-click-outside.d.ts +0 -1
- package/dist/directives/ui3n-html.d.ts +0 -1
- package/dist/index.d.ts +5 -2
- package/dist/plugins/dialogs.d.ts +0 -1
- package/dist/plugins/i18n.d.ts +0 -1
- package/dist/plugins/icons.d.ts +0 -1
- package/dist/plugins/index.d.ts +0 -1
- package/dist/plugins/notifications.d.ts +0 -1
- package/dist/plugins/store-dialogs.d.ts +0 -1
- package/dist/plugins/store-notifications.d.ts +0 -1
- package/dist/plugins/store-vue-bus.d.ts +0 -1
- package/dist/plugins/vue-bus.d.ts +0 -1
- package/dist/style.css +1 -1
- package/dist/tools/sqlite-on-3nstorage/index.d.ts +0 -1
- package/dist/tools/ui.helpers.d.ts +0 -1
- package/dist/ui-3n-lib.js +10769 -9919
- package/package.json +29 -27
- package/src/components/index.ts +36 -6
- package/src/components/ui3n-checkbox.vue +1 -1
- package/src/components/ui3n-dialog.vue +6 -1
- package/src/components/ui3n-menu/types.ts +23 -0
- package/src/components/ui3n-menu/ui3n-menu.vue +117 -0
- package/src/components/ui3n-table/composables/useTable.ts +206 -0
- package/src/components/ui3n-table/types.ts +80 -0
- package/src/components/ui3n-table/ui3n-table.vue +319 -0
- package/src/components/ui3n-table-sort-icon.vue +9 -6
- package/src/components/ui3n-tooltip/types.ts +41 -0
- package/src/components/ui3n-tooltip/ui3n-tooltip.vue +199 -0
- package/dist/components/ui3n-table.vue.d.ts +0 -36
- package/src/components/ui3n-menu.vue +0 -136
- /package/src/components/{ui3n-table.vue → ui3n-table-simple.vue} +0 -0
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
import { computed, onMounted, ref } from 'vue';
|
|
4
|
-
import { default as vClickOutside } from '../directives/ui3n-click-outside';
|
|
5
|
-
|
|
6
|
-
export interface Ui3nMenuProps {
|
|
7
|
-
offsetX?: number;
|
|
8
|
-
offsetY?: number;
|
|
9
|
-
closeOnClick?: boolean;
|
|
10
|
-
closeOnClickOutside?: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface Ui3nMenuEmits {
|
|
15
|
-
(ev: 'open'): void;
|
|
16
|
-
(ev: 'opened'): void;
|
|
17
|
-
(ev: 'close'): void;
|
|
18
|
-
(ev: 'closed'): void;
|
|
19
|
-
(ev: 'click-outside'): void;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface Ui3nMenuSlots {
|
|
23
|
-
default: () => any;
|
|
24
|
-
menu?: () => any;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const props = withDefaults(defineProps<Ui3nMenuProps>(), {
|
|
28
|
-
offsetX: 0,
|
|
29
|
-
offsetY: 0,
|
|
30
|
-
closeOnClick: true,
|
|
31
|
-
closeOnClickOutside: true,
|
|
32
|
-
disabled: false,
|
|
33
|
-
});
|
|
34
|
-
const emits = defineEmits<Ui3nMenuEmits>();
|
|
35
|
-
defineSlots<Ui3nMenuSlots>();
|
|
36
|
-
|
|
37
|
-
const menuElement = ref<HTMLDivElement | null>(null);
|
|
38
|
-
const menuTriggerElement = ref<HTMLDivElement | null>(null);
|
|
39
|
-
const isShow = ref(false);
|
|
40
|
-
const defaultAnimationDuration = 400;
|
|
41
|
-
const menuContentStyle = computed(() => {
|
|
42
|
-
if (!props.offsetX && !props.offsetY) {
|
|
43
|
-
return {};
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
...(props.offsetX && { left: `${props.offsetX}px` }),
|
|
47
|
-
...(props.offsetY && { top: `${menuTriggerElement.value!.clientHeight + props.offsetY}px` }),
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
onMounted(() => {
|
|
52
|
-
menuElement.value!.style.setProperty('--ui3n-menu-animation-duration', `${defaultAnimationDuration}ms`);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
function toggleMenu() {
|
|
56
|
-
isShow.value = !isShow.value;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function onContentClick() {
|
|
60
|
-
isShow.value = false;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function onClickOutside() {
|
|
64
|
-
emits('click-outside');
|
|
65
|
-
if (props.closeOnClickOutside) {
|
|
66
|
-
isShow.value = false;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
</script>
|
|
70
|
-
|
|
71
|
-
<template>
|
|
72
|
-
<div ref="menuElement" :class="$style.menu">
|
|
73
|
-
<div
|
|
74
|
-
ref="menuTriggerElement"
|
|
75
|
-
:class="$style.trigger"
|
|
76
|
-
@click.stop="toggleMenu"
|
|
77
|
-
>
|
|
78
|
-
<slot />
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
<transition
|
|
82
|
-
name="menu"
|
|
83
|
-
:duration="defaultAnimationDuration"
|
|
84
|
-
@before-enter="emits('open')"
|
|
85
|
-
@after-enter="emits('opened')"
|
|
86
|
-
@before-leave="emits('close')"
|
|
87
|
-
@after-leave="emits('closed')"
|
|
88
|
-
>
|
|
89
|
-
<div
|
|
90
|
-
v-if="isShow"
|
|
91
|
-
v-click-outside="onClickOutside"
|
|
92
|
-
:style="menuContentStyle"
|
|
93
|
-
:class="$style.content"
|
|
94
|
-
v-on="props.closeOnClick ? { click: onContentClick } : {}"
|
|
95
|
-
>
|
|
96
|
-
<slot name="menu" />
|
|
97
|
-
</div>
|
|
98
|
-
</transition>
|
|
99
|
-
</div>
|
|
100
|
-
</template>
|
|
101
|
-
|
|
102
|
-
<style lang="scss" module>
|
|
103
|
-
@import "../assets/styles/mixins";
|
|
104
|
-
|
|
105
|
-
.menu {
|
|
106
|
-
--ui3n-menu-animation-duration: 400ms;
|
|
107
|
-
--ui3n-menu-content-bg: var(--color-bg-control-secondary-default);
|
|
108
|
-
|
|
109
|
-
position: relative;
|
|
110
|
-
overflow: visible;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.trigger {
|
|
114
|
-
position: relative;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.content {
|
|
118
|
-
position: absolute;
|
|
119
|
-
border-radius: 4px;
|
|
120
|
-
background-color: var(--ui3n-menu-content-bg);
|
|
121
|
-
z-index: 1000;
|
|
122
|
-
@include elevation(3);
|
|
123
|
-
}
|
|
124
|
-
</style>
|
|
125
|
-
|
|
126
|
-
<style lang="scss" scoped>
|
|
127
|
-
.menu-enter-active,
|
|
128
|
-
.menu-leave-active {
|
|
129
|
-
transition: opacity var(--ui3n-menu-animation-duration);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.menu-enter-from,
|
|
133
|
-
.menu-leave-to {
|
|
134
|
-
opacity: 0;
|
|
135
|
-
}
|
|
136
|
-
</style>
|
|
File without changes
|