@fluentui/react-field 0.0.0-nightly-20230926-0416.1 → 0.0.0-nightly-20230927-0415.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 CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui/react-field",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 26 Sep 2023 04:23:38 GMT",
6
- "tag": "@fluentui/react-field_v0.0.0-nightly-20230926-0416.1",
7
- "version": "0.0.0-nightly-20230926-0416.1",
5
+ "date": "Wed, 27 Sep 2023 04:22:06 GMT",
6
+ "tag": "@fluentui/react-field_v0.0.0-nightly-20230927-0415.1",
7
+ "version": "0.0.0-nightly-20230927-0415.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,44 +16,140 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui/react-field",
19
- "comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-20230926-0416.1",
20
- "commit": "c45a5113d2267de1d82868f5e2037a974e2248f3"
19
+ "comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-20230927-0415.1",
20
+ "commit": "e2ddd695515e0d647f781917f280cebc78d8cf71"
21
21
  },
22
22
  {
23
23
  "author": "beachball",
24
24
  "package": "@fluentui/react-field",
25
- "comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230926-0416.1",
26
- "commit": "c45a5113d2267de1d82868f5e2037a974e2248f3"
25
+ "comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230927-0415.1",
26
+ "commit": "e2ddd695515e0d647f781917f280cebc78d8cf71"
27
27
  },
28
28
  {
29
29
  "author": "beachball",
30
30
  "package": "@fluentui/react-field",
31
- "comment": "Bump @fluentui/react-label to v0.0.0-nightly-20230926-0416.1",
32
- "commit": "c45a5113d2267de1d82868f5e2037a974e2248f3"
31
+ "comment": "Bump @fluentui/react-label to v0.0.0-nightly-20230927-0415.1",
32
+ "commit": "e2ddd695515e0d647f781917f280cebc78d8cf71"
33
33
  },
34
34
  {
35
35
  "author": "beachball",
36
36
  "package": "@fluentui/react-field",
37
- "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230926-0416.1",
38
- "commit": "c45a5113d2267de1d82868f5e2037a974e2248f3"
37
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230927-0415.1",
38
+ "commit": "e2ddd695515e0d647f781917f280cebc78d8cf71"
39
39
  },
40
40
  {
41
41
  "author": "beachball",
42
42
  "package": "@fluentui/react-field",
43
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230926-0416.1",
44
- "commit": "c45a5113d2267de1d82868f5e2037a974e2248f3"
43
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230927-0415.1",
44
+ "commit": "e2ddd695515e0d647f781917f280cebc78d8cf71"
45
45
  },
46
46
  {
47
47
  "author": "beachball",
48
48
  "package": "@fluentui/react-field",
49
- "comment": "Bump @fluentui/react-conformance to v0.0.0-nightly-20230926-0416.1",
50
- "commit": "c45a5113d2267de1d82868f5e2037a974e2248f3"
49
+ "comment": "Bump @fluentui/react-conformance to v0.0.0-nightly-20230927-0415.1",
50
+ "commit": "e2ddd695515e0d647f781917f280cebc78d8cf71"
51
51
  },
52
52
  {
53
53
  "author": "beachball",
54
54
  "package": "@fluentui/react-field",
55
- "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230926-0416.1",
56
- "commit": "c45a5113d2267de1d82868f5e2037a974e2248f3"
55
+ "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230927-0415.1",
56
+ "commit": "e2ddd695515e0d647f781917f280cebc78d8cf71"
57
+ }
58
+ ]
59
+ }
60
+ },
61
+ {
62
+ "date": "Tue, 26 Sep 2023 17:49:05 GMT",
63
+ "tag": "@fluentui/react-field_v9.1.31",
64
+ "version": "9.1.31",
65
+ "comments": {
66
+ "patch": [
67
+ {
68
+ "author": "yuanboxue@microsoft.com",
69
+ "package": "@fluentui/react-field",
70
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d",
71
+ "comment": "chore: trigger manual version bump after broken release"
72
+ },
73
+ {
74
+ "author": "beachball",
75
+ "package": "@fluentui/react-field",
76
+ "comment": "Bump @fluentui/react-context-selector to v9.1.36",
77
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
78
+ },
79
+ {
80
+ "author": "beachball",
81
+ "package": "@fluentui/react-field",
82
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.12",
83
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
84
+ },
85
+ {
86
+ "author": "beachball",
87
+ "package": "@fluentui/react-field",
88
+ "comment": "Bump @fluentui/react-label to v9.1.39",
89
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
90
+ },
91
+ {
92
+ "author": "beachball",
93
+ "package": "@fluentui/react-field",
94
+ "comment": "Bump @fluentui/react-theme to v9.1.14",
95
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
96
+ },
97
+ {
98
+ "author": "beachball",
99
+ "package": "@fluentui/react-field",
100
+ "comment": "Bump @fluentui/react-utilities to v9.13.5",
101
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
102
+ }
103
+ ]
104
+ }
105
+ },
106
+ {
107
+ "date": "Tue, 26 Sep 2023 15:31:59 GMT",
108
+ "tag": "@fluentui/react-field_v9.1.30",
109
+ "version": "9.1.30",
110
+ "comments": {
111
+ "patch": [
112
+ {
113
+ "author": "martinhochel@microsoft.com",
114
+ "package": "@fluentui/react-field",
115
+ "commit": "e61473fa10195f6ebf2308205c1e72e91b711831",
116
+ "comment": "fix: bump swc core to mitigate transpilation memory leaks"
117
+ },
118
+ {
119
+ "author": "ololubek@microsoft.com",
120
+ "package": "@fluentui/react-field",
121
+ "commit": "a31e7394d9f169bc5aa55430a22cdc65425a1b49",
122
+ "comment": "chore: Update react-icons version to pick up IconDirectionContextProvider updated export"
123
+ },
124
+ {
125
+ "author": "beachball",
126
+ "package": "@fluentui/react-field",
127
+ "comment": "Bump @fluentui/react-context-selector to v9.1.35",
128
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
129
+ },
130
+ {
131
+ "author": "beachball",
132
+ "package": "@fluentui/react-field",
133
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.11",
134
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
135
+ },
136
+ {
137
+ "author": "beachball",
138
+ "package": "@fluentui/react-field",
139
+ "comment": "Bump @fluentui/react-label to v9.1.38",
140
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
141
+ },
142
+ {
143
+ "author": "beachball",
144
+ "package": "@fluentui/react-field",
145
+ "comment": "Bump @fluentui/react-theme to v9.1.13",
146
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
147
+ },
148
+ {
149
+ "author": "beachball",
150
+ "package": "@fluentui/react-field",
151
+ "comment": "Bump @fluentui/react-utilities to v9.13.4",
152
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
57
153
  }
58
154
  ]
59
155
  }
package/CHANGELOG.md CHANGED
@@ -1,24 +1,53 @@
1
1
  # Change Log - @fluentui/react-field
2
2
 
3
- This log was last generated on Tue, 26 Sep 2023 04:23:38 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 27 Sep 2023 04:22:06 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20230926-0416.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v0.0.0-nightly-20230926-0416.1)
7
+ ## [0.0.0-nightly-20230927-0415.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v0.0.0-nightly-20230927-0415.1)
8
8
 
