@json-layout/core 0.32.1 → 0.33.0
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/package.json +1 -1
- package/src/i18n/de.js +33 -0
- package/src/i18n/index.js +3 -1
- package/src/state/index.js +3 -1
- package/src/state/types.ts +1 -0
- package/src/utils/doc-options.js +4 -0
package/package.json
CHANGED
package/src/i18n/de.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** @type {import('./types.js').LocaleMessages} */
|
|
2
|
+
export default {
|
|
3
|
+
errorOneOf: 'Wählen Sie eine Option',
|
|
4
|
+
errorRequired: 'Erforderliche Information',
|
|
5
|
+
addItem: 'Element hinzufügen',
|
|
6
|
+
delete: 'Löschen',
|
|
7
|
+
edit: 'Bearbeiten',
|
|
8
|
+
close: 'Schließen',
|
|
9
|
+
duplicate: 'Duplizieren',
|
|
10
|
+
sort: 'Sortieren',
|
|
11
|
+
up: 'Nach oben verschieben',
|
|
12
|
+
down: 'Nach unten verschieben',
|
|
13
|
+
showHelp: 'Hilfemeldung anzeigen',
|
|
14
|
+
mdeLink1: '[Link-Titel',
|
|
15
|
+
mdeLink2: '](Link-URL)',
|
|
16
|
+
mdeImg1: '',
|
|
18
|
+
mdeTable1: '',
|
|
19
|
+
mdeTable2: '\n\n| Spalte 1 | Spalte 2 | Spalte 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n',
|
|
20
|
+
bold: 'Fett',
|
|
21
|
+
italic: 'Kursiv',
|
|
22
|
+
heading: 'Titel',
|
|
23
|
+
quote: 'Zitat',
|
|
24
|
+
unorderedList: 'Ungeordnete Liste',
|
|
25
|
+
orderedList: 'Geordnete Liste',
|
|
26
|
+
createLink: 'Link erstellen',
|
|
27
|
+
insertImage: 'Bild einfügen',
|
|
28
|
+
createTable: 'Tabelle erstellen',
|
|
29
|
+
preview: 'Vorschau',
|
|
30
|
+
mdeGuide: 'Syntax-Dokumentation',
|
|
31
|
+
undo: 'Rückgängig',
|
|
32
|
+
redo: 'Wiederholen'
|
|
33
|
+
}
|
package/src/i18n/index.js
CHANGED
package/src/state/index.js
CHANGED
|
@@ -75,6 +75,7 @@ function fillOptions (partialOptions, compiledLayout) {
|
|
|
75
75
|
removeAdditional: 'error',
|
|
76
76
|
autofocus: false,
|
|
77
77
|
readOnlyPropertiesMode: 'show',
|
|
78
|
+
fetchOptions: {},
|
|
78
79
|
onAutofocus: () => {},
|
|
79
80
|
onUpdate: () => {},
|
|
80
81
|
onData: () => {},
|
|
@@ -554,7 +555,8 @@ export class StatefulLayout {
|
|
|
554
555
|
if (q) url.searchParams.set(qSearchParam, q)
|
|
555
556
|
else url.searchParams.delete(qSearchParam)
|
|
556
557
|
}
|
|
557
|
-
|
|
558
|
+
const fetchOptions = typeof node.options.fetchOptions === 'function' ? node.options.fetchOptions(url) : node.options.fetchOptions
|
|
559
|
+
rawItems = await (await fetch(url, fetchOptions)).json()
|
|
558
560
|
}
|
|
559
561
|
|
|
560
562
|
if (!rawItems) {
|
package/src/state/types.ts
CHANGED
|
@@ -102,6 +102,7 @@ export interface ValidationState {
|
|
|
102
102
|
export type StateNodeOptions = Required<StateNodeOptionsBase & {
|
|
103
103
|
context: Record<string, any>
|
|
104
104
|
messages: LocaleMessages
|
|
105
|
+
fetchOptions: RequestInit | ((url: URL) => RequestInit)
|
|
105
106
|
onData: (data: any) => void
|
|
106
107
|
onUpdate: (statefulLayout: StatefulLayout) => void
|
|
107
108
|
onAutofocus: (key: string) => void
|
package/src/utils/doc-options.js
CHANGED
|
@@ -148,5 +148,9 @@ export const runtimeOptions = [
|
|
|
148
148
|
key: 'autofocus',
|
|
149
149
|
description: 'Activate autofocus. The focus will be given to the first input of the form.',
|
|
150
150
|
default: false
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
key: 'fetchOptions',
|
|
154
|
+
description: 'Define options to be given to <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch">fetch</a> when getting data items from a URL. Can also be a function that will accept a URL object as parameter and return those options.'
|
|
151
155
|
}
|
|
152
156
|
]
|