@masterteam/components 0.0.207 → 0.0.209
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/assets/common.css +257 -2
- package/fesm2022/masterteam-components-entities.mjs +25 -4
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-formula.mjs +46 -5
- 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
|
}
|
|
@@ -1132,6 +1139,35 @@ const MONACO_ASSET_DIR = 'assets/monaco/vs';
|
|
|
1132
1139
|
* instance reuses a single load).
|
|
1133
1140
|
*/
|
|
1134
1141
|
let monacoLoadPromise = null;
|
|
1142
|
+
/**
|
|
1143
|
+
* Shared, body-level container for Monaco's overflow widgets (the suggest and
|
|
1144
|
+
* hover popups). Monaco renders those with `position: fixed`, which is meant to
|
|
1145
|
+
* resolve against the viewport — but a `transform` / `will-change: transform`
|
|
1146
|
+
* on ANY ancestor turns that ancestor into the containing block, so a popup
|
|
1147
|
+
* inside a transformed host lands at the wrong offset. This is exactly what
|
|
1148
|
+
* breaks the suggest dropdown inside a PrimeNG dialog/drawer (`.p-dialog` /
|
|
1149
|
+
* `.p-drawer` carry `transform: scale(1)`) and the foblex-flow canvas (`scale`).
|
|
1150
|
+
*
|
|
1151
|
+
* Pointing the editor's `overflowWidgetsDomNode` at a node appended straight to
|
|
1152
|
+
* <body> — which has no transformed ancestor — makes `position: fixed` resolve
|
|
1153
|
+
* against the viewport again, fixing every host at once instead of patching one
|
|
1154
|
+
* container type. Created once and reused by every editor instance (Monaco
|
|
1155
|
+
* appends and cleans up its own per-editor sub-nodes inside it), mirroring how
|
|
1156
|
+
* VS Code shares a single overflow container.
|
|
1157
|
+
*/
|
|
1158
|
+
let monacoOverflowWidgetsNode = null;
|
|
1159
|
+
function resolveOverflowWidgetsNode(doc) {
|
|
1160
|
+
if (monacoOverflowWidgetsNode?.isConnected) {
|
|
1161
|
+
return monacoOverflowWidgetsNode;
|
|
1162
|
+
}
|
|
1163
|
+
const node = doc.createElement('div');
|
|
1164
|
+
// `monaco-editor` lets Monaco's global, theme-driven suggest/hover CSS match;
|
|
1165
|
+
// `mt-formula-editor-overflow` carries our cosmetic tweaks + escape z-index.
|
|
1166
|
+
node.className = 'monaco-editor mt-formula-editor-overflow';
|
|
1167
|
+
doc.body.appendChild(node);
|
|
1168
|
+
monacoOverflowWidgetsNode = node;
|
|
1169
|
+
return node;
|
|
1170
|
+
}
|
|
1135
1171
|
/** Absolute URL to the copied Monaco `vs` folder, with no trailing slash. */
|
|
1136
1172
|
function resolveMonacoAssetBase(doc) {
|
|
1137
1173
|
return new URL(`${MONACO_ASSET_DIR}/`, doc.baseURI)
|
|
@@ -1406,6 +1442,11 @@ class FormulaEditorCode {
|
|
|
1406
1442
|
glyphMargin: false,
|
|
1407
1443
|
automaticLayout: true,
|
|
1408
1444
|
fixedOverflowWidgets: true,
|
|
1445
|
+
// Render suggest/hover popups in a body-level node so their
|
|
1446
|
+
// `position: fixed` resolves against the viewport, not a transformed
|
|
1447
|
+
// ancestor (PrimeNG dialog/drawer, foblex-flow canvas). See
|
|
1448
|
+
// resolveOverflowWidgetsNode above.
|
|
1449
|
+
overflowWidgetsDomNode: resolveOverflowWidgetsNode(this.document),
|
|
1409
1450
|
suggestOnTriggerCharacters: true,
|
|
1410
1451
|
quickSuggestions: { other: true, comments: false, strings: true },
|
|
1411
1452
|
renderLineHighlight: 'line',
|
|
@@ -1912,7 +1953,7 @@ class FormulaEditorCode {
|
|
|
1912
1953
|
useExisting: forwardRef(() => FormulaEditorCode),
|
|
1913
1954
|
multi: true,
|
|
1914
1955
|
},
|
|
1915
|
-
], viewQueries: [{ propertyName: "editorHost", first: true, predicate: ["editorHost"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n [class]=\"containerClasses()\"\r\n [class.opacity-60]=\"disabled()\"\r\n [class.pointer-events-none]=\"disabled()\"\r\n>\r\n <div #editorHost class=\"min-h-20 flex-1\"></div>\r\n\r\n @if (showPlaceholder()) {\r\n <div\r\n class=\"mt-formula-editor-code__placeholder text-sm italic text-surface-400 dark:text-surface-500\"\r\n >\r\n {{ placeholder() }}\r\n </div>\r\n }\r\n</div>\r\n", styles: [".mt-formula-editor-code{position:relative;--mt-formula-editor-code-gutter: 3.25rem;--mt-formula-editor-code-placeholder-top: .25rem}.mt-formula-editor-code__placeholder{position:absolute;top:var(--mt-formula-editor-code-placeholder-top);left:var(--mt-formula-editor-code-gutter);pointer-events:none;z-index:2;white-space:nowrap}.mt-formula-editor-code .monaco-editor .overflow-guard{overflow:visible}.mt-formula-editor-
|
|
1956
|
+
], viewQueries: [{ propertyName: "editorHost", first: true, predicate: ["editorHost"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n [class]=\"containerClasses()\"\r\n [class.opacity-60]=\"disabled()\"\r\n [class.pointer-events-none]=\"disabled()\"\r\n>\r\n <div #editorHost class=\"min-h-20 flex-1\"></div>\r\n\r\n @if (showPlaceholder()) {\r\n <div\r\n class=\"mt-formula-editor-code__placeholder text-sm italic text-surface-400 dark:text-surface-500\"\r\n >\r\n {{ placeholder() }}\r\n </div>\r\n }\r\n</div>\r\n", styles: [".mt-formula-editor-code{position:relative;--mt-formula-editor-code-gutter: 3.25rem;--mt-formula-editor-code-placeholder-top: .25rem}.mt-formula-editor-code__placeholder{position:absolute;top:var(--mt-formula-editor-code-placeholder-top);left:var(--mt-formula-editor-code-gutter);pointer-events:none;z-index:2;white-space:nowrap}.mt-formula-editor-code .monaco-editor .overflow-guard{overflow:visible}.mt-formula-editor-overflow{position:fixed;inset:0 auto auto 0;width:0;height:0;z-index:100000;transform:none}.mt-formula-editor-code .monaco-editor .cursor{transition:opacity .1s ease-in-out}.mt-formula-editor-code .monaco-editor .selected-text{border-radius:0}.mt-formula-editor-code .monaco-editor .bracket-match{border-radius:2px}.mt-formula-editor-code .monaco-editor .view-overlays .current-line{border:none}.mt-formula-editor-code .monaco-editor .monaco-scrollable-element>.scrollbar>.slider{border-radius:0}.mt-formula-editor-code .monaco-editor .suggest-widget,.mt-formula-editor-overflow .suggest-widget{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029,0 0 0 1px #0000000a}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row,.mt-formula-editor-overflow .suggest-widget .monaco-list-row{padding:0 4px}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row.focused,.mt-formula-editor-overflow .suggest-widget .monaco-list-row.focused{border-radius:3px}.mt-formula-editor-code .monaco-editor .monaco-hover,.mt-formula-editor-overflow .monaco-hover{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1916
1957
|
}
|
|
1917
1958
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: FormulaEditorCode, decorators: [{
|
|
1918
1959
|
type: Component,
|
|
@@ -1924,7 +1965,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1924
1965
|
useExisting: forwardRef(() => FormulaEditorCode),
|
|
1925
1966
|
multi: true,
|
|
1926
1967
|
},
|
|
1927
|
-
], template: "<div\r\n [class]=\"containerClasses()\"\r\n [class.opacity-60]=\"disabled()\"\r\n [class.pointer-events-none]=\"disabled()\"\r\n>\r\n <div #editorHost class=\"min-h-20 flex-1\"></div>\r\n\r\n @if (showPlaceholder()) {\r\n <div\r\n class=\"mt-formula-editor-code__placeholder text-sm italic text-surface-400 dark:text-surface-500\"\r\n >\r\n {{ placeholder() }}\r\n </div>\r\n }\r\n</div>\r\n", styles: [".mt-formula-editor-code{position:relative;--mt-formula-editor-code-gutter: 3.25rem;--mt-formula-editor-code-placeholder-top: .25rem}.mt-formula-editor-code__placeholder{position:absolute;top:var(--mt-formula-editor-code-placeholder-top);left:var(--mt-formula-editor-code-gutter);pointer-events:none;z-index:2;white-space:nowrap}.mt-formula-editor-code .monaco-editor .overflow-guard{overflow:visible}.mt-formula-editor-
|
|
1968
|
+
], template: "<div\r\n [class]=\"containerClasses()\"\r\n [class.opacity-60]=\"disabled()\"\r\n [class.pointer-events-none]=\"disabled()\"\r\n>\r\n <div #editorHost class=\"min-h-20 flex-1\"></div>\r\n\r\n @if (showPlaceholder()) {\r\n <div\r\n class=\"mt-formula-editor-code__placeholder text-sm italic text-surface-400 dark:text-surface-500\"\r\n >\r\n {{ placeholder() }}\r\n </div>\r\n }\r\n</div>\r\n", styles: [".mt-formula-editor-code{position:relative;--mt-formula-editor-code-gutter: 3.25rem;--mt-formula-editor-code-placeholder-top: .25rem}.mt-formula-editor-code__placeholder{position:absolute;top:var(--mt-formula-editor-code-placeholder-top);left:var(--mt-formula-editor-code-gutter);pointer-events:none;z-index:2;white-space:nowrap}.mt-formula-editor-code .monaco-editor .overflow-guard{overflow:visible}.mt-formula-editor-overflow{position:fixed;inset:0 auto auto 0;width:0;height:0;z-index:100000;transform:none}.mt-formula-editor-code .monaco-editor .cursor{transition:opacity .1s ease-in-out}.mt-formula-editor-code .monaco-editor .selected-text{border-radius:0}.mt-formula-editor-code .monaco-editor .bracket-match{border-radius:2px}.mt-formula-editor-code .monaco-editor .view-overlays .current-line{border:none}.mt-formula-editor-code .monaco-editor .monaco-scrollable-element>.scrollbar>.slider{border-radius:0}.mt-formula-editor-code .monaco-editor .suggest-widget,.mt-formula-editor-overflow .suggest-widget{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029,0 0 0 1px #0000000a}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row,.mt-formula-editor-overflow .suggest-widget .monaco-list-row{padding:0 4px}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row.focused,.mt-formula-editor-overflow .suggest-widget .monaco-list-row.focused{border-radius:3px}.mt-formula-editor-code .monaco-editor .monaco-hover,.mt-formula-editor-overflow .monaco-hover{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029}\n"] }]
|
|
1928
1969
|
}], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], initialFormula: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialFormula", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], language: [{ type: i0.Input, args: [{ isSignal: true, alias: "language", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], borderless: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderless", required: false }] }], autocompleteProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocompleteProvider", required: false }] }], autocompleteDebounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocompleteDebounceMs", required: false }] }], formulaChange: [{ type: i0.Output, args: ["formulaChange"] }], onBlur: [{ type: i0.Output, args: ["onBlur"] }], onFocus: [{ type: i0.Output, args: ["onFocus"] }], editorHost: [{ type: i0.ViewChild, args: ['editorHost', { isSignal: true }] }] } });
|
|
1929
1970
|
|
|
1930
1971
|
/**
|