@fw-components/formula-editor 2.0.7-formula-editor.16 → 2.0.7-formula-editor.17
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.
|
@@ -29,6 +29,7 @@ let FormulaEditor = class FormulaEditor extends LitElement {
|
|
|
29
29
|
this.currentCursorPosition = null;
|
|
30
30
|
this.currentCursorRect = undefined;
|
|
31
31
|
this.lastInputType = "undef";
|
|
32
|
+
this.isFocus = false;
|
|
32
33
|
this.content = "";
|
|
33
34
|
this.placeholder = "Type your formula...";
|
|
34
35
|
this.variables = new Map();
|
|
@@ -181,10 +182,12 @@ let FormulaEditor = class FormulaEditor extends LitElement {
|
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
handleFocusOut(e) {
|
|
185
|
+
this.isFocus = false;
|
|
184
186
|
this._recommendations = null;
|
|
185
187
|
this.requestUpdate();
|
|
186
188
|
}
|
|
187
189
|
handleFocus(e) {
|
|
190
|
+
this.isFocus = true;
|
|
188
191
|
if (!this.content.trim()) {
|
|
189
192
|
this._recommendations = Array.from(this.variables.keys());
|
|
190
193
|
}
|
|
@@ -212,7 +215,7 @@ let FormulaEditor = class FormulaEditor extends LitElement {
|
|
|
212
215
|
@blur=${this.handleFocusOut}
|
|
213
216
|
@focus=${this.handleFocus}
|
|
214
217
|
></div>
|
|
215
|
-
${this._recommendations && this.
|
|
218
|
+
${this._recommendations && this.isFocus
|
|
216
219
|
? html ` <suggestion-menu
|
|
217
220
|
.recommendations=${this._recommendations}
|
|
218
221
|
.currentSelection=${this._selectedRecommendation}
|
|
@@ -245,6 +248,9 @@ __decorate([
|
|
|
245
248
|
__decorate([
|
|
246
249
|
state()
|
|
247
250
|
], FormulaEditor.prototype, "_selectedRecommendation", void 0);
|
|
251
|
+
__decorate([
|
|
252
|
+
state()
|
|
253
|
+
], FormulaEditor.prototype, "isFocus", void 0);
|
|
248
254
|
__decorate([
|
|
249
255
|
property()
|
|
250
256
|
], FormulaEditor.prototype, "content", void 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fw-components/formula-editor",
|
|
3
|
-
"version": "2.0.7-formula-editor.
|
|
3
|
+
"version": "2.0.7-formula-editor.17",
|
|
4
4
|
"description": "A WYSIWYG type formula editor",
|
|
5
5
|
"main": "dist/formula-editor/src/formula-builder.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"@types/big.js": "^6.1.6",
|
|
26
26
|
"es-dev-server": "^2.1.0"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "0585773ac6796039ec5e59c265c2347994efae3a"
|
|
29
29
|
}
|