@carbon/ibm-products 1.53.0 → 1.53.1
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["id", "itemText", "onClick", "icon"],
|
|
4
|
+
var _excluded = ["id", "itemText", "onClick", "icon", "shouldHideMenuItem"],
|
|
5
5
|
_excluded2 = ["id", "onClick", "shouldHideMenuItem", "shouldDisableMenuItem", "disabled"];
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -47,7 +47,12 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
|
47
47
|
itemText = action.itemText,
|
|
48
48
|
_onClick = action.onClick,
|
|
49
49
|
icon = action.icon,
|
|
50
|
+
shouldHideMenuItem = action.shouldHideMenuItem,
|
|
50
51
|
rest = _objectWithoutProperties(action, _excluded);
|
|
52
|
+
var hidden = typeof shouldHideMenuItem === 'function' && shouldHideMenuItem(row);
|
|
53
|
+
if (hidden) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
51
56
|
var selectedRowId = selectedFlatRows === null || selectedFlatRows === void 0 ? void 0 : selectedFlatRows.filter(function (item) {
|
|
52
57
|
return item.id === row.id ? item.id : null;
|
|
53
58
|
});
|
|
@@ -66,7 +66,7 @@ export var prepareStory = function prepareStory(template, options) {
|
|
|
66
66
|
export var CodesandboxLink = function CodesandboxLink(_ref) {
|
|
67
67
|
var exampleDirectory = _ref.exampleDirectory;
|
|
68
68
|
return /*#__PURE__*/React.createElement("a", {
|
|
69
|
-
href: "https://codesandbox.io/s/github/carbon-design-system/ibm-cloud-cognitive/tree/
|
|
69
|
+
href: "https://codesandbox.io/s/github/carbon-design-system/ibm-cloud-cognitive/tree/main_v1/examples/carbon-for-ibm-products/".concat(exampleDirectory)
|
|
70
70
|
}, /*#__PURE__*/React.createElement("img", {
|
|
71
71
|
alt: "Edit on CodeSandbox",
|
|
72
72
|
src: "https://codesandbox.io/static/img/play-codesandbox.svg"
|
|
@@ -13,7 +13,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
14
|
var _carbonComponentsReact = require("carbon-components-react");
|
|
15
15
|
var _settings = require("../../settings");
|
|
16
|
-
var _excluded = ["id", "itemText", "onClick", "icon"],
|
|
16
|
+
var _excluded = ["id", "itemText", "onClick", "icon", "shouldHideMenuItem"],
|
|
17
17
|
_excluded2 = ["id", "onClick", "shouldHideMenuItem", "shouldDisableMenuItem", "disabled"];
|
|
18
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -50,7 +50,12 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
|
50
50
|
itemText = action.itemText,
|
|
51
51
|
_onClick = action.onClick,
|
|
52
52
|
icon = action.icon,
|
|
53
|
+
shouldHideMenuItem = action.shouldHideMenuItem,
|
|
53
54
|
rest = (0, _objectWithoutProperties2.default)(action, _excluded);
|
|
55
|
+
var hidden = typeof shouldHideMenuItem === 'function' && shouldHideMenuItem(row);
|
|
56
|
+
if (hidden) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
54
59
|
var selectedRowId = selectedFlatRows === null || selectedFlatRows === void 0 ? void 0 : selectedFlatRows.filter(function (item) {
|
|
55
60
|
return item.id === row.id ? item.id : null;
|
|
56
61
|
});
|
|
@@ -75,7 +75,7 @@ exports.prepareStory = prepareStory;
|
|
|
75
75
|
var CodesandboxLink = function CodesandboxLink(_ref) {
|
|
76
76
|
var exampleDirectory = _ref.exampleDirectory;
|
|
77
77
|
return /*#__PURE__*/_react.default.createElement("a", {
|
|
78
|
-
href: "https://codesandbox.io/s/github/carbon-design-system/ibm-cloud-cognitive/tree/
|
|
78
|
+
href: "https://codesandbox.io/s/github/carbon-design-system/ibm-cloud-cognitive/tree/main_v1/examples/carbon-for-ibm-products/".concat(exampleDirectory)
|
|
79
79
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
80
80
|
alt: "Edit on CodeSandbox",
|
|
81
81
|
src: "https://codesandbox.io/static/img/play-codesandbox.svg"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/ibm-products",
|
|
3
3
|
"description": "Carbon for IBM Products",
|
|
4
|
-
"version": "1.53.
|
|
4
|
+
"version": "1.53.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"@carbon/telemetry": "^0.1.0",
|
|
76
76
|
"framer-motion": "^6.5.1 <7",
|
|
77
77
|
"immutability-helper": "^3.1.1",
|
|
78
|
+
"lodash": "^4.17.21",
|
|
78
79
|
"react-dnd": "^15.1.2",
|
|
79
80
|
"react-dnd-html5-backend": "^15.1.3",
|
|
80
81
|
"react-table": "^7.8.0",
|
|
@@ -94,5 +95,5 @@
|
|
|
94
95
|
"react": "^16.8.6 || ^17.0.1",
|
|
95
96
|
"react-dom": "^16.8.6 || ^17.0.1"
|
|
96
97
|
},
|
|
97
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "1eaa6392a5ddc2c60ee54bc73f427ee447749d16"
|
|
98
99
|
}
|