@atlaskit/form 12.6.0 → 12.6.1

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/form
2
2
 
3
+ ## 12.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2e9c49d200b1d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2e9c49d200b1d) -
8
+ Added resetFieldState to Form children props
9
+ - Updated dependencies
10
+
3
11
  ## 12.6.0
4
12
 
5
13
  ### Minor Changes
package/dist/cjs/field.js CHANGED
@@ -1,4 +1,4 @@
1
- /* field.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* field.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* fieldset.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* fieldset.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -1,4 +1,4 @@
1
- /* form-footer.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* form-footer.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -1,4 +1,4 @@
1
- /* form-header.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* form-header.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  /* eslint-disable @atlaskit/design-system/use-primitives */
3
3
  "use strict";
4
4
 
@@ -1,4 +1,4 @@
1
- /* form-section.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* form-section.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
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
- }) : children();
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/cjs/label.js CHANGED
@@ -1,4 +1,4 @@
1
- /* label.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* label.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -1,4 +1,4 @@
1
- /* messages.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* messages.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* required-asterisk.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* required-asterisk.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -1,4 +1,4 @@
1
- /* field.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* field.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./field.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* fieldset.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* fieldset.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./fieldset.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* form-footer.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* form-footer.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./form-footer.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* form-header.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* form-header.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  /* eslint-disable @atlaskit/design-system/use-primitives */
3
3
  import "./form-header.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* form-section.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* form-section.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./form-section.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -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 {
@@ -1,4 +1,4 @@
1
- /* label.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* label.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./label.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* messages.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* messages.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./messages.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* required-asterisk.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* required-asterisk.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./required-asterisk.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
package/dist/esm/field.js CHANGED
@@ -1,4 +1,4 @@
1
- /* field.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* field.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _typeof from "@babel/runtime/helpers/typeof";
@@ -1,4 +1,4 @@
1
- /* fieldset.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* fieldset.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./fieldset.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* form-footer.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* form-footer.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./form-footer.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* form-header.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* form-header.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  /* eslint-disable @atlaskit/design-system/use-primitives */
3
3
  import "./form-header.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* form-section.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* form-section.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./form-section.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
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
- }) : children();
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/esm/label.js CHANGED
@@ -1,4 +1,4 @@
1
- /* label.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* label.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./label.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* messages.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* messages.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import "./messages.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* required-asterisk.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* required-asterisk.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./required-asterisk.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/form",
3
- "version": "12.6.0",
3
+ "version": "12.6.1",
4
4
  "description": "A form allows users to input information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/checkbox": "^17.1.0",
51
51
  "@atlaskit/codemod-utils": "^4.2.0",
52
52
  "@atlaskit/datetime-picker": "^17.0.0",
53
- "@atlaskit/docs": "^11.0.0",
53
+ "@atlaskit/docs": "^11.1.0",
54
54
  "@atlaskit/link": "^3.2.0",
55
55
  "@atlaskit/lozenge": "^13.0.0",
56
56
  "@atlaskit/modal-dialog": "^14.3.0",
@@ -122,6 +122,9 @@
122
122
  },
123
123
  "platform-form-field-error-focus": {
124
124
  "type": "boolean"
125
+ },
126
+ "platform-form-reset-field-state": {
127
+ "type": "boolean"
125
128
  }
126
129
  }
127
130
  }