@carbon/ibm-products 2.30.0 → 2.31.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/css/index-full-carbon.css +248 -23
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +10 -4
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +248 -23
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +1 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +244 -19
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +1 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/ComboButton/ComboButton.d.ts +38 -18
  18. package/es/components/ComboButton/ComboButton.js +25 -21
  19. package/es/components/ComboButton/ComboButtonItem/index.d.ts +22 -13
  20. package/es/components/CreateModal/CreateModal.d.ts +66 -2
  21. package/es/components/CreateModal/CreateModal.js +1 -1
  22. package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  23. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +3 -1
  24. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +4 -1
  25. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +3 -15
  26. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +0 -7
  27. package/es/components/Datagrid/Datagrid/addons/stateReducer.js +7 -0
  28. package/es/components/EditInPlace/EditInPlace.js +4 -5
  29. package/es/components/Nav/Nav.d.ts +3 -0
  30. package/es/components/Nav/Nav.js +154 -0
  31. package/es/components/Nav/NavItem.d.ts +35 -0
  32. package/es/components/Nav/NavItem.js +149 -0
  33. package/es/components/Nav/NavItemLink.d.ts +3 -0
  34. package/es/components/Nav/NavItemLink.js +30 -0
  35. package/es/components/Nav/NavList.d.ts +4 -0
  36. package/es/components/Nav/NavList.js +168 -0
  37. package/es/components/Nav/index.d.ts +3 -0
  38. package/es/components/Tearsheet/TearsheetShell.js +22 -7
  39. package/es/components/index.d.ts +1 -0
  40. package/es/global/js/package-settings.d.ts +1 -0
  41. package/es/global/js/package-settings.js +1 -0
  42. package/es/index.js +1 -0
  43. package/es/node_modules/@carbon/icon-helpers/es/index.js +140 -0
  44. package/es/node_modules/@carbon/icons-react/es/Icon.js +73 -0
  45. package/es/node_modules/@carbon/icons-react/es/generated/bucket-2.js +3091 -0
  46. package/es/node_modules/@carbon/icons-react/es/generated/bucket-8.js +3004 -0
  47. package/es/node_modules/@carbon/icons-react/es/iconPropTypes-4cbeb95d.js +14 -0
  48. package/es/settings.d.ts +1 -0
  49. package/lib/components/ComboButton/ComboButton.d.ts +38 -18
  50. package/lib/components/ComboButton/ComboButton.js +24 -20
  51. package/lib/components/ComboButton/ComboButtonItem/index.d.ts +22 -13
  52. package/lib/components/CreateModal/CreateModal.d.ts +66 -2
  53. package/lib/components/CreateModal/CreateModal.js +1 -1
  54. package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  55. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +3 -1
  56. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +4 -1
  57. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +3 -15
  58. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +0 -7
  59. package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +7 -0
  60. package/lib/components/EditInPlace/EditInPlace.js +4 -5
  61. package/lib/components/Nav/Nav.d.ts +3 -0
  62. package/lib/components/Nav/Nav.js +161 -0
  63. package/lib/components/Nav/NavItem.d.ts +35 -0
  64. package/lib/components/Nav/NavItem.js +160 -0
  65. package/lib/components/Nav/NavItemLink.d.ts +3 -0
  66. package/lib/components/Nav/NavItemLink.js +38 -0
  67. package/lib/components/Nav/NavList.d.ts +4 -0
  68. package/lib/components/Nav/NavList.js +179 -0
  69. package/lib/components/Nav/index.d.ts +3 -0
  70. package/lib/components/Tearsheet/TearsheetShell.js +22 -7
  71. package/lib/components/index.d.ts +1 -0
  72. package/lib/global/js/package-settings.d.ts +1 -0
  73. package/lib/global/js/package-settings.js +1 -0
  74. package/lib/index.js +5 -0
  75. package/lib/node_modules/@carbon/icon-helpers/es/index.js +145 -0
  76. package/lib/node_modules/@carbon/icons-react/es/Icon.js +81 -0
  77. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-2.js +3223 -0
  78. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-8.js +3136 -0
  79. package/lib/node_modules/@carbon/icons-react/es/iconPropTypes-4cbeb95d.js +18 -0
  80. package/lib/settings.d.ts +1 -0
  81. package/package.json +3 -3
  82. package/scss/components/ComboButton/_combo-button.scss +19 -21
  83. package/scss/components/Datagrid/styles/_draggableElement.scss +5 -1
  84. package/scss/components/Nav/_carbon-imports.scss +9 -0
  85. package/scss/components/Nav/_index-with-carbon.scss +9 -0
  86. package/scss/components/Nav/_index.scss +8 -0
  87. package/scss/components/Nav/_nav.scss +259 -0
  88. package/scss/components/Tearsheet/_tearsheet.scss +24 -6
  89. package/scss/components/_index-with-carbon.scss +1 -0
  90. package/scss/components/_index.scss +1 -0
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import PropTypes from '../../../prop-types/index.js';
9
+
10
+ var iconPropTypes = {
11
+ size: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
12
+ };
13
+
14
+ export { iconPropTypes as i };
package/es/settings.d.ts CHANGED
@@ -61,6 +61,7 @@ export const pkg: {
61
61
  EditTearsheetNarrow: boolean;
62
62
  EditFullPage: boolean;
63
63
  EditUpdateCards: boolean;
64
+ Nav: boolean;
64
65
  BigNumbers: boolean;
65
66
  TruncatedList: boolean;
66
67
  DelimitedList: boolean;
@@ -1,21 +1,41 @@
1
1
  /**
2
- * The combo button consolidates similar actions, while exposing the most commonly used one.
2
+ * Copyright IBM Corp. 2020, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
3
6
  */
4
- export function ComboButton({ children, className, overflowMenu, ...rest }: {
5
- [x: string]: any;
6
- children: any;
7
- className: any;
8
- overflowMenu: any;
9
- }): import("react/jsx-runtime").JSX.Element;
10
- export namespace ComboButton {
11
- namespace deprecated {
12
- let level: string;
13
- let details: string;
14
- }
15
- namespace propTypes {
16
- export let children: import("prop-types").Validator<NonNullable<import("prop-types").ReactNodeLike>>;
17
- export { string as className };
18
- export let overflowMenu: import("prop-types").Requireable<import("prop-types").InferProps<any>>;
19
- }
7
+ import React, { ComponentProps, ReactNode } from 'react';
8
+ interface ComboButtonProps extends ComponentProps<'div'> {
9
+ /** Provide the contents of the `ComboButton` */
10
+ children?: ReactNode;
11
+ /** Provide an optional class to be applied to the containing node */
12
+ className?: string;
13
+ /** Provide the [props of the `OverflowMenu`](https://react.carbondesignsystem.com/?path=/docs/overflowmenu) */
14
+ overflowMenu: {
15
+ /**
16
+ * The event handler for the `click` event.
17
+ */
18
+ onClick?(): void;
19
+ /**
20
+ * Function called when menu is closed
21
+ */
22
+ onClose?(): void;
23
+ /**
24
+ * The event handler for the `focus` event.
25
+ */
26
+ onFocus?(): void;
27
+ /**
28
+ * The event handler for the `keydown` event.
29
+ */
30
+ onKeyDown?(): void;
31
+ /**
32
+ * Function called when menu is opened
33
+ */
34
+ onOpen?(): void;
35
+ };
20
36
  }
21
- import { string } from 'prop-types';
37
+ /**
38
+ * The combo button consolidates similar actions, while exposing the most commonly used one.
39
+ */
40
+ declare const ComboButton: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<ComboButtonProps>, "ref"> & React.RefAttributes<HTMLDivElement>>;
41
+ export { ComboButton };
@@ -16,6 +16,7 @@ var cx = require('classnames');
16
16
  var index = require('../../node_modules/prop-types/index.js');
17
17
  var uuidv4 = require('../../global/js/utils/uuidv4.js');
18
18
  var React = require('react');
19
+ var settings = require('../../settings.js');
19
20
 
20
21
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
21
22
 
@@ -23,15 +24,13 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
23
24
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
25
 
25
26
  var _excluded = ["children", "className", "overflowMenu"],
26
- _excluded2 = ["children"],
27
- _excluded3 = ["children", "renderIcon"];
28
- var blockClass = 'security--combo-button';
27
+ _excluded2 = ["children", "renderIcon"];
28
+ var blockClass = "".concat(settings.pkg.prefix, "--combo-button");
29
29
  var componentName = 'ComboButton';
30
-
31
30
  /**
32
31
  * The combo button consolidates similar actions, while exposing the most commonly used one.
33
32
  */
34
- var ComboButton = function ComboButton(_ref) {
33
+ var ComboButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
35
34
  var children = _ref.children,
36
35
  className = _ref.className,
37
36
  overflowMenu = _ref.overflowMenu,
@@ -42,21 +41,22 @@ var ComboButton = function ComboButton(_ref) {
42
41
  _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
43
42
  isOpen = _useState2[0],
44
43
  setIsOpen = _useState2[1];
45
- var _Children$toArray$fil = React.Children.toArray(children).filter(Boolean).map(function (_ref2) {
46
- var _ref2$props = _ref2.props,
47
- children = _ref2$props.children,
48
- props = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2$props, _excluded2);
49
- return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, props), {}, {
50
- children: /*#__PURE__*/React__default["default"].createElement("span", {
51
- className: "".concat(blockClass, "__action"),
52
- title: children
53
- }, children)
54
- });
44
+ var _Children$toArray$fil = React.Children.toArray(children).filter(Boolean).map(function (child) {
45
+ if ( /*#__PURE__*/React__default["default"].isValidElement(child)) {
46
+ var props = child.props;
47
+ return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, props), {}, {
48
+ children: /*#__PURE__*/React__default["default"].createElement("span", {
49
+ className: "".concat(blockClass, "__action")
50
+ }, child)
51
+ });
52
+ }
53
+ return null;
55
54
  }),
56
55
  _Children$toArray$fil2 = _rollupPluginBabelHelpers.toArray(_Children$toArray$fil),
57
56
  primaryAction = _Children$toArray$fil2[0],
58
57
  restActions = _Children$toArray$fil2.slice(1);
59
58
  return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
59
+ ref: ref,
60
60
  className: cx__default["default"](blockClass, className),
61
61
  "data-floating-menu-container": true
62
62
  }), /*#__PURE__*/React__default["default"].createElement(react.Button, primaryAction), restActions.length > 0 && /*#__PURE__*/React__default["default"].createElement(react.OverflowMenu, _rollupPluginBabelHelpers["extends"]({}, overflowMenu, {
@@ -82,10 +82,10 @@ var ComboButton = function ComboButton(_ref) {
82
82
  });
83
83
  },
84
84
  flipped: true
85
- }), restActions.map(function (_ref3, index) {
86
- var children = _ref3.children,
87
- Icon = _ref3.renderIcon,
88
- action = _rollupPluginBabelHelpers.objectWithoutProperties(_ref3, _excluded3);
85
+ }), restActions.map(function (_ref2, index) {
86
+ var children = _ref2.children,
87
+ Icon = _ref2.renderIcon,
88
+ action = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded2);
89
89
  return /*#__PURE__*/React__default["default"].createElement(react.OverflowMenuItem, _rollupPluginBabelHelpers["extends"]({}, action, {
90
90
  key: "".concat(blockClass, "--").concat(instanceId, "__overflow-menu__item__").concat(index),
91
91
  className: "".concat(blockClass, "__overflow-menu__item"),
@@ -94,17 +94,21 @@ var ComboButton = function ComboButton(_ref) {
94
94
  }, /*#__PURE__*/React__default["default"].createElement(Icon, null)))
95
95
  }));
