@licklist/design 0.44.486-dev.49 → 0.44.486-dev.50

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 (21) hide show
  1. package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
  2. package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -1
  3. package/dist/product-set/control/ProductSetControl.d.ts +2 -1
  4. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  5. package/dist/product-set/control/ProductSetControl.js +1 -1
  6. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  7. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  8. package/dist/product-set/product-category/ProductCategoryControl.d.ts +0 -1
  9. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  10. package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
  11. package/dist/sales/manual-booking/summary/ManualBookingSummary.d.ts.map +1 -1
  12. package/package.json +2 -2
  13. package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.stories.tsx +0 -9
  14. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +3 -1
  15. package/src/iframe/event/event-venue-map/IframeEventVenueMap.stories.tsx +0 -1
  16. package/src/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.stories.tsx +0 -1
  17. package/src/product-set/control/ProductSetControl.tsx +35 -0
  18. package/src/product-set/form/ProductCategoriesControl.tsx +0 -1
  19. package/src/product-set/form/ProductSetForm.stories.tsx +2 -6
  20. package/src/product-set/product-category/ProductCategoryControl.tsx +0 -23
  21. package/src/sales/manual-booking/summary/ManualBookingSummary.tsx +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"getDefaultProductSet.d.ts","sourceRoot":"","sources":["../../../../src/events/edit-event-modal/utils/getDefaultProductSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACX,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,eAAO,MAAM,gBAAgB,gBACd,UAAU,GAAG,IAAI,qBACX,OAAO,KACzB,oBAsCD,CAAC"}
