@licklist/design 0.62.1 → 0.62.3-dev.1

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 (143) hide show
  1. package/bitbucket-pipelines.yml +0 -8
  2. package/dist/date-time-button/DateTimeButton.js +1 -1
  3. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +3 -1
  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 +3 -1
  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 +3 -1
  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 +4 -1
  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 +3 -1
  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 +12 -0
  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 +2 -1
  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/sales/coupon/utils/index.d.ts +7 -0
  47. package/dist/sales/coupon/utils/index.d.ts.map +1 -0
  48. package/dist/sales/coupon/utils/index.js +1 -0
  49. package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
  50. package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
  51. package/dist/setting/dashboard/DashboardSettingForm.d.ts +1 -0
  52. package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
  53. package/dist/setting/dashboard/DashboardSettingForm.js +1 -1
  54. package/dist/styles/iframe-external-modal/IframeExternalModal.scss +5 -2
  55. package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +99 -113
  56. package/dist/styles/sales/BookingResults.scss +1 -1
  57. package/dist/typeahead/Typeahead.d.ts +2 -1
  58. package/dist/typeahead/Typeahead.d.ts.map +1 -1
  59. package/dist/typeahead/Typeahead.js +1 -1
  60. package/dist/zone/form/ZoneForm.d.ts +2 -2
  61. package/dist/zone/form/ZoneForm.d.ts.map +1 -1
  62. package/dist/zone/form/ZoneForm.js +1 -1
  63. package/dist/zone/form/components/ZoneControl.d.ts +2 -2
  64. package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
  65. package/dist/zone/form/components/ZoneControl.js +1 -1
  66. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -4
  67. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
  68. package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
  69. package/dist/zone/form/utils/dates.d.ts.map +1 -1
  70. package/package.json +10 -35
  71. package/src/date-time-button/DateTimeButton.stories.tsx +2 -1
  72. package/src/date-time-button/DateTimeButton.tsx +7 -5
  73. package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +4 -0
  74. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +10 -8
  75. package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +4 -0
  76. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +6 -6
  77. package/src/iframe/ryft/RyftPaymentForm.tsx +12 -4
  78. package/src/iframe/ryft/utils/ryft-form.ts +8 -4
  79. package/src/product-set/control/DateAndRecurrenceInput.tsx +3 -2
  80. package/src/product-set/control/DateInput.tsx +2 -4
  81. package/src/product-set/control/ProductSetControl.tsx +1 -1
  82. package/src/product-set/form/ProductCategoriesControl.tsx +1 -1
  83. package/src/product-set/form/ProductSetForm.tsx +5 -1
  84. package/src/product-set/hooks/useSortableTreeFunctions.ts +2 -0
  85. package/src/product-set/product/ProductControl.tsx +38 -38
  86. package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +0 -2
  87. package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +4 -18
  88. package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +0 -1
  89. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +11 -1
  90. package/src/recurring-date-picker-input/utils.ts +77 -0
  91. package/src/sales/booking/results/BookingResults.stories.tsx +3 -2
  92. package/src/sales/booking/results/components/ResultCard.tsx +2 -5
  93. package/src/sales/coupon/control/CouponFormControl.tsx +29 -50
  94. package/src/sales/coupon/form/CouponFrom.tsx +5 -15
  95. package/src/sales/coupon/utils/index.ts +13 -0
  96. package/src/setting/admin/AdminSettingForm.tsx +2 -2
  97. package/src/setting/dashboard/DashboardSettingForm.tsx +13 -0
  98. package/src/sortable-tree/SortableTreeItem.tsx +1 -1
  99. package/src/static/switch/BooleanSwitch.tsx +1 -1
  100. package/src/styles/iframe-external-modal/IframeExternalModal.scss +5 -2
  101. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +99 -113
  102. package/src/styles/sales/BookingResults.scss +1 -1
  103. package/src/typeahead/Typeahead.tsx +16 -3
  104. package/src/zone/form/ZoneForm.tsx +3 -2
  105. package/src/zone/form/components/ZoneControl.tsx +3 -3
  106. package/src/zone/form/components/ZoneRecurrencesControl.tsx +7 -5
  107. package/src/zone/form/utils/dates.ts +9 -10
  108. package/jest.config.js +0 -29
  109. package/tests/Auth/Authorizer.test.tsx +0 -194
  110. package/tests/Auth/Layout/UserNavDropDown.test.tsx +0 -43
  111. package/tests/Auth/Layout/UserNavDropDownToggle.test.tsx +0 -33
  112. package/tests/Auth/Login/LoginComponent.test.tsx +0 -246
  113. package/tests/Auth/Login/LoginFormComponent.test.tsx +0 -182
  114. package/tests/Auth/Register/RegisterComponent.test.tsx +0 -285
  115. package/tests/Auth/Register/RegisterFormComponent.test.tsx +0 -170
  116. package/tests/Auth/Settings/Dashboard/IpInput.test.tsx +0 -130
  117. package/tests/Auth/Social/SocialCallbackComponent.test.tsx +0 -133
  118. package/tests/Auth/Social/SocialFormComponent.test.tsx +0 -118
  119. package/tests/FileUpload/FileUpload.test.tsx +0 -42
  120. package/tests/Notification/EmailTemplate.test.tsx +0 -82
  121. package/tests/ProductSet/ProductSetPopover.test.tsx +0 -40
  122. package/tests/Report/Report.test.tsx +0 -48
  123. package/tests/Sales/Coupon.test.tsx +0 -51
  124. package/tests/Sales/SalesAndVIews.test.tsx +0 -63
  125. package/tests/SnippetTemplates/SnippetTemplates.test.tsx +0 -56
  126. package/tests/Table/FilterHelperComponent.test.tsx +0 -88
  127. package/tests/Table/PaginationHelperComponent.test.tsx +0 -109
  128. package/tests/Table/PerPageHelperComponent.test.tsx +0 -34
  129. package/tests/Table/TableHelperComponent.test.tsx +0 -295
  130. package/tests/TipTapEditor/TipTapEditor.test.tsx +0 -28
  131. package/tests/__mock__/hooks/useAuthApi.ts +0 -13
  132. package/tests/__mock__/hooks/useAuthMock.ts +0 -13
  133. package/tests/__mock__/hooks/useFormMock.ts +0 -27
  134. package/tests/__mock__/hooks/useNotificationMock.ts +0 -13
  135. package/tests/__mock__/hooks/useQueryMock.ts +0 -16
  136. package/tests/__mock__/hooks/useSocialApiMock.ts +0 -20
  137. package/tests/__mock__/hooks/useTranslationMock.ts +0 -17
  138. package/tests/__mock__/hooks/useUserApiMock.ts +0 -18
  139. package/tests/__mock__/hooks/useUserMock.ts +0 -13
  140. package/tests/__mock__/styleMock.js +0 -1
  141. package/tests/__mock__/windowMock.ts +0 -5
  142. package/tests/packages/react-query.tsx +0 -28
  143. package/tests/setupTests.ts +0 -10
