@vulcanjs/react-ui 0.7.2-alpha.5 → 0.7.2-alpha.8
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/components/Datatable/Datatable.d.ts +39 -0
- package/dist/components/Datatable/DatatableCell.d.ts +26 -0
- package/dist/components/Datatable/DatatableContents.d.ts +53 -0
- package/dist/components/Datatable/DatatableFilter.d.ts +33 -0
- package/dist/components/Datatable/DatatableHeader.d.ts +23 -0
- package/dist/components/Datatable/DatatableRow.d.ts +25 -0
- package/dist/components/Datatable/DatatableSelect.d.ts +11 -0
- package/dist/components/Datatable/DatatableSorter.d.ts +8 -0
- package/dist/components/Datatable/DatatableSubmitSelected.d.ts +6 -0
- package/dist/components/Datatable/others/DeleteButton.d.ts +13 -0
- package/dist/components/Datatable/others/EditButton.d.ts +20 -0
- package/dist/components/Datatable/others/NewButton.d.ts +20 -0
- package/dist/components/HeadTags.d.ts +13 -0
- package/dist/components/LoadingButton.d.ts +11 -0
- package/dist/components/MutationButton.d.ts +20 -0
- package/dist/components/VulcanComponents/defaultVulcanComponents/cellComponents.d.ts +3 -0
- package/dist/components/VulcanComponents/defaultVulcanComponents/coreComponents.d.ts +3 -0
- package/dist/components/VulcanComponents/defaultVulcanComponents/datatableComponents.d.ts +3 -0
- package/dist/components/VulcanComponents/defaultVulcanComponents/formComponents.d.ts +3 -0
- package/dist/components/bootstrap/Dropdown.d.ts +24 -0
- package/dist/components/bootstrap/Modal.d.ts +25 -0
- package/dist/components/bootstrap/ModalTrigger.d.ts +18 -0
- package/dist/components/bootstrap/TooltipTrigger.d.ts +6 -0
- package/dist/components/cell/CardItem.d.ts +14 -0
- package/dist/components/cell/CardItemArray.d.ts +6 -0
- package/dist/components/cell/CardItemDate.d.ts +5 -0
- package/dist/components/cell/CardItemDefault.d.ts +5 -0
- package/dist/components/cell/CardItemHTML.d.ts +5 -0
- package/dist/components/cell/CardItemImage.d.ts +6 -0
- package/dist/components/cell/CardItemNumber.d.ts +5 -0
- package/dist/components/cell/CardItemObject.d.ts +3 -0
- package/dist/components/cell/CardItemRelationHasMany.d.ts +3 -0
- package/dist/components/cell/CardItemRelationHasOne.d.ts +3 -0
- package/dist/components/cell/CardItemRelationItem.d.ts +15 -0
- package/dist/components/cell/CardItemString.d.ts +5 -0
- package/dist/components/cell/CardItemURL.d.ts +6 -0
- package/dist/components/core/Button.d.ts +4 -0
- package/dist/components/core/Loading.d.ts +3 -0
- package/dist/components/form/FieldErrors.d.ts +6 -0
- package/dist/components/form/Form/Form.d.ts +4 -0
- package/dist/components/form/Form/fields.d.ts +22 -0
- package/dist/components/form/Form/index.d.ts +3 -0
- package/dist/components/form/Form/typings.d.ts +76 -0
- package/dist/components/form/Form/utils.d.ts +2 -0
- package/dist/components/form/FormComponent.d.ts +31 -0
- package/dist/components/form/FormComponentInner.d.ts +32 -0
- package/dist/components/form/FormComponentLoader.d.ts +15 -0
- package/dist/components/form/FormContainer.d.ts +18 -0
- package/dist/components/form/FormContext.d.ts +25 -0
- package/dist/components/form/FormElement.d.ts +4 -0
- package/dist/components/form/FormError.d.ts +11 -0
- package/dist/components/form/FormErrors.d.ts +3 -0
- package/dist/components/form/FormGroup.d.ts +30 -0
- package/dist/components/form/FormIntl.d.ts +15 -0
- package/dist/components/form/FormLayout.d.ts +10 -0
- package/dist/components/form/FormNestedArray.d.ts +26 -0
- package/dist/components/form/FormNestedArrayLayout.d.ts +18 -0
- package/dist/components/form/FormNestedDivider.d.ts +13 -0
- package/dist/components/form/FormNestedItem.d.ts +52 -0
- package/dist/components/form/FormNestedObject.d.ts +35 -0
- package/dist/components/form/FormOptionLabel.d.ts +5 -0
- package/dist/components/form/FormSubmit.d.ts +38 -0
- package/dist/components/form/core/Button.d.ts +4 -0
- package/dist/components/form/core/Form/Form.d.ts.map +1 -1
- package/dist/components/form/core/FormComponent.d.ts +31 -0
- package/dist/components/form/core/FormComponentInner.d.ts +32 -0
- package/dist/components/form/core/FormComponentLoader.d.ts +15 -0
- package/dist/components/form/core/FormContext.d.ts +1 -1
- package/dist/components/form/core/FormContext.d.ts.map +1 -1
- package/dist/components/form/core/FormGroup.d.ts +30 -0
- package/dist/components/form/core/Loading.d.ts +3 -0
- package/dist/components/form/elements/FieldErrors.d.ts +5 -0
- package/dist/components/form/elements/FormElement.d.ts +4 -0
- package/dist/components/form/elements/FormError.d.ts +11 -0
- package/dist/components/form/elements/FormErrors.d.ts +3 -0
- package/dist/components/form/elements/FormLayout.d.ts +10 -0
- package/dist/components/form/elements/FormSubmit.d.ts +38 -0
- package/dist/components/form/elements/index.d.ts +7 -0
- package/dist/components/form/inputs/AutocompleteMultiple.d.ts +6 -0
- package/dist/components/form/inputs/BasicInputs.d.ts +16 -0
- package/dist/components/form/inputs/Checkboxgroup.d.ts +9 -0
- package/dist/components/form/inputs/FormItem.d.ts +4 -0
- package/dist/components/form/inputs/FormOptionLabel.d.ts +7 -0
- package/dist/components/form/inputs/RadioGroup.d.ts +4 -0
- package/dist/components/form/inputs/SelectInputs.d.ts +5 -0
- package/dist/components/form/inputs/consts.d.ts +9 -0
- package/dist/components/form/inputs/index.d.ts +8 -0
- package/dist/components/form/intl/FormIntl.d.ts +15 -0
- package/dist/components/form/modules/formFragments.d.ts +16 -0
- package/dist/components/form/modules/path_utils.d.ts +6 -0
- package/dist/components/form/modules/schema_utils.d.ts +14 -0
- package/dist/components/form/modules/utils.d.ts +17 -0
- package/dist/components/form/nested/FormNestedArray.d.ts +26 -0
- package/dist/components/form/nested/FormNestedArrayLayout.d.ts +18 -0
- package/dist/components/form/nested/FormNestedDivider.d.ts +13 -0
- package/dist/components/form/nested/FormNestedItem.d.ts +52 -0
- package/dist/components/form/nested/FormNestedObject.d.ts +35 -0
- package/dist/components/form/nested/index.d.ts +6 -0
- package/dist/components/form/ui_utils.d.ts +3 -0
- package/dist/components/form/useBlockTransition/block.d.ts +4 -0
- package/dist/components/form/useBlockTransition/useBlockTransition.d.ts +5 -0
- package/dist/components/form/useWarnOnUnsaved/index.d.ts +2 -0
- package/dist/components/form/useWarnOnUnsaved/useWarnOnUnsaved.d.ts +5 -0
- package/dist/decorators/autocomplete.d.ts +8 -0
- package/dist/decorators/index.d.ts +4 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +67 -50
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface FormLayoutProps {
|
|
3
|
+
commonProps: any;
|
|
4
|
+
formProps: any;
|
|
5
|
+
submitProps: any;
|
|
6
|
+
repeatErrors?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const FormLayout: React.FC<FormLayoutProps>;
|
|
9
|
+
export declare const formComponentsDependencies: string[];
|
|
10
|
+
//# sourceMappingURL=FormLayout.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
export interface FormSubmitProps {
|
|
4
|
+
submitLabel: any;
|
|
5
|
+
cancelLabel: any;
|
|
6
|
+
cancelCallback: any;
|
|
7
|
+
revertLabel: any;
|
|
8
|
+
revertCallback: any;
|
|
9
|
+
document: any;
|
|
10
|
+
deleteDocument: any;
|
|
11
|
+
model: any;
|
|
12
|
+
currentUser: any;
|
|
13
|
+
}
|
|
14
|
+
export declare const FormSubmit: {
|
|
15
|
+
({ submitLabel, cancelLabel, cancelCallback, revertLabel, revertCallback, document, deleteDocument, model, currentUser, }: {
|
|
16
|
+
submitLabel: any;
|
|
17
|
+
cancelLabel: any;
|
|
18
|
+
cancelCallback: any;
|
|
19
|
+
revertLabel: any;
|
|
20
|
+
revertCallback: any;
|
|
21
|
+
document: any;
|
|
22
|
+
deleteDocument: any;
|
|
23
|
+
model: any;
|
|
24
|
+
currentUser: any;
|
|
25
|
+
}): JSX.Element;
|
|
26
|
+
propTypes: {
|
|
27
|
+
submitLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
28
|
+
cancelLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
29
|
+
cancelCallback: PropTypes.Requireable<(...args: any[]) => any>;
|
|
30
|
+
revertLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
31
|
+
revertCallback: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
|
+
document: PropTypes.Requireable<object>;
|
|
33
|
+
deleteDocument: PropTypes.Requireable<(...args: any[]) => any>;
|
|
34
|
+
collectionName: PropTypes.Requireable<string>;
|
|
35
|
+
classes: PropTypes.Requireable<object>;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=FormSubmit.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FormInputProps } from "../core/FormComponentInner";
|
|
3
|
+
export interface AutocompleteMultipleProps extends FormInputProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const AutocompleteMultiple: (props: AutocompleteMultipleProps) => JSX.Element;
|
|
6
|
+
//# sourceMappingURL=AutocompleteMultiple.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormInputProps, FormTextAreaProps } from "../core/FormComponentInner";
|
|
3
|
+
export declare const FormComponentDefault: (props: FormInputProps) => JSX.Element;
|
|
4
|
+
export declare const FormComponentPassword: (props: FormInputProps) => JSX.Element;
|
|
5
|
+
export declare const FormComponentNumber: (props: FormInputProps) => JSX.Element;
|
|
6
|
+
export declare const FormComponentUrl: (props: FormInputProps) => JSX.Element;
|
|
7
|
+
export declare const FormComponentEmail: (props: FormInputProps) => JSX.Element;
|
|
8
|
+
export declare const FormComponentCheckbox: (props: FormInputProps) => JSX.Element;
|
|
9
|
+
export declare const FormComponentDate: (props: any) => JSX.Element;
|
|
10
|
+
export declare const FormComponentDateTime: (props: any) => JSX.Element;
|
|
11
|
+
export declare const FormComponentTime: (props: any) => JSX.Element;
|
|
12
|
+
export declare const FormComponentStaticText: (props: FormInputProps) => JSX.Element;
|
|
13
|
+
export declare const FormComponentLikert: (props: any) => string;
|
|
14
|
+
export declare const FormComponentAutocomplete: (props: any) => string;
|
|
15
|
+
export declare const FormComponentTextarea: (props: FormTextAreaProps) => JSX.Element;
|
|
16
|
+
//# sourceMappingURL=BasicInputs.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormInputProps } from "../core/FormComponentInner";
|
|
3
|
+
export declare const otherMarker = "[other]";
|
|
4
|
+
export declare const isOtherValue: (s: any) => any;
|
|
5
|
+
export declare const removeOtherMarker: (s: any) => any;
|
|
6
|
+
export declare const addOtherMarker: (s: any) => string;
|
|
7
|
+
export declare const removeOtherValue: (a: any) => any;
|
|
8
|
+
export declare const FormComponentCheckboxGroup: (props: FormInputProps) => JSX.Element;
|
|
9
|
+
//# sourceMappingURL=Checkboxgroup.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormInputProps } from "../core/FormComponentInner";
|
|
3
|
+
export declare const FormItem: (props: FormInputProps["itemProperties"] & Pick<FormInputProps["inputProperties"], "label" | "name">) => JSX.Element;
|
|
4
|
+
//# sourceMappingURL=FormItem.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FormOption } from "../core/FormComponent";
|
|
3
|
+
export interface FormOptionLabelProps extends React.HTMLProps<HTMLLabelElement> {
|
|
4
|
+
option: FormOption;
|
|
5
|
+
}
|
|
6
|
+
export declare const FormOptionLabel: ({ option, name }: FormOptionLabelProps) => JSX.Element;
|
|
7
|
+
//# sourceMappingURL=FormOptionLabel.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FormInputProps } from "../core/FormComponentInner";
|
|
3
|
+
export declare const FormComponentSelect: (props: FormInputProps<HTMLSelectElement>) => JSX.Element;
|
|
4
|
+
export declare const FormComponentSelectMultiple: (props: any) => JSX.Element;
|
|
5
|
+
//# sourceMappingURL=SelectInputs.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VulcanFieldType, VulcanCoreInput } from "@vulcanjs/schema";
|
|
2
|
+
export declare const standardInputs: Array<VulcanCoreInput>;
|
|
3
|
+
export declare const clearableInputs: Array<VulcanCoreInput>;
|
|
4
|
+
export declare const advancedInputs: Array<VulcanCoreInput>;
|
|
5
|
+
export declare type DerivedInput = "nested";
|
|
6
|
+
export declare const derivedInputs: Array<DerivedInput>;
|
|
7
|
+
export declare const allVulcanInputs: Array<VulcanCoreInput | DerivedInput>;
|
|
8
|
+
export declare const getAutoInputFromType: (fieldType: VulcanFieldType) => VulcanCoreInput;
|
|
9
|
+
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./BasicInputs";
|
|
2
|
+
export * from "./RadioGroup";
|
|
3
|
+
export * from "./Checkboxgroup";
|
|
4
|
+
export * from "./SelectInputs";
|
|
5
|
+
export * from "./FormItem";
|
|
6
|
+
export * from "./FormOptionLabel";
|
|
7
|
+
export * from "./AutocompleteMultiple";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const FormIntlLayout: ({ children }: {
|
|
3
|
+
children: any;
|
|
4
|
+
}) => JSX.Element;
|
|
5
|
+
export declare const FormIntlItemLayout: ({ locale, children }: {
|
|
6
|
+
locale: any;
|
|
7
|
+
children: any;
|
|
8
|
+
}) => JSX.Element;
|
|
9
|
+
interface FormIntlProps {
|
|
10
|
+
path: string;
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const FormIntl: (props: FormIntlProps) => JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=FormIntl.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VulcanGraphqlModel } from "@vulcanjs/graphql";
|
|
2
|
+
import type { FormType } from "../typings";
|
|
3
|
+
declare const getFormFragments: ({ formType, model, fields, addFields, }: {
|
|
4
|
+
model: VulcanGraphqlModel;
|
|
5
|
+
formType: FormType;
|
|
6
|
+
fields?: string[] | undefined;
|
|
7
|
+
addFields?: string[] | undefined;
|
|
8
|
+
}) => {
|
|
9
|
+
queryFragment: import("graphql").DocumentNode;
|
|
10
|
+
mutationFragment: import("graphql").DocumentNode;
|
|
11
|
+
queryFragmentName: string;
|
|
12
|
+
mutationFragmentName: string;
|
|
13
|
+
extraQueries: (string | (() => string))[];
|
|
14
|
+
};
|
|
15
|
+
export default getFormFragments;
|
|
16
|
+
//# sourceMappingURL=formFragments.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const splitPath: (string: string) => string[];
|
|
2
|
+
export declare const joinPath: (array: Array<string | number>) => string;
|
|
3
|
+
export declare const getParentPath: (string: string) => string;
|
|
4
|
+
export declare const removePrefix: (prefix: string, paths: Array<string>) => Array<string>;
|
|
5
|
+
export declare const filterPathsByPrefix: (prefix: string, paths: Array<string>) => string[];
|
|
6
|
+
//# sourceMappingURL=path_utils.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VulcanFieldSchema, VulcanSchema } from "@vulcanjs/schema";
|
|
2
|
+
export declare const getValidFields: (schema: any) => string[];
|
|
3
|
+
export declare const getInsertableFields: (schema: any, user: any) => string[];
|
|
4
|
+
export declare const getEditableFields: (schema: any, user: any, document: any) => string[];
|
|
5
|
+
export declare const convertSchema: (schema: VulcanSchema, options?: {
|
|
6
|
+
flatten?: boolean;
|
|
7
|
+
removeArrays?: boolean;
|
|
8
|
+
}) => {};
|
|
9
|
+
export declare const getFieldSchema: (fieldName: string, schema: VulcanSchema) => {};
|
|
10
|
+
export declare const getSchemaType: (fieldSchema: VulcanFieldSchema) => import("@vulcanjs/schema").VulcanFieldType;
|
|
11
|
+
export declare const getNestedFieldSchemaOrType: (fieldName: any, schema: any) => Object | Number | Date | null;
|
|
12
|
+
export declare const schemaProperties: string[];
|
|
13
|
+
export declare const formProperties: string[];
|
|
14
|
+
//# sourceMappingURL=schema_utils.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VulcanFieldSchema } from "@vulcanjs/schema";
|
|
2
|
+
export declare const deepValue: (obj: any, path: any) => any;
|
|
3
|
+
export declare const flatten: (data: any) => {};
|
|
4
|
+
export declare const isEmptyValue: (value: any) => boolean;
|
|
5
|
+
export declare const mergeValue: ({ currentValue, documentValue, deletedValues: deletedFields, path, locale, datatype, }: {
|
|
6
|
+
currentValue: any;
|
|
7
|
+
documentValue: any;
|
|
8
|
+
deletedValues: any;
|
|
9
|
+
path: any;
|
|
10
|
+
locale: any;
|
|
11
|
+
datatype: any;
|
|
12
|
+
}) => any;
|
|
13
|
+
export declare const getDeletedValues: (deletedFields: any, accumulator?: {}) => any;
|
|
14
|
+
export declare const getNestedDeletedValues: (prefix: any, deletedFields: any, accumulator?: {}) => any;
|
|
15
|
+
export declare const getFieldType: (fieldSchema: VulcanFieldSchema) => import("@vulcanjs/schema").VulcanFieldType;
|
|
16
|
+
export declare const getNullValue: (datatype: any) => false | "" | never[] | null;
|
|
17
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const FormNestedArrayInnerLayout: (props: any) => JSX.Element;
|
|
3
|
+
export interface FormNestedArrayProps<TValue = any> {
|
|
4
|
+
value: TValue;
|
|
5
|
+
path: string;
|
|
6
|
+
itemProperties: any;
|
|
7
|
+
minCount?: number;
|
|
8
|
+
maxCount?: number;
|
|
9
|
+
arrayField?: boolean;
|
|
10
|
+
nestedArrayErrors: any;
|
|
11
|
+
hasErrors?: boolean;
|
|
12
|
+
prefilledProps?: any;
|
|
13
|
+
addItem: Function | null;
|
|
14
|
+
}
|
|
15
|
+
export declare const FormNestedArray: (props: FormNestedArrayProps) => JSX.Element;
|
|
16
|
+
export declare const formComponentsDependencies: string[];
|
|
17
|
+
export default FormNestedArray;
|
|
18
|
+
export declare const IconAdd: ({ width, height }: {
|
|
19
|
+
width?: number | undefined;
|
|
20
|
+
height?: number | undefined;
|
|
21
|
+
}) => JSX.Element;
|
|
22
|
+
export declare const IconRemove: ({ width, height }: {
|
|
23
|
+
width?: number | undefined;
|
|
24
|
+
height?: number | undefined;
|
|
25
|
+
}) => JSX.Element;
|
|
26
|
+
//# sourceMappingURL=FormNestedArray.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
export declare const FormNestedArrayLayout: {
|
|
4
|
+
(props: any): JSX.Element;
|
|
5
|
+
propTypes: {
|
|
6
|
+
hasErrors: PropTypes.Validator<boolean>;
|
|
7
|
+
nestedArrayErrors: PropTypes.Requireable<any[]>;
|
|
8
|
+
label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
9
|
+
hideLabel: PropTypes.Requireable<boolean>;
|
|
10
|
+
addItem: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
beforeComponent: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
12
|
+
afterComponent: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
13
|
+
formComponents: PropTypes.Requireable<object>;
|
|
14
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default FormNestedArrayLayout;
|
|
18
|
+
//# sourceMappingURL=FormNestedArrayLayout.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
export declare const FormNestedDivider: {
|
|
4
|
+
({ label, addItem }: {
|
|
5
|
+
label: any;
|
|
6
|
+
addItem: any;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
propTypes: {
|
|
9
|
+
label: PropTypes.Requireable<string>;
|
|
10
|
+
addItem: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=FormNestedDivider.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
export declare const FormNestedItemLayout: {
|
|
4
|
+
({ content, removeButton }: {
|
|
5
|
+
content: any;
|
|
6
|
+
removeButton: any;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
propTypes: {
|
|
9
|
+
content: PropTypes.Validator<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
10
|
+
removeButton: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const FormNestedItem: {
|
|
14
|
+
({ nestedFields, name, path, removeItem, itemIndex, formComponents, hideRemove, label, ...props }: {
|
|
15
|
+
[x: string]: any;
|
|
16
|
+
nestedFields: any;
|
|
17
|
+
name: any;
|
|
18
|
+
path: any;
|
|
19
|
+
removeItem: any;
|
|
20
|
+
itemIndex: any;
|
|
21
|
+
formComponents: any;
|
|
22
|
+
hideRemove: any;
|
|
23
|
+
label: any;
|
|
24
|
+
}): JSX.Element;
|
|
25
|
+
propTypes: {
|
|
26
|
+
path: PropTypes.Validator<string>;
|
|
27
|
+
itemIndex: PropTypes.Requireable<number>;
|
|
28
|
+
formComponents: PropTypes.Requireable<object>;
|
|
29
|
+
hideRemove: PropTypes.Requireable<boolean>;
|
|
30
|
+
};
|
|
31
|
+
contextTypes: {
|
|
32
|
+
errors: PropTypes.Requireable<any[]>;
|
|
33
|
+
intl: PropTypes.Requireable<PropTypes.InferProps<{
|
|
34
|
+
formatters: PropTypes.Requireable<object>;
|
|
35
|
+
now: PropTypes.Validator<(...args: any[]) => any>;
|
|
36
|
+
formatDate: PropTypes.Validator<(...args: any[]) => any>;
|
|
37
|
+
formatTime: PropTypes.Validator<(...args: any[]) => any>;
|
|
38
|
+
formatRelative: PropTypes.Validator<(...args: any[]) => any>;
|
|
39
|
+
formatNumber: PropTypes.Validator<(...args: any[]) => any>;
|
|
40
|
+
formatPlural: PropTypes.Validator<(...args: any[]) => any>;
|
|
41
|
+
formatMessage: PropTypes.Validator<(...args: any[]) => any>;
|
|
42
|
+
formatHTMLMessage: PropTypes.Validator<(...args: any[]) => any>;
|
|
43
|
+
locale: PropTypes.Requireable<string>;
|
|
44
|
+
formats: PropTypes.Requireable<object>;
|
|
45
|
+
messages: PropTypes.Requireable<object>;
|
|
46
|
+
textComponent: PropTypes.Requireable<any>;
|
|
47
|
+
defaultLocale: PropTypes.Requireable<string>;
|
|
48
|
+
defaultFormats: PropTypes.Requireable<object>;
|
|
49
|
+
}>>;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=FormNestedItem.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
export declare const FormNestedObjectLayout: {
|
|
4
|
+
({ hasErrors, label, content }: {
|
|
5
|
+
hasErrors: any;
|
|
6
|
+
label: any;
|
|
7
|
+
content: any;
|
|
8
|
+
}): JSX.Element;
|
|
9
|
+
propTypes: {
|
|
10
|
+
hasErrors: PropTypes.Requireable<number | boolean>;
|
|
11
|
+
label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
12
|
+
content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
interface FormNestedObjectProps {
|
|
16
|
+
label?: string;
|
|
17
|
+
value: any;
|
|
18
|
+
input: any;
|
|
19
|
+
inputProperties: any;
|
|
20
|
+
nestedInput: any;
|
|
21
|
+
errors: Array<any>;
|
|
22
|
+
path: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const FormNestedObject: {
|
|
25
|
+
(props: FormNestedObjectProps): JSX.Element;
|
|
26
|
+
propTypes: {
|
|
27
|
+
currentValues: PropTypes.Requireable<object>;
|
|
28
|
+
path: PropTypes.Requireable<string>;
|
|
29
|
+
label: PropTypes.Requireable<string>;
|
|
30
|
+
errors: PropTypes.Validator<any[]>;
|
|
31
|
+
formComponents: PropTypes.Requireable<object>;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export default FormNestedObject;
|
|
35
|
+
//# sourceMappingURL=FormNestedObject.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const BLOCK_TRANSITION_EVENT_TYPE = "blocktransition";
|
|
2
|
+
export declare const UNBLOCK_TRANSITION_EVENT_TYPE = "unblocktransition";
|
|
3
|
+
export declare const block: (setConfirmationMessage: (event?: BeforeUnloadEvent | undefined) => string, onUnblock?: Function | undefined) => () => void;
|
|
4
|
+
//# sourceMappingURL=block.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./components/core";
|
|
2
|
-
export * from "./components/form";
|
|
3
|
-
export * from "./components/VulcanComponents";
|
|
4
|
-
export * from "./components/VulcanCurrentUser";
|
|
5
|
-
export * from "./componentsHelpers";
|
|
1
|
+
export * from "./components/core/index.js";
|
|
2
|
+
export * from "./components/form/index.js";
|
|
3
|
+
export * from "./components/VulcanComponents/index.js";
|
|
4
|
+
export * from "./components/VulcanCurrentUser/index.js";
|
|
5
|
+
export * from "./componentsHelpers.js";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -665,11 +665,14 @@ var LoadingButton = /* @__PURE__ */ __name((_a) => {
|
|
|
665
665
|
className: `loading-button ${loading ? "loading-button-loading" : "loading-button-notloading"} ${className}`,
|
|
666
666
|
onClick
|
|
667
667
|
}, rest), /* @__PURE__ */ React4.createElement("span", {
|
|
668
|
-
style: wrapperStyle
|
|
668
|
+
style: wrapperStyle,
|
|
669
|
+
className: "loading-button-inner"
|
|
669
670
|
}, /* @__PURE__ */ React4.createElement("span", {
|
|
670
|
-
style: labelStyle
|
|
671
|
+
style: labelStyle,
|
|
672
|
+
className: "loading-button-label"
|
|
671
673
|
}, label || children), /* @__PURE__ */ React4.createElement("span", {
|
|
672
|
-
style: loadingStyle
|
|
674
|
+
style: loadingStyle,
|
|
675
|
+
className: "loading-button-loader"
|
|
673
676
|
}, /* @__PURE__ */ React4.createElement(Components2.Loading, null))));
|
|
674
677
|
}, "LoadingButton");
|
|
675
678
|
|
|
@@ -1774,8 +1777,8 @@ var Form = /* @__PURE__ */ __name((props) => {
|
|
|
1774
1777
|
});
|
|
1775
1778
|
}, "clearFormCallbacks");
|
|
1776
1779
|
const [currentValues, setCurrentValues] = useState2({});
|
|
1777
|
-
const submitFormContext = /* @__PURE__ */ __name(
|
|
1778
|
-
submitForm(
|
|
1780
|
+
const submitFormContext = /* @__PURE__ */ __name(async (event) => {
|
|
1781
|
+
await submitForm(event);
|
|
1779
1782
|
}, "submitFormContext");
|
|
1780
1783
|
const [currentDocument, setCurrentDocument] = useState2(initialDocument);
|
|
1781
1784
|
const updateCurrentValues = /* @__PURE__ */ __name((newValues, options = {}) => {
|
|
@@ -1883,16 +1886,7 @@ var Form = /* @__PURE__ */ __name((props) => {
|
|
|
1883
1886
|
form: void 0
|
|
1884
1887
|
});
|
|
1885
1888
|
}, "mutationErrorCallback");
|
|
1886
|
-
const
|
|
1887
|
-
var _a, _b;
|
|
1888
|
-
event && event.preventDefault();
|
|
1889
|
-
event && event.stopPropagation();
|
|
1890
|
-
const { contextName } = props;
|
|
1891
|
-
if (disabled) {
|
|
1892
|
-
return;
|
|
1893
|
-
}
|
|
1894
|
-
setErrors([]);
|
|
1895
|
-
setDisabled(true);
|
|
1889
|
+
const getSubmitData = /* @__PURE__ */ __name(() => {
|
|
1896
1890
|
let data = getData({
|
|
1897
1891
|
replaceIntlFields: true,
|
|
1898
1892
|
addExtraFields: false,
|
|
@@ -1907,42 +1901,64 @@ var Form = /* @__PURE__ */ __name((props) => {
|
|
|
1907
1901
|
if (props.submitCallback) {
|
|
1908
1902
|
data = props.submitCallback(data) || data;
|
|
1909
1903
|
}
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1904
|
+
return data;
|
|
1905
|
+
}, "getSubmitData");
|
|
1906
|
+
const submitFormCreate = /* @__PURE__ */ __name(async (event) => {
|
|
1907
|
+
var _a;
|
|
1908
|
+
event && event.preventDefault();
|
|
1909
|
+
event && event.stopPropagation();
|
|
1910
|
+
const { contextName } = props;
|
|
1911
|
+
if (disabled) {
|
|
1912
|
+
return;
|
|
1913
|
+
}
|
|
1914
|
+
setErrors([]);
|
|
1915
|
+
setDisabled(true);
|
|
1916
|
+
const data = getSubmitData();
|
|
1917
|
+
try {
|
|
1918
|
+
const result = await createDocument({
|
|
1919
|
+
input: {
|
|
1920
|
+
data,
|
|
1921
|
+
contextName
|
|
1922
1922
|
}
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1923
|
+
});
|
|
1924
|
+
if ((_a = result.errors) == null ? void 0 : _a.length) {
|
|
1925
|
+
mutationErrorCallback(document1, result.errors[0]);
|
|
1926
|
+
} else {
|
|
1927
|
+
newMutationSuccessCallback(result);
|
|
1925
1928
|
}
|
|
1926
|
-
}
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1929
|
+
} catch (error) {
|
|
1930
|
+
mutationErrorCallback(document1, error);
|
|
1931
|
+
}
|
|
1932
|
+
}, "submitFormCreate");
|
|
1933
|
+
const submitFormUpdate = /* @__PURE__ */ __name(async (event) => {
|
|
1934
|
+
var _a;
|
|
1935
|
+
event && event.preventDefault();
|
|
1936
|
+
event && event.stopPropagation();
|
|
1937
|
+
const { contextName } = props;
|
|
1938
|
+
if (disabled) {
|
|
1939
|
+
return;
|
|
1940
|
+
}
|
|
1941
|
+
setErrors([]);
|
|
1942
|
+
setDisabled(true);
|
|
1943
|
+
const data = getSubmitData();
|
|
1944
|
+
try {
|
|
1945
|
+
const documentId = currentDocument._id;
|
|
1946
|
+
const result = await updateDocument({
|
|
1947
|
+
input: {
|
|
1948
|
+
id: documentId,
|
|
1949
|
+
data,
|
|
1950
|
+
contextName
|
|
1940
1951
|
}
|
|
1941
|
-
}
|
|
1942
|
-
|
|
1952
|
+
});
|
|
1953
|
+
if ((_a = result.errors) == null ? void 0 : _a.length) {
|
|
1954
|
+
mutationErrorCallback(document1, result.errors[0]);
|
|
1955
|
+
} else {
|
|
1956
|
+
editMutationSuccessCallback(result);
|
|
1943
1957
|
}
|
|
1958
|
+
} catch (error) {
|
|
1959
|
+
mutationErrorCallback(document1, error);
|
|
1944
1960
|
}
|
|
1945
|
-
}, "
|
|
1961
|
+
}, "submitFormUpdate");
|
|
1946
1962
|
const deleteDocumentWithConfirm = /* @__PURE__ */ __name(() => {
|
|
1947
1963
|
const document = currentDocument;
|
|
1948
1964
|
const documentId = props.document._id;
|
|
@@ -1971,13 +1987,14 @@ var Form = /* @__PURE__ */ __name((props) => {
|
|
|
1971
1987
|
}, "deleteDocumentWithConfirm");
|
|
1972
1988
|
const { successComponent, document: document1, currentUser, model, warnUnsavedChanges } = props;
|
|
1973
1989
|
const FormComponents = useVulcanComponents();
|
|
1974
|
-
const
|
|
1975
|
-
const
|
|
1990
|
+
const formType = document1 ? "edit" : "new";
|
|
1991
|
+
const submitForm = formType === "new" ? submitFormCreate : submitFormUpdate;
|
|
1992
|
+
const mutableFields = formType === "edit" ? getEditableFields(schema, currentUser, initialDocument) : getInsertableFields(schema, currentUser);
|
|
1976
1993
|
const { formLayoutProps, formGroupProps } = getChildrenProps(props, {
|
|
1977
1994
|
disabled,
|
|
1978
1995
|
currentDocument
|
|
1979
1996
|
}, {
|
|
1980
|
-
formType
|
|
1997
|
+
formType
|
|
1981
1998
|
}, {
|
|
1982
1999
|
deleteDocument: deleteDocumentWithConfirm
|
|
1983
2000
|
});
|
|
@@ -1991,7 +2008,7 @@ var Form = /* @__PURE__ */ __name((props) => {
|
|
|
1991
2008
|
clearForm,
|
|
1992
2009
|
refetchForm,
|
|
1993
2010
|
isChanged,
|
|
1994
|
-
submitForm: submitFormContext
|
|
2011
|
+
submitForm: submitFormContext,
|
|
1995
2012
|
addToDeletedValues,
|
|
1996
2013
|
updateCurrentValues,
|
|
1997
2014
|
getDocument: () => currentDocument,
|