@ai-matrx/records-ui 0.89.2 → 0.89.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog — @ai-matrx/records-ui
2
2
 
3
+ ## 0.89.3
4
+ ### Unreleased
5
+
6
+ - **Fix (6e, found on the live walk): a stored score past what a rating is out of is shown as
7
+ stored, in amber** — a Crew rating of 1250.5 drew five lit, clickable stars; the one-click stars
8
+ now draw only for an empty value or one inside 0…max, and anything else falls to the registry's
9
+ fallback (THE FALLBACK LAW). RED → GREEN in
10
+ `the-merged-grid-shows-formats-colours-summaries-and-row-labels.test.tsx`.
11
+
3
12
  ## 0.89.2
4
13
 
5
14
  Automatic changed-only republish (docs/metadata drift since the last tag — see
package/dist/index.cjs CHANGED
@@ -2070,7 +2070,9 @@ function FormattedValue({
2070
2070
  onRate
2071
2071
  }) {
2072
2072
  const def = (0, import_field_formats3.getFieldFormat)(format.id);
2073
- if (def?.id === "rating" && onRate) {
2073
+ const score = numberOf(value);
2074
+ const max = format.options?.ratingMax ?? 5;
2075
+ if (def?.id === "rating" && onRate && (value === null || value === void 0 || value === "" || score !== null && score >= 0 && score <= max)) {
2074
2076
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RatingStars, { value, max: format.options?.ratingMax ?? 5, onRate });
2075
2077
  }
2076
2078
  const result = (0, import_field_formats3.formatFieldValue)(value, format);
@@ -4634,6 +4636,10 @@ var PLAIN_WORD = {
4634
4636
  date: "datetime",
4635
4637
  datetime: "datetime"
4636
4638
  };
4639
+ function storesWord(def) {
4640
+ if (KIND_WORD[def.id]) return def.label;
4641
+ return BASE_WORDS[def.base] ?? def.base;
4642
+ }
4637
4643
  var BASE_WORDS = {
4638
4644
  string: "Text",
4639
4645
  number: "Number",
@@ -4764,12 +4770,12 @@ function FieldFormatPicker({
4764
4770
  otherKinds.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("optgroup", { label: "Other kinds \xB7 changes what the column stores", "data-records-other-kinds": "", children: otherKinds.map(({ def }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("option", { value: def.id, children: [
4765
4771
  def.label,
4766
4772
  " \xB7 stores ",
4767
- BASE_WORDS[def.base] ?? def.base
4773
+ storesWord(def)
4768
4774
  ] }, def.id)) }) : null
4769
4775
  ]
4770
4776
  }
4771
4777
  ),
4772
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-[11px] text-muted-foreground", children: retypedTo ? `This changes what the column stores, to ${BASE_WORDS[retypedTo.def.base] ?? retypedTo.def.base}. The store converts each value it can, and says so before it keeps anything it cannot.` : active ? active.description : "How every value in this column is written, wherever it appears." }),
4778
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-[11px] text-muted-foreground", children: retypedTo ? `This changes what the column stores, to ${storesWord(retypedTo.def)}. The store converts each value it can, and says so before it keeps anything it cannot.` : active ? active.description : "How every value in this column is written, wherever it appears." }),
4773
4779
  optionKeys.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-wrap items-end gap-2", children: [
4774
4780
  option(
4775
4781
  "currency",