viur-ui 0.0.1
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/README.md +79 -0
- package/index.d.ts +351 -0
- package/index.js +46 -0
- package/package.json +84 -0
- package/src/components/Browser/Browser.vue +496 -0
- package/src/components/Browser/TreeNav.vue +408 -0
- package/src/components/Browser/ViurBrowser.d.vue.ts +64 -0
- package/src/components/Browser/ViurBrowser.vue +271 -0
- package/src/components/Browser/dragSession.ts +134 -0
- package/src/components/Browser/index.ts +14 -0
- package/src/components/Browser/types.ts +30 -0
- package/src/components/DataTable/ColumnFilterPanel.vue +225 -0
- package/src/components/DataTable/DataTable.vue +3155 -0
- package/src/components/DataTable/ViurDataTable.d.vue.ts +72 -0
- package/src/components/DataTable/ViurDataTable.vue +331 -0
- package/src/components/DataTable/columns.ts +400 -0
- package/src/components/DataTable/index.ts +60 -0
- package/src/components/DataTable/rows.ts +446 -0
- package/src/components/DataTable/types.ts +267 -0
- package/src/components/DataTable/useColumnLayout.ts +294 -0
- package/src/components/DataTable/useGridNavigation.ts +193 -0
- package/src/components/DataTable/useVirtualRows.ts +126 -0
- package/src/components/DataTable/viurColumns.ts +330 -0
- package/src/forms/ViForm.d.vue.ts +106 -0
- package/src/forms/ViForm.vue +592 -0
- package/src/forms/ViFormCategory.vue +57 -0
- package/src/forms/bones/Bone.vue +1023 -0
- package/src/forms/bones/BoneActions.vue +127 -0
- package/src/forms/bones/BoneLabel.vue +122 -0
- package/src/forms/bones/BoneMultipleList.vue +91 -0
- package/src/forms/bones/BoneMultipleWrapper.vue +105 -0
- package/src/forms/bones/BoneNestedWrapper.vue +155 -0
- package/src/forms/bones/BoneSingleEntry.vue +51 -0
- package/src/forms/bones/FilterBone.vue +694 -0
- package/src/forms/bones/actionbar/defaultBar.vue +98 -0
- package/src/forms/bones/actionbar/fileBar.vue +165 -0
- package/src/forms/bones/actionbar/relationalBar.vue +125 -0
- package/src/forms/bones/actions/ActionDialog.vue +70 -0
- package/src/forms/bones/actions/Debug.vue +106 -0
- package/src/forms/bones/actions/Delete.vue +13 -0
- package/src/forms/bones/actions/DescribeImage.vue +201 -0
- package/src/forms/bones/actions/Download.vue +27 -0
- package/src/forms/bones/actions/Placeholder.vue +14 -0
- package/src/forms/bones/actions/Translation.vue +238 -0
- package/src/forms/bones/actions/index.js +280 -0
- package/src/forms/bones/bone.d.ts +45 -0
- package/src/forms/bones/country_information.json +779 -0
- package/src/forms/bones/index.js +225 -0
- package/src/forms/bones/uploadAdapter.js +46 -0
- package/src/forms/bones/utils.js +284 -0
- package/src/forms/bones/view/base_item.vue +35 -0
- package/src/forms/bones/view/boneLogic.js +202 -0
- package/src/forms/bones/view/index.js +5 -0
- package/src/forms/bones/widgets/booleanBone.vue +83 -0
- package/src/forms/bones/widgets/booleanBoneChoose.vue +57 -0
- package/src/forms/bones/widgets/booleanBoneSelect.vue +58 -0
- package/src/forms/bones/widgets/codeBone.vue +214 -0
- package/src/forms/bones/widgets/colorBone.vue +75 -0
- package/src/forms/bones/widgets/dateBone.vue +114 -0
- package/src/forms/bones/widgets/emailBone.vue +100 -0
- package/src/forms/bones/widgets/fileBone.vue +273 -0
- package/src/forms/bones/widgets/jsonBone.vue +63 -0
- package/src/forms/bones/widgets/keyBone.vue +71 -0
- package/src/forms/bones/widgets/numericBone.vue +125 -0
- package/src/forms/bones/widgets/passwordBone.vue +215 -0
- package/src/forms/bones/widgets/phoneBone.vue +173 -0
- package/src/forms/bones/widgets/rawBone.vue +94 -0
- package/src/forms/bones/widgets/recordBone.vue +64 -0
- package/src/forms/bones/widgets/relationalBone.vue +164 -0
- package/src/forms/bones/widgets/relationalBoneSelect.vue +120 -0
- package/src/forms/bones/widgets/selectBone.vue +122 -0
- package/src/forms/bones/widgets/selectBoneChoose.vue +104 -0
- package/src/forms/bones/widgets/spatialBone.vue +111 -0
- package/src/forms/bones/widgets/stringBone.vue +139 -0
- package/src/forms/bones/widgets/textBone.vue +641 -0
- package/src/forms/install.d.ts +4 -0
- package/src/forms/install.js +43 -0
- package/src/forms/layouts/LayloutList2Columns.vue +57 -0
- package/src/forms/layouts/LayoutCategory.vue +38 -0
- package/src/forms/layouts/LayoutList.vue +31 -0
- package/src/forms/utils.js +601 -0
- package/src/public/assets/icons/fontawesome-manifest.json +8 -0
- package/src/public/assets/icons/regular/file.svg +1 -0
- package/src/public/assets/icons/solid/arrows-left-right.svg +1 -0
- package/src/public/assets/icons/solid/bug.svg +1 -0
- package/src/public/assets/icons/solid/check.svg +1 -0
- package/src/public/assets/icons/solid/circle-info.svg +1 -0
- package/src/public/assets/icons/solid/compress.svg +1 -0
- package/src/public/assets/icons/solid/download.svg +1 -0
- package/src/public/assets/icons/solid/expand.svg +1 -0
- package/src/public/assets/icons/solid/grip-vertical.svg +1 -0
- package/src/public/assets/icons/solid/plus.svg +1 -0
- package/src/public/assets/icons/solid/question.svg +1 -0
- package/src/public/assets/icons/solid/triangle-exclamation.svg +1 -0
- package/src/public/assets/icons/solid/upload.svg +1 -0
- package/src/public/assets/icons/solid/xmark.svg +1 -0
- package/src/request/cache.js +183 -0
- package/src/request/configStore.js +516 -0
- package/src/request/envelope.js +211 -0
- package/src/request/index.js +35 -0
- package/src/request/messageStore.js +201 -0
- package/src/request/request.js +752 -0
- package/src/request/skel.js +90 -0
- package/src/theme/colorStore.js +168 -0
- package/src/translations/de.js +178 -0
- package/src/translations/en.js +177 -0
- package/src/user/LoginScreen.d.vue.ts +54 -0
- package/src/user/LoginScreen.vue +627 -0
- package/src/user/google.js +75 -0
- package/src/user/index.js +3 -0
- package/src/user/store.d.ts +59 -0
- package/src/user/store.js +183 -0
- package/src/webawesomeCompat.css +72 -0
- package/src/webawesomeConfig.js +61 -0
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template v-if="state.editor">
|
|
3
|
+
<template v-if="boneState.bonestructure?.['valid_html'] || boneState.bonestructure?.['validHtml']">
|
|
4
|
+
<ckeditor
|
|
5
|
+
v-model="state.value"
|
|
6
|
+
:editor="state.editor"
|
|
7
|
+
:config="state.editorConfig"
|
|
8
|
+
:disabled="boneState?.readonly"
|
|
9
|
+
:required="
|
|
10
|
+
boneState.bonestructure.required && !boneState.bonestructure.multiple && !boneState.bonestructure.languages
|
|
11
|
+
"
|
|
12
|
+
class="bone-widget bone-widget-text bone-widget-text-default"
|
|
13
|
+
:class="([`bone-widget-text-${name}`], [`bone-widget-text-${name}-html`])"
|
|
14
|
+
:data-user-invalid="boneState.errorMessages.length === 0 ? undefined : true"
|
|
15
|
+
@ready="onReady"
|
|
16
|
+
@input="changeEvent"
|
|
17
|
+
></ckeditor>
|
|
18
|
+
<input
|
|
19
|
+
type="text"
|
|
20
|
+
class="bone-widget-text-hidden"
|
|
21
|
+
:value="state.value"
|
|
22
|
+
:required="
|
|
23
|
+
boneState.bonestructure.required && !boneState.bonestructure.multiple && !boneState.bonestructure.languages
|
|
24
|
+
"
|
|
25
|
+
/>
|
|
26
|
+
</template>
|
|
27
|
+
<wa-textarea
|
|
28
|
+
v-else
|
|
29
|
+
class="bone-widget bone-widget-text bone-widget-text-default"
|
|
30
|
+
:class="[`bone-widget-text-${name}`]"
|
|
31
|
+
:disabled="boneState?.readonly"
|
|
32
|
+
:value="value"
|
|
33
|
+
:required="
|
|
34
|
+
boneState.bonestructure.required && !boneState.bonestructure.multiple && !boneState.bonestructure.languages
|
|
35
|
+
"
|
|
36
|
+
:placeholder="state.placeholder"
|
|
37
|
+
:data-user-invalid="boneState.errorMessages.length === 0 ? undefined : true"
|
|
38
|
+
@input="changeEventTextarea"
|
|
39
|
+
></wa-textarea>
|
|
40
|
+
</template>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script setup>
|
|
44
|
+
import { reactive, onMounted, inject, computed, watch, onBeforeMount } from "vue"
|
|
45
|
+
import { Ckeditor } from "@ckeditor/ckeditor5-vue"
|
|
46
|
+
import {
|
|
47
|
+
ClassicEditor,
|
|
48
|
+
Essentials,
|
|
49
|
+
Paragraph,
|
|
50
|
+
Bold,
|
|
51
|
+
Italic,
|
|
52
|
+
SourceEditing,
|
|
53
|
+
BlockQuote,
|
|
54
|
+
Heading,
|
|
55
|
+
Image,
|
|
56
|
+
ImageStyle,
|
|
57
|
+
ImageToolbar,
|
|
58
|
+
ImageUpload,
|
|
59
|
+
ImageResizeButtons,
|
|
60
|
+
FileRepository,
|
|
61
|
+
ImageBlock,
|
|
62
|
+
ImageInline,
|
|
63
|
+
Indent,
|
|
64
|
+
IndentBlock,
|
|
65
|
+
Link,
|
|
66
|
+
List,
|
|
67
|
+
Table,
|
|
68
|
+
TableToolbar,
|
|
69
|
+
TextTransformation,
|
|
70
|
+
Underline,
|
|
71
|
+
Alignment,
|
|
72
|
+
RemoveFormat,
|
|
73
|
+
GeneralHtmlSupport,
|
|
74
|
+
} from "ckeditor5"
|
|
75
|
+
import coreTranslations from "ckeditor5/dist/translations/de.js"
|
|
76
|
+
import "ckeditor5/dist/ckeditor5.css"
|
|
77
|
+
import { ViURUploadAdapterPlugin } from "../uploadAdapter"
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Mehrzeiliges Textfeld für längere Inhalte, wahlweise als Textarea oder Rich-Text-Editor (CKEditor 5).
|
|
81
|
+
*
|
|
82
|
+
* Wenn `boneState.bonestructure.valid_html` oder `boneState.bonestructure.validHtml` gesetzt ist,
|
|
83
|
+
* wird ein CKEditor 5 (ClassicEditor) gerendert. Die sichtbaren Toolbar-Aktionen werden anhand
|
|
84
|
+
* der erlaubten HTML-Tags (`validTags`) gefiltert. Ohne HTML-Konfiguration erscheint ein
|
|
85
|
+
* einfaches `<wa-textarea>`. Bei `boneState.label === "placeholder"` wird der Bone-Name als
|
|
86
|
+
* Placeholder angezeigt statt als Label.
|
|
87
|
+
*
|
|
88
|
+
* @displayName TextBone
|
|
89
|
+
*
|
|
90
|
+
* @cssClass bone-widget - Basis-Klasse aller Bone-Widgets
|
|
91
|
+
* @cssClass bone-widget-text - Kennzeichnet den Bone-Typ
|
|
92
|
+
* @cssClass bone-widget-text-default - Standard-Variante (Textarea oder CKEditor)
|
|
93
|
+
* @cssClass bone-widget-text-{name} - Dynamisch gesetzt auf den Bone-Namen, z.B. `bone-widget-text-content`
|
|
94
|
+
* @cssClass bone-widget-text-{name}-html - Gesetzt wenn der Bone HTML-Inhalt enthält
|
|
95
|
+
*/
|
|
96
|
+
defineOptions({
|
|
97
|
+
inheritAttrs: false,
|
|
98
|
+
})
|
|
99
|
+
const props = defineProps({
|
|
100
|
+
/** Bone-Name – wird in jedem `change`-Event als erstes Argument übergeben. */
|
|
101
|
+
name: String,
|
|
102
|
+
/** Aktueller Bone-Wert als Klartext oder HTML-String. */
|
|
103
|
+
value: [Object, String, Number, Boolean, Array],
|
|
104
|
+
/** Index im Multiple-Array; `undefined` bei Einzelwert. */
|
|
105
|
+
index: Number,
|
|
106
|
+
/** Sprach-Key bei mehrsprachigen Bones, z.B. `"de"`. */
|
|
107
|
+
lang: String,
|
|
108
|
+
/** Bone-Struktur (aktuell nicht aktiv genutzt). */
|
|
109
|
+
bone: Object,
|
|
110
|
+
/** Setzt den Fokus auf das Eingabefeld (aktuell nicht implementiert). */
|
|
111
|
+
autofocus: Boolean,
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
const emit = defineEmits([
|
|
115
|
+
/**
|
|
116
|
+
* Wird bei jeder Wertänderung sowie beim Mount (Initialisierung) gefeuert.
|
|
117
|
+
* @arg {string} name - Bone-Name
|
|
118
|
+
* @arg {string} value - Aktueller Textwert oder HTML-String
|
|
119
|
+
* @arg {string|undefined} lang - Sprach-Key
|
|
120
|
+
* @arg {number|undefined} index - Index im Multiple-Array
|
|
121
|
+
*/
|
|
122
|
+
"change",
|
|
123
|
+
])
|
|
124
|
+
|
|
125
|
+
const boneState = inject("boneState")
|
|
126
|
+
const state = reactive({
|
|
127
|
+
value: "",
|
|
128
|
+
editorConfig: {},
|
|
129
|
+
editor: computed(() => ClassicEditor),
|
|
130
|
+
placeholder: computed(() => {
|
|
131
|
+
if (boneState.label !== "placeholder") return undefined
|
|
132
|
+
let name = boneState?.bonestructure?.descr
|
|
133
|
+
if (boneState.bonestructure.required) {
|
|
134
|
+
name += "*"
|
|
135
|
+
}
|
|
136
|
+
return name
|
|
137
|
+
}),
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
function changeEvent(event) {
|
|
141
|
+
emit("change", props.name, state.value, props.lang, props.index)
|
|
142
|
+
}
|
|
143
|
+
function changeEventTextarea(event) {
|
|
144
|
+
state.value = event.target.value
|
|
145
|
+
emit("change", props.name, state.value, props.lang, props.index)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
onBeforeMount(() => {
|
|
149
|
+
let toolbarActions = {
|
|
150
|
+
heading: "h1",
|
|
151
|
+
bold: "b",
|
|
152
|
+
italic: "i",
|
|
153
|
+
underline: "u",
|
|
154
|
+
numberedList: "ol",
|
|
155
|
+
bulletedList: "ul",
|
|
156
|
+
blockQuote: "blockquote",
|
|
157
|
+
link: "a",
|
|
158
|
+
insertTable: "table",
|
|
159
|
+
imageUpload: "img",
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
let defaultSet = [
|
|
163
|
+
"heading",
|
|
164
|
+
"|",
|
|
165
|
+
"bold",
|
|
166
|
+
"italic",
|
|
167
|
+
"underline",
|
|
168
|
+
"|",
|
|
169
|
+
"alignment",
|
|
170
|
+
"numberedList",
|
|
171
|
+
"bulletedList",
|
|
172
|
+
"blockQuote",
|
|
173
|
+
"|",
|
|
174
|
+
"indent",
|
|
175
|
+
"outdent",
|
|
176
|
+
"|",
|
|
177
|
+
"link",
|
|
178
|
+
"insertTable",
|
|
179
|
+
"imageUpload",
|
|
180
|
+
"|",
|
|
181
|
+
"undo",
|
|
182
|
+
"redo",
|
|
183
|
+
"RemoveFormat",
|
|
184
|
+
"sourceEditing",
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
defaultSet = defaultSet.filter((i) => {
|
|
188
|
+
if (!Object.keys(toolbarActions).includes(i)) {
|
|
189
|
+
return true
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (boneState.bonestructure?.["valid_html"]?.["validTags"].includes(toolbarActions[i])) {
|
|
193
|
+
return true
|
|
194
|
+
}
|
|
195
|
+
if (boneState.bonestructure?.["validHtml"]?.["validTags"].includes(toolbarActions[i])) {
|
|
196
|
+
return true
|
|
197
|
+
}
|
|
198
|
+
return false
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
state.editorConfig = {
|
|
202
|
+
licenseKey: "GPL",
|
|
203
|
+
translations: [coreTranslations],
|
|
204
|
+
toolbar: defaultSet,
|
|
205
|
+
plugins: [
|
|
206
|
+
Essentials,
|
|
207
|
+
Heading,
|
|
208
|
+
Paragraph,
|
|
209
|
+
Bold,
|
|
210
|
+
List,
|
|
211
|
+
ImageUpload,
|
|
212
|
+
Italic,
|
|
213
|
+
Underline,
|
|
214
|
+
ImageBlock,
|
|
215
|
+
ImageInline,
|
|
216
|
+
Alignment,
|
|
217
|
+
Link,
|
|
218
|
+
BlockQuote,
|
|
219
|
+
Indent,
|
|
220
|
+
Table,
|
|
221
|
+
RemoveFormat,
|
|
222
|
+
ImageStyle,
|
|
223
|
+
ImageToolbar,
|
|
224
|
+
ImageResizeButtons,
|
|
225
|
+
IndentBlock,
|
|
226
|
+
TableToolbar,
|
|
227
|
+
TextTransformation,
|
|
228
|
+
GeneralHtmlSupport,
|
|
229
|
+
Image,
|
|
230
|
+
SourceEditing,
|
|
231
|
+
FileRepository,
|
|
232
|
+
ViURUploadAdapterPlugin,
|
|
233
|
+
],
|
|
234
|
+
link: {
|
|
235
|
+
decorators: [
|
|
236
|
+
{
|
|
237
|
+
mode: "manual",
|
|
238
|
+
label: "Link in neuem Fester öffnen",
|
|
239
|
+
attributes: {
|
|
240
|
+
target: "_blank",
|
|
241
|
+
rel: "noopener noreferrer",
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
},
|
|
246
|
+
image: {
|
|
247
|
+
toolbar: [
|
|
248
|
+
"imageStyle:inline",
|
|
249
|
+
"imageStyle:block",
|
|
250
|
+
"imageStyle:side",
|
|
251
|
+
"|",
|
|
252
|
+
"resizeImage:50",
|
|
253
|
+
"resizeImage:75",
|
|
254
|
+
"resizeImage:original",
|
|
255
|
+
"imageTextAlternative",
|
|
256
|
+
],
|
|
257
|
+
resizeOptions: [
|
|
258
|
+
{
|
|
259
|
+
name: "resizeImage:original",
|
|
260
|
+
value: null,
|
|
261
|
+
icon: "original",
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: "resizeImage:50",
|
|
265
|
+
value: "50",
|
|
266
|
+
icon: "medium",
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: "resizeImage:75",
|
|
270
|
+
value: "75",
|
|
271
|
+
icon: "large",
|
|
272
|
+
},
|
|
273
|
+
],
|
|
274
|
+
},
|
|
275
|
+
table: {
|
|
276
|
+
contentToolbar: ["tableColumn", "tableRow", "mergeTableCells"],
|
|
277
|
+
},
|
|
278
|
+
heading: {
|
|
279
|
+
options: [
|
|
280
|
+
{ model: "paragraph", title: "Paragraph", class: "ck-heading_paragraph" },
|
|
281
|
+
{ model: "heading1", view: "h1", title: "Heading 1", class: "ck-heading_heading1" },
|
|
282
|
+
{ model: "heading2", view: "h2", title: "Heading 2", class: "ck-heading_heading2" },
|
|
283
|
+
{ model: "heading3", view: "h3", title: "Heading 3", class: "ck-heading_heading3" },
|
|
284
|
+
{ model: "heading4", view: "h4", title: "Heading 4", class: "ck-heading_heading4" },
|
|
285
|
+
{ model: "heading5", view: "h5", title: "Heading 5", class: "ck-heading_heading5" },
|
|
286
|
+
{ model: "heading6", view: "h6", title: "Heading 6", class: "ck-heading_heading6" },
|
|
287
|
+
],
|
|
288
|
+
},
|
|
289
|
+
alignment: {
|
|
290
|
+
options: [
|
|
291
|
+
{ name: "left", className: "viur-txt-align--left" },
|
|
292
|
+
{ name: "right", className: "viur-txt-align--right" },
|
|
293
|
+
{ name: "center", className: "viur-txt-align--center" },
|
|
294
|
+
{ name: "justify", className: "viur-txt-align--justify" },
|
|
295
|
+
],
|
|
296
|
+
},
|
|
297
|
+
indentBlock: {
|
|
298
|
+
classes: [
|
|
299
|
+
"viur-txt-indent--1",
|
|
300
|
+
"viur-txt-indent--2",
|
|
301
|
+
"viur-txt-indent--3",
|
|
302
|
+
"viur-txt-indent--4",
|
|
303
|
+
"viur-txt-indent--5",
|
|
304
|
+
"viur-txt-indent--6",
|
|
305
|
+
"viur-txt-indent--7",
|
|
306
|
+
"viur-txt-indent--8",
|
|
307
|
+
"viur-txt-indent--9",
|
|
308
|
+
"viur-txt-indent--10",
|
|
309
|
+
],
|
|
310
|
+
},
|
|
311
|
+
|
|
312
|
+
htmlSupport: {
|
|
313
|
+
allow: [
|
|
314
|
+
{
|
|
315
|
+
name: "a",
|
|
316
|
+
attributes: {
|
|
317
|
+
target: true,
|
|
318
|
+
rel: true,
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
],
|
|
322
|
+
},
|
|
323
|
+
language: "de",
|
|
324
|
+
viur_api_url: import.meta.env.VITE_API_URL ? import.meta.env.VITE_API_URL : window.location.origin,
|
|
325
|
+
}
|
|
326
|
+
})
|
|
327
|
+
|
|
328
|
+
onMounted(() => {
|
|
329
|
+
if (props.value !== null) {
|
|
330
|
+
state.value = props.value
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
emit("change", props.name, props.value, props.lang, props.index) //init
|
|
334
|
+
})
|
|
335
|
+
|
|
336
|
+
function onReady(editor) {
|
|
337
|
+
editor.editing.view.change((writer) => {
|
|
338
|
+
writer.setStyle("min-height", "250px", editor.editing.view.document.getRoot())
|
|
339
|
+
})
|
|
340
|
+
|
|
341
|
+
const codePlugin = editor.plugins.get("SourceEditing")
|
|
342
|
+
|
|
343
|
+
codePlugin.on("change:isSourceEditingMode", (_eventInfo, _name, value) => {
|
|
344
|
+
if (value) {
|
|
345
|
+
const sourceEditingTextarea = editor.editing.view.getDomRoot()?.nextSibling?.firstChild
|
|
346
|
+
sourceEditingTextarea.addEventListener("focusout", (event) => {
|
|
347
|
+
if (event.relatedTarget?.classList.contains("ck")) {
|
|
348
|
+
return
|
|
349
|
+
}
|
|
350
|
+
codePlugin.isSourceEditingMode = false
|
|
351
|
+
})
|
|
352
|
+
}
|
|
353
|
+
})
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
watch(
|
|
357
|
+
() => props.value,
|
|
358
|
+
(newVal, oldVal) => {
|
|
359
|
+
if (!newVal) {
|
|
360
|
+
state.value = ""
|
|
361
|
+
} else {
|
|
362
|
+
state.value = newVal
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
)
|
|
366
|
+
</script>
|
|
367
|
+
<style scoped>
|
|
368
|
+
.bone-widget-text-hidden {
|
|
369
|
+
max-height: 0;
|
|
370
|
+
display: block;
|
|
371
|
+
visibility: hidden;
|
|
372
|
+
width: 100%;
|
|
373
|
+
pointer-events: none;
|
|
374
|
+
}
|
|
375
|
+
</style>
|
|
376
|
+
<style>
|
|
377
|
+
.viur-txt-align--left {
|
|
378
|
+
text-align: left;
|
|
379
|
+
}
|
|
380
|
+
.viur-txt-align--right {
|
|
381
|
+
text-align: right;
|
|
382
|
+
}
|
|
383
|
+
.viur-txt-align--center {
|
|
384
|
+
text-align: center;
|
|
385
|
+
}
|
|
386
|
+
.viur-txt-align--justify {
|
|
387
|
+
text-align: justify;
|
|
388
|
+
}
|
|
389
|
+
.viur-txt-indent--1 {
|
|
390
|
+
margin-left: 1em;
|
|
391
|
+
}
|
|
392
|
+
.viur-txt-indent--2 {
|
|
393
|
+
margin-left: 2em;
|
|
394
|
+
}
|
|
395
|
+
.viur-txt-indent--3 {
|
|
396
|
+
margin-left: 3em;
|
|
397
|
+
}
|
|
398
|
+
.viur-txt-indent--4 {
|
|
399
|
+
margin-left: 4em;
|
|
400
|
+
}
|
|
401
|
+
.viur-txt-indent--5 {
|
|
402
|
+
margin-left: 5em;
|
|
403
|
+
}
|
|
404
|
+
.viur-txt-indent--6 {
|
|
405
|
+
margin-left: 6em;
|
|
406
|
+
}
|
|
407
|
+
.viur-txt-indent--7 {
|
|
408
|
+
margin-left: 7em;
|
|
409
|
+
}
|
|
410
|
+
.viur-txt-indent--8 {
|
|
411
|
+
margin-left: 8em;
|
|
412
|
+
}
|
|
413
|
+
.viur-txt-indent--9 {
|
|
414
|
+
margin-left: 9em;
|
|
415
|
+
}
|
|
416
|
+
.viur-txt-indent--10 {
|
|
417
|
+
margin-left: 10em;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.bone-inner-wrap {
|
|
421
|
+
.ck-editor {
|
|
422
|
+
/* Overrides the border radius setting in the theme. */
|
|
423
|
+
--ck-border-radius: 0px;
|
|
424
|
+
|
|
425
|
+
/* Overrides the default font size in the theme. */
|
|
426
|
+
--ck-font-size-base: 14px;
|
|
427
|
+
|
|
428
|
+
/* Helper variables to avoid duplication in the colors. */
|
|
429
|
+
--ck-custom-background: var(--wa-color-neutral-90);
|
|
430
|
+
--ck-custom-foreground: var(--wa-color-neutral-10);
|
|
431
|
+
--ck-custom-border: var(--wa-color-neutral-95);
|
|
432
|
+
--ck-custom-white: var(--wa-color-neutral-95);
|
|
433
|
+
|
|
434
|
+
/* -- Overrides generic colors. ------------------------------------------------------------- */
|
|
435
|
+
--ck-color-base-foreground: var(--ck-custom-background);
|
|
436
|
+
--ck-color-base-background: var(--ck-custom-background);
|
|
437
|
+
--ck-color-base-border: var(--wa-color-neutral-80);
|
|
438
|
+
--ck-color-focus-border: var(--wa-color-neutral-40);
|
|
439
|
+
--ck-color-text: var(--wa-color-neutral-10);
|
|
440
|
+
--ck-color-shadow-drop: hsla(0, 0%, 0%, 0.2);
|
|
441
|
+
--ck-color-shadow-inner: hsla(0, 0%, 0%, 0.1);
|
|
442
|
+
|
|
443
|
+
/* -- Overrides the default .ck-button class colors. ---------------------------------------- */
|
|
444
|
+
--ck-color-button-default-background: var(--ck-custom-background);
|
|
445
|
+
--ck-color-button-default-hover-background: var(--wa-color-neutral-95);
|
|
446
|
+
--ck-color-button-default-active-background: var(--wa-color-neutral-95);
|
|
447
|
+
--ck-color-button-default-active-shadow: hsl(270, 2%, 23%);
|
|
448
|
+
--ck-color-button-default-disabled-background: var(--ck-custom-background);
|
|
449
|
+
|
|
450
|
+
--ck-color-button-on-hover-background: var(--wa-color-neutral-95);
|
|
451
|
+
--ck-color-button-on-active-background: hsl(255, 4%, 14%);
|
|
452
|
+
--ck-color-button-on-active-shadow: hsl(240, 3%, 19%);
|
|
453
|
+
--ck-color-button-on-disabled-background: var(--ck-custom-foreground);
|
|
454
|
+
|
|
455
|
+
--ck-color-button-on-color: var(--wa-color-brand-50);
|
|
456
|
+
--ck-color-button-on-background: var(--wa-color-neutral-95);
|
|
457
|
+
--ck-focus-ring: 1px solid var(--wa-color-brand-50);
|
|
458
|
+
--ck-focus-outer-shadow: none;
|
|
459
|
+
|
|
460
|
+
--ck-powered-by-text-color: var(--ck-custom-foreground);
|
|
461
|
+
--ck-powered-by-background: var(--ck-custom-background);
|
|
462
|
+
|
|
463
|
+
--ck-color-button-action-background: var(--wa-color-brand-60);
|
|
464
|
+
--ck-color-button-action-hover-background: var(--wa-color-brand-50);
|
|
465
|
+
--ck-color-button-action-active-background: var(--wa-color-brand-50);
|
|
466
|
+
--ck-color-button-action-active-shadow: var(--wa-color-brand-50);
|
|
467
|
+
--ck-color-button-action-disabled-background: var(--wa-color-brand-60);
|
|
468
|
+
--ck-color-button-action-text: var(--ck-custom-white);
|
|
469
|
+
|
|
470
|
+
/* -- Overrides the default .ck-dropdown class colors. -------------------------------------- */
|
|
471
|
+
--ck-color-dropdown-panel-background: var(--ck-custom-background);
|
|
472
|
+
--ck-color-dropdown-panel-border: var(--wa-color-neutral-70);
|
|
473
|
+
|
|
474
|
+
/* -- Overrides the default .ck-splitbutton class colors. ----------------------------------- */
|
|
475
|
+
--ck-color-split-button-hover-background: var(--ck-color-button-default-hover-background);
|
|
476
|
+
--ck-color-split-button-hover-border: var(--ck-custom-foreground);
|
|
477
|
+
|
|
478
|
+
/* -- Overrides the default .ck-labeled-field-view class colors. ---------------------------- */
|
|
479
|
+
--ck-color-labeled-field-label-background: var(--ck-custom-background);
|
|
480
|
+
|
|
481
|
+
/* -- Overrides the default .ck-list class colors. ------------------------------------------ */
|
|
482
|
+
--ck-color-list-background: var(--ck-custom-background);
|
|
483
|
+
--ck-color-list-button-hover-background: var(--wa-color-neutral-95);
|
|
484
|
+
--ck-color-list-button-on-background: var(--wa-color-brand-50);
|
|
485
|
+
--ck-color-list-button-on-background-focus: var(--wa-color-brand-50);
|
|
486
|
+
--ck-color-list-button-on-text: var(--ck-color-base-background);
|
|
487
|
+
|
|
488
|
+
/* -- Overrides the default .ck-balloon-panel class colors. --------------------------------- */
|
|
489
|
+
--ck-color-panel-background: var(--ck-custom-background);
|
|
490
|
+
--ck-color-panel-border: var(--ck-custom-border);
|
|
491
|
+
|
|
492
|
+
/* -- Overrides the default .ck-toolbar class colors. --------------------------------------- */
|
|
493
|
+
--ck-color-toolbar-background: var(--ck-custom-background);
|
|
494
|
+
--ck-color-toolbar-border: var(--ck-custom-border);
|
|
495
|
+
|
|
496
|
+
/* -- Overrides the default .ck-tooltip class colors. --------------------------------------- */
|
|
497
|
+
--ck-color-tooltip-background: hsl(252, 7%, 14%);
|
|
498
|
+
--ck-color-tooltip-text: hsl(0, 0%, 93%);
|
|
499
|
+
|
|
500
|
+
/* -- Overrides the default colors used by the ckeditor5-image package. --------------------- */
|
|
501
|
+
--ck-color-image-caption-background: var(--ck-custom-background);
|
|
502
|
+
--ck-color-image-caption-text: var(--ck-custom-foreground);
|
|
503
|
+
|
|
504
|
+
/* -- Overrides the default colors used by the ckeditor5-link package. ---------------------- */
|
|
505
|
+
--ck-color-link-default: var(--wa-color-brand-50);
|
|
506
|
+
|
|
507
|
+
width: 100% !important;
|
|
508
|
+
|
|
509
|
+
.ck-content {
|
|
510
|
+
background: transparent !important;
|
|
511
|
+
border: 1px solid var(--vi-border-color) !important;
|
|
512
|
+
width: 100%;
|
|
513
|
+
/*height: 250px;*/
|
|
514
|
+
border-bottom-left-radius: var(--wa-border-radius-m) !important;
|
|
515
|
+
border-bottom-right-radius: var(--wa-border-radius-m) !important;
|
|
516
|
+
|
|
517
|
+
&.ck-focused {
|
|
518
|
+
border: 1px solid var(--wa-color-neutral-50) !important;
|
|
519
|
+
|
|
520
|
+
.ck-source-editing-area {
|
|
521
|
+
& textarea,
|
|
522
|
+
& td {
|
|
523
|
+
border: 1px solid var(--wa-color-neutral-50) !important;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
h1 {
|
|
529
|
+
font-size: 1.6em;
|
|
530
|
+
font-weight: 700;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
h2 {
|
|
534
|
+
font-size: 1.5em;
|
|
535
|
+
font-weight: 700;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
h3 {
|
|
539
|
+
font-size: 1.4em;
|
|
540
|
+
font-weight: 700;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
h4 {
|
|
544
|
+
font-size: 1.3em;
|
|
545
|
+
font-weight: 700;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
h5 {
|
|
549
|
+
font-size: 1.2em;
|
|
550
|
+
font-weight: 700;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
h6 {
|
|
554
|
+
font-size: 1.1em;
|
|
555
|
+
font-weight: 700;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
a:hover {
|
|
559
|
+
text-decoration: underline;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
ul {
|
|
563
|
+
list-style: disc;
|
|
564
|
+
padding-left: var(--wa-space-m);
|
|
565
|
+
list-style-position: inside;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
ol {
|
|
569
|
+
padding-left: var(--wa-space-m);
|
|
570
|
+
list-style-position: inside;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.ck-toolbar {
|
|
575
|
+
height: var(--wa-form-control-height);
|
|
576
|
+
border-color: var(--vi-border-color);
|
|
577
|
+
background-color: var(--vi-background-color);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.ck-button {
|
|
581
|
+
border-color: none;
|
|
582
|
+
background-color: var(--vi-background-color);
|
|
583
|
+
cursor: pointer;
|
|
584
|
+
|
|
585
|
+
&:hover {
|
|
586
|
+
background-color: var(--wa-color-neutral-90) !important;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
&.ck-on {
|
|
590
|
+
background-color: var(--vi-background-color) !important;
|
|
591
|
+
border: 1px solid var(--wa-color-brand-50) !important;
|
|
592
|
+
color: var(--wa-color-brand-50) !important;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.ck-source-editing-area {
|
|
597
|
+
width: 100%;
|
|
598
|
+
/*height: 250px;*/
|
|
599
|
+
|
|
600
|
+
& textarea {
|
|
601
|
+
background-color: transparent;
|
|
602
|
+
color: var(--ck-custom-foreground);
|
|
603
|
+
border: 1px solid var(--vi-border-color) !important;
|
|
604
|
+
border-bottom-left-radius: var(--wa-border-radius-m) !important;
|
|
605
|
+
border-bottom-right-radius: var(--wa-border-radius-m) !important;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
.ck-content .table {
|
|
610
|
+
margin: 0.9em 0;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.ck-body-wrapper {
|
|
615
|
+
.ck-link-form {
|
|
616
|
+
padding-top: 5px !important;
|
|
617
|
+
width: 500px !important;
|
|
618
|
+
max-width: 37vw !important;
|
|
619
|
+
min-width: 180px !important;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
wa-textarea {
|
|
624
|
+
&::part(base) {
|
|
625
|
+
box-shadow: none !important;
|
|
626
|
+
background-color: transparent;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
&::part(textarea) {
|
|
630
|
+
background-color: transparent;
|
|
631
|
+
border: 1px solid var(--vi-border-color);
|
|
632
|
+
border-radius: var(--wa-border-radius-m);
|
|
633
|
+
border-top-left-radius: 0;
|
|
634
|
+
border-bottom-left-radius: 0;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
.ck-list-bogus-paragraph {
|
|
639
|
+
display: inline !important;
|
|
640
|
+
}
|
|
641
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineAsyncComponent } from "vue"
|
|
2
|
+
|
|
3
|
+
// --------------------------------------------------------------------------- //
|
|
4
|
+
// Global registration of the form wrappers //
|
|
5
|
+
// --------------------------------------------------------------------------- //
|
|
6
|
+
//
|
|
7
|
+
// The form templates reference their wrappers by NAME (`<bone>`, `<bone-label>`,
|
|
8
|
+
// `<bone-actions>`, …). Vue resolves those names in the scope of the component
|
|
9
|
+
// that RENDERS them — inside this package — so a consumer app has to register
|
|
10
|
+
// them GLOBALLY. The bone widgets themselves are resolved dynamically through
|
|
11
|
+
// the bone store and need no registration.
|
|
12
|
+
//
|
|
13
|
+
// Registration is async on purpose: the form tree is large (every bone widget,
|
|
14
|
+
// plus their editors), and an app that merely embeds a login must not pay for
|
|
15
|
+
// it on every page load. `defineAsyncComponent` defers each import until a
|
|
16
|
+
// form is actually rendered.
|
|
17
|
+
//
|
|
18
|
+
// Keeping the list here instead of in every consumer means a rename inside the
|
|
19
|
+
// package cannot silently break the apps that embed the forms.
|
|
20
|
+
//
|
|
21
|
+
// import { installViurForms } from "viur-ui/src/forms/install.js"
|
|
22
|
+
// installViurForms(app)
|
|
23
|
+
//
|
|
24
|
+
const components = {
|
|
25
|
+
ViForm: () => import("./ViForm.vue"),
|
|
26
|
+
"vi-form": () => import("./ViForm.vue"),
|
|
27
|
+
"vi-form-category": () => import("./ViFormCategory.vue"),
|
|
28
|
+
Bone: () => import("./bones/Bone.vue"),
|
|
29
|
+
bone: () => import("./bones/Bone.vue"),
|
|
30
|
+
"bone-label": () => import("./bones/BoneLabel.vue"),
|
|
31
|
+
"bone-actions": () => import("./bones/BoneActions.vue"),
|
|
32
|
+
"bone-single-entry": () => import("./bones/BoneSingleEntry.vue"),
|
|
33
|
+
"bone-multiple-list": () => import("./bones/BoneMultipleList.vue"),
|
|
34
|
+
"bone-multiple-wrapper": () => import("./bones/BoneMultipleWrapper.vue"),
|
|
35
|
+
"bone-nested-wrapper": () => import("./bones/BoneNestedWrapper.vue"),
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** @param {import("vue").App} app */
|
|
39
|
+
export function installViurForms(app) {
|
|
40
|
+
for (const [name, loader] of Object.entries(components)) {
|
|
41
|
+
if (!app.component(name)) app.component(name, defineAsyncComponent(loader))
|
|
42
|
+
}
|
|
43
|
+
}
|