@budibase/frontend-core 1.2.44-alpha.0 → 1.2.46

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 CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@budibase/frontend-core",
3
- "version": "1.2.44-alpha.0",
3
+ "version": "1.2.46",
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.44-alpha.0",
9
+ "@budibase/bbui": "^1.2.46",
10
10
  "lodash": "^4.17.21",
11
11
  "svelte": "^3.46.2"
12
12
  },
13
- "gitHead": "a9aebf552f8f7e69aa0afa1d88c6f090a609f470"
13
+ "gitHead": "9c20cb857b8fd3caa99fab0c926c32bc2189deaa"
14
14
  }
@@ -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: "notContains",
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
@@ -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
 
@@ -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
  }
@@ -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, Op.In]
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, Op.ContainsAny]
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") {
@@ -72,7 +72,7 @@ const cleanupQuery = query => {
72
72
  continue
73
73
  }
74
74
  for (let [key, value] of Object.entries(query[filterField])) {
75
- if (!value || value === "") {
75
+ if (value == null || value === "") {
76
76
  delete query[filterField][key]
77
77
  }
78
78
  }
@@ -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
@@ -186,7 +174,7 @@ export const runLuceneQuery = (docs, query) => {
186
174
  return docs
187
175
  }
188
176
 
189
- // make query consistent first
177
+ // Make query consistent first
190
178
  query = cleanupQuery(query)
191
179
 
192
180
  // Iterates over a set of filters and evaluates a fail function against a doc
@@ -218,7 +206,12 @@ export const runLuceneQuery = (docs, query) => {
218
206
 
219
207
  // Process a range match
220
208
  const rangeMatch = match("range", (docValue, testValue) => {
221
- return !docValue || docValue < testValue.low || docValue > testValue.high
209
+ return (
210
+ docValue == null ||
211
+ docValue === "" ||
212
+ docValue < testValue.low ||
213
+ docValue > testValue.high
214
+ )
222
215
  })
223
216
 
224
217
  // Process an equal match (fails if the value is different)
@@ -252,18 +245,6 @@ export const runLuceneQuery = (docs, query) => {
252
245
  return !testValue?.includes(docValue)
253
246
  })
254
247
 
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
248
  // Match a document against all criteria
268
249
  const docMatch = doc => {
269
250
  return (
@@ -274,10 +255,7 @@ export const runLuceneQuery = (docs, query) => {
274
255
  notEqualMatch(doc) &&
275
256
  emptyMatch(doc) &&
276
257
  notEmptyMatch(doc) &&
277
- oneOf(doc) &&
278
- contains(doc) &&
279
- containsAny(doc) &&
280
- notContains(doc)
258
+ oneOf(doc)
281
259
  )
282
260
  }
283
261