@haiilo/catalyst 1.3.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/catalyst/catalyst.css +1 -1
  2. package/dist/catalyst/catalyst.esm.js +1 -1
  3. package/dist/catalyst/catalyst.esm.js.map +1 -1
  4. package/dist/catalyst/index.cdn.js +7 -3
  5. package/dist/catalyst/index.esm.js +9 -1
  6. package/dist/catalyst/index.esm.js.map +1 -1
  7. package/dist/catalyst/p-167f01e8.entry.js +2 -0
  8. package/dist/catalyst/p-167f01e8.entry.js.map +1 -0
  9. package/dist/catalyst/p-5865f232.js +2 -0
  10. package/dist/catalyst/p-5865f232.js.map +1 -0
  11. package/dist/catalyst/scss/_variables.scss +1 -1
  12. package/dist/catalyst/scss/core/_form.scss +8 -0
  13. package/dist/catalyst/scss/core/_nav.scss +3 -3
  14. package/dist/catalyst/scss/core/_notification.scss +48 -0
  15. package/dist/catalyst/scss/index.scss +2 -1
  16. package/dist/catalyst/scss/utils/_typography.scss +4 -0
  17. package/dist/cjs/cat-alert_22.cjs.entry.js +351 -290
  18. package/dist/cjs/cat-alert_22.cjs.entry.js.map +1 -1
  19. package/dist/cjs/cat-icon-registry-2a54df3d.js +417 -0
  20. package/dist/cjs/cat-icon-registry-2a54df3d.js.map +1 -0
  21. package/dist/cjs/catalyst.cjs.js +1 -1
  22. package/dist/cjs/index.cjs.js +528 -4
  23. package/dist/cjs/index.cjs.js.map +1 -1
  24. package/dist/cjs/loader.cjs.js +1 -1
  25. package/dist/collection/collection-manifest.json +2 -2
  26. package/dist/collection/components/cat-button/cat-button.css +21 -63
  27. package/dist/collection/components/cat-button/cat-button.js +21 -4
  28. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  29. package/dist/collection/components/cat-card/cat-card.css +5 -4
  30. package/dist/collection/components/cat-checkbox/cat-checkbox.css +1 -4
  31. package/dist/collection/components/cat-checkbox/cat-checkbox.js +1 -1
  32. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  33. package/dist/collection/components/{cat-menu/cat-menu.css → cat-dropdown/cat-dropdown.css} +20 -0
  34. package/dist/collection/components/{cat-menu/cat-menu.js → cat-dropdown/cat-dropdown.js} +102 -87
  35. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -0
  36. package/dist/collection/components/cat-i18n/cat-i18n-registry.js +13 -38
  37. package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
  38. package/dist/collection/components/cat-icon/cat-icon-registry.js +1 -0
  39. package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
  40. package/dist/collection/components/cat-input/cat-input.css +1 -4
  41. package/dist/collection/components/cat-input/cat-input.js +4 -5
  42. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  43. package/dist/collection/components/cat-notification/cat-notification.js +61 -89
  44. package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
  45. package/dist/collection/components/cat-pagination/cat-pagination.css +106 -0
  46. package/dist/collection/components/cat-pagination/cat-pagination.js +302 -0
  47. package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -0
  48. package/dist/collection/components/cat-radio/cat-radio.css +1 -4
  49. package/dist/collection/components/cat-radio/cat-radio.js +1 -1
  50. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
  51. package/dist/collection/components/cat-select/cat-select.css +1 -4
  52. package/dist/collection/components/cat-select/cat-select.js +8 -9
  53. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  54. package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
  55. package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
  56. package/dist/collection/components/cat-tabs/cat-tabs.css +2 -2
  57. package/dist/collection/components/cat-tabs/cat-tabs.js +2 -2
  58. package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
  59. package/dist/collection/components/cat-textarea/cat-textarea.css +1 -4
  60. package/dist/collection/components/cat-textarea/cat-textarea.js +1 -1
  61. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  62. package/dist/collection/components/cat-toggle/cat-toggle.css +1 -4
  63. package/dist/collection/components/cat-toggle/cat-toggle.js +1 -1
  64. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  65. package/dist/collection/index.cdn.js +7 -3
  66. package/dist/collection/index.js +3 -3
  67. package/dist/collection/index.js.map +1 -1
  68. package/dist/collection/scss/_variables.scss +1 -1
  69. package/dist/collection/scss/core/_form.scss +8 -0
  70. package/dist/collection/scss/core/_nav.scss +3 -3
  71. package/dist/collection/scss/core/_notification.scss +48 -0
  72. package/dist/collection/scss/index.scss +2 -1
  73. package/dist/collection/scss/utils/_typography.scss +4 -0
  74. package/dist/components/cat-button2.js +6 -5
  75. package/dist/components/cat-button2.js.map +1 -1
  76. package/dist/components/cat-card.js +1 -1
  77. package/dist/components/cat-card.js.map +1 -1
  78. package/dist/components/cat-checkbox2.js +2 -2
  79. package/dist/components/cat-checkbox2.js.map +1 -1
  80. package/dist/components/{cat-menu.d.ts → cat-dropdown.d.ts} +4 -4
  81. package/dist/components/cat-dropdown.js +8 -0
  82. package/dist/components/cat-dropdown.js.map +1 -0
  83. package/dist/components/cat-dropdown2.js +195 -0
  84. package/dist/components/cat-dropdown2.js.map +1 -0
  85. package/dist/components/cat-i18n-registry.js +14 -39
  86. package/dist/components/cat-i18n-registry.js.map +1 -1
  87. package/dist/components/cat-icon2.js +2 -1
  88. package/dist/components/cat-icon2.js.map +1 -1
  89. package/dist/components/cat-input.js +5 -6
  90. package/dist/components/cat-input.js.map +1 -1
  91. package/dist/components/{cat-toast-demo.d.ts → cat-pagination.d.ts} +4 -4
  92. package/dist/components/cat-pagination.js +150 -0
  93. package/dist/components/cat-pagination.js.map +1 -0
  94. package/dist/components/cat-radio.js +2 -2
  95. package/dist/components/cat-radio.js.map +1 -1
  96. package/dist/components/cat-select-demo.js +6 -6
  97. package/dist/components/cat-select-demo.js.map +1 -1
  98. package/dist/components/cat-select2.js +7 -8
  99. package/dist/components/cat-select2.js.map +1 -1
  100. package/dist/components/cat-tabs.js +3 -3
  101. package/dist/components/cat-tabs.js.map +1 -1
  102. package/dist/components/cat-textarea.js +2 -2
  103. package/dist/components/cat-textarea.js.map +1 -1
  104. package/dist/components/cat-toggle.js +2 -2
  105. package/dist/components/cat-toggle.js.map +1 -1
  106. package/dist/components/index.d.ts +2 -2
  107. package/dist/components/index.js +531 -4
  108. package/dist/components/index.js.map +1 -1
  109. package/dist/esm/cat-alert_22.entry.js +348 -287
  110. package/dist/esm/cat-alert_22.entry.js.map +1 -1
  111. package/dist/esm/cat-icon-registry-d537b18b.js +409 -0
  112. package/dist/esm/cat-icon-registry-d537b18b.js.map +1 -0
  113. package/dist/esm/catalyst.js +1 -1
  114. package/dist/esm/index.js +527 -1
  115. package/dist/esm/index.js.map +1 -1
  116. package/dist/esm/loader.js +1 -1
  117. package/dist/types/components/cat-button/cat-button.d.ts +4 -0
  118. package/dist/types/components/{cat-menu/cat-menu.d.ts → cat-dropdown/cat-dropdown.d.ts} +19 -12
  119. package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +4 -6
  120. package/dist/types/components/cat-icon/cat-icon-registry.d.ts +1 -0
  121. package/dist/types/components/cat-input/cat-input.d.ts +0 -1
  122. package/dist/types/components/cat-notification/cat-notification.d.ts +21 -48
  123. package/dist/types/components/cat-pagination/cat-pagination.d.ts +56 -0
  124. package/dist/types/components/cat-select/cat-select.d.ts +0 -1
  125. package/dist/types/components.d.ts +145 -57
  126. package/dist/types/index.d.ts +4 -4
  127. package/package.json +3 -3
  128. package/dist/catalyst/p-10b0d7a2.js +0 -10
  129. package/dist/catalyst/p-10b0d7a2.js.map +0 -1
  130. package/dist/catalyst/p-b561dcd4.entry.js +0 -2
  131. package/dist/catalyst/p-b561dcd4.entry.js.map +0 -1
  132. package/dist/catalyst/scss/core/_toast.scss +0 -87
  133. package/dist/cjs/cat-notification-bcb9fb86.js +0 -990
  134. package/dist/cjs/cat-notification-bcb9fb86.js.map +0 -1
  135. package/dist/collection/components/cat-menu/cat-menu.js.map +0 -1
  136. package/dist/collection/components/cat-toast-demo/cat-toast-demo.css +0 -3
  137. package/dist/collection/components/cat-toast-demo/cat-toast-demo.js +0 -62
  138. package/dist/collection/components/cat-toast-demo/cat-toast-demo.js.map +0 -1
  139. package/dist/collection/scss/core/_toast.scss +0 -87
  140. package/dist/components/cat-menu.js +0 -8
  141. package/dist/components/cat-menu.js.map +0 -1
  142. package/dist/components/cat-menu2.js +0 -176
  143. package/dist/components/cat-menu2.js.map +0 -1
  144. package/dist/components/cat-toast-demo.js +0 -647
  145. package/dist/components/cat-toast-demo.js.map +0 -1
  146. package/dist/esm/cat-notification-8bcf6fa2.js +0 -985
  147. package/dist/esm/cat-notification-8bcf6fa2.js.map +0 -1
  148. package/dist/types/components/cat-toast-demo/cat-toast-demo.d.ts +0 -9
