@gridsuite/commons-ui 0.37.0 → 0.38.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.
@@ -497,7 +497,7 @@ var TopBar = function TopBar(_ref2) {
497
497
  defaultMessage: 'Settings'
498
498
  })))), /*#__PURE__*/React.createElement(StyledMenuItem, {
499
499
  sx: styles.borderBottom,
500
- disabled: true,
500
+ disabled: !onAboutClick,
501
501
  style: {
502
502
  opacity: '1'
503
503
  },
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { Button } from '@mui/material';
3
+ import { FormattedMessage } from 'react-intl';
4
+ import PropTypes from 'prop-types';
5
+ var CancelButton = function CancelButton(_ref) {
6
+ var onClick = _ref.onClick,
7
+ variant = _ref.variant,
8
+ disabled = _ref.disabled,
9
+ _ref$withCustomColor = _ref.withCustomColor,
10
+ withCustomColor = _ref$withCustomColor === void 0 ? true : _ref$withCustomColor;
11
+ return /*#__PURE__*/React.createElement(Button, {
12
+ onClick: onClick,
13
+ variant: variant,
14
+ disabled: disabled,
15
+ color: withCustomColor ? 'customButton' : 'primary'
16
+ }, /*#__PURE__*/React.createElement(FormattedMessage, {
17
+ id: "cancel"
18
+ }));
19
+ };
20
+ CancelButton.propTypes = process.env.NODE_ENV !== "production" ? {
21
+ onClick: PropTypes.func.isRequired,
22
+ variant: PropTypes.string,
23
+ disabled: PropTypes.bool,
24
+ withCustomColor: PropTypes.bool
25
+ } : {};
26
+ export default CancelButton;
package/es/index.js CHANGED
@@ -64,4 +64,5 @@ export { default as MidFormError } from './components/react-hook-form/error-mana
64
64
  export { default as TextFieldWithAdornment } from './components/react-hook-form/utils/text-field-with-adornment';
65
65
  export { default as FieldLabel } from './components/react-hook-form/utils/field-label';
66
66
  export { default as SubmitButton } from './components/react-hook-form/utils/submit-button';
67
+ export { default as CancelButton } from './components/react-hook-form/utils/cancel-button';
67
68
  export { genHelperPreviousValue, genHelperError, identity, isFieldRequired } from './components/react-hook-form/utils/functions';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.37.0",
3
+ "version": "0.38.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "npm": ">=9",