@plesk/ui-library 3.25.6 → 3.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -35
- package/cjs/components/Action/Action.js +3 -3
- package/cjs/components/Button/Button.js +50 -50
- package/cjs/components/Checkbox/Checkbox.js +3 -3
- package/cjs/components/CodeEditor/CodeEditor.js +40 -40
- package/cjs/components/Dialog/Dialog.js +63 -63
- package/cjs/components/Drawer/Drawer.js +100 -90
- package/cjs/components/Drawer/DrawerProgress.js +17 -14
- package/cjs/components/Drawer/Header.js +11 -4
- package/cjs/components/Form/Form.js +4 -4
- package/cjs/components/FormField/FormField.js +87 -82
- package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.js +26 -26
- package/cjs/components/FormFieldPassword/FormFieldPassword.js +34 -34
- package/cjs/components/FormFieldRadioButtons/FormFieldRadioButtons.js +32 -32
- package/cjs/components/FormFieldSelect/FormFieldSelect.js +1 -1
- package/cjs/components/Icon/Icon.js +6 -6
- package/cjs/components/Icon/constants.js +2 -2
- package/cjs/components/Icon/images/symbols.svg +1653 -1639
- package/cjs/components/InputNumber/InputNumber.js +3 -3
- package/cjs/components/Item/Item.js +50 -41
- package/cjs/components/ItemLink/ItemLink.js +1 -0
- package/cjs/components/ItemList/ItemList.js +43 -12
- package/cjs/components/ItemList/ItemList.stories.js +35 -3
- package/cjs/components/Layout/Layout.js +55 -55
- package/cjs/components/List/List.js +139 -134
- package/cjs/components/LocaleProvider/LocaleProvider.js +3 -3
- package/cjs/components/Menu/MenuBaseItem.js +19 -19
- package/cjs/components/Overlay/Overlay.js +34 -34
- package/cjs/components/Pagination/Pagination.js +3 -3
- package/cjs/components/Panel/Panel.js +14 -4
- package/cjs/components/Popper/Popper.js +30 -30
- package/cjs/components/ProgressStep/ProgressStep.js +16 -14
- package/cjs/components/Section/Section.js +128 -68
- package/cjs/components/Select/Select.js +9 -9
- package/cjs/components/Select/SelectControl.js +1 -1
- package/cjs/components/Tabs/Tab.js +28 -28
- package/cjs/components/Tabs/Tabs.js +33 -33
- package/cjs/components/Translate/Translate.js +25 -25
- package/cjs/index.js +1 -1
- package/dist/images/symbols.svg +1653 -1639
- 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 +1116 -970
- 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/Action/Action.js +3 -3
- package/esm/components/Button/Button.js +50 -50
- package/esm/components/Checkbox/Checkbox.js +3 -3
- package/esm/components/CodeEditor/CodeEditor.js +40 -40
- package/esm/components/Dialog/Dialog.js +63 -63
- package/esm/components/Drawer/Drawer.js +100 -89
- package/esm/components/Drawer/DrawerProgress.js +16 -15
- package/esm/components/Drawer/Header.js +11 -4
- package/esm/components/Form/Form.js +4 -4
- package/esm/components/FormField/FormField.js +87 -82
- package/esm/components/FormFieldCheckbox/FormFieldCheckbox.js +26 -26
- package/esm/components/FormFieldPassword/FormFieldPassword.js +34 -34
- package/esm/components/FormFieldRadioButtons/FormFieldRadioButtons.js +32 -32
- package/esm/components/FormFieldSelect/FormFieldSelect.js +1 -1
- package/esm/components/Icon/Icon.js +6 -6
- package/esm/components/Icon/constants.js +2 -2
- package/esm/components/Icon/images/symbols.svg +1653 -1639
- package/esm/components/InputNumber/InputNumber.js +3 -3
- package/esm/components/Item/Item.js +50 -41
- package/esm/components/ItemLink/ItemLink.js +1 -0
- package/esm/components/ItemList/ItemList.js +43 -12
- package/esm/components/ItemList/ItemList.stories.js +32 -2
- package/esm/components/Layout/Layout.js +55 -55
- package/esm/components/List/List.js +139 -134
- package/esm/components/LocaleProvider/LocaleProvider.js +3 -3
- package/esm/components/Menu/MenuBaseItem.js +19 -19
- package/esm/components/Overlay/Overlay.js +34 -34
- package/esm/components/Pagination/Pagination.js +3 -3
- package/esm/components/Panel/Panel.js +14 -5
- package/esm/components/Popper/Popper.js +30 -30
- package/esm/components/ProgressStep/ProgressStep.js +17 -15
- package/esm/components/Section/Section.js +129 -72
- package/esm/components/Select/Select.js +9 -9
- package/esm/components/Select/SelectControl.js +1 -1
- package/esm/components/Tabs/Tab.js +28 -28
- package/esm/components/Tabs/Tabs.js +33 -33
- package/esm/components/Translate/Translate.js +25 -25
- package/esm/index.js +1 -1
- package/package.json +146 -146
- package/styleguide/build/bundle.ff1f903a.js +2 -0
- package/styleguide/build/{bundle.b7db9339.js.LICENSE.txt → bundle.ff1f903a.js.LICENSE.txt} +0 -0
- package/styleguide/images/symbols.svg +1653 -1639
- package/styleguide/index.html +6 -6
- package/types/src/components/Drawer/DrawerProgress.d.ts +7 -2
- package/types/src/components/Icon/constants.d.ts +1 -1
- package/types/src/components/ItemLink/ItemLink.d.ts +4 -0
- package/types/src/components/ItemLink/ItemLink.stories.d.ts +1 -0
- package/types/src/components/ItemList/ItemList.d.ts +8 -0
- package/types/src/components/ItemList/ItemList.stories.d.ts +104 -0
- package/styleguide/build/bundle.b7db9339.js +0 -2
|
@@ -10,8 +10,8 @@ import classNames from 'classnames';
|
|
|
10
10
|
import { CLS_PREFIX } from '../../constants';
|
|
11
11
|
import PopperJs from 'popper.js';
|
|
12
12
|
import Layer from '../Layer';
|
|
13
|
-
/**
|
|
14
|
-
* `Popper` component.
|
|
13
|
+
/**
|
|
14
|
+
* `Popper` component.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
class Popper extends Component {
|
|
@@ -191,75 +191,75 @@ class Popper extends Component {
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
Popper.propTypes = {
|
|
194
|
-
/**
|
|
195
|
-
* Whether show popper content.
|
|
194
|
+
/**
|
|
195
|
+
* Whether show popper content.
|
|
196
196
|
*/
|
|
197
197
|
show: PropTypes.bool,
|
|
198
198
|
|
|
199
|
-
/**
|
|
200
|
-
* Content of the `Popper`.
|
|
199
|
+
/**
|
|
200
|
+
* Content of the `Popper`.
|
|
201
201
|
*/
|
|
202
202
|
children: PropTypes.node,
|
|
203
203
|
|
|
204
|
-
/**
|
|
205
|
-
* Target for popper.
|
|
204
|
+
/**
|
|
205
|
+
* Target for popper.
|
|
206
206
|
*/
|
|
207
207
|
target: PropTypes.any.isRequired,
|
|
208
208
|
|
|
209
|
-
/**
|
|
210
|
-
* A React reference to the DOM element that needs for calculating the position of the popup.
|
|
209
|
+
/**
|
|
210
|
+
* A React reference to the DOM element that needs for calculating the position of the popup.
|
|
211
211
|
*/
|
|
212
212
|
targetRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
213
213
|
current: PropTypes.instanceOf(HTMLElement)
|
|
214
214
|
})]),
|
|
215
215
|
|
|
216
|
-
/**
|
|
217
|
-
* Arrow element of popper
|
|
216
|
+
/**
|
|
217
|
+
* Arrow element of popper
|
|
218
218
|
*/
|
|
219
219
|
arrow: PropTypes.element,
|
|
220
220
|
|
|
221
|
-
/**
|
|
222
|
-
* Placement for popper.
|
|
221
|
+
/**
|
|
222
|
+
* Placement for popper.
|
|
223
223
|
*/
|
|
224
224
|
placement: PropTypes.oneOf(['auto', 'auto-start', 'auto-end', 'auto-top', 'auto-right', 'auto-bottom', 'auto-left', 'top', 'top-start', 'top-end', 'right', 'right-start', 'right-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end']),
|
|
225
225
|
|
|
226
|
-
/**
|
|
227
|
-
* The behavior used to change the popper's placement.
|
|
226
|
+
/**
|
|
227
|
+
* The behavior used to change the popper's placement.
|
|
228
228
|
*/
|
|
229
229
|
behavior: PropTypes.oneOfType([PropTypes.oneOf(['flip', 'clockwise', 'counterclockwise']), PropTypes.arrayOf(PropTypes.string)]),
|
|
230
230
|
|
|
231
|
-
/**
|
|
232
|
-
* Shift your popper on both axis.
|
|
231
|
+
/**
|
|
232
|
+
* Shift your popper on both axis.
|
|
233
233
|
*/
|
|
234
234
|
offset: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
235
235
|
|
|
236
|
-
/**
|
|
237
|
-
* Update callback function
|
|
236
|
+
/**
|
|
237
|
+
* Update callback function
|
|
238
238
|
*/
|
|
239
239
|
onUpdate: PropTypes.func,
|
|
240
240
|
|
|
241
|
-
/**
|
|
242
|
-
* @ignore
|
|
241
|
+
/**
|
|
242
|
+
* @ignore
|
|
243
243
|
*/
|
|
244
244
|
className: PropTypes.string,
|
|
245
245
|
|
|
246
|
-
/**
|
|
247
|
-
* @ignore
|
|
246
|
+
/**
|
|
247
|
+
* @ignore
|
|
248
248
|
*/
|
|
249
249
|
baseClassName: PropTypes.string,
|
|
250
250
|
|
|
251
|
-
/**
|
|
252
|
-
* zIndex value.
|
|
251
|
+
/**
|
|
252
|
+
* zIndex value.
|
|
253
253
|
*/
|
|
254
254
|
zIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
255
255
|
|
|
256
|
-
/**
|
|
257
|
-
* Boundaries element for preventOverflow property.
|
|
256
|
+
/**
|
|
257
|
+
* Boundaries element for preventOverflow property.
|
|
258
258
|
*/
|
|
259
259
|
boundariesElement: PropTypes.oneOfType([PropTypes.oneOf(['scrollParent', 'window', 'viewport']), PropTypes.instanceOf(HTMLElement)]),
|
|
260
260
|
|
|
261
|
-
/**
|
|
262
|
-
* @ignore
|
|
261
|
+
/**
|
|
262
|
+
* @ignore
|
|
263
263
|
*/
|
|
264
264
|
style: PropTypes.object
|
|
265
265
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
// Copyright 1999-
|
|
2
|
+
// Copyright 1999-2021. Plesk International GmbH. All rights reserved.
|
|
3
3
|
import React, { isValidElement, Children, useContext } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import Icon, {
|
|
6
|
+
import Icon, { ICON_SIZE_16 } from '../Icon';
|
|
7
7
|
import Status from '../Status';
|
|
8
8
|
import { CLS_PREFIX } from '../../constants';
|
|
9
9
|
import ProgressBar from '../ProgressBar';
|
|
@@ -35,39 +35,39 @@ const ProgressStep = ({
|
|
|
35
35
|
switch (status) {
|
|
36
36
|
case STATUS_NOT_STARTED:
|
|
37
37
|
intent = 'inactive';
|
|
38
|
-
icon =
|
|
38
|
+
icon = 'dot';
|
|
39
39
|
break;
|
|
40
40
|
|
|
41
41
|
case STATUS_RUNNING:
|
|
42
|
-
intent =
|
|
43
|
-
icon =
|
|
42
|
+
intent = false;
|
|
43
|
+
icon = 'dot';
|
|
44
44
|
break;
|
|
45
45
|
|
|
46
46
|
case STATUS_DONE:
|
|
47
47
|
intent = 'success';
|
|
48
|
-
icon = 'check-mark';
|
|
48
|
+
icon = 'check-mark-circle-filled';
|
|
49
49
|
break;
|
|
50
50
|
|
|
51
51
|
case STATUS_WARNING:
|
|
52
52
|
intent = 'warning';
|
|
53
|
-
icon = 'triangle-exclamation-mark';
|
|
53
|
+
icon = 'triangle-exclamation-mark-filled';
|
|
54
54
|
break;
|
|
55
55
|
|
|
56
56
|
case STATUS_ERROR:
|
|
57
57
|
intent = 'danger';
|
|
58
|
-
icon = 'exclamation-mark-circle';
|
|
58
|
+
icon = 'exclamation-mark-circle-filled';
|
|
59
59
|
break;
|
|
60
60
|
|
|
61
61
|
case STATUS_CANCELED:
|
|
62
62
|
progress = 0;
|
|
63
63
|
intent = 'inactive';
|
|
64
|
-
icon = 'cross-mark';
|
|
64
|
+
icon = 'cross-mark-circle-filled';
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
icon = Icon.create(icon, {
|
|
69
69
|
className: `${baseClassName}__icon`,
|
|
70
|
-
size:
|
|
70
|
+
size: ICON_SIZE_16,
|
|
71
71
|
intent
|
|
72
72
|
});
|
|
73
73
|
|
|
@@ -85,19 +85,21 @@ const ProgressStep = ({
|
|
|
85
85
|
className: `${baseClassName}__media`
|
|
86
86
|
}, icon), /*#__PURE__*/React.createElement("div", {
|
|
87
87
|
className: `${baseClassName}__body`
|
|
88
|
-
}, (title || statusText) && /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
}, (title || statusText || Children.toArray(children).length > 0) && /*#__PURE__*/React.createElement("div", {
|
|
89
89
|
className: `${baseClassName}__labels`
|
|
90
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
className: `${baseClassName}__labels-body`
|
|
90
92
|
}, title && /*#__PURE__*/React.createElement("div", {
|
|
91
93
|
className: `${baseClassName}__title`
|
|
92
|
-
}, title),
|
|
94
|
+
}, title), Children.toArray(children).length ? /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: `${baseClassName}__content`
|
|
96
|
+
}, children) : null), statusText && /*#__PURE__*/React.createElement("div", {
|
|
93
97
|
className: `${baseClassName}__status`
|
|
94
98
|
}, statusText)), STATUS_RUNNING === status && /*#__PURE__*/React.createElement(ProgressBar, {
|
|
95
99
|
className: `${baseClassName}__progress`,
|
|
96
100
|
intent: "info",
|
|
97
101
|
progress: progress
|
|
98
|
-
})
|
|
99
|
-
className: `${baseClassName}__content`
|
|
100
|
-
}, children) : null));
|
|
102
|
+
})));
|
|
101
103
|
};
|
|
102
104
|
|
|
103
105
|
ProgressStep.propTypes = {
|
|
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
// Copyright 1999-2020. Plesk International GmbH. All rights reserved.
|
|
4
4
|
|
|
5
5
|
/* eslint-disable react/no-deprecated */
|
|
6
|
-
import React, { Component } from 'react';
|
|
6
|
+
import React, { Component, Children, isValidElement, useContext } from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import Measure from 'react-measure';
|
|
@@ -11,25 +11,30 @@ import { CLS_PREFIX } from '../../constants';
|
|
|
11
11
|
import { isClickable } from '../utils';
|
|
12
12
|
import InPlaceEdit from '../InPlaceEdit';
|
|
13
13
|
import Button from '../Button';
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
import VerticalContext, { VERTICAL_BREAKPOINT } from '../VerticalContext';
|
|
15
|
+
import FormContext from '../Form/FormContext';
|
|
16
|
+
|
|
17
|
+
const getErrorsForChildren = (form, children) => {
|
|
18
|
+
let errors = {};
|
|
19
|
+
Children.forEach(children, child => {
|
|
20
|
+
if (! /*#__PURE__*/isValidElement(child)) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
if (child.props.name) {
|
|
25
|
+
errors = { ...errors,
|
|
26
|
+
...form.getErrors(child.props.name)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
24
29
|
|
|
25
|
-
|
|
30
|
+
if (child.props.children) {
|
|
31
|
+
errors = { ...errors,
|
|
32
|
+
...getErrorsForChildren(form, child.props.children)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return errors;
|
|
26
37
|
};
|
|
27
|
-
/**
|
|
28
|
-
* `Section` component is used for dividing of complex content into groups for better readability
|
|
29
|
-
* and comprehension of the presented information.
|
|
30
|
-
* @since 0.0.54
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
38
|
|
|
34
39
|
class Section extends Component {
|
|
35
40
|
constructor(...args) {
|
|
@@ -42,9 +47,7 @@ class Section extends Component {
|
|
|
42
47
|
_defineProperty(this, "handleResize", ({
|
|
43
48
|
bounds
|
|
44
49
|
}) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (vertical !== undefined) {
|
|
50
|
+
if (this.props.vertical !== undefined) {
|
|
48
51
|
return;
|
|
49
52
|
}
|
|
50
53
|
|
|
@@ -62,16 +65,24 @@ class Section extends Component {
|
|
|
62
65
|
collapsed
|
|
63
66
|
}) => ({
|
|
64
67
|
collapsed: !collapsed
|
|
65
|
-
}))
|
|
68
|
+
}), () => {
|
|
69
|
+
if (this.props.onToggle) {
|
|
70
|
+
this.props.onToggle(this.state.collapsed);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
66
73
|
});
|
|
67
74
|
}
|
|
68
75
|
|
|
69
76
|
static getDerivedStateFromProps(props, state) {
|
|
70
77
|
const {
|
|
71
|
-
|
|
78
|
+
collapsible,
|
|
79
|
+
collapsed,
|
|
80
|
+
form,
|
|
81
|
+
children
|
|
72
82
|
} = props;
|
|
73
83
|
const {
|
|
74
|
-
prevCollapsed
|
|
84
|
+
prevCollapsed,
|
|
85
|
+
prevErrors
|
|
75
86
|
} = state;
|
|
76
87
|
const nextState = {};
|
|
77
88
|
|
|
@@ -80,6 +91,17 @@ class Section extends Component {
|
|
|
80
91
|
}
|
|
81
92
|
|
|
82
93
|
nextState.prevCollapsed = collapsed;
|
|
94
|
+
|
|
95
|
+
if (collapsible && form) {
|
|
96
|
+
const errors = getErrorsForChildren(form, children);
|
|
97
|
+
|
|
98
|
+
if (JSON.stringify(errors) !== JSON.stringify(prevErrors) && Object.keys(errors).length > 0) {
|
|
99
|
+
nextState.collapsed = false;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
nextState.prevErrors = errors;
|
|
103
|
+
}
|
|
104
|
+
|
|
83
105
|
return nextState;
|
|
84
106
|
}
|
|
85
107
|
|
|
@@ -158,14 +180,15 @@ class Section extends Component {
|
|
|
158
180
|
collapsed,
|
|
159
181
|
onTitleChange,
|
|
160
182
|
onClose,
|
|
183
|
+
onToggle,
|
|
161
184
|
buttons,
|
|
162
185
|
vertical: verticalProp,
|
|
163
186
|
children,
|
|
187
|
+
form,
|
|
164
188
|
...props
|
|
165
189
|
} = this.props;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return /*#__PURE__*/React.createElement(Vertical.Provider, {
|
|
190
|
+
const vertical = verticalProp === undefined ? this.state.vertical : verticalProp;
|
|
191
|
+
return /*#__PURE__*/React.createElement(VerticalContext.Provider, {
|
|
169
192
|
value: vertical
|
|
170
193
|
}, /*#__PURE__*/React.createElement(Measure, {
|
|
171
194
|
onResize: this.handleResize,
|
|
@@ -201,84 +224,118 @@ class Section extends Component {
|
|
|
201
224
|
|
|
202
225
|
}
|
|
203
226
|
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Title of the section.
|
|
207
|
-
* @since 0.0.54
|
|
227
|
+
const propTypes = {
|
|
228
|
+
/**
|
|
229
|
+
* Title of the section.
|
|
230
|
+
* @since 0.0.54
|
|
208
231
|
*/
|
|
209
232
|
title: PropTypes.node,
|
|
210
233
|
|
|
211
|
-
/**
|
|
212
|
-
* Visual intent color to apply to component.
|
|
213
|
-
* @since 0.0.54
|
|
234
|
+
/**
|
|
235
|
+
* Visual intent color to apply to component.
|
|
236
|
+
* @since 0.0.54
|
|
214
237
|
*/
|
|
215
238
|
intent: PropTypes.oneOf(['danger', 'warning', 'success', 'inactive']),
|
|
216
239
|
|
|
217
|
-
/**
|
|
218
|
-
* Is section collapsible.
|
|
219
|
-
* @since 0.0.54
|
|
240
|
+
/**
|
|
241
|
+
* Is section collapsible.
|
|
242
|
+
* @since 0.0.54
|
|
220
243
|
*/
|
|
221
244
|
collapsible: PropTypes.bool,
|
|
222
245
|
|
|
223
|
-
/**
|
|
224
|
-
* Is section collapsed now.
|
|
225
|
-
* @since 0.0.54
|
|
246
|
+
/**
|
|
247
|
+
* Is section collapsed now.
|
|
248
|
+
* @since 0.0.54
|
|
226
249
|
*/
|
|
227
250
|
collapsed: PropTypes.bool,
|
|
228
251
|
|
|
229
|
-
/**
|
|
230
|
-
* Event handler of title change with inline editing form.
|
|
231
|
-
* @since 0.0.54
|
|
252
|
+
/**
|
|
253
|
+
* Event handler of title change with inline editing form.
|
|
254
|
+
* @since 0.0.54
|
|
232
255
|
*/
|
|
233
256
|
onTitleChange: PropTypes.func,
|
|
234
257
|
|
|
235
|
-
/**
|
|
236
|
-
* Event handler of closing section with X-sign at the right.
|
|
237
|
-
* @since 0.0.54
|
|
258
|
+
/**
|
|
259
|
+
* Event handler of closing section with X-sign at the right.
|
|
260
|
+
* @since 0.0.54
|
|
238
261
|
*/
|
|
239
262
|
onClose: PropTypes.func,
|
|
240
263
|
|
|
241
|
-
/**
|
|
242
|
-
*
|
|
243
|
-
* @since
|
|
264
|
+
/**
|
|
265
|
+
* A callback executed when the section collapsing.
|
|
266
|
+
* @since 3.26.0
|
|
267
|
+
*/
|
|
268
|
+
onToggle: PropTypes.func,
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Array of custom section action button at the right.
|
|
272
|
+
* @since 0.0.54
|
|
244
273
|
*/
|
|
245
274
|
buttons: PropTypes.arrayOf(PropTypes.element),
|
|
246
275
|
|
|
247
|
-
/**
|
|
248
|
-
* Vertical or horizontal section view.
|
|
249
|
-
* Section view will be automatically switched if this parameter is not specified explicitly.
|
|
250
|
-
* @since 0.3.0
|
|
276
|
+
/**
|
|
277
|
+
* Vertical or horizontal section view.
|
|
278
|
+
* Section view will be automatically switched if this parameter is not specified explicitly.
|
|
279
|
+
* @since 0.3.0
|
|
251
280
|
*/
|
|
252
281
|
vertical: PropTypes.bool,
|
|
253
282
|
|
|
254
|
-
/**
|
|
255
|
-
* Content of the `Section`.
|
|
256
|
-
* @since 0.0.54
|
|
283
|
+
/**
|
|
284
|
+
* Content of the `Section`.
|
|
285
|
+
* @since 0.0.54
|
|
257
286
|
*/
|
|
258
287
|
children: PropTypes.node,
|
|
259
288
|
|
|
260
|
-
/**
|
|
261
|
-
* @ignore
|
|
289
|
+
/**
|
|
290
|
+
* @ignore
|
|
262
291
|
*/
|
|
263
292
|
className: PropTypes.string,
|
|
264
293
|
|
|
265
|
-
/**
|
|
266
|
-
* @ignore
|
|
294
|
+
/**
|
|
295
|
+
* @ignore
|
|
296
|
+
*/
|
|
297
|
+
baseClassName: PropTypes.string,
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* @ignore
|
|
267
301
|
*/
|
|
268
|
-
|
|
302
|
+
form: PropTypes.object
|
|
269
303
|
};
|
|
270
|
-
|
|
271
|
-
title:
|
|
272
|
-
intent:
|
|
304
|
+
const defaultProps = {
|
|
305
|
+
title: undefined,
|
|
306
|
+
intent: undefined,
|
|
273
307
|
collapsible: false,
|
|
274
308
|
collapsed: false,
|
|
275
|
-
onTitleChange:
|
|
276
|
-
onClose:
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
309
|
+
onTitleChange: undefined,
|
|
310
|
+
onClose: undefined,
|
|
311
|
+
onToggle: undefined,
|
|
312
|
+
buttons: undefined,
|
|
313
|
+
vertical: undefined,
|
|
314
|
+
children: undefined,
|
|
315
|
+
className: undefined,
|
|
316
|
+
baseClassName: `${CLS_PREFIX}section`,
|
|
317
|
+
form: undefined
|
|
282
318
|
};
|
|
283
|
-
Section.
|
|
284
|
-
|
|
319
|
+
Section.propTypes = propTypes;
|
|
320
|
+
Section.defaultProps = defaultProps;
|
|
321
|
+
/**
|
|
322
|
+
* `Section` component is used for dividing of complex content into groups for better readability
|
|
323
|
+
* and comprehension of the presented information.
|
|
324
|
+
* @since 0.0.54
|
|
325
|
+
*/
|
|
326
|
+
|
|
327
|
+
const SectionWrapper = props => {
|
|
328
|
+
const form = useContext(FormContext);
|
|
329
|
+
const verticalContext = useContext(VerticalContext);
|
|
330
|
+
const vertical = props.vertical === undefined ? verticalContext : props.vertical;
|
|
331
|
+
return /*#__PURE__*/React.createElement(Section, _extends({}, props, {
|
|
332
|
+
form: form,
|
|
333
|
+
vertical: vertical
|
|
334
|
+
}));
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
SectionWrapper.displayName = 'Section';
|
|
338
|
+
SectionWrapper.propTypes = propTypes;
|
|
339
|
+
SectionWrapper.defaultProps = defaultProps;
|
|
340
|
+
SectionWrapper.WrappedComponent = Section;
|
|
341
|
+
export default SectionWrapper;
|
|
@@ -37,12 +37,12 @@ const collect = (children, options = [], group) => {
|
|
|
37
37
|
...props
|
|
38
38
|
} = child.props;
|
|
39
39
|
|
|
40
|
-
if (typeof value !== 'string' && typeof value !== 'number'
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
if (typeof value !== 'string' && typeof value !== 'number') {
|
|
41
|
+
if (typeof children === 'string' && children) {
|
|
42
|
+
value = children;
|
|
43
|
+
} else {
|
|
44
|
+
throw new Error('The value can only be a number or a string.');
|
|
45
|
+
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
let label;
|
|
@@ -95,9 +95,9 @@ const getNextValue = (value, prevValue) => {
|
|
|
95
95
|
return value;
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
/**
|
|
99
|
-
* `Select` component is used for making a choice among a set of related options.
|
|
100
|
-
* @since 2.3.0
|
|
98
|
+
/**
|
|
99
|
+
* `Select` component is used for making a choice among a set of related options.
|
|
100
|
+
* @since 2.3.0
|
|
101
101
|
*/
|
|
102
102
|
const Select = ({
|
|
103
103
|
id,
|
|
@@ -228,7 +228,7 @@ const SelectControl = /*#__PURE__*/forwardRef(function SelectControl({
|
|
|
228
228
|
"aria-hidden": "true",
|
|
229
229
|
focusable: "false"
|
|
230
230
|
}, /*#__PURE__*/React.createElement("path", {
|
|
231
|
-
d: "M.85 7.854a.498.498 0 1 1-.704-.704L3.296 4 .146.85A.498.498 0 0 1 .85.146L4 3.296 7.15.146a.498.498 0 0 1 .704.704L4.704 4l3.15 3.15a.498.498 0 0 1-.704.704L4 4.704.85 7.854z"
|
|
231
|
+
d: "M.85 7.854a.498.498 0 1 1-.704-.704L3.296 4 .146.85A.498.498 0 0 1 .85.146L4 3.296 7.15.146a.498.498 0 0 1\r .704.704L4.704 4l3.15 3.15a.498.498 0 0 1-.704.704L4 4.704.85 7.854z"
|
|
232
232
|
})))), /*#__PURE__*/React.createElement("button", {
|
|
233
233
|
type: "button",
|
|
234
234
|
className: classNames(`${baseClassName}__indicator`, `${baseClassName}__indicator--dropdown`),
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
/* eslint-disable react/no-unused-prop-types */
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
/**
|
|
7
|
-
* `Tab` is an individual element of the [Tabs](#!/Tabs) component.
|
|
8
|
-
*
|
|
9
|
-
* Each `Tab` can display an icon near the tab name for easier identification.
|
|
10
|
-
* It can also display a [Label](#!/Label) next to the tab name for showing additional information about its content.
|
|
11
|
-
* You can make `Tabs` closeable, for example, if you are using them for opening and displaying files.
|
|
12
|
-
* @since 0.0.35
|
|
6
|
+
/**
|
|
7
|
+
* `Tab` is an individual element of the [Tabs](#!/Tabs) component.
|
|
8
|
+
*
|
|
9
|
+
* Each `Tab` can display an icon near the tab name for easier identification.
|
|
10
|
+
* It can also display a [Label](#!/Label) next to the tab name for showing additional information about its content.
|
|
11
|
+
* You can make `Tabs` closeable, for example, if you are using them for opening and displaying files.
|
|
12
|
+
* @since 0.0.35
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
const Tab = ({
|
|
@@ -17,45 +17,45 @@ const Tab = ({
|
|
|
17
17
|
}) => /*#__PURE__*/React.createElement("div", null, children);
|
|
18
18
|
|
|
19
19
|
Tab.propTypes = {
|
|
20
|
-
/**
|
|
21
|
-
* Tab title
|
|
22
|
-
* @since 0.0.35
|
|
20
|
+
/**
|
|
21
|
+
* Tab title
|
|
22
|
+
* @since 0.0.35
|
|
23
23
|
*/
|
|
24
24
|
title: PropTypes.node.isRequired,
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
* Label in tab title
|
|
28
|
-
* @since 0.0.42
|
|
26
|
+
/**
|
|
27
|
+
* Label in tab title
|
|
28
|
+
* @since 0.0.42
|
|
29
29
|
*/
|
|
30
30
|
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
31
31
|
|
|
32
|
-
/**
|
|
33
|
-
* Name of icon or Icon component for tab
|
|
34
|
-
* @since 0.0.42
|
|
32
|
+
/**
|
|
33
|
+
* Name of icon or Icon component for tab
|
|
34
|
+
* @since 0.0.42
|
|
35
35
|
*/
|
|
36
36
|
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.element]),
|
|
37
37
|
|
|
38
|
-
/**
|
|
39
|
-
* Activate callback.
|
|
40
|
-
* @since 0.0.43
|
|
38
|
+
/**
|
|
39
|
+
* Activate callback.
|
|
40
|
+
* @since 0.0.43
|
|
41
41
|
*/
|
|
42
42
|
onActivate: PropTypes.func,
|
|
43
43
|
|
|
44
|
-
/**
|
|
45
|
-
* Close callback
|
|
46
|
-
* @since 0.0.58
|
|
44
|
+
/**
|
|
45
|
+
* Close callback
|
|
46
|
+
* @since 0.0.58
|
|
47
47
|
*/
|
|
48
48
|
onClose: PropTypes.func,
|
|
49
49
|
|
|
50
|
-
/**
|
|
51
|
-
* Component to render as the root element.
|
|
52
|
-
* @since 2.5.1
|
|
50
|
+
/**
|
|
51
|
+
* Component to render as the root element.
|
|
52
|
+
* @since 2.5.1
|
|
53
53
|
*/
|
|
54
54
|
component: PropTypes.elementType,
|
|
55
55
|
|
|
56
|
-
/**
|
|
57
|
-
* Tab content
|
|
58
|
-
* @since 0.0.47
|
|
56
|
+
/**
|
|
57
|
+
* Tab content
|
|
58
|
+
* @since 0.0.47
|
|
59
59
|
*/
|
|
60
60
|
children: PropTypes.node
|
|
61
61
|
};
|