@pingux/astro 2.65.0-alpha.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.
Files changed (39) hide show
  1. package/lib/cjs/components/DataTable/DataTable.d.ts +4 -0
  2. package/lib/cjs/components/DataTable/DataTable.js +28 -108
  3. package/lib/cjs/components/DataTable/DataTable.stories.d.ts +202 -0
  4. package/lib/cjs/components/DataTable/DataTable.stories.js +37 -41
  5. package/lib/cjs/components/DataTable/DataTable.styles.d.ts +141 -0
  6. package/lib/cjs/components/DataTable/DataTable.test.d.ts +1 -0
  7. package/lib/cjs/components/DataTable/DataTable.test.js +119 -116
  8. package/lib/cjs/components/DataTable/DataTableBadge.d.ts +4 -0
  9. package/lib/cjs/components/DataTable/DataTableBadge.js +2 -6
  10. package/lib/cjs/components/DataTable/DataTableBadge.test.d.ts +1 -0
  11. package/lib/cjs/components/DataTable/DataTableMenu.d.ts +3 -0
  12. package/lib/cjs/components/DataTable/DataTableMenu.test.d.ts +1 -0
  13. package/lib/cjs/components/DataTable/DataTableMultiLine.d.ts +4 -0
  14. package/lib/cjs/components/DataTable/DataTableMultiLine.js +2 -2
  15. package/lib/cjs/components/DataTable/DataTableMultiLine.test.d.ts +1 -0
  16. package/lib/cjs/components/DataTable/DataTableMultiLine.test.js +1 -2
  17. package/lib/cjs/components/DataTable/DataTableVirtualizer.d.ts +8 -0
  18. package/lib/cjs/components/DataTable/DataTableVirtualizer.js +12 -36
  19. package/lib/cjs/components/DataTable/index.d.ts +5 -0
  20. package/lib/cjs/types/dataTable.d.ts +88 -0
  21. package/lib/cjs/types/dataTable.js +6 -0
  22. package/lib/cjs/types/index.d.ts +1 -0
  23. package/lib/cjs/types/index.js +45 -34
  24. package/lib/cjs/types/shared/index.d.ts +1 -0
  25. package/lib/cjs/types/shared/index.js +16 -5
  26. package/lib/cjs/types/shared/loadingState.d.ts +1 -0
  27. package/lib/cjs/types/shared/loadingState.js +6 -0
  28. package/lib/components/DataTable/DataTable.js +28 -108
  29. package/lib/components/DataTable/DataTable.stories.js +37 -41
  30. package/lib/components/DataTable/DataTable.test.js +118 -116
  31. package/lib/components/DataTable/DataTableBadge.js +2 -6
  32. package/lib/components/DataTable/DataTableMultiLine.js +2 -2
  33. package/lib/components/DataTable/DataTableMultiLine.test.js +1 -2
  34. package/lib/components/DataTable/DataTableVirtualizer.js +13 -37
  35. package/lib/types/dataTable.js +1 -0
  36. package/lib/types/index.js +1 -0
  37. package/lib/types/shared/index.js +1 -0
  38. package/lib/types/shared/loadingState.js +1 -0
  39. 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 : null,
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' : null
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(cell.key, "_")).call(_context, item.accountId),
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.75",
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", "setTableWidth", "getColumnWidth", "onVisibleRectChange"];
4
- import React, { forwardRef, useCallback, useRef } from 'react';
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 PropTypes from 'prop-types';
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
- var headerRef = useRef(ref);
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
- // eslint-disable-next-line no-param-reassign
41
- bodyRef.current.scrollTop = rect.y;
42
- setScrollLeft(bodyRef.current, direction, rect.x);
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.scrollLeft = bodyRef.current.scrollLeft;
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 {};
@@ -8,6 +8,7 @@ export * from './buttonBar';
8
8
  export * from './calendar';
9
9
  export * from './card';
10
10
  export * from './copyText';
11
+ export * from './dataTable';
11
12
  export * from './environmentBreadcrumb';
12
13
  export * from './fieldHelperText';
13
14
  export * from './helpHint';
@@ -1,5 +1,6 @@
1
1
  export * from './dom';
2
2
  export * from './events';
3
+ export * from './loadingState';
3
4
  export * from './orientation';
4
5
  export * from './style';
5
6
  export * from './utils';
@@ -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-alpha.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.3",
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",