1
+ {"version":3,"file":"getDefaultProductSet.d.ts","sourceRoot":"","sources":["../../../../src/events/edit-event-modal/utils/getDefaultProductSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,UAAU,EACX,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,eAAO,MAAM,gBAAgB,gBACd,UAAU,GAAG,IAAI,qBACX,OAAO,KACzB,oBAuCD,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),i=require("../../../product-set/utils/index.js");exports.getDefaultValues=function(o,n){var t,d,u,s,r,a,v,p,_,m,c,g;return{id:null!==(t=null==o?void 0:o.id)&&void 0!==t?t:0,name:null!==(d=null==o?void 0:o.name)&&void 0!==d?d:"",type:null!==(u=null==o?void 0:o.type)&&void 0!==u?u:l.DEFAULT_PRODUCT_SET_TYPE,termsAndConditions:null!==(s=null==o?void 0:o.termsAndConditions)&&void 0!==s?s:"",operationalCost:null!==(r=null==o?void 0:o.operationalCost)&&void 0!==r?r:l.DEFAULT_OPERATIONAL_COST_TYPE,thankYouPageUrl:null!==(a=null==o?void 0:o.thankYouPageUrl)&&void 0!==a?a:"",isDefault:null!==(v=null==o?void 0:o.isDefault)&&void 0!==v&&v,fieldSetId:null==o?void 0:o.fieldSetId,emailTemplates:(null==o?void 0:o.mailTemplates)&&(null===(p=null==o?void 0:o.mailTemplates)||void 0===p?void 0:p.length)>0?i.getFilteredTemplates(null==o?void 0:o.mailTemplates):void 0,smsTemplates:(null==o?void 0:o.smsTemplates)&&(null===(_=null==o?void 0:o.smsTemplates)||void 0===_?void 0:_.length)>0?i.getFilteredTemplates(null==o?void 0:o.mailTemplates):void 0,steps:null!==(c=null===(m=null==o?void 0:o.steps)||void 0===m?void 0:m.map((function(l){var i,o=l.productCategories,n=e.__rest(l,["productCategories"]);return e.__assign(e.__assign({},n),{productCategories:null==o?void 0:o.map((function(l){var i=l.products,o=e.__rest(l,["products"]);return e.__assign(e.__assign({},o),{products:null==i?void 0:i.map((function(l){var i=l.zoneId,o=l.subProducts,n=e.__rest(l,["zoneId","subProducts"]);return e.__assign(e.__assign({},n),{subProducts:null==o?void 0:o.map((function(l){var i=l.zoneId,o=e.__rest(l,["zoneId"]);return e.__assign(e.__assign({},o),{productCategoryId:void 0,zoneId:i})})),productCategoryId:void 0,zoneId:i})}))})})),venueMapSetId:(null==n?void 0:n.venueMapSet)?null===(i=null==n?void 0:n.venueMapSet)||void 0===i?void 0:i.id:null})})))&&void 0!==c?c:void 0,menuRecurrences:n?[]:null!==(g=null==o?void 0:o.menuRecurrences)&&void 0!==g?g:[]}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),o=require("../../../product-set/utils/index.js");exports.getDefaultValues=function(i,n){var t,d,u,s,r,a,v,p,_,m,c,T,g;return{id:null!==(t=null==i?void 0:i.id)&&void 0!==t?t:0,name:null!==(d=null==i?void 0:i.name)&&void 0!==d?d:"",type:null!==(u=null==i?void 0:i.type)&&void 0!==u?u:l.DEFAULT_PRODUCT_SET_TYPE,termsAndConditions:null!==(s=null==i?void 0:i.termsAndConditions)&&void 0!==s?s:"",operationalCost:null!==(r=null==i?void 0:i.operationalCost)&&void 0!==r?r:l.DEFAULT_OPERATIONAL_COST_TYPE,relyOnPeopleType:null!==(a=null==i?void 0:i.relyOnPeopleType)&&void 0!==a?a:l.DEFAULT_RELY_ON_PEOPLE_TYPE,thankYouPageUrl:null!==(v=null==i?void 0:i.thankYouPageUrl)&&void 0!==v?v:"",isDefault:null!==(p=null==i?void 0:i.isDefault)&&void 0!==p&&p,fieldSetId:null==i?void 0:i.fieldSetId,emailTemplates:(null==i?void 0:i.mailTemplates)&&(null===(_=null==i?void 0:i.mailTemplates)||void 0===_?void 0:_.length)>0?o.getFilteredTemplates(null==i?void 0:i.mailTemplates):void 0,smsTemplates:(null==i?void 0:i.smsTemplates)&&(null===(m=null==i?void 0:i.smsTemplates)||void 0===m?void 0:m.length)>0?o.getFilteredTemplates(null==i?void 0:i.smsTemplates):void 0,steps:null!==(T=null===(c=null==i?void 0:i.steps)||void 0===c?void 0:c.map((function(l){var o,i=l.productCategories,n=e.__rest(l,["productCategories"]);return e.__assign(e.__assign({},n),{productCategories:null==i?void 0:i.map((function(l){var o=l.products,i=e.__rest(l,["products"]);return e.__assign(e.__assign({},i),{products:null==o?void 0:o.map((function(l){var o=l.zoneId,i=l.subProducts,n=e.__rest(l,["zoneId","subProducts"]);return e.__assign(e.__assign({},n),{subProducts:null==i?void 0:i.map((function(l){var o=l.zoneId,i=e.__rest(l,["zoneId"]);return e.__assign(e.__assign({},i),{productCategoryId:void 0,zoneId:o})})),productCategoryId:void 0,zoneId:o})}))})})),venueMapSetId:(null==n?void 0:n.venueMapSet)?null===(o=null==n?void 0:n.venueMapSet)||void 0===o?void 0:o.id:null})})))&&void 0!==T?T:void 0,menuRecurrences:n?[]:null!==(g=null==i?void 0:i.menuRecurrences)&&void 0!==g?g:[]}};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { OperationalCostType, ProductSetType } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
2
+ import { OperationalCostType, ProductSetType, RelyOnPeopleType } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
3
3
  import { FieldSet } from "@licklist/core/dist/DataMapper/Order/FieldSetDataMapper";
4
4
  import { EmailTemplate } from "@licklist/core/dist/DataMapper/Notification/EmailTemplateDataMapper";
5
5
  import { SmsTemplate } from "@licklist/core/dist/DataMapper/Notification/SmsTemplateDataMapper";
@@ -19,6 +19,7 @@ export interface ProductSetControlValues extends DateAndRecurrenceInputValues {
19
19
  isDefault: boolean;
20
20
  operationalCost: OperationalCostType;
21
21
  productGroups?: SelectItem[];
22
+ relyOnPeopleType: RelyOnPeopleType;
22
23
  fieldSetId?: number;
23
24
  steps?: Step[];
24
25
  emailTemplates?: TemplateItem[];
@@ -1 +1 @@
1
- {"version":3,"file":"ProductSetControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/ProductSetControl.tsx"],"names":[],"mappings":";AAKA,OAAO,EAIL,mBAAmB,EACnB,cAAc,EACf,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,mEAAmE,CAAC;AAIhG,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAIL,4BAA4B,EAC7B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAShC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,aAAa,GAAG,WAAW,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAwB,SAAQ,4BAA4B;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,cAAc,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,mBAAmB,CAAC;IACrC,aAAa,CAAC,EAAE,UAAU,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,SAAS,EACT,GAAU,EACV,SAAc,EACd,cAAmB,EACnB,YAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,EAAE,sBAAsB,eAqPxB"}
1
+ {"version":3,"file":"ProductSetControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/ProductSetControl.tsx"],"names":[],"mappings":";AAKA,OAAO,EAOL,mBAAmB,EACnB,cAAc,EAEd,gBAAgB,EACjB,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,mEAAmE,CAAC;AAIhG,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAIL,4BAA4B,EAC7B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAehC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,aAAa,GAAG,WAAW,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAwB,SAAQ,4BAA4B;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,cAAc,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,mBAAmB,CAAC;IACrC,aAAa,CAAC,EAAE,UAAU,EAAE,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,SAAS,EACT,GAAU,EACV,SAAc,EACd,cAAmB,EACnB,YAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,EAAE,sBAAsB,eA4QxB"}
@@ -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"),a=e(require("react")),r=require("react-i18next"),n=require("react-bootstrap"),o=require("react-hook-form"),l=e(require("@licklist/plugins/dist/services/Form/HookFormService")),i=require("@react-aria/utils"),s=e(require("clsx")),m=require("../../static/WarningMessage.js");require("../../static/index.js");var c,u=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),d=require("@licklist/plugins/dist/validation/Rules/urlRule"),p=(e(d),require("./DateAndRecurrenceInput.js")),E=require("./TutorialGifCard.js"),g=require("../form/StepsControl.js"),v=require("../../typeahead/Typeahead.js"),T=((c={})[u.OPERATIONAL_COST_PROVIDER]="operationalCostProvider",c[u.OPERATIONAL_COST_CUSTOMER]="operationalCostCustomer",c);exports.ProductSetControl=function(e){var c,f=e.companyName,C=e.isLoading,h=e.fee,F=void 0===h?"5%":h,P=e.fieldSets,O=void 0===P?[]:P,D=e.emailTemplates,b=void 0===D?[]:D,S=e.smsTemplates,_=void 0===S?[]:S,A=e.isEventEditProductSet,N=e.isCreateAction,I=e.showEmailTemplate,q=e.showSmsTemplate,R=r.useTranslation(["Design","Validation","Notification"]).t,k=o.useFormContext(),L=k.register,y=k.control,x=k.formState.errors,M=k.watch,Y=k.setError,j=k.clearErrors,U=M("steps"),V=i.useId(),G=i.useId();return a.createElement(n.Row,{className:"product-set-form ".concat(A&&"event-edit-product-set")},a.createElement(n.Col,{md:6,sm:12,className:"pr-5"},a.createElement(n.Form.Group,{controlId:V},a.createElement(n.Form.Label,null,R("Design:name"),"*"),a.createElement(n.Form.Control,t.__assign({},L("name",{required:R("Validation:fieldRequired",{attribute:R("name")}),maxLength:255,validate:function(){var e;return U.length?(null===(e=x.steps)||void 0===e?void 0:e.type)===l.manualErrorType&&j("steps"):Y("steps",{type:l.manualErrorType,message:R("Validation:fieldMinNumber",{attribute:R("steps"),min:1})}),!0}}),{placeholder:R("Design:placeholderProductSetName"),isInvalid:Boolean(x.name)})),a.createElement(n.Form.Control.Feedback,{type:"invalid"},null===(c=x.name)||void 0===c?void 0:c.message)),N&&a.createElement(p.DateAndRecurrenceInput,{isEventEditProductSet:A}),a.createElement("div",{className:"divider"}),a.createElement(E.default,null),a.createElement(g.StepsControl,{isLoading:C})),a.createElement(n.Col,{md:6,sm:12},a.createElement("div",{className:"second-column"},a.createElement(n.Form.Group,null,a.createElement(n.Form.Label,{className:"mb-0"},R("Design:operationalCost")),a.createElement("div",{className:"d-flex"},a.createElement("span",{className:"booking-fee-text"},R("bookingFeePaid",{fee:F}))),a.createElement(n.Form.Control,t.__assign({},L("operationalCost",{required:!0}),{as:"select",defaultValue:u.OPERATIONAL_COST_PROVIDER}),Object.keys(u.OPERATIONAL_COST_TYPES).map((function(e){return a.createElement("option",{value:u.OPERATIONAL_COST_TYPES[e],key:u.OPERATIONAL_COST_TYPES[e]},R(T[u.OPERATIONAL_COST_TYPES[e]],{companyName:f}))})))),a.createElement(n.Form.Group,{controlId:G},a.createElement(n.Form.Label,null,R("Design:termsAndConditions")),a.createElement(n.Form.Control,t.__assign({},L("termsAndConditions"),{as:"textarea",rows:2,disabled:C}))),a.createElement(n.Form.Group,null,a.createElement(n.Form.Label,{className:"mt-4"},R("Design:emailTemplate")),I?a.createElement(v.Typeahead,{name:"emailTemplates",options:b,isMultipleChoise:!0,placeholder:R("Design:choose"),noOptionsMessage:R("Design:noActiveTemplates",{notification:R("Design:email")})}):a.createElement(m.default,{message:R("Design:noActiveTemplates",{notification:R("Design:email")})}),a.createElement(n.Form.Label,{className:s(b.length>0?"mt-4":"mt-1")},R("Design:smsTemplate")),q?a.createElement(v.Typeahead,{name:"smsTemplates",options:_,isMultipleChoise:!0,placeholder:R("Design:choose"),noOptionsMessage:R("Design:noActiveTemplates",{notification:R("Design:sms")})}):a.createElement(m.default,{message:R("Design:noActiveTemplates",{notification:R("Design:sms")})})),a.createElement(n.Form.Group,null,a.createElement(o.Controller,{control:y,name:"fieldSetId",render:function(e){var t=e.field,r=Number(t.value);return a.createElement(a.Fragment,null,a.createElement(n.Form.Label,null,R("Design:customFields")),a.createElement(n.Form.Control,{onChange:t.onChange,value:r,as:"select"},a.createElement("option",{value:""},R("Design:choose")),null==O?void 0:O.map((function(e){return a.createElement("option",{value:e.id,key:e.id},e.name)}))))}})),a.createElement(n.Form.Group,{controlId:"thankYouPageUrlId"},a.createElement(n.Form.Label,null,R("thankYouPageUrl")),a.createElement(n.Form.Control,t.__assign({},L("thankYouPageUrl",{validate:function(e){return!e||(!!d.ruleForUrlWithProtocol.test(e)||R("Validation:fieldValidWebURL",{attribute:R("thankYouPageUrl")}))}}),{isInvalid:l.isInvalid("thankYouPageUrl",x)})),a.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("thankYouPageUrl",x))))))};
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"),a=e(require("react")),r=require("react-i18next"),n=require("react-bootstrap"),o=require("react-hook-form"),l=e(require("@licklist/plugins/dist/services/Form/HookFormService")),i=require("@react-aria/utils"),s=e(require("clsx")),m=require("../../static/WarningMessage.js");require("../../static/index.js");var c,u,d=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),E=require("@licklist/plugins/dist/validation/Rules/urlRule"),p=(e(E),require("./DateAndRecurrenceInput.js")),P=require("./TutorialGifCard.js"),T=require("../form/StepsControl.js"),_=require("../../typeahead/Typeahead.js"),g=((c={})[d.OPERATIONAL_COST_PROVIDER]="operationalCostProvider",c[d.OPERATIONAL_COST_CUSTOMER]="operationalCostCustomer",c),O=((u={})[d.RELY_ON_PEOPLE_PRODUCT_CAPACITY_QUANTITY]="peopleProductCapacityQuantity",u[d.RELY_ON_PEOPLE_PRODUCT_QUANTITY]="peopleProductQuantity",u[d.RELY_ON_PEOPLE_QUANTITY]="peopleQuantity",u);exports.ProductSetControl=function(e){var c,u=e.companyName,C=e.isLoading,v=e.fee,f=void 0===v?"5%":v,L=e.fieldSets,N=void 0===L?[]:L,F=e.emailTemplates,A=void 0===F?[]:F,R=e.smsTemplates,h=void 0===R?[]:R,I=e.isEventEditProductSet,D=e.isCreateAction,S=e.showEmailTemplate,Y=e.showSmsTemplate,y=r.useTranslation(["Design","Validation","Notification"]).t,b=o.useFormContext(),k=b.register,q=b.control,U=b.formState.errors,j=b.watch,x=b.setError,M=b.clearErrors,V=j("steps"),G=i.useId(),Q=i.useId(),w=i.useId();return a.createElement(n.Row,{className:"product-set-form ".concat(I&&"event-edit-product-set")},a.createElement(n.Col,{md:6,sm:12,className:"pr-5"},a.createElement(n.Form.Group,{controlId:G},a.createElement(n.Form.Label,null,y("Design:name"),"*"),a.createElement(n.Form.Control,t.__assign({},k("name",{required:y("Validation:fieldRequired",{attribute:y("name")}),maxLength:255,validate:function(){var e;return V.length?(null===(e=U.steps)||void 0===e?void 0:e.type)===l.manualErrorType&&M("steps"):x("steps",{type:l.manualErrorType,message:y("Validation:fieldMinNumber",{attribute:y("steps"),min:1})}),!0}}),{placeholder:y("Design:placeholderProductSetName"),isInvalid:Boolean(U.name)})),a.createElement(n.Form.Control.Feedback,{type:"invalid"},null===(c=U.name)||void 0===c?void 0:c.message)),D&&a.createElement(p.DateAndRecurrenceInput,{isEventEditProductSet:I}),a.createElement("div",{className:"divider"}),a.createElement(P.default,null),a.createElement(T.StepsControl,{isLoading:C})),a.createElement(n.Col,{md:6,sm:12},a.createElement("div",{className:"second-column"},a.createElement(n.Form.Group,null,a.createElement(n.Form.Label,{className:"mb-0"},y("Design:operationalCost")),a.createElement("div",{className:"d-flex"},a.createElement("span",{className:"booking-fee-text"},y("bookingFeePaid",{fee:f}))),a.createElement(n.Form.Control,t.__assign({},k("operationalCost",{required:!0}),{as:"select",defaultValue:d.OPERATIONAL_COST_PROVIDER}),Object.keys(d.OPERATIONAL_COST_TYPES).map((function(e){return a.createElement("option",{value:d.OPERATIONAL_COST_TYPES[e],key:d.OPERATIONAL_COST_TYPES[e]},y(g[d.OPERATIONAL_COST_TYPES[e]],{companyName:u}))})))),a.createElement(n.Form.Group,{controlId:w},a.createElement(n.Form.Label,null,y("peopleQuantityType")),a.createElement(n.Form.Control,t.__assign({},k("relyOnPeopleType",{required:!0}),{as:"select",defaultValue:d.RELY_ON_PEOPLE_PRODUCT_CAPACITY_QUANTITY}),Object.keys(d.RELY_ON_PEOPLE_TYPES).map((function(e){return a.createElement("option",{value:d.RELY_ON_PEOPLE_TYPES[e],key:d.RELY_ON_PEOPLE_TYPES[e]},y(O[d.RELY_ON_PEOPLE_TYPES[e]]))})))),a.createElement(n.Form.Group,{controlId:Q},a.createElement(n.Form.Label,null,y("Design:termsAndConditions")),a.createElement(n.Form.Control,t.__assign({},k("termsAndConditions"),{as:"textarea",rows:2,disabled:C}))),a.createElement(n.Form.Group,null,a.createElement(n.Form.Label,{className:"mt-4"},y("Design:emailTemplate")),S?a.createElement(_.Typeahead,{name:"emailTemplates",options:A,isMultipleChoise:!0,placeholder:y("Design:choose"),noOptionsMessage:y("Design:noActiveTemplates",{notification:y("Design:email")})}):a.createElement(m.default,{message:y("Design:noActiveTemplates",{notification:y("Design:email")})}),a.createElement(n.Form.Label,{className:s(A.length>0?"mt-4":"mt-1")},y("Design:smsTemplate")),Y?a.createElement(_.Typeahead,{name:"smsTemplates",options:h,isMultipleChoise:!0,placeholder:y("Design:choose"),noOptionsMessage:y("Design:noActiveTemplates",{notification:y("Design:sms")})}):a.createElement(m.default,{message:y("Design:noActiveTemplates",{notification:y("Design:sms")})})),a.createElement(n.Form.Group,null,a.createElement(o.Controller,{control:q,name:"fieldSetId",render:function(e){var t=e.field,r=Number(t.value);return a.createElement(a.Fragment,null,a.createElement(n.Form.Label,null,y("Design:customFields")),a.createElement(n.Form.Control,{onChange:t.onChange,value:r,as:"select"},a.createElement("option",{value:""},y("Design:choose")),null==N?void 0:N.map((function(e){return a.createElement("option",{value:e.id,key:e.id},e.name)}))))}})),a.createElement(n.Form.Group,{controlId:"thankYouPageUrlId"},a.createElement(n.Form.Label,null,y("thankYouPageUrl")),a.createElement(n.Form.Control,t.__assign({},k("thankYouPageUrl",{validate:function(e){return!e||(!!E.ruleForUrlWithProtocol.test(e)||y("Validation:fieldValidWebURL",{attribute:y("thankYouPageUrl")}))}}),{isInvalid:l.isInvalid("thankYouPageUrl",U)})),a.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("thankYouPageUrl",U))))))};
@@ -1 +1 @@
1
- {"version":3,"file":"ProductCategoriesControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/ProductCategoriesControl.tsx"],"names":[],"mappings":";AAYA,OAAO,EAKL,YAAY,EACb,MAAM,kEAAkE,CAAC;AAQ1E,OAAO,EAAwB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AASvE,UAAU,6BAA8B,SAAQ,aAAa;IAC3D,SAAS,EAAE,MAAM,CAAC;CACnB;AA4BD,wBAAgB,wBAAwB,CAAC,EACvC,SAAS,EACT,SAAS,GACV,EAAE,6BAA6B,eAmS/B;AAED,eAAO,MAAM,cAAc,iBACX,YAAY,SACnB,MAAM;WACH,MAAM;eAAa,MAAM;CAcpC,CAAC"}
1
+ {"version":3,"file":"ProductCategoriesControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/ProductCategoriesControl.tsx"],"names":[],"mappings":";AAYA,OAAO,EAKL,YAAY,EACb,MAAM,kEAAkE,CAAC;AAQ1E,OAAO,EAAwB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AASvE,UAAU,6BAA8B,SAAQ,aAAa;IAC3D,SAAS,EAAE,MAAM,CAAC;CACnB;AA2BD,wBAAgB,wBAAwB,CAAC,EACvC,SAAS,EACT,SAAS,GACV,EAAE,6BAA6B,eAmS/B;AAED,eAAO,MAAM,cAAc,iBACX,YAAY,SACnB,MAAM;WACH,MAAM;eAAa,MAAM;CAcpC,CAAC"}
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),n=e(r),o=require("react-i18next"),i=require("react-bootstrap"),a=require("react-hook-form"),u=e(require("@licklist/plugins/dist/services/Form/HookFormService")),d=e(require("clsx")),l=require("@dnd-kit/core"),s=require("lodash"),c=require("../../sortable-tree/SortableTreeItem.js"),m=require("../../sortable-tree/SortableTree.js"),p=require("../hooks/useSortableTreeFunctions.js"),v=require("../item/CreateProductSetItem.js"),g=require("./context.js"),f=require("@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper"),y=require("../product-category/ProductCategoryControl.js"),C=require("./ProductsControl.js"),E=require("./SelectCategoryModal.js"),b=require("./VenueMapSetModal.js"),_=require("../utils/index.js");var I=function(e,t){return e===f.CATEGORY_TYPE_GAME?{className:"game-badge",label:t}:e===f.CATEGORY_TYPE_FIXED_DURATION?{className:"fixed-duration-badge",label:t}:null};exports.ProductCategoriesControl=function(e){var S,q,T,x,P,N,h=e.isLoading,M=e.stepIndex,A=o.useTranslation("Design").t,k=r.useContext(g.ProductSetLoadingContext),j=k.providerHasMap,V=k.expandedProductCategories,D=k.setExpandedProductCategories,F=k.zones,R=a.useFormContext(),Y=t.__read(r.useState(!1),2),O=Y[0],B=Y[1],L=t.__read(r.useState(!1),2),w=L[0],G=L[1],H=t.__read(r.useState(!1),2),U=H[0],z=H[1],Q=R.control,K=R.formState.errors,W=R.clearErrors,X=R.watch,J=R.trigger,Z=R.getValues,$=R.setValue,ee=X("steps.".concat(M,".hasMap"))||!1,te="steps.".concat(M,".productCategories"),re=a.useFieldArray({name:te,control:Q,keyName:"_id"}),ne=re.fields,oe=re.append,ie=re.remove,ae=t.__read(r.useState({}),2),ue=ae[0],de=ae[1],le=p.useSortableTreeFunctions({fieldName:te,remove:ie}),se=le.edit,ce=le.saveValidField,me=le.cancelChanges,pe=a.useWatch({control:Q,name:te}),ve=null===(q=null===(S=null==K?void 0:K.steps)||void 0===S?void 0:S[M])||void 0===q?void 0:q.productCategories,ge=null===(x=null===(T=null==K?void 0:K.steps)||void 0===T?void 0:T[M])||void 0===x?void 0:x.venueMapSetId,fe=null===(N=null===(P=null==K?void 0:K.steps)||void 0===P?void 0:P[M])||void 0===N?void 0:N.pointProducts,ye=Boolean(ge||fe),Ce=l.useSensor(l.MouseSensor,{activationConstraint:{distance:10}});return r.useEffect((function(){pe&&pe.length&&pe.forEach((function(e){var r,n,o=null===(r=e.products)||void 0===r?void 0:r.reduce((function(e,t){return e+Number(t.price)*Number(t.totalQuantity)}),0),i=null===(n=e.products)||void 0===n?void 0:n.reduce((function(e,t){return e+(t.isUnlimited?0:Number(t.totalQuantity))}),0);de((function(r){var n;return t.__assign(t.__assign({},r),((n={})[(null==e?void 0:e.id)||e.uniqueId]={price:o,quantity:i},n))}))}))}),[pe]),r.useEffect((function(){1===ne.length&&D((function(e){var r,n,o;return t.__assign(t.__assign({},e),((r={})[String((null===(n=ne[0])||void 0===n?void 0:n.id)||(null===(o=ne[0])||void 0===o?void 0:o.uniqueId))]=!0,r))}))}),[ne]),n.createElement(n.Fragment,null,n.createElement(m.SortableTree,{sensors:[Ce],items:ne.map((function(e){return String(e._id)})),onDragEnd:function(e){var t=e.active,r=e.over;if(t&&r&&(null==t?void 0:t.id)&&(null==r?void 0:r.id)){var n=ne.findIndex((function(e){return e._id===t.id})),o=ne.findIndex((function(e){return e._id===r.id}));if(n!==o){var i=Z(te);if(i){var a=_.sortArrayByIndex(_.moveArrayElements(i,n,o));$(te,a)}}}}},ne.map((function(e,r){var o=(null==e?void 0:e.id)?String(e.id):e.uniqueId,u=function(){!function(e){D((function(r){var n;return t.__assign(t.__assign({},r),((n={})[e]=!r[e],n))}))}(o)};return n.createElement(a.Controller,{key:"product-category-".concat(e._id),name:"".concat(te,".").concat(r,".name"),control:Q,rules:{required:A("Validation:fieldRequired",{attribute:A("name")})},render:function(t){var a,d,l,s=t.field,p=s.value,v=s.onChange;return n.createElement(m.SortableTree.Item,{id:e._id,title:p,isExpanded:V[o],setIsExpanded:u,edit:function(){return se(r)},cancelChanges:function(){return me(r)},isInvalid:!!ve,badge:n.createElement(i.Badge,{className:"category-badge"},A("productCategory")),isIconInHeader:!1,subTitle:n.createElement("div",{className:"product-set-badges-container"},n.createElement("div",{className:"product-set-subtitle-dot product-set-subtitle-category-dot"}),n.createElement("span",null,null!==(l=null===(d=ue[null!==(a=null==e?void 0:e.id)&&void 0!==a?a:e.uniqueId])||void 0===d?void 0:d.quantity)&&void 0!==l?l:"N/A"," ",A("products"))),treeLineIconColor:"#1A93AA",modalLabel:A("addNewCategory"),secondaryBadge:I(e.type,A(e.type)),modalClass:c.ProductSetModalClasses.category,isNewAdded:U,body:n.createElement(y.ProductCategoryControl,{isLoading:h,onCategoryNameChange:v,categoryName:p,stepIndex:M,productCategoryIndex:r}),onDelete:function(){return ie(r)},validate:function(){return J("steps.".concat(M,".productCategories.").concat(r))},saveValidField:ce,sortableItems:e.products?e.products.filter((function(e){return e.id})).map((function(e){var t=e.id;return String(t)})):[]},n.createElement(C.ProductsControl,{isLoading:h,quantityType:e.quantityType,hasTicket:null==e?void 0:e.hasTicket,stepIndex:M,zones:F,productCategoryIndex:r,categoryType:e.type}))}})}))),n.createElement(v.CreateProductSetItem,{title:A("addCategory"),onClick:function(){B(!0)}}),n.createElement(E.SelectCategoryModal,{isVisible:O,onHide:function(){return B(!1)},onCategorySelect:function(e){oe(function(e,t){return{id:null,uniqueId:s.uniqueId("product-category"),name:"",minSubItems:null,maxSubItems:null,quantityType:f.QUANTITY_TYPE_STANDARD,type:e,isRelyOnPeople:e===f.CATEGORY_TYPE_TICKETS,isTimeRelated:!1,collectUserInfo:!1,hasTicket:e===f.CATEGORY_TYPE_TICKETS,allowDeposits:!1,remainderExpireAfter:void 0,hasBookingManagement:!1,weight:0,isReusable:!1,hasSubEvents:!1,products:[],zoneId:null,sort:t}}(e,ne.length)),z(!0),(null==ve?void 0:ve.type)===u.manualErrorType&&W(te)}}),j&&ee&&n.createElement(n.Fragment,null,n.createElement(v.CreateProductSetItem,{title:A("editMap"),onClick:function(){G(!0)},className:d("mt-3",ye&&"mb-3",ye&&"is-invalid")}),ye&&n.createElement("div",{className:"manual-form-error"},ge&&A("Validation:fieldRequired",{attribute:A("Design:venueMapSet")}),fe&&A("Validation:fieldMinNumber",{attribute:A("pointProduct"),min:1})),n.createElement(b.VenueMapSetModal,{isVisible:w,setIsVisible:G,stepIndex:M})),n.createElement("div",{className:"manual-form-error"},ve&&ve.message))},exports.getBadgeConfig=I;
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),n=e(r),o=require("react-i18next"),i=require("react-bootstrap"),a=require("react-hook-form"),u=e(require("@licklist/plugins/dist/services/Form/HookFormService")),d=e(require("clsx")),l=require("@dnd-kit/core"),s=require("lodash"),c=require("../../sortable-tree/SortableTreeItem.js"),m=require("../../sortable-tree/SortableTree.js"),p=require("../hooks/useSortableTreeFunctions.js"),v=require("../item/CreateProductSetItem.js"),g=require("./context.js"),f=require("@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper"),y=require("../product-category/ProductCategoryControl.js"),C=require("./ProductsControl.js"),b=require("./SelectCategoryModal.js"),E=require("./VenueMapSetModal.js"),_=require("../utils/index.js");var I=function(e,t){return e===f.CATEGORY_TYPE_GAME?{className:"game-badge",label:t}:e===f.CATEGORY_TYPE_FIXED_DURATION?{className:"fixed-duration-badge",label:t}:null};exports.ProductCategoriesControl=function(e){var S,q,T,x,N,P,h=e.isLoading,M=e.stepIndex,A=o.useTranslation("Design").t,k=r.useContext(g.ProductSetLoadingContext),j=k.providerHasMap,V=k.expandedProductCategories,D=k.setExpandedProductCategories,F=k.zones,R=a.useFormContext(),Y=t.__read(r.useState(!1),2),B=Y[0],L=Y[1],w=t.__read(r.useState(!1),2),O=w[0],G=w[1],H=t.__read(r.useState(!1),2),U=H[0],z=H[1],Q=R.control,K=R.formState.errors,W=R.clearErrors,X=R.watch,J=R.trigger,Z=R.getValues,$=R.setValue,ee=X("steps.".concat(M,".hasMap"))||!1,te="steps.".concat(M,".productCategories"),re=a.useFieldArray({name:te,control:Q,keyName:"_id"}),ne=re.fields,oe=re.append,ie=re.remove,ae=t.__read(r.useState({}),2),ue=ae[0],de=ae[1],le=p.useSortableTreeFunctions({fieldName:te,remove:ie}),se=le.edit,ce=le.saveValidField,me=le.cancelChanges,pe=a.useWatch({control:Q,name:te}),ve=null===(q=null===(S=null==K?void 0:K.steps)||void 0===S?void 0:S[M])||void 0===q?void 0:q.productCategories,ge=null===(x=null===(T=null==K?void 0:K.steps)||void 0===T?void 0:T[M])||void 0===x?void 0:x.venueMapSetId,fe=null===(P=null===(N=null==K?void 0:K.steps)||void 0===N?void 0:N[M])||void 0===P?void 0:P.pointProducts,ye=Boolean(ge||fe),Ce=l.useSensor(l.MouseSensor,{activationConstraint:{distance:10}});return r.useEffect((function(){pe&&pe.length&&pe.forEach((function(e){var r,n,o=null===(r=e.products)||void 0===r?void 0:r.reduce((function(e,t){return e+Number(t.price)*Number(t.totalQuantity)}),0),i=null===(n=e.products)||void 0===n?void 0:n.reduce((function(e,t){return e+(t.isUnlimited?0:Number(t.totalQuantity))}),0);de((function(r){var n;return t.__assign(t.__assign({},r),((n={})[(null==e?void 0:e.id)||e.uniqueId]={price:o,quantity:i},n))}))}))}),[pe]),r.useEffect((function(){1===ne.length&&D((function(e){var r,n,o;return t.__assign(t.__assign({},e),((r={})[String((null===(n=ne[0])||void 0===n?void 0:n.id)||(null===(o=ne[0])||void 0===o?void 0:o.uniqueId))]=!0,r))}))}),[ne]),n.createElement(n.Fragment,null,n.createElement(m.SortableTree,{sensors:[Ce],items:ne.map((function(e){return String(e._id)})),onDragEnd:function(e){var t=e.active,r=e.over;if(t&&r&&(null==t?void 0:t.id)&&(null==r?void 0:r.id)){var n=ne.findIndex((function(e){return e._id===t.id})),o=ne.findIndex((function(e){return e._id===r.id}));if(n!==o){var i=Z(te);if(i){var a=_.sortArrayByIndex(_.moveArrayElements(i,n,o));$(te,a)}}}}},ne.map((function(e,r){var o=(null==e?void 0:e.id)?String(e.id):e.uniqueId,u=function(){!function(e){D((function(r){var n;return t.__assign(t.__assign({},r),((n={})[e]=!r[e],n))}))}(o)};return n.createElement(a.Controller,{key:"product-category-".concat(e._id),name:"".concat(te,".").concat(r,".name"),control:Q,rules:{required:A("Validation:fieldRequired",{attribute:A("name")})},render:function(t){var a,d,l,s=t.field,p=s.value,v=s.onChange;return n.createElement(m.SortableTree.Item,{id:e._id,title:p,isExpanded:V[o],setIsExpanded:u,edit:function(){return se(r)},cancelChanges:function(){return me(r)},isInvalid:!!ve,badge:n.createElement(i.Badge,{className:"category-badge"},A("productCategory")),isIconInHeader:!1,subTitle:n.createElement("div",{className:"product-set-badges-container"},n.createElement("div",{className:"product-set-subtitle-dot product-set-subtitle-category-dot"}),n.createElement("span",null,null!==(l=null===(d=ue[null!==(a=null==e?void 0:e.id)&&void 0!==a?a:e.uniqueId])||void 0===d?void 0:d.quantity)&&void 0!==l?l:"N/A"," ",A("products"))),treeLineIconColor:"#1A93AA",modalLabel:A("addNewCategory"),secondaryBadge:I(e.type,A(e.type)),modalClass:c.ProductSetModalClasses.category,isNewAdded:U,body:n.createElement(y.ProductCategoryControl,{isLoading:h,onCategoryNameChange:v,categoryName:p,stepIndex:M,productCategoryIndex:r}),onDelete:function(){return ie(r)},validate:function(){return J("steps.".concat(M,".productCategories.").concat(r))},saveValidField:ce,sortableItems:e.products?e.products.filter((function(e){return e.id})).map((function(e){var t=e.id;return String(t)})):[]},n.createElement(C.ProductsControl,{isLoading:h,quantityType:e.quantityType,hasTicket:null==e?void 0:e.hasTicket,stepIndex:M,zones:F,productCategoryIndex:r,categoryType:e.type}))}})}))),n.createElement(v.CreateProductSetItem,{title:A("addCategory"),onClick:function(){L(!0)}}),n.createElement(b.SelectCategoryModal,{isVisible:B,onHide:function(){return L(!1)},onCategorySelect:function(e){oe(function(e,t){return{id:null,uniqueId:s.uniqueId("product-category"),name:"",minSubItems:null,maxSubItems:null,quantityType:f.QUANTITY_TYPE_STANDARD,type:e,isTimeRelated:!1,collectUserInfo:!1,hasTicket:e===f.CATEGORY_TYPE_TICKETS,allowDeposits:!1,remainderExpireAfter:void 0,hasBookingManagement:!1,weight:0,isReusable:!1,hasSubEvents:!1,products:[],zoneId:null,sort:t}}(e,ne.length)),z(!0),(null==ve?void 0:ve.type)===u.manualErrorType&&W(te)}}),j&&ee&&n.createElement(n.Fragment,null,n.createElement(v.CreateProductSetItem,{title:A("editMap"),onClick:function(){G(!0)},className:d("mt-3",ye&&"mb-3",ye&&"is-invalid")}),ye&&n.createElement("div",{className:"manual-form-error"},ge&&A("Validation:fieldRequired",{attribute:A("Design:venueMapSet")}),fe&&A("Validation:fieldMinNumber",{attribute:A("pointProduct"),min:1})),n.createElement(E.VenueMapSetModal,{isVisible:O,setIsVisible:G,stepIndex:M})),n.createElement("div",{className:"manual-form-error"},ve&&ve.message))},exports.getBadgeConfig=I;
@@ -11,7 +11,6 @@ export interface ProductCategoryControlValues extends FormValues {
11
11
  maxSubItems: number | null;
12
12
  quantityType: QuantityType;
13
13
  type: CategoryType;
14
- isRelyOnPeople: boolean;
15
14
  isTimeRelated: boolean;
16
15
  collectUserInfo: boolean;
17
16
  hasTicket: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"ProductCategoryControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/product-category/ProductCategoryControl.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAE1F,OAAO,EACL,YAAY,EACZ,YAAY,EAKb,MAAM,kEAAkE,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAG9E,OAAO,EAAE,gBAAgB,EAAmB,MAAM,UAAU,CAAC;AAI7D,MAAM,WAAW,4BAA6B,SAAQ,UAAU;IAC9D,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,YAAY,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IAErB,oBAAoB,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAQD,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,SAAS,GACV,EAAE,2BAA2B,eA2f7B"}
