@licklist/design 0.44.485-dev.66 → 0.44.485-dev.67

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":"IntervalInput.d.ts","sourceRoot":"","sources":["../../../src/events/edit-event-modal/IntervalInput.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAC;AAIzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,UAAU,kBAAkB;IAC1B,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IACxC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,GACZ,EAAE,kBAAkB,eAgJpB"}
1
+ {"version":3,"file":"IntervalInput.d.ts","sourceRoot":"","sources":["../../../src/events/edit-event-modal/IntervalInput.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAC;AAIzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,UAAU,kBAAkB;IAC1B,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IACxC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,GACZ,EAAE,kBAAkB,eAkJpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProviderDetailsInput.d.ts","sourceRoot":"","sources":["../../../src/provider/provider-details-input/ProviderDetailsInput.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAE7E,OAAO,EAAa,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAEL,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;CACxB,GAAG,wBAAwB,CAAC;AAE7B,MAAM,MAAM,yBAAyB,GAAG;IACtC,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACtC,SAAS,CAAC,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAClD,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,gBAAqB,EACrB,SAAc,GACf,EAAE,yBAAyB,eA6I3B"}
1
+ {"version":3,"file":"ProviderDetailsInput.d.ts","sourceRoot":"","sources":["../../../src/provider/provider-details-input/ProviderDetailsInput.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAE7E,OAAO,EAAa,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAEL,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;CACxB,GAAG,wBAAwB,CAAC;AAE7B,MAAM,MAAM,yBAAyB,GAAG;IACtC,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACtC,SAAS,CAAC,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAClD,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,gBAAqB,EACrB,SAAc,GACf,EAAE,yBAAyB,eA8J3B"}
@@ -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 r=require("tslib"),t=require("react"),i=e(t),n=require("react-i18next"),a=e(require("@licklist/plugins/dist/context/app/hooks/useNotification")),o=require("react-bootstrap"),l=require("react-hook-form"),s=e(require("@licklist/plugins/dist/services/Form/HookFormService")),m=require("@react-aria/utils"),d=require("../../typeahead/Typeahead.js"),u=require("../constants.js"),c=require("../provider-links-input/ProviderLinksInput.js");exports.ProviderDetailsInput=function(e){var p,g,E,v,F,b=e.companiesOptions,h=void 0===b?[]:b,I=e.linkTypes,q=void 0===I?[]:I,_=l.useFormContext(),f=_.register,y=_.watch,C=_.formState.errors,D=n.useTranslation(["App","Design","Validation"]).t,k=a(),T=m.useId(),w=m.useId(),A=m.useId(),L=m.useId(),M=m.useId(),S=m.useId(),R=y("description");return t.useEffect((function(){u.MAX_DESCRIPTION_CHARACTERS_LENGTH>R.length||k.danger({title:D("App:warning"),message:D("Validation:descriptionTooManyCharactersMessage",{max:u.MAX_DESCRIPTION_CHARACTERS_LENGTH})})}),[R.length]),i.createElement(i.Fragment,null,i.createElement(o.Form.Group,{controlId:T},i.createElement(o.Form.Label,null,D("Design:name")),i.createElement(o.Form.Control,r.__assign({},f("name",{required:D("Validation:fieldRequired",{attribute:D("Design:name")})}),{name:"name",required:!0,isInvalid:Boolean(C.name)})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},s.hasError(C.name,"required")&&(null===(p=C.name)||void 0===p?void 0:p.message))),i.createElement(o.Form.Group,{controlId:w},i.createElement(o.Form.Label,null,D("Design:description")),i.createElement(o.Form.Control,r.__assign({},f("description"),{as:"textarea",name:"description",rows:6}))),i.createElement(o.Form.Group,{controlId:A},i.createElement(o.Form.Label,null,D("Design:email")),i.createElement(o.Form.Control,r.__assign({},f("email",{required:D("Validation:fieldRequired",{attribute:D("Design:email")}),pattern:{value:/^\S+@\S+$/,message:D("Validation:fieldValidEmail",{attribute:D("Design:email")})}}),{name:"email",type:"email",inputMode:"email",isInvalid:Boolean(C.email)})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},s.hasError(C.email,"required")&&(null===(g=C.email)||void 0===g?void 0:g.message),s.hasError(C.email,"pattern")&&(null===(E=C.email)||void 0===E?void 0:E.message))),i.createElement(o.Form.Group,{controlId:L},i.createElement(o.Form.Label,null,D("Design:phone")),i.createElement(o.Form.Control,r.__assign({},f("phone",{required:D("Validation:fieldRequired",{attribute:D("Design:phone")})}),{name:"phone",type:"tel",inputMode:"tel",isInvalid:Boolean(C.phone)})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},s.hasError(C.phone,"required")&&(null===(v=C.phone)||void 0===v?void 0:v.message))),i.createElement(o.Form.Group,{controlId:M},i.createElement(o.Form.Label,null,D("Design:website")),i.createElement(o.Form.Control,r.__assign({},f("website",{pattern:{value:/\S+\.\S+/,message:D("Validation:fieldInvalid",{attribute:D("Design:website")})}}),{name:"website",type:"url",inputMode:"url",isInvalid:Boolean(C.website)})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},s.hasError(C.website,"pattern")&&(null===(F=C.website)||void 0===F?void 0:F.message))),h.length>1&&i.createElement(o.Form.Group,{controlId:S},i.createElement(o.Form.Label,null,D("Design:company")),i.createElement(d.Typeahead,{name:"company",options:h,placeholder:D("App:select"),noOptionsMessage:D("App:noMatchesFound")})),q.length>0&&i.createElement(c.ProviderLinksInput,{linkTypes:q}))};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=require("react"),i=e(t),n=require("react-i18next"),a=e(require("@licklist/plugins/dist/context/app/hooks/useNotification")),o=require("react-bootstrap"),l=require("react-hook-form"),s=e(require("@licklist/plugins/dist/services/Form/HookFormService")),d=require("@react-aria/utils"),m=require("../../typeahead/Typeahead.js"),u=require("../constants.js"),c=require("../provider-links-input/ProviderLinksInput.js");exports.ProviderDetailsInput=function(e){var p,E,g,v,F,I,h=e.companiesOptions,b=void 0===h?[]:h,C=e.linkTypes,_=void 0===C?[]:C,q=l.useFormContext(),y=q.register,T=q.watch,f=q.trigger,D=q.formState.errors,A=n.useTranslation(["App","Design","Validation"]).t,k=a(),R=d.useId(),M=d.useId(),S=d.useId(),L=d.useId(),w=d.useId(),G=d.useId(),H=T("description");return t.useEffect((function(){u.MAX_DESCRIPTION_CHARACTERS_LENGTH>H.length||(f("description"),k.danger({title:A("App:warning"),message:A("Validation:descriptionTooManyCharactersMessage",{max:u.MAX_DESCRIPTION_CHARACTERS_LENGTH})}))}),[H.length]),i.createElement(i.Fragment,null,i.createElement(o.Form.Group,{controlId:R},i.createElement(o.Form.Label,null,A("Design:name")),i.createElement(o.Form.Control,r.__assign({},y("name",{required:A("Validation:fieldRequired",{attribute:A("Design:name")})}),{name:"name",required:!0,isInvalid:Boolean(D.name)})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},s.hasError(D.name,"required")&&(null===(p=D.name)||void 0===p?void 0:p.message))),i.createElement(o.Form.Group,{controlId:M},i.createElement(o.Form.Label,null,A("Design:description")),i.createElement(o.Form.Control,r.__assign({},y("description",{validate:function(e){return!(e.length>u.MAX_DESCRIPTION_CHARACTERS_LENGTH)||A("Validation:descriptionTooManyCharactersMessage",{max:u.MAX_DESCRIPTION_CHARACTERS_LENGTH})}}),{as:"textarea",name:"description",rows:6,isInvalid:Boolean(D.description)})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},s.hasError(D.description,"validate")&&(null===(E=D.description)||void 0===E?void 0:E.message))),i.createElement(o.Form.Group,{controlId:S},i.createElement(o.Form.Label,null,A("Design:email")),i.createElement(o.Form.Control,r.__assign({},y("email",{required:A("Validation:fieldRequired",{attribute:A("Design:email")}),pattern:{value:/^\S+@\S+$/,message:A("Validation:fieldValidEmail",{attribute:A("Design:email")})}}),{name:"email",type:"email",inputMode:"email",isInvalid:Boolean(D.email)})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},s.hasError(D.email,"required")&&(null===(g=D.email)||void 0===g?void 0:g.message),s.hasError(D.email,"pattern")&&(null===(v=D.email)||void 0===v?void 0:v.message))),i.createElement(o.Form.Group,{controlId:L},i.createElement(o.Form.Label,null,A("Design:phone")),i.createElement(o.Form.Control,r.__assign({},y("phone",{required:A("Validation:fieldRequired",{attribute:A("Design:phone")})}),{name:"phone",type:"tel",inputMode:"tel",isInvalid:Boolean(D.phone)})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},s.hasError(D.phone,"required")&&(null===(F=D.phone)||void 0===F?void 0:F.message))),i.createElement(o.Form.Group,{controlId:w},i.createElement(o.Form.Label,null,A("Design:website")),i.createElement(o.Form.Control,r.__assign({},y("website",{pattern:{value:/\S+\.\S+/,message:A("Validation:fieldInvalid",{attribute:A("Design:website")})}}),{name:"website",type:"url",inputMode:"url",isInvalid:Boolean(D.website)})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},s.hasError(D.website,"pattern")&&(null===(I=D.website)||void 0===I?void 0:I.message))),b.length>1&&i.createElement(o.Form.Group,{controlId:G},i.createElement(o.Form.Label,null,A("Design:company")),i.createElement(m.Typeahead,{name:"company",options:b,placeholder:A("App:select"),noOptionsMessage:A("App:noMatchesFound")})),_.length>0&&i.createElement(c.ProviderLinksInput,{linkTypes:_}))};
@@ -55,7 +55,7 @@
55
55
  .zoom-buttons {
56
56
  position: absolute;
57
57
  top: calc((100% - 10rem) / 2);
58
- right: 0.75rem;
58
+ right: 1.75rem;
59
59
  z-index: 5;
60
60
 
61
61
  .buttons-wrapper {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.485-dev.66",
3
+ "version": "0.44.485-dev.67",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -119,7 +119,9 @@ export function IntervalInput({
119
119
  {...register("end", validationOptions.end)}
120
120
  value={end}
121
121
  name="end"
122
- onChange={({ target: { value: nextEndtDate } }) => onChangeEndDate(nextEndtDate)}
122
+ onChange={({ target: { value: nextEndtDate } }) =>
123
+ onChangeEndDate(nextEndtDate)
124
+ }
123
125
  min={start}
124
126
  isInvalid={Boolean(errors.end)}
125
127
  onClick={() => endDateInput?.current?.showPicker()}
@@ -34,4 +34,4 @@ export const useSortableTreeFunctions = ({
34
34
  cancelChanges,
35
35
  saveValidField,
36
36
  };
37
- };
37
+ };
@@ -85,7 +85,7 @@ export function ProductQuantityRechargingControl<T extends FormValues>(
85
85
  }) as string;
86
86
  }
87
87
  return true;
88
- }
88
+ },
89
89
  })}