package/dist/esm/index.js CHANGED
@@ -1,3 +1,529 @@
1
- export { C as CatI18nRegistry, a as CatIconRegistry, N as NotificationsService } from './cat-notification-8bcf6fa2.js';
1
+ import { c as createCommonjsModule, a as commonjsGlobal, b as catI18nRegistry } from './cat-icon-registry-d537b18b.js';
2
+ export { C as CatI18nRegistry, e as CatIconRegistry, b as catI18nRegistry, d as catIconRegistry } from './cat-icon-registry-d537b18b.js';
3
+
4
+ var toastify = createCommonjsModule(function (module) {
5
+ /*!
6
+ * Toastify js 1.12.0
7
+ * https://github.com/apvarun/toastify-js
8
+ * @license MIT licensed
9
+ *
10
+ * Copyright (C) 2018 Varun A P
11
+ */
12
+ (function(root, factory) {
13
+ if (module.exports) {
14
+ module.exports = factory();
15
+ } else {
16
+ root.Toastify = factory();
17
+ }
18
+ })(commonjsGlobal, function(global) {
19
+ // Object initialization
20
+ var Toastify = function(options) {
21
+ // Returning a new init object
22
+ return new Toastify.lib.init(options);
23
+ },
24
+ // Library version
25
+ version = "1.12.0";
26
+
27
+ // Set the default global options
28
+ Toastify.defaults = {
29
+ oldestFirst: true,
30
+ text: "Toastify is awesome!",
31
+ node: undefined,
32
+ duration: 3000,
33
+ selector: undefined,
34
+ callback: function () {
35
+ },
36
+ destination: undefined,
37
+ newWindow: false,
38
+ close: false,
39
+ gravity: "toastify-top",
40
+ positionLeft: false,
41
+ position: '',
42
+ backgroundColor: '',
43
+ avatar: "",
44
+ className: "",
45
+ stopOnFocus: true,
46
+ onClick: function () {
47
+ },
48
+ offset: {x: 0, y: 0},
49
+ escapeMarkup: true,
50
+ ariaLive: 'polite',
51
+ style: {background: ''}
52
+ };
53
+
54
+ // Defining the prototype of the object
55
+ Toastify.lib = Toastify.prototype = {
56
+ toastify: version,
57
+
58
+ constructor: Toastify,
59
+
60
+ // Initializing the object with required parameters
61
+ init: function(options) {
62
+ // Verifying and validating the input object
63
+ if (!options) {
64
+ options = {};
65
+ }
66
+
67
+ // Creating the options object
68
+ this.options = {};
69
+
70
+ this.toastElement = null;
71
+
72
+ // Validating the options
73
+ this.options.text = options.text || Toastify.defaults.text; // Display message
74
+ this.options.node = options.node || Toastify.defaults.node; // Display content as node
75
+ this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration
76
+ this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector
77
+ this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display
78
+ this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination
79
+ this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window
80
+ this.options.close = options.close || Toastify.defaults.close; // Show toast close icon
81
+ this.options.gravity = options.gravity === "bottom" ? "toastify-bottom" : Toastify.defaults.gravity; // toast position - top or bottom
82
+ this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right
83
+ this.options.position = options.position || Toastify.defaults.position; // toast position - left or right
84
+ this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color
85
+ this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path
86
+ this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast
87
+ this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus
88
+ this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click
89
+ this.options.offset = options.offset || Toastify.defaults.offset; // toast offset
90
+ this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup;
91
+ this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive;
92
+ this.options.style = options.style || Toastify.defaults.style;
93
+ if(options.backgroundColor) {
94
+ this.options.style.background = options.backgroundColor;
95
+ }
96
+
97
+ // Returning the current object for chaining functions
98
+ return this;
99
+ },
100
+
101
+ // Building the DOM element
102
+ buildToast: function() {
103
+ // Validating if the options are defined
104
+ if (!this.options) {
105
+ throw "Toastify is not initialized";
106
+ }
107
+
108
+ // Creating the DOM object
109
+ var divElement = document.createElement("div");
110
+ divElement.className = "toastify on " + this.options.className;
111
+
112
+ // Positioning toast to left or right or center
113
+ if (!!this.options.position) {
114
+ divElement.className += " toastify-" + this.options.position;
115
+ } else {
116
+ // To be depreciated in further versions
117
+ if (this.options.positionLeft === true) {
118
+ divElement.className += " toastify-left";
119
+ console.warn('Property `positionLeft` will be depreciated in further versions. Please use `position` instead.');
120
+ } else {
121
+ // Default position
122
+ divElement.className += " toastify-right";
123
+ }
124
+ }
125
+
126
+ // Assigning gravity of element
127
+ divElement.className += " " + this.options.gravity;
128
+
129
+ if (this.options.backgroundColor) {
130
+ // This is being deprecated in favor of using the style HTML DOM property
131
+ console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');
132
+ }
133
+
134
+ // Loop through our style object and apply styles to divElement
135
+ for (var property in this.options.style) {
136
+ divElement.style[property] = this.options.style[property];
137
+ }
138
+
139
+ // Announce the toast to screen readers
140
+ if (this.options.ariaLive) {
141
+ divElement.setAttribute('aria-live', this.options.ariaLive);
142
+ }
143
+
144
+ // Adding the toast message/node
145
+ if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {
146
+ // If we have a valid node, we insert it
147
+ divElement.appendChild(this.options.node);
148
+ } else {
149
+ if (this.options.escapeMarkup) {
150
+ divElement.innerText = this.options.text;
151
+ } else {
152
+ divElement.innerHTML = this.options.text;
153
+ }
154
+
155
+ if (this.options.avatar !== "") {
156
+ var avatarElement = document.createElement("img");
157
+ avatarElement.src = this.options.avatar;
158
+
159
+ avatarElement.className = "toastify-avatar";
160
+
161
+ if (this.options.position == "left" || this.options.positionLeft === true) {
162
+ // Adding close icon on the left of content
163
+ divElement.appendChild(avatarElement);
164
+ } else {
165
+ // Adding close icon on the right of content
166
+ divElement.insertAdjacentElement("afterbegin", avatarElement);
167
+ }
168
+ }
169
+ }
170
+
171
+ // Adding a close icon to the toast
172
+ if (this.options.close === true) {
173
+ // Create a span for close element
174
+ var closeElement = document.createElement("button");
175
+ closeElement.type = "button";
176
+ closeElement.setAttribute("aria-label", "Close");
177
+ closeElement.className = "toast-close";
178
+ closeElement.innerHTML = "✖";
179
+
180
+ // Triggering the removal of toast from DOM on close click
181
+ closeElement.addEventListener(
182
+ "click",
183
+ function(event) {
184
+ event.stopPropagation();
185
+ this.removeElement(this.toastElement);
186
+ window.clearTimeout(this.toastElement.timeOutValue);
187
+ }.bind(this)
188
+ );
189
+
190
+ //Calculating screen width
191
+ var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
192
+
193
+ // Adding the close icon to the toast element
194
+ // Display on the right if screen width is less than or equal to 360px
195
+ if ((this.options.position == "left" || this.options.positionLeft === true) && width > 360) {
196
+ // Adding close icon on the left of content
197
+ divElement.insertAdjacentElement("afterbegin", closeElement);
198
+ } else {
199
+ // Adding close icon on the right of content
200
+ divElement.appendChild(closeElement);
201
+ }
202
+ }
203
+
204
+ // Clear timeout while toast is focused
205
+ if (this.options.stopOnFocus && this.options.duration > 0) {
206
+ var self = this;
207
+ // stop countdown
208
+ divElement.addEventListener(
209
+ "mouseover",
210
+ function(event) {
211
+ window.clearTimeout(divElement.timeOutValue);
212
+ }
213
+ );
214
+ // add back the timeout
215
+ divElement.addEventListener(
216
+ "mouseleave",
217
+ function() {
218
+ divElement.timeOutValue = window.setTimeout(
219
+ function() {
220
+ // Remove the toast from DOM
221
+ self.removeElement(divElement);
222
+ },
223
+ self.options.duration
224
+ );
225
+ }
226
+ );
227
+ }
228
+
229
+ // Adding an on-click destination path
230
+ if (typeof this.options.destination !== "undefined") {
231
+ divElement.addEventListener(
232
+ "click",
233
+ function(event) {
234
+ event.stopPropagation();
235
+ if (this.options.newWindow === true) {
236
+ window.open(this.options.destination, "_blank");
237
+ } else {
238
+ window.location = this.options.destination;
239
+ }
240
+ }.bind(this)
241
+ );
242
+ }
243
+
244
+ if (typeof this.options.onClick === "function" && typeof this.options.destination === "undefined") {
245
+ divElement.addEventListener(
246
+ "click",
247
+ function(event) {
248
+ event.stopPropagation();
249
+ this.options.onClick();
250
+ }.bind(this)
251
+ );
252
+ }
253
+
254
+ // Adding offset
255
+ if(typeof this.options.offset === "object") {
256
+
257
+ var x = getAxisOffsetAValue("x", this.options);
258
+ var y = getAxisOffsetAValue("y", this.options);
259
+
260
+ var xOffset = this.options.position == "left" ? x : "-" + x;
261
+ var yOffset = this.options.gravity == "toastify-top" ? y : "-" + y;
262
+
263
+ divElement.style.transform = "translate(" + xOffset + "," + yOffset + ")";
264
+
265
+ }
266
+
267
+ // Returning the generated element
268
+ return divElement;
269
+ },
270
+
271
+ // Displaying the toast
272
+ showToast: function() {
273
+ // Creating the DOM object for the toast
274
+ this.toastElement = this.buildToast();
275
+
276
+ // Getting the root element to with the toast needs to be added
277
+ var rootElement;
278
+ if (typeof this.options.selector === "string") {
279
+ rootElement = document.getElementById(this.options.selector);
280
+ } else if (this.options.selector instanceof HTMLElement || (typeof ShadowRoot !== 'undefined' && this.options.selector instanceof ShadowRoot)) {
281
+ rootElement = this.options.selector;
282
+ } else {
283
+ rootElement = document.body;
284
+ }
285
+
286
+ // Validating if root element is present in DOM
287
+ if (!rootElement) {
288
+ throw "Root element is not defined";
289
+ }
290
+
291
+ // Adding the DOM element
292
+ var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild;
293
+ rootElement.insertBefore(this.toastElement, elementToInsert);
294
+
295
+ // Repositioning the toasts in case multiple toasts are present
296
+ Toastify.reposition();
297
+
298
+ if (this.options.duration > 0) {
299
+ this.toastElement.timeOutValue = window.setTimeout(
300
+ function() {
301
+ // Remove the toast from DOM
302
+ this.removeElement(this.toastElement);
303
+ }.bind(this),
304
+ this.options.duration
305
+ ); // Binding `this` for function invocation
306
+ }
307
+
308
+ // Supporting function chaining
309
+ return this;
310
+ },
311
+
312
+ hideToast: function() {
313
+ if (this.toastElement.timeOutValue) {
314
+ clearTimeout(this.toastElement.timeOutValue);
315
+ }
316
+ this.removeElement(this.toastElement);
317
+ },
318
+
319
+ // Removing the element from the DOM
320
+ removeElement: function(toastElement) {
321
+ // Hiding the element
322
+ // toastElement.classList.remove("on");
323
+ toastElement.className = toastElement.className.replace(" on", "");
324
+
325
+ // Removing the element from DOM after transition end
326
+ window.setTimeout(
327
+ function() {
328
+ // remove options node if any
329
+ if (this.options.node && this.options.node.parentNode) {
330
+ this.options.node.parentNode.removeChild(this.options.node);
331
+ }
332
+
333
+ // Remove the element from the DOM, only when the parent node was not removed before.
334
+ if (toastElement.parentNode) {
335
+ toastElement.parentNode.removeChild(toastElement);
336
+ }
337
+
338
+ // Calling the callback function
339
+ this.options.callback.call(toastElement);
340
+
341
+ // Repositioning the toasts again
342
+ Toastify.reposition();
343
+ }.bind(this),
344
+ 400
345
+ ); // Binding `this` for function invocation
346
+ },
347
+ };
348
+
349
+ // Positioning the toasts on the DOM
350
+ Toastify.reposition = function() {
351
+
352
+ // Top margins with gravity
353
+ var topLeftOffsetSize = {
354
+ top: 15,
355
+ bottom: 15,
356
+ };
357
+ var topRightOffsetSize = {
358
+ top: 15,
359
+ bottom: 15,
360
+ };
361
+ var offsetSize = {
362
+ top: 15,
363
+ bottom: 15,
364
+ };
365
+
366
+ // Get all toast messages on the DOM
367
+ var allToasts = document.getElementsByClassName("toastify");
368
+
369
+ var classUsed;
370
+
371
+ // Modifying the position of each toast element
372
+ for (var i = 0; i < allToasts.length; i++) {
373
+ // Getting the applied gravity
374
+ if (containsClass(allToasts[i], "toastify-top") === true) {
375
+ classUsed = "toastify-top";
376
+ } else {
377
+ classUsed = "toastify-bottom";
378
+ }
379
+
380
+ var height = allToasts[i].offsetHeight;
381
+ classUsed = classUsed.substr(9, classUsed.length-1);
382
+ // Spacing between toasts
383
+ var offset = 15;
384
+
385
+ var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
386
+
387
+ // Show toast in center if screen with less than or equal to 360px
388
+ if (width <= 360) {
389
+ // Setting the position
390
+ allToasts[i].style[classUsed] = offsetSize[classUsed] + "px";
391
+
392
+ offsetSize[classUsed] += height + offset;
393
+ } else {
394
+ if (containsClass(allToasts[i], "toastify-left") === true) {
395
+ // Setting the position
396
+ allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + "px";
397
+
398
+ topLeftOffsetSize[classUsed] += height + offset;
399
+ } else {
400
+ // Setting the position
401
+ allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + "px";
402
+
403
+ topRightOffsetSize[classUsed] += height + offset;
404
+ }
405
+ }
406
+ }
407
+
408
+ // Supporting function chaining
409
+ return this;
410
+ };
411
+
412
+ // Helper function to get offset.
413
+ function getAxisOffsetAValue(axis, options) {
414
+
415
+ if(options.offset[axis]) {
416
+ if(isNaN(options.offset[axis])) {
417
+ return options.offset[axis];
418
+ }
419
+ else {
420
+ return options.offset[axis] + 'px';
421
+ }
422
+ }
423
+
424
+ return '0px';
425
+
426
+ }
427
+
428
+ function containsClass(elem, yourClass) {
429
+ if (!elem || typeof yourClass !== "string") {
430
+ return false;
431
+ } else if (
432
+ elem.className &&
433
+ elem.className
434
+ .trim()
435
+ .split(/\s+/gi)
436
+ .indexOf(yourClass) > -1
437
+ ) {
438
+ return true;
439
+ } else {
440
+ return false;
441
+ }
442
+ }
443
+
444
+ // Setting up the prototype for the init object
445
+ Toastify.lib.init.prototype = Toastify.lib;
446
+
447
+ // Returning the Toastify function to be assigned to the window object/module
448
+ return Toastify;
449
+ });
450
+ });
451
+
452
+ class CatNotificationService {
453
+ constructor() {
454
+ // hide constructor
455
+ }
456
+ static getInstance() {
457
+ if (!CatNotificationService.instance) {
458
+ CatNotificationService.instance = new CatNotificationService();
459
+ }
460
+ return CatNotificationService.instance;
461
+ }
462
+ show(content, options) {
463
+ const ref = {};
464
+ const toastContent = this.getNode(content, ref, options);
465
+ const toastOptions = this.getOptions(toastContent, ref, options);
466
+ const toast = toastify(toastOptions);
467
+ ref.toast = toast;
468
+ toast.showToast();
469
+ return () => toast.hideToast();
470
+ }
471
+ getNode(content, ref, options) {
472
+ var _a, _b;
473
+ const template = document.createElement('template');
474
+ template.innerHTML = `<div class="cat-toastify-wrapper">
475
+ ${(options === null || options === void 0 ? void 0 : options.icon) ? `<cat-icon class="cat-toastify-icon" icon="${options.icon}" size="l"></cat-icon>` : ''}
476
+ <div class="cat-toastify-content">
477
+ <div class="cat-toastify-inner">${content}</div>
478
+ ${(options === null || options === void 0 ? void 0 : options.action)
479
+ ? `<cat-button class="cat-toastify-action cat-button-pull" size="s" variant="text" color="primary">${options.action}</cat-button>`
480
+ : ''}
481
+ </div>
482
+ ${(options === null || options === void 0 ? void 0 : options.autoClose) === false
483
+ ? `<cat-button class="cat-toastify-close cat-button-pull" size="s" icon="cross-outlined" variant="text" icon-only="true" class="close" a11y-label="${catI18nRegistry.t('notification.dismiss')}"></cat-button>`
484
+ : ''}
485
+ </div>`;
486
+ const node = template.content.firstElementChild;
487
+ (_a = node.querySelector('.cat-toastify-close')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => { var _a; return (_a = ref.toast) === null || _a === void 0 ? void 0 : _a.hideToast(); });
488
+ (_b = node.querySelector('.cat-toastify-action')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', () => { var _a; return (_a = options === null || options === void 0 ? void 0 : options.onAction) === null || _a === void 0 ? void 0 : _a.call(options, ref); });
489
+ const inner = node.querySelector('.cat-toastify-inner');
490
+ if (inner) {
491
+ if (typeof content !== 'string') {
492
+ inner.replaceChildren(content);
493
+ }
494
+ else if ((options === null || options === void 0 ? void 0 : options.escapeMarkup) === false) {
495
+ inner.innerHTML = content;
496
+ }
497
+ else {
498
+ inner.innerText = content;
499
+ }
500
+ }
501
+ return node;
502
+ }
503
+ getOptions(node, ref, options) {
504
+ var _a, _b, _c;
505
+ const [gravity, position] = ((_b = (_a = options === null || options === void 0 ? void 0 : options.position) === null || _a === void 0 ? void 0 : _a.split('-')) !== null && _b !== void 0 ? _b : ['bottom', 'left']);
506
+ const duration = (_c = options === null || options === void 0 ? void 0 : options.duration) !== null && _c !== void 0 ? _c : ((options === null || options === void 0 ? void 0 : options.autoClose) === false ? -1 : CatNotificationService.duration);
507
+ return {
508
+ gravity,
509
+ position,
510
+ node,
511
+ duration,
512
+ close: false,
513
+ className: (options === null || options === void 0 ? void 0 : options.mode) === 'light' ? 'cat-toastify' : 'cat-toastify cat-toastify-dark',
514
+ stopOnFocus: true,
515
+ onClick: () => { var _a; return (_a = options === null || options === void 0 ? void 0 : options.onClick) === null || _a === void 0 ? void 0 : _a.call(options, ref); },
516
+ callback: () => { var _a; return (_a = options === null || options === void 0 ? void 0 : options.onDismiss) === null || _a === void 0 ? void 0 : _a.call(options, ref); },
517
+ offset: {
518
+ x: '1rem',
519
+ y: '1rem'
520
+ }
521
+ };
522
+ }
523
+ }
524
+ CatNotificationService.duration = 3000;
525
+ const catNotificationService = CatNotificationService.getInstance();
526
+
527
+ export { CatNotificationService, catNotificationService };
2
528
 
3
529
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"file":"index.js","mappings":"","names":[],"sources":[],"sourcesContent":[],"version":3}
1
+ {"file":"index.js","mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA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GAAG,CAAC,CAAA,EAAA;MACzC,MAAM,EAAE;QACN,CAAC,EAAE,MAAM;QACT,CAAC,EAAE,MAAM;OACV;KACF,CAAC;GACH;;AAlFc,+BAAQ,GAAG,IAAI,CAAC;MAqFpB,sBAAsB,GAAG,sBAAsB,CAAC,WAAW;;;;","names":["this","Toastify","i18n"],"sources":["../node_modules/toastify-js/src/toastify.js","./src/components/cat-notification/cat-notification.tsx"],"sourcesContent":["/*!\n * Toastify js 1.12.0\n * https://github.com/apvarun/toastify-js\n * @license MIT licensed\n *\n * Copyright (C) 2018 Varun A P\n */\n(function(root, factory) {\n if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n } else {\n root.Toastify = factory();\n }\n})(this, function(global) {\n // Object initialization\n var Toastify = function(options) {\n // Returning a new init object\n return new Toastify.lib.init(options);\n },\n // Library version\n version = \"1.12.0\";\n\n // Set the default global options\n Toastify.defaults = {\n oldestFirst: true,\n text: \"Toastify is awesome!\",\n node: undefined,\n duration: 3000,\n selector: undefined,\n callback: function () {\n },\n destination: undefined,\n newWindow: false,\n close: false,\n gravity: \"toastify-top\",\n positionLeft: false,\n position: '',\n backgroundColor: '',\n avatar: \"\",\n className: \"\",\n stopOnFocus: true,\n onClick: function () {\n },\n offset: {x: 0, y: 0},\n escapeMarkup: true,\n ariaLive: 'polite',\n style: {background: ''}\n };\n\n // Defining the prototype of the object\n Toastify.lib = Toastify.prototype = {\n toastify: version,\n\n constructor: Toastify,\n\n // Initializing the object with required parameters\n init: function(options) {\n // Verifying and validating the input object\n if (!options) {\n options = {};\n }\n\n // Creating the options object\n this.options = {};\n\n this.toastElement = null;\n\n // Validating the options\n this.options.text = options.text || Toastify.defaults.text; // Display message\n this.options.node = options.node || Toastify.defaults.node; // Display content as node\n this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration\n this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector\n this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display\n this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination\n this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window\n this.options.close = options.close || Toastify.defaults.close; // Show toast close icon\n this.options.gravity = options.gravity === \"bottom\" ? \"toastify-bottom\" : Toastify.defaults.gravity; // toast position - top or bottom\n this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right\n this.options.position = options.position || Toastify.defaults.position; // toast position - left or right\n this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color\n this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path\n this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast\n this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus\n this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click\n this.options.offset = options.offset || Toastify.defaults.offset; // toast offset\n this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup;\n this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive;\n this.options.style = options.style || Toastify.defaults.style;\n if(options.backgroundColor) {\n this.options.style.background = options.backgroundColor;\n }\n\n // Returning the current object for chaining functions\n return this;\n },\n\n // Building the DOM element\n buildToast: function() {\n // Validating if the options are defined\n if (!this.options) {\n throw \"Toastify is not initialized\";\n }\n\n // Creating the DOM object\n var divElement = document.createElement(\"div\");\n divElement.className = \"toastify on \" + this.options.className;\n\n // Positioning toast to left or right or center\n if (!!this.options.position) {\n divElement.className += \" toastify-\" + this.options.position;\n } else {\n // To be depreciated in further versions\n if (this.options.positionLeft === true) {\n divElement.className += \" toastify-left\";\n console.warn('Property `positionLeft` will be depreciated in further versions. Please use `position` instead.')\n } else {\n // Default position\n divElement.className += \" toastify-right\";\n }\n }\n\n // Assigning gravity of element\n divElement.className += \" \" + this.options.gravity;\n\n if (this.options.backgroundColor) {\n // This is being deprecated in favor of using the style HTML DOM property\n console.warn('DEPRECATION NOTICE: \"backgroundColor\" is being deprecated. Please use the \"style.background\" property.');\n }\n\n // Loop through our style object and apply styles to divElement\n for (var property in this.options.style) {\n divElement.style[property] = this.options.style[property];\n }\n\n // Announce the toast to screen readers\n if (this.options.ariaLive) {\n divElement.setAttribute('aria-live', this.options.ariaLive)\n }\n\n // Adding the toast message/node\n if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {\n // If we have a valid node, we insert it\n divElement.appendChild(this.options.node)\n } else {\n if (this.options.escapeMarkup) {\n divElement.innerText = this.options.text;\n } else {\n divElement.innerHTML = this.options.text;\n }\n\n if (this.options.avatar !== \"\") {\n var avatarElement = document.createElement(\"img\");\n avatarElement.src = this.options.avatar;\n\n avatarElement.className = \"toastify-avatar\";\n\n if (this.options.position == \"left\" || this.options.positionLeft === true) {\n // Adding close icon on the left of content\n divElement.appendChild(avatarElement);\n } else {\n // Adding close icon on the right of content\n divElement.insertAdjacentElement(\"afterbegin\", avatarElement);\n }\n }\n }\n\n // Adding a close icon to the toast\n if (this.options.close === true) {\n // Create a span for close element\n var closeElement = document.createElement(\"button\");\n closeElement.type = \"button\";\n closeElement.setAttribute(\"aria-label\", \"Close\");\n closeElement.className = \"toast-close\";\n closeElement.innerHTML = \"&#10006;\";\n\n // Triggering the removal of toast from DOM on close click\n closeElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n this.removeElement(this.toastElement);\n window.clearTimeout(this.toastElement.timeOutValue);\n }.bind(this)\n );\n\n //Calculating screen width\n var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n // Adding the close icon to the toast element\n // Display on the right if screen width is less than or equal to 360px\n if ((this.options.position == \"left\" || this.options.positionLeft === true) && width > 360) {\n // Adding close icon on the left of content\n divElement.insertAdjacentElement(\"afterbegin\", closeElement);\n } else {\n // Adding close icon on the right of content\n divElement.appendChild(closeElement);\n }\n }\n\n // Clear timeout while toast is focused\n if (this.options.stopOnFocus && this.options.duration > 0) {\n var self = this;\n // stop countdown\n divElement.addEventListener(\n \"mouseover\",\n function(event) {\n window.clearTimeout(divElement.timeOutValue);\n }\n )\n // add back the timeout\n divElement.addEventListener(\n \"mouseleave\",\n function() {\n divElement.timeOutValue = window.setTimeout(\n function() {\n // Remove the toast from DOM\n self.removeElement(divElement);\n },\n self.options.duration\n )\n }\n )\n }\n\n // Adding an on-click destination path\n if (typeof this.options.destination !== \"undefined\") {\n divElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n if (this.options.newWindow === true) {\n window.open(this.options.destination, \"_blank\");\n } else {\n window.location = this.options.destination;\n }\n }.bind(this)\n );\n }\n\n if (typeof this.options.onClick === \"function\" && typeof this.options.destination === \"undefined\") {\n divElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n this.options.onClick();\n }.bind(this)\n );\n }\n\n // Adding offset\n if(typeof this.options.offset === \"object\") {\n\n var x = getAxisOffsetAValue(\"x\", this.options);\n var y = getAxisOffsetAValue(\"y\", this.options);\n\n var xOffset = this.options.position == \"left\" ? x : \"-\" + x;\n var yOffset = this.options.gravity == \"toastify-top\" ? y : \"-\" + y;\n\n divElement.style.transform = \"translate(\" + xOffset + \",\" + yOffset + \")\";\n\n }\n\n // Returning the generated element\n return divElement;\n },\n\n // Displaying the toast\n showToast: function() {\n // Creating the DOM object for the toast\n this.toastElement = this.buildToast();\n\n // Getting the root element to with the toast needs to be added\n var rootElement;\n if (typeof this.options.selector === \"string\") {\n rootElement = document.getElementById(this.options.selector);\n } else if (this.options.selector instanceof HTMLElement || (typeof ShadowRoot !== 'undefined' && this.options.selector instanceof ShadowRoot)) {\n rootElement = this.options.selector;\n } else {\n rootElement = document.body;\n }\n\n // Validating if root element is present in DOM\n if (!rootElement) {\n throw \"Root element is not defined\";\n }\n\n // Adding the DOM element\n var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild;\n rootElement.insertBefore(this.toastElement, elementToInsert);\n\n // Repositioning the toasts in case multiple toasts are present\n Toastify.reposition();\n\n if (this.options.duration > 0) {\n this.toastElement.timeOutValue = window.setTimeout(\n function() {\n // Remove the toast from DOM\n this.removeElement(this.toastElement);\n }.bind(this),\n this.options.duration\n ); // Binding `this` for function invocation\n }\n\n // Supporting function chaining\n return this;\n },\n\n hideToast: function() {\n if (this.toastElement.timeOutValue) {\n clearTimeout(this.toastElement.timeOutValue);\n }\n this.removeElement(this.toastElement);\n },\n\n // Removing the element from the DOM\n removeElement: function(toastElement) {\n // Hiding the element\n // toastElement.classList.remove(\"on\");\n toastElement.className = toastElement.className.replace(\" on\", \"\");\n\n // Removing the element from DOM after transition end\n window.setTimeout(\n function() {\n // remove options node if any\n if (this.options.node && this.options.node.parentNode) {\n this.options.node.parentNode.removeChild(this.options.node);\n }\n\n // Remove the element from the DOM, only when the parent node was not removed before.\n if (toastElement.parentNode) {\n toastElement.parentNode.removeChild(toastElement);\n }\n\n // Calling the callback function\n this.options.callback.call(toastElement);\n\n // Repositioning the toasts again\n Toastify.reposition();\n }.bind(this),\n 400\n ); // Binding `this` for function invocation\n },\n };\n\n // Positioning the toasts on the DOM\n Toastify.reposition = function() {\n\n // Top margins with gravity\n var topLeftOffsetSize = {\n top: 15,\n bottom: 15,\n };\n var topRightOffsetSize = {\n top: 15,\n bottom: 15,\n };\n var offsetSize = {\n top: 15,\n bottom: 15,\n };\n\n // Get all toast messages on the DOM\n var allToasts = document.getElementsByClassName(\"toastify\");\n\n var classUsed;\n\n // Modifying the position of each toast element\n for (var i = 0; i < allToasts.length; i++) {\n // Getting the applied gravity\n if (containsClass(allToasts[i], \"toastify-top\") === true) {\n classUsed = \"toastify-top\";\n } else {\n classUsed = \"toastify-bottom\";\n }\n\n var height = allToasts[i].offsetHeight;\n classUsed = classUsed.substr(9, classUsed.length-1)\n // Spacing between toasts\n var offset = 15;\n\n var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n // Show toast in center if screen with less than or equal to 360px\n if (width <= 360) {\n // Setting the position\n allToasts[i].style[classUsed] = offsetSize[classUsed] + \"px\";\n\n offsetSize[classUsed] += height + offset;\n } else {\n if (containsClass(allToasts[i], \"toastify-left\") === true) {\n // Setting the position\n allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + \"px\";\n\n topLeftOffsetSize[classUsed] += height + offset;\n } else {\n // Setting the position\n allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + \"px\";\n\n topRightOffsetSize[classUsed] += height + offset;\n }\n }\n }\n\n // Supporting function chaining\n return this;\n };\n\n // Helper function to get offset.\n function getAxisOffsetAValue(axis, options) {\n\n if(options.offset[axis]) {\n if(isNaN(options.offset[axis])) {\n return options.offset[axis];\n }\n else {\n return options.offset[axis] + 'px';\n }\n }\n\n return '0px';\n\n }\n\n function containsClass(elem, yourClass) {\n if (!elem || typeof yourClass !== \"string\") {\n return false;\n } else if (\n elem.className &&\n elem.className\n .trim()\n .split(/\\s+/gi)\n .indexOf(yourClass) > -1\n ) {\n return true;\n } else {\n return false;\n }\n }\n\n // Setting up the prototype for the init object\n Toastify.lib.init.prototype = Toastify.lib;\n\n // Returning the Toastify function to be assigned to the window object/module\n return Toastify;\n});\n","import Toastify, { Options } from 'toastify-js';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\ninterface ToastRef {\n toast?: {\n showToast: () => void;\n hideToast: () => void;\n };\n}\n\nexport interface ToastOptions {\n mode: 'dark' | 'light';\n icon: string;\n position: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';\n autoClose: boolean;\n duration: number;\n action: string;\n escapeMarkup: boolean;\n onAction: (toast: ToastRef) => void;\n onClick: (toast: ToastRef) => void;\n onDismiss: (toast: ToastRef) => void;\n}\n\nexport class CatNotificationService {\n private static instance: CatNotificationService;\n private static duration = 3000;\n\n private constructor() {\n // hide constructor\n }\n\n static getInstance(): CatNotificationService {\n if (!CatNotificationService.instance) {\n CatNotificationService.instance = new CatNotificationService();\n }\n return CatNotificationService.instance;\n }\n\n show(content: string | Node, options?: Partial<ToastOptions>): () => void {\n const ref: ToastRef = {};\n const toastContent = this.getNode(content, ref, options);\n const toastOptions = this.getOptions(toastContent, ref, options);\n const toast = Toastify(toastOptions);\n ref.toast = toast;\n toast.showToast();\n return () => toast.hideToast();\n }\n\n private getNode(content: string | Node, ref: ToastRef, options?: Partial<ToastOptions>): HTMLElement {\n const template = document.createElement('template');\n template.innerHTML = `<div class=\"cat-toastify-wrapper\">\n ${options?.icon ? `<cat-icon class=\"cat-toastify-icon\" icon=\"${options.icon}\" size=\"l\"></cat-icon>` : ''}\n <div class=\"cat-toastify-content\">\n <div class=\"cat-toastify-inner\">${content}</div>\n ${\n options?.action\n ? `<cat-button class=\"cat-toastify-action cat-button-pull\" size=\"s\" variant=\"text\" color=\"primary\">${options.action}</cat-button>`\n : ''\n }\n </div>\n ${\n options?.autoClose === false\n ? `<cat-button class=\"cat-toastify-close cat-button-pull\" size=\"s\" icon=\"cross-outlined\" variant=\"text\" icon-only=\"true\" class=\"close\" a11y-label=\"${i18n.t(\n 'notification.dismiss'\n )}\"></cat-button>`\n : ''\n }\n </div>`;\n\n const node = template.content.firstElementChild as HTMLElement;\n node.querySelector('.cat-toastify-close')?.addEventListener('click', () => ref.toast?.hideToast());\n node.querySelector('.cat-toastify-action')?.addEventListener('click', () => options?.onAction?.(ref));\n const inner = node.querySelector<HTMLDivElement>('.cat-toastify-inner');\n if (inner) {\n if (typeof content !== 'string') {\n inner.replaceChildren(content);\n } else if (options?.escapeMarkup === false) {\n inner.innerHTML = content;\n } else {\n inner.innerText = content;\n }\n }\n\n return node;\n }\n\n private getOptions(node: Node, ref: ToastRef, options?: Partial<ToastOptions>): Options {\n const [gravity, position] = (options?.position?.split('-') ?? ['bottom', 'left']) as [\n Options['gravity'],\n Options['position']\n ];\n const duration = options?.duration ?? (options?.autoClose === false ? -1 : CatNotificationService.duration);\n return {\n gravity,\n position,\n node,\n duration,\n close: false,\n className: options?.mode === 'light' ? 'cat-toastify' : 'cat-toastify cat-toastify-dark',\n stopOnFocus: true,\n onClick: () => options?.onClick?.(ref),\n callback: () => options?.onDismiss?.(ref),\n offset: {\n x: '1rem',\n y: '1rem'\n }\n };\n }\n}\n\nexport const catNotificationService = CatNotificationService.getInstance();\n"],"version":3}
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["cat-alert_22",[[1,"cat-select-demo"],[1,"cat-input",{"autoComplete":[1,"auto-complete"],"clearable":[4],"disabled":[4],"hint":[1],"icon":[1],"iconRight":[4,"icon-right"],"label":[1],"labelHidden":[4,"label-hidden"],"max":[8],"maxLength":[2,"max-length"],"min":[8],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"textPrefix":[1,"text-prefix"],"textSuffix":[1,"text-suffix"],"readonly":[4],"required":[4],"round":[4],"type":[1],"value":[1032],"hasSlottedLabel":[32],"setFocus":[64],"clear":[64]}],[1,"cat-tabs",{"activeTab":[1,"active-tab"],"tabsAlign":[1,"tabs-align"],"tabs":[32],"activeTabId":[32]},[[0,"keydown","onKeydown"]]],[0,"cat-toast-demo"],[1,"cat-alert",{"color":[1],"icon":[1],"noIcon":[4,"no-icon"]}],[1,"cat-badge",{"variant":[1],"color":[1],"size":[1],"round":[4],"pulse":[4]}],[1,"cat-card"],[1,"cat-radio",{"checked":[1028],"disabled":[4],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"setFocus":[64]}],[1,"cat-radio-group",{"name":[1],"value":[1025],"disabled":[4],"a11yLabel":[1,"a11y-label"],"labelLeft":[4,"label-left"]},[[0,"keydown","onKeydown"],[0,"input","onInput"],[2,"blur","onBlur"]]],[1,"cat-tab",{"label":[513],"icon":[513],"iconOnly":[520,"icon-only"],"iconRight":[516,"icon-right"],"url":[513],"urlTarget":[513,"url-target"],"deactivated":[516]},[[0,"click","onClick"]]],[1,"cat-textarea",{"disabled":[4],"hint":[1],"label":[1],"labelHidden":[4,"label-hidden"],"maxLength":[2,"max-length"],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"value":[1032],"hasSlottedLabel":[32],"setFocus":[64]}],[1,"cat-toggle",{"checked":[1028],"disabled":[4],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1032],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"setFocus":[64]}],[1,"cat-tooltip",{"content":[1],"disabled":[4],"placement":[1],"round":[4],"size":[1],"showDelay":[2,"show-delay"],"hideDelay":[2,"hide-delay"],"longTouchDuration":[2,"long-touch-duration"]},[[0,"keydown","handleKeyDown"]]],[1,"cat-select",{"multiple":[4],"debounce":[2],"placement":[1],"value":[1025],"disabled":[4],"placeholder":[1],"hint":[1],"label":[1],"name":[1],"labelHidden":[4,"label-hidden"],"required":[4],"clearable":[4],"tags":[4],"tagHint":[1,"tag-hint"],"connector":[32],"state":[32],"hasSlottedLabel":[32],"connect":[64]},[[0,"blur","onBlur"],[0,"keydown","onKeyDown"],[0,"keyup","onKeyUp"]]],[1,"cat-menu",{"placement":[1],"noAutoClose":[4,"no-auto-close"],"overflow":[4],"close":[64]},[[0,"catClick","clickHandler"]]],[1,"cat-avatar",{"size":[1],"round":[4],"label":[1],"initials":[1],"src":[1],"icon":[1],"url":[1],"urlTarget":[1,"url-target"],"backgroundImage":[32]}],[1,"cat-checkbox",{"checked":[1028],"disabled":[4],"indeterminate":[4],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1032],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"setFocus":[64]}],[1,"cat-scrollable",{"noShadowX":[4,"no-shadow-x"],"noShadowY":[4,"no-shadow-y"],"noOverflowX":[4,"no-overflow-x"],"noOverflowY":[4,"no-overflow-y"],"noOverscroll":[4,"no-overscroll"],"noScrolledInit":[4,"no-scrolled-init"],"scrolledBuffer":[2,"scrolled-buffer"]}],[1,"cat-skeleton",{"effect":[1],"variant":[1],"size":[1],"lines":[2]}],[1,"cat-button",{"variant":[1],"color":[1],"active":[4],"size":[1],"name":[1],"value":[1],"disabled":[4],"loading":[4],"submit":[4],"noEllipsis":[4,"no-ellipsis"],"round":[4],"url":[1],"urlTarget":[1,"url-target"],"icon":[1],"iconOnly":[8,"icon-only"],"iconRight":[4,"icon-right"],"buttonId":[1,"button-id"],"a11yLabel":[1,"a11y-label"],"_iconOnly":[32],"setFocus":[64]},[[0,"click","haltDisabledEvents"]]],[1,"cat-spinner",{"size":[1],"a11yLabel":[1,"a11y-label"]}],[1,"cat-icon",{"icon":[1],"size":[1],"a11yLabel":[1,"a11y-label"]}]]],["cat-modal",[[1,"cat-modal",{"size":[1],"isVisible":[32],"show":[64]}]]]], options);
13
+ return bootstrapLazy([["cat-alert_22",[[1,"cat-select-demo"],[1,"cat-input",{"autoComplete":[1,"auto-complete"],"clearable":[4],"disabled":[4],"hint":[1],"icon":[1],"iconRight":[4,"icon-right"],"label":[1],"labelHidden":[4,"label-hidden"],"max":[8],"maxLength":[2,"max-length"],"min":[8],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"textPrefix":[1,"text-prefix"],"textSuffix":[1,"text-suffix"],"readonly":[4],"required":[4],"round":[4],"type":[1],"value":[1032],"hasSlottedLabel":[32],"setFocus":[64],"clear":[64]}],[1,"cat-pagination",{"page":[1026],"pageCount":[2,"page-count"],"activePadding":[2,"active-padding"],"sidePadding":[2,"side-padding"],"size":[1],"variant":[1],"round":[4],"compact":[4],"iconPrev":[1,"icon-prev"],"iconNext":[1,"icon-next"]}],[1,"cat-tabs",{"activeTab":[1,"active-tab"],"tabsAlign":[1,"tabs-align"],"tabs":[32],"activeTabId":[32]},[[0,"keydown","onKeydown"]]],[1,"cat-alert",{"color":[1],"icon":[1],"noIcon":[4,"no-icon"]}],[1,"cat-badge",{"variant":[1],"color":[1],"size":[1],"round":[4],"pulse":[4]}],[1,"cat-card"],[1,"cat-radio",{"checked":[1028],"disabled":[4],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"setFocus":[64]}],[1,"cat-radio-group",{"name":[1],"value":[1025],"disabled":[4],"a11yLabel":[1,"a11y-label"],"labelLeft":[4,"label-left"]},[[0,"keydown","onKeydown"],[0,"input","onInput"],[2,"blur","onBlur"]]],[1,"cat-tab",{"label":[513],"icon":[513],"iconOnly":[520,"icon-only"],"iconRight":[516,"icon-right"],"url":[513],"urlTarget":[513,"url-target"],"deactivated":[516]},[[0,"click","onClick"]]],[1,"cat-textarea",{"disabled":[4],"hint":[1],"label":[1],"labelHidden":[4,"label-hidden"],"maxLength":[2,"max-length"],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"value":[1032],"hasSlottedLabel":[32],"setFocus":[64]}],[1,"cat-toggle",{"checked":[1028],"disabled":[4],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1032],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"setFocus":[64]}],[1,"cat-tooltip",{"content":[1],"disabled":[4],"placement":[1],"round":[4],"size":[1],"showDelay":[2,"show-delay"],"hideDelay":[2,"hide-delay"],"longTouchDuration":[2,"long-touch-duration"]},[[0,"keydown","handleKeyDown"]]],[1,"cat-select",{"multiple":[4],"debounce":[2],"placement":[1],"value":[1025],"disabled":[4],"placeholder":[1],"hint":[1],"label":[1],"name":[1],"labelHidden":[4,"label-hidden"],"required":[4],"clearable":[4],"tags":[4],"tagHint":[1,"tag-hint"],"connector":[32],"state":[32],"hasSlottedLabel":[32],"connect":[64]},[[0,"blur","onBlur"],[0,"keydown","onKeyDown"],[0,"keyup","onKeyUp"]]],[1,"cat-dropdown",{"placement":[1],"noAutoClose":[4,"no-auto-close"],"overflow":[4],"close":[64]},[[0,"catClick","clickHandler"]]],[1,"cat-avatar",{"size":[1],"round":[4],"label":[1],"initials":[1],"src":[1],"icon":[1],"url":[1],"urlTarget":[1,"url-target"],"backgroundImage":[32]}],[1,"cat-checkbox",{"checked":[1028],"disabled":[4],"indeterminate":[4],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1032],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"setFocus":[64]}],[1,"cat-scrollable",{"noShadowX":[4,"no-shadow-x"],"noShadowY":[4,"no-shadow-y"],"noOverflowX":[4,"no-overflow-x"],"noOverflowY":[4,"no-overflow-y"],"noOverscroll":[4,"no-overscroll"],"noScrolledInit":[4,"no-scrolled-init"],"scrolledBuffer":[2,"scrolled-buffer"]}],[1,"cat-skeleton",{"effect":[1],"variant":[1],"size":[1],"lines":[2]}],[1,"cat-button",{"variant":[1],"color":[1],"active":[4],"size":[1],"name":[1],"value":[1],"disabled":[4],"loading":[4],"submit":[4],"noEllipsis":[4,"no-ellipsis"],"round":[4],"url":[1],"urlTarget":[1,"url-target"],"icon":[1],"iconOnly":[8,"icon-only"],"iconRight":[4,"icon-right"],"buttonId":[1,"button-id"],"a11yLabel":[1,"a11y-label"],"a11yCurrent":[4,"a11y-current"],"_iconOnly":[32],"setFocus":[64]},[[0,"click","haltDisabledEvents"]]],[1,"cat-spinner",{"size":[1],"a11yLabel":[1,"a11y-label"]}],[1,"cat-icon",{"icon":[1],"size":[1],"a11yLabel":[1,"a11y-label"]}]]],["cat-modal",[[1,"cat-modal",{"size":[1],"isVisible":[32],"show":[64]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -98,6 +98,10 @@ export declare class CatButton {
98
98
  * button for users who use assistive technology.
99
99
  */
100
100
  a11yLabel?: string;
101
+ /**
102
+ * Sets the `aria-current` attribute on the button.
103
+ */
104
+ a11yCurrent?: boolean;
101
105
  onIconOnlyChanged(value: boolean | Breakpoint): void;
102
106
  /**
103
107
  * Emitted when the button is clicked.