monkey-style-guide-v2 0.0.4 → 0.0.6

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 (169) hide show
  1. package/assets/scss/directives/_index.scss +7 -0
  2. package/assets/scss/directives/_styles.scss +100 -0
  3. package/assets/scss/input/_index.scss +7 -0
  4. package/assets/scss/input/_styles.scss +43 -0
  5. package/assets/scss/partials/_index.scss +7 -0
  6. package/assets/scss/partials/_style-reset.scss +189 -0
  7. package/assets/scss/partials/_variables.scss +178 -0
  8. package/assets/scss/table/_index.scss +7 -0
  9. package/assets/scss/table/_styles.scss +45 -0
  10. package/assets/scss/theme.scss +11 -0
  11. package/assets/scss/typography/_function.scss +23 -0
  12. package/assets/scss/typography/_index.scss +9 -0
  13. package/assets/scss/typography/_mixins.scss +111 -0
  14. package/assets/scss/typography/_styles.scss +173 -0
  15. package/esm2022/lib/components/index.mjs +14 -1
  16. package/esm2022/lib/components/monkey-accordion/index.mjs +2 -0
  17. package/esm2022/lib/components/monkey-accordion/monkey-accordion.component.mjs +102 -0
  18. package/esm2022/lib/components/monkey-alert/index.mjs +2 -0
  19. package/esm2022/lib/components/monkey-alert/monkey-alert.component.mjs +50 -0
  20. package/esm2022/lib/components/monkey-breadcrumb/index.mjs +2 -0
  21. package/esm2022/lib/components/monkey-breadcrumb/monkey-breadcrumb.component.mjs +56 -0
  22. package/esm2022/lib/components/monkey-button/monkey-button.component.mjs +27 -12
  23. package/esm2022/lib/components/monkey-checkbox/index.mjs +2 -0
  24. package/esm2022/lib/components/monkey-checkbox/monkey-checkbox.component.mjs +216 -0
  25. package/esm2022/lib/components/monkey-divider/index.mjs +2 -0
  26. package/esm2022/lib/components/monkey-divider/monkey-divider.component.mjs +44 -0
  27. package/esm2022/lib/components/monkey-form-field/form-field-control.mjs +15 -0
  28. package/esm2022/lib/components/monkey-form-field/form-field.mjs +250 -0
  29. package/esm2022/lib/components/monkey-form-field/index.mjs +5 -0
  30. package/esm2022/lib/components/monkey-form-field/module.mjs +21 -0
  31. package/esm2022/lib/components/monkey-form-field/utils.mjs +16 -0
  32. package/esm2022/lib/components/monkey-icon/monkey-icon.component.mjs +31 -15
  33. package/esm2022/lib/components/monkey-icon-button/monkey-icon-button.component.mjs +25 -9
  34. package/esm2022/lib/components/monkey-input/index.mjs +5 -0
  35. package/esm2022/lib/components/monkey-input/monkey-input-currency.directive.mjs +187 -0
  36. package/esm2022/lib/components/monkey-input/monkey-input.directive.mjs +166 -0
  37. package/esm2022/lib/components/monkey-input/monkey-input.module.mjs +24 -0
  38. package/esm2022/lib/components/monkey-input/validators.mjs +17 -0
  39. package/esm2022/lib/components/monkey-option/index.mjs +2 -0
  40. package/esm2022/lib/components/monkey-option/monkey-option.component.mjs +54 -0
  41. package/esm2022/lib/components/monkey-security-level/monkey-security-level.component.mjs +30 -14
  42. package/esm2022/lib/components/monkey-select/index.mjs +2 -0
  43. package/esm2022/lib/components/monkey-select/monkey-select.component.mjs +352 -0
  44. package/esm2022/lib/components/monkey-status/monkey-status.component.mjs +28 -12
  45. package/esm2022/lib/components/monkey-table/components/pagination-action/pagination-action.mjs +53 -0
  46. package/esm2022/lib/components/monkey-table/components/pagination-label/pagination-label.mjs +34 -0
  47. package/esm2022/lib/components/monkey-table/components/pagination-size/pagination-size.mjs +57 -0
  48. package/esm2022/lib/components/monkey-table/directives/column-checked.mjs +109 -0
  49. package/esm2022/lib/components/monkey-table/directives/column-expansible.mjs +134 -0
  50. package/esm2022/lib/components/monkey-table/directives/column-sortable.mjs +97 -0
  51. package/esm2022/lib/components/monkey-table/directives/column-stick.mjs +28 -0
  52. package/esm2022/lib/components/monkey-table/index.mjs +10 -0
  53. package/esm2022/lib/components/monkey-table/table.mjs +132 -0
  54. package/esm2022/lib/components/monkey-table/table.module.mjs +60 -0
  55. package/esm2022/lib/components/monkey-toast/index.mjs +2 -0
  56. package/esm2022/lib/components/monkey-toast/monkey-toast.component.mjs +74 -0
  57. package/esm2022/lib/components/monkey-toggle/monkey-toggle.component.mjs +28 -14
  58. package/esm2022/lib/components/monkey-toggle-line/index.mjs +3 -0
  59. package/esm2022/lib/components/monkey-toggle-line/monkey-toggle-line-button/index.mjs +2 -0
  60. package/esm2022/lib/components/monkey-toggle-line/monkey-toggle-line-button/monkey-toggle-line-button.component.mjs +24 -0
  61. package/esm2022/lib/components/monkey-toggle-line/monkey-toggle-line.component.mjs +85 -0
  62. package/esm2022/lib/components/monkey-tooltip/index.mjs +3 -0
  63. package/esm2022/lib/components/monkey-tooltip/monkey-tooltip.directive.mjs +175 -0
  64. package/esm2022/lib/components/monkey-tooltip/tooltip/index.mjs +2 -0
  65. package/esm2022/lib/components/monkey-tooltip/tooltip/tooltip.component.mjs +53 -0
  66. package/esm2022/lib/directives/error.mjs +18 -0
  67. package/esm2022/lib/directives/helper.mjs +18 -0
  68. package/esm2022/lib/directives/index.mjs +8 -0
  69. package/esm2022/lib/directives/info.mjs +18 -0
  70. package/esm2022/lib/directives/label.mjs +18 -0
  71. package/esm2022/lib/directives/module.mjs +26 -0
  72. package/esm2022/lib/directives/prefix.mjs +18 -0
  73. package/esm2022/lib/directives/suffix.mjs +43 -0
  74. package/esm2022/lib/interfaces/alert.mjs +2 -0
  75. package/esm2022/lib/interfaces/breadcrumb.mjs +2 -0
  76. package/esm2022/lib/interfaces/button.mjs +2 -0
  77. package/esm2022/lib/interfaces/index.mjs +7 -0
  78. package/esm2022/lib/interfaces/sizes.mjs +2 -0
  79. package/esm2022/lib/interfaces/table.mjs +2 -0
  80. package/esm2022/lib/interfaces/toast.mjs +10 -0
  81. package/esm2022/lib/services/index.mjs +4 -0
  82. package/esm2022/lib/services/monkey-destroy.service.mjs +15 -0
  83. package/esm2022/lib/services/monkey-icons.service.mjs +45 -0
  84. package/esm2022/lib/services/monkey-toast.service.mjs +72 -0
  85. package/esm2022/public-api.mjs +6 -3
  86. package/esm2022/utils/id-generator.mjs +20 -0
  87. package/esm2022/utils/index.mjs +4 -0
  88. package/esm2022/utils/tests-utils.mjs +4 -0
  89. package/esm2022/utils/utils.mjs +10 -0
  90. package/fesm2022/monkey-style-guide-v2.mjs +3049 -121
  91. package/fesm2022/monkey-style-guide-v2.mjs.map +1 -1
  92. package/lib/components/index.d.ts +13 -0
  93. package/lib/components/monkey-accordion/index.d.ts +1 -0
  94. package/lib/components/monkey-accordion/monkey-accordion.component.d.ts +22 -0
  95. package/lib/components/monkey-alert/index.d.ts +1 -0
  96. package/lib/components/monkey-alert/monkey-alert.component.d.ts +23 -0
  97. package/lib/components/monkey-breadcrumb/index.d.ts +1 -0
  98. package/lib/components/monkey-breadcrumb/monkey-breadcrumb.component.d.ts +18 -0
  99. package/lib/components/monkey-button/monkey-button.component.d.ts +11 -4
  100. package/lib/components/monkey-checkbox/index.d.ts +1 -0
  101. package/lib/components/monkey-checkbox/monkey-checkbox.component.d.ts +50 -0
  102. package/lib/components/monkey-divider/index.d.ts +1 -0
  103. package/lib/components/monkey-divider/monkey-divider.component.d.ts +20 -0
  104. package/lib/components/monkey-form-field/form-field-control.d.ts +18 -0
  105. package/lib/components/monkey-form-field/form-field.d.ts +74 -0
  106. package/lib/components/monkey-form-field/index.d.ts +4 -0
  107. package/lib/components/monkey-form-field/module.d.ts +7 -0
  108. package/lib/components/monkey-form-field/utils.d.ts +6 -0
  109. package/lib/components/monkey-icon/monkey-icon.component.d.ts +6 -1
  110. package/lib/components/monkey-icon-button/monkey-icon-button.component.d.ts +6 -1
  111. package/lib/components/monkey-input/index.d.ts +4 -0
  112. package/lib/components/monkey-input/monkey-input-currency.directive.d.ts +57 -0
  113. package/lib/components/monkey-input/monkey-input.directive.d.ts +46 -0
  114. package/lib/components/monkey-input/monkey-input.module.d.ts +8 -0
  115. package/lib/components/monkey-input/validators.d.ts +1 -0
  116. package/lib/components/monkey-option/index.d.ts +1 -0
  117. package/lib/components/monkey-option/monkey-option.component.d.ts +22 -0
  118. package/lib/components/monkey-security-level/monkey-security-level.component.d.ts +7 -2
  119. package/lib/components/monkey-select/index.d.ts +1 -0
  120. package/lib/components/monkey-select/monkey-select.component.d.ts +74 -0
  121. package/lib/components/monkey-status/monkey-status.component.d.ts +8 -3
  122. package/lib/components/monkey-table/components/pagination-action/pagination-action.d.ts +17 -0
  123. package/lib/components/monkey-table/components/pagination-label/pagination-label.d.ts +10 -0
  124. package/lib/components/monkey-table/components/pagination-size/pagination-size.d.ts +15 -0
  125. package/lib/components/monkey-table/directives/column-checked.d.ts +32 -0
  126. package/lib/components/monkey-table/directives/column-expansible.d.ts +25 -0
  127. package/lib/components/monkey-table/directives/column-sortable.d.ts +24 -0
  128. package/lib/components/monkey-table/directives/column-stick.d.ts +6 -0
  129. package/lib/components/monkey-table/index.d.ts +9 -0
  130. package/lib/components/monkey-table/table.d.ts +32 -0
  131. package/lib/components/monkey-table/table.module.d.ts +15 -0
  132. package/lib/components/monkey-toast/index.d.ts +1 -0
  133. package/lib/components/monkey-toast/monkey-toast.component.d.ts +26 -0
  134. package/lib/components/monkey-toggle/monkey-toggle.component.d.ts +6 -1
  135. package/lib/components/monkey-toggle-line/index.d.ts +2 -0
  136. package/lib/components/monkey-toggle-line/monkey-toggle-line-button/index.d.ts +1 -0
  137. package/lib/components/monkey-toggle-line/monkey-toggle-line-button/monkey-toggle-line-button.component.d.ts +16 -0
  138. package/lib/components/monkey-toggle-line/monkey-toggle-line.component.d.ts +24 -0
  139. package/lib/components/monkey-tooltip/index.d.ts +2 -0
  140. package/lib/components/monkey-tooltip/monkey-tooltip.directive.d.ts +30 -0
  141. package/lib/components/monkey-tooltip/tooltip/index.d.ts +1 -0
  142. package/lib/components/monkey-tooltip/tooltip/tooltip.component.d.ts +19 -0
  143. package/lib/directives/error.d.ts +5 -0
  144. package/lib/directives/helper.d.ts +5 -0
  145. package/lib/directives/index.d.ts +7 -0
  146. package/lib/directives/info.d.ts +5 -0
  147. package/lib/directives/label.d.ts +5 -0
  148. package/lib/directives/module.d.ts +12 -0
  149. package/lib/directives/prefix.d.ts +5 -0
  150. package/lib/directives/suffix.d.ts +9 -0
  151. package/lib/interfaces/alert.d.ts +1 -0
  152. package/lib/interfaces/breadcrumb.d.ts +5 -0
  153. package/lib/interfaces/button.d.ts +1 -0
  154. package/lib/interfaces/index.d.ts +6 -0
  155. package/lib/interfaces/sizes.d.ts +1 -0
  156. package/lib/interfaces/table.d.ts +4 -0
  157. package/lib/interfaces/toast.d.ts +22 -0
  158. package/lib/services/index.d.ts +3 -0
  159. package/lib/services/monkey-destroy.service.d.ts +8 -0
  160. package/lib/services/monkey-icons.service.d.ts +14 -0
  161. package/lib/services/monkey-toast.service.d.ts +13 -0
  162. package/monkey-style-guide-v2-0.0.6.tgz +0 -0
  163. package/package.json +10 -3
  164. package/public-api.d.ts +5 -2
  165. package/utils/id-generator.d.ts +6 -0
  166. package/utils/index.d.ts +3 -0
  167. package/utils/tests-utils.d.ts +1 -0
  168. package/utils/utils.d.ts +1 -0
  169. package/monkey-style-guide-v2-0.0.4.tgz +0 -0
@@ -1,182 +1,2770 @@
1
- import * as i1 from '@angular/common';
2
- import { CommonModule } from '@angular/common';
1
+ import { trigger, state, style, transition, animate, keyframes } from '@angular/animations';
2
+ import * as i1$1 from '@angular/common';
3
+ import { CommonModule, CurrencyPipe, NgTemplateOutlet, DOCUMENT } from '@angular/common';
3
4
  import * as i0 from '@angular/core';
4
- import { Component, ViewEncapsulation, Input, HostListener, input, HostBinding, EventEmitter, Output } from '@angular/core';
5
+ import { Injectable, inject, TemplateRef, booleanAttribute, Component, Input, ViewEncapsulation, input, output, HostListener, Directive, NgModule, EventEmitter, Injector, ChangeDetectorRef, forwardRef, ChangeDetectionStrategy, ContentChildren, Output, HostBinding, ElementRef, DEFAULT_CURRENCY_CODE, ContentChild, LOCALE_ID, ViewChild, Optional, Inject } from '@angular/core';
6
+ import { Subject, takeUntil, merge, Subscription } from 'rxjs';
7
+ import { DomSanitizer } from '@angular/platform-browser';
8
+ import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
9
+ import * as i1 from '@angular/cdk/overlay';
10
+ import { Router } from '@angular/router';
11
+ import * as i1$2 from '@angular/forms';
12
+ import { NgControl, FormControlDirective, NgModel, FormControlName, FormGroupDirective, NG_VALUE_ACCESSOR, NG_VALIDATORS, ReactiveFormsModule, FormsModule, Validators } from '@angular/forms';
13
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
14
+ import { getSupportedInputTypes } from '@angular/cdk/platform';
5
15
 
