a zip code crypto-currency system good for red ONLY

toast-controller.js 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. (function (factory) {
  2. if (typeof module === "object" && typeof module.exports === "object") {
  3. var v = factory(require, exports);
  4. if (v !== undefined) module.exports = v;
  5. }
  6. else if (typeof define === "function" && define.amd) {
  7. define(["require", "exports", "@angular/core", "../app/app", "../../config/config", "./toast"], factory);
  8. }
  9. })(function (require, exports) {
  10. "use strict";
  11. Object.defineProperty(exports, "__esModule", { value: true });
  12. var core_1 = require("@angular/core");
  13. var app_1 = require("../app/app");
  14. var config_1 = require("../../config/config");
  15. var toast_1 = require("./toast");
  16. /**
  17. * @name ToastController
  18. * @description
  19. * A Toast is a subtle notification commonly used in modern applications.
  20. * It can be used to provide feedback about an operation or to
  21. * display a system message. The toast appears on top of the app's content,
  22. * and can be dismissed by the app to resume user interaction with
  23. * the app.
  24. *
  25. * ### Creating
  26. * All of the toast options should be passed in the first argument of
  27. * the create method: `create(opts)`. The message to display should be
  28. * passed in the `message` property. The `showCloseButton` option can be set to
  29. * true in order to display a close button on the toast. See the [create](#create)
  30. * method below for all available options.
  31. *
  32. * ### Positioning
  33. * Toasts can be positioned at the top, bottom or middle of the
  34. * view port. The position can be passed to the `Toast.create(opts)` method.
  35. * The position option is a string, and the values accepted are `top`, `bottom` and `middle`.
  36. * If the position is not specified, the toast will be displayed at the bottom of the view port.
  37. *
  38. * ### Dismissing
  39. * The toast can be dismissed automatically after a specific amount of time
  40. * by passing the number of milliseconds to display it in the `duration` of
  41. * the toast options. If `showCloseButton` is set to true, then the close button
  42. * will dismiss the toast. To dismiss the toast after creation, call the `dismiss()`
  43. * method on the Toast instance. The `onDidDismiss` function can be called to perform an action after the toast
  44. * is dismissed.
  45. *
  46. * @usage
  47. * ```ts
  48. * import { ToastController } from 'ionic-angular';
  49. *
  50. * constructor(public toastCtrl: ToastController) { }
  51. *
  52. * presentToast() {
  53. * const toast = this.toastCtrl.create({
  54. * message: 'User was added successfully',
  55. * duration: 3000,
  56. * position: 'top'
  57. * });
  58. *
  59. * toast.onDidDismiss(() => {
  60. * console.log('Dismissed toast');
  61. * });
  62. *
  63. * toast.present();
  64. * }
  65. * ```
  66. * @advanced
  67. * | Property | Type | Default | Description |
  68. * |-----------------------|-----------|-----------------|---------------------------------------------------------------------------------------------------------------|
  69. * | message | `string` | - | The message for the toast. Long strings will wrap and the toast container will expand. |
  70. * | duration | `number` | - | How many milliseconds to wait before hiding the toast. By default, it will show until `dismiss()` is called. |
  71. * | position | `string` | "bottom" | The position of the toast on the screen. Accepted values: "top", "middle", "bottom". |
  72. * | cssClass | `string` | - | Additional classes for custom styles, separated by spaces. |
  73. * | showCloseButton | `boolean` | false | Whether or not to show a button to close the toast. |
  74. * | closeButtonText | `string` | "Close" | Text to display in the close button. |
  75. * | dismissOnPageChange | `boolean` | false | Whether to dismiss the toast when navigating to a new page. |
  76. *
  77. * @demo /docs/demos/src/toast/
  78. */
  79. var ToastController = (function () {
  80. function ToastController(_app, config) {
  81. this._app = _app;
  82. this.config = config;
  83. }
  84. /**
  85. * Create a new toast component. See options below
  86. * @param {ToastOptions} opts Toast options. See the below table for available options.
  87. */
  88. ToastController.prototype.create = function (opts) {
  89. if (opts === void 0) { opts = {}; }
  90. return new toast_1.Toast(this._app, opts, this.config);
  91. };
  92. ToastController.decorators = [
  93. { type: core_1.Injectable },
  94. ];
  95. /** @nocollapse */
  96. ToastController.ctorParameters = function () { return [
  97. { type: app_1.App, },
  98. { type: config_1.Config, },
  99. ]; };
  100. return ToastController;
  101. }());
  102. exports.ToastController = ToastController;
  103. });
  104. //# sourceMappingURL=toast-controller.js.map