@fluentui/react-field 0.0.0-nightly-20230412-0419.1 → 0.0.0-nightly-20230413-0419.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.json +46 -13
- package/CHANGELOG.md +21 -9
- package/dist/index.d.ts +1 -32
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/lib-commonjs/index.js +1 -4
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +6 -6
- package/lib/util/makeDeprecatedField.js +0 -68
- package/lib/util/makeDeprecatedField.js.map +0 -1
- package/lib-commonjs/util/makeDeprecatedField.js +0 -61
- package/lib-commonjs/util/makeDeprecatedField.js.map +0 -1
package/CHANGELOG.json
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
"name": "@fluentui/react-field",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
6
|
-
"tag": "@fluentui/react-field_v0.0.0-nightly-
|
7
|
-
"version": "0.0.0-nightly-
|
5
|
+
"date": "Thu, 13 Apr 2023 04:25:46 GMT",
|
6
|
+
"tag": "@fluentui/react-field_v0.0.0-nightly-20230413-0419.1",
|
7
|
+
"version": "0.0.0-nightly-20230413-0419.1",
|
8
8
|
"comments": {
|
9
9
|
"prerelease": [
|
10
10
|
{
|
@@ -16,32 +16,65 @@
|
|
16
16
|
{
|
17
17
|
"author": "beachball",
|
18
18
|
"package": "@fluentui/react-field",
|
19
|
-
"comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-
|
20
|
-
"commit": "
|
19
|
+
"comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-20230413-0419.1",
|
20
|
+
"commit": "6f4864436cb7d7680f18c40e02671f0960d84ff5"
|
21
21
|
},
|
22
22
|
{
|
23
23
|
"author": "beachball",
|
24
24
|
"package": "@fluentui/react-field",
|
25
|
-
"comment": "Bump @fluentui/react-label to v0.0.0-nightly-
|
26
|
-
"commit": "
|
25
|
+
"comment": "Bump @fluentui/react-label to v0.0.0-nightly-20230413-0419.1",
|
26
|
+
"commit": "6f4864436cb7d7680f18c40e02671f0960d84ff5"
|
27
27
|
},
|
28
28
|
{
|
29
29
|
"author": "beachball",
|
30
30
|
"package": "@fluentui/react-field",
|
31
|
-
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-
|
32
|
-
"commit": "
|
31
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230413-0419.1",
|
32
|
+
"commit": "6f4864436cb7d7680f18c40e02671f0960d84ff5"
|
33
33
|
},
|
34
34
|
{
|
35
35
|
"author": "beachball",
|
36
36
|
"package": "@fluentui/react-field",
|
37
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-
|
38
|
-
"commit": "
|
37
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230413-0419.1",
|
38
|
+
"commit": "6f4864436cb7d7680f18c40e02671f0960d84ff5"
|
39
39
|
},
|
40
40
|
{
|
41
41
|
"author": "beachball",
|
42
42
|
"package": "@fluentui/react-field",
|
43
|
-
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
44
|
-
"commit": "
|
43
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230413-0419.1",
|
44
|
+
"commit": "6f4864436cb7d7680f18c40e02671f0960d84ff5"
|
45
|
+
}
|
46
|
+
]
|
47
|
+
}
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"date": "Wed, 12 Apr 2023 09:31:44 GMT",
|
51
|
+
"tag": "@fluentui/react-field_v9.0.0-beta.2",
|
52
|
+
"version": "9.0.0-beta.2",
|
53
|
+
"comments": {
|
54
|
+
"prerelease": [
|
55
|
+
{
|
56
|
+
"author": "behowell@microsoft.com",
|
57
|
+
"package": "@fluentui/react-field",
|
58
|
+
"commit": "3bad9d0fca9713c3e375831b26fc2e9d96f3fd35",
|
59
|
+
"comment": "fix: Make contextValues argument required on renderField_unstable"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"author": "beachball",
|
63
|
+
"package": "@fluentui/react-field",
|
64
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.17",
|
65
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"author": "beachball",
|
69
|
+
"package": "@fluentui/react-field",
|
70
|
+
"comment": "Bump @fluentui/react-label to v9.1.8",
|
71
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"author": "beachball",
|
75
|
+
"package": "@fluentui/react-field",
|
76
|
+
"comment": "Bump @fluentui/react-utilities to v9.7.4",
|
77
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
45
78
|
}
|
46
79
|
]
|
47
80
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,22 +1,34 @@
|
|
1
1
|
# Change Log - @fluentui/react-field
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Thu, 13 Apr 2023 04:25:46 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-nightly-
|
7
|
+
## [0.0.0-nightly-20230413-0419.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v0.0.0-nightly-20230413-0419.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.0.0-beta.
|
9
|
+
Thu, 13 Apr 2023 04:25:46 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.0.0-beta.2..@fluentui/react-field_v0.0.0-nightly-20230413-0419.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
15
|
-
- Bump @fluentui/react-context-selector to v0.0.0-nightly-
|
16
|
-
- Bump @fluentui/react-label to v0.0.0-nightly-
|
17
|
-
- Bump @fluentui/react-theme to v0.0.0-nightly-
|
18
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
19
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
15
|
+
- Bump @fluentui/react-context-selector to v0.0.0-nightly-20230413-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/6f4864436cb7d7680f18c40e02671f0960d84ff5) by beachball)
|
16
|
+
- Bump @fluentui/react-label to v0.0.0-nightly-20230413-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/6f4864436cb7d7680f18c40e02671f0960d84ff5) by beachball)
|
17
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20230413-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/6f4864436cb7d7680f18c40e02671f0960d84ff5) by beachball)
|
18
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20230413-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/6f4864436cb7d7680f18c40e02671f0960d84ff5) by beachball)
|
19
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230413-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/6f4864436cb7d7680f18c40e02671f0960d84ff5) by beachball)
|
20
|
+
|
21
|
+
## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.0.0-beta.2)
|
22
|
+
|
23
|
+
Wed, 12 Apr 2023 09:31:44 GMT
|
24
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.0.0-beta.1..@fluentui/react-field_v9.0.0-beta.2)
|
25
|
+
|
26
|
+
### Changes
|
27
|
+
|
28
|
+
- fix: Make contextValues argument required on renderField_unstable ([PR #27436](https://github.com/microsoft/fluentui/pull/27436) by behowell@microsoft.com)
|
29
|
+
- Bump @fluentui/react-context-selector to v9.1.17 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
30
|
+
- Bump @fluentui/react-label to v9.1.8 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
31
|
+
- Bump @fluentui/react-utilities to v9.7.4 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
20
32
|
|
21
33
|
## [9.0.0-beta.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.0.0-beta.1)
|
22
34
|
|
package/dist/index.d.ts
CHANGED
@@ -2,21 +2,12 @@
|
|
2
2
|
|
3
3
|
import type { ComponentProps } from '@fluentui/react-utilities';
|
4
4
|
import type { ComponentState } from '@fluentui/react-utilities';
|
5
|
-
import { ForwardRefComponent } from '@fluentui/react-utilities';
|
5
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
6
6
|
import { Label } from '@fluentui/react-label';
|
7
7
|
import * as React_2 from 'react';
|
8
8
|
import type { Slot } from '@fluentui/react-utilities';
|
9
9
|
import type { SlotClassNames } from '@fluentui/react-utilities';
|
10
10
|
|
11
|
-
/**
|
12
|
-
* @deprecated Only for use to make deprecated [Control]Field shim components.
|
13
|
-
* @internal
|
14
|
-
*/
|
15
|
-
export declare type DeprecatedFieldProps<ControlProps> = ControlProps & {
|
16
|
-
root?: FieldProps;
|
17
|
-
control?: ControlProps;
|
18
|
-
} & Pick<FieldProps, 'className' | 'hint' | 'label' | 'orientation' | 'style' | 'validationMessage' | 'validationMessageIcon' | 'validationState'>;
|
19
|
-
|
20
11
|
export declare const Field: ForwardRefComponent<FieldProps>;
|
21
12
|
|
22
13
|
export declare const fieldClassNames: SlotClassNames<FieldSlots>;
|
@@ -164,28 +155,6 @@ export declare type FieldState = ComponentState<Required<FieldSlots>> & Required
|
|
164
155
|
generatedControlId: string;
|
165
156
|
};
|
166
157
|
|
167
|
-
/**
|
168
|
-
* @deprecated Only for use to make deprecated [Control]Field shim components.
|
169
|
-
* @internal
|
170
|
-
*/
|
171
|
-
export declare const getDeprecatedFieldClassNames: (controlRootClassName: string) => {
|
172
|
-
control: string;
|
173
|
-
root: string;
|
174
|
-
label: string;
|
175
|
-
validationMessage: string;
|
176
|
-
validationMessageIcon: string;
|
177
|
-
hint: string;
|
178
|
-
};
|
179
|
-
|
180
|
-
/**
|
181
|
-
* @deprecated Only for use to make deprecated [Control]Field shim components.
|
182
|
-
* @internal
|
183
|
-
*/
|
184
|
-
export declare function makeDeprecatedField<ControlProps>(Control: React_2.ComponentType<ControlProps>, options?: {
|
185
|
-
mapProps?: (props: DeprecatedFieldProps<ControlProps>) => DeprecatedFieldProps<ControlProps>;
|
186
|
-
displayName?: string;
|
187
|
-
}): ForwardRefComponent<DeprecatedFieldProps<ControlProps>>;
|
188
|
-
|
189
158
|
/**
|
190
159
|
* Render the final JSX of Field
|
191
160
|
*/
|
package/lib/index.js
CHANGED
@@ -1,5 +1,3 @@
|
|
1
1
|
export { Field, fieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from './Field';
|
2
2
|
export { FieldContextProvider, useFieldContext_unstable, useFieldContextValues_unstable, useFieldControlProps_unstable } from './contexts/index';
|
3
|
-
// eslint-disable-next-line deprecation/deprecation
|
4
|
-
export { getDeprecatedFieldClassNames, makeDeprecatedField } from './util/makeDeprecatedField';
|
5
3
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Field","fieldClassNames","renderField_unstable","useFieldStyles_unstable","useField_unstable","FieldContextProvider","useFieldContext_unstable","useFieldContextValues_unstable","useFieldControlProps_unstable"
|
1
|
+
{"version":3,"names":["Field","fieldClassNames","renderField_unstable","useFieldStyles_unstable","useField_unstable","FieldContextProvider","useFieldContext_unstable","useFieldContextValues_unstable","useFieldControlProps_unstable"],"sources":["../src/index.ts"],"sourcesContent":["export { Field, fieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from './Field';\nexport type {\n FieldContextValue,\n FieldContextValues,\n FieldControlProps,\n FieldProps,\n FieldSlots,\n FieldState,\n} from './Field';\nexport {\n FieldContextProvider,\n useFieldContext_unstable,\n useFieldContextValues_unstable,\n useFieldControlProps_unstable,\n} from './contexts/index';\nexport type { FieldControlPropsOptions } from './contexts/index';\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ;AASzG,SACEC,oBAAoB,EACpBC,wBAAwB,EACxBC,8BAA8B,EAC9BC,6BAA6B,QACxB"}
|
package/lib-commonjs/index.js
CHANGED
@@ -17,13 +17,10 @@ _export(exports, {
|
|
17
17
|
FieldContextProvider: ()=>_index.FieldContextProvider,
|
18
18
|
useFieldContext_unstable: ()=>_index.useFieldContext_unstable,
|
19
19
|
useFieldContextValues_unstable: ()=>_index.useFieldContextValues_unstable,
|
20
|
-
useFieldControlProps_unstable: ()=>_index.useFieldControlProps_unstable
|
21
|
-
getDeprecatedFieldClassNames: ()=>_makeDeprecatedField.getDeprecatedFieldClassNames,
|
22
|
-
makeDeprecatedField: ()=>_makeDeprecatedField.makeDeprecatedField
|
20
|
+
useFieldControlProps_unstable: ()=>_index.useFieldControlProps_unstable
|
23
21
|
});
|
24
22
|
const _field = require("./Field");
|
25
23
|
const _index = require("./contexts/index");
|
26
|
-
const _makeDeprecatedField = require("./util/makeDeprecatedField");
|
27
24
|
//# sourceMappingURL=index.js.map
|
28
25
|
|
29
26
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { Field, fieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from './Field';\nexport { FieldContextProvider, useFieldContext_unstable, useFieldContextValues_unstable, useFieldControlProps_unstable } from './contexts/index';\n
|
1
|
+
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { Field, fieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from './Field';\nexport { FieldContextProvider, useFieldContext_unstable, useFieldContextValues_unstable, useFieldControlProps_unstable } from './contexts/index';\n//# sourceMappingURL=index.js.map"],"names":["Field","fieldClassNames","renderField_unstable","useFieldStyles_unstable","useField_unstable","FieldContextProvider","useFieldContext_unstable","useFieldContextValues_unstable","useFieldControlProps_unstable"],"mappings":";;;;;;;;;;;IAASA,KAAK,MAALA,YAAK;IAAEC,eAAe,MAAfA,sBAAe;IAAEC,oBAAoB,MAApBA,2BAAoB;IAAEC,uBAAuB,MAAvBA,8BAAuB;IAAEC,iBAAiB,MAAjBA,wBAAiB;IACxFC,oBAAoB,MAApBA,2BAAoB;IAAEC,wBAAwB,MAAxBA,+BAAwB;IAAEC,8BAA8B,MAA9BA,qCAA8B;IAAEC,6BAA6B,MAA7BA,oCAA6B;;uBADb;uBACqB;CAC9H,iCAAiC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-field",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20230413-0419.1",
|
4
4
|
"description": "Fluent UI Field components",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -27,16 +27,16 @@
|
|
27
27
|
"devDependencies": {
|
28
28
|
"@fluentui/eslint-plugin": "*",
|
29
29
|
"@fluentui/react-conformance": "*",
|
30
|
-
"@fluentui/react-conformance-griffel": "0.0.0-nightly-
|
30
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20230413-0419.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-
|
35
|
+
"@fluentui/react-context-selector": "0.0.0-nightly-20230413-0419.1",
|
36
36
|
"@fluentui/react-icons": "^2.0.196",
|
37
|
-
"@fluentui/react-label": "0.0.0-nightly-
|
38
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
39
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
37
|
+
"@fluentui/react-label": "0.0.0-nightly-20230413-0419.1",
|
38
|
+
"@fluentui/react-theme": "0.0.0-nightly-20230413-0419.1",
|
39
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20230413-0419.1",
|
40
40
|
"@griffel/react": "^1.5.2",
|
41
41
|
"@swc/helpers": "^0.4.14"
|
42
42
|
},
|
@@ -1,68 +0,0 @@
|
|
1
|
-
/* eslint-disable deprecation/deprecation */import * as React from 'react';
|
2
|
-
import { Field, fieldClassNames } from '../Field';
|
3
|
-
/**
|
4
|
-
* Partition the props used by the Field itself, from the props that are passed to the underlying field component.
|
5
|
-
*/
|
6
|
-
function getPartitionedFieldProps(props) {
|
7
|
-
const {
|
8
|
-
className,
|
9
|
-
control,
|
10
|
-
hint,
|
11
|
-
label,
|
12
|
-
orientation,
|
13
|
-
required,
|
14
|
-
root,
|
15
|
-
size,
|
16
|
-
style,
|
17
|
-
validationMessage,
|
18
|
-
validationMessageIcon,
|
19
|
-
validationState = 'none',
|
20
|
-
...restOfProps
|
21
|
-
} = props;
|
22
|
-
return [{
|
23
|
-
className,
|
24
|
-
hint,
|
25
|
-
label,
|
26
|
-
orientation,
|
27
|
-
required,
|
28
|
-
size,
|
29
|
-
style,
|
30
|
-
validationMessage,
|
31
|
-
validationMessageIcon,
|
32
|
-
validationState,
|
33
|
-
...root
|
34
|
-
}, {
|
35
|
-
required,
|
36
|
-
size,
|
37
|
-
...restOfProps,
|
38
|
-
...control
|
39
|
-
}];
|
40
|
-
}
|
41
|
-
/**
|
42
|
-
* @deprecated Only for use to make deprecated [Control]Field shim components.
|
43
|
-
* @internal
|
44
|
-
*/
|
45
|
-
export function makeDeprecatedField(Control, options = {}) {
|
46
|
-
const {
|
47
|
-
mapProps = props => props,
|
48
|
-
displayName = `${Control.displayName}Field`
|
49
|
-
} = options;
|
50
|
-
const DeprecatedField = /*#__PURE__*/React.forwardRef((props, ref) => {
|
51
|
-
const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));
|
52
|
-
return /*#__PURE__*/React.createElement(Field, fieldProps, /*#__PURE__*/React.createElement(Control, {
|
53
|
-
...controlProps,
|
54
|
-
ref: ref
|
55
|
-
}));
|
56
|
-
});
|
57
|
-
DeprecatedField.displayName = displayName;
|
58
|
-
return DeprecatedField;
|
59
|
-
}
|
60
|
-
/**
|
61
|
-
* @deprecated Only for use to make deprecated [Control]Field shim components.
|
62
|
-
* @internal
|
63
|
-
*/
|
64
|
-
export const getDeprecatedFieldClassNames = controlRootClassName => ({
|
65
|
-
...fieldClassNames,
|
66
|
-
control: controlRootClassName
|
67
|
-
});
|
68
|
-
//# sourceMappingURL=makeDeprecatedField.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["React","Field","fieldClassNames","getPartitionedFieldProps","props","className","control","hint","label","orientation","required","root","size","style","validationMessage","validationMessageIcon","validationState","restOfProps","makeDeprecatedField","Control","options","mapProps","displayName","DeprecatedField","forwardRef","ref","fieldProps","controlProps","createElement","getDeprecatedFieldClassNames","controlRootClassName"],"sources":["../../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"],"mappings":"AAAA,4CACA,YAAYA,KAAA,MAAW;AAGvB,SAASC,KAAK,EAAEC,eAAe,QAAQ;AAqBvC;;;AAGA,SAASC,yBACPC,KAAiF,EACjF;EACA,MAAM;IACJC,SAAA;IACAC,OAAA;IACAC,IAAA;IACAC,KAAA;IACAC,WAAA;IACAC,QAAA;IACAC,IAAA;IACAC,IAAA;IACAC,KAAA;IACAC,iBAAA;IACAC,qBAAA;IACAC,eAAA,GAAkB;IAClB,GAAGC;EAAA,CACJ,GAAGb,KAAA;EAEJ,OAAO,CACL;IACEC,SAAA;IACAE,IAAA;IACAC,KAAA;IACAC,WAAA;IACAC,QAAA;IACAE,IAAA;IACAC,KAAA;IACAC,iBAAA;IACAC,qBAAA;IACAC,eAAA;IACA,GAAGL;EACL,GACA;IACED,QAAA;IACAE,IAAA;IACA,GAAGK,WAAW;IACd,GAAGX;EACL,EACD;AACH;AAEA;;;;AAIA,OAAO,SAASY,oBACdC,OAA0C,EAC1CC,OAAA,GAGI,CAAC,CAAC,EACN;EACA,MAAM;IAAEC,QAAA,GAAWjB,KAAA,IAASA,KAAA;IAAOkB,WAAA,GAAe,GAAEH,OAAA,CAAQG,WAAY;EAAM,CAAE,GAAGF,OAAA;EAEnF,MAAMG,eAAA,gBAAkBvB,KAAA,CAAMwB,UAAU,CAAC,CAACpB,KAAA,EAAOqB,GAAA,KAAQ;IACvD,MAAM,CAACC,UAAA,EAAYC,YAAA,CAAa,GAAGxB,wBAAA,CAAyBkB,QAAA,CAASjB,KAAA;IACrE,oBACEJ,KAAA,CAAA4B,aAAA,CAAC3B,KAAA,EAAUyB,UAAA,eAET1B,KAAA,CAAA4B,aAAA,CAACT,OAAA;MAAS,GAAIQ,YAAY;MAAUF,GAAA,EAAKA;;EAG/C;EAEAF,eAAA,CAAgBD,WAAW,GAAGA,WAAA;EAE9B,OAAOC,eAAA;AACT;AAEA;;;;AAIA,OAAO,MAAMM,4BAAA,GAAgCC,oBAAA,KAAkC;EAC7E,GAAG5B,eAAe;EAClBI,OAAA,EAASwB;AACX"}
|
@@ -1,61 +0,0 @@
|
|
1
|
-
/* eslint-disable deprecation/deprecation */ "use strict";
|
2
|
-
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
|
14
|
-
});
|
15
|
-
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
16
|
-
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
17
|
-
const _field = require("../Field");
|
18
|
-
/**
|
19
|
-
* Partition the props used by the Field itself, from the props that are passed to the underlying field component.
|
20
|
-
*/ function getPartitionedFieldProps(props) {
|
21
|
-
const { className , control , hint , label , orientation , required , root , size , style , validationMessage , validationMessageIcon , validationState ='none' , ...restOfProps } = props;
|
22
|
-
return [
|
23
|
-
{
|
24
|
-
className,
|
25
|
-
hint,
|
26
|
-
label,
|
27
|
-
orientation,
|
28
|
-
required,
|
29
|
-
size,
|
30
|
-
style,
|
31
|
-
validationMessage,
|
32
|
-
validationMessageIcon,
|
33
|
-
validationState,
|
34
|
-
...root
|
35
|
-
},
|
36
|
-
{
|
37
|
-
required,
|
38
|
-
size,
|
39
|
-
...restOfProps,
|
40
|
-
...control
|
41
|
-
}
|
42
|
-
];
|
43
|
-
}
|
44
|
-
function makeDeprecatedField(Control, options = {}) {
|
45
|
-
const { mapProps =(props)=>props , displayName =`${Control.displayName}Field` } = options;
|
46
|
-
const DeprecatedField = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
47
|
-
const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));
|
48
|
-
return /*#__PURE__*/ _react.createElement(_field.Field, fieldProps, /*#__PURE__*/ _react.createElement(Control, {
|
49
|
-
...controlProps,
|
50
|
-
ref: ref
|
51
|
-
}));
|
52
|
-
});
|
53
|
-
DeprecatedField.displayName = displayName;
|
54
|
-
return DeprecatedField;
|
55
|
-
}
|
56
|
-
const getDeprecatedFieldClassNames = (controlRootClassName)=>({
|
57
|
-
..._field.fieldClassNames,
|
58
|
-
control: controlRootClassName
|
59
|
-
}); //# sourceMappingURL=makeDeprecatedField.js.map
|
60
|
-
|
61
|
-
//# sourceMappingURL=makeDeprecatedField.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../lib/util/makeDeprecatedField.js"],"sourcesContent":["/* eslint-disable deprecation/deprecation */import * 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, options = {}) {\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, fieldProps, /*#__PURE__*/React.createElement(Control, {\n ...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","mapProps","displayName","DeprecatedField","React","forwardRef","ref","fieldProps","controlProps","createElement","Field","controlRootClassName","fieldClassNames"],"mappings":"AAAA,0CAA0C;;;;;;;;;;;IA4C1BA,mBAAmB,MAAnBA;IAmBHC,4BAA4B,MAA5BA;;;6DA/DsD;uBAC5B;AACvC;;CAEC,GACD,SAASC,yBAAyBC,KAAK,EAAE;IACvC,MAAM,EACJC,UAAS,EACTC,QAAO,EACPC,KAAI,EACJC,MAAK,EACLC,YAAW,EACXC,SAAQ,EACRC,KAAI,EACJC,KAAI,EACJC,MAAK,EACLC,kBAAiB,EACjBC,sBAAqB,EACrBC,iBAAkB,OAAM,EACxB,GAAGC,aACJ,GAAGb;IACJ,OAAO;QAAC;YACNC;YACAE;YACAC;YACAC;YACAC;YACAE;YACAC;YACAC;YACAC;YACAC;YACA,GAAGL,IAAI;QACT;QAAG;YACDD;YACAE;YACA,GAAGK,WAAW;YACd,GAAGX,OAAO;QACZ;KAAE;AACJ;AAKO,SAASL,oBAAoBiB,OAAO,EAAEC,UAAU,CAAC,CAAC,EAAE;IACzD,MAAM,EACJC,UAAWhB,CAAAA,QAASA,MAAK,EACzBiB,aAAc,CAAC,EAAEH,QAAQG,WAAW,CAAC,KAAK,CAAC,CAAA,EAC5C,GAAGF;IACJ,MAAMG,kBAAkB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACpB,OAAOqB,MAAQ;QACpE,MAAM,CAACC,YAAYC,aAAa,GAAGxB,yBAAyBiB,SAAShB;QACrE,OAAO,WAAW,GAAEmB,OAAMK,aAAa,CAACC,YAAK,EAAEH,YAAY,WAAW,GAAEH,OAAMK,aAAa,CAACV,SAAS;YACnG,GAAGS,YAAY;YACfF,KAAKA;QACP;IACF;IACAH,gBAAgBD,WAAW,GAAGA;IAC9B,OAAOC;AACT;AAKO,MAAMpB,+BAA+B4B,CAAAA,uBAAyB,CAAA;QACnE,GAAGC,sBAAe;QAClBzB,SAASwB;IACX,CAAA,GACA,+CAA+C"}
|