@instructure/ui-grid 11.7.3-snapshot-25 → 11.7.3-snapshot-26

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.
@@ -28,12 +28,14 @@
28
28
  * @return {Object} The final theme object with the overrides and component variables
29
29
  */
30
30
  const generateComponentTheme = theme => {
31
- const spacing = theme.spacing,
32
- media = theme.media;
31
+ const {
32
+ spacing,
33
+ media
34
+ } = theme;
33
35
  const componentVariables = {
34
- spacingSmall: spacing === null || spacing === void 0 ? void 0 : spacing.small,
35
- spacingMedium: spacing === null || spacing === void 0 ? void 0 : spacing.medium,
36
- spacingLarge: spacing === null || spacing === void 0 ? void 0 : spacing.large,
36
+ spacingSmall: spacing?.small,
37
+ spacingMedium: spacing?.medium,
38
+ spacingLarge: spacing?.large,
37
39
  ...media
38
40
  };
39
41
  return {
@@ -1,7 +1,4 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- const _excluded = ["styles", "makeStyles"],
3
- _excluded2 = ["styles"];
4
- var _dec, _class, _GridRow;
1
+ var _dec, _class;
5
2
  /*
6
3
  * The MIT License (MIT)
7
4
  *
@@ -39,27 +36,30 @@ parent: Grid
39
36
  id: Grid.Row
40
37
  ---
41
38
  **/
42
- let GridRow = (_dec = withStyle(generateStyle), _dec(_class = (_GridRow = class GridRow extends Component {
43
- constructor(...args) {
44
- super(...args);
45
- this.ref = null;
46
- this.handleRef = el => {
47
- this.ref = el;
48
- };
49
- }
39
+ let GridRow = (_dec = withStyle(generateStyle), _dec(_class = class GridRow extends Component {
40
+ static displayName = "GridRow";
41
+ static componentId = 'Grid.Row';
42
+ static allowedProps = allowedProps;
43
+ static defaultProps = {
44
+ children: null,
45
+ isLastRow: false
46
+ };
47
+ ref = null;
48
+ handleRef = el => {
49
+ this.ref = el;
50
+ };
50
51
  componentDidMount() {
51
- var _this$props$makeStyle, _this$props;
52
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
52
+ this.props.makeStyles?.();
53
53
  }
54
54
  componentDidUpdate() {
55
- var _this$props$makeStyle2, _this$props2;
56
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
55
+ this.props.makeStyles?.();
57
56
  }
58
57
  renderChildren() {
59
- const _this$props3 = this.props,
60
- styles = _this$props3.styles,
61
- makeStyles = _this$props3.makeStyles,
62
- props = _objectWithoutProperties(_this$props3, _excluded);
58
+ const {
59
+ styles,
60
+ makeStyles,
61
+ ...props
62
+ } = this.props;
63
63
  return Children.map(this.props.children, (child, index) => {
64
64
  if (matchComponentTypes(child, [GridCol])) {
65
65
  return safeCloneElement(child, {
@@ -74,20 +74,18 @@ let GridRow = (_dec = withStyle(generateStyle), _dec(_class = (_GridRow = class
74
74
  });
75
75
  }
76
76
  render() {
77
- const _this$props4 = this.props,
78
- styles = _this$props4.styles,
79
- restProps = _objectWithoutProperties(_this$props4, _excluded2);
77
+ const {
78
+ styles,
79
+ ...restProps
80
+ } = this.props;
80
81
  const props = omitProps(restProps, GridRow.allowedProps);
81
82
  return _jsx("span", {
82
83
  ...props,
83
- css: styles === null || styles === void 0 ? void 0 : styles.gridRow,
84
+ css: styles?.gridRow,
84
85
  ref: this.handleRef,
85
86
  children: this.renderChildren()
86
87
  });
87
88
  }
88
- }, _GridRow.displayName = "GridRow", _GridRow.componentId = 'Grid.Row', _GridRow.allowedProps = allowedProps, _GridRow.defaultProps = {
89
- children: null,
90
- isLastRow: false
91
- }, _GridRow)) || _class);
89
+ }) || _class);
92
90
  export default GridRow;
93
91
  export { GridRow };
@@ -33,13 +33,15 @@
33
33
  * @return {Object} The final style object, which will be used in the component
34
34
  */
35
35
  const generateStyle = (componentTheme, props) => {
36
- const hAlign = props.hAlign,
37
- vAlign = props.vAlign,
38
- rowSpacing = props.rowSpacing,
39
- colSpacing = props.colSpacing,
40
- isLastRow = props.isLastRow,
41
- startAt = props.startAt,
42
- visualDebug = props.visualDebug;
36
+ const {
37
+ hAlign,
38
+ vAlign,
39
+ rowSpacing,
40
+ colSpacing,
41
+ isLastRow,
42
+ startAt,
43
+ visualDebug
44
+ } = props;
43
45
  const getGridRowStyle = () => {
44
46
  const hAlignVariants = {
45
47
  center: {
@@ -18,7 +18,6 @@ Object.defineProperty(exports, "GridRow", {
18
18
  }
19
19
  });
20
20
  exports.default = void 0;
21
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
22
21
  var _react = require("react");
23
22
  var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
24
23
  var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
@@ -31,9 +30,7 @@ var _styles = _interopRequireDefault(require("./styles"));
31
30
  var _theme = _interopRequireDefault(require("./theme"));
32
31
  var _props = require("./props");
33
32
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
34
- const _excluded = ["styles", "makeStyles"],
35
- _excluded2 = ["styles"];
36
- var _dec, _class, _Grid;
33
+ var _dec, _class;
37
34
  /*
38
35
  * The MIT License (MIT)
39
36
  *
@@ -62,27 +59,37 @@ var _dec, _class, _Grid;
62
59
  category: components
63
60
  ---
64
61
  **/
65
- let Grid = exports.Grid = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = (_Grid = class Grid extends _react.Component {
66
- constructor(...args) {
67
- super(...args);
68
- this.ref = null;
69
- this.handleRef = el => {
70
- this.ref = el;
71
- };
72
- }
62
+ let Grid = exports.Grid = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class Grid extends _react.Component {
63
+ static displayName = "Grid";
64
+ static componentId = 'Grid';
65
+ static allowedProps = _props.allowedProps;
66
+ static defaultProps = {
67
+ colSpacing: 'medium',
68
+ rowSpacing: 'medium',
69
+ hAlign: 'start',
70
+ startAt: 'small',
71
+ vAlign: 'top',
72
+ visualDebug: false,
73
+ children: null
74
+ };
75
+ static Row = _v.GridRow;
76
+ static Col = _v2.GridCol;
77
+ ref = null;
78
+ handleRef = el => {
79
+ this.ref = el;
80
+ };
73
81
  componentDidMount() {
74
- var _this$props$makeStyle, _this$props;
75
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
82
+ this.props.makeStyles?.();
76
83
  }
77
84
  componentDidUpdate() {
78
- var _this$props$makeStyle2, _this$props2;
79
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
85
+ this.props.makeStyles?.();
80
86
  }
81
87
  renderChildren() {
82
- const _this$props3 = this.props,
83
- styles = _this$props3.styles,
84
- makeStyles = _this$props3.makeStyles,
85
- props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
88
+ const {
89
+ styles,
90
+ makeStyles,
91
+ ...props
92
+ } = this.props;
86
93
  const children = _react.Children.toArray(this.props.children);
87
94
  return children.map((child, index) => {
88
95
  if ((0, _matchComponentTypes.matchComponentTypes)(child, [_v.GridRow])) {
@@ -97,24 +104,17 @@ let Grid = exports.Grid = (_dec = (0, _emotion.withStyleLegacy)(_styles.default,
97
104
  });
98
105
  }
99
106
  render() {
100
- const _this$props4 = this.props,
101
- styles = _this$props4.styles,
102
- restProps = (0, _objectWithoutProperties2.default)(_this$props4, _excluded2);
107
+ const {
108
+ styles,
109
+ ...restProps
110
+ } = this.props;
103
111
  const props = (0, _omitProps.omitProps)(restProps, Grid.allowedProps);
104
112
  return (0, _jsxRuntime.jsx)("span", {
105
113
  ...props,
106
- css: styles === null || styles === void 0 ? void 0 : styles.grid,
114
+ css: styles?.grid,
107
115
  ref: this.handleRef,
108
116
  children: this.renderChildren()
109
117
  });
110
118
  }
111
- }, _Grid.displayName = "Grid", _Grid.componentId = 'Grid', _Grid.allowedProps = _props.allowedProps, _Grid.defaultProps = {
112
- colSpacing: 'medium',
113
- rowSpacing: 'medium',
114
- hAlign: 'start',
115
- startAt: 'small',
116
- vAlign: 'top',
117
- visualDebug: false,
118
- children: null
119
- }, _Grid.Row = _v.GridRow, _Grid.Col = _v2.GridCol, _Grid)) || _class);
119
+ }) || _class);
120
120
  var _default = exports.default = Grid;
@@ -39,8 +39,10 @@ exports.default = void 0;
39
39
  * @return {Object} The final style object, which will be used in the component
40
40
  */
41
41
  const generateStyle = (componentTheme, props) => {
42
- const startAt = props.startAt,
43
- visualDebug = props.visualDebug;
42
+ const {
43
+ startAt,
44
+ visualDebug
45
+ } = props;
44
46
  const getStartAtVariants = breakpoint => !!startAt && startAt === breakpoint ? {
45
47
  boxSizing: 'border-box'
46
48
  } : {};
@@ -34,12 +34,14 @@ exports.default = void 0;
34
34
  * @return {Object} The final theme object with the overrides and component variables
35
35
  */
36
36
  const generateComponentTheme = theme => {
37
- const spacing = theme.spacing,
38
- media = theme.media;
37
+ const {
38
+ spacing,
39
+ media
40
+ } = theme;
39
41
  const componentVariables = {
40
- spacingSmall: spacing === null || spacing === void 0 ? void 0 : spacing.small,
41
- spacingMedium: spacing === null || spacing === void 0 ? void 0 : spacing.medium,
42
- spacingLarge: spacing === null || spacing === void 0 ? void 0 : spacing.large,
42
+ spacingSmall: spacing?.small,
43
+ spacingMedium: spacing?.medium,
44
+ spacingLarge: spacing?.large,
43
45
  ...media
44
46
  };
45
47
  return {
@@ -18,7 +18,6 @@ Object.defineProperty(exports, "GridRow", {
18
18
  }
19
19
  });
20
20
  exports.default = void 0;
21
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
22
21
  var _react = require("react");
23
22
  var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
24
23
  var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
@@ -30,9 +29,7 @@ var _emotion = require("@instructure/emotion");
30
29
  var _styles = _interopRequireDefault(require("./styles"));
31
30
  var _props = require("./props");
32
31
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
33
- const _excluded = ["styles", "makeStyles"],
34
- _excluded2 = ["styles"];
35
- var _dec, _class, _Grid;
32
+ var _dec, _class;
36
33
  /*
37
34
  * The MIT License (MIT)
38
35
  *
@@ -61,27 +58,37 @@ var _dec, _class, _Grid;
61
58
  category: components
62
59
  ---
63
60
  **/
64
- let Grid = exports.Grid = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = (_Grid = class Grid extends _react.Component {
65
- constructor(...args) {
66
- super(...args);
67
- this.ref = null;
68
- this.handleRef = el => {
69
- this.ref = el;
70
- };
71
- }
61
+ let Grid = exports.Grid = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = class Grid extends _react.Component {
62
+ static displayName = "Grid";
63
+ static componentId = 'Grid';
64
+ static allowedProps = _props.allowedProps;
65
+ static defaultProps = {
66
+ colSpacing: 'medium',
67
+ rowSpacing: 'medium',
68
+ hAlign: 'start',
69
+ startAt: 'small',
70
+ vAlign: 'top',
71
+ visualDebug: false,
72
+ children: null
73
+ };
74
+ static Row = _v.GridRow;
75
+ static Col = _v2.GridCol;
76
+ ref = null;
77
+ handleRef = el => {
78
+ this.ref = el;
79
+ };
72
80
  componentDidMount() {
73
- var _this$props$makeStyle, _this$props;
74
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
81
+ this.props.makeStyles?.();
75
82
  }
76
83
  componentDidUpdate() {
77
- var _this$props$makeStyle2, _this$props2;
78
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
84
+ this.props.makeStyles?.();
79
85
  }
80
86
  renderChildren() {
81
- const _this$props3 = this.props,
82
- styles = _this$props3.styles,
83
- makeStyles = _this$props3.makeStyles,
84
- props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
87
+ const {
88
+ styles,
89
+ makeStyles,
90
+ ...props
91
+ } = this.props;
85
92
  const children = _react.Children.toArray(this.props.children);
86
93
  return children.map((child, index) => {
87
94
  if ((0, _matchComponentTypes.matchComponentTypes)(child, [_v.GridRow])) {
@@ -96,24 +103,17 @@ let Grid = exports.Grid = (_dec = (0, _emotion.withStyle)(_styles.default), _dec
96
103
  });
97
104
  }
98
105
  render() {
99
- const _this$props4 = this.props,
100
- styles = _this$props4.styles,
101
- restProps = (0, _objectWithoutProperties2.default)(_this$props4, _excluded2);
106
+ const {
107
+ styles,
108
+ ...restProps
109
+ } = this.props;
102
110
  const props = (0, _omitProps.omitProps)(restProps, Grid.allowedProps);
103
111
  return (0, _jsxRuntime.jsx)("span", {
104
112
  ...props,
105
- css: styles === null || styles === void 0 ? void 0 : styles.grid,
113
+ css: styles?.grid,
106
114
  ref: this.handleRef,
107
115
  children: this.renderChildren()
108
116
  });
109
117
  }
110
- }, _Grid.displayName = "Grid", _Grid.componentId = 'Grid', _Grid.allowedProps = _props.allowedProps, _Grid.defaultProps = {
111
- colSpacing: 'medium',
112
- rowSpacing: 'medium',
113
- hAlign: 'start',
114
- startAt: 'small',
115
- vAlign: 'top',
116
- visualDebug: false,
117
- children: null
118
- }, _Grid.Row = _v.GridRow, _Grid.Col = _v2.GridCol, _Grid)) || _class);
118
+ }) || _class);
119
119
  var _default = exports.default = Grid;
@@ -39,8 +39,10 @@ exports.default = void 0;
39
39
  * @return {Object} The final style object, which will be used in the component
40
40
  */
41
41
  const generateStyle = (componentTheme, props) => {
42
- const startAt = props.startAt,
43
- visualDebug = props.visualDebug;
42
+ const {
43
+ startAt,
44
+ visualDebug
45
+ } = props;
44
46
  const getStartAtVariants = breakpoint => !!startAt && startAt === breakpoint ? {
45
47
  boxSizing: 'border-box'
46
48
  } : {};
@@ -13,7 +13,7 @@ var _styles = _interopRequireDefault(require("./styles"));
13
13
  var _theme = _interopRequireDefault(require("./theme"));
14
14
  var _props = require("./props");
15
15
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
16
- var _dec, _class, _GridCol;
16
+ var _dec, _class;
17
17
  /*
18
18
  * The MIT License (MIT)
19
19
  *
@@ -43,20 +43,30 @@ parent: Grid
43
43
  id: Grid.Col
44
44
  ---
45
45
  **/
46
- let GridCol = exports.GridCol = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = (_GridCol = class GridCol extends _react.Component {
47
- constructor(...args) {
48
- super(...args);
49
- this.ref = null;
50
- this.handleRef = el => {
51
- const elementRef = this.props.elementRef;
52
- this.ref = el;
53
- if (typeof elementRef === 'function') {
54
- elementRef(el);
55
- }
56
- };
57
- }
46
+ let GridCol = exports.GridCol = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class GridCol extends _react.Component {
47
+ static displayName = "GridCol";
48
+ static componentId = 'Grid.Col';
49
+ static allowedProps = _props.allowedProps;
50
+ static defaultProps = {
51
+ textAlign: 'inherit',
52
+ children: null,
53
+ isLastCol: false,
54
+ isLastRow: false
55
+ };
56
+ ref = null;
57
+ handleRef = el => {
58
+ const {
59
+ elementRef
60
+ } = this.props;
61
+ this.ref = el;
62
+ if (typeof elementRef === 'function') {
63
+ elementRef(el);
64
+ }
65
+ };
58
66
  widthCheck() {
59
- const width = this.props.width;
67
+ const {
68
+ width
69
+ } = this.props;
60
70
  let shouldWarn = false;
61
71
  if (width) {
62
72
  if (typeof width === 'number' && width <= 0) {
@@ -76,31 +86,25 @@ let GridCol = exports.GridCol = (_dec = (0, _emotion.withStyleLegacy)(_styles.de
76
86
  }
77
87
  }
78
88
  componentDidMount() {
79
- var _this$props$makeStyle, _this$props;
80
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
89
+ this.props.makeStyles?.();
81
90
  this.widthCheck();
82
91
  }
83
92
  componentDidUpdate() {
84
- var _this$props$makeStyle2, _this$props2;
85
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
93
+ this.props.makeStyles?.();
86
94
  this.widthCheck();
87
95
  }
88
96
  render() {
89
- const _this$props3 = this.props,
90
- children = _this$props3.children,
91
- styles = _this$props3.styles;
97
+ const {
98
+ children,
99
+ styles
100
+ } = this.props;
92
101
  const props = (0, _omitProps.omitProps)(this.props, GridCol.allowedProps);
93
102
  return (0, _jsxRuntime.jsx)("span", {
94
103
  ...props,
95
104
  ref: this.handleRef,
96
- css: styles === null || styles === void 0 ? void 0 : styles.gridCol,
105
+ css: styles?.gridCol,
97
106
  children: children
98
107
  });
99
108
  }
100
- }, _GridCol.displayName = "GridCol", _GridCol.componentId = 'Grid.Col', _GridCol.allowedProps = _props.allowedProps, _GridCol.defaultProps = {
101
- textAlign: 'inherit',
102
- children: null,
103
- isLastCol: false,
104
- isLastRow: false
105
- }, _GridCol)) || _class);
109
+ }) || _class);
106
110
  var _default = exports.default = GridCol;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ require("core-js/modules/es.array.includes.js");
7
8
  /*
8
9
  * The MIT License (MIT)
9
10
  *
@@ -39,14 +40,16 @@ exports.default = void 0;
39
40
  * @return {Object} The final style object, which will be used in the component
40
41
  */
41
42
  const generateStyle = (componentTheme, props) => {
42
- const vAlign = props.vAlign,
43
- textAlign = props.textAlign,
44
- rowSpacing = props.rowSpacing,
45
- colSpacing = props.colSpacing,
46
- isLastRow = props.isLastRow,
47
- isLastCol = props.isLastCol,
48
- startAt = props.startAt,
49
- visualDebug = props.visualDebug;
43
+ const {
44
+ vAlign,
45
+ textAlign,
46
+ rowSpacing,
47
+ colSpacing,
48
+ isLastRow,
49
+ isLastCol,
50
+ startAt,
51
+ visualDebug
52
+ } = props;
50
53
  const rowSpacingVariants = {
51
54
  small: {
52
55
  marginBottom: componentTheme.spacingSmall
@@ -124,7 +127,9 @@ const generateStyle = (componentTheme, props) => {
124
127
  return enabledBreakpoints().includes(breakpoint);
125
128
  };
126
129
  const getColSize = breakpoint => {
127
- let width = props.width;
130
+ let {
131
+ width
132
+ } = props;
128
133
  if (!width) return;
129
134
  if (width && typeof width === 'object') {
130
135
  width = width[breakpoint === 'x-large' ? 'xLarge' : breakpoint];
@@ -132,7 +137,9 @@ const generateStyle = (componentTheme, props) => {
132
137
  return width;
133
138
  };
134
139
  const getColOffset = breakpoint => {
135
- let offset = props.offset;
140
+ let {
141
+ offset
142
+ } = props;
136
143
  if (!offset) return;
137
144
  if (offset && typeof offset === 'object') {
138
145
  offset = offset[breakpoint === 'x-large' ? 'xLarge' : breakpoint];
@@ -34,12 +34,14 @@ exports.default = void 0;
34
34
  * @return {Object} The final theme object with the overrides and component variables
35
35
  */
36
36
  const generateComponentTheme = theme => {
37
- const spacing = theme.spacing,
38
- media = theme.media;
37
+ const {
38
+ spacing,
39
+ media
40
+ } = theme;
39
41
  const componentVariables = {
40
- spacingSmall: spacing === null || spacing === void 0 ? void 0 : spacing.small,
41
- spacingMedium: spacing === null || spacing === void 0 ? void 0 : spacing.medium,
42
- spacingLarge: spacing === null || spacing === void 0 ? void 0 : spacing.large,
42
+ spacingSmall: spacing?.small,
43
+ spacingMedium: spacing?.medium,
44
+ spacingLarge: spacing?.large,
43
45
  ...media
44
46
  };
45
47
  return {
@@ -12,7 +12,7 @@ var _console = require("@instructure/console");
12
12
  var _styles = _interopRequireDefault(require("./styles"));
13
13
  var _props = require("./props");
14
14
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
15
- var _dec, _class, _GridCol;
15
+ var _dec, _class;
16
16
  /*
17
17
  * The MIT License (MIT)
18
18
  *
@@ -42,20 +42,30 @@ parent: Grid
42
42
  id: Grid.Col
43
43
  ---
44
44
  **/
45
- let GridCol = exports.GridCol = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = (_GridCol = class GridCol extends _react.Component {
46
- constructor(...args) {
47
- super(...args);
48
- this.ref = null;
49
- this.handleRef = el => {
50
- const elementRef = this.props.elementRef;
51
- this.ref = el;
52
- if (typeof elementRef === 'function') {
53
- elementRef(el);
54
- }
55
- };
56
- }
45
+ let GridCol = exports.GridCol = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = class GridCol extends _react.Component {
46
+ static displayName = "GridCol";
47
+ static componentId = 'Grid.Col';
48
+ static allowedProps = _props.allowedProps;
49
+ static defaultProps = {
50
+ textAlign: 'inherit',
51
+ children: null,
52
+ isLastCol: false,
53
+ isLastRow: false
54
+ };
55
+ ref = null;
56
+ handleRef = el => {
57
+ const {
58
+ elementRef
59
+ } = this.props;
60
+ this.ref = el;
61
+ if (typeof elementRef === 'function') {
62
+ elementRef(el);
63
+ }
64
+ };
57
65
  widthCheck() {
58
- const width = this.props.width;
66
+ const {
67
+ width
68
+ } = this.props;
59
69
  let shouldWarn = false;
60
70
  if (width) {
61
71
  if (typeof width === 'number' && width <= 0) {
@@ -75,31 +85,25 @@ let GridCol = exports.GridCol = (_dec = (0, _emotion.withStyle)(_styles.default)
75
85
  }
76
86
  }
77
87
  componentDidMount() {
78
- var _this$props$makeStyle, _this$props;
79
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
88
+ this.props.makeStyles?.();
80
89
  this.widthCheck();
81
90
  }
82
91
  componentDidUpdate() {
83
- var _this$props$makeStyle2, _this$props2;
84
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
92
+ this.props.makeStyles?.();
85
93
  this.widthCheck();
86
94
  }
87
95
  render() {
88
- const _this$props3 = this.props,
89
- children = _this$props3.children,
90
- styles = _this$props3.styles;
96
+ const {
97
+ children,
98
+ styles
99
+ } = this.props;
91
100
  const props = (0, _omitProps.omitProps)(this.props, GridCol.allowedProps);
92
101
  return (0, _jsxRuntime.jsx)("span", {
93
102
  ...props,
94
103
  ref: this.handleRef,
95
- css: styles === null || styles === void 0 ? void 0 : styles.gridCol,
104
+ css: styles?.gridCol,
96
105
  children: children
97
106
  });
98
107
  }
99
- }, _GridCol.displayName = "GridCol", _GridCol.componentId = 'Grid.Col', _GridCol.allowedProps = _props.allowedProps, _GridCol.defaultProps = {
100
- textAlign: 'inherit',
101
- children: null,
102
- isLastCol: false,
103
- isLastRow: false
104
- }, _GridCol)) || _class);
108
+ }) || _class);
105
109
  var _default = exports.default = GridCol;