@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.
Files changed (62) hide show
  1. package/.gitlab-ci.yml +30 -0
  2. package/.jshintrc +8 -0
  3. package/LICENSE +21 -0
  4. package/README.md +20 -0
  5. package/components/BottomBar.vue +22 -0
  6. package/components/Breadcrumb.vue +64 -0
  7. package/components/Button.vue +243 -0
  8. package/components/ButtonGroup.vue +37 -0
  9. package/components/Checkbox.vue +112 -0
  10. package/components/Dialog.vue +178 -0
  11. package/components/DirectoryView.vue +772 -0
  12. package/components/DirectoryViewListItem.vue +412 -0
  13. package/components/EmailInput.vue +22 -0
  14. package/components/FileUploader.vue +204 -0
  15. package/components/FormGroup.vue +26 -0
  16. package/components/Icon.vue +12 -0
  17. package/components/InputDialog.vue +170 -0
  18. package/components/InputGroup.vue +32 -0
  19. package/components/MainLayout.vue +63 -0
  20. package/components/Menu.vue +284 -0
  21. package/components/MenuItem.vue +106 -0
  22. package/components/MenuItemLink.vue +52 -0
  23. package/components/MultiSelect.vue +202 -0
  24. package/components/Notification.vue +163 -0
  25. package/components/NumberInput.vue +31 -0
  26. package/components/OfflineBanner.vue +47 -0
  27. package/components/PasswordInput.vue +86 -0
  28. package/components/Popover.vue +185 -0
  29. package/components/ProgressBar.vue +75 -0
  30. package/components/Radiobutton.vue +128 -0
  31. package/components/SideBar.vue +104 -0
  32. package/components/SingleSelect.vue +190 -0
  33. package/components/Spinner.vue +67 -0
  34. package/components/Switch.vue +94 -0
  35. package/components/TabView.vue +161 -0
  36. package/components/TableView.vue +187 -0
  37. package/components/TagInput.vue +104 -0
  38. package/components/TextInput.vue +58 -0
  39. package/components/TopBar.vue +88 -0
  40. package/fallbackImage.js +29 -0
  41. package/fetcher.js +81 -0
  42. package/gallery/CustomMenuItem.vue +40 -0
  43. package/gallery/DirectoryViewDemo.vue +73 -0
  44. package/gallery/Index.vue +790 -0
  45. package/gallery/folder.svg +151 -0
  46. package/gallery/index.html +25 -0
  47. package/gallery/index.js +10 -0
  48. package/gallery/logo.png +0 -0
  49. package/gallery/vite.config.mjs +9 -0
  50. package/gestures.js +60 -0
  51. package/index.js +86 -0
  52. package/logo.png +0 -0
  53. package/logo.svg +78 -0
  54. package/package.json +26 -0
  55. package/style.css +351 -0
  56. package/tooltip.js +83 -0
  57. package/utils.js +383 -0
  58. package/viewers/GenericViewer.vue +84 -0
  59. package/viewers/ImageViewer.vue +239 -0
  60. package/viewers/PdfViewer.vue +82 -0
  61. package/viewers/TextViewer.vue +221 -0
  62. package/viewers.js +11 -0
