fix(): update to Stencil One 🎉🎊

This commit is contained in:
Manu MA
2019-06-19 21:33:50 +02:00
committed by GitHub
parent 7f1829eb21
commit b40f7d36d5
572 changed files with 14426 additions and 9916 deletions

View File

@ -1,10 +1,13 @@
import { Component, ComponentInterface, Element, Listen, Prop } from '@stencil/core';
import { Component, ComponentInterface, Element, Listen, Prop, h } from '@stencil/core';
import { Color, Mode } from '../../interface';
import { getIonMode } from '../../global/ionic-global';
import { Color } from '../../interface';
import { AnchorInterface, ButtonInterface } from '../../utils/element-interface';
import { createColorClasses } from '../../utils/theme';
/**
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
*
* @slot - Content is placed between the named slots if provided without a slot.
* @slot start - Content is placed to the left of the option text in LTR, and to the right in RTL.
* @slot top - Content is placed above the option text.
@ -31,11 +34,6 @@ export class ItemOption implements ComponentInterface, AnchorInterface, ButtonIn
*/
@Prop() color?: Color;
/**
* The mode determines which platform styles to use.
*/
@Prop() mode!: Mode;
/**
* If `true`, the user cannot interact with the item option.
*/
@ -87,11 +85,12 @@ export class ItemOption implements ComponentInterface, AnchorInterface, ButtonIn
}
hostData() {
const mode = getIonMode(this);
const { disabled, expandable } = this;
return {
class: {
...createColorClasses(this.color),
[`${this.mode}`]: true,
[`${mode}`]: true,
'item-option-disabled': disabled,
'item-option-expandable': expandable,
@ -102,6 +101,7 @@ export class ItemOption implements ComponentInterface, AnchorInterface, ButtonIn
render() {
const TagType = this.href === undefined ? 'button' : 'a' as any;
const mode = getIonMode(this);
const attrs = (TagType === 'button')
? { type: this.type }
: {
@ -126,7 +126,7 @@ export class ItemOption implements ComponentInterface, AnchorInterface, ButtonIn
</div>
<slot name="bottom"></slot>
</span>
{this.mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
{mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
</TagType>
);
}

View File

@ -42,6 +42,19 @@ action for the item.
| `--color` | Color of the item option |
## Dependencies
### Depends on
- [ion-ripple-effect](../ripple-effect)
### Graph
```mermaid
graph TD;
ion-item-option --> ion-ripple-effect
style ion-item-option fill:#f9f,stroke:#333,stroke-width:4px
```
----------------------------------------------
*Built with [StencilJS](https://stenciljs.com/)*