96
96
  })));
97
- };
97
+ });
98
+
99
+ /**@ts-ignore*/
98
100
  ComboButton.deprecated = {
99
101
  level: 'warn',
100
102
  details: "Please replace ".concat(componentName, " with Carbon's ComboButton")
101
103
  };
104
+ ComboButton.displayName = componentName;
102
105
  ComboButton.propTypes = {
103
106
  /** Provide the contents of the `ComboButton` */
104
107
  children: index.propTypesExports.node.isRequired,
105
108
  /** Provide an optional class to be applied to the containing node */
106
109
  className: index.propTypesExports.string,
107
110
  /** Provide the [props of the `OverflowMenu`](https://react.carbondesignsystem.com/?path=/docs/overflowmenu) */
111
+ /**@ts-ignore*/
108
112
  overflowMenu: index.propTypesExports.shape(react.OverflowMenu.propTypes)
109
113
  };
110
114
 
@@ -1,16 +1,25 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
1
7
  /**
2
8
  * The combo button item provides additional actions a user can take.
3
9
  */
4
- export function ComboButtonItem({ ...rest }: {
5
- [x: string]: any;
6
- }): import("react/jsx-runtime").JSX.Element;
7
- export namespace ComboButtonItem {
8
- namespace propTypes {
9
- export let children: import("prop-types").Validator<NonNullable<import("prop-types").ReactNodeLike>>;
10
- export { bool as disabled };
11
- export { string as href };
12
- export let renderIcon: import("prop-types").Requireable<object>;
13
- }
14
- }
15
- import { bool } from 'prop-types';
16
- import { string } from 'prop-types';
10
+ declare const ComboButtonItem: {
11
+ ({ ...rest }: {
12
+ [x: string]: any;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ propTypes: {
15
+ /** Provide the contents of the `ComboButtonItem` */
16
+ children: import("prop-types").Validator<NonNullable<import("prop-types").ReactNodeLike>>;
17
+ /** Specify whether the `ComboButton` should be disabled, or not */
18
+ disabled: import("prop-types").Requireable<boolean>;
19
+ /** Provide an optional `href` for the `ComboButtonItem` to become an `a` element */
20
+ href: import("prop-types").Requireable<string>;
21
+ /** Provide an optional icon to render */
22
+ renderIcon: import("prop-types").Requireable<object>;
23
+ };
24
+ };
25
+ export { ComboButtonItem };
@@ -1,8 +1,72 @@
1
+ /**
2
+ * Copyright IBM Corp. 2021, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /// <reference path="../../../src/custom-typings/index.d.ts" />
8
+ import React, { ReactNode } from 'react';
9
+ import { ComposedModal } from '@carbon/react';
10
+ interface CreateModalProps extends React.ComponentProps<typeof ComposedModal> {
11
+ /**
12
+ * Specify an optional className to be applied to the modal root node
13
+ */
14
+ className?: string;
15
+ /**
16
+ * Specifies an optional handler which is called when the CreateModal
17
+ * is closed.
18
+ */
19
+ onRequestClose?(): void;
20
+ /**
21
+ * Specifies an optional handler which is called when the CreateModal
22
+ * primary button is pressed.
23
+ */
24
+ onRequestSubmit?(): void;
25
+ /**
26
+ * Specifies whether the CreateModal is open or not.
27
+ */
28
+ open?: boolean;
29
+ /**
30
+ * The title of the CreateModal is usually the product or service name.
31
+ */
32
+ title: ReactNode;
33
+ /**
34
+ * The subtitle of the CreateModal is optional and serves to provide more information about the modal.
35
+ */
36
+ subtitle?: ReactNode;
37
+ /**
38
+ * The description of the CreateModal serves to provide more information about the modal.
39
+ */
40
+ description: ReactNode;
41
+ /**
42
+ * Specifies the secondary button's text in the modal.
43
+ */
44
+ secondaryButtonText: string;
45
+ /**
46
+ * The DOM node the tearsheet should be rendered within. Defaults to document.body.
47
+ */
48
+ portalTarget?: ReactNode;
49
+ /**
50
+ * Specifies the primary button's text in the modal.
51
+ */
52
+ primaryButtonText: string;
53
+ /**
54
+ * Specifies a boolean for disabling or enabling the primary button. This is important for form validation
55
+ * Returning `true` prevents the primary button from being clicked until required fields are completed.
56
+ */
57
+ disableSubmit?: boolean;
58
+ /**
59
+ * Specifies which DOM element in the form should be focused.
60
+ */
61
+ selectorPrimaryFocus: ReactNode;
62
+ }
1
63
  /**
2
64
  * The `CreateModal` component provides a way for a user to quickly generate a new
3
65
  resource. It is triggered by a user’s action, appears on top of the main page
4
66
  content, and is persistent until dismissed. The purpose of this modal should be
5
67
  immediately apparent to the user, with a clear and obvious path to completion.
6
68
  */
7
- export let CreateModal: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
8
- import React from 'react';
69
+ export declare let CreateModal: React.ForwardRefExoticComponent<CreateModalProps & {
70
+ children?: React.ReactNode;
71
+ } & React.RefAttributes<unknown>>;
72
+ export {};
@@ -37,7 +37,6 @@ var isValidChildren = function isValidChildren() {
37
37
  return;
38
38
  };
39
39
  };
