@licklist/design 0.62.3-dev.2 → 0.62.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/bitbucket-pipelines.yml +8 -0
  2. package/dist/date-time-button/DateTimeButton.js +1 -1
  3. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +1 -3
  4. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
  5. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +1 -1
  6. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts +1 -3
  7. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
  8. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +1 -1
  9. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts +1 -3
  10. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
  11. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
  12. package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
  13. package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
  14. package/dist/iframe/ryft/RyftPaymentForm.js +1 -1
  15. package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
  16. package/dist/iframe/ryft/utils/ryft-form.js +1 -1
  17. package/dist/product-set/control/DateAndRecurrenceInput.d.ts +1 -1
  18. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  19. package/dist/product-set/control/DateAndRecurrenceInput.js +1 -1
  20. package/dist/product-set/control/DateInput.d.ts.map +1 -1
  21. package/dist/product-set/control/DateInput.js +1 -1
  22. package/dist/product-set/control/ProductSetControl.d.ts +1 -1
  23. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  24. package/dist/product-set/form/ProductSetForm.d.ts +1 -4
  25. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  26. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
  27. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  28. package/dist/product-set/product/ProductControl.js +1 -1
  29. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
  30. package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
  31. package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
  32. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +1 -1
  33. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +1 -3
  34. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
  35. package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
  36. package/dist/recurring-date-picker-input/utils.d.ts +0 -12
  37. package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
  38. package/dist/recurring-date-picker-input/utils.js +1 -1
  39. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  40. package/dist/sales/booking/results/components/ResultCard.js +1 -1
  41. package/dist/sales/coupon/control/CouponFormControl.d.ts +1 -2
  42. package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
  43. package/dist/sales/coupon/control/CouponFormControl.js +1 -1
  44. package/dist/sales/coupon/form/CouponFrom.d.ts +2 -2
  45. package/dist/sales/coupon/form/CouponFrom.d.ts.map +1 -1
  46. package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
  47. package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
  48. package/dist/setting/dashboard/DashboardSettingForm.d.ts +0 -1
  49. package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
  50. package/dist/setting/dashboard/DashboardSettingForm.js +1 -1
  51. package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +113 -99
  52. package/dist/styles/sales/BookingResults.scss +1 -1
  53. package/dist/typeahead/Typeahead.d.ts +1 -2
  54. package/dist/typeahead/Typeahead.d.ts.map +1 -1
  55. package/dist/typeahead/Typeahead.js +1 -1
  56. package/dist/zone/form/ZoneForm.d.ts +2 -2
  57. package/dist/zone/form/ZoneForm.d.ts.map +1 -1
  58. package/dist/zone/form/ZoneForm.js +1 -1
  59. package/dist/zone/form/components/ZoneControl.d.ts +2 -2
  60. package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
  61. package/dist/zone/form/components/ZoneControl.js +1 -1
  62. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -4
  63. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
  64. package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
  65. package/dist/zone/form/utils/dates.d.ts.map +1 -1
  66. package/jest.config.js +29 -0
  67. package/package.json +35 -10
  68. package/src/date-time-button/DateTimeButton.stories.tsx +1 -2
  69. package/src/date-time-button/DateTimeButton.tsx +5 -7
  70. package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +0 -4
  71. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +8 -10
  72. package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +0 -4
  73. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +6 -6
  74. package/src/iframe/ryft/RyftPaymentForm.tsx +4 -12
  75. package/src/iframe/ryft/utils/ryft-form.ts +4 -8
  76. package/src/product-set/control/DateAndRecurrenceInput.tsx +2 -3
  77. package/src/product-set/control/DateInput.tsx +4 -2
  78. package/src/product-set/control/ProductSetControl.tsx +1 -1
  79. package/src/product-set/form/ProductCategoriesControl.tsx +1 -1
  80. package/src/product-set/form/ProductSetForm.tsx +1 -5
  81. package/src/product-set/hooks/useSortableTreeFunctions.ts +0 -2
  82. package/src/product-set/product/ProductControl.tsx +38 -38
  83. package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +2 -0
  84. package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +18 -4
  85. package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +1 -0
  86. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +1 -11
  87. package/src/recurring-date-picker-input/utils.ts +0 -77
  88. package/src/sales/booking/results/BookingResults.stories.tsx +2 -3
  89. package/src/sales/booking/results/components/ResultCard.tsx +5 -2
  90. package/src/sales/coupon/control/CouponFormControl.tsx +51 -28
  91. package/src/sales/coupon/form/CouponFrom.tsx +15 -5
  92. package/src/setting/admin/AdminSettingForm.tsx +2 -2
  93. package/src/setting/dashboard/DashboardSettingForm.tsx +0 -13
  94. package/src/sortable-tree/SortableTreeItem.tsx +1 -1
  95. package/src/static/switch/BooleanSwitch.tsx +1 -1
  96. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +113 -99
  97. package/src/styles/sales/BookingResults.scss +1 -1
  98. package/src/typeahead/Typeahead.tsx +3 -16
  99. package/src/zone/form/ZoneForm.tsx +2 -3
  100. package/src/zone/form/components/ZoneControl.tsx +3 -3
  101. package/src/zone/form/components/ZoneRecurrencesControl.tsx +5 -7
  102. package/src/zone/form/utils/dates.ts +10 -9
  103. package/tests/Auth/Authorizer.test.tsx +194 -0
  104. package/tests/Auth/Layout/UserNavDropDown.test.tsx +43 -0
  105. package/tests/Auth/Layout/UserNavDropDownToggle.test.tsx +33 -0
  106. package/tests/Auth/Login/LoginComponent.test.tsx +246 -0
  107. package/tests/Auth/Login/LoginFormComponent.test.tsx +182 -0
  108. package/tests/Auth/Register/RegisterComponent.test.tsx +285 -0
  109. package/tests/Auth/Register/RegisterFormComponent.test.tsx +170 -0
  110. package/tests/Auth/Settings/Dashboard/IpInput.test.tsx +130 -0
  111. package/tests/Auth/Social/SocialCallbackComponent.test.tsx +133 -0
  112. package/tests/Auth/Social/SocialFormComponent.test.tsx +118 -0
  113. package/tests/FileUpload/FileUpload.test.tsx +42 -0
  114. package/tests/Notification/EmailTemplate.test.tsx +82 -0
  115. package/tests/ProductSet/ProductSetPopover.test.tsx +40 -0
  116. package/tests/Report/Report.test.tsx +48 -0
  117. package/tests/Sales/Coupon.test.tsx +51 -0
  118. package/tests/Sales/SalesAndVIews.test.tsx +63 -0
  119. package/tests/SnippetTemplates/SnippetTemplates.test.tsx +56 -0
  120. package/tests/Table/FilterHelperComponent.test.tsx +88 -0
  121. package/tests/Table/PaginationHelperComponent.test.tsx +109 -0
  122. package/tests/Table/PerPageHelperComponent.test.tsx +34 -0
  123. package/tests/Table/TableHelperComponent.test.tsx +295 -0
  124. package/tests/TipTapEditor/TipTapEditor.test.tsx +28 -0
  125. package/tests/__mock__/hooks/useAuthApi.ts +13 -0
  126. package/tests/__mock__/hooks/useAuthMock.ts +13 -0
  127. package/tests/__mock__/hooks/useFormMock.ts +27 -0
  128. package/tests/__mock__/hooks/useNotificationMock.ts +13 -0
  129. package/tests/__mock__/hooks/useQueryMock.ts +16 -0
  130. package/tests/__mock__/hooks/useSocialApiMock.ts +20 -0
  131. package/tests/__mock__/hooks/useTranslationMock.ts +17 -0
  132. package/tests/__mock__/hooks/useUserApiMock.ts +18 -0
  133. package/tests/__mock__/hooks/useUserMock.ts +13 -0
  134. package/tests/__mock__/styleMock.js +1 -0
  135. package/tests/__mock__/windowMock.ts +5 -0
  136. package/tests/packages/react-query.tsx +28 -0
  137. package/tests/setupTests.ts +10 -0
  138. package/dist/sales/coupon/utils/index.d.ts +0 -7
  139. package/dist/sales/coupon/utils/index.d.ts.map +0 -1
  140. package/dist/sales/coupon/utils/index.js +0 -1
  141. package/src/sales/coupon/utils/index.ts +0 -13
@@ -1,7 +1,6 @@
1
1
  import { PropsWithChildren } from "react";
2
2
  import { Frequency, Weekday } from "rrule";
3
3
  import { DateTime } from "luxon";
4
- import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
5
4
  import { SupportedFrequency } from "./utils";