6
- /**************************
16
+ const counters = {};
17
+ class IdGenerator {
18
+ getId(prefix) {
19
+ if (!Object.prototype.hasOwnProperty.call(counters, prefix)) {
20
+ counters[prefix] = 1;
21
+ }
22
+ const currentCount = counters[prefix];
23
+ counters[prefix] = currentCount + 1;
24
+ return `${prefix}${currentCount}`;
25
+ }
26
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IdGenerator, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
27
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IdGenerator, providedIn: 'root' }); }
28
+ }
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IdGenerator, decorators: [{
30
+ type: Injectable,
31
+ args: [{ providedIn: 'root' }]
32
+ }] });
33
+
34
+ function stripHtmlComments(htmlContent) {
35
+ return htmlContent.replace(/<!--(?!>)[\S\s]*?-->/g, '');
36
+ }
37
+
38
+ function getRandomString(len, charSet) {
39
+ charSet = charSet || 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
40
+ return new Array(len)
41
+ .fill('1')
42
+ .map(() => {
43
+ return charSet?.charAt(Math.floor(Math.random() * charSet.length));
44
+ })
45
+ .join('');
46
+ }
47
+
48
+ class MonkeyDestroyService extends Subject {
49
+ ngOnDestroy() {
50
+ this.next();
51
+ this.complete();
52
+ }
53
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyDestroyService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
54
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyDestroyService }); }
55
+ }
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyDestroyService, decorators: [{
57
+ type: Injectable
58
+ }] });
59
+
60
+ /* eslint-disable max-len */
61
+ class MonkeyIconsService {
62
+ constructor() {
63
+ this._sanitizer = inject(DomSanitizer);
64
+ }
65
+ handleTrust(icon) {
66
+ return this._sanitizer.bypassSecurityTrustHtml(icon);
67
+ }
68
+ get clear() {
69
+ return this.handleTrust(`
70
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path d="M7.815 7.277a.802.802 0 0 0-.459.349c-.103.167-.123.529-.038.694.028.055.854.906 1.836 1.89L10.939 12l-1.785 1.79c-.982.985-1.808 1.835-1.836 1.89a.926.926 0 0 0-.051.324c0 .494.414.812.922.707.183-.038.266-.114 2.001-1.844L12 13.062l1.81 1.805c1.731 1.725 1.818 1.806 2 1.844.58.12 1.021-.321.901-.901-.038-.182-.119-.269-1.844-2L13.062 12l1.805-1.81c1.73-1.735 1.806-1.818 1.844-2.001.105-.508-.213-.922-.707-.922a.926.926 0 0 0-.324.051c-.055.028-.905.854-1.89 1.836L12 10.939l-1.79-1.785c-.984-.982-1.826-1.803-1.87-1.825a.99.99 0 0 0-.525-.052" fill-rule="evenodd" fill="var(--mecx-color-gray-900)"/></svg>
71
+ `);
72
+ }
73
+ get calendar() {
74
+ return this.handleTrust(`
75
+ <svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.815 1.277a.8.8 0 0 0-.462.354c-.087.139-.094.198-.107.875l-.013.725-1.347.019c-1.236.018-1.371.026-1.646.107A2.807 2.807 0 0 0 2.352 5.26l-.092.32v13.84l.092.32a2.797 2.797 0 0 0 1.908 1.908l.32.092h14.84l.32-.092a2.797 2.797 0 0 0 1.908-1.908l.092-.32V5.58l-.092-.32a2.807 2.807 0 0 0-1.888-1.903c-.276-.081-.41-.089-1.65-.107l-1.35-.019v-.593c0-.757-.042-.96-.238-1.156-.349-.349-.903-.279-1.169.149-.087.139-.094.198-.107.879l-.014.73H8.76l-.001-.61c-.001-.68-.039-.91-.179-1.094-.159-.209-.502-.325-.765-.259M7.246 5.49c.013.681.02.74.107.879.357.574 1.223.443 1.363-.207.024-.113.044-.475.044-.804V4.76h6.472l.014.73c.013.681.02.74.107.879.357.574 1.223.443 1.363-.207.024-.113.044-.475.044-.804V4.76h1.238c1.452 0 1.525.014 1.876.366.352.351.366.424.366 1.876V8.24H3.756l.012-1.31c.012-1.277.014-1.314.104-1.482.155-.29.475-.562.768-.651.055-.016.661-.032 1.346-.034l1.246-.003.014.73m12.994 9.008c0 4.664-.001 4.742-.081 4.956-.109.29-.415.596-.705.705-.215.08-.28.081-7.454.081-7.159 0-7.239-.001-7.453-.081-.245-.091-.544-.363-.679-.615l-.088-.164-.011-4.81-.01-4.81H20.24v4.738M6.7 12.028a.967.967 0 0 0-.24.126.992.992 0 0 0 .097 1.695 1.005 1.005 0 0 0 1.352-.427c.096-.185.114-.59.035-.797a1.104 1.104 0 0 0-.521-.549c-.154-.07-.507-.094-.723-.048m5 0a.967.967 0 0 0-.24.126.992.992 0 0 0 .097 1.695 1.005 1.005 0 0 0 1.352-.427c.096-.185.114-.59.035-.797a1.104 1.104 0 0 0-.521-.549c-.154-.07-.507-.094-.723-.048m5 0a.967.967 0 0 0-.24.126.992.992 0 0 0 .097 1.695 1.005 1.005 0 0 0 1.352-.427c.096-.185.114-.59.035-.797a1.104 1.104 0 0 0-.521-.549c-.154-.07-.507-.094-.723-.048m-10 4a.967.967 0 0 0-.24.126.992.992 0 0 0 .097 1.695 1.005 1.005 0 0 0 1.352-.427c.096-.185.114-.59.035-.797a1.104 1.104 0 0 0-.521-.549c-.154-.07-.507-.094-.723-.048m5 0a.967.967 0 0 0-.24.126.992.992 0 0 0 .097 1.695 1.005 1.005 0 0 0 1.352-.427c.096-.185.114-.59.035-.797a1.104 1.104 0 0 0-.521-.549c-.154-.07-.507-.094-.723-.048" fill-rule="evenodd" fill="var(--mecx-color-gray-900)"/></svg>
76
+ `);
77
+ }
78
+ get arrowDown() {
79
+ return this.handleTrust(`
80
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 10L12 14L16 10" stroke="var(--mecx-color-gray-900)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
81
+ `);
82
+ }
83
+ get check() {
84
+ return this.handleTrust(`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.808 2.528 C 9.752 2.542,9.671 2.574,9.628 2.599 C 9.585 2.625,8.414 3.781,7.025 5.168 L 4.500 7.690 3.475 6.667 C 2.865 6.059,2.414 5.624,2.360 5.594 C 2.137 5.467,1.822 5.478,1.603 5.620 C 1.226 5.863,1.141 6.369,1.419 6.715 C 1.558 6.887,4.068 9.375,4.140 9.411 C 4.366 9.525,4.634 9.525,4.860 9.411 C 4.931 9.376,10.438 3.892,10.581 3.715 C 10.688 3.582,10.742 3.425,10.742 3.250 C 10.742 2.758,10.293 2.410,9.808 2.528 " stroke="none" fill-rule="evenodd" fill="var(--mecx-color-theme-contrast-500"></path></svg>`);
85
+ }
86
+ get minus() {
87
+ return this.handleTrust(`<svg width="8" height="2" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.333 0.268 C 1.300 0.274,1.225 0.303,1.167 0.332 C 1.054 0.388,0.939 0.490,0.866 0.599 C 0.776 0.732,0.732 0.936,0.757 1.098 C 0.786 1.283,0.848 1.405,0.977 1.532 C 1.071 1.624,1.148 1.673,1.253 1.710 L 1.340 1.740 4.000 1.740 L 6.660 1.740 6.747 1.710 C 6.943 1.642,7.128 1.462,7.200 1.270 C 7.265 1.095,7.265 0.904,7.200 0.730 C 7.118 0.510,6.880 0.308,6.655 0.267 C 6.565 0.250,1.420 0.251,1.333 0.268" stroke="none" fill-rule="evenodd" fill="var(--mecx-color-theme-contrast-500"></path></svg>`);
88
+ }
89
+ get loading() {
90
+ return this.handleTrust(`<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY{transform-origin:center;animation:spinner_AtaB .75s infinite linear}@keyframes spinner_AtaB{100%{transform:rotate(360deg)}}</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"/><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"/></svg>`);
91
+ }
92
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyIconsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
93
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyIconsService, providedIn: 'root' }); }
94
+ }
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyIconsService, decorators: [{
96
+ type: Injectable,
97
+ args: [{
98
+ providedIn: 'root'
99
+ }]
100
+ }] });
101
+
102
+ class ToastRef {
103
+ constructor(componentRef) {
104
+ this.componentRef = componentRef;
105
+ // not to do
106
+ }
107
+ close() {
108
+ this.componentRef.instance.close();
109
+ }
110
+ }
111
+
112
+ class MonkeyToastService {
113
+ constructor(overlay) {
114
+ this.overlay = overlay;
115
+ // no to do
116
+ }
117
+ getPositionStrategy(position) {
118
+ const globalPosition = this.overlay.position().global();
119
+ switch (position) {
120
+ case 'top-left':
121
+ return globalPosition.top('40px').start('40px');
122
+ case 'top-center':
123
+ return globalPosition.top('40px').centerHorizontally();
124
+ case 'top-right':
125
+ return globalPosition.top('40px').end('40px');
126
+ case 'bottom-left':
127
+ return globalPosition.bottom('40px').start('40px');
128
+ case 'bottom-center':
129
+ return globalPosition.bottom('40px').centerHorizontally();
130
+ default:
131
+ return globalPosition.bottom('40px').end('40px');
132
+ }
133
+ }
134
+ show(toastConfig) {
135
+ if (this.lastToast) {
136
+ this.lastToast.close();
137
+ }
138
+ const overlayRef = this.overlay.create({
139
+ hasBackdrop: false,
140
+ positionStrategy: this.getPositionStrategy(toastConfig.position)
141
+ });
142
+ const portal = new ComponentPortal(MonkeyToastComponent);
143
+ const componentRef = overlayRef.attach(portal);
144
+ this.lastToast = new ToastRef(componentRef);
145
+ componentRef.instance.id = getRandomString(6);
146
+ componentRef.instance.type = toastConfig.type ?? 'default';
147
+ componentRef.instance.icon = toastConfig.icon;
148
+ componentRef.instance.isClosable = toastConfig.isClosable ?? false;
149
+ componentRef.instance.message = toastConfig.message;
150
+ componentRef.instance.actionLabel = toastConfig.actionLabel;
151
+ componentRef.instance.actionIcon = toastConfig.actionIcon;
152
+ componentRef.instance.onActionClick.subscribe(() => {
153
+ if (toastConfig.action) {
154
+ toastConfig.action();
155
+ if (toastConfig.closeOnAction ?? true) {
156
+ componentRef.instance.close();
157
+ }
158
+ }
159
+ });
160
+ componentRef.instance.onClose.subscribe(() => {
161
+ overlayRef.detach();
162
+ });
163
+ if (!toastConfig.keepOpen) {
164
+ setTimeout(() => {
165
+ componentRef.instance.close();
166
+ }, toastConfig.duration ?? 4000);
167
+ }
168
+ return componentRef.instance;
169
+ }
170
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyToastService, deps: [{ token: i1.Overlay }], target: i0.ɵɵFactoryTarget.Injectable }); }
171
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyToastService }); }
172
+ }
173
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyToastService, decorators: [{
174
+ type: Injectable
175
+ }], ctorParameters: () => [{ type: i1.Overlay }] });
176
+
177
+ /** ************************
178
+ * Copyright Monkey Exchange. All Rights Reserved
179
+ * This style guide was developed by Monkey Exchange Team
180
+ * MIT Licence
181
+ ************************* */
182
+ class MonkeyAccordionComponent {
183
+ set title(data) {
184
+ if (data instanceof TemplateRef) {
185
+ this.titleRef = data;
186
+ }
187
+ else {
188
+ this.titleStr = data;
189
+ }
190
+ }
191
+ get id() {
192
+ return this._id;
193
+ }
194
+ set id(value) {
195
+ this._id = value || this._uid;
196
+ }
197
+ constructor() {
198
+ this._icons = inject(MonkeyIconsService);
199
+ this.open = false;
200
+ this.disabled = false;
201
+ this.imgArrowDown = this._icons.arrowDown;
202
+ this._uid = inject(IdGenerator).getId('monkey-accordion-');
203
+ // eslint-disable-next-line no-self-assign
204
+ this.id = this.id;
205
+ }
206
+ onClick() {
207
+ if (this.disabled)
208
+ return;
209
+ this.open = !this.open;
210
+ }
211
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
212
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyAccordionComponent, isStandalone: true, selector: "monkey-accordion", inputs: { open: ["open", "open", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], title: "title", id: "id" }, host: { attributes: { "data-testid": "monkey-accordion" }, properties: { "class.disabled": "disabled", "attr.id": "id", "id": "id" } }, ngImport: i0, template: "<div class=\"header\" (click)=\"onClick()\">\n <div class=\"title\">\n @if (titleRef) {\n <ng-container *ngTemplateOutlet=\"titleRef\" />\n } @else {\n {{ titleStr }}\n }\n </div>\n <div [innerHTML]=\"imgArrowDown\" class=\"icon\" [class.rotated]=\"open\"></div>\n</div>\n<div class=\"content-wrapper\">\n @if (open) {\n <div [@content]>\n <div class=\"content\">\n <ng-content />\n </div>\n </div>\n }\n</div>\n", styles: [":host{display:flex;flex-direction:column;border-radius:16px;border:2px solid var(--mecx-color-gray-400);background:var(--mecx-color-white);overflow:hidden}:host .header{display:flex;align-items:center;justify-content:space-between;padding:24px;gap:24px;cursor:pointer}:host .header .title{color:var(--mecx-color-gray-900);font-size:18px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.54px}:host .header .icon{transform:rotate(0);transition:transform .2s ease-in-out}:host .header .icon.rotated{transform:rotate(180deg)}:host.disabled .header{cursor:not-allowed;background:var(--mecx-color-gray-200)}:host .content-wrapper{border-top:1px solid var(--mecx-color-gray-200);overflow:hidden}:host .content-wrapper .content{padding:24px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], animations: [
213
+ trigger('content', [
214
+ state('void', style({
215
+ height: '0px',
216
+ overflow: 'hidden'
217
+ })),
218
+ transition(':enter', [
219
+ animate('300ms ease-in-out', style({
220
+ height: '*',
221
+ overflow: 'hidden'
222
+ }))
223
+ ]),
224
+ transition(':leave', [
225
+ animate('300ms ease-in-out', style({
226
+ height: '0px',
227
+ overflow: 'hidden'
228
+ }))
229
+ ])
230
+ ])
231
+ ] }); }
232
+ }
233
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyAccordionComponent, decorators: [{
234
+ type: Component,
235
+ args: [{ selector: 'monkey-accordion', standalone: true, imports: [CommonModule], host: {
236
+ 'data-testid': 'monkey-accordion',
237
+ '[class.disabled]': 'disabled',
238
+ '[attr.id]': 'id',
239
+ '[id]': 'id'
240
+ }, animations: [
241
+ trigger('content', [
242
+ state('void', style({
243
+ height: '0px',
244
+ overflow: 'hidden'
245
+ })),
246
+ transition(':enter', [
247
+ animate('300ms ease-in-out', style({
248
+ height: '*',
249
+ overflow: 'hidden'
250
+ }))
251
+ ]),
252
+ transition(':leave', [
253
+ animate('300ms ease-in-out', style({
254
+ height: '0px',
255
+ overflow: 'hidden'
256
+ }))
257
+ ])
258
+ ])
259
+ ], template: "<div class=\"header\" (click)=\"onClick()\">\n <div class=\"title\">\n @if (titleRef) {\n <ng-container *ngTemplateOutlet=\"titleRef\" />\n } @else {\n {{ titleStr }}\n }\n </div>\n <div [innerHTML]=\"imgArrowDown\" class=\"icon\" [class.rotated]=\"open\"></div>\n</div>\n<div class=\"content-wrapper\">\n @if (open) {\n <div [@content]>\n <div class=\"content\">\n <ng-content />\n </div>\n </div>\n }\n</div>\n", styles: [":host{display:flex;flex-direction:column;border-radius:16px;border:2px solid var(--mecx-color-gray-400);background:var(--mecx-color-white);overflow:hidden}:host .header{display:flex;align-items:center;justify-content:space-between;padding:24px;gap:24px;cursor:pointer}:host .header .title{color:var(--mecx-color-gray-900);font-size:18px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.54px}:host .header .icon{transform:rotate(0);transition:transform .2s ease-in-out}:host .header .icon.rotated{transform:rotate(180deg)}:host.disabled .header{cursor:not-allowed;background:var(--mecx-color-gray-200)}:host .content-wrapper{border-top:1px solid var(--mecx-color-gray-200);overflow:hidden}:host .content-wrapper .content{padding:24px}\n"] }]
260
+ }], ctorParameters: () => [], propDecorators: { open: [{
261
+ type: Input,
262
+ args: [{ transform: booleanAttribute }]
263
+ }], disabled: [{
264
+ type: Input,
265
+ args: [{ transform: booleanAttribute }]
266
+ }], title: [{
267
+ type: Input
268
+ }], id: [{
269
+ type: Input
270
+ }] } });
271
+
272
+ /** ************************
273
+ * Copyright Monkey Exchange. All Rights Reserved
274
+ * This style guide was developed by Monkey Exchange Team
275
+ * MIT Licence
276
+ ************************* */
277
+ class MonkeyIconComponent {
278
+ set icon(val) {
279
+ if (val) {
280
+ this._icon = `mk-i mk-i-${val}`;
281
+ }
282
+ }
283
+ get id() {
284
+ return this._id;
285
+ }
286
+ set id(value) {
287
+ this._id = value || this._uid;
288
+ }
289
+ constructor() {
290
+ this.size = '';
291
+ this._icon = '';
292
+ this._uid = inject(IdGenerator).getId('monkey-icon-');
293
+ // eslint-disable-next-line no-self-assign
294
+ this.id = this.id;
295
+ }
296
+ ngOnInit() {
297
+ if (!this._icon) {
298
+ throw new Error('monkey-icon must have icon input');
299
+ }
300
+ }
301
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
302
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyIconComponent, isStandalone: true, selector: "monkey-icon", inputs: { icon: "icon", size: "size", id: "id" }, host: { properties: { "class": "_icon+' '+size", "attr.id": "id", "id": "id" } }, ngImport: i0, template: "", styles: ["monkey-icon{display:inline-flex}monkey-icon.sm{font-size:20px;width:20px;height:20px}monkey-icon.md{font-size:22px;width:22px;height:22px}monkey-icon.lg{font-size:24px;width:24px;height:24px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], encapsulation: i0.ViewEncapsulation.None }); }
303
+ }
304
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyIconComponent, decorators: [{
305
+ type: Component,
306
+ args: [{ selector: 'monkey-icon', standalone: true, imports: [CommonModule], encapsulation: ViewEncapsulation.None, host: {
307
+ '[class]': `_icon+' '+size`,
308
+ '[attr.id]': 'id',
309
+ '[id]': 'id'
310
+ }, template: "", styles: ["monkey-icon{display:inline-flex}monkey-icon.sm{font-size:20px;width:20px;height:20px}monkey-icon.md{font-size:22px;width:22px;height:22px}monkey-icon.lg{font-size:24px;width:24px;height:24px}\n"] }]
311
+ }], ctorParameters: () => [], propDecorators: { icon: [{
312
+ type: Input
313
+ }], size: [{
314
+ type: Input
315
+ }], id: [{
316
+ type: Input
317
+ }] } });
318
+
319
+ /** ************************
320
+ * Copyright Monkey Exchange. All Rights Reserved
321
+ * This style guide was developed by Monkey Exchange Team
322
+ * MIT Licence
323
+ ************************* */
324
+ class MonkeyAlertComponent {
325
+ get id() {
326
+ return this._id;
327
+ }
328
+ set id(value) {
329
+ this._id = value || this._uid;
330
+ }
331
+ constructor() {
332
+ this.buttonLabel = input('');
333
+ this.message = input.required();
334
+ this.title = input.required();
335
+ this.type = input.required();
336
+ this.onButtonClicked = output();
337
+ this._uid = inject(IdGenerator).getId('monkey-alert-');
338
+ // eslint-disable-next-line no-self-assign
339
+ this.id = this.id;
340
+ }
341
+ icon(type) {
342
+ const typeIcons = {
343
+ alert: 'warning-outline',
344
+ default: 'info',
345
+ error: 'error-outline',
346
+ info: 'info',
347
+ success: 'checkmark-big-circle'
348
+ };
349
+ return typeIcons[type];
350
+ }
351
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
352
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyAlertComponent, isStandalone: true, selector: "monkey-alert", inputs: { buttonLabel: { classPropertyName: "buttonLabel", publicName: "buttonLabel", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onButtonClicked: "onButtonClicked" }, host: { attributes: { "data-testid": "monkey-alert" }, properties: { "attr.id": "id", "id": "id" } }, ngImport: i0, template: "<div [class]=\"'monkey-alert__card ' + type()\">\n @if (type()) {\n <monkey-icon size=\"lg\" [class]=\"'monkey-alert__card__type-' + type()\" [icon]=\"icon(type())\" />\n }\n <div class=\"monkey-alert__card__content\">\n <h4 class=\"monkey-alert__card__title\">{{ title() }}</h4>\n <h5 class=\"monkey-alert__card__message\">{{ message() }}</h5>\n @if (buttonLabel()) {\n <div>\n <a class=\"monkey-alert__card__link\" (click)=\"onButtonClicked.emit()\">\n {{ buttonLabel() }}\n </a>\n </div>\n }\n </div>\n</div>\n", styles: ["monkey-alert{display:flex}monkey-alert .monkey-alert__card{border-radius:8px;display:flex;gap:8px;padding:24px}monkey-alert .monkey-alert__card.alert{background-color:#fff8eb;border:solid 2px var(--mecx-color-warning-500)}monkey-alert .monkey-alert__card.alert>.mk-i{color:var(--mecx-color-warning-500)}monkey-alert .monkey-alert__card.default{background-color:#f8fafb;border:solid 2px #bdc1c7}monkey-alert .monkey-alert__card.default>.mk-i{color:#1f2024}monkey-alert .monkey-alert__card.error{background-color:#ffecec;border:solid 2px #fa3838}monkey-alert .monkey-alert__card.error>.mk-i{color:var(--mecx-color-error-700)}monkey-alert .monkey-alert__card.info{background-color:var(--mecx-color-question-100);border:solid 2px var(--mecx-color-question-500)}monkey-alert .monkey-alert__card.info>.mk-i{color:var(--mecx-color-question-500)}monkey-alert .monkey-alert__card.success{background-color:#f5fffb;border:solid 2px var(--mecx-color-success-500)}monkey-alert .monkey-alert__card.success>.mk-i{color:var(--mecx-color-success-500)}monkey-alert .monkey-alert__card__content{display:flex;flex-direction:column;gap:8px}monkey-alert .monkey-alert__card__title{color:#1f2024;font-size:18px;font-weight:400;letter-spacing:.54px;line-height:24px}monkey-alert .monkey-alert__card__message{color:#545a63;font-size:14px;font-weight:400;letter-spacing:.42px;line-height:24px}monkey-alert .monkey-alert__card__link{color:#1f2024;cursor:pointer;font-size:14px;font-weight:400;letter-spacing:.42px;line-height:24px;text-decoration:underline}\n"], dependencies: [{ kind: "component", type: MonkeyIconComponent, selector: "monkey-icon", inputs: ["icon", "size", "id"] }], encapsulation: i0.ViewEncapsulation.None }); }
353
+ }
354
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyAlertComponent, decorators: [{
355
+ type: Component,
356
+ args: [{ encapsulation: ViewEncapsulation.None, imports: [MonkeyIconComponent], selector: 'monkey-alert', standalone: true, host: {
357
+ 'data-testid': 'monkey-alert',
358
+ '[attr.id]': 'id',
359
+ '[id]': 'id'
360
+ }, template: "<div [class]=\"'monkey-alert__card ' + type()\">\n @if (type()) {\n <monkey-icon size=\"lg\" [class]=\"'monkey-alert__card__type-' + type()\" [icon]=\"icon(type())\" />\n }\n <div class=\"monkey-alert__card__content\">\n <h4 class=\"monkey-alert__card__title\">{{ title() }}</h4>\n <h5 class=\"monkey-alert__card__message\">{{ message() }}</h5>\n @if (buttonLabel()) {\n <div>\n <a class=\"monkey-alert__card__link\" (click)=\"onButtonClicked.emit()\">\n {{ buttonLabel() }}\n </a>\n </div>\n }\n </div>\n</div>\n", styles: ["monkey-alert{display:flex}monkey-alert .monkey-alert__card{border-radius:8px;display:flex;gap:8px;padding:24px}monkey-alert .monkey-alert__card.alert{background-color:#fff8eb;border:solid 2px var(--mecx-color-warning-500)}monkey-alert .monkey-alert__card.alert>.mk-i{color:var(--mecx-color-warning-500)}monkey-alert .monkey-alert__card.default{background-color:#f8fafb;border:solid 2px #bdc1c7}monkey-alert .monkey-alert__card.default>.mk-i{color:#1f2024}monkey-alert .monkey-alert__card.error{background-color:#ffecec;border:solid 2px #fa3838}monkey-alert .monkey-alert__card.error>.mk-i{color:var(--mecx-color-error-700)}monkey-alert .monkey-alert__card.info{background-color:var(--mecx-color-question-100);border:solid 2px var(--mecx-color-question-500)}monkey-alert .monkey-alert__card.info>.mk-i{color:var(--mecx-color-question-500)}monkey-alert .monkey-alert__card.success{background-color:#f5fffb;border:solid 2px var(--mecx-color-success-500)}monkey-alert .monkey-alert__card.success>.mk-i{color:var(--mecx-color-success-500)}monkey-alert .monkey-alert__card__content{display:flex;flex-direction:column;gap:8px}monkey-alert .monkey-alert__card__title{color:#1f2024;font-size:18px;font-weight:400;letter-spacing:.54px;line-height:24px}monkey-alert .monkey-alert__card__message{color:#545a63;font-size:14px;font-weight:400;letter-spacing:.42px;line-height:24px}monkey-alert .monkey-alert__card__link{color:#1f2024;cursor:pointer;font-size:14px;font-weight:400;letter-spacing:.42px;line-height:24px;text-decoration:underline}\n"] }]
361
+ }], ctorParameters: () => [], propDecorators: { id: [{
362
+ type: Input
363
+ }] } });
364
+
365
+ /** ************************
366
+ * Copyright Monkey Exchange. All Rights Reserved
367
+ * This style guide was developed by Monkey Exchange Team
368
+ * MIT Licence
369
+ ************************* */
370
+ class MonkeyBreadcrumbComponent {
371
+ get id() {
372
+ return this._id;
373
+ }
374
+ set id(value) {
375
+ this._id = value || this._uid;
376
+ }
377
+ constructor() {
378
+ this.colapsed = false;
379
+ this._router = inject(Router);
380
+ this._uid = inject(IdGenerator).getId('monkey-breadcrumb-');
381
+ // eslint-disable-next-line no-self-assign
382
+ this.id = this.id;
383
+ }
384
+ handleNavigate(item) {
385
+ if (item.callback) {
386
+ item.callback();
387
+ }
388
+ else {
389
+ this._router.navigate([item.path]);
390
+ }
391
+ }
392
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyBreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
393
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyBreadcrumbComponent, isStandalone: true, selector: "monkey-breadcrumb", inputs: { first: "first", last: "last", colapsed: ["colapsed", "colapsed", booleanAttribute], id: "id" }, host: { attributes: { "data-testid": "monkey-breadcrumb" }, properties: { "attr.id": "id", "id": "id" } }, ngImport: i0, template: "<div class=\"breadcrumbs\">\n <a class=\"first\" (click)=\"handleNavigate(first)\">\n {{ first.label | titlecase }}\n </a>\n <span>/</span>\n @if(colapsed){\n <span>...</span>\n <span>/</span>\n }\n <a class=\"last\" (click)=\"handleNavigate(last)\">\n {{ last.label | titlecase }}\n </a>\n</div>\n", styles: ["monkey-breadcrumb .last{color:var(--mecx-color-theme-main);text-decoration:none}monkey-breadcrumb .last:hover{text-decoration:underline}monkey-breadcrumb .first{color:#000;text-decoration:none}monkey-breadcrumb .first:hover{text-decoration:underline}monkey-breadcrumb .breadcrumbs{display:flex;gap:8px;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$1.TitleCasePipe, name: "titlecase" }], encapsulation: i0.ViewEncapsulation.None }); }
394
+ }
395
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyBreadcrumbComponent, decorators: [{
396
+ type: Component,
397
+ args: [{ selector: 'monkey-breadcrumb', standalone: true, imports: [CommonModule], encapsulation: ViewEncapsulation.None, host: {
398
+ 'data-testid': 'monkey-breadcrumb',
399
+ '[attr.id]': 'id',
400
+ '[id]': 'id'
401
+ }, template: "<div class=\"breadcrumbs\">\n <a class=\"first\" (click)=\"handleNavigate(first)\">\n {{ first.label | titlecase }}\n </a>\n <span>/</span>\n @if(colapsed){\n <span>...</span>\n <span>/</span>\n }\n <a class=\"last\" (click)=\"handleNavigate(last)\">\n {{ last.label | titlecase }}\n </a>\n</div>\n", styles: ["monkey-breadcrumb .last{color:var(--mecx-color-theme-main);text-decoration:none}monkey-breadcrumb .last:hover{text-decoration:underline}monkey-breadcrumb .first{color:#000;text-decoration:none}monkey-breadcrumb .first:hover{text-decoration:underline}monkey-breadcrumb .breadcrumbs{display:flex;gap:8px;align-items:center}\n"] }]
402
+ }], ctorParameters: () => [], propDecorators: { first: [{
403
+ type: Input,
404
+ args: [{ required: true }]
405
+ }], last: [{
406
+ type: Input,
407
+ args: [{ required: true }]
408
+ }], colapsed: [{
409
+ type: Input,
410
+ args: [{ transform: booleanAttribute }]
411
+ }], id: [{
412
+ type: Input
413
+ }] } });
414
+
415
+ /** ************************
416
+ * Copyright Monkey Exchange. All Rights Reserved
417
+ * This style guide was developed by Monkey Exchange Team
418
+ * MIT Licence
419
+ ************************* */
420
+ class MonkeyButtonComponent {
421
+ get id() {
422
+ return this._id;
423
+ }
424
+ set id(value) {
425
+ this._id = value || this._uid;
426
+ }
427
+ constructor() {
428
+ this.size = 'md';
429
+ this.type = 'primary';
430
+ this._uid = inject(IdGenerator).getId('monkey-button-');
431
+ // eslint-disable-next-line no-self-assign
432
+ this.id = this.id;
433
+ }
434
+ onClick(event) {
435
+ if (this.disabled) {
436
+ event.stopPropagation();
437
+ event.preventDefault();
438
+ event.stopImmediatePropagation();
439
+ }
440
+ }
441
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
442
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyButtonComponent, isStandalone: true, selector: "monkey-button", inputs: { disabled: "disabled", size: "size", type: "type", id: "id" }, host: { attributes: { "data-testid": "monkey-button" }, listeners: { "click": "onClick($event)" }, properties: { "attr.id": "id", "id": "id" } }, ngImport: i0, template: "<button class=\"mecx-button\" [ngClass]=\"type + ' ' + size\" [disabled]=\"disabled\">\n <div class=\"content\">\n <ng-content select=\"[first]\"></ng-content>\n <span><ng-content></ng-content></span>\n <ng-content select=\"[last]\"></ng-content>\n </div>\n</button>\n", styles: ["monkey-button{display:inline-block}monkey-button .mecx-button{width:100%;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;transition:background-color .15s ease-out,color .15s ease-out}monkey-button .mecx-button .content{display:flex;align-items:center;justify-content:center;gap:8px;padding:0 12px;flex-shrink:0;letter-spacing:.48px;font-weight:400;transition:transform .2s cubic-bezier(0,.5,.2,1)}monkey-button .mecx-button .content span{width:100%}monkey-button .mecx-button .content .mk-i{display:flex}monkey-button .mecx-button.secondary{border:2px solid #bdc1c7;background:unset}monkey-button .mecx-button.secondary:disabled{border-width:1px}monkey-button .mecx-button:disabled{background:#f1f2f3!important;color:#bdc1c7!important;cursor:not-allowed!important}monkey-button .mecx-button:disabled.secondary{background:unset!important;border:1px solid #bdc1c7!important}monkey-button .mecx-button.primary{color:var(--mecx-color-theme-contrast-main);background:var(--mecx-color-theme-main)}monkey-button .mecx-button.primary:hover:not(:disabled){background:var(--mecx-color-theme-600)}monkey-button .mecx-button.secondary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-button .mecx-button.tertiary{background:unset}monkey-button .mecx-button.tertiary span{text-decoration:underline}monkey-button .mecx-button.tertiary:disabled{background:unset!important;border-width:1px}monkey-button .mecx-button.tertiary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-button .mecx-button.sm{height:32px}monkey-button .mecx-button.sm .mk-i{font-size:20px}monkey-button .mecx-button.md{height:40px}monkey-button .mecx-button.md .mk-i{font-size:22px}monkey-button .mecx-button.lg{height:48px;text-align:center;font-size:16px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.48px}monkey-button .mecx-button.lg .mk-i{font-size:24px}monkey-button .mecx-button.full-width{width:100%}monkey-button .mecx-button:focus{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}monkey-button .mecx-button:active:not(:disabled).primary{background:var(--mecx-color-theme-main);opacity:.8;outline:none}monkey-button .mecx-button:active:not(:disabled) .content{transform:scale(.8)}:host:has(.mecx-button:active) .mecx-button{outline:unset;outline-offset:unset}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], encapsulation: i0.ViewEncapsulation.None }); }
443
+ }
444
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyButtonComponent, decorators: [{
445
+ type: Component,
446
+ args: [{ encapsulation: ViewEncapsulation.None, imports: [CommonModule], selector: 'monkey-button', standalone: true, host: {
447
+ 'data-testid': 'monkey-button',
448
+ '[attr.id]': 'id',
449
+ '[id]': 'id'
450
+ }, template: "<button class=\"mecx-button\" [ngClass]=\"type + ' ' + size\" [disabled]=\"disabled\">\n <div class=\"content\">\n <ng-content select=\"[first]\"></ng-content>\n <span><ng-content></ng-content></span>\n <ng-content select=\"[last]\"></ng-content>\n </div>\n</button>\n", styles: ["monkey-button{display:inline-block}monkey-button .mecx-button{width:100%;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;transition:background-color .15s ease-out,color .15s ease-out}monkey-button .mecx-button .content{display:flex;align-items:center;justify-content:center;gap:8px;padding:0 12px;flex-shrink:0;letter-spacing:.48px;font-weight:400;transition:transform .2s cubic-bezier(0,.5,.2,1)}monkey-button .mecx-button .content span{width:100%}monkey-button .mecx-button .content .mk-i{display:flex}monkey-button .mecx-button.secondary{border:2px solid #bdc1c7;background:unset}monkey-button .mecx-button.secondary:disabled{border-width:1px}monkey-button .mecx-button:disabled{background:#f1f2f3!important;color:#bdc1c7!important;cursor:not-allowed!important}monkey-button .mecx-button:disabled.secondary{background:unset!important;border:1px solid #bdc1c7!important}monkey-button .mecx-button.primary{color:var(--mecx-color-theme-contrast-main);background:var(--mecx-color-theme-main)}monkey-button .mecx-button.primary:hover:not(:disabled){background:var(--mecx-color-theme-600)}monkey-button .mecx-button.secondary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-button .mecx-button.tertiary{background:unset}monkey-button .mecx-button.tertiary span{text-decoration:underline}monkey-button .mecx-button.tertiary:disabled{background:unset!important;border-width:1px}monkey-button .mecx-button.tertiary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-button .mecx-button.sm{height:32px}monkey-button .mecx-button.sm .mk-i{font-size:20px}monkey-button .mecx-button.md{height:40px}monkey-button .mecx-button.md .mk-i{font-size:22px}monkey-button .mecx-button.lg{height:48px;text-align:center;font-size:16px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.48px}monkey-button .mecx-button.lg .mk-i{font-size:24px}monkey-button .mecx-button.full-width{width:100%}monkey-button .mecx-button:focus{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}monkey-button .mecx-button:active:not(:disabled).primary{background:var(--mecx-color-theme-main);opacity:.8;outline:none}monkey-button .mecx-button:active:not(:disabled) .content{transform:scale(.8)}:host:has(.mecx-button:active) .mecx-button{outline:unset;outline-offset:unset}\n"] }]
451
+ }], ctorParameters: () => [], propDecorators: { disabled: [{
452
+ type: Input
453
+ }], size: [{
454
+ type: Input
455
+ }], type: [{
456
+ type: Input
457
+ }], id: [{
458
+ type: Input
459
+ }], onClick: [{
460
+ type: HostListener,
461
+ args: ['click', ['$event']]
462
+ }] } });
463
+
464
+ /** ************************
465
+ * Copyright Monkey Exchange. All Rights Reserved
466
+ * This style guide was developed by Monkey Exchange Team
467
+ * MIT Licence
468
+ ************************* */
469
+ class MonkeyError {
470
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyError, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
471
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyError, selector: "monkey-error", ngImport: i0 }); }
472
+ }
473
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyError, decorators: [{
474
+ type: Directive,
475
+ args: [{
476
+ selector: 'monkey-error'
477
+ }]
478
+ }] });
479
+
480
+ /** ************************
481
+ * Copyright Monkey Exchange. All Rights Reserved
482
+ * This style guide was developed by Monkey Exchange Team
483
+ * MIT Licence
484
+ ************************* */
485
+ class MonkeyHelper {
486
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyHelper, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
487
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyHelper, selector: "monkey-helper", ngImport: i0 }); }
488
+ }
489
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyHelper, decorators: [{
490
+ type: Directive,
491
+ args: [{
492
+ selector: 'monkey-helper'
493
+ }]
494
+ }] });
495
+
496
+ /** ************************
497
+ * Copyright Monkey Exchange. All Rights Reserved
498
+ * This style guide was developed by Monkey Exchange Team
499
+ * MIT Licence
500
+ ************************* */
501
+ class MonkeyInfo {
502
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInfo, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
503
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyInfo, selector: "monkey-info", ngImport: i0 }); }
504
+ }
505
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInfo, decorators: [{
506
+ type: Directive,
507
+ args: [{
508
+ selector: 'monkey-info'
509
+ }]
510
+ }] });
511
+
512
+ /** ************************
513
+ * Copyright Monkey Exchange. All Rights Reserved
514
+ * This style guide was developed by Monkey Exchange Team
515
+ * MIT Licence
516
+ ************************* */
517
+ class MonkeyLabel {
518
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
519
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyLabel, selector: "monkey-label", ngImport: i0 }); }
520
+ }
521
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyLabel, decorators: [{
522
+ type: Directive,
523
+ args: [{
524
+ selector: 'monkey-label'
525
+ }]
526
+ }] });
527
+
528
+ /** ************************
529
+ * Copyright Monkey Exchange. All Rights Reserved
530
+ * This style guide was developed by Monkey Exchange Team
531
+ * MIT Licence
532
+ ************************* */
533
+ class MonkeyPrefix {
534
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyPrefix, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
535
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyPrefix, selector: "monkey-prefix", ngImport: i0 }); }
536
+ }
537
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyPrefix, decorators: [{
538
+ type: Directive,
539
+ args: [{
540
+ selector: 'monkey-prefix'
541
+ }]
542
+ }] });
543
+
544
+ /** ************************
545
+ * Copyright Monkey Exchange. All Rights Reserved
546
+ * This style guide was developed by Monkey Exchange Team
547
+ * MIT Licence
548
+ ************************* */
549
+ class MonkeySuffix {
550
+ constructor() {
551
+ this.hasAction = false;
552
+ this.action = null;
553
+ }
554
+ set _hasAction(value) {
555
+ this.hasAction = true;
556
+ }
557
+ onClick(event) {
558
+ if (!this.action) {
559
+ event.preventDefault();
560
+ event.stopPropagation();
561
+ }
562
+ else {
563
+ this.action(event);
564
+ }
565
+ }
566
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySuffix, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
567
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeySuffix, selector: "monkey-suffix", inputs: { _hasAction: ["hasAction", "_hasAction"] }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.has-action": "hasAction" } }, ngImport: i0 }); }
568
+ }
569
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySuffix, decorators: [{
570
+ type: Directive,
571
+ args: [{
572
+ selector: 'monkey-suffix',
573
+ host: {
574
+ '[class.has-action]': 'hasAction'
575
+ }
576
+ }]
577
+ }], propDecorators: { _hasAction: [{
578
+ type: Input,
579
+ args: ['hasAction']
580
+ }], onClick: [{
581
+ type: HostListener,
582
+ args: ['click', ['$event']]
583
+ }] } });
584
+
585
+ /** ************************
586
+ * Copyright Monkey Exchange. All Rights Reserved
587
+ * This style guide was developed by Monkey Exchange Team
588
+ * MIT Licence
589
+ ************************* */
590
+ class MonkeyDirectivesModule {
591
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
592
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: MonkeyDirectivesModule, declarations: [MonkeyError, MonkeyHelper, MonkeyInfo, MonkeyLabel, MonkeyPrefix, MonkeySuffix], exports: [MonkeyError, MonkeyHelper, MonkeyInfo, MonkeyLabel, MonkeyPrefix, MonkeySuffix] }); }
593
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyDirectivesModule }); }
594
+ }
595
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyDirectivesModule, decorators: [{
596
+ type: NgModule,
597
+ args: [{
598
+ declarations: [MonkeyError, MonkeyHelper, MonkeyInfo, MonkeyLabel, MonkeyPrefix, MonkeySuffix],
599
+ exports: [MonkeyError, MonkeyHelper, MonkeyInfo, MonkeyLabel, MonkeyPrefix, MonkeySuffix]
600
+ }]
601
+ }] });
602
+
603
+ class MonkeyCheckboxComponent {
604
+ constructor() {
605
+ this.disabled = false;
606
+ this.indeterminate = false;
607
+ this.required = false;
608
+ this.showFooter = true;
609
+ this.size = 'md';
610
+ this.onChange = new EventEmitter();
611
+ this._destroyed = inject(MonkeyDestroyService);
612
+ this.icons = inject(MonkeyIconsService);
613
+ this.idGenerator = inject(IdGenerator);
614
+ this.injector = inject(Injector);
615
+ this.cdr = inject(ChangeDetectorRef);
616
+ this.iconCheck = this.icons.check;
617
+ this.iconIndeterminate = this.icons.minus;
618
+ this.inputId = this.idGenerator.getId('input-checkbox-');
619
+ this.value = false;
620
+ this.isFocused = false;
621
+ this._onChange = () => { };
622
+ this._onTouched = () => { };
623
+ this._onValidatorChange = () => { };
624
+ this.onBlur = () => {
625
+ this._onTouched();
626
+ this.isFocused = false;
627
+ };
628
+ this.onFocus = () => {
629
+ this.isFocused = true;
630
+ };
631
+ }
632
+ get showInvalid() {
633
+ const touched = this.control?.touched || false;
634
+ const invalid = this.control?.invalid || false;
635
+ return !this.isFocused && touched && invalid;
636
+ }
637
+ get hasHeader() {
638
+ return this.labelChildren.length > 0 || this.helperChildren.length > 0;
639
+ }
640
+ get isTouched() {
641
+ return this.control?.touched ?? false;
642
+ }
643
+ get isInvalid() {
644
+ return this.control?.invalid ?? false;
645
+ }
646
+ ngOnInit() {
647
+ const ngControl = this.injector.get(NgControl, null, { self: true, optional: true });
648
+ if (ngControl instanceof FormControlDirective || ngControl instanceof NgModel) {
649
+ this.control = ngControl.control;
650
+ }
651
+ else if (ngControl instanceof FormControlName) {
652
+ this.control = this.injector.get(FormGroupDirective).getControl(ngControl);
653
+ this.control.statusChanges.pipe(takeUntil(this._destroyed)).subscribe(() => {
654
+ this.cdr.markForCheck();
655
+ });
656
+ }
657
+ }
658
+ ngOnChanges(changes) {
659
+ if (changes.required) {
660
+ this._onValidatorChange();
661
+ }
662
+ }
663
+ validate(control) {
664
+ return this.required && control.value !== true ? { required: true } : null;
665
+ }
666
+ writeValue(value) {
667
+ this.value = value;
668
+ this.cdr.markForCheck();
669
+ }
670
+ registerOnChange(fn) {
671
+ this._onChange = fn;
672
+ }
673
+ registerOnTouched(fn) {
674
+ this._onTouched = fn;
675
+ }
676
+ registerOnValidatorChange(fn) {
677
+ this._onValidatorChange = fn;
678
+ }
679
+ setDisabledState(isDisabled) {
680
+ this.disabled = isDisabled;
681
+ this.cdr.markForCheck();
682
+ }
683
+ onChangeEvent(event) {
684
+ const checkbox = event.target;
685
+ if (this.indeterminate) {
686
+ this.indeterminate = false;
687
+ }
688
+ this.value = checkbox.checked;
689
+ this._onChange(this.value);
690
+ this.onChange.next(this.value);
691
+ this._onTouched();
692
+ }
693
+ getFooterMessages() {
694
+ const hasInfoChildren = this.infoChildren && this.infoChildren.length > 0;
695
+ if (!this.disabled && this.isTouched && this.isInvalid) {
696
+ return 'error';
697
+ }
698
+ if (hasInfoChildren) {
699
+ return 'info';
700
+ }
701
+ return '';
702
+ }
703
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
704
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyCheckboxComponent, isStandalone: true, selector: "monkey-checkbox", inputs: { disabled: ["disabled", "disabled", booleanAttribute], indeterminate: ["indeterminate", "indeterminate", booleanAttribute], required: ["required", "required", booleanAttribute], showFooter: ["showFooter", "showFooter", booleanAttribute], size: "size", value: "value" }, outputs: { onChange: "onChange" }, host: { attributes: { "data-testid": "input-checkbox" }, properties: { "class.mecx-disabled": "disabled", "class.mecx-checkbox-checked": "value", "class.mecx-checkbox-focused": "isFocused", "class.mecx-checkbox-indeterminate": "indeterminate", "class.mecx-checkbox-invalid": "showInvalid", "class.sm": "size.includes(\"sm\")", "class.md": "size.includes(\"md\")", "class.lg": "size.includes(\"lg\")" }, classAttribute: "mecx-checkbox" }, providers: [
705
+ {
706
+ provide: NG_VALUE_ACCESSOR,
707
+ useExisting: forwardRef(() => {
708
+ // eslint-disable-next-line no-use-before-define
709
+ return MonkeyCheckboxComponent;
710
+ }),
711
+ multi: true
712
+ },
713
+ {
714
+ provide: NG_VALIDATORS,
715
+ // eslint-disable-next-line no-use-before-define
716
+ useExisting: MonkeyCheckboxComponent,
717
+ multi: true
718
+ },
719
+ MonkeyDestroyService
720
+ ], queries: [{ propertyName: "infoChildren", predicate: MonkeyInfo, descendants: true }, { propertyName: "labelChildren", predicate: MonkeyLabel, descendants: true }, { propertyName: "helperChildren", predicate: MonkeyHelper, descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (hasHeader) {\n <div class=\"header\">\n <ng-content select=\"monkey-label\" />\n <ng-content select=\"monkey-helper\" />\n </div>\n}\n<label [attr.for]=\"inputId\">\n <input\n type=\"checkbox\"\n [checked]=\"value\"\n [indeterminate]=\"indeterminate\"\n [disabled]=\"disabled\"\n (change)=\"onChangeEvent($event)\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n [id]=\"inputId\"\n [required]=\"required\"\n />\n <span class=\"checkbox\">\n @if (indeterminate) {\n <div class=\"icon\" @iconAnimation [innerHTML]=\"iconIndeterminate\"></div>\n } @else if (value) {\n <div class=\"icon\" @iconAnimation [innerHTML]=\"iconCheck\"></div>\n }\n </span>\n <span class=\"checkbox-label\">\n <ng-content></ng-content>\n </span>\n</label>\n@if (showFooter) {\n @switch (getFooterMessages()) {\n @case ('error') {\n <ng-content select=\"monkey-error\" />\n }\n @case ('info') {\n <ng-content select=\"monkey-info\" />\n }\n }\n}\n", styles: [":host{display:inline-flex;flex-direction:column;gap:6px}:host .header{display:flex;justify-content:space-between;gap:6px}:host label{display:inline-flex;align-items:center;justify-content:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none;position:relative}:host .checkbox{display:block;width:24px;height:24px;border:2px solid var(--mecx-color-gray-400);background-color:#fff;border-radius:8px;position:relative;transition:background-color .2s ease;box-sizing:border-box}:host .checkbox .icon{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}:host .checkbox-label{color:var(--mecx-color-gray-900);font-size:14px;font-weight:400;line-height:24px}:host input{position:absolute;opacity:0;cursor:pointer;height:0;width:0}:host.sm .checkbox{width:16px;height:16px;border-radius:4px}:host.sm .checkbox-label{line-height:16px}:host.lg .checkbox-label{font-size:16px}:host.mecx-checkbox-checked .checkbox,:host.mecx-checkbox-indeterminate .checkbox{border:none;background-color:var(--mecx-color-theme-main)}:host.mecx-checkbox-focused .checkbox{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}:host.mecx-disabled .checkbox-label{color:var(--mecx-color-gray-400)}:host.mecx-disabled .checkbox{background-color:var(--mecx-color-gray-50);border-color:var(--mecx-color-gray-200)}:host.mecx-checkbox-invalid:not(.mecx-checkbox-indeterminate) .checkbox{border:2px solid var(--mecx-color-error-700)}:host.mecx-checkbox-checked.mecx-disabled .checkbox,:host.mecx-checkbox-indeterminate.mecx-disabled .checkbox{background-color:var(--mecx-color-gray-400)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormsModule }], animations: [
721
+ trigger('iconAnimation', [
722
+ transition(':enter', [
723
+ animate('250ms ease-in-out', keyframes([
724
+ style({ opacity: 0, transform: 'scale(0.7)' }),
725
+ style({ opacity: 1, transform: 'scale(1)' })
726
+ ]))
727
+ ]),
728
+ transition(':leave', [
729
+ animate('250ms ease-in-out', keyframes([
730
+ style({ opacity: 1, transform: 'scale(1)' }),
731
+ style({ opacity: 0, transform: 'scale(.7)' })
732
+ ]))
733
+ ])
734
+ ])
735
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
736
+ }
737
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyCheckboxComponent, decorators: [{
738
+ type: Component,
739
+ args: [{ selector: 'monkey-checkbox', standalone: true, imports: [ReactiveFormsModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, animations: [
740
+ trigger('iconAnimation', [
741
+ transition(':enter', [
742
+ animate('250ms ease-in-out', keyframes([
743
+ style({ opacity: 0, transform: 'scale(0.7)' }),
744
+ style({ opacity: 1, transform: 'scale(1)' })
745
+ ]))
746
+ ]),
747
+ transition(':leave', [
748
+ animate('250ms ease-in-out', keyframes([
749
+ style({ opacity: 1, transform: 'scale(1)' }),
750
+ style({ opacity: 0, transform: 'scale(.7)' })
751
+ ]))
752
+ ])
753
+ ])
754
+ ], providers: [
755
+ {
756
+ provide: NG_VALUE_ACCESSOR,
757
+ useExisting: forwardRef(() => {
758
+ // eslint-disable-next-line no-use-before-define
759
+ return MonkeyCheckboxComponent;
760
+ }),
761
+ multi: true
762
+ },
763
+ {
764
+ provide: NG_VALIDATORS,
765
+ // eslint-disable-next-line no-use-before-define
766
+ useExisting: MonkeyCheckboxComponent,
767
+ multi: true
768
+ },
769
+ MonkeyDestroyService
770
+ ], host: {
771
+ 'data-testid': 'input-checkbox',
772
+ class: 'mecx-checkbox',
773
+ '[class.mecx-disabled]': 'disabled',
774
+ '[class.mecx-checkbox-checked]': 'value',
775
+ '[class.mecx-checkbox-focused]': 'isFocused',
776
+ '[class.mecx-checkbox-indeterminate]': 'indeterminate',
777
+ '[class.mecx-checkbox-invalid]': 'showInvalid',
778
+ '[class.sm]': 'size.includes("sm")',
779
+ '[class.md]': 'size.includes("md")',
780
+ '[class.lg]': 'size.includes("lg")'
781
+ }, template: "@if (hasHeader) {\n <div class=\"header\">\n <ng-content select=\"monkey-label\" />\n <ng-content select=\"monkey-helper\" />\n </div>\n}\n<label [attr.for]=\"inputId\">\n <input\n type=\"checkbox\"\n [checked]=\"value\"\n [indeterminate]=\"indeterminate\"\n [disabled]=\"disabled\"\n (change)=\"onChangeEvent($event)\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n [id]=\"inputId\"\n [required]=\"required\"\n />\n <span class=\"checkbox\">\n @if (indeterminate) {\n <div class=\"icon\" @iconAnimation [innerHTML]=\"iconIndeterminate\"></div>\n } @else if (value) {\n <div class=\"icon\" @iconAnimation [innerHTML]=\"iconCheck\"></div>\n }\n </span>\n <span class=\"checkbox-label\">\n <ng-content></ng-content>\n </span>\n</label>\n@if (showFooter) {\n @switch (getFooterMessages()) {\n @case ('error') {\n <ng-content select=\"monkey-error\" />\n }\n @case ('info') {\n <ng-content select=\"monkey-info\" />\n }\n }\n}\n", styles: [":host{display:inline-flex;flex-direction:column;gap:6px}:host .header{display:flex;justify-content:space-between;gap:6px}:host label{display:inline-flex;align-items:center;justify-content:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none;position:relative}:host .checkbox{display:block;width:24px;height:24px;border:2px solid var(--mecx-color-gray-400);background-color:#fff;border-radius:8px;position:relative;transition:background-color .2s ease;box-sizing:border-box}:host .checkbox .icon{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}:host .checkbox-label{color:var(--mecx-color-gray-900);font-size:14px;font-weight:400;line-height:24px}:host input{position:absolute;opacity:0;cursor:pointer;height:0;width:0}:host.sm .checkbox{width:16px;height:16px;border-radius:4px}:host.sm .checkbox-label{line-height:16px}:host.lg .checkbox-label{font-size:16px}:host.mecx-checkbox-checked .checkbox,:host.mecx-checkbox-indeterminate .checkbox{border:none;background-color:var(--mecx-color-theme-main)}:host.mecx-checkbox-focused .checkbox{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}:host.mecx-disabled .checkbox-label{color:var(--mecx-color-gray-400)}:host.mecx-disabled .checkbox{background-color:var(--mecx-color-gray-50);border-color:var(--mecx-color-gray-200)}:host.mecx-checkbox-invalid:not(.mecx-checkbox-indeterminate) .checkbox{border:2px solid var(--mecx-color-error-700)}:host.mecx-checkbox-checked.mecx-disabled .checkbox,:host.mecx-checkbox-indeterminate.mecx-disabled .checkbox{background-color:var(--mecx-color-gray-400)}\n"] }]
782
+ }], propDecorators: { infoChildren: [{
783
+ type: ContentChildren,
784
+ args: [MonkeyInfo, { descendants: true }]
785
+ }], labelChildren: [{
786
+ type: ContentChildren,
787
+ args: [MonkeyLabel, { descendants: true }]
788
+ }], helperChildren: [{
789
+ type: ContentChildren,
790
+ args: [MonkeyHelper, { descendants: true }]
791
+ }], disabled: [{
792
+ type: Input,
793
+ args: [{ transform: booleanAttribute }]
794
+ }], indeterminate: [{
795
+ type: Input,
796
+ args: [{ transform: booleanAttribute }]
797
+ }], required: [{
798
+ type: Input,
799
+ args: [{ transform: booleanAttribute }]
800
+ }], showFooter: [{
801
+ type: Input,
802
+ args: [{ transform: booleanAttribute }]
803
+ }], size: [{
804
+ type: Input
805
+ }], onChange: [{
806
+ type: Output
807
+ }], value: [{
808
+ type: Input
809
+ }] } });
810
+
811
+ /** ************************
812
+ * Copyright Monkey Exchange. All Rights Reserved
813
+ * This style guide was developed by Monkey Exchange Team
814
+ * MIT Licence
815
+ ************************* */
816
+ class MonkeyDividerComponent {
817
+ get classes() {
818
+ return `${this.size()} ${this.vertical() ? 'vertical' : ''}`;
819
+ }
820
+ get id() {
821
+ return this._id;
822
+ }
823
+ set id(value) {
824
+ this._id = value || this._uid;
825
+ }
826
+ constructor() {
827
+ this.size = input('sm');
828
+ this.vertical = input(false, {
829
+ transform: booleanAttribute
830
+ });
831
+ this._uid = inject(IdGenerator).getId('monkey-divider-');
832
+ // eslint-disable-next-line no-self-assign
833
+ this.id = this.id;
834
+ }
835
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyDividerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
836
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: MonkeyDividerComponent, isStandalone: true, selector: "monkey-divider", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, vertical: { classPropertyName: "vertical", publicName: "vertical", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null } }, host: { attributes: { "data-testid": "monkey-divider" }, properties: { "attr.id": "id", "id": "id", "class": "this.classes" } }, ngImport: i0, template: '', isInline: true, styles: ["monkey-divider{display:flex;box-sizing:border-box;width:100%;background-color:#e9eaec}monkey-divider.lg{height:4px}monkey-divider.lg.vertical{width:4px!important}monkey-divider.md{height:2px}monkey-divider.md.vertical{width:2px!important}monkey-divider.sm{height:1px}monkey-divider.sm.vertical{width:1px!important}monkey-divider.vertical{height:100%}\n"], encapsulation: i0.ViewEncapsulation.None }); }
837
+ }
838
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyDividerComponent, decorators: [{
839
+ type: Component,
840
+ args: [{ encapsulation: ViewEncapsulation.None, selector: 'monkey-divider', standalone: true, template: '', host: {
841
+ 'data-testid': 'monkey-divider',
842
+ '[attr.id]': 'id',
843
+ '[id]': 'id'
844
+ }, styles: ["monkey-divider{display:flex;box-sizing:border-box;width:100%;background-color:#e9eaec}monkey-divider.lg{height:4px}monkey-divider.lg.vertical{width:4px!important}monkey-divider.md{height:2px}monkey-divider.md.vertical{width:2px!important}monkey-divider.sm{height:1px}monkey-divider.sm.vertical{width:1px!important}monkey-divider.vertical{height:100%}\n"] }]
845
+ }], ctorParameters: () => [], propDecorators: { classes: [{
846
+ type: HostBinding,
847
+ args: ['class']
848
+ }], id: [{
849
+ type: Input
850
+ }] } });
851
+
852
+ /** ************************
853
+ * Copyright Monkey Exchange. All Rights Reserved
854
+ * This style guide was developed by Monkey Exchange Team
855
+ * MIT Licence
856
+ ************************* */
857
+ class MonkeyFormFieldControl {
858
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyFormFieldControl, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
859
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyFormFieldControl, ngImport: i0 }); }
860
+ }
861
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyFormFieldControl, decorators: [{
862
+ type: Directive
863
+ }] });
864
+
865
+ /** ************************
866
+ * Copyright Monkey Exchange. All Rights Reserved
867
+ * This style guide was developed by Monkey Exchange Team
868
+ * MIT Licence
869
+ ************************* */
870
+ function getCurrencySymbol(code) {
871
+ const currency = code || 'BRL';
872
+ const symbol = {
873
+ BRL: 'R$',
874
+ CLP: '$',
875
+ MXN: '$',
876
+ USD: '$'
877
+ }[currency];
878
+ return symbol;
879
+ }
880
+
881
+ /** ************************
882
+ * Copyright Monkey Exchange. All Rights Reserved
883
+ * This style guide was developed by Monkey Exchange Team
884
+ * MIT Licence
885
+ ************************* */
886
+ class MonkeyFormFieldComponent {
887
+ get id() {
888
+ return this._id;
889
+ }
890
+ set id(value) {
891
+ this._id = value || this._uid;
892
+ }
893
+ get control() {
894
+ return this._formFieldControl;
895
+ }
896
+ get labelId() {
897
+ return this._labelId;
898
+ }
899
+ get showHeader() {
900
+ return this.hasLabel || this.hasHelper;
901
+ }
902
+ get showFooter() {
903
+ return this.hasInfo || this.hasError;
904
+ }
905
+ get showInvalid() {
906
+ const touched = this.control.ngControl?.touched || false;
907
+ const invalid = this.control.ngControl?.invalid || false;
908
+ return (this.hasError && !this._isFocused && touched && invalid && !this.control.disableToBeDirty);
909
+ }
910
+ get showClear() {
911
+ return (!!this.control.ngControl?.control?.value &&
912
+ !this.control.disabled &&
913
+ !this.control.loading &&
914
+ !this.hideClear);
915
+ }
916
+ get showCalendar() {
917
+ return this.control.type === 'date';
918
+ }
919
+ get showCurrency() {
920
+ return this.control.currency;
921
+ }
922
+ get showPercent() {
923
+ return this.control.percent;
924
+ }
925
+ get showLoading() {
926
+ return this.control.loading || false;
927
+ }
928
+ constructor() {
929
+ this.elementRef = inject(ElementRef);
930
+ this._icons = inject(MonkeyIconsService);
931
+ this._changeDetectorRef = inject(ChangeDetectorRef);
932
+ this._idGenerator = inject(IdGenerator);
933
+ this._labelId = this._idGenerator.getId('monkey-label-');
934
+ this._uid = inject(IdGenerator).getId('monkey-form-field-');
935
+ this._destroyed = new Subject();
936
+ this._isFocused = null;
937
+ this._previousControl = null;
938
+ this.currencySymbol = getCurrencySymbol(inject(DEFAULT_CURRENCY_CODE));
939
+ this.percentSymbol = '%';
940
+ this.imgClear = this._icons.clear;
941
+ this.imgCalendar = this._icons.calendar;
942
+ this.imgLoading = this._icons.loading;
943
+ this.hasLabel = false;
944
+ this.hasHelper = false;
945
+ this.hasPrefix = false;
946
+ this.hasSuffix = false;
947
+ this.hasInfo = false;
948
+ this.hasError = false;
949
+ // eslint-disable-next-line no-self-assign
950
+ this.id = this.id;
951
+ }
952
+ updateFocusState() {
953
+ if (this.control.focused && !this._isFocused) {
954
+ this._isFocused = true;
955
+ }
956
+ else if (!this.control.focused && (this._isFocused || this._isFocused === null)) {
957
+ this._isFocused = false;
958
+ }
959
+ }
960
+ handleFormFieldControl() {
961
+ if (!this.control) {
962
+ throw Error('monkey-form-field must have a MonkeyFormFieldControl');
963
+ }
964
+ }
965
+ checkPrefixAndSuffix() {
966
+ this.hasPrefix = !!this._prefixChildren?.length;
967
+ this.hasSuffix = !!this._suffixChildren?.length;
968
+ const suffix = this._suffixChildren.get(0);
969
+ if (suffix) {
970
+ suffix.action = (event) => {
971
+ event.preventDefault();
972
+ event.stopPropagation();
973
+ };
974
+ }
975
+ }
976
+ initializePrefixAndSuffix() {
977
+ this.checkPrefixAndSuffix();
978
+ merge(this._prefixChildren.changes, this._suffixChildren.changes).subscribe(() => {
979
+ this.checkPrefixAndSuffix();
980
+ this._changeDetectorRef.markForCheck();
981
+ });
982
+ }
983
+ checkInfoError() {
984
+ this.hasInfo = !!this._infoChildren?.length;
985
+ this.hasError = !!this._errorChildren?.length;
986
+ }
987
+ initializeInfoError() {
988
+ this.checkInfoError();
989
+ merge(this._infoChildren.changes, this._errorChildren.changes).subscribe(() => {
990
+ this.checkInfoError();
991
+ this._changeDetectorRef.markForCheck();
992
+ });
993
+ }
994
+ initializeComponents() {
995
+ this.hasLabel = !!this._labelChildren?.length;
996
+ this.hasHelper = !!this._helperChildren?.length;
997
+ this.initializePrefixAndSuffix();
998
+ this.initializeInfoError();
999
+ }
1000
+ initializeControl() {
1001
+ const { control } = this;
1002
+ this._stateChanges?.unsubscribe();
1003
+ this._stateChanges = control.stateChanges.subscribe(() => {
1004
+ this.updateFocusState();
1005
+ this._changeDetectorRef.markForCheck();
1006
+ });
1007
+ this._valueChanges?.unsubscribe();
1008
+ if (control.ngControl && control.ngControl.valueChanges) {
1009
+ this._valueChanges = control.ngControl.valueChanges
1010
+ .pipe(takeUntil(this._destroyed))
1011
+ .subscribe(() => {
1012
+ this._changeDetectorRef.markForCheck();
1013
+ });
1014
+ }
1015
+ }
1016
+ openDatePicker() {
1017
+ const input = document.getElementById(this.control.id);
1018
+ if (input.showPicker) {
1019
+ input.showPicker();
1020
+ }
1021
+ else {
1022
+ input.focus();
1023
+ }
1024
+ }
1025
+ ngAfterContentInit() {
1026
+ this.handleFormFieldControl();
1027
+ this.initializeComponents();
1028
+ }
1029
+ ngAfterContentChecked() {
1030
+ this.handleFormFieldControl();
1031
+ if (this.control !== this._previousControl) {
1032
+ this.initializeControl();
1033
+ this._previousControl = this.control;
1034
+ }
1035
+ }
1036
+ ngOnDestroy() {
1037
+ this._stateChanges?.unsubscribe();
1038
+ this._valueChanges?.unsubscribe();
1039
+ this._destroyed.next();
1040
+ this._destroyed.complete();
1041
+ }
1042
+ getFooterMessages() {
1043
+ const touched = this.control.ngControl?.touched;
1044
+ const invalid = this.control.ngControl?.invalid;
1045
+ const isFocused = this._isFocused;
1046
+ const hasInfoChildren = this._infoChildren && this._infoChildren.length > 0;
1047
+ const isControlEnabled = !this.control.disabled;
1048
+ const isControlDisableToBeDirty = !this.control.disableToBeDirty;
1049
+ const isTouched = touched;
1050
+ const isInvalid = invalid;
1051
+ const isNotFocused = !isFocused;
1052
+ if (isControlEnabled && isTouched && isInvalid && isNotFocused && isControlDisableToBeDirty) {
1053
+ return 'error';
1054
+ }
1055
+ if (hasInfoChildren) {
1056
+ return 'info';
1057
+ }
1058
+ return '';
1059
+ }
1060
+ getSymbols() {
1061
+ if (this.showCurrency && this.currencySymbol) {
1062
+ return this.currencySymbol;
1063
+ }
1064
+ if (this.showPercent && this.percentSymbol) {
1065
+ return this.percentSymbol;
1066
+ }
1067
+ return '';
1068
+ }
1069
+ onClear(event) {
1070
+ event.preventDefault();
1071
+ event.stopPropagation();
1072
+ this.control.ngControl?.control?.setValue('');
1073
+ this.control.ngControl?.control?.markAsTouched();
1074
+ }
1075
+ onOpenCalendar(event) {
1076
+ event.preventDefault();
1077
+ event.stopPropagation();
1078
+ if (this.control.type === 'date') {
1079
+ this.openDatePicker();
1080
+ }
1081
+ }
1082
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1083
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyFormFieldComponent, selector: "monkey-form-field", inputs: { id: "id", hideClear: ["hideClear", "hideClear", booleanAttribute] }, host: { properties: { "class.mecx-disabled": "control.disabled", "class.mecx-form-field-focused": "control.focused", "class.mecx-form-field-invalid": "showInvalid", "attr.id": "id", "id": "id" }, classAttribute: "mecx-form-field" }, queries: [{ propertyName: "_formFieldControl", first: true, predicate: MonkeyFormFieldControl, descendants: true }, { propertyName: "_labelChildren", predicate: MonkeyLabel, descendants: true }, { propertyName: "_helperChildren", predicate: MonkeyHelper, descendants: true }, { propertyName: "_prefixChildren", predicate: MonkeyPrefix, descendants: true }, { propertyName: "_suffixChildren", predicate: MonkeySuffix, descendants: true }, { propertyName: "_infoChildren", predicate: MonkeyInfo, descendants: true }, { propertyName: "_errorChildren", predicate: MonkeyError, descendants: true }], exportAs: ["monkeyFormField"], ngImport: i0, template: "@if (showHeader) {\n <div class=\"mecx-form-field-header\" (click)=\"control.onContainerClick($event)\">\n <label [id]=\"labelId\" [attr.for]=\"control.id\">\n <ng-content select=\"monkey-label\"></ng-content>\n </label>\n <ng-content select=\"monkey-helper\"></ng-content>\n </div>\n}\n\n<div class=\"mecx-form-field-body\" (click)=\"control.onContainerClick($event)\">\n @if (hasPrefix) {\n <ng-content select=\"monkey-prefix\"></ng-content>\n }\n @if (getSymbols(); as symbols) {\n <div class=\"mecx-form-field-prefix-symbol\">\n {{ symbols }}\n </div>\n }\n\n <ng-content></ng-content>\n\n @if (showClear) {\n <div [innerHTML]=\"imgClear\" class=\"mecx-clear\" (click)=\"onClear($event)\"></div>\n }\n @if (showCalendar) {\n <div [innerHTML]=\"imgCalendar\" class=\"mecx-calendar\" (click)=\"onOpenCalendar($event)\"></div>\n }\n @if (showLoading) {\n <div [innerHTML]=\"imgLoading\" class=\"mecx-form-field-loading\"></div>\n }\n\n @if (hasSuffix) {\n <ng-content select=\"monkey-suffix\"></ng-content>\n }\n</div>\n\n@if (showFooter) {\n <div class=\"mecx-form-field-footer\" (click)=\"control.onContainerClick($event)\">\n @switch (getFooterMessages()) {\n @case ('error') {\n <ng-content select=\"monkey-error\"></ng-content>\n }\n @case ('info') {\n <div class=\"mecx-form-field-info\">\n <ng-content select=\"monkey-info\"></ng-content>\n </div>\n }\n }\n </div>\n}\n", styles: [".mecx-form-field{width:100%;display:inline-flex;flex-direction:column;min-width:0;text-align:left;gap:6px}.mecx-disabled .mecx-form-field{cursor:not-allowed;pointer-events:none}.mecx-form-field-header{display:flex;justify-content:space-between;align-items:center}.mecx-disabled .mecx-form-field-header label{pointer-events:none}.mecx-form-field-body{border-radius:8px;border:2px solid var(--mecx-color-gray-400);padding:8px;gap:4px;background:var(--mecx-color-white);color:var(--mecx-color-gray-500);box-sizing:border-box;height:40px;display:flex;align-items:center}.mecx-form-field-invalid .mecx-form-field-body{border:2px solid var(--mecx-color-error-700)}.mecx-form-field-focused .mecx-form-field-body{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}.mecx-disabled .mecx-form-field-body{border-color:var(--mecx-color-gray-50);background:var(--mecx-color-gray-50);border-radius:8px}.mecx-form-field-body .mecx-clear,.mecx-form-field-body .mecx-calendar{display:flex;align-items:center;justify-content:center;cursor:pointer}.mecx-form-field-body .mecx-calendar svg path{fill:var(--mecx-color-theme-main)}.mecx-form-field-footer{display:flex;flex-direction:column}.mecx-form-field-prefix-symbol{color:var(--mecx-color-gray-700);font-size:16px;font-weight:400;font-style:normal;width:22px;text-align:center}.mecx-form-field-prefix-symbol .mk-i{display:flex}.mecx-disabled .mecx-form-field-prefix-symbol{color:var(--mecx-color-gray-400)!important;pointer-events:none}.mecx-form-field-loading{display:flex}.mecx-form-field-loading svg path{fill:var(--mecx-color-theme-main)}\n"], encapsulation: i0.ViewEncapsulation.None }); }
1084
+ }
1085
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyFormFieldComponent, decorators: [{
1086
+ type: Component,
1087
+ args: [{ encapsulation: ViewEncapsulation.None, selector: 'monkey-form-field', exportAs: 'monkeyFormField', host: {
1088
+ class: 'mecx-form-field',
1089
+ '[class.mecx-disabled]': 'control.disabled',
1090
+ '[class.mecx-form-field-focused]': 'control.focused',
1091
+ '[class.mecx-form-field-invalid]': 'showInvalid',
1092
+ '[attr.id]': 'id',
1093
+ '[id]': 'id'
1094
+ }, template: "@if (showHeader) {\n <div class=\"mecx-form-field-header\" (click)=\"control.onContainerClick($event)\">\n <label [id]=\"labelId\" [attr.for]=\"control.id\">\n <ng-content select=\"monkey-label\"></ng-content>\n </label>\n <ng-content select=\"monkey-helper\"></ng-content>\n </div>\n}\n\n<div class=\"mecx-form-field-body\" (click)=\"control.onContainerClick($event)\">\n @if (hasPrefix) {\n <ng-content select=\"monkey-prefix\"></ng-content>\n }\n @if (getSymbols(); as symbols) {\n <div class=\"mecx-form-field-prefix-symbol\">\n {{ symbols }}\n </div>\n }\n\n <ng-content></ng-content>\n\n @if (showClear) {\n <div [innerHTML]=\"imgClear\" class=\"mecx-clear\" (click)=\"onClear($event)\"></div>\n }\n @if (showCalendar) {\n <div [innerHTML]=\"imgCalendar\" class=\"mecx-calendar\" (click)=\"onOpenCalendar($event)\"></div>\n }\n @if (showLoading) {\n <div [innerHTML]=\"imgLoading\" class=\"mecx-form-field-loading\"></div>\n }\n\n @if (hasSuffix) {\n <ng-content select=\"monkey-suffix\"></ng-content>\n }\n</div>\n\n@if (showFooter) {\n <div class=\"mecx-form-field-footer\" (click)=\"control.onContainerClick($event)\">\n @switch (getFooterMessages()) {\n @case ('error') {\n <ng-content select=\"monkey-error\"></ng-content>\n }\n @case ('info') {\n <div class=\"mecx-form-field-info\">\n <ng-content select=\"monkey-info\"></ng-content>\n </div>\n }\n }\n </div>\n}\n", styles: [".mecx-form-field{width:100%;display:inline-flex;flex-direction:column;min-width:0;text-align:left;gap:6px}.mecx-disabled .mecx-form-field{cursor:not-allowed;pointer-events:none}.mecx-form-field-header{display:flex;justify-content:space-between;align-items:center}.mecx-disabled .mecx-form-field-header label{pointer-events:none}.mecx-form-field-body{border-radius:8px;border:2px solid var(--mecx-color-gray-400);padding:8px;gap:4px;background:var(--mecx-color-white);color:var(--mecx-color-gray-500);box-sizing:border-box;height:40px;display:flex;align-items:center}.mecx-form-field-invalid .mecx-form-field-body{border:2px solid var(--mecx-color-error-700)}.mecx-form-field-focused .mecx-form-field-body{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}.mecx-disabled .mecx-form-field-body{border-color:var(--mecx-color-gray-50);background:var(--mecx-color-gray-50);border-radius:8px}.mecx-form-field-body .mecx-clear,.mecx-form-field-body .mecx-calendar{display:flex;align-items:center;justify-content:center;cursor:pointer}.mecx-form-field-body .mecx-calendar svg path{fill:var(--mecx-color-theme-main)}.mecx-form-field-footer{display:flex;flex-direction:column}.mecx-form-field-prefix-symbol{color:var(--mecx-color-gray-700);font-size:16px;font-weight:400;font-style:normal;width:22px;text-align:center}.mecx-form-field-prefix-symbol .mk-i{display:flex}.mecx-disabled .mecx-form-field-prefix-symbol{color:var(--mecx-color-gray-400)!important;pointer-events:none}.mecx-form-field-loading{display:flex}.mecx-form-field-loading svg path{fill:var(--mecx-color-theme-main)}\n"] }]
1095
+ }], ctorParameters: () => [], propDecorators: { id: [{
1096
+ type: Input
1097
+ }], hideClear: [{
1098
+ type: Input,
1099
+ args: [{ transform: booleanAttribute }]
1100
+ }], _formFieldControl: [{
1101
+ type: ContentChild,
1102
+ args: [MonkeyFormFieldControl]
1103
+ }], _labelChildren: [{
1104
+ type: ContentChildren,
1105
+ args: [MonkeyLabel, { descendants: true }]
1106
+ }], _helperChildren: [{
1107
+ type: ContentChildren,
1108
+ args: [MonkeyHelper, { descendants: true }]
1109
+ }], _prefixChildren: [{
1110
+ type: ContentChildren,
1111
+ args: [MonkeyPrefix, { descendants: true }]
1112
+ }], _suffixChildren: [{
1113
+ type: ContentChildren,
1114
+ args: [MonkeySuffix, { descendants: true }]
1115
+ }], _infoChildren: [{
1116
+ type: ContentChildren,
1117
+ args: [MonkeyInfo, { descendants: true }]
1118
+ }], _errorChildren: [{
1119
+ type: ContentChildren,
1120
+ args: [MonkeyError, { descendants: true }]
1121
+ }] } });
1122
+
1123
+ /** ************************
1124
+ * Copyright Monkey Exchange. All Rights Reserved
1125
+ * This style guide was developed by Monkey Exchange Team
1126
+ * MIT Licence
1127
+ ************************* */
1128
+ class MonkeyFormFieldModule {
1129
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1130
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: MonkeyFormFieldModule, declarations: [MonkeyFormFieldComponent], exports: [MonkeyFormFieldComponent] }); }
1131
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyFormFieldModule }); }
1132
+ }
1133
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyFormFieldModule, decorators: [{
1134
+ type: NgModule,
1135
+ args: [{
1136
+ declarations: [MonkeyFormFieldComponent],
1137
+ exports: [MonkeyFormFieldComponent]
1138
+ }]
1139
+ }] });
1140
+
1141
+ /** ************************
1142
+ * Copyright Monkey Exchange. All Rights Reserved
1143
+ * This style guide was developed by Monkey Exchange Team
1144
+ * MIT Licence
1145
+ ************************* */
1146
+ class MonkeyIconButtonComponent {
1147
+ get id() {
1148
+ return this._id;
1149
+ }
1150
+ set id(value) {
1151
+ this._id = value || this._uid;
1152
+ }
1153
+ constructor() {
1154
+ this.type = 'primary';
1155
+ this.size = 'md';
1156
+ this.disabled = false;
1157
+ this.icon = '';
1158
+ this._uid = inject(IdGenerator).getId('monkey-icon-button-');
1159
+ // eslint-disable-next-line no-self-assign
1160
+ this.id = this.id;
1161
+ }
1162
+ onClick(event) {
1163
+ if (this.disabled) {
1164
+ event.stopPropagation();
1165
+ event.preventDefault();
1166
+ event.stopImmediatePropagation();
1167
+ }
1168
+ }
1169
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyIconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1170
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyIconButtonComponent, isStandalone: true, selector: "monkey-icon-button", inputs: { type: "type", size: "size", disabled: "disabled", icon: "icon", id: "id" }, host: { attributes: { "data-testid": "monkey-icon-button" }, listeners: { "click": "onClick($event)" }, properties: { "attr.id": "id", "id": "id" } }, ngImport: i0, template: "<button class=\"mecx-icon-button\" [ngClass]=\"type + ' ' + size\" [disabled]=\"disabled\">\n <div class=\"content\">\n <monkey-icon [icon]=\"icon\" [size]=\"size\" first></monkey-icon>\n </div>\n</button>\n", styles: ["monkey-icon-button{display:inline-block;margin:0 2px}monkey-icon-button .mecx-icon-button{width:100%;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;transition:background-color .15s ease-out,color .15s ease-out}monkey-icon-button .mecx-icon-button .content{display:flex;align-items:center;justify-content:center;padding:12px;transition:transform .2s cubic-bezier(0,.5,.2,1)}monkey-icon-button .mecx-icon-button .content span{width:100%}monkey-icon-button .mecx-icon-button .content .mk-i{display:flex}monkey-icon-button .mecx-icon-button:disabled{background:#f1f2f3!important;color:#bdc1c7!important;cursor:not-allowed!important}monkey-icon-button .mecx-icon-button:disabled.secondary{background:unset!important;border:1px solid #bdc1c7!important}monkey-icon-button .mecx-icon-button.primary{color:var(--mecx-color-theme-contrast-main);background:var(--mecx-color-theme-main)}monkey-icon-button .mecx-icon-button.primary:hover:not(:disabled){background:var(--mecx-color-theme-600)}monkey-icon-button .mecx-icon-button.secondary{border:2px solid #bdc1c7;background:unset}monkey-icon-button .mecx-icon-button.secondary:disabled{border-width:1px}monkey-icon-button .mecx-icon-button.secondary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-icon-button .mecx-icon-button.tertiary{background:unset}monkey-icon-button .mecx-icon-button.tertiary span{text-decoration:underline}monkey-icon-button .mecx-icon-button.tertiary:disabled{background:unset!important;border-width:1px}monkey-icon-button .mecx-icon-button.tertiary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-icon-button .mecx-icon-button.sm{width:32px;height:32px}monkey-icon-button .mecx-icon-button.sm .mk-i{font-size:20px}monkey-icon-button .mecx-icon-button.md{width:40px;height:40px}monkey-icon-button .mecx-icon-button.md .mk-i{font-size:22px}monkey-icon-button .mecx-icon-button.lg{width:48px;height:48px}monkey-icon-button .mecx-icon-button.lg .mk-i{font-size:24px}monkey-icon-button .mecx-icon-button.full-width{width:100%}monkey-icon-button .mecx-icon-button:focus{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}monkey-icon-button .mecx-icon-button:active:not(:disabled).primary{background:var(--mecx-color-theme-main);opacity:.8;outline:none}monkey-icon-button .mecx-icon-button:active:not(:disabled) .content{transform:scale(.8)}:host:has(.mecx-button:active) .mecx-button{outline:unset;outline-offset:unset}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MonkeyIconComponent, selector: "monkey-icon", inputs: ["icon", "size", "id"] }], encapsulation: i0.ViewEncapsulation.None }); }
1171
+ }
1172
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyIconButtonComponent, decorators: [{
1173
+ type: Component,
1174
+ args: [{ selector: 'monkey-icon-button', standalone: true, imports: [CommonModule, MonkeyIconComponent], encapsulation: ViewEncapsulation.None, host: {
1175
+ 'data-testid': 'monkey-icon-button',
1176
+ '[attr.id]': 'id',
1177
+ '[id]': 'id'
1178
+ }, template: "<button class=\"mecx-icon-button\" [ngClass]=\"type + ' ' + size\" [disabled]=\"disabled\">\n <div class=\"content\">\n <monkey-icon [icon]=\"icon\" [size]=\"size\" first></monkey-icon>\n </div>\n</button>\n", styles: ["monkey-icon-button{display:inline-block;margin:0 2px}monkey-icon-button .mecx-icon-button{width:100%;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;transition:background-color .15s ease-out,color .15s ease-out}monkey-icon-button .mecx-icon-button .content{display:flex;align-items:center;justify-content:center;padding:12px;transition:transform .2s cubic-bezier(0,.5,.2,1)}monkey-icon-button .mecx-icon-button .content span{width:100%}monkey-icon-button .mecx-icon-button .content .mk-i{display:flex}monkey-icon-button .mecx-icon-button:disabled{background:#f1f2f3!important;color:#bdc1c7!important;cursor:not-allowed!important}monkey-icon-button .mecx-icon-button:disabled.secondary{background:unset!important;border:1px solid #bdc1c7!important}monkey-icon-button .mecx-icon-button.primary{color:var(--mecx-color-theme-contrast-main);background:var(--mecx-color-theme-main)}monkey-icon-button .mecx-icon-button.primary:hover:not(:disabled){background:var(--mecx-color-theme-600)}monkey-icon-button .mecx-icon-button.secondary{border:2px solid #bdc1c7;background:unset}monkey-icon-button .mecx-icon-button.secondary:disabled{border-width:1px}monkey-icon-button .mecx-icon-button.secondary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-icon-button .mecx-icon-button.tertiary{background:unset}monkey-icon-button .mecx-icon-button.tertiary span{text-decoration:underline}monkey-icon-button .mecx-icon-button.tertiary:disabled{background:unset!important;border-width:1px}monkey-icon-button .mecx-icon-button.tertiary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-icon-button .mecx-icon-button.sm{width:32px;height:32px}monkey-icon-button .mecx-icon-button.sm .mk-i{font-size:20px}monkey-icon-button .mecx-icon-button.md{width:40px;height:40px}monkey-icon-button .mecx-icon-button.md .mk-i{font-size:22px}monkey-icon-button .mecx-icon-button.lg{width:48px;height:48px}monkey-icon-button .mecx-icon-button.lg .mk-i{font-size:24px}monkey-icon-button .mecx-icon-button.full-width{width:100%}monkey-icon-button .mecx-icon-button:focus{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}monkey-icon-button .mecx-icon-button:active:not(:disabled).primary{background:var(--mecx-color-theme-main);opacity:.8;outline:none}monkey-icon-button .mecx-icon-button:active:not(:disabled) .content{transform:scale(.8)}:host:has(.mecx-button:active) .mecx-button{outline:unset;outline-offset:unset}\n"] }]
1179
+ }], ctorParameters: () => [], propDecorators: { type: [{
1180
+ type: Input
1181
+ }], size: [{
1182
+ type: Input
1183
+ }], disabled: [{
1184
+ type: Input
1185
+ }], icon: [{
1186
+ type: Input
1187
+ }], id: [{
1188
+ type: Input
1189
+ }], onClick: [{
1190
+ type: HostListener,
1191
+ args: ['click', ['$event']]
1192
+ }] } });
1193
+
1194
+ /** ************************
1195
+ * Copyright Monkey Exchange. All Rights Reserved
1196
+ * This style guide was developed by Monkey Exchange Team
1197
+ * MIT Licence
1198
+ ************************* */
1199
+ class MonkeyInputCurrencyDirective {
1200
+ get disabled() {
1201
+ if (this.ngControl && this.ngControl.disabled !== null) {
1202
+ return this.ngControl.disabled;
1203
+ }
1204
+ return this._disabled;
1205
+ }
1206
+ set disabled(value) {
1207
+ this._disabled = value;
1208
+ if (this.focused) {
1209
+ this.focused = false;
1210
+ this.stateChanges.next();
1211
+ }
1212
+ }
1213
+ get id() {
1214
+ return this._id;
1215
+ }
1216
+ set id(value) {
1217
+ this._id = value || this._uid;
1218
+ }
1219
+ get required() {
1220
+ return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;
1221
+ }
1222
+ set required(value) {
1223
+ this._required = coerceBooleanProperty(value);
1224
+ }
1225
+ get type() {
1226
+ return this._type;
1227
+ }
1228
+ set type(value) {
1229
+ this._type = value;
1230
+ }
1231
+ get currency() {
1232
+ return true;
1233
+ }
1234
+ get percent() {
1235
+ return false;
1236
+ }
1237
+ constructor(el, renderer, currencyPipe) {
1238
+ this.el = el;
1239
+ this.renderer = renderer;
1240
+ this.currencyPipe = currencyPipe;
1241
+ this._elementRef = inject(ElementRef);
1242
+ this._uid = inject(IdGenerator).getId('monkey-input-currency-');
1243
+ this.stateChanges = new Subject();
1244
+ this._disabled = false;
1245
+ this._type = 'text';
1246
+ this._changeDetectorRef = inject(ChangeDetectorRef);
1247
+ this._currencyCode = inject(DEFAULT_CURRENCY_CODE);
1248
+ this._localeId = inject(LOCALE_ID);
1249
+ this._destroyed = new Subject();
1250
+ this._rawValue = 0;
1251
+ this.ngControl = inject(NgControl, { self: true, optional: true });
1252
+ this.focused = false;
1253
+ // eslint-disable-next-line no-self-assign
1254
+ this.id = this.id;
1255
+ }
1256
+ markAsUntouched() {
1257
+ this.ngControl?.control?.markAsUntouched();
1258
+ }
1259
+ focus(options) {
1260
+ this._elementRef.nativeElement.focus(options);
1261
+ this.markAsUntouched();
1262
+ }
1263
+ formatValue(value) {
1264
+ return this.currencyPipe.transform(value, this._currencyCode || 'BRL', '', '1.2-2', this._localeId || 'pt-BR');
1265
+ }
1266
+ handleControlValue() {
1267
+ const value = this.ngControl?.control?.value;
1268
+ if (this._rawValue !== value) {
1269
+ this._rawValue = value;
1270
+ let handled = value;
1271
+ const decimal = `${value}`.split('.')[1];
1272
+ if (`${decimal}`.length >= 2) {
1273
+ handled = `${value}`.replace(/[^0-9]/g, '');
1274
+ handled = `${Number(handled) / 100}`;
1275
+ }
1276
+ this.ngControl?.control?.setValue(Number(handled), { emitEvent: false, onlySelf: true });
1277
+ const formattedValue = this.formatValue(handled);
1278
+ this.renderer.setProperty(this.el.nativeElement, 'value', formattedValue);
1279
+ this._changeDetectorRef.markForCheck();
1280
+ }
1281
+ }
1282
+ ngOnInit() {
1283
+ this.handleControlValue();
1284
+ this._valueChanges?.unsubscribe();
1285
+ this._valueChanges = this.ngControl?.control?.valueChanges
1286
+ .pipe(takeUntil(this._destroyed))
1287
+ .subscribe(() => {
1288
+ this.handleControlValue();
1289
+ });
1290
+ }
1291
+ ngOnDestroy() {
1292
+ this.stateChanges.complete();
1293
+ this._valueChanges?.unsubscribe();
1294
+ }
1295
+ ngOnChanges({ disabled }) {
1296
+ if (!disabled) {
1297
+ this.stateChanges.next();
1298
+ }
1299
+ }
1300
+ onContainerClick() {
1301
+ if (!this.focused) {
1302
+ this.focus();
1303
+ }
1304
+ }
1305
+ focusChanged(isFocused) {
1306
+ if (isFocused === this.focused) {
1307
+ return;
1308
+ }
1309
+ if (isFocused && this.disabled) {
1310
+ const element = this._elementRef.nativeElement;
1311
+ element.setSelectionRange(0, 0);
1312
+ }
1313
+ this.markAsUntouched();
1314
+ this.focused = isFocused;
1315
+ this.stateChanges.next();
1316
+ }
1317
+ focusOutChanged() {
1318
+ this.ngControl?.control?.markAsTouched();
1319
+ }
1320
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputCurrencyDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1$1.CurrencyPipe }], target: i0.ɵɵFactoryTarget.Directive }); }
1321
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.13", type: MonkeyInputCurrencyDirective, selector: "input[monkey-input-currency]", inputs: { name: "name", disabled: ["disabled", "disabled", booleanAttribute], id: "id", required: "required", type: "type" }, host: { listeners: { "focus": "focusChanged(true)", "focusout": "focusOutChanged()", "blur": "focusChanged(false)" }, properties: { "class.mecx-input-disabled": "disabled", "id": "id", "disabled": "disabled", "required": "required", "attr.name": "name || null", "attr.disabled": "disabled || null", "attr.aria-invalid": "(empty && required) ? null : errorState", "attr.aria-required": "required", "attr.id": "id" }, classAttribute: "mecx-input" }, providers: [
1322
+ {
1323
+ provide: MonkeyFormFieldControl,
1324
+ // eslint-disable-next-line no-use-before-define
1325
+ useExisting: MonkeyInputCurrencyDirective
1326
+ },
1327
+ MonkeyDestroyService
1328
+ ], exportAs: ["monkeyInput"], usesOnChanges: true, ngImport: i0 }); }
1329
+ }
1330
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputCurrencyDirective, decorators: [{
1331
+ type: Directive,
1332
+ args: [{
1333
+ selector: 'input[monkey-input-currency]',
1334
+ exportAs: 'monkeyInput',
1335
+ host: {
1336
+ class: 'mecx-input',
1337
+ '[class.mecx-input-disabled]': 'disabled',
1338
+ '[id]': 'id',
1339
+ '[disabled]': 'disabled',
1340
+ '[required]': 'required',
1341
+ '[attr.name]': 'name || null',
1342
+ '[attr.disabled]': 'disabled || null',
1343
+ '[attr.aria-invalid]': '(empty && required) ? null : errorState',
1344
+ '[attr.aria-required]': 'required',
1345
+ '[attr.id]': 'id',
1346
+ '(focus)': 'focusChanged(true)',
1347
+ '(focusout)': 'focusOutChanged()',
1348
+ '(blur)': 'focusChanged(false)'
1349
+ },
1350
+ providers: [
1351
+ {
1352
+ provide: MonkeyFormFieldControl,
1353
+ // eslint-disable-next-line no-use-before-define
1354
+ useExisting: MonkeyInputCurrencyDirective
1355
+ },
1356
+ MonkeyDestroyService
1357
+ ]
1358
+ }]
1359
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1$1.CurrencyPipe }], propDecorators: { name: [{
1360
+ type: Input
1361
+ }], disabled: [{
1362
+ type: Input,
1363
+ args: [{ transform: booleanAttribute }]
1364
+ }], id: [{
1365
+ type: Input
1366
+ }], required: [{
1367
+ type: Input
1368
+ }], type: [{
1369
+ type: Input
1370
+ }] } });
1371
+
1372
+ const INPUT_INVALID_TYPES = [
1373
+ 'button',
1374
+ 'checkbox',
1375
+ 'file',
1376
+ 'image',
1377
+ 'radio',
1378
+ 'range',
1379
+ 'reset',
1380
+ 'submit'
1381
+ ];
1382
+ function validateType(type) {
1383
+ if (INPUT_INVALID_TYPES.indexOf(type) > -1 || !getSupportedInputTypes().has(type)) {
1384
+ throw Error(`Input type "${type}" isn't supported.`);
1385
+ }
1386
+ }
1387
+
1388
+ /** ************************
1389
+ * Copyright Monkey Exchange. All Rights Reserved
1390
+ * This style guide was developed by Monkey Exchange Team
1391
+ * MIT Licence
1392
+ ************************* */
1393
+ class MonkeyInputDirective {
1394
+ get disabled() {
1395
+ if (this.ngControl && this.ngControl.disabled !== null) {
1396
+ return this.ngControl.disabled;
1397
+ }
1398
+ return this._disabled;
1399
+ }
1400
+ set disabled(value) {
1401
+ this._disabled = value;
1402
+ if (this.focused) {
1403
+ this.focused = false;
1404
+ this.stateChanges.next();
1405
+ }
1406
+ }
1407
+ get id() {
1408
+ return this._id;
1409
+ }
1410
+ set id(value) {
1411
+ this._id = value || this._uid;
1412
+ }
1413
+ get required() {
1414
+ return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;
1415
+ }
1416
+ set required(value) {
1417
+ this._required = coerceBooleanProperty(value);
1418
+ }
1419
+ get type() {
1420
+ return this._type;
1421
+ }
1422
+ set type(value) {
1423
+ validateType(value);
1424
+ this._type = value || 'text';
1425
+ this._elementRef.nativeElement.type = this._type;
1426
+ }
1427
+ get currency() {
1428
+ return false;
1429
+ }
1430
+ get percent() {
1431
+ return this._percent;
1432
+ }
1433
+ set percent(value) {
1434
+ this._percent = true;
1435
+ }
1436
+ constructor() {
1437
+ this._elementRef = inject(ElementRef);
1438
+ this._uid = inject(IdGenerator).getId('monkey-input-');
1439
+ this.stateChanges = new Subject();
1440
+ this._disabled = false;
1441
+ this._type = 'text';
1442
+ this._percent = false;
1443
+ this.ngControl = inject(NgControl, { self: true, optional: true });
1444
+ this.focused = false;
1445
+ // eslint-disable-next-line no-self-assign
1446
+ this.id = this.id;
1447
+ }
1448
+ markAsUntouched() {
1449
+ this.ngControl?.control?.markAsUntouched();
1450
+ }
1451
+ focus(options) {
1452
+ this._elementRef.nativeElement.focus(options);
1453
+ this.markAsUntouched();
1454
+ }
1455
+ ngOnDestroy() {
1456
+ this.stateChanges.complete();
1457
+ }
1458
+ ngOnChanges({ disabled }) {
1459
+ if (!disabled) {
1460
+ this.stateChanges.next();
1461
+ }
1462
+ }
1463
+ onContainerClick() {
1464
+ if (!this.focused) {
1465
+ this.focus();
1466
+ }
1467
+ }
1468
+ focusChanged(isFocused) {
1469
+ if (isFocused === this.focused) {
1470
+ return;
1471
+ }
1472
+ if (isFocused && this.disabled) {
1473
+ const element = this._elementRef.nativeElement;
1474
+ if (element.type === 'number') {
1475
+ element.type = 'text';
1476
+ element.setSelectionRange(0, 0);
1477
+ element.type = 'number';
1478
+ }
1479
+ else {
1480
+ element.setSelectionRange(0, 0);
1481
+ }
1482
+ }
1483
+ this.markAsUntouched();
1484
+ this.focused = isFocused;
1485
+ this.stateChanges.next();
1486
+ }
1487
+ focusOutChanged() {
1488
+ this.ngControl?.control?.markAsTouched();
1489
+ }
1490
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1491
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.13", type: MonkeyInputDirective, selector: "input[monkey-input],textarea[monkey-input]", inputs: { name: "name", disabled: ["disabled", "disabled", booleanAttribute], id: "id", required: "required", type: "type", percent: "percent" }, host: { attributes: { "data-testid": "monkey-input" }, listeners: { "focus": "focusChanged(true)", "focusout": "focusOutChanged()", "blur": "focusChanged(false)" }, properties: { "class.mecx-input-disabled": "disabled", "id": "id", "disabled": "disabled", "required": "required", "attr.name": "name || null", "attr.disabled": "disabled || null", "attr.aria-invalid": "(empty && required) ? null : errorState", "attr.aria-required": "required", "attr.id": "id" }, classAttribute: "mecx-input" }, providers: [
1492
+ {
1493
+ provide: MonkeyFormFieldControl,
1494
+ // eslint-disable-next-line no-use-before-define
1495
+ useExisting: MonkeyInputDirective
1496
+ },
1497
+ MonkeyDestroyService
1498
+ ], exportAs: ["monkeyInput"], usesOnChanges: true, ngImport: i0 }); }
1499
+ }
1500
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputDirective, decorators: [{
1501
+ type: Directive,
1502
+ args: [{
1503
+ selector: 'input[monkey-input],textarea[monkey-input]',
1504
+ exportAs: 'monkeyInput',
1505
+ host: {
1506
+ class: 'mecx-input',
1507
+ 'data-testid': 'monkey-input',
1508
+ '[class.mecx-input-disabled]': 'disabled',
1509
+ '[id]': 'id',
1510
+ '[disabled]': 'disabled',
1511
+ '[required]': 'required',
1512
+ '[attr.name]': 'name || null',
1513
+ '[attr.disabled]': 'disabled || null',
1514
+ '[attr.aria-invalid]': '(empty && required) ? null : errorState',
1515
+ '[attr.aria-required]': 'required',
1516
+ '[attr.id]': 'id',
1517
+ '(focus)': 'focusChanged(true)',
1518
+ '(focusout)': 'focusOutChanged()',
1519
+ '(blur)': 'focusChanged(false)'
1520
+ },
1521
+ providers: [
1522
+ {
1523
+ provide: MonkeyFormFieldControl,
1524
+ // eslint-disable-next-line no-use-before-define
1525
+ useExisting: MonkeyInputDirective
1526
+ },
1527
+ MonkeyDestroyService
1528
+ ]
1529
+ }]
1530
+ }], ctorParameters: () => [], propDecorators: { name: [{
1531
+ type: Input
1532
+ }], disabled: [{
1533
+ type: Input,
1534
+ args: [{ transform: booleanAttribute }]
1535
+ }], id: [{
1536
+ type: Input
1537
+ }], required: [{
1538
+ type: Input
1539
+ }], type: [{
1540
+ type: Input
1541
+ }], percent: [{
1542
+ type: Input
1543
+ }] } });
1544
+
1545
+ /** ************************
1546
+ * Copyright Monkey Exchange. All Rights Reserved
1547
+ * This style guide was developed by Monkey Exchange Team
1548
+ * MIT Licence
1549
+ ************************* */
1550
+ class MonkeyInputModule {
1551
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1552
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputModule, declarations: [MonkeyInputDirective, MonkeyInputCurrencyDirective], exports: [MonkeyInputDirective, MonkeyInputCurrencyDirective] }); }
1553
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputModule, providers: [CurrencyPipe] }); }
1554
+ }
1555
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputModule, decorators: [{
1556
+ type: NgModule,
1557
+ args: [{
1558
+ providers: [CurrencyPipe],
1559
+ declarations: [MonkeyInputDirective, MonkeyInputCurrencyDirective],
1560
+ exports: [MonkeyInputDirective, MonkeyInputCurrencyDirective]
1561
+ }]
1562
+ }] });
1563
+
1564
+ /** ************************
1565
+ * Copyright Monkey Exchange. All Rights Reserved
1566
+ * This style guide was developed by Monkey Exchange Team
1567
+ * MIT Licence
1568
+ ************************* */
1569
+ class MonkeySecurityLevelComponent {
1570
+ get class() {
1571
+ if (this.score() === 0) {
1572
+ return 'empty';
1573
+ }
1574
+ if (this.score() < 300) {
1575
+ return 'weak';
1576
+ }
1577
+ if (this.score() >= 300 && this.score() < 800) {
1578
+ return 'medium';
1579
+ }
1580
+ if (this.score() >= 800 && this.score() < 1000) {
1581
+ return 'strong';
1582
+ }
1583
+ return 'very-strong';
1584
+ }
1585
+ get id() {
1586
+ return this._id;
1587
+ }
1588
+ set id(value) {
1589
+ this._id = value || this._uid;
1590
+ }
1591
+ constructor() {
1592
+ this.label = input();
1593
+ this.score = input.required();
1594
+ this.strengthLabel = input();
1595
+ this._uid = inject(IdGenerator).getId('monkey-security-level-');
1596
+ // eslint-disable-next-line no-self-assign
1597
+ this.id = this.id;
1598
+ }
1599
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySecurityLevelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1600
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: MonkeySecurityLevelComponent, isStandalone: true, selector: "monkey-security-level", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, score: { classPropertyName: "score", publicName: "score", isSignal: true, isRequired: true, transformFunction: null }, strengthLabel: { classPropertyName: "strengthLabel", publicName: "strengthLabel", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null } }, host: { attributes: { "data-testid": "monkey-security-level" }, properties: { "attr.id": "id", "id": "id", "class": "this.class" } }, ngImport: i0, template: "<div class=\"body\">\n <div>\n <span data-testid=\"label\" *ngIf=\"label() as lb\">\n {{ lb }}\n </span>\n <span data-testid=\"str-label\" class=\"level-info\" *ngIf=\"strengthLabel() as strLabel\">\n {{ strLabel }}\n </span>\n </div>\n <div class=\"bar\"></div>\n</div>\n", styles: ["monkey-security-level{display:flex;align-items:center;gap:8px;width:100%}monkey-security-level span{color:#545a63;font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px}monkey-security-level .level-info{color:#1f2024;margin-left:24px;font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px}monkey-security-level .body{display:flex;flex-direction:column;align-items:baseline;width:100%}monkey-security-level .bar{height:4px;width:100%;max-width:426px;border-radius:8px;background:#d3d6da;position:relative;overflow:hidden}monkey-security-level .bar:before{content:\"\";display:block;position:absolute;height:100%;left:0;top:0;transition:all 1s}monkey-security-level.very-strong .bar:before{background:#00875a;width:100%}monkey-security-level.strong .bar:before{background:#00875a;width:80%}monkey-security-level.medium .bar:before{background:#efa30e;width:66%}monkey-security-level.weak .bar:before{background:#db0505;width:33%}monkey-security-level.empty .bar:before{background:#db0505;width:0%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None }); }
1601
+ }
1602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySecurityLevelComponent, decorators: [{
1603
+ type: Component,
1604
+ args: [{ encapsulation: ViewEncapsulation.None, imports: [CommonModule], selector: 'monkey-security-level', standalone: true, host: {
1605
+ 'data-testid': 'monkey-security-level',
1606
+ '[attr.id]': 'id',
1607
+ '[id]': 'id'
1608
+ }, template: "<div class=\"body\">\n <div>\n <span data-testid=\"label\" *ngIf=\"label() as lb\">\n {{ lb }}\n </span>\n <span data-testid=\"str-label\" class=\"level-info\" *ngIf=\"strengthLabel() as strLabel\">\n {{ strLabel }}\n </span>\n </div>\n <div class=\"bar\"></div>\n</div>\n", styles: ["monkey-security-level{display:flex;align-items:center;gap:8px;width:100%}monkey-security-level span{color:#545a63;font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px}monkey-security-level .level-info{color:#1f2024;margin-left:24px;font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px}monkey-security-level .body{display:flex;flex-direction:column;align-items:baseline;width:100%}monkey-security-level .bar{height:4px;width:100%;max-width:426px;border-radius:8px;background:#d3d6da;position:relative;overflow:hidden}monkey-security-level .bar:before{content:\"\";display:block;position:absolute;height:100%;left:0;top:0;transition:all 1s}monkey-security-level.very-strong .bar:before{background:#00875a;width:100%}monkey-security-level.strong .bar:before{background:#00875a;width:80%}monkey-security-level.medium .bar:before{background:#efa30e;width:66%}monkey-security-level.weak .bar:before{background:#db0505;width:33%}monkey-security-level.empty .bar:before{background:#db0505;width:0%}\n"] }]
1609
+ }], ctorParameters: () => [], propDecorators: { class: [{
1610
+ type: HostBinding,
1611
+ args: ['class']
1612
+ }], id: [{
1613
+ type: Input
1614
+ }] } });
1615
+
1616
+ /** ************************
1617
+ * Copyright Monkey Exchange. All Rights Reserved
1618
+ * This style guide was developed by Monkey Exchange Team
1619
+ * MIT Licence
1620
+ ************************* */
1621
+ class MonkeyStatusComponent {
1622
+ get class() {
1623
+ return `${this.type()} ${this.size()}`;
1624
+ }
1625
+ get id() {
1626
+ return this._id;
1627
+ }
1628
+ set id(value) {
1629
+ this._id = value || this._uid;
1630
+ }
1631
+ constructor() {
1632
+ this.type = input.required();
1633
+ this.size = input('md');
1634
+ this.label = input();
1635
+ this._uid = inject(IdGenerator).getId('monkey-status-');
1636
+ // eslint-disable-next-line no-self-assign
1637
+ this.id = this.id;
1638
+ }
1639
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1640
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: MonkeyStatusComponent, isStandalone: true, selector: "monkey-status", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null } }, host: { attributes: { "data-testid": "monkey-status" }, properties: { "attr.id": "id", "id": "id", "class": "this.class" } }, ngImport: i0, template: "<div class=\"status\"></div>\n<span *ngIf=\"label() as lb\">\n {{ lb }}\n</span>\n", styles: [":host{display:flex;align-items:center;gap:8px}:host span{color:#545a63;font-style:normal;font-weight:400;line-height:24px}:host .status{width:8px;height:8px;border-radius:50%;flex-shrink:0}:host.sm span{font-size:14px;letter-spacing:.42px}:host.sm .status{height:8px;width:8px}:host.md span{font-size:16px;letter-spacing:.48px}:host.md .status{height:12px;width:12px}:host.lg span{font-size:18px;letter-spacing:.52px}:host.lg .status{height:16px;width:16px}:host.default .status{background-color:#d3d6da}:host.success .status{background-color:#00875a}:host.warning .status{background-color:#efa30e}:host.error .status{background-color:#db0505}:host.question .status{background-color:#8d38fa}:host.info .status{background-color:#003687}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1641
+ }
1642
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyStatusComponent, decorators: [{
1643
+ type: Component,
1644
+ args: [{ selector: 'monkey-status', standalone: true, imports: [CommonModule], host: {
1645
+ 'data-testid': 'monkey-status',
1646
+ '[attr.id]': 'id',
1647
+ '[id]': 'id'
1648
+ }, template: "<div class=\"status\"></div>\n<span *ngIf=\"label() as lb\">\n {{ lb }}\n</span>\n", styles: [":host{display:flex;align-items:center;gap:8px}:host span{color:#545a63;font-style:normal;font-weight:400;line-height:24px}:host .status{width:8px;height:8px;border-radius:50%;flex-shrink:0}:host.sm span{font-size:14px;letter-spacing:.42px}:host.sm .status{height:8px;width:8px}:host.md span{font-size:16px;letter-spacing:.48px}:host.md .status{height:12px;width:12px}:host.lg span{font-size:18px;letter-spacing:.52px}:host.lg .status{height:16px;width:16px}:host.default .status{background-color:#d3d6da}:host.success .status{background-color:#00875a}:host.warning .status{background-color:#efa30e}:host.error .status{background-color:#db0505}:host.question .status{background-color:#8d38fa}:host.info .status{background-color:#003687}\n"] }]
1649
+ }], ctorParameters: () => [], propDecorators: { class: [{
1650
+ type: HostBinding,
1651
+ args: ['class']
1652
+ }], id: [{
1653
+ type: Input
1654
+ }] } });
1655
+
1656
+ /** ************************
1657
+ * Copyright Monkey Exchange. All Rights Reserved
1658
+ * This style guide was developed by Monkey Exchange Team
1659
+ * MIT Licence
1660
+ ************************* */
1661
+ class MonkeyPaginationActionComponent {
1662
+ get id() {
1663
+ return this._id;
1664
+ }
1665
+ set id(value) {
1666
+ this._id = value || this._uid;
1667
+ }
1668
+ constructor() {
1669
+ this.next = false;
1670
+ this.prev = false;
1671
+ this.onAction = new EventEmitter();
1672
+ this._uid = inject(IdGenerator).getId('monkey-pagination-action-');
1673
+ // eslint-disable-next-line no-self-assign
1674
+ this.id = this.id;
1675
+ }
1676
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyPaginationActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1677
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyPaginationActionComponent, isStandalone: true, selector: "monkey-pagination-action", inputs: { disabled: "disabled", first: "first", last: "last", next: "next", prev: "prev", id: "id" }, outputs: { onAction: "onAction" }, host: { attributes: { "data-testid": "monkey-pagination-action" }, properties: { "attr.id": "id", "id": "id" } }, exportAs: ["monkeyPaginationAction"], ngImport: i0, template: "<monkey-button\n type=\"secondary\"\n size=\"sm\"\n (click)=\"onAction.next('prev')\"\n [disabled]=\"disabled || !prev\"\n>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M11.670 8.630 C 9.335 10.964,8.550 11.772,8.523 11.870 C 8.501 11.947,8.501 12.053,8.523 12.130 C 8.574 12.316,14.682 18.423,14.870 18.477 C 15.231 18.581,15.581 18.231,15.477 17.869 C 15.450 17.774,14.687 16.987,12.570 14.870 L 9.700 12.000 12.570 9.130 C 14.687 7.013,15.450 6.226,15.477 6.131 C 15.528 5.951,15.464 5.747,15.316 5.623 C 15.219 5.541,15.151 5.520,14.988 5.520 L 14.781 5.520 11.670 8.630 \"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n fill=\"black\"\n ></path>\n </svg>\n</monkey-button>\n\n<monkey-button\n type=\"secondary\"\n size=\"sm\"\n (click)=\"onAction.next('next')\"\n [disabled]=\"disabled || !next\"\n>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M8.751 5.583 C 8.552 5.691,8.459 6.004,8.564 6.213 C 8.588 6.261,9.889 7.583,11.454 9.150 L 14.300 12.000 11.454 14.850 C 9.889 16.418,8.588 17.739,8.564 17.787 C 8.357 18.197,8.823 18.640,9.232 18.423 C 9.363 18.353,15.373 12.337,15.436 12.213 C 15.497 12.092,15.491 11.897,15.423 11.768 C 15.353 11.637,9.337 5.627,9.213 5.564 C 9.092 5.503,8.881 5.512,8.751 5.583 \"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n fill=\"black\"\n ></path>\n </svg>\n</monkey-button>\n", styles: ["monkey-pagination-action{display:flex;align-items:center;gap:8px}monkey-pagination-action monkey-button .mecx-button .content{padding:unset}monkey-pagination-action monkey-button .mecx-button .content span{display:flex;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: MonkeyButtonComponent, selector: "monkey-button", inputs: ["disabled", "size", "type", "id"] }], encapsulation: i0.ViewEncapsulation.None }); }
1678
+ }
1679
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyPaginationActionComponent, decorators: [{
1680
+ type: Component,
1681
+ args: [{ standalone: true, imports: [CommonModule, MonkeyButtonComponent], encapsulation: ViewEncapsulation.None, selector: 'monkey-pagination-action', exportAs: 'monkeyPaginationAction', host: {
1682
+ 'data-testid': 'monkey-pagination-action',
1683
+ '[attr.id]': 'id',
1684
+ '[id]': 'id'
1685
+ }, template: "<monkey-button\n type=\"secondary\"\n size=\"sm\"\n (click)=\"onAction.next('prev')\"\n [disabled]=\"disabled || !prev\"\n>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M11.670 8.630 C 9.335 10.964,8.550 11.772,8.523 11.870 C 8.501 11.947,8.501 12.053,8.523 12.130 C 8.574 12.316,14.682 18.423,14.870 18.477 C 15.231 18.581,15.581 18.231,15.477 17.869 C 15.450 17.774,14.687 16.987,12.570 14.870 L 9.700 12.000 12.570 9.130 C 14.687 7.013,15.450 6.226,15.477 6.131 C 15.528 5.951,15.464 5.747,15.316 5.623 C 15.219 5.541,15.151 5.520,14.988 5.520 L 14.781 5.520 11.670 8.630 \"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n fill=\"black\"\n ></path>\n </svg>\n</monkey-button>\n\n<monkey-button\n type=\"secondary\"\n size=\"sm\"\n (click)=\"onAction.next('next')\"\n [disabled]=\"disabled || !next\"\n>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M8.751 5.583 C 8.552 5.691,8.459 6.004,8.564 6.213 C 8.588 6.261,9.889 7.583,11.454 9.150 L 14.300 12.000 11.454 14.850 C 9.889 16.418,8.588 17.739,8.564 17.787 C 8.357 18.197,8.823 18.640,9.232 18.423 C 9.363 18.353,15.373 12.337,15.436 12.213 C 15.497 12.092,15.491 11.897,15.423 11.768 C 15.353 11.637,9.337 5.627,9.213 5.564 C 9.092 5.503,8.881 5.512,8.751 5.583 \"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n fill=\"black\"\n ></path>\n </svg>\n</monkey-button>\n", styles: ["monkey-pagination-action{display:flex;align-items:center;gap:8px}monkey-pagination-action monkey-button .mecx-button .content{padding:unset}monkey-pagination-action monkey-button .mecx-button .content span{display:flex;height:100%}\n"] }]
1686
+ }], ctorParameters: () => [], propDecorators: { disabled: [{
1687
+ type: Input
1688
+ }], first: [{
1689
+ type: Input
1690
+ }], last: [{
1691
+ type: Input
1692
+ }], next: [{
1693
+ type: Input,
1694
+ args: [{ required: true }]
1695
+ }], prev: [{
1696
+ type: Input,
1697
+ args: [{ required: true }]
1698
+ }], onAction: [{
1699
+ type: Output
1700
+ }], id: [{
1701
+ type: Input
1702
+ }] } });
1703
+
1704
+ /** ************************
1705
+ * Copyright Monkey Exchange. All Rights Reserved
1706
+ * This style guide was developed by Monkey Exchange Team
1707
+ * MIT Licence
1708
+ ************************* */
1709
+ class MonkeyPaginationLabelComponent {
1710
+ get id() {
1711
+ return this._id;
1712
+ }
1713
+ set id(value) {
1714
+ this._id = value || this._uid;
1715
+ }
1716
+ constructor() {
1717
+ this._uid = inject(IdGenerator).getId('monkey-pagination-label-');
1718
+ // eslint-disable-next-line no-self-assign
1719
+ this.id = this.id;
1720
+ }
1721
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyPaginationLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1722
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyPaginationLabelComponent, isStandalone: true, selector: "monkey-pagination-label", inputs: { id: "id" }, host: { attributes: { "data-testid": "monkey-pagination-label" }, properties: { "attr.id": "id", "id": "id" } }, exportAs: ["monkeyPaginationLabel"], ngImport: i0, template: "<ng-content></ng-content>\n", styles: ["monkey-pagination-label{font-size:12px}\n"], encapsulation: i0.ViewEncapsulation.None }); }
1723
+ }
1724
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyPaginationLabelComponent, decorators: [{
1725
+ type: Component,
1726
+ args: [{ standalone: true, encapsulation: ViewEncapsulation.None, selector: 'monkey-pagination-label', exportAs: 'monkeyPaginationLabel', host: {
1727
+ 'data-testid': 'monkey-pagination-label',
1728
+ '[attr.id]': 'id',
1729
+ '[id]': 'id'
1730
+ }, template: "<ng-content></ng-content>\n", styles: ["monkey-pagination-label{font-size:12px}\n"] }]
1731
+ }], ctorParameters: () => [], propDecorators: { id: [{
1732
+ type: Input
1733
+ }] } });
1734
+
1735
+ /** ************************
1736
+ * Copyright Monkey Exchange. All Rights Reserved
1737
+ * This style guide was developed by Monkey Exchange Team
1738
+ * MIT Licence
1739
+ ************************* */
1740
+ class MonkeyOptionComponent {
1741
+ constructor() {
1742
+ this.idGenerator = inject(IdGenerator);
1743
+ this.disabled = false;
1744
+ this.selected = false;
1745
+ this.tabIndex = 0;
1746
+ this.id = this.idGenerator.getId('mecx-option-');
1747
+ }
1748
+ get displayContent() {
1749
+ return (this._content?.nativeElement.textContent || '').trim();
1750
+ }
1751
+ onClick(event) {
1752
+ if (this.disabled) {
1753
+ event.stopPropagation();
1754
+ event.preventDefault();
1755
+ }
1756
+ else {
1757
+ this.action?.();
1758
+ }
1759
+ }
1760
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1761
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.13", type: MonkeyOptionComponent, isStandalone: true, selector: "monkey-option", inputs: { value: "value", disabled: ["disabled", "disabled", booleanAttribute] }, host: { attributes: { "data-testid": "monkey-option" }, listeners: { "click": "onClick($event)" }, properties: { "attr.id": "id", "class.mecx-option-disabled": "disabled", "class.mecx-option-selected": "selected", "attr.tabindex": "disabled ? -1 : tabIndex" }, classAttribute: "mecx-option" }, viewQueries: [{ propertyName: "_content", first: true, predicate: ["content"], descendants: true, static: true }], ngImport: i0, template: `<div #content><ng-content /></div>`, isInline: true, styles: ["monkey-option{display:flex;position:relative;cursor:pointer;padding:16px;line-height:16px;font-size:14px;color:var(--mecx-color-gray-900);transition:all .1s ease-in-out}monkey-option>div{display:flex;white-space:normal;word-break:break-all}monkey-option:hover{color:var(--mecx-color-gray-900);background-color:var(--mecx-color-gray-100)}monkey-option.mecx-option-disabled{color:var(--mecx-color-gray-400);background-color:#fff;cursor:default}monkey-option.mecx-option-selected{color:var(--mecx-color-theme-contrast-main);background-color:var(--mecx-color-theme-main)}.ng-animating monkey-option.mecx-option-selected{color:var(--mecx-color-gray-900);background-color:var(--mecx-color-gray-100)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1762
+ }
1763
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyOptionComponent, decorators: [{
1764
+ type: Component,
1765
+ args: [{ selector: 'monkey-option', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `<div #content><ng-content /></div>`, encapsulation: ViewEncapsulation.None, host: {
1766
+ 'data-testid': 'monkey-option',
1767
+ '[attr.id]': 'id',
1768
+ class: 'mecx-option',
1769
+ '[class.mecx-option-disabled]': 'disabled',
1770
+ '[class.mecx-option-selected]': 'selected',
1771
+ '[attr.tabindex]': 'disabled ? -1 : tabIndex'
1772
+ }, styles: ["monkey-option{display:flex;position:relative;cursor:pointer;padding:16px;line-height:16px;font-size:14px;color:var(--mecx-color-gray-900);transition:all .1s ease-in-out}monkey-option>div{display:flex;white-space:normal;word-break:break-all}monkey-option:hover{color:var(--mecx-color-gray-900);background-color:var(--mecx-color-gray-100)}monkey-option.mecx-option-disabled{color:var(--mecx-color-gray-400);background-color:#fff;cursor:default}monkey-option.mecx-option-selected{color:var(--mecx-color-theme-contrast-main);background-color:var(--mecx-color-theme-main)}.ng-animating monkey-option.mecx-option-selected{color:var(--mecx-color-gray-900);background-color:var(--mecx-color-gray-100)}\n"] }]
1773
+ }], propDecorators: { _content: [{
1774
+ type: ViewChild,
1775
+ args: ['content', { static: true }]
1776
+ }], value: [{
1777
+ type: Input
1778
+ }], disabled: [{
1779
+ type: Input,
1780
+ args: [{ transform: booleanAttribute }]
1781
+ }], onClick: [{
1782
+ type: HostListener,
1783
+ args: ['click', ['$event']]
1784
+ }] } });
1785
+
1786
+ /** ************************
1787
+ * Copyright Monkey Exchange. All Rights Reserved
1788
+ * This style guide was developed by Monkey Exchange Team
1789
+ * MIT Licence
1790
+ ************************* */
1791
+ class MonkeySelectComponent {
1792
+ get disabled() {
1793
+ if (this.ngControl && this.ngControl.disabled !== null) {
1794
+ return this.ngControl.disabled;
1795
+ }
1796
+ return this._disabled;
1797
+ }
1798
+ set disabled(value) {
1799
+ this._disabled = value;
1800
+ if (this.focused) {
1801
+ this.focused = false;
1802
+ this.stateChanges.next();
1803
+ }
1804
+ }
1805
+ get required() {
1806
+ return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;
1807
+ }
1808
+ set required(value) {
1809
+ this._required = value;
1810
+ this.stateChanges.next();
1811
+ }
1812
+ set value(value) {
1813
+ if (this._value !== value) {
1814
+ this._value = value;
1815
+ this._onChange(value);
1816
+ }
1817
+ }
1818
+ get value() {
1819
+ return this._value;
1820
+ }
1821
+ constructor(overlay, changeDetectorRef, viewContainerRef, formField) {
1822
+ this.overlay = overlay;
1823
+ this.changeDetectorRef = changeDetectorRef;
1824
+ this.viewContainerRef = viewContainerRef;
1825
+ this.formField = formField;
1826
+ this.tabIndex = 0;
1827
+ this.onChange = new EventEmitter();
1828
+ this.placeholder = '';
1829
+ this.loading = false;
1830
+ this._value = null;
1831
+ this.labelSelected = '';
1832
+ this.overlayRef = null;
1833
+ this.isOpen = false;
1834
+ this._destroyed = inject(MonkeyDestroyService);
1835
+ this.iconArrowDown = inject(MonkeyIconsService).arrowDown;
1836
+ this.idGenerator = inject(IdGenerator);
1837
+ this.ngControl = inject(NgControl, { self: true, optional: true });
1838
+ this._elementRef = inject(ElementRef);
1839
+ this.currency = false;
1840
+ this.focused = false;
1841
+ this._disabled = false;
1842
+ this.id = this.idGenerator.getId('monkey-select-');
1843
+ this.percent = false;
1844
+ this.stateChanges = new Subject();
1845
+ this.type = '';
1846
+ this.onAnimationEnd = (event) => {
1847
+ if (event.toState === 'closed') {
1848
+ this.closeOverlay();
1849
+ }
1850
+ };
1851
+ this._onChange = () => { };
1852
+ this._onTouched = () => { };
1853
+ if (this.ngControl) {
1854
+ this.ngControl.valueAccessor = this;
1855
+ }
1856
+ }
1857
+ changeControl() {
1858
+ if (this.formField?.control) {
1859
+ this.formField.control.loading = this.loading;
1860
+ }
1861
+ }
1862
+ changeSelected() {
1863
+ setTimeout(() => {
1864
+ if (this.options) {
1865
+ this.options.forEach((opt) => {
1866
+ opt.selected = opt.value === this.value;
1867
+ });
1868
+ this.updateSelectedLabel();
1869
+ }
1870
+ this.changeDetectorRef.markForCheck();
1871
+ });
1872
+ }
1873
+ initializeOptions() {
1874
+ this.options.forEach((option) => {
1875
+ if (!option.action) {
1876
+ option.action = this.selectOption.bind(this, option);
1877
+ }
1878
+ });
1879
+ }
1880
+ ngAfterContentInit() {
1881
+ this.initializeOptions();
1882
+ this.options.changes.subscribe((resp) => {
1883
+ this.updateSelectedLabel();
1884
+ this.initializeOptions();
1885
+ this.changeSelected();
1886
+ });
1887
+ }
1888
+ ngOnDestroy() {
1889
+ if (this.overlayRef) {
1890
+ this.overlayRef.dispose();
1891
+ }
1892
+ }
1893
+ toggleDropdown() {
1894
+ if (!this.disabled) {
1895
+ if (this.isOpen) {
1896
+ this.closeDropdown();
1897
+ this._onTouched();
1898
+ }
1899
+ else {
1900
+ this.openDropdown();
1901
+ }
1902
+ }
1903
+ }
1904
+ openDropdown() {
1905
+ if (this.options?.length) {
1906
+ this.formField.control.disableToBeDirty = true;
1907
+ this.isOpen = true;
1908
+ this.createOverlay();
1909
+ }
1910
+ }
1911
+ closeDropdown() {
1912
+ this.changeDetectorRef.markForCheck();
1913
+ this.isOpen = false;
1914
+ this.focused = false;
1915
+ this.formField.control.disableToBeDirty = false;
1916
+ }
1917
+ closeOverlay() {
1918
+ if (this.overlayRef) {
1919
+ this.overlayRef.dispose();
1920
+ this.overlayRef = null;
1921
+ }
1922
+ }
1923
+ createOverlay() {
1924
+ if (this.overlayRef) {
1925
+ return;
1926
+ }
1927
+ const offset = 4;
1928
+ const positions = [
1929
+ {
1930
+ originX: 'start',
1931
+ originY: 'bottom',
1932
+ overlayX: 'start',
1933
+ overlayY: 'top',
1934
+ offsetY: offset
1935
+ },
1936
+ {
1937
+ originX: 'start',
1938
+ originY: 'top',
1939
+ overlayX: 'start',
1940
+ overlayY: 'bottom',
1941
+ offsetY: -offset
1942
+ }
1943
+ ];
1944
+ let anchor = this.trigger;
1945
+ let width = anchor.nativeElement.offsetWidth;
1946
+ if (this.formField?.elementRef) {
1947
+ const el = this.formField?.elementRef.nativeElement.querySelector('.mecx-form-field-body');
1948
+ anchor = el;
1949
+ width = el.offsetWidth;
1950
+ }
1951
+ const positionStrategy = this.overlay
1952
+ .position()
1953
+ .flexibleConnectedTo(anchor)
1954
+ .withPositions(positions)
1955
+ .withPush(true);
1956
+ this.overlayRef = this.overlay.create({
1957
+ positionStrategy,
1958
+ scrollStrategy: this.overlay.scrollStrategies.block(),
1959
+ width,
1960
+ hasBackdrop: true,
1961
+ backdropClass: 'no-class'
1962
+ });
1963
+ const portal = new TemplatePortal(this.overlayTemplate, this.viewContainerRef);
1964
+ this.overlayRef.attach(portal);
1965
+ this.overlayRef
1966
+ .backdropClick()
1967
+ .pipe(takeUntil(this._destroyed))
1968
+ .subscribe(() => {
1969
+ return this.closeDropdown();
1970
+ });
1971
+ }
1972
+ selectOption(option) {
1973
+ if (!option.disabled && !this.disabled) {
1974
+ this.value = option.value;
1975
+ this.updateSelectedLabel();
1976
+ this.closeDropdown();
1977
+ this._onChange(this.value);
1978
+ this.onChange.emit(this.value);
1979
+ this.options.forEach((opt) => {
1980
+ opt.selected = opt.value === this.value;
1981
+ });
1982
+ }
1983
+ }
1984
+ updateSelectedLabel() {
1985
+ const selectedOption = this.options.find((opt) => {
1986
+ return opt.value === this.value;
1987
+ });
1988
+ this.labelSelected = selectedOption ? selectedOption.displayContent : '';
1989
+ }
1990
+ writeValue(value) {
1991
+ this.value = value;
1992
+ this.changeSelected();
1993
+ }
1994
+ onContainerClick(event) {
1995
+ if (this.disabled)
1996
+ return;
1997
+ this.openDropdown();
1998
+ this._elementRef.nativeElement.focus();
1999
+ }
2000
+ _onFocus() {
2001
+ if (!this.disabled) {
2002
+ this.focused = true;
2003
+ this._onTouched();
2004
+ this.stateChanges.next();
2005
+ }
2006
+ }
2007
+ _onBlur() {
2008
+ this.focused = false;
2009
+ this.stateChanges.next();
2010
+ }
2011
+ registerOnChange(fn) {
2012
+ this._onChange = fn;
2013
+ }
2014
+ registerOnTouched(fn) {
2015
+ this._onTouched = fn;
2016
+ }
2017
+ setDisabledState(isDisabled) {
2018
+ this.disabled = isDisabled;
2019
+ }
2020
+ ngOnChanges(changes) {
2021
+ let hasChanges = false;
2022
+ // eslint-disable-next-line dot-notation
2023
+ const changesLoading = changes?.['loading'];
2024
+ if (changesLoading?.currentValue !== changesLoading?.previousValue) {
2025
+ hasChanges = true;
2026
+ this.changeControl();
2027
+ }
2028
+ if (hasChanges) {
2029
+ this.stateChanges.next();
2030
+ }
2031
+ }
2032
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySelectComponent, deps: [{ token: i1.Overlay }, { token: i0.ChangeDetectorRef }, { token: i0.ViewContainerRef }, { token: MonkeyFormFieldComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
2033
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeySelectComponent, isStandalone: true, selector: "monkey-select", inputs: { tabIndex: "tabIndex", placeholder: "placeholder", loading: ["loading", "loading", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], required: ["required", "required", booleanAttribute], value: "value" }, outputs: { onChange: "onChange" }, host: { attributes: { "data-testid": "monkey-select" }, listeners: { "focus": "_onFocus()", "blur": "_onBlur()" }, properties: { "class.mecx-select-disabled": "_disabled", "class.mecx-select-focused": "focused", "attr.id": "id", "attr.tabindex": "disabled ? -1 : tabIndex" }, classAttribute: "mecx-select" }, providers: [
2034
+ // eslint-disable-next-line no-use-before-define
2035
+ { provide: MonkeyFormFieldControl, useExisting: MonkeySelectComponent },
2036
+ MonkeyDestroyService
2037
+ ], queries: [{ propertyName: "options", predicate: MonkeyOptionComponent }], viewQueries: [{ propertyName: "overlayTemplate", first: true, predicate: ["overlayTemplate"], descendants: true }, { propertyName: "overlayEl", first: true, predicate: ["overlay"], descendants: true }, { propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"mecx-select-trigger\"\n [class.open]=\"isOpen\"\n (click)=\"toggleDropdown()\"\n role=\"combobox\"\n [attr.aria-expanded]=\"isOpen\"\n #trigger\n>\n <div class=\"mecx-select-value\" [class.has-value]=\"value\">\n <span>{{ labelSelected || placeholder }}</span>\n </div>\n\n @if (!loading) {\n <div class=\"mecx-select-icon\" [innerHTML]=\"iconArrowDown\"></div>\n }\n</div>\n\n<ng-template #overlayTemplate>\n <div\n class=\"mecx-select-overlay\"\n #overlay\n [@animation]=\"isOpen ? 'open' : 'closed'\"\n (@animation.done)=\"onAnimationEnd($event)\"\n >\n <ng-content />\n </div>\n</ng-template>\n", styles: ["monkey-select{display:inline-flex;width:100%;min-width:0;position:relative}monkey-select:focus-visible,monkey-select:focus{outline:none}.mecx-select-trigger{width:100%;display:inline-flex;align-items:center;cursor:pointer;gap:8px;box-sizing:border-box}.mecx-select-trigger .mecx-select-value{flex-grow:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--mecx-color-gray-500);font-size:14px;line-height:24px;letter-spacing:.42px}.mecx-select-trigger .mecx-select-value.has-value{color:var(--mecx-color-gray-900)}.mecx-select-trigger .mecx-select-icon{display:flex;transition:all .2s ease-in-out}.mecx-select-trigger .mecx-select-icon svg *{stroke:var(--mecx-color-theme-main)}.mecx-select-disabled .mecx-select-trigger{background-color:var(--mecx-color-gray-50);border-color:var(--mecx-color-gray-50);cursor:default}.mecx-select-disabled .mecx-select-trigger .mecx-select-value{color:var(--mecx-color-gray-400)}.mecx-select-disabled .mecx-select-trigger .mecx-select-icon svg *{stroke:var(--mecx-color-gray-400)}.mecx-select-trigger.open .mecx-select-icon{transform:rotate(180deg)}.mecx-select-overlay{width:100%;background:#fff;border:2px solid var(--mecx-color-gray-400);overflow:hidden auto;border-radius:8px;box-shadow:0 16px 32px #d6d6d694;max-height:360px}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormsModule }], animations: [
2038
+ trigger('animation', [
2039
+ transition(':enter', [
2040
+ style({
2041
+ opacity: 0,
2042
+ transform: 'scaleY(.9)'
2043
+ }),
2044
+ animate('100ms ease-in-out', style({
2045
+ opacity: 1,
2046
+ transform: 'scaleY(1)'
2047
+ }))
2048
+ ]),
2049
+ state('closed', style({
2050
+ transform: 'scaleY(.9)',
2051
+ opacity: 0
2052
+ })),
2053
+ transition('closed <=> open', animate('200ms ease-in-out'))
2054
+ ])
2055
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
2056
+ }
2057
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySelectComponent, decorators: [{
2058
+ type: Component,
2059
+ args: [{ selector: 'monkey-select', standalone: true, imports: [ReactiveFormsModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
2060
+ // eslint-disable-next-line no-use-before-define
2061
+ { provide: MonkeyFormFieldControl, useExisting: MonkeySelectComponent },
2062
+ MonkeyDestroyService
2063
+ ], animations: [
2064
+ trigger('animation', [
2065
+ transition(':enter', [
2066
+ style({
2067
+ opacity: 0,
2068
+ transform: 'scaleY(.9)'
2069
+ }),
2070
+ animate('100ms ease-in-out', style({
2071
+ opacity: 1,
2072
+ transform: 'scaleY(1)'
2073
+ }))
2074
+ ]),
2075
+ state('closed', style({
2076
+ transform: 'scaleY(.9)',
2077
+ opacity: 0
2078
+ })),
2079
+ transition('closed <=> open', animate('200ms ease-in-out'))
2080
+ ])
2081
+ ], host: {
2082
+ 'data-testid': 'monkey-select',
2083
+ class: 'mecx-select',
2084
+ '[class.mecx-select-disabled]': '_disabled',
2085
+ '[class.mecx-select-focused]': 'focused',
2086
+ '[attr.id]': 'id',
2087
+ '[attr.tabindex]': 'disabled ? -1 : tabIndex',
2088
+ '(focus)': '_onFocus()',
2089
+ '(blur)': '_onBlur()'
2090
+ }, template: "<div\n class=\"mecx-select-trigger\"\n [class.open]=\"isOpen\"\n (click)=\"toggleDropdown()\"\n role=\"combobox\"\n [attr.aria-expanded]=\"isOpen\"\n #trigger\n>\n <div class=\"mecx-select-value\" [class.has-value]=\"value\">\n <span>{{ labelSelected || placeholder }}</span>\n </div>\n\n @if (!loading) {\n <div class=\"mecx-select-icon\" [innerHTML]=\"iconArrowDown\"></div>\n }\n</div>\n\n<ng-template #overlayTemplate>\n <div\n class=\"mecx-select-overlay\"\n #overlay\n [@animation]=\"isOpen ? 'open' : 'closed'\"\n (@animation.done)=\"onAnimationEnd($event)\"\n >\n <ng-content />\n </div>\n</ng-template>\n", styles: ["monkey-select{display:inline-flex;width:100%;min-width:0;position:relative}monkey-select:focus-visible,monkey-select:focus{outline:none}.mecx-select-trigger{width:100%;display:inline-flex;align-items:center;cursor:pointer;gap:8px;box-sizing:border-box}.mecx-select-trigger .mecx-select-value{flex-grow:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--mecx-color-gray-500);font-size:14px;line-height:24px;letter-spacing:.42px}.mecx-select-trigger .mecx-select-value.has-value{color:var(--mecx-color-gray-900)}.mecx-select-trigger .mecx-select-icon{display:flex;transition:all .2s ease-in-out}.mecx-select-trigger .mecx-select-icon svg *{stroke:var(--mecx-color-theme-main)}.mecx-select-disabled .mecx-select-trigger{background-color:var(--mecx-color-gray-50);border-color:var(--mecx-color-gray-50);cursor:default}.mecx-select-disabled .mecx-select-trigger .mecx-select-value{color:var(--mecx-color-gray-400)}.mecx-select-disabled .mecx-select-trigger .mecx-select-icon svg *{stroke:var(--mecx-color-gray-400)}.mecx-select-trigger.open .mecx-select-icon{transform:rotate(180deg)}.mecx-select-overlay{width:100%;background:#fff;border:2px solid var(--mecx-color-gray-400);overflow:hidden auto;border-radius:8px;box-shadow:0 16px 32px #d6d6d694;max-height:360px}\n"] }]
2091
+ }], ctorParameters: () => [{ type: i1.Overlay }, { type: i0.ChangeDetectorRef }, { type: i0.ViewContainerRef }, { type: MonkeyFormFieldComponent, decorators: [{
2092
+ type: Optional
2093
+ }] }], propDecorators: { overlayTemplate: [{
2094
+ type: ViewChild,
2095
+ args: ['overlayTemplate']
2096
+ }], overlayEl: [{
2097
+ type: ViewChild,
2098
+ args: ['overlay']
2099
+ }], trigger: [{
2100
+ type: ViewChild,
2101
+ args: ['trigger']
2102
+ }], options: [{
2103
+ type: ContentChildren,
2104
+ args: [MonkeyOptionComponent]
2105
+ }], tabIndex: [{
2106
+ type: Input
2107
+ }], onChange: [{
2108
+ type: Output
2109
+ }], placeholder: [{
2110
+ type: Input,
2111
+ args: [{ required: true }]
2112
+ }], loading: [{
2113
+ type: Input,
2114
+ args: [{ transform: booleanAttribute }]
2115
+ }], disabled: [{
2116
+ type: Input,
2117
+ args: [{ transform: booleanAttribute }]
2118
+ }], required: [{
2119
+ type: Input,
2120
+ args: [{ transform: booleanAttribute }]
2121
+ }], value: [{
2122
+ type: Input
2123
+ }] } });
2124
+
2125
+ /** ************************
7
2126
  * Copyright Monkey Exchange. All Rights Reserved
8
2127
  * This style guide was developed by Monkey Exchange Team
9
2128
  * MIT Licence
10
- **************************/
11
- class MonkeyButtonComponent {
2129
+ ************************* */
2130
+ class MonkeyPaginationSizeComponent {
2131
+ get id() {
2132
+ return this._id;
2133
+ }
2134
+ set id(value) {
2135
+ this._id = value || this._uid;
2136
+ }
12
2137
  constructor() {
13
- this.type = 'primary';
14
- this.size = 'md';
15
- this.disabled = false;
2138
+ this.onChange = new EventEmitter();
2139
+ this._uid = inject(IdGenerator).getId('monkey-pagination-size-');
2140
+ this.sizes = [10, 20, 50, 100];
2141
+ // eslint-disable-next-line no-self-assign
2142
+ this.id = this.id;
16
2143
  }
17
- onClick(event) {
18
- if (this.disabled) {
19
- event.stopPropagation();
20
- event.preventDefault();
21
- event.stopImmediatePropagation();
2144
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyPaginationSizeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2145
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyPaginationSizeComponent, isStandalone: true, selector: "monkey-pagination-size", inputs: { size: "size", disabled: "disabled", id: "id" }, outputs: { onChange: "onChange" }, host: { attributes: { "data-testid": "monkey-pagination-size" }, properties: { "attr.id": "id", "id": "id" } }, exportAs: ["monkeyPaginationSize"], ngImport: i0, template: "<ng-content></ng-content>\n<monkey-form-field hideClear>\n <monkey-select placeholder=\"''\" [ngModel]=\"size\" (onChange)=\"onChange.next($event)\">\n @for (item of sizes; track item) {\n <monkey-option [value]=\"item\">{{ item }}</monkey-option>\n }\n </monkey-select>\n</monkey-form-field>\n", styles: ["monkey-pagination-size{display:flex;align-items:center;gap:8px}monkey-pagination-size .mecx-form-field-body{height:32px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: MonkeySelectComponent, selector: "monkey-select", inputs: ["tabIndex", "placeholder", "loading", "disabled", "required", "value"], outputs: ["onChange"] }, { kind: "component", type: MonkeyOptionComponent, selector: "monkey-option", inputs: ["value", "disabled"] }, { kind: "ngmodule", type: MonkeyFormFieldModule }, { kind: "component", type: MonkeyFormFieldComponent, selector: "monkey-form-field", inputs: ["id", "hideClear"], exportAs: ["monkeyFormField"] }], encapsulation: i0.ViewEncapsulation.None }); }
2146
+ }
2147
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyPaginationSizeComponent, decorators: [{
2148
+ type: Component,
2149
+ args: [{ standalone: true, imports: [
2150
+ CommonModule,
2151
+ FormsModule,
2152
+ ReactiveFormsModule,
2153
+ MonkeySelectComponent,
2154
+ MonkeyOptionComponent,
2155
+ MonkeyFormFieldModule
2156
+ ], encapsulation: ViewEncapsulation.None, selector: 'monkey-pagination-size', exportAs: 'monkeyPaginationSize', host: {
2157
+ 'data-testid': 'monkey-pagination-size',
2158
+ '[attr.id]': 'id',
2159
+ '[id]': 'id'
2160
+ }, template: "<ng-content></ng-content>\n<monkey-form-field hideClear>\n <monkey-select placeholder=\"''\" [ngModel]=\"size\" (onChange)=\"onChange.next($event)\">\n @for (item of sizes; track item) {\n <monkey-option [value]=\"item\">{{ item }}</monkey-option>\n }\n </monkey-select>\n</monkey-form-field>\n", styles: ["monkey-pagination-size{display:flex;align-items:center;gap:8px}monkey-pagination-size .mecx-form-field-body{height:32px}\n"] }]
2161
+ }], ctorParameters: () => [], propDecorators: { size: [{
2162
+ type: Input,
2163
+ args: [{ required: true }]
2164
+ }], disabled: [{
2165
+ type: Input
2166
+ }], onChange: [{
2167
+ type: Output
2168
+ }], id: [{
2169
+ type: Input
2170
+ }] } });
2171
+
2172
+ /** ************************
2173
+ * Copyright Monkey Exchange. All Rights Reserved
2174
+ * This style guide was developed by Monkey Exchange Team
2175
+ * MIT Licence
2176
+ ************************* */
2177
+ const defaultX = '880px';
2178
+ class MonkeyTableComponent {
2179
+ constructor() {
2180
+ this.sortChange = new EventEmitter();
2181
+ this._loadingInitialized = false;
2182
+ this.stateChanges = new EventEmitter();
2183
+ }
2184
+ updateScrollStyle() {
2185
+ if (!this._headerEl || !this._tableHeaderEl || !this._tableContentEl || !this._tableScrollEl) {
2186
+ throw Error('monkey-table must have header and content');
2187
+ }
2188
+ const x = this.scroll?.x || defaultX;
2189
+ const y = this.scroll?.y;
2190
+ const styleHeader = this._headerEl.nativeElement.style;
2191
+ const styleTableHeader = this._tableHeaderEl.nativeElement.style;
2192
+ const styleTableContent = this._tableContentEl.nativeElement.style;
2193
+ const styleTableScroll = this._tableScrollEl.nativeElement.style;
2194
+ if (x) {
2195
+ styleTableHeader.minWidth = `${x}`;
2196
+ styleTableContent.minWidth = `${x}`;
2197
+ this._tableScrollEl.nativeElement.addEventListener('scroll', () => {
2198
+ this._headerEl.nativeElement.scrollLeft = this._tableScrollEl.nativeElement.scrollLeft;
2199
+ });
2200
+ }
2201
+ if (y) {
2202
+ styleTableScroll.maxHeight = `${y}`;
2203
+ styleTableScroll.overflowX = 'auto';
2204
+ styleTableScroll.overflowY = 'scroll';
2205
+ }
2206
+ if (x && !y) {
2207
+ styleTableScroll.overflowX = 'scroll';
2208
+ styleHeader.overflowY = 'hidden';
2209
+ }
2210
+ }
2211
+ initializeComponents() {
2212
+ const paginationAction = this._paginationActionChildren?.get(0);
2213
+ const paginationSize = this._paginationSizeChildren?.get(0);
2214
+ if (paginationAction) {
2215
+ paginationAction.disabled = this.loading;
2216
+ }
2217
+ if (paginationSize) {
2218
+ paginationSize.disabled = this.loading;
2219
+ }
2220
+ }
2221
+ initializeLoadingComponent() {
2222
+ if (this._loadingInitialized || !this._tableLoadingEl)
2223
+ return;
2224
+ const styleTableLoading = this._tableLoadingEl?.nativeElement.style;
2225
+ const x = this.scroll?.x || defaultX;
2226
+ if (x) {
2227
+ styleTableLoading.minWidth = `${x}`;
2228
+ }
2229
+ this._loadingInitialized = true;
2230
+ }
2231
+ ngAfterContentInit() {
2232
+ this.updateScrollStyle();
2233
+ this.initializeComponents();
2234
+ }
2235
+ updateSortableOptions(name, sortable) {
2236
+ this._sortOptions = {
2237
+ ...this._sortOptions,
2238
+ [name]: sortable
2239
+ };
2240
+ if (!sortable) {
2241
+ delete this._sortOptions[name];
2242
+ }
2243
+ this.sortChange.emit(this._sortOptions);
2244
+ }
2245
+ ngOnChanges(changes) {
2246
+ let hasChanges = false;
2247
+ let loading = false;
2248
+ // eslint-disable-next-line dot-notation
2249
+ const changesLoading = changes?.['loading'];
2250
+ if (changesLoading?.currentValue !== changesLoading.previousValue) {
2251
+ this.initializeComponents();
2252
+ this.initializeLoadingComponent();
2253
+ loading = changesLoading.currentValue || false;
2254
+ hasChanges = true;
2255
+ }
2256
+ if (hasChanges) {
2257
+ this.stateChanges.emit({ loading });
22
2258
  }
23
2259
  }
24
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: MonkeyButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
25
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: MonkeyButtonComponent, isStandalone: true, selector: "monkey-button-v2", inputs: { type: "type", size: "size", disabled: "disabled" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0, template: "<button class=\"mecx-button\" [ngClass]=\"type + ' ' + size\" [disabled]=\"disabled\">\n <div class=\"content\">\n <ng-content select=\"[first]\"></ng-content>\n <span><ng-content></ng-content></span>\n <ng-content select=\"[last]\"></ng-content>\n </div>\n</button>\n", styles: ["monkey-button-v2{display:inline-block;margin:0 2px}monkey-button-v2 .mecx-button{width:100%;display:flex;align-items:center;border-radius:8px;cursor:pointer;transition:background-color .15s ease-out,color .15s ease-out}monkey-button-v2 .mecx-button .content{display:flex;align-items:center;justify-content:center;gap:8px;padding:12px 24px;flex-shrink:0;letter-spacing:.48px;font-weight:400;transition:transform .2s cubic-bezier(0,.5,.2,1)}monkey-button-v2 .mecx-button .content span{width:100%}monkey-button-v2 .mecx-button .content .mk-i{display:flex}monkey-button-v2 .mecx-button:disabled{background:#f1f2f3!important;color:#bdc1c7!important;cursor:not-allowed!important}monkey-button-v2 .mecx-button:disabled.secondary{background:unset!important;border:1px solid #bdc1c7!important}monkey-button-v2 .mecx-button.primary{color:var(--mecx-color-theme-contrast-main);background:var(--mecx-color-theme-main)}monkey-button-v2 .mecx-button.primary:hover:not(:disabled){background:var(--mecx-color-theme-600)}monkey-button-v2 .mecx-button.secondary{border:2px solid #bdc1c7;background:unset}monkey-button-v2 .mecx-button.secondary:disabled{border-width:1px}monkey-button-v2 .mecx-button.secondary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-button-v2 .mecx-button.tertiary{background:unset}monkey-button-v2 .mecx-button.tertiary span{text-decoration:underline}monkey-button-v2 .mecx-button.tertiary:disabled{background:unset!important;border-width:1px}monkey-button-v2 .mecx-button.tertiary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-button-v2 .mecx-button.sm{height:32px}monkey-button-v2 .mecx-button.sm .mk-i{font-size:20px}monkey-button-v2 .mecx-button.md{height:40px}monkey-button-v2 .mecx-button.md .mk-i{font-size:22px}monkey-button-v2 .mecx-button.lg{height:48px;text-align:center;font-size:16px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.48px}monkey-button-v2 .mecx-button.lg .mk-i{font-size:24px}monkey-button-v2 .mecx-button.full-width{width:100%}monkey-button-v2 .mecx-button:focus{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}monkey-button-v2 .mecx-button:active:not(:disabled).primary{background:var(--mecx-color-theme-main);opacity:.8;outline:none}monkey-button-v2 .mecx-button:active:not(:disabled) .content{transform:scale(.8)}:host:has(.mecx-button:active) .mecx-button{outline:unset;outline-offset:unset}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], encapsulation: i0.ViewEncapsulation.None }); }
2260
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2261
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyTableComponent, selector: "monkey-table, table[monkey-table]", inputs: { scroll: "scroll", loading: "loading", loadingRef: "loadingRef" }, outputs: { sortChange: "sortChange" }, host: { properties: { "class.disabled": "this.loading" } }, queries: [{ propertyName: "_paginationActionChildren", predicate: MonkeyPaginationActionComponent, descendants: true }, { propertyName: "_paginationSizeChildren", predicate: MonkeyPaginationSizeComponent, descendants: true }], viewQueries: [{ propertyName: "_headerEl", first: true, predicate: ["header"], descendants: true, static: true }, { propertyName: "_tableHeaderEl", first: true, predicate: ["tableHeader"], descendants: true, static: true }, { propertyName: "_tableContentEl", first: true, predicate: ["tableContent"], descendants: true, static: true }, { propertyName: "_tableLoadingEl", first: true, predicate: ["tableLoading"], descendants: true, static: true }, { propertyName: "_tableScrollEl", first: true, predicate: ["tableScroll"], descendants: true, static: true }], exportAs: ["monkeyTable"], usesOnChanges: true, ngImport: i0, template: "<div class=\"mecx-table-container\">\n <div class=\"mecx-table-wrapper\">\n <div class=\"mecx-table-header\" #header>\n <table #tableHeader>\n <ng-content select=\"thead\"></ng-content>\n </table>\n </div>\n <div class=\"mecx-inner-scroll\" #tableScroll>\n <table #tableContent>\n <ng-content select=\"tbody\"></ng-content>\n </table>\n\n @if (loadingRef && loading) {\n <table #tableLoading>\n <ng-container *ngTemplateOutlet=\"loadingRef\"></ng-container>\n </table>\n }\n </div>\n </div>\n <div class=\"mecx-table-footer\">\n <ng-content select=\"monkey-pagination-size\"></ng-content>\n <div class=\"mecx-table-actions\">\n <ng-content select=\"monkey-pagination-label\"></ng-content>\n <ng-content select=\"monkey-pagination-action\"></ng-content>\n </div>\n </div>\n</div>\n", styles: ["monkey-table{position:relative;display:block;table-layout:fixed;border:2px solid var(--mecx-color-gray-400);border-radius:16px}.mecx-table-container{scrollbar-color:var(--mecx-color-gray-400) transparent}.mecx-table-wrapper{display:block}.mecx-table-header{overflow-x:hidden;overflow-y:scroll;white-space:nowrap;border-bottom:2px solid var(--mecx-color-gray-300);background:var(--mecx-color-gray-50);border-top-left-radius:16px;border-top-right-radius:16px}.mecx-table-header table{table-layout:fixed;width:100%;text-align:left;border-collapse:separate;height:48px}.mecx-table-header table thead{display:table-header-group;vertical-align:middle;unicode-bidi:isolate}.mecx-table-header table th{text-align:left;vertical-align:middle;padding:8px 12px;color:var(--mecx-color-gray-700);font-size:16px;font-weight:700;font-style:normal;white-space:nowrap;will-change:transform;backface-visibility:hidden;line-height:24px}.mecx-table-header table th svg{opacity:0;transform:opacity 2s ease-in-out}.mecx-table-header table th:hover svg{opacity:1}.mecx-table-header table .mecx-column-checked svg{opacity:1}.mecx-table-header .mecx-column-stick{position:sticky;background:var(--mecx-color-gray-50);z-index:3}.mecx-table-header .mecx-column-stick-left{border-right:1px solid var(--mecx-color-gray-200);left:0}.mecx-table-header .mecx-column-stick-right{border-left:1px solid var(--mecx-color-gray-200);right:0}.mecx-table-header .mecx-column-checked{position:sticky;left:0;border-right:1px solid var(--mecx-color-gray-200);background:var(--mecx-color-gray-50);z-index:3}.mecx-table-header .mecx-column-checked monkey-checkbox{vertical-align:middle}.mecx-inner-scroll{scroll-behavior:smooth}.mecx-inner-scroll table{table-layout:fixed;width:100%;text-align:left;border-collapse:separate;border-spacing:0px}.mecx-inner-scroll table td{text-align:left;border-bottom:2px solid var(--mecx-color-gray-100);padding:8px 12px;vertical-align:middle}.mecx-inner-scroll .mecx-column-stick{position:sticky;right:0;z-index:1;background:#fff}.mecx-inner-scroll .mecx-column-stick-left{border-right:1px solid var(--mecx-color-gray-200);left:0}.mecx-inner-scroll .mecx-column-stick-right{border-left:1px solid var(--mecx-color-gray-200);right:0}.mecx-inner-scroll .mecx-column-checked{position:sticky;left:0;z-index:1;border-right:1px solid var(--mecx-color-gray-200);background:#fff}.mecx-inner-scroll .mecx-column-checked monkey-checkbox{vertical-align:middle}.mecx-table-footer{border-top:1px solid var(--mecx-color-gray-200);padding:8px 12px;display:flex;align-items:center;justify-content:space-between}.mecx-table-footer .mecx-table-actions{display:flex;gap:8px;align-items:center}.mecx-column-sortable-disabled,.mecx-column-checked-disabled{pointer-events:none}.mecx-column-expansible{border-left:none!important;border-right:none!important}@keyframes rotate-right{0%{transform:rotate(0)}to{transform:rotate(90deg)}}@keyframes rotate-left{0%{transform:rotate(90deg)}to{transform:rotate(0)}}.mecx-column-expansible .rotate-animation-right{animation:rotate-right .3s ease-in-out}.mecx-column-expansible .rotate-animation-left{animation:rotate-left .3s ease-in-out}\n"], encapsulation: i0.ViewEncapsulation.None }); }
26
2262
  }
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: MonkeyButtonComponent, decorators: [{
2263
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyTableComponent, decorators: [{
28
2264
  type: Component,
29
- args: [{ selector: 'monkey-button-v2', standalone: true, imports: [CommonModule], encapsulation: ViewEncapsulation.None, template: "<button class=\"mecx-button\" [ngClass]=\"type + ' ' + size\" [disabled]=\"disabled\">\n <div class=\"content\">\n <ng-content select=\"[first]\"></ng-content>\n <span><ng-content></ng-content></span>\n <ng-content select=\"[last]\"></ng-content>\n </div>\n</button>\n", styles: ["monkey-button-v2{display:inline-block;margin:0 2px}monkey-button-v2 .mecx-button{width:100%;display:flex;align-items:center;border-radius:8px;cursor:pointer;transition:background-color .15s ease-out,color .15s ease-out}monkey-button-v2 .mecx-button .content{display:flex;align-items:center;justify-content:center;gap:8px;padding:12px 24px;flex-shrink:0;letter-spacing:.48px;font-weight:400;transition:transform .2s cubic-bezier(0,.5,.2,1)}monkey-button-v2 .mecx-button .content span{width:100%}monkey-button-v2 .mecx-button .content .mk-i{display:flex}monkey-button-v2 .mecx-button:disabled{background:#f1f2f3!important;color:#bdc1c7!important;cursor:not-allowed!important}monkey-button-v2 .mecx-button:disabled.secondary{background:unset!important;border:1px solid #bdc1c7!important}monkey-button-v2 .mecx-button.primary{color:var(--mecx-color-theme-contrast-main);background:var(--mecx-color-theme-main)}monkey-button-v2 .mecx-button.primary:hover:not(:disabled){background:var(--mecx-color-theme-600)}monkey-button-v2 .mecx-button.secondary{border:2px solid #bdc1c7;background:unset}monkey-button-v2 .mecx-button.secondary:disabled{border-width:1px}monkey-button-v2 .mecx-button.secondary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-button-v2 .mecx-button.tertiary{background:unset}monkey-button-v2 .mecx-button.tertiary span{text-decoration:underline}monkey-button-v2 .mecx-button.tertiary:disabled{background:unset!important;border-width:1px}monkey-button-v2 .mecx-button.tertiary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-button-v2 .mecx-button.sm{height:32px}monkey-button-v2 .mecx-button.sm .mk-i{font-size:20px}monkey-button-v2 .mecx-button.md{height:40px}monkey-button-v2 .mecx-button.md .mk-i{font-size:22px}monkey-button-v2 .mecx-button.lg{height:48px;text-align:center;font-size:16px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.48px}monkey-button-v2 .mecx-button.lg .mk-i{font-size:24px}monkey-button-v2 .mecx-button.full-width{width:100%}monkey-button-v2 .mecx-button:focus{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}monkey-button-v2 .mecx-button:active:not(:disabled).primary{background:var(--mecx-color-theme-main);opacity:.8;outline:none}monkey-button-v2 .mecx-button:active:not(:disabled) .content{transform:scale(.8)}:host:has(.mecx-button:active) .mecx-button{outline:unset;outline-offset:unset}\n"] }]
30
- }], propDecorators: { type: [{
2265
+ args: [{ encapsulation: ViewEncapsulation.None, selector: 'monkey-table, table[monkey-table]', exportAs: 'monkeyTable', template: "<div class=\"mecx-table-container\">\n <div class=\"mecx-table-wrapper\">\n <div class=\"mecx-table-header\" #header>\n <table #tableHeader>\n <ng-content select=\"thead\"></ng-content>\n </table>\n </div>\n <div class=\"mecx-inner-scroll\" #tableScroll>\n <table #tableContent>\n <ng-content select=\"tbody\"></ng-content>\n </table>\n\n @if (loadingRef && loading) {\n <table #tableLoading>\n <ng-container *ngTemplateOutlet=\"loadingRef\"></ng-container>\n </table>\n }\n </div>\n </div>\n <div class=\"mecx-table-footer\">\n <ng-content select=\"monkey-pagination-size\"></ng-content>\n <div class=\"mecx-table-actions\">\n <ng-content select=\"monkey-pagination-label\"></ng-content>\n <ng-content select=\"monkey-pagination-action\"></ng-content>\n </div>\n </div>\n</div>\n", styles: ["monkey-table{position:relative;display:block;table-layout:fixed;border:2px solid var(--mecx-color-gray-400);border-radius:16px}.mecx-table-container{scrollbar-color:var(--mecx-color-gray-400) transparent}.mecx-table-wrapper{display:block}.mecx-table-header{overflow-x:hidden;overflow-y:scroll;white-space:nowrap;border-bottom:2px solid var(--mecx-color-gray-300);background:var(--mecx-color-gray-50);border-top-left-radius:16px;border-top-right-radius:16px}.mecx-table-header table{table-layout:fixed;width:100%;text-align:left;border-collapse:separate;height:48px}.mecx-table-header table thead{display:table-header-group;vertical-align:middle;unicode-bidi:isolate}.mecx-table-header table th{text-align:left;vertical-align:middle;padding:8px 12px;color:var(--mecx-color-gray-700);font-size:16px;font-weight:700;font-style:normal;white-space:nowrap;will-change:transform;backface-visibility:hidden;line-height:24px}.mecx-table-header table th svg{opacity:0;transform:opacity 2s ease-in-out}.mecx-table-header table th:hover svg{opacity:1}.mecx-table-header table .mecx-column-checked svg{opacity:1}.mecx-table-header .mecx-column-stick{position:sticky;background:var(--mecx-color-gray-50);z-index:3}.mecx-table-header .mecx-column-stick-left{border-right:1px solid var(--mecx-color-gray-200);left:0}.mecx-table-header .mecx-column-stick-right{border-left:1px solid var(--mecx-color-gray-200);right:0}.mecx-table-header .mecx-column-checked{position:sticky;left:0;border-right:1px solid var(--mecx-color-gray-200);background:var(--mecx-color-gray-50);z-index:3}.mecx-table-header .mecx-column-checked monkey-checkbox{vertical-align:middle}.mecx-inner-scroll{scroll-behavior:smooth}.mecx-inner-scroll table{table-layout:fixed;width:100%;text-align:left;border-collapse:separate;border-spacing:0px}.mecx-inner-scroll table td{text-align:left;border-bottom:2px solid var(--mecx-color-gray-100);padding:8px 12px;vertical-align:middle}.mecx-inner-scroll .mecx-column-stick{position:sticky;right:0;z-index:1;background:#fff}.mecx-inner-scroll .mecx-column-stick-left{border-right:1px solid var(--mecx-color-gray-200);left:0}.mecx-inner-scroll .mecx-column-stick-right{border-left:1px solid var(--mecx-color-gray-200);right:0}.mecx-inner-scroll .mecx-column-checked{position:sticky;left:0;z-index:1;border-right:1px solid var(--mecx-color-gray-200);background:#fff}.mecx-inner-scroll .mecx-column-checked monkey-checkbox{vertical-align:middle}.mecx-table-footer{border-top:1px solid var(--mecx-color-gray-200);padding:8px 12px;display:flex;align-items:center;justify-content:space-between}.mecx-table-footer .mecx-table-actions{display:flex;gap:8px;align-items:center}.mecx-column-sortable-disabled,.mecx-column-checked-disabled{pointer-events:none}.mecx-column-expansible{border-left:none!important;border-right:none!important}@keyframes rotate-right{0%{transform:rotate(0)}to{transform:rotate(90deg)}}@keyframes rotate-left{0%{transform:rotate(90deg)}to{transform:rotate(0)}}.mecx-column-expansible .rotate-animation-right{animation:rotate-right .3s ease-in-out}.mecx-column-expansible .rotate-animation-left{animation:rotate-left .3s ease-in-out}\n"] }]
2266
+ }], propDecorators: { scroll: [{
31
2267
  type: Input
32
- }], size: [{
2268
+ }], loading: [{
2269
+ type: HostBinding,
2270
+ args: ['class.disabled']
2271
+ }, {
33
2272
  type: Input
34
- }], disabled: [{
2273
+ }], loadingRef: [{
35
2274
  type: Input
36
- }], onClick: [{
37
- type: HostListener,
38
- args: ['click', ['$event']]
2275
+ }], sortChange: [{
2276
+ type: Output
2277
+ }], _headerEl: [{
2278
+ type: ViewChild,
2279
+ args: ['header', { static: true }]
2280
+ }], _tableHeaderEl: [{
2281
+ type: ViewChild,
2282
+ args: ['tableHeader', { static: true }]
2283
+ }], _tableContentEl: [{
2284
+ type: ViewChild,
2285
+ args: ['tableContent', { static: true }]
2286
+ }], _tableLoadingEl: [{
2287
+ type: ViewChild,
2288
+ args: ['tableLoading', { static: true }]
2289
+ }], _tableScrollEl: [{
2290
+ type: ViewChild,
2291
+ args: ['tableScroll', { static: true }]
2292
+ }], _paginationActionChildren: [{
2293
+ type: ContentChildren,
2294
+ args: [MonkeyPaginationActionComponent, { descendants: true }]
2295
+ }], _paginationSizeChildren: [{
2296
+ type: ContentChildren,
2297
+ args: [MonkeyPaginationSizeComponent, { descendants: true }]
39
2298
  }] } });
40
2299
 
41
- /**************************
2300
+ /* eslint-disable dot-notation */
2301
+ /** ************************
42
2302
  * Copyright Monkey Exchange. All Rights Reserved
43
2303
  * This style guide was developed by Monkey Exchange Team
44
2304
  * MIT Licence
45
- **************************/
46
- class MonkeyIconComponent {
47
- constructor() {
48
- this.size = '';
49
- this._icon = '';
2305
+ ************************* */
2306
+ class MonkeyColumnChecked {
2307
+ constructor(el, renderer, viewContainerRef, table) {
2308
+ this.el = el;
2309
+ this.renderer = renderer;
2310
+ this.viewContainerRef = viewContainerRef;
2311
+ this.table = table;
2312
+ this.checkedChange = new EventEmitter();
2313
+ this._cdr = inject(ChangeDetectorRef);
2314
+ this._injector = inject(Injector);
2315
+ this._subscriptions = new Subscription();
2316
+ // not to do
50
2317
  }
51
- set icon(val) {
52
- this._icon = `mk-i mk-i-${val}`;
2318
+ renderCheckbox() {
2319
+ this.checkboxRef = this.viewContainerRef.createComponent(MonkeyCheckboxComponent, {
2320
+ injector: this._injector
2321
+ });
2322
+ this.checkboxRef.instance.value = this.checked;
2323
+ this.checkboxRef.instance.setDisabledState(this.disabled);
2324
+ this.checkboxRef.instance.onChange.subscribe((isChecked) => {
2325
+ this.checkboxRef.instance.writeValue(isChecked);
2326
+ this.checkedChange.emit(isChecked);
2327
+ });
2328
+ this.renderer.appendChild(this.el.nativeElement, this.checkboxRef.location.nativeElement);
2329
+ }
2330
+ handleDisableFromStateChanges(disabled) {
2331
+ if (disabled) {
2332
+ this.el.nativeElement.style.pointerEvents = 'none';
2333
+ }
2334
+ else {
2335
+ this.el.nativeElement.style.pointerEvents = 'all';
2336
+ }
53
2337
  }
54
2338
  ngOnInit() {
55
- if (!this._icon) {
56
- throw new Error('Icon property must be used');
2339
+ this.el.nativeElement.style.pointerEvents = 'none';
2340
+ this._subscriptions.add(this.table?.stateChanges?.subscribe(() => {
2341
+ this.handleDisableFromStateChanges(this.table.loading);
2342
+ }));
2343
+ }
2344
+ ngAfterViewInit() {
2345
+ this.renderCheckbox();
2346
+ }
2347
+ ngOnChanges(changes) {
2348
+ let hasChanges = false;
2349
+ let checked = false;
2350
+ let disabled = false;
2351
+ const changesChecked = changes?.['checked'];
2352
+ const changesDisabled = changes?.['disabled'];
2353
+ if (changesChecked?.currentValue !== changesChecked?.previousValue) {
2354
+ checked = changesChecked.currentValue || false;
2355
+ hasChanges = true;
2356
+ }
2357
+ if (changesDisabled?.currentValue !== changesDisabled?.previousValue) {
2358
+ disabled = changesDisabled.currentValue;
2359
+ hasChanges = true;
57
2360
  }
2361
+ if (hasChanges) {
2362
+ this.initializeComponent(checked, disabled);
2363
+ }
2364
+ }
2365
+ initializeComponent(checked, disabled) {
2366
+ if (!this.checkboxRef || this.disabled)
2367
+ return;
2368
+ this.checkboxRef.instance.writeValue(checked);
2369
+ this.checkboxRef.instance.setDisabledState(disabled);
2370
+ this._cdr.detectChanges();
58
2371
  }
59
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: MonkeyIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
60
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: MonkeyIconComponent, isStandalone: true, selector: "monkey-icon-v2", inputs: { icon: "icon", size: "size" }, host: { properties: { "class": "_icon+' '+size" } }, ngImport: i0, template: "", styles: ["monkey-icon-v2{display:inline-block}monkey-icon-v2.sm{font-size:20px;width:20px;height:20px}monkey-icon-v2.md{font-size:22px;width:22px;height:22px}monkey-icon-v2.lg{font-size:24px;width:24px;height:24px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], encapsulation: i0.ViewEncapsulation.None }); }
2372
+ ngOnDestroy() {
2373
+ this._subscriptions.unsubscribe();
2374
+ }
2375
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyColumnChecked, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ViewContainerRef }, { token: MonkeyTableComponent, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
2376
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyColumnChecked, selector: "[mkChecked]", inputs: { checked: ["mkChecked", "checked"], disabled: "disabled" }, outputs: { checkedChange: "checkedChange" }, host: { properties: { "class.mecx-column-checked-disabled": "this.disabled" }, classAttribute: "mecx-column-checked" }, usesOnChanges: true, ngImport: i0 }); }
61
2377
  }
62
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: MonkeyIconComponent, decorators: [{
63
- type: Component,
64
- args: [{ selector: 'monkey-icon-v2', standalone: true, imports: [CommonModule], encapsulation: ViewEncapsulation.None, host: {
65
- '[class]': `_icon+' '+size`
66
- }, template: "", styles: ["monkey-icon-v2{display:inline-block}monkey-icon-v2.sm{font-size:20px;width:20px;height:20px}monkey-icon-v2.md{font-size:22px;width:22px;height:22px}monkey-icon-v2.lg{font-size:24px;width:24px;height:24px}\n"] }]
67
- }], propDecorators: { icon: [{
68
- type: Input
69
- }], size: [{
2378
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyColumnChecked, decorators: [{
2379
+ type: Directive,
2380
+ args: [{
2381
+ selector: '[mkChecked]',
2382
+ host: {
2383
+ class: 'mecx-column-checked'
2384
+ }
2385
+ }]
2386
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: MonkeyTableComponent, decorators: [{
2387
+ type: Optional
2388
+ }, {
2389
+ type: Inject,
2390
+ args: [MonkeyTableComponent]
2391
+ }] }], propDecorators: { checked: [{
2392
+ type: Input,
2393
+ args: [{ alias: 'mkChecked', required: true }]
2394
+ }], disabled: [{
2395
+ type: HostBinding,
2396
+ args: ['class.mecx-column-checked-disabled']
2397
+ }, {
70
2398
  type: Input
2399
+ }], checkedChange: [{
2400
+ type: Output
71
2401
  }] } });
72
2402
 
73
- /**************************
2403
+ /** ************************
74
2404
  * Copyright Monkey Exchange. All Rights Reserved
75
2405
  * This style guide was developed by Monkey Exchange Team
76
2406
  * MIT Licence
77
- **************************/
78
- class MonkeyIconButtonComponent {
79
- constructor() {
80
- this.type = 'primary';
81
- this.size = 'md';
2407
+ ************************* */
2408
+ class MonkeyColumnExpansible {
2409
+ constructor(el, renderer, table) {
2410
+ this.el = el;
2411
+ this.renderer = renderer;
2412
+ this.table = table;
2413
+ this.expansionChange = new EventEmitter();
2414
+ this._opened = false;
2415
+ this._subscriptions = new Subscription();
2416
+ this._enableAnimation = false;
82
2417
  this.disabled = false;
83
- this.icon = '';
2418
+ // not to do
84
2419
  }
85
- onClick(event) {
86
- if (this.disabled) {
87
- event.stopPropagation();
88
- event.preventDefault();
89
- event.stopImmediatePropagation();
2420
+ createSvgElement(opened) {
2421
+ const oldIcon = this.el.nativeElement.querySelector('#expansible-icon');
2422
+ if (oldIcon)
2423
+ this.renderer.removeChild(this.el.nativeElement, oldIcon);
2424
+ this.el.nativeElement.style.cursor = 'pointer';
2425
+ const svg = this.renderer.createElement('svg', 'svg');
2426
+ this.renderer.setAttribute(svg, 'id', 'expansible-icon');
2427
+ this.renderer.setAttribute(svg, 'width', '24');
2428
+ this.renderer.setAttribute(svg, 'height', '24');
2429
+ this.renderer.setAttribute(svg, 'viewBox', '0 0 24 24');
2430
+ this.renderer.setAttribute(svg, 'fill', 'none');
2431
+ this.renderer.setAttribute(svg, 'xmlns', 'http://www.w3.org/2000/svg');
2432
+ this.renderer.setStyle(svg, 'vertical-align', 'middle');
2433
+ this.renderer.setStyle(svg, 'cursor', 'pointer');
2434
+ if (opened) {
2435
+ const path1 = this.renderer.createElement('path', 'svg');
2436
+ const path2 = this.renderer.createElement('path', 'svg');
2437
+ this.renderer.setAttribute(path1, 'stroke', 'var(--mecx-color-gray-600)');
2438
+ this.renderer.setAttribute(path1, 'stroke-width', '1.5');
2439
+ this.renderer.setAttribute(path1, 'stroke-linecap', 'round');
2440
+ this.renderer.setAttribute(path1, 'stroke-linejoin', 'round');
2441
+ this.renderer.setAttribute(path1, 'd', 'M16 12H8');
2442
+ this.renderer.setAttribute(path2, 'fill-rule', 'evenodd');
2443
+ this.renderer.setAttribute(path2, 'clip-rule', 'evenodd');
2444
+ this.renderer.setAttribute(path2, 'stroke', 'var(--mecx-color-gray-400)');
2445
+ this.renderer.setAttribute(path2, 'stroke-width', '1.5');
2446
+ this.renderer.setAttribute(path2, 'stroke-linecap', 'round');
2447
+ this.renderer.setAttribute(path2, 'stroke-linejoin', 'round');
2448
+ this.renderer.setAttribute(path2, 'd', 'M12 21V21C7.029 21 3 16.971 3 12V12C3 7.029 7.029 3 12 3V3C16.971 3 21 7.029 21 12V12C21 16.971 16.971 21 12 21Z');
2449
+ this.renderer.appendChild(svg, path1);
2450
+ this.renderer.appendChild(svg, path2);
2451
+ if (this._enableAnimation) {
2452
+ this.renderer.addClass(svg, 'rotate-animation-left');
2453
+ }
2454
+ }
2455
+ else {
2456
+ const path1 = this.renderer.createElement('path', 'svg');
2457
+ const path2 = this.renderer.createElement('path', 'svg');
2458
+ const path3 = this.renderer.createElement('path', 'svg');
2459
+ this.renderer.setAttribute(path1, 'stroke', 'var(--mecx-color-gray-600)');
2460
+ this.renderer.setAttribute(path1, 'stroke-width', '1.5');
2461
+ this.renderer.setAttribute(path1, 'stroke-linecap', 'round');
2462
+ this.renderer.setAttribute(path1, 'stroke-linejoin', 'round');
2463
+ this.renderer.setAttribute(path1, 'd', 'M12 8V16');
2464
+ this.renderer.setAttribute(path2, 'stroke', 'var(--mecx-color-gray-600)');
2465
+ this.renderer.setAttribute(path2, 'stroke-width', '1.5');
2466
+ this.renderer.setAttribute(path2, 'stroke-linecap', 'round');
2467
+ this.renderer.setAttribute(path2, 'stroke-linejoin', 'round');
2468
+ this.renderer.setAttribute(path2, 'd', 'M16 12H8');
2469
+ this.renderer.setAttribute(path3, 'fill-rule', 'evenodd');
2470
+ this.renderer.setAttribute(path3, 'clip-rule', 'evenodd');
2471
+ this.renderer.setAttribute(path3, 'stroke', 'var(--mecx-color-gray-400)');
2472
+ this.renderer.setAttribute(path3, 'stroke-width', '2');
2473
+ this.renderer.setAttribute(path3, 'stroke-linecap', 'round');
2474
+ this.renderer.setAttribute(path3, 'stroke-linejoin', 'round');
2475
+ this.renderer.setAttribute(path3, 'd', 'M12 21V21C7.029 21 3 16.971 3 12V12C3 7.029 7.029 3 12 3V3C16.971 3 21 7.029 21 12V12C21 16.971 16.971 21 12 21Z');
2476
+ this.renderer.appendChild(svg, path1);
2477
+ this.renderer.appendChild(svg, path2);
2478
+ this.renderer.appendChild(svg, path3);
2479
+ if (this._enableAnimation) {
2480
+ this.renderer.addClass(svg, 'rotate-animation-right');
2481
+ }
2482
+ }
2483
+ this.renderer.appendChild(this.el.nativeElement, svg);
2484
+ }
2485
+ ngOnInit() {
2486
+ this.disabled = this.table.loading;
2487
+ this._subscriptions.add(this.table?.stateChanges?.subscribe(() => {
2488
+ this.disabled = this.table.loading;
2489
+ }));
2490
+ this.createSvgElement(this._opened);
2491
+ }
2492
+ onClick() {
2493
+ this._enableAnimation = true;
2494
+ if (this._opened) {
2495
+ this._opened = false;
2496
+ }
2497
+ else {
2498
+ this._opened = true;
90
2499
  }
2500
+ this.createSvgElement(this._opened);
2501
+ this.expansionChange.emit(this._opened);
91
2502
  }
92
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: MonkeyIconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
93
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: MonkeyIconButtonComponent, isStandalone: true, selector: "monkey-icon-button-v2", inputs: { type: "type", size: "size", disabled: "disabled", icon: "icon" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0, template: "<button class=\"mecx-icon-button\" [ngClass]=\"type + ' ' + size\" [disabled]=\"disabled\">\n <div class=\"content\">\n <monkey-icon-v2 [icon]=\"icon\" [size]=\"size\" first></monkey-icon-v2>\n </div>\n</button>\n", styles: ["monkey-icon-button-v2{display:inline-block;margin:0 2px}monkey-icon-button-v2 .mecx-icon-button{width:100%;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;transition:background-color .15s ease-out,color .15s ease-out}monkey-icon-button-v2 .mecx-icon-button .content{display:flex;align-items:center;justify-content:center;padding:12px;transition:transform .2s cubic-bezier(0,.5,.2,1)}monkey-icon-button-v2 .mecx-icon-button .content span{width:100%}monkey-icon-button-v2 .mecx-icon-button .content .mk-i{display:flex}monkey-icon-button-v2 .mecx-icon-button:disabled{background:#f1f2f3!important;color:#bdc1c7!important;cursor:not-allowed!important}monkey-icon-button-v2 .mecx-icon-button:disabled.secondary{background:unset!important;border:1px solid #bdc1c7!important}monkey-icon-button-v2 .mecx-icon-button.primary{color:var(--mecx-color-theme-contrast-main);background:var(--mecx-color-theme-main)}monkey-icon-button-v2 .mecx-icon-button.primary:hover:not(:disabled){background:var(--mecx-color-theme-600)}monkey-icon-button-v2 .mecx-icon-button.secondary{border:2px solid #bdc1c7;background:unset}monkey-icon-button-v2 .mecx-icon-button.secondary:disabled{border-width:1px}monkey-icon-button-v2 .mecx-icon-button.secondary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-icon-button-v2 .mecx-icon-button.tertiary{background:unset}monkey-icon-button-v2 .mecx-icon-button.tertiary span{text-decoration:underline}monkey-icon-button-v2 .mecx-icon-button.tertiary:disabled{background:unset!important;border-width:1px}monkey-icon-button-v2 .mecx-icon-button.tertiary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-icon-button-v2 .mecx-icon-button.sm{width:32px;height:32px}monkey-icon-button-v2 .mecx-icon-button.sm .mk-i{font-size:20px}monkey-icon-button-v2 .mecx-icon-button.md{width:40px;height:40px}monkey-icon-button-v2 .mecx-icon-button.md .mk-i{font-size:22px}monkey-icon-button-v2 .mecx-icon-button.lg{width:48px;height:48px}monkey-icon-button-v2 .mecx-icon-button.lg .mk-i{font-size:24px}monkey-icon-button-v2 .mecx-icon-button.full-width{width:100%}monkey-icon-button-v2 .mecx-icon-button:focus{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}monkey-icon-button-v2 .mecx-icon-button:active:not(:disabled).primary{background:var(--mecx-color-theme-main);opacity:.8;outline:none}monkey-icon-button-v2 .mecx-icon-button:active:not(:disabled) .content{transform:scale(.8)}:host:has(.mecx-button:active) .mecx-button{outline:unset;outline-offset:unset}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MonkeyIconComponent, selector: "monkey-icon-v2", inputs: ["icon", "size"] }], encapsulation: i0.ViewEncapsulation.None }); }
2503
+ ngOnDestroy() {
2504
+ this._subscriptions.unsubscribe();
2505
+ }
2506
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyColumnExpansible, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: MonkeyTableComponent, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
2507
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyColumnExpansible, selector: "[mkExpansible]", outputs: { expansionChange: "expansionChange" }, host: { listeners: { "click": "onClick()" }, properties: { "class.mecx-column-expansible-disabled": "this.disabled" }, classAttribute: "mecx-column-expansible" }, ngImport: i0 }); }
94
2508
  }
95
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: MonkeyIconButtonComponent, decorators: [{
96
- type: Component,
97
- args: [{ selector: 'monkey-icon-button-v2', standalone: true, imports: [CommonModule, MonkeyIconComponent], encapsulation: ViewEncapsulation.None, template: "<button class=\"mecx-icon-button\" [ngClass]=\"type + ' ' + size\" [disabled]=\"disabled\">\n <div class=\"content\">\n <monkey-icon-v2 [icon]=\"icon\" [size]=\"size\" first></monkey-icon-v2>\n </div>\n</button>\n", styles: ["monkey-icon-button-v2{display:inline-block;margin:0 2px}monkey-icon-button-v2 .mecx-icon-button{width:100%;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;transition:background-color .15s ease-out,color .15s ease-out}monkey-icon-button-v2 .mecx-icon-button .content{display:flex;align-items:center;justify-content:center;padding:12px;transition:transform .2s cubic-bezier(0,.5,.2,1)}monkey-icon-button-v2 .mecx-icon-button .content span{width:100%}monkey-icon-button-v2 .mecx-icon-button .content .mk-i{display:flex}monkey-icon-button-v2 .mecx-icon-button:disabled{background:#f1f2f3!important;color:#bdc1c7!important;cursor:not-allowed!important}monkey-icon-button-v2 .mecx-icon-button:disabled.secondary{background:unset!important;border:1px solid #bdc1c7!important}monkey-icon-button-v2 .mecx-icon-button.primary{color:var(--mecx-color-theme-contrast-main);background:var(--mecx-color-theme-main)}monkey-icon-button-v2 .mecx-icon-button.primary:hover:not(:disabled){background:var(--mecx-color-theme-600)}monkey-icon-button-v2 .mecx-icon-button.secondary{border:2px solid #bdc1c7;background:unset}monkey-icon-button-v2 .mecx-icon-button.secondary:disabled{border-width:1px}monkey-icon-button-v2 .mecx-icon-button.secondary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-icon-button-v2 .mecx-icon-button.tertiary{background:unset}monkey-icon-button-v2 .mecx-icon-button.tertiary span{text-decoration:underline}monkey-icon-button-v2 .mecx-icon-button.tertiary:disabled{background:unset!important;border-width:1px}monkey-icon-button-v2 .mecx-icon-button.tertiary:hover:not(:disabled){color:var(--mecx-color-theme-main)}monkey-icon-button-v2 .mecx-icon-button.sm{width:32px;height:32px}monkey-icon-button-v2 .mecx-icon-button.sm .mk-i{font-size:20px}monkey-icon-button-v2 .mecx-icon-button.md{width:40px;height:40px}monkey-icon-button-v2 .mecx-icon-button.md .mk-i{font-size:22px}monkey-icon-button-v2 .mecx-icon-button.lg{width:48px;height:48px}monkey-icon-button-v2 .mecx-icon-button.lg .mk-i{font-size:24px}monkey-icon-button-v2 .mecx-icon-button.full-width{width:100%}monkey-icon-button-v2 .mecx-icon-button:focus{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}monkey-icon-button-v2 .mecx-icon-button:active:not(:disabled).primary{background:var(--mecx-color-theme-main);opacity:.8;outline:none}monkey-icon-button-v2 .mecx-icon-button:active:not(:disabled) .content{transform:scale(.8)}:host:has(.mecx-button:active) .mecx-button{outline:unset;outline-offset:unset}\n"] }]
98
- }], propDecorators: { type: [{
99
- type: Input
100
- }], size: [{
101
- type: Input
2509
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyColumnExpansible, decorators: [{
2510
+ type: Directive,
2511
+ args: [{
2512
+ selector: '[mkExpansible]',
2513
+ host: {
2514
+ class: 'mecx-column-expansible'
2515
+ }
2516
+ }]
2517
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: MonkeyTableComponent, decorators: [{
2518
+ type: Optional
2519
+ }, {
2520
+ type: Inject,
2521
+ args: [MonkeyTableComponent]
2522
+ }] }], propDecorators: { expansionChange: [{
2523
+ type: Output
102
2524
  }], disabled: [{
103
- type: Input
104
- }], icon: [{
105
- type: Input
2525
+ type: HostBinding,
2526
+ args: ['class.mecx-column-expansible-disabled']
106
2527
  }], onClick: [{
107
2528
  type: HostListener,
108
- args: ['click', ['$event']]
2529
+ args: ['click']
109
2530
  }] } });
110
2531
 
111
- /**************************
2532
+ /** ************************
112
2533
  * Copyright Monkey Exchange. All Rights Reserved
113
2534
  * This style guide was developed by Monkey Exchange Team
114
2535
  * MIT Licence
115
- **************************/
116
- class MonkeySecurityLevelComponent {
117
- constructor() {
118
- this.score = input.required();
119
- this.label = input();
120
- this.strengthLabel = input();
2536
+ ************************* */
2537
+ class MonkeyColumnSortable {
2538
+ constructor(el, renderer, table) {
2539
+ this.el = el;
2540
+ this.renderer = renderer;
2541
+ this.table = table;
2542
+ this._sortableDirection = null;
2543
+ this.subscriptions = new Subscription();
2544
+ this.disabled = false;
2545
+ // not to do
121
2546
  }
122
- get class() {
123
- if (this.score() === 0) {
124
- return 'empty';
125
- }
126
- if (this.score() < 300) {
127
- return 'weak';
2547
+ createSvgElement(direction) {
2548
+ const dPath = direction === 'desc' ? 'M16 14L12 10L8 14' : 'M8.75 10L12.75 14L16.75 10';
2549
+ const oldIcon = this.el.nativeElement.querySelector('#sortable-icon');
2550
+ if (oldIcon)
2551
+ this.renderer.removeChild(this.el.nativeElement, oldIcon);
2552
+ this.el.nativeElement.style.cursor = 'pointer';
2553
+ const svg = this.renderer.createElement('svg', 'svg');
2554
+ this.renderer.setAttribute(svg, 'id', 'sortable-icon');
2555
+ this.renderer.setAttribute(svg, 'width', '25');
2556
+ this.renderer.setAttribute(svg, 'height', '24');
2557
+ this.renderer.setAttribute(svg, 'viewBox', '0 0 25 24');
2558
+ this.renderer.setAttribute(svg, 'fill', 'none');
2559
+ this.renderer.setAttribute(svg, 'xmlns', 'http://www.w3.org/2000/svg');
2560
+ this.renderer.setStyle(svg, 'margin-left', '1px');
2561
+ this.renderer.setStyle(svg, 'vertical-align', 'middle');
2562
+ this.renderer.setStyle(svg, 'cursor', 'pointer');
2563
+ const g = this.renderer.createElement('g', 'svg');
2564
+ const path = this.renderer.createElement('path', 'svg');
2565
+ this.renderer.setAttribute(path, 'stroke', '#000');
2566
+ this.renderer.setAttribute(path, 'stroke-width', '1.5');
2567
+ this.renderer.setAttribute(path, 'stroke-linecap', 'round');
2568
+ this.renderer.setAttribute(path, 'stroke-linejoin', 'round');
2569
+ this.renderer.setAttribute(path, 'd', dPath);
2570
+ this.renderer.appendChild(g, path);
2571
+ this.renderer.appendChild(svg, g);
2572
+ this.renderer.appendChild(this.el.nativeElement, svg);
2573
+ }
2574
+ ngOnInit() {
2575
+ this.disabled = this.table.loading;
2576
+ this.subscriptions.add(this.table?.stateChanges?.subscribe(() => {
2577
+ this.disabled = this.table.loading;
2578
+ }));
2579
+ this.createSvgElement(this._sortableDirection);
2580
+ }
2581
+ onClick() {
2582
+ if (this._sortableDirection === null) {
2583
+ this._sortableDirection = 'asc';
128
2584
  }
129
- if (this.score() >= 300 && this.score() < 800) {
130
- return 'medium';
2585
+ else if (this._sortableDirection === 'asc') {
2586
+ this._sortableDirection = 'desc';
131
2587
  }
132
- if (this.score() >= 800 && this.score() < 1000) {
133
- return 'strong';
2588
+ else {
2589
+ this._sortableDirection = null;
134
2590
  }
135
- return 'very-strong';
2591
+ this.createSvgElement(this._sortableDirection);
2592
+ this.table?.updateSortableOptions(this.name, this._sortableDirection || '');
136
2593
  }
137
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: MonkeySecurityLevelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
138
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.1.2", type: MonkeySecurityLevelComponent, isStandalone: true, selector: "monkey-security-level", inputs: { score: { classPropertyName: "score", publicName: "score", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, strengthLabel: { classPropertyName: "strengthLabel", publicName: "strengthLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<div class=\"body\">\n <div>\n <span data-testid=\"label\" *ngIf=\"label() as lb\">\n {{ lb }}\n </span>\n <span data-testid=\"str-label\" class=\"level-info\" *ngIf=\"strengthLabel() as strLabel\">\n {{ strLabel }}\n </span>\n </div>\n <div class=\"bar\"></div>\n</div>\n", styles: [":host{display:flex;align-items:center;gap:8px;width:100%}:host span{color:#545a63;font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px}:host .level-info{color:#1f2024;margin-left:24px;font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px}:host .body{display:flex;flex-direction:column;align-items:baseline;width:100%}:host .bar{height:4px;width:100%;max-width:426px;border-radius:8px;background:#d3d6da;position:relative;overflow:hidden}:host .bar:before{content:\"\";display:block;position:absolute;height:100%;left:0;top:0;transition:all 1s}:host.very-strong .bar:before{background:#00875a;width:100%}:host.strong .bar:before{background:#00875a;width:80%}:host.medium .bar:before{background:#efa30e;width:66%}:host.weak .bar:before{background:#db0505;width:33%}:host.empty .bar:before{background:#db0505;width:0%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
2594
+ ngOnDestroy() {
2595
+ this.subscriptions.unsubscribe();
2596
+ }
2597
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyColumnSortable, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: MonkeyTableComponent, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
2598
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyColumnSortable, selector: "[mkSortable]", inputs: { name: ["mkSortable", "name"] }, host: { listeners: { "click": "onClick()" }, properties: { "class.mecx-column-sortable-disabled": "this.disabled" }, classAttribute: "mecx-column-sortable" }, ngImport: i0 }); }
139
2599
  }
140
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: MonkeySecurityLevelComponent, decorators: [{
141
- type: Component,
142
- args: [{ selector: 'monkey-security-level', standalone: true, imports: [CommonModule], template: "<div class=\"body\">\n <div>\n <span data-testid=\"label\" *ngIf=\"label() as lb\">\n {{ lb }}\n </span>\n <span data-testid=\"str-label\" class=\"level-info\" *ngIf=\"strengthLabel() as strLabel\">\n {{ strLabel }}\n </span>\n </div>\n <div class=\"bar\"></div>\n</div>\n", styles: [":host{display:flex;align-items:center;gap:8px;width:100%}:host span{color:#545a63;font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px}:host .level-info{color:#1f2024;margin-left:24px;font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px}:host .body{display:flex;flex-direction:column;align-items:baseline;width:100%}:host .bar{height:4px;width:100%;max-width:426px;border-radius:8px;background:#d3d6da;position:relative;overflow:hidden}:host .bar:before{content:\"\";display:block;position:absolute;height:100%;left:0;top:0;transition:all 1s}:host.very-strong .bar:before{background:#00875a;width:100%}:host.strong .bar:before{background:#00875a;width:80%}:host.medium .bar:before{background:#efa30e;width:66%}:host.weak .bar:before{background:#db0505;width:33%}:host.empty .bar:before{background:#db0505;width:0%}\n"] }]
143
- }], propDecorators: { class: [{
2600
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyColumnSortable, decorators: [{
2601
+ type: Directive,
2602
+ args: [{
2603
+ selector: '[mkSortable]',
2604
+ host: {
2605
+ class: 'mecx-column-sortable'
2606
+ }
2607
+ }]
2608
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: MonkeyTableComponent, decorators: [{
2609
+ type: Optional
2610
+ }, {
2611
+ type: Inject,
2612
+ args: [MonkeyTableComponent]
2613
+ }] }], propDecorators: { name: [{
2614
+ type: Input,
2615
+ args: [{ alias: 'mkSortable', required: true }]
2616
+ }], disabled: [{
144
2617
  type: HostBinding,
145
- args: ['class']
2618
+ args: ['class.mecx-column-sortable-disabled']
2619
+ }], onClick: [{
2620
+ type: HostListener,
2621
+ args: ['click']
146
2622
  }] } });
147
2623
 
148
- /**************************
2624
+ /** ************************
149
2625
  * Copyright Monkey Exchange. All Rights Reserved
150
2626
  * This style guide was developed by Monkey Exchange Team
151
2627
  * MIT Licence
152
- **************************/
153
- class MonkeyStatusComponent {
2628
+ ************************* */
2629
+ class MonkeyColumnStick {
154
2630
  constructor() {
155
- this.type = input.required();
156
- this.size = input('md');
157
- this.label = input();
2631
+ this.position = 'right';
2632
+ }
2633
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyColumnStick, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2634
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyColumnStick, selector: "[mkStick]", inputs: { position: ["mkStick", "position"] }, host: { properties: { "class": "\"mecx-column-stick-\"+position" }, classAttribute: "mecx-column-stick" }, ngImport: i0 }); }
2635
+ }
2636
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyColumnStick, decorators: [{
2637
+ type: Directive,
2638
+ args: [{
2639
+ selector: '[mkStick]',
2640
+ host: {
2641
+ class: 'mecx-column-stick',
2642
+ '[class]': '"mecx-column-stick-"+position'
2643
+ }
2644
+ }]
2645
+ }], propDecorators: { position: [{
2646
+ type: Input,
2647
+ args: [{ alias: 'mkStick', required: true }]
2648
+ }] } });
2649
+
2650
+ /** ************************
2651
+ * Copyright Monkey Exchange. All Rights Reserved
2652
+ * This style guide was developed by Monkey Exchange Team
2653
+ * MIT Licence
2654
+ ************************* */
2655
+ class MonkeyTableModule {
2656
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2657
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: MonkeyTableModule, declarations: [MonkeyTableComponent,
2658
+ MonkeyColumnStick,
2659
+ MonkeyColumnChecked,
2660
+ MonkeyColumnSortable,
2661
+ MonkeyColumnExpansible], imports: [MonkeyButtonComponent,
2662
+ MonkeyPaginationSizeComponent,
2663
+ MonkeyPaginationLabelComponent,
2664
+ MonkeyPaginationActionComponent], exports: [MonkeyTableComponent,
2665
+ MonkeyColumnStick,
2666
+ MonkeyColumnChecked,
2667
+ MonkeyColumnSortable,
2668
+ MonkeyColumnExpansible] }); }
2669
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyTableModule, imports: [MonkeyButtonComponent,
2670
+ MonkeyPaginationSizeComponent,
2671
+ MonkeyPaginationActionComponent] }); }
2672
+ }
2673
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyTableModule, decorators: [{
2674
+ type: NgModule,
2675
+ args: [{
2676
+ imports: [
2677
+ MonkeyButtonComponent,
2678
+ MonkeyPaginationSizeComponent,
2679
+ MonkeyPaginationLabelComponent,
2680
+ MonkeyPaginationActionComponent
2681
+ ],
2682
+ declarations: [
2683
+ MonkeyTableComponent,
2684
+ MonkeyColumnStick,
2685
+ MonkeyColumnChecked,
2686
+ MonkeyColumnSortable,
2687
+ MonkeyColumnExpansible
2688
+ ],
2689
+ exports: [
2690
+ MonkeyTableComponent,
2691
+ MonkeyColumnStick,
2692
+ MonkeyColumnChecked,
2693
+ MonkeyColumnSortable,
2694
+ MonkeyColumnExpansible
2695
+ ]
2696
+ }]
2697
+ }] });
2698
+
2699
+ class MonkeyToastComponent {
2700
+ get id() {
2701
+ return this._id;
2702
+ }
2703
+ set id(value) {
2704
+ this._id = value || this._uid;
158
2705
  }
159
2706
  get class() {
160
- return `${this.type()} ${this.size()}`;
2707
+ return this.type;
2708
+ }
2709
+ constructor(host) {
2710
+ this.host = host;
2711
+ this.icon = 'close-circle';
2712
+ this.type = 'default';
2713
+ this.isClosable = false;
2714
+ this.onActionClick = new EventEmitter();
2715
+ this.onClose = new EventEmitter();
2716
+ this._uid = inject(IdGenerator).getId('monkey-toast-');
2717
+ this.animationState = 'hidden';
2718
+ // eslint-disable-next-line no-self-assign
2719
+ this.id = this.id;
2720
+ }
2721
+ close() {
2722
+ this.host.nativeElement.classList.add('closed');
2723
+ }
2724
+ onAnimationEnd(event) {
2725
+ if (event.animationName.includes('fade-out')) {
2726
+ this.onClose.emit(this.id);
2727
+ }
161
2728
  }
162
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: MonkeyStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
163
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.1.2", type: MonkeyStatusComponent, isStandalone: true, selector: "monkey-status", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<div class=\"status\"></div>\n<span *ngIf=\"label() as lb\">\n {{ lb }}\n</span>\n", styles: [":host{display:flex;align-items:center;gap:8px}:host span{color:#545a63;font-style:normal;font-weight:400;line-height:24px}:host .status{width:8px;height:8px;border-radius:50%;flex-shrink:0}:host.sm span{font-size:14px;letter-spacing:.42px}:host.sm .status{height:8px;width:8px}:host.md span{font-size:16px;letter-spacing:.48px}:host.md .status{height:12px;width:12px}:host.lg span{font-size:18px;letter-spacing:.52px}:host.lg .status{height:16px;width:16px}:host.default .status{background-color:#d3d6da}:host.success .status{background-color:#00875a}:host.warning .status{background-color:#efa30e}:host.error .status{background-color:#db0505}:host.question .status{background-color:#8d38fa}:host.info .status{background-color:#003687}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
2729
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyToastComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
2730
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyToastComponent, isStandalone: true, selector: "monkey-toast", inputs: { message: "message", icon: "icon", type: "type", isClosable: ["isClosable", "isClosable", booleanAttribute], actionLabel: "actionLabel", actionIcon: "actionIcon", id: "id" }, outputs: { onActionClick: "onActionClick", onClose: "onClose" }, host: { attributes: { "data-testid": "monkey-toast" }, listeners: { "animationend": "onAnimationEnd($event)" }, properties: { "attr.id": "id", "id": "id", "class": "this.class", "animation": "this.animationState" } }, ngImport: i0, template: "<div class=\"content\">\n @if (icon) {\n <monkey-icon [icon]=\"icon\" size=\"lg\"></monkey-icon>\n }\n <div class=\"message\">\n {{ message }}\n </div>\n</div>\n@if (actionLabel) {\n <div class=\"action\">\n <monkey-button class=\"btn-action\" type=\"tertiary\" size=\"sm\" (click)=\"onActionClick.emit(id)\">\n {{ actionLabel }}\n @if (actionIcon) {\n <monkey-icon [icon]=\"actionIcon\" first></monkey-icon>\n }\n </monkey-button>\n </div>\n}\n@if (isClosable) {\n <div class=\"divider\"></div>\n <div class=\"close\">\n <monkey-icon-button class=\"btn-close\" type=\"tertiary\" size=\"sm\" icon=\"close\" (click)=\"close()\">\n </monkey-icon-button>\n </div>\n}\n", styles: ["monkey-toast{display:flex;align-items:start;min-width:200px;width:100%;gap:16px;padding:16px;box-shadow:0 8px 16px #00000029;background-color:#111418;color:#fff;border-radius:8px;max-width:450px;box-sizing:border-box;animation:fade-in .3s}monkey-toast.closed{animation:fade-out .1s}monkey-toast .content{display:flex;gap:8px;line-height:24px;font-size:14px;letter-spacing:.48px;flex-grow:1}monkey-toast .action .btn-action{margin:0!important}monkey-toast .action .btn-action .mecx-button{height:24px;color:#fff!important;outline-color:#fff}monkey-toast .action .btn-action .mecx-button .content{padding:12px 8px}monkey-toast .action .btn-action .mecx-button:hover{color:#fff!important}monkey-toast .divider{width:1px;height:24px;background-color:#bdc1c7}monkey-toast .close{display:flex}monkey-toast .close .btn-close{margin:0!important}monkey-toast .close .btn-close .mecx-icon-button{height:24px;width:24px;color:#fff!important;outline-color:#fff}monkey-toast .close .btn-close .mecx-icon-button:hover{color:#fff!important}monkey-toast.success{background-color:var(--mecx-color-success-main)}monkey-toast.error{background-color:#db0505}monkey-toast.question{background-color:var(--mecx-color-question-800)}monkey-toast.info{background-color:#003687}@keyframes fade-in{0%{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}@keyframes fade-out{to{transform:scale(.9);opacity:0}}\n"], dependencies: [{ kind: "component", type: MonkeyButtonComponent, selector: "monkey-button", inputs: ["disabled", "size", "type", "id"] }, { kind: "component", type: MonkeyIconComponent, selector: "monkey-icon", inputs: ["icon", "size", "id"] }, { kind: "component", type: MonkeyIconButtonComponent, selector: "monkey-icon-button", inputs: ["type", "size", "disabled", "icon", "id"] }], encapsulation: i0.ViewEncapsulation.None }); }
164
2731
  }
165
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: MonkeyStatusComponent, decorators: [{
2732
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyToastComponent, decorators: [{
166
2733
  type: Component,
167
- args: [{ selector: 'monkey-status', standalone: true, imports: [CommonModule], template: "<div class=\"status\"></div>\n<span *ngIf=\"label() as lb\">\n {{ lb }}\n</span>\n", styles: [":host{display:flex;align-items:center;gap:8px}:host span{color:#545a63;font-style:normal;font-weight:400;line-height:24px}:host .status{width:8px;height:8px;border-radius:50%;flex-shrink:0}:host.sm span{font-size:14px;letter-spacing:.42px}:host.sm .status{height:8px;width:8px}:host.md span{font-size:16px;letter-spacing:.48px}:host.md .status{height:12px;width:12px}:host.lg span{font-size:18px;letter-spacing:.52px}:host.lg .status{height:16px;width:16px}:host.default .status{background-color:#d3d6da}:host.success .status{background-color:#00875a}:host.warning .status{background-color:#efa30e}:host.error .status{background-color:#db0505}:host.question .status{background-color:#8d38fa}:host.info .status{background-color:#003687}\n"] }]
168
- }], propDecorators: { class: [{
2734
+ args: [{ standalone: true, selector: 'monkey-toast', imports: [MonkeyButtonComponent, MonkeyIconComponent, MonkeyIconButtonComponent], encapsulation: ViewEncapsulation.None, host: {
2735
+ 'data-testid': 'monkey-toast',
2736
+ '(animationend)': 'onAnimationEnd($event)',
2737
+ '[attr.id]': 'id',
2738
+ '[id]': 'id'
2739
+ }, template: "<div class=\"content\">\n @if (icon) {\n <monkey-icon [icon]=\"icon\" size=\"lg\"></monkey-icon>\n }\n <div class=\"message\">\n {{ message }}\n </div>\n</div>\n@if (actionLabel) {\n <div class=\"action\">\n <monkey-button class=\"btn-action\" type=\"tertiary\" size=\"sm\" (click)=\"onActionClick.emit(id)\">\n {{ actionLabel }}\n @if (actionIcon) {\n <monkey-icon [icon]=\"actionIcon\" first></monkey-icon>\n }\n </monkey-button>\n </div>\n}\n@if (isClosable) {\n <div class=\"divider\"></div>\n <div class=\"close\">\n <monkey-icon-button class=\"btn-close\" type=\"tertiary\" size=\"sm\" icon=\"close\" (click)=\"close()\">\n </monkey-icon-button>\n </div>\n}\n", styles: ["monkey-toast{display:flex;align-items:start;min-width:200px;width:100%;gap:16px;padding:16px;box-shadow:0 8px 16px #00000029;background-color:#111418;color:#fff;border-radius:8px;max-width:450px;box-sizing:border-box;animation:fade-in .3s}monkey-toast.closed{animation:fade-out .1s}monkey-toast .content{display:flex;gap:8px;line-height:24px;font-size:14px;letter-spacing:.48px;flex-grow:1}monkey-toast .action .btn-action{margin:0!important}monkey-toast .action .btn-action .mecx-button{height:24px;color:#fff!important;outline-color:#fff}monkey-toast .action .btn-action .mecx-button .content{padding:12px 8px}monkey-toast .action .btn-action .mecx-button:hover{color:#fff!important}monkey-toast .divider{width:1px;height:24px;background-color:#bdc1c7}monkey-toast .close{display:flex}monkey-toast .close .btn-close{margin:0!important}monkey-toast .close .btn-close .mecx-icon-button{height:24px;width:24px;color:#fff!important;outline-color:#fff}monkey-toast .close .btn-close .mecx-icon-button:hover{color:#fff!important}monkey-toast.success{background-color:var(--mecx-color-success-main)}monkey-toast.error{background-color:#db0505}monkey-toast.question{background-color:var(--mecx-color-question-800)}monkey-toast.info{background-color:#003687}@keyframes fade-in{0%{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}@keyframes fade-out{to{transform:scale(.9);opacity:0}}\n"] }]
2740
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { message: [{
2741
+ type: Input
2742
+ }], icon: [{
2743
+ type: Input
2744
+ }], type: [{
2745
+ type: Input
2746
+ }], isClosable: [{
2747
+ type: Input,
2748
+ args: [{ transform: booleanAttribute }]
2749
+ }], actionLabel: [{
2750
+ type: Input
2751
+ }], actionIcon: [{
2752
+ type: Input
2753
+ }], onActionClick: [{
2754
+ type: Output
2755
+ }], onClose: [{
2756
+ type: Output
2757
+ }], id: [{
2758
+ type: Input
2759
+ }], class: [{
169
2760
  type: HostBinding,
170
2761
  args: ['class']
2762
+ }], animationState: [{
2763
+ type: HostBinding,
2764
+ args: ['animation']
171
2765
  }] } });
172
2766
 
173
2767
  class MonkeyToggleComponent {
174
- constructor() {
175
- this.disabled = false;
176
- this.size = 'md';
177
- this.onChange = new EventEmitter();
178
- this._checked = false;
179
- }
180
2768
  set value(_) {
181
2769
  if (typeof _ === 'string') {
182
2770
  this._checked = _ === 'true';
@@ -185,6 +2773,21 @@ class MonkeyToggleComponent {
185
2773
  this._checked = _;
186
2774
  }
187
2775
  }
2776
+ get id() {
2777
+ return this._id;
2778
+ }
2779
+ set id(value) {
2780
+ this._id = value || this._uid;
2781
+ }
2782
+ constructor() {
2783
+ this.disabled = false;
2784
+ this.size = 'md';
2785
+ this.onChange = new EventEmitter();
2786
+ this._checked = false;
2787
+ this._uid = inject(IdGenerator).getId('monkey-toggle-');
2788
+ // eslint-disable-next-line no-self-assign
2789
+ this.id = this.id;
2790
+ }
188
2791
  onClick(event) {
189
2792
  event.preventDefault();
190
2793
  event.stopPropagation();
@@ -194,15 +2797,17 @@ class MonkeyToggleComponent {
194
2797
  this._checked = !this._checked;
195
2798
  }
196
2799
  }
197
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: MonkeyToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
198
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: MonkeyToggleComponent, isStandalone: true, selector: "monkey-toggle-v2", inputs: { disabled: "disabled", size: "size", value: "value" }, outputs: { onChange: "onChange" }, host: { attributes: { "data-testid": "input-toggle" }, listeners: { "click": "onClick($event)" }, properties: { "class.disabled": "this.disabled", "class": "this.size" } }, ngImport: i0, template: "<input type=\"checkbox\" [checked]=\"_checked\" />\n<div class=\"slider\" [ngClass]=\"{ checked: _checked }\"></div>\n", styles: [":host{position:relative;display:inline-block}:host input{display:none}:host.disabled{box-shadow:none;pointer-events:none;opacity:.2}:host.lg{width:88px;height:48px}:host.lg input:checked+.checked:before{left:calc(100% - 42px)}:host.lg .slider{position:absolute;cursor:pointer;inset:0;border-radius:34px;transition:all .4s ease;background-color:#f8fafb;border:2px solid #bdc1c7}:host.lg .slider:before{position:absolute;content:\"\";bottom:2px;transition:.4s;border-radius:50%;background-color:#1f2024;left:2px;height:40px;width:40px}:host.lg .slider.checked{background-color:#ebfff8;border:2px solid #00875a}:host.lg .slider.checked:before{background-color:#00875a}:host.md{width:72px;height:40px}:host.md input:checked+.checked:before{left:calc(100% - 34px)}:host.md .slider{position:absolute;cursor:pointer;inset:0;border-radius:34px;transition:all .4s ease;background-color:#f8fafb;border:2px solid #bdc1c7}:host.md .slider:before{position:absolute;content:\"\";bottom:2px;transition:.4s;border-radius:50%;background-color:#1f2024;left:2px;height:32px;width:32px}:host.md .slider.checked{background-color:#ebfff8;border:2px solid #00875a}:host.md .slider.checked:before{background-color:#00875a}:host.sm{width:56px;height:32px}:host.sm input:checked+.checked:before{left:calc(100% - 26px)}:host.sm .slider{position:absolute;cursor:pointer;inset:0;border-radius:34px;transition:all .4s ease;background-color:#f8fafb;border:2px solid #bdc1c7}:host.sm .slider:before{position:absolute;content:\"\";bottom:2px;transition:.4s;border-radius:50%;background-color:#1f2024;left:2px;height:24px;width:24px}:host.sm .slider.checked{background-color:#ebfff8;border:2px solid #00875a}:host.sm .slider.checked:before{background-color:#00875a}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
2800
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2801
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyToggleComponent, isStandalone: true, selector: "monkey-toggle", inputs: { disabled: "disabled", size: "size", value: "value", id: "id" }, outputs: { onChange: "onChange" }, host: { attributes: { "data-testid": "monkey-toggle" }, listeners: { "click": "onClick($event)" }, properties: { "attr.id": "id", "id": "id", "class.disabled": "this.disabled", "class": "this.size" } }, ngImport: i0, template: "<input type=\"checkbox\" [checked]=\"_checked\" />\n<div class=\"slider\" [ngClass]=\"{ checked: _checked }\"></div>\n", styles: [":host{position:relative;display:inline-block}:host input{display:none}:host.disabled{box-shadow:none;pointer-events:none;opacity:.2}:host.lg{width:88px;height:48px}:host.lg input:checked+.checked:before{left:calc(100% - 42px)}:host.lg .slider{position:absolute;cursor:pointer;inset:0;border-radius:34px;transition:all .4s ease;background-color:#f8fafb;border:2px solid #bdc1c7}:host.lg .slider:before{position:absolute;content:\"\";bottom:2px;transition:.4s;border-radius:50%;background-color:#1f2024;left:2px;height:40px;width:40px}:host.lg .slider.checked{background-color:#ebfff8;border:2px solid #00875a}:host.lg .slider.checked:before{background-color:#00875a}:host.md{width:72px;height:40px}:host.md input:checked+.checked:before{left:calc(100% - 34px)}:host.md .slider{position:absolute;cursor:pointer;inset:0;border-radius:34px;transition:all .4s ease;background-color:#f8fafb;border:2px solid #bdc1c7}:host.md .slider:before{position:absolute;content:\"\";bottom:2px;transition:.4s;border-radius:50%;background-color:#1f2024;left:2px;height:32px;width:32px}:host.md .slider.checked{background-color:#ebfff8;border:2px solid #00875a}:host.md .slider.checked:before{background-color:#00875a}:host.sm{width:56px;height:32px}:host.sm input:checked+.checked:before{left:calc(100% - 26px)}:host.sm .slider{position:absolute;cursor:pointer;inset:0;border-radius:34px;transition:all .4s ease;background-color:#f8fafb;border:2px solid #bdc1c7}:host.sm .slider:before{position:absolute;content:\"\";bottom:2px;transition:.4s;border-radius:50%;background-color:#1f2024;left:2px;height:24px;width:24px}:host.sm .slider.checked{background-color:#ebfff8;border:2px solid #00875a}:host.sm .slider.checked:before{background-color:#00875a}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
199
2802
  }
200
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: MonkeyToggleComponent, decorators: [{
2803
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyToggleComponent, decorators: [{
201
2804
  type: Component,
202
- args: [{ selector: 'monkey-toggle-v2', standalone: true, imports: [CommonModule], host: {
203
- 'data-testid': 'input-toggle'
2805
+ args: [{ selector: 'monkey-toggle', standalone: true, imports: [CommonModule], host: {
2806
+ 'data-testid': 'monkey-toggle',
2807
+ '[attr.id]': 'id',
2808
+ '[id]': 'id'
204
2809
  }, template: "<input type=\"checkbox\" [checked]=\"_checked\" />\n<div class=\"slider\" [ngClass]=\"{ checked: _checked }\"></div>\n", styles: [":host{position:relative;display:inline-block}:host input{display:none}:host.disabled{box-shadow:none;pointer-events:none;opacity:.2}:host.lg{width:88px;height:48px}:host.lg input:checked+.checked:before{left:calc(100% - 42px)}:host.lg .slider{position:absolute;cursor:pointer;inset:0;border-radius:34px;transition:all .4s ease;background-color:#f8fafb;border:2px solid #bdc1c7}:host.lg .slider:before{position:absolute;content:\"\";bottom:2px;transition:.4s;border-radius:50%;background-color:#1f2024;left:2px;height:40px;width:40px}:host.lg .slider.checked{background-color:#ebfff8;border:2px solid #00875a}:host.lg .slider.checked:before{background-color:#00875a}:host.md{width:72px;height:40px}:host.md input:checked+.checked:before{left:calc(100% - 34px)}:host.md .slider{position:absolute;cursor:pointer;inset:0;border-radius:34px;transition:all .4s ease;background-color:#f8fafb;border:2px solid #bdc1c7}:host.md .slider:before{position:absolute;content:\"\";bottom:2px;transition:.4s;border-radius:50%;background-color:#1f2024;left:2px;height:32px;width:32px}:host.md .slider.checked{background-color:#ebfff8;border:2px solid #00875a}:host.md .slider.checked:before{background-color:#00875a}:host.sm{width:56px;height:32px}:host.sm input:checked+.checked:before{left:calc(100% - 26px)}:host.sm .slider{position:absolute;cursor:pointer;inset:0;border-radius:34px;transition:all .4s ease;background-color:#f8fafb;border:2px solid #bdc1c7}:host.sm .slider:before{position:absolute;content:\"\";bottom:2px;transition:.4s;border-radius:50%;background-color:#1f2024;left:2px;height:24px;width:24px}:host.sm .slider.checked{background-color:#ebfff8;border:2px solid #00875a}:host.sm .slider.checked:before{background-color:#00875a}\n"] }]
205
- }], propDecorators: { disabled: [{
2810
+ }], ctorParameters: () => [], propDecorators: { disabled: [{
206
2811
  type: HostBinding,
207
2812
  args: ['class.disabled']
208
2813
  }, {
@@ -216,20 +2821,343 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImpor
216
2821
  type: Output
217
2822
  }], value: [{
218
2823
  type: Input
2824
+ }], id: [{
2825
+ type: Input
219
2826
  }], onClick: [{
220
2827
  type: HostListener,
221
2828
  args: ['click', ['$event']]
222
2829
  }] } });
223
2830
 
224
- /**************************
2831
+ /** ************************
2832
+ * Copyright Monkey Exchange. All Rights Reserved
2833
+ * This style guide was developed by Monkey Exchange Team
2834
+ * MIT Licence
2835
+ ************************* */
2836
+ class MonkeyToggleLineButtonComponent {
2837
+ constructor() {
2838
+ this.disabled = false;
2839
+ this.onChange = new EventEmitter();
2840
+ }
2841
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyToggleLineButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2842
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyToggleLineButtonComponent, isStandalone: true, selector: "monkey-toggle-line-button", inputs: { disabled: "disabled" }, outputs: { onChange: "onChange" }, ngImport: i0, template: "<input\n type=\"radio\"\n [name]=\"name\"\n [id]=\"value + '-' + name\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n (change)=\"onChange.emit(this.value)\"\n/>\n<label [for]=\"value + '-' + name\">\n <ng-content></ng-content>\n</label>\n", styles: ["monkey-toggle-line-button{display:flex;width:100%}monkey-toggle-line-button input{display:none}monkey-toggle-line-button label{display:flex;box-sizing:border-box;gap:8px;background:unset;height:100%;width:100%;align-items:center;justify-content:center;letter-spacing:.03em;text-align:center;color:#1f2024;cursor:pointer;padding:4px 8px;border:2px solid #bdc1c7;transition:all .2s ease-in-out}monkey-toggle-line-button label monkey-icon{transition:all .2s ease-in-out}monkey-toggle-line-button input:disabled+label{color:#bdc1c7!important;cursor:not-allowed!important}monkey-toggle-line-button input:disabled+label monkey-icon{color:#bdc1c7!important}monkey-toggle-line-button input:checked+label[for*=true]{background-color:#00875a;color:#fff}monkey-toggle-line-button input:checked+label[for*=true] monkey-icon{color:#fff}monkey-toggle-line-button input:checked+label[for*=false]{background-color:#db0505;color:#fff}monkey-toggle-line-button input:checked+label[for*=false] monkey-icon{color:#fff}\n"], encapsulation: i0.ViewEncapsulation.None }); }
2843
+ }
2844
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyToggleLineButtonComponent, decorators: [{
2845
+ type: Component,
2846
+ args: [{ selector: 'monkey-toggle-line-button', standalone: true, encapsulation: ViewEncapsulation.None, template: "<input\n type=\"radio\"\n [name]=\"name\"\n [id]=\"value + '-' + name\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n (change)=\"onChange.emit(this.value)\"\n/>\n<label [for]=\"value + '-' + name\">\n <ng-content></ng-content>\n</label>\n", styles: ["monkey-toggle-line-button{display:flex;width:100%}monkey-toggle-line-button input{display:none}monkey-toggle-line-button label{display:flex;box-sizing:border-box;gap:8px;background:unset;height:100%;width:100%;align-items:center;justify-content:center;letter-spacing:.03em;text-align:center;color:#1f2024;cursor:pointer;padding:4px 8px;border:2px solid #bdc1c7;transition:all .2s ease-in-out}monkey-toggle-line-button label monkey-icon{transition:all .2s ease-in-out}monkey-toggle-line-button input:disabled+label{color:#bdc1c7!important;cursor:not-allowed!important}monkey-toggle-line-button input:disabled+label monkey-icon{color:#bdc1c7!important}monkey-toggle-line-button input:checked+label[for*=true]{background-color:#00875a;color:#fff}monkey-toggle-line-button input:checked+label[for*=true] monkey-icon{color:#fff}monkey-toggle-line-button input:checked+label[for*=false]{background-color:#db0505;color:#fff}monkey-toggle-line-button input:checked+label[for*=false] monkey-icon{color:#fff}\n"] }]
2847
+ }], propDecorators: { disabled: [{
2848
+ type: Input
2849
+ }], onChange: [{
2850
+ type: Output
2851
+ }] } });
2852
+
2853
+ /** ************************
2854
+ * Copyright Monkey Exchange. All Rights Reserved
2855
+ * This style guide was developed by Monkey Exchange Team
2856
+ * MIT Licence
2857
+ ************************* */
2858
+ class MonkeyToggleLineComponent {
2859
+ get class() {
2860
+ return this.size;
2861
+ }
2862
+ get id() {
2863
+ return this._id;
2864
+ }
2865
+ set id(value) {
2866
+ this._id = value || this._uid;
2867
+ }
2868
+ constructor() {
2869
+ this.name = Math.random().toString();
2870
+ this.size = 'md';
2871
+ this.disabled = false;
2872
+ this.onChange = new EventEmitter();
2873
+ this.subscriptions = new Subscription();
2874
+ this._uid = inject(IdGenerator).getId('monkey-toggle-line-');
2875
+ // eslint-disable-next-line no-self-assign
2876
+ this.id = this.id;
2877
+ }
2878
+ ngAfterContentInit() {
2879
+ this.radioButtons.forEach((_, i) => {
2880
+ _.value = !!i;
2881
+ _.checked = this.value === _.value;
2882
+ _.name = this.name;
2883
+ _.disabled = this.disabled;
2884
+ const subscription = _.onChange.subscribe((value) => {
2885
+ this.onChange.emit(value);
2886
+ });
2887
+ this.subscriptions.add(subscription);
2888
+ });
2889
+ }
2890
+ ngOnChanges() {
2891
+ if (!this.radioButtons)
2892
+ return;
2893
+ this.radioButtons.forEach((_, i) => {
2894
+ _.checked = this.value === _.value;
2895
+ _.disabled = this.disabled;
2896
+ });
2897
+ }
2898
+ ngOnDestroy() {
2899
+ this.subscriptions.unsubscribe();
2900
+ }
2901
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyToggleLineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2902
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.13", type: MonkeyToggleLineComponent, isStandalone: true, selector: "monkey-toggle-line", inputs: { value: "value", name: "name", size: "size", disabled: ["disabled", "disabled", booleanAttribute], id: "id" }, outputs: { onChange: "onChange" }, host: { attributes: { "data-testid": "monkey-toggle-line" }, properties: { "attr.id": "id", "id": "id", "class": "this.class" } }, queries: [{ propertyName: "radioButtons", predicate: MonkeyToggleLineButtonComponent }], usesOnChanges: true, ngImport: i0, template: "<ng-content></ng-content>\n", styles: ["monkey-toggle-line{display:inline-flex;min-width:250px}monkey-toggle-line :first-child label{border-radius:8px 0 0 8px;border-right:none!important}monkey-toggle-line :first-child label monkey-icon{color:#db0505}monkey-toggle-line :last-child label{border-radius:0 8px 8px 0}monkey-toggle-line :last-child label monkey-icon{color:#00875a}monkey-toggle-line.lg{min-height:48px}monkey-toggle-line.lg label{font-size:16px}monkey-toggle-line.md{min-height:40px}monkey-toggle-line.md label{font-size:14px}monkey-toggle-line.sm{min-height:32px}monkey-toggle-line.sm label{font-size:14px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], encapsulation: i0.ViewEncapsulation.None }); }
2903
+ }
2904
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyToggleLineComponent, decorators: [{
2905
+ type: Component,
2906
+ args: [{ selector: 'monkey-toggle-line', standalone: true, imports: [CommonModule], encapsulation: ViewEncapsulation.None, host: {
2907
+ 'data-testid': 'monkey-toggle-line',
2908
+ '[attr.id]': 'id',
2909
+ '[id]': 'id'
2910
+ }, template: "<ng-content></ng-content>\n", styles: ["monkey-toggle-line{display:inline-flex;min-width:250px}monkey-toggle-line :first-child label{border-radius:8px 0 0 8px;border-right:none!important}monkey-toggle-line :first-child label monkey-icon{color:#db0505}monkey-toggle-line :last-child label{border-radius:0 8px 8px 0}monkey-toggle-line :last-child label monkey-icon{color:#00875a}monkey-toggle-line.lg{min-height:48px}monkey-toggle-line.lg label{font-size:16px}monkey-toggle-line.md{min-height:40px}monkey-toggle-line.md label{font-size:14px}monkey-toggle-line.sm{min-height:32px}monkey-toggle-line.sm label{font-size:14px}\n"] }]
2911
+ }], ctorParameters: () => [], propDecorators: { value: [{
2912
+ type: Input
2913
+ }], name: [{
2914
+ type: Input
2915
+ }], size: [{
2916
+ type: Input
2917
+ }], disabled: [{
2918
+ type: Input,
2919
+ args: [{ transform: booleanAttribute }]
2920
+ }], onChange: [{
2921
+ type: Output
2922
+ }], radioButtons: [{
2923
+ type: ContentChildren,
2924
+ args: [MonkeyToggleLineButtonComponent]
2925
+ }], class: [{
2926
+ type: HostBinding,
2927
+ args: ['class']
2928
+ }], id: [{
2929
+ type: Input
2930
+ }] } });
2931
+
2932
+ class MonkeyTooltipComponent {
2933
+ get id() {
2934
+ return this._id;
2935
+ }
2936
+ set id(value) {
2937
+ this._id = value || this._uid;
2938
+ }
2939
+ constructor(host) {
2940
+ this.host = host;
2941
+ this.afterClose = new EventEmitter();
2942
+ this._uid = inject(IdGenerator).getId('monkey-tooltip-');
2943
+ // eslint-disable-next-line no-self-assign
2944
+ this.id = this.id;
2945
+ }
2946
+ close() {
2947
+ this.host.nativeElement.classList.add('closed');
2948
+ }
2949
+ onAnimationEnd(event) {
2950
+ if (event.animationName.includes('fade-out')) {
2951
+ this.afterClose.emit(true);
2952
+ }
2953
+ }
2954
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyTooltipComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
2955
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyTooltipComponent, isStandalone: true, selector: "monkey-tooltip", inputs: { text: "text", template: "template", left: "left", top: "top", id: "id" }, outputs: { afterClose: "afterClose" }, host: { attributes: { "data-testid": "monkey-tooltip" }, listeners: { "animationend": "onAnimationEnd($event)" }, properties: { "style.left.px": "left", "style.top.px": "top", "attr.id": "id", "id": "id" } }, ngImport: i0, template: "@if(template) {\n<ng-container *ngTemplateOutlet=\"template\"> </ng-container>\n} @if(text) {\n{{ text }}\n}\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center;border-radius:8px;box-shadow:0 8px 16px #00000029;background-color:#1f2024;padding:8px 12px;flex-wrap:wrap;text-align:center;color:#fff;font-size:14px;letter-spacing:.42px;line-height:16px;position:absolute;pointer-events:none;cursor:none;word-break:normal;overflow-wrap:anywhere;min-width:50px;max-width:200px;box-sizing:border-box;overflow:hidden;animation:fade-in .3s}:host.closed{animation:fade-out .1s}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{to{opacity:0}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
2956
+ }
2957
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyTooltipComponent, decorators: [{
2958
+ type: Component,
2959
+ args: [{ selector: 'monkey-tooltip', standalone: true, imports: [NgTemplateOutlet], host: {
2960
+ 'data-testid': 'monkey-tooltip',
2961
+ '[style.left.px]': 'left',
2962
+ '[style.top.px]': 'top',
2963
+ '(animationend)': 'onAnimationEnd($event)',
2964
+ '[attr.id]': 'id',
2965
+ '[id]': 'id'
2966
+ }, template: "@if(template) {\n<ng-container *ngTemplateOutlet=\"template\"> </ng-container>\n} @if(text) {\n{{ text }}\n}\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center;border-radius:8px;box-shadow:0 8px 16px #00000029;background-color:#1f2024;padding:8px 12px;flex-wrap:wrap;text-align:center;color:#fff;font-size:14px;letter-spacing:.42px;line-height:16px;position:absolute;pointer-events:none;cursor:none;word-break:normal;overflow-wrap:anywhere;min-width:50px;max-width:200px;box-sizing:border-box;overflow:hidden;animation:fade-in .3s}:host.closed{animation:fade-out .1s}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{to{opacity:0}}\n"] }]
2967
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { text: [{
2968
+ type: Input
2969
+ }], template: [{
2970
+ type: Input
2971
+ }], left: [{
2972
+ type: Input
2973
+ }], top: [{
2974
+ type: Input
2975
+ }], afterClose: [{
2976
+ type: Output
2977
+ }], id: [{
2978
+ type: Input
2979
+ }] } });
2980
+
2981
+ class MonkeyTooltipDirective {
2982
+ constructor(viewContainerRef, elementRef, appRef, document) {
2983
+ this.viewContainerRef = viewContainerRef;
2984
+ this.elementRef = elementRef;
2985
+ this.appRef = appRef;
2986
+ this.document = document;
2987
+ this.enabled = true;
2988
+ this.offset = 8;
2989
+ // to do not
2990
+ }
2991
+ setBounds() {
2992
+ this.tooltipComponent.hostView.detectChanges();
2993
+ this.bounds = {
2994
+ elBounds: this.elementRef.nativeElement.getBoundingClientRect(),
2995
+ tooltipBounds: this.tooltipComponent?.location.nativeElement.getBoundingClientRect(),
2996
+ scroll: document.documentElement.scrollTop || document.body.scrollTop || 0,
2997
+ viewport: {
2998
+ width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
2999
+ height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
3000
+ }
3001
+ };
3002
+ }
3003
+ createTooltip() {
3004
+ this.tooltipComponent = this.viewContainerRef.createComponent(MonkeyTooltipComponent);
3005
+ this.document.body.appendChild(this.tooltipComponent.location.nativeElement);
3006
+ if (this.tooltipText instanceof TemplateRef) {
3007
+ this.tooltipComponent.instance.template = this.tooltipText;
3008
+ }
3009
+ else {
3010
+ this.tooltipComponent.instance.text = this.tooltipText;
3011
+ }
3012
+ this.setBounds();
3013
+ this.positionTooltip(this.tooltipPosition);
3014
+ }
3015
+ positionTooltip(position) {
3016
+ switch (position) {
3017
+ case 'left':
3018
+ this.positionLeft();
3019
+ if (this.isOutOfBounds()) {
3020
+ this.positionRight();
3021
+ if (this.isOutOfBounds()) {
3022
+ this.positionBottom();
3023
+ if (this.isOutOfBounds()) {
3024
+ this.positionTop();
3025
+ }
3026
+ }
3027
+ }
3028
+ break;
3029
+ case 'right':
3030
+ this.positionRight();
3031
+ if (this.isOutOfBounds()) {
3032
+ this.positionLeft();
3033
+ if (this.isOutOfBounds()) {
3034
+ this.positionBottom();
3035
+ if (this.isOutOfBounds()) {
3036
+ this.positionTop();
3037
+ }
3038
+ }
3039
+ }
3040
+ break;
3041
+ case 'top':
3042
+ this.positionTop();
3043
+ if (this.isOutOfBounds()) {
3044
+ this.positionBottom();
3045
+ if (this.isOutOfBounds()) {
3046
+ this.positionRight();
3047
+ if (this.isOutOfBounds()) {
3048
+ this.positionLeft();
3049
+ }
3050
+ }
3051
+ }
3052
+ break;
3053
+ case 'bottom':
3054
+ this.positionBottom();
3055
+ if (this.isOutOfBounds()) {
3056
+ this.positionTop();
3057
+ if (this.isOutOfBounds()) {
3058
+ this.positionRight();
3059
+ if (this.isOutOfBounds()) {
3060
+ this.positionLeft();
3061
+ }
3062
+ }
3063
+ }
3064
+ break;
3065
+ default:
3066
+ }
3067
+ }
3068
+ isOutOfBounds() {
3069
+ const { tooltipBounds, viewport } = this.bounds;
3070
+ return (tooltipBounds.left < 0 ||
3071
+ tooltipBounds.top < 0 ||
3072
+ tooltipBounds.left + tooltipBounds.width > viewport.width ||
3073
+ tooltipBounds.top + tooltipBounds.height > viewport.height);
3074
+ }
3075
+ positionLeft() {
3076
+ const { elBounds, tooltipBounds, scroll } = this.bounds;
3077
+ this.tooltipComponent.instance.left = elBounds.left - tooltipBounds.width - this.offset;
3078
+ this.tooltipComponent.instance.top = scroll + (elBounds.top + elBounds.height / 2);
3079
+ this.tooltipComponent.location.nativeElement.style.transform = 'translateY(-50%)';
3080
+ this.setBounds();
3081
+ }
3082
+ positionRight() {
3083
+ const { elBounds, scroll } = this.bounds;
3084
+ this.tooltipComponent.instance.left = elBounds.right + this.offset;
3085
+ this.tooltipComponent.instance.top = scroll + (elBounds.top + elBounds.height / 2);
3086
+ this.tooltipComponent.location.nativeElement.style.transform = 'translateY(-50%)';
3087
+ this.setBounds();
3088
+ }
3089
+ positionTop() {
3090
+ const { elBounds, tooltipBounds, scroll } = this.bounds;
3091
+ this.tooltipComponent.instance.left = elBounds.left + elBounds.width / 2;
3092
+ this.tooltipComponent.instance.top =
3093
+ scroll + elBounds.top - tooltipBounds.height - this.offset;
3094
+ this.tooltipComponent.location.nativeElement.style.transform = 'translateX(-50%)';
3095
+ this.setBounds();
3096
+ }
3097
+ positionBottom() {
3098
+ const { elBounds, scroll } = this.bounds;
3099
+ this.tooltipComponent.instance.left = elBounds.left + elBounds.width / 2;
3100
+ this.tooltipComponent.instance.top = scroll + elBounds.bottom + this.offset;
3101
+ this.tooltipComponent.location.nativeElement.style.transform = 'translateX(-50%)';
3102
+ this.setBounds();
3103
+ }
3104
+ show() {
3105
+ if (!this.enabled || this.tooltipComponent) {
3106
+ return;
3107
+ }
3108
+ this.createTooltip();
3109
+ }
3110
+ hide() {
3111
+ if (!this.tooltipComponent) {
3112
+ return;
3113
+ }
3114
+ this.tooltipComponent.instance.close();
3115
+ const subscribe = this.tooltipComponent.instance.afterClose.subscribe(() => {
3116
+ if (!this.tooltipComponent) {
3117
+ return;
3118
+ }
3119
+ this.appRef.detachView(this.tooltipComponent.hostView);
3120
+ this.tooltipComponent.destroy();
3121
+ this.tooltipComponent = undefined;
3122
+ subscribe.unsubscribe();
3123
+ });
3124
+ }
3125
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyTooltipDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.ApplicationRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive }); }
3126
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.13", type: MonkeyTooltipDirective, isStandalone: true, selector: "[monkeyTooltip]", inputs: { tooltipText: ["monkeyTooltip", "tooltipText"], tooltipPosition: "tooltipPosition", enabled: ["enabled", "enabled", booleanAttribute] }, host: { listeners: { "mouseenter": "show()", "mouseleave": "hide()", "click": "hide()" } }, ngImport: i0 }); }
3127
+ }
3128
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyTooltipDirective, decorators: [{
3129
+ type: Directive,
3130
+ args: [{
3131
+ selector: '[monkeyTooltip]',
3132
+ standalone: true,
3133
+ host: {
3134
+ '(mouseenter)': 'show()',
3135
+ '(mouseleave)': 'hide()',
3136
+ '(click)': 'hide()'
3137
+ }
3138
+ }]
3139
+ }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.ApplicationRef }, { type: Document, decorators: [{
3140
+ type: Inject,
3141
+ args: [DOCUMENT]
3142
+ }] }], propDecorators: { tooltipText: [{
3143
+ type: Input,
3144
+ args: ['monkeyTooltip']
3145
+ }], tooltipPosition: [{
3146
+ type: Input
3147
+ }], enabled: [{
3148
+ type: Input,
3149
+ args: [{ transform: booleanAttribute }]
3150
+ }] } });
3151
+
3152
+ /** ************************
225
3153
  * Copyright Monkey Exchange. All Rights Reserved
226
3154
  * This style guide was developed by Monkey Exchange Team
227
3155
  * MIT Licence
228
- **************************/
3156
+ ************************* */
229
3157
 