40
-
41
40
  /**
42
41
  * The `CreateModal` component provides a way for a user to quickly generate a new
43
42
  resource. It is triggered by a user’s action, appears on top of the main page
@@ -102,6 +101,7 @@ exports.CreateModal.propTypes = {
102
101
  /**
103
102
  * Children refers to all form items within a form inside of the modal's body.
104
103
  */
104
+ /**@ts-ignore*/
105
105
  children: isValidChildren(),
106
106
  /**
107
107
  * Specify an optional className to be applied to the modal root node
@@ -96,7 +96,7 @@ var DatagridContent = function DatagridContent(_ref) {
96
96
  var renderTable = function renderTable() {
97
97
  var _getTableProps;
98
98
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(react.Table, _rollupPluginBabelHelpers["extends"]({}, getTableProps(), {
99
- className: cx__default["default"](withVirtualScroll ? '' : "".concat(blockClass, "__table-simple"), "".concat(blockClass, "__vertical-align-").concat(verticalAlign), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__variable-row-height"), variableRowHeight), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__table-with-inline-edit"), withInlineEdit), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__table-grid-active"), gridActive), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__table-is-resizing"), typeof columnResizing.isResizingColumn === 'string'), (_getTableProps = getTableProps()) === null || _getTableProps === void 0 ? void 0 : _getTableProps.className),
99
+ className: cx__default["default"](withVirtualScroll ? '' : "".concat(blockClass, "__table-simple"), "".concat(blockClass, "__vertical-align-").concat(verticalAlign), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__variable-row-height"), variableRowHeight), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__table-with-inline-edit"), withInlineEdit), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__table-grid-active"), gridActive), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__table-is-resizing"), typeof (columnResizing === null || columnResizing === void 0 ? void 0 : columnResizing.isResizingColumn) === 'string'), (_getTableProps = getTableProps()) === null || _getTableProps === void 0 ? void 0 : _getTableProps.className),
100
100
  role: withInlineEdit ? 'grid' : undefined,
101
101
  tabIndex: withInlineEdit ? 0 : -1,
102
102
  onKeyDown: /* istanbul ignore next */
