@cloudron/pankow 3.5.4 → 3.5.6
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>
|
package/components/Menu.vue
CHANGED
|
@@ -287,7 +287,7 @@ defineExpose({
|
|
|
287
287
|
<div class="pankow-menu-backdrop" @click="onBackdrop($event)" @contextmenu="onBackdrop($event)" v-show="isOpen"></div>
|
|
288
288
|
<Transition :name="rollUp ? 'pankow-roll-up' : 'pankow-roll-down'">
|
|
289
289
|
<div class="pankow-menu" v-show="isOpen" ref="container" tabindex="0" @keydown.up.stop="selectUp()" @keydown.down.stop="selectDown()" @keydown.esc.stop="close()" @keydown="onKeyDown">
|
|
290
|
-
<TextInput placeholder="Filter ..." @keydown.up.stop="selectUp()" @keydown.down.stop="selectDown()" @keydown.stop @keydown.esc.stop="close()" @click.stop style="width: 100%; border: 0; padding: 8px 12px;" v-model="searchString" v-if="searchThreshold < model.length"/>
|
|
290
|
+
<TextInput placeholder="Filter ..." autocomplete="off" @keydown.up.stop="selectUp()" @keydown.down.stop="selectDown()" @keydown.stop @keydown.esc.stop="close()" @click.stop style="width: 100%; border: 0; padding: 8px 12px;" v-model="searchString" v-if="searchThreshold < model.length"/>
|
|
291
291
|
<component v-for="item in visibleItems" ref="itemElements" :is="item.type || (item.href ? MenuItemLink : MenuItem)" @activated="onItemActivated(item)" :item="item" :has-icons="hasIcons" />
|
|
292
292
|
<MenuItem v-if="model.length === 0" :item="emptyItem"/>
|
|
293
293
|
</div>
|
package/components/Popover.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span class="pankow-radio">
|
|
3
|
-
<input :name="name" :id="id || internalId" class="pankow-radio-input" type="radio" v-model="internalValue" :value="value" :disabled="disabled"/>
|
|
3
|
+
<input :name="name" :id="id || internalId" class="pankow-radio-input" type="radio" v-model="internalValue" :value="value" :disabled="disabled" :required="$attrs['required']"/>
|
|
4
4
|
<slot>
|
|
5
5
|
<label :for="id || internalId" class="pankow-radio-input-label">{{ label }}</label>
|
|
6
6
|
</slot>
|
|
@@ -74,6 +74,7 @@ const menuModel = computed(() => {
|
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
+
const nativeSelect = useTemplateRef('nativeSelect');
|
|
77
78
|
function selectIndex(index) {
|
|
78
79
|
const item = props.options[index];
|
|
79
80
|
|
|
@@ -84,6 +85,11 @@ function selectIndex(index) {
|
|
|
84
85
|
|
|
85
86
|
model.value = newValue;
|
|
86
87
|
emits('select', newValue);
|
|
88
|
+
|
|
89
|
+
// let the browser know about the changes
|
|
90
|
+
nativeSelect.value.value = newValue;
|
|
91
|
+
nativeSelect.value.dispatchEvent(new Event('input', { bubbles: true }));
|
|
92
|
+
nativeSelect.value.dispatchEvent(new Event('change', { bubbles: true }));
|
|
87
93
|
}
|
|
88
94
|
|
|
89
95
|
function onMenuClosed() {
|
|
@@ -163,7 +169,7 @@ onMounted(() => {
|
|
|
163
169
|
<template>
|
|
164
170
|
<div class="pankow-singleselect" :class="{ 'pankow-singleselect-disabled': disabled }" ref="elem" tabindex="0" @click="onClick" @keydown.enter="onOpen" @keydown.down.stop.prevent="onSelectNext" @keydown.up.stop.prevent="onSelectPrev" @keydown.esc.stop="onClose" @keydown.stop="onKeyDown($event)">
|
|
165
171
|
<!-- native select for required and accessibility handling -->
|
|
166
|
-
<select v-model="selectedKey" :required="$attrs['required']" style="display: none">
|
|
172
|
+
<select v-model="selectedKey" ref="nativeSelect" :required="$attrs['required']" style="display: none">
|
|
167
173
|
<option value=""></option>
|
|
168
174
|
<option v-for="item in options" :value="optionKey ? item[optionKey] : item">{{ item[optionLabel] }}</option>
|
|
169
175
|
</select>
|
package/components/TableView.vue
CHANGED
|
@@ -95,7 +95,12 @@ onMounted(() => {
|
|
|
95
95
|
<table class="pankow-table">
|
|
96
96
|
<thead class="pankow-table-header" v-if="sortedItems.length !== 0">
|
|
97
97
|
<tr>
|
|
98
|
-
<th v-for="column in Object.keys(columns)"
|
|
98
|
+
<th v-for="column in Object.keys(columns)"
|
|
99
|
+
class="pankow-table-header-column"
|
|
100
|
+
:class="{ 'pankow-table-header-column-sortable': columns[column].sort, 'pankow-table-cell-hide-mobile': columns[column].hideMobile }"
|
|
101
|
+
:style="{ 'text-align': columns[column].align || null }"
|
|
102
|
+
@click="toggleSort(column)"
|
|
103
|
+
>
|
|
99
104
|
<Icon v-if="columns[column].icon" :icon="columns[column].icon" />
|
|
100
105
|
{{ columns[column].label }}
|
|
101
106
|
<i v-show="sortBy === column" class="fa-solid" :class="{ 'fa-arrow-up': sortOrder === SORT_ORDER.DESC, 'fa-arrow-down': sortOrder === SORT_ORDER.ASC }"></i>
|
|
@@ -103,10 +108,20 @@ onMounted(() => {
|
|
|
103
108
|
</tr>
|
|
104
109
|
</thead>
|
|
105
110
|
<tbody>
|
|
106
|
-
<tr v-if="busy"
|
|
107
|
-
|
|
111
|
+
<tr v-if="busy">
|
|
112
|
+
<td :colspan="Object.keys(columns).length" style="text-align: center; padding: 20px;">
|
|
113
|
+
<ProgressBar mode="indeterminate" :show-label="false" :slim="true" v-show="finalBusy"/>
|
|
114
|
+
</td>
|
|
115
|
+
</tr>
|
|
116
|
+
<tr v-else-if="!busy && sortedItems.length === 0">
|
|
117
|
+
<td :colspan="Object.keys(columns).length" class="pankow-table-placeholder">{{ placeholder }}</td>
|
|
118
|
+
</tr>
|
|
108
119
|
<tr v-else class="pankow-table-row" :class="{ 'pankow-table-row-with-hover': hover }" v-for="item in sortedItems" @click="onRowClick(item)">
|
|
109
|
-
<td
|
|
120
|
+
<td v-for="column in Object.keys(columns)"
|
|
121
|
+
class="pankow-table-cell"
|
|
122
|
+
:style="{ 'text-align': columns[column].align || null, width: typeof columns[column].width === 'string' ? columns[column].width : 'auto' }"
|
|
123
|
+
:class="{ 'pankow-table-cell-hide-mobile': columns[column].hideMobile, 'pankow-table-cell-nowrap': columns[column].nowrap }"
|
|
124
|
+
>
|
|
110
125
|
<slot :name="column" v-if="$slots[column]" v-bind="item"/>
|
|
111
126
|
<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>
|
|
112
127
|
</td>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudron/pankow",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.5.
|
|
4
|
+
"version": "3.5.6",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"types": "types/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
26
26
|
"typescript": "^5.9.3",
|
|
27
|
-
"vite": "^7.1.
|
|
27
|
+
"vite": "^7.1.12",
|
|
28
28
|
"vue": "^3.5.22"
|
|
29
29
|
}
|
|
30
30
|
}
|