quasar-ui-danx 0.0.10 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +8 -2
- package/src/components/ActionTable/ActionTable.vue +143 -0
- package/src/components/ActionTable/BatchActionMenu.vue +60 -0
- package/src/components/ActionTable/EmptyTableState.vue +33 -0
- package/src/components/ActionTable/Filters/CollapsableFiltersSidebar.vue +36 -0
- package/src/components/ActionTable/Filters/FilterGroupItem.vue +28 -0
- package/src/components/ActionTable/Filters/FilterGroupList.vue +76 -0
- package/src/components/ActionTable/Filters/FilterListToggle.vue +50 -0
- package/src/components/ActionTable/Filters/FilterableField.vue +143 -0
- package/src/components/ActionTable/Filters/index.ts +5 -0
- package/src/components/ActionTable/Form/Fields/BooleanField.vue +37 -0
- package/src/components/ActionTable/Form/Fields/ConfirmPasswordField.vue +46 -0
- package/src/components/ActionTable/Form/Fields/DateField.vue +59 -0
- package/src/components/ActionTable/Form/Fields/DateRangeField.vue +110 -0
- package/src/components/ActionTable/Form/Fields/DateTimeField.vue +50 -0
- package/src/components/ActionTable/Form/Fields/DateTimePicker.vue +59 -0
- package/src/components/ActionTable/Form/Fields/EditableDiv.vue +39 -0
- package/src/components/ActionTable/Form/Fields/FieldLabel.vue +32 -0
- package/src/components/ActionTable/Form/Fields/FileUploadButton.vue +78 -0
- package/src/components/ActionTable/Form/Fields/InlineDateTimeField.vue +44 -0
- package/src/components/ActionTable/Form/Fields/IntegerField.vue +26 -0
- package/src/components/ActionTable/Form/Fields/LabelValueBlock.vue +22 -0
- package/src/components/ActionTable/Form/Fields/LabeledInput.vue +63 -0
- package/src/components/ActionTable/Form/Fields/MultiFileField.vue +91 -0
- package/src/components/ActionTable/Form/Fields/MultiKeywordField.vue +57 -0
- package/src/components/ActionTable/Form/Fields/NewPasswordField.vue +39 -0
- package/src/components/ActionTable/Form/Fields/NumberField.vue +94 -0
- package/src/components/ActionTable/Form/Fields/NumberRangeField.vue +140 -0
- package/src/components/ActionTable/Form/Fields/SelectDrawer.vue +136 -0
- package/src/components/ActionTable/Form/Fields/SelectField.vue +318 -0
- package/src/components/ActionTable/Form/Fields/SelectWithChildrenField.vue +81 -0
- package/src/components/ActionTable/Form/Fields/SingleFileField.vue +78 -0
- package/src/components/ActionTable/Form/Fields/TextField.vue +82 -0
- package/src/components/ActionTable/Form/Fields/WysiwygField.vue +46 -0
- package/src/components/ActionTable/Form/Fields/index.ts +23 -0
- package/src/components/ActionTable/Form/RenderedForm.vue +76 -0
- package/src/components/ActionTable/Form/index.ts +2 -0
- package/src/components/ActionTable/RenderComponentColumn.vue +22 -0
- package/src/components/ActionTable/TableSummaryRow.vue +95 -0
- package/src/components/ActionTable/index.ts +10 -0
- package/src/components/ActionTable/listActions.ts +362 -0
- package/src/components/ActionTable/listHelpers.ts +74 -0
- package/src/components/ActionTable/tableColumns.ts +72 -0
- package/src/components/DragAndDrop/HandleDraggable.vue +29 -29
- package/src/components/DragAndDrop/ListItemDraggable.vue +10 -10
- package/src/components/DragAndDrop/index.ts +0 -1
- package/src/components/DragAndDrop/listDragAndDrop.ts +1 -1
- package/src/components/Utility/CollapsableSidebar.vue +119 -0
- package/src/components/Utility/ContentDrawer.vue +70 -0
- package/src/components/Utility/Dialogs/ConfirmDialog.vue +132 -0
- package/src/components/Utility/Dialogs/FullScreenDialog.vue +46 -0
- package/src/components/Utility/Dialogs/FullscreenCarouselDialog.vue +105 -0
- package/src/components/Utility/Dialogs/InfoDialog.vue +92 -0
- package/src/components/Utility/Dialogs/InputDialog.vue +35 -0
- package/src/components/Utility/ImagePreview.vue +192 -0
- package/src/components/Utility/Popover/PopoverMenu.vue +64 -0
- package/src/components/Utility/Transitions/ListTransition.vue +50 -0
- package/src/components/Utility/Transitions/SlideTransition.vue +63 -0
- package/src/components/Utility/Transitions/StaggeredListTransition.vue +97 -0
- package/src/components/Utility/index.ts +11 -0
- package/src/components/index.ts +3 -0
- package/src/helpers/FileUpload.ts +295 -0
- package/src/helpers/FlashMessages.ts +79 -0
- package/src/helpers/array.ts +37 -0
- package/src/helpers/compatibility.ts +64 -0
- package/src/helpers/date.ts +5 -0
- package/src/helpers/download.ts +200 -0
- package/src/helpers/downloadPdf.ts +92 -0
- package/src/helpers/files.ts +52 -0
- package/src/helpers/formats.ts +183 -0
- package/src/helpers/http.ts +62 -0
- package/src/helpers/index.ts +12 -1
- package/src/helpers/multiFileUpload.ts +68 -0
- package/src/helpers/singleFileUpload.ts +54 -0
- package/src/helpers/storage.ts +8 -0
- package/src/index.esm.js +3 -4
- package/src/svg/FilterIcon.svg +7 -0
- package/src/svg/ImageIcon.svg +30 -0
- package/src/svg/PdfIcon.svg +21 -0
- package/src/svg/PercentIcon.svg +13 -0
- package/src/svg/TrashIcon.svg +15 -0
- package/src/svg/XIcon.svg +18 -0
- package/src/svg/index.ts +8 -0
- package/src/vendor/tinymce-config.ts +1 -0
- package/src/vue-plugin.js +7 -4
- package/tsconfig.json +14 -13
- package/src/components/DragAndDrop/Icons/index.ts +0 -2
- /package/src/{components/DragAndDrop/Icons → svg}/DragHandleDotsIcon.svg +0 -0
- /package/src/{components/DragAndDrop/Icons → svg}/DragHandleIcon.svg +0 -0
@@ -0,0 +1,92 @@
|
|
1
|
+
<template>
|
2
|
+
<q-dialog
|
3
|
+
:full-height="fullHeight"
|
4
|
+
:full-width="fullWidth"
|
5
|
+
:model-value="!!modelValue"
|
6
|
+
:no-backdrop-dismiss="!backdropDismiss"
|
7
|
+
:maximized="maximized"
|
8
|
+
@update:model-value="onClose"
|
9
|
+
>
|
10
|
+
<q-card class="flex flex-col flex-nowrap">
|
11
|
+
<q-card-section
|
12
|
+
v-if="title || $slots.title"
|
13
|
+
class="pl-6 pr-10 border-b border-gray-medium"
|
14
|
+
>
|
15
|
+
<h3
|
16
|
+
class="font-normal flex items-center"
|
17
|
+
:class="titleClass"
|
18
|
+
>
|
19
|
+
<slot name="title">{{ title }}</slot>
|
20
|
+
</h3>
|
21
|
+
<div
|
22
|
+
v-if="subtitle"
|
23
|
+
class="mt-1 text-sm"
|
24
|
+
>{{ subtitle }}
|
25
|
+
</div>
|
26
|
+
</q-card-section>
|
27
|
+
<q-card-section
|
28
|
+
v-if="content || $slots.default"
|
29
|
+
class="px-6 bg-neutral-plus-7 flex-grow max-h-full overflow-y-auto"
|
30
|
+
>
|
31
|
+
<slot>{{ content }}</slot>
|
32
|
+
</q-card-section>
|
33
|
+
<div
|
34
|
+
class="flex items-center justify-center px-6 py-4 border-t border-gray-medium"
|
35
|
+
>
|
36
|
+
<div class="flex-grow text-right">
|
37
|
+
<q-btn
|
38
|
+
:label="doneText"
|
39
|
+
class="action-btn btn-white-gray"
|
40
|
+
@click="onClose"
|
41
|
+
>
|
42
|
+
<slot name="done-text" />
|
43
|
+
</q-btn>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
<a
|
47
|
+
class="absolute top-0 right-0 p-4 text-black"
|
48
|
+
@click="onClose"
|
49
|
+
>
|
50
|
+
<CloseIcon class="w-5" />
|
51
|
+
</a>
|
52
|
+
</q-card>
|
53
|
+
</q-dialog>
|
54
|
+
</template>
|
55
|
+
|
56
|
+
<script setup>
|
57
|
+
import { XIcon as CloseIcon } from "@heroicons/vue/outline";
|
58
|
+
|
59
|
+
const emit = defineEmits(["update:model-value", "close"]);
|
60
|
+
defineProps({
|
61
|
+
modelValue: { type: [Boolean, Object], default: true },
|
62
|
+
title: {
|
63
|
+
type: String,
|
64
|
+
default: ""
|
65
|
+
},
|
66
|
+
titleClass: {
|
67
|
+
type: String,
|
68
|
+
default: ""
|
69
|
+
},
|
70
|
+
subtitle: {
|
71
|
+
type: String,
|
72
|
+
default: ""
|
73
|
+
},
|
74
|
+
content: {
|
75
|
+
type: String,
|
76
|
+
default: ""
|
77
|
+
},
|
78
|
+
backdropDismiss: Boolean,
|
79
|
+
maximized: Boolean,
|
80
|
+
fullWidth: Boolean,
|
81
|
+
fullHeight: Boolean,
|
82
|
+
doneText: {
|
83
|
+
type: String,
|
84
|
+
default: "Done"
|
85
|
+
}
|
86
|
+
});
|
87
|
+
|
88
|
+
function onClose() {
|
89
|
+
emit("update:model-value", false);
|
90
|
+
emit("close");
|
91
|
+
}
|
92
|
+
</script>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<template>
|
2
|
+
<ConfirmDialog
|
3
|
+
v-bind="$props"
|
4
|
+
@confirm="$emit('confirm', newInput)"
|
5
|
+
@close="$emit('close', $event)"
|
6
|
+
>
|
7
|
+
<slot>
|
8
|
+
<q-input
|
9
|
+
v-model="newInput"
|
10
|
+
type="number"
|
11
|
+
class="w-full"
|
12
|
+
@input="$emit('update:input', $event)"
|
13
|
+
/>
|
14
|
+
</slot>
|
15
|
+
</ConfirmDialog>
|
16
|
+
</template>
|
17
|
+
<script setup>
|
18
|
+
import { ref } from 'vue';
|
19
|
+
import ConfirmDialog from './ConfirmDialog';
|
20
|
+
|
21
|
+
defineEmits(['confirm', 'close', 'update:input']);
|
22
|
+
const props = defineProps({
|
23
|
+
...ConfirmDialog.props,
|
24
|
+
title: {
|
25
|
+
type: String,
|
26
|
+
default: 'Enter Value'
|
27
|
+
},
|
28
|
+
input: {
|
29
|
+
type: [Number, String],
|
30
|
+
default: ''
|
31
|
+
}
|
32
|
+
});
|
33
|
+
|
34
|
+
const newInput = ref(props.input);
|
35
|
+
</script>
|
@@ -0,0 +1,192 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="relative flex justify-center bg-neutral-plus-7" :class="{'rounded-2xl': !square}">
|
3
|
+
<template v-if="computedImage">
|
4
|
+
<div
|
5
|
+
class="grow h-full overflow-hidden"
|
6
|
+
:class="{'rounded-2xl': !square}"
|
7
|
+
@click="showPreview = true"
|
8
|
+
>
|
9
|
+
<div
|
10
|
+
v-if="isVideo"
|
11
|
+
class="relative max-h-full max-w-full w-full flex justify-center"
|
12
|
+
>
|
13
|
+
<video
|
14
|
+
class="max-h-full"
|
15
|
+
preload="auto"
|
16
|
+
>
|
17
|
+
<source
|
18
|
+
:src="previewUrl + '#t=0.1'"
|
19
|
+
:type="mimeType"
|
20
|
+
/>
|
21
|
+
</video>
|
22
|
+
<button class="play-button text-blue-lighter">
|
23
|
+
<PlayIcon class="w-16" />
|
24
|
+
</button>
|
25
|
+
</div>
|
26
|
+
<div
|
27
|
+
v-if="isPdf && !thumbUrl"
|
28
|
+
class="flex items-center justify-center h-full"
|
29
|
+
>
|
30
|
+
<PdfIcon class="w-24" />
|
31
|
+
</div>
|
32
|
+
<q-img
|
33
|
+
v-else
|
34
|
+
fit="scale-down"
|
35
|
+
class="non-selectable max-h-full max-w-full h-full"
|
36
|
+
:src="(thumbUrl || previewUrl) + '#t=0.1'"
|
37
|
+
preload="auto"
|
38
|
+
data-testid="previewed-image"
|
39
|
+
data-dusk="previewed-image"
|
40
|
+
/>
|
41
|
+
</div>
|
42
|
+
<div
|
43
|
+
v-if="$slots['action-button']"
|
44
|
+
class="action-button"
|
45
|
+
>
|
46
|
+
<slot name="action-button" />
|
47
|
+
</div>
|
48
|
+
<div
|
49
|
+
v-if="image && image.progress !== undefined"
|
50
|
+
class="absolute-bottom w-full"
|
51
|
+
>
|
52
|
+
<q-linear-progress
|
53
|
+
:value="image.progress"
|
54
|
+
size="15px"
|
55
|
+
color="green-base"
|
56
|
+
stripe
|
57
|
+
/>
|
58
|
+
</div>
|
59
|
+
</template>
|
60
|
+
<template v-else>
|
61
|
+
<slot name="missing">
|
62
|
+
<component
|
63
|
+
:is="missingIcon"
|
64
|
+
class="w-full h-full p-2 text-gray-medium"
|
65
|
+
/>
|
66
|
+
</slot>
|
67
|
+
</template>
|
68
|
+
|
69
|
+
<div class="absolute top-1 right-1 flex items-center justify-between space-x-1">
|
70
|
+
<q-btn
|
71
|
+
v-if="downloadable && computedImage?.url"
|
72
|
+
size="sm"
|
73
|
+
class="!p-1 opacity-70 hover:opacity-100"
|
74
|
+
:class="downloadButtonClass"
|
75
|
+
@click.stop="download(computedImage.url)"
|
76
|
+
>
|
77
|
+
<DownloadIcon class="w-4 h-5" />
|
78
|
+
</q-btn>
|
79
|
+
|
80
|
+
<q-btn
|
81
|
+
v-if="removable"
|
82
|
+
size="sm"
|
83
|
+
class="bg-red-dark text-white !p-1 opacity-50 hover:opacity-100"
|
84
|
+
@click.stop="onRemove"
|
85
|
+
>
|
86
|
+
<div v-if="isConfirmingRemove" class="font-bold text-[1rem] leading-[1.2rem]">?</div>
|
87
|
+
<RemoveIcon v-else class="w-3" />
|
88
|
+
</q-btn>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<FullScreenCarouselDialog
|
92
|
+
v-if="showPreview && !disabled"
|
93
|
+
:files="relatedFiles || [computedImage]"
|
94
|
+
:default-slide="computedImage.id"
|
95
|
+
@close="showPreview = false"
|
96
|
+
/>
|
97
|
+
</div>
|
98
|
+
</template>
|
99
|
+
|
100
|
+
<script setup>
|
101
|
+
import { DownloadIcon, PlayIcon } from '@heroicons/vue/outline';
|
102
|
+
import { FullScreenCarouselDialog } from '@ui/components';
|
103
|
+
import { download } from '@ui/helpers';
|
104
|
+
import { ImageIcon, PdfIcon, TrashIcon as RemoveIcon } from '@ui/svg';
|
105
|
+
import { computed, ref } from 'vue';
|
106
|
+
|
107
|
+
const emit = defineEmits(['remove']);
|
108
|
+
const props = defineProps({
|
109
|
+
src: {
|
110
|
+
type: String,
|
111
|
+
default: ''
|
112
|
+
},
|
113
|
+
image: {
|
114
|
+
type: Object,
|
115
|
+
default: null
|
116
|
+
},
|
117
|
+
relatedFiles: {
|
118
|
+
type: Array,
|
119
|
+
default: null
|
120
|
+
},
|
121
|
+
missingIcon: {
|
122
|
+
type: [Function, Object],
|
123
|
+
default: ImageIcon
|
124
|
+
},
|
125
|
+
downloadButtonClass: {
|
126
|
+
type: String,
|
127
|
+
default: 'bg-blue-base text-white'
|
128
|
+
},
|
129
|
+
downloadable: Boolean,
|
130
|
+
removable: Boolean,
|
131
|
+
disabled: Boolean,
|
132
|
+
square: Boolean
|
133
|
+
});
|
134
|
+
|
135
|
+
const showPreview = ref(false);
|
136
|
+
const computedImage = computed(() => {
|
137
|
+
if (props.image) {
|
138
|
+
return props.image;
|
139
|
+
} else if (props.src) {
|
140
|
+
return {
|
141
|
+
id: props.src,
|
142
|
+
url: props.src,
|
143
|
+
type: 'image/' + props.src.split('.').pop().toLowerCase()
|
144
|
+
};
|
145
|
+
}
|
146
|
+
return null;
|
147
|
+
});
|
148
|
+
const mimeType = computed(
|
149
|
+
() => computedImage.value.type || computedImage.value.mime
|
150
|
+
);
|
151
|
+
const isVideo = computed(() => mimeType.value.match(/^video\//));
|
152
|
+
const isPdf = computed(() => mimeType.value.match(/^application\/pdf/));
|
153
|
+
const previewUrl = computed(
|
154
|
+
() => computedImage.value.transcodes?.compress?.url || computedImage.value.blobUrl || computedImage.value.url
|
155
|
+
);
|
156
|
+
const thumbUrl = computed(() => {
|
157
|
+
return computedImage.value.transcodes?.thumb?.url;
|
158
|
+
});
|
159
|
+
|
160
|
+
const isConfirmingRemove = ref(false);
|
161
|
+
function onRemove() {
|
162
|
+
if (!isConfirmingRemove.value) {
|
163
|
+
isConfirmingRemove.value = true;
|
164
|
+
setTimeout(() => {
|
165
|
+
isConfirmingRemove.value = false;
|
166
|
+
}, 2000);
|
167
|
+
} else {
|
168
|
+
emit('remove');
|
169
|
+
}
|
170
|
+
}
|
171
|
+
</script>
|
172
|
+
|
173
|
+
<style scoped lang="scss">
|
174
|
+
.action-button {
|
175
|
+
position: absolute;
|
176
|
+
bottom: 1.5em;
|
177
|
+
right: 1em;
|
178
|
+
z-index: 1;
|
179
|
+
}
|
180
|
+
|
181
|
+
.play-button {
|
182
|
+
position: absolute;
|
183
|
+
top: 0;
|
184
|
+
left: 0;
|
185
|
+
display: flex;
|
186
|
+
justify-content: center;
|
187
|
+
align-items: center;
|
188
|
+
width: 100%;
|
189
|
+
height: 100%;
|
190
|
+
pointer-events: none;
|
191
|
+
}
|
192
|
+
</style>
|
@@ -0,0 +1,64 @@
|
|
1
|
+
<template>
|
2
|
+
<a
|
3
|
+
class="p-3 actionable"
|
4
|
+
:class="{'opacity-50 cursor-not-allowed': disabled}"
|
5
|
+
>
|
6
|
+
<Transition
|
7
|
+
mode="out-in"
|
8
|
+
:duration="150"
|
9
|
+
>
|
10
|
+
<q-spinner
|
11
|
+
v-if="loading"
|
12
|
+
class="w-4 h-4 text-black"
|
13
|
+
/>
|
14
|
+
<MenuIcon
|
15
|
+
v-else
|
16
|
+
class="w-4 text-black"
|
17
|
+
/>
|
18
|
+
</Transition>
|
19
|
+
<q-menu
|
20
|
+
v-if="!disabled"
|
21
|
+
auto-close
|
22
|
+
>
|
23
|
+
<q-list>
|
24
|
+
<template v-for="item in items">
|
25
|
+
<a
|
26
|
+
v-if="item.url"
|
27
|
+
:key="item.url"
|
28
|
+
class="q-item"
|
29
|
+
target="_blank"
|
30
|
+
:href="item.url"
|
31
|
+
:class="item.class"
|
32
|
+
>
|
33
|
+
{{ item.label }}
|
34
|
+
</a>
|
35
|
+
<q-item
|
36
|
+
v-else
|
37
|
+
:key="item.action"
|
38
|
+
clickable
|
39
|
+
:class="item.class"
|
40
|
+
@click="$emit('action', item.action)"
|
41
|
+
>
|
42
|
+
{{ item.label }}
|
43
|
+
</q-item>
|
44
|
+
</template>
|
45
|
+
</q-list>
|
46
|
+
</q-menu>
|
47
|
+
</a>
|
48
|
+
</template>
|
49
|
+
<script setup>
|
50
|
+
import { DotsVerticalIcon as MenuIcon } from '@heroicons/vue/outline';
|
51
|
+
|
52
|
+
defineEmits(['action']);
|
53
|
+
defineProps({
|
54
|
+
items: {
|
55
|
+
type: Array,
|
56
|
+
required: true,
|
57
|
+
validator(items) {
|
58
|
+
return items.every((item) => item.label && (item.url || item.action));
|
59
|
+
}
|
60
|
+
},
|
61
|
+
disabled: Boolean,
|
62
|
+
loading: Boolean
|
63
|
+
});
|
64
|
+
</script>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<template>
|
2
|
+
<TransitionGroup tag="div" :name="name" class="relative">
|
3
|
+
<slot />
|
4
|
+
</TransitionGroup>
|
5
|
+
</template>
|
6
|
+
|
7
|
+
<script setup>
|
8
|
+
defineProps({
|
9
|
+
name: {
|
10
|
+
type: String,
|
11
|
+
default: "fade-list"
|
12
|
+
}
|
13
|
+
});
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<style lang="scss">
|
17
|
+
[class*="list-move"], /* apply transition to moving elements */
|
18
|
+
[class*="list-enter-active"],
|
19
|
+
[class*=".list-leave-active"] {
|
20
|
+
transition: all 0.3s cubic-bezier(0.55, 0, 0.1, 1);
|
21
|
+
}
|
22
|
+
|
23
|
+
/* ensure leaving items are taken out of layout flow so that moving
|
24
|
+
animations can be calculated correctly. */
|
25
|
+
[class*="list-leave-active"] {
|
26
|
+
position: absolute !important;
|
27
|
+
}
|
28
|
+
|
29
|
+
/** Default List */
|
30
|
+
.list-enter-from,
|
31
|
+
.list-leave-to {
|
32
|
+
opacity: 0;
|
33
|
+
transform: translateX(30px);
|
34
|
+
}
|
35
|
+
|
36
|
+
/** Fade */
|
37
|
+
.fade-list-enter-from,
|
38
|
+
.fade-list-leave-to {
|
39
|
+
opacity: 0;
|
40
|
+
transform: scaleY(0.01) translate(30px, 0);
|
41
|
+
}
|
42
|
+
|
43
|
+
/** Fade Down */
|
44
|
+
.fade-down-list-enter-from,
|
45
|
+
.fade-down-list-leave-to {
|
46
|
+
opacity: 0;
|
47
|
+
transform-origin: top;
|
48
|
+
transform: translateY(30px);
|
49
|
+
}
|
50
|
+
</style>
|
@@ -0,0 +1,63 @@
|
|
1
|
+
<template>
|
2
|
+
<Transition :name="name">
|
3
|
+
<slot />
|
4
|
+
</Transition>
|
5
|
+
</template>
|
6
|
+
|
7
|
+
<script setup>
|
8
|
+
defineProps({
|
9
|
+
name: {
|
10
|
+
type: String,
|
11
|
+
default: "slide"
|
12
|
+
}
|
13
|
+
});
|
14
|
+
</script>
|
15
|
+
<style lang="scss">
|
16
|
+
.slide-enter-active,
|
17
|
+
.slide-leave-active,
|
18
|
+
.slide-right-enter-active,
|
19
|
+
.slide-right-leave-active {
|
20
|
+
transition: all 0.3s linear;
|
21
|
+
width: 100%;
|
22
|
+
}
|
23
|
+
|
24
|
+
.slide-right-enter-active,
|
25
|
+
.slide-enter-active {
|
26
|
+
position: absolute !important;
|
27
|
+
top: 0;
|
28
|
+
}
|
29
|
+
|
30
|
+
/** Slide Left (default) */
|
31
|
+
.slide-enter-from {
|
32
|
+
right: -120%;
|
33
|
+
}
|
34
|
+
|
35
|
+
.slide-enter-to {
|
36
|
+
right: 0;
|
37
|
+
}
|
38
|
+
|
39
|
+
.slide-leave-to {
|
40
|
+
left: -120%;
|
41
|
+
}
|
42
|
+
|
43
|
+
.slide-leave-from {
|
44
|
+
left: 0;
|
45
|
+
}
|
46
|
+
|
47
|
+
/** Slide Right */
|
48
|
+
.slide-right-enter-from {
|
49
|
+
left: -120%;
|
50
|
+
}
|
51
|
+
|
52
|
+
.slide-right-enter-to {
|
53
|
+
left: 0;
|
54
|
+
}
|
55
|
+
|
56
|
+
.slide-right-leave-to {
|
57
|
+
right: -120%;
|
58
|
+
}
|
59
|
+
|
60
|
+
.slide-right-leave-from {
|
61
|
+
right: 0;
|
62
|
+
}
|
63
|
+
</style>
|
@@ -0,0 +1,97 @@
|
|
1
|
+
<template>
|
2
|
+
<TransitionGroup
|
3
|
+
ref="list"
|
4
|
+
tag="div"
|
5
|
+
appear
|
6
|
+
:css="false"
|
7
|
+
@before-enter="onBeforeEnter"
|
8
|
+
@enter="onEnter"
|
9
|
+
@leave="onLeave"
|
10
|
+
>
|
11
|
+
<slot />
|
12
|
+
</TransitionGroup>
|
13
|
+
</template>
|
14
|
+
|
15
|
+
<script setup>
|
16
|
+
import gsap from 'gsap';
|
17
|
+
import { computed, ref } from 'vue';
|
18
|
+
|
19
|
+
const props = defineProps({
|
20
|
+
height: {
|
21
|
+
type: [String, Number],
|
22
|
+
default: 'auto'
|
23
|
+
},
|
24
|
+
duration: {
|
25
|
+
type: Number,
|
26
|
+
default: 0.5
|
27
|
+
},
|
28
|
+
delayOffset: {
|
29
|
+
type: Number,
|
30
|
+
default: 0.5
|
31
|
+
},
|
32
|
+
disabled: Boolean
|
33
|
+
});
|
34
|
+
|
35
|
+
const list = ref(null);
|
36
|
+
const indexDelay = computed(() => {
|
37
|
+
return props.delayOffset / list.value.$el.children.length;
|
38
|
+
});
|
39
|
+
|
40
|
+
function onBeforeEnter(el) {
|
41
|
+
if (props.disabled) {
|
42
|
+
return;
|
43
|
+
}
|
44
|
+
el.style.opacity = 0;
|
45
|
+
el.style.height = 0;
|
46
|
+
}
|
47
|
+
|
48
|
+
function onEnter(el, onComplete) {
|
49
|
+
if (props.disabled) {
|
50
|
+
onComplete();
|
51
|
+
return;
|
52
|
+
}
|
53
|
+
|
54
|
+
gsap.to(el, {
|
55
|
+
opacity: 1,
|
56
|
+
duration: props.duration,
|
57
|
+
height: props.height,
|
58
|
+
delay: el.dataset.index * indexDelay.value,
|
59
|
+
onComplete
|
60
|
+
});
|
61
|
+
}
|
62
|
+
|
63
|
+
function onLeave(el, onComplete) {
|
64
|
+
if (props.disabled) {
|
65
|
+
onComplete();
|
66
|
+
return;
|
67
|
+
}
|
68
|
+
|
69
|
+
gsap.to(el, {
|
70
|
+
opacity: 0,
|
71
|
+
height: 0,
|
72
|
+
duration: props.duration,
|
73
|
+
delay: el.dataset.index * indexDelay.value,
|
74
|
+
onComplete
|
75
|
+
});
|
76
|
+
}
|
77
|
+
</script>
|
78
|
+
|
79
|
+
<style scoped lang="scss">
|
80
|
+
.list-move,
|
81
|
+
.list-enter-active,
|
82
|
+
.list-leave-active {
|
83
|
+
transition: all 0.5s ease;
|
84
|
+
}
|
85
|
+
|
86
|
+
.list-enter-from,
|
87
|
+
.list-leave-to {
|
88
|
+
opacity: 0;
|
89
|
+
transform: translateX(2em);
|
90
|
+
}
|
91
|
+
|
92
|
+
/* ensure leaving items are taken out of layout flow so that moving
|
93
|
+
animations can be calculated correctly. */
|
94
|
+
.list-leave-active {
|
95
|
+
position: absolute;
|
96
|
+
}
|
97
|
+
</style>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export { default as CollapsableSidebar } from "./CollapsableSidebar.vue";
|
2
|
+
export { default as ConfirmDialog } from "./Dialogs/ConfirmDialog.vue";
|
3
|
+
export { default as ContentDrawer } from "./ContentDrawer.vue";
|
4
|
+
export { default as FullScreenCarouselDialog } from "./Dialogs/FullscreenCarouselDialog.vue";
|
5
|
+
export { default as FullScreenDialog } from "./Dialogs/FullScreenDialog.vue";
|
6
|
+
export { default as ImagePreview } from "./ImagePreview.vue";
|
7
|
+
export { default as InfoDialog } from "./Dialogs/InfoDialog.vue";
|
8
|
+
export { default as InputDialog } from "./Dialogs/InputDialog.vue";
|
9
|
+
export { default as ListTransition } from "./Transitions/ListTransition.vue";
|
10
|
+
export { default as SlideTransition } from "./Transitions/SlideTransition.vue";
|
11
|
+
export { default as StaggeredListTransition } from "./Transitions/StaggeredListTransition.vue";
|