@fluentui/react-utilities
Advanced tools
Comparing version 9.0.0-beta.3 to 9.0.0-beta.4
@@ -5,3 +5,26 @@ { | ||
{ | ||
"date": "Fri, 12 Nov 2021 12:33:48 GMT", | ||
"date": "Thu, 25 Nov 2021 08:31:27 GMT", | ||
"tag": "@fluentui/react-utilities_v9.0.0-beta.4", | ||
"version": "9.0.0-beta.4", | ||
"comments": { | ||
"none": [ | ||
{ | ||
"author": "lingfangao@hotmail.com", | ||
"package": "@fluentui/react-utilities", | ||
"commit": "718e63006d8d07d24efab9c32942041963d78dc7", | ||
"comment": "Migrate package to use solution style ts-configs" | ||
} | ||
], | ||
"prerelease": [ | ||
{ | ||
"author": "behowell@microsoft.com", | ||
"package": "@fluentui/react-utilities", | ||
"commit": "99adff5a9aab9086e8bc4737040654ab23f0febe", | ||
"comment": "Update utility types to support specifying a primary slot other than root" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Fri, 12 Nov 2021 13:25:10 GMT", | ||
"tag": "@fluentui/react-utilities_v9.0.0-beta.3", | ||
@@ -8,0 +31,0 @@ "version": "9.0.0-beta.3", |
# Change Log - @fluentui/react-utilities | ||
This log was last generated on Fri, 12 Nov 2021 12:33:48 GMT and should not be manually modified. | ||
This log was last generated on Thu, 25 Nov 2021 08:31:27 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.0.0-beta.4) | ||
Thu, 25 Nov 2021 08:31:27 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.0.0-beta.3..@fluentui/react-utilities_v9.0.0-beta.4) | ||
### Changes | ||
- Update utility types to support specifying a primary slot other than root ([PR #20617](https://github.com/microsoft/fluentui/pull/20617) by behowell@microsoft.com) | ||
## [9.0.0-beta.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.0.0-beta.3) | ||
Fri, 12 Nov 2021 12:33:48 GMT | ||
Fri, 12 Nov 2021 13:25:10 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.0.0-beta.2..@fluentui/react-utilities_v9.0.0-beta.3) | ||
@@ -11,0 +20,0 @@ |
@@ -78,3 +78,3 @@ import { DispatchWithoutAction } from 'react'; | ||
[Key in keyof Shorthands]?: ShorthandProps<NonNullable<Shorthands[Key]>>; | ||
}, Primary> & PropsWithoutRef<Shorthands[Primary]>; | ||
}, Primary & 'root'> & PropsWithoutRef<Shorthands[Primary]>; | ||
@@ -93,4 +93,3 @@ export declare type ComponentState<Shorthands extends ObjectShorthandPropsRecord> = { | ||
*/ | ||
export declare type DefaultObjectShorthandProps = ObjectShorthandProps<{ | ||
children?: React_2.ReactNode; | ||
export declare type DefaultObjectShorthandProps = ObjectShorthandProps<Pick<React_2.HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'> & { | ||
as?: keyof JSX.IntrinsicElements; | ||
@@ -156,2 +155,25 @@ }>; | ||
/** | ||
* Splits the native props into ones that go to the `root` slot, and ones that go to the primary slot. | ||
* | ||
* This function is only for use with components that have a primary slot other than `root`. | ||
* Most components should use {@link getNativeElementProps} for their root slot if it is the primary slot. | ||
* | ||
* @returns An object containing the native props for the `root` and primary slots. | ||
*/ | ||
export declare const getPartitionedNativeProps: ({ primarySlotTagName, props, excludedPropNames, }: { | ||
/** The primary slot's element type (e.g. 'div') */ | ||
primarySlotTagName: keyof JSX.IntrinsicElements; | ||
/** The component's props object */ | ||
props: Pick<React_2.HTMLAttributes<HTMLElement>, 'style' | 'className'>; | ||
/** List of native props to exclude from the returned value */ | ||
excludedPropNames?: string[] | undefined; | ||
}) => { | ||
root: { | ||
style: React_2.CSSProperties | undefined; | ||
className: string | undefined; | ||
}; | ||
primary: React_2.HTMLAttributes<any>; | ||
}; | ||
/** | ||
* Finds and swaps a provided key for it's right to left format. | ||
@@ -158,0 +180,0 @@ */ |
@@ -11,4 +11,3 @@ import * as React from 'react'; | ||
*/ | ||
export declare type DefaultObjectShorthandProps = ObjectShorthandProps<{ | ||
children?: React.ReactNode; | ||
export declare type DefaultObjectShorthandProps = ObjectShorthandProps<Pick<React.HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'> & { | ||
as?: keyof JSX.IntrinsicElements; | ||
@@ -82,3 +81,3 @@ }>; | ||
[Key in keyof Shorthands]?: ShorthandProps<NonNullable<Shorthands[Key]>>; | ||
}, Primary> & PropsWithoutRef<Shorthands[Primary]>; | ||
}, Primary & 'root'> & PropsWithoutRef<Shorthands[Primary]>; | ||
export declare type ComponentState<Shorthands extends ObjectShorthandPropsRecord> = { | ||
@@ -85,0 +84,0 @@ components?: { |
@@ -10,1 +10,23 @@ import * as React from 'react'; | ||
export declare function getNativeElementProps<TAttributes extends React.HTMLAttributes<any>>(tagName: string, props: {}, excludedPropNames?: string[]): TAttributes; | ||
/** | ||
* Splits the native props into ones that go to the `root` slot, and ones that go to the primary slot. | ||
* | ||
* This function is only for use with components that have a primary slot other than `root`. | ||
* Most components should use {@link getNativeElementProps} for their root slot if it is the primary slot. | ||
* | ||
* @returns An object containing the native props for the `root` and primary slots. | ||
*/ | ||
export declare const getPartitionedNativeProps: ({ primarySlotTagName, props, excludedPropNames, }: { | ||
/** The primary slot's element type (e.g. 'div') */ | ||
primarySlotTagName: keyof JSX.IntrinsicElements; | ||
/** The component's props object */ | ||
props: Pick<React.HTMLAttributes<HTMLElement>, 'style' | 'className'>; | ||
/** List of native props to exclude from the returned value */ | ||
excludedPropNames?: string[] | undefined; | ||
}) => { | ||
root: { | ||
style: React.CSSProperties | undefined; | ||
className: string | undefined; | ||
}; | ||
primary: React.HTMLAttributes<any>; | ||
}; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.getNativeElementProps = void 0; | ||
exports.getPartitionedNativeProps = exports.getNativeElementProps = void 0; | ||
@@ -49,2 +49,26 @@ const properties_1 = /*#__PURE__*/require("./properties"); | ||
exports.getNativeElementProps = getNativeElementProps; | ||
/** | ||
* Splits the native props into ones that go to the `root` slot, and ones that go to the primary slot. | ||
* | ||
* This function is only for use with components that have a primary slot other than `root`. | ||
* Most components should use {@link getNativeElementProps} for their root slot if it is the primary slot. | ||
* | ||
* @returns An object containing the native props for the `root` and primary slots. | ||
*/ | ||
const getPartitionedNativeProps = ({ | ||
primarySlotTagName, | ||
props, | ||
excludedPropNames | ||
}) => { | ||
return { | ||
root: { | ||
style: props.style, | ||
className: props.className | ||
}, | ||
primary: getNativeElementProps(primarySlotTagName, props, [...(excludedPropNames || []), 'style', 'className']) | ||
}; | ||
}; | ||
exports.getPartitionedNativeProps = getPartitionedNativeProps; | ||
//# sourceMappingURL=getNativeElementProps.js.map |
@@ -11,4 +11,3 @@ import * as React from 'react'; | ||
*/ | ||
export declare type DefaultObjectShorthandProps = ObjectShorthandProps<{ | ||
children?: React.ReactNode; | ||
export declare type DefaultObjectShorthandProps = ObjectShorthandProps<Pick<React.HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'> & { | ||
as?: keyof JSX.IntrinsicElements; | ||
@@ -82,3 +81,3 @@ }>; | ||
[Key in keyof Shorthands]?: ShorthandProps<NonNullable<Shorthands[Key]>>; | ||
}, Primary> & PropsWithoutRef<Shorthands[Primary]>; | ||
}, Primary & 'root'> & PropsWithoutRef<Shorthands[Primary]>; | ||
export declare type ComponentState<Shorthands extends ObjectShorthandPropsRecord> = { | ||
@@ -85,0 +84,0 @@ components?: { |
@@ -10,1 +10,23 @@ import * as React from 'react'; | ||
export declare function getNativeElementProps<TAttributes extends React.HTMLAttributes<any>>(tagName: string, props: {}, excludedPropNames?: string[]): TAttributes; | ||
/** | ||
* Splits the native props into ones that go to the `root` slot, and ones that go to the primary slot. | ||
* | ||
* This function is only for use with components that have a primary slot other than `root`. | ||
* Most components should use {@link getNativeElementProps} for their root slot if it is the primary slot. | ||
* | ||
* @returns An object containing the native props for the `root` and primary slots. | ||
*/ | ||
export declare const getPartitionedNativeProps: ({ primarySlotTagName, props, excludedPropNames, }: { | ||
/** The primary slot's element type (e.g. 'div') */ | ||
primarySlotTagName: keyof JSX.IntrinsicElements; | ||
/** The component's props object */ | ||
props: Pick<React.HTMLAttributes<HTMLElement>, 'style' | 'className'>; | ||
/** List of native props to exclude from the returned value */ | ||
excludedPropNames?: string[] | undefined; | ||
}) => { | ||
root: { | ||
style: React.CSSProperties | undefined; | ||
className: string | undefined; | ||
}; | ||
primary: React.HTMLAttributes<any>; | ||
}; |
@@ -38,2 +38,24 @@ import { labelProperties, audioProperties, videoProperties, olProperties, liProperties, anchorProperties, buttonProperties, inputProperties, textAreaProperties, selectProperties, optionProperties, tableProperties, trProperties, thProperties, tdProperties, colGroupProperties, colProperties, formProperties, iframeProperties, imgProperties, htmlElementProperties, getNativeProps } from './properties'; | ||
} | ||
/** | ||
* Splits the native props into ones that go to the `root` slot, and ones that go to the primary slot. | ||
* | ||
* This function is only for use with components that have a primary slot other than `root`. | ||
* Most components should use {@link getNativeElementProps} for their root slot if it is the primary slot. | ||
* | ||
* @returns An object containing the native props for the `root` and primary slots. | ||
*/ | ||
export const getPartitionedNativeProps = ({ | ||
primarySlotTagName, | ||
props, | ||
excludedPropNames | ||
}) => { | ||
return { | ||
root: { | ||
style: props.style, | ||
className: props.className | ||
}, | ||
primary: getNativeElementProps(primarySlotTagName, props, [...(excludedPropNames || []), 'style', 'className']) | ||
}; | ||
}; | ||
//# sourceMappingURL=getNativeElementProps.js.map |
{ | ||
"name": "@fluentui/react-utilities", | ||
"version": "9.0.0-beta.3", | ||
"version": "9.0.0-beta.4", | ||
"description": "A set of general React-specific utilities.", | ||
@@ -23,5 +23,5 @@ "main": "lib-commonjs/index.js", | ||
"docs": "api-extractor run --config=config/api-extractor.local.json --local", | ||
"build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/react-utilities/src && yarn docs", | ||
"storybook": "start-storybook", | ||
"start": "yarn storybook" | ||
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-utilities/src && yarn docs", | ||
"start": "yarn storybook", | ||
"type-check": "tsc -b tsconfig.json" | ||
}, | ||
@@ -28,0 +28,0 @@ "devDependencies": { |
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
332710
5712