@evoke-platform/ui-components 1.0.0-dev.109 → 1.0.0-dev.110
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 +16 -2
- package/dist/published/components/custom/FormField/InputFieldComponent/InputFieldComponent.d.ts +2 -1
- package/dist/published/components/custom/FormField/InputFieldComponent/InputFieldComponent.js +1 -1
- package/package.json +1 -1
@@ -5,6 +5,7 @@ import 'react-querybuilder/dist/query-builder.css';
|
|
5
5
|
import { RemoveCircleOutline } from '../../../icons';
|
6
6
|
import { Autocomplete, Button, DatePicker, IconButton, LocalizationProvider, MenuItem, TextField, Typography, } from '../../core';
|
7
7
|
import { Box } from '../../layout';
|
8
|
+
import { NumericFormat } from '../FormField/InputFieldComponent';
|
8
9
|
const ALL_OPERATORS = [
|
9
10
|
{ name: '=', label: '=' },
|
10
11
|
{ name: '!=', label: '!=' },
|
@@ -132,7 +133,9 @@ const dynamicContentInputEditor = (props) => {
|
|
132
133
|
const DynamicContentInput = (_a = props.context) === null || _a === void 0 ? void 0 : _a.dynamicContentInput.component;
|
133
134
|
let valueEditor;
|
134
135
|
if (DynamicContentInput) {
|
135
|
-
valueEditor = (React.createElement(DynamicContentInput, { values: ['null', 'notNull'].includes(operator) ? '' : value, setValues:
|
136
|
+
valueEditor = (React.createElement(DynamicContentInput, { values: ['null', 'notNull'].includes(operator) ? '' : value, setValues: (e) => {
|
137
|
+
handleOnChange(e !== null && e !== void 0 ? e : '');
|
138
|
+
}, disabled: ['null', 'notNull'].includes(operator), size: 'small', previousSteps: (_c = (_b = props.context) === null || _b === void 0 ? void 0 : _b.dynamicContentInput.previousSteps) !== null && _c !== void 0 ? _c : [], isSingleValue: true, width: '33%', useStringInterpolation: true }));
|
136
139
|
}
|
137
140
|
return determineValueEditor(valueEditor, props);
|
138
141
|
};
|
@@ -147,6 +150,17 @@ const determineValueEditor = (baseValueEditor, props) => {
|
|
147
150
|
handleOnChange(value);
|
148
151
|
}, renderInput: (params) => (React.createElement(TextField, Object.assign({}, params, { placeholder: "Value", size: "small", style: { width: '33%' } }))) })));
|
149
152
|
break;
|
153
|
+
case 'integer':
|
154
|
+
valueEditor = (React.createElement(TextField, { value: ['null', 'notNull'].includes(operator) ? '' : value, disabled: ['null', 'notNull'].includes(operator), onChange: (e) => {
|
155
|
+
handleOnChange(isNaN(parseInt(e.target.value)) ? '' : parseInt(e.target.value));
|
156
|
+
}, type: "number", placeholder: "Value", size: "small", sx: { width: '33%' } }));
|
157
|
+
break;
|
158
|
+
case 'number':
|
159
|
+
valueEditor = (React.createElement(TextField, { value: ['null', 'notNull'].includes(operator) ? '' : value, disabled: ['null', 'notNull'].includes(operator), onChange: (e) => {
|
160
|
+
var _a;
|
161
|
+
handleOnChange((_a = e.target.value) !== null && _a !== void 0 ? _a : '');
|
162
|
+
}, InputProps: { inputComponent: NumericFormat }, placeholder: "Value", size: "small", sx: { width: '33%' } }));
|
163
|
+
break;
|
150
164
|
case 'array':
|
151
165
|
valueEditor = (React.createElement(Autocomplete, { multiple: true, options: values || [], getOptionLabel: (option) => (option.label ? option.label : ''), value: Array.isArray(value) ? (disabled ? [] : value) : [], disabled: disabled, onChange: (event, newValue) => {
|
152
166
|
const uniqueSelections = Array.from(new Set(newValue.map((item) => item.label))).map((label) => {
|
@@ -245,7 +259,7 @@ const CriteriaBuilder = (props) => {
|
|
245
259
|
React.createElement(QueryBuilderMaterial, null,
|
246
260
|
React.createElement(QueryBuilder, { query: !criteria ? { combinator: 'and', rules: [] } : query, fields: fields, onQueryChange: (q) => {
|
247
261
|
handleQueryChange(q);
|
248
|
-
}, showCombinatorsBetweenRules: true, listsAsArrays: true, controlElements: {
|
262
|
+
}, showCombinatorsBetweenRules: true, listsAsArrays: true, addRuleToNewGroups: true, controlElements: {
|
249
263
|
combinatorSelector: customCombinator,
|
250
264
|
fieldSelector: customSelector,
|
251
265
|
operatorSelector: customSelector,
|
package/dist/published/components/custom/FormField/InputFieldComponent/InputFieldComponent.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
import { FunctionComponent } from 'react';
|
2
2
|
import { FormFieldProps } from '../FormField';
|
3
|
+
export declare const NumericFormat: FunctionComponent<any>;
|
3
4
|
declare const InputFieldComponent: (props: FormFieldProps) => JSX.Element;
|
4
5
|
export default InputFieldComponent;
|
package/dist/published/components/custom/FormField/InputFieldComponent/InputFieldComponent.js
CHANGED
@@ -14,7 +14,7 @@ import NumberFormat from 'react-number-format';
|
|
14
14
|
import { Autocomplete, TextField } from '../../../core';
|
15
15
|
import InputMask from 'react-input-mask';
|
16
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
17
|
-
const NumericFormat = (props) => {
|
17
|
+
export const NumericFormat = (props) => {
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
19
19
|
const { inputRef, onChange, defaultValue } = props, other = __rest(props, ["inputRef", "onChange", "defaultValue"]);
|
20
20
|
return (React.createElement(NumberFormat, Object.assign({}, other, { getInputRef: inputRef, onValueChange: (values) => {
|