@licklist/design 0.69.4 → 0.69.6-dev.0

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 (192) hide show
  1. package/dist/affiliate/form/AffiliateForm.d.ts.map +1 -1
  2. package/dist/auth/Login/LoginComponent.js +2 -1
  3. package/dist/calendar/utils/index.d.ts +8 -2
  4. package/dist/calendar/utils/index.d.ts.map +1 -1
  5. package/dist/calendar/utils/index.js +9 -21
  6. package/dist/date-time-button/DateContent.d.ts.map +1 -1
  7. package/dist/date-time-button/DateContent.js +3 -3
  8. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +2 -1
  9. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
  10. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +3 -2
  11. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts +2 -1
  12. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
  13. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +31 -28
  14. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts +2 -1
  15. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
  16. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +14 -2
  17. package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
  18. package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +0 -1
  19. package/dist/events/event-card/utils.d.ts +1 -0
  20. package/dist/events/event-card/utils.d.ts.map +1 -1
  21. package/dist/events/event-card/utils.js +6 -2
  22. package/dist/iframe/activity-card/ActivityCard.d.ts +3 -1
  23. package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
  24. package/dist/iframe/activity-card/ActivityCard.js +8 -1
  25. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
  26. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +13 -0
  27. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  28. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +2 -0
  29. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
  30. package/dist/iframe/ryft/RyftPaymentForm.d.ts +2 -2
  31. package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
  32. package/dist/iframe/ryft/RyftPaymentForm.js +8 -2
  33. package/dist/iframe/ryft/utils/ryft-form.d.ts +2 -1
  34. package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
  35. package/dist/iframe/ryft/utils/ryft-form.js +20 -1
  36. package/dist/index.js +1 -0
  37. package/dist/layout/DropDown.d.ts +2 -1
  38. package/dist/layout/DropDown.d.ts.map +1 -1
  39. package/dist/modals/confirmation/ConfirmModal.d.ts +3 -1
  40. package/dist/modals/confirmation/ConfirmModal.d.ts.map +1 -1
  41. package/dist/modals/confirmation/ConfirmModal.js +172 -8
  42. package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
  43. package/dist/notification/email-template/control/EmailTemplateControl.js +3 -0
  44. package/dist/product-set/card/ProductSetCard.d.ts +6 -2
  45. package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
  46. package/dist/product-set/card/ProductSetCard.js +20 -11
  47. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  48. package/dist/product-set/control/DateAndRecurrenceInput.js +4 -3
  49. package/dist/product-set/control/DateInput.d.ts.map +1 -1
  50. package/dist/product-set/control/DateInput.js +2 -2
  51. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  52. package/dist/product-set/form/ProductCategoriesControl.js +48 -2
  53. package/dist/product-set/form/ProductSetForm.d.ts +4 -1
  54. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  55. package/dist/product-set/form/ProductSetForm.js +64 -1
  56. package/dist/product-set/form/ProductSetNameControl.d.ts +6 -0
  57. package/dist/product-set/form/ProductSetNameControl.d.ts.map +1 -0
  58. package/dist/product-set/form/ProductSetNameControl.js +35 -0
  59. package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -1
  60. package/dist/product-set/form/ProductZonesControl.js +0 -2
  61. package/dist/product-set/form/ProductsControl.js +1 -0
  62. package/dist/product-set/form/SelectCategoryModal.d.ts +12 -0
  63. package/dist/product-set/form/SelectCategoryModal.d.ts.map +1 -1
  64. package/dist/product-set/form/SelectCategoryModal.js +1 -1
  65. package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
  66. package/dist/product-set/form/SubProductsControl.js +0 -3
  67. package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
  68. package/dist/product-set/form/VenueMapsControl.js +0 -3
  69. package/dist/product-set/form/index.d.ts +1 -0
  70. package/dist/product-set/form/index.d.ts.map +1 -1
  71. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  72. package/dist/product-set/product/booking-management/ProductBookingManagementControl.d.ts.map +1 -1
  73. package/dist/product-set/product/booking-management/ProductBookingManagementControl.js +6 -0
  74. package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
  75. package/dist/product-set/product/deposit/ProductDepositControl.js +3 -0
  76. package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
  77. package/dist/product-set/product/duration/ProductDurationControl.js +6 -0
  78. package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
  79. package/dist/product-set/product/price/ProductPriceControl.js +3 -0
  80. package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
  81. package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +6 -0
  82. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
  83. package/dist/product-set/product/quantity/ProductQuantityControl.js +6 -0
  84. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
  85. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +4 -1
  86. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  87. package/dist/product-set/product-category/ProductCategoryControl.js +12 -0
  88. package/dist/product-set/utils/index.d.ts +7 -0
  89. package/dist/product-set/utils/index.d.ts.map +1 -1
  90. package/dist/product-set/utils/index.js +10 -1
  91. package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
  92. package/dist/recurrence-input/RecurrenceEndInput.js +3 -0
  93. package/dist/recurring-date-picker-input/RecurrenceEndInput.d.ts.map +1 -1
  94. package/dist/resource/form/components/CapacityControl.d.ts.map +1 -1
  95. package/dist/resource/form/components/CapacityControl.js +3 -0
  96. package/dist/resource/form/components/SortControl.d.ts.map +1 -1
  97. package/dist/resource/form/components/SortControl.js +3 -0
  98. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  99. package/dist/sales/booking/results/components/ResultCard.js +0 -2
  100. package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
  101. package/dist/sales/coupon/control/CouponFormControl.js +21 -0
  102. package/dist/setting/admin/PaymentFeeForm.d.ts.map +1 -1
  103. package/dist/setting/admin/PaymentFeeForm.js +16 -1
  104. package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
  105. package/dist/setting/dashboard/DashboardSettingForm.js +4 -1
  106. package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
  107. package/dist/snippet/snippet-template/preview/Preview.js +6 -0
  108. package/dist/sortable-tree/SortableTreeItem.d.ts +2 -1
  109. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  110. package/dist/sortable-tree/SortableTreeItem.js +10 -4
  111. package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
  112. package/dist/static/CurrencyNumberInput.js +3 -0
  113. package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
  114. package/dist/static/form-number-input/FormNumberInput.js +3 -0
  115. package/dist/static/number-input/NumberInput.d.ts.map +1 -1
  116. package/dist/static/number-input/NumberInput.js +3 -0
  117. package/dist/styles/availability-indicator/AvailabilityIndicator.scss +9 -0
  118. package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  119. package/dist/styles/product-set/ProductSetForm.scss +22 -0
  120. package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +25 -0
  121. package/dist/styles/sales/BookingResults.scss +1 -1
  122. package/dist/typeahead/Typeahead.d.ts +5 -1
  123. package/dist/typeahead/Typeahead.d.ts.map +1 -1
  124. package/dist/typeahead/Typeahead.js +9 -2
  125. package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -1
  126. package/dist/zone/form/components/GameDurationControl.js +3 -0
  127. package/dist/zone/form/components/SortControl.d.ts.map +1 -1
  128. package/dist/zone/form/components/SortControl.js +3 -0
  129. package/package.json +8 -7
  130. package/src/affiliate/form/AffiliateForm.tsx +1 -0
  131. package/src/auth/Login/LoginComponent.tsx +1 -1
  132. package/src/calendar/utils/index.ts +17 -26
  133. package/src/date-time-button/DateContent.tsx +3 -3
  134. package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +3 -0
  135. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +88 -85
  136. package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +11 -1
  137. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +0 -1
  138. package/src/events/event-card/utils.ts +5 -1
  139. package/src/iframe/activity-card/ActivityCard.tsx +6 -0
  140. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +9 -0
  141. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +1 -0
  142. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -0
  143. package/src/iframe/ryft/RyftPaymentForm.tsx +9 -4
  144. package/src/iframe/ryft/utils/ryft-form.ts +28 -2
  145. package/src/layout/DropDown.tsx +1 -1
  146. package/src/modals/confirmation/ConfirmModal.tsx +19 -3
  147. package/src/notification/email-template/control/EmailTemplateControl.tsx +1 -0
  148. package/src/product-set/card/ProductSetCard.tsx +32 -6
  149. package/src/product-set/control/DateAndRecurrenceInput.tsx +3 -1
  150. package/src/product-set/control/DateInput.tsx +2 -1
  151. package/src/product-set/form/ProductCategoriesControl.tsx +37 -1
  152. package/src/product-set/form/ProductSetForm.tsx +24 -2
  153. package/src/product-set/form/ProductSetNameControl.tsx +27 -0
  154. package/src/product-set/form/ProductZonesControl.tsx +1 -4
  155. package/src/product-set/form/SelectCategoryModal.tsx +2 -2
  156. package/src/product-set/form/SubProductsControl.tsx +0 -3
  157. package/src/product-set/form/VenueMapsControl.tsx +0 -3
  158. package/src/product-set/form/index.ts +1 -0
  159. package/src/product-set/product/ProductControl.tsx +0 -1
  160. package/src/product-set/product/advanced-options/AdvancedOptions.tsx +1 -1
  161. package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +2 -0
  162. package/src/product-set/product/deposit/ProductDepositControl.tsx +1 -0
  163. package/src/product-set/product/duration/ProductDurationControl.tsx +2 -0
  164. package/src/product-set/product/price/ProductPriceControl.tsx +1 -0
  165. package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +2 -0
  166. package/src/product-set/product/quantity/ProductQuantityControl.tsx +2 -0
  167. package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +1 -0
  168. package/src/product-set/product-category/ProductCategoryControl.tsx +4 -0
  169. package/src/product-set/product-zone/ProductZoneControl.tsx +1 -1
  170. package/src/product-set/utils/index.ts +11 -0
  171. package/src/recurrence-input/RecurrenceEndInput.tsx +1 -0
  172. package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +1 -0
  173. package/src/resource/form/components/CapacityControl.tsx +1 -0
  174. package/src/resource/form/components/SortControl.tsx +1 -0
  175. package/src/sales/booking/results/components/ResultCard.tsx +0 -2
  176. package/src/sales/coupon/control/CouponFormControl.tsx +7 -0
  177. package/src/setting/admin/PaymentFeeForm.tsx +5 -0
  178. package/src/setting/dashboard/DashboardSettingForm.tsx +1 -0
  179. package/src/snippet/snippet-template/preview/Preview.tsx +6 -0
  180. package/src/sortable-tree/SortableTreeItem.tsx +6 -0
  181. package/src/static/CurrencyNumberInput.tsx +1 -0
  182. package/src/static/form-number-input/FormNumberInput.tsx +1 -0
  183. package/src/static/number-input/NumberInput.tsx +1 -0
  184. package/src/styles/availability-indicator/AvailabilityIndicator.scss +9 -0
  185. package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  186. package/src/styles/product-set/ProductSetForm.scss +22 -0
  187. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +25 -0
  188. package/src/styles/sales/BookingResults.scss +1 -1
  189. package/src/typeahead/Typeahead.tsx +15 -1
  190. package/src/zone/form/components/GameDurationControl.tsx +1 -0
  191. package/src/zone/form/components/SortControl.tsx +1 -0
  192. package/yarn.lock +20 -62
