@plesk/ui-library 3.35.0 → 3.35.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 +1 -2
- package/cjs/components/Carousel/Carousel.js +25 -39
- package/cjs/components/Drawer/Header.js +71 -108
- package/cjs/components/Form/Form.js +5 -7
- package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.js +8 -67
- package/cjs/components/Grid/Grid.js +9 -71
- package/cjs/components/GridCol/GridCol.js +3 -54
- package/cjs/components/Icon/constants.js +2 -2
- package/cjs/components/Icon/images/symbols.svg +15 -1
- package/cjs/components/Link/Link.js +1 -2
- package/cjs/components/List/List.js +11 -8
- package/cjs/components/Progress/Progress.js +8 -28
- package/cjs/components/ProgressDialog/ProgressDialog.js +12 -85
- package/cjs/components/ProgressStep/ProgressStep.js +4 -46
- package/cjs/components/ProgressStep/index.js +36 -12
- package/cjs/components/Rating/Rating.js +5 -36
- package/cjs/components/Skeleton/index.js +2 -2
- package/cjs/components/SplitButton/SplitButton.js +1 -2
- package/cjs/components/Switch/Switch.js +43 -118
- package/cjs/components/SwitchesPanel/SwitchesPanel.js +3 -26
- package/cjs/components/SwitchesPanelItem/SwitchesPanelItem.js +3 -57
- package/cjs/components/Toaster/Toaster.js +3 -3
- package/cjs/components/Tooltip/Tooltip.js +35 -64
- package/cjs/components/Translate/Translate.js +10 -78
- package/cjs/components/Translate/index.js +4 -4
- package/cjs/components/Translate/isLikeText.js +27 -0
- package/cjs/components/index.js +14 -11
- package/cjs/index.js +1 -1
- package/cjs/tests/index.js +13 -0
- package/cjs/tests/renderer.js +33 -0
- package/dist/images/symbols.svg +15 -1
- 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 +567 -1139
- 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 +1 -2
- package/esm/components/Carousel/Carousel.js +25 -37
- package/esm/components/Drawer/Header.js +70 -107
- package/esm/components/Form/Form.js +5 -7
- package/esm/components/FormFieldCheckbox/FormFieldCheckbox.js +8 -65
- package/esm/components/Grid/Grid.js +9 -69
- package/esm/components/GridCol/GridCol.js +2 -55
- package/esm/components/Icon/constants.js +2 -2
- package/esm/components/Icon/images/symbols.svg +15 -1
- package/esm/components/Link/Link.js +1 -2
- package/esm/components/List/List.js +11 -8
- package/esm/components/Progress/Progress.js +8 -26
- package/esm/components/ProgressDialog/ProgressDialog.js +12 -83
- package/esm/components/ProgressStep/ProgressStep.js +6 -48
- package/esm/components/ProgressStep/index.js +1 -2
- package/esm/components/Rating/Rating.js +5 -36
- package/esm/components/Skeleton/index.js +2 -2
- package/esm/components/SplitButton/SplitButton.js +1 -2
- package/esm/components/Switch/Switch.js +43 -116
- package/esm/components/SwitchesPanel/SwitchesPanel.js +3 -24
- package/esm/components/SwitchesPanelItem/SwitchesPanelItem.js +3 -55
- package/esm/components/Toaster/Toaster.js +3 -1
- package/esm/components/Tooltip/Tooltip.js +36 -62
- package/esm/components/Translate/Translate.js +9 -73
- package/esm/components/Translate/index.js +2 -1
- package/esm/components/Translate/isLikeText.js +19 -0
- package/esm/components/index.js +1 -2
- package/esm/index.js +1 -1
- package/esm/tests/index.js +3 -0
- package/esm/tests/renderer.js +25 -0
- package/package.json +25 -22
- package/styleguide/build/bundle.6318f4a5.js +2 -0
- package/styleguide/images/symbols.svg +15 -1
- package/styleguide/index.html +2 -2
- package/types/src/components/Button/Button.d.ts +2 -3
- package/types/src/components/Carousel/Carousel.d.ts +58 -0
- package/types/src/components/Carousel/index.d.ts +2 -0
- package/types/src/components/Dialog/Dialog.d.ts +1 -1
- package/types/src/components/Dialog/index.d.ts +1 -1
- package/types/src/components/Drawer/DrawerProgress.d.ts +3 -3
- package/types/src/components/Drawer/Header.d.ts +4 -20
- package/types/src/components/Form/Form.d.ts +5 -0
- package/types/src/components/FormFieldCheckbox/FormFieldCheckbox.d.ts +53 -0
- package/types/src/components/FormFieldCheckbox/index.d.ts +2 -0
- package/types/src/components/FormFieldPassword/generatePassword.d.ts +2 -0
- package/types/src/components/Grid/Grid.d.ts +97 -0
- package/types/src/components/Grid/index.d.ts +2 -0
- package/types/src/components/GridCol/GridCol.d.ts +53 -0
- package/types/src/components/GridCol/index.d.ts +2 -0
- package/types/src/components/Icon/constants.d.ts +1 -1
- package/types/src/components/ItemList/index.d.ts +1 -0
- package/types/src/components/Link/Link.d.ts +1 -2
- package/types/src/components/LocaleProvider/LocaleProvider.d.ts +1 -1
- package/types/src/components/Pagination/index.d.ts +1 -0
- package/types/src/components/Panel/index.d.ts +1 -0
- package/types/src/components/Progress/Progress.d.ts +49 -0
- package/types/src/components/Progress/index.d.ts +2 -0
- package/types/src/components/ProgressDialog/ProgressDialog.d.ts +125 -0
- package/types/src/components/ProgressDialog/index.d.ts +2 -0
- package/types/src/components/ProgressStep/ProgressStep.d.ts +69 -0
- package/types/src/components/ProgressStep/index.d.ts +2 -0
- package/types/src/components/Rating/Rating.d.ts +27 -0
- package/types/src/components/Rating/index.d.ts +2 -0
- package/types/src/components/Skeleton/Skeleton.d.ts +3 -5
- package/types/src/components/Skeleton/SkeletonTabs.d.ts +4 -4
- package/types/src/components/Skeleton/SkeletonText.d.ts +2 -2
- package/types/src/components/Skeleton/index.d.ts +4 -1
- package/types/src/components/SplitButton/SplitButton.d.ts +1 -2
- package/types/src/components/Switch/Switch.d.ts +58 -0
- package/types/src/components/Switch/index.d.ts +2 -0
- package/types/src/components/SwitchesPanel/SwitchesPanel.d.ts +24 -0
- package/types/src/components/SwitchesPanel/index.d.ts +2 -0
- package/types/src/components/SwitchesPanelItem/SwitchesPanelItem.d.ts +78 -0
- package/types/src/components/SwitchesPanelItem/index.d.ts +2 -0
- package/types/src/components/TextArea/index.d.ts +1 -0
- package/types/src/components/Tooltip/Tooltip.d.ts +61 -0
- package/types/src/components/Tooltip/index.d.ts +2 -0
- package/types/src/components/Translate/Translate.d.ts +56 -0
- package/types/src/components/Translate/index.d.ts +3 -0
- package/types/src/components/Translate/isLikeText.d.ts +2 -0
- package/types/src/components/index.d.ts +15 -2
- package/types/src/components/utils.d.ts +1 -1
- package/cjs/components/Alert/Alert.stories.js +0 -34
- package/cjs/components/Button/Button.stories.js +0 -109
- package/cjs/components/Cuttable/Cuttable.stories.js +0 -46
- package/cjs/components/Dialog/Dialog.stories.js +0 -49
- package/cjs/components/Drawer/Drawer.stories.js +0 -65
- package/cjs/components/Form/Form.stories.js +0 -35
- package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.stories.js +0 -32
- package/cjs/components/Icon/Icon.stories.js +0 -32
- package/cjs/components/ItemLink/ItemLink.stories.js +0 -20
- package/cjs/components/ItemList/ItemList.stories.js +0 -122
- package/cjs/components/List/List.stories.js +0 -152
- package/cjs/components/Markdown/Markdown.stories.js +0 -51
- package/cjs/components/Menu/Menu.stories.js +0 -77
- package/cjs/components/Popover/Popover.stories.js +0 -60
- package/cjs/components/Select/Select.stories.js +0 -57
- package/cjs/components/Skeleton/Skeleton.stories.js +0 -24
- package/cjs/components/Skeleton/SkeletonTabs.stories.js +0 -15
- package/cjs/components/Skeleton/SkeletonText.stories.js +0 -33
- package/cjs/components/Status/Status.stories.js +0 -19
- package/cjs/components/Tabs/Tabs.stories.js +0 -24
- package/esm/components/Alert/Alert.stories.js +0 -27
- package/esm/components/Button/Button.stories.js +0 -99
- package/esm/components/Cuttable/Cuttable.stories.js +0 -39
- package/esm/components/Dialog/Dialog.stories.js +0 -42
- package/esm/components/Drawer/Drawer.stories.js +0 -56
- package/esm/components/Form/Form.stories.js +0 -27
- package/esm/components/FormFieldCheckbox/FormFieldCheckbox.stories.js +0 -23
- package/esm/components/Icon/Icon.stories.js +0 -23
- package/esm/components/ItemLink/ItemLink.stories.js +0 -12
- package/esm/components/ItemList/ItemList.stories.js +0 -109
- package/esm/components/List/List.stories.js +0 -139
- package/esm/components/Markdown/Markdown.stories.js +0 -43
- package/esm/components/Menu/Menu.stories.js +0 -65
- package/esm/components/Popover/Popover.stories.js +0 -52
- package/esm/components/Select/Select.stories.js +0 -48
- package/esm/components/Skeleton/Skeleton.stories.js +0 -15
- package/esm/components/Skeleton/SkeletonTabs.stories.js +0 -7
- package/esm/components/Skeleton/SkeletonText.stories.js +0 -23
- package/esm/components/Status/Status.stories.js +0 -11
- package/esm/components/Tabs/Tabs.stories.js +0 -16
- package/styleguide/build/bundle.2a886a79.js +0 -2
- package/types/src/components/Alert/Alert.stories.d.ts +0 -11
- package/types/src/components/Button/Button.stories.d.ts +0 -17
- package/types/src/components/Cuttable/Cuttable.stories.d.ts +0 -17
- package/types/src/components/Dialog/Dialog.stories.d.ts +0 -25
- package/types/src/components/Drawer/Drawer.stories.d.ts +0 -43
- package/types/src/components/Form/Form.stories.d.ts +0 -13
- package/types/src/components/FormFieldCheckbox/FormFieldCheckbox.stories.d.ts +0 -20
- package/types/src/components/Icon/Icon.stories.d.ts +0 -7
- package/types/src/components/ItemLink/ItemLink.stories.d.ts +0 -12
- package/types/src/components/ItemList/ItemList.stories.d.ts +0 -172
- package/types/src/components/List/List.stories.d.ts +0 -30
- package/types/src/components/Markdown/Markdown.stories.d.ts +0 -10
- package/types/src/components/Menu/Menu.stories.d.ts +0 -20
- package/types/src/components/Popover/Popover.stories.d.ts +0 -25
- package/types/src/components/Select/Select.stories.d.ts +0 -12
- package/types/src/components/Skeleton/Skeleton.stories.d.ts +0 -15
- package/types/src/components/Skeleton/SkeletonTabs.stories.d.ts +0 -5
- package/types/src/components/Skeleton/SkeletonText.stories.d.ts +0 -23
- package/types/src/components/Status/Status.stories.d.ts +0 -11
- package/types/src/components/Tabs/Tabs.stories.d.ts +0 -10
- /package/styleguide/build/{bundle.2a886a79.js.LICENSE.txt → bundle.6318f4a5.js.LICENSE.txt} +0 -0
|
@@ -201,7 +201,6 @@ Button.defaultProps = {
|
|
|
201
201
|
/**
|
|
202
202
|
* `Button` component is used for executing actions, changing the application state, opening forms or dialog windows, and submitting data.
|
|
203
203
|
* As a rule, you should not use buttons for navigation between individual pages (use `Link` instead).
|
|
204
|
-
*
|
|
205
|
-
* Since: 0.0.37
|
|
204
|
+
* @since 0.0.37
|
|
206
205
|
*/
|
|
207
206
|
export default Button;
|
|
@@ -2,8 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
3
3
|
|
|
4
4
|
import { isRtl } from '../../utils';
|
|
5
|
-
import
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
5
|
+
import { Component, createRef } from 'react';
|
|
7
6
|
import classNames from 'classnames';
|
|
8
7
|
import Measure from 'react-measure';
|
|
9
8
|
import { CLS_PREFIX } from '../../constants';
|
|
@@ -18,7 +17,6 @@ const calcWidths = node => {
|
|
|
18
17
|
totalWidth
|
|
19
18
|
};
|
|
20
19
|
};
|
|
21
|
-
|
|
22
20
|
/**
|
|
23
21
|
* Carousel component is used for optimizing page space by displaying only some parts
|
|
24
22
|
* of entire content in a cyclic view.
|
|
@@ -35,23 +33,27 @@ class Carousel extends Component {
|
|
|
35
33
|
slideWidths: [],
|
|
36
34
|
totalWidth: 0
|
|
37
35
|
});
|
|
38
|
-
this
|
|
39
|
-
this
|
|
40
|
-
this
|
|
41
|
-
this
|
|
36
|
+
_defineProperty(this, "speed", 500);
|
|
37
|
+
_defineProperty(this, "playSpeed", 5000);
|
|
38
|
+
_defineProperty(this, "isRtl", void 0);
|
|
39
|
+
_defineProperty(this, "playTimer", null);
|
|
40
|
+
_defineProperty(this, "movingCallback", null);
|
|
41
|
+
_defineProperty(this, "rootRef", /*#__PURE__*/createRef());
|
|
42
|
+
_defineProperty(this, "genuineRef", /*#__PURE__*/createRef());
|
|
42
43
|
this.handlePrevClick = this.handlePrevClick.bind(this);
|
|
43
44
|
this.handleNextClick = this.handleNextClick.bind(this);
|
|
44
45
|
this.stop = this.stop.bind(this);
|
|
45
46
|
this.play = this.play.bind(this);
|
|
46
47
|
this.handleResize = this.handleResize.bind(this);
|
|
47
|
-
this.rootRef = /*#__PURE__*/createRef();
|
|
48
|
-
this.genuineRef = /*#__PURE__*/createRef();
|
|
49
48
|
}
|
|
50
49
|
componentDidMount() {
|
|
51
50
|
this.isRtl = isRtl();
|
|
52
51
|
this.play();
|
|
53
52
|
}
|
|
54
53
|
componentDidUpdate() {
|
|
54
|
+
if (!this.rootRef.current || !this.genuineRef.current) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
55
57
|
const {
|
|
56
58
|
width
|
|
57
59
|
} = this.rootRef.current.getBoundingClientRect();
|
|
@@ -69,7 +71,9 @@ class Carousel extends Component {
|
|
|
69
71
|
}
|
|
70
72
|
componentWillUnmount() {
|
|
71
73
|
this.stop();
|
|
72
|
-
|
|
74
|
+
if (this.movingCallback) {
|
|
75
|
+
clearTimeout(this.movingCallback);
|
|
76
|
+
}
|
|
73
77
|
}
|
|
74
78
|
handlePrevClick() {
|
|
75
79
|
this.stop();
|
|
@@ -120,11 +124,12 @@ class Carousel extends Component {
|
|
|
120
124
|
}
|
|
121
125
|
handleResize(_ref) {
|
|
122
126
|
let {
|
|
123
|
-
bounds
|
|
124
|
-
width
|
|
125
|
-
}
|
|
127
|
+
bounds
|
|
126
128
|
} = _ref;
|
|
127
129
|
const node = this.genuineRef.current;
|
|
130
|
+
if (!node) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
128
133
|
const {
|
|
129
134
|
slideWidths,
|
|
130
135
|
totalWidth
|
|
@@ -132,7 +137,7 @@ class Carousel extends Component {
|
|
|
132
137
|
this.setState({
|
|
133
138
|
slideWidths,
|
|
134
139
|
totalWidth,
|
|
135
|
-
showControls: width < totalWidth
|
|
140
|
+
showControls: (bounds?.width || 0) < totalWidth
|
|
136
141
|
});
|
|
137
142
|
}
|
|
138
143
|
listStyle() {
|
|
@@ -160,8 +165,8 @@ class Carousel extends Component {
|
|
|
160
165
|
return {
|
|
161
166
|
WebkitTransform: `translateX(${x ? `${x}px` : 0})`,
|
|
162
167
|
transform: `translateX(${x ? `${x}px` : 0})`,
|
|
163
|
-
WebkitTransition: moving ? `-webkit-transform ${this.speed}ms ease` :
|
|
164
|
-
transition: moving ? `transform ${this.speed}ms ease` :
|
|
168
|
+
WebkitTransition: moving ? `-webkit-transform ${this.speed}ms ease` : undefined,
|
|
169
|
+
transition: moving ? `transform ${this.speed}ms ease` : undefined
|
|
165
170
|
};
|
|
166
171
|
}
|
|
167
172
|
render() {
|
|
@@ -177,9 +182,7 @@ class Carousel extends Component {
|
|
|
177
182
|
return /*#__PURE__*/_jsx(Measure, {
|
|
178
183
|
onResize: this.handleResize,
|
|
179
184
|
bounds: true,
|
|
180
|
-
innerRef:
|
|
181
|
-
this.rootRef.current = node;
|
|
182
|
-
},
|
|
185
|
+
innerRef: this.rootRef,
|
|
183
186
|
children: _ref2 => {
|
|
184
187
|
let {
|
|
185
188
|
measureRef
|
|
@@ -190,7 +193,7 @@ class Carousel extends Component {
|
|
|
190
193
|
...props,
|
|
191
194
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
192
195
|
className: `${baseClassName}__slides`,
|
|
193
|
-
style: showControls ? this.listStyle() :
|
|
196
|
+
style: showControls ? this.listStyle() : undefined,
|
|
194
197
|
children: [showControls && children, /*#__PURE__*/_jsx("div", {
|
|
195
198
|
className: `${baseClassName}__genuine-slides`,
|
|
196
199
|
ref: this.genuineRef,
|
|
@@ -223,24 +226,9 @@ class Carousel extends Component {
|
|
|
223
226
|
});
|
|
224
227
|
}
|
|
225
228
|
}
|
|
226
|
-
Carousel
|
|
227
|
-
/**
|
|
228
|
-
* Slides
|
|
229
|
-
* @since 0.0.42
|
|
230
|
-
*/
|
|
231
|
-
children: PropTypes.node,
|
|
232
|
-
/**
|
|
233
|
-
* @ignore
|
|
234
|
-
*/
|
|
235
|
-
className: PropTypes.string,
|
|
236
|
-
/**
|
|
237
|
-
* @ignore
|
|
238
|
-
*/
|
|
239
|
-
baseClassName: PropTypes.string
|
|
240
|
-
};
|
|
241
|
-
Carousel.defaultProps = {
|
|
229
|
+
_defineProperty(Carousel, "defaultProps", {
|
|
242
230
|
children: null,
|
|
243
231
|
className: null,
|
|
244
232
|
baseClassName: `${CLS_PREFIX}carousel`
|
|
245
|
-
};
|
|
233
|
+
});
|
|
246
234
|
export default Carousel;
|
|
@@ -1,131 +1,94 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
3
2
|
|
|
4
3
|
import { isRtl } from '../../utils';
|
|
5
|
-
import { Component } from 'react';
|
|
6
4
|
import classNames from 'classnames';
|
|
7
5
|
import { CLS_PREFIX } from '../../constants';
|
|
8
6
|
import Button from '../Button';
|
|
9
7
|
import Icon from '../Icon';
|
|
10
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
className: classNames(`${baseClassName}__button`, `${baseClassName}__button--hide`),
|
|
45
|
-
size: "lg",
|
|
46
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
|
47
|
-
className: `${baseClassName}__icon`,
|
|
48
|
-
name: "minimize"
|
|
49
|
-
}),
|
|
50
|
-
onClick: onClose
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
renderCloseButton() {
|
|
10
|
+
const Header = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
baseClassName = `${CLS_PREFIX}drawer-header`,
|
|
13
|
+
onClose,
|
|
14
|
+
children,
|
|
15
|
+
backButton = false,
|
|
16
|
+
hideButton = false,
|
|
17
|
+
tabs,
|
|
18
|
+
...props
|
|
19
|
+
} = _ref;
|
|
20
|
+
const renderBackButton = () => /*#__PURE__*/_jsx(Button, {
|
|
21
|
+
ghost: true,
|
|
22
|
+
className: classNames(`${baseClassName}__button`, `${baseClassName}__button--back`),
|
|
23
|
+
size: "lg",
|
|
24
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
25
|
+
name: "chevron-left",
|
|
26
|
+
flipHorizontal: isRtl(),
|
|
27
|
+
className: `${baseClassName}__icon`
|
|
28
|
+
}),
|
|
29
|
+
onClick: onClose
|
|
30
|
+
});
|
|
31
|
+
const renderHideButton = () => /*#__PURE__*/_jsx(Button, {
|
|
32
|
+
ghost: true,
|
|
33
|
+
className: classNames(`${baseClassName}__button`, `${baseClassName}__button--hide`),
|
|
34
|
+
size: "lg",
|
|
35
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
36
|
+
className: `${baseClassName}__icon`,
|
|
37
|
+
name: "minimize"
|
|
38
|
+
}),
|
|
39
|
+
onClick: onClose
|
|
40
|
+
});
|
|
41
|
+
const renderCloseButton = function () {
|
|
54
42
|
let {
|
|
55
43
|
disabled = false
|
|
56
44
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
57
|
-
const {
|
|
58
|
-
baseClassName,
|
|
59
|
-
onClose
|
|
60
|
-
} = this.props;
|
|
61
45
|
return /*#__PURE__*/_jsx(Button, {
|
|
62
46
|
ghost: true,
|
|
63
47
|
className: classNames(`${baseClassName}__button`, `${baseClassName}__button--close`),
|
|
64
48
|
size: "lg",
|
|
65
49
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
66
|
-
name:
|
|
50
|
+
name: "cross-mark",
|
|
67
51
|
className: `${baseClassName}__icon`
|
|
68
52
|
}),
|
|
69
53
|
onClick: onClose,
|
|
70
54
|
disabled: disabled
|
|
71
55
|
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
case hideButton:
|
|
91
|
-
suffix = /*#__PURE__*/_jsxs("div", {
|
|
92
|
-
className: `${baseClassName}__actions`,
|
|
93
|
-
children: [this.renderHideButton(), this.renderCloseButton({
|
|
94
|
-
disabled: true
|
|
95
|
-
})]
|
|
96
|
-
});
|
|
97
|
-
break;
|
|
98
|
-
default:
|
|
99
|
-
suffix = /*#__PURE__*/_jsx("div", {
|
|
100
|
-
className: `${baseClassName}__actions`,
|
|
101
|
-
children: this.renderCloseButton()
|
|
102
|
-
});
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
56
|
+
};
|
|
57
|
+
let prefix;
|
|
58
|
+
let suffix;
|
|
59
|
+
if (onClose) {
|
|
60
|
+
if (backButton) {
|
|
61
|
+
prefix = renderBackButton();
|
|
62
|
+
} else if (hideButton) {
|
|
63
|
+
suffix = /*#__PURE__*/_jsxs("div", {
|
|
64
|
+
className: `${baseClassName}__actions`,
|
|
65
|
+
children: [renderHideButton(), renderCloseButton({
|
|
66
|
+
disabled: true
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
} else {
|
|
70
|
+
suffix = /*#__PURE__*/_jsx("div", {
|
|
71
|
+
className: `${baseClassName}__actions`,
|
|
72
|
+
children: renderCloseButton()
|
|
73
|
+
});
|
|
105
74
|
}
|
|
106
|
-
return /*#__PURE__*/_jsx("div", {
|
|
107
|
-
className: baseClassName,
|
|
108
|
-
...props,
|
|
109
|
-
children: /*#__PURE__*/_jsxs("div", {
|
|
110
|
-
className: `${baseClassName}__inner`,
|
|
111
|
-
children: [prefix, /*#__PURE__*/_jsxs("div", {
|
|
112
|
-
className: `${baseClassName}__content`,
|
|
113
|
-
children: [children, tabs && /*#__PURE__*/_jsx("div", {
|
|
114
|
-
className: `${baseClassName}__tabs`,
|
|
115
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
116
|
-
className: `${baseClassName}__tabs-inner`,
|
|
117
|
-
children: tabs
|
|
118
|
-
})
|
|
119
|
-
})]
|
|
120
|
-
}), suffix]
|
|
121
|
-
})
|
|
122
|
-
});
|
|
123
75
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
76
|
+
return /*#__PURE__*/_jsx("div", {
|
|
77
|
+
className: baseClassName,
|
|
78
|
+
...props,
|
|
79
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
80
|
+
className: `${baseClassName}__inner`,
|
|
81
|
+
children: [prefix, /*#__PURE__*/_jsxs("div", {
|
|
82
|
+
className: `${baseClassName}__content`,
|
|
83
|
+
children: [children, tabs && /*#__PURE__*/_jsx("div", {
|
|
84
|
+
className: `${baseClassName}__tabs`,
|
|
85
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
86
|
+
className: `${baseClassName}__tabs-inner`,
|
|
87
|
+
children: tabs
|
|
88
|
+
})
|
|
89
|
+
})]
|
|
90
|
+
}), suffix]
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
export default Header;
|
|
@@ -367,13 +367,6 @@ class Form extends Component {
|
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* `Form` component is used for entering and submitting of user data.
|
|
373
|
-
* [More details about designing of forms.](#!/Good%20Forms)
|
|
374
|
-
*
|
|
375
|
-
* Since: 0.0.54
|
|
376
|
-
*/
|
|
377
370
|
_defineProperty(Form, "defaultProps", {
|
|
378
371
|
children: undefined,
|
|
379
372
|
requiredMark: /*#__PURE__*/_jsx("span", {
|
|
@@ -412,4 +405,9 @@ const RefForwardingForm = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
412
405
|
});
|
|
413
406
|
});
|
|
414
407
|
RefForwardingForm.displayName = 'Form';
|
|
408
|
+
/**
|
|
409
|
+
* `Form` component is used for entering and submitting of user data.
|
|
410
|
+
* [More details about designing of forms.](#!/Good%20Forms)
|
|
411
|
+
* @since 0.0.54
|
|
412
|
+
*/
|
|
415
413
|
export default RefForwardingForm;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
3
|
+
import { Fragment } from 'react';
|
|
5
4
|
import classNames from 'classnames';
|
|
6
5
|
import { CLS_PREFIX } from '../../constants';
|
|
7
6
|
import Checkbox from '../Checkbox';
|
|
@@ -10,20 +9,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
10
9
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
11
|
/**
|
|
13
|
-
* `FormFieldCheckbox` component
|
|
12
|
+
* `FormFieldCheckbox` component is used for turning an option on or off
|
|
14
13
|
* and selecting or deselecting an item.
|
|
15
14
|
* @since 0.0.58
|
|
16
15
|
*/
|
|
17
16
|
const FormFieldCheckbox = _ref => {
|
|
18
17
|
let {
|
|
19
|
-
baseClassName,
|
|
20
18
|
className,
|
|
21
19
|
label,
|
|
22
|
-
required,
|
|
23
|
-
checkedValue,
|
|
24
|
-
uncheckedValue,
|
|
25
20
|
autoFocus,
|
|
26
|
-
|
|
21
|
+
required = false,
|
|
22
|
+
checkedValue = true,
|
|
23
|
+
uncheckedValue = false,
|
|
24
|
+
baseClassName = `${CLS_PREFIX}form-field-checkbox`,
|
|
27
25
|
...props
|
|
28
26
|
} = _ref;
|
|
29
27
|
return /*#__PURE__*/_jsx(FormField, {
|
|
@@ -45,14 +43,14 @@ const FormFieldCheckbox = _ref => {
|
|
|
45
43
|
children: [/*#__PURE__*/_jsx("input", {
|
|
46
44
|
type: "hidden",
|
|
47
45
|
name: getName(),
|
|
48
|
-
value: uncheckedValue
|
|
46
|
+
value: uncheckedValue.toString()
|
|
49
47
|
}), /*#__PURE__*/_jsx(Checkbox, {
|
|
50
48
|
checked: getValue() === checkedValue,
|
|
51
49
|
onChange: checked => setValue(checked ? checkedValue : uncheckedValue),
|
|
52
50
|
inputProps: {
|
|
53
51
|
id: getId(),
|
|
54
52
|
name: getName(),
|
|
55
|
-
value: checkedValue,
|
|
53
|
+
value: checkedValue.toString(),
|
|
56
54
|
autoFocus
|
|
57
55
|
},
|
|
58
56
|
disabled: isDisabled(),
|
|
@@ -65,59 +63,4 @@ const FormFieldCheckbox = _ref => {
|
|
|
65
63
|
}
|
|
66
64
|
});
|
|
67
65
|
};
|
|
68
|
-
FormFieldCheckbox.propTypes = {
|
|
69
|
-
/**
|
|
70
|
-
* Disabled state of field.
|
|
71
|
-
* @since 0.1.0
|
|
72
|
-
*/
|
|
73
|
-
disabled: PropTypes.bool,
|
|
74
|
-
/**
|
|
75
|
-
* Custom checked value. Default is boolean true.
|
|
76
|
-
* @since 0.0.59
|
|
77
|
-
*/
|
|
78
|
-
checkedValue: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
79
|
-
/**
|
|
80
|
-
* Custom unchecked value. Default is boolean false.
|
|
81
|
-
* @since 0.0.59
|
|
82
|
-
*/
|
|
83
|
-
uncheckedValue: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
84
|
-
/**
|
|
85
|
-
* The browser will automatically focus on the component upon rendering the screen
|
|
86
|
-
* @since 1.9.0
|
|
87
|
-
*/
|
|
88
|
-
autoFocus: PropTypes.bool,
|
|
89
|
-
/**
|
|
90
|
-
* @ignore Field cannot be multiple
|
|
91
|
-
*/
|
|
92
|
-
multi: PropTypes.bool,
|
|
93
|
-
/**
|
|
94
|
-
* @ignore
|
|
95
|
-
*/
|
|
96
|
-
label: PropTypes.any,
|
|
97
|
-
/**
|
|
98
|
-
* @ignore
|
|
99
|
-
*/
|
|
100
|
-
required: PropTypes.bool,
|
|
101
|
-
/**
|
|
102
|
-
* @ignore
|
|
103
|
-
*/
|
|
104
|
-
className: PropTypes.string,
|
|
105
|
-
/**
|
|
106
|
-
* @ignore
|
|
107
|
-
*/
|
|
108
|
-
baseClassName: PropTypes.string,
|
|
109
|
-
fullDescription: PropTypes.string
|
|
110
|
-
};
|
|
111
|
-
FormFieldCheckbox.defaultProps = {
|
|
112
|
-
disabled: undefined,
|
|
113
|
-
checkedValue: true,
|
|
114
|
-
uncheckedValue: false,
|
|
115
|
-
autoFocus: undefined,
|
|
116
|
-
multi: undefined,
|
|
117
|
-
label: undefined,
|
|
118
|
-
required: false,
|
|
119
|
-
className: undefined,
|
|
120
|
-
baseClassName: `${CLS_PREFIX}form-field-checkbox`,
|
|
121
|
-
fullDescription: undefined
|
|
122
|
-
};
|
|
123
66
|
export default FormFieldCheckbox;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
4
|
+
import { cloneElement, Component } from 'react';
|
|
6
5
|
import classNames from 'classnames';
|
|
7
6
|
import Measure from 'react-measure';
|
|
8
7
|
import { CLS_PREFIX } from '../../constants';
|
|
@@ -19,10 +18,11 @@ class Grid extends Component {
|
|
|
19
18
|
});
|
|
20
19
|
_defineProperty(this, "handleResize", _ref => {
|
|
21
20
|
let {
|
|
22
|
-
bounds
|
|
23
|
-
width
|
|
24
|
-
}
|
|
21
|
+
bounds
|
|
25
22
|
} = _ref;
|
|
23
|
+
const {
|
|
24
|
+
width
|
|
25
|
+
} = bounds;
|
|
26
26
|
let {
|
|
27
27
|
maxColumnsNumber
|
|
28
28
|
} = this.props;
|
|
@@ -87,9 +87,9 @@ class Grid extends Component {
|
|
|
87
87
|
const result = /*#__PURE__*/_jsx("div", {
|
|
88
88
|
className: computedClassName,
|
|
89
89
|
...props,
|
|
90
|
-
children: minColumnWidth
|
|
90
|
+
children: minColumnWidth && !this.state.xs ? null : children
|
|
91
91
|
});
|
|
92
|
-
if (minColumnWidth
|
|
92
|
+
if (minColumnWidth) {
|
|
93
93
|
return /*#__PURE__*/_jsx(Measure, {
|
|
94
94
|
bounds: true,
|
|
95
95
|
onResize: this.handleResize,
|
|
@@ -106,67 +106,7 @@ class Grid extends Component {
|
|
|
106
106
|
return result;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
Grid
|
|
110
|
-
/**
|
|
111
|
-
* Content of the `Grid`.
|
|
112
|
-
* @since 0.0.48
|
|
113
|
-
*/
|
|
114
|
-
children: PropTypes.node,
|
|
115
|
-
/**
|
|
116
|
-
* @ignore
|
|
117
|
-
*/
|
|
118
|
-
className: PropTypes.string,
|
|
119
|
-
/**
|
|
120
|
-
* @ignore
|
|
121
|
-
*/
|
|
122
|
-
baseClassName: PropTypes.string,
|
|
123
|
-
/**
|
|
124
|
-
* Minimal column width
|
|
125
|
-
* @since 0.0.50
|
|
126
|
-
*/
|
|
127
|
-
minColumnWidth: PropTypes.number,
|
|
128
|
-
/**
|
|
129
|
-
* Maximum columns number
|
|
130
|
-
* @since 0.0.53
|
|
131
|
-
*/
|
|
132
|
-
maxColumnsNumber: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
|
|
133
|
-
/**
|
|
134
|
-
* Number of columns for `xs` breakpoint
|
|
135
|
-
* @since 0.0.53
|
|
136
|
-
*/
|
|
137
|
-
xs: PropTypes.PropTypes.oneOf([1, 2, 3, 4, 5, 6, 'auto']),
|
|
138
|
-
/**
|
|
139
|
-
* Number of columns for `sm` breakpoint
|
|
140
|
-
* @since 0.0.48
|
|
141
|
-
*/
|
|
142
|
-
sm: PropTypes.oneOf([1, 2, 3, 4, 5, 6, 'auto']),
|
|
143
|
-
/**
|
|
144
|
-
* Number of columns for `md` breakpoint
|
|
145
|
-
* @since 0.0.48
|
|
146
|
-
*/
|
|
147
|
-
md: PropTypes.oneOf([1, 2, 3, 4, 5, 6, 'auto']),
|
|
148
|
-
/**
|
|
149
|
-
* Number of columns for `lg` breakpoint
|
|
150
|
-
* @since 0.0.48
|
|
151
|
-
*/
|
|
152
|
-
lg: PropTypes.oneOf([1, 2, 3, 4, 5, 6, 'auto']),
|
|
153
|
-
/**
|
|
154
|
-
* Number of columns for `xl` breakpoint
|
|
155
|
-
* @since 0.0.48
|
|
156
|
-
*/
|
|
157
|
-
xl: PropTypes.oneOf([1, 2, 3, 4, 5, 6, 'auto']),
|
|
158
|
-
/**
|
|
159
|
-
* Specifying the gutters between grid items
|
|
160
|
-
* @since 0.0.53
|
|
161
|
-
*/
|
|
162
|
-
gap: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
|
|
163
|
-
/**
|
|
164
|
-
* Columns number change notifier
|
|
165
|
-
* @since 0.0.50
|
|
166
|
-
*/
|
|
167
|
-
onColumnsChange: PropTypes.func
|
|
168
|
-
};
|
|
169
|
-
Grid.defaultProps = {
|
|
109
|
+
_defineProperty(Grid, "defaultProps", {
|
|
170
110
|
children: null,
|
|
171
111
|
className: null,
|
|
172
112
|
baseClassName: `${CLS_PREFIX}grid`,
|
|
@@ -179,5 +119,5 @@ Grid.defaultProps = {
|
|
|
179
119
|
xl: null,
|
|
180
120
|
gap: null,
|
|
181
121
|
onColumnsChange: null
|
|
182
|
-
};
|
|
122
|
+
});
|
|
183
123
|
export default Grid;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
3
|
import classNames from 'classnames';
|
|
6
4
|
import { CLS_PREFIX } from '../../constants';
|
|
7
|
-
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
6
|
/**
|
|
9
7
|
* `GridCol` component is a part of [Grid](#!/Grid) component.
|
|
10
8
|
* @since 0.0.48
|
|
11
9
|
*/
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
10
|
const GridCol = _ref => {
|
|
14
11
|
let {
|
|
15
|
-
baseClassName
|
|
12
|
+
baseClassName = `${CLS_PREFIX}grid__col`,
|
|
16
13
|
className,
|
|
17
14
|
children,
|
|
18
15
|
xs,
|
|
@@ -35,54 +32,4 @@ const GridCol = _ref => {
|
|
|
35
32
|
children: children
|
|
36
33
|
});
|
|
37
34
|
};
|
|
38
|
-
GridCol.propTypes = {
|
|
39
|
-
/**
|
|
40
|
-
* Content of the `GridCol`.
|
|
41
|
-
* @since 0.0.48
|
|
42
|
-
*/
|
|
43
|
-
children: PropTypes.node,
|
|
44
|
-
/**
|
|
45
|
-
* @ignore
|
|
46
|
-
*/
|
|
47
|
-
className: PropTypes.string,
|
|
48
|
-
/**
|
|
49
|
-
* @ignore
|
|
50
|
-
*/
|
|
51
|
-
baseClassName: PropTypes.string,
|
|
52
|
-
/**
|
|
53
|
-
* Column size for `xs` breakpoint (from 1 to 12)
|
|
54
|
-
* @since 0.0.53
|
|
55
|
-
*/
|
|
56
|
-
xs: PropTypes.number,
|
|
57
|
-
/**
|
|
58
|
-
* Column size for `sm` breakpoint (from 1 to 12)
|
|
59
|
-
* @since 0.0.53
|
|
60
|
-
*/
|
|
61
|
-
sm: PropTypes.number,
|
|
62
|
-
/**
|
|
63
|
-
* Column size for `sm` breakpoint (from 1 to 12)
|
|
64
|
-
* @since 0.0.53
|
|
65
|
-
*/
|
|
66
|
-
md: PropTypes.number,
|
|
67
|
-
/**
|
|
68
|
-
* Column size for `md` breakpoint (from 1 to 12)
|
|
69
|
-
* @since 0.0.53
|
|
70
|
-
*/
|
|
71
|
-
lg: PropTypes.number,
|
|
72
|
-
/**
|
|
73
|
-
* Column size for `lg` breakpoint (from 1 to 12)
|
|
74
|
-
* @since 0.0.53
|
|
75
|
-
*/
|
|
76
|
-
xl: PropTypes.number
|
|
77
|
-
};
|
|
78
|
-
GridCol.defaultProps = {
|
|
79
|
-
children: null,
|
|
80
|
-
className: null,
|
|
81
|
-
baseClassName: `${CLS_PREFIX}grid__col`,
|
|
82
|
-
xs: null,
|
|
83
|
-
sm: null,
|
|
84
|
-
md: null,
|
|
85
|
-
lg: null,
|
|
86
|
-
xl: null
|
|
87
|
-
};
|
|
88
35
|
export default GridCol;
|