@v1nt1248/3nclient-lib 0.1.6 → 0.1.8
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/dist/components/index.d.ts +40 -23
- package/dist/components/ui3n-badge/types.d.ts +13 -0
- package/dist/components/{ui3n-badge-simple.vue.d.ts → ui3n-badge/ui3n-badge-simple.vue.d.ts} +1 -6
- package/dist/components/{ui3n-badge.vue.d.ts → ui3n-badge/ui3n-badge.vue.d.ts} +1 -7
- package/dist/components/ui3n-breadcrumbs/types.d.ts +17 -0
- package/dist/components/{ui3n-breadcrumb.vue.d.ts → ui3n-breadcrumbs/ui3n-breadcrumb.vue.d.ts} +1 -12
- package/dist/components/{ui3n-breadcrumbs.vue.d.ts → ui3n-breadcrumbs/ui3n-breadcrumbs.vue.d.ts} +1 -4
- package/dist/components/ui3n-button/types.d.ts +19 -0
- package/dist/components/{ui3n-button.vue.d.ts → ui3n-button/ui3n-button.vue.d.ts} +1 -19
- package/dist/components/ui3n-checkbox/types.d.ts +18 -0
- package/dist/components/{ui3n-checkbox.vue.d.ts → ui3n-checkbox/ui3n-checkbox.vue.d.ts} +1 -17
- package/dist/components/ui3n-chip/types.d.ts +21 -0
- package/dist/components/{ui3n-chip.vue.d.ts → ui3n-chip/ui3n-chip.vue.d.ts} +1 -20
- package/dist/components/ui3n-dialog/types.d.ts +36 -0
- package/dist/components/{ui3n-dialog.vue.d.ts → ui3n-dialog/ui3n-dialog.vue.d.ts} +1 -36
- package/dist/components/ui3n-drop-files/types.d.ts +12 -0
- package/dist/components/{ui3n-drop-files.vue.d.ts → ui3n-drop-files/ui3n-drop-files.vue.d.ts} +2 -11
- package/dist/components/ui3n-emoji/types.d.ts +8 -0
- package/dist/components/{ui3n-emoji.vue.d.ts → ui3n-emoji/ui3n-emoji.vue.d.ts} +1 -8
- package/dist/components/ui3n-icon/types.d.ts +16 -0
- package/dist/components/{ui3n-icon.vue.d.ts → ui3n-icon/ui3n-icon.vue.d.ts} +1 -16
- package/dist/components/ui3n-input/types.d.ts +25 -0
- package/dist/components/{ui3n-input.vue.d.ts → ui3n-input/ui3n-input.vue.d.ts} +1 -25
- package/dist/components/ui3n-list/types.d.ts +20 -0
- package/dist/components/{ui3n-list.vue.d.ts → ui3n-list/ui3n-list.vue.d.ts} +1 -19
- package/dist/components/ui3n-notification/types.d.ts +11 -0
- package/dist/components/{ui3n-notification.vue.d.ts → ui3n-notification/ui3n-notification.vue.d.ts} +1 -1
- package/dist/components/ui3n-progress/types.d.ts +17 -0
- package/dist/components/{ui3n-progress-circular.vue.d.ts → ui3n-progress/ui3n-progress-circular.vue.d.ts} +1 -9
- package/dist/components/{ui3n-progress-linear.vue.d.ts → ui3n-progress/ui3n-progress-linear.vue.d.ts} +1 -8
- package/dist/components/ui3n-step-line-bar/types.d.ts +5 -0
- package/dist/components/{ui3n-step-line-bar.vue.d.ts → ui3n-step-line-bar/ui3n-step-line-bar.vue.d.ts} +1 -5
- package/dist/components/ui3n-switch/types.d.ts +14 -0
- package/dist/components/{ui3n-switch.vue.d.ts → ui3n-switch/ui3n-switch.vue.d.ts} +1 -13
- package/dist/components/ui3n-table/composables/useTable.d.ts +1 -1
- package/dist/components/ui3n-table/types.d.ts +5 -0
- package/dist/components/{ui3n-table-sort-icon.vue.d.ts → ui3n-table/ui3n-table-sort-icon.vue.d.ts} +1 -5
- package/dist/components/ui3n-tabs/types.d.ts +16 -0
- package/dist/components/{ui3n-tabs.vue.d.ts → ui3n-tabs/ui3n-tabs.vue.d.ts} +2 -18
- package/dist/components/ui3n-text/types.d.ts +17 -0
- package/dist/components/{ui3n-text.vue.d.ts → ui3n-text/ui3n-text.vue.d.ts} +1 -17
- package/dist/components/ui3n-virtual-scroll/types.d.ts +12 -0
- package/dist/components/{ui3n-virtual-scroll.vue.d.ts → ui3n-virtual-scroll/ui3n-virtual-scroll.vue.d.ts} +1 -11
- package/dist/constants/index.d.ts +0 -1
- package/dist/index.d.ts +26 -24
- package/dist/plugins/dialogs/dialogs.d.ts +9 -0
- package/dist/plugins/{store-dialogs.d.ts → dialogs/store-dialogs.d.ts} +1 -1
- package/dist/plugins/dialogs/types.d.ts +12 -0
- package/dist/plugins/i18n/i18n.d.ts +9 -0
- package/dist/plugins/{i18n.d.ts → i18n/types.d.ts} +1 -9
- package/dist/plugins/index.d.ts +13 -9
- package/dist/plugins/notifications/notifications.d.ts +8 -0
- package/dist/plugins/{store-notifications.d.ts → notifications/store-notifications.d.ts} +1 -1
- package/dist/plugins/notifications/types.d.ts +6 -0
- package/dist/plugins/{store-vue-bus.d.ts → vue-bus/store-vue-bus.d.ts} +1 -1
- package/dist/plugins/vue-bus/types.d.ts +13 -0
- package/dist/plugins/{vue-bus.d.ts → vue-bus/vue-bus.d.ts} +2 -6
- package/dist/style.css +1 -0
- package/dist/{components.d.ts → ui3n-components.d.ts} +21 -21
- package/dist/ui3n-components.js +16394 -0
- package/dist/ui3n-plugins.d.ts +44 -0
- package/dist/ui3n-plugins.js +5678 -0
- package/dist/{utils.d.ts → ui3n-utils.d.ts} +1 -1
- package/dist/{tools → utils}/index.d.ts +2 -2
- package/package.json +9 -10
- package/src/components/index.ts +46 -41
- package/src/components/ui3n-badge/types.ts +14 -0
- package/src/components/{ui3n-badge-simple.vue → ui3n-badge/ui3n-badge-simple.vue} +29 -35
- package/src/components/ui3n-badge/ui3n-badge.vue +82 -0
- package/src/components/ui3n-breadcrumbs/types.ts +21 -0
- package/src/components/{ui3n-breadcrumb.vue → ui3n-breadcrumbs/ui3n-breadcrumb.vue} +1 -14
- package/src/components/{ui3n-breadcrumbs.vue → ui3n-breadcrumbs/ui3n-breadcrumbs.vue} +1 -4
- package/src/components/ui3n-button/types.ts +20 -0
- package/src/components/{ui3n-button.vue → ui3n-button/ui3n-button.vue} +3 -23
- package/src/components/ui3n-checkbox/types.ts +22 -0
- package/src/components/{ui3n-checkbox.vue → ui3n-checkbox/ui3n-checkbox.vue} +2 -23
- package/src/components/ui3n-chip/types.ts +19 -0
- package/src/components/{ui3n-chip.vue → ui3n-chip/ui3n-chip.vue} +32 -50
- package/src/components/ui3n-dialog/types.ts +40 -0
- package/src/components/{ui3n-dialog.vue → ui3n-dialog/ui3n-dialog.vue} +3 -49
- package/src/components/ui3n-drop-files/types.ts +15 -0
- package/src/components/{ui3n-drop-files.vue → ui3n-drop-files/ui3n-drop-files.vue} +2 -10
- package/src/components/ui3n-emoji/types.ts +9 -0
- package/src/components/{ui3n-emoji.vue → ui3n-emoji/ui3n-emoji.vue} +2 -11
- package/src/components/ui3n-icon/types.ts +17 -0
- package/src/components/ui3n-icon/ui3n-icon.vue +53 -0
- package/src/components/ui3n-input/types.ts +26 -0
- package/src/components/{ui3n-input.vue → ui3n-input/ui3n-input.vue} +4 -30
- package/src/components/ui3n-list/types.ts +17 -0
- package/src/components/{ui3n-list.vue → ui3n-list/ui3n-list.vue} +1 -16
- package/src/components/ui3n-notification/types.ts +11 -0
- package/src/components/{ui3n-notification.vue → ui3n-notification/ui3n-notification.vue} +3 -3
- package/src/components/ui3n-progress/types.ts +18 -0
- package/src/components/{ui3n-progress-circular.vue → ui3n-progress/ui3n-progress-circular.vue} +1 -10
- package/src/components/{ui3n-progress-linear.vue → ui3n-progress/ui3n-progress-linear.vue} +1 -9
- package/src/components/ui3n-step-line-bar/types.ts +5 -0
- package/src/components/{ui3n-step-line-bar.vue → ui3n-step-line-bar/ui3n-step-line-bar.vue} +1 -5
- package/src/components/ui3n-switch/types.ts +17 -0
- package/src/components/{ui3n-switch.vue → ui3n-switch/ui3n-switch.vue} +1 -16
- package/src/components/ui3n-table/composables/useTable.ts +1 -1
- package/src/components/ui3n-table/types.ts +6 -0
- package/src/components/{ui3n-table-sort-icon.vue → ui3n-table/ui3n-table-sort-icon.vue} +2 -7
- package/src/components/ui3n-table/ui3n-table.vue +3 -3
- package/src/components/ui3n-tabs/types.ts +19 -0
- package/src/components/{ui3n-tabs.vue → ui3n-tabs/ui3n-tabs.vue} +3 -20
- package/src/components/ui3n-text/types.ts +18 -0
- package/src/components/{ui3n-text.vue → ui3n-text/ui3n-text.vue} +2 -21
- package/src/components/ui3n-virtual-scroll/types.ts +11 -0
- package/src/components/{ui3n-virtual-scroll.vue → ui3n-virtual-scroll/ui3n-virtual-scroll.vue} +1 -11
- package/dist/constants/types.d.ts +0 -29
- package/dist/plugins/dialogs.d.ts +0 -18
- package/dist/plugins/notifications.d.ts +0 -12
- package/dist/plugins.d.ts +0 -32
- package/dist/plugins.js +0 -1
- package/dist/ui-3n-lib.js +0 -5252
- package/src/components/ui3n-badge.vue +0 -89
- package/src/components/ui3n-icon.vue +0 -70
- package/src/components/ui3n-table-simple.vue +0 -328
- /package/dist/plugins/{store-i18n.d.ts → i18n/store-i18n.d.ts} +0 -0
- /package/dist/plugins/{icons.d.ts → icons/icons.d.ts} +0 -0
- /package/dist/{utils.js → ui3n-utils.js} +0 -0
- /package/dist/{tools/common.helpers.d.ts → utils/common.utils.d.ts} +0 -0
- /package/dist/{tools → utils}/sqlite-on-3nstorage/deferred.d.ts +0 -0
- /package/dist/{tools → utils}/sqlite-on-3nstorage/index.d.ts +0 -0
- /package/dist/{tools → utils}/sqlite-on-3nstorage/synced.d.ts +0 -0
- /package/dist/{tools → utils}/sqlite-on-3nstorage/types.d.ts +0 -0
- /package/dist/{tools → utils}/textarea-max-rows.d.ts +0 -0
- /package/dist/{tools/ui.helpers.d.ts → utils/ui.utils.d.ts} +0 -0
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed, ref, useSlots } from 'vue';
|
|
3
|
-
import get from 'lodash/get';
|
|
4
|
-
import Ui3nBadgeSimple from './ui3n-badge-simple.vue';
|
|
5
|
-
|
|
6
|
-
export interface Ui3nBadgeProps {
|
|
7
|
-
dot?: boolean;
|
|
8
|
-
value?: string | number;
|
|
9
|
-
color?: string;
|
|
10
|
-
textColor?: string;
|
|
11
|
-
position?: 'right-top' | 'right-bottom' | 'left-top' | 'left-bottom';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const props = withDefaults(
|
|
15
|
-
defineProps<Ui3nBadgeProps>(),
|
|
16
|
-
{
|
|
17
|
-
dot: false,
|
|
18
|
-
value: '',
|
|
19
|
-
color: 'var(--color-bg-button-primary-default)',
|
|
20
|
-
textColor: 'var(--color-text-button-primary-default)',
|
|
21
|
-
position: 'right-top',
|
|
22
|
-
},
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
const slots = useSlots()
|
|
26
|
-
const badgeElementSize = ref<{
|
|
27
|
-
width: number;
|
|
28
|
-
height: number;
|
|
29
|
-
} | never>();
|
|
30
|
-
|
|
31
|
-
const hasDefaultSlot = computed(() => !!slots.default);
|
|
32
|
-
const style = computed(() => {
|
|
33
|
-
const [xPosition, yPosition] = props.position.split('-')
|
|
34
|
-
return {
|
|
35
|
-
...(xPosition === 'right' && { right: `-${get(badgeElementSize.value, 'width', 0) / 2}px` }),
|
|
36
|
-
...(xPosition === 'left' && { left: `-${get(badgeElementSize.value, 'width', 0) / 2}px` }),
|
|
37
|
-
...(yPosition === 'top' && { top: `-${get(badgeElementSize.value, 'height', 0) / 2}px` }),
|
|
38
|
-
...(yPosition === 'bottom' && { bottom: `-${get(badgeElementSize.value, 'height', 0) / 2}px` }),
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
<template>
|
|
44
|
-
<!-- eslint-disable vue/no-multiple-template-root -->
|
|
45
|
-
<div
|
|
46
|
-
v-if="hasDefaultSlot"
|
|
47
|
-
:class="$style.badge"
|
|
48
|
-
>
|
|
49
|
-
<div :class="$style.wrapper">
|
|
50
|
-
<slot />
|
|
51
|
-
|
|
52
|
-
<ui3n-badge-simple
|
|
53
|
-
:dot="dot"
|
|
54
|
-
:value="value"
|
|
55
|
-
:color="color"
|
|
56
|
-
:text-color="textColor"
|
|
57
|
-
:style="style"
|
|
58
|
-
:class="$style.content"
|
|
59
|
-
@change:size="badgeElementSize = $event"
|
|
60
|
-
/>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
<ui3n-badge-simple
|
|
65
|
-
v-else
|
|
66
|
-
:dot="dot"
|
|
67
|
-
:value="value"
|
|
68
|
-
:color="color"
|
|
69
|
-
:text-color="textColor"
|
|
70
|
-
/>
|
|
71
|
-
</template>
|
|
72
|
-
|
|
73
|
-
<style lang="scss" module>
|
|
74
|
-
.badge {
|
|
75
|
-
--ui3n-badge-size: 20px;
|
|
76
|
-
|
|
77
|
-
position: relative;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.wrapper {
|
|
81
|
-
position: relative;
|
|
82
|
-
width: max-content;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.content {
|
|
86
|
-
position: absolute;
|
|
87
|
-
z-index: 5;
|
|
88
|
-
}
|
|
89
|
-
</style>
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
import { Icon } from '@iconify/vue'
|
|
4
|
-
|
|
5
|
-
export interface Ui3nIconProps {
|
|
6
|
-
icon: string;
|
|
7
|
-
title?: string;
|
|
8
|
-
inline?: boolean;
|
|
9
|
-
width?: string | number;
|
|
10
|
-
height?: string | number;
|
|
11
|
-
horizontalFlip?: boolean;
|
|
12
|
-
verticalFlip?: boolean;
|
|
13
|
-
flip?: string;
|
|
14
|
-
rotate?: number;
|
|
15
|
-
color?: string;
|
|
16
|
-
onLoad?: Function;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface Ui3nIconEmits {
|
|
20
|
-
(ev: 'click', value: Event): void;
|
|
21
|
-
}
|
|
22
|
-
|
|
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>()
|
|
34
|
-
|
|
35
|
-
const onLoad = (value: any) => {
|
|
36
|
-
if (props.onLoad) {
|
|
37
|
-
props.onLoad(value)
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const onClick = (ev: Event) => {
|
|
41
|
-
emits('click', ev)
|
|
42
|
-
}
|
|
43
|
-
</script>
|
|
44
|
-
|
|
45
|
-
<template>
|
|
46
|
-
<icon
|
|
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"
|
|
58
|
-
:on-load="onLoad"
|
|
59
|
-
@click="onClick"
|
|
60
|
-
/>
|
|
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>
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed, ref } from 'vue';
|
|
3
|
-
import { Icon } from '@iconify/vue';
|
|
4
|
-
import Ui3nTableSortIcon from './ui3n-table-sort-icon.vue';
|
|
5
|
-
import type { ListingEntryTypeExtended, EntityAction, SortField } from '../constants';
|
|
6
|
-
|
|
7
|
-
export interface Ui3nTableProps {
|
|
8
|
-
items: ListingEntryTypeExtended[];
|
|
9
|
-
textIfEmpty?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface Ui3nTableEmits {
|
|
13
|
-
(ev: 'go', name: string): void;
|
|
14
|
-
(ev: 'action', value: { action: EntityAction, entity: ListingEntryTypeExtended }): void;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const props = defineProps<Ui3nTableProps>();
|
|
18
|
-
const emits = defineEmits<Ui3nTableEmits>();
|
|
19
|
-
|
|
20
|
-
const sortField = ref<SortField>('name');
|
|
21
|
-
const sortDirection = ref<'asc' | 'desc'>('asc');
|
|
22
|
-
|
|
23
|
-
const sortByName = (itemA: ListingEntryTypeExtended, itemB: ListingEntryTypeExtended) => {
|
|
24
|
-
if (sortDirection.value === 'desc') {
|
|
25
|
-
return itemA.name < itemB.name ? 1 : -1;
|
|
26
|
-
}
|
|
27
|
-
return itemA.name > itemB.name ? 1 : -1;
|
|
28
|
-
};
|
|
29
|
-
const sortByType = (itemA: ListingEntryTypeExtended, itemB: ListingEntryTypeExtended) => {
|
|
30
|
-
if (sortDirection.value === 'desc') {
|
|
31
|
-
return itemA.type! < itemB.type! ? 1 : -1;
|
|
32
|
-
}
|
|
33
|
-
return itemA.type! > itemB.type! ? 1 : -1;
|
|
34
|
-
};
|
|
35
|
-
const sortByCreatedAt = (itemA: ListingEntryTypeExtended, itemB: ListingEntryTypeExtended) => {
|
|
36
|
-
const tsA = itemA.ctime!.getTime();
|
|
37
|
-
const tsB = itemB.ctime!.getTime();
|
|
38
|
-
return sortDirection.value === 'asc' ? tsA - tsB : tsB - tsA;
|
|
39
|
-
};
|
|
40
|
-
const sortByChangedAt = (itemA: ListingEntryTypeExtended, itemB: ListingEntryTypeExtended) => {
|
|
41
|
-
const tsA = itemA.mtime!.getTime();
|
|
42
|
-
const tsB = itemB.mtime!.getTime();
|
|
43
|
-
return sortDirection.value === 'asc' ? tsA - tsB : tsB - tsA;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const placeholder = computed(() => props.textIfEmpty || 'Empty');
|
|
47
|
-
const sortMap = {
|
|
48
|
-
name: sortByName,
|
|
49
|
-
type: sortByType,
|
|
50
|
-
createdAt: sortByCreatedAt,
|
|
51
|
-
changedAt: sortByChangedAt,
|
|
52
|
-
};
|
|
53
|
-
const sortedItems = computed(() => [...props.items].sort(sortMap[sortField.value]));
|
|
54
|
-
const changeSort = (field: SortField) => {
|
|
55
|
-
if (field !== sortField.value) {
|
|
56
|
-
sortField.value = field;
|
|
57
|
-
sortDirection.value = 'asc';
|
|
58
|
-
} else {
|
|
59
|
-
sortDirection.value = sortDirection.value === 'asc' ? 'desc' : 'asc';
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const getTimeAsString = (date: Date) => {
|
|
64
|
-
return date
|
|
65
|
-
? `${`${date.getDate()}`.padStart(2, '0')}/${`${date.getMonth() + 1}`.padStart(2, '0')}/${date.getFullYear()} ${`${date.getHours()}`.padStart(2, '0')}:${`${date.getMinutes()}`.padStart(2, '0')}`
|
|
66
|
-
: '';
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const handleClick = (ev: MouseEvent) => {
|
|
70
|
-
ev.preventDefault();
|
|
71
|
-
const { target } = ev;
|
|
72
|
-
const { id, classList } = target as Element;
|
|
73
|
-
if (classList.contains('ui3n-table__item') && id) {
|
|
74
|
-
return props.items.find(i => i.id === id);
|
|
75
|
-
}
|
|
76
|
-
return undefined;
|
|
77
|
-
};
|
|
78
|
-
const onClick = (ev: MouseEvent) => {
|
|
79
|
-
handleClick(ev);
|
|
80
|
-
const entity = handleClick(ev);
|
|
81
|
-
if (entity && entity.isFolder && entity.fullPath) {
|
|
82
|
-
emits('go', entity.fullPath);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
const onRightClick = (ev: MouseEvent) => {
|
|
86
|
-
handleClick(ev);
|
|
87
|
-
const entity = handleClick(ev);
|
|
88
|
-
if (entity) {
|
|
89
|
-
emits('action', { action: 'open:menu', entity });
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const handleActions = (ev: MouseEvent, action: EntityAction, entity: ListingEntryTypeExtended) => {
|
|
94
|
-
ev.preventDefault();
|
|
95
|
-
ev.stopImmediatePropagation();
|
|
96
|
-
emits('action', { action, entity });
|
|
97
|
-
};
|
|
98
|
-
</script>
|
|
99
|
-
|
|
100
|
-
<template>
|
|
101
|
-
<div :class="$style.table">
|
|
102
|
-
<div :class="$style.header">
|
|
103
|
-
<div
|
|
104
|
-
:class="[$style.cellHeader, $style.cellHeaderSortable, $style.columnName]"
|
|
105
|
-
@click="changeSort('name')"
|
|
106
|
-
>
|
|
107
|
-
<span :class="$style.cellHeaderText">Name</span>
|
|
108
|
-
<ui3n-table-sort-icon
|
|
109
|
-
v-if="sortField === 'name'"
|
|
110
|
-
:value="sortDirection"
|
|
111
|
-
:size="18"
|
|
112
|
-
/>
|
|
113
|
-
</div>
|
|
114
|
-
<div
|
|
115
|
-
:class="[$style.cellHeader, $style.cellHeaderSortable, $style.columnType]"
|
|
116
|
-
@click="changeSort('type')"
|
|
117
|
-
>
|
|
118
|
-
<span :class="$style.cellHeaderText">Type</span>
|
|
119
|
-
<ui3n-table-sort-icon
|
|
120
|
-
v-if="sortField === 'type'"
|
|
121
|
-
:value="sortDirection"
|
|
122
|
-
:size="18"
|
|
123
|
-
/>
|
|
124
|
-
</div>
|
|
125
|
-
|
|
126
|
-
<div
|
|
127
|
-
:class="[$style.cellHeader, $style.cellHeaderSortable, $style.columnChangeAt]"
|
|
128
|
-
@click="changeSort('changedAt')"
|
|
129
|
-
>
|
|
130
|
-
<span :class="$style.cellHeaderText">Changed At</span>
|
|
131
|
-
<ui3n-table-sort-icon
|
|
132
|
-
v-if="sortField === 'changedAt'"
|
|
133
|
-
:value="sortDirection"
|
|
134
|
-
:size="18"
|
|
135
|
-
/>
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
|
|
139
|
-
<div :class="$style.content">
|
|
140
|
-
<div
|
|
141
|
-
v-for="item in sortedItems"
|
|
142
|
-
:id="item.id"
|
|
143
|
-
:key="item.id"
|
|
144
|
-
:class="$style.row"
|
|
145
|
-
@click="onClick"
|
|
146
|
-
@click.right="onRightClick"
|
|
147
|
-
>
|
|
148
|
-
<icon
|
|
149
|
-
:icon="item.isFolder ? 'folder' : 'subject'"
|
|
150
|
-
:width="16"
|
|
151
|
-
:height="16"
|
|
152
|
-
:class="$style.rowIcon"
|
|
153
|
-
/>
|
|
154
|
-
<div :class="[$style.cellRow, $style.columnName]">
|
|
155
|
-
{{ item.name }}
|
|
156
|
-
</div>
|
|
157
|
-
<div :class="[$style.cellRow, $style.columnType]">
|
|
158
|
-
{{ item.ext || '' }}
|
|
159
|
-
</div>
|
|
160
|
-
<div :class="[$style.cellRow, $style.columnChangeAt]">
|
|
161
|
-
{{ getTimeAsString(item.mtime!) }}
|
|
162
|
-
</div>
|
|
163
|
-
|
|
164
|
-
<icon
|
|
165
|
-
v-if="item.isFolder"
|
|
166
|
-
icon="bookmark"
|
|
167
|
-
:width="12"
|
|
168
|
-
:height="12"
|
|
169
|
-
:class="$style.rowBookmark"
|
|
170
|
-
@click="handleActions($event, 'add:favorites', item)"
|
|
171
|
-
/>
|
|
172
|
-
|
|
173
|
-
<icon
|
|
174
|
-
icon="baseline-edit"
|
|
175
|
-
:width="12"
|
|
176
|
-
:height="12"
|
|
177
|
-
:class="$style.rowRename"
|
|
178
|
-
@click="handleActions($event, 'rename', item)"
|
|
179
|
-
/>
|
|
180
|
-
</div>
|
|
181
|
-
|
|
182
|
-
<div
|
|
183
|
-
v-if="!sortedItems.length"
|
|
184
|
-
:class="$style.emptyText"
|
|
185
|
-
>
|
|
186
|
-
{{ placeholder }}
|
|
187
|
-
</div>
|
|
188
|
-
</div>
|
|
189
|
-
</div>
|
|
190
|
-
</template>
|
|
191
|
-
|
|
192
|
-
<style lang="scss" module>
|
|
193
|
-
@import "../assets/styles/mixins";
|
|
194
|
-
|
|
195
|
-
.table {
|
|
196
|
-
--table-header-height: 36px;
|
|
197
|
-
--table-row-height: 28px;
|
|
198
|
-
|
|
199
|
-
position: relative;
|
|
200
|
-
width: 100%;
|
|
201
|
-
height: 100%;
|
|
202
|
-
overflow-x: hidden;
|
|
203
|
-
overflow-y: auto;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.header {
|
|
207
|
-
position: sticky;
|
|
208
|
-
top: 0;
|
|
209
|
-
display: flex;
|
|
210
|
-
width: 100%;
|
|
211
|
-
height: var(--table-header-height);
|
|
212
|
-
justify-content: flex-start;
|
|
213
|
-
align-items: center;
|
|
214
|
-
padding: var(--spacing-m);
|
|
215
|
-
background-color: var(--color-bg-table-header-default);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.cellHeader {
|
|
219
|
-
display: flex;
|
|
220
|
-
justify-content: flex-start;
|
|
221
|
-
align-items: center;
|
|
222
|
-
font-size: var(--font-14);
|
|
223
|
-
line-height: var(--font-20);
|
|
224
|
-
font-weight: 500;
|
|
225
|
-
color: var(--color-text-table-primary-default);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.cellHeaderSortable {
|
|
229
|
-
cursor: pointer;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.cellHeaderText {
|
|
233
|
-
display: block;
|
|
234
|
-
position: relative;
|
|
235
|
-
@include text-overflow-ellipsis(100%);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.row {
|
|
239
|
-
display: flex;
|
|
240
|
-
width: 100%;
|
|
241
|
-
height: var(--table-row-height);
|
|
242
|
-
justify-content: flex-start;
|
|
243
|
-
align-items: center;
|
|
244
|
-
padding: 0 var(--spacing-m) 0 calc(var(--spacing-l) + var(--spacing-s));
|
|
245
|
-
cursor: pointer;
|
|
246
|
-
border-bottom: 1px solid var(--color-border-table-primary-default);
|
|
247
|
-
|
|
248
|
-
&:hover {
|
|
249
|
-
background-color: var(--color-bg-control-primary-hover);
|
|
250
|
-
|
|
251
|
-
.rowBookmark,
|
|
252
|
-
.rowRename {
|
|
253
|
-
display: block;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.rowIcon {
|
|
257
|
-
color: var(--color-icon-table-accent-hover);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
.rowBookmark,
|
|
263
|
-
.rowRename {
|
|
264
|
-
display: none;
|
|
265
|
-
position: absolute;
|
|
266
|
-
z-index: 1;
|
|
267
|
-
color: var(--color-icon-control-accent-unselected);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.rowBookmark {
|
|
271
|
-
left: 2px;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.rowRename {
|
|
275
|
-
right: calc(var(--spacing-l) * 4);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
.rowIcon {
|
|
279
|
-
position: absolute;
|
|
280
|
-
left: var(--spacing-m);
|
|
281
|
-
color: var(--color-icon-table-secondary-default);
|
|
282
|
-
pointer-events: none;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.cellRow {
|
|
286
|
-
position: relative;
|
|
287
|
-
font-weight: 400;
|
|
288
|
-
pointer-events: none;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.columnName {
|
|
292
|
-
flex: 1 0;
|
|
293
|
-
|
|
294
|
-
.rowCell {
|
|
295
|
-
font-size: var(--font-12);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
.columnType {
|
|
300
|
-
position: relative;
|
|
301
|
-
width: 56px;
|
|
302
|
-
display: flex;
|
|
303
|
-
justify-content: center;
|
|
304
|
-
align-items: center;
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
.rowCell {
|
|
308
|
-
font-size: var(--font-10);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.columnChangeAt {
|
|
313
|
-
position: relative;
|
|
314
|
-
width: 104px;
|
|
315
|
-
|
|
316
|
-
.rowCell {
|
|
317
|
-
font-size: var(--font-12);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
.emptyText {
|
|
322
|
-
font-size: var(--font-14);
|
|
323
|
-
line-height: var(--font-20);
|
|
324
|
-
color: var(--color-text-control-secondary-default);
|
|
325
|
-
text-align: center;
|
|
326
|
-
padding: 56px 0;
|
|
327
|
-
}
|
|
328
|
-
</style>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|