@fluentui/react-field 0.0.0-nightly-20230223-2115.1 → 0.0.0-nightly-20230227-0424.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.
Files changed (35) hide show
  1. package/CHANGELOG.json +13 -13
  2. package/CHANGELOG.md +9 -9
  3. package/lib/Field.js.map +1 -1
  4. package/lib/components/Field/Field.js.map +1 -1
  5. package/lib/components/Field/Field.types.js +1 -1
  6. package/lib/components/Field/Field.types.js.map +1 -1
  7. package/lib/components/Field/index.js.map +1 -1
  8. package/lib/components/Field/renderField.js +11 -2
  9. package/lib/components/Field/renderField.js.map +1 -1
  10. package/lib/components/Field/useField.js +9 -8
  11. package/lib/components/Field/useField.js.map +1 -1
  12. package/lib/components/Field/useFieldStyles.js.map +1 -1
  13. package/lib/index.js.map +1 -1
  14. package/lib/util/makeDeprecatedField.js +7 -5
  15. package/lib/util/makeDeprecatedField.js.map +1 -1
  16. package/lib-commonjs/Field.js +4 -5
  17. package/lib-commonjs/Field.js.map +1 -1
  18. package/lib-commonjs/components/Field/Field.js +12 -16
  19. package/lib-commonjs/components/Field/Field.js.map +1 -1
  20. package/lib-commonjs/components/Field/Field.types.js +2 -5
  21. package/lib-commonjs/components/Field/Field.types.js.map +1 -1
  22. package/lib-commonjs/components/Field/index.js +8 -9
  23. package/lib-commonjs/components/Field/index.js.map +1 -1
  24. package/lib-commonjs/components/Field/renderField.js +26 -15
  25. package/lib-commonjs/components/Field/renderField.js.map +1 -1
  26. package/lib-commonjs/components/Field/useField.js +102 -94
  27. package/lib-commonjs/components/Field/useField.js.map +1 -1
  28. package/lib-commonjs/components/Field/useFieldStyles.js +96 -137
  29. package/lib-commonjs/components/Field/useFieldStyles.js.map +1 -1
  30. package/lib-commonjs/index.js +49 -21
  31. package/lib-commonjs/index.js.map +1 -1
  32. package/lib-commonjs/util/makeDeprecatedField.js +72 -56
  33. package/lib-commonjs/util/makeDeprecatedField.js.map +1 -1
  34. package/package.json +8 -8
  35. package/.swcrc +0 -33
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { Field, fieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from './Field';\n// eslint-disable-next-line deprecation/deprecation\nexport { getDeprecatedFieldClassNames, makeDeprecatedField } from './util/makeDeprecatedField';\n//# sourceMappingURL=index.js.map"],"names":["Field","fieldClassNames","renderField_unstable","useFieldStyles_unstable","useField_unstable","getDeprecatedFieldClassNames","makeDeprecatedField"],"mappings":";;;;;;;;;;;IAASA,KAAK,MAALA,YAAK;IAAEC,eAAe,MAAfA,sBAAe;IAAEC,oBAAoB,MAApBA,2BAAoB;IAAEC,uBAAuB,MAAvBA,8BAAuB;IAAEC,iBAAiB,MAAjBA,wBAAiB;IAExFC,4BAA4B,MAA5BA,iDAA4B;IAAEC,mBAAmB,MAAnBA,wCAAmB;;uBAF+C;qCAEvC;CAClE,iCAAiC"}
1
+ {"version":3,"mappings":";;;;;;AAAA;AAASA;EAAAC;EAAAC;IAAA,oBAAK;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,8BAAe;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,mCAAoB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,sCAAuB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,gCAAiB;EAAA;AAAA;AAGjG;AACA;AAASF;EAAAC;EAAAC;IAAA,yDAA4B;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,gDAAmB;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"","sources":["../../../../../../../packages/react-components/react-field/src/index.ts"],"sourcesContent":["export { Field, fieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from './Field';\nexport type { FieldProps, FieldSlots, FieldState } from './Field';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { getDeprecatedFieldClassNames, makeDeprecatedField } from './util/makeDeprecatedField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { DeprecatedFieldProps } from './util/makeDeprecatedField';\n"]}
@@ -1,63 +1,79 @@
1
- /* eslint-disable deprecation/deprecation */ "use strict";
1
+ "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- makeDeprecatedField: ()=>makeDeprecatedField,
13
- getDeprecatedFieldClassNames: ()=>getDeprecatedFieldClassNames
4
+ value: true
14
5
  });
15
- const _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
16
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
17
- const _extends = require("@swc/helpers/lib/_extends.js").default;
18
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
19
- const _field = require("../Field");
6
+ exports.getDeprecatedFieldClassNames = exports.makeDeprecatedField = void 0;
7
+ /* eslint-disable deprecation/deprecation */
8
+ const React = /*#__PURE__*/require("react");
9
+ const Field_1 = /*#__PURE__*/require("../Field");
20
10
  /**
21
11
  * Partition the props used by the Field itself, from the props that are passed to the underlying field component.
22
- */ function getPartitionedFieldProps(props) {
23
- const { className , control , hint , label , orientation , required , root , size , style , validationMessage , validationMessageIcon , validationState ='none' , ...restOfProps } = props;
24
- return [
25
- {
26
- className,
27
- hint,
28
- label,
29
- orientation,
30
- required,
31
- size,
32
- style,
33
- validationMessage,
34
- validationMessageIcon,
35
- validationState,
36
- ...root
37
- },
38
- {
39
- required,
40
- size,
41
- ...restOfProps,
42
- ...control
43
- }
44
- ];
12
+ */
13
+ function getPartitionedFieldProps(props) {
14
+ const {
15
+ className,
16
+ control,
17
+ hint,
18
+ label,
19
+ orientation,
20
+ required,
21
+ root,
22
+ size,
23
+ style,
24
+ validationMessage,
25
+ validationMessageIcon,
26
+ validationState = 'none',
27
+ ...restOfProps
28
+ } = props;
29
+ return [{
30
+ className,
31
+ hint,
32
+ label,
33
+ orientation,
34
+ required,
35
+ size,
36
+ style,
37
+ validationMessage,
38
+ validationMessageIcon,
39
+ validationState,
40
+ ...root
41
+ }, {
42
+ required,
43
+ size,
44
+ ...restOfProps,
45
+ ...control
46
+ }];
45
47
  }
46
- function makeDeprecatedField(Control) {
47
- let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
48
- const { mapProps =(props)=>props , displayName =`${Control.displayName}Field` } = options;
49
- const DeprecatedField = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
50
- const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));
51
- return /*#__PURE__*/ _react.createElement(_field.Field, _extends({}, fieldProps), /*#__PURE__*/ _react.createElement(Control, _extends({}, controlProps, {
52
- ref: ref
53
- })));
54
- });
55
- DeprecatedField.displayName = displayName;
56
- return DeprecatedField;
48
+ /**
49
+ * @deprecated Only for use to make deprecated [Control]Field shim components.
50
+ * @internal
51
+ */
52
+ function makeDeprecatedField(Control, options = {}) {
53
+ const {
54
+ mapProps = props => props,
55
+ displayName = `${Control.displayName}Field`
56
+ } = options;
57
+ const DeprecatedField = React.forwardRef((props, ref) => {
58
+ const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));
59
+ return React.createElement(Field_1.Field, {
60
+ ...fieldProps
61
+ }, React.createElement(Control, {
62
+ ...controlProps,
63
+ ref: ref
64
+ }));
65
+ });
66
+ DeprecatedField.displayName = displayName;
67
+ return DeprecatedField;
57
68
  }
