@fluentui/react-aria
Advanced tools
Comparing version 9.0.0-alpha.29 to 9.0.0-alpha.30
@@ -5,3 +5,18 @@ { | ||
{ | ||
"date": "Fri, 10 Sep 2021 16:29:54 GMT", | ||
"date": "Tue, 14 Sep 2021 07:36:50 GMT", | ||
"tag": "@fluentui/react-aria_v9.0.0-alpha.30", | ||
"version": "9.0.0-alpha.30", | ||
"comments": { | ||
"prerelease": [ | ||
{ | ||
"author": "bsunderhus@microsoft.com", | ||
"package": "@fluentui/react-aria", | ||
"comment": "Generalize mergeARIADisabled", | ||
"commit": "1d97d1752c38810528e9a499876788fe4e6b98aa" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Fri, 10 Sep 2021 16:31:53 GMT", | ||
"tag": "@fluentui/react-aria_v9.0.0-alpha.29", | ||
@@ -8,0 +23,0 @@ "version": "9.0.0-alpha.29", |
# Change Log - @fluentui/react-aria | ||
This log was last generated on Fri, 10 Sep 2021 16:29:54 GMT and should not be manually modified. | ||
This log was last generated on Tue, 14 Sep 2021 07:36:50 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## [9.0.0-alpha.30](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.0.0-alpha.30) | ||
Tue, 14 Sep 2021 07:36:50 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.0.0-alpha.29..@fluentui/react-aria_v9.0.0-alpha.30) | ||
### Changes | ||
- Generalize mergeARIADisabled ([PR #19760](https://github.com/microsoft/fluentui/pull/19760) by bsunderhus@microsoft.com) | ||
## [9.0.0-alpha.29](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.0.0-alpha.29) | ||
Fri, 10 Sep 2021 16:29:54 GMT | ||
Fri, 10 Sep 2021 16:31:53 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.0.0-alpha.28..@fluentui/react-aria_v9.0.0-alpha.29) | ||
@@ -11,0 +20,0 @@ |
import type { IntrinsicShorthandProps } from '@fluentui/react-utilities'; | ||
import { ObjectShorthandProps } from '@fluentui/react-utilities'; | ||
import * as React_2 from 'react'; | ||
import type { ResolveShorthandOptions } from '@fluentui/react-utilities'; | ||
@@ -8,2 +10,11 @@ import type { ShorthandProps } from '@fluentui/react-utilities'; | ||
/** | ||
* Merges disabled declaration with `aria-disabled` | ||
*/ | ||
export declare function mergeARIADisabled(shorthand: ObjectShorthandProps<{ | ||
disabled?: boolean; | ||
'aria-disabled'?: string | boolean; | ||
children?: React_2.ReactNode; | ||
}>): boolean; | ||
/** | ||
* button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec | ||
@@ -10,0 +21,0 @@ * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases |
@@ -1,11 +0,5 @@ | ||
define(["require", "exports", "@fluentui/keyboard-keys", "@fluentui/react-utilities"], function (require, exports, keyboard_keys_1, react_utilities_1) { | ||
define(["require", "exports", "@fluentui/keyboard-keys", "@fluentui/react-utilities", "../utils/index"], function (require, exports, keyboard_keys_1, react_utilities_1, index_1) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useARIAButton = void 0; | ||
function mergeARIADisabled(disabled) { | ||
if (typeof disabled === 'string') { | ||
return disabled === 'false' ? false : true; | ||
} | ||
return disabled !== null && disabled !== void 0 ? disabled : false; | ||
} | ||
/** | ||
@@ -17,7 +11,5 @@ * button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec | ||
function useARIAButton(value, options) { | ||
var _a; | ||
var shorthand = react_utilities_1.resolveShorthand(value, options); | ||
var _b = (shorthand || | ||
{}), onClick = _b.onClick, onKeyDown = _b.onKeyDown, onKeyUp = _b.onKeyUp, ariaDisabled = _b["aria-disabled"]; | ||
var disabled = mergeARIADisabled((_a = (shorthand && shorthand.as === 'button' ? shorthand.disabled : undefined)) !== null && _a !== void 0 ? _a : ariaDisabled); | ||
var _a = (shorthand || {}), onClick = _a.onClick, onKeyDown = _a.onKeyDown, onKeyUp = _a.onKeyUp; | ||
var disabled = index_1.mergeARIADisabled(shorthand); | ||
var onClickHandler = react_utilities_1.useEventCallback(function (ev) { | ||
@@ -24,0 +16,0 @@ if (disabled) { |
export * from './hooks/index'; | ||
export * from './utils/index'; |
@@ -1,6 +0,7 @@ | ||
define(["require", "exports", "tslib", "./hooks/index"], function (require, exports, tslib_1, index_1) { | ||
define(["require", "exports", "tslib", "./hooks/index", "./utils/index"], function (require, exports, tslib_1, index_1, index_2) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
tslib_1.__exportStar(index_1, exports); | ||
tslib_1.__exportStar(index_2, exports); | ||
}); | ||
//# sourceMappingURL=index.js.map |
@@ -12,9 +12,3 @@ "use strict"; | ||
function mergeARIADisabled(disabled) { | ||
if (typeof disabled === 'string') { | ||
return disabled === 'false' ? false : true; | ||
} | ||
return disabled !== null && disabled !== void 0 ? disabled : false; | ||
} | ||
var index_1 = /*#__PURE__*/require("../utils/index"); | ||
/** | ||
@@ -28,13 +22,10 @@ * button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec | ||
function useARIAButton(value, options) { | ||
var _a; | ||
var shorthand = react_utilities_1.resolveShorthand(value, options); | ||
var _b = shorthand || {}, | ||
onClick = _b.onClick, | ||
onKeyDown = _b.onKeyDown, | ||
onKeyUp = _b.onKeyUp, | ||
ariaDisabled = _b["aria-disabled"]; | ||
var _a = shorthand || {}, | ||
onClick = _a.onClick, | ||
onKeyDown = _a.onKeyDown, | ||
onKeyUp = _a.onKeyUp; | ||
var disabled = mergeARIADisabled((_a = shorthand && shorthand.as === 'button' ? shorthand.disabled : undefined) !== null && _a !== void 0 ? _a : ariaDisabled); | ||
var disabled = index_1.mergeARIADisabled(shorthand); | ||
var onClickHandler = react_utilities_1.useEventCallback(function (ev) { | ||
@@ -41,0 +32,0 @@ if (disabled) { |
export * from './hooks/index'; | ||
export * from './utils/index'; |
@@ -10,2 +10,4 @@ "use strict"; | ||
tslib_1.__exportStar(require("./hooks/index"), exports); | ||
tslib_1.__exportStar(require("./utils/index"), exports); | ||
//# sourceMappingURL=index.js.map |
import { Enter, Space } from '@fluentui/keyboard-keys'; | ||
import { resolveShorthand, useEventCallback } from '@fluentui/react-utilities'; | ||
function mergeARIADisabled(disabled) { | ||
if (typeof disabled === 'string') { | ||
return disabled === 'false' ? false : true; | ||
} | ||
return disabled !== null && disabled !== void 0 ? disabled : false; | ||
} | ||
import { mergeARIADisabled } from '../utils/index'; | ||
/** | ||
@@ -17,15 +10,11 @@ * button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec | ||
export function useARIAButton(value, options) { | ||
var _a; | ||
var shorthand = resolveShorthand(value, options); | ||
var _b = shorthand || {}, | ||
onClick = _b.onClick, | ||
onKeyDown = _b.onKeyDown, | ||
onKeyUp = _b.onKeyUp, | ||
ariaDisabled = _b["aria-disabled"]; | ||
var _a = shorthand || {}, | ||
onClick = _a.onClick, | ||
onKeyDown = _a.onKeyDown, | ||
onKeyUp = _a.onKeyUp; | ||
var disabled = mergeARIADisabled((_a = shorthand && shorthand.as === 'button' ? shorthand.disabled : undefined) !== null && _a !== void 0 ? _a : ariaDisabled); | ||
var disabled = mergeARIADisabled(shorthand); | ||
var onClickHandler = useEventCallback(function (ev) { | ||
@@ -32,0 +21,0 @@ if (disabled) { |
export * from './hooks/index'; | ||
export * from './utils/index'; |
export * from './hooks/index'; | ||
export * from './utils/index'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@fluentui/react-aria", | ||
"version": "9.0.0-alpha.29", | ||
"version": "9.0.0-alpha.30", | ||
"description": "React helper to ensure ARIA", | ||
@@ -5,0 +5,0 @@ "main": "lib-commonjs/index.js", |
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
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
83789
53
1134