@onesy/ui-react 1.0.132 → 1.0.133
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/Buttons/Buttons.js +1 -22
- package/TableCell/TableCell.js +23 -4
- package/esm/Buttons/Buttons.js +1 -22
- package/esm/TableCell/TableCell.js +23 -4
- package/esm/index.js +1 -1
- package/esm/utils.js +7 -2
- package/index.js +1 -1
- package/package.json +1 -1
- package/utils.d.ts +1 -1
- package/utils.js +7 -2
package/Buttons/Buttons.js
CHANGED
|
@@ -39,7 +39,6 @@ const IconMaterialDone = exports.IconMaterialDone = /*#__PURE__*/_react.default.
|
|
|
39
39
|
const useStyle = (0, _styleReact.style)(theme => ({
|
|
40
40
|
root: {
|
|
41
41
|
position: 'relative',
|
|
42
|
-
borderRadius: theme.methods.shape.radius.value('xl', 'px'),
|
|
43
42
|
maxWidth: '100%'
|
|
44
43
|
},
|
|
45
44
|
orientation_horizontal_size_small: {
|
|
@@ -66,26 +65,6 @@ const useStyle = (0, _styleReact.style)(theme => ({
|
|
|
66
65
|
width: '100% !important'
|
|
67
66
|
}
|
|
68
67
|
},
|
|
69
|
-
// Size
|
|
70
|
-
size_small: {
|
|
71
|
-
borderRadius: `${theme.shape.radius.unit * 2}px`
|
|
72
|
-
},
|
|
73
|
-
size_regular: {
|
|
74
|
-
borderRadius: `${theme.shape.radius.unit * 2.5}px`
|
|
75
|
-
},
|
|
76
|
-
size_large: {
|
|
77
|
-
borderRadius: `${theme.shape.radius.unit * 3.5}px`
|
|
78
|
-
},
|
|
79
|
-
// Size
|
|
80
|
-
chip_size_small: {
|
|
81
|
-
borderRadius: `${theme.shape.radius.unit - theme.shape.radius.unit / 4}px`
|
|
82
|
-
},
|
|
83
|
-
chip_size_regular: {
|
|
84
|
-
borderRadius: `${theme.shape.radius.unit}px`
|
|
85
|
-
},
|
|
86
|
-
chip_size_large: {
|
|
87
|
-
borderRadius: `${theme.shape.radius.unit + theme.shape.radius.unit / 4}px`
|
|
88
|
-
},
|
|
89
68
|
// Shadows
|
|
90
69
|
elevation: {
|
|
91
70
|
boxShadow: theme.shadows.values.neutral[1],
|
|
@@ -348,7 +327,7 @@ const Buttons = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
348
327
|
gap: 0,
|
|
349
328
|
direction: "row",
|
|
350
329
|
display: "inline-flex",
|
|
351
|
-
className: (0, _styleReact.classNames)([(0, _utils2.staticClassName)('Buttons', theme) && ['onesy-Buttons-root', `onesy-Buttons-version-${version}`, `onesy-Buttons-size-${size}`, disabled && `onesy-Buttons-disabled`], className, classes.root, classes[`
|
|
330
|
+
className: (0, _styleReact.classNames)([(0, _utils2.staticClassName)('Buttons', theme) && ['onesy-Buttons-root', `onesy-Buttons-version-${version}`, `onesy-Buttons-size-${size}`, disabled && `onesy-Buttons-disabled`], className, classes.root, classes[`orientation_${orientation}`], classes[`orientation_${orientation}_size_${size}`], fullWidth && classes.fullWidth, elevation && !disabled && ['filled', 'tonal'].includes(version) && classes.elevation, disabled && classes.disabled])
|
|
352
331
|
}, other), children);
|
|
353
332
|
});
|
|
354
333
|
Buttons.displayName = 'onesy-Buttons';
|
package/TableCell/TableCell.js
CHANGED
|
@@ -67,7 +67,9 @@ const useStyle = (0, _styleReact.style)(theme => ({
|
|
|
67
67
|
},
|
|
68
68
|
sticky: {
|
|
69
69
|
position: 'sticky',
|
|
70
|
-
zIndex: '14'
|
|
70
|
+
zIndex: '14'
|
|
71
|
+
},
|
|
72
|
+
sticky_left: {
|
|
71
73
|
'&::after': {
|
|
72
74
|
content: "''",
|
|
73
75
|
position: 'absolute',
|
|
@@ -79,11 +81,28 @@ const useStyle = (0, _styleReact.style)(theme => ({
|
|
|
79
81
|
pointerEvents: 'none'
|
|
80
82
|
}
|
|
81
83
|
},
|
|
82
|
-
|
|
84
|
+
sticky_right: {
|
|
85
|
+
'&::after': {
|
|
86
|
+
content: "''",
|
|
87
|
+
position: 'absolute',
|
|
88
|
+
top: '0',
|
|
89
|
+
left: '-24px',
|
|
90
|
+
bottom: '0',
|
|
91
|
+
width: '24px',
|
|
92
|
+
transition: theme.methods.transitions.make('box-shadow'),
|
|
93
|
+
pointerEvents: 'none'
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
stickyActive_left: {
|
|
83
97
|
'&::after': {
|
|
84
98
|
boxShadow: `inset 11px 0 7px -7px ${theme.palette.light ? 'rgba(0, 0, 0, 0.04)' : 'rgba(255, 255, 255, 0.14)'}`
|
|
85
99
|
}
|
|
86
100
|
},
|
|
101
|
+
stickyActive_right: {
|
|
102
|
+
'&::after': {
|
|
103
|
+
boxShadow: `inset -11px 0 7px -7px ${theme.palette.light ? 'rgba(0, 0, 0, 0.04)' : 'rgba(255, 255, 255, 0.14)'}`
|
|
104
|
+
}
|
|
105
|
+
},
|
|
87
106
|
sort: {
|
|
88
107
|
cursor: 'pointer',
|
|
89
108
|
borderRadius: 2,
|
|
@@ -195,7 +214,7 @@ const TableCell = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
195
214
|
_react.default.useEffect(() => {
|
|
196
215
|
if (sticky) {
|
|
197
216
|
if (root) {
|
|
198
|
-
const parentOverflow = (0, _utils2.getOverflowParent)(root);
|
|
217
|
+
const parentOverflow = (0, _utils2.getOverflowParent)(root, false);
|
|
199
218
|
const offsetPrevious = stickyPosition === 'left' ? root.offsetLeft : window.innerWidth - root.getBoundingClientRect().right;
|
|
200
219
|
const method = () => {
|
|
201
220
|
const offsetNew = stickyPosition === 'left' ? root.offsetLeft : window.innerWidth - root.getBoundingClientRect().right;
|
|
@@ -233,7 +252,7 @@ const TableCell = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
233
252
|
setRoot(item);
|
|
234
253
|
},
|
|
235
254
|
role: "cell",
|
|
236
|
-
className: (0, _styleReact.classNames)([(0, _utils2.staticClassName)('TableCell', theme) && [`onesy-TableCell-root`, `onesy-TableCell-size-${size}`, sticky && `onesy-TableCell-sticky`, stickyPosition && `onesy-TableCell-sticky-position-${stickyPosition}`, stickyActive && `onesy-TableHead-sticky-active`], className, classes.root, position === 'head' ? classes.head : classes.body, noWeight && classes.noWeight, sticky && classes.sticky, stickyActive && classes
|
|
255
|
+
className: (0, _styleReact.classNames)([(0, _utils2.staticClassName)('TableCell', theme) && [`onesy-TableCell-root`, `onesy-TableCell-size-${size}`, sticky && `onesy-TableCell-sticky`, stickyPosition && `onesy-TableCell-sticky-position-${stickyPosition}`, stickyActive && `onesy-TableHead-sticky-active`], className, classes.root, position === 'head' ? classes.head : classes.body, noWeight && classes.noWeight, sticky && [classes.sticky, classes[`sticky_${stickyPosition}`]], stickyActive && classes[`stickyActive_${stickyPosition}`]]),
|
|
237
256
|
style: _objectSpread(_objectSpread({}, style), stylesOther)
|
|
238
257
|
}, other), /*#__PURE__*/_react.default.createElement(Line, {
|
|
239
258
|
gap: 0,
|
package/esm/Buttons/Buttons.js
CHANGED
|
@@ -32,7 +32,6 @@ export const IconMaterialDone = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
32
32
|
const useStyle = styleMethod(theme => ({
|
|
33
33
|
root: {
|
|
34
34
|
position: 'relative',
|
|
35
|
-
borderRadius: theme.methods.shape.radius.value('xl', 'px'),
|
|
36
35
|
maxWidth: '100%'
|
|
37
36
|
},
|
|
38
37
|
orientation_horizontal_size_small: {
|
|
@@ -59,26 +58,6 @@ const useStyle = styleMethod(theme => ({
|
|
|
59
58
|
width: '100% !important'
|
|
60
59
|
}
|
|
61
60
|
},
|
|
62
|
-
// Size
|
|
63
|
-
size_small: {
|
|
64
|
-
borderRadius: `${theme.shape.radius.unit * 2}px`
|
|
65
|
-
},
|
|
66
|
-
size_regular: {
|
|
67
|
-
borderRadius: `${theme.shape.radius.unit * 2.5}px`
|
|
68
|
-
},
|
|
69
|
-
size_large: {
|
|
70
|
-
borderRadius: `${theme.shape.radius.unit * 3.5}px`
|
|
71
|
-
},
|
|
72
|
-
// Size
|
|
73
|
-
chip_size_small: {
|
|
74
|
-
borderRadius: `${theme.shape.radius.unit - theme.shape.radius.unit / 4}px`
|
|
75
|
-
},
|
|
76
|
-
chip_size_regular: {
|
|
77
|
-
borderRadius: `${theme.shape.radius.unit}px`
|
|
78
|
-
},
|
|
79
|
-
chip_size_large: {
|
|
80
|
-
borderRadius: `${theme.shape.radius.unit + theme.shape.radius.unit / 4}px`
|
|
81
|
-
},
|
|
82
61
|
// Shadows
|
|
83
62
|
elevation: {
|
|
84
63
|
boxShadow: theme.shadows.values.neutral[1],
|
|
@@ -328,7 +307,7 @@ const Buttons = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
328
307
|
gap: 0,
|
|
329
308
|
direction: "row",
|
|
330
309
|
display: "inline-flex",
|
|
331
|
-
className: classNames([staticClassName('Buttons', theme) && ['onesy-Buttons-root', `onesy-Buttons-version-${version}`, `onesy-Buttons-size-${size}`, disabled && `onesy-Buttons-disabled`], className, classes.root, classes[`
|
|
310
|
+
className: classNames([staticClassName('Buttons', theme) && ['onesy-Buttons-root', `onesy-Buttons-version-${version}`, `onesy-Buttons-size-${size}`, disabled && `onesy-Buttons-disabled`], className, classes.root, classes[`orientation_${orientation}`], classes[`orientation_${orientation}_size_${size}`], fullWidth && classes.fullWidth, elevation && !disabled && ['filled', 'tonal'].includes(version) && classes.elevation, disabled && classes.disabled])
|
|
332
311
|
}, other), children);
|
|
333
312
|
});
|
|
334
313
|
Buttons.displayName = 'onesy-Buttons';
|
|
@@ -60,7 +60,9 @@ const useStyle = styleMethod(theme => ({
|
|
|
60
60
|
},
|
|
61
61
|
sticky: {
|
|
62
62
|
position: 'sticky',
|
|
63
|
-
zIndex: '14'
|
|
63
|
+
zIndex: '14'
|
|
64
|
+
},
|
|
65
|
+
sticky_left: {
|
|
64
66
|
'&::after': {
|
|
65
67
|
content: "''",
|
|
66
68
|
position: 'absolute',
|
|
@@ -72,11 +74,28 @@ const useStyle = styleMethod(theme => ({
|
|
|
72
74
|
pointerEvents: 'none'
|
|
73
75
|
}
|
|
74
76
|
},
|
|
75
|
-
|
|
77
|
+
sticky_right: {
|
|
78
|
+
'&::after': {
|
|
79
|
+
content: "''",
|
|
80
|
+
position: 'absolute',
|
|
81
|
+
top: '0',
|
|
82
|
+
left: '-24px',
|
|
83
|
+
bottom: '0',
|
|
84
|
+
width: '24px',
|
|
85
|
+
transition: theme.methods.transitions.make('box-shadow'),
|
|
86
|
+
pointerEvents: 'none'
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
stickyActive_left: {
|
|
76
90
|
'&::after': {
|
|
77
91
|
boxShadow: `inset 11px 0 7px -7px ${theme.palette.light ? 'rgba(0, 0, 0, 0.04)' : 'rgba(255, 255, 255, 0.14)'}`
|
|
78
92
|
}
|
|
79
93
|
},
|
|
94
|
+
stickyActive_right: {
|
|
95
|
+
'&::after': {
|
|
96
|
+
boxShadow: `inset -11px 0 7px -7px ${theme.palette.light ? 'rgba(0, 0, 0, 0.04)' : 'rgba(255, 255, 255, 0.14)'}`
|
|
97
|
+
}
|
|
98
|
+
},
|
|
80
99
|
sort: {
|
|
81
100
|
cursor: 'pointer',
|
|
82
101
|
borderRadius: 2,
|
|
@@ -172,7 +191,7 @@ const TableCell = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
172
191
|
React.useEffect(() => {
|
|
173
192
|
if (sticky) {
|
|
174
193
|
if (root) {
|
|
175
|
-
const parentOverflow = getOverflowParent(root);
|
|
194
|
+
const parentOverflow = getOverflowParent(root, false);
|
|
176
195
|
const offsetPrevious = stickyPosition === 'left' ? root.offsetLeft : window.innerWidth - root.getBoundingClientRect().right;
|
|
177
196
|
const method = () => {
|
|
178
197
|
const offsetNew = stickyPosition === 'left' ? root.offsetLeft : window.innerWidth - root.getBoundingClientRect().right;
|
|
@@ -210,7 +229,7 @@ const TableCell = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
210
229
|
setRoot(item);
|
|
211
230
|
},
|
|
212
231
|
role: "cell",
|
|
213
|
-
className: classNames([staticClassName('TableCell', theme) && [`onesy-TableCell-root`, `onesy-TableCell-size-${size}`, sticky && `onesy-TableCell-sticky`, stickyPosition && `onesy-TableCell-sticky-position-${stickyPosition}`, stickyActive && `onesy-TableHead-sticky-active`], className, classes.root, position === 'head' ? classes.head : classes.body, noWeight && classes.noWeight, sticky && classes.sticky, stickyActive && classes
|
|
232
|
+
className: classNames([staticClassName('TableCell', theme) && [`onesy-TableCell-root`, `onesy-TableCell-size-${size}`, sticky && `onesy-TableCell-sticky`, stickyPosition && `onesy-TableCell-sticky-position-${stickyPosition}`, stickyActive && `onesy-TableHead-sticky-active`], className, classes.root, position === 'head' ? classes.head : classes.body, noWeight && classes.noWeight, sticky && [classes.sticky, classes[`sticky_${stickyPosition}`]], stickyActive && classes[`stickyActive_${stickyPosition}`]]),
|
|
214
233
|
style: _objectSpread(_objectSpread({}, style), stylesOther)
|
|
215
234
|
}, other), /*#__PURE__*/React.createElement(Line, {
|
|
216
235
|
gap: 0,
|
package/esm/index.js
CHANGED
package/esm/utils.js
CHANGED
|
@@ -208,9 +208,14 @@ export const importIframeStyles = iframeDocument => {
|
|
|
208
208
|
iframeDocument.head.append(style);
|
|
209
209
|
}
|
|
210
210
|
};
|
|
211
|
-
export const getOverflowParent = element => {
|
|
211
|
+
export const getOverflowParent = (element, vertical = true) => {
|
|
212
212
|
if (!element) return;
|
|
213
|
-
|
|
213
|
+
|
|
214
|
+
// height
|
|
215
|
+
if (vertical && element.scrollHeight > element.clientHeight) return element;
|
|
216
|
+
|
|
217
|
+
// width
|
|
218
|
+
if (!vertical && element.scrollWidth > element.clientWidth) return element;
|
|
214
219
|
return getOverflowParent(element.parentElement);
|
|
215
220
|
};
|
|
216
221
|
export const keyboardStandardCommands = ['a', 'c', 'v', 'y', 'z'];
|
package/index.js
CHANGED
package/package.json
CHANGED
package/utils.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare const minMaxBetweenNumbers: (value?: number, min?: number, max?:
|
|
|
26
26
|
export declare const sanitize: (value: string) => string;
|
|
27
27
|
export declare const replace: (value: string, split: string, join: string) => string;
|
|
28
28
|
export declare const importIframeStyles: (iframeDocument: Document) => void;
|
|
29
|
-
export declare const getOverflowParent: (element: HTMLElement) => HTMLElement;
|
|
29
|
+
export declare const getOverflowParent: (element: HTMLElement, vertical?: boolean) => HTMLElement;
|
|
30
30
|
export declare const keyboardStandardCommands: string[];
|
|
31
31
|
export declare const keyboardStyleCommands: string[];
|
|
32
32
|
export declare const caret: any;
|
package/utils.js
CHANGED
|
@@ -238,9 +238,14 @@ const importIframeStyles = iframeDocument => {
|
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
240
|
exports.importIframeStyles = importIframeStyles;
|
|
241
|
-
const getOverflowParent = element => {
|
|
241
|
+
const getOverflowParent = (element, vertical = true) => {
|
|
242
242
|
if (!element) return;
|
|
243
|
-
|
|
243
|
+
|
|
244
|
+
// height
|
|
245
|
+
if (vertical && element.scrollHeight > element.clientHeight) return element;
|
|
246
|
+
|
|
247
|
+
// width
|
|
248
|
+
if (!vertical && element.scrollWidth > element.clientWidth) return element;
|
|
244
249
|
return getOverflowParent(element.parentElement);
|
|
245
250
|
};
|
|
246
251
|
exports.getOverflowParent = getOverflowParent;
|