@licklist/design 0.73.0 → 0.74.0-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.
- package/dist/affiliate/form/AffiliateForm.d.ts.map +1 -1
- package/dist/assets/dashboard/chartBar.svg.js +2 -2
- package/dist/auth/Authorizer.d.ts.map +1 -1
- package/dist/auth/Authorizer.js +2 -1
- package/dist/auth/Login/LoginComponent.js +2 -1
- package/dist/auth/Router.d.ts.map +1 -1
- package/dist/auth/Router.js +18 -14
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +2 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +3 -2
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts +2 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +3 -2
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts +2 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +6 -4
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts +2 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.js +2 -2
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.js +2 -1
- package/dist/events/event-statistic-modal/utils/index.js +3 -3
- package/dist/events/event-venue-map/EventVenueMap.d.ts.map +1 -1
- package/dist/events/event-venue-map/EventVenueMap.js +1 -0
- package/dist/events/event-venue-map/hooks/useCanvasSize.d.ts.map +1 -1
- package/dist/events/event-venue-map/hooks/useCanvasSize.js +11 -4
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.js +2 -3
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts.map +1 -1
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.js +4 -11
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +13 -0
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
- package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
- package/dist/iframe/ryft/utils/ryft-form.js +4 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -5
- package/dist/layout/DropDown.d.ts +2 -1
- package/dist/layout/DropDown.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.js +3 -0
- package/dist/product-set/control/ProductSetControl.d.ts +4 -1
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +13 -2
- package/dist/product-set/form/ProductCategoriesControl.d.ts +2 -1
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +3 -2
- package/dist/product-set/form/ProductSetForm.d.ts +7 -4
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +5 -3
- package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductZonesControl.js +0 -2
- package/dist/product-set/form/ProductsControl.d.ts +2 -1
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +7 -3
- package/dist/product-set/form/StepsControl.d.ts +2 -1
- package/dist/product-set/form/StepsControl.d.ts.map +1 -1
- package/dist/product-set/form/StepsControl.js +5 -3
- package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/SubProductsControl.js +1 -3
- package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
- package/dist/product-set/form/VenueMapsControl.js +0 -3
- package/dist/product-set/form/context.d.ts +1 -2
- package/dist/product-set/form/context.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.d.ts +6 -2
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +36 -1
- package/dist/product-set/product/booking-management/ProductBookingManagementControl.d.ts.map +1 -1
- package/dist/product-set/product/booking-management/ProductBookingManagementControl.js +6 -0
- package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
- package/dist/product-set/product/deposit/ProductDepositControl.js +3 -0
- package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
- package/dist/product-set/product/duration/ProductDurationControl.js +6 -0
- package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
- package/dist/product-set/product/price/ProductPriceControl.js +3 -0
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +6 -0
- package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.js +6 -0
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +4 -1
- package/dist/product-set/product/scanRange/ProductScanRangeControl.d.ts +12 -0
- package/dist/product-set/product/scanRange/ProductScanRangeControl.d.ts.map +1 -0
- package/dist/product-set/product/scanRange/ProductScanRangeControl.js +153 -0
- package/dist/product-set/product/scanRange/index.d.ts +2 -0
- package/dist/product-set/product/scanRange/index.d.ts.map +1 -0
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +12 -0
- package/dist/product-set/utils/index.d.ts +5 -1
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
- package/dist/recurrence-input/RecurrenceEndInput.js +3 -0
- package/dist/recurring-date-picker-input/RecurrenceEndInput.d.ts.map +1 -1
- package/dist/resource/form/components/CapacityControl.d.ts.map +1 -1
- package/dist/resource/form/components/CapacityControl.js +3 -0
- package/dist/resource/form/components/SortControl.d.ts.map +1 -1
- package/dist/resource/form/components/SortControl.js +3 -0
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +0 -2
- package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
- package/dist/sales/coupon/control/CouponFormControl.js +21 -0
- package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
- package/dist/setting/dashboard/DashboardSettingForm.js +4 -1
- package/dist/setting/index.d.ts +0 -2
- package/dist/setting/index.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
- package/dist/static/CurrencyNumberInput.js +3 -0
- package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
- package/dist/static/form-number-input/FormNumberInput.js +3 -0
- package/dist/static/number-input/NumberInput.d.ts.map +1 -1
- package/dist/static/number-input/NumberInput.js +3 -0
- package/dist/styles/form/CustomCheckbox.scss +31 -0
- package/dist/styles/iframe-events/Calendar.scss +1 -1
- package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/dist/styles/product-set/ProductSetForm.scss +2 -3
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +1 -3
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -1
- package/dist/zone/form/components/GameDurationControl.js +3 -0
- package/dist/zone/form/components/SortControl.d.ts.map +1 -1
- package/dist/zone/form/components/SortControl.js +3 -0
- package/package.json +12 -6
- package/src/affiliate/form/AffiliateForm.tsx +1 -0
- package/src/auth/Authorizer.tsx +1 -0
- package/src/auth/Login/LoginComponent.tsx +1 -1
- package/src/auth/Router.tsx +19 -19
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +15 -7
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +3 -0
- package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +3 -0
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -1
- package/src/events/event-statistic-modal/EventStatisticModal.tsx +3 -1
- package/src/events/event-statistic-modal/hooks/useTableData.tsx +2 -1
- package/src/events/event-statistic-modal/utils/index.ts +4 -4
- package/src/events/event-venue-map/EventVenueMap.tsx +1 -0
- package/src/events/event-venue-map/hooks/useCanvasSize.ts +5 -1
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.tsx +2 -2
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx +5 -13
- package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +1 -0
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +9 -0
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -0
- package/src/iframe/ryft/utils/ryft-form.ts +6 -5
- package/src/index.ts +0 -1
- package/src/layout/DropDown.tsx +1 -1
- package/src/notification/email-template/control/EmailTemplateControl.tsx +1 -0
- package/src/product-set/control/ProductSetControl.tsx +17 -0
- package/src/product-set/form/ProductCategoriesControl.tsx +3 -0
- package/src/product-set/form/ProductSetForm.tsx +10 -6
- package/src/product-set/form/ProductZonesControl.tsx +1 -4
- package/src/product-set/form/ProductsControl.tsx +6 -7
- package/src/product-set/form/StepsControl.tsx +4 -3
- package/src/product-set/form/SubProductsControl.tsx +1 -3
- package/src/product-set/form/VenueMapsControl.tsx +0 -3
- package/src/product-set/form/context.tsx +2 -5
- package/src/product-set/product/ProductControl.tsx +57 -18
- package/src/product-set/product/advanced-options/AdvancedOptions.tsx +1 -1
- package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +2 -0
- package/src/product-set/product/deposit/ProductDepositControl.tsx +1 -0
- package/src/product-set/product/duration/ProductDurationControl.tsx +2 -0
- package/src/product-set/product/price/ProductPriceControl.tsx +1 -0
- package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +2 -0
- package/src/product-set/product/quantity/ProductQuantityControl.tsx +2 -0
- package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +1 -0
- package/src/product-set/product/scanRange/ProductScanRangeControl.stories.ts +45 -0
- package/src/product-set/product/scanRange/ProductScanRangeControl.tsx +163 -0
- package/src/product-set/product/scanRange/index.ts +1 -0
- package/src/product-set/product-category/ProductCategoryControl.tsx +4 -0
- package/src/product-set/product-zone/ProductZoneControl.tsx +1 -1
- package/src/recurrence-input/RecurrenceEndInput.tsx +1 -0
- package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +1 -0
- package/src/resource/form/components/CapacityControl.tsx +1 -0
- package/src/resource/form/components/SortControl.tsx +1 -0
- package/src/sales/booking/results/components/ResultCard.tsx +0 -2
- package/src/sales/coupon/control/CouponFormControl.tsx +7 -0
- package/src/setting/dashboard/DashboardSettingForm.tsx +1 -0
- package/src/setting/index.ts +0 -2
- package/src/sortable-tree/SortableTreeItem.tsx +1 -6
- package/src/static/CurrencyNumberInput.tsx +1 -0
- package/src/static/form-number-input/FormNumberInput.tsx +1 -0
- package/src/static/number-input/NumberInput.tsx +1 -0
- package/src/styles/form/CustomCheckbox.scss +31 -0
- package/src/styles/iframe-events/Calendar.scss +1 -1
- package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/src/styles/product-set/ProductSetForm.scss +2 -3
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +1 -3
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/zone/form/components/GameDurationControl.tsx +1 -0
- package/src/zone/form/components/SortControl.tsx +1 -0
- package/yarn.lock +827 -877
- package/dist/header/BookeditHeader.d.ts +0 -12
- package/dist/header/BookeditHeader.d.ts.map +0 -1
- package/dist/header/BookeditHeader.js +0 -21
- package/dist/header/Header.d.ts +0 -24
- package/dist/header/Header.d.ts.map +0 -1
- package/dist/header/Header.js +0 -81
- package/dist/header/elements/CompanySelector.d.ts +0 -11
- package/dist/header/elements/CompanySelector.d.ts.map +0 -1
- package/dist/header/elements/CompanySelector.js +0 -36
- package/dist/header/elements/index.d.ts +0 -3
- package/dist/header/elements/index.d.ts.map +0 -1
- package/dist/header/index.d.ts +0 -6
- package/dist/header/index.d.ts.map +0 -1
- package/dist/setting/admin/AdminSettingForm.d.ts +0 -25
- package/dist/setting/admin/AdminSettingForm.d.ts.map +0 -1
- package/dist/setting/admin/AdminSettingForm.js +0 -220
- package/dist/setting/admin/PaymentFeeForm.d.ts +0 -13
- package/dist/setting/admin/PaymentFeeForm.d.ts.map +0 -1
- package/dist/setting/admin/PaymentFeeForm.js +0 -424
- package/dist/setting/admin/index.d.ts +0 -2
- package/dist/setting/admin/index.d.ts.map +0 -1
- package/dist/setting/system/SystemSettingForm.d.ts +0 -10
- package/dist/setting/system/SystemSettingForm.d.ts.map +0 -1
- package/dist/setting/system/SystemSettingForm.js +0 -95
- package/dist/setting/system/index.d.ts +0 -2
- package/dist/setting/system/index.d.ts.map +0 -1
- package/dist/types/currency.d.ts +0 -5
- package/dist/types/currency.d.ts.map +0 -1
- package/src/header/BookeditHeader.tsx +0 -34
- package/src/header/Header.stories.tsx +0 -72
- package/src/header/Header.tsx +0 -107
- package/src/header/elements/CompanySelector.tsx +0 -47
- package/src/header/elements/Elements.stories.tsx +0 -33
- package/src/header/elements/index.ts +0 -3
- package/src/header/index.ts +0 -7
- package/src/setting/admin/AdminSetting.stories.tsx +0 -52
- package/src/setting/admin/AdminSettingForm.tsx +0 -196
- package/src/setting/admin/PaymentFeeForm.tsx +0 -304
- package/src/setting/admin/index.ts +0 -1
- package/src/setting/system/SystemSetting.stories.tsx +0 -26
- package/src/setting/system/SystemSettingForm.tsx +0 -62
- package/src/setting/system/index.ts +0 -1
- package/src/types/currency.ts +0 -4
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
import { useId } from '@react-aria/utils'
|
|
2
|
-
import Card from 'react-bootstrap/Card'
|
|
3
|
-
import Col from 'react-bootstrap/Col'
|
|
4
|
-
import Form from 'react-bootstrap/Form'
|
|
5
|
-
import InputGroup from 'react-bootstrap/InputGroup'
|
|
6
|
-
import Row from 'react-bootstrap/Row'
|
|
7
|
-
import { useFormContext } from 'react-hook-form'
|
|
8
|
-
import { useTranslation } from 'react-i18next'
|
|
9
|
-
import { FaPercentage, FaPoundSign } from 'react-icons/fa'
|
|
10
|
-
import { WarningMessage } from '../../static'
|
|
11
|
-
|
|
12
|
-
export type PaymentFeeFormFieldValues = {
|
|
13
|
-
feeInPercent: number
|
|
14
|
-
minFeeInPounds: number
|
|
15
|
-
maxFeeInPounds: number
|
|
16
|
-
vatInPercent: number
|
|
17
|
-
fixedFee: number
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type PaymentFeeFormProps = {
|
|
21
|
-
isLoading: boolean
|
|
22
|
-
defaultValues?: Partial<PaymentFeeFormFieldValues>
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function PaymentFeeForm({ isLoading = false }: PaymentFeeFormProps) {
|
|
26
|
-
const {
|
|
27
|
-
register,
|
|
28
|
-
formState: { errors },
|
|
29
|
-
watch,
|
|
30
|
-
} = useFormContext<PaymentFeeFormFieldValues>()
|
|
31
|
-
const { t } = useTranslation('Design')
|
|
32
|
-
|
|
33
|
-
const feeInPercentId = useId()
|
|
34
|
-
const minFeeInPoundsId = useId()
|
|
35
|
-
const maxFeeInPoundsId = useId()
|
|
36
|
-
const vatInPercentId = useId()
|
|
37
|
-
const fixedFeeId = useId()
|
|
38
|
-
|
|
39
|
-
const minFee = watch('minFeeInPounds')
|
|
40
|
-
const maxFee = watch('maxFeeInPounds')
|
|
41
|
-
const percentFee = watch('feeInPercent')
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<>
|
|
45
|
-
<Row>
|
|
46
|
-
<Col xs={12}>
|
|
47
|
-
<h5 className='mt-5'>{t('paymentFee')}</h5>
|
|
48
|
-
</Col>
|
|
49
|
-
</Row>
|
|
50
|
-
|
|
51
|
-
<Card className='mb-3'>
|
|
52
|
-
<Card.Body>
|
|
53
|
-
<Row>
|
|
54
|
-
<Col xs={12}>
|
|
55
|
-
<div className='mb-4'>{t('paymentFeeDescription')}</div>
|
|
56
|
-
</Col>
|
|
57
|
-
</Row>
|
|
58
|
-
|
|
59
|
-
<Row>
|
|
60
|
-
<Col xs={12} sm={4} lg={2}>
|
|
61
|
-
<Form.Group controlId={feeInPercentId}>
|
|
62
|
-
<Form.Label>{t('feeInPercent')}</Form.Label>
|
|
63
|
-
|
|
64
|
-
<InputGroup hasValidation>
|
|
65
|
-
<InputGroup.Prepend>
|
|
66
|
-
<InputGroup.Text>
|
|
67
|
-
<FaPercentage size={10} />
|
|
68
|
-
</InputGroup.Text>
|
|
69
|
-
</InputGroup.Prepend>
|
|
70
|
-
|
|
71
|
-
<Form.Control
|
|
72
|
-
type='number'
|
|
73
|
-
min={0}
|
|
74
|
-
max={100}
|
|
75
|
-
step='1'
|
|
76
|
-
placeholder='0'
|
|
77
|
-
{...register('feeInPercent', {
|
|
78
|
-
validate: {
|
|
79
|
-
moreThan: (v) => (v ? v >= 0 : true),
|
|
80
|
-
lessThan: (v) => (v ? v <= 100 : true),
|
|
81
|
-
},
|
|
82
|
-
})}
|
|
83
|
-
name='feeInPercent'
|
|
84
|
-
isInvalid={Boolean(errors.feeInPercent)}
|
|
85
|
-
disabled={isLoading}
|
|
86
|
-
/>
|
|
87
|
-
|
|
88
|
-
<Form.Control.Feedback type='invalid'>
|
|
89
|
-
{errors.feeInPercent?.message}
|
|
90
|
-
{errors.feeInPercent?.type === 'moreThan' &&
|
|
91
|
-
t('Validation:fieldMinNumber', {
|
|
92
|
-
attribute: t('feeInPercent'),
|
|
93
|
-
min: 0,
|
|
94
|
-
})}
|
|
95
|
-
{errors.feeInPercent?.type === 'lessThan' &&
|
|
96
|
-
t('Validation:fieldMaxNumber', {
|
|
97
|
-
attribute: t('feeInPercent'),
|
|
98
|
-
max: 100,
|
|
99
|
-
})}
|
|
100
|
-
</Form.Control.Feedback>
|
|
101
|
-
</InputGroup>
|
|
102
|
-
</Form.Group>
|
|
103
|
-
{percentFee && minFee && maxFee ? (
|
|
104
|
-
<WarningMessage message={t('Validation:fieldPercentFee')} />
|
|
105
|
-
) : null}
|
|
106
|
-
</Col>
|
|
107
|
-
|
|
108
|
-
<Col xs={12} sm={4} lg={2}>
|
|
109
|
-
<Form.Group controlId={minFeeInPoundsId}>
|
|
110
|
-
<Form.Label>{t('minFeeInPounds')}</Form.Label>
|
|
111
|
-
|
|
112
|
-
<InputGroup hasValidation>
|
|
113
|
-
<InputGroup.Prepend>
|
|
114
|
-
<InputGroup.Text>
|
|
115
|
-
<FaPoundSign size={10} />
|
|
116
|
-
</InputGroup.Text>
|
|
117
|
-
</InputGroup.Prepend>
|
|
118
|
-
|
|
119
|
-
<Form.Control
|
|
120
|
-
{...register('minFeeInPounds', {
|
|
121
|
-
validate: {
|
|
122
|
-
moreThan: (v) => (v ? v >= 0 : true),
|
|
123
|
-
lessThan: (v) => (v ? v <= 999999.99 : true),
|
|
124
|
-
},
|
|
125
|
-
})}
|
|
126
|
-
name='minFeeInPounds'
|
|
127
|
-
type='number'
|
|
128
|
-
min={0}
|
|
129
|
-
max={999999.99}
|
|
130
|
-
step='0.01'
|
|
131
|
-
placeholder='0,00'
|
|
132
|
-
isInvalid={Boolean(errors.minFeeInPounds)}
|
|
133
|
-
disabled={isLoading}
|
|
134
|
-
/>
|
|
135
|
-
|
|
136
|
-
<Form.Control.Feedback type='invalid'>
|
|
137
|
-
{errors.minFeeInPounds?.message}
|
|
138
|
-
{errors.minFeeInPounds?.type === 'moreThan' &&
|
|
139
|
-
t('Validation:fieldMinNumber', {
|
|
140
|
-
attribute: t('minFeeInPounds'),
|
|
141
|
-
min: 0,
|
|
142
|
-
})}
|
|
143
|
-
{errors.minFeeInPounds?.type === 'lessThan' &&
|
|
144
|
-
t('Validation:fieldMaxNumber', {
|
|
145
|
-
attribute: t('minFeeInPounds'),
|
|
146
|
-
max: 999999.99,
|
|
147
|
-
})}
|
|
148
|
-
</Form.Control.Feedback>
|
|
149
|
-
</InputGroup>
|
|
150
|
-
</Form.Group>
|
|
151
|
-
</Col>
|
|
152
|
-
|
|
153
|
-
<Col xs={12} sm={4} lg={3}>
|
|
154
|
-
<Form.Group controlId={maxFeeInPoundsId}>
|
|
155
|
-
<Form.Label>{t('maxFeeInPounds')}</Form.Label>
|
|
156
|
-
|
|
157
|
-
<InputGroup hasValidation>
|
|
158
|
-
<InputGroup.Prepend>
|
|
159
|
-
<InputGroup.Text>
|
|
160
|
-
<FaPoundSign size={10} />
|
|
161
|
-
</InputGroup.Text>
|
|
162
|
-
</InputGroup.Prepend>
|
|
163
|
-
|
|
164
|
-
<Form.Control
|
|
165
|
-
{...register('maxFeeInPounds', {
|
|
166
|
-
validate: {
|
|
167
|
-
moreThan: (v) => (v ? v >= 0 : true),
|
|
168
|
-
lessThan: (v) => (v ? v <= 999999.99 : true),
|
|
169
|
-
},
|
|
170
|
-
})}
|
|
171
|
-
name='maxFeeInPounds'
|
|
172
|
-
type='number'
|
|
173
|
-
min={0}
|
|
174
|
-
max={999999.99}
|
|
175
|
-
step='0.01'
|
|
176
|
-
placeholder='0,00'
|
|
177
|
-
isInvalid={Boolean(errors.maxFeeInPounds)}
|
|
178
|
-
disabled={isLoading}
|
|
179
|
-
/>
|
|
180
|
-
|
|
181
|
-
<Form.Control.Feedback type='invalid'>
|
|
182
|
-
{errors.maxFeeInPounds?.message}
|
|
183
|
-
{errors.maxFeeInPounds?.type === 'moreThan' &&
|
|
184
|
-
t('Validation:fieldMinNumber', {
|
|
185
|
-
attribute: t('maxFeeInPounds'),
|
|
186
|
-
min: 0,
|
|
187
|
-
})}
|
|
188
|
-
{errors.maxFeeInPounds?.type === 'lessThan' &&
|
|
189
|
-
t('Validation:fieldMaxNumber', {
|
|
190
|
-
attribute: t('maxFeeInPounds'),
|
|
191
|
-
max: 999999.99,
|
|
192
|
-
})}
|
|
193
|
-
</Form.Control.Feedback>
|
|
194
|
-
</InputGroup>
|
|
195
|
-
</Form.Group>
|
|
196
|
-
{minFee > maxFee ? (
|
|
197
|
-
<WarningMessage
|
|
198
|
-
message={t('Validation:fieldMaxNumber', {
|
|
199
|
-
attribute: t('Min Fee'),
|
|
200
|
-
max: 'Max Fee',
|
|
201
|
-
})}
|
|
202
|
-
/>
|
|
203
|
-
) : null}
|
|
204
|
-
</Col>
|
|
205
|
-
|
|
206
|
-
<Col
|
|
207
|
-
xs={12}
|
|
208
|
-
sm={{ span: 4, offset: 2 }}
|
|
209
|
-
lg={{ span: 2, offset: 0 }}
|
|
210
|
-
>
|
|
211
|
-
<Form.Group controlId={vatInPercentId}>
|
|
212
|
-
<Form.Label>{t('vatInPercent')}</Form.Label>
|
|
213
|
-
|
|
214
|
-
<InputGroup hasValidation>
|
|
215
|
-
<InputGroup.Prepend>
|
|
216
|
-
<InputGroup.Text>
|
|
217
|
-
<FaPercentage size={10} />
|
|
218
|
-
</InputGroup.Text>
|
|
219
|
-
</InputGroup.Prepend>
|
|
220
|
-
|
|
221
|
-
<Form.Control
|
|
222
|
-
{...register('vatInPercent', {
|
|
223
|
-
validate: {
|
|
224
|
-
moreThan: (v) => (v ? v >= 0 : true),
|
|
225
|
-
lessThan: (v) => (v ? v <= 100 : true),
|
|
226
|
-
},
|
|
227
|
-
})}
|
|
228
|
-
name='vatInPercent'
|
|
229
|
-
type='number'
|
|
230
|
-
min={0}
|
|
231
|
-
max={100}
|
|
232
|
-
step='1'
|
|
233
|
-
placeholder='0'
|
|
234
|
-
isInvalid={Boolean(errors.vatInPercent)}
|
|
235
|
-
disabled={isLoading}
|
|
236
|
-
/>
|
|
237
|
-
|
|
238
|
-
<Form.Control.Feedback type='invalid'>
|
|
239
|
-
{errors.vatInPercent?.message}
|
|
240
|
-
{errors.vatInPercent?.type === 'moreThan' &&
|
|
241
|
-
t('Validation:fieldMinNumber', {
|
|
242
|
-
attribute: t('vatInPercent'),
|
|
243
|
-
min: 0,
|
|
244
|
-
})}
|
|
245
|
-
{errors.vatInPercent?.type === 'lessThan' &&
|
|
246
|
-
t('Validation:fieldMaxNumber', {
|
|
247
|
-
attribute: t('vatInPercent'),
|
|
248
|
-
max: 100,
|
|
249
|
-
})}
|
|
250
|
-
</Form.Control.Feedback>
|
|
251
|
-
</InputGroup>
|
|
252
|
-
</Form.Group>
|
|
253
|
-
</Col>
|
|
254
|
-
|
|
255
|
-
<Col xs={12} sm={4} lg={3}>
|
|
256
|
-
<Form.Group controlId={fixedFeeId}>
|
|
257
|
-
<Form.Label>{t('fixedFee')}</Form.Label>
|
|
258
|
-
|
|
259
|
-
<InputGroup hasValidation>
|
|
260
|
-
<InputGroup.Prepend>
|
|
261
|
-
<InputGroup.Text>
|
|
262
|
-
<FaPoundSign size={10} />
|
|
263
|
-
</InputGroup.Text>
|
|
264
|
-
</InputGroup.Prepend>
|
|
265
|
-
|
|
266
|
-
<Form.Control
|
|
267
|
-
{...register('fixedFee', {
|
|
268
|
-
validate: {
|
|
269
|
-
moreThan: (v) => (v ? v >= 0 : true),
|
|
270
|
-
lessThan: (v) => (v ? v <= 999999.99 : true),
|
|
271
|
-
},
|
|
272
|
-
})}
|
|
273
|
-
name='fixedFee'
|
|
274
|
-
type='number'
|
|
275
|
-
min={0}
|
|
276
|
-
max={999999.99}
|
|
277
|
-
step='0.01'
|
|
278
|
-
placeholder='0,00'
|
|
279
|
-
isInvalid={Boolean(errors.fixedFee)}
|
|
280
|
-
disabled={isLoading}
|
|
281
|
-
/>
|
|
282
|
-
|
|
283
|
-
<Form.Control.Feedback type='invalid'>
|
|
284
|
-
{errors.fixedFee?.message}
|
|
285
|
-
{errors.fixedFee?.type === 'moreThan' &&
|
|
286
|
-
t('Validation:fieldMinNumber', {
|
|
287
|
-
attribute: t('fixedFee'),
|
|
288
|
-
min: 0,
|
|
289
|
-
})}
|
|
290
|
-
{errors.fixedFee?.type === 'lessThan' &&
|
|
291
|
-
t('Validation:fieldMaxNumber', {
|
|
292
|
-
attribute: t('fixedFee'),
|
|
293
|
-
max: 999999.99,
|
|
294
|
-
})}
|
|
295
|
-
</Form.Control.Feedback>
|
|
296
|
-
</InputGroup>
|
|
297
|
-
</Form.Group>
|
|
298
|
-
</Col>
|
|
299
|
-
</Row>
|
|
300
|
-
</Card.Body>
|
|
301
|
-
</Card>
|
|
302
|
-
</>
|
|
303
|
-
)
|
|
304
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './AdminSettingForm'
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Meta } from '@storybook/react'
|
|
2
|
-
import Container from 'react-bootstrap/Container'
|
|
3
|
-
import { SystemSettingForm } from './SystemSettingForm'
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Setting/System',
|
|
7
|
-
} as Meta
|
|
8
|
-
|
|
9
|
-
export function Default() {
|
|
10
|
-
return (
|
|
11
|
-
<Container>
|
|
12
|
-
<SystemSettingForm
|
|
13
|
-
isLoading={false}
|
|
14
|
-
onSubmit={(data) => console.log('onSubmit', data)}
|
|
15
|
-
defaultValues={{
|
|
16
|
-
feeInPercent: NaN,
|
|
17
|
-
minFeeInPounds: NaN,
|
|
18
|
-
maxFeeInPounds: NaN,
|
|
19
|
-
vatInPercent: NaN,
|
|
20
|
-
fixedFee: NaN,
|
|
21
|
-
}}
|
|
22
|
-
hasPermission
|
|
23
|
-
/>
|
|
24
|
-
</Container>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Button, Spinner } from 'react-bootstrap'
|
|
2
|
-
import Form from 'react-bootstrap/Form'
|
|
3
|
-
import { FormProvider, useForm } from 'react-hook-form'
|
|
4
|
-
import { useTranslation } from 'react-i18next'
|
|
5
|
-
import { HasPermissionProp } from '@licklist/plugins/dist/types/permission/Permission'
|
|
6
|
-
import {
|
|
7
|
-
PaymentFeeForm,
|
|
8
|
-
PaymentFeeFormFieldValues,
|
|
9
|
-
} from '../admin/PaymentFeeForm'
|
|
10
|
-
|
|
11
|
-
export type SystemSettingFormFieldValues = PaymentFeeFormFieldValues
|
|
12
|
-
|
|
13
|
-
export interface SystemSettingFormProps extends HasPermissionProp {
|
|
14
|
-
isLoading: boolean
|
|
15
|
-
onSubmit?: (data: SystemSettingFormFieldValues) => void
|
|
16
|
-
defaultValues?: Partial<SystemSettingFormFieldValues>
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function SystemSettingForm(props: SystemSettingFormProps) {
|
|
20
|
-
const {
|
|
21
|
-
isLoading = false,
|
|
22
|
-
defaultValues = {},
|
|
23
|
-
onSubmit,
|
|
24
|
-
hasPermission = true,
|
|
25
|
-
} = props
|
|
26
|
-
const form = useForm<SystemSettingFormFieldValues>({
|
|
27
|
-
mode: 'onChange',
|
|
28
|
-
defaultValues,
|
|
29
|
-
})
|
|
30
|
-
const { handleSubmit } = form
|
|
31
|
-
const { t } = useTranslation('Design')
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<Form
|
|
35
|
-
className='d-flex flex-column'
|
|
36
|
-
noValidate
|
|
37
|
-
onSubmit={handleSubmit(onSubmit)}
|
|
38
|
-
>
|
|
39
|
-
<FormProvider {...form}>
|
|
40
|
-
<PaymentFeeForm {...props} />
|
|
41
|
-
</FormProvider>
|
|
42
|
-
{hasPermission && (
|
|
43
|
-
<Button
|
|
44
|
-
type='submit'
|
|
45
|
-
disabled={isLoading}
|
|
46
|
-
className='d-flex align-items-center align-self-end mt-5'
|
|
47
|
-
>
|
|
48
|
-
{isLoading && (
|
|
49
|
-
<Spinner
|
|
50
|
-
animation='border'
|
|
51
|
-
size='sm'
|
|
52
|
-
role='status'
|
|
53
|
-
aria-hidden='true'
|
|
54
|
-
className='mr-2'
|
|
55
|
-
/>
|
|
56
|
-
)}
|
|
57
|
-
{t('update')}
|
|
58
|
-
</Button>
|
|
59
|
-
)}
|
|
60
|
-
</Form>
|
|
61
|
-
)
|
|
62
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SystemSettingForm'
|
package/src/types/currency.ts
DELETED