@elastic/eui 63.0.4 → 63.0.5

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.
@@ -47,13 +47,13 @@ export var EuiHeader = function EuiHeader(_ref) {
47
47
  // Increment fixed header counter for each fixed header
48
48
  euiHeaderFixedCounter++;
49
49
  document.body.classList.add('euiBody--headerIsFixed');
50
- document.body.setAttribute('data-fixed-headers', String(euiHeaderFixedCounter));
50
+ document.body.dataset.fixedHeaders = String(euiHeaderFixedCounter);
51
51
  return function () {
52
52
  // Both decrement the fixed counter AND then check if there are none
53
53
  if (--euiHeaderFixedCounter === 0) {
54
54
  // If there are none, THEN remove class
55
55
  document.body.classList.remove('euiBody--headerIsFixed');
56
- document.body.removeAttribute('data-fixed-headers');
56
+ delete document.body.dataset.fixedHeaders;
57
57
  }
58
58
  };
59
59
  }
@@ -64,11 +64,17 @@ export var EuiPageSidebar = function EuiPageSidebar(_ref) {
64
64
  setInlineStyles = _useState2[1];
65
65
 
66
66
  useEffect(function () {
67
+ var updatedStyles = _objectSpread(_objectSpread({}, style), logicalStyle('min-width', isResponding ? '100%' : minWidth));
68
+
67
69
  if (sticky) {
68
- var euiHeaderFixedCounter = Number(document.body.dataset.fixedHeaders);
70
+ var _document$body$datase;
71
+
72
+ var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
69
73
  var offset = _typeof(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
70
- setInlineStyles(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, style), logicalStyle('min-width', isResponding ? '100%' : minWidth)), logicalStyle('top', offset)), logicalStyle('max-height', "calc(100vh - ".concat(offset, "px)"))));
74
+ updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), logicalStyle('top', offset)), logicalStyle('max-height', "calc(100vh - ".concat(offset, "px)")));
71
75
  }
76
+
77
+ setInlineStyles(updatedStyles);
72
78
  }, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);
73
79
  return ___EmotionJSX("div", _extends({
74
80
  className: className,
@@ -89,7 +89,9 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
89
89
  });
90
90
  useEffect(function () {
91
91
  if (_offset === undefined) {
92
- var euiHeaderFixedCounter = Number(document.body.dataset.fixedHeaders);
92
+ var _document$body$datase;
93
+
94
+ var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
93
95
  setOffset(euiTheme.base * 3 * euiHeaderFixedCounter);
94
96
  }
95
97
  }, [_offset, euiTheme.base]); // Sections include page header
@@ -61,13 +61,13 @@ var EuiHeader = function EuiHeader(_ref) {
61
61
  // Increment fixed header counter for each fixed header
62
62
  euiHeaderFixedCounter++;
63
63
  document.body.classList.add('euiBody--headerIsFixed');
64
- document.body.setAttribute('data-fixed-headers', String(euiHeaderFixedCounter));
64
+ document.body.dataset.fixedHeaders = String(euiHeaderFixedCounter);
65
65
  return function () {
66
66
  // Both decrement the fixed counter AND then check if there are none
67
67
  if (--euiHeaderFixedCounter === 0) {
68
68
  // If there are none, THEN remove class
69
69
  document.body.classList.remove('euiBody--headerIsFixed');
70
- document.body.removeAttribute('data-fixed-headers');
70
+ delete document.body.dataset.fixedHeaders;
71
71
  }
72
72
  };
73
73
  }
@@ -76,11 +76,17 @@ var EuiPageSidebar = function EuiPageSidebar(_ref) {
76
76
  setInlineStyles = _useState2[1];
77
77
 
78
78
  (0, _react.useEffect)(function () {
79
+ var updatedStyles = _objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth));
80
+
79
81
  if (sticky) {
80
- var euiHeaderFixedCounter = Number(document.body.dataset.fixedHeaders);
82
+ var _document$body$datase;
83
+
84
+ var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
81
85
  var offset = _typeof(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
82
- setInlineStyles(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth)), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)"))));
86
+ updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)")));
83
87
  }
