@cloudron/pankow 3.2.3 → 3.2.5

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.
@@ -0,0 +1,40 @@
1
+ <script setup>
2
+
3
+ import { computed } from 'vue';
4
+
5
+ const props = defineProps({
6
+ values: Array,
7
+ });
8
+
9
+ // const normalizedValue = computed(() => {
10
+ // if (props.value < 0) return 0;
11
+ // if (props.value > 100) return 100;
12
+ // return props.value;
13
+ // });
14
+
15
+ // we want 100 to be the circumverence so we can neatly use percentage: radius = 100 / ( 3,14159 * 2 ) = 15,9155
16
+ const radius = 15.9155;
17
+ const stroke = 10;
18
+
19
+ function calculateViewbox() {
20
+ return `0 0 ${radius*2+stroke} ${radius*2+stroke}`;
21
+ }
22
+
23
+ function calculateArcPath() {
24
+ return `M${radius+stroke/2} ${stroke/2} a ${radius} ${radius} 0 0 1 0 ${radius*2} a ${radius} ${radius} 0 0 1 0 -${radius*2}`;
25
+ }
26
+
27
+ </script>
28
+
29
+ <template>
30
+ <div class="pankow-circle-chart">
31
+ <svg :viewBox="calculateViewbox()" xmlns="http://www.w3.org/2000/svg">
32
+ <path :d="calculateArcPath()" fill="none" stroke="red" :stroke-width="stroke" stroke-dasharray="75, 100" @click.stop="onClick('red')" />
33
+ <path :d="calculateArcPath()" fill="none" stroke="green" :stroke-width="stroke" stroke-dasharray="30, 100" @click.stop="onClick('green') "/>
34
+ </svg>
35
+ </div>
36
+ </template>
37
+
38
+ <style>
39
+
40
+ </style>
@@ -54,7 +54,7 @@ function onActivated() {
54
54
  display: flex;
55
55
  align-items: center;
56
56
  user-select: none;
57
- padding: 6px 10px;
57
+ padding: 8px 10px;
58
58
  cursor: pointer;
59
59
  font-size: 14px; /* this also defines the overall widget size as all sizes are in rem */
60
60
  font-family: var(--font-family);
@@ -15,6 +15,10 @@ const props = defineProps({
15
15
  type: Boolean,
16
16
  default: false,
17
17
  },
18
+ busy: {
19
+ type: Boolean,
20
+ default: false,
21
+ },
18
22
  mode: String // only really "indeterminate" is supported
19
23
  });
20
24
 
