@atlaskit/form 12.0.11 → 12.0.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/CHANGELOG.md +17 -0
- package/dist/cjs/checkbox-field.js +29 -21
- package/dist/cjs/messages.js +4 -4
- package/dist/cjs/range-field.js +26 -20
- package/dist/es2019/checkbox-field.js +18 -11
- package/dist/es2019/messages.js +2 -2
- package/dist/es2019/range-field.js +11 -4
- package/dist/esm/checkbox-field.js +29 -21
- package/dist/esm/messages.js +2 -2
- package/dist/esm/range-field.js +26 -20
- package/dist/types/checkbox-field.d.ts +2 -2
- package/dist/types/label.d.ts +3 -3
- package/dist/types/range-field.d.ts +2 -2
- package/dist/types-ts4.5/checkbox-field.d.ts +2 -2
- package/dist/types-ts4.5/label.d.ts +3 -3
- package/dist/types-ts4.5/range-field.d.ts +2 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/form
|
|
2
2
|
|
|
3
|
+
## 12.0.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#188952](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/188952)
|
|
8
|
+
[`1a88e6e2601ae`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1a88e6e2601ae) -
|
|
9
|
+
Migrated usage of renamed/deprecated icons
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 12.0.12
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#182760](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/182760)
|
|
17
|
+
[`971d04b4835b3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/971d04b4835b3) -
|
|
18
|
+
Remove React.FC from all form components.
|
|
19
|
+
|
|
3
20
|
## 12.0.11
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -12,7 +12,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _field = _interopRequireDefault(require("./field"));
|
|
15
|
-
var _excluded = ["children", "defaultIsChecked", "value"],
|
|
15
|
+
var _excluded = ["children", "defaultIsChecked", "isDisabled", "isRequired", "label", "name", "value"],
|
|
16
16
|
_excluded2 = ["value"],
|
|
17
17
|
_excluded3 = ["fieldProps"],
|
|
18
18
|
_excluded4 = ["value"],
|
|
@@ -29,13 +29,16 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
29
29
|
* - [Code] https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#checkboxfield-reference
|
|
30
30
|
* - [Usage] https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#checkboxfield-reference
|
|
31
31
|
*/
|
|
32
|
-
var CheckboxField = function CheckboxField(
|
|
33
|
-
var children =
|
|
34
|
-
|
|
35
|
-
defaultIsChecked =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
var CheckboxField = function CheckboxField(_ref) {
|
|
33
|
+
var children = _ref.children,
|
|
34
|
+
_ref$defaultIsChecked = _ref.defaultIsChecked,
|
|
35
|
+
defaultIsChecked = _ref$defaultIsChecked === void 0 ? false : _ref$defaultIsChecked,
|
|
36
|
+
isDisabled = _ref.isDisabled,
|
|
37
|
+
isRequired = _ref.isRequired,
|
|
38
|
+
label = _ref.label,
|
|
39
|
+
name = _ref.name,
|
|
40
|
+
value = _ref.value,
|
|
41
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
39
42
|
// Maintains a memoised list of the default values
|
|
40
43
|
var defaultValue = (0, _react.useCallback)(function () {
|
|
41
44
|
var currentValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -43,16 +46,20 @@ var CheckboxField = function CheckboxField(props) {
|
|
|
43
46
|
}, [value, defaultIsChecked]);
|
|
44
47
|
return value !== undefined ? /*#__PURE__*/_react.default.createElement(_field.default, (0, _extends2.default)({}, rest, {
|
|
45
48
|
defaultValue: defaultValue,
|
|
49
|
+
isDisabled: isDisabled,
|
|
50
|
+
isRequired: isRequired,
|
|
51
|
+
label: label,
|
|
52
|
+
name: name,
|
|
46
53
|
transform: function transform(event, currentValue) {
|
|
47
54
|
return event.currentTarget.checked && currentValue ? [].concat((0, _toConsumableArray2.default)(currentValue), [value]) : currentValue.filter(function (v) {
|
|
48
55
|
return v !== value;
|
|
49
56
|
});
|
|
50
57
|
}
|
|
51
|
-
}), function (
|
|
52
|
-
var
|
|
53
|
-
fieldValue =
|
|
54
|
-
otherFieldProps = (0, _objectWithoutProperties2.default)(
|
|
55
|
-
others = (0, _objectWithoutProperties2.default)(
|
|
58
|
+
}), function (_ref2) {
|
|
59
|
+
var _ref2$fieldProps = _ref2.fieldProps,
|
|
60
|
+
fieldValue = _ref2$fieldProps.value,
|
|
61
|
+
otherFieldProps = (0, _objectWithoutProperties2.default)(_ref2$fieldProps, _excluded2),
|
|
62
|
+
others = (0, _objectWithoutProperties2.default)(_ref2, _excluded3);
|
|
56
63
|
return children(_objectSpread({
|
|
57
64
|
fieldProps: _objectSpread(_objectSpread({}, otherFieldProps), {}, {
|
|
58
65
|
isChecked: !!fieldValue.find(function (v) {
|
|
@@ -63,14 +70,18 @@ var CheckboxField = function CheckboxField(props) {
|
|
|
63
70
|
}, others));
|
|
64
71
|
}) : /*#__PURE__*/_react.default.createElement(_field.default, (0, _extends2.default)({}, rest, {
|
|
65
72
|
defaultValue: defaultIsChecked,
|
|
73
|
+
isDisabled: isDisabled,
|
|
74
|
+
isRequired: isRequired,
|
|
75
|
+
label: label,
|
|
76
|
+
name: name,
|
|
66
77
|
transform: function transform(event) {
|
|
67
78
|
return event.currentTarget.checked;
|
|
68
79
|
}
|
|
69
|
-
}), function (
|
|
70
|
-
var
|
|
71
|
-
fieldValue =
|
|
72
|
-
otherFieldProps = (0, _objectWithoutProperties2.default)(
|
|
73
|
-
others = (0, _objectWithoutProperties2.default)(
|
|
80
|
+
}), function (_ref3) {
|
|
81
|
+
var _ref3$fieldProps = _ref3.fieldProps,
|
|
82
|
+
fieldValue = _ref3$fieldProps.value,
|
|
83
|
+
otherFieldProps = (0, _objectWithoutProperties2.default)(_ref3$fieldProps, _excluded4),
|
|
84
|
+
others = (0, _objectWithoutProperties2.default)(_ref3, _excluded5);
|
|
74
85
|
return children(_objectSpread({
|
|
75
86
|
fieldProps: _objectSpread(_objectSpread({}, otherFieldProps), {}, {
|
|
76
87
|
isChecked: fieldValue,
|
|
@@ -79,7 +90,4 @@ var CheckboxField = function CheckboxField(props) {
|
|
|
79
90
|
}, others));
|
|
80
91
|
});
|
|
81
92
|
};
|
|
82
|
-
CheckboxField.defaultProps = {
|
|
83
|
-
defaultIsChecked: false
|
|
84
|
-
};
|
|
85
93
|
var _default = exports.default = CheckboxField;
|
package/dist/cjs/messages.js
CHANGED
|
@@ -12,8 +12,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var React = _react;
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
var
|
|
16
|
-
var
|
|
15
|
+
var _statusErrorError = _interopRequireDefault(require("@atlaskit/icon/core/migration/status-error--error"));
|
|
16
|
+
var _statusSuccessEditorSuccess = _interopRequireDefault(require("@atlaskit/icon/core/migration/status-success--editor-success"));
|
|
17
17
|
var _fieldIdContext = require("./field-id-context");
|
|
18
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
19
|
/**
|
|
@@ -40,14 +40,14 @@ var IconWrapper = function IconWrapper(_ref) {
|
|
|
40
40
|
}, children);
|
|
41
41
|
};
|
|
42
42
|
var messageIcons = {
|
|
43
|
-
error: /*#__PURE__*/React.createElement(
|
|
43
|
+
error: /*#__PURE__*/React.createElement(_statusErrorError.default, {
|
|
44
44
|
LEGACY_margin: "0 -2px 0 0",
|
|
45
45
|
color: "currentColor",
|
|
46
46
|
LEGACY_size: "small",
|
|
47
47
|
label: "error",
|
|
48
48
|
size: "small"
|
|
49
49
|
}),
|
|
50
|
-
valid: /*#__PURE__*/React.createElement(
|
|
50
|
+
valid: /*#__PURE__*/React.createElement(_statusSuccessEditorSuccess.default, {
|
|
51
51
|
LEGACY_margin: "0 -2px 0 0",
|
|
52
52
|
color: "currentColor",
|
|
53
53
|
LEGACY_size: "small",
|
package/dist/cjs/range-field.js
CHANGED
|
@@ -10,7 +10,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _field = _interopRequireDefault(require("./field"));
|
|
13
|
-
var _excluded = ["children"],
|
|
13
|
+
var _excluded = ["children", "defaultValue", "id", "isDisabled", "label", "name"],
|
|
14
14
|
_excluded2 = ["isInvalid", "isRequired"],
|
|
15
15
|
_excluded3 = ["fieldProps"];
|
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -26,25 +26,31 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
26
26
|
*/
|
|
27
27
|
var RangeField = function RangeField(_ref) {
|
|
28
28
|
var children = _ref.children,
|
|
29
|
+
defaultValue = _ref.defaultValue,
|
|
30
|
+
id = _ref.id,
|
|
31
|
+
isDisabled = _ref.isDisabled,
|
|
32
|
+
label = _ref.label,
|
|
33
|
+
name = _ref.name,
|
|
29
34
|
strippedProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
30
|
-
return (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_field.default, (0, _extends2.default)({}, strippedProps, {
|
|
36
|
+
defaultValue: defaultValue,
|
|
37
|
+
id: id,
|
|
38
|
+
isDisabled: isDisabled,
|
|
39
|
+
label: label,
|
|
40
|
+
name: name,
|
|
41
|
+
transform: Number
|
|
42
|
+
}), function (_ref2) {
|
|
43
|
+
var _ref2$fieldProps = _ref2.fieldProps,
|
|
44
|
+
isInvalid = _ref2$fieldProps.isInvalid,
|
|
45
|
+
isRequired = _ref2$fieldProps.isRequired,
|
|
46
|
+
fieldProps = (0, _objectWithoutProperties2.default)(_ref2$fieldProps, _excluded2),
|
|
47
|
+
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded3);
|
|
48
|
+
return (
|
|
49
|
+
// isInvalid and isRequired are specifically invalid for range inputs
|
|
50
|
+
children(_objectSpread({
|
|
51
|
+
fieldProps: fieldProps
|
|
52
|
+
}, rest))
|
|
53
|
+
);
|
|
54
|
+
});
|
|
49
55
|
};
|
|
50
56
|
var _default = exports.default = RangeField;
|
|
@@ -10,18 +10,24 @@ import Field from './field';
|
|
|
10
10
|
* - [Code] https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#checkboxfield-reference
|
|
11
11
|
* - [Usage] https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#checkboxfield-reference
|
|
12
12
|
*/
|
|
13
|
-
const CheckboxField =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const CheckboxField = ({
|
|
14
|
+
children,
|
|
15
|
+
defaultIsChecked = false,
|
|
16
|
+
isDisabled,
|
|
17
|
+
isRequired,
|
|
18
|
+
label,
|
|
19
|
+
name,
|
|
20
|
+
value,
|
|
21
|
+
...rest
|
|
22
|
+
}) => {
|
|
21
23
|
// Maintains a memoised list of the default values
|
|
22
24
|
const defaultValue = useCallback((currentValue = []) => defaultIsChecked && value !== undefined ? [...currentValue, value] : currentValue, [value, defaultIsChecked]);
|
|
23
25
|
return value !== undefined ? /*#__PURE__*/React.createElement(Field, _extends({}, rest, {
|
|
24
26
|
defaultValue: defaultValue,
|
|
27
|
+
isDisabled: isDisabled,
|
|
28
|
+
isRequired: isRequired,
|
|
29
|
+
label: label,
|
|
30
|
+
name: name,
|
|
25
31
|
transform: (event, currentValue) => event.currentTarget.checked && currentValue ? [...currentValue, value] : currentValue.filter(v => v !== value)
|
|
26
32
|
}), ({
|
|
27
33
|
fieldProps: {
|
|
@@ -38,6 +44,10 @@ const CheckboxField = props => {
|
|
|
38
44
|
...others
|
|
39
45
|
})) : /*#__PURE__*/React.createElement(Field, _extends({}, rest, {
|
|
40
46
|
defaultValue: defaultIsChecked,
|
|
47
|
+
isDisabled: isDisabled,
|
|
48
|
+
isRequired: isRequired,
|
|
49
|
+
label: label,
|
|
50
|
+
name: name,
|
|
41
51
|
transform: event => event.currentTarget.checked
|
|
42
52
|
}), ({
|
|
43
53
|
fieldProps: {
|
|
@@ -54,7 +64,4 @@ const CheckboxField = props => {
|
|
|
54
64
|
...others
|
|
55
65
|
}));
|
|
56
66
|
};
|
|
57
|
-
CheckboxField.defaultProps = {
|
|
58
|
-
defaultIsChecked: false
|
|
59
|
-
};
|
|
60
67
|
export default CheckboxField;
|
package/dist/es2019/messages.js
CHANGED
|
@@ -3,8 +3,8 @@ import "./messages.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { createContext, useContext, useEffect, useRef, useState } from 'react';
|
|
6
|
-
import ErrorIcon from '@atlaskit/icon/core/migration/error';
|
|
7
|
-
import SuccessIcon from '@atlaskit/icon/core/migration/success--editor-success';
|
|
6
|
+
import ErrorIcon from '@atlaskit/icon/core/migration/status-error--error';
|
|
7
|
+
import SuccessIcon from '@atlaskit/icon/core/migration/status-success--editor-success';
|
|
8
8
|
import { FieldId } from './field-id-context';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -12,11 +12,18 @@ import Field from './field';
|
|
|
12
12
|
*/
|
|
13
13
|
const RangeField = ({
|
|
14
14
|
children,
|
|
15
|
+
defaultValue,
|
|
16
|
+
id,
|
|
17
|
+
isDisabled,
|
|
18
|
+
label,
|
|
19
|
+
name,
|
|
15
20
|
...strippedProps
|
|
16
|
-
}) =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
}) => /*#__PURE__*/React.createElement(Field, _extends({}, strippedProps, {
|
|
22
|
+
defaultValue: defaultValue,
|
|
23
|
+
id: id,
|
|
24
|
+
isDisabled: isDisabled,
|
|
25
|
+
label: label,
|
|
26
|
+
name: name,
|
|
20
27
|
transform: Number
|
|
21
28
|
}), ({
|
|
22
29
|
fieldProps: {
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["children", "defaultIsChecked", "value"],
|
|
5
|
+
var _excluded = ["children", "defaultIsChecked", "isDisabled", "isRequired", "label", "name", "value"],
|
|
6
6
|
_excluded2 = ["value"],
|
|
7
7
|
_excluded3 = ["fieldProps"],
|
|
8
8
|
_excluded4 = ["value"],
|
|
@@ -20,13 +20,16 @@ import Field from './field';
|
|
|
20
20
|
* - [Code] https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#checkboxfield-reference
|
|
21
21
|
* - [Usage] https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#checkboxfield-reference
|
|
22
22
|
*/
|
|
23
|
-
var CheckboxField = function CheckboxField(
|
|
24
|
-
var children =
|
|
25
|
-
|
|
26
|
-
defaultIsChecked =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
var CheckboxField = function CheckboxField(_ref) {
|
|
24
|
+
var children = _ref.children,
|
|
25
|
+
_ref$defaultIsChecked = _ref.defaultIsChecked,
|
|
26
|
+
defaultIsChecked = _ref$defaultIsChecked === void 0 ? false : _ref$defaultIsChecked,
|
|
27
|
+
isDisabled = _ref.isDisabled,
|
|
28
|
+
isRequired = _ref.isRequired,
|
|
29
|
+
label = _ref.label,
|
|
30
|
+
name = _ref.name,
|
|
31
|
+
value = _ref.value,
|
|
32
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
33
|
// Maintains a memoised list of the default values
|
|
31
34
|
var defaultValue = useCallback(function () {
|
|
32
35
|
var currentValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -34,16 +37,20 @@ var CheckboxField = function CheckboxField(props) {
|
|
|
34
37
|
}, [value, defaultIsChecked]);
|
|
35
38
|
return value !== undefined ? /*#__PURE__*/React.createElement(Field, _extends({}, rest, {
|
|
36
39
|
defaultValue: defaultValue,
|
|
40
|
+
isDisabled: isDisabled,
|
|
41
|
+
isRequired: isRequired,
|
|
42
|
+
label: label,
|
|
43
|
+
name: name,
|
|
37
44
|
transform: function transform(event, currentValue) {
|
|
38
45
|
return event.currentTarget.checked && currentValue ? [].concat(_toConsumableArray(currentValue), [value]) : currentValue.filter(function (v) {
|
|
39
46
|
return v !== value;
|
|
40
47
|
});
|
|
41
48
|
}
|
|
42
|
-
}), function (
|
|
43
|
-
var
|
|
44
|
-
fieldValue =
|
|
45
|
-
otherFieldProps = _objectWithoutProperties(
|
|
46
|
-
others = _objectWithoutProperties(
|
|
49
|
+
}), function (_ref2) {
|
|
50
|
+
var _ref2$fieldProps = _ref2.fieldProps,
|
|
51
|
+
fieldValue = _ref2$fieldProps.value,
|
|
52
|
+
otherFieldProps = _objectWithoutProperties(_ref2$fieldProps, _excluded2),
|
|
53
|
+
others = _objectWithoutProperties(_ref2, _excluded3);
|
|
47
54
|
return children(_objectSpread({
|
|
48
55
|
fieldProps: _objectSpread(_objectSpread({}, otherFieldProps), {}, {
|
|
49
56
|
isChecked: !!fieldValue.find(function (v) {
|
|
@@ -54,14 +61,18 @@ var CheckboxField = function CheckboxField(props) {
|
|
|
54
61
|
}, others));
|
|
55
62
|
}) : /*#__PURE__*/React.createElement(Field, _extends({}, rest, {
|
|
56
63
|
defaultValue: defaultIsChecked,
|
|
64
|
+
isDisabled: isDisabled,
|
|
65
|
+
isRequired: isRequired,
|
|
66
|
+
label: label,
|
|
67
|
+
name: name,
|
|
57
68
|
transform: function transform(event) {
|
|
58
69
|
return event.currentTarget.checked;
|
|
59
70
|
}
|
|
60
|
-
}), function (
|
|
61
|
-
var
|
|
62
|
-
fieldValue =
|
|
63
|
-
otherFieldProps = _objectWithoutProperties(
|
|
64
|
-
others = _objectWithoutProperties(
|
|
71
|
+
}), function (_ref3) {
|
|
72
|
+
var _ref3$fieldProps = _ref3.fieldProps,
|
|
73
|
+
fieldValue = _ref3$fieldProps.value,
|
|
74
|
+
otherFieldProps = _objectWithoutProperties(_ref3$fieldProps, _excluded4),
|
|
75
|
+
others = _objectWithoutProperties(_ref3, _excluded5);
|
|
65
76
|
return children(_objectSpread({
|
|
66
77
|
fieldProps: _objectSpread(_objectSpread({}, otherFieldProps), {}, {
|
|
67
78
|
isChecked: fieldValue,
|
|
@@ -70,7 +81,4 @@ var CheckboxField = function CheckboxField(props) {
|
|
|
70
81
|
}, others));
|
|
71
82
|
});
|
|
72
83
|
};
|
|
73
|
-
CheckboxField.defaultProps = {
|
|
74
|
-
defaultIsChecked: false
|
|
75
|
-
};
|
|
76
84
|
export default CheckboxField;
|
package/dist/esm/messages.js
CHANGED
|
@@ -4,8 +4,8 @@ import "./messages.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { createContext, useContext, useEffect, useRef, useState } from 'react';
|
|
7
|
-
import ErrorIcon from '@atlaskit/icon/core/migration/error';
|
|
8
|
-
import SuccessIcon from '@atlaskit/icon/core/migration/success--editor-success';
|
|
7
|
+
import ErrorIcon from '@atlaskit/icon/core/migration/status-error--error';
|
|
8
|
+
import SuccessIcon from '@atlaskit/icon/core/migration/status-success--editor-success';
|
|
9
9
|
import { FieldId } from './field-id-context';
|
|
10
10
|
|
|
11
11
|
/**
|
package/dist/esm/range-field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["children"],
|
|
4
|
+
var _excluded = ["children", "defaultValue", "id", "isDisabled", "label", "name"],
|
|
5
5
|
_excluded2 = ["isInvalid", "isRequired"],
|
|
6
6
|
_excluded3 = ["fieldProps"];
|
|
7
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -19,25 +19,31 @@ import Field from './field';
|
|
|
19
19
|
*/
|
|
20
20
|
var RangeField = function RangeField(_ref) {
|
|
21
21
|
var children = _ref.children,
|
|
22
|
+
defaultValue = _ref.defaultValue,
|
|
23
|
+
id = _ref.id,
|
|
24
|
+
isDisabled = _ref.isDisabled,
|
|
25
|
+
label = _ref.label,
|
|
26
|
+
name = _ref.name,
|
|
22
27
|
strippedProps = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
-
return (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
return /*#__PURE__*/React.createElement(Field, _extends({}, strippedProps, {
|
|
29
|
+
defaultValue: defaultValue,
|
|
30
|
+
id: id,
|
|
31
|
+
isDisabled: isDisabled,
|
|
32
|
+
label: label,
|
|
33
|
+
name: name,
|
|
34
|
+
transform: Number
|
|
35
|
+
}), function (_ref2) {
|
|
36
|
+
var _ref2$fieldProps = _ref2.fieldProps,
|
|
37
|
+
isInvalid = _ref2$fieldProps.isInvalid,
|
|
38
|
+
isRequired = _ref2$fieldProps.isRequired,
|
|
39
|
+
fieldProps = _objectWithoutProperties(_ref2$fieldProps, _excluded2),
|
|
40
|
+
rest = _objectWithoutProperties(_ref2, _excluded3);
|
|
41
|
+
return (
|
|
42
|
+
// isInvalid and isRequired are specifically invalid for range inputs
|
|
43
|
+
children(_objectSpread({
|
|
44
|
+
fieldProps: fieldProps
|
|
45
|
+
}, rest))
|
|
46
|
+
);
|
|
47
|
+
});
|
|
42
48
|
};
|
|
43
49
|
export default RangeField;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
2
|
import { type FieldProps, type Meta } from './field';
|
|
3
3
|
export interface CheckboxFieldProps extends FieldProps<string | undefined> {
|
|
4
4
|
isChecked: boolean;
|
|
@@ -47,5 +47,5 @@ interface CheckboxProps {
|
|
|
47
47
|
* - [Code] https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#checkboxfield-reference
|
|
48
48
|
* - [Usage] https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#checkboxfield-reference
|
|
49
49
|
*/
|
|
50
|
-
declare const CheckboxField:
|
|
50
|
+
declare const CheckboxField: ({ children, defaultIsChecked, isDisabled, isRequired, label, name, value, ...rest }: CheckboxProps) => React.JSX.Element;
|
|
51
51
|
export default CheckboxField;
|
package/dist/types/label.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
import { type
|
|
5
|
+
import { type ReactNode } from 'react';
|
|
6
6
|
export interface LabelProps {
|
|
7
7
|
id?: string;
|
|
8
8
|
htmlFor: string;
|
|
@@ -20,10 +20,10 @@ export interface LegendProps {
|
|
|
20
20
|
* It's recommended that a label has a `space.050` spacing above its associated
|
|
21
21
|
* control element.
|
|
22
22
|
*/
|
|
23
|
-
export declare const Label:
|
|
23
|
+
export declare const Label: ({ children, htmlFor, id, testId }: LabelProps) => JSX.Element;
|
|
24
24
|
/**
|
|
25
25
|
* __Legend__
|
|
26
26
|
*
|
|
27
27
|
* A Legend represents a caption for a fieldset in a user interface.
|
|
28
28
|
*/
|
|
29
|
-
export declare const Legend:
|
|
29
|
+
export declare const Legend: ({ children }: LegendProps) => JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { type
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
2
|
import { type FieldProps, type Meta } from './field';
|
|
3
3
|
type RangeProps = Omit<FieldProps<number>, 'isInvalid' | 'isRequired'>;
|
|
4
4
|
export interface RangeFieldProps {
|
|
@@ -37,5 +37,5 @@ export interface RangeFieldProps {
|
|
|
37
37
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#rangefield-reference)
|
|
38
38
|
* - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#rangefield-reference)
|
|
39
39
|
*/
|
|
40
|
-
declare const RangeField:
|
|
40
|
+
declare const RangeField: ({ children, defaultValue, id, isDisabled, label, name, ...strippedProps }: RangeFieldProps) => React.JSX.Element;
|
|
41
41
|
export default RangeField;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
2
|
import { type FieldProps, type Meta } from './field';
|
|
3
3
|
export interface CheckboxFieldProps extends FieldProps<string | undefined> {
|
|
4
4
|
isChecked: boolean;
|
|
@@ -47,5 +47,5 @@ interface CheckboxProps {
|
|
|
47
47
|
* - [Code] https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#checkboxfield-reference
|
|
48
48
|
* - [Usage] https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#checkboxfield-reference
|
|
49
49
|
*/
|
|
50
|
-
declare const CheckboxField:
|
|
50
|
+
declare const CheckboxField: ({ children, defaultIsChecked, isDisabled, isRequired, label, name, value, ...rest }: CheckboxProps) => React.JSX.Element;
|
|
51
51
|
export default CheckboxField;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
import { type
|
|
5
|
+
import { type ReactNode } from 'react';
|
|
6
6
|
export interface LabelProps {
|
|
7
7
|
id?: string;
|
|
8
8
|
htmlFor: string;
|
|
@@ -20,10 +20,10 @@ export interface LegendProps {
|
|
|
20
20
|
* It's recommended that a label has a `space.050` spacing above its associated
|
|
21
21
|
* control element.
|
|
22
22
|
*/
|
|
23
|
-
export declare const Label:
|
|
23
|
+
export declare const Label: ({ children, htmlFor, id, testId }: LabelProps) => JSX.Element;
|
|
24
24
|
/**
|
|
25
25
|
* __Legend__
|
|
26
26
|
*
|
|
27
27
|
* A Legend represents a caption for a fieldset in a user interface.
|
|
28
28
|
*/
|
|
29
|
-
export declare const Legend:
|
|
29
|
+
export declare const Legend: ({ children }: LegendProps) => JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { type
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
2
|
import { type FieldProps, type Meta } from './field';
|
|
3
3
|
type RangeProps = Omit<FieldProps<number>, 'isInvalid' | 'isRequired'>;
|
|
4
4
|
export interface RangeFieldProps {
|
|
@@ -37,5 +37,5 @@ export interface RangeFieldProps {
|
|
|
37
37
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#rangefield-reference)
|
|
38
38
|
* - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#rangefield-reference)
|
|
39
39
|
*/
|
|
40
|
-
declare const RangeField:
|
|
40
|
+
declare const RangeField: ({ children, defaultValue, id, isDisabled, label, name, ...strippedProps }: RangeFieldProps) => React.JSX.Element;
|
|
41
41
|
export default RangeField;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/form",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.13",
|
|
4
4
|
"description": "A form allows users to input information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@atlaskit/css": "^0.12.0",
|
|
29
|
-
"@atlaskit/ds-lib": "^4.
|
|
29
|
+
"@atlaskit/ds-lib": "^4.1.0",
|
|
30
30
|
"@atlaskit/heading": "^5.2.0",
|
|
31
|
-
"@atlaskit/icon": "^27.
|
|
31
|
+
"@atlaskit/icon": "^27.5.0",
|
|
32
32
|
"@atlaskit/primitives": "^14.10.0",
|
|
33
33
|
"@atlaskit/theme": "^19.0.0",
|
|
34
|
-
"@atlaskit/tokens": "^5.
|
|
34
|
+
"@atlaskit/tokens": "^5.6.0",
|
|
35
35
|
"@babel/runtime": "^7.0.0",
|
|
36
36
|
"@compiled/react": "^0.18.3",
|
|
37
37
|
"final-form": "^4.20.3",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"@atlaskit/docs": "^11.0.0",
|
|
54
54
|
"@atlaskit/link": "^3.2.0",
|
|
55
55
|
"@atlaskit/lozenge": "^13.0.0",
|
|
56
|
-
"@atlaskit/modal-dialog": "^14.
|
|
56
|
+
"@atlaskit/modal-dialog": "^14.3.0",
|
|
57
57
|
"@atlaskit/radio": "^8.1.0",
|
|
58
58
|
"@atlaskit/range": "^9.1.0",
|
|
59
59
|
"@atlaskit/section-message": "^8.2.0",
|
|
60
|
-
"@atlaskit/select": "^21.
|
|
60
|
+
"@atlaskit/select": "^21.2.0",
|
|
61
61
|
"@atlaskit/textarea": "^8.0.0",
|
|
62
62
|
"@atlaskit/textfield": "^8.0.0",
|
|
63
63
|
"@atlaskit/toggle": "^15.0.0",
|