@fluentui/react-field 9.1.13 → 9.1.15

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,61 @@
2
2
  "name": "@fluentui/react-field",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 25 Jul 2023 13:26:22 GMT",
5
+ "date": "Fri, 04 Aug 2023 08:48:25 GMT",
6
+ "tag": "@fluentui/react-field_v9.1.15",
7
+ "version": "9.1.15",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui/react-field",
13
+ "comment": "Bump @fluentui/react-context-selector to v9.1.27",
14
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-field",
19
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.13",
20
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-field",
25
+ "comment": "Bump @fluentui/react-label to v9.1.23",
26
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-field",
31
+ "comment": "Bump @fluentui/react-theme to v9.1.10",
32
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-field",
37
+ "comment": "Bump @fluentui/react-utilities to v9.11.0",
38
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "date": "Tue, 01 Aug 2023 10:17:21 GMT",
45
+ "tag": "@fluentui/react-field_v9.1.14",
46
+ "version": "9.1.14",
47
+ "comments": {
48
+ "patch": [
49
+ {
50
+ "author": "beachball",
51
+ "package": "@fluentui/react-field",
52
+ "comment": "Bump @fluentui/react-label to v9.1.22",
53
+ "commit": "412d815f88863bde8bb16abc8fd9c4140a37f1f5"
54
+ }
55
+ ]
56
+ }
57
+ },
58
+ {
59
+ "date": "Tue, 25 Jul 2023 13:29:19 GMT",
6
60
  "tag": "@fluentui/react-field_v9.1.13",
7
61
  "version": "9.1.13",
8
62
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,34 @@
1
1
  # Change Log - @fluentui/react-field
2
2
 
3
- This log was last generated on Tue, 25 Jul 2023 13:26:22 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 04 Aug 2023 08:48:25 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.1.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.1.15)
8
+
9
+ Fri, 04 Aug 2023 08:48:25 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.1.14..@fluentui/react-field_v9.1.15)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-context-selector to v9.1.27 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
15
+ - Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.13 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
16
+ - Bump @fluentui/react-label to v9.1.23 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
17
+ - Bump @fluentui/react-theme to v9.1.10 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
18
+ - Bump @fluentui/react-utilities to v9.11.0 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
19
+
20
+ ## [9.1.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.1.14)
21
+
22
+ Tue, 01 Aug 2023 10:17:21 GMT
23
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.1.13..@fluentui/react-field_v9.1.14)
24
+
25
+ ### Patches
26
+
27
+ - Bump @fluentui/react-label to v9.1.22 ([PR #28689](https://github.com/microsoft/fluentui/pull/28689) by beachball)
28
+
7
29
  ## [9.1.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.1.13)
8
30
 
9
- Tue, 25 Jul 2023 13:26:22 GMT
31
+ Tue, 25 Jul 2023 13:29:19 GMT
10
32
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.1.12..@fluentui/react-field_v9.1.13)
11
33
 
12
34
  ### Patches
@@ -1,4 +1,3 @@
1
- var _props, _props1, _arialabelledby, _props2, _ariainvalid, _props3, _props4, _ariarequired, _props5;
2
1
  import { useFieldContext_unstable } from './FieldContext';
3
2
  export function useFieldControlProps_unstable(props, options) {
4
3
  return getFieldControlProps(useFieldContext_unstable(), props, options);
@@ -17,12 +16,14 @@ export function useFieldControlProps_unstable(props, options) {
17
16
  };
18
17
  const { generatedControlId , hintId , labelFor , labelId , required , validationMessageId , validationState } = context;
19
18
  if (generatedControlId) {
19
+ var _props;
20
20
  var _id;
21
21
  (_id = (_props = props).id) !== null && _id !== void 0 ? _id : _props.id = generatedControlId;
22
22
  }
23
23
  // Set aria-labelledby if the control doesn't support label.htmlFor, or if the label's htmlFor doesn't refer
24
24
  // to this control (i.e. the user set this control's id prop without also setting the Field's label.htmlFor).
25
25
  if (labelId && (!(options === null || options === void 0 ? void 0 : options.supportsLabelFor) || labelFor !== props.id)) {
26
+ var _props1, _arialabelledby;
26
27
  var _;
27
28
  (_ = (_props1 = props)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _props1[_arialabelledby] = labelId;
28
29
  }
@@ -38,20 +39,24 @@ export function useFieldControlProps_unstable(props, options) {
38
39
  ].filter(Boolean).join(' ');
39
40
  }
40
41
  if (validationState === 'error') {
42
+ var _props2, _ariainvalid;
41
43
  var _1;
42
44
  (_1 = (_props2 = props)[_ariainvalid = 'aria-invalid']) !== null && _1 !== void 0 ? _1 : _props2[_ariainvalid] = true;
43
45
  }
44
46
  if (required) {
45
47
  if (options === null || options === void 0 ? void 0 : options.supportsRequired) {
48
+ var _props3;
46
49
  var _required;
47
50
  (_required = (_props3 = props).required) !== null && _required !== void 0 ? _required : _props3.required = true;
48
51
  } else {
52
+ var _props4, _ariarequired;
49
53
  var _2;
50
54
  (_2 = (_props4 = props)[_ariarequired = 'aria-required']) !== null && _2 !== void 0 ? _2 : _props4[_ariarequired] = true;
51
55
  }
52
56
  }
53
57
  // Include the size prop if this control supports it
54
58
  if (options === null || options === void 0 ? void 0 : options.supportsSize) {
59
+ var _props5;
55
60
  var _size;
56
61
  (_size = (_props5 = props).size) !== null && _size !== void 0 ? _size : _props5.size = context.size;
57
62
  }
@@ -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":["props","useFieldContext_unstable","useFieldControlProps_unstable","options","getFieldControlProps","context","generatedControlId","hintId","labelFor","labelId","required","validationMessageId","validationState","id","supportsLabelFor","filter","Boolean","join","supportsRequired","supportsSize","size"],"mappings":"IA8EIA,QAMAA,SAAM,iBAYNA,SAAM,cAKHA,SAEDA,SAAM,eAMPA;AA5GL,SAASC,wBAAwB,QAAQ,iBAAiB;AAkD1D,OAAO,SAASC,8BACdF,KAAa,EACbG,OAAkC,EACf;IACnB,OAAOC,qBAAqBH,4BAA4BD,OAAOG;AACjE,CAAC;AAED;;;;CAIC,GACD,OAAO,SAASC,qBACdC,OAAsC,EACtCL,KAAa,EACbG,OAAkC,EACf;IACnB,IAAI,CAACE,SAAS;QACZ,OAAOL;IACT,CAAC;IAED,yDAAyD;IACzDA,QAAQ;QAAE,GAAGA,KAAK;IAAC;IAEnB,MAAM,EAAEM,mBAAkB,EAAEC,OAAM,EAAEC,SAAQ,EAAEC,QAAO,EAAEC,SAAQ,EAAEC,oBAAmB,EAAEC,gBAAe,EAAE,GAAGP;IAE1G,IAAIC,oBAAoB;;QACtBN,QAAAA,SAAAA,OAAMa,uCAANb,OAAMa,KAAOP,kBAAkB;IACjC,CAAC;IAED,4GAA4G;IAC5G,6GAA6G;IAC7G,IAAIG,WAAY,CAAA,CAACN,CAAAA,oBAAAA,qBAAAA,KAAAA,IAAAA,QAASW,gBAAgB,AAAD,KAAKN,aAAaR,MAAMa,EAAE,AAAD,GAAI;;QACpEb,MAAAA,UAAAA,MAAK,CAAC,kBAAA,kBAAkB,iCAAxBA,OAAK,CAAC,gBAAkB,GAAKS,OAAO;IACtC,CAAC;IAED,wEAAwE;IACxE,+DAA+D;IAC/D,yFAAyF;IACzF,IAAIE,uBAAuBJ,QAAQ;QACjC,kFAAkF;QAClFP,KAAK,CAAC,mBAAmB,GAAG;YAACW;YAAqBJ;YAAQP,kBAAAA,mBAAAA,KAAAA,IAAAA,KAAO,CAAC,mBAAmB;SAAC,CAACe,MAAM,CAACC,SAASC,IAAI,CAAC;IAC9G,CAAC;IAED,IAAIL,oBAAoB,SAAS;;QAC/BZ,OAAAA,UAAAA,MAAK,CAAC,eAAA,eAAe,mCAArBA,OAAK,CAAC,aAAe,GAAK,IAAI;IAChC,CAAC;IAED,IAAIU,UAAU;QACZ,IAAIP,oBAAAA,qBAAAA,KAAAA,IAAAA,QAASe,gBAAgB,EAAE;;YAC7B,cAAClB,UAAAA,OAAiCU,yDAAjCV,QAAiCU,WAAa,IAAI;QACrD,OAAO;;YACLV,OAAAA,UAAAA,MAAK,CAAC,gBAAA,gBAAgB,mCAAtBA,OAAK,CAAC,cAAgB,GAAK,IAAI;QACjC,CAAC;IACH,CAAC;IAED,oDAAoD;IACpD,IAAIG,oBAAAA,qBAAAA,KAAAA,IAAAA,QAASgB,YAAY,EAAE;;QACzB,UAACnB,UAAAA,OAA+CoB,6CAA/CpB,QAA+CoB,OAASf,QAAQe,IAAI;IACvE,CAAC;IAED,OAAOpB;AACT,CAAC"}
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,EACf;IACnB,OAAOC,qBAAqBJ,4BAA4BE,OAAOC;AACjE,CAAC;AAED;;;;CAIC,GACD,OAAO,SAASC,qBACdC,OAAsC,EACtCH,KAAa,EACbC,OAAkC,EACf;IACnB,IAAI,CAACE,SAAS;QACZ,OAAOH;IACT,CAAC;IAED,yDAAyD;IACzDA,QAAQ;QAAE,GAAGA,KAAK;IAAC;IAEnB,MAAM,EAAEI,mBAAkB,EAAEC,OAAM,EAAEC,SAAQ,EAAEC,QAAO,EAAEC,SAAQ,EAAEC,oBAAmB,EAAEC,gBAAe,EAAE,GAAGP;IAE1G,IAAIC,oBAAoB;YACtBJ;;QAAAA,QAAAA,SAAAA,OAAMW,uCAANX,OAAMW,KAAOP,kBAAkB;IACjC,CAAC;IAED,4GAA4G;IAC5G,6GAA6G;IAC7G,IAAIG,WAAY,CAAA,CAACN,CAAAA,oBAAAA,qBAAAA,KAAAA,IAAAA,QAASW,gBAAgB,AAAD,KAAKN,aAAaN,MAAMW,EAAE,AAAD,GAAI;YACpEX,SAAM;;QAANA,MAAAA,UAAAA,MAAK,CAAC,kBAAA,kBAAkB,iCAAxBA,OAAK,CAAC,gBAAkB,GAAKO,OAAO;IACtC,CAAC;IAED,wEAAwE;IACxE,+DAA+D;IAC/D,yFAAyF;IACzF,IAAIE,uBAAuBJ,QAAQ;QACjC,kFAAkF;QAClFL,KAAK,CAAC,mBAAmB,GAAG;YAACS;YAAqBJ;YAAQL,kBAAAA,mBAAAA,KAAAA,IAAAA,KAAO,CAAC,mBAAmB;SAAC,CAACa,MAAM,CAACC,SAASC,IAAI,CAAC;IAC9G,CAAC;IAED,IAAIL,oBAAoB,SAAS;YAC/BV,SAAM;;QAANA,OAAAA,UAAAA,MAAK,CAAC,eAAA,eAAe,mCAArBA,OAAK,CAAC,aAAe,GAAK,IAAI;IAChC,CAAC;IAED,IAAIQ,UAAU;QACZ,IAAIP,oBAAAA,qBAAAA,KAAAA,IAAAA,QAASe,gBAAgB,EAAE;gBAC5BhB;;YAAD,cAACA,UAAAA,OAAiCQ,yDAAjCR,QAAiCQ,WAAa,IAAI;QACrD,OAAO;gBACLR,SAAM;;YAANA,OAAAA,UAAAA,MAAK,CAAC,gBAAA,gBAAgB,mCAAtBA,OAAK,CAAC,cAAgB,GAAK,IAAI;QACjC,CAAC;IACH,CAAC;IAED,oDAAoD;IACpD,IAAIC,oBAAAA,qBAAAA,KAAAA,IAAAA,QAASgB,YAAY,EAAE;YACxBjB;;QAAD,UAACA,UAAAA,OAA+CkB,6CAA/ClB,QAA+CkB,OAASf,QAAQe,IAAI;IACvE,CAAC;IAED,OAAOlB;AACT,CAAC"}
@@ -13,7 +13,6 @@ _export(exports, {
13
13
  getFieldControlProps: ()=>getFieldControlProps
14
14
  });
15
15
  const _fieldContext = require("./FieldContext");
16
- var _props, _props1, _arialabelledby, _props2, _ariainvalid, _props3, _props4, _ariarequired, _props5;
17
16
  function useFieldControlProps_unstable(props, options) {
18
17
  return getFieldControlProps((0, _fieldContext.useFieldContext_unstable)(), props, options);
19
18
  }
@@ -27,12 +26,14 @@ function getFieldControlProps(context, props, options) {
27
26
  };
28
27
  const { generatedControlId , hintId , labelFor , labelId , required , validationMessageId , validationState } = context;
29
28
  if (generatedControlId) {
29
+ var _props;
30
30
  var _id;
31
31
  (_id = (_props = props).id) !== null && _id !== void 0 ? _id : _props.id = generatedControlId;
32
32
  }
33
33
  // Set aria-labelledby if the control doesn't support label.htmlFor, or if the label's htmlFor doesn't refer
34
34
  // to this control (i.e. the user set this control's id prop without also setting the Field's label.htmlFor).
35
35
  if (labelId && (!(options === null || options === void 0 ? void 0 : options.supportsLabelFor) || labelFor !== props.id)) {
36
+ var _props1, _arialabelledby;
36
37
  var _;
37
38
  (_ = (_props1 = props)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _props1[_arialabelledby] = labelId;
38
39
  }
@@ -48,20 +49,24 @@ function getFieldControlProps(context, props, options) {
48
49
  ].filter(Boolean).join(' ');
49
50
  }
50
51
  if (validationState === 'error') {
52
+ var _props2, _ariainvalid;
51
53
  var _1;
52
54
  (_1 = (_props2 = props)[_ariainvalid = 'aria-invalid']) !== null && _1 !== void 0 ? _1 : _props2[_ariainvalid] = true;
53
55
  }
54
56
  if (required) {
55
57
  if (options === null || options === void 0 ? void 0 : options.supportsRequired) {
58
+ var _props3;
56
59
  var _required;
57
60
  (_required = (_props3 = props).required) !== null && _required !== void 0 ? _required : _props3.required = true;
58
61
  } else {
62
+ var _props4, _ariarequired;
59
63
  var _2;
60
64
  (_2 = (_props4 = props)[_ariarequired = 'aria-required']) !== null && _2 !== void 0 ? _2 : _props4[_ariarequired] = true;
61
65
  }
62
66
  }
63
67
  // Include the size prop if this control supports it
64
68
  if (options === null || options === void 0 ? void 0 : options.supportsSize) {
69
+ var _props5;
65
70
  var _size;
66
71
  (_size = (_props5 = props).size) !== null && _size !== void 0 ? _size : _props5.size = context.size;
67
72
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["useFieldControlProps.js"],"sourcesContent":["var _props, _props1, _arialabelledby, _props2, _ariainvalid, _props3, _props4, _ariarequired, _props5;\nimport { 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 _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 _;\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 _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 _required;\n (_required = (_props3 = props).required) !== null && _required !== void 0 ? _required : _props3.required = true;\n } else {\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 _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","_props1","_arialabelledby","_props2","_ariainvalid","_props3","_props4","_ariarequired","_props5","props","options","useFieldContext_unstable","context","generatedControlId","hintId","labelFor","labelId","required","validationMessageId","validationState","_id","id","supportsLabelFor","_","filter","Boolean","join","_1","supportsRequired","_required","_2","supportsSize","_size","size"],"mappings":";;;;;;;;;;;IAEgBA,6BAA6B,MAA7BA;IAOIC,oBAAoB,MAApBA;;8BARqB;AADzC,IAAIC,QAAQC,SAASC,iBAAiBC,SAASC,cAAcC,SAASC,SAASC,eAAeC;AAEvF,SAASV,8BAA8BW,KAAK,EAAEC,OAAO,EAAE;IAC1D,OAAOX,qBAAqBY,IAAAA,sCAAwB,KAAIF,OAAOC;AACnE;AAKW,SAASX,qBAAqBa,OAAO,EAAEH,KAAK,EAAEC,OAAO,EAAE;IAC9D,IAAI,CAACE,SAAS;QACV,OAAOH;IACX,CAAC;IACD,yDAAyD;IACzDA,QAAQ;QACJ,GAAGA,KAAK;IACZ;IACA,MAAM,EAAEI,mBAAkB,EAAGC,OAAM,EAAGC,SAAQ,EAAGC,QAAO,EAAGC,SAAQ,EAAGC,oBAAmB,EAAGC,gBAAe,EAAG,GAAGP;IACjH,IAAIC,oBAAoB;QACpB,IAAIO;QACHA,CAAAA,MAAM,AAACpB,CAAAA,SAASS,KAAI,EAAGY,EAAE,AAAD,MAAO,IAAI,IAAID,QAAQ,KAAK,IAAIA,MAAMpB,OAAOqB,EAAE,GAAGR,kBAAkB;IACjG,CAAC;IACD,4GAA4G;IAC5G,6GAA6G;IAC7G,IAAIG,WAAY,CAAA,CAAEN,CAAAA,YAAY,IAAI,IAAIA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQY,gBAAgB,AAAD,KAAMP,aAAaN,MAAMY,EAAE,AAAD,GAAI;QACrH,IAAIE;QACHA,CAAAA,IAAI,AAACtB,CAAAA,UAAUQ,KAAI,CAAE,CAACP,kBAAkB,kBAAkB,AAAD,MAAO,IAAI,IAAIqB,MAAM,KAAK,IAAIA,IAAItB,OAAO,CAACC,gBAAgB,GAA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;IACvG,CAAC;IACD,OAAOxB;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,MAA7BA;IAOIC,oBAAoB,MAApBA;;8BARqB;AAClC,SAASD,8BAA8BE,KAAK,EAAEC,OAAO,EAAE;IAC1D,OAAOF,qBAAqBG,IAAAA,sCAAwB,KAAIF,OAAOC;AACnE;AAKW,SAASF,qBAAqBI,OAAO,EAAEH,KAAK,EAAEC,OAAO,EAAE;IAC9D,IAAI,CAACE,SAAS;QACV,OAAOH;IACX,CAAC;IACD,yDAAyD;IACzDA,QAAQ;QACJ,GAAGA,KAAK;IACZ;IACA,MAAM,EAAEI,mBAAkB,EAAGC,OAAM,EAAGC,SAAQ,EAAGC,QAAO,EAAGC,SAAQ,EAAGC,oBAAmB,EAAGC,gBAAe,EAAG,GAAGP;IACjH,IAAIC,oBAAoB;QACpB,IAAIO;QACJ,IAAIC;QACHA,CAAAA,MAAM,AAACD,CAAAA,SAASX,KAAI,EAAGa,EAAE,AAAD,MAAO,IAAI,IAAID,QAAQ,KAAK,IAAIA,MAAMD,OAAOE,EAAE,GAAGT,kBAAkB;IACjG,CAAC;IACD,4GAA4G;IAC5G,6GAA6G;IAC7G,IAAIG,WAAY,CAAA,CAAEN,CAAAA,YAAY,IAAI,IAAIA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQa,gBAAgB,AA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C;IACL,CAAC;IACD,oDAAoD;IACpD,IAAI3B,YAAY,IAAI,IAAIA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQ6B,YAAY,EAAE;QACxE,IAAIC;QACJ,IAAIC;QACHA,CAAAA,QAAQ,AAACD,CAAAA,UAAU/B,KAAI,EAAGiC,IAAI,AAAD,MAAO,IAAI,IAAID,UAAU,KAAK,IAAIA,QAAQD,QAAQE,IAAI,GAAG9B,QAAQ8B,IAAI;IACvG,CAAC;IACD,OAAOjC;AACX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-field",
3
- "version": "9.1.13",
3
+ "version": "9.1.15",
4
4
  "description": "Fluent UI Field components",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -33,12 +33,12 @@
33
33
  "@fluentui/scripts-tasks": "*"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui/react-context-selector": "^9.1.26",
36
+ "@fluentui/react-context-selector": "^9.1.27",
37
37
  "@fluentui/react-icons": "^2.0.207",
38
- "@fluentui/react-jsx-runtime": "9.0.0-alpha.12",
39
- "@fluentui/react-label": "^9.1.21",
40
- "@fluentui/react-theme": "^9.1.9",
41
- "@fluentui/react-utilities": "^9.10.1",
38
+ "@fluentui/react-jsx-runtime": "9.0.0-alpha.13",
39
+ "@fluentui/react-label": "^9.1.23",
40
+ "@fluentui/react-theme": "^9.1.10",
41
+ "@fluentui/react-utilities": "^9.11.0",
42
42
  "@griffel/react": "^1.5.7",
43
43
  "@swc/helpers": "^0.4.14"
44
44
  },