@licklist/design 0.58.11 → 0.59.0-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.
- package/bitbucket-pipelines.yml +0 -8
- package/dist/assets/iframe/calendar.svg +2 -2
- package/dist/assets/iframe/calendar.svg.js +1 -1
- package/dist/assets/iframe/ticket.svg +2 -2
- package/dist/assets/iframe/ticket.svg.js +1 -1
- package/dist/calendar/Calendar.d.ts +1 -1
- package/dist/calendar/Calendar.d.ts.map +1 -1
- package/dist/calendar/Calendar.js +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts +2 -2
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.js +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +3 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts +3 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts +3 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts +2 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts +2 -2
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.d.ts +4 -2
- package/dist/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.d.ts +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.d.ts +4 -2
- package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +4 -0
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
- package/dist/iframe/page/components/PageBody/constants.d.ts +1 -0
- package/dist/iframe/page/components/PageBody/constants.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/constants.js +1 -1
- package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.js +1 -1
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.js +1 -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 +5 -0
- package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -0
- package/dist/iframe/ryft/utils/ryft-form.js +1 -0
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.js +1 -1
- package/dist/product-set/control/DateInput.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts +4 -1
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.d.ts +1 -0
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
- package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +3 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
- package/dist/recurring-date-picker-input/utils.d.ts +12 -0
- package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/utils.js +1 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +1 -1
- package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
- package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
- package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
- package/dist/static/manual-date-picker/constants/index.d.ts +4 -1
- package/dist/static/manual-date-picker/constants/index.d.ts.map +1 -1
- package/dist/static/manual-date-picker/constants/index.js +1 -1
- package/dist/static/manual-date-picker/utils/index.d.ts +4 -0
- package/dist/static/manual-date-picker/utils/index.d.ts.map +1 -1
- package/dist/static/manual-date-picker/utils/index.js +1 -1
- package/dist/styles/iframe-events/Card.scss +24 -8
- package/dist/styles/iframe-events/PoweredBy.scss +2 -2
- package/dist/styles/iframe-order-process/IframeOrderProcess.scss +57 -20
- package/dist/styles/iframe-page/Page.scss +1 -0
- package/dist/styles/iframe-page/PageBody.scss +34 -12
- package/dist/styles/iframe-page/PageHeader.scss +41 -39
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +125 -2
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/zone/form/ZoneForm.d.ts +2 -2
- package/dist/zone/form/ZoneForm.d.ts.map +1 -1
- package/dist/zone/form/ZoneForm.js +1 -1
- package/dist/zone/form/components/ZoneControl.d.ts +2 -2
- package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneControl.js +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -4
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
- package/dist/zone/form/utils/dates.d.ts.map +1 -1
- package/package.json +10 -35
- package/src/assets/iframe/calendar.svg +2 -2
- package/src/assets/iframe/ticket.svg +2 -2
- package/src/calendar/Calendar.stories.tsx +23 -0
- package/src/calendar/Calendar.tsx +5 -5
- package/src/calendar/components/CalendarDates/CalendarDates.tsx +0 -5
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +4 -0
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +10 -8
- package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +4 -0
- package/src/iframe/event/event-card/IframeEventCard.stories.tsx +1 -0
- package/src/iframe/event/event-card/IframeEventCard.tsx +7 -8
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.stories.tsx +9 -0
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +58 -7
- package/src/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.tsx +8 -0
- package/src/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.tsx +4 -4
- package/src/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.tsx +63 -10
- package/src/iframe/order-process/components/BookingSummary/types/index.ts +4 -0
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +1 -1
- package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +3 -1
- package/src/iframe/page/components/PageBody/constants.ts +2 -0
- package/src/iframe/page/components/PageBody/hooks/useResizePageBody.ts +10 -0
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +6 -6
- package/src/iframe/payment/payment-page/PaymentPage.stories.tsx +546 -6
- package/src/iframe/payment/payment-page/PaymentPage.tsx +38 -29
- package/src/iframe/ryft/RyftPaymentForm.tsx +11 -5
- package/src/iframe/ryft/utils/ryft-form.ts +47 -0
- package/src/product-set/control/DateAndRecurrenceInput.tsx +3 -2
- package/src/product-set/control/DateInput.tsx +1 -3
- package/src/product-set/control/ProductSetControl.tsx +1 -1
- package/src/product-set/form/ProductCategoriesControl.tsx +1 -1
- package/src/product-set/form/ProductSetForm.tsx +5 -1
- package/src/product-set/hooks/useSortableTreeFunctions.ts +2 -0
- package/src/product-set/product/ProductControl.tsx +6 -3
- package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +0 -2
- package/src/product-set/product-category/ProductCategoryControl.tsx +89 -27
- package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +4 -18
- package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +0 -1
- package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +11 -1
- package/src/recurring-date-picker-input/utils.ts +77 -0
- package/src/sales/booking/results/BookingResults.stories.tsx +3 -2
- package/src/sales/booking/results/components/ResultCard.tsx +2 -5
- package/src/setting/admin/AdminSettingForm.tsx +2 -2
- package/src/sortable-tree/SortableTreeItem.tsx +1 -1
- package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
- package/src/static/manual-date-picker/constants/index.ts +6 -2
- package/src/static/manual-date-picker/utils/index.ts +11 -0
- package/src/static/switch/BooleanSwitch.tsx +1 -1
- package/src/styles/iframe-events/Card.scss +24 -8
- package/src/styles/iframe-events/PoweredBy.scss +2 -2
- package/src/styles/iframe-order-process/IframeOrderProcess.scss +57 -20
- package/src/styles/iframe-page/Page.scss +1 -0
- package/src/styles/iframe-page/PageBody.scss +34 -12
- package/src/styles/iframe-page/PageHeader.scss +41 -39
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +125 -2
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/zone/form/ZoneForm.tsx +3 -2
- package/src/zone/form/components/ZoneControl.tsx +3 -3
- package/src/zone/form/components/ZoneRecurrencesControl.tsx +7 -5
- package/src/zone/form/utils/dates.ts +9 -10
- package/jest.config.js +0 -29
- package/tests/Auth/Authorizer.test.tsx +0 -194
- package/tests/Auth/Layout/UserNavDropDown.test.tsx +0 -43
- package/tests/Auth/Layout/UserNavDropDownToggle.test.tsx +0 -33
- package/tests/Auth/Login/LoginComponent.test.tsx +0 -246
- package/tests/Auth/Login/LoginFormComponent.test.tsx +0 -182
- package/tests/Auth/Register/RegisterComponent.test.tsx +0 -285
- package/tests/Auth/Register/RegisterFormComponent.test.tsx +0 -170
- package/tests/Auth/Settings/Dashboard/IpInput.test.tsx +0 -130
- package/tests/Auth/Social/SocialCallbackComponent.test.tsx +0 -133
- package/tests/Auth/Social/SocialFormComponent.test.tsx +0 -118
- package/tests/FileUpload/FileUpload.test.tsx +0 -42
- package/tests/Notification/EmailTemplate.test.tsx +0 -82
- package/tests/ProductSet/ProductSetPopover.test.tsx +0 -40
- package/tests/Report/Report.test.tsx +0 -48
- package/tests/Sales/Coupon.test.tsx +0 -51
- package/tests/Sales/SalesAndVIews.test.tsx +0 -63
- package/tests/SnippetTemplates/SnippetTemplates.test.tsx +0 -56
- package/tests/Table/FilterHelperComponent.test.tsx +0 -88
- package/tests/Table/PaginationHelperComponent.test.tsx +0 -109
- package/tests/Table/PerPageHelperComponent.test.tsx +0 -34
- package/tests/Table/TableHelperComponent.test.tsx +0 -295
- package/tests/TipTapEditor/TipTapEditor.test.tsx +0 -28
- package/tests/__mock__/hooks/useAuthApi.ts +0 -13
- package/tests/__mock__/hooks/useAuthMock.ts +0 -13
- package/tests/__mock__/hooks/useFormMock.ts +0 -27
- package/tests/__mock__/hooks/useNotificationMock.ts +0 -13
- package/tests/__mock__/hooks/useQueryMock.ts +0 -16
- package/tests/__mock__/hooks/useSocialApiMock.ts +0 -20
- package/tests/__mock__/hooks/useTranslationMock.ts +0 -17
- package/tests/__mock__/hooks/useUserApiMock.ts +0 -18
- package/tests/__mock__/hooks/useUserMock.ts +0 -13
- package/tests/__mock__/styleMock.js +0 -1
- package/tests/__mock__/windowMock.ts +0 -5
- package/tests/packages/react-query.tsx +0 -28
- package/tests/setupTests.ts +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),o=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,t=require("react-bootstrap"),n=require("./NameControl.js"),l=require("./ZoneTypeControl.js"),a=require("./SortControl.js"),i=require("./ZoneRecurrencesControl.js"),s=require("./DescriptionControl.js"),m=require("./ZoneImageControl.js"),c=require("./GameDurationControl.js");exports.ZoneControl=function(e){var r=e.isLoading,u=e.workHours;return o.createElement(t.Row,null,o.createElement(t.Col,{md:6,sm:12,className:"pr-5"},o.createElement(n.NameControl,{isLoading:r}),o.createElement(i.ZoneRecurrencesControl,{workHours:u}),o.createElement("hr",null),o.createElement(t.Row,null,o.createElement(t.Col,{md:6,sm:6},o.createElement(l.ZoneTypeControl,{isLoading:r}),o.createElement(a.SortControl,{isLoading:r}),o.createElement(c.GameDurationControl,{isLoading:r})),o.createElement(t.Col,{md:6,sm:6},o.createElement(m.ZoneImageControl,{isLoading:r}))),o.createElement("hr",null),o.createElement(t.Row,null,o.createElement(t.Col,{md:12,sm:12},o.createElement(s.DescriptionControl,{isLoading:r})))))};
|
|
@@ -4,9 +4,9 @@ import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMa
|
|
|
4
4
|
export interface DateAndRecurrenceInputValues {
|
|
5
5
|
zoneRecurrences?: Partial<ZoneRecurrence>[];
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
workHours
|
|
9
|
-
isLoading?: boolean;
|
|
7
|
+
type ZoneRecurrenceControlProps = {
|
|
8
|
+
workHours: WorkHour[] | undefined;
|
|
10
9
|
};
|
|
11
|
-
export declare const ZoneRecurrencesControl: () => JSX.Element;
|
|
10
|
+
export declare const ZoneRecurrencesControl: ({ workHours, }: ZoneRecurrenceControlProps) => JSX.Element;
|
|
11
|
+
export {};
|
|
12
12
|
//# sourceMappingURL=ZoneRecurrencesControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoneRecurrencesControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneRecurrencesControl.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAMlG,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAWtF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;CAC7C;AAED,
|
|
1
|
+
{"version":3,"file":"ZoneRecurrencesControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneRecurrencesControl.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAMlG,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAWtF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;CAC7C;AAED,KAAK,0BAA0B,GAAG;IAChC,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,mBAEhC,0BAA0B,gBAuM5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("tslib"),t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-bootstrap"),a=require("../../../static/Icon.js"),u=require("react-hook-form"),l=require("@react-aria/utils"),c=require("react-use");require("../../../static/index.js");var d=require("@dnd-kit/core"),s=require("@dnd-kit/sortable"),m=require("../../../modals/confirmation/ConfirmModal.js"),v=require("../../../recurring-date-picker-input/RecurringDatePickerInput.js"),f=require("../../../product-set/control/DateAndRecurrenceInput.js"),p=require("./ZoneRecurrenceControl.js");exports.ZoneRecurrencesControl=function(){var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("tslib"),t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-bootstrap"),a=require("../../../static/Icon.js"),u=require("react-hook-form"),l=require("@react-aria/utils"),c=require("react-use");require("../../../static/index.js");var d=require("@dnd-kit/core"),s=require("@dnd-kit/sortable"),m=require("../../../modals/confirmation/ConfirmModal.js"),v=require("../../../recurring-date-picker-input/RecurringDatePickerInput.js"),f=require("../../../product-set/control/DateAndRecurrenceInput.js"),p=require("./ZoneRecurrenceControl.js");exports.ZoneRecurrencesControl=function(e){var g,_,E=e.workHours,q=u.useFormContext(),x=q.control,C=q.register,D=q.formState.errors,R=q.getValues,b=q.setValue,k=q.clearErrors,y=u.useFieldArray({name:"zoneRecurrences",control:x,keyName:"_id"}),I=y.fields,S=y.append,z=y.update,N=y.move,h=r.__read(t.useState(!1),2),j=h[0],w=h[1],T=r.__read(t.useState({index:null,values:null}),2),A=T[0],F=T[1],M=function(){return F({index:null,values:null})},P=t.useRef();c.useClickAway(P,(function(e){var r,t,n;m.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)||(w(!1),M())}));var O=l.useId(),V=i.useTranslation(["Design","Validation"]).t,L=function(){M(),w((function(e){return!e}))};return t.useEffect((function(){I.length&&k("zoneRecurrences")}),[I,k]),n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,V("zoneAvailable")),n.createElement(o.OverlayTrigger,{show:j,overlay:n.createElement(o.Popover,{id:O,className:"rounded"},n.createElement(o.Popover.Content,{className:"shadow-lg rounded",ref:P},n.createElement(v.RecurringDatePickerInput,{defaultValues:A.values,onChange:function(e){return r.__awaiter(void 0,void 0,void 0,(function(){var t,n,i;return r.__generator(this,(function(r){return t={rrule:e.rrule,startDate:e.startDate,endDate:e.endDate,startTime:e.startTime,endTime:e.endTime},(null===(n=A.values)||void 0===n?void 0:n.id)&&(t.id=null===(i=A.values)||void 0===i?void 0:i.id),null!==A.index?z(A.index,t):S(t),w((function(){return!1})),M(),[2]}))}))},onDelete:function(){var e=A.index;w(!1),M(),setTimeout((function(){var r=R().zoneRecurrences;b("zoneRecurrences",(void 0===r?[]:r).filter((function(r,t){return t!==e})))}),100)},setInitialStartDateAfterSelect:!0,workHours:E}))),trigger:"click",placement:"bottom",popperConfig:{modifiers:[f.sameWidthPopperModifier]}},n.createElement("div",{className:"zone-recurrences"},n.createElement(d.DndContext,{onDragEnd:function(e){var r=e.over,t=e.active;if(r.id!==t.id){var n=I.findIndex((function(e){return String(e._id)===t.id})),i=I.findIndex((function(e){return String(e._id)===r.id}));N(n,i)}}},n.createElement(s.SortableContext,{items:null!==(g=null==I?void 0:I.map((function(e){return String(e._id)})))&&void 0!==g?g:[],strategy:s.verticalListSortingStrategy},null==I?void 0:I.map((function(e,r){return n.createElement(p.ZoneRecurrenceControl,{key:e._id,zoneRecurrence:e,onEdit:function(){return function(e,r){M(),F({index:r,values:e}),w((function(){return!0}))}(e,r)}})})))),n.createElement("div",{className:"zone-recurrence-icon-wrapper",role:"button",tabIndex:0,onClick:L,onKeyDown:L},n.createElement(a.default,{type:"plus-circle",height:"1rem",className:"zone-recurrence-icon-add mr-2"}),V("addDates")),n.createElement(o.Form.Control,r.__assign({type:"hidden"},C("zoneRecurrences",{required:{value:!0,message:V("Validation:fieldMinNumber",{attribute:V("dates"),min:1})}}))),n.createElement("div",{className:"manual-form-error"},null===(_=D.zoneRecurrences)||void 0===_?void 0:_.message))))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/utils/dates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAOtF,eAAO,MAAM,qBAAqB,cACrB,MAAM,WACR,MAAM,6BAuChB,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/utils/dates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAOtF,eAAO,MAAM,qBAAqB,cACrB,MAAM,WACR,MAAM,6BAuChB,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,QAAQ,EAAE,aAyC9D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.0-dev.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -16,14 +16,11 @@
|
|
|
16
16
|
"type-check:watch": "yarn type-check -- --watch",
|
|
17
17
|
"build": "rollup -c",
|
|
18
18
|
"watch": "yarn build -- -w",
|
|
19
|
-
"test": "jest --verbose --coverage --watchAll=false",
|
|
20
|
-
"run-test": "jest --verbose --watchAll=false",
|
|
21
19
|
"lint": "eslint --ext .ts,.tsx .",
|
|
22
20
|
"lint:fix": "yarn run lint -- --fix",
|
|
23
21
|
"lint:format": "prettier \"**/*.{md,json,yml,scss}\" --check",
|
|
24
22
|
"lint:format:fix": "prettier \"**/*.{md,json,yml,scss}\" --write",
|
|
25
23
|
"prepare": "husky install",
|
|
26
|
-
"test-staged": "CI=true jest --passWithNoTests --findRelatedTests",
|
|
27
24
|
"tests": "yarn tests-staged",
|
|
28
25
|
"prettier-write": "prettier --write",
|
|
29
26
|
"tsc": "bash -c tsc -p tsconfig.json -b"
|
|
@@ -53,9 +50,9 @@
|
|
|
53
50
|
"@fortawesome/free-brands-svg-icons": "5.15.2",
|
|
54
51
|
"@fortawesome/free-solid-svg-icons": "5.15.2",
|
|
55
52
|
"@fortawesome/react-fontawesome": "0.1.9",
|
|
56
|
-
"@licklist/core": "
|
|
57
|
-
"@licklist/eslint-config": "0.
|
|
58
|
-
"@licklist/plugins": "
|
|
53
|
+
"@licklist/core": ">=0.23.3-dev.0 < 0.23.3",
|
|
54
|
+
"@licklist/eslint-config": "0.4.5",
|
|
55
|
+
"@licklist/plugins": ">=0.27.2-dev.2 < 0.27.2",
|
|
59
56
|
"@mdx-js/react": "1.6.22",
|
|
60
57
|
"@popperjs/core": "2.11.8",
|
|
61
58
|
"@react-aria/utils": "3.9.0",
|
|
@@ -73,10 +70,6 @@
|
|
|
73
70
|
"@svgr/rollup": "5.5.0",
|
|
74
71
|
"@svgr/webpack": "5.5.0",
|
|
75
72
|
"@tanstack/react-table": "8.10.6",
|
|
76
|
-
"@testing-library/jest-dom": "5.16.1",
|
|
77
|
-
"@testing-library/react": "11.2.5",
|
|
78
|
-
"@testing-library/react-hooks": "5.1.0",
|
|
79
|
-
"@testing-library/user-event": "13.5.0",
|
|
80
73
|
"@tiptap/core": "2.0.0-beta.176",
|
|
81
74
|
"@tiptap/extension-blockquote": "2.0.0-beta.29",
|
|
82
75
|
"@tiptap/extension-bold": "2.0.0-beta.28",
|
|
@@ -99,14 +92,10 @@
|
|
|
99
92
|
"@tiptap/react": "2.0.0-beta.109",
|
|
100
93
|
"@tiptap/suggestion": "2.0.0-beta.92",
|
|
101
94
|
"@types/babel__core": "7.1.12",
|
|
102
|
-
"@types/enzyme-adapter-react-16": "1.0.6",
|
|
103
|
-
"@types/jest": "26.0.20",
|
|
104
95
|
"@types/luxon": "1.26.2",
|
|
105
96
|
"@types/mdx-js__react": "1.5.3",
|
|
106
|
-
"@types/react": "17.0.2",
|
|
107
97
|
"@types/react-bootstrap": "1.0.1",
|
|
108
98
|
"@types/react-date-range": "^1.4.4",
|
|
109
|
-
"@types/react-dom": "17.0.1",
|
|
110
99
|
"@types/react-email-editor": "1.1.7",
|
|
111
100
|
"@types/react-loader": "2.4.4",
|
|
112
101
|
"@types/react-phone-number-input": "3.0.6",
|
|
@@ -116,7 +105,6 @@
|
|
|
116
105
|
"@typescript-eslint/eslint-plugin": "5.8.1",
|
|
117
106
|
"@typescript-eslint/parser": "5.8.1",
|
|
118
107
|
"@wojtekmaj/react-daterange-picker": "^4.1.0",
|
|
119
|
-
"babel-jest": "26.6.3",
|
|
120
108
|
"babel-loader": "8.2.2",
|
|
121
109
|
"babel-plugin-inline-react-svg": "2.0.1",
|
|
122
110
|
"bootstrap": "4.6.0",
|
|
@@ -128,21 +116,16 @@
|
|
|
128
116
|
"emojibase": "6.1.0",
|
|
129
117
|
"emojibase-data": "7.0.1",
|
|
130
118
|
"emojibase-regex": "6.0.1",
|
|
131
|
-
"enzyme": "3.11.0",
|
|
132
|
-
"enzyme-adapter-react-16": "1.15.6",
|
|
133
119
|
"eslint": "7.32.0",
|
|
134
120
|
"eslint-config-airbnb": "18.2.1",
|
|
135
121
|
"eslint-config-prettier": "8.3.0",
|
|
136
|
-
"eslint-plugin-jest": "25.3.2",
|
|
137
122
|
"eslint-plugin-jsx-a11y": "6.5.1",
|
|
138
123
|
"eslint-plugin-prettier": "4.0.0",
|
|
139
124
|
"eslint-plugin-react-hooks": "4.2.0",
|
|
140
|
-
"eslint-plugin-testing-library": "5.0.1",
|
|
141
125
|
"framer-motion": "4.1.17",
|
|
142
126
|
"history": "5.3.0",
|
|
143
127
|
"husky": "7.0.4",
|
|
144
128
|
"i18next": "19.4.5",
|
|
145
|
-
"jest": "26.6.0",
|
|
146
129
|
"klona": "2.0.4",
|
|
147
130
|
"konva": "6.0.0",
|
|
148
131
|
"lint-staged": "11.1.2",
|
|
@@ -150,18 +133,18 @@
|
|
|
150
133
|
"luxon": "1.26.0",
|
|
151
134
|
"moment": "2.29.1",
|
|
152
135
|
"prettier": "2.5.1",
|
|
153
|
-
"react": "
|
|
136
|
+
"react": "17.0.2",
|
|
154
137
|
"react-bootstrap": "1.6.1",
|
|
155
138
|
"react-color": "2.19.3",
|
|
156
139
|
"react-copy-to-clipboard": "5.0.3",
|
|
157
140
|
"react-date-range": "^1.4.0",
|
|
158
|
-
"react-dom": "
|
|
141
|
+
"react-dom": "17.0.2",
|
|
159
142
|
"react-email-editor": "1.6.1",
|
|
160
143
|
"react-highlighter": "0.4.3",
|
|
161
144
|
"react-hook-form": "7.13.0",
|
|
162
145
|
"react-i18next": "11.8.8",
|
|
163
146
|
"react-intl": "5.15.8",
|
|
164
|
-
"react-konva": "
|
|
147
|
+
"react-konva": "^17.0.2-6",
|
|
165
148
|
"react-loader": "2.4.7",
|
|
166
149
|
"react-loading-skeleton": "^3.3.1",
|
|
167
150
|
"react-overlays": "4.1.1",
|
|
@@ -186,7 +169,6 @@
|
|
|
186
169
|
"sass": "1.32.8",
|
|
187
170
|
"sass-loader": "10.1.1",
|
|
188
171
|
"style-loader": "2.0.0",
|
|
189
|
-
"ts-jest": "26.5.2",
|
|
190
172
|
"twemoji-parser": "14.0.0",
|
|
191
173
|
"typescript": "4.9.5",
|
|
192
174
|
"url-loader": "4.1.1",
|
|
@@ -194,24 +176,17 @@
|
|
|
194
176
|
},
|
|
195
177
|
"resolutions": {
|
|
196
178
|
"@types/react": "17.0.2",
|
|
197
|
-
"@types/react-dom": "17.0.
|
|
198
|
-
},
|
|
199
|
-
"jest": {
|
|
200
|
-
"setupFilesAfterEnv": [
|
|
201
|
-
"./jest.config.js"
|
|
202
|
-
],
|
|
203
|
-
"snapshotSerializers": [
|
|
204
|
-
"enzyme-to-json/serializer"
|
|
205
|
-
]
|
|
179
|
+
"@types/react-dom": "17.0.2"
|
|
206
180
|
},
|
|
207
181
|
"lint-staged": {
|
|
208
182
|
"*.{ts,tsx}": [
|
|
209
|
-
"yarn test-staged",
|
|
210
183
|
"yarn prettier-write",
|
|
211
184
|
"yarn lint:fix"
|
|
212
185
|
]
|
|
213
186
|
},
|
|
214
187
|
"devDependencies": {
|
|
188
|
+
"@types/react": "17.0.2",
|
|
189
|
+
"@types/react-dom": "17.0.2",
|
|
215
190
|
"identity-obj-proxy": "^3.0.0"
|
|
216
191
|
},
|
|
217
192
|
"volta": {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="16" height="15" viewBox="0 0 16 15" fill="
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 0C3.44772 0 3 0.447715 3 1H1C0.447715 1 0 1.44772 0 2V4H16V2C16 1.44772 15.5523 1 15 1H13C13 0.447715 12.5523 0 12 0C11.4477 0 11 0.447715 11 1H5C5 0.447715 4.55228 0 4 0ZM16 6C16 5.44772 15.5523 5 15 5H1C0.447715 5 0 5.44772 0 6V12C0 13.6569 1.34315 15 3 15H13C14.6569 15 16 13.6569 16 12V6ZM2 7H14V12C14 12.5523 13.5523 13 13 13H3L2.88338 12.9933C2.38604 12.9355 2 12.5128 2 12V7ZM10.5 9C10.2239 9 10 9.22386 10 9.5V11.5C10 11.7761 10.2239 12 10.5 12H12.5C12.7761 12 13 11.7761 13 11.5V9.5C13 9.22386 12.7761 9 12.5 9H10.5Z"
|
|
1
|
+
<svg width="16" height="15" viewBox="0 0 16 15" fill="#979797" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 0C3.44772 0 3 0.447715 3 1H1C0.447715 1 0 1.44772 0 2V4H16V2C16 1.44772 15.5523 1 15 1H13C13 0.447715 12.5523 0 12 0C11.4477 0 11 0.447715 11 1H5C5 0.447715 4.55228 0 4 0ZM16 6C16 5.44772 15.5523 5 15 5H1C0.447715 5 0 5.44772 0 6V12C0 13.6569 1.34315 15 3 15H13C14.6569 15 16 13.6569 16 12V6ZM2 7H14V12C14 12.5523 13.5523 13 13 13H3L2.88338 12.9933C2.38604 12.9355 2 12.5128 2 12V7ZM10.5 9C10.2239 9 10 9.22386 10 9.5V11.5C10 11.7761 10.2239 12 10.5 12H12.5C12.7761 12 13 11.7761 13 11.5V9.5C13 9.22386 12.7761 9 12.5 9H10.5Z" />
|
|
3
3
|
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="14" viewBox="0 0 18 14" fill="
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 2.00002C18 0.89543 17.1046 0 16 0H2C0.89543 0 0 0.89543 0 2L0.000956201 4.35567C0.00105503 4.59911 0.0899525 4.83415 0.250979 5.01672C0.731269 5.56128 1 6.25846 1 7C1 7.74154 0.731269 8.43872 0.250979 8.98328C0.0899525 9.16585 0.00105503 9.4009 0.000956201 9.64433L0 11.9996C0 13.1046 0.89543 14 2 14H16C17.1046 14 18 13.1046 18 12L17.9999 9.64574C17.9999 9.40205 17.9109 9.16675 17.7497 8.98404C17.269 8.43938 17 7.7419 17 7C17 6.2581 17.269 5.56062 17.7497 5.01596C17.9109 4.83325 17.9999 4.59795 17.9999 4.35426L18 2.00002ZM2.07187 4.09764L2 4.002L1.999 2H5C5 2.55228 5.44772 3 6 3C6.55228 3 7 2.55228 7 2H16L15.999 4.002L15.929 4.09646C15.3306 4.93393 15 5.94228 15 7L15.0069 7.26333C15.057 8.22459 15.3805 9.13586 15.929 9.90354L15.999 9.997L16 12H7C7 11.4477 6.55228 11 6 11C5.44772 11 5 11.4477 5 12H2V9.996L2.07187 9.90236C2.66972 9.06511 3 8.05722 3 7C3 5.94278 2.66972 4.93489 2.07187 4.09764ZM6 6C6.55228 6 7 5.55228 7 5C7 4.44772 6.55228 4 6 4C5.44772 4 5 4.44772 5 5C5 5.55228 5.44772 6 6 6ZM7 9C7 9.55229 6.55228 10 6 10C5.44772 10 5 9.55229 5 9C5 8.44771 5.44772 8 6 8C6.55228 8 7 8.44771 7 9Z"
|
|
1
|
+
<svg width="18" height="14" viewBox="0 0 18 14" fill="#979797" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 2.00002C18 0.89543 17.1046 0 16 0H2C0.89543 0 0 0.89543 0 2L0.000956201 4.35567C0.00105503 4.59911 0.0899525 4.83415 0.250979 5.01672C0.731269 5.56128 1 6.25846 1 7C1 7.74154 0.731269 8.43872 0.250979 8.98328C0.0899525 9.16585 0.00105503 9.4009 0.000956201 9.64433L0 11.9996C0 13.1046 0.89543 14 2 14H16C17.1046 14 18 13.1046 18 12L17.9999 9.64574C17.9999 9.40205 17.9109 9.16675 17.7497 8.98404C17.269 8.43938 17 7.7419 17 7C17 6.2581 17.269 5.56062 17.7497 5.01596C17.9109 4.83325 17.9999 4.59795 17.9999 4.35426L18 2.00002ZM2.07187 4.09764L2 4.002L1.999 2H5C5 2.55228 5.44772 3 6 3C6.55228 3 7 2.55228 7 2H16L15.999 4.002L15.929 4.09646C15.3306 4.93393 15 5.94228 15 7L15.0069 7.26333C15.057 8.22459 15.3805 9.13586 15.929 9.90354L15.999 9.997L16 12H7C7 11.4477 6.55228 11 6 11C5.44772 11 5 11.4477 5 12H2V9.996L2.07187 9.90236C2.66972 9.06511 3 8.05722 3 7C3 5.94278 2.66972 4.93489 2.07187 4.09764ZM6 6C6.55228 6 7 5.55228 7 5C7 4.44772 6.55228 4 6 4C5.44772 4 5 4.44772 5 5C5 5.55228 5.44772 6 6 6ZM7 9C7 9.55229 6.55228 10 6 10C5.44772 10 5 9.55229 5 9C5 8.44771 5.44772 8 6 8C6.55228 8 7 8.44771 7 9Z" />
|
|
3
3
|
</svg>
|
|
@@ -38,3 +38,26 @@ Default.args = {
|
|
|
38
38
|
isDisabled: false,
|
|
39
39
|
}),
|
|
40
40
|
};
|
|
41
|
+
|
|
42
|
+
export const Loading: Story<CalendarProps> = (args) => {
|
|
43
|
+
return (
|
|
44
|
+
<div style={{ backgroundColor: "white" }}>
|
|
45
|
+
<Calendar {...args} />
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
Loading.args = {
|
|
51
|
+
isLoading: true,
|
|
52
|
+
fromPrice: "from £10",
|
|
53
|
+
selectedDate: null,
|
|
54
|
+
setSelectedDate: () => null,
|
|
55
|
+
calendarDates: getMonthCalendarDates(now),
|
|
56
|
+
currentDate: now,
|
|
57
|
+
getDateTimeButtonProps: () => ({
|
|
58
|
+
resources: [],
|
|
59
|
+
showResources: false,
|
|
60
|
+
shouldCalculateResources: false,
|
|
61
|
+
isDisabled: false,
|
|
62
|
+
}),
|
|
63
|
+
};
|
|
@@ -3,6 +3,7 @@ import { DateTime } from "luxon";
|
|
|
3
3
|
import { DateTimeButtonProps } from "src/date-time-button";
|
|
4
4
|
import { CalendarButtons } from "./components/CalendarButtons";
|
|
5
5
|
import { CalendarDates } from "./components/CalendarDates";
|
|
6
|
+
import { LoaderIndicator } from "../static";
|
|
6
7
|
|
|
7
8
|
export const defaultStartDay = DateTime.now().set({
|
|
8
9
|
millisecond: 0,
|
|
@@ -28,15 +29,14 @@ export type CalendarProps = {
|
|
|
28
29
|
>;
|
|
29
30
|
};
|
|
30
31
|
|
|
31
|
-
export const Calendar = ({
|
|
32
|
-
initialDate = defaultStartDay,
|
|
33
|
-
...props
|
|
34
|
-
}: CalendarProps) => {
|
|
32
|
+
export const Calendar = (props: CalendarProps) => {
|
|
33
|
+
const { initialDate = defaultStartDay, isLoading } = props;
|
|
35
34
|
return (
|
|
36
35
|
<div className="calendar-wrapper">
|
|
37
36
|
<div className="calendar">
|
|
38
37
|
<CalendarButtons initialDate={initialDate} {...props} />
|
|
39
|
-
|
|
38
|
+
|
|
39
|
+
{isLoading ? <LoaderIndicator /> : <CalendarDates {...props} />}
|
|
40
40
|
</div>
|
|
41
41
|
</div>
|
|
42
42
|
);
|
|
@@ -6,7 +6,6 @@ import { CalendarProps } from "../../Calendar";
|
|
|
6
6
|
|
|
7
7
|
export type CalendarDatesProps = Pick<
|
|
8
8
|
CalendarProps,
|
|
9
|
-
| "isLoading"
|
|
10
9
|
| "calendarDates"
|
|
11
10
|
| "selectedDate"
|
|
12
11
|
| "setSelectedDate"
|
|
@@ -15,7 +14,6 @@ export type CalendarDatesProps = Pick<
|
|
|
15
14
|
>;
|
|
16
15
|
|
|
17
16
|
export const CalendarDates = ({
|
|
18
|
-
isLoading = false,
|
|
19
17
|
calendarDates,
|
|
20
18
|
selectedDate,
|
|
21
19
|
setSelectedDate,
|
|
@@ -48,12 +46,9 @@ export const CalendarDates = ({
|
|
|
48
46
|
|
|
49
47
|
const props = getDateTimeButtonProps(date);
|
|
50
48
|
|
|
51
|
-
const isDisabled = isLoading || props.isDisabled;
|
|
52
|
-
|
|
53
49
|
return (
|
|
54
50
|
<DateTimeButton
|
|
55
51
|
key={+date}
|
|
56
|
-
isDisabled={isDisabled}
|
|
57
52
|
isSelected={
|
|
58
53
|
selectedDate ? date.hasSame(selectedDate, "day") : undefined
|
|
59
54
|
}
|
|
@@ -19,6 +19,7 @@ import { scrollToError } from "@licklist/plugins/dist/utils/ScrollUtils";
|
|
|
19
19
|
import { getFirstErrorKey } from "@licklist/plugins/dist/utils/FormValues";
|
|
20
20
|
|
|
21
21
|
import { ProductSet } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
|
|
22
|
+
import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
|
|
22
23
|
import { CategoryGroup } from "../../../../types/categories";
|
|
23
24
|
import { SaleDeadline } from "../SaleDeadline/SaleDeadline";
|
|
24
25
|
import {
|
|
@@ -64,6 +65,7 @@ export interface EditEventFormProps extends HasPermissionProp {
|
|
|
64
65
|
createProductSet: (props: EditEventFormValues) => void;
|
|
65
66
|
setEditProductSetId: (value: string) => void;
|
|
66
67
|
isExternalPaymentLinkEnabled?: boolean;
|
|
68
|
+
workHours: WorkHour[] | undefined;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
const eventImageTypes = {
|
|
@@ -83,6 +85,7 @@ export const EditEventForm = ({
|
|
|
83
85
|
createProductSet,
|
|
84
86
|
setEditProductSetId,
|
|
85
87
|
isExternalPaymentLinkEnabled,
|
|
88
|
+
workHours,
|
|
86
89
|
}: EditEventFormProps) => {
|
|
87
90
|
const { t } = useTranslation(["Design", "Validation"]);
|
|
88
91
|
|
|
@@ -403,6 +406,7 @@ export const EditEventForm = ({
|
|
|
403
406
|
setEditProductSetId={setEditProductSetId}
|
|
404
407
|
setShowEditProductSet={setShowEditProductSet}
|
|
405
408
|
showEditProductSet={showEditProductSet}
|
|
409
|
+
workHours={workHours}
|
|
406
410
|
/>
|
|
407
411
|
|
|
408
412
|
{hasPermission && !showEditProductSet && (
|
package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import { useId } from "@react-aria/utils";
|
|
|
5
5
|
import { Controller, useFormContext } from "react-hook-form";
|
|
6
6
|
import { HasPermissionProp } from "@licklist/plugins/dist/types/permission/Permission";
|
|
7
7
|
import { ProductSet } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
|
|
8
|
+
import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
|
|
8
9
|
import { ConfirmModal } from "../../../../modals/confirmation/ConfirmModal";
|
|
9
10
|
import { EditEventFormValues } from "../EditEventForm/EditEventForm";
|
|
10
11
|
import { EditEventProductSet } from "./component/EditEventProductSet";
|
|
@@ -15,6 +16,7 @@ interface SelectEventProductSetProps extends HasPermissionProp {
|
|
|
15
16
|
setShowEditProductSet: (value: boolean) => void;
|
|
16
17
|
createProductSet: (props: EditEventFormValues) => void;
|
|
17
18
|
setEditProductSetId: (value: string) => void;
|
|
19
|
+
workHours: WorkHour[] | undefined;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
export const SelectEventProductSet = ({
|
|
@@ -23,6 +25,7 @@ export const SelectEventProductSet = ({
|
|
|
23
25
|
setEditProductSetId,
|
|
24
26
|
showEditProductSet,
|
|
25
27
|
setShowEditProductSet,
|
|
28
|
+
workHours,
|
|
26
29
|
}: SelectEventProductSetProps) => {
|
|
27
30
|
const { t } = useTranslation(["Design"]);
|
|
28
31
|
const form = useFormContext<EditEventFormValues>();
|
|
@@ -199,14 +202,13 @@ export const SelectEventProductSet = ({
|
|
|
199
202
|
</Form.Group>
|
|
200
203
|
</div>
|
|
201
204
|
{showEditProductSet && productSetId && (
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
</>
|
|
205
|
+
<EditEventProductSet
|
|
206
|
+
onSubmit={onSubmit}
|
|
207
|
+
defaultValues={
|
|
208
|
+
productSetId === editedProductSet?.id && editedProductSet
|
|
209
|
+
}
|
|
210
|
+
workHours={workHours}
|
|
211
|
+
/>
|
|
210
212
|
)}
|
|
211
213
|
</>
|
|
212
214
|
);
|
|
@@ -5,6 +5,7 @@ import { isEqual } from "lodash";
|
|
|
5
5
|
import { useParams } from "react-router-dom";
|
|
6
6
|
import { useEventEditProductSetContext } from "@licklist/plugins/dist/context/event/EventEditProductSetContext";
|
|
7
7
|
import { useTranslation } from "react-i18next";
|
|
8
|
+
import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
|
|
8
9
|
import { BlockLoader } from "../../../../../static/loader/BlockLoader";
|
|
9
10
|
import { ProductSetControl } from "../../../../../product-set";
|
|
10
11
|
import { ProductSetContextProvider } from "../../../../../product-set/form/context";
|
|
@@ -22,11 +23,13 @@ export interface EventDates {
|
|
|
22
23
|
interface EditEventProductSetProps {
|
|
23
24
|
onSubmit: (value: EditEventFormValues["editedProductSet"]) => void;
|
|
24
25
|
defaultValues?: EditEventFormValues["editedProductSet"];
|
|
26
|
+
workHours: WorkHour[] | undefined;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
export const EditEventProductSet = ({
|
|
28
30
|
onSubmit,
|
|
29
31
|
defaultValues,
|
|
32
|
+
workHours,
|
|
30
33
|
}: EditEventProductSetProps) => {
|
|
31
34
|
const { companyId } = useParams<{
|
|
32
35
|
companyId: string;
|
|
@@ -124,6 +127,7 @@ export const EditEventProductSet = ({
|
|
|
124
127
|
companyName={selectedCompany?.title}
|
|
125
128
|
fee={feeInPercent}
|
|
126
129
|
isEventEditProductSet
|
|
130
|
+
workHours={workHours}
|
|
127
131
|
/>
|
|
128
132
|
<Button
|
|
129
133
|
disabled={isLoading}
|
|
@@ -29,6 +29,7 @@ interface IframeEventCardProps {
|
|
|
29
29
|
titleId?: string;
|
|
30
30
|
descriptionId?: string;
|
|
31
31
|
imageClassName?: string;
|
|
32
|
+
showMoreInfo?: boolean;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
export function IframeEventCard({
|
|
@@ -46,6 +47,7 @@ export function IframeEventCard({
|
|
|
46
47
|
titleId,
|
|
47
48
|
descriptionId,
|
|
48
49
|
imageClassName,
|
|
50
|
+
showMoreInfo,
|
|
49
51
|
}: IframeEventCardProps) {
|
|
50
52
|
const { formatNumber } = useIntl();
|
|
51
53
|
const { t } = useTranslation("Design");
|
|
@@ -70,6 +72,7 @@ export function IframeEventCard({
|
|
|
70
72
|
)}
|
|
71
73
|
onClick={goToDetails ? onClick : undefined}
|
|
72
74
|
>
|
|
75
|
+
{showMoreInfo && <div className="iframe-event-card__info-icon">i</div>}
|
|
73
76
|
{imageSrc && (
|
|
74
77
|
<Card.Img
|
|
75
78
|
className={imageClassName ?? "card-image"}
|
|
@@ -91,12 +94,8 @@ export function IframeEventCard({
|
|
|
91
94
|
<div className="icon-wrapper">
|
|
92
95
|
<CalendarSvg />
|
|
93
96
|
</div>
|
|
94
|
-
<p className="
|
|
95
|
-
|
|
96
|
-
</p>
|
|
97
|
-
<p className="iframe-event-card__bold m-0 grid-view-hided">
|
|
98
|
-
{shortDate}
|
|
99
|
-
</p>
|
|
97
|
+
<p className="m-0 list-view-hided">{date}</p>
|
|
98
|
+
<p className="m-0 grid-view-hided">{shortDate}</p>
|
|
100
99
|
</div>
|
|
101
100
|
</Card.Text>
|
|
102
101
|
|
|
@@ -106,7 +105,7 @@ export function IframeEventCard({
|
|
|
106
105
|
<div className="icon-wrapper">
|
|
107
106
|
<ClockSvg />
|
|
108
107
|
</div>
|
|
109
|
-
<p className="
|
|
108
|
+
<p className="m-0">{type}</p>
|
|
110
109
|
</div>
|
|
111
110
|
</Card.Text>
|
|
112
111
|
)}
|
|
@@ -117,7 +116,7 @@ export function IframeEventCard({
|
|
|
117
116
|
<div className="icon-wrapper">
|
|
118
117
|
<TicketSvg />
|
|
119
118
|
</div>
|
|
120
|
-
<p className="
|
|
119
|
+
<p className="m-0">
|
|
121
120
|
{t("from")}{" "}
|
|
122
121
|
{formatNumber(cost, { style: "currency", currency: "GBP" })}
|
|
123
122
|
</p>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Meta } from "@storybook/react";
|
|
3
3
|
import { BookingSummary } from "./BookingSummary";
|
|
4
|
+
import { SummaryTotalBlock } from "./components/SummaryTotal";
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
title: "Iframe/Order-Process/BookingSummary",
|
|
@@ -138,6 +139,14 @@ export function Default() {
|
|
|
138
139
|
<div className="payment-process">
|
|
139
140
|
<div className="col-lg-4">
|
|
140
141
|
<BookingSummary
|
|
142
|
+
isPaymentPage
|
|
143
|
+
eventName="new Event"
|
|
144
|
+
footer={
|
|
145
|
+
<div className="d-flex flex-column justify-content-between">
|
|
146
|
+
<SummaryTotalBlock label={"Total"} amount={2} />
|
|
147
|
+
<SummaryTotalBlock label={"Total with discount"} amount={1} />
|
|
148
|
+
</div>
|
|
149
|
+
}
|
|
141
150
|
date="29 Sept 2022 at 09:00"
|
|
142
151
|
menuSteps={menuSteps as any}
|
|
143
152
|
peopleAmount={5}
|
|
@@ -8,6 +8,8 @@ import { ProductsByMenuStep } from "./components/ProductsByMenuStep";
|
|
|
8
8
|
import { BookingSummaryProps } from "./types";
|
|
9
9
|
import { SummaryTotal } from "./components/SummaryTotal";
|
|
10
10
|
import { BookingSummaryAccordion } from "./components/BookingSummaryAccordion";
|
|
11
|
+
import { ReactComponent as TicketIcon } from "../../../../assets/iframe/ticket.svg";
|
|
12
|
+
import { ReactComponent as CalendarIcon } from "../../../../assets/iframe/calendar.svg";
|
|
11
13
|
|
|
12
14
|
export const BookingSummary = ({
|
|
13
15
|
date,
|
|
@@ -22,6 +24,10 @@ export const BookingSummary = ({
|
|
|
22
24
|
hasPeopleInput,
|
|
23
25
|
isPaymentLink,
|
|
24
26
|
peopleAmount,
|
|
27
|
+
footer,
|
|
28
|
+
headerComponent,
|
|
29
|
+
// TODO Remove this, when all iframe pages will be ready
|
|
30
|
+
isPaymentPage,
|
|
25
31
|
}: Omit<BookingSummaryProps, "totallWithDiscount">) => {
|
|
26
32
|
const { t } = useTranslation("Design");
|
|
27
33
|
const { formatNumber } = useIntl();
|
|
@@ -36,11 +42,18 @@ export const BookingSummary = ({
|
|
|
36
42
|
|
|
37
43
|
return (
|
|
38
44
|
<div className="payment-booking-summary">
|
|
39
|
-
<BookingSummaryAccordion
|
|
45
|
+
<BookingSummaryAccordion
|
|
46
|
+
isPaymentPage={isPaymentPage}
|
|
47
|
+
hasPeopleInput={hasPeopleInput}
|
|
48
|
+
headerComponent={headerComponent}
|
|
49
|
+
>
|
|
40
50
|
<div className="event-info">
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
<EventInfo
|
|
52
|
+
eventName={eventName}
|
|
53
|
+
isPaymentPage={isPaymentPage}
|
|
54
|
+
date={date}
|
|
55
|
+
time={time}
|
|
56
|
+
/>
|
|
44
57
|
</div>
|
|
45
58
|
<hr />
|
|
46
59
|
|
|
@@ -62,8 +75,8 @@ export const BookingSummary = ({
|
|
|
62
75
|
{!shouldHidePeopleAmount && peopleAmount > 0 && (
|
|
63
76
|
<>
|
|
64
77
|
<hr />
|
|
65
|
-
<div className="d-flex justify-content-between mt-3">
|
|
66
|
-
<p className="m-0">{t("people")}:</p>
|
|
78
|
+
<div className="d-flex justify-content-between mt-3 people">
|
|
79
|
+
<p className="m-0 payment-metadata">{t("people")}:</p>
|
|
67
80
|
<p className="price">{peopleAmount}</p>
|
|
68
81
|
</div>
|
|
69
82
|
</>
|
|
@@ -73,7 +86,9 @@ export const BookingSummary = ({
|
|
|
73
86
|
<>
|
|
74
87
|
<hr />
|
|
75
88
|
<div className="d-flex justify-content-between mt-3">
|
|
76
|
-
<p className="m-0">
|
|
89
|
+
<p className="m-0 payment-metadata">
|
|
90
|
+
{t("transactionFee")}:
|
|
91
|
+
</p>
|
|
77
92
|
<p className="price">
|
|
78
93
|
{formatNumber(transactionFee, {
|
|
79
94
|
style: "currency",
|
|
@@ -84,6 +99,7 @@ export const BookingSummary = ({
|
|
|
84
99
|
</>
|
|
85
100
|
)}
|
|
86
101
|
</div>
|
|
102
|
+
{footer}
|
|
87
103
|
</div>
|
|
88
104
|
) : (
|
|
89
105
|
<div className="cart-items">
|
|
@@ -97,3 +113,38 @@ export const BookingSummary = ({
|
|
|
97
113
|
|
|
98
114
|
BookingSummary.SummaryTotal = SummaryTotal;
|
|
99
115
|
BookingSummary.Accordion = BookingSummaryAccordion;
|
|
116
|
+
|
|
117
|
+
const EventInfo = ({
|
|
118
|
+
isPaymentPage,
|
|
119
|
+
eventName,
|
|
120
|
+
date,
|
|
121
|
+
time,
|
|
122
|
+
}: Pick<
|
|
123
|
+
BookingSummaryProps,
|
|
124
|
+
"date" | "time" | "eventName" | "isPaymentPage"
|
|
125
|
+
>) => {
|
|
126
|
+
if (isPaymentPage) {
|
|
127
|
+
return (
|
|
128
|
+
<>
|
|
129
|
+
<div className="d-flex align-items-center mb-5">
|
|
130
|
+
<TicketIcon height={16} width={20} fill="black" />
|
|
131
|
+
<div className="m-0 pl-2 title event-name metadata">{eventName}</div>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<div className="d-flex align-items-center mb-5">
|
|
135
|
+
<CalendarIcon height={16} width={20} fill="black" />
|
|
136
|
+
<div className="m-0 pl-2 metadata">{date}</div>
|
|
137
|
+
</div>
|
|
138
|
+
{time && <div className="mb-5 metadata">{time}</div>}
|
|
139
|
+
</>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<>
|
|
145
|
+
<p className="m-0 title event-name">{eventName}</p>
|
|
146
|
+
<p className="m-0">{date}</p>
|
|
147
|
+
{time && <p className="m-0">{time}</p>}
|
|
148
|
+
</>
|
|
149
|
+
);
|
|
150
|
+
};
|