@evoke-platform/ui-components 1.0.0-dev.219 → 1.0.0-dev.220
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,7 +1,8 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
import { ApiServices, Obj, ObjectInstance, UserAccount } from '@evoke-platform/context';
|
2
|
-
import {
|
3
|
-
import { Document, ObjectPropertyInputProps } from '../types';
|
3
|
+
import { ReactComponent } from '@formio/react';
|
4
4
|
import '../../../../styles/form-component.css';
|
5
|
+
import { Document, ObjectPropertyInputProps } from '../types';
|
5
6
|
declare type OnSaveResponse = {
|
6
7
|
isSuccessful: boolean;
|
7
8
|
error?: Record<string, unknown>;
|
@@ -32,7 +33,7 @@ export declare type FormProps = {
|
|
32
33
|
};
|
33
34
|
queryAddresses?: unknown;
|
34
35
|
fieldHeight?: 'small' | 'medium';
|
35
|
-
richTextEditor?:
|
36
|
+
richTextEditor?: typeof ReactComponent;
|
36
37
|
};
|
37
38
|
export declare function Form(props: FormProps): JSX.Element;
|
38
39
|
export default Form;
|
@@ -12,11 +12,11 @@ import { Components, Form as FormIO } from '@formio/react';
|
|
12
12
|
import { flatten } from 'flat';
|
13
13
|
import { isEqual, toPairs } from 'lodash';
|
14
14
|
import React, { useEffect, useRef, useState } from 'react';
|
15
|
+
import '../../../../styles/form-component.css';
|
15
16
|
import { Skeleton, Snackbar } from '../../../core';
|
16
17
|
import { Box } from '../../../layout';
|
17
18
|
import { ButtonComponent, DocumentComponent, FormFieldComponent, ImageComponent, ObjectComponent, RepeatableFieldComponent, UserComponent, ViewOnlyComponent, } from '../FormComponents';
|
18
19
|
import { addObjectPropertiesToComponentProps, buildComponentPropsFromDocumentProperties, buildComponentPropsFromObjectProperties, convertFormToComponents, getFlattenEntries, getPrefixedUrl, } from '../utils';
|
19
|
-
import '../../../../styles/form-component.css';
|
20
20
|
const usePrevious = (value) => {
|
21
21
|
const ref = useRef();
|
22
22
|
useEffect(() => {
|
@@ -320,10 +320,10 @@ export class FormFieldComponent extends ReactComponent {
|
|
320
320
|
delete this.errorDetails['time'];
|
321
321
|
}
|
322
322
|
}
|
323
|
-
if (validate.min || validate.max) {
|
323
|
+
if (!isNil(validate.min) || !isNil(validate.max)) {
|
324
324
|
if (!isNil(value) &&
|
325
325
|
value !== '' &&
|
326
|
-
((validate.min && value < validate.min) || (validate.max && value > validate.max))) {
|
326
|
+
((!isNil(validate.min) && value < validate.min) || (!isNil(validate.max) && value > validate.max))) {
|
327
327
|
this.errorDetails['min-max'] = validate.customMessage;
|
328
328
|
}
|
329
329
|
else {
|