carbon-react 111.8.5 → 111.9.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/__internal__/focus-trap/focus-trap-utils.js +21 -1
- package/esm/__internal__/focus-trap/focus-trap.component.js +4 -0
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.component.js +11 -1
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.style.js +3 -1
- package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.js +11 -1
- package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.js +3 -2
- package/esm/components/flat-table/flat-table-head/flat-table-head.style.js +8 -7
- package/esm/components/flat-table/flat-table-header/flat-table-header.component.js +11 -1
- package/esm/components/flat-table/flat-table-header/flat-table-header.d.ts +2 -0
- package/esm/components/flat-table/flat-table-header/flat-table-header.style.js +31 -22
- package/esm/components/flat-table/flat-table-row/flat-table-row.component.js +46 -19
- package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +72 -22
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.component.js +31 -6
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.d.ts +2 -0
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +11 -4
- package/esm/components/flat-table/flat-table.style.js +68 -19
- package/esm/components/grouped-character/grouped-character.component.d.ts +30 -0
- package/esm/components/grouped-character/grouped-character.component.js +544 -41
- package/esm/components/grouped-character/grouped-character.utils.d.ts +2 -0
- package/esm/components/grouped-character/index.d.ts +2 -1
- package/lib/__internal__/focus-trap/focus-trap-utils.js +21 -1
- package/lib/__internal__/focus-trap/focus-trap.component.js +4 -0
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.component.js +11 -1
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.style.js +3 -1
- package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.js +11 -1
- package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.js +3 -2
- package/lib/components/flat-table/flat-table-head/flat-table-head.style.js +8 -7
- package/lib/components/flat-table/flat-table-header/flat-table-header.component.js +11 -1
- package/lib/components/flat-table/flat-table-header/flat-table-header.d.ts +2 -0
- package/lib/components/flat-table/flat-table-header/flat-table-header.style.js +34 -23
- package/lib/components/flat-table/flat-table-row/flat-table-row.component.js +47 -19
- package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +72 -22
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.component.js +35 -6
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.d.ts +2 -0
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +11 -4
- package/lib/components/flat-table/flat-table.style.js +69 -20
- package/lib/components/grouped-character/grouped-character.component.d.ts +30 -0
- package/lib/components/grouped-character/grouped-character.component.js +545 -45
- package/lib/components/grouped-character/grouped-character.utils.d.ts +2 -0
- package/lib/components/grouped-character/index.d.ts +2 -1
- package/package.json +1 -1
- package/esm/components/grouped-character/grouped-character.d.ts +0 -23
- package/lib/components/grouped-character/grouped-character.d.ts +0 -23
|
@@ -16,6 +16,8 @@ export interface FlatTableRowHeaderProps extends PaddingProps {
|
|
|
16
16
|
verticalBorder?: TableBorderSize;
|
|
17
17
|
/** Sets the color of the right border */
|
|
18
18
|
verticalBorderColor?: string;
|
|
19
|
+
/** Defines whether the column should be sticky on the left or right hand side of the Table */
|
|
20
|
+
stickyAlignment?: "left" | "right";
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
declare function FlatTableRowHeader(
|
|
@@ -30,10 +30,12 @@ const StyledFlatTableRowHeader = _styledComponents.default.th`
|
|
|
30
30
|
theme,
|
|
31
31
|
colWidth,
|
|
32
32
|
leftPosition,
|
|
33
|
+
rightPosition,
|
|
33
34
|
isTruncated,
|
|
34
35
|
expandable,
|
|
35
36
|
verticalBorder,
|
|
36
|
-
verticalBorderColor
|
|
37
|
+
verticalBorderColor,
|
|
38
|
+
stickyAlignment
|
|
37
39
|
}) => (0, _styledComponents.css)`
|
|
38
40
|
background-color: var(--colorsUtilityYang100);
|
|
39
41
|
border: 1px solid var(--colorsUtilityMajor100);
|
|
@@ -69,14 +71,19 @@ const StyledFlatTableRowHeader = _styledComponents.default.th`
|
|
|
69
71
|
${_styledSystem.padding}
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
${leftPosition !== undefined && (0, _styledComponents.css)`
|
|
75
|
+
left: ${leftPosition}px;
|
|
76
|
+
`}
|
|
77
|
+
${rightPosition !== undefined && (0, _styledComponents.css)`
|
|
78
|
+
right: ${rightPosition}px;
|
|
79
|
+
`}
|
|
73
80
|
|
|
74
81
|
${verticalBorder && (0, _styledComponents.css)`
|
|
75
|
-
border
|
|
82
|
+
border-${stickyAlignment === "right" ? "left" : "right"}-width: ${verticalBorderSizes[verticalBorder]};
|
|
76
83
|
`}
|
|
77
84
|
|
|
78
85
|
${verticalBorderColor && (0, _styledComponents.css)`
|
|
79
|
-
border
|
|
86
|
+
border-${stickyAlignment === "right" ? "left" : "right"}-color: ${(0, _color.toColor)(theme, verticalBorderColor)};
|
|
80
87
|
`}
|
|
81
88
|
}
|
|
82
89
|
|
|
@@ -31,6 +31,9 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
31
31
|
|
|
32
32
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
|
33
33
|
|
|
34
|
+
const HEADER_OVERLAY_INCREMENT = 3;
|
|
35
|
+
const STICKY_FOOTER_OVERLAY_INCREMENT = 1;
|
|
36
|
+
const ROW_HEADER_OVERLAY_INCREMENT = 5;
|
|
34
37
|
const StyledTableContainer = _styledComponents.default.div`
|
|
35
38
|
${({
|
|
36
39
|
width,
|
|
@@ -38,7 +41,7 @@ const StyledTableContainer = _styledComponents.default.div`
|
|
|
38
41
|
}) => width && (0, _styledComponents.css)`
|
|
39
42
|
width: ${width};
|
|
40
43
|
|
|
41
|
-
${overflowX && `overflow-x: ${overflowX}
|
|
44
|
+
${overflowX && `overflow-x: ${overflowX};`}
|
|
42
45
|
`}
|
|
43
46
|
`;
|
|
44
47
|
exports.StyledTableContainer = StyledTableContainer;
|
|
@@ -137,34 +140,49 @@ const StyledFlatTableWrapper = (0, _styledComponents.default)(_box.default)`
|
|
|
137
140
|
case "light":
|
|
138
141
|
return (0, _styledComponents.css)`
|
|
139
142
|
${_flatTableHeader.default},
|
|
140
|
-
${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader},
|
|
141
143
|
${_flatTableHead.default} ${_flatTableCheckbox.default} {
|
|
142
144
|
background-color: var(--colorsUtilityMajor100);
|
|
143
145
|
border-right: 1px solid var(--colorsUtilityMajor150);
|
|
144
146
|
border-bottom-color: var(--colorsUtilityMajor150);
|
|
145
147
|
}
|
|
148
|
+
${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader} {
|
|
149
|
+
background-color: var(--colorsUtilityMajor100);
|
|
150
|
+
border-bottom-color: var(--colorsUtilityMajor150);
|
|
151
|
+
border-right-color: var(--colorsUtilityMajor150);
|
|
152
|
+
border-left-color: var(--colorsUtilityMajor150);
|
|
153
|
+
}
|
|
146
154
|
`;
|
|
147
155
|
|
|
148
156
|
case "transparent-base":
|
|
149
157
|
return (0, _styledComponents.css)`
|
|
150
158
|
${_flatTableHeader.default},
|
|
151
|
-
${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader},
|
|
152
159
|
${_flatTableHead.default} ${_flatTableCheckbox.default} {
|
|
153
160
|
background-color: var(--colorsUtilityMajor025);
|
|
154
161
|
border-right: 1px solid var(--colorsUtilityMajor025);
|
|
155
162
|
border-bottom-color: var(--colorsUtilityMajor100);
|
|
156
163
|
}
|
|
164
|
+
${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader} {
|
|
165
|
+
background-color: var(--colorsUtilityMajor025);
|
|
166
|
+
border-bottom-color: var(--colorsUtilityMajor100);
|
|
167
|
+
border-right-color: var(--colorsUtilityMajor025);
|
|
168
|
+
border-left-color: var(--colorsUtilityMajor025);
|
|
169
|
+
}
|
|
157
170
|
`;
|
|
158
171
|
|
|
159
172
|
case "transparent-white":
|
|
160
173
|
return (0, _styledComponents.css)`
|
|
161
174
|
${_flatTableHeader.default},
|
|
162
|
-
${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader},
|
|
163
175
|
${_flatTableHead.default} ${_flatTableCheckbox.default} {
|
|
164
176
|
background-color: var(--colorsUtilityYang100);
|
|
165
177
|
border-right: 1px solid var(--colorsUtilityYang100);
|
|
166
178
|
border-bottom-color: var(--colorsUtilityMajor100);
|
|
167
179
|
}
|
|
180
|
+
${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader} {
|
|
181
|
+
background-color: var(--colorsUtilityYang100);
|
|
182
|
+
border-bottom-color: var(--colorsUtilityMajor100);
|
|
183
|
+
border-right-color: var(--colorsUtilityYang100);
|
|
184
|
+
border-left-color: var(--colorsUtilityYang100);
|
|
185
|
+
}
|
|
168
186
|
`;
|
|
169
187
|
// default theme is "dark"
|
|
170
188
|
|
|
@@ -172,12 +190,19 @@ const StyledFlatTableWrapper = (0, _styledComponents.default)(_box.default)`
|
|
|
172
190
|
return (0, _styledComponents.css)`
|
|
173
191
|
${_flatTableHead.default} ${_flatTableCheckbox.default},
|
|
174
192
|
${_flatTableHeader.default},
|
|
175
|
-
${_flatTableHead.default}
|
|
193
|
+
${_flatTableHead.default} {
|
|
176
194
|
background-color: var(--colorsUtilityMajor400);
|
|
177
195
|
border-right: 1px solid var(--colorsUtilityMajor300);
|
|
178
196
|
color: var(--colorsUtilityYang100);
|
|
179
197
|
border-bottom-color: var(--colorsUtilityMajor300);
|
|
180
198
|
}
|
|
199
|
+
${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader} {
|
|
200
|
+
background-color: var(--colorsUtilityMajor400);
|
|
201
|
+
color: var(--colorsUtilityYang100);
|
|
202
|
+
border-bottom-color: var(--colorsUtilityMajor300);
|
|
203
|
+
border-right-color: var(--colorsUtilityMajor300);
|
|
204
|
+
border-left-color: var(--colorsUtilityMajor300);
|
|
205
|
+
}
|
|
181
206
|
`;
|
|
182
207
|
}
|
|
183
208
|
}}
|
|
@@ -195,24 +220,44 @@ const StyledFlatTableWrapper = (0, _styledComponents.default)(_box.default)`
|
|
|
195
220
|
`}
|
|
196
221
|
|
|
197
222
|
${({
|
|
198
|
-
hasStickyHead
|
|
223
|
+
hasStickyHead,
|
|
224
|
+
theme
|
|
199
225
|
}) => hasStickyHead && (0, _styledComponents.css)`
|
|
200
|
-
${_flatTableHead.default}
|
|
226
|
+
${_flatTableHead.default} {
|
|
201
227
|
position: sticky;
|
|
202
|
-
z-index: ${({
|
|
203
|
-
theme
|
|
204
|
-
}) => theme.zIndex.overlay};
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader},
|
|
208
|
-
${_flatTableHead.default} ${_flatTableCheckbox.default} {
|
|
209
|
-
z-index: ${({
|
|
210
|
-
theme
|
|
211
|
-
}) => theme.zIndex.overlay + 2};
|
|
212
228
|
top: 0;
|
|
213
229
|
left: 0;
|
|
230
|
+
z-index: ${theme.zIndex.overlay + ROW_HEADER_OVERLAY_INCREMENT};
|
|
214
231
|
}
|
|
215
232
|
`}
|
|
233
|
+
|
|
234
|
+
${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader},
|
|
235
|
+
${_flatTableHeader.default}.isSticky,
|
|
236
|
+
${_flatTableHead.default} ${_flatTableCheckbox.default}.isSticky {
|
|
237
|
+
z-index: ${({
|
|
238
|
+
theme
|
|
239
|
+
}) => theme.zIndex.overlay + ROW_HEADER_OVERLAY_INCREMENT};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
thead ${_flatTableHeader.default}.isSticky, ${_flatTableCheckbox.default}.isSticky {
|
|
243
|
+
border-right: none;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
${_flatTableHeader.default}, ${_flatTableCheckbox.default} {
|
|
247
|
+
z-index: ${({
|
|
248
|
+
theme
|
|
249
|
+
}) => theme.zIndex.overlay + HEADER_OVERLAY_INCREMENT};
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
tbody
|
|
253
|
+
${_flatTableRowHeader.StyledFlatTableRowHeader},
|
|
254
|
+
${_flatTableCell.StyledFlatTableCell}.isSticky,
|
|
255
|
+
tbody
|
|
256
|
+
${_flatTableCheckbox.default}.isSticky {
|
|
257
|
+
z-index: ${({
|
|
258
|
+
theme
|
|
259
|
+
}) => theme.zIndex.overlay};
|
|
260
|
+
}
|
|
216
261
|
`;
|
|
217
262
|
exports.StyledFlatTableWrapper = StyledFlatTableWrapper;
|
|
218
263
|
StyledFlatTableWrapper.defaultProps = {
|
|
@@ -220,11 +265,15 @@ StyledFlatTableWrapper.defaultProps = {
|
|
|
220
265
|
};
|
|
221
266
|
const StyledFlatTableFooter = _styledComponents.default.div`
|
|
222
267
|
${({
|
|
223
|
-
hasStickyFooter
|
|
268
|
+
hasStickyFooter,
|
|
269
|
+
theme
|
|
224
270
|
}) => hasStickyFooter && (0, _styledComponents.css)`
|
|
225
271
|
position: sticky;
|
|
226
272
|
bottom: 0px;
|
|
227
|
-
z-index: ${
|
|
273
|
+
z-index: ${theme.zIndex.overlay + STICKY_FOOTER_OVERLAY_INCREMENT};
|
|
228
274
|
`}
|
|
229
275
|
`;
|
|
230
|
-
exports.StyledFlatTableFooter = StyledFlatTableFooter;
|
|
276
|
+
exports.StyledFlatTableFooter = StyledFlatTableFooter;
|
|
277
|
+
StyledFlatTableFooter.defaultProps = {
|
|
278
|
+
theme: _themes.baseTheme
|
|
279
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TextboxProps } from "../textbox";
|
|
3
|
+
declare type EventValue = {
|
|
4
|
+
formattedValue: string;
|
|
5
|
+
rawValue: string;
|
|
6
|
+
};
|
|
7
|
+
declare type CustomTarget = {
|
|
8
|
+
name?: string;
|
|
9
|
+
id?: string;
|
|
10
|
+
value: EventValue;
|
|
11
|
+
};
|
|
12
|
+
export interface CustomEvent extends Omit<React.ChangeEvent<HTMLInputElement>, "target"> {
|
|
13
|
+
target: CustomTarget;
|
|
14
|
+
}
|
|
15
|
+
export interface GroupedCharacterProps extends Omit<TextboxProps, "onChange" | "onBlur"> {
|
|
16
|
+
/** Default input value if component is meant to be used as an uncontrolled component */
|
|
17
|
+
defaultValue?: string;
|
|
18
|
+
/** pattern by which input value should be grouped */
|
|
19
|
+
groups: number[];
|
|
20
|
+
/** Handler for blur event */
|
|
21
|
+
onBlur?: (ev: CustomEvent) => void;
|
|
22
|
+
/** Handler for change event if input is meant to be used as a controlled component */
|
|
23
|
+
onChange?: (ev: CustomEvent) => void;
|
|
24
|
+
/** character to be used as separator - has to be a 1 character string */
|
|
25
|
+
separator: string;
|
|
26
|
+
/** Input value if component is meant to be used as a controlled component */
|
|
27
|
+
value?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const GroupedCharacter: ({ defaultValue, groups, onBlur, onChange, separator: rawSeparator, value: externalValue, ...rest }: GroupedCharacterProps) => JSX.Element;
|
|
30
|
+
export default GroupedCharacter;
|