@licklist/design 0.44.541 → 0.44.543
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/availability-indicator/AvailabilityIndicator.d.ts +5 -4
- package/dist/availability-indicator/AvailabilityIndicator.d.ts.map +1 -1
- package/dist/availability-indicator/AvailabilityIndicator.js +1 -1
- package/dist/calendar/Calendar.d.ts +2 -4
- package/dist/calendar/Calendar.d.ts.map +1 -1
- package/dist/date-time-button/DateTimeButton.d.ts +4 -5
- package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
- package/dist/date-time-button/DateTimeButton.js +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -1
- package/dist/iframe/activity-card/ActivityCard.d.ts +1 -3
- package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
- package/dist/iframe/activity-card/ActivityCard.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +3 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.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/product-set/control/DateAndRecurrenceInput.d.ts +5 -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/ProductSetControl.d.ts +4 -2
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +1 -1
- package/dist/product-set/control/ProductSetRecurrenceControl.d.ts +2 -1
- package/dist/product-set/control/ProductSetRecurrenceControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetRecurrenceControl.js +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts +3 -1
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +1 -1
- package/dist/product-set/utils/index.d.ts +10 -0
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.js +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
- package/dist/sales/payment-form/SalePaymentForm.js +1 -1
- package/dist/styles/activity-card/GridActivitiesCard.scss +0 -8
- package/dist/styles/form/CustomCheckbox.scss +1 -0
- package/dist/styles/zones/ZoneForm.scss +3 -0
- package/dist/zone/form/ZoneForm.d.ts +1 -1
- package/dist/zone/form/ZoneForm.d.ts.map +1 -1
- package/dist/zone/form/ZoneForm.js +1 -1
- package/dist/zone/form/components/AvailableTimesControl.d.ts +2 -0
- package/dist/zone/form/components/AvailableTimesControl.d.ts.map +1 -1
- package/dist/zone/form/components/AvailableTimesControl.js +1 -1
- package/dist/zone/form/components/ZoneControl.d.ts +1 -1
- 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 +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
- package/package.json +1 -1
- package/src/availability-indicator/AvailabilityIndicator.tsx +41 -33
- package/src/calendar/Calendar.tsx +2 -3
- package/src/date-time-button/DateTimeButton.tsx +11 -6
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.stories.tsx +0 -3
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +0 -1
- package/src/iframe/activity-card/ActivityCard.stories.tsx +27 -51
- package/src/iframe/activity-card/ActivityCard.tsx +2 -13
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +13 -32
- package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +12 -10
- package/src/product-set/control/DateAndRecurrenceInput.tsx +73 -2
- package/src/product-set/control/ProductSetControl.stories.tsx +0 -2
- package/src/product-set/control/ProductSetControl.tsx +8 -10
- package/src/product-set/control/ProductSetRecurrenceControl.tsx +6 -1
- package/src/product-set/form/ProductSetForm.stories.tsx +6 -6
- package/src/product-set/form/ProductSetForm.tsx +19 -3
- package/src/product-set/utils/index.ts +38 -0
- package/src/styles/activity-card/GridActivitiesCard.scss +0 -8
- package/src/styles/form/CustomCheckbox.scss +1 -0
- package/src/styles/zones/ZoneForm.scss +3 -0
- package/src/zone/form/ZoneForm.tsx +1 -2
- package/src/zone/form/components/AvailableTimesControl.tsx +89 -83
- package/src/zone/form/components/ZoneControl.tsx +2 -5
- package/src/zone/form/components/ZoneRecurrencesControl.tsx +2 -51
|
@@ -12,5 +12,5 @@ export type ZoneFormProps = {
|
|
|
12
12
|
export type ZoneFormValues = Partial<Zone> & {
|
|
13
13
|
localImageBlobURL?: string;
|
|
14
14
|
};
|
|
15
|
-
export declare const ZoneForm: ({ defaultValues, onSubmit, serverErrors, isLoading,
|
|
15
|
+
export declare const ZoneForm: ({ defaultValues, onSubmit, serverErrors, isLoading, }: ZoneFormProps) => JSX.Element;
|
|
16
16
|
//# sourceMappingURL=ZoneForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoneForm.d.ts","sourceRoot":"","sources":["../../../src/zone/form/ZoneForm.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAGtF,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"ZoneForm.d.ts","sourceRoot":"","sources":["../../../src/zone/form/ZoneForm.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAGtF,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,QAAQ,0DAKlB,aAAa,gBAiDf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=require("react"),o=e(t),n=require("react-i18next"),s=require("react-bootstrap"),a=require("react-hook-form"),l=e(require("@licklist/plugins/dist/services/Form/FormErrorService")),
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=require("react"),o=e(t),n=require("react-i18next"),s=require("react-bootstrap"),a=require("react-hook-form"),l=e(require("@licklist/plugins/dist/services/Form/FormErrorService")),i=require("./components/ZoneControl.js");exports.ZoneForm=function(e){var u=e.defaultValues,c=e.onSubmit,m=e.serverErrors,d=e.isLoading,f=void 0!==d&&d,b=n.useTranslation("Design").t,p=a.useForm({mode:"onChange",defaultValues:{zoneRecurrences:[]}}),v=p.reset,E=p.setError,g=p.handleSubmit,q=(0,p.watch)();return t.useEffect((function(){u&&v(u)}),[u,v]),t.useEffect((function(){m&&l.handleServerErrors(m,E)}),[m,E]),o.createElement(a.FormProvider,r.__assign({},p),o.createElement(s.Form,{onSubmit:g((function(e){e.localImageBlobURL;var t=r.__rest(e,["localImageBlobURL"]);c(t)}))},o.createElement(i.ZoneControl,{isLoading:f}),o.createElement(s.Row,null,o.createElement(s.Col,{md:6,sm:12}),o.createElement(s.Col,{className:"product-set-save-btn-wrapper p-0 pl-4 d-flex mw-100",md:6,sm:12},o.createElement(s.Button,{className:"product-set-save-btn mt-5 ml-5 d-no dne d-md-block",type:"submit",disabled:f||!q.name},b("saveAndClose"))))))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvailableTimesControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/AvailableTimesControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,eAAe,EAAW,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAGtF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM;QAAE,cAAc,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC9C,QAAQ,EAAE,eAAe,CAAC,kBAAkB,CAAC,CAAC;CAC/C,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"AvailableTimesControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/AvailableTimesControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,eAAe,EAAW,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAGtF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM;QAAE,cAAc,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC9C,QAAQ,EAAE,eAAe,CAAC,kBAAkB,CAAC,CAAC;CAC/C,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B,CAAC;AAEF,KAAK,kBAAkB,GAAG;IAAE,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEvD,eAAO,MAAM,qBAAqB,6GA8FjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("tslib"),a=require("react"),t=(e=a)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-bootstrap"),s=require("react-hook-form"),n=require("@react-aria/utils"),l=require("../utils/dates.js"),u=a.forwardRef((function(e,u){var c,m=e.isLoading,d=e.workHours,f=e.defaultValues,v=void 0===f?[]:f,g=e.errorMessage,b=e.clearErrorMessage,p=n.useId(),E=i.useTranslation(["Design","Validation"]).t,h=s.useForm({mode:"onChange"}),k=h.register,_=h.formState.errors,y=h.reset,C=h.trigger,T=h.getValues,q=h.setValue,F=h.watch,x=h.setError,V=F("availableTimes")||[],I=a.useMemo((function(){return l.getCheckboxesByWorkHours(d)}),[d]);a.useImperativeHandle(u,(function(){return{trigger:C,getValues:T,setError:x}}));return a.useEffect((function(){v&&y({availableTimes:v})}),[v]),t.createElement(o.Form.Group,{controlId:p},t.createElement(o.Form.Label,null,E("Design:startTimes")),t.createElement("div",{className:"zone-available-times"},I.map((function(e){return t.createElement(o.Form.Check,{key:e,inline:!0,custom:!0,id:e},t.createElement(o.Form.Check.Input,{type:"checkbox",value:e,checked:V.includes(e),onChange:function(){return function(e){var a=V.includes(e);g&&b(),q("availableTimes",a?V.filter((function(r){return r!==e})):r.__spreadArray(r.__spreadArray([],r.__read(V),!1),[e],!1))}(e)},disabled:m}),t.createElement(o.Form.Check.Label,null,e))}))),t.createElement(o.Form.Control,r.__assign({type:"hidden"},k("availableTimes"))),t.createElement("div",{className:"manual-form-error"},(null===(c=_.availableTimes)||void 0===c?void 0:c.message)||g))}));exports.AvailableTimesControl=u;
|
|
@@ -4,5 +4,5 @@ export type ZoneControlProps = {
|
|
|
4
4
|
isLoading: boolean;
|
|
5
5
|
workHours?: WorkHour[];
|
|
6
6
|
};
|
|
7
|
-
export declare const ZoneControl: ({ isLoading
|
|
7
|
+
export declare const ZoneControl: ({ isLoading }: ZoneControlProps) => JSX.Element;
|
|
8
8
|
//# sourceMappingURL=ZoneControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoneControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneControl.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAStF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"ZoneControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneControl.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAStF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,WAAW,kBAAmB,gBAAgB,gBA0B1D,CAAC"}
|
|
@@ -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"),t=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,o=require("react-bootstrap"),n=require("./NameControl.js"),l=require("./ZoneTypeControl.js"),a=require("./SortControl.js"),i=require("./ZoneRecurrencesControl.js"),m=require("./DescriptionControl.js"),s=require("./ZoneImageControl.js"),c=require("./GameDurationControl.js");exports.ZoneControl=function(e){var r=e.isLoading;return t.createElement(o.Row,null,t.createElement(o.Col,{md:6,sm:12,className:"pr-5"},t.createElement(n.NameControl,{isLoading:r}),t.createElement(i.ZoneRecurrencesControl,null),t.createElement("hr",null),t.createElement(o.Row,null,t.createElement(o.Col,{md:6,sm:6},t.createElement(l.ZoneTypeControl,{isLoading:r}),t.createElement(a.SortControl,{isLoading:r}),t.createElement(c.GameDurationControl,{isLoading:r})),t.createElement(o.Col,{md:6,sm:6},t.createElement(s.ZoneImageControl,{isLoading:r}))),t.createElement("hr",null),t.createElement(o.Row,null,t.createElement(o.Col,{md:12,sm:12},t.createElement(m.DescriptionControl,{isLoading:r})))))};
|
|
@@ -8,5 +8,5 @@ export type ZoneRecurrenceControlProps = {
|
|
|
8
8
|
workHours?: WorkHour[];
|
|
9
9
|
isLoading?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare const ZoneRecurrencesControl: (
|
|
11
|
+
export declare const ZoneRecurrencesControl: () => JSX.Element;
|
|
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;
|
|
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,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,sBAAsB,mBAsMlC,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("
|
|
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 e,g,_=u.useFormContext(),E=_.control,q=_.register,x=_.formState.errors,C=_.getValues,D=_.setValue,R=_.clearErrors,b=u.useFieldArray({name:"zoneRecurrences",control:E,keyName:"_id"}),y=b.fields,I=b.append,S=b.update,k=b.move,z=r.__read(t.useState(!1),2),N=z[0],h=z[1],j=r.__read(t.useState({index:null,values:null}),2),T=j[0],A=j[1],w=function(){return A({index:null,values:null})},F=t.useRef();c.useClickAway(F,(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)||(h(!1),w())}));var M=l.useId(),P=i.useTranslation(["Design","Validation"]).t,O=function(){w(),h((function(e){return!e}))};return t.useEffect((function(){y.length&&R("zoneRecurrences")}),[y,R]),n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,P("zoneAvailable")),n.createElement(o.OverlayTrigger,{show:N,overlay:n.createElement(o.Popover,{id:M,className:"rounded"},n.createElement(o.Popover.Content,{className:"shadow-lg rounded",ref:F},n.createElement(v.RecurringDatePickerInput,{defaultValues:T.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=T.values)||void 0===n?void 0:n.id)&&(t.id=null===(i=T.values)||void 0===i?void 0:i.id),null!==T.index?S(T.index,t):I(t),h((function(){return!1})),w(),[2]}))}))},onDelete:function(){var e=T.index;h(!1),w(),setTimeout((function(){var r=C().zoneRecurrences;D("zoneRecurrences",(void 0===r?[]:r).filter((function(r,t){return t!==e})))}),100)},setInitialStartDateAfterSelect:!0}))),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=y.findIndex((function(e){return String(e._id)===t.id})),i=y.findIndex((function(e){return String(e._id)===r.id}));k(n,i)}}},n.createElement(s.SortableContext,{items:null!==(e=null==y?void 0:y.map((function(e){return String(e._id)})))&&void 0!==e?e:[],strategy:s.verticalListSortingStrategy},null==y?void 0:y.map((function(e,r){return n.createElement(p.ZoneRecurrenceControl,{key:e._id,zoneRecurrence:e,onEdit:function(){return function(e,r){w(),A({index:r,values:e}),h((function(){return!0}))}(e,r)}})})))),n.createElement("div",{className:"zone-recurrence-icon-wrapper",role:"button",tabIndex:0,onClick:O,onKeyDown:O},n.createElement(a.default,{type:"plus-circle",height:"1rem",className:"zone-recurrence-icon-add mr-2"}),P("addDates")),n.createElement(o.Form.Control,r.__assign({type:"hidden"},q("zoneRecurrences",{required:{value:!0,message:P("Validation:fieldMinNumber",{attribute:P("dates"),min:1})}}))),n.createElement("div",{className:"manual-form-error"},null===(g=x.zoneRecurrences)||void 0===g?void 0:g.message))))};
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { FunctionComponent, SVGProps } from "react";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
+
import { ZoneResourcesAvailability } from "@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper";
|
|
3
4
|
import { ReactComponent as AvailableIcon } from "../assets/iframe/available.svg";
|
|
4
5
|
import { ReactComponent as LimitedIcon } from "../assets/iframe/limited.svg";
|
|
5
6
|
import { ReactComponent as SoldOutIcon } from "../assets/iframe/soldOut.svg";
|
|
@@ -7,53 +8,60 @@ import { ReactComponent as SoldOutIcon } from "../assets/iframe/soldOut.svg";
|
|
|
7
8
|
const LOTS_OF_SPACE_LIMIT = 0.2;
|
|
8
9
|
const LIMITED_LIMIT = 0.8;
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
type Config = {
|
|
12
|
+
label: string;
|
|
13
|
+
icon: FunctionComponent<SVGProps<SVGSVGElement>>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const getIconsAndLabels = ({
|
|
17
|
+
bookedResources,
|
|
18
|
+
totalResources,
|
|
19
|
+
}: ZoneResourcesAvailability): Config => {
|
|
20
|
+
if (bookedResources === totalResources) {
|
|
21
|
+
return { label: "soldOut", icon: SoldOutIcon };
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
// lots of space if less than 80% booked
|
|
19
|
-
if (
|
|
20
|
-
return { label: "lotsOfSpace", icon:
|
|
25
|
+
if (bookedResources / totalResources <= LOTS_OF_SPACE_LIMIT) {
|
|
26
|
+
return { label: "lotsOfSpace", icon: AvailableIcon };
|
|
21
27
|
}
|
|
22
28
|
|
|
23
|
-
if (
|
|
24
|
-
return { label: "limited", icon:
|
|
29
|
+
if (bookedResources / totalResources >= LIMITED_LIMIT) {
|
|
30
|
+
return { label: "limited", icon: LimitedIcon };
|
|
25
31
|
}
|
|
26
32
|
|
|
27
|
-
return { label: "available", icon:
|
|
33
|
+
return { label: "available", icon: AvailableIcon };
|
|
28
34
|
};
|
|
29
35
|
|
|
30
36
|
type AvailabilityIndicatorProps = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
resources: ZoneResourcesAvailability;
|
|
38
|
+
isUnavailable?: boolean;
|
|
39
|
+
isSoldOut?: boolean;
|
|
34
40
|
};
|
|
35
41
|
|
|
36
42
|
export const AvailabilityIndicator = ({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
resources,
|
|
44
|
+
isUnavailable,
|
|
45
|
+
isSoldOut,
|
|
40
46
|
}: AvailabilityIndicatorProps) => {
|
|
41
47
|
const { t } = useTranslation("Design");
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<div className="availability-indicator">
|
|
47
|
-
<SoldOutIcon className="logo" />
|
|
48
|
-
<div>{t("notAvailable")}</div>
|
|
49
|
-
</div>
|
|
50
|
-
);
|
|
48
|
+
|
|
49
|
+
if (isUnavailable) {
|
|
50
|
+
return <Indicator icon={SoldOutIcon} label={t("notAvailable")} />;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
if (isSoldOut) {
|
|
54
|
+
return <Indicator icon={SoldOutIcon} label={t("soldOut")} />;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const { icon, label } = getIconsAndLabels(resources);
|
|
58
|
+
|
|
59
|
+
return <Indicator icon={icon} label={t(label)} />;
|
|
59
60
|
};
|
|
61
|
+
|
|
62
|
+
const Indicator = ({ icon, label }: Config) => (
|
|
63
|
+
<div className="availability-indicator">
|
|
64
|
+
{icon}
|
|
65
|
+
<div>{label}</div>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Dispatch, ReactElement, SetStateAction } from "react";
|
|
2
2
|
import { DateTime } from "luxon";
|
|
3
|
+
import { ZoneResourcesAvailability } from "@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper";
|
|
3
4
|
import { CalendarButtons } from "./components/CalendarButtons";
|
|
4
5
|
import { CalendarDates } from "./components/CalendarDates";
|
|
5
6
|
|
|
@@ -20,9 +21,7 @@ export type CalendarProps = {
|
|
|
20
21
|
fromPrice?: string | ReactElement | null;
|
|
21
22
|
isLoading?: boolean;
|
|
22
23
|
initialDate?: DateTime;
|
|
23
|
-
getAvailability?: (
|
|
24
|
-
date: DateTime
|
|
25
|
-
) => { booked: number; total: number } | undefined;
|
|
24
|
+
getAvailability?: (date: DateTime) => ZoneResourcesAvailability | null;
|
|
26
25
|
includeAvailability?: boolean;
|
|
27
26
|
};
|
|
28
27
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { ReactElement } from "react";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { DateTime } from "luxon";
|
|
4
|
+
import { ZoneResourcesAvailability } from "@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper";
|
|
4
5
|
import { AvailabilityIndicator } from "../availability-indicator";
|
|
5
6
|
import { DateContent } from "./DateContent";
|
|
6
7
|
|
|
@@ -8,13 +9,11 @@ export type DateTimeButtonProps<T = DateTime | string> = {
|
|
|
8
9
|
date: T;
|
|
9
10
|
isSelected?: boolean;
|
|
10
11
|
isDisabled?: boolean;
|
|
12
|
+
isSoldOut?: boolean;
|
|
11
13
|
onSelect: (date: T) => void;
|
|
12
14
|
isOnlyTimeContainer?: boolean;
|
|
13
15
|
price?: string | number | ReactElement | null;
|
|
14
|
-
resources?:
|
|
15
|
-
booked: number;
|
|
16
|
-
total: number;
|
|
17
|
-
};
|
|
16
|
+
resources?: ZoneResourcesAvailability | null;
|
|
18
17
|
calendarView?: boolean;
|
|
19
18
|
showResources?: boolean;
|
|
20
19
|
};
|
|
@@ -23,6 +22,7 @@ export const DateTimeButton = <T extends DateTime | string>({
|
|
|
23
22
|
date,
|
|
24
23
|
isDisabled: _isDisabled,
|
|
25
24
|
isSelected,
|
|
25
|
+
isSoldOut,
|
|
26
26
|
onSelect,
|
|
27
27
|
isOnlyTimeContainer,
|
|
28
28
|
price,
|
|
@@ -33,7 +33,8 @@ export const DateTimeButton = <T extends DateTime | string>({
|
|
|
33
33
|
const isTimeVariant = typeof date === "string";
|
|
34
34
|
|
|
35
35
|
const isDisabled =
|
|
36
|
-
_isDisabled ||
|
|
36
|
+
_isDisabled ||
|
|
37
|
+
(resources && resources.bookedResources === resources.totalResources);
|
|
37
38
|
|
|
38
39
|
return (
|
|
39
40
|
<button
|
|
@@ -63,7 +64,11 @@ export const DateTimeButton = <T extends DateTime | string>({
|
|
|
63
64
|
{price && !isDisabled && <div className="price">{price}</div>}
|
|
64
65
|
|
|
65
66
|
{showResources && resources && (
|
|
66
|
-
<AvailabilityIndicator
|
|
67
|
+
<AvailabilityIndicator
|
|
68
|
+
resources={resources}
|
|
69
|
+
isUnavailable={_isDisabled}
|
|
70
|
+
isSoldOut={isSoldOut}
|
|
71
|
+
/>
|
|
67
72
|
)}
|
|
68
73
|
</button>
|
|
69
74
|
);
|
|
@@ -47,7 +47,6 @@ const contextValue = {
|
|
|
47
47
|
name: "Example",
|
|
48
48
|
type: "sale",
|
|
49
49
|
termsAndConditions: "",
|
|
50
|
-
isDefault: true,
|
|
51
50
|
operationalCost: OPERATIONAL_COST_CUSTOMER,
|
|
52
51
|
steps: [
|
|
53
52
|
{
|
|
@@ -687,7 +686,6 @@ const defaultProductSets = [
|
|
|
687
686
|
name: "Example",
|
|
688
687
|
type: PRODUCT_SET_TYPES[0],
|
|
689
688
|
termsAndConditions: "",
|
|
690
|
-
isDefault: true,
|
|
691
689
|
operationalCost: OPERATIONAL_COST_TYPES[0],
|
|
692
690
|
fieldSet: {
|
|
693
691
|
id: 1,
|
|
@@ -877,7 +875,6 @@ const defaultProductSets = [
|
|
|
877
875
|
name: "Example 2",
|
|
878
876
|
type: PRODUCT_SET_TYPES[1],
|
|
879
877
|
termsAndConditions: "",
|
|
880
|
-
isDefault: true,
|
|
881
878
|
operationalCost: OPERATIONAL_COST_TYPES[1],
|
|
882
879
|
fieldSet: {
|
|
883
880
|
id: 2,
|
|
@@ -17,7 +17,6 @@ export const getDefaultValues = (
|
|
|
17
17
|
operationalCost: productSet?.operationalCost ?? DEFAULT_OPERATIONAL_COST_TYPE,
|
|
18
18
|
relyOnPeopleType: productSet?.relyOnPeopleType ?? null,
|
|
19
19
|
thankYouPageUrl: productSet?.thankYouPageUrl ?? "",
|
|
20
|
-
isDefault: productSet?.isDefault ?? false,
|
|
21
20
|
fieldSetId: productSet?.fieldSetId,
|
|
22
21
|
emailTemplates:
|
|
23
22
|
productSet?.mailTemplates && productSet?.mailTemplates?.length > 0
|
|
@@ -1,75 +1,51 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Meta, Story } from "@storybook/react";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
ActivityCard,
|
|
5
|
+
ActivityCardProps,
|
|
6
|
+
LAYOUT_GRID,
|
|
7
|
+
LAYOUT_LIST,
|
|
8
|
+
} from "./ActivityCard";
|
|
4
9
|
|
|
5
10
|
export default {
|
|
6
11
|
title: "Iframe/ActivityCard",
|
|
7
12
|
component: ActivityCard,
|
|
8
13
|
} as Meta;
|
|
9
14
|
|
|
10
|
-
export const
|
|
11
|
-
|
|
12
|
-
};
|
|
15
|
+
export const GridView: Story<ActivityCardProps> = (props) => {
|
|
16
|
+
const [isSelected, setIsSelected] = React.useState(false);
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
imageType: "cover",
|
|
22
|
-
imageableId: 25,
|
|
23
|
-
imageableType: "zone",
|
|
24
|
-
path: "images/original/000/000/000/000/195-0b37b130e22aa2d3.jpeg",
|
|
25
|
-
// eslint-disable-next-line max-len
|
|
26
|
-
url: "https://cdn.lickli.st/doNktZRze1yuz3Uo2OPrLSvXVtUcdUsF/images/original/000/000/000/000/195-0b37b130e22aa2d3.jpeg",
|
|
27
|
-
},
|
|
28
|
-
onSelect: () => null,
|
|
29
|
-
isSelected: false,
|
|
18
|
+
return (
|
|
19
|
+
<ActivityCard
|
|
20
|
+
{...props}
|
|
21
|
+
isSelected={isSelected}
|
|
22
|
+
onSelect={() => setIsSelected(true)}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
30
25
|
};
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
Selected.args = {
|
|
27
|
+
GridView.args = {
|
|
28
|
+
layout: LAYOUT_GRID,
|
|
37
29
|
title: "Clay Pigeons & Axe Thowing",
|
|
38
30
|
duration: "60 mins",
|
|
39
31
|
price: "from £20",
|
|
40
|
-
image: {
|
|
41
|
-
hash: "0b37b130e22aa2d3",
|
|
42
|
-
id: 195,
|
|
43
|
-
imageType: "cover",
|
|
44
|
-
imageableId: 25,
|
|
45
|
-
imageableType: "zone",
|
|
46
|
-
path: "images/original/000/000/000/000/195-0b37b130e22aa2d3.jpeg",
|
|
47
|
-
// eslint-disable-next-line max-len
|
|
48
|
-
url: "https://cdn.lickli.st/doNktZRze1yuz3Uo2OPrLSvXVtUcdUsF/images/original/000/000/000/000/195-0b37b130e22aa2d3.jpeg",
|
|
49
|
-
},
|
|
50
|
-
onSelect: () => null,
|
|
51
|
-
isSelected: true,
|
|
52
32
|
};
|
|
53
33
|
|
|
54
34
|
export const ListView: Story<ActivityCardProps> = (props) => {
|
|
55
|
-
|
|
35
|
+
const [isSelected, setIsSelected] = React.useState(false);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<ActivityCard
|
|
39
|
+
{...props}
|
|
40
|
+
isSelected={isSelected}
|
|
41
|
+
onSelect={() => setIsSelected(true)}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
56
44
|
};
|
|
57
45
|
|
|
58
|
-
|
|
46
|
+
ListView.args = {
|
|
59
47
|
layout: LAYOUT_LIST,
|
|
60
48
|
title: "Clay Pigeons & Axe Thowing",
|
|
61
49
|
duration: "60 mins",
|
|
62
50
|
price: "from £20",
|
|
63
|
-
image: {
|
|
64
|
-
hash: "0b37b130e22aa2d3",
|
|
65
|
-
id: 195,
|
|
66
|
-
imageType: "cover",
|
|
67
|
-
imageableId: 25,
|
|
68
|
-
imageableType: "zone",
|
|
69
|
-
path: "images/original/000/000/000/000/195-0b37b130e22aa2d3.jpeg",
|
|
70
|
-
// eslint-disable-next-line max-len
|
|
71
|
-
url: "https://cdn.lickli.st/doNktZRze1yuz3Uo2OPrLSvXVtUcdUsF/images/original/000/000/000/000/195-0b37b130e22aa2d3.jpeg",
|
|
72
|
-
},
|
|
73
|
-
onSelect: () => null,
|
|
74
|
-
isSelected: false,
|
|
75
51
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import { Image } from "@licklist/core/dist/DataMapper/Media/ImageDataMapper";
|
|
4
3
|
|
|
5
4
|
export const LAYOUT_GRID = "grid";
|
|
6
5
|
export const LAYOUT_LIST = "list";
|
|
@@ -11,7 +10,6 @@ export type ActivityCardProps = {
|
|
|
11
10
|
title: ReactNode;
|
|
12
11
|
duration: ReactNode;
|
|
13
12
|
price: ReactNode;
|
|
14
|
-
image?: Image | null;
|
|
15
13
|
onSelect: () => void;
|
|
16
14
|
isSelected: boolean;
|
|
17
15
|
layout?: Layout;
|
|
@@ -21,7 +19,7 @@ export const ActivityCard = ({
|
|
|
21
19
|
title,
|
|
22
20
|
duration,
|
|
23
21
|
price,
|
|
24
|
-
image,
|
|
22
|
+
// image,
|
|
25
23
|
onSelect,
|
|
26
24
|
isSelected,
|
|
27
25
|
layout = LAYOUT_GRID,
|
|
@@ -33,10 +31,7 @@ export const ActivityCard = ({
|
|
|
33
31
|
className={clsx("activity-card", isSelected && "active")}
|
|
34
32
|
onClick={onSelect}
|
|
35
33
|
>
|
|
36
|
-
{
|
|
37
|
-
<img className="activity-card-image" alt="" src={image.url} />
|
|
38
|
-
)}
|
|
39
|
-
<div className={clsx("d-flex", "flex-column", !image && "no-image")}>
|
|
34
|
+
<div className={clsx("d-flex", "flex-column")}>
|
|
40
35
|
<div className="activity-card-title">{title}</div>
|
|
41
36
|
|
|
42
37
|
{duration && <div>{duration}</div>}
|
|
@@ -64,12 +59,6 @@ export const ActivityCard = ({
|
|
|
64
59
|
|
|
65
60
|
{price && <div>{price}</div>}
|
|
66
61
|
</div>
|
|
67
|
-
|
|
68
|
-
{image && (
|
|
69
|
-
<div className="image-container">
|
|
70
|
-
<img className="image" src={image.url} alt="" />
|
|
71
|
-
</div>
|
|
72
|
-
)}
|
|
73
62
|
</div>
|
|
74
63
|
<hr className="list-activity-card-hr" />
|
|
75
64
|
</div>
|
|
@@ -3,6 +3,7 @@ import clsx from "clsx";
|
|
|
3
3
|
import { Button } from "react-bootstrap";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import { FieldValues, RefCallBack, UseFormClearErrors } from "react-hook-form";
|
|
6
|
+
import { Zone } from "@licklist/core/dist/DataMapper/Provider/ZoneDataMapper";
|
|
6
7
|
import { NumberInput } from "../NumberInput";
|
|
7
8
|
import { Product, ProductCategory } from "../../../../../../types";
|
|
8
9
|
|
|
@@ -11,6 +12,7 @@ interface FormOrderItem {
|
|
|
11
12
|
name: string;
|
|
12
13
|
price: number;
|
|
13
14
|
productsCategoryId: number;
|
|
15
|
+
zoneId?: Zone["id"];
|
|
14
16
|
deposit?: number | null;
|
|
15
17
|
quantity: number;
|
|
16
18
|
capacity?: number | null;
|
|
@@ -30,7 +32,7 @@ interface ProductQuantityInputProps {
|
|
|
30
32
|
export const ProductQuantityInput = ({
|
|
31
33
|
product,
|
|
32
34
|
category,
|
|
33
|
-
onChange,
|
|
35
|
+
onChange: _onChange,
|
|
34
36
|
clearErrors,
|
|
35
37
|
refCallback,
|
|
36
38
|
productInfo,
|
|
@@ -39,14 +41,15 @@ export const ProductQuantityInput = ({
|
|
|
39
41
|
}: ProductQuantityInputProps) => {
|
|
40
42
|
const { t } = useTranslation("Design");
|
|
41
43
|
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
+
const onChange = (quantity: number | null) => {
|
|
45
|
+
_onChange({
|
|
44
46
|
id: product.id,
|
|
45
47
|
name: product.name,
|
|
46
48
|
deposit,
|
|
47
49
|
price: product.price,
|
|
48
50
|
productsCategoryId: category.id,
|
|
49
|
-
|
|
51
|
+
zoneId: category.zone?.id,
|
|
52
|
+
quantity,
|
|
50
53
|
capacity: product?.capacity,
|
|
51
54
|
});
|
|
52
55
|
};
|
|
@@ -58,6 +61,7 @@ export const ProductQuantityInput = ({
|
|
|
58
61
|
</div>
|
|
59
62
|
);
|
|
60
63
|
}
|
|
64
|
+
|
|
61
65
|
if (product?.maxAmount === 1) {
|
|
62
66
|
return (
|
|
63
67
|
<Button
|
|
@@ -69,49 +73,26 @@ export const ProductQuantityInput = ({
|
|
|
69
73
|
}`,
|
|
70
74
|
invalid && "error"
|
|
71
75
|
)}
|
|
72
|
-
onClick={
|
|
76
|
+
onClick={() => onChange(productInfo?.quantity ? 0 : 1)}
|
|
73
77
|
>
|
|
74
78
|
{t(`Design:${productInfo?.quantity ? "unselect" : "select"}`)}
|
|
75
79
|
</Button>
|
|
76
80
|
);
|
|
77
81
|
}
|
|
82
|
+
|
|
78
83
|
return (
|
|
79
84
|
<NumberInput
|
|
80
85
|
ref={refCallback}
|
|
81
86
|
onChange={(val) => {
|
|
82
|
-
onChange(
|
|
83
|
-
id: product.id,
|
|
84
|
-
name: product.name,
|
|
85
|
-
deposit,
|
|
86
|
-
price: product.price,
|
|
87
|
-
productsCategoryId: category.id,
|
|
88
|
-
quantity: val || null,
|
|
89
|
-
capacity: product?.capacity,
|
|
90
|
-
});
|
|
87
|
+
onChange(val || null);
|
|
91
88
|
clearErrors(`${product.id}` as const);
|
|
92
89
|
}}
|
|
93
90
|
onArrowDown={() => {
|
|
94
|
-
onChange(
|
|
95
|
-
id: product.id,
|
|
96
|
-
name: product.name,
|
|
97
|
-
deposit,
|
|
98
|
-
price: product.price,
|
|
99
|
-
productsCategoryId: category.id,
|
|
100
|
-
quantity: productInfo?.quantity - 1 || 0,
|
|
101
|
-
capacity: product?.capacity,
|
|
102
|
-
});
|
|
91
|
+
onChange(productInfo?.quantity - 1 || 0);
|
|
103
92
|
clearErrors(`${product.id}` as const);
|
|
104
93
|
}}
|
|
105
94
|
onArrowUp={() => {
|
|
106
|
-
onChange(
|
|
107
|
-
id: product.id,
|
|
108
|
-
name: product.name,
|
|
109
|
-
deposit,
|
|
110
|
-
price: product.price,
|
|
111
|
-
productsCategoryId: category.id,
|
|
112
|
-
quantity: (productInfo?.quantity ?? 0) + 1,
|
|
113
|
-
capacity: product?.capacity,
|
|
114
|
-
});
|
|
95
|
+
onChange((productInfo?.quantity ?? 0) + 1);
|
|
115
96
|
clearErrors(`${product.id}` as const);
|
|
116
97
|
}}
|
|
117
98
|
min={0}
|
|
@@ -24,17 +24,19 @@ export const LeftBlock = ({
|
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
26
|
<div className={clsx("left-block", className)} {...props}>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
<div className="navigation">
|
|
28
|
+
{pageTitle && (
|
|
29
|
+
<>
|
|
30
|
+
{typeof pageTitle === "string" ? (
|
|
31
|
+
<div className="title">{pageTitle}</div>
|
|
32
|
+
) : (
|
|
33
|
+
pageTitle
|
|
34
|
+
)}
|
|
35
|
+
</>
|
|
36
|
+
)}
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)}
|
|
38
|
+
{component}
|
|
39
|
+
</div>
|
|
38
40
|
<div
|
|
39
41
|
className={clsx("left-block-container", childrenClassName)}
|
|
40
42
|
style={leftBlockStyles}
|