@licklist/design 0.44.486-dev.37 → 0.44.486-dev.39

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.
@@ -2,7 +2,8 @@
2
2
  type AvailabilityIndicatorProps = {
3
3
  booked: number;
4
4
  total: number;
5
+ notAvailable?: boolean;
5
6
  };
6
- export declare const AvailabilityIndicator: ({ booked, total, }: AvailabilityIndicatorProps) => JSX.Element;
7
+ export declare const AvailabilityIndicator: ({ booked, total, notAvailable, }: AvailabilityIndicatorProps) => JSX.Element;
7
8
  export {};
8
9
  //# sourceMappingURL=AvailabilityIndicator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AvailabilityIndicator.d.ts","sourceRoot":"","sources":["../../src/availability-indicator/AvailabilityIndicator.tsx"],"names":[],"mappings":";AA6BA,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,qBAAqB,uBAG/B,0BAA0B,gBAU5B,CAAC"}
1
+ {"version":3,"file":"AvailabilityIndicator.d.ts","sourceRoot":"","sources":["../../src/availability-indicator/AvailabilityIndicator.tsx"],"names":[],"mappings":";AA6BA,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,qBAAqB,qCAI/B,0BAA0B,gBAmB5B,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,a=require("react"),t=(e=a)&&"object"==typeof e&&"default"in e?e.default:e,l=require("react-i18next"),i=require("../assets/iframe/available.svg.js"),o=require("../assets/iframe/limited.svg.js"),s=require("../assets/iframe/soldOut.svg.js");exports.AvailabilityIndicator=function(e){var a=e.booked,r=e.total,n=l.useTranslation("Design").t,c=function(e,a){return e===a?{label:"soldOut",icon:t.createElement(s.ReactComponent,{className:"logo"})}:e/a<=.2?{label:"lotsOfSpace",icon:t.createElement(i.ReactComponent,{className:"logo"})}:e/a>=.8?{label:"limited",icon:t.createElement(o.ReactComponent,{className:"logo"})}:{label:"available",icon:t.createElement(i.ReactComponent,{className:"logo"})}}(a,r),m=c.icon,u=c.label;return t.createElement("div",{className:"availability-indicator"},m,t.createElement("div",null,n(u)))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,a=require("react"),t=(e=a)&&"object"==typeof e&&"default"in e?e.default:e,l=require("react-i18next"),i=require("../assets/iframe/available.svg.js"),o=require("../assets/iframe/limited.svg.js"),n=require("../assets/iframe/soldOut.svg.js");exports.AvailabilityIndicator=function(e){var a=e.booked,s=e.total,r=e.notAvailable,c=l.useTranslation("Design").t,m=function(e,a){return e===a?{label:"soldOut",icon:t.createElement(n.ReactComponent,{className:"logo"})}:e/a<=.2?{label:"lotsOfSpace",icon:t.createElement(i.ReactComponent,{className:"logo"})}:e/a>=.8?{label:"limited",icon:t.createElement(o.ReactComponent,{className:"logo"})}:{label:"available",icon:t.createElement(i.ReactComponent,{className:"logo"})}}(a,s),u=m.icon,v=m.label;return r?t.createElement("div",{className:"availability-indicator"},t.createElement(n.ReactComponent,{className:"logo"}),t.createElement("div",null,c("notAvailable"))):t.createElement("div",{className:"availability-indicator"},u,t.createElement("div",null,c(v)))};
@@ -13,5 +13,5 @@ export type DateTimeButtonProps<T = DateTime | string> = {
13
13
  };
14
14
  calendarView?: boolean;
15
15
  };
16
- export declare const DateTimeButton: <T extends string | DateTime>({ date, isDisabled, isSelected, onSelect, isOnlyTimeContainer, price, resources, calendarView, }: DateTimeButtonProps<T>) => JSX.Element;
16
+ export declare const DateTimeButton: <T extends string | DateTime>({ date, isDisabled: _isDisabled, isSelected, onSelect, isOnlyTimeContainer, price, resources, calendarView, }: DateTimeButtonProps<T>) => JSX.Element;
17
17
  //# sourceMappingURL=DateTimeButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeButton.d.ts","sourceRoot":"","sources":["../../src/date-time-button/DateTimeButton.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIjC,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG,QAAQ,GAAG,MAAM,IAAI;IACvD,IAAI,EAAE,CAAC,CAAC;IACR,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE;QACV,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,cAAc,wKA0C1B,CAAC"}
