@hazelcast/ui 1.3.2-next.6 → 1.3.2-next.60
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/lib/Alert.d.ts +6 -5
- package/lib/Alert.js +2 -2
- package/lib/Alert.js.map +1 -1
- package/lib/AutocompleteField.d.ts +9 -6
- package/lib/AutocompleteField.js +6 -7
- package/lib/AutocompleteField.js.map +1 -1
- package/lib/AutocompleteField.module.scss +16 -0
- package/lib/AutocompleteFieldFormik.d.ts +1 -1
- package/lib/Badge.d.ts +4 -4
- package/lib/Button.d.ts +16 -16
- package/lib/Button.js +1 -1
- package/lib/Button.js.map +1 -1
- package/lib/Button.module.scss +24 -1
- package/lib/Calendar/Calendar.d.ts +8 -4
- package/lib/Calendar/Calendar.js +32 -22
- package/lib/Calendar/Calendar.js.map +1 -1
- package/lib/Calendar/Calendar.module.scss +2 -1
- package/lib/Calendar/CalendarRange.d.ts +4 -4
- package/lib/Calendar/CalendarRange.js +5 -5
- package/lib/Calendar/CalendarRange.js.map +1 -1
- package/lib/Calendar/CalendarRange.module.scss +5 -0
- package/lib/Calendar/components/CalendarHeader.d.ts +2 -2
- package/lib/Calendar/components/CalendarInput.d.ts +8 -6
- package/lib/Calendar/components/CalendarInput.js +3 -3
- package/lib/Calendar/components/CalendarInput.js.map +1 -1
- package/lib/Calendar/components/CalendarTime.d.ts +2 -2
- package/lib/Calendar/components/CalendarTime.js +15 -10
- package/lib/Calendar/components/CalendarTime.js.map +1 -1
- package/lib/Calendar/components/CalendarTime.module.scss +4 -0
- package/lib/Calendar/helpers/consts.js +97 -97
- package/lib/Calendar/helpers/consts.js.map +1 -1
- package/lib/Card.d.ts +1 -1
- package/lib/Card.js +2 -2
- package/lib/Card.js.map +1 -1
- package/lib/Carousel.d.ts +25 -0
- package/lib/Carousel.js +28 -0
- package/lib/Carousel.js.map +1 -0
- package/lib/Carousel.module.scss +26 -0
- package/lib/Checkbox.d.ts +4 -3
- package/lib/Checkbox.js +2 -2
- package/lib/Checkbox.js.map +1 -1
- package/lib/CheckboxFormik.d.ts +1 -1
- package/lib/CircularProgressBar.d.ts +1 -1
- package/lib/ContextMenu.d.ts +15 -0
- package/lib/ContextMenu.js +58 -0
- package/lib/ContextMenu.js.map +1 -0
- package/lib/ContextMenu.module.scss +37 -0
- package/lib/Dialog.d.ts +2 -2
- package/lib/EmptyState.d.ts +5 -5
- package/lib/FieldHeader.d.ts +8 -6
- package/lib/FieldHeader.js +2 -2
- package/lib/FieldHeader.js.map +1 -1
- package/lib/Help.d.ts +2 -1
- package/lib/Help.js +2 -2
- package/lib/Help.js.map +1 -1
- package/lib/Icon.d.ts +5 -5
- package/lib/Icon.js +1 -1
- package/lib/Icon.js.map +1 -1
- package/lib/IconButton.d.ts +6 -6
- package/lib/InteractiveList.d.ts +5 -5
- package/lib/InteractiveList.js +4 -2
- package/lib/InteractiveList.js.map +1 -1
- package/lib/InteractiveList.module.scss +1 -0
- package/lib/InteractiveListFormik.d.ts +1 -1
- package/lib/Label.d.ts +1 -1
- package/lib/Link.d.ts +7 -7
- package/lib/Link.js +3 -3
- package/lib/Link.js.map +1 -1
- package/lib/Loader.d.ts +1 -1
- package/lib/Modal.d.ts +4 -2
- package/lib/Modal.js.map +1 -1
- package/lib/Notification.d.ts +4 -4
- package/lib/NumberBadge.d.ts +2 -1
- package/lib/NumberBadge.js +3 -2
- package/lib/NumberBadge.js.map +1 -1
- package/lib/NumberField.d.ts +5 -7
- package/lib/NumberField.js.map +1 -1
- package/lib/NumberFieldFormik.d.ts +1 -1
- package/lib/Overlay.d.ts +7 -2
- package/lib/Overlay.js +5 -5
- package/lib/Overlay.js.map +1 -1
- package/lib/Overlay.module.scss +1 -1
- package/lib/Pagination.d.ts +7 -6
- package/lib/Pagination.js +7 -7
- package/lib/Pagination.js.map +1 -1
- package/lib/PasswordField.d.ts +3 -3
- package/lib/PasswordFieldFormik.d.ts +1 -1
- package/lib/Popover.d.ts +2 -0
- package/lib/Popover.js +12 -6
- package/lib/Popover.js.map +1 -1
- package/lib/Radio.d.ts +3 -3
- package/lib/RadioFormik.d.ts +1 -1
- package/lib/RadioGroup.d.ts +3 -3
- package/lib/RadioGroupFormik.d.ts +1 -1
- package/lib/SegmentedControl.d.ts +7 -6
- package/lib/SegmentedControl.js +4 -4
- package/lib/SegmentedControl.js.map +1 -1
- package/lib/SegmentedControlFormik.d.ts +1 -1
- package/lib/Select/CheckableSelectField.d.ts +3 -3
- package/lib/Select/CheckableSelectField.module.scss +1 -1
- package/lib/Select/CheckableSelectFieldFormik.d.ts +1 -1
- package/lib/Select/Common.d.ts +6 -6
- package/lib/Select/MultiSelectField.d.ts +7 -7
- package/lib/Select/MultiSelectField.js +3 -1
- package/lib/Select/MultiSelectField.js.map +1 -1
- package/lib/Select/MultiSelectFieldFormik.d.ts +1 -1
- package/lib/Select/SelectField.d.ts +6 -7
- package/lib/Select/SelectField.js +5 -3
- package/lib/Select/SelectField.js.map +1 -1
- package/lib/Select/SelectField.module.scss +6 -4
- package/lib/Select/SelectFieldFormik.d.ts +1 -1
- package/lib/Select/helpers.d.ts +2 -2
- package/lib/SimpleTable.d.ts +1 -1
- package/lib/Slider.d.ts +8 -8
- package/lib/SliderFormik.d.ts +1 -1
- package/lib/Table/Cell.d.ts +11 -3
- package/lib/Table/Cell.js +44 -9
- package/lib/Table/Cell.js.map +1 -1
- package/lib/Table/Cell.module.scss +8 -0
- package/lib/Table/CellWrapper.d.ts +11 -0
- package/lib/Table/CellWrapper.js +29 -0
- package/lib/Table/CellWrapper.js.map +1 -0
- package/lib/Table/EnhancedRenderers.d.ts +2 -2
- package/lib/Table/Header.d.ts +1 -2
- package/lib/Table/Header.js +2 -2
- package/lib/Table/Header.js.map +1 -1
- package/lib/Table/Header.module.scss +35 -27
- package/lib/Table/Row.d.ts +4 -4
- package/lib/Table/Row.js +6 -2
- package/lib/Table/Row.js.map +1 -1
- package/lib/Table/Table.d.ts +14 -19
- package/lib/Table/Table.js +108 -161
- package/lib/Table/Table.js.map +1 -1
- package/lib/Table/Table.module.scss +4 -16
- package/lib/Table/TableContent.d.ts +25 -0
- package/lib/Table/TableContent.js +49 -0
- package/lib/Table/TableContent.js.map +1 -0
- package/lib/Table/TableContent.module.scss +21 -0
- package/lib/Table/constants.d.ts +2 -0
- package/lib/Table/constants.js +3 -0
- package/lib/Table/constants.js.map +1 -0
- package/lib/Table/features/columnsSelection/CellCopyablePopover.d.ts +8 -0
- package/lib/Table/features/columnsSelection/CellCopyablePopover.js +13 -0
- package/lib/Table/features/columnsSelection/CellCopyablePopover.js.map +1 -0
- package/lib/Table/features/columnsSelection/CellCopyablePopover.module.scss +12 -0
- package/lib/Table/features/columnsSelection/ContextMenu/ContextMenu.d.ts +6 -0
- package/lib/Table/features/columnsSelection/ContextMenu/ContextMenu.js +17 -0
- package/lib/Table/features/columnsSelection/ContextMenu/ContextMenu.js.map +1 -0
- package/lib/Table/features/columnsSelection/ContextMenu/ContextMenu.module.scss +6 -0
- package/lib/Table/features/columnsSelection/ContextMenu/index.d.ts +1 -0
- package/lib/Table/features/columnsSelection/ContextMenu/index.js +2 -0
- package/lib/Table/features/columnsSelection/ContextMenu/index.js.map +1 -0
- package/lib/Table/features/columnsSelection/columnsSelection.d.ts +19 -0
- package/lib/Table/features/columnsSelection/columnsSelection.js +71 -0
- package/lib/Table/features/columnsSelection/columnsSelection.js.map +1 -0
- package/lib/Table/features/columnsSelection/helpers.d.ts +7 -0
- package/lib/Table/features/columnsSelection/helpers.js +26 -0
- package/lib/Table/features/columnsSelection/helpers.js.map +1 -0
- package/lib/Table/features/columnsSelection/index.d.ts +4 -0
- package/lib/Table/features/columnsSelection/index.js +5 -0
- package/lib/Table/features/columnsSelection/index.js.map +1 -0
- package/lib/Tabs/Tab.d.ts +22 -8
- package/lib/Tabs/Tab.js +15 -4
- package/lib/Tabs/Tab.js.map +1 -1
- package/lib/Tabs/TabContext.d.ts +3 -3
- package/lib/Tabs/TabList.d.ts +1 -1
- package/lib/Tabs/TabPanel.d.ts +1 -1
- package/lib/Terminal.d.ts +1 -1
- package/lib/TextArea.d.ts +4 -4
- package/lib/TextAreaFormik.d.ts +1 -1
- package/lib/TextField.d.ts +7 -6
- package/lib/TextField.js +3 -4
- package/lib/TextField.js.map +1 -1
- package/lib/TextField.module.scss +5 -1
- package/lib/TextFieldFormik.d.ts +1 -1
- package/lib/TimeField.d.ts +3 -3
- package/lib/TimeField.js +4 -12
- package/lib/TimeField.js.map +1 -1
- package/lib/TimeField.module.scss +0 -87
- package/lib/TimeFieldFormik.d.ts +1 -1
- package/lib/Toast.d.ts +3 -3
- package/lib/Toggle.d.ts +4 -4
- package/lib/Toggle.js +1 -1
- package/lib/Toggle.js.map +1 -1
- package/lib/ToggleFormik.d.ts +1 -1
- package/lib/Tooltip.d.ts +6 -5
- package/lib/Tooltip.js +4 -14
- package/lib/Tooltip.js.map +1 -1
- package/lib/hooks/index.d.ts +0 -1
- package/lib/hooks/index.js +0 -1
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useCloseOnResize.d.ts +8 -0
- package/lib/hooks/useCloseOnResize.js +16 -0
- package/lib/hooks/useCloseOnResize.js.map +1 -0
- package/lib/hooks/useDimensions.d.ts +1 -1
- package/lib/hooks/useOnClickOutside.d.ts +1 -1
- package/lib/hooks/usePagination.d.ts +2 -2
- package/lib/index.d.ts +3 -4
- package/lib/index.js +3 -4
- package/lib/index.js.map +1 -1
- package/lib/utils/formik.d.ts +2 -2
- package/lib/utils/portal.d.ts +2 -0
- package/lib/utils/portal.js +15 -0
- package/lib/utils/portal.js.map +1 -0
- package/lib/utils/test.d.ts +3 -1
- package/lib/utils/test.js.map +1 -1
- package/lib/utils/types.d.ts +1 -1
- package/package.json +59 -55
- package/styles/constants/_colors.scss +3 -1
- package/styles/constants/_sizes.scss +1 -1
- package/styles/constants/_typography.scss +33 -22
- package/styles/typography/fonts/LICENSE.txt +202 -0
- package/styles/typography/fonts/OpenSans-Italic.woff2 +0 -0
- package/styles/typography/fonts/OpenSans-Regular.woff2 +0 -0
- package/styles/typography/fonts/OpenSans-SemiBold.woff2 +0 -0
- package/styles/typography/fonts/OpenSans-SemiBoldItalic.woff2 +0 -0
- package/styles/typography/fonts/PPTelegraf-Light.woff2 +0 -0
- package/styles/typography/fonts/PPTelegraf-Medium.woff2 +0 -0
- package/styles/typography/fonts/PPTelegraf-RegularSlanted.woff2 +0 -0
- package/styles/typography/fonts/PPTelegraf-UltralightSlanted.woff2 +0 -0
- package/styles/typography/open-sans.css +35 -0
- package/styles/typography/pp-telegraf.css +31 -0
- package/lib/Code.d.ts +0 -8
- package/lib/Code.js +0 -16
- package/lib/Code.js.map +0 -1
- package/lib/CodeEditor.d.ts +0 -28
- package/lib/CodeEditor.js +0 -180
- package/lib/CodeEditor.js.map +0 -1
- package/lib/CodeEditor.module.scss +0 -32
- package/lib/CodeEditorFormik.d.ts +0 -9
- package/lib/CodeEditorFormik.js +0 -14
- package/lib/CodeEditorFormik.js.map +0 -1
- package/lib/hooks/useTableCustomizableColumns.d.ts +0 -9
- package/lib/hooks/useTableCustomizableColumns.js +0 -21
- package/lib/hooks/useTableCustomizableColumns.js.map +0 -1
- package/styles/fonts.css +0 -26
package/lib/NumberField.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { DataTestProp } from '@hazelcast/helpers';
|
|
2
2
|
import { FC, FocusEvent, InputHTMLAttributes } from 'react';
|
|
3
|
-
import { TextFieldSize } from './TextField';
|
|
4
|
-
|
|
5
|
-
declare type NumberFieldCoreProps = {
|
|
3
|
+
import { TextFieldProps, TextFieldSize } from './TextField';
|
|
4
|
+
type NumberFieldCoreProps = {
|
|
6
5
|
name: string;
|
|
7
6
|
value?: number;
|
|
8
7
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
9
8
|
onChange: (newValue?: number) => void;
|
|
10
9
|
error?: string;
|
|
11
10
|
};
|
|
12
|
-
export
|
|
11
|
+
export type NumberFieldExtraProps = Omit<TextFieldProps<'number'>, 'onChange' | 'inputTrailingIcon' | 'inputTrailingIconLabel'> & {
|
|
13
12
|
incrementIconAriaLabel?: string;
|
|
14
13
|
decrementIconAriaLabel?: string;
|
|
15
14
|
step?: number;
|
|
@@ -19,9 +18,8 @@ export declare type NumberFieldExtraProps = {
|
|
|
19
18
|
numberType?: 'int' | 'float';
|
|
20
19
|
iconPosition?: 'separate' | 'together';
|
|
21
20
|
showIconButtons?: boolean;
|
|
22
|
-
label
|
|
21
|
+
label?: string;
|
|
23
22
|
showAriaLabel?: boolean;
|
|
24
|
-
helperText?: HelpProps['helperText'];
|
|
25
23
|
size?: TextFieldSize;
|
|
26
24
|
className?: string;
|
|
27
25
|
labelClassName?: string;
|
|
@@ -29,6 +27,6 @@ export declare type NumberFieldExtraProps = {
|
|
|
29
27
|
inputContainerClassName?: string;
|
|
30
28
|
errorClassName?: string;
|
|
31
29
|
} & DataTestProp & Pick<InputHTMLAttributes<HTMLInputElement>, 'autoFocus' | 'disabled' | 'autoComplete' | 'required' | 'placeholder'>;
|
|
32
|
-
export
|
|
30
|
+
export type NumberFieldProps = NumberFieldCoreProps & NumberFieldExtraProps;
|
|
33
31
|
export declare const NumberField: FC<NumberFieldProps>;
|
|
34
32
|
export {};
|
package/lib/NumberField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberField.js","sourceRoot":"","sources":["../src/NumberField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAoD,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACrG,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,yBAAyB,MAAM,yCAAyC,CAAA;AAC/E,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"NumberField.js","sourceRoot":"","sources":["../src/NumberField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAoD,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C,EAAE,eAAe;YACjC,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,YAAY,KAAK,UAAU;YAC1D,CAAC,MAAM,CAAC,2BAA2B,CAAC,EAAE,YAAY,KAAK,UAAU,IAAI,IAAI,KAAK,OAAO;SACtF,EACD,uBAAuB,CACxB,EACD,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,GACV,CACH,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { ReactElement } from 'react';
|
|
|
2
2
|
import { NumberFieldExtraProps } from './NumberField';
|
|
3
3
|
import { FieldValidatorGeneric } from './utils/formik';
|
|
4
4
|
import { ExtractKeysOfValueType } from './utils/types';
|
|
5
|
-
export
|
|
5
|
+
export type NumberFieldFormikProps<V extends object> = NumberFieldExtraProps & {
|
|
6
6
|
name: ExtractKeysOfValueType<V, number | undefined>;
|
|
7
7
|
validate?: FieldValidatorGeneric<number | undefined>;
|
|
8
8
|
onChange?: (value?: number) => void;
|
package/lib/Overlay.d.ts
CHANGED
|
@@ -3,16 +3,21 @@ import { Props as ReactModalProps } from 'react-modal';
|
|
|
3
3
|
import { DataTestProp } from '@hazelcast/helpers';
|
|
4
4
|
import { ButtonProps, ButtonTypeButtonProps } from './Button';
|
|
5
5
|
import { IconProps } from './Icon';
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type OverlayActionProps = ButtonProps<ButtonTypeButtonProps>;
|
|
7
|
+
export type OverlayProps = {
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
closable?: boolean;
|
|
10
|
+
closeText?: string | null;
|
|
11
|
+
className?: string;
|
|
10
12
|
headerClassName?: string;
|
|
13
|
+
footerClassName?: string;
|
|
11
14
|
contentClassName?: string;
|
|
15
|
+
wrapperClassName?: string;
|
|
12
16
|
icon?: IconProps['icon'];
|
|
13
17
|
onClose?: ReactModalProps['onRequestClose'];
|
|
14
18
|
contentWidth?: 'fullscreen' | 'normal';
|
|
15
19
|
title?: string;
|
|
16
20
|
headingContent?: ReactNode;
|
|
21
|
+
footerContent?: ReactNode;
|
|
17
22
|
} & DataTestProp & Exclude<ReactModalProps, 'onRequestClose' | 'shouldFocusAfterRender' | 'shouldReturnFocusAfterClose'>;
|
|
18
23
|
export declare const Overlay: FC<OverlayProps>;
|
package/lib/Overlay.js
CHANGED
|
@@ -15,7 +15,7 @@ import styles from './Overlay.module.scss';
|
|
|
15
15
|
* - Overlay always contains a title, cancel button in the top right corner, and content.
|
|
16
16
|
* - To close the Overlay, use cancel button in the top right corner or press "Esc" key.
|
|
17
17
|
*/
|
|
18
|
-
export const Overlay = ({ 'data-test': dataTest, children, className, headerClassName, contentClassName, icon, onClose, title, headingContent, contentWidth = 'normal', isOpen, closable = true, ...rest }) => {
|
|
18
|
+
export const Overlay = ({ 'data-test': dataTest, children, className, headerClassName, footerClassName, contentClassName, wrapperClassName, icon, onClose, title, headingContent, footerContent, contentWidth = 'normal', isOpen, closable = true, closeText = 'Cancel', ...rest }) => {
|
|
19
19
|
useIsomorphicLayoutEffect(() => {
|
|
20
20
|
if (isOpen) {
|
|
21
21
|
document.body.classList.add(styles.overlayed);
|
|
@@ -25,13 +25,13 @@ export const Overlay = ({ 'data-test': dataTest, children, className, headerClas
|
|
|
25
25
|
}
|
|
26
26
|
}, [isOpen]);
|
|
27
27
|
return (React.createElement(ReactModal, { "data-test": dataTest, portalClassName: styles.portal, className: cn(styles.modal, className), contentLabel: title, onRequestClose: onClose, shouldCloseOnOverlayClick: false, shouldCloseOnEsc: closable, shouldFocusAfterRender: true, shouldReturnFocusAfterClose: true, isOpen: isOpen, ...rest },
|
|
28
|
-
React.createElement("div", { "data-test": "overlay-wrapper", className: cn(styles.wrapper, { [styles.normal]: contentWidth === 'normal', [styles.fullscreen]: contentWidth === 'fullscreen' }) },
|
|
28
|
+
React.createElement("div", { "data-test": "overlay-wrapper", className: cn(styles.wrapper, { [styles.normal]: contentWidth === 'normal', [styles.fullscreen]: contentWidth === 'fullscreen' }, wrapperClassName) },
|
|
29
29
|
React.createElement("div", { "data-test": "overlay-header", className: cn(styles.header, headerClassName) },
|
|
30
30
|
icon && React.createElement(Icon, { "data-test": "overlay-header-icon", className: styles.icon, size: "medium", icon: icon, ariaHidden: true }),
|
|
31
31
|
title && (React.createElement("h1", { "data-test": "overlay-header-title", className: styles.title }, title)),
|
|
32
32
|
headingContent,
|
|
33
|
-
closable && (React.createElement(Link, { "data-test": "overlay-header-cancel-button", className: styles.close, component: "button", onClick: onClose, size: "small", iconClassName: styles.closeIcon, icon: X, ariaLabel:
|
|
34
|
-
|
|
35
|
-
React.createElement("div", { "data-test": "overlay-
|
|
33
|
+
closable && (React.createElement(Link, { "data-test": "overlay-header-cancel-button", className: styles.close, component: "button", onClick: onClose, size: "small", iconClassName: styles.closeIcon, icon: X, ariaLabel: closeText || 'Cancel' }, !!closeText && React.createElement("span", { className: styles.closeText }, closeText)))),
|
|
34
|
+
React.createElement("div", { "data-test": "overlay-content", className: cn(styles.content, contentClassName) }, children),
|
|
35
|
+
footerContent && (React.createElement("div", { "data-test": "overlay-footer", className: footerClassName }, footerContent)))));
|
|
36
36
|
};
|
|
37
37
|
//# sourceMappingURL=Overlay.js.map
|
package/lib/Overlay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.js","sourceRoot":"","sources":["../src/Overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAC5C,OAAO,UAAwC,MAAM,aAAa,CAAA;AAClE,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAA;AACjC,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,yBAAyB,MAAM,yCAAyC,CAAA;AAI/E,OAAO,EAAE,IAAI,EAAa,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,OAAO,MAAM,MAAM,uBAAuB,CAAA;
|
|
1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IACvD,aAAa,CACV,CACP,CACG,CACK,CACd,CAAA;AACH,CAAC,CAAA"}
|
package/lib/Overlay.module.scss
CHANGED
package/lib/Pagination.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type GetShownItemsRangeParams = {
|
|
3
3
|
currentPage: number;
|
|
4
4
|
pageSize: number;
|
|
5
5
|
numberOfItems: number;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type ShownItemsRange = {
|
|
8
8
|
firstItemShown: number;
|
|
9
9
|
lastItemShown: number;
|
|
10
10
|
};
|
|
11
11
|
export declare const getShownItemsRange: ({ currentPage, pageSize, numberOfItems }: GetShownItemsRangeParams) => ShownItemsRange;
|
|
12
|
-
export
|
|
12
|
+
export type PaginationProps = {
|
|
13
13
|
pageCount: number;
|
|
14
14
|
currentPage: number;
|
|
15
15
|
canPreviousPage: boolean;
|
|
@@ -17,11 +17,12 @@ export declare type PaginationProps = {
|
|
|
17
17
|
goToPage: (page: number) => void;
|
|
18
18
|
nextPage: () => void;
|
|
19
19
|
previousPage: () => void;
|
|
20
|
-
pageSize: number;
|
|
21
|
-
setPageSize: (pageSize: number) => void;
|
|
22
|
-
pageSizeOptions: number[];
|
|
23
20
|
numberOfItems: number;
|
|
21
|
+
pageSize: number;
|
|
22
|
+
setPageSize?: (pageSize: number) => void;
|
|
23
|
+
pageSizeOptions?: number[];
|
|
24
24
|
displaySmallBreakpoint?: number;
|
|
25
|
+
isSimpleView?: boolean;
|
|
25
26
|
};
|
|
26
27
|
/**
|
|
27
28
|
* ### Purpose
|
package/lib/Pagination.js
CHANGED
|
@@ -40,7 +40,7 @@ export const getShownItemsRange = ({ currentPage, pageSize, numberOfItems }) =>
|
|
|
40
40
|
* version of Pagination with all its features. In that case the features
|
|
41
41
|
* (rows per page select and page jump) are hidden under "More Options" button.
|
|
42
42
|
*/
|
|
43
|
-
export const Pagination = ({ pageCount, currentPage, canPreviousPage, canNextPage, goToPage, nextPage, previousPage, pageSize, setPageSize, pageSizeOptions, numberOfItems, displaySmallBreakpoint = 820, }) => {
|
|
43
|
+
export const Pagination = ({ pageCount, currentPage, canPreviousPage, canNextPage, goToPage, nextPage, previousPage, pageSize, setPageSize, pageSizeOptions = [], numberOfItems, displaySmallBreakpoint = 820, isSimpleView, }) => {
|
|
44
44
|
const [currentPageValue, setCurrentPageValue] = useState(currentPage);
|
|
45
45
|
const containerWidthRef = useRef(null);
|
|
46
46
|
const { width } = useDimensions(containerWidthRef);
|
|
@@ -54,7 +54,7 @@ export const Pagination = ({ pageCount, currentPage, canPreviousPage, canNextPag
|
|
|
54
54
|
}), [currentPage, pageSize, numberOfItems]);
|
|
55
55
|
const rowsPerPageOptions = useDeepCompareMemo(() => pageSizeOptions.map((opt) => ({ value: opt, label: opt.toString() })), [pageSizeOptions]);
|
|
56
56
|
const onChangeWrapped = useCallback((pageSize) => {
|
|
57
|
-
if (typeof pageSize === 'number') {
|
|
57
|
+
if (typeof pageSize === 'number' && setPageSize) {
|
|
58
58
|
setPageSize(pageSize);
|
|
59
59
|
}
|
|
60
60
|
}, [setPageSize]);
|
|
@@ -91,13 +91,13 @@ export const Pagination = ({ pageCount, currentPage, canPreviousPage, canNextPag
|
|
|
91
91
|
}, [canNextPage, canPreviousPage, currentPage, goToPage, nextPage, previousPage, pageCount, pages]);
|
|
92
92
|
const [moreOptions, setMoreOptions] = useState(false);
|
|
93
93
|
return (React.createElement("div", { ref: containerWidthRef, className: styles.container },
|
|
94
|
-
displaySmall && moreOptions ? (React.createElement(React.Fragment, null,
|
|
94
|
+
displaySmall && moreOptions && !isSimpleView ? (React.createElement(React.Fragment, null,
|
|
95
95
|
PageJumpForm,
|
|
96
96
|
RowsPerPageSelect)) : (PageButtons),
|
|
97
|
-
!displaySmall && (React.createElement("span", { "data-test": "pagination-range-of-shown-items", className: styles.shownItems }, `${firstItemShown} – ${lastItemShown} of ${numberOfItems}`)),
|
|
98
|
-
!displaySmall && PageJumpForm,
|
|
99
|
-
!displaySmall && RowsPerPageSelect,
|
|
100
|
-
displaySmall && (
|
|
97
|
+
!displaySmall && !isSimpleView && (React.createElement("span", { "data-test": "pagination-range-of-shown-items", className: styles.shownItems }, `${firstItemShown} – ${lastItemShown} of ${numberOfItems}`)),
|
|
98
|
+
!displaySmall && !isSimpleView && PageJumpForm,
|
|
99
|
+
!displaySmall && !isSimpleView && RowsPerPageSelect,
|
|
100
|
+
displaySmall && !isSimpleView && (
|
|
101
101
|
// TODO: button should display an overlay with more options
|
|
102
102
|
React.createElement(IconButton, { key: "next", kind: "primary", icon: moreOptions ? ArrowLeft : Settings, ariaLabel: moreOptions ? 'Show Pages' : 'More Options', className: styles.iconButton, onClick: () => {
|
|
103
103
|
setMoreOptions(!moreOptions);
|
package/lib/Pagination.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../src/Pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9E,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,OAAO,MAAM,MAAM,0BAA0B,CAAA;AAC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Y,IAAI,CAAC,YAAY,IAAI,YAAY;QAC9C,CAAC,YAAY,IAAI,CAAC,YAAY,IAAI,iBAAiB;QAEnD,YAAY,IAAI,CAAC,YAAY,IAAI;QAChC,2DAA2D;QAC3D,oBAAC,UAAU,IACT,GAAG,EAAC,MAAM,EACV,IAAI,EAAC,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EACxC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,EACtD,SAAS,EAAE,MAAM,CAAC,UAAU,EAC5B,OAAO,EAAE,GAAG,EAAE;gBACZ,cAAc,CAAC,CAAC,WAAW,CAAC,CAAA;YAC9B,CAAC,GACD,CACH,CACG,CACP,CAAA;AACH,CAAC,CAAA"}
|
package/lib/PasswordField.d.ts
CHANGED
|
@@ -2,14 +2,14 @@ import { DataTestProp } from '@hazelcast/helpers';
|
|
|
2
2
|
import { FC, FocusEvent, ChangeEvent, InputHTMLAttributes } from 'react';
|
|
3
3
|
import { TextFieldSize } from './TextField';
|
|
4
4
|
import { HelpProps } from './Help';
|
|
5
|
-
|
|
5
|
+
type PasswordFieldCoreProps = {
|
|
6
6
|
name: string;
|
|
7
7
|
value?: string;
|
|
8
8
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
9
9
|
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
10
10
|
error?: string;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type PasswordFieldExtraProps = {
|
|
13
13
|
showIconLabel?: string;
|
|
14
14
|
hideIconLabel?: string;
|
|
15
15
|
label: string;
|
|
@@ -22,6 +22,6 @@ export declare type PasswordFieldExtraProps = {
|
|
|
22
22
|
withIcon?: boolean;
|
|
23
23
|
initiallyVisible?: boolean;
|
|
24
24
|
} & DataTestProp & Pick<InputHTMLAttributes<HTMLInputElement>, 'id' | 'autoFocus' | 'disabled' | 'autoComplete' | 'required' | 'placeholder'>;
|
|
25
|
-
export
|
|
25
|
+
export type PasswordFieldProps = PasswordFieldCoreProps & PasswordFieldExtraProps;
|
|
26
26
|
export declare const PasswordField: FC<PasswordFieldProps>;
|
|
27
27
|
export {};
|
|
@@ -2,7 +2,7 @@ import { ReactElement } from 'react';
|
|
|
2
2
|
import { PasswordFieldExtraProps } from './PasswordField';
|
|
3
3
|
import { FieldValidatorGeneric } from './utils/formik';
|
|
4
4
|
import { ExtractKeysOfValueType } from './utils/types';
|
|
5
|
-
export
|
|
5
|
+
export type PasswordFieldFormikProps<V extends object> = PasswordFieldExtraProps & {
|
|
6
6
|
name: ExtractKeysOfValueType<V, string | undefined>;
|
|
7
7
|
validate?: FieldValidatorGeneric<string | undefined>;
|
|
8
8
|
onChange?: (value: string) => void;
|
package/lib/Popover.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { Placement } from '@popperjs/core';
|
|
3
|
+
import { PortalContainer } from './utils/portal';
|
|
3
4
|
import { DataTestProp } from '../../helpers';
|
|
4
5
|
export interface PopoverProps extends DataTestProp {
|
|
5
6
|
open: boolean;
|
|
@@ -17,5 +18,6 @@ export interface PopoverProps extends DataTestProp {
|
|
|
17
18
|
onClose: () => void;
|
|
18
19
|
matchReferenceSize?: boolean;
|
|
19
20
|
onUpdateLayout?: () => void;
|
|
21
|
+
container?: PortalContainer;
|
|
20
22
|
}
|
|
21
23
|
export declare const Popover: FC<PopoverProps>;
|
package/lib/Popover.js
CHANGED
|
@@ -3,11 +3,11 @@ import { createPortal } from 'react-dom';
|
|
|
3
3
|
import { usePopper } from 'react-popper';
|
|
4
4
|
import cls from 'classnames';
|
|
5
5
|
import FocusTrap from 'focus-trap-react';
|
|
6
|
-
import {
|
|
6
|
+
import { getPortalContainer } from './utils/portal';
|
|
7
7
|
import { useOnClickOutside, useRefValue } from './hooks';
|
|
8
8
|
import styles from './Popover.module.scss';
|
|
9
9
|
export const Popover = (props) => {
|
|
10
|
-
const { open, children, anchorElement, placement = 'bottom-end', className, offset, arrowElement, onClose, 'data-test': dataTest, matchReferenceSize, onUpdateLayout, } = props;
|
|
10
|
+
const { open, children, anchorElement, placement = 'bottom-end', className, offset, arrowElement, onClose, 'data-test': dataTest, matchReferenceSize, onUpdateLayout, container = `body`, } = props;
|
|
11
11
|
const getOnUpdate = useRefValue(onUpdateLayout);
|
|
12
12
|
const [popperElement, setPopperElement] = useState(null);
|
|
13
13
|
const hasFocusableElements = useMemo(() => {
|
|
@@ -22,7 +22,7 @@ export const Popover = (props) => {
|
|
|
22
22
|
{
|
|
23
23
|
name: 'offset',
|
|
24
24
|
options: {
|
|
25
|
-
offset: [(_a = offset === null || offset === void 0 ? void 0 : offset.
|
|
25
|
+
offset: [(_a = offset === null || offset === void 0 ? void 0 : offset.x) !== null && _a !== void 0 ? _a : 0, (_b = offset === null || offset === void 0 ? void 0 : offset.y) !== null && _b !== void 0 ? _b : 0],
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
{
|
|
@@ -62,16 +62,22 @@ export const Popover = (props) => {
|
|
|
62
62
|
placement,
|
|
63
63
|
modifiers,
|
|
64
64
|
});
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
const containerEl = getPortalContainer(container, anchorElement);
|
|
66
|
+
useOnClickOutside(open, {
|
|
67
|
+
target: popperElement,
|
|
68
|
+
excludeElement: anchorElement,
|
|
69
|
+
handler: onClose,
|
|
70
|
+
});
|
|
71
|
+
return (React.createElement(React.Fragment, null, containerEl
|
|
67
72
|
? createPortal(open && (React.createElement(FocusTrap, { active: hasFocusableElements, focusTrapOptions: {
|
|
68
73
|
initialFocus: false,
|
|
69
74
|
setReturnFocus: anchorElement || undefined,
|
|
70
75
|
escapeDeactivates: true,
|
|
71
76
|
allowOutsideClick: true,
|
|
72
77
|
onDeactivate: onClose,
|
|
78
|
+
tabbableOptions: { displayCheck: 'none' },
|
|
73
79
|
} },
|
|
74
|
-
React.createElement("div", { ref: setPopperElement, "data-test": dataTest, className: cls(styles.root, className), style: popper.styles.popper, ...popper.attributes.popper }, children))),
|
|
80
|
+
React.createElement("div", { ref: setPopperElement, "data-test": dataTest, className: cls(styles.root, className), style: popper.styles.popper, ...popper.attributes.popper }, children))), containerEl)
|
|
75
81
|
: children));
|
|
76
82
|
};
|
|
77
83
|
//# sourceMappingURL=Popover.js.map
|
package/lib/Popover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","sourceRoot":"","sources":["../src/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAY,SAAS,EAAE,MAAM,cAAc,CAAA;AAElD,OAAO,GAAG,MAAM,YAAY,CAAA;AAC5B,OAAO,SAAS,MAAM,kBAAkB,CAAA;AAExC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Popover.js","sourceRoot":"","sources":["../src/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAY,SAAS,EAAE,MAAM,cAAc,CAAA;AAElD,OAAO,GAAG,MAAM,YAAY,CAAA;AAC5B,OAAO,SAAS,MAAM,kBAAkB,CAAA;AAExC,OAAO,EAAE,kBAAkB,EAAmB,MAAM,gBAAgB,CAAA;AAEpE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAExD,OAAO,MAAM,MAAM,uBAAuB,CAAA;AAkB1C,MAAM,CAAC,MAAM,OAAO,GAAqB,CAAC,KAAK,EAAE,EAAE;IACjD,MAAM,EACJ,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,SAAS,GAAG,YA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M,EAAE,aAAa;QACrB,cAAc,EAAE,aAAa;QAC7B,OAAO,EAAE,OAAO;KACjB,CAAC,CAAA;IAEF,OAAO,CACL,0CACG,WAAW;QACV,CAAC,CAAC,YAAY,CACV,IAAI,IAAI,CACN,oBAAC,SAAS,IACR,MAAM,EAAE,oBAAoB,EAC5B,gBAAgB,EAAE;gBAChB,YAAY,EAAE,KAAK;gBACnB,cAAc,EAAE,aAAa,IAAI,SAAS;gBAC1C,iBAAiB,EAAE,IAAI;gBACvB,iBAAiB,EAAE,IAAI;gBACvB,YAAY,EAAE,OAAO;gBACrB,eAAe,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE;aAC1C;YAED,6BACE,GAAG,EAAE,gBAAgB,eACV,QAAQ,EACnB,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,EACtC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,KACvB,MAAM,CAAC,UAAU,CAAC,MAAM,IAE3B,QAAQ,CACL,CACI,CACb,EACD,WAAW,CACZ;QACH,CAAC,CAAC,QAAQ,CACX,CACJ,CAAA;AACH,CAAC,CAAA"}
|
package/lib/Radio.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { FC, FocusEvent, ReactElement, ReactNode, ReactText } from 'react';
|
|
2
2
|
import { DataTestProp } from '@hazelcast/helpers';
|
|
3
3
|
import { HelpProps } from './Help';
|
|
4
|
-
|
|
4
|
+
type RadioCoreProps = {
|
|
5
5
|
value: string;
|
|
6
6
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
7
7
|
checked?: boolean;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type RadioExtraProps = {
|
|
10
10
|
label?: ReactText | ReactElement;
|
|
11
11
|
helperText?: HelpProps['helperText'];
|
|
12
12
|
disabled?: boolean;
|
|
@@ -14,7 +14,7 @@ export declare type RadioExtraProps = {
|
|
|
14
14
|
className?: string;
|
|
15
15
|
renderCheckmark?: () => ReactNode;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type RadioProps = RadioCoreProps & RadioExtraProps & DataTestProp;
|
|
18
18
|
/**
|
|
19
19
|
* ### Purpose
|
|
20
20
|
* Forms require input from users. If you need information that can be represented as a choice of multiple values, use input with type 'radio'.
|
package/lib/RadioFormik.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { RadioExtraProps } from './Radio';
|
|
3
|
-
export
|
|
3
|
+
export type RadioFormikProps = RadioExtraProps & {
|
|
4
4
|
value: string;
|
|
5
5
|
};
|
|
6
6
|
export declare const RadioFieldFormik: ({ value, ...props }: RadioFormikProps) => ReactElement;
|
package/lib/RadioGroup.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ChangeEvent, FC, ReactElement } from 'react';
|
|
2
2
|
import { DataTestProp } from '@hazelcast/helpers';
|
|
3
3
|
import { RadioProps } from './Radio';
|
|
4
|
-
export
|
|
4
|
+
export type RadioGroupCoreProps = {
|
|
5
5
|
name: string;
|
|
6
6
|
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
7
7
|
error?: string;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type RadioGroupExtraProps = {
|
|
10
10
|
children: ReactElement<RadioProps> | Array<ReactElement<RadioProps>>;
|
|
11
11
|
inline?: boolean;
|
|
12
12
|
radioGroupClassName?: string;
|
|
13
13
|
className?: string;
|
|
14
14
|
} & DataTestProp;
|
|
15
|
-
export
|
|
15
|
+
export type RadioGroupProps = RadioGroupExtraProps & RadioGroupCoreProps;
|
|
16
16
|
/**
|
|
17
17
|
* ### Purpose
|
|
18
18
|
* Forms require input from users. If you need information that can be represented as a choice of multiple values, use input with type 'radio'.
|
|
@@ -2,7 +2,7 @@ import { ReactElement } from 'react';
|
|
|
2
2
|
import { RadioGroupExtraProps } from './RadioGroup';
|
|
3
3
|
import { FieldValidatorGeneric } from './utils/formik';
|
|
4
4
|
import { ExtractKeysOfValueType } from './utils/types';
|
|
5
|
-
export
|
|
5
|
+
export type RadioGroupFormikProps<V extends object> = RadioGroupExtraProps & {
|
|
6
6
|
name: ExtractKeysOfValueType<V, string | undefined>;
|
|
7
7
|
validate?: FieldValidatorGeneric<string | undefined>;
|
|
8
8
|
onChange?: (value: string) => void;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { DataTestProp } from '@hazelcast/helpers';
|
|
3
|
+
export type SegmentedControlOption<V> = {
|
|
3
4
|
value: V;
|
|
4
5
|
label: string;
|
|
5
6
|
};
|
|
6
|
-
export
|
|
7
|
-
export
|
|
7
|
+
export type SegmentedControlSize = 'medium' | 'small';
|
|
8
|
+
export type SegmentedControlProps<V> = {
|
|
8
9
|
value: V;
|
|
9
10
|
onChange: (value: V) => void;
|
|
10
|
-
label
|
|
11
|
+
label?: string;
|
|
11
12
|
options: SegmentedControlOption<V>[];
|
|
12
13
|
size?: SegmentedControlSize;
|
|
13
14
|
className?: string;
|
|
14
15
|
optionClassName?: string;
|
|
15
16
|
labelClassName?: string;
|
|
16
|
-
};
|
|
17
|
-
export declare const SegmentedControl: <V extends string = string>({ label, value, onChange, options, size, className, optionClassName, labelClassName, }: SegmentedControlProps<V>) => JSX.Element;
|
|
17
|
+
} & DataTestProp;
|
|
18
|
+
export declare const SegmentedControl: <V extends string = string>({ label, value, onChange, options, size, className, optionClassName, labelClassName, "data-test": dataTest, }: SegmentedControlProps<V>) => JSX.Element;
|
package/lib/SegmentedControl.js
CHANGED
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { RadioGroup } from '@headlessui/react';
|
|
4
4
|
import styles from './SegmentedControl.module.scss';
|
|
5
|
-
export const SegmentedControl = ({ label, value, onChange, options, size = 'medium', className, optionClassName, labelClassName, }) => (React.createElement(RadioGroup, { className: cn(styles.group, { [styles.small]: size === 'small' }, className), value: value, onChange: onChange },
|
|
6
|
-
React.createElement(RadioGroup.Label, { className: styles.groupLabel }, label),
|
|
7
|
-
options.map((option) => (React.createElement(RadioGroup.Option, { key: option.value, value: option.value, className: ({ checked }) => cn(styles.option, { [styles.checked]: checked }, optionClassName) },
|
|
8
|
-
React.createElement(RadioGroup.Label, { className: cn(styles.label, labelClassName) }, option.label))))));
|
|
5
|
+
export const SegmentedControl = ({ label, value, onChange, options, size = 'medium', className, optionClassName, labelClassName, 'data-test': dataTest = 'segmented', }) => (React.createElement(RadioGroup, { "data-test": dataTest, className: cn(styles.group, { [styles.small]: size === 'small' }, className), value: value, onChange: onChange },
|
|
6
|
+
label && (React.createElement(RadioGroup.Label, { "data-test": `${dataTest}-label`, className: styles.groupLabel }, label)),
|
|
7
|
+
options.map((option) => (React.createElement(RadioGroup.Option, { "data-test": `${dataTest}-${option.value}`, key: option.value, value: option.value, className: ({ checked }) => cn(styles.option, { [styles.checked]: checked }, optionClassName) },
|
|
8
|
+
React.createElement(RadioGroup.Label, { "data-test": `${dataTest}-${option.value}-label`, className: cn(styles.label, labelClassName) }, option.label))))));
|
|
9
9
|
//# sourceMappingURL=SegmentedControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.js","sourceRoot":"","sources":["../src/SegmentedControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,MAAM,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"SegmentedControl.js","sourceRoot":"","sources":["../src/SegmentedControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,m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7 +2,7 @@ import { ReactElement } from 'react';
|
|
|
2
2
|
import { SegmentedControlProps } from './SegmentedControl';
|
|
3
3
|
import { FieldValidatorGeneric } from './utils/formik';
|
|
4
4
|
import { ExtractKeysOfValueType } from './utils/types';
|
|
5
|
-
export
|
|
5
|
+
export type SegmentedControlFormikProps<V extends object, OV> = Omit<SegmentedControlProps<OV>, 'value' | 'onChange'> & {
|
|
6
6
|
name: ExtractKeysOfValueType<V, OV | undefined>;
|
|
7
7
|
validate?: FieldValidatorGeneric<OV | undefined>;
|
|
8
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FocusEvent, ReactNode } from 'react';
|
|
2
2
|
import { SelectFieldOption } from './helpers';
|
|
3
3
|
import { HelpProps } from '../Help';
|
|
4
|
-
export
|
|
4
|
+
export type CheckableSelectFieldCoreStaticProps<V> = {
|
|
5
5
|
name: string;
|
|
6
6
|
onBlur?: (e: FocusEvent<HTMLElement>) => void;
|
|
7
7
|
error?: string;
|
|
@@ -10,7 +10,7 @@ export declare type CheckableSelectFieldCoreStaticProps<V> = {
|
|
|
10
10
|
allSelectedLabel?: string;
|
|
11
11
|
noneSelectedLabel?: string;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type CheckableSelectFieldExtraProps<V> = {
|
|
14
14
|
options: SelectFieldOption<V>[];
|
|
15
15
|
label: ReactNode;
|
|
16
16
|
size?: 'small' | 'medium';
|
|
@@ -27,7 +27,7 @@ export declare type CheckableSelectFieldExtraProps<V> = {
|
|
|
27
27
|
defaultOpen?: boolean;
|
|
28
28
|
id?: string;
|
|
29
29
|
};
|
|
30
|
-
export
|
|
30
|
+
export type CheckableSelectProps<V> = CheckableSelectFieldCoreStaticProps<V> & CheckableSelectFieldExtraProps<V>;
|
|
31
31
|
export interface CheckMarkProps {
|
|
32
32
|
checked: boolean;
|
|
33
33
|
}
|
|
@@ -2,7 +2,7 @@ import { ReactElement } from 'react';
|
|
|
2
2
|
import { CheckableSelectFieldExtraProps } from './CheckableSelectField';
|
|
3
3
|
import { FieldValidatorGeneric } from '../utils/formik';
|
|
4
4
|
import { ExtractKeysOfValueType } from '../utils/types';
|
|
5
|
-
export
|
|
5
|
+
export type CheckableSelectFieldFormikProps<V extends object, OV = string> = CheckableSelectFieldExtraProps<OV> & {
|
|
6
6
|
name: ExtractKeysOfValueType<V, OV[]>;
|
|
7
7
|
validate?: FieldValidatorGeneric<OV[]>;
|
|
8
8
|
onChange?: (value: OV[]) => void;
|
package/lib/Select/Common.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type RenderMenuFooterFunction = () => ReactNode;
|
|
3
3
|
export declare const components: {
|
|
4
|
-
DropdownIndicator: React.FunctionComponent<import("react-select").IndicatorProps<any>>;
|
|
5
|
-
ClearIndicator: React.FunctionComponent<import("react-select").IndicatorProps<any>>;
|
|
4
|
+
DropdownIndicator: React.FunctionComponent<import("react-select").IndicatorProps<any, boolean>>;
|
|
5
|
+
ClearIndicator: React.FunctionComponent<import("react-select").IndicatorProps<any, boolean>>;
|
|
6
6
|
Input: React.FunctionComponent<import("react-select").InputProps>;
|
|
7
|
-
MenuList: React.FunctionComponent<import("react-select").MenuListComponentProps<any>>;
|
|
8
|
-
IndicatorSeparator: React.FunctionComponent<import("react-select").IndicatorProps<any>>;
|
|
9
|
-
Option: React.FunctionComponent<import("react-select").OptionProps<any>>;
|
|
7
|
+
MenuList: React.FunctionComponent<import("react-select").MenuListComponentProps<any, boolean>>;
|
|
8
|
+
IndicatorSeparator: React.FunctionComponent<import("react-select").IndicatorProps<any, boolean>>;
|
|
9
|
+
Option: React.FunctionComponent<import("react-select").OptionProps<any, boolean>>;
|
|
10
10
|
SingleValue: React.FunctionComponent<import("react-select").SingleValueProps<any>>;
|
|
11
11
|
};
|
|
@@ -4,25 +4,25 @@ import { DataTestProp } from '@hazelcast/helpers';
|
|
|
4
4
|
import { SelectFieldOption } from './helpers';
|
|
5
5
|
import { RenderMenuFooterFunction } from './Common';
|
|
6
6
|
import { FieldHeaderProps } from '../FieldHeader';
|
|
7
|
-
export
|
|
7
|
+
export type MultiSelectFieldCoreStaticProps<V> = {
|
|
8
8
|
name: string;
|
|
9
9
|
onBlur?: (e: FocusEvent<HTMLElement>) => void;
|
|
10
10
|
error?: string;
|
|
11
11
|
value: V[];
|
|
12
12
|
onChange: (newValue: V[]) => void;
|
|
13
|
-
components?: Partial<SelectComponentsConfig<SelectFieldOption<V
|
|
13
|
+
components?: Partial<SelectComponentsConfig<SelectFieldOption<V>, true>>;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type MultiSelectFieldExtraProps<V> = {
|
|
16
16
|
options: GroupedOptionsType<SelectFieldOption<V>> | OptionsType<SelectFieldOption<V>>;
|
|
17
17
|
isCreatable?: V extends string ? boolean : false;
|
|
18
18
|
className?: string;
|
|
19
19
|
placeholder?: string;
|
|
20
20
|
errorClassName?: string;
|
|
21
21
|
menuPortalTarget?: 'body' | 'self' | HTMLElement | null;
|
|
22
|
-
formatGroupLabel?: ReactSelectProps<SelectFieldOption<V
|
|
23
|
-
formatOptionLabel?: ReactSelectProps<SelectFieldOption<V
|
|
22
|
+
formatGroupLabel?: ReactSelectProps<SelectFieldOption<V>, true>['formatGroupLabel'];
|
|
23
|
+
formatOptionLabel?: ReactSelectProps<SelectFieldOption<V>, true>['formatOptionLabel'];
|
|
24
24
|
renderMenuFooter?: RenderMenuFooterFunction;
|
|
25
|
-
styles?: ReactSelectProps<SelectFieldOption<V
|
|
25
|
+
styles?: ReactSelectProps<SelectFieldOption<V>, true>['styles'];
|
|
26
26
|
} & DataTestProp & Pick<InputHTMLAttributes<HTMLElement>, 'autoFocus' | 'disabled' | 'required' | 'placeholder'> & Pick<ReactSelectProps, 'isSearchable' | 'menuIsOpen' | 'menuPlacement' | 'noOptionsMessage' | 'inputValue' | 'closeMenuOnSelect' | 'hideSelectedOptions' | 'isClearable' | 'onInputChange'> & Omit<FieldHeaderProps, 'id'>;
|
|
27
|
-
export
|
|
27
|
+
export type MultiSelectProps<V> = MultiSelectFieldCoreStaticProps<V> & MultiSelectFieldExtraProps<V>;
|
|
28
28
|
export declare const MultiSelectField: <V extends string | number = number>(props: MultiSelectProps<V>) => React.ReactElement<MultiSelectProps<V>, string | React.JSXElementConstructor<any>>;
|