@licklist/design 0.44.467 → 0.44.468

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.
@@ -2,8 +2,6 @@ import React from "react";
2
2
  import { ProductQuantityCheckResponse } from "@licklist/plugins/dist/types/Api/verifyStock";
3
3
  import { MenuStep } from "../../../../types";
4
4
  export interface StepsFormProps {
5
- relyOnPeopleCategoryIds?: number[];
6
- ticketCategoriesIds?: number[];
7
5
  step: MenuStep;
8
6
  isLastMenuStep: boolean;
9
7
  onSubmit: (values: Record<string, any>) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"StepsForm.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/StepsForm/StepsForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAWf,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAG5F,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAO7C,MAAM,WAAW,cAAc;IAC7B,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAChD,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IACrD,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kBAAkB,CAAC,EAAE,4BAA4B,CAAC,UAAU,CAAC,CAAC;CAC/D;AAED,oBAAY,YAAY,GAAG;IACzB,aAAa,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,SAAS,qFA0JrB,CAAC"}
1
+ {"version":3,"file":"StepsForm.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/StepsForm/StepsForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;AAWf,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAE5F,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAO7C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAChD,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IACrD,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kBAAkB,CAAC,EAAE,4BAA4B,CAAC,UAAU,CAAC,CAAC;CAC/D;AAED,oBAAY,YAAY,GAAG;IACzB,aAAa,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,SAAS,qFAoIrB,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("tslib"),t=require("react"),o=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,s=require("react-i18next"),u=require("react-bootstrap"),i=require("react-hook-form"),n=require("lodash"),l=require("@licklist/plugins/dist/hooks/Value/usePreviousValue"),a=require("@licklist/plugins/dist/utils/ScrollUtils"),c=require("@licklist/plugins/dist/utils/FormValues"),d=require("../../../event/event-details/components/number-of-people-input/NumberOfPeopleInput.js"),m=require("../Category/Category.js"),f=require("../../constants.js"),p=require("../CalendarStepsForm/components/ErrorModal.js"),E=require("../utils/category.js"),g="NO_ORDER_ITEMS_ERROR",v=t.forwardRef((function(e,v){var y=e.step,q=e.isLastMenuStep,F=e.relyOnPeopleCategoryIds,S=void 0===F?[]:F,C=e.ticketCategoriesIds,h=void 0===C?[]:C,O=e.setFormValues,V=e.defaultValues,_=e.onSubmit,b=e.setFormErrors,P=e.id,j=void 0===P?f.STEP_FORM_ID:P,I=e.productsWithErrors,k=i.useForm({defaultValues:V}),M=s.useTranslation(["Design","Validation"]).t,R=r.__read(t.useState(""),2),T=R[0],N=R[1],x=E.useCategory().verifyCategoryItems,B=k.control,D=k.formState.errors,K=k.getValues,W=k.setError,L=k.clearErrors,w=k.reset,A=i.useWatch({control:B}),H=l.usePreviousValue(D),U=t.useMemo((function(){if(h.length||!(null==S?void 0:S.length))return!1;var e=Object.values(A).filter(Boolean).filter((function(e){return S.includes(e.productsCategoryId)&&e.quantity>0&&!e.isSoldOut}));return Boolean(e.length)}),[A,S,h]);t.useImperativeHandle(v,(function(){return{getFormValues:function(){return K()}}})),t.useEffect((function(){I&&N(M("soldOutProduct"))}),[I]);return t.useEffect((function(){D&&setTimeout(L,0),O(A)}),[A]),t.useEffect((function(){c.isFormValuesEmpty(A)||L(g)}),[A,L]),t.useEffect((function(){w(V)}),[V]),t.useEffect((function(){!n.isEqual(D,H)&&b&&b(D)}),[D,H,b]),o.createElement(u.Form,{onSubmit:k.handleSubmit((function(e){if(q&&c.isFormValuesEmpty(e))return W(g,{}),void a.scrollToError(g);var r=x(e,y);if(r)return N(r.message),void W("category_".concat(r.id),{message:r.message});_(e)}),(function(e){a.scrollToError(c.getFirstErrorKey(e)),N(M("pleaseCheckSelectedProducts"))})),id:j},o.createElement(i.FormProvider,r.__assign({},k),o.createElement(p.ErrorModal,{isOpen:Boolean(T),messageKey:T,onClose:function(){return N("")}}),o.createElement("div",null,o.createElement("div",{className:"iframe-event"},o.createElement(m.Category,{productCategories:null==y?void 0:y.productCategories,productsWithErrors:I,errors:D}),U&&q&&o.createElement(d.NumberOfPeopleInput,null),D[g]&&o.createElement("div",{className:"d-flex m-5 justify-content-center form-error",id:g},o.createElement(s.Trans,{t:M,i18nKey:"pleaseSelectAtLeastFrom",values:{min:1,type:"item",from:"those categories"}}))))))}));exports.StepsForm=v;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("tslib"),t=require("react"),s=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,o=require("react-i18next"),i=require("react-bootstrap"),u=require("react-hook-form"),a=require("lodash"),l=require("@licklist/plugins/dist/hooks/Value/usePreviousValue"),n=require("@licklist/plugins/dist/utils/ScrollUtils"),c=require("@licklist/plugins/dist/utils/FormValues"),m=require("../Category/Category.js"),d=require("../../constants.js"),f=require("../CalendarStepsForm/components/ErrorModal.js"),E=require("../utils/category.js"),p="NO_ORDER_ITEMS_ERROR",g=t.forwardRef((function(e,g){var v=e.step,y=e.isLastMenuStep,q=e.setFormValues,F=e.defaultValues,S=e.onSubmit,V=e.setFormErrors,_=e.id,C=void 0===_?d.STEP_FORM_ID:_,h=e.productsWithErrors,b=u.useForm({defaultValues:F}),j=o.useTranslation(["Design","Validation"]).t,O=r.__read(t.useState(""),2),P=O[0],R=O[1],T=E.useCategory().verifyCategoryItems,k=b.control,M=b.formState.errors,x=b.getValues,I=b.setError,D=b.clearErrors,K=b.reset,N=u.useWatch({control:k}),W=l.usePreviousValue(M);t.useImperativeHandle(g,(function(){return{getFormValues:function(){return x()}}})),t.useEffect((function(){h&&R(j("soldOutProduct"))}),[h]);return t.useEffect((function(){M&&setTimeout(D,0),q(N)}),[N]),t.useEffect((function(){c.isFormValuesEmpty(N)||D(p)}),[N,D]),t.useEffect((function(){K(F)}),[F]),t.useEffect((function(){!a.isEqual(M,W)&&V&&V(M)}),[M,W,V]),s.createElement(i.Form,{onSubmit:b.handleSubmit((function(e){if(y&&c.isFormValuesEmpty(e))return I(p,{}),void n.scrollToError(p);var r=T(e,v);if(r)return R(r.message),void I("category_".concat(r.id),{message:r.message});S(e)}),(function(e){n.scrollToError(c.getFirstErrorKey(e)),R(j("pleaseCheckSelectedProducts"))})),id:C},s.createElement(u.FormProvider,r.__assign({},b),s.createElement(f.ErrorModal,{isOpen:Boolean(P),messageKey:P,onClose:function(){return R("")}}),s.createElement("div",null,s.createElement("div",{className:"iframe-event"},s.createElement(m.Category,{productCategories:null==v?void 0:v.productCategories,productsWithErrors:h,errors:M}),M[p]&&s.createElement("div",{className:"d-flex m-5 justify-content-center form-error",id:p},s.createElement(o.Trans,{t:j,i18nKey:"pleaseSelectAtLeastFrom",values:{min:1,type:"item",from:"those categories"}}))))))}));exports.StepsForm=g;
@@ -109,7 +109,7 @@
109
109
  }
