@licklist/design 0.44.484 → 0.44.485-dev.0

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.
Files changed (71) hide show
  1. package/dist/customers/components/filter/CustomerFilter.d.ts +14 -0
  2. package/dist/customers/components/filter/CustomerFilter.d.ts.map +1 -0
  3. package/dist/customers/components/filter/CustomerFilter.js +1 -0
  4. package/dist/customers/components/filter/index.d.ts +3 -0
  5. package/dist/customers/components/filter/index.d.ts.map +1 -0
  6. package/dist/customers/components/index.d.ts +2 -0
  7. package/dist/customers/components/index.d.ts.map +1 -0
  8. package/dist/customers/index.d.ts +2 -0
  9. package/dist/customers/index.d.ts.map +1 -0
  10. package/dist/events/event-statistic-modal/EventStatisticModal.d.ts +1 -2
  11. package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
  12. package/dist/events/event-statistic-modal/EventStatisticModal.js +1 -1
  13. package/dist/events/event-statistic-modal/hooks/useTableData.d.ts +1 -1
  14. package/dist/events/event-statistic-modal/hooks/useTableData.d.ts.map +1 -1
  15. package/dist/events/event-statistic-modal/hooks/useTableData.js +1 -1
  16. package/dist/events/event-statistic-modal/utils/index.d.ts +1 -1
  17. package/dist/events/event-statistic-modal/utils/index.d.ts.map +1 -1
  18. package/dist/events/event-statistic-modal/utils/index.js +1 -1
  19. package/dist/iframe/payment/order-items-table/OrderItemsTable.js +1 -1
  20. package/dist/iframe/payment/payment-form/PaymentForm.js +1 -1
  21. package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
  22. package/dist/iframe/ryft/RyftPaymentForm.js +1 -1
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +1 -1
  26. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  27. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  28. package/dist/sales/notes/NotesTableRow.js +1 -1
  29. package/dist/setting/dashboard/snippets/card/SnippetCard.js +1 -1
  30. package/dist/styles/customers/Filter.scss +34 -0
  31. package/dist/styles/customers/_index.scss +1 -0
  32. package/dist/styles/packages.scss +1 -0
  33. package/dist/table/ReactTableHelperComponent.d.ts +12 -0
  34. package/dist/table/ReactTableHelperComponent.d.ts.map +1 -0
  35. package/dist/table/ReactTableHelperComponent.js +1 -0
  36. package/dist/table/TableHelperComponent.d.ts +2 -3
  37. package/dist/table/TableHelperComponent.d.ts.map +1 -1
  38. package/dist/table/hooks/useTableQueryOptions.d.ts +20 -0
  39. package/dist/table/hooks/useTableQueryOptions.d.ts.map +1 -0
  40. package/dist/table/hooks/useTableQueryOptions.js +1 -0
  41. package/dist/table/index.d.ts +1 -0
  42. package/dist/table/index.d.ts.map +1 -1
  43. package/dist/table/types.d.ts +41 -0
  44. package/dist/table/types.d.ts.map +1 -0
  45. package/dist/table/utils/index.d.ts +1 -0
  46. package/dist/table/utils/index.d.ts.map +1 -1
  47. package/dist/table/utils/index.js +1 -1
  48. package/package.json +2 -1
  49. package/src/customers/components/filter/CustomerFilter.stories.tsx +19 -0
  50. package/src/customers/components/filter/CustomerFilter.tsx +50 -0
  51. package/src/customers/components/filter/index.ts +2 -0
  52. package/src/customers/components/index.ts +1 -0
  53. package/src/customers/index.ts +1 -0
  54. package/src/events/event-statistic-modal/EventStatisticModal.tsx +1 -4
  55. package/src/events/event-statistic-modal/hooks/useTableData.tsx +4 -10
  56. package/src/events/event-statistic-modal/utils/index.ts +35 -38
  57. package/src/iframe/payment/payment-page/PaymentPage.tsx +0 -1
  58. package/src/iframe/ryft/RyftPaymentForm.tsx +1 -1
  59. package/src/index.ts +1 -0
  60. package/src/product-set/form/ProductCategoriesControl.tsx +4 -3
  61. package/src/sales/notes/NotesTableRow.tsx +1 -1
  62. package/src/styles/customers/Filter.scss +34 -0
  63. package/src/styles/customers/_index.scss +1 -0
  64. package/src/styles/packages.scss +1 -0
  65. package/src/table/ReactTableHelperComponent.tsx +321 -0
  66. package/src/table/Table.stories.tsx +127 -1
  67. package/src/table/TableHelperComponent.tsx +3 -1
  68. package/src/table/hooks/useTableQueryOptions.ts +49 -0
  69. package/src/table/index.ts +1 -0
  70. package/src/table/types.ts +47 -0
  71. package/src/table/utils/index.ts +2 -0
