@licklist/design 0.68.0-dev.0 → 0.68.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 (212) hide show
  1. package/.storybook/main.cjs +12 -15
  2. package/dist/assets/iframe/selectArrow.svg.js +17 -0
  3. package/dist/auth/Login/LoginComponent.js +1 -2
  4. package/dist/calendar/components/CalendarButtons/CalendarButtons.d.ts.map +1 -1
  5. package/dist/calendar/components/CalendarButtons/CalendarButtons.js +40 -35
  6. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
  7. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +23 -24
  8. package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
  9. package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -0
  10. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  11. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +0 -2
  12. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
  13. package/dist/index.js +0 -1
  14. package/dist/layout/DropDown.d.ts +1 -2
  15. package/dist/layout/DropDown.d.ts.map +1 -1
  16. package/dist/modals/confirmation/ConfirmModal.d.ts +1 -3
  17. package/dist/modals/confirmation/ConfirmModal.d.ts.map +1 -1
  18. package/dist/modals/confirmation/ConfirmModal.js +8 -172
  19. package/dist/product-set/card/ProductSetCard.d.ts +2 -6
  20. package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
  21. package/dist/product-set/card/ProductSetCard.js +11 -30
  22. package/dist/product-set/control/DateInput.d.ts.map +1 -1
  23. package/dist/product-set/control/DateInput.js +2 -2
  24. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  25. package/dist/product-set/form/ProductCategoriesControl.js +2 -48
  26. package/dist/product-set/form/ProductSetForm.d.ts +1 -4
  27. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  28. package/dist/product-set/form/ProductSetForm.js +1 -59
  29. package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -1
  30. package/dist/product-set/form/ProductZonesControl.js +2 -0
  31. package/dist/product-set/form/SelectCategoryModal.d.ts +0 -12
  32. package/dist/product-set/form/SelectCategoryModal.d.ts.map +1 -1
  33. package/dist/product-set/form/SelectCategoryModal.js +1 -1
  34. package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
  35. package/dist/product-set/form/SubProductsControl.js +3 -0
  36. package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
  37. package/dist/product-set/form/VenueMapsControl.js +3 -0
  38. package/dist/product-set/form/index.d.ts +0 -1
  39. package/dist/product-set/form/index.d.ts.map +1 -1
  40. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  41. package/dist/product-set/utils/index.d.ts +0 -7
  42. package/dist/product-set/utils/index.d.ts.map +1 -1
  43. package/dist/product-set/utils/index.js +1 -10
  44. package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +2 -3
  45. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  46. package/dist/sales/booking/results/components/ResultCard.js +2 -0
  47. package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
  48. package/dist/snippet/snippet-template/preview/Preview.js +0 -6
  49. package/dist/sortable-tree/SortableTreeItem.d.ts +1 -2
  50. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  51. package/dist/sortable-tree/SortableTreeItem.js +4 -10
  52. package/dist/styles/auth/AccessDenied.scss +1 -1
  53. package/dist/styles/back-button/BackButton.scss +24 -25
  54. package/dist/styles/back-button/_index.scss +1 -1
  55. package/dist/styles/company-user-form/UserForm.scss +7 -4
  56. package/dist/styles/company-user-form/_index.scss +1 -1
  57. package/dist/styles/custom-fields/CreateSortableListItem.scss +1 -2
  58. package/dist/styles/custom-fields/_index.scss +1 -1
  59. package/dist/styles/customers/Filter.scss +5 -5
  60. package/dist/styles/events/EditEventModal.scss +3 -1
  61. package/dist/styles/events/EventVenueMap.scss +7 -7
  62. package/dist/styles/form/Input.scss +1 -1
  63. package/dist/styles/header/Header.scss +1 -1
  64. package/dist/styles/header/elements/CompanySelector.scss +2 -2
  65. package/dist/styles/iframe-events/Calendar.scss +1 -0
  66. package/dist/styles/iframe-events/CalendarSelect.scss +1 -1
  67. package/dist/styles/iframe-events/CategoryStepsForm.scss +7 -6
  68. package/dist/styles/iframe-events/Event.scss +4 -2
  69. package/dist/styles/iframe-events/EventForm.scss +54 -54
  70. package/dist/styles/iframe-events/EventNavigationFooter.scss +0 -1
  71. package/dist/styles/iframe-events/TicketDescription.scss +1 -1
  72. package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  73. package/dist/styles/iframe-payments/PaymentForm.scss +1 -1
  74. package/dist/styles/layout/BackgroundVideoContainer.scss +2 -2
  75. package/dist/styles/notification/Notification.scss +1 -1
  76. package/dist/styles/order-items-table/OrderItemsTable.scss +2 -1
  77. package/dist/styles/product-set/CreateProductSetItem.scss +13 -15
  78. package/dist/styles/product-set/DateAndRecurrenceInput.scss +8 -6
  79. package/dist/styles/product-set/EditCategoryModal.scss +4 -4
  80. package/dist/styles/product-set/EditProductModal.scss +3 -3
  81. package/dist/styles/product-set/EditStepModal.scss +4 -4
  82. package/dist/styles/product-set/EditVenueMapSetModal.scss +6 -6
  83. package/dist/styles/product-set/ProductSetForm.scss +2 -25
  84. package/dist/styles/product-set/TutorialGifCard.scss +1 -1
  85. package/dist/styles/product-set/_index.scss +2 -2
  86. package/dist/styles/report/ReportCard.scss +0 -1
  87. package/dist/styles/report/_index.scss +1 -1
  88. package/dist/styles/resources-blocking/_index.scss +0 -4
  89. package/dist/styles/sales/BookingFilter.scss +2 -2
  90. package/dist/styles/sales/BookingResults.scss +1 -1
  91. package/dist/styles/sales/BookingTabs.scss +5 -7
  92. package/dist/styles/sales/Filters.scss +4 -5
  93. package/dist/styles/sales/GuestProfile.scss +175 -170
  94. package/dist/styles/sales/LifeTimeSales.scss +1 -1
  95. package/dist/styles/sales/ManualBooking.scss +2 -4
  96. package/dist/styles/snippet-templates/_snippetVariables.scss +244 -63
  97. package/dist/styles/sortable-field/SortableField.scss +16 -16
  98. package/dist/styles/sortable-field/_index.scss +1 -1
  99. package/dist/styles/sortable-tree/Item.scss +4 -4
  100. package/dist/styles/table/Table.scss +1 -1
  101. package/dist/styles/themes/bookedit/_variables.scss +32 -10
  102. package/dist/styles/themes/licklist/_variables.scss +1 -1
  103. package/dist/styles/tiptap-editor/TiptapEditor.scss +10 -9
  104. package/dist/styles/tiptap-editor/_index.scss +1 -1
  105. package/dist/styles/venue-map-sets/VenueMapSetForm.scss +4 -5
  106. package/dist/styles/virtualized/_index.scss +1 -1
  107. package/dist/styles/zones/ZoneRecurrencesControl.scss +8 -6
  108. package/dist/typeahead/Typeahead.d.ts +1 -5
  109. package/dist/typeahead/Typeahead.d.ts.map +1 -1
  110. package/dist/typeahead/Typeahead.js +2 -9
  111. package/package.json +6 -8
  112. package/src/auth/ChangePassword/ChangePassword.stories.tsx +1 -1
  113. package/src/auth/Login/LoginComponent.tsx +1 -1
  114. package/src/auth/ResetPassword/ResetPassword.stories.tsx +1 -1
  115. package/src/calendar/components/CalendarButtons/CalendarButtons.tsx +28 -31
  116. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +34 -32
  117. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -0
  118. package/src/header/elements/Elements.stories.tsx +1 -1
  119. package/src/help/popover/Popover.stories.tsx +1 -1
  120. package/src/iframe/event/event-venue-map/IframeEventVenueMap.stories.tsx +3 -3
  121. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +0 -1
  122. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +0 -1
  123. package/src/layout/DropDown.tsx +1 -2
  124. package/src/modals/confirmation/ConfirmModal.tsx +3 -19
  125. package/src/product-set/card/ProductSetCard.stories.tsx +1 -3
  126. package/src/product-set/card/ProductSetCard.tsx +8 -47
  127. package/src/product-set/control/DateInput.tsx +1 -2
  128. package/src/product-set/control/ProductSetRecurrenceControl.stories.tsx +2 -2
  129. package/src/product-set/form/ProductCategoriesControl.tsx +1 -37
  130. package/src/product-set/form/ProductSetForm.tsx +3 -18
  131. package/src/product-set/form/ProductZonesControl.tsx +7 -4
  132. package/src/product-set/form/SelectCategoryModal.stories.tsx +1 -1
  133. package/src/product-set/form/SelectCategoryModal.tsx +2 -2
  134. package/src/product-set/form/SubProductsControl.tsx +3 -0
  135. package/src/product-set/form/VenueMapsControl.tsx +3 -0
  136. package/src/product-set/form/index.ts +0 -1
  137. package/src/product-set/product/ProductControl.tsx +5 -1
  138. package/src/product-set/product/advanced-options/AdvancedOptions.tsx +5 -5
  139. package/src/product-set/product/booking-management/ProductBookingManagement.stories.tsx +1 -1
  140. package/src/product-set/product/quantity/ProductQuantity.stories.tsx +1 -1
  141. package/src/product-set/product-zone/ProductZoneControl.tsx +9 -9
  142. package/src/product-set/utils/index.ts +0 -11
  143. package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +2 -2
  144. package/src/sales/booking/results/components/ResultCard.tsx +2 -0
  145. package/src/setting/admin/AdminSetting.stories.tsx +0 -1
  146. package/src/setting/system/SystemSetting.stories.tsx +1 -1
  147. package/src/snippet/snippet-template/preview/Preview.tsx +0 -6
  148. package/src/sortable-tree/SortableTreeItem.tsx +0 -6
  149. package/src/styles/auth/AccessDenied.scss +1 -1
  150. package/src/styles/back-button/BackButton.scss +24 -25
  151. package/src/styles/back-button/_index.scss +1 -1
  152. package/src/styles/company-user-form/UserForm.scss +7 -4
  153. package/src/styles/company-user-form/_index.scss +1 -1
  154. package/src/styles/custom-fields/CreateSortableListItem.scss +1 -2
  155. package/src/styles/custom-fields/_index.scss +1 -1
  156. package/src/styles/customers/Filter.scss +5 -5
  157. package/src/styles/events/EditEventModal.scss +3 -1
  158. package/src/styles/events/EventVenueMap.scss +7 -7
  159. package/src/styles/form/Input.scss +1 -1
  160. package/src/styles/header/Header.scss +1 -1
  161. package/src/styles/header/elements/CompanySelector.scss +2 -2
  162. package/src/styles/iframe-events/Calendar.scss +1 -0
  163. package/src/styles/iframe-events/CalendarSelect.scss +1 -1
  164. package/src/styles/iframe-events/CategoryStepsForm.scss +7 -6
  165. package/src/styles/iframe-events/Event.scss +4 -2
  166. package/src/styles/iframe-events/EventForm.scss +54 -54
  167. package/src/styles/iframe-events/EventNavigationFooter.scss +0 -1
  168. package/src/styles/iframe-events/TicketDescription.scss +1 -1
  169. package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  170. package/src/styles/iframe-payments/PaymentForm.scss +1 -1
  171. package/src/styles/layout/BackgroundVideoContainer.scss +2 -2
  172. package/src/styles/notification/Notification.scss +1 -1
  173. package/src/styles/order-items-table/OrderItemsTable.scss +2 -1
  174. package/src/styles/product-set/CreateProductSetItem.scss +13 -15
  175. package/src/styles/product-set/DateAndRecurrenceInput.scss +8 -6
  176. package/src/styles/product-set/EditCategoryModal.scss +4 -4
  177. package/src/styles/product-set/EditProductModal.scss +3 -3
  178. package/src/styles/product-set/EditStepModal.scss +4 -4
  179. package/src/styles/product-set/EditVenueMapSetModal.scss +6 -6
  180. package/src/styles/product-set/ProductSetForm.scss +2 -25
  181. package/src/styles/product-set/TutorialGifCard.scss +1 -1
  182. package/src/styles/product-set/_index.scss +2 -2
  183. package/src/styles/report/ReportCard.scss +0 -1
  184. package/src/styles/report/_index.scss +1 -1
  185. package/src/styles/resources-blocking/_index.scss +0 -4
  186. package/src/styles/sales/BookingFilter.scss +2 -2
  187. package/src/styles/sales/BookingResults.scss +1 -1
  188. package/src/styles/sales/BookingTabs.scss +5 -7
  189. package/src/styles/sales/Filters.scss +4 -5
  190. package/src/styles/sales/GuestProfile.scss +175 -170
  191. package/src/styles/sales/LifeTimeSales.scss +1 -1
  192. package/src/styles/sales/ManualBooking.scss +2 -4
  193. package/src/styles/snippet-templates/_snippetVariables.scss +244 -63
  194. package/src/styles/sortable-field/SortableField.scss +16 -16
  195. package/src/styles/sortable-field/_index.scss +1 -1
  196. package/src/styles/sortable-tree/Item.scss +4 -4
  197. package/src/styles/table/Table.scss +1 -1
  198. package/src/styles/themes/bookedit/_variables.scss +32 -10
  199. package/src/styles/themes/licklist/_variables.scss +1 -1
  200. package/src/styles/tiptap-editor/TiptapEditor.scss +10 -9
  201. package/src/styles/tiptap-editor/_index.scss +1 -1
  202. package/src/styles/venue-map-sets/VenueMapSetForm.scss +4 -5
  203. package/src/styles/virtualized/_index.scss +1 -1
  204. package/src/styles/zones/ZoneRecurrencesControl.scss +8 -6
  205. package/src/tiptap-editor/TipTapEditor.stories.tsx +4 -6
  206. package/src/tiptap-editor/TipTapMenu/TipTapMenu.stories.tsx +2 -5
  207. package/src/typeahead/Typeahead.tsx +1 -15
  208. package/yarn.lock +14 -40
  209. package/dist/product-set/form/ProductSetNameControl.d.ts +0 -6
  210. package/dist/product-set/form/ProductSetNameControl.d.ts.map +0 -1
  211. package/dist/product-set/form/ProductSetNameControl.js +0 -35
  212. package/src/product-set/form/ProductSetNameControl.tsx +0 -27