88
+
89
+ setInlineStyles(updatedStyles);
84
90
  }, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);
85
91
  return (0, _react2.jsx)("div", _extends({
86
92
  className: className,
@@ -109,7 +109,9 @@ var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
109
109
  });
110
110
  (0, _react.useEffect)(function () {
111
111
  if (_offset === undefined) {
112
- var euiHeaderFixedCounter = Number(document.body.dataset.fixedHeaders);
112
+ var _document$body$datase;
113
+
114
+ var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
113
115
  setOffset(euiTheme.base * 3 * euiHeaderFixedCounter);
114
116
  }
115
117
  }, [_offset, euiTheme.base]); // Sections include page header
@@ -42,13 +42,13 @@ export var EuiHeader = function EuiHeader(_ref) {
42
42
  // Increment fixed header counter for each fixed header
43
43
  euiHeaderFixedCounter++;
44
44
  document.body.classList.add('euiBody--headerIsFixed');
45
- document.body.setAttribute('data-fixed-headers', String(euiHeaderFixedCounter));
45
+ document.body.dataset.fixedHeaders = String(euiHeaderFixedCounter);
46
46
  return function () {
47
47
  // Both decrement the fixed counter AND then check if there are none
48
48
  if (--euiHeaderFixedCounter === 0) {
49
49
  // If there are none, THEN remove class
50
50
  document.body.classList.remove('euiBody--headerIsFixed');
51
- document.body.removeAttribute('data-fixed-headers');
51
+ delete document.body.dataset.fixedHeaders;
52
52
  }
53
53
  };
54
54
  }
@@ -46,11 +46,17 @@ export var EuiPageSidebar = function EuiPageSidebar(_ref) {
46
46
  setInlineStyles = _useState2[1];
47
47
 
48
48
  useEffect(function () {
49
+ var updatedStyles = _objectSpread(_objectSpread({}, style), logicalStyle('min-width', isResponding ? '100%' : minWidth));
50
+
49
51
  if (sticky) {
50
- var euiHeaderFixedCounter = Number(document.body.dataset.fixedHeaders);
52
+ var _document$body$datase;
53
+
54
+ var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
51
55
  var offset = _typeof(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
52
- setInlineStyles(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, style), logicalStyle('min-width', isResponding ? '100%' : minWidth)), logicalStyle('top', offset)), logicalStyle('max-height', "calc(100vh - ".concat(offset, "px)"))));
56
+ updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), logicalStyle('top', offset)), logicalStyle('max-height', "calc(100vh - ".concat(offset, "px)")));
53
57
  }
58
+
59
+ setInlineStyles(updatedStyles);
54
60
  }, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);
55
61
  return ___EmotionJSX("div", _extends({
56
62
  className: className,
@@ -72,7 +72,9 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
72
72
  });
73
73
  useEffect(function () {
74
74
  if (_offset === undefined) {
75
- var euiHeaderFixedCounter = Number(document.body.dataset.fixedHeaders);
75
+ var _document$body$datase;
76
+
77
+ var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
76
78
  setOffset(euiTheme.base * 3 * euiHeaderFixedCounter);
77
79
  }
78
80
  }, [_offset, euiTheme.base]); // Sections include page header
@@ -56,13 +56,13 @@ var EuiHeader = function EuiHeader(_ref) {
56
56
  // Increment fixed header counter for each fixed header
57
57
  euiHeaderFixedCounter++;
58
58
  document.body.classList.add('euiBody--headerIsFixed');
59
- document.body.setAttribute('data-fixed-headers', String(euiHeaderFixedCounter));
59
+ document.body.dataset.fixedHeaders = String(euiHeaderFixedCounter);
60
60
  return function () {
61
61
  // Both decrement the fixed counter AND then check if there are none
62
62
  if (--euiHeaderFixedCounter === 0) {
63
63
  // If there are none, THEN remove class
64
64
  document.body.classList.remove('euiBody--headerIsFixed');
65
- document.body.removeAttribute('data-fixed-headers');
65
+ delete document.body.dataset.fixedHeaders;
66
66
  }
67
67
  };
68
68
  }
@@ -63,11 +63,17 @@ var EuiPageSidebar = function EuiPageSidebar(_ref) {
63
63
  setInlineStyles = _useState2[1];
64
64
 
65
65
  (0, _react.useEffect)(function () {
66
+ var updatedStyles = _objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth));
67
+
66
68
  if (sticky) {
67
- var euiHeaderFixedCounter = Number(document.body.dataset.fixedHeaders);
69
+ var _document$body$datase;
70
+
71
+ var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
68
72
  var offset = (0, _typeof2.default)(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
69
- setInlineStyles(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth)), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)"))));
73
+ updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)")));
70
74
  }
