@plesk/ui-library 3.34.1 → 3.35.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/cjs/components/ContentLoader/IconsLoader.js +1 -2
- package/cjs/components/Drawer/Drawer.js +10 -143
- package/cjs/components/Drawer/Header.js +5 -12
- package/cjs/components/Dropdown/Dropdown.js +0 -2
- package/cjs/components/Dropdown/index.js +15 -2
- package/cjs/components/Figure/Figure.js +1 -33
- package/cjs/components/Figure/index.js +15 -2
- package/cjs/components/Form/Form.js +3 -3
- package/cjs/components/Form/ScrollableElementFormContext.js +1 -1
- package/cjs/components/Form/index.js +19 -3
- package/cjs/components/FormFieldPassword/PasswordMeter.js +4 -4
- package/cjs/components/Icon/constants.js +2 -2
- package/cjs/components/Icon/images/symbols.svg +9 -1
- package/cjs/components/Link/Link.js +11 -18
- package/cjs/components/Overlay/Overlay.js +3 -4
- package/cjs/components/Popper/Popper.js +14 -79
- package/cjs/components/Popper/index.js +15 -2
- package/cjs/components/Section/Section.js +1 -2
- package/cjs/components/Skeleton/SkeletonText.js +1 -1
- package/cjs/components/SplitButton/SplitButton.js +10 -49
- package/cjs/components/SplitButton/index.js +15 -2
- package/cjs/components/index.js +2 -30
- package/cjs/components/utils.js +1 -1
- package/cjs/index.js +1 -1
- package/dist/images/symbols.svg +9 -1
- package/dist/plesk-ui-library-rtl.css.map +1 -1
- package/dist/plesk-ui-library.css.map +1 -1
- package/dist/plesk-ui-library.js +213 -461
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +2 -2
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/ContentLoader/IconsLoader.js +1 -2
- package/esm/components/Drawer/Drawer.js +10 -141
- package/esm/components/Drawer/Header.js +5 -10
- package/esm/components/Dropdown/Dropdown.js +0 -2
- package/esm/components/Dropdown/index.js +2 -1
- package/esm/components/Figure/Figure.js +1 -33
- package/esm/components/Figure/index.js +2 -1
- package/esm/components/Form/Form.js +3 -3
- package/esm/components/Form/ScrollableElementFormContext.js +1 -1
- package/esm/components/Form/index.js +1 -0
- package/esm/components/FormFieldPassword/PasswordMeter.js +4 -4
- package/esm/components/Icon/constants.js +2 -2
- package/esm/components/Icon/images/symbols.svg +9 -1
- package/esm/components/Link/Link.js +11 -18
- package/esm/components/Overlay/Overlay.js +3 -4
- package/esm/components/Popper/Popper.js +14 -79
- package/esm/components/Popper/index.js +2 -1
- package/esm/components/Section/Section.js +1 -2
- package/esm/components/Skeleton/SkeletonText.js +1 -1
- package/esm/components/SplitButton/SplitButton.js +10 -47
- package/esm/components/SplitButton/index.js +2 -1
- package/esm/components/index.js +2 -2
- package/esm/components/utils.js +1 -1
- package/esm/index.js +1 -1
- package/package.json +10 -13
- package/styleguide/build/bundle.2a886a79.js +2 -0
- package/styleguide/images/symbols.svg +9 -1
- package/styleguide/index.html +2 -2
- package/types/src/components/Button/Button.d.ts +4 -1
- package/types/src/components/ButtonGroup/ButtonGroup.d.ts +2 -2
- package/types/src/components/Dialog/Dialog.d.ts +29 -6
- package/types/src/components/Drawer/Drawer.d.ts +106 -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 +3 -4
- package/types/src/components/Dropdown/index.d.ts +2 -0
- package/types/src/components/Figure/Figure.d.ts +28 -0
- package/types/src/components/Figure/index.d.ts +2 -0
- package/types/src/components/Form/Form.d.ts +9 -104
- package/types/src/components/Form/ScrollableElementFormContext.d.ts +2 -0
- package/types/src/components/Form/index.d.ts +1 -0
- package/types/src/components/Form/types.d.ts +5 -3
- package/types/src/components/Icon/constants.d.ts +1 -1
- package/types/src/components/Link/Link.d.ts +14 -12
- package/types/src/components/Link/index.d.ts +1 -0
- package/types/src/components/Overlay/Overlay.d.ts +1 -1
- package/types/src/components/Popper/Popper.d.ts +96 -0
- package/types/src/components/Popper/index.d.ts +2 -0
- package/types/src/components/SplitButton/SplitButton.d.ts +53 -0
- package/types/src/components/SplitButton/index.d.ts +2 -0
- package/types/src/components/index.d.ts +11 -2
- package/types/src/components/utils.d.ts +6 -4
- package/dist/.DS_Store +0 -0
- package/dist/images/default.svg +0 -1
- package/dist/images/filtered.svg +0 -1
- package/styleguide/build/bundle.c6ebacd7.js +0 -2
- /package/styleguide/build/{bundle.c6ebacd7.js.LICENSE.txt → bundle.2a886a79.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg width="16" height="
|
|
1
|
+
<svg width="16" height="11760" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
2
2
|
<defs>
|
|
3
3
|
<symbol viewBox="0 0 12 12" id="archive:12">
|
|
4
4
|
<path d="M2 1h7v.5a.5.5 0 0 0 1 0V1a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1v-.5a.5.5 0 0 0-1 0v.5H2V1z" />
|
|
@@ -181,6 +181,14 @@
|
|
|
181
181
|
<path d="M4.145 11.855a.496.496 0 0 1 0-.702L13.298 2H9.5a.5.5 0 0 1 0-1h5.002a.495.495 0 0 1 .498.5v5a.5.5 0 0 1-1 0V2.702l-9.153 9.153a.496.496 0 0 1-.702 0z" />
|
|
182
182
|
<path d="M1.5 15a.5.5 0 0 1-.5-.5v-13a.5.5 0 0 1 1 0V14h12.5a.5.5 0 0 1 0 1h-13z" />
|
|
183
183
|
</symbol>
|
|
184
|
+
<symbol viewBox="0 0 12 12" id="bar-chart-vertical-lock:12">
|
|
185
|
+
<path d="M4 .5a.5.5 0 0 1 1 0v9a.5.5 0 0 1-1 0v-9zM1.5 5a.5.5 0 0 0-.5.5v4a.5.5 0 0 0 1 0v-4a.5.5 0 0 0-.5-.5zM.5 11a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5zM7.5 3a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 1 0v-1a.5.5 0 0 0-.5-.5zM10 1.5a.5.5 0 0 1 1 0v3a.5.5 0 0 1-1 0v-3z" />
|
|
186
|
+
<path d="M7 9a1 1 0 0 1 1-1V7a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V9zm3-1V7H9v1h1z" />
|
|
187
|
+
</symbol>
|
|
188
|
+
<symbol viewBox="0 0 16 16" id="bar-chart-vertical-lock:16">
|
|
189
|
+
<path d="M13 .5a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0v-7zM4.5 2a.5.5 0 0 0-.5.5v11a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-.5-.5zM1 9.5a.5.5 0 0 1 1 0v4a.5.5 0 0 1-1 0v-4zm-1 6a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 0 1h-8a.5.5 0 0 1-.5-.5zm7-9a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0v-7zM10.5 4a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 1 0v-3a.5.5 0 0 0-.5-.5z" />
|
|
190
|
+
<path d="M10 12a1 1 0 0 1 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1v-3zm3-1v-1h-1v1h1z" />
|
|
191
|
+
</symbol>
|
|
184
192
|
<symbol viewBox="0 0 12 12" id="bar-chart-vertical:12">
|
|
185
193
|
<path d="M0 11.5a.5.5 0 01.5-.5h11a.5.5 0 010 1H.5a.5.5 0 01-.5-.5zM1 5.5a.5.5 0 011 0v4a.5.5 0 01-1 0v-4zM4 .5a.5.5 0 011 0v9a.5.5 0 01-1 0v-9zM7 4.5a.5.5 0 011 0v5a.5.5 0 01-1 0v-5zM10 2.5a.5.5 0 011 0v7a.5.5 0 01-1 0v-7z" />
|
|
186
194
|
</symbol>
|
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.
|
|
7
|
+
<title>Plesk UI Library 3.35.0</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.2a886a79.js"></script>
|
|
30
30
|
</body>
|
|
31
31
|
</html>
|
|
@@ -79,6 +79,9 @@ interface BaseButtonPops {
|
|
|
79
79
|
*/
|
|
80
80
|
baseClassName?: string;
|
|
81
81
|
}
|
|
82
|
+
declare type DataAttributes = {
|
|
83
|
+
[dataAttribute: `data-${string}`]: unknown;
|
|
84
|
+
};
|
|
82
85
|
export declare type ButtonProps<Component extends ElementType = 'button'> = {
|
|
83
86
|
/**
|
|
84
87
|
* Component to render as the root element. Useful when rendering a `Button` as `<a>` or `<Link>`.
|
|
@@ -87,7 +90,7 @@ export declare type ButtonProps<Component extends ElementType = 'button'> = {
|
|
|
87
90
|
* @default button
|
|
88
91
|
*/
|
|
89
92
|
component?: Component;
|
|
90
|
-
} & PolymorphicComponentPropsWithRef<Component, BaseButtonPops
|
|
93
|
+
} & PolymorphicComponentPropsWithRef<Component, BaseButtonPops> & DataAttributes;
|
|
91
94
|
declare type ButtonComponent<Component extends ElementType = 'button'> = {
|
|
92
95
|
defaultProps?: Partial<ButtonProps<Component>>;
|
|
93
96
|
displayName?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionComponent, ReactNode, Ref } from 'react';
|
|
1
|
+
import { FunctionComponent, ReactNode, Ref, HTMLAttributes } from 'react';
|
|
2
2
|
import './ButtonGroup.less';
|
|
3
3
|
declare type ButtonGroupProps = {
|
|
4
4
|
/**
|
|
@@ -18,7 +18,7 @@ declare type ButtonGroupProps = {
|
|
|
18
18
|
* @ignore
|
|
19
19
|
*/
|
|
20
20
|
innerRef?: Ref<HTMLDivElement>;
|
|
21
|
-
}
|
|
21
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
22
22
|
/**
|
|
23
23
|
* `ButtonGroup` component is used for visual grouping of several [Buttons](#!/Button) together.
|
|
24
24
|
* @since 0.0.37
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode, HTMLAttributes, ReactElement, CSSProperties } from 'react';
|
|
2
2
|
import { OverlayProps } from '../Overlay';
|
|
3
|
-
import Form from '../Form';
|
|
3
|
+
import Form, { FormProps, FormValues } from '../Form';
|
|
4
4
|
import { ButtonProps } from '../Button';
|
|
5
5
|
import '../../helpers/base.less';
|
|
6
6
|
import './Dialog.less';
|
|
7
7
|
declare type ImageType = string | ReactElement | HTMLAttributes<HTMLImageElement>;
|
|
8
|
-
export declare type DialogProps = {
|
|
8
|
+
export declare type DialogProps<FV extends FormValues = FormValues> = {
|
|
9
9
|
/**
|
|
10
10
|
* Toggles visibility.
|
|
11
11
|
* @since 0.0.68
|
|
@@ -71,10 +71,9 @@ export declare type DialogProps = {
|
|
|
71
71
|
actions?: ReactNode;
|
|
72
72
|
/**
|
|
73
73
|
* Wraps children into [Form](#!/Form) if not empty.
|
|
74
|
-
* @type ComponentProps<typeof Form> | typeof Form
|
|
75
74
|
* @since 0.0.68
|
|
76
75
|
*/
|
|
77
|
-
form?:
|
|
76
|
+
form?: FormProps<FV> | typeof Form;
|
|
78
77
|
/**
|
|
79
78
|
* Dialog width
|
|
80
79
|
* @since 0.0.68
|
|
@@ -119,5 +118,29 @@ export declare type DialogProps = {
|
|
|
119
118
|
* `Dialog` is a modal window that asks users to make a decision or enter additional information.
|
|
120
119
|
* @since 0.0.68
|
|
121
120
|
*/
|
|
122
|
-
declare const Dialog:
|
|
121
|
+
declare const Dialog: {
|
|
122
|
+
<FV extends FormValues = FormValues>({ baseClassName, className, children, actions, isOpen, banner, image, title, subtitle, cancelTitle, cancelButton, buttons, form, size, closable, onClose, closingConfirmation, canClose, ...props }: DialogProps<FV>): JSX.Element;
|
|
123
|
+
defaultProps: {
|
|
124
|
+
isOpen: boolean;
|
|
125
|
+
banner: undefined;
|
|
126
|
+
sideBanner: undefined;
|
|
127
|
+
sideBannerContainer: undefined;
|
|
128
|
+
image: undefined;
|
|
129
|
+
title: undefined;
|
|
130
|
+
subtitle: undefined;
|
|
131
|
+
cancelTitle: undefined;
|
|
132
|
+
cancelButton: undefined;
|
|
133
|
+
buttons: undefined;
|
|
134
|
+
actions: undefined;
|
|
135
|
+
form: undefined;
|
|
136
|
+
size: string;
|
|
137
|
+
closable: boolean;
|
|
138
|
+
canClose: boolean;
|
|
139
|
+
onClose: undefined;
|
|
140
|
+
closingConfirmation: undefined;
|
|
141
|
+
children: undefined;
|
|
142
|
+
className: undefined;
|
|
143
|
+
baseClassName: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
123
146
|
export default Dialog;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { ReactNode, ReactElement, HTMLAttributes, CSSProperties } from 'react';
|
|
2
|
+
import Form, { FormProps, FormValues } from '../Form';
|
|
3
|
+
import { DrawerProgressProps } from './DrawerProgress';
|
|
4
|
+
import '../../helpers/base.less';
|
|
5
|
+
import './Drawer.less';
|
|
6
|
+
export interface DrawerProps<FV extends FormValues = FormValues> {
|
|
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
|
+
* @since 0.0.66
|
|
62
|
+
*/
|
|
63
|
+
form?: FormProps<FV> | typeof Form;
|
|
64
|
+
/**
|
|
65
|
+
* Block with an image, placed at the side of the component
|
|
66
|
+
* @type string | ReactElement | HTMLAttributes<HTMLImageElement>
|
|
67
|
+
* @since 3.25.0
|
|
68
|
+
*/
|
|
69
|
+
sideBanner?: string | ReactElement | HTMLAttributes<HTMLImageElement>;
|
|
70
|
+
/**
|
|
71
|
+
* Additional properties for the sideBanner
|
|
72
|
+
* @since 3.25.0
|
|
73
|
+
*/
|
|
74
|
+
sideBannerContainer?: {
|
|
75
|
+
background: string;
|
|
76
|
+
align?: CSSProperties['alignItems'];
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Content of the `Drawer`.
|
|
80
|
+
* @since 0.0.65
|
|
81
|
+
*/
|
|
82
|
+
children?: ReactNode;
|
|
83
|
+
/**
|
|
84
|
+
* Adds [Progress](#!/Progress) into footer.
|
|
85
|
+
* @since 1.11.0
|
|
86
|
+
*/
|
|
87
|
+
progress?: DrawerProgressProps | null;
|
|
88
|
+
/**
|
|
89
|
+
* @ignore
|
|
90
|
+
*/
|
|
91
|
+
className?: string;
|
|
92
|
+
/**
|
|
93
|
+
* @ignore
|
|
94
|
+
*/
|
|
95
|
+
baseClassName?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* `Drawer` component is used for working with properties of an object (or system) without leaving the context of the object.
|
|
99
|
+
* [Read more when to use Drawer](#!/Drawers%2C%20pages%2C%20popovers).
|
|
100
|
+
* @since 0.0.65
|
|
101
|
+
*/
|
|
102
|
+
declare const Drawer: {
|
|
103
|
+
<FV extends FormValues = FormValues>({ baseClassName, className, children, title, subtitle, backButton, hideButton, tabs, onClose, form, progress, closingConfirmation, ...props }: DrawerProps<FV>): JSX.Element;
|
|
104
|
+
defaultProps: Partial<DrawerProps<FormValues>>;
|
|
105
|
+
};
|
|
106
|
+
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 {};
|
|
@@ -2,10 +2,9 @@ import { ReactNode, ReactElement, FunctionComponent, ReactChild } from 'react';
|
|
|
2
2
|
import '../../helpers/base.less';
|
|
3
3
|
import '../Menu/Menu.less';
|
|
4
4
|
import './Dropdown.less';
|
|
5
|
-
|
|
6
|
-
declare type
|
|
7
|
-
export
|
|
8
|
-
interface DropdownProps {
|
|
5
|
+
import { Placement } from 'popper.js';
|
|
6
|
+
export declare type PopoverPlacement = Placement;
|
|
7
|
+
export interface DropdownProps {
|
|
9
8
|
/**
|
|
10
9
|
* Dropdown [menu](#!/Menu).
|
|
11
10
|
* @type ReactElement
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import './Figure.less';
|
|
3
|
+
export interface FigureProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* External link
|
|
6
|
+
* @since 0.0.42
|
|
7
|
+
*/
|
|
8
|
+
href?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Bottom content
|
|
11
|
+
* @since 0.0.42
|
|
12
|
+
*/
|
|
13
|
+
caption?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* @ignore
|
|
16
|
+
*/
|
|
17
|
+
baseClassName?: string;
|
|
18
|
+
/**
|
|
19
|
+
* @ignore
|
|
20
|
+
*/
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Figure component.
|
|
25
|
+
* @since 0.0.42
|
|
26
|
+
*/
|
|
27
|
+
declare const Figure: ({ baseClassName, className, href, caption, children, ...props }: FigureProps) => JSX.Element;
|
|
28
|
+
export default Figure;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, ReactElement, MutableRefObject, HTMLProps } from 'react';
|
|
1
|
+
import { ReactNode, ReactElement, MutableRefObject, HTMLProps, ForwardedRef } from 'react';
|
|
2
2
|
import { ButtonProps } from '../Button';
|
|
3
3
|
import { FormInstanceHandles, FormValues, FormErrors } from './types';
|
|
4
4
|
import './Form.less';
|
|
@@ -58,7 +58,7 @@ export declare type FormProps<FV extends FormValues> = {
|
|
|
58
58
|
* A callback function, can be executed when some field value is changing.
|
|
59
59
|
* @since 3.1.0
|
|
60
60
|
*/
|
|
61
|
-
onFieldChange?: (name:
|
|
61
|
+
onFieldChange?: <Key extends keyof FV>(name: Key, value: FV[Key]) => void;
|
|
62
62
|
/**
|
|
63
63
|
* Submit handler
|
|
64
64
|
* @since 0.0.54
|
|
@@ -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;
|
|
@@ -97,104 +97,9 @@ export declare type FormProps<FV extends FormValues> = {
|
|
|
97
97
|
*/
|
|
98
98
|
innerRef?: MutableRefObject<null | HTMLFormElement>;
|
|
99
99
|
} & Omit<HTMLProps<HTMLFormElement>, 'onSubmit' | 'ref'>;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Required mark.
|
|
108
|
-
* @since 0.0.54
|
|
109
|
-
*/
|
|
110
|
-
requiredMark?: ReactNode;
|
|
111
|
-
/**
|
|
112
|
-
* Hide required legend.
|
|
113
|
-
* @ignore
|
|
114
|
-
* @deprecated
|
|
115
|
-
*/
|
|
116
|
-
hideRequiredLegend?: boolean | undefined;
|
|
117
|
-
/**
|
|
118
|
-
* Form values.
|
|
119
|
-
* @since 0.0.57
|
|
120
|
-
*/
|
|
121
|
-
values?: FormValues | undefined;
|
|
122
|
-
/**
|
|
123
|
-
* Form errors.
|
|
124
|
-
* @since 0.0.57
|
|
125
|
-
*/
|
|
126
|
-
errors?: FormErrors | undefined;
|
|
127
|
-
/**
|
|
128
|
-
* Current active state
|
|
129
|
-
* @since 0.0.59
|
|
130
|
-
*/
|
|
131
|
-
state?: "cancel" | "submit" | "apply" | undefined;
|
|
132
|
-
/**
|
|
133
|
-
* Content of the `Form`.
|
|
134
|
-
* @since 0.0.54
|
|
135
|
-
*/
|
|
136
|
-
children?: ReactNode;
|
|
137
|
-
/**
|
|
138
|
-
* Submit button visibility or custom configuration
|
|
139
|
-
* @since 0.0.58
|
|
140
|
-
*/
|
|
141
|
-
submitButton?: boolean | Partial<ButtonProps<"button">> | undefined;
|
|
142
|
-
/**
|
|
143
|
-
* Apply button visibility or custom configuration
|
|
144
|
-
* @since 0.0.58
|
|
145
|
-
*/
|
|
146
|
-
applyButton?: boolean | Partial<ButtonProps<"button">> | undefined;
|
|
147
|
-
/**
|
|
148
|
-
* Cancel button visibility or custom configuration
|
|
149
|
-
* @since 0.0.58
|
|
150
|
-
*/
|
|
151
|
-
cancelButton?: boolean | Partial<ButtonProps<"button">> | undefined;
|
|
152
|
-
/**
|
|
153
|
-
* Additional buttons
|
|
154
|
-
* @since 0.0.58
|
|
155
|
-
*/
|
|
156
|
-
additionalButtons?: ReactNode[] | undefined;
|
|
157
|
-
/**
|
|
158
|
-
* A callback function, can be executed when some field value is changing.
|
|
159
|
-
* @since 3.1.0
|
|
160
|
-
*/
|
|
161
|
-
onFieldChange?: ((name: string, value: any) => void) | undefined;
|
|
162
|
-
/**
|
|
163
|
-
* Submit handler
|
|
164
|
-
* @since 0.0.54
|
|
165
|
-
*/
|
|
166
|
-
onSubmit?: ((values: FormValues, isApply?: boolean | undefined) => void) | undefined;
|
|
167
|
-
/**
|
|
168
|
-
* Additional class name for the buttons container.
|
|
169
|
-
* @since 0.0.66
|
|
170
|
-
*/
|
|
171
|
-
footerClassName?: string | undefined;
|
|
172
|
-
/**
|
|
173
|
-
* Form responsive view will be switched automatically.
|
|
174
|
-
* Specify this parameter explicitly if you want disable this behaviour and choice vertical or horizontal form view.
|
|
175
|
-
* @since 0.4.1
|
|
176
|
-
*/
|
|
177
|
-
vertical?: boolean | undefined;
|
|
178
|
-
/**
|
|
179
|
-
* @ignore
|
|
180
|
-
*/
|
|
181
|
-
className?: string | undefined;
|
|
182
|
-
/**
|
|
183
|
-
* @ignore
|
|
184
|
-
*/
|
|
185
|
-
baseClassName?: string | undefined;
|
|
186
|
-
/**
|
|
187
|
-
* @ignore
|
|
188
|
-
*/
|
|
189
|
-
render?: ((params: {
|
|
190
|
-
renderForm: (params: {
|
|
191
|
-
actionButtons?: ReactNode;
|
|
192
|
-
}) => ReactElement;
|
|
193
|
-
renderActionButtons: () => ReactElement;
|
|
194
|
-
}) => ReactNode) | undefined;
|
|
195
|
-
/**
|
|
196
|
-
* @ignore
|
|
197
|
-
*/
|
|
198
|
-
innerRef?: MutableRefObject<HTMLFormElement | null> | undefined;
|
|
199
|
-
} & Omit<HTMLProps<HTMLFormElement>, "ref" | "onSubmit"> & import("react").RefAttributes<FormInstanceHandles>>;
|
|
200
|
-
export default RefForwardingForm;
|
|
100
|
+
export type { FormValues, FormInstanceHandles };
|
|
101
|
+
declare type FormComponent = <FV extends FormValues>(props: FormProps<FV> & {
|
|
102
|
+
ref?: ForwardedRef<FormInstanceHandles>;
|
|
103
|
+
}) => ReactElement;
|
|
104
|
+
declare const _default: FormComponent;
|
|
105
|
+
export default _default;
|
|
@@ -3,6 +3,7 @@ export declare type FormInstanceHandles = {
|
|
|
3
3
|
submit: () => void;
|
|
4
4
|
};
|
|
5
5
|
export declare type FormValues = Record<string, any>;
|
|
6
|
+
export declare type FormFieldErrors = Record<string, any>;
|
|
6
7
|
export declare type FormErrors = Record<string, any>;
|
|
7
8
|
export declare type FormState<FV> = {
|
|
8
9
|
values?: FV;
|
|
@@ -13,6 +14,9 @@ export declare type FormState<FV> = {
|
|
|
13
14
|
prevErrors?: FormErrors;
|
|
14
15
|
prevRequiredMark?: ReactNode;
|
|
15
16
|
};
|
|
17
|
+
export declare type Field = {
|
|
18
|
+
focus: (errors: FormFieldErrors) => void;
|
|
19
|
+
};
|
|
16
20
|
export declare type FormContextProps = {
|
|
17
21
|
getValues: () => Readonly<FormValues> | undefined;
|
|
18
22
|
getValue: (name: string, def?: any) => any;
|
|
@@ -21,9 +25,7 @@ export declare type FormContextProps = {
|
|
|
21
25
|
[key: string]: any;
|
|
22
26
|
};
|
|
23
27
|
setRequiredField: (name: string, required: boolean) => void;
|
|
24
|
-
registerField: (name: string, field:
|
|
25
|
-
focus: () => void;
|
|
26
|
-
}) => void;
|
|
28
|
+
registerField: (name: string, field: Field) => void;
|
|
27
29
|
unregisterField: (name: string) => void;
|
|
28
30
|
getRequiredMark: () => ReactNode;
|
|
29
31
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const NAMES_12: IconName[];
|
|
2
|
-
export declare type IconName = 'archive' | 'arrow-back' | 'arrow-diagonal-out' | 'arrow-down' | 'arrow-down-in' | 'arrow-down-out' | 'arrow-down-tray' | 'arrow-left' | 'arrow-right' | 'arrow-right-in' | 'arrow-right-out' | 'arrow-up' | 'arrow-up-circle' | 'arrow-up-in' | 'arrow-up-in-cloud' | 'arrow-up-out' | 'arrow-up-tray' | 'arrows-four-directions' | 'arrows-inward' | 'arrows-loop' | 'arrows-opposite' | 'arrows-outward' | 'backup' | 'backup2' | 'bar-chart-vertical' | 'bar-chart-vertical-arrow-up' | 'bell' | 'book-email' | 'boundary' | 'box-diagonal-bottom-in' | 'box-diagonal-top-in' | 'brush' | 'bug' | 'calendar' | 'calendar-clock' | 'camera' | 'card' | 'card-ribbon' | 'card-row' | 'card-tile' | 'cd' | 'cd-up-in-cloud' | 'chain' | 'chain-broken' | 'chat' | 'check-list' | 'check-mark' | 'check-mark-circle' | 'check-mark-circle-filled' | 'chevron-double-down' | 'chevron-double-up' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'chevron-up' | 'circle-diagonal' | 'clean' | 'clip' | 'clock' | 'clone' | 'cloud' | 'cloud-checkmark' | 'cloud-crossed' | 'cloud-graph' | 'code' | 'connection' | 'console' | 'console-filled' | 'copy' | 'copy-indicator' | 'cpu' | 'crane' | 'credit-cards' | 'cross-mark' | 'cross-mark-circle' | 'cross-mark-circle-filled' | 'crown-transfer' | 'dashboard' | 'database' | 'database-box' | 'database-filled' | 'database-plus' | 'deploy' | 'docker-filled' | 'dollar' | 'dollar-filled' | 'dot' | 'emoticon-confused' | 'emoticon-dead' | 'emoticon-excited' | 'emoticon-happy' | 'emoticon-neutral' | 'emoticon-sad' | 'emoticon-smile' | 'enter' | 'exclamation-mark-circle' | 'exclamation-mark-circle-filled' | 'eye' | 'eye-closed' | 'facebook' | 'facebook-filled' | 'feedback' | 'filter' | 'filter-check-mark' | 'fire' | 'flag' | 'flag-filled' | 'flag-globe' | 'floppy-disk' | 'folder-closed' | 'folder-key' | 'folder-network' | 'folder-open' | 'folders-tree' | 'forward-circle-filled' | 'four-squares' | 'gear' | 'git' | 'github' | 'globe' | 'hard-drive' | 'hard-drive-key' | 'hat' | 'hexagons' | 'home' | 'info-circle' | 'info-circle-filled' | 'ip-addresses' | 'joomla' | 'kebab' | 'key' | 'laravel' | 'lifebuoy' | 'lightbulb' | 'limit' | 'linux' | 'list' | 'list-check-mark' | 'location' | 'lock-closed' | 'lock-closed-check' | 'lock-closed-filled' | 'lock-open' | 'lock-open-cross' | 'lock-open-filled' | 'mail' | 'mail-circle-filled' | 'mail-settings' | 'megaphone' | 'menu' | 'menu-thin' | 'microsoft' | 'minimize' | 'minus' | 'minus-circle' | 'minus-circle-filled' | 'monitoring' | 'monitoring-off' | 'my-little-admin' | 'net' | 'nine-dots' | 'node-js' | 'package' | 'panel' | 'panel-check' | 'panel-eye' | 'panel-key' | 'panel-settings' | 'panels' | 'pause-circle' | 'pencil' | 'pencil-dialog' | 'php' | 'phpmyadmin' | 'pin' | 'pipette' | 'plans' | 'plugins' | 'plus' | 'power' | 'projects' | 'puzzle' | 'question-mark-circle' | 'question-mark-circle-filled' | 'ram' | 'react-js' | 'recycle' | 'redirect-circle-filled' | 'refresh' | 'reload' | 'remove' | 'reset' | 'resource' | 'ribbon' | 'rocket' | 'ruby' | 'sand-clock' | 'scan' | 'screen' | 'search' | 'security-check' | 'send' | 'server' | 'servers' | 'share' | 'shield' | 'shield-attention-filled' | 'shield-chain' | 'shield-filled' | 'shopping-cart' | 'sidebar-right-hide' | 'sidebar-right-show' | 'signal-light' | 'site-page' | 'sleep' | 'sliders' | 'square-with-circles' | 'star' | 'star-circle-filled' | 'star-filled' | 'star-half-filled' | 'start' | 'start-circle' | 'start-filled' | 'stop' | 'stop-circle' | 'storage' | 'themes' | 'three-dots-horizontal' | 'three-dots-vertical' | 'tools' | 'transfer' | 'triangle-exclamation-mark' | 'triangle-exclamation-mark-filled' | 'unarchive' | 'user' | 'volume' | 'web' | 'web-plus' | 'web-settings' | 'windows' | 'woocommerce' | 'wordpress' | 'zero-circle-filled';
|
|
2
|
+
export declare type IconName = 'archive' | 'arrow-back' | 'arrow-diagonal-out' | 'arrow-down' | 'arrow-down-in' | 'arrow-down-out' | 'arrow-down-tray' | 'arrow-left' | 'arrow-right' | 'arrow-right-in' | 'arrow-right-out' | 'arrow-up' | 'arrow-up-circle' | 'arrow-up-in' | 'arrow-up-in-cloud' | 'arrow-up-out' | 'arrow-up-tray' | 'arrows-four-directions' | 'arrows-inward' | 'arrows-loop' | 'arrows-opposite' | 'arrows-outward' | 'backup' | 'backup2' | 'bar-chart-vertical' | 'bar-chart-vertical-arrow-up' | 'bar-chart-vertical-lock' | 'bell' | 'book-email' | 'boundary' | 'box-diagonal-bottom-in' | 'box-diagonal-top-in' | 'brush' | 'bug' | 'calendar' | 'calendar-clock' | 'camera' | 'card' | 'card-ribbon' | 'card-row' | 'card-tile' | 'cd' | 'cd-up-in-cloud' | 'chain' | 'chain-broken' | 'chat' | 'check-list' | 'check-mark' | 'check-mark-circle' | 'check-mark-circle-filled' | 'chevron-double-down' | 'chevron-double-up' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'chevron-up' | 'circle-diagonal' | 'clean' | 'clip' | 'clock' | 'clone' | 'cloud' | 'cloud-checkmark' | 'cloud-crossed' | 'cloud-graph' | 'code' | 'connection' | 'console' | 'console-filled' | 'copy' | 'copy-indicator' | 'cpu' | 'crane' | 'credit-cards' | 'cross-mark' | 'cross-mark-circle' | 'cross-mark-circle-filled' | 'crown-transfer' | 'dashboard' | 'database' | 'database-box' | 'database-filled' | 'database-plus' | 'deploy' | 'docker-filled' | 'dollar' | 'dollar-filled' | 'dot' | 'emoticon-confused' | 'emoticon-dead' | 'emoticon-excited' | 'emoticon-happy' | 'emoticon-neutral' | 'emoticon-sad' | 'emoticon-smile' | 'enter' | 'exclamation-mark-circle' | 'exclamation-mark-circle-filled' | 'eye' | 'eye-closed' | 'facebook' | 'facebook-filled' | 'feedback' | 'filter' | 'filter-check-mark' | 'fire' | 'flag' | 'flag-filled' | 'flag-globe' | 'floppy-disk' | 'folder-closed' | 'folder-key' | 'folder-network' | 'folder-open' | 'folders-tree' | 'forward-circle-filled' | 'four-squares' | 'gear' | 'git' | 'github' | 'globe' | 'hard-drive' | 'hard-drive-key' | 'hat' | 'hexagons' | 'home' | 'info-circle' | 'info-circle-filled' | 'ip-addresses' | 'joomla' | 'kebab' | 'key' | 'laravel' | 'lifebuoy' | 'lightbulb' | 'limit' | 'linux' | 'list' | 'list-check-mark' | 'location' | 'lock-closed' | 'lock-closed-check' | 'lock-closed-filled' | 'lock-open' | 'lock-open-cross' | 'lock-open-filled' | 'mail' | 'mail-circle-filled' | 'mail-settings' | 'megaphone' | 'menu' | 'menu-thin' | 'microsoft' | 'minimize' | 'minus' | 'minus-circle' | 'minus-circle-filled' | 'monitoring' | 'monitoring-off' | 'my-little-admin' | 'net' | 'nine-dots' | 'node-js' | 'package' | 'panel' | 'panel-check' | 'panel-eye' | 'panel-key' | 'panel-settings' | 'panels' | 'pause-circle' | 'pencil' | 'pencil-dialog' | 'php' | 'phpmyadmin' | 'pin' | 'pipette' | 'plans' | 'plugins' | 'plus' | 'power' | 'projects' | 'puzzle' | 'question-mark-circle' | 'question-mark-circle-filled' | 'ram' | 'react-js' | 'recycle' | 'redirect-circle-filled' | 'refresh' | 'reload' | 'remove' | 'reset' | 'resource' | 'ribbon' | 'rocket' | 'ruby' | 'sand-clock' | 'scan' | 'screen' | 'search' | 'security-check' | 'send' | 'server' | 'servers' | 'share' | 'shield' | 'shield-attention-filled' | 'shield-chain' | 'shield-filled' | 'shopping-cart' | 'sidebar-right-hide' | 'sidebar-right-show' | 'signal-light' | 'site-page' | 'sleep' | 'sliders' | 'square-with-circles' | 'star' | 'star-circle-filled' | 'star-filled' | 'star-half-filled' | 'start' | 'start-circle' | 'start-filled' | 'stop' | 'stop-circle' | 'storage' | 'themes' | 'three-dots-horizontal' | 'three-dots-vertical' | 'tools' | 'transfer' | 'triangle-exclamation-mark' | 'triangle-exclamation-mark-filled' | 'unarchive' | 'user' | 'volume' | 'web' | 'web-plus' | 'web-settings' | 'windows' | 'woocommerce' | 'wordpress' | 'zero-circle-filled';
|
|
3
3
|
export declare const NAMES: IconName[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElementType, SyntheticEvent, ReactNode } from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '../../utils/types';
|
|
2
3
|
import './Link.less';
|
|
3
|
-
export declare type
|
|
4
|
+
export declare type BaseLinkProps = {
|
|
4
5
|
/**
|
|
5
6
|
* @ignore
|
|
6
7
|
*/
|
|
@@ -13,7 +14,7 @@ export declare type LinkProps<P> = {
|
|
|
13
14
|
* Content of the link.
|
|
14
15
|
* @since 1.9.0
|
|
15
16
|
*/
|
|
16
|
-
children
|
|
17
|
+
children?: ReactNode;
|
|
17
18
|
/**
|
|
18
19
|
* @ignore
|
|
19
20
|
*/
|
|
@@ -29,19 +30,20 @@ export declare type LinkProps<P> = {
|
|
|
29
30
|
* @since 1.9.0
|
|
30
31
|
*/
|
|
31
32
|
pseudo?: boolean;
|
|
33
|
+
};
|
|
34
|
+
export declare type LinkProps<Component extends ElementType = 'a'> = {
|
|
32
35
|
/**
|
|
33
36
|
* Component to render as the root element. Useful when rendering a `Link` as other component or tag.
|
|
34
|
-
* @since
|
|
37
|
+
* @since 0.0.42
|
|
38
|
+
* @type ElementType
|
|
39
|
+
* @default a
|
|
35
40
|
*/
|
|
36
|
-
component?:
|
|
37
|
-
} &
|
|
38
|
-
/**
|
|
39
|
-
* FIXME: With the following code all @ts-ignore comments can be removed, but react-docgen cannot parse it.
|
|
40
|
-
* const Link = <P extends any>({ ... }: LinkProps<P>) => {
|
|
41
|
-
*/
|
|
41
|
+
component?: Component;
|
|
42
|
+
} & PolymorphicComponentProps<Component, BaseLinkProps>;
|
|
42
43
|
/**
|
|
43
44
|
* `Link` is used for navigation purposes.
|
|
44
|
-
*
|
|
45
|
+
*
|
|
46
|
+
* Since: 1.9.0
|
|
45
47
|
*/
|
|
46
|
-
declare const Link: <
|
|
48
|
+
declare const Link: <Component extends ElementType<any> = "a">({ baseClassName, className, onClick, disabled, pseudo, component, children, ...other }: LinkProps<Component>) => JSX.Element;
|
|
47
49
|
export default Link;
|