@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
package/.gitlab-ci.yml
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# jobs (defined using a top level key) belong to a stage. the jobs of a stage are run in parallel.
|
|
2
|
+
# stages are run in sequence.
|
|
3
|
+
# artifacts are attached to the jobs on success (downloadable from UI)
|
|
4
|
+
# cache is preserved between pipelines (and not meant for jobs)
|
|
5
|
+
|
|
6
|
+
default:
|
|
7
|
+
image: cloudron/base:5.0.0@sha256:04fd70dbd8ad6149c19de39e35718e024417c3e01dc9c6637eaf4a41ec4e596c
|
|
8
|
+
|
|
9
|
+
variables:
|
|
10
|
+
DEMO_SERVER: pankow.nebulon.de
|
|
11
|
+
|
|
12
|
+
build-gallery:
|
|
13
|
+
stage: build
|
|
14
|
+
script:
|
|
15
|
+
- npm install && npm run build
|
|
16
|
+
artifacts:
|
|
17
|
+
paths:
|
|
18
|
+
- gallery/dist/
|
|
19
|
+
expire_in: 2 hours
|
|
20
|
+
|
|
21
|
+
deploy-gallery:
|
|
22
|
+
stage: deploy
|
|
23
|
+
script:
|
|
24
|
+
- npm install -g cloudron-surfer && surfer put --server ${DEMO_SERVER} --token ${PANKOW_DEMO_SURFER_TOKEN} --delete gallery/dist/* /
|
|
25
|
+
only:
|
|
26
|
+
- main
|
|
27
|
+
|
|
28
|
+
stages:
|
|
29
|
+
- build
|
|
30
|
+
- deploy
|
package/.jshintrc
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 Cloudron UG
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
## Pankow
|
|
2
|
+
|
|
3
|
+
Pankow is the UI component library for scaffolding Cloudron apps. It is based on [Vue.js](https://vuejs.org/) using [Vite](https://vitejs.dev/) as the bundler.
|
|
4
|
+
The main use-case is to provide common Cloudron related UI compents like a login screen and common layout with header, body and footers.
|
|
5
|
+
|
|
6
|
+
### Getting started
|
|
7
|
+
|
|
8
|
+
Open a terminal in the Cloudron app main folder. Run the following command to init a subfolder where the UI project will be contained.
|
|
9
|
+
For consistency the project name here is `frontend`, so make sure to specify that as the first question asked in the init wizard.
|
|
10
|
+
All other options can be accpeted as defaults.
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npm init vue@latest
|
|
14
|
+
cd frontend
|
|
15
|
+
npm install
|
|
16
|
+
npm run dev
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This will install and build the initial project with the default Vue.js Hello World page.
|
|
20
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<template>
|
|
5
|
+
<div class="pankow-bottom-bar">
|
|
6
|
+
<slot>
|
|
7
|
+
© 2024 <a href="https://cloudron.io" rel="noopener noreferrer" target="_blank">Cloudron</a> <a href="https://forum.cloudron.io" rel="noopener noreferrer" target="_blank">Forum <i class="fa fa-comments"></i></a>
|
|
8
|
+
</slot>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<style>
|
|
13
|
+
|
|
14
|
+
.pankow-bottom-bar {
|
|
15
|
+
width: 100%;
|
|
16
|
+
background-color: var(--pankow-color-background);
|
|
17
|
+
text-align: center;
|
|
18
|
+
box-shadow: 0 2px 5px rgba(0,0,0,.1);
|
|
19
|
+
padding: 5px 10px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
|
|
3
|
+
import Icon from './Icon.vue';
|
|
4
|
+
|
|
5
|
+
const emit = defineEmits([ 'click' ]);
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
items: {
|
|
8
|
+
type: Array
|
|
9
|
+
},
|
|
10
|
+
home: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: {
|
|
13
|
+
label: 'Home',
|
|
14
|
+
icon: 'fa-solid fa-house',
|
|
15
|
+
route: null,
|
|
16
|
+
action(item, event) {}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
function onClick() {
|
|
22
|
+
emit('click');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div class="pankow-breadcrumb">
|
|
29
|
+
<a class="pankow-breadcrumb-item" :href="home.route" @click="home.action ? home.action(home, $event) : null" @keydown.enter="home.action ? home.action(home, $event) : null" tabindex="0">
|
|
30
|
+
<Icon :class="home.icon"/> {{ home.label }}
|
|
31
|
+
</a>
|
|
32
|
+
<span v-for="item in items">
|
|
33
|
+
<Icon icon="fa-solid fa-chevron-right" class="pankow-breadcrumb-separator"/>
|
|
34
|
+
<a class="pankow-breadcrumb-item" :href="item.route" @click="item.action ? item.action(home, $event) : null" @keydown.enter="item.action ? item.action(home, $event) : null" tabindex="0">
|
|
35
|
+
<Icon v-if="item.icon" :class="item.icon"/> {{ item.label }}
|
|
36
|
+
</a>
|
|
37
|
+
</span>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<style>
|
|
42
|
+
|
|
43
|
+
.pankow-breadcrumb {
|
|
44
|
+
display: block;
|
|
45
|
+
overflow: auto;
|
|
46
|
+
white-space: nowrap;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.pankow-breadcrumb-separator {
|
|
50
|
+
margin: 0 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.pankow-breadcrumb-item {
|
|
54
|
+
display: inline-block;
|
|
55
|
+
margin: 4px;
|
|
56
|
+
user-select: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.pankow-breadcrumb-item:hover {
|
|
60
|
+
color: var(--pankow-color-primary);
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
|
|
3
|
+
import { useTemplateRef } from 'vue';
|
|
4
|
+
import Menu from './Menu.vue';
|
|
5
|
+
import Icon from './Icon.vue';
|
|
6
|
+
import Spinner from './Spinner.vue';
|
|
7
|
+
|
|
8
|
+
const emit = defineEmits([ 'click' ]);
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
icon: String,
|
|
11
|
+
href: String,
|
|
12
|
+
target: String,
|
|
13
|
+
iconRight: String,
|
|
14
|
+
menu: Array,
|
|
15
|
+
disabled: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false
|
|
18
|
+
},
|
|
19
|
+
loading: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false
|
|
22
|
+
},
|
|
23
|
+
showDropdown: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: true
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const elem = useTemplateRef('elem');
|
|
30
|
+
const menuItem = useTemplateRef('menuItem');
|
|
31
|
+
|
|
32
|
+
function onClick(event) {
|
|
33
|
+
if (props.disabled) return;
|
|
34
|
+
|
|
35
|
+
if (props.menu) {
|
|
36
|
+
if (menuItem.value.isOpen) menuItem.value.close();
|
|
37
|
+
else menuItem.value.open(event, elem.value);
|
|
38
|
+
} else {
|
|
39
|
+
emit('click', event, elem.value);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<component ref="elem" :is="href ? 'a' : 'div'" class="pankow-button" role="button" type="button" :class="{ 'pankow-button-disabled': disabled }" @click="onClick" @keydown.enter="onClick" :href="disabled ? null : href" :target="target" tabindex="0">
|
|
47
|
+
<Menu ref="menuItem" :model="menu" v-if="menu"></Menu>
|
|
48
|
+
<Spinner v-show="loading" style="stroke: white;" :class="{ 'pankow-button-icon-with-text': $slots['default'] }"/>
|
|
49
|
+
<Icon v-show="!loading && icon" :icon="icon" :class="{ 'pankow-button-icon-with-text': $slots['default'] }" />
|
|
50
|
+
<slot></slot>
|
|
51
|
+
<Icon v-show="menu && showDropdown" icon="fa-solid fa-chevron-down" class="pankow-button-icon-right-with-text" />
|
|
52
|
+
</component>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<style>
|
|
56
|
+
|
|
57
|
+
.pankow-button {
|
|
58
|
+
font-weight: 400;
|
|
59
|
+
font-size: 14px;
|
|
60
|
+
color: white;
|
|
61
|
+
user-select: none;
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
text-align: center;
|
|
64
|
+
border: none;
|
|
65
|
+
padding: var(--pankow-input-vertial-padding) max(12px, var(--pankow-input-horizontal-padding));
|
|
66
|
+
border-radius: var(--pankow-border-radius);
|
|
67
|
+
text-decoration: none;
|
|
68
|
+
display: inline-block;
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
border: 1px solid transparent;
|
|
71
|
+
transition: background 250ms, border-color 250ms;
|
|
72
|
+
min-width: 100px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.pankow-button[tool] {
|
|
76
|
+
min-width: auto;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.pankow-button-disabled {
|
|
80
|
+
cursor: not-allowed;
|
|
81
|
+
opacity: 0.5;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.pankow-button-icon-with-text {
|
|
85
|
+
margin-right: 7px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.pankow-button-icon-right-with-text {
|
|
89
|
+
padding-left: 7px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.pankow-button[small] {
|
|
93
|
+
font-size: 12px;
|
|
94
|
+
padding: 3px 6px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.pankow-button[large] {
|
|
98
|
+
font-size: 24px;
|
|
99
|
+
padding: 8px 16px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.pankow-button[outline] {
|
|
103
|
+
background: transparent;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.pankow-button:hover,
|
|
107
|
+
.pankow-button:active,
|
|
108
|
+
.pankow-button:focus,
|
|
109
|
+
.pankow-button[primary]:hover,
|
|
110
|
+
.pankow-button[primary]:active,
|
|
111
|
+
.pankow-button[primary]:focus,
|
|
112
|
+
.pankow-button[danger]:hover,
|
|
113
|
+
.pankow-button[danger]:active,
|
|
114
|
+
.pankow-button[danger]:focus,
|
|
115
|
+
.pankow-button[success]:hover,
|
|
116
|
+
.pankow-button[success]:active,
|
|
117
|
+
.pankow-button[success]:focus,
|
|
118
|
+
.pankow-button[secondary]:hover,
|
|
119
|
+
.pankow-button[secondary]:active,
|
|
120
|
+
.pankow-button[secondary]:focus {
|
|
121
|
+
text-decoration: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* primary */
|
|
125
|
+
.pankow-button {
|
|
126
|
+
background: var(--pankow-color-primary);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.pankow-button[outline] {
|
|
130
|
+
border-color: var(--pankow-color-primary);
|
|
131
|
+
color: var(--pankow-color-primary);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.pankow-button[plain] {
|
|
135
|
+
border-color: transparent;
|
|
136
|
+
background: transparent;
|
|
137
|
+
color: var(--pankow-color-primary);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.pankow-button:hover,
|
|
141
|
+
.pankow-button[outline]:hover,
|
|
142
|
+
.pankow-button[plain]:hover {
|
|
143
|
+
background: var(--pankow-color-primary-hover);
|
|
144
|
+
color: white;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.pankow-button:active:not(.pankow-button-disabled),
|
|
148
|
+
.pankow-button[outline]:active:not(.pankow-button-disabled) {
|
|
149
|
+
background: var(--pankow-color-primary-active);
|
|
150
|
+
border-color: var(--pankow-color-primary-active);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* danger */
|
|
154
|
+
.pankow-button[danger] {
|
|
155
|
+
background: var(--pankow-color-danger);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.pankow-button[danger][outline] {
|
|
159
|
+
background: transparent;
|
|
160
|
+
border-color: var(--pankow-color-danger);
|
|
161
|
+
color: var(--pankow-color-danger);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.pankow-button[danger][plain] {
|
|
165
|
+
border-color: transparent;
|
|
166
|
+
background: transparent;
|
|
167
|
+
color: var(--pankow-color-danger);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.pankow-button[danger]:hover,
|
|
171
|
+
.pankow-button[danger][outline]:hover,
|
|
172
|
+
.pankow-button[danger][plain]:hover {
|
|
173
|
+
background: var(--pankow-color-danger-hover);
|
|
174
|
+
color: white;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.pankow-button[danger]:active:not(.pankow-button-disabled),
|
|
178
|
+
.pankow-button[danger][outline]:active:not(.pankow-button-disabled) {
|
|
179
|
+
background: var(--pankow-color-danger-active);
|
|
180
|
+
border-color: var(--pankow-color-danger-active);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* success */
|
|
184
|
+
.pankow-button[success] {
|
|
185
|
+
background: var(--pankow-color-success);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.pankow-button[success][outline] {
|
|
189
|
+
background: transparent;
|
|
190
|
+
border-color: var(--pankow-color-success);
|
|
191
|
+
color: var(--pankow-color-success);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.pankow-button[success][plain] {
|
|
195
|
+
border-color: transparent;
|
|
196
|
+
background: transparent;
|
|
197
|
+
color: var(--pankow-color-success);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.pankow-button[success]:hover,
|
|
201
|
+
.pankow-button[success][plain]:hover,
|
|
202
|
+
.pankow-button[success][outline]:hover {
|
|
203
|
+
background: var(--pankow-color-success-hover);
|
|
204
|
+
color: white;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.pankow-button[success]:active:not(.pankow-button-disabled),
|
|
208
|
+
.pankow-button[success][outline]:active:not(.pankow-button-disabled) {
|
|
209
|
+
background: var(--pankow-color-success-active);
|
|
210
|
+
border-color: var(--pankow-color-success-active);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* secondary */
|
|
214
|
+
.pankow-button[secondary] {
|
|
215
|
+
background: var(--pankow-color-secondary);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.pankow-button[secondary][outline] {
|
|
219
|
+
background: transparent;
|
|
220
|
+
border-color: var(--pankow-color-secondary);
|
|
221
|
+
color: var(--pankow-color-secondary);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.pankow-button[secondary][plain] {
|
|
225
|
+
border-color: transparent;
|
|
226
|
+
background: transparent;
|
|
227
|
+
color: var(--pankow-color-secondary);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.pankow-button[secondary]:hover,
|
|
231
|
+
.pankow-button[secondary][plain]:hover,
|
|
232
|
+
.pankow-button[secondary][outline]:hover {
|
|
233
|
+
background: var(--pankow-color-secondary-hover);
|
|
234
|
+
color: white;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.pankow-button[secondary]:active:not(.pankow-button-disabled),
|
|
238
|
+
.pankow-button[secondary][outline]:active:not(.pankow-button-disabled) {
|
|
239
|
+
background: var(--pankow-color-secondary-active);
|
|
240
|
+
border-color: var(--pankow-color-secondary-active);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<template>
|
|
5
|
+
<div class="pankow-button-group">
|
|
6
|
+
<slot></slot>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<style>
|
|
11
|
+
|
|
12
|
+
.pankow-button-group {
|
|
13
|
+
display: inline-block;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pankow-button-group > .pankow-button {
|
|
18
|
+
border-radius: 0;
|
|
19
|
+
margin-left: 0;
|
|
20
|
+
margin-right: 0;
|
|
21
|
+
border-left-width: 0.5px;
|
|
22
|
+
border-right-width: 0.5px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.pankow-button-group > .pankow-button:first-child {
|
|
26
|
+
border-top-left-radius: var(--pankow-border-radius);
|
|
27
|
+
border-bottom-left-radius: var(--pankow-border-radius);
|
|
28
|
+
border-left-width: 1px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.pankow-button-group > .pankow-button:last-child {
|
|
32
|
+
border-top-right-radius: var(--pankow-border-radius);
|
|
33
|
+
border-bottom-right-radius: var(--pankow-border-radius);
|
|
34
|
+
border-right-width: 1px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
</style>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
|
|
3
|
+
import { uuidv4 } from '../utils.js';
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
label: String,
|
|
7
|
+
id: String,
|
|
8
|
+
disabled: null
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const model = defineModel({ type: Boolean });
|
|
12
|
+
|
|
13
|
+
const internalId = uuidv4();
|
|
14
|
+
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<span class="pankow-checkbox">
|
|
19
|
+
<input :id="id || internalId" class="pankow-checkbox-input" type="checkbox" v-model="model" :disabled="disabled"/>
|
|
20
|
+
<slot>
|
|
21
|
+
<label :for="id || internalId" class="pankow-checkbox-input-label">{{ label }}</label>
|
|
22
|
+
</slot>
|
|
23
|
+
</span>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<style>
|
|
27
|
+
|
|
28
|
+
.pankow-checkbox {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
margin: 4px 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.pankow-checkbox-input-label {
|
|
36
|
+
display: inline-block;
|
|
37
|
+
vertical-align: middle;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
user-select: none;
|
|
40
|
+
margin: 0;
|
|
41
|
+
margin-left: 6px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.pankow-checkbox-input {
|
|
45
|
+
appearance: none;
|
|
46
|
+
height: 19px;
|
|
47
|
+
width: 19px;
|
|
48
|
+
outline: none;
|
|
49
|
+
display: inline-block;
|
|
50
|
+
position: relative;
|
|
51
|
+
margin: 0;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
border: 1px solid #ced4da;
|
|
54
|
+
background: var(--state-background, white);
|
|
55
|
+
transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
|
|
56
|
+
border-radius: 3px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@media (prefers-color-scheme: dark) {
|
|
60
|
+
.pankow-checkbox-input {
|
|
61
|
+
color: var(--pankow-color-light-dark);
|
|
62
|
+
background: var(--pankow-color-dark);
|
|
63
|
+
border: 1px solid var(--pankow-color-dark);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.pankow-checkbox-input:after {
|
|
68
|
+
content: "";
|
|
69
|
+
display: block;
|
|
70
|
+
position: absolute;
|
|
71
|
+
opacity: var(--state-opacity, 0);
|
|
72
|
+
width: 5px;
|
|
73
|
+
height: 8px;
|
|
74
|
+
border: 2px solid white;
|
|
75
|
+
border-top: 0;
|
|
76
|
+
border-left: 0;
|
|
77
|
+
left: 6px;
|
|
78
|
+
top: 3px;
|
|
79
|
+
transform: rotate(43deg);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.pankow-checkbox-input:checked {
|
|
83
|
+
--state-background: var(--pankow-color-primary);
|
|
84
|
+
--state-opacity: 1;
|
|
85
|
+
border: 1px solid transparent;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.pankow-checkbox-input:disabled {
|
|
89
|
+
cursor: not-allowed;
|
|
90
|
+
opacity: 0.5;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.pankow-checkbox-input:disabled + label {
|
|
94
|
+
cursor: not-allowed;
|
|
95
|
+
opacity: 0.5;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.pankow-checkbox-input:hover {
|
|
99
|
+
border: 1px solid var(--pankow-color-dark);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@media (prefers-color-scheme: dark) {
|
|
103
|
+
.pankow-checkbox-input:hover {
|
|
104
|
+
border: 1px solid var(--pankow-color-light-dark);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.pankow-checkbox-input:focus {
|
|
109
|
+
border: 1px solid var(--pankow-color-primary);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
</style>
|