@licklist/design 0.50.0 → 0.50.1-dev.1
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/calendar/Calendar.d.ts +3 -0
- package/dist/calendar/Calendar.d.ts.map +1 -1
- package/dist/calendar/components/CalendarButtons/CalendarButtons.js +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.js +1 -1
- package/dist/calendar/utils/index.d.ts +2 -1
- package/dist/calendar/utils/index.d.ts.map +1 -1
- package/dist/calendar/utils/index.js +1 -1
- package/dist/date-time-button/DateTimeButton.d.ts +3 -2
- package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
- package/dist/date-time-button/DateTimeButton.js +1 -1
- package/dist/events/event-card/EventCard.d.ts +2 -1
- package/dist/events/event-card/EventCard.d.ts.map +1 -1
- package/dist/events/event-card/EventCard.js +1 -1
- package/dist/events/event-venue-map/components/Scrollbars/Scrollbars.js +1 -1
- package/dist/iframe/event/event-booking-products/EventBookingProducts.js +1 -1
- package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.d.ts +2 -2
- package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.d.ts.map +1 -1
- package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.js +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts +2 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.js +1 -1
- package/dist/iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.d.ts +2 -1
- package/dist/iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +1 -1
- package/dist/iframe/order-process/components/utils/useCategoryVerification.js +1 -1
- package/dist/index.js +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.js +1 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.d.ts +2 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.d.ts.map +1 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.js +1 -1
- package/dist/static/date-range-input/DateRangeInput.d.ts.map +1 -1
- package/dist/static/date-range-input/DateRangeInput.js +1 -1
- package/dist/static/switch/BooleanSwitch.d.ts +3 -1
- package/dist/static/switch/BooleanSwitch.d.ts.map +1 -1
- package/dist/static/switch/BooleanSwitch.js +1 -1
- package/dist/styles/events/EventCard.scss +3 -6
- package/dist/styles/resources-blocking/_index.scss +6 -0
- package/dist/styles/sales/BookingFilter.scss +21 -1
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/styles/sales/BookingTabs.scss +63 -5
- package/dist/styles/sales/LifeTimeSales.scss +1 -0
- package/dist/styles/sales/ManualBooking.scss +62 -3
- package/dist/styles/sales/SourceOfSales.scss +3 -0
- package/dist/styles/snippet-templates/SnippetTemplateCard.scss +3 -2
- package/dist/styles/static/Switch.scss +1 -0
- package/dist/styles/static/Tabs.scss +6 -0
- package/dist/styles/themes/bookedit/_index.scss +9 -8
- package/dist/table/TableHelperComponent.d.ts +2 -1
- package/dist/table/TableHelperComponent.d.ts.map +1 -1
- package/dist/table/TableHelperComponent.js +1 -1
- package/package.json +3 -3
- package/src/calendar/Calendar.tsx +5 -0
- package/src/calendar/components/CalendarButtons/CalendarButtons.tsx +3 -3
- package/src/calendar/components/CalendarDates/CalendarDates.tsx +5 -2
- package/src/calendar/utils/index.ts +15 -6
- package/src/date-time-button/DateTimeButton.tsx +16 -3
- package/src/events/event-card/EventCard.stories.tsx +1 -0
- package/src/events/event-card/EventCard.tsx +8 -1
- package/src/iframe/event/event-booking-products/EventBookingProducts.tsx +1 -1
- package/src/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.tsx +8 -8
- package/src/iframe/event/event-card/IframeEventCard.tsx +3 -1
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.stories.tsx +5 -5
- package/src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx +2 -2
- package/src/iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.tsx +16 -3
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +2 -2
- package/src/iframe/order-process/components/utils/useCategoryVerification.ts +1 -1
- package/src/iframe/payment/payment-page/PaymentPage.stories.tsx +1 -1
- package/src/notification/email-template/control/EmailTemplateControl.tsx +5 -15
- package/src/sales/manual-booking/summary/ManualBookingSummary.tsx +9 -1
- package/src/static/date-range-input/DateRangeInput.tsx +23 -2
- package/src/static/switch/BooleanSwitch.tsx +6 -2
- package/src/styles/events/EventCard.scss +3 -6
- package/src/styles/resources-blocking/_index.scss +6 -0
- package/src/styles/sales/BookingFilter.scss +21 -1
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/styles/sales/BookingTabs.scss +63 -5
- package/src/styles/sales/LifeTimeSales.scss +1 -0
- package/src/styles/sales/ManualBooking.scss +62 -3
- package/src/styles/sales/SourceOfSales.scss +3 -0
- package/src/styles/snippet-templates/SnippetTemplateCard.scss +3 -2
- package/src/styles/static/Switch.scss +1 -0
- package/src/styles/static/Tabs.scss +6 -0
- package/src/styles/themes/bookedit/_index.scss +9 -8
- package/src/table/TableHelperComponent.tsx +73 -18
|
@@ -1,24 +1,49 @@
|
|
|
1
1
|
.booking-tabs-pane {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
|
+
justify-content: space-between;
|
|
4
5
|
align-items: center;
|
|
5
6
|
height: 2.75rem;
|
|
6
7
|
background-color: $white;
|
|
7
8
|
|
|
8
9
|
.booking-tabs {
|
|
9
10
|
svg {
|
|
10
|
-
g
|
|
11
|
-
fill: $white;
|
|
11
|
+
g>rect:first-child {
|
|
12
|
+
fill: $white;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
|
|
15
16
|
.active {
|
|
16
17
|
svg {
|
|
17
|
-
g
|
|
18
|
-
fill: $blue;
|
|
18
|
+
g>rect:first-child {
|
|
19
|
+
fill: $blue;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
}
|
|
23
|
+
|
|
24
|
+
@include media-breakpoint-down(sm) {
|
|
25
|
+
width: 4rem;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.content {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
width: 85%;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
|
|
35
|
+
@include media-breakpoint-down(sm) {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
align-items: start;
|
|
39
|
+
height: 4rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.booking {
|
|
43
|
+
@include media-breakpoint-down(sm) {
|
|
44
|
+
height: 13rem;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
22
47
|
}
|
|
23
48
|
|
|
24
49
|
.separator {
|
|
@@ -29,6 +54,12 @@
|
|
|
29
54
|
.children {
|
|
30
55
|
flex: 1;
|
|
31
56
|
margin-left: 1rem;
|
|
57
|
+
|
|
58
|
+
@include media-breakpoint-down(sm) {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
align-items: start;
|
|
62
|
+
}
|
|
32
63
|
}
|
|
33
64
|
|
|
34
65
|
.buttons {
|
|
@@ -61,6 +92,33 @@
|
|
|
61
92
|
border-radius: 0.625rem;
|
|
62
93
|
margin-right: 0.5rem;
|
|
63
94
|
}
|
|
95
|
+
@include media-breakpoint-down(sm) {
|
|
96
|
+
width: 12.5rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@include media-breakpoint-down(sm) {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
align-items: start;
|
|
105
|
+
gap: .5rem;
|
|
106
|
+
margin-top: .5rem;
|
|
107
|
+
white-space: nowrap;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@include media-breakpoint-down(sm) {
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: start;
|
|
114
|
+
gap: 1rem;
|
|
115
|
+
margin-top: 1rem;
|
|
116
|
+
height: 100%;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.booking {
|
|
120
|
+
@include media-breakpoint-down(sm) {
|
|
121
|
+
height: 13rem;
|
|
64
122
|
}
|
|
65
123
|
}
|
|
66
124
|
}
|
|
@@ -361,10 +361,11 @@
|
|
|
361
361
|
width: inherit;
|
|
362
362
|
|
|
363
363
|
@include media-breakpoint-down(sm) {
|
|
364
|
-
|
|
365
|
-
padding-top: 2rem;
|
|
364
|
+
display: none;
|
|
366
365
|
}
|
|
367
366
|
|
|
367
|
+
|
|
368
|
+
|
|
368
369
|
.form-control {
|
|
369
370
|
margin-bottom: 1.5rem;
|
|
370
371
|
}
|
|
@@ -411,6 +412,64 @@
|
|
|
411
412
|
}
|
|
412
413
|
}
|
|
413
414
|
|
|
415
|
+
.manual-booking-summary-mobile {
|
|
416
|
+
display: none;
|
|
417
|
+
|
|
418
|
+
@include media-breakpoint-down(sm) {
|
|
419
|
+
display: block;
|
|
420
|
+
padding: 0 1.5rem;
|
|
421
|
+
padding-top: 2rem;
|
|
422
|
+
height: max-content;
|
|
423
|
+
margin-bottom: 1.5rem;
|
|
424
|
+
width: inherit;
|
|
425
|
+
|
|
426
|
+
.form-control {
|
|
427
|
+
margin-bottom: .5rem;
|
|
428
|
+
}
|
|
429
|
+
.receipt-title {
|
|
430
|
+
font-size: 1.125rem;
|
|
431
|
+
font-weight: 600;
|
|
432
|
+
padding-bottom: 0.4rem;
|
|
433
|
+
margin-bottom: 1rem;
|
|
434
|
+
border-bottom: 2px solid $gray-400;
|
|
435
|
+
}
|
|
436
|
+
.event-name {
|
|
437
|
+
font-size: 0.94rem;
|
|
438
|
+
font-weight: 600;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.border-summary-item {
|
|
442
|
+
padding-bottom: 0.9rem;
|
|
443
|
+
margin-bottom: 1%;
|
|
444
|
+
border-bottom: 2px solid $gray-100;
|
|
445
|
+
flex-wrap: wrap;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.total-container {
|
|
449
|
+
display: flex;
|
|
450
|
+
justify-content: space-between;
|
|
451
|
+
font-size: 1rem;
|
|
452
|
+
font-weight: 600;
|
|
453
|
+
|
|
454
|
+
@include media-breakpoint-down(lg) {
|
|
455
|
+
flex-wrap: wrap;
|
|
456
|
+
}
|
|
457
|
+
.total-amount {
|
|
458
|
+
padding-left: 1rem;
|
|
459
|
+
@include media-breakpoint-down(lg) {
|
|
460
|
+
padding-left: 0;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.summary-item-container {
|
|
466
|
+
.border-summary-item:nth-last-child(2) {
|
|
467
|
+
border-bottom: 2px solid $gray-400;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
414
473
|
.menu-list-manual-booking {
|
|
415
474
|
display: flex;
|
|
416
475
|
align-items: center;
|
|
@@ -437,4 +496,4 @@
|
|
|
437
496
|
color: $blue;
|
|
438
497
|
}
|
|
439
498
|
}
|
|
440
|
-
}
|
|
499
|
+
}
|
|
@@ -28,12 +28,13 @@ $snippet-template-card-button-transition: $product-set-card-transition !default;
|
|
|
28
28
|
border: 1px solid #ccc;
|
|
29
29
|
border-radius: $border-radius;
|
|
30
30
|
height: 10rem;
|
|
31
|
-
width: 15rem;
|
|
31
|
+
min-width: 15rem;
|
|
32
32
|
padding: 1rem;
|
|
33
33
|
|
|
34
34
|
@include media-breakpoint-down(sm) {
|
|
35
35
|
height: 100%;
|
|
36
36
|
max-height: 10rem;
|
|
37
|
+
width: 100%;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
p {
|
|
@@ -109,4 +110,4 @@ $snippet-template-card-button-transition: $product-set-card-transition !default;
|
|
|
109
110
|
&:hover {
|
|
110
111
|
border: 2px solid $blue;
|
|
111
112
|
}
|
|
112
|
-
}
|
|
113
|
+
}
|
|
@@ -27,6 +27,7 @@ $btn-switch-option-padding-y: calc(#{$btn-padding-y} - #{sp(1)}) !default;
|
|
|
27
27
|
border-radius: $btn-switch-option-border-radius;
|
|
28
28
|
margin: 0;
|
|
29
29
|
padding: $btn-switch-option-padding-y $btn-switch-option-padding-x;
|
|
30
|
+
min-width: 4.25rem;
|
|
30
31
|
|
|
31
32
|
&:hover,
|
|
32
33
|
&:active,
|
|
@@ -11,6 +11,12 @@ $tab-nav-link-active-border-bottom: 1px solid $tab-nav-link-active-color !defaul
|
|
|
11
11
|
margin-left: -1.25rem;
|
|
12
12
|
border-bottom: 1px solid $nav-tabs-border-color;
|
|
13
13
|
|
|
14
|
+
@include media-breakpoint-down(sm) {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
.nav-link {
|
|
15
21
|
color: $tab-nav-link-color;
|
|
16
22
|
background-color: transparent;
|
|
@@ -98,7 +98,8 @@
|
|
|
98
98
|
color: gray("600");
|
|
99
99
|
|
|
100
100
|
&.sortable {
|
|
101
|
-
&::before,
|
|
101
|
+
&::before,
|
|
102
|
+
&::after {
|
|
102
103
|
opacity: 1;
|
|
103
104
|
}
|
|
104
105
|
|
|
@@ -132,20 +133,20 @@
|
|
|
132
133
|
width: 2.5rem;
|
|
133
134
|
height: 2.5rem;
|
|
134
135
|
background-color: transparent;
|
|
135
|
-
|
|
136
|
+
|
|
136
137
|
svg {
|
|
137
138
|
margin-bottom: 2.5px;
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
&:hover {
|
|
141
142
|
cursor: pointer;
|
|
142
|
-
border-radius: .5rem;
|
|
143
|
+
border-radius: 0.5rem;
|
|
143
144
|
background-color: lighten($primary, 40);
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
.page-item {
|
|
148
|
-
margin-left: .4rem;
|
|
149
|
+
margin-left: 0.4rem;
|
|
149
150
|
min-width: 15px;
|
|
150
151
|
width: 2.5rem;
|
|
151
152
|
height: 2.5rem;
|
|
@@ -153,7 +154,7 @@
|
|
|
153
154
|
.page-link {
|
|
154
155
|
border: 0;
|
|
155
156
|
padding: 0;
|
|
156
|
-
border-radius: .5rem;
|
|
157
|
+
border-radius: 0.5rem;
|
|
157
158
|
height: 100%;
|
|
158
159
|
display: flex;
|
|
159
160
|
align-items: center;
|
|
@@ -162,13 +163,13 @@
|
|
|
162
163
|
color: $black;
|
|
163
164
|
font-weight: 600;
|
|
164
165
|
font-size: 0.875rem;
|
|
165
|
-
|
|
166
|
+
|
|
166
167
|
&:hover {
|
|
167
|
-
border-radius: .5rem;
|
|
168
|
+
border-radius: 0.5rem;
|
|
168
169
|
background-color: lighten($primary, 40);
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
|
-
|
|
172
|
+
|
|
172
173
|
&.active {
|
|
173
174
|
.page-link {
|
|
174
175
|
border: 2px solid $primary;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
2
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
+
import React, { SetStateAction, useEffect, useState } from "react";
|
|
3
3
|
import { Col, Row, Table } from "react-bootstrap";
|
|
4
4
|
import { useLocation } from "react-router-dom";
|
|
5
5
|
import { isEqual } from "lodash";
|
|
@@ -30,6 +30,7 @@ export interface TableHelperComponentProps {
|
|
|
30
30
|
displayShowingSection?: boolean;
|
|
31
31
|
externalFilters?: { [key: string]: any };
|
|
32
32
|
initialOptions?: Partial<ITableProps>;
|
|
33
|
+
filteredOrdersOptions?: (value: SetStateAction<ITableProps>) => void;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
// @TODO Refactor? component to get less complexity
|
|
@@ -62,6 +63,7 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
62
63
|
displayShowingSection = true,
|
|
63
64
|
externalFilters = {},
|
|
64
65
|
initialOptions = {},
|
|
66
|
+
filteredOrdersOptions,
|
|
65
67
|
} = props;
|
|
66
68
|
|
|
67
69
|
const query = useQuery();
|
|
@@ -97,8 +99,9 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
97
99
|
useEffect(
|
|
98
100
|
() => {
|
|
99
101
|
if (
|
|
100
|
-
isEqual(optionsCache, options) &&
|
|
101
|
-
|
|
102
|
+
(isEqual(optionsCache, options) &&
|
|
103
|
+
isEqual(cachedExtFilters, externalFilters)) ||
|
|
104
|
+
!!filteredOrdersOptions
|
|
102
105
|
)
|
|
103
106
|
return;
|
|
104
107
|
|
|
@@ -124,12 +127,12 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
124
127
|
);
|
|
125
128
|
},
|
|
126
129
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
127
|
-
[pathname, options, onRefreshFn, externalFilters]
|
|
130
|
+
[pathname, options, onRefreshFn, filteredOrdersOptions, externalFilters]
|
|
128
131
|
);
|
|
129
132
|
|
|
130
133
|
// Refresh table's content on manual trigger
|
|
131
134
|
useEffect(() => {
|
|
132
|
-
if (refreshedAt === refreshAt) {
|
|
135
|
+
if (refreshedAt === refreshAt || !!filteredOrdersOptions) {
|
|
133
136
|
return;
|
|
134
137
|
}
|
|
135
138
|
|
|
@@ -138,24 +141,44 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
138
141
|
if (onRefreshFn) {
|
|
139
142
|
onRefreshFn(options);
|
|
140
143
|
}
|
|
141
|
-
}, [onRefreshFn, options, refreshAt, refreshedAt]);
|
|
144
|
+
}, [onRefreshFn, options, refreshAt, filteredOrdersOptions, refreshedAt]);
|
|
142
145
|
|
|
143
146
|
const onSort = (key: string) => {
|
|
144
147
|
let nextDirection = TableService.DEFAULT_SORT_DIRECTION;
|
|
145
|
-
|
|
146
148
|
if (sortKey === key) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
if (filteredOrdersOptions) {
|
|
150
|
+
filteredOrdersOptions((prevOptions) => {
|
|
151
|
+
nextDirection = TableService.getSortDirection(
|
|
152
|
+
prevOptions.sortDirection,
|
|
153
|
+
nextDirection
|
|
154
|
+
);
|
|
152
155
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
return {
|
|
157
|
+
...prevOptions,
|
|
158
|
+
sortKey: key,
|
|
159
|
+
sortDirection: nextDirection,
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
} else {
|
|
163
|
+
setOptions((prevOptions) => {
|
|
164
|
+
nextDirection = TableService.getSortDirection(
|
|
165
|
+
prevOptions.sortDirection,
|
|
166
|
+
nextDirection
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
...prevOptions,
|
|
171
|
+
sortKey: key,
|
|
172
|
+
sortDirection: nextDirection,
|
|
173
|
+
};
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
} else if (filteredOrdersOptions) {
|
|
177
|
+
filteredOrdersOptions((prevOptions) => ({
|
|
178
|
+
...prevOptions,
|
|
179
|
+
sortKey: key,
|
|
180
|
+
sortDirection: nextDirection,
|
|
181
|
+
}));
|
|
159
182
|
} else {
|
|
160
183
|
setOptions((prevOptions) => ({
|
|
161
184
|
...prevOptions,
|
|
@@ -166,6 +189,13 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
166
189
|
};
|
|
167
190
|
|
|
168
191
|
const onPerPageChange = (nextPerPage: number) => {
|
|
192
|
+
if (filteredOrdersOptions) {
|
|
193
|
+
filteredOrdersOptions((prevOptions) => ({
|
|
194
|
+
...prevOptions,
|
|
195
|
+
page: nextPerPage,
|
|
196
|
+
}));
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
169
199
|
setOptions((prevOptions) => ({
|
|
170
200
|
...prevOptions,
|
|
171
201
|
perPage: nextPerPage,
|
|
@@ -173,6 +203,13 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
173
203
|
};
|
|
174
204
|
|
|
175
205
|
const onPageChange = (nextPage: number) => {
|
|
206
|
+
if (filteredOrdersOptions) {
|
|
207
|
+
filteredOrdersOptions((prevOptions) => ({
|
|
208
|
+
...prevOptions,
|
|
209
|
+
page: nextPage,
|
|
210
|
+
}));
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
176
213
|
setOptions((prevOptions) => ({
|
|
177
214
|
...prevOptions,
|
|
178
215
|
page: nextPage,
|
|
@@ -180,6 +217,24 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
180
217
|
};
|
|
181
218
|
|
|
182
219
|
const onFilterChange = (nextFilter: string) => {
|
|
220
|
+
if (filteredOrdersOptions) {
|
|
221
|
+
filteredOrdersOptions(({ page: prevPage, ...prevOptions }) => {
|
|
222
|
+
let nextPage = prevPage;
|
|
223
|
+
|
|
224
|
+
if (
|
|
225
|
+
(!nextFilter && prevOptions.filter) ||
|
|
226
|
+
(nextFilter && !prevOptions.filter)
|
|
227
|
+
) {
|
|
228
|
+
nextPage = 1;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return {
|
|
232
|
+
...prevOptions,
|
|
233
|
+
page: nextPage,
|
|
234
|
+
filter: nextFilter,
|
|
235
|
+
};
|
|
236
|
+
});
|
|
237
|
+
}
|
|
183
238
|
setOptions(({ page: prevPage, ...prevOptions }) => {
|
|
184
239
|
let nextPage = prevPage;
|
|
185
240
|
|