6
5
  export interface RecurringDatePickerInputProps {
7
6
  disabled?: boolean;
@@ -11,7 +10,6 @@ export interface RecurringDatePickerInputProps {
11
10
  initialFrequency?: Frequency;
12
11
  setInitialStartDateAfterSelect?: boolean;
13
12
  minDate?: string;
14
- workHours: WorkHour[] | undefined;
15
13
  }
16
14
  export interface RecurringDatePickerInputValues {
17
15
  rrule?: string;
@@ -26,6 +24,6 @@ export interface RecurringDatePickerInputValues {
26
24
  count?: number;
27
25
  withOutEndDate?: boolean;
28
26
  }
29
- export declare function RecurringDatePickerInput({ disabled, onChange, onDelete, defaultValues, initialFrequency, setInitialStartDateAfterSelect, children, minDate, workHours, }: PropsWithChildren<RecurringDatePickerInputProps>): JSX.Element;
27
+ export declare function RecurringDatePickerInput({ disabled, onChange, onDelete, defaultValues, initialFrequency, setInitialStartDateAfterSelect, children, minDate, }: PropsWithChildren<RecurringDatePickerInputProps>): JSX.Element;
30
28
  export declare const getDateTimeObject: (date: string, time: string) => DateTime | string;
31
29
  //# sourceMappingURL=RecurringDatePickerInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RecurringDatePickerInput.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/RecurringDatePickerInput.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAsB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACrE,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,QAAQ,EAAY,MAAM,OAAO,CAAC;AAU3C,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAGtF,OAAO,EAEL,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAIjB,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC;IACxD,QAAQ,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC;IAC1D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;CACnC;AAED,MAAM,WAAW,8BAA8B;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,wBAAwB,CAAC,EACvC,QAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,gBAAkC,EAClC,8BAAsC,EACtC,QAAQ,EACR,OAAO,EACP,SAAS,GACV,EAAE,iBAAiB,CAAC,6BAA6B,CAAC,eA6LlD;AAmGD,eAAO,MAAM,iBAAiB,SACtB,MAAM,QACN,MAAM,KACX,QAAQ,GAAG,MAiBb,CAAC"}
1
+ {"version":3,"file":"RecurringDatePickerInput.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/RecurringDatePickerInput.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAsB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACrE,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,QAAQ,EAAY,MAAM,OAAO,CAAC;AAY3C,OAAO,EAAyB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAIpE,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC;IACxD,QAAQ,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC;IAC1D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,8BAA8B;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,wBAAwB,CAAC,EACvC,QAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,gBAAkC,EAClC,8BAAsC,EACtC,QAAQ,EACR,OAAO,GACR,EAAE,iBAAiB,CAAC,6BAA6B,CAAC,eA0LlD;AAmGD,eAAO,MAAM,iBAAiB,SACtB,MAAM,QACN,MAAM,KACX,QAAQ,GAAG,MAiBb,CAAC"}
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),n=require("react"),r=e(n),a=require("react-i18next"),i=e(require("react-bootstrap/Button")),l=require("react-bootstrap"),u=require("react-hook-form"),o=require("luxon"),s=require("../modals/confirmation/ConfirmModal.js");require("../modals/dialog/Dialog.js"),require("../modals/dialog/DialogContext.js");var d=require("../product-set/elements/DeleteFieldButton.js"),c=require("rrule"),m=e(c),f=require("@licklist/core/dist/Config/Date"),v=require("react-intl"),D=require("@licklist/plugins/dist/hooks/Value/usePreviousValue"),y=require("./RecurrenceIntervalAndFrequencyInput.js"),T=require("./utils.js"),p=require("./RecurrenceWeekdaysInput.js");var q=function(e){var n=e.rrule,r=e.startDate,a=e.endDate,i=e.startTime,l=e.endTime,u=e.initialFrequency,o=void 0===u?c.Frequency.DAILY:u;return t.__assign({startDate:r,endDate:a,startTime:i,endTime:l,interval:1,freq:o},n&&T.parseAndValidateRRule({rrule:n,date:r}))},g=function(e){var r=e.startDate,a=e.endDate,i=e.startTime,l=e.endTime,u=e.byWeekDay,s=void 0===u?[]:u,d=k(r,i||"00:00:00"),c=k(a,l||"23:59:59"),m=v.useIntl(),f=m.formatList,D=m.formatNumber;return n.useMemo((function(){if(d instanceof o.DateTime&&c instanceof o.DateTime&&d.isValid&&c.isValid){var e=o.Interval.fromDateTimes(d.set({second:0}),c.set({second:0})).toDuration(["days","hours","minutes"]);if(e.isValid){var n=function(e,t){return D(e,{style:"unit",unit:t,unitDisplay:"long"})},r=o.Interval.fromDateTimes(d.minus({second:1}),c.plus({second:1})).splitBy({days:1});if(!(s.length?r.reduce((function(e,t){return s.some((function(e){return e.weekday+1===t.start.weekday}))?e+1:e}),0):1))return n(0,"minute");var a=[[e.days,"day"],[e.hours,"hour"],[e.minutes,"minute"]].filter((function(e){return t.__read(e,1)[0]}));return a.length||a.push([0,"minute"]),f(a.map((function(e){return n.apply(void 0,t.__spreadArray([],t.__read(e),!1))})),{style:"long",type:"unit"})}}}),[d,c,s,f,D])},k=function(e,t){var n=o.DateTime.fromFormat("".concat(e," ").concat(t),f.DATE_TIME_FORMAT);if(n.isValid)return n;var r=o.DateTime.fromFormat("".concat(e," ").concat(t),f.DATE_TIME_FULL_FORMAT);return r.isValid?r:""};exports.RecurringDatePickerInput=function(e){var v,_,b,F,E,w,h=e.disabled,I=void 0!==h&&h,V=e.onChange,A=e.onDelete,x=e.defaultValues,L=e.initialFrequency,j=void 0===L?c.Frequency.DAILY:L,R=e.setInitialStartDateAfterSelect,M=void 0!==R&&R,S=e.children,N=e.minDate,W=e.workHours,C=a.useTranslation(["Design"]).t,O=u.useForm({defaultValues:q({rrule:null!==(v=null==x?void 0:x.rrule)&&void 0!==v?v:"",startDate:null!==(_=null==x?void 0:x.startDate)&&void 0!==_?_:"",endDate:null!==(b=null==x?void 0:x.endDate)&&void 0!==b?b:"",startTime:null!==(F=null==x?void 0:x.startTime)&&void 0!==F?F:"",endTime:null!==(E=null==x?void 0:x.endTime)&&void 0!==E?E:"",initialFrequency:null!==(w=null==x?void 0:x.freq)&&void 0!==w?w:j}),mode:"onChange"}),P=O.watch,B=O.setValue,Y=O.handleSubmit,U=P("startDate"),H=P("endDate"),Q=P("startTime"),J=P("endTime"),K=P("byweekday"),z=D.usePreviousValue(U),G=g({startDate:U,endDate:H,startTime:Q,endTime:J,byWeekDay:K}),X=T.useWorkHoursValidationRules(K,W),Z=function(e){var n,r=k(H,J||"23:59:59"),a=Array.isArray(e.byweekday)?e.byweekday.map((function(e){return e instanceof c.Weekday?e:new c.Weekday(null==e?void 0:e.weekday)})):e.byweekday,i=(null==e?void 0:e.endTime)?o.DateTime.fromISO(null==e?void 0:e.endTime).toFormat(f.TIME_FULL_FORMAT):"",l=null!==(n=null==e?void 0:e.endDate)&&void 0!==n?n:"",u=m.optionsToString({until:r instanceof o.DateTime&&r.isValid?null==r?void 0:r.toJSDate():null,byweekday:a,count:e.count,freq:(null==a?void 0:a.length)?c.Frequency.WEEKLY:c.Frequency.DAILY,interval:e.interval}).replace("RRULE:","");V(t.__assign(t.__assign({},e),{endDate:l,endTime:i,rrule:u}))};return n.useEffect((function(){var e,t;if(M&&(!z||U)&&!U&&K&&K.length&&!Number.isNaN(null===(e=K[0])||void 0===e?void 0:e.weekday)){var n=(null===(t=K[0])||void 0===t?void 0:t.weekday)+1,r=o.DateTime.local(),a=o.DateTime.local().set({weekday:n});a>=r||n===r.weekday?B("startDate",a.toSQLDate()):B("startDate",a.plus({week:1}).toSQLDate())}}),[K,M]),r.createElement(u.FormProvider,t.__assign({},O),r.createElement(l.Form,{noValidate:!0,onSubmit:function(e){return e.preventDefault(),e.stopPropagation(),Y(Z)(e)}},r.createElement(p.default,{date:U,disabled:I}),r.createElement(y.default,t.__assign({disabled:I,minDate:N},X)),S,r.createElement("div",{className:"d-inline-flex align-items-center w-100"},r.createElement(i,{type:"submit"},C("Design:apply")),r.createElement("div",{className:"d-flex flex-grow-1 text-muted mx-3 flex-column"},r.createElement("div",null,G&&"lasts ".concat(G))),x&&r.createElement("div",{className:"d-flex justify-content-end delete-btn"},r.createElement(s.ConfirmModal,null,(function(e){return r.createElement(d.DeleteFieldButton,{onDelete:function(){return e(A)}})}))))))},exports.getDateTimeObject=k;
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),n=require("react"),r=e(n),a=require("react-i18next"),i=e(require("react-bootstrap/Button")),l=require("react-bootstrap"),u=require("react-hook-form"),o=require("luxon"),d=require("../modals/confirmation/ConfirmModal.js");require("../modals/dialog/Dialog.js"),require("../modals/dialog/DialogContext.js");var s=require("../product-set/elements/DeleteFieldButton.js"),c=require("rrule"),m=e(c),f=require("@licklist/core/dist/Config/Date"),v=require("react-intl"),D=require("@licklist/plugins/dist/hooks/Value/usePreviousValue"),y=require("./RecurrenceIntervalAndFrequencyInput.js"),T=require("./utils.js"),p=require("./RecurrenceWeekdaysInput.js");var q=function(e){var n=e.rrule,r=e.startDate,a=e.endDate,i=e.startTime,l=e.endTime,u=e.initialFrequency,o=void 0===u?c.Frequency.DAILY:u;return t.__assign({startDate:r,endDate:a,startTime:i,endTime:l,interval:1,freq:o},n&&T.parseAndValidateRRule({rrule:n,date:r}))},g=function(e){var r=e.startDate,a=e.endDate,i=e.startTime,l=e.endTime,u=e.byWeekDay,d=void 0===u?[]:u,s=k(r,i||"00:00:00"),c=k(a,l||"23:59:59"),m=v.useIntl(),f=m.formatList,D=m.formatNumber;return n.useMemo((function(){if(s instanceof o.DateTime&&c instanceof o.DateTime&&s.isValid&&c.isValid){var e=o.Interval.fromDateTimes(s.set({second:0}),c.set({second:0})).toDuration(["days","hours","minutes"]);if(e.isValid){var n=function(e,t){return D(e,{style:"unit",unit:t,unitDisplay:"long"})},r=o.Interval.fromDateTimes(s.minus({second:1}),c.plus({second:1})).splitBy({days:1});if(!(d.length?r.reduce((function(e,t){return d.some((function(e){return e.weekday+1===t.start.weekday}))?e+1:e}),0):1))return n(0,"minute");var a=[[e.days,"day"],[e.hours,"hour"],[e.minutes,"minute"]].filter((function(e){return t.__read(e,1)[0]}));return a.length||a.push([0,"minute"]),f(a.map((function(e){return n.apply(void 0,t.__spreadArray([],t.__read(e),!1))})),{style:"long",type:"unit"})}}}),[s,c,d,f,D])},k=function(e,t){var n=o.DateTime.fromFormat("".concat(e," ").concat(t),f.DATE_TIME_FORMAT);if(n.isValid)return n;var r=o.DateTime.fromFormat("".concat(e," ").concat(t),f.DATE_TIME_FULL_FORMAT);return r.isValid?r:""};exports.RecurringDatePickerInput=function(e){var v,T,_,b,F,E,w=e.disabled,h=void 0!==w&&w,I=e.onChange,A=e.onDelete,V=e.defaultValues,x=e.initialFrequency,L=void 0===x?c.Frequency.DAILY:x,j=e.setInitialStartDateAfterSelect,M=void 0!==j&&j,R=e.children,S=e.minDate,N=a.useTranslation(["Design"]).t,C=u.useForm({defaultValues:q({rrule:null!==(v=null==V?void 0:V.rrule)&&void 0!==v?v:"",startDate:null!==(T=null==V?void 0:V.startDate)&&void 0!==T?T:"",endDate:null!==(_=null==V?void 0:V.endDate)&&void 0!==_?_:"",startTime:null!==(b=null==V?void 0:V.startTime)&&void 0!==b?b:"",endTime:null!==(F=null==V?void 0:V.endTime)&&void 0!==F?F:"",initialFrequency:null!==(E=null==V?void 0:V.freq)&&void 0!==E?E:L}),mode:"onChange"}),O=C.watch,P=C.setValue,W=C.handleSubmit,B=O("startDate"),Y=O("endDate"),U=O("startTime"),Q=O("endTime"),J=O("byweekday"),K=D.usePreviousValue(B),z=g({startDate:B,endDate:Y,startTime:U,endTime:Q,byWeekDay:J}),G=function(e){var n,r=k(Y,Q||"23:59:59"),a=Array.isArray(e.byweekday)?e.byweekday.map((function(e){return e instanceof c.Weekday?e:new c.Weekday(null==e?void 0:e.weekday)})):e.byweekday,i=(null==e?void 0:e.endTime)?o.DateTime.fromISO(null==e?void 0:e.endTime).toFormat(f.TIME_FULL_FORMAT):"",l=null!==(n=null==e?void 0:e.endDate)&&void 0!==n?n:"",u=m.optionsToString({until:r instanceof o.DateTime&&r.isValid?null==r?void 0:r.toJSDate():null,byweekday:a,count:e.count,freq:(null==a?void 0:a.length)?c.Frequency.WEEKLY:c.Frequency.DAILY,interval:e.interval}).replace("RRULE:","");I(t.__assign(t.__assign({},e),{endDate:l,endTime:i,rrule:u}))};return n.useEffect((function(){var e,t;if(M&&(!K||B)&&!B&&J&&J.length&&!Number.isNaN(null===(e=J[0])||void 0===e?void 0:e.weekday)){var n=(null===(t=J[0])||void 0===t?void 0:t.weekday)+1,r=o.DateTime.local(),a=o.DateTime.local().set({weekday:n});a>=r||n===r.weekday?P("startDate",a.toSQLDate()):P("startDate",a.plus({week:1}).toSQLDate())}}),[J,M]),r.createElement(u.FormProvider,t.__assign({},C),r.createElement(l.Form,{noValidate:!0,onSubmit:function(e){return e.preventDefault(),e.stopPropagation(),W(G)(e)}},r.createElement(p.default,{date:B,disabled:h}),r.createElement(y.default,{disabled:h,minDate:S}),R,r.createElement("div",{className:"d-inline-flex align-items-center w-100"},r.createElement(i,{type:"submit"},N("Design:apply")),r.createElement("div",{className:"d-flex flex-grow-1 text-muted mx-3 flex-column"},r.createElement("div",null,z&&"lasts ".concat(z))),V&&r.createElement("div",{className:"d-flex justify-content-end delete-btn"},r.createElement(d.ConfirmModal,null,(function(e){return r.createElement(s.DeleteFieldButton,{onDelete:function(){return e(A)}})}))))))},exports.getDateTimeObject=k;
@@ -1,4 +1,3 @@
1
- import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
2
1
  import { Frequency, Weekday } from "rrule";
