@licklist/design 0.61.1 → 0.62.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.
- package/dist/iframe/activity-card/ActivityCard.d.ts +2 -1
- package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
- package/dist/iframe/activity-card/ActivityCard.js +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.d.ts +3 -1
- package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.js +1 -1
- package/dist/iframe/ryft/utils/ryft-form.d.ts +2 -1
- package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
- package/dist/iframe/ryft/utils/ryft-form.js +1 -1
- package/dist/product-set/control/DateInput.d.ts.map +1 -1
- package/dist/product-set/control/DateInput.js +1 -1
- package/dist/styles/activity-card/ListActivitiesCard.scss +1 -1
- package/package.json +1 -1
- package/src/iframe/activity-card/ActivityCard.tsx +4 -2
- package/src/iframe/ryft/RyftPaymentForm.tsx +10 -1
- package/src/iframe/ryft/utils/ryft-form.ts +3 -1
- package/src/product-set/control/DateInput.tsx +3 -2
- package/src/styles/activity-card/ListActivitiesCard.scss +1 -1
|
@@ -9,7 +9,8 @@ export type ActivityCardProps = {
|
|
|
9
9
|
onSelect: () => void;
|
|
10
10
|
isSelected: boolean;
|
|
11
11
|
layout?: Layout;
|
|
12
|
+
availableTimes?: string | null;
|
|
12
13
|
};
|
|
13
|
-
export declare const ActivityCard: ({ title, duration, price, onSelect, isSelected, layout, }: ActivityCardProps) => JSX.Element;
|
|
14
|
+
export declare const ActivityCard: ({ title, duration, price, availableTimes, onSelect, isSelected, layout, }: ActivityCardProps) => JSX.Element;
|
|
14
15
|
export {};
|
|
15
16
|
//# sourceMappingURL=ActivityCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityCard.d.ts","sourceRoot":"","sources":["../../../src/iframe/activity-card/ActivityCard.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,eAAO,MAAM,WAAW,SAAS,CAAC;AAClC,eAAO,MAAM,WAAW,SAAS,CAAC;AAElC,KAAK,MAAM,GAAG,OAAO,WAAW,GAAG,OAAO,WAAW,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ActivityCard.d.ts","sourceRoot":"","sources":["../../../src/iframe/activity-card/ActivityCard.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,eAAO,MAAM,WAAW,SAAS,CAAC;AAClC,eAAO,MAAM,WAAW,SAAS,CAAC;AAElC,KAAK,MAAM,GAAG,OAAO,WAAW,GAAG,OAAO,WAAW,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,YAAY,8EAStB,iBAAiB,gBAwCnB,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")),l=e(require("clsx")),a="grid";exports.ActivityCard=function(e){var
|
|
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")),l=e(require("clsx")),a="grid";exports.ActivityCard=function(e){var i=e.title,c=e.duration,r=e.price,n=e.availableTimes,s=e.onSelect,d=e.isSelected,m=e.layout;return(void 0===m?a:m)===a?t.createElement("button",{type:"button",className:l("activity-card",d&&"active"),onClick:s},t.createElement("div",{className:l("d-flex","flex-column")},t.createElement("div",{className:"activity-card-title"},i),c&&t.createElement("div",null,c),r&&t.createElement("div",null,r))):t.createElement("div",{role:"button",onClick:s,onKeyPress:s,tabIndex:0},t.createElement("div",{className:l("list-activity-card",{active:d})},t.createElement("div",{className:"description"},t.createElement("div",{className:"title mb-2"},i),n&&t.createElement("div",null,n),c&&t.createElement("div",null,t.createElement("p",null,c)),r&&t.createElement("div",null,r))),t.createElement("hr",{className:"list-activity-card-hr"}))},exports.LAYOUT_GRID=a,exports.LAYOUT_LIST="list";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AttemptPaymentResponse } from "@licklist/plugins/dist/hooks/Ryft/useRyftPayment";
|
|
3
|
+
import { ProviderPaymentSettings } from "@licklist/core/dist/DataMapper/Setting/ProviderPaymentSettingsDataMapper";
|
|
3
4
|
export declare const ryftErrorMap: Record<string, string>;
|
|
4
5
|
export type RyftPaymentFormValues = Record<string, never>;
|
|
5
6
|
export interface RyftPaymentFormProps {
|
|
@@ -8,6 +9,7 @@ export interface RyftPaymentFormProps {
|
|
|
8
9
|
initRyft: (onSuccess: () => void, onFailure: (error?: string) => void) => Promise<void>;
|
|
9
10
|
onSubmit: () => Promise<AttemptPaymentResponse>;
|
|
10
11
|
resetReferrer?: () => void;
|
|
12
|
+
providerPaymentSettings?: ProviderPaymentSettings;
|
|
11
13
|
}
|
|
12
|
-
export declare const RyftPaymentForm: ({ accountId, isCreateLoading, initRyft, resetReferrer, onSubmit, }: RyftPaymentFormProps) => JSX.Element;
|
|
14
|
+
export declare const RyftPaymentForm: ({ accountId, isCreateLoading, providerPaymentSettings, initRyft, resetReferrer, onSubmit, }: RyftPaymentFormProps) => JSX.Element;
|
|
13
15
|
//# sourceMappingURL=RyftPaymentForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RyftPaymentForm.d.ts","sourceRoot":"","sources":["../../../src/iframe/ryft/RyftPaymentForm.tsx"],"names":[],"mappings":";AAOA,OAAO,EAKL,sBAAsB,EACvB,MAAM,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"RyftPaymentForm.d.ts","sourceRoot":"","sources":["../../../src/iframe/ryft/RyftPaymentForm.tsx"],"names":[],"mappings":";AAOA,OAAO,EAKL,sBAAsB,EACvB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0EAA0E,CAAC;AAKnH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAW/C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE1D,MAAM,WAAW,oBAAoB;IAEnC,SAAS,EAAE,GAAG,CAAC;IACf,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,CACR,SAAS,EAAE,MAAM,IAAI,EACrB,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,KAChC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,QAAQ,EAAE,MAAM,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAChD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;CACnD;AAED,eAAO,MAAM,eAAe,gGAOzB,oBAAoB,gBA8JtB,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"),r=require("react"),n=e(r),a=require("react-router-dom"),i=require("../../static/loader/BlockLoader.js"),o=require("react-i18next"),u=e(require("react-bootstrap/Button")),
|
|
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"),r=require("react"),n=e(r),a=require("react-router-dom"),i=require("../../static/loader/BlockLoader.js"),o=require("react-i18next"),u=e(require("react-bootstrap/Button")),d=require("react-hook-form"),s=require("../../static/loader/ButtonLoader.js"),l=e(require("react-bootstrap/Alert"));require("../../static/index.js");var c=require("@licklist/plugins/dist/hooks/Ryft/useRyftPayment"),f=require("./utils/ryft-form.js"),m={insufficient_funds:"insufficientFunds",declined_do_not_honour:"declinedDoNotHonour",invalid_card_number:"invalidCardNumber",restricted_card:"restrictedCard",security_violation:"securityViolation",expired_card:"expiredCard",gateway_reject:"gatewayReject",bad_track_data:"badTrackData","3ds_authentication_failure":"3dsAuthenticationFailure",unknown_error:"unknownError"};exports.RyftPaymentForm=function(e){var y,_,v=e.accountId,E=e.isCreateLoading,p=e.providerPaymentSettings,g=e.initRyft,b=e.resetReferrer,h=e.onSubmit,R=o.useTranslation(["Design","Validation","Ryft"]).t,q=r.useRef(null),S=a.useHistory(),k=t.__read(r.useState(!1),2),w=k[0],N=k[1],P=t.__read(r.useState(!1),2),T=P[0],F=P[1],A=t.__read(r.useState(!1),2),j=A[0],x=A[1],C=t.__read(r.useState(void 0),2),D=C[0],M=C[1],L=c.useRyftPayment().addEventHandler,U=d.useForm(),V=function(){b&&b()},B=function(e){(null==e?void 0:e.id)&&(null==e?void 0:e.returnUrl)&&(window.location.href="".concat(e.returnUrl,"&ps=").concat(e.id),V())};return r.useEffect((function(){return f.injectComponentsInRyftForm({t:R,additionalPaymentMethodsEnabled:null==p?void 0:p.additionalPaymentMethodsEnabled})}),[null===(_=null===(y=q.current)||void 0===y?void 0:y.childNodes)||void 0===_?void 0:_.length]),r.useEffect((function(){v.data&&!v.isError&&g((function(){L("cardValidationChanged",(function(e){N(e.isValid)})),x(!1)}),(function(){return x(!0)}))}),[v.data]),v.isLoading||v.isFetching||E?n.createElement("div",{className:"mt-5 pt-5"},n.createElement(i.BlockLoader,null)):v.isError?n.createElement("div",{className:"mt-5 ryft-init-failure"},n.createElement(l,{key:"danger",variant:"danger"},n.createElement("h5",null,R("Ryft:errorMessage")),R("Ryft:noPaymentProviderFound"))):j?n.createElement("div",{className:"mt-5 ryft-init-failure"},n.createElement(l,{key:"danger",variant:"danger"},n.createElement("h5",null,R("Ryft:errorMessage")),R("Ryft:initFailureMessage"),n.createElement("div",{className:"flex flex-column align-items-center mt-4"},n.createElement(u,{variant:"primary",onClick:function(){S.go(0)}},R("Ryft:refresh"))))):n.createElement(n.Fragment,null,n.createElement("form",{ref:q,id:"ryft-pay-form",noValidate:!0,onSubmit:U.handleSubmit((function(){return t.__awaiter(void 0,void 0,void 0,(function(){var e,r,n;return t.__generator(this,(function(t){switch(t.label){case 0:F(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,h()];case 2:if((e=t.sent())||M("unknown_error"),"requiredAction"in e){if(e.status!==c.RYFT_STATUS_PENDING_ACTION||!(null===(n=e.requiredAction)||void 0===n?void 0:n.url))return B(e),[2];window.location.href=e.requiredAction.url,V()}return e.status===c.RYFT_STATUS_APPROVED||e.status===c.RYFT_STATUS_CAPTURED?(B(e),[2]):(e.lastError&&(M(e.lastError),V()),[3,5]);case 3:return r=t.sent(),M(r),[3,5];case 4:return F(!1),[7];case 5:return[2]}}))}))})),className:"ryft-payment-form"},n.createElement("div",{className:"submit-button-wrapper mt-4 p-1"},n.createElement(u,{type:"submit",disabled:T||!w},T&&n.createElement(s.ButtonLoader,null),R("Design:buyNow"))),D&&n.createElement("div",{id:"ryft-payment-error"},R("".concat(m[D])))))},exports.ryftErrorMap=m;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TFunction } from "react-i18next";
|
|
2
|
-
export declare const injectComponentsInRyftForm: ({ t, }: {
|
|
2
|
+
export declare const injectComponentsInRyftForm: ({ t, additionalPaymentMethodsEnabled, }: {
|
|
3
3
|
t: TFunction<string[]>;
|
|
4
|
+
additionalPaymentMethodsEnabled?: boolean;
|
|
4
5
|
}) => void;
|
|
5
6
|
//# sourceMappingURL=ryft-form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ryft-form.d.ts","sourceRoot":"","sources":["../../../../src/iframe/ryft/utils/ryft-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAO,MAAM,0BAA0B;
|
|
1
|
+
{"version":3,"file":"ryft-form.d.ts","sourceRoot":"","sources":["../../../../src/iframe/ryft/utils/ryft-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAO,MAAM,0BAA0B;OAIlC,UAAU,MAAM,EAAE,CAAC;sCACY,OAAO;UAyC1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.injectComponentsInRyftForm=function(e){var t=e.t,n=document.getElementById("ryft-pay-iframe"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.injectComponentsInRyftForm=function(e){var t=e.t,n=e.additionalPaymentMethodsEnabled,i=document.getElementById("ryft-pay-iframe"),d=document.getElementById("card-title-container");if(i&&!d){var a=document.createElement("div"),r=document.createElement("div"),o=document.createElement("div");o.id="card-title-container",a.textContent=t("Design:enterCardDetails"),r.className="bold-text form-label",r.innerText=t("Design:paymentDetails"),o.append(a,r),null==i||i.before(o);var m=document.getElementById("ryft-pay-grid");if(m&&n){var l=document.createElement("div"),c=document.createElement("div"),s=document.createElement("div"),p=document.createElement("div");l.className="mobile-pay-title",l.innerText=t("Design:expressCheckoutWith"),c.id="mobile-pay-divider-text",c.innerText="or",s.id="mobile-pay-divider",p.id="mobile-pay-divider-container",p.append(c,s),m.before(l),m.after(p)}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/DateInput.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAO1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uEAAuE,CAAC;AAI7G,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAkBtF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;CACnD;AAED,UAAU,2BAA2B;IACnC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,4BAA4B,EAAE,OAAO,CAAC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,SAAS,mFAKnB,2BAA2B,
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/DateInput.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAO1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uEAAuE,CAAC;AAI7G,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAkBtF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;CACnD;AAED,UAAU,2BAA2B;IACnC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,4BAA4B,EAAE,OAAO,CAAC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,SAAS,mFAKnB,2BAA2B,gBAsP7B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAC5C,WAAW,EACX,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsBxB,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),i=require("react-i18next"),a=require("react-bootstrap"),u=require("../../static/Icon.js"),o=require("react-hook-form"),l=require("@react-aria/utils"),s=require("react-use"),c=require("luxon");require("../../static/index.js");var d=require("../../modals/confirmation/ConfirmModal.js"),m=require("rrule"),v=e(m),f=require("@licklist/core/dist/Config/Date"),p=require("../../recurring-date-picker-input/RecurringDatePickerInput.js"),g=require("../../zone/form/components/AvailableTimesControl.js"),T=require("../product/constants.js"),
|
|
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),i=require("react-i18next"),a=require("react-bootstrap"),u=require("../../static/Icon.js"),o=require("react-hook-form"),l=require("@react-aria/utils"),s=require("react-use"),c=require("luxon");require("../../static/index.js");var d=require("../../modals/confirmation/ConfirmModal.js"),m=require("rrule"),v=e(m),f=require("@licklist/core/dist/Config/Date"),p=require("../../recurring-date-picker-input/RecurringDatePickerInput.js"),g=require("../../zone/form/components/AvailableTimesControl.js"),T=require("../product/constants.js"),b=require("../../recurring-date-picker-input/DatePickerInput.js"),E=require("./ProductSetRecurrenceOverridesControl.js"),R={name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var r=e.state,t={width:"".concat(r.rects.reference.width+4,"px"),marginLeft:"-2px",maxWidth:"unset"};Object.assign(r.styles.popper,t)},effect:function(e){var r=e.state,t=r.elements.reference.getBoundingClientRect().width,n={width:"".concat(t,"px"),maxWidth:"unset"};Object.assign(r.elements.popper.style,n)}};exports.DateInput=function(e){var _,D,q,x,h=e.isEventEditProductSet,I=e.isLoading,y=e.workHours,C=e.providerHasBookingManagement,M=o.useFormContext(),O=M.control,k=M.register,w=M.formState.errors,A=M.getValues,N=M.setValue,S=M.clearErrors,j=o.useFieldArray({name:"menuRecurrences",control:O,keyName:"_id"}),F=j.fields,P=j.append,V=j.update,L=r.__read(t.useState([]),2),W=L[0],B=L[1],H=r.__read(t.useState(!1),2),U=H[0],z=H[1],Y=t.useRef(),G=r.__read(t.useState({index:null,values:null}),2),J=G[0],K=G[1],Q=function(){return K({index:null,values:null})},X=t.useRef();s.useClickAway(X,(function(e){var r,t,n;d.CONFIRM_MODAL_ACTIONS.includes(null===(n=null===(t=null===(r=e.target)||void 0===r?void 0:r.attributes)||void 0===t?void 0:t.getNamedItem("data-id"))||void 0===n?void 0:n.value)||(z(!1),Q())}));var Z=l.useId(),$=i.useTranslation("Design").t,ee=function(){F.length>=1||(Q(),z((function(e){return!e})))};return n.createElement(a.Form.Group,null,n.createElement(a.Form.Label,null,$(h?"whenOverridesAvailable":"productSetAvailable")),n.createElement(a.OverlayTrigger,{show:U,overlay:n.createElement(a.Popover,{id:Z,className:"rounded"},n.createElement(a.Popover.Content,{className:"shadow-lg rounded",ref:X},n.createElement(b.DatePickerInput,{defaultValues:J.values,onChange:function(e){return r.__awaiter(void 0,void 0,void 0,(function(){var t,n,i,a,u,o,l,s,d,g,T,b,E;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,null===(d=Y.current)||void 0===d?void 0:d.trigger()];case 1:return t=r.sent(),(null==e?void 0:e.startTime)&&(null==e?void 0:e.endTime)&&t&&(n=c.DateTime.fromISO(e.startTime),i=c.DateTime.fromISO(e.endTime),a=Y.current.getValues().availableTimes,!a.every((function(e){var r=c.DateTime.fromFormat(e,f.TIME_FORMAT);return r.diff(n,"minutes").minutes>=0&&r.diff(i,"minutes").minutes<=0})))?(Y.current.setError("availableTimes",{message:$("Validation:fieldTimeBetween",{attribute:$("Design:startTimesSmall"),min:n.toFormat(f.TIME_FORMAT),max:i.toFormat(f.TIME_FORMAT)})}),[2]):(u=p.getDateTimeObject(e.startDate,e.endTime||"23:59:59"),o=v.optionsToString({until:u.toJSDate(),byweekday:[],freq:m.Frequency.DAILY,tzid:f.TIMEZONE,interval:1}).replace("RRULE:",""),l=(null===(T=null===(g=null==Y?void 0:Y.current)||void 0===g?void 0:g.getValues())||void 0===T?void 0:T.availableTimes)||null,s={rrule:o,startDate:e.startDate,endDate:e.startDate,startTime:e.startTime,endTime:e.endTime,availableTimes:l},(null===(b=J.values)||void 0===b?void 0:b.id)&&(s.id=null===(E=J.values)||void 0===E?void 0:E.id),null!==J.index?V(J.index,s):P(s),z((function(){return!1})),Q(),[2])}}))}))},onDelete:function(){var e=J.index;z(!1),Q(),setTimeout((function(){var r=A().menuRecurrences;N("menuRecurrences",(void 0===r?[]:r).filter((function(r,t){return t!==e})))}),100)}},C&&n.createElement(g.AvailableTimesControl,{workHours:y,isLoading:I,ref:Y,defaultValues:W,errorMessage:null===(q=null===(D=null===(_=null==w?void 0:w.menuRecurrences)||void 0===_?void 0:_["".concat(null==J?void 0:J.index)])||void 0===D?void 0:D.availableTimes)||void 0===q?void 0:q.message,clearErrorMessage:function(){return S("menuRecurrences.".concat(null==J?void 0:J.index,".availableTimes"))}})))),trigger:"click",placement:"bottom",popperConfig:{modifiers:[R]}},n.createElement("div",{className:"product-set-recurrences"},F.map((function(e,r){var t,i,a;return n.createElement(E.ProductSetRecurrenceOverridesControl,{key:e._id,menuRecurrence:e,onEdit:function(){return function(e,r){Q(),setTimeout((function(){K({index:r,values:e}),B(e.availableTimes||[]),z((function(){return!0}))}),100)}(e,r)},errorMessage:null===(a=null===(i=null===(t=null==w?void 0:w.menuRecurrences)||void 0===t?void 0:t["".concat(r)])||void 0===i?void 0:i.availableTimes)||void 0===a?void 0:a.message})})),F.length<T.MAX_QUANTITY_RECURRENCE_DATE_IN_OVERRIDE&&n.createElement("div",{className:"product-set-recurrence-icon-wrapper",role:"button",tabIndex:0,onClick:ee,onKeyDown:ee},n.createElement(u.default,{type:"plus-circle",height:"1rem",className:"product-set-recurrence-icon-add mr-2"}),$("addDates")),n.createElement(a.Form.Control,r.__assign({type:"hidden"},k("menuRecurrences",{required:{value:!0,message:$("Validation:fieldMinNumber",{attribute:$("dates"),min:1})}}))),n.createElement("div",{className:"manual-form-error"},null===(x=w.menuRecurrences)||void 0===x?void 0:x.message))))},exports.sameWidthPopperModifier=R;
|
package/package.json
CHANGED
|
@@ -13,12 +13,14 @@ export type ActivityCardProps = {
|
|
|
13
13
|
onSelect: () => void;
|
|
14
14
|
isSelected: boolean;
|
|
15
15
|
layout?: Layout;
|
|
16
|
+
availableTimes?: string | null;
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
export const ActivityCard = ({
|
|
19
20
|
title,
|
|
20
21
|
duration,
|
|
21
22
|
price,
|
|
23
|
+
availableTimes,
|
|
22
24
|
// image,
|
|
23
25
|
onSelect,
|
|
24
26
|
isSelected,
|
|
@@ -33,7 +35,6 @@ export const ActivityCard = ({
|
|
|
33
35
|
>
|
|
34
36
|
<div className={clsx("d-flex", "flex-column")}>
|
|
35
37
|
<div className="activity-card-title">{title}</div>
|
|
36
|
-
|
|
37
38
|
{duration && <div>{duration}</div>}
|
|
38
39
|
|
|
39
40
|
{price && <div>{price}</div>}
|
|
@@ -50,7 +51,8 @@ export const ActivityCard = ({
|
|
|
50
51
|
})}
|
|
51
52
|
>
|
|
52
53
|
<div className="description">
|
|
53
|
-
<div className="title">{title}</div>
|
|
54
|
+
<div className="title mb-2">{title}</div>
|
|
55
|
+
{availableTimes && <div>{availableTimes}</div>}
|
|
54
56
|
{duration && (
|
|
55
57
|
<div>
|
|
56
58
|
<p>{duration}</p>
|
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
RYFT_STATUS_PENDING_ACTION,
|
|
13
13
|
AttemptPaymentResponse,
|
|
14
14
|
} from "@licklist/plugins/dist/hooks/Ryft/useRyftPayment";
|
|
15
|
+
import { ProviderPaymentSettings } from "@licklist/core/dist/DataMapper/Setting/ProviderPaymentSettingsDataMapper";
|
|
16
|
+
|
|
15
17
|
import { BlockLoader, ButtonLoader } from "../../static";
|
|
16
18
|
import { injectComponentsInRyftForm } from "./utils/ryft-form";
|
|
17
19
|
|
|
@@ -40,11 +42,13 @@ export interface RyftPaymentFormProps {
|
|
|
40
42
|
) => Promise<void>;
|
|
41
43
|
onSubmit: () => Promise<AttemptPaymentResponse>;
|
|
42
44
|
resetReferrer?: () => void;
|
|
45
|
+
providerPaymentSettings?: ProviderPaymentSettings;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
export const RyftPaymentForm = ({
|
|
46
49
|
accountId,
|
|
47
50
|
isCreateLoading,
|
|
51
|
+
providerPaymentSettings,
|
|
48
52
|
initRyft,
|
|
49
53
|
resetReferrer,
|
|
50
54
|
onSubmit,
|
|
@@ -119,7 +123,12 @@ export const RyftPaymentForm = ({
|
|
|
119
123
|
};
|
|
120
124
|
|
|
121
125
|
useEffect(
|
|
122
|
-
() =>
|
|
126
|
+
() =>
|
|
127
|
+
injectComponentsInRyftForm({
|
|
128
|
+
t,
|
|
129
|
+
additionalPaymentMethodsEnabled:
|
|
130
|
+
providerPaymentSettings?.additionalPaymentMethodsEnabled,
|
|
131
|
+
}),
|
|
123
132
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
124
133
|
[formRef.current?.childNodes?.length]
|
|
125
134
|
);
|
|
@@ -2,8 +2,10 @@ import { TFunction } from "react-i18next";
|
|
|
2
2
|
|
|
3
3
|
export const injectComponentsInRyftForm = ({
|
|
4
4
|
t,
|
|
5
|
+
additionalPaymentMethodsEnabled,
|
|
5
6
|
}: {
|
|
6
7
|
t: TFunction<string[]>;
|
|
8
|
+
additionalPaymentMethodsEnabled?: boolean;
|
|
7
9
|
}) => {
|
|
8
10
|
const cardContainer = document.getElementById("ryft-pay-iframe");
|
|
9
11
|
const oldCardDividerContainer = document.getElementById(
|
|
@@ -26,7 +28,7 @@ export const injectComponentsInRyftForm = ({
|
|
|
26
28
|
|
|
27
29
|
const payGrid = document.getElementById("ryft-pay-grid");
|
|
28
30
|
|
|
29
|
-
if (!payGrid) {
|
|
31
|
+
if (!payGrid || !additionalPaymentMethodsEnabled) {
|
|
30
32
|
return;
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -59,7 +59,7 @@ export const DateInput = ({
|
|
|
59
59
|
control,
|
|
60
60
|
keyName: "_id",
|
|
61
61
|
});
|
|
62
|
-
|
|
62
|
+
const [availableTimes, setAvailableTimes] = useState<string[]>([]);
|
|
63
63
|
const [isDatePopoverVisible, setIsDatePopoverVisible] = useState(false);
|
|
64
64
|
const availableTimesFormRef = useRef<AvailableTimesControlRef>();
|
|
65
65
|
const [editState, setEditState] = useState<{
|
|
@@ -94,6 +94,7 @@ export const DateInput = ({
|
|
|
94
94
|
// Hotfix for an issue with Popover close & open actions
|
|
95
95
|
setTimeout(() => {
|
|
96
96
|
setEditState({ index, values: next });
|
|
97
|
+
setAvailableTimes(next.availableTimes || []);
|
|
97
98
|
setIsDatePopoverVisible(() => true);
|
|
98
99
|
}, 100);
|
|
99
100
|
};
|
|
@@ -221,7 +222,7 @@ export const DateInput = ({
|
|
|
221
222
|
workHours={workHours}
|
|
222
223
|
isLoading={isLoading}
|
|
223
224
|
ref={availableTimesFormRef}
|
|
224
|
-
defaultValues={
|
|
225
|
+
defaultValues={availableTimes}
|
|
225
226
|
errorMessage={
|
|
226
227
|
errors?.menuRecurrences?.[`${editState?.index}`]
|
|
227
228
|
?.availableTimes?.message
|