@@ -31,7 +31,7 @@ function _object_spread(target) {
31
31
  return target;
32
32
  }
33
33
  function Typeahead(param) {
34
- var options = param.options, placeholder = param.placeholder, _param_isRequired = param.isRequired, isRequired = _param_isRequired === void 0 ? false : _param_isRequired, isMultipleChoise = param.isMultipleChoise, _param_name = param.name, name = _param_name === void 0 ? '' : _param_name, _param_isCouponForm = param.isCouponForm, isCouponForm = _param_isCouponForm === void 0 ? false : _param_isCouponForm, _param_noOptionsMessage = param.noOptionsMessage, noOptionsMessage = _param_noOptionsMessage === void 0 ? '' : _param_noOptionsMessage, isInvalid = param.isInvalid;
34
+ var options = param.options, placeholder = param.placeholder, _param_isRequired = param.isRequired, isRequired = _param_isRequired === void 0 ? false : _param_isRequired, isMultipleChoise = param.isMultipleChoise, _param_name = param.name, name = _param_name === void 0 ? '' : _param_name, value = param.value, onChangeValue = param.onChangeValue, containerStyles = param.containerStyles, _param_isCouponForm = param.isCouponForm, isCouponForm = _param_isCouponForm === void 0 ? false : _param_isCouponForm, _param_noOptionsMessage = param.noOptionsMessage, noOptionsMessage = _param_noOptionsMessage === void 0 ? '' : _param_noOptionsMessage, isInvalid = param.isInvalid;
35
35
  var control = useFormContext().control;
36
36
  var getStyle = function() {
37
37
  var couponFormStyle = isCouponForm ? {
@@ -53,14 +53,21 @@ function Typeahead(param) {
53
53
  var field = param.field;
54
54
  return /*#__PURE__*/ jsx(Select, {
55
55
  placeholder: placeholder,
56
- value: field.value,
56
+ value: value !== null && value !== void 0 ? value : field.value,
57
57
  isMulti: isMultipleChoise,
58
58
  styles: {
59
+ container: function(base) {
60
+ return _object_spread({}, base, containerStyles);
61
+ },
59
62
  control: function(base) {
60
63
  return _object_spread({}, base, getStyle());
61
64
  }
62
65
  },
63
66
  onChange: function(value) {
67
+ if (onChangeValue) {
68
+ onChangeValue(value);
69
+ return;
70
+ }
64
71
  field.onChange(value);
65
72
  },
66
73
  options: options,
@@ -1 +1 @@
1
- {"version":3,"file":"GameDurationControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/GameDurationControl.tsx"],"names":[],"mappings":"AAOA,KAAK,wBAAwB,GAAG;IAC9B,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,mBAAmB,mBAE7B,wBAAwB,4CA+B1B,CAAA"}
1
+ {"version":3,"file":"GameDurationControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/GameDurationControl.tsx"],"names":[],"mappings":"AAOA,KAAK,wBAAwB,GAAG;IAC9B,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,mBAAmB,mBAE7B,wBAAwB,4CAgC1B,CAAA"}
@@ -77,6 +77,9 @@ var GameDurationControl = function(param) {
77
77
  required: false,
78
78
  min: 1
79
79
  })), {
80
+ onWheel: function(event) {
81
+ return event.currentTarget.blur();
82
+ },
80
83
  placeholder: t('Design:duration'),
81
84
  isInvalid: Boolean(errors.defaultDuration),
82
85
  disabled: isLoading
@@ -1 +1 @@
1
- {"version":3,"file":"SortControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/SortControl.tsx"],"names":[],"mappings":"AAOA,KAAK,gBAAgB,GAAG;IACtB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,WAAW,kBAAmB,gBAAgB,4CAmC1D,CAAA"}
1
+ {"version":3,"file":"SortControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/SortControl.tsx"],"names":[],"mappings":"AAOA,KAAK,gBAAgB,GAAG;IACtB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,WAAW,kBAAmB,gBAAgB,4CAoC1D,CAAA"}
@@ -77,6 +77,9 @@ var SortControl = function(param) {
77
77
  required: false,
78
78
  min: 1
79
79
  })), {
80
+ onWheel: function(event) {
81
+ return event.currentTarget.blur();
82
+ },
80
83
  placeholder: t('Design:ordering'),
81
84
  isInvalid: Boolean(errors.sort),
82
85
  disabled: isLoading
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.69.4",
3
+ "version": "0.69.6-dev.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -42,9 +42,9 @@
42
42
  ]
