oa-componentbook 0.17.97 → 0.17.99

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.
@@ -147,6 +147,10 @@ function CustomSelect(_ref) {
147
147
  } else {
148
148
  setSelectedOptions(null);
149
149
  }
150
+ onSelectionChange({
151
+ label: valueLabelMap[value],
152
+ value
153
+ });
150
154
  };
151
155
  const onOptionsChangeForMultiple = (select, value) => {
152
156
  const newlySelectedOptions = selectedOptions.slice(0);
@@ -76,16 +76,11 @@ function SparePartsWidget(_ref) {
76
76
  showCostBreakdown,
77
77
  coverageShow
78
78
  } = _ref;
79
- const [sparePartList, setSparePartList] = (0, _react.useState)([]);
80
- const [actionList, setActionList] = (0, _react.useState)(false);
81
- (0, _react.useEffect)(() => {
82
- var tempSparePartsList = [...scopeDetails.unCoveredScope, ...scopeDetails.coveredScope];
83
- setActionList(tempSparePartsList.some(sparePart => {
84
- var _sparePart$action;
85
- return (sparePart === null || sparePart === void 0 || (_sparePart$action = sparePart.action) === null || _sparePart$action === void 0 ? void 0 : _sparePart$action.length) > 0;
86
- }));
87
- setSparePartList(tempSparePartsList);
88
- }, [scopeDetails]);
79
+ const sparePartList = [...scopeDetails.unCoveredScope, ...scopeDetails.coveredScope];
80
+ const showActionList = sparePartList.some(sparePart => {
81
+ var _sparePart$action;
82
+ return (sparePart === null || sparePart === void 0 || (_sparePart$action = sparePart.action) === null || _sparePart$action === void 0 ? void 0 : _sparePart$action.length) > 0;
83
+ });
89
84
  const columns = [{
90
85
  title: 'Spare Part',
91
86
  dataIndex: 'scopeName',
@@ -110,7 +105,7 @@ function SparePartsWidget(_ref) {
110
105
  });
111
106
  }
112
107
  // check if there are any actions then create action column
113
- if (actionList) {
108
+ if (showActionList) {
114
109
  columns.push({
115
110
  title: 'Action',
116
111
  key: 'action',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oa-componentbook",
3
- "version": "0.17.97",
3
+ "version": "0.17.99",
4
4
  "private": false,
5
5
  "description": "Reusable components",
6
6
  "main": "build/index.js",
@@ -18,7 +18,8 @@
18
18
  "@storybook/addon-actions": "^7.6.3",
19
19
  "@storybook/addon-styling": "^1.3.7",
20
20
  "@storybook/cli": "^7.6.3",
21
- "antd": "^5.11.4"
21
+ "antd": "^5.11.4",
22
+ "d3": "^7.8.5"
22
23
  },
23
24
  "devDependencies": {
24
25
  "@babel/cli": "^7.22.9",
@@ -41,8 +42,7 @@
41
42
  "react-scripts": "^5.0.1",
42
43
  "storybook": "^7.6.3",
43
44
  "webpack": "^5.88.2",
44
- "webpack-cli": "^5.1.4",
45
- "d3": "^7.8.5"
45
+ "webpack-cli": "^5.1.4"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@material-ui/core": "^4.12.4",