@@ -1,5 +1,5 @@
1
1
  export default Columns;
2
- declare function Columns({ getVisibleColumnsCount, filterString, columns, setColumnsObject, onSelectColumn, assistiveTextInstructionsLabel, assistiveTextDisabledInstructionsLabel, selectAllLabel, }: {
2
+ declare function Columns({ getVisibleColumnsCount, filterString, columns, setColumnsObject, onSelectColumn, assistiveTextInstructionsLabel, assistiveTextDisabledInstructionsLabel, selectAllLabel, customizeTearsheetHeadingLabel }: {
3
3
  getVisibleColumnsCount: any;
4
4
  filterString: any;
5
5
  columns: any;
@@ -8,12 +8,14 @@ declare function Columns({ getVisibleColumnsCount, filterString, columns, setCol
8
8
  assistiveTextInstructionsLabel: any;
9
9
  assistiveTextDisabledInstructionsLabel: any;
10
10
  selectAllLabel: any;
11
+ customizeTearsheetHeadingLabel: any;
11
12
  }): import("react/jsx-runtime").JSX.Element;
12
13
  declare namespace Columns {
13
14
  namespace propTypes {
14
15
  let assistiveTextDisabledInstructionsLabel: PropTypes.Requireable<string>;
15
16
  let assistiveTextInstructionsLabel: PropTypes.Requireable<string>;
16
17
  let columns: PropTypes.Validator<any[]>;
18
+ let customizeTearsheetHeadingLabel: PropTypes.Requireable<string>;
17
19
  let disabledInstructionsLabel: PropTypes.Requireable<string>;
18
20
  let filterString: PropTypes.Validator<string>;
19
21
  let getVisibleColumnsCount: PropTypes.Validator<(...args: any[]) => any>;
@@ -34,7 +34,8 @@ var Columns = function Columns(_ref) {
34
34
  onSelectColumn = _ref.onSelectColumn,
35
35
  assistiveTextInstructionsLabel = _ref.assistiveTextInstructionsLabel,
36
36
  assistiveTextDisabledInstructionsLabel = _ref.assistiveTextDisabledInstructionsLabel,
37
- selectAllLabel = _ref.selectAllLabel;
37
+ selectAllLabel = _ref.selectAllLabel,
38
+ customizeTearsheetHeadingLabel = _ref.customizeTearsheetHeadingLabel;
38
39
  var listId = React.useRef(uuidv4["default"]()); // keep id between renders
39
40
  var listRef = React.useRef(null);
40
41
  var _React$useState = React__default["default"].useState(''),
@@ -57,6 +58,7 @@ var Columns = function Columns(_ref) {
57
58
  }, /*#__PURE__*/React__default["default"].createElement("ol", {
58
59
  className: "".concat(blockClass, "__customize-columns-column-list--focus"),
59
60
  role: "listbox",
61
+ "aria-label": customizeTearsheetHeadingLabel,
60
62
  "aria-describedby": "".concat(blockClass, "__customize-columns--instructions"),
61
63
  tabIndex: 0
62
64
  }, /*#__PURE__*/React__default["default"].createElement("span", {
@@ -91,6 +93,7 @@ Columns.propTypes = {
91
93
  assistiveTextDisabledInstructionsLabel: index["default"].string,
92
94
  assistiveTextInstructionsLabel: index["default"].string,
93
95
  columns: index["default"].array.isRequired,
96
+ customizeTearsheetHeadingLabel: index["default"].string,
94
97
  disabledInstructionsLabel: index["default"].string,
95
98
  filterString: index["default"].string.isRequired,
96
99
  getVisibleColumnsCount: index["default"].func.isRequired,
@@ -12,7 +12,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
12
12
  var _rollupPluginBabelHelpers = require('../../../../../_virtual/_rollupPluginBabelHelpers.js');
13
13
  var React = require('react');
14
14
  var index = require('../../../../../node_modules/prop-types/index.js');
15
- var common = require('./common.js');
16
15
  var Columns = require('./Columns.js');
17
16
  var Actions = require('./Actions.js');
18
17
  var settings = require('../../../../../settings.js');
@@ -59,19 +58,7 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
59
58
  _useState6 = _rollupPluginBabelHelpers.slicedToArray(_useState5, 2),
60
59
  searchText = _useState6[0],
61
60
  setSearchText = _useState6[1];
62
- var _useState7 = React.useState(columnDefinitions
63
- // only sort the hidden column to the end when modal reopen
64
- .sort(function (defA, defB) {
65
- var isVisibleA = common.isColumnVisible(defA);
66
- var isVisibleB = common.isColumnVisible(defB);
67
- if (isVisibleA && !isVisibleB) {
68
- return -1;
69
- }
70
- if (!isVisibleA && isVisibleB) {
71
- return 1;
72
- }
73
- return 0;
74
- })),
61
+ var _useState7 = React.useState(columnDefinitions),
75
62
  _useState8 = _rollupPluginBabelHelpers.slicedToArray(_useState7, 2),
76
63
  columnObjects = _useState8[0],
77
64
  setColumnObjects = _useState8[1];
@@ -157,7 +144,8 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
157
144
  setColumnObjects(cols);
158
145
  setDirty();
159
146
  },
160
- selectAllLabel: selectAllLabel
147
+ selectAllLabel: selectAllLabel,
148
+ customizeTearsheetHeadingLabel: customizeTearsheetHeadingLabel
161
149
  }));
162
150
  };
163
151
  CustomizeColumnsTearsheet.propTypes = {
@@ -15,13 +15,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
15
15
 
16
16
  var isBoolean__default = /*#__PURE__*/_interopDefaultLegacy(isBoolean);
17
17
 
18
- /*
19
- * Licensed Materials - Property of IBM
20
- * 5724-Q36
21
- * (c) Copyright IBM Corp. 2021
22
- * US Government Users Restricted Rights - Use, duplication or disclosure
23
- * restricted by GSA ADP Schedule Contract with IBM Corp.
24
- */
25
18
  var isColumnVisible = function isColumnVisible(colDef) {
26
19
  return isBoolean__default["default"](colDef.isVisible) ? colDef.isVisible : true;
27
20
  };
@@ -90,12 +90,19 @@ var stateReducer = function stateReducer(newState, action) {
90
90
  getRowId = _ref3.getRowId,
91
91
  indeterminate = _ref3.indeterminate,
92
92
  isChecked = _ref3.isChecked;
93
+ var newSelectedRowIds = {};
93
94
  if (rows) {
94
95
  var newSelectedRowData = {};
95
96
  rows.forEach(function (row) {
97
+ var props = row.getRowProps();
98
+ if (props && props.disabled) {
99
+ return;
100
+ }
101
+ newSelectedRowIds[getRowId(row.original, row.index)] = true;
96
102
  newSelectedRowData[getRowId(row.original, row.index)] = row.original;
97
103
  });
98
104
  return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, newState), {}, {
105
+ selectedRowIds: newSelectedRowIds,
99
106
  selectedRowData: indeterminate || !isChecked ? {} : newSelectedRowData
100
107
  });
101
108
  }
@@ -151,10 +151,7 @@ exports.EditInPlace = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
151
151
  className: cx__default["default"](blockClass, "".concat(blockClass, "--").concat(size), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--focused"), focused), "".concat(blockClass, "--invalid"), invalid), "".concat(blockClass, "--inherit-type"), inheritTypography), "".concat(blockClass, "--overflows"), inputRef.current && inputRef.current.scrollWidth > inputRef.current.offsetWidth)),
152
152
  onFocus: onFocusHandler,
153
153
  onBlur: onBlurHandler
154
- }, /*#__PURE__*/React__default["default"].createElement("label", {
155
- className: "".concat(blockClass, "__text-input-label"),
156
- htmlFor: id
157
- }, labelText), /*#__PURE__*/React__default["default"].createElement("input", {
154
+ }, /*#__PURE__*/React__default["default"].createElement("input", {
158
155
  id: id,
159
156
  className: cx__default["default"]("".concat(blockClass, "__text-input"), "".concat(settings.carbon.prefix, "--text-input"), "".concat(settings.carbon.prefix, "--text-input--").concat(size)),
160
157
  type: "text",
@@ -163,7 +160,9 @@ exports.EditInPlace = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
163
160
  ref: inputRef
164
161
  // readOnly={readOnly}
165
162
  ,
166
- onKeyDown: onKeyHandler
163
+ onKeyDown: onKeyHandler,
164
+ "aria-label": labelText,
165
+ "aria-invalid": invalid
167
166
  }), /*#__PURE__*/React__default["default"].createElement("div", {
168
167
  className: "".concat(blockClass, "__ellipsis"),
169
168
  "aria-hidden": !focused
@@ -0,0 +1,3 @@
1
+ export let Nav: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
+ export default Nav;
3
+ import React from 'react';
@@ -0,0 +1,161 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var React = require('react');
14
+ var index = require('../../node_modules/prop-types/index.js');
15
+ var cx = require('classnames');
16
+ var NavList = require('./NavList.js');
17
+ var NavItem = require('./NavItem.js');
18
+ var devtools = require('../../global/js/utils/devtools.js');
19
+ var settings = require('../../settings.js');
20
+
21
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
22
+
23
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
+ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
25
+
26
+ var _excluded = ["activeHref", "className", "children", "heading", "label"];
27
+ var componentName = 'Nav';
28
+ var blockClass = "".concat(settings.pkg.prefix, "--nav");
29
+ exports.Nav = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
30
+ var activeHref = _ref.activeHref,
31
+ className = _ref.className,
32
+ children = _ref.children,
33
+ heading = _ref.heading,
34
+ label = _ref.label,
35
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
36
+ var _useState = React.useState(activeHref),
37
+ _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
38
+ _activeHref = _useState2[0],
39
+ setActiveHref = _useState2[1];
40
+ var navigationLists = React.useRef({});
41
+ React.useEffect(function () {
42
+ if (!_activeHref && window.location) {
43
+ var _window$location = window.location,
44
+ hash = _window$location.hash,
45
+ pathname = _window$location.pathname;
46
+ setActiveHref(pathname + hash);
47
+ }
48
+ }, [_activeHref]);
49
+
50
+ /**
51
+ * Creates a new child list item.
52
+ * @param {NavItem} child The child list item to create.
53
+ * @param {number} index The index of the child list item.
54
+ * @returns {NavItem} The new child list item.
55
+ */
56
+ var buildNewItemChild = function buildNewItemChild(child, index) {
57
+ var key = "".concat(NavItem.blockClass, "--").concat(index);
58
+ return /*#__PURE__*/React__default["default"].createElement(NavItem["default"], _rollupPluginBabelHelpers["extends"]({}, child.props, {
59
+ activeHref: _activeHref,
60
+ key: key,
61
+ onClick: function onClick(event, href) {
62
+ return handleItemClick(event, href, child.props.onClick);
63
+ }
64
+ }));
65
+ };
66
+
67
+ /**
68
+ * Creates a new child list.
69
+ * @param {NavList} child The child list to create.
70
+ * @param {number} index The index of the child list.
71
+ * @returns {NavList} The new child list.
72
+ */
73
+ var buildNewListChild = function buildNewListChild(child, index) {
74
+ var key = "".concat(NavList.blockClass, "--").concat(index);
75
+ return /*#__PURE__*/React__default["default"].createElement(NavList["default"], _rollupPluginBabelHelpers["extends"]({}, child.props, {
76
+ activeHref: _activeHref,
77
+ id: key,
78
+ key: key,
79
+ onListClick: handleListClick,
80
+ onItemClick: handleItemClick,
81
+ ref: function ref(el) {
82
+ return navigationLists.current[key] = el;
83
+ }
84
+ }));
85
+ };
86
+
87
+ /**
88
+ * Handles toggling the list item.
89
+ * @param {SyntheticEvent} event The event fired when the list item is toggled.
90
+ * @param {string} href The URL of the list item.
91
+ */
92
+ var handleItemClick = function handleItemClick(event, href, onClick) {
93
+ event.stopPropagation();
94
+ var type = event.type,
95
+ which = event.which;
96
+
97
+ // Enter (13) and spacebar (32).
98
+ var acceptableEvent = which === 13 || which === 32 || type === 'click';
99
+ var diffHref = href !== _activeHref;
100
+ if (acceptableEvent && diffHref) {
101
+ setActiveHref(href);
102
+ }
103
+ if (onClick) {
104
+ onClick(event);
105
+ }
106
+ };
107
+
108
+ /**
109
+ * Handles when a list has been selected.
110
+ * @param {number} id The index of the list.
111
+ */
112
+ var handleListClick = function handleListClick(id) {
113
+ Object.keys(navigationLists.current).forEach(function (key) {
114
+ if (key !== id && !navigationLists.current[key].isExpandedOnPageload) {
115
+ navigationLists.current[key].close();
116
+ }
117
+ });
118
+ };
119
+ return /*#__PURE__*/React__default["default"].createElement("nav", _rollupPluginBabelHelpers["extends"]({
120
+ className: cx__default["default"](blockClass, className),
121
+ "aria-label": label,
122
+ ref: ref
123
+ }, devtools.getDevtoolsProps(componentName), rest), heading && /*#__PURE__*/React__default["default"].createElement("h1", {
124
+ className: "".concat(blockClass, "__heading")
125
+ }, heading), /*#__PURE__*/React__default["default"].createElement("ul", {
126
+ className: "".concat(blockClass, "__wrapper"),
127
+ role: "menubar"
128
+ }, React__default["default"].Children.map(children, function (child, index) {
129
+ var _child$type;
130
+ return (child === null || child === void 0 || (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === NavList["default"].displayName ? buildNewListChild(child, index) : buildNewItemChild(child, index);
131
+ })));
132
+ });
133
+ exports.Nav.propTypes = {
134
+ /**
135
+ * Hypertext reference for active page.
136
+ */
137
+ activeHref: index["default"].string,
138
+ /**
139
+ * Child elements.
140
+ */
141
+ children: index["default"].node,
142
+ /**
143
+ * Extra classes to add.
144
+ */
145
+ className: index["default"].string,
146
+ /**
147
+ * Heading.
148
+ */
149
+ heading: index["default"].string,
150
+ /**
151
+ * Aria-label on the rendered `nav` element.
152
+ */
153
+ label: index["default"].string.isRequired
154
+ };
155
+
156
+ // Return a placeholder if not released and not enabled by feature flag
157
+ exports.Nav = settings.pkg.checkComponentEnabled(exports.Nav, componentName);
158
+
159
+ // The display name of the component, used by React. Note that displayName
160
+ // is used in preference to relying on function.name.
161
+ exports.Nav.displayName = componentName;