@plesk/ui-library 3.31.1 → 3.31.3
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 +4 -1
- package/cjs/components/Button/ButtonContext.js +28 -0
- package/cjs/components/CodeEditor/CodeEditor.js +2 -1
- package/cjs/components/ComboBox/ComboBoxOption.js +1 -2
- package/cjs/components/Dialog/Dialog.js +17 -9
- package/cjs/components/Drawer/Drawer.js +7 -14
- package/cjs/components/Drawer/DrawerProgress.js +9 -12
- package/cjs/components/Form/Form.js +25 -23
- package/cjs/components/ItemList/ItemList.js +1 -1
- package/cjs/components/Link/Link.js +2 -1
- package/cjs/components/List/List.js +16 -9
- package/cjs/components/List/ListEmptyView.js +10 -2
- package/cjs/components/Markdown/Markdown.js +1 -3
- package/cjs/components/Select/SelectOption.js +1 -2
- package/cjs/components/Spot/SpotPopup.js +2 -0
- package/cjs/index.js +1 -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 +514 -379
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +6 -6
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/Button/Button.js +4 -1
- package/esm/components/Button/ButtonContext.js +18 -0
- package/esm/components/ComboBox/ComboBoxOption.js +1 -2
- package/esm/components/Dialog/Dialog.js +18 -10
- package/esm/components/Drawer/Drawer.js +7 -14
- package/esm/components/Drawer/DrawerProgress.js +10 -13
- package/esm/components/Form/Form.js +26 -24
- package/esm/components/Link/Link.js +3 -1
- package/esm/components/List/List.js +14 -8
- package/esm/components/List/ListEmptyView.js +10 -2
- package/esm/components/Markdown/Markdown.js +1 -3
- package/esm/components/Select/SelectOption.js +1 -2
- package/esm/components/Spot/SpotPopup.js +3 -0
- package/esm/index.js +1 -1
- package/package.json +70 -74
- package/styleguide/build/bundle.bab12e1d.js +2 -0
- package/styleguide/build/{bundle.a0fc0411.js.LICENSE.txt → bundle.bab12e1d.js.LICENSE.txt} +4 -4
- package/styleguide/images/empty-list.png +0 -0
- package/styleguide/index.html +2 -2
- package/types/package.d.ts +12 -14
- package/types/src/components/Alert/Alert.stories.d.ts +2 -2
- package/types/src/components/AutoClosable/AutoClosable.d.ts +1 -1
- package/types/src/components/Button/Button.stories.d.ts +6 -5
- package/types/src/components/Button/ButtonContext.d.ts +9 -0
- package/types/src/components/Card/PreviewPanel.d.ts +2 -2
- package/types/src/components/ClosingConfirmation/useClosingConfirmation.d.ts +1 -1
- package/types/src/components/ComboBox/ComboBox.d.ts +2 -2
- package/types/src/components/ComboBoxDropdown/ComboBoxDropdown.d.ts +2 -2
- package/types/src/components/ConsoleOutput/ConsoleOutput.d.ts +2 -2
- package/types/src/components/ContentLoader/IconsLoader.d.ts +2 -2
- package/types/src/components/Cuttable/Cuttable.d.ts +1 -1
- package/types/src/components/Cuttable/Cuttable.stories.d.ts +4 -4
- package/types/src/components/Dialog/Dialog.stories.d.ts +4 -3
- package/types/src/components/Drawer/Drawer.stories.d.ts +6 -5
- package/types/src/components/Form/Form.d.ts +9 -9
- package/types/src/components/Form/Form.stories.d.ts +3 -2
- package/types/src/components/FormFieldCheckbox/FormFieldCheckbox.stories.d.ts +3 -2
- package/types/src/components/FormFieldPassword/FormFieldPassword.d.ts +3 -3
- package/types/src/components/Icon/Icon.stories.d.ts +3 -2
- package/types/src/components/InputFile/InputFile.d.ts +2 -2
- package/types/src/components/ItemLink/ItemLink.stories.d.ts +1 -1
- package/types/src/components/ItemList/ItemList.d.ts +4 -4
- package/types/src/components/ItemList/ItemList.stories.d.ts +30 -30
- package/types/src/components/Link/Link.d.ts +2 -2
- package/types/src/components/List/List.stories.d.ts +8 -7
- package/types/src/components/List/ListAction.d.ts +2 -2
- package/types/src/components/List/ListActions.d.ts +2 -2
- package/types/src/components/List/ListActionsDivider.d.ts +1 -1
- package/types/src/components/LocaleProvider/LocaleProvider.d.ts +2 -2
- package/types/src/components/Menu/Menu.stories.d.ts +7 -6
- package/types/src/components/Panel/Panel.d.ts +1 -1
- package/types/src/components/Popover/Popover.stories.d.ts +9 -8
- package/types/src/components/Select/Select.stories.d.ts +3 -3
- package/types/src/components/Skeleton/Skeleton.stories.d.ts +2 -2
- package/types/src/components/Skeleton/SkeletonTabs.stories.d.ts +1 -1
- package/types/src/components/Skeleton/SkeletonText.stories.d.ts +6 -6
- package/types/src/components/Spot/Spot.d.ts +2 -2
- package/types/src/components/Spot/SpotPopup.d.ts +2 -2
- package/types/src/components/Squeezer/Squeezer.d.ts +2 -2
- package/types/src/components/Status/Status.stories.d.ts +3 -3
- package/types/src/components/Tabs/Tabs.stories.d.ts +3 -2
- package/types/src/components/TextArea/TextArea.d.ts +1 -1
- package/types/src/components/Toast/Toast.d.ts +2 -2
- package/types/src/components/Toaster/Toaster.d.ts +2 -2
- package/types/src/components/Toolbar/ToolbarExpander.d.ts +2 -2
- package/types/src/components/Toolbar/ToolbarItem.d.ts +1 -1
- package/types/src/components/Tour/Tour.d.ts +2 -2
- package/types/src/components/utils.d.ts +1 -1
- package/cjs/components/Drawer/ScrollDirection.js +0 -45
- package/dist/images/default.svg +0 -1
- package/dist/images/filtered.svg +0 -1
- package/esm/components/Drawer/ScrollDirection.js +0 -37
- package/styleguide/build/bundle.a0fc0411.js +0 -2
- package/styleguide/images/default.svg +0 -1
- package/styleguide/images/empty-list_256.png +0 -0
- package/styleguide/images/filtered.svg +0 -1
- package/styleguide/patterns/controls/control-button-tooltip-1-do.png +0 -0
- package/styleguide/patterns/controls/control-button-tooltip-1-dont.png +0 -0
- package/styleguide/patterns/controls/control-button-tooltip-2-do.png +0 -0
- package/styleguide/patterns/controls/control-button-tooltip-2-dont.png +0 -0
- package/styleguide/patterns/controls/control-button-tooltip-3-do.png +0 -0
- package/styleguide/patterns/controls/control-button-tooltip-3-dont.png +0 -0
- package/styleguide/patterns/dialogsWindows/autoclose.png +0 -0
- package/styleguide/patterns/dialogsWindows/focus.png +0 -0
- package/styleguide/patterns/dialogsWindows/header.png +0 -0
- package/styleguide/patterns/dialogsWindows/image.png +0 -0
- package/styleguide/patterns/dialogsWindows/list_submit.png +0 -0
- package/styleguide/patterns/dialogsWindows/new_object.png +0 -0
- package/styleguide/patterns/dialogsWindows/popover-confirm.png +0 -0
- package/styleguide/patterns/dialogsWindows/popover.png +0 -0
- package/styleguide/patterns/dialogsWindows/similar_buttons.png +0 -0
- package/styleguide/patterns/dialogsWindows/submit.png +0 -0
- package/styleguide/patterns/dialogsWindows/toast_controls.png +0 -0
- package/styleguide/patterns/dialogsWindows/toaster_intent.png +0 -0
- package/styleguide/patterns/dialogsWindows/tooltip.png +0 -0
- package/styleguide/patterns/dialogsWindows/tour.png +0 -0
- package/styleguide/patterns/dialogsWindows/when_to_show.png +0 -0
- package/styleguide/patterns/dialogsWindows/width.png +0 -0
|
@@ -31,6 +31,7 @@ const oldIconNames = {
|
|
|
31
31
|
};
|
|
32
32
|
import ResponsiveContext from '../ResponsiveContext';
|
|
33
33
|
import OnDarkContext from '../OnDarkContext';
|
|
34
|
+
import ButtonContext from './ButtonContext';
|
|
34
35
|
const renderIcon = _ref => {
|
|
35
36
|
let {
|
|
36
37
|
baseClassName,
|
|
@@ -76,7 +77,7 @@ const Button = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
76
77
|
baseClassName,
|
|
77
78
|
className,
|
|
78
79
|
component: Tag,
|
|
79
|
-
size,
|
|
80
|
+
size: propsSize,
|
|
80
81
|
intent,
|
|
81
82
|
ghost,
|
|
82
83
|
selected: selectedProp,
|
|
@@ -97,6 +98,8 @@ const Button = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
97
98
|
return !selectedState;
|
|
98
99
|
};
|
|
99
100
|
const isCollapsed = useContext(ResponsiveContext);
|
|
101
|
+
const buttonContextConfig = useContext(ButtonContext);
|
|
102
|
+
const size = propsSize || buttonContextConfig.defaultProps.size;
|
|
100
103
|
const componentProps = {};
|
|
101
104
|
if (Tag === 'button') {
|
|
102
105
|
componentProps.type = 'button';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
const defaultValue = {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
size: undefined
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
export const ButtonContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
10
|
+
export const getButtonContextValue = value => ({
|
|
11
|
+
...defaultValue,
|
|
12
|
+
...value,
|
|
13
|
+
defaultProps: {
|
|
14
|
+
...defaultValue.defaultProps,
|
|
15
|
+
...(value.defaultProps || {})
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
export default ButtonContext;
|
|
@@ -4,8 +4,7 @@ import React from 'react';
|
|
|
4
4
|
/**
|
|
5
5
|
* `ComboBoxOption` is a part of [ComboBox](#!/ComboBox) component.
|
|
6
6
|
* @since 2.6.0
|
|
7
|
-
*/
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
8
|
const ComboBoxOption = _props => {
|
|
10
9
|
// styleguidist doesn't show Props & Methods if component renders nothing
|
|
11
10
|
// eslint-disable-next-line no-constant-condition
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
// Copyright 1999-2021. Plesk International GmbH. All rights reserved.
|
|
3
3
|
|
|
4
4
|
/* eslint-disable react/no-deprecated */
|
|
5
|
-
import React, { isValidElement, useEffect, useState } from 'react';
|
|
5
|
+
import React, { isValidElement, cloneElement, useEffect, useState } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { CLS_PREFIX } from '../../constants';
|
|
@@ -77,11 +77,12 @@ const Dialog = _ref => {
|
|
|
77
77
|
className: `${classPrefix}-inner`
|
|
78
78
|
}, image)));
|
|
79
79
|
};
|
|
80
|
-
const getCancelButtonProps = ()
|
|
80
|
+
const getCancelButtonProps = function () {
|
|
81
|
+
let formProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : form;
|
|
81
82
|
if (!closable) {
|
|
82
83
|
return false;
|
|
83
84
|
}
|
|
84
|
-
if (cancelButton === false ||
|
|
85
|
+
if (cancelButton === false || formProps && formProps.cancelButton === false) {
|
|
85
86
|
return false;
|
|
86
87
|
}
|
|
87
88
|
let props = {
|
|
@@ -91,10 +92,10 @@ const Dialog = _ref => {
|
|
|
91
92
|
fallback: "Cancel"
|
|
92
93
|
})
|
|
93
94
|
};
|
|
94
|
-
if (
|
|
95
|
+
if (formProps && isProps(formProps.cancelButton)) {
|
|
95
96
|
props = {
|
|
96
97
|
...props,
|
|
97
|
-
...
|
|
98
|
+
...formProps.cancelButton
|
|
98
99
|
};
|
|
99
100
|
}
|
|
100
101
|
if (isProps(cancelButton)) {
|
|
@@ -123,10 +124,17 @@ const Dialog = _ref => {
|
|
|
123
124
|
};
|
|
124
125
|
let childrenElement;
|
|
125
126
|
if (form) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
if ( /*#__PURE__*/isValidElement(form)) {
|
|
128
|
+
childrenElement = /*#__PURE__*/cloneElement(form, {
|
|
129
|
+
cancelButton: getCancelButtonProps(form.props),
|
|
130
|
+
footerClassName: classNames(form.props.footerClassName, `${baseClassName}__form-footer`)
|
|
131
|
+
});
|
|
132
|
+
} else if (typeof form === 'object') {
|
|
133
|
+
form.cancelButton = getCancelButtonProps();
|
|
134
|
+
form.footerClassName = classNames(form.footerClassName, `${baseClassName}__form-footer`);
|
|
135
|
+
form.applyButton = form.applyButton || false;
|
|
136
|
+
childrenElement = /*#__PURE__*/React.createElement(Form, form, children);
|
|
137
|
+
}
|
|
130
138
|
} else {
|
|
131
139
|
childrenElement = children;
|
|
132
140
|
}
|
|
@@ -237,7 +245,7 @@ Dialog.propTypes = {
|
|
|
237
245
|
* Wraps children into [Form](#!/Form) if not empty.
|
|
238
246
|
* @since 0.0.68
|
|
239
247
|
*/
|
|
240
|
-
form: PropTypes.object,
|
|
248
|
+
form: PropTypes.oneOfType([PropTypes.object, PropTypes.element]),
|
|
241
249
|
/**
|
|
242
250
|
* Dialog width
|
|
243
251
|
* @since 0.0.68
|
|
@@ -8,7 +8,6 @@ import { CLS_PREFIX } from '../../constants';
|
|
|
8
8
|
import Overlay from '../Overlay';
|
|
9
9
|
import { useClosingConfirmation } from '../ClosingConfirmation';
|
|
10
10
|
import Header from './Header';
|
|
11
|
-
import ScrollDirection from './ScrollDirection';
|
|
12
11
|
import Form from '../Form';
|
|
13
12
|
import Heading from '../Heading';
|
|
14
13
|
import { isLikeText } from '../Translate';
|
|
@@ -163,7 +162,7 @@ const defaultProps = {
|
|
|
163
162
|
|
|
164
163
|
/**
|
|
165
164
|
* `Drawer` component is used for working with properties of an object (or system) without leaving the context of the object.
|
|
166
|
-
*
|
|
165
|
+
* [Read more when to use Drawer](#!/Drawers%2C%20pages%2C%20popovers).
|
|
167
166
|
* @since 0.0.65
|
|
168
167
|
*/
|
|
169
168
|
const Drawer = _ref => {
|
|
@@ -282,18 +281,12 @@ const Drawer = _ref => {
|
|
|
282
281
|
className: `${baseClassName}__title`
|
|
283
282
|
}, title), subtitle && /*#__PURE__*/React.createElement("div", {
|
|
284
283
|
className: `${baseClassName}__subtitle`
|
|
285
|
-
}, subtitle)), /*#__PURE__*/React.createElement(
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
onScroll: handleScroll,
|
|
292
|
-
ref: scrollableRef
|
|
293
|
-
}, /*#__PURE__*/React.createElement(ScrollableElementFormContext.Provider, {
|
|
294
|
-
value: scrollableRef.current
|
|
295
|
-
}, content));
|
|
296
|
-
}), footer && /*#__PURE__*/React.createElement("footer", {
|
|
284
|
+
}, subtitle)), /*#__PURE__*/React.createElement("div", {
|
|
285
|
+
className: `${baseClassName}__body`,
|
|
286
|
+
ref: scrollableRef
|
|
287
|
+
}, /*#__PURE__*/React.createElement(ScrollableElementFormContext.Provider, {
|
|
288
|
+
value: scrollableRef.current
|
|
289
|
+
}, content)), footer && /*#__PURE__*/React.createElement("footer", {
|
|
297
290
|
className: `${baseClassName}__footer`
|
|
298
291
|
}, /*#__PURE__*/React.createElement("div", {
|
|
299
292
|
className: `${baseClassName}__footer-inner`
|
|
@@ -2,24 +2,19 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
// Copyright 1999-2019. Plesk International GmbH. All rights reserved.
|
|
4
4
|
|
|
5
|
-
import React, { Component, Fragment
|
|
5
|
+
import React, { Component, Fragment } from 'react';
|
|
6
6
|
import Button from '../Button';
|
|
7
|
+
import { ButtonContext, getButtonContextValue } from '../Button/ButtonContext';
|
|
7
8
|
import Translate from '../Translate';
|
|
8
9
|
import Progress from '../Progress';
|
|
9
10
|
import ProgressStep, { STATUS_DONE, STATUS_ERROR, STATUS_NOT_STARTED } from '../ProgressStep';
|
|
10
11
|
import { CLS_PREFIX } from '../../constants';
|
|
11
12
|
import { safeInvoke } from '../utils';
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
return button;
|
|
20
|
-
};
|
|
21
|
-
return Array.isArray(buttons) ? buttons.map(buttonProcessing) : buttonProcessing(buttons);
|
|
22
|
-
};
|
|
13
|
+
const additionalButtonsConfig = getButtonContextValue({
|
|
14
|
+
defaultProps: {
|
|
15
|
+
size: 'lg'
|
|
16
|
+
}
|
|
17
|
+
});
|
|
23
18
|
class DrawerProgress extends Component {
|
|
24
19
|
constructor() {
|
|
25
20
|
super(...arguments);
|
|
@@ -120,7 +115,9 @@ class DrawerProgress extends Component {
|
|
|
120
115
|
}, step)))));
|
|
121
116
|
const footer = hasFooter ? /*#__PURE__*/React.createElement("div", {
|
|
122
117
|
className: `${baseClassName}__footer`
|
|
123
|
-
},
|
|
118
|
+
}, /*#__PURE__*/React.createElement(ButtonContext.Provider, {
|
|
119
|
+
value: additionalButtonsConfig
|
|
120
|
+
}, buttons), canCancel && /*#__PURE__*/React.createElement(Button, {
|
|
124
121
|
onClick: this.handleCancel,
|
|
125
122
|
size: "lg"
|
|
126
123
|
}, /*#__PURE__*/React.createElement(Translate, {
|
|
@@ -2,14 +2,13 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
// Copyright 1999-2020. Plesk International GmbH. All rights reserved.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import React, { createElement, Component, cloneElement, isValidElement, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
5
|
+
import React, { Component, cloneElement, isValidElement, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
8
6
|
import { getIn, setIn } from './utils';
|
|
9
7
|
import classNames from 'classnames';
|
|
10
8
|
import Measure from 'react-measure';
|
|
11
9
|
import { CLS_PREFIX } from '../../constants';
|
|
12
10
|
import Button from '../Button';
|
|
11
|
+
import { ButtonContext, getButtonContextValue } from '../Button/ButtonContext';
|
|
13
12
|
import FormField from '../FormField';
|
|
14
13
|
import Section from '../Section';
|
|
15
14
|
import Translate from '../Translate';
|
|
@@ -17,6 +16,11 @@ import FormContext from './FormContext';
|
|
|
17
16
|
import VerticalContext, { VERTICAL_BREAKPOINT } from '../VerticalContext';
|
|
18
17
|
import DisabledContext from './DisabledContext';
|
|
19
18
|
import { safeInvoke } from '../utils';
|
|
19
|
+
const actionButtonsConfig = getButtonContextValue({
|
|
20
|
+
defaultProps: {
|
|
21
|
+
size: 'lg'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
20
24
|
class Form extends Component {
|
|
21
25
|
constructor() {
|
|
22
26
|
var _this;
|
|
@@ -190,7 +194,9 @@ class Form extends Component {
|
|
|
190
194
|
} = this.props;
|
|
191
195
|
return /*#__PURE__*/React.createElement(Section, {
|
|
192
196
|
className: classNames(`${baseClassName}__footer`, footerClassName)
|
|
193
|
-
}, /*#__PURE__*/React.createElement(FormField, null,
|
|
197
|
+
}, /*#__PURE__*/React.createElement(FormField, null, /*#__PURE__*/React.createElement(ButtonContext.Provider, {
|
|
198
|
+
value: actionButtonsConfig
|
|
199
|
+
}, this.renderSubmitButton({
|
|
194
200
|
submitButton,
|
|
195
201
|
state
|
|
196
202
|
}), this.renderApplyButton({
|
|
@@ -201,7 +207,7 @@ class Form extends Component {
|
|
|
201
207
|
}), this.renderCancelButton({
|
|
202
208
|
cancelButton,
|
|
203
209
|
state
|
|
204
|
-
})));
|
|
210
|
+
}))));
|
|
205
211
|
});
|
|
206
212
|
}
|
|
207
213
|
static getDerivedStateFromProps(props, state) {
|
|
@@ -262,7 +268,6 @@ class Form extends Component {
|
|
|
262
268
|
return null;
|
|
263
269
|
}
|
|
264
270
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
265
|
-
size: "lg",
|
|
266
271
|
intent: "primary",
|
|
267
272
|
state: state === 'submit' ? 'loading' : undefined,
|
|
268
273
|
disabled: !!state,
|
|
@@ -271,9 +276,9 @@ class Form extends Component {
|
|
|
271
276
|
,
|
|
272
277
|
children: /*#__PURE__*/React.createElement(Translate, {
|
|
273
278
|
content: "Form.submitButton",
|
|
274
|
-
fallback: "
|
|
279
|
+
fallback: "Save"
|
|
275
280
|
})
|
|
276
|
-
}, submitButton));
|
|
281
|
+
}, typeof submitButton === 'object' ? submitButton : {}));
|
|
277
282
|
}
|
|
278
283
|
renderApplyButton(_ref5) {
|
|
279
284
|
let {
|
|
@@ -283,18 +288,18 @@ class Form extends Component {
|
|
|
283
288
|
if (!applyButton) {
|
|
284
289
|
return null;
|
|
285
290
|
}
|
|
286
|
-
return /*#__PURE__*/createElement(Button, {
|
|
287
|
-
|
|
288
|
-
intent: 'primary',
|
|
291
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
292
|
+
intent: "primary",
|
|
289
293
|
state: state === 'apply' ? 'loading' : undefined,
|
|
290
294
|
disabled: !!state,
|
|
291
|
-
onClick: this.handleApplyClick
|
|
295
|
+
onClick: this.handleApplyClick
|
|
296
|
+
// eslint-disable-next-line react/no-children-prop
|
|
297
|
+
,
|
|
292
298
|
children: /*#__PURE__*/React.createElement(Translate, {
|
|
293
299
|
content: "Form.applyButton",
|
|
294
300
|
fallback: "Apply"
|
|
295
|
-
})
|
|
296
|
-
|
|
297
|
-
});
|
|
301
|
+
})
|
|
302
|
+
}, typeof applyButton === 'object' ? applyButton : {}));
|
|
298
303
|
}
|
|
299
304
|
renderCancelButton(_ref6) {
|
|
300
305
|
let {
|
|
@@ -304,16 +309,16 @@ class Form extends Component {
|
|
|
304
309
|
if (!cancelButton) {
|
|
305
310
|
return null;
|
|
306
311
|
}
|
|
307
|
-
return /*#__PURE__*/createElement(Button, {
|
|
308
|
-
size: 'lg',
|
|
312
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
309
313
|
state: state === 'cancel' ? 'loading' : undefined,
|
|
310
|
-
disabled: !!state
|
|
314
|
+
disabled: !!state
|
|
315
|
+
// eslint-disable-next-line react/no-children-prop
|
|
316
|
+
,
|
|
311
317
|
children: /*#__PURE__*/React.createElement(Translate, {
|
|
312
318
|
content: "Form.cancelButton",
|
|
313
319
|
fallback: "Cancel"
|
|
314
|
-
})
|
|
315
|
-
|
|
316
|
-
});
|
|
320
|
+
})
|
|
321
|
+
}, typeof cancelButton === 'object' ? cancelButton : {}));
|
|
317
322
|
}
|
|
318
323
|
renderAdditionalButtons(_ref7) {
|
|
319
324
|
let {
|
|
@@ -328,9 +333,6 @@ class Form extends Component {
|
|
|
328
333
|
const props = {
|
|
329
334
|
className: classNames(element.props.className, `${baseClassName}__additional-button`)
|
|
330
335
|
};
|
|
331
|
-
if (element.type === Button) {
|
|
332
|
-
props.size = 'lg';
|
|
333
|
-
}
|
|
334
336
|
return /*#__PURE__*/cloneElement(element, props);
|
|
335
337
|
}
|
|
336
338
|
return element;
|
|
@@ -7,11 +7,13 @@ import { CLS_PREFIX } from '../../constants';
|
|
|
7
7
|
import OnDarkContext from '../OnDarkContext';
|
|
8
8
|
import { wrapFunction } from '../utils';
|
|
9
9
|
import Icon from '../Icon';
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line space-infix-ops
|
|
12
|
+
|
|
10
13
|
/**
|
|
11
14
|
* FIXME: With the following code all @ts-ignore comments can be removed, but react-docgen cannot parse it.
|
|
12
15
|
* const Link = <P extends any>({ ... }: LinkProps<P>) => {
|
|
13
16
|
*/
|
|
14
|
-
|
|
15
17
|
/**
|
|
16
18
|
* `Link` is used for navigation purposes.
|
|
17
19
|
* @since 1.9.0
|
|
@@ -365,14 +365,7 @@ class List extends Component {
|
|
|
365
365
|
}
|
|
366
366
|
componentDidMount() {
|
|
367
367
|
if (this.props.reorderable) {
|
|
368
|
-
|
|
369
|
-
let {
|
|
370
|
-
List: ReorderableList
|
|
371
|
-
} = _ref7;
|
|
372
|
-
this.setState({
|
|
373
|
-
ReorderableList
|
|
374
|
-
});
|
|
375
|
-
});
|
|
368
|
+
this.applyReorderableList();
|
|
376
369
|
}
|
|
377
370
|
}
|
|
378
371
|
componentDidUpdate(prevProps) {
|
|
@@ -388,6 +381,19 @@ class List extends Component {
|
|
|
388
381
|
});
|
|
389
382
|
this.needScroll = false;
|
|
390
383
|
}
|
|
384
|
+
if (prevProps.reorderable !== this.props.reorderable && this.props.reorderable) {
|
|
385
|
+
this.applyReorderableList();
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
applyReorderableList() {
|
|
389
|
+
import( /* webpackChunkName: "react-movable" */'@plesk/react-movable').then(_ref7 => {
|
|
390
|
+
let {
|
|
391
|
+
List: ReorderableList
|
|
392
|
+
} = _ref7;
|
|
393
|
+
this.setState({
|
|
394
|
+
ReorderableList
|
|
395
|
+
});
|
|
396
|
+
});
|
|
391
397
|
}
|
|
392
398
|
getData() {
|
|
393
399
|
const {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
// Copyright 1999-
|
|
2
|
+
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
3
3
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import classNames from 'classnames';
|
|
@@ -8,6 +8,7 @@ import Translate from '../Translate';
|
|
|
8
8
|
import empty from './images/default.png';
|
|
9
9
|
import filtered from './images/filtered.png';
|
|
10
10
|
import { CLS_PREFIX } from '../../constants';
|
|
11
|
+
import { ButtonContext, getButtonContextValue } from '../Button/ButtonContext';
|
|
11
12
|
const createImage = (baseClassName, image, reason) => {
|
|
12
13
|
if (image === undefined) {
|
|
13
14
|
image = reason === 'filtered' ? filtered : empty;
|
|
@@ -53,6 +54,11 @@ const createDescription = (baseClassName, description, reason) => {
|
|
|
53
54
|
className: `${baseClassName}__description`
|
|
54
55
|
}, description);
|
|
55
56
|
};
|
|
57
|
+
const buttonConfig = getButtonContextValue({
|
|
58
|
+
defaultProps: {
|
|
59
|
+
size: 'lg'
|
|
60
|
+
}
|
|
61
|
+
});
|
|
56
62
|
|
|
57
63
|
/**
|
|
58
64
|
* `ListEmptyView` component is used for displaying "empty" state of [List](#!/List)
|
|
@@ -76,6 +82,8 @@ const ListEmptyView = _ref => {
|
|
|
76
82
|
className: `${baseClassName}__body`
|
|
77
83
|
}, createTitle(baseClassName, title, reason), createDescription(baseClassName, description, reason), actions && /*#__PURE__*/React.createElement("div", {
|
|
78
84
|
className: `${baseClassName}__actions`
|
|
79
|
-
},
|
|
85
|
+
}, /*#__PURE__*/React.createElement(ButtonContext.Provider, {
|
|
86
|
+
value: buttonConfig
|
|
87
|
+
}, actions))));
|
|
80
88
|
};
|
|
81
89
|
export default ListEmptyView;
|
|
@@ -4,8 +4,7 @@ import React from 'react';
|
|
|
4
4
|
/**
|
|
5
5
|
* `SelectOption` is a part of [SelectOptionGroup](#!/SelectOptionGroup) component.
|
|
6
6
|
* @since 2.3.0
|
|
7
|
-
*/
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
8
|
const SelectOption = _props => {
|
|
10
9
|
// styleguidist doesn't show Props & Methods if component renders nothing
|
|
11
10
|
// eslint-disable-next-line no-constant-condition
|
|
@@ -9,6 +9,9 @@ import Text from '../Text';
|
|
|
9
9
|
import Translate from '../Translate';
|
|
10
10
|
import Focuser from '../Overlay/Focuser';
|
|
11
11
|
import { safeInvoke } from '../utils';
|
|
12
|
+
|
|
13
|
+
// TODO: Use SpotSpotProps['popup'] instead of copypaste
|
|
14
|
+
|
|
12
15
|
const SpotPopup = _ref => {
|
|
13
16
|
let {
|
|
14
17
|
baseClassName = `${CLS_PREFIX}spot-popup`,
|
package/esm/index.js
CHANGED