@licklist/design 0.44.545 → 0.44.546
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.
|
@@ -1 +1 @@
|
|
|
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;AAGhG,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAEtF,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,eAAe,EAAE,mBAAmB,CAAC;IACrC,aAAa,CAAC,EAAE,UAAU,EAAE,CAAC;IAC7B,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3C,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;IAC1B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,4BAA4B,CAAC,EAAE,OAAO,CAAC;CACxC;AAED,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,SAAS,EACT,GAAU,EACV,SAAc,EACd,cAAmB,EACnB,YAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,4BAAoC,GACrC,EAAE,sBAAsB,
|
|
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,CA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,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;IAC1B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,4BAA4B,CAAC,EAAE,OAAO,CAAC;CACxC;AAED,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,SAAS,EACT,GAAU,EACV,SAAc,EACd,cAAmB,EACnB,YAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,4BAAoC,GACrC,EAAE,sBAAsB,eA6RxB"}
|
|
@@ -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"),
|
|
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=e(require("react")),a=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,d,u=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),p=require("@licklist/plugins/dist/validation/Rules/urlRule"),E=(e(p),require("./DateAndRecurrenceInput.js")),g=require("./TutorialGifCard.js"),v=require("../form/StepsControl.js"),P=require("../../typeahead/Typeahead.js"),T=((c={})[u.OPERATIONAL_COST_PROVIDER]="operationalCostProvider",c[u.OPERATIONAL_COST_CUSTOMER]="operationalCostCustomer",c),_=((d={})[u.RELY_ON_PEOPLE_PRODUCT_CAPACITY_QUANTITY]="peopleProductCapacityQuantity",d[u.RELY_ON_PEOPLE_PRODUCT_QUANTITY]="peopleProductQuantity",d[u.RELY_ON_PEOPLE_QUANTITY]="peopleQuantity",d);exports.ProductSetControl=function(e){var c,d=e.companyName,C=e.isLoading,O=e.fee,F=void 0===O?"5%":O,f=e.fieldSets,I=void 0===f?[]:f,y=e.emailTemplates,L=void 0===y?[]:y,N=e.smsTemplates,b=void 0===N?[]:N,A=e.isEventEditProductSet,S=e.isCreateAction,h=e.showEmailTemplate,R=e.showSmsTemplate,k=e.workHours,D=e.providerHasBookingManagement,Y=void 0!==D&&D,q=a.useTranslation(["Design","Validation","Notification"]).t,U=o.useFormContext(),M=U.register,j=U.control,x=U.formState.errors,V=U.watch,G=U.setError,w=U.clearErrors,Q=V("steps"),H=i.useId(),B=i.useId(),W=i.useId();return r.createElement(n.Row,{className:"product-set-form ".concat(A&&"event-edit-product-set")},r.createElement(n.Col,{md:6,sm:12,className:"pr-5"},r.createElement(n.Form.Group,{controlId:H},r.createElement(n.Form.Label,null,q("Design:name"),"*"),r.createElement(n.Form.Control,t.__assign({},M("name",{required:q("Validation:fieldRequired",{attribute:q("name")}),maxLength:255,validate:function(){var e;return Q.length?(null===(e=x.steps)||void 0===e?void 0:e.type)===l.manualErrorType&&w("steps"):G("steps",{type:l.manualErrorType,message:q("Validation:fieldMinNumber",{attribute:q("steps"),min:1})}),!0}}),{placeholder:q("Design:placeholderProductSetName"),isInvalid:Boolean(x.name)})),r.createElement(n.Form.Control.Feedback,{type:"invalid"},null===(c=x.name)||void 0===c?void 0:c.message)),S&&r.createElement(E.DateAndRecurrenceInput,{isEventEditProductSet:A,workHours:k,isLoading:C,providerHasBookingManagement:Y}),r.createElement("div",{className:"divider"}),r.createElement(g.default,null),r.createElement(v.StepsControl,{isLoading:C})),r.createElement(n.Col,{md:6,sm:12},r.createElement("div",{className:"second-column"},r.createElement(n.Form.Group,null,r.createElement(n.Form.Label,{className:"mb-0"},q("Design:operationalCost")),r.createElement("div",{className:"d-flex"},r.createElement("span",{className:"booking-fee-text"},q("bookingFeePaid",{fee:F}))),r.createElement(n.Form.Control,t.__assign({},M("operationalCost",{required:!0}),{as:"select",defaultValue:u.OPERATIONAL_COST_PROVIDER,isInvalid:l.isInvalid("operationalCost",x)}),Object.keys(u.OPERATIONAL_COST_TYPES).map((function(e){return r.createElement("option",{value:u.OPERATIONAL_COST_TYPES[e],key:u.OPERATIONAL_COST_TYPES[e]},q(T[u.OPERATIONAL_COST_TYPES[e]],{companyName:d}))}))),r.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("operationalCost",x))),r.createElement(n.Form.Group,{controlId:W},r.createElement(n.Form.Label,null,q("peopleQuantityType")),r.createElement(n.Form.Control,t.__assign({},M("relyOnPeopleType"),{as:"select",defaultValue:null,isInvalid:l.isInvalid("relyOnPeopleType",x)}),r.createElement("option",{value:""},q("notRequired")," "),Object.keys(u.RELY_ON_PEOPLE_TYPES).map((function(e){return r.createElement("option",{value:u.RELY_ON_PEOPLE_TYPES[e],key:u.RELY_ON_PEOPLE_TYPES[e]},q(_[u.RELY_ON_PEOPLE_TYPES[e]]))}))),r.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("relyOnPeopleType",x))),r.createElement(n.Form.Group,{controlId:B},r.createElement(n.Form.Label,null,q("Design:termsAndConditions")),r.createElement(n.Form.Control,t.__assign({},M("termsAndConditions"),{as:"textarea",rows:2,disabled:C,isInvalid:l.isInvalid("termsAndConditions",x)})),r.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("termsAndConditions",x))),r.createElement(n.Form.Group,null,r.createElement(n.Form.Label,{className:"mt-4"},q("Design:emailTemplate")),h?r.createElement(P.Typeahead,{name:"emailTemplates",options:L,isMultipleChoise:!0,placeholder:q("Design:choose"),noOptionsMessage:q("Design:noActiveTemplates",{notification:q("Design:email")})}):r.createElement(m.default,{message:q("Design:noActiveTemplates",{notification:q("Design:email")})}),r.createElement(n.Form.Label,{className:s(L.length>0?"mt-4":"mt-1")},q("Design:smsTemplate")),R?r.createElement(P.Typeahead,{name:"smsTemplates",options:b,isMultipleChoise:!0,placeholder:q("Design:choose"),noOptionsMessage:q("Design:noActiveTemplates",{notification:q("Design:sms")})}):r.createElement(m.default,{message:q("Design:noActiveTemplates",{notification:q("Design:sms")})})),r.createElement(n.Form.Group,null,r.createElement(o.Controller,{control:j,name:"fieldSetId",render:function(e){var t=e.field,a=Number(t.value);return r.createElement(r.Fragment,null,r.createElement(n.Form.Label,null,q("Design:customFields")),r.createElement(n.Form.Control,{onChange:t.onChange,value:a,as:"select",isInvalid:l.isInvalid("fieldSetId",x)},r.createElement("option",{value:""},q("Design:choose")),null==I?void 0:I.map((function(e){return r.createElement("option",{value:e.id,key:e.id},e.name)}))),r.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("fieldSetId",x)))}})),r.createElement(n.Form.Group,{controlId:"thankYouPageUrlId"},r.createElement(n.Form.Label,null,q("thankYouPageUrl")),r.createElement(n.Form.Control,t.__assign({},M("thankYouPageUrl",{validate:function(e){return!e||(!!p.ruleForUrlWithProtocol.test(e)||q("Validation:fieldValidWebURL",{attribute:q("thankYouPageUrl")}))}}),{isInvalid:l.isInvalid("thankYouPageUrl",x)})),r.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("thankYouPageUrl",x))))))};
|
package/package.json
CHANGED
|
@@ -212,6 +212,7 @@ export function ProductSetControl({
|
|
|
212
212
|
{...register("operationalCost", { required: true })}
|
|
213
213
|
as="select"
|
|
214
214
|
defaultValue={OPERATIONAL_COST_PROVIDER}
|
|
215
|
+
isInvalid={HookFormService.isInvalid("operationalCost", errors)}
|
|
215
216
|
>
|
|
216
217
|
{Object.keys(OPERATIONAL_COST_TYPES).map((operationalCost) => (
|
|
217
218
|
<option
|
|
@@ -229,6 +230,9 @@ export function ProductSetControl({
|
|
|
229
230
|
</option>
|
|
230
231
|
))}
|
|
231
232
|
</Form.Control>
|
|
233
|
+
<Form.Control.Feedback type="invalid">
|
|
234
|
+
{HookFormService.getErrors("operationalCost", errors)}
|
|
235
|
+
</Form.Control.Feedback>
|
|
232
236
|
</Form.Group>
|
|
233
237
|
|
|
234
238
|
<Form.Group controlId={relyOnPeopleTypeId}>
|
|
@@ -237,8 +241,9 @@ export function ProductSetControl({
|
|
|
237
241
|
{...register("relyOnPeopleType")}
|
|
238
242
|
as="select"
|
|
239
243
|
defaultValue={null}
|
|
244
|
+
isInvalid={HookFormService.isInvalid("relyOnPeopleType", errors)}
|
|
240
245
|
>
|
|
241
|
-
<option value="">{t("notRequired")}</option>
|
|
246
|
+
<option value="">{t("notRequired")} </option>
|
|
242
247
|
{Object.keys(RELY_ON_PEOPLE_TYPES).map((relyOnPeopleType) => (
|
|
243
248
|
<option
|
|
244
249
|
value={RELY_ON_PEOPLE_TYPES[relyOnPeopleType]}
|
|
@@ -252,6 +257,9 @@ export function ProductSetControl({
|
|
|
252
257
|
</option>
|
|
253
258
|
))}
|
|
254
259
|
</Form.Control>
|
|
260
|
+
<Form.Control.Feedback type="invalid">
|
|
261
|
+
{HookFormService.getErrors("relyOnPeopleType", errors)}
|
|
262
|
+
</Form.Control.Feedback>
|
|
255
263
|
</Form.Group>
|
|
256
264
|
|
|
257
265
|
<Form.Group controlId={termsAndConditionsId}>
|
|
@@ -261,7 +269,14 @@ export function ProductSetControl({
|
|
|
261
269
|
as="textarea"
|
|
262
270
|
rows={2}
|
|
263
271
|
disabled={isLoading}
|
|
272
|
+
isInvalid={HookFormService.isInvalid(
|
|
273
|
+
"termsAndConditions",
|
|
274
|
+
errors
|
|
275
|
+
)}
|
|
264
276
|
/>
|
|
277
|
+
<Form.Control.Feedback type="invalid">
|
|
278
|
+
{HookFormService.getErrors("termsAndConditions", errors)}
|
|
279
|
+
</Form.Control.Feedback>
|
|
265
280
|
</Form.Group>
|
|
266
281
|
|
|
267
282
|
<Form.Group>
|
|
@@ -324,6 +339,10 @@ export function ProductSetControl({
|
|
|
324
339
|
onChange={field.onChange}
|
|
325
340
|
value={fieldValue}
|
|
326
341
|
as="select"
|
|
342
|
+
isInvalid={HookFormService.isInvalid(
|
|
343
|
+
"fieldSetId",
|
|
344
|
+
errors
|
|
345
|
+
)}
|
|
327
346
|
>
|
|
328
347
|
<option value="">{t("Design:choose")}</option>
|
|
329
348
|
{fieldSets?.map((fieldSet) => {
|
|
@@ -334,6 +353,9 @@ export function ProductSetControl({
|
|
|
334
353
|
);
|
|
335
354
|
})}
|
|
336
355
|
</Form.Control>
|
|
356
|
+
<Form.Control.Feedback type="invalid">
|
|
357
|
+
{HookFormService.getErrors("fieldSetId", errors)}
|
|
358
|
+
</Form.Control.Feedback>
|
|
337
359
|
</>
|
|
338
360
|
);
|
|
339
361
|
}}
|