oa-componentbook 1.0.1-stage.43 → 1.0.1-stage.431
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 +131 -40
- package/build/components/oa-component-accordion/styles.js +2 -2
- package/build/components/oa-component-button/CustomButton.js +24 -19
- package/build/components/oa-component-button/styles.js +1 -1
- package/build/components/oa-component-checkbox/CustomCheckBox.js +20 -17
- package/build/components/oa-component-checkbox/styles.js +1 -1
- package/build/components/oa-component-datepicker/CustomDatePicker.js +37 -26
- package/build/components/oa-component-drawer/CustomDrawer.js +2 -0
- package/build/components/oa-component-dropdown/CustomDropdown.js +16 -4
- package/build/components/oa-component-icons/MaterialIcon.js +1 -1
- package/build/components/oa-component-info/CustomInfo.js +9 -4
- package/build/components/oa-component-info/styles.js +3 -3
- package/build/components/oa-component-modal/CustomModal.js +59 -48
- package/build/components/oa-component-modal/styles.js +3 -2
- package/build/components/oa-component-pagination/CustomPagination.js +111 -0
- package/build/components/oa-component-pagination/styles.js +12 -0
- package/build/components/oa-component-select/CustomSelect.js +130 -56
- package/build/components/oa-component-steps/CustomSteps.js +117 -0
- package/build/components/oa-component-steps/styles.js +12 -0
- package/build/components/oa-component-table/CustomTable.js +28 -5
- package/build/components/oa-component-table/CustomTableV1.js +612 -0
- package/build/components/oa-component-table/styles.js +1 -1
- package/build/components/oa-component-table/stylesV1.js +19 -0
- package/build/components/oa-component-tabs/CustomTabs.js +1 -1
- package/build/components/oa-component-tag/CustomTag.js +29 -11
- package/build/components/oa-component-tag/styles.js +30 -3
- package/build/components/oa-component-textarea/CustomTextArea.js +161 -0
- package/build/components/oa-component-textarea/constants.js +39 -0
- package/build/components/oa-component-textarea/styles.js +12 -3
- package/build/components/oa-component-tooltip/CustomTooltip.js +8 -4
- package/build/components/oa-component-upload/CustomUpload.js +129 -42
- package/build/components/oa-component-viewer/CustomViewer.js +17 -11
- package/build/dev/oa-component-document-viewer/CustomDocumentViewer.js +367 -0
- package/build/dev/oa-component-document-viewer/styles.js +12 -0
- package/build/dev/oa-component-upload/CustomUpload.js +135 -47
- package/build/dev/oa-component-upload/styles.js +2 -2
- package/build/dev/oa-widget-document-modal/DocumentSideModal.js +166 -0
- package/build/dev/oa-widget-document-modal/styles.js +12 -0
- package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +196 -0
- package/build/dev/oa-widget-document-side-drawer/styles.js +12 -0
- package/build/global-css/GlobalCss.js +2 -1
- package/build/global-css/GridLayout.js +1 -1
- package/build/global-css/commonStyles.js +11 -0
- package/build/images/Car.png +0 -0
- package/build/images/TwoWheeler.png +0 -0
- package/build/images/astronaut_emptystate.png +0 -0
- package/build/images/exportGrp01.png +0 -0
- package/build/images/exportGrp02.png +0 -0
- package/build/images/exportGrp03.png +0 -0
- package/build/images/outOfStock.png +0 -0
- package/build/index.js +110 -5
- package/build/layout/DetailDataLayout/DetailDataLayout.js +20 -0
- package/build/layout/DetailDataLayout/components/Form.js +22 -0
- package/build/layout/DetailDataLayout/components/Header.js +32 -0
- package/build/layout/DetailDataLayout/style.css +9 -0
- package/build/layout/DetailDataLayout/styles.js +12 -0
- package/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +262 -0
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +68 -0
- package/build/layout/EntityOverviewLayout/styles.js +13 -0
- package/build/layout/GenricLayOut/GenricLayOut.js +2401 -0
- package/build/layout/GenricLayOut/components/AppliedFilters.js +90 -0
- package/build/layout/GenricLayOut/components/CardList.js +34 -0
- package/build/layout/GenricLayOut/components/DropdownSearch.js +48 -0
- package/build/layout/GenricLayOut/components/Header.js +74 -0
- package/build/layout/GenricLayOut/components/Modal.js +96 -0
- package/build/layout/GenricLayOut/components/ProfileSection.js +219 -0
- package/build/layout/GenricLayOut/components/Search.js +51 -0
- package/build/layout/GenricLayOut/components/StaticFilter.css +73 -0
- package/build/layout/GenricLayOut/components/StaticFilter.js +37 -0
- package/build/layout/GenricLayOut/reducer/layoutReducer.js +306 -0
- package/build/layout/GenricLayOut/resolver/staticConfigResolver.js +98 -0
- package/build/layout/GenricLayOut/styles.js +42 -0
- package/build/utils/download-file.js +23 -0
- package/build/widgets/oa-form-widget/FormWidget.js +576 -0
- package/build/widgets/oa-form-widget/FormWidgetStyle.js +18 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +80 -16
- package/build/widgets/oa-widget-add-spare-part/AddSparePartWidget.js +50 -7
- package/build/widgets/oa-widget-address/AddressWidget.js +12 -17
- package/build/widgets/oa-widget-approval/ApprovalWidget.js +19 -11
- package/build/widgets/oa-widget-approval/ApprovalWidgetNew.js +492 -0
- package/build/widgets/oa-widget-approval/styles.js +2 -2
- package/build/widgets/oa-widget-chat/ChatWidget.js +5 -5
- package/build/widgets/oa-widget-close-claim/CloseClaimWidget.js +17 -5
- package/build/widgets/oa-widget-collapsible-key-value/CollapsibleKeyValueWidget.js +396 -0
- package/build/widgets/oa-widget-collapsible-key-value/styles.js +16 -0
- package/build/widgets/oa-widget-content-panel/ContentPanel.js +82 -0
- package/build/widgets/oa-widget-content-panel/styles.js +12 -0
- package/build/widgets/oa-widget-customer-rating-card/CustomerRatingCard.js +5 -5
- package/build/widgets/oa-widget-detailcard/styles.js +1 -1
- package/build/widgets/oa-widget-document-upload/DocUploadWidget.js +6 -9
- package/build/widgets/oa-widget-dropdown-search-input/DropdownSearchInput.js +53 -19
- package/build/widgets/oa-widget-dropdown-search-input/styles.js +1 -1
- package/build/widgets/oa-widget-guide/GuideWidget.js +70 -0
- package/build/widgets/oa-widget-guide/GuideWidgetStyle.js +12 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationDeleteBiker.js +24 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModal.js +34 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModalStyle.js +13 -0
- package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +99 -57
- package/build/widgets/oa-widget-image-carousel/styles.js +16 -5
- package/build/widgets/oa-widget-image-gallery/FullscreenViewer.js +169 -0
- package/build/widgets/oa-widget-image-gallery/ImageGallery.js +87 -0
- package/build/widgets/oa-widget-image-gallery/ThumbnailGrid.js +146 -0
- package/build/widgets/oa-widget-image-gallery/imageCache.js +15 -0
- package/build/widgets/oa-widget-image-gallery/imageGalleryStyle.js +16 -0
- package/build/widgets/oa-widget-item-info-card/InfoCardListWidget.js +60 -0
- package/build/widgets/oa-widget-item-info-card/ItemInfoCardWidget.js +83 -0
- package/build/widgets/oa-widget-item-info-card/styles.css +50 -0
- package/build/widgets/oa-widget-item-info-card/styles.js +14 -0
- package/build/widgets/oa-widget-key-value/KeyValueWidget.js +46 -12
- package/build/widgets/oa-widget-key-value/styles.js +1 -1
- package/build/widgets/oa-widget-kpi/KPICardWidget.js +86 -0
- package/build/widgets/oa-widget-kpi/styles.js +12 -0
- package/build/widgets/oa-widget-map-base-location/AddressDetails.js +21 -7
- package/build/widgets/oa-widget-map-base-location/AddressForm.js +32 -5
- package/build/widgets/oa-widget-map-base-location/MapBaseLocation.js +9 -3
- package/build/widgets/oa-widget-map-base-location/MapComponent.js +17 -2
- package/build/widgets/oa-widget-membershipcard/MembershipCard.js +14 -3
- package/build/widgets/oa-widget-membershipcard/styles.js +1 -1
- package/build/widgets/oa-widget-notes/NotesWidget.js +32 -30
- package/build/widgets/oa-widget-notes/styles.js +4 -3
- package/build/widgets/oa-widget-profile-data/ProfileDataWidget.js +165 -0
- package/build/widgets/oa-widget-profile-data/styles.js +13 -0
- package/build/widgets/oa-widget-progressive-steps/ProgressiveStepsWidget.js +362 -0
- package/build/widgets/oa-widget-progressive-steps/styles.js +12 -0
- package/build/widgets/oa-widget-reimbursement-breakup/ReimbursementBreakupWidget.js +18 -9
- package/build/widgets/oa-widget-reimbursement-breakup/styles.js +1 -1
- package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +164 -0
- package/build/widgets/oa-widget-select-list-item-modal/SelectListItemModal.js +91 -0
- package/build/widgets/oa-widget-sidebar/SidebarWidget.js +175 -0
- package/build/widgets/oa-widget-sidebar/components/Header.js +33 -0
- package/build/widgets/oa-widget-sidebar/styles.js +13 -0
- package/build/widgets/oa-widget-spare-part/SparePartsWidget.js +63 -35
- package/build/widgets/oa-widget-track-shipment/TrackShipmentWidget.js +28 -6
- package/build/widgets/oa-widget-track-shipment-list/TrackShipmentWidgetList.js +103 -0
- package/build/widgets/oa-widget-track-shipment-list/fn.js +81 -0
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +354 -0
- package/build/widgets/oa-widget-user-management/styles.js +15 -0
- package/package.json +3 -1
- package/build/components/oa-component-textarea/TextArea.js +0 -74
- package/build/dev/oa-widget-track-shipment/TrackShipmentWidget.js +0 -195
- /package/build/{dev/oa-widget-track-shipment → widgets/oa-widget-track-shipment-list}/styles.js +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _fn = require("./fn");
|
|
10
|
+
var _TrackShipmentWidget = _interopRequireDefault(require("../oa-widget-track-shipment/TrackShipmentWidget"));
|
|
11
|
+
var _Accordion = _interopRequireDefault(require("../../components/oa-component-accordion/Accordion"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function TrackShipmentWidgetList(_ref) {
|
|
14
|
+
var _assignments$map;
|
|
15
|
+
let {
|
|
16
|
+
shipmentData,
|
|
17
|
+
onChange
|
|
18
|
+
} = _ref;
|
|
19
|
+
const assignments = (shipmentData === null || shipmentData === void 0 ? void 0 : shipmentData.assignments) || [];
|
|
20
|
+
if (assignments.length === 0) {
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_TrackShipmentWidget.default, (0, _fn.getSingleShipmentHistory)(shipmentData));
|
|
22
|
+
}
|
|
23
|
+
if (assignments.length === 1) {
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_TrackShipmentWidget.default, (0, _fn.getSingleShipmentHistory)(assignments[0]));
|
|
25
|
+
}
|
|
26
|
+
const lastReassignmentId = assignments && assignments.length > 0 ? assignments[assignments.length - 1].assignmentId || 0 : 0;
|
|
27
|
+
return assignments === null || assignments === void 0 || (_assignments$map = assignments.map) === null || _assignments$map === void 0 ? void 0 : _assignments$map.call(assignments, (item, index) => {
|
|
28
|
+
const {
|
|
29
|
+
assignmentId,
|
|
30
|
+
assignmentDate,
|
|
31
|
+
assignmentClosedTime,
|
|
32
|
+
status
|
|
33
|
+
} = item !== null && item !== void 0 ? item : {};
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
35
|
+
className: "margin-bottom-16",
|
|
36
|
+
key: assignmentId
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement(_Accordion.default, {
|
|
38
|
+
defaultActiveKey: lastReassignmentId,
|
|
39
|
+
activeKey: assignmentId,
|
|
40
|
+
body: /*#__PURE__*/_react.default.createElement(_TrackShipmentWidget.default, (0, _fn.getSingleShipmentHistory)(item)),
|
|
41
|
+
headerText: (0, _fn.headerText)(index, assignmentDate, assignmentClosedTime, status)
|
|
42
|
+
}));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const HistoryPropType = _propTypes.default.shape({
|
|
46
|
+
shipmentStatus: _propTypes.default.string.isRequired,
|
|
47
|
+
fromDate: _propTypes.default.string.isRequired,
|
|
48
|
+
toDate: _propTypes.default.string.isRequired,
|
|
49
|
+
partnerStatus: _propTypes.default.string,
|
|
50
|
+
customerDisplayStatus: _propTypes.default.string.isRequired,
|
|
51
|
+
oneassistDisplayStatus: _propTypes.default.string.isRequired,
|
|
52
|
+
stageConsistent: _propTypes.default.bool.isRequired
|
|
53
|
+
});
|
|
54
|
+
const AssignmentPropType = _propTypes.default.shape({
|
|
55
|
+
assignmentDate: _propTypes.default.number.isRequired,
|
|
56
|
+
assignmentClosedTime: _propTypes.default.number.isRequired,
|
|
57
|
+
logisticPartnerName: _propTypes.default.string.isRequired,
|
|
58
|
+
assignmentId: _propTypes.default.number.isRequired,
|
|
59
|
+
logisticPartnerRefNum: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
60
|
+
originAddressLine1: _propTypes.default.string.isRequired,
|
|
61
|
+
originDistrict: _propTypes.default.string.isRequired,
|
|
62
|
+
originPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
63
|
+
destAddressLine1: _propTypes.default.string.isRequired,
|
|
64
|
+
destDistrict: _propTypes.default.string,
|
|
65
|
+
destPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
66
|
+
history: _propTypes.default.arrayOf(HistoryPropType).isRequired,
|
|
67
|
+
origAddressFullName: _propTypes.default.string.isRequired,
|
|
68
|
+
destAddressFullName: _propTypes.default.string.isRequired,
|
|
69
|
+
assignments: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
70
|
+
logisticPartnerRefNum: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
71
|
+
originAddressLine1: _propTypes.default.string.isRequired,
|
|
72
|
+
originDistrict: _propTypes.default.string.isRequired,
|
|
73
|
+
originPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
74
|
+
destAddressLine1: _propTypes.default.string.isRequired,
|
|
75
|
+
destDistrict: _propTypes.default.string,
|
|
76
|
+
destPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
77
|
+
history: _propTypes.default.arrayOf(HistoryPropType).isRequired,
|
|
78
|
+
origAddressFullName: _propTypes.default.string.isRequired,
|
|
79
|
+
destAddressFullName: _propTypes.default.string.isRequired,
|
|
80
|
+
assignments: _propTypes.default.array // Placeholder to break recursion
|
|
81
|
+
}))
|
|
82
|
+
});
|
|
83
|
+
TrackShipmentWidgetList.propTypes = {
|
|
84
|
+
shipmentData: _propTypes.default.shape({
|
|
85
|
+
logisticPartnerRefNum: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
86
|
+
originAddressLine1: _propTypes.default.string.isRequired,
|
|
87
|
+
originDistrict: _propTypes.default.string.isRequired,
|
|
88
|
+
originPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
89
|
+
destAddressLine1: _propTypes.default.string.isRequired,
|
|
90
|
+
destDistrict: _propTypes.default.string,
|
|
91
|
+
destPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
92
|
+
history: _propTypes.default.arrayOf(HistoryPropType).isRequired,
|
|
93
|
+
origAddressFullName: _propTypes.default.string.isRequired,
|
|
94
|
+
destAddressFullName: _propTypes.default.string.isRequired,
|
|
95
|
+
assignments: _propTypes.default.arrayOf(AssignmentPropType)
|
|
96
|
+
}),
|
|
97
|
+
onChange: _propTypes.default.func
|
|
98
|
+
};
|
|
99
|
+
TrackShipmentWidgetList.defaultProps = {
|
|
100
|
+
shipmentData: {},
|
|
101
|
+
onChange: () => {}
|
|
102
|
+
};
|
|
103
|
+
var _default = exports.default = TrackShipmentWidgetList;
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
function numberToOrdinal(number) {
|
|
10
|
+
const suffixes = ['th', 'st', 'nd', 'rd'];
|
|
11
|
+
const value = number % 100;
|
|
12
|
+
const suffix = value >= 11 && value <= 13 ? suffixes[0] // 11th, 12th, 13th
|
|
13
|
+
: suffixes[number % 10] || suffixes[0]; // 1st, 2nd, 3rd, others
|
|
14
|
+
return "".concat(number).concat(suffix); // Use template literal correctly
|
|
15
|
+
}
|
|
16
|
+
const getDateFromEpoch = date => {
|
|
17
|
+
if (!date) {
|
|
18
|
+
return '';
|
|
19
|
+
}
|
|
20
|
+
const dateObj = new Date(date);
|
|
21
|
+
const day = dateObj.getDate();
|
|
22
|
+
const month = dateObj.getMonth();
|
|
23
|
+
const year = dateObj.getFullYear();
|
|
24
|
+
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
25
|
+
return "".concat(day, " ").concat(months[month], " ").concat(year);
|
|
26
|
+
};
|
|
27
|
+
const getDateString = (startTime, endTime) => {
|
|
28
|
+
const startDate = getDateFromEpoch(startTime);
|
|
29
|
+
const endDate = getDateFromEpoch(endTime);
|
|
30
|
+
if (startDate === '' && endDate === '') {
|
|
31
|
+
return '';
|
|
32
|
+
}
|
|
33
|
+
if (endDate === '') {
|
|
34
|
+
return startDate;
|
|
35
|
+
}
|
|
36
|
+
return "".concat(startDate, " - ").concat(endDate);
|
|
37
|
+
};
|
|
38
|
+
exports.getDateString = getDateString;
|
|
39
|
+
const getCurrentShipmentLabel = number => {
|
|
40
|
+
const ordinalNumber = numberToOrdinal(number);
|
|
41
|
+
return "".concat(ordinalNumber, " Shipment");
|
|
42
|
+
};
|
|
43
|
+
exports.getCurrentShipmentLabel = getCurrentShipmentLabel;
|
|
44
|
+
const showNewLineChar = addressDetail => {
|
|
45
|
+
var _splitedAddress$map;
|
|
46
|
+
const splitedAddress = addressDetail === null || addressDetail === void 0 ? void 0 : addressDetail.split('\n');
|
|
47
|
+
if ((splitedAddress === null || splitedAddress === void 0 ? void 0 : splitedAddress.length) === 1) return addressDetail;
|
|
48
|
+
return (_splitedAddress$map = splitedAddress.map((title, index) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, title, index === 0 && /*#__PURE__*/_react.default.createElement("br", null)))) !== null && _splitedAddress$map !== void 0 ? _splitedAddress$map : '';
|
|
49
|
+
};
|
|
50
|
+
const isActive = time => time === null;
|
|
51
|
+
exports.isActive = isActive;
|
|
52
|
+
const headerText = (index, reassignmentTime, modifiedTime, status) => "".concat(getCurrentShipmentLabel(index + 1), " | ").concat(getDateString(reassignmentTime, modifiedTime)).concat(isActive(modifiedTime) ? ' - Present' : '');
|
|
53
|
+
exports.headerText = headerText;
|
|
54
|
+
const getSingleShipmentHistory = item => {
|
|
55
|
+
var _item$history;
|
|
56
|
+
return {
|
|
57
|
+
partnerName: item === null || item === void 0 ? void 0 : item.logisticPartnerName,
|
|
58
|
+
errorReason: item === null || item === void 0 ? void 0 : item.failureReason,
|
|
59
|
+
awbNumber: item === null || item === void 0 ? void 0 : item.logisticPartnerRefNum,
|
|
60
|
+
fromAddress: {
|
|
61
|
+
heading: 'From Address:',
|
|
62
|
+
addressLine1: item === null || item === void 0 ? void 0 : item.origAddressFullName,
|
|
63
|
+
addressLine2: showNewLineChar(item === null || item === void 0 ? void 0 : item.originAddressLine1),
|
|
64
|
+
pincode: item === null || item === void 0 ? void 0 : item.originPincode,
|
|
65
|
+
city: item === null || item === void 0 ? void 0 : item.originDistrict,
|
|
66
|
+
landmark: item === null || item === void 0 ? void 0 : item.originLandmark,
|
|
67
|
+
state: item === null || item === void 0 ? void 0 : item.originState
|
|
68
|
+
},
|
|
69
|
+
toAddress: {
|
|
70
|
+
heading: 'To Address:',
|
|
71
|
+
addressLine1: item === null || item === void 0 ? void 0 : item.destAddressFullName,
|
|
72
|
+
addressLine2: showNewLineChar(item === null || item === void 0 ? void 0 : item.destAddressLine1),
|
|
73
|
+
pincode: item === null || item === void 0 ? void 0 : item.destPincode,
|
|
74
|
+
city: item === null || item === void 0 ? void 0 : item.destDistrict,
|
|
75
|
+
landmark: item === null || item === void 0 ? void 0 : item.destLandmark,
|
|
76
|
+
state: item === null || item === void 0 ? void 0 : item.destState
|
|
77
|
+
},
|
|
78
|
+
tableData: (_item$history = item === null || item === void 0 ? void 0 : item.history) !== null && _item$history !== void 0 ? _item$history : []
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
exports.getSingleShipmentHistory = getSingleShipmentHistory;
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.symbol.description.js");
|
|
4
|
+
require("core-js/modules/es.weak-map.js");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = UserManagementWidget;
|
|
9
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
|
+
require("core-js/modules/es.promise.js");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _antd = require("antd");
|
|
13
|
+
var _EditOutlined = _interopRequireDefault(require("@material-ui/icons/EditOutlined"));
|
|
14
|
+
var _DeleteOutlineOutlined = _interopRequireDefault(require("@material-ui/icons/DeleteOutlineOutlined"));
|
|
15
|
+
var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
|
|
16
|
+
var _CustomInput = _interopRequireDefault(require("../../components/oa-component-input/CustomInput"));
|
|
17
|
+
var _CustomSelect = _interopRequireDefault(require("../../components/oa-component-select/CustomSelect"));
|
|
18
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
19
|
+
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
20
|
+
var _CustomModal = _interopRequireDefault(require("../../components/oa-component-modal/CustomModal"));
|
|
21
|
+
var _CustomNotification = _interopRequireDefault(require("../../components/oa-component-notification/CustomNotification"));
|
|
22
|
+
var _styles = require("./styles");
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
+
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); }
|
|
25
|
+
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; }
|
|
26
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
30
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* eslint-disable */
|
|
31
|
+
function UserManagementWidget(_ref) {
|
|
32
|
+
let {
|
|
33
|
+
form,
|
|
34
|
+
fieldName = "users",
|
|
35
|
+
initialData = [],
|
|
36
|
+
fields,
|
|
37
|
+
disabled = false,
|
|
38
|
+
customPageModal,
|
|
39
|
+
addUserClick,
|
|
40
|
+
deleteUserClick,
|
|
41
|
+
editUserClick,
|
|
42
|
+
misc
|
|
43
|
+
} = _ref;
|
|
44
|
+
const finalFields = fields || [];
|
|
45
|
+
const [editingUserId, setEditingUserId] = (0, _react.useState)(null);
|
|
46
|
+
const [addingUser, setAddingUser] = (0, _react.useState)(false);
|
|
47
|
+
const [deleteModalVisible, setDeleteModalVisible] = (0, _react.useState)(false);
|
|
48
|
+
const [userToDelete, setUserToDelete] = (0, _react.useState)(null);
|
|
49
|
+
const notificationRef = (0, _react.useRef)(null);
|
|
50
|
+
|
|
51
|
+
// Use local state for users, initialized from initialData only
|
|
52
|
+
const [users, setUsers] = (0, _react.useState)(() => {
|
|
53
|
+
return Array.isArray(initialData) ? initialData : [];
|
|
54
|
+
});
|
|
55
|
+
const openNotification = (0, _react.useCallback)(params => notificationRef.current.openNotification(params), []);
|
|
56
|
+
const showErrorNotification = message => {
|
|
57
|
+
openNotification({
|
|
58
|
+
description: message,
|
|
59
|
+
type: "failure",
|
|
60
|
+
mode: "dark",
|
|
61
|
+
showIcon: true,
|
|
62
|
+
placement: "bottomRight"
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
const showSuccessNotification = message => {
|
|
66
|
+
openNotification({
|
|
67
|
+
description: message,
|
|
68
|
+
type: "success",
|
|
69
|
+
mode: "dark",
|
|
70
|
+
showIcon: true,
|
|
71
|
+
placement: "bottomRight"
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// Update both local state and form state
|
|
76
|
+
const updateUsers = newUsers => {
|
|
77
|
+
setUsers(newUsers);
|
|
78
|
+
form.setFieldsValue({
|
|
79
|
+
[fieldName]: newUsers
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// Sync users state with form and initialData
|
|
84
|
+
(0, _react.useEffect)(() => {
|
|
85
|
+
const defaultUsers = Array.isArray(initialData) ? initialData : [];
|
|
86
|
+
setUsers(defaultUsers);
|
|
87
|
+
form.setFieldsValue({
|
|
88
|
+
[fieldName]: defaultUsers
|
|
89
|
+
});
|
|
90
|
+
}, [initialData, fieldName, form]);
|
|
91
|
+
const handleEdit = user => {
|
|
92
|
+
setEditingUserId(user.id);
|
|
93
|
+
setAddingUser(false);
|
|
94
|
+
|
|
95
|
+
// Set form values for editing
|
|
96
|
+
const editData = {};
|
|
97
|
+
finalFields.forEach(field => {
|
|
98
|
+
editData["".concat(fieldName, "_").concat(field.key)] = user[field.key] || "";
|
|
99
|
+
});
|
|
100
|
+
form.setFieldsValue(editData);
|
|
101
|
+
};
|
|
102
|
+
const handleAdd = () => {
|
|
103
|
+
setAddingUser(true);
|
|
104
|
+
setEditingUserId(null);
|
|
105
|
+
|
|
106
|
+
// Clear form values for adding
|
|
107
|
+
const clearData = {};
|
|
108
|
+
finalFields.forEach(field => {
|
|
109
|
+
clearData["".concat(fieldName, "_").concat(field.key)] = "";
|
|
110
|
+
});
|
|
111
|
+
form.setFieldsValue(clearData);
|
|
112
|
+
};
|
|
113
|
+
const handleSave = async () => {
|
|
114
|
+
// Validate only the user management fields
|
|
115
|
+
const fieldNames = finalFields.map(field => "".concat(fieldName, "_").concat(field.key));
|
|
116
|
+
try {
|
|
117
|
+
const values = await form.validateFields(fieldNames);
|
|
118
|
+
|
|
119
|
+
// Extract user data from form values
|
|
120
|
+
const userData = {};
|
|
121
|
+
finalFields.forEach(field => {
|
|
122
|
+
userData[field.key] = values["".concat(fieldName, "_").concat(field.key)];
|
|
123
|
+
});
|
|
124
|
+
if (editingUserId) {
|
|
125
|
+
// Update existing user
|
|
126
|
+
if (editUserClick) {
|
|
127
|
+
const {
|
|
128
|
+
error,
|
|
129
|
+
data
|
|
130
|
+
} = await editUserClick(editingUserId, userData);
|
|
131
|
+
if (error) {
|
|
132
|
+
showErrorNotification(error);
|
|
133
|
+
} else {
|
|
134
|
+
const updatedUsers = users.map(user => user.id === editingUserId ? _objectSpread(_objectSpread({}, user), userData) : user);
|
|
135
|
+
updateUsers(updatedUsers);
|
|
136
|
+
setEditingUserId(null);
|
|
137
|
+
showSuccessNotification(data === null || data === void 0 ? void 0 : data.message);
|
|
138
|
+
// Clear the form fields only if operation was successful
|
|
139
|
+
const clearData = {};
|
|
140
|
+
finalFields.forEach(field => {
|
|
141
|
+
clearData["".concat(fieldName, "_").concat(field.key)] = "";
|
|
142
|
+
});
|
|
143
|
+
form.setFieldsValue(clearData);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
} else if (addingUser) {
|
|
147
|
+
// Add new user
|
|
148
|
+
if (addUserClick) {
|
|
149
|
+
const {
|
|
150
|
+
error,
|
|
151
|
+
data
|
|
152
|
+
} = await addUserClick(userData, misc);
|
|
153
|
+
if (error) {
|
|
154
|
+
showErrorNotification(error);
|
|
155
|
+
} else {
|
|
156
|
+
var _data$data;
|
|
157
|
+
const newUser = _objectSpread({
|
|
158
|
+
id: data === null || data === void 0 || (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.userId
|
|
159
|
+
}, userData);
|
|
160
|
+
const updatedUsers = [...users, newUser];
|
|
161
|
+
updateUsers(updatedUsers);
|
|
162
|
+
setAddingUser(false);
|
|
163
|
+
showSuccessNotification(data === null || data === void 0 ? void 0 : data.message);
|
|
164
|
+
// Clear the form fields only if operation was successful
|
|
165
|
+
const clearData = {};
|
|
166
|
+
finalFields.forEach(field => {
|
|
167
|
+
clearData["".concat(fieldName, "_").concat(field.key)] = "";
|
|
168
|
+
});
|
|
169
|
+
form.setFieldsValue(clearData);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
} catch (errorInfo) {
|
|
174
|
+
console.log("Form validation failed:", errorInfo);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const handleCancel = () => {
|
|
178
|
+
setEditingUserId(null);
|
|
179
|
+
setAddingUser(false);
|
|
180
|
+
|
|
181
|
+
// Clear only the user management form fields
|
|
182
|
+
const clearData = {};
|
|
183
|
+
finalFields.forEach(field => {
|
|
184
|
+
clearData["".concat(fieldName, "_").concat(field.key)] = "";
|
|
185
|
+
});
|
|
186
|
+
form.setFieldsValue(clearData);
|
|
187
|
+
};
|
|
188
|
+
const handleDelete = userId => {
|
|
189
|
+
setUserToDelete(userId);
|
|
190
|
+
setDeleteModalVisible(true);
|
|
191
|
+
};
|
|
192
|
+
const confirmDelete = async () => {
|
|
193
|
+
if (userToDelete) {
|
|
194
|
+
if (deleteUserClick) {
|
|
195
|
+
const {
|
|
196
|
+
error,
|
|
197
|
+
data
|
|
198
|
+
} = await deleteUserClick(userToDelete);
|
|
199
|
+
if (error) {
|
|
200
|
+
showErrorNotification(error);
|
|
201
|
+
setDeleteModalVisible(false);
|
|
202
|
+
} else {
|
|
203
|
+
const updatedUsers = users.filter(user => user.id !== userToDelete);
|
|
204
|
+
updateUsers(updatedUsers);
|
|
205
|
+
setDeleteModalVisible(false);
|
|
206
|
+
showSuccessNotification(data === null || data === void 0 ? void 0 : data.message);
|
|
207
|
+
setUserToDelete(null);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const cancelDelete = () => {
|
|
213
|
+
setDeleteModalVisible(false);
|
|
214
|
+
setUserToDelete(null);
|
|
215
|
+
};
|
|
216
|
+
const canDelete = users.length > 1;
|
|
217
|
+
const isEditing = editingUserId !== null || addingUser;
|
|
218
|
+
const renderFormField = field => {
|
|
219
|
+
var _field$options;
|
|
220
|
+
const fieldNameWithPrefix = "".concat(fieldName, "_").concat(field.key);
|
|
221
|
+
switch (field.widget || field.type) {
|
|
222
|
+
case "input":
|
|
223
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
224
|
+
name: fieldNameWithPrefix,
|
|
225
|
+
label: field.label,
|
|
226
|
+
rules: field.rules,
|
|
227
|
+
style: {
|
|
228
|
+
marginBottom: 16
|
|
229
|
+
}
|
|
230
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomInput.default, {
|
|
231
|
+
placeholder: field.placeholder || "Enter ".concat(field.label.toLowerCase())
|
|
232
|
+
}));
|
|
233
|
+
case "select":
|
|
234
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
235
|
+
name: fieldNameWithPrefix,
|
|
236
|
+
label: field.label,
|
|
237
|
+
rules: field.rules,
|
|
238
|
+
style: {
|
|
239
|
+
marginBottom: 16
|
|
240
|
+
}
|
|
241
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomSelect.default, {
|
|
242
|
+
placeholder: field.placeholder || "Select ".concat(field.label.toLowerCase()),
|
|
243
|
+
options: ((_field$options = field.options) === null || _field$options === void 0 ? void 0 : _field$options.map(option => ({
|
|
244
|
+
value: option.value,
|
|
245
|
+
label: option.label
|
|
246
|
+
}))) || []
|
|
247
|
+
}));
|
|
248
|
+
default:
|
|
249
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
250
|
+
name: fieldNameWithPrefix,
|
|
251
|
+
label: field.label,
|
|
252
|
+
rules: field.rules,
|
|
253
|
+
style: {
|
|
254
|
+
marginBottom: 16
|
|
255
|
+
}
|
|
256
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomInput.default, {
|
|
257
|
+
placeholder: field.placeholder || "Enter ".concat(field.label.toLowerCase())
|
|
258
|
+
}));
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
return /*#__PURE__*/_react.default.createElement("div", null, users && users.length > 0 && users.map(user => /*#__PURE__*/_react.default.createElement(_styles.UserItem, {
|
|
262
|
+
key: user.id
|
|
263
|
+
}, editingUserId === user.id ? /*#__PURE__*/_react.default.createElement(_styles.EditFormCard, null, /*#__PURE__*/_react.default.createElement(_styles.EditForm, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
264
|
+
className: "form-row"
|
|
265
|
+
}, finalFields.map((field, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
266
|
+
key: field.key,
|
|
267
|
+
className: "form-field"
|
|
268
|
+
}, renderFormField(field)))), /*#__PURE__*/_react.default.createElement("div", {
|
|
269
|
+
className: "form-actions"
|
|
270
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
271
|
+
type: "danger-secondary",
|
|
272
|
+
onClick: handleCancel,
|
|
273
|
+
label: "Cancel"
|
|
274
|
+
}), /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
275
|
+
type: "secondary",
|
|
276
|
+
onClick: handleSave,
|
|
277
|
+
label: "Save"
|
|
278
|
+
})))) : /*#__PURE__*/_react.default.createElement(_styles.UserInfo, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
279
|
+
className: "user-details"
|
|
280
|
+
}, finalFields.map((field, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
281
|
+
key: field.key
|
|
282
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
283
|
+
typography: index === 0 ? "type-t2-700" : "type-b1-400",
|
|
284
|
+
color: index === 0 ? "primary-content" : "secondary-content"
|
|
285
|
+
}, user[field.key])))), /*#__PURE__*/_react.default.createElement("div", {
|
|
286
|
+
className: "user-actions"
|
|
287
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
288
|
+
type: "text-only",
|
|
289
|
+
onClick: () => handleEdit(user),
|
|
290
|
+
disabled: disabled || isEditing,
|
|
291
|
+
iconConfig: {
|
|
292
|
+
icon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
293
|
+
icon: _EditOutlined.default,
|
|
294
|
+
size: 64,
|
|
295
|
+
color: "primary"
|
|
296
|
+
}),
|
|
297
|
+
size: 32,
|
|
298
|
+
position: "right"
|
|
299
|
+
}
|
|
300
|
+
}), canDelete && /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
301
|
+
type: "text-only",
|
|
302
|
+
onClick: () => handleDelete(user.id),
|
|
303
|
+
disabled: disabled || isEditing,
|
|
304
|
+
iconConfig: {
|
|
305
|
+
icon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
306
|
+
icon: _DeleteOutlineOutlined.default,
|
|
307
|
+
color: "negative"
|
|
308
|
+
}),
|
|
309
|
+
color: "negative",
|
|
310
|
+
size: 32,
|
|
311
|
+
position: "right"
|
|
312
|
+
}
|
|
313
|
+
}))))), addingUser && /*#__PURE__*/_react.default.createElement(_styles.EditFormCard, null, /*#__PURE__*/_react.default.createElement(_styles.EditForm, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
314
|
+
className: "form-row"
|
|
315
|
+
}, finalFields.map((field, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
316
|
+
key: field.key,
|
|
317
|
+
className: "form-field"
|
|
318
|
+
}, renderFormField(field)))), /*#__PURE__*/_react.default.createElement("div", {
|
|
319
|
+
className: "form-actions"
|
|
320
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
321
|
+
type: "danger-secondary",
|
|
322
|
+
onClick: handleCancel,
|
|
323
|
+
label: "Cancel"
|
|
324
|
+
}), /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
325
|
+
type: "primary",
|
|
326
|
+
onClick: handleSave,
|
|
327
|
+
label: "Save"
|
|
328
|
+
})))), !isEditing && /*#__PURE__*/_react.default.createElement(_styles.AddUserButtonContainer, null, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
329
|
+
type: "secondary",
|
|
330
|
+
onClick: handleAdd,
|
|
331
|
+
disabled: disabled,
|
|
332
|
+
label: "Add Another User"
|
|
333
|
+
})), deleteModalVisible && /*#__PURE__*/_react.default.createElement(_CustomModal.default, {
|
|
334
|
+
imgSrc: customPageModal === null || customPageModal === void 0 ? void 0 : customPageModal.imgSrc,
|
|
335
|
+
open: deleteModalVisible,
|
|
336
|
+
onCancel: cancelDelete,
|
|
337
|
+
title: customPageModal === null || customPageModal === void 0 ? void 0 : customPageModal.heading,
|
|
338
|
+
buttonConfig: [{
|
|
339
|
+
callback: () => {
|
|
340
|
+
cancelDelete();
|
|
341
|
+
},
|
|
342
|
+
label: "Cancel",
|
|
343
|
+
type: "secondary"
|
|
344
|
+
}, {
|
|
345
|
+
callback: () => {
|
|
346
|
+
confirmDelete();
|
|
347
|
+
},
|
|
348
|
+
label: "Delete",
|
|
349
|
+
type: "danger-primary"
|
|
350
|
+
}]
|
|
351
|
+
}, customPageModal === null || customPageModal === void 0 ? void 0 : customPageModal.subHeading), /*#__PURE__*/_react.default.createElement(_CustomNotification.default, {
|
|
352
|
+
ref: notificationRef
|
|
353
|
+
}));
|
|
354
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UserItem = exports.UserInfo = exports.EditFormCard = exports.EditForm = exports.AddUserButtonContainer = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
+
const UserItem = exports.UserItem = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-bottom: 16px;\n padding: 16px 0;\n width: 100%;\n"])));
|
|
12
|
+
const EditFormCard = exports.EditFormCard = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-bottom: 16px;\n border-radius: 8px;\n background: #f5f5f5;\n border: 1px solid #e8e8e8;\n padding: 16px;\n width: 100%;\n"])));
|
|
13
|
+
const UserInfo = exports.UserInfo = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n\n .user-details {\n flex: 1;\n }\n\n .user-actions {\n display: flex;\n gap: 8px;\n align-items: center;\n }\n"])));
|
|
14
|
+
const EditForm = exports.EditForm = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .form-row {\n display: flex;\n gap: 16px;\n margin-bottom: 16px;\n\n .form-field {\n flex: 1;\n }\n }\n\n .form-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n }\n"])));
|
|
15
|
+
const AddUserButtonContainer = exports.AddUserButtonContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-top: 16px;\n width: 100%;\n display: flex;\n justify-content: flex-start;\n"])));
|
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.431",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Reusable components",
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -22,8 +22,10 @@
|
|
|
22
22
|
"antd": "^5.11.4",
|
|
23
23
|
"d3": "^7.8.5",
|
|
24
24
|
"dayjs": "^1.11.10",
|
|
25
|
+
"immer": "^10.1.1",
|
|
25
26
|
"pdfjs-dist": "^2.6.347",
|
|
26
27
|
"react-google-maps": "^9.4.5",
|
|
28
|
+
"react-intersection-observer": "^8.32.5",
|
|
27
29
|
"react-markdown": "^8.0.7",
|
|
28
30
|
"react-pattern-lock": "^12.0.12",
|
|
29
31
|
"react-pdf": "^5.3.0",
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.object.assign.js");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var _antd = require("antd");
|
|
11
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
|
12
|
-
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
13
|
-
const _excluded = ["rows", "placeholder", "maxLength", "className"];
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
|
-
/**
|
|
19
|
-
* A custom text area component.
|
|
20
|
-
*
|
|
21
|
-
* The component includes the following properties:
|
|
22
|
-
* - `rows`: The number of rows for the text area.
|
|
23
|
-
* - `placeholder`: The placeholder text for the text area.
|
|
24
|
-
* - `maxLength`: The maximum length of the input value.
|
|
25
|
-
* - `className`: Additional CSS class to apply to the text area.
|
|
26
|
-
* - `antDesignProps`: Any other props to pass to the antd Input.TextArea component.
|
|
27
|
-
*
|
|
28
|
-
* The component will apply the following styles:
|
|
29
|
-
* - A dark grey background when the component is disabled.
|
|
30
|
-
* - A dark grey text color when the component is disabled.
|
|
31
|
-
* - A custom style class of `custom-textarea` to the outer element.
|
|
32
|
-
*
|
|
33
|
-
* The component will also apply the following props to the antd Input.TextArea component:
|
|
34
|
-
* - `rows`
|
|
35
|
-
* - `placeholder`
|
|
36
|
-
* - `maxLength`
|
|
37
|
-
* - `className` (appended to the outer element)
|
|
38
|
-
* - Any other props passed in the `antDesignProps` object
|
|
39
|
-
*/
|
|
40
|
-
function TextArea(_ref) {
|
|
41
|
-
let {
|
|
42
|
-
rows,
|
|
43
|
-
placeholder,
|
|
44
|
-
maxLength,
|
|
45
|
-
className
|
|
46
|
-
} = _ref,
|
|
47
|
-
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
48
|
-
return /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
49
|
-
theme: {
|
|
50
|
-
token: {
|
|
51
|
-
colorBgContainerDisabled: _ColorVariablesMap.default['--color-divider'],
|
|
52
|
-
colorTextDisabled: _ColorVariablesMap.default['--color-secondary-content']
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}, /*#__PURE__*/_react.default.createElement(_styles.default, _extends({
|
|
56
|
-
rows: rows,
|
|
57
|
-
placeholder: placeholder,
|
|
58
|
-
maxLength: maxLength,
|
|
59
|
-
className: "custom-textarea ".concat(className)
|
|
60
|
-
}, antDesignProps)));
|
|
61
|
-
}
|
|
62
|
-
TextArea.propTypes = {
|
|
63
|
-
rows: _propTypes.default.number,
|
|
64
|
-
placeholder: _propTypes.default.string,
|
|
65
|
-
maxLength: _propTypes.default.number,
|
|
66
|
-
className: _propTypes.default.string
|
|
67
|
-
};
|
|
68
|
-
TextArea.defaultProps = {
|
|
69
|
-
rows: 2,
|
|
70
|
-
placeholder: null,
|
|
71
|
-
maxLength: 5000,
|
|
72
|
-
className: ''
|
|
73
|
-
};
|
|
74
|
-
var _default = exports.default = TextArea;
|