@socotra/ec-react-components 2.2.3-alpha.7 → 2.2.3-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/index.d.ts +189 -0
- package/dist/index.es.js +21439 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +76 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +4 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { AccountConfigRecord } from '@socotra/ec-react-schemas';
|
|
2
|
+
import { AccountRequest } from '@socotra/ec-react-schemas';
|
|
3
|
+
import { AccountResponse } from '@socotra/ec-react-schemas';
|
|
4
|
+
import { DataTypeConfigRecord } from '@socotra/ec-react-schemas';
|
|
5
|
+
import { ElementConfig } from '@socotra/ec-react-schemas';
|
|
6
|
+
import { ElementRequest } from '@socotra/ec-react-schemas';
|
|
7
|
+
import { ElementResponse } from '@socotra/ec-react-schemas';
|
|
8
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
9
|
+
import { ProductConfig } from '@socotra/ec-react-schemas';
|
|
10
|
+
import { QuoteRequest } from '@socotra/ec-react-schemas';
|
|
11
|
+
import { QuoteResponse } from '@socotra/ec-react-schemas';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* AccountForm is a form for creating or updating an account. It required a resolved data model, custom data types, and an optional account object to put the form in update mode.
|
|
15
|
+
*/
|
|
16
|
+
export declare const AccountForm: {
|
|
17
|
+
({ accountsModel, accountType, dataTypes, disabled, handleSubmit, isSubmitting, preventFormResetOnDisabled, hideSubmitButton, validateOnSubmit, account, submitButtonText, id, }: Props): JSX_2.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* ElementForm is a form for creating or updating an element of a Quote. It required the element's data model, custom data types, and an element response object.
|
|
23
|
+
*/
|
|
24
|
+
export declare const ElementForm: {
|
|
25
|
+
({ elementModel, dataTypes, disabled, handleSubmit, isSubmitting, preventFormResetOnDisabled, hideSubmitButton, element, validateOnSubmit, submitButtonText, id, }: Props_3): JSX_2.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
declare type Props = {
|
|
30
|
+
/**
|
|
31
|
+
* The resolved data model for **all** accounts retrieved from the data model response
|
|
32
|
+
*/
|
|
33
|
+
accountsModel: AccountConfigRecord;
|
|
34
|
+
/**
|
|
35
|
+
* The account type to use for the form, used to pick the correct data model from the accountsModel
|
|
36
|
+
*/
|
|
37
|
+
accountType: keyof AccountConfigRecord;
|
|
38
|
+
/**
|
|
39
|
+
* The custom data types for the configuration that may be referenced by the account's data model
|
|
40
|
+
*/
|
|
41
|
+
dataTypes: DataTypeConfigRecord;
|
|
42
|
+
/**
|
|
43
|
+
* The function to call when the form is submitted. It will create an AccountRequest from the form data.
|
|
44
|
+
*/
|
|
45
|
+
handleSubmit: (data: AccountRequest) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Set to true when the form is submitting to set fields to readonly and disable the submit button
|
|
48
|
+
*/
|
|
49
|
+
isSubmitting?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Disables the form
|
|
52
|
+
*/
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Prevents the form from resetting when disabled
|
|
56
|
+
* default is true
|
|
57
|
+
*/
|
|
58
|
+
preventFormResetOnDisabled?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* The account object to put the form in update mode
|
|
61
|
+
*/
|
|
62
|
+
account?: AccountResponse;
|
|
63
|
+
/**
|
|
64
|
+
* Hides the submit button
|
|
65
|
+
*/
|
|
66
|
+
hideSubmitButton?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* The text to display on the submit button
|
|
69
|
+
*/
|
|
70
|
+
submitButtonText?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Whether to validate the form on submit
|
|
73
|
+
*/
|
|
74
|
+
validateOnSubmit?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* ID for the form wrapper
|
|
77
|
+
* */
|
|
78
|
+
id?: string;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
declare type Props_2 = {
|
|
82
|
+
/**
|
|
83
|
+
* The quote object
|
|
84
|
+
*/
|
|
85
|
+
quote: QuoteResponse;
|
|
86
|
+
/**
|
|
87
|
+
* The resolved data model for quote retrieved from the data model response
|
|
88
|
+
*/
|
|
89
|
+
productModel: ProductConfig;
|
|
90
|
+
/**
|
|
91
|
+
* The custom data types for the configuration that may be referenced by the elementModel
|
|
92
|
+
*/
|
|
93
|
+
dataTypes: DataTypeConfigRecord;
|
|
94
|
+
/**
|
|
95
|
+
* The function to call when the form is submitted. It will create an QuoteRequest from the form data.
|
|
96
|
+
*/
|
|
97
|
+
handleSubmit: (data: QuoteRequest) => void;
|
|
98
|
+
/**
|
|
99
|
+
* Set to true when the form is submitting to set fields to readonly and disable the submit button
|
|
100
|
+
*/
|
|
101
|
+
isSubmitting?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Disables the form
|
|
104
|
+
*/
|
|
105
|
+
disabled?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Prevents the form from resetting when disabled
|
|
108
|
+
* default is true
|
|
109
|
+
*/
|
|
110
|
+
preventFormResetOnDisabled?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Hides the submit button
|
|
113
|
+
*/
|
|
114
|
+
hideSubmitButton?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* The text to display on the submit button
|
|
117
|
+
*/
|
|
118
|
+
/**
|
|
119
|
+
* Whether to validate the form on submit
|
|
120
|
+
*/
|
|
121
|
+
validateOnSubmit?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* The text to display on the submit button
|
|
124
|
+
*/
|
|
125
|
+
submitButtonText?: string;
|
|
126
|
+
/**
|
|
127
|
+
* ID for the form wrapper
|
|
128
|
+
* */
|
|
129
|
+
id?: string;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
declare type Props_3 = {
|
|
133
|
+
/**
|
|
134
|
+
* The resolved data model for the element retrieved from the data model response
|
|
135
|
+
*/
|
|
136
|
+
elementModel: ElementConfig;
|
|
137
|
+
/**
|
|
138
|
+
* The custom data types for the configuration that may be referenced by the elementModel
|
|
139
|
+
*/
|
|
140
|
+
dataTypes: DataTypeConfigRecord;
|
|
141
|
+
/**
|
|
142
|
+
* The function to call when the form is submitted. It will create an ElementUpdateRequest.
|
|
143
|
+
*/
|
|
144
|
+
handleSubmit: (data: ElementRequest) => void;
|
|
145
|
+
/**
|
|
146
|
+
* Set to true when the form is submitting to set fields to readonly and disable the submit button
|
|
147
|
+
*/
|
|
148
|
+
isSubmitting?: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Disables the form
|
|
151
|
+
*/
|
|
152
|
+
disabled?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Prevents the form from resetting when disabled
|
|
155
|
+
* default is true
|
|
156
|
+
*/
|
|
157
|
+
preventFormResetOnDisabled?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* The element object from the quote
|
|
160
|
+
*/
|
|
161
|
+
element: ElementResponse;
|
|
162
|
+
/**
|
|
163
|
+
* Hides the submit button
|
|
164
|
+
*/
|
|
165
|
+
hideSubmitButton?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Whether to validate the form on submit
|
|
168
|
+
*/
|
|
169
|
+
validateOnSubmit?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
/**
|
|
172
|
+
* The text to display on the submit button
|
|
173
|
+
*/
|
|
174
|
+
submitButtonText?: string;
|
|
175
|
+
/**
|
|
176
|
+
* ID for the form wrapper
|
|
177
|
+
* */
|
|
178
|
+
id?: string;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* QuoteForm is a form for updating a quote. It required a product data model, custom data types, and quote object to render the form.
|
|
183
|
+
*/
|
|
184
|
+
export declare const QuoteForm: {
|
|
185
|
+
({ quote, productModel, dataTypes, disabled, handleSubmit, isSubmitting, preventFormResetOnDisabled, validateOnSubmit, hideSubmitButton, submitButtonText, id, }: Props_2): JSX_2.Element;
|
|
186
|
+
displayName: string;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export { }
|