@ai-matrx/records-ui 0.93.29 → 0.93.30
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 +6 -0
- package/dist/index.cjs +7 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -7390,7 +7390,9 @@ function useChoiceOptions(fields, keys) {
|
|
|
7390
7390
|
return index;
|
|
7391
7391
|
}
|
|
7392
7392
|
function lookOf(option) {
|
|
7393
|
-
|
|
7393
|
+
const raw = option.data?.["color"];
|
|
7394
|
+
const color = typeof raw === "string" && STYLE_COLORS4.includes(raw) ? raw : void 0;
|
|
7395
|
+
return { id: String(option.id), key: optionKey2(option), label: optionLabel2(option), ...color ? { color } : {} };
|
|
7394
7396
|
}
|
|
7395
7397
|
function paintByOption(style, fields, index, lookup) {
|
|
7396
7398
|
if (index.size === 0) return { style, documentOf: (doc) => doc, choiceColorFor: lookup };
|
|
@@ -7414,10 +7416,13 @@ function paintByOption(style, fields, index, lookup) {
|
|
|
7414
7416
|
}
|
|
7415
7417
|
return out ?? doc;
|
|
7416
7418
|
},
|
|
7419
|
+
// A CHOICE PAINTS IN ITS OWN COLOUR (DATA-V2-BASICS-2 C1b): an option kept in its own Table
|
|
7420
|
+
// carries the colour its owner gave it; coloured by Status, a "Verified" (green) row was tinted
|
|
7421
|
+
// pink by the hash. The option's colour first, then the column's stored colours, then the hash.
|
|
7417
7422
|
choiceColorFor: (fieldKey, value) => {
|
|
7418
7423
|
const option = optionFor(index.get(fieldKey), value);
|
|
7419
7424
|
if (!option) return lookup(fieldKey, value);
|
|
7420
|
-
return lookup(fieldKey, option.label) ?? lookup(fieldKey, option.key);
|
|
7425
|
+
return option.color ?? lookup(fieldKey, option.label) ?? lookup(fieldKey, option.key);
|
|
7421
7426
|
}
|
|
7422
7427
|
};
|
|
7423
7428
|
}
|