@plesk/ui-library 3.34.0 → 3.34.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Button/Button.js +17 -100
- package/cjs/components/ContentLoader/IconsLoader.js +2 -1
- package/cjs/components/Dialog/Dialog.js +4 -113
- package/cjs/components/Drawer/Drawer.js +10 -143
- package/cjs/components/Drawer/Header.js +5 -12
- package/cjs/components/Dropdown/Dropdown.js +4 -42
- package/cjs/components/Form/Form.js +2 -1
- package/cjs/components/FormFieldPassword/PasswordMeter.js +4 -4
- package/cjs/components/Overlay/Overlay.js +4 -3
- package/cjs/components/Section/Section.js +2 -1
- package/cjs/components/Skeleton/SkeletonText.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/utils/types/PolymorphicComponent.js +5 -0
- package/cjs/utils/types/index.js +5 -0
- package/dist/plesk-ui-library-rtl.css +1 -1
- package/dist/plesk-ui-library-rtl.css.map +1 -1
- package/dist/plesk-ui-library.css +1 -1
- package/dist/plesk-ui-library.css.map +1 -1
- package/dist/plesk-ui-library.js +128 -494
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +5 -5
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/Button/Button.js +17 -98
- package/esm/components/ContentLoader/IconsLoader.js +2 -1
- package/esm/components/Dialog/Dialog.js +4 -113
- package/esm/components/Drawer/Drawer.js +10 -141
- package/esm/components/Drawer/Header.js +5 -10
- package/esm/components/Dropdown/Dropdown.js +4 -40
- package/esm/components/Form/Form.js +2 -1
- package/esm/components/FormFieldPassword/PasswordMeter.js +4 -4
- package/esm/components/Overlay/Overlay.js +4 -3
- package/esm/components/Section/Section.js +2 -1
- package/esm/components/Skeleton/SkeletonText.js +1 -1
- package/esm/index.js +1 -1
- package/esm/utils/types/PolymorphicComponent.js +1 -0
- package/esm/utils/types/index.js +1 -0
- package/package.json +24 -23
- package/styleguide/build/bundle.70f167a3.js +2 -0
- package/styleguide/index.html +2 -2
- package/types/src/components/AutoClosable/AutoClosable.d.ts +2 -2
- package/types/src/components/Button/Button.d.ts +105 -0
- package/types/src/components/Button/index.d.ts +2 -0
- package/types/src/components/Dialog/Dialog.d.ts +126 -0
- package/types/src/components/Dialog/index.d.ts +2 -0
- package/types/src/components/Drawer/Drawer.d.ts +108 -0
- package/types/src/components/Drawer/DrawerProgress.d.ts +1 -1
- package/types/src/components/Drawer/Header.d.ts +28 -0
- package/types/src/components/Drawer/index.d.ts +2 -0
- package/types/src/components/Dropdown/Dropdown.d.ts +54 -0
- package/types/src/components/Form/Form.d.ts +11 -11
- package/types/src/components/Icon/Icon.d.ts +1 -1
- package/types/src/components/Icon/index.d.ts +1 -0
- package/types/src/components/Overlay/Overlay.d.ts +1 -1
- package/types/src/components/Overlay/index.d.ts +1 -0
- package/types/src/components/index.d.ts +3 -0
- package/types/src/utils/types/PolymorphicComponent.d.ts +11 -0
- package/types/src/utils/types/index.d.ts +1 -0
- package/styleguide/build/bundle.ad46084d.js +0 -2
- /package/styleguide/build/{bundle.ad46084d.js.LICENSE.txt → bundle.70f167a3.js.LICENSE.txt} +0 -0
package/styleguide/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
7
|
-
<title>Plesk UI Library 3.34.
|
|
7
|
+
<title>Plesk UI Library 3.34.2</title>
|
|
8
8
|
<meta name="msapplication-TileColor" content="#da532c">
|
|
9
9
|
<meta name="theme-color" content="#ffffff">
|
|
10
10
|
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KWST26V"
|
|
27
27
|
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
|
28
28
|
<!-- End Google Tag Manager (noscript) -->
|
|
29
|
-
<script src="build/bundle.
|
|
29
|
+
<script src="build/bundle.70f167a3.js"></script>
|
|
30
30
|
</body>
|
|
31
31
|
</html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ReactElement, ReactInstance, RefObject } from 'react';
|
|
1
|
+
import { Component, ReactElement, ReactInstance, RefObject, MutableRefObject } from 'react';
|
|
2
2
|
declare type AutoClosableProps = {
|
|
3
3
|
/**
|
|
4
4
|
* onClose handler
|
|
@@ -19,7 +19,7 @@ declare type AutoClosableProps = {
|
|
|
19
19
|
* A React reference to the DOM element that needs tracking outside clicks.
|
|
20
20
|
* @since 3.12.0
|
|
21
21
|
*/
|
|
22
|
-
nodeRef?: RefObject<HTMLElement>;
|
|
22
|
+
nodeRef?: RefObject<HTMLElement> | MutableRefObject<HTMLElement | undefined>;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* This is helper component for handling outside clicks.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ElementType, ReactNode, ReactElement } from 'react';
|
|
2
|
+
import { PolymorphicComponentPropsWithRef } from '../../utils/types';
|
|
3
|
+
import { IconName, IconProps } from '../Icon';
|
|
4
|
+
import '../../helpers/base.less';
|
|
5
|
+
import './Button.less';
|
|
6
|
+
interface BaseButtonPops {
|
|
7
|
+
/**
|
|
8
|
+
* Button size.
|
|
9
|
+
* @since 2.5.0
|
|
10
|
+
*/
|
|
11
|
+
size?: 'md' | 'lg';
|
|
12
|
+
/**
|
|
13
|
+
* Visual intent color to apply to component.
|
|
14
|
+
* @since 0.0.42
|
|
15
|
+
*/
|
|
16
|
+
intent?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info';
|
|
17
|
+
/**
|
|
18
|
+
* Display button with transparent background.
|
|
19
|
+
* @since 2.1.0
|
|
20
|
+
*/
|
|
21
|
+
ghost?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Arrow button.
|
|
24
|
+
* @since 2.6.0
|
|
25
|
+
*/
|
|
26
|
+
arrow?: 'forward' | 'backward';
|
|
27
|
+
/**
|
|
28
|
+
* Selected state of toggle button. Used in controlled component mode.
|
|
29
|
+
* @since 0.0.68
|
|
30
|
+
*/
|
|
31
|
+
selected?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Toggle button callback. Used in uncontrolled component mode.
|
|
34
|
+
* @since 0.0.68
|
|
35
|
+
*/
|
|
36
|
+
onToggle?: (state: boolean) => void;
|
|
37
|
+
/**
|
|
38
|
+
* State of the button
|
|
39
|
+
* @since 0.0.42
|
|
40
|
+
*/
|
|
41
|
+
state?: 'active' | 'loading' | 'hovered' | 'focused';
|
|
42
|
+
/**
|
|
43
|
+
* Is button disabled?
|
|
44
|
+
* @since 0.0.42
|
|
45
|
+
*/
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Tooltip for component
|
|
49
|
+
* @since 0.0.42
|
|
50
|
+
*/
|
|
51
|
+
tooltip?: ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* Name of icon or [Icon](#!/Icon) component
|
|
54
|
+
* @since 0.0.42
|
|
55
|
+
* @type IconName | IconProps | ReactNode
|
|
56
|
+
*/
|
|
57
|
+
icon?: IconName | IconProps | ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* Show caret
|
|
60
|
+
* @since 0.0.42
|
|
61
|
+
*/
|
|
62
|
+
caret?: boolean | ReactNode;
|
|
63
|
+
/**
|
|
64
|
+
* Dynamically expand the button to fill out the whole available width of its parent container.
|
|
65
|
+
* @since 1.8.0
|
|
66
|
+
*/
|
|
67
|
+
fill?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Content of the button
|
|
70
|
+
* @since 0.0.37
|
|
71
|
+
*/
|
|
72
|
+
children?: ReactNode;
|
|
73
|
+
/**
|
|
74
|
+
* @ignore
|
|
75
|
+
*/
|
|
76
|
+
className?: string;
|
|
77
|
+
/**
|
|
78
|
+
* @ignore
|
|
79
|
+
*/
|
|
80
|
+
baseClassName?: string;
|
|
81
|
+
}
|
|
82
|
+
declare type DataAttributes = {
|
|
83
|
+
[dataAttribute: `data-${string}`]: unknown;
|
|
84
|
+
};
|
|
85
|
+
export declare type ButtonProps<Component extends ElementType = 'button'> = {
|
|
86
|
+
/**
|
|
87
|
+
* Component to render as the root element. Useful when rendering a `Button` as `<a>` or `<Link>`.
|
|
88
|
+
* @since 0.0.42
|
|
89
|
+
* @type ElementType
|
|
90
|
+
* @default button
|
|
91
|
+
*/
|
|
92
|
+
component?: Component;
|
|
93
|
+
} & PolymorphicComponentPropsWithRef<Component, BaseButtonPops> & DataAttributes;
|
|
94
|
+
declare type ButtonComponent<Component extends ElementType = 'button'> = {
|
|
95
|
+
defaultProps?: Partial<ButtonProps<Component>>;
|
|
96
|
+
displayName?: string;
|
|
97
|
+
} & (<C extends ElementType = Component>(props: ButtonProps<C>) => ReactElement | null);
|
|
98
|
+
declare const _default: ButtonComponent<"button">;
|
|
99
|
+
/**
|
|
100
|
+
* `Button` component is used for executing actions, changing the application state, opening forms or dialog windows, and submitting data.
|
|
101
|
+
* As a rule, you should not use buttons for navigation between individual pages (use `Link` instead).
|
|
102
|
+
*
|
|
103
|
+
* Since: 0.0.37
|
|
104
|
+
*/
|
|
105
|
+
export default _default;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode, HTMLAttributes, ComponentProps, ReactElement, CSSProperties } from 'react';
|
|
2
|
+
import { OverlayProps } from '../Overlay';
|
|
3
|
+
import Form from '../Form';
|
|
4
|
+
import { ButtonProps } from '../Button';
|
|
5
|
+
import '../../helpers/base.less';
|
|
6
|
+
import './Dialog.less';
|
|
7
|
+
declare type ImageType = string | ReactElement | HTMLAttributes<HTMLImageElement>;
|
|
8
|
+
export declare type DialogProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Toggles visibility.
|
|
11
|
+
* @since 0.0.68
|
|
12
|
+
*/
|
|
13
|
+
isOpen?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Banner. Renders in front of content as wide as dialog.
|
|
16
|
+
* @type string | ReactElement | HTMLAttributes<HTMLImageElement>
|
|
17
|
+
* @since 0.0.68
|
|
18
|
+
*/
|
|
19
|
+
banner?: ImageType;
|
|
20
|
+
/**
|
|
21
|
+
* Image. Renders into content.
|
|
22
|
+
* @type string | ReactElement | HTMLAttributes<HTMLImageElement>
|
|
23
|
+
* @since 0.0.68
|
|
24
|
+
*/
|
|
25
|
+
image?: ImageType;
|
|
26
|
+
/**
|
|
27
|
+
* Block with an image, placed at the side of the component
|
|
28
|
+
* @type string | ReactElement | HTMLAttributes<HTMLImageElement>
|
|
29
|
+
* @since 3.25.0
|
|
30
|
+
*/
|
|
31
|
+
sideBanner?: ImageType;
|
|
32
|
+
/**
|
|
33
|
+
* Additional properties for the sideBanner
|
|
34
|
+
*
|
|
35
|
+
* @since 3.25.0
|
|
36
|
+
*/
|
|
37
|
+
sideBannerContainer?: {
|
|
38
|
+
background: string;
|
|
39
|
+
align: CSSProperties['alignItems'];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Title
|
|
43
|
+
* @since 0.0.68
|
|
44
|
+
*/
|
|
45
|
+
title?: ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* The subtitle of the `Dialog`.
|
|
48
|
+
* @since 4.0.0
|
|
49
|
+
*/
|
|
50
|
+
subtitle?: ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Title of "cancel" button
|
|
53
|
+
* @since 0.0.68
|
|
54
|
+
* @deprecated Use `cancelButton` instead.
|
|
55
|
+
*/
|
|
56
|
+
cancelTitle?: ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Cancel button visibility or custom configuration. It accepts all props of the `Button` component.
|
|
59
|
+
* @since 3.13.0
|
|
60
|
+
*/
|
|
61
|
+
cancelButton?: boolean | Partial<ButtonProps>;
|
|
62
|
+
/**
|
|
63
|
+
* Buttons except "cancel" button
|
|
64
|
+
* @since 0.0.68
|
|
65
|
+
*/
|
|
66
|
+
buttons?: ReactNode;
|
|
67
|
+
/**
|
|
68
|
+
* Actions which will be shown in Dialog header
|
|
69
|
+
* @since 1.2.0
|
|
70
|
+
*/
|
|
71
|
+
actions?: ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* Wraps children into [Form](#!/Form) if not empty.
|
|
74
|
+
* @type ComponentProps<typeof Form> | typeof Form
|
|
75
|
+
* @since 0.0.68
|
|
76
|
+
*/
|
|
77
|
+
form?: (Omit<ComponentProps<typeof Form>, 'values' | 'onSubmit'> & {
|
|
78
|
+
values?: any;
|
|
79
|
+
onSubmit?: any;
|
|
80
|
+
}) | typeof Form;
|
|
81
|
+
/**
|
|
82
|
+
* Dialog width
|
|
83
|
+
* @since 0.0.68
|
|
84
|
+
*/
|
|
85
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
86
|
+
/**
|
|
87
|
+
* If the value is false, the dialog cannot be closed and the Close button is hidden.
|
|
88
|
+
* @since 1.2.0
|
|
89
|
+
*/
|
|
90
|
+
closable?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Disable close dialog button
|
|
93
|
+
* @since 4.0.0
|
|
94
|
+
*/
|
|
95
|
+
canClose?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* On close event handler. Called immediately after dialog closed by "cancel" button or "Esc" key.
|
|
98
|
+
* @type () => void
|
|
99
|
+
* @since 0.0.68
|
|
100
|
+
*/
|
|
101
|
+
onClose?: () => void;
|
|
102
|
+
/**
|
|
103
|
+
* Whether show or not a confirmation dialog on close.
|
|
104
|
+
* @since 3.21.0
|
|
105
|
+
*/
|
|
106
|
+
closingConfirmation?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Content of the `DialogWindow`.
|
|
109
|
+
* @since 0.0.68
|
|
110
|
+
*/
|
|
111
|
+
children?: ReactNode;
|
|
112
|
+
/**
|
|
113
|
+
* @ignore
|
|
114
|
+
*/
|
|
115
|
+
className?: string;
|
|
116
|
+
/**
|
|
117
|
+
* @ignore
|
|
118
|
+
*/
|
|
119
|
+
baseClassName?: string;
|
|
120
|
+
} & Omit<OverlayProps, 'canCloseOnBackdropClick' | 'canCloseOnEscapePress'>;
|
|
121
|
+
/**
|
|
122
|
+
* `Dialog` is a modal window that asks users to make a decision or enter additional information.
|
|
123
|
+
* @since 0.0.68
|
|
124
|
+
*/
|
|
125
|
+
declare const Dialog: FunctionComponent<DialogProps>;
|
|
126
|
+
export default Dialog;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { ReactNode, ReactElement, HTMLAttributes, FunctionComponent, ComponentProps, CSSProperties } from 'react';
|
|
2
|
+
import Form from '../Form';
|
|
3
|
+
import { DrawerProgressProps } from './DrawerProgress';
|
|
4
|
+
import '../../helpers/base.less';
|
|
5
|
+
import './Drawer.less';
|
|
6
|
+
export interface DrawerProps {
|
|
7
|
+
/**
|
|
8
|
+
* Toggles visibility.
|
|
9
|
+
* @since 0.0.65
|
|
10
|
+
*/
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The title of the `Drawer`.
|
|
14
|
+
* @since 0.0.65
|
|
15
|
+
*/
|
|
16
|
+
title: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* The subtitle of the `Drawer`.
|
|
19
|
+
* @since 0.0.65
|
|
20
|
+
*/
|
|
21
|
+
subtitle?: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Show the minimize button and the inactive close button.
|
|
24
|
+
* @since 1.4.1
|
|
25
|
+
*/
|
|
26
|
+
hideButton?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Show back button in the header. If true the close button is not show.
|
|
29
|
+
* @deprecated Not recommended to use. Use default close button instead.
|
|
30
|
+
* @since 0.0.65
|
|
31
|
+
*/
|
|
32
|
+
backButton?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* A slot for `Tabs` component.
|
|
35
|
+
* @since 3.26.0
|
|
36
|
+
*/
|
|
37
|
+
tabs?: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Overlay placement.
|
|
40
|
+
* @since 0.0.65
|
|
41
|
+
*/
|
|
42
|
+
placement?: 'left' | 'right';
|
|
43
|
+
/**
|
|
44
|
+
* Overlay size.
|
|
45
|
+
* @since 0.0.65
|
|
46
|
+
*/
|
|
47
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
48
|
+
/**
|
|
49
|
+
* onClose handler.
|
|
50
|
+
* @since 0.0.65
|
|
51
|
+
*/
|
|
52
|
+
onClose?: () => void;
|
|
53
|
+
/**
|
|
54
|
+
* Whether show or not a confirmation dialog on close.
|
|
55
|
+
* @since 3.21.0
|
|
56
|
+
*/
|
|
57
|
+
closingConfirmation?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Wraps children into [Form](#!/Form) if not empty.<br>
|
|
60
|
+
* **Note:** in case of *element* you should take care of providing additional form props from [Drawer](#!/Drawer) through your custom component. See example below for more details
|
|
61
|
+
*
|
|
62
|
+
* @type ComponentProps<typeof Form> | typeof Form
|
|
63
|
+
* @since 0.0.66
|
|
64
|
+
*/
|
|
65
|
+
form?: (Omit<ComponentProps<typeof Form>, 'values' | 'onSubmit'> & {
|
|
66
|
+
values?: any;
|
|
67
|
+
onSubmit?: any;
|
|
68
|
+
}) | typeof Form;
|
|
69
|
+
/**
|
|
70
|
+
* Block with an image, placed at the side of the component
|
|
71
|
+
* @type string | ReactElement | HTMLAttributes<HTMLImageElement>
|
|
72
|
+
* @since 3.25.0
|
|
73
|
+
*/
|
|
74
|
+
sideBanner?: string | ReactElement | HTMLAttributes<HTMLImageElement>;
|
|
75
|
+
/**
|
|
76
|
+
* Additional properties for the sideBanner
|
|
77
|
+
* @since 3.25.0
|
|
78
|
+
*/
|
|
79
|
+
sideBannerContainer?: {
|
|
80
|
+
background: string;
|
|
81
|
+
align: CSSProperties['alignItems'];
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Content of the `Drawer`.
|
|
85
|
+
* @since 0.0.65
|
|
86
|
+
*/
|
|
87
|
+
children?: ReactNode;
|
|
88
|
+
/**
|
|
89
|
+
* Adds [Progress](#!/Progress) into footer.
|
|
90
|
+
* @since 1.11.0
|
|
91
|
+
*/
|
|
92
|
+
progress?: DrawerProgressProps;
|
|
93
|
+
/**
|
|
94
|
+
* @ignore
|
|
95
|
+
*/
|
|
96
|
+
className?: string;
|
|
97
|
+
/**
|
|
98
|
+
* @ignore
|
|
99
|
+
*/
|
|
100
|
+
baseClassName?: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* `Drawer` component is used for working with properties of an object (or system) without leaving the context of the object.
|
|
104
|
+
* [Read more when to use Drawer](#!/Drawers%2C%20pages%2C%20popovers).
|
|
105
|
+
* @since 0.0.65
|
|
106
|
+
*/
|
|
107
|
+
declare const Drawer: FunctionComponent<DrawerProps>;
|
|
108
|
+
export default Drawer;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Component, ReactNode } from 'react';
|
|
2
|
+
import './Header.less';
|
|
3
|
+
declare type HeaderProps = {
|
|
4
|
+
baseClassName?: string;
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
backButton?: boolean;
|
|
8
|
+
hideButton?: boolean;
|
|
9
|
+
tabs?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export default class Header extends Component<HeaderProps> {
|
|
12
|
+
static defaultProps: {
|
|
13
|
+
onClose: null;
|
|
14
|
+
baseClassName: string;
|
|
15
|
+
backButton: boolean;
|
|
16
|
+
hideButton: boolean;
|
|
17
|
+
tabs: undefined;
|
|
18
|
+
};
|
|
19
|
+
componentDidMount(): void;
|
|
20
|
+
private isRtl;
|
|
21
|
+
renderBackButton(): JSX.Element;
|
|
22
|
+
renderHideButton(): JSX.Element;
|
|
23
|
+
renderCloseButton({ disabled }?: {
|
|
24
|
+
disabled?: boolean | undefined;
|
|
25
|
+
}): JSX.Element;
|
|
26
|
+
render(): JSX.Element;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ReactNode, ReactElement, FunctionComponent, ReactChild } from 'react';
|
|
2
|
+
import '../../helpers/base.less';
|
|
3
|
+
import '../Menu/Menu.less';
|
|
4
|
+
import './Dropdown.less';
|
|
5
|
+
declare type PlacementSide = 'top' | 'right' | 'bottom' | 'left';
|
|
6
|
+
declare type PlacementAlign = 'start' | 'end';
|
|
7
|
+
export declare type PopoverPlacement = `${PlacementSide}-${PlacementAlign}` | PlacementSide | 'auto';
|
|
8
|
+
interface DropdownProps {
|
|
9
|
+
/**
|
|
10
|
+
* Dropdown [menu](#!/Menu).
|
|
11
|
+
* @type ReactElement
|
|
12
|
+
* @since 0.0.57
|
|
13
|
+
*/
|
|
14
|
+
menu: ReactElement;
|
|
15
|
+
/**
|
|
16
|
+
* Menu placement.
|
|
17
|
+
* @since 0.0.60
|
|
18
|
+
*/
|
|
19
|
+
menuPlacement?: PopoverPlacement;
|
|
20
|
+
/**
|
|
21
|
+
* Content of the `Dropdown`.
|
|
22
|
+
* @type ReactChild
|
|
23
|
+
* @since 0.0.57
|
|
24
|
+
*/
|
|
25
|
+
children: ReactChild;
|
|
26
|
+
/**
|
|
27
|
+
* Custom localization messages.
|
|
28
|
+
* @since 3.6.0
|
|
29
|
+
*/
|
|
30
|
+
locale?: {
|
|
31
|
+
close?: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Display menu as overlay.
|
|
35
|
+
* @ignore
|
|
36
|
+
*/
|
|
37
|
+
overlay?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* @ignore
|
|
40
|
+
*/
|
|
41
|
+
className?: string;
|
|
42
|
+
/**
|
|
43
|
+
* @ignore
|
|
44
|
+
*/
|
|
45
|
+
baseClassName?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* `Dropdown` component is a [Button](#!/Button) that opens a drop-down (nested) [Menu](#!/Menu).
|
|
49
|
+
* Use dropdown for grouping actions that are not used often or are less important than others -- in other words,
|
|
50
|
+
* for stuff that you don't want to show users all the time, especially if you have limited screen space.
|
|
51
|
+
* @since 0.0.57
|
|
52
|
+
*/
|
|
53
|
+
declare const Dropdown: FunctionComponent<DropdownProps>;
|
|
54
|
+
export default Dropdown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode,
|
|
2
|
-
import
|
|
1
|
+
import { ReactNode, ReactElement, MutableRefObject, HTMLProps } from 'react';
|
|
2
|
+
import { ButtonProps } from '../Button';
|
|
3
3
|
import { FormInstanceHandles, FormValues, FormErrors } from './types';
|
|
4
4
|
import './Form.less';
|
|
5
5
|
export declare type FormProps<FV extends FormValues> = {
|
|
@@ -38,17 +38,17 @@ export declare type FormProps<FV extends FormValues> = {
|
|
|
38
38
|
* Submit button visibility or custom configuration
|
|
39
39
|
* @since 0.0.58
|
|
40
40
|
*/
|
|
41
|
-
submitButton?: boolean | Partial<
|
|
41
|
+
submitButton?: boolean | Partial<ButtonProps>;
|
|
42
42
|
/**
|
|
43
43
|
* Apply button visibility or custom configuration
|
|
44
44
|
* @since 0.0.58
|
|
45
45
|
*/
|
|
46
|
-
applyButton?: boolean | Partial<
|
|
46
|
+
applyButton?: boolean | Partial<ButtonProps>;
|
|
47
47
|
/**
|
|
48
48
|
* Cancel button visibility or custom configuration
|
|
49
49
|
* @since 0.0.58
|
|
50
50
|
*/
|
|
51
|
-
cancelButton?: boolean | Partial<
|
|
51
|
+
cancelButton?: boolean | Partial<ButtonProps>;
|
|
52
52
|
/**
|
|
53
53
|
* Additional buttons
|
|
54
54
|
* @since 0.0.58
|
|
@@ -87,7 +87,7 @@ export declare type FormProps<FV extends FormValues> = {
|
|
|
87
87
|
* @ignore
|
|
88
88
|
*/
|
|
89
89
|
render?: (params: {
|
|
90
|
-
renderForm: (params
|
|
90
|
+
renderForm: (params?: {
|
|
91
91
|
actionButtons?: ReactNode;
|
|
92
92
|
}) => ReactElement;
|
|
93
93
|
renderActionButtons: () => ReactElement;
|
|
@@ -138,17 +138,17 @@ declare const RefForwardingForm: import("react").ForwardRefExoticComponent<{
|
|
|
138
138
|
* Submit button visibility or custom configuration
|
|
139
139
|
* @since 0.0.58
|
|
140
140
|
*/
|
|
141
|
-
submitButton?: boolean | Partial<
|
|
141
|
+
submitButton?: boolean | Partial<ButtonProps<"button">> | undefined;
|
|
142
142
|
/**
|
|
143
143
|
* Apply button visibility or custom configuration
|
|
144
144
|
* @since 0.0.58
|
|
145
145
|
*/
|
|
146
|
-
applyButton?: boolean | Partial<
|
|
146
|
+
applyButton?: boolean | Partial<ButtonProps<"button">> | undefined;
|
|
147
147
|
/**
|
|
148
148
|
* Cancel button visibility or custom configuration
|
|
149
149
|
* @since 0.0.58
|
|
150
150
|
*/
|
|
151
|
-
cancelButton?: boolean | Partial<
|
|
151
|
+
cancelButton?: boolean | Partial<ButtonProps<"button">> | undefined;
|
|
152
152
|
/**
|
|
153
153
|
* Additional buttons
|
|
154
154
|
* @since 0.0.58
|
|
@@ -187,9 +187,9 @@ declare const RefForwardingForm: import("react").ForwardRefExoticComponent<{
|
|
|
187
187
|
* @ignore
|
|
188
188
|
*/
|
|
189
189
|
render?: ((params: {
|
|
190
|
-
renderForm: (params
|
|
190
|
+
renderForm: (params?: {
|
|
191
191
|
actionButtons?: ReactNode;
|
|
192
|
-
}) => ReactElement;
|
|
192
|
+
} | undefined) => ReactElement;
|
|
193
193
|
renderActionButtons: () => ReactElement;
|
|
194
194
|
}) => ReactNode) | undefined;
|
|
195
195
|
/**
|
|
@@ -3,7 +3,7 @@ import { IconName } from './constants';
|
|
|
3
3
|
import '../../helpers/base.less';
|
|
4
4
|
import './Icon.less';
|
|
5
5
|
export * from './constants';
|
|
6
|
-
declare type IconSize = '12' | '16' | '24' | '32' | '48' | '64' | '96' | '128' | '192';
|
|
6
|
+
export declare type IconSize = '12' | '16' | '24' | '32' | '48' | '64' | '96' | '128' | '192';
|
|
7
7
|
export declare const ICON_SIZE_12: IconSize;
|
|
8
8
|
export declare const ICON_SIZE_16: IconSize;
|
|
9
9
|
export declare const ICON_SIZE_24: IconSize;
|
|
@@ -5,6 +5,7 @@ export { default as AuxiliaryActions } from './AuxiliaryActions';
|
|
|
5
5
|
export { default as Badge } from './Badge';
|
|
6
6
|
export { default as Breadcrumbs } from './Breadcrumbs';
|
|
7
7
|
export { default as Button } from './Button';
|
|
8
|
+
export type { ButtonProps } from './Button';
|
|
8
9
|
export { default as ButtonGroup } from './ButtonGroup';
|
|
9
10
|
export { default as Card } from './Card';
|
|
10
11
|
export * from './Card';
|
|
@@ -22,6 +23,7 @@ export { default as ContentLoader } from './ContentLoader';
|
|
|
22
23
|
export { default as Cuttable } from './Cuttable';
|
|
23
24
|
export { default as Dialog } from './Dialog';
|
|
24
25
|
export { default as Drawer } from './Drawer';
|
|
26
|
+
export type { DrawerProps } from './Drawer';
|
|
25
27
|
export { default as Dropdown } from './Dropdown';
|
|
26
28
|
export { default as InPlaceEdit } from './InPlaceEdit';
|
|
27
29
|
export { default as ExtendedStatusMessage } from './ExtendedStatusMessage';
|
|
@@ -41,6 +43,7 @@ export { default as GridCol } from './GridCol';
|
|
|
41
43
|
export { default as Heading } from './Heading';
|
|
42
44
|
export { default as Hint } from './Hint';
|
|
43
45
|
export { default as Icon } from './Icon';
|
|
46
|
+
export type { IconProps, IconName, IconSize } from './Icon';
|
|
44
47
|
export { default as Input } from './Input';
|
|
45
48
|
export { default as InputFile } from './InputFile';
|
|
46
49
|
export { default as InputNumber } from './InputNumber';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ElementType, ComponentPropsWithoutRef, ComponentPropsWithRef } from 'react';
|
|
2
|
+
declare type ComponentProp<C extends ElementType> = {
|
|
3
|
+
component?: C;
|
|
4
|
+
};
|
|
5
|
+
declare type PropsToOmit<C extends ElementType, P> = keyof (ComponentProp<C> & P);
|
|
6
|
+
export declare type PolymorphicComponentProps<C extends ElementType, Props = {}> = Props & ComponentProp<C> & Omit<ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
|
|
7
|
+
declare type PolymorphicRef<C extends ElementType> = ComponentPropsWithRef<C>['ref'];
|
|
8
|
+
export declare type PolymorphicComponentPropsWithRef<C extends ElementType, Props = {}> = PolymorphicComponentProps<C, Props> & {
|
|
9
|
+
ref?: PolymorphicRef<C>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { PolymorphicComponentProps, PolymorphicComponentPropsWithRef, } from './PolymorphicComponent';
|