Skip to content

Commit

Permalink
WIP update from review
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickrodee committed Jul 3, 2019
1 parent 0e15717 commit dee380a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions packages/mdc-chips/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ Method Signature | Description
`focusPrimaryAction() => void` | Proxies to the foundation's `focusPrimaryAction` method
`focusTrailingAction() => void` | Proxies to the foundation's `focusTrailingAction` method
`removeFocus() => void` | Proxies to the foundation's `removeFocus` method
`setSelectedFromChipset(selected: boolean) => void` | Proxies to the foundation's `setSelectedFromChipset` method (only called from the chip set)
`setSelectedFromChipSet(selected: boolean) => void` | Proxies to the foundation's `setSelectedFromChipset` method (only called from the chip set)

Property | Value Type | Description
--- | --- | ---
Expand Down Expand Up @@ -393,7 +393,7 @@ Method Signature | Description
--- | ---
`hasClass(className: string) => boolean` | Returns whether the chip set element has the given class
`removeChipAtIndex(index: number) => void` | Removes the chip with the given `index` from the chip set
`selectChipAtIndex(index: string, selected: boolean) => void` | Calls `MDCChip#setSelectedFromChipset(selected)` on the chip at the given `index`
`selectChipAtIndex(index: string, selected: boolean) => void` | Calls `MDCChip#setSelectedFromChipSet(selected)` on the chip at the given `index`
`getIndexOfChipById(id: string) => number` | Returns the index of the chip with the matching `id` or -1
`focusChipPrimaryActionAtIndex(index: number) => void` | Calls `MDCChip#focusPrimaryAction()` on the chip at the given `index`
`focusChipTrailingActionAtIndex(index: number) => void` | Calls `MDCChip#focusTrailingAction()` on the chip at the given `index`
Expand All @@ -409,7 +409,7 @@ Method Signature | Description
--- | ---
`isSelected() => boolean` | Returns true if the chip is selected
`setSelected(selected: boolean) => void` | Sets the chip's selected state
`setSelectedFromChipset(selected: boolean) => void` | Sets the chip's selected state (called from the chip set)
`setSelectedFromChipSet(selected: boolean) => void` | Sets the chip's selected state (called from the chip set)
`getShouldRemoveOnTrailingIconClick() => boolean` | Returns whether a trailing icon click should trigger exit/removal of the chip
`setShouldRemoveOnTrailingIconClick(shouldRemove: boolean) => void` | Sets whether a trailing icon click should trigger exit/removal of the chip
`getDimensions() => ClientRect` | Returns the dimensions of the chip. This is used for applying ripple to the chip.
Expand Down
2 changes: 1 addition & 1 deletion packages/mdc-chips/chip-set/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class MDCChipSet extends MDCComponent<MDCChipSetFoundation> {
},
selectChipAtIndex: (index, selected) => {
if (index >= 0 && index < this.chips_.length) {
this.chips_[index].setSelectedFromChipset(selected);
this.chips_[index].setSelectedFromChipSet(selected);
}
},
};
Expand Down
4 changes: 2 additions & 2 deletions packages/mdc-chips/chip/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ export class MDCChip extends MDCComponent<MDCChipFoundation> implements MDCRippl
return new MDCChipFoundation(adapter);
}

setSelectedFromChipset(selected: boolean) {
this.foundation_.setSelectedFromChipset(selected);
setSelectedFromChipSet(selected: boolean) {
this.foundation_.setSelectedFromChipSet(selected);
}

focusPrimaryAction() {
Expand Down
2 changes: 1 addition & 1 deletion packages/mdc-chips/chip/foundation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class MDCChipFoundation extends MDCFoundation<MDCChipAdapter> {
this.setSelected_(selected, true);
}

setSelectedFromChipset(selected: boolean) {
setSelectedFromChipSet(selected: boolean) {
this.setSelected_(selected, false);
}

Expand Down
2 changes: 1 addition & 1 deletion test/unit/mdc-chips/mdc-chip-set.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ test('#adapter.selectChipAtIndex calls setSelectedFromChipset on chip object', (
const {component} = setupTest();
const chip = component.chips[0];
component.getDefaultFoundation().adapter_.selectChipAtIndex(0, true);
td.verify(chip.setSelectedFromChipset(true));
td.verify(chip.setSelectedFromChipSet(true));
});

test('#adapter.getChipListCount returns the number of chips', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/mdc-chips/mdc-chip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ test('#set shouldRemoveOnTrailingIconClick proxies to foundation', () => {

test('#setSelectedFromChipset proxies to the same foundation method', () => {
const {component, mockFoundation} = setupMockFoundationTest();
component.setSelectedFromChipset(true);
component.setSelectedFromChipSet(true);
td.verify(mockFoundation.setSelectedFromChipset(true));
});

Expand Down

0 comments on commit dee380a

Please sign in to comment.