@licklist/design 0.58.4-dev.1 → 0.58.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/iframe/event/event-card/IframeEventCard.d.ts +1 -2
  2. package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
  3. package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
  4. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
  5. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
  6. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  7. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +1 -1
  8. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
  9. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
  10. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
  11. package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/product-set/card/ProductSetCard.d.ts +1 -2
  14. package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
  15. package/dist/product-set/card/ProductSetCard.js +1 -1
  16. package/dist/product-set/control/ProductSetControl.d.ts +1 -2
  17. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  18. package/dist/product-set/control/ProductSetControl.js +1 -1
  19. package/dist/product-set/control/TutorialGifCard.d.ts +1 -2
  20. package/dist/product-set/control/TutorialGifCard.d.ts.map +1 -1
  21. package/dist/product-set/control/TutorialGifCard.js +1 -1
  22. package/dist/product-set/form/ProductCategoriesControl.d.ts +1 -2
  23. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  24. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  25. package/dist/product-set/form/ProductSetForm.d.ts +2 -7
  26. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  27. package/dist/product-set/form/ProductSetForm.js +1 -1
  28. package/dist/product-set/form/ProductsControl.d.ts +1 -2
  29. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  30. package/dist/product-set/form/ProductsControl.js +1 -1
  31. package/dist/product-set/form/StepsControl.d.ts +1 -2
  32. package/dist/product-set/form/StepsControl.d.ts.map +1 -1
  33. package/dist/product-set/form/StepsControl.js +1 -1
  34. package/dist/product-set/form/SubProductsControl.d.ts +1 -2
  35. package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
  36. package/dist/product-set/form/SubProductsControl.js +1 -1
  37. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts +1 -2
  38. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
  39. package/dist/product-set/hooks/useSortableTreeFunctions.js +1 -1
  40. package/dist/product-set/item/CreateProductSetItem.d.ts +1 -2
  41. package/dist/product-set/item/CreateProductSetItem.d.ts.map +1 -1
  42. package/dist/product-set/item/CreateProductSetItem.js +1 -1
  43. package/dist/product-set/product/ProductControl.d.ts +1 -2
  44. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  45. package/dist/product-set/product/ProductControl.js +1 -1
  46. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts +2 -4
  47. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
  48. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.js +1 -1
  49. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts +0 -1
  50. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
  51. package/dist/product-set/product/quantity/ProductQuantityControl.js +1 -1
  52. package/dist/product-set/product-category/ProductCategoryControl.d.ts +1 -2
  53. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  54. package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
  55. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +0 -2
  56. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
  57. package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
  58. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  59. package/dist/sortable-list/SortableList.d.ts +1 -2
  60. package/dist/sortable-list/SortableList.d.ts.map +1 -1
  61. package/dist/sortable-list/SortableList.js +1 -1
  62. package/dist/sortable-tree/SortableTreeItem.d.ts +1 -3
  63. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  64. package/dist/sortable-tree/SortableTreeItem.js +1 -1
  65. package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
  66. package/dist/static/manual-date-picker/constants/index.d.ts +1 -4
  67. package/dist/static/manual-date-picker/constants/index.d.ts.map +1 -1
  68. package/dist/static/manual-date-picker/constants/index.js +1 -1
  69. package/dist/static/manual-date-picker/utils/index.d.ts +0 -4
  70. package/dist/static/manual-date-picker/utils/index.d.ts.map +1 -1
  71. package/dist/static/manual-date-picker/utils/index.js +1 -1
  72. package/dist/styles/availability-indicator/AvailabilityIndicator.scss +0 -10
  73. package/dist/styles/iframe-events/Card.scss +8 -24
  74. package/dist/styles/iframe-events/PoweredBy.scss +2 -2
  75. package/dist/styles/iframe-order-process/IframeOrderProcess.scss +2 -0
  76. package/dist/styles/iframe-page/Page.scss +0 -1
  77. package/dist/styles/iframe-page/PageBody.scss +11 -32
  78. package/dist/styles/iframe-page/PageHeader.scss +39 -41
  79. package/dist/styles/product-set/EditVenueMapSetModal.scss +1 -1
  80. package/dist/styles/sales/BookingResults.scss +1 -1
  81. package/package.json +3 -3
  82. package/src/calendar/Calendar.stories.tsx +2 -9
  83. package/src/iframe/event/event-card/IframeEventCard.stories.tsx +0 -1
  84. package/src/iframe/event/event-card/IframeEventCard.tsx +8 -7
  85. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +10 -30
  86. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +12 -8
  87. package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +1 -3
  88. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -6
  89. package/src/product-set/card/ProductSetCard.tsx +1 -10
  90. package/src/product-set/control/ProductSetControl.tsx +24 -46
  91. package/src/product-set/control/TutorialGifCard.tsx +3 -11
  92. package/src/product-set/form/ProductCategoriesControl.tsx +1 -12
  93. package/src/product-set/form/ProductSetForm.tsx +1 -10
  94. package/src/product-set/form/ProductsControl.tsx +0 -10
  95. package/src/product-set/form/StepsControl.tsx +2 -8
  96. package/src/product-set/form/SubProductsControl.tsx +0 -3
  97. package/src/product-set/hooks/useSortableTreeFunctions.ts +0 -4
  98. package/src/product-set/item/CreateProductSetItem.tsx +0 -3
  99. package/src/product-set/product/ProductControl.tsx +12 -23
  100. package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +2 -10
  101. package/src/product-set/product/quantity/ProductQuantityControl.tsx +3 -4
  102. package/src/product-set/product-category/ProductCategoryControl.tsx +8 -12
  103. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +1 -4
  104. package/src/sales/booking/results/components/ResultCard.tsx +3 -0
  105. package/src/sortable-list/SortableList.tsx +0 -3
  106. package/src/sortable-tree/SortableTreeItem.tsx +1 -7
  107. package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
  108. package/src/static/manual-date-picker/constants/index.ts +2 -6
  109. package/src/static/manual-date-picker/utils/index.ts +0 -11
  110. package/src/static/switch/BooleanSwitch.tsx +1 -1
  111. package/src/styles/availability-indicator/AvailabilityIndicator.scss +0 -10
  112. package/src/styles/iframe-events/Card.scss +8 -24
  113. package/src/styles/iframe-events/PoweredBy.scss +2 -2
  114. package/src/styles/iframe-order-process/IframeOrderProcess.scss +2 -0
  115. package/src/styles/iframe-page/Page.scss +0 -1
  116. package/src/styles/iframe-page/PageBody.scss +11 -32
  117. package/src/styles/iframe-page/PageHeader.scss +39 -41
  118. package/src/styles/product-set/EditVenueMapSetModal.scss +1 -1
  119. package/src/styles/sales/BookingResults.scss +1 -1
  120. package/dist/product-set/control/DateInput.d.ts +0 -17
  121. package/dist/product-set/control/DateInput.d.ts.map +0 -1
  122. package/dist/product-set/control/DateInput.js +0 -1
  123. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts +0 -11
  124. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts.map +0 -1
  125. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.js +0 -1
  126. package/dist/recurring-date-picker-input/DatePickerInput.d.ts +0 -19
  127. package/dist/recurring-date-picker-input/DatePickerInput.d.ts.map +0 -1
  128. package/dist/recurring-date-picker-input/DatePickerInput.js +0 -1
  129. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts +0 -15
  130. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +0 -1
  131. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.js +0 -1
  132. package/src/product-set/control/DateInput.tsx +0 -311
  133. package/src/product-set/control/ProductSetRecurrenceOverridesControl.tsx +0 -63
  134. package/src/recurring-date-picker-input/DatePickerInput.tsx +0 -93
  135. package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +0 -137
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import { Modifier } from "@popperjs/core";
3
- import { ProductSetRecurrence } from "@licklist/core/dist/DataMapper/Product/ProductSetRecurrenceDataMapper";
4
- import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
5
- export interface DateAndRecurrenceInputValues {
6
- menuRecurrences?: Partial<ProductSetRecurrence>[];
7
- }
8
- interface DateAndRecurrenceInputProps {
9
- isEventEditProductSet?: boolean;
10
- workHours?: WorkHour[];
11
- providerHasBookingManagement: boolean;
12
- isLoading?: boolean;
13
- }
14
- export declare const DateInput: ({ isEventEditProductSet, isLoading, workHours, providerHasBookingManagement, }: DateAndRecurrenceInputProps) => JSX.Element;
15
- export declare const sameWidthPopperModifier: Modifier<"sameWidth", Record<string, unknown>>;
16
- export {};
17
- //# sourceMappingURL=DateInput.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/DateInput.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAO1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uEAAuE,CAAC;AAI7G,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AActF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;CACnD;AAED,UAAU,2BAA2B;IACnC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,4BAA4B,EAAE,OAAO,CAAC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,SAAS,mFAKnB,2BAA2B,gBAkP7B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAC5C,WAAW,EACX,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsBxB,CAAC"}
@@ -1 +0,0 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=require("react"),n=e(t),i=require("react-i18next"),a=require("react-bootstrap"),o=require("../../static/Icon.js"),u=require("react-hook-form"),l=require("@react-aria/utils"),s=require("react-use"),c=require("luxon");require("../../static/index.js");var d=require("../../modals/confirmation/ConfirmModal.js"),m=require("rrule"),v=e(m),f=require("@licklist/core/dist/Config/Date"),p=require("../../zone/form/components/AvailableTimesControl.js"),g=require("../../recurring-date-picker-input/DatePickerInput.js"),T=require("./ProductSetRecurrenceOverridesControl.js"),b={name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var r=e.state,t={width:"".concat(r.rects.reference.width+4,"px"),marginLeft:"-2px",maxWidth:"unset"};Object.assign(r.styles.popper,t)},effect:function(e){var r=e.state,t=r.elements.reference.getBoundingClientRect().width,n={width:"".concat(t,"px"),maxWidth:"unset"};Object.assign(r.elements.popper.style,n)}};exports.DateInput=function(e){var E,D,x,h,q=e.isEventEditProductSet,R=e.isLoading,_=e.workHours,y=e.providerHasBookingManagement,I=u.useFormContext(),O=I.control,M=I.register,S=I.formState.errors,w=I.getValues,C=I.setValue,k=I.clearErrors,F=u.useFieldArray({name:"menuRecurrences",control:O,keyName:"_id"}),A=F.fields,N=F.append,j=F.update,P=r.__read(t.useState(!1),2),V=P[0],L=P[1],W=t.useRef(),B=r.__read(t.useState({index:null,values:null}),2),H=B[0],z=B[1],J=function(){return z({index:null,values:null})},G=t.useRef();s.useClickAway(G,(function(e){var r,t,n;d.CONFIRM_MODAL_ACTIONS.includes(null===(n=null===(t=null===(r=e.target)||void 0===r?void 0:r.attributes)||void 0===t?void 0:t.getNamedItem("data-id"))||void 0===n?void 0:n.value)||(L(!1),J())}));var K=l.useId(),U=i.useTranslation("Design").t,Y=function(){A.length>=1||(J(),L((function(e){return!e})))};return n.createElement(a.Form.Group,null,n.createElement(a.Form.Label,null,U(q?"whenOverridesAvailable":"productSetAvailable")),n.createElement(a.OverlayTrigger,{show:V,overlay:n.createElement(a.Popover,{id:K,className:"rounded"},n.createElement(a.Popover.Content,{className:"shadow-lg rounded",ref:G},n.createElement(g.DatePickerInput,{defaultValues:H.values,onChange:function(e){return r.__awaiter(void 0,void 0,void 0,(function(){var t,n,i,a,o,u,l,s,d,p,g,T;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,null===(s=W.current)||void 0===s?void 0:s.trigger()];case 1:return t=r.sent(),(null==e?void 0:e.startTime)&&(null==e?void 0:e.endTime)&&t&&(n=c.DateTime.fromISO(e.startTime),i=c.DateTime.fromISO(e.endTime),a=W.current.getValues().availableTimes,!a.every((function(e){var r=c.DateTime.fromFormat(e,f.TIME_FORMAT);return r.diff(n,"minutes").minutes>=0&&r.diff(i,"minutes").minutes<=0})))?(W.current.setError("availableTimes",{message:U("Validation:fieldTimeBetween",{attribute:U("Design:startTimesSmall"),min:n.toFormat(f.TIME_FORMAT),max:i.toFormat(f.TIME_FORMAT)})}),[2]):(o=v.optionsToString({dtstart:c.DateTime.fromISO(e.startDate).toJSDate(),until:c.DateTime.fromISO(e.startDate).toJSDate(),byweekday:[],freq:m.Frequency.DAILY,tzid:f.TIMEZONE}).replace("RRULE:",""),u=(null===(p=null===(d=null==W?void 0:W.current)||void 0===d?void 0:d.getValues())||void 0===p?void 0:p.availableTimes)||null,l={rrule:o,startDate:e.startDate,endDate:e.startDate,startTime:e.startTime,endTime:e.endTime,availableTimes:u},(null===(g=H.values)||void 0===g?void 0:g.id)&&(l.id=null===(T=H.values)||void 0===T?void 0:T.id),null!==H.index?j(H.index,l):N(l),L((function(){return!1})),J(),[2])}}))}))},onDelete:function(){var e=H.index;L(!1),J(),setTimeout((function(){var r=w().menuRecurrences;C("menuRecurrences",(void 0===r?[]:r).filter((function(r,t){return t!==e})))}),100)}},y&&n.createElement(p.AvailableTimesControl,{workHours:_,isLoading:R,ref:W,defaultValues:[],errorMessage:null===(x=null===(D=null===(E=null==S?void 0:S.menuRecurrences)||void 0===E?void 0:E["".concat(null==H?void 0:H.index)])||void 0===D?void 0:D.availableTimes)||void 0===x?void 0:x.message,clearErrorMessage:function(){return k("menuRecurrences.".concat(null==H?void 0:H.index,".availableTimes"))}})))),trigger:"click",placement:"bottom",popperConfig:{modifiers:[b]}},n.createElement("div",{className:"product-set-recurrences"},A.map((function(e,r){var t,i,a;return n.createElement(T.ProductSetRecurrenceOverridesControl,{key:e._id,menuRecurrence:e,onEdit:function(){return function(e,r){J(),setTimeout((function(){z({index:r,values:e}),L((function(){return!0}))}),100)}(e,r)},errorMessage:null===(a=null===(i=null===(t=null==S?void 0:S.menuRecurrences)||void 0===t?void 0:t["".concat(r)])||void 0===i?void 0:i.availableTimes)||void 0===a?void 0:a.message})})),n.createElement("div",{className:"product-set-recurrence-icon-wrapper",role:"button",tabIndex:0,onClick:Y,onKeyDown:Y},n.createElement(o.default,{type:"plus-circle",height:"1rem",className:"product-set-recurrence-icon-add mr-2"}),U("addDates")),n.createElement(a.Form.Control,r.__assign({type:"hidden"},M("menuRecurrences",{required:{value:!0,message:U("Validation:fieldMinNumber",{attribute:U("dates"),min:1})}}))),n.createElement("div",{className:"manual-form-error"},null===(h=S.menuRecurrences)||void 0===h?void 0:h.message))))},exports.sameWidthPopperModifier=b;
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { ProductSetRecurrence } from "@licklist/core/dist/DataMapper/Product/ProductSetRecurrenceDataMapper";
3
- export interface ProductSetRecurrenceControlProps {
4
- menuRecurrence?: {
5
- _id: string;
6
- } & Partial<ProductSetRecurrence>;
7
- onEdit?: (onEdit: Partial<ProductSetRecurrence>) => void;
8
- errorMessage?: string;
9
- }
10
- export declare const ProductSetRecurrenceOverridesControl: ({ menuRecurrence, onEdit, errorMessage, }: ProductSetRecurrenceControlProps) => JSX.Element;
11
- //# sourceMappingURL=ProductSetRecurrenceOverridesControl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProductSetRecurrenceOverridesControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/ProductSetRecurrenceOverridesControl.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uEAAuE,CAAC;AAI7G,MAAM,WAAW,gCAAgC;IAC/C,cAAc,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAC;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,oCAAoC,8CAI9C,gCAAgC,gBA8ClC,CAAC"}
@@ -1 +0,0 @@
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,a=require("../../static/Icon.js");require("../../static/index.js");var c=require("react-intl");exports.ProductSetRecurrenceOverridesControl=function(e){var r=e.menuRecurrence,n=e.onEdit,l=e.errorMessage,s=c.useIntl().formatDate;return t.createElement("div",{className:"sortable-tree-root flex-column",role:"button",tabIndex:0},t.createElement("div",{key:r.rrule,className:"product-set-recurrence d-flex flex-column mr-0 mb-3 p-3 px-4 flex-grow-1"},t.createElement("span",{className:"d-flex flex-row align-items-center"},t.createElement(a.default,{type:"calendar",height:"1rem",className:"product-set-recurrence-icon-calendar"}),t.createElement("span",{className:"product-set-recurrence-title d-flex flex-grow-1"},s(r.startDate,{dateStyle:"medium"})," "),t.createElement("div",{className:"d-inline-flex",role:"button",tabIndex:0,onClick:function(){return n(r)},onKeyDown:function(){return n(r)}},t.createElement(a.default,{type:"ellipsis-h",height:"1rem",className:"product-set-recurrence-icon-more"}))),t.createElement("span",{className:"product-set-recurrence-description"},s(r.startDate,{dateStyle:"medium"})," ")),t.createElement("div",{className:"manual-form-error ".concat(!l&&"d-none")},l))};
@@ -1,19 +0,0 @@
1
- import { PropsWithChildren } from "react";
2
- import { Frequency } from "rrule";
3
- import { RecurringDatePickerInputValues } from "./RecurringDatePickerInput";
4
- export interface RecurringDatePickerInputProps {
5
- disabled?: boolean;
6
- defaultValues?: Partial<RecurringDatePickerInputValues>;
7
- onChange: (state: RecurringDatePickerInputValues) => void;
8
- onDelete: () => void;
9
- initialFrequency?: Frequency;
10
- setInitialStartDateAfterSelect?: boolean;
11
- minDate?: string;
12
- }
13
- export interface DatePickerInputValues {
14
- startDate: string;
15
- startTime: string;
16
- endTime: string;
17
- }
18
- export declare function DatePickerInput({ disabled, onChange, onDelete, defaultValues, children, minDate, }: PropsWithChildren<RecurringDatePickerInputProps>): JSX.Element;
19
- //# sourceMappingURL=DatePickerInput.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DatePickerInput.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/DatePickerInput.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASlC,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAG5E,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC;IACxD,QAAQ,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC;IAC1D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,OAAO,GACR,EAAE,iBAAiB,CAAC,6BAA6B,CAAC,eAwDlD"}
@@ -1 +0,0 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),n=e(require("react")),r=require("react-i18next"),i=e(require("react-bootstrap/Button")),a=require("react-bootstrap"),l=require("react-hook-form"),o=require("luxon"),u=require("../modals/confirmation/ConfirmModal.js");require("../modals/dialog/Dialog.js"),require("../modals/dialog/DialogContext.js");var d=require("../product-set/elements/DeleteFieldButton.js"),s=require("@licklist/core/dist/Config/Date"),m=require("./RecurrenceAndFrequencyInput.js");exports.DatePickerInput=function(e){var c,f,v,D=e.disabled,p=void 0!==D&&D,g=e.onChange,q=e.onDelete,b=e.defaultValues,T=e.children,_=e.minDate,E=r.useTranslation(["Design"]).t,F=l.useForm({defaultValues:{startDate:null!==(c=null==b?void 0:b.startDate)&&void 0!==c?c:"",startTime:null!==(f=null==b?void 0:b.startTime)&&void 0!==f?f:"",endTime:null!==(v=null==b?void 0:b.endTime)&&void 0!==v?v:""},mode:"onChange"}),j=F.handleSubmit,x=function(e){var n=(null==e?void 0:e.endTime)?o.DateTime.fromISO(null==e?void 0:e.endTime).toFormat(s.TIME_FULL_FORMAT):"";g(t.__assign(t.__assign({},e),{endTime:n}))};return n.createElement(l.FormProvider,t.__assign({},F),n.createElement(a.Form,{noValidate:!0,onSubmit:function(e){return e.preventDefault(),e.stopPropagation(),j(x)(e)}},n.createElement(m.default,{disabled:p,minDate:_}),T,n.createElement("div",{className:"d-inline-flex align-items-center w-100"},n.createElement(i,{type:"submit"},E("Design:apply")),b&&n.createElement("div",{className:"d-flex justify-content-end delete-btn"},n.createElement(u.ConfirmModal,null,(function(e){return n.createElement(d.DeleteFieldButton,{onDelete:function(){return e(q)}})}))))))};
@@ -1,15 +0,0 @@
1
- /// <reference types="react" />
2
- import { RegisterOptions } from "react-hook-form";
3
- interface RecurrenceIntervalAndFrequencyInputProps {
4
- disabled?: boolean;
5
- minDate?: string;
6
- startDateLabel?: string;
7
- startTimeLabel?: string;
8
- endDateLabel?: string;
9
- endTimeLabel?: string;
10
- startTimeRules?: Pick<RegisterOptions, "max" | "min" | "validate" | "required" | "pattern">;
11
- endTimeRules?: Pick<RegisterOptions, "max" | "min" | "validate" | "required" | "pattern">;
12
- }
13
- declare function RecurrenceAndFrequencyInput({ disabled, minDate, startDateLabel, startTimeLabel, endTimeLabel, startTimeRules, endTimeRules, }: RecurrenceIntervalAndFrequencyInputProps): JSX.Element;
14
- export default RecurrenceAndFrequencyInput;
15
- //# sourceMappingURL=RecurrenceAndFrequencyInput.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RecurrenceAndFrequencyInput.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AAGlE,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,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,2BAA2B,CAAC,EACnC,QAAgB,EAChB,OAAO,EACP,cAAc,EACd,cAAc,EACd,YAAY,EACZ,cAAc,EACd,YAAY,GACb,EAAE,wCAAwC,eAsG1C;AAED,eAAe,2BAA2B,CAAC"}
@@ -1 +0,0 @@
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("react-i18next"),i=require("react-bootstrap"),n=require("react-hook-form"),o=require("luxon");exports.default=function(e){var m,s,u,d=e.disabled,c=void 0!==d&&d,v=e.minDate,f=e.startDateLabel,b=e.startTimeLabel,g=e.endTimeLabel,p=e.startTimeRules,E=e.endTimeRules,T=r.useTranslation(["Design","Notification","App"]).t,F=n.useFormContext(),D=F.getValues,_=F.formState.errors,C=F.register,q=F.trigger,h=D("startDate"),x=D("startTime"),y=D("endTime");return a.useEffect((function(){x&&y&&q("endTime")}),[x]),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!=f?f:T("Design:fromDate")),l.createElement(i.Form.Control,t.__assign({type:"date"},C("startDate",{required:!0}),{defaultValue:h,className:h&&"date-input-with-value",disabled:c,min:v,isInvalid:Boolean(_.startDate)})),l.createElement(i.Form.Control.Feedback,{type:"invalid"},null===(m=_.startDate)||void 0===m?void 0:m.message)))),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!=b?b:T("Design:availableFrom")),l.createElement(i.Form.Control,t.__assign({type:"time"},C("startTime",t.__assign({required:!1},p)),{placeholder:"hh:mm",defaultValue:x,disabled:c,isInvalid:Boolean(_.startTime)})),l.createElement(i.Form.Control.Feedback,{type:"invalid"},null===(s=_.startTime)||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!=g?g:T("Design:availableTo")),l.createElement(i.Form.Control,t.__assign({type:"time"},C("endTime",t.__assign({required:!1,validate:function(e){var t;if(!x||!e)return!0;var a=o.DateTime.fromISO(x),l=o.DateTime.fromISO(e);return(null===(t=null==l?void 0:l.diff(a,["minutes"]))||void 0===t?void 0:t.minutes)>=0||"".concat(T("Validation:fieldLaterDate",{attribute:T("Design:endTimeSmall"),min:T("Design:startTimeSmall")}))}},E)),{placeholder:"hh:mm",defaultValue:y,disabled:c,isInvalid:Boolean(_.endTime)})),l.createElement(i.Form.Control.Feedback,{type:"invalid"},null===(u=_.endTime)||void 0===u?void 0:u.message)))))};
@@ -1,311 +0,0 @@
1
- import React, { useRef, useState } from "react";
2
- import { Modifier } from "@popperjs/core";
3
- import { useId } from "@react-aria/utils";
4
- import { Form, OverlayTrigger, Popover } from "react-bootstrap";
5
- import { useFieldArray, useFormContext } from "react-hook-form";
6
- import { useTranslation } from "react-i18next";
7
- import { useClickAway } from "react-use";
8
- import { TIMEZONE } from "@licklist/core/dist/Config/Date";
9
- import { ProductSetRecurrence } from "@licklist/core/dist/DataMapper/Product/ProductSetRecurrenceDataMapper";
10
- import { TIME_FORMAT } from "@licklist/core/dist/Config/Date";
11
- import { DateTime } from "luxon";
12
- import RRule, { Frequency } from "rrule";
13
- import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
14
-
15
- import { DatePickerInput } from "../../recurring-date-picker-input/DatePickerInput";
16
- import { CONFIRM_MODAL_ACTIONS } from "../../modals/confirmation/ConfirmModal";
17
- import { Icon } from "../../static";
18
-
19
- import {
20
- AvailableTimesControl,
21
- AvailableTimesControlRef,
22
- } from "../../zone/form/components/AvailableTimesControl";
23
- import { RecurringDatePickerInputValues } from "../../recurring-date-picker-input/RecurringDatePickerInput";
24
- import { ProductSetRecurrenceOverridesControl } from "./ProductSetRecurrenceOverridesControl";
25
-
26
-
27
- export interface DateAndRecurrenceInputValues {
28
- menuRecurrences?: Partial<ProductSetRecurrence>[];
29
- }
30
-
31
- interface DateAndRecurrenceInputProps {
32
- isEventEditProductSet?: boolean;
33
- workHours?: WorkHour[];
34
- providerHasBookingManagement: boolean;
35
- isLoading?: boolean;
36
- }
37
-
38
- export const DateInput = ({
39
- isEventEditProductSet,
40
- isLoading,
41
- workHours,
42
- providerHasBookingManagement,
43
- }: DateAndRecurrenceInputProps) => {
44
- const {
45
- control,
46
- register,
47
- formState: { errors },
48
- getValues,
49
- setValue,
50
- clearErrors,
51
- } = useFormContext<DateAndRecurrenceInputValues>();
52
-
53
- const { fields, append, update } = useFieldArray({
54
- name: "menuRecurrences",
55
- control,
56
- keyName: "_id",
57
- });
58
-
59
- const [isDatePopoverVisible, setIsDatePopoverVisible] = useState(false);
60
- const availableTimesFormRef = useRef<AvailableTimesControlRef>();
61
- const [editState, setEditState] = useState<{
62
- index: number;
63
- values: Partial<ProductSetRecurrence>;
64
- }>({
65
- index: null,
66
- values: null,
67
- });
68
- const clearEditState = () => setEditState({ index: null, values: null });
69
-
70
- const popoverRef = useRef<HTMLDivElement>();
71
-
72
- useClickAway(popoverRef, (event) => {
73
- const isModal = CONFIRM_MODAL_ACTIONS.includes(
74
- (event.target as HTMLElement)?.attributes?.getNamedItem("data-id")?.value
75
- );
76
-
77
- if (isModal) {
78
- return;
79
- }
80
-
81
- setIsDatePopoverVisible(false);
82
- clearEditState();
83
- });
84
-
85
- const popoverId = useId()!;
86
-
87
- const handleOnEdit = (next: Partial<ProductSetRecurrence>, index) => {
88
- clearEditState();
89
-
90
- // Hotfix for an issue with Popover close & open actions
91
- setTimeout(() => {
92
- setEditState({ index, values: next });
93
- setIsDatePopoverVisible(() => true);
94
- }, 100);
95
- };
96
-
97
- const { t } = useTranslation("Design");
98
-
99
- // in this method we should fulfill the form with a proper data
100
- const handleRecurringDateChange = async (
101
- next: RecurringDatePickerInputValues
102
- ) => {
103
- const isAvailableTimesFormValid =
104
- await availableTimesFormRef.current?.trigger();
105
-
106
- if (next?.startTime && next?.endTime && isAvailableTimesFormValid) {
107
- const startTime = DateTime.fromISO(next.startTime);
108
- const endTime = DateTime.fromISO(next.endTime);
109
- const { availableTimes } = availableTimesFormRef.current.getValues();
110
- const validAvalilableTimes = availableTimes.every((time) => {
111
- const currentAvailableTime = DateTime.fromFormat(time, TIME_FORMAT);
112
-
113
- return (
114
- currentAvailableTime.diff(startTime, "minutes").minutes >= 0 &&
115
- currentAvailableTime.diff(endTime, "minutes").minutes <= 0
116
- );
117
- });
118
- if (!validAvalilableTimes) {
119
- availableTimesFormRef.current.setError("availableTimes", {
120
- message: t("Validation:fieldTimeBetween", {
121
- attribute: t("Design:startTimesSmall"),
122
- min: startTime.toFormat(TIME_FORMAT),
123
- max: endTime.toFormat(TIME_FORMAT),
124
- }),
125
- });
126
-
127
- return;
128
- }
129
- }
130
-
131
- const rrule = RRule.optionsToString({
132
- dtstart: DateTime.fromISO(next.startDate).toJSDate(),
133
- until: DateTime.fromISO(next.startDate).toJSDate(),
134
- byweekday: [],
135
- freq: Frequency.DAILY,
136
- tzid: TIMEZONE,
137
- }).replace("RRULE:", "");
138
-
139
- const availableTime =
140
- availableTimesFormRef?.current?.getValues()?.availableTimes || null;
141
- const values = {
142
- rrule,
143
- startDate: next.startDate,
144
- endDate: next.startDate,
145
- startTime: next.startTime,
146
- endTime: next.endTime,
147
- availableTimes: availableTime,
148
- } as Partial<ProductSetRecurrence>;
149
-
150
- if (editState.values?.id) {
151
- values.id = editState.values?.id;
152
- }
153
-
154
- if (editState.index !== null) {
155
- update(editState.index, values);
156
- } else {
157
- append(values);
158
- }
159
-
160
- setIsDatePopoverVisible(() => false);
161
- clearEditState();
162
- };
163
-
164
- const handleOnAdd = () => {
165
- if (fields.length >= 1) return;
166
- clearEditState();
167
- setIsDatePopoverVisible((prevValue) => !prevValue);
168
- };
169
-
170
- const handleDelete = () => {
171
- const removeIndex = editState.index;
172
-
173
- setIsDatePopoverVisible(false);
174
- clearEditState();
175
-
176
- setTimeout(() => {
177
- const { menuRecurrences = [] } = getValues();
178
-
179
- // @TODO looks like workaround
180
- // Need recheck other places with remove method.
181
- // or update react-hook-form version.
182
- // Remove method from useFormFieldArray throw
183
- // errors while try to remove element by index.
184
- // So we remove them manually
185
- setValue(
186
- "menuRecurrences",
187
- menuRecurrences.filter(
188
- (_currentMenuRecurrence, index) => index !== removeIndex
189
- )
190
- );
191
- }, 100);
192
- };
193
-
194
- return (
195
- <Form.Group>
196
- <Form.Label>
197
- {t(
198
- isEventEditProductSet
199
- ? "whenOverridesAvailable"
200
- : "productSetAvailable"
201
- )}
202
- </Form.Label>
203
-
204
- <OverlayTrigger
205
- show={isDatePopoverVisible}
206
- overlay={
207
- <Popover id={popoverId} className="rounded">
208
- <Popover.Content className="shadow-lg rounded" ref={popoverRef}>
209
- <DatePickerInput
210
- defaultValues={editState.values}
211
- onChange={handleRecurringDateChange}
212
- onDelete={handleDelete}
213
- >
214
- {providerHasBookingManagement && (
215
- <AvailableTimesControl
216
- workHours={workHours}
217
- isLoading={isLoading}
218
- ref={availableTimesFormRef}
219
- defaultValues={[]}
220
- errorMessage={
221
- errors?.menuRecurrences?.[`${editState?.index}`]
222
- ?.availableTimes?.message
223
- }
224
- clearErrorMessage={() =>
225
- clearErrors(
226
- `menuRecurrences.${editState?.index}.availableTimes`
227
- )
228
- }
229
- />
230
- )}
231
- </DatePickerInput>
232
- </Popover.Content>
233
- </Popover>
234
- }
235
- trigger="click"
236
- placement="bottom"
237
- popperConfig={{ modifiers: [sameWidthPopperModifier] }}
238
- >
239
- <div className="product-set-recurrences">
240
- {fields.map((menuRecurrence, index) => (
241
- <ProductSetRecurrenceOverridesControl
242
- key={menuRecurrence._id}
243
- menuRecurrence={menuRecurrence}
244
- onEdit={() => handleOnEdit(menuRecurrence, index)}
245
- errorMessage={
246
- errors?.menuRecurrences?.[`${index}`]?.availableTimes?.message
247
- }
248
- />
249
- ))}
250
- <div
251
- className="product-set-recurrence-icon-wrapper"
252
- role="button"
253
- tabIndex={0}
254
- onClick={handleOnAdd}
255
- onKeyDown={handleOnAdd}
256
- >
257
- <Icon
258
- type="plus-circle"
259
- height="1rem"
260
- className="product-set-recurrence-icon-add mr-2"
261
- />
262
- {t("addDates")}
263
- </div>
264
-
265
- <Form.Control
266
- type="hidden"
267
- {...register("menuRecurrences", {
268
- required: {
269
- value: true,
270
- message: t("Validation:fieldMinNumber", {
271
- attribute: t("dates"),
272
- min: 1,
273
- }),
274
- },
275
- })}
276
- />
277
-
278
- <div className="manual-form-error">
279
- {errors.menuRecurrences?.message}
280
- </div>
281
- </div>
282
- </OverlayTrigger>
283
- </Form.Group>
284
- );
285
- };
286
-
287
- export const sameWidthPopperModifier: Modifier<
288
- "sameWidth",
289
- Record<string, unknown>
290
- > = {
291
- name: "sameWidth",
292
- enabled: true,
293
- phase: "beforeWrite",
294
- requires: ["computeStyles"],
295
- fn({ state }) {
296
- const style = {
297
- width: `${state.rects.reference.width + 4}px`,
298
- marginLeft: "-2px",
299
- maxWidth: "unset",
300
- };
301
- Object.assign(state.styles.popper, style);
302
- },
303
- effect({ state }) {
304
- const { width } = state.elements.reference.getBoundingClientRect();
305
- const style = {
306
- width: `${width}px`,
307
- maxWidth: "unset",
308
- };
309
- Object.assign(state.elements.popper.style, style);
310
- },
311
- };
@@ -1,63 +0,0 @@
1
- import React from "react";
2
- import { useIntl } from "react-intl";
3
- import { ProductSetRecurrence } from "@licklist/core/dist/DataMapper/Product/ProductSetRecurrenceDataMapper";
4
-
5
- import { Icon } from "../../static";
6
-
7
- export interface ProductSetRecurrenceControlProps {
8
- menuRecurrence?: { _id: string } & Partial<ProductSetRecurrence>;
9
- onEdit?: (onEdit: Partial<ProductSetRecurrence>) => void;
10
- errorMessage?: string;
11
- }
12
-
13
- export const ProductSetRecurrenceOverridesControl = ({
14
- menuRecurrence,
15
- onEdit,
16
- errorMessage,
17
- }: ProductSetRecurrenceControlProps) => {
18
- const { formatDate } = useIntl();
19
-
20
- return (
21
- <div className="sortable-tree-root flex-column" role="button" tabIndex={0}>
22
- <div
23
- key={menuRecurrence.rrule}
24
- className="product-set-recurrence d-flex flex-column mr-0 mb-3 p-3 px-4 flex-grow-1"
25
- >
26
- <span className="d-flex flex-row align-items-center">
27
- <Icon
28
- type="calendar"
29
- height="1rem"
30
- className="product-set-recurrence-icon-calendar"
31
- />
32
- <span className="product-set-recurrence-title d-flex flex-grow-1">
33
- {formatDate(menuRecurrence.startDate, {
34
- dateStyle: "medium",
35
- })}{" "}
36
- </span>
37
-
38
- <div
39
- className="d-inline-flex"
40
- role="button"
41
- tabIndex={0}
42
- onClick={() => onEdit(menuRecurrence)}
43
- onKeyDown={() => onEdit(menuRecurrence)}
44
- >
45
- <Icon
46
- type="ellipsis-h"
47
- height="1rem"
48
- className="product-set-recurrence-icon-more"
49
- />
50
- </div>
51
- </span>
52
- <span className="product-set-recurrence-description">
53
- {formatDate(menuRecurrence.startDate, {
54
- dateStyle: "medium",
55
- })}{" "}
56
- </span>
57
- </div>
58
- <div className={`manual-form-error ${!errorMessage && "d-none"}`}>
59
- {errorMessage}
60
- </div>
61
- </div>
62
- );
63
- };
@@ -1,93 +0,0 @@
1
- import React, { PropsWithChildren } from "react";
2
- import { Frequency } from "rrule";
3
- import { useTranslation } from "react-i18next";
4
- import Button from "react-bootstrap/Button";
5
- import { DateTime } from "luxon";
6
- import { TIME_FULL_FORMAT } from "@licklist/core/dist/Config/Date";
7
- import { FormProvider, useForm } from "react-hook-form";
8
- import { Form } from "react-bootstrap";
9
- import { ConfirmModal } from "../modals";
10
- import { DeleteFieldButton } from "../product-set/elements";
11
- import { RecurringDatePickerInputValues } from "./RecurringDatePickerInput";
12
- import RecurrenceAndFrequencyInput from "./RecurrenceAndFrequencyInput";
13
-
14
- export interface RecurringDatePickerInputProps {
15
- disabled?: boolean;
16
- defaultValues?: Partial<RecurringDatePickerInputValues>;
17
- onChange: (state: RecurringDatePickerInputValues) => void;
18
- onDelete: () => void;
19
- initialFrequency?: Frequency;
20
- setInitialStartDateAfterSelect?: boolean;
21
- minDate?: string;
22
- }
23
-
24
- export interface DatePickerInputValues {
25
- startDate: string;
26
- startTime: string;
27
- endTime: string;
28
- }
29
-
30
- export function DatePickerInput({
31
- disabled = false,
32
- onChange,
33
- onDelete,
34
- defaultValues,
35
- children,
36
- minDate,
37
- }: PropsWithChildren<RecurringDatePickerInputProps>) {
38
- const { t } = useTranslation(["Design"]);
39
-
40
- const form = useForm<DatePickerInputValues>({
41
- defaultValues: {
42
- startDate: defaultValues?.startDate ?? "",
43
- startTime: defaultValues?.startTime ?? "",
44
- endTime: defaultValues?.endTime ?? "",
45
- },
46
- mode: "onChange",
47
- });
48
-
49
- const { handleSubmit } = form;
50
-
51
- const onSubmit = (nextState: RecurringDatePickerInputValues) => {
52
- const endTimeNextState = nextState?.endTime
53
- ? DateTime.fromISO(nextState?.endTime).toFormat(TIME_FULL_FORMAT)
54
- : "";
55
-
56
- onChange({
57
- ...nextState,
58
- endTime: endTimeNextState,
59
- });
60
- };
61
-
62
- return (
63
- <FormProvider {...form}>
64
- <Form
65
- noValidate
66
- onSubmit={(event) => {
67
- // prevents parent form submitting
68
- event.preventDefault();
69
- event.stopPropagation();
70
- return handleSubmit(onSubmit)(event);
71
- }}
72
- >
73
- <RecurrenceAndFrequencyInput disabled={disabled} minDate={minDate} />
74
-
75
- {children}
76
-
77
- <div className="d-inline-flex align-items-center w-100">
78
- <Button type="submit">{t("Design:apply")}</Button>
79
-
80
- {defaultValues && (
81
- <div className="d-flex justify-content-end delete-btn">
82
- <ConfirmModal>
83
- {(confirm) => (
84
- <DeleteFieldButton onDelete={() => confirm(onDelete)} />
85
- )}
86
- </ConfirmModal>
87
- </div>
88
- )}
89
- </div>
90
- </Form>
91
- </FormProvider>
92
- );
93
- }