feat(select-option): pass class from the option to the interface for individual styling (#21304)

Co-authored-by: Robb Wright <audaxion@gmail.com>
This commit is contained in:
Brandy Carney
2020-05-27 12:12:01 -04:00
committed by GitHub
parent 2dac12c577
commit 5285824da5
12 changed files with 1465 additions and 13 deletions

View File

@ -4,5 +4,6 @@ export interface SelectPopoverOption {
value: string;
disabled: boolean;
checked: boolean;
cssClass?: string | string[];
handler?: () => void;
}

View File

@ -3,6 +3,7 @@ import { Component, ComponentInterface, Host, Listen, Prop, h } from '@stencil/c
import { getIonMode } from '../../global/ionic-global';
import { SelectPopoverOption } from '../../interface';
import { safeCall } from '../../utils/overlays';
import { getClassMap } from '../../utils/theme';
/**
* @internal
@ -51,7 +52,7 @@ export class SelectPopover implements ComponentInterface {
}
<ion-radio-group value={checkedValue}>
{this.options.map(option =>
<ion-item>
<ion-item class={getClassMap(option.cssClass)}>
<ion-label>
{option.text}
</ion-label>