@atlaskit/form 12.6.0 → 12.6.2
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 +16 -2
- package/dist/cjs/form.js +4 -2
- package/dist/es2019/form.js +4 -1
- package/dist/esm/form.js +4 -2
- package/dist/types/form.d.ts +1 -0
- package/dist/types-ts4.5/form.d.ts +1 -0
- package/offerings.json +40 -0
- package/package.json +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/form
|
|
2
2
|
|
|
3
|
+
## 12.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2f220beaedb7a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2f220beaedb7a) -
|
|
8
|
+
Remove unused dependency.
|
|
9
|
+
|
|
10
|
+
## 12.6.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`2e9c49d200b1d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2e9c49d200b1d) -
|
|
15
|
+
Added resetFieldState to Form children props
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 12.6.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -299,8 +314,7 @@
|
|
|
299
314
|
handle `.css` imports correctly.Most bundlers come with built-in support for `.css` imports, so
|
|
300
315
|
you may not need to do anything. If you are using a different bundler, please refer to the
|
|
301
316
|
documentation for that bundler to understand how to handle `.css` imports.For more information on
|
|
302
|
-
the migration, please refer to [RFC-73 Migrating our components to
|
|
303
|
-
Compiled
|
|
317
|
+
the migration, please refer to [RFC-73 Migrating our components to Compiled
|
|
304
318
|
CSS-in-JS](https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/859
|
|
305
319
|
|
|
306
320
|
## 10.6.3
|
package/dist/cjs/form.js
CHANGED
|
@@ -157,7 +157,7 @@ function Form(props) {
|
|
|
157
157
|
});
|
|
158
158
|
var childrenContent = function () {
|
|
159
159
|
if (typeof children === 'function') {
|
|
160
|
-
var result = children.length > 0 ? children({
|
|
160
|
+
var result = children.length > 0 ? children(_objectSpread({
|
|
161
161
|
formProps: formProps,
|
|
162
162
|
dirty: dirty,
|
|
163
163
|
reset: handleReset,
|
|
@@ -170,7 +170,9 @@ function Form(props) {
|
|
|
170
170
|
return form.getState().values;
|
|
171
171
|
},
|
|
172
172
|
setFieldValue: form.change
|
|
173
|
-
}
|
|
173
|
+
}, (0, _platformFeatureFlags.fg)('platform-form-reset-field-state') && {
|
|
174
|
+
resetFieldState: form.resetFieldState
|
|
175
|
+
})) : children();
|
|
174
176
|
return result === undefined ? null : result;
|
|
175
177
|
} else {
|
|
176
178
|
return (0, _platformFeatureFlags.fg)('platform_design-system-team_form-upgrade') ? /*#__PURE__*/_react.default.createElement("form", (0, _extends2.default)({}, formProps, userProvidedFormProps), children) : children;
|
package/dist/es2019/form.js
CHANGED
|
@@ -144,7 +144,10 @@ export default function Form(props) {
|
|
|
144
144
|
disabled: isDisabled,
|
|
145
145
|
getState: () => form.getState(),
|
|
146
146
|
getValues: () => form.getState().values,
|
|
147
|
-
setFieldValue: form.change
|
|
147
|
+
setFieldValue: form.change,
|
|
148
|
+
...(fg('platform-form-reset-field-state') && {
|
|
149
|
+
resetFieldState: form.resetFieldState
|
|
150
|
+
})
|
|
148
151
|
}) : children();
|
|
149
152
|
return result === undefined ? null : result;
|
|
150
153
|
} else {
|
package/dist/esm/form.js
CHANGED
|
@@ -147,7 +147,7 @@ export default function Form(props) {
|
|
|
147
147
|
});
|
|
148
148
|
var childrenContent = function () {
|
|
149
149
|
if (typeof children === 'function') {
|
|
150
|
-
var result = children.length > 0 ? children({
|
|
150
|
+
var result = children.length > 0 ? children(_objectSpread({
|
|
151
151
|
formProps: formProps,
|
|
152
152
|
dirty: dirty,
|
|
153
153
|
reset: handleReset,
|
|
@@ -160,7 +160,9 @@ export default function Form(props) {
|
|
|
160
160
|
return form.getState().values;
|
|
161
161
|
},
|
|
162
162
|
setFieldValue: form.change
|
|
163
|
-
})
|
|
163
|
+
}, fg('platform-form-reset-field-state') && {
|
|
164
|
+
resetFieldState: form.resetFieldState
|
|
165
|
+
})) : children();
|
|
164
166
|
return result === undefined ? null : result;
|
|
165
167
|
} else {
|
|
166
168
|
return fg('platform_design-system-team_form-upgrade') ? /*#__PURE__*/React.createElement("form", _extends({}, formProps, userProvidedFormProps), children) : children;
|
package/dist/types/form.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ type FormChildrenArgs<FormValues> = {
|
|
|
33
33
|
getState: () => FormState<FormValues>;
|
|
34
34
|
getValues: () => FormValues;
|
|
35
35
|
setFieldValue: (name: string, value: any) => void;
|
|
36
|
+
resetFieldState?: (name: string) => void;
|
|
36
37
|
reset: (initialValues?: FormValues) => void;
|
|
37
38
|
};
|
|
38
39
|
type ExcludeReservedFormProps = {
|
|
@@ -33,6 +33,7 @@ type FormChildrenArgs<FormValues> = {
|
|
|
33
33
|
getState: () => FormState<FormValues>;
|
|
34
34
|
getValues: () => FormValues;
|
|
35
35
|
setFieldValue: (name: string, value: any) => void;
|
|
36
|
+
resetFieldState?: (name: string) => void;
|
|
36
37
|
reset: (initialValues?: FormValues) => void;
|
|
37
38
|
};
|
|
38
39
|
type ExcludeReservedFormProps = {
|
package/offerings.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "Form",
|
|
4
|
+
"package": "@atlaskit/form",
|
|
5
|
+
"import": {
|
|
6
|
+
"name": "Form",
|
|
7
|
+
"package": "@atlaskit/form",
|
|
8
|
+
"type": "default"
|
|
9
|
+
},
|
|
10
|
+
"keywords": ["form", "validation", "field", "input", "submit", "state"],
|
|
11
|
+
"categories": ["form"],
|
|
12
|
+
"shortDescription": "A component for building forms with validation and state management.",
|
|
13
|
+
"status": "general-availability",
|
|
14
|
+
"accessibilityGuidelines": [
|
|
15
|
+
"Provide clear labels for all form fields",
|
|
16
|
+
"Use appropriate error messaging",
|
|
17
|
+
"Ensure keyboard navigation between fields",
|
|
18
|
+
"Mark required fields clearly",
|
|
19
|
+
"Provide helpful validation feedback"
|
|
20
|
+
],
|
|
21
|
+
"usageGuidelines": [
|
|
22
|
+
"Use for complex forms with validation",
|
|
23
|
+
"Provide clear field labels and instructions",
|
|
24
|
+
"Use single column layout for better comprehension",
|
|
25
|
+
"Mark required fields with asterisk (*)",
|
|
26
|
+
"Provide specific error messages"
|
|
27
|
+
],
|
|
28
|
+
"contentGuidelines": [
|
|
29
|
+
"Use clear, concise labels",
|
|
30
|
+
"Write helpful placeholder text",
|
|
31
|
+
"Provide specific error messages",
|
|
32
|
+
"Use consistent terminology",
|
|
33
|
+
"Always include a visible label (exception: search fields)",
|
|
34
|
+
"Match field length to intended content length"
|
|
35
|
+
],
|
|
36
|
+
"examples": {
|
|
37
|
+
"basic": "./examples/ai/form.tsx"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/form",
|
|
3
|
-
"version": "12.6.
|
|
3
|
+
"version": "12.6.2",
|
|
4
4
|
"description": "A form allows users to input information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,10 +28,9 @@
|
|
|
28
28
|
"@atlaskit/css": "^0.14.0",
|
|
29
29
|
"@atlaskit/ds-lib": "^5.0.0",
|
|
30
30
|
"@atlaskit/heading": "^5.2.0",
|
|
31
|
-
"@atlaskit/icon": "^28.
|
|
31
|
+
"@atlaskit/icon": "^28.2.0",
|
|
32
32
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
33
33
|
"@atlaskit/primitives": "^14.14.0",
|
|
34
|
-
"@atlaskit/theme": "^21.0.0",
|
|
35
34
|
"@atlaskit/tokens": "^6.3.0",
|
|
36
35
|
"@babel/runtime": "^7.0.0",
|
|
37
36
|
"final-form": "^4.20.3",
|
|
@@ -50,14 +49,14 @@
|
|
|
50
49
|
"@atlaskit/checkbox": "^17.1.0",
|
|
51
50
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
52
51
|
"@atlaskit/datetime-picker": "^17.0.0",
|
|
53
|
-
"@atlaskit/docs": "^11.
|
|
52
|
+
"@atlaskit/docs": "^11.1.0",
|
|
54
53
|
"@atlaskit/link": "^3.2.0",
|
|
55
54
|
"@atlaskit/lozenge": "^13.0.0",
|
|
56
55
|
"@atlaskit/modal-dialog": "^14.3.0",
|
|
57
56
|
"@atlaskit/radio": "^8.3.0",
|
|
58
57
|
"@atlaskit/range": "^9.2.0",
|
|
59
58
|
"@atlaskit/section-message": "^8.7.0",
|
|
60
|
-
"@atlaskit/select": "^21.
|
|
59
|
+
"@atlaskit/select": "^21.3.0",
|
|
61
60
|
"@atlaskit/textarea": "^8.0.0",
|
|
62
61
|
"@atlaskit/textfield": "^8.0.0",
|
|
63
62
|
"@atlaskit/toggle": "^15.1.0",
|
|
@@ -122,6 +121,9 @@
|
|
|
122
121
|
},
|
|
123
122
|
"platform-form-field-error-focus": {
|
|
124
123
|
"type": "boolean"
|
|
124
|
+
},
|
|
125
|
+
"platform-form-reset-field-state": {
|
|
126
|
+
"type": "boolean"
|
|
125
127
|
}
|
|
126
128
|
}
|
|
127
129
|
}
|