1
+ {"version":3,"file":"DateTimeButton.d.ts","sourceRoot":"","sources":["../../src/date-time-button/DateTimeButton.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIjC,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG,QAAQ,GAAG,MAAM,IAAI;IACvD,IAAI,EAAE,CAAC,CAAC;IACR,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE;QACV,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,cAAc,qLA+C1B,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"),i=e(require("react")),a=e(require("clsx")),r=require("../availability-indicator/AvailabilityIndicator.js"),n=require("./DateContent.js");exports.DateTimeButton=function(e){var l=e.date,c=e.isDisabled,s=e.isSelected,o=e.onSelect,d=e.isOnlyTimeContainer,u=e.price,b=e.resources,m=e.calendarView,y="string"==typeof l;return i.createElement("button",{type:"button",onClick:function(){return o(l)},disabled:c,className:a("date-time-button",c&&"disabled",s&&"selected",y&&"time-button",d&&"only-time-container",!y&&"today",m&&"calendar-view")},y?l:i.createElement(n.DateContent,{date:l,isDisabled:c,isSelected:s}),u&&!c&&i.createElement("div",{className:"price"},u),b&&i.createElement(r.AvailabilityIndicator,t.__assign({},b)))};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),i=e(require("react")),a=e(require("clsx")),n=require("../availability-indicator/AvailabilityIndicator.js"),r=require("./DateContent.js");exports.DateTimeButton=function(e){var l=e.date,o=e.isDisabled,c=e.isSelected,s=e.onSelect,d=e.isOnlyTimeContainer,u=e.price,b=e.resources,m=e.calendarView,y="string"==typeof l,v=o||b&&b.booked===b.total;return i.createElement("button",{type:"button",onClick:function(){return s(l)},disabled:v,className:a("date-time-button",v&&"disabled",c&&"selected",y&&"time-button",d&&"only-time-container",!y&&"today",m&&"calendar-view")},y?l:i.createElement(r.DateContent,{date:l,isDisabled:v,isSelected:c}),u&&!v&&i.createElement("div",{className:"price"},u),b&&i.createElement(n.AvailabilityIndicator,t.__assign({},b,{notAvailable:o})))};
@@ -2,7 +2,8 @@
2
2
  export interface ErrorModalProps {
3
3
  isOpen: boolean;
4
4
  onClose?: () => void;
5
+ message?: string;
5
6
  messageKey?: string;
6
7
  }
7
- export declare const ErrorModal: ({ isOpen, onClose, messageKey, }: ErrorModalProps) => JSX.Element;
8
+ export declare const ErrorModal: ({ isOpen, onClose, message, messageKey, }: ErrorModalProps) => JSX.Element;
8
9
  //# sourceMappingURL=ErrorModal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorModal.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/ErrorModal/ErrorModal.tsx"],"names":[],"mappings":";AASA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,qCAIpB,eAAe,gBA2CjB,CAAC"}