@@ -0,0 +1,41 @@
1
+ import { ReactNode, CSSProperties } from "react";
2
+ import { TableOptions, ColumnDef, Row as TableRow } from "@tanstack/react-table";
3
+ import ILengthAwarePaginator from "@licklist/plugins/dist/types/services/Table/ILengthAwarePaginator";
4
+ import ITableHeader from "@licklist/plugins/dist/types/services/Table/ITableHeader";
5
+ import ITableProps from "@licklist/plugins/dist/types/services/Table/ITableProps";
6
+ export declare type ReactTableHelperRow<T extends object> = TableRow<T>;
7
+ export declare type ExtendedTableOptions = ITableProps & {
8
+ [key: string]: any;
9
+ };
10
+ export interface TableComponentProps<T extends object> extends Omit<TableOptions<T>, "columns" | "data" | "getCoreRowModel"> {
11
+ paginator?: ILengthAwarePaginator<T>;
12
+ isLoading?: boolean;
13
+ striped?: boolean;
14
+ bordered?: boolean;
15
+ displaySearchBar?: boolean;
16
+ displayPerPageSelect?: boolean;
17
+ displayShowingSection?: boolean;
18
+ externalFilters?: {
19
+ [key: string]: any;
20
+ };
21
+ initialOptions?: Partial<ITableProps>;
22
+ sortableColumns?: string[];
23
+ }
24
+ export declare type TableColumnMeta = {
25
+ onClick?: () => void;
26
+ className?: string;
27
+ style?: CSSProperties;
28
+ };
29
+ export declare type TableComponentPropsWithOldTableData<T extends object> = {
30
+ headers: ITableHeader[];
31
+ renderItemFn: (row: T, index: number) => void;
32
+ columns?: never;
33
+ renderRow?: never;
34
+ };
35
+ export declare type TableComponentPropsWithReactTableData<T extends object> = {
36
+ headers?: never;
37
+ renderItemFn?: never;
38
+ columns: ColumnDef<T, any>[];
39
+ renderRow: (row: ReactTableHelperRow<T>) => ReactNode;
40
+ };
41
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/table/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EACL,YAAY,EACZ,SAAS,EACT,GAAG,IAAI,QAAQ,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,qBAAqB,MAAM,mEAAmE,CAAC;AACtG,OAAO,YAAY,MAAM,0DAA0D,CAAC;AACpF,OAAO,WAAW,MAAM,yDAAyD,CAAC;AAElF,oBAAY,mBAAmB,CAAC,CAAC,SAAS,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;AAEhE,oBAAY,oBAAoB,GAAG,WAAW,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAExE,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM,CACnD,SAAQ,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,iBAAiB,CAAC;IACrE,SAAS,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,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;IACtC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,oBAAY,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,oBAAY,mCAAmC,CAAC,CAAC,SAAS,MAAM,IAAI;IAClE,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,YAAY,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,CAAC;AAEF,oBAAY,qCAAqC,CAAC,CAAC,SAAS,MAAM,IAAI;IACpE,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,OAAO,EAAE,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IAC7B,SAAS,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;CACvD,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import ITableProps from "@licklist/plugins/dist/types/services/Table/ITableProps";
2
+ export { flexRender } from "@tanstack/react-table";
2
3
  export declare const getFilterOptionsValue: (query: URLSearchParams, initialOptions: Partial<ITableProps>, key: keyof ITableProps) => string | number;
3
4
  //# 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;AAWlF,eAAO,MAAM,qBAAqB,UACzB,eAAe,kBACN,QAAQ,WAAW,CAAC,OAC/B,MAAM,WAAW,oBAWvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,yDAAyD,CAAC;AAGlF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAUnD,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={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]};
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=require("@tanstack/react-table"),i={page:t.DEFAULT_PAGE,perPage:t.DEFAULT_PER_PAGE,sortDirection:t.DEFAULT_SORT_DIRECTION,sortKey:t.DEFAULT_SORT_KEY,filter:""};Object.defineProperty(exports,"flexRender",{enumerable:!0,get:function(){return r.flexRender}}),exports.getFilterOptionsValue=function(e,t,r){return e.get(r)?e.get(r):t[r]?t[r]:i[r]};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.484",
3
+ "version": "0.44.485-dev.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -71,6 +71,7 @@
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",
74
75
  "@testing-library/jest-dom": "5.16.1",
