@atlaskit/form 10.5.6 → 10.5.8
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/field.js +6 -9
- package/dist/es2019/field.js +6 -7
- package/dist/esm/field.js +6 -9
- package/package.json +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/form
|
|
2
2
|
|
|
3
|
+
## 10.5.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#153024](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/153024)
|
|
8
|
+
[`f2ca7201459b1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f2ca7201459b1) -
|
|
9
|
+
Change `react-uid` to use ID generator that is compatible with React16 and React 18; Strict React
|
|
10
|
+
18 behind a flag.
|
|
11
|
+
|
|
12
|
+
## 10.5.7
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#152429](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/152429)
|
|
17
|
+
[`5d414827c3394`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5d414827c3394) -
|
|
18
|
+
Removes usages of deprecated CustomThemeButton in favor of the new Button
|
|
19
|
+
|
|
3
20
|
## 10.5.6
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/cjs/field.js
CHANGED
|
@@ -10,8 +10,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
|
-
var _reactUid = require("react-uid");
|
|
14
13
|
var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
|
|
14
|
+
var _useId = require("@atlaskit/ds-lib/use-id");
|
|
15
15
|
var _fieldIdContext = require("./field-id-context");
|
|
16
16
|
var _form = require("./form");
|
|
17
17
|
var _label = require("./label");
|
|
@@ -82,7 +82,7 @@ function Field(props) {
|
|
|
82
82
|
* effectively made it an optional prop to external consumers of Field. However the
|
|
83
83
|
* prop types defined defaultValue as required, so inside the component it was not
|
|
84
84
|
* valid for defaultValue to be undefined. We need to suppress the error
|
|
85
|
-
* after changing defaultValue to
|
|
85
|
+
* after changing defaultValue to explicitly be an optional prop.
|
|
86
86
|
* If default value has changed we are using new default value.
|
|
87
87
|
* Otherwise we need to check if we already have value for this field
|
|
88
88
|
* (because we are using changing key prop to re-run field level validation, and that
|
|
@@ -220,13 +220,10 @@ function Field(props) {
|
|
|
220
220
|
});
|
|
221
221
|
return unregister;
|
|
222
222
|
}, [latestPropsRef, latestStateRef, registerField, props.name, isDefaultValueChanged]);
|
|
223
|
-
var
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
id: props.name
|
|
228
|
-
}));
|
|
229
|
-
}, [props.id, props.name]);
|
|
223
|
+
var uid = (0, _useId.useId)();
|
|
224
|
+
var fieldId = (0, _react.useMemo)(function () {
|
|
225
|
+
return props.id ? props.id : "".concat(props.name, "-").concat(uid);
|
|
226
|
+
}, [props.id, props.name, uid]);
|
|
230
227
|
var getDescribedBy = function getDescribedBy() {
|
|
231
228
|
var value = '';
|
|
232
229
|
if (state.error) {
|
package/dist/es2019/field.js
CHANGED
|
@@ -6,8 +6,8 @@ import { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
|
-
import { uid } from 'react-uid';
|
|
10
9
|
import invariant from 'tiny-invariant';
|
|
10
|
+
import { useId } from '@atlaskit/ds-lib/use-id';
|
|
11
11
|
import { FieldId } from './field-id-context';
|
|
12
12
|
import { FormContext, IsDisabledContext } from './form';
|
|
13
13
|
import { Label } from './label';
|
|
@@ -74,7 +74,7 @@ export default function Field(props) {
|
|
|
74
74
|
* effectively made it an optional prop to external consumers of Field. However the
|
|
75
75
|
* prop types defined defaultValue as required, so inside the component it was not
|
|
76
76
|
* valid for defaultValue to be undefined. We need to suppress the error
|
|
77
|
-
* after changing defaultValue to
|
|
77
|
+
* after changing defaultValue to explicitly be an optional prop.
|
|
78
78
|
* If default value has changed we are using new default value.
|
|
79
79
|
* Otherwise we need to check if we already have value for this field
|
|
80
80
|
* (because we are using changing key prop to re-run field level validation, and that
|
|
@@ -208,11 +208,10 @@ export default function Field(props) {
|
|
|
208
208
|
});
|
|
209
209
|
return unregister;
|
|
210
210
|
}, [latestPropsRef, latestStateRef, registerField, props.name, isDefaultValueChanged]);
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
})}`, [props.id, props.name]);
|
|
211
|
+
const uid = useId();
|
|
212
|
+
const fieldId = useMemo(() => {
|
|
213
|
+
return props.id ? props.id : `${props.name}-${uid}`;
|
|
214
|
+
}, [props.id, props.name, uid]);
|
|
216
215
|
const getDescribedBy = () => {
|
|
217
216
|
let value = '';
|
|
218
217
|
if (state.error) {
|
package/dist/esm/field.js
CHANGED
|
@@ -11,8 +11,8 @@ import { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
11
11
|
|
|
12
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
13
|
import { css, jsx } from '@emotion/react';
|
|
14
|
-
import { uid } from 'react-uid';
|
|
15
14
|
import invariant from 'tiny-invariant';
|
|
15
|
+
import { useId } from '@atlaskit/ds-lib/use-id';
|
|
16
16
|
import { FieldId } from './field-id-context';
|
|
17
17
|
import { FormContext, IsDisabledContext } from './form';
|
|
18
18
|
import { Label } from './label';
|
|
@@ -78,7 +78,7 @@ export default function Field(props) {
|
|
|
78
78
|
* effectively made it an optional prop to external consumers of Field. However the
|
|
79
79
|
* prop types defined defaultValue as required, so inside the component it was not
|
|
80
80
|
* valid for defaultValue to be undefined. We need to suppress the error
|
|
81
|
-
* after changing defaultValue to
|
|
81
|
+
* after changing defaultValue to explicitly be an optional prop.
|
|
82
82
|
* If default value has changed we are using new default value.
|
|
83
83
|
* Otherwise we need to check if we already have value for this field
|
|
84
84
|
* (because we are using changing key prop to re-run field level validation, and that
|
|
@@ -216,13 +216,10 @@ export default function Field(props) {
|
|
|
216
216
|
});
|
|
217
217
|
return unregister;
|
|
218
218
|
}, [latestPropsRef, latestStateRef, registerField, props.name, isDefaultValueChanged]);
|
|
219
|
-
var
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
id: props.name
|
|
224
|
-
}));
|
|
225
|
-
}, [props.id, props.name]);
|
|
219
|
+
var uid = useId();
|
|
220
|
+
var fieldId = useMemo(function () {
|
|
221
|
+
return props.id ? props.id : "".concat(props.name, "-").concat(uid);
|
|
222
|
+
}, [props.id, props.name, uid]);
|
|
226
223
|
var getDescribedBy = function getDescribedBy() {
|
|
227
224
|
var value = '';
|
|
228
225
|
if (state.error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/form",
|
|
3
|
-
"version": "10.5.
|
|
3
|
+
"version": "10.5.8",
|
|
4
4
|
"description": "A form allows users to input information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
"runReact18": true
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"@atlaskit/ds-lib": "^3.0.0",
|
|
27
28
|
"@atlaskit/heading": "^2.4.0",
|
|
28
|
-
"@atlaskit/icon": "^22.
|
|
29
|
+
"@atlaskit/icon": "^22.22.0",
|
|
29
30
|
"@atlaskit/primitives": "^12.2.0",
|
|
30
|
-
"@atlaskit/theme": "^13.
|
|
31
|
+
"@atlaskit/theme": "^13.1.0",
|
|
31
32
|
"@atlaskit/tokens": "^2.0.0",
|
|
32
33
|
"@babel/runtime": "^7.0.0",
|
|
33
34
|
"@emotion/react": "^11.7.1",
|
|
34
35
|
"final-form": "^4.20.3",
|
|
35
36
|
"final-form-focus": "^1.1.2",
|
|
36
37
|
"lodash": "^4.17.21",
|
|
37
|
-
"react-uid": "^2.2.0",
|
|
38
38
|
"tiny-invariant": "^1.2.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -47,11 +47,10 @@
|
|
|
47
47
|
"@atlaskit/banner": "^12.5.0",
|
|
48
48
|
"@atlaskit/button": "^20.2.0",
|
|
49
49
|
"@atlaskit/checkbox": "^14.0.0",
|
|
50
|
-
"@atlaskit/ds-lib": "^3.0.0",
|
|
51
50
|
"@atlaskit/modal-dialog": "^12.17.0",
|
|
52
51
|
"@atlaskit/radio": "^6.5.0",
|
|
53
52
|
"@atlaskit/range": "^7.4.0",
|
|
54
|
-
"@atlaskit/select": "^18.
|
|
53
|
+
"@atlaskit/select": "^18.1.0",
|
|
55
54
|
"@atlaskit/ssr": "*",
|
|
56
55
|
"@atlaskit/textfield": "^6.5.0",
|
|
57
56
|
"@atlaskit/toggle": "^13.4.0",
|