230
3158
  /**
231
3159
  * Generated bundle index. Do not edit.
232
3160
  */
233
3161
 
234
- export { MonkeyButtonComponent, MonkeyIconButtonComponent, MonkeyIconComponent, MonkeySecurityLevelComponent, MonkeyStatusComponent, MonkeyToggleComponent };
3162
+ export { MonkeyAccordionComponent, MonkeyAlertComponent, MonkeyBreadcrumbComponent, MonkeyButtonComponent, MonkeyCheckboxComponent, MonkeyColumnChecked, MonkeyColumnExpansible, MonkeyColumnSortable, MonkeyColumnStick, MonkeyDestroyService, MonkeyDirectivesModule, MonkeyDividerComponent, MonkeyError, MonkeyFormFieldComponent, MonkeyFormFieldControl, MonkeyFormFieldModule, MonkeyHelper, MonkeyIconButtonComponent, MonkeyIconComponent, MonkeyIconsService, MonkeyInfo, MonkeyInputCurrencyDirective, MonkeyInputDirective, MonkeyInputModule, MonkeyLabel, MonkeyOptionComponent, MonkeyPaginationActionComponent, MonkeyPaginationLabelComponent, MonkeyPaginationSizeComponent, MonkeyPrefix, MonkeySecurityLevelComponent, MonkeySelectComponent, MonkeyStatusComponent, MonkeySuffix, MonkeyTableComponent, MonkeyTableModule, MonkeyToastComponent, MonkeyToastService, MonkeyToggleComponent, MonkeyToggleLineButtonComponent, MonkeyToggleLineComponent, MonkeyTooltipComponent, MonkeyTooltipDirective, ToastRef, getCurrencySymbol, validateType };
235
3163
  //# sourceMappingURL=monkey-style-guide-v2.mjs.map