@dataloop-ai/components 0.20.81 → 0.20.83

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.81",
3
+ "version": "0.20.83",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -848,7 +848,7 @@ export default defineComponent({
848
848
 
849
849
  //#region computed
850
850
  const editorStyle = computed((): SyntaxColorSchema => {
851
- return createColorSchema(colorSchema.value, aliases.value)
851
+ return createColorSchema(colorSchema.value, aliases.value, schema.value)
852
852
  })
853
853
 
854
854
  const defaultIcon = 'icon-dl-stars'
@@ -162,7 +162,7 @@ export function replaceJSDatesWithStringifiedDates(
162
162
  } else {
163
163
  toReturn[key] = formatToStringDate(value)
164
164
  }
165
- } else if (typeof value === 'object') {
165
+ } else if (value && typeof value === 'object') {
166
166
  toReturn[key] = replaceJSDatesWithStringifiedDates(
167
167
  toReturn[key],
168
168
  dateKeys
@@ -343,13 +343,25 @@ export function setValueAliases(json: Data, schema: Data) {
343
343
 
344
344
  export function createColorSchema(
345
345
  colorSchema: ColorSchema,
346
- aliases: Alias[]
346
+ aliases: Alias[],
347
+ schema: Data
347
348
  ): SyntaxColorSchema {
348
349
  const thisFields = []
349
350
  for (const key in aliases) {
350
351
  thisFields.push(aliases[key].alias)
351
352
  }
352
353
 
354
+ const addKeysFromSchema = (schema: Data, parentKey?: string) => {
355
+ for (const key in schema) {
356
+ const fullKey = parentKey ? `${parentKey}.${key}` : key
357
+ thisFields.push(fullKey)
358
+ if (typeof schema[key] === 'object') {
359
+ addKeysFromSchema(schema[key], fullKey)
360
+ }
361
+ }
362
+ }
363
+ addKeysFromSchema(schema)
364
+
353
365
  const thisOperators = []
354
366
  for (const key in operators) {
355
367
  thisOperators.push(operators[key])
@@ -275,7 +275,9 @@ export const stringifySmartQuery = (query: { [key: string]: any }): string => {
275
275
  result += ' AND '
276
276
  }
277
277
 
278
- if (isObject(value)) {
278
+ if (value === null) {
279
+ result += `${key} = null`
280
+ } else if (isObject(value)) {
279
281
  for (const operator in value) {
280
282
  if (value.hasOwnProperty(operator)) {
281
283
  let operatorValue = (