@licklist/design 0.72.72-dev.0 → 0.72.72-dev.1

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,439 +0,0 @@
1
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
- import { useId } from '@react-aria/utils';
3
- import Card from 'react-bootstrap/Card';
4
- import Col from 'react-bootstrap/Col';
5
- import Form from 'react-bootstrap/Form';
6
- import InputGroup from 'react-bootstrap/InputGroup';
7
- import Row from 'react-bootstrap/Row';
8
- import { useFormContext } from 'react-hook-form';
9
- import { useTranslation } from 'react-i18next';
10
- import { FaPercentage, FaPoundSign } from 'react-icons/fa';
11
- import '../../static/index.js';
12
- import WarningMessage from '../../static/WarningMessage.js';
13
-
14
- function _define_property(obj, key, value) {
15
- if (key in obj) {
16
- Object.defineProperty(obj, key, {
17
- value: value,
18
- enumerable: true,
19
- configurable: true,
20
- writable: true
21
- });
22
- } else {
23
- obj[key] = value;
24
- }
25
- return obj;
26
- }
27
- function _object_spread(target) {
28
- for(var i = 1; i < arguments.length; i++){
29
- var source = arguments[i] != null ? arguments[i] : {};
30
- var ownKeys = Object.keys(source);
31
- if (typeof Object.getOwnPropertySymbols === "function") {
32
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
33
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
34
- }));
35
- }
36
- ownKeys.forEach(function(key) {
37
- _define_property(target, key, source[key]);
38
- });
39
- }
40
- return target;
41
- }
42
- function ownKeys(object, enumerableOnly) {
43
- var keys = Object.keys(object);
44
- if (Object.getOwnPropertySymbols) {
45
- var symbols = Object.getOwnPropertySymbols(object);
46
- if (enumerableOnly) {
47
- symbols = symbols.filter(function(sym) {
48
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
49
- });
50
- }
51
- keys.push.apply(keys, symbols);
52
- }
53
- return keys;
54
- }
55
- function _object_spread_props(target, source) {
56
- source = source != null ? source : {};
57
- if (Object.getOwnPropertyDescriptors) {
58
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
59
- } else {
60
- ownKeys(Object(source)).forEach(function(key) {
61
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
62
- });
63
- }
64
- return target;
65
- }
66
- function PaymentFeeForm(param) {
67
- var _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading;
68
- var _errors_feeInPercent, _errors_feeInPercent1, _errors_feeInPercent2, _errors_minFeeInPounds, _errors_minFeeInPounds1, _errors_minFeeInPounds2, _errors_maxFeeInPounds, _errors_maxFeeInPounds1, _errors_maxFeeInPounds2, _errors_vatInPercent, _errors_vatInPercent1, _errors_vatInPercent2, _errors_fixedFee, _errors_fixedFee1, _errors_fixedFee2;
69
- var _useFormContext = useFormContext(), register = _useFormContext.register, errors = _useFormContext.formState.errors, watch = _useFormContext.watch;
70
- var t = useTranslation('Design').t;
71
- var feeInPercentId = useId();
72
- var minFeeInPoundsId = useId();
73
- var maxFeeInPoundsId = useId();
74
- var vatInPercentId = useId();
75
- var fixedFeeId = useId();
76
- var minFee = watch('minFeeInPounds');
77
- var maxFee = watch('maxFeeInPounds');
78
- var percentFee = watch('feeInPercent');
79
- return /*#__PURE__*/ jsxs(Fragment, {
80
- children: [
81
- /*#__PURE__*/ jsx(Row, {
82
- children: /*#__PURE__*/ jsx(Col, {
83
- xs: 12,
84
- children: /*#__PURE__*/ jsx("h5", {
85
- className: "mt-5",
86
- children: t('paymentFee')
87
- })
88
- })
89
- }),
90
- /*#__PURE__*/ jsx(Card, {
91
- className: "mb-3",
92
- children: /*#__PURE__*/ jsxs(Card.Body, {
93
- children: [
94
- /*#__PURE__*/ jsx(Row, {
95
- children: /*#__PURE__*/ jsx(Col, {
96
- xs: 12,
97
- children: /*#__PURE__*/ jsx("div", {
98
- className: "mb-4",
99
- children: t('paymentFeeDescription')
100
- })
101
- })
102
- }),
103
- /*#__PURE__*/ jsxs(Row, {
104
- children: [
105
- /*#__PURE__*/ jsxs(Col, {
106
- xs: 12,
107
- sm: 4,
108
- lg: 2,
109
- children: [
110
- /*#__PURE__*/ jsxs(Form.Group, {
111
- controlId: feeInPercentId,
112
- children: [
113
- /*#__PURE__*/ jsx(Form.Label, {
114
- children: t('feeInPercent')
115
- }),
116
- /*#__PURE__*/ jsxs(InputGroup, {
117
- hasValidation: true,
118
- children: [
119
- /*#__PURE__*/ jsx(InputGroup.Prepend, {
120
- children: /*#__PURE__*/ jsx(InputGroup.Text, {
121
- children: /*#__PURE__*/ jsx(FaPercentage, {
122
- size: 10
123
- })
124
- })
125
- }),
126
- /*#__PURE__*/ jsx(Form.Control, _object_spread_props(_object_spread({
127
- type: "number",
128
- min: 0,
129
- max: 100,
130
- step: "1",
131
- placeholder: "0",
132
- onWheel: function(event) {
133
- return event.currentTarget.blur();
134
- }
135
- }, register('feeInPercent', {
136
- validate: {
137
- moreThan: function(v) {
138
- return v ? v >= 0 : true;
139
- },
140
- lessThan: function(v) {
141
- return v ? v <= 100 : true;
142
- }
143
- }
144
- })), {
145
- name: "feeInPercent",
146
- isInvalid: Boolean(errors.feeInPercent),
147
- disabled: isLoading
148
- })),
149
- /*#__PURE__*/ jsxs(Form.Control.Feedback, {
150
- type: "invalid",
151
- children: [
152
- (_errors_feeInPercent = errors.feeInPercent) === null || _errors_feeInPercent === void 0 ? void 0 : _errors_feeInPercent.message,
153
- ((_errors_feeInPercent1 = errors.feeInPercent) === null || _errors_feeInPercent1 === void 0 ? void 0 : _errors_feeInPercent1.type) === 'moreThan' && t('Validation:fieldMinNumber', {
154
- attribute: t('feeInPercent'),
155
- min: 0
156
- }),
157
- ((_errors_feeInPercent2 = errors.feeInPercent) === null || _errors_feeInPercent2 === void 0 ? void 0 : _errors_feeInPercent2.type) === 'lessThan' && t('Validation:fieldMaxNumber', {
158
- attribute: t('feeInPercent'),
159
- max: 100
160
- })
161
- ]
162
- })
163
- ]
164
- })
165
- ]
166
- }),
167
- percentFee && minFee && maxFee ? /*#__PURE__*/ jsx(WarningMessage, {
168
- message: t('Validation:fieldPercentFee')
169
- }) : null
170
- ]
171
- }),
172
- /*#__PURE__*/ jsx(Col, {
173
- xs: 12,
174
- sm: 4,
175
- lg: 2,
176
- children: /*#__PURE__*/ jsxs(Form.Group, {
177
- controlId: minFeeInPoundsId,
178
- children: [
179
- /*#__PURE__*/ jsx(Form.Label, {
180
- children: t('minFeeInPounds')
181
- }),
182
- /*#__PURE__*/ jsxs(InputGroup, {
183
- hasValidation: true,
184
- children: [
185
- /*#__PURE__*/ jsx(InputGroup.Prepend, {
186
- children: /*#__PURE__*/ jsx(InputGroup.Text, {
187
- children: /*#__PURE__*/ jsx(FaPoundSign, {
188
- size: 10
189
- })
190
- })
191
- }),
192
- /*#__PURE__*/ jsx(Form.Control, _object_spread_props(_object_spread({}, register('minFeeInPounds', {
193
- validate: {
194
- moreThan: function(v) {
195
- return v ? v >= 0 : true;
196
- },
197
- lessThan: function(v) {
198
- return v ? v <= 999999.99 : true;
199
- }
200
- }
201
- })), {
202
- name: "minFeeInPounds",
203
- type: "number",
204
- min: 0,
205
- max: 999999.99,
206
- step: "0.01",
207
- placeholder: "0,00",
208
- onWheel: function(event) {
209
- return event.currentTarget.blur();
210
- },
211
- isInvalid: Boolean(errors.minFeeInPounds),
212
- disabled: isLoading
213
- })),
214
- /*#__PURE__*/ jsxs(Form.Control.Feedback, {
215
- type: "invalid",
216
- children: [
217
- (_errors_minFeeInPounds = errors.minFeeInPounds) === null || _errors_minFeeInPounds === void 0 ? void 0 : _errors_minFeeInPounds.message,
218
- ((_errors_minFeeInPounds1 = errors.minFeeInPounds) === null || _errors_minFeeInPounds1 === void 0 ? void 0 : _errors_minFeeInPounds1.type) === 'moreThan' && t('Validation:fieldMinNumber', {
219
- attribute: t('minFeeInPounds'),
220
- min: 0
221
- }),
222
- ((_errors_minFeeInPounds2 = errors.minFeeInPounds) === null || _errors_minFeeInPounds2 === void 0 ? void 0 : _errors_minFeeInPounds2.type) === 'lessThan' && t('Validation:fieldMaxNumber', {
223
- attribute: t('minFeeInPounds'),
224
- max: 999999.99
225
- })
226
- ]
227
- })
228
- ]
229
- })
230
- ]
231
- })
232
- }),
233
- /*#__PURE__*/ jsxs(Col, {
234
- xs: 12,
235
- sm: 4,
236
- lg: 3,
237
- children: [
238
- /*#__PURE__*/ jsxs(Form.Group, {
239
- controlId: maxFeeInPoundsId,
240
- children: [
241
- /*#__PURE__*/ jsx(Form.Label, {
242
- children: t('maxFeeInPounds')
243
- }),
244
- /*#__PURE__*/ jsxs(InputGroup, {
245
- hasValidation: true,
246
- children: [
247
- /*#__PURE__*/ jsx(InputGroup.Prepend, {
248
- children: /*#__PURE__*/ jsx(InputGroup.Text, {
249
- children: /*#__PURE__*/ jsx(FaPoundSign, {
250
- size: 10
251
- })
252
- })
253
- }),
254
- /*#__PURE__*/ jsx(Form.Control, _object_spread_props(_object_spread({}, register('maxFeeInPounds', {
255
- validate: {
256
- moreThan: function(v) {
257
- return v ? v >= 0 : true;
258
- },
259
- lessThan: function(v) {
260
- return v ? v <= 999999.99 : true;
261
- }
262
- }
263
- })), {
264
- name: "maxFeeInPounds",
265
- type: "number",
266
- min: 0,
267
- max: 999999.99,
268
- step: "0.01",
269
- placeholder: "0,00",
270
- onWheel: function(event) {
271
- return event.currentTarget.blur();
272
- },
273
- isInvalid: Boolean(errors.maxFeeInPounds),
274
- disabled: isLoading
275
- })),
276
- /*#__PURE__*/ jsxs(Form.Control.Feedback, {
277
- type: "invalid",
278
- children: [
279
- (_errors_maxFeeInPounds = errors.maxFeeInPounds) === null || _errors_maxFeeInPounds === void 0 ? void 0 : _errors_maxFeeInPounds.message,
280
- ((_errors_maxFeeInPounds1 = errors.maxFeeInPounds) === null || _errors_maxFeeInPounds1 === void 0 ? void 0 : _errors_maxFeeInPounds1.type) === 'moreThan' && t('Validation:fieldMinNumber', {
281
- attribute: t('maxFeeInPounds'),
282
- min: 0
283
- }),
284
- ((_errors_maxFeeInPounds2 = errors.maxFeeInPounds) === null || _errors_maxFeeInPounds2 === void 0 ? void 0 : _errors_maxFeeInPounds2.type) === 'lessThan' && t('Validation:fieldMaxNumber', {
285
- attribute: t('maxFeeInPounds'),
286
- max: 999999.99
287
- })
288
- ]
289
- })
290
- ]
291
- })
292
- ]
293
- }),
294
- minFee > maxFee ? /*#__PURE__*/ jsx(WarningMessage, {
295
- message: t('Validation:fieldMaxNumber', {
296
- attribute: t('Min Fee'),
297
- max: 'Max Fee'
298
- })
299
- }) : null
300
- ]
301
- }),
302
- /*#__PURE__*/ jsx(Col, {
303
- xs: 12,
304
- sm: {
305
- span: 4,
306
- offset: 2
307
- },
308
- lg: {
309
- span: 2,
310
- offset: 0
311
- },
312
- children: /*#__PURE__*/ jsxs(Form.Group, {
313
- controlId: vatInPercentId,
314
- children: [
315
- /*#__PURE__*/ jsx(Form.Label, {
316
- children: t('vatInPercent')
317
- }),
318
- /*#__PURE__*/ jsxs(InputGroup, {
319
- hasValidation: true,
320
- children: [
321
- /*#__PURE__*/ jsx(InputGroup.Prepend, {
322
- children: /*#__PURE__*/ jsx(InputGroup.Text, {
323
- children: /*#__PURE__*/ jsx(FaPercentage, {
324
- size: 10
325
- })
326
- })
327
- }),
328
- /*#__PURE__*/ jsx(Form.Control, _object_spread_props(_object_spread({}, register('vatInPercent', {
329
- validate: {
330
- moreThan: function(v) {
331
- return v ? v >= 0 : true;
332
- },
333
- lessThan: function(v) {
334
- return v ? v <= 100 : true;
335
- }
336
- }
337
- })), {
338
- name: "vatInPercent",
339
- type: "number",
340
- min: 0,
341
- max: 100,
342
- step: "1",
343
- placeholder: "0",
344
- onWheel: function(event) {
345
- return event.currentTarget.blur();
346
- },
347
- isInvalid: Boolean(errors.vatInPercent),
348
- disabled: isLoading
349
- })),
350
- /*#__PURE__*/ jsxs(Form.Control.Feedback, {
351
- type: "invalid",
352
- children: [
353
- (_errors_vatInPercent = errors.vatInPercent) === null || _errors_vatInPercent === void 0 ? void 0 : _errors_vatInPercent.message,
354
- ((_errors_vatInPercent1 = errors.vatInPercent) === null || _errors_vatInPercent1 === void 0 ? void 0 : _errors_vatInPercent1.type) === 'moreThan' && t('Validation:fieldMinNumber', {
355
- attribute: t('vatInPercent'),
356
- min: 0
357
- }),
358
- ((_errors_vatInPercent2 = errors.vatInPercent) === null || _errors_vatInPercent2 === void 0 ? void 0 : _errors_vatInPercent2.type) === 'lessThan' && t('Validation:fieldMaxNumber', {
359
- attribute: t('vatInPercent'),
360
- max: 100
361
- })
362
- ]
363
- })
364
- ]
365
- })
366
- ]
367
- })
368
- }),
369
- /*#__PURE__*/ jsx(Col, {
370
- xs: 12,
371
- sm: 4,
372
- lg: 3,
373
- children: /*#__PURE__*/ jsxs(Form.Group, {
374
- controlId: fixedFeeId,
375
- children: [
376
- /*#__PURE__*/ jsx(Form.Label, {
377
- children: t('fixedFee')
378
- }),
379
- /*#__PURE__*/ jsxs(InputGroup, {
380
- hasValidation: true,
381
- children: [
382
- /*#__PURE__*/ jsx(InputGroup.Prepend, {
383
- children: /*#__PURE__*/ jsx(InputGroup.Text, {
384
- children: /*#__PURE__*/ jsx(FaPoundSign, {
385
- size: 10
386
- })
387
- })
388
- }),
389
- /*#__PURE__*/ jsx(Form.Control, _object_spread_props(_object_spread({}, register('fixedFee', {
390
- validate: {
391
- moreThan: function(v) {
392
- return v ? v >= 0 : true;
393
- },
394
- lessThan: function(v) {
395
- return v ? v <= 999999.99 : true;
396
- }
397
- }
398
- })), {
399
- name: "fixedFee",
400
- type: "number",
401
- min: 0,
402
- max: 999999.99,
403
- step: "0.01",
404
- placeholder: "0,00",
405
- onWheel: function(event) {
406
- return event.currentTarget.blur();
407
- },
408
- isInvalid: Boolean(errors.fixedFee),
409
- disabled: isLoading
410
- })),
411
- /*#__PURE__*/ jsxs(Form.Control.Feedback, {
412
- type: "invalid",
413
- children: [
414
- (_errors_fixedFee = errors.fixedFee) === null || _errors_fixedFee === void 0 ? void 0 : _errors_fixedFee.message,
415
- ((_errors_fixedFee1 = errors.fixedFee) === null || _errors_fixedFee1 === void 0 ? void 0 : _errors_fixedFee1.type) === 'moreThan' && t('Validation:fieldMinNumber', {
416
- attribute: t('fixedFee'),
417
- min: 0
418
- }),
419
- ((_errors_fixedFee2 = errors.fixedFee) === null || _errors_fixedFee2 === void 0 ? void 0 : _errors_fixedFee2.type) === 'lessThan' && t('Validation:fieldMaxNumber', {
420
- attribute: t('fixedFee'),
421
- max: 999999.99
422
- })
423
- ]
424
- })
425
- ]
426
- })
427
- ]
428
- })
429
- })
430
- ]
431
- })
432
- ]
433
- })
434
- })
435
- ]
436
- });
437
- }
438
-
439
- export { PaymentFeeForm };
@@ -1,2 +0,0 @@
1
- export * from './AdminSettingForm';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/setting/admin/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
@@ -1,10 +0,0 @@
1
- import { HasPermissionProp } from '@licklist/plugins/dist/types/permission/Permission';
2
- import { PaymentFeeFormFieldValues } from '../admin/PaymentFeeForm';
3
- export type SystemSettingFormFieldValues = PaymentFeeFormFieldValues;
4
- export interface SystemSettingFormProps extends HasPermissionProp {
5
- isLoading: boolean;
6
- onSubmit?: (data: SystemSettingFormFieldValues) => void;
7
- defaultValues?: Partial<SystemSettingFormFieldValues>;
8
- }
9
- export declare function SystemSettingForm(props: SystemSettingFormProps): import("react/jsx-runtime").JSX.Element;
10
- //# sourceMappingURL=SystemSettingForm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SystemSettingForm.d.ts","sourceRoot":"","sources":["../../../src/setting/system/SystemSettingForm.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AACtF,OAAO,EAEL,yBAAyB,EAC1B,MAAM,yBAAyB,CAAA;AAEhC,MAAM,MAAM,4BAA4B,GAAG,yBAAyB,CAAA;AAEpE,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC/D,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,4BAA4B,KAAK,IAAI,CAAA;IACvD,aAAa,CAAC,EAAE,OAAO,CAAC,4BAA4B,CAAC,CAAA;CACtD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CA2C9D"}
@@ -1,95 +0,0 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { Button, Spinner } from 'react-bootstrap';
3
- import Form from 'react-bootstrap/Form';
4
- import { useForm, FormProvider } from 'react-hook-form';
5
- import { useTranslation } from 'react-i18next';
6
- import { PaymentFeeForm } from '../admin/PaymentFeeForm.js';
7
-
8
- function _define_property(obj, key, value) {
9
- if (key in obj) {
10
- Object.defineProperty(obj, key, {
11
- value: value,
12
- enumerable: true,
13
- configurable: true,
14
- writable: true
15
- });
16
- } else {
17
- obj[key] = value;
18
- }
19
- return obj;
20
- }
21
- function _object_spread(target) {
22
- for(var i = 1; i < arguments.length; i++){
23
- var source = arguments[i] != null ? arguments[i] : {};
24
- var ownKeys = Object.keys(source);
25
- if (typeof Object.getOwnPropertySymbols === "function") {
26
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
27
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
28
- }));
29
- }
30
- ownKeys.forEach(function(key) {
31
- _define_property(target, key, source[key]);
32
- });
33
- }
34
- return target;
35
- }
36
- function ownKeys(object, enumerableOnly) {
37
- var keys = Object.keys(object);
38
- if (Object.getOwnPropertySymbols) {
39
- var symbols = Object.getOwnPropertySymbols(object);
40
- if (enumerableOnly) {
41
- symbols = symbols.filter(function(sym) {
42
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
43
- });
44
- }
45
- keys.push.apply(keys, symbols);
46
- }
47
- return keys;
48
- }
49
- function _object_spread_props(target, source) {
50
- source = source != null ? source : {};
51
- if (Object.getOwnPropertyDescriptors) {
52
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
53
- } else {
54
- ownKeys(Object(source)).forEach(function(key) {
55
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
56
- });
57
- }
58
- return target;
59
- }
60
- function SystemSettingForm(props) {
61
- var _props_isLoading = props.isLoading, isLoading = _props_isLoading === void 0 ? false : _props_isLoading, _props_defaultValues = props.defaultValues, defaultValues = _props_defaultValues === void 0 ? {} : _props_defaultValues, onSubmit = props.onSubmit, _props_hasPermission = props.hasPermission, hasPermission = _props_hasPermission === void 0 ? true : _props_hasPermission;
62
- var form = useForm({
63
- mode: 'onChange',
64
- defaultValues: defaultValues
65
- });
66
- var handleSubmit = form.handleSubmit;
67
- var t = useTranslation('Design').t;
68
- return /*#__PURE__*/ jsxs(Form, {
69
- className: "d-flex flex-column",
70
- noValidate: true,
71
- onSubmit: handleSubmit(onSubmit),
72
- children: [
73
- /*#__PURE__*/ jsx(FormProvider, _object_spread_props(_object_spread({}, form), {
74
- children: /*#__PURE__*/ jsx(PaymentFeeForm, _object_spread({}, props))
75
- })),
76
- hasPermission && /*#__PURE__*/ jsxs(Button, {
77
- type: "submit",
78
- disabled: isLoading,
79
- className: "d-flex align-items-center align-self-end mt-5",
80
- children: [
81
- isLoading && /*#__PURE__*/ jsx(Spinner, {
82
- animation: "border",
83
- size: "sm",
84
- role: "status",
85
- "aria-hidden": "true",
86
- className: "mr-2"
87
- }),
88
- t('update')
89
- ]
90
- })
91
- ]
92
- });
93
- }
94
-
95
- export { SystemSettingForm };
@@ -1,2 +0,0 @@
1
- export * from './SystemSettingForm';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/setting/system/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
@@ -1,5 +0,0 @@
1
- export type Currency = {
2
- id: number;
3
- title: string;
4
- };
5
- //# sourceMappingURL=currency.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../src/types/currency.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
@@ -1,52 +0,0 @@
1
- import { Meta, Story } from '@storybook/react'
2
- import { FormProvider, useForm } from 'react-hook-form'
3
- import Container from 'react-bootstrap/Container'
4
-
5
- import {
6
- PaymentFeeForm,
7
- PaymentFeeFormFieldValues,
8
- PaymentFeeFormProps,
9
- } from './PaymentFeeForm'
10
- import { AdminSettingForm, AdminSettingFormProps } from './AdminSettingForm'
11
-
12
- export default {
13
- title: 'Setting/Admin',
14
- } as Meta
15
-
16
- export const SettingFormComponent: Story<AdminSettingFormProps> = (args) => (
17
- <Container>
18
- <AdminSettingForm {...args} />
19
- </Container>
20
- )
21
-
22
- export const PaymentFeeFormComponent: Story<PaymentFeeFormProps> = (args) => {
23
- const form = useForm<PaymentFeeFormFieldValues>({
24
- defaultValues: args.defaultValues,
25
- })
26
- return (
27
- <FormProvider {...form}>
28
- <PaymentFeeForm {...args} />
29
- </FormProvider>
30
- )
31
- }
32
-
33
- PaymentFeeFormComponent.args = {
34
- isLoading: false,
35
- defaultValues: {
36
- feeInPercent: NaN,
37
- minFeeInPounds: NaN,
38
- maxFeeInPounds: NaN,
39
- vatInPercent: NaN,
40
- fixedFee: NaN,
41
- },
42
- }
43
-
44
- SettingFormComponent.args = {
45
- isLoading: false,
46
- onSubmit: (data) => console.log('onSubmit', data),
47
- hasPermission: true,
48
- defaultValues: {
49
- warningOnNumberOfPeople: '',
50
- ...PaymentFeeFormComponent.args.defaultValues,
51
- },
52
- }