90
90
  value={value as string}
91
91
  onFocus={onFocus}
@@ -1 +1 @@
1
- export const MAX_DESCRIPTION_CHARACTERS_LENGTH = 25500;
1
+ export const MAX_DESCRIPTION_CHARACTERS_LENGTH = 25500;
@@ -36,6 +36,7 @@ export function ProviderDetailsInput({
36
36
  const {
37
37
  register,
38
38
  watch,
39
+ trigger,
39
40
  formState: { errors },
40
41
  } = useFormContext<ProviderDetailsInputValues>();
41
42
  const { t } = useTranslation(["App", "Design", "Validation"]);
@@ -52,6 +53,7 @@ export function ProviderDetailsInput({
52
53
 
53
54
  useEffect(() => {
54
55
  if (MAX_DESCRIPTION_CHARACTERS_LENGTH > description.length) return;
56
+ trigger("description");
55
57
  notification.danger({
56
58
  title: t("App:warning"),
57
59
  message: t("Validation:descriptionTooManyCharactersMessage", {
@@ -83,11 +85,26 @@ export function ProviderDetailsInput({
83
85
  <Form.Group controlId={descriptionId}>
84
86
  <Form.Label>{t("Design:description")}</Form.Label>
85
87
  <Form.Control
86
- {...register("description")}
88
+ {...register("description", {
89
+ validate: (value) => {
90
+ const descriptionLength = value.length;
91
+ if (descriptionLength > MAX_DESCRIPTION_CHARACTERS_LENGTH) {
92
+ return t("Validation:descriptionTooManyCharactersMessage", {
93
+ max: MAX_DESCRIPTION_CHARACTERS_LENGTH,
94
+ }) as string;
95
+ }
96
+ return true;
97
+ },
98
+ })}
87
99
  as="textarea"
88
100
  name="description"
89
101
  rows={6}
102
+ isInvalid={Boolean(errors.description)}
90
103
  />
104
+ <Form.Control.Feedback type="invalid">
105
+ {HookFormService.hasError(errors.description, "validate") &&
106
+ errors.description?.message}
107
+ </Form.Control.Feedback>
91
108
  </Form.Group>
92
109
 
93
110
  <Form.Group controlId={emailId}>
@@ -147,7 +147,7 @@ export function SortableTreeItem({
147
147
  e.stopPropagation();
148
148
  if (edit && !isModalVisible) edit();
149
149
  setIsModalVisible(true);
150
- }
150
+ };
151
151
 
152
152
  useEffect(() => {
153
153
  setExpanded(isExpanded);
@@ -55,7 +55,7 @@
55
55
  .zoom-buttons {
56
56
  position: absolute;
57
57
  top: calc((100% - 10rem) / 2);
58
- right: 0.75rem;
58
+ right: 1.75rem;
59
59
  z-index: 5;
60
60
 
61
61
  .buttons-wrapper {