@@ -1,6 +1,7 @@
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";
4
5
  import { SupportedFrequency } from "./utils";
5
6
  export interface RecurringDatePickerInputProps {
6
7
  disabled?: boolean;
@@ -10,6 +11,7 @@ export interface RecurringDatePickerInputProps {
10
11
  initialFrequency?: Frequency;
11
12
  setInitialStartDateAfterSelect?: boolean;
12
13
  minDate?: string;
14
+ workHours: WorkHour[] | undefined;
13
15
  }
14
16
  export interface RecurringDatePickerInputValues {
15
17
  rrule?: string;
@@ -24,6 +26,6 @@ export interface RecurringDatePickerInputValues {
24
26
  count?: number;
25
27
  withOutEndDate?: boolean;
26
28
  }
27
- export declare function RecurringDatePickerInput({ disabled, onChange, onDelete, defaultValues, initialFrequency, setInitialStartDateAfterSelect, children, minDate, }: PropsWithChildren<RecurringDatePickerInputProps>): JSX.Element;
29
+ export declare function RecurringDatePickerInput({ disabled, onChange, onDelete, defaultValues, initialFrequency, setInitialStartDateAfterSelect, children, minDate, workHours, }: PropsWithChildren<RecurringDatePickerInputProps>): JSX.Element;
28
30
  export declare const getDateTimeObject: (date: string, time: string) => DateTime | string;
29
31
  //# 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;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
+ {"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 +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"),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
+ "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,3 +1,4 @@
1
+ import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
1
2
  import { Frequency, Weekday } from "rrule";
2
3
  export declare const getWeekdayForFrequency: ({ date, frequency, }: {
3
4
  date: string;
@@ -15,4 +16,15 @@ export declare const parseAndValidateRRule: ({ rrule, date, }: {
15
16
  rrule: string;
16
17
  date: string;
17
18
  }) => 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
+ };
18
30
  //# 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,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
+ {"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 +1 @@
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
+ "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 +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;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
+ {"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 +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.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
+ "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,11 +1,12 @@
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";
4
5
  export interface CouponFormValues {
5
6
  name?: string;
6
7
  code: string;
7
8
  discountType: CouponType;
8
- productGroupIds: string[];
9
+ productGroupIds: Array<TypeaheadOptions | ProductGroup>;
9
10
  discount: number;
10
11
  totalType: CouponTotalType;
11
12
  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;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
+ {"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,gBAyVjB,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("@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
+ "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")),c=require("../utils/index.js");exports.CouponFormControl=function(e){var d,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,R=y.formState.errors,G=y.watch,L=r.useTranslation(["Design","Notification","App"]).t,N=t.__read(l.useState([]),2),h=N[0],q=N[1],k=G("startFrom"),A=G("validTill"),w=l.useRef(null),I=l.useRef(null),U=((d={})[s.COUPON_TYPE_FIXED]=L("Design:fixed"),d[s.COUPON_TYPE_FIXED_PER_PERSON]=L("Design:fixedPerPerson"),d[s.COUPON_TYPE_PERCENTAGE]=L("Design:percentage"),d[s.COUPON_TYPE_PERCENTAGE_PER_PERSON]=L("Design:percentagePerPerson"),d),S=((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(c.convertToTypeaheadOptions(e))}),[x]),l.useEffect((function(){O("productGroupIds",h)}),[x,O,h]);var V=c.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!==R.name},P("name",{required:L("Validation:fieldRequired",{attribute:L("Design:name")})}),{disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(p=null==R?void 0:R.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!==R.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==R?void 0:R.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(U).map((function(e){return n.createElement("option",{value:e,key:e},U[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!==R.discount},P("discount",{required:L("Validation:fieldRequired",{attribute:L("Design:discount")})}),{disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(v=null==R?void 0:R.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(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"},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!==R.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==R?void 0:R.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:noActiveTemplates",{notification:L("Design:email")})})))),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!==R.totalCoupons,disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(_=null==R?void 0:R.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,12 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { ProductGroup } from "@licklist/core/dist/DataMapper/Product/ProductGroupDataMapper";
2
+ import { ProductGroup, ProductGroupDTO } 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: string[];
9
+ productGroupIds: ProductGroupDTO[];
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,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
+ {"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"}
@@ -0,0 +1,7 @@
1
+ import { ProductGroup } from "@licklist/core/dist/DataMapper/Product/ProductGroupDataMapper";
2
+ export declare const convertToTypeaheadOptions: (productGroups?: ProductGroup[]) => {
3
+ id: number;
4
+ value: string;
5
+ label: string;
6
+ }[];
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sales/coupon/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+DAA+D,CAAC;AAE7F,eAAO,MAAM,yBAAyB,mBAAoB,YAAY,EAAE;;;;GAUvE,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.convertToTypeaheadOptions=function(e){return e&&e.length?e.map((function(e){var t=e.id,r=e.name;return{id:Number(t),value:r,label:r}})):[]};
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { HasPermissionProp } from "@licklist/plugins/dist/types/permission/Permission";
3
- import { ProviderType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
3
+ import { ProvidableType } 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?: ProviderType;
22
+ providerType?: ProvidableType;
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,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"}
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"}
@@ -10,6 +10,7 @@ export type DashboardSettingFormFieldValues = {
10
10
  isEnquiryOnly: boolean;
11
11
  hasUserVerification: boolean;
12
12
  metaPixelId?: number;
13
+ eventDeadlineErrorMessage?: string;
13
14
  } & EventSettingFormFieldValues & ProviderSettingFormFieldValues;
14
15
  export interface DashboardSettingFormProps extends HasPermissionProp {
15
16
  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;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
+ {"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 +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"),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")))};
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")))};
@@ -4,7 +4,8 @@ html[bkdt-scrollable="false"] {
4
4
  overflow: hidden !important;
5
5
  }
6
6
 
7
- body[bkdt-scrollable="false"] .bkdt-modal, body[bkdt-scrollable="false"] .bkdt-mask {
7
+ body[bkdt-scrollable="false"] .bkdt-modal,
8
+ body[bkdt-scrollable="false"] .bkdt-mask {
8
9
  display: block;
9
10
  }
10
11
 
@@ -15,7 +16,7 @@ body[bkdt-scrollable="false"] .bkdt-modal, body[bkdt-scrollable="false"] .bkdt-m
15
16
  width: 100%;
16
17
  height: 100%;
17
18
  z-index: 1000000;
18
- background-color: rgba(0,0,0,0.5);
19
+ background-color: rgba(0, 0, 0, 0.5);
19
20
  display: none;
20
21
  }
21
22
 
@@ -82,6 +83,7 @@ body[bkdt-scrollable="false"] .bkdt-modal, body[bkdt-scrollable="false"] .bkdt-m
82
83
  width: 100%;
83
84
  height: 100%;
84
85
  max-width: 800px;
86
+ min-height: unset;
85
87
  }
86
88
  }
87
89
  }
@@ -98,6 +100,7 @@ body[bkdt-scrollable="false"] .bkdt-modal, body[bkdt-scrollable="false"] .bkdt-m
98
100
  .bkdt-modal-content {
99
101
  .bkdt-modal-body {
100
102
  height: 35rem;
103
+ max-height: 85vh;
101
104
  }
102
105
  }
103
106
  }
@@ -47,141 +47,127 @@
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
- }
100
50
  .form {
101
51
  .input {
102
52
  border: 2px solid #525252 !important;
103
53
  }
104
54
  }
105
55
 
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;
56
+ @include media-breakpoint-down(sm) {
57
+ .left-block-container {
58
+ max-height: 100%;
59
+ overflow: visible;
118
60
  }
119
- .ryft-pay-apple-pay-button {
120
- border-radius: 0.25rem;
121
- }
122
- }
123
-
124
- .divider {
125
- display: none !important;
126
- }
127
- }
128
- @include media-breakpoint-down(sm) {
129
- .left-block-container {
130
- max-height: 100%;
131
- overflow: visible;
132
61
  }
133
62
  }
134
- }
135
-
136
- @include media-breakpoint-down(sm) {
137
- flex-direction: column-reverse;
138
- overflow: scroll;
139
63
 
140
64
  @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;
65
+ flex-direction: column-reverse;
66
+ overflow: scroll;
67
+
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
+ }
153
82
  }
154
83
  }
155
84
  }