43
43
  },
44
44
  "peerDependencies": {
45
- "@licklist/core": "0.30.3",
45
+ "@licklist/core": "0.30.5-dev.0",
46
46
  "@licklist/eslint-config": "0.5.6",
47
- "@licklist/plugins": "0.33.1",
47
+ "@licklist/plugins": "0.33.4-dev.0",
48
48
  "lodash": "4.17.21",
49
49
  "luxon": "3.5.0",
50
50
  "react": "17.0.2",
@@ -61,9 +61,9 @@
61
61
  "@dnd-kit/utilities": "2.0.0",
62
62
  "@fortawesome/fontawesome-svg-core": "1.2.34",
63
63
  "@fortawesome/free-solid-svg-icons": "5.15.2",
64
- "@licklist/core": "0.30.3",
64
+ "@licklist/core": "0.30.5-dev.0",
65
65
  "@licklist/eslint-config": "0.5.6",
66
- "@licklist/plugins": "0.33.1",
66
+ "@licklist/plugins": "0.33.4-dev.0",
67
67
  "@mantine/core": "6.0.22",
68
68
  "@mantine/hooks": "6.0.22",
69
69
  "@mdx-js/react": "1.6.22",
@@ -95,7 +95,6 @@
95
95
  "bootstrap": "4.6.0",
96
96
  "bootstrap-social": "5.1.1",
97
97
  "clsx": "1.1.1",
98
- "date-fns": "2.29.3",
99
98
  "emojibase": "6.1.0",
100
99
  "emojibase-data": "7.0.1",
101
100
  "emojibase-regex": "6.0.1",
@@ -202,8 +201,10 @@
202
201
  "yarn tsc"
203
202
  ]
