@pingux/astro 2.65.0 → 2.65.1-alpha.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/lib/cjs/components/DataTable/DataTable.d.ts +4 -0
- package/lib/cjs/components/DataTable/DataTable.js +28 -108
- package/lib/cjs/components/DataTable/DataTable.stories.d.ts +202 -0
- package/lib/cjs/components/DataTable/DataTable.stories.js +37 -41
- package/lib/cjs/components/DataTable/DataTable.styles.d.ts +141 -0
- package/lib/cjs/components/DataTable/DataTable.test.d.ts +1 -0
- package/lib/cjs/components/DataTable/DataTable.test.js +119 -116
- package/lib/cjs/components/DataTable/DataTableBadge.d.ts +4 -0
- package/lib/cjs/components/DataTable/DataTableBadge.js +2 -6
- package/lib/cjs/components/DataTable/DataTableBadge.test.d.ts +1 -0
- package/lib/cjs/components/DataTable/DataTableMenu.d.ts +3 -0
- package/lib/cjs/components/DataTable/DataTableMenu.test.d.ts +1 -0
- package/lib/cjs/components/DataTable/DataTableMultiLine.d.ts +4 -0
- package/lib/cjs/components/DataTable/DataTableMultiLine.js +2 -2
- package/lib/cjs/components/DataTable/DataTableMultiLine.test.d.ts +1 -0
- package/lib/cjs/components/DataTable/DataTableMultiLine.test.js +1 -2
- package/lib/cjs/components/DataTable/DataTableVirtualizer.d.ts +8 -0
- package/lib/cjs/components/DataTable/DataTableVirtualizer.js +12 -36
- package/lib/cjs/components/DataTable/index.d.ts +5 -0
- package/lib/cjs/types/dataTable.d.ts +88 -0
- package/lib/cjs/types/dataTable.js +6 -0
- package/lib/cjs/types/index.d.ts +1 -0
- package/lib/cjs/types/index.js +45 -34
- package/lib/cjs/types/shared/index.d.ts +1 -0
- package/lib/cjs/types/shared/index.js +16 -5
- package/lib/cjs/types/shared/loadingState.d.ts +1 -0
- package/lib/cjs/types/shared/loadingState.js +6 -0
- package/lib/components/DataTable/DataTable.js +28 -108
- package/lib/components/DataTable/DataTable.stories.js +37 -41
- package/lib/components/DataTable/DataTable.test.js +118 -116
- package/lib/components/DataTable/DataTableBadge.js +2 -6
- package/lib/components/DataTable/DataTableMultiLine.js +2 -2
- package/lib/components/DataTable/DataTableMultiLine.test.js +1 -2
- package/lib/components/DataTable/DataTableVirtualizer.js +13 -37
- package/lib/types/dataTable.js +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/shared/index.js +1 -0
- package/lib/types/shared/loadingState.js +1 -0
- package/package.json +3 -2
@@ -3,7 +3,6 @@ import React, { forwardRef } from 'react';
|
|
3
3
|
import AlertCircleIcon from '@pingux/mdi-react/AlertCircleIcon';
|
4
4
|
import AlertIcon from '@pingux/mdi-react/AlertIcon';
|
5
5
|
import CheckIcon from '@pingux/mdi-react/CheckIcon';
|
6
|
-
import PropTypes from 'prop-types';
|
7
6
|
import { Badge, Icon } from '../../index';
|
8
7
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
9
8
|
var DataTableBadge = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
@@ -21,16 +20,13 @@ var DataTableBadge = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
21
20
|
flexDirection: 'row-reverse !important'
|
22
21
|
}
|
23
22
|
}, cell && cell !== 'Pending' && ___EmotionJSX(Icon, {
|
24
|
-
icon: cell === 'Approved' ? CheckIcon : cell === 'Rejected' ? AlertCircleIcon : cell === 'Failed' ? AlertIcon :
|
23
|
+
icon: cell === 'Approved' ? CheckIcon : cell === 'Rejected' ? AlertCircleIcon : cell === 'Failed' ? AlertIcon : undefined,
|
25
24
|
title: {
|
26
|
-
name: cell === 'Approved' ? 'Check Icon' : cell === 'Rejected' ? 'Alert Circle Icon' : cell === 'Failed' ? 'Alert Icon' :
|
25
|
+
name: cell === 'Approved' ? 'Check Icon' : cell === 'Rejected' ? 'Alert Circle Icon' : cell === 'Failed' ? 'Alert Icon' : ''
|
27
26
|
},
|
28
27
|
mr: "xs",
|
29
28
|
size: "14px",
|
30
29
|
color: color
|
31
30
|
}));
|
32
31
|
});
|
33
|
-
DataTableBadge.propTypes = {
|
34
|
-
cell: PropTypes.string
|
35
|
-
};
|
36
32
|
export default DataTableBadge;
|
@@ -9,7 +9,7 @@ var DataTableMultiLine = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
9
9
|
return ___EmotionJSX(React.Fragment, null, _mapInstanceProperty(cell).call(cell, function (item) {
|
10
10
|
var _context;
|
11
11
|
return ___EmotionJSX(Box, {
|
12
|
-
key: _concatInstanceProperty(_context = "".concat(
|
12
|
+
key: _concatInstanceProperty(_context = "".concat(item.key, "_")).call(_context, item.accountId),
|
13
13
|
ref: ref
|
14
14
|
}, ___EmotionJSX(Box, {
|
15
15
|
sx: {
|
@@ -24,7 +24,7 @@ var DataTableMultiLine = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
24
24
|
}, ___EmotionJSX(Icon, {
|
25
25
|
icon: item.icon,
|
26
26
|
color: "accent.40",
|
27
|
-
size: "18.
|
27
|
+
size: "18.75px",
|
28
28
|
title: {
|
29
29
|
name: "Icon for ".concat(item.name)
|
30
30
|
}
|
@@ -10,8 +10,7 @@ var cell = [{
|
|
10
10
|
icon: ApplicationIcon,
|
11
11
|
accountId: 123
|
12
12
|
}];
|
13
|
-
var getComponent = function getComponent() {
|
14
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
13
|
+
var getComponent = function getComponent(props) {
|
15
14
|
return render(___EmotionJSX(DataTableMultiLine, props));
|
16
15
|
};
|
17
16
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
|
-
var _excluded = ["layout", "collection", "renderView", "renderWrapper", "domRef", "bodyRef", "
|
4
|
-
import React, { forwardRef, useCallback
|
3
|
+
var _excluded = ["layout", "collection", "renderView", "renderWrapper", "domRef", "bodyRef", "onVisibleRectChange"];
|
4
|
+
import React, { forwardRef, useCallback } from 'react';
|
5
5
|
import { chain, mergeProps, useLayoutEffect } from '@react-aria/utils';
|
6
6
|
import { ScrollView, setScrollLeft, useVirtualizer } from '@react-aria/virtualizer';
|
7
7
|
import { useVirtualizerState } from '@react-stately/virtualizer';
|
8
|
-
import
|
8
|
+
import { useLocalOrForwardRef } from '../../hooks';
|
9
9
|
import { Box } from '../../index';
|
10
10
|
|
11
11
|
/**
|
@@ -21,12 +21,11 @@ var DataTableVirtualizer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
21
21
|
renderWrapper = _ref.renderWrapper,
|
22
22
|
domRef = _ref.domRef,
|
23
23
|
bodyRef = _ref.bodyRef,
|
24
|
-
setTableWidth = _ref.setTableWidth,
|
25
|
-
getColumnWidth = _ref.getColumnWidth,
|
26
24
|
onVisibleRectChangeProp = _ref.onVisibleRectChange,
|
27
25
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
28
26
|
var direction = 'ltr'; // useLocale override
|
29
|
-
|
27
|
+
|
28
|
+
var headerRef = useLocalOrForwardRef(ref);
|
30
29
|
var loadingState = collection.body.props.loadingState;
|
31
30
|
var isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
|
32
31
|
var onLoadMore = collection.body.props.onLoadMore;
|
@@ -37,9 +36,11 @@ var DataTableVirtualizer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
37
36
|
renderView: renderView,
|
38
37
|
renderWrapper: renderWrapper,
|
39
38
|
onVisibleRectChange: function onVisibleRectChange(rect) {
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
if (bodyRef.current) {
|
40
|
+
// eslint-disable-next-line no-param-reassign
|
41
|
+
bodyRef.current.scrollTop = rect.y;
|
42
|
+
setScrollLeft(bodyRef.current, direction, rect.x);
|
43
|
+
}
|
43
44
|
},
|
44
45
|
transitionDuration: isLoading ? 160 : 220
|
45
46
|
});
|
@@ -69,7 +70,9 @@ var DataTableVirtualizer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
69
70
|
|
70
71
|
// Sync the scroll position from the table body to the header container.
|
71
72
|
var onScroll = useCallback(function () {
|
72
|
-
headerRef.current
|
73
|
+
if (headerRef.current && bodyRef.current) {
|
74
|
+
headerRef.current.scrollLeft = bodyRef.current.scrollLeft;
|
75
|
+
}
|
73
76
|
}, [bodyRef]);
|
74
77
|
var onVisibleRectChange = useCallback(function (rect) {
|
75
78
|
state.setVisibleRect(rect);
|
@@ -103,7 +106,6 @@ var DataTableVirtualizer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
103
106
|
},
|
104
107
|
ref: headerRef
|
105
108
|
}, state.visibleViews[0]), ___EmotionJSX(ScrollView, {
|
106
|
-
variant: "dataTable.tableBody",
|
107
109
|
style: {
|
108
110
|
flex: 1
|
109
111
|
},
|
@@ -120,30 +122,4 @@ var DataTableVirtualizer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
120
122
|
tabIndex: 0
|
121
123
|
}, state.visibleViews[1]));
|
122
124
|
});
|
123
|
-
DataTableVirtualizer.propTypes = {
|
124
|
-
bodyRef: PropTypes.shape({
|
125
|
-
current: PropTypes.shape({
|
126
|
-
scrollLeft: PropTypes.number,
|
127
|
-
scrollTop: PropTypes.number
|
128
|
-
})
|
129
|
-
}),
|
130
|
-
collection: PropTypes.shape({
|
131
|
-
body: PropTypes.shape({
|
132
|
-
props: PropTypes.shape({
|
133
|
-
loadingState: PropTypes.string,
|
134
|
-
onLoadMore: PropTypes.func
|
135
|
-
})
|
136
|
-
}),
|
137
|
-
getItem: PropTypes.func
|
138
|
-
}),
|
139
|
-
domRef: PropTypes.shape({}),
|
140
|
-
getColumnWidth: PropTypes.func,
|
141
|
-
layout: PropTypes.shape({
|
142
|
-
getLayoutInfo: PropTypes.func
|
143
|
-
}),
|
144
|
-
onVisibleRectChange: PropTypes.func,
|
145
|
-
renderView: PropTypes.func,
|
146
|
-
renderWrapper: PropTypes.func,
|
147
|
-
setTableWidth: PropTypes.func
|
148
|
-
};
|
149
125
|
export default DataTableVirtualizer;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/lib/types/index.js
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pingux/astro",
|
3
|
-
"version": "2.65.0",
|
3
|
+
"version": "2.65.1-alpha.0",
|
4
4
|
"description": "React component library for Ping Identity's design system",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -87,9 +87,10 @@
|
|
87
87
|
"@react-stately/tree": "^3.7.4",
|
88
88
|
"@react-stately/virtualizer": "~3.6.5",
|
89
89
|
"@react-types/accordion": "^3.0.0-alpha.18",
|
90
|
-
"@react-types/grid": "^3.2.
|
90
|
+
"@react-types/grid": "^3.2.4",
|
91
91
|
"@react-types/select": "^3.9.1",
|
92
92
|
"@react-types/shared": "^3.22.0",
|
93
|
+
"@react-types/table": "^3.9.3",
|
93
94
|
"@storybook/addon-actions": "^7.1.0",
|
94
95
|
"@storybook/api": "^7.1.0",
|
95
96
|
"@storybook/components": "^7.1.0",
|