1 | var __extends = (this && this.__extends) || (function () {
|
2 | var extendStatics = Object.setPrototypeOf ||
|
3 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
4 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
5 | return function (d, b) {
|
6 | extendStatics(d, b);
|
7 | function __() { this.constructor = d; }
|
8 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
9 | };
|
10 | })();
|
11 | import { ChangeDetectionStrategy, Component, ElementRef, Renderer, ViewEncapsulation } from '@angular/core';
|
12 | import { Config } from '../../config/config';
|
13 | import { Ion } from '../ion';
|
14 | /**
|
15 | * @name FabButton
|
16 | * @module ionic
|
17 | *
|
18 | * @description
|
19 | * FABs (Floating Action Buttons) are standard material design components. They are shaped as a circle that represents a promoted action. When pressed, it may contain more related actions.
|
20 | * FABs as its name suggests are floating over the content in a fixed position. This is not achieved exclusively with `<button ion-fab>Button</button>` but it has to be wrapped with the `<ion-fab>` component, like this:
|
21 | *
|
22 | * ```html
|
23 | * <ion-content>
|
24 | * <!-- Real floating action button, fixed. It will not scroll with the content -->
|
25 | * <ion-fab>
|
26 | * <button ion-fab>Button</button>
|
27 | * </ion-fab>
|
28 | *
|
29 | * <!-- Button shaped as a circle that just like a normal button scrolls with the content -->
|
30 | * <button ion-fab>Button</button>
|
31 | * </ion-content>
|
32 | *
|
33 | * ```
|
34 | *
|
35 | * In case the button is not wrapped with `<ion-fab>`, the fab button will behave like a normal button, scrolling with the content.
|
36 | *
|
37 | * See [ion-fab] to learn more information about how to position the fab button.
|
38 | *
|
39 | * @property [mini] - Makes a fab button with a reduced size.
|
40 | *
|
41 | * @usage
|
42 | *
|
43 | * ```html
|
44 | *
|
45 | * <!-- Colors -->
|
46 | * <ion-fab>
|
47 | * <button ion-fab color="primary">Button</button>
|
48 | * </ion-fab>
|
49 | *
|
50 | * <!-- Mini -->
|
51 | * <ion-fab>
|
52 | * <button ion-fab mini>Small</button>
|
53 | * </ion-fab>
|
54 | * ```
|
55 | *
|
56 | * @demo /docs/demos/src/fab/
|
57 | * @see {@link /docs/components#fabs FAB Component Docs}
|
58 | */
|
59 | var FabButton = (function (_super) {
|
60 | __extends(FabButton, _super);
|
61 | function FabButton(config, elementRef, renderer) {
|
62 | return _super.call(this, config, elementRef, renderer, 'fab') || this;
|
63 | }
|
64 | /**
|
65 | * @hidden
|
66 | */
|
67 | FabButton.prototype.setActiveClose = function (closeVisible) {
|
68 | this.setElementClass('fab-close-active', closeVisible);
|
69 | };
|
70 | FabButton.decorators = [
|
71 | { type: Component, args: [{
|
72 | selector: '[ion-fab]',
|
73 | template: '<ion-icon name="close" class="fab-close-icon"></ion-icon>' +
|
74 | '<span class="button-inner">' +
|
75 | '<ng-content></ng-content>' +
|
76 | '</span>' +
|
77 | '<div class="button-effect"></div>',
|
78 | changeDetection: ChangeDetectionStrategy.OnPush,
|
79 | encapsulation: ViewEncapsulation.None,
|
80 | },] },
|
81 | ];
|
82 | /** @nocollapse */
|
83 | FabButton.ctorParameters = function () { return [
|
84 | { type: Config, },
|
85 | { type: ElementRef, },
|
86 | { type: Renderer, },
|
87 | ]; };
|
88 | return FabButton;
|
89 | }(Ion));
|
90 | export { FabButton };
|
91 | //# sourceMappingURL=fab.js.map |
\ | No newline at end of file |