@cloudron/pankow 3.2.2 → 3.2.4
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/components/CircleChart.vue +40 -0
- package/components/Popover.vue +3 -5
- package/components/TableView.vue +5 -1
- package/components/TagInput.vue +1 -2
- package/components/TextInput.vue +2 -2
- package/components/TextInputRaw.vue +24 -0
- package/gallery/Index.vue +1 -1
- package/index.js +2 -0
- package/package.json +3 -3
- package/utils.js +17 -0
|
@@ -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>
|
package/components/Popover.vue
CHANGED
|
@@ -166,10 +166,9 @@ defineExpose({
|
|
|
166
166
|
position: fixed;
|
|
167
167
|
box-shadow: var(--pankow-menu-shadow);
|
|
168
168
|
border-radius: var(--pankow-border-radius);
|
|
169
|
-
background-color:
|
|
169
|
+
background-color: var(--pankow-input-background-color);
|
|
170
170
|
z-index: 3001;
|
|
171
|
-
color:
|
|
172
|
-
backdrop-filter: blur(10px);
|
|
171
|
+
color: var(--pankow-color-dark);
|
|
173
172
|
overflow: auto;
|
|
174
173
|
outline: none;
|
|
175
174
|
max-width: min(100%, 800px);
|
|
@@ -177,8 +176,7 @@ defineExpose({
|
|
|
177
176
|
|
|
178
177
|
@media (prefers-color-scheme: dark) {
|
|
179
178
|
.pankow-popover {
|
|
180
|
-
|
|
181
|
-
color: white;
|
|
179
|
+
color: var(--pankow-color-light-dark);
|
|
182
180
|
}
|
|
183
181
|
}
|
|
184
182
|
|
package/components/TableView.vue
CHANGED
|
@@ -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/components/TagInput.vue
CHANGED
|
@@ -52,11 +52,10 @@ function onRemoveIndex(index) {
|
|
|
52
52
|
display: inline-flex;
|
|
53
53
|
white-space: nowrap;
|
|
54
54
|
position: relative;
|
|
55
|
-
margin: 4px;
|
|
56
55
|
border: 1px solid var(--pankow-input-border-color);
|
|
57
56
|
color: var(--pankow-text-color);
|
|
58
57
|
background-color: var(--pankow-input-background-color);
|
|
59
|
-
padding:
|
|
58
|
+
padding: 4px 4px;
|
|
60
59
|
border-radius: var(--pankow-border-radius);
|
|
61
60
|
transition: border-color 250ms;
|
|
62
61
|
overflow: auto;
|
package/components/TextInput.vue
CHANGED
|
@@ -5,14 +5,14 @@ const props = defineProps({
|
|
|
5
5
|
placeholder: String,
|
|
6
6
|
readonly: {
|
|
7
7
|
type: Boolean,
|
|
8
|
-
default: false
|
|
8
|
+
default: false,
|
|
9
9
|
},
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<template>
|
|
15
|
-
<input class="pankow-text-input" type="text" :placeholder="placeholder" :readonly="readonly"
|
|
15
|
+
<input class="pankow-text-input" type="text" :placeholder="placeholder" :readonly="readonly" v-model.trim="model"/>
|
|
16
16
|
</template>
|
|
17
17
|
|
|
18
18
|
<style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
|
|
3
|
+
// For now the only difference to TextInput is that TextInputRaw does not trim the model value
|
|
4
|
+
|
|
5
|
+
const model = defineModel();
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
placeholder: String,
|
|
8
|
+
readonly: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: false,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<input class="pankow-text-input" type="text" :placeholder="placeholder" :readonly="readonly" v-model="model"/>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<style>
|
|
21
|
+
|
|
22
|
+
/* uses styles from TextInput.vue */
|
|
23
|
+
|
|
24
|
+
</style>
|
package/gallery/Index.vue
CHANGED
|
@@ -511,7 +511,7 @@ onMounted(async () => {
|
|
|
511
511
|
<h2 id="form">Form</h2>
|
|
512
512
|
<h3 id="form-textinput">Text Input</h3>
|
|
513
513
|
<FormGroup>
|
|
514
|
-
<label for="textInput">Label: {{ textInputValue }}</label>
|
|
514
|
+
<label for="textInput">Label: |{{ textInputValue }}| (input gets trimmed)</label>
|
|
515
515
|
<TextInput id="textInput" v-model="textInputValue" placeholder="Some text input" style="width: 600px"/>
|
|
516
516
|
</FormGroup>
|
|
517
517
|
<FormGroup>
|
package/index.js
CHANGED
|
@@ -34,6 +34,7 @@ import TableView from './components/TableView.vue';
|
|
|
34
34
|
import TabView from './components/TabView.vue';
|
|
35
35
|
import TagInput from './components/TagInput.vue';
|
|
36
36
|
import TextInput from './components/TextInput.vue';
|
|
37
|
+
import TextInputRaw from './components/TextInputRaw.vue';
|
|
37
38
|
import TopBar from './components/TopBar.vue';
|
|
38
39
|
import InputGroup from './components/InputGroup.vue'; // must be at the end for border-radius handling
|
|
39
40
|
|
|
@@ -76,6 +77,7 @@ export {
|
|
|
76
77
|
TabView,
|
|
77
78
|
TagInput,
|
|
78
79
|
TextInput,
|
|
80
|
+
TextInputRaw,
|
|
79
81
|
TopBar,
|
|
80
82
|
|
|
81
83
|
fetcher,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudron/pankow",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.2.
|
|
4
|
+
"version": "3.2.4",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"scripts": {
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@fontsource/inter": "^5.2.6",
|
|
16
16
|
"@fortawesome/fontawesome-free": "^6.7.2",
|
|
17
|
-
"filesize": "^11.0.
|
|
17
|
+
"filesize": "^11.0.2",
|
|
18
18
|
"monaco-editor": "^0.52.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@vitejs/plugin-vue": "^6.0.0",
|
|
22
|
-
"vite": "^7.0.
|
|
22
|
+
"vite": "^7.0.5",
|
|
23
23
|
"vue": "^3.5.17"
|
|
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,
|