@dataloop-ai/components 0.20.77 → 0.20.79

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.20.77",
3
+ "version": "0.20.79",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -227,7 +227,7 @@ export function revertValueAliases(json: Data, schema: Data) {
227
227
 
228
228
  const replaceAliases = (where: Data) => {
229
229
  for (const key in where) {
230
- if (typeof where[key] === 'object') {
230
+ if (where[key] && typeof where[key] === 'object') {
231
231
  const val = where[key]
232
232
  const isOperator = operatorKeys.includes(Object.keys(val)[0])
233
233
  const isArrayOperator = ['$in', '$nin'].includes(
@@ -288,7 +288,7 @@ export function setValueAliases(json: Data, schema: Data) {
288
288
  const replaceValues = (where: Data) => {
289
289
  for (const key in where) {
290
290
  const val = where[key]
291
- if (typeof val === 'object') {
291
+ if (val && typeof val === 'object') {
292
292
  const isOperator = operatorKeys.includes(Object.keys(val)[0])
293
293
  const isArrayOperator = ['$in', '$nin'].includes(
294
294
  Object.keys(val)[0]
@@ -314,7 +314,6 @@ export default defineComponent({
314
314
  return between(val, this.minRation, this.maxRatio)
315
315
  },
316
316
  onActivate(evt: MouseEvent) {
317
- console.log('hiihihihihihih')
318
317
  this.updatePosition(evt, this.getDragging(evt))
319
318
  this.updateValue()
320
319
 
@@ -858,7 +858,7 @@ const getValueSuggestions = (
858
858
  typeof type !== 'object'
859
859
  ) {
860
860
  suggestion.push(
861
- typeof type === 'string' ? enquoteString(type) : type
861
+ type !== 'null' && typeof type === 'string' ? enquoteString(type) : type
862
862
  )
863
863
  }
864
864
  }
@@ -43,7 +43,6 @@ export const registerToWindow = (params: {
43
43
  let { key, ref } = params
44
44
  key = !key && ref._isVue ? `${ref.$vnode.tag}-${ref._uid}` : key
45
45
  const dispose = () => {
46
- // console.log(`DISPOSING ${key}`)
47
46
  // @ts-ignore
48
47
  window[key] = undefined
49
48
  // @ts-ignore
@@ -51,7 +50,6 @@ export const registerToWindow = (params: {
51
50
  }
52
51
 
53
52
  const destroyRef = () => {
54
- // console.log(`DESTROYING ${key}`)
55
53
  const keys = Object.keys(ref.$data)
56
54
  keys.forEach((k) => {
57
55
  if (k === 'unsubscribers' && Array.isArray(ref.$data[k])) {
@@ -13,7 +13,7 @@ export function isDatePattern(str: string) {
13
13
 
14
14
  const GeneratePureValue = (value: any) => {
15
15
  if (value === '') {
16
- return null
16
+ return
17
17
  }
18
18
 
19
19
  if (typeof value === 'string') {
@@ -23,6 +23,9 @@ const GeneratePureValue = (value: any) => {
23
23
  if (value === 'false') {
24
24
  return false
25
25
  }
26
+ if (value === 'null') {
27
+ return null
28
+ }
26
29
 
27
30
  try {
28
31
  const num = Number(value)
@@ -137,42 +140,42 @@ export const parseSmartQuery = (
137
140
  case termUpToQuote.includes('>='):
138
141
  ;[key, value] = SplitFirst(term, '>=').map((x) => x.trim())
139
142
  pureValue = GeneratePureValue(value)
140
- if (pureValue !== null) {
143
+ if (pureValue !== undefined) {
141
144
  andQuery.push({ [key]: { $gte: pureValue } })
142
145
  }
143
146
  break
144
147
  case termUpToQuote.includes('<='):
145
148
  ;[key, value] = SplitFirst(term, '<=').map((x) => x.trim())
146
149
  pureValue = GeneratePureValue(value)
147
- if (pureValue !== null) {
150
+ if (pureValue !== undefined) {
148
151
  andQuery.push({ [key]: { $lte: pureValue } })
149
152
  }
150
153
  break
151
154
  case termUpToQuote.includes('>'):
152
155
  ;[key, value] = SplitFirst(term, '>').map((x) => x.trim())
153
156
  pureValue = GeneratePureValue(value)
154
- if (pureValue !== null) {
157
+ if (pureValue !== undefined) {
155
158
  andQuery.push({ [key]: { $gt: pureValue } })
156
159
  }
157
160
  break
158
161
  case termUpToQuote.includes('<'):
159
162
  ;[key, value] = SplitFirst(term, '<').map((x) => x.trim())
160
163
  pureValue = GeneratePureValue(value)
161
- if (pureValue !== null) {
164
+ if (pureValue !== undefined) {
162
165
  andQuery.push({ [key]: { $lt: pureValue } })
163
166
  }
164
167
  break
165
168
  case termUpToQuote.includes('!='):
166
169
  ;[key, value] = SplitFirst(term, '!=').map((x) => x.trim())
167
170
  pureValue = GeneratePureValue(value)
168
- if (pureValue !== null) {
171
+ if (pureValue !== undefined) {
169
172
  andQuery.push({ [key]: { $ne: pureValue } })
170
173
  }
171
174
  break
172
175
  case termUpToQuote.includes('='):
173
176
  ;[key, value] = SplitFirst(term, '=').map((x) => x.trim())
174
177
  pureValue = GeneratePureValue(value)
175
- if (pureValue !== null) {
178
+ if (pureValue !== undefined) {
176
179
  andQuery.push({ [key]: pureValue })
177
180
  }
178
181
  break
@@ -197,7 +200,7 @@ export const parseSmartQuery = (
197
200
  .filter((x) => x)
198
201
 
199
202
  pureValue = GeneratePureValue(queryValue)
200
- if (pureValue !== null && Array.isArray(pureValue)) {
203
+ if (pureValue !== undefined && Array.isArray(pureValue)) {
201
204
  andQuery.push({ [key]: { $nin: pureValue } })
202
205
  }
203
206
  } else {
@@ -208,7 +211,7 @@ export const parseSmartQuery = (
208
211
  .filter((x) => x)
209
212
 
210
213
  pureValue = GeneratePureValue(queryValue)
211
- if (pureValue !== null && Array.isArray(pureValue)) {
214
+ if (pureValue !== undefined && Array.isArray(pureValue)) {
212
215
  andQuery.push({ [key]: { $in: pureValue } })
213
216
  }
214
217
  }