@pingux/astro 2.56.0-alpha.0 → 2.56.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/ListView/ListView.d.ts +11 -0
- package/lib/cjs/components/ListView/ListView.js +12 -65
- package/lib/cjs/components/ListView/ListView.stories.d.ts +169 -0
- package/lib/cjs/components/ListView/ListView.stories.js +22 -56
- package/lib/cjs/components/ListView/ListView.test.d.ts +1 -0
- package/lib/cjs/components/ListView/ListView.test.js +5 -5
- package/lib/cjs/components/ListView/ListViewContext.d.ts +7 -0
- package/lib/cjs/components/ListView/ListViewExpandableItem.d.ts +4 -0
- package/lib/cjs/components/ListView/ListViewExpandableItem.js +14 -27
- package/lib/cjs/components/ListView/ListViewFocusWrapper.d.ts +11 -0
- package/lib/cjs/components/ListView/ListViewFocusWrapper.js +3 -13
- package/lib/cjs/components/ListView/ListViewItem.d.ts +10 -0
- package/lib/cjs/components/ListView/ListViewItem.js +1 -1
- package/lib/cjs/components/ListView/index.d.ts +1 -0
- package/lib/cjs/components/ListView/listViewAttributes.d.ts +113 -0
- package/lib/cjs/components/ListView/listViewAttributes.js +74 -0
- package/lib/cjs/hooks/useExpandableListViewItem/useExpandableListViewItem.d.ts +3 -21
- package/lib/cjs/hooks/useExpandableListViewItem/useExpandableListViewItem.js +3 -1
- package/lib/cjs/hooks/useField/useField.d.ts +3 -2
- package/lib/cjs/types/box.d.ts +1 -0
- package/lib/cjs/types/listView.d.ts +69 -0
- package/lib/cjs/types/listView.js +6 -0
- package/lib/components/ListView/ListView.js +12 -65
- package/lib/components/ListView/ListView.stories.js +21 -53
- package/lib/components/ListView/ListView.test.js +5 -5
- package/lib/components/ListView/ListViewExpandableItem.js +14 -27
- package/lib/components/ListView/ListViewFocusWrapper.js +3 -13
- package/lib/components/ListView/ListViewItem.js +1 -1
- package/lib/components/ListView/listViewAttributes.js +66 -0
- package/lib/hooks/useExpandableListViewItem/useExpandableListViewItem.js +3 -1
- package/lib/types/listView.js +1 -0
- package/package.json +2 -2
@@ -13,7 +13,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/e
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
14
14
|
var _MenuDownIcon = _interopRequireDefault(require("@pingux/mdi-react/MenuDownIcon"));
|
15
15
|
var _MenuUpIcon = _interopRequireDefault(require("@pingux/mdi-react/MenuUpIcon"));
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
17
16
|
var _useExpandableListViewItem = _interopRequireDefault(require("../../hooks/useExpandableListViewItem/useExpandableListViewItem"));
|
18
17
|
var _index = require("../../index");
|
19
18
|
var _ListViewContext = require("./ListViewContext");
|
@@ -23,22 +22,25 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "functi
|
|
23
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
24
23
|
var ListViewExpandableItem = function ListViewExpandableItem(props) {
|
25
24
|
var item = props.item,
|
26
|
-
_props$item
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
_props$item = props.item,
|
26
|
+
_props$item$props = _props$item.props,
|
27
|
+
_props$item$props2 = _props$item$props === void 0 ? {} : _props$item$props,
|
28
|
+
listItemProps = _props$item$props2.listItemProps,
|
29
|
+
rowProps = _props$item$props2.rowProps,
|
30
|
+
_props$item$props2$ha = _props$item$props2.hasSeparator,
|
31
|
+
hasSeparator = _props$item$props2$ha === void 0 ? true : _props$item$props2$ha,
|
32
|
+
hasInsetSeparator = _props$item$props2.hasInsetSeparator,
|
33
|
+
key = _props$item.key,
|
32
34
|
isHoverable = props.isHoverable,
|
33
35
|
isFocusable = props.isFocusable,
|
34
36
|
className = props.className;
|
35
|
-
var key = item.key;
|
36
37
|
var _useContext = (0, _react.useContext)(_ListViewContext.ListViewContext),
|
37
38
|
state = _useContext.state;
|
38
|
-
var expandableItemRowRef = (0, _react.useRef)();
|
39
|
-
var expandableChildrenRef = (0, _react.useRef)();
|
39
|
+
var expandableItemRowRef = (0, _react.useRef)(null);
|
40
|
+
var expandableChildrenRef = (0, _react.useRef)(null);
|
40
41
|
var hookProps = {
|
41
42
|
item: item,
|
43
|
+
key: key,
|
42
44
|
listItemProps: listItemProps,
|
43
45
|
rowProps: rowProps,
|
44
46
|
hasSeparator: hasSeparator,
|
@@ -68,7 +70,7 @@ var ListViewExpandableItem = function ListViewExpandableItem(props) {
|
|
68
70
|
alignItems: 'center',
|
69
71
|
width: '100%'
|
70
72
|
}
|
71
|
-
}, item.rendered[0], (0, _react2.jsx)(_index.Icon, {
|
73
|
+
}, item.rendered && item.rendered[0], (0, _react2.jsx)(_index.Icon, {
|
72
74
|
sx: {
|
73
75
|
ml: 'auto'
|
74
76
|
},
|
@@ -79,22 +81,7 @@ var ListViewExpandableItem = function ListViewExpandableItem(props) {
|
|
79
81
|
}))), (0, _react2.jsx)(_index.Box, expandableItemState.gridCellProps, isExpanded && (0, _react2.jsx)(_ListViewFocusWrapper["default"], {
|
80
82
|
isFocusEscaped: isFocusEscaped,
|
81
83
|
containerProps: expandableContainerProps
|
82
|
-
}, item.rendered[1])));
|
83
|
-
};
|
84
|
-
ListViewExpandableItem.propTypes = {
|
85
|
-
item: _propTypes["default"].shape({
|
86
|
-
key: _propTypes["default"].string,
|
87
|
-
rendered: _propTypes["default"].node,
|
88
|
-
props: _propTypes["default"].shape({
|
89
|
-
'data-id': _propTypes["default"].string,
|
90
|
-
listItemProps: _propTypes["default"].shape({}),
|
91
|
-
rowProps: _propTypes["default"].shape({}),
|
92
|
-
hasSeparator: _propTypes["default"].bool,
|
93
|
-
hasInsetSeparator: _propTypes["default"].bool
|
94
|
-
})
|
95
|
-
}),
|
96
|
-
isHoverable: _propTypes["default"].bool,
|
97
|
-
isFocusable: _propTypes["default"].bool
|
84
|
+
}, item.rendered && item.rendered[1])));
|
98
85
|
};
|
99
86
|
var _default = ListViewExpandableItem;
|
100
87
|
exports["default"] = _default;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExpandableContainerProps } from '../../types/listView';
|
3
|
+
export declare const escapeFocusDelegate: (e: any, setIsFocusEscaped: any, focusManager: any, isFocusEscaped: any) => void;
|
4
|
+
declare const ListViewFocusWrapper: {
|
5
|
+
(props: ExpandableContainerProps): React.JSX.Element;
|
6
|
+
propTypes: {
|
7
|
+
containerProps: any;
|
8
|
+
isFocusEscaped: any;
|
9
|
+
};
|
10
|
+
};
|
11
|
+
export default ListViewFocusWrapper;
|
@@ -49,6 +49,8 @@ var escapeFocusDelegate = function escapeFocusDelegate(e, setIsFocusEscaped, foc
|
|
49
49
|
}
|
50
50
|
}
|
51
51
|
};
|
52
|
+
|
53
|
+
// eslint-disable-next-line max-len
|
52
54
|
exports.escapeFocusDelegate = escapeFocusDelegate;
|
53
55
|
var ExpandableItemChildrenContainer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
54
56
|
var children = props.children,
|
@@ -65,7 +67,7 @@ var ExpandableItemChildrenContainer = /*#__PURE__*/(0, _react.forwardRef)(functi
|
|
65
67
|
|
66
68
|
// this handles instances where a user clicks into the container.
|
67
69
|
(0, _react.useEffect)(function () {
|
68
|
-
if (isFocusWithin && !isFocusEscaped && !isFocused) {
|
70
|
+
if (isFocusWithin && !isFocusEscaped && !isFocused && setIsFocusEscaped) {
|
69
71
|
setIsFocusEscaped(true);
|
70
72
|
}
|
71
73
|
}, [isFocusWithin]);
|
@@ -78,18 +80,6 @@ var ExpandableItemChildrenContainer = /*#__PURE__*/(0, _react.forwardRef)(functi
|
|
78
80
|
}
|
79
81
|
}), children);
|
80
82
|
});
|
81
|
-
ExpandableItemChildrenContainer.propTypes = {
|
82
|
-
gridCellProps: _propTypes["default"].shape({}),
|
83
|
-
focusManager: _propTypes["default"].shape({}),
|
84
|
-
focusProps: _propTypes["default"].shape({}),
|
85
|
-
focusWithinProps: _propTypes["default"].shape({}),
|
86
|
-
isFocusEscaped: _propTypes["default"].bool,
|
87
|
-
isFocused: _propTypes["default"].bool,
|
88
|
-
isFocusWithin: _propTypes["default"].bool,
|
89
|
-
expandableContainerOnBlur: _propTypes["default"].func,
|
90
|
-
expandableContainerOnFocus: _propTypes["default"].func,
|
91
|
-
setIsFocusEscaped: _propTypes["default"].func
|
92
|
-
};
|
93
83
|
var ListViewFocusWrapper = function ListViewFocusWrapper(props) {
|
94
84
|
var children = props.children,
|
95
85
|
containerProps = props.containerProps,
|
@@ -47,7 +47,7 @@ var ListViewItem = function ListViewItem(props) {
|
|
47
47
|
var _useContext = (0, _react.useContext)(_ListViewContext.ListViewContext),
|
48
48
|
state = _useContext.state;
|
49
49
|
var isDisabled = state.disabledKeys.has(item.key);
|
50
|
-
var rowRef = (0, _react.useRef)();
|
50
|
+
var rowRef = (0, _react.useRef)(null);
|
51
51
|
var isSelectable = state.selectionManager.selectionMode !== 'none';
|
52
52
|
var _useFocusRing = (0, _reactAria.useFocusRing)({
|
53
53
|
within: true
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './ListView';
|
@@ -0,0 +1,113 @@
|
|
1
|
+
export declare const listViewArgTypes: {
|
2
|
+
loadingState: {
|
3
|
+
description: string;
|
4
|
+
control: string;
|
5
|
+
options: any;
|
6
|
+
};
|
7
|
+
disabledKeys: {
|
8
|
+
description: string;
|
9
|
+
};
|
10
|
+
defaultExpandedKeys: {
|
11
|
+
description: string;
|
12
|
+
};
|
13
|
+
expandedKeys: {
|
14
|
+
description: string;
|
15
|
+
};
|
16
|
+
onExpandedChange: {
|
17
|
+
description: string;
|
18
|
+
};
|
19
|
+
items: {
|
20
|
+
description: string;
|
21
|
+
};
|
22
|
+
id: {
|
23
|
+
description: string;
|
24
|
+
};
|
25
|
+
isHoverable: {
|
26
|
+
description: string;
|
27
|
+
};
|
28
|
+
'aria-label': {
|
29
|
+
type: {
|
30
|
+
summary: string;
|
31
|
+
};
|
32
|
+
control: {
|
33
|
+
type: string;
|
34
|
+
};
|
35
|
+
table: {
|
36
|
+
category: string;
|
37
|
+
};
|
38
|
+
description: string;
|
39
|
+
};
|
40
|
+
'aria-labelledby': {
|
41
|
+
type: {
|
42
|
+
summary: string;
|
43
|
+
};
|
44
|
+
control: {
|
45
|
+
type: string;
|
46
|
+
};
|
47
|
+
table: {
|
48
|
+
category: string;
|
49
|
+
};
|
50
|
+
description: string;
|
51
|
+
};
|
52
|
+
'aria-describedby': {
|
53
|
+
type: {
|
54
|
+
summary: string;
|
55
|
+
};
|
56
|
+
control: {
|
57
|
+
type: string;
|
58
|
+
};
|
59
|
+
table: {
|
60
|
+
category: string;
|
61
|
+
};
|
62
|
+
description: string;
|
63
|
+
};
|
64
|
+
'aria-details': {
|
65
|
+
type: {
|
66
|
+
summary: string;
|
67
|
+
};
|
68
|
+
control: {
|
69
|
+
type: string;
|
70
|
+
};
|
71
|
+
table: {
|
72
|
+
category: string;
|
73
|
+
};
|
74
|
+
description: string;
|
75
|
+
};
|
76
|
+
selectedKeys: {
|
77
|
+
description: string;
|
78
|
+
};
|
79
|
+
selectionMode: {
|
80
|
+
description: string;
|
81
|
+
};
|
82
|
+
selectionStyle: {};
|
83
|
+
onSelectionChange: {
|
84
|
+
description: string;
|
85
|
+
};
|
86
|
+
onLoadMore: {
|
87
|
+
description: string;
|
88
|
+
};
|
89
|
+
'aria-controls': {
|
90
|
+
type: {
|
91
|
+
summary: string;
|
92
|
+
};
|
93
|
+
control: {
|
94
|
+
type: string;
|
95
|
+
};
|
96
|
+
table: {
|
97
|
+
category: string;
|
98
|
+
};
|
99
|
+
description: string;
|
100
|
+
};
|
101
|
+
'aria-errormessage': {
|
102
|
+
type: {
|
103
|
+
summary: string;
|
104
|
+
};
|
105
|
+
control: {
|
106
|
+
type: string;
|
107
|
+
};
|
108
|
+
table: {
|
109
|
+
category: string;
|
110
|
+
};
|
111
|
+
description: string;
|
112
|
+
};
|
113
|
+
};
|
@@ -0,0 +1,74 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
4
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
5
|
+
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
6
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
7
|
+
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
8
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
9
|
+
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
10
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
11
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
12
|
+
_Object$defineProperty(exports, "__esModule", {
|
13
|
+
value: true
|
14
|
+
});
|
15
|
+
exports.listViewArgTypes = void 0;
|
16
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
17
|
+
var _loadingStates = _interopRequireDefault(require("../../utils/devUtils/constants/loadingStates"));
|
18
|
+
var _ariaAttributes = require("../../utils/docUtils/ariaAttributes");
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
21
|
+
var listViewArgTypes = _objectSpread(_objectSpread({}, _ariaAttributes.ariaAttributeBaseArgTypes), {}, {
|
22
|
+
loadingState: {
|
23
|
+
description: 'The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.',
|
24
|
+
control: 'radio',
|
25
|
+
options: _loadingStates["default"]
|
26
|
+
},
|
27
|
+
disabledKeys: {
|
28
|
+
description: 'The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.'
|
29
|
+
},
|
30
|
+
defaultExpandedKeys: {
|
31
|
+
description: 'The initial expanded keys in the collection (uncontrolled).'
|
32
|
+
},
|
33
|
+
expandedKeys: {
|
34
|
+
description: 'The expanded keys in the collection (controlled).'
|
35
|
+
},
|
36
|
+
onExpandedChange: {
|
37
|
+
description: 'Handler that is called when items are expanded or collapsed.'
|
38
|
+
},
|
39
|
+
items: {
|
40
|
+
description: 'The list of ListView items (controlled).'
|
41
|
+
},
|
42
|
+
id: {
|
43
|
+
description: "The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id)."
|
44
|
+
},
|
45
|
+
isHoverable: {
|
46
|
+
description: 'Whether ListView should handle hover state (defaults to true)'
|
47
|
+
},
|
48
|
+
'aria-label': _objectSpread({
|
49
|
+
description: 'Defines a string value that labels the current element.'
|
50
|
+
}, _ariaAttributes.ariaAttributeBaseDocSettings),
|
51
|
+
'aria-labelledby': _objectSpread({
|
52
|
+
description: 'Identifies the element (or elements) that labels the current element.'
|
53
|
+
}, _ariaAttributes.ariaAttributeBaseDocSettings),
|
54
|
+
'aria-describedby': _objectSpread({
|
55
|
+
description: 'Identifies the element (or elements) that describes the object.'
|
56
|
+
}, _ariaAttributes.ariaAttributeBaseDocSettings),
|
57
|
+
'aria-details': _objectSpread({
|
58
|
+
description: 'Identifies the element (or elements) that provide a detailed, extended description for the object.'
|
59
|
+
}, _ariaAttributes.ariaAttributeBaseDocSettings),
|
60
|
+
selectedKeys: {
|
61
|
+
description: 'The currently selected keys in the collection (controlled). `selectedKeys="all"` can be used to select every key.'
|
62
|
+
},
|
63
|
+
selectionMode: {
|
64
|
+
description: 'The type of selection that is allowed in the collection.'
|
65
|
+
},
|
66
|
+
selectionStyle: {},
|
67
|
+
onSelectionChange: {
|
68
|
+
description: 'Callback function that fires when the selected key changes.'
|
69
|
+
},
|
70
|
+
onLoadMore: {
|
71
|
+
description: 'Handler called when more items should be loaded, e.g. while scrolling near the bottom.'
|
72
|
+
}
|
73
|
+
});
|
74
|
+
exports.listViewArgTypes = listViewArgTypes;
|
@@ -1,12 +1,9 @@
|
|
1
|
-
|
2
|
-
import type { TreeState } from 'react-stately';
|
3
|
-
import type { SelectionManager } from '@react-stately/selection';
|
4
|
-
import type { GridNode } from '@react-types/grid';
|
1
|
+
import { ExpandableItemState, ExpandableListViewItemProps } from '../../types/listView';
|
5
2
|
interface UseExpandableListViewItemResult {
|
6
3
|
expandableRowProps: object;
|
7
4
|
cellProps: object;
|
8
5
|
expandableContainerProps: object;
|
9
|
-
expandableItemState:
|
6
|
+
expandableItemState: ExpandableItemState;
|
10
7
|
}
|
11
8
|
interface UseExpandableListViewItem<T> {
|
12
9
|
/**
|
@@ -17,6 +14,7 @@ interface UseExpandableListViewItem<T> {
|
|
17
14
|
* Returns four objects, three of which are spread into subcomponents,
|
18
15
|
* the fourth provides state handing props.
|
19
16
|
* @param {Object} [props] Properties provided to the underlying hooks
|
17
|
+
* @param {Boolean} [props.isFocusable] whether or not the option is focusable
|
20
18
|
* @param {Boolean} [props.isHoverable] whether or not the option is hoverable
|
21
19
|
* @param {ReactRef} [props.expandableChildrenRef] the container of all of the expandable content
|
22
20
|
* @param {ReactRef} [props.expandableItemRowRef] the container of for the entire item
|
@@ -31,21 +29,5 @@ interface UseExpandableListViewItem<T> {
|
|
31
29
|
*/
|
32
30
|
(props: ExpandableListViewItemProps<T>): UseExpandableListViewItemResult;
|
33
31
|
}
|
34
|
-
interface ListViewState<T> extends TreeState<T> {
|
35
|
-
hover: {
|
36
|
-
hoveredItem?: string;
|
37
|
-
setHoveredItem: (hoveredItem: string | number) => unknown;
|
38
|
-
};
|
39
|
-
isLink: boolean;
|
40
|
-
selectionManager: SelectionManager;
|
41
|
-
}
|
42
|
-
interface ExpandableListViewItemProps<T> {
|
43
|
-
expandableItemRowRef: React.MutableRefObject<HTMLDivElement | null>;
|
44
|
-
expandableChildrenRef: React.MutableRefObject<HTMLDivElement | null>;
|
45
|
-
className: string;
|
46
|
-
item: GridNode<T>;
|
47
|
-
state: ListViewState<T>;
|
48
|
-
key: string | number;
|
49
|
-
}
|
50
32
|
declare const useExpandableListViewItem: UseExpandableListViewItem<object>;
|
51
33
|
export default useExpandableListViewItem;
|
@@ -30,11 +30,12 @@ var useExpandableListViewItem = function useExpandableListViewItem(props) {
|
|
30
30
|
_props$item$props = props.item.props,
|
31
31
|
listItemProps = _props$item$props.listItemProps,
|
32
32
|
rowProps = _props$item$props.rowProps,
|
33
|
+
_props$item$props$has = _props$item$props.hasSeparator,
|
34
|
+
hasSeparator = _props$item$props$has === void 0 ? true : _props$item$props$has,
|
33
35
|
state = props.state,
|
34
36
|
expandableItemRowRef = props.expandableItemRowRef,
|
35
37
|
expandableChildrenRef = props.expandableChildrenRef,
|
36
38
|
className = props.className;
|
37
|
-
var hasSeparator = true;
|
38
39
|
|
39
40
|
// convenience extractions from props
|
40
41
|
var key = item.key;
|
@@ -135,6 +136,7 @@ var useExpandableListViewItem = function useExpandableListViewItem(props) {
|
|
135
136
|
|
136
137
|
// if the expanded content container is focused, this function will call
|
137
138
|
// it returns focus to the row on right press, and calls the native left press
|
139
|
+
/* istanbul ignore next */
|
138
140
|
var expandedChildrenKeyCaptureOverride = function expandedChildrenKeyCaptureOverride(e) {
|
139
141
|
var _expandableItemRowRef;
|
140
142
|
// if left go back ie dont stifle
|
@@ -109,6 +109,7 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
|
|
109
109
|
isRow?: boolean | undefined;
|
110
110
|
isDisabled?: boolean | undefined;
|
111
111
|
isFocused?: boolean | undefined;
|
112
|
+
tabIndex?: string | number | undefined;
|
112
113
|
isSelected?: boolean | undefined;
|
113
114
|
isUnavailable?: boolean | undefined;
|
114
115
|
hidden?: boolean | undefined;
|
@@ -1120,6 +1121,7 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
|
|
1120
1121
|
style?: import("react").CSSProperties | undefined;
|
1121
1122
|
slot?: string | undefined;
|
1122
1123
|
title?: string | undefined;
|
1124
|
+
tabIndex?: number | undefined;
|
1123
1125
|
hidden?: boolean | undefined;
|
1124
1126
|
id?: string | undefined;
|
1125
1127
|
dangerouslySetInnerHTML?: {
|
@@ -1302,7 +1304,6 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
|
|
1302
1304
|
nonce?: string | undefined;
|
1303
1305
|
placeholder?: string | undefined;
|
1304
1306
|
spellCheck?: (boolean | "false" | "true") | undefined;
|
1305
|
-
tabIndex?: number | undefined;
|
1306
1307
|
radioGroup?: string | undefined;
|
1307
1308
|
about?: string | undefined;
|
1308
1309
|
datatype?: string | undefined;
|
@@ -1439,6 +1440,7 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
|
|
1439
1440
|
style?: import("react").CSSProperties | undefined;
|
1440
1441
|
slot?: string | undefined;
|
1441
1442
|
title?: string | undefined;
|
1443
|
+
tabIndex?: number | undefined;
|
1442
1444
|
hidden?: boolean | undefined;
|
1443
1445
|
id?: string | undefined;
|
1444
1446
|
dangerouslySetInnerHTML?: {
|
@@ -1621,7 +1623,6 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
|
|
1621
1623
|
nonce?: string | undefined;
|
1622
1624
|
placeholder?: string | undefined;
|
1623
1625
|
spellCheck?: (boolean | "false" | "true") | undefined;
|
1624
|
-
tabIndex?: number | undefined;
|
1625
1626
|
radioGroup?: string | undefined;
|
1626
1627
|
about?: string | undefined;
|
1627
1628
|
datatype?: string | undefined;
|
package/lib/cjs/types/box.d.ts
CHANGED
@@ -0,0 +1,69 @@
|
|
1
|
+
import { Dispatch, Key, ReactNode, SetStateAction } from 'react';
|
2
|
+
import { FocusManager } from 'react-aria';
|
3
|
+
import { TreeProps, TreeState } from 'react-stately';
|
4
|
+
import type { GridNode } from '@react-types/grid';
|
5
|
+
export type SelectionOptions = 'expansion' | 'single' | 'multiple' | 'none';
|
6
|
+
export interface ListViewProps extends Omit<TreeProps<object>, 'selectionMode'> {
|
7
|
+
selectionStyle?: string;
|
8
|
+
isHoverable?: boolean;
|
9
|
+
loadingState?: string;
|
10
|
+
selectionMode?: SelectionOptions;
|
11
|
+
onFocus?: (event: any) => void;
|
12
|
+
onLoadMore?: () => void;
|
13
|
+
'aria-label'?: string;
|
14
|
+
}
|
15
|
+
export interface ExpandableItemChildrenContainerProps {
|
16
|
+
children?: ReactNode;
|
17
|
+
gridCellProps?: object;
|
18
|
+
isFocusEscaped?: boolean;
|
19
|
+
isFocusWithin?: boolean;
|
20
|
+
isFocused?: boolean;
|
21
|
+
focusManager?: FocusManager;
|
22
|
+
focusProps?: object;
|
23
|
+
setIsFocusEscaped?: (boolean: any) => void;
|
24
|
+
focusWithinProps?: object;
|
25
|
+
}
|
26
|
+
export interface ExpandableContainerProps {
|
27
|
+
containerProps: object;
|
28
|
+
isFocusEscaped: boolean;
|
29
|
+
children?: ReactNode;
|
30
|
+
}
|
31
|
+
export interface ListViewExpandableItemProps<T> {
|
32
|
+
isHoverable: boolean;
|
33
|
+
isFocusable: boolean;
|
34
|
+
className?: string;
|
35
|
+
item: ListViewItemTypes<T>;
|
36
|
+
}
|
37
|
+
export interface ListViewState<T> extends TreeState<T> {
|
38
|
+
hover: {
|
39
|
+
hoveredItem?: Key | null;
|
40
|
+
setHoveredItem: Dispatch<SetStateAction<Key | null>>;
|
41
|
+
};
|
42
|
+
isLink: boolean;
|
43
|
+
isLoading: boolean;
|
44
|
+
}
|
45
|
+
export interface ListViewItemTypesProps {
|
46
|
+
listItemProps?: object;
|
47
|
+
rowProps?: object;
|
48
|
+
hasSeparator?: boolean;
|
49
|
+
hasInsetSeparator?: boolean;
|
50
|
+
}
|
51
|
+
export interface ListViewItemTypes<T> extends GridNode<T> {
|
52
|
+
props?: ListViewItemTypesProps;
|
53
|
+
}
|
54
|
+
export interface ExpandableListViewItemProps<T> {
|
55
|
+
expandableItemRowRef: React.MutableRefObject<HTMLDivElement | null>;
|
56
|
+
expandableChildrenRef: React.MutableRefObject<HTMLDivElement | null>;
|
57
|
+
className?: string;
|
58
|
+
isHoverable: boolean;
|
59
|
+
isFocusable: boolean;
|
60
|
+
item: GridNode<unknown>;
|
61
|
+
state: ListViewState<T>;
|
62
|
+
key: string | number;
|
63
|
+
}
|
64
|
+
export interface ExpandableItemState {
|
65
|
+
isExpanded: boolean;
|
66
|
+
toggleExpanded: (boolean: any) => void;
|
67
|
+
isFocusEscaped: boolean;
|
68
|
+
gridCellProps: object;
|
69
|
+
}
|