carbon-react 109.3.2 → 109.3.5
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/__internal__/fieldset/fieldset.component.d.ts +25 -0
- package/esm/__internal__/fieldset/fieldset.component.js +167 -50
- package/esm/__internal__/fieldset/fieldset.style.d.ts +13 -0
- package/esm/__internal__/fieldset/fieldset.style.js +0 -10
- package/esm/__internal__/fieldset/index.d.ts +2 -1
- package/esm/__internal__/popover/index.d.ts +2 -1
- package/esm/__internal__/popover/popover.component.d.ts +18 -0
- package/esm/__internal__/popover/popover.component.js +23 -21
- package/esm/__internal__/popover/popover.style.d.ts +2 -0
- package/esm/components/button/button.component.d.ts +2 -0
- package/esm/components/button/button.component.js +2 -0
- package/esm/components/multi-action-button/multi-action-button.component.js +1 -0
- package/esm/components/pager/pager.component.js +1 -1
- package/esm/components/pager/pager.style.js +1 -1
- package/esm/components/select/multi-select/multi-select.component.js +36 -34
- package/esm/components/select/select-list/select-list.component.js +9 -1
- package/esm/components/select/select-list/select-list.style.js +8 -1
- package/esm/components/split-button/index.d.ts +2 -2
- package/esm/components/split-button/split-button-children.style.d.ts +8 -0
- package/esm/components/split-button/split-button-children.style.js +3 -4
- package/esm/components/split-button/split-button-toggle.style.d.ts +10 -0
- package/esm/components/split-button/split-button.component.d.ts +29 -0
- package/esm/components/split-button/split-button.component.js +534 -87
- package/esm/components/split-button/split-button.config.d.ts +4 -0
- package/esm/components/split-button/split-button.style.d.ts +2 -0
- package/lib/__internal__/fieldset/fieldset.component.d.ts +25 -0
- package/lib/__internal__/fieldset/fieldset.component.js +167 -53
- package/lib/__internal__/fieldset/fieldset.style.d.ts +13 -0
- package/lib/__internal__/fieldset/fieldset.style.js +1 -12
- package/lib/__internal__/fieldset/index.d.ts +2 -1
- package/lib/__internal__/popover/index.d.ts +2 -1
- package/lib/__internal__/popover/popover.component.d.ts +18 -0
- package/lib/__internal__/popover/popover.component.js +24 -22
- package/lib/__internal__/popover/popover.style.d.ts +2 -0
- package/lib/components/button/button.component.d.ts +2 -0
- package/lib/components/button/button.component.js +2 -0
- package/lib/components/multi-action-button/multi-action-button.component.js +1 -0
- package/lib/components/pager/pager.component.js +1 -1
- package/lib/components/pager/pager.style.js +1 -1
- package/lib/components/select/multi-select/multi-select.component.js +36 -34
- package/lib/components/select/select-list/select-list.component.js +9 -1
- package/lib/components/select/select-list/select-list.style.js +8 -1
- package/lib/components/split-button/index.d.ts +2 -2
- package/lib/components/split-button/split-button-children.style.d.ts +8 -0
- package/lib/components/split-button/split-button-children.style.js +3 -4
- package/lib/components/split-button/split-button-toggle.style.d.ts +10 -0
- package/lib/components/split-button/split-button.component.d.ts +29 -0
- package/lib/components/split-button/split-button.component.js +535 -89
- package/lib/components/split-button/split-button.config.d.ts +4 -0
- package/lib/components/split-button/split-button.style.d.ts +2 -0
- package/package.json +2 -2
- package/esm/__internal__/fieldset/fieldset.d.ts +0 -37
- package/esm/__internal__/popover/popover.d.ts +0 -46
- package/esm/components/split-button/split-button.d.ts +0 -29
- package/lib/__internal__/fieldset/fieldset.d.ts +0 -37
- package/lib/__internal__/popover/popover.d.ts +0 -46
- package/lib/components/split-button/split-button.d.ts +0 -29
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
export interface FieldsetProps extends MarginProps {
|
|
4
|
+
/** Fieldset content */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** The content for the Fieldset Legend */
|
|
7
|
+
legend?: string;
|
|
8
|
+
error?: boolean | string;
|
|
9
|
+
warning?: boolean | string;
|
|
10
|
+
info?: boolean | string;
|
|
11
|
+
/** When true, legend is placed in line with the children */
|
|
12
|
+
inline?: boolean;
|
|
13
|
+
/** Percentage width of legend (only when legend is inline) */
|
|
14
|
+
legendWidth?: number;
|
|
15
|
+
/** Text alignment of legend when inline */
|
|
16
|
+
legendAlign?: "left" | "right";
|
|
17
|
+
/** Spacing between legend and field for inline legend, number multiplied by base spacing unit (8) */
|
|
18
|
+
legendSpacing?: 1 | 2;
|
|
19
|
+
/** If true, an asterisk will be added to the label */
|
|
20
|
+
isRequired?: boolean;
|
|
21
|
+
/** Controls whether group behaviour should be enabled */
|
|
22
|
+
blockGroupBehaviour?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const Fieldset: ({ legend, children, inline, legendWidth, legendAlign, legendSpacing, error, warning, info, isRequired, blockGroupBehaviour, ...rest }: FieldsetProps) => JSX.Element;
|
|
25
|
+
export default Fieldset;
|
|
@@ -2,17 +2,14 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import styledSystemPropTypes from "@styled-system/prop-types";
|
|
6
5
|
import { StyledFieldset, StyledLegend, StyledLegendContent } from "./fieldset.style";
|
|
7
6
|
import ValidationIcon from "../validations/validation-icon.component";
|
|
8
7
|
import { InputGroupBehaviour, InputGroupContext } from "../input-behaviour";
|
|
9
|
-
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
10
|
-
const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
|
|
11
8
|
|
|
12
9
|
const Fieldset = ({
|
|
13
10
|
legend,
|
|
14
11
|
children,
|
|
15
|
-
inline,
|
|
12
|
+
inline = false,
|
|
16
13
|
legendWidth,
|
|
17
14
|
legendAlign = "right",
|
|
18
15
|
legendSpacing = 2,
|
|
@@ -26,8 +23,7 @@ const Fieldset = ({
|
|
|
26
23
|
blockGroupBehaviour: blockGroupBehaviour
|
|
27
24
|
}, /*#__PURE__*/React.createElement(StyledFieldset, _extends({
|
|
28
25
|
"data-component": "fieldset",
|
|
29
|
-
m: 0
|
|
30
|
-
inline: inline
|
|
26
|
+
m: 0
|
|
31
27
|
}, rest), legend && /*#__PURE__*/React.createElement(InputGroupContext.Consumer, null, ({
|
|
32
28
|
onMouseEnter,
|
|
33
29
|
onMouseLeave
|
|
@@ -48,49 +44,170 @@ const Fieldset = ({
|
|
|
48
44
|
})))), children));
|
|
49
45
|
|
|
50
46
|
Fieldset.propTypes = {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
47
|
+
"blockGroupBehaviour": PropTypes.bool,
|
|
48
|
+
"children": PropTypes.node,
|
|
49
|
+
"error": PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
50
|
+
"info": PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
51
|
+
"inline": PropTypes.bool,
|
|
52
|
+
"isRequired": PropTypes.bool,
|
|
53
|
+
"legend": PropTypes.string,
|
|
54
|
+
"legendAlign": PropTypes.oneOf(["left", "right"]),
|
|
55
|
+
"legendSpacing": PropTypes.oneOf([1, 2]),
|
|
56
|
+
"legendWidth": PropTypes.number,
|
|
57
|
+
"m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
58
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
59
|
+
"description": PropTypes.string,
|
|
60
|
+
"toString": PropTypes.func.isRequired,
|
|
61
|
+
"valueOf": PropTypes.func.isRequired
|
|
62
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
63
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
64
|
+
"description": PropTypes.string,
|
|
65
|
+
"toString": PropTypes.func.isRequired,
|
|
66
|
+
"valueOf": PropTypes.func.isRequired
|
|
67
|
+
}), PropTypes.string]),
|
|
68
|
+
"margin": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
69
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
70
|
+
"description": PropTypes.string,
|
|
71
|
+
"toString": PropTypes.func.isRequired,
|
|
72
|
+
"valueOf": PropTypes.func.isRequired
|
|
73
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
74
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
75
|
+
"description": PropTypes.string,
|
|
76
|
+
"toString": PropTypes.func.isRequired,
|
|
77
|
+
"valueOf": PropTypes.func.isRequired
|
|
78
|
+
}), PropTypes.string]),
|
|
79
|
+
"marginBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
80
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
81
|
+
"description": PropTypes.string,
|
|
82
|
+
"toString": PropTypes.func.isRequired,
|
|
83
|
+
"valueOf": PropTypes.func.isRequired
|
|
84
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
85
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
86
|
+
"description": PropTypes.string,
|
|
87
|
+
"toString": PropTypes.func.isRequired,
|
|
88
|
+
"valueOf": PropTypes.func.isRequired
|
|
89
|
+
}), PropTypes.string]),
|
|
90
|
+
"marginLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
91
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
92
|
+
"description": PropTypes.string,
|
|
93
|
+
"toString": PropTypes.func.isRequired,
|
|
94
|
+
"valueOf": PropTypes.func.isRequired
|
|
95
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
96
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
97
|
+
"description": PropTypes.string,
|
|
98
|
+
"toString": PropTypes.func.isRequired,
|
|
99
|
+
"valueOf": PropTypes.func.isRequired
|
|
100
|
+
}), PropTypes.string]),
|
|
101
|
+
"marginRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
102
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
103
|
+
"description": PropTypes.string,
|
|
104
|
+
"toString": PropTypes.func.isRequired,
|
|
105
|
+
"valueOf": PropTypes.func.isRequired
|
|
106
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
107
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
108
|
+
"description": PropTypes.string,
|
|
109
|
+
"toString": PropTypes.func.isRequired,
|
|
110
|
+
"valueOf": PropTypes.func.isRequired
|
|
111
|
+
}), PropTypes.string]),
|
|
112
|
+
"marginTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
113
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
114
|
+
"description": PropTypes.string,
|
|
115
|
+
"toString": PropTypes.func.isRequired,
|
|
116
|
+
"valueOf": PropTypes.func.isRequired
|
|
117
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
118
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
119
|
+
"description": PropTypes.string,
|
|
120
|
+
"toString": PropTypes.func.isRequired,
|
|
121
|
+
"valueOf": PropTypes.func.isRequired
|
|
122
|
+
}), PropTypes.string]),
|
|
123
|
+
"marginX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
124
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
125
|
+
"description": PropTypes.string,
|
|
126
|
+
"toString": PropTypes.func.isRequired,
|
|
127
|
+
"valueOf": PropTypes.func.isRequired
|
|
128
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
129
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
130
|
+
"description": PropTypes.string,
|
|
131
|
+
"toString": PropTypes.func.isRequired,
|
|
132
|
+
"valueOf": PropTypes.func.isRequired
|
|
133
|
+
}), PropTypes.string]),
|
|
134
|
+
"marginY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
135
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
136
|
+
"description": PropTypes.string,
|
|
137
|
+
"toString": PropTypes.func.isRequired,
|
|
138
|
+
"valueOf": PropTypes.func.isRequired
|
|
139
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
140
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
141
|
+
"description": PropTypes.string,
|
|
142
|
+
"toString": PropTypes.func.isRequired,
|
|
143
|
+
"valueOf": PropTypes.func.isRequired
|
|
144
|
+
}), PropTypes.string]),
|
|
145
|
+
"mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
146
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
147
|
+
"description": PropTypes.string,
|
|
148
|
+
"toString": PropTypes.func.isRequired,
|
|
149
|
+
"valueOf": PropTypes.func.isRequired
|
|
150
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
151
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
152
|
+
"description": PropTypes.string,
|
|
153
|
+
"toString": PropTypes.func.isRequired,
|
|
154
|
+
"valueOf": PropTypes.func.isRequired
|
|
155
|
+
}), PropTypes.string]),
|
|
156
|
+
"ml": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
157
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
158
|
+
"description": PropTypes.string,
|
|
159
|
+
"toString": PropTypes.func.isRequired,
|
|
160
|
+
"valueOf": PropTypes.func.isRequired
|
|
161
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
162
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
163
|
+
"description": PropTypes.string,
|
|
164
|
+
"toString": PropTypes.func.isRequired,
|
|
165
|
+
"valueOf": PropTypes.func.isRequired
|
|
166
|
+
}), PropTypes.string]),
|
|
167
|
+
"mr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
168
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
169
|
+
"description": PropTypes.string,
|
|
170
|
+
"toString": PropTypes.func.isRequired,
|
|
171
|
+
"valueOf": PropTypes.func.isRequired
|
|
172
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
173
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
174
|
+
"description": PropTypes.string,
|
|
175
|
+
"toString": PropTypes.func.isRequired,
|
|
176
|
+
"valueOf": PropTypes.func.isRequired
|
|
177
|
+
}), PropTypes.string]),
|
|
178
|
+
"mt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
179
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
180
|
+
"description": PropTypes.string,
|
|
181
|
+
"toString": PropTypes.func.isRequired,
|
|
182
|
+
"valueOf": PropTypes.func.isRequired
|
|
183
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
184
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
185
|
+
"description": PropTypes.string,
|
|
186
|
+
"toString": PropTypes.func.isRequired,
|
|
187
|
+
"valueOf": PropTypes.func.isRequired
|
|
188
|
+
}), PropTypes.string]),
|
|
189
|
+
"mx": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
190
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
191
|
+
"description": PropTypes.string,
|
|
192
|
+
"toString": PropTypes.func.isRequired,
|
|
193
|
+
"valueOf": PropTypes.func.isRequired
|
|
194
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
195
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
196
|
+
"description": PropTypes.string,
|
|
197
|
+
"toString": PropTypes.func.isRequired,
|
|
198
|
+
"valueOf": PropTypes.func.isRequired
|
|
199
|
+
}), PropTypes.string]),
|
|
200
|
+
"my": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
201
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
202
|
+
"description": PropTypes.string,
|
|
203
|
+
"toString": PropTypes.func.isRequired,
|
|
204
|
+
"valueOf": PropTypes.func.isRequired
|
|
205
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
206
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
207
|
+
"description": PropTypes.string,
|
|
208
|
+
"toString": PropTypes.func.isRequired,
|
|
209
|
+
"valueOf": PropTypes.func.isRequired
|
|
210
|
+
}), PropTypes.string]),
|
|
211
|
+
"warning": PropTypes.oneOfType([PropTypes.string, PropTypes.bool])
|
|
95
212
|
};
|
|
96
213
|
export default Fieldset;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const StyledFieldset: import("styled-components").StyledComponent<"fieldset", any, {}, never>;
|
|
2
|
+
declare type StyledLegendContentProps = {
|
|
3
|
+
isRequired?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const StyledLegendContent: import("styled-components").StyledComponent<"span", any, StyledLegendContentProps, never>;
|
|
6
|
+
declare type StyledLegendProps = {
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
width?: number;
|
|
9
|
+
align?: "left" | "right";
|
|
10
|
+
rightPadding?: 1 | 2;
|
|
11
|
+
};
|
|
12
|
+
declare const StyledLegend: import("styled-components").StyledComponent<"legend", any, StyledLegendProps, never>;
|
|
13
|
+
export { StyledFieldset, StyledLegend, StyledLegendContent };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
import { margin } from "styled-system";
|
|
4
3
|
import BaseTheme from "../../style/themes/base";
|
|
5
4
|
const StyledFieldset = styled.fieldset`
|
|
@@ -48,13 +47,4 @@ const StyledLegend = styled.legend`
|
|
|
48
47
|
padding-right: ${rightPadding === 1 ? "var(--spacing100)" : "var(--spacing200)"};
|
|
49
48
|
`}
|
|
50
49
|
`;
|
|
51
|
-
StyledLegend.defaultProps = {
|
|
52
|
-
align: "right"
|
|
53
|
-
};
|
|
54
|
-
StyledLegend.propTypes = {
|
|
55
|
-
inline: PropTypes.bool,
|
|
56
|
-
width: PropTypes.number,
|
|
57
|
-
align: PropTypes.oneOf(["left", "right"]),
|
|
58
|
-
rightPadding: PropTypes.oneOf([1, 2])
|
|
59
|
-
};
|
|
60
50
|
export { StyledFieldset, StyledLegend, StyledLegendContent };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./fieldset";
|
|
1
|
+
export { default } from "./fieldset.component";
|
|
2
|
+
export type { FieldsetProps } from "./fieldset.component";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./popover";
|
|
1
|
+
export { default } from "./popover.component";
|
|
2
|
+
export type { PopoverProps } from "./popover.component";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { State } from "@popperjs/core";
|
|
3
|
+
declare type PopoverModifier = {
|
|
4
|
+
name: string;
|
|
5
|
+
options?: Record<string, unknown>;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export interface PopoverProps {
|
|
9
|
+
children: React.ReactElement;
|
|
10
|
+
placement?: "auto" | "auto-start" | "auto-end" | "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "right" | "right-start" | "right-end" | "left" | "left-start" | "left-end";
|
|
11
|
+
disableBackgroundUI?: boolean;
|
|
12
|
+
modifiers?: PopoverModifier[];
|
|
13
|
+
onFirstUpdate?: (state: Partial<State>) => void;
|
|
14
|
+
disablePortal?: boolean;
|
|
15
|
+
reference: React.RefObject<HTMLElement>;
|
|
16
|
+
}
|
|
17
|
+
declare const Popover: ({ children, placement, disablePortal, reference, onFirstUpdate, modifiers, disableBackgroundUI, }: PopoverProps) => JSX.Element;
|
|
18
|
+
export default Popover;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useLayoutEffect, useRef } from "react";
|
|
2
|
-
import ReactDOM from "react-dom";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
3
|
+
import ReactDOM from "react-dom";
|
|
4
4
|
import { createPopper } from "@popperjs/core";
|
|
5
5
|
import useResizeObserver from "../../hooks/__internal__/useResizeObserver";
|
|
6
6
|
import StyledBackdrop from "./popover.style";
|
|
@@ -18,7 +18,8 @@ const Popover = ({
|
|
|
18
18
|
}) => {
|
|
19
19
|
var _reference$current;
|
|
20
20
|
|
|
21
|
-
const elementDOM = useRef();
|
|
21
|
+
const elementDOM = useRef(null); // TODO: Remove TempModalContext after modal has been converted to TS
|
|
22
|
+
|
|
22
23
|
const {
|
|
23
24
|
isInModal
|
|
24
25
|
} = useContext(ModalContext);
|
|
@@ -30,8 +31,8 @@ const Popover = ({
|
|
|
30
31
|
mountNode.appendChild(elementDOM.current);
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
const popperInstance = useRef();
|
|
34
|
-
const popperRef = useRef();
|
|
34
|
+
const popperInstance = useRef(null);
|
|
35
|
+
const popperRef = useRef(null);
|
|
35
36
|
let content;
|
|
36
37
|
let popperElementRef;
|
|
37
38
|
const childRef = React.Children.only(children).ref;
|
|
@@ -94,23 +95,24 @@ const Popover = ({
|
|
|
94
95
|
};
|
|
95
96
|
|
|
96
97
|
Popover.propTypes = {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
98
|
+
"children": PropTypes.element.isRequired,
|
|
99
|
+
"disableBackgroundUI": PropTypes.bool,
|
|
100
|
+
"disablePortal": PropTypes.bool,
|
|
101
|
+
"modifiers": PropTypes.arrayOf(PropTypes.shape({
|
|
102
|
+
"enabled": PropTypes.bool,
|
|
103
|
+
"name": PropTypes.string.isRequired,
|
|
104
|
+
"options": PropTypes.object
|
|
105
|
+
})),
|
|
106
|
+
"onFirstUpdate": PropTypes.func,
|
|
107
|
+
"placement": PropTypes.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
|
|
108
|
+
"reference": PropTypes.shape({
|
|
109
|
+
"current": PropTypes.oneOfType([PropTypes.oneOf([null]), function (props, propName) {
|
|
110
|
+
if (props[propName] == null) {
|
|
111
|
+
return new Error("Prop '" + propName + "' is required but wasn't specified");
|
|
112
|
+
} else if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
|
|
113
|
+
return new Error("Expected prop '" + propName + "' to be of type Element");
|
|
114
|
+
}
|
|
115
|
+
}]).isRequired
|
|
114
116
|
}).isRequired
|
|
115
117
|
};
|
|
116
118
|
export default Popover;
|
|
@@ -35,6 +35,8 @@ export interface ButtonProps extends SpaceProps {
|
|
|
35
35
|
iconTooltipPosition?: TooltipPositions;
|
|
36
36
|
/** Defines an Icon type within the button */
|
|
37
37
|
iconType?: IconType;
|
|
38
|
+
/** id attribute */
|
|
39
|
+
id?: string;
|
|
38
40
|
/** If provided, the text inside a button will not wrap */
|
|
39
41
|
noWrap?: boolean;
|
|
40
42
|
/** Specify a callback triggered on blur */
|
|
@@ -192,6 +192,7 @@ Button.propTypes = {
|
|
|
192
192
|
"iconTooltipMessage": PropTypes.string,
|
|
193
193
|
"iconTooltipPosition": PropTypes.oneOf(["bottom", "left", "right", "top"]),
|
|
194
194
|
"iconType": PropTypes.oneOf(["add", "admin", "alert", "analysis", "arrow_down", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_left", "arrow_right_small", "arrow_right", "arrow_up", "arrow", "attach", "bank", "basket_with_squares", "basket", "bin", "block_arrow_right", "blocked_square", "blocked", "bold", "boxed_shapes", "bulk_destroy", "bullet_list_dotted", "bullet_list_numbers", "bullet_list", "business", "calendar_today", "calendar", "call", "camera", "card_view", "caret_down", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "caret_left", "caret_right", "caret_up", "cart", "chart_bar", "chart_line", "chart_pie", "chat_notes", "chat", "chevron_down_thick", "chevron_down", "chevron_left_thick", "chevron_left", "chevron_right_thick", "chevron_right", "chevron_up_thick", "chevron_up", "circle_with_dots", "circles_connection", "clock", "close", "coins", "collaborate", "computer_clock", "connect", "contacts", "copy", "create", "credit_card_slash", "credit_card", "cross_circle", "cross", "csv", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "draft", "drag_vertical", "drag", "dropdown", "duplicate", "edit", "edited", "ellipsis_horizontal", "ellipsis_vertical", "email_switch", "email", "entry", "envelope_dollar", "envelope_euro", "error_square", "error", "euro", "expand", "factory", "favourite_lined", "favourite", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter_new", "filter", "fit_height", "fit_width", "flag", "folder", "gift", "go", "graph", "grid", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "italic", "key", "ledger_arrow_left", "ledger_arrow_right", "ledger", "lightbulb_off", "lightbulb_on", "link", "list_view", "location", "locked", "logout", "lookup", "marker", "message", "minus_large", "minus", "mobile", "money_bag", "none", "old_warning", "pause_circle", "pause", "pdf", "people_switch", "people", "person_info", "person_tick", "person", "phone", "piggy_bank", "play_circle", "play", "plus_large", "plus", "pound", "print", "progress", "progressed", "question_hollow", "question_mark", "question", "refresh_clock", "refresh", "remove", "sage_coin", "save", "scan", "search", "services", "settings_old", "settings", "share", "shop", "sort_down", "sort_up", "spanner", "split_container", "split", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "submitted", "sync", "tag", "talk", "three_boxes", "tick_circle", "tick", "true_tick", "undo", "unlocked", "upload", "uploaded", "video", "view", "warning"]),
|
|
195
|
+
"id": PropTypes.string,
|
|
195
196
|
"m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
196
197
|
"__@toStringTag": PropTypes.string.isRequired,
|
|
197
198
|
"description": PropTypes.string,
|
|
@@ -539,6 +540,7 @@ ButtonWithForwardRef.propTypes = {
|
|
|
539
540
|
"iconTooltipMessage": PropTypes.string,
|
|
540
541
|
"iconTooltipPosition": PropTypes.oneOf(["bottom", "left", "right", "top"]),
|
|
541
542
|
"iconType": PropTypes.oneOf(["add", "admin", "alert", "analysis", "arrow_down", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_left", "arrow_right_small", "arrow_right", "arrow_up", "arrow", "attach", "bank", "basket_with_squares", "basket", "bin", "block_arrow_right", "blocked_square", "blocked", "bold", "boxed_shapes", "bulk_destroy", "bullet_list_dotted", "bullet_list_numbers", "bullet_list", "business", "calendar_today", "calendar", "call", "camera", "card_view", "caret_down", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "caret_left", "caret_right", "caret_up", "cart", "chart_bar", "chart_line", "chart_pie", "chat_notes", "chat", "chevron_down_thick", "chevron_down", "chevron_left_thick", "chevron_left", "chevron_right_thick", "chevron_right", "chevron_up_thick", "chevron_up", "circle_with_dots", "circles_connection", "clock", "close", "coins", "collaborate", "computer_clock", "connect", "contacts", "copy", "create", "credit_card_slash", "credit_card", "cross_circle", "cross", "csv", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "draft", "drag_vertical", "drag", "dropdown", "duplicate", "edit", "edited", "ellipsis_horizontal", "ellipsis_vertical", "email_switch", "email", "entry", "envelope_dollar", "envelope_euro", "error_square", "error", "euro", "expand", "factory", "favourite_lined", "favourite", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter_new", "filter", "fit_height", "fit_width", "flag", "folder", "gift", "go", "graph", "grid", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "italic", "key", "ledger_arrow_left", "ledger_arrow_right", "ledger", "lightbulb_off", "lightbulb_on", "link", "list_view", "location", "locked", "logout", "lookup", "marker", "message", "minus_large", "minus", "mobile", "money_bag", "none", "old_warning", "pause_circle", "pause", "pdf", "people_switch", "people", "person_info", "person_tick", "person", "phone", "piggy_bank", "play_circle", "play", "plus_large", "plus", "pound", "print", "progress", "progressed", "question_hollow", "question_mark", "question", "refresh_clock", "refresh", "remove", "sage_coin", "save", "scan", "search", "services", "settings_old", "settings", "share", "shop", "sort_down", "sort_up", "spanner", "split_container", "split", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "submitted", "sync", "tag", "talk", "three_boxes", "tick_circle", "tick", "true_tick", "undo", "unlocked", "upload", "uploaded", "video", "view", "warning"]),
|
|
543
|
+
"id": PropTypes.string,
|
|
542
544
|
"m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
543
545
|
"__@toStringTag": PropTypes.string.isRequired,
|
|
544
546
|
"description": PropTypes.string,
|
|
@@ -221,6 +221,7 @@ MultiActionButton.propTypes = {
|
|
|
221
221
|
"formTarget": PropTypes.string,
|
|
222
222
|
"hidden": PropTypes.bool,
|
|
223
223
|
"iconPosition": PropTypes.oneOf(["after", "before"]),
|
|
224
|
+
"iconType": PropTypes.oneOf(["add", "admin", "alert", "analysis", "arrow_down", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_left", "arrow_right_small", "arrow_right", "arrow_up", "arrow", "attach", "bank", "basket_with_squares", "basket", "bin", "block_arrow_right", "blocked_square", "blocked", "bold", "boxed_shapes", "bulk_destroy", "bullet_list_dotted", "bullet_list_numbers", "bullet_list", "business", "calendar_today", "calendar", "call", "camera", "card_view", "caret_down", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "caret_left", "caret_right", "caret_up", "cart", "chart_bar", "chart_line", "chart_pie", "chat_notes", "chat", "chevron_down_thick", "chevron_down", "chevron_left_thick", "chevron_left", "chevron_right_thick", "chevron_right", "chevron_up_thick", "chevron_up", "circle_with_dots", "circles_connection", "clock", "close", "coins", "collaborate", "computer_clock", "connect", "contacts", "copy", "create", "credit_card_slash", "credit_card", "cross_circle", "cross", "csv", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "draft", "drag_vertical", "drag", "dropdown", "duplicate", "edit", "edited", "ellipsis_horizontal", "ellipsis_vertical", "email_switch", "email", "entry", "envelope_dollar", "envelope_euro", "error_square", "error", "euro", "expand", "factory", "favourite_lined", "favourite", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter_new", "filter", "fit_height", "fit_width", "flag", "folder", "gift", "go", "graph", "grid", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "italic", "key", "ledger_arrow_left", "ledger_arrow_right", "ledger", "lightbulb_off", "lightbulb_on", "link", "list_view", "location", "locked", "logout", "lookup", "marker", "message", "minus_large", "minus", "mobile", "money_bag", "none", "old_warning", "pause_circle", "pause", "pdf", "people_switch", "people", "person_info", "person_tick", "person", "phone", "piggy_bank", "play_circle", "play", "plus_large", "plus", "pound", "print", "progress", "progressed", "question_hollow", "question_mark", "question", "refresh_clock", "refresh", "remove", "sage_coin", "save", "scan", "search", "services", "settings_old", "settings", "share", "shop", "sort_down", "sort_up", "spanner", "split_container", "split", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "submitted", "sync", "tag", "talk", "three_boxes", "tick_circle", "tick", "true_tick", "undo", "unlocked", "upload", "uploaded", "video", "view", "warning"]),
|
|
224
225
|
"id": PropTypes.string,
|
|
225
226
|
"inlist": PropTypes.any,
|
|
226
227
|
"inputMode": PropTypes.oneOf(["decimal", "email", "none", "numeric", "search", "tel", "text", "url"]),
|
|
@@ -120,7 +120,7 @@ const Pager = ({
|
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
const renderPageSizeOptions = () => {
|
|
123
|
-
return showPageSizeSelection && /*#__PURE__*/React.createElement(StyledPagerSizeOptionsInner, null, showPageSizeLabelBefore && /*#__PURE__*/React.createElement("span", null, l.pager.show()), sizeSelector(), showPageSizeLabelAfter && /*#__PURE__*/React.createElement("
|
|
123
|
+
return showPageSizeSelection && /*#__PURE__*/React.createElement(StyledPagerSizeOptionsInner, null, showPageSizeLabelBefore && /*#__PURE__*/React.createElement("span", null, l.pager.show()), sizeSelector(), showPageSizeLabelAfter && /*#__PURE__*/React.createElement("div", null, l.pager.records(currentPageSize, false)));
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
const renderTotalRecords = () => showTotalRecords && l.pager.records(totalRecords);
|