@fluentui/react-field
Advanced tools
Comparing version 0.0.0-nightly-20221122-0421.1 to 0.0.0-nightly-20221123-0420.1
@@ -5,5 +5,5 @@ { | ||
{ | ||
"date": "Tue, 22 Nov 2022 04:28:11 GMT", | ||
"tag": "@fluentui/react-field_v0.0.0-nightly-20221122-0421.1", | ||
"version": "0.0.0-nightly-20221122-0421.1", | ||
"date": "Wed, 23 Nov 2022 04:26:57 GMT", | ||
"tag": "@fluentui/react-field_v0.0.0-nightly-20221123-0420.1", | ||
"version": "0.0.0-nightly-20221123-0420.1", | ||
"comments": { | ||
@@ -20,4 +20,4 @@ "prerelease": [ | ||
"package": "@fluentui/react-field", | ||
"comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-20221122-0421.1", | ||
"commit": "8a09fe689339bbfc40840f7616ab03d329f2ef1f" | ||
"comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-20221123-0420.1", | ||
"commit": "f3b8131aa7d2f3337e614e3a6069e67a608b1ab6" | ||
}, | ||
@@ -27,4 +27,4 @@ { | ||
"package": "@fluentui/react-field", | ||
"comment": "Bump @fluentui/react-label to v0.0.0-nightly-20221122-0421.1", | ||
"commit": "8a09fe689339bbfc40840f7616ab03d329f2ef1f" | ||
"comment": "Bump @fluentui/react-label to v0.0.0-nightly-20221123-0420.1", | ||
"commit": "f3b8131aa7d2f3337e614e3a6069e67a608b1ab6" | ||
}, | ||
@@ -34,4 +34,4 @@ { | ||
"package": "@fluentui/react-field", | ||
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20221122-0421.1", | ||
"commit": "8a09fe689339bbfc40840f7616ab03d329f2ef1f" | ||
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20221123-0420.1", | ||
"commit": "f3b8131aa7d2f3337e614e3a6069e67a608b1ab6" | ||
}, | ||
@@ -41,4 +41,4 @@ { | ||
"package": "@fluentui/react-field", | ||
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20221122-0421.1", | ||
"commit": "8a09fe689339bbfc40840f7616ab03d329f2ef1f" | ||
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20221123-0420.1", | ||
"commit": "f3b8131aa7d2f3337e614e3a6069e67a608b1ab6" | ||
}, | ||
@@ -48,4 +48,4 @@ { | ||
"package": "@fluentui/react-field", | ||
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20221122-0421.1", | ||
"commit": "8a09fe689339bbfc40840f7616ab03d329f2ef1f" | ||
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20221123-0420.1", | ||
"commit": "f3b8131aa7d2f3337e614e3a6069e67a608b1ab6" | ||
} | ||
@@ -52,0 +52,0 @@ ] |
# Change Log - @fluentui/react-field | ||
This log was last generated on Tue, 22 Nov 2022 04:28:11 GMT and should not be manually modified. | ||
This log was last generated on Wed, 23 Nov 2022 04:26:57 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## [0.0.0-nightly-20221122-0421.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v0.0.0-nightly-20221122-0421.1) | ||
## [0.0.0-nightly-20221123-0420.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v0.0.0-nightly-20221123-0420.1) | ||
Tue, 22 Nov 2022 04:28:11 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.0.0-alpha.9..@fluentui/react-field_v0.0.0-nightly-20221122-0421.1) | ||
Wed, 23 Nov 2022 04:26:57 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.0.0-alpha.9..@fluentui/react-field_v0.0.0-nightly-20221123-0420.1) | ||
@@ -15,7 +15,7 @@ ### Changes | ||
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com) | ||
- Bump @fluentui/react-context-selector to v0.0.0-nightly-20221122-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/8a09fe689339bbfc40840f7616ab03d329f2ef1f) by beachball) | ||
- Bump @fluentui/react-label to v0.0.0-nightly-20221122-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/8a09fe689339bbfc40840f7616ab03d329f2ef1f) by beachball) | ||
- Bump @fluentui/react-theme to v0.0.0-nightly-20221122-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/8a09fe689339bbfc40840f7616ab03d329f2ef1f) by beachball) | ||
- Bump @fluentui/react-utilities to v0.0.0-nightly-20221122-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/8a09fe689339bbfc40840f7616ab03d329f2ef1f) by beachball) | ||
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20221122-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/8a09fe689339bbfc40840f7616ab03d329f2ef1f) by beachball) | ||
- Bump @fluentui/react-context-selector to v0.0.0-nightly-20221123-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/f3b8131aa7d2f3337e614e3a6069e67a608b1ab6) by beachball) | ||
- Bump @fluentui/react-label to v0.0.0-nightly-20221123-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/f3b8131aa7d2f3337e614e3a6069e67a608b1ab6) by beachball) | ||
- Bump @fluentui/react-theme to v0.0.0-nightly-20221123-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/f3b8131aa7d2f3337e614e3a6069e67a608b1ab6) by beachball) | ||
- Bump @fluentui/react-utilities to v0.0.0-nightly-20221123-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/f3b8131aa7d2f3337e614e3a6069e67a608b1ab6) by beachball) | ||
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20221123-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/f3b8131aa7d2f3337e614e3a6069e67a608b1ab6) by beachball) | ||
@@ -22,0 +22,0 @@ ## [9.0.0-alpha.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.0.0-alpha.9) |
@@ -35,3 +35,3 @@ /// <reference types="react" /> | ||
/** | ||
* Should the aria-invalid and aria-errormessage attributes be set when validationState="error". | ||
* Should the aria-invalid attribute be set when validationState="error". | ||
* | ||
@@ -49,3 +49,3 @@ * @default true | ||
*/ | ||
export declare type FieldControl = React_2.VoidFunctionComponent<Pick<React_2.HTMLAttributes<HTMLElement>, 'id' | 'className' | 'style' | 'aria-labelledby' | 'aria-describedby' | 'aria-invalid' | 'aria-errormessage'>>; | ||
export declare type FieldControl = React_2.VoidFunctionComponent<Pick<React_2.HTMLAttributes<HTMLElement>, 'id' | 'className' | 'style' | 'aria-labelledby' | 'aria-describedby' | 'aria-invalid'>>; | ||
@@ -81,2 +81,6 @@ /** | ||
/** | ||
* A ref to the underlying control. | ||
*/ | ||
ref?: React_2.Ref<HTMLElement>; | ||
/** | ||
* Whether the field label should be marked as required. | ||
@@ -83,0 +87,0 @@ */ |
@@ -67,3 +67,3 @@ "use strict"; | ||
const useField_unstable = (props, ref, params) => { | ||
var _a, _b, _c, _d, _e; | ||
var _a, _b, _c; | ||
@@ -84,10 +84,2 @@ const [fieldProps, controlProps] = exports.getPartitionedFieldProps(props); | ||
}); | ||
const control = react_utilities_1.resolveShorthand(fieldProps.control, { | ||
required: true, | ||
defaultProps: { | ||
ref, | ||
id: baseId + '__control', | ||
...controlProps | ||
} | ||
}); | ||
const label = react_utilities_1.resolveShorthand(fieldProps.label, { | ||
@@ -97,4 +89,4 @@ defaultProps: { | ||
required: controlProps.required, | ||
size: typeof controlProps.size === 'string' ? controlProps.size : undefined, | ||
htmlFor: labelConnection === 'htmlFor' ? control.id : undefined | ||
size: typeof controlProps.size === 'string' ? controlProps.size : undefined // htmlFor is handled below | ||
} | ||
@@ -120,22 +112,27 @@ }); | ||
if (label && labelConnection === 'aria-labelledby') { | ||
(_a = control['aria-labelledby']) !== null && _a !== void 0 ? _a : control['aria-labelledby'] = label.id; | ||
(_a = controlProps['aria-labelledby']) !== null && _a !== void 0 ? _a : controlProps['aria-labelledby'] = label.id; | ||
} | ||
if (validationMessage || hint) { | ||
// The control is described by the validation message, or hint, or both | ||
// We also preserve and append any aria-describedby supplied by the user | ||
// For reference: https://github.com/microsoft/fluentui/pull/25580#discussion_r1017259933 | ||
controlProps['aria-describedby'] = [validationMessage === null || validationMessage === void 0 ? void 0 : validationMessage.id, hint === null || hint === void 0 ? void 0 : hint.id, controlProps['aria-describedby']].filter(Boolean).join(' '); | ||
} | ||
if (validationState === 'error' && ariaInvalidOnError) { | ||
(_b = control['aria-invalid']) !== null && _b !== void 0 ? _b : control['aria-invalid'] = true; | ||
(_b = controlProps['aria-invalid']) !== null && _b !== void 0 ? _b : controlProps['aria-invalid'] = true; | ||
} | ||
if (validationMessage) { | ||
(_c = control['aria-errormessage']) !== null && _c !== void 0 ? _c : control['aria-errormessage'] = validationMessage.id; | ||
const control = react_utilities_1.resolveShorthand(fieldProps.control, { | ||
required: true, | ||
defaultProps: { | ||
ref, | ||
id: baseId + '__control', | ||
...controlProps | ||
} | ||
}); | ||
if (hint) { | ||
(_d = control['aria-describedby']) !== null && _d !== void 0 ? _d : control['aria-describedby'] = hint.id; | ||
} | ||
} else { | ||
// If the state is not an error, then the control is described by the validation message, or hint, or both | ||
const describedby = validationMessage || hint; | ||
if (describedby) { | ||
(_e = control['aria-describedby']) !== null && _e !== void 0 ? _e : control['aria-describedby'] = validationMessage && hint ? `${validationMessage.id} ${hint.id}` : describedby.id; | ||
} | ||
if (label && labelConnection === 'htmlFor') { | ||
(_c = label.htmlFor) !== null && _c !== void 0 ? _c : label.htmlFor = control.id; | ||
} | ||
@@ -142,0 +139,0 @@ |
@@ -54,3 +54,3 @@ import * as React from 'react'; | ||
export const useField_unstable = (props, ref, params) => { | ||
var _a, _b, _c, _d, _e; | ||
var _a, _b, _c; | ||
@@ -71,10 +71,2 @@ const [fieldProps, controlProps] = getPartitionedFieldProps(props); | ||
}); | ||
const control = resolveShorthand(fieldProps.control, { | ||
required: true, | ||
defaultProps: { | ||
ref, | ||
id: baseId + '__control', | ||
...controlProps | ||
} | ||
}); | ||
const label = resolveShorthand(fieldProps.label, { | ||
@@ -84,4 +76,4 @@ defaultProps: { | ||
required: controlProps.required, | ||
size: typeof controlProps.size === 'string' ? controlProps.size : undefined, | ||
htmlFor: labelConnection === 'htmlFor' ? control.id : undefined | ||
size: typeof controlProps.size === 'string' ? controlProps.size : undefined // htmlFor is handled below | ||
} | ||
@@ -107,22 +99,27 @@ }); | ||
if (label && labelConnection === 'aria-labelledby') { | ||
(_a = control['aria-labelledby']) !== null && _a !== void 0 ? _a : control['aria-labelledby'] = label.id; | ||
(_a = controlProps['aria-labelledby']) !== null && _a !== void 0 ? _a : controlProps['aria-labelledby'] = label.id; | ||
} | ||
if (validationMessage || hint) { | ||
// The control is described by the validation message, or hint, or both | ||
// We also preserve and append any aria-describedby supplied by the user | ||
// For reference: https://github.com/microsoft/fluentui/pull/25580#discussion_r1017259933 | ||
controlProps['aria-describedby'] = [validationMessage === null || validationMessage === void 0 ? void 0 : validationMessage.id, hint === null || hint === void 0 ? void 0 : hint.id, controlProps['aria-describedby']].filter(Boolean).join(' '); | ||
} | ||
if (validationState === 'error' && ariaInvalidOnError) { | ||
(_b = control['aria-invalid']) !== null && _b !== void 0 ? _b : control['aria-invalid'] = true; | ||
(_b = controlProps['aria-invalid']) !== null && _b !== void 0 ? _b : controlProps['aria-invalid'] = true; | ||
} | ||
if (validationMessage) { | ||
(_c = control['aria-errormessage']) !== null && _c !== void 0 ? _c : control['aria-errormessage'] = validationMessage.id; | ||
const control = resolveShorthand(fieldProps.control, { | ||
required: true, | ||
defaultProps: { | ||
ref, | ||
id: baseId + '__control', | ||
...controlProps | ||
} | ||
}); | ||
if (hint) { | ||
(_d = control['aria-describedby']) !== null && _d !== void 0 ? _d : control['aria-describedby'] = hint.id; | ||
} | ||
} else { | ||
// If the state is not an error, then the control is described by the validation message, or hint, or both | ||
const describedby = validationMessage || hint; | ||
if (describedby) { | ||
(_e = control['aria-describedby']) !== null && _e !== void 0 ? _e : control['aria-describedby'] = validationMessage && hint ? `${validationMessage.id} ${hint.id}` : describedby.id; | ||
} | ||
if (label && labelConnection === 'htmlFor') { | ||
(_c = label.htmlFor) !== null && _c !== void 0 ? _c : label.htmlFor = control.id; | ||
} | ||
@@ -129,0 +126,0 @@ |
{ | ||
"name": "@fluentui/react-field", | ||
"version": "0.0.0-nightly-20221122-0421.1", | ||
"version": "0.0.0-nightly-20221123-0420.1", | ||
"description": "Fluent UI Field components", | ||
@@ -29,11 +29,11 @@ "main": "lib-commonjs/index.js", | ||
"@fluentui/react-conformance": "*", | ||
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20221122-0421.1", | ||
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20221123-0420.1", | ||
"@fluentui/scripts": "^1.0.0" | ||
}, | ||
"dependencies": { | ||
"@fluentui/react-context-selector": "0.0.0-nightly-20221122-0421.1", | ||
"@fluentui/react-context-selector": "0.0.0-nightly-20221123-0420.1", | ||
"@fluentui/react-icons": "^2.0.175", | ||
"@fluentui/react-label": "0.0.0-nightly-20221122-0421.1", | ||
"@fluentui/react-theme": "0.0.0-nightly-20221122-0421.1", | ||
"@fluentui/react-utilities": "0.0.0-nightly-20221122-0421.1", | ||
"@fluentui/react-label": "0.0.0-nightly-20221123-0420.1", | ||
"@fluentui/react-theme": "0.0.0-nightly-20221123-0420.1", | ||
"@fluentui/react-utilities": "0.0.0-nightly-20221123-0420.1", | ||
"@griffel/react": "^1.4.2", | ||
@@ -40,0 +40,0 @@ "tslib": "^2.1.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
136883
1517
+ Added@fluentui/keyboard-keys@0.0.0-nightly-20221123-0420.1(transitive)
+ Added@fluentui/react-context-selector@0.0.0-nightly-20221123-0420.1(transitive)
+ Added@fluentui/react-label@0.0.0-nightly-20221123-0420.1(transitive)
+ Added@fluentui/react-theme@0.0.0-nightly-20221123-0420.1(transitive)
+ Added@fluentui/react-utilities@0.0.0-nightly-20221123-0420.1(transitive)
- Removed@fluentui/keyboard-keys@0.0.0-nightly-20221122-0421.1(transitive)
- Removed@fluentui/react-context-selector@0.0.0-nightly-20221122-0421.1(transitive)
- Removed@fluentui/react-label@0.0.0-nightly-20221122-0421.1(transitive)
- Removed@fluentui/react-theme@0.0.0-nightly-20221122-0421.1(transitive)
- Removed@fluentui/react-utilities@0.0.0-nightly-20221122-0421.1(transitive)
Updated@fluentui/react-context-selector@0.0.0-nightly-20221123-0420.1
Updated@fluentui/react-utilities@0.0.0-nightly-20221123-0420.1