@evoke-platform/ui-components 1.0.0-dev.238 → 1.0.0-dev.240
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/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.js +43 -18
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectComponent.js +2 -2
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectPropertyInput.js +1 -0
- package/package.json +1 -1
@@ -9,22 +9,22 @@ import { Box } from '../../layout';
|
|
9
9
|
import { difference } from '../util';
|
10
10
|
import ValueEditor from './ValueEditor';
|
11
11
|
const ALL_OPERATORS = [
|
12
|
-
{ name: '=', label: '
|
13
|
-
{ name: '!=', label: '
|
14
|
-
{ name: '<', label: '
|
15
|
-
{ name: '>', label: '
|
16
|
-
{ name: '<=', label: '
|
17
|
-
{ name: '>=', label: '
|
18
|
-
{ name: 'contains', label: '
|
19
|
-
{ name: 'beginsWith', label: '
|
20
|
-
{ name: 'endsWith', label: '
|
21
|
-
{ name: 'doesNotContain', label: '
|
22
|
-
{ name: 'doesNotBeginWith', label: '
|
23
|
-
{ name: 'doesNotEndWith', label: '
|
24
|
-
{ name: 'null', label: '
|
25
|
-
{ name: 'notNull', label: '
|
26
|
-
{ name: 'in', label: '
|
27
|
-
{ name: 'notIn', label: '
|
12
|
+
{ name: '=', label: 'Is' },
|
13
|
+
{ name: '!=', label: 'Is not' },
|
14
|
+
{ name: '<', label: 'Less than' },
|
15
|
+
{ name: '>', label: 'Greater than' },
|
16
|
+
{ name: '<=', label: 'Less than or equal to' },
|
17
|
+
{ name: '>=', label: 'Greater than or equal to' },
|
18
|
+
{ name: 'contains', label: 'Contains' },
|
19
|
+
{ name: 'beginsWith', label: 'Starts with' },
|
20
|
+
{ name: 'endsWith', label: 'Ends with' },
|
21
|
+
{ name: 'doesNotContain', label: 'Does not contain' },
|
22
|
+
{ name: 'doesNotBeginWith', label: 'Does not start with' },
|
23
|
+
{ name: 'doesNotEndWith', label: 'Does not end with' },
|
24
|
+
{ name: 'null', label: 'Is empty' },
|
25
|
+
{ name: 'notNull', label: 'Is not empty' },
|
26
|
+
{ name: 'in', label: 'In' },
|
27
|
+
{ name: 'notIn', label: 'Not in' },
|
28
28
|
];
|
29
29
|
const CustomRuleGroup = (props) => {
|
30
30
|
const rg = { ...props, ...useRuleGroup(props) };
|
@@ -86,6 +86,7 @@ const customSelector = (props) => {
|
|
86
86
|
let width = '90px';
|
87
87
|
let val = value;
|
88
88
|
let opts = options;
|
89
|
+
const inputType = props.fieldData?.inputType;
|
89
90
|
let readOnly = false;
|
90
91
|
if (context.disabledCriteria) {
|
91
92
|
readOnly =
|
@@ -98,18 +99,42 @@ const customSelector = (props) => {
|
|
98
99
|
switch (title) {
|
99
100
|
case 'Operators':
|
100
101
|
width = '20%';
|
101
|
-
if (
|
102
|
+
if (inputType === 'array') {
|
102
103
|
opts = options
|
103
104
|
.filter((option) => ['null', 'notNull', 'in', 'notIn'].includes(option.name))
|
104
105
|
.map((option) => ({ name: option.name, label: option.label }));
|
105
106
|
val = val === '=' ? '' : options.find((option) => option.name === val).name;
|
106
107
|
}
|
107
|
-
else if (
|
108
|
+
else if (inputType === 'document') {
|
108
109
|
opts = options
|
109
110
|
.filter((option) => ['null', 'notNull'].includes(option.name))
|
110
111
|
.map((option) => ({ name: option.name, label: option.label }));
|
111
112
|
val = val === '=' ? '' : options.find((option) => option.name === val).name;
|
112
113
|
}
|
114
|
+
else if (inputType === 'date' || inputType === 'date-time' || inputType === 'time') {
|
115
|
+
opts = options
|
116
|
+
.filter((option) => ['=', '!=', '<', '>', '<=', '>=', 'null', 'notNull'].includes(option.name))
|
117
|
+
.map((option) => ({
|
118
|
+
...option,
|
119
|
+
label: option.name === '>'
|
120
|
+
? inputType === 'time'
|
121
|
+
? 'Later than'
|
122
|
+
: 'After'
|
123
|
+
: option.name === '>='
|
124
|
+
? inputType === 'time'
|
125
|
+
? 'Later than or at'
|
126
|
+
: 'After or on'
|
127
|
+
: option.name === '<'
|
128
|
+
? inputType === 'time'
|
129
|
+
? 'Earlier than'
|
130
|
+
: 'Before'
|
131
|
+
: option.name === '<='
|
132
|
+
? inputType === 'time'
|
133
|
+
? 'Earlier than or at'
|
134
|
+
: 'Before or on'
|
135
|
+
: option.label,
|
136
|
+
}));
|
137
|
+
}
|
113
138
|
break;
|
114
139
|
case 'Fields':
|
115
140
|
width = '33%';
|
package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectComponent.js
CHANGED
@@ -4,7 +4,7 @@ import { cloneDeep, isEmpty, pick } from 'lodash';
|
|
4
4
|
import React from 'react';
|
5
5
|
import ReactDOM from 'react-dom';
|
6
6
|
import { FormComponentWrapper } from '../../Common';
|
7
|
-
import { getAllCriteriaInputs, getPrefixedUrl,
|
7
|
+
import { getAllCriteriaInputs, getPrefixedUrl, transformToWhere, updateCriteriaInputs } from '../../utils';
|
8
8
|
import { ObjectPropertyInput } from './ObjectPropertyInput';
|
9
9
|
export class ObjectComponent extends ReactComponent {
|
10
10
|
constructor(component, options, data) {
|
@@ -130,7 +130,7 @@ export class ObjectComponent extends ReactComponent {
|
|
130
130
|
this.root.customErrors = this.root.customErrors.filter((error) => error.formattedKeyOrPath !== this.component.key);
|
131
131
|
}
|
132
132
|
handleValidation() {
|
133
|
-
if (!
|
133
|
+
if (!this.visible) {
|
134
134
|
return;
|
135
135
|
}
|
136
136
|
//check for out-of-the-box formio errors which store on this.root.errors
|
package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectPropertyInput.js
CHANGED
@@ -228,6 +228,7 @@ export const ObjectPropertyInput = (props) => {
|
|
228
228
|
setDropdownInput(undefined); // refresh search options
|
229
229
|
setSelectedInstance(undefined);
|
230
230
|
handleChangeObjectProperty(property.id, null);
|
231
|
+
instance[property.id] = null;
|
231
232
|
}
|
232
233
|
else {
|
233
234
|
const selectedInstance = options.find((o) => o.id === value?.value);
|