@licklist/design 0.71.18-dev.2 → 0.71.18-dev.4

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.
Files changed (110) hide show
  1. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -0
  2. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.d.ts +18 -0
  3. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.d.ts.map +1 -0
  4. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.js +281 -0
  5. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.d.ts +15 -0
  6. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.d.ts.map +1 -0
  7. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.js +89 -0
  8. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts +16 -0
  9. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts.map +1 -0
  10. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.js +447 -0
  11. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.d.ts +12 -0
  12. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.d.ts.map +1 -0
  13. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.js +45 -0
  14. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/index.d.ts +2 -0
  15. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/index.d.ts.map +1 -0
  16. package/dist/iframe/ProductWithModifierModal/index.d.ts +2 -0
  17. package/dist/iframe/ProductWithModifierModal/index.d.ts.map +1 -0
  18. package/dist/iframe/event/ticket-description/TicketDescription.d.ts +2 -1
  19. package/dist/iframe/event/ticket-description/TicketDescription.d.ts.map +1 -1
  20. package/dist/iframe/event/ticket-description/TicketDescription.js +4 -3
  21. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
  22. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.js +29 -2
  23. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts +4 -0
  24. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
  25. package/dist/iframe/order-process/components/BookingSummary/utils/index.js +27 -2
  26. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
  27. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.js +106 -2
  28. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +3 -1
  29. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  30. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +95 -1
  31. package/dist/iframe/order-process/components/CategoryProduct/components/ProductWithModifier/ProductWithModifier.d.ts +22 -0
  32. package/dist/iframe/order-process/components/CategoryProduct/components/ProductWithModifier/ProductWithModifier.d.ts.map +1 -0
  33. package/dist/iframe/order-process/components/CategoryProduct/components/ProductWithModifier/ProductWithModifier.js +62 -0
  34. package/dist/iframe/order-process/components/CategoryProduct/constants.d.ts +2 -0
  35. package/dist/iframe/order-process/components/CategoryProduct/constants.d.ts.map +1 -0
  36. package/dist/iframe/order-process/components/CategoryProduct/constants.js +4 -0
  37. package/dist/iframe/order-process/components/utils/useOnWindowUnmount.d.ts +6 -0
  38. package/dist/iframe/order-process/components/utils/useOnWindowUnmount.d.ts.map +1 -0
  39. package/dist/iframe/order-process/components/utils/useOnWindowUnmount.js +18 -0
  40. package/dist/iframe/payment/order-items-table/hooks/useTableData.d.ts.map +1 -1
  41. package/dist/iframe/payment/order-items-table/hooks/useTableData.js +83 -10
  42. package/dist/iframe/payment/order-items-table/utils/index.d.ts.map +1 -1
  43. package/dist/iframe/payment/order-items-table/utils/index.js +15 -0
  44. package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +2 -2
  45. package/dist/index.js +1 -1
  46. package/dist/product-set/form/ProductSetForm.d.ts +3 -1
  47. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  48. package/dist/product-set/form/ProductSetForm.js +6 -4
  49. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  50. package/dist/product-set/form/ProductsControl.js +17 -5
  51. package/dist/product-set/form/context.d.ts +3 -1
  52. package/dist/product-set/form/context.d.ts.map +1 -1
  53. package/dist/product-set/form/context.js +2 -1
  54. package/dist/product-set/product/ProductControl.d.ts +8 -0
  55. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  56. package/dist/product-set/product/ProductControl.js +25 -1
  57. package/dist/product-set/utils/index.d.ts +88 -0
  58. package/dist/product-set/utils/index.d.ts.map +1 -1
  59. package/dist/product-set/utils/index.js +19 -1
  60. package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts +1 -1
  61. package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts.map +1 -1
  62. package/dist/sales/coupon/utils/index.d.ts +2 -1
  63. package/dist/sales/coupon/utils/index.d.ts.map +1 -1
  64. package/dist/sales/modals/refund-modal/RefundModal.d.ts +6 -2
  65. package/dist/sales/modals/refund-modal/RefundModal.d.ts.map +1 -1
  66. package/dist/sales/modals/refund-modal/RefundModal.js +8 -4
  67. package/dist/sales/modals/refund-modal/index.d.ts +2 -2
  68. package/dist/sales/modals/refund-modal/index.d.ts.map +1 -1
  69. package/dist/styles/date-time-button/DateTimeButton.scss +1 -1
  70. package/dist/styles/iframe-page/Page.scss +16 -0
  71. package/dist/styles/iframe-page/PageBody.scss +4 -0
  72. package/dist/styles/modals/Modals.scss +16 -0
  73. package/dist/styles/product-set/ProductSetForm.scss +10 -0
  74. package/dist/styles/sales/ManualBooking.scss +6 -0
  75. package/dist/styles/themes/bookedit/index.scss +14 -0
  76. package/package.json +6 -6
  77. package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.tsx +205 -0
  78. package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.tsx +75 -0
  79. package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx +471 -0
  80. package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.tsx +55 -0
  81. package/src/iframe/ProductWithModifierModal/ModifierSetModal/index.ts +1 -0
  82. package/src/iframe/ProductWithModifierModal/index.ts +1 -0
  83. package/src/iframe/event/ticket-description/TicketDescription.tsx +5 -3
  84. package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +32 -1
  85. package/src/iframe/order-process/components/BookingSummary/utils/index.ts +45 -1
  86. package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +155 -75
  87. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +58 -1
  88. package/src/iframe/order-process/components/CategoryProduct/components/ProductWithModifier/ProductWithModifier.tsx +84 -0
  89. package/src/iframe/order-process/components/CategoryProduct/constants.ts +1 -0
  90. package/src/iframe/order-process/components/utils/useOnWindowUnmount.ts +25 -0
  91. package/src/iframe/payment/order-items-table/hooks/useTableData.tsx +84 -14
  92. package/src/iframe/payment/order-items-table/utils/index.ts +23 -0
  93. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +2 -2
  94. package/src/product-set/form/ProductSetForm.tsx +11 -3
  95. package/src/product-set/form/ProductsControl.tsx +24 -15
  96. package/src/product-set/form/context.tsx +5 -0
  97. package/src/product-set/product/ProductControl.tsx +37 -1
  98. package/src/product-set/utils/index.ts +19 -0
  99. package/src/report/ReportRunnerModal/ReportRunnerModal.tsx +2 -2
  100. package/src/sales/coupon/utils/index.ts +5 -3
  101. package/src/sales/modals/refund-modal/RefundModal.tsx +15 -6
  102. package/src/sales/modals/refund-modal/index.ts +7 -2
  103. package/src/styles/date-time-button/DateTimeButton.scss +1 -1
  104. package/src/styles/iframe-page/Page.scss +16 -0
  105. package/src/styles/iframe-page/PageBody.scss +4 -0
  106. package/src/styles/modals/Modals.scss +16 -0
  107. package/src/styles/product-set/ProductSetForm.scss +10 -0
  108. package/src/styles/sales/ManualBooking.scss +6 -0
  109. package/src/styles/themes/bookedit/index.scss +14 -0
  110. package/yarn.lock +171 -199
