Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
WIP: Export types and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
acdvorak committed Feb 7, 2019
1 parent 89c454a commit e3a15ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/mdc-chips/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,16 @@ Method Signature | Description

Property | Value Type | Description
--- | --- | ---
`chips` | Array<`MDCChip`> | An array of the `MDCChip` objects that represent chips in the set
`selectedChipIds` | `!Array<string>` (read-only) | An array of the IDs of all selected chips
`chips` | `MDCChip` | An array of the `MDCChip` objects that represent chips in the set
`selectedChipIds` | `string[]` (read-only) | An array of the IDs of all selected chips

## Usage within Web Frameworks

If you are using a JavaScript framework, such as React or Angular, you can create Chips for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).

### Adapters: `MDCChipAdapter` and `MDCChipSetAdapter`

See [`chip/index.js`](chip/index.js) and [`chip-set/index.js`](chip-set/index.js) for vanilla DOM implementations of these adapter APIs for reference.
See [`chip/index.ts`](chip/index.ts) and [`chip-set/index.ts`](chip-set/index.ts) for vanilla DOM implementations of these adapter APIs for reference.

#### `MDCChipAdapter`

Expand All @@ -336,7 +336,7 @@ Method Signature | Description
`setStyleProperty(propertyName: string, value: string) => void` | Sets the property value of the given style property on the root element
`hasLeadingIcon() => boolean` | Returns whether the chip has a leading icon
`getRootBoundingClientRect() => ClientRect` | Returns the bounding client rect of the root element
`getCheckmarkBoundingClientRect() => ?ClientRect` | Returns the bounding client rect of the checkmark element or null if it doesn't exist
`getCheckmarkBoundingClientRect() => ClientRect \| null` | Returns the bounding client rect of the checkmark element or null if it doesn't exist

> \*_NOTE_: `notifyInteraction` and `notifyTrailingIconInteraction` must pass along the target chip's ID, and must be observable by the parent `mdc-chip-set` element (e.g. via DOM event bubbling).
Expand Down Expand Up @@ -382,7 +382,7 @@ Events | Element Selector | Foundation Handler

Method Signature | Description
--- | ---
`getSelectedChipIds() => !Array<string>` | Returns an array of the IDs of all selected chips
`getSelectedChipIds() => string[]` | Returns an array of the IDs of all selected chips
`select(chipId: string) => void` | Selects the chip with the given id
`handleChipInteraction(chipId: string) => void` | Handles a custom `MDCChip:interaction` event on the root element
`handleChipSelection(chipId: string, selected: boolean) => void` | Handles a custom `MDCChip:selection` event on the root element
Expand Down
1 change: 1 addition & 0 deletions packages/mdc-chips/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
export * from './chip/adapter';
export * from './chip/foundation';
export * from './chip/index';
export * from './chip/types';
export * from './chip-set/adapter';
export * from './chip-set/foundation';
export * from './chip-set/index';

0 comments on commit e3a15ae

Please sign in to comment.