@licklist/design 0.66.10-dev.0 → 0.66.10-dev.3
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/auth/Login/LoginComponent.js +2 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +7 -2
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +22 -9
- package/dist/layout/DropDown.d.ts +2 -1
- package/dist/layout/DropDown.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +3 -3
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +1 -3
- package/dist/product-set/form/ProductZonesControl.d.ts +9 -0
- package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -0
- package/dist/product-set/form/ProductZonesControl.js +214 -0
- package/dist/product-set/form/ProductsControl.d.ts +1 -3
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +2 -13
- package/dist/product-set/product/ProductControl.d.ts +5 -8
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +19 -301
- package/dist/product-set/product/advanced-options/AdvancedOptions.d.ts +8 -0
- package/dist/product-set/product/advanced-options/AdvancedOptions.d.ts.map +1 -0
- package/dist/product-set/product/advanced-options/AdvancedOptions.js +264 -0
- package/dist/product-set/product/advanced-options/index.d.ts +2 -0
- package/dist/product-set/product/advanced-options/index.d.ts.map +1 -0
- package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.js +1 -0
- package/dist/product-set/product-category/ProductCategoryControl.d.ts +0 -2
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +2 -57
- package/dist/product-set/product-zone/ProductZoneControl.d.ts +15 -0
- package/dist/product-set/product-zone/ProductZoneControl.d.ts.map +1 -0
- package/dist/product-set/product-zone/ProductZoneControl.js +263 -0
- package/dist/product-set/product-zone/index.d.ts +2 -0
- package/dist/product-set/product-zone/index.d.ts.map +1 -0
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.js +3 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts +3 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.js +15 -5
- package/dist/styles/product-set/CreateProductSetItem.scss +8 -0
- package/dist/styles/product-set/EditZoneSettingModal.scss +16 -0
- package/dist/styles/product-set/ProductSetForm.scss +14 -1
- package/dist/styles/product-set/_index.scss +2 -1
- package/package.json +1 -1
- package/src/auth/Login/LoginComponent.tsx +1 -1
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +2 -4
- package/src/layout/DropDown.tsx +1 -1
- package/src/product-set/control/ProductSetControl.tsx +2 -1
- package/src/product-set/form/ProductCategoriesControl.tsx +0 -3
- package/src/product-set/form/ProductZonesControl.tsx +178 -0
- package/src/product-set/form/ProductsControl.tsx +0 -17
- package/src/product-set/product/ProductControl.tsx +23 -268
- package/src/product-set/product/advanced-options/AdvancedOptions.tsx +168 -0
- package/src/product-set/product/advanced-options/index.ts +1 -0
- package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +1 -1
- package/src/product-set/product-category/ProductCategoryControl.tsx +1 -60
- package/src/product-set/product-zone/ProductZoneControl.tsx +247 -0
- package/src/product-set/product-zone/index.ts +1 -0
- package/src/product-set/utils/index.ts +5 -1
- package/src/sortable-tree/SortableTreeItem.tsx +59 -45
- package/src/styles/product-set/CreateProductSetItem.scss +8 -0
- package/src/styles/product-set/EditZoneSettingModal.scss +16 -0
- package/src/styles/product-set/ProductSetForm.scss +14 -1
- package/src/styles/product-set/_index.scss +2 -1
- package/yarn.lock +108 -87
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import { Form, Col } from 'react-bootstrap';
|
|
4
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
5
|
+
import { HookFormService } from '@licklist/plugins';
|
|
6
|
+
import { useId } from '@react-aria/utils';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import { PRODUCT_DEfAULT_COLORS } from '@licklist/core/dist/DataMapper/Product/ProductDataMapper';
|
|
9
|
+
import { ProductPriceControl } from '../price/ProductPriceControl.js';
|
|
10
|
+
import '@licklist/core/dist/DataMapper/Provider/SnippetTemplateDataMapper';
|
|
11
|
+
import { PropertyControl } from '../../../snippet/snippet-template/control/PropertyControl.js';
|
|
12
|
+
import 'react-bootstrap/Button';
|
|
13
|
+
import 'lodash';
|
|
14
|
+
import 'react-bootstrap/Row';
|
|
15
|
+
import 'react-bootstrap/Col';
|
|
16
|
+
import '@licklist/plugins/dist/services/Form/FormErrorService';
|
|
17
|
+
import '@licklist/plugins/dist/services/Form/HookFormService';
|
|
18
|
+
import 'react-router-dom';
|
|
19
|
+
import '@licklist/core/dist/DataMapper/Provider/SnippetDataMapper';
|
|
20
|
+
import '../../../calendar/Calendar.js';
|
|
21
|
+
import 'clsx';
|
|
22
|
+
import 'luxon';
|
|
23
|
+
import 'react-intl';
|
|
24
|
+
import '../../../tiptap-editor/TipTapEditor.js';
|
|
25
|
+
import '@licklist/core/dist/Config';
|
|
26
|
+
import '../../../iframe/event/event-card/IframeEventCardSkeleton.js';
|
|
27
|
+
import 'react-icons/fa';
|
|
28
|
+
import '../../../static/index.js';
|
|
29
|
+
import '../../../iframe/page/Page.js';
|
|
30
|
+
import '../../../iframe/page/components/PageBody/PageBody.js';
|
|
31
|
+
import 'react-swipeable';
|
|
32
|
+
import '@licklist/plugins/dist/services/Route/RouteService';
|
|
33
|
+
import '@licklist/core/dist/DataMapper/Media/ImageDataMapper';
|
|
34
|
+
import '@licklist/plugins/dist/services/Media/MediaService';
|
|
35
|
+
import 'react-bootstrap/Accordion';
|
|
36
|
+
import 'react-bootstrap/Card';
|
|
37
|
+
import 'react-bootstrap/AccordionToggle';
|
|
38
|
+
import 'react-bootstrap/AccordionContext';
|
|
39
|
+
import '../../../iframe/event/event-venue-map/IframeEventVenueMap.js';
|
|
40
|
+
import 'react-bootstrap/PageItem';
|
|
41
|
+
import '@licklist/plugins/dist/services/Table/PaginationService';
|
|
42
|
+
import '@licklist/plugins/dist/services/Table/TableService';
|
|
43
|
+
import '@licklist/plugins/dist/hooks/Query/useQuery';
|
|
44
|
+
import 'react-loader';
|
|
45
|
+
import '../../../table/utils/index.js';
|
|
46
|
+
import '@tanstack/react-table';
|
|
47
|
+
import '../../../iframe/payment/order-items-table/hooks/useTableData.js';
|
|
48
|
+
import '@licklist/plugins/dist/context/payment/PaymentSessionContext';
|
|
49
|
+
import 'react-bootstrap/Alert';
|
|
50
|
+
import '@licklist/plugins/dist/hooks/Ryft/useRyftPayment';
|
|
51
|
+
import '@licklist/plugins/dist';
|
|
52
|
+
import '../../../iframe/order-process/components/BookingSummary/BookingSummary.js';
|
|
53
|
+
import '../../../iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.js';
|
|
54
|
+
import 'react-bootstrap/ModalHeader';
|
|
55
|
+
import 'react-bootstrap/ModalTitle';
|
|
56
|
+
import 'react-bootstrap/ModalBody';
|
|
57
|
+
import 'react-bootstrap/Modal';
|
|
58
|
+
import '../../../iframe/payment/payment-status-page/PaymentStatusPage.js';
|
|
59
|
+
import '../../../static/manual-date-picker/constants/index.js';
|
|
60
|
+
import '../../../iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js';
|
|
61
|
+
import { ProductSetLoadingContext } from '../../form/context.js';
|
|
62
|
+
import { BooleanSwitch } from '../../../static/switch/BooleanSwitch.js';
|
|
63
|
+
|
|
64
|
+
function _define_property(obj, key, value) {
|
|
65
|
+
if (key in obj) {
|
|
66
|
+
Object.defineProperty(obj, key, {
|
|
67
|
+
value: value,
|
|
68
|
+
enumerable: true,
|
|
69
|
+
configurable: true,
|
|
70
|
+
writable: true
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
obj[key] = value;
|
|
74
|
+
}
|
|
75
|
+
return obj;
|
|
76
|
+
}
|
|
77
|
+
function _object_spread(target) {
|
|
78
|
+
for(var i = 1; i < arguments.length; i++){
|
|
79
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
80
|
+
var ownKeys = Object.keys(source);
|
|
81
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
82
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
83
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
ownKeys.forEach(function(key) {
|
|
87
|
+
_define_property(target, key, source[key]);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return target;
|
|
91
|
+
}
|
|
92
|
+
function ownKeys(object, enumerableOnly) {
|
|
93
|
+
var keys = Object.keys(object);
|
|
94
|
+
if (Object.getOwnPropertySymbols) {
|
|
95
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
96
|
+
if (enumerableOnly) {
|
|
97
|
+
symbols = symbols.filter(function(sym) {
|
|
98
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
keys.push.apply(keys, symbols);
|
|
102
|
+
}
|
|
103
|
+
return keys;
|
|
104
|
+
}
|
|
105
|
+
function _object_spread_props(target, source) {
|
|
106
|
+
source = source != null ? source : {};
|
|
107
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
108
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
109
|
+
} else {
|
|
110
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
111
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
return target;
|
|
115
|
+
}
|
|
116
|
+
var AdvancedOptions = function(param) {
|
|
117
|
+
var fieldNamePrefix = param.fieldNamePrefix, isOverrides = param.isOverrides, isLoading = param.isLoading;
|
|
118
|
+
var t = useTranslation([
|
|
119
|
+
"Design",
|
|
120
|
+
"Validation",
|
|
121
|
+
"ProductSet"
|
|
122
|
+
]).t;
|
|
123
|
+
var _useFormContext = useFormContext(), register = _useFormContext.register, control = _useFormContext.control, errors = _useFormContext.formState.errors;
|
|
124
|
+
var productGroupList = useContext(ProductSetLoadingContext).productGroupList;
|
|
125
|
+
var isRequiredId = useId();
|
|
126
|
+
var productGroupId = useId();
|
|
127
|
+
var termsAndConditionsId = useId();
|
|
128
|
+
var hasSpecialNotesId = useId();
|
|
129
|
+
var minSpendId = useId();
|
|
130
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
131
|
+
children: [
|
|
132
|
+
/*#__PURE__*/ jsxs(Form.Group, {
|
|
133
|
+
controlId: isRequiredId,
|
|
134
|
+
className: "advanced-switch-container",
|
|
135
|
+
children: [
|
|
136
|
+
/*#__PURE__*/ jsx(Form.Label, {
|
|
137
|
+
children: t("isRequired")
|
|
138
|
+
}),
|
|
139
|
+
/*#__PURE__*/ jsx(Controller, {
|
|
140
|
+
render: function(param) {
|
|
141
|
+
var _param_field = param.field, value = _param_field.value, onChange = _param_field.onChange, name = _param_field.name;
|
|
142
|
+
return /*#__PURE__*/ jsx(BooleanSwitch, {
|
|
143
|
+
name: name,
|
|
144
|
+
value: Boolean(value),
|
|
145
|
+
onChange: onChange,
|
|
146
|
+
disabled: isLoading || isOverrides
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
control: control,
|
|
150
|
+
name: "".concat(fieldNamePrefix, ".isRequired")
|
|
151
|
+
})
|
|
152
|
+
]
|
|
153
|
+
}),
|
|
154
|
+
/*#__PURE__*/ jsxs(Form.Group, {
|
|
155
|
+
controlId: hasSpecialNotesId,
|
|
156
|
+
className: "advanced-switch-container",
|
|
157
|
+
children: [
|
|
158
|
+
/*#__PURE__*/ jsx(Form.Label, {
|
|
159
|
+
children: t("hasSpecialNotes")
|
|
160
|
+
}),
|
|
161
|
+
/*#__PURE__*/ jsx(Controller, {
|
|
162
|
+
render: function(param) {
|
|
163
|
+
var _param_field = param.field, value = _param_field.value, onChange = _param_field.onChange, name = _param_field.name;
|
|
164
|
+
return /*#__PURE__*/ jsx(BooleanSwitch, {
|
|
165
|
+
name: name,
|
|
166
|
+
value: Boolean(value),
|
|
167
|
+
onChange: onChange,
|
|
168
|
+
disabled: isLoading || isOverrides
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
control: control,
|
|
172
|
+
name: "".concat(fieldNamePrefix, ".hasSpecialNotes")
|
|
173
|
+
})
|
|
174
|
+
]
|
|
175
|
+
}),
|
|
176
|
+
/*#__PURE__*/ jsx(PropertyControl, {
|
|
177
|
+
item: "".concat(fieldNamePrefix, ".color"),
|
|
178
|
+
label: t("ProductSet:selectColor"),
|
|
179
|
+
isDisabled: isOverrides,
|
|
180
|
+
isRequired: false,
|
|
181
|
+
defaultColors: PRODUCT_DEfAULT_COLORS
|
|
182
|
+
}),
|
|
183
|
+
/*#__PURE__*/ jsxs(Form.Group, {
|
|
184
|
+
controlId: productGroupId,
|
|
185
|
+
children: [
|
|
186
|
+
/*#__PURE__*/ jsx(Form.Label, {
|
|
187
|
+
children: t("productGroup")
|
|
188
|
+
}),
|
|
189
|
+
/*#__PURE__*/ jsxs(Form.Control, _object_spread_props(_object_spread({
|
|
190
|
+
as: "select"
|
|
191
|
+
}, register("".concat(fieldNamePrefix, ".productGroupId"))), {
|
|
192
|
+
isInvalid: HookFormService.isInvalid("".concat(fieldNamePrefix, ".productGroupId"), errors),
|
|
193
|
+
disabled: isLoading || isOverrides,
|
|
194
|
+
defaultValue: "",
|
|
195
|
+
children: [
|
|
196
|
+
/*#__PURE__*/ jsx("option", {
|
|
197
|
+
value: "",
|
|
198
|
+
children: t("Design:selectProductGroup")
|
|
199
|
+
}),
|
|
200
|
+
productGroupList.map(function(productGroup) {
|
|
201
|
+
return /*#__PURE__*/ jsx("option", {
|
|
202
|
+
value: productGroup.id,
|
|
203
|
+
children: productGroup.value
|
|
204
|
+
}, productGroup.id);
|
|
205
|
+
})
|
|
206
|
+
]
|
|
207
|
+
})),
|
|
208
|
+
/*#__PURE__*/ jsx(Form.Control.Feedback, {
|
|
209
|
+
type: "invalid",
|
|
210
|
+
children: HookFormService.getErrors("".concat(fieldNamePrefix, ".productGroupId"), errors)
|
|
211
|
+
})
|
|
212
|
+
]
|
|
213
|
+
}),
|
|
214
|
+
/*#__PURE__*/ jsx(Col, {
|
|
215
|
+
lg: 8,
|
|
216
|
+
md: 8,
|
|
217
|
+
className: "pl-0",
|
|
218
|
+
children: /*#__PURE__*/ jsxs(Form.Group, {
|
|
219
|
+
controlId: termsAndConditionsId,
|
|
220
|
+
children: [
|
|
221
|
+
/*#__PURE__*/ jsx(Form.Label, {
|
|
222
|
+
children: t("productTermsConditions")
|
|
223
|
+
}),
|
|
224
|
+
/*#__PURE__*/ jsx(Controller, {
|
|
225
|
+
render: function(param) {
|
|
226
|
+
var _param_field = param.field, value = _param_field.value, onChange = _param_field.onChange, name = _param_field.name, ref = _param_field.ref;
|
|
227
|
+
return /*#__PURE__*/ jsx(Form.Control, {
|
|
228
|
+
ref: ref,
|
|
229
|
+
as: "textarea",
|
|
230
|
+
rows: 3,
|
|
231
|
+
value: value,
|
|
232
|
+
onChange: onChange,
|
|
233
|
+
isInvalid: HookFormService.isInvalid("".concat(fieldNamePrefix, ".termsAndConditions"), errors),
|
|
234
|
+
disabled: isLoading || isOverrides,
|
|
235
|
+
name: name
|
|
236
|
+
});
|
|
237
|
+
},
|
|
238
|
+
control: control,
|
|
239
|
+
name: "".concat(fieldNamePrefix, ".termsAndConditions")
|
|
240
|
+
}),
|
|
241
|
+
/*#__PURE__*/ jsx(Form.Control.Feedback, {
|
|
242
|
+
type: "invalid",
|
|
243
|
+
children: HookFormService.getErrors("".concat(fieldNamePrefix, ".termsAndConditions"), errors)
|
|
244
|
+
})
|
|
245
|
+
]
|
|
246
|
+
})
|
|
247
|
+
}),
|
|
248
|
+
/*#__PURE__*/ jsx(Form.Group, {
|
|
249
|
+
controlId: minSpendId,
|
|
250
|
+
className: "advanced-switch-container",
|
|
251
|
+
children: /*#__PURE__*/ jsx(ProductPriceControl, {
|
|
252
|
+
title: t("minSpend"),
|
|
253
|
+
isRequired: false,
|
|
254
|
+
isMoreThanZero: true,
|
|
255
|
+
allowDeposits: false,
|
|
256
|
+
isLoading: isLoading || isOverrides,
|
|
257
|
+
fieldNamePrefix: "".concat(fieldNamePrefix, ".minSpend")
|
|
258
|
+
})
|
|
259
|
+
})
|
|
260
|
+
]
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export { AdvancedOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/product-set/product/advanced-options/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FormValues } from "@licklist/plugins/dist/types/services/Form/hook-form-service";
|
|
2
2
|
import { QuantityType, CategoryType } from "@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper";
|
|
3
|
-
import { Zone } from "@licklist/core/dist/DataMapper/Provider/ZoneDataMapper";
|
|
4
3
|
import { IsDeletableEvent } from "../types";
|
|
5
4
|
export interface ProductCategoryControlValues extends FormValues {
|
|
6
5
|
id: number;
|
|
@@ -21,7 +20,6 @@ export interface ProductCategoryControlValues extends FormValues {
|
|
|
21
20
|
weight?: number;
|
|
22
21
|
isReusable?: boolean;
|
|
23
22
|
termsAndConditions?: string;
|
|
24
|
-
zoneId?: Zone["id"];
|
|
25
23
|
sort: number | null;
|
|
26
24
|
}
|
|
27
25
|
export interface ProductCategoryControlProps extends IsDeletableEvent {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductCategoryControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/product-category/ProductCategoryControl.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAE1F,OAAO,EACL,YAAY,EACZ,YAAY,EAKb,MAAM,kEAAkE,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductCategoryControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/product-category/ProductCategoryControl.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAE1F,OAAO,EACL,YAAY,EACZ,YAAY,EAKb,MAAM,kEAAkE,CAAC;AAG1E,OAAO,EAAE,gBAAgB,EAAmB,MAAM,UAAU,CAAC;AAG7D,MAAM,WAAW,4BAA6B,SAAQ,UAAU;IAC9D,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,YAAY,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IAErB,oBAAoB,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAQD,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,SAAS,EACT,UAAkB,GACnB,EAAE,2BAA2B,2CA4e7B"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useState,
|
|
2
|
+
import { useState, useCallback, useEffect } from 'react';
|
|
3
3
|
import { Col, Form, Row, InputGroup, Collapse } from 'react-bootstrap';
|
|
4
4
|
import { useFormContext, useWatch, Controller } from 'react-hook-form';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import HookFormService from '@licklist/plugins/dist/services/Form/HookFormService';
|
|
7
7
|
import { useId } from '@react-aria/utils';
|
|
8
|
-
import {
|
|
8
|
+
import { QUANTITY_TYPES, CATEGORY_TYPE_TICKETS, CATEGORY_TYPE_FIXED_DURATION, CATEGORY_TYPE_GAME } from '@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper';
|
|
9
9
|
import '../../static/index.js';
|
|
10
10
|
import { ReactComponent as SvgIncrement } from '../../assets/dashboard/increment.svg.js';
|
|
11
|
-
import { ProductSetLoadingContext } from '../form/context.js';
|
|
12
11
|
import { Switch } from '../../static/switch/Switch.js';
|
|
13
12
|
import { BooleanSwitch } from '../../static/switch/BooleanSwitch.js';
|
|
14
13
|
|
|
@@ -138,11 +137,9 @@ function ProductCategoryControl(param) {
|
|
|
138
137
|
var isTimeRelatedId = useId();
|
|
139
138
|
var collectUserInfoId = useId();
|
|
140
139
|
var hasTicketId = useId();
|
|
141
|
-
var zoneId = useId();
|
|
142
140
|
var overallQuantityId = useId();
|
|
143
141
|
var allowDepositsId = useId();
|
|
144
142
|
var remainderExpireAfterId = useId();
|
|
145
|
-
var _useContext = useContext(ProductSetLoadingContext), providerHasBookingManagement = _useContext.providerHasBookingManagement, _useContext_zones = _useContext.zones, zones = _useContext_zones === void 0 ? [] : _useContext_zones;
|
|
146
143
|
// @TODO not for first release
|
|
147
144
|
// const hasBookingManagementId = useId();
|
|
148
145
|
var handleExpand = useCallback(function() {
|
|
@@ -164,7 +161,6 @@ function ProductCategoryControl(param) {
|
|
|
164
161
|
maxSubItems,
|
|
165
162
|
fieldNamePrefix
|
|
166
163
|
]);
|
|
167
|
-
var isZoneCategory = category.type === CATEGORY_TYPE_FIXED_DURATION || category.type === CATEGORY_TYPE_GAME;
|
|
168
164
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
169
165
|
children: [
|
|
170
166
|
/*#__PURE__*/ jsxs(Col, {
|
|
@@ -425,57 +421,6 @@ function ProductCategoryControl(param) {
|
|
|
425
421
|
]
|
|
426
422
|
})
|
|
427
423
|
})
|
|
428
|
-
}),
|
|
429
|
-
isZoneCategory && /*#__PURE__*/ jsx(Fragment, {
|
|
430
|
-
children: /*#__PURE__*/ jsx(Row, {
|
|
431
|
-
children: /*#__PURE__*/ jsx(Col, {
|
|
432
|
-
children: /*#__PURE__*/ jsxs(Form.Group, {
|
|
433
|
-
controlId: zoneId,
|
|
434
|
-
children: [
|
|
435
|
-
/*#__PURE__*/ jsx(Form.Label, {
|
|
436
|
-
children: t("Design:zone")
|
|
437
|
-
}),
|
|
438
|
-
/*#__PURE__*/ jsx(Controller, {
|
|
439
|
-
control: control,
|
|
440
|
-
name: "".concat(fieldNamePrefix, ".zoneId"),
|
|
441
|
-
render: function(param) {
|
|
442
|
-
var field = param.field;
|
|
443
|
-
return /*#__PURE__*/ jsxs(Form.Control, _object_spread_props(_object_spread({
|
|
444
|
-
as: "select",
|
|
445
|
-
disabled: isOverride,
|
|
446
|
-
isInvalid: HookFormService.isInvalid("".concat(fieldNamePrefix, ".zoneId"), errors)
|
|
447
|
-
}, field), {
|
|
448
|
-
children: [
|
|
449
|
-
/*#__PURE__*/ jsx("option", {
|
|
450
|
-
value: null,
|
|
451
|
-
children: t("Design:choose")
|
|
452
|
-
}),
|
|
453
|
-
zones.map(function(zone) {
|
|
454
|
-
return /*#__PURE__*/ jsx("option", {
|
|
455
|
-
value: zone.id,
|
|
456
|
-
children: zone.name
|
|
457
|
-
}, zone.id);
|
|
458
|
-
})
|
|
459
|
-
]
|
|
460
|
-
}));
|
|
461
|
-
},
|
|
462
|
-
rules: {
|
|
463
|
-
required: {
|
|
464
|
-
value: providerHasBookingManagement,
|
|
465
|
-
message: t("Validation:fieldRequired", {
|
|
466
|
-
attribute: t("zone")
|
|
467
|
-
})
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
}),
|
|
471
|
-
/*#__PURE__*/ jsx(Form.Control.Feedback, {
|
|
472
|
-
type: "invalid",
|
|
473
|
-
children: HookFormService.getErrors("".concat(fieldNamePrefix, ".zoneId"), errors)
|
|
474
|
-
})
|
|
475
|
-
]
|
|
476
|
-
})
|
|
477
|
-
})
|
|
478
|
-
})
|
|
479
424
|
})
|
|
480
425
|
]
|
|
481
426
|
}),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ArrayPath } from "react-hook-form";
|
|
2
|
+
import { CategoryType } from "@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper";
|
|
3
|
+
import { FieldNamePrefixPath, FormValues } from "@licklist/plugins/dist/types/services/Form/hook-form-service";
|
|
4
|
+
import { ProductZone } from "@licklist/core/dist/DataMapper/Product/ProductZoneDataMapper";
|
|
5
|
+
export interface ProductZoneControlValues extends FormValues, ProductZone {
|
|
6
|
+
id: number | null;
|
|
7
|
+
}
|
|
8
|
+
interface ProductZoneProps<T> extends FieldNamePrefixPath<T> {
|
|
9
|
+
isOverrides: boolean;
|
|
10
|
+
categoryType?: CategoryType;
|
|
11
|
+
productZonesFieldName: ArrayPath<T>;
|
|
12
|
+
}
|
|
13
|
+
export declare const ProductZoneControl: <T extends FormValues>({ isOverrides, categoryType, fieldNamePrefix, productZonesFieldName, }: ProductZoneProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=ProductZoneControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductZoneControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/product-zone/ProductZoneControl.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EAOV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,YAAY,EAGb,MAAM,kEAAkE,CAAC;AAC1E,OAAO,EACL,mBAAmB,EACnB,UAAU,EACX,MAAM,8DAA8D,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,8DAA8D,CAAC;AAM3F,MAAM,WAAW,wBAAyB,SAAQ,UAAU,EAAE,WAAW;IACvE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAED,UAAU,gBAAgB,CAAC,CAAC,CAAE,SAAQ,mBAAmB,CAAC,CAAC,CAAC;IAC1D,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,qBAAqB,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;CACrC;AAED,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,UAAU,0EAKpD,gBAAgB,CAAC,CAAC,CAAC,4CA2MrB,CAAC"}
|