@sb1/ffe-form-react 23.2.11 → 23.2.13
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/InputGroup.js +8 -4
- package/lib/InputGroup.js +8 -4
- package/package.json +3 -3
- package/types/InputGroup.d.ts +0 -2
package/es/InputGroup.js
CHANGED
|
@@ -25,9 +25,9 @@ import { Tooltip } from './Tooltip';
|
|
|
25
25
|
import { Label } from './Label';
|
|
26
26
|
import classNames from 'classnames';
|
|
27
27
|
import { ErrorFieldMessage } from './message';
|
|
28
|
-
var getChildrenWithExtraProps = function (children, extraProps) {
|
|
28
|
+
var getChildrenWithExtraProps = function (children, extraProps, functionExtraProps) {
|
|
29
29
|
if (typeof children === 'function') {
|
|
30
|
-
return children(extraProps);
|
|
30
|
+
return children(__assign(__assign({}, extraProps), functionExtraProps));
|
|
31
31
|
}
|
|
32
32
|
else if (React.isValidElement(children)) {
|
|
33
33
|
return React.cloneElement(children, extraProps);
|
|
@@ -75,9 +75,13 @@ export var InputGroup = function (_a) {
|
|
|
75
75
|
id: id,
|
|
76
76
|
'aria-invalid': isInvalid ? 'true' : 'false',
|
|
77
77
|
'aria-describedby': ariaDescribedBy,
|
|
78
|
-
setInputGroupLabelAsSpan: function () { return setLabelAsSpan(true); },
|
|
79
78
|
};
|
|
80
|
-
var
|
|
79
|
+
var extraFunctionProps = {
|
|
80
|
+
setInputGroupLabelAsSpan: function () {
|
|
81
|
+
setLabelAsSpan(true);
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
var modifiedChildren = getChildrenWithExtraProps(children, extraProps, extraFunctionProps);
|
|
81
85
|
return (React.createElement("div", __assign({ className: classNames('ffe-input-group', {
|
|
82
86
|
'ffe-input-group--no-extra-margin': !extraMargin,
|
|
83
87
|
'ffe-input-group--message': hasMessage,
|
package/lib/InputGroup.js
CHANGED
|
@@ -64,9 +64,9 @@ var Tooltip_1 = require("./Tooltip");
|
|
|
64
64
|
var Label_1 = require("./Label");
|
|
65
65
|
var classnames_1 = __importDefault(require("classnames"));
|
|
66
66
|
var message_1 = require("./message");
|
|
67
|
-
var getChildrenWithExtraProps = function (children, extraProps) {
|
|
67
|
+
var getChildrenWithExtraProps = function (children, extraProps, functionExtraProps) {
|
|
68
68
|
if (typeof children === 'function') {
|
|
69
|
-
return children(extraProps);
|
|
69
|
+
return children(__assign(__assign({}, extraProps), functionExtraProps));
|
|
70
70
|
}
|
|
71
71
|
else if (react_1.default.isValidElement(children)) {
|
|
72
72
|
return react_1.default.cloneElement(children, extraProps);
|
|
@@ -114,9 +114,13 @@ var InputGroup = function (_a) {
|
|
|
114
114
|
id: id,
|
|
115
115
|
'aria-invalid': isInvalid ? 'true' : 'false',
|
|
116
116
|
'aria-describedby': ariaDescribedBy,
|
|
117
|
-
setInputGroupLabelAsSpan: function () { return setLabelAsSpan(true); },
|
|
118
117
|
};
|
|
119
|
-
var
|
|
118
|
+
var extraFunctionProps = {
|
|
119
|
+
setInputGroupLabelAsSpan: function () {
|
|
120
|
+
setLabelAsSpan(true);
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
var modifiedChildren = getChildrenWithExtraProps(children, extraProps, extraFunctionProps);
|
|
120
124
|
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('ffe-input-group', {
|
|
121
125
|
'ffe-input-group--no-extra-margin': !extraMargin,
|
|
122
126
|
'ffe-input-group--message': hasMessage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-form-react",
|
|
3
|
-
"version": "23.2.
|
|
3
|
+
"version": "23.2.13",
|
|
4
4
|
"description": "React component for form elements in ffe",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@sb1/ffe-collapse-react": "^5.1.20",
|
|
30
|
-
"@sb1/ffe-form": "^32.0.
|
|
30
|
+
"@sb1/ffe-form": "^32.0.19",
|
|
31
31
|
"@sb1/ffe-icons-react": "^11.0.20",
|
|
32
32
|
"classnames": "^2.3.1"
|
|
33
33
|
},
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "03e9a2f3bd66232d73630dcd202cde04fec9821c"
|
|
47
47
|
}
|
package/types/InputGroup.d.ts
CHANGED
|
@@ -4,8 +4,6 @@ type ChildrenExtraProps = {
|
|
|
4
4
|
id: string;
|
|
5
5
|
'aria-invalid': 'true' | 'false';
|
|
6
6
|
'aria-describedby': string | undefined;
|
|
7
|
-
/** Hack that changes label to a span to be wcag complient */
|
|
8
|
-
setInputGroupLabelAsSpan?: () => void;
|
|
9
7
|
};
|
|
10
8
|
export interface InputGroupProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
11
9
|
/** The id that will be used on the input child if you don't want a generated one */
|