@carbon/ibm-products 2.41.1-canary.11 → 2.41.1-canary.5
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +0 -6
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +0 -6
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +0 -6
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +0 -6
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -21
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +2 -12
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.d.ts +3 -3
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +5 -5
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +1 -3
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -12
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +0 -7
- package/es/components/Datagrid/useCustomizeColumns.js +4 -0
- package/es/components/Datagrid/useEditableCell.js +1 -1
- package/es/components/Datagrid/useFocusRowExpander.js +1 -1
- package/es/components/Datagrid/useInlineEdit.d.ts +1 -1
- package/es/components/Datagrid/useInlineEdit.js +16 -9
- package/es/components/EditUpdateCards/EditUpdateCards.d.ts +3 -4
- package/es/components/ProductiveCard/ProductiveCard.d.ts +2 -115
- package/es/components/ProductiveCard/ProductiveCard.js +9 -9
- package/es/components/index.d.ts +0 -1
- package/es/global/js/hooks/usePortalTarget.js +2 -4
- package/es/index.js +0 -1
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +29 -49
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +19 -13
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.d.ts +3 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +5 -5
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +1 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -12
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +0 -7
- package/lib/components/Datagrid/useCustomizeColumns.js +4 -0
- package/lib/components/Datagrid/useEditableCell.js +1 -1
- package/lib/components/Datagrid/useFocusRowExpander.js +1 -1
- package/lib/components/Datagrid/useInlineEdit.d.ts +1 -1
- package/lib/components/Datagrid/useInlineEdit.js +15 -8
- package/lib/components/EditUpdateCards/EditUpdateCards.d.ts +3 -4
- package/lib/components/ProductiveCard/ProductiveCard.d.ts +2 -115
- package/lib/components/ProductiveCard/ProductiveCard.js +9 -9
- package/lib/components/index.d.ts +0 -1
- package/lib/global/js/hooks/usePortalTarget.js +2 -4
- package/lib/index.js +0 -4
- package/package.json +3 -7
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +0 -6
- package/es/components/FeatureFlags/index.d.ts +0 -37
- package/es/components/FeatureFlags/index.js +0 -151
- package/es/feature-flags.d.ts +0 -1
- package/lib/components/FeatureFlags/index.d.ts +0 -37
- package/lib/components/FeatureFlags/index.js +0 -162
- package/lib/feature-flags.d.ts +0 -1
@@ -13,11 +13,26 @@ var _rollupPluginBabelHelpers = require('../../../../../_virtual/_rollupPluginBa
|
|
13
13
|
var React = require('react');
|
14
14
|
var index = require('../../../../../node_modules/prop-types/index.js');
|
15
15
|
var CustomizeColumnsTearsheet = require('./CustomizeColumnsTearsheet.js');
|
16
|
-
var InlineEditContext = require('../InlineEdit/InlineEditContext/InlineEditContext.js');
|
17
16
|
|
18
|
-
function
|
17
|
+
function _interopNamespace(e) {
|
18
|
+
if (e && e.__esModule) return e;
|
19
|
+
var n = Object.create(null);
|
20
|
+
if (e) {
|
21
|
+
Object.keys(e).forEach(function (k) {
|
22
|
+
if (k !== 'default') {
|
23
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
24
|
+
Object.defineProperty(n, k, d.get ? d : {
|
25
|
+
enumerable: true,
|
26
|
+
get: function () { return e[k]; }
|
27
|
+
});
|
28
|
+
}
|
29
|
+
});
|
30
|
+
}
|
31
|
+
n["default"] = e;
|
32
|
+
return Object.freeze(n);
|
33
|
+
}
|
19
34
|
|
20
|
-
var
|
35
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
21
36
|
|
22
37
|
var _excluded = ["onSaveColumnPrefs", "isTearsheetOpen", "setIsTearsheetOpen", "labels"];
|
23
38
|
var TearsheetWrapper = function TearsheetWrapper(_ref) {
|
@@ -28,16 +43,7 @@ var TearsheetWrapper = function TearsheetWrapper(_ref) {
|
|
28
43
|
setIsTearsheetOpen = _instance$customizeCo.setIsTearsheetOpen,
|
29
44
|
labels = _instance$customizeCo.labels,
|
30
45
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_instance$customizeCo, _excluded);
|
31
|
-
|
32
|
-
state = _useContext.state;
|
33
|
-
var _ref2 = state || {},
|
34
|
-
featureFlags = _ref2.featureFlags;
|
35
|
-
React.useEffect(function () {
|
36
|
-
if (featureFlags && !(featureFlags !== null && featureFlags !== void 0 && featureFlags['enable-datagrid-useCustomizeColumns'])) {
|
37
|
-
console.error("Datagrid useCustomizeColumns extension has not been enabled via feature flag.");
|
38
|
-
}
|
39
|
-
}, [featureFlags]);
|
40
|
-
return /*#__PURE__*/React__default["default"].createElement(CustomizeColumnsTearsheet["default"], _rollupPluginBabelHelpers["extends"]({}, rest, labels, {
|
46
|
+
return /*#__PURE__*/React__namespace.createElement(CustomizeColumnsTearsheet["default"], _rollupPluginBabelHelpers["extends"]({}, rest, labels, {
|
41
47
|
isOpen: isTearsheetOpen,
|
42
48
|
setIsTearsheetOpen: setIsTearsheetOpen,
|
43
49
|
columnDefinitions: instance.allColumns,
|
package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
export function InlineEditButton({ label, renderIcon: Icon, labelIcon: LabelIcon, placeholder,
|
1
|
+
export function InlineEditButton({ label, renderIcon: Icon, disabled, labelIcon: LabelIcon, placeholder, nonEditCell, isActiveCell, columnConfig, type, }: {
|
2
2
|
label: any;
|
3
3
|
renderIcon: any;
|
4
|
+
disabled: any;
|
4
5
|
labelIcon: any;
|
5
6
|
placeholder: any;
|
6
|
-
disabledCell: any;
|
7
7
|
nonEditCell: any;
|
8
8
|
isActiveCell: any;
|
9
9
|
columnConfig: any;
|
@@ -12,7 +12,7 @@ export function InlineEditButton({ label, renderIcon: Icon, labelIcon: LabelIcon
|
|
12
12
|
export namespace InlineEditButton {
|
13
13
|
namespace propTypes {
|
14
14
|
let columnConfig: PropTypes.Requireable<object>;
|
15
|
-
let
|
15
|
+
let disabled: PropTypes.Requireable<boolean>;
|
16
16
|
let isActiveCell: PropTypes.Requireable<boolean>;
|
17
17
|
let label: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
18
18
|
let labelIcon: PropTypes.Requireable<object>;
|
package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js
CHANGED
@@ -24,18 +24,18 @@ var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
|
|
24
24
|
var InlineEditButton = function InlineEditButton(_ref) {
|
25
25
|
var label = _ref.label,
|
26
26
|
Icon = _ref.renderIcon,
|
27
|
+
disabled = _ref.disabled,
|
27
28
|
LabelIcon = _ref.labelIcon,
|
28
29
|
placeholder = _ref.placeholder,
|
29
|
-
disabledCell = _ref.disabledCell,
|
30
30
|
nonEditCell = _ref.nonEditCell,
|
31
31
|
isActiveCell = _ref.isActiveCell,
|
32
32
|
columnConfig = _ref.columnConfig,
|
33
33
|
type = _ref.type;
|
34
34
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
35
|
-
className: cx__default["default"]("".concat(blockClass, "__inline-edit-button"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__inline-edit-button--disabled"),
|
35
|
+
className: cx__default["default"]("".concat(blockClass, "__inline-edit-button"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__inline-edit-button--disabled"), disabled || nonEditCell), "".concat(blockClass, "__inline-edit-button--with-label-icon"), LabelIcon), "".concat(blockClass, "__inline-edit-button--non-edit"), nonEditCell), "".concat(blockClass, "__inline-edit-button--active"), isActiveCell), "".concat(blockClass, "__inline-edit-button--").concat(type), type === 'date' || type === 'selection')),
|
36
36
|
tabIndex: isActiveCell ? 0 : -1,
|
37
|
-
"data-disabled":
|
38
|
-
"aria-disabled":
|
37
|
+
"data-disabled": disabled || nonEditCell,
|
38
|
+
"aria-disabled": disabled || nonEditCell,
|
39
39
|
role: "button",
|
40
40
|
title: label
|
41
41
|
}, LabelIcon && /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -50,7 +50,7 @@ var InlineEditButton = function InlineEditButton(_ref) {
|
|
50
50
|
};
|
51
51
|
InlineEditButton.propTypes = {
|
52
52
|
columnConfig: index["default"].object,
|
53
|
-
|
53
|
+
disabled: index["default"].bool,
|
54
54
|
isActiveCell: index["default"].bool,
|
55
55
|
label: index["default"].oneOfType([index["default"].string, index["default"].number]),
|
56
56
|
labelIcon: index["default"].oneOfType([index["default"].func, index["default"].object]),
|
package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
export function InlineEditCell({ cell, config,
|
1
|
+
export function InlineEditCell({ cell, config, instance, placeholder, tabIndex, value, nonEditCell, type, }: {
|
2
2
|
cell: any;
|
3
3
|
config: any;
|
4
|
-
disabledCell?: boolean | undefined;
|
5
4
|
instance: any;
|
6
5
|
placeholder?: string | undefined;
|
7
6
|
tabIndex: any;
|
@@ -13,7 +12,6 @@ export namespace InlineEditCell {
|
|
13
12
|
namespace propTypes {
|
14
13
|
let cell: PropTypes.Requireable<object>;
|
15
14
|
let config: PropTypes.Requireable<object>;
|
16
|
-
let disabledCell: PropTypes.Requireable<boolean>;
|
17
15
|
let instance: PropTypes.Requireable<PropTypes.InferProps<{
|
18
16
|
columns: PropTypes.Requireable<(object | null | undefined)[]>;
|
19
17
|
onDataUpdate: PropTypes.Requireable<(...args: any[]) => any>;
|
@@ -31,8 +31,6 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
31
31
|
var _config$validator, _value$text;
|
32
32
|
var cell = _ref.cell,
|
33
33
|
config = _ref.config,
|
34
|
-
_ref$disabledCell = _ref.disabledCell,
|
35
|
-
disabledCell = _ref$disabledCell === void 0 ? false : _ref$disabledCell,
|
36
34
|
instance = _ref.instance,
|
37
35
|
_ref$placeholder = _ref.placeholder,
|
38
36
|
placeholder = _ref$placeholder === void 0 ? '' : _ref$placeholder,
|
@@ -330,11 +328,6 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
330
328
|
return icons.Calendar;
|
331
329
|
}
|
332
330
|
};
|
333
|
-
var renderRegularCell = function renderRegularCell() {
|
334
|
-
return /*#__PURE__*/React__default["default"].createElement("span", _rollupPluginBabelHelpers["extends"]({}, inputProps, {
|
335
|
-
id: cellId
|
336
|
-
}));
|
337
|
-
};
|
338
331
|
var renderDateCell = function renderDateCell() {
|
339
332
|
var _config$inputProps, _outerButtonElement$c;
|
340
333
|
var datePickerPreparedProps = propsHelper.prepareProps(config.inputProps, ['datePickerInputProps']);
|
@@ -450,16 +443,15 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
450
443
|
"data-cell-id": cellId,
|
451
444
|
"data-column-index": columnIndex,
|
452
445
|
"data-row-index": cell.row.index,
|
453
|
-
"data-disabled":
|
446
|
+
"data-disabled": nonEditCell,
|
454
447
|
"data-inline-type": type,
|
455
448
|
onClick: !nonEditCell ? handleInlineCellClick : addActiveState,
|
456
449
|
onKeyDown: !nonEditCell ? handleKeyDown : null,
|
457
|
-
className: cx__default["default"]("".concat(blockClass, "__inline-edit--outer-cell-button"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(
|
458
|
-
}, !
|
450
|
+
className: cx__default["default"]("".concat(blockClass, "__inline-edit--outer-cell-button"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"), config === null || config === void 0 || (_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, cellValue)))
|
451
|
+
}, !inEditMode && /*#__PURE__*/React__default["default"].createElement(InlineEditButton.InlineEditButton, {
|
459
452
|
isActiveCell: cellId === activeCellId,
|
460
453
|
renderIcon: setRenderIcon(),
|
461
454
|
label: type === 'selection' ? (_value$text = value === null || value === void 0 ? void 0 : value.text) !== null && _value$text !== void 0 ? _value$text : value : type === 'date' ? buildDate(value) : value,
|
462
|
-
disabledCell: disabledCell,
|
463
455
|
labelIcon: (value === null || value === void 0 ? void 0 : value.icon) || null,
|
464
456
|
placeholder: placeholder,
|
465
457
|
tabIndex: tabIndex,
|
@@ -472,7 +464,6 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
472
464
|
InlineEditCell.propTypes = {
|
473
465
|
cell: index["default"].object,
|
474
466
|
config: index["default"].object,
|
475
|
-
disabledCell: index["default"].bool,
|
476
467
|
instance: index["default"].shape({
|
477
468
|
columns: index["default"].arrayOf(index["default"].object),
|
478
469
|
onDataUpdate: index["default"].func,
|
package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js
CHANGED
@@ -81,13 +81,6 @@ var inlineEditReducer = function inlineEditReducer(state, action) {
|
|
81
81
|
}
|
82
82
|
break;
|
83
83
|
}
|
84
|
-
case 'SET_FEATURE_FLAGS':
|
85
|
-
{
|
86
|
-
var _action$payload2;
|
87
|
-
return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, state), {}, {
|
88
|
-
featureFlags: (_action$payload2 = action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {}
|
89
|
-
});
|
90
|
-
}
|
91
84
|
default:
|
92
85
|
return state;
|
93
86
|
}
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
13
13
|
var React = require('react');
|
14
|
+
var settings = require('../../settings.js');
|
14
15
|
var ButtonWrapper = require('./Datagrid/addons/CustomizeColumns/ButtonWrapper.js');
|
15
16
|
var TearsheetWrapper = require('./Datagrid/addons/CustomizeColumns/TearsheetWrapper.js');
|
16
17
|
|
@@ -35,6 +36,9 @@ function _interopNamespace(e) {
|
|
35
36
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
36
37
|
|
37
38
|
var useCustomizeColumns = function useCustomizeColumns(hooks) {
|
39
|
+
React__namespace.useEffect(function () {
|
40
|
+
settings.pkg.checkReportFeatureEnabled('Datagrid.useCustomizeColumns');
|
41
|
+
}, []);
|
38
42
|
var _React$useState = React__namespace.useState(false),
|
39
43
|
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
40
44
|
isTearsheetOpen = _React$useState2[0],
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
12
12
|
var useInlineEdit = require('./useInlineEdit.js');
|
13
13
|
|
14
14
|
var useEditableCell = function useEditableCell(hooks) {
|
15
|
-
useInlineEdit["default"](hooks);
|
15
|
+
useInlineEdit["default"](hooks, 'usingEditableCell');
|
16
16
|
};
|
17
17
|
var useEditableCell$1 = useEditableCell;
|
18
18
|
|
@@ -38,7 +38,7 @@ var useFocusRowExpander = function useFocusRowExpander(_ref) {
|
|
38
38
|
});
|
39
39
|
if (activeRow.length) {
|
40
40
|
var rowExpander = activeRow[0].querySelector(".".concat(blockClass, "__row-expander"));
|
41
|
-
rowExpander
|
41
|
+
rowExpander.focus();
|
42
42
|
}
|
43
43
|
}, [instance === null || instance === void 0 ? void 0 : instance.tableId, instance === null || instance === void 0 ? void 0 : instance.expandedRows, lastExpandedRowIndex, blockClass, activeElement]);
|
44
44
|
};
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export default useInlineEdit;
|
2
|
-
declare function useInlineEdit(hooks: any): void;
|
2
|
+
declare function useInlineEdit(hooks: any, usingEditableCell: any): void;
|
@@ -9,6 +9,7 @@
|
|
9
9
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
11
11
|
|
12
|
+
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
12
13
|
var React = require('react');
|
13
14
|
var settings = require('../../settings.js');
|
14
15
|
var cx = require('classnames');
|
@@ -20,21 +21,27 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
21
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
21
22
|
|
22
23
|
var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
|
23
|
-
var useInlineEdit = function useInlineEdit(hooks) {
|
24
|
+
var useInlineEdit = function useInlineEdit(hooks, usingEditableCell) {
|
25
|
+
React.useEffect(function () {
|
26
|
+
if (!usingEditableCell) {
|
27
|
+
settings.pkg.checkReportFeatureEnabled('Datagrid.useInlineEdit');
|
28
|
+
}
|
29
|
+
if (usingEditableCell) {
|
30
|
+
settings.pkg.checkReportFeatureEnabled('Datagrid.useEditableCell');
|
31
|
+
}
|
32
|
+
}, [usingEditableCell]);
|
24
33
|
var addInlineEdit = function addInlineEdit(props, _ref) {
|
25
|
-
var _cell$column
|
34
|
+
var _cell$column;
|
26
35
|
var cell = _ref.cell,
|
27
36
|
instance = _ref.instance;
|
28
37
|
var columnInlineEditConfig = cell.column.inlineEdit;
|
29
38
|
var inlineEditType = (_cell$column = cell.column) === null || _cell$column === void 0 || (_cell$column = _cell$column.inlineEdit) === null || _cell$column === void 0 ? void 0 : _cell$column.type;
|
30
|
-
var isDisabled = (_cell$column2 = cell.column) === null || _cell$column2 === void 0 ? void 0 : _cell$column2.isDisabled;
|
31
39
|
var renderInlineEditComponent = function renderInlineEditComponent(type) {
|
32
40
|
return /*#__PURE__*/React__default["default"].createElement(InlineEditCell.InlineEditCell, {
|
33
41
|
config: columnInlineEditConfig,
|
34
42
|
tabIndex: -1,
|
35
43
|
value: cell.value,
|
36
44
|
cell: cell,
|
37
|
-
isDisabled: isDisabled,
|
38
45
|
instance: instance,
|
39
46
|
type: type
|
40
47
|
});
|
@@ -45,15 +52,15 @@ var useInlineEdit = function useInlineEdit(hooks) {
|
|
45
52
|
}];
|
46
53
|
}
|
47
54
|
return [props, {
|
48
|
-
className: cx__default["default"]("".concat(blockClass, "__cell"), "".concat(blockClass, "__cell-inline-edit")),
|
55
|
+
className: cx__default["default"]("".concat(blockClass, "__cell"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__cell-inline-edit"), !!usingEditableCell || settings.pkg.isFeatureEnabled('Datagrid.useInlineEdit') ? true : '')),
|
49
56
|
role: 'gridcell',
|
50
|
-
children: /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, inlineEditType === 'text' && renderInlineEditComponent(inlineEditType), inlineEditType === 'number' && renderInlineEditComponent(inlineEditType), inlineEditType === 'selection' && renderInlineEditComponent(inlineEditType), inlineEditType === 'date' && renderInlineEditComponent(inlineEditType), !inlineEditType && /*#__PURE__*/React__default["default"].createElement(InlineEditCell.InlineEditCell, {
|
57
|
+
children: (!!usingEditableCell || settings.pkg.isFeatureEnabled('Datagrid.useInlineEdit')) && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, inlineEditType === 'text' && renderInlineEditComponent(inlineEditType), inlineEditType === 'number' && renderInlineEditComponent(inlineEditType), inlineEditType === 'selection' && renderInlineEditComponent(inlineEditType), inlineEditType === 'date' && renderInlineEditComponent(inlineEditType), !inlineEditType && /*#__PURE__*/React__default["default"].createElement(InlineEditCell.InlineEditCell, {
|
51
58
|
config: columnInlineEditConfig,
|
52
59
|
tabIndex: -1,
|
53
60
|
value: cell.value,
|
54
61
|
cell: cell,
|
55
62
|
instance: instance,
|
56
|
-
|
63
|
+
disabled: true,
|
57
64
|
nonEditCell: true,
|
58
65
|
type: "text"
|
59
66
|
}))
|
@@ -62,7 +69,7 @@ var useInlineEdit = function useInlineEdit(hooks) {
|
|
62
69
|
hooks.getCellProps.push(addInlineEdit);
|
63
70
|
hooks.useInstance.push(function (instance) {
|
64
71
|
Object.assign(instance, {
|
65
|
-
withInlineEdit: true
|
72
|
+
withInlineEdit: !!usingEditableCell || settings.pkg.isFeatureEnabled('Datagrid.useInlineEdit') ? true : false
|
66
73
|
});
|
67
74
|
});
|
68
75
|
};
|
@@ -14,7 +14,6 @@ type ActionIcon = {
|
|
14
14
|
iconDescription: string;
|
15
15
|
href?: string;
|
16
16
|
};
|
17
|
-
type PlacementType = 'top' | 'bottom';
|
18
17
|
interface EditUpdateCardsProps {
|
19
18
|
/**
|
20
19
|
* Icons that are displayed on card. Refer to design documentation for implementation guidelines
|
@@ -23,7 +22,7 @@ interface EditUpdateCardsProps {
|
|
23
22
|
/**
|
24
23
|
* Determines if the action icons are on the top or bottom of the card
|
25
24
|
*/
|
26
|
-
actionsPlacement?:
|
25
|
+
actionsPlacement?: 'top' | 'bottom';
|
27
26
|
/**
|
28
27
|
* Optional label for the top of the card.
|
29
28
|
*/
|
@@ -67,7 +66,7 @@ interface EditUpdateCardsProps {
|
|
67
66
|
/**
|
68
67
|
* Determines if the primary button is on the top or bottom of the card
|
69
68
|
*/
|
70
|
-
primaryButtonPlacement?:
|
69
|
+
primaryButtonPlacement?: 'top' | 'bottom';
|
71
70
|
/**
|
72
71
|
* The text that's displayed in the primary button
|
73
72
|
*/
|
@@ -87,7 +86,7 @@ interface EditUpdateCardsProps {
|
|
87
86
|
/**
|
88
87
|
* Determines if the secondary button is on the top or bottom of the card
|
89
88
|
*/
|
90
|
-
secondaryButtonPlacement?:
|
89
|
+
secondaryButtonPlacement?: 'top' | 'bottom';
|
91
90
|
/**
|
92
91
|
* The text that's displayed in the secondary button
|
93
92
|
*/
|
@@ -1,115 +1,2 @@
|
|
1
|
-
|
2
|
-
import
|
3
|
-
type ActionIcon = {
|
4
|
-
id?: string;
|
5
|
-
icon?: CarbonIconType;
|
6
|
-
onKeyDown?(): void;
|
7
|
-
onClick?(): void;
|
8
|
-
iconDescription?: string;
|
9
|
-
href?: string;
|
10
|
-
};
|
11
|
-
type overflowAction = {
|
12
|
-
id?: string;
|
13
|
-
itemText?: string;
|
14
|
-
onClick?: () => void;
|
15
|
-
onKeydown?: () => void;
|
16
|
-
};
|
17
|
-
type PlacementType = 'top' | 'bottom';
|
18
|
-
type ClickZoneType = 'one' | 'two' | 'three';
|
19
|
-
interface ProductiveCardProps extends PropsWithChildren {
|
20
|
-
/**
|
21
|
-
* Icons that are displayed on card. Refer to design documentation for implementation guidelines. Note- href will supersede onClick
|
22
|
-
*/
|
23
|
-
actionIcons?: ActionIcon[];
|
24
|
-
/**
|
25
|
-
* Determines if the action icons are on the top or bottom of the card
|
26
|
-
*/
|
27
|
-
actionsPlacement?: PlacementType;
|
28
|
-
/**
|
29
|
-
* Content that shows in the body of the card
|
30
|
-
*/
|
31
|
-
/**
|
32
|
-
* Optional user provided class
|
33
|
-
*/
|
34
|
-
className?: string;
|
35
|
-
children: ReactNode;
|
36
|
-
/**
|
37
|
-
* Designates which zones of the card are clickable. Refer to design documentation for implementation guidelines
|
38
|
-
*/
|
39
|
-
clickZone?: ClickZoneType;
|
40
|
-
/**
|
41
|
-
* Optional header description
|
42
|
-
*/
|
43
|
-
description?: string | object | ReactNode;
|
44
|
-
/**
|
45
|
-
* Optional label for the top of the card
|
46
|
-
*/
|
47
|
-
label?: string | object | ReactNode;
|
48
|
-
/**
|
49
|
-
* Provides the callback for a clickable card
|
50
|
-
*/
|
51
|
-
onClick?: () => void;
|
52
|
-
/**
|
53
|
-
* Function that's called from the primary button or action icon
|
54
|
-
*/
|
55
|
-
onPrimaryButtonClick?: () => void;
|
56
|
-
/**
|
57
|
-
* Function that's called from the secondary button
|
58
|
-
*/
|
59
|
-
onSecondaryButtonClick?: () => void;
|
60
|
-
/**
|
61
|
-
* Use an overflow menu instead of action icons. Refer to design documentation for implementation guidelines
|
62
|
-
*/
|
63
|
-
overflowActions?: overflowAction[];
|
64
|
-
/**
|
65
|
-
* Aria label prop required for OverflowMenu
|
66
|
-
*/
|
67
|
-
overflowAriaLabel?: string;
|
68
|
-
/**
|
69
|
-
* Optionally specify an href for your Button to become an <a> element
|
70
|
-
*/
|
71
|
-
primaryButtonHref?: string;
|
72
|
-
/**
|
73
|
-
* Optional prop to allow overriding the icon rendering. Can be a React component class
|
74
|
-
*/
|
75
|
-
primaryButtonIcon?: CarbonIconType;
|
76
|
-
/**
|
77
|
-
* Determines if the primary button is on the top or bottom of the card
|
78
|
-
*/
|
79
|
-
primaryButtonPlacement?: PlacementType;
|
80
|
-
/**
|
81
|
-
* The text that's displayed in the primary button
|
82
|
-
*/
|
83
|
-
primaryButtonText?: string;
|
84
|
-
/**
|
85
|
-
* Optionally specify an href for your Button to become an <a> element
|
86
|
-
*/
|
87
|
-
secondaryButtonHref?: string;
|
88
|
-
/**
|
89
|
-
* Optional prop to allow overriding the icon rendering. Can be a React component class
|
90
|
-
*/
|
91
|
-
secondaryButtonIcon?: CarbonIconType;
|
92
|
-
/**
|
93
|
-
* Determines if the secondary button is on the top or bottom of the card
|
94
|
-
*/
|
95
|
-
secondaryButtonPlacement?: PlacementType;
|
96
|
-
/**
|
97
|
-
* The text that's displayed in the secondary button
|
98
|
-
*/
|
99
|
-
secondaryButtonText?: string;
|
100
|
-
/**
|
101
|
-
* **Experimental:** For all cases a `Slug` component can be provided.
|
102
|
-
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
103
|
-
*/
|
104
|
-
slug?: ReactNode | boolean;
|
105
|
-
/**
|
106
|
-
* Title that's displayed at the top of the card
|
107
|
-
*/
|
108
|
-
title?: string | object | ReactNode;
|
109
|
-
/**
|
110
|
-
* Determines title size
|
111
|
-
*/
|
112
|
-
titleSize?: 'default' | 'large';
|
113
|
-
}
|
114
|
-
export declare let ProductiveCard: React.ForwardRefExoticComponent<ProductiveCardProps & React.RefAttributes<HTMLDivElement>>;
|
115
|
-
export {};
|
1
|
+
export let ProductiveCard: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
2
|
+
import React from 'react';
|
@@ -23,16 +23,22 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
23
|
|
24
24
|
var _excluded = ["actionsPlacement"];
|
25
25
|
var componentName = 'ProductiveCard';
|
26
|
+
|
27
|
+
// Default values for props
|
28
|
+
var defaults = {
|
29
|
+
actionsPlacement: 'top'
|
30
|
+
};
|
26
31
|
exports.ProductiveCard = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
27
32
|
var _ref$actionsPlacement = _ref.actionsPlacement,
|
28
|
-
actionsPlacement = _ref$actionsPlacement === void 0 ?
|
33
|
+
actionsPlacement = _ref$actionsPlacement === void 0 ? defaults.actionsPlacement : _ref$actionsPlacement,
|
29
34
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
30
35
|
var validProps = propsHelper.prepareProps(rest, ['media', 'mediaPosition', 'pictogram', 'primaryButtonClick', 'productive', 'secondaryButtonKind']);
|
31
36
|
return /*#__PURE__*/React__default["default"].createElement(Card.Card, _rollupPluginBabelHelpers["extends"]({}, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, validProps), {}, {
|
32
37
|
actionsPlacement: actionsPlacement,
|
33
|
-
ref: ref
|
38
|
+
ref: ref
|
39
|
+
}), {
|
34
40
|
productive: true
|
35
|
-
}
|
41
|
+
}, devtools.getDevtoolsProps(componentName)));
|
36
42
|
});
|
37
43
|
|
38
44
|
// Return a placeholder if not released and not enabled by feature flag
|
@@ -41,7 +47,6 @@ exports.ProductiveCard.propTypes = {
|
|
41
47
|
/**
|
42
48
|
* Icons that are displayed on card. Refer to design documentation for implementation guidelines
|
43
49
|
*/
|
44
|
-
/**@ts-ignore */
|
45
50
|
actionIcons: index["default"].arrayOf(index["default"].shape({
|
46
51
|
id: index["default"].string,
|
47
52
|
icon: index["default"].oneOfType([index["default"].func, index["default"].object]),
|
@@ -89,7 +94,6 @@ exports.ProductiveCard.propTypes = {
|
|
89
94
|
/**
|
90
95
|
* Use an overflow menu instead of action icons. Refer to design documentation for implementation guidelines
|
91
96
|
*/
|
92
|
-
/**@ts-ignore */
|
93
97
|
overflowActions: index["default"].arrayOf(index["default"].shape({
|
94
98
|
id: index["default"].string,
|
95
99
|
itemText: index["default"].string,
|
@@ -107,7 +111,6 @@ exports.ProductiveCard.propTypes = {
|
|
107
111
|
/**
|
108
112
|
* Optional prop to allow overriding the icon rendering. Can be a React component class
|
109
113
|
*/
|
110
|
-
/**@ts-ignore */
|
111
114
|
primaryButtonIcon: index["default"].oneOfType([index["default"].func, index["default"].object]),
|
112
115
|
/**
|
113
116
|
* Determines if the primary button is on the top or bottom of the card
|
@@ -116,7 +119,6 @@ exports.ProductiveCard.propTypes = {
|
|
116
119
|
/**
|
117
120
|
* The text that's displayed in the primary button
|
118
121
|
*/
|
119
|
-
/**@ts-ignore */
|
120
122
|
primaryButtonText: index["default"].node,
|
121
123
|
/**
|
122
124
|
* Optionally specify an href for your Button to become an <a> element
|
@@ -125,7 +127,6 @@ exports.ProductiveCard.propTypes = {
|
|
125
127
|
/**
|
126
128
|
* Optional prop to allow overriding the icon rendering. Can be a React component class
|
127
129
|
*/
|
128
|
-
/**@ts-ignore */
|
129
130
|
secondaryButtonIcon: index["default"].oneOfType([index["default"].func, index["default"].object]),
|
130
131
|
/**
|
131
132
|
* Determines if the secondary button is on the top or bottom of the card
|
@@ -134,7 +135,6 @@ exports.ProductiveCard.propTypes = {
|
|
134
135
|
/**
|
135
136
|
* The text that's displayed in the secondary button
|
136
137
|
*/
|
137
|
-
/**@ts-ignore */
|
138
138
|
secondaryButtonText: index["default"].node,
|
139
139
|
/**
|
140
140
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
@@ -69,4 +69,3 @@ export { Guidebanner, GuidebannerElement, GuidebannerElementButton, GuidebannerE
|
|
69
69
|
export { InlineTip, InlineTipButton, InlineTipLink } from "./InlineTip";
|
70
70
|
export { DescriptionList, DescriptionListBody, DescriptionListCell, DescriptionListRow } from "./DescriptionList";
|
71
71
|
export { FilterPanel, FilterPanelAccordion, FilterPanelAccordionItem, FilterPanelCheckbox, FilterPanelCheckboxWithOverflow, FilterPanelGroup, FilterPanelLabel, FilterPanelSearch } from "./FilterPanel";
|
72
|
-
export { FeatureFlags as unstable_FeatureFlags, useFeatureFlag as unstable_useFeatureFlag, useFeatureFlags as unstable_useFeatureFlags } from "./FeatureFlags";
|
@@ -13,10 +13,8 @@ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHel
|
|
13
13
|
var React = require('react');
|
14
14
|
var settings = require('../../../settings.js');
|
15
15
|
var reactDom = require('react-dom');
|
16
|
-
var index = require('../../../components/FeatureFlags/index.js');
|
17
16
|
|
18
17
|
var usePortalTarget = function usePortalTarget(portalTargetIn) {
|
19
|
-
var enablePortalTarget = index.useFeatureFlag('default-portal-target-body');
|
20
18
|
var _useState = React.useState(null),
|
21
19
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
22
20
|
portalTarget = _useState2[0],
|
@@ -25,11 +23,11 @@ var usePortalTarget = function usePortalTarget(portalTargetIn) {
|
|
25
23
|
if (portalTargetIn) {
|
26
24
|
setPortalTarget(portalTargetIn);
|
27
25
|
} else {
|
28
|
-
if (settings.pkg.isFeatureEnabled('default-portal-target-body')
|
26
|
+
if (settings.pkg.isFeatureEnabled('default-portal-target-body')) {
|
29
27
|
setPortalTarget(document.body);
|
30
28
|
}
|
31
29
|
}
|
32
|
-
}, [portalTargetIn
|
30
|
+
}, [portalTargetIn]);
|
33
31
|
var renderPortalUse = React.useCallback(function (children) {
|
34
32
|
return portalTarget ? /*#__PURE__*/reactDom.createPortal(children, portalTarget) : children;
|
35
33
|
}, [portalTarget]);
|
package/lib/index.js
CHANGED
@@ -137,7 +137,6 @@ var FilterPanelLabel = require('./components/FilterPanel/FilterPanelLabel/Filter
|
|
137
137
|
var FilterPanelSearch = require('./components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js');
|
138
138
|
var ConditionBuilder = require('./components/ConditionBuilder/ConditionBuilder.js');
|
139
139
|
var GetStartedCard = require('./components/GetStartedCard/GetStartedCard.js');
|
140
|
-
var index$2 = require('./components/FeatureFlags/index.js');
|
141
140
|
|
142
141
|
|
143
142
|
|
@@ -582,6 +581,3 @@ Object.defineProperty(exports, 'GetStartedCard', {
|
|
582
581
|
enumerable: true,
|
583
582
|
get: function () { return GetStartedCard.GetStartedCard; }
|
584
583
|
});
|
585
|
-
exports.unstable_FeatureFlags = index$2.FeatureFlags;
|
586
|
-
exports.unstable_useFeatureFlag = index$2.useFeatureFlag;
|
587
|
-
exports.unstable_useFeatureFlags = index$2.useFeatureFlags;
|
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": "2.41.1-canary.
|
4
|
+
"version": "2.41.1-canary.5+e4c6a2c8e",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -17,10 +17,7 @@
|
|
17
17
|
"sideEffects": [
|
18
18
|
"**/global/js/utils/props-helper.js",
|
19
19
|
"**/*.css",
|
20
|
-
"**/*.scss"
|
21
|
-
"es/feature-flags.js",
|
22
|
-
"lib/feature-flags.js",
|
23
|
-
"src/feature-flags.js"
|
20
|
+
"**/*.scss"
|
24
21
|
],
|
25
22
|
"files": [
|
26
23
|
"css",
|
@@ -95,7 +92,6 @@
|
|
95
92
|
},
|
96
93
|
"dependencies": {
|
97
94
|
"@babel/runtime": "^7.23.9",
|
98
|
-
"@carbon/feature-flags": "^0.20.0",
|
99
95
|
"@carbon/ibm-products-styles": "^2.38.0",
|
100
96
|
"@carbon/telemetry": "^0.1.0",
|
101
97
|
"@dnd-kit/core": "^6.0.8",
|
@@ -120,5 +116,5 @@
|
|
120
116
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
121
117
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
122
118
|
},
|
123
|
-
"gitHead": "
|
119
|
+
"gitHead": "e4c6a2c8e8d42dd74abf2370331dde96c258de1c"
|
124
120
|
}
|
@@ -80,12 +80,6 @@ $row-heights: (
|
|
80
80
|
align-items: center;
|
81
81
|
}
|
82
82
|
|
83
|
-
.#{variables.$block-class}__static--outer-cell {
|
84
|
-
display: flex;
|
85
|
-
height: -webkit-fill-available;
|
86
|
-
align-items: center;
|
87
|
-
}
|
88
|
-
|
89
83
|
.#{variables.$block-class}__inline-edit--outer-cell-button {
|
90
84
|
width: 100%;
|
91
85
|
height: calc(100% + 2px); // account for borders
|