package/style.css ADDED
@@ -0,0 +1,351 @@
1
+ [v-cloak] {
2
+ display: none;
3
+ }
4
+
5
+ * {
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ :root {
10
+ --font-family: 'Inter';
11
+
12
+ --pankow-body-background-color: white;
13
+
14
+ --pankow-text-color: #333;
15
+ --pankow-text-color-alt: #333;
16
+ --pankow-text-color-white: white;
17
+
18
+ --pankow-color-dark: #495057;
19
+ --pankow-color-dark-secondary: #495057;
20
+
21
+ --pankow-color-background: #f8f8f8;
22
+ --pankow-color-background-hover: #e9ecef;
23
+
24
+ --pankow-color-light-dark: #ced4da;
25
+
26
+ --pankow-tooltip-background-color: rgba(0,0,0,0.5);
27
+ --pankow-tooltip-text-color: white;
28
+
29
+ --pankow-color-primary: #1a76bf;
30
+ --pankow-color-primary-hover: #0d89ec;
31
+ --pankow-color-primary-active: #0b7ad1;
32
+
33
+ --pankow-color-danger: #ca3636;
34
+ --pankow-color-danger-hover: #e24949;
35
+ --pankow-color-danger-active: #970d0d;
36
+
37
+ --pankow-color-success: #0e893b;
38
+ --pankow-color-success-hover: #1d9b4c;
39
+ --pankow-color-success-active: #17773b;
40
+
41
+ --pankow-color-secondary: #607D8B;
42
+ --pankow-color-secondary-hover: #889ba3;
43
+ --pankow-color-secondary-active: #324650;
44
+
45
+ --pankow-box-shadow: 0 2px 5px rgba(0,0,0,.1);
46
+ --pankow-menu-shadow: 0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;
47
+ --pankow-notification-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.1) 0px 1px 2px -1px;
48
+
49
+ --pankow-input-vertial-padding: 6px;
50
+ --pankow-input-horizontal-padding: max(7px, var(--pankow-border-radius));
51
+ --pankow-input-background-color: white;
52
+ --pankow-input-border-color: #ced4da;
53
+ --pankow-input-border-color-hover: var(--pankow-color-dark);
54
+ --pankow-input-border-color-focus: var(--pankow-color-primary-hover);
55
+
56
+ --pankow-dialog-background-color: white;
57
+ --pankow-dialog-backdrop-color: rgba(0,0,0,.4);
58
+
59
+ --pankow-border-radius: 4px;
60
+ }
61
+
62
+ *,
63
+ *::before,
64
+ *::after {
65
+ box-sizing: border-box;
66
+ }
67
+
68
+ html, body {
69
+ margin: 0;
70
+ padding: 0;
71
+ width: 100%;
72
+ height: 100%;
73
+ font-size: 14px; /* this also defines the overall widget size as all sizes are in rem */
74
+ font-family: var(--font-family);
75
+ font-weight: 400;
76
+ color: var(--pankow-text-color);
77
+ overflow: hidden;
78
+ }
79
+
80
+ input {
81
+ accent-color: var(--pankow-color-primary);
82
+ }
83
+
84
+ @media (prefers-color-scheme: dark) {
85
+ :root {
86
+ --pankow-body-background-color: black;
87
+
88
+ --pankow-text-color: #ced4da;
89
+ --pankow-text-color-alt: #495057;
90
+ --pankow-text-color-white: #ced4da;
91
+
92
+ --pankow-input-background-color: #1b1e21;
93
+ --pankow-input-border-color: #1b1e21;
94
+ --pankow-input-border-color-hover: #ced4da;
95
+
96
+ --pankow-color-background: #1b1e21;
97
+ --pankow-color-background-hover: var(--pankow-color-dark);
98
+
99
+ --pankow-dialog-background-color: #32383e;
100
+ --pankow-dialog-backdrop-color: rgba(0,0,0,.7);
101
+
102
+ --pankow-tooltip-background-color: rgba(255,255,255,0.5);
103
+ --pankow-tooltip-text-color: black;
104
+ }
105
+ }
106
+
107
+ a {
108
+ color: var(--pankow-color-dark);
109
+ text-decoration: none;
110
+ }
111
+
112
+ @media (prefers-color-scheme: dark) {
113
+ a {
114
+ color: var(--pankow-color-light-dark);
115
+ }
116
+ }
117
+
118
+ a:hover {
119
+ color: var(--pankow-color-primary-hover);
120
+ }
121
+
122
+ code {
123
+ background-color: var(--pankow-color-light-dark);
124
+ border-radius: 2px;
125
+ padding: 0 5px;
126
+ }
127
+
128
+ @media (prefers-color-scheme: dark) {
129
+ code {
130
+ background-color: var(--pankow-color-dark);
131
+ }
132
+ }
133
+
134
+ label {
135
+ display: block;
136
+ font-weight: bold;
137
+ margin-top: 10px;
138
+ margin-bottom: 6px;
139
+ }
140
+
141
+ select {
142
+ font-size: 14px;
143
+ color: var(--pankow-text-color);
144
+ margin: 4px 0;
145
+ margin-inline: 4px;
146
+ background-color: var(--pankow-input-background-color);
147
+ padding: 7px 18px;
148
+ border-radius: var(--pankow-border-radius);
149
+ display: inline-block;
150
+ border: 1px solid var(--pankow-input-border-color);
151
+ transition: border-color 250ms;
152
+ cursor: pointer;
153
+ }
154
+
155
+ select:hover {
156
+ border: 1px solid var(--pankow-color-dark);
157
+ }
158
+
159
+ select:focus {
160
+ border: 1px solid var(--pankow-color-primary-hover);
161
+ outline: none;
162
+ }
163
+
164
+ textarea {
165
+ font-size: 14px;
166
+ color: var(--pankow-text-color);
167
+ margin: 6px 0;
168
+ background-color: var(--pankow-input-background-color);
169
+ padding: 6px;
170
+ border-radius: var(--pankow-border-radius);
171
+ display: inline-block;
172
+ border: 1px solid var(--pankow-input-border-color);
173
+ transition: border-color 250ms;
174
+ }
175
+
176
+ textarea:hover {
177
+ border: 1px solid var(--pankow-color-dark);
178
+ }
179
+
180
+ textarea:focus {
181
+ border: 1px solid var(--pankow-color-primary-hover);
182
+ outline: none;
183
+ }
184
+
185
+ @media (max-width: 576px) {
186
+ .pankow-no-mobile {
187
+ display: none !important;
188
+ }
189
+ }
190
+
191
+ @media (min-width: 575px) {
192
+ .pankow-no-desktop {
193
+ display: none !important;
194
+ }
195
+ }
196
+
197
+ .pankow-tooltip {
198
+ position: absolute;
199
+ border-radius: var(--pankow-border-radius);
200
+ background-color: var(--pankow-tooltip-background-color);
201
+ backdrop-filter: blur(10px);
202
+ color: var(--pankow-tooltip-text-color);
203
+ padding: 4px 7px;
204
+ font-size: 12px;
205
+ z-index: 6000;
206
+ text-align: center;
207
+ }
208
+
209
+ .has-error {
210
+ color: var(--pankow-color-danger);
211
+ }
212
+
213
+ .pankow-fade-enter-active,
214
+ .pankow-fade-leave-active {
215
+ transition: opacity 0.5s ease;
216
+ }
217
+
218
+ .pankow-fade-enter-from,
219
+ .pankow-fade-leave-to {
220
+ opacity: 0;
221
+ }
222
+
223
+ .pankow-scale-enter-active,
224
+ .pankow-scale-leave-active {
225
+ transition: transform 0.2s ease;
226
+ }
227
+
228
+ .pankow-scale-enter-from,
229
+ .pankow-scale-leave-to {
230
+ transform: scale(0);
231
+ }
232
+
233
+ .pankow-fade-fast-enter-active,
234
+ .pankow-fade-fast-leave-active {
235
+ transition: opacity 0.2s ease;
236
+ }
237
+
238
+ .pankow-fade-fast-enter-from,
239
+ .pankow-fade-fast-leave-to {
240
+ opacity: 0;
241
+ }
242
+
243
+ .pankow-roll-down-enter-active {
244
+ transform-origin: center top;
245
+ animation: pankow-roll-down-in 0.1s;
246
+ }
247
+
248
+ .pankow-roll-down-leave-active {
249
+ transform-origin: center top;
250
+ animation: pankow-roll-down-in 0.1s reverse;
251
+ }
252
+
253
+ @keyframes pankow-roll-down-in {
254
+ 0% {
255
+ opacity: 0;
256
+ transform: scaleY(0.7);
257
+ }
258
+
259
+ 100% {
260
+ opacity: 1;
261
+ transform: scaleY(1);
262
+ }
263
+ }
264
+
265
+ .pankow-roll-up-enter-active {
266
+ transform-origin: center bottom;
267
+ animation: pankow-roll-up-in 0.1s;
268
+ }
269
+
270
+ .pankow-roll-up-leave-active {
271
+ transform-origin: center bottom;
272
+ animation: pankow-roll-up-in 0.1s reverse;
273
+ }
274
+
275
+ @keyframes pankow-roll-up-in {
276
+ 0% {
277
+ opacity: 0;
278
+ transform: scaleY(0.7);
279
+ }
280
+
281
+ 100% {
282
+ opacity: 1;
283
+ transform: scaleY(1);
284
+ }
285
+ }
286
+
287
+
288
+ .pankow-animation-pop-down-enter-active {
289
+ transform-origin: center top;
290
+ animation: pankow-animation-pop-down-in 0.1s;
291
+ }
292
+
293
+ .pankow-animation-pop-down-leave-active {
294
+ transform-origin: center top;
295
+ animation: pankow-animation-pop-down-in 0.1s reverse;
296
+ }
297
+
298
+ @keyframes pankow-animation-pop-down-in {
299
+ 0% {
300
+ opacity: 0;
301
+ transform: scale(0.7);
302
+ }
303
+
304
+ 100% {
305
+ opacity: 1;
306
+ transform: scale(1);
307
+ }
308
+ }
309
+
310
+ .pankow-animation-pop-up-enter-active {
311
+ transform-origin: center bottom;
312
+ animation: pankow-animation-pop-up-in 0.1s;
313
+ }
314
+
315
+ .pankow-animation-pop-up-leave-active {
316
+ transform-origin: center bottom;
317
+ animation: pankow-animation-pop-up-in 0.1s reverse;
318
+ }
319
+
320
+ @keyframes pankow-animation-pop-up-in {
321
+ 0% {
322
+ opacity: 0;
323
+ transform: scale(0.7);
324
+ }
325
+
326
+ 100% {
327
+ opacity: 1;
328
+ transform: scale(1);
329
+ }
330
+ }
331
+
332
+ .pankow-bounce-center-enter-active {
333
+ animation: pankow-bounce-center-in 0.2s;
334
+ }
335
+
336
+ .pankow-bounce-center-leave-active {
337
+ animation: pankow-bounce-center-in 0.2s reverse;
338
+ }
339
+
340
+ @keyframes pankow-bounce-center-in {
341
+ 0% {
342
+ opacity: 0;
343
+ transform: translateX(-50%) translateY(-50%) scale(0.9);
344
+ }
345
+
346
+ 100% {
347
+ opacity: 1;
348
+ transform: translateX(-50%) translateY(-50%) scale(1);
349
+ }
350
+ }
351
+
package/tooltip.js ADDED
@@ -0,0 +1,83 @@
1
+ /*
2
+
3
+ Tooltip Directive
4
+
5
+ ```
6
+ import tooltip from 'pankow/tooltip';
7
+
8
+ app.directive('tooltip', tooltip);
9
+
10
+ ...
11
+
12
+ <div v-tooltip.top="'hello'"></div>
13
+
14
+ ```
15
+
16
+ */
17
+
18
+ const TOP = 1;
19
+ const BOTTOM = 2;
20
+ const LEFT = 3;
21
+ const RIGHT = 4;
22
+
23
+ const padding = 10;
24
+
25
+ const tooltips = {};
26
+
27
+ function remove(key) {
28
+ if (tooltips[key]) tooltips[key].remove();
29
+ delete tooltips[key];
30
+ }
31
+
32
+ function update(target, value, modifiers, tooltip) {
33
+ if (!tooltip) return;
34
+
35
+ tooltip.innerText = value;
36
+
37
+ // BOTTOM is default
38
+ const pos = modifiers.top ? TOP : (modifiers.left ? LEFT : (modifiers.RIGHT ? RIGHT : BOTTOM));
39
+
40
+ const targetRect = target.getBoundingClientRect();
41
+ const tooltipRect = tooltip.getBoundingClientRect();
42
+
43
+ if (pos === TOP || pos === BOTTOM) tooltip.style.left = (targetRect.left + targetRect.width/2) - (tooltipRect.width/2) + 'px';
44
+ else if (pos === LEFT) tooltip.style.left = (targetRect.left - tooltipRect.width - padding) + 'px';
45
+ else tooltip.style.left = (targetRect.left + targetRect.width + padding) + 'px';
46
+
47
+ if (pos === LEFT || pos === RIGHT) tooltip.style.top = (targetRect.top + targetRect.height/2) - (tooltipRect.height/2) + 'px';
48
+ else if (pos === TOP) tooltip.style.top = (targetRect.top - tooltipRect.height - padding) + 'px';
49
+ else tooltip.style.top = (targetRect.bottom + padding) + 'px';
50
+ }
51
+
52
+ function mounted(el, binding, vnode) {
53
+ el.addEventListener('mouseenter', () => {
54
+ if (!binding.value) return remove(vnode.ctx.uid);
55
+
56
+ tooltips[vnode.ctx.uid] = document.createElement('div');
57
+ tooltips[vnode.ctx.uid].classList.add('pankow-tooltip');
58
+ window.document.body.appendChild(tooltips[vnode.ctx.uid]);
59
+
60
+ update(el, binding.value, binding.modifiers, tooltips[vnode.ctx.uid]);
61
+ });
62
+
63
+ el.addEventListener('mouseleave', () => {
64
+ remove(vnode.ctx.uid);
65
+ });
66
+ }
67
+
68
+ function updated(el, binding, vnode) {
69
+ if (!binding.value) return remove(vnode.ctx.uid);
70
+ update(el, binding.value, binding.modifiers, tooltips[vnode.ctx.uid]);
71
+ }
72
+
73
+ function beforeUnmount(el, binding, vnode) {
74
+ remove(vnode.ctx.uid);
75
+ }
76
+
77
+ const tooltip = {
78
+ mounted,
79
+ updated,
80
+ beforeUnmount
81
+ };
82
+
83
+ export default tooltip;