carbon-react 128.0.0 → 128.1.2
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/README.md +1 -1
- package/esm/__spec_helper__/test-utils.d.ts +5 -9
- package/esm/__spec_helper__/test-utils.js +2 -0
- package/esm/components/alert/alert.component.d.ts +1 -1
- package/esm/components/alert/alert.component.js +3 -1
- package/esm/components/button-minor/button-minor.component.d.ts +1 -1
- package/esm/components/button-minor/button-minor.component.js +5 -1
- package/esm/components/checkbox/{checkbox-group.component.d.ts → checkbox-group/checkbox-group.component.d.ts} +1 -1
- package/esm/components/checkbox/{checkbox-group.component.js → checkbox-group/checkbox-group.component.js} +9 -9
- package/esm/components/checkbox/{checkbox-group.style.js → checkbox-group/checkbox-group.style.js} +5 -5
- package/esm/components/checkbox/checkbox.component.js +1 -1
- package/esm/components/checkbox/index.d.ts +2 -2
- package/esm/components/checkbox/index.js +1 -1
- package/esm/components/definition-list/{dd.component.js → dd/dd.component.js} +2 -2
- package/esm/components/definition-list/dl.component.js +13 -11
- package/esm/components/definition-list/{dt.component.js → dt/dt.component.js} +2 -2
- package/esm/components/definition-list/index.d.ts +4 -4
- package/esm/components/definition-list/index.js +2 -2
- package/esm/components/dialog/dialog.component.d.ts +3 -1
- package/esm/components/dialog/dialog.component.js +11 -3
- package/esm/components/dialog-full-screen/dialog-full-screen.component.d.ts +4 -1
- package/esm/components/dialog-full-screen/dialog-full-screen.component.js +7 -3
- package/esm/components/draggable/{internal → __internal__}/drop-target.component.js +1 -1
- package/esm/components/draggable/draggable-container.component.js +2 -2
- package/esm/components/draggable/{draggable-item.component.js → draggable-item/draggable-item.component.js} +1 -1
- package/{lib/components/draggable → esm/components/draggable/draggable-item}/draggable-item.style.d.ts +1 -1
- package/esm/components/draggable/{draggable-item.style.js → draggable-item/draggable-item.style.js} +2 -2
- package/esm/components/draggable/index.d.ts +2 -2
- package/esm/components/draggable/index.js +1 -1
- package/esm/components/duelling-picklist/picklist-placeholder/picklist-placeholder.component.js +5 -3
- package/esm/components/flat-table/flat-table-header/flat-table-header.component.d.ts +0 -3
- package/esm/components/flat-table/flat-table-header/flat-table-header.component.js +1 -4
- package/esm/components/flat-table/sort/sort.component.d.ts +1 -1
- package/esm/components/flat-table/sort/sort.component.js +1 -1
- package/esm/components/hr/hr.component.d.ts +0 -1
- package/esm/components/link/link.component.js +1 -16
- package/esm/components/modal/__internal__/modal-manager.js +2 -2
- package/esm/components/number/number.component.js +10 -1
- package/esm/components/pager/__internal__/pager-navigation.component.d.ts +1 -1
- package/esm/components/pager/pager.component.d.ts +2 -2
- package/esm/components/popover-container/popover-container.component.d.ts +6 -2
- package/esm/components/popover-container/popover-container.component.js +11 -5
- package/esm/components/portal/portal.d.ts +1 -1
- package/esm/components/portal/portal.js +1 -1
- package/esm/components/preview/preview.component.d.ts +1 -0
- package/esm/components/radio-button/index.d.ts +3 -1
- package/esm/components/radio-button/index.js +1 -1
- package/esm/components/radio-button/{radio-button-group.component.d.ts → radio-button-group/radio-button-group.component.d.ts} +1 -1
- package/esm/components/radio-button/{radio-button-group.component.js → radio-button-group/radio-button-group.component.js} +12 -12
- package/esm/components/textbox/textbox.component.d.ts +4 -0
- package/esm/components/textbox/textbox.component.js +8 -4
- package/esm/components/tile/flex-tile-divider/flex-tile-divider.component.d.ts +0 -1
- package/esm/components/tile-select/index.d.ts +2 -2
- package/esm/components/tile-select/index.js +1 -1
- package/{lib/components/tile-select → esm/components/tile-select/tile-select-group}/tile-select-group.component.d.ts +1 -1
- package/esm/components/tile-select/{tile-select-group.component.js → tile-select-group/tile-select-group.component.js} +4 -4
- package/esm/components/toast/toast.component.d.ts +3 -0
- package/esm/components/toast/toast.component.js +10 -3
- package/esm/components/vertical-divider/vertical-divider.component.d.ts +0 -1
- package/esm/components/vertical-menu/index.d.ts +6 -6
- package/esm/components/vertical-menu/index.js +3 -3
- package/{lib/components/vertical-menu → esm/components/vertical-menu/vertical-menu-full-screen}/vertical-menu-full-screen.component.d.ts +1 -1
- package/esm/components/vertical-menu/{vertical-menu-full-screen.component.js → vertical-menu-full-screen/vertical-menu-full-screen.component.js} +10 -10
- package/{lib/components/vertical-menu → esm/components/vertical-menu/vertical-menu-item}/vertical-menu-item.component.d.ts +2 -2
- package/esm/components/vertical-menu/{vertical-menu-item.component.js → vertical-menu-item/vertical-menu-item.component.js} +4 -4
- package/esm/components/vertical-menu/{vertical-menu-trigger.component.d.ts → vertical-menu-trigger/vertical-menu-trigger.component.d.ts} +1 -1
- package/esm/components/vertical-menu/{vertical-menu-trigger.component.js → vertical-menu-trigger/vertical-menu-trigger.component.js} +3 -3
- package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +0 -1
- package/esm/hooks/__internal__/useScrollBlock/scroll-block-manager.js +2 -2
- package/esm/locales/__internal__/es-es.d.ts +3 -0
- package/esm/locales/__internal__/es-es.js +193 -0
- package/lib/__spec_helper__/test-utils.d.ts +5 -9
- package/lib/__spec_helper__/test-utils.js +2 -0
- package/lib/components/alert/alert.component.d.ts +1 -1
- package/lib/components/alert/alert.component.js +3 -1
- package/lib/components/button-minor/button-minor.component.d.ts +1 -1
- package/lib/components/button-minor/button-minor.component.js +5 -1
- package/lib/components/checkbox/{checkbox-group.component.d.ts → checkbox-group/checkbox-group.component.d.ts} +1 -1
- package/lib/components/checkbox/{checkbox-group.component.js → checkbox-group/checkbox-group.component.js} +9 -9
- package/lib/components/checkbox/{checkbox-group.style.js → checkbox-group/checkbox-group.style.js} +5 -5
- package/lib/components/checkbox/checkbox.component.js +1 -1
- package/lib/components/checkbox/index.d.ts +2 -2
- package/lib/components/checkbox/index.js +1 -1
- package/lib/components/definition-list/{dd.component.js → dd/dd.component.js} +2 -2
- package/lib/components/definition-list/dl.component.js +13 -11
- package/lib/components/definition-list/{dt.component.js → dt/dt.component.js} +2 -2
- package/lib/components/definition-list/index.d.ts +4 -4
- package/lib/components/definition-list/index.js +2 -2
- package/lib/components/dialog/dialog.component.d.ts +3 -1
- package/lib/components/dialog/dialog.component.js +11 -3
- package/lib/components/dialog-full-screen/dialog-full-screen.component.d.ts +4 -1
- package/lib/components/dialog-full-screen/dialog-full-screen.component.js +7 -3
- package/lib/components/draggable/{internal → __internal__}/drop-target.component.js +1 -1
- package/lib/components/draggable/draggable-container.component.js +2 -2
- package/lib/components/draggable/{draggable-item.component.js → draggable-item/draggable-item.component.js} +1 -1
- package/{esm/components/draggable → lib/components/draggable/draggable-item}/draggable-item.style.d.ts +1 -1
- package/lib/components/draggable/{draggable-item.style.js → draggable-item/draggable-item.style.js} +2 -2
- package/lib/components/draggable/index.d.ts +2 -2
- package/lib/components/draggable/index.js +1 -1
- package/lib/components/duelling-picklist/picklist-placeholder/picklist-placeholder.component.js +5 -3
- package/lib/components/flat-table/flat-table-header/flat-table-header.component.d.ts +0 -3
- package/lib/components/flat-table/flat-table-header/flat-table-header.component.js +1 -4
- package/lib/components/flat-table/sort/sort.component.d.ts +1 -1
- package/lib/components/flat-table/sort/sort.component.js +2 -1
- package/lib/components/hr/hr.component.d.ts +0 -1
- package/lib/components/link/link.component.js +1 -16
- package/lib/components/modal/__internal__/modal-manager.js +2 -2
- package/lib/components/number/number.component.js +10 -1
- package/lib/components/pager/__internal__/pager-navigation.component.d.ts +1 -1
- package/lib/components/pager/pager.component.d.ts +2 -2
- package/lib/components/popover-container/popover-container.component.d.ts +6 -2
- package/lib/components/popover-container/popover-container.component.js +11 -5
- package/lib/components/portal/portal.d.ts +1 -1
- package/lib/components/portal/portal.js +2 -1
- package/lib/components/preview/preview.component.d.ts +1 -0
- package/lib/components/radio-button/index.d.ts +3 -1
- package/lib/components/radio-button/index.js +1 -1
- package/lib/components/radio-button/{radio-button-group.component.d.ts → radio-button-group/radio-button-group.component.d.ts} +1 -1
- package/lib/components/radio-button/{radio-button-group.component.js → radio-button-group/radio-button-group.component.js} +12 -12
- package/lib/components/textbox/textbox.component.d.ts +4 -0
- package/lib/components/textbox/textbox.component.js +9 -5
- package/lib/components/tile/flex-tile-divider/flex-tile-divider.component.d.ts +0 -1
- package/lib/components/tile-select/index.d.ts +2 -2
- package/lib/components/tile-select/index.js +1 -1
- package/{esm/components/tile-select → lib/components/tile-select/tile-select-group}/tile-select-group.component.d.ts +1 -1
- package/lib/components/tile-select/{tile-select-group.component.js → tile-select-group/tile-select-group.component.js} +4 -4
- package/lib/components/toast/toast.component.d.ts +3 -0
- package/lib/components/toast/toast.component.js +10 -3
- package/lib/components/vertical-divider/vertical-divider.component.d.ts +0 -1
- package/lib/components/vertical-menu/index.d.ts +6 -6
- package/lib/components/vertical-menu/index.js +3 -3
- package/{esm/components/vertical-menu → lib/components/vertical-menu/vertical-menu-full-screen}/vertical-menu-full-screen.component.d.ts +1 -1
- package/lib/components/vertical-menu/{vertical-menu-full-screen.component.js → vertical-menu-full-screen/vertical-menu-full-screen.component.js} +10 -10
- package/{esm/components/vertical-menu → lib/components/vertical-menu/vertical-menu-item}/vertical-menu-item.component.d.ts +2 -2
- package/lib/components/vertical-menu/{vertical-menu-item.component.js → vertical-menu-item/vertical-menu-item.component.js} +4 -4
- package/lib/components/vertical-menu/{vertical-menu-trigger.component.d.ts → vertical-menu-trigger/vertical-menu-trigger.component.d.ts} +1 -1
- package/lib/components/vertical-menu/{vertical-menu-trigger.component.js → vertical-menu-trigger/vertical-menu-trigger.component.js} +3 -3
- package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +0 -1
- package/lib/hooks/__internal__/useScrollBlock/scroll-block-manager.js +2 -2
- package/lib/locales/__internal__/es-es.d.ts +3 -0
- package/lib/locales/__internal__/es-es.js +199 -0
- package/package.json +30 -26
- package/esm/locales/__internal__/pl-pl.d.ts +0 -5
- package/esm/locales/__internal__/pl-pl.js +0 -231
- package/lib/locales/__internal__/pl-pl.d.ts +0 -5
- package/lib/locales/__internal__/pl-pl.js +0 -237
- /package/esm/components/checkbox/{checkbox-group.style.d.ts → checkbox-group/checkbox-group.style.d.ts} +0 -0
- /package/esm/components/definition-list/{dd.component.d.ts → dd/dd.component.d.ts} +0 -0
- /package/esm/components/definition-list/{dt.component.d.ts → dt/dt.component.d.ts} +0 -0
- /package/esm/components/draggable/{internal → __internal__}/drop-target.component.d.ts +0 -0
- /package/esm/components/draggable/{draggable-item.component.d.ts → draggable-item/draggable-item.component.d.ts} +0 -0
- /package/esm/components/radio-button/{radio-button-group.style.d.ts → radio-button-group/radio-button-group.style.d.ts} +0 -0
- /package/esm/components/radio-button/{radio-button-group.style.js → radio-button-group/radio-button-group.style.js} +0 -0
- /package/esm/components/vertical-menu/{vertical-menu-full-screen.context.d.ts → vertical-menu-full-screen/vertical-menu-full-screen.context.d.ts} +0 -0
- /package/esm/components/vertical-menu/{vertical-menu-full-screen.context.js → vertical-menu-full-screen/vertical-menu-full-screen.context.js} +0 -0
- /package/lib/components/checkbox/{checkbox-group.style.d.ts → checkbox-group/checkbox-group.style.d.ts} +0 -0
- /package/lib/components/definition-list/{dd.component.d.ts → dd/dd.component.d.ts} +0 -0
- /package/lib/components/definition-list/{dt.component.d.ts → dt/dt.component.d.ts} +0 -0
- /package/lib/components/draggable/{internal → __internal__}/drop-target.component.d.ts +0 -0
- /package/lib/components/draggable/{draggable-item.component.d.ts → draggable-item/draggable-item.component.d.ts} +0 -0
- /package/lib/components/radio-button/{radio-button-group.style.d.ts → radio-button-group/radio-button-group.style.d.ts} +0 -0
- /package/lib/components/radio-button/{radio-button-group.style.js → radio-button-group/radio-button-group.style.js} +0 -0
- /package/lib/components/vertical-menu/{vertical-menu-full-screen.context.d.ts → vertical-menu-full-screen/vertical-menu-full-screen.context.d.ts} +0 -0
- /package/lib/components/vertical-menu/{vertical-menu-full-screen.context.js → vertical-menu-full-screen/vertical-menu-full-screen.context.js} +0 -0
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Carbon is a [React](https://react.dev/) component library developed by Sage.
|
|
|
4
4
|
|
|
5
5
|
## Getting started
|
|
6
6
|
|
|
7
|
-
Our [getting started guide](https://carbon.sage.com/?path=/
|
|
7
|
+
Our [getting started guide](https://carbon.sage.com/?path=/docs/getting-started-installation--docs) provides instructions on how to install and use the Carbon library.
|
|
8
8
|
|
|
9
9
|
## Examples
|
|
10
10
|
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { ReactWrapper, ShallowWrapper } from "enzyme";
|
|
1
|
+
import { ReactWrapper } from "enzyme";
|
|
3
2
|
import { LayoutProps, FlexboxProps, BackgroundProps, PositionProps, GridProps } from "styled-system";
|
|
4
|
-
import { ReactTestRendererJSON } from "react-test-renderer";
|
|
5
3
|
import { mockMatchMedia } from "./mock-match-media";
|
|
6
4
|
declare const toCSSCase: (str: string) => string;
|
|
7
|
-
declare const assertStyleMatch:
|
|
8
|
-
[key: string]: string | number | undefined;
|
|
9
|
-
}, component: HTMLElement | ReactWrapper<Props, {}, import("react").Component<{}, {}, any>> | ShallowWrapper<Props, {}, import("react").Component<{}, {}, any>> | ReactTestRendererJSON | ReactTestRendererJSON[] | null, opts?: jest.Options) => void;
|
|
5
|
+
declare const assertStyleMatch: any;
|
|
10
6
|
declare const makeArrayKeys: (n: number) => number[];
|
|
11
7
|
declare const keyboard: Record<string, () => void>;
|
|
12
8
|
declare const simulate: {
|
|
@@ -14,10 +10,10 @@ declare const simulate: {
|
|
|
14
10
|
shiftKey: boolean;
|
|
15
11
|
} | undefined) => void>;
|
|
16
12
|
};
|
|
17
|
-
declare const listFrom: (wrapper: ReactWrapper) => ReactWrapper
|
|
18
|
-
declare const childrenFrom: (node: ReactWrapper) => ReactWrapper
|
|
13
|
+
declare const listFrom: (wrapper: ReactWrapper) => ReactWrapper;
|
|
14
|
+
declare const childrenFrom: (node: ReactWrapper) => ReactWrapper;
|
|
19
15
|
declare const hoverList: (wrapper: ReactWrapper) => (item: number) => void;
|
|
20
|
-
declare const click:
|
|
16
|
+
declare const click: unknown;
|
|
21
17
|
declare const selectedItemOf: (wrapper: ReactWrapper) => number;
|
|
22
18
|
declare const assertKeyboardTraversal: ({ num, nonSelectables, }: {
|
|
23
19
|
num: number;
|
|
@@ -11,6 +11,8 @@ const humpToDash = (acc, char) => `${acc}${isUpper(char) ? `-${char.toLowerCase(
|
|
|
11
11
|
const toCSSCase = str => {
|
|
12
12
|
return str.split("").reduce(humpToDash, "");
|
|
13
13
|
};
|
|
14
|
+
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
16
|
const assertStyleMatch = (styleSpec, component, opts) => {
|
|
15
17
|
Object.entries(styleSpec).forEach(([attr, value]) => {
|
|
16
18
|
expect(component).toHaveStyleRule(toCSSCase(attr), value, opts);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DialogProps } from "../dialog";
|
|
3
|
-
export declare const Alert: ({ children, size, topModalOverride, ...rest }: DialogProps) => React.JSX.Element;
|
|
3
|
+
export declare const Alert: ({ children, size, topModalOverride, closeButtonDataProps, ...rest }: DialogProps) => React.JSX.Element;
|
|
4
4
|
export default Alert;
|
|
@@ -6,11 +6,13 @@ export const Alert = ({
|
|
|
6
6
|
children,
|
|
7
7
|
size = "extra-small",
|
|
8
8
|
topModalOverride,
|
|
9
|
+
closeButtonDataProps,
|
|
9
10
|
...rest
|
|
10
11
|
}) => /*#__PURE__*/React.createElement(Dialog, _extends({
|
|
11
12
|
"data-component": "alert",
|
|
12
13
|
role: "alertdialog",
|
|
13
14
|
size: size,
|
|
14
|
-
topModalOverride: topModalOverride
|
|
15
|
+
topModalOverride: topModalOverride,
|
|
16
|
+
closeButtonDataProps: closeButtonDataProps
|
|
15
17
|
}, rest), children);
|
|
16
18
|
export default Alert;
|
|
@@ -5,7 +5,7 @@ export interface ButtonMinorProps extends ButtonProps {
|
|
|
5
5
|
isInPassword?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare const ButtonMinor: {
|
|
8
|
-
({ buttonType: buttonTypeProp, size: sizeProp, iconPosition: iconPositionProp, fullWidth: fullWidthProp, ...rest }: ButtonMinorProps): React.JSX.Element;
|
|
8
|
+
({ buttonType: buttonTypeProp, disabled, destructive, size: sizeProp, iconPosition: iconPositionProp, fullWidth: fullWidthProp, ...rest }: ButtonMinorProps): React.JSX.Element;
|
|
9
9
|
displayName: string;
|
|
10
10
|
};
|
|
11
11
|
export default ButtonMinor;
|
|
@@ -5,6 +5,8 @@ import StyledButtonMinor from "./button-minor.style";
|
|
|
5
5
|
import { ButtonBarContext } from "../button-bar/button-bar.component";
|
|
6
6
|
export const ButtonMinor = ({
|
|
7
7
|
buttonType: buttonTypeProp = "secondary",
|
|
8
|
+
disabled = false,
|
|
9
|
+
destructive = false,
|
|
8
10
|
size: sizeProp = "medium",
|
|
9
11
|
iconPosition: iconPositionProp = "before",
|
|
10
12
|
fullWidth: fullWidthProp = false,
|
|
@@ -25,7 +27,9 @@ export const ButtonMinor = ({
|
|
|
25
27
|
size: size,
|
|
26
28
|
fullWidth: fullWidth,
|
|
27
29
|
iconPosition: iconPosition,
|
|
28
|
-
buttonType: buttonType
|
|
30
|
+
buttonType: buttonType,
|
|
31
|
+
disabled: disabled,
|
|
32
|
+
destructive: destructive
|
|
29
33
|
}, rest));
|
|
30
34
|
};
|
|
31
35
|
ButtonMinor.displayName = "ButtonMinor";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
|
-
import { ValidationProps } from "
|
|
3
|
+
import { ValidationProps } from "../../../__internal__/validations";
|
|
4
4
|
export interface CheckboxGroupProps extends ValidationProps, MarginProps {
|
|
5
5
|
/** The content for the CheckboxGroup Legend */
|
|
6
6
|
legend?: string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
2
2
|
import React, { useContext } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import tagComponent from "
|
|
4
|
+
import tagComponent from "../../../__internal__/utils/helpers/tags/tags";
|
|
5
5
|
import StyledCheckboxGroup, { StyledHintText } from "./checkbox-group.style";
|
|
6
|
-
import Fieldset from "
|
|
7
|
-
import { filterStyledSystemMarginProps } from "
|
|
8
|
-
import { TooltipProvider } from "
|
|
9
|
-
import FormSpacingProvider from "
|
|
10
|
-
import { NewValidationContext } from "
|
|
11
|
-
import ValidationMessage from "
|
|
12
|
-
import Box from "../../
|
|
13
|
-
import { ErrorBorder } from "../../
|
|
6
|
+
import Fieldset from "../../../__internal__/fieldset";
|
|
7
|
+
import { filterStyledSystemMarginProps } from "../../../style/utils";
|
|
8
|
+
import { TooltipProvider } from "../../../__internal__/tooltip-provider";
|
|
9
|
+
import FormSpacingProvider from "../../../__internal__/form-spacing-provider";
|
|
10
|
+
import { NewValidationContext } from "../../carbon-provider/carbon-provider.component";
|
|
11
|
+
import ValidationMessage from "../../../__internal__/validation-message/validation-message.component";
|
|
12
|
+
import Box from "../../box";
|
|
13
|
+
import { ErrorBorder } from "../../textbox/textbox.style";
|
|
14
14
|
export const CheckboxGroupContext = /*#__PURE__*/React.createContext({});
|
|
15
15
|
export const CheckboxGroup = props => {
|
|
16
16
|
const {
|
package/esm/components/checkbox/{checkbox-group.style.js → checkbox-group/checkbox-group.style.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import StyledFormField from "
|
|
3
|
-
import StyledIcon from "
|
|
4
|
-
import CheckboxStyle from "
|
|
5
|
-
import { StyledLabelContainer } from "
|
|
6
|
-
import StyledValidationIcon from "
|
|
2
|
+
import StyledFormField from "../../../__internal__/form-field/form-field.style";
|
|
3
|
+
import StyledIcon from "../../icon/icon.style";
|
|
4
|
+
import CheckboxStyle from "../checkbox.style";
|
|
5
|
+
import { StyledLabelContainer } from "../../../__internal__/label/label.style";
|
|
6
|
+
import StyledValidationIcon from "../../../__internal__/validations/validation-icon.style";
|
|
7
7
|
export const StyledHintText = styled.div`
|
|
8
8
|
margin-top: -4px;
|
|
9
9
|
margin-bottom: 8px;
|
|
@@ -6,7 +6,7 @@ import CheckableInput from "../../__internal__/checkable-input/checkable-input.c
|
|
|
6
6
|
import CheckboxSvg from "./checkbox-svg.component";
|
|
7
7
|
import useIsAboveBreakpoint from "../../hooks/__internal__/useIsAboveBreakpoint";
|
|
8
8
|
import { TooltipProvider } from "../../__internal__/tooltip-provider";
|
|
9
|
-
import { CheckboxGroupContext } from "./checkbox-group.component";
|
|
9
|
+
import { CheckboxGroupContext } from "./checkbox-group/checkbox-group.component";
|
|
10
10
|
import Logger from "../../__internal__/utils/logger";
|
|
11
11
|
import useFormSpacing from "../../hooks/__internal__/useFormSpacing";
|
|
12
12
|
import { NewValidationContext } from "../carbon-provider/carbon-provider.component";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as CheckboxGroup } from "./checkbox-group.component";
|
|
2
|
-
export type { CheckboxGroupProps } from "./checkbox-group.component";
|
|
1
|
+
export { default as CheckboxGroup } from "./checkbox-group/checkbox-group.component";
|
|
2
|
+
export type { CheckboxGroupProps } from "./checkbox-group/checkbox-group.component";
|
|
3
3
|
export { default as Checkbox } from "./checkbox.component";
|
|
4
4
|
export type { CheckboxProps } from "./checkbox.component";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as CheckboxGroup } from "./checkbox-group.component";
|
|
1
|
+
export { default as CheckboxGroup } from "./checkbox-group/checkbox-group.component";
|
|
2
2
|
export { default as Checkbox } from "./checkbox.component";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
2
2
|
import React, { useContext } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import { StyledDd } from "
|
|
5
|
-
import DlContext from "
|
|
4
|
+
import { StyledDd } from "../definition-list.style";
|
|
5
|
+
import DlContext from "../__internal__/dl.context";
|
|
6
6
|
const Dd = ({
|
|
7
7
|
children,
|
|
8
8
|
...rest
|
|
@@ -10,16 +10,18 @@ const Dl = ({
|
|
|
10
10
|
ddTextAlign = "left",
|
|
11
11
|
asSingleColumn = false,
|
|
12
12
|
...rest
|
|
13
|
-
}) =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
13
|
+
}) => {
|
|
14
|
+
return /*#__PURE__*/React.createElement(StyledDl, _extends({
|
|
15
|
+
w: w,
|
|
16
|
+
"data-component": "dl",
|
|
17
|
+
asSingleColumn: asSingleColumn
|
|
18
|
+
}, rest), /*#__PURE__*/React.createElement(DlContext.Provider, {
|
|
19
|
+
value: {
|
|
20
|
+
asSingleColumn,
|
|
21
|
+
dtTextAlign,
|
|
22
|
+
ddTextAlign
|
|
23
|
+
}
|
|
24
|
+
}, children));
|
|
25
|
+
};
|
|
24
26
|
Dl.displayName = "Dl";
|
|
25
27
|
export default Dl;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
2
2
|
import React, { useContext } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import { StyledDt } from "
|
|
5
|
-
import DlContext from "
|
|
4
|
+
import { StyledDt } from "../definition-list.style";
|
|
5
|
+
import DlContext from "../__internal__/dl.context";
|
|
6
6
|
const Dt = ({
|
|
7
7
|
children,
|
|
8
8
|
...rest
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { DlProps } from "./dl.component";
|
|
2
2
|
export { default as Dl } from "./dl.component";
|
|
3
|
-
export type { DtProps } from "./dt.component";
|
|
4
|
-
export { default as Dt } from "./dt.component";
|
|
5
|
-
export type { DdProps } from "./dd.component";
|
|
6
|
-
export { default as Dd } from "./dd.component";
|
|
3
|
+
export type { DtProps } from "./dt/dt.component";
|
|
4
|
+
export { default as Dt } from "./dt/dt.component";
|
|
5
|
+
export type { DdProps } from "./dd/dd.component";
|
|
6
|
+
export { default as Dd } from "./dd/dd.component";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as Dl } from "./dl.component";
|
|
2
|
-
export { default as Dt } from "./dt.component";
|
|
3
|
-
export { default as Dd } from "./dd.component";
|
|
2
|
+
export { default as Dt } from "./dt/dt.component";
|
|
3
|
+
export { default as Dd } from "./dd/dd.component";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ModalProps } from "../modal";
|
|
3
|
-
import { TagProps } from "../../__internal__/utils/helpers/tags
|
|
3
|
+
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
4
4
|
import { DialogSizes } from "./dialog.config";
|
|
5
5
|
import { CustomRefObject } from "../../__internal__/focus-trap";
|
|
6
6
|
declare const PADDING_VALUES: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8];
|
|
@@ -46,6 +46,8 @@ export interface DialogProps extends ModalProps, TagProps {
|
|
|
46
46
|
onCancel?: (ev: React.KeyboardEvent<HTMLElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
47
47
|
/** Determines if the close icon is shown */
|
|
48
48
|
showCloseIcon?: boolean;
|
|
49
|
+
/** Data tag prop bag for close Button */
|
|
50
|
+
closeButtonDataProps?: Pick<TagProps, "data-role" | "data-element">;
|
|
49
51
|
/** Size of dialog, default size is 750px */
|
|
50
52
|
size?: DialogSizes;
|
|
51
53
|
/** Subtitle displayed at top of dialog */
|
|
@@ -4,6 +4,7 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
import createGuid from "../../__internal__/utils/helpers/guid";
|
|
5
5
|
import Modal from "../modal";
|
|
6
6
|
import Heading from "../heading";
|
|
7
|
+
import tagComponent from "../../__internal__/utils/helpers/tags";
|
|
7
8
|
import useResizeObserver from "../../hooks/__internal__/useResizeObserver";
|
|
8
9
|
import { StyledDialog, StyledDialogTitle, StyledDialogContent, StyledDialogInnerContent } from "./dialog.style";
|
|
9
10
|
import { TOP_MARGIN } from "./dialog.config";
|
|
@@ -36,6 +37,7 @@ const Dialog = /*#__PURE__*/forwardRef(({
|
|
|
36
37
|
greyBackground = false,
|
|
37
38
|
focusableContainers,
|
|
38
39
|
topModalOverride,
|
|
40
|
+
closeButtonDataProps,
|
|
39
41
|
...rest
|
|
40
42
|
}, ref) => {
|
|
41
43
|
const locale = useLocale();
|
|
@@ -110,12 +112,14 @@ const Dialog = /*#__PURE__*/forwardRef(({
|
|
|
110
112
|
}, [centerDialog, open, height]);
|
|
111
113
|
const closeIcon = () => {
|
|
112
114
|
if (!showCloseIcon || !onCancel) return null;
|
|
113
|
-
return /*#__PURE__*/React.createElement(IconButton, {
|
|
114
|
-
"data-element": "close",
|
|
115
|
+
return /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
115
116
|
"aria-label": locale.dialog.ariaLabels.close(),
|
|
116
117
|
onClick: onCancel,
|
|
117
118
|
disabled: disableClose
|
|
118
|
-
},
|
|
119
|
+
}, tagComponent("close", {
|
|
120
|
+
"data-element": "close",
|
|
121
|
+
...closeButtonDataProps
|
|
122
|
+
})), /*#__PURE__*/React.createElement(Icon, {
|
|
119
123
|
type: "close"
|
|
120
124
|
}));
|
|
121
125
|
};
|
|
@@ -193,6 +197,10 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
193
197
|
"bespokeFocusTrap": PropTypes.func,
|
|
194
198
|
"children": PropTypes.node,
|
|
195
199
|
"className": PropTypes.string,
|
|
200
|
+
"closeButtonDataProps": PropTypes.shape({
|
|
201
|
+
"data-element": PropTypes.string,
|
|
202
|
+
"data-role": PropTypes.string
|
|
203
|
+
}),
|
|
196
204
|
"contentPadding": PropTypes.shape({
|
|
197
205
|
"p": PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
|
|
198
206
|
"px": PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ModalProps } from "../modal";
|
|
3
3
|
import { CustomRefObject } from "../../__internal__/focus-trap";
|
|
4
|
+
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
4
5
|
export interface DialogFullScreenProps extends ModalProps {
|
|
5
6
|
/** Prop to specify the aria-describedby property of the DialogFullscreen component */
|
|
6
7
|
"aria-describedby"?: string;
|
|
@@ -39,6 +40,8 @@ export interface DialogFullScreenProps extends ModalProps {
|
|
|
39
40
|
pagesStyling?: boolean;
|
|
40
41
|
/** Determines if the close icon is shown */
|
|
41
42
|
showCloseIcon?: boolean;
|
|
43
|
+
/** Data tag prop bag for close Button */
|
|
44
|
+
closeButtonDataProps?: Pick<TagProps, "data-role" | "data-element">;
|
|
42
45
|
/** Subtitle displayed at top of dialog */
|
|
43
46
|
subtitle?: string;
|
|
44
47
|
/** Title displayed at top of dialog */
|
|
@@ -52,5 +55,5 @@ export interface DialogFullScreenProps extends ModalProps {
|
|
|
52
55
|
/** A custom close event handler */
|
|
53
56
|
onCancel?: (ev: React.KeyboardEvent<HTMLElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
54
57
|
}
|
|
55
|
-
export declare const DialogFullScreen: ({ "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, disableAutoFocus, focusFirstElement, bespokeFocusTrap, open, children, title, subtitle, pagesStyling, headerChildren, showCloseIcon, disableContentPadding, disableEscKey, onCancel, contentRef, help, role, focusableContainers, focusableSelectors, topModalOverride, ...rest }: DialogFullScreenProps) => React.JSX.Element;
|
|
58
|
+
export declare const DialogFullScreen: ({ "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, disableAutoFocus, focusFirstElement, bespokeFocusTrap, open, children, title, subtitle, pagesStyling, headerChildren, showCloseIcon, disableContentPadding, disableEscKey, onCancel, contentRef, help, role, focusableContainers, focusableSelectors, topModalOverride, closeButtonDataProps, ...rest }: DialogFullScreenProps) => React.JSX.Element;
|
|
56
59
|
export default DialogFullScreen;
|
|
@@ -13,6 +13,7 @@ import Icon from "../icon";
|
|
|
13
13
|
import useLocale from "../../hooks/__internal__/useLocale";
|
|
14
14
|
import useIsStickyFooterForm from "../../hooks/__internal__/useIsStickyFooterForm";
|
|
15
15
|
import useModalAria from "../../hooks/__internal__/useModalAria/useModalAria";
|
|
16
|
+
import tagComponent from "../../__internal__/utils/helpers/tags";
|
|
16
17
|
export const DialogFullScreen = ({
|
|
17
18
|
"aria-describedby": ariaDescribedBy,
|
|
18
19
|
"aria-label": ariaLabel,
|
|
@@ -36,6 +37,7 @@ export const DialogFullScreen = ({
|
|
|
36
37
|
focusableContainers,
|
|
37
38
|
focusableSelectors,
|
|
38
39
|
topModalOverride,
|
|
40
|
+
closeButtonDataProps,
|
|
39
41
|
...rest
|
|
40
42
|
}) => {
|
|
41
43
|
const locale = useLocale();
|
|
@@ -51,11 +53,13 @@ export const DialogFullScreen = ({
|
|
|
51
53
|
const isTopModal = useModalAria(dialogRef);
|
|
52
54
|
const closeIcon = () => {
|
|
53
55
|
if (!showCloseIcon || !onCancel) return null;
|
|
54
|
-
return /*#__PURE__*/React.createElement(IconButton, {
|
|
55
|
-
"data-element": "close",
|
|
56
|
+
return /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
56
57
|
"aria-label": locale.dialogFullScreen.ariaLabels.close(),
|
|
57
58
|
onClick: onCancel
|
|
58
|
-
},
|
|
59
|
+
}, tagComponent("close", {
|
|
60
|
+
"data-element": "close",
|
|
61
|
+
...closeButtonDataProps
|
|
62
|
+
})), /*#__PURE__*/React.createElement(Icon, {
|
|
59
63
|
type: "close"
|
|
60
64
|
}));
|
|
61
65
|
};
|
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { useDrop } from "react-dnd";
|
|
5
|
-
import { StyledDraggableContainer } from "../draggable-item.style";
|
|
5
|
+
import { StyledDraggableContainer } from "../draggable-item/draggable-item.style";
|
|
6
6
|
const DropTarget = ({
|
|
7
7
|
children,
|
|
8
8
|
getOrder,
|
|
@@ -5,8 +5,8 @@ import { DndProvider } from "react-dnd";
|
|
|
5
5
|
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
6
6
|
import invariant from "invariant";
|
|
7
7
|
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
8
|
-
import DraggableItem from "./draggable-item.component";
|
|
9
|
-
import DropTarget from "./
|
|
8
|
+
import DraggableItem from "./draggable-item/draggable-item.component";
|
|
9
|
+
import DropTarget from "./__internal__/drop-target.component";
|
|
10
10
|
const DraggableContainer = ({
|
|
11
11
|
children,
|
|
12
12
|
getOrder,
|
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { useDrop, useDrag } from "react-dnd";
|
|
5
|
-
import { filterStyledSystemPaddingProps } from "
|
|
5
|
+
import { filterStyledSystemPaddingProps } from "../../../style/utils";
|
|
6
6
|
import { StyledDraggableItem, StyledIcon } from "./draggable-item.style";
|
|
7
7
|
const DraggableItem = ({
|
|
8
8
|
id,
|
|
@@ -5,5 +5,5 @@ interface StyledDraggableItemProps extends PaddingProps {
|
|
|
5
5
|
isDragging?: boolean;
|
|
6
6
|
}
|
|
7
7
|
declare const StyledDraggableItem: import("styled-components").StyledComponent<"div", any, StyledDraggableItemProps, never>;
|
|
8
|
-
declare const StyledIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("
|
|
8
|
+
declare const StyledIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
9
9
|
export { StyledDraggableContainer, StyledDraggableItem, StyledIcon };
|
package/esm/components/draggable/{draggable-item.style.js → draggable-item/draggable-item.style.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
import { padding, margin } from "styled-system";
|
|
3
|
-
import { baseTheme } from "
|
|
4
|
-
import Icon from "
|
|
3
|
+
import { baseTheme } from "../../../style/themes";
|
|
4
|
+
import Icon from "../../icon";
|
|
5
5
|
const StyledDraggableContainer = styled.div`
|
|
6
6
|
${margin}
|
|
7
7
|
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as DraggableContainer } from "./draggable-container.component";
|
|
2
2
|
export type { DraggableContainerProps } from "./draggable-container.component";
|
|
3
|
-
export { default as DraggableItem } from "./draggable-item.component";
|
|
4
|
-
export type { DraggableItemProps } from "./draggable-item.component";
|
|
3
|
+
export { default as DraggableItem } from "./draggable-item/draggable-item.component";
|
|
4
|
+
export type { DraggableItemProps } from "./draggable-item/draggable-item.component";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as DraggableContainer } from "./draggable-container.component";
|
|
2
|
-
export { default as DraggableItem } from "./draggable-item.component";
|
|
2
|
+
export { default as DraggableItem } from "./draggable-item/draggable-item.component";
|
package/esm/components/duelling-picklist/picklist-placeholder/picklist-placeholder.component.js
CHANGED
|
@@ -3,7 +3,9 @@ import PropTypes from "prop-types";
|
|
|
3
3
|
import { StyledPicklistPlaceholder } from "../duelling-picklist.style";
|
|
4
4
|
export const PicklistPlaceholder = ({
|
|
5
5
|
text
|
|
6
|
-
}) =>
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
}) => {
|
|
7
|
+
return /*#__PURE__*/React.createElement(StyledPicklistPlaceholder, {
|
|
8
|
+
"data-element": "picklist-placeholder"
|
|
9
|
+
}, text);
|
|
10
|
+
};
|
|
9
11
|
export default PicklistPlaceholder;
|
|
@@ -23,9 +23,6 @@ export interface FlatTableHeaderProps extends PaddingProps {
|
|
|
23
23
|
}
|
|
24
24
|
export declare const FlatTableHeader: {
|
|
25
25
|
({ align, children, colspan, rowspan, width, py, px, id, ...rest }: FlatTableHeaderProps): React.JSX.Element;
|
|
26
|
-
defaultProps: {
|
|
27
|
-
align: string;
|
|
28
|
-
};
|
|
29
26
|
displayName: string;
|
|
30
27
|
};
|
|
31
28
|
export default FlatTableHeader;
|
|
@@ -6,7 +6,7 @@ import { FlatTableThemeContext } from "../flat-table.component";
|
|
|
6
6
|
import guid from "../../../__internal__/utils/helpers/guid";
|
|
7
7
|
import useTableCell from "../__internal__/use-table-cell";
|
|
8
8
|
export const FlatTableHeader = ({
|
|
9
|
-
align,
|
|
9
|
+
align = "left",
|
|
10
10
|
children,
|
|
11
11
|
colspan,
|
|
12
12
|
rowspan,
|
|
@@ -47,8 +47,5 @@ export const FlatTableHeader = ({
|
|
|
47
47
|
id: internalId.current
|
|
48
48
|
}), /*#__PURE__*/React.createElement("div", null, children));
|
|
49
49
|
};
|
|
50
|
-
FlatTableHeader.defaultProps = {
|
|
51
|
-
align: "left"
|
|
52
|
-
};
|
|
53
50
|
FlatTableHeader.displayName = "FlatTableHeader";
|
|
54
51
|
export default FlatTableHeader;
|
|
@@ -7,5 +7,5 @@ export interface SortProps {
|
|
|
7
7
|
/** Sets the content of `FlatTableSortHeader` */
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
declare const Sort: ({ children, onClick, sortType }: SortProps) => React.JSX.Element;
|
|
10
|
+
export declare const Sort: ({ children, onClick, sortType }: SortProps) => React.JSX.Element;
|
|
11
11
|
export default Sort;
|
|
@@ -4,7 +4,7 @@ import Event from "../../../__internal__/utils/helpers/events";
|
|
|
4
4
|
import { StyledSort, StyledSpaceHolder, StyledSortIcon } from "./sort.style";
|
|
5
5
|
import guid from "../../../__internal__/utils/helpers/guid";
|
|
6
6
|
import { FlatTableThemeContext } from "../flat-table.component";
|
|
7
|
-
const Sort = ({
|
|
7
|
+
export const Sort = ({
|
|
8
8
|
children,
|
|
9
9
|
onClick,
|
|
10
10
|
sortType
|
|
@@ -3,7 +3,6 @@ import React, { useContext, useMemo, useState } from "react";
|
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import Icon from "../icon";
|
|
5
5
|
import MenuContext from "../menu/menu.context";
|
|
6
|
-
import Event from "../../__internal__/utils/helpers/events";
|
|
7
6
|
import { StyledLink, StyledContent } from "./link.style";
|
|
8
7
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
9
8
|
import useLocale from "../../hooks/__internal__/useLocale";
|
|
@@ -34,20 +33,6 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
34
33
|
const {
|
|
35
34
|
inMenu
|
|
36
35
|
} = useContext(MenuContext);
|
|
37
|
-
const handleOnKeyDown = ev => {
|
|
38
|
-
if (onKeyDown) {
|
|
39
|
-
onKeyDown(ev);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// return early if there is no onClick or there is a href prop
|
|
43
|
-
// or the event is not an enter key
|
|
44
|
-
if (href || !Event.isEnterKey(ev) && !Event.isSpaceKey(ev)) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (onClick) {
|
|
48
|
-
onClick(ev);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
36
|
const renderLinkIcon = (currentAlignment = "left") => {
|
|
52
37
|
const hasProperAlignment = icon && iconAlign === currentAlignment;
|
|
53
38
|
return hasProperAlignment ? /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -66,7 +51,7 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
66
51
|
}, {});
|
|
67
52
|
}, [rest]);
|
|
68
53
|
const componentProps = {
|
|
69
|
-
onKeyDown
|
|
54
|
+
onKeyDown,
|
|
70
55
|
onMouseDown,
|
|
71
56
|
onClick,
|
|
72
57
|
disabled,
|
|
@@ -2,8 +2,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
2
2
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
3
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(
|
|
6
|
-
function _toPrimitive(
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
let ModalManagerInstance = /*#__PURE__*/function () {
|
|
8
8
|
function ModalManagerInstance() {
|
|
9
9
|
_classCallCheck(this, ModalManagerInstance);
|
|
@@ -3,6 +3,7 @@ import React, { useRef } from "react";
|
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import Textbox from "../textbox";
|
|
5
5
|
import Logger from "../../__internal__/utils/logger";
|
|
6
|
+
import { ALIGN_DEFAULT, LABEL_VALIDATION_DEFAULT, LABEL_WIDTH_DEFAULT, SIZE_DEFAULT } from "../textbox/textbox.component";
|
|
6
7
|
let deprecateInputRefWarnTriggered = false;
|
|
7
8
|
let deprecateUncontrolledWarnTriggered = false;
|
|
8
9
|
function isValidNumber(value) {
|
|
@@ -15,6 +16,10 @@ const Number = /*#__PURE__*/React.forwardRef(({
|
|
|
15
16
|
onKeyDown,
|
|
16
17
|
value,
|
|
17
18
|
inputRef,
|
|
19
|
+
align = ALIGN_DEFAULT,
|
|
20
|
+
labelWidth = LABEL_WIDTH_DEFAULT,
|
|
21
|
+
size = SIZE_DEFAULT,
|
|
22
|
+
validationOnLabel = LABEL_VALIDATION_DEFAULT,
|
|
18
23
|
...rest
|
|
19
24
|
}, ref) => {
|
|
20
25
|
const selectionStart = useRef(null);
|
|
@@ -47,7 +52,11 @@ const Number = /*#__PURE__*/React.forwardRef(({
|
|
|
47
52
|
onChange: handleOnChange,
|
|
48
53
|
onKeyDown: handleKeyDown,
|
|
49
54
|
ref: ref,
|
|
50
|
-
inputRef: inputRef
|
|
55
|
+
inputRef: inputRef,
|
|
56
|
+
align: align,
|
|
57
|
+
labelWidth: labelWidth,
|
|
58
|
+
size: size,
|
|
59
|
+
validationOnLabel: validationOnLabel
|
|
51
60
|
}));
|
|
52
61
|
});
|
|
53
62
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -16,7 +16,7 @@ export interface PagerNavigationProps {
|
|
|
16
16
|
/** Callback function for last link */
|
|
17
17
|
onLast?: (ev: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
18
18
|
/** onPagination Callback triggered when a change is triggered */
|
|
19
|
-
onPagination: (
|
|
19
|
+
onPagination: (currentPage: number, pageSize: number, origin: string) => void;
|
|
20
20
|
/** Should the `First` and `Last` navigation buttons be shown */
|
|
21
21
|
showFirstAndLastButtons?: boolean;
|
|
22
22
|
/** Should the `Next` and `Previous` navigation buttons be shown */
|
|
@@ -4,8 +4,8 @@ declare type PageSizeOption = {
|
|
|
4
4
|
name: number;
|
|
5
5
|
};
|
|
6
6
|
export interface PagerProps {
|
|
7
|
-
/** Function called when pager changes (
|
|
8
|
-
onPagination: (
|
|
7
|
+
/** Function called when pager changes (Current page, Page size, Origin component) */
|
|
8
|
+
onPagination: (currentPage: number, pageSize: number, origin: string) => void;
|
|
9
9
|
/** Callback function for next link */
|
|
10
10
|
onNext?: (ev: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
11
11
|
/** Callback function for first link */
|