@smart-react-components/ui 2.0.0-alpha-20 → 2.0.0-alpha-22
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/Input/index.d.ts +1 -0
- package/Input/index.js +1 -1
- package/Tooltip/index.js +1 -1
- package/package.json +1 -1
package/Input/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { InputType } from '../types';
|
|
|
8
8
|
export interface Props extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledProps, ChangeEvents, FocusEvents, KeyboardEvents {
|
|
9
9
|
defaultValue?: string;
|
|
10
10
|
hasBorder?: boolean;
|
|
11
|
+
hasSpellCheck?: boolean;
|
|
11
12
|
isBlock?: boolean;
|
|
12
13
|
isDisabled?: boolean;
|
|
13
14
|
isOutline?: boolean;
|
package/Input/index.js
CHANGED
|
@@ -49,7 +49,7 @@ const Input = react_1.default.forwardRef((props, forwardRef) => {
|
|
|
49
49
|
props.label && react_1.default.createElement("span", null, props.label),
|
|
50
50
|
react_1.default.createElement(Div_1.default, { display: "flex", flex: "1 1 auto" },
|
|
51
51
|
leftAddon && leftAddon,
|
|
52
|
-
react_1.default.cloneElement(props.template, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, element_props_1.default)(props, [change_events_1.default, focus_events_1.default, keyboard_events_1.default])), (typeof props.defaultValue !== 'undefined' && { defaultValue: props.defaultValue })), (props.isDisabled && { disabled: true })), (props.isReadOnly && { readOnly: true })), (props.isRequired && { required: true })), (typeof props.placeholder !== 'undefined' && { placeholder: props.placeholder })), (typeof props.value !== 'undefined' && { value: props.value })), { hasBorder: props.hasBorder, hasLeftAddon: !!leftAddon, hasRightAddon: !!rightAddon, hasSeparatedLeftAddon: (_a = leftAddon === null || leftAddon === void 0 ? void 0 : leftAddon.props) === null || _a === void 0 ? void 0 : _a.isSeparated, hasSeparatedRightAddon: (_b = rightAddon === null || rightAddon === void 0 ? void 0 : rightAddon.props) === null || _b === void 0 ? void 0 : _b.isSeparated, inputSize: props.size, inputSizeSm: props.sizeSm, inputSizeMd: props.sizeMd, inputSizeLg: props.sizeLg, inputSizeXl: props.sizeXl, isDisabled: props.isDisabled, isFocused, isOutline: props.isOutline, isSoft: props.isSoft, onBlur: handleOnBlur, onChange: handleOnChange, onFocus: handleOnFocus, palette: props.palette, ref: forwardRef, shape: props.shape, type: props.type })),
|
|
52
|
+
react_1.default.cloneElement(props.template, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, element_props_1.default)(props, [change_events_1.default, focus_events_1.default, keyboard_events_1.default])), (typeof props.defaultValue !== 'undefined' && { defaultValue: props.defaultValue })), (props.hasSpellCheck && { spellCheck: true })), (props.isDisabled && { disabled: true })), (props.isReadOnly && { readOnly: true })), (props.isRequired && { required: true })), (typeof props.placeholder !== 'undefined' && { placeholder: props.placeholder })), (typeof props.value !== 'undefined' && { value: props.value })), { hasBorder: props.hasBorder, hasLeftAddon: !!leftAddon, hasRightAddon: !!rightAddon, hasSeparatedLeftAddon: (_a = leftAddon === null || leftAddon === void 0 ? void 0 : leftAddon.props) === null || _a === void 0 ? void 0 : _a.isSeparated, hasSeparatedRightAddon: (_b = rightAddon === null || rightAddon === void 0 ? void 0 : rightAddon.props) === null || _b === void 0 ? void 0 : _b.isSeparated, inputSize: props.size, inputSizeSm: props.sizeSm, inputSizeMd: props.sizeMd, inputSizeLg: props.sizeLg, inputSizeXl: props.sizeXl, isDisabled: props.isDisabled, isFocused, isOutline: props.isOutline, isSoft: props.isSoft, onBlur: handleOnBlur, onChange: handleOnChange, onFocus: handleOnFocus, palette: props.palette, ref: forwardRef, shape: props.shape, type: props.type })),
|
|
53
53
|
rightAddon && rightAddon)));
|
|
54
54
|
});
|
|
55
55
|
Input.defaultProps = {
|
package/Tooltip/index.js
CHANGED
|
@@ -25,7 +25,7 @@ const Tooltip = ({ afterHide, afterShow, beforeHide, beforeShow, children, hasHi
|
|
|
25
25
|
const arrowEl = react_1.default.useRef(null);
|
|
26
26
|
const getTriggerEl = () => { var _a; return ((_a = children[0].ref) !== null && _a !== void 0 ? _a : triggerEl).current; };
|
|
27
27
|
const getTransitionDuration = () => transitionDuration !== null && transitionDuration !== void 0 ? transitionDuration : theme.$.transition.tooltipDuration;
|
|
28
|
-
const handlePosition = () => (0, popover_1.calculatePosition)(
|
|
28
|
+
const handlePosition = () => (0, popover_1.calculatePosition)(getTriggerEl(), boxEl.current, null, arrowEl.current, position, space);
|
|
29
29
|
const { getStatus, handleBeforeShow, } = (0, useFixedBoxMethods_1.default)({ beforeShow, boxEl, getTriggerEl, handlePosition, hoverDelay, isDismissible, key: 'tooltip', setStatus, status, triggerInteraction });
|
|
30
30
|
const content = (react_1.default.createElement(CSSTransition_1.default, { afterHide: afterHide, afterShow: afterShow, beforeHide: beforeHide, beforeShow: handleBeforeShow, className: transitionClassName !== null && transitionClassName !== void 0 ? transitionClassName : 'src-tooltip', duration: getTransitionDuration(), hasHideAnimation: hasHideAnimation, hasShowAnimation: hasShowAnimation, status: getStatus() },
|
|
31
31
|
react_1.default.createElement(TooltipElement_1.default, { duration: getTransitionDuration(), hasTransition: !transitionClassName, isSoft: isSoft, palette: palette, tooltipSize: size, tooltipSizeSm: sizeSm, tooltipSizeMd: sizeMd, tooltipSizeLg: sizeLg, tooltipSizeXl: sizeXl, ref: boxEl },
|