@budibase/frontend-core 1.2.41-alpha.4 → 1.2.42
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/api/attachments.js +0 -27
- package/src/constants.js +1 -5
- package/src/themes/midnight.css +0 -2
- package/src/themes/nord.css +0 -3
- package/src/utils/lucene.js +4 -31
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/frontend-core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.42",
|
|
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.2.
|
|
9
|
+
"@budibase/bbui": "^1.2.42",
|
|
10
10
|
"lodash": "^4.17.21",
|
|
11
11
|
"svelte": "^3.46.2"
|
|
12
12
|
},
|
|
13
|
-
"gitHead": "
|
|
13
|
+
"gitHead": "111226abbd5e491027931e272d2267f25057fb13"
|
|
14
14
|
}
|
package/src/api/attachments.js
CHANGED
|
@@ -61,32 +61,5 @@ export const buildAttachmentEndpoints = API => {
|
|
|
61
61
|
})
|
|
62
62
|
return { publicUrl }
|
|
63
63
|
},
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Deletes attachments from the bucket.
|
|
67
|
-
* @param keys the attachments to delete
|
|
68
|
-
* @param tableId the associated table ID
|
|
69
|
-
*/
|
|
70
|
-
deleteAttachments: async ({ keys, tableId }) => {
|
|
71
|
-
return await API.post({
|
|
72
|
-
url: `/api/attachments/${tableId}/delete`,
|
|
73
|
-
body: {
|
|
74
|
-
keys,
|
|
75
|
-
},
|
|
76
|
-
})
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Deletes attachments from the builder bucket.
|
|
81
|
-
* @param keys the attachments to delete
|
|
82
|
-
*/
|
|
83
|
-
deleteBuilderAttachments: async keys => {
|
|
84
|
-
return await API.post({
|
|
85
|
-
url: `/api/attachments/delete`,
|
|
86
|
-
body: {
|
|
87
|
-
keys,
|
|
88
|
-
},
|
|
89
|
-
})
|
|
90
|
-
},
|
|
91
64
|
}
|
|
92
65
|
}
|
package/src/constants.js
CHANGED
|
@@ -39,17 +39,13 @@ export const OperatorOptions = {
|
|
|
39
39
|
label: "Contains",
|
|
40
40
|
},
|
|
41
41
|
NotContains: {
|
|
42
|
-
value: "
|
|
42
|
+
value: "notEqual",
|
|
43
43
|
label: "Does Not Contain",
|
|
44
44
|
},
|
|
45
45
|
In: {
|
|
46
46
|
value: "oneOf",
|
|
47
47
|
label: "Is in",
|
|
48
48
|
},
|
|
49
|
-
ContainsAny: {
|
|
50
|
-
value: "containsAny",
|
|
51
|
-
label: "Has any",
|
|
52
|
-
},
|
|
53
49
|
}
|
|
54
50
|
|
|
55
51
|
// Cookie names
|
package/src/themes/midnight.css
CHANGED
|
@@ -12,7 +12,5 @@
|
|
|
12
12
|
--spectrum-global-color-gray-700: hsl(var(--hue), var(--sat), 70%);
|
|
13
13
|
--spectrum-global-color-gray-800: hsl(var(--hue), var(--sat), 80%);
|
|
14
14
|
--spectrum-global-color-gray-900: hsl(var(--hue), var(--sat), 95%);
|
|
15
|
-
|
|
16
|
-
--modal-background: var(--spectrum-global-color-gray-50);
|
|
17
15
|
}
|
|
18
16
|
|
package/src/themes/nord.css
CHANGED
|
@@ -43,7 +43,4 @@
|
|
|
43
43
|
|
|
44
44
|
--spectrum-alias-highlight-hover: rgba(169, 177, 193, 0.1);
|
|
45
45
|
--spectrum-alias-highlight-active: rgba(169, 177, 193, 0.1);
|
|
46
|
-
--spectrum-alias-background-color-hover-overlay: rgba(169, 177, 193, 0.1);
|
|
47
|
-
|
|
48
|
-
--modal-background: var(--spectrum-global-color-gray-50);
|
|
49
46
|
}
|
package/src/utils/lucene.js
CHANGED
|
@@ -32,9 +32,9 @@ export const getValidOperatorsForType = type => {
|
|
|
32
32
|
} else if (type === "number") {
|
|
33
33
|
return numOps
|
|
34
34
|
} else if (type === "options") {
|
|
35
|
-
return [Op.Equals, Op.NotEquals, Op.Empty, Op.NotEmpty
|
|
35
|
+
return [Op.Equals, Op.NotEquals, Op.Empty, Op.NotEmpty]
|
|
36
36
|
} else if (type === "array") {
|
|
37
|
-
return [Op.Contains, Op.NotContains, Op.Empty, Op.NotEmpty
|
|
37
|
+
return [Op.Contains, Op.NotContains, Op.Empty, Op.NotEmpty]
|
|
38
38
|
} else if (type === "boolean") {
|
|
39
39
|
return [Op.Equals, Op.NotEquals, Op.Empty, Op.NotEmpty]
|
|
40
40
|
} else if (type === "longform") {
|
|
@@ -96,7 +96,6 @@ export const buildLuceneQuery = filter => {
|
|
|
96
96
|
contains: {},
|
|
97
97
|
notContains: {},
|
|
98
98
|
oneOf: {},
|
|
99
|
-
containsAny: {},
|
|
100
99
|
}
|
|
101
100
|
if (Array.isArray(filter)) {
|
|
102
101
|
filter.forEach(expression => {
|
|
@@ -104,10 +103,6 @@ export const buildLuceneQuery = filter => {
|
|
|
104
103
|
const isHbs =
|
|
105
104
|
typeof value === "string" && value.match(HBS_REGEX)?.length > 0
|
|
106
105
|
// Parse all values into correct types
|
|
107
|
-
if (operator === "allOr") {
|
|
108
|
-
query.allOr = true
|
|
109
|
-
return
|
|
110
|
-
}
|
|
111
106
|
if (type === "datetime") {
|
|
112
107
|
// Ensure date value is a valid date and parse into correct format
|
|
113
108
|
if (!value) {
|
|
@@ -119,7 +114,7 @@ export const buildLuceneQuery = filter => {
|
|
|
119
114
|
return
|
|
120
115
|
}
|
|
121
116
|
}
|
|
122
|
-
if (type === "number" &&
|
|
117
|
+
if (type === "number" && typeof value === "string") {
|
|
123
118
|
if (operator === "oneOf") {
|
|
124
119
|
value = value.split(",").map(item => parseFloat(item))
|
|
125
120
|
} else if (!isHbs) {
|
|
@@ -129,13 +124,6 @@ export const buildLuceneQuery = filter => {
|
|
|
129
124
|
if (type === "boolean") {
|
|
130
125
|
value = `${value}`?.toLowerCase() === "true"
|
|
131
126
|
}
|
|
132
|
-
if (
|
|
133
|
-
["contains", "notContains", "containsAny"].includes(operator) &&
|
|
134
|
-
type === "array" &&
|
|
135
|
-
typeof value === "string"
|
|
136
|
-
) {
|
|
137
|
-
value = value.split(",")
|
|
138
|
-
}
|
|
139
127
|
if (operator.startsWith("range")) {
|
|
140
128
|
const minint =
|
|
141
129
|
SqlNumberTypeRangeMap[externalType]?.min || Number.MIN_SAFE_INTEGER
|
|
@@ -252,18 +240,6 @@ export const runLuceneQuery = (docs, query) => {
|
|
|
252
240
|
return !testValue?.includes(docValue)
|
|
253
241
|
})
|
|
254
242
|
|
|
255
|
-
const containsAny = match("containsAny", (docValue, testValue) => {
|
|
256
|
-
return !docValue?.includes(...testValue)
|
|
257
|
-
})
|
|
258
|
-
|
|
259
|
-
const contains = match("contains", (docValue, testValue) => {
|
|
260
|
-
return !testValue?.every(item => docValue?.includes(item))
|
|
261
|
-
})
|
|
262
|
-
|
|
263
|
-
const notContains = match("notContains", (docValue, testValue) => {
|
|
264
|
-
return testValue?.every(item => docValue?.includes(item))
|
|
265
|
-
})
|
|
266
|
-
|
|
267
243
|
// Match a document against all criteria
|
|
268
244
|
const docMatch = doc => {
|
|
269
245
|
return (
|
|
@@ -274,10 +250,7 @@ export const runLuceneQuery = (docs, query) => {
|
|
|
274
250
|
notEqualMatch(doc) &&
|
|
275
251
|
emptyMatch(doc) &&
|
|
276
252
|
notEmptyMatch(doc) &&
|
|
277
|
-
oneOf(doc)
|
|
278
|
-
contains(doc) &&
|
|
279
|
-
containsAny(doc) &&
|
|
280
|
-
notContains(doc)
|
|
253
|
+
oneOf(doc)
|
|
281
254
|
)
|
|
282
255
|
}
|
|
283
256
|
|