oa-componentbook 1.0.1-stage.7 → 1.0.1-stage.9
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 +10 -4
- package/build/components/oa-component-info/CustomInfo.js +9 -4
- package/build/components/oa-component-info/styles.js +3 -3
- package/build/widgets/oa-widget-track-shipment-list/TrackShipmentWidgetList.js +9 -11
- package/package.json +1 -1
|
@@ -55,7 +55,9 @@ function Accordion(_ref2) {
|
|
|
55
55
|
smallText,
|
|
56
56
|
key,
|
|
57
57
|
defaultActiveKey,
|
|
58
|
-
hasContentPadding
|
|
58
|
+
hasContentPadding,
|
|
59
|
+
// New prop to determine whether to apply contentPadding
|
|
60
|
+
onChange
|
|
59
61
|
} = _ref2;
|
|
60
62
|
const themeConfig = {
|
|
61
63
|
components: {
|
|
@@ -70,7 +72,8 @@ function Accordion(_ref2) {
|
|
|
70
72
|
}, /*#__PURE__*/_react.default.createElement(_styles.CollapseStyle, null, /*#__PURE__*/_react.default.createElement(_antd.Collapse, {
|
|
71
73
|
expandIcon: CollapseIcon,
|
|
72
74
|
expandIconPosition: "end",
|
|
73
|
-
defaultActiveKey: disabled ? '-1' : defaultActiveKey
|
|
75
|
+
defaultActiveKey: disabled ? '-1' : defaultActiveKey,
|
|
76
|
+
onChange: onChange
|
|
74
77
|
}, /*#__PURE__*/_react.default.createElement(_antd.Collapse.Panel, {
|
|
75
78
|
"data-test": dataTest ? "".concat(dataTest, "--complete") : undefined,
|
|
76
79
|
collapsible: disabled ? 'disabled' : undefined,
|
|
@@ -92,7 +95,8 @@ Accordion.propTypes = {
|
|
|
92
95
|
hasContentPadding: _propTypes.default.bool,
|
|
93
96
|
// New prop for controlling contentPadding
|
|
94
97
|
key: _propTypes.default.string,
|
|
95
|
-
defaultActiveKey: _propTypes.default.string
|
|
98
|
+
defaultActiveKey: _propTypes.default.string,
|
|
99
|
+
onChange: _propTypes.default.func
|
|
96
100
|
};
|
|
97
101
|
Accordion.defaultProps = {
|
|
98
102
|
body: '',
|
|
@@ -101,6 +105,8 @@ Accordion.defaultProps = {
|
|
|
101
105
|
smallText: '',
|
|
102
106
|
key: '1',
|
|
103
107
|
defaultActiveKey: '1',
|
|
104
|
-
hasContentPadding: true
|
|
108
|
+
hasContentPadding: true,
|
|
109
|
+
// Default value for contentPadding
|
|
110
|
+
onChange: () => {}
|
|
105
111
|
};
|
|
106
112
|
var _default = exports.default = Accordion;
|
|
@@ -27,6 +27,7 @@ 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.
|
|
30
31
|
*
|
|
31
32
|
* @returns {ReactElement} A styled component with the specified properties.
|
|
32
33
|
*/
|
|
@@ -37,7 +38,8 @@ function CustomInfo(_ref) {
|
|
|
37
38
|
description,
|
|
38
39
|
fontColor,
|
|
39
40
|
iconConfig,
|
|
40
|
-
title
|
|
41
|
+
title,
|
|
42
|
+
borderColor
|
|
41
43
|
} = _ref;
|
|
42
44
|
/**
|
|
43
45
|
* Renders the icon based on the presence of a title.
|
|
@@ -65,7 +67,8 @@ function CustomInfo(_ref) {
|
|
|
65
67
|
}, renderIcon()) : renderIcon();
|
|
66
68
|
};
|
|
67
69
|
return /*#__PURE__*/_react.default.createElement(_styles.InfoContainer, {
|
|
68
|
-
$color: color
|
|
70
|
+
$color: color,
|
|
71
|
+
$borderColor: borderColor
|
|
69
72
|
}, /*#__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, {
|
|
70
73
|
color: fontColor,
|
|
71
74
|
typography: "type-t2-700"
|
|
@@ -96,7 +99,8 @@ CustomInfo.propTypes = {
|
|
|
96
99
|
position: _propTypes.default.oneOf(['left', 'right']),
|
|
97
100
|
tooltipText: _propTypes.default.string
|
|
98
101
|
}),
|
|
99
|
-
title: _propTypes.default.string
|
|
102
|
+
title: _propTypes.default.string,
|
|
103
|
+
borderColor: _propTypes.default.string
|
|
100
104
|
};
|
|
101
105
|
CustomInfo.defaultProps = {
|
|
102
106
|
buttonConfig: {
|
|
@@ -110,5 +114,6 @@ CustomInfo.defaultProps = {
|
|
|
110
114
|
},
|
|
111
115
|
fontColor: 'primary-content',
|
|
112
116
|
title: '',
|
|
113
|
-
description: ''
|
|
117
|
+
description: '',
|
|
118
|
+
borderColor: ''
|
|
114
119
|
};
|
|
@@ -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 \n button {\n margin-left: 8px;\n }
|
|
15
|
+
})(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 12px;\n align-items: center;\n border-radius: 8px;\n background-color: var(--color-", ");\n border: 1px solid var(--color-", ");\n\n button {\n margin-left: 8px;\n }\n"])), props => props.$color, props => props.$borderColor);
|
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.weak-map.js");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
require("
|
|
9
|
-
require("core-js/modules/es.promise.js");
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
9
|
var _fn = require("./fn");
|
|
13
10
|
var _TrackShipmentWidget = _interopRequireDefault(require("../oa-widget-track-shipment/TrackShipmentWidget"));
|
|
14
11
|
var _Accordion = _interopRequireDefault(require("../../components/oa-component-accordion/Accordion"));
|
|
15
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
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); }
|
|
17
|
-
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; }
|
|
18
13
|
function TrackShipmentWidgetList(_ref) {
|
|
19
14
|
var _shipmentData$map;
|
|
20
15
|
let {
|
|
21
|
-
shipmentData
|
|
16
|
+
shipmentData,
|
|
17
|
+
onChange: _onChange
|
|
22
18
|
} = _ref;
|
|
23
|
-
const [historyData, setHistoryData] = (0, _react.useState)({});
|
|
24
|
-
const [loading, setLoading] = (0, _react.useState)({});
|
|
25
|
-
const fetchStatusXData = async reassignmentId => {};
|
|
26
19
|
if (!shipmentData || shipmentData.length === 0) {
|
|
27
20
|
return /*#__PURE__*/_react.default.createElement("p", null, "No shipment data available.");
|
|
28
21
|
}
|
|
@@ -37,6 +30,7 @@ function TrackShipmentWidgetList(_ref) {
|
|
|
37
30
|
status
|
|
38
31
|
} = item !== null && item !== void 0 ? item : {};
|
|
39
32
|
return /*#__PURE__*/_react.default.createElement(_Accordion.default, {
|
|
33
|
+
onChange: () => _onChange(reassignmentId),
|
|
40
34
|
key: reassignmentId,
|
|
41
35
|
body: /*#__PURE__*/_react.default.createElement(_TrackShipmentWidget.default, (0, _fn.getSingleShipmentHistory)(item)),
|
|
42
36
|
headerText: (0, _fn.headerText)(index, reassignmentTime, modifiedTime, status)
|
|
@@ -59,6 +53,10 @@ TrackShipmentWidgetList.propTypes = {
|
|
|
59
53
|
reassignmentTime: _propTypes.default.string,
|
|
60
54
|
modifiedTime: _propTypes.default.string,
|
|
61
55
|
stages: _propTypes.default.array
|
|
62
|
-
})).isRequired
|
|
56
|
+
})).isRequired,
|
|
57
|
+
onChange: _propTypes.default.func
|
|
58
|
+
};
|
|
59
|
+
TrackShipmentWidgetList.defaultProps = {
|
|
60
|
+
onChange: () => {}
|
|
63
61
|
};
|
|
64
62
|
var _default = exports.default = TrackShipmentWidgetList;
|