@sb1/ffe-form-react 9.1.3 → 9.1.6
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 +1 -1
- package/es/ToggleSwitch.js +2 -2
- package/lib/InputGroup.js +1 -1
- package/lib/ToggleSwitch.js +1 -1
- package/package.json +2 -2
- package/types/index.d.ts +20 -14
package/es/InputGroup.js
CHANGED
|
@@ -97,7 +97,7 @@ var InputGroup = function InputGroup(_ref) {
|
|
|
97
97
|
}, tooltip), tooltip === true && /*#__PURE__*/React.createElement(Tooltip, {
|
|
98
98
|
onClick: onTooltipToggle
|
|
99
99
|
}), /*#__PURE__*/React.isValidElement(tooltip) && tooltip, description && /*#__PURE__*/React.createElement("div", {
|
|
100
|
-
className: "ffe-small-text",
|
|
100
|
+
className: "ffe-small-text ffe-input-group__description",
|
|
101
101
|
id: descriptionId
|
|
102
102
|
}, description), modifiedChildren, typeof fieldMessage === 'string' && /*#__PURE__*/React.createElement(ErrorFieldMessage, {
|
|
103
103
|
element: "p",
|
package/es/ToggleSwitch.js
CHANGED
|
@@ -31,7 +31,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
31
31
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
32
32
|
|
|
33
33
|
import React from 'react';
|
|
34
|
-
import { bool, node, string } from 'prop-types';
|
|
34
|
+
import { bool, node, string, oneOf } from 'prop-types';
|
|
35
35
|
import { v4 as uuidv4 } from 'uuid';
|
|
36
36
|
import classNames from 'classnames';
|
|
37
37
|
import i18n from './i18n/i18n';
|
|
@@ -112,7 +112,7 @@ ToggleSwitch.propTypes = {
|
|
|
112
112
|
className: string,
|
|
113
113
|
|
|
114
114
|
/** A second line of text in the label */
|
|
115
|
-
locale:
|
|
115
|
+
locale: oneOf(['nb', 'nn', 'en']),
|
|
116
116
|
|
|
117
117
|
/** On/Off text language */
|
|
118
118
|
description: string,
|
package/lib/InputGroup.js
CHANGED
|
@@ -118,7 +118,7 @@ var InputGroup = function InputGroup(_ref) {
|
|
|
118
118
|
}, tooltip), tooltip === true && /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
119
119
|
onClick: onTooltipToggle
|
|
120
120
|
}), /*#__PURE__*/_react.default.isValidElement(tooltip) && tooltip, description && /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
-
className: "ffe-small-text",
|
|
121
|
+
className: "ffe-small-text ffe-input-group__description",
|
|
122
122
|
id: descriptionId
|
|
123
123
|
}, description), modifiedChildren, typeof fieldMessage === 'string' && /*#__PURE__*/_react.default.createElement(_ErrorFieldMessage.default, {
|
|
124
124
|
element: "p",
|
package/lib/ToggleSwitch.js
CHANGED
|
@@ -125,7 +125,7 @@ ToggleSwitch.propTypes = {
|
|
|
125
125
|
className: _propTypes.string,
|
|
126
126
|
|
|
127
127
|
/** A second line of text in the label */
|
|
128
|
-
locale: _propTypes.
|
|
128
|
+
locale: (0, _propTypes.oneOf)(['nb', 'nn', 'en']),
|
|
129
129
|
|
|
130
130
|
/** On/Off text language */
|
|
131
131
|
description: _propTypes.string,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-form-react",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.6",
|
|
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": "b6aa8be25c11fb3f354bd97731e1d7aee9ffa2be"
|
|
49
49
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
export interface CheckboxProps
|
|
4
|
-
extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children'> {
|
|
5
5
|
noMargins?: boolean;
|
|
6
6
|
hiddenLabel?: boolean;
|
|
7
7
|
id?: string;
|
|
8
8
|
inline?: boolean;
|
|
9
|
-
children?:
|
|
9
|
+
children?:
|
|
10
|
+
| React.ReactNode
|
|
11
|
+
| ((labelProps: {
|
|
12
|
+
className: string;
|
|
13
|
+
htmlFor: string;
|
|
14
|
+
}) => React.ReactNode);
|
|
10
15
|
}
|
|
11
16
|
|
|
12
17
|
export interface BaseFieldMessageProps
|
|
@@ -88,7 +93,7 @@ export interface RadioBlockProps
|
|
|
88
93
|
label: string | React.ReactNode;
|
|
89
94
|
labelClass?: string;
|
|
90
95
|
name: string;
|
|
91
|
-
selectedValue?: boolean | string | number;
|
|
96
|
+
selectedValue?: boolean | string | number | null;
|
|
92
97
|
showChildren?: boolean;
|
|
93
98
|
value: string;
|
|
94
99
|
}
|
|
@@ -107,7 +112,7 @@ export interface RadioButtonProps extends WeakInputAttributes {
|
|
|
107
112
|
inline?: boolean;
|
|
108
113
|
innerRef?: React.Ref<HTMLElement>;
|
|
109
114
|
name: string;
|
|
110
|
-
selectedValue?: boolean | string | number;
|
|
115
|
+
selectedValue?: boolean | string | number | null;
|
|
111
116
|
tooltip?: string;
|
|
112
117
|
tooltipProps?: TooltipProps;
|
|
113
118
|
value: boolean | string | number;
|
|
@@ -128,7 +133,7 @@ export interface RadioButtonInputGroupProps
|
|
|
128
133
|
inline?: boolean;
|
|
129
134
|
name: string;
|
|
130
135
|
onChange: (...args: any) => any;
|
|
131
|
-
selectedValue?: boolean | string | number;
|
|
136
|
+
selectedValue?: boolean | string | number | null;
|
|
132
137
|
}) => React.ReactNode);
|
|
133
138
|
className?: string;
|
|
134
139
|
description?: string | React.ReactNode;
|
|
@@ -138,7 +143,7 @@ export interface RadioButtonInputGroupProps
|
|
|
138
143
|
label?: string | React.ReactNode;
|
|
139
144
|
name: string;
|
|
140
145
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
141
|
-
selectedValue?: string | boolean | number;
|
|
146
|
+
selectedValue?: string | boolean | number | null;
|
|
142
147
|
tooltip?: string | React.ReactNode;
|
|
143
148
|
}
|
|
144
149
|
|
|
@@ -154,7 +159,7 @@ export interface RadioSwitchProps
|
|
|
154
159
|
rightValue: boolean | string | number;
|
|
155
160
|
rightInnerRef?: React.Ref<HTMLInputElement>;
|
|
156
161
|
name: string;
|
|
157
|
-
selectedValue?: boolean | string | number;
|
|
162
|
+
selectedValue?: boolean | string | number | null;
|
|
158
163
|
tooltip?: string;
|
|
159
164
|
tooltipProps?: TooltipProps;
|
|
160
165
|
condensed?: boolean;
|
|
@@ -168,13 +173,14 @@ export interface TextAreaProps
|
|
|
168
173
|
export interface ToggleSwitchProps
|
|
169
174
|
extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
170
175
|
children: React.ReactNode;
|
|
171
|
-
className
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
className?: string;
|
|
177
|
+
locale?: 'nb' | 'nn' | 'en';
|
|
178
|
+
id?: string;
|
|
179
|
+
description?: string;
|
|
180
|
+
onText?: string;
|
|
181
|
+
offText?: string;
|
|
182
|
+
hideOnOff?: boolean;
|
|
183
|
+
value?: string;
|
|
178
184
|
}
|
|
179
185
|
|
|
180
186
|
declare class Checkbox extends React.Component<CheckboxProps, any> {}
|