@masterteam/components 0.0.207 → 0.0.208
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/fesm2022/masterteam-components-entities.mjs +25 -4
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-formula.mjs +10 -3
- package/fesm2022/masterteam-components-formula.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-entities.d.ts +4 -0
- package/types/masterteam-components-formula.d.ts +2 -2
|
@@ -149,7 +149,7 @@ function createOperatorToken(symbol, depth = 0, functionId, argIndex) {
|
|
|
149
149
|
/**
|
|
150
150
|
* Create a literal token
|
|
151
151
|
*/
|
|
152
|
-
function createLiteralToken(value, depth = 0, functionId, argIndex) {
|
|
152
|
+
function createLiteralToken(value, depth = 0, functionId, argIndex, display) {
|
|
153
153
|
let displayValue = String(value);
|
|
154
154
|
let literalType = 'string';
|
|
155
155
|
if (typeof value === 'number') {
|
|
@@ -165,6 +165,10 @@ function createLiteralToken(value, depth = 0, functionId, argIndex) {
|
|
|
165
165
|
id: generateTokenId(),
|
|
166
166
|
type: 'literal',
|
|
167
167
|
value: displayValue,
|
|
168
|
+
// Friendly label rendered on the chip while `value` stays the executable
|
|
169
|
+
// (serialized) form — e.g. a lookup value shows "Completed" but serializes
|
|
170
|
+
// as "completed". Cosmetic only; serialization never reads `display`.
|
|
171
|
+
display: display?.trim() ? display : undefined,
|
|
168
172
|
literalType,
|
|
169
173
|
depth,
|
|
170
174
|
functionId,
|
|
@@ -657,11 +661,12 @@ function createOperatorBlock(symbol) {
|
|
|
657
661
|
};
|
|
658
662
|
}
|
|
659
663
|
/** Create a literal block */
|
|
660
|
-
function createLiteralBlock(value) {
|
|
664
|
+
function createLiteralBlock(value, display) {
|
|
661
665
|
return {
|
|
662
666
|
id: generateSmartBlockId(),
|
|
663
667
|
type: 'literal',
|
|
664
668
|
value: String(value),
|
|
669
|
+
display,
|
|
665
670
|
literalValue: value,
|
|
666
671
|
};
|
|
667
672
|
}
|
|
@@ -1002,7 +1007,9 @@ class FormulaEditor {
|
|
|
1002
1007
|
case 'operator':
|
|
1003
1008
|
return [createOperatorToken(block.operatorSymbol || block.value)];
|
|
1004
1009
|
case 'literal':
|
|
1005
|
-
return [
|
|
1010
|
+
return [
|
|
1011
|
+
createLiteralToken(block.literalValue ?? block.value, 0, undefined, undefined, block.display),
|
|
1012
|
+
];
|
|
1006
1013
|
default:
|
|
1007
1014
|
return [createLiteralToken(block.value)];
|
|
1008
1015
|
}
|