@licklist/design 0.44.476-dev.8 → 0.44.476
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.
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +1 -2
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts +4 -0
- package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
- package/dist/iframe/payment/order-items-table/OrderItemsTable.js +1 -1
- package/dist/iframe/payment/payment-form/PaymentForm.js +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.js +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +1 -1
- package/dist/product-set/form/StepsControl.js +1 -1
- package/dist/sales/manual-booking/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/sales/manual-booking/select-menu/SelectMenu.js +1 -1
- package/dist/sales/notes/NotesTableRow.js +1 -1
- package/dist/sales/notes/note-form/NoteForm.d.ts.map +1 -1
- package/dist/sales/notes/note-form/NoteForm.js +1 -1
- package/dist/setting/dashboard/snippets/card/SnippetCard.js +1 -1
- package/dist/styles/iframe-events/Event.scss +2 -0
- package/dist/styles/packages.scss +0 -1
- package/dist/table/TableHelperComponent.d.ts +3 -2
- package/dist/table/TableHelperComponent.d.ts.map +1 -1
- package/dist/table/index.d.ts +0 -1
- package/dist/table/index.d.ts.map +1 -1
- package/dist/table/utils/index.d.ts +0 -1
- package/dist/table/utils/index.d.ts.map +1 -1
- package/dist/table/utils/index.js +1 -1
- package/package.json +1 -2
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.stories.tsx +0 -1
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +5 -6
- package/src/iframe/order-process/OrderProcess.stories.tsx +5 -2
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.stories.tsx +2 -2
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +13 -6
- package/src/iframe/order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.tsx +12 -4
- package/src/iframe/order-process/components/BookingSummary/types/index.ts +1 -2
- package/src/iframe/order-process/components/BookingSummary/utils/index.ts +21 -0
- package/src/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.stories.tsx +1 -9
- package/src/iframe/payment/payment-page/PaymentPage.tsx +2 -1
- package/src/iframe/ryft/RyftPaymentForm.tsx +1 -1
- package/src/index.ts +0 -1
- package/src/product-set/form/ProductCategoriesControl.tsx +3 -4
- package/src/product-set/form/StepsControl.tsx +1 -1
- package/src/sales/manual-booking/select-menu/SelectMenu.tsx +1 -3
- package/src/sales/notes/note-form/NoteForm.tsx +3 -21
- package/src/styles/iframe-events/Event.scss +2 -0
- package/src/styles/packages.scss +0 -1
- package/src/table/Table.stories.tsx +1 -127
- package/src/table/TableHelperComponent.tsx +1 -3
- package/src/table/index.ts +0 -1
- package/src/table/utils/index.ts +0 -2
- package/dist/customers/components/filter/CustomerFilter.d.ts +0 -14
- package/dist/customers/components/filter/CustomerFilter.d.ts.map +0 -1
- package/dist/customers/components/filter/CustomerFilter.js +0 -1
- package/dist/customers/components/filter/index.d.ts +0 -3
- package/dist/customers/components/filter/index.d.ts.map +0 -1
- package/dist/customers/components/index.d.ts +0 -2
- package/dist/customers/components/index.d.ts.map +0 -1
- package/dist/customers/index.d.ts +0 -2
- package/dist/customers/index.d.ts.map +0 -1
- package/dist/styles/customers/Filter.scss +0 -34
- package/dist/styles/customers/_index.scss +0 -1
- package/dist/table/ReactTableHelperComponent.d.ts +0 -12
- package/dist/table/ReactTableHelperComponent.d.ts.map +0 -1
- package/dist/table/ReactTableHelperComponent.js +0 -1
- package/dist/table/hooks/useTableQueryOptions.d.ts +0 -20
- package/dist/table/hooks/useTableQueryOptions.d.ts.map +0 -1
- package/dist/table/hooks/useTableQueryOptions.js +0 -1
- package/dist/table/types.d.ts +0 -41
- package/dist/table/types.d.ts.map +0 -1
- package/src/customers/components/filter/CustomerFilter.stories.tsx +0 -19
- package/src/customers/components/filter/CustomerFilter.tsx +0 -50
- package/src/customers/components/filter/index.ts +0 -2
- package/src/customers/components/index.ts +0 -1
- package/src/customers/index.ts +0 -1
- package/src/styles/customers/Filter.scss +0 -34
- package/src/styles/customers/_index.scss +0 -1
- package/src/table/ReactTableHelperComponent.tsx +0 -321
- package/src/table/hooks/useTableQueryOptions.ts +0 -49
- package/src/table/types.ts +0 -47
|
@@ -19,10 +19,11 @@ export interface TableHelperComponentProps {
|
|
|
19
19
|
};
|
|
20
20
|
initialOptions?: Partial<ITableProps>;
|
|
21
21
|
}
|
|
22
|
+
export declare type ExtendedTableOptions = ITableProps & {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
};
|
|
22
25
|
/**
|
|
23
26
|
* TableHelperComponent
|
|
24
|
-
* @deprecated use new ReactTableHelperComponent
|
|
25
|
-
* for default tables
|
|
26
27
|
* @param props
|
|
27
28
|
* @constructor
|
|
28
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHelperComponent.d.ts","sourceRoot":"","sources":["../../src/table/TableHelperComponent.tsx"],"names":[],"mappings":";AAQA,OAAO,qBAAqB,MAAM,mEAAmE,CAAC;AACtG,OAAO,YAAY,MAAM,0DAA0D,CAAC;AACpF,OAAO,WAAW,MAAM,yDAAyD,CAAC;
|
|
1
|
+
{"version":3,"file":"TableHelperComponent.d.ts","sourceRoot":"","sources":["../../src/table/TableHelperComponent.tsx"],"names":[],"mappings":";AAQA,OAAO,qBAAqB,MAAM,mEAAmE,CAAC;AACtG,OAAO,YAAY,MAAM,0DAA0D,CAAC;AACpF,OAAO,WAAW,MAAM,yDAAyD,CAAC;AAOlF,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,YAAY,EAAE,QAAQ,CAAC;IACvB,SAAS,CAAC,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACzC,cAAc,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CACvC;AAED,oBAAY,oBAAoB,GAAG,WAAW,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AASxE;;;;GAIG;AACH,iBAAS,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,eAsP7D;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
package/dist/table/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/table/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/table/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import ITableProps from "@licklist/plugins/dist/types/services/Table/ITableProps";
|
|
2
|
-
export { flexRender } from "@tanstack/react-table";
|
|
3
2
|
export declare const getFilterOptionsValue: (query: URLSearchParams, initialOptions: Partial<ITableProps>, key: keyof ITableProps) => string | number;
|
|
4
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,yDAAyD,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,yDAAyD,CAAC;AAWlF,eAAO,MAAM,qBAAqB,UACzB,eAAe,kBACN,QAAQ,WAAW,CAAC,OAC/B,MAAM,WAAW,oBAWvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("@licklist/plugins/dist/services/Table/TableService"))&&"object"==typeof e&&"default"in e?e.default:e,r=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("@licklist/plugins/dist/services/Table/TableService"))&&"object"==typeof e&&"default"in e?e.default:e,r={page:t.DEFAULT_PAGE,perPage:t.DEFAULT_PER_PAGE,sortDirection:t.DEFAULT_SORT_DIRECTION,sortKey:t.DEFAULT_SORT_KEY,filter:""};exports.getFilterOptionsValue=function(e,t,i){return e.get(i)?e.get(i):t[i]?t[i]:r[i]};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.44.476
|
|
3
|
+
"version": "0.44.476",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -71,7 +71,6 @@
|
|
|
71
71
|
"@storybook/react": "6.3.12",
|
|
72
72
|
"@svgr/rollup": "5.5.0",
|
|
73
73
|
"@svgr/webpack": "5.5.0",
|
|
74
|
-
"@tanstack/react-table": "8.10.6",
|
|
75
74
|
"@testing-library/jest-dom": "5.16.1",
|
|
76
75
|
"@testing-library/react": "11.2.5",
|
|
77
76
|
"@testing-library/react-hooks": "5.1.0",
|
|
@@ -1082,7 +1082,6 @@ export const Default: Story<EditEventFormProps> = (args) => {
|
|
|
1082
1082
|
<EventEditProductSetContext.Provider value={contextValue}>
|
|
1083
1083
|
<EditEventForm
|
|
1084
1084
|
{...args}
|
|
1085
|
-
isExternalPaymentLinkEnabled
|
|
1086
1085
|
title="Create new event"
|
|
1087
1086
|
categories={categories}
|
|
1088
1087
|
setEditProductSetId={setEditProductSetId}
|
|
@@ -308,12 +308,11 @@ export const EditEventForm = ({
|
|
|
308
308
|
<Form.Label>{t("externalPaymentLink")}</Form.Label>
|
|
309
309
|
<Form.Control
|
|
310
310
|
{...register("externalPaymentLink", {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
},
|
|
311
|
+
required: t("Validation:fieldRequired", {
|
|
312
|
+
attribute: t("Design:externalPaymentLink"),
|
|
313
|
+
}) as string,
|
|
314
|
+
validate: (url) =>
|
|
315
|
+
validateURL(url, t("Design:externalPaymentLink")),
|
|
317
316
|
})}
|
|
318
317
|
name="externalPaymentLink"
|
|
319
318
|
type="url"
|
|
@@ -15,6 +15,7 @@ import { StepsForm } from "./components/StepsForm";
|
|
|
15
15
|
import { Page, PageBody, PageHeader } from "../page";
|
|
16
16
|
import { StepsFormRef } from "./components/StepsForm/StepsForm";
|
|
17
17
|
import { BookingSummaryFooter } from "./components/BookingSummaryFooter";
|
|
18
|
+
import { sanitizeFormValues } from "./components/BookingSummary/utils";
|
|
18
19
|
import { Order } from "../../types";
|
|
19
20
|
// eslint-disable-next-line max-len
|
|
20
21
|
import { RenderNumberOfPeopleInputComponent } from "../event/event-details/components/number-of-people-input/component/RenderNumberOfPeopleInputComponent";
|
|
@@ -266,7 +267,10 @@ export function Default() {
|
|
|
266
267
|
};
|
|
267
268
|
|
|
268
269
|
const shouldShowPeopleInput = useMemo(() => {
|
|
269
|
-
const
|
|
270
|
+
const { numberOfPeople, ...orderProducts } =
|
|
271
|
+
sanitizeFormValues(formValues);
|
|
272
|
+
|
|
273
|
+
const values = Object.values(orderProducts).filter(
|
|
270
274
|
Boolean
|
|
271
275
|
) as Order[];
|
|
272
276
|
const filteredValues = values.filter(
|
|
@@ -343,7 +347,6 @@ export function Default() {
|
|
|
343
347
|
date="29 Sept 2022 at 09:00"
|
|
344
348
|
menuSteps={menuSteps as any}
|
|
345
349
|
formValues={formValues}
|
|
346
|
-
peopleAmount={peopleAmount}
|
|
347
350
|
totalWithDiscount={5}
|
|
348
351
|
eventName="Glam!"
|
|
349
352
|
/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import { Meta } from "@storybook/react";
|
|
3
3
|
import { BookingSummary } from "./BookingSummary";
|
|
4
4
|
|
|
@@ -139,7 +139,6 @@ export function Default() {
|
|
|
139
139
|
<BookingSummary
|
|
140
140
|
date="29 Sept 2022 at 09:00"
|
|
141
141
|
menuSteps={menuSteps as any}
|
|
142
|
-
peopleAmount={5}
|
|
143
142
|
formValues={{
|
|
144
143
|
"3": {
|
|
145
144
|
id: 3,
|
|
@@ -162,6 +161,7 @@ export function Default() {
|
|
|
162
161
|
price: 1,
|
|
163
162
|
productsCategoryId: 1,
|
|
164
163
|
},
|
|
164
|
+
numberOfPeople: 5,
|
|
165
165
|
}}
|
|
166
166
|
totalWithDiscount={5}
|
|
167
167
|
transactionFee={0.01}
|
|
@@ -6,6 +6,7 @@ import { LoaderIndicator } from "../../../../static";
|
|
|
6
6
|
import { MenuStep, Order } from "../../../../types";
|
|
7
7
|
import { ProductsByMenuStep } from "./components/ProductsByMenuStep";
|
|
8
8
|
import { BookingSummaryProps } from "./types";
|
|
9
|
+
import { sanitizeFormValues } from "./utils";
|
|
9
10
|
import { SummaryTotal } from "./components/SummaryTotal";
|
|
10
11
|
import { BookingSummaryAccordion } from "./components/BookingSummaryAccordion";
|
|
11
12
|
|
|
@@ -19,15 +20,21 @@ export const BookingSummary = ({
|
|
|
19
20
|
productsWithErrors,
|
|
20
21
|
isLoading,
|
|
21
22
|
hasPeopleInput,
|
|
22
|
-
peopleAmount,
|
|
23
23
|
}: Omit<BookingSummaryProps, "totallWithDiscount">) => {
|
|
24
24
|
const { t } = useTranslation("Design");
|
|
25
25
|
const { formatNumber } = useIntl();
|
|
26
26
|
|
|
27
|
-
const orderProducts = useMemo(() => {
|
|
28
|
-
const
|
|
27
|
+
const [numberOfPeople = 0, orderProducts] = useMemo(() => {
|
|
28
|
+
const { numberOfPeople, ...orderProducts } = sanitizeFormValues(formValues);
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
const products = Object.keys(orderProducts).map(
|
|
31
|
+
(productId) => orderProducts[productId]
|
|
32
|
+
) as Order[];
|
|
33
|
+
|
|
34
|
+
return [
|
|
35
|
+
numberOfPeople as number,
|
|
36
|
+
products.filter((prod) => prod.quantity !== 0),
|
|
37
|
+
];
|
|
31
38
|
}, [formValues]);
|
|
32
39
|
|
|
33
40
|
if (isLoading) {
|
|
@@ -60,12 +67,12 @@ export const BookingSummary = ({
|
|
|
60
67
|
/>
|
|
61
68
|
);
|
|
62
69
|
})}
|
|
63
|
-
{!isNotShownPeopleAmount &&
|
|
70
|
+
{!isNotShownPeopleAmount && numberOfPeople > 0 && (
|
|
64
71
|
<>
|
|
65
72
|
<hr />
|
|
66
73
|
<div className="d-flex justify-content-between mt-3">
|
|
67
74
|
<p className="m-0">{t("people")}:</p>
|
|
68
|
-
<p className="price">{
|
|
75
|
+
<p className="price">{numberOfPeople}</p>
|
|
69
76
|
</div>
|
|
70
77
|
</>
|
|
71
78
|
)}
|
package/src/iframe/order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
+
import { Order } from "../../../../../../types";
|
|
3
4
|
import { BookingSummaryProps } from "../../types";
|
|
4
|
-
import { cartSumByOrderProducts } from "../../utils";
|
|
5
|
+
import { sanitizeFormValues, cartSumByOrderProducts } from "../../utils";
|
|
5
6
|
import { SummaryTotalBlock } from "./components/SummaryTotalBlock";
|
|
6
7
|
|
|
7
8
|
export const SummaryTotal = ({
|
|
@@ -14,10 +15,17 @@ export const SummaryTotal = ({
|
|
|
14
15
|
"formValues" | "totalWithDiscount" | "transactionFee" | "isFreePayment"
|
|
15
16
|
>) => {
|
|
16
17
|
const { t } = useTranslation("Design");
|
|
17
|
-
const orderProducts = useMemo(() => {
|
|
18
|
-
const
|
|
18
|
+
const [, orderProducts] = useMemo(() => {
|
|
19
|
+
const { numberOfPeople, ...orderProducts } = sanitizeFormValues(formValues);
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
const products = Object.keys(orderProducts).map(
|
|
22
|
+
(productId) => orderProducts[productId]
|
|
23
|
+
) as Order[];
|
|
24
|
+
|
|
25
|
+
return [
|
|
26
|
+
numberOfPeople as number,
|
|
27
|
+
products.filter((prod) => prod.quantity !== 0),
|
|
28
|
+
];
|
|
21
29
|
}, [formValues]);
|
|
22
30
|
|
|
23
31
|
const cartSum = isFreePayment
|
|
@@ -8,7 +8,7 @@ export type BookingSummaryProps = {
|
|
|
8
8
|
date: string;
|
|
9
9
|
menuSteps: MenuStep[];
|
|
10
10
|
formValues: {
|
|
11
|
-
[key: string]: Order;
|
|
11
|
+
[key: string]: Order | number;
|
|
12
12
|
};
|
|
13
13
|
totalWithDiscount?: number;
|
|
14
14
|
isNotShownPeopleAmount?: boolean;
|
|
@@ -18,5 +18,4 @@ export type BookingSummaryProps = {
|
|
|
18
18
|
isFreePayment?: boolean;
|
|
19
19
|
productsWithErrors?: ProductQuantityCheckResponse["products"];
|
|
20
20
|
isLoading?: boolean;
|
|
21
|
-
peopleAmount: number;
|
|
22
21
|
};
|
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
import { Order } from "../../../../../types";
|
|
2
|
+
import { BookingSummaryProps } from "../types";
|
|
3
|
+
|
|
4
|
+
export const sanitizeFormValues = (
|
|
5
|
+
formValues: BookingSummaryProps["formValues"]
|
|
6
|
+
) =>
|
|
7
|
+
Object.keys(formValues).reduce(
|
|
8
|
+
(
|
|
9
|
+
prevValues: {
|
|
10
|
+
[key: string]: Order | number;
|
|
11
|
+
},
|
|
12
|
+
currentKey: string
|
|
13
|
+
) => {
|
|
14
|
+
const value = formValues[currentKey];
|
|
15
|
+
if (value) {
|
|
16
|
+
return { ...prevValues, [currentKey]: value };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return prevValues;
|
|
20
|
+
},
|
|
21
|
+
{}
|
|
22
|
+
);
|
|
2
23
|
|
|
3
24
|
export const cartSumByOrderProducts = (orderProducts: Order[]) =>
|
|
4
25
|
orderProducts.reduce((prevSumValue: number, product) => {
|
|
@@ -174,12 +174,7 @@ const OrderProcessContextProvider: React.FC = ({ children }) => {
|
|
|
174
174
|
|
|
175
175
|
return (
|
|
176
176
|
<OrderProcessContext.Provider
|
|
177
|
-
value={{
|
|
178
|
-
orderFormValues,
|
|
179
|
-
setOrderFormValues,
|
|
180
|
-
formValues,
|
|
181
|
-
setFormValues,
|
|
182
|
-
}}
|
|
177
|
+
value={{ orderFormValues, setOrderFormValues, formValues, setFormValues }}
|
|
183
178
|
>
|
|
184
179
|
{children}
|
|
185
180
|
</OrderProcessContext.Provider>
|
|
@@ -408,8 +403,6 @@ const MENU_STEPS = [
|
|
|
408
403
|
|
|
409
404
|
export function Default() {
|
|
410
405
|
const { formValues, setFormValues } = useContext(OrderProcessContext);
|
|
411
|
-
const [peopleAmount] = useState(0);
|
|
412
|
-
|
|
413
406
|
return (
|
|
414
407
|
<div className="snippet">
|
|
415
408
|
<OrderProcessContextProvider>
|
|
@@ -441,7 +434,6 @@ export function Default() {
|
|
|
441
434
|
<BookingSummary
|
|
442
435
|
date="29 Sept 2022 at 09:00"
|
|
443
436
|
menuSteps={menuSteps as any}
|
|
444
|
-
peopleAmount={peopleAmount}
|
|
445
437
|
formValues={formValues}
|
|
446
438
|
totalWithDiscount={5}
|
|
447
439
|
eventName="Glam!"
|
|
@@ -109,7 +109,8 @@ export const PaymentPage = ({
|
|
|
109
109
|
showCloseButton={isIframePayment}
|
|
110
110
|
onCloseButtonClick={isIframePayment ? onGoBack : undefined}
|
|
111
111
|
>
|
|
112
|
-
<PaymentTimer />
|
|
112
|
+
{isIframePayment && <PaymentTimer />}
|
|
113
|
+
|
|
113
114
|
<div className="d-flex align-items-center justify-content-center w-100">
|
|
114
115
|
{t("paymentDetails")}
|
|
115
116
|
</div>
|
|
@@ -183,7 +183,7 @@ export const RyftPaymentForm = ({
|
|
|
183
183
|
onSubmit={methods.handleSubmit(handleSubmit)}
|
|
184
184
|
className="ryft-payment-form"
|
|
185
185
|
>
|
|
186
|
-
<div className="submit-button-wrapper mt-3
|
|
186
|
+
<div className="submit-button-wrapper mt-3 px-1">
|
|
187
187
|
<Button type="submit" disabled={isBtnDisabled || !isValid}>
|
|
188
188
|
{isBtnDisabled && <ButtonLoader />}
|
|
189
189
|
{t("Design:buyNow")}
|
package/src/index.ts
CHANGED
|
@@ -99,7 +99,7 @@ export function ProductCategoriesControl({
|
|
|
99
99
|
});
|
|
100
100
|
const [productCategoryState, setProductCategoryState] = useState<
|
|
101
101
|
Record<number, { price: number; quantity: number }>
|
|
102
|
-
>(
|
|
102
|
+
>([]);
|
|
103
103
|
|
|
104
104
|
const productCategories: ProductCategory[] = useWatch({
|
|
105
105
|
control,
|
|
@@ -168,15 +168,14 @@ export function ProductCategoriesControl({
|
|
|
168
168
|
return sum + Number(product.totalQuantity);
|
|
169
169
|
}, 0);
|
|
170
170
|
|
|
171
|
-
setProductCategoryState(
|
|
172
|
-
...prevState,
|
|
171
|
+
setProductCategoryState({
|
|
173
172
|
// New added categories will have uniqueId
|
|
174
173
|
// but existing have already assigned Id.
|
|
175
174
|
[productCategory?.id || productCategory.uniqueId]: {
|
|
176
175
|
price,
|
|
177
176
|
quantity,
|
|
178
177
|
},
|
|
179
|
-
})
|
|
178
|
+
});
|
|
180
179
|
});
|
|
181
180
|
}, [productCategories]);
|
|
182
181
|
|
|
@@ -32,9 +32,7 @@ export const SelectMenu = ({
|
|
|
32
32
|
<div>
|
|
33
33
|
{(!menus || !menus.length) && !isLoading ? (
|
|
34
34
|
<div className="no-results-content">
|
|
35
|
-
<span className="no-results-found">
|
|
36
|
-
{t("App:noResultsFoundForSelectedDate")}
|
|
37
|
-
</span>
|
|
35
|
+
<span className="no-results-found">{t("App:noResultsFound")}</span>
|
|
38
36
|
</div>
|
|
39
37
|
) : (
|
|
40
38
|
<>
|
|
@@ -19,12 +19,7 @@ export const NoteForm = ({
|
|
|
19
19
|
onClose,
|
|
20
20
|
defaultValues = { note: "" },
|
|
21
21
|
}: NoteFormProps) => {
|
|
22
|
-
const {
|
|
23
|
-
register,
|
|
24
|
-
handleSubmit,
|
|
25
|
-
formState: { errors },
|
|
26
|
-
setValue,
|
|
27
|
-
} = useForm<FormModel>({
|
|
22
|
+
const { register, handleSubmit } = useForm<FormModel>({
|
|
28
23
|
mode: "onChange",
|
|
29
24
|
defaultValues,
|
|
30
25
|
});
|
|
@@ -42,18 +37,9 @@ export const NoteForm = ({
|
|
|
42
37
|
<Form.Control
|
|
43
38
|
as="textarea"
|
|
44
39
|
rows={5}
|
|
45
|
-
isInvalid={!!errors.note}
|
|
46
40
|
placeholder={t("writeYourNoteHere")}
|
|
47
|
-
{...register("note"
|
|
48
|
-
required: {
|
|
49
|
-
value: true,
|
|
50
|
-
message: t("Validation:fieldRequired"),
|
|
51
|
-
},
|
|
52
|
-
})}
|
|
41
|
+
{...register("note")}
|
|
53
42
|
/>
|
|
54
|
-
<Form.Control.Feedback type="invalid">
|
|
55
|
-
{errors.note?.message}
|
|
56
|
-
</Form.Control.Feedback>
|
|
57
43
|
</Form.Group>
|
|
58
44
|
|
|
59
45
|
<footer className="d-flex">
|
|
@@ -66,11 +52,7 @@ export const NoteForm = ({
|
|
|
66
52
|
>
|
|
67
53
|
{t("close")}
|
|
68
54
|
</Button>
|
|
69
|
-
<Button
|
|
70
|
-
variant="danger"
|
|
71
|
-
className="ml-2"
|
|
72
|
-
onClick={() => setValue("note", "")}
|
|
73
|
-
>
|
|
55
|
+
<Button type="reset" variant="danger" className="ml-2">
|
|
74
56
|
{t("delete")}
|
|
75
57
|
</Button>
|
|
76
58
|
</footer>
|
|
@@ -91,9 +91,11 @@
|
|
|
91
91
|
|
|
92
92
|
&__select-product {
|
|
93
93
|
width: 10.5rem !important;
|
|
94
|
+
margin-top: 1rem;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
&__unselect-product {
|
|
98
|
+
margin-top: 1rem;
|
|
97
99
|
width: 10.5rem !important;
|
|
98
100
|
background-color: $snippet-elements-button-color !important;
|
|
99
101
|
color: $snippet-elements-button-background-color !important;
|
package/src/styles/packages.scss
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ILengthAwarePaginator from "@licklist/plugins/dist/types/services/Table/ILengthAwarePaginator";
|
|
2
2
|
import { Meta, Story } from "@storybook/react";
|
|
3
3
|
import { range } from "lodash";
|
|
4
|
-
import React
|
|
4
|
+
import React from "react";
|
|
5
5
|
import { Router } from "../auth/Router";
|
|
6
6
|
import {
|
|
7
7
|
FilterHelperComponent as FilterHelper,
|
|
@@ -19,13 +19,6 @@ import {
|
|
|
19
19
|
TableHelperComponent as TableHelper,
|
|
20
20
|
TableHelperComponentProps,
|
|
21
21
|
} from "./TableHelperComponent";
|
|
22
|
-
import {
|
|
23
|
-
ReactTableHelperComponent as ReactTableHelper,
|
|
24
|
-
ReactTableHelperComponentProps,
|
|
25
|
-
ReactTableHelperRow,
|
|
26
|
-
ReactTableHelperComponentRef,
|
|
27
|
-
} from "./ReactTableHelperComponent";
|
|
28
|
-
import { flexRender } from "./utils/index";
|
|
29
22
|
|
|
30
23
|
export default {
|
|
31
24
|
title: "Table",
|
|
@@ -52,40 +45,6 @@ export const PerPageHelperComponent: Story<PerPageHelperComponentProps> = (
|
|
|
52
45
|
args
|
|
53
46
|
) => <PerPageHelper {...args} />;
|
|
54
47
|
|
|
55
|
-
export const ReactTableHelperComponent: Story<
|
|
56
|
-
ReactTableHelperComponentProps<any>
|
|
57
|
-
> = (args) => (
|
|
58
|
-
<>
|
|
59
|
-
<Router>
|
|
60
|
-
<ReactTableHelper {...args} />
|
|
61
|
-
</Router>
|
|
62
|
-
</>
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
const ComponentInsideRouter = (args) => {
|
|
66
|
-
const ref = useRef<ReactTableHelperComponentRef>(null);
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<ReactTableHelper
|
|
70
|
-
{...args}
|
|
71
|
-
ref={ref}
|
|
72
|
-
externalFilters={{ uniqField: "uniqField" }}
|
|
73
|
-
/>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const ReactTableHelperComponentWithColumns: Story<
|
|
78
|
-
ReactTableHelperComponentProps<any>
|
|
79
|
-
> = (args) => {
|
|
80
|
-
return (
|
|
81
|
-
<>
|
|
82
|
-
<Router>
|
|
83
|
-
<ComponentInsideRouter {...args} />
|
|
84
|
-
</Router>
|
|
85
|
-
</>
|
|
86
|
-
);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
48
|
const getPaginator = (perPage, items = 100) =>
|
|
90
49
|
({
|
|
91
50
|
current_page: 1,
|
|
@@ -139,88 +98,3 @@ TableHelperComponent.args = {
|
|
|
139
98
|
PaginationHelperComponent.args = {
|
|
140
99
|
paginator: getPaginator(24, 100),
|
|
141
100
|
};
|
|
142
|
-
|
|
143
|
-
ReactTableHelperComponent.args = {
|
|
144
|
-
isLoading: false,
|
|
145
|
-
headers: [
|
|
146
|
-
{
|
|
147
|
-
title: "ID",
|
|
148
|
-
key: "id",
|
|
149
|
-
isSortable: true,
|
|
150
|
-
width: "600px",
|
|
151
|
-
},
|
|
152
|
-
"Title",
|
|
153
|
-
"Description",
|
|
154
|
-
"Action",
|
|
155
|
-
],
|
|
156
|
-
paginator: getPaginator(24, 10),
|
|
157
|
-
renderItemFn: (row) => {
|
|
158
|
-
return (
|
|
159
|
-
<tr key={row.id}>
|
|
160
|
-
<td>{row.id}</td>
|
|
161
|
-
<td>{row.title}</td>
|
|
162
|
-
<td>{row.description}</td>
|
|
163
|
-
<td>ADD | REMOVE</td>
|
|
164
|
-
</tr>
|
|
165
|
-
);
|
|
166
|
-
},
|
|
167
|
-
striped: false,
|
|
168
|
-
bordered: false,
|
|
169
|
-
displayShowingSection: false,
|
|
170
|
-
initialOptions: {
|
|
171
|
-
page: 1,
|
|
172
|
-
perPage: 10,
|
|
173
|
-
sortKey: "id",
|
|
174
|
-
sortDirection: "desc",
|
|
175
|
-
filter: "",
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
ReactTableHelperComponentWithColumns.args = {
|
|
180
|
-
isLoading: false,
|
|
181
|
-
columns: [
|
|
182
|
-
{
|
|
183
|
-
accessorKey: "id",
|
|
184
|
-
header: () => "CustomHeader",
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
accessorKey: "title",
|
|
188
|
-
header: () => "SuperTitle",
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
accessorKey: "description",
|
|
192
|
-
header: () => "AwesomeDescription",
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
accessorKey: "actions",
|
|
196
|
-
header: () => "Incredible Actions",
|
|
197
|
-
},
|
|
198
|
-
],
|
|
199
|
-
sortableColumns: ["id"],
|
|
200
|
-
paginator: getPaginator(24, 10),
|
|
201
|
-
renderRow: (row: ReactTableHelperRow<any>) => {
|
|
202
|
-
return (
|
|
203
|
-
<tr key={row.id}>
|
|
204
|
-
{row.getVisibleCells().map((cell) => {
|
|
205
|
-
return (
|
|
206
|
-
<td key={cell.id}>
|
|
207
|
-
{cell.column.id === "actions"
|
|
208
|
-
? "ADD | REMOVE"
|
|
209
|
-
: flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
210
|
-
</td>
|
|
211
|
-
);
|
|
212
|
-
})}
|
|
213
|
-
</tr>
|
|
214
|
-
);
|
|
215
|
-
},
|
|
216
|
-
striped: false,
|
|
217
|
-
bordered: false,
|
|
218
|
-
displayShowingSection: false,
|
|
219
|
-
initialOptions: {
|
|
220
|
-
page: 1,
|
|
221
|
-
perPage: 10,
|
|
222
|
-
sortKey: "id",
|
|
223
|
-
sortDirection: "desc",
|
|
224
|
-
filter: "",
|
|
225
|
-
},
|
|
226
|
-
};
|
|
@@ -14,7 +14,6 @@ import { FilterHelperComponent } from "./FilterHelperComponent";
|
|
|
14
14
|
import { PaginationHelperComponent } from "./PaginationHelperComponent";
|
|
15
15
|
import { PerPageHelperComponent } from "./PerPageHelperComponent";
|
|
16
16
|
import { getFilterOptionsValue } from "./utils";
|
|
17
|
-
import { ExtendedTableOptions } from "./types";
|
|
18
17
|
|
|
19
18
|
export interface TableHelperComponentProps {
|
|
20
19
|
headers: ITableHeader[];
|
|
@@ -32,6 +31,7 @@ export interface TableHelperComponentProps {
|
|
|
32
31
|
initialOptions?: Partial<ITableProps>;
|
|
33
32
|
}
|
|
34
33
|
|
|
34
|
+
export type ExtendedTableOptions = ITableProps & { [key: string]: any };
|
|
35
35
|
// @TODO Refactor? component to get less complexity
|
|
36
36
|
// with query filter params. Now External filters use only in
|
|
37
37
|
// one place of Dashboard.
|
|
@@ -42,8 +42,6 @@ export interface TableHelperComponentProps {
|
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* TableHelperComponent
|
|
45
|
-
* @deprecated use new ReactTableHelperComponent
|
|
46
|
-
* for default tables
|
|
47
45
|
* @param props
|
|
48
46
|
* @constructor
|
|
49
47
|
*/
|
package/src/table/index.ts
CHANGED
package/src/table/utils/index.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import ITableProps from "@licklist/plugins/dist/types/services/Table/ITableProps";
|
|
2
2
|
import TableService from "@licklist/plugins/dist/services/Table/TableService";
|
|
3
3
|
|
|
4
|
-
export { flexRender } from "@tanstack/react-table";
|
|
5
|
-
|
|
6
4
|
const DEFAULT_QUERY_VALUES: { [key in keyof ITableProps]: string | number } = {
|
|
7
5
|
page: TableService.DEFAULT_PAGE,
|
|
8
6
|
perPage: TableService.DEFAULT_PER_PAGE,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare type CustomerFilterValues = {
|
|
3
|
-
first_name: string;
|
|
4
|
-
last_name: string;
|
|
5
|
-
email: string;
|
|
6
|
-
phone: string;
|
|
7
|
-
};
|
|
8
|
-
export interface CustomerFilterProps {
|
|
9
|
-
values: CustomerFilterValues;
|
|
10
|
-
onChange: (values: CustomerFilterValues) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const CustomerFilter: ({ values, onChange }: CustomerFilterProps) => JSX.Element;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=CustomerFilter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomerFilter.d.ts","sourceRoot":"","sources":["../../../../src/customers/components/filter/CustomerFilter.tsx"],"names":[],"mappings":";AAKA,aAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AASF,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,QAAQ,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAClD;AAED,eAAO,MAAM,cAAc,yBAA0B,mBAAmB,gBAyBvE,CAAC"}
|