@smart-react-components/ui 2.0.0-alpha-42 → 2.0.0-alpha-43
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 +2 -1
- package/Input/index.js +2 -1
- package/package.json +1 -1
package/Input/index.d.ts
CHANGED
|
@@ -2,13 +2,14 @@ import { ChangeEvents } from '@smart-react-components/core/element-props/change-
|
|
|
2
2
|
import { FocusEvents } from '@smart-react-components/core/element-props/focus-events';
|
|
3
3
|
import { IntrinsicStyledProps } from '@smart-react-components/core/element-props/intrinsic-styled-props';
|
|
4
4
|
import { KeyboardEvents } from '@smart-react-components/core/element-props/keyboard-events';
|
|
5
|
-
import { ContentElement, PaletteProp, Partial, ResponsiveProp, SetState, ShapeProp, SizeProp } from '@smart-react-components/core/types';
|
|
5
|
+
import { ContentElement, JSXElementProps, PaletteProp, Partial, ResponsiveProp, SetState, ShapeProp, SizeProp } from '@smart-react-components/core/types';
|
|
6
6
|
import React from 'react';
|
|
7
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
11
|
hasSpellCheck?: boolean;
|
|
12
|
+
inputProps?: JSXElementProps;
|
|
12
13
|
isBlock?: boolean;
|
|
13
14
|
isDisabled?: boolean;
|
|
14
15
|
isOutline?: boolean;
|
package/Input/index.js
CHANGED
|
@@ -52,12 +52,13 @@ const Input = react_1.default.forwardRef((props, forwardRef) => {
|
|
|
52
52
|
((_a = leftAddon === null || leftAddon === void 0 ? void 0 : leftAddon.props) === null || _a === void 0 ? void 0 : _a.isExcluded) && leftAddon,
|
|
53
53
|
react_1.default.createElement(InputWrapper_1.default, { hasBorder: props.hasBorder, hasExcludedLeftAddon: (_b = leftAddon === null || leftAddon === void 0 ? void 0 : leftAddon.props) === null || _b === void 0 ? void 0 : _b.isExcluded, hasExcludedRightAddon: (_c = rightAddon === null || rightAddon === void 0 ? void 0 : rightAddon.props) === null || _c === void 0 ? void 0 : _c.isExcluded, isDisabled: props.isDisabled, isFocused: isFocused, isOutline: props.isOutline, isSoft: props.isSoft, palette: props.palette, shape: props.shape },
|
|
54
54
|
(leftAddon && !((_d = leftAddon === null || leftAddon === void 0 ? void 0 : leftAddon.props) === null || _d === void 0 ? void 0 : _d.isExcluded)) && leftAddon,
|
|
55
|
-
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 })), (typeof props.hasSpellCheck !== 'undefined' && { spellCheck: props.hasSpellCheck })), (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, 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 })),
|
|
55
|
+
react_1.default.cloneElement(props.template, Object.assign(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 })), (typeof props.hasSpellCheck !== 'undefined' && { spellCheck: props.hasSpellCheck })), (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 })), props.inputProps), { hasBorder: props.hasBorder, hasLeftAddon: !!leftAddon, hasRightAddon: !!rightAddon, 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 })),
|
|
56
56
|
(rightAddon && !((_e = rightAddon === null || rightAddon === void 0 ? void 0 : rightAddon.props) === null || _e === void 0 ? void 0 : _e.isExcluded)) && rightAddon),
|
|
57
57
|
((_f = rightAddon === null || rightAddon === void 0 ? void 0 : rightAddon.props) === null || _f === void 0 ? void 0 : _f.isExcluded) && rightAddon)));
|
|
58
58
|
});
|
|
59
59
|
Input.defaultProps = {
|
|
60
60
|
hasBorder: true,
|
|
61
|
+
inputProps: {},
|
|
61
62
|
isBlock: true,
|
|
62
63
|
isOutline: true,
|
|
63
64
|
palette: 'primary',
|