tf-checkout-react 1.3.40 → 1.3.41-beta.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/components/myTicketsContainer/index.d.ts +4 -1
- package/dist/components/myTicketsContainer/row.d.ts +4 -1
- package/dist/components/myTicketsContainer/tableConfig.d.ts +9 -1
- package/dist/components/orderDetailsContainer/index.d.ts +2 -1
- package/dist/tf-checkout-react.cjs.development.js +79 -15
- package/dist/tf-checkout-react.cjs.development.js.map +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
- package/dist/tf-checkout-react.esm.js +79 -15
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/myTicketsContainer/index.tsx +10 -3
- package/src/components/myTicketsContainer/row.tsx +33 -14
- package/src/components/myTicketsContainer/tableConfig.tsx +52 -6
- package/src/components/orderDetailsContainer/index.tsx +18 -15
- package/src/components/ticketsContainer/TicketsSection.tsx +2 -3
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './style.css';
|
|
3
|
+
import { IColumnData } from './tableConfig';
|
|
3
4
|
interface MyTicketsTypes {
|
|
4
5
|
handleDetailsInfo: (id: string) => void;
|
|
5
6
|
onGetOrdersSuccess: (res: any) => void;
|
|
6
7
|
onGetOrdersError: (err: any) => void;
|
|
7
8
|
logo?: string;
|
|
8
9
|
theme?: 'light' | 'dark';
|
|
10
|
+
hideDetailsButton?: boolean;
|
|
11
|
+
columns?: IColumnData[];
|
|
9
12
|
}
|
|
10
|
-
export declare const MyTicketsContainer: ({ handleDetailsInfo, onGetOrdersSuccess, onGetOrdersError, theme, logo, }: MyTicketsTypes) => JSX.Element;
|
|
13
|
+
export declare const MyTicketsContainer: ({ handleDetailsInfo, onGetOrdersSuccess, onGetOrdersError, theme, logo, hideDetailsButton, columns, }: MyTicketsTypes) => JSX.Element;
|
|
11
14
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { IColumnData } from './tableConfig';
|
|
2
3
|
export interface RowItems {
|
|
3
4
|
id: string;
|
|
4
5
|
date: string;
|
|
@@ -10,6 +11,8 @@ export interface RowItems {
|
|
|
10
11
|
interface RowPropsTypes {
|
|
11
12
|
row: RowItems;
|
|
12
13
|
handleDetailsInfo: (id: string) => void;
|
|
14
|
+
hideDetailsButton: boolean;
|
|
15
|
+
columns?: IColumnData[];
|
|
13
16
|
}
|
|
14
|
-
declare const Row: ({ row, handleDetailsInfo }: RowPropsTypes) => JSX.Element;
|
|
17
|
+
declare const Row: ({ row, handleDetailsInfo, columns, hideDetailsButton, }: RowPropsTypes) => JSX.Element;
|
|
15
18
|
export default Row;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IColumnData {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
component?: React.ElementType;
|
|
6
|
+
normalizer?: (value: any) => any;
|
|
7
|
+
onCellClick: (row: any) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const tableConfig: (columns?: IColumnData[] | undefined, key?: string | undefined) => {
|
|
2
10
|
header: string[];
|
|
3
11
|
body: ((row: any) => any)[];
|
|
4
12
|
};
|
|
@@ -20,6 +20,7 @@ interface OrderDetailsTypes {
|
|
|
20
20
|
label: string | number | null | undefined;
|
|
21
21
|
}>;
|
|
22
22
|
ordersPath?: string;
|
|
23
|
+
orderId?: string | number;
|
|
23
24
|
}
|
|
24
|
-
export declare const OrderDetailsContainer: ({ columns, onGetOrdersSuccess, onGetOrdersError, onRemoveFromResaleSuccess, onRemoveFromResaleError, onResaleTicketSuccess, onResaleTicketError, onReturnButtonClick, personalLinkIcon, displayColumnNameInRow, ticketsTableColumns, ordersPath, }: OrderDetailsTypes) => JSX.Element;
|
|
25
|
+
export declare const OrderDetailsContainer: ({ columns, onGetOrdersSuccess, onGetOrdersError, onRemoveFromResaleSuccess, onRemoveFromResaleError, onResaleTicketSuccess, onResaleTicketError, onReturnButtonClick, personalLinkIcon, displayColumnNameInRow, ticketsTableColumns, ordersPath, orderId: pOrderId, }: OrderDetailsTypes) => JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -5768,7 +5768,9 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
5768
5768
|
sortBySoldOut = _ref.sortBySoldOut,
|
|
5769
5769
|
ticketsHeaderComponent = _ref.ticketsHeaderComponent,
|
|
5770
5770
|
hideTicketsHeader = _ref.hideTicketsHeader;
|
|
5771
|
-
|
|
5771
|
+
|
|
5772
|
+
var currency = _get(event, 'currency.currency', '');
|
|
5773
|
+
|
|
5772
5774
|
var sortedTicketsList = sortBySoldOut ? _sortBy(_sortBy(ticketsList, 'sortOrder'), 'soldOut') : _sortBy(ticketsList, 'sortOrder');
|
|
5773
5775
|
var showGroup = !!sortedTicketsList.find(function (ticket) {
|
|
5774
5776
|
return ticket.groupName;
|
|
@@ -6541,9 +6543,56 @@ var EventInfoItem = function EventInfoItem(_ref) {
|
|
|
6541
6543
|
}), name);
|
|
6542
6544
|
};
|
|
6543
6545
|
|
|
6544
|
-
var tableConfig = function tableConfig(key) {
|
|
6546
|
+
var tableConfig = function tableConfig(columns, key) {
|
|
6545
6547
|
var config;
|
|
6546
6548
|
|
|
6549
|
+
if (columns) {
|
|
6550
|
+
return {
|
|
6551
|
+
header: _map(columns, function (item) {
|
|
6552
|
+
return item.label;
|
|
6553
|
+
}),
|
|
6554
|
+
body: _map(columns, function (item) {
|
|
6555
|
+
if (item.component) {
|
|
6556
|
+
var ItemComponent = item.component;
|
|
6557
|
+
return function (row) {
|
|
6558
|
+
return {
|
|
6559
|
+
columnProps: item,
|
|
6560
|
+
component: React__default.createElement(ItemComponent, Object.assign({}, row))
|
|
6561
|
+
};
|
|
6562
|
+
};
|
|
6563
|
+
}
|
|
6564
|
+
|
|
6565
|
+
if (item.key === 'event') {
|
|
6566
|
+
return function (row) {
|
|
6567
|
+
return {
|
|
6568
|
+
columnProps: item,
|
|
6569
|
+
component: React__default.createElement(EventInfoItem, {
|
|
6570
|
+
image: row.image,
|
|
6571
|
+
name: row.eventName
|
|
6572
|
+
})
|
|
6573
|
+
};
|
|
6574
|
+
};
|
|
6575
|
+
}
|
|
6576
|
+
|
|
6577
|
+
if (item.key === 'total') {
|
|
6578
|
+
return function (row) {
|
|
6579
|
+
return {
|
|
6580
|
+
columnProps: item,
|
|
6581
|
+
component: row.currency + row.amount
|
|
6582
|
+
};
|
|
6583
|
+
};
|
|
6584
|
+
}
|
|
6585
|
+
|
|
6586
|
+
return function (row) {
|
|
6587
|
+
return {
|
|
6588
|
+
columnProps: item,
|
|
6589
|
+
component: item.normalizer ? item.normalizer(row[item.key]) : row[item.key]
|
|
6590
|
+
};
|
|
6591
|
+
};
|
|
6592
|
+
})
|
|
6593
|
+
};
|
|
6594
|
+
}
|
|
6595
|
+
|
|
6547
6596
|
switch (key) {
|
|
6548
6597
|
default:
|
|
6549
6598
|
config = {
|
|
@@ -6568,20 +6617,28 @@ var tableConfig = function tableConfig(key) {
|
|
|
6568
6617
|
|
|
6569
6618
|
var Row = function Row(_ref) {
|
|
6570
6619
|
var row = _ref.row,
|
|
6571
|
-
handleDetailsInfo = _ref.handleDetailsInfo
|
|
6620
|
+
handleDetailsInfo = _ref.handleDetailsInfo,
|
|
6621
|
+
_ref$columns = _ref.columns,
|
|
6622
|
+
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
6623
|
+
hideDetailsButton = _ref.hideDetailsButton;
|
|
6572
6624
|
return React__default.createElement(TableRow, {
|
|
6573
6625
|
sx: {
|
|
6574
6626
|
'& > *': {
|
|
6575
6627
|
borderBottom: 'unset'
|
|
6576
6628
|
}
|
|
6577
6629
|
}
|
|
6578
|
-
}, tableConfig().body.map(function (column, index) {
|
|
6630
|
+
}, tableConfig(columns).body.map(function (column, index) {
|
|
6579
6631
|
return React__default.createElement(TableCell, {
|
|
6580
6632
|
component: "th",
|
|
6581
6633
|
scope: "row",
|
|
6582
|
-
key: index
|
|
6583
|
-
|
|
6584
|
-
|
|
6634
|
+
key: index,
|
|
6635
|
+
onClick: function onClick(e) {
|
|
6636
|
+
if (column(row).columnProps.onCellClick) {
|
|
6637
|
+
column(row).columnProps.onCellClick(column(row).component.props, e);
|
|
6638
|
+
}
|
|
6639
|
+
}
|
|
6640
|
+
}, column(row).component);
|
|
6641
|
+
}), !hideDetailsButton && React__default.createElement(TableCell, {
|
|
6585
6642
|
component: "th",
|
|
6586
6643
|
scope: "row"
|
|
6587
6644
|
}, React__default.createElement("button", {
|
|
@@ -6604,7 +6661,11 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
6604
6661
|
onGetOrdersError = _ref$onGetOrdersError === void 0 ? _identity : _ref$onGetOrdersError,
|
|
6605
6662
|
_ref$theme = _ref.theme,
|
|
6606
6663
|
theme = _ref$theme === void 0 ? 'dark' : _ref$theme,
|
|
6607
|
-
logo = _ref.logo
|
|
6664
|
+
logo = _ref.logo,
|
|
6665
|
+
_ref$hideDetailsButto = _ref.hideDetailsButton,
|
|
6666
|
+
hideDetailsButton = _ref$hideDetailsButto === void 0 ? false : _ref$hideDetailsButto,
|
|
6667
|
+
_ref$columns = _ref.columns,
|
|
6668
|
+
columns = _ref$columns === void 0 ? [] : _ref$columns;
|
|
6608
6669
|
|
|
6609
6670
|
var _useState = React.useState(null),
|
|
6610
6671
|
data = _useState[0],
|
|
@@ -6748,15 +6809,17 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
6748
6809
|
className: "my-ticket-table"
|
|
6749
6810
|
}, React__default.createElement(Table, {
|
|
6750
6811
|
"aria-label": "collapsible table"
|
|
6751
|
-
}, React__default.createElement(TableHead, null, React__default.createElement(TableRow, null, tableConfig().header.map(function (column, index) {
|
|
6812
|
+
}, React__default.createElement(TableHead, null, React__default.createElement(TableRow, null, tableConfig(columns).header.map(function (column, index) {
|
|
6752
6813
|
return React__default.createElement(TableCell, {
|
|
6753
6814
|
key: index
|
|
6754
6815
|
}, column);
|
|
6755
|
-
}), React__default.createElement(TableCell, null))), React__default.createElement(TableBody, null, (_data$orders = data.orders) == null ? void 0 : _data$orders.map(function (row) {
|
|
6816
|
+
}), !hideDetailsButton && React__default.createElement(TableCell, null))), React__default.createElement(TableBody, null, (_data$orders = data.orders) == null ? void 0 : _data$orders.map(function (row) {
|
|
6756
6817
|
return React__default.createElement(Row, {
|
|
6757
6818
|
key: row.id,
|
|
6758
6819
|
row: row,
|
|
6759
|
-
handleDetailsInfo: handleDetailsInfo
|
|
6820
|
+
handleDetailsInfo: handleDetailsInfo,
|
|
6821
|
+
columns: columns,
|
|
6822
|
+
hideDetailsButton: hideDetailsButton
|
|
6760
6823
|
});
|
|
6761
6824
|
})))), React__default.createElement(TablePagination, {
|
|
6762
6825
|
rowsPerPageOptions: [10, 25, 100],
|
|
@@ -7158,7 +7221,8 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
7158
7221
|
_ref$displayColumnNam = _ref.displayColumnNameInRow,
|
|
7159
7222
|
displayColumnNameInRow = _ref$displayColumnNam === void 0 ? false : _ref$displayColumnNam,
|
|
7160
7223
|
ticketsTableColumns = _ref.ticketsTableColumns,
|
|
7161
|
-
ordersPath = _ref.ordersPath
|
|
7224
|
+
ordersPath = _ref.ordersPath,
|
|
7225
|
+
pOrderId = _ref.orderId;
|
|
7162
7226
|
|
|
7163
7227
|
var _useState = React.useState({}),
|
|
7164
7228
|
data = _useState[0],
|
|
@@ -7198,15 +7262,15 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
7198
7262
|
case 0:
|
|
7199
7263
|
_context.prev = 0;
|
|
7200
7264
|
setLoading(true);
|
|
7201
|
-
orderId = '';
|
|
7265
|
+
orderId = pOrderId || '';
|
|
7202
7266
|
|
|
7203
|
-
if (typeof window !== 'undefined') {
|
|
7267
|
+
if (typeof window !== 'undefined' && !pOrderId) {
|
|
7204
7268
|
params = new URL("" + window.location).searchParams;
|
|
7205
7269
|
orderId = params.get('o') || '';
|
|
7206
7270
|
}
|
|
7207
7271
|
|
|
7208
7272
|
_context.next = 6;
|
|
7209
|
-
return getOrderDetails(orderId);
|
|
7273
|
+
return getOrderDetails(String(orderId));
|
|
7210
7274
|
|
|
7211
7275
|
case 6:
|
|
7212
7276
|
response = _context.sent;
|