@onesy/ui-react 1.0.145 → 1.0.147

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.
@@ -266,7 +266,7 @@ const MenuItem = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
266
266
  RootProps: {
267
267
  className: (0, _styleReact.classNames)([(0, _utils2.staticClassName)('ListItem', theme) && [menu && `onesy-ListItem-menu`, list && `onesy-ListItem-list`, menuItem && `onesy-ListItem-menu-item`, menuOpen && `onesy-ListItem-menu-open`, openMenu && `onesy-ListItem-open-menu`, openList && `onesy-ListItem-open-list`, menuItem && [inset && `onesy-ListItem-menu-item-inset`]]])
268
268
  },
269
- footer: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, footer, /*#__PURE__*/_react.default.createElement(Expand, (0, _extends2.default)({
269
+ footer: (footer || menu || list) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, footer, list && /*#__PURE__*/_react.default.createElement(Expand, (0, _extends2.default)({
270
270
  in: openList,
271
271
  parent: refs.root.current
272
272
  }, ExpandProps), /*#__PURE__*/_react.default.createElement(ListTransitionComponent, ListTransitionComponentProps, /*#__PURE__*/_react.default.createElement(List, (0, _extends2.default)({
@@ -188,8 +188,11 @@ const TableCell = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
188
188
  const refs = {
189
189
  root: _react.default.useRef(undefined),
190
190
  offset: _react.default.useRef(null),
191
- observer: _react.default.useRef(null)
191
+ observer: _react.default.useRef(null),
192
+ sticky: _react.default.useRef(sticky)
192
193
  };
194
+ refs.root.current = root;
195
+ refs.sticky.current = sticky;
193
196
  const init = _react.default.useCallback(() => {
194
197
  setTimeout(() => {
195
198
  if (sticky) {
@@ -221,13 +224,13 @@ const TableCell = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
221
224
  setStickyActive(refs.offset.current !== offsetNew);
222
225
  }, []);
223
226
  const onStickyInit = _react.default.useCallback(() => {
224
- if (sticky && root) {
225
- root.style.position = 'unset';
226
- refs.offset.current = root.offsetLeft;
227
- root.style.position = 'sticky';
227
+ if (refs.sticky.current && refs.root.current) {
228
+ refs.root.current.style.position = 'unset';
229
+ refs.offset.current = refs.root.current.offsetLeft;
230
+ refs.root.current.style.position = 'sticky';
228
231
  onStickyMove();
229
232
  }
230
- }, [sticky, root]);
233
+ }, []);
231
234
  const onObserve = _react.default.useCallback(() => {
232
235
  var _refs$root$current2;
233
236
  const element = (_refs$root$current2 = refs.root.current) === null || _refs$root$current2 === void 0 ? void 0 : _refs$root$current2.closest('table');
@@ -241,7 +244,7 @@ const TableCell = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
241
244
  childList: true,
242
245
  subtree: true,
243
246
  attributes: true,
244
- attributeFilter: ['style', 'data-*'],
247
+ attributeFilter: ['data-*'],
245
248
  characterData: true
246
249
  };
247
250
  const method = mutations => {
@@ -90,22 +90,25 @@ const TableHead = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
90
90
  const refs = {
91
91
  root: _react.default.useRef(undefined),
92
92
  offset: _react.default.useRef(null),
93
- observer: _react.default.useRef(null)
93
+ observer: _react.default.useRef(null),
94
+ sticky: _react.default.useRef(sticky)
94
95
  };
96
+ refs.root.current = root;
97
+ refs.sticky.current = sticky;
95
98
  const styleOther = {};
96
99
  if (sticky && stickyOffset !== undefined) styleOther.top = stickyOffset;
97
100
  const onStickyMove = _react.default.useCallback(() => {
98
- const offsetNew = refs.root.current.offsetTop;
101
+ const offsetNew = refs.root.current.offsetLeft;
99
102
  setStickyActive(refs.offset.current !== offsetNew);
100
103
  }, []);
101
104
  const onStickyInit = _react.default.useCallback(() => {
102
- if (sticky && root) {
103
- root.style.position = 'unset';
104
- refs.offset.current = root.offsetTop;
105
- root.style.position = 'sticky';
105
+ if (refs.sticky.current && refs.root.current) {
106
+ refs.root.current.style.position = 'unset';
107
+ refs.offset.current = refs.root.current.offsetLeft;
108
+ refs.root.current.style.position = 'sticky';
106
109
  onStickyMove();
107
110
  }
108
- }, [sticky, root]);
111
+ }, []);
109
112
  const onObserve = _react.default.useCallback(() => {
110
113
  var _refs$root$current;
111
114
  const element = (_refs$root$current = refs.root.current) === null || _refs$root$current === void 0 ? void 0 : _refs$root$current.closest('table');
@@ -119,7 +122,7 @@ const TableHead = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
119
122
  childList: true,
120
123
  subtree: true,
121
124
  attributes: true,
122
- attributeFilter: ['style', 'data-*'],
125
+ attributeFilter: ['data-*'],
123
126
  characterData: true
124
127
  };
125
128
  const method = mutations => {
@@ -237,7 +237,7 @@ const MenuItem = /*#__PURE__*/React.forwardRef((props_, ref) => {
237
237
  RootProps: {
238
238
  className: classNames([staticClassName('ListItem', theme) && [menu && `onesy-ListItem-menu`, list && `onesy-ListItem-list`, menuItem && `onesy-ListItem-menu-item`, menuOpen && `onesy-ListItem-menu-open`, openMenu && `onesy-ListItem-open-menu`, openList && `onesy-ListItem-open-list`, menuItem && [inset && `onesy-ListItem-menu-item-inset`]]])
239
239
  },
240
- footer: /*#__PURE__*/React.createElement(React.Fragment, null, footer, /*#__PURE__*/React.createElement(Expand, _extends({
240
+ footer: (footer || menu || list) && /*#__PURE__*/React.createElement(React.Fragment, null, footer, list && /*#__PURE__*/React.createElement(Expand, _extends({
241
241
  in: openList,
242
242
  parent: refs.root.current
243
243
  }, ExpandProps), /*#__PURE__*/React.createElement(ListTransitionComponent, ListTransitionComponentProps, /*#__PURE__*/React.createElement(List, _extends({
@@ -166,8 +166,11 @@ const TableCell = /*#__PURE__*/React.forwardRef((props_, ref) => {
166
166
  const refs = {
167
167
  root: React.useRef(undefined),
168
168
  offset: React.useRef(null),
169
- observer: React.useRef(null)
169
+ observer: React.useRef(null),
170
+ sticky: React.useRef(sticky)
170
171
  };
172
+ refs.root.current = root;
173
+ refs.sticky.current = sticky;
171
174
  const init = React.useCallback(() => {
172
175
  setTimeout(() => {
173
176
  if (sticky) {
@@ -198,13 +201,13 @@ const TableCell = /*#__PURE__*/React.forwardRef((props_, ref) => {
198
201
  setStickyActive(refs.offset.current !== offsetNew);
199
202
  }, []);
200
203
  const onStickyInit = React.useCallback(() => {
201
- if (sticky && root) {
202
- root.style.position = 'unset';
203
- refs.offset.current = root.offsetLeft;
204
- root.style.position = 'sticky';
204
+ if (refs.sticky.current && refs.root.current) {
205
+ refs.root.current.style.position = 'unset';
206
+ refs.offset.current = refs.root.current.offsetLeft;
207
+ refs.root.current.style.position = 'sticky';
205
208
  onStickyMove();
206
209
  }
207
- }, [sticky, root]);
210
+ }, []);
208
211
  const onObserve = React.useCallback(() => {
209
212
  const element = refs.root.current?.closest('table');
210
213
 
@@ -217,7 +220,7 @@ const TableCell = /*#__PURE__*/React.forwardRef((props_, ref) => {
217
220
  childList: true,
218
221
  subtree: true,
219
222
  attributes: true,
220
- attributeFilter: ['style', 'data-*'],
223
+ attributeFilter: ['data-*'],
221
224
  characterData: true
222
225
  };
223
226
  const method = mutations => {
@@ -71,22 +71,25 @@ const TableHead = /*#__PURE__*/React.forwardRef((props_, ref) => {
71
71
  const refs = {
72
72
  root: React.useRef(undefined),
73
73
  offset: React.useRef(null),
74
- observer: React.useRef(null)
74
+ observer: React.useRef(null),
75
+ sticky: React.useRef(sticky)
75
76
  };
77
+ refs.root.current = root;
78
+ refs.sticky.current = sticky;
76
79
  const styleOther = {};
77
80
  if (sticky && stickyOffset !== undefined) styleOther.top = stickyOffset;
78
81
  const onStickyMove = React.useCallback(() => {
79
- const offsetNew = refs.root.current.offsetTop;
82
+ const offsetNew = refs.root.current.offsetLeft;
80
83
  setStickyActive(refs.offset.current !== offsetNew);
81
84
  }, []);
82
85
  const onStickyInit = React.useCallback(() => {
83
- if (sticky && root) {
84
- root.style.position = 'unset';
85
- refs.offset.current = root.offsetTop;
86
- root.style.position = 'sticky';
86
+ if (refs.sticky.current && refs.root.current) {
87
+ refs.root.current.style.position = 'unset';
88
+ refs.offset.current = refs.root.current.offsetLeft;
89
+ refs.root.current.style.position = 'sticky';
87
90
  onStickyMove();
88
91
  }
89
- }, [sticky, root]);
92
+ }, []);
90
93
  const onObserve = React.useCallback(() => {
91
94
  const element = refs.root.current?.closest('table');
92
95
 
@@ -99,7 +102,7 @@ const TableHead = /*#__PURE__*/React.forwardRef((props_, ref) => {
99
102
  childList: true,
100
103
  subtree: true,
101
104
  attributes: true,
102
- attributeFilter: ['style', 'data-*'],
105
+ attributeFilter: ['data-*'],
103
106
  characterData: true
104
107
  };
105
108
  const method = mutations => {
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license UiReact v1.0.144
1
+ /** @license UiReact v1.0.146
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license UiReact v1.0.144
1
+ /** @license UiReact v1.0.146
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onesy/ui-react",
3
- "version": "1.0.145",
3
+ "version": "1.0.147",
4
4
  "description": "UI for React",
5
5
  "repository": "https://github.com/onesy-me/onesy.git",
6
6
  "author": "Lazar Erić <lazareric1@proton.me>",