@@ -33,6 +33,7 @@ import '@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper';
33
33
  import 'react-bootstrap/Collapse';
34
34
  import '@licklist/plugins/dist/hooks/Media/useImages';
35
35
  import '@licklist/core/dist/DataMapper/Media/ImageDataMapper';
36
+ import 'react-select';
36
37
  import '@licklist/plugins';
37
38
  import '@licklist/plugins/dist/context/app/hooks/useNotification';
38
39
  import '../../../../../static/index.js';
@@ -0,0 +1,18 @@
1
+ import { MenuStep } from '@licklist/plugins/dist/types/context/sale/menuSteps';
2
+ import { OrderModifierByProduct } from '@licklist/core/dist/DataMapper/Order/OrderModifiierByProduct';
3
+ import { Product } from '@licklist/plugins/dist/types/context/sale/menuSteps';
4
+ import { ProductCategory } from 'dist/product-set/types';
5
+ import { FormOrderItem } from '../../order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput';
6
+ export interface ManualBookingFormValues {
7
+ steps: MenuStep[];
8
+ }
9
+ interface ProductWithModifierSetFormProps {
10
+ onHide: () => void;
11
+ product: Product;
12
+ category: ProductCategory;
13
+ editOrderModifier?: OrderModifierByProduct;
14
+ onChange: (product: FormOrderItem) => void;
15
+ }
16
+ export declare const ProductWithModifierSetForm: ({ product, category, editOrderModifier, onChange, }: ProductWithModifierSetFormProps) => import("react/jsx-runtime").JSX.Element;
17
+ export {};
18
+ //# sourceMappingURL=ProductWithModifierSetForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductWithModifierSetForm.d.ts","sourceRoot":"","sources":["../../../../src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAA;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAA;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,qDAAqD,CAAA;AAI7E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,qGAAqG,CAAA;AAInI,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,QAAQ,EAAE,CAAA;CAClB;AAED,UAAU,+BAA+B;IACvC,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,eAAe,CAAA;IACzB,iBAAiB,CAAC,EAAE,sBAAsB,CAAA;IAC1C,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAA;CAC3C;AAkBD,eAAO,MAAM,0BAA0B,wDAKpC,+BAA+B,4CAyJjC,CAAA"}
@@ -0,0 +1,281 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useForm, FormProvider, Controller } from 'react-hook-form';
3
+ import { Form, Button } from 'react-bootstrap';
4
+ import { isEmpty, uniqBy } from 'lodash';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { useIntl } from 'react-intl';
7
+ import { Currency } from '@licklist/core/dist/Config';
8
+ import 'recharts';
9
+ import 'react';
10
+ import 'react-loader';
11
+ import '@licklist/plugins/dist/hooks/Media/useWindowDimensions';
12
+ import clsx from 'clsx';
13
+ import 'moment';
14
+ import '@react-aria/utils';
15
+ import 'react-date-range';
16
+ import 'react-use';
17
+ import 'react-icons/fa';
18
+ import 'luxon';
19
+ import 'react-date-range/dist/styles.css';
20
+ import 'react-date-range/dist/theme/default.css';
21
+ import '@licklist/core/dist/DataMapper/User/UserDetailDataMapper';
22
+ import 'react-bootstrap/Col';
23
+ import 'react-bootstrap/Row';
24
+ import '@licklist/plugins/dist/services/Media/MediaService';
25
+ import '@licklist/plugins/dist/services/Form/FormErrorService';
26
+ import '@licklist/core/dist/DataMapper/Product/CouponDataMapper';
27
+ import '@licklist/plugins/dist/validation/Rules/couponCodeRules';
28
+ import 'react-select';
29
+ import 'rrule';
30
+ import '@licklist/core/dist/Services';
31
+ import { NumberInputHorizontal } from '../../../sales/manual-booking/number-input-horizontal/NumberInputHorizontal.js';
32
+ import '@licklist/core/dist/DataMapper/Product/ProductSetDataMapper';
33
+ import '@licklist/plugins/dist/utils/relyOnPeople';
34
+ import 'react-highlighter';
35
+ import '@licklist/plugins/dist';
36
+ import '@licklist/core/dist/Config/DefaultUser';
37
+ import '../../../typeahead-helper/TypeaheadHelperComponent.js';
38
+ import 'react-bootstrap/ModalHeader';
39
+ import 'react-bootstrap/ModalTitle';
40
+ import '../../../sales/constants.js';
41
+ import '../../../static/CurrencyNumberInput.js';
42
+ import '@licklist/core/dist/DataMapper/Order/OrderPaymentDataMapper';
43
+ import '@licklist/plugins/dist/context/sale/SalePaymentFormContext';
44
+ import '@licklist/core/dist/Services/Date';
45
+ import 'react-router-dom';
46
+ import '../../../static/index.js';
47
+ import '@licklist/core/dist/DataMapper/Order/OrderDataMapper';
48
+ import '@licklist/plugins/dist/utils/formatDate';
49
+ import '@licklist/plugins/dist/utils/sourceTitle';
50
+ import 'react-bootstrap/ModalBody';
51
+ import 'react-bootstrap/ModalFooter';
52
+ import 'react-bootstrap/Modal';
53
+ import 'react-bootstrap/PageItem';
54
+ import '@licklist/plugins/dist/services/Table/PaginationService';
55
+ import '@licklist/plugins/dist/services/Table/TableService';
56
+ import '@licklist/plugins/dist/hooks/Query/useQuery';
57
+ import '@licklist/plugins/dist/services/Route/RouteService';
58
+ import '../../../table/utils/index.js';
59
+ import '@tanstack/react-table';
60
+ import { MAX_PRODUCT_NUMBER } from '../../order-process/components/CategoryProduct/constants.js';
61
+ import { getOrderProductModifiersPrice } from '../../order-process/components/BookingSummary/utils/index.js';
62
+ import { ProductControl } from './controll/ProductControll.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 filteredOrderModifierSets = function(modifiersSet) {
117
+ if (!modifiersSet) return [];
118
+ var orderModifier = modifiersSet === null || modifiersSet === void 0 ? void 0 : modifiersSet.flat().filter(function(modifier) {
119
+ return !!(modifier === null || modifier === void 0 ? void 0 : modifier.quantity);
120
+ });
121
+ var filteredOrderModifier = uniqBy(orderModifier, function(item) {
122
+ return "".concat(item.modifierId, "-").concat(item.modifierSetId);
123
+ });
124
+ return filteredOrderModifier || [];
125
+ };
126
+ var ProductWithModifierSetForm = function(param) {
127
+ var product = param.product, category = param.category, editOrderModifier = param.editOrderModifier, onChange = param.onChange;
128
+ var _valuesOrder_product, _valuesOrder_;
129
+ var form = useForm({
130
+ mode: 'onChange'
131
+ });
132
+ var t = useTranslation([
133
+ 'App',
134
+ 'Sale',
135
+ 'Validation'
136
+ ]).t;
137
+ var _form_formState = form.formState, errors = _form_formState.errors, isSubmitting = _form_formState.isSubmitting, control = form.control, trigger = form.trigger, watch = form.watch;
138
+ var _editOrderModifier_productQuantity;
139
+ var defaultProductQuantity = (_editOrderModifier_productQuantity = editOrderModifier === null || editOrderModifier === void 0 ? void 0 : editOrderModifier.productQuantity) !== null && _editOrderModifier_productQuantity !== void 0 ? _editOrderModifier_productQuantity : 0;
140
+ var valuesOrder = watch();
141
+ var productQuantity = valuesOrder === null || valuesOrder === void 0 ? void 0 : (_valuesOrder_product = valuesOrder.product) === null || _valuesOrder_product === void 0 ? void 0 : _valuesOrder_product.quantity;
142
+ var orderModifiersSets = ((_valuesOrder_ = valuesOrder["".concat(product.id)]) === null || _valuesOrder_ === void 0 ? void 0 : _valuesOrder_.orderProductModifiers) || [];
143
+ var filteredOrderModifiers = filteredOrderModifierSets(orderModifiersSets);
144
+ var orderModifierSets = [
145
+ {
146
+ productQuantity: productQuantity !== null && productQuantity !== void 0 ? productQuantity : 1,
147
+ modifiers: filteredOrderModifiers
148
+ }
149
+ ];
150
+ var onSubmit = function(event) {
151
+ event.preventDefault();
152
+ trigger();
153
+ var productOrder = {
154
+ id: product.id,
155
+ name: product.name,
156
+ deposit: product === null || product === void 0 ? void 0 : product.deposit,
157
+ hasDeposit: category.allowDeposits && (product === null || product === void 0 ? void 0 : product.deposit) < product.price,
158
+ price: product.price,
159
+ productCategoryId: category.id,
160
+ quantity: productQuantity,
161
+ capacity: product === null || product === void 0 ? void 0 : product.capacity,
162
+ orderModifiersSets: orderModifierSets
163
+ };
164
+ if (productOrder) {
165
+ return onChange(productOrder);
166
+ }
167
+ return undefined;
168
+ };
169
+ var handleProductQuantityChange = function(value, onChange) {
170
+ if (value < 0) {
171
+ onChange(0);
172
+ } else if (value > MAX_PRODUCT_NUMBER) {
173
+ onChange(MAX_PRODUCT_NUMBER);
174
+ } else {
175
+ onChange(value);
176
+ }
177
+ };
178
+ var modifierPrice = getOrderProductModifiersPrice(orderModifierSets[0]);
179
+ var productWithModifierPrice = (product.price * productQuantity || 0) + modifierPrice;
180
+ var formatNumber = useIntl().formatNumber;
181
+ var formatToCurrency = function(value) {
182
+ return formatNumber(value, {
183
+ style: 'currency',
184
+ currency: Currency.GBP
185
+ });
186
+ };
187
+ return /*#__PURE__*/ jsx(FormProvider, _object_spread_props(_object_spread({}, form), {
188
+ children: /*#__PURE__*/ jsx(Form, {
189
+ children: /*#__PURE__*/ jsxs("div", {
190
+ className: "manual-booking-form",
191
+ children: [
192
+ /*#__PURE__*/ jsx(ProductControl, {
193
+ product: product,
194
+ errors: errors,
195
+ editOrderModifier: editOrderModifier
196
+ }),
197
+ /*#__PURE__*/ jsxs("div", {
198
+ className: "bg-light m-2 p-2 rounded",
199
+ children: [
200
+ /*#__PURE__*/ jsx(Controller, {
201
+ control: control,
202
+ name: "product.quantity",
203
+ rules: {
204
+ min: {
205
+ value: 1,
206
+ message: t('Validation:fieldMinNumber', {
207
+ attribute: t('minItems'),
208
+ min: 1
209
+ })
210
+ },
211
+ max: {
212
+ value: !product.isUnlimited ? product.maxQuantity : MAX_PRODUCT_NUMBER,
213
+ message: t('Validation:fieldMaxNumber', {
214
+ attribute: t('maxItems'),
215
+ max: product.maxQuantity
216
+ })
217
+ }
218
+ },
219
+ render: function(param) {
220
+ var _param_field = param.field, onChange = _param_field.onChange, value = _param_field.value, ref = _param_field.ref, _param_fieldState = param.fieldState, invalid = _param_fieldState.invalid, error = _param_fieldState.error;
221
+ return /*#__PURE__*/ jsxs("div", {
222
+ className: "mb-8 d-flex flex-column",
223
+ children: [
224
+ /*#__PURE__*/ jsx("div", {
225
+ className: "quantity-container-product w-100",
226
+ children: /*#__PURE__*/ jsx(NumberInputHorizontal, {
227
+ ref: ref,
228
+ size: "big",
229
+ onChange: function(val) {
230
+ return handleProductQuantityChange(val, onChange);
231
+ },
232
+ onMinusClick: function(val) {
233
+ return handleProductQuantityChange(val, onChange);
234
+ },
235
+ onPlusClick: function(val) {
236
+ handleProductQuantityChange(val, onChange);
237
+ },
238
+ min: 0,
239
+ max: 100,
240
+ value: value || defaultProductQuantity,
241
+ className: clsx(invalid && 'error'),
242
+ isLoading: isSubmitting
243
+ })
244
+ }),
245
+ /*#__PURE__*/ jsxs("div", {
246
+ className: " d-flex justify-content-center",
247
+ children: [
248
+ /*#__PURE__*/ jsx("div", {
249
+ className: "price pl-5",
250
+ children: formatToCurrency(product.price)
251
+ }),
252
+ (error === null || error === void 0 ? void 0 : error.message) && /*#__PURE__*/ jsx("div", {
253
+ className: "d-flex justify-content-center mt-3 w-100",
254
+ children: /*#__PURE__*/ jsx("p", {
255
+ className: "iframe-event__message-error",
256
+ children: error.message
257
+ })
258
+ })
259
+ ]
260
+ })
261
+ ]
262
+ });
263
+ }
264
+ }),
265
+ /*#__PURE__*/ jsx(Button, {
266
+ as: "button",
267
+ variant: "primary",
268
+ className: "w-100",
269
+ disabled: !productQuantity || !isEmpty(errors),
270
+ onClick: onSubmit,
271
+ children: "".concat(t('App:add')).concat(modifierPrice ? " (".concat(formatToCurrency(productWithModifierPrice), ")") : '')
272
+ })
273
+ ]
274
+ })
275
+ ]
276
+ })
277
+ })
278
+ }));
279
+ };
280
+
281
+ export { ProductWithModifierSetForm };
@@ -0,0 +1,15 @@
1
+ import { OrderModifierByProduct } from '@licklist/core/dist/DataMapper/Order/OrderModifiierByProduct';
2
+ import { Product } from '@licklist/plugins/dist/types/context/sale/menuSteps';
3
+ import { ProductCategory } from 'dist/product-set/types';
4
+ import { FormOrderItem } from '../../order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput';
5
+ interface ProductWithModifierSetModalProps {
6
+ show: boolean;
7
+ onHide: () => void;
8
+ product: Product;
9
+ category: ProductCategory;
10
+ editOrderModifier?: OrderModifierByProduct;
11
+ onChange: (product: FormOrderItem) => void;
12
+ }
13
+ export declare const ProductWithModifierSetModal: ({ show, onHide, product, category, onChange, editOrderModifier, }: ProductWithModifierSetModalProps) => import("react/jsx-runtime").JSX.Element;
14
+ export {};
15
+ //# sourceMappingURL=ProductWithModifierSetModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductWithModifierSetModal.d.ts","sourceRoot":"","sources":["../../../../src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAA;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,qDAAqD,CAAA;AAG7E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qGAAqG,CAAA;AAInI,UAAU,gCAAgC;IACxC,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,eAAe,CAAA;IACzB,iBAAiB,CAAC,EAAE,sBAAsB,CAAA;IAC1C,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAA;CAC3C;AAED,eAAO,MAAM,2BAA2B,sEAOrC,gCAAgC,4CA+ClC,CAAA"}
@@ -0,0 +1,89 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import 'react';
3
+ import { Modal } from 'react-bootstrap';
4
+ import 'react-i18next';
5
+ import 'react-bootstrap/ModalHeader';
6
+ import 'react-bootstrap/ModalTitle';
7
+ import 'react-bootstrap/ModalBody';
8
+ import 'react-bootstrap/ModalFooter';
9
+ import 'react-bootstrap/Modal';
10
+ import 'react-icons/fa';
11
+ import { useDialogContext, DialogContextProvider } from '../../../modals/dialog/DialogContext.js';
12
+ import 'react-swipeable';
13
+ import 'react-bootstrap/Button';
14
+ import '@licklist/plugins/dist/services/Route/RouteService';
15
+ import 'react-intl';
16
+ import clsx from 'clsx';
17
+ import '../../../tiptap-editor/TipTapEditor.js';
18
+ import '@licklist/core/dist/Config';
19
+ import 'luxon';
20
+ import '../../event/event-card/IframeEventCardSkeleton.js';
21
+ import { TicketDescription } from '../../event/ticket-description/TicketDescription.js';
22
+ import 'react-bootstrap/Accordion';
23
+ import 'react-bootstrap/Card';
24
+ import 'react-bootstrap/AccordionToggle';
25
+ import 'react-bootstrap/AccordionContext';
26
+ import '../../../static/index.js';
27
+ import '@licklist/plugins/dist/services/Media/MediaService';
28
+ import '../../event/event-venue-map/IframeEventVenueMap.js';
29
+ import { useOnWindowUnmount } from '../../order-process/components/utils/useOnWindowUnmount.js';
30
+ import { ProductWithModifierSetForm } from './ProductWithModifierSetForm.js';
31
+
32
+ var ProductWithModifierSetModal = function(param) {
33
+ var show = param.show, onHide = param.onHide, product = param.product, category = param.category, onChange = param.onChange, editOrderModifier = param.editOrderModifier;
34
+ var _useDialogContext = useDialogContext(), onBeforeUnload = _useDialogContext.onBeforeUnload, onPopState = _useDialogContext.onPopState;
35
+ useOnWindowUnmount({
36
+ onBeforeUnload: onBeforeUnload,
37
+ onPopState: onPopState
38
+ });
39
+ return /*#__PURE__*/ jsx(DialogContextProvider, {
40
+ children: /*#__PURE__*/ jsxs(Modal, {
41
+ onHide: onHide,
42
+ show: show,
43
+ className: "m-0 manual-booking-form-modal mt-0 h-100 p-0",
44
+ dialogClassName: "manual-booking-dialog mt-0",
45
+ children: [
46
+ /*#__PURE__*/ jsx("div", {
47
+ className: "close-button",
48
+ children: /*#__PURE__*/ jsx("button", {
49
+ type: "button",
50
+ onClick: onHide,
51
+ onKeyPress: onHide,
52
+ className: "btn btn-light rounded-circle position-absolute top-0 end-0 m-2",
53
+ children: "\xd7"
54
+ })
55
+ }),
56
+ /*#__PURE__*/ jsx("div", {
57
+ className: "right-block",
58
+ id: "select-event-container",
59
+ children: /*#__PURE__*/ jsxs("div", {
60
+ className: "manual-booking-container",
61
+ children: [
62
+ /*#__PURE__*/ jsx("div", {
63
+ className: "manual-booking-header",
64
+ children: /*#__PURE__*/ jsx(TicketDescription, {
65
+ title: product.name,
66
+ description: product.description,
67
+ className: clsx('iframe-event__product-description'),
68
+ classNameProductModal: "d-block",
69
+ images: product.images,
70
+ isRequired: product.isRequired,
71
+ canExpand: true
72
+ })
73
+ }),
74
+ /*#__PURE__*/ jsx(ProductWithModifierSetForm, {
75
+ product: product,
76
+ onHide: onHide,
77
+ editOrderModifier: editOrderModifier,
78
+ onChange: onChange,
79
+ category: category
80
+ })
81
+ ]
82
+ })
83
+ })
84
+ ]
85
+ })
86
+ });
87
+ };
88
+
89
+ export { ProductWithModifierSetModal };
@@ -0,0 +1,16 @@
1
+ import { OrderModifier } from '@licklist/core/dist/DataMapper/Order/OrderModifierDataMapper';
2
+ import { Modifier } from '@licklist/core/dist/DataMapper/Product/ModifierDataMapper';
3
+ import { ModifierSet } from '@licklist/core/dist/DataMapper/Product/ModifierSetDataMapper';
4
+ import { FieldErrors, FieldValues } from 'react-hook-form';
5
+ interface ModifiersSetControllProps {
6
+ modifiers?: Modifier[];
7
+ modifierSet: ModifierSet;
8
+ modifiersSetWithErrors?: FieldErrors<FieldValues>;
9
+ isLoading?: boolean;
10
+ isEditMode?: boolean;
11
+ productId: number;
12
+ orderProductModifierSets?: OrderModifier[];
13
+ }
14
+ export declare const ModifiersSetControl: ({ modifierSet, modifiers, modifiersSetWithErrors, productId, isLoading, isEditMode, orderProductModifierSets, }: ModifiersSetControllProps) => import("react/jsx-runtime").JSX.Element;
15
+ export {};
16
+ //# sourceMappingURL=ModifierSetControll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModifierSetControll.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAA;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,2DAA2D,CAAA;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,8DAA8D,CAAA;AAG1F,OAAO,EAEL,WAAW,EACX,WAAW,EAEZ,MAAM,iBAAiB,CAAA;AAQxB,UAAU,yBAAyB;IACjC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,sBAAsB,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAA;IACjD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,wBAAwB,CAAC,EAAE,aAAa,EAAE,CAAA;CAC3C;AAID,eAAO,MAAM,mBAAmB,oHAQ7B,yBAAyB,4CAkZ3B,CAAA"}