75
76
  "@testing-library/react": "11.2.5",
76
77
  "@testing-library/react-hooks": "5.1.0",
@@ -0,0 +1,19 @@
1
+ import React, { useState } from "react";
2
+ import { Meta, Story } from "@storybook/react";
3
+ import { CustomerFilter, CustomerFilterProps } from "./CustomerFilter";
4
+
5
+ export default {
6
+ title: "Customers/Filter",
7
+ component: CustomerFilter,
8
+ } as Meta;
9
+
10
+ export const Default: Story<CustomerFilterProps> = () => {
11
+ const [values, setValues] = useState({
12
+ first_name: "",
13
+ last_name: "",
14
+ email: "",
15
+ phone: "",
16
+ });
17
+
18
+ return <CustomerFilter values={values} onChange={setValues} />;
19
+ };
@@ -0,0 +1,50 @@
1
+ import React from "react";
2
+ import { useTranslation } from "react-i18next";
3
+ import clsx from "clsx";
4
+ import { TextField } from "../../../static/TextField";
5
+
6
+ type CustomerFilterValues = {
7
+ first_name: string;
8
+ last_name: string;
9
+ email: string;
10
+ phone: string;
11
+ };
12
+
13
+ const FILTER_FIELDS = {
14
+ first_name: "firstName",
15
+ last_name: "lastName",
16
+ email: "email",
17
+ phone: "phone",
18
+ };
19
+
20
+ export interface CustomerFilterProps {
21
+ values: CustomerFilterValues;
22
+ onChange: (values: CustomerFilterValues) => void;
23
+ }
24
+
25
+ export const CustomerFilter = ({ values, onChange }: CustomerFilterProps) => {
26
+ const { t } = useTranslation(["Design"]);
27
+
28
+ return (
29
+ <div className="customers-filter d-flex">
30
+ <div className="d-flex customers-filter-items">
31
+ {Object.keys(FILTER_FIELDS).map((filterKeyName) => {
32
+ const label = t(FILTER_FIELDS[filterKeyName]);
33
+
34
+ return (
35
+ <TextField
36
+ key={filterKeyName}
37
+ className={clsx("mb-0")}
38
+ type="text"
39
+ label={label}
40
+ value={values[filterKeyName]}
41
+ onChange={(event) =>
42
+ onChange({ ...values, [filterKeyName]: event.target.value })
43
+ }
44
+ />
45
+ );
46
+ })}
47
+ </div>
48
+ </div>
49
+ );
50
+ };
@@ -0,0 +1,2 @@
1
+ export { CustomerFilter } from "./CustomerFilter";
2
+ export type { CustomerFilterProps } from "./CustomerFilter";
@@ -0,0 +1 @@
1
+ export * from "./filter";
@@ -0,0 +1 @@
1
+ export * from "./components";
@@ -11,7 +11,6 @@ export type EventStatisticModalProps = {
11
11
  setIsOpen: (value: boolean) => void;
12
12
  eventStatistic?: EventStatistic | null;
13
13
  title?: string;
14
- date?: string;
15
14
  };
16
15
 