@@ -29,7 +33,9 @@ const normalizedValue = computed(() => {
29
33
  <template>
30
34
  <div class="pankow-progress-bar">
31
35
  <div class="pankow-progress-bar-label" v-show="showLabel"><slot>{{ value + ' %' }}</slot></div>
32
- <div v-if="mode !== 'indeterminate'" class="pankow-progress-bar-filled" :style="{ width: normalizedValue+'%', height: slim ? '2px' : '6px' }"></div>
36
+ <div v-if="mode !== 'indeterminate'" class="pankow-progress-bar-filled" :style="{ width: normalizedValue+'%', height: slim ? '2px' : '6px' }">
37
+ <div v-if="busy" class="pankow-progress-bar-glow" :style="{ height: slim ? '2px' : '6px' }"></div>
38
+ </div>
33
39
  <div v-else class="pankow-progress-bar-indeterminate" :style="{ height: slim ? '2px' : '6px' }"></div>
34
40
  </div>
35
41
  </template>
@@ -37,6 +43,7 @@ const normalizedValue = computed(() => {
37
43
  <style>
38
44
 
39
45
  .pankow-progress-bar {
46
+ position: relative;
40
47
  font-weight: 700;
41
48
  min-height: 12px;
42
49
  user-select: none;
@@ -56,6 +63,28 @@ const normalizedValue = computed(() => {
56
63
  height: 6px;
57
64
  }
58
65
 
66
+ .pankow-progress-bar-glow {
67
+ width: 100%;
68
+ height: 6px;
69
+ display: inline-block;
70
+ position: absolute;
71
+ overflow: hidden;
72
+ border-radius: var(--pankow-border-radius);
73
+ }
74
+
75
+ .pankow-progress-bar-glow::after {
76
+ content: '';
77
+ width: 30%;
78
+ height: 100%;
79
+ background: linear-gradient(to right, transparent, rgba(255,255,255,0.7));
80
+ position: absolute;
81
+ top: 0;
82
+ left: 0;
83
+ box-sizing: border-box;
84
+ animation: pankow-progress-bar-indeterminate-animation 1.5s ease-in-out infinite;
85
+ border-radius: var(--pankow-border-radius);
86
+ }
87
+
59
88
  .pankow-progress-bar-indeterminate {
60
89
  width: 100%;
61
90
  height: 6px;
@@ -70,7 +99,7 @@ const normalizedValue = computed(() => {
70
99
  content: '';
71
100
  width: 90%;
72
101
  height: 100%;
73
- background: var(--pankow-color-primary);
102
+ background: linear-gradient(to right, transparent, var(--pankow-color-primary));
74
103
  position: absolute;
75
104
  top: 0;
76
105
  left: 0;
@@ -15,7 +15,7 @@
15
15
  <tr v-if="busy"><td :colspan="Object.keys(columns).length" style="text-align: center; padding: 20px;"><ProgressBar mode="indeterminate" :show-label="false" :slim="true"/></td></tr>
16
16
  <tr v-else-if="!busy && sortedItems.length === 0"><td :colspan="Object.keys(columns).length" class="pankow-table-placeholder">{{ placeholder }}</td></tr>
17
17
  <tr v-else class="pankow-table-row" :class="{ 'pankow-table-row-with-hover': hover }" v-for="item in sortedItems" @click="onRowClick(item)">
18
- <td class="pankow-table-cell" v-for="column in Object.keys(columns)" :style="{ width: typeof columns[column].width === 'string' ? columns[column].width : 'auto' }" :class="{ 'pankow-table-cell-hide-mobile': columns[column].hideMobile }">
18
+ <td class="pankow-table-cell" v-for="column in Object.keys(columns)" :style="{ width: typeof columns[column].width === 'string' ? columns[column].width : 'auto' }" :class="{ 'pankow-table-cell-hide-mobile': columns[column].hideMobile, 'pankow-table-cell-nowrap': columns[column].nowrap }">
19
19
  <slot :name="column" v-if="$slots[column]" v-bind="item"/>
20
20
  <span v-if="!$slots[column]">{{ (column in item) ? (item[column].label || item[column]) : `TableView Error: item has no property '${column}' nor a template with that name` }}</span>
21
21
  </td>
@@ -178,6 +178,10 @@ export default {
178
178
  height: 50px;
179
179
  }
180
180
 
181
+ .pankow-table-cell-nowrap {
182
+ white-space: nowrap;
183
+ }
184
+
181
185
  @media (max-width: 576px) {
182
186
  .pankow-table-cell-hide-mobile {
183
187
  display: none;
package/gallery/Index.vue CHANGED
@@ -656,6 +656,8 @@ onMounted(async () => {
656
656
  <br/><br/>
657
657
  <ProgressBar :value="progressValue" />
658
658
  <br/>
659
+ <ProgressBar :value="progressValue" :busy="true" />
660
+ <br/>
659
661
  <ProgressBar :value="progressValue">Custom label with {{ progressValue }}</ProgressBar>
660
662
  <br/>
661
663
  <ProgressBar mode="indeterminate" :show-label="false"/>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudron/pankow",
3
3
  "private": false,
4
- "version": "3.2.3",
4
+ "version": "3.2.5",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {
@@ -13,13 +13,13 @@
13
13
  "license": "ISC",
14
14
  "dependencies": {
15
15
  "@fontsource/inter": "^5.2.6",
16
- "@fortawesome/fontawesome-free": "^6.7.2",
16
+ "@fortawesome/fontawesome-free": "^7.0.0",
17
17
  "filesize": "^11.0.2",
18
18
  "monaco-editor": "^0.52.2"
19
19
  },
20
20
  "devDependencies": {
21
- "@vitejs/plugin-vue": "^6.0.0",
22
- "vite": "^7.0.4",
23
- "vue": "^3.5.17"
21
+ "@vitejs/plugin-vue": "^6.0.1",
22
+ "vite": "^7.0.6",
23
+ "vue": "^3.5.18"
24
24
  }
25
25
  }
package/utils.js CHANGED
@@ -103,6 +103,21 @@ function prettyDate(value) {
103
103
  return fromNow(date);
104
104
  }
105
105
 
106
+ function prettyShortDate(value) {
107
+ if (!value) return 'unknown';
108
+
109
+ const date = new Date(value);
110
+ if (isNaN(date.getTime())) return 'unknown';
111
+
112
+ const formatter = new Intl.DateTimeFormat(undefined, {
113
+ timeStyle: 'medium'
114
+ });
115
+
116
+ const formattedDate = formatter.format(date);
117
+
118
+ return formattedDate;
119
+ }
120
+
106
121
  function prettyLongDate(value) {
107
122
  if (!value) return 'unknown';
108
123
 
@@ -376,6 +391,7 @@ export {
376
391
  prettyBinarySize,
377
392
  prettyDecimalSize,
378
393
  prettyDate,
394
+ prettyShortDate,
379
395
  prettyLongDate,
380
396
  prettyFileSize,
381
397
  prettyEmailAddresses,
@@ -403,6 +419,7 @@ export default {
403
419
  prettyBinarySize,
404
420
  prettyDecimalSize,
405
421
  prettyDate,
422
+ prettyShortDate,
406
423
  prettyLongDate,
407
424
  prettyFileSize,
408
425
  prettyEmailAddresses,