@carbon/ibm-products 1.42.1 → 1.43.0
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/css/index-full-carbon.css +154 -24
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +2 -2
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon.css +154 -24
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +2 -2
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +154 -24
- package/css/index.css.map +1 -1
- package/css/index.min.css +2 -2
- package/css/index.min.css.map +1 -1
- package/es/components/AddSelect/AddSelect.js +1 -1
- package/es/components/AddSelect/AddSelectBody.js +1 -1
- package/es/components/AddSelect/AddSelectColumn.js +1 -1
- package/es/components/Datagrid/Datagrid/Datagrid.js +3 -3
- package/es/components/Datagrid/Datagrid/DatagridContent.js +43 -15
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +2 -18
- package/es/components/Datagrid/Datagrid/DraggableElement.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +65 -34
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +436 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +8 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/constants.js +9 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/index.js +2 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +3 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useSubscribeToEventEmitter.js +23 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/index.js +3 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/motion/variants.js +55 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/utils.js +49 -17
- package/es/components/Datagrid/Datagrid.stories/index.js +0 -1
- package/es/components/Datagrid/useFiltering.js +10 -3
- package/es/components/Datagrid/utils/DatagridActions.js +59 -6
- package/lib/components/AddSelect/AddSelect.js +1 -1
- package/lib/components/AddSelect/AddSelectBody.js +1 -1
- package/lib/components/AddSelect/AddSelectColumn.js +1 -1
- package/lib/components/Datagrid/Datagrid/Datagrid.js +3 -3
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +43 -15
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +2 -17
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +64 -31
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +445 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +7 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/constants.js +15 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/index.js +20 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +3 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useSubscribeToEventEmitter.js +30 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/index.js +21 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/motion/variants.js +64 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/utils.js +48 -17
- package/lib/components/Datagrid/Datagrid.stories/index.js +0 -7
- package/lib/components/Datagrid/useFiltering.js +10 -3
- package/lib/components/Datagrid/utils/DatagridActions.js +57 -4
- package/package.json +2 -2
- package/scss/components/Datagrid/styles/_datagrid.scss +18 -18
- package/scss/components/Datagrid/styles/_draggableElement.scss +12 -4
- package/scss/components/Datagrid/styles/_index.scss +1 -0
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +7 -3
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsTearsheet.scss +5 -1
- package/scss/components/Datagrid/styles/addons/_FilterPanel.scss +123 -0
- package/scss/components/FilterSummary/_filter-summary.scss +1 -0
- package/es/components/Datagrid/Datagrid.stories/LeftPanelStory.js +0 -6
- package/lib/components/Datagrid/Datagrid.stories/LeftPanelStory.js +0 -13
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.getInitialStateFromFilters = void 0;
|
7
|
+
var _constants = require("./constants");
|
7
8
|
/**
|
8
9
|
* Copyright IBM Corp. 2022, 2022
|
9
10
|
*
|
@@ -13,33 +14,63 @@ exports.getInitialStateFromFilters = void 0;
|
|
13
14
|
|
14
15
|
// This functions takes the filters passed in and makes an object to track it's state
|
15
16
|
var getInitialStateFromFilters = function getInitialStateFromFilters(filters) {
|
17
|
+
var variation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _constants.FLYOUT;
|
16
18
|
var initialFilterState = {};
|
17
|
-
|
19
|
+
var setInitialState = function setInitialState(_ref) {
|
18
20
|
var type = _ref.type,
|
19
21
|
column = _ref.column,
|
20
22
|
props = _ref.props;
|
21
23
|
if (type === 'checkbox') {
|
22
|
-
initialFilterState[column] =
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
24
|
+
initialFilterState[column] = {
|
25
|
+
value: props.Checkbox.map(function (_ref2) {
|
26
|
+
var id = _ref2.id,
|
27
|
+
labelText = _ref2.labelText,
|
28
|
+
value = _ref2.value;
|
29
|
+
return {
|
30
|
+
id: id,
|
31
|
+
labelText: labelText,
|
32
|
+
value: value,
|
33
|
+
selected: false
|
34
|
+
};
|
35
|
+
}),
|
36
|
+
type: type
|
37
|
+
};
|
33
38
|
} else if (type === 'date') {
|
34
|
-
initialFilterState[column] =
|
39
|
+
initialFilterState[column] = {
|
40
|
+
value: [null, null],
|
41
|
+
type: type
|
42
|
+
};
|
35
43
|
} else if (type === 'number') {
|
36
|
-
initialFilterState[column] =
|
44
|
+
initialFilterState[column] = {
|
45
|
+
value: '',
|
46
|
+
type: type
|
47
|
+
};
|
37
48
|
} else if (type === 'radio') {
|
38
|
-
initialFilterState[column] =
|
49
|
+
initialFilterState[column] = {
|
50
|
+
value: '',
|
51
|
+
type: type
|
52
|
+
};
|
39
53
|
} else if (type === 'dropdown') {
|
40
|
-
initialFilterState[column] =
|
54
|
+
initialFilterState[column] = {
|
55
|
+
value: '',
|
56
|
+
type: type
|
57
|
+
};
|
41
58
|
}
|
42
|
-
}
|
59
|
+
};
|
60
|
+
if (variation === _constants.FLYOUT) {
|
61
|
+
filters.forEach(setInitialState);
|
62
|
+
} else if (variation === _constants.PANEL) {
|
63
|
+
filters.forEach(function (_ref3) {
|
64
|
+
var _ref3$filters = _ref3.filters,
|
65
|
+
sections = _ref3$filters === void 0 ? [] : _ref3$filters;
|
66
|
+
sections.forEach(function (_ref4) {
|
67
|
+
var filter = _ref4.filter;
|
68
|
+
return setInitialState(filter);
|
69
|
+
});
|
70
|
+
});
|
71
|
+
} else {
|
72
|
+
console.error('No variation passed into useInitialStateFromFilters');
|
73
|
+
}
|
43
74
|
return initialFilterState;
|
44
75
|
};
|
45
76
|
exports.getInitialStateFromFilters = getInitialStateFromFilters;
|
@@ -10,12 +10,6 @@ Object.defineProperty(exports, "CustomizeColumnStory", {
|
|
10
10
|
return _CustomizeColumnStory.story;
|
11
11
|
}
|
12
12
|
});
|
13
|
-
Object.defineProperty(exports, "LeftPanelStory", {
|
14
|
-
enumerable: true,
|
15
|
-
get: function get() {
|
16
|
-
return _LeftPanelStory.story;
|
17
|
-
}
|
18
|
-
});
|
19
13
|
Object.defineProperty(exports, "RowSizeDropdownStory", {
|
20
14
|
enumerable: true,
|
21
15
|
get: function get() {
|
@@ -37,5 +31,4 @@ Object.defineProperty(exports, "StickyActionsColumn", {
|
|
37
31
|
var _CustomizeColumnStory = require("./CustomizeColumnStory");
|
38
32
|
var _StickyActionsColumnStory = _interopRequireDefault(require("./StickyActionsColumnStory"));
|
39
33
|
var _RowSizeDropdownStory = require("./RowSizeDropdownStory");
|
40
|
-
var _LeftPanelStory = require("./LeftPanelStory");
|
41
34
|
var _SelectAllWithToggleStory = require("./SelectAllWithToggleStory");
|
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
10
10
|
var _react = require("react");
|
11
11
|
var _Filtering = require("./Datagrid/addons/Filtering");
|
12
|
+
var _constants = require("./Datagrid/addons/Filtering/constants");
|
12
13
|
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; }
|
13
14
|
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) { (0, _defineProperty2.default)(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; }
|
14
15
|
var useFiltering = function useFiltering(hooks) {
|
@@ -61,14 +62,20 @@ var useFiltering = function useFiltering(hooks) {
|
|
61
62
|
hooks.useInstance.push(function (instance) {
|
62
63
|
var filterProps = instance.filterProps,
|
63
64
|
setAllFilters = instance.setAllFilters,
|
64
|
-
|
65
|
+
setFilter = instance.setFilter,
|
66
|
+
headers = instance.headers,
|
67
|
+
data = instance.data;
|
65
68
|
var defaultProps = {
|
66
|
-
variation: 'flyout'
|
69
|
+
variation: 'flyout',
|
70
|
+
updateMethod: _constants.BATCH,
|
71
|
+
panelIconDescription: 'Open filter panel'
|
67
72
|
};
|
68
73
|
var getFilterFlyoutProps = function getFilterFlyoutProps() {
|
69
74
|
return _objectSpread(_objectSpread(_objectSpread({}, defaultProps), filterProps), {}, {
|
70
75
|
setAllFilters: setAllFilters,
|
71
|
-
|
76
|
+
setFilter: setFilter,
|
77
|
+
headers: headers,
|
78
|
+
data: data
|
72
79
|
});
|
73
80
|
};
|
74
81
|
Object.assign(instance, {
|
@@ -13,6 +13,7 @@ var _iconsReact = require("@carbon/icons-react");
|
|
13
13
|
var _addonActions = require("@storybook/addon-actions");
|
14
14
|
var _settings = require("../../../settings");
|
15
15
|
var _ButtonMenu = require("../../ButtonMenu");
|
16
|
+
var _Filtering = require("../Datagrid/addons/Filtering");
|
16
17
|
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); }
|
17
18
|
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; }
|
18
19
|
/**
|
@@ -24,6 +25,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
24
25
|
|
25
26
|
var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
26
27
|
var DatagridActions = function DatagridActions(datagridState) {
|
28
|
+
var _useContext = (0, _react.useContext)(_Filtering.FilterContext),
|
29
|
+
setLeftPanelOpen = _useContext.setLeftPanelOpen;
|
27
30
|
var selectedFlatRows = datagridState.selectedFlatRows,
|
28
31
|
setGlobalFilter = datagridState.setGlobalFilter,
|
29
32
|
CustomizeColumnsButton = datagridState.CustomizeColumnsButton,
|
@@ -32,6 +35,7 @@ var DatagridActions = function DatagridActions(datagridState) {
|
|
32
35
|
useDenseHeader = datagridState.useDenseHeader,
|
33
36
|
filterProps = datagridState.filterProps,
|
34
37
|
getFilterFlyoutProps = datagridState.getFilterFlyoutProps,
|
38
|
+
data = datagridState.data,
|
35
39
|
FilterFlyout = datagridState.FilterFlyout;
|
36
40
|
var downloadCsv = function downloadCsv() {
|
37
41
|
alert('Downloading...');
|
@@ -55,6 +59,23 @@ var DatagridActions = function DatagridActions(datagridState) {
|
|
55
59
|
var renderFilterFlyout = function renderFilterFlyout() {
|
56
60
|
return (filterProps === null || filterProps === void 0 ? void 0 : filterProps.variation) === 'flyout' && /*#__PURE__*/_react.default.createElement(FilterFlyout, getFilterFlyoutProps());
|
57
61
|
};
|
62
|
+
var renderFilterPanelButton = function renderFilterPanelButton() {
|
63
|
+
return (filterProps === null || filterProps === void 0 ? void 0 : filterProps.variation) === 'panel' && /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
64
|
+
kind: "ghost",
|
65
|
+
hasIconOnly: true,
|
66
|
+
tooltipPosition: "bottom",
|
67
|
+
renderIcon: _iconsReact.Filter16,
|
68
|
+
iconDescription: filterProps.panelIconDescription,
|
69
|
+
className: "".concat(blockClass, "-filter-panel-open-button"),
|
70
|
+
onClick: function onClick() {
|
71
|
+
return setLeftPanelOpen(function (open) {
|
72
|
+
return !open;
|
73
|
+
});
|
74
|
+
},
|
75
|
+
disabled: data.length === 0,
|
76
|
+
tooltipAlignment: "start"
|
77
|
+
});
|
78
|
+
};
|
58
79
|
var _useState = (0, _react.useState)(false),
|
59
80
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
60
81
|
modalOpen = _useState2[0],
|
@@ -76,7 +97,7 @@ var DatagridActions = function DatagridActions(datagridState) {
|
|
76
97
|
var items = ['Option 1', 'Option 2', 'Option 3'];
|
77
98
|
return isNothingSelected && (useDenseHeader && useDenseHeader ? /*#__PURE__*/_react.default.createElement(TableToolbarContent, {
|
78
99
|
size: "sm"
|
79
|
-
}, !mobileToolbar ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
100
|
+
}, !mobileToolbar ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderFilterPanelButton(), /*#__PURE__*/_react.default.createElement("div", {
|
80
101
|
style: style
|
81
102
|
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
82
103
|
kind: "ghost",
|
@@ -121,7 +142,7 @@ var DatagridActions = function DatagridActions(datagridState) {
|
|
121
142
|
itemText: "Create",
|
122
143
|
hasDivider: true,
|
123
144
|
requireTitle: true
|
124
|
-
}))) : !mobileToolbar ? /*#__PURE__*/_react.default.createElement(TableToolbarContent, null, /*#__PURE__*/_react.default.createElement(TableToolbarSearch, {
|
145
|
+
}))) : !mobileToolbar ? /*#__PURE__*/_react.default.createElement(TableToolbarContent, null, renderFilterPanelButton(), /*#__PURE__*/_react.default.createElement(TableToolbarSearch, {
|
125
146
|
size: "xl",
|
126
147
|
id: "columnSearch",
|
127
148
|
persistent: true,
|
@@ -163,7 +184,7 @@ var DatagridActions = function DatagridActions(datagridState) {
|
|
163
184
|
}), /*#__PURE__*/_react.default.createElement(_ButtonMenu.ButtonMenuItem, {
|
164
185
|
itemText: "Option 3",
|
165
186
|
onClick: (0, _addonActions.action)("Click on ButtonMenu Option 3")
|
166
|
-
}))) : /*#__PURE__*/_react.default.createElement(TableToolbarContent, null, /*#__PURE__*/_react.default.createElement(TableToolbarSearch, {
|
187
|
+
}))) : /*#__PURE__*/_react.default.createElement(TableToolbarContent, null, renderFilterPanelButton(), /*#__PURE__*/_react.default.createElement(TableToolbarSearch, {
|
167
188
|
size: "xl",
|
168
189
|
id: "columnSearch",
|
169
190
|
persistent: true,
|
@@ -171,7 +192,39 @@ var DatagridActions = function DatagridActions(datagridState) {
|
|
171
192
|
onChange: function onChange(e) {
|
172
193
|
return setGlobalFilter(e.target.value);
|
173
194
|
}
|
174
|
-
}), /*#__PURE__*/_react.default.createElement(
|
195
|
+
}), renderFilterFlyout(), /*#__PURE__*/_react.default.createElement(RowSizeDropdown, rowSizeDropdownProps), /*#__PURE__*/_react.default.createElement("div", {
|
196
|
+
style: style
|
197
|
+
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
198
|
+
kind: "ghost",
|
199
|
+
hasIconOnly: true,
|
200
|
+
tooltipPosition: "bottom",
|
201
|
+
renderIcon: _iconsReact.Restart16,
|
202
|
+
iconDescription: 'Refresh',
|
203
|
+
onClick: refreshColumns
|
204
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
205
|
+
style: style
|
206
|
+
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
207
|
+
kind: "ghost",
|
208
|
+
hasIconOnly: true,
|
209
|
+
tooltipPosition: "bottom",
|
210
|
+
renderIcon: _iconsReact.Download16,
|
211
|
+
iconDescription: 'Download CSV',
|
212
|
+
onClick: downloadCsv
|
213
|
+
})), CustomizeColumnsButton && /*#__PURE__*/_react.default.createElement("div", {
|
214
|
+
style: style
|
215
|
+
}, /*#__PURE__*/_react.default.createElement(CustomizeColumnsButton, null)), /*#__PURE__*/_react.default.createElement(_ButtonMenu.ButtonMenu, {
|
216
|
+
label: "Primary button",
|
217
|
+
renderIcon: _iconsReact.Add16
|
218
|
+
}, /*#__PURE__*/_react.default.createElement(_ButtonMenu.ButtonMenuItem, {
|
219
|
+
itemText: "Option 1",
|
220
|
+
onClick: (0, _addonActions.action)("Click on ButtonMenu Option 1")
|
221
|
+
}), /*#__PURE__*/_react.default.createElement(_ButtonMenu.ButtonMenuItem, {
|
222
|
+
itemText: "Option 2",
|
223
|
+
onClick: (0, _addonActions.action)("Click on ButtonMenu Option 2")
|
224
|
+
}), /*#__PURE__*/_react.default.createElement(_ButtonMenu.ButtonMenuItem, {
|
225
|
+
itemText: "Option 3",
|
226
|
+
onClick: (0, _addonActions.action)("Click on ButtonMenu Option 3")
|
227
|
+
})), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.OverflowMenu, {
|
175
228
|
ariaLabel: "Tools",
|
176
229
|
size: "lg",
|
177
230
|
flipped: true,
|
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.
|
4
|
+
"version": "1.43.0",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -95,5 +95,5 @@
|
|
95
95
|
"react": "^16.8.6 || ^17.0.1",
|
96
96
|
"react-dom": "^16.8.6 || ^17.0.1"
|
97
97
|
},
|
98
|
-
"gitHead": "
|
98
|
+
"gitHead": "5227b2c4f26128f471144febc117c9e8cb607c7a"
|
99
99
|
}
|
@@ -368,12 +368,6 @@
|
|
368
368
|
flex-direction: row;
|
369
369
|
}
|
370
370
|
|
371
|
-
.#{$block-class}__datagridLeftPanel {
|
372
|
-
display: flex;
|
373
|
-
width: 388px; // as per UX specs.
|
374
|
-
background-color: $ui-01;
|
375
|
-
}
|
376
|
-
|
377
371
|
.#{$block-class}__leftPanel-position {
|
378
372
|
display: inherit;
|
379
373
|
}
|
@@ -381,38 +375,44 @@
|
|
381
375
|
.#{$block-class}__datagridWithPanel {
|
382
376
|
position: relative;
|
383
377
|
display: flex;
|
384
|
-
width: 100%;
|
385
378
|
height: 100%;
|
386
379
|
flex-direction: column;
|
387
380
|
|
388
381
|
.#{$block-class}__grid-container {
|
389
382
|
display: flex;
|
390
|
-
overflow:
|
383
|
+
overflow: visible;
|
391
384
|
flex-direction: column;
|
392
385
|
}
|
393
386
|
|
394
|
-
.#{$block-class}__table-toolbar {
|
395
|
-
width: 100%;
|
396
|
-
}
|
397
|
-
|
398
|
-
.#{$block-class}__datagridLeftPanel {
|
399
|
-
flex: 0 0 auto;
|
400
|
-
}
|
401
|
-
|
402
387
|
.#{$carbon-prefix}--data-table-content {
|
403
388
|
flex: 1 1 0%;
|
404
389
|
}
|
390
|
+
|
405
391
|
.#{$block-class}__table-container {
|
392
|
+
display: flex;
|
393
|
+
overflow: visible;
|
394
|
+
background-color: $ui-01;
|
395
|
+
}
|
396
|
+
|
397
|
+
.#{$block-class}__table-container-inner {
|
406
398
|
overflow: hidden;
|
399
|
+
flex: 1;
|
400
|
+
}
|
401
|
+
|
402
|
+
.#{$block-class}__table-container .#{$block-class}__filter-summary {
|
403
|
+
border-bottom: 1px solid $ui-03;
|
404
|
+
}
|
405
|
+
|
406
|
+
.#{$pkg-prefix}--datagrid__table-simple {
|
407
|
+
height: 100%;
|
407
408
|
}
|
408
409
|
}
|
409
410
|
|
410
411
|
.#{$block-class}__table-container {
|
411
412
|
position: relative;
|
412
|
-
display: flex;
|
413
|
-
overflow: auto;
|
414
413
|
width: 100%;
|
415
414
|
max-height: 100%;
|
415
|
+
overflow-y: scroll;
|
416
416
|
}
|
417
417
|
|
418
418
|
.#{$block-class}__carbon-row-expanded {
|
@@ -19,13 +19,12 @@
|
|
19
19
|
}
|
20
20
|
|
21
21
|
.#{$block-class}__draggable-handleStyle.disabled svg {
|
22
|
-
fill: $disabled-
|
22
|
+
fill: $disabled-03;
|
23
23
|
}
|
24
24
|
|
25
25
|
.#{$block-class}__draggable-handleHolder {
|
26
26
|
display: flex;
|
27
27
|
height: $spacing-09;
|
28
|
-
padding-left: $spacing-05;
|
29
28
|
border-bottom: 1px solid $layer-active;
|
30
29
|
background-color: $layer;
|
31
30
|
}
|
@@ -37,7 +36,6 @@
|
|
37
36
|
.#{$block-class}__draggable-handleHolder-selected {
|
38
37
|
display: flex;
|
39
38
|
height: $spacing-09;
|
40
|
-
padding-left: $spacing-05;
|
41
39
|
border-bottom: 1px solid $layer-active;
|
42
40
|
background-color: $layer-selected;
|
43
41
|
}
|
@@ -48,13 +46,23 @@
|
|
48
46
|
|
49
47
|
.#{$block-class}__draggable-handleHolder-isOver {
|
50
48
|
border: 2px dashed $focus;
|
51
|
-
|
49
|
+
/* stylelint-disable-next-line carbon/theme-token-use */
|
50
|
+
background-color: $blue-10;
|
52
51
|
}
|
53
52
|
|
54
53
|
.#{$block-class}__draggable-handleHolder-droppable {
|
55
54
|
display: flex;
|
56
55
|
width: 100%;
|
57
56
|
align-items: center;
|
57
|
+
padding-left: $spacing-05;
|
58
|
+
/* stylelint-disable-next-line carbon/type-token-use */
|
59
|
+
line-height: 1; // center align text within row
|
60
|
+
transition-property: opacity;
|
61
|
+
}
|
62
|
+
|
63
|
+
.#{$block-class}__draggable-handleHolder-droppable.#{$block-class}__draggable-handleHolder-droppable--origin {
|
64
|
+
opacity: 0.5;
|
65
|
+
transition: opacity $duration--moderate-01 motion(entrance, productive);
|
58
66
|
}
|
59
67
|
|
60
68
|
.#{$block-class}__draggable-handleHolder-grabbed {
|
@@ -129,7 +129,7 @@ $row-heights: (
|
|
129
129
|
background-color: $hover-selected-ui;
|
130
130
|
color: $text-01;
|
131
131
|
.#{$block-class}__inline-edit-button-icon {
|
132
|
-
|
132
|
+
color: $icon-01;
|
133
133
|
}
|
134
134
|
}
|
135
135
|
|
@@ -137,9 +137,13 @@ $row-heights: (
|
|
137
137
|
.#{$block-class}__inline-edit-button.#{$block-class}__inline-edit-button--active:not(
|
138
138
|
[data-disabled='true']
|
139
139
|
) {
|
140
|
-
background-color: $
|
141
|
-
color: $text-
|
140
|
+
background-color: $field-01;
|
141
|
+
color: $text-02;
|
142
142
|
cursor: text;
|
143
|
+
|
144
|
+
.#{$block-class}__inline-edit-button-icon {
|
145
|
+
color: $icon-02;
|
146
|
+
}
|
143
147
|
}
|
144
148
|
|
145
149
|
.#{$block-class}__inline-edit--outer-cell-button
|
@@ -23,7 +23,11 @@
|
|
23
23
|
.#{$block-class}__customize-columns-checkbox-wrapper {
|
24
24
|
display: flex;
|
25
25
|
justify-content: center;
|
26
|
-
padding-left: $spacing-
|
26
|
+
padding-left: $spacing-02;
|
27
|
+
}
|
28
|
+
|
29
|
+
.#{$block-class}__customize-columns-column-list
|
30
|
+
.#{$block-class}__customize-columns-checkbox-wrapper.#{$carbon-prefix}--form-item {
|
27
31
|
margin-bottom: 0;
|
28
32
|
}
|
29
33
|
|
@@ -0,0 +1,123 @@
|
|
1
|
+
/*
|
2
|
+
* Licensed Materials - Property of IBM
|
3
|
+
* 5724-Q36
|
4
|
+
* (c) Copyright IBM Corp. 2022
|
5
|
+
* US Government Users Restricted Rights - Use, duplication or disclosure
|
6
|
+
* restricted by GSA ADP Schedule Contract with IBM Corp.
|
7
|
+
*/
|
8
|
+
|
9
|
+
@import '../variables';
|
10
|
+
|
11
|
+
.#{$block-class}-filter-panel__container {
|
12
|
+
position: relative;
|
13
|
+
width: rem(320px);
|
14
|
+
height: clamp(var(--filter-panel-min-height), 100%, 100vh);
|
15
|
+
border-top: 1px $ui-03 solid;
|
16
|
+
background-color: $ui-01;
|
17
|
+
}
|
18
|
+
|
19
|
+
.#{$block-class}-filter-panel--open {
|
20
|
+
border-right: 1px $ui-03 solid;
|
21
|
+
}
|
22
|
+
|
23
|
+
.#{$block-class}-filter-panel__container::before {
|
24
|
+
position: absolute;
|
25
|
+
top: -1px; // stylelint-disable-line
|
26
|
+
left: 0;
|
27
|
+
display: block;
|
28
|
+
width: rem(47px); // size of filter panel button
|
29
|
+
height: 1px;
|
30
|
+
background-color: $ui-01;
|
31
|
+
content: '';
|
32
|
+
}
|
33
|
+
|
34
|
+
.#{$block-class}-filter-panel__inner-container {
|
35
|
+
position: relative;
|
36
|
+
z-index: 0;
|
37
|
+
overflow: auto;
|
38
|
+
padding: 0 $spacing-05;
|
39
|
+
overscroll-behavior: contain;
|
40
|
+
}
|
41
|
+
|
42
|
+
// Adds extra space to the last category so the scroll shows everything visible when you reach the bottom
|
43
|
+
.#{$block-class}-filter-panel__inner-container
|
44
|
+
.#{$block-class}-filter-panel__category:last-of-type {
|
45
|
+
padding-bottom: $spacing-11;
|
46
|
+
}
|
47
|
+
|
48
|
+
.#{$block-class}-filter-panel {
|
49
|
+
position: sticky;
|
50
|
+
top: 0;
|
51
|
+
}
|
52
|
+
|
53
|
+
.#{$block-class}-filter-panel__heading {
|
54
|
+
display: flex;
|
55
|
+
justify-content: space-between;
|
56
|
+
padding-left: $spacing-05;
|
57
|
+
border-bottom: 1px solid transparent;
|
58
|
+
}
|
59
|
+
|
60
|
+
.#{$block-class}-filter-panel__heading--with-divider {
|
61
|
+
border-bottom: 1px solid $ui-03;
|
62
|
+
}
|
63
|
+
|
64
|
+
.#{$block-class}-filter-panel__title {
|
65
|
+
padding: $spacing-05 0;
|
66
|
+
@include carbon--type-style('productive-heading-02');
|
67
|
+
}
|
68
|
+
|
69
|
+
.#{$block-class}-filter-panel__search {
|
70
|
+
padding: 0 $spacing-05 $spacing-06;
|
71
|
+
}
|
72
|
+
|
73
|
+
.#{$block-class}-filter-panel__category-title {
|
74
|
+
@include carbon--type-style('heading-01');
|
75
|
+
|
76
|
+
margin-bottom: $spacing-05;
|
77
|
+
color: $text-02;
|
78
|
+
}
|
79
|
+
|
80
|
+
.#{$block-class}-filter-panel__category {
|
81
|
+
padding-bottom: $spacing-06;
|
82
|
+
}
|
83
|
+
|
84
|
+
// This selects all filter elements inside of categories and give them 16px margin bottom
|
85
|
+
.#{$block-class}-filter-panel__category
|
86
|
+
> *:not(.c4p--datagrid-filter-panel__category-title, .bx--accordion) {
|
87
|
+
margin-bottom: $spacing-05;
|
88
|
+
}
|
89
|
+
|
90
|
+
.#{$block-class}-filter-panel__action-set {
|
91
|
+
position: sticky;
|
92
|
+
z-index: 1; // To layer action set on top of content behind when sticky
|
93
|
+
bottom: 0;
|
94
|
+
height: rem(64px);
|
95
|
+
margin-top: auto;
|
96
|
+
}
|
97
|
+
|
98
|
+
// Overrides
|
99
|
+
.#{$block-class}-filter-panel__container .#{$carbon-prefix}--accordion__title {
|
100
|
+
margin: 0;
|
101
|
+
}
|
102
|
+
|
103
|
+
.#{$block-class}-filter-panel__container .#{$carbon-prefix}--accordion__arrow {
|
104
|
+
margin: $spacing-01 0 0;
|
105
|
+
}
|
106
|
+
|
107
|
+
.#{$block-class}-filter-panel__container
|
108
|
+
.#{$carbon-prefix}--accordion__content {
|
109
|
+
padding-right: 0;
|
110
|
+
padding-left: 0;
|
111
|
+
}
|
112
|
+
|
113
|
+
// Makes sure every child (filter) inside the accordion content has space in between
|
114
|
+
.#{$block-class}-filter-panel__container
|
115
|
+
.#{$carbon-prefix}--accordion__content
|
116
|
+
> *:not(:last-child) {
|
117
|
+
margin-bottom: $spacing-05;
|
118
|
+
}
|
119
|
+
|
120
|
+
.#{$carbon-prefix}--btn.c4p--datagrid-filter-panel-open-button {
|
121
|
+
border-right: 1px solid $ui-03;
|
122
|
+
border-bottom: none;
|
123
|
+
}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
var notes = "\n# Access left side panel in data grid\nAllow users to access left panel in datagrid.\n\n## Documentation:\n\n- (required) Implement `options.leftPanel` which has the following props\n - `options.leftPanel.isOpen` value is toggled by the Button onClick from DatagridActions\n - render `options.leftPanel.panelContent` inside the panel container of data grid when isOpen is true\n\ncode snippet:\n\n```js\nconst columns = React.useMemo(() => defaultHeader, []);\n const [data] = useState(makeData(10));\n const [isPanelOpen, setIsPanelOpen] = useState(false);\n const DatagridActions = (datagridState) => (\n <TableToolbarContent>\n <Button onClick={() => { setIsPanelOpen(!isPanelOpen); }}>Click to toggle left panel</Button>\n <TableToolbarSearch ... />\n <Button ... />\n <datagridState.CustomizeColumnsButton />\n </TableToolbarContent>\n )\n const datagridState = useDatagrid(\n {\n columns,\n data,\n leftPanel: {\n isOpen: isPanelOpen,\n panelContent: <div>Panel content will go here along with any button interactions</div>,\n },\n initialState: {\n hiddenColumns: ['age'],\n columnOrder: [],\n },\n customizeColumnsProps: {\n onSaveColumnPrefs: (newColDefs) => {\n console.log(newColDefs);\n },\n },\n DatagridActions,\n },\n );\n\nreturn (\n <Wrapper>\n <IntlProvider locale=\"en\">\n <Datagrid {...datagridState} />\n </IntlProvider>\n </Wrapper>\n);\n```\n";
|
2
|
-
export var story = {
|
3
|
-
parameters: {
|
4
|
-
notes: notes
|
5
|
-
}
|
6
|
-
};
|
@@ -1,13 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.story = void 0;
|
7
|
-
var notes = "\n# Access left side panel in data grid\nAllow users to access left panel in datagrid.\n\n## Documentation:\n\n- (required) Implement `options.leftPanel` which has the following props\n - `options.leftPanel.isOpen` value is toggled by the Button onClick from DatagridActions\n - render `options.leftPanel.panelContent` inside the panel container of data grid when isOpen is true\n\ncode snippet:\n\n```js\nconst columns = React.useMemo(() => defaultHeader, []);\n const [data] = useState(makeData(10));\n const [isPanelOpen, setIsPanelOpen] = useState(false);\n const DatagridActions = (datagridState) => (\n <TableToolbarContent>\n <Button onClick={() => { setIsPanelOpen(!isPanelOpen); }}>Click to toggle left panel</Button>\n <TableToolbarSearch ... />\n <Button ... />\n <datagridState.CustomizeColumnsButton />\n </TableToolbarContent>\n )\n const datagridState = useDatagrid(\n {\n columns,\n data,\n leftPanel: {\n isOpen: isPanelOpen,\n panelContent: <div>Panel content will go here along with any button interactions</div>,\n },\n initialState: {\n hiddenColumns: ['age'],\n columnOrder: [],\n },\n customizeColumnsProps: {\n onSaveColumnPrefs: (newColDefs) => {\n console.log(newColDefs);\n },\n },\n DatagridActions,\n },\n );\n\nreturn (\n <Wrapper>\n <IntlProvider locale=\"en\">\n <Datagrid {...datagridState} />\n </IntlProvider>\n </Wrapper>\n);\n```\n";
|
8
|
-
var story = {
|
9
|
-
parameters: {
|
10
|
-
notes: notes
|
11
|
-
}
|
12
|
-
};
|
13
|
-
exports.story = story;
|