@evoke-platform/ui-components 1.0.0-dev.245 → 1.0.0-dev.246

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.
@@ -1,8 +1,7 @@
1
1
  import { ElementType } from 'react';
2
- import { ObjectProperty, TreeViewObject } from './types';
3
2
  import 'react-querybuilder/dist/query-builder.css';
4
3
  import { EvokeObject } from '../../../types';
5
- import { Operator, PresetValue } from './types';
4
+ import { ObjectProperty, Operator, PresetValue, TreeViewObject } from './types';
6
5
  import { ValueEditorProps } from './ValueEditor';
7
6
  export type CriteriaInputProps = {
8
7
  properties: ObjectProperty[];
@@ -1,7 +1,7 @@
1
1
  import { AddRounded, UnfoldMore } from '@mui/icons-material';
2
2
  import { Typography } from '@mui/material';
3
3
  import { QueryBuilderMaterial } from '@react-querybuilder/material';
4
- import { isEmpty, startCase } from 'lodash';
4
+ import { isArray, isEmpty, startCase } from 'lodash';
5
5
  import React, { useEffect, useMemo, useState } from 'react';
6
6
  import { QueryBuilder, RuleGroupBodyComponents, RuleGroupHeaderComponents, TestID, formatQuery, parseMongoDB, useRuleGroup, } from 'react-querybuilder';
7
7
  import 'react-querybuilder/dist/query-builder.css';
@@ -166,6 +166,13 @@ const customSelector = (props) => {
166
166
  : option.label,
167
167
  }));
168
168
  }
169
+ else if (inputType === 'integer' || inputType === 'number') {
170
+ opts = options.filter((option) => ['=', '!=', '<', '<=', '>', '>=', 'null', 'notNull'].includes(option.name));
171
+ // checks if it is a single-select property
172
+ }
173
+ else if (inputType === 'string' && isArray(props.fieldData?.values)) {
174
+ opts = options.filter((option) => ['in', 'notIn', '=', '!=', 'notNull', 'null'].includes(option.name));
175
+ }
169
176
  break;
170
177
  case 'Fields':
171
178
  placeholder = 'Select Property';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/ui-components",
3
- "version": "1.0.0-dev.245",
3
+ "version": "1.0.0-dev.246",
4
4
  "description": "",
5
5
  "main": "dist/published/index.js",
6
6
  "module": "dist/published/index.js",