constants.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * @license
  3. * Copyright 2020 Google Inc.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6. * of this software and associated documentation files (the "Software"), to deal
  7. * in the Software without restriction, including without limitation the rights
  8. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. * copies of the Software, and to permit persons to whom the Software is
  10. * furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included in
  13. * all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. * THE SOFTWARE.
  22. */
  23. /** Banner element classes. */
  24. export var cssClasses = {
  25. CLOSING: 'mdc-banner--closing',
  26. OPEN: 'mdc-banner--open',
  27. OPENING: 'mdc-banner--opening',
  28. };
  29. /** Banner numbers. */
  30. export var numbers = {
  31. BANNER_ANIMATION_CLOSE_TIME_MS: 250,
  32. BANNER_ANIMATION_OPEN_TIME_MS: 300,
  33. };
  34. /** Banner events. */
  35. export var events = {
  36. CLOSED: 'MDCBanner:closed',
  37. CLOSING: 'MDCBanner:closing',
  38. OPENED: 'MDCBanner:opened',
  39. OPENING: 'MDCBanner:opening',
  40. ACTION_CLICKED: 'MDCBanner:actionClicked',
  41. };
  42. /** Banner selectors. */
  43. export var selectors = {
  44. CONTENT: '.mdc-banner__content',
  45. PRIMARY_ACTION: '.mdc-banner__primary-action',
  46. SECONDARY_ACTION: '.mdc-banner__secondary-action',
  47. TEXT: '.mdc-banner__text',
  48. };
  49. /** Reason as to why the banner was closed. */
  50. export var CloseReason;
  51. (function (CloseReason) {
  52. // Indicates the banner was closed via primary action button.
  53. CloseReason[CloseReason["PRIMARY"] = 0] = "PRIMARY";
  54. // Indicates the banner was closed via secondary action button.
  55. CloseReason[CloseReason["SECONDARY"] = 1] = "SECONDARY";
  56. // Will never be used by the component. Provided for custom handling of
  57. // programmatic closing of the banner.
  58. CloseReason[CloseReason["UNSPECIFIED"] = 2] = "UNSPECIFIED";
  59. })(CloseReason || (CloseReason = {}));
  60. /**
  61. * Payload of actionClicked events to signify which action emitted the event.
  62. */
  63. export var Action;
  64. (function (Action) {
  65. Action[Action["PRIMARY"] = 0] = "PRIMARY";
  66. Action[Action["SECONDARY"] = 1] = "SECONDARY";
  67. Action[Action["UNKNOWN"] = 2] = "UNKNOWN";
  68. })(Action || (Action = {}));
  69. //# sourceMappingURL=constants.js.map