3
2
  export declare const getWeekdayForFrequency: ({ date, frequency, }: {
4
3
  date: string;
@@ -16,15 +15,4 @@ export declare const parseAndValidateRRule: ({ rrule, date, }: {
16
15
  rrule: string;
17
16
  date: string;
18
17
  }) => ParsedRRuleOptions;
19
- export declare const useWorkHoursValidationRules: (byWeekDay: Weekday[], workHours: WorkHour[] | undefined) => {
20
- startTimeRules?: undefined;
21
- endTimeRules?: undefined;
22
- } | {
23
- startTimeRules: {
24
- validate: (date: string) => string | true;
25
- };
26
- endTimeRules: {
27
- validate: (date: string) => string | true;
28
- };
29
- };
30
18
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAItF,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAElD,eAAO,MAAM,sBAAsB;UAI3B,MAAM;eACD,SAAS;MAClB,OAWH,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B,SAAS,CAAC,KAAK,GACf,SAAS,CAAC,MAAM,GAChB,SAAS,CAAC,OAAO,GACjB,SAAS,CAAC,MAAM,CAAC;AAErB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,qBAAqB;WAIzB,MAAM;UACP,MAAM;wBAsEb,CAAC;AAEF,eAAO,MAAM,2BAA2B,cAC3B,OAAO,EAAE,aACT,QAAQ,EAAE,GAAG,SAAS;;;;;yBAsBd,MAAM;;;yBA+BN,MAAM;;CAe1B,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/utils.ts"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAElD,eAAO,MAAM,sBAAsB;UAI3B,MAAM;eACD,SAAS;MAClB,OAUH,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B,SAAS,CAAC,KAAK,GACf,SAAS,CAAC,MAAM,GAChB,SAAS,CAAC,OAAO,GACjB,SAAS,CAAC,MAAM,CAAC;AAErB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,qBAAqB;WAIzB,MAAM;UACP,MAAM;wBAsEb,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("@licklist/core/dist/Config"),t=require("react-i18next"),n=require("luxon"),i=require("rrule"),a=(e=i)&&"object"==typeof e&&"default"in e?e.default:e,o=require("@licklist/plugins/dist/utils/dateTime"),u=function(e){var r=e.date,t=e.frequency,a=n.DateTime.fromISO(r);return new i.Weekday(a.weekday-1,t!==i.Frequency.MONTHLY?void 0:a.day+7>a.daysInMonth?-1:Math.floor(a.day/7)+1)};exports.getWeekdayForFrequency=u,exports.parseAndValidateRRule=function(e){var r,t,n=e.rrule,o=e.date,d="Unsupported RRule",l=new Set(["interval","freq","byweekday","until","count"]),f=new Set([i.Frequency.DAILY,i.Frequency.WEEKLY,i.Frequency.MONTHLY,i.Frequency.YEARLY]),s=a.parseString(n.includes("EXDATE")?n.split(";EXDATE=")[0]:n);if(Object.keys(s).some((function(e){return!l.has(e)}))||void 0===s.freq||!f.has(s.freq)||s.until&&s.count)throw new Error(d);if(s.byweekday){var m=s.byweekday;if(s.freq===i.Frequency.WEEKLY){if(m.some((function(e){return void 0!==e.n})))throw new Error(d)}else{if(s.freq!==i.Frequency.MONTHLY)throw new Error(d);var T=u({date:o,frequency:i.Frequency.MONTHLY});if(m.length>1||(null===(r=m[0])||void 0===r?void 0:r.weekday)!==T.weekday||(null===(t=m[0])||void 0===t?void 0:t.n)!==T.n)throw new Error(d)}}return{interval:s.interval,freq:s.freq,byweekday:s.byweekday,count:s.count,until:s.until}},exports.useWorkHoursValidationRules=function(e,i){void 0===e&&(e=[]);var a=t.useTranslation("Validation").t;if(!i)return{};var u=e.length?e.map((function(e){var r=e.weekday;return i.find((function(e){return e.day===r}))})):i,d=u.map((function(e){return n.DateTime.fromFormat(e.start,r.TIME_FORMAT)})).sort(o.dateTimesSortFn("desc"))[0],l={validate:function(e){return n.DateTime.fromFormat(e,r.TIME_FORMAT)>=d||a("fieldTimeAfter",{attribute:a("Design:startTimeSmall"),time:d.toFormat(r.TIME_FORMAT)})}},f=u.map((function(e){var t=e.start,i=e.end;return n.DateTime.fromFormat(t,r.TIME_FORMAT)<=n.DateTime.fromFormat(i,r.TIME_FORMAT)?i:"23:59"})).map((function(e){return n.DateTime.fromFormat(e,r.TIME_FORMAT)})).sort(o.dateTimesSortFn("asc"))[0];return{startTimeRules:l,endTimeRules:{validate:function(e){return n.DateTime.fromFormat(e,r.TIME_FORMAT)<=f||a("fieldTimeBefore",{attribute:a("Design:endTimeSmall"),time:f.toFormat(r.TIME_FORMAT)})}}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("luxon"),n=require("rrule"),t=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,u=function(e){var t=e.date,u=e.frequency,o=r.DateTime.fromISO(t);return new n.Weekday(o.weekday-1,u!==n.Frequency.MONTHLY?void 0:o.day+7>o.daysInMonth?-1:Math.floor(o.day/7)+1)};exports.getWeekdayForFrequency=u,exports.parseAndValidateRRule=function(e){var r,o,a=e.rrule,i=e.date,y="Unsupported RRule",d=new Set(["interval","freq","byweekday","until","count"]),l=new Set([n.Frequency.DAILY,n.Frequency.WEEKLY,n.Frequency.MONTHLY,n.Frequency.YEARLY]),f=t.parseString(a.includes("EXDATE")?a.split(";EXDATE=")[0]:a);if(Object.keys(f).some((function(e){return!d.has(e)}))||void 0===f.freq||!l.has(f.freq)||f.until&&f.count)throw new Error(y);if(f.byweekday){var c=f.byweekday;if(f.freq===n.Frequency.WEEKLY){if(c.some((function(e){return void 0!==e.n})))throw new Error(y)}else{if(f.freq!==n.Frequency.MONTHLY)throw new Error(y);var q=u({date:i,frequency:n.Frequency.MONTHLY});if(c.length>1||(null===(r=c[0])||void 0===r?void 0:r.weekday)!==q.weekday||(null===(o=c[0])||void 0===o?void 0:o.n)!==q.n)throw new Error(y)}}return{interval:f.interval,freq:f.freq,byweekday:f.byweekday,count:f.count,until:f.until}};
@@ -1 +1 @@
1
- {"version":3,"file":"ResultCard.d.ts","sourceRoot":"","sources":["../../../../../src/sales/booking/results/components/ResultCard.tsx"],"names":[],"mappings":";AAKA,OAAO,EACL,KAAK,EAEN,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAC;AAO1E,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,UAAU,oDAKpB,eAAe,gBA2FjB,CAAC"}
1
+ {"version":3,"file":"ResultCard.d.ts","sourceRoot":"","sources":["../../../../../src/sales/booking/results/components/ResultCard.tsx"],"names":[],"mappings":";AAKA,OAAO,EACL,KAAK,EAEN,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAC;AAQ1E,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAIF,eAAO,MAAM,UAAU,oDAKpB,eAAe,gBA2FjB,CAAC"}
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),r=require("@licklist/core/dist/Config"),l=require("react-i18next"),a=require("../../../../static/Icon.js"),n=e(require("clsx")),i=require("luxon"),c=require("react-intl"),u=require("@licklist/plugins/dist/utils/formatDate"),s=require("@licklist/core/dist/DataMapper/Order/OrderDataMapper"),o=require("@licklist/plugins/dist/utils/sourceTitle");exports.ResultCard=function(e){var m,d,p,E=e.order,f=e.className,v=e.staffMember,y=e.onCardClick,N=l.useTranslation("Design").t,q=c.useIntl().formatNumber,D=E.id,g=E.people,C=E.user,O=E.status,M=E.startDate,T=E.products,b=E.source,k=E.event,x=E.menu,A=E.remainingToPay,h=E.paidAmount,I=(null===(m=T.map((function(e){return e.name})))||void 0===m?void 0:m.join(", "))||"",R=(null==k?void 0:k.name)||(null==x?void 0:x.name)||"",_=function(){y&&y(D)};return t.createElement("div",{className:n("result-card",f),onClick:_,onKeyUp:_,role:"button",tabIndex:0},t.createElement("div",{className:"card-content"},t.createElement("div",{className:"order-id"},D),t.createElement("div",{className:"order-people"},t.createElement(a.default,{type:"user",width:"10",height:"11"}),g),t.createElement("div",{className:"order-description"},t.createElement("p",{className:"name"},C.firstName," ",C.lastName),C.email&&t.createElement("p",null,C.email),(null===(d=C.userDetail)||void 0===d?void 0:d.phone)&&t.createElement("p",null,null===(p=C.userDetail)||void 0===p?void 0:p.phone),t.createElement("p",null,"------"),t.createElement("p",null,N("activity"),": ",R," "),b===s.ORDER_SOURCE_MANUAL&&v&&t.createElement("p",null,N("staff"),": ","".concat(v.firstName," ").concat(v.lastName)),t.createElement("p",null,N("status"),": ",N(O)),t.createElement("p",null,N("date"),": ",u.formatDateStringForEvent(M,!1)),t.createElement("p",null,N("time"),": ",i.DateTime.fromISO(M).toFormat(r.TIME_FORMAT)),t.createElement("p",{className:"products",title:I},N("products"),": ",I),!!A&&t.createElement("p",null,N("remainingAmount"),":"," ",q(A,{style:"currency",currency:r.Currency.GBP})),t.createElement("p",null,N("paidAmount"),":"," ",q(h,{style:"currency",currency:r.Currency.GBP})),t.createElement("p",null,N("source"),": ",N(o.getOrderSourceTitle(b))))))};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),r=require("@licklist/core/dist/Config"),l=require("react-i18next"),a=require("../../../../static/Icon.js"),n=e(require("clsx")),i=require("luxon"),c=require("react-intl"),u=require("@licklist/plugins/dist/utils/formatDate"),s=require("@licklist/core/dist/DataMapper/Order/OrderDataMapper"),o=require("@licklist/plugins/dist/utils/sourceTitle");exports.ResultCard=function(e){var m,d,p,E=e.order,f=e.className,v=e.staffMember,y=e.onCardClick,N=l.useTranslation("Design").t,q=c.useIntl().formatNumber,D=E.id,g=E.people,C=E.user,O=E.status,M=E.startDate,T=E.products,b=E.source,k=E.totalAmount,x=E.event,A=E.menu,h=E.remainingToPay,I=(null===(m=T.map((function(e){return e.name})))||void 0===m?void 0:m.join(", "))||"",R=(null==x?void 0:x.name)||(null==A?void 0:A.name)||"",_=function(){y&&y(D)};return t.createElement("div",{className:n("result-card",f),onClick:_,onKeyUp:_,role:"button",tabIndex:0},t.createElement("div",{className:"card-content"},t.createElement("div",{className:"order-id"},D),t.createElement("div",{className:"order-people"},t.createElement(a.default,{type:"user",width:"10",height:"11"}),g),t.createElement("div",{className:"order-description"},t.createElement("p",{className:"name"},C.firstName," ",C.lastName),C.email&&t.createElement("p",null,C.email),(null===(d=C.userDetail)||void 0===d?void 0:d.phone)&&t.createElement("p",null,null===(p=C.userDetail)||void 0===p?void 0:p.phone),t.createElement("p",null,"------"),t.createElement("p",null,N("activity"),": ",R," "),b===s.ORDER_SOURCE_MANUAL&&v&&t.createElement("p",null,N("staff"),": ","".concat(v.firstName," ").concat(v.lastName)),t.createElement("p",null,N("status"),": ",N(O)),t.createElement("p",null,N("date"),": ",u.formatDateStringForEvent(M,!1)),t.createElement("p",null,N("time"),": ",i.DateTime.fromISO(M).toFormat(r.TIME_FORMAT)),t.createElement("p",{className:"products",title:I},N("products"),": ",I),!!h&&t.createElement("p",null,N("remainingAmount"),":"," ",q(h,{style:"currency",currency:r.Currency.GBP})),t.createElement("p",null,N("paidAmount"),":"," ",q(k,{style:"currency",currency:r.Currency.GBP})),t.createElement("p",null,N("source"),": ",N(o.getOrderSourceTitle(b))))))};
@@ -1,12 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { ProductGroup } from "@licklist/core/dist/DataMapper/Product/ProductGroupDataMapper";
3
3
  import { CouponTotalType, CouponType } from "@licklist/core/dist/DataMapper/Product/CouponDataMapper";
