@licklist/design 0.49.0 → 0.50.0-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-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/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/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +1 -1
- package/dist/product-set/product/duration/ProductDurationControl.d.ts +1 -2
- package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
- package/dist/product-set/product/duration/ProductDurationControl.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/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/static/Switch.scss +1 -0
- package/dist/styles/static/Tabs.scss +6 -0
- 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/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/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/product-set/product/ProductControl.tsx +1 -4
- package/src/product-set/product/duration/ProductDurationControl.tsx +10 -9
- 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/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/static/Switch.scss +1 -0
- package/src/styles/static/Tabs.scss +6 -0
- package/src/table/TableHelperComponent.tsx +73 -18
|
@@ -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
|
|