75
+
76
+ setInlineStyles(updatedStyles);
71
77
  }, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);
72
78
  return (0, _react2.jsx)("div", (0, _extends2.default)({
73
79
  className: className,
@@ -95,7 +95,9 @@ var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
95
95
  });
96
96
  (0, _react.useEffect)(function () {
97
97
  if (_offset === undefined) {
98
- var euiHeaderFixedCounter = Number(document.body.dataset.fixedHeaders);
98
+ var _document$body$datase;
99
+
100
+ var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
99
101
  setOffset(euiTheme.base * 3 * euiHeaderFixedCounter);
100
102
  }
101
103
  }, [_offset, euiTheme.base]); // Sections include page header
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elastic/eui",
3
3
  "description": "Elastic UI Component Library",
4
- "version": "63.0.4",
4
+ "version": "63.0.5",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -58,13 +58,13 @@ var EuiHeader = function EuiHeader(_ref) {
58
58
  // Increment fixed header counter for each fixed header
59
59
  euiHeaderFixedCounter++;
60
60
  document.body.classList.add('euiBody--headerIsFixed');
61
- document.body.setAttribute('data-fixed-headers', String(euiHeaderFixedCounter));
61
+ document.body.dataset.fixedHeaders = String(euiHeaderFixedCounter);
62
62
  return function () {
63
63
  // Both decrement the fixed counter AND then check if there are none
64
64
  if (--euiHeaderFixedCounter === 0) {
65
65
  // If there are none, THEN remove class
66
66
  document.body.classList.remove('euiBody--headerIsFixed');
67
- document.body.removeAttribute('data-fixed-headers');
67
+ delete document.body.dataset.fixedHeaders;
68
68
  }
69
69
  };
70
70
  }
@@ -65,11 +65,17 @@ var EuiPageSidebar = function EuiPageSidebar(_ref) {
65
65
  setInlineStyles = _useState2[1];
66
66
 
67
67
  (0, _react.useEffect)(function () {
68
+ var updatedStyles = _objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth));
69
+
68
70
  if (sticky) {
69
- var euiHeaderFixedCounter = Number(document.body.dataset.fixedHeaders);
71
+ var _document$body$datase;
72
+
73
+ var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
70
74
  var offset = (0, _typeof2.default)(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
71
- setInlineStyles(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth)), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)"))));
75
+ updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)")));
72
76
  }
77
+
78
+ setInlineStyles(updatedStyles);
73
79
  }, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);
74
80
  return (0, _react2.jsx)("div", (0, _extends2.default)({
75
81
  className: className,
@@ -97,7 +97,9 @@ var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
97
97
  });
98
98
  (0, _react.useEffect)(function () {
99
99
  if (_offset === undefined) {
100
- var euiHeaderFixedCounter = Number(document.body.dataset.fixedHeaders);
100
+ var _document$body$datase;
101
+
102
+ var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
101
103
  setOffset(euiTheme.base * 3 * euiHeaderFixedCounter);
102
104
  }
103
105
  }, [_offset, euiTheme.base]); // Sections include page header