@instructure/ui-expandable 8.12.1-snapshot.7 → 8.13.1-snapshot.9

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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [8.13.0](https://github.com/instructure/instructure-ui/compare/v8.12.0...v8.13.0) (2021-12-01)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-expandable
9
+
6
10
  # [8.12.0](https://github.com/instructure/instructure-ui/compare/v8.11.1...v8.12.0) (2021-11-17)
7
11
 
8
12
  **Note:** Version bump only for package @instructure/ui-expandable
@@ -26,11 +26,12 @@ import { uid } from '@instructure/uid';
26
26
  import { createChainedFunction } from '@instructure/ui-utils';
27
27
  import { propTypes, allowedProps } from './props';
28
28
 
29
- const toggleExpanded = ({
30
- expanded
31
- }) => ({
32
- expanded: !expanded
33
- });
29
+ const toggleExpanded = _ref => {
30
+ let expanded = _ref.expanded;
31
+ return {
32
+ expanded: !expanded
33
+ };
34
+ };
34
35
  /**
35
36
  ---
36
37
  category: components/utilities
@@ -62,7 +63,8 @@ class Expandable extends Component {
62
63
  return this.isControlled() ? this.props.expanded : this.state.expanded;
63
64
  }
64
65
 
65
- isControlled(props = this.props) {
66
+ isControlled() {
67
+ let props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props;
66
68
  return typeof props.expanded === 'boolean';
67
69
  }
68
70
 
@@ -79,6 +81,8 @@ class Expandable extends Component {
79
81
  }
80
82
 
81
83
  render() {
84
+ var _this = this;
85
+
82
86
  const _this$props = this.props,
83
87
  children = _this$props.children,
84
88
  _this$props$render = _this$props.render,
@@ -87,11 +91,12 @@ class Expandable extends Component {
87
91
  if (typeof render === 'function') {
88
92
  return render({
89
93
  expanded: this.expanded,
90
- getToggleProps: (props = {}) => {
94
+ getToggleProps: function () {
95
+ let props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
91
96
  return {
92
- 'aria-controls': this._contentId,
93
- 'aria-expanded': this.expanded,
94
- onClick: createChainedFunction(this.handleToggle, props.onClick),
97
+ 'aria-controls': _this._contentId,
98
+ 'aria-expanded': _this.expanded,
99
+ onClick: createChainedFunction(_this.handleToggle, props.onClick),
95
100
  ...props
96
101
  };
97
102
  },
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Expandable = exports.default = void 0;
6
+ exports.default = exports.Expandable = void 0;
7
7
 
8
8
  var _react = require("react");
9
9
 
@@ -36,11 +36,12 @@ var _props = require("./props");
36
36
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37
37
  * SOFTWARE.
38
38
  */
39
- const toggleExpanded = ({
40
- expanded
41
- }) => ({
42
- expanded: !expanded
43
- });
39
+ const toggleExpanded = _ref => {
40
+ let expanded = _ref.expanded;
41
+ return {
42
+ expanded: !expanded
43
+ };
44
+ };
44
45
  /**
45
46
  ---
46
47
  category: components/utilities
@@ -72,7 +73,8 @@ class Expandable extends _react.Component {
72
73
  return this.isControlled() ? this.props.expanded : this.state.expanded;
73
74
  }
74
75
 
75
- isControlled(props = this.props) {
76
+ isControlled() {
77
+ let props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props;
76
78
  return typeof props.expanded === 'boolean';
77
79
  }
78
80
 
@@ -89,6 +91,8 @@ class Expandable extends _react.Component {
89
91
  }
90
92
 
91
93
  render() {
94
+ var _this = this;
95
+
92
96
  const _this$props = this.props,
93
97
  children = _this$props.children,
94
98
  _this$props$render = _this$props.render,
@@ -97,11 +101,12 @@ class Expandable extends _react.Component {
97
101
  if (typeof render === 'function') {
98
102
  return render({
99
103
  expanded: this.expanded,
100
- getToggleProps: (props = {}) => {
104
+ getToggleProps: function () {
105
+ let props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
101
106
  return {
102
- 'aria-controls': this._contentId,
103
- 'aria-expanded': this.expanded,
104
- onClick: (0, _createChainedFunction.createChainedFunction)(this.handleToggle, props.onClick),
107
+ 'aria-controls': _this._contentId,
108
+ 'aria-expanded': _this.expanded,
109
+ onClick: (0, _createChainedFunction.createChainedFunction)(_this.handleToggle, props.onClick),
105
110
  ...props
106
111
  };
107
112
  },
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.allowedProps = exports.propTypes = void 0;
8
+ exports.propTypes = exports.allowedProps = void 0;
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-expandable",
3
- "version": "8.12.1-snapshot.7+1e7ac8219",
3
+ "version": "8.13.1-snapshot.9+f32ba918e",
4
4
  "description": "A utility component for show/hide functionality",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -25,16 +25,16 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.13.10",
28
- "@instructure/ui-prop-types": "8.12.1-snapshot.7+1e7ac8219",
29
- "@instructure/ui-testable": "8.12.1-snapshot.7+1e7ac8219",
30
- "@instructure/ui-utils": "8.12.1-snapshot.7+1e7ac8219",
31
- "@instructure/uid": "8.12.1-snapshot.7+1e7ac8219",
28
+ "@instructure/ui-prop-types": "8.13.1-snapshot.9+f32ba918e",
29
+ "@instructure/ui-testable": "8.13.1-snapshot.9+f32ba918e",
30
+ "@instructure/ui-utils": "8.13.1-snapshot.9+f32ba918e",
31
+ "@instructure/uid": "8.13.1-snapshot.9+f32ba918e",
32
32
  "prop-types": "^15"
33
33
  },
34
34
  "devDependencies": {
35
- "@instructure/ui-babel-preset": "8.12.1-snapshot.7+1e7ac8219",
36
- "@instructure/ui-color-utils": "8.12.1-snapshot.7+1e7ac8219",
37
- "@instructure/ui-test-utils": "8.12.1-snapshot.7+1e7ac8219"
35
+ "@instructure/ui-babel-preset": "8.13.1-snapshot.9+f32ba918e",
36
+ "@instructure/ui-color-utils": "8.13.1-snapshot.9+f32ba918e",
37
+ "@instructure/ui-test-utils": "8.13.1-snapshot.9+f32ba918e"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": ">=16.8 <=17"
@@ -43,5 +43,5 @@
43
43
  "access": "public"
44
44
  },
45
45
  "sideEffects": false,
46
- "gitHead": "1e7ac821932a91fe9ef761c96f747c7ea1f3925a"
46
+ "gitHead": "f32ba918e4d3ce76c6ee95c856584d00a9d80958"
47
47
  }