@carbon/ibm-products 2.43.1-canary.4 → 2.43.1-canary.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
+ import '../../../feature-flags';
1
2
  import PropTypes from 'prop-types';
2
3
  import { DataGridState } from '../types';
3
4
  interface DatagridContentProps {
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import { defineProperty as _defineProperty, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import '../../../feature-flags.js';
9
10
  import React__default, { useContext, useRef, useEffect } from 'react';
10
11
  import { TableContainer, Table } from '@carbon/react';
11
12
  import { pkg, carbon } from '../../../settings.js';
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import '../../../../../feature-flags.js';
9
10
  import React__default, { useContext, useEffect } from 'react';
10
11
  import PropTypes from '../../../../../node_modules/prop-types/index.js';
11
12
  import CustomizeColumnsTearsheet from './CustomizeColumnsTearsheet.js';
@@ -195,6 +195,9 @@ export interface DataGridState<T extends object = any> extends TableCommonProps,
195
195
  expandedRowIds?: object;
196
196
  onRowClick?: (row: any, event: any) => void;
197
197
  onSort?: boolean;
198
+ expandedContentHeight?: number;
199
+ onRowExpand?: (row: DatagridRow, event: React.MouseEvent<HTMLElement>) => void;
200
+ ExpandedRowContentComponent?: JSXElementConstructor<any>;
198
201
  }
199
202
  export interface ResizeHeaderProps {
200
203
  resizerProps?: ResizerProps;
@@ -1,2 +1,9 @@
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
+ import { Hooks } from 'react-table';
8
+ declare const useExpandedRow: (hooks: Hooks) => void;
1
9
  export default useExpandedRow;
2
- declare function useExpandedRow(hooks: any): void;
@@ -13,10 +13,11 @@ import useRowExpander from './useRowExpander.js';
13
13
  var useExpandedRow = function useExpandedRow(hooks) {
14
14
  useRowExpander(hooks);
15
15
  var useInstance = function useInstance(instance) {
16
- var rows = instance.rows,
17
- expandedContentHeight = instance.expandedContentHeight,
18
- ExpandedRowContentComponent = instance.ExpandedRowContentComponent,
19
- onRowExpand = instance.onRowExpand;
16
+ var _ref = instance,
17
+ rows = _ref.rows,
18
+ expandedContentHeight = _ref.expandedContentHeight,
19
+ ExpandedRowContentComponent = _ref.ExpandedRowContentComponent,
20
+ onRowExpand = _ref.onRowExpand;
20
21
  var _useState = useState({}),
21
22
  _useState2 = _slicedToArray(_useState, 2),
22
23
  expandedRowsHeight = _useState2[0],
@@ -28,7 +29,7 @@ var useExpandedRow = function useExpandedRow(hooks) {
28
29
  return _objectSpread2(_objectSpread2({}, row), {}, {
29
30
  canExpand: row.original && !row.original.notExpandable,
30
31
  expandedContentHeight: expandedRowsHeight[row.index] || expandedContentHeight,
31
- RowExpansionRenderer: DatagridExpandedRow(ExpandedRowContentComponent),
32
+ RowExpansionRenderer: ExpandedRowContentComponent && DatagridExpandedRow(ExpandedRowContentComponent),
32
33
  onClick: function onClick(row, event) {
33
34
  return onRowExpand === null || onRowExpand === void 0 ? void 0 : onRowExpand(row, event);
34
35
  }
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import '../../../feature-flags.js';
9
10
  import { useState, useEffect, useCallback } from 'react';
10
11
  import { pkg } from '../../../settings.js';
11
12
  import { createPortal } from 'react-dom';
@@ -1,3 +1,4 @@
1
+ import '../../../feature-flags';
1
2
  import PropTypes from 'prop-types';
2
3
  import { DataGridState } from '../types';
3
4
  interface DatagridContentProps {
@@ -10,6 +10,7 @@
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
13
+ require('../../../feature-flags.js');
13
14
  var React = require('react');
14
15
  var react = require('@carbon/react');
15
16
  var settings = require('../../../settings.js');
@@ -10,6 +10,7 @@
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  var _rollupPluginBabelHelpers = require('../../../../../_virtual/_rollupPluginBabelHelpers.js');
13
+ require('../../../../../feature-flags.js');
13
14
  var React = require('react');
14
15
  var index = require('../../../../../node_modules/prop-types/index.js');
15
16
  var CustomizeColumnsTearsheet = require('./CustomizeColumnsTearsheet.js');
@@ -195,6 +195,9 @@ export interface DataGridState<T extends object = any> extends TableCommonProps,
195
195
  expandedRowIds?: object;
196
196
  onRowClick?: (row: any, event: any) => void;
197
197
  onSort?: boolean;
198
+ expandedContentHeight?: number;
199
+ onRowExpand?: (row: DatagridRow, event: React.MouseEvent<HTMLElement>) => void;
200
+ ExpandedRowContentComponent?: JSXElementConstructor<any>;
198
201
  }
199
202
  export interface ResizeHeaderProps {
200
203
  resizerProps?: ResizerProps;
@@ -1,2 +1,9 @@
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
+ import { Hooks } from 'react-table';
8
+ declare const useExpandedRow: (hooks: Hooks) => void;
1
9
  export default useExpandedRow;
2
- declare function useExpandedRow(hooks: any): void;
@@ -17,10 +17,11 @@ var useRowExpander = require('./useRowExpander.js');
17
17
  var useExpandedRow = function useExpandedRow(hooks) {
18
18
  useRowExpander["default"](hooks);
19
19
  var useInstance = function useInstance(instance) {
20
- var rows = instance.rows,
21
- expandedContentHeight = instance.expandedContentHeight,
22
- ExpandedRowContentComponent = instance.ExpandedRowContentComponent,
23
- onRowExpand = instance.onRowExpand;
20
+ var _ref = instance,
21
+ rows = _ref.rows,
22
+ expandedContentHeight = _ref.expandedContentHeight,
23
+ ExpandedRowContentComponent = _ref.ExpandedRowContentComponent,
24
+ onRowExpand = _ref.onRowExpand;
24
25
  var _useState = React.useState({}),
25
26
  _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
26
27
  expandedRowsHeight = _useState2[0],
@@ -32,7 +33,7 @@ var useExpandedRow = function useExpandedRow(hooks) {
32
33
  return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, row), {}, {
33
34
  canExpand: row.original && !row.original.notExpandable,
34
35
  expandedContentHeight: expandedRowsHeight[row.index] || expandedContentHeight,
35
- RowExpansionRenderer: DatagridExpandedRow["default"](ExpandedRowContentComponent),
36
+ RowExpansionRenderer: ExpandedRowContentComponent && DatagridExpandedRow["default"](ExpandedRowContentComponent),
36
37
  onClick: function onClick(row, event) {
37
38
  return onRowExpand === null || onRowExpand === void 0 ? void 0 : onRowExpand(row, event);
38
39
  }
@@ -10,6 +10,7 @@
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
13
+ require('../../../feature-flags.js');
13
14
  var React = require('react');
14
15
  var settings = require('../../../settings.js');
15
16
  var reactDom = require('react-dom');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/ibm-products",
3
3
  "description": "Carbon for IBM Products",
4
- "version": "2.43.1-canary.4+3b3c48743",
4
+ "version": "2.43.1-canary.6+578f1cfbc",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -18,9 +18,7 @@
18
18
  "**/global/js/utils/props-helper.js",
19
19
  "**/*.css",
20
20
  "**/*.scss",
21
- "es/feature-flags.js",
22
- "lib/feature-flags.js",
23
- "src/feature-flags.js"
21
+ "**/feature-flags.js"
24
22
  ],
25
23
  "files": [
26
24
  "css",
@@ -121,5 +119,5 @@
121
119
  "react": "^16.8.6 || ^17.0.1 || ^18.2.0",
122
120
  "react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
123
121
  },
124
- "gitHead": "3b3c4874302df3cb3d4498e61d93a63e72e65166"
122
+ "gitHead": "578f1cfbc3b7815edb102dc1fd1f2740b32ce0d6"
125
123
  }