Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(chips): Add removal functionality/styling. #4912

Merged
merged 11 commits into from
Jul 14, 2017

Commits on Jul 12, 2017

  1. feat(chips): Add remove functionality/styling.

    Add events, styling and keyboard controls to allow removable chips.
    
     - Add basic styling for a user-provided remove icon.
     - Add keyboard controls for backspace/delete.
     - Add `(remove)` event which is emitted when the remove icon or
       one of the delete keys is pressed.
     - Add `md-chip-remove` directive which can be applied to `<md-icon>`
       (or others) to inform the chip of the remove request.
    
    Add new directive `mdChipInput` for controlling:
     - `(chipAdded)` - Event fired when a chip should be added.
     - `[separatorKeys]` - The list of keycodes that will fire the
       `(chipAdded)` event.
     - `[addOnBlur]` - Whether or not to fire the `(chipAdded)` event
       when the input is blurred.
    
    Additionally, fix some issues with dark theme and add styling/support
    for usage inside the `md-input-container` and add styling for focused
    chips.
    
    BREAKING CHANGE - The `selectable` property of the `md-chip-list` has
    now been moved to `md-chip` to maintain consistency with the new
    `removable` option.
    
    If you used the following code,
    
    ```html
    <md-chip-list [selectable]="selectable">
      <md-chip>My Chip</md-chip>
    </md-chip-list>
    ```
    
    you should switch it to
    
    ```html
    <md-chip-list>
      <md-chip [selectable]="selectable">My Chip</md-chip>
    </md-chip-list>
    ```
    
    References angular#120. Closes angular#3143.
    
    Hat tip to @willshowell for suggestion to use secondary-text
    for focus color :-)
    topherfangio authored and tinayuangao committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    de0ec65 View commit details
    Browse the repository at this point in the history
  2. sync chip

    tinayuangao committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    4a586de View commit details
    Browse the repository at this point in the history
  3. Add chip list container

    tinayuangao committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    bceeaee View commit details
    Browse the repository at this point in the history
  4. Address comments

    tinayuangao committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    a9afafb View commit details
    Browse the repository at this point in the history
  5. comments addressed

    tinayuangao committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    6846f3a View commit details
    Browse the repository at this point in the history
  6. update tab index

    tinayuangao committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    ff95fbb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    fa248c2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8ef5a0c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    0fd32a9 View commit details
    Browse the repository at this point in the history
  10. sync & address comments

    tinayuangao committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    f188183 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    8143e18 View commit details
    Browse the repository at this point in the history