@wildwinter/app-shell 0.52.0 → 0.53.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.
@@ -74,6 +74,9 @@ interface FieldRowOptions {
74
74
  disabled?: boolean;
75
75
  /** A message of the app's own about this value (a check the row cannot make), shown under the control. */
76
76
  problem?: string;
77
+ /** The app's own sentence INSTEAD of the row's (a renamed stage said better than "not one of the stages").
78
+ * Given, it is the whole message; `problem` is ignored. */
79
+ replaceProblem?: string;
77
80
  /** The caption; default the field's name. */
78
81
  label?: string | Node;
79
82
  /** Added to the row and its caption, so a row sits in its app's layout. */
@@ -74,6 +74,9 @@ interface FieldRowOptions {
74
74
  disabled?: boolean;
75
75
  /** A message of the app's own about this value (a check the row cannot make), shown under the control. */
76
76
  problem?: string;
77
+ /** The app's own sentence INSTEAD of the row's (a renamed stage said better than "not one of the stages").
78
+ * Given, it is the whole message; `problem` is ignored. */
79
+ replaceProblem?: string;
77
80
  /** The caption; default the field's name. */
78
81
  label?: string | Node;
79
82
  /** Added to the row and its caption, so a row sits in its app's layout. */
@@ -1,4 +1,4 @@
1
- export { defaultLabel, fallbackText, fieldRow, fieldRowFocus, fieldRows, fieldValueProblem, rungStrip, stageGateNote, valueHelpText } from './chunk-4QDD6GF3.js';
1
+ export { defaultLabel, fallbackText, fieldRow, fieldRowFocus, fieldRows, fieldValueProblem, rungStrip, stageGateNote, valueHelpText } from './chunk-XJM733E6.js';
2
2
  import './chunk-W4WC4FO5.js';
3
3
  //# sourceMappingURL=value-control.js.map
4
4
  //# sourceMappingURL=value-control.js.map
@@ -559,7 +559,7 @@ function fieldRow(initial) {
559
559
  const help = valueHelpText(opts.decl, opts.value);
560
560
  valueHelp.textContent = help;
561
561
  valueHelp.hidden = help === "";
562
- const words = [typing || fieldValueProblem(opts.decl, opts.value), opts.problem ?? ""].filter((w) => w !== "");
562
+ const words = opts.replaceProblem !== void 0 ? [opts.replaceProblem].filter((w) => w !== "") : [typing || fieldValueProblem(opts.decl, opts.value), opts.problem ?? ""].filter((w) => w !== "");
563
563
  problem.textContent = words.join(" ");
564
564
  problem.hidden = words.length === 0;
565
565
  row.classList.toggle("has-problem", words.length > 0);
@@ -856,6 +856,7 @@ function scalarRow(initial) {
856
856
  ...o.onCommit ? { onCommit: (v) => o.onCommit(v) } : {},
857
857
  ...o.disabled !== void 0 ? { disabled: o.disabled } : {},
858
858
  ...problem !== "" ? { problem } : {},
859
+ ...o.replaceProblem !== void 0 ? { replaceProblem: o.replaceProblem } : {},
859
860
  label: o.label ?? nameOf(o.decl),
860
861
  ...o.className !== void 0 ? { className: o.className } : {},
861
862
  ...o.labelClassName !== void 0 ? { labelClassName: o.labelClassName } : {},
@@ -914,7 +915,7 @@ function referenceRow(initial) {
914
915
  sel.disabled = o.onCommit === void 0 || o.disabled === true;
915
916
  help.textContent = o.decl.help ?? o.decl.purpose ?? "";
916
917
  help.hidden = help.textContent === "";
917
- const words = [ownProblems(o.decl, o.value, o.adapter), o.problem ?? ""].filter((w) => w !== "").join(" ");
918
+ const words = o.replaceProblem ?? [ownProblems(o.decl, o.value, o.adapter), o.problem ?? ""].filter((w) => w !== "").join(" ");
918
919
  problem.textContent = words;
919
920
  problem.hidden = words === "";
920
921
  row.classList.toggle("has-problem", words !== "");
@@ -1091,7 +1092,7 @@ function structuredRow(initial) {
1091
1092
  if (decl.type !== "record" && editable()) body.append(adder);
1092
1093
  help.textContent = decl.help ?? decl.purpose ?? "";
1093
1094
  if (help.textContent !== "") body.append(help);
1094
- const words = [ownProblems(decl, o.value, o.adapter), o.problem ?? ""].filter((w) => w !== "").join(" ");
1095
+ const words = o.replaceProblem ?? [ownProblems(decl, o.value, o.adapter), o.problem ?? ""].filter((w) => w !== "").join(" ");
1095
1096
  problem.textContent = words;
1096
1097
  problem.hidden = words === "";
1097
1098
  body.append(problem);