viur-ui 0.0.1 → 0.0.2

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.
Files changed (83) hide show
  1. package/README.md +67 -41
  2. package/index.d.ts +18 -9
  3. package/index.js +6 -3
  4. package/package.json +3 -5
  5. package/src/components/Browser/Browser.vue +58 -58
  6. package/src/components/Browser/TreeNav.vue +32 -32
  7. package/src/components/Browser/ViurBrowser.d.vue.ts +21 -21
  8. package/src/components/Browser/ViurBrowser.vue +47 -44
  9. package/src/components/Browser/dragSession.ts +27 -27
  10. package/src/components/Browser/index.ts +3 -3
  11. package/src/components/Browser/types.ts +9 -9
  12. package/src/components/DataTable/ColumnFilterPanel.vue +7 -7
  13. package/src/components/DataTable/DataTable.vue +346 -346
  14. package/src/components/DataTable/ViurDataTable.d.vue.ts +26 -26
  15. package/src/components/DataTable/ViurDataTable.vue +51 -50
  16. package/src/components/DataTable/columns.ts +30 -30
  17. package/src/components/DataTable/index.ts +12 -12
  18. package/src/components/DataTable/rows.ts +71 -72
  19. package/src/components/DataTable/types.ts +55 -55
  20. package/src/components/DataTable/useColumnLayout.ts +28 -28
  21. package/src/components/DataTable/useGridNavigation.ts +15 -15
  22. package/src/components/DataTable/useVirtualRows.ts +10 -10
  23. package/src/components/DataTable/viurColumns.ts +69 -69
  24. package/src/forms/ViForm.d.vue.ts +32 -32
  25. package/src/forms/ViForm.vue +17 -16
  26. package/src/forms/ViFormCategory.vue +3 -1
  27. package/src/forms/bones/Bone.vue +125 -108
  28. package/src/forms/bones/BoneActions.vue +21 -21
  29. package/src/forms/bones/BoneLabel.vue +1 -1
  30. package/src/forms/bones/BoneMultipleWrapper.vue +3 -3
  31. package/src/forms/bones/BoneNestedWrapper.vue +3 -3
  32. package/src/forms/bones/BoneSingleEntry.vue +2 -2
  33. package/src/forms/bones/FilterBone.vue +3 -3
  34. package/src/forms/bones/actions/ActionDialog.vue +2 -2
  35. package/src/forms/bones/actions/Debug.vue +6 -6
  36. package/src/forms/bones/actions/Delete.vue +2 -2
  37. package/src/forms/bones/actions/DescribeImage.vue +4 -3
  38. package/src/forms/bones/actions/Download.vue +4 -4
  39. package/src/forms/bones/actions/Placeholder.vue +2 -2
  40. package/src/forms/bones/actions/index.js +72 -74
  41. package/src/forms/bones/bone.d.ts +19 -19
  42. package/src/forms/bones/uploadAdapter.js +3 -3
  43. package/src/forms/bones/utils.js +40 -41
  44. package/src/forms/bones/view/base_item.vue +1 -1
  45. package/src/forms/bones/view/boneLogic.js +1 -1
  46. package/src/forms/bones/widgets/booleanBone.vue +19 -19
  47. package/src/forms/bones/widgets/booleanBoneChoose.vue +2 -2
  48. package/src/forms/bones/widgets/booleanBoneSelect.vue +3 -3
  49. package/src/forms/bones/widgets/codeBone.vue +22 -22
  50. package/src/forms/bones/widgets/colorBone.vue +18 -18
  51. package/src/forms/bones/widgets/dateBone.vue +22 -22
  52. package/src/forms/bones/widgets/emailBone.vue +20 -20
  53. package/src/forms/bones/widgets/fileBone.vue +32 -31
  54. package/src/forms/bones/widgets/keyBone.vue +21 -21
  55. package/src/forms/bones/widgets/numericBone.vue +21 -21
  56. package/src/forms/bones/widgets/passwordBone.vue +34 -31
  57. package/src/forms/bones/widgets/phoneBone.vue +20 -20
  58. package/src/forms/bones/widgets/rawBone.vue +19 -19
  59. package/src/forms/bones/widgets/recordBone.vue +16 -16
  60. package/src/forms/bones/widgets/relationalBone.vue +26 -26
  61. package/src/forms/bones/widgets/selectBone.vue +23 -23
  62. package/src/forms/bones/widgets/selectBoneChoose.vue +2 -2
  63. package/src/forms/bones/widgets/spatialBone.vue +21 -21
  64. package/src/forms/bones/widgets/stringBone.vue +27 -27
  65. package/src/forms/bones/widgets/textBone.vue +28 -26
  66. package/src/forms/install.d.ts +1 -1
  67. package/src/forms/install.js +7 -0
  68. package/src/forms/layouts/LayloutList2Columns.vue +1 -1
  69. package/src/forms/layouts/LayoutCategory.vue +1 -1
  70. package/src/forms/layouts/LayoutList.vue +1 -1
  71. package/src/forms/utils.js +22 -22
  72. package/src/request/configStore.js +4 -4
  73. package/src/request/envelope.js +6 -6
  74. package/src/request/request.js +22 -22
  75. package/src/translations/de.js +31 -0
  76. package/src/translations/en.js +31 -0
  77. package/src/user/LoginScreen.d.vue.ts +24 -24
  78. package/src/user/LoginScreen.vue +6 -7
  79. package/src/user/store.d.ts +16 -16
  80. package/src/vite/safeHtml.js +73 -0
  81. package/src/vite/sanitizeVHtml.d.ts +4 -0
  82. package/src/vite/sanitizeVHtml.js +15 -0
  83. package/src/webawesomeCompat.css +0 -40
@@ -12,9 +12,8 @@ export default class Utils {
12
12
  }
13
13
 
14
14
  static stripHtml(html) {
15
- const div = document.createElement("div")
16
- div.innerHTML = html
17
- return div.textContent || div.innerText || ""
15
+ // DOMParser builds an inert document: no scripts or event handlers run (unlike innerHTML)
16
+ return new DOMParser().parseFromString(String(html ?? ""), "text/html").body.textContent || ""
18
17
  }
19
18
 
20
19
  static unescape(value) {
@@ -93,10 +92,10 @@ export default class Utils {
93
92
  let finalstr = formatstr
94
93
  for (let pathstr of pathlist) {
95
94
  let aval = readValue(pathstr, avalue)
96
- // Auch Zahlen und Wahrheitswerte gehören in den Text: vorher wurde
97
- // JEDER Nicht-String durch den Fallback ersetzt, `$(dest.kdnr)` mit 42
98
- // verschwand also. Leeres, Objekte und der Platzhalter "-" bleiben der
99
- // Fallback.
95
+ // Numbers and booleans belong in the text too: previously
96
+ // EVERY non-string was replaced by the fallback, so `$(dest.kdnr)` with 42
97
+ // disappeared. Empty values, objects and the placeholder "-" remain the
98
+ // fallback.
100
99
  if (aval === null || aval === undefined || aval === "-" || typeof aval === "object") {
101
100
  aval = fallback
102
101
  } else {
@@ -110,20 +109,20 @@ export default class Utils {
110
109
  return finalStrList.join(", ")
111
110
  }
112
111
 
113
- // ── ViUR-Werte als Text ───────────────────────────────────────────────
112
+ // ── ViUR values as text ───────────────────────────────────────────────
114
113
  //
115
- // EINE Stelle, die jeden Bone-Wert in eine Zeichenkette übersetzt — für
116
- // Tabellen, Detailansichten, Export. Denn ein Bone-Wert ist selten ein
117
- // Skalar: mehrsprachige Bones sind ein Objekt je Sprache, `multiple` eine
118
- // Liste, relationale Bones tragen `{dest, rel}` und ihren eigenen
119
- // Formatstring, `text` enthält HTML.
114
+ // ONE place that turns every bone value into a string — for
115
+ // tables, detail views, export. Because a bone value is rarely a
116
+ // scalar: multilingual bones are one object per language, `multiple` a
117
+ // list, relational bones carry `{dest, rel}` and their own
118
+ // format string, `text` contains HTML.
120
119
 
121
- /** Typfamilie eines Bones: "str.email" → "str". */
120
+ /** Type family of a bone: "str.email" → "str". */
122
121
  static boneFamily(type) {
123
122
  return String(type ?? "").split(".")[0]
124
123
  }
125
124
 
126
- /** select-Wert → Beschriftung. Akzeptiert Objekt- UND Paar-Schreibweise. */
125
+ /** select value → label. Accepts object AND pair notation. */
127
126
  static optionLabel(bone, value) {
128
127
  const values = bone?.["values"]
129
128
  if (Array.isArray(values)) {
@@ -137,7 +136,7 @@ export default class Utils {
137
136
  return String(value)
138
137
  }
139
138
 
140
- /** Ein EINZELNER Wert (ohne Sprachen/multiple — das macht boneToString). */
139
+ /** A SINGLE value (without languages/multiple — boneToString handles that). */
141
140
  static singleValueToString(value, bone = {}, options = {}) {
142
141
  if (value === null || value === undefined || value === "") return ""
143
142
  switch (Utils.boneFamily(bone["type"])) {
@@ -159,7 +158,7 @@ export default class Utils {
159
158
  case "date": {
160
159
  const parsed = new Date(String(value))
161
160
  if (Number.isNaN(parsed.getTime())) return String(value)
162
- // ViUR setzt die Flags `date`/`time` (beide standardmäßig an).
161
+ // ViUR sets the flags `date`/`time` (both on by default).
163
162
  const wantsDate = bone["date"] !== false
164
163
  const wantsTime = bone["time"] !== false
165
164
  const format = {}
@@ -169,15 +168,15 @@ export default class Utils {
169
168
  }
170
169
  case "relational":
171
170
  case "record": {
172
- // Relationale Bones bringen ihren Formatstring mit ("$(dest.name)").
171
+ // Relational bones bring their own format string ("$(dest.name)").
173
172
  const formatstr = bone["format"] ?? bone["params"]?.["format"] ?? "$(dest.name)"
174
173
  const text = Utils.formatString(formatstr, value, "")
175
174
  if (text && text !== "-") return Utils.stripHtml(String(text))
176
- // Ohne Format ist der Schlüssel besser als nichts.
175
+ // Without a format, the key is better than nothing.
177
176
  return String(value?.["dest"]?.["key"] ?? value?.["key"] ?? "")
178
177
  }
179
178
  case "text":
180
- // Textbones enthalten HTML — in einer Zelle stört das.
179
+ // Text bones contain HTML — that's disruptive in a cell.
181
180
  return Utils.stripHtml(String(value))
182
181
  case "raw":
183
182
  return typeof value === "object" ? JSON.stringify(value) : String(value)
@@ -186,7 +185,7 @@ export default class Utils {
186
185
  }
187
186
  }
188
187
 
189
- /** Ein Wert OHNE Sprachdimension (multiple-Listen inklusive) als Text. */
188
+ /** A value WITHOUT language dimension (multiple lists included) as text. */
190
189
  static monolingualToString(value, bone = {}, options = {}) {
191
190
  if (bone["multiple"]) {
192
191
  const list = Array.isArray(value) ? value : value === null || value === undefined ? [] : [value]
@@ -196,10 +195,10 @@ export default class Utils {
196
195
  }
197
196
 
198
197
  /**
199
- * Flagge einer Sprache — pflegefrei über die CLDR-Daten des Browsers:
200
- * Sprachcode → wahrscheinlichste Region (`Intl.Locale.maximize`, de→DE,
201
- * en→US, ja→JP) → Regional-Indicator-Emoji. `null`, wenn keine Region
202
- * bestimmbar ist.
198
+ * Flag of a language — maintenance-free via the browser's CLDR data:
199
+ * language code → most likely region (`Intl.Locale.maximize`, de→DE,
200
+ * en→US, ja→JP) → regional indicator emoji. `null` if no region
201
+ * can be determined.
203
202
  */
204
203
  static languageFlag(code) {
205
204
  try {
@@ -211,28 +210,28 @@ export default class Utils {
211
210
  }
212
211
  }
213
212
 
214
- /** Präfix, das einen Wert seiner Sprache zuordnet: Flagge, sonst Kürzel. */
213
+ /** Prefix that assigns a value to its language: flag, otherwise code. */
215
214
  static languageTag(code) {
216
215
  return Utils.languageFlag(code) ?? `${code}:`
217
216
  }
218
217
 
219
218
  /**
220
- * Bone-Wert eines Datensatzes als Text.
219
+ * Bone value of an entry as text.
221
220
  *
222
- * Mehrsprachige Bones (`bone.languages`) steuert `options.language`:
223
- * - `"*"` — ALLE befüllten Sprachen, je mit Flaggen-Präfix (`🇩🇪 Wert`),
224
- * verkettet mit `languageSeparator` (Standard `", "`).
225
- * `options.primaryLanguage` steht dabei vorn, die übrigen folgen in der
226
- * Reihenfolge des Bones.
227
- * - Sprachcode — der Wert dieser Sprache. Ist er leer, springt die Anzeige
228
- * auf die erste befüllte Sprache und kennzeichnet das mit deren Flagge —
229
- * eine leere Zelle verschweigt sonst, dass der Eintrag in anderer Sprache
230
- * sehr wohl Inhalt hat.
231
- * - nicht gesetzt — die erste Sprache des Bones, ohne Präfix (stabiles
232
- * Verhalten für Formatstrings und andere Bestandsnutzer).
221
+ * Multilingual bones (`bone.languages`) are controlled by `options.language`:
222
+ * - `"*"` — ALL filled languages, each with a flag prefix (`🇩🇪 value`),
223
+ * joined with `languageSeparator` (default `", "`).
224
+ * `options.primaryLanguage` comes first, the others follow in the
225
+ * bone's order.
226
+ * - language code — the value of that language. If it's empty, the display falls back
227
+ * to the first filled language and marks that with its flag —
228
+ * an empty cell would otherwise hide that the entry does have content
229
+ * in another language.
230
+ * - not set — the bone's first language, without prefix (stable
231
+ * behavior for format strings and other existing users).
233
232
  *
234
- * @param {*} value Wert aus dem Skel
235
- * @param {object} bone Bone-Beschreibung aus der `structure`
233
+ * @param {*} value value from the skel
234
+ * @param {object} bone bone description from the `structure`
236
235
  * @param {{ language?: string, primaryLanguage?: string, locale?: string, boolTexts?: [string, string], separator?: string, languageSeparator?: string }} [options]
237
236
  */
238
237
  static boneToString(value, bone = {}, options = {}) {
@@ -254,7 +253,7 @@ export default class Utils {
254
253
  lang = languages.find((other) => !isEmpty(value[other])) ?? lang
255
254
  }
256
255
  const text = Utils.monolingualToString(value[lang], bone, options)
257
- // Präfix nur, wenn eine BESTIMMTE Sprache gewünscht war und eine andere kam.
256
+ // Prefix only if a SPECIFIC language was requested and a different one came.
258
257
  return options.language && options.language !== lang && !isEmpty(value[lang])
259
258
  ? `${Utils.languageTag(lang)} ${text}`
260
259
  : text
@@ -3,7 +3,7 @@
3
3
  </template>
4
4
 
5
5
  <script setup>
6
- import boneLogic from "./boneLogic"
6
+ import boneLogic from "./boneLogic.js"
7
7
  import { computed, defineComponent, reactive } from "vue"
8
8
  import { useI18n } from "vue-i18n"
9
9
 
@@ -1,4 +1,4 @@
1
- import Utils from "../utils"
1
+ import Utils from "../utils.js"
2
2
  import { computed, reactive } from "vue"
3
3
 
4
4
  export const languageMap = [
@@ -12,44 +12,44 @@
12
12
  <script setup>
13
13
  import { reactive, onMounted, inject, computed } from "vue"
14
14
  /**
15
- * Schalter für boolesche Werte (true/false).
15
+ * Switch for boolean values (true/false).
16
16
  *
17
- * Verfügbar in drei Varianten: `bool` (Switch), `bool.choose` (Ja/Nein-Buttons),
18
- * `bool.select` (Dropdown). Der Wert `null`, `undefined`, `false` und `""` wird
19
- * einheitlich als `false` behandelt.
17
+ * Available in three variants: `bool` (switch), `bool.choose` (yes/no buttons),
18
+ * `bool.select` (dropdown). The values `null`, `undefined`, `false` and `""` are
19
+ * uniformly treated as `false`.
20
20
  *
21
21
  * @displayName BooleanBone
22
22
  *
23
- * @cssClass bone-widget - Basis-Klasse aller Bone-Widgets
24
- * @cssClass bone-widget-boolean - Kennzeichnet den Bone-Typ
25
- * @cssClass bone-widget-boolean-default - Standard-Variante
26
- * @cssClass bone-widget-boolean-{name} - Dynamisch gesetzt auf den Bone-Namen
23
+ * @cssClass bone-widget - Base class of all bone widgets
24
+ * @cssClass bone-widget-boolean - Identifies the bone type
25
+ * @cssClass bone-widget-boolean-default - Default variant
26
+ * @cssClass bone-widget-boolean-{name} - Dynamically set to the bone name
27
27
  */
28
28
  defineOptions({
29
29
  inheritAttrs: false,
30
30
  })
31
31
  const props = defineProps({
32
- /** Bone-Name – wird in jedem `change`-Event als erstes Argument übergeben. */
32
+ /** Bone name – passed as the first argument in every `change` event. */
33
33
  name: String,
34
- /** Aktueller Bone-Wert. `null`, `undefined`, `false` und `""` gelten als `false`. */
34
+ /** Current bone value. `null`, `undefined`, `false` and `""` count as `false`. */
35
35
  value: [Object, String, Number, Boolean, Array],
36
- /** Index im Multiple-Array; `undefined` bei Einzelwert. */
36
+ /** Index in the multiple array; `undefined` for a single value. */
37
37
  index: Number,
38
- /** Sprach-Key bei mehrsprachigen Bones, z.B. `"de"`. */
38
+ /** Language key for multilingual bones, e.g. `"de"`. */
39
39
  lang: String,
40
- /** Bone-Struktur (aktuell nicht aktiv genutzt). */
40
+ /** Bone structure (currently not actively used). */
41
41
  bone: Object,
42
- /** Autofocus (aktuell nicht aktiv genutzt). */
42
+ /** Autofocus (currently not actively used). */
43
43
  autofocus: Boolean,
44
44
  })
45
45
 
46
46
  const emit = defineEmits([
47
47
  /**
48
- * Wird bei jeder Wertänderung sowie beim Mount (Initialisierung) gefeuert.
49
- * @arg {string} name - Bone-Name
50
- * @arg {boolean} value - Aktueller Wert
51
- * @arg {string|undefined} lang - Sprach-Key
52
- * @arg {number|undefined} index - Index im Multiple-Array
48
+ * Fired on every value change and on mount (initialization).
49
+ * @arg {string} name - Bone name
50
+ * @arg {boolean} value - Current value
51
+ * @arg {string|undefined} lang - Language key
52
+ * @arg {number|undefined} index - Index in the multiple array
53
53
  */
54
54
  "change",
55
55
  ])
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <!-- readonly an der Gruppe: wa-radio-group markiert nur Radios, die selbst
3
- nicht disabled sind — sonst wäre bei readonly keine Auswahl sichtbar -->
2
+ <!-- readonly on the group: wa-radio-group only marks radios that are not
3
+ disabled themselves — otherwise no selection would be visible when readonly -->
4
4
  <wa-radio-group
5
5
  :value="state.value"
6
6
  :disabled="boneState.readonly"
@@ -8,9 +8,9 @@
8
8
  :data-user-invalid="boneState.errorMessages.length === 0 ? undefined : true"
9
9
  @change="changeEvent"
10
10
  >
11
- <!-- String-Werte: wa-select gleicht seinen Wert beim Setzen mit den
12
- Options-Werten ab; boolesche werden erst später zu Strings, der
13
- gespeicherte Wert erschiene dann nicht -->
11
+ <!-- String values: wa-select matches its value against the option values
12
+ when it is set; booleans only become strings later, so the
13
+ stored value would not appear -->
14
14
  <wa-option
15
15
  v-for="val in ['true', 'false']"
16
16
  :key="val"
@@ -39,21 +39,21 @@ import { EditorState } from "@codemirror/state"
39
39
  import { languages } from "@codemirror/language-data"
40
40
 
41
41
  /**
42
- * Code-Editor auf Basis von CodeMirror für syntaxhervorgehobene Quelltext-Eingabe.
42
+ * Code editor based on CodeMirror for syntax-highlighted source code input.
43
43
  *
44
- * Erkennt die Programmiersprache anhand von `boneState.bonestructure.type`
45
- * (z.B. `raw.code.python`, `raw.code.html`, `raw.code.javascript`) und lädt
46
- * das passende CodeMirror-Language-Plugin dynamisch nach. Unterstützt
47
- * Mehrfachwerte (`multiple`). Ein Expand-Button ermöglicht das Aufklappen
48
- * auf volle Höhe.
44
+ * Detects the programming language from `boneState.bonestructure.type`
45
+ * (e.g. `raw.code.python`, `raw.code.html`, `raw.code.javascript`) and dynamically
46
+ * loads the matching CodeMirror language plugin. Supports
47
+ * multiple values (`multiple`). An expand button allows expanding
48
+ * to full height.
49
49
  *
50
50
  * @displayName CodeBone
51
51
  *
52
- * @cssClass bone-widget - Basis-Klasse aller Bone-Widgets
53
- * @cssClass bone-widget-raw - Kennzeichnet den übergeordneten Bone-Typ
54
- * @cssClass bone-widget-raw-default - Standard-Variante
55
- * @cssClass bone-widget-wrapper - Umschließt Editor und Expand-Button
56
- * @cssClass is-max-size - Wird per Expand-Button umgeschaltet; hebt die maximale Höhe auf
52
+ * @cssClass bone-widget - Base class of all bone widgets
53
+ * @cssClass bone-widget-raw - Identifies the parent bone type
54
+ * @cssClass bone-widget-raw-default - Default variant
55
+ * @cssClass bone-widget-wrapper - Wraps the editor and the expand button
56
+ * @cssClass is-max-size - Toggled via the expand button; removes the maximum height
57
57
  */
58
58
  defineOptions({
59
59
  inheritAttrs: false,
@@ -63,27 +63,27 @@ const element = ref(null)
63
63
  const view = ref(null)
64
64
 
65
65
  const props = defineProps({
66
- /** Bone-Name – wird in jedem `change`-Event als erstes Argument übergeben. */
66
+ /** Bone name – passed as the first argument in every `change` event. */
67
67
  name: String,
68
- /** Aktueller Bone-Wert (Quelltext als String). */
68
+ /** Current bone value (source code as a string). */
69
69
  value: [Object, String, Number, Boolean, Array],
70
- /** Index im Multiple-Array; `undefined` bei Einzelwert. */
70
+ /** Index in the multiple array; `undefined` for a single value. */
71
71
  index: Number,
72
- /** Sprach-Key bei mehrsprachigen Bones (CodeBone unterstützt kein multilang). */
72
+ /** Language key for multilingual bones (CodeBone does not support multilang). */
73
73
  lang: String,
74
- /** Bone-Struktur (aktuell nicht aktiv genutzt). */
74
+ /** Bone structure (currently not actively used). */
75
75
  bone: Object,
76
- /** Setzt den Fokus nach dem Mount auf den CodeMirror-Editor. */
76
+ /** Focuses the CodeMirror editor after mount. */
77
77
  autofocus: Boolean,
78
78
  })
79
79
 
80
80
  const emit = defineEmits([
81
81
  /**
82
- * Wird bei jeder Wertänderung sowie beim Mount (Initialisierung) gefeuert.
83
- * @arg {string} name - Bone-Name
84
- * @arg {string} value - Aktueller Quelltext
85
- * @arg {string|undefined} lang - Sprach-Key
86
- * @arg {number|undefined} index - Index im Multiple-Array
82
+ * Fired on every value change and on mount (initialization).
83
+ * @arg {string} name - Bone name
84
+ * @arg {string} value - Current source code
85
+ * @arg {string|undefined} lang - Language key
86
+ * @arg {number|undefined} index - Index in the multiple array
87
87
  */
88
88
  "change",
89
89
  ])
@@ -22,43 +22,43 @@
22
22
  <script setup>
23
23
  import { reactive, onMounted, inject } from "vue"
24
24
  /**
25
- * Farbauswahl-Feld über ein natives `<wa-color-picker>`-Element.
25
+ * Color picker field using a native `<wa-color-picker>` element.
26
26
  *
27
- * Speichert den gewählten Farbwert als Hex-String, z.B. `"#e74c3c"`.
28
- * Unterstützt mehrfache Werte (`multiple`), aber keine Mehrsprachigkeit.
27
+ * Stores the selected color value as a hex string, e.g. `"#e74c3c"`.
28
+ * Supports multiple values (`multiple`), but not multiple languages.
29
29
  *
30
30
  * @displayName ColorBone
31
31
  *
32
- * @cssClass bone-widget - Basis-Klasse aller Bone-Widgets
33
- * @cssClass bone-widget-color - Kennzeichnet den Bone-Typ
34
- * @cssClass bone-widget-color-default - Standard-Variante
35
- * @cssClass bone-widget-color-{name} - Dynamisch gesetzt auf den Bone-Namen, z.B. `bone-widget-color-color`
32
+ * @cssClass bone-widget - Base class of all bone widgets
33
+ * @cssClass bone-widget-color - Identifies the bone type
34
+ * @cssClass bone-widget-color-default - Default variant
35
+ * @cssClass bone-widget-color-{name} - Dynamically set to the bone name, e.g. `bone-widget-color-color`
36
36
  */
37
37
  defineOptions({
38
38
  inheritAttrs: false,
39
39
  })
40
40
  const props = defineProps({
41
- /** Bone-Name – wird in jedem `change`-Event als erstes Argument übergeben. */
41
+ /** Bone name – passed as the first argument in every `change` event. */
42
42
  name: String,
43
- /** Aktueller Bone-Wert als Hex-String, z.B. `"#e74c3c"`, oder `null`. */
43
+ /** Current bone value as a hex string, e.g. `"#e74c3c"`, or `null`. */
44
44
  value: [Object, String, Number, Boolean, Array],
45
- /** Index im Multiple-Array; `undefined` bei Einzelwert. */
45
+ /** Index in the multiple array; `undefined` for a single value. */
46
46
  index: Number,
47
- /** Sprach-Key bei mehrsprachigen Bones, z.B. `"de"`. */
47
+ /** Language key for multilingual bones, e.g. `"de"`. */
48
48
  lang: String,
49
- /** Bone-Struktur (aktuell nicht aktiv genutzt). */
49
+ /** Bone structure (currently not actively used). */
50
50
  bone: Object,
51
- /** Setzt den Fokus nach 600 ms auf das Input-Element. */
51
+ /** Focuses the input element after 600 ms. */
52
52
  autofocus: Boolean,
53
53
  })
54
54
 
55
55
  const emit = defineEmits([
56
56
  /**
57
- * Wird bei jeder Wertänderung sowie beim Mount (Initialisierung) gefeuert.
58
- * @arg {string} name - Bone-Name
59
- * @arg {string|null} value - Gewählter Farbwert als Hex-String oder `null`
60
- * @arg {string|undefined} lang - Sprach-Key
61
- * @arg {number|undefined} index - Index im Multiple-Array
57
+ * Fired on every value change and on mount (initialization).
58
+ * @arg {string} name - Bone name
59
+ * @arg {string|null} value - Selected color value as a hex string or `null`
60
+ * @arg {string|undefined} lang - Language key
61
+ * @arg {number|undefined} index - Index in the multiple array
62
62
  */
63
63
  "change",
64
64
  ])
@@ -19,48 +19,48 @@
19
19
  <script setup>
20
20
  import { reactive, onMounted, computed, inject } from "vue"
21
21
  /**
22
- * Datums- und/oder Zeitfeld, gesteuert durch `bonestructure.date` und `bonestructure.time`.
22
+ * Date and/or time field, controlled by `bonestructure.date` and `bonestructure.time`.
23
23
  *
24
- * Rendert ein `<wa-input>` mit dem passenden `type`-Attribut:
25
- * - `date` wenn nur `date: true`
26
- * - `time` wenn nur `time: true`
27
- * - `datetime-local` wenn beide gesetzt sind
24
+ * Renders a `<wa-input>` with the matching `type` attribute:
25
+ * - `date` if only `date: true`
26
+ * - `time` if only `time: true`
27
+ * - `datetime-local` if both are set
28
28
  *
29
- * Bereinigt Zeitzonendaten aus dem Wert, bevor er ans Input weitergegeben wird.
30
- * Unterstützt mehrfache Werte (`multiple`), aber keine Mehrsprachigkeit.
29
+ * Strips timezone data from the value before it is passed to the input.
30
+ * Supports multiple values (`multiple`), but not multiple languages.
31
31
  *
32
32
  * @displayName DateBone
33
33
  *
34
- * @cssClass bone-widget - Basis-Klasse aller Bone-Widgets
35
- * @cssClass bone-widget-date - Kennzeichnet den Bone-Typ
36
- * @cssClass bone-widget-date-default - Standard-Variante
37
- * @cssClass bone-widget-date-{name} - Dynamisch gesetzt auf den Bone-Namen, z.B. `bone-widget-date-publishedAt`
34
+ * @cssClass bone-widget - Base class of all bone widgets
35
+ * @cssClass bone-widget-date - Identifies the bone type
36
+ * @cssClass bone-widget-date-default - Default variant
37
+ * @cssClass bone-widget-date-{name} - Dynamically set to the bone name, e.g. `bone-widget-date-publishedAt`
38
38
  */
39
39
  defineOptions({
40
40
  inheritAttrs: false,
41
41
  })
42
42
  const props = defineProps({
43
- /** Bone-Name – wird in jedem `change`-Event als erstes Argument übergeben. */
43
+ /** Bone name – passed as the first argument in every `change` event. */
44
44
  name: String,
45
- /** Aktueller Bone-Wert als ISO-String, z.B. `"2026-03-28"` oder `"10:30:00"`. */
45
+ /** Current bone value as an ISO string, e.g. `"2026-03-28"` or `"10:30:00"`. */
46
46
  value: [Object, String, Number, Boolean, Array],
47
- /** Index im Multiple-Array; `undefined` bei Einzelwert. */
47
+ /** Index in the multiple array; `undefined` for a single value. */
48
48
  index: Number,
49
- /** Sprach-Key bei mehrsprachigen Bones, z.B. `"de"`. */
49
+ /** Language key for multilingual bones, e.g. `"de"`. */
50
50
  lang: String,
51
- /** Bone-Struktur (aktuell nicht aktiv genutzt). */
51
+ /** Bone structure (currently not actively used). */
52
52
  bone: Object,
53
- /** Setzt den Fokus nach 600 ms auf das Input-Element. */
53
+ /** Focuses the input element after 600 ms. */
54
54
  autofocus: Boolean,
55
55
  })
56
56
 
57
57
  const emit = defineEmits([
58
58
  /**
59
- * Wird bei jeder Wertänderung sowie beim Mount (Initialisierung) gefeuert.
60
- * @arg {string} name - Bone-Name
61
- * @arg {string} value - Aktueller Eingabewert als ISO-String
62
- * @arg {string|undefined} lang - Sprach-Key
63
- * @arg {number|undefined} index - Index im Multiple-Array
59
+ * Fired on every value change and on mount (initialization).
60
+ * @arg {string} name - Bone name
61
+ * @arg {string} value - Current input value as an ISO string
62
+ * @arg {string|undefined} lang - Language key
63
+ * @arg {number|undefined} index - Index in the multiple array
64
64
  */
65
65
  "change",
66
66
  ])
@@ -21,45 +21,45 @@
21
21
  import { reactive, onMounted, inject, ref, watchEffect, computed } from "vue"
22
22
  import { useTimeoutFn } from "@vueuse/core"
23
23
  /**
24
- * Einzeiliges E-Mail-Eingabefeld mit nativer Browser-Validierung.
24
+ * Single-line email input field with native browser validation.
25
25
  *
26
- * Rendert ein `<wa-input type="email">` und nutzt die native Constraint
27
- * Validation API des Browsers zur Format-Prüfung. Bei
28
- * `boneState.label === "placeholder"` wird die Bone-Beschreibung als
29
- * Placeholder angezeigt statt als Label darüber.
26
+ * Renders a `<wa-input type="email">` and uses the browser's native Constraint
27
+ * Validation API for format checking. With
28
+ * `boneState.label === "placeholder"`, the bone description is shown as a
29
+ * placeholder instead of as a label above.
30
30
  *
31
31
  * @displayName EmailBone
32
32
  *
33
- * @cssClass bone-widget - Basis-Klasse aller Bone-Widgets
34
- * @cssClass bone-widget-email - Kennzeichnet den Bone-Typ
35
- * @cssClass bone-widget-email-default - Standard-Variante
36
- * @cssClass bone-widget-email-{name} - Dynamisch gesetzt auf den Bone-Namen, z.B. `bone-widget-email-email`
33
+ * @cssClass bone-widget - Base class of all bone widgets
34
+ * @cssClass bone-widget-email - Identifies the bone type
35
+ * @cssClass bone-widget-email-default - Default variant
36
+ * @cssClass bone-widget-email-{name} - Dynamically set to the bone name, e.g. `bone-widget-email-email`
37
37
  */
38
38
  defineOptions({
39
39
  inheritAttrs: false,
40
40
  })
41
41
  const props = defineProps({
42
- /** Bone-Name – wird in jedem `change`-Event als erstes Argument übergeben. */
42
+ /** Bone name – passed as the first argument in every `change` event. */
43
43
  name: String,
44
- /** Aktueller Bone-Wert. */
44
+ /** Current bone value. */
45
45
  value: [Object, String, Number, Boolean, Array],
46
- /** Index im Multiple-Array; `undefined` bei Einzelwert. */
46
+ /** Index in the multiple array; `undefined` for a single value. */
47
47
  index: Number,
48
- /** Sprach-Key bei mehrsprachigen Bones, z.B. `"de"`. */
48
+ /** Language key for multilingual bones, e.g. `"de"`. */
49
49
  lang: String,
50
- /** Bone-Struktur (aktuell nicht aktiv genutzt). */
50
+ /** Bone structure (currently not actively used). */
51
51
  bone: Object,
52
- /** Setzt den Fokus nach 600 ms auf das Input-Element. */
52
+ /** Focuses the input element after 600 ms. */
53
53
  autofocus: Boolean,
54
54
  })
55
55
 
56
56
  const emit = defineEmits([
57
57
  /**
58
- * Wird bei jeder Wertänderung sowie beim Mount (Initialisierung) gefeuert.
59
- * @arg {string} name - Bone-Name
60
- * @arg {string} value - Aktueller Eingabewert
61
- * @arg {string|undefined} lang - Sprach-Key
62
- * @arg {number|undefined} index - Index im Multiple-Array
58
+ * Fired on every value change and on mount (initialization).
59
+ * @arg {string} name - Bone name
60
+ * @arg {string} value - Current input value
61
+ * @arg {string|undefined} lang - Language key
62
+ * @arg {number|undefined} index - Index in the multiple array
63
63
  */
64
64
  "change",
65
65
  ])