@sb1/ffe-form-react 12.1.1 → 13.0.1
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/es/Input.js +1 -6
- package/es/InputTextLike.js +22 -0
- package/es/index.js +2 -1
- package/lib/Input.js +1 -6
- package/lib/InputTextLike.js +30 -0
- package/lib/index.js +7 -0
- package/package.json +2 -2
- package/types/index.d.ts +6 -1
package/es/Input.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["className", "inline", "
|
|
1
|
+
var _excluded = ["className", "inline", "textRightAlign"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -8,14 +8,11 @@ import classNames from 'classnames';
|
|
|
8
8
|
var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
9
9
|
var className = props.className,
|
|
10
10
|
inline = props.inline,
|
|
11
|
-
textLike = props.textLike,
|
|
12
11
|
textRightAlign = props.textRightAlign,
|
|
13
12
|
rest = _objectWithoutProperties(props, _excluded);
|
|
14
13
|
return /*#__PURE__*/React.createElement("input", _extends({
|
|
15
14
|
className: classNames('ffe-input-field', {
|
|
16
15
|
'ffe-input-field--inline': inline
|
|
17
|
-
}, {
|
|
18
|
-
'ffe-input-field--text-like': textLike
|
|
19
16
|
}, {
|
|
20
17
|
'ffe-input-field--text-right-align': textRightAlign
|
|
21
18
|
}, className),
|
|
@@ -26,8 +23,6 @@ Input.propTypes = {
|
|
|
26
23
|
className: string,
|
|
27
24
|
/** Input fields default to `display: block;`. Set this to `true` to apply the inline modifier. */
|
|
28
25
|
inline: bool,
|
|
29
|
-
/** Apply the text-like modifier by setting this to `true`. */
|
|
30
|
-
textLike: bool,
|
|
31
26
|
/** Make the text right aligned */
|
|
32
27
|
textRightAlign: bool
|
|
33
28
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var _excluded = ["className", "ariaLabel"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { string } from 'prop-types';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
var InputTextLike = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
9
|
+
var className = props.className,
|
|
10
|
+
ariaLabel = props.ariaLabel,
|
|
11
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
12
|
+
return /*#__PURE__*/React.createElement("input", _extends({
|
|
13
|
+
className: classNames('ffe-input-field', 'ffe-input-field--text-like', className),
|
|
14
|
+
"aria-label": ariaLabel,
|
|
15
|
+
ref: ref
|
|
16
|
+
}, rest));
|
|
17
|
+
});
|
|
18
|
+
InputTextLike.propTypes = {
|
|
19
|
+
ariaLabel: string.isRequired,
|
|
20
|
+
className: string
|
|
21
|
+
};
|
|
22
|
+
export default InputTextLike;
|
package/es/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import ErrorFieldMessage from './ErrorFieldMessage';
|
|
|
3
3
|
import InfoFieldMessage from './InfoFieldMessage';
|
|
4
4
|
import SuccessFieldMessage from './SuccessFieldMessage';
|
|
5
5
|
import Input from './Input';
|
|
6
|
+
import InputTextLike from './InputTextLike';
|
|
6
7
|
import InputGroup from './InputGroup';
|
|
7
8
|
import Label from './Label';
|
|
8
9
|
import PhoneNumber from './PhoneNumber';
|
|
@@ -13,4 +14,4 @@ import RadioSwitch from './RadioSwitch';
|
|
|
13
14
|
import TextArea from './TextArea';
|
|
14
15
|
import Tooltip from './Tooltip';
|
|
15
16
|
import ToggleSwitch from './ToggleSwitch';
|
|
16
|
-
export { Checkbox, ErrorFieldMessage, InfoFieldMessage, SuccessFieldMessage, Input, PhoneNumber, InputGroup, Label, RadioBlock, RadioButton, RadioButtonInputGroup, RadioSwitch, TextArea, Tooltip, ToggleSwitch };
|
|
17
|
+
export { Checkbox, ErrorFieldMessage, InfoFieldMessage, SuccessFieldMessage, Input, InputTextLike, PhoneNumber, InputGroup, Label, RadioBlock, RadioButton, RadioButtonInputGroup, RadioSwitch, TextArea, Tooltip, ToggleSwitch };
|
package/lib/Input.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _excluded = ["className", "inline", "
|
|
10
|
+
var _excluded = ["className", "inline", "textRightAlign"];
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
13
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -15,14 +15,11 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
15
15
|
var Input = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
16
16
|
var className = props.className,
|
|
17
17
|
inline = props.inline,
|
|
18
|
-
textLike = props.textLike,
|
|
19
18
|
textRightAlign = props.textRightAlign,
|
|
20
19
|
rest = _objectWithoutProperties(props, _excluded);
|
|
21
20
|
return /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
22
21
|
className: (0, _classnames.default)('ffe-input-field', {
|
|
23
22
|
'ffe-input-field--inline': inline
|
|
24
|
-
}, {
|
|
25
|
-
'ffe-input-field--text-like': textLike
|
|
26
23
|
}, {
|
|
27
24
|
'ffe-input-field--text-right-align': textRightAlign
|
|
28
25
|
}, className),
|
|
@@ -33,8 +30,6 @@ Input.propTypes = {
|
|
|
33
30
|
className: _propTypes.string,
|
|
34
31
|
/** Input fields default to `display: block;`. Set this to `true` to apply the inline modifier. */
|
|
35
32
|
inline: _propTypes.bool,
|
|
36
|
-
/** Apply the text-like modifier by setting this to `true`. */
|
|
37
|
-
textLike: _propTypes.bool,
|
|
38
33
|
/** Make the text right aligned */
|
|
39
34
|
textRightAlign: _propTypes.bool
|
|
40
35
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = require("prop-types");
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _excluded = ["className", "ariaLabel"];
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
+
var InputTextLike = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
16
|
+
var className = props.className,
|
|
17
|
+
ariaLabel = props.ariaLabel,
|
|
18
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
20
|
+
className: (0, _classnames.default)('ffe-input-field', 'ffe-input-field--text-like', className),
|
|
21
|
+
"aria-label": ariaLabel,
|
|
22
|
+
ref: ref
|
|
23
|
+
}, rest));
|
|
24
|
+
});
|
|
25
|
+
InputTextLike.propTypes = {
|
|
26
|
+
ariaLabel: _propTypes.string.isRequired,
|
|
27
|
+
className: _propTypes.string
|
|
28
|
+
};
|
|
29
|
+
var _default = InputTextLike;
|
|
30
|
+
exports.default = _default;
|
package/lib/index.js
CHANGED
|
@@ -33,6 +33,12 @@ Object.defineProperty(exports, "InputGroup", {
|
|
|
33
33
|
return _InputGroup.default;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
+
Object.defineProperty(exports, "InputTextLike", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _InputTextLike.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
36
42
|
Object.defineProperty(exports, "Label", {
|
|
37
43
|
enumerable: true,
|
|
38
44
|
get: function get() {
|
|
@@ -98,6 +104,7 @@ var _ErrorFieldMessage = _interopRequireDefault(require("./ErrorFieldMessage"));
|
|
|
98
104
|
var _InfoFieldMessage = _interopRequireDefault(require("./InfoFieldMessage"));
|
|
99
105
|
var _SuccessFieldMessage = _interopRequireDefault(require("./SuccessFieldMessage"));
|
|
100
106
|
var _Input = _interopRequireDefault(require("./Input"));
|
|
107
|
+
var _InputTextLike = _interopRequireDefault(require("./InputTextLike"));
|
|
101
108
|
var _InputGroup = _interopRequireDefault(require("./InputGroup"));
|
|
102
109
|
var _Label = _interopRequireDefault(require("./Label"));
|
|
103
110
|
var _PhoneNumber = _interopRequireDefault(require("./PhoneNumber"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-form-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.1",
|
|
4
4
|
"description": "React component for form elements in ffe",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "fa712eb383e8626d8ca51f0031ddea734228d58e"
|
|
49
49
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -24,10 +24,14 @@ export interface BaseFieldMessageProps extends React.ComponentProps<'div'> {
|
|
|
24
24
|
export interface InputProps extends React.ComponentProps<'input'> {
|
|
25
25
|
className?: string;
|
|
26
26
|
inline?: boolean;
|
|
27
|
-
textLike?: boolean;
|
|
28
27
|
textRightAlign?: boolean;
|
|
29
28
|
}
|
|
30
29
|
|
|
30
|
+
export interface InputTextLikeProps extends React.ComponentProps<'input'> {
|
|
31
|
+
ariaLabel: string;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
export interface PhoneNumberProps {
|
|
32
36
|
number?: string;
|
|
33
37
|
countryCode?: string;
|
|
@@ -192,6 +196,7 @@ declare class SuccessFieldMessage extends React.Component<
|
|
|
192
196
|
any
|
|
193
197
|
> {}
|
|
194
198
|
declare class Input extends React.Component<InputProps, any> {}
|
|
199
|
+
declare class InputTextLike extends React.Component<InputTextLikeProps, any> {}
|
|
195
200
|
declare class PhoneNumber extends React.Component<PhoneNumberProps, any> {}
|
|
196
201
|
declare class Label extends React.Component<LabelProps, any> {}
|
|
197
202
|
declare class InputGroup extends React.Component<InputGroupProps, any> {}
|