156
85
  }
157
86
  }
158
87
  }
159
- }
160
- ::-webkit-scrollbar {
161
- display: none;
162
- scrollbar-width: none;
88
+ ::-webkit-scrollbar {
89
+ display: none;
90
+ scrollbar-width: none;
91
+ }
163
92
  }
164
93
  }
165
94
 
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
- }
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%;
181
105
  }
182
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;
147
+ }
183
148
  }
184
149
 
185
- #ryft-threeDSMethodIframe {
186
- display: none;
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;
157
+ }
158
+ }
159
+
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
+ }
187
173
  }
@@ -5,7 +5,7 @@
5
5
  flex-wrap: wrap;
6
6
 
7
7
  .result-card {
8
- height: 14.25rem;
8
+ height: 14rem;
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,7 +12,8 @@ export interface TypeaheadProps {
12
12
  isMultipleChoise?: boolean;
13
13
  noOptionsMessage: string;
14
14
  isInvalid?: boolean;
15
+ isCouponForm?: boolean;
15
16
  }
16
- declare function Typeahead({ options, placeholder, isRequired, isMultipleChoise, name, noOptionsMessage, isInvalid, }: TypeaheadProps): JSX.Element;
17
+ declare function Typeahead({ options, placeholder, isRequired, isMultipleChoise, name, isCouponForm, noOptionsMessage, isInvalid, }: TypeaheadProps): JSX.Element;
17
18
  export { Typeahead };
18
19
  //# 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;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
+ {"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"}