@licklist/design 0.62.3-dev.1 → 0.62.3-dev.2

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":"CouponFormControl.d.ts","sourceRoot":"","sources":["../../../../src/sales/coupon/control/CouponFormControl.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+DAA+D,CAAC;AAC7F,OAAO,EAOL,eAAe,EACf,UAAU,EACX,MAAM,yDAAyD,CAAC;AAYjE,OAAO,EAAa,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGjE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,UAAU,CAAC;IACzB,eAAe,EAAE,KAAK,CAAC,gBAAgB,GAAG,YAAY,CAAC,CAAC;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,iBAAiB,kCAG3B,eAAe,gBAyVjB,CAAC"}
1
+ {"version":3,"file":"CouponFormControl.d.ts","sourceRoot":"","sources":["../../../../src/sales/coupon/control/CouponFormControl.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+DAA+D,CAAC;AAC7F,OAAO,EAOL,eAAe,EACf,UAAU,EACX,MAAM,yDAAyD,CAAC;AAYjE,OAAO,EAAa,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGjE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,UAAU,CAAC;IACzB,eAAe,EAAE,KAAK,CAAC,gBAAgB,GAAG,YAAY,CAAC,CAAC;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,iBAAiB,kCAG3B,eAAe,gBAuVjB,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"),l=require("react"),n=e(l),r=require("react-i18next"),o=require("react-bootstrap"),a=require("react-hook-form"),i=require("luxon"),m=require("../../../typeahead/Typeahead.js"),s=require("@licklist/core/dist/DataMapper/Product/CouponDataMapper"),u=e(require("@licklist/plugins/dist/validation/Rules/couponCodeRules")),c=require("../utils/index.js");exports.CouponFormControl=function(e){var d,E,p,g,F,v,C,b,_,D=e.isLoading,T=void 0!==D&&D,f=e.productGroups,y=a.useFormContext(),P=y.register,O=y.setValue,x=y.getValues,R=y.formState.errors,G=y.watch,L=r.useTranslation(["Design","Notification","App"]).t,N=t.__read(l.useState([]),2),h=N[0],q=N[1],k=G("startFrom"),A=G("validTill"),w=l.useRef(null),I=l.useRef(null),U=((d={})[s.COUPON_TYPE_FIXED]=L("Design:fixed"),d[s.COUPON_TYPE_FIXED_PER_PERSON]=L("Design:fixedPerPerson"),d[s.COUPON_TYPE_PERCENTAGE]=L("Design:percentage"),d[s.COUPON_TYPE_PERCENTAGE_PER_PERSON]=L("Design:percentagePerPerson"),d),S=((E={})[s.COUPON_TOTAL_TYPE_GROSS]=L("Design:grossTotal"),E[s.COUPON_TOTAL_TYPE_TOTAL]=L("Design:depositTotal"),E);l.useEffect((function(){var e=x("productGroupIds");q(c.convertToTypeaheadOptions(e))}),[x]),l.useEffect((function(){O("productGroupIds",h)}),[x,O,h]);var V=c.convertToTypeaheadOptions(f);return n.createElement(o.Row,null,n.createElement(o.Col,{md:5},n.createElement("h2",{className:"mb-5"},L("Design:coupon")),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:name")),n.createElement(o.Form.Control,t.__assign({isInvalid:void 0!==R.name},P("name",{required:L("Validation:fieldRequired",{attribute:L("Design:name")})}),{disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(p=null==R?void 0:R.name)||void 0===p?void 0:p.message))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:couponCode")),n.createElement(o.Form.Control,t.__assign({isInvalid:void 0!==R.code},P("code",{required:L("Validation:fieldRequired",{attribute:L("Design:code")}),pattern:{message:"".concat(L("Validation:fieldCouponCode")),value:u}}),{disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(g=null==R?void 0:R.code)||void 0===g?void 0:g.message)))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:discountType")),n.createElement(o.Form.Control,t.__assign({},P("discountType",{required:!0}),{as:"select",defaultValue:null!==(F=x("discountType"))&&void 0!==F?F:1,disabled:T}),Object.keys(U).map((function(e){return n.createElement("option",{value:e,key:e},U[e])}))))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:discount")),n.createElement(o.Form.Control,t.__assign({type:"number",isInvalid:void 0!==R.discount},P("discount",{required:L("Validation:fieldRequired",{attribute:L("Design:discount")})}),{disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(v=null==R?void 0:R.discount)||void 0===v?void 0:v.message)))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:applyOn")),n.createElement(o.Form.Control,t.__assign({},P("totalType",{required:!0}),{as:"select",defaultValue:null!==(C=x("totalType"))&&void 0!==C?C:1,disabled:T}),Object.keys(S).map((function(e){return n.createElement("option",{value:e,key:e},S[e])}))))))),n.createElement(o.Col,{md:{span:5,offset:1}},n.createElement("h2",{className:"mb-5"},L("Design:limitations")),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:startFrom")),n.createElement(o.Form.Control,t.__assign({type:"date"},P("startFrom"),{value:k,isInvalid:void 0!==R.startFrom,onChange:function(e){var t=i.DateTime.fromSQL(e.target.value).toISODate();O("startFrom",t)},className:k&&"date-input-with-value",ref:w,onClick:function(){var e;return null===(e=null==w?void 0:w.current)||void 0===e?void 0:e.showPicker()},disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(b=null==R?void 0:R.startFrom)||void 0===b?void 0:b.message))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:validTill")),n.createElement(o.Form.Control,t.__assign({type:"date"},P("validTill"),{value:A,onChange:function(e){var t=i.DateTime.fromSQL(e.target.value).toISODate();O("validTill",t)},ref:I,className:A&&"date-input-with-value",onClick:function(){var e;return null===(e=null==I?void 0:I.current)||void 0===e?void 0:e.showPicker()},disabled:T}))))),n.createElement(o.Row,null,n.createElement(o.Col,null,n.createElement(o.Form.Group,{className:"mb-3"},n.createElement(o.Form.Label,null,L("Design:productGroups")),n.createElement(m.Typeahead,{name:"productGroupIds",options:V,isMultipleChoise:!0,isCouponForm:!0,placeholder:L("Design:choose"),noOptionsMessage:L("Design:noActiveTemplates",{notification:L("Design:email")})})))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:totalCoupons")),n.createElement(o.Form.Control,t.__assign({},P("totalCoupons"),{type:"number",isInvalid:void 0!==R.totalCoupons,disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(_=null==R?void 0:R.totalCoupons)||void 0===_?void 0:_.message))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:usesPerUser")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("usesPerUser"),{disabled:T}))))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:useAgain")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("useAgain"),{disabled:T})),n.createElement(o.Form.Text,{className:"text-muted"},L("Design:useAgainExplanation")))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:usesPerUserDay")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("usesPerUserDay"),{disabled:T})),n.createElement(o.Form.Text,{className:"text-muted"},L("Design:usesPerUserDayExplanation"))))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:minAmount")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("minAmount"),{disabled:T})),n.createElement(o.Form.Text,{className:"text-muted"},L("Design:minAmountExplanation")))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:maxAmount")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("maxAmount"),{disabled:T})),n.createElement(o.Form.Text,{className:"text-muted"},L("Design:maxAmountExplanation")))))))};
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"),l=require("react"),n=e(l),r=require("react-i18next"),o=require("react-bootstrap"),a=require("react-hook-form"),i=require("luxon"),m=require("../../../typeahead/Typeahead.js"),s=require("@licklist/core/dist/DataMapper/Product/CouponDataMapper"),u=e(require("@licklist/plugins/dist/validation/Rules/couponCodeRules")),d=require("../utils/index.js");exports.CouponFormControl=function(e){var c,E,p,g,F,v,C,b,_,D=e.isLoading,T=void 0!==D&&D,f=e.productGroups,y=a.useFormContext(),P=y.register,O=y.setValue,x=y.getValues,G=y.formState.errors,R=y.watch,L=r.useTranslation(["Design","Notification","App"]).t,N=t.__read(l.useState([]),2),h=N[0],q=N[1],k=R("startFrom"),A=R("validTill"),w=l.useRef(null),I=l.useRef(null),S=((c={})[s.COUPON_TYPE_FIXED]=L("Design:fixed"),c[s.COUPON_TYPE_FIXED_PER_PERSON]=L("Design:fixedPerPerson"),c[s.COUPON_TYPE_PERCENTAGE]=L("Design:percentage"),c[s.COUPON_TYPE_PERCENTAGE_PER_PERSON]=L("Design:percentagePerPerson"),c),U=((E={})[s.COUPON_TOTAL_TYPE_GROSS]=L("Design:grossTotal"),E[s.COUPON_TOTAL_TYPE_TOTAL]=L("Design:depositTotal"),E);l.useEffect((function(){var e=x("productGroupIds");q(d.convertToTypeaheadOptions(e))}),[x]),l.useEffect((function(){O("productGroupIds",h)}),[x,O,h]);var V=d.convertToTypeaheadOptions(f);return n.createElement(o.Row,null,n.createElement(o.Col,{md:5},n.createElement("h2",{className:"mb-5"},L("Design:coupon")),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:name")),n.createElement(o.Form.Control,t.__assign({isInvalid:void 0!==G.name},P("name",{required:L("Validation:fieldRequired",{attribute:L("Design:name")})}),{disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(p=null==G?void 0:G.name)||void 0===p?void 0:p.message))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:couponCode")),n.createElement(o.Form.Control,t.__assign({isInvalid:void 0!==G.code},P("code",{required:L("Validation:fieldRequired",{attribute:L("Design:code")}),pattern:{message:"".concat(L("Validation:fieldCouponCode")),value:u}}),{disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(g=null==G?void 0:G.code)||void 0===g?void 0:g.message)))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:discountType")),n.createElement(o.Form.Control,t.__assign({},P("discountType",{required:!0}),{as:"select",defaultValue:null!==(F=x("discountType"))&&void 0!==F?F:1,disabled:T}),Object.keys(S).map((function(e){return n.createElement("option",{value:e,key:e},S[e])}))))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:discount")),n.createElement(o.Form.Control,t.__assign({type:"number",isInvalid:void 0!==G.discount},P("discount",{required:L("Validation:fieldRequired",{attribute:L("Design:discount")})}),{disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(v=null==G?void 0:G.discount)||void 0===v?void 0:v.message)))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:applyOn")),n.createElement(o.Form.Control,t.__assign({},P("totalType",{required:!0}),{as:"select",defaultValue:null!==(C=x("totalType"))&&void 0!==C?C:1,disabled:T}),Object.keys(U).map((function(e){return n.createElement("option",{value:e,key:e},U[e])}))))))),n.createElement(o.Col,{md:{span:5,offset:1}},n.createElement("h2",{className:"mb-5"},L("Design:limitations")),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:startFrom")),n.createElement(o.Form.Control,t.__assign({type:"date"},P("startFrom"),{value:k,isInvalid:void 0!==G.startFrom,onChange:function(e){var t=i.DateTime.fromSQL(e.target.value).toISODate();O("startFrom",t)},className:k&&"date-input-with-value",ref:w,onClick:function(){var e;return null===(e=null==w?void 0:w.current)||void 0===e?void 0:e.showPicker()},disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(b=null==G?void 0:G.startFrom)||void 0===b?void 0:b.message))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:validTill")),n.createElement(o.Form.Control,t.__assign({type:"date"},P("validTill"),{value:A,onChange:function(e){var t=i.DateTime.fromSQL(e.target.value).toISODate();O("validTill",t)},ref:I,className:A&&"date-input-with-value",onClick:function(){var e;return null===(e=null==I?void 0:I.current)||void 0===e?void 0:e.showPicker()},disabled:T}))))),n.createElement(o.Row,null,n.createElement(o.Col,null,n.createElement(o.Form.Group,{className:"mb-3"},n.createElement(o.Form.Label,null,L("Design:productGroups")),n.createElement(m.Typeahead,{name:"productGroupIds",options:V,isMultipleChoise:!0,isCouponForm:!0,placeholder:L("Design:choose"),noOptionsMessage:L("Design:noSelectedProductGroups")})))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:totalCoupons")),n.createElement(o.Form.Control,t.__assign({},P("totalCoupons"),{type:"number",isInvalid:void 0!==G.totalCoupons,disabled:T})),n.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(_=null==G?void 0:G.totalCoupons)||void 0===_?void 0:_.message))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:usesPerUser")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("usesPerUser"),{disabled:T}))))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:useAgain")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("useAgain"),{disabled:T})),n.createElement(o.Form.Text,{className:"text-muted"},L("Design:useAgainExplanation")))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:usesPerUserDay")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("usesPerUserDay"),{disabled:T})),n.createElement(o.Form.Text,{className:"text-muted"},L("Design:usesPerUserDayExplanation"))))),n.createElement(o.Row,null,n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:minAmount")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("minAmount"),{disabled:T})),n.createElement(o.Form.Text,{className:"text-muted"},L("Design:minAmountExplanation")))),n.createElement(o.Col,{md:6},n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,L("Design:maxAmount")),n.createElement(o.Form.Control,t.__assign({type:"number"},P("maxAmount"),{disabled:T})),n.createElement(o.Form.Text,{className:"text-muted"},L("Design:maxAmountExplanation")))))))};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.62.3-dev.1",
3
+ "version": "0.62.3-dev.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -268,9 +268,7 @@ export const CouponFormControl = ({
268
268
  isMultipleChoise
269
269
  isCouponForm
270
270
  placeholder={t("Design:choose")}
271
- noOptionsMessage={t("Design:noActiveTemplates", {
272
- notification: t("Design:email"),
273
- })}
271
+ noOptionsMessage={t("Design:noSelectedProductGroups")}
274
272
  />
275
273
  </Form.Group>
276
274
  </Col>