@fluentui/react-field 9.0.0-beta.2 → 9.1.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +72 -4
- package/CHANGELOG.md +32 -5
- package/README.md +1 -3
- package/dist/index.d.ts +1 -32
- package/lib/components/Field/renderField.js +5 -5
- package/lib/components/Field/renderField.js.map +1 -1
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Field/renderField.js +5 -6
- package/lib-commonjs/components/Field/renderField.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,7 +2,75 @@
|
|
2
2
|
"name": "@fluentui/react-field",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Mon, 24 Apr 2023 08:09:11 GMT",
|
6
|
+
"tag": "@fluentui/react-field_v9.1.1",
|
7
|
+
"version": "9.1.1",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "bernardo.sunderhus@gmail.com",
|
12
|
+
"package": "@fluentui/react-field",
|
13
|
+
"commit": "7e199488cd02df78788b833bf29ed7e312b9e41f",
|
14
|
+
"comment": "chore: adopt custom JSX pragma"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "beachball",
|
18
|
+
"package": "@fluentui/react-field",
|
19
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2",
|
20
|
+
"commit": "948b5bf9871303d1742f1b9a17a3bd4006ce2fea"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-field",
|
25
|
+
"comment": "Bump @fluentui/react-label to v9.1.10",
|
26
|
+
"commit": "948b5bf9871303d1742f1b9a17a3bd4006ce2fea"
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"date": "Mon, 17 Apr 2023 17:53:50 GMT",
|
33
|
+
"tag": "@fluentui/react-field_v9.1.0",
|
34
|
+
"version": "9.1.0",
|
35
|
+
"comments": {
|
36
|
+
"patch": [
|
37
|
+
{
|
38
|
+
"author": "behowell@microsoft.com",
|
39
|
+
"package": "@fluentui/react-field",
|
40
|
+
"commit": "273116e8efaf4230474a0f214e9adbb5f556e5de",
|
41
|
+
"comment": "chore: Remove utilities for deprecated shim InputField, etc. components"
|
42
|
+
}
|
43
|
+
],
|
44
|
+
"minor": [
|
45
|
+
{
|
46
|
+
"author": "behowell@microsoft.com",
|
47
|
+
"package": "@fluentui/react-field",
|
48
|
+
"commit": "36f98c3a49334e4ea9b22774691560d11010f2e7",
|
49
|
+
"comment": "feat: Release Field component as stable"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"author": "beachball",
|
53
|
+
"package": "@fluentui/react-field",
|
54
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.18",
|
55
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"author": "beachball",
|
59
|
+
"package": "@fluentui/react-field",
|
60
|
+
"comment": "Bump @fluentui/react-label to v9.1.9",
|
61
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"author": "beachball",
|
65
|
+
"package": "@fluentui/react-field",
|
66
|
+
"comment": "Bump @fluentui/react-utilities to v9.8.0",
|
67
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
68
|
+
}
|
69
|
+
]
|
70
|
+
}
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"date": "Wed, 12 Apr 2023 09:31:44 GMT",
|
6
74
|
"tag": "@fluentui/react-field_v9.0.0-beta.2",
|
7
75
|
"version": "9.0.0-beta.2",
|
8
76
|
"comments": {
|
@@ -17,19 +85,19 @@
|
|
17
85
|
"author": "beachball",
|
18
86
|
"package": "@fluentui/react-field",
|
19
87
|
"comment": "Bump @fluentui/react-context-selector to v9.1.17",
|
20
|
-
"commit": "
|
88
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
21
89
|
},
|
22
90
|
{
|
23
91
|
"author": "beachball",
|
24
92
|
"package": "@fluentui/react-field",
|
25
93
|
"comment": "Bump @fluentui/react-label to v9.1.8",
|
26
|
-
"commit": "
|
94
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
27
95
|
},
|
28
96
|
{
|
29
97
|
"author": "beachball",
|
30
98
|
"package": "@fluentui/react-field",
|
31
99
|
"comment": "Bump @fluentui/react-utilities to v9.7.4",
|
32
|
-
"commit": "
|
100
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
33
101
|
}
|
34
102
|
]
|
35
103
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,20 +1,47 @@
|
|
1
1
|
# Change Log - @fluentui/react-field
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Mon, 24 Apr 2023 08:09:11 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.1.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.1.1)
|
8
|
+
|
9
|
+
Mon, 24 Apr 2023 08:09:11 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.1.0..@fluentui/react-field_v9.1.1)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- chore: adopt custom JSX pragma ([PR #27612](https://github.com/microsoft/fluentui/pull/27612) by bernardo.sunderhus@gmail.com)
|
15
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2 ([PR #27632](https://github.com/microsoft/fluentui/pull/27632) by beachball)
|
16
|
+
- Bump @fluentui/react-label to v9.1.10 ([PR #27632](https://github.com/microsoft/fluentui/pull/27632) by beachball)
|
17
|
+
|
18
|
+
## [9.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.1.0)
|
19
|
+
|
20
|
+
Mon, 17 Apr 2023 17:53:50 GMT
|
21
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.0.0-beta.2..@fluentui/react-field_v9.1.0)
|
22
|
+
|
23
|
+
### Minor changes
|
24
|
+
|
25
|
+
- feat: Release Field component as stable ([PR #27493](https://github.com/microsoft/fluentui/pull/27493) by behowell@microsoft.com)
|
26
|
+
- Bump @fluentui/react-context-selector to v9.1.18 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
27
|
+
- Bump @fluentui/react-label to v9.1.9 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
28
|
+
- Bump @fluentui/react-utilities to v9.8.0 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
29
|
+
|
30
|
+
### Patches
|
31
|
+
|
32
|
+
- chore: Remove utilities for deprecated shim InputField, etc. components ([PR #27492](https://github.com/microsoft/fluentui/pull/27492) by behowell@microsoft.com)
|
33
|
+
|
7
34
|
## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.0.0-beta.2)
|
8
35
|
|
9
|
-
Wed, 12 Apr 2023 09:
|
36
|
+
Wed, 12 Apr 2023 09:31:44 GMT
|
10
37
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.0.0-beta.1..@fluentui/react-field_v9.0.0-beta.2)
|
11
38
|
|
12
39
|
### Changes
|
13
40
|
|
14
41
|
- fix: Make contextValues argument required on renderField_unstable ([PR #27436](https://github.com/microsoft/fluentui/pull/27436) by behowell@microsoft.com)
|
15
|
-
- Bump @fluentui/react-context-selector to v9.1.17 ([
|
16
|
-
- Bump @fluentui/react-label to v9.1.8 ([
|
17
|
-
- Bump @fluentui/react-utilities to v9.7.4 ([
|
42
|
+
- Bump @fluentui/react-context-selector to v9.1.17 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
43
|
+
- Bump @fluentui/react-label to v9.1.8 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
44
|
+
- Bump @fluentui/react-utilities to v9.7.4 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
18
45
|
|
19
46
|
## [9.0.0-beta.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.0.0-beta.1)
|
20
47
|
|
package/README.md
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
**React Field component for [Fluent UI React](https://react.fluentui.dev/)**
|
4
4
|
|
5
|
-
These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
|
6
|
-
|
7
5
|
## Description
|
8
6
|
|
9
7
|
Field adds a label, validation message, and hint text to a control. Any single form control can be used as the child of the Field.
|
@@ -13,7 +11,7 @@ Field adds a label, validation message, and hint text to a control. Any single f
|
|
13
11
|
To import Field:
|
14
12
|
|
15
13
|
```js
|
16
|
-
import { Field } from '@fluentui/react-components
|
14
|
+
import { Field } from '@fluentui/react-components';
|
17
15
|
```
|
18
16
|
|
19
17
|
### Examples
|
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
|
*/
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import
|
2
|
-
import {
|
1
|
+
/** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
|
2
|
+
import { getSlotsNext } from '@fluentui/react-utilities';
|
3
3
|
import { FieldContextProvider, getFieldControlProps } from '../../contexts/index';
|
4
4
|
/**
|
5
5
|
* Render the final JSX of Field
|
@@ -8,15 +8,15 @@ export const renderField_unstable = (state, contextValues) => {
|
|
8
8
|
const {
|
9
9
|
slots,
|
10
10
|
slotProps
|
11
|
-
} =
|
11
|
+
} = getSlotsNext(state);
|
12
12
|
let {
|
13
13
|
children
|
14
14
|
} = state;
|
15
15
|
if (typeof children === 'function') {
|
16
16
|
children = children(getFieldControlProps(contextValues.field) || {});
|
17
17
|
}
|
18
|
-
return /*#__PURE__*/
|
18
|
+
return /*#__PURE__*/createElement(FieldContextProvider, {
|
19
19
|
value: contextValues === null || contextValues === void 0 ? void 0 : contextValues.field
|
20
|
-
}, /*#__PURE__*/
|
20
|
+
}, /*#__PURE__*/createElement(slots.root, slotProps.root, slots.label && /*#__PURE__*/createElement(slots.label, slotProps.label), children, slots.validationMessage && /*#__PURE__*/createElement(slots.validationMessage, slotProps.validationMessage, slots.validationMessageIcon && /*#__PURE__*/createElement(slots.validationMessageIcon, slotProps.validationMessageIcon), slotProps.validationMessage.children), slots.hint && /*#__PURE__*/createElement(slots.hint, slotProps.hint)));
|
21
21
|
};
|
22
22
|
//# sourceMappingURL=renderField.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["createElement","getSlotsNext","FieldContextProvider","getFieldControlProps","renderField_unstable","state","contextValues","slots","slotProps","children","field","value","root","label","validationMessage","validationMessageIcon","hint"],"sources":["../../../src/components/Field/renderField.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\n\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport { FieldContextProvider, getFieldControlProps } from '../../contexts/index';\nimport type { FieldContextValues, FieldSlots, FieldState } from './Field.types';\n\n/**\n * Render the final JSX of Field\n */\nexport const renderField_unstable = (state: FieldState, contextValues: FieldContextValues) => {\n const { slots, slotProps } = getSlotsNext<FieldSlots>(state);\n\n let { children } = state;\n if (typeof children === 'function') {\n children = children(getFieldControlProps(contextValues.field) || {});\n }\n\n return (\n <FieldContextProvider value={contextValues?.field}>\n <slots.root {...slotProps.root}>\n {slots.label && <slots.label {...slotProps.label} />}\n {children}\n {slots.validationMessage && (\n <slots.validationMessage {...slotProps.validationMessage}>\n {slots.validationMessageIcon && <slots.validationMessageIcon {...slotProps.validationMessageIcon} />}\n {slotProps.validationMessage.children}\n </slots.validationMessage>\n )}\n {slots.hint && <slots.hint {...slotProps.hint} />}\n </slots.root>\n </FieldContextProvider>\n );\n};\n"],"mappings":"AAAA,2BACA,yBAEA,SAASA,aAAa,QAAQ;AAE9B,SAASC,YAAY,QAAQ;AAC7B,SAASC,oBAAoB,EAAEC,oBAAoB,QAAQ;AAG3D;;;AAGA,OAAO,MAAMC,oBAAA,GAAuBA,CAACC,KAAA,EAAmBC,aAAA,KAAsC;EAC5F,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGP,YAAA,CAAyBI,KAAA;EAEtD,IAAI;IAAEI;EAAQ,CAAE,GAAGJ,KAAA;EACnB,IAAI,OAAOI,QAAA,KAAa,YAAY;IAClCA,QAAA,GAAWA,QAAA,CAASN,oBAAA,CAAqBG,aAAA,CAAcI,KAAK,KAAK,CAAC;EACpE;EAEA,oBACEV,aApBJ,CAoBKE,oBAAA;IAAqBS,KAAA,EAAOL,aAAA,aAAAA,aAAA,uBAAAA,aAAA,CAAeI;kBAC1CV,aArBN,CAqBOO,KAAA,CAAMK,IAAI,EAAKJ,SAAA,CAAUI,IAAI,EAC3BL,KAAA,CAAMM,KAAK,iBAAIb,aAtBxB,CAsByBO,KAAA,CAAMM,KAAK,EAAKL,SAAA,CAAUK,KAAK,GAC/CJ,QAAA,EACAF,KAAA,CAAMO,iBAAiB,iBACtBd,aAzBV,CAyBWO,KAAA,CAAMO,iBAAiB,EAAKN,SAAA,CAAUM,iBAAiB,EACrDP,KAAA,CAAMQ,qBAAqB,iBAAIf,aA1B5C,CA0B6CO,KAAA,CAAMQ,qBAAqB,EAAKP,SAAA,CAAUO,qBAAqB,GAC/FP,SAAA,CAAUM,iBAAiB,CAACL,QAAQ,GAGxCF,KAAA,CAAMS,IAAI,iBAAIhB,aA9BvB,CA8BwBO,KAAA,CAAMS,IAAI,EAAKR,SAAA,CAAUQ,IAAI;AAIrD"}
|
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"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";
|
1
|
+
/** @jsxRuntime classic */ /** @jsx createElement */ "use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
3
3
|
value: true
|
4
4
|
});
|
@@ -6,19 +6,18 @@ Object.defineProperty(exports, "renderField_unstable", {
|
|
6
6
|
enumerable: true,
|
7
7
|
get: ()=>renderField_unstable
|
8
8
|
});
|
9
|
-
const
|
10
|
-
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
9
|
+
const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
|
11
10
|
const _reactUtilities = require("@fluentui/react-utilities");
|
12
11
|
const _index = require("../../contexts/index");
|
13
12
|
const renderField_unstable = (state, contextValues)=>{
|
14
|
-
const { slots , slotProps } = (0, _reactUtilities.
|
13
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
|
15
14
|
let { children } = state;
|
16
15
|
if (typeof children === 'function') {
|
17
16
|
children = children((0, _index.getFieldControlProps)(contextValues.field) || {});
|
18
17
|
}
|
19
|
-
return /*#__PURE__*/
|
18
|
+
return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_index.FieldContextProvider, {
|
20
19
|
value: contextValues === null || contextValues === void 0 ? void 0 : contextValues.field
|
21
|
-
}, /*#__PURE__*/
|
20
|
+
}, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root, slots.label && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.label, slotProps.label), children, slots.validationMessage && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.validationMessage, slotProps.validationMessage, slots.validationMessageIcon && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.validationMessageIcon, slotProps.validationMessageIcon), slotProps.validationMessage.children), slots.hint && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.hint, slotProps.hint)));
|
22
21
|
}; //# sourceMappingURL=renderField.js.map
|
23
22
|
|
24
23
|
//# sourceMappingURL=renderField.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Field/renderField.js"],"sourcesContent":["import
|
1
|
+
{"version":3,"sources":["../../../lib/components/Field/renderField.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport { FieldContextProvider, getFieldControlProps } from '../../contexts/index';\n/**\n * Render the final JSX of Field\n */\nexport const renderField_unstable = (state, contextValues) => {\n const {\n slots,\n slotProps\n } = getSlotsNext(state);\n let {\n children\n } = state;\n if (typeof children === 'function') {\n children = children(getFieldControlProps(contextValues.field) || {});\n }\n return /*#__PURE__*/createElement(FieldContextProvider, {\n value: contextValues === null || contextValues === void 0 ? void 0 : contextValues.field\n }, /*#__PURE__*/createElement(slots.root, slotProps.root, slots.label && /*#__PURE__*/createElement(slots.label, slotProps.label), children, slots.validationMessage && /*#__PURE__*/createElement(slots.validationMessage, slotProps.validationMessage, slots.validationMessageIcon && /*#__PURE__*/createElement(slots.validationMessageIcon, slotProps.validationMessageIcon), slotProps.validationMessage.children), slots.hint && /*#__PURE__*/createElement(slots.hint, slotProps.hint)));\n};\n//# sourceMappingURL=renderField.js.map"],"names":["renderField_unstable","state","contextValues","slots","slotProps","getSlotsNext","children","getFieldControlProps","field","createElement","FieldContextProvider","value","root","label","validationMessage","validationMessageIcon","hint"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAMrCA;;aAAAA;;iCANqE;gCACrD;uBAC8B;AAIpD,MAAMA,uBAAuB,CAACC,OAAOC,gBAAkB;IAC5D,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,4BAAY,EAACJ;IACjB,IAAI,EACFK,SAAQ,EACT,GAAGL;IACJ,IAAI,OAAOK,aAAa,YAAY;QAClCA,WAAWA,SAASC,IAAAA,2BAAoB,EAACL,cAAcM,KAAK,KAAK,CAAC;IACpE,CAAC;IACD,OAAO,WAAW,GAAEC,IAAAA,8BAAa,EAACC,2BAAoB,EAAE;QACtDC,OAAOT,kBAAkB,IAAI,IAAIA,kBAAkB,KAAK,IAAI,KAAK,IAAIA,cAAcM,KAAK;IAC1F,GAAG,WAAW,GAAEC,IAAAA,8BAAa,EAACN,MAAMS,IAAI,EAAER,UAAUQ,IAAI,EAAET,MAAMU,KAAK,IAAI,WAAW,GAAEJ,IAAAA,8BAAa,EAACN,MAAMU,KAAK,EAAET,UAAUS,KAAK,GAAGP,UAAUH,MAAMW,iBAAiB,IAAI,WAAW,GAAEL,IAAAA,8BAAa,EAACN,MAAMW,iBAAiB,EAAEV,UAAUU,iBAAiB,EAAEX,MAAMY,qBAAqB,IAAI,WAAW,GAAEN,IAAAA,8BAAa,EAACN,MAAMY,qBAAqB,EAAEX,UAAUW,qBAAqB,GAAGX,UAAUU,iBAAiB,CAACR,QAAQ,GAAGH,MAAMa,IAAI,IAAI,WAAW,GAAEP,IAAAA,8BAAa,EAACN,MAAMa,IAAI,EAAEZ,UAAUY,IAAI;AAC9d,GACA,uCAAuC"}
|
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": "9.
|
3
|
+
"version": "9.1.1",
|
4
4
|
"description": "Fluent UI Field components",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -32,11 +32,12 @@
|
|
32
32
|
"@fluentui/scripts-tasks": "*"
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
|
-
"@fluentui/react-context-selector": "^9.1.
|
35
|
+
"@fluentui/react-context-selector": "^9.1.18",
|
36
36
|
"@fluentui/react-icons": "^2.0.196",
|
37
|
-
"@fluentui/react-
|
37
|
+
"@fluentui/react-jsx-runtime": "9.0.0-alpha.2",
|
38
|
+
"@fluentui/react-label": "^9.1.10",
|
38
39
|
"@fluentui/react-theme": "^9.1.7",
|
39
|
-
"@fluentui/react-utilities": "^9.
|
40
|
+
"@fluentui/react-utilities": "^9.8.0",
|
40
41
|
"@griffel/react": "^1.5.2",
|
41
42
|
"@swc/helpers": "^0.4.14"
|
42
43
|
},
|
@@ -49,8 +50,7 @@
|
|
49
50
|
"beachball": {
|
50
51
|
"disallowedChangeTypes": [
|
51
52
|
"major",
|
52
|
-
"
|
53
|
-
"patch"
|
53
|
+
"prerelease"
|
54
54
|
]
|
55
55
|
},
|
56
56
|
"exports": {
|
@@ -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"}
|