@dataloop-ai/components 0.20.89 → 0.20.91

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.89",
3
+ "version": "0.20.91",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -154,7 +154,7 @@ import { debounce, isEqual } from 'lodash'
154
154
  import { DlTooltip } from '../../../../shared'
155
155
  import SuggestionsDropdown from './SuggestionsDropdown.vue'
156
156
  import {
157
- isEndingWithDateIntervalPattern,
157
+ isEndingWithDatePattern,
158
158
  replaceDateInterval,
159
159
  removeDateInterval,
160
160
  updateEditor,
@@ -380,7 +380,7 @@ export default defineComponent({
380
380
  }
381
381
 
382
382
  if (focused.value) {
383
- if (value.length && isEndingWithDateIntervalPattern(value)) {
383
+ if (value.length && isEndingWithDatePattern(value)) {
384
384
  showDatePicker.value = true
385
385
  showSuggestions.value = false
386
386
  } else {
@@ -33,7 +33,7 @@ export const isEndOfString = (
33
33
  return trimmed.lastIndexOf(lastMatch) + lastMatch.length === trimmed.length
34
34
  }
35
35
 
36
- export const isEndingWithDateIntervalPattern = (str: string) => {
36
+ export const isEndingWithDatePattern = (str: string) => {
37
37
  return isEndOfString(str, datePattern, { checkWhiteSpace: true })
38
38
  }
39
39
 
@@ -151,7 +151,7 @@ export function replaceJSDatesWithStringifiedDates(
151
151
  if (typeof value === 'object') {
152
152
  const testKey = Object.keys(toReturn[key])[0]
153
153
  if (
154
- ['$gt', '$gte', '$lt', '$lte', '$eq', '$ne'].includes(
154
+ ['$gt', '$gte', '$lt', '$lte'].includes(
155
155
  testKey
156
156
  )
157
157
  ) {
@@ -178,7 +178,13 @@ export default defineComponent({
178
178
  }
179
179
 
180
180
  try {
181
- let publicPath = process.env.BASE_URL ?? ''
181
+ let publicPath = ''
182
+ try {
183
+ publicPath = process.env.BASE_URL ?? ''
184
+ } catch (err) {
185
+ // skip in case 'process' is not defined
186
+ }
187
+
182
188
  if (publicPath.endsWith('/')) {
183
189
  publicPath = publicPath.slice(0, -1)
184
190
  }
@@ -32,7 +32,7 @@ export enum Logical {
32
32
 
33
33
  export const operators: Operators = {
34
34
  $eq: '=', // all types
35
- $neq: '!=', // all types
35
+ $ne: '!=', // all types
36
36
  $gt: '>', // number, date, datetime, time
37
37
  $gte: '>=', // number, date, datetime, time
38
38
  $lt: '<', // number, date, datetime, time
@@ -49,7 +49,7 @@ type OperatorToDataTypeMap = {
49
49
 
50
50
  const operatorToDataTypeMap: OperatorToDataTypeMap = {
51
51
  $eq: [],
52
- $neq: [],
52
+ $ne: [],
53
53
  $gt: ['number', 'date', 'datetime', 'time'],
54
54
  $gte: ['number', 'date', 'datetime', 'time'],
55
55
  $lt: ['number', 'date', 'datetime', 'time'],
@@ -632,7 +632,7 @@ export const enquoteString = (str: string) => {
632
632
  }
633
633
 
634
634
  const getOperatorByDataType = (dataType: string) => {
635
- if (dataType === 'boolean') return ['$eq', '$neq']
635
+ if (dataType === 'boolean') return ['$eq', '$ne']
636
636
 
637
637
  if (dataType === 'object') {
638
638
  return []
@@ -644,7 +644,7 @@ const getOperatorByDataType = (dataType: string) => {
644
644
  })
645
645
 
646
646
  if (dataType === 'date' || dataType === 'datetime') {
647
- const toExclude = ['$in', '$nin']
647
+ const toExclude = ['$eq', '$ne', '$in', '$nin']
648
648
  operators = operators.filter((s) => !toExclude.includes(s))
649
649
  }
650
650