110
110
 
111
111
  &__product-count {
112
- margin-left: 3rem;
112
+ margin-left: 1.5rem;
113
113
  }
114
114
 
115
115
  &__product-count.error {
@@ -119,6 +119,7 @@
119
119
 
120
120
  &.show {
121
121
  overflow: scroll;
122
+ overflow-x: hidden;
122
123
  }
123
124
 
124
125
  @include media-breakpoint-down(sm) {
@@ -164,7 +165,8 @@
164
165
  }
165
166
  }
166
167
 
167
- input, select {
168
+ input,
169
+ select {
168
170
  border-radius: $iframe-border-radius;
169
171
  height: 2.25rem;
170
172
  padding: 0.25rem 0.5rem;
@@ -205,16 +207,16 @@
205
207
  &:focus,
206
208
  &.focus {
207
209
  &:not(:disabled) {
208
- background-color: darken(#0E8CE2, 10%);
209
- box-shadow: 0 0 0 $input-btn-focus-width darken(#0E8CE2, 10%);
210
+ background-color: darken(#0e8ce2, 10%);
211
+ box-shadow: 0 0 0 $input-btn-focus-width darken(#0e8ce2, 10%);
210
212
  }
211
213
  }
212
214
 
213
215
  &:active,
214
216
  &.active {
215
217
  &:not(:disabled) {
216
- background-color: darken(#0E8CE2, 10%);
217
- box-shadow: 0 0 0 $input-btn-focus-width darken(#0E8CE2, 10%);
218
+ background-color: darken(#0e8ce2, 10%);
219
+ box-shadow: 0 0 0 $input-btn-focus-width darken(#0e8ce2, 10%);
218
220
  }
219
221
  }
220
222
  }
@@ -229,7 +231,7 @@
229
231
  font-size: 0.875rem;
230
232
  height: 2.25rem;
231
233
 
232
- &:focus{
234
+ &:focus {
233
235
  box-shadow: unset;
234
236
  }
235
237
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.467",
3
+ "version": "0.44.468",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -1,6 +1,5 @@
1
1
  import React, {
2
2
  useEffect,
3
- useMemo,
4
3
  forwardRef,
5
4
  useImperativeHandle,
6
5
  useState,
@@ -17,7 +16,6 @@ import {
17
16
  } from "@licklist/plugins/dist/utils/FormValues";
18
17
  import { ProductQuantityCheckResponse } from "@licklist/plugins/dist/types/Api/verifyStock";
19
18
  import { Category } from "../Category";
20
- import { NumberOfPeopleInput } from "../../../event/event-details/components/number-of-people-input";
21
19
  import { MenuStep } from "../../../../types";
22
20
  import { STEP_FORM_ID } from "../../constants";
23
21
  import { ErrorModal } from "../CalendarStepsForm/components/ErrorModal";
@@ -26,8 +24,6 @@ import { useCategory } from "../utils/category";
26
24
  const NO_ORDER_ITEMS_ERROR = "NO_ORDER_ITEMS_ERROR";
27
25
 
28
26
  export interface StepsFormProps {
29
- relyOnPeopleCategoryIds?: number[];
30
- ticketCategoriesIds?: number[];
31
27
  step: MenuStep;
32
28
  isLastMenuStep: boolean;
33
29
  onSubmit: (values: Record<string, any>) => void;
@@ -47,8 +43,6 @@ export const StepsForm = forwardRef<StepsFormRef, StepsFormProps>(
47
43
  {
48
44
  step,
49
45
  isLastMenuStep,
50
- relyOnPeopleCategoryIds = [],
51
- ticketCategoriesIds = [],
52
46
  setFormValues,
53
47
  defaultValues,
54
48
  onSubmit,
@@ -74,22 +68,6 @@ export const StepsForm = forwardRef<StepsFormRef, StepsFormProps>(
74
68
  const formValues = useWatch({ control });
75
69
  const prevErrors = usePreviousValue(errors);
76
70
 
77
- const shouldShowPeopleInput = useMemo(() => {
78
- if (ticketCategoriesIds.length || !relyOnPeopleCategoryIds?.length) {
79
- return false;
80
- }
81
- const values = Object.values(formValues)
82
- .filter(Boolean)
83
- .filter(
84
- (product) =>
85
- relyOnPeopleCategoryIds.includes(product.productsCategoryId) &&
86
- product.quantity > 0 &&
87
- !product.isSoldOut
88
- );
89
-
90
- return Boolean(values.length);
91
- }, [formValues, relyOnPeopleCategoryIds, ticketCategoriesIds]);
92
-
93
71
  useImperativeHandle(ref, () => {
94
72
  return {
95
73
  getFormValues: () => getValues(),
@@ -174,10 +152,6 @@ export const StepsForm = forwardRef<StepsFormRef, StepsFormProps>(
174
152
  errors={errors}
175
153
  />
176
154
 
177
- {shouldShowPeopleInput && isLastMenuStep && (
178
- <NumberOfPeopleInput />
179
- )}
180
-
181
155
  {errors[NO_ORDER_ITEMS_ERROR] && (
182
156
  <div
183
157
  className="d-flex m-5 justify-content-center form-error"
@@ -109,7 +109,7 @@
109
109
  }
110
110
 
111
111
  &__product-count {
112
- margin-left: 3rem;
112
+ margin-left: 1.5rem;
113
113
  }
114
114
 
115
115
  &__product-count.error {
@@ -119,6 +119,7 @@
119
119
 
120
120
  &.show {
121
121
  overflow: scroll;
122
+ overflow-x: hidden;
122
123
  }
123
124
 
124
125
  @include media-breakpoint-down(sm) {
@@ -164,7 +165,8 @@
164
165
  }
165
166
  }
166
167
 
167
- input, select {
168
+ input,
169
+ select {
168
170
  border-radius: $iframe-border-radius;
169
171
  height: 2.25rem;
170
172
  padding: 0.25rem 0.5rem;
@@ -205,16 +207,16 @@
205
207
  &:focus,
206
208
  &.focus {
207
209
  &:not(:disabled) {
208
- background-color: darken(#0E8CE2, 10%);
209
- box-shadow: 0 0 0 $input-btn-focus-width darken(#0E8CE2, 10%);
210
+ background-color: darken(#0e8ce2, 10%);
211
+ box-shadow: 0 0 0 $input-btn-focus-width darken(#0e8ce2, 10%);
210
212
  }
211
213
  }
212
214
 
213
215
  &:active,
214
216
  &.active {
215
217
  &:not(:disabled) {
216
- background-color: darken(#0E8CE2, 10%);
217
- box-shadow: 0 0 0 $input-btn-focus-width darken(#0E8CE2, 10%);
218
+ background-color: darken(#0e8ce2, 10%);
219
+ box-shadow: 0 0 0 $input-btn-focus-width darken(#0e8ce2, 10%);
218
220
  }
219
221
  }
220
222
  }
@@ -229,7 +231,7 @@
229
231
  font-size: 0.875rem;
230
232
  height: 2.25rem;
231
233
 
232
- &:focus{
234
+ &:focus {
233
235
  box-shadow: unset;
234
236
  }
235
237
  }