@budibase/frontend-core 1.1.30 → 1.1.31
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/package.json +3 -3
- package/src/utils/lucene.js +5 -1
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/frontend-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.31",
|
|
4
4
|
"description": "Budibase frontend core libraries used in builder and client",
|
|
5
5
|
"author": "Budibase",
|
|
6
6
|
"license": "MPL-2.0",
|
|
7
7
|
"svelte": "src/index.js",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@budibase/bbui": "^1.1.
|
|
9
|
+
"@budibase/bbui": "^1.1.31",
|
|
10
10
|
"lodash": "^4.17.21",
|
|
11
11
|
"svelte": "^3.46.2"
|
|
12
12
|
},
|
|
13
|
-
"gitHead": "
|
|
13
|
+
"gitHead": "da3be5a095ce403e4f1ff13e3b9f21708a998e6b"
|
|
14
14
|
}
|
package/src/utils/lucene.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Helpers } from "@budibase/bbui"
|
|
2
2
|
import { OperatorOptions, SqlNumberTypeRangeMap } from "../constants"
|
|
3
3
|
|
|
4
|
+
const HBS_REGEX = /{{([^{].*?)}}/g
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* Returns the valid operator options for a certain data type
|
|
6
8
|
* @param type the data type
|
|
@@ -98,6 +100,8 @@ export const buildLuceneQuery = filter => {
|
|
|
98
100
|
if (Array.isArray(filter)) {
|
|
99
101
|
filter.forEach(expression => {
|
|
100
102
|
let { operator, field, type, value, externalType } = expression
|
|
103
|
+
const isHbs =
|
|
104
|
+
typeof value === "string" && value.match(HBS_REGEX)?.length > 0
|
|
101
105
|
// Parse all values into correct types
|
|
102
106
|
if (type === "datetime" && value) {
|
|
103
107
|
value = new Date(value).toISOString()
|
|
@@ -105,7 +109,7 @@ export const buildLuceneQuery = filter => {
|
|
|
105
109
|
if (type === "number" && !Array.isArray(value)) {
|
|
106
110
|
if (operator === "oneOf") {
|
|
107
111
|
value = value.split(",").map(item => parseFloat(item))
|
|
108
|
-
} else {
|
|
112
|
+
} else if (!isHbs) {
|
|
109
113
|
value = parseFloat(value)
|
|
110
114
|
}
|
|
111
115
|
}
|