17
16
  export const EventStatisticModal = ({
@@ -19,11 +18,9 @@ export const EventStatisticModal = ({
19
18
  setIsOpen,
20
19
  eventStatistic,
21
20
  title,
22
- date,
23
21
  }: EventStatisticModalProps) => {
24
22
  const { t } = useTranslation("Design");
25
- const data = useTableData(eventStatistic, date);
26
-
23
+ const data = useTableData(eventStatistic);
27
24
  const handleClose = () => {
28
25
  setIsOpen(false);
29
26
  };
@@ -7,10 +7,7 @@ import { EventStatistic } from "@licklist/core/dist/DataMapper/Provider/EventSta
7
7
  import { convertEventStatisticToTableData, TRANSLATION_KEYS } from "../utils";
8
8
  import { StaticTableData } from "../../../table";
9
9
 
10
- export const useTableData = (
11
- eventStatistic: EventStatistic | null,
12
- date: string
13
- ) => {
10
+ export const useTableData = (eventStatistic: EventStatistic | null) => {
14
11
  const { t } = useTranslation("Design");
15
12
  const { formatNumber } = useIntl();
16
13
  const [tableRows, setTableRows] = useState<StaticTableData[]>([]);
@@ -31,17 +28,14 @@ export const useTableData = (
31
28
  return t(key);
32
29
  };
33
30
 
34
- const transformStatisticToTableRows = (
35
- statistic: EventStatistic | null,
36
- date: string
37
- ) => {
31
+ const transformStatisticToTableRows = (statistic: EventStatistic | null) => {
38
32
  if (!statistic) {
39
33
  return [];
40
34
  }
41
35
 
42
36
  const tableDataRows: StaticTableData[] = [];
43
37
 
44
- convertEventStatisticToTableData(statistic, date).forEach(
38
+ convertEventStatisticToTableData(statistic).forEach(
45
39
  ({ name, quantity, total, isBold, isHeader, key }) => {
46
40
  const formattedTotal = !Object.keys(TRANSLATION_KEYS).includes(
47
41
  String(total)
@@ -83,7 +77,7 @@ export const useTableData = (
83
77
  };
84
78
 
85
79
  useEffect(() => {
86
- setTableRows(transformStatisticToTableRows(eventStatistic, date));
80
+ setTableRows(transformStatisticToTableRows(eventStatistic));
87
81
  // eslint-disable-next-line react-hooks/exhaustive-deps
88
82
  }, [eventStatistic]);
89
83
 
@@ -1,6 +1,4 @@
1
1
  import { EventStatistic } from "@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper";
2
- import { DateTime } from "luxon";
3
- import { DATE_TIME_FULL_FORMAT } from "@licklist/core/dist/Config";
4
2
 
5
3
  export const TRANSLATION_KEYS = {
6
4
  shortQuantity: "shortQuantity",
@@ -9,8 +7,7 @@ export const TRANSLATION_KEYS = {
9
7
  };
10
8
 
11
9
  export const convertEventStatisticToTableData = (
12
- eventStatistic: EventStatistic,
13
- date: string
10
+ eventStatistic: EventStatistic
14
11
  ) => {
15
12
  let totalAmount = 0;
16
13
  let totalQuantity = 0;
@@ -28,49 +25,49 @@ export const convertEventStatisticToTableData = (
28
25
  total: string | number;
29
26
  }[] = [];
30
27
 
31
- const formattedDate = DateTime.fromISO(date)
32
- .toUTC()
33
- .toFormat(DATE_TIME_FULL_FORMAT);
28
+ Object.values(eventStatistic?.productCategorySummary)?.forEach(
29
+ (categories) => {
30
+ categories?.forEach(
31
+ ({ totalPerCategory, productsSummary = [], categoryName, eventId }) => {
32
+ let quantity = 0;
34
33
 
35
- eventStatistic?.productCategorySummary?.[formattedDate]?.forEach(
36
- ({ totalPerCategory, productsSummary = [], categoryName, eventId }) => {
37
- let quantity = 0;
34
+ totalAmount += totalPerCategory || 0;
38
35
 
39
- totalAmount += totalPerCategory || 0;
36
+ tableDataArray.push({
37
+ name: categoryName,
38
+ key: `${eventId}.${categoryName}`,
39
+ isBold: true,
40
+ isHeader: true,
41
+ quantity: TRANSLATION_KEYS.shortQuantity,
42
+ total: TRANSLATION_KEYS.total,
43
+ });
40
44
 
41
- tableDataArray.push({
42
- name: categoryName,
43
- key: `${eventId}.${categoryName}`,
44
- isBold: true,
45
- isHeader: true,
46
- quantity: TRANSLATION_KEYS.shortQuantity,
47
- total: TRANSLATION_KEYS.total,
48
- });
45
+ productsSummary?.forEach(
46
+ ({ productsSold, name, totalQuantity, total }) => {
47
+ quantity += productsSold;
49
48
 
50
- productsSummary?.forEach(
51
- ({ productsSold, name, totalQuantity, total }) => {
52
- quantity += productsSold;
49
+ tableDataArray.push({
50
+ name,
51
+ key: `${eventId}.${categoryName}.${name}`,
52
+ quantity: totalQuantity
53
+ ? `${productsSold} / ${totalQuantity}`
54
+ : String(productsSold),
55
+ total: String(total),
56
+ });
57
+ }
58
+ );
53
59
 
54
60
  tableDataArray.push({
55
- name,
56
- key: `${eventId}.${categoryName}.${name}`,
57
- quantity: totalQuantity
58
- ? `${productsSold} / ${totalQuantity}`
59
- : String(productsSold),
60
- total: String(total),
61
+ name: TRANSLATION_KEYS.totalPerCategory,
62
+ key: `${eventId}.${categoryName}.${TRANSLATION_KEYS.totalPerCategory}`,
63
+ quantity,
64
+ total: totalPerCategory,
65
+ isBold: true,
61
66
  });
67
+
68
+ totalQuantity += quantity;
62
69
  }
63
70
  );
64
-
65
- tableDataArray.push({
66
- name: TRANSLATION_KEYS.totalPerCategory,
67
- key: `${eventId}.${categoryName}.${TRANSLATION_KEYS.totalPerCategory}`,
68
- quantity,
69
- total: totalPerCategory,
70
- isBold: true,
71
- });
72
-
73
- totalQuantity += quantity;
74
71
  }
75
72
  );
76
73
 
@@ -110,7 +110,6 @@ export const PaymentPage = ({
110
110
  onCloseButtonClick={isIframePayment ? onGoBack : undefined}
111
111
  >
112
112
  <PaymentTimer />
113
-
114
113
  <div className="d-flex align-items-center justify-content-center w-100">
115
114
  {t("paymentDetails")}
116
115
  </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 px-1">
186
+ <div className="submit-button-wrapper mt-3 p-1">
187
187
  <Button type="submit" disabled={isBtnDisabled || !isValid}>
188
188
  {isBtnDisabled && <ButtonLoader />}
189
189
  {t("Design:buyNow")}
package/src/index.ts CHANGED
@@ -32,3 +32,4 @@ export * from "./typeahead-helper";
32
32
  export * from "./zone";
33
33
  export * from "./resource";
34
34
  export * from "./virtualized";
35
+ export * from "./customers";
@@ -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,14 +168,15 @@ export function ProductCategoriesControl({
168
168
  return sum + Number(product.totalQuantity);
169
169
  }, 0);
170
170
 
171
- setProductCategoryState({
171
+ setProductCategoryState((prevState) => ({
172
+ ...prevState,
172
173
  // New added categories will have uniqueId
173
174
  // but existing have already assigned Id.
174
175
  [productCategory?.id || productCategory.uniqueId]: {
175
176
  price,
176
177
  quantity,
177
178
  },
178
- });
179
+ }));
179
180
  });
180
181
  }, [productCategories]);
181
182
 
@@ -7,8 +7,8 @@ import { Note } from "@licklist/core/dist/DataMapper/Order/NoteDataMapper";
7
7
  import { capitalize } from "lodash";
8
8
  import { DateTime } from "luxon";
9
9
  import {
10
- DATE_TIME_FULL_FORMAT,
11
10
  DATE_TIME_FORMAT,
11
+ DATE_TIME_FULL_FORMAT,
12
12
  } from "@licklist/core/dist/Config";
13
13
  import { getClientTimeZone } from "@licklist/core/dist/Services";
14
14
  import { ConfirmModal } from "../../modals";
@@ -0,0 +1,34 @@
1
+ .customers-filter {
2
+ gap: 0.5rem;
3
+
4
+ @include media-breakpoint-down(sm) {
5
+ label {
6
+ font-size: 0.8rem;
7
+ }
8
+ }
9
+
10
+ @include media-breakpoint-up(md) {
11
+ label {
12
+ font-size: 0.9rem;
13
+ }
14
+ }
15
+
16
+ @include media-breakpoint-up(lg) {
17
+ label {
18
+ font-size: 1rem;
19
+ }
20
+ }
21
+
22
+ @include media-breakpoint-down(lg) {
23
+ flex-direction: column;
24
+ }
25
+
26
+ .customers-filter-items {
27
+ gap: 0.5rem;
28
+
29
+ @include media-breakpoint-down(xs) {
30
+ flex-direction: column;
31
+ gap: 0rem;
32
+ }
33
+ }
34
+ }
@@ -0,0 +1 @@
1
+ @import "./Filter.scss";
@@ -35,3 +35,4 @@
35
35
  @import "./skeleton";
36
36
  @import "./virtualized/";
37
37
  @import "./error";
38
+ @import "./customers/";