4
- import { TypeaheadOptions } from "../../../typeahead";
5
4
  export interface CouponFormValues {
6
5
  name?: string;
7
6
  code: string;
8
7
  discountType: CouponType;
9
- productGroupIds: Array<TypeaheadOptions | ProductGroup>;
8
+ productGroupIds: string[];
10
9
  discount: number;
11
10
  totalType: CouponTotalType;
12
11
  startFrom: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CouponFormControl.d.ts","sourceRoot":"","sources":["../../../../src/sales/coupon/control/CouponFormControl.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+DAA+D,CAAC;AAC7F,OAAO,EAOL,eAAe,EACf,UAAU,EACX,MAAM,yDAAyD,CAAC;AAYjE,OAAO,EAAa,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGjE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,UAAU,CAAC;IACzB,eAAe,EAAE,KAAK,CAAC,gBAAgB,GAAG,YAAY,CAAC,CAAC;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,iBAAiB,kCAG3B,eAAe,gBAuVjB,CAAC"}
1
+ {"version":3,"file":"CouponFormControl.d.ts","sourceRoot":"","sources":["../../../../src/sales/coupon/control/CouponFormControl.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+DAA+D,CAAC;AAC7F,OAAO,EAOL,eAAe,EACf,UAAU,EACX,MAAM,yDAAyD,CAAC;AAajE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,UAAU,CAAC;IACzB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,iBAAiB,kCAG3B,eAAe,gBAgXjB,CAAC"}
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),l=require("react"),n=e(l),r=require("react-i18next"),o=require("react-bootstrap"),a=require("react-hook-form"),i=require("luxon"),m=require("../../../typeahead/Typeahead.js"),s=require("@licklist/core/dist/DataMapper/Product/CouponDataMapper"),u=e(require("@licklist/plugins/dist/validation/Rules/couponCodeRules")),d=require("../utils/index.js");exports.CouponFormControl=function(e){var c,E,p,g,F,v,C,b,_,D=e.isLoading,T=void 0!==D&&D,f=e.productGroups,y=a.useFormContext(),P=y.register,O=y.setValue,x=y.getValues,G=y.formState.errors,R=y.watch,L=r.useTranslation(["Design","Notification","App"]).t,N=t.__read(l.useState([]),2),h=N[0],q=N[1],k=R("startFrom"),A=R("validTill"),w=l.useRef(null),I=l.useRef(null),S=((c={})[s.COUPON_TYPE_FIXED]=L("Design:fixed"),c[s.COUPON_TYPE_FIXED_PER_PERSON]=L("Design:fixedPerPerson"),c[s.COUPON_TYPE_PERCENTAGE]=L("Design:percentage"),c[s.COUPON_TYPE_PERCENTAGE_PER_PERSON]=L("Design:percentagePerPerson"),c),U=((E={})[s.COUPON_TOTAL_TYPE_GROSS]=L("Design:grossTotal"),E[s.COUPON_TOTAL_TYPE_TOTAL]=L("Design:depositTotal"),E);l.useEffect((function(){var e=x("productGroupIds");q(d.convertToTypeaheadOptions(e))}),[x]),l.useEffect((function(){O("productGroupIds",h)}),[x,O,h]);var V=d.convertToTypeaheadOptions(f);return n.createElement(o.Row,null,n.createElement(o.Col,{md:5},n.createElement("h2",{className:"mb-5"},L("Design:coupon")),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:name")),n.createElement(o.Form.Control,t.__assign({isInvalid:void 0!==G.name},P("name",{required:L("Validation:fieldRequired",{attribute:L("Design:name")})}),{disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(p=null==G?void 0:G.name)||void 0===p?void 0:p.message))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:couponCode")),n.createElement(o.Form.Control,t.__assign({isInvalid:void 0!==G.code},P("code",{required:L("Validation:fieldRequired",{attribute:L("Design:code")}),pattern:{message:"".concat(L("Validation:fieldCouponCode")),value:u}}),{disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(g=null==G?void 0:G.code)||void 0===g?void 0:g.message)))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:discountType")),n.createElement(o.Form.Control,t.__assign({},P("discountType",{required:!0}),{as:"select",defaultValue:null!==(F=x("discountType"))&&void 0!==F?F:1,disabled:T}),Object.keys(S).map((function(e){return n.createElement("option",{value:e,key:e},S[e])}))))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:discount")),n.createElement(o.Form.Control,t.__assign({type:"number",isInvalid:void 0!==G.discount},P("discount",{required:L("Validation:fieldRequired",{attribute:L("Design:discount")})}),{disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(v=null==G?void 0:G.discount)||void 0===v?void 0:v.message)))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:applyOn")),n.createElement(o.Form.Control,t.__assign({},P("totalType",{required:!0}),{as:"select",defaultValue:null!==(C=x("totalType"))&&void 0!==C?C:1,disabled:T}),Object.keys(U).map((function(e){return n.createElement("option",{value:e,key:e},U[e])}))))))),n.createElement(o.Col,{md:{span:5,offset:1}},n.createElement("h2",{className:"mb-5"},L("Design:limitations")),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:startFrom")),n.createElement(o.Form.Control,t.__assign({type:"date"},P("startFrom"),{value:k,isInvalid:void 0!==G.startFrom,onChange:function(e){var t=i.DateTime.fromSQL(e.target.value).toISODate();O("startFrom",t)},className:k&&"date-input-with-value",ref:w,onClick:function(){var e;return null===(e=null==w?void 0:w.current)||void 0===e?void 0:e.showPicker()},disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(b=null==G?void 0:G.startFrom)||void 0===b?void 0:b.message))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:validTill")),n.createElement(o.Form.Control,t.__assign({type:"date"},P("validTill"),{value:A,onChange:function(e){var t=i.DateTime.fromSQL(e.target.value).toISODate();O("validTill",t)},ref:I,className:A&&"date-input-with-value",onClick:function(){var e;return null===(e=null==I?void 0:I.current)||void 0===e?void 0:e.showPicker()},disabled:T}))))),n.createElement(o.Row,null,n.createElement(o.Col,null,n.createElement(o.Form.Group,{className:"mb-3"},n.createElement(o.Form.Label,null,L("Design:productGroups")),n.createElement(m.Typeahead,{name:"productGroupIds",options:V,isMultipleChoise:!0,isCouponForm:!0,placeholder:L("Design:choose"),noOptionsMessage:L("Design:noSelectedProductGroups")})))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:totalCoupons")),n.createElement(o.Form.Control,t.__assign({},P("totalCoupons"),{type:"number",isInvalid:void 0!==G.totalCoupons,disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(_=null==G?void 0:G.totalCoupons)||void 0===_?void 0:_.message))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:usesPerUser")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("usesPerUser"),{disabled:T}))))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:useAgain")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("useAgain"),{disabled:T})),n.createElement(o.Form.Text,{className:"text-muted"},L("Design:useAgainExplanation")))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:usesPerUserDay")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("usesPerUserDay"),{disabled:T})),n.createElement(o.Form.Text,{className:"text-muted"},L("Design:usesPerUserDayExplanation"))))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:minAmount")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("minAmount"),{disabled:T})),n.createElement(o.Form.Text,{className:"text-muted"},L("Design:minAmountExplanation")))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:maxAmount")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("maxAmount"),{disabled:T})),n.createElement(o.Form.Text,{className:"text-muted"},L("Design:maxAmountExplanation")))))))};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),l=require("react"),n=e(l),r=require("react-i18next"),o=require("react-bootstrap"),a=require("react-hook-form"),i=require("luxon"),m=require("@licklist/core/dist/DataMapper/Product/CouponDataMapper"),u=e(require("@licklist/plugins/dist/validation/Rules/couponCodeRules"));exports.CouponFormControl=function(e){var s,d,c,E,p,g,v,F,C,_=e.isLoading,b=void 0!==_&&_,f=e.productGroups,D=a.useFormContext(),y=D.register,T=D.setValue,P=D.getValues,x=D.formState.errors,O=D.watch,G=r.useTranslation(["Design","Notification","App"]).t,R=t.__read(l.useState([]),2),N=R[0],k=R[1],L=O("startFrom"),A=O("validTill"),h=l.useRef(null),w=l.useRef(null),q=((s={})[m.COUPON_TYPE_FIXED]=G("Design:fixed"),s[m.COUPON_TYPE_FIXED_PER_PERSON]=G("Design:fixedPerPerson"),s[m.COUPON_TYPE_PERCENTAGE]=G("Design:percentage"),s[m.COUPON_TYPE_PERCENTAGE_PER_PERSON]=G("Design:percentagePerPerson"),s),S=((d={})[m.COUPON_TOTAL_TYPE_GROSS]=G("Design:grossTotal"),d[m.COUPON_TOTAL_TYPE_TOTAL]=G("Design:depositTotal"),d);return l.useEffect((function(){k(P("productGroupIds"))}),[P]),l.useEffect((function(){T("productGroupIds",N)}),[P,T,N]),n.createElement(o.Row,null,n.createElement(o.Col,{md:5},n.createElement("h2",{className:"mb-5"},G("Design:coupon")),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,G("Design:name")),n.createElement(o.Form.Control,t.__assign({isInvalid:void 0!==x.name},y("name",{required:G("Validation:fieldRequired",{attribute:G("Design:name")})}),{disabled:b})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(c=null==x?void 0:x.name)||void 0===c?void 0:c.message))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,G("Design:couponCode")),n.createElement(o.Form.Control,t.__assign({isInvalid:void 0!==x.code},y("code",{required:G("Validation:fieldRequired",{attribute:G("Design:code")}),pattern:{message:"".concat(G("Validation:fieldCouponCode")),value:u}}),{disabled:b})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(E=null==x?void 0:x.code)||void 0===E?void 0:E.message)))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,G("Design:discountType")),n.createElement(o.Form.Control,t.__assign({},y("discountType",{required:!0}),{as:"select",defaultValue:null!==(p=P("discountType"))&&void 0!==p?p:1,disabled:b}),Object.keys(q).map((function(e){return n.createElement("option",{value:e,key:e},q[e])}))))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,G("Design:discount")),n.createElement(o.Form.Control,t.__assign({type:"number",isInvalid:void 0!==x.discount},y("discount",{required:G("Validation:fieldRequired",{attribute:G("Design:discount")})}),{disabled:b})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(g=null==x?void 0:x.discount)||void 0===g?void 0:g.message)))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,G("Design:applyOn")),n.createElement(o.Form.Control,t.__assign({},y("totalType",{required:!0}),{as:"select",defaultValue:null!==(v=P("totalType"))&&void 0!==v?v:1,disabled:b}),Object.keys(S).map((function(e){return n.createElement("option",{value:e,key:e},S[e])}))))))),n.createElement(o.Col,{md:{span:5,offset:1}},n.createElement("h2",{className:"mb-5"},G("Design:limitations")),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,G("Design:startFrom")),n.createElement(o.Form.Control,t.__assign({type:"date"},y("startFrom"),{value:L,isInvalid:void 0!==x.startFrom,onChange:function(e){var t=i.DateTime.fromSQL(e.target.value).toISODate();T("startFrom",t)},className:L&&"date-input-with-value",ref:h,onClick:function(){var e;return null===(e=null==h?void 0:h.current)||void 0===e?void 0:e.showPicker()},disabled:b})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(F=null==x?void 0:x.startFrom)||void 0===F?void 0:F.message))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,G("Design:validTill")),n.createElement(o.Form.Control,t.__assign({type:"date"},y("validTill"),{value:A,onChange:function(e){var t=i.DateTime.fromSQL(e.target.value).toISODate();T("validTill",t)},ref:w,className:A&&"date-input-with-value",onClick:function(){var e;return null===(e=null==w?void 0:w.current)||void 0===e?void 0:e.showPicker()},disabled:b}))))),f&&(null==f?void 0:f.length)>0&&n.createElement(o.Row,null,n.createElement(o.Col,{md:12},n.createElement("h5",{className:"mt-4"},G("Design:productGroups")),n.createElement(o.Form.Group,{className:"d-flex flex-wrap justify-content-between mt-4 mb-5"},null==f?void 0:f.map((function(e){var l,r,a=null!==(r=null===(l=P("productGroupIds"))||void 0===l?void 0:l.includes(String(e.id)))&&void 0!==r&&r;return n.createElement(o.Form.Check,{key:e.id,label:e.name,defaultChecked:a,disabled:b,onChange:function(l){l.target.checked?k((function(l){return Array.from(new Set(t.__spreadArray(t.__spreadArray([],t.__read(l),!1),[String(e.id)],!1)))})):k((function(t){return t.filter((function(t){return String(e.id)!==t}))}))}})})),n.createElement(o.Form.Control,t.__assign({},y("productGroupIds"),{hidden:!0,value:N,disabled:b}))))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,G("Design:totalCoupons")),n.createElement(o.Form.Control,t.__assign({},y("totalCoupons"),{type:"number",isInvalid:void 0!==x.totalCoupons,disabled:b})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(C=null==x?void 0:x.totalCoupons)||void 0===C?void 0:C.message))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,G("Design:usesPerUser")),n.createElement(o.Form.Control,t.__assign({type:"number"},y("usesPerUser"),{disabled:b}))))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,G("Design:useAgain")),n.createElement(o.Form.Control,t.__assign({type:"number"},y("useAgain"),{disabled:b})),n.createElement(o.Form.Text,{className:"text-muted"},G("Design:useAgainExplanation")))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,G("Design:usesPerUserDay")),n.createElement(o.Form.Control,t.__assign({type:"number"},y("usesPerUserDay"),{disabled:b})),n.createElement(o.Form.Text,{className:"text-muted"},G("Design:usesPerUserDayExplanation"))))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,G("Design:minAmount")),n.createElement(o.Form.Control,t.__assign({type:"number"},y("minAmount"),{disabled:b})),n.createElement(o.Form.Text,{className:"text-muted"},G("Design:minAmountExplanation")))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,G("Design:maxAmount")),n.createElement(o.Form.Control,t.__assign({type:"number"},y("maxAmount"),{disabled:b})),n.createElement(o.Form.Text,{className:"text-muted"},G("Design:maxAmountExplanation")))))))};
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { ProductGroup, ProductGroupDTO } from "@licklist/core/dist/DataMapper/Product/ProductGroupDataMapper";
2
+ import { ProductGroup } from "@licklist/core/dist/DataMapper/Product/ProductGroupDataMapper";
3
3
  import { CouponTotalType, CouponType } from "@licklist/core/dist/DataMapper/Product/CouponDataMapper";