58
- const getDeprecatedFieldClassNames = (controlRootClassName)=>({
59
- ..._field.fieldClassNames,
60
- control: controlRootClassName
61
- }); //# sourceMappingURL=makeDeprecatedField.js.map
62
-
69
+ exports.makeDeprecatedField = makeDeprecatedField;
70
+ /**
71
+ * @deprecated Only for use to make deprecated [Control]Field shim components.
72
+ * @internal
73
+ */
74
+ const getDeprecatedFieldClassNames = controlRootClassName => ({
75
+ ...Field_1.fieldClassNames,
76
+ control: controlRootClassName
77
+ });
78
+ exports.getDeprecatedFieldClassNames = getDeprecatedFieldClassNames;
63
79
  //# sourceMappingURL=makeDeprecatedField.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/util/makeDeprecatedField.js"],"sourcesContent":["/* eslint-disable deprecation/deprecation */import _extends from \"@swc/helpers/src/_extends.mjs\";\nimport * as React from 'react';\nimport { Field, fieldClassNames } from '../Field';\n/**\n * Partition the props used by the Field itself, from the props that are passed to the underlying field component.\n */\nfunction getPartitionedFieldProps(props) {\n const {\n className,\n control,\n hint,\n label,\n orientation,\n required,\n root,\n size,\n style,\n validationMessage,\n validationMessageIcon,\n validationState = 'none',\n ...restOfProps\n } = props;\n return [{\n className,\n hint,\n label,\n orientation,\n required,\n size,\n style,\n validationMessage,\n validationMessageIcon,\n validationState,\n ...root\n }, {\n required,\n size,\n ...restOfProps,\n ...control\n }];\n}\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport function makeDeprecatedField(Control) {\n let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n const {\n mapProps = props => props,\n displayName = `${Control.displayName}Field`\n } = options;\n const DeprecatedField = /*#__PURE__*/React.forwardRef((props, ref) => {\n const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));\n return /*#__PURE__*/React.createElement(Field, _extends({}, fieldProps), /*#__PURE__*/React.createElement(Control, _extends({}, controlProps, {\n ref: ref\n })));\n });\n DeprecatedField.displayName = displayName;\n return DeprecatedField;\n}\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport const getDeprecatedFieldClassNames = controlRootClassName => ({\n ...fieldClassNames,\n control: controlRootClassName\n});\n//# sourceMappingURL=makeDeprecatedField.js.map"],"names":["makeDeprecatedField","getDeprecatedFieldClassNames","getPartitionedFieldProps","props","className","control","hint","label","orientation","required","root","size","style","validationMessage","validationMessageIcon","validationState","restOfProps","Control","options","arguments","length","mapProps","displayName","DeprecatedField","React","forwardRef","ref","fieldProps","controlProps","createElement","Field","_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IO,MAAMC,4BAA4B,GAAIC,oBAA4B,KAAM;EAC7E,GAAGH,uBAAe;EAClBvB,OAAO,EAAE0B;CACV,CAAC;AAHWF,oCAA4B","names":["getPartitionedFieldProps","props","className","control","hint","label","orientation","required","root","size","style","validationMessage","validationMessageIcon","validationState","restOfProps","makeDeprecatedField","Control","options","mapProps","displayName","DeprecatedField","React","forwardRef","ref","fieldProps","controlProps","Field_1","exports","getDeprecatedFieldClassNames","controlRootClassName"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-field/src/util/makeDeprecatedField.tsx"],"sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport * as React from 'react';\nimport { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { FieldProps } from '../Field';\nimport { Field, fieldClassNames } from '../Field';\n\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport type DeprecatedFieldProps<ControlProps> = ControlProps & {\n root?: FieldProps;\n control?: ControlProps;\n} & Pick<\n FieldProps,\n | 'className'\n | 'hint'\n | 'label'\n | 'orientation'\n | 'style'\n | 'validationMessage'\n | 'validationMessageIcon'\n | 'validationState'\n >;\n\n/**\n * Partition the props used by the Field itself, from the props that are passed to the underlying field component.\n */\nfunction getPartitionedFieldProps<ControlProps>(\n props: DeprecatedFieldProps<ControlProps> & Pick<FieldProps, 'required' | 'size'>,\n) {\n const {\n className,\n control,\n hint,\n label,\n orientation,\n required,\n root,\n size,\n style,\n validationMessage,\n validationMessageIcon,\n validationState = 'none',\n ...restOfProps\n } = props;\n\n return [\n {\n className,\n hint,\n label,\n orientation,\n required,\n size,\n style,\n validationMessage,\n validationMessageIcon,\n validationState,\n ...root,\n },\n {\n required,\n size,\n ...restOfProps,\n ...control,\n },\n ];\n}\n\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport function makeDeprecatedField<ControlProps>(\n Control: React.ComponentType<ControlProps>,\n options: {\n mapProps?: (props: DeprecatedFieldProps<ControlProps>) => DeprecatedFieldProps<ControlProps>;\n displayName?: string;\n } = {},\n) {\n const { mapProps = props => props, displayName = `${Control.displayName}Field` } = options;\n\n const DeprecatedField = React.forwardRef((props, ref) => {\n const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));\n return (\n <Field {...fieldProps}>\n {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}\n <Control {...(controlProps as any)} ref={ref as any} />\n </Field>\n );\n }) as ForwardRefComponent<DeprecatedFieldProps<ControlProps>>;\n\n DeprecatedField.displayName = displayName;\n\n return DeprecatedField;\n}\n\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport const getDeprecatedFieldClassNames = (controlRootClassName: string) => ({\n ...fieldClassNames,\n control: controlRootClassName,\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-field",