204
203
  },
204
+ "packageManager": "yarn@4.4.0",
205
205
  "volta": {
206
206
  "node": "20.9.0",
207
207
  "yarn": "4.4.0"
208
- }
208
+ },
209
+ "stableVersion": "0.69.1-dev.3"
209
210
  }
@@ -76,6 +76,7 @@ export const AffiliateForm = ({
76
76
  const copyToClipboard = () =>
77
77
  // eslint-disable-next-line consistent-return
78
78
  window.navigator.clipboard.writeText(formValues.link)
79
+
79
80
  return (
80
81
  <FormProvider {...form}>
81
82
  <Form onSubmit={form.handleSubmit(handleSubmit)}>
@@ -44,7 +44,7 @@ const LoginComponent = ({
44
44
  const handleError = (error: any) => {
45
45
  notification.danger({
46
46
  title: 'Error',
47
- message: error.message,
47
+ message: error?.response?.data?.message || error.message,
48
48
  })
49
49
  }
50
50
 
@@ -1,40 +1,31 @@
1
+ import { TimeZone } from '@licklist/core/dist/DataMapper/Common/TimeZoneDataMapper'
1
2
  import { DateTime, Interval } from 'luxon'
2
3
 
3
- export const getMonthCalendarDates = (
4
- initialDate: DateTime,
5
- timeZone?: string,
6
- ): DateTime[] => {
4
+ type Builder = (args: {
5
+ initialDate?: DateTime
6
+ timeZone: TimeZone['name']
7
+ }) => DateTime[]
8
+
9
+ export const getMonthCalendarDates: Builder = ({
10
+ initialDate: _initialDate,
11
+ timeZone,
12
+ }): DateTime[] => {
13
+ const initialDate = _initialDate || DateTime.now().setZone(timeZone)
14
+
7
15
  const startOfMonth = initialDate.startOf('month')
8
16
  const endOfMonth = initialDate.endOf('month')
9
17
 
10
- const dateTimes = Interval.fromDateTimes(startOfMonth, endOfMonth)
18
+ return Interval.fromDateTimes(startOfMonth, endOfMonth)
11
19
  .splitBy({ day: 1 })
12
20
  .map((d) => d.start)
13
-
14
- if (timeZone) {
15
- return dateTimes.map((date) =>
16
- date.setZone(timeZone, { keepLocalTime: true }),
17
- )
18
- }
19
-
20
- return dateTimes
21
21
  }
22
22
 
23
- export const getWeekCalendarDates = (
24
- initialDate: DateTime,
25
- timeZone?: string,
26
- ): DateTime[] => {
23
+ export const getWeekCalendarDates: Builder = ({ timeZone }): DateTime[] => {
24
+ const initialDate = DateTime.now().setZone(timeZone)
25
+
27
26
  const lastDay = initialDate.plus({ days: 7 })
28
27
 
29
- const dateTimes = Interval.fromDateTimes(initialDate, lastDay)
28
+ return Interval.fromDateTimes(initialDate, lastDay)
30
29
  .splitBy({ day: 1 })
31
30
  .map((d) => d.start)
32
-
33
- if (timeZone) {
34
- return dateTimes.map((date) =>
35
- date.setZone(timeZone, { keepLocalTime: true }),
36
- )
37
- }
38
-
39
- return dateTimes
40
31
  }
@@ -6,9 +6,9 @@ import {
6
6
  } from '@licklist/core/dist/Config'
7
7
  import { getDayWithOrdinal } from '@licklist/plugins/dist/utils/formatDate'
8
8
  import clsx from 'clsx'
9
- import { isToday, isTomorrow } from 'date-fns'
10
9
  import { DateTime } from 'luxon'
11
10
  import { useTranslation } from 'react-i18next'
11
+ import { isToday, isTomorrow } from '@licklist/plugins/dist'
12
12
  import { DateTimeButtonProps, Variant } from './DateTimeButton'
13
13
 
14
14
  type DateContentProps = Pick<
@@ -55,9 +55,9 @@ export const DateContent = ({
55
55
  }
56
56
 
57
57
  const getDate = (date: DateTime): string => {
58
- if (isToday(date.toJSDate())) return 'today'
58
+ if (isToday(date)) return 'today'
59
59
 
60
- if (isTomorrow(date.toJSDate())) return 'tomorrow'
60
+ if (isTomorrow(date)) return 'tomorrow'
61
61
 
62
62
  return date.toFormat(DAY_OF_WEEK)
63
63
  }
@@ -64,6 +64,7 @@ export interface EditEventFormProps extends HasPermissionProp {
64
64
  isExternalPaymentLinkEnabled?: boolean
65
65
  timeZone: string
66
66
  eventProductSet?: ProductSet
67
+ overrideNameError?: string
67
68
  }
68
69
 
69
70
  const eventImageTypes = {
@@ -85,6 +86,7 @@ export const EditEventForm = ({
85
86
  isExternalPaymentLinkEnabled,
86
87
  timeZone,
87
88
  eventProductSet,
89
+ overrideNameError,
88
90
  }: EditEventFormProps) => {
89
91
  const { t } = useTranslation(['Design', 'Validation'])
90
92
 
@@ -406,6 +408,7 @@ export const EditEventForm = ({
406
408
  showEditProductSet={showEditProductSet}
407
409
  timeZone={timeZone}
408
410
  eventProductSet={eventProductSet}
411
+ overrideNameError={overrideNameError}
409
412
  />
410
413
 
411
414
  {hasPermission && !showEditProductSet && (
@@ -5,9 +5,12 @@ import { useId } from '@react-aria/utils'
5
5
  import { Controller, useFormContext } from 'react-hook-form'
6
6
  import { HasPermissionProp } from '@licklist/plugins/dist/types/permission/Permission'
7
7
  import { ProductSet } from '@licklist/core/dist/DataMapper/Product/ProductSetDataMapper'
8
+ import { uniqBy } from 'lodash'
9
+ import { getTypeHeadItemsFromMenus } from '../../../../product-set/utils'
8
10
  import { ConfirmModal } from '../../../../modals/confirmation/ConfirmModal'
9
11
  import { EditEventFormValues } from '../EditEventForm/EditEventForm'
10
12
  import { EditEventProductSet } from './component/EditEventProductSet'
13
+ import { Typeahead } from '../../../../typeahead'
11
14
 
12
15
  interface SelectEventProductSetProps extends HasPermissionProp {
13
16
  productSets?: ProductSet[]
@@ -17,6 +20,7 @@ interface SelectEventProductSetProps extends HasPermissionProp {
17
20
  setEditProductSetId: (value: string) => void
18
21
  timeZone: string
19
22
  eventProductSet?: ProductSet
23
+ overrideNameError?: string
20
24
  }
21
25
 
22
26
  export const SelectEventProductSet = ({
@@ -27,6 +31,7 @@ export const SelectEventProductSet = ({
27
31
  setShowEditProductSet,
28
32
  timeZone,
29
33
  eventProductSet,
34
+ overrideNameError,
30
35
  }: SelectEventProductSetProps) => {
31
36
  const productSets = eventProductSet
32
37
  ? [..._productSets, eventProductSet]
@@ -48,6 +53,22 @@ export const SelectEventProductSet = ({
48
53
  const productSetId = watch('productSetId')
49
54
  const editedProductSet = watch('editedProductSet')
50
55
 
56
+ const typeheadValues = uniqBy(
57
+ getTypeHeadItemsFromMenus(
58
+ editedProductSet
59
+ ? productSets.map((productSet) =>
60
+ productSet.id === editedProductSet.id
61
+ ? editedProductSet
62
+ : productSet,
63
+ )
64
+ : productSets,
65
+ ),
66
+ (item) => item.id,
67
+ )
68
+ const selectedProductSetTypeheadValue = productSetId
69
+ ? typeheadValues?.find((typeheadValue) => typeheadValue.id === productSetId)
70
+ : undefined
71
+
51
72
  const onEditProductSet = useCallback(
52
73
  () => {
53
74
  setEditProductSetId(String(productSetId))
@@ -101,6 +122,7 @@ export const SelectEventProductSet = ({
101
122
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
102
123
  const onSubmit = (value: EditEventFormValues['editedProductSet']) => {
103
124
  setShowEditProductSet(false)
125
+ setValue('productSetId', value.id)
104
126
  setValue('editedProductSet', value)
105
127
  }
106
128
 
@@ -116,93 +138,73 @@ export const SelectEventProductSet = ({
116
138
  <Controller
117
139
  control={control}
118
140
  name='productSetId'
119
- render={({ field }) => {
120
- const fieldValue = String(field.value)
121
- return (
122
- <>
123
- <div className='d-flex align-items-center flex-row w-100'>
124
- <ConfirmModal>
125
- {(confirm) => (
126
- <Form.Control
127
- as='select'
128
- onChange={(e) =>
129
- onChangeProductSet(Number(e.target.value), confirm)
130
- }
131
- isInvalid={Boolean(errors.productSetId)}
132
- value={fieldValue}
133
- >
134
- <option value='' hidden>
135
- {t('Design:chooseProductSet')}
136
- </option>
137
- {productSets?.map((productSet) => {
138
- const isCurrentEditedProductSet =
139
- editedProductSet &&
140
- editedProductSet?.id === productSet?.id
141
- return (
142
- <option key={productSet.id} value={productSet.id}>
143
- {isCurrentEditedProductSet ||
144
- productSet.isOverride
145
- ? `[${t('edited')}] ${
146
- isCurrentEditedProductSet
147
- ? editedProductSet?.name
148
- : productSet.name
149
- }`
150
- : productSet.name}
151
- </option>
152
- )
153
- })}
154
- </Form.Control>
155
- )}
156
- </ConfirmModal>
157
-
158
- <div className='buttons-container'>
159
- {!showEditProductSet && !editedProductSet && (
160
- <Button
161
- variant=''
162
- className='btn product-set-button mr-4'
163
- onClick={handleCreateProductSet}
164
- >
165
- {t('addNewProductSet')}
166
- </Button>
167
- )}
168
- {showOverrideProductSet && (
169
- <Button
170
- variant=''
171
- className='btn product-set-button'
172
- onClick={onEditProductSet}
173
- >
174
- {isOverrideProductSet
175
- ? t('editOverrides')
176
- : t('editProductSet')}
177
- </Button>
178
- )}
179
- {showEditProductSet && (
180
- <Button
181
- variant=''
182
- className='btn product-set-button'
183
- onClick={revertEditProductSet}
184
- >
185
- {t('cancelAndRevert')}
186
- </Button>
187
- )}
188
- {!showEditProductSet && editedProductSet && (
189
- <Button
190
- variant=''
191
- className='btn product-set-button ml-4 text-danger'
192
- onClick={revertEditProductSet}
193
- >
194
- {t('undoChanges')}
195
- </Button>
196
- )}
197
- </div>
141
+ render={() => (
142
+ <>
143
+ <div className='d-flex align-items-center flex-row w-100'>
144
+ <ConfirmModal>
145
+ {(confirm) => (
146
+ <Typeahead
147
+ name='productSetId'
148
+ value={selectedProductSetTypeheadValue}
149
+ containerStyles={{ width: '100%' }}
150
+ onChangeValue={(typeheadValue) => {
151
+ onChangeProductSet(Number(typeheadValue.id), confirm)
152
+ }}
153
+ isInvalid={!!overrideNameError}
154
+ options={typeheadValues}
155
+ placeholder={t('Design:choose')}
156
+ noOptionsMessage={t('Design:noAvailableProductSets')}
157
+ />
158
+ )}
159
+ </ConfirmModal>
160
+
161
+ <div className='buttons-container'>
162
+ {!showEditProductSet && !editedProductSet && (
163
+ <Button
164
+ variant=''
165
+ className='btn product-set-button mr-4'
166
+ onClick={handleCreateProductSet}
167
+ >
168
+ {t('addNewProductSet')}
169
+ </Button>
170
+ )}
171
+ {showOverrideProductSet && (
172
+ <Button
173
+ variant=''
174
+ className='btn product-set-button'
175
+ onClick={onEditProductSet}
176
+ >
177
+ {isOverrideProductSet
178
+ ? t('editOverrides')
179
+ : t('editProductSet')}
180
+ </Button>
181
+ )}
182
+ {showEditProductSet && (
183
+ <Button
184
+ variant=''
185
+ className='btn product-set-button'
186
+ onClick={revertEditProductSet}
187
+ >
188
+ {t('cancelAndRevert')}
189
+ </Button>
190
+ )}
191
+ {!showEditProductSet && editedProductSet && (
192
+ <Button
193
+ variant=''
194
+ className='btn product-set-button ml-4 text-danger'
195
+ onClick={revertEditProductSet}
196
+ >
197
+ {t('undoChanges')}
198
+ </Button>
199
+ )}
198
200
  </div>
201
+ </div>
199
202
 
200
- <Form.Control.Feedback type='invalid'>
201
- {errors?.productSetId?.message}
202
- </Form.Control.Feedback>
203
- </>
204
- )
205
- }}
203
+ <div className='manual-form-error'>
204
+ {errors?.productSetId?.message || overrideNameError}
205
+ </div>
206
+ </>
207
+ )}
206
208
  />
207
209
  </Form.Group>
208
210
  </div>
@@ -213,6 +215,7 @@ export const SelectEventProductSet = ({
213
215
  productSetId === editedProductSet?.id && editedProductSet
214
216
  }
215
217
  timeZone={timeZone}
218
+ overrideNameError={overrideNameError}
216
219
  />
217
220
  )}
218
221
  </>
@@ -23,12 +23,14 @@ interface EditEventProductSetProps {
23
23
  onSubmit: (value: EditEventFormValues['editedProductSet']) => void
24
24
  defaultValues?: EditEventFormValues['editedProductSet']
25
25
  timeZone: string
26
+ overrideNameError?: string
26
27
  }
27
28
 
28
29
  export const EditEventProductSet = ({
29
30
  onSubmit,
30
31
  defaultValues,
31
32
  timeZone,
33
+ overrideNameError,
32
34
  }: EditEventProductSetProps) => {
33
35
  const { companyId } = useParams<{
34
36
  companyId: string
@@ -64,7 +66,15 @@ export const EditEventProductSet = ({
64
66
  mode: 'onChange',
65
67
  })
66
68
 
67
- const { reset, handleSubmit, watch } = form
69
+ const { reset, handleSubmit, watch, setError } = form
70
+
71
+ useEffect(() => {
72
+ if (!overrideNameError) {
73
+ return
74
+ }
75
+ setError('name', { message: overrideNameError })
76
+ // eslint-disable-next-line react-hooks/exhaustive-deps
77
+ }, [overrideNameError])
68
78
 
69
79
  const formValues = watch()
70
80
 
@@ -39,7 +39,6 @@ export const getDefaultValues = (
39
39
  ...product,
40
40
  subProducts: subProducts?.map(({ ...subProducts }) => ({
41
41
  ...subProducts,
42
- originalProductId: null,
43
42
  productCategoryId: undefined,
44
43
  })),
45
44
  productCategoryId: undefined,
@@ -21,10 +21,14 @@ export const formatContentWithoutTags = (
21
21
  .replace(/\s\s+/g, ' ')
22
22
 
23
23
  const words = trimmedText.slice(0, maxLength).split(' ')
24
+ const contentWithMinLength = content.slice(0, MIN_EVENT_DESCRIPTION_SIZE)
24
25
  const index = String(content).indexOf(words[words.length - 2])
25
- return content.slice(0, index).concat('...')
26
+ const slicedContent = content.slice(0, index)
27
+ const contentWithMinSize = contentWithMinLength.length > slicedContent.length ? contentWithMinLength : slicedContent
28
+ return contentWithMinSize.concat('...')
26
29
  }
27
30
 
31
+ export const MIN_EVENT_DESCRIPTION_SIZE = 150
28
32
  export const EVENT_DESCRIPTION_SIZE = 350
29
33
 
30
34
  /**
@@ -1,6 +1,8 @@
1
1
  import { ReactNode } from 'react'
2
2
  import clsx from 'clsx'
3
3
  import { Image } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
4
+ import { ZoneResourcesAvailability } from '@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper'
5
+ import { AvailabilityIndicator } from '../../availability-indicator'
4
6
 
5
7
  export const LAYOUT_GRID = 'grid'
6
8
  export const LAYOUT_LIST = 'list'
@@ -15,6 +17,7 @@ export type ActivityCardProps = {
15
17
  layout?: typeof LAYOUT_GRID | typeof LAYOUT_LIST
16
18
  availableTimes?: string | null
17
19
  image?: Image | null
20
+ resources?: ZoneResourcesAvailability
18
21
  }
19
22
 
20
23
  export const ActivityCard = ({
@@ -27,6 +30,7 @@ export const ActivityCard = ({
27
30
  onSelect,
28
31
  isSelected,
29
32
  layout = LAYOUT_GRID,
33
+ resources,
30
34
  }: ActivityCardProps) => {
31
35
  if (layout === LAYOUT_GRID) {
32
36
  return (
@@ -46,6 +50,7 @@ export const ActivityCard = ({
46
50
  {description && (
47
51
  <div className='mt-2 activity-card-description'>{description}</div>
48
52
  )}
53
+ {resources && <AvailabilityIndicator resources={resources} />}
49
54
  </div>
50
55
  </button>
51
56
  )
@@ -71,6 +76,7 @@ export const ActivityCard = ({
71
76
  {description && (
72
77
  <div className='mt-2 activity-card-description'>{description}</div>
73
78
  )}
79
+ {resources && <AvailabilityIndicator resources={resources} />}
74
80
  </div>
75
81
 
76
82
  <hr className='list-activity-card-hr' />
@@ -89,6 +89,7 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
89
89
  <FormControl
90
90
  type='number'
91
91
  onChange={(e) => handleChangeValue(Number(e.target.value))}
92
+ onWheel={(event) => event.currentTarget.blur()}
92
93
  value={value}
93
94
  min={0}
94
95
  max={max}
@@ -101,6 +102,14 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
101
102
  <button
102
103
  type='button'
103
104
  onClick={handleArrowUpClick}
105
+ onWheel={(event) => event.currentTarget.blur()}
106
+ onFocus={(event) =>
107
+ event.target.addEventListener(
108
+ 'wheel',
109
+ (event) => event.preventDefault(),
110
+ { passive: false },
111
+ )
112
+ }
104
113
  className={`payment-number-input__btn-up ${
105
114
  plusButtonGreyedOut && 'disabled-number-input-button'
106
115
  }`}
@@ -51,6 +51,7 @@ export const ProductQuantityInput = ({
51
51
  hasDeposit: category.allowDeposits && product?.deposit < product.price,
52
52
  price: product.price,
53
53
  productCategoryId: category.id,
54
+ zoneId: category.zone?.id,
54
55
  quantity,
55
56
  capacity: product?.capacity,
56
57
  })
@@ -61,6 +61,7 @@ const processedPaymentSummary = ({
61
61
  const total = calculateTotalPrice(order, externalPaymentDetail)
62
62
 
63
63
  const totalDiscount = calculateTotalDiscount(order.payments)
64
+
64
65
  let summaryItems: SummaryItem[] = [
65
66
  {
66
67
  translateKey: AMOUNT_TOTAL,