4
4
  import { ServerError } from "@licklist/plugins/dist/hooks/Api/useHttpQuery";
5
5
  export interface CouponFormValues {
6
6
  name?: string;
7
7
  code: string;
8
8
  discountType: CouponType;
9
- productGroupIds: ProductGroupDTO[];
9
+ productGroupIds: string[];
10
10
  discount: number;
11
11
  totalType: CouponTotalType;
12
12
  startFrom: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CouponFrom.d.ts","sourceRoot":"","sources":["../../../../src/sales/coupon/form/CouponFrom.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,YAAY,EACZ,eAAe,EAChB,MAAM,+DAA+D,CAAC;AACvE,OAAO,EACL,eAAe,EACf,UAAU,EACX,MAAM,yDAAyD,CAAC;AAIjE,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAK5E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,UAAU,CAAC;IACzB,eAAe,EAAE,eAAe,EAAE,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED,eAAO,MAAM,UAAU,wFAOpB,eAAe,gBAkCjB,CAAC"}
1
+ {"version":3,"file":"CouponFrom.d.ts","sourceRoot":"","sources":["../../../../src/sales/coupon/form/CouponFrom.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+DAA+D,CAAC;AAC7F,OAAO,EACL,eAAe,EACf,UAAU,EACX,MAAM,yDAAyD,CAAC;AAIjE,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAK5E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,UAAU,CAAC;IACzB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED,eAAO,MAAM,UAAU,wFAOpB,eAAe,gBA+CjB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { HasPermissionProp } from "@licklist/plugins/dist/types/permission/Permission";
3
- import { ProvidableType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
3
+ import { ProviderType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
4
4
  import { PaymentFeeFormFieldValues } from "./PaymentFeeForm";
5
5
  import { Currency } from "../../types/currency";
6
6
  export type AdminSettingFormFieldValues = {
@@ -19,7 +19,7 @@ export interface AdminSettingFormProps extends HasPermissionProp {
19
19
  providerMetadata: {
20
20
  country?: string;
21
21
  providableId?: number;
22
- providerType?: ProvidableType;
22
+ providerType?: ProviderType;
23
23
  };
24
24
  }
25
25
  export declare const AdminSettingForm: ({ isLoading, defaultValues, onSubmit, currencies, hasPermission, providerMetadata, }: AdminSettingFormProps) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"AdminSettingForm.d.ts","sourceRoot":"","sources":["../../../src/setting/admin/AdminSettingForm.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AAOvF,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAE9F,OAAO,EAAkB,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,MAAM,2BAA2B,GAAG;IACxC,uBAAuB,EAAE,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,IAAI,GAAG,OAAO,CAAC;IAC/B,oBAAoB,EAAE,IAAI,GAAG,OAAO,CAAC;IACrC,+BAA+B,EAAE,IAAI,GAAG,OAAO,CAAC;IAChD,0BAA0B,EAAE,IAAI,GAAG,OAAO,CAAC;CAC5C,GAAG,yBAAyB,CAAC;AAE9B,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,IAAI,CAAC;IACvD,aAAa,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACrD,UAAU,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7B,gBAAgB,EAAE;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,cAAc,CAAC;KAC/B,CAAC;CACH;AAED,eAAO,MAAM,gBAAgB,yFAO1B,qBAAqB,gBAwJvB,CAAC"}
1
+ {"version":3,"file":"AdminSettingForm.d.ts","sourceRoot":"","sources":["../../../src/setting/admin/AdminSettingForm.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AAOvF,OAAO,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAC;AAE5F,OAAO,EAAkB,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,MAAM,2BAA2B,GAAG;IACxC,uBAAuB,EAAE,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,IAAI,GAAG,OAAO,CAAC;IAC/B,oBAAoB,EAAE,IAAI,GAAG,OAAO,CAAC;IACrC,+BAA+B,EAAE,IAAI,GAAG,OAAO,CAAC;IAChD,0BAA0B,EAAE,IAAI,GAAG,OAAO,CAAC;CAC5C,GAAG,yBAAyB,CAAC;AAE9B,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,IAAI,CAAC;IACvD,aAAa,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACrD,UAAU,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7B,gBAAgB,EAAE;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,YAAY,CAAC;KAC7B,CAAC;CACH;AAED,eAAO,MAAM,gBAAgB,yFAO1B,qBAAqB,gBAwJvB,CAAC"}
@@ -10,7 +10,6 @@ export type DashboardSettingFormFieldValues = {
10
10
  isEnquiryOnly: boolean;
11
11
  hasUserVerification: boolean;
12
12
  metaPixelId?: number;
13
- eventDeadlineErrorMessage?: string;
14
13
  } & EventSettingFormFieldValues & ProviderSettingFormFieldValues;
15
14
  export interface DashboardSettingFormProps extends HasPermissionProp {
16
15
  isLoading: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardSettingForm.d.ts","sourceRoot":"","sources":["../../../src/setting/dashboard/DashboardSettingForm.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAM5E,OAAO,EAEL,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,+BAA+B,GAAG;IAC5C,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,GAAG,2BAA2B,GAC7B,8BAA8B,CAAC;AAYjC,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,+BAA+B,KAAK,IAAI,CAAC;IAC3D,aAAa,CAAC,EAAE,OAAO,CAAC,+BAA+B,CAAC,CAAC;IACzD,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED,eAAO,MAAM,oBAAoB,yEAM9B,yBAAyB,gBAkN3B,CAAC"}
1
+ {"version":3,"file":"DashboardSettingForm.d.ts","sourceRoot":"","sources":["../../../src/setting/dashboard/DashboardSettingForm.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAM5E,OAAO,EAEL,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,+BAA+B,GAAG;IAC5C,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,2BAA2B,GAC7B,8BAA8B,CAAC;AAYjC,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,+BAA+B,KAAK,IAAI,CAAC;IAC3D,aAAa,CAAC,EAAE,OAAO,CAAC,+BAA+B,CAAC,CAAC;IACzD,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED,eAAO,MAAM,oBAAoB,yEAM9B,yBAAyB,gBAsM3B,CAAC"}
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=require("react"),n=e(t),a=require("react-i18next"),o=e(require("react-bootstrap/Row")),l=e(require("react-bootstrap/Col")),i=require("react-bootstrap"),s=require("react-hook-form"),d=e(require("@licklist/plugins/dist/services/Form/HookFormService")),m=e(require("@licklist/plugins/dist/services/Form/FormErrorService")),c=e(require("react-bootstrap/Form")),u=require("@react-aria/utils"),v=require("../../static/switch/BooleanSwitch.js");require("../../static/index.js");var E=require("../../help/popover/HelpPopover.js"),p=require("./EventSettingForm.js"),b=require("./ProviderSettingForm.js");exports.DashboardSettingForm=function(e){var g,f,h,F=e.isLoading,I=void 0!==F&&F,S=e.defaultValues,q=void 0===S?{}:S,C=e.onSubmit,x=e.hasPermission,P=void 0===x||x,B=e.serverErrors,_=s.useForm({mode:"onChange",defaultValues:r.__assign({},q)}),L=_.register,O=_.handleSubmit,R=_.formState,y=R.errors,V=R.isValid,k=R.isDirty,j=_.setError,D=a.useTranslation(["Design","Validation"]).t;t.useEffect((function(){m.handleServerErrors(B,j)}),[B,j]);var w=u.useId(),G=u.useId(),H=u.useId(),M=u.useId(),N=u.useId(),A=u.useId(),U=[{id:1,value:D("groupItemsByOrder")}];return n.createElement(c,{className:"d-flex flex-column",noValidate:!0,onSubmit:O(C)},n.createElement(s.FormProvider,r.__assign({},_),n.createElement(o,null,n.createElement(l,{xs:12,sm:6},n.createElement(c.Group,{controlId:w},n.createElement(c.Label,null,D("notificationOnEachOrder")," ",n.createElement(E.HelpPopover,{variant:"info"},D("notificationOnEachOrderHelp"))),n.createElement(s.Controller,{render:function(e){var r=e.field,t=r.name,a=r.value,o=r.onChange;return n.createElement(v.BooleanSwitch,{name:t,value:Boolean(a),onChange:d.booleanAsNumber(o),disabled:I})},name:"notificationOnEachOrder",control:_.control})),n.createElement(c.Group,{controlId:G},n.createElement(c.Label,null,D("orderReportOnEventStart")," ",n.createElement(E.HelpPopover,{variant:"info"},D("orderReportOnEventStartHelp"))),n.createElement(s.Controller,{render:function(e){var r=e.field,t=r.name,a=r.value,o=r.onChange;return n.createElement(v.BooleanSwitch,{name:t,value:Boolean(a),onChange:d.booleanAsNumber(o),disabled:I})},name:"orderReportOnEventStart",control:_.control})),n.createElement(c.Group,{controlId:M},n.createElement(c.Label,null,D("hasUserVerification")),n.createElement(s.Controller,{render:function(e){var r=e.field,t=r.name,a=r.value,o=r.onChange;return n.createElement(v.BooleanSwitch,{name:t,value:Boolean(a),onChange:o,disabled:I})},name:"hasUserVerification",control:_.control})),n.createElement(c.Group,{controlId:N},n.createElement(c.Label,null,D("metaPixelId")),n.createElement(c.Control,r.__assign({type:"number"},L("metaPixelId",{minLength:{value:15,message:D("Validation:fieldMinLength",{attribute:D("metaPixelId"),min:15})}}),{isInvalid:Boolean(y.metaPixelId),disabled:I})),n.createElement(c.Control.Feedback,{type:"invalid"},null===(g=y.metaPixelId)||void 0===g?void 0:g.message))),n.createElement(l,{xs:12,sm:6},n.createElement(c.Group,{controlId:H},n.createElement(c.Label,null,D("orderReportFormat")),n.createElement(c.Control,r.__assign({as:"select"},L("orderReportFormat",{required:D("Validation:fieldRequired",{attribute:D("orderReportFormat")}),valueAsNumber:!0}),{name:"orderReportFormat",isInvalid:Boolean(y.orderReportFormat),disabled:I}),U.map((function(e){return n.createElement("option",{value:e.id,key:e.id},e.value)}))),n.createElement(c.Control.Feedback,{type:"invalid"},null===(f=y.orderReportFormat)||void 0===f?void 0:f.message)))),n.createElement(p.EventSettingForm,{isLoading:I}),n.createElement(b.ProviderSettingForm,{isLoading:I}),n.createElement(c.Group,{controlId:A},n.createElement(c.Label,null,D("eventDeadlineErrorMessage")),n.createElement(c.Control,r.__assign({},L("eventDeadlineErrorMessage"),{isInvalid:Boolean(y.eventDeadlineErrorMessage),disabled:I})),n.createElement(c.Control.Feedback,{type:"invalid"},null===(h=y.eventDeadlineErrorMessage)||void 0===h?void 0:h.message))),P&&n.createElement(i.Button,{type:"submit",disabled:I||!V||!k,className:"d-flex align-items-center align-self-end"},I&&n.createElement(i.Spinner,{animation:"border",size:"sm",role:"status","aria-hidden":"true",className:"mr-2"}),D("update")))};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=require("react"),a=e(t),n=require("react-i18next"),o=e(require("react-bootstrap/Row")),l=e(require("react-bootstrap/Col")),i=require("react-bootstrap"),s=require("react-hook-form"),d=e(require("@licklist/plugins/dist/services/Form/HookFormService")),m=e(require("@licklist/plugins/dist/services/Form/FormErrorService")),c=e(require("react-bootstrap/Form")),u=require("@react-aria/utils"),v=require("../../static/switch/BooleanSwitch.js");require("../../static/index.js");var E=require("../../help/popover/HelpPopover.js"),p=require("./EventSettingForm.js"),b=require("./ProviderSettingForm.js");exports.DashboardSettingForm=function(e){var f,g,h=e.isLoading,F=void 0!==h&&h,S=e.defaultValues,q=void 0===S?{}:S,I=e.onSubmit,C=e.hasPermission,x=void 0===C||C,P=e.serverErrors,B=s.useForm({mode:"onChange",defaultValues:r.__assign({},q)}),O=B.register,R=B.handleSubmit,L=B.formState,_=L.errors,y=L.isValid,V=L.isDirty,j=B.setError,k=n.useTranslation(["Design","Validation"]).t;t.useEffect((function(){m.handleServerErrors(P,j)}),[P,j]);var w=u.useId(),H=u.useId(),N=u.useId(),G=u.useId(),A=u.useId(),D=[{id:1,value:k("groupItemsByOrder")}];return a.createElement(c,{className:"d-flex flex-column",noValidate:!0,onSubmit:R(I)},a.createElement(s.FormProvider,r.__assign({},B),a.createElement(o,null,a.createElement(l,{xs:12,sm:6},a.createElement(c.Group,{controlId:w},a.createElement(c.Label,null,k("notificationOnEachOrder")," ",a.createElement(E.HelpPopover,{variant:"info"},k("notificationOnEachOrderHelp"))),a.createElement(s.Controller,{render:function(e){var r=e.field,t=r.name,n=r.value,o=r.onChange;return a.createElement(v.BooleanSwitch,{name:t,value:Boolean(n),onChange:d.booleanAsNumber(o),disabled:F})},name:"notificationOnEachOrder",control:B.control})),a.createElement(c.Group,{controlId:H},a.createElement(c.Label,null,k("orderReportOnEventStart")," ",a.createElement(E.HelpPopover,{variant:"info"},k("orderReportOnEventStartHelp"))),a.createElement(s.Controller,{render:function(e){var r=e.field,t=r.name,n=r.value,o=r.onChange;return a.createElement(v.BooleanSwitch,{name:t,value:Boolean(n),onChange:d.booleanAsNumber(o),disabled:F})},name:"orderReportOnEventStart",control:B.control})),a.createElement(c.Group,{controlId:G},a.createElement(c.Label,null,k("hasUserVerification")),a.createElement(s.Controller,{render:function(e){var r=e.field,t=r.name,n=r.value,o=r.onChange;return a.createElement(v.BooleanSwitch,{name:t,value:Boolean(n),onChange:o,disabled:F})},name:"hasUserVerification",control:B.control})),a.createElement(c.Group,{controlId:A},a.createElement(c.Label,null,k("metaPixelId")),a.createElement(c.Control,r.__assign({type:"number"},O("metaPixelId",{minLength:{value:15,message:k("Validation:fieldMinLength",{attribute:k("metaPixelId"),min:15})}}),{isInvalid:Boolean(_.metaPixelId),disabled:F})),a.createElement(c.Control.Feedback,{type:"invalid"},null===(f=_.metaPixelId)||void 0===f?void 0:f.message))),a.createElement(l,{xs:12,sm:6},a.createElement(c.Group,{controlId:N},a.createElement(c.Label,null,k("orderReportFormat")),a.createElement(c.Control,r.__assign({as:"select"},O("orderReportFormat",{required:k("Validation:fieldRequired",{attribute:k("orderReportFormat")}),valueAsNumber:!0}),{name:"orderReportFormat",isInvalid:Boolean(_.orderReportFormat),disabled:F}),D.map((function(e){return a.createElement("option",{value:e.id,key:e.id},e.value)}))),a.createElement(c.Control.Feedback,{type:"invalid"},null===(g=_.orderReportFormat)||void 0===g?void 0:g.message)))),a.createElement(p.EventSettingForm,{isLoading:F}),a.createElement(b.ProviderSettingForm,{isLoading:F})),x&&a.createElement(i.Button,{type:"submit",disabled:F||!y||!V,className:"d-flex align-items-center align-self-end"},F&&a.createElement(i.Spinner,{animation:"border",size:"sm",role:"status","aria-hidden":"true",className:"mr-2"}),k("update")))};
@@ -47,127 +47,141 @@
47
47
  margin-left: 0.5rem;
48
48
  }
49
49
 
50
+ .ryft-payment-form {
51
+ .submit-button-wrapper {
52
+ margin: -1rem 0 1rem;
53
+
54
+ button {
55
+ width: 100%;
56
+ }
57
+ }
58
+ #mobile-pay-divider-container {
59
+ display: flex;
60
+ position: relative;
61
+ margin-bottom: 1rem;
62
+ #mobile-pay-divider-text {
63
+ margin-right: 1rem;
64
+ font-size: 0.875rem;
65
+ font-weight: 600;
66
+ }
67
+ #mobile-pay-divider {
68
+ width: 100%;
69
+ border-bottom: 1px #dfdfdf solid;
70
+ margin-bottom: 0.6rem;
71
+ }
72
+ }
73
+
74
+ #card-title-container {
75
+ height: auto;
76
+ border: none;
77
+ margin-bottom: 0.5rem;
78
+ text-align: left;
79
+ :first-child {
80
+ font-size: 1rem;
81
+ font-weight: 600;
82
+ margin-bottom: 1rem;
83
+ }
84
+
85
+ .form-label {
86
+ margin-bottom: 0.5rem;
87
+ }
88
+ }
89
+ .mobile-pay-title {
90
+ display: block;
91
+ font-weight: 600;
92
+ font-size: 1rem;
93
+ color: black;
94
+ padding: 0;
95
+ font-style: normal;
96
+ font-family: inherit;
97
+ margin-bottom: 1rem;
98
+ }
99
+ }
50
100
  .form {
51
101
  .input {
52
102
  border: 2px solid #525252 !important;
53
103
  }
54
104
  }
55
105
 
56
- @include media-breakpoint-down(sm) {
57
- .left-block-container {
58
- max-height: 100%;
59
- overflow: visible;
106
+ .ryft-payment-form {
107
+ @include media-breakpoint-up(md) {
108
+ .submit-button-wrapper {
109
+ max-width: 15.5rem;
110
+ }
111
+ }
112
+
113
+ // it's style for Google and Apple pay container, for unknown reasons we can't move this html elements with appendChild or replaceChild
114
+ .ryft-pay-grid {
115
+ width: 100%;
116
+ max-width: 15.5rem;
117
+ margin-bottom: 1rem;
118
+ }
119
+ .ryft-pay-apple-pay-button {
120
+ border-radius: 0.25rem;
60
121
  }
61
122
  }
62
- }
63
123
 
124
+ .divider {
125
+ display: none !important;
126
+ }
127
+ }
64
128
  @include media-breakpoint-down(sm) {
65
- flex-direction: column-reverse;
66
- overflow: scroll;
129
+ .left-block-container {
130
+ max-height: 100%;
131
+ overflow: visible;
132
+ }
133
+ }
134
+ }
67
135
 
68
- @include media-breakpoint-down(sm) {
69
- .left-block {
70
- min-height: 100%;
71
- }
72
- .right-block {
73
- margin: 0 auto;
74
- width: 100%;
75
- .children-wrapper {
76
- .accordion {
77
- .collapse {
78
- overflow: visible;
79
- overflow-x: unset;
80
- scrollbar-width: unset;
81
- }
136
+ @include media-breakpoint-down(sm) {
137
+ flex-direction: column-reverse;
138
+ overflow: scroll;
139
+
140
+ @include media-breakpoint-down(sm) {
141
+ .left-block {
142
+ min-height: 100%;
143
+ }
144
+ .right-block {
145
+ margin: 0 auto;
146
+ width: 100%;
147
+ .children-wrapper {
148
+ .accordion {
149
+ .collapse {
150
+ overflow: visible;
151
+ overflow-x: unset;
152
+ scrollbar-width: unset;
82
153
  }
83
154
  }
84
155
  }
85
156
  }
86
157
  }
87
158
  }
88
- ::-webkit-scrollbar {
89
- display: none;
90
- scrollbar-width: none;
91
- }
92
159
  }
93
- }
94
-
95
- #ryft-threeDSMethodIframe {
96
- display: none;
97
- }
98
-
99
- .ryft-payment-form {
100
- .submit-button-wrapper {
101
- margin: -1rem 0 1rem;
102
-
103
- button {
104
- width: 100%;
105
- }
106
- }
107
- #mobile-pay-divider-container {
108
- display: flex;
109
- position: relative;
110
- margin-bottom: 1rem;
111
- #mobile-pay-divider-text {
112
- margin-right: 1rem;
113
- font-size: 0.875rem;
114
- font-weight: 600;
115
- }
116
- #mobile-pay-divider {
117
- width: 100%;
118
- border-bottom: 1px #dfdfdf solid;
119
- margin-bottom: 0.6rem;
120
- }
121
- }
122
-
123
- #card-title-container {
124
- height: auto;
125
- border: none;
126
- margin-bottom: 0.5rem;
127
- text-align: left;
128
- :first-child {
129
- font-size: 1rem;
130
- font-weight: 600;
131
- margin-bottom: 1rem;
132
- }
133
-
134
- .form-label {
135
- margin-bottom: 0.5rem;
136
- }
137
- }
138
- .mobile-pay-title {
139
- display: block;
140
- font-weight: 600;
141
- font-size: 1rem;
142
- color: black;
143
- padding: 0;
144
- font-style: normal;
145
- font-family: inherit;
146
- margin-bottom: 1rem;
160
+ ::-webkit-scrollbar {
161
+ display: none;
162
+ scrollbar-width: none;
147
163
  }
148
164
  }
149
165
 
150
- @include media-breakpoint-up(md) {
151
- .ryft-payment-form,
152
- .iframe-payment-form {
153
- position: relative;
154
- max-height: 300px !important;
155
- .submit-button-wrapper {
156
- max-width: 15.5rem;
166
+ @include media-breakpoint-down(md) {
167
+ .payment_link {
168
+ .page-body {
169
+ .left-block {
170
+ .left-block-container {
171
+ .ryft-payment-form {
172
+ position: relative;
173
+ max-height: 300px !important;
174
+ .ryft-pay-grid {
175
+ width: 100%;
176
+ max-width: 100%;
177
+ }
178
+ }
179
+ }
180
+ }
157
181
  }
158
182
  }
183
+ }
159
184
 
160
- // it's style for Google and Apple pay container, for unknown reasons we can't move this html elements with appendChild or replaceChild
161
- .ryft-pay-grid {
162
- width: 100%;
163
- max-width: 15.5rem;
164
- margin-bottom: 1rem;
165
- }
166
- .ryft-pay-apple-pay-button {
167
- border-radius: 0.25rem;
168
- }
169
-
170
- .divider {
171
- display: none !important;
172
- }
185
+ #ryft-threeDSMethodIframe {
186
+ display: none;
173
187
  }
@@ -5,7 +5,7 @@
5
5
  flex-wrap: wrap;
6
6
 
7
7
  .result-card {
8
- height: 14rem;
8
+ height: 14.25rem;
9
9
  border: 1px solid $gray-400;
10
10
  max-width: calc(50% - 0.75rem);
11
11
  flex: 0 0 calc(50% - 0.75rem);
@@ -12,8 +12,7 @@ export interface TypeaheadProps {
12
12
  isMultipleChoise?: boolean;
13
13
  noOptionsMessage: string;
14
14
  isInvalid?: boolean;
15
- isCouponForm?: boolean;
16
15
  }
17
- declare function Typeahead({ options, placeholder, isRequired, isMultipleChoise, name, isCouponForm, noOptionsMessage, isInvalid, }: TypeaheadProps): JSX.Element;
16
+ declare function Typeahead({ options, placeholder, isRequired, isMultipleChoise, name, noOptionsMessage, isInvalid, }: TypeaheadProps): JSX.Element;
18
17
  export { Typeahead };
19
18
  //# sourceMappingURL=Typeahead.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../src/typeahead/Typeahead.tsx"],"names":[],"mappings":";AAIA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,iBAAS,SAAS,CAAC,EACjB,OAAO,EACP,WAAW,EACX,UAAkB,EAClB,gBAAgB,EAChB,IAAS,EACT,YAAoB,EACpB,gBAAqB,EACrB,SAAS,GACV,EAAE,cAAc,eA4ChB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../src/typeahead/Typeahead.tsx"],"names":[],"mappings":";AAIA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,iBAAS,SAAS,CAAC,EACjB,OAAO,EACP,WAAW,EACX,UAAkB,EAClB,gBAAgB,EAChB,IAAS,EACT,gBAAqB,EACrB,SAAS,GACV,EAAE,cAAc,eAiChB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),n=e(require("react")),o=require("react-hook-form"),t=e(require("react-select"));exports.Typeahead=function(e){var i=e.options,s=e.placeholder,a=e.isRequired,l=void 0!==a&&a,u=e.isMultipleChoise,c=e.name,d=void 0===c?"":c,p=e.isCouponForm,m=void 0!==p&&p,f=e.noOptionsMessage,v=void 0===f?"":f,g=e.isInvalid,_=o.useFormContext().control;return n.createElement(n.Fragment,null,n.createElement(o.Controller,{name:d,control:_,rules:{required:l},render:function(e){var o=e.field;return n.createElement(t,{placeholder:s,value:o.value,isMulti:u,styles:{control:function(e){return r.__assign(r.__assign({},e),(n=m?{borderRadius:"1rem",minHeight:"3rem"}:{},g?r.__assign({borderColor:"red"},n):r.__assign({},n)));var n}},onChange:function(e){o.onChange(e)},options:i,noOptionsMessage:function(){return n.createElement("span",null,v)}})}}))};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),n=e(require("react")),t=require("react-hook-form"),o=e(require("react-select"));exports.Typeahead=function(e){var i=e.options,l=e.placeholder,a=e.isRequired,u=void 0!==a&&a,s=e.isMultipleChoise,c=e.name,d=void 0===c?"":c,p=e.noOptionsMessage,f=void 0===p?"":p,v=e.isInvalid,m=t.useFormContext().control;return n.createElement(n.Fragment,null,n.createElement(t.Controller,{name:d,control:m,rules:{required:u},render:function(e){var t=e.field;return n.createElement(o,{placeholder:l,value:t.value,isMulti:s,styles:{control:function(e){return r.__assign(r.__assign({},e),v?{borderColor:"red"}:{})}},onChange:function(e){t.onChange(e)},options:i,noOptionsMessage:function(){return n.createElement("span",null,f)}})}}))};
@@ -7,10 +7,10 @@ export type ZoneFormProps = {
7
7
  onSubmit: (values: Partial<Zone>) => void;
8
8
  serverErrors?: ServerError;
9
9
  isLoading?: boolean;
10
- workHours: WorkHour[] | undefined;
10
+ workHours?: WorkHour[];
11
11
  };
12
12
  export type ZoneFormValues = Partial<Zone> & {
13
13
  localImageBlobURL?: string;
14
14
  };
15
- export declare const ZoneForm: ({ defaultValues, onSubmit, serverErrors, isLoading, workHours, }: ZoneFormProps) => JSX.Element;
15
+ export declare const ZoneForm: ({ defaultValues, onSubmit, serverErrors, isLoading, }: ZoneFormProps) => JSX.Element;
16
16
  //# sourceMappingURL=ZoneForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ZoneForm.d.ts","sourceRoot":"","sources":["../../../src/zone/form/ZoneForm.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAGtF,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,QAAQ,qEAMlB,aAAa,gBAiDf,CAAC"}
1
+ {"version":3,"file":"ZoneForm.d.ts","sourceRoot":"","sources":["../../../src/zone/form/ZoneForm.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAGtF,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,QAAQ,0DAKlB,aAAa,gBAiDf,CAAC"}
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=require("react"),o=e(t),n=require("react-i18next"),s=require("react-bootstrap"),a=require("react-hook-form"),l=e(require("@licklist/plugins/dist/services/Form/FormErrorService")),u=require("./components/ZoneControl.js");exports.ZoneForm=function(e){var i=e.defaultValues,c=e.onSubmit,m=e.serverErrors,d=e.isLoading,f=void 0!==d&&d,b=e.workHours,p=n.useTranslation("Design").t,v=a.useForm({mode:"onChange",defaultValues:{zoneRecurrences:[]}}),E=v.reset,g=v.setError,q=v.handleSubmit,w=(0,v.watch)();return t.useEffect((function(){i&&E(i)}),[i,E]),t.useEffect((function(){m&&l.handleServerErrors(m,g)}),[m,g]),o.createElement(a.FormProvider,r.__assign({},v),o.createElement(s.Form,{onSubmit:q((function(e){e.localImageBlobURL;var t=r.__rest(e,["localImageBlobURL"]);c(t)}))},o.createElement(u.ZoneControl,{isLoading:f,workHours:b}),o.createElement(s.Row,null,o.createElement(s.Col,{md:6,sm:12}),o.createElement(s.Col,{className:"product-set-save-btn-wrapper p-0 pl-4 d-flex mw-100",md:6,sm:12},o.createElement(s.Button,{className:"product-set-save-btn mt-5 ml-5 d-no dne d-md-block",type:"submit",disabled:f||!w.name},p("saveAndClose"))))))};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=require("react"),o=e(t),n=require("react-i18next"),s=require("react-bootstrap"),a=require("react-hook-form"),l=e(require("@licklist/plugins/dist/services/Form/FormErrorService")),i=require("./components/ZoneControl.js");exports.ZoneForm=function(e){var u=e.defaultValues,c=e.onSubmit,m=e.serverErrors,d=e.isLoading,f=void 0!==d&&d,b=n.useTranslation("Design").t,p=a.useForm({mode:"onChange",defaultValues:{zoneRecurrences:[]}}),v=p.reset,E=p.setError,g=p.handleSubmit,q=(0,p.watch)();return t.useEffect((function(){u&&v(u)}),[u,v]),t.useEffect((function(){m&&l.handleServerErrors(m,E)}),[m,E]),o.createElement(a.FormProvider,r.__assign({},p),o.createElement(s.Form,{onSubmit:g((function(e){e.localImageBlobURL;var t=r.__rest(e,["localImageBlobURL"]);c(t)}))},o.createElement(i.ZoneControl,{isLoading:f}),o.createElement(s.Row,null,o.createElement(s.Col,{md:6,sm:12}),o.createElement(s.Col,{className:"product-set-save-btn-wrapper p-0 pl-4 d-flex mw-100",md:6,sm:12},o.createElement(s.Button,{className:"product-set-save-btn mt-5 ml-5 d-no dne d-md-block",type:"submit",disabled:f||!q.name},b("saveAndClose"))))))};