1
+ {"version":3,"file":"ErrorModal.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/ErrorModal/ErrorModal.tsx"],"names":[],"mappings":";AASA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,8CAKpB,eAAe,gBA4CjB,CAAC"}
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),r=require("react-i18next"),a=require("react-bootstrap"),o=require("../../../../static/Icon.js"),n=e(require("react-bootstrap/ModalHeader")),s=e(require("react-bootstrap/ModalTitle")),i=e(require("react-bootstrap/ModalBody")),c=e(require("react-bootstrap/Modal"));exports.ErrorModal=function(e){var l=e.isOpen,m=void 0!==l&&l,u=e.onClose,d=e.messageKey,f=r.useTranslation("Design").t,p=function(){u&&u()};return t.createElement(c,{show:m,onHide:p,animation:!1,centered:!0,contentClassName:"rounded"},t.createElement(n,{className:"align-items-center border-0"},t.createElement(s,{as:"h6"},f("formHasErrors")),t.createElement(a.Button,{variant:"danger",className:"btn-sm rounded",onClick:p},t.createElement(o.default,{type:"times",height:"1rem"}))),t.createElement(i,{className:"confirmation-modal-body"},t.createElement("div",{className:"d-flex m-5 justify-content-center manual-form-error"},d?f(d):t.createElement(r.Trans,{t:f,i18nKey:"pleaseSelectAtLeastFrom",values:{min:1,type:"item",from:"those categories"}}))))};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),r=require("react-i18next"),a=require("react-bootstrap"),o=require("../../../../static/Icon.js"),n=e(require("react-bootstrap/ModalHeader")),s=e(require("react-bootstrap/ModalTitle")),i=e(require("react-bootstrap/ModalBody")),c=e(require("react-bootstrap/Modal"));exports.ErrorModal=function(e){var l=e.isOpen,m=void 0!==l&&l,u=e.onClose,d=e.message,f=e.messageKey,p=r.useTranslation("Design").t,b=function(){u&&u()};return t.createElement(c,{show:m,onHide:b,animation:!1,centered:!0,contentClassName:"rounded"},t.createElement(n,{className:"align-items-center border-0"},t.createElement(s,{as:"h6"},p("formHasErrors")),t.createElement(a.Button,{variant:"danger",className:"btn-sm rounded",onClick:b},t.createElement(o.default,{type:"times",height:"1rem"}))),t.createElement(i,{className:"confirmation-modal-body"},t.createElement("div",{className:"d-flex m-5 justify-content-center manual-form-error"},d||(f?p(f):t.createElement(r.Trans,{t:p,i18nKey:"pleaseSelectAtLeastFrom",values:{min:1,type:"item",from:"those categories"}})))))};
@@ -1 +1 @@
1
- {"version":3,"file":"RecurrenceIntervalAndFrequencyInput.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AAIlE,UAAU,wCAAwC;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,IAAI,CACnB,eAAe,EACf,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CACpD,CAAC;IACF,YAAY,CAAC,EAAE,IAAI,CACjB,eAAe,EACf,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CACpD,CAAC;CACH;AAED,iBAAS,mCAAmC,CAAC,EAC3C,QAAgB,EAChB,OAAO,EACP,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,YAAY,GACb,EAAE,wCAAwC,eA6K1C;AAED,eAAe,mCAAmC,CAAC"}
1
+ {"version":3,"file":"RecurrenceIntervalAndFrequencyInput.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AAIlE,UAAU,wCAAwC;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,IAAI,CACnB,eAAe,EACf,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CACpD,CAAC;IACF,YAAY,CAAC,EAAE,IAAI,CACjB,eAAe,EACf,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CACpD,CAAC;CACH;AAED,iBAAS,mCAAmC,CAAC,EAC3C,QAAgB,EAChB,OAAO,EACP,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,YAAY,GACb,EAAE,wCAAwC,eA2K1C;AAED,eAAe,mCAAmC,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),a=require("react"),l=(e=a)&&"object"==typeof e&&"default"in e?e.default:e,r=require("@licklist/core/dist/Config"),n=require("react-i18next"),i=require("react-bootstrap"),o=require("react-hook-form"),m=require("luxon");exports.default=function(e){var s,u,d,c,f=e.disabled,D=void 0!==f&&f,v=e.minDate,E=e.startDateLabel,F=e.startTimeLabel,b=e.endDateLabel,p=e.endTimeLabel,g=e.startTimeRules,T=e.endTimeRules,h=e.isProductSet,C=n.useTranslation(["Design","Notification","App"]).t,_=o.useFormContext(),k=_.getValues,y=_.setValue,x=_.formState.errors,q=_.register,L=_.trigger,S=k("startDate"),V=k("endDate"),I=k("startTime"),R=k("endTime"),A=t.__read(a.useState(!Boolean(V)),2),B=A[0],G=A[1],N=h&&B;return a.useEffect((function(){S&&V&&L("endDate")}),[S]),a.useEffect((function(){I&&R&&L("endTime")}),[I]),l.createElement(l.Fragment,null,l.createElement(i.Row,null,l.createElement(i.Col,{xs:12,sm:6},l.createElement(i.Form.Group,null,l.createElement(i.Form.Label,null,null!=E?E:C("Design:fromDate")),l.createElement(i.Form.Control,t.__assign({type:"date"},q("startDate",{required:!0}),{defaultValue:S,className:S&&"date-input-with-value",disabled:D,min:v,isInvalid:Boolean(x.startDate)})),l.createElement(i.Form.Control.Feedback,{type:"invalid"},null===(s=x.startDate)||void 0===s?void 0:s.message))),l.createElement(i.Col,{xs:12,sm:6},l.createElement(i.Form.Group,null,l.createElement(i.Form.Label,null,null!=b?b:C("Design:toDate")),l.createElement(i.Form.Control,t.__assign({type:"date"},q("endDate",{required:!N,validate:function(e){if(!S||!e)return!0;var t=m.DateTime.fromFormat(S,r.DATE_FORMAT);return m.DateTime.fromFormat(e,r.DATE_FORMAT).diff(t,["days"]).days>=0||"".concat(C("Validation:fieldLaterDate",{attribute:C("Design:endDateSmall"),min:C("Design:startDateSmall")}))}}),{defaultValue:V,className:V&&"date-input-with-value",disabled:D||N,min:S||void 0,isInvalid:Boolean(x.endDate)})),l.createElement(i.Form.Control.Feedback,{type:"invalid"},null===(u=x.endDate)||void 0===u?void 0:u.message)),h&&l.createElement(i.Form.Group,{className:"custom-checkbox"},l.createElement(i.Form.Check,{custom:!0,type:"checkbox"},l.createElement(i.Form.Check.Input,{type:"checkbox",className:"checkbox-input",checked:B,onChange:function(){y("endDate",""),G((function(e){return!e}))}}),l.createElement(i.Form.Check.Label,null,C("Design:infiniteProductSet")))))),l.createElement(i.Row,null,l.createElement(i.Col,{xs:12,sm:6},l.createElement(i.Form.Group,null,l.createElement(i.Form.Label,null,null!=F?F:C("Design:availableFrom")),l.createElement(i.Form.Control,t.__assign({type:"time"},q("startTime",t.__assign({required:!1},g)),{placeholder:"hh:mm",defaultValue:I,disabled:D,isInvalid:Boolean(x.startTime)})),l.createElement(i.Form.Control.Feedback,{type:"invalid"},null===(d=x.startTime)||void 0===d?void 0:d.message))),l.createElement(i.Col,{xs:12,sm:6},l.createElement(i.Form.Group,null,l.createElement(i.Form.Label,null,null!=p?p:C("Design:availableTo")),l.createElement(i.Form.Control,t.__assign({type:"time"},q("endTime",t.__assign({required:!1,validate:function(e){var t;if(!I||!e)return!0;var a=m.DateTime.fromISO(I),l=m.DateTime.fromISO(e);return(null===(t=null==l?void 0:l.diff(a,["minutes"]))||void 0===t?void 0:t.minutes)>=0||"".concat(C("Validation:fieldLaterDate",{attribute:C("Design:endTimeSmall"),min:C("Design:startTimeSmall")}))}},T)),{placeholder:"hh:mm",defaultValue:R,disabled:D,isInvalid:Boolean(x.endTime)})),l.createElement(i.Form.Control.Feedback,{type:"invalid"},null===(c=x.endTime)||void 0===c?void 0:c.message)))))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),a=require("react"),l=(e=a)&&"object"==typeof e&&"default"in e?e.default:e,r=require("@licklist/core/dist/Config"),n=require("react-i18next"),i=require("react-bootstrap"),o=require("react-hook-form"),m=require("luxon");exports.default=function(e){var s,u,d,c,f=e.disabled,D=void 0!==f&&f,v=e.minDate,E=e.startDateLabel,F=e.startTimeLabel,b=e.endDateLabel,p=e.endTimeLabel,g=e.startTimeRules,T=e.endTimeRules,h=e.isProductSet,C=n.useTranslation(["Design","Notification","App"]).t,_=o.useFormContext(),k=_.getValues,y=_.setValue,x=_.formState.errors,q=_.register,L=_.trigger,S=k("startDate"),V=k("endDate"),I=k("startTime"),R=k("endTime"),A=t.__read(a.useState(!V),2),G=A[0],N=A[1],O=h&&G;return a.useEffect((function(){S&&V&&L("endDate")}),[S]),a.useEffect((function(){I&&R&&L("endTime")}),[I]),l.createElement(l.Fragment,null,l.createElement(i.Row,null,l.createElement(i.Col,{xs:12,sm:6},l.createElement(i.Form.Group,null,l.createElement(i.Form.Label,null,null!=E?E:C("Design:fromDate")),l.createElement(i.Form.Control,t.__assign({type:"date"},q("startDate",{required:!0}),{defaultValue:S,className:S&&"date-input-with-value",disabled:D,min:v,isInvalid:Boolean(x.startDate)})),l.createElement(i.Form.Control.Feedback,{type:"invalid"},null===(s=x.startDate)||void 0===s?void 0:s.message))),l.createElement(i.Col,{xs:12,sm:6},l.createElement(i.Form.Group,null,l.createElement(i.Form.Label,null,null!=b?b:C("Design:toDate")),l.createElement(i.Form.Control,t.__assign({type:"date"},q("endDate",{required:!O,validate:function(e){if(!S||!e)return!0;var t=m.DateTime.fromFormat(S,r.DATE_FORMAT);return m.DateTime.fromFormat(e,r.DATE_FORMAT).diff(t,["days"]).days>=0||"".concat(C("Validation:fieldLaterDate",{attribute:C("Design:endDateSmall"),min:C("Design:startDateSmall")}))}}),{defaultValue:V,className:V&&"date-input-with-value",disabled:D||O,min:S||void 0,isInvalid:Boolean(x.endDate)})),l.createElement(i.Form.Control.Feedback,{type:"invalid"},null===(u=x.endDate)||void 0===u?void 0:u.message)),h&&l.createElement(i.Form.Group,{className:"custom-checkbox"},l.createElement(i.Form.Check,{custom:!0,type:"checkbox"},l.createElement(i.Form.Check.Input,{type:"checkbox",className:"checkbox-input",checked:G,onChange:function(){y("endDate",""),N((function(e){return!e}))}}),l.createElement(i.Form.Check.Label,null,C("Design:infiniteProductSet")))))),l.createElement(i.Row,null,l.createElement(i.Col,{xs:12,sm:6},l.createElement(i.Form.Group,null,l.createElement(i.Form.Label,null,null!=F?F:C("Design:availableFrom")),l.createElement(i.Form.Control,t.__assign({type:"time"},q("startTime",t.__assign({required:!1},g)),{placeholder:"hh:mm",defaultValue:I,disabled:D,isInvalid:Boolean(x.startTime)})),l.createElement(i.Form.Control.Feedback,{type:"invalid"},null===(d=x.startTime)||void 0===d?void 0:d.message))),l.createElement(i.Col,{xs:12,sm:6},l.createElement(i.Form.Group,null,l.createElement(i.Form.Label,null,null!=p?p:C("Design:availableTo")),l.createElement(i.Form.Control,t.__assign({type:"time"},q("endTime",t.__assign({required:!1,validate:function(e){var t;if(!I||!e)return!0;var a=m.DateTime.fromISO(I),l=m.DateTime.fromISO(e);return(null===(t=null==l?void 0:l.diff(a,["minutes"]))||void 0===t?void 0:t.minutes)>=0||"".concat(C("Validation:fieldLaterDate",{attribute:C("Design:endTimeSmall"),min:C("Design:startTimeSmall")}))}},T)),{placeholder:"hh:mm",defaultValue:R,disabled:D,isInvalid:Boolean(x.endTime)})),l.createElement(i.Form.Control.Feedback,{type:"invalid"},null===(c=x.endTime)||void 0===c?void 0:c.message)))))};
@@ -1 +1 @@
1
- {"version":3,"file":"RecurringDatePickerInput.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/RecurringDatePickerInput.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAsB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACrE,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAelD,OAAO,EAAyB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAIpE,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC;IACxD,QAAQ,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC;IAC1D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,8BAA8B;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,wBAAwB,CAAC,EACvC,QAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,gBAAkC,EAClC,8BAAsC,EACtC,QAAQ,EACR,OAAO,EACP,YAAY,GACb,EAAE,iBAAiB,CAAC,6BAA6B,CAAC,eA4LlD"}
1
+ {"version":3,"file":"RecurringDatePickerInput.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/RecurringDatePickerInput.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAsB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACrE,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAelD,OAAO,EAAyB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAIpE,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC;IACxD,QAAQ,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC;IAC1D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,8BAA8B;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,wBAAwB,CAAC,EACvC,QAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,gBAAkC,EAClC,8BAAsC,EACtC,QAAQ,EACR,OAAO,EACP,YAAY,GACb,EAAE,iBAAiB,CAAC,6BAA6B,CAAC,eA2LlD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.486-dev.37",
3
+ "version": "0.44.486-dev.39",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -30,15 +30,26 @@ const getIconsAndLabels = (
30
30
  type AvailabilityIndicatorProps = {
31
31
  booked: number;
32
32
  total: number;
33
+ notAvailable?: boolean;
33
34
  };
34
35
 
35
36
  export const AvailabilityIndicator = ({
36
37
  booked,
37
38
  total,
39
+ notAvailable,
38
40
  }: AvailabilityIndicatorProps) => {
39
41
  const { t } = useTranslation("Design");
40
42
  const { icon, label } = getIconsAndLabels(booked, total);
41
43
 
44
+ if (notAvailable) {
45
+ return (
46
+ <div className="availability-indicator">
47
+ <SoldOutIcon className="logo" />
48
+ <div>{t("notAvailable")}</div>
49
+ </div>
50
+ );
51
+ }
52
+
42
53
  return (
43
54
  <div className="availability-indicator">
44
55
  {icon}
@@ -20,7 +20,7 @@ export type DateTimeButtonProps<T = DateTime | string> = {
20
20
 
21
21
  export const DateTimeButton = <T extends DateTime | string>({
22
22
  date,
23
- isDisabled,
23
+ isDisabled: _isDisabled,
24
24
  isSelected,
25
25
  onSelect,
26
26
  isOnlyTimeContainer,
@@ -30,6 +30,9 @@ export const DateTimeButton = <T extends DateTime | string>({
30
30
  }: DateTimeButtonProps<T>) => {
31
31
  const isTimeVariant = typeof date === "string";
32
32
 
33
+ const isDisabled =
34
+ _isDisabled || (resources && resources.booked === resources.total);
35
+
33
36
  return (
34
37
  <button
35
38
  type="button"
@@ -57,7 +60,9 @@ export const DateTimeButton = <T extends DateTime | string>({
57
60
 
58
61
  {price && !isDisabled && <div className="price">{price}</div>}
59
62
 
60
- {resources && <AvailabilityIndicator {...resources} />}
63
+ {resources && (
64
+ <AvailabilityIndicator {...resources} notAvailable={_isDisabled} />
65
+ )}
61
66
  </button>
62
67
  );
63
68
  };
@@ -10,12 +10,14 @@ import Icon from "../../../../static/Icon";
10
10
  export interface ErrorModalProps {
11
11
  isOpen: boolean;
12
12
  onClose?: () => void;
13
+ message?: string;
13
14
  messageKey?: string;
14
15
  }
15
16
 
16
17
  export const ErrorModal = ({
17
18
  isOpen = false,
18
19
  onClose,
20
+ message,
19
21
  messageKey,
20
22
  }: ErrorModalProps) => {
21
23
  const { t } = useTranslation("Design");
@@ -47,15 +49,16 @@ export const ErrorModal = ({
47
49
  </ModalHeader>
48
50
  <ModalBody className="confirmation-modal-body">
49
51
  <div className="d-flex m-5 justify-content-center manual-form-error">
50
- {messageKey ? (
51
- t(messageKey)
52
- ) : (
53
- <Trans
54
- t={t}
55
- i18nKey="pleaseSelectAtLeastFrom"
56
- values={{ min: 1, type: "item", from: "those categories" }}
57
- />
58
- )}
52
+ {message ||
53
+ (messageKey ? (
54
+ t(messageKey)
55
+ ) : (
56
+ <Trans
57
+ t={t}
58
+ i18nKey="pleaseSelectAtLeastFrom"
59
+ values={{ min: 1, type: "item", from: "those categories" }}
60
+ />
61
+ ))}
59
62
  </div>
60
63
  </ModalBody>
61
64
  </Modal>
@@ -50,9 +50,7 @@ function RecurrenceIntervalAndFrequencyInput({
50
50
  const startTime = getValues("startTime");
51
51
  const endTime = getValues("endTime");
52
52
 
53
- const [withOutEndDate, setWithOutEndDate] = useState<boolean>(
54
- !Boolean(endDate)
55
- );
53
+ const [withOutEndDate, setWithOutEndDate] = useState<boolean>(!endDate);
56
54
  const isProductSetWithoutEndDate = isProductSet && withOutEndDate;
57
55
 
58
56
  const handleWithoutEndDate = () => {
@@ -110,7 +110,6 @@ export function RecurringDatePickerInput({
110
110
  : "";
111
111
  const endDateNextState = nextState?.endDate ?? "";
112
112
 
113
-
114
113
  const rrule = RRule.optionsToString({
115
114
  // @TODO: investigate if we need these fields
116
115
  // dtstart: getDateTimeObject(startDate, startTime).toJSDate(),