@carbon/ibm-products 1.27.0 → 1.32.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 +570 -80
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +3 -3
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +942 -23
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +3 -3
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +569 -79
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +3 -3
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +570 -80
- package/css/index.css.map +1 -1
- package/css/index.min.css +3 -3
- package/css/index.min.css.map +1 -1
- package/es/components/AddSelect/AddSelect.js +0 -3
- package/es/components/AddSelect/AddSelectBody.js +20 -3
- package/es/components/AddSelect/AddSelectBreadcrumbs.js +11 -3
- package/es/components/AddSelect/AddSelectColumn.js +4 -3
- package/es/components/AddSelect/AddSelectFilter.js +4 -3
- package/es/components/AddSelect/AddSelectList.js +40 -14
- package/es/components/Card/Card.js +16 -6
- package/es/components/Card/CardFooter.js +3 -1
- package/es/components/Card/CardHeader.js +20 -1
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +63 -11
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
- package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +31 -0
- package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
- package/es/components/Datagrid/Datagrid/Datagrid.js +10 -38
- package/es/components/Datagrid/Datagrid/DatagridContent.js +127 -0
- package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -3
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +12 -3
- package/es/components/Datagrid/Datagrid/DraggableElement.js +5 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +5 -40
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +35 -10
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +61 -24
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +60 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +467 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +112 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +27 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +39 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +19 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +263 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +66 -0
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +6 -5
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +1 -2
- package/es/components/Datagrid/index.js +3 -1
- package/es/components/Datagrid/useActionsColumn.js +28 -12
- package/es/components/Datagrid/useColumnOrder.js +8 -0
- package/es/components/Datagrid/useCustomizeColumns.js +5 -0
- package/es/components/Datagrid/useDisableSelectRows.js +6 -2
- package/es/components/Datagrid/useExpandedRow.js +0 -1
- package/es/components/Datagrid/useInlineEdit.js +71 -0
- package/es/components/Datagrid/useNestedRowExpander.js +42 -0
- package/es/components/Datagrid/useNestedRows.js +2 -2
- package/es/components/Datagrid/useRowSize.js +17 -6
- package/es/components/Datagrid/useSelectAllToggle.js +17 -4
- package/es/components/Datagrid/useSelectRows.js +12 -2
- package/es/components/Datagrid/useStickyColumn.js +11 -0
- package/es/components/Datagrid/utils/DatagridActions.js +121 -0
- package/es/components/Datagrid/utils/DatagridPagination.js +33 -0
- package/es/components/Datagrid/utils/Wrapper.js +21 -0
- package/es/components/Datagrid/utils/getArgTypes.js +85 -0
- package/es/components/Datagrid/utils/getInlineEditColumns.js +121 -0
- package/es/components/Datagrid/utils/makeData.js +17 -1
- package/es/components/ImportModal/ImportModal.js +2 -2
- package/es/components/InlineEdit/InlineEdit.js +4 -2
- package/es/components/ProductiveCard/ProductiveCard.js +5 -0
- package/es/components/index.js +1 -1
- package/es/global/js/hooks/useClickOutside.js +1 -1
- package/es/global/js/package-settings.js +3 -3
- package/es/global/js/utils/rangeWithCallback.js +13 -0
- package/es/global/js/utils/story-helper.js +5 -1
- package/es/global/js/utils/uuidv4.spec.js +4 -0
- package/lib/components/AddSelect/AddSelect.js +0 -4
- package/lib/components/AddSelect/AddSelectBody.js +20 -3
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +14 -3
- package/lib/components/AddSelect/AddSelectColumn.js +3 -2
- package/lib/components/AddSelect/AddSelectFilter.js +3 -2
- package/lib/components/AddSelect/AddSelectList.js +39 -13
- package/lib/components/Card/Card.js +16 -6
- package/lib/components/Card/CardFooter.js +3 -1
- package/lib/components/Card/CardHeader.js +21 -1
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +63 -10
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
- package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +42 -0
- package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
- package/lib/components/Datagrid/Datagrid/Datagrid.js +12 -45
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +160 -0
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +12 -3
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +14 -3
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +5 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +12 -41
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +47 -25
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +59 -23
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +76 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +13 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +491 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +13 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +129 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +36 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +19 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +45 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +28 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +272 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +78 -0
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +6 -5
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +1 -2
- package/lib/components/Datagrid/index.js +17 -1
- package/lib/components/Datagrid/useActionsColumn.js +28 -13
- package/lib/components/Datagrid/useColumnOrder.js +17 -0
- package/lib/components/Datagrid/useCustomizeColumns.js +5 -0
- package/lib/components/Datagrid/useDisableSelectRows.js +6 -2
- package/lib/components/Datagrid/useExpandedRow.js +0 -1
- package/lib/components/Datagrid/useInlineEdit.js +85 -0
- package/lib/components/Datagrid/useNestedRowExpander.js +57 -0
- package/lib/components/Datagrid/useNestedRows.js +3 -3
- package/lib/components/Datagrid/useRowSize.js +18 -13
- package/lib/components/Datagrid/useSelectAllToggle.js +18 -4
- package/lib/components/Datagrid/useSelectRows.js +12 -2
- package/lib/components/Datagrid/useStickyColumn.js +11 -0
- package/lib/components/Datagrid/utils/DatagridActions.js +139 -0
- package/lib/components/Datagrid/utils/DatagridPagination.js +46 -0
- package/lib/components/Datagrid/utils/Wrapper.js +33 -0
- package/lib/components/Datagrid/utils/getArgTypes.js +93 -0
- package/lib/components/Datagrid/utils/getInlineEditColumns.js +133 -0
- package/lib/components/Datagrid/utils/makeData.js +17 -1
- package/lib/components/ImportModal/ImportModal.js +2 -2
- package/lib/components/InlineEdit/InlineEdit.js +4 -2
- package/lib/components/ProductiveCard/ProductiveCard.js +5 -0
- package/lib/components/index.js +12 -0
- package/lib/global/js/hooks/useClickOutside.js +1 -1
- package/lib/global/js/package-settings.js +3 -3
- package/lib/global/js/utils/rangeWithCallback.js +22 -0
- package/lib/global/js/utils/story-helper.js +5 -1
- package/lib/global/js/utils/uuidv4.spec.js +4 -0
- package/package.json +13 -13
- package/scss/components/AddSelect/_add-select.scss +126 -28
- package/scss/components/Card/_card.scss +1 -0
- package/scss/components/Cascade/_cascade.scss +1 -1
- package/scss/components/CreateTearsheet/_create-tearsheet.scss +1 -0
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +18 -1
- package/scss/components/Datagrid/_storybook-styles.scss +1 -1
- package/scss/components/Datagrid/styles/_datagrid.scss +27 -4
- package/scss/components/Datagrid/styles/_draggableElement.scss +26 -9
- package/scss/components/Datagrid/styles/_index.scss +1 -0
- package/scss/components/Datagrid/styles/_useActionsColumn.scss +12 -0
- package/scss/components/Datagrid/styles/_useExpandedRow.scss +30 -0
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +211 -0
- package/scss/components/Datagrid/styles/_useNestedRows.scss +15 -1
- package/scss/components/Datagrid/styles/_useStickyColumn.scss +30 -2
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsModal.scss +44 -6
- package/scss/components/NotificationsPanel/_notifications-panel.scss +5 -6
- package/scss/components/ProductiveCard/_productive-card.scss +39 -0
- package/scss/components/RemoveModal/_remove-modal.scss +0 -4
- package/scss/components/SidePanel/_side-panel.scss +4 -6
- package/scss/components/_index-released-only.scss +1 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ARG_TYPES = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Copyright IBM Corp. 2022, 2022
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
var ARG_TYPES = {
|
|
15
|
+
gridTitle: {
|
|
16
|
+
name: 'gridTitle',
|
|
17
|
+
control: 'text',
|
|
18
|
+
description: 'This sets the title text for the Datagrid component. _This value is set/passed inside of the `datagridState` object._',
|
|
19
|
+
type: {
|
|
20
|
+
name: 'string',
|
|
21
|
+
required: false
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
gridDescription: {
|
|
25
|
+
name: 'gridDescription',
|
|
26
|
+
control: 'text',
|
|
27
|
+
description: 'This sets the description text for the Datagrid component. _This value is set/passed inside of the `datagridState` object._',
|
|
28
|
+
type: {
|
|
29
|
+
name: 'string',
|
|
30
|
+
required: false
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
emptyStateTitle: {
|
|
34
|
+
name: 'emptyStateTitle',
|
|
35
|
+
control: 'text',
|
|
36
|
+
description: 'This sets the empty state title text for the Datagrid component. _This value is set/passed inside of the `datagridState` object._',
|
|
37
|
+
type: {
|
|
38
|
+
name: 'string',
|
|
39
|
+
required: false
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
emptyStateDescription: {
|
|
43
|
+
name: 'emptyStateDescription',
|
|
44
|
+
control: 'text',
|
|
45
|
+
description: 'This sets the empty state description text for the Datagrid component. _This value is set/passed inside of the `datagridState` object._',
|
|
46
|
+
type: {
|
|
47
|
+
name: 'string',
|
|
48
|
+
required: false
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
emptyStateSize: {
|
|
52
|
+
control: 'select',
|
|
53
|
+
options: ['sm', 'lg']
|
|
54
|
+
},
|
|
55
|
+
useDenseHeader: {
|
|
56
|
+
control: {
|
|
57
|
+
type: 'radio'
|
|
58
|
+
},
|
|
59
|
+
options: [true, false],
|
|
60
|
+
description: 'This sets the dense header option for the Datagrid component. _This value is set/passed inside of the `datagridState` object._'
|
|
61
|
+
},
|
|
62
|
+
rowSize: {
|
|
63
|
+
control: 'select',
|
|
64
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
65
|
+
description: 'This sets the height for each row of the Datagrid component. _This value is set/passed inside of the `datagridState` object._'
|
|
66
|
+
},
|
|
67
|
+
rowSizes: {
|
|
68
|
+
control: 'object',
|
|
69
|
+
description: 'This array of objects specifies the different row size options that will render from the settings icon in the table actions. _This value is set/passed inside of the `datagridState` object._'
|
|
70
|
+
},
|
|
71
|
+
onRowSizeChange: {
|
|
72
|
+
description: 'Callback function that is called on row size changes. _This value is set/passed inside of the `datagridState` object._'
|
|
73
|
+
},
|
|
74
|
+
rowActions: {
|
|
75
|
+
control: 'object',
|
|
76
|
+
description: 'This array of objects renders the action buttons for each row in the Datagrid. _This value is set/passed inside of the `datagridState` object._',
|
|
77
|
+
action: 'Row action onClick'
|
|
78
|
+
},
|
|
79
|
+
batchActions: {
|
|
80
|
+
control: {
|
|
81
|
+
type: 'radio'
|
|
82
|
+
},
|
|
83
|
+
options: [true, false],
|
|
84
|
+
description: 'This will allow the Datagrid component to use batch actions. _This value is set/passed inside of the `datagridState` object._'
|
|
85
|
+
},
|
|
86
|
+
expandedContentHeight: {
|
|
87
|
+
control: {
|
|
88
|
+
type: 'number'
|
|
89
|
+
},
|
|
90
|
+
description: 'This value controls the height of the expanded content area. _This value is set/passed inside of the `datagridState` object._'
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
exports.ARG_TYPES = ARG_TYPES;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.inlineEditSelectItems = exports.getInlineEditColumns = void 0;
|
|
7
|
+
|
|
8
|
+
var _iconsReact = require("@carbon/icons-react");
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Copyright IBM Corp. 2022, 2022
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
var inlineEditSelectItems = [{
|
|
17
|
+
id: 'option-0',
|
|
18
|
+
icon: _iconsReact.ChartColumnFloating16,
|
|
19
|
+
text: 'Column Chart'
|
|
20
|
+
}, {
|
|
21
|
+
id: 'option-1',
|
|
22
|
+
icon: _iconsReact.ChartBubble16,
|
|
23
|
+
text: 'Bubble Chart'
|
|
24
|
+
}, {
|
|
25
|
+
id: 'option-2',
|
|
26
|
+
icon: _iconsReact.ChartVennDiagram16,
|
|
27
|
+
text: 'Venn Diagram'
|
|
28
|
+
}];
|
|
29
|
+
exports.inlineEditSelectItems = inlineEditSelectItems;
|
|
30
|
+
|
|
31
|
+
var getInlineEditColumns = function getInlineEditColumns() {
|
|
32
|
+
return [{
|
|
33
|
+
Header: 'Row Index',
|
|
34
|
+
accessor: function accessor(row, i) {
|
|
35
|
+
return i;
|
|
36
|
+
},
|
|
37
|
+
id: 'rowIndex' // id is required when accessor is a function.
|
|
38
|
+
|
|
39
|
+
}, {
|
|
40
|
+
Header: 'First Name',
|
|
41
|
+
accessor: 'firstName',
|
|
42
|
+
inlineEdit: {
|
|
43
|
+
type: 'text',
|
|
44
|
+
inputProps: {} // These props are passed to the Carbon component used for inline editing
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
Header: 'Last Name',
|
|
49
|
+
accessor: 'lastName',
|
|
50
|
+
inlineEdit: {
|
|
51
|
+
type: 'text',
|
|
52
|
+
inputProps: {} // These props are passed to the Carbon component used for inline editing
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
Header: 'Age',
|
|
57
|
+
accessor: 'age',
|
|
58
|
+
width: 120,
|
|
59
|
+
inlineEdit: {
|
|
60
|
+
type: 'number',
|
|
61
|
+
inputProps: {} // These props are passed to the Carbon component used for inline editing
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
Header: 'Visits',
|
|
66
|
+
accessor: 'visits',
|
|
67
|
+
width: 120,
|
|
68
|
+
inlineEdit: {
|
|
69
|
+
type: 'number',
|
|
70
|
+
inputProps: {} // These props are passed to the Carbon component used for inline editing
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
Header: 'Active since',
|
|
75
|
+
accessor: 'activeSince',
|
|
76
|
+
inlineEdit: {
|
|
77
|
+
type: 'date',
|
|
78
|
+
inputProps: {
|
|
79
|
+
// optionally pass props here to be passed through to Carbon's DatePicker component
|
|
80
|
+
onChange: function onChange(newDateObj, cell) {
|
|
81
|
+
console.log(newDateObj, cell);
|
|
82
|
+
},
|
|
83
|
+
labelText: 'Change active since date',
|
|
84
|
+
// optionally pass props here to be passed through to Carbon's DatePickerInput component
|
|
85
|
+
datePickerInputProps: {
|
|
86
|
+
labelText: 'Change active since date'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
Header: 'Chart type',
|
|
92
|
+
accessor: 'chartType',
|
|
93
|
+
inlineEdit: {
|
|
94
|
+
type: 'selection',
|
|
95
|
+
inputProps: {
|
|
96
|
+
// These props are passed to the Carbon component used for inline editing
|
|
97
|
+
items: inlineEditSelectItems,
|
|
98
|
+
onChange: function onChange(item) {
|
|
99
|
+
return console.log(item);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
Header: 'Someone 2',
|
|
105
|
+
accessor: 'someone2'
|
|
106
|
+
}, {
|
|
107
|
+
Header: 'Someone 3',
|
|
108
|
+
accessor: 'someone3'
|
|
109
|
+
}, {
|
|
110
|
+
Header: 'Someone 4',
|
|
111
|
+
accessor: 'someone4'
|
|
112
|
+
}, {
|
|
113
|
+
Header: 'Someone 5',
|
|
114
|
+
accessor: 'someone5'
|
|
115
|
+
}, {
|
|
116
|
+
Header: 'Someone 6',
|
|
117
|
+
accessor: 'someone6'
|
|
118
|
+
}, {
|
|
119
|
+
Header: 'Someone 7',
|
|
120
|
+
accessor: 'someone7'
|
|
121
|
+
}, {
|
|
122
|
+
Header: 'Someone 8',
|
|
123
|
+
accessor: 'someone8'
|
|
124
|
+
}, {
|
|
125
|
+
Header: 'Someone 9',
|
|
126
|
+
accessor: 'someone9'
|
|
127
|
+
}, {
|
|
128
|
+
Header: 'Someone 10',
|
|
129
|
+
accessor: 'someone10'
|
|
130
|
+
}];
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
exports.getInlineEditColumns = getInlineEditColumns;
|
|
@@ -13,10 +13,18 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
13
|
|
|
14
14
|
var _namor = _interopRequireDefault(require("namor"));
|
|
15
15
|
|
|
16
|
+
var _getInlineEditColumns = require("./getInlineEditColumns");
|
|
17
|
+
|
|
16
18
|
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; }
|
|
17
19
|
|
|
18
20
|
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; }
|
|
19
21
|
|
|
22
|
+
var getRandomInteger = function getRandomInteger(min, max) {
|
|
23
|
+
min = Math.ceil(min);
|
|
24
|
+
max = Math.floor(max);
|
|
25
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
26
|
+
};
|
|
27
|
+
|
|
20
28
|
var makeData = function makeData() {
|
|
21
29
|
for (var _len = arguments.length, lens = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22
30
|
lens[_key] = arguments[_key];
|
|
@@ -51,6 +59,12 @@ exports.range = range;
|
|
|
51
59
|
|
|
52
60
|
var newPerson = function newPerson() {
|
|
53
61
|
var statusChance = Math.random();
|
|
62
|
+
var initialChartTypeIndex = getRandomInteger(0, 2);
|
|
63
|
+
var activeSinceDate = new Date();
|
|
64
|
+
var yesterdayDate = new Date();
|
|
65
|
+
yesterdayDate.setDate(yesterdayDate.getDate() - 1);
|
|
66
|
+
var twoDaysAgoDate = new Date();
|
|
67
|
+
twoDaysAgoDate.setDate(twoDaysAgoDate.getDate() - 2);
|
|
54
68
|
return {
|
|
55
69
|
firstName: _namor.default.generate({
|
|
56
70
|
words: 1,
|
|
@@ -143,7 +157,9 @@ var newPerson = function newPerson() {
|
|
|
143
157
|
words: 1,
|
|
144
158
|
numbers: 0
|
|
145
159
|
}),
|
|
146
|
-
status: statusChance > 0.66 ? 'relationship' : statusChance > 0.33 ? 'complicated' : 'single'
|
|
160
|
+
status: statusChance > 0.66 ? 'relationship' : statusChance > 0.33 ? 'complicated' : 'single',
|
|
161
|
+
chartType: initialChartTypeIndex === 0 ? _getInlineEditColumns.inlineEditSelectItems[0] : initialChartTypeIndex === 1 ? _getInlineEditColumns.inlineEditSelectItems[1] : _getInlineEditColumns.inlineEditSelectItems[2],
|
|
162
|
+
activeSince: statusChance > 0.66 ? activeSinceDate : statusChance > 0.33 ? yesterdayDate : twoDaysAgoDate
|
|
147
163
|
};
|
|
148
164
|
};
|
|
149
165
|
|
|
@@ -99,9 +99,9 @@ var ImportModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
99
99
|
var acceptSet = new Set(accept);
|
|
100
100
|
var name = file.name;
|
|
101
101
|
var mimeType = file.type;
|
|
102
|
-
var extension = name.split('.').pop();
|
|
102
|
+
var extension = ".".concat(name.split('.').pop());
|
|
103
103
|
|
|
104
|
-
if (acceptSet.has(mimeType) || acceptSet.has(extension)) {
|
|
104
|
+
if (acceptSet.has(mimeType) || acceptSet.has(extension) || accept.length === 0) {
|
|
105
105
|
return false;
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -80,7 +80,9 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
|
|
|
80
80
|
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
|
81
81
|
value = _ref.value,
|
|
82
82
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
83
|
-
var refInput = (0, _react.useRef)(
|
|
83
|
+
var refInput = (0, _react.useRef)({
|
|
84
|
+
innerText: value
|
|
85
|
+
});
|
|
84
86
|
var localRef = (0, _react.useRef)(null);
|
|
85
87
|
var ref = refIn || localRef;
|
|
86
88
|
|
|
@@ -283,7 +285,7 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (_ref, refIn) {
|
|
|
283
285
|
onPaste: handlePaste,
|
|
284
286
|
suppressContentEditableWarning: true,
|
|
285
287
|
ref: refInput,
|
|
286
|
-
"data-placeholder": placeholder
|
|
288
|
+
"data-placeholder": placeholder
|
|
287
289
|
}), value), /*#__PURE__*/_react.default.createElement("div", {
|
|
288
290
|
className: (0, _classnames.default)("".concat(blockClass, "__after-input-elements")) // tabindex -1 fixes blur target test when clicking on after-input-elements background
|
|
289
291
|
,
|
|
@@ -130,6 +130,11 @@ ProductiveCard.propTypes = {
|
|
|
130
130
|
*/
|
|
131
131
|
primaryButtonIcon: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
132
132
|
|
|
133
|
+
/**
|
|
134
|
+
* Determines if the primary button is on the top or bottom of the card
|
|
135
|
+
*/
|
|
136
|
+
primaryButtonPlacement: _propTypes.default.oneOf(['top', 'bottom']),
|
|
137
|
+
|
|
133
138
|
/**
|
|
134
139
|
* The text that's displayed in the primary button
|
|
135
140
|
*/
|
package/lib/components/index.js
CHANGED
|
@@ -333,6 +333,12 @@ Object.defineProperty(exports, "useActionsColumn", {
|
|
|
333
333
|
return _Datagrid.useActionsColumn;
|
|
334
334
|
}
|
|
335
335
|
});
|
|
336
|
+
Object.defineProperty(exports, "useColumnOrder", {
|
|
337
|
+
enumerable: true,
|
|
338
|
+
get: function get() {
|
|
339
|
+
return _Datagrid.useColumnOrder;
|
|
340
|
+
}
|
|
341
|
+
});
|
|
336
342
|
Object.defineProperty(exports, "useColumnRightAlign", {
|
|
337
343
|
enumerable: true,
|
|
338
344
|
get: function get() {
|
|
@@ -369,6 +375,12 @@ Object.defineProperty(exports, "useInfiniteScroll", {
|
|
|
369
375
|
return _Datagrid.useInfiniteScroll;
|
|
370
376
|
}
|
|
371
377
|
});
|
|
378
|
+
Object.defineProperty(exports, "useInlineEdit", {
|
|
379
|
+
enumerable: true,
|
|
380
|
+
get: function get() {
|
|
381
|
+
return _Datagrid.useInlineEdit;
|
|
382
|
+
}
|
|
383
|
+
});
|
|
372
384
|
Object.defineProperty(exports, "useNestedRows", {
|
|
373
385
|
enumerable: true,
|
|
374
386
|
get: function get() {
|
|
@@ -16,7 +16,7 @@ var _react = require("react");
|
|
|
16
16
|
var useClickOutside = function useClickOutside(ref, callback) {
|
|
17
17
|
var handleClick = function handleClick(event) {
|
|
18
18
|
if (ref.current && !ref.current.contains(event.target)) {
|
|
19
|
-
callback();
|
|
19
|
+
callback(event.target);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -57,6 +57,9 @@ var defaults = {
|
|
|
57
57
|
TearsheetNarrow: true,
|
|
58
58
|
UnauthorizedEmptyState: true,
|
|
59
59
|
UserProfileImage: true,
|
|
60
|
+
WebTerminal: true,
|
|
61
|
+
WebTerminalContentWrapper: true,
|
|
62
|
+
WebTerminalProvider: true,
|
|
60
63
|
// other public components not yet reviewed and released:
|
|
61
64
|
MultiAddSelect: false,
|
|
62
65
|
SingleAddSelect: false,
|
|
@@ -64,9 +67,6 @@ var defaults = {
|
|
|
64
67
|
Toolbar: false,
|
|
65
68
|
ToolbarButton: false,
|
|
66
69
|
ToolbarGroup: false,
|
|
67
|
-
WebTerminal: false,
|
|
68
|
-
WebTerminalContentWrapper: false,
|
|
69
|
-
WebTerminalProvider: false,
|
|
70
70
|
EditSidePanel: false,
|
|
71
71
|
CancelableTextEdit: false,
|
|
72
72
|
DataSpreadsheet: false,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.rangeWithCallback = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Copyright IBM Corp. 2022, 2022
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
// Iterates through a numeric range and calls callback
|
|
15
|
+
// function for each iteration
|
|
16
|
+
var rangeWithCallback = function rangeWithCallback(start, end, fn) {
|
|
17
|
+
for (var i = start; i <= end; i++) {
|
|
18
|
+
fn(i);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.rangeWithCallback = rangeWithCallback;
|
|
@@ -46,7 +46,11 @@ var getStoryTitle = function getStoryTitle(componentName) {
|
|
|
46
46
|
|
|
47
47
|
exports.getStoryTitle = getStoryTitle;
|
|
48
48
|
|
|
49
|
-
var getStoryId = function getStoryId(componentName, scenario) {
|
|
49
|
+
var getStoryId = function getStoryId(componentName, scenario, subdirectory) {
|
|
50
|
+
if (subdirectory) {
|
|
51
|
+
return "".concat((0, _csf.sanitize)(getStoryTitle(componentName)), "-").concat((0, _csf.sanitize)(subdirectory), "--").concat(scenario);
|
|
52
|
+
}
|
|
53
|
+
|
|
50
54
|
return "".concat((0, _csf.sanitize)(getStoryTitle(componentName)), "--").concat(scenario);
|
|
51
55
|
};
|
|
52
56
|
/**
|
|
@@ -9,11 +9,15 @@ describe('uuidv4', function () {
|
|
|
9
9
|
jest.resetAllMocks();
|
|
10
10
|
});
|
|
11
11
|
it('Uses Math.random when window is not defined', function () {
|
|
12
|
+
var _window = window,
|
|
13
|
+
crypto = _window.crypto;
|
|
14
|
+
delete window.crypto;
|
|
12
15
|
var mockMath = Object.create(global.Math);
|
|
13
16
|
var mockMathRandom = jest.fn().mockReturnValue(0.5);
|
|
14
17
|
mockMath.random = mockMathRandom;
|
|
15
18
|
global.Math = mockMath;
|
|
16
19
|
expect((0, _uuidv.default)()).toEqual('98888888-9888-4888-a888-988888888888');
|
|
20
|
+
window.crypto = crypto;
|
|
17
21
|
});
|
|
18
22
|
it('Uses crypto from window when window is defined', function () {
|
|
19
23
|
var mGetRandomValues = jest.fn().mockReturnValue(new Uint32Array(10));
|
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.32.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -51,22 +51,22 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@babel/cli": "^7.18.10",
|
|
54
|
-
"@babel/core": "^7.18.
|
|
55
|
-
"babel-preset-ibm-cloud-cognitive": "^0.14.
|
|
54
|
+
"@babel/core": "^7.18.13",
|
|
55
|
+
"babel-preset-ibm-cloud-cognitive": "^0.14.19",
|
|
56
56
|
"chalk": "^4.1.2",
|
|
57
57
|
"change-case": "^4.1.2",
|
|
58
58
|
"copyfiles": "^2.4.1",
|
|
59
59
|
"cross-env": "^7.0.3",
|
|
60
60
|
"fs-extra": "^10.1.0",
|
|
61
61
|
"glob": "^8.0.3",
|
|
62
|
-
"jest": "^
|
|
63
|
-
"jest-config-ibm-cloud-cognitive": "^0.24.
|
|
64
|
-
"jest-environment-jsdom": "^
|
|
62
|
+
"jest": "^29.0.1",
|
|
63
|
+
"jest-config-ibm-cloud-cognitive": "^0.24.5",
|
|
64
|
+
"jest-environment-jsdom": "^29.0.1",
|
|
65
65
|
"namor": "^1.1.2",
|
|
66
|
-
"npm-check-updates": "^16.0.
|
|
66
|
+
"npm-check-updates": "^16.0.6",
|
|
67
67
|
"npm-run-all": "^4.1.5",
|
|
68
68
|
"rimraf": "^3.0.2",
|
|
69
|
-
"sass": "^1.54.
|
|
69
|
+
"sass": "^1.54.8",
|
|
70
70
|
"yargs": "^17.5.1"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
@@ -85,13 +85,13 @@
|
|
|
85
85
|
"@carbon/import-once": "^10.7.0",
|
|
86
86
|
"@carbon/layout": "^10.37.1",
|
|
87
87
|
"@carbon/motion": "^10.29.0",
|
|
88
|
-
"@carbon/themes": "^10.
|
|
89
|
-
"@carbon/type": "^10.
|
|
90
|
-
"carbon-components": "^10.
|
|
91
|
-
"carbon-components-react": "^7.
|
|
88
|
+
"@carbon/themes": "^10.55.0",
|
|
89
|
+
"@carbon/type": "^10.45.0",
|
|
90
|
+
"carbon-components": "^10.58.0",
|
|
91
|
+
"carbon-components-react": "^7.59.0",
|
|
92
92
|
"carbon-icons": "^7.0.7",
|
|
93
93
|
"react": "^16.8.6 || ^17.0.1",
|
|
94
94
|
"react-dom": "^16.8.6 || ^17.0.1"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "07980288bb0aeea68a7b884846fb675e9bba82bd"
|
|
97
97
|
}
|