oa-componentbook 1.0.1-stage.33 → 1.0.1-stage.35
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/build/components/oa-component-accordion/Accordion.js +5 -16
- package/build/components/oa-component-info/CustomInfo.js +4 -9
- package/build/components/oa-component-info/styles.js +3 -3
- package/build/dev/oa-widget-track-shipment/TrackShipmentWidget.js +195 -0
- package/build/index.js +3 -10
- package/build/widgets/oa-widget-track-shipment/TrackShipmentWidget.js +6 -28
- package/package.json +3 -3
- package/build/layout/paymentAndConsent/CancelScreen.js +0 -46
- package/build/layout/paymentAndConsent/ConsentCard.js +0 -68
- package/build/layout/paymentAndConsent/DetailsCard.js +0 -75
- package/build/layout/paymentAndConsent/DetailsList.js +0 -38
- package/build/layout/paymentAndConsent/Header.js +0 -33
- package/build/layout/paymentAndConsent/InProgressScreen.js +0 -46
- package/build/layout/paymentAndConsent/Loader.js +0 -21
- package/build/layout/paymentAndConsent/Modal.js +0 -28
- package/build/layout/paymentAndConsent/PaymentAndConsent.js +0 -22
- package/build/layout/paymentAndConsent/PaymentCard.js +0 -83
- package/build/layout/paymentAndConsent/Section.js +0 -34
- package/build/layout/paymentAndConsent/SuccessScreen.js +0 -46
- package/build/layout/paymentAndConsent/TimeLineCard.js +0 -28
- package/build/layout/paymentAndConsent/TncList.js +0 -32
- package/build/layout/paymentAndConsent/style.js +0 -12
- package/build/widgets/oa-widget-track-shipment-list/TrackShipmentWidgetList.js +0 -103
- package/build/widgets/oa-widget-track-shipment-list/fn.js +0 -69
- /package/build/{widgets/oa-widget-track-shipment-list → dev/oa-widget-track-shipment}/styles.js +0 -0
|
@@ -45,8 +45,6 @@ CollapseIcon.propTypes = {
|
|
|
45
45
|
* @param {string | number} [key] - Key to be used for the collapsible panel.
|
|
46
46
|
* @param {string | number} [defaultActiveKey] - Key of the collapsible panel that should be active by default.
|
|
47
47
|
* @param {boolean} [hasContentPadding=true] - Whether to apply content padding to the collapsible panel or not.
|
|
48
|
-
* @param {Function} [onChange=() => {}] - Function to be called when the panel is expanded or collapsed.
|
|
49
|
-
* @param {string | number} [activeKey] - Key of the collapsible panel that is currently active.
|
|
50
48
|
*/
|
|
51
49
|
function Accordion(_ref2) {
|
|
52
50
|
let {
|
|
@@ -57,10 +55,7 @@ function Accordion(_ref2) {
|
|
|
57
55
|
smallText,
|
|
58
56
|
key,
|
|
59
57
|
defaultActiveKey,
|
|
60
|
-
hasContentPadding
|
|
61
|
-
// New prop to determine whether to apply contentPadding
|
|
62
|
-
onChange,
|
|
63
|
-
activeKey
|
|
58
|
+
hasContentPadding // New prop to determine whether to apply contentPadding
|
|
64
59
|
} = _ref2;
|
|
65
60
|
const themeConfig = {
|
|
66
61
|
components: {
|
|
@@ -75,12 +70,11 @@ function Accordion(_ref2) {
|
|
|
75
70
|
}, /*#__PURE__*/_react.default.createElement(_styles.CollapseStyle, null, /*#__PURE__*/_react.default.createElement(_antd.Collapse, {
|
|
76
71
|
expandIcon: CollapseIcon,
|
|
77
72
|
expandIconPosition: "end",
|
|
78
|
-
defaultActiveKey: disabled ? '-1' : defaultActiveKey
|
|
79
|
-
onChange: onChange
|
|
73
|
+
defaultActiveKey: disabled ? '-1' : defaultActiveKey
|
|
80
74
|
}, /*#__PURE__*/_react.default.createElement(_antd.Collapse.Panel, {
|
|
81
75
|
"data-test": dataTest ? "".concat(dataTest, "--complete") : undefined,
|
|
82
76
|
collapsible: disabled ? 'disabled' : undefined,
|
|
83
|
-
key:
|
|
77
|
+
key: key,
|
|
84
78
|
header: /*#__PURE__*/_react.default.createElement("div", {
|
|
85
79
|
"data-test": dataTest ? "".concat(dataTest, "--header") : undefined,
|
|
86
80
|
className: "type-button-500"
|
|
@@ -98,9 +92,7 @@ Accordion.propTypes = {
|
|
|
98
92
|
hasContentPadding: _propTypes.default.bool,
|
|
99
93
|
// New prop for controlling contentPadding
|
|
100
94
|
key: _propTypes.default.string,
|
|
101
|
-
defaultActiveKey: _propTypes.default.string
|
|
102
|
-
onChange: _propTypes.default.func,
|
|
103
|
-
activeKey: _propTypes.default.string || _propTypes.default.number
|
|
95
|
+
defaultActiveKey: _propTypes.default.string
|
|
104
96
|
};
|
|
105
97
|
Accordion.defaultProps = {
|
|
106
98
|
body: '',
|
|
@@ -109,9 +101,6 @@ Accordion.defaultProps = {
|
|
|
109
101
|
smallText: '',
|
|
110
102
|
key: '1',
|
|
111
103
|
defaultActiveKey: '1',
|
|
112
|
-
hasContentPadding: true
|
|
113
|
-
// Default value for contentPadding
|
|
114
|
-
onChange: () => {},
|
|
115
|
-
activeKey: null
|
|
104
|
+
hasContentPadding: true // Default value for contentPadding
|
|
116
105
|
};
|
|
117
106
|
var _default = exports.default = Accordion;
|
|
@@ -27,7 +27,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
27
27
|
* @param {string} fontColor - The color of the text.
|
|
28
28
|
* @param {object} iconConfig - Configuration for the icon.
|
|
29
29
|
* @param {string} title - The title to be displayed.
|
|
30
|
-
* @param {string} borderColor - The border color of the component.
|
|
31
30
|
*
|
|
32
31
|
* @returns {ReactElement} A styled component with the specified properties.
|
|
33
32
|
*/
|
|
@@ -38,8 +37,7 @@ function CustomInfo(_ref) {
|
|
|
38
37
|
description,
|
|
39
38
|
fontColor,
|
|
40
39
|
iconConfig,
|
|
41
|
-
title
|
|
42
|
-
borderColor
|
|
40
|
+
title
|
|
43
41
|
} = _ref;
|
|
44
42
|
/**
|
|
45
43
|
* Renders the icon based on the presence of a title.
|
|
@@ -67,8 +65,7 @@ function CustomInfo(_ref) {
|
|
|
67
65
|
}, renderIcon()) : renderIcon();
|
|
68
66
|
};
|
|
69
67
|
return /*#__PURE__*/_react.default.createElement(_styles.InfoContainer, {
|
|
70
|
-
$color: color
|
|
71
|
-
$borderColor: borderColor
|
|
68
|
+
$color: color
|
|
72
69
|
}, /*#__PURE__*/_react.default.createElement(_styles.RowFlex, null, iconConfig.position === 'left' && conditionallyAddTooltipToIcon(), /*#__PURE__*/_react.default.createElement(_styles.ColFlex, null, title && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
73
70
|
color: fontColor,
|
|
74
71
|
typography: "type-t2-700"
|
|
@@ -99,8 +96,7 @@ CustomInfo.propTypes = {
|
|
|
99
96
|
position: _propTypes.default.oneOf(['left', 'right']),
|
|
100
97
|
tooltipText: _propTypes.default.string
|
|
101
98
|
}),
|
|
102
|
-
title: _propTypes.default.string
|
|
103
|
-
borderColor: _propTypes.default.string
|
|
99
|
+
title: _propTypes.default.string
|
|
104
100
|
};
|
|
105
101
|
CustomInfo.defaultProps = {
|
|
106
102
|
buttonConfig: {
|
|
@@ -114,6 +110,5 @@ CustomInfo.defaultProps = {
|
|
|
114
110
|
},
|
|
115
111
|
fontColor: 'primary-content',
|
|
116
112
|
title: '',
|
|
117
|
-
description: ''
|
|
118
|
-
borderColor: ''
|
|
113
|
+
description: ''
|
|
119
114
|
};
|
|
@@ -8,8 +8,8 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _templateObject, _templateObject2, _templateObject3;
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
-
const RowFlex = exports.RowFlex = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n
|
|
12
|
-
const ColFlex = exports.ColFlex = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n
|
|
11
|
+
const RowFlex = exports.RowFlex = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n gap: 8px;\n"])));
|
|
12
|
+
const ColFlex = exports.ColFlex = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"])));
|
|
13
13
|
const InfoContainer = exports.InfoContainer = (0, _styledComponents.default)(RowFlex).attrs({
|
|
14
14
|
as: 'section'
|
|
15
|
-
})(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 12px;\n align-items: center;\n border-radius: 8px;\n background-color: var(--color-", ");\n
|
|
15
|
+
})(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 12px;\n align-items: center;\n border-radius: 8px;\n background-color: var(--color-", ");\n \n button {\n margin-left: 8px;\n };\n"])), props => props.$color);
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.weak-map.js");
|
|
4
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _FileCopyOutlined = _interopRequireDefault(require("@material-ui/icons/FileCopyOutlined"));
|
|
12
|
+
var _AddressWidget = _interopRequireDefault(require("../../widgets/oa-widget-address/AddressWidget"));
|
|
13
|
+
var _CustomTable = _interopRequireDefault(require("../../components/oa-component-table/CustomTable"));
|
|
14
|
+
var _CustomTimeline = _interopRequireDefault(require("../oa-component-timeline/CustomTimeline"));
|
|
15
|
+
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
var _CustomNotification = _interopRequireDefault(require("../../components/oa-component-notification/CustomNotification"));
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
+
function TrackShipmentWidget(_ref) {
|
|
22
|
+
var _tableData, _tableData2;
|
|
23
|
+
let {
|
|
24
|
+
awbNumber,
|
|
25
|
+
fromAddress,
|
|
26
|
+
tableData,
|
|
27
|
+
title,
|
|
28
|
+
toAddress,
|
|
29
|
+
heading
|
|
30
|
+
} = _ref;
|
|
31
|
+
// local variables
|
|
32
|
+
const deilveryStageText = 'SHIPMENT DELIVERED to Customer';
|
|
33
|
+
|
|
34
|
+
// show notification when user click on clipboard
|
|
35
|
+
const notificationRef = (0, _react.useRef)(null);
|
|
36
|
+
const openNotification = parameters => {
|
|
37
|
+
var _notificationRef$curr;
|
|
38
|
+
return notificationRef === null || notificationRef === void 0 || (_notificationRef$curr = notificationRef.current) === null || _notificationRef$curr === void 0 ? void 0 : _notificationRef$curr.openNotification(parameters);
|
|
39
|
+
};
|
|
40
|
+
const handleCopyToClipboard = () => {
|
|
41
|
+
navigator.clipboard.writeText(awbNumber).then(() => {
|
|
42
|
+
openNotification({
|
|
43
|
+
description: 'Copy to clipboard',
|
|
44
|
+
type: 'success'
|
|
45
|
+
});
|
|
46
|
+
}).catch(err => {
|
|
47
|
+
openNotification({
|
|
48
|
+
description: 'Failed to copy text',
|
|
49
|
+
type: 'failure'
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// return circle color depands on stageConsistent key coming from backend
|
|
55
|
+
const getCircleClass = (row, isTimeLineStep) => {
|
|
56
|
+
if (row.stageConsistent) {
|
|
57
|
+
return isTimeLineStep ? 'finish' : 'greenBg';
|
|
58
|
+
}
|
|
59
|
+
if (row.toDate === null && row.oneassistDisplayStatus === deilveryStageText) {
|
|
60
|
+
return isTimeLineStep ? 'process' : 'greenBr';
|
|
61
|
+
}
|
|
62
|
+
return isTimeLineStep ? 'error' : 'redBg';
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// check if current stage is delivery stage or not
|
|
66
|
+
const isOnDeliveryStage = Array.isArray(tableData) && tableData.length > 0 && ((_tableData = tableData[tableData.length - 1]) === null || _tableData === void 0 ? void 0 : _tableData.oneassistDisplayStatus) === deilveryStageText && ((_tableData2 = tableData[tableData.length - 1]) === null || _tableData2 === void 0 ? void 0 : _tableData2.toDate) === null;
|
|
67
|
+
|
|
68
|
+
// remove duplicate consicutive objects only show single unique objects
|
|
69
|
+
const stepsData = tableData.map(item => ({
|
|
70
|
+
title: item.oneassistDisplayStatus,
|
|
71
|
+
status: getCircleClass(item, true)
|
|
72
|
+
})).filter((item, index) => {
|
|
73
|
+
var _tableData3;
|
|
74
|
+
return item.title !== ((_tableData3 = tableData[index - 1]) === null || _tableData3 === void 0 ? void 0 : _tableData3.oneassistDisplayStatus);
|
|
75
|
+
});
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_styles.StyleTrackShipment, {
|
|
77
|
+
className: "trackingDetails"
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomNotification.default, {
|
|
79
|
+
ref: notificationRef
|
|
80
|
+
}), title ? /*#__PURE__*/_react.default.createElement("h1", {
|
|
81
|
+
className: "type-t1-500"
|
|
82
|
+
}, title) : null, /*#__PURE__*/_react.default.createElement("h3", {
|
|
83
|
+
className: "type-t1-500"
|
|
84
|
+
}, heading), /*#__PURE__*/_react.default.createElement("p", {
|
|
85
|
+
className: "type-b2-400 disFlex"
|
|
86
|
+
}, "AWB Number:", awbNumber, awbNumber && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
87
|
+
icon: _FileCopyOutlined.default,
|
|
88
|
+
size: 20,
|
|
89
|
+
onClick: handleCopyToClipboard,
|
|
90
|
+
style: {
|
|
91
|
+
cursor: 'pointer',
|
|
92
|
+
color: '014FC5'
|
|
93
|
+
}
|
|
94
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.AddressesContainer, null, /*#__PURE__*/_react.default.createElement(_AddressWidget.default, {
|
|
95
|
+
address: fromAddress
|
|
96
|
+
}), /*#__PURE__*/_react.default.createElement(_AddressWidget.default, {
|
|
97
|
+
address: toAddress
|
|
98
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
99
|
+
className: "cstScroll"
|
|
100
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomTimeline.default, {
|
|
101
|
+
currentStep: isOnDeliveryStage ? stepsData.length : stepsData.length - 1,
|
|
102
|
+
stepsData: stepsData
|
|
103
|
+
})), /*#__PURE__*/_react.default.createElement(_CustomTable.default, {
|
|
104
|
+
bordered: true,
|
|
105
|
+
rowKey: "key",
|
|
106
|
+
columns: [{
|
|
107
|
+
title: 'Stage',
|
|
108
|
+
dataIndex: 'oneassistDisplayStatus',
|
|
109
|
+
key: 'oneassistDisplayStatus',
|
|
110
|
+
render: (text, row, index) => {
|
|
111
|
+
const obj = {
|
|
112
|
+
children: /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("em", {
|
|
113
|
+
className: "comIcon ".concat(getCircleClass(row))
|
|
114
|
+
}), text),
|
|
115
|
+
props: {}
|
|
116
|
+
};
|
|
117
|
+
if (index === 0 || tableData[index - 1].oneassistDisplayStatus !== text) {
|
|
118
|
+
let rowSpanCount = 1;
|
|
119
|
+
for (let i = index + 1; i < tableData.length; i += 1) {
|
|
120
|
+
if (tableData[i].oneassistDisplayStatus === text) {
|
|
121
|
+
rowSpanCount += 1;
|
|
122
|
+
} else {
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
obj.props.rowSpan = rowSpanCount;
|
|
127
|
+
} else {
|
|
128
|
+
obj.props.rowSpan = 0;
|
|
129
|
+
}
|
|
130
|
+
return obj;
|
|
131
|
+
}
|
|
132
|
+
}, {
|
|
133
|
+
title: 'description from partner',
|
|
134
|
+
dataIndex: 'partnerStatus',
|
|
135
|
+
key: 'partnerStatus'
|
|
136
|
+
}, {
|
|
137
|
+
title: 'Time',
|
|
138
|
+
dataIndex: 'toDate',
|
|
139
|
+
key: 'toDate'
|
|
140
|
+
}],
|
|
141
|
+
dataSource: tableData
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
144
|
+
TrackShipmentWidget.propTypes = {
|
|
145
|
+
awbNumber: _propTypes.default.string.isRequired,
|
|
146
|
+
fromAddress: _propTypes.default.shape({
|
|
147
|
+
heading: _propTypes.default.string,
|
|
148
|
+
addressLine1: _propTypes.default.string,
|
|
149
|
+
addressLine2: _propTypes.default.string,
|
|
150
|
+
addressLine3: _propTypes.default.string,
|
|
151
|
+
landmark: _propTypes.default.string,
|
|
152
|
+
pincode: _propTypes.default.string || _propTypes.default.number,
|
|
153
|
+
city: _propTypes.default.string,
|
|
154
|
+
state: _propTypes.default.string,
|
|
155
|
+
type: _propTypes.default.oneOf(['permanent', 'temporary']),
|
|
156
|
+
additional_info: _propTypes.default.shape({
|
|
157
|
+
lat: _propTypes.default.string,
|
|
158
|
+
long: _propTypes.default.string
|
|
159
|
+
})
|
|
160
|
+
}),
|
|
161
|
+
tableData: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
162
|
+
key: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
163
|
+
oneassistDisplayStatus: _propTypes.default.string,
|
|
164
|
+
partnerStatus: _propTypes.default.string,
|
|
165
|
+
toDate: _propTypes.default.string
|
|
166
|
+
})).isRequired,
|
|
167
|
+
title: _propTypes.default.string,
|
|
168
|
+
heading: _propTypes.default.string,
|
|
169
|
+
toAddress: _propTypes.default.shape({
|
|
170
|
+
heading: _propTypes.default.string,
|
|
171
|
+
addressLine1: _propTypes.default.string,
|
|
172
|
+
addressLine2: _propTypes.default.string,
|
|
173
|
+
addressLine3: _propTypes.default.string,
|
|
174
|
+
landmark: _propTypes.default.string,
|
|
175
|
+
pincode: _propTypes.default.string || _propTypes.default.number,
|
|
176
|
+
city: _propTypes.default.string,
|
|
177
|
+
state: _propTypes.default.string,
|
|
178
|
+
type: _propTypes.default.oneOf(['permanent', 'temporary']),
|
|
179
|
+
additional_info: _propTypes.default.shape({
|
|
180
|
+
lat: _propTypes.default.string,
|
|
181
|
+
long: _propTypes.default.string
|
|
182
|
+
})
|
|
183
|
+
})
|
|
184
|
+
};
|
|
185
|
+
TrackShipmentWidget.defaultProps = {
|
|
186
|
+
fromAddress: {
|
|
187
|
+
heading: ''
|
|
188
|
+
},
|
|
189
|
+
title: '',
|
|
190
|
+
heading: 'Shipment tracking details',
|
|
191
|
+
toAddress: {
|
|
192
|
+
heading: ''
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
var _default = exports.default = TrackShipmentWidget;
|
package/build/index.js
CHANGED
|
@@ -401,12 +401,6 @@ Object.defineProperty(exports, "NotesWidget", {
|
|
|
401
401
|
return _NotesWidget.default;
|
|
402
402
|
}
|
|
403
403
|
});
|
|
404
|
-
Object.defineProperty(exports, "PaymentAndConsent", {
|
|
405
|
-
enumerable: true,
|
|
406
|
-
get: function get() {
|
|
407
|
-
return _PaymentAndConsent.default;
|
|
408
|
-
}
|
|
409
|
-
});
|
|
410
404
|
Object.defineProperty(exports, "PincodeBaseLocation", {
|
|
411
405
|
enumerable: true,
|
|
412
406
|
get: function get() {
|
|
@@ -497,10 +491,10 @@ Object.defineProperty(exports, "TrackShipmentWidget", {
|
|
|
497
491
|
return _TrackShipmentWidget.default;
|
|
498
492
|
}
|
|
499
493
|
});
|
|
500
|
-
Object.defineProperty(exports, "
|
|
494
|
+
Object.defineProperty(exports, "TrackShipmentWidgetDev", {
|
|
501
495
|
enumerable: true,
|
|
502
496
|
get: function get() {
|
|
503
|
-
return
|
|
497
|
+
return _TrackShipmentWidget2.default;
|
|
504
498
|
}
|
|
505
499
|
});
|
|
506
500
|
Object.defineProperty(exports, "Typographies", {
|
|
@@ -622,7 +616,6 @@ var _SparePartsWidget = _interopRequireDefault(require("./widgets/oa-widget-spar
|
|
|
622
616
|
var _SparePartsCollapseWidget = _interopRequireDefault(require("./widgets/oa-widget-spare-part/SparePartsCollapseWidget"));
|
|
623
617
|
var _StageTimelineWidget = _interopRequireWildcard(require("./widgets/oa-widget-stage-timeline/StageTimelineWidget"));
|
|
624
618
|
var _TrackShipmentWidget = _interopRequireDefault(require("./widgets/oa-widget-track-shipment/TrackShipmentWidget"));
|
|
625
|
-
var _TrackShipmentWidgetList = _interopRequireDefault(require("./widgets/oa-widget-track-shipment-list/TrackShipmentWidgetList"));
|
|
626
619
|
var _UploadDownloadWidget = _interopRequireDefault(require("./widgets/oa-widget-upload-download/UploadDownloadWidget"));
|
|
627
620
|
var _ViewHistoryWidget = _interopRequireDefault(require("./widgets/oa-widget-view-history/ViewHistoryWidget"));
|
|
628
621
|
var _ViewPreviousDescriptionWidget = _interopRequireDefault(require("./widgets/oa-widget-view-previous-description/ViewPreviousDescriptionWidget"));
|
|
@@ -643,9 +636,9 @@ var _Preview = _interopRequireDefault(require("./widgets/oa-widget-preview/Previ
|
|
|
643
636
|
var _PincodeBaseLocation = _interopRequireDefault(require("./widgets/oa-widget-pincode-base-location/PincodeBaseLocation"));
|
|
644
637
|
var _MapBaseLocation = _interopRequireDefault(require("./widgets/oa-widget-map-base-location/MapBaseLocation"));
|
|
645
638
|
var _CustomTimeline2 = _interopRequireDefault(require("./dev/oa-component-timeline/CustomTimeline"));
|
|
639
|
+
var _TrackShipmentWidget2 = _interopRequireDefault(require("./dev/oa-widget-track-shipment/TrackShipmentWidget"));
|
|
646
640
|
var _DocUploadCardWidget2 = _interopRequireDefault(require("./dev/oa-widget-document-upload-card/DocUploadCardWidget"));
|
|
647
641
|
var _CustomUpload2 = _interopRequireDefault(require("./dev/oa-component-upload/CustomUpload"));
|
|
648
|
-
var _PaymentAndConsent = _interopRequireDefault(require("./layout/paymentAndConsent/PaymentAndConsent"));
|
|
649
642
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
650
643
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
651
644
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -9,14 +9,12 @@ exports.default = void 0;
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _FileCopyOutlined = _interopRequireDefault(require("@material-ui/icons/FileCopyOutlined"));
|
|
12
|
-
var _InfoOutlined = _interopRequireDefault(require("@material-ui/icons/InfoOutlined"));
|
|
13
12
|
var _AddressWidget = _interopRequireDefault(require("../oa-widget-address/AddressWidget"));
|
|
14
13
|
var _CustomTable = _interopRequireDefault(require("../../components/oa-component-table/CustomTable"));
|
|
15
14
|
var _CustomTimeline = _interopRequireDefault(require("../../components/oa-component-timeline/CustomTimeline"));
|
|
16
15
|
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
17
16
|
var _styles = require("./styles");
|
|
18
17
|
var _CustomNotification = _interopRequireDefault(require("../../components/oa-component-notification/CustomNotification"));
|
|
19
|
-
var _CustomInfo = _interopRequireDefault(require("../../components/oa-component-info/CustomInfo"));
|
|
20
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -43,9 +41,7 @@ function TrackShipmentWidget(_ref) {
|
|
|
43
41
|
tableData,
|
|
44
42
|
title,
|
|
45
43
|
toAddress,
|
|
46
|
-
heading
|
|
47
|
-
partnerName,
|
|
48
|
-
errorReason
|
|
44
|
+
heading
|
|
49
45
|
} = _ref;
|
|
50
46
|
// local variables
|
|
51
47
|
const deilveryStageText = 'SHIPMENT DELIVERED to Customer';
|
|
@@ -85,7 +81,7 @@ function TrackShipmentWidget(_ref) {
|
|
|
85
81
|
const isOnDeliveryStage = Array.isArray(tableData) && tableData.length > 0 && ((_tableData = tableData[tableData.length - 1]) === null || _tableData === void 0 ? void 0 : _tableData.oneassistDisplayStatus) === deilveryStageText && ((_tableData2 = tableData[tableData.length - 1]) === null || _tableData2 === void 0 ? void 0 : _tableData2.toDate) === null;
|
|
86
82
|
|
|
87
83
|
// remove duplicate consicutive objects only show single unique objects
|
|
88
|
-
const stepsData = tableData
|
|
84
|
+
const stepsData = tableData.map(item => ({
|
|
89
85
|
title: item.oneassistDisplayStatus,
|
|
90
86
|
status: getCircleClass(item, true)
|
|
91
87
|
})).filter((item, index) => {
|
|
@@ -100,7 +96,7 @@ function TrackShipmentWidget(_ref) {
|
|
|
100
96
|
className: "type-t1-500"
|
|
101
97
|
}, title) : null, /*#__PURE__*/_react.default.createElement("h3", {
|
|
102
98
|
className: "type-t1-500"
|
|
103
|
-
}, heading),
|
|
99
|
+
}, heading), /*#__PURE__*/_react.default.createElement("p", {
|
|
104
100
|
className: "type-b2-400 disFlex"
|
|
105
101
|
}, "AWB Number:", awbNumber, awbNumber && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
106
102
|
icon: _FileCopyOutlined.default,
|
|
@@ -110,30 +106,16 @@ function TrackShipmentWidget(_ref) {
|
|
|
110
106
|
cursor: 'pointer',
|
|
111
107
|
color: '014FC5'
|
|
112
108
|
}
|
|
113
|
-
})),
|
|
114
|
-
className: "type-b2-400 disFlex"
|
|
115
|
-
}, "Partner:", partnerName), fromAddress && toAddress && /*#__PURE__*/_react.default.createElement(_styles.AddressesContainer, null, /*#__PURE__*/_react.default.createElement(_AddressWidget.default, {
|
|
109
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.AddressesContainer, null, /*#__PURE__*/_react.default.createElement(_AddressWidget.default, {
|
|
116
110
|
address: fromAddress
|
|
117
111
|
}), /*#__PURE__*/_react.default.createElement(_AddressWidget.default, {
|
|
118
112
|
address: toAddress
|
|
119
|
-
})),
|
|
113
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
120
114
|
className: "cstScroll"
|
|
121
115
|
}, /*#__PURE__*/_react.default.createElement(_CustomTimeline.default, {
|
|
122
116
|
currentStep: isOnDeliveryStage ? stepsData.length : stepsData.length - 1,
|
|
123
117
|
stepsData: stepsData
|
|
124
|
-
})),
|
|
125
|
-
className: "margin-top-16 margin-bottom-16"
|
|
126
|
-
}, /*#__PURE__*/_react.default.createElement(_CustomInfo.default, {
|
|
127
|
-
iconConfig: {
|
|
128
|
-
icon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
129
|
-
color: "warning",
|
|
130
|
-
size: 24,
|
|
131
|
-
icon: _InfoOutlined.default
|
|
132
|
-
}),
|
|
133
|
-
position: 'left'
|
|
134
|
-
},
|
|
135
|
-
description: errorReason
|
|
136
|
-
})), (tableData === null || tableData === void 0 ? void 0 : tableData.length) > 0 && /*#__PURE__*/_react.default.createElement(_CustomTable.default, {
|
|
118
|
+
})), /*#__PURE__*/_react.default.createElement(_CustomTable.default, {
|
|
137
119
|
bordered: true,
|
|
138
120
|
rowKey: "key",
|
|
139
121
|
columns: [{
|
|
@@ -176,8 +158,6 @@ function TrackShipmentWidget(_ref) {
|
|
|
176
158
|
}
|
|
177
159
|
TrackShipmentWidget.propTypes = {
|
|
178
160
|
awbNumber: _propTypes.default.string.isRequired,
|
|
179
|
-
errorReason: _propTypes.default.string,
|
|
180
|
-
partnerName: _propTypes.default.string,
|
|
181
161
|
fromAddress: _propTypes.default.shape({
|
|
182
162
|
heading: _propTypes.default.string,
|
|
183
163
|
addressLine1: _propTypes.default.string,
|
|
@@ -218,8 +198,6 @@ TrackShipmentWidget.propTypes = {
|
|
|
218
198
|
})
|
|
219
199
|
};
|
|
220
200
|
TrackShipmentWidget.defaultProps = {
|
|
221
|
-
errorReason: '',
|
|
222
|
-
partnerName: '',
|
|
223
201
|
fromAddress: {
|
|
224
202
|
heading: ''
|
|
225
203
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oa-componentbook",
|
|
3
|
-
"version": "1.0.1-stage.
|
|
3
|
+
"version": "1.0.1-stage.35",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Reusable components",
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"babel-plugin-named-exports-order": "^0.0.2",
|
|
48
48
|
"eslint-config-airbnb": "^19.0.4",
|
|
49
49
|
"eslint-plugin-storybook": "^0.6.15",
|
|
50
|
+
"onchange": "^6.1.0",
|
|
50
51
|
"pre-commit": "^1.2.2",
|
|
51
52
|
"react-scripts": "^5.0.1",
|
|
52
53
|
"storybook": "^7.6.3",
|
|
53
54
|
"webpack": "^5.88.2",
|
|
54
|
-
"webpack-cli": "^5.1.4"
|
|
55
|
-
"onchange": "^6.1.0"
|
|
55
|
+
"webpack-cli": "^5.1.4"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@material-ui/core": "^4.12.4",
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
require("core-js/modules/es.symbol.description.js");
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function CancelScreen(props) {
|
|
12
|
-
const {
|
|
13
|
-
cancelScreen
|
|
14
|
-
} = props !== null && props !== void 0 ? props : {};
|
|
15
|
-
const {
|
|
16
|
-
image,
|
|
17
|
-
title,
|
|
18
|
-
description,
|
|
19
|
-
subDescription
|
|
20
|
-
} = cancelScreen !== null && cancelScreen !== void 0 ? cancelScreen : {};
|
|
21
|
-
const {
|
|
22
|
-
src,
|
|
23
|
-
alt
|
|
24
|
-
} = image !== null && image !== void 0 ? image : {};
|
|
25
|
-
if (!(cancelScreen !== null && cancelScreen !== void 0 && cancelScreen.showCancelScreen)) return null;
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
|
-
className: "icRepairBox"
|
|
28
|
-
}, src && /*#__PURE__*/_react.default.createElement("img", {
|
|
29
|
-
src: src,
|
|
30
|
-
alt: alt
|
|
31
|
-
}), title && /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
-
className: "margin-top-16 margin-bottom-16"
|
|
33
|
-
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
34
|
-
color: "primary-content",
|
|
35
|
-
className: "type-t1-500"
|
|
36
|
-
}, title)), description && /*#__PURE__*/_react.default.createElement("div", {
|
|
37
|
-
className: "margin-bottom-16"
|
|
38
|
-
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
39
|
-
color: "primary-content",
|
|
40
|
-
className: "type-b2-400"
|
|
41
|
-
}, description)), subDescription && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
42
|
-
color: "primary-content",
|
|
43
|
-
className: "type-b2-400"
|
|
44
|
-
}, subDescription));
|
|
45
|
-
}
|
|
46
|
-
var _default = exports.default = CancelScreen;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
|
|
9
|
-
var _CustomCheckBox = _interopRequireDefault(require("../../components/oa-component-checkbox/CustomCheckBox"));
|
|
10
|
-
var _CustomTag = _interopRequireDefault(require("../../components/oa-component-tag/CustomTag"));
|
|
11
|
-
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
12
|
-
var _TncList = _interopRequireDefault(require("./TncList"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function ConsentCard(props) {
|
|
15
|
-
const {
|
|
16
|
-
consentCard
|
|
17
|
-
} = props !== null && props !== void 0 ? props : {};
|
|
18
|
-
const {
|
|
19
|
-
title,
|
|
20
|
-
image = {},
|
|
21
|
-
checkBox = {},
|
|
22
|
-
tag,
|
|
23
|
-
action2
|
|
24
|
-
} = consentCard;
|
|
25
|
-
const {
|
|
26
|
-
src,
|
|
27
|
-
alt
|
|
28
|
-
} = image !== null && image !== void 0 ? image : {};
|
|
29
|
-
const {
|
|
30
|
-
label,
|
|
31
|
-
type
|
|
32
|
-
} = tag !== null && tag !== void 0 ? tag : {};
|
|
33
|
-
if (!(consentCard !== null && consentCard !== void 0 && consentCard.showConsentCard)) return null;
|
|
34
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
35
|
-
className: "cromaCardHeader"
|
|
36
|
-
}, src && /*#__PURE__*/_react.default.createElement("div", {
|
|
37
|
-
className: "iconBox"
|
|
38
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
39
|
-
src: src,
|
|
40
|
-
alt: alt
|
|
41
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
42
|
-
className: "textAreaSecBox"
|
|
43
|
-
}, title && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
44
|
-
color: "primary-content",
|
|
45
|
-
className: "type-t2-700"
|
|
46
|
-
}, title), label && /*#__PURE__*/_react.default.createElement("div", {
|
|
47
|
-
className: "margin-top-8 margin-bottom-8"
|
|
48
|
-
}, /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
|
|
49
|
-
label: label,
|
|
50
|
-
type: type
|
|
51
|
-
})))), /*#__PURE__*/_react.default.createElement("div", {
|
|
52
|
-
className: "grayBoxSec"
|
|
53
|
-
}, /*#__PURE__*/_react.default.createElement(_TncList.default, props), (checkBox === null || checkBox === void 0 ? void 0 : checkBox.label) && /*#__PURE__*/_react.default.createElement("div", {
|
|
54
|
-
className: "checkBoxSec"
|
|
55
|
-
}, /*#__PURE__*/_react.default.createElement(_CustomCheckBox.default, {
|
|
56
|
-
label: /*#__PURE__*/_react.default.createElement("p", null, checkBox === null || checkBox === void 0 ? void 0 : checkBox.label),
|
|
57
|
-
onChange: checkBox === null || checkBox === void 0 ? void 0 : checkBox.onChange,
|
|
58
|
-
size: "large"
|
|
59
|
-
})), action2 && /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
-
className: "margin-top-32 makePayment"
|
|
61
|
-
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
62
|
-
"data-test": "button",
|
|
63
|
-
disabled: action2 === null || action2 === void 0 ? void 0 : action2.isDisabled,
|
|
64
|
-
label: action2 === null || action2 === void 0 ? void 0 : action2.label,
|
|
65
|
-
onClick: action2 === null || action2 === void 0 ? void 0 : action2.onClick
|
|
66
|
-
}))));
|
|
67
|
-
}
|
|
68
|
-
var _default = exports.default = ConsentCard;
|