@dxc-technology/halstack-react 6.2.2 → 7.0.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/accordion/types.d.ts +1 -0
- package/accordion-group/types.d.ts +1 -0
- package/box/types.d.ts +1 -0
- package/card/types.d.ts +1 -0
- package/common/variables.js +5 -5
- package/dialog/types.d.ts +1 -0
- package/dropdown/Dropdown.js +3 -2
- package/dropdown/Dropdown.test.js +1 -2
- package/file-input/FileInput.js +13 -5
- package/file-input/FileInput.test.js +41 -0
- package/flex/Flex.d.ts +1 -1
- package/flex/Flex.js +31 -19
- package/flex/types.d.ts +14 -3
- package/footer/types.d.ts +1 -0
- package/header/types.d.ts +1 -0
- package/number-input/NumberInput.test.js +38 -1
- package/package.json +1 -1
- package/paginator/Paginator.js +2 -2
- package/paginator/Paginator.test.js +1 -1
- package/password-input/PasswordInput.test.js +13 -12
- package/quick-nav/QuickNav.js +11 -12
- package/quick-nav/QuickNav.stories.tsx +97 -19
- package/radio-group/RadioGroup.js +9 -5
- package/radio-group/RadioGroup.test.js +116 -59
- package/resultsetTable/ResultsetTable.js +1 -3
- package/select/Select.js +3 -1
- package/select/Select.test.js +267 -209
- package/table/Table.js +1 -1
- package/text-input/TextInput.js +165 -151
- package/text-input/TextInput.test.js +140 -82
- package/text-input/types.d.ts +5 -0
package/accordion/types.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ declare type Props = {
|
|
|
56
56
|
*/
|
|
57
57
|
margin?: Space | Margin;
|
|
58
58
|
/**
|
|
59
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
59
60
|
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
60
61
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
61
62
|
*/
|
|
@@ -31,6 +31,7 @@ export declare type AccordionPropsType = {
|
|
|
31
31
|
*/
|
|
32
32
|
disabled?: boolean;
|
|
33
33
|
/**
|
|
34
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
34
35
|
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
35
36
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
36
37
|
*/
|
package/box/types.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ declare type Props = {
|
|
|
31
31
|
*/
|
|
32
32
|
margin?: Space | Margin;
|
|
33
33
|
/**
|
|
34
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
34
35
|
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
35
36
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
36
37
|
*/
|
package/card/types.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ declare type Props = {
|
|
|
47
47
|
*/
|
|
48
48
|
margin?: Space | Size;
|
|
49
49
|
/**
|
|
50
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
50
51
|
* Size of the padding to be applied to the content area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
51
52
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
52
53
|
*/
|
package/common/variables.js
CHANGED
|
@@ -763,13 +763,13 @@ var componentTokens = {
|
|
|
763
763
|
fontTextTransform: "none",
|
|
764
764
|
verticalPadding: "0.75rem",
|
|
765
765
|
horizontalPadding: "2rem",
|
|
766
|
-
marginRight: "
|
|
767
|
-
marginLeft: "
|
|
766
|
+
marginRight: "40px",
|
|
767
|
+
marginLeft: "20px",
|
|
768
768
|
itemsPerPageSelectorMarginLeft: "0px",
|
|
769
|
-
itemsPerPageSelectorMarginRight: "
|
|
769
|
+
itemsPerPageSelectorMarginRight: "0.5rem",
|
|
770
770
|
pageSelectorMarginRight: "30px",
|
|
771
771
|
pageSelectorMarginLeft: "0px",
|
|
772
|
-
totalItemsContainerMarginRight: "
|
|
772
|
+
totalItemsContainerMarginRight: "2.5rem",
|
|
773
773
|
totalItemsContainerMarginLeft: "0px"
|
|
774
774
|
},
|
|
775
775
|
progressBar: {
|
|
@@ -1462,7 +1462,7 @@ var defaultTranslatedComponentLabels = {
|
|
|
1462
1462
|
incrementValueTitle: "Increment value"
|
|
1463
1463
|
},
|
|
1464
1464
|
paginator: {
|
|
1465
|
-
itemsPerPageText: "Items per page ",
|
|
1465
|
+
itemsPerPageText: "Items per page: ",
|
|
1466
1466
|
minToMaxOfText: function minToMaxOfText(minNumberOfItems, maxNumberOfItems, totalItems) {
|
|
1467
1467
|
return "".concat(minNumberOfItems, " to ").concat(maxNumberOfItems, " of ").concat(totalItems);
|
|
1468
1468
|
},
|
package/dialog/types.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ declare type Props = {
|
|
|
26
26
|
*/
|
|
27
27
|
onBackgroundClick?: () => void;
|
|
28
28
|
/**
|
|
29
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
29
30
|
* Size of the padding to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
30
31
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
31
32
|
*/
|
package/dropdown/Dropdown.js
CHANGED
|
@@ -254,7 +254,8 @@ var DxcDropdown = function DxcDropdown(_ref) {
|
|
|
254
254
|
}, /*#__PURE__*/_react["default"].createElement(Popover.Root, {
|
|
255
255
|
open: isOpen
|
|
256
256
|
}, /*#__PURE__*/_react["default"].createElement(Popover.Trigger, {
|
|
257
|
-
asChild: true
|
|
257
|
+
asChild: true,
|
|
258
|
+
type: undefined
|
|
258
259
|
}, /*#__PURE__*/_react["default"].createElement(DropdownTrigger, {
|
|
259
260
|
opened: isOpen,
|
|
260
261
|
onClick: handleTriggerOnClick,
|
|
@@ -267,8 +268,8 @@ var DxcDropdown = function DxcDropdown(_ref) {
|
|
|
267
268
|
margin: margin,
|
|
268
269
|
size: size,
|
|
269
270
|
id: triggerId,
|
|
270
|
-
"aria-disabled": disabled,
|
|
271
271
|
"aria-haspopup": "true",
|
|
272
|
+
"aria-controls": menuId,
|
|
272
273
|
"aria-expanded": isOpen ? true : undefined,
|
|
273
274
|
tabIndex: tabIndex,
|
|
274
275
|
ref: triggerRef
|
|
@@ -74,7 +74,6 @@ describe("Dropdown component tests", function () {
|
|
|
74
74
|
getByRole = _render.getByRole;
|
|
75
75
|
|
|
76
76
|
var dropdown = getByRole("button");
|
|
77
|
-
expect(dropdown.getAttribute("aria-disabled")).toBe("false");
|
|
78
77
|
expect(dropdown.getAttribute("aria-haspopup")).toBe("true");
|
|
79
78
|
expect(dropdown.getAttribute("aria-expanded")).toBeNull();
|
|
80
79
|
expect(dropdown.getAttribute("aria-activedescendant")).toBeNull();
|
|
@@ -82,6 +81,7 @@ describe("Dropdown component tests", function () {
|
|
|
82
81
|
_userEvent["default"].click(dropdown);
|
|
83
82
|
|
|
84
83
|
var menu = getByRole("menu");
|
|
84
|
+
expect(dropdown.getAttribute("aria-controls")).toBe(menu.id);
|
|
85
85
|
expect(dropdown.getAttribute("aria-expanded")).toBe("true");
|
|
86
86
|
expect(menu.getAttribute("aria-activedescendant")).toBe("option-0");
|
|
87
87
|
expect(menu.getAttribute("aria-orientation")).toBe("vertical");
|
|
@@ -123,7 +123,6 @@ describe("Dropdown component tests", function () {
|
|
|
123
123
|
queryByText = _render3.queryByText;
|
|
124
124
|
|
|
125
125
|
var dropdown = getByRole("button");
|
|
126
|
-
expect(dropdown.getAttribute("aria-disabled")).toBe("true");
|
|
127
126
|
expect(queryByRole("menu")).toBeFalsy();
|
|
128
127
|
|
|
129
128
|
_userEvent["default"].click(dropdown);
|
package/file-input/FileInput.js
CHANGED
|
@@ -405,12 +405,16 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
405
405
|
}, helperText), mode === "file" ? /*#__PURE__*/_react["default"].createElement(FileContainer, {
|
|
406
406
|
multiple: multiple,
|
|
407
407
|
files: files
|
|
408
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
408
|
+
}, /*#__PURE__*/_react["default"].createElement(ValueInput, {
|
|
409
409
|
id: fileInputId,
|
|
410
410
|
type: "file",
|
|
411
411
|
accept: accept,
|
|
412
412
|
multiple: multiple,
|
|
413
|
-
onChange: selectFiles
|
|
413
|
+
onChange: selectFiles,
|
|
414
|
+
name: name,
|
|
415
|
+
disabled: disabled,
|
|
416
|
+
readOnly: true,
|
|
417
|
+
"aria-hidden": "true"
|
|
414
418
|
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
415
419
|
mode: "secondary",
|
|
416
420
|
label: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : multiple ? translatedLabels.fileInput.multipleButtonLabelDefault : translatedLabels.fileInput.singleButtonLabelDefault,
|
|
@@ -435,12 +439,16 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
435
439
|
onDelete: onDelete,
|
|
436
440
|
tabIndex: tabIndex
|
|
437
441
|
})));
|
|
438
|
-
})) : /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(
|
|
442
|
+
})) : /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(ValueInput, {
|
|
439
443
|
id: fileInputId,
|
|
440
444
|
type: "file",
|
|
441
445
|
accept: accept,
|
|
442
446
|
multiple: multiple,
|
|
443
|
-
onChange: selectFiles
|
|
447
|
+
onChange: selectFiles,
|
|
448
|
+
name: name,
|
|
449
|
+
disabled: disabled,
|
|
450
|
+
readOnly: true,
|
|
451
|
+
"aria-hidden": "true"
|
|
444
452
|
}), /*#__PURE__*/_react["default"].createElement(DragDropArea, {
|
|
445
453
|
isDragging: isDragging,
|
|
446
454
|
disabled: disabled,
|
|
@@ -543,7 +551,7 @@ var FileContainer = _styledComponents["default"].div(_templateObject5 || (_templ
|
|
|
543
551
|
return props.multiple || props.files.length > 1 ? "column" : "row";
|
|
544
552
|
});
|
|
545
553
|
|
|
546
|
-
var
|
|
554
|
+
var ValueInput = _styledComponents["default"].input(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: none;\n"])));
|
|
547
555
|
|
|
548
556
|
var ButtonContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n"])), function (props) {
|
|
549
557
|
return props.mode === "filedrop" && "padding: 2px 12px 2px 3px";
|
|
@@ -454,4 +454,45 @@ describe("FileInput component tests", function () {
|
|
|
454
454
|
}
|
|
455
455
|
}, _callee6);
|
|
456
456
|
})));
|
|
457
|
+
test("File input sends value when submitted in a form", function () {
|
|
458
|
+
var newFile = new File(["newFile"], "newFile.pdf", {
|
|
459
|
+
type: "pdf"
|
|
460
|
+
});
|
|
461
|
+
var handlerOnSubmit = jest.fn(function (e) {
|
|
462
|
+
e.preventDefault();
|
|
463
|
+
var formData = new FormData(e.target);
|
|
464
|
+
var formProps = Object.fromEntries(formData);
|
|
465
|
+
expect(formProps).toStrictEqual({
|
|
466
|
+
file: newFile
|
|
467
|
+
});
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
var _render17 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement("form", {
|
|
471
|
+
onSubmit: handlerOnSubmit
|
|
472
|
+
}, /*#__PURE__*/_react["default"].createElement(_FileInput["default"], {
|
|
473
|
+
label: "File input label",
|
|
474
|
+
name: "file",
|
|
475
|
+
helperText: "File input helper text",
|
|
476
|
+
mode: "filedrop",
|
|
477
|
+
buttonLabel: "Choose",
|
|
478
|
+
dropAreaLabel: "(or drop the files)"
|
|
479
|
+
}), /*#__PURE__*/_react["default"].createElement("button", {
|
|
480
|
+
type: "submit"
|
|
481
|
+
}, "Submit"))),
|
|
482
|
+
getByText = _render17.getByText,
|
|
483
|
+
getByLabelText = _render17.getByLabelText;
|
|
484
|
+
|
|
485
|
+
var inputFile = getByLabelText("File input label", {
|
|
486
|
+
hidden: true
|
|
487
|
+
});
|
|
488
|
+
var submit = getByText("Submit");
|
|
489
|
+
|
|
490
|
+
_react2.fireEvent.change(inputFile, {
|
|
491
|
+
target: {
|
|
492
|
+
files: [newFile]
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
_userEvent["default"].click(submit);
|
|
497
|
+
});
|
|
457
498
|
});
|
package/flex/Flex.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import FlexPropsType from "./types";
|
|
3
|
-
declare const DxcFlex: ({ children, ...props }: FlexPropsType) => JSX.Element;
|
|
3
|
+
declare const DxcFlex: ({ direction, wrap, gap, order, grow, shrink, basis, children, ...props }: FlexPropsType) => JSX.Element;
|
|
4
4
|
export default DxcFlex;
|
package/flex/Flex.js
CHANGED
|
@@ -11,6 +11,8 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
11
11
|
|
|
12
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
13
|
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
+
|
|
14
16
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
17
|
|
|
16
18
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -19,20 +21,39 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
19
21
|
|
|
20
22
|
var _templateObject;
|
|
21
23
|
|
|
22
|
-
var _excluded = ["children"]
|
|
24
|
+
var _excluded = ["direction", "wrap", "gap", "order", "grow", "shrink", "basis", "children"],
|
|
25
|
+
_excluded2 = ["justifyContent", "alignItems", "alignContent", "alignSelf"];
|
|
23
26
|
|
|
24
27
|
var DxcFlex = function DxcFlex(_ref) {
|
|
25
|
-
var
|
|
28
|
+
var _ref$direction = _ref.direction,
|
|
29
|
+
direction = _ref$direction === void 0 ? "row" : _ref$direction,
|
|
30
|
+
_ref$wrap = _ref.wrap,
|
|
31
|
+
wrap = _ref$wrap === void 0 ? "nowrap" : _ref$wrap,
|
|
32
|
+
_ref$gap = _ref.gap,
|
|
33
|
+
gap = _ref$gap === void 0 ? "0" : _ref$gap,
|
|
34
|
+
_ref$order = _ref.order,
|
|
35
|
+
order = _ref$order === void 0 ? 0 : _ref$order,
|
|
36
|
+
_ref$grow = _ref.grow,
|
|
37
|
+
grow = _ref$grow === void 0 ? 0 : _ref$grow,
|
|
38
|
+
_ref$shrink = _ref.shrink,
|
|
39
|
+
shrink = _ref$shrink === void 0 ? 1 : _ref$shrink,
|
|
40
|
+
_ref$basis = _ref.basis,
|
|
41
|
+
basis = _ref$basis === void 0 ? "auto" : _ref$basis,
|
|
42
|
+
children = _ref.children,
|
|
26
43
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
27
|
-
return /*#__PURE__*/_react["default"].createElement(Flex,
|
|
44
|
+
return /*#__PURE__*/_react["default"].createElement(Flex, (0, _extends2["default"])({
|
|
45
|
+
$direction: direction,
|
|
46
|
+
$wrap: wrap,
|
|
47
|
+
$order: order,
|
|
48
|
+
$grow: grow,
|
|
49
|
+
$shrink: shrink,
|
|
50
|
+
$basis: basis,
|
|
51
|
+
$gap: gap
|
|
52
|
+
}, props), children);
|
|
28
53
|
};
|
|
29
54
|
|
|
30
55
|
var Flex = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n ", "\n"])), function (_ref2) {
|
|
31
|
-
var _ref2$
|
|
32
|
-
direction = _ref2$direction === void 0 ? "row" : _ref2$direction,
|
|
33
|
-
_ref2$wrap = _ref2.wrap,
|
|
34
|
-
wrap = _ref2$wrap === void 0 ? "nowrap" : _ref2$wrap,
|
|
35
|
-
_ref2$justifyContent = _ref2.justifyContent,
|
|
56
|
+
var _ref2$justifyContent = _ref2.justifyContent,
|
|
36
57
|
justifyContent = _ref2$justifyContent === void 0 ? "flex-start" : _ref2$justifyContent,
|
|
37
58
|
_ref2$alignItems = _ref2.alignItems,
|
|
38
59
|
alignItems = _ref2$alignItems === void 0 ? "stretch" : _ref2$alignItems,
|
|
@@ -40,17 +61,8 @@ var Flex = _styledComponents["default"].div(_templateObject || (_templateObject
|
|
|
40
61
|
alignContent = _ref2$alignContent === void 0 ? "normal" : _ref2$alignContent,
|
|
41
62
|
_ref2$alignSelf = _ref2.alignSelf,
|
|
42
63
|
alignSelf = _ref2$alignSelf === void 0 ? "auto" : _ref2$alignSelf,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
_ref2$order = _ref2.order,
|
|
46
|
-
order = _ref2$order === void 0 ? 0 : _ref2$order,
|
|
47
|
-
_ref2$grow = _ref2.grow,
|
|
48
|
-
grow = _ref2$grow === void 0 ? 0 : _ref2$grow,
|
|
49
|
-
_ref2$shrink = _ref2.shrink,
|
|
50
|
-
shrink = _ref2$shrink === void 0 ? 1 : _ref2$shrink,
|
|
51
|
-
_ref2$basis = _ref2.basis,
|
|
52
|
-
basis = _ref2$basis === void 0 ? "auto" : _ref2$basis;
|
|
53
|
-
return "\n flex-direction: ".concat(direction, "; \n flex-wrap: ").concat(wrap, "; \n justify-content: ").concat(justifyContent, "; \n align-items: ").concat(alignItems, ";\n align-content: ").concat(alignContent, ";\n align-self: ").concat(alignSelf, ";\n gap: ").concat((0, _typeof2["default"])(gap) === "object" ? "".concat(gap.rowGap, " ").concat(gap.columnGap) : gap, ";\n order: ").concat(order, ";\n flex-grow: ").concat(grow, ";\n flex-shrink: ").concat(shrink, ";\n flex-basis: ").concat(basis, ";\n ");
|
|
64
|
+
props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded2);
|
|
65
|
+
return "\n flex-direction: ".concat(props.$direction, "; \n flex-wrap: ").concat(props.$wrap, "; \n justify-content: ").concat(justifyContent, "; \n align-items: ").concat(alignItems, ";\n align-content: ").concat(alignContent, ";\n align-self: ").concat(alignSelf, ";\n gap: ").concat((0, _typeof2["default"])(props.$gap) === "object" ? "".concat(props.$gap.rowGap, " ").concat(props.$gap.columnGap) : props.$gap, ";\n order: ").concat(props.$order, ";\n flex-grow: ").concat(props.$grow, ";\n flex-shrink: ").concat(props.$shrink, ";\n flex-basis: ").concat(props.$basis, ";\n ");
|
|
54
66
|
});
|
|
55
67
|
|
|
56
68
|
var _default = DxcFlex;
|
package/flex/types.d.ts
CHANGED
|
@@ -3,13 +3,15 @@ declare type Gap = {
|
|
|
3
3
|
rowGap: string;
|
|
4
4
|
columnGap: string;
|
|
5
5
|
};
|
|
6
|
-
declare type
|
|
7
|
-
direction?: "row" | "row-reverse" | "column" | "column-reverse";
|
|
8
|
-
wrap?: "nowrap" | "wrap" | "wrap-reverse";
|
|
6
|
+
declare type CommonProps = {
|
|
9
7
|
justifyContent?: "flex-start" | "flex-end" | "start" | "end" | "left" | "right" | "center" | "space-between" | "space-around" | "space-evenly";
|
|
10
8
|
alignItems?: "stretch" | "flex-start" | "flex-end" | "start" | "end" | "self-start" | "self-end" | "center" | "baseline";
|
|
11
9
|
alignContent?: "normal" | "flex-start" | "flex-end" | "start" | "end" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch";
|
|
12
10
|
alignSelf?: "auto" | "flex-start" | "flex-end" | "center" | "baseline" | "stretch";
|
|
11
|
+
};
|
|
12
|
+
declare type Props = CommonProps & {
|
|
13
|
+
direction?: "row" | "row-reverse" | "column" | "column-reverse";
|
|
14
|
+
wrap?: "nowrap" | "wrap" | "wrap-reverse";
|
|
13
15
|
gap?: string | Gap;
|
|
14
16
|
order?: number;
|
|
15
17
|
grow?: number;
|
|
@@ -18,4 +20,13 @@ declare type Props = {
|
|
|
18
20
|
as?: keyof HTMLElementTagNameMap;
|
|
19
21
|
children: React.ReactNode;
|
|
20
22
|
};
|
|
23
|
+
export declare type StyledProps = CommonProps & {
|
|
24
|
+
$direction?: "row" | "row-reverse" | "column" | "column-reverse";
|
|
25
|
+
$wrap?: "nowrap" | "wrap" | "wrap-reverse";
|
|
26
|
+
$gap?: string | Gap;
|
|
27
|
+
$order?: number;
|
|
28
|
+
$grow?: number;
|
|
29
|
+
$shrink?: number;
|
|
30
|
+
$basis?: string;
|
|
31
|
+
};
|
|
21
32
|
export default Props;
|
package/footer/types.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ declare type FooterPropsType = {
|
|
|
57
57
|
*/
|
|
58
58
|
margin?: Space | Size;
|
|
59
59
|
/**
|
|
60
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
60
61
|
* Size of the padding to be applied to the custom area of the component.
|
|
61
62
|
* You can pass an object with properties in order to specify different padding sizes.
|
|
62
63
|
*/
|
package/header/types.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ declare type Props = {
|
|
|
32
32
|
*/
|
|
33
33
|
margin?: Space;
|
|
34
34
|
/**
|
|
35
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
35
36
|
* Size of the padding to be applied to the custom area of the component
|
|
36
37
|
* ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
37
38
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in
|
|
@@ -83,7 +83,7 @@ describe("Number input component tests", function () {
|
|
|
83
83
|
})),
|
|
84
84
|
getByRole = _render8.getByRole;
|
|
85
85
|
|
|
86
|
-
var input = getByRole("
|
|
86
|
+
var input = getByRole("spinbutton");
|
|
87
87
|
|
|
88
88
|
_userEvent["default"].type(input, "1");
|
|
89
89
|
|
|
@@ -503,4 +503,41 @@ describe("Number input component tests", function () {
|
|
|
503
503
|
var increment = getAllByRole("button")[1];
|
|
504
504
|
expect(increment.getAttribute("aria-label")).toBe("Increment value");
|
|
505
505
|
});
|
|
506
|
+
test("Number input submits correct values in a form", function () {
|
|
507
|
+
var handlerOnSubmit = jest.fn(function (e) {
|
|
508
|
+
e.preventDefault();
|
|
509
|
+
var formData = new FormData(e.target);
|
|
510
|
+
var formProps = Object.fromEntries(formData);
|
|
511
|
+
expect(formProps).toStrictEqual({
|
|
512
|
+
data: "0"
|
|
513
|
+
});
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
var _render23 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement("form", {
|
|
517
|
+
onSubmit: handlerOnSubmit
|
|
518
|
+
}, /*#__PURE__*/_react["default"].createElement(_NumberInput["default"], {
|
|
519
|
+
label: "Number input label",
|
|
520
|
+
name: "data"
|
|
521
|
+
}), /*#__PURE__*/_react["default"].createElement("button", {
|
|
522
|
+
type: "submit"
|
|
523
|
+
}, "Submit"))),
|
|
524
|
+
getByText = _render23.getByText,
|
|
525
|
+
getAllByRole = _render23.getAllByRole;
|
|
526
|
+
|
|
527
|
+
var less = getAllByRole("button")[0];
|
|
528
|
+
var more = getAllByRole("button")[1];
|
|
529
|
+
var submit = getByText("Submit");
|
|
530
|
+
|
|
531
|
+
_userEvent["default"].click(more);
|
|
532
|
+
|
|
533
|
+
expect(handlerOnSubmit).not.toHaveBeenCalled();
|
|
534
|
+
|
|
535
|
+
_userEvent["default"].click(less);
|
|
536
|
+
|
|
537
|
+
expect(handlerOnSubmit).not.toHaveBeenCalled();
|
|
538
|
+
|
|
539
|
+
_userEvent["default"].click(submit);
|
|
540
|
+
|
|
541
|
+
expect(handlerOnSubmit).toHaveBeenCalled();
|
|
542
|
+
});
|
|
506
543
|
});
|
package/package.json
CHANGED
package/paginator/Paginator.js
CHANGED
|
@@ -153,7 +153,7 @@ var ItemsPageContainer = _styledComponents["default"].span(_templateObject3 || (
|
|
|
153
153
|
|
|
154
154
|
var ItemsLabel = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 0.5rem;\n"])));
|
|
155
155
|
|
|
156
|
-
var GoToLabel = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 0.5rem;\n margin-left:
|
|
156
|
+
var GoToLabel = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 0.5rem;\n margin-left: 0.5rem;\n"])));
|
|
157
157
|
|
|
158
158
|
var TotalItemsContainer = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
159
159
|
return props.theme.totalItemsContainerMarginRight;
|
|
@@ -163,7 +163,7 @@ var TotalItemsContainer = _styledComponents["default"].span(_templateObject6 ||
|
|
|
163
163
|
|
|
164
164
|
var LabelsContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n gap: 0.5rem;\n width: 100%;\n justify-content: flex-end;\n align-items: center;\n"])));
|
|
165
165
|
|
|
166
|
-
var PageToSelectContainer = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n\n label {\n height: 0px;\n }\n label + .MuiInput-formControl {\n margin-top: 0px;\n }\n"])));
|
|
166
|
+
var PageToSelectContainer = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n margin-right: 0.5rem;\n\n label {\n height: 0px;\n }\n label + .MuiInput-formControl {\n margin-top: 0px;\n }\n"])));
|
|
167
167
|
|
|
168
168
|
var TextContainer = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
169
169
|
|
|
@@ -77,7 +77,7 @@ describe("Paginator component tests", function () {
|
|
|
77
77
|
})),
|
|
78
78
|
getByText = _render3.getByText;
|
|
79
79
|
|
|
80
|
-
expect(getByText("Items per page")).toBeTruthy();
|
|
80
|
+
expect(getByText("Items per page:")).toBeTruthy();
|
|
81
81
|
});
|
|
82
82
|
test("Paginator renders with itemsPerPageOptions", function () {
|
|
83
83
|
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
@@ -46,9 +46,9 @@ describe("Password input component tests", function () {
|
|
|
46
46
|
label: "Password input",
|
|
47
47
|
onChange: onChange
|
|
48
48
|
})),
|
|
49
|
-
|
|
49
|
+
getByLabelText = _render4.getByLabelText;
|
|
50
50
|
|
|
51
|
-
var passwordInput =
|
|
51
|
+
var passwordInput = getByLabelText("Password input");
|
|
52
52
|
|
|
53
53
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
54
54
|
|
|
@@ -64,9 +64,9 @@ describe("Password input component tests", function () {
|
|
|
64
64
|
label: "Password input",
|
|
65
65
|
onBlur: onBlur
|
|
66
66
|
})),
|
|
67
|
-
|
|
67
|
+
getByLabelText = _render5.getByLabelText;
|
|
68
68
|
|
|
69
|
-
var passwordInput =
|
|
69
|
+
var passwordInput = getByLabelText("Password input");
|
|
70
70
|
|
|
71
71
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
72
72
|
|
|
@@ -83,9 +83,9 @@ describe("Password input component tests", function () {
|
|
|
83
83
|
clearable: true
|
|
84
84
|
})),
|
|
85
85
|
getAllByRole = _render6.getAllByRole,
|
|
86
|
-
|
|
86
|
+
getByLabelText = _render6.getByLabelText;
|
|
87
87
|
|
|
88
|
-
var passwordInput =
|
|
88
|
+
var passwordInput = getByLabelText("Password input");
|
|
89
89
|
|
|
90
90
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
91
91
|
|
|
@@ -101,9 +101,9 @@ describe("Password input component tests", function () {
|
|
|
101
101
|
label: "Password input"
|
|
102
102
|
})),
|
|
103
103
|
getAllByRole = _render7.getAllByRole,
|
|
104
|
-
|
|
104
|
+
getByLabelText = _render7.getByLabelText;
|
|
105
105
|
|
|
106
|
-
var passwordInput =
|
|
106
|
+
var passwordInput = getByLabelText("Password input");
|
|
107
107
|
|
|
108
108
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
109
109
|
|
|
@@ -117,9 +117,9 @@ describe("Password input component tests", function () {
|
|
|
117
117
|
clearable: true
|
|
118
118
|
})),
|
|
119
119
|
getAllByRole = _render8.getAllByRole,
|
|
120
|
-
|
|
120
|
+
getByLabelText = _render8.getByLabelText;
|
|
121
121
|
|
|
122
|
-
var passwordInput =
|
|
122
|
+
var passwordInput = getByLabelText("Password input");
|
|
123
123
|
|
|
124
124
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
125
125
|
|
|
@@ -164,9 +164,10 @@ describe("Password input component tests", function () {
|
|
|
164
164
|
var _render10 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_PasswordInput["default"], {
|
|
165
165
|
label: "Password input"
|
|
166
166
|
})),
|
|
167
|
-
getByRole = _render10.getByRole
|
|
167
|
+
getByRole = _render10.getByRole,
|
|
168
|
+
getByLabelText = _render10.getByLabelText;
|
|
168
169
|
|
|
169
|
-
var passwordInput =
|
|
170
|
+
var passwordInput = getByLabelText("Password input");
|
|
170
171
|
expect(passwordInput.getAttribute("aria-autocomplete")).toBeNull();
|
|
171
172
|
expect(passwordInput.getAttribute("aria-controls")).toBeNull();
|
|
172
173
|
expect(passwordInput.getAttribute("aria-expanded")).toBeNull();
|
package/quick-nav/QuickNav.js
CHANGED
|
@@ -48,13 +48,10 @@ var DxcQuickNav = function DxcQuickNav(_ref) {
|
|
|
48
48
|
}, /*#__PURE__*/_react["default"].createElement(_Heading["default"], {
|
|
49
49
|
level: 4,
|
|
50
50
|
text: title || translatedLabels.quickNav.contentTitle
|
|
51
|
-
}), /*#__PURE__*/_react["default"].createElement(ListColumn, null,
|
|
52
|
-
direction: "column",
|
|
53
|
-
gap: "0.5rem"
|
|
54
|
-
}, links.map(function (link) {
|
|
51
|
+
}), /*#__PURE__*/_react["default"].createElement(ListColumn, null, links.map(function (link) {
|
|
55
52
|
var _link$links;
|
|
56
53
|
|
|
57
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
54
|
+
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
58
55
|
key: link.label
|
|
59
56
|
}, /*#__PURE__*/_react["default"].createElement(_Inset["default"], {
|
|
60
57
|
space: "0.25rem"
|
|
@@ -62,18 +59,20 @@ var DxcQuickNav = function DxcQuickNav(_ref) {
|
|
|
62
59
|
href: "#".concat((0, _slugify["default"])(link === null || link === void 0 ? void 0 : link.label, {
|
|
63
60
|
lower: true
|
|
64
61
|
}))
|
|
65
|
-
}, link === null || link === void 0 ? void 0 : link.label), (_link$links = link.links) === null || _link$links === void 0 ? void 0 : _link$links.map(function (sublink) {
|
|
66
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
62
|
+
}, link === null || link === void 0 ? void 0 : link.label), /*#__PURE__*/_react["default"].createElement(ListSecondColumn, null, (_link$links = link.links) === null || _link$links === void 0 ? void 0 : _link$links.map(function (sublink) {
|
|
63
|
+
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
67
64
|
key: sublink.label
|
|
68
65
|
}, /*#__PURE__*/_react["default"].createElement(_Inset["default"], {
|
|
69
66
|
horizontal: "0.5rem"
|
|
70
67
|
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], null, /*#__PURE__*/_react["default"].createElement(Link, {
|
|
71
|
-
href: "#".concat((0, _slugify["default"])(
|
|
68
|
+
href: "#".concat((0, _slugify["default"])(link === null || link === void 0 ? void 0 : link.label, {
|
|
69
|
+
lower: true
|
|
70
|
+
}), "-").concat((0, _slugify["default"])(sublink === null || sublink === void 0 ? void 0 : sublink.label, {
|
|
72
71
|
lower: true
|
|
73
72
|
}))
|
|
74
73
|
}, sublink === null || sublink === void 0 ? void 0 : sublink.label))));
|
|
75
|
-
}))));
|
|
76
|
-
})))))
|
|
74
|
+
})))));
|
|
75
|
+
})))));
|
|
77
76
|
};
|
|
78
77
|
|
|
79
78
|
var QuickNavContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n border-left: 2px solid ", ";\n"])), function (props) {
|
|
@@ -88,9 +87,9 @@ var QuickNavContainer = _styledComponents["default"].div(_templateObject || (_te
|
|
|
88
87
|
return props.theme.dividerBorderColor;
|
|
89
88
|
});
|
|
90
89
|
|
|
91
|
-
var ListColumn = _styledComponents["default"].ul(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
90
|
+
var ListColumn = _styledComponents["default"].ul(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin: 0;\n padding: 0;\n list-style-type: none;\n"])));
|
|
92
91
|
|
|
93
|
-
var
|
|
92
|
+
var ListSecondColumn = _styledComponents["default"].ul(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n list-style-type: none;\n"])));
|
|
94
93
|
|
|
95
94
|
var Link = _styledComponents["default"].a(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: none;\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n display: block;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n width: fit-content;\n max-width: 100%;\n\n &:hover {\n color: ", ";\n }\n &:focus {\n outline-color: ", ";\n outline-style: ", ";\n outline-width: ", ";\n border-radius: ", ";\n }\n"])), function (props) {
|
|
96
95
|
return props.theme.fontSize;
|