@plesk/ui-library 3.28.1 → 3.28.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 +13 -6
- package/cjs/components/List/List.js +1 -6
- package/cjs/components/index.js +10 -1
- package/cjs/index.js +1 -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 +25 -14
- 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/Button/Button.js +14 -7
- package/esm/components/List/List.js +1 -6
- package/esm/components/index.js +2 -1
- package/esm/index.js +1 -1
- package/package.json +1 -1
- package/styleguide/build/bundle.699238d9.js +2 -0
- package/styleguide/build/{bundle.fa6ff17e.js.LICENSE.txt → bundle.699238d9.js.LICENSE.txt} +0 -0
- package/styleguide/index.html +2 -2
- package/types/src/components/Form/Form.d.ts +3 -54
- package/types/src/components/Form/types.d.ts +4 -4
- package/types/src/components/FormFieldPassword/FormFieldPassword.d.ts +2 -2
- package/types/src/components/index.d.ts +1 -0
- package/styleguide/build/bundle.fa6ff17e.js +0 -2
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
// Copyright 1999-2020. Plesk International GmbH. All rights reserved.
|
|
3
3
|
|
|
4
4
|
/* eslint-disable react/no-deprecated */
|
|
5
|
-
import React, { cloneElement, isValidElement, useContext, useState } from 'react';
|
|
5
|
+
import React, { cloneElement, forwardRef, isValidElement, useContext, useState } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { CLS_PREFIX } from '../../constants';
|
|
@@ -72,7 +72,7 @@ const renderCaret = ({
|
|
|
72
72
|
*/
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
const Button = ({
|
|
75
|
+
const Button = /*#__PURE__*/forwardRef(({
|
|
76
76
|
baseClassName,
|
|
77
77
|
className,
|
|
78
78
|
component: Tag,
|
|
@@ -90,7 +90,7 @@ const Button = ({
|
|
|
90
90
|
arrow,
|
|
91
91
|
disabled,
|
|
92
92
|
...props
|
|
93
|
-
}) => {
|
|
93
|
+
}, ref) => {
|
|
94
94
|
const [selectedState, setSelectedState] = useState(false);
|
|
95
95
|
|
|
96
96
|
const handleToggle = () => {
|
|
@@ -145,6 +145,7 @@ const Button = ({
|
|
|
145
145
|
const isArrowButton = arrow === 'forward' || arrow === 'backward';
|
|
146
146
|
const hasAriaDisabled = Tag === 'button' && disabled && tooltip;
|
|
147
147
|
let button = /*#__PURE__*/React.createElement(Tag, _extends({
|
|
148
|
+
ref: ref,
|
|
148
149
|
className: classNames(baseClassName, {
|
|
149
150
|
[`${baseClassName}--${size}`]: size,
|
|
150
151
|
[`${baseClassName}--${intent}`]: intent && !ghost,
|
|
@@ -184,8 +185,8 @@ const Button = ({
|
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
return button;
|
|
187
|
-
};
|
|
188
|
-
|
|
188
|
+
});
|
|
189
|
+
Button.displayName = 'Button';
|
|
189
190
|
Button.propTypes = {
|
|
190
191
|
/**
|
|
191
192
|
* Button size.
|
|
@@ -279,7 +280,12 @@ Button.propTypes = {
|
|
|
279
280
|
/**
|
|
280
281
|
* @ignore
|
|
281
282
|
*/
|
|
282
|
-
baseClassName: PropTypes.string
|
|
283
|
+
baseClassName: PropTypes.string,
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* @ignore
|
|
287
|
+
*/
|
|
288
|
+
onClick: PropTypes.func
|
|
283
289
|
};
|
|
284
290
|
Button.defaultProps = {
|
|
285
291
|
size: undefined,
|
|
@@ -297,6 +303,7 @@ Button.defaultProps = {
|
|
|
297
303
|
component: 'button',
|
|
298
304
|
className: undefined,
|
|
299
305
|
baseClassName: `${CLS_PREFIX}button`,
|
|
300
|
-
arrow: undefined
|
|
306
|
+
arrow: undefined,
|
|
307
|
+
onClick: undefined
|
|
301
308
|
};
|
|
302
309
|
export default Button;
|
|
@@ -875,14 +875,9 @@ class List extends Component {
|
|
|
875
875
|
|
|
876
876
|
if (totalRows && /*#__PURE__*/isValidElement(pagination)) {
|
|
877
877
|
const {
|
|
878
|
-
itemsPerPageOptions = ITEMS_PER_PAGE_OPTIONS
|
|
879
|
-
itemsPerPage
|
|
878
|
+
itemsPerPageOptions = ITEMS_PER_PAGE_OPTIONS
|
|
880
879
|
} = pagination.props;
|
|
881
880
|
|
|
882
|
-
if (Number.isInteger(itemsPerPage)) {
|
|
883
|
-
return totalRows > itemsPerPage;
|
|
884
|
-
}
|
|
885
|
-
|
|
886
881
|
if (Array.isArray(itemsPerPageOptions)) {
|
|
887
882
|
const numericOptions = itemsPerPageOptions.filter(v => Number(v) === v);
|
|
888
883
|
|
package/esm/components/index.js
CHANGED
|
@@ -98,4 +98,5 @@ export { default as Tour } from './Tour';
|
|
|
98
98
|
export { default as Translate } from './Translate';
|
|
99
99
|
export { default as Link } from './Link';
|
|
100
100
|
export { default as Skeleton } from './Skeleton';
|
|
101
|
-
export * from './Skeleton';
|
|
101
|
+
export * from './Skeleton';
|
|
102
|
+
export { PortalContext } from './Layer';
|
package/esm/index.js
CHANGED