3
- "version": "0.0.0-nightly-20230223-2115.1",
3
+ "version": "0.0.0-nightly-20230227-0424.1",
4
4
  "description": "Fluent UI Field components",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -22,23 +22,23 @@
22
22
  "storybook": "start-storybook",
23
23
  "test": "jest --passWithNoTests",
24
24
  "type-check": "tsc -b tsconfig.json",
25
- "generate-api": "just-scripts generate-api"
25
+ "generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@fluentui/eslint-plugin": "*",
29
29
  "@fluentui/react-conformance": "*",
30
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230223-2115.1",
30
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230227-0424.1",
31
31
  "@fluentui/scripts-api-extractor": "*",
32
32
  "@fluentui/scripts-tasks": "*"
33
33
  },
34
34
  "dependencies": {
35
- "@fluentui/react-context-selector": "0.0.0-nightly-20230223-2115.1",
35
+ "@fluentui/react-context-selector": "0.0.0-nightly-20230227-0424.1",
36
36
  "@fluentui/react-icons": "^2.0.175",
37
- "@fluentui/react-label": "0.0.0-nightly-20230223-2115.1",
38
- "@fluentui/react-theme": "0.0.0-nightly-20230223-2115.1",
39
- "@fluentui/react-utilities": "0.0.0-nightly-20230223-2115.1",
37
+ "@fluentui/react-label": "0.0.0-nightly-20230227-0424.1",
38
+ "@fluentui/react-theme": "0.0.0-nightly-20230227-0424.1",
39
+ "@fluentui/react-utilities": "0.0.0-nightly-20230227-0424.1",
40
40
  "@griffel/react": "^1.5.2",
41
- "@swc/helpers": "^0.4.14"
41
+ "tslib": "^2.1.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@types/react": ">=16.8.0 <19.0.0",
package/.swcrc DELETED
@@ -1,33 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/swcrc",
3
- "env": {
4
- "targets": {
5
- "chrome": "84",
6
- "edge": "84",
7
- "firefox": "75",
8
- "opera": "73",
9
- "safari": "14.1"
10
- }
11
- },
12
- "exclude": [
13
- "/testing",
14
- "/**/*.cy.ts",
15
- "/**/*.cy.tsx",
16
- "/**/*.spec.ts",
17
- "/**/*.spec.tsx",
18
- "/**/*.test.ts",
19
- "/**/*.test.tsx"
20
- ],
21
- "jsc": {
22
- "parser": {
23
- "syntax": "typescript",
24
- "tsx": true,
25
- "decorators": false,
26
- "dynamicImport": false
27
- },
28
- "target": "es2019",
29
- "externalHelpers": true
30
- },
31
- "minify": false,
32
- "sourceMaps": true
33
- }