@licklist/design 0.72.72-dev.0 → 0.72.72-dev.2
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/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
- package/dist/index.js +0 -2
- package/dist/product-set/product/ProductControl.d.ts +2 -2
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +4 -53
- package/dist/product-set/utils/index.d.ts +1 -1
- package/dist/setting/index.d.ts +0 -2
- package/dist/setting/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/product-set/product/Product.stories.tsx +1 -1
- package/src/product-set/product/ProductControl.tsx +3 -55
- package/src/setting/index.ts +0 -2
- package/yarn.lock +26 -26
- 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 -439
- 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/setting/admin/AdminSetting.stories.tsx +0 -52
- package/src/setting/admin/AdminSettingForm.tsx +0 -196
- package/src/setting/admin/PaymentFeeForm.tsx +0 -309
- 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
|
@@ -29,7 +29,6 @@ import 'react-bootstrap/Button';
|
|
|
29
29
|
import 'react-bootstrap/OverlayTrigger';
|
|
30
30
|
import 'react-bootstrap/Popover';
|
|
31
31
|
import '@licklist/plugins/dist/services/Form/HookFormService';
|
|
32
|
-
import '@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper';
|
|
33
32
|
import 'react-bootstrap/Collapse';
|
|
34
33
|
import '@licklist/plugins/dist/hooks/Media/useImages';
|
|
35
34
|
import '@licklist/core/dist/DataMapper/Media/ImageDataMapper';
|
|
@@ -74,6 +73,7 @@ import '../../../../../iframe/payment/payment-status-page/PaymentStatusPage.js';
|
|
|
74
73
|
import '@licklist/core/dist/DataMapper/Provider/SnippetDataMapper';
|
|
75
74
|
import '../../../../../static/manual-date-picker/constants/index.js';
|
|
76
75
|
import '../../../../../iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js';
|
|
76
|
+
import '@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper';
|
|
77
77
|
import '../../../../../sortable-tree/SortableTree.js';
|
|
78
78
|
import '@dnd-kit/core';
|
|
79
79
|
import '@dnd-kit/sortable';
|
package/dist/index.js
CHANGED
|
@@ -136,8 +136,6 @@ export { RyftPayment } from './sales/payment-form/components/RyftPayment/RyftPay
|
|
|
136
136
|
export { BookingResults } from './sales/booking/results/BookingResults.js';
|
|
137
137
|
export { BACKGROUND_COLOR_CLASSNAMES } from './sales/booking/results/constants.js';
|
|
138
138
|
export { NotesTable } from './sales/notes/NotesTable.js';
|
|
139
|
-
export { SystemSettingForm } from './setting/system/SystemSettingForm.js';
|
|
140
|
-
export { AdminSettingForm } from './setting/admin/AdminSettingForm.js';
|
|
141
139
|
export { DashboardSettingForm } from './setting/dashboard/DashboardSettingForm.js';
|
|
142
140
|
export { SnippetCard } from './setting/dashboard/snippets/card/SnippetCard.js';
|
|
143
141
|
export { SnippetTemplateCard } from './setting/dashboard/snippet-templates/card/SnippetTemplateCard.js';
|
|
@@ -28,7 +28,7 @@ export interface ProductControlValues extends FormValues, ProductDepositControlV
|
|
|
28
28
|
originalProductId: number | null;
|
|
29
29
|
isUnlimited: boolean;
|
|
30
30
|
isRequired: boolean;
|
|
31
|
-
quantitySelector
|
|
31
|
+
quantitySelector?: number;
|
|
32
32
|
hasSpecialNotes: boolean;
|
|
33
33
|
minSpend?: number | null;
|
|
34
34
|
type?: ProductType;
|
|
@@ -54,5 +54,5 @@ export interface ProductControlProps<T> extends IsDeletableEvent, FieldNamePrefi
|
|
|
54
54
|
categoryType?: CategoryType;
|
|
55
55
|
isOverrides?: boolean;
|
|
56
56
|
}
|
|
57
|
-
export declare function ProductControl<T extends FormValues>({ isLoading, fieldNamePrefix, allowDeposits, hasBookingManagement, zoneList, onCopy, onProductNameChange, productName,
|
|
57
|
+
export declare function ProductControl<T extends FormValues>({ isLoading, fieldNamePrefix, allowDeposits, hasBookingManagement, zoneList, onCopy, onProductNameChange, productName, categoryType, isOverrides, }: ProductControlProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
58
58
|
//# sourceMappingURL=ProductControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/product/ProductControl.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,YAAY,EAIb,MAAM,kEAAkE,CAAA;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,0DAA0D,CAAA;AAGtF,OAAO,EACL,mBAAmB,EACnB,UAAU,EACX,MAAM,8DAA8D,CAAA;AAErE,OAAO,EACL,WAAW,EAKZ,MAAM,OAAO,CAAA;AAed,OAAO,EACL,KAAK,EAEN,MAAM,sDAAsD,CAAA;
|
|
1
|
+
{"version":3,"file":"ProductControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/product/ProductControl.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,YAAY,EAIb,MAAM,kEAAkE,CAAA;AACzE,OAA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ST_DTO, QUANTITY_TYPE_CONSTANT, QUANTITY_TYPE_RECHARGING } from '@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper';
|
|
3
2
|
import HookFormService from '@licklist/plugins/dist/services/Form/HookFormService';
|
|
4
3
|
import clsx from 'clsx';
|
|
5
4
|
import { useId } from '@react-aria/utils';
|
|
@@ -8,7 +7,7 @@ import { Form, Button } from 'react-bootstrap';
|
|
|
8
7
|
import Col from 'react-bootstrap/Col';
|
|
9
8
|
import Collapse from 'react-bootstrap/Collapse';
|
|
10
9
|
import Row from 'react-bootstrap/Row';
|
|
11
|
-
import { useFormContext,
|
|
10
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
12
11
|
import { useTranslation } from 'react-i18next';
|
|
13
12
|
import { useImages } from '@licklist/plugins/dist/hooks/Media/useImages';
|
|
14
13
|
import { IMAGE_TYPE_IMAGE } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper';
|
|
@@ -22,7 +21,7 @@ import { ProductSetLoadingContext } from '../form/context.js';
|
|
|
22
21
|
import { ProductBookingManagementControl } from './booking-management/ProductBookingManagementControl.js';
|
|
23
22
|
import { ProductDepositControl } from './deposit/ProductDepositControl.js';
|
|
24
23
|
import { ProductQuantityControl } from './quantity/ProductQuantityControl.js';
|
|
25
|
-
import
|
|
24
|
+
import 'react-bootstrap/InputGroup';
|
|
26
25
|
import { ProductQuantityRechargingControl } from './quantity/ProductQuantityRechargingControl.js';
|
|
27
26
|
import { TipTapEditor } from '../../tiptap-editor/TipTapEditor.js';
|
|
28
27
|
import { ProductPriceControl } from './price/ProductPriceControl.js';
|
|
@@ -130,7 +129,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
130
129
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
131
130
|
}
|
|
132
131
|
function ProductControl(param) {
|
|
133
|
-
var _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, fieldNamePrefix = param.fieldNamePrefix, _param_allowDeposits = param.allowDeposits, allowDeposits = _param_allowDeposits === void 0 ? false : _param_allowDeposits, _param_hasBookingManagement = param.hasBookingManagement, hasBookingManagement = _param_hasBookingManagement === void 0 ? false : _param_hasBookingManagement, _param_zoneList = param.zoneList, zoneList = _param_zoneList === void 0 ? [] : _param_zoneList, onCopy = param.onCopy, onProductNameChange = param.onProductNameChange, productName = param.productName,
|
|
132
|
+
var _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, fieldNamePrefix = param.fieldNamePrefix, _param_allowDeposits = param.allowDeposits, allowDeposits = _param_allowDeposits === void 0 ? false : _param_allowDeposits, _param_hasBookingManagement = param.hasBookingManagement, hasBookingManagement = _param_hasBookingManagement === void 0 ? false : _param_hasBookingManagement, _param_zoneList = param.zoneList, zoneList = _param_zoneList === void 0 ? [] : _param_zoneList, onCopy = param.onCopy, onProductNameChange = param.onProductNameChange, productName = param.productName, categoryType = param.categoryType, _param_isOverrides = param.isOverrides, isOverrides = _param_isOverrides === void 0 ? false : _param_isOverrides;
|
|
134
133
|
var _useFormContext = useFormContext(), register = _useFormContext.register, control = _useFormContext.control, errors = _useFormContext.formState.errors, setValue = _useFormContext.setValue, getValues = _useFormContext.getValues, watch = _useFormContext.watch;
|
|
135
134
|
var _useContext = useContext(ProductSetLoadingContext), setLoading = _useContext.setLoading, modifiersSetList = _useContext.modifiersSetList;
|
|
136
135
|
var t = useTranslation([
|
|
@@ -147,28 +146,13 @@ function ProductControl(param) {
|
|
|
147
146
|
var descriptionId = useId();
|
|
148
147
|
var isAvailableId = useId();
|
|
149
148
|
var isSoldOutId = useId();
|
|
150
|
-
var quantitySelectorId = useId();
|
|
151
149
|
var unlimitedQuantityId = useId();
|
|
152
150
|
var isZoneCategory = checkIfZoneCategory(categoryType);
|
|
153
|
-
var quantitySelectorList = [
|
|
154
|
-
{
|
|
155
|
-
id: 1,
|
|
156
|
-
value: t('quantitySelector')
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
id: 2,
|
|
160
|
-
value: t('stockControl')
|
|
161
|
-
}
|
|
162
|
-
];
|
|
163
151
|
var handleExpand = useCallback(function() {
|
|
164
152
|
return setExpanded(function(prevExpanded) {
|
|
165
153
|
return !prevExpanded;
|
|
166
154
|
});
|
|
167
155
|
}, []);
|
|
168
|
-
var quantityValue = useWatch({
|
|
169
|
-
control: control,
|
|
170
|
-
name: "".concat(fieldNamePrefix, ".quantitySelector")
|
|
171
|
-
});
|
|
172
156
|
var _useImages = useImages(initialImages), images = _useImages.images, handleImageRemove = _useImages.handleImageRemove, handleImageUploading = _useImages.handleImageUploading, isImageUploading = _useImages.isLoading;
|
|
173
157
|
var onFilesChange = useCallback(function(files) {
|
|
174
158
|
handleImageUploading(files, IMAGE_TYPE_IMAGE);
|
|
@@ -206,8 +190,6 @@ function ProductControl(param) {
|
|
|
206
190
|
fieldNamePrefix,
|
|
207
191
|
setValue
|
|
208
192
|
]);
|
|
209
|
-
var quantitySelector = quantityValue !== null && quantityValue !== void 0 ? quantityValue : '1';
|
|
210
|
-
var quantity = QUANTITY_TYPE_LIST_DTO[quantitySelector];
|
|
211
193
|
var modifierList = convertToTypeaheadOptions(modifiersSetList);
|
|
212
194
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
213
195
|
children: [
|
|
@@ -294,13 +276,7 @@ function ProductControl(param) {
|
|
|
294
276
|
isOverrides: isOverrides,
|
|
295
277
|
onFocus: onFocus
|
|
296
278
|
}),
|
|
297
|
-
|
|
298
|
-
isLoading: isLoading,
|
|
299
|
-
fieldNamePrefix: fieldNamePrefix,
|
|
300
|
-
onFocus: onFocus,
|
|
301
|
-
disabled: isUnlimited
|
|
302
|
-
}),
|
|
303
|
-
quantity === QUANTITY_TYPE_RECHARGING && /*#__PURE__*/ jsx(ProductQuantityRechargingControl, {
|
|
279
|
+
/*#__PURE__*/ jsx(ProductQuantityRechargingControl, {
|
|
304
280
|
isLoading: isLoading,
|
|
305
281
|
fieldNamePrefix: fieldNamePrefix,
|
|
306
282
|
onFocus: onFocus,
|
|
@@ -323,31 +299,6 @@ function ProductControl(param) {
|
|
|
323
299
|
]
|
|
324
300
|
})
|
|
325
301
|
]
|
|
326
|
-
}),
|
|
327
|
-
/*#__PURE__*/ jsxs(Form.Group, {
|
|
328
|
-
controlId: quantitySelectorId,
|
|
329
|
-
children: [
|
|
330
|
-
/*#__PURE__*/ jsx(Form.Label, {
|
|
331
|
-
children: t('quantitySelectorType')
|
|
332
|
-
}),
|
|
333
|
-
/*#__PURE__*/ jsx(Form.Control, _object_spread_props(_object_spread({
|
|
334
|
-
as: "select",
|
|
335
|
-
defaultValue: hasTicket ? quantitySelectorList[0].id : undefined
|
|
336
|
-
}, register("".concat(fieldNamePrefix, ".quantitySelector"))), {
|
|
337
|
-
isInvalid: HookFormService.isInvalid("".concat(fieldNamePrefix, ".quantitySelector"), errors),
|
|
338
|
-
disabled: isLoading || hasTicket || isOverrides,
|
|
339
|
-
children: quantitySelectorList.map(function(selector) {
|
|
340
|
-
return /*#__PURE__*/ jsx("option", {
|
|
341
|
-
value: selector.id,
|
|
342
|
-
children: selector.value
|
|
343
|
-
}, selector.id);
|
|
344
|
-
})
|
|
345
|
-
})),
|
|
346
|
-
/*#__PURE__*/ jsx(Form.Control.Feedback, {
|
|
347
|
-
type: "invalid",
|
|
348
|
-
children: HookFormService.getErrors("".concat(fieldNamePrefix, ".quantitySelector"), errors)
|
|
349
|
-
})
|
|
350
|
-
]
|
|
351
302
|
})
|
|
352
303
|
]
|
|
353
304
|
})
|
|
@@ -44,7 +44,7 @@ export declare const updateModifiersSetAtProductSetForm: (data: ProductSetFormVa
|
|
|
44
44
|
originalProductId: number | null;
|
|
45
45
|
isUnlimited: boolean;
|
|
46
46
|
isRequired: boolean;
|
|
47
|
-
quantitySelector
|
|
47
|
+
quantitySelector?: number;
|
|
48
48
|
hasSpecialNotes: boolean;
|
|
49
49
|
minSpend?: number | null;
|
|
50
50
|
type?: import("@licklist/core/dist/DataMapper/Product/ProductDataMapper").ProductType;
|
package/dist/setting/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/setting/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/setting/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
package/package.json
CHANGED
|
@@ -44,7 +44,6 @@ import { convertToTypeaheadOptions } from 'src/sales/coupon/utils'
|
|
|
44
44
|
import { checkIfZoneCategory } from '@licklist/plugins'
|
|
45
45
|
import { FileUpload } from '../../file-upload'
|
|
46
46
|
import { BooleanSwitch } from '../../static'
|
|
47
|
-
import { SelectItem } from '../../types/generic/SelectItem'
|
|
48
47
|
import { ProductSetLoadingContext } from '../form/context'
|
|
49
48
|
import {
|
|
50
49
|
ProductBookingManagementControl,
|
|
@@ -55,7 +54,6 @@ import {
|
|
|
55
54
|
ProductDepositControlValues,
|
|
56
55
|
} from './deposit/ProductDepositControl'
|
|
57
56
|
import {
|
|
58
|
-
ProductQuantityConstantControl,
|
|
59
57
|
ProductQuantityControl,
|
|
60
58
|
ProductQuantityRechargingControl,
|
|
61
59
|
} from './quantity'
|
|
@@ -94,7 +92,7 @@ export interface ProductControlValues
|
|
|
94
92
|
originalProductId: number | null
|
|
95
93
|
isUnlimited: boolean
|
|
96
94
|
isRequired: boolean
|
|
97
|
-
quantitySelector
|
|
95
|
+
quantitySelector?: number
|
|
98
96
|
hasSpecialNotes: boolean
|
|
99
97
|
minSpend?: number | null
|
|
100
98
|
type?: ProductType
|
|
@@ -135,7 +133,6 @@ export function ProductControl<T extends FormValues>({
|
|
|
135
133
|
onCopy,
|
|
136
134
|
onProductNameChange,
|
|
137
135
|
productName,
|
|
138
|
-
hasTicket,
|
|
139
136
|
categoryType,
|
|
140
137
|
isOverrides = false,
|
|
141
138
|
}: ProductControlProps<T>) {
|
|
@@ -165,26 +162,15 @@ export function ProductControl<T extends FormValues>({
|
|
|
165
162
|
const descriptionId = useId()
|
|
166
163
|
const isAvailableId = useId()
|
|
167
164
|
const isSoldOutId = useId()
|
|
168
|
-
const quantitySelectorId = useId()
|
|
169
165
|
const unlimitedQuantityId = useId()
|
|
170
166
|
|
|
171
167
|
const isZoneCategory = checkIfZoneCategory(categoryType)
|
|
172
168
|
|
|
173
|
-
const quantitySelectorList: SelectItem[] = [
|
|
174
|
-
{ id: 1, value: t('quantitySelector') },
|
|
175
|
-
{ id: 2, value: t('stockControl') },
|
|
176
|
-
]
|
|
177
|
-
|
|
178
169
|
const handleExpand = useCallback(
|
|
179
170
|
() => setExpanded((prevExpanded) => !prevExpanded),
|
|
180
171
|
[],
|
|
181
172
|
)
|
|
182
173
|
|
|
183
|
-
const quantityValue = useWatch({
|
|
184
|
-
control,
|
|
185
|
-
name: `${fieldNamePrefix}.quantitySelector` as Path<T>,
|
|
186
|
-
})
|
|
187
|
-
|
|
188
174
|
const {
|
|
189
175
|
images,
|
|
190
176
|
handleImageRemove,
|
|
@@ -227,9 +213,6 @@ export function ProductControl<T extends FormValues>({
|
|
|
227
213
|
}
|
|
228
214
|
}, [images, fieldNamePrefix, setValue])
|
|
229
215
|
|
|
230
|
-
const quantitySelector = quantityValue ?? '1'
|
|
231
|
-
const quantity = QUANTITY_TYPE_LIST_DTO[quantitySelector as string]
|
|
232
|
-
|
|
233
216
|
const modifierList = convertToTypeaheadOptions(modifiersSetList)
|
|
234
217
|
|
|
235
218
|
return (
|
|
@@ -315,23 +298,14 @@ export function ProductControl<T extends FormValues>({
|
|
|
315
298
|
isOverrides={isOverrides}
|
|
316
299
|
onFocus={onFocus}
|
|
317
300
|
/>
|
|
318
|
-
|
|
319
|
-
{quantity === QUANTITY_TYPE_CONSTANT && (
|
|
320
|
-
<ProductQuantityConstantControl<T>
|
|
321
|
-
isLoading={isLoading}
|
|
322
|
-
fieldNamePrefix={fieldNamePrefix}
|
|
323
|
-
onFocus={onFocus}
|
|
324
|
-
disabled={isUnlimited}
|
|
325
|
-
/>
|
|
326
|
-
)}
|
|
327
|
-
{quantity === QUANTITY_TYPE_RECHARGING && (
|
|
301
|
+
|
|
328
302
|
<ProductQuantityRechargingControl<T>
|
|
329
303
|
isLoading={isLoading}
|
|
330
304
|
fieldNamePrefix={fieldNamePrefix}
|
|
331
305
|
onFocus={onFocus}
|
|
332
306
|
disabled={isUnlimited}
|
|
333
307
|
/>
|
|
334
|
-
|
|
308
|
+
|
|
335
309
|
<Form.Group
|
|
336
310
|
controlId={unlimitedQuantityId}
|
|
337
311
|
className='custom-checkbox'
|
|
@@ -346,32 +320,6 @@ export function ProductControl<T extends FormValues>({
|
|
|
346
320
|
<Form.Check.Label>{t('isUnlimited')}</Form.Check.Label>
|
|
347
321
|
</Form.Group>
|
|
348
322
|
</div>
|
|
349
|
-
|
|
350
|
-
<Form.Group controlId={quantitySelectorId}>
|
|
351
|
-
<Form.Label>{t('quantitySelectorType')}</Form.Label>
|
|
352
|
-
<Form.Control
|
|
353
|
-
as='select'
|
|
354
|
-
defaultValue={hasTicket ? quantitySelectorList[0].id : undefined}
|
|
355
|
-
{...register(`${fieldNamePrefix}.quantitySelector` as Path<T>)}
|
|
356
|
-
isInvalid={HookFormService.isInvalid<T>(
|
|
357
|
-
`${fieldNamePrefix}.quantitySelector` as Path<T>,
|
|
358
|
-
errors,
|
|
359
|
-
)}
|
|
360
|
-
disabled={isLoading || hasTicket || isOverrides}
|
|
361
|
-
>
|
|
362
|
-
{quantitySelectorList.map((selector) => (
|
|
363
|
-
<option value={selector.id} key={selector.id}>
|
|
364
|
-
{selector.value}
|
|
365
|
-
</option>
|
|
366
|
-
))}
|
|
367
|
-
</Form.Control>
|
|
368
|
-
<Form.Control.Feedback type='invalid'>
|
|
369
|
-
{HookFormService.getErrors<T>(
|
|
370
|
-
`${fieldNamePrefix}.quantitySelector` as Path<T>,
|
|
371
|
-
errors,
|
|
372
|
-
)}
|
|
373
|
-
</Form.Control.Feedback>
|
|
374
|
-
</Form.Group>
|
|
375
323
|
</Col>
|
|
376
324
|
</Row>
|
|
377
325
|
<Row>
|
package/src/setting/index.ts
CHANGED
package/yarn.lock
CHANGED
|
@@ -5419,11 +5419,11 @@ __metadata:
|
|
|
5419
5419
|
linkType: hard
|
|
5420
5420
|
|
|
5421
5421
|
"@types/babel__generator@npm:*":
|
|
5422
|
-
version: 7.
|
|
5423
|
-
resolution: "@types/babel__generator@npm:7.
|
|
5422
|
+
version: 7.27.0
|
|
5423
|
+
resolution: "@types/babel__generator@npm:7.27.0"
|
|
5424
5424
|
dependencies:
|
|
5425
5425
|
"@babel/types": "npm:^7.0.0"
|
|
5426
|
-
checksum: 10c0/
|
|
5426
|
+
checksum: 10c0/9f9e959a8792df208a9d048092fda7e1858bddc95c6314857a8211a99e20e6830bdeb572e3587ae8be5429e37f2a96fcf222a9f53ad232f5537764c9e13a2bbd
|
|
5427
5427
|
languageName: node
|
|
5428
5428
|
linkType: hard
|
|
5429
5429
|
|
|
@@ -5699,11 +5699,11 @@ __metadata:
|
|
|
5699
5699
|
linkType: hard
|
|
5700
5700
|
|
|
5701
5701
|
"@types/node@npm:*":
|
|
5702
|
-
version: 22.
|
|
5703
|
-
resolution: "@types/node@npm:22.
|
|
5702
|
+
version: 22.14.0
|
|
5703
|
+
resolution: "@types/node@npm:22.14.0"
|
|
5704
5704
|
dependencies:
|
|
5705
|
-
undici-types: "npm:~6.
|
|
5706
|
-
checksum: 10c0/
|
|
5705
|
+
undici-types: "npm:~6.21.0"
|
|
5706
|
+
checksum: 10c0/9d79f3fa1af9c2c869514f419c4a4905b34c10e12915582fd1784868ac4e74c6d306cf5eb47ef889b6750ab85a31be96618227b86739c4a3e0b1c15063f384c6
|
|
5707
5707
|
languageName: node
|
|
5708
5708
|
linkType: hard
|
|
5709
5709
|
|
|
@@ -8078,9 +8078,9 @@ __metadata:
|
|
|
8078
8078
|
linkType: hard
|
|
8079
8079
|
|
|
8080
8080
|
"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001109, caniuse-lite@npm:^1.0.30001125, caniuse-lite@npm:^1.0.30001646, caniuse-lite@npm:^1.0.30001688":
|
|
8081
|
-
version: 1.0.
|
|
8082
|
-
resolution: "caniuse-lite@npm:1.0.
|
|
8083
|
-
checksum: 10c0/
|
|
8081
|
+
version: 1.0.30001712
|
|
8082
|
+
resolution: "caniuse-lite@npm:1.0.30001712"
|
|
8083
|
+
checksum: 10c0/b3df8bdcc3335969380c2e47acb36c89bfc7f8fb4ef7ee2a5380e30ba46aa69e9d411654bc29894a06c201a1d60d490ab9b92787f3b66d7a7a38d71360e68215
|
|
8084
8084
|
languageName: node
|
|
8085
8085
|
linkType: hard
|
|
8086
8086
|
|
|
@@ -8223,8 +8223,8 @@ __metadata:
|
|
|
8223
8223
|
linkType: hard
|
|
8224
8224
|
|
|
8225
8225
|
"chromatic@npm:^11.4.0":
|
|
8226
|
-
version: 11.
|
|
8227
|
-
resolution: "chromatic@npm:11.
|
|
8226
|
+
version: 11.28.0
|
|
8227
|
+
resolution: "chromatic@npm:11.28.0"
|
|
8228
8228
|
peerDependencies:
|
|
8229
8229
|
"@chromatic-com/cypress": ^0.*.* || ^1.0.0
|
|
8230
8230
|
"@chromatic-com/playwright": ^0.*.* || ^1.0.0
|
|
@@ -8237,7 +8237,7 @@ __metadata:
|
|
|
8237
8237
|
chroma: dist/bin.js
|
|
8238
8238
|
chromatic: dist/bin.js
|
|
8239
8239
|
chromatic-cli: dist/bin.js
|
|
8240
|
-
checksum: 10c0/
|
|
8240
|
+
checksum: 10c0/ae0bb035e531852f9a6dbd5be133a2a4759ef39ece13fcbcdf635db4de0129f7bca8f58f7a0411a7eafb4dc09319df6aaece5646d9944ee4347ee0e38de52d65
|
|
8241
8241
|
languageName: node
|
|
8242
8242
|
linkType: hard
|
|
8243
8243
|
|
|
@@ -9867,9 +9867,9 @@ __metadata:
|
|
|
9867
9867
|
linkType: hard
|
|
9868
9868
|
|
|
9869
9869
|
"electron-to-chromium@npm:^1.3.564, electron-to-chromium@npm:^1.5.73":
|
|
9870
|
-
version: 1.5.
|
|
9871
|
-
resolution: "electron-to-chromium@npm:1.5.
|
|
9872
|
-
checksum: 10c0/
|
|
9870
|
+
version: 1.5.134
|
|
9871
|
+
resolution: "electron-to-chromium@npm:1.5.134"
|
|
9872
|
+
checksum: 10c0/ba0c8b3a86e139b142ce797e807f3a7b4b5708d8a550d820cc5467bf22fc62517fa9c2a38c4fec975c96f321f18918be1bcae41687f1715889a0ac6122fbfa6d
|
|
9873
9873
|
languageName: node
|
|
9874
9874
|
linkType: hard
|
|
9875
9875
|
|
|
@@ -17062,13 +17062,13 @@ __metadata:
|
|
|
17062
17062
|
linkType: hard
|
|
17063
17063
|
|
|
17064
17064
|
"prosemirror-view@npm:^1.0.0, prosemirror-view@npm:^1.1.0, prosemirror-view@npm:^1.23.6, prosemirror-view@npm:^1.27.0, prosemirror-view@npm:^1.28.2, prosemirror-view@npm:^1.31.0, prosemirror-view@npm:^1.37.2":
|
|
17065
|
-
version: 1.
|
|
17066
|
-
resolution: "prosemirror-view@npm:1.
|
|
17065
|
+
version: 1.39.1
|
|
17066
|
+
resolution: "prosemirror-view@npm:1.39.1"
|
|
17067
17067
|
dependencies:
|
|
17068
17068
|
prosemirror-model: "npm:^1.20.0"
|
|
17069
17069
|
prosemirror-state: "npm:^1.0.0"
|
|
17070
17070
|
prosemirror-transform: "npm:^1.1.0"
|
|
17071
|
-
checksum: 10c0/
|
|
17071
|
+
checksum: 10c0/44e641a51f741449c4065708ba5d7e28a1d777daf50260563e4fd2072c6d90157a5ac4b0ed18ea97ec8c5805ffa8eda6fa05b0667b71fc244393f45cd4d7c8d0
|
|
17072
17072
|
languageName: node
|
|
17073
17073
|
linkType: hard
|
|
17074
17074
|
|
|
@@ -21056,9 +21056,9 @@ __metadata:
|
|
|
21056
21056
|
linkType: hard
|
|
21057
21057
|
|
|
21058
21058
|
"ufo@npm:^1.5.4":
|
|
21059
|
-
version: 1.
|
|
21060
|
-
resolution: "ufo@npm:1.
|
|
21061
|
-
checksum: 10c0/
|
|
21059
|
+
version: 1.6.1
|
|
21060
|
+
resolution: "ufo@npm:1.6.1"
|
|
21061
|
+
checksum: 10c0/5a9f041e5945fba7c189d5410508cbcbefef80b253ed29aa2e1f8a2b86f4bd51af44ee18d4485e6d3468c92be9bf4a42e3a2b72dcaf27ce39ce947ec994f1e6b
|
|
21062
21062
|
languageName: node
|
|
21063
21063
|
linkType: hard
|
|
21064
21064
|
|
|
@@ -21095,10 +21095,10 @@ __metadata:
|
|
|
21095
21095
|
languageName: node
|
|
21096
21096
|
linkType: hard
|
|
21097
21097
|
|
|
21098
|
-
"undici-types@npm:~6.
|
|
21099
|
-
version: 6.
|
|
21100
|
-
resolution: "undici-types@npm:6.
|
|
21101
|
-
checksum: 10c0/
|
|
21098
|
+
"undici-types@npm:~6.21.0":
|
|
21099
|
+
version: 6.21.0
|
|
21100
|
+
resolution: "undici-types@npm:6.21.0"
|
|
21101
|
+
checksum: 10c0/c01ed51829b10aa72fc3ce64b747f8e74ae9b60eafa19a7b46ef624403508a54c526ffab06a14a26b3120d055e1104d7abe7c9017e83ced038ea5cf52f8d5e04
|
|
21102
21102
|
languageName: node
|
|
21103
21103
|
linkType: hard
|
|
21104
21104
|
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { HasPermissionProp } from '@licklist/plugins/dist/types/permission/Permission';
|
|
2
|
-
import { ProvidableType } from '@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper';
|
|
3
|
-
import { PaymentFeeFormFieldValues } from './PaymentFeeForm';
|
|
4
|
-
import { Currency } from '../../types/currency';
|
|
5
|
-
export type AdminSettingFormFieldValues = {
|
|
6
|
-
warningOnNumberOfPeople: string;
|
|
7
|
-
currency_id?: number;
|
|
8
|
-
providerHasMap: null | boolean;
|
|
9
|
-
hasBookingManagement: null | boolean;
|
|
10
|
-
additionalPaymentMethodsEnabled: null | boolean;
|
|
11
|
-
externalPaymentLinkEnabled: null | boolean;
|
|
12
|
-
} & PaymentFeeFormFieldValues;
|
|
13
|
-
export interface AdminSettingFormProps extends HasPermissionProp {
|
|
14
|
-
isLoading: boolean;
|
|
15
|
-
onSubmit?: (data: AdminSettingFormFieldValues) => void;
|
|
16
|
-
defaultValues?: Partial<AdminSettingFormFieldValues>;
|
|
17
|
-
currencies?: Array<Currency>;
|
|
18
|
-
providerMetadata: {
|
|
19
|
-
country?: string;
|
|
20
|
-
providableId?: number;
|
|
21
|
-
providerType?: ProvidableType;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export declare const AdminSettingForm: ({ isLoading, defaultValues, onSubmit, currencies, hasPermission, providerMetadata, }: AdminSettingFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
//# sourceMappingURL=AdminSettingForm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AdminSettingForm.d.ts","sourceRoot":"","sources":["../../../src/setting/admin/AdminSettingForm.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AAOtF,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAA;AAE7F,OAAO,EAAkB,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,MAAM,MAAM,2BAA2B,GAAG;IACxC,uBAAuB,EAAE,MAAM,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,IAAI,GAAG,OAAO,CAAA;IAC9B,oBAAoB,EAAE,IAAI,GAAG,OAAO,CAAA;IACpC,+BAA+B,EAAE,IAAI,GAAG,OAAO,CAAA;IAC/C,0BAA0B,EAAE,IAAI,GAAG,OAAO,CAAA;CAC3C,GAAG,yBAAyB,CAAA;AAE7B,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,IAAI,CAAA;IACtD,aAAa,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAA;IACpD,UAAU,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IAC5B,gBAAgB,EAAE;QAChB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,YAAY,CAAC,EAAE,cAAc,CAAA;KAC9B,CAAA;CACF;AAED,eAAO,MAAM,gBAAgB,yFAO1B,qBAAqB,4CAsJvB,CAAA"}
|