@onesy/ui-react 1.0.30 → 1.0.31
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/Slider/Slider.js +6 -0
- package/Tooltip/Tooltip.d.ts +1 -0
- package/Tooltip/Tooltip.js +4 -3
- package/esm/Slider/Slider.js +7 -0
- package/esm/Tooltip/Tooltip.js +5 -4
- package/esm/index.js +1 -1
- package/package.json +1 -1
package/Slider/Slider.js
CHANGED
@@ -335,6 +335,10 @@ const useStyle = (0, style_react_1.style)(theme => {
|
|
335
335
|
}
|
336
336
|
}
|
337
337
|
},
|
338
|
+
tooltipLabelText: {
|
339
|
+
minWidth: '40px',
|
340
|
+
textAlign: 'center'
|
341
|
+
},
|
338
342
|
disabled: {
|
339
343
|
cursor: 'default',
|
340
344
|
pointerEvents: 'none',
|
@@ -826,6 +830,8 @@ const Slider = react_1.default.forwardRef((props_, ref) => {
|
|
826
830
|
classes[`tooltip_orientation_${orientation}`]
|
827
831
|
]), classNameSwitch: classes[`tooltip_switch_orientation_${orientation}_${theme.direction}`] }, ((tooltip === 'always') || (tooltip !== undefined && mouseDownButton === index) ? { open: true } : tooltip === undefined ? { open: false } : {}), { label: labelMethod(value__), position: orientation === 'horizontal' ? 'top' : theme.direction === 'ltr' ? 'left' : 'right', alignment: 'center', TransitionComponent: Zoom, transformOrigin: orientation === 'horizontal' ? 'center bottom' : 'center right', transformOriginSwitch: orientation === 'horizontal' ? 'center top' : 'center left', transformOriginRtl: orientation === 'horizontal' ? 'center bottom' : 'center left', transformOriginRtlSwitch: orientation === 'horizontal' ? 'center top' : 'center right', noMargin: true, LabelProps: {
|
828
832
|
style: styles.label
|
833
|
+
}, LabelTextProps: {
|
834
|
+
className: classes.tooltipLabelText
|
829
835
|
} }, TooltipProps, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ ref: item => refs.iconButtons.current.push(item), size: size, tonal: tonal, color: color, onBlur: onBlur, onFocus: () => {
|
830
836
|
onFocus();
|
831
837
|
onFocusButton(index);
|
package/Tooltip/Tooltip.d.ts
CHANGED
package/Tooltip/Tooltip.js
CHANGED
@@ -152,9 +152,9 @@ const Tooltip = react_1.default.forwardRef((props_, ref) => {
|
|
152
152
|
const Append = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.Append) || Append_1.default; }, [theme]);
|
153
153
|
const Modal = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.Modal) || Modal_1.default; }, [theme]);
|
154
154
|
const Surface = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.Surface) || Surface_1.default; }, [theme]);
|
155
|
-
const { tonal = true, color = 'inverted', open: open_, openDefault, name, label: label_, parent, position = 'bottom', switch: switch_ = true, alignment = 'center', portal = true, fullWidth, maxWidth = 'unset', arrow, anchor: anchor_, anchorElement, noMargin, classNameSwitch, transformOrigin, transformOriginSwitch, transformOriginRtl, transformOriginRtlSwitch, click, touch: touch_, longPress: longPress_ = false, hover: hover_ = true, focus: focus_ = false, inset, nowrap, follow, interactive, onOpen: onOpen_, onClose: onClose_, onExited, TransitionComponent = Grow, TransitionComponentProps, AppendProps, ModalProps, LabelProps,
|
155
|
+
const { tonal = true, color = 'inverted', open: open_, openDefault, name, label: label_, parent, position = 'bottom', switch: switch_ = true, alignment = 'center', portal = true, fullWidth, maxWidth = 'unset', arrow, anchor: anchor_, anchorElement, noMargin, classNameSwitch, transformOrigin, transformOriginSwitch, transformOriginRtl, transformOriginRtlSwitch, click, touch: touch_, longPress: longPress_ = false, hover: hover_ = true, focus: focus_ = false, inset, nowrap, follow, interactive, onOpen: onOpen_, onClose: onClose_, onExited, TransitionComponent = Grow, TransitionComponentProps, AppendProps, ModalProps, LabelProps, LabelTextProps,
|
156
156
|
// other
|
157
|
-
elevation, className, style, children } = props, other = __rest(props, ["tonal", "color", "open", "openDefault", "name", "label", "parent", "position", "switch", "alignment", "portal", "fullWidth", "maxWidth", "arrow", "anchor", "anchorElement", "noMargin", "classNameSwitch", "transformOrigin", "transformOriginSwitch", "transformOriginRtl", "transformOriginRtlSwitch", "click", "touch", "longPress", "hover", "focus", "inset", "nowrap", "follow", "interactive", "onOpen", "onClose", "onExited", "TransitionComponent", "TransitionComponentProps", "AppendProps", "ModalProps", "LabelProps", "elevation", "className", "style", "children"]);
|
157
|
+
elevation, className, style, children } = props, other = __rest(props, ["tonal", "color", "open", "openDefault", "name", "label", "parent", "position", "switch", "alignment", "portal", "fullWidth", "maxWidth", "arrow", "anchor", "anchorElement", "noMargin", "classNameSwitch", "transformOrigin", "transformOriginSwitch", "transformOriginRtl", "transformOriginRtlSwitch", "click", "touch", "longPress", "hover", "focus", "inset", "nowrap", "follow", "interactive", "onOpen", "onClose", "onExited", "TransitionComponent", "TransitionComponentProps", "AppendProps", "ModalProps", "LabelProps", "LabelTextProps", "elevation", "className", "style", "children"]);
|
158
158
|
const [init, setInit] = react_1.default.useState(false);
|
159
159
|
const [open, setOpen] = react_1.default.useState(openDefault !== undefined ? openDefault : open_);
|
160
160
|
const [hover, setHover] = react_1.default.useState(false);
|
@@ -416,10 +416,11 @@ const Tooltip = react_1.default.forwardRef((props_, ref) => {
|
|
416
416
|
classes.arrow,
|
417
417
|
classes[`arrow_position_${position}_alignment_${alignment}`]
|
418
418
|
]
|
419
|
-
]), style: Object.assign(Object.assign({}, styles.name), LabelProps === null || LabelProps === void 0 ? void 0 : LabelProps.style) }, { children: (0, jsx_runtime_1.jsx)("span", Object.assign({ className: (0, style_react_1.classNames)([
|
419
|
+
]), style: Object.assign(Object.assign({}, styles.name), LabelProps === null || LabelProps === void 0 ? void 0 : LabelProps.style) }, { children: (0, jsx_runtime_1.jsx)("span", Object.assign({}, LabelTextProps, { className: (0, style_react_1.classNames)([
|
420
420
|
(0, utils_2.staticClassName)('Tooltip', theme) && [
|
421
421
|
'onesy-Tooltip-name-text'
|
422
422
|
],
|
423
|
+
LabelTextProps === null || LabelTextProps === void 0 ? void 0 : LabelTextProps.className
|
423
424
|
]) }, { children: label })) })) :
|
424
425
|
react_1.default.cloneElement(label, {
|
425
426
|
className: (0, style_react_1.classNames)([
|
package/esm/Slider/Slider.js
CHANGED
@@ -412,6 +412,10 @@ const useStyle = styleMethod(theme => {
|
|
412
412
|
}
|
413
413
|
}
|
414
414
|
},
|
415
|
+
tooltipLabelText: {
|
416
|
+
minWidth: '40px',
|
417
|
+
textAlign: 'center'
|
418
|
+
},
|
415
419
|
disabled: {
|
416
420
|
cursor: 'default',
|
417
421
|
pointerEvents: 'none',
|
@@ -884,6 +888,9 @@ const Slider = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
884
888
|
noMargin: true,
|
885
889
|
LabelProps: {
|
886
890
|
style: styles.label
|
891
|
+
},
|
892
|
+
LabelTextProps: {
|
893
|
+
className: classes.tooltipLabelText
|
887
894
|
}
|
888
895
|
}, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
|
889
896
|
ref: item => refs.iconButtons.current.push(item),
|
package/esm/Tooltip/Tooltip.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
4
|
-
const _excluded = ["tonal", "color", "open", "openDefault", "name", "label", "parent", "position", "switch", "alignment", "portal", "fullWidth", "maxWidth", "arrow", "anchor", "anchorElement", "noMargin", "classNameSwitch", "transformOrigin", "transformOriginSwitch", "transformOriginRtl", "transformOriginRtlSwitch", "click", "touch", "longPress", "hover", "focus", "inset", "nowrap", "follow", "interactive", "onOpen", "onClose", "onExited", "TransitionComponent", "TransitionComponentProps", "AppendProps", "ModalProps", "LabelProps", "elevation", "className", "style", "children"];
|
4
|
+
const _excluded = ["tonal", "color", "open", "openDefault", "name", "label", "parent", "position", "switch", "alignment", "portal", "fullWidth", "maxWidth", "arrow", "anchor", "anchorElement", "noMargin", "classNameSwitch", "transformOrigin", "transformOriginSwitch", "transformOriginRtl", "transformOriginRtlSwitch", "click", "touch", "longPress", "hover", "focus", "inset", "nowrap", "follow", "interactive", "onOpen", "onClose", "onExited", "TransitionComponent", "TransitionComponentProps", "AppendProps", "ModalProps", "LabelProps", "LabelTextProps", "elevation", "className", "style", "children"];
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
7
7
|
import React from 'react';
|
@@ -215,6 +215,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
215
215
|
AppendProps,
|
216
216
|
ModalProps,
|
217
217
|
LabelProps,
|
218
|
+
LabelTextProps,
|
218
219
|
// other
|
219
220
|
elevation,
|
220
221
|
className,
|
@@ -435,9 +436,9 @@ const Tooltip = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
435
436
|
}, LabelProps, {
|
436
437
|
className: classNames([staticClassName('Tooltip', theme) && ['onesy-Tooltip-name'], LabelProps?.className, classes.name, arrow && [classes.arrow, classes[`arrow_position_${position}_alignment_${alignment}`]]]),
|
437
438
|
style: _objectSpread(_objectSpread({}, styles.name), LabelProps?.style)
|
438
|
-
}), /*#__PURE__*/React.createElement("span", {
|
439
|
-
className: classNames([staticClassName('Tooltip', theme) && ['onesy-Tooltip-name-text']])
|
440
|
-
}, label)) : /*#__PURE__*/React.cloneElement(label, {
|
439
|
+
}), /*#__PURE__*/React.createElement("span", _extends({}, LabelTextProps, {
|
440
|
+
className: classNames([staticClassName('Tooltip', theme) && ['onesy-Tooltip-name-text'], LabelTextProps?.className])
|
441
|
+
}), label)) : /*#__PURE__*/React.cloneElement(label, {
|
441
442
|
className: classNames([label?.props?.className, arrow && [classes.arrow, classes[`arrow_position_${position}_alignment_${alignment}`]]])
|
442
443
|
}))));
|
443
444
|
}
|
package/esm/index.js
CHANGED