@@ -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, 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;
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;
35
35
  var control = useFormContext().control;
36
36
  var getStyle = function() {
37
37
  var couponFormStyle = isCouponForm ? {
@@ -53,21 +53,14 @@ function Typeahead(param) {
53
53
  var field = param.field;
54
54
  return /*#__PURE__*/ jsx(Select, {
55
55
  placeholder: placeholder,
56
- value: value !== null && value !== void 0 ? value : field.value,
56
+ value: field.value,
57
57
  isMulti: isMultipleChoise,
58
58
  styles: {
59
- container: function(base) {
60
- return _object_spread({}, base, containerStyles);
61
- },
62
59
  control: function(base) {
63
60
  return _object_spread({}, base, getStyle());
64
61
  }
65
62
  },
66
63
  onChange: function(value) {
67
- if (onChangeValue) {
68
- onChangeValue(value);
69
- return;
70
- }
71
64
  field.onChange(value);
72
65
  },
73
66
  options: options,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.68.0-dev.0",
3
+ "version": "0.68.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.29.1-dev.3",
45
+ "@licklist/core": "0.30.0",
46
46
  "@licklist/eslint-config": "0.5.5",
47
- "@licklist/plugins": "0.32.0-dev.3",
47
+ "@licklist/plugins": "0.33.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.29.1-dev.3",
64
+ "@licklist/core": "0.30.0",
65
65
  "@licklist/eslint-config": "0.5.5",
66
- "@licklist/plugins": "0.32.0-dev.3",
66
+ "@licklist/plugins": "0.33.0",
67
67
  "@mdx-js/react": "1.6.22",
68
68
  "@popperjs/core": "2.11.8",
69
69
  "@react-aria/utils": "3.9.0",
@@ -195,10 +195,8 @@
195
195
  "yarn tsc"
196
196
  ]
197
197
  },
198
- "packageManager": "yarn@4.4.0",
199
198
  "volta": {
200
199
  "node": "20.9.0",
201
200
  "yarn": "4.4.0"
202
- },
203
- "stableVersion": "0.66.7-dev.5"
201
+ }
204
202
  }
@@ -15,7 +15,7 @@ export const ChangePassword: Story<{}> = (args) => (
15
15
  );
16
16
 
17
17
  export const ChangePasswordForm: Story<ChangePasswordFormComponentProps> = (
18
- args
18
+ args,
19
19
  ) => (
20
20
  <>
21
21
  <Router>
@@ -44,7 +44,7 @@ const LoginComponent = ({
44
44
  const handleError = (error: any) => {
45
45
  notification.danger({
46
46
  title: "Error",
47
- message: error?.response?.data?.message || error.message,
47
+ message: error.message,
48
48
  });
49
49
  };
50
50
 
@@ -14,7 +14,7 @@ export const ResetPassword: Story<{}> = (args) => (
14
14
  <ResetPasswordComponent {...args} />
15
15
  );
16
16
  export const ResetPasswordForm: Story<ResetPasswordFormComponentProps> = (
17
- args
17
+ args,
18
18
  ) => (
19
19
  <>
20
20
  <Router>
@@ -2,7 +2,7 @@ import { useCallback, useMemo } from "react";
2
2
  import { Button } from "react-bootstrap";
3
3
  import { useTranslation } from "react-i18next";
4
4
  import { range } from "lodash";
5
- import { DateTime } from "luxon";
5
+ import { ReactComponent as SelectArrow } from "../../../assets/iframe/selectArrow.svg";
6
6
  import { CalendarSelect } from "../CalendarSelect";
7
7
  import { CalendarProps } from "../../Calendar";
8
8
 
@@ -26,21 +26,15 @@ export const CalendarButtons = ({
26
26
  }: CalendarButtonsProps) => {
27
27
  const { t } = useTranslation("Design");
28
28
 
29
- const onSelectMonth = useCallback(
30
- (value: string) => {
31
- const selectedMonth = Number(value);
32
- const nextDateTime = currentDate.set({ month: selectedMonth });
33
-
34
- if (nextDateTime <= initialDate) {
35
- setCurrentDate(initialDate);
36
- return;
37
- }
29
+ const onSelectNextMonth = useCallback(() => {
30
+ setCurrentDate((prevDate) => prevDate.plus({ months: 1 }));
31
+ // eslint-disable-next-line react-hooks/exhaustive-deps
32
+ }, []);
38
33
 
39
- setCurrentDate(nextDateTime);
40
- },
34
+ const onSelectPreviousMonth = useCallback(() => {
35
+ setCurrentDate((prevDate) => prevDate.minus({ month: 1 }));
41
36
  // eslint-disable-next-line react-hooks/exhaustive-deps
42
- [setCurrentDate, currentDate],
43
- );
37
+ }, []);
44
38
 
45
39
  const yearOptions = useMemo(() => {
46
40
  return range(initialDate.year, initialDate.year + 5, 1).map((year) => {
@@ -48,18 +42,10 @@ export const CalendarButtons = ({
48
42
  });
49
43
  }, [initialDate]);
50
44
 
51
- const monthOptions = useMemo(() => {
52
- const initialMonth =
53
- currentDate.year > initialDate.year ? 1 : initialDate.month;
54
- return range(initialMonth, 13).map((monthNumber) => {
55
- return {
56
- label: DateTime.fromObject({ month: monthNumber }).toLocaleString({
57
- month: "long",
58
- }),
59
- value: monthNumber,
60
- };
61
- });
62
- }, [initialDate, currentDate]);
45
+ const canMoveBack = useMemo(
46
+ () => currentDate > initialDate,
47
+ [currentDate, initialDate],
48
+ );
63
49
 
64
50
  const onSelectYear = (value: string) => {
65
51
  const selectedYear = Number(value);
@@ -121,11 +107,22 @@ export const CalendarButtons = ({
121
107
  <hr />
122
108
  <div className="calendar-buttons">
123
109
  <div className="buttons-wrapper">
124
- <CalendarSelect
125
- options={monthOptions}
126
- onChange={onSelectMonth}
127
- value={currentDate.month}
128
- />
110
+ <Button
111
+ className="calendar-button left-button"
112
+ onClick={onSelectPreviousMonth}
113
+ disabled={!canMoveBack}
114
+ variant="link"
115
+ >
116
+ <SelectArrow />
117
+ </Button>
118
+ <div className="month-title">{currentDate.toFormat("MMMM")}</div>
119
+ <Button
120
+ className="calendar-button"
121
+ onClick={onSelectNextMonth}
122
+ variant="link"
123
+ >
124
+ <SelectArrow />
125
+ </Button>
129
126
  </div>
130
127
  <CalendarSelect
131
128
  options={yearOptions}
@@ -5,11 +5,9 @@ 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 { getTypeHeadItemsFromMenus } from "../../../../product-set/utils";
9
8
  import { ConfirmModal } from "../../../../modals/confirmation/ConfirmModal";
10
9
  import { EditEventFormValues } from "../EditEventForm/EditEventForm";
11
10
  import { EditEventProductSet } from "./component/EditEventProductSet";
12
- import { Typeahead } from "../../../../typeahead";
13
11
 
14
12
  interface SelectEventProductSetProps extends HasPermissionProp {
15
13
  productSets?: ProductSet[];
@@ -44,21 +42,6 @@ export const SelectEventProductSet = ({
44
42
  const productSetId = watch("productSetId");
45
43
  const editedProductSet = watch("editedProductSet");
46
44
 
47
- const typeheadValues = getTypeHeadItemsFromMenus(
48
- editedProductSet
49
- ? productSets.map((productSet) => {
50
- if (productSet.id === editedProductSet.id) {
51
- return editedProductSet;
52
- }
53
-
54
- return productSet;
55
- })
56
- : productSets,
57
- );
58
- const selectedProductSetTypeheadValue = productSetId
59
- ? typeheadValues?.find((typeheadValue) => typeheadValue.id === productSetId)
60
- : undefined;
61
-
62
45
  const onEditProductSet = useCallback(
63
46
  () => {
64
47
  setEditProductSetId(String(productSetId));
@@ -112,7 +95,6 @@ export const SelectEventProductSet = ({
112
95
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
113
96
  const onSubmit = (value: EditEventFormValues["editedProductSet"]) => {
114
97
  setShowEditProductSet(false);
115
- setValue("productSetId", value.id);
116
98
  setValue("editedProductSet", value);
117
99
  };
118
100
 
@@ -128,29 +110,49 @@ export const SelectEventProductSet = ({
128
110
  <Controller
129
111
  control={control}
130
112
  name="productSetId"
131
- render={() => {
113
+ render={({ field }) => {
114
+ const fieldValue = String(field.value);
132
115
  return (
133
116
  <>
134
117
  <div className="d-flex align-items-center flex-row w-100">
135
118
  <ConfirmModal>
136
119
  {(confirm) => {
137
120
  return (
138
- <Typeahead
139
- name="productSetId"
140
- value={selectedProductSetTypeheadValue}
141
- containerStyles={{ width: "100%" }}
142
- onChangeValue={(typeheadValue) => {
121
+ <Form.Control
122
+ as="select"
123
+ onChange={(e) =>
143
124
  onChangeProductSet(
144
- Number(typeheadValue.id),
125
+ Number(e.target.value),
145
126
  confirm,
127
+ )
128
+ }
129
+ isInvalid={Boolean(errors.productSetId)}
130
+ value={fieldValue}
131
+ >
132
+ <option value="" hidden>
133
+ {t("Design:chooseProductSet")}
134
+ </option>
135
+ {productSets?.map((productSet) => {
136
+ const isCurrentEditedProductSet =
137
+ editedProductSet &&
138
+ editedProductSet?.id === productSet?.id;
139
+ return (
140
+ <option
141
+ key={productSet.id}
142
+ value={productSet.id}
143
+ >
144
+ {isCurrentEditedProductSet ||
145
+ productSet.isOverride
146
+ ? `[${t("edited")}] ${
147
+ isCurrentEditedProductSet
148
+ ? editedProductSet?.name
149
+ : productSet.name
150
+ }`
151
+ : productSet.name}
152
+ </option>
146
153
  );
147
- }}
148
- options={typeheadValues}
149
- placeholder={t("Design:choose")}
150
- noOptionsMessage={t(
151
- "Design:noAvailableProductSets",
152
- )}
153
- />
154
+ })}
155
+ </Form.Control>
154
156
  );
155
157
  }}
156
158
  </ConfirmModal>
@@ -37,6 +37,7 @@ export const getDefaultValues = (
37
37
  ...product,
38
38
  subProducts: subProducts?.map(({ ...subProducts }) => ({
39
39
  ...subProducts,
40
+ originalProductId: null,
40
41
  productCategoryId: undefined,
41
42
  })),
42
43
  productCategoryId: undefined,
@@ -22,7 +22,7 @@ CompanySelector.args = {
22
22
  };
23
23
 
24
24
  export const CompanySelectorWithOneItem: Story<CompanySelectorProps> = (
25
- args
25
+ args,
26
26
  ) => {
27
27
  return <CompanySelectorComponent {...args} />;
28
28
  };
@@ -17,7 +17,7 @@ export const HelpPopoverPrimaryVariant: Story<HelpPopoverProps> = (args) => (
17
17
  <HelpPopover {...args} />
18
18
  );
19
19
  export const HelpPopoverOutlinedInfoVariant: Story<HelpPopoverProps> = (
20
- args
20
+ args,
21
21
  ) => <HelpPopover {...args} />;
22
22
 
23
23
  DefaultHelpPopover.args = {
@@ -260,9 +260,9 @@ export function Default() {
260
260
  (point) =>
261
261
  Boolean(
262
262
  MENU_STEPS[0].pointProducts.find(
263
- (pointProduct) => pointProduct.pointId === point.id
264
- )
265
- )
263
+ (pointProduct) => pointProduct.pointId === point.id,
264
+ ),
265
+ ),
266
266
  )}
267
267
  pointProducts={MENU_STEPS[0].pointProducts}
268
268
  usedInIframe={usedInIframe}
@@ -51,7 +51,6 @@ 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,
55
54
  quantity,
56
55
  capacity: product?.capacity,
57
56
  });
@@ -63,7 +63,6 @@ const processedPaymentSummary = ({
63
63
  const total = calculateTotalPrice(order, externalPaymentDetail);
64
64
 
65
65
  const totalDiscount = calculateTotalDiscount(order.payments);
66
-
67
66
  let summaryItems: SummaryItem[] = [
68
67
  {
69
68
  translateKey: AMOUNT_TOTAL,
@@ -1,4 +1,4 @@
1
- import React, { forwardRef } from "react";
1
+ import { forwardRef } from "react";
2
2
 
3
3
  interface Props {
4
4
  children?: React.ReactNode | React.ReactNode[];
@@ -24,5 +24,4 @@ const DropDown = forwardRef((props: Props, ref: any) => {
24
24
  });
25
25
 
26
26
  DropDown.displayName = "DropDown";
27
-
28
27
  export default DropDown;
@@ -20,9 +20,6 @@ export type ConfirmModalTypes =
20
20
  export interface ConfirmModalProps {
21
21
  type?: ConfirmModalTypes;
22
22
  children?: (confirm: (action: ConfirmAction) => void) => ReactNode;
23
- // confirm function memoize the callback function. It's an alternative function
24
- confirmationHandler?: () => Promise<boolean | undefined>;
25
- disabledButtons?: boolean;
26
23
  title?: string;
27
24
  content?: string | ReactNode;
28
25
  onClose?: () => void;
@@ -40,9 +37,7 @@ export function ConfirmModal({
40
37
  type = "default",
41
38
  children,
42
39
  onClose,
43
- confirmationHandler,
44
40
  title,
45
- disabledButtons,
46
41
  content,
47
42
  hideButtons = false,
48
43
  }: ConfirmModalProps) {
@@ -57,16 +52,10 @@ export function ConfirmModal({
57
52
  setIsOpen(() => true);
58
53
  };
59
54
 
60
- const handleConfirmation = async (e) => {
55
+ const handleConfirmation = (e) => {
61
56
  e.stopPropagation();
62
- if (!actionRef.current && !confirmationHandler) return;
63
- if (confirmationHandler) {
64
- const res = await confirmationHandler();
65
- if (res) {
66
- setIsOpen(() => false);
67
- }
68
- return;
69
- }
57
+ if (!actionRef.current) return;
58
+
70
59
  actionRef.current();
71
60
  setIsOpen(() => false);
72
61
  };
@@ -99,7 +88,6 @@ export function ConfirmModal({
99
88
  <Button
100
89
  variant="danger"
101
90
  className="btn-sm rounded"
102
- disabled={disabledButtons}
103
91
  onClick={handleClose}
104
92
  data-id={CONFIRM_MODAL_ACTION_DECLINE}
105
93
  >
@@ -117,14 +105,12 @@ export function ConfirmModal({
117
105
  variant="outline"
118
106
  className="cancel-button"
119
107
  onClick={handleClose}
120
- disabled={disabledButtons}
121
108
  data-id={CONFIRM_MODAL_ACTION_DECLINE}
122
109
  >
123
110
  {t("cancel")}
124
111
  </Button>
125
112
  <Button
126
113
  variant="danger"
127
- disabled={disabledButtons}
128
114
  onClick={handleConfirmation}
129
115
  data-id={CONFIRM_MODAL_ACTION_CONFIRM}
130
116
  >
@@ -135,7 +121,6 @@ export function ConfirmModal({
135
121
  <>
136
122
  <Button
137
123
  variant="danger"
138
- disabled={disabledButtons}
139
124
  onClick={handleClose}
140
125
  data-id={CONFIRM_MODAL_ACTION_DECLINE}
141
126
  >
@@ -143,7 +128,6 @@ export function ConfirmModal({
143
128
  </Button>
144
129
  <Button
145
130
  variant="success"
146
- disabled={disabledButtons}
147
131
  onClick={handleConfirmation}
148
132
  data-id={CONFIRM_MODAL_ACTION_CONFIRM}
149
133
  >
@@ -9,8 +9,7 @@ export default {
9
9
 
10
10
  export const Default: Story<ProductSetCardProps> = (args) => (
11
11
  <ProductSetCard {...args} />
12
- )
13
-
12
+ );
14
13
 
15
14
  Default.args = {
16
15
  href: "#",
@@ -18,4 +17,3 @@ Default.args = {
18
17
  rrule: "FREQ=WEEKLY;BYDAY=WE",
19
18
  hasPermission: true,
20
19
  };
21
-
@@ -9,20 +9,15 @@ import RouteService from "@licklist/plugins/dist/services/Route/RouteService";
9
9
  import { FaEllipsisH, FaEye, FaTrashAlt } from "react-icons/fa";
10
10
  import { ConfirmModal } from "../../modals";
11
11
  import { MenuButton } from "../../table/MenuButton";
12
- import { ProductSetNameControl } from "../form/ProductSetNameControl";
13
12
 
14
13
  export interface ProductSetCardProps extends HasPermissionProp {
15
14
  name: string;
16
15
  rrule?: string;
17
16
  href: string;
18
- duplicateProductSetName: string;
19
- onChangeDuplicateProductSetName: (value: string) => void;
20
- onCopy: () => Promise<boolean | undefined>;
17
+ onCopy: () => void;
21
18
  onRemove: () => void;
22
- isLoading?: boolean;
23
19
  className?: string;
24
20
  override?: number;
25
- duplicateProductSetError?: string;
26
21
  }
27
22
 
28
23
  export function ProductSetCard({
@@ -31,10 +26,6 @@ export function ProductSetCard({
31
26
  href,
32
27
  onCopy,
33
28
  onRemove,
34
- onChangeDuplicateProductSetName,
35
- duplicateProductSetName,
36
- duplicateProductSetError,
37
- isLoading,
38
29
  className = "",
39
30
  hasPermission = true,
40
31
  override = 0,
@@ -44,23 +35,19 @@ export function ProductSetCard({
44
35
  const productSetCardClasses = `product-set-card ${className}`;
45
36
  const [isOverlayVisibile, setIsOverlayVisible] = useState(false);
46
37
 
47
- const onCardClick = () => {
48
- RouteService.redirectTo(href);
49
- };
50
38
  return (
51
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events
52
39
  <div
53
40
  role="button"
54
41
  tabIndex={0}
55
42
  className="border-0 product-set-card-wrapper w-100 pb-0"
56
- onClick={onCardClick}
43
+ onClick={() => RouteService.redirectTo(href)}
44
+ onKeyUp={() => RouteService.redirectTo(href)}
57
45
  >
58
46
  <div className={productSetCardClasses}>
59
47
  <div className="product-set-card-link">
60
48
  <div className="d-flex flex-column">
61
49
  <div>
62
- {name}
63
- {rrule && `(${RRule.fromString(rrule).toText()})`}
50
+ {name} {rrule && `(${RRule.fromString(rrule).toText()})`}
64
51
  </div>
65
52
  {!!override && (
66
53
  <div className="h6 bold ml-1">
@@ -92,33 +79,14 @@ export function ProductSetCard({
92
79
  >
93
80
  {hasPermission && (
94
81
  <>
95
- <ListGroup.Item
96
- action
97
- as="div"
98
- role="button"
99
- tabIndex={0}
100
- onClick={(e) => e.stopPropagation()}
101
- >
82
+ <ListGroup.Item action as="div">
102
83
  {Boolean(onCopy) && (
103
- <ConfirmModal
104
- // confirm function memoize the callback function and it leads to bugs
105
- confirmationHandler={onCopy}
106
- disabledButtons={isLoading}
107
- content={
108
- <ProductSetNameControl
109
- value={duplicateProductSetName}
110
- onChange={onChangeDuplicateProductSetName}
111
- error={duplicateProductSetError}
112
- />
113
- }
114
- >
84
+ <ConfirmModal>
115
85
  {(confirm) => (
116
86
  <MenuButton
117
87
  onClick={() => {
118
88
  setIsOverlayVisible(false);
119
- onChangeDuplicateProductSetName(name);
120
- // confirm function memoize the callback function and it leads to bugs
121
- confirm(() => {});
89
+ confirm(onCopy);
122
90
  }}
123
91
  name={t("duplicate")}
124
92
  className="product-set-card-menu-item-text"
@@ -127,14 +95,7 @@ export function ProductSetCard({
127
95
  </ConfirmModal>
128
96
  )}
129
97
  </ListGroup.Item>
130
- <ListGroup.Item
131
- action
132
- className="text-danger"
133
- as="div"
134
- role="button"
135
- tabIndex={0}
136
- onClick={(e) => e.stopPropagation()}
137
- >
98
+ <ListGroup.Item action className="text-danger" as="div">
138
99
  {Boolean(onRemove) && (
139
100
  <ConfirmModal>
140
101
  {(confirm) => (
@@ -247,8 +247,7 @@ export const DateInput = ({
247
247
  menuRecurrence={menuRecurrence}
248
248
  onEdit={() => handleOnEdit(menuRecurrence, index)}
249
249
  errorMessage={
250
- errors?.menuRecurrences?.[`${index}`]?.availableTimes
251
- ?.message || errors?.menuRecurrences?.[`${index}`]?.message
250
+ errors?.menuRecurrences?.[`${index}`]?.availableTimes?.message
252
251
  }
253
252
  />
254
253
  ))}
@@ -23,7 +23,7 @@ interface ProductSetRecurrences {
23
23
 
24
24
  export const Default: Story<ProductSetRecurrences> = (args) => {
25
25
  const [items, setItems] = useState(
26
- args.menuRecurrences?.sort((a, b) => a.sort - b.sort) ?? []
26
+ args.menuRecurrences?.sort((a, b) => a.sort - b.sort) ?? [],
27
27
  );
28
28
 
29
29
  const onDragEnd = ({ over, active }) => {
@@ -31,7 +31,7 @@ export const Default: Story<ProductSetRecurrences> = (args) => {
31
31
 
32
32
  setItems((items) => {
33
33
  const prevIndex = items.findIndex(
34
- (item) => String(item.id) === active.id
34
+ (item) => String(item.id) === active.id,
35
35
  );
36
36
  const nextIndex = items.findIndex((item) => String(item.id) === over.id);
37
37