Skip to content

Commit

Permalink
fix(project): revert accidental public api changes (#9563)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
joshblack and kodiakhq[bot] authored Aug 30, 2021
1 parent 713f558 commit 3293dda
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 33 deletions.
22 changes: 11 additions & 11 deletions packages/components/demo/js/data-table-demo-expand-all-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@ class DataTableDemoExpandRowAllManager extends mixin(
handles
) {
/**
* The row expand handler for data table "expand all" feature demo.
* The row expando handler for data table "expand all" feature demo.
* @extends CreateComponent
* @extends InitComponentByEvent
* @extends Handles
* @param {HTMLElement} element The element working as the button for data table "expand all" feature demo.
* @param {Object} [options] The component options.
* @param {string} [options.selectorExpandHeader] The CSS selector to find the header expand button.
* @param {string} [options.selectorExpandCells] The CSS selector to find the row expand button.
* @param {string} [options.selectorExpandHeader] The CSS selector to find the header expando button.
* @param {string} [options.selectorExpandCells] The CSS selector to find the row expando button.
* @param {string} [options.selectorExpandCellsExpanded]
* The CSS selector to find the row expand button with its expanded state.
* The CSS selector to find the row expando button with its expanded state.
*/
constructor(element, options) {
super(element, options);
this.manage(on(element, 'click', this._handleClickRowExpand));
this.manage(on(element, 'click', this._handleClickRowExpando));
}

/**
* A method called when this widget is created upon events.
* @param {Event} event The event triggering the creation.
*/
createdByEvent(event) {
this._handleClickRowExpand(event);
this._handleClickRowExpando(event);
}

/**
* Handles `click` event on the row expand button.
* @private
*/
_handleClickRowExpand = () => {
_handleClickRowExpando = () => {
if (
this.element.querySelectorAll(this.options.selectorExpandCells).length ===
this.element.querySelectorAll(this.options.selectorExpandCellsExpanded)
Expand All @@ -66,10 +66,10 @@ class DataTableDemoExpandRowAllManager extends mixin(
* and how {@linkcode DataTableDemoExpandRowAllManager.init .init()} works.
* @member DataTableDemoExpandRowAllManager.options
* @type {Object}
* @property {string} selectorInit The CSS selector to find the row expand handler for data table "expand all" feature demo.
* @property {string} [selectorExpandHeader] The CSS selector to find the header expand button.
* @property {string} [selectorExpandCells] The CSS selector to find the row expand button.
* @property {string} [selectorExpandCellsExpanded] The CSS selector to find the row expand button with its expanded state.
* @property {string} selectorInit The CSS selector to find the row expando handler for data table "expand all" feature demo.
* @property {string} [selectorExpandHeader] The CSS selector to find the header expando button.
* @property {string} [selectorExpandCells] The CSS selector to find the row expando button.
* @property {string} [selectorExpandCellsExpanded] The CSS selector to find the row expando button with its expanded state.
* @property {string[]} initEventNames The event names that instantiates this component.
*/
static get options() {
Expand Down
6 changes: 3 additions & 3 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Map {
"open": Object {
"type": "bool",
},
"renderExpand": Object {
"renderExpando": Object {
"type": "func",
},
"title": Object {
Expand Down Expand Up @@ -1145,7 +1145,7 @@ Map {
"className": Object {
"type": "string",
},
"enableExpand": Object {
"enableExpando": Object {
"type": "bool",
},
"expandIconDescription": Object {
Expand Down Expand Up @@ -1782,7 +1782,7 @@ Map {
"className": Object {
"type": "string",
},
"enableExpand": Object {
"enableExpando": Object {
"type": "bool",
},
"expandIconDescription": Object {
Expand Down
16 changes: 8 additions & 8 deletions packages/react/src/components/Accordion/AccordionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import { useId } from '../../internal/useId';
import deprecate from '../../prop-types/deprecate.js';

const { prefix } = settings;
const defaultRenderExpand = (props) => <button type="button" {...props} />;
const defaultRenderExpando = (props) => <button type="button" {...props} />;

function AccordionItem({
children,
className: customClassName,
iconDescription, // eslint-disable-line
open = false,
onHeadingClick,
renderExpand: Expand = defaultRenderExpand,
renderExpando: Expando = defaultRenderExpando,
title = 'title',
disabled,
...rest
Expand Down Expand Up @@ -75,7 +75,7 @@ function AccordionItem({

return (
<li className={className} {...rest} onAnimationEnd={handleAnimationEnd}>
<Expand
<Expando
disabled={disabled}
aria-controls={id}
aria-expanded={isOpen}
Expand All @@ -85,7 +85,7 @@ function AccordionItem({
type="button">
<ChevronRight16 className={`${prefix}--accordion__arrow`} />
<div className={`${prefix}--accordion__title`}>{title}</div>
</Expand>
</Expando>
<div id={id} className={`${prefix}--accordion__content`}>
{children}
</div>
Expand All @@ -110,7 +110,7 @@ AccordionItem.propTypes = {
disabled: PropTypes.bool,

/**
* The description of the expand icon.
* The description of the expando icon.
*/
iconDescription: deprecate(
PropTypes.string,
Expand All @@ -131,15 +131,15 @@ AccordionItem.propTypes = {
onHeadingClick: PropTypes.func,

/**
* `true` to open the expand.
* `true` to open the expando.
*/
open: PropTypes.bool,

/**
* The callback function to render the expand button.
* The callback function to render the expando button.
* Can be a React component class.
*/
renderExpand: PropTypes.func,
renderExpando: PropTypes.func,

/**
* The accordion title.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`AccordionItem should render 1`] = `
className="bx--accordion__item extra-class"
onAnimationEnd={[Function]}
>
<defaultRenderExpand
<defaultRenderExpando
aria-controls="accordion-item-1"
aria-expanded={false}
className="bx--accordion__heading"
Expand Down Expand Up @@ -60,7 +60,7 @@ exports[`AccordionItem should render 1`] = `
A heading
</div>
</button>
</defaultRenderExpand>
</defaultRenderExpando>
<div
className="bx--accordion__content"
id="accordion-item-1"
Expand Down
12 changes: 6 additions & 6 deletions packages/react/src/components/DataTable/TableExpandHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const { prefix } = settings;
const TableExpandHeader = ({
ariaLabel,
className: headerClassName,
enableExpand,
enableExpando,
isExpanded,
onExpand,
expandIconDescription,
Expand All @@ -33,7 +33,7 @@ const TableExpandHeader = ({
className={className}
data-previous-value={previousValue}
{...rest}>
{!enableExpand ? null : (
{!enableExpando ? null : (
<button
type="button"
className={`${prefix}--table-expand__button`}
Expand All @@ -56,15 +56,15 @@ TableExpandHeader.propTypes = {
* Specify the string read by a voice reader when the expand trigger is
* focused
*/
ariaLabel: requiredIfGivenPropIsTruthy('enableExpand', PropTypes.string),
ariaLabel: requiredIfGivenPropIsTruthy('enableExpando', PropTypes.string),
children: PropTypes.node,

className: PropTypes.string,

/**
* Specify whether an expand all button should be displayed
*/
enableExpand: PropTypes.bool,
enableExpando: PropTypes.bool,

/**
* The description of the chevron right icon, to be put in its SVG `<title>` element.
Expand All @@ -75,12 +75,12 @@ TableExpandHeader.propTypes = {
* Specify whether this row is expanded or not. This helps coordinate data
* attributes so that `TableExpandRow` and `TableExpandedRow` work together
*/
isExpanded: requiredIfGivenPropIsTruthy('enableExpand', PropTypes.bool),
isExpanded: requiredIfGivenPropIsTruthy('enableExpando', PropTypes.bool),

/**
* Hook for when a listener initiates a request to expand the given row
*/
onExpand: requiredIfGivenPropIsTruthy('enableExpand', PropTypes.func),
onExpand: requiredIfGivenPropIsTruthy('enableExpando', PropTypes.func),
};

export default TableExpandHeader;
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export const BatchExpansion = () => (
<TableHead>
<TableRow>
<TableExpandHeader
enableExpand={true}
enableExpando={true}
{...getExpandHeaderProps()}
/>
{headers.map((header, i) => (
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/TreeView/TreeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ export default function TreeNode({
* Dynamically calculate padding to recreate tree node indentation
* - parent nodes have (depth + 1rem) left padding
* - leaf nodes have (depth + 2.5rem) left padding without icons (because
* of expand icon + spacing)
* of expando icon + spacing)
* - leaf nodes have (depth + 2rem) left padding with icons (because of
* reduced spacing between the expand icon and the node icon + label)
* reduced spacing between the expando icon and the node icon + label)
*/
const calcOffset = () => {
// parent node
Expand Down

0 comments on commit 3293dda

Please sign in to comment.