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
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isActive = exports.headerText = exports.getSingleShipmentHistory = exports.getDateString = exports.getCurrentShipmentLabel = void 0;
|
|
7
|
-
function numberToOrdinal(number) {
|
|
8
|
-
const suffixes = ['th', 'st', 'nd', 'rd'];
|
|
9
|
-
const value = number % 100;
|
|
10
|
-
const suffix = value >= 11 && value <= 13 ? suffixes[0] // 11th, 12th, 13th
|
|
11
|
-
: suffixes[number % 10] || suffixes[0]; // 1st, 2nd, 3rd, others
|
|
12
|
-
return "".concat(number).concat(suffix); // Use template literal correctly
|
|
13
|
-
}
|
|
14
|
-
const getDateFromEpoch = date => {
|
|
15
|
-
if (!date) {
|
|
16
|
-
return '';
|
|
17
|
-
}
|
|
18
|
-
const dateObj = new Date(date);
|
|
19
|
-
const day = dateObj.getDate();
|
|
20
|
-
const month = dateObj.getMonth();
|
|
21
|
-
const year = dateObj.getFullYear();
|
|
22
|
-
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
23
|
-
return "".concat(day, " ").concat(months[month], " ").concat(year);
|
|
24
|
-
};
|
|
25
|
-
const getDateString = (startTime, endTime) => {
|
|
26
|
-
const startDate = getDateFromEpoch(startTime);
|
|
27
|
-
const endDate = getDateFromEpoch(endTime);
|
|
28
|
-
if (startDate === '' && endDate === '') {
|
|
29
|
-
return '';
|
|
30
|
-
}
|
|
31
|
-
if (endDate === '') {
|
|
32
|
-
return startDate;
|
|
33
|
-
}
|
|
34
|
-
return "".concat(startDate, " - ").concat(endDate);
|
|
35
|
-
};
|
|
36
|
-
exports.getDateString = getDateString;
|
|
37
|
-
const getCurrentShipmentLabel = number => {
|
|
38
|
-
const ordinalNumber = numberToOrdinal(number);
|
|
39
|
-
return "".concat(ordinalNumber, " Shipment");
|
|
40
|
-
};
|
|
41
|
-
exports.getCurrentShipmentLabel = getCurrentShipmentLabel;
|
|
42
|
-
const isActive = time => time === null;
|
|
43
|
-
exports.isActive = isActive;
|
|
44
|
-
const headerText = (index, reassignmentTime, modifiedTime, status) => "".concat(getCurrentShipmentLabel(index + 1), " | ").concat(getDateString(reassignmentTime, modifiedTime)).concat(isActive(modifiedTime) ? ' - Present' : '');
|
|
45
|
-
exports.headerText = headerText;
|
|
46
|
-
const getSingleShipmentHistory = item => {
|
|
47
|
-
var _item$history;
|
|
48
|
-
return {
|
|
49
|
-
partnerName: item === null || item === void 0 ? void 0 : item.logisticPartnerName,
|
|
50
|
-
errorReason: item === null || item === void 0 ? void 0 : item.failureReason,
|
|
51
|
-
awbNumber: item === null || item === void 0 ? void 0 : item.logisticPartnerRefNum,
|
|
52
|
-
fromAddress: {
|
|
53
|
-
heading: 'From Address:',
|
|
54
|
-
addressLine1: item === null || item === void 0 ? void 0 : item.origAddressFullName,
|
|
55
|
-
addressLine2: item === null || item === void 0 ? void 0 : item.originAddressLine1,
|
|
56
|
-
pincode: item === null || item === void 0 ? void 0 : item.originPincode,
|
|
57
|
-
city: item === null || item === void 0 ? void 0 : item.originDistrict
|
|
58
|
-
},
|
|
59
|
-
toAddress: {
|
|
60
|
-
heading: 'To Address:',
|
|
61
|
-
addressLine1: item === null || item === void 0 ? void 0 : item.destAddressFullName,
|
|
62
|
-
addressLine2: item === null || item === void 0 ? void 0 : item.destAddressLine1,
|
|
63
|
-
pincode: item === null || item === void 0 ? void 0 : item.destPincode,
|
|
64
|
-
city: item === null || item === void 0 ? void 0 : item.destDistrict
|
|
65
|
-
},
|
|
66
|
-
tableData: (_item$history = item === null || item === void 0 ? void 0 : item.history) !== null && _item$history !== void 0 ? _item$history : []
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
exports.getSingleShipmentHistory = getSingleShipmentHistory;
|
/package/build/{widgets/oa-widget-track-shipment-list → dev/oa-widget-track-shipment}/styles.js
RENAMED
|
File without changes
|