@micromag/element-button 0.3.36 → 0.3.45
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/es/index.js +9 -5
- package/lib/index.js +12 -7
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
|
-
import
|
|
4
|
-
import PropTypes$1 from 'prop-types';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
4
|
import classNames from 'classnames';
|
|
5
|
+
import PropTypes$1 from 'prop-types';
|
|
6
|
+
import React from 'react';
|
|
6
7
|
import { PropTypes } from '@micromag/core';
|
|
7
8
|
import { Button as Button$1 } from '@micromag/core/components';
|
|
8
9
|
import { getStyleFromText, getStyleFromBox } from '@micromag/core/utils';
|
|
9
10
|
|
|
10
11
|
var styles = {"container":"micromag-element-button-container","active":"micromag-element-button-active","focus":"micromag-element-button-focus","disabled":"micromag-element-button-disabled"};
|
|
11
12
|
|
|
13
|
+
var _excluded = ["textStyle", "buttonStyle", "type", "disabled", "focusable", "onClick", "children", "className", "refButton"];
|
|
12
14
|
var propTypes = {
|
|
13
15
|
textStyle: PropTypes.textStyle,
|
|
14
16
|
buttonStyle: PropTypes.boxStyle,
|
|
@@ -44,7 +46,9 @@ var Button = function Button(_ref) {
|
|
|
44
46
|
onClick = _ref.onClick,
|
|
45
47
|
children = _ref.children,
|
|
46
48
|
className = _ref.className,
|
|
47
|
-
refButton = _ref.refButton
|
|
49
|
+
refButton = _ref.refButton,
|
|
50
|
+
buttonProps = _objectWithoutProperties(_ref, _excluded);
|
|
51
|
+
|
|
48
52
|
var finalStyle = null;
|
|
49
53
|
|
|
50
54
|
if (textStyle !== null) {
|
|
@@ -55,7 +59,7 @@ var Button = function Button(_ref) {
|
|
|
55
59
|
finalStyle = _objectSpread(_objectSpread({}, finalStyle), getStyleFromBox(buttonStyle));
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
return /*#__PURE__*/React.createElement(Button$1, {
|
|
62
|
+
return /*#__PURE__*/React.createElement(Button$1, Object.assign({
|
|
59
63
|
className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
|
|
60
64
|
disabled: disabled,
|
|
61
65
|
style: finalStyle,
|
|
@@ -63,7 +67,7 @@ var Button = function Button(_ref) {
|
|
|
63
67
|
refButton: refButton,
|
|
64
68
|
type: type,
|
|
65
69
|
focusable: focusable
|
|
66
|
-
}, children);
|
|
70
|
+
}, buttonProps), children);
|
|
67
71
|
};
|
|
68
72
|
|
|
69
73
|
Button.propTypes = propTypes;
|
package/lib/index.js
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
5
|
-
var
|
|
6
|
-
var PropTypes = require('prop-types');
|
|
5
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
6
|
var classNames = require('classnames');
|
|
7
|
+
var PropTypes = require('prop-types');
|
|
8
|
+
var React = require('react');
|
|
8
9
|
var core = require('@micromag/core');
|
|
9
10
|
var components = require('@micromag/core/components');
|
|
10
11
|
var utils = require('@micromag/core/utils');
|
|
@@ -13,12 +14,14 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
13
14
|
|
|
14
15
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
15
16
|
var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
|
16
|
-
var
|
|
17
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
17
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
18
18
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
19
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
20
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
21
|
|
|
20
22
|
var styles = {"container":"micromag-element-button-container","active":"micromag-element-button-active","focus":"micromag-element-button-focus","disabled":"micromag-element-button-disabled"};
|
|
21
23
|
|
|
24
|
+
var _excluded = ["textStyle", "buttonStyle", "type", "disabled", "focusable", "onClick", "children", "className", "refButton"];
|
|
22
25
|
var propTypes = {
|
|
23
26
|
textStyle: core.PropTypes.textStyle,
|
|
24
27
|
buttonStyle: core.PropTypes.boxStyle,
|
|
@@ -54,7 +57,9 @@ var Button = function Button(_ref) {
|
|
|
54
57
|
onClick = _ref.onClick,
|
|
55
58
|
children = _ref.children,
|
|
56
59
|
className = _ref.className,
|
|
57
|
-
refButton = _ref.refButton
|
|
60
|
+
refButton = _ref.refButton,
|
|
61
|
+
buttonProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
62
|
+
|
|
58
63
|
var finalStyle = null;
|
|
59
64
|
|
|
60
65
|
if (textStyle !== null) {
|
|
@@ -65,7 +70,7 @@ var Button = function Button(_ref) {
|
|
|
65
70
|
finalStyle = _objectSpread__default["default"](_objectSpread__default["default"]({}, finalStyle), utils.getStyleFromBox(buttonStyle));
|
|
66
71
|
}
|
|
67
72
|
|
|
68
|
-
return /*#__PURE__*/React__default["default"].createElement(components.Button, {
|
|
73
|
+
return /*#__PURE__*/React__default["default"].createElement(components.Button, Object.assign({
|
|
69
74
|
className: classNames__default["default"]([styles.container, _defineProperty__default["default"]({}, className, className !== null)]),
|
|
70
75
|
disabled: disabled,
|
|
71
76
|
style: finalStyle,
|
|
@@ -73,7 +78,7 @@ var Button = function Button(_ref) {
|
|
|
73
78
|
refButton: refButton,
|
|
74
79
|
type: type,
|
|
75
80
|
focusable: focusable
|
|
76
|
-
}, children);
|
|
81
|
+
}, buttonProps), children);
|
|
77
82
|
};
|
|
78
83
|
|
|
79
84
|
Button.propTypes = propTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-button",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.45",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
|
-
"@micromag/core": "^0.3.
|
|
52
|
+
"@micromag/core": "^0.3.42",
|
|
53
53
|
"classnames": "^2.2.6",
|
|
54
54
|
"prop-types": "^15.7.2",
|
|
55
55
|
"react-intl": "^5.12.1",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "c36f6e7d2bff89a65b20cd51e74139158f7d8dda"
|
|
62
62
|
}
|