@carbon/ibm-products 2.100.0 → 2.101.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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +485 -387
- package/css/index-full-carbon.css +2 -1
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +2 -1
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +2 -1
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +2 -1
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/Datagrid/useSortableColumns.d.ts.map +1 -1
- package/es/components/Datagrid/useSortableColumns.js +0 -7
- package/es/global/js/hooks/useOverflowItems/useOverflowItems.d.ts.map +1 -1
- package/es/global/js/hooks/useOverflowItems/useOverflowItems.js +17 -12
- package/es/global/js/hooks/useWindowResize.d.ts.map +1 -1
- package/es/global/js/hooks/useWindowResize.js +5 -2
- package/lib/components/Datagrid/useSortableColumns.d.ts.map +1 -1
- package/lib/components/Datagrid/useSortableColumns.js +0 -7
- package/lib/global/js/hooks/useOverflowItems/useOverflowItems.d.ts.map +1 -1
- package/lib/global/js/hooks/useOverflowItems/useOverflowItems.js +17 -12
- package/lib/global/js/hooks/useWindowResize.d.ts.map +1 -1
- package/lib/global/js/hooks/useWindowResize.js +5 -2
- package/package.json +6 -6
- package/scss/components/Tearsheet/_tearsheet_next.scss +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSortableColumns.d.ts","sourceRoot":"","sources":["../../../src/components/Datagrid/useSortableColumns.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,EAAE,KAAK,EAAiB,MAAM,aAAa,CAAC;AAGnD,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,WAAW,EAAE,SAAS,GAAG,OAAO,CAAC;CAClC;AAID,eAAO,MAAM,eAAe,GAAI,eAAe,OAAO,GAAG,MAAM,UAwB9D,CAAC;
|
|
1
|
+
{"version":3,"file":"useSortableColumns.d.ts","sourceRoot":"","sources":["../../../src/components/Datagrid/useSortableColumns.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,EAAE,KAAK,EAAiB,MAAM,aAAa,CAAC;AAGnD,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,WAAW,EAAE,SAAS,GAAG,OAAO,CAAC;CAClC;AAID,eAAO,MAAM,eAAe,GAAI,eAAe,OAAO,GAAG,MAAM,UAwB9D,CAAC;AAQF,QAAA,MAAM,kBAAkB,GAAI,OAAO,KAAK,SA4GvC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -41,12 +41,6 @@ const getNewSortOrder = (currentOrder) => {
|
|
|
41
41
|
}
|
|
42
42
|
return order;
|
|
43
43
|
};
|
|
44
|
-
const getAriaPressedValue = (col) => {
|
|
45
|
-
if (!col) return;
|
|
46
|
-
const { isSorted } = col;
|
|
47
|
-
if (isSorted) return "true";
|
|
48
|
-
return "false";
|
|
49
|
-
};
|
|
50
44
|
const useSortableColumns = (hooks) => {
|
|
51
45
|
const carbonPrefix = usePrefix();
|
|
52
46
|
const sortableVisibleColumns = (visibleColumns, { instance }) => {
|
|
@@ -81,7 +75,6 @@ const useSortableColumns = (hooks) => {
|
|
|
81
75
|
if (key === "Enter") setTimeout(() => document.getElementById(columnId)?.focus(), 0);
|
|
82
76
|
};
|
|
83
77
|
const Header = (headerProp) => column.disableSortBy === true || column.id === "datagridSelection" || column.isAction ? column.disableSortBy || column.isAction ? column.Header : /* @__PURE__ */ React.createElement(SelectAll, instance) : /* @__PURE__ */ React.createElement(Button, {
|
|
84
|
-
"aria-pressed": getAriaPressedValue(headerProp?.column),
|
|
85
78
|
onClick: (event) => onSortClick(event, headerProp?.column),
|
|
86
79
|
kind: "ghost",
|
|
87
80
|
renderIcon: (props) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOverflowItems.d.ts","sourceRoot":"","sources":["../../../../../src/global/js/hooks/useOverflowItems/useOverflowItems.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAoB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useOverflowItems.d.ts","sourceRoot":"","sources":["../../../../../src/global/js/hooks/useOverflowItems/useOverflowItems.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAoB,MAAM,OAAO,CAAC;AAIpD,KAAK,IAAI,GAAG;IACV,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,IAAI,EAC7C,KAAK,EAAE,CAAC,EAAO,EACf,YAAY,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAC3C,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACzC,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;IACjB,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,KAAK,IAAI,GACT;IACD,YAAY,EAAE,CAAC,EAAE,CAAC;IAClB,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/D,WAAW,EAAE,CAAC,EAAE,CAAC;IACjB,gBAAgB,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,WAAW,CAAC;CAC7D,CAwIA"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { useIsomorphicEffect } from "../useIsomorphicEffect.js";
|
|
8
9
|
import { useResizeObserver } from "../useResizeObserver.js";
|
|
9
10
|
import { useRef, useState } from "react";
|
|
10
11
|
//#region src/global/js/hooks/useOverflowItems/useOverflowItems.ts
|
|
@@ -73,18 +74,22 @@ function useOverflowItems(items = [], containerRef, offsetRef, maxItems, onChang
|
|
|
73
74
|
};
|
|
74
75
|
const visibleItems = getVisibleItems();
|
|
75
76
|
const hiddenItems = items.slice(visibleItems?.length);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
const onChangeRef = useRef(onChange);
|
|
78
|
+
onChangeRef.current = onChange;
|
|
79
|
+
useIsomorphicEffect(() => {
|
|
80
|
+
if (visibleItems?.length !== visibleItemCount.current || remainingWidth !== minWidthRef.current || requiredWidth !== requiredWidthRef.current) {
|
|
81
|
+
visibleItemCount.current = visibleItems?.length;
|
|
82
|
+
minWidthRef.current = remainingWidth;
|
|
83
|
+
requiredWidthRef.current = requiredWidth;
|
|
84
|
+
const firstItemKey = getMap()?.keys()?.next()?.value || "";
|
|
85
|
+
const firstItemWidth = getMap()?.get(firstItemKey) || 0;
|
|
86
|
+
onChangeRef.current?.({
|
|
87
|
+
hiddenItems,
|
|
88
|
+
minWidth: remainingWidth,
|
|
89
|
+
maxWidth: requiredWidth + firstItemWidth
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
88
93
|
return {
|
|
89
94
|
visibleItems,
|
|
90
95
|
itemRefHandler,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowResize.d.ts","sourceRoot":"","sources":["../../../../src/global/js/hooks/useWindowResize.js"],"names":[],"mappings":"AAqBO,
|
|
1
|
+
{"version":3,"file":"useWindowResize.d.ts","sourceRoot":"","sources":["../../../../src/global/js/hooks/useWindowResize.js"],"names":[],"mappings":"AAqBO,yFA0CN"}
|
|
@@ -49,8 +49,11 @@ const useWindowResize = (effect, deps, throttleInterval = 0) => {
|
|
|
49
49
|
} else doGetWindowSize();
|
|
50
50
|
};
|
|
51
51
|
window.addEventListener("resize", handleResize);
|
|
52
|
-
doGetWindowSize
|
|
53
|
-
return () =>
|
|
52
|
+
const initialSizeId = setTimeout(doGetWindowSize, 0);
|
|
53
|
+
return () => {
|
|
54
|
+
window.removeEventListener("resize", handleResize);
|
|
55
|
+
clearTimeout(initialSizeId);
|
|
56
|
+
};
|
|
54
57
|
}, deps);
|
|
55
58
|
};
|
|
56
59
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSortableColumns.d.ts","sourceRoot":"","sources":["../../../src/components/Datagrid/useSortableColumns.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,EAAE,KAAK,EAAiB,MAAM,aAAa,CAAC;AAGnD,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,WAAW,EAAE,SAAS,GAAG,OAAO,CAAC;CAClC;AAID,eAAO,MAAM,eAAe,GAAI,eAAe,OAAO,GAAG,MAAM,UAwB9D,CAAC;
|
|
1
|
+
{"version":3,"file":"useSortableColumns.d.ts","sourceRoot":"","sources":["../../../src/components/Datagrid/useSortableColumns.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,EAAE,KAAK,EAAiB,MAAM,aAAa,CAAC;AAGnD,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,WAAW,EAAE,SAAS,GAAG,OAAO,CAAC;CAClC;AAID,eAAO,MAAM,eAAe,GAAI,eAAe,OAAO,GAAG,MAAM,UAwB9D,CAAC;AAQF,QAAA,MAAM,kBAAkB,GAAI,OAAO,KAAK,SA4GvC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -42,12 +42,6 @@ const getNewSortOrder = (currentOrder) => {
|
|
|
42
42
|
}
|
|
43
43
|
return order;
|
|
44
44
|
};
|
|
45
|
-
const getAriaPressedValue = (col) => {
|
|
46
|
-
if (!col) return;
|
|
47
|
-
const { isSorted } = col;
|
|
48
|
-
if (isSorted) return "true";
|
|
49
|
-
return "false";
|
|
50
|
-
};
|
|
51
45
|
const useSortableColumns = (hooks) => {
|
|
52
46
|
const carbonPrefix = (0, _carbon_react.usePrefix)();
|
|
53
47
|
const sortableVisibleColumns = (visibleColumns, { instance }) => {
|
|
@@ -82,7 +76,6 @@ const useSortableColumns = (hooks) => {
|
|
|
82
76
|
if (key === "Enter") setTimeout(() => document.getElementById(columnId)?.focus(), 0);
|
|
83
77
|
};
|
|
84
78
|
const Header = (headerProp) => column.disableSortBy === true || column.id === "datagridSelection" || column.isAction ? column.disableSortBy || column.isAction ? column.Header : /* @__PURE__ */ react.default.createElement(require_DatagridSelectAll.SelectAll, instance) : /* @__PURE__ */ react.default.createElement(_carbon_react.Button, {
|
|
85
|
-
"aria-pressed": getAriaPressedValue(headerProp?.column),
|
|
86
79
|
onClick: (event) => onSortClick(event, headerProp?.column),
|
|
87
80
|
kind: "ghost",
|
|
88
81
|
renderIcon: (props) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOverflowItems.d.ts","sourceRoot":"","sources":["../../../../../src/global/js/hooks/useOverflowItems/useOverflowItems.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAoB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useOverflowItems.d.ts","sourceRoot":"","sources":["../../../../../src/global/js/hooks/useOverflowItems/useOverflowItems.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAoB,MAAM,OAAO,CAAC;AAIpD,KAAK,IAAI,GAAG;IACV,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,IAAI,EAC7C,KAAK,EAAE,CAAC,EAAO,EACf,YAAY,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAC3C,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACzC,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;IACjB,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,KAAK,IAAI,GACT;IACD,YAAY,EAAE,CAAC,EAAE,CAAC;IAClB,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/D,WAAW,EAAE,CAAC,EAAE,CAAC;IACjB,gBAAgB,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,WAAW,CAAC;CAC7D,CAwIA"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
require("../../../../_virtual/_rolldown/runtime.js");
|
|
9
|
+
const require_useIsomorphicEffect = require("../useIsomorphicEffect.js");
|
|
9
10
|
const require_useResizeObserver = require("../useResizeObserver.js");
|
|
10
11
|
let react = require("react");
|
|
11
12
|
//#region src/global/js/hooks/useOverflowItems/useOverflowItems.ts
|
|
@@ -74,18 +75,22 @@ function useOverflowItems(items = [], containerRef, offsetRef, maxItems, onChang
|
|
|
74
75
|
};
|
|
75
76
|
const visibleItems = getVisibleItems();
|
|
76
77
|
const hiddenItems = items.slice(visibleItems?.length);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
const onChangeRef = (0, react.useRef)(onChange);
|
|
79
|
+
onChangeRef.current = onChange;
|
|
80
|
+
require_useIsomorphicEffect.useIsomorphicEffect(() => {
|
|
81
|
+
if (visibleItems?.length !== visibleItemCount.current || remainingWidth !== minWidthRef.current || requiredWidth !== requiredWidthRef.current) {
|
|
82
|
+
visibleItemCount.current = visibleItems?.length;
|
|
83
|
+
minWidthRef.current = remainingWidth;
|
|
84
|
+
requiredWidthRef.current = requiredWidth;
|
|
85
|
+
const firstItemKey = getMap()?.keys()?.next()?.value || "";
|
|
86
|
+
const firstItemWidth = getMap()?.get(firstItemKey) || 0;
|
|
87
|
+
onChangeRef.current?.({
|
|
88
|
+
hiddenItems,
|
|
89
|
+
minWidth: remainingWidth,
|
|
90
|
+
maxWidth: requiredWidth + firstItemWidth
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
89
94
|
return {
|
|
90
95
|
visibleItems,
|
|
91
96
|
itemRefHandler,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowResize.d.ts","sourceRoot":"","sources":["../../../../src/global/js/hooks/useWindowResize.js"],"names":[],"mappings":"AAqBO,
|
|
1
|
+
{"version":3,"file":"useWindowResize.d.ts","sourceRoot":"","sources":["../../../../src/global/js/hooks/useWindowResize.js"],"names":[],"mappings":"AAqBO,yFA0CN"}
|
|
@@ -50,8 +50,11 @@ const useWindowResize = (effect, deps, throttleInterval = 0) => {
|
|
|
50
50
|
} else doGetWindowSize();
|
|
51
51
|
};
|
|
52
52
|
window.addEventListener("resize", handleResize);
|
|
53
|
-
doGetWindowSize
|
|
54
|
-
return () =>
|
|
53
|
+
const initialSizeId = setTimeout(doGetWindowSize, 0);
|
|
54
|
+
return () => {
|
|
55
|
+
window.removeEventListener("resize", handleResize);
|
|
56
|
+
clearTimeout(initialSizeId);
|
|
57
|
+
};
|
|
55
58
|
}, deps);
|
|
56
59
|
};
|
|
57
60
|
//#endregion
|
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.
|
|
4
|
+
"version": "2.101.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@babel/preset-react": "^7.26.3",
|
|
68
68
|
"@babel/preset-typescript": "^7.26.0",
|
|
69
69
|
"@carbon/charts-react": "^1.27.18",
|
|
70
|
-
"@carbon/ibm-products-utilities": "1.
|
|
70
|
+
"@carbon/ibm-products-utilities": "1.10.0",
|
|
71
71
|
"@carbon/styles": "^1.114.0",
|
|
72
72
|
"@figma/code-connect": "^1.4.0",
|
|
73
73
|
"@ibm/telemetry-js-config-generator": "^2.0.1",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@types/react-table": "^7.7.20",
|
|
81
81
|
"@vitejs/plugin-react": "^5.0.0",
|
|
82
82
|
"babel-plugin-dev-expression": "^0.2.3",
|
|
83
|
-
"babel-preset-ibm-cloud-cognitive": "^0.
|
|
83
|
+
"babel-preset-ibm-cloud-cognitive": "^0.59.0",
|
|
84
84
|
"change-case": "5.4.4",
|
|
85
85
|
"classnames": "^2.5.1",
|
|
86
86
|
"copyfiles": "^2.4.1",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"fs-extra": "^11.3.0",
|
|
89
89
|
"glob": "^13.0.0",
|
|
90
90
|
"jest": "^30.0.5",
|
|
91
|
-
"jest-config-ibm-cloud-cognitive": "^1.
|
|
91
|
+
"jest-config-ibm-cloud-cognitive": "^1.60.0",
|
|
92
92
|
"jest-environment-jsdom": "^30.0.5",
|
|
93
93
|
"namor": "^1.1.2",
|
|
94
94
|
"npm-run-all2": "^8.0.0",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@babel/runtime": "^7.26.10",
|
|
109
109
|
"@carbon-labs/react-resizer": "^0.25.0",
|
|
110
110
|
"@carbon/feature-flags": "^1.8.0",
|
|
111
|
-
"@carbon/ibm-products-styles": "^2.
|
|
111
|
+
"@carbon/ibm-products-styles": "^2.97.0",
|
|
112
112
|
"@carbon/telemetry": "^0.1.0",
|
|
113
113
|
"@carbon/utilities": "^0.25.0",
|
|
114
114
|
"@carbon/utilities-react": "0.28.0",
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0 || ^19.0.0",
|
|
133
133
|
"react-is": "^16.13.1 || ^17.0.2 || ^18.3.1 || ^19.0.0"
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "98ae41eaf299c34c31791548eb153ea1f99263d7"
|
|
136
136
|
}
|
|
@@ -500,7 +500,7 @@ $transform-start: translate3d(0, calc(min(95vh, 500px)), 0);
|
|
|
500
500
|
@include type.type-style('label-01');
|
|
501
501
|
|
|
502
502
|
color: $text-secondary;
|
|
503
|
-
margin-block
|
|
503
|
+
margin-block: 0 $spacing-02;
|
|
504
504
|
}
|
|
505
505
|
|
|
506
506
|
.#{$block-class__next}__header-title {
|
|
@@ -514,6 +514,7 @@ $transform-start: translate3d(0, calc(min(95vh, 500px)), 0);
|
|
|
514
514
|
align-items: flex-start;
|
|
515
515
|
gap: $spacing-05;
|
|
516
516
|
margin-block-end: $spacing-03;
|
|
517
|
+
margin-block-start: 0;
|
|
517
518
|
|
|
518
519
|
&--no-content-below {
|
|
519
520
|
margin-block-end: 0;
|