1
+ {"version":3,"file":"ProductCategoryControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/product-category/ProductCategoryControl.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAE1F,OAAO,EACL,YAAY,EACZ,YAAY,EAKb,MAAM,kEAAkE,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAG9E,OAAO,EAAE,gBAAgB,EAAmB,MAAM,UAAU,CAAC;AAI7D,MAAM,WAAW,4BAA6B,SAAQ,UAAU;IAC9D,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,YAAY,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IAErB,oBAAoB,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAQD,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,SAAS,GACV,EAAE,2BAA2B,eAqe7B"}
@@ -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"),n=require("react"),a=e(n),r=require("react-i18next"),o=require("react-bootstrap"),l=require("react-hook-form"),c=e(require("@licklist/plugins/dist/services/Form/HookFormService")),m=require("@react-aria/utils"),i=require("../../static/switch/Switch.js"),u=require("../../static/switch/BooleanSwitch.js"),s=require("../../assets/dashboard/increment.svg.js");require("../../static/index.js");var d=require("../form/context.js"),E=require("@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper"),p=[E.CATEGORY_TYPE_TICKETS,E.CATEGORY_TYPE_FIXED_DURATION,E.CATEGORY_TYPE_GAME];exports.ProductCategoryControl=function(e){var v,I,C,b,f=e.isLoading,h=e.categoryName,g=e.onCategoryNameChange,F=e.productCategoryIndex,x=e.stepIndex,y=l.useFormContext(),T=y.control,S=y.formState.errors,k=y.register,G=y.clearErrors,N=y.setValue,w=y.getValues,_=y.watch,q=y.trigger,R=r.useTranslation("Design").t,P=t.__read(n.useState(!1),2),A=P[0],L=P[1],Y="steps.".concat(x,".productCategories.").concat(F),D=l.useWatch({name:Y}),O=_("".concat(Y,".maxSubItems"))||0,B=_("".concat(Y,".minSubItems"))||0,V=_("".concat(Y,".allowDeposits")),M=p.includes(D.type),j=null===(b=null===(C=null===(I=null===(v=null==S?void 0:S.steps)||void 0===v?void 0:v[x])||void 0===I?void 0:I.productCategories)||void 0===C?void 0:C[F])||void 0===b?void 0:b.products,z=m.useId(),U=m.useId(),H=m.useId(),K=m.useId(),X=m.useId(),Q=m.useId(),W=m.useId(),J=m.useId(),Z=m.useId(),$=m.useId(),ee=m.useId(),te=m.useId(),ne=n.useContext(d.ProductSetLoadingContext),ae=ne.providerHasBookingManagement,re=ne.zones,oe=void 0===re?[]:re,le=n.useCallback((function(){return L((function(e){return!e}))}),[]);n.useEffect((function(){q("".concat(Y,".maxSubItems"))}),[B,Y]),n.useEffect((function(){q("".concat(Y,".minSubItems"))}),[O,Y]);var ce=D.type===E.CATEGORY_TYPE_FIXED_DURATION||D.type===E.CATEGORY_TYPE_GAME;return a.createElement(a.Fragment,null,a.createElement(o.Col,{md:12,xl:!0,className:"p-0"},a.createElement(o.Form.Group,{controlId:U},a.createElement(o.Form.Label,null,R("nameOfTheCategory")),a.createElement(o.Form.Control,t.__assign({},k("".concat(Y,".name"),{required:R("Validation:fieldRequired",{attribute:R("name")}),validate:function(){return(null==j?void 0:j.type)===c.manualErrorType&&G("".concat(Y,".products")),!0}}),{value:h,onChange:g,isInvalid:c.isInvalid("".concat(Y,".name"),S),placeholder:R("name"),disabled:f})),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(Y,".name"),S))),a.createElement(o.Form.Group,{controlId:X},a.createElement(l.Controller,{control:T,name:"".concat(Y,".quantityType"),render:function(e){var t=e.field;return a.createElement(o.Form.Group,{className:"d-flex flex-column flex-grow-1 align-items-start"},a.createElement(o.Form.Label,null,R("quantityType")),a.createElement(i.Switch,{name:t.name,options:E.QUANTITY_TYPES.map((function(e){return{key:e,id:e,value:R(e)}})),value:t.value,onChange:t.onChange,disabled:f}))}})),a.createElement(o.Row,null,a.createElement(o.Col,{md:6,sm:6,xs:6},a.createElement(o.Form.Group,{controlId:H},a.createElement(o.Form.Label,null,R("minItems")),a.createElement(o.InputGroup,{hasValidation:!0},a.createElement(o.InputGroup.Prepend,{className:"arrow-up-btn",onClick:function(){var e=Number(w("".concat(Y,".minSubItems"))||0);N("".concat(Y,".minSubItems"),e+1,{shouldValidate:!0})}},a.createElement(o.InputGroup.Text,{className:"py-0 px-3"},a.createElement(s.ReactComponent,null))),a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.value,r=t.onChange,l=t.name,m=t.ref;return a.createElement(o.Form.Control,{ref:m,type:"number",min:0,step:1,value:null===n?"":n,onChange:r,isInvalid:c.isInvalid("".concat(Y,".minSubItems"),S),disabled:f,name:l})},control:T,name:"".concat(Y,".minSubItems"),rules:{min:{value:0,message:R("Validation:fieldMinNumber",{attribute:R("minItems"),min:0})},max:O?{value:Number(O),message:R("Validation:fieldMaxNumber",{attribute:R("minItems"),max:R("maxItems")})}:void 0}}),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(Y,".minSubItems"),S))))),a.createElement(o.Col,{md:6,sm:6,xs:6},a.createElement(o.Form.Group,{controlId:K},a.createElement(o.Form.Label,null,R("maxItems")),a.createElement(o.InputGroup,{hasValidation:!0},a.createElement(o.InputGroup.Prepend,{className:"arrow-up-btn",onClick:function(){var e=Number(w("".concat(Y,".maxSubItems"))||0);N("".concat(Y,".maxSubItems"),e+1,{shouldValidate:!0})}},a.createElement(o.InputGroup.Text,{className:"py-0 px-3"},a.createElement(s.ReactComponent,null))),a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.value,r=t.onChange,l=t.name,m=t.ref;return a.createElement(o.Form.Control,{ref:m,type:"number",step:1,name:l,value:null===n?"":n,onChange:r,isInvalid:c.isInvalid("".concat(Y,".maxSubItems"),S),disabled:f})},control:T,name:"".concat(Y,".maxSubItems"),rules:{min:{value:Number(B),message:R("Validation:fieldGreaterMinNumber",{attribute:R("maxItems"),min:R("minItems")})}}}),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(Y,".maxSubItems"),S)))))),ce&&a.createElement(o.Row,null,a.createElement(o.Col,null,a.createElement(o.Form.Group,{controlId:$},a.createElement(o.Form.Label,null,R("Design:zone")),a.createElement(l.Controller,{control:T,name:"".concat(Y,".zoneId"),render:function(e){var n=e.field;return a.createElement(o.Form.Control,t.__assign({as:"select",isInvalid:c.isInvalid("".concat(Y,".zoneId"),S)},n),a.createElement("option",{value:null},R("Design:choose")),oe.map((function(e){return a.createElement("option",{key:e.id,value:e.id},e.name)})))},rules:{required:{value:ae,message:R("Validation:fieldRequired",{attribute:R("zone")})}}}),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(Y,".zoneId"),S)))))),a.createElement(o.Col,{md:12,xl:!0,className:"p-0"},a.createElement(o.Form.Group,{controlId:z,className:"custom-checkbox"},a.createElement(o.Form.Check,{custom:!0,type:"checkbox",name:z,disabled:f,id:"check-api"},a.createElement(o.Form.Check.Input,{checked:A,onChange:le,type:"checkbox"}),a.createElement(o.Form.Check.Label,null,R("showAdvancedOptions")))),a.createElement(o.Collapse,{in:A},a.createElement("div",null,M&&a.createElement(o.Form.Group,{controlId:Z,className:"advanced-switch-container"},a.createElement(o.Form.Label,null,R("hasTicket")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:D.type===E.CATEGORY_TYPE_TICKETS})},control:T,name:"".concat(Y,".hasTicket")}))),D.hasTicket&&a.createElement(o.Form.Group,{controlId:J,className:"advanced-switch-container"},a.createElement(o.Form.Label,null,R("collectUserInfo")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:f})},control:T,name:"".concat(Y,".collectUserInfo")}))),a.createElement(o.Form.Group,{controlId:Q,className:"advanced-switch-container"},a.createElement(o.Form.Label,null,R("isRelyOnPeople")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:f||D.hasTicket})},control:T,name:"".concat(Y,".isRelyOnPeople")}))),!D.hasTicket&&a.createElement(o.Form.Group,{controlId:W,className:"advanced-switch-container"},a.createElement(a.Fragment,null,a.createElement(o.Form.Label,null,R("isTimeRelated")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:f})},control:T,name:"".concat(Y,".isTimeRelated")})))),a.createElement(o.Form.Group,{controlId:ee,className:"advanced-switch-container"},a.createElement(o.Form.Label,null,R("allowDeposits")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:f})},control:T,name:"".concat(Y,".allowDeposits")}))),V&&a.createElement(o.Form.Group,{controlId:te,className:"deposit-days"},a.createElement(o.Form.Label,null,R("depositDays")),a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.value,r=t.onChange,l=t.name,m=t.ref;return a.createElement(o.Form.Control,{ref:m,type:"number",min:0,step:1,value:n,onChange:r,isInvalid:c.isInvalid("".concat(Y,".remainderExpireAfter"),S),disabled:f,name:l})},control:T,name:"".concat(Y,".remainderExpireAfter")}),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(Y,".remainderExpireAfter"),S)))))))};
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=require("react"),a=e(n),r=require("react-i18next"),o=require("react-bootstrap"),l=require("react-hook-form"),c=e(require("@licklist/plugins/dist/services/Form/HookFormService")),m=require("@react-aria/utils"),i=require("../../static/switch/Switch.js"),u=require("../../static/switch/BooleanSwitch.js"),s=require("../../assets/dashboard/increment.svg.js");require("../../static/index.js");var d=require("../form/context.js"),E=require("@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper"),p=[E.CATEGORY_TYPE_TICKETS,E.CATEGORY_TYPE_FIXED_DURATION,E.CATEGORY_TYPE_GAME];exports.ProductCategoryControl=function(e){var v,I,C,b,f=e.isLoading,h=e.categoryName,g=e.onCategoryNameChange,F=e.productCategoryIndex,x=e.stepIndex,y=l.useFormContext(),T=y.control,S=y.formState.errors,k=y.register,G=y.clearErrors,N=y.setValue,w=y.getValues,_=y.watch,q=y.trigger,R=r.useTranslation("Design").t,A=t.__read(n.useState(!1),2),P=A[0],Y=A[1],D="steps.".concat(x,".productCategories.").concat(F),L=l.useWatch({name:D}),O=_("".concat(D,".maxSubItems"))||0,V=_("".concat(D,".minSubItems"))||0,B=_("".concat(D,".allowDeposits")),M=p.includes(L.type),j=null===(b=null===(C=null===(I=null===(v=null==S?void 0:S.steps)||void 0===v?void 0:v[x])||void 0===I?void 0:I.productCategories)||void 0===C?void 0:C[F])||void 0===b?void 0:b.products,z=m.useId(),U=m.useId(),H=m.useId(),K=m.useId(),X=m.useId(),Q=m.useId(),W=m.useId(),J=m.useId(),Z=m.useId(),$=m.useId(),ee=m.useId(),te=n.useContext(d.ProductSetLoadingContext),ne=te.providerHasBookingManagement,ae=te.zones,re=void 0===ae?[]:ae,oe=n.useCallback((function(){return Y((function(e){return!e}))}),[]);n.useEffect((function(){q("".concat(D,".maxSubItems"))}),[V,D]),n.useEffect((function(){q("".concat(D,".minSubItems"))}),[O,D]);var le=L.type===E.CATEGORY_TYPE_FIXED_DURATION||L.type===E.CATEGORY_TYPE_GAME;return a.createElement(a.Fragment,null,a.createElement(o.Col,{md:12,xl:!0,className:"p-0"},a.createElement(o.Form.Group,{controlId:U},a.createElement(o.Form.Label,null,R("nameOfTheCategory")),a.createElement(o.Form.Control,t.__assign({},k("".concat(D,".name"),{required:R("Validation:fieldRequired",{attribute:R("name")}),validate:function(){return(null==j?void 0:j.type)===c.manualErrorType&&G("".concat(D,".products")),!0}}),{value:h,onChange:g,isInvalid:c.isInvalid("".concat(D,".name"),S),placeholder:R("name"),disabled:f})),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(D,".name"),S))),a.createElement(o.Form.Group,{controlId:X},a.createElement(l.Controller,{control:T,name:"".concat(D,".quantityType"),render:function(e){var t=e.field;return a.createElement(o.Form.Group,{className:"d-flex flex-column flex-grow-1 align-items-start"},a.createElement(o.Form.Label,null,R("quantityType")),a.createElement(i.Switch,{name:t.name,options:E.QUANTITY_TYPES.map((function(e){return{key:e,id:e,value:R(e)}})),value:t.value,onChange:t.onChange,disabled:f}))}})),a.createElement(o.Row,null,a.createElement(o.Col,{md:6,sm:6,xs:6},a.createElement(o.Form.Group,{controlId:H},a.createElement(o.Form.Label,null,R("minItems")),a.createElement(o.InputGroup,{hasValidation:!0},a.createElement(o.InputGroup.Prepend,{className:"arrow-up-btn",onClick:function(){var e=Number(w("".concat(D,".minSubItems"))||0);N("".concat(D,".minSubItems"),e+1,{shouldValidate:!0})}},a.createElement(o.InputGroup.Text,{className:"py-0 px-3"},a.createElement(s.ReactComponent,null))),a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.value,r=t.onChange,l=t.name,m=t.ref;return a.createElement(o.Form.Control,{ref:m,type:"number",min:0,step:1,value:null===n?"":n,onChange:r,isInvalid:c.isInvalid("".concat(D,".minSubItems"),S),disabled:f,name:l})},control:T,name:"".concat(D,".minSubItems"),rules:{min:{value:0,message:R("Validation:fieldMinNumber",{attribute:R("minItems"),min:0})},max:O?{value:Number(O),message:R("Validation:fieldMaxNumber",{attribute:R("minItems"),max:R("maxItems")})}:void 0}}),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(D,".minSubItems"),S))))),a.createElement(o.Col,{md:6,sm:6,xs:6},a.createElement(o.Form.Group,{controlId:K},a.createElement(o.Form.Label,null,R("maxItems")),a.createElement(o.InputGroup,{hasValidation:!0},a.createElement(o.InputGroup.Prepend,{className:"arrow-up-btn",onClick:function(){var e=Number(w("".concat(D,".maxSubItems"))||0);N("".concat(D,".maxSubItems"),e+1,{shouldValidate:!0})}},a.createElement(o.InputGroup.Text,{className:"py-0 px-3"},a.createElement(s.ReactComponent,null))),a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.value,r=t.onChange,l=t.name,m=t.ref;return a.createElement(o.Form.Control,{ref:m,type:"number",step:1,name:l,value:null===n?"":n,onChange:r,isInvalid:c.isInvalid("".concat(D,".maxSubItems"),S),disabled:f})},control:T,name:"".concat(D,".maxSubItems"),rules:{min:{value:Number(V),message:R("Validation:fieldGreaterMinNumber",{attribute:R("maxItems"),min:R("minItems")})}}}),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(D,".maxSubItems"),S)))))),le&&a.createElement(o.Row,null,a.createElement(o.Col,null,a.createElement(o.Form.Group,{controlId:Z},a.createElement(o.Form.Label,null,R("Design:zone")),a.createElement(l.Controller,{control:T,name:"".concat(D,".zoneId"),render:function(e){var n=e.field;return a.createElement(o.Form.Control,t.__assign({as:"select",isInvalid:c.isInvalid("".concat(D,".zoneId"),S)},n),a.createElement("option",{value:null},R("Design:choose")),re.map((function(e){return a.createElement("option",{key:e.id,value:e.id},e.name)})))},rules:{required:{value:ne,message:R("Validation:fieldRequired",{attribute:R("zone")})}}}),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(D,".zoneId"),S)))))),a.createElement(o.Col,{md:12,xl:!0,className:"p-0"},a.createElement(o.Form.Group,{controlId:z,className:"custom-checkbox"},a.createElement(o.Form.Check,{custom:!0,type:"checkbox",name:z,disabled:f,id:"check-api"},a.createElement(o.Form.Check.Input,{checked:P,onChange:oe,type:"checkbox"}),a.createElement(o.Form.Check.Label,null,R("showAdvancedOptions")))),a.createElement(o.Collapse,{in:P},a.createElement("div",null,M&&a.createElement(o.Form.Group,{controlId:J,className:"advanced-switch-container"},a.createElement(o.Form.Label,null,R("hasTicket")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:L.type===E.CATEGORY_TYPE_TICKETS})},control:T,name:"".concat(D,".hasTicket")}))),L.hasTicket&&a.createElement(o.Form.Group,{controlId:W,className:"advanced-switch-container"},a.createElement(o.Form.Label,null,R("collectUserInfo")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:f})},control:T,name:"".concat(D,".collectUserInfo")}))),!L.hasTicket&&a.createElement(o.Form.Group,{controlId:Q,className:"advanced-switch-container"},a.createElement(a.Fragment,null,a.createElement(o.Form.Label,null,R("isTimeRelated")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:f})},control:T,name:"".concat(D,".isTimeRelated")})))),a.createElement(o.Form.Group,{controlId:$,className:"advanced-switch-container"},a.createElement(o.Form.Label,null,R("allowDeposits")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:f})},control:T,name:"".concat(D,".allowDeposits")}))),B&&a.createElement(o.Form.Group,{controlId:ee,className:"deposit-days"},a.createElement(o.Form.Label,null,R("depositDays")),a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.value,r=t.onChange,l=t.name,m=t.ref;return a.createElement(o.Form.Control,{ref:m,type:"number",min:0,step:1,value:n,onChange:r,isInvalid:c.isInvalid("".concat(D,".remainderExpireAfter"),S),disabled:f,name:l})},control:T,name:"".concat(D,".remainderExpireAfter")}),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(D,".remainderExpireAfter"),S)))))))};
@@ -1 +1 @@
1
- {"version":3,"file":"ManualBookingSummary.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/summary/ManualBookingSummary.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+DAA+D,CAAC;AAUnG,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,oBAAoB,sFAO9B,yBAAyB,gBAyE3B,CAAC"}
1
+ {"version":3,"file":"ManualBookingSummary.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/summary/ManualBookingSummary.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+DAA+D,CAAC;AAUnG,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,oBAAoB,sFAO9B,yBAAyB,gBA0E3B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.486-dev.49",
3
+ "version": "0.44.486-dev.50",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -53,7 +53,7 @@
53
53
  "@fortawesome/free-brands-svg-icons": "5.15.2",
54
54
  "@fortawesome/free-solid-svg-icons": "5.15.2",
55
55
  "@fortawesome/react-fontawesome": "0.1.9",
56
- "@licklist/core": ">=0.15.28-dev.0 < 0.15.28",
56
+ "@licklist/core": ">=0.15.41-dev.0 < 0.15.41",
57
57
  "@licklist/eslint-config": "0.3.4",
58
58
  "@licklist/plugins": ">=0.20.133-dev.5 < 0.20.133",
59
59
  "@mdx-js/react": "1.6.22",
@@ -60,7 +60,6 @@ const contextValue = {
60
60
  minSubItems: 1,
61
61
  maxSubItems: 10,
62
62
  quantityType: "constant",
63
- isRelyOnPeople: false,
64
63
  isTimeRelated: false,
65
64
  hasTicket: false,
66
65
  allowDeposits: false,
@@ -126,7 +125,6 @@ const contextValue = {
126
125
  minSubItems: 0,
127
126
  maxSubItems: 0,
128
127
  quantityType: "recharging",
129
- isRelyOnPeople: false,
130
128
  isTimeRelated: false,
131
129
  hasTicket: false,
132
130
  allowDeposits: false,
@@ -144,7 +142,6 @@ const contextValue = {
144
142
  minSubItems: 0,
145
143
  maxSubItems: 0,
146
144
  quantityType: "recharging",
147
- isRelyOnPeople: false,
148
145
  isTimeRelated: false,
149
146
  hasTicket: false,
150
147
  allowDeposits: false,
@@ -713,7 +710,6 @@ const defaultProductSets = [
713
710
  minSubItems: 1,
714
711
  maxSubItems: 10,
715
712
  quantityType: "constant",
716
- isRelyOnPeople: false,
717
713
  isTimeRelated: false,
718
714
  hasTicket: false,
719
715
  allowDeposits: false,
@@ -779,7 +775,6 @@ const defaultProductSets = [
779
775
  minSubItems: 0,
780
776
  maxSubItems: 0,
781
777
  quantityType: "recharging",
782
- isRelyOnPeople: false,
783
778
  isTimeRelated: false,
784
779
  hasTicket: false,
785
780
  allowDeposits: false,
@@ -797,7 +792,6 @@ const defaultProductSets = [
797
792
  minSubItems: 0,
798
793
  maxSubItems: 0,
799
794
  quantityType: "recharging",
800
- isRelyOnPeople: false,
801
795
  isTimeRelated: false,
802
796
  hasTicket: false,
803
797
  allowDeposits: false,
@@ -906,7 +900,6 @@ const defaultProductSets = [
906
900
  minSubItems: 1,
907
901
  maxSubItems: 10,
908
902
  quantityType: "constant",
909
- isRelyOnPeople: false,
910
903
  isTimeRelated: false,
911
904
  hasTicket: false,
912
905
  allowDeposits: false,
@@ -972,7 +965,6 @@ const defaultProductSets = [
972
965
  minSubItems: 0,
973
966
  maxSubItems: 0,
974
967
  quantityType: "recharging",
975
- isRelyOnPeople: false,
976
968
  isTimeRelated: false,
977
969
  hasTicket: false,
978
970
  allowDeposits: false,
@@ -990,7 +982,6 @@ const defaultProductSets = [
990
982
  minSubItems: 0,
991
983
  maxSubItems: 0,
992
984
  quantityType: "recharging",
993
- isRelyOnPeople: false,
994
985
  isTimeRelated: false,
995
986
  hasTicket: false,
996
987
  allowDeposits: false,
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  DEFAULT_OPERATIONAL_COST_TYPE,
3
3
  DEFAULT_PRODUCT_SET_TYPE,
4
+ DEFAULT_RELY_ON_PEOPLE_TYPE,
4
5
  ProductSet,
5
6
  } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
6
7
  import { getFilteredTemplates } from "../../../product-set/utils/index";
@@ -15,6 +16,7 @@ export const getDefaultValues = (
15
16
  type: productSet?.type ?? DEFAULT_PRODUCT_SET_TYPE,
16
17
  termsAndConditions: productSet?.termsAndConditions ?? "",
17
18
  operationalCost: productSet?.operationalCost ?? DEFAULT_OPERATIONAL_COST_TYPE,
19
+ relyOnPeopleType: productSet?.relyOnPeopleType ?? DEFAULT_RELY_ON_PEOPLE_TYPE,
18
20
  thankYouPageUrl: productSet?.thankYouPageUrl ?? "",
19
21
  isDefault: productSet?.isDefault ?? false,
20
22
  fieldSetId: productSet?.fieldSetId,
@@ -24,7 +26,7 @@ export const getDefaultValues = (
24
26
  : undefined,
25
27
  smsTemplates:
26
28
  productSet?.smsTemplates && productSet?.smsTemplates?.length > 0
27
- ? getFilteredTemplates(productSet?.mailTemplates)
29
+ ? getFilteredTemplates(productSet?.smsTemplates)
28
30
  : undefined,
29
31
  steps:
30
32
  productSet?.steps?.map(({ productCategories, ...step }) => ({
@@ -26,7 +26,6 @@ const MENU_STEPS = [
26
26
  maxSubItems: 1,
27
27
  quantityType: "constant",
28
28
  type: "menuItems",
29
- isRelyOnPeople: false,
30
29
  collectUserInfo: false,
31
30
  isTimeRelated: false,
32
31
  hasTicket: false,
@@ -212,7 +212,6 @@ const MENU_STEPS = [
212
212
  minSubItems: 1,
213
213
  quantityType: "constant" as const,
214
214
  type: "menuItems" as const,
215
- isRelyOnPeople: false,
216
215
  collectUserInfo: false,
217
216
  isTimeRelated: false,
218
217
  hasTicket: false,
@@ -7,8 +7,13 @@ import {
7
7
  OPERATIONAL_COST_CUSTOMER,
8
8
  OPERATIONAL_COST_PROVIDER,
9
9
  OPERATIONAL_COST_TYPES,
10
+ RELY_ON_PEOPLE_QUANTITY,
11
+ RELY_ON_PEOPLE_PRODUCT_CAPACITY_QUANTITY,
12
+ RELY_ON_PEOPLE_PRODUCT_QUANTITY,
10
13
  OperationalCostType,
11
14
  ProductSetType,
15
+ RELY_ON_PEOPLE_TYPES,
16
+ RelyOnPeopleType,
12
17
  } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
13
18
  import { useId } from "@react-aria/utils";
14
19
  import { FieldSet } from "@licklist/core/dist/DataMapper/Order/FieldSetDataMapper";
@@ -34,6 +39,12 @@ const OPERATIONAL_COST_TITLES = {
34
39
  [OPERATIONAL_COST_CUSTOMER]: "operationalCostCustomer",
35
40
  } as const;
36
41
 
42
+ const RELY_ON_PEOPLE_TYPE_TITLES = {
43
+ [RELY_ON_PEOPLE_PRODUCT_CAPACITY_QUANTITY]: "peopleProductCapacityQuantity",
44
+ [RELY_ON_PEOPLE_PRODUCT_QUANTITY]: "peopleProductQuantity",
45
+ [RELY_ON_PEOPLE_QUANTITY]: "peopleQuantity",
46
+ };
47
+
37
48
  export interface TemplateItem {
38
49
  id: string;
39
50
  value: EmailTemplate | SmsTemplate;
@@ -48,6 +59,7 @@ export interface ProductSetControlValues extends DateAndRecurrenceInputValues {
48
59
  isDefault: boolean;
49
60
  operationalCost: OperationalCostType;
50
61
  productGroups?: SelectItem[];
62
+ relyOnPeopleType: RelyOnPeopleType;
51
63
  fieldSetId?: number;
52
64
  steps?: Step[];
53
65
  emailTemplates?: TemplateItem[];
@@ -100,6 +112,7 @@ export function ProductSetControl({
100
112
 
101
113
  const nameId = useId();
102
114
  const termsAndConditionsId = useId();
115
+ const relyOnPeopleTypeId = useId();
103
116
 
104
117
  return (
105
118
  <Row
@@ -220,6 +233,28 @@ export function ProductSetControl({
220
233
  </Form.Control>
221
234
  </Form.Group>
222
235
 
236
+ <Form.Group controlId={relyOnPeopleTypeId}>
237
+ <Form.Label>{t("peopleQuantityType")}</Form.Label>
238
+ <Form.Control
239
+ {...register("relyOnPeopleType", { required: true })}
240
+ as="select"
241
+ defaultValue={RELY_ON_PEOPLE_PRODUCT_CAPACITY_QUANTITY}
242
+ >
243
+ {Object.keys(RELY_ON_PEOPLE_TYPES).map((relyOnPeopleType) => (
244
+ <option
245
+ value={RELY_ON_PEOPLE_TYPES[relyOnPeopleType]}
246
+ key={RELY_ON_PEOPLE_TYPES[relyOnPeopleType]}
247
+ >
248
+ {t(
249
+ RELY_ON_PEOPLE_TYPE_TITLES[
250
+ RELY_ON_PEOPLE_TYPES[relyOnPeopleType]
251
+ ]
252
+ )}
253
+ </option>
254
+ ))}
255
+ </Form.Control>
256
+ </Form.Group>
257
+
223
258
  <Form.Group controlId={termsAndConditionsId}>
224
259
  <Form.Label>{t("Design:termsAndConditions")}</Form.Label>
225
260
  <Form.Control
@@ -48,7 +48,6 @@ const getCategoryDefaultValue = (
48
48
  maxSubItems: null,
49
49
  quantityType: QUANTITY_TYPE_STANDARD,
50
50
  type: categoryType,
51
- isRelyOnPeople: categoryType === CATEGORY_TYPE_TICKETS,
52
51
  isTimeRelated: false,
53
52
  collectUserInfo: false,
54
53
  hasTicket: categoryType === CATEGORY_TYPE_TICKETS,
@@ -11,6 +11,7 @@ import {
11
11
  import {
12
12
  OPERATIONAL_COST_CUSTOMER,
13
13
  OPERATIONAL_COST_PROVIDER,
14
+ RELY_ON_PEOPLE_PRODUCT_QUANTITY,
14
15
  } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
15
16
  import { FieldSet } from "@licklist/core/dist/DataMapper/Order/FieldSetDataMapper";
16
17
  import { ProductSetForm, ProductSetFormProps } from "./ProductSetForm";
@@ -104,6 +105,7 @@ Default.args = {
104
105
  termsAndConditions: "",
105
106
  isDefault: true,
106
107
  operationalCost: OPERATIONAL_COST_CUSTOMER,
108
+ relyOnPeopleType: RELY_ON_PEOPLE_PRODUCT_QUANTITY,
107
109
  steps: [
108
110
  {
109
111
  id: 1,
@@ -115,7 +117,6 @@ Default.args = {
115
117
  minSubItems: 1,
116
118
  maxSubItems: 10,
117
119
  quantityType: "constant",
118
- isRelyOnPeople: false,
119
120
  isTimeRelated: false,
120
121
  hasTicket: false,
121
122
  allowDeposits: false,
@@ -184,7 +185,6 @@ Default.args = {
184
185
  minSubItems: 0,
185
186
  maxSubItems: 0,
186
187
  quantityType: "recharging",
187
- isRelyOnPeople: false,
188
188
  isTimeRelated: false,
189
189
  hasTicket: false,
190
190
  allowDeposits: false,
@@ -203,7 +203,6 @@ Default.args = {
203
203
  minSubItems: 0,
204
204
  maxSubItems: 0,
205
205
  quantityType: "recharging",
206
- isRelyOnPeople: false,
207
206
  isTimeRelated: false,
208
207
  hasTicket: false,
209
208
  allowDeposits: false,
@@ -289,7 +288,6 @@ Default.args = {
289
288
  minSubItems: 0,
290
289
  maxSubItems: null,
291
290
  quantityType: "recharging",
292
- isRelyOnPeople: false,
293
291
  isTimeRelated: false,
294
292
  hasTicket: false,
295
293
  allowDeposits: false,
@@ -898,7 +896,6 @@ Valid.args = {
898
896
  minSubItems: 0,
899
897
  maxSubItems: 0,
900
898
  quantityType: "recharging",
901
- isRelyOnPeople: false,
902
899
  isTimeRelated: false,
903
900
  hasTicket: false,
904
901
  allowDeposits: false,
@@ -1113,7 +1110,6 @@ Valid.args = {
1113
1110
  minSubItems: 0,
1114
1111
  maxSubItems: 0,
1115
1112
  quantityType: "recharging",
1116
- isRelyOnPeople: false,
1117
1113
  isTimeRelated: false,
1118
1114
  hasTicket: false,
1119
1115
  allowDeposits: false,
@@ -28,7 +28,6 @@ export interface ProductCategoryControlValues extends FormValues {
28
28
  maxSubItems: number | null;
29
29
  quantityType: QuantityType;
30
30
  type: CategoryType;
31
- isRelyOnPeople: boolean;
32
31
  isTimeRelated: boolean;
33
32
  collectUserInfo: boolean;
34
33
  hasTicket: boolean;
@@ -97,7 +96,6 @@ export function ProductCategoryControl({
97
96
  const minSubItemsId = useId();
98
97
  const maxSubItemsId = useId();
99
98
  const quantityType = useId();
100
- const isRelyOnPeopleId = useId();
101
99
  const isTimeRelatedId = useId();
102
100
  const collectUserInfoId = useId();
103
101
  const hasTicketId = useId();
@@ -464,27 +462,6 @@ export function ProductCategoryControl({
464
462
  </Form.Group>
465
463
  )}
466
464
 
467
- <Form.Group
468
- controlId={isRelyOnPeopleId}
469
- className="advanced-switch-container"
470
- >
471
- <Form.Label>{t("isRelyOnPeople")}</Form.Label>
472
-
473
- <div>
474
- <Controller
475
- render={({ field: { name, value, onChange } }) => (
476
- <BooleanSwitch
477
- name={name}
478
- value={Boolean(value)}
479
- onChange={onChange}
480
- disabled={isLoading || category.hasTicket}
481
- />
482
- )}
483
- control={control}
484
- name={`${fieldNamePrefix}.isRelyOnPeople` as const}
485
- />
486
- </div>
487
- </Form.Group>
488
465
  {!category.hasTicket && (
489
466
  <Form.Group
490
467
  controlId={isTimeRelatedId}
@@ -50,6 +50,7 @@ export const ManualBookingSummary = ({
50
50
  >
51
51
  <div>{order.name}</div>
52
52
  <div>
53
+ {/* @TODO change to order.quantyty||order.quantity * capacity when rely on people BE will be ready */}
53
54
  {order.isRelyOnPeople ? `x ${order.quantity} People` : ""}
54
55
  </div>
55
56
  <div>