diff --git a/common/changes/office-ui-fabric-react/magellan-componentIdInternal_2018-02-06-19-27.json b/common/changes/office-ui-fabric-react/magellan-componentIdInternal_2018-02-06-19-27.json new file mode 100644 index 0000000000000..9a84a48ef7d23 --- /dev/null +++ b/common/changes/office-ui-fabric-react/magellan-componentIdInternal_2018-02-06-19-27.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "office-ui-fabric-react", + "comment": "TextField, Panel: Deprecated componentId prop.", + "type": "patch" + } + ], + "packageName": "office-ui-fabric-react", + "email": "law@microsoft.com" +} diff --git a/packages/office-ui-fabric-react/src/components/Panel/Panel.tsx b/packages/office-ui-fabric-react/src/components/Panel/Panel.tsx index baee354cc6acd..f636002b53897 100644 --- a/packages/office-ui-fabric-react/src/components/Panel/Panel.tsx +++ b/packages/office-ui-fabric-react/src/components/Panel/Panel.tsx @@ -102,7 +102,6 @@ export class Panel extends BaseComponent implements IP const isOnRightSide = isRTL ? isLeft : !isLeft; const headerTextId = id + '-headerText'; const customWidthStyles = (type === PanelType.custom) ? { width: customWidth } : {}; - const renderProps: IPanelProps = { ...this.props, componentId: id }; if (!isOpen && !isAnimating && !isHiddenOnDismiss) { return null; @@ -177,12 +176,12 @@ export class Panel extends BaseComponent implements IP isClickableOutsideFocusTrap={ isLightDismiss || isHiddenOnDismiss } >
- { onRenderNavigation(renderProps, this._onRenderNavigation) } + { onRenderNavigation(this.props, this._onRenderNavigation) }
- { onRenderHeader(renderProps, this._onRenderHeader) } - { onRenderBody(renderProps, this._onRenderBody) } - { onRenderFooter(renderProps, this._onRenderFooter) } + { onRenderHeader(this.props, this._onRenderHeader) } + { onRenderBody(this.props, this._onRenderBody) } + { onRenderFooter(this.props, this._onRenderFooter) }
@@ -257,14 +256,17 @@ export class Panel extends BaseComponent implements IP private _onRenderHeader(props: IPanelProps): JSX.Element | null { const { headerText, - componentId, headerClassName = '', } = props; if (headerText) { return (
-

+

{ headerText }

diff --git a/packages/office-ui-fabric-react/src/components/Panel/Panel.types.ts b/packages/office-ui-fabric-react/src/components/Panel/Panel.types.ts index 1e6acd0c9f70f..2c3c2fb065e65 100644 --- a/packages/office-ui-fabric-react/src/components/Panel/Panel.types.ts +++ b/packages/office-ui-fabric-react/src/components/Panel/Panel.types.ts @@ -170,7 +170,8 @@ export interface IPanelProps extends React.Props { onRenderFooterContent?: IRenderFunction; /** - * Internal ID passed to render functions. + * Deprecated property. Serves no function. + * @deprecated */ componentId?: string; } diff --git a/packages/office-ui-fabric-react/src/components/TextField/TextField.tsx b/packages/office-ui-fabric-react/src/components/TextField/TextField.tsx index 8962b4c61e680..960c16338382f 100644 --- a/packages/office-ui-fabric-react/src/components/TextField/TextField.tsx +++ b/packages/office-ui-fabric-react/src/components/TextField/TextField.tsx @@ -3,6 +3,7 @@ import { ITextField, ITextFieldProps } from './TextField.types'; import { Label } from '../../Label'; import { Icon } from '../../Icon'; import { + autobind, DelayedRender, BaseComponent, getId, @@ -153,7 +154,6 @@ export class TextField extends BaseComponent i const { isFocused } = this.state; const errorMessage = this._errorMessage; this._isDescriptionAvailable = Boolean(description || errorMessage); - const renderProps: ITextFieldProps = { ...this.props, componentId: this._id }; const textFieldClassName = css('ms-TextField', styles.root, className, { ['is-required ' + styles.rootIsRequiredLabel]: this.props.label && required, @@ -168,7 +168,7 @@ export class TextField extends BaseComponent i return (
- { onRenderLabel(renderProps, this._onRenderLabel) } + { onRenderLabel(this.props, this._onRenderLabel) }
{ (addonString !== undefined || this.props.onRenderAddon) && (
@@ -292,13 +292,13 @@ export class TextField extends BaseComponent i } } + @autobind private _onRenderLabel(props: ITextFieldProps): JSX.Element | null { const { - label, - componentId + label } = props; if (label) { - return (); + return (); } return null; } diff --git a/packages/office-ui-fabric-react/src/components/TextField/TextField.types.ts b/packages/office-ui-fabric-react/src/components/TextField/TextField.types.ts index 7f32537bc68d4..46cc5f889573d 100644 --- a/packages/office-ui-fabric-react/src/components/TextField/TextField.types.ts +++ b/packages/office-ui-fabric-react/src/components/TextField/TextField.types.ts @@ -222,14 +222,15 @@ export interface ITextFieldProps extends React.AllHTMLAttributes