@socotra/ec-react-components 2.0.1 → 2.1.0-alpha.0

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/index.d.ts CHANGED
@@ -3,6 +3,9 @@ import { AccountRequest } from '@socotra/ec-react-schemas';
3
3
  import { AccountResponse } from '@socotra/ec-react-schemas';
4
4
  import { DataTypeConfigRecord } from '@socotra/ec-react-schemas';
5
5
  import { JSX as JSX_2 } from 'react/jsx-runtime';
6
+ import { ProductConfigRecord } from '@socotra/ec-react-schemas';
7
+ import { QuoteRequest } from '@socotra/ec-react-schemas';
8
+ import { QuoteResponse } from '@socotra/ec-react-schemas';
6
9
 
7
10
  /**
8
11
  * AccountForm is a form for creating or updating an account. It accepts a resolved data model, custom data types, and an optional account object to put the form in update mode. References: https://rjsf-team.github.io/react-jsonschema-form/docs/
@@ -65,9 +68,67 @@ declare type Props = {
65
68
  id?: string;
66
69
  };
67
70
 
71
+ declare type Props_2 = {
72
+ /**
73
+ * The resolved data model for quotes retrieved from the data model response
74
+ */
75
+ productsModel: ProductConfigRecord;
76
+ /**
77
+ * The quote type to use for the form
78
+ */
79
+ productType: keyof ProductConfigRecord;
80
+ /**
81
+ * The custom data types for the configuration that may be referenced by the DataModel
82
+ */
83
+ dataTypes: DataTypeConfigRecord;
84
+ /**
85
+ * The function to call when the form is submitted. It will create an QuoteUpdateRequest from the form data.
86
+ */
87
+ handleSubmit: (data: QuoteRequest) => void;
88
+ /**
89
+ * Set to true when the form is submitting to set fields to readonly and disable the submit button
90
+ */
91
+ isSubmitting?: boolean;
92
+ /**
93
+ * Disables the form
94
+ */
95
+ disabled?: boolean;
96
+ /**
97
+ * Prevents the form from resetting when disabled
98
+ * default is false
99
+ */
100
+ preventFormResetOnDisabled?: boolean;
101
+ /**
102
+ * The quote object to put the form in update mode
103
+ */
104
+ quote?: QuoteResponse;
105
+ /**
106
+ * Hides the submit button
107
+ */
108
+ hideSubmitButton?: boolean;
109
+ /**
110
+ * The text to display on the submit button
111
+ */
112
+ /**
113
+ * Whether to validate the form on submit
114
+ */
115
+ validateOnSubmit?: boolean;
116
+ /**
117
+ * The text to display on the submit button
118
+ */
119
+ submitButtonText?: string;
120
+ /**
121
+ * ID for the form wrapper
122
+ * */
123
+ id?: string;
124
+ };
125
+
68
126
  /**
69
- * QuoteForm is a form for updating a quote. It accepts a resolved data model, custom data types, and a quote object to build on.
127
+ * QuoteForm is a form for creating or updating an quote. It accepts a resolved data model, custom data types, and an optional quote object to put the form in update mode. References: https://rjsf-team.github.io/react-jsonschema-form/docs/
70
128
  */
71
- export declare const QuoteForm: () => JSX_2.Element;
129
+ export declare const QuoteForm: {
130
+ ({ productType, productsModel, dataTypes, disabled, handleSubmit, isSubmitting, preventFormResetOnDisabled, hideSubmitButton, validateOnSubmit, quote, submitButtonText, id, }: Props_2): JSX_2.Element;
131
+ displayName: string;
132
+ };
72
133
 
73
134
  export { }