carbon-react 128.0.0 → 128.2.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/README.md +1 -1
- package/esm/__internal__/checkable-input/checkable-input.component.d.ts +2 -0
- package/esm/__internal__/checkable-input/checkable-input.component.js +4 -2
- package/esm/__internal__/fieldset/fieldset.style.js +7 -6
- package/esm/__internal__/form-field/form-field.component.d.ts +1 -1
- package/esm/__internal__/form-field/form-field.component.js +1 -0
- package/esm/__internal__/label/label.style.js +6 -5
- 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} +3 -1
- package/esm/components/checkbox/{checkbox-group.component.js → checkbox-group/checkbox-group.component.js} +14 -11
- package/esm/components/checkbox/{checkbox-group.style.js → checkbox-group/checkbox-group.style.js} +5 -5
- package/esm/components/checkbox/checkbox.component.js +4 -1
- package/esm/components/checkbox/index.d.ts +2 -2
- package/esm/components/checkbox/index.js +1 -1
- package/esm/components/date-range/date-range.component.d.ts +5 -1
- package/esm/components/date-range/date-range.component.js +5 -1
- package/esm/components/decimal/decimal.component.d.ts +0 -2
- package/esm/components/decimal/decimal.component.js +1 -2
- 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/fieldset/fieldset.component.d.ts +8 -3
- package/esm/components/fieldset/fieldset.component.js +16 -2
- package/esm/components/fieldset/fieldset.style.d.ts +4 -0
- package/esm/components/fieldset/fieldset.style.js +29 -2
- package/esm/components/file-input/file-input.component.d.ts +4 -0
- package/esm/components/file-input/file-input.component.js +3 -0
- 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/form/index.d.ts +1 -0
- package/esm/components/form/index.js +2 -1
- package/esm/components/form/required-fields-indicator/index.d.ts +1 -0
- package/esm/components/form/required-fields-indicator/index.js +1 -0
- package/esm/components/form/required-fields-indicator/required-fields-indicator.component.d.ts +7 -0
- package/esm/components/form/required-fields-indicator/required-fields-indicator.component.js +20 -0
- package/esm/components/hr/hr.component.d.ts +0 -1
- package/esm/components/inline-inputs/inline-inputs.component.d.ts +3 -1
- package/esm/components/inline-inputs/inline-inputs.component.js +13 -3
- 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/numeral-date/numeral-date.component.d.ts +3 -1
- package/esm/components/numeral-date/numeral-date.component.js +4 -3
- 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} +3 -1
- package/esm/components/radio-button/{radio-button-group.component.js → radio-button-group/radio-button-group.component.js} +17 -15
- package/esm/components/radio-button/radio-button.component.d.ts +1 -2
- package/esm/components/radio-button/radio-button.component.js +1 -3
- package/esm/components/select/filterable-select/filterable-select.component.d.ts +4 -0
- package/esm/components/select/filterable-select/filterable-select.component.js +5 -0
- package/esm/components/select/multi-select/multi-select.component.d.ts +2 -0
- package/esm/components/select/multi-select/multi-select.component.js +5 -0
- package/esm/components/select/select-textbox/select-textbox.component.d.ts +2 -0
- package/esm/components/select/select-textbox/select-textbox.component.js +3 -0
- package/esm/components/select/simple-select/simple-select.component.d.ts +4 -0
- package/esm/components/select/simple-select/simple-select.component.js +6 -0
- package/esm/components/switch/switch.component.js +1 -0
- package/esm/components/text-editor/text-editor.component.d.ts +3 -1
- package/esm/components/text-editor/text-editor.component.js +16 -2
- package/esm/components/textarea/textarea.component.d.ts +2 -2
- package/esm/components/textarea/textarea.component.js +7 -2
- package/esm/components/textbox/textbox.component.d.ts +6 -2
- 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/tile-select/tile-select.style.d.ts +1 -1
- 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/__internal__/checkable-input/checkable-input.component.d.ts +2 -0
- package/lib/__internal__/checkable-input/checkable-input.component.js +4 -2
- package/lib/__internal__/fieldset/fieldset.style.js +7 -6
- package/lib/__internal__/form-field/form-field.component.d.ts +1 -1
- package/lib/__internal__/form-field/form-field.component.js +1 -0
- package/lib/__internal__/label/label.style.js +6 -5
- 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} +3 -1
- package/lib/components/checkbox/{checkbox-group.component.js → checkbox-group/checkbox-group.component.js} +14 -11
- package/lib/components/checkbox/{checkbox-group.style.js → checkbox-group/checkbox-group.style.js} +5 -5
- package/lib/components/checkbox/checkbox.component.js +4 -1
- package/lib/components/checkbox/index.d.ts +2 -2
- package/lib/components/checkbox/index.js +1 -1
- package/lib/components/date-range/date-range.component.d.ts +5 -1
- package/lib/components/date-range/date-range.component.js +5 -1
- package/lib/components/decimal/decimal.component.d.ts +0 -2
- package/lib/components/decimal/decimal.component.js +1 -2
- 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/fieldset/fieldset.component.d.ts +8 -3
- package/lib/components/fieldset/fieldset.component.js +18 -2
- package/lib/components/fieldset/fieldset.style.d.ts +4 -0
- package/lib/components/fieldset/fieldset.style.js +31 -2
- package/lib/components/file-input/file-input.component.d.ts +4 -0
- package/lib/components/file-input/file-input.component.js +3 -0
- 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/form/index.d.ts +1 -0
- package/lib/components/form/index.js +7 -0
- package/lib/components/form/required-fields-indicator/index.d.ts +1 -0
- package/lib/components/form/required-fields-indicator/index.js +13 -0
- package/lib/components/form/required-fields-indicator/package.json +6 -0
- package/lib/components/form/required-fields-indicator/required-fields-indicator.component.d.ts +7 -0
- package/lib/components/form/required-fields-indicator/required-fields-indicator.component.js +28 -0
- package/lib/components/hr/hr.component.d.ts +0 -1
- package/lib/components/inline-inputs/inline-inputs.component.d.ts +3 -1
- package/lib/components/inline-inputs/inline-inputs.component.js +14 -4
- 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/numeral-date/numeral-date.component.d.ts +3 -1
- package/lib/components/numeral-date/numeral-date.component.js +4 -3
- 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} +3 -1
- package/lib/components/radio-button/{radio-button-group.component.js → radio-button-group/radio-button-group.component.js} +17 -15
- package/lib/components/radio-button/radio-button.component.d.ts +1 -2
- package/lib/components/radio-button/radio-button.component.js +1 -3
- package/lib/components/select/filterable-select/filterable-select.component.d.ts +4 -0
- package/lib/components/select/filterable-select/filterable-select.component.js +5 -0
- package/lib/components/select/multi-select/multi-select.component.d.ts +2 -0
- package/lib/components/select/multi-select/multi-select.component.js +5 -0
- package/lib/components/select/select-textbox/select-textbox.component.d.ts +2 -0
- package/lib/components/select/select-textbox/select-textbox.component.js +3 -0
- package/lib/components/select/simple-select/simple-select.component.d.ts +4 -0
- package/lib/components/select/simple-select/simple-select.component.js +6 -0
- package/lib/components/switch/switch.component.js +1 -0
- package/lib/components/text-editor/text-editor.component.d.ts +3 -1
- package/lib/components/text-editor/text-editor.component.js +16 -2
- package/lib/components/textarea/textarea.component.d.ts +2 -2
- package/lib/components/textarea/textarea.component.js +7 -2
- package/lib/components/textbox/textbox.component.d.ts +6 -2
- 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/tile-select/tile-select.style.d.ts +1 -1
- 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
|
@@ -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;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export interface FieldsetProps extends MarginProps {
|
|
4
|
+
/** When true, legend is placed in line with the children */
|
|
5
|
+
inline?: boolean;
|
|
5
6
|
/** Child elements */
|
|
6
7
|
children?: React.ReactNode;
|
|
7
8
|
/** The text for the fieldsets legend element. */
|
|
8
9
|
legend?: string;
|
|
10
|
+
/** Flag to configure fields as mandatory. */
|
|
11
|
+
required?: boolean;
|
|
12
|
+
/** Flag to configure fields as optional. */
|
|
13
|
+
isOptional?: boolean;
|
|
9
14
|
}
|
|
10
15
|
export declare const Fieldset: {
|
|
11
|
-
({ children, inline, legend, ...rest }: FieldsetProps): React.JSX.Element;
|
|
16
|
+
({ children, inline, legend, required, isOptional, ...rest }: FieldsetProps): React.JSX.Element;
|
|
12
17
|
displayName: string;
|
|
13
18
|
};
|
|
14
19
|
export default Fieldset;
|
|
@@ -1,5 +1,5 @@
|
|
|
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
|
-
import React from "react";
|
|
2
|
+
import React, { useState, useEffect } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
5
5
|
import { FieldsetStyle, LegendContainerStyle, FieldsetContentStyle } from "./fieldset.style";
|
|
@@ -10,11 +10,16 @@ export const Fieldset = ({
|
|
|
10
10
|
children,
|
|
11
11
|
inline = false,
|
|
12
12
|
legend,
|
|
13
|
+
required,
|
|
14
|
+
isOptional,
|
|
13
15
|
...rest
|
|
14
16
|
}) => {
|
|
17
|
+
const [ref, setRef] = useState(null);
|
|
15
18
|
const getLegend = () => {
|
|
16
19
|
if (!legend) return null;
|
|
17
20
|
return /*#__PURE__*/React.createElement(LegendContainerStyle, {
|
|
21
|
+
isRequired: required,
|
|
22
|
+
isOptional: isOptional,
|
|
18
23
|
inline: inline,
|
|
19
24
|
"data-component": "legend-style"
|
|
20
25
|
}, /*#__PURE__*/React.createElement("legend", {
|
|
@@ -22,11 +27,20 @@ export const Fieldset = ({
|
|
|
22
27
|
}, legend));
|
|
23
28
|
};
|
|
24
29
|
const marginProps = useFormSpacing(rest);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (ref && required) {
|
|
32
|
+
Array.from(ref.querySelectorAll("input") || /* istanbul ignore next */[]).forEach(el => {
|
|
33
|
+
el.setAttribute("required", "");
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}, [ref, required]);
|
|
25
37
|
return /*#__PURE__*/React.createElement(NewValidationContext.Provider, {
|
|
26
38
|
value: {
|
|
27
39
|
validationRedesignOptIn: false
|
|
28
40
|
}
|
|
29
|
-
}, /*#__PURE__*/React.createElement(FieldsetStyle, _extends({
|
|
41
|
+
}, /*#__PURE__*/React.createElement(FieldsetStyle, _extends({
|
|
42
|
+
ref: setRef
|
|
43
|
+
}, tagComponent("fieldset", rest), rest, marginProps), /*#__PURE__*/React.createElement(FieldsetContentStyle, {
|
|
30
44
|
"data-component": "fieldset-style",
|
|
31
45
|
inline: inline
|
|
32
46
|
}, getLegend(), /*#__PURE__*/React.createElement(FormSpacingProvider, {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export interface StyledFieldsetProps {
|
|
2
2
|
/** When true, legend is placed in line with the children */
|
|
3
3
|
inline?: boolean;
|
|
4
|
+
/** Flag to configure fields as mandatory. */
|
|
5
|
+
isRequired?: boolean;
|
|
6
|
+
/** Flag to configure fields as optional. */
|
|
7
|
+
isOptional?: boolean;
|
|
4
8
|
}
|
|
5
9
|
declare const FieldsetStyle: import("styled-components").StyledComponent<"fieldset", any, {}, never>;
|
|
6
10
|
declare const LegendContainerStyle: import("styled-components").StyledComponent<"div", any, StyledFieldsetProps, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
2
|
import { margin } from "styled-system";
|
|
3
3
|
import FormFieldStyle from "../../__internal__/form-field/form-field.style";
|
|
4
4
|
import ValidationIconStyle from "../../__internal__/validations/validation-icon.style";
|
|
@@ -37,9 +37,36 @@ const LegendContainerStyle = styled.div`
|
|
|
37
37
|
|
|
38
38
|
legend {
|
|
39
39
|
font-size: 20px;
|
|
40
|
-
font-weight:
|
|
40
|
+
font-weight: var(--fontWeights700);
|
|
41
|
+
color: var(--colorsUtilityYin090);
|
|
41
42
|
line-height: 24px;
|
|
42
43
|
margin-right: 4px;
|
|
44
|
+
|
|
45
|
+
${({
|
|
46
|
+
isRequired
|
|
47
|
+
}) => isRequired && css`
|
|
48
|
+
::after {
|
|
49
|
+
content: "*";
|
|
50
|
+
line-height: 24px;
|
|
51
|
+
color: var(--colorsSemanticNegative500);
|
|
52
|
+
font-weight: var(--fontWeights700);
|
|
53
|
+
margin-left: var(--spacing100);
|
|
54
|
+
position: relative;
|
|
55
|
+
top: 1px;
|
|
56
|
+
left: -4px;
|
|
57
|
+
}
|
|
58
|
+
`}
|
|
59
|
+
|
|
60
|
+
${({
|
|
61
|
+
isOptional
|
|
62
|
+
}) => isOptional && css`
|
|
63
|
+
::after {
|
|
64
|
+
content: "(optional)";
|
|
65
|
+
color: var(--colorsUtilityYin055);
|
|
66
|
+
font-weight: var(--fontWeights400);
|
|
67
|
+
margin-left: var(--spacing050);
|
|
68
|
+
}
|
|
69
|
+
`}
|
|
43
70
|
}
|
|
44
71
|
|
|
45
72
|
${ValidationIconStyle} ${StyledIcon}:focus {
|
|
@@ -31,6 +31,10 @@ export interface FileInputProps extends Pick<ValidationProps, "error">, Pick<Inp
|
|
|
31
31
|
onChange: (files: FileList) => void;
|
|
32
32
|
/** used to control how to display the progress of uploaded file(s) within the component */
|
|
33
33
|
uploadStatus?: FileUploadStatusProps | FileUploadStatusProps[];
|
|
34
|
+
/** Flag to configure component as mandatory. */
|
|
35
|
+
required?: boolean;
|
|
36
|
+
/** Flag to configure component as optional. */
|
|
37
|
+
isOptional?: boolean;
|
|
34
38
|
}
|
|
35
39
|
export declare const FileInput: React.ForwardRefExoticComponent<FileInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
36
40
|
export default FileInput;
|
|
@@ -32,6 +32,7 @@ const FileInput = /*#__PURE__*/React.forwardRef(({
|
|
|
32
32
|
name,
|
|
33
33
|
onChange,
|
|
34
34
|
required,
|
|
35
|
+
isOptional,
|
|
35
36
|
uploadStatus = [],
|
|
36
37
|
...rest
|
|
37
38
|
}, ref) => {
|
|
@@ -149,6 +150,7 @@ const FileInput = /*#__PURE__*/React.forwardRef(({
|
|
|
149
150
|
labelId: labelId,
|
|
150
151
|
id: uniqueId,
|
|
151
152
|
isRequired: required,
|
|
153
|
+
isOptional: isOptional,
|
|
152
154
|
"data-component": "file-input",
|
|
153
155
|
"data-role": dataRole,
|
|
154
156
|
"data-element": dataElement,
|
|
@@ -170,6 +172,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
170
172
|
"error": PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
171
173
|
"id": PropTypes.string,
|
|
172
174
|
"inputHint": PropTypes.node,
|
|
175
|
+
"isOptional": PropTypes.bool,
|
|
173
176
|
"isVertical": PropTypes.bool,
|
|
174
177
|
"label": PropTypes.string,
|
|
175
178
|
"m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
@@ -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
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./form.component";
|
|
1
|
+
export { default } from "./form.component";
|
|
2
|
+
export { default as RequiredFieldsIndicator } from "./required-fields-indicator";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./required-fields-indicator.component";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./required-fields-indicator.component";
|
package/esm/components/form/required-fields-indicator/required-fields-indicator.component.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
export interface RequiredIndicatorProps extends MarginProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: ({ children, ...rest }: RequiredIndicatorProps) => React.JSX.Element;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import Box from "../../box";
|
|
5
|
+
import StyledTypography from "../../typography/typography.style";
|
|
6
|
+
const StyledIndicatorContainer = styled(Box)`
|
|
7
|
+
${StyledTypography} {
|
|
8
|
+
color: var(--colorsUtilityYin090);
|
|
9
|
+
}
|
|
10
|
+
::after {
|
|
11
|
+
content: "*";
|
|
12
|
+
color: var(--colorsSemanticNegative500);
|
|
13
|
+
font-weight: 700;
|
|
14
|
+
margin-left: var(--spacing050);
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
export default (({
|
|
18
|
+
children,
|
|
19
|
+
...rest
|
|
20
|
+
}) => /*#__PURE__*/React.createElement(StyledIndicatorContainer, rest, children));
|
|
@@ -21,9 +21,11 @@ export interface InlineInputsProps extends MarginProps, StyledContentContainerPr
|
|
|
21
21
|
labelId?: string;
|
|
22
22
|
/** Flag to configure component as mandatory. */
|
|
23
23
|
required?: boolean;
|
|
24
|
+
/** Flag to configure component as optional. */
|
|
25
|
+
isOptional?: boolean;
|
|
24
26
|
}
|
|
25
27
|
declare const InlineInputs: {
|
|
26
|
-
({ adaptiveLabelBreakpoint, label, labelAlign, labelId, htmlFor, children, className, gutter, inputWidth, labelInline, labelWidth, required, ...rest }: InlineInputsProps): React.JSX.Element;
|
|
28
|
+
({ adaptiveLabelBreakpoint, label, labelAlign, labelId, htmlFor, children, className, gutter, inputWidth, labelInline, labelWidth, required, isOptional, ...rest }: InlineInputsProps): React.JSX.Element;
|
|
27
29
|
displayName: string;
|
|
28
30
|
};
|
|
29
31
|
export default InlineInputs;
|
|
@@ -1,5 +1,5 @@
|
|
|
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
|
-
import React from "react";
|
|
2
|
+
import React, { useRef, useEffect } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import Label from "../../__internal__/label";
|
|
5
5
|
import StyledInlineInputs, { StyledContentContainer, StyledInlineInput } from "./inline-inputs.style";
|
|
@@ -27,9 +27,11 @@ const InlineInputs = ({
|
|
|
27
27
|
labelInline = true,
|
|
28
28
|
labelWidth,
|
|
29
29
|
required,
|
|
30
|
+
isOptional,
|
|
30
31
|
...rest
|
|
31
32
|
}) => {
|
|
32
33
|
const largeScreen = useIsAboveBreakpoint(adaptiveLabelBreakpoint);
|
|
34
|
+
const ref = useRef(null);
|
|
33
35
|
let inlineLabel = labelInline;
|
|
34
36
|
if (adaptiveLabelBreakpoint) {
|
|
35
37
|
inlineLabel = largeScreen;
|
|
@@ -41,16 +43,24 @@ const InlineInputs = ({
|
|
|
41
43
|
labelId: labelId,
|
|
42
44
|
inline: inlineLabel,
|
|
43
45
|
htmlFor: htmlFor,
|
|
44
|
-
isRequired: required
|
|
46
|
+
isRequired: required,
|
|
47
|
+
optional: isOptional
|
|
45
48
|
}, label);
|
|
46
49
|
}
|
|
47
50
|
const marginProps = useFormSpacing(rest);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (required) {
|
|
53
|
+
const elements = Array.from(ref.current?.querySelectorAll("input") || /* istanbul ignore next */[]);
|
|
54
|
+
elements.forEach(el => el.setAttribute("required", ""));
|
|
55
|
+
}
|
|
56
|
+
}, [required]);
|
|
48
57
|
return /*#__PURE__*/React.createElement(StyledInlineInputs, _extends({
|
|
49
58
|
gutter: gutter,
|
|
50
59
|
"data-component": "inline-inputs",
|
|
51
60
|
className: className,
|
|
52
61
|
labelWidth: labelWidth,
|
|
53
|
-
labelInline: inlineLabel
|
|
62
|
+
labelInline: inlineLabel,
|
|
63
|
+
ref: ref
|
|
54
64
|
}, marginProps), renderLabel(), /*#__PURE__*/React.createElement(StyledContentContainer, {
|
|
55
65
|
gutter: gutter,
|
|
56
66
|
"data-element": "inline-inputs-container",
|
|
@@ -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") {
|
|
@@ -87,7 +87,9 @@ export interface NumeralDateProps<DateType extends NumeralDateObject = FullDate>
|
|
|
87
87
|
* A React ref to pass to the input corresponding to the year
|
|
88
88
|
*/
|
|
89
89
|
yearRef?: React.ForwardedRef<HTMLInputElement>;
|
|
90
|
+
/** Flag to configure component as optional. */
|
|
91
|
+
isOptional?: boolean;
|
|
90
92
|
}
|
|
91
93
|
export declare type ValidDateFormat = typeof ALLOWED_DATE_FORMATS[number];
|
|
92
|
-
export declare const NumeralDate: <DateType extends NumeralDateObject = FullDate>({ dateFormat, defaultValue, disabled, error, warning, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, info, id, name, onBlur, onChange, value, validationOnLabel, label, labelInline, labelWidth, labelAlign, labelHelp, labelSpacing, fieldHelp, adaptiveLabelBreakpoint, required, readOnly, size, enableInternalError, enableInternalWarning, tooltipPosition, helpAriaLabel, dayRef, monthRef, yearRef, ...rest }: NumeralDateProps<DateType>) => React.JSX.Element;
|
|
94
|
+
export declare const NumeralDate: <DateType extends NumeralDateObject = FullDate>({ dateFormat, defaultValue, disabled, error, warning, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, info, id, name, onBlur, onChange, value, validationOnLabel, label, labelInline, labelWidth, labelAlign, labelHelp, labelSpacing, fieldHelp, adaptiveLabelBreakpoint, required, isOptional, readOnly, size, enableInternalError, enableInternalWarning, tooltipPosition, helpAriaLabel, dayRef, monthRef, yearRef, ...rest }: NumeralDateProps<DateType>) => React.JSX.Element;
|
|
93
95
|
export default NumeralDate;
|
|
@@ -103,6 +103,7 @@ export const NumeralDate = ({
|
|
|
103
103
|
fieldHelp,
|
|
104
104
|
adaptiveLabelBreakpoint,
|
|
105
105
|
required,
|
|
106
|
+
isOptional,
|
|
106
107
|
readOnly,
|
|
107
108
|
size,
|
|
108
109
|
enableInternalError,
|
|
@@ -215,6 +216,7 @@ export const NumeralDate = ({
|
|
|
215
216
|
fieldHelp: fieldHelp,
|
|
216
217
|
adaptiveLabelBreakpoint: adaptiveLabelBreakpoint,
|
|
217
218
|
isRequired: required,
|
|
219
|
+
isOptional: isOptional,
|
|
218
220
|
validationRedesignOptIn: validationRedesignOptIn
|
|
219
221
|
}, filterStyledSystemMarginProps(rest)), validationRedesignOptIn && labelHelp && /*#__PURE__*/React.createElement(StyledHintText, null, labelHelp), /*#__PURE__*/React.createElement(Box, {
|
|
220
222
|
position: "relative"
|
|
@@ -285,8 +287,6 @@ export const NumeralDate = ({
|
|
|
285
287
|
error: !!internalError,
|
|
286
288
|
warning: !!internalWarning,
|
|
287
289
|
info: !!info
|
|
288
|
-
}, required && {
|
|
289
|
-
required
|
|
290
290
|
}, isEnd && !validationRedesignOptIn && !validationOnLabel && {
|
|
291
291
|
error: internalError,
|
|
292
292
|
warning: internalWarning,
|
|
@@ -294,7 +294,8 @@ export const NumeralDate = ({
|
|
|
294
294
|
}, {
|
|
295
295
|
size: size,
|
|
296
296
|
tooltipPosition: tooltipPosition,
|
|
297
|
-
"aria-labelledby": labelId
|
|
297
|
+
"aria-labelledby": labelId,
|
|
298
|
+
required: required
|
|
298
299
|
})))));
|
|
299
300
|
}))))));
|
|
300
301
|
};
|
|
@@ -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 */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { PaddingProps } from "styled-system";
|
|
3
|
+
import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
|
|
3
4
|
export interface RenderOpenProps {
|
|
4
5
|
tabIndex: number;
|
|
5
6
|
isOpen?: boolean;
|
|
@@ -18,8 +19,9 @@ export interface RenderCloseProps {
|
|
|
18
19
|
onClick: (ev: React.KeyboardEvent<HTMLElement> | React.MouseEvent<HTMLElement>) => void;
|
|
19
20
|
ref: React.RefObject<HTMLButtonElement>;
|
|
20
21
|
"aria-label": string;
|
|
22
|
+
closeButtonDataProps?: Pick<TagProps, "data-role" | "data-element">;
|
|
21
23
|
}
|
|
22
|
-
export declare const renderClose: ({ "data-element": dataElement, tabIndex, onClick, ref, "aria-label": ariaLabel, }: RenderCloseProps) => React.JSX.Element;
|
|
24
|
+
export declare const renderClose: ({ "data-element": dataElement, tabIndex, onClick, ref, "aria-label": ariaLabel, closeButtonDataProps, }: RenderCloseProps) => React.JSX.Element;
|
|
23
25
|
export interface PopoverContainerProps extends PaddingProps {
|
|
24
26
|
/** A function that will render the open component
|
|
25
27
|
*
|
|
@@ -53,10 +55,12 @@ export interface PopoverContainerProps extends PaddingProps {
|
|
|
53
55
|
openButtonAriaLabel?: string;
|
|
54
56
|
/** Close button aria label */
|
|
55
57
|
closeButtonAriaLabel?: string;
|
|
58
|
+
/** Data tag prop bag for close Button */
|
|
59
|
+
closeButtonDataProps?: Pick<TagProps, "data-role" | "data-element">;
|
|
56
60
|
/** Container aria label */
|
|
57
61
|
containerAriaLabel?: string;
|
|
58
62
|
/** Disables the animation for the component */
|
|
59
63
|
disableAnimation?: boolean;
|
|
60
64
|
}
|
|
61
|
-
export declare const PopoverContainer: ({ children, title, position, open, onOpen, onClose, renderOpenComponent, renderCloseComponent, shouldCoverButton, ariaDescribedBy, openButtonAriaLabel, closeButtonAriaLabel, containerAriaLabel, disableAnimation, ...rest }: PopoverContainerProps) => React.JSX.Element;
|
|
65
|
+
export declare const PopoverContainer: ({ children, title, position, open, onOpen, onClose, renderOpenComponent, renderCloseComponent, shouldCoverButton, ariaDescribedBy, openButtonAriaLabel, closeButtonAriaLabel, containerAriaLabel, closeButtonDataProps, disableAnimation, ...rest }: PopoverContainerProps) => React.JSX.Element;
|
|
62
66
|
export default PopoverContainer;
|
|
@@ -14,6 +14,7 @@ import Events from "../../__internal__/utils/helpers/events";
|
|
|
14
14
|
import FocusTrap from "../../__internal__/focus-trap";
|
|
15
15
|
import { ModalContext } from "../modal";
|
|
16
16
|
import useFocusPortalContent from "../../hooks/__internal__/useFocusPortalContent";
|
|
17
|
+
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
17
18
|
export const renderOpen = ({
|
|
18
19
|
tabIndex,
|
|
19
20
|
onClick,
|
|
@@ -42,14 +43,17 @@ export const renderClose = ({
|
|
|
42
43
|
tabIndex,
|
|
43
44
|
onClick,
|
|
44
45
|
ref,
|
|
45
|
-
"aria-label": ariaLabel
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
"aria-label": ariaLabel,
|
|
47
|
+
closeButtonDataProps
|
|
48
|
+
}) => /*#__PURE__*/React.createElement(PopoverContainerCloseIcon, _extends({
|
|
48
49
|
tabIndex: tabIndex,
|
|
49
50
|
onClick: onClick,
|
|
50
51
|
ref: ref,
|
|
51
52
|
"aria-label": ariaLabel
|
|
52
|
-
},
|
|
53
|
+
}, tagComponent("close", {
|
|
54
|
+
"data-element": dataElement,
|
|
55
|
+
...closeButtonDataProps
|
|
56
|
+
})), /*#__PURE__*/React.createElement(Icon, {
|
|
53
57
|
type: "close"
|
|
54
58
|
}));
|
|
55
59
|
const popoverMiddleware = [offset(({
|
|
@@ -73,6 +77,7 @@ export const PopoverContainer = ({
|
|
|
73
77
|
openButtonAriaLabel,
|
|
74
78
|
closeButtonAriaLabel = "close",
|
|
75
79
|
containerAriaLabel,
|
|
80
|
+
closeButtonDataProps,
|
|
76
81
|
disableAnimation = false,
|
|
77
82
|
...rest
|
|
78
83
|
}) => {
|
|
@@ -139,7 +144,8 @@ export const PopoverContainer = ({
|
|
|
139
144
|
tabIndex: 0,
|
|
140
145
|
onClick: handleCloseButtonClick,
|
|
141
146
|
ref: closeButtonRef,
|
|
142
|
-
"aria-label": closeButtonAriaLabel
|
|
147
|
+
"aria-label": closeButtonAriaLabel,
|
|
148
|
+
closeButtonDataProps
|
|
143
149
|
};
|
|
144
150
|
const handleClickAway = e => {
|
|
145
151
|
if (!isControlled) setIsOpenInternal(false);
|