@licklist/design 0.49.0-dev.2 → 0.49.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.
- package/dist/calendar/Calendar.d.ts +0 -1
- package/dist/calendar/Calendar.d.ts.map +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/date-time-button/DateTimeButton.d.ts +2 -3
- 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/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.js +1 -1
- package/dist/iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.d.ts +1 -2
- 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/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 +2 -1
- 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 +1 -2
- 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 +1 -3
- 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 +0 -6
- package/dist/styles/sales/BookingFilter.scss +1 -21
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/styles/sales/BookingTabs.scss +5 -63
- package/dist/styles/sales/LifeTimeSales.scss +0 -1
- package/dist/styles/sales/ManualBooking.scss +2 -56
- package/dist/styles/sales/SourceOfSales.scss +0 -3
- package/dist/styles/static/Switch.scss +0 -1
- package/dist/styles/static/Tabs.scss +0 -6
- package/dist/table/TableHelperComponent.d.ts +1 -2
- 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 +0 -1
- package/src/calendar/components/CalendarDates/CalendarDates.tsx +0 -2
- package/src/date-time-button/DateTimeButton.tsx +3 -16
- package/src/iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.tsx +3 -16
- package/src/product-set/product/ProductControl.tsx +4 -1
- package/src/product-set/product/duration/ProductDurationControl.tsx +9 -10
- package/src/sales/manual-booking/summary/ManualBookingSummary.tsx +1 -9
- package/src/static/date-range-input/DateRangeInput.tsx +2 -23
- package/src/static/switch/BooleanSwitch.tsx +2 -6
- package/src/styles/resources-blocking/_index.scss +0 -6
- package/src/styles/sales/BookingFilter.scss +1 -21
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/styles/sales/BookingTabs.scss +5 -63
- package/src/styles/sales/LifeTimeSales.scss +0 -1
- package/src/styles/sales/ManualBooking.scss +2 -56
- package/src/styles/sales/SourceOfSales.scss +0 -3
- package/src/styles/static/Switch.scss +0 -1
- package/src/styles/static/Tabs.scss +0 -6
- package/src/table/TableHelperComponent.tsx +18 -73
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { 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,7 +30,6 @@ export interface TableHelperComponentProps {
|
|
|
30
30
|
displayShowingSection?: boolean;
|
|
31
31
|
externalFilters?: { [key: string]: any };
|
|
32
32
|
initialOptions?: Partial<ITableProps>;
|
|
33
|
-
filteredOrdersOptions?: (value: SetStateAction<ITableProps>) => void;
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
// @TODO Refactor? component to get less complexity
|
|
@@ -63,7 +62,6 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
63
62
|
displayShowingSection = true,
|
|
64
63
|
externalFilters = {},
|
|
65
64
|
initialOptions = {},
|
|
66
|
-
filteredOrdersOptions,
|
|
67
65
|
} = props;
|
|
68
66
|
|
|
69
67
|
const query = useQuery();
|
|
@@ -99,9 +97,8 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
99
97
|
useEffect(
|
|
100
98
|
() => {
|
|
101
99
|
if (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
!!filteredOrdersOptions
|
|
100
|
+
isEqual(optionsCache, options) &&
|
|
101
|
+
isEqual(cachedExtFilters, externalFilters)
|
|
105
102
|
)
|
|
106
103
|
return;
|
|
107
104
|
|
|
@@ -127,12 +124,12 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
127
124
|
);
|
|
128
125
|
},
|
|
129
126
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
130
|
-
[pathname, options, onRefreshFn,
|
|
127
|
+
[pathname, options, onRefreshFn, externalFilters]
|
|
131
128
|
);
|
|
132
129
|
|
|
133
130
|
// Refresh table's content on manual trigger
|
|
134
131
|
useEffect(() => {
|
|
135
|
-
if (refreshedAt === refreshAt
|
|
132
|
+
if (refreshedAt === refreshAt) {
|
|
136
133
|
return;
|
|
137
134
|
}
|
|
138
135
|
|
|
@@ -141,44 +138,24 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
141
138
|
if (onRefreshFn) {
|
|
142
139
|
onRefreshFn(options);
|
|
143
140
|
}
|
|
144
|
-
}, [onRefreshFn, options, refreshAt,
|
|
141
|
+
}, [onRefreshFn, options, refreshAt, refreshedAt]);
|
|
145
142
|
|
|
146
143
|
const onSort = (key: string) => {
|
|
147
144
|
let nextDirection = TableService.DEFAULT_SORT_DIRECTION;
|
|
148
|
-
if (sortKey === key) {
|
|
149
|
-
if (filteredOrdersOptions) {
|
|
150
|
-
filteredOrdersOptions((prevOptions) => {
|
|
151
|
-
nextDirection = TableService.getSortDirection(
|
|
152
|
-
prevOptions.sortDirection,
|
|
153
|
-
nextDirection
|
|
154
|
-
);
|
|
155
145
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
} else {
|
|
163
|
-
setOptions((prevOptions) => {
|
|
164
|
-
nextDirection = TableService.getSortDirection(
|
|
165
|
-
prevOptions.sortDirection,
|
|
166
|
-
nextDirection
|
|
167
|
-
);
|
|
146
|
+
if (sortKey === key) {
|
|
147
|
+
setOptions((prevOptions) => {
|
|
148
|
+
nextDirection = TableService.getSortDirection(
|
|
149
|
+
prevOptions.sortDirection,
|
|
150
|
+
nextDirection
|
|
151
|
+
);
|
|
168
152
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
} else if (filteredOrdersOptions) {
|
|
177
|
-
filteredOrdersOptions((prevOptions) => ({
|
|
178
|
-
...prevOptions,
|
|
179
|
-
sortKey: key,
|
|
180
|
-
sortDirection: nextDirection,
|
|
181
|
-
}));
|
|
153
|
+
return {
|
|
154
|
+
...prevOptions,
|
|
155
|
+
sortKey: key,
|
|
156
|
+
sortDirection: nextDirection,
|
|
157
|
+
};
|
|
158
|
+
});
|
|
182
159
|
} else {
|
|
183
160
|
setOptions((prevOptions) => ({
|
|
184
161
|
...prevOptions,
|
|
@@ -189,13 +166,6 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
189
166
|
};
|
|
190
167
|
|
|
191
168
|
const onPerPageChange = (nextPerPage: number) => {
|
|
192
|
-
if (filteredOrdersOptions) {
|
|
193
|
-
filteredOrdersOptions((prevOptions) => ({
|
|
194
|
-
...prevOptions,
|
|
195
|
-
page: nextPerPage,
|
|
196
|
-
}));
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
169
|
setOptions((prevOptions) => ({
|
|
200
170
|
...prevOptions,
|
|
201
171
|
perPage: nextPerPage,
|
|
@@ -203,13 +173,6 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
203
173
|
};
|
|
204
174
|
|
|
205
175
|
const onPageChange = (nextPage: number) => {
|
|
206
|
-
if (filteredOrdersOptions) {
|
|
207
|
-
filteredOrdersOptions((prevOptions) => ({
|
|
208
|
-
...prevOptions,
|
|
209
|
-
page: nextPage,
|
|
210
|
-
}));
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
176
|
setOptions((prevOptions) => ({
|
|
214
177
|
...prevOptions,
|
|
215
178
|
page: nextPage,
|
|
@@ -217,24 +180,6 @@ function TableHelperComponent(props: TableHelperComponentProps) {
|
|
|
217
180
|
};
|
|
218
181
|
|
|
219
182
|
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
|
-
}
|
|
238
183
|
setOptions(({ page: prevPage, ...prevOptions }) => {
|
|
239
184
|
let nextPage = prevPage;
|
|
240
185
|
|