carbon-react 114.9.1 → 114.10.1
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/esm/components/draggable/draggable-container.component.js +4 -4
- package/esm/components/draggable/draggable-container.d.ts +4 -1
- package/esm/components/duelling-picklist/duelling-picklist.component.d.ts +21 -0
- package/esm/components/duelling-picklist/duelling-picklist.component.js +171 -36
- package/esm/components/duelling-picklist/duelling-picklist.context.d.ts +11 -0
- package/esm/components/duelling-picklist/duelling-picklist.context.js +6 -1
- package/esm/components/duelling-picklist/duelling-picklist.style.d.ts +10 -0
- package/esm/components/duelling-picklist/index.d.ts +12 -6
- package/esm/components/duelling-picklist/picklist/picklist.component.d.ts +16 -0
- package/esm/components/duelling-picklist/picklist/picklist.component.js +31 -39
- package/esm/components/duelling-picklist/picklist/picklist.style.d.ts +5 -0
- package/esm/components/duelling-picklist/picklist-divider/picklist-divider.component.d.ts +5 -0
- package/esm/components/duelling-picklist/picklist-divider/picklist-divider.component.js +4 -0
- package/esm/components/duelling-picklist/picklist-divider/picklist-divider.style.d.ts +2 -0
- package/esm/components/duelling-picklist/picklist-group/picklist-group.component.d.ts +19 -0
- package/esm/components/duelling-picklist/picklist-group/picklist-group.component.js +30 -32
- package/esm/components/duelling-picklist/picklist-group/picklist-group.style.d.ts +14 -0
- package/esm/components/duelling-picklist/picklist-item/picklist-item.component.d.ts +28 -0
- package/esm/components/duelling-picklist/picklist-item/picklist-item.component.js +16 -44
- package/esm/components/duelling-picklist/picklist-item/picklist-item.style.d.ts +7 -0
- package/esm/components/duelling-picklist/picklist-placeholder/picklist-placeholder.component.d.ts +7 -0
- package/esm/components/duelling-picklist/picklist-placeholder/picklist-placeholder.component.js +2 -2
- package/esm/components/flat-table/flat-table.component.js +2 -2
- package/esm/components/flat-table/flat-table.style.js +3 -1
- package/lib/components/draggable/draggable-container.component.js +4 -4
- package/lib/components/draggable/draggable-container.d.ts +4 -1
- package/lib/components/duelling-picklist/duelling-picklist.component.d.ts +21 -0
- package/lib/components/duelling-picklist/duelling-picklist.component.js +172 -39
- package/lib/components/duelling-picklist/duelling-picklist.context.d.ts +11 -0
- package/lib/components/duelling-picklist/duelling-picklist.context.js +6 -1
- package/lib/components/duelling-picklist/duelling-picklist.style.d.ts +10 -0
- package/lib/components/duelling-picklist/index.d.ts +12 -6
- package/lib/components/duelling-picklist/picklist/picklist.component.d.ts +16 -0
- package/lib/components/duelling-picklist/picklist/picklist.component.js +28 -44
- package/lib/components/duelling-picklist/picklist/picklist.style.d.ts +5 -0
- package/lib/components/duelling-picklist/picklist-divider/picklist-divider.component.d.ts +5 -0
- package/lib/components/duelling-picklist/picklist-divider/picklist-divider.component.js +5 -0
- package/lib/components/duelling-picklist/picklist-divider/picklist-divider.style.d.ts +2 -0
- package/lib/components/duelling-picklist/picklist-group/picklist-group.component.d.ts +19 -0
- package/lib/components/duelling-picklist/picklist-group/picklist-group.component.js +31 -33
- package/lib/components/duelling-picklist/picklist-group/picklist-group.style.d.ts +14 -0
- package/lib/components/duelling-picklist/picklist-item/picklist-item.component.d.ts +28 -0
- package/lib/components/duelling-picklist/picklist-item/picklist-item.component.js +17 -45
- package/lib/components/duelling-picklist/picklist-item/picklist-item.style.d.ts +7 -0
- package/lib/components/duelling-picklist/picklist-placeholder/picklist-placeholder.component.d.ts +7 -0
- package/lib/components/duelling-picklist/picklist-placeholder/picklist-placeholder.component.js +3 -3
- package/lib/components/flat-table/flat-table.component.js +2 -2
- package/lib/components/flat-table/flat-table.style.js +3 -1
- package/package.json +1 -1
- package/esm/components/duelling-picklist/duelling-picklist.d.ts +0 -24
- package/esm/components/duelling-picklist/picklist/picklist.d.ts +0 -19
- package/esm/components/duelling-picklist/picklist-divider/picklist-divider.d.ts +0 -12
- package/esm/components/duelling-picklist/picklist-group/picklist-group.d.ts +0 -18
- package/esm/components/duelling-picklist/picklist-item/picklist-item.d.ts +0 -24
- package/esm/components/duelling-picklist/picklist-placeholder/picklist-placeholder.d.ts +0 -10
- package/lib/components/duelling-picklist/duelling-picklist.d.ts +0 -24
- package/lib/components/duelling-picklist/picklist/picklist.d.ts +0 -19
- package/lib/components/duelling-picklist/picklist-divider/picklist-divider.d.ts +0 -12
- package/lib/components/duelling-picklist/picklist-group/picklist-group.d.ts +0 -18
- package/lib/components/duelling-picklist/picklist-item/picklist-item.d.ts +0 -24
- package/lib/components/duelling-picklist/picklist-placeholder/picklist-placeholder.d.ts +0 -10
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type Item = Record<string, unknown> | string | number;
|
|
3
|
+
export interface PicklistItemProps {
|
|
4
|
+
/** Item content */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** Define if item is of type add or remove */
|
|
7
|
+
type: "add" | "remove";
|
|
8
|
+
/** Handler invoked when add/remove button is clicked or when space/enter is pressed on the whole item */
|
|
9
|
+
onChange: (item: Item) => void;
|
|
10
|
+
/** Value passed to the onChange handler - can be a string, a number or an object */
|
|
11
|
+
item: Item;
|
|
12
|
+
/** Disable the item */
|
|
13
|
+
locked?: boolean;
|
|
14
|
+
/** Tooltip message for the locked icon (only present when locked prop is true) */
|
|
15
|
+
tooltipMessage?: string;
|
|
16
|
+
/** @private @ignore */
|
|
17
|
+
index?: number;
|
|
18
|
+
/** @private @ignore */
|
|
19
|
+
groupIndex?: number;
|
|
20
|
+
/** @private @ignore */
|
|
21
|
+
listIndex?: number;
|
|
22
|
+
/** @private @ignore */
|
|
23
|
+
isLastItem?: boolean;
|
|
24
|
+
/** @private @ignore */
|
|
25
|
+
isLastGroup?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare const PicklistItem: React.ForwardRefExoticComponent<PicklistItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
+
export default PicklistItem;
|
|
@@ -9,10 +9,8 @@ import Events from "../../../__internal__/utils/helpers/events";
|
|
|
9
9
|
const PicklistItem = /*#__PURE__*/React.forwardRef(({
|
|
10
10
|
children,
|
|
11
11
|
type,
|
|
12
|
-
disabled,
|
|
13
12
|
onChange,
|
|
14
13
|
item,
|
|
15
|
-
highlighted,
|
|
16
14
|
locked,
|
|
17
15
|
tooltipMessage = "This item is locked and can not be moved",
|
|
18
16
|
index,
|
|
@@ -20,12 +18,12 @@ const PicklistItem = /*#__PURE__*/React.forwardRef(({
|
|
|
20
18
|
groupIndex,
|
|
21
19
|
isLastGroup,
|
|
22
20
|
isLastItem,
|
|
23
|
-
...
|
|
21
|
+
...transitionGroupProps
|
|
24
22
|
}, ref) => {
|
|
25
23
|
const {
|
|
26
24
|
setElementToFocus
|
|
27
25
|
} = useContext(FocusContext);
|
|
28
|
-
const picklistItemNodeRef = useRef();
|
|
26
|
+
const picklistItemNodeRef = useRef(null);
|
|
29
27
|
const calculateFocusIndex = useCallback(() => {
|
|
30
28
|
if (isLastItem) {
|
|
31
29
|
const toggledListIndex = listIndex === 0 ? 1 : 0;
|
|
@@ -69,7 +67,7 @@ const PicklistItem = /*#__PURE__*/React.forwardRef(({
|
|
|
69
67
|
exit: 0
|
|
70
68
|
},
|
|
71
69
|
classNames: "picklist-item"
|
|
72
|
-
},
|
|
70
|
+
}, transitionGroupProps, type === "add" ? {
|
|
73
71
|
enter: false
|
|
74
72
|
} : {}, {
|
|
75
73
|
nodeRef: picklistItemNodeRef
|
|
@@ -83,7 +81,6 @@ const PicklistItem = /*#__PURE__*/React.forwardRef(({
|
|
|
83
81
|
destructive: type === "remove",
|
|
84
82
|
iconType: type,
|
|
85
83
|
onClick: handleClick,
|
|
86
|
-
highlighted: highlighted,
|
|
87
84
|
ref: ref
|
|
88
85
|
}), locked && /*#__PURE__*/React.createElement(StyledLockIcon, {
|
|
89
86
|
type: "locked",
|
|
@@ -91,43 +88,18 @@ const PicklistItem = /*#__PURE__*/React.forwardRef(({
|
|
|
91
88
|
})));
|
|
92
89
|
});
|
|
93
90
|
PicklistItem.propTypes = {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
/** Value passed to the onChange handler */
|
|
107
|
-
item: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.number]).isRequired,
|
|
108
|
-
|
|
109
|
-
/** Disable the item */
|
|
110
|
-
locked: PropTypes.bool,
|
|
111
|
-
|
|
112
|
-
/** Tooltip message for the locked icon (only present when locked prop is true) */
|
|
113
|
-
tooltipMessage: PropTypes.string,
|
|
114
|
-
|
|
115
|
-
/** @private @ignore */
|
|
116
|
-
highlighted: PropTypes.bool,
|
|
117
|
-
|
|
118
|
-
/** @private @ignore */
|
|
119
|
-
index: PropTypes.number,
|
|
120
|
-
|
|
121
|
-
/** @private @ignore */
|
|
122
|
-
groupIndex: PropTypes.number,
|
|
123
|
-
|
|
124
|
-
/** @private @ignore */
|
|
125
|
-
listIndex: PropTypes.number,
|
|
126
|
-
|
|
127
|
-
/** @private @ignore */
|
|
128
|
-
isLastItem: PropTypes.bool,
|
|
129
|
-
|
|
130
|
-
/** @private @ignore */
|
|
131
|
-
isLastGroup: PropTypes.bool
|
|
91
|
+
"children": PropTypes.node,
|
|
92
|
+
"groupIndex": PropTypes.number,
|
|
93
|
+
"index": PropTypes.number,
|
|
94
|
+
"isLastGroup": PropTypes.bool,
|
|
95
|
+
"isLastItem": PropTypes.bool,
|
|
96
|
+
"item": PropTypes.oneOfType([PropTypes.number, PropTypes.object, PropTypes.string]).isRequired,
|
|
97
|
+
"listIndex": PropTypes.number,
|
|
98
|
+
"locked": PropTypes.bool,
|
|
99
|
+
"onChange": PropTypes.func.isRequired,
|
|
100
|
+
"tooltipMessage": PropTypes.string,
|
|
101
|
+
"type": PropTypes.oneOf(["add", "remove"]).isRequired
|
|
132
102
|
};
|
|
103
|
+
export { PicklistItem };
|
|
104
|
+
PicklistItem.displayName = "PicklistItem";
|
|
133
105
|
export default PicklistItem;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const StyledPicklistItem: import("styled-components").StyledComponent<"li", any, {
|
|
3
|
+
locked?: boolean | undefined;
|
|
4
|
+
}, never>;
|
|
5
|
+
declare const StyledButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../button").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
|
|
6
|
+
declare const StyledLockIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
7
|
+
export { StyledPicklistItem, StyledButton, StyledLockIcon };
|
package/esm/components/duelling-picklist/picklist-placeholder/picklist-placeholder.component.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface PicklistPlaceholderProps {
|
|
3
|
+
/** Text to be displayed when list is empty */
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const PicklistPlaceholder: ({ text }: PicklistPlaceholderProps) => JSX.Element;
|
|
7
|
+
export default PicklistPlaceholder;
|
package/esm/components/duelling-picklist/picklist-placeholder/picklist-placeholder.component.js
CHANGED
|
@@ -9,7 +9,7 @@ const PicklistPlaceholder = ({
|
|
|
9
9
|
}, text);
|
|
10
10
|
|
|
11
11
|
PicklistPlaceholder.propTypes = {
|
|
12
|
-
|
|
13
|
-
text: PropTypes.string.isRequired
|
|
12
|
+
"text": PropTypes.string.isRequired
|
|
14
13
|
};
|
|
14
|
+
export { PicklistPlaceholder };
|
|
15
15
|
export default PicklistPlaceholder;
|
|
@@ -65,9 +65,9 @@ const FlatTable = ({
|
|
|
65
65
|
colorTheme,
|
|
66
66
|
size
|
|
67
67
|
}
|
|
68
|
-
}, children))
|
|
68
|
+
}, children)), footer && /*#__PURE__*/React.createElement(StyledFlatTableFooter, {
|
|
69
69
|
hasStickyFooter: hasStickyFooter
|
|
70
|
-
}, footer)));
|
|
70
|
+
}, footer))));
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
FlatTable.propTypes = { ...marginPropTypes,
|
|
@@ -12,6 +12,9 @@ const HEADER_OVERLAY_INCREMENT = 3;
|
|
|
12
12
|
const STICKY_FOOTER_OVERLAY_INCREMENT = 1;
|
|
13
13
|
const ROW_HEADER_OVERLAY_INCREMENT = 5;
|
|
14
14
|
const StyledTableContainer = styled.div`
|
|
15
|
+
display: grid;
|
|
16
|
+
grid-auto-rows: min-content;
|
|
17
|
+
|
|
15
18
|
${({
|
|
16
19
|
width,
|
|
17
20
|
overflowX
|
|
@@ -25,7 +28,6 @@ const StyledFlatTable = styled.table`
|
|
|
25
28
|
border-collapse: separate;
|
|
26
29
|
border-radius: 0px;
|
|
27
30
|
border-spacing: 0;
|
|
28
|
-
min-width: 100%;
|
|
29
31
|
width: 100%;
|
|
30
32
|
|
|
31
33
|
${({
|
|
@@ -39,8 +39,8 @@ const DropTarget = ({
|
|
|
39
39
|
const [, drop] = (0, _reactDnd.useDrop)({
|
|
40
40
|
accept: "draggableItem",
|
|
41
41
|
|
|
42
|
-
drop() {
|
|
43
|
-
getOrder();
|
|
42
|
+
drop(item) {
|
|
43
|
+
getOrder(item === null || item === void 0 ? void 0 : item.id);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
});
|
|
@@ -86,13 +86,13 @@ const DraggableContainer = ({
|
|
|
86
86
|
setDraggableItems(copyOfDraggableItems);
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
const getItemsId =
|
|
89
|
+
const getItemsId = item => {
|
|
90
90
|
if (!getOrder) {
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
const draggableItemIds = draggableItems.map(draggableItem => draggableItem.props.id);
|
|
95
|
-
getOrder(draggableItemIds);
|
|
95
|
+
getOrder(draggableItemIds, item);
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
const marginProps = (0, _utils.filterStyledSystemMarginProps)(rest);
|
|
@@ -9,7 +9,10 @@ type DraggableContainerChild =
|
|
|
9
9
|
|
|
10
10
|
export interface DraggableContainerProps {
|
|
11
11
|
/** Callback fired when order is changed */
|
|
12
|
-
getOrder?: (
|
|
12
|
+
getOrder?: (
|
|
13
|
+
draggableItemIds: (number | string)[],
|
|
14
|
+
movedItemId: string | number
|
|
15
|
+
) => void;
|
|
13
16
|
/**
|
|
14
17
|
* The content of the component
|
|
15
18
|
*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
export interface DuellingPicklistProps extends MarginProps {
|
|
4
|
+
/**
|
|
5
|
+
* Content of the component, should contain two Picklist children
|
|
6
|
+
* and a PicklistDivider
|
|
7
|
+
*/
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
/** Indicate if component is disabled */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Place for components like Search or Filter placed above the left list */
|
|
12
|
+
leftControls?: React.ReactNode;
|
|
13
|
+
/** Left list label */
|
|
14
|
+
leftLabel?: string;
|
|
15
|
+
/** Place for components like Search or Filter placed above the right list */
|
|
16
|
+
rightControls?: React.ReactNode;
|
|
17
|
+
/** Right list label */
|
|
18
|
+
rightLabel?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const DuellingPicklist: ({ children, disabled, leftControls, rightControls, leftLabel, rightLabel, ...rest }: DuellingPicklistProps) => JSX.Element;
|
|
21
|
+
export default DuellingPicklist;
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.DuellingPicklist = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _propTypes2 = _interopRequireDefault(require("@styled-system/prop-types"));
|
|
13
|
-
|
|
14
12
|
var _utils = require("../../style/utils");
|
|
15
13
|
|
|
16
14
|
var _duellingPicklist = require("./duelling-picklist.style");
|
|
@@ -27,8 +25,6 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
27
25
|
|
|
28
26
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
27
|
|
|
30
|
-
const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default.space);
|
|
31
|
-
|
|
32
28
|
const DuellingPicklist = ({
|
|
33
29
|
children,
|
|
34
30
|
disabled,
|
|
@@ -57,9 +53,15 @@ const DuellingPicklist = ({
|
|
|
57
53
|
return index;
|
|
58
54
|
};
|
|
59
55
|
|
|
60
|
-
const clonedChildren = _react.default.Children.map(children, child =>
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
const clonedChildren = _react.default.Children.map(children, child => {
|
|
57
|
+
if ( /*#__PURE__*/_react.default.isValidElement(child) && child.type === _picklist.Picklist) {
|
|
58
|
+
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
59
|
+
index: getIndex()
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return child;
|
|
64
|
+
});
|
|
63
65
|
|
|
64
66
|
return /*#__PURE__*/_react.default.createElement(_duellingPicklist.StyledDuellingPicklistOverlay, _extends({
|
|
65
67
|
disabled: disabled,
|
|
@@ -80,37 +82,168 @@ const DuellingPicklist = ({
|
|
|
80
82
|
}, /*#__PURE__*/_react.default.createElement(_duellingPicklist.StyledDuellingPicklist, null, clonedChildren)));
|
|
81
83
|
};
|
|
82
84
|
|
|
83
|
-
DuellingPicklist
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
85
|
+
exports.DuellingPicklist = DuellingPicklist;
|
|
86
|
+
DuellingPicklist.propTypes = {
|
|
87
|
+
"children": _propTypes.default.node,
|
|
88
|
+
"disabled": _propTypes.default.bool,
|
|
89
|
+
"leftControls": _propTypes.default.node,
|
|
90
|
+
"leftLabel": _propTypes.default.string,
|
|
91
|
+
"m": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
92
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
93
|
+
"description": _propTypes.default.string,
|
|
94
|
+
"toString": _propTypes.default.func.isRequired,
|
|
95
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
96
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
97
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
98
|
+
"description": _propTypes.default.string,
|
|
99
|
+
"toString": _propTypes.default.func.isRequired,
|
|
100
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
101
|
+
}), _propTypes.default.string]),
|
|
102
|
+
"margin": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
103
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
104
|
+
"description": _propTypes.default.string,
|
|
105
|
+
"toString": _propTypes.default.func.isRequired,
|
|
106
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
107
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
108
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
109
|
+
"description": _propTypes.default.string,
|
|
110
|
+
"toString": _propTypes.default.func.isRequired,
|
|
111
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
112
|
+
}), _propTypes.default.string]),
|
|
113
|
+
"marginBottom": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
114
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
115
|
+
"description": _propTypes.default.string,
|
|
116
|
+
"toString": _propTypes.default.func.isRequired,
|
|
117
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
118
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
119
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
120
|
+
"description": _propTypes.default.string,
|
|
121
|
+
"toString": _propTypes.default.func.isRequired,
|
|
122
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
123
|
+
}), _propTypes.default.string]),
|
|
124
|
+
"marginLeft": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
125
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
126
|
+
"description": _propTypes.default.string,
|
|
127
|
+
"toString": _propTypes.default.func.isRequired,
|
|
128
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
129
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
130
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
131
|
+
"description": _propTypes.default.string,
|
|
132
|
+
"toString": _propTypes.default.func.isRequired,
|
|
133
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
134
|
+
}), _propTypes.default.string]),
|
|
135
|
+
"marginRight": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
136
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
137
|
+
"description": _propTypes.default.string,
|
|
138
|
+
"toString": _propTypes.default.func.isRequired,
|
|
139
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
140
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
141
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
142
|
+
"description": _propTypes.default.string,
|
|
143
|
+
"toString": _propTypes.default.func.isRequired,
|
|
144
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
145
|
+
}), _propTypes.default.string]),
|
|
146
|
+
"marginTop": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
147
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
148
|
+
"description": _propTypes.default.string,
|
|
149
|
+
"toString": _propTypes.default.func.isRequired,
|
|
150
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
151
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
152
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
153
|
+
"description": _propTypes.default.string,
|
|
154
|
+
"toString": _propTypes.default.func.isRequired,
|
|
155
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
156
|
+
}), _propTypes.default.string]),
|
|
157
|
+
"marginX": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
158
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
159
|
+
"description": _propTypes.default.string,
|
|
160
|
+
"toString": _propTypes.default.func.isRequired,
|
|
161
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
162
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
163
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
164
|
+
"description": _propTypes.default.string,
|
|
165
|
+
"toString": _propTypes.default.func.isRequired,
|
|
166
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
167
|
+
}), _propTypes.default.string]),
|
|
168
|
+
"marginY": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
169
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
170
|
+
"description": _propTypes.default.string,
|
|
171
|
+
"toString": _propTypes.default.func.isRequired,
|
|
172
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
173
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
174
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
175
|
+
"description": _propTypes.default.string,
|
|
176
|
+
"toString": _propTypes.default.func.isRequired,
|
|
177
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
178
|
+
}), _propTypes.default.string]),
|
|
179
|
+
"mb": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
180
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
181
|
+
"description": _propTypes.default.string,
|
|
182
|
+
"toString": _propTypes.default.func.isRequired,
|
|
183
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
184
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
185
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
186
|
+
"description": _propTypes.default.string,
|
|
187
|
+
"toString": _propTypes.default.func.isRequired,
|
|
188
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
189
|
+
}), _propTypes.default.string]),
|
|
190
|
+
"ml": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
191
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
192
|
+
"description": _propTypes.default.string,
|
|
193
|
+
"toString": _propTypes.default.func.isRequired,
|
|
194
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
195
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
196
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
197
|
+
"description": _propTypes.default.string,
|
|
198
|
+
"toString": _propTypes.default.func.isRequired,
|
|
199
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
200
|
+
}), _propTypes.default.string]),
|
|
201
|
+
"mr": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
202
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
203
|
+
"description": _propTypes.default.string,
|
|
204
|
+
"toString": _propTypes.default.func.isRequired,
|
|
205
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
206
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
207
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
208
|
+
"description": _propTypes.default.string,
|
|
209
|
+
"toString": _propTypes.default.func.isRequired,
|
|
210
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
211
|
+
}), _propTypes.default.string]),
|
|
212
|
+
"mt": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
213
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
214
|
+
"description": _propTypes.default.string,
|
|
215
|
+
"toString": _propTypes.default.func.isRequired,
|
|
216
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
217
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
218
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
219
|
+
"description": _propTypes.default.string,
|
|
220
|
+
"toString": _propTypes.default.func.isRequired,
|
|
221
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
222
|
+
}), _propTypes.default.string]),
|
|
223
|
+
"mx": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
224
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
225
|
+
"description": _propTypes.default.string,
|
|
226
|
+
"toString": _propTypes.default.func.isRequired,
|
|
227
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
228
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
229
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
230
|
+
"description": _propTypes.default.string,
|
|
231
|
+
"toString": _propTypes.default.func.isRequired,
|
|
232
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
233
|
+
}), _propTypes.default.string]),
|
|
234
|
+
"my": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
235
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
236
|
+
"description": _propTypes.default.string,
|
|
237
|
+
"toString": _propTypes.default.func.isRequired,
|
|
238
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
239
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
240
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
241
|
+
"description": _propTypes.default.string,
|
|
242
|
+
"toString": _propTypes.default.func.isRequired,
|
|
243
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
244
|
+
}), _propTypes.default.string]),
|
|
245
|
+
"rightControls": _propTypes.default.node,
|
|
246
|
+
"rightLabel": _propTypes.default.string
|
|
114
247
|
};
|
|
115
248
|
var _default = DuellingPicklist;
|
|
116
249
|
exports.default = _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare type FocusContextType = {
|
|
3
|
+
setElementToFocus: (itemIndex?: number, listIndex?: number, groupIndex?: number) => void;
|
|
4
|
+
elementToFocus: {
|
|
5
|
+
itemIndex?: number;
|
|
6
|
+
listIndex?: number;
|
|
7
|
+
groupIndex?: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
declare const FocusContext: React.Context<FocusContextType>;
|
|
11
|
+
export default FocusContext;
|
|
@@ -9,7 +9,12 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
-
const FocusContext = /*#__PURE__*/_react.default.createContext({
|
|
12
|
+
const FocusContext = /*#__PURE__*/_react.default.createContext({
|
|
13
|
+
setElementToFocus:
|
|
14
|
+
/* istanbul ignore next */
|
|
15
|
+
() => {},
|
|
16
|
+
elementToFocus: {}
|
|
17
|
+
});
|
|
13
18
|
|
|
14
19
|
var _default = FocusContext;
|
|
15
20
|
exports.default = _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const StyledDuellingPicklistOverlay: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
disabled?: boolean | undefined;
|
|
3
|
+
}, never>;
|
|
4
|
+
declare const StyledDuellingPicklist: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
declare const StyledLabelContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
declare const StyledLabel: import("styled-components").StyledComponent<"p", any, {}, never>;
|
|
7
|
+
declare const StyledControlsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
+
declare const StyledControl: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
|
+
declare const StyledPicklistPlaceholder: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
+
export { StyledDuellingPicklist, StyledDuellingPicklistOverlay, StyledLabelContainer, StyledLabel, StyledControlsContainer, StyledControl, StyledPicklistPlaceholder, };
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
export { default as DuellingPicklist } from "./duelling-picklist";
|
|
2
|
-
export {
|
|
3
|
-
export { default as
|
|
4
|
-
export {
|
|
5
|
-
export { default as
|
|
6
|
-
export {
|
|
1
|
+
export { default as DuellingPicklist } from "./duelling-picklist.component";
|
|
2
|
+
export type { DuellingPicklistProps } from "./duelling-picklist.component";
|
|
3
|
+
export { default as PicklistDivider } from "./picklist-divider/picklist-divider.component";
|
|
4
|
+
export type { PicklistDividerProps } from "./picklist-divider/picklist-divider.component";
|
|
5
|
+
export { default as PicklistItem } from "./picklist-item/picklist-item.component";
|
|
6
|
+
export type { PicklistItemProps } from "./picklist-item/picklist-item.component";
|
|
7
|
+
export { default as Picklist } from "./picklist/picklist.component";
|
|
8
|
+
export type { PicklistProps } from "./picklist/picklist.component";
|
|
9
|
+
export { default as PicklistPlaceholder } from "./picklist-placeholder/picklist-placeholder.component";
|
|
10
|
+
export type { PicklistPlaceholderProps } from "./picklist-placeholder/picklist-placeholder.component";
|
|
11
|
+
export { default as PicklistGroup } from "./picklist-group/picklist-group.component";
|
|
12
|
+
export type { PicklistGroupProps } from "./picklist-group/picklist-group.component";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface PicklistProps {
|
|
3
|
+
/** List of PicklistItem elements */
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
/** Placeholder to be rendered when list is empty */
|
|
6
|
+
placeholder?: React.ReactNode;
|
|
7
|
+
/** Indicate if component is disabled */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** @private @ignore */
|
|
10
|
+
index?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const Picklist: {
|
|
13
|
+
({ disabled, children, placeholder, index, }: PicklistProps): JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
export default Picklist;
|