@cloudron/pankow 3.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/.gitlab-ci.yml +30 -0
- package/.jshintrc +8 -0
- package/LICENSE +21 -0
- package/README.md +20 -0
- package/components/BottomBar.vue +22 -0
- package/components/Breadcrumb.vue +64 -0
- package/components/Button.vue +243 -0
- package/components/ButtonGroup.vue +37 -0
- package/components/Checkbox.vue +112 -0
- package/components/Dialog.vue +178 -0
- package/components/DirectoryView.vue +772 -0
- package/components/DirectoryViewListItem.vue +412 -0
- package/components/EmailInput.vue +22 -0
- package/components/FileUploader.vue +204 -0
- package/components/FormGroup.vue +26 -0
- package/components/Icon.vue +12 -0
- package/components/InputDialog.vue +170 -0
- package/components/InputGroup.vue +32 -0
- package/components/MainLayout.vue +63 -0
- package/components/Menu.vue +284 -0
- package/components/MenuItem.vue +106 -0
- package/components/MenuItemLink.vue +52 -0
- package/components/MultiSelect.vue +202 -0
- package/components/Notification.vue +163 -0
- package/components/NumberInput.vue +31 -0
- package/components/OfflineBanner.vue +47 -0
- package/components/PasswordInput.vue +86 -0
- package/components/Popover.vue +185 -0
- package/components/ProgressBar.vue +75 -0
- package/components/Radiobutton.vue +128 -0
- package/components/SideBar.vue +104 -0
- package/components/SingleSelect.vue +190 -0
- package/components/Spinner.vue +67 -0
- package/components/Switch.vue +94 -0
- package/components/TabView.vue +161 -0
- package/components/TableView.vue +187 -0
- package/components/TagInput.vue +104 -0
- package/components/TextInput.vue +58 -0
- package/components/TopBar.vue +88 -0
- package/fallbackImage.js +29 -0
- package/fetcher.js +81 -0
- package/gallery/CustomMenuItem.vue +40 -0
- package/gallery/DirectoryViewDemo.vue +73 -0
- package/gallery/Index.vue +790 -0
- package/gallery/folder.svg +151 -0
- package/gallery/index.html +25 -0
- package/gallery/index.js +10 -0
- package/gallery/logo.png +0 -0
- package/gallery/vite.config.mjs +9 -0
- package/gestures.js +60 -0
- package/index.js +86 -0
- package/logo.png +0 -0
- package/logo.svg +78 -0
- package/package.json +26 -0
- package/style.css +351 -0
- package/tooltip.js +83 -0
- package/utils.js +383 -0
- package/viewers/GenericViewer.vue +84 -0
- package/viewers/ImageViewer.vue +239 -0
- package/viewers/PdfViewer.vue +82 -0
- package/viewers/TextViewer.vue +221 -0
- package/viewers.js +11 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
|
|
3
|
+
import { ref, useTemplateRef } from 'vue';
|
|
4
|
+
import Button from './Button.vue';
|
|
5
|
+
import Icon from './Icon.vue';
|
|
6
|
+
|
|
7
|
+
const emit = defineEmits([ 'confirm', 'reject', 'close', 'alternate' ]);
|
|
8
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
title: String,
|
|
11
|
+
confirmStyle: String, // success, danger, ''
|
|
12
|
+
rejectStyle: String, // success, danger, ''
|
|
13
|
+
alternateStyle: String, // success, danger, ''
|
|
14
|
+
zIndex: {
|
|
15
|
+
type: Number,
|
|
16
|
+
default: 2000
|
|
17
|
+
},
|
|
18
|
+
modal: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
},
|
|
22
|
+
showX: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
confirmBusy: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
confirmActive: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
33
|
+
},
|
|
34
|
+
alternateBusy: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
},
|
|
38
|
+
alternateActive: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true
|
|
41
|
+
},
|
|
42
|
+
confirmLabel: String,
|
|
43
|
+
rejectLabel: String,
|
|
44
|
+
alternateLabel: String,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const visible = ref(false);
|
|
48
|
+
const dialog = useTemplateRef('dialog');
|
|
49
|
+
const dialogBody = useTemplateRef('dialogBody');
|
|
50
|
+
|
|
51
|
+
function open() {
|
|
52
|
+
visible.value = true;
|
|
53
|
+
|
|
54
|
+
// try to focus some form elements else just the dialog
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
const focusElement = dialogBody.value.querySelector('input:not([disabled]):not([style*="display:none"]):not([style*="display: none"])') || dialog.value;
|
|
57
|
+
focusElement.focus();
|
|
58
|
+
}, 100);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function close() {
|
|
62
|
+
visible.value = false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function onConfirm() {
|
|
66
|
+
emit('confirm');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function onDismiss() {
|
|
70
|
+
if (props.modal) return;
|
|
71
|
+
onReject();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function onReject() {
|
|
75
|
+
emit('reject');
|
|
76
|
+
onClose();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function onClose() {
|
|
80
|
+
visible.value = false;
|
|
81
|
+
emit('close');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function onAlternateAction() {
|
|
85
|
+
emit('alternate');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
defineExpose({ open, close });
|
|
89
|
+
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<template>
|
|
93
|
+
<teleport to="#app">
|
|
94
|
+
<div>
|
|
95
|
+
<Transition name="pankow-fade">
|
|
96
|
+
<div class="pankow-dialog-backdrop" @click="onDismiss" v-show="visible" :style="{ 'z-index': zIndex }"></div>
|
|
97
|
+
</Transition>
|
|
98
|
+
<Transition name="pankow-bounce-center">
|
|
99
|
+
<div ref="dialog" class="pankow-dialog" @click.stop v-show="visible" @keydown.esc="onDismiss" tabindex="0" :style="{ 'z-index': zIndex+1 }">
|
|
100
|
+
<div class="pankow-dialog-header" v-show="title">
|
|
101
|
+
{{ title }}
|
|
102
|
+
<Icon v-show="showX" icon="fa-solid fa-xmark" style="cursor: pointer;" @click="onReject"/>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="pankow-dialog-body" ref="dialogBody" :class="{ 'pankow-dialog-body-no-header': !title, 'pankow-dialog-body-no-buttons': !(rejectLabel || confirmLabel) }">
|
|
105
|
+
<slot></slot>
|
|
106
|
+
</div>
|
|
107
|
+
<div class="pankow-dialog-buttons" v-if="rejectLabel || confirmLabel || alternateLabel">
|
|
108
|
+
<Button :[alternateStyle]="!!alternateStyle" @click="onAlternateAction" v-show="alternateLabel" :loading="alternateBusy" :disabled="alternateBusy || !alternateActive">{{ alternateLabel }}</Button>
|
|
109
|
+
<div style="flex-grow: 1;"></div>
|
|
110
|
+
<Button :[rejectStyle]="!!rejectStyle" @click="onReject" v-show="rejectLabel">{{ rejectLabel }}</Button>
|
|
111
|
+
<Button :[confirmStyle]="!!confirmStyle" @click="onConfirm" v-show="confirmLabel" :loading="confirmBusy" :disabled="confirmBusy || !confirmActive">{{ confirmLabel }}</Button>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</Transition>
|
|
115
|
+
</div>
|
|
116
|
+
</teleport>
|
|
117
|
+
</template>
|
|
118
|
+
|
|
119
|
+
<style>
|
|
120
|
+
|
|
121
|
+
.pankow-dialog-backdrop {
|
|
122
|
+
position: fixed;
|
|
123
|
+
height: 100%;
|
|
124
|
+
width: 100%;
|
|
125
|
+
left: 0px;
|
|
126
|
+
top: 0px;
|
|
127
|
+
z-index: 2001;
|
|
128
|
+
background-color: var(--pankow-dialog-backdrop-color);
|
|
129
|
+
backdrop-filter: blur(2px);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.pankow-dialog {
|
|
133
|
+
position: absolute;
|
|
134
|
+
background-color: var(--pankow-dialog-background-color);
|
|
135
|
+
min-width: min(95%, 450px);
|
|
136
|
+
max-height: calc(100% - 20px);
|
|
137
|
+
max-width: calc(100% - 20px);
|
|
138
|
+
box-shadow: 0 2px 5px rgba(0,0,0,.1);
|
|
139
|
+
z-index: 2002;
|
|
140
|
+
border-radius: var(--pankow-border-radius);
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
display: flex;
|
|
143
|
+
flex-direction: column;
|
|
144
|
+
top: 50%;
|
|
145
|
+
left: 50%;
|
|
146
|
+
transform: translateX(-50%) translateY(-50%);
|
|
147
|
+
outline: none;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.pankow-dialog-header {
|
|
151
|
+
font-size: 20px;
|
|
152
|
+
padding: 15px;
|
|
153
|
+
display: flex;
|
|
154
|
+
justify-content: space-between;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.pankow-dialog-body {
|
|
158
|
+
padding: 0 15px;
|
|
159
|
+
overflow: auto;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.pankow-dialog-body-no-header {
|
|
163
|
+
padding: 15px;
|
|
164
|
+
padding-bottom: 0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.pankow-dialog-body-no-buttons {
|
|
168
|
+
padding-bottom: 15px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.pankow-dialog-buttons {
|
|
172
|
+
display: flex;
|
|
173
|
+
gap: 6px;
|
|
174
|
+
padding: 15px;
|
|
175
|
+
text-align: right;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
</style>
|