9
- Tue, 26 Sep 2023 04:23:38 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.1.29..@fluentui/react-field_v0.0.0-nightly-20230926-0416.1)
9
+ Wed, 27 Sep 2023 04:22:06 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.1.31..@fluentui/react-field_v0.0.0-nightly-20230927-0415.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-20230926-0416.1 ([commit](https://github.com/microsoft/fluentui/commit/c45a5113d2267de1d82868f5e2037a974e2248f3) by beachball)
16
- - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230926-0416.1 ([commit](https://github.com/microsoft/fluentui/commit/c45a5113d2267de1d82868f5e2037a974e2248f3) by beachball)
17
- - Bump @fluentui/react-label to v0.0.0-nightly-20230926-0416.1 ([commit](https://github.com/microsoft/fluentui/commit/c45a5113d2267de1d82868f5e2037a974e2248f3) by beachball)
18
- - Bump @fluentui/react-theme to v0.0.0-nightly-20230926-0416.1 ([commit](https://github.com/microsoft/fluentui/commit/c45a5113d2267de1d82868f5e2037a974e2248f3) by beachball)
19
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20230926-0416.1 ([commit](https://github.com/microsoft/fluentui/commit/c45a5113d2267de1d82868f5e2037a974e2248f3) by beachball)
20
- - Bump @fluentui/react-conformance to v0.0.0-nightly-20230926-0416.1 ([commit](https://github.com/microsoft/fluentui/commit/c45a5113d2267de1d82868f5e2037a974e2248f3) by beachball)
21
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230926-0416.1 ([commit](https://github.com/microsoft/fluentui/commit/c45a5113d2267de1d82868f5e2037a974e2248f3) by beachball)
15
+ - Bump @fluentui/react-context-selector to v0.0.0-nightly-20230927-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/e2ddd695515e0d647f781917f280cebc78d8cf71) by beachball)
16
+ - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230927-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/e2ddd695515e0d647f781917f280cebc78d8cf71) by beachball)
17
+ - Bump @fluentui/react-label to v0.0.0-nightly-20230927-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/e2ddd695515e0d647f781917f280cebc78d8cf71) by beachball)
18
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20230927-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/e2ddd695515e0d647f781917f280cebc78d8cf71) by beachball)
19
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20230927-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/e2ddd695515e0d647f781917f280cebc78d8cf71) by beachball)
20
+ - Bump @fluentui/react-conformance to v0.0.0-nightly-20230927-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/e2ddd695515e0d647f781917f280cebc78d8cf71) by beachball)
21
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230927-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/e2ddd695515e0d647f781917f280cebc78d8cf71) by beachball)
22
+
23
+ ## [9.1.31](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.1.31)
24
+
25
+ Tue, 26 Sep 2023 17:49:05 GMT
26
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.1.30..@fluentui/react-field_v9.1.31)
27
+
28
+ ### Patches
29
+
30
+ - chore: trigger manual version bump after broken release ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by yuanboxue@microsoft.com)
31
+ - Bump @fluentui/react-context-selector to v9.1.36 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
32
+ - Bump @fluentui/react-jsx-runtime to v9.0.12 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
33
+ - Bump @fluentui/react-label to v9.1.39 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
34
+ - Bump @fluentui/react-theme to v9.1.14 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
35
+ - Bump @fluentui/react-utilities to v9.13.5 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
36
+
37
+ ## [9.1.30](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.1.30)
38
+
39
+ Tue, 26 Sep 2023 15:31:59 GMT
40
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.1.29..@fluentui/react-field_v9.1.30)
41
+
42
+ ### Patches
43
+
44
+ - fix: bump swc core to mitigate transpilation memory leaks ([PR #29253](https://github.com/microsoft/fluentui/pull/29253) by martinhochel@microsoft.com)
45
+ - chore: Update react-icons version to pick up IconDirectionContextProvider updated export ([PR #29151](https://github.com/microsoft/fluentui/pull/29151) by ololubek@microsoft.com)
46
+ - Bump @fluentui/react-context-selector to v9.1.35 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
47
+ - Bump @fluentui/react-jsx-runtime to v9.0.11 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
48
+ - Bump @fluentui/react-label to v9.1.38 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
49
+ - Bump @fluentui/react-theme to v9.1.13 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
50
+ - Bump @fluentui/react-utilities to v9.13.4 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
22
51
 
23
52
  ## [9.1.29](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.1.29)
24
53
 
@@ -4,14 +4,13 @@ import { FieldContextProvider, getFieldControlProps } from '../../contexts/index
4
4
  /**
5
5
  * Render the final JSX of Field
6
6
  */ export const renderField_unstable = (state, contextValues)=>{
7
- var _contextValues;
8
7
  assertSlots(state);
9
8
  let { children } = state;
10
9
  if (typeof children === 'function') {
11
10
  children = children(getFieldControlProps(contextValues.field) || {});
12
11
  }
13
12
  return /*#__PURE__*/ _jsx(FieldContextProvider, {
14
- value: (_contextValues = contextValues) === null || _contextValues === void 0 ? void 0 : _contextValues.field,
13
+ value: contextValues === null || contextValues === void 0 ? void 0 : contextValues.field,
15
14
  children: /*#__PURE__*/ _jsxs(state.root, {
16
15
  children: [
17
16
  state.label && /*#__PURE__*/ _jsx(state.label, {}),
@@ -1 +1 @@
1
- {"version":3,"sources":["renderField.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } 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 assertSlots<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 <state.root>\n {state.label && <state.label />}\n {children}\n {state.validationMessage && (\n <state.validationMessage>\n {state.validationMessageIcon && <state.validationMessageIcon />}\n {state.validationMessage.children}\n </state.validationMessage>\n )}\n\n {state.hint && <state.hint />}\n </state.root>\n </FieldContextProvider>\n );\n};\n"],"names":["assertSlots","FieldContextProvider","getFieldControlProps","renderField_unstable","state","contextValues","children","field","value","root","label","validationMessage","validationMessageIcon","hint"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,SAASC,oBAAoB,EAAEC,oBAAoB,QAAQ,uBAAuB;AAGlF;;CAEC,GACD,OAAO,MAAMC,uBAAuB,CAACC,OAAmBC;QASvBA;IAR/BL,YAAwBI;IAExB,IAAI,EAAEE,QAAQ,EAAE,GAAGF;IACnB,IAAI,OAAOE,aAAa,YAAY;QAClCA,WAAWA,SAASJ,qBAAqBG,cAAcE,KAAK,KAAK,CAAC;IACpE;IAEA,qBACE,KAACN;QAAqBO,KAAK,GAAEH,iBAAAA,2BAAAA,qCAAAA,eAAeE,KAAK;kBAC/C,cAAA,MAACH,MAAMK,IAAI;;gBACRL,MAAMM,KAAK,kBAAI,KAACN,MAAMM,KAAK;gBAC3BJ;gBACAF,MAAMO,iBAAiB,kBACtB,MAACP,MAAMO,iBAAiB;;wBACrBP,MAAMQ,qBAAqB,kBAAI,KAACR,MAAMQ,qBAAqB;wBAC3DR,MAAMO,iBAAiB,CAACL,QAAQ;;;gBAIpCF,MAAMS,IAAI,kBAAI,KAACT,MAAMS,IAAI;;;;AAIlC,EAAE"}
1
+ {"version":3,"sources":["renderField.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } 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 assertSlots<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 <state.root>\n {state.label && <state.label />}\n {children}\n {state.validationMessage && (\n <state.validationMessage>\n {state.validationMessageIcon && <state.validationMessageIcon />}\n {state.validationMessage.children}\n </state.validationMessage>\n )}\n\n {state.hint && <state.hint />}\n </state.root>\n </FieldContextProvider>\n );\n};\n"],"names":["assertSlots","FieldContextProvider","getFieldControlProps","renderField_unstable","state","contextValues","children","field","value","root","label","validationMessage","validationMessageIcon","hint"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,SAASC,oBAAoB,EAAEC,oBAAoB,QAAQ,uBAAuB;AAGlF;;CAEC,GACD,OAAO,MAAMC,uBAAuB,CAACC,OAAmBC;IACtDL,YAAwBI;IAExB,IAAI,EAAEE,QAAQ,EAAE,GAAGF;IACnB,IAAI,OAAOE,aAAa,YAAY;QAClCA,WAAWA,SAASJ,qBAAqBG,cAAcE,KAAK,KAAK,CAAC;IACpE;IAEA,qBACE,KAACN;QAAqBO,KAAK,EAAEH,0BAAAA,oCAAAA,cAAeE,KAAK;kBAC/C,cAAA,MAACH,MAAMK,IAAI;;gBACRL,MAAMM,KAAK,kBAAI,KAACN,MAAMM,KAAK;gBAC3BJ;gBACAF,MAAMO,iBAAiB,kBACtB,MAACP,MAAMO,iBAAiB;;wBACrBP,MAAMQ,qBAAqB,kBAAI,KAACR,MAAMQ,qBAAqB;wBAC3DR,MAAMO,iBAAiB,CAACL,QAAQ;;;gBAIpCF,MAAMS,IAAI,kBAAI,KAACT,MAAMS,IAAI;;;;AAIlC,EAAE"}
@@ -7,7 +7,6 @@ export function useFieldControlProps_unstable(props, options) {
7
7
  * Implementation of useFieldControlProps_unstable.
8
8
  * Split out so it can be used directly in renderField_unstable.
9
9
  */ export function getFieldControlProps(context, props, options) {
10
- var _options, _options1;
11
10
  if (!context) {
12
11
  return props;
13
12
  }
@@ -23,7 +22,7 @@ export function useFieldControlProps_unstable(props, options) {
23
22
  }
24
23
  // Set aria-labelledby if the control doesn't support label.htmlFor, or if the label's htmlFor doesn't refer
25
24
  // to this control (i.e. the user set this control's id prop without also setting the Field's label.htmlFor).
26
- if (labelId && (!((_options = options) === null || _options === void 0 ? void 0 : _options.supportsLabelFor) || labelFor !== props.id)) {
25
+ if (labelId && (!(options === null || options === void 0 ? void 0 : options.supportsLabelFor) || labelFor !== props.id)) {
27
26
  var _props1, _arialabelledby;
28
27
  var _;
29
28
  (_ = (_props1 = props)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _props1[_arialabelledby] = labelId;
@@ -32,36 +31,34 @@ export function useFieldControlProps_unstable(props, options) {
32
31
  // We also preserve and append any aria-describedby from props.
33
32
  // For reference: https://github.com/microsoft/fluentui/pull/25580#discussion_r1017259933
34
33
  if (validationMessageId || hintId) {
35
- var _props2;
36
34
  // NOTE: Not using ??= since we're merging and overriding the user-provided value.
37
35
  props['aria-describedby'] = [
38
36
  validationMessageId,
39
37
  hintId,
40
- (_props2 = props) === null || _props2 === void 0 ? void 0 : _props2['aria-describedby']
38
+ props === null || props === void 0 ? void 0 : props['aria-describedby']
41
39
  ].filter(Boolean).join(' ');
42
40
  }
43
41
  if (validationState === 'error') {
44
- var _props3, _ariainvalid;
42
+ var _props2, _ariainvalid;
45
43
  var _1;
46
- (_1 = (_props3 = props)[_ariainvalid = 'aria-invalid']) !== null && _1 !== void 0 ? _1 : _props3[_ariainvalid] = true;
44
+ (_1 = (_props2 = props)[_ariainvalid = 'aria-invalid']) !== null && _1 !== void 0 ? _1 : _props2[_ariainvalid] = true;
47
45
  }
48
46
  if (required) {
49
- var _options2;
50
- if ((_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.supportsRequired) {
51
- var _props4;
47
+ if (options === null || options === void 0 ? void 0 : options.supportsRequired) {
48
+ var _props3;
52
49
  var _required;
53
- (_required = (_props4 = props).required) !== null && _required !== void 0 ? _required : _props4.required = true;
50
+ (_required = (_props3 = props).required) !== null && _required !== void 0 ? _required : _props3.required = true;
54
51
  } else {
55
- var _props5, _ariarequired;
52
+ var _props4, _ariarequired;
56
53
  var _2;
57
- (_2 = (_props5 = props)[_ariarequired = 'aria-required']) !== null && _2 !== void 0 ? _2 : _props5[_ariarequired] = true;
54
+ (_2 = (_props4 = props)[_ariarequired = 'aria-required']) !== null && _2 !== void 0 ? _2 : _props4[_ariarequired] = true;
58
55
  }
59
56
  }
60
57
  // Include the size prop if this control supports it
61
- if ((_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.supportsSize) {
62
- var _props6;
58
+ if (options === null || options === void 0 ? void 0 : options.supportsSize) {
59
+ var _props5;
63
60
  var _size;
64
- (_size = (_props6 = props).size) !== null && _size !== void 0 ? _size : _props6.size = context.size;
61
+ (_size = (_props5 = props).size) !== null && _size !== void 0 ? _size : _props5.size = context.size;
65
62
  }
66
63
  return props;
67
64
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["useFieldControlProps.ts"],"sourcesContent":["import type { FieldContextValue, FieldControlProps } from '../Field';\nimport { useFieldContext_unstable } from './FieldContext';\n\n/**\n * Options for `useFieldControlProps_unstable`.\n */\nexport type FieldControlPropsOptions = {\n /**\n * Skips setting `aria-labelledby` on the control if the `label.htmlFor` refers to the control.\n *\n * This should be used with controls that can be the target of a label's `for` prop:\n * `<button>`, `<input>`, `<progress>`, `<select>`, `<textarea>`.\n */\n supportsLabelFor?: boolean;\n\n /**\n * Sets `required` instead of `aria-required` when the Field is marked required.\n *\n * This should be used with controls that support the `required` prop:\n * `<input>` (except `range` or `color`), `<select>`, `<textarea>`.\n */\n supportsRequired?: boolean;\n\n /**\n * Sets the size prop on the control to match the Field's size: `'small' | 'medium' | 'large'`.\n *\n * This should be used with controls that have a custom size prop that matches the Field's size prop.\n */\n supportsSize?: boolean;\n};\n\n/**\n * Gets the control props from the field context, if this inside a `<Field>`.\n *\n * When called with no arguments, returns the FieldControlProps that should be applied to the control.\n *\n * @returns A FieldControlProps object if inside a `<Field>`, otherwise undefined.\n */\nexport function useFieldControlProps_unstable(): FieldControlProps | undefined;\n\n/**\n * Copies and merges the FieldControlProps with the given props, if this inside a `<Field>`.\n *\n * @param props - The existing props for the control. These will be merged with the control props from the field context.\n * @param options - Option to include the size prop.\n * @returns Merged props if inside a `<Field>`, otherwise the original props, or undefined if no props given.\n */\nexport function useFieldControlProps_unstable<Props extends FieldControlProps>(\n props: Props,\n options?: FieldControlPropsOptions,\n): Props;\nexport function useFieldControlProps_unstable<Props extends FieldControlProps>(\n props?: Props,\n options?: FieldControlPropsOptions,\n): Props | undefined {\n return getFieldControlProps(useFieldContext_unstable(), props, options);\n}\n\n/**\n * @internal\n * Implementation of useFieldControlProps_unstable.\n * Split out so it can be used directly in renderField_unstable.\n */\nexport function getFieldControlProps<Props extends FieldControlProps>(\n context: FieldContextValue | undefined,\n props?: Props,\n options?: FieldControlPropsOptions,\n): Props | undefined {\n if (!context) {\n return props;\n }\n\n // Create a copy of props so we don't modify the original\n props = { ...props } as Props;\n\n const { generatedControlId, hintId, labelFor, labelId, required, validationMessageId, validationState } = context;\n\n if (generatedControlId) {\n props.id ??= generatedControlId;\n }\n\n // Set aria-labelledby if the control doesn't support label.htmlFor, or if the label's htmlFor doesn't refer\n // to this control (i.e. the user set this control's id prop without also setting the Field's label.htmlFor).\n if (labelId && (!options?.supportsLabelFor || labelFor !== props.id)) {\n props['aria-labelledby'] ??= labelId;\n }\n\n // The control is described by the validation message, or hint, or both.\n // We also preserve and append any aria-describedby from props.\n // For reference: https://github.com/microsoft/fluentui/pull/25580#discussion_r1017259933\n if (validationMessageId || hintId) {\n // NOTE: Not using ??= since we're merging and overriding the user-provided value.\n props['aria-describedby'] = [validationMessageId, hintId, props?.['aria-describedby']].filter(Boolean).join(' ');\n }\n\n if (validationState === 'error') {\n props['aria-invalid'] ??= true;\n }\n\n if (required) {\n if (options?.supportsRequired) {\n (props as { required?: boolean }).required ??= true;\n } else {\n props['aria-required'] ??= true;\n }\n }\n\n // Include the size prop if this control supports it\n if (options?.supportsSize) {\n (props as { size?: FieldContextValue['size'] }).size ??= context.size;\n }\n\n return props;\n}\n"],"names":["useFieldContext_unstable","useFieldControlProps_unstable","props","options","getFieldControlProps","context","generatedControlId","hintId","labelFor","labelId","required","validationMessageId","validationState","id","supportsLabelFor","filter","Boolean","join","supportsRequired","supportsSize","size"],"mappings":"AACA,SAASA,wBAAwB,QAAQ,iBAAiB;AAkD1D,OAAO,SAASC,8BACdC,KAAa,EACbC,OAAkC;IAElC,OAAOC,qBAAqBJ,4BAA4BE,OAAOC;AACjE;AAEA;;;;CAIC,GACD,OAAO,SAASC,qBACdC,OAAsC,EACtCH,KAAa,EACbC,OAAkC;QAiBjBA,UAyBbA;IAxCJ,IAAI,CAACE,SAAS;QACZ,OAAOH;IACT;IAEA,yDAAyD;IACzDA,QAAQ;QAAE,GAAGA,KAAK;IAAC;IAEnB,MAAM,EAAEI,kBAAkB,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,QAAQ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lProps.ts"],"sourcesContent":["import type { FieldContextValue, FieldControlProps } from '../Field';\nimport { useFieldContext_unstable } from './FieldContext';\n\n/**\n * Options for `useFieldControlProps_unstable`.\n */\nexport type FieldControlPropsOptions = {\n /**\n * Skips setting `aria-labelledby` on the control if the `label.htmlFor` refers to the control.\n *\n * This should be used with controls that can be the target of a label's `for` prop:\n * `<button>`, `<input>`, `<progress>`, `<select>`, `<textarea>`.\n */\n supportsLabelFor?: boolean;\n\n /**\n * Sets `required` instead of `aria-required` when the Field is marked required.\n *\n * This should be used with controls that support the `required` prop:\n * `<input>` (except `range` or `color`), `<select>`, `<textarea>`.\n */\n supportsRequired?: boolean;\n\n /**\n * Sets the size prop on the control to match the Field's size: `'small' | 'medium' | 'large'`.\n *\n * This should be used with controls that have a custom size prop that matches the Field's size prop.\n */\n supportsSize?: boolean;\n};\n\n/**\n * Gets the control props from the field context, if this inside a `<Field>`.\n *\n * When called with no arguments, returns the FieldControlProps that should be applied to the control.\n *\n * @returns A FieldControlProps object if inside a `<Field>`, otherwise undefined.\n */\nexport function useFieldControlProps_unstable(): FieldControlProps | undefined;\n\n/**\n * Copies and merges the FieldControlProps with the given props, if this inside a `<Field>`.\n *\n * @param props - The existing props for the control. These will be merged with the control props from the field context.\n * @param options - Option to include the size prop.\n * @returns Merged props if inside a `<Field>`, otherwise the original props, or undefined if no props given.\n */\nexport function useFieldControlProps_unstable<Props extends FieldControlProps>(\n props: Props,\n options?: FieldControlPropsOptions,\n): Props;\nexport function useFieldControlProps_unstable<Props extends FieldControlProps>(\n props?: Props,\n options?: FieldControlPropsOptions,\n): Props | undefined {\n return getFieldControlProps(useFieldContext_unstable(), props, options);\n}\n\n/**\n * @internal\n * Implementation of useFieldControlProps_unstable.\n * Split out so it can be used directly in renderField_unstable.\n */\nexport function getFieldControlProps<Props extends FieldControlProps>(\n context: FieldContextValue | undefined,\n props?: Props,\n options?: FieldControlPropsOptions,\n): Props | undefined {\n if (!context) {\n return props;\n }\n\n // Create a copy of props so we don't modify the original\n props = { ...props } as Props;\n\n const { generatedControlId, hintId, labelFor, labelId, required, validationMessageId, validationState } = context;\n\n if (generatedControlId) {\n props.id ??= generatedControlId;\n }\n\n // Set aria-labelledby if the control doesn't support label.htmlFor, or if the label's htmlFor doesn't refer\n // to this control (i.e. the user set this control's id prop without also setting the Field's label.htmlFor).\n if (labelId && (!options?.supportsLabelFor || labelFor !== props.id)) {\n props['aria-labelledby'] ??= labelId;\n }\n\n // The control is described by the validation message, or hint, or both.\n // We also preserve and append any aria-describedby from props.\n // For reference: https://github.com/microsoft/fluentui/pull/25580#discussion_r1017259933\n if (validationMessageId || hintId) {\n // NOTE: Not using ??= since we're merging and overriding the user-provided value.\n props['aria-describedby'] = [validationMessageId, hintId, props?.['aria-describedby']].filter(Boolean).join(' ');\n }\n\n if (validationState === 'error') {\n props['aria-invalid'] ??= true;\n }\n\n if (required) {\n if (options?.supportsRequired) {\n (props as { required?: boolean }).required ??= true;\n } else {\n props['aria-required'] ??= true;\n }\n }\n\n // Include the size prop if this control supports it\n if (options?.supportsSize) {\n (props as { size?: FieldContextValue['size'] }).size ??= context.size;\n }\n\n return props;\n}\n"],"names":["useFieldContext_unstable","useFieldControlProps_unstable","props","options","getFieldControlProps","context","generatedControlId","hintId","labelFor","labelId","required","validationMessageId","validationState","id","supportsLabelFor","filter","Boolean","join","supportsRequired","supportsSize","size"],"mappings":"AACA,SAASA,wBAAwB,QAAQ,iBAAiB;AAkD1D,OAAO,SAASC,8BACdC,KAAa,EACbC,OAAkC;IAElC,OAAOC,qBAAqBJ,4BAA4BE,OAAOC;AACjE;AAEA;;;;CAIC,GACD,OAAO,SAASC,qBACdC,OAAsC,EACtCH,KAAa,EACbC,OAAkC;IAElC,IAAI,CAACE,SAAS;QACZ,OAAOH;IACT;IAEA,yDAAyD;IACzDA,QAAQ;QAAE,GAAGA,KAAK;IAAC;IAEnB,MAAM,EAAEI,kBAAkB,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAA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
12
12
  const _reactutilities = require("@fluentui/react-utilities");
13
13
  const _index = require("../../contexts/index");
14
14
  const renderField_unstable = (state, contextValues)=>{
15
- var _contextValues;
16
15
  (0, _reactutilities.assertSlots)(state);
17
16
  let { children } = state;
18
17
  if (typeof children === 'function') {
19
18
  children = children((0, _index.getFieldControlProps)(contextValues.field) || {});
20
19
  }
21
20
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_index.FieldContextProvider, {
22
- value: (_contextValues = contextValues) === null || _contextValues === void 0 ? void 0 : _contextValues.field,
21
+ value: contextValues === null || contextValues === void 0 ? void 0 : contextValues.field,
23
22
  children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
24
23
  children: [
25
24
  state.label && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.label, {}),
@@ -1 +1 @@
1
- {"version":3,"sources":["renderField.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { FieldContextProvider, getFieldControlProps } from '../../contexts/index';\n/**\n * Render the final JSX of Field\n */ export const renderField_unstable = (state, contextValues)=>{\n var _contextValues;\n assertSlots(state);\n let { children } = state;\n if (typeof children === 'function') {\n children = children(getFieldControlProps(contextValues.field) || {});\n }\n return /*#__PURE__*/ _jsx(FieldContextProvider, {\n value: (_contextValues = contextValues) === null || _contextValues === void 0 ? void 0 : _contextValues.field,\n children: /*#__PURE__*/ _jsxs(state.root, {\n children: [\n state.label && /*#__PURE__*/ _jsx(state.label, {}),\n children,\n state.validationMessage && /*#__PURE__*/ _jsxs(state.validationMessage, {\n children: [\n state.validationMessageIcon && /*#__PURE__*/ _jsx(state.validationMessageIcon, {}),\n state.validationMessage.children\n ]\n }),\n state.hint && /*#__PURE__*/ _jsx(state.hint, {})\n ]\n })\n });\n};\n"],"names":["renderField_unstable","state","contextValues","_contextValues","assertSlots","children","getFieldControlProps","field","_jsx","FieldContextProvider","value","_jsxs","root","label","validationMessage","validationMessageIcon","hint"],"mappings":";;;;+BAKiBA;;;eAAAA;;;4BAL4B;gCACjB;uBAC+B;AAGhD,MAAMA,uBAAuB,CAACC,OAAOC;IAC5C,IAAIC;IACJC,IAAAA,2BAAW,EAACH;IACZ,IAAI,EAAEI,QAAQ,EAAE,GAAGJ;IACnB,IAAI,OAAOI,aAAa,YAAY;QAChCA,WAAWA,SAASC,IAAAA,2BAAoB,EAACJ,cAAcK,KAAK,KAAK,CAAC;IACtE;IACA,OAAO,WAAW,GAAGC,IAAAA,eAAI,EAACC,2BAAoB,EAAE;QAC5CC,OAAO,AAACP,CAAAA,iBAAiBD,aAAY,MAAO,QAAQC,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeI,KAAK;QAC7GF,UAAU,WAAW,GAAGM,IAAAA,gBAAK,EAACV,MAAMW,IAAI,EAAE;YACtCP,UAAU;gBACNJ,MAAMY,KAAK,IAAI,WAAW,GAAGL,IAAAA,eAAI,EAACP,MAAMY,KAAK,EAAE,CAAC;gBAChDR;gBACAJ,MAAMa,iBAAiB,IAAI,WAAW,GAAGH,IAAAA,gBAAK,EAACV,MAAMa,iBAAiB,EAAE;oBACpET,UAAU;wBACNJ,MAAMc,qBAAqB,IAAI,WAAW,GAAGP,IAAAA,eAAI,EAACP,MAAMc,qBAAqB,EAAE,CAAC;wBAChFd,MAAMa,iBAAiB,CAACT,QAAQ;qBACnC;gBACL;gBACAJ,MAAMe,IAAI,IAAI,WAAW,GAAGR,IAAAA,eAAI,EAACP,MAAMe,IAAI,EAAE,CAAC;aACjD;QACL;IACJ;AACJ"}
1
+ {"version":3,"sources":["renderField.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { FieldContextProvider, getFieldControlProps } from '../../contexts/index';\n/**\n * Render the final JSX of Field\n */ export const renderField_unstable = (state, contextValues)=>{\n assertSlots(state);\n let { children } = state;\n if (typeof children === 'function') {\n children = children(getFieldControlProps(contextValues.field) || {});\n }\n return /*#__PURE__*/ _jsx(FieldContextProvider, {\n value: contextValues === null || contextValues === void 0 ? void 0 : contextValues.field,\n children: /*#__PURE__*/ _jsxs(state.root, {\n children: [\n state.label && /*#__PURE__*/ _jsx(state.label, {}),\n children,\n state.validationMessage && /*#__PURE__*/ _jsxs(state.validationMessage, {\n children: [\n state.validationMessageIcon && /*#__PURE__*/ _jsx(state.validationMessageIcon, {}),\n state.validationMessage.children\n ]\n }),\n state.hint && /*#__PURE__*/ _jsx(state.hint, {})\n ]\n })\n });\n};\n"],"names":["renderField_unstable","state","contextValues","assertSlots","children","getFieldControlProps","field","_jsx","FieldContextProvider","value","_jsxs","root","label","validationMessage","validationMessageIcon","hint"],"mappings":";;;;+BAKiBA;;;eAAAA;;;4BAL4B;gCACjB;uBAC+B;AAGhD,MAAMA,uBAAuB,CAACC,OAAOC;IAC5CC,IAAAA,2BAAW,EAACF;IACZ,IAAI,EAAEG,QAAQ,EAAE,GAAGH;IACnB,IAAI,OAAOG,aAAa,YAAY;QAChCA,WAAWA,SAASC,IAAAA,2BAAoB,EAACH,cAAcI,KAAK,KAAK,CAAC;IACtE;IACA,OAAO,WAAW,GAAGC,IAAAA,eAAI,EAACC,2BAAoB,EAAE;QAC5CC,OAAOP,kBAAkB,QAAQA,kBAAkB,KAAK,IAAI,KAAK,IAAIA,cAAcI,KAAK;QACxFF,UAAU,WAAW,GAAGM,IAAAA,gBAAK,EAACT,MAAMU,IAAI,EAAE;YACtCP,UAAU;gBACNH,MAAMW,KAAK,IAAI,WAAW,GAAGL,IAAAA,eAAI,EAACN,MAAMW,KAAK,EAAE,CAAC;gBAChDR;gBACAH,MAAMY,iBAAiB,IAAI,WAAW,GAAGH,IAAAA,gBAAK,EAACT,MAAMY,iBAAiB,EAAE;oBACpET,UAAU;wBACNH,MAAMa,qBAAqB,IAAI,WAAW,GAAGP,IAAAA,eAAI,EAACN,MAAMa,qBAAqB,EAAE,CAAC;wBAChFb,MAAMY,iBAAiB,CAACT,QAAQ;qBACnC;gBACL;gBACAH,MAAMc,IAAI,IAAI,WAAW,GAAGR,IAAAA,eAAI,EAACN,MAAMc,IAAI,EAAE,CAAC;aACjD;QACL;IACJ;AACJ"}
@@ -21,7 +21,6 @@ function useFieldControlProps_unstable(props, options) {
21
21
  return getFieldControlProps((0, _FieldContext.useFieldContext_unstable)(), props, options);
22
22
  }
23
23
  function getFieldControlProps(context, props, options) {
24
- var _options, _options1;
25
24
  if (!context) {
26
25
  return props;
27
26
  }
@@ -37,7 +36,7 @@ function getFieldControlProps(context, props, options) {
37
36
  }
38
37
  // Set aria-labelledby if the control doesn't support label.htmlFor, or if the label's htmlFor doesn't refer
39
38
  // to this control (i.e. the user set this control's id prop without also setting the Field's label.htmlFor).
40
- if (labelId && (!((_options = options) === null || _options === void 0 ? void 0 : _options.supportsLabelFor) || labelFor !== props.id)) {
39
+ if (labelId && (!(options === null || options === void 0 ? void 0 : options.supportsLabelFor) || labelFor !== props.id)) {
41
40
  var _props1, _arialabelledby;
42
41
  var _;
43
42
  (_ = (_props1 = props)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _props1[_arialabelledby] = labelId;
@@ -46,36 +45,34 @@ function getFieldControlProps(context, props, options) {
46
45
  // We also preserve and append any aria-describedby from props.
47
46
  // For reference: https://github.com/microsoft/fluentui/pull/25580#discussion_r1017259933
48
47
  if (validationMessageId || hintId) {
49
- var _props2;
50
48
  // NOTE: Not using ??= since we're merging and overriding the user-provided value.
51
49
  props['aria-describedby'] = [
52
50
  validationMessageId,
53
51
  hintId,
54
- (_props2 = props) === null || _props2 === void 0 ? void 0 : _props2['aria-describedby']
52
+ props === null || props === void 0 ? void 0 : props['aria-describedby']
55
53
  ].filter(Boolean).join(' ');
56
54
  }
57
55
  if (validationState === 'error') {
58
- var _props3, _ariainvalid;
56
+ var _props2, _ariainvalid;
59
57
  var _1;
60
- (_1 = (_props3 = props)[_ariainvalid = 'aria-invalid']) !== null && _1 !== void 0 ? _1 : _props3[_ariainvalid] = true;
58
+ (_1 = (_props2 = props)[_ariainvalid = 'aria-invalid']) !== null && _1 !== void 0 ? _1 : _props2[_ariainvalid] = true;
61
59
  }
62
60
  if (required) {
63
- var _options2;
64
- if ((_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.supportsRequired) {
65
- var _props4;
61
+ if (options === null || options === void 0 ? void 0 : options.supportsRequired) {
62
+ var _props3;
66
63
  var _required;
67
- (_required = (_props4 = props).required) !== null && _required !== void 0 ? _required : _props4.required = true;
64
+ (_required = (_props3 = props).required) !== null && _required !== void 0 ? _required : _props3.required = true;
68
65
  } else {
69
- var _props5, _ariarequired;
66
+ var _props4, _ariarequired;
70
67
  var _2;
71
- (_2 = (_props5 = props)[_ariarequired = 'aria-required']) !== null && _2 !== void 0 ? _2 : _props5[_ariarequired] = true;
68
+ (_2 = (_props4 = props)[_ariarequired = 'aria-required']) !== null && _2 !== void 0 ? _2 : _props4[_ariarequired] = true;
72
69
  }
73
70
  }
74
71
  // Include the size prop if this control supports it
75
- if ((_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.supportsSize) {
76
- var _props6;
72
+ if (options === null || options === void 0 ? void 0 : options.supportsSize) {
73
+ var _props5;
77
74
  var _size;
78
- (_size = (_props6 = props).size) !== null && _size !== void 0 ? _size : _props6.size = context.size;
75
+ (_size = (_props5 = props).size) !== null && _size !== void 0 ? _size : _props5.size = context.size;
79
76
  }
80
77
  return props;
81
78
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["useFieldControlProps.js"],"sourcesContent":["import { useFieldContext_unstable } from './FieldContext';\nexport function useFieldControlProps_unstable(props, options) {\n return getFieldControlProps(useFieldContext_unstable(), props, options);\n}\n/**\n * @internal\n * Implementation of useFieldControlProps_unstable.\n * Split out so it can be used directly in renderField_unstable.\n */ export function getFieldControlProps(context, props, options) {\n var _options, _options1;\n if (!context) {\n return props;\n }\n // Create a copy of props so we don't modify the original\n props = {\n ...props\n };\n const { generatedControlId, hintId, labelFor, labelId, required, validationMessageId, validationState } = context;\n if (generatedControlId) {\n var _props;\n var _id;\n (_id = (_props = props).id) !== null && _id !== void 0 ? _id : _props.id = generatedControlId;\n }\n // Set aria-labelledby if the control doesn't support label.htmlFor, or if the label's htmlFor doesn't refer\n // to this control (i.e. the user set this control's id prop without also setting the Field's label.htmlFor).\n if (labelId && (!((_options = options) === null || _options === void 0 ? void 0 : _options.supportsLabelFor) || labelFor !== props.id)) {\n var _props1, _arialabelledby;\n var _;\n (_ = (_props1 = props)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _props1[_arialabelledby] = labelId;\n }\n // The control is described by the validation message, or hint, or both.\n // We also preserve and append any aria-describedby from props.\n // For reference: https://github.com/microsoft/fluentui/pull/25580#discussion_r1017259933\n if (validationMessageId || hintId) {\n var _props2;\n // NOTE: Not using ??= since we're merging and overriding the user-provided value.\n props['aria-describedby'] = [\n validationMessageId,\n hintId,\n (_props2 = props) === null || _props2 === void 0 ? void 0 : _props2['aria-describedby']\n ].filter(Boolean).join(' ');\n }\n if (validationState === 'error') {\n var _props3, _ariainvalid;\n var _1;\n (_1 = (_props3 = props)[_ariainvalid = 'aria-invalid']) !== null && _1 !== void 0 ? _1 : _props3[_ariainvalid] = true;\n }\n if (required) {\n var _options2;\n if ((_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.supportsRequired) {\n var _props4;\n var _required;\n (_required = (_props4 = props).required) !== null && _required !== void 0 ? _required : _props4.required = true;\n } else {\n var _props5, _ariarequired;\n var _2;\n (_2 = (_props5 = props)[_ariarequired = 'aria-required']) !== null && _2 !== void 0 ? _2 : _props5[_ariarequired] = true;\n }\n }\n // Include the size prop if this control supports it\n if ((_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.supportsSize) {\n var _props6;\n var _size;\n (_size = (_props6 = props).size) !== null && _size !== void 0 ? _size : _props6.size = context.size;\n }\n return props;\n}\n"],"names":["useFieldControlProps_unstable","getFieldControlProps","props","options","useFieldContext_unstable","context","_options","_options1","generatedControlId","hintId","labelFor","labelId","required","validationMessageId","validationState","_props","_id","id","supportsLabelFor","_props1","_arialabelledby","_","_props2","filter","Boolean","join","_props3","_ariainvalid","_1","_options2","supportsRequired","_props4","_required","_props5","_ariarequired","_2","supportsSize","_props6","_size","size"],"mappings":";;;;;;;;;;;IACgBA,6BAA6B;eAA7BA;;IAOIC,oBAAoB;eAApBA;;;8BARqB;AAClC,SAASD,8BAA8BE,KAAK,EAAEC,OAAO;IACxD,OAAOF,qBAAqBG,IAAAA,sCAAwB,KAAIF,OAAOC;AACnE;AAKW,SAASF,qBAAqBI,OAAO,EAAEH,KAAK,EAAEC,OAAO;IAC5D,IAAIG,UAAUC;IACd,IAAI,CAACF,SAAS;QACV,OAAOH;IACX;IACA,yDAAyD;IACzDA,QAAQ;QACJ,GAAGA,KAAK;IACZ;IACA,MAAM,EAAEM,kBAAkB,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,mBAAmB,EAAEC,eAAe,EAAE,GAAGT;IAC1G,IAAIG,oBAAoB;QACpB,IAAIO;QACJ,IAAIC;QACHA,CAAAA,MAAM,AAACD,CAAAA,SAASb,KAAI,EAAGe,EAAE,AAAD,MAAO,QAAQD,QAAQ,KAAK,IAAIA,MAAMD,OAAOE,EAAE,GAAGT;IAC/E;IACA,4GAA4G;IAC5G,6GAA6G;IAC7G,IAAIG,WAAY,CAAA,CAAE,CAAA,AAACL,CAAAA,WAAWH,OAAM,MAAO,QAAQG,aAAa,KAAK,IAAI,KAAK,IAAIA,SAASY,gBAAgB,AAAD,KAAMR,aAAaR,MAAMe,EAAE,AAAD,GAAI;QACpI,IAAIE,SAASC;QACb,IAAIC;QACHA,CAAAA,IAAI,AAACF,CAAAA,UAAUjB,KAAI,CAAE,CAACkB,kBAAkB,kBAAkB,AAAD,MAAO,QAAQC,MAAM,KAAK,IAAIA,IAAIF,OAAO,CAACC,gBA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I,AAAD,MAAO,QAAQD,UAAU,KAAK,IAAIA,QAAQD,QAAQE,IAAI,GAAGlC,QAAQkC,IAAI;IACvG;IACA,OAAOrC;AACX"}
1
+ {"version":3,"sources":["useFieldControlProps.js"],"sourcesContent":["import { useFieldContext_unstable } from './FieldContext';\nexport function useFieldControlProps_unstable(props, options) {\n return getFieldControlProps(useFieldContext_unstable(), props, options);\n}\n/**\n * @internal\n * Implementation of useFieldControlProps_unstable.\n * Split out so it can be used directly in renderField_unstable.\n */ export function getFieldControlProps(context, props, options) {\n if (!context) {\n return props;\n }\n // Create a copy of props so we don't modify the original\n props = {\n ...props\n };\n const { generatedControlId, hintId, labelFor, labelId, required, validationMessageId, validationState } = context;\n if (generatedControlId) {\n var _props;\n var _id;\n (_id = (_props = props).id) !== null && _id !== void 0 ? _id : _props.id = generatedControlId;\n }\n // Set aria-labelledby if the control doesn't support label.htmlFor, or if the label's htmlFor doesn't refer\n // to this control (i.e. the user set this control's id prop without also setting the Field's label.htmlFor).\n if (labelId && (!(options === null || options === void 0 ? void 0 : options.supportsLabelFor) || labelFor !== props.id)) {\n var _props1, _arialabelledby;\n var _;\n (_ = (_props1 = props)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _props1[_arialabelledby] = labelId;\n }\n // The control is described by the validation message, or hint, or both.\n // We also preserve and append any aria-describedby from props.\n // For reference: https://github.com/microsoft/fluentui/pull/25580#discussion_r1017259933\n if (validationMessageId || hintId) {\n // NOTE: Not using ??= since we're merging and overriding the user-provided value.\n props['aria-describedby'] = [\n validationMessageId,\n hintId,\n props === null || props === void 0 ? void 0 : props['aria-describedby']\n ].filter(Boolean).join(' ');\n }\n if (validationState === 'error') {\n var _props2, _ariainvalid;\n var _1;\n (_1 = (_props2 = props)[_ariainvalid = 'aria-invalid']) !== null && _1 !== void 0 ? _1 : _props2[_ariainvalid] = true;\n }\n if (required) {\n if (options === null || options === void 0 ? void 0 : options.supportsRequired) {\n var _props3;\n var _required;\n (_required = (_props3 = props).required) !== null && _required !== void 0 ? _required : _props3.required = true;\n } else {\n var _props4, _ariarequired;\n var _2;\n (_2 = (_props4 = props)[_ariarequired = 'aria-required']) !== null && _2 !== void 0 ? _2 : _props4[_ariarequired] = true;\n }\n }\n // Include the size prop if this control supports it\n if (options === null || options === void 0 ? void 0 : options.supportsSize) {\n var _props5;\n var _size;\n (_size = (_props5 = props).size) !== null && _size !== void 0 ? _size : _props5.size = context.size;\n }\n return props;\n}\n"],"names":["useFieldControlProps_unstable","getFieldControlProps","props","options","useFieldContext_unstable","context","generatedControlId","hintId","labelFor","labelId","required","validationMessageId","validationState","_props","_id","id","supportsLabelFor","_props1","_arialabelledby","_","filter","Boolean","join","_props2","_ariainvalid","_1","supportsRequired","_props3","_required","_props4","_ariarequired","_2","supportsSize","_props5","_size","size"],"mappings":";;;;;;;;;;;IACgBA,6BAA6B;eAA7BA;;IAOIC,oBAAoB;eAApBA;;;8BARqB;AAClC,SAASD,8BAA8BE,KAAK,EAAEC,OAAO;IACxD,OAAOF,qBAAqBG,IAAAA,sCAAwB,KAAIF,OAAOC;AACnE;AAKW,SAASF,qBAAqBI,OAAO,EAAEH,KAAK,EAAEC,OAAO;IAC5D,IAAI,CAACE,SAAS;QACV,OAAOH;IACX;IACA,yDAAyD;IACzDA,QAAQ;QACJ,GAAGA,KAAK;IACZ;IACA,MAAM,EAAEI,kBAAkB,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,mBAAmB,EAAEC,eAAe,EAAE,GAAGP;IAC1G,IAAIC,oBAAoB;QACpB,IAAIO;QACJ,IAAIC;QACHA,CAAAA,MAAM,AAACD,CAAAA,SAASX,KAAI,EAAGa,EAAE,AAAD,MAAO,QAAQD,QAAQ,KAAK,IAAIA,MAAMD,OAAOE,EAAE,GAAGT;IAC/E;IACA,4GAA4G;IAC5G,6GAA6G;IAC7G,IAAIG,WAAY,CAAA,CAAEN,CAAAA,YAAY,QAAQA,YAAY,KAAK,I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A,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQ6B,YAAY,EAAE;QACxE,IAAIC;QACJ,IAAIC;QACHA,CAAAA,QAAQ,AAACD,CAAAA,UAAU/B,KAAI,EAAGiC,IAAI,AAAD,MAAO,QAAQD,UAAU,KAAK,IAAIA,QAAQD,QAAQE,IAAI,GAAG9B,QAAQ8B,IAAI;IACvG;IACA,OAAOjC;AACX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-field",
3
- "version": "0.0.0-nightly-20230926-0416.1",
3
+ "version": "0.0.0-nightly-20230927-0415.1",
4
4
  "description": "Fluent UI Field components",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -27,18 +27,18 @@
27
27
  },
28
28
  "devDependencies": {
29
29
  "@fluentui/eslint-plugin": "*",
30
- "@fluentui/react-conformance": "0.0.0-nightly-20230926-0416.1",
31
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230926-0416.1",
30
+ "@fluentui/react-conformance": "0.0.0-nightly-20230927-0415.1",
31
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230927-0415.1",
32
32
  "@fluentui/scripts-api-extractor": "*",
33
33
  "@fluentui/scripts-tasks": "*"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui/react-context-selector": "0.0.0-nightly-20230926-0416.1",
36
+ "@fluentui/react-context-selector": "0.0.0-nightly-20230927-0415.1",
37
37
  "@fluentui/react-icons": "^2.0.217",
38
- "@fluentui/react-jsx-runtime": "0.0.0-nightly-20230926-0416.1",
39
- "@fluentui/react-label": "0.0.0-nightly-20230926-0416.1",
40
- "@fluentui/react-theme": "0.0.0-nightly-20230926-0416.1",
41
- "@fluentui/react-utilities": "0.0.0-nightly-20230926-0416.1",
38
+ "@fluentui/react-jsx-runtime": "0.0.0-nightly-20230927-0415.1",
39
+ "@fluentui/react-label": "0.0.0-nightly-20230927-0415.1",
40
+ "@fluentui/react-theme": "0.0.0-nightly-20230927-0415.1",
41
+ "@fluentui/react-utilities": "0.0.0-nightly-20230927-0415.1",
42
42
  "@griffel/react": "^1.5.14",
43
43
  "@swc/helpers": "^0.5.1"
44
44
  },