mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 10:41:13 +08:00
@ -239,12 +239,12 @@ export class Fab {
|
||||
}
|
||||
|
||||
export declare interface FabButton extends StencilComponents<'IonFabButton'> {}
|
||||
@Component({ selector: 'ion-fab-button', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: '<ng-content></ng-content>', inputs: ['mode', 'color', 'activated', 'disabled', 'href', 'translucent', 'show'] })
|
||||
@Component({ selector: 'ion-fab-button', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: '<ng-content></ng-content>', inputs: ['mode', 'color', 'activated', 'disabled', 'routerDirection', 'href', 'translucent', 'show'] })
|
||||
export class FabButton {
|
||||
|
||||
constructor(r: ElementRef) {
|
||||
const el = r.nativeElement;
|
||||
proxyInputs(this, el, ['mode', 'color', 'activated', 'disabled', 'href', 'translucent', 'show']);
|
||||
proxyInputs(this, el, ['mode', 'color', 'activated', 'disabled', 'routerDirection', 'href', 'translucent', 'show']);
|
||||
}
|
||||
}
|
||||
|
||||
|
8
core/src/components.d.ts
vendored
8
core/src/components.d.ts
vendored
@ -1398,6 +1398,10 @@ export namespace Components {
|
||||
*/
|
||||
'mode': Mode;
|
||||
/**
|
||||
* When using a router, it specifies the transition direction when navigating to another page using `href`.
|
||||
*/
|
||||
'routerDirection'?: RouterDirection;
|
||||
/**
|
||||
* If true, the fab button will show when in a fab-list.
|
||||
*/
|
||||
'show': boolean;
|
||||
@ -1428,6 +1432,10 @@ export namespace Components {
|
||||
*/
|
||||
'mode'?: Mode;
|
||||
/**
|
||||
* When using a router, it specifies the transition direction when navigating to another page using `href`.
|
||||
*/
|
||||
'routerDirection'?: RouterDirection;
|
||||
/**
|
||||
* If true, the fab button will show when in a fab-list.
|
||||
*/
|
||||
'show'?: boolean;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Component, Element, Prop } from '@stencil/core';
|
||||
|
||||
import { Color, CssClassMap, Mode } from '../../interface';
|
||||
import { createColorClasses } from '../../utils/theme';
|
||||
import { Color, CssClassMap, Mode, RouterDirection } from '../../interface';
|
||||
import { createColorClasses, openURL } from '../../utils/theme';
|
||||
|
||||
@Component({
|
||||
tag: 'ion-fab-button',
|
||||
@ -14,6 +14,8 @@ import { createColorClasses } from '../../utils/theme';
|
||||
export class FabButton {
|
||||
private inList = false;
|
||||
|
||||
@Prop({ context: 'window' }) win!: Window;
|
||||
|
||||
@Element() el!: HTMLElement;
|
||||
|
||||
/**
|
||||
@ -39,6 +41,12 @@ export class FabButton {
|
||||
*/
|
||||
@Prop() disabled = false;
|
||||
|
||||
/**
|
||||
* When using a router, it specifies the transition direction when navigating to
|
||||
* another page using `href`.
|
||||
*/
|
||||
@Prop() routerDirection?: RouterDirection;
|
||||
|
||||
/**
|
||||
* Contains a URL or a URL fragment that the hyperlink points to.
|
||||
* If this property is set, an anchor tag will be rendered.
|
||||
@ -94,6 +102,7 @@ export class FabButton {
|
||||
class="fab-button-native"
|
||||
disabled={this.disabled}
|
||||
href={this.href}
|
||||
onClick={ev => openURL(this.win, this.href, ev, this.routerDirection)}
|
||||
>
|
||||
<span class="fab-button-close-icon">
|
||||
<ion-icon name="close" lazy={false}></ion-icon>
|
||||
|
@ -10,12 +10,13 @@ If the FAB button is not wrapped with `<ion-fab>`, it will scroll with the conte
|
||||
## Properties
|
||||
|
||||
| Property | Attribute | Description | Type |
|
||||
| ------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
|
||||
| ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
|
||||
| `activated` | `activated` | If true, the fab button will be show a close icon. Defaults to `false`. | `boolean` |
|
||||
| `color` | `color` | The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). | `Color` |
|
||||
| `disabled` | `disabled` | If true, the user cannot interact with the fab button. Defaults to `false`. | `boolean` |
|
||||
| `href` | `href` | Contains a URL or a URL fragment that the hyperlink points to. If this property is set, an anchor tag will be rendered. | `string` |
|
||||
| `mode` | `mode` | The mode determines which platform styles to use. Possible values are: `"ios"` or `"md"`. | `Mode` |
|
||||
| `routerDirection` | `router-direction` | When using a router, it specifies the transition direction when navigating to another page using `href`. | `RouterDirection` |
|
||||
| `show` | `show` | If true, the fab button will show when in a fab-list. | `boolean` |
|
||||
| `translucent` | `translucent` | If true, the fab button will be translucent. Defaults to `false`. | `boolean` |
|
||||
|
||||
|
Reference in New Issue
Block a user