@aiaiai-pt/design-system 0.30.0 → 0.31.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.
|
@@ -449,6 +449,12 @@
|
|
|
449
449
|
"required" on the field — not just the disconnected visual hint below.
|
|
450
450
|
Passed through the DS field components' `{...rest}` onto the input. -->
|
|
451
451
|
{@const ariaRequired = parameter.required ? "true" : undefined}
|
|
452
|
+
<!-- #252 — a parameter with `editable: false` (visibility.editable === false)
|
|
453
|
+
renders READ-ONLY: its value (e.g. a logged-in citizen's prefilled
|
|
454
|
+
identity — name/email) is shown but not editable. The value still rides
|
|
455
|
+
the payload; the field just can't be changed. Default (undefined/true) is
|
|
456
|
+
editable, so this is purely additive. -->
|
|
457
|
+
{@const editable = parameter.editable !== false}
|
|
452
458
|
{#if type === "enum" || type === "select" || enumOptions(parameter).length}
|
|
453
459
|
<Select
|
|
454
460
|
label={String(parameter.label ?? key)}
|
|
@@ -465,6 +471,7 @@
|
|
|
465
471
|
name={key}
|
|
466
472
|
type="number"
|
|
467
473
|
value={String(values[key] ?? "")}
|
|
474
|
+
readonly={!editable}
|
|
468
475
|
oninput={(event: Event) => {
|
|
469
476
|
const value = (event.target as HTMLInputElement).value;
|
|
470
477
|
setValue(key, value === "" ? "" : Number(value));
|
|
@@ -554,7 +561,8 @@
|
|
|
554
561
|
<Input
|
|
555
562
|
label={String(parameter.label ?? key)}
|
|
556
563
|
name={key}
|
|
557
|
-
value={String(values[key] ?? "")}
|
|
564
|
+
value={String(values[key] ?? initialValue(parameter) ?? "")}
|
|
565
|
+
readonly={!editable}
|
|
558
566
|
oninput={(event: Event) => setValue(key, (event.target as HTMLInputElement).value)}
|
|
559
567
|
aria-required={ariaRequired}
|
|
560
568
|
/>
|