@budibase/frontend-core 1.2.58-alpha.4 → 1.2.58
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 +3 -30
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/frontend-core",
|
|
3
|
-
"version": "1.2.58
|
|
3
|
+
"version": "1.2.58",
|
|
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.58
|
|
9
|
+
"@budibase/bbui": "^1.2.58",
|
|
10
10
|
"lodash": "^4.17.21",
|
|
11
11
|
"svelte": "^3.46.2"
|
|
12
12
|
},
|
|
13
|
-
"gitHead": "
|
|
13
|
+
"gitHead": "2922b47620173f41097d36b9dc5b1c0f8f7b063a"
|
|
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) {
|
|
@@ -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
|
|
@@ -257,18 +245,6 @@ export const runLuceneQuery = (docs, query) => {
|
|
|
257
245
|
return !testValue?.includes(docValue)
|
|
258
246
|
})
|
|
259
247
|
|
|
260
|
-
const containsAny = match("containsAny", (docValue, testValue) => {
|
|
261
|
-
return !docValue?.includes(...testValue)
|
|
262
|
-
})
|
|
263
|
-
|
|
264
|
-
const contains = match("contains", (docValue, testValue) => {
|
|
265
|
-
return !testValue?.every(item => docValue?.includes(item))
|
|
266
|
-
})
|
|
267
|
-
|
|
268
|
-
const notContains = match("notContains", (docValue, testValue) => {
|
|
269
|
-
return testValue?.every(item => docValue?.includes(item))
|
|
270
|
-
})
|
|
271
|
-
|
|
272
248
|
// Match a document against all criteria
|
|
273
249
|
const docMatch = doc => {
|
|
274
250
|
return (
|
|
@@ -279,10 +255,7 @@ export const runLuceneQuery = (docs, query) => {
|
|
|
279
255
|
notEqualMatch(doc) &&
|
|
280
256
|
emptyMatch(doc) &&
|
|
281
257
|
notEmptyMatch(doc) &&
|
|
282
|
-
oneOf(doc)
|
|
283
|
-
contains(doc) &&
|
|
284
|
-
containsAny(doc) &&
|
|
285
|
-
notContains(doc)
|
|
258
|
+
oneOf(doc)
|
|
286
259
|
)
|
|
287
260
|
}
|
|
288
261
|
|