monkey-style-guide-v2 0.0.22 → 0.0.25

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 (36) hide show
  1. package/esm2022/lib/components/form-field/form-field.component.mjs +2 -2
  2. package/esm2022/lib/components/index.mjs +7 -1
  3. package/esm2022/lib/components/input-phone/index.mjs +7 -0
  4. package/esm2022/lib/components/input-phone/input-phone.component.mjs +324 -0
  5. package/esm2022/lib/components/modal/components/confirmation.component.mjs +6 -1
  6. package/esm2022/lib/components/modal/modal.component.mjs +2 -2
  7. package/esm2022/lib/directives/index.mjs +6 -1
  8. package/esm2022/lib/directives/popover.mjs +8 -3
  9. package/esm2022/lib/interfaces/alert.mjs +1 -1
  10. package/esm2022/lib/interfaces/breadcrumb.mjs +1 -1
  11. package/esm2022/lib/interfaces/button.mjs +1 -1
  12. package/esm2022/lib/interfaces/index.mjs +6 -1
  13. package/esm2022/lib/interfaces/popover.mjs +1 -1
  14. package/esm2022/lib/interfaces/sizes.mjs +1 -1
  15. package/esm2022/lib/interfaces/table.mjs +1 -1
  16. package/esm2022/lib/interfaces/toast.mjs +1 -1
  17. package/esm2022/lib/services/dictionary.service.mjs +3 -3
  18. package/esm2022/lib/tokens/index.mjs +9 -3
  19. package/fesm2022/monkey-style-guide-v2.mjs +1602 -1249
  20. package/fesm2022/monkey-style-guide-v2.mjs.map +1 -1
  21. package/lib/components/index.d.ts +6 -0
  22. package/lib/components/input-phone/index.d.ts +6 -0
  23. package/lib/components/input-phone/input-phone.component.d.ts +68 -0
  24. package/lib/directives/index.d.ts +5 -0
  25. package/lib/interfaces/alert.d.ts +5 -0
  26. package/lib/interfaces/breadcrumb.d.ts +5 -0
  27. package/lib/interfaces/button.d.ts +5 -0
  28. package/lib/interfaces/index.d.ts +5 -0
  29. package/lib/interfaces/popover.d.ts +5 -0
  30. package/lib/interfaces/sizes.d.ts +5 -0
  31. package/lib/interfaces/table.d.ts +5 -0
  32. package/lib/interfaces/toast.d.ts +5 -0
  33. package/lib/tokens/index.d.ts +8 -2
  34. package/monkey-style-guide-v2-0.0.25.tgz +0 -0
  35. package/package.json +3 -2
  36. package/monkey-style-guide-v2-0.0.22.tgz +0 -0
@@ -14,6 +14,8 @@ import { filter, BehaviorSubject, map, merge, Subject, debounceTime, Subscriptio
14
14
  import { format, parseISO, subYears, addYears, subMonths, addMonths, getMonth, getYear, startOfWeek, startOfMonth, endOfWeek, endOfMonth, isSameMonth, isBefore, isAfter, isToday, addDays, isWithinInterval, subDays } from 'date-fns';
15
15
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
16
16
  import { getSupportedInputTypes } from '@angular/cdk/platform';
17
+ import parsePhoneNumberFromString, { getCountries, getCountryCallingCode, getExampleNumber, AsYouType, isValidPhoneNumber } from 'libphonenumber-js';
18
+ import examples from 'libphonenumber-js/examples.mobile.json';
17
19
  import { hasModifierKey } from '@angular/cdk/keycodes';
18
20
 
19
21
  const counters = {};
@@ -983,9 +985,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
983
985
  }]
984
986
  }] });
985
987
 
986
- const MONKEY_I18N_WRAPPER = new InjectionToken('');
987
- const MONKEY_POPOVER_OPTIONS = new InjectionToken('MONKEY_POPOVER_OPTIONS');
988
+ /** ************************
989
+ * Copyright Monkey Exchange. All Rights Reserved
990
+ * This style guide was developed by Monkey Exchange Team
991
+ * MIT Licence
992
+ ************************* */
993
+ const MECX_I18N_WRAPPER = new InjectionToken('');
994
+ const MECX_POPOVER_OPTIONS = new InjectionToken('MECX_POPOVER_OPTIONS');
995
+ const MECX_COUNTRY_CODE = new InjectionToken('+55');
988
996
 
997
+ /** ************************
998
+ * Copyright Monkey Exchange. All Rights Reserved
999
+ * This style guide was developed by Monkey Exchange Team
1000
+ * MIT Licence
1001
+ ************************* */
989
1002
  class MonkeyPopoverContentComponent {
990
1003
  constructor(host) {
991
1004
  this.host = host;
@@ -1310,7 +1323,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1310
1323
  type: Optional
1311
1324
  }, {
1312
1325
  type: Inject,
1313
- args: [MONKEY_POPOVER_OPTIONS]
1326
+ args: [MECX_POPOVER_OPTIONS]
1314
1327
  }], popover: [{
1315
1328
  type: Input,
1316
1329
  args: ['monkeyPopover']
@@ -1463,6 +1476,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1463
1476
  }]
1464
1477
  }] });
1465
1478
 
1479
+ /** ************************
1480
+ * Copyright Monkey Exchange. All Rights Reserved
1481
+ * This style guide was developed by Monkey Exchange Team
1482
+ * MIT Licence
1483
+ ************************* */
1484
+
1466
1485
  /** ************************
1467
1486
  * Copyright Monkey Exchange. All Rights Reserved
1468
1487
  * This style guide was developed by Monkey Exchange Team
@@ -1857,7 +1876,7 @@ class MonkeyDictionaryService {
1857
1876
  }
1858
1877
  }
1859
1878
  });
1860
- const tokenSubject = inject(MONKEY_I18N_WRAPPER, { optional: true });
1879
+ const tokenSubject = inject(MECX_I18N_WRAPPER, { optional: true });
1861
1880
  tokenSubject?.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((value) => {
1862
1881
  this.handleWrapperValues(value);
1863
1882
  });
@@ -2134,7 +2153,7 @@ class MonkeyFormFieldComponent {
2134
2153
  }
2135
2154
  }
2136
2155
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2137
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyFormFieldComponent, selector: "monkey-form-field", inputs: { id: "id", hideAction: ["hideAction", "hideAction", booleanAttribute], enableClear: ["enableClear", "enableClear", booleanAttribute], size: "size" }, host: { properties: { "class.mecx-disabled": "control.disabled", "class.mecx-form-field-focused": "control.focused", "class.mecx-form-field-invalid": "showInvalid", "class.mecx-form-field-borderless": "hideBorder", "attr.id": "id", "id": "id", "class": "size" }, classAttribute: "mecx-form-field" }, queries: [{ propertyName: "_formFieldControl", first: true, predicate: MonkeyFormFieldControl, descendants: true }, { propertyName: "_labelChildren", predicate: MonkeyLabelDirective, descendants: true }, { propertyName: "_helperChildren", predicate: MonkeyHelperDirective, descendants: true }, { propertyName: "_prefixChildren", predicate: MonkeyPrefixDirective, descendants: true }, { propertyName: "_suffixChildren", predicate: MonkeySuffixDirective, descendants: true }, { propertyName: "_infoChildren", predicate: MonkeyInfoDirective, descendants: true }, { propertyName: "_errorChildren", predicate: MonkeyErrorDirective, 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 <util-icon class=\"mecx-clear\" name=\"clear\" (click)=\"onClear($event)\" />\n }\n @if (showCalendar) {\n <util-icon class=\"mecx-calendar\" name=\"calendar\" (click)=\"onOpenCalendar($event)\" />\n }\n @if (showLoading) {\n <util-icon class=\"mecx-form-field-loading\" name=\"loading\" />\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:4px;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;position:relative}.mecx-form-field-invalid .mecx-form-field-body{border:2px solid var(--mecx-color-error-700)}.mecx-form-field-invalid .mecx-form-field-body .mecx-option:not(.mecx-option-disabled).radio:before{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)}.sm .mecx-form-field-body{height:32px}.md .mecx-form-field-body{height:40px}.lg .mecx-form-field-body{height:48px}.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)}.mecx-form-field-borderless .mecx-form-field-body{background-color:transparent;border:0;border-radius:0;padding:0;height:unset;align-items:flex-start}.mecx-form-field-borderless.mecx-form-field-focused .mecx-form-field-body{outline:none;outline-offset:unset}\n"], dependencies: [{ kind: "component", type: UtilIconComponent, selector: "util-icon", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None }); }
2156
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyFormFieldComponent, selector: "monkey-form-field", inputs: { id: "id", hideAction: ["hideAction", "hideAction", booleanAttribute], enableClear: ["enableClear", "enableClear", booleanAttribute], size: "size" }, host: { properties: { "class.mecx-disabled": "control.disabled", "class.mecx-form-field-focused": "control.focused", "class.mecx-form-field-invalid": "showInvalid", "class.mecx-form-field-borderless": "hideBorder", "attr.id": "id", "id": "id", "class": "size" }, classAttribute: "mecx-form-field" }, queries: [{ propertyName: "_formFieldControl", first: true, predicate: MonkeyFormFieldControl, descendants: true }, { propertyName: "_labelChildren", predicate: MonkeyLabelDirective, descendants: true }, { propertyName: "_helperChildren", predicate: MonkeyHelperDirective, descendants: true }, { propertyName: "_prefixChildren", predicate: MonkeyPrefixDirective, descendants: true }, { propertyName: "_suffixChildren", predicate: MonkeySuffixDirective, descendants: true }, { propertyName: "_infoChildren", predicate: MonkeyInfoDirective, descendants: true }, { propertyName: "_errorChildren", predicate: MonkeyErrorDirective, 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 <util-icon class=\"mecx-clear\" name=\"clear\" (click)=\"onClear($event)\" />\n }\n @if (showCalendar) {\n <util-icon class=\"mecx-calendar\" name=\"calendar\" (click)=\"onOpenCalendar($event)\" />\n }\n @if (showLoading) {\n <util-icon class=\"mecx-form-field-loading\" name=\"loading\" />\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:4px;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;position:relative}.mecx-form-field-invalid .mecx-form-field-body{border:2px solid var(--mecx-color-error-700)}.mecx-form-field-invalid .mecx-form-field-body .mecx-option:not(.mecx-option-disabled).radio:before{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)}.sm .mecx-form-field-body{height:32px}.md .mecx-form-field-body{height:40px}.lg .mecx-form-field-body{height:48px}.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)}.mecx-form-field-borderless .mecx-form-field-body{background-color:transparent;border:0;border-radius:0;padding:0;height:unset;align-items:flex-start;outline:none;outline-offset:unset}.mecx-form-field-borderless.mecx-form-field-focused .mecx-form-field-body{outline:none;outline-offset:unset}\n"], dependencies: [{ kind: "component", type: UtilIconComponent, selector: "util-icon", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None }); }
2138
2157
  }
2139
2158
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyFormFieldComponent, decorators: [{
2140
2159
  type: Component,
@@ -2147,7 +2166,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
2147
2166
  '[attr.id]': 'id',
2148
2167
  '[id]': 'id',
2149
2168
  '[class]': 'size'
2150
- }, 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 <util-icon class=\"mecx-clear\" name=\"clear\" (click)=\"onClear($event)\" />\n }\n @if (showCalendar) {\n <util-icon class=\"mecx-calendar\" name=\"calendar\" (click)=\"onOpenCalendar($event)\" />\n }\n @if (showLoading) {\n <util-icon class=\"mecx-form-field-loading\" name=\"loading\" />\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:4px;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;position:relative}.mecx-form-field-invalid .mecx-form-field-body{border:2px solid var(--mecx-color-error-700)}.mecx-form-field-invalid .mecx-form-field-body .mecx-option:not(.mecx-option-disabled).radio:before{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)}.sm .mecx-form-field-body{height:32px}.md .mecx-form-field-body{height:40px}.lg .mecx-form-field-body{height:48px}.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)}.mecx-form-field-borderless .mecx-form-field-body{background-color:transparent;border:0;border-radius:0;padding:0;height:unset;align-items:flex-start}.mecx-form-field-borderless.mecx-form-field-focused .mecx-form-field-body{outline:none;outline-offset:unset}\n"] }]
2169
+ }, 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 <util-icon class=\"mecx-clear\" name=\"clear\" (click)=\"onClear($event)\" />\n }\n @if (showCalendar) {\n <util-icon class=\"mecx-calendar\" name=\"calendar\" (click)=\"onOpenCalendar($event)\" />\n }\n @if (showLoading) {\n <util-icon class=\"mecx-form-field-loading\" name=\"loading\" />\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:4px;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;position:relative}.mecx-form-field-invalid .mecx-form-field-body{border:2px solid var(--mecx-color-error-700)}.mecx-form-field-invalid .mecx-form-field-body .mecx-option:not(.mecx-option-disabled).radio:before{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)}.sm .mecx-form-field-body{height:32px}.md .mecx-form-field-body{height:40px}.lg .mecx-form-field-body{height:48px}.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)}.mecx-form-field-borderless .mecx-form-field-body{background-color:transparent;border:0;border-radius:0;padding:0;height:unset;align-items:flex-start;outline:none;outline-offset:unset}.mecx-form-field-borderless.mecx-form-field-focused .mecx-form-field-body{outline:none;outline-offset:unset}\n"] }]
2151
2170
  }], ctorParameters: () => [], propDecorators: { id: [{
2152
2171
  type: Input
2153
2172
  }], hideAction: [{
@@ -3463,7 +3482,80 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
3463
3482
  * This style guide was developed by Monkey Exchange Team
3464
3483
  * MIT Licence
3465
3484
  ************************* */
3466
- class MonkeyInputUploadComponent {
3485
+ class MonkeyOptionComponent {
3486
+ constructor() {
3487
+ this.idGenerator = inject(IdGenerator);
3488
+ this.disabled = false;
3489
+ this.type = 'select';
3490
+ this.selected = false;
3491
+ this.tabIndex = 0;
3492
+ this.id = this.idGenerator.getId('mecx-option-');
3493
+ }
3494
+ get displayContent() {
3495
+ return (this._content?.nativeElement.textContent || '').trim();
3496
+ }
3497
+ handleAction(event) {
3498
+ if (this.disabled) {
3499
+ event.stopPropagation();
3500
+ event.preventDefault();
3501
+ }
3502
+ else {
3503
+ this.action?.();
3504
+ }
3505
+ }
3506
+ onClick(event) {
3507
+ this.handleAction(event);
3508
+ }
3509
+ handleKeyDown(event) {
3510
+ const { key } = event;
3511
+ if (key === 'Enter' || key === ' ') {
3512
+ this.handleAction(event);
3513
+ }
3514
+ }
3515
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3516
+ 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], type: "type" }, host: { attributes: { "data-testid": "monkey-option" }, listeners: { "click": "onClick($event)", "keydown": "handleKeyDown($event)" }, properties: { "attr.id": "id", "class.mecx-option-disabled": "disabled", "class.mecx-option-selected": "selected", "attr.tabindex": "disabled ? -1 : tabIndex", "class": "type" }, 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.select:hover{color:var(--mecx-color-gray-900);background-color:var(--mecx-color-gray-100)}monkey-option.select.mecx-option-disabled{color:var(--mecx-color-gray-400);background-color:#fff;cursor:default}monkey-option.select.mecx-option-selected{color:var(--mecx-color-theme-contrast-main);background-color:var(--mecx-color-theme-main)}.ng-animating monkey-option.select.mecx-option-selected{color:var(--mecx-color-gray-900);background-color:var(--mecx-color-gray-100)}monkey-option.radio{display:flex;align-items:center;gap:10px;padding:8px 24px 8px 0;cursor:pointer;border-radius:4px;-webkit-user-select:none;user-select:none;position:relative}monkey-option.radio:before{content:\"\";width:20px;height:20px;border:2px solid var(--mecx-color-gray-600);border-radius:800px;box-sizing:border-box;background-color:var(--mecx-color-white)}monkey-option.radio:focus{outline:unset;outline-offset:1px}monkey-option.radio:focus:before{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}monkey-option.radio.mecx-option-selected:before{border:5px solid var(--mecx-color-theme-main)}monkey-option.radio.mecx-option-disabled{opacity:.5;pointer-events:none}monkey-option.radio.mecx-option-disabled:before{background:var(--mecx-color-white);border-color:var(--mecx-color-gray-400)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
3517
+ }
3518
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyOptionComponent, decorators: [{
3519
+ type: Component,
3520
+ args: [{ selector: 'monkey-option', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `<div #content><ng-content /></div>`, encapsulation: ViewEncapsulation.None, host: {
3521
+ 'data-testid': 'monkey-option',
3522
+ '[attr.id]': 'id',
3523
+ class: 'mecx-option',
3524
+ '[class.mecx-option-disabled]': 'disabled',
3525
+ '[class.mecx-option-selected]': 'selected',
3526
+ '[attr.tabindex]': 'disabled ? -1 : tabIndex',
3527
+ '[class]': 'type'
3528
+ }, 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.select:hover{color:var(--mecx-color-gray-900);background-color:var(--mecx-color-gray-100)}monkey-option.select.mecx-option-disabled{color:var(--mecx-color-gray-400);background-color:#fff;cursor:default}monkey-option.select.mecx-option-selected{color:var(--mecx-color-theme-contrast-main);background-color:var(--mecx-color-theme-main)}.ng-animating monkey-option.select.mecx-option-selected{color:var(--mecx-color-gray-900);background-color:var(--mecx-color-gray-100)}monkey-option.radio{display:flex;align-items:center;gap:10px;padding:8px 24px 8px 0;cursor:pointer;border-radius:4px;-webkit-user-select:none;user-select:none;position:relative}monkey-option.radio:before{content:\"\";width:20px;height:20px;border:2px solid var(--mecx-color-gray-600);border-radius:800px;box-sizing:border-box;background-color:var(--mecx-color-white)}monkey-option.radio:focus{outline:unset;outline-offset:1px}monkey-option.radio:focus:before{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}monkey-option.radio.mecx-option-selected:before{border:5px solid var(--mecx-color-theme-main)}monkey-option.radio.mecx-option-disabled{opacity:.5;pointer-events:none}monkey-option.radio.mecx-option-disabled:before{background:var(--mecx-color-white);border-color:var(--mecx-color-gray-400)}\n"] }]
3529
+ }], propDecorators: { _content: [{
3530
+ type: ViewChild,
3531
+ args: ['content', { static: true }]
3532
+ }], value: [{
3533
+ type: Input
3534
+ }], disabled: [{
3535
+ type: Input,
3536
+ args: [{ transform: booleanAttribute }]
3537
+ }], type: [{
3538
+ type: Input
3539
+ }], onClick: [{
3540
+ type: HostListener,
3541
+ args: ['click', ['$event']]
3542
+ }], handleKeyDown: [{
3543
+ type: HostListener,
3544
+ args: ['keydown', ['$event']]
3545
+ }] } });
3546
+
3547
+ /** ************************
3548
+ * Copyright Monkey Exchange. All Rights Reserved
3549
+ * This style guide was developed by Monkey Exchange Team
3550
+ * MIT Licence
3551
+ ************************* */
3552
+
3553
+ /** ************************
3554
+ * Copyright Monkey Exchange. All Rights Reserved
3555
+ * This style guide was developed by Monkey Exchange Team
3556
+ * MIT Licence
3557
+ ************************* */
3558
+ class MonkeySelectComponent {
3467
3559
  get disabled() {
3468
3560
  if (this.ngControl && this.ngControl.disabled !== null) {
3469
3561
  return this.ngControl.disabled;
@@ -3485,197 +3577,708 @@ class MonkeyInputUploadComponent {
3485
3577
  this.stateChanges.next();
3486
3578
  }
3487
3579
  set value(value) {
3488
- if (this._value !== value && value !== undefined) {
3580
+ if (this._value !== value) {
3489
3581
  this._value = value;
3490
3582
  this._onChange(value);
3491
- this._onTouched(value);
3492
3583
  }
3493
3584
  }
3494
3585
  get value() {
3495
3586
  return this._value;
3496
3587
  }
3497
- constructor() {
3498
- this.progress = 0;
3588
+ constructor(overlay, changeDetectorRef, viewContainerRef, formField) {
3589
+ this.overlay = overlay;
3590
+ this.changeDetectorRef = changeDetectorRef;
3591
+ this.viewContainerRef = viewContainerRef;
3592
+ this.formField = formField;
3593
+ this.tabIndex = 0;
3594
+ this.onChange = new EventEmitter();
3595
+ this.onSearch = new EventEmitter();
3499
3596
  this.placeholder = '';
3500
- this.maxSizeBytes = 5 * 1024 * 1024;
3501
- this.allowedExtensions = ['.jpg', '.jpeg', '.png', '.pdf', '.txt', '.xls', '.xlsx'];
3502
3597
  this.loading = false;
3503
- this.tabIndex = 0;
3504
- this._disabled = false;
3598
+ this.showSearch = true;
3599
+ this.searchPlaceholder = '';
3600
+ this.callbackSearch = false;
3505
3601
  this._value = null;
3506
- this.onChange = new EventEmitter();
3507
- this.ngControl = inject(NgControl, { self: true, optional: true });
3602
+ this.labelSelected = '';
3603
+ this.overlayRef = null;
3604
+ this._destroyRef = inject(DestroyRef);
3508
3605
  this.idGenerator = inject(IdGenerator);
3509
- this.id = this.idGenerator.getId('monkey-input-upload-');
3510
- this.focused = false;
3511
- this.type = '';
3606
+ this.ngControl = inject(NgControl, { self: true, optional: true });
3607
+ this._elementRef = inject(ElementRef);
3512
3608
  this.currency = false;
3609
+ this.focused = false;
3610
+ this._disabled = false;
3611
+ this.id = this.idGenerator.getId('monkey-select-');
3513
3612
  this.percent = false;
3514
3613
  this.stateChanges = new Subject();
3614
+ this.type = '';
3615
+ this.searchHandle = new EventEmitter();
3616
+ this.searchDictionary = inject(MonkeyDictionaryService).get('NO-DATA');
3617
+ this.loadingDictionary = inject(MonkeyDictionaryService).get('LOADING');
3618
+ this.showSearchNoData = false;
3619
+ this.isOpen = false;
3620
+ this.searchData = '';
3621
+ this.onAnimationEnd = (event) => {
3622
+ if (event.toState === 'closed') {
3623
+ this.closeOverlay();
3624
+ }
3625
+ };
3515
3626
  this._onChange = () => { };
3516
3627
  this._onTouched = () => { };
3517
3628
  if (this.ngControl) {
3518
3629
  this.ngControl.valueAccessor = this;
3519
3630
  }
3520
3631
  }
3521
- validateFileSize(file) {
3522
- return file.size <= this.maxSizeBytes;
3523
- }
3524
- validateFileExtension(file) {
3525
- if (!this.allowedExtensions || !this.allowedExtensions.length) {
3526
- return true;
3632
+ changeControl() {
3633
+ if (this.formField?.control) {
3634
+ this.formField.control.loading = this.loading;
3527
3635
  }
3528
- const fileExtension = getFileExtension(file.name);
3529
- const allowedExts = this.allowedExtensions.map((ext) => {
3530
- return ext.trim().replace('.', '').toLowerCase();
3636
+ }
3637
+ changeSelected() {
3638
+ setTimeout(() => {
3639
+ if (this.options) {
3640
+ this.options.forEach((opt) => {
3641
+ opt.selected = opt.value === this.value;
3642
+ });
3643
+ this.updateSelectedLabel();
3644
+ }
3645
+ this.changeDetectorRef.markForCheck();
3531
3646
  });
3532
- return allowedExts.includes(fileExtension);
3533
3647
  }
3534
- onContainerClick(event) {
3535
- if (!this.loading) {
3536
- this.fileInput.nativeElement.click();
3537
- }
3648
+ initializeOptions() {
3649
+ this.options.forEach((option) => {
3650
+ if (!option.action) {
3651
+ option.action = this.selectOption.bind(this, option);
3652
+ }
3653
+ });
3538
3654
  }
3539
- _onFocus() {
3540
- if (!this.disabled) {
3541
- this.focused = true;
3542
- this._onTouched();
3543
- this.stateChanges.next();
3655
+ openDropdown() {
3656
+ if (this.options?.length) {
3657
+ this.formField.control.disableToBeDirty = true;
3658
+ this.isOpen = true;
3659
+ this.createOverlay();
3544
3660
  }
3545
3661
  }
3546
- _onBlur() {
3662
+ closeDropdown() {
3663
+ this.changeDetectorRef.markForCheck();
3664
+ this.isOpen = false;
3547
3665
  this.focused = false;
3548
- this.stateChanges.next();
3549
- }
3550
- ngAfterContentInit() { }
3551
- ngOnChanges(changes) { }
3552
- ngOnDestroy() { }
3553
- registerOnChange(fn) {
3554
- this._onChange = fn;
3555
- }
3556
- registerOnTouched(fn) {
3557
- this._onTouched = fn;
3558
- }
3559
- setDisabledState(isDisabled) {
3560
- this.disabled = isDisabled;
3561
- if (this.fileInput) {
3562
- this.fileInput.nativeElement.disabled = isDisabled;
3666
+ this.formField.control.disableToBeDirty = false;
3667
+ if (!this.callbackSearch) {
3668
+ this.searchData = '';
3563
3669
  }
3564
3670
  }
3565
- writeValue(value) {
3566
- this.value = value;
3567
- }
3568
- reset() {
3569
- if (this.fileInput) {
3570
- this.fileInput.nativeElement.value = '';
3671
+ closeOverlay() {
3672
+ if (this.overlayRef) {
3673
+ this.overlayRef.dispose();
3674
+ this.overlayRef = null;
3571
3675
  }
3572
3676
  }
3573
- onFileSelected(event) {
3574
- const input = event.target;
3575
- this._onTouched();
3576
- if (!input.files?.length) {
3577
- return;
3578
- }
3579
- const file = input.files.item(0);
3580
- if (this.fileInput) {
3581
- this.fileInput.nativeElement.value = '';
3677
+ initializeWithOverlay() {
3678
+ if (this.showSearch) {
3679
+ const element = this.overlayRef?.overlayElement.querySelector(`#${this.id}-search`);
3680
+ this.options.forEach((opt) => {
3681
+ const element = this.overlayRef?.overlayElement.querySelector(`#${opt.id}`);
3682
+ if (!element)
3683
+ return;
3684
+ element.style.display = '';
3685
+ });
3686
+ setTimeout(() => {
3687
+ element?.focus();
3688
+ }, 0);
3689
+ this.showSearchNoData = false;
3582
3690
  }
3583
- if (!this.validateFileSize(file)) {
3584
- this.ngControl?.control?.setErrors({
3585
- maxFileSize: true,
3586
- sizeAllowed: formatFileSize(this.maxSizeBytes)
3691
+ setTimeout(() => {
3692
+ const selected = this.options.find((opt) => {
3693
+ return opt.selected;
3587
3694
  });
3588
- this._onBlur();
3589
- this.reset();
3695
+ if (selected) {
3696
+ const element = this.overlayRef?.overlayElement.querySelector(`#${selected.id}`);
3697
+ element?.scrollIntoView({ behavior: 'instant', block: 'center' });
3698
+ }
3699
+ }, 0);
3700
+ }
3701
+ createOverlay() {
3702
+ if (this.overlayRef) {
3590
3703
  return;
3591
3704
  }
3592
- if (!this.validateFileExtension(file)) {
3593
- this.ngControl?.control?.setErrors({
3594
- fileExtension: true,
3595
- extensionAllowed: this.allowedExtensions.join(', ')
3596
- });
3597
- this._onBlur();
3598
- this.reset();
3705
+ const offset = 4;
3706
+ const positions = [
3707
+ {
3708
+ originX: 'start',
3709
+ originY: 'bottom',
3710
+ overlayX: 'start',
3711
+ overlayY: 'top',
3712
+ offsetY: offset
3713
+ },
3714
+ {
3715
+ originX: 'start',
3716
+ originY: 'top',
3717
+ overlayX: 'start',
3718
+ overlayY: 'bottom',
3719
+ offsetY: -offset
3720
+ }
3721
+ ];
3722
+ let anchor = this.trigger;
3723
+ let width = anchor.nativeElement.offsetWidth;
3724
+ if (this.formField?.elementRef) {
3725
+ const el = this.formField?.elementRef.nativeElement.querySelector('.mecx-form-field-body');
3726
+ anchor = el;
3727
+ width = el.offsetWidth;
3728
+ }
3729
+ const positionStrategy = this.overlay
3730
+ .position()
3731
+ .flexibleConnectedTo(anchor)
3732
+ .withPositions(positions)
3733
+ .withPush(true);
3734
+ this.overlayRef = this.overlay.create({
3735
+ positionStrategy,
3736
+ scrollStrategy: this.overlay.scrollStrategies.block(),
3737
+ width,
3738
+ hasBackdrop: true,
3739
+ backdropClass: 'no-class'
3740
+ });
3741
+ const portal = new TemplatePortal(this.overlayTemplate, this.viewContainerRef);
3742
+ this.overlayRef.attach(portal);
3743
+ this.overlayRef
3744
+ .backdropClick()
3745
+ .pipe(takeUntilDestroyed(this._destroyRef))
3746
+ .subscribe(() => {
3747
+ return this.closeDropdown();
3748
+ });
3749
+ this.initializeWithOverlay();
3750
+ }
3751
+ updateSelectedLabel() {
3752
+ const selectedOption = this.options.find((opt) => {
3753
+ return opt.value === this.value;
3754
+ });
3755
+ this.labelSelected = selectedOption ? selectedOption.displayContent : '';
3756
+ }
3757
+ executeSearch(search) {
3758
+ let found = false;
3759
+ this.options.forEach((opt) => {
3760
+ const element = this.overlayRef?.overlayElement.querySelector(`#${opt.id}`);
3761
+ if (!element)
3762
+ return;
3763
+ const isMatch = normalizeStringToSearch(opt.displayContent).includes(normalizeStringToSearch(search));
3764
+ if (isMatch) {
3765
+ found = true;
3766
+ }
3767
+ element.style.display = isMatch ? '' : 'none';
3768
+ });
3769
+ this.repositionScroll();
3770
+ this.showSearchNoData = !found;
3771
+ }
3772
+ repositionScroll() {
3773
+ const overlayElement = this.overlayRef?.overlayElement.querySelector('.mecx-select-overlay');
3774
+ if (overlayElement) {
3775
+ overlayElement.scrollTop = 0;
3776
+ }
3777
+ }
3778
+ ngOnInit() {
3779
+ this.searchHandle
3780
+ .pipe(debounceTime(200), takeUntilDestroyed(this._destroyRef))
3781
+ .subscribe((search) => {
3782
+ if (this.callbackSearch) {
3783
+ this.onSearch.next(search);
3784
+ this.repositionScroll();
3785
+ }
3786
+ else {
3787
+ this.executeSearch(search);
3788
+ }
3789
+ });
3790
+ }
3791
+ ngAfterContentInit() {
3792
+ this.initializeOptions();
3793
+ this.options.changes.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((resp) => {
3794
+ this.updateSelectedLabel();
3795
+ this.initializeOptions();
3796
+ this.changeSelected();
3797
+ });
3798
+ }
3799
+ ngOnDestroy() {
3800
+ if (this.overlayRef) {
3801
+ this.overlayRef.dispose();
3802
+ }
3803
+ }
3804
+ toggleDropdown() {
3805
+ if (!this.disabled) {
3806
+ if (this.isOpen) {
3807
+ this.closeDropdown();
3808
+ this._onTouched();
3809
+ }
3810
+ else {
3811
+ this.openDropdown();
3812
+ }
3813
+ }
3814
+ }
3815
+ selectOption(option) {
3816
+ if (!option.disabled && !this.disabled) {
3817
+ this.value = option.value;
3818
+ this.updateSelectedLabel();
3819
+ this.closeDropdown();
3820
+ this._onChange(this.value);
3821
+ this.onChange.emit(this.value);
3822
+ this.options.forEach((opt) => {
3823
+ opt.selected = opt.value === this.value;
3824
+ });
3825
+ }
3826
+ }
3827
+ writeValue(value) {
3828
+ this.value = value;
3829
+ this.changeSelected();
3830
+ }
3831
+ onContainerClick(event) {
3832
+ if (this.disabled)
3599
3833
  return;
3834
+ this.openDropdown();
3835
+ this._elementRef.nativeElement.focus();
3836
+ }
3837
+ _onFocus() {
3838
+ if (!this.disabled) {
3839
+ this.focused = true;
3840
+ this._onTouched();
3841
+ this.stateChanges.next();
3842
+ }
3843
+ }
3844
+ _onBlur() {
3845
+ this.focused = false;
3846
+ this.stateChanges.next();
3847
+ }
3848
+ registerOnChange(fn) {
3849
+ this._onChange = fn;
3850
+ }
3851
+ registerOnTouched(fn) {
3852
+ this._onTouched = fn;
3853
+ }
3854
+ setDisabledState(isDisabled) {
3855
+ this.disabled = isDisabled;
3856
+ }
3857
+ ngOnChanges(changes) {
3858
+ let hasChanges = false;
3859
+ // eslint-disable-next-line dot-notation
3860
+ const changesLoading = changes?.['loading'];
3861
+ if (changesLoading?.currentValue !== changesLoading?.previousValue) {
3862
+ hasChanges = true;
3863
+ this.changeControl();
3864
+ }
3865
+ if (hasChanges) {
3866
+ this.stateChanges.next();
3867
+ }
3868
+ }
3869
+ onHandleSearch(event) {
3870
+ try {
3871
+ const { value } = event.target;
3872
+ const handled = sanitizeString(value);
3873
+ this.searchHandle.next(handled || '');
3874
+ }
3875
+ catch (e) {
3876
+ // not to do
3877
+ }
3878
+ }
3879
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySelectComponent, deps: [{ token: i1$1.Overlay }, { token: i0.ChangeDetectorRef }, { token: i0.ViewContainerRef }, { token: MonkeyFormFieldComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
3880
+ 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], showSearch: ["showSearch", "showSearch", booleanAttribute], searchPlaceholder: "searchPlaceholder", callbackSearch: ["callbackSearch", "callbackSearch", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], required: ["required", "required", booleanAttribute], value: "value" }, outputs: { onChange: "onChange", onSearch: "onSearch" }, 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: [
3881
+ // eslint-disable-next-line no-use-before-define
3882
+ { provide: MonkeyFormFieldControl, useExisting: MonkeySelectComponent }
3883
+ ], 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 <util-icon class=\"mecx-select-icon\" name=\"arrowDown\" />\n }\n</div>\n\n<ng-template #overlayTemplate>\n <div class=\"mecx-select-body-overlay\">\n @if (showSearch) {\n <div class=\"mecx-select-search\">\n <util-icon class=\"mecx-select-search-icon\" name=\"search\" />\n <input\n (input)=\"onHandleSearch($event)\"\n type=\"text\"\n [id]=\"id + '-search'\"\n autocomplete=\"off\"\n maxlength=\"50\"\n [placeholder]=\"searchPlaceholder\"\n [(ngModel)]=\"searchData\"\n />\n </div>\n }\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 @if (showSearch && showSearchNoData) {\n <div class=\"mecx-select-search-no-data\">\n <util-icon class=\"mecx-select-search-no-data-icon\" name=\"searchFail\" />\n {{ searchDictionary | async }}\n </div>\n }\n @if (loading) {\n <div class=\"mecx-select-search-loading\">\n {{ loadingDictionary | async }}\n </div>\n }\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-body-overlay{width:100%;background:#fff;border:2px solid var(--mecx-color-gray-400);overflow:hidden;border-radius:4px;box-shadow:0 16px 32px 0 var(--mecx-color-box-shadow)}.mecx-select-body-overlay .mecx-select-search{display:flex;gap:4px;border-bottom:2px solid var(--mecx-color-gray-400);padding:8px}.mecx-select-body-overlay .mecx-select-search-icon{width:12px;display:flex}.mecx-select-body-overlay .mecx-select-search-icon svg path{stroke:var(--mecx-color-gray-600)}.mecx-select-body-overlay input{border:none;width:90%;color:var(--mecx-color-gray-600)!important;font-size:12px;letter-spacing:.54px}.mecx-select-body-overlay .mecx-select-search-no-data,.mecx-select-body-overlay .mecx-select-search-loading{padding:12px;display:flex;justify-content:center;flex-direction:column;align-items:center;gap:4px;color:var(--mecx-color-gray-600);font-size:12px;letter-spacing:.54px;text-align:center}.mecx-select-body-overlay .mecx-select-search-no-data-icon svg path,.mecx-select-body-overlay .mecx-select-search-loading-icon svg path{stroke:var(--mecx-color-gray-600)}.mecx-select-overlay{width:100%;background:#fff;overflow:hidden auto;max-height:360px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UtilIconComponent, selector: "util-icon", inputs: ["name"] }], animations: [
3884
+ trigger('animation', [
3885
+ transition(':enter', [
3886
+ style({
3887
+ opacity: 0,
3888
+ transform: 'scaleY(.9)'
3889
+ }),
3890
+ animate('100ms ease-in-out', style({
3891
+ opacity: 1,
3892
+ transform: 'scaleY(1)'
3893
+ }))
3894
+ ]),
3895
+ state('closed', style({
3896
+ transform: 'scaleY(.9)',
3897
+ opacity: 0
3898
+ })),
3899
+ transition('closed <=> open', animate('200ms ease-in-out'))
3900
+ ])
3901
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
3902
+ }
3903
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySelectComponent, decorators: [{
3904
+ type: Component,
3905
+ args: [{ selector: 'monkey-select', standalone: true, imports: [CommonModule, ReactiveFormsModule, FormsModule, UtilIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
3906
+ // eslint-disable-next-line no-use-before-define
3907
+ { provide: MonkeyFormFieldControl, useExisting: MonkeySelectComponent }
3908
+ ], animations: [
3909
+ trigger('animation', [
3910
+ transition(':enter', [
3911
+ style({
3912
+ opacity: 0,
3913
+ transform: 'scaleY(.9)'
3914
+ }),
3915
+ animate('100ms ease-in-out', style({
3916
+ opacity: 1,
3917
+ transform: 'scaleY(1)'
3918
+ }))
3919
+ ]),
3920
+ state('closed', style({
3921
+ transform: 'scaleY(.9)',
3922
+ opacity: 0
3923
+ })),
3924
+ transition('closed <=> open', animate('200ms ease-in-out'))
3925
+ ])
3926
+ ], host: {
3927
+ 'data-testid': 'monkey-select',
3928
+ class: 'mecx-select',
3929
+ '[class.mecx-select-disabled]': '_disabled',
3930
+ '[class.mecx-select-focused]': 'focused',
3931
+ '[attr.id]': 'id',
3932
+ '[attr.tabindex]': 'disabled ? -1 : tabIndex',
3933
+ '(focus)': '_onFocus()',
3934
+ '(blur)': '_onBlur()'
3935
+ }, 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 <util-icon class=\"mecx-select-icon\" name=\"arrowDown\" />\n }\n</div>\n\n<ng-template #overlayTemplate>\n <div class=\"mecx-select-body-overlay\">\n @if (showSearch) {\n <div class=\"mecx-select-search\">\n <util-icon class=\"mecx-select-search-icon\" name=\"search\" />\n <input\n (input)=\"onHandleSearch($event)\"\n type=\"text\"\n [id]=\"id + '-search'\"\n autocomplete=\"off\"\n maxlength=\"50\"\n [placeholder]=\"searchPlaceholder\"\n [(ngModel)]=\"searchData\"\n />\n </div>\n }\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 @if (showSearch && showSearchNoData) {\n <div class=\"mecx-select-search-no-data\">\n <util-icon class=\"mecx-select-search-no-data-icon\" name=\"searchFail\" />\n {{ searchDictionary | async }}\n </div>\n }\n @if (loading) {\n <div class=\"mecx-select-search-loading\">\n {{ loadingDictionary | async }}\n </div>\n }\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-body-overlay{width:100%;background:#fff;border:2px solid var(--mecx-color-gray-400);overflow:hidden;border-radius:4px;box-shadow:0 16px 32px 0 var(--mecx-color-box-shadow)}.mecx-select-body-overlay .mecx-select-search{display:flex;gap:4px;border-bottom:2px solid var(--mecx-color-gray-400);padding:8px}.mecx-select-body-overlay .mecx-select-search-icon{width:12px;display:flex}.mecx-select-body-overlay .mecx-select-search-icon svg path{stroke:var(--mecx-color-gray-600)}.mecx-select-body-overlay input{border:none;width:90%;color:var(--mecx-color-gray-600)!important;font-size:12px;letter-spacing:.54px}.mecx-select-body-overlay .mecx-select-search-no-data,.mecx-select-body-overlay .mecx-select-search-loading{padding:12px;display:flex;justify-content:center;flex-direction:column;align-items:center;gap:4px;color:var(--mecx-color-gray-600);font-size:12px;letter-spacing:.54px;text-align:center}.mecx-select-body-overlay .mecx-select-search-no-data-icon svg path,.mecx-select-body-overlay .mecx-select-search-loading-icon svg path{stroke:var(--mecx-color-gray-600)}.mecx-select-overlay{width:100%;background:#fff;overflow:hidden auto;max-height:360px}\n"] }]
3936
+ }], ctorParameters: () => [{ type: i1$1.Overlay }, { type: i0.ChangeDetectorRef }, { type: i0.ViewContainerRef }, { type: MonkeyFormFieldComponent, decorators: [{
3937
+ type: Optional
3938
+ }] }], propDecorators: { overlayTemplate: [{
3939
+ type: ViewChild,
3940
+ args: ['overlayTemplate']
3941
+ }], overlayEl: [{
3942
+ type: ViewChild,
3943
+ args: ['overlay']
3944
+ }], trigger: [{
3945
+ type: ViewChild,
3946
+ args: ['trigger']
3947
+ }], options: [{
3948
+ type: ContentChildren,
3949
+ args: [MonkeyOptionComponent]
3950
+ }], tabIndex: [{
3951
+ type: Input
3952
+ }], onChange: [{
3953
+ type: Output
3954
+ }], onSearch: [{
3955
+ type: Output
3956
+ }], placeholder: [{
3957
+ type: Input,
3958
+ args: [{ required: true }]
3959
+ }], loading: [{
3960
+ type: Input,
3961
+ args: [{ transform: booleanAttribute }]
3962
+ }], showSearch: [{
3963
+ type: Input,
3964
+ args: [{ transform: booleanAttribute }]
3965
+ }], searchPlaceholder: [{
3966
+ type: Input
3967
+ }], callbackSearch: [{
3968
+ type: Input,
3969
+ args: [{ transform: booleanAttribute }]
3970
+ }], disabled: [{
3971
+ type: Input,
3972
+ args: [{ transform: booleanAttribute }]
3973
+ }], required: [{
3974
+ type: Input,
3975
+ args: [{ transform: booleanAttribute }]
3976
+ }], value: [{
3977
+ type: Input
3978
+ }] } });
3979
+
3980
+ /** ************************
3981
+ * Copyright Monkey Exchange. All Rights Reserved
3982
+ * This style guide was developed by Monkey Exchange Team
3983
+ * MIT Licence
3984
+ ************************* */
3985
+
3986
+ /** ************************
3987
+ * Copyright Monkey Exchange. All Rights Reserved
3988
+ * This style guide was developed by Monkey Exchange Team
3989
+ * MIT Licence
3990
+ ************************* */
3991
+ class MonkeyInputPhoneComponent {
3992
+ get disabled() {
3993
+ if (this.ngControl && this.ngControl.disabled !== null) {
3994
+ return this.ngControl.disabled;
3995
+ }
3996
+ return this._disabled;
3997
+ }
3998
+ set disabled(value) {
3999
+ this._disabled = value;
4000
+ if (this.focused) {
4001
+ this.focused = false;
4002
+ this.stateChanges.next();
4003
+ }
4004
+ }
4005
+ get required() {
4006
+ return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;
4007
+ }
4008
+ set required(value) {
4009
+ this._required = value;
4010
+ this.stateChanges.next();
4011
+ }
4012
+ set value(value) {
4013
+ if (this._value !== value && value !== undefined) {
4014
+ this._value = value;
4015
+ this.formatValue(value);
4016
+ this._onChange(value);
4017
+ this._onTouched(value);
4018
+ }
4019
+ }
4020
+ get value() {
4021
+ return this._value;
4022
+ }
4023
+ constructor() {
4024
+ this.placeholder = '';
4025
+ this.tabIndex = 0;
4026
+ this._disabled = false;
4027
+ this._value = null;
4028
+ this.ngControl = inject(NgControl, { self: true, optional: true });
4029
+ this.idGenerator = inject(IdGenerator);
4030
+ this.countryCode = inject(MECX_COUNTRY_CODE);
4031
+ this.locale = inject(LOCALE_ID);
4032
+ this.id = this.idGenerator.getId('monkey-input-upload-');
4033
+ this.inputId = this.idGenerator.getId('monkey-input-upload-input-');
4034
+ this.focused = false;
4035
+ this.type = 'input-phone';
4036
+ this.stateChanges = new Subject();
4037
+ this.countries = getCountries()
4038
+ .map((code) => {
4039
+ return {
4040
+ code: `+${getCountryCallingCode(code)}`,
4041
+ name: this.getCountryNameFromCode(code),
4042
+ flag: `${this.isoToFlagEmoji(code)} `
4043
+ };
4044
+ })
4045
+ .sort((a, b) => {
4046
+ return a.name.localeCompare(b.name);
4047
+ });
4048
+ this.countriesFiltered = this.countries;
4049
+ this.selectedCallingCode = this.countryCode.toString();
4050
+ this.phoneFormatted = '';
4051
+ this.phoneValid = false;
4052
+ this._onChange = () => { };
4053
+ this._onTouched = () => { };
4054
+ if (this.ngControl) {
4055
+ this.ngControl.valueAccessor = this;
4056
+ }
4057
+ }
4058
+ getCountryNameFromCode(code) {
4059
+ try {
4060
+ const locale = this.locale.toString();
4061
+ const display = new Intl.DisplayNames([locale], { type: 'region' });
4062
+ return display.of(code.toUpperCase()) || code;
4063
+ }
4064
+ catch {
4065
+ return code;
4066
+ }
4067
+ }
4068
+ getCountryByCallingCode(code) {
4069
+ const cleanCode = code.replace('+', '');
4070
+ return (getCountries().find((country) => {
4071
+ return getCountryCallingCode(country) === cleanCode;
4072
+ }) || null);
4073
+ }
4074
+ isoToFlagEmoji(isoCode) {
4075
+ return isoCode.toUpperCase().replace(/./g, (char) => {
4076
+ return String.fromCodePoint(127397 + char.charCodeAt(0));
4077
+ });
4078
+ }
4079
+ getCountryFromPhoneNumber(input, changedCountry) {
4080
+ try {
4081
+ if (changedCountry) {
4082
+ return this.selectedCallingCode;
4083
+ }
4084
+ const parsed = parsePhoneNumberFromString(input);
4085
+ const country = getCountryCallingCode(parsed?.country);
4086
+ return `+${country}`;
4087
+ }
4088
+ catch (e) {
4089
+ // not to do
4090
+ }
4091
+ return this.selectedCallingCode;
4092
+ }
4093
+ performValue(value) {
4094
+ this._value = `${this.selectedCallingCode}${value}`;
4095
+ this._onChange(this._value);
4096
+ this._onTouched(this._value);
4097
+ }
4098
+ validateValue() {
4099
+ const { phoneValid } = this;
4100
+ if (!phoneValid) {
4101
+ const countryCode = this.getCountryByCallingCode(this.selectedCallingCode);
4102
+ const example = getExampleNumber(countryCode, examples);
4103
+ this.ngControl?.control?.setErrors({
4104
+ phone: true,
4105
+ phoneAllowed: example?.nationalNumber
4106
+ });
4107
+ }
4108
+ }
4109
+ formatValue(value, changedCountry = false) {
4110
+ if (!value) {
4111
+ this.phoneFormatted = '';
4112
+ this.phoneValid = false;
4113
+ this.validateValue();
4114
+ return;
4115
+ }
4116
+ const detectedCallingCode = this.getCountryFromPhoneNumber(value, changedCountry);
4117
+ const isCountryChanged = changedCountry || detectedCallingCode !== this.selectedCallingCode;
4118
+ if (isCountryChanged && detectedCallingCode) {
4119
+ this.selectedCallingCode = detectedCallingCode;
4120
+ }
4121
+ const countryCode = this.getCountryByCallingCode(this.selectedCallingCode);
4122
+ if (!countryCode) {
4123
+ this.phoneFormatted = value;
4124
+ this.phoneValid = false;
4125
+ this.validateValue();
4126
+ return;
4127
+ }
4128
+ const nationalPart = value.replace(this.selectedCallingCode, '').replace(/[^\d+]/g, '');
4129
+ const formatter = new AsYouType(countryCode);
4130
+ this.phoneFormatted = formatter.input(nationalPart);
4131
+ this.performValue(nationalPart);
4132
+ this.phoneValid = isValidPhoneNumber(nationalPart, countryCode);
4133
+ this.validateValue();
4134
+ }
4135
+ ngAfterContentInit() { }
4136
+ ngOnChanges(changes) { }
4137
+ ngOnDestroy() { }
4138
+ onContainerClick(event) {
4139
+ this.inputs.first.nativeElement.focus();
4140
+ }
4141
+ _onFocus() {
4142
+ if (!this.disabled) {
4143
+ this.focused = true;
4144
+ this._onTouched();
4145
+ this.stateChanges.next();
3600
4146
  }
3601
- this._onBlur();
3602
- if (this.onChange.observed) {
3603
- this.onChange.emit({ component: this, file: file });
4147
+ }
4148
+ _onBlur() {
4149
+ this.focused = false;
4150
+ this.stateChanges.next();
4151
+ this.validateValue();
4152
+ }
4153
+ registerOnChange(fn) {
4154
+ this._onChange = fn;
4155
+ }
4156
+ registerOnTouched(fn) {
4157
+ this._onTouched = fn;
4158
+ }
4159
+ setDisabledState(isDisabled) {
4160
+ this.disabled = isDisabled;
4161
+ }
4162
+ writeValue(value) {
4163
+ this.value = value;
4164
+ }
4165
+ onInputChange(event) {
4166
+ const { value } = event.target;
4167
+ this.formatValue(value);
4168
+ }
4169
+ onCountryChange() {
4170
+ this.formatValue(this._value, true);
4171
+ this.validateValue();
4172
+ }
4173
+ getMaxLength() {
4174
+ try {
4175
+ const countryCode = this.getCountryByCallingCode(this.selectedCallingCode);
4176
+ if (!countryCode)
4177
+ return 20;
4178
+ const example = getExampleNumber(countryCode, examples);
4179
+ const formatted = new AsYouType(countryCode).input(example.nationalNumber);
4180
+ return formatted.length;
3604
4181
  }
3605
- else {
3606
- this.value = {
3607
- fileName: file.name,
3608
- file
3609
- };
4182
+ catch {
4183
+ return 20;
3610
4184
  }
3611
4185
  }
3612
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3613
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyInputUploadComponent, isStandalone: true, selector: "monkey-input-upload", inputs: { progress: "progress", placeholder: "placeholder", maxSizeBytes: "maxSizeBytes", allowedExtensions: "allowedExtensions", loading: ["loading", "loading", booleanAttribute], tabIndex: "tabIndex", disabled: ["disabled", "disabled", booleanAttribute], required: ["required", "required", booleanAttribute], value: "value" }, outputs: { onChange: "onChange" }, host: { listeners: { "focus": "_onFocus()", "blur": "_onBlur()" }, properties: { "attr.data-testid": "'monkey-input-upload'", "class.mecx-input-upload-disabled": "_disabled", "class.mecx-input-upload-focused": "focused", "attr.id": "id", "attr.tabindex": "disabled ? -1 : tabIndex" }, classAttribute: "mecx-input-upload" }, providers: [
4186
+ onHandleSearchSelect(query) {
4187
+ const normalizedQuery = query.trim().toLowerCase();
4188
+ this.countriesFiltered = this.countries.filter(({ name }) => {
4189
+ return name.toLowerCase().includes(normalizedQuery);
4190
+ });
4191
+ }
4192
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputPhoneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4193
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyInputPhoneComponent, isStandalone: true, selector: "monkey-input-phone", inputs: { placeholder: "placeholder", tabIndex: "tabIndex", disabled: ["disabled", "disabled", booleanAttribute], required: ["required", "required", booleanAttribute], value: "value" }, host: { listeners: { "focus": "_onFocus()", "blur": "_onBlur()" }, properties: { "attr.data-testid": "'monkey-input-phone'", "class.mecx-input-phone-disabled": "_disabled", "class.mecx-input-phone-focused": "focused", "attr.id": "id", "attr.tabindex": "disabled ? -1 : tabIndex" }, classAttribute: "mecx-input-phone" }, providers: [
3614
4194
  // eslint-disable-next-line no-use-before-define
3615
- { provide: MonkeyFormFieldControl, useExisting: MonkeyInputUploadComponent }
3616
- ], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
3617
- <div class="mecx-input-upload-value" [class.has-value]="value">
3618
- {{ value?.fileName || placeholder }}
3619
- </div>
4195
+ { provide: MonkeyFormFieldControl, useExisting: MonkeyInputPhoneComponent }
4196
+ ], viewQueries: [{ propertyName: "inputs", predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
4197
+ <monkey-select
4198
+ placeholder=""
4199
+ [disabled]="disabled"
4200
+ showSearch
4201
+ [(ngModel)]="selectedCallingCode"
4202
+ class="mecx-phone-select-country"
4203
+ (onChange)="onCountryChange()"
4204
+ callbackSearch
4205
+ (onSearch)="onHandleSearchSelect($event)"
4206
+ >
4207
+ @for (item of countriesFiltered; track $index) {
4208
+ <monkey-option [value]="item.code">
4209
+ <span class="option-flag">{{ item.flag }}</span>
4210
+ <div class="option-name">{{ item.name }} {{ item.code }}</div>
4211
+ </monkey-option>
4212
+ }
4213
+ </monkey-select>
3620
4214
  <input
3621
- (change)="onFileSelected($event)"
3622
- type="file"
3623
- class="file-input"
3624
- #fileInput
3625
- [accept]="allowedExtensions.join(',')"
4215
+ #input
4216
+ class="mecx-input"
4217
+ [attr.disabled]="disabled"
4218
+ placeholder="Enter phone number"
4219
+ (input)="onInputChange($event)"
4220
+ [ngModel]="phoneFormatted"
4221
+ [maxlength]="getMaxLength()"
4222
+ (focus)="_onFocus()"
4223
+ (blur)="_onBlur()"
4224
+ [attr.id]="inputId"
3626
4225
  />
3627
- @if (loading) {
3628
- <div class="progress">
3629
- <div class="progress-bar" [style.width.%]="progress"></div>
3630
- </div>
3631
- }
3632
- `, isInline: true, styles: [":host{display:inline-flex;width:100%;min-width:0;cursor:pointer}:host .progress{position:absolute;left:0;bottom:0;right:0;height:2px;background-color:var(--mecx-color-gray-300);width:100%}:host .progress .progress-bar{background-color:var(--mecx-color-success-main);height:100%;transition:width .2s}:host:focus-visible,:host:focus{outline:none}:host .mecx-input-upload-value{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:24px}:host .mecx-input-upload-value.has-value{color:var(--mecx-color-gray-900)}:host.mecx-input-upload-disabled .mecx-input-upload-value{color:var(--mecx-color-gray-400)!important}:host .file-input{display:none}\n"] }); }
4226
+ `, isInline: true, styles: [":host{display:inline-flex;width:100%;min-width:0}:host monkey-select{width:164px;border-right:2px solid var(--mecx-color-gray-400)}:host.mecx-input-phone-disabled monkey-select{border-right:2px solid var(--mecx-color-gray-200)}:host input{width:100%;border:none;margin-left:8px}monkey-option .option-flag{font-size:30px}monkey-option .option-name{letter-spacing:.48px;margin-left:4px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.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", "showSearch", "searchPlaceholder", "callbackSearch", "disabled", "required", "value"], outputs: ["onChange", "onSearch"] }, { kind: "component", type: MonkeyOptionComponent, selector: "monkey-option", inputs: ["value", "disabled", "type"] }, { kind: "ngmodule", type: MonkeyFormFieldModule }] }); }
3633
4227
  }
3634
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputUploadComponent, decorators: [{
4228
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputPhoneComponent, decorators: [{
3635
4229
  type: Component,
3636
- args: [{ selector: 'monkey-input-upload', standalone: true, imports: [], template: `
3637
- <div class="mecx-input-upload-value" [class.has-value]="value">
3638
- {{ value?.fileName || placeholder }}
3639
- </div>
4230
+ args: [{ selector: 'monkey-input-phone', standalone: true, imports: [
4231
+ CommonModule,
4232
+ FormsModule,
4233
+ ReactiveFormsModule,
4234
+ MonkeySelectComponent,
4235
+ MonkeyOptionComponent,
4236
+ MonkeyFormFieldModule
4237
+ ], template: `
4238
+ <monkey-select
4239
+ placeholder=""
4240
+ [disabled]="disabled"
4241
+ showSearch
4242
+ [(ngModel)]="selectedCallingCode"
4243
+ class="mecx-phone-select-country"
4244
+ (onChange)="onCountryChange()"
4245
+ callbackSearch
4246
+ (onSearch)="onHandleSearchSelect($event)"
4247
+ >
4248
+ @for (item of countriesFiltered; track $index) {
4249
+ <monkey-option [value]="item.code">
4250
+ <span class="option-flag">{{ item.flag }}</span>
4251
+ <div class="option-name">{{ item.name }} {{ item.code }}</div>
4252
+ </monkey-option>
4253
+ }
4254
+ </monkey-select>
3640
4255
  <input
3641
- (change)="onFileSelected($event)"
3642
- type="file"
3643
- class="file-input"
3644
- #fileInput
3645
- [accept]="allowedExtensions.join(',')"
4256
+ #input
4257
+ class="mecx-input"
4258
+ [attr.disabled]="disabled"
4259
+ placeholder="Enter phone number"
4260
+ (input)="onInputChange($event)"
4261
+ [ngModel]="phoneFormatted"
4262
+ [maxlength]="getMaxLength()"
4263
+ (focus)="_onFocus()"
4264
+ (blur)="_onBlur()"
4265
+ [attr.id]="inputId"
3646
4266
  />
3647
- @if (loading) {
3648
- <div class="progress">
3649
- <div class="progress-bar" [style.width.%]="progress"></div>
3650
- </div>
3651
- }
3652
4267
  `, providers: [
3653
4268
  // eslint-disable-next-line no-use-before-define
3654
- { provide: MonkeyFormFieldControl, useExisting: MonkeyInputUploadComponent }
4269
+ { provide: MonkeyFormFieldControl, useExisting: MonkeyInputPhoneComponent }
3655
4270
  ], host: {
3656
- '[attr.data-testid]': "'monkey-input-upload'",
3657
- class: 'mecx-input-upload',
3658
- '[class.mecx-input-upload-disabled]': '_disabled',
3659
- '[class.mecx-input-upload-focused]': 'focused',
4271
+ '[attr.data-testid]': "'monkey-input-phone'",
4272
+ class: 'mecx-input-phone',
4273
+ '[class.mecx-input-phone-disabled]': '_disabled',
4274
+ '[class.mecx-input-phone-focused]': 'focused',
3660
4275
  '[attr.id]': 'id',
3661
4276
  '[attr.tabindex]': 'disabled ? -1 : tabIndex',
3662
4277
  '(focus)': '_onFocus()',
3663
4278
  '(blur)': '_onBlur()'
3664
- }, styles: [":host{display:inline-flex;width:100%;min-width:0;cursor:pointer}:host .progress{position:absolute;left:0;bottom:0;right:0;height:2px;background-color:var(--mecx-color-gray-300);width:100%}:host .progress .progress-bar{background-color:var(--mecx-color-success-main);height:100%;transition:width .2s}:host:focus-visible,:host:focus{outline:none}:host .mecx-input-upload-value{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:24px}:host .mecx-input-upload-value.has-value{color:var(--mecx-color-gray-900)}:host.mecx-input-upload-disabled .mecx-input-upload-value{color:var(--mecx-color-gray-400)!important}:host .file-input{display:none}\n"] }]
3665
- }], ctorParameters: () => [], propDecorators: { fileInput: [{
3666
- type: ViewChild,
3667
- args: ['fileInput']
3668
- }], progress: [{
3669
- type: Input
3670
- }], placeholder: [{
3671
- type: Input
3672
- }], maxSizeBytes: [{
4279
+ }, styles: [":host{display:inline-flex;width:100%;min-width:0}:host monkey-select{width:164px;border-right:2px solid var(--mecx-color-gray-400)}:host.mecx-input-phone-disabled monkey-select{border-right:2px solid var(--mecx-color-gray-200)}:host input{width:100%;border:none;margin-left:8px}monkey-option .option-flag{font-size:30px}monkey-option .option-name{letter-spacing:.48px;margin-left:4px}\n"] }]
4280
+ }], ctorParameters: () => [], propDecorators: { placeholder: [{
3673
4281
  type: Input
3674
- }], allowedExtensions: [{
3675
- type: Input
3676
- }], loading: [{
3677
- type: Input,
3678
- args: [{ transform: booleanAttribute }]
3679
4282
  }], tabIndex: [{
3680
4283
  type: Input
3681
4284
  }], disabled: [{
@@ -3686,8 +4289,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
3686
4289
  args: [{ transform: booleanAttribute }]
3687
4290
  }], value: [{
3688
4291
  type: Input
3689
- }], onChange: [{
3690
- type: Output
4292
+ }], inputs: [{
4293
+ type: ViewChildren,
4294
+ args: ['input']
3691
4295
  }] } });
3692
4296
 
3693
4297
  /** ************************
@@ -3701,456 +4305,331 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
3701
4305
  * This style guide was developed by Monkey Exchange Team
3702
4306
  * MIT Licence
3703
4307
  ************************* */
3704
- class MonkeyModalActionsDirective {
3705
- constructor() {
3706
- this.mkAlign = 'end';
3707
- this.id = inject(IdGenerator).getId('monkey-modal-actions-');
4308
+ class MonkeyInputUploadComponent {
4309
+ get disabled() {
4310
+ if (this.ngControl && this.ngControl.disabled !== null) {
4311
+ return this.ngControl.disabled;
4312
+ }
4313
+ return this._disabled;
3708
4314
  }
3709
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalActionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3710
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyModalActionsDirective, selector: "monkey-modal-actions, [monkey-modal-actions]", inputs: { mkAlign: "mkAlign" }, host: { properties: { "class": "'mecx-modal-actions align-'+mkAlign", "attr.id": "id || null" } }, ngImport: i0 }); }
3711
- }
3712
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalActionsDirective, decorators: [{
3713
- type: Directive,
3714
- args: [{
3715
- selector: 'monkey-modal-actions, [monkey-modal-actions]',
3716
- host: {
3717
- '[class]': `'mecx-modal-actions align-'+mkAlign`,
3718
- '[attr.id]': 'id || null'
3719
- }
3720
- }]
3721
- }], propDecorators: { mkAlign: [{
3722
- type: Input
3723
- }] } });
3724
-
3725
- /** ************************
3726
- * Copyright Monkey Exchange. All Rights Reserved
3727
- * This style guide was developed by Monkey Exchange Team
3728
- * MIT Licence
3729
- ************************* */
3730
- class MonkeyModalContentDirective {
3731
- constructor() {
3732
- this.id = inject(IdGenerator).getId('monkey-modal-content-');
4315
+ set disabled(value) {
4316
+ this._disabled = value;
4317
+ if (this.focused) {
4318
+ this.focused = false;
4319
+ this.stateChanges.next();
4320
+ }
3733
4321
  }
3734
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3735
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyModalContentDirective, selector: "monkey-modal-content, [monkey-modal-content]", host: { properties: { "attr.id": "id || null" }, classAttribute: "mecx-modal-content" }, ngImport: i0 }); }
3736
- }
3737
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalContentDirective, decorators: [{
3738
- type: Directive,
3739
- args: [{
3740
- selector: 'monkey-modal-content, [monkey-modal-content]',
3741
- host: {
3742
- class: 'mecx-modal-content',
3743
- '[attr.id]': 'id || null'
3744
- }
3745
- }]
3746
- }] });
3747
-
3748
- /** ************************
3749
- * Copyright Monkey Exchange. All Rights Reserved
3750
- * This style guide was developed by Monkey Exchange Team
3751
- * MIT Licence
3752
- ************************* */
3753
- class MonkeyModalSubtitleDirective {
3754
- constructor() {
3755
- this.id = inject(IdGenerator).getId('monkey-modal-subtitle-');
4322
+ get required() {
4323
+ return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;
3756
4324
  }
3757
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalSubtitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3758
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyModalSubtitleDirective, selector: "monkey-modal-subtitle, [monkey-modal-subtitle]", host: { properties: { "attr.id": "id || null" }, classAttribute: "mecx-modal-subtitle" }, ngImport: i0 }); }
3759
- }
3760
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalSubtitleDirective, decorators: [{
3761
- type: Directive,
3762
- args: [{
3763
- selector: 'monkey-modal-subtitle, [monkey-modal-subtitle]',
3764
- host: {
3765
- class: 'mecx-modal-subtitle',
3766
- '[attr.id]': 'id || null'
3767
- }
3768
- }]
3769
- }] });
3770
-
3771
- /** ************************
3772
- * Copyright Monkey Exchange. All Rights Reserved
3773
- * This style guide was developed by Monkey Exchange Team
3774
- * MIT Licence
3775
- ************************* */
3776
- class MonkeyModalTitleDirective {
3777
- constructor() {
3778
- this.id = inject(IdGenerator).getId('monkey-modal-title-');
4325
+ set required(value) {
4326
+ this._required = value;
4327
+ this.stateChanges.next();
4328
+ }
4329
+ set value(value) {
4330
+ if (this._value !== value && value !== undefined) {
4331
+ this._value = value;
4332
+ this._onChange(value);
4333
+ this._onTouched(value);
4334
+ }
4335
+ }
4336
+ get value() {
4337
+ return this._value;
3779
4338
  }
3780
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3781
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyModalTitleDirective, selector: "monkey-modal-title, [monkey-modal-title]", host: { properties: { "attr.id": "id || null" }, classAttribute: "mecx-modal-title" }, ngImport: i0 }); }
3782
- }
3783
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalTitleDirective, decorators: [{
3784
- type: Directive,
3785
- args: [{
3786
- selector: 'monkey-modal-title, [monkey-modal-title]',
3787
- host: {
3788
- class: 'mecx-modal-title',
3789
- '[attr.id]': 'id || null'
3790
- }
3791
- }]
3792
- }] });
3793
-
3794
- /** ************************
3795
- * Copyright Monkey Exchange. All Rights Reserved
3796
- * This style guide was developed by Monkey Exchange Team
3797
- * MIT Licence
3798
- ************************* */
3799
- class MonkeyModalConfig {
3800
4339
  constructor() {
3801
- this.panelClass = '';
3802
- this.hasBackdrop = true;
3803
- this.backdropClass = 'mecx-modal-overlay';
3804
- this.disableClose = false;
3805
- this.disableBackdropClose = false;
3806
- this.fullscreen = false;
3807
- this.position = 'center-center';
3808
- this.data = null;
3809
- this.closeOnNavigation = true;
4340
+ this.progress = 0;
4341
+ this.placeholder = '';
4342
+ this.maxSizeBytes = 5 * 1024 * 1024;
4343
+ this.allowedExtensions = ['.jpg', '.jpeg', '.png', '.pdf', '.txt', '.xls', '.xlsx'];
4344
+ this.loading = false;
4345
+ this.tabIndex = 0;
4346
+ this._disabled = false;
4347
+ this._value = null;
4348
+ this.onChange = new EventEmitter();
4349
+ this.ngControl = inject(NgControl, { self: true, optional: true });
4350
+ this.idGenerator = inject(IdGenerator);
4351
+ this.id = this.idGenerator.getId('monkey-input-upload-');
4352
+ this.focused = false;
4353
+ this.type = '';
4354
+ this.currency = false;
4355
+ this.percent = false;
4356
+ this.stateChanges = new Subject();
4357
+ this._onChange = () => { };
4358
+ this._onTouched = () => { };
4359
+ if (this.ngControl) {
4360
+ this.ngControl.valueAccessor = this;
4361
+ }
4362
+ }
4363
+ validateFileSize(file) {
4364
+ return file.size <= this.maxSizeBytes;
4365
+ }
4366
+ validateFileExtension(file) {
4367
+ if (!this.allowedExtensions || !this.allowedExtensions.length) {
4368
+ return true;
4369
+ }
4370
+ const fileExtension = getFileExtension(file.name);
4371
+ const allowedExts = this.allowedExtensions.map((ext) => {
4372
+ return ext.trim().replace('.', '').toLowerCase();
4373
+ });
4374
+ return allowedExts.includes(fileExtension);
3810
4375
  }
3811
- }
3812
-
3813
- /** ************************
3814
- * Copyright Monkey Exchange. All Rights Reserved
3815
- * This style guide was developed by Monkey Exchange Team
3816
- * MIT Licence
3817
- ************************* */
3818
- class MonkeyModalRef {
3819
- constructor(overlayRef, config) {
3820
- this.overlayRef = overlayRef;
3821
- this.config = config;
3822
- this.closed = new Subject();
3823
- this.id = config.id;
3824
- this.icon = config.icon;
3825
- this.disableClose = config.disableClose;
3826
- this.disableBackdropClose = config.disableBackdropClose;
3827
- this.closeOnNavigation = config.closeOnNavigation;
3828
- this.backdropClick = overlayRef.backdropClick();
3829
- this.keydownEvents = overlayRef.keydownEvents();
3830
- this.outsidePointerEvents = overlayRef.outsidePointerEvents();
3831
- if (!this.disableBackdropClose) {
3832
- this.keydownEvents.subscribe((event) => {
3833
- if (event.key === 'Escape' && !this.disableClose && !hasModifierKey(event)) {
3834
- event.preventDefault();
3835
- this.close(undefined);
3836
- }
3837
- });
3838
- this.backdropClick.subscribe(() => {
3839
- if (!this.disableClose) {
3840
- this.close(undefined);
3841
- }
3842
- });
4376
+ onContainerClick(event) {
4377
+ if (!this.loading) {
4378
+ this.fileInput.nativeElement.click();
3843
4379
  }
3844
4380
  }
3845
- close(result) {
3846
- if (this.componentInstance) {
3847
- const closedSubject = this.closed;
3848
- const active = document.activeElement;
3849
- if (active && this.componentElement.contains(active)) {
3850
- active.blur();
3851
- }
3852
- this.componentElement.querySelectorAll('monkey-modal')[0].classList.add('fade-out');
3853
- setTimeout(() => {
3854
- this.overlayRef.detach();
3855
- }, 150);
3856
- closedSubject.next(result);
3857
- closedSubject.complete();
3858
- // eslint-disable-next-line no-multi-assign
3859
- this.componentInstance = null;
4381
+ _onFocus() {
4382
+ if (!this.disabled) {
4383
+ this.focused = true;
4384
+ this._onTouched();
4385
+ this.stateChanges.next();
3860
4386
  }
3861
4387
  }
3862
- afterClosed() {
3863
- return this.closed;
4388
+ _onBlur() {
4389
+ this.focused = false;
4390
+ this.stateChanges.next();
3864
4391
  }
3865
- }
3866
-
3867
- class MonkeyModalComponent {
3868
- constructor(_elementRef, overlayRef, modalRef) {
3869
- this._elementRef = _elementRef;
3870
- this.overlayRef = overlayRef;
3871
- this.modalRef = modalRef;
3872
- this._navigationSubscription = null;
3873
- this._router = inject(Router);
3874
- // not to do
4392
+ ngAfterContentInit() { }
4393
+ ngOnChanges(changes) { }
4394
+ ngOnDestroy() { }
4395
+ registerOnChange(fn) {
4396
+ this._onChange = fn;
3875
4397
  }
3876
- ngAfterViewInit() {
3877
- if (this._elementRef) {
3878
- this._elementRef.nativeElement.focus();
3879
- }
3880
- if (this.modalRef?.closeOnNavigation) {
3881
- this._navigationSubscription = this._router.events.subscribe((event) => {
3882
- if (event instanceof NavigationStart) {
3883
- this.close();
3884
- }
3885
- });
4398
+ registerOnTouched(fn) {
4399
+ this._onTouched = fn;
4400
+ }
4401
+ setDisabledState(isDisabled) {
4402
+ this.disabled = isDisabled;
4403
+ if (this.fileInput) {
4404
+ this.fileInput.nativeElement.disabled = isDisabled;
3886
4405
  }
3887
4406
  }
3888
- ngOnDestroy() {
3889
- if (this._navigationSubscription) {
3890
- this._navigationSubscription.unsubscribe();
3891
- this._navigationSubscription = null;
4407
+ writeValue(value) {
4408
+ this.value = value;
4409
+ }
4410
+ reset() {
4411
+ if (this.fileInput) {
4412
+ this.fileInput.nativeElement.value = '';
3892
4413
  }
3893
4414
  }
3894
- close() {
3895
- const element = this._elementRef.nativeElement;
3896
- element.classList.add('fade-out');
3897
- setTimeout(() => {
3898
- this.modalRef?.close();
3899
- }, 150);
4415
+ onFileSelected(event) {
4416
+ const input = event.target;
4417
+ this._onTouched();
4418
+ if (!input.files?.length) {
4419
+ return;
4420
+ }
4421
+ const file = input.files.item(0);
4422
+ if (this.fileInput) {
4423
+ this.fileInput.nativeElement.value = '';
4424
+ }
4425
+ if (!this.validateFileSize(file)) {
4426
+ this.ngControl?.control?.setErrors({
4427
+ maxFileSize: true,
4428
+ sizeAllowed: formatFileSize(this.maxSizeBytes)
4429
+ });
4430
+ this._onBlur();
4431
+ this.reset();
4432
+ return;
4433
+ }
4434
+ if (!this.validateFileExtension(file)) {
4435
+ this.ngControl?.control?.setErrors({
4436
+ fileExtension: true,
4437
+ extensionAllowed: this.allowedExtensions.join(', ')
4438
+ });
4439
+ this._onBlur();
4440
+ this.reset();
4441
+ return;
4442
+ }
4443
+ this._onBlur();
4444
+ if (this.onChange.observed) {
4445
+ this.onChange.emit({ component: this, file: file });
4446
+ }
4447
+ else {
4448
+ this.value = {
4449
+ fileName: file.name,
4450
+ file
4451
+ };
4452
+ }
3900
4453
  }
3901
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.OverlayRef, optional: true }, { token: MonkeyModalRef, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
3902
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyModalComponent, selector: "monkey-modal", host: { attributes: { "tabindex": "-1" }, properties: { "attr.id": "modalRef?.id || null" }, classAttribute: "mecx-modal" }, ngImport: i0, template: `
3903
- <div class="mecx-modal-header">
3904
- <div class="mecx-modal-header-group">
3905
- <div class="mecx-modal-header-title">
3906
- @if (modalRef?.icon) {
3907
- <div class="mecx-modal-header-icon">
3908
- <monkey-icon [icon]="modalRef?.icon + ''" first></monkey-icon>
3909
- </div>
3910
- }
3911
- <ng-content select="monkey-modal-title"></ng-content>
3912
- <ng-content select="[monkey-modal-title]"></ng-content>
3913
- </div>
3914
-
3915
- <ng-content select="monkey-modal-subtitle"></ng-content>
3916
- <ng-content select="[monkey-modal-subtitle]"></ng-content>
3917
- </div>
3918
- @if (!modalRef?.disableClose) {
3919
- <monkey-icon-button
3920
- size="sm"
3921
- type="tertiary"
3922
- icon="close"
3923
- class="mecx-modal-close"
3924
- (click)="close()"
3925
- >
3926
- </monkey-icon-button>
3927
- }
4454
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4455
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyInputUploadComponent, isStandalone: true, selector: "monkey-input-upload", inputs: { progress: "progress", placeholder: "placeholder", maxSizeBytes: "maxSizeBytes", allowedExtensions: "allowedExtensions", loading: ["loading", "loading", booleanAttribute], tabIndex: "tabIndex", disabled: ["disabled", "disabled", booleanAttribute], required: ["required", "required", booleanAttribute], value: "value" }, outputs: { onChange: "onChange" }, host: { listeners: { "focus": "_onFocus()", "blur": "_onBlur()" }, properties: { "attr.data-testid": "'monkey-input-upload'", "class.mecx-input-upload-disabled": "_disabled", "class.mecx-input-upload-focused": "focused", "attr.id": "id", "attr.tabindex": "disabled ? -1 : tabIndex" }, classAttribute: "mecx-input-upload" }, providers: [
4456
+ // eslint-disable-next-line no-use-before-define
4457
+ { provide: MonkeyFormFieldControl, useExisting: MonkeyInputUploadComponent }
4458
+ ], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
4459
+ <div class="mecx-input-upload-value" [class.has-value]="value">
4460
+ {{ value?.fileName || placeholder }}
3928
4461
  </div>
3929
- <ng-content select="monkey-modal-content"></ng-content>
3930
- <ng-content select="[monkey-modal-content]"></ng-content>
3931
- <ng-content select="monkey-modal-actions"></ng-content>
3932
- <ng-content select="[monkey-modal-actions]"></ng-content>
3933
- `, isInline: true, styles: ["monkey-modal{width:100%;height:100%;display:flex;flex-direction:column;background:#fff;border-radius:8px}.mecx-modal{opacity:0;animation:modalFadeIn .2s ease-out forwards;transition:opacity .15s ease-in}.mecx-modal.fade-out{animation:modalFadeOut .15s ease-in forwards}@keyframes modalFadeIn{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes modalFadeOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}.mecx-modal-header{display:flex;gap:12px;align-items:flex-start;justify-content:space-between;border-bottom:1px solid var(--mecx-color-gray-200);padding:12px;position:relative}.mecx-modal-header-group{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:4px}.mecx-modal-header-title{display:flex;gap:8px;align-items:center;justify-content:flex-start}.mecx-modal-header-icon{padding:8px;display:flex;align-items:center;justify-content:center;background:var(--mecx-color-gray-100);border-radius:8px;font-size:24px;color:var(--mecx-color-gray-900)}.mecx-modal-title{font-size:18px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.54px;color:var(--mecx-color-gray-900)}.mecx-modal-subtitle{font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px;color:var(--mecx-color-gray-700)}.mecx-modal-content{display:block;flex-grow:1;box-sizing:border-box;overflow:auto;max-height:65vh;padding:12px;scrollbar-color:var(--mecx-color-gray-400) transparent}.mecx-modal-actions{display:flex;flex-wrap:wrap;gap:8px;border-top:1px solid var(--mecx-color-gray-200);padding:12px}.mecx-modal-actions.align-start{justify-content:flex-start}.mecx-modal-actions.align-center{justify-content:center}.mecx-modal-actions.align-end{justify-content:flex-end}.mecx-modal-overlay{background:#00000052}.monkey-modal-panel{padding:16px}.monkey-modal-panel.monkey-modal-fullscreen{width:100%!important;max-width:100%!important;height:100%!important;max-height:100%!important;padding:0}.monkey-modal-panel.monkey-modal-fullscreen monkey-modal{border-radius:0}.monkey-modal-panel.monkey-modal-fullscreen monkey-modal .mecx-modal-content{max-height:100%}\n"], dependencies: [{ kind: "component", type: MonkeyIconButtonComponent, selector: "monkey-icon-button", inputs: ["type", "size", "disabled", "icon", "id"] }, { kind: "component", type: MonkeyIconComponent, selector: "monkey-icon", inputs: ["icon", "size", "id"] }], encapsulation: i0.ViewEncapsulation.None }); }
4462
+ <input
4463
+ (change)="onFileSelected($event)"
4464
+ type="file"
4465
+ class="file-input"
4466
+ #fileInput
4467
+ [accept]="allowedExtensions.join(',')"
4468
+ />
4469
+ @if (loading) {
4470
+ <div class="progress">
4471
+ <div class="progress-bar" [style.width.%]="progress"></div>
4472
+ </div>
4473
+ }
4474
+ `, isInline: true, styles: [":host{display:inline-flex;width:100%;min-width:0;cursor:pointer}:host .progress{position:absolute;left:0;bottom:0;right:0;height:2px;background-color:var(--mecx-color-gray-300);width:100%}:host .progress .progress-bar{background-color:var(--mecx-color-success-main);height:100%;transition:width .2s}:host:focus-visible,:host:focus{outline:none}:host .mecx-input-upload-value{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:24px}:host .mecx-input-upload-value.has-value{color:var(--mecx-color-gray-900)}:host.mecx-input-upload-disabled .mecx-input-upload-value{color:var(--mecx-color-gray-400)!important}:host .file-input{display:none}\n"] }); }
3934
4475
  }
3935
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalComponent, decorators: [{
4476
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyInputUploadComponent, decorators: [{
3936
4477
  type: Component,
3937
- args: [{ encapsulation: ViewEncapsulation.None, selector: 'monkey-modal', template: `
3938
- <div class="mecx-modal-header">
3939
- <div class="mecx-modal-header-group">
3940
- <div class="mecx-modal-header-title">
3941
- @if (modalRef?.icon) {
3942
- <div class="mecx-modal-header-icon">
3943
- <monkey-icon [icon]="modalRef?.icon + ''" first></monkey-icon>
3944
- </div>
3945
- }
3946
- <ng-content select="monkey-modal-title"></ng-content>
3947
- <ng-content select="[monkey-modal-title]"></ng-content>
3948
- </div>
4478
+ args: [{ selector: 'monkey-input-upload', standalone: true, imports: [], template: `
4479
+ <div class="mecx-input-upload-value" [class.has-value]="value">
4480
+ {{ value?.fileName || placeholder }}
4481
+ </div>
4482
+ <input
4483
+ (change)="onFileSelected($event)"
4484
+ type="file"
4485
+ class="file-input"
4486
+ #fileInput
4487
+ [accept]="allowedExtensions.join(',')"
4488
+ />
4489
+ @if (loading) {
4490
+ <div class="progress">
4491
+ <div class="progress-bar" [style.width.%]="progress"></div>
4492
+ </div>
4493
+ }
4494
+ `, providers: [
4495
+ // eslint-disable-next-line no-use-before-define
4496
+ { provide: MonkeyFormFieldControl, useExisting: MonkeyInputUploadComponent }
4497
+ ], host: {
4498
+ '[attr.data-testid]': "'monkey-input-upload'",
4499
+ class: 'mecx-input-upload',
4500
+ '[class.mecx-input-upload-disabled]': '_disabled',
4501
+ '[class.mecx-input-upload-focused]': 'focused',
4502
+ '[attr.id]': 'id',
4503
+ '[attr.tabindex]': 'disabled ? -1 : tabIndex',
4504
+ '(focus)': '_onFocus()',
4505
+ '(blur)': '_onBlur()'
4506
+ }, styles: [":host{display:inline-flex;width:100%;min-width:0;cursor:pointer}:host .progress{position:absolute;left:0;bottom:0;right:0;height:2px;background-color:var(--mecx-color-gray-300);width:100%}:host .progress .progress-bar{background-color:var(--mecx-color-success-main);height:100%;transition:width .2s}:host:focus-visible,:host:focus{outline:none}:host .mecx-input-upload-value{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:24px}:host .mecx-input-upload-value.has-value{color:var(--mecx-color-gray-900)}:host.mecx-input-upload-disabled .mecx-input-upload-value{color:var(--mecx-color-gray-400)!important}:host .file-input{display:none}\n"] }]
4507
+ }], ctorParameters: () => [], propDecorators: { fileInput: [{
4508
+ type: ViewChild,
4509
+ args: ['fileInput']
4510
+ }], progress: [{
4511
+ type: Input
4512
+ }], placeholder: [{
4513
+ type: Input
4514
+ }], maxSizeBytes: [{
4515
+ type: Input
4516
+ }], allowedExtensions: [{
4517
+ type: Input
4518
+ }], loading: [{
4519
+ type: Input,
4520
+ args: [{ transform: booleanAttribute }]
4521
+ }], tabIndex: [{
4522
+ type: Input
4523
+ }], disabled: [{
4524
+ type: Input,
4525
+ args: [{ transform: booleanAttribute }]
4526
+ }], required: [{
4527
+ type: Input,
4528
+ args: [{ transform: booleanAttribute }]
4529
+ }], value: [{
4530
+ type: Input
4531
+ }], onChange: [{
4532
+ type: Output
4533
+ }] } });
3949
4534
 
3950
- <ng-content select="monkey-modal-subtitle"></ng-content>
3951
- <ng-content select="[monkey-modal-subtitle]"></ng-content>
3952
- </div>
3953
- @if (!modalRef?.disableClose) {
3954
- <monkey-icon-button
3955
- size="sm"
3956
- type="tertiary"
3957
- icon="close"
3958
- class="mecx-modal-close"
3959
- (click)="close()"
3960
- >
3961
- </monkey-icon-button>
3962
- }
3963
- </div>
3964
- <ng-content select="monkey-modal-content"></ng-content>
3965
- <ng-content select="[monkey-modal-content]"></ng-content>
3966
- <ng-content select="monkey-modal-actions"></ng-content>
3967
- <ng-content select="[monkey-modal-actions]"></ng-content>
3968
- `, host: {
3969
- class: 'mecx-modal',
3970
- tabindex: '-1',
3971
- '[attr.id]': 'modalRef?.id || null'
3972
- }, styles: ["monkey-modal{width:100%;height:100%;display:flex;flex-direction:column;background:#fff;border-radius:8px}.mecx-modal{opacity:0;animation:modalFadeIn .2s ease-out forwards;transition:opacity .15s ease-in}.mecx-modal.fade-out{animation:modalFadeOut .15s ease-in forwards}@keyframes modalFadeIn{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes modalFadeOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}.mecx-modal-header{display:flex;gap:12px;align-items:flex-start;justify-content:space-between;border-bottom:1px solid var(--mecx-color-gray-200);padding:12px;position:relative}.mecx-modal-header-group{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:4px}.mecx-modal-header-title{display:flex;gap:8px;align-items:center;justify-content:flex-start}.mecx-modal-header-icon{padding:8px;display:flex;align-items:center;justify-content:center;background:var(--mecx-color-gray-100);border-radius:8px;font-size:24px;color:var(--mecx-color-gray-900)}.mecx-modal-title{font-size:18px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.54px;color:var(--mecx-color-gray-900)}.mecx-modal-subtitle{font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px;color:var(--mecx-color-gray-700)}.mecx-modal-content{display:block;flex-grow:1;box-sizing:border-box;overflow:auto;max-height:65vh;padding:12px;scrollbar-color:var(--mecx-color-gray-400) transparent}.mecx-modal-actions{display:flex;flex-wrap:wrap;gap:8px;border-top:1px solid var(--mecx-color-gray-200);padding:12px}.mecx-modal-actions.align-start{justify-content:flex-start}.mecx-modal-actions.align-center{justify-content:center}.mecx-modal-actions.align-end{justify-content:flex-end}.mecx-modal-overlay{background:#00000052}.monkey-modal-panel{padding:16px}.monkey-modal-panel.monkey-modal-fullscreen{width:100%!important;max-width:100%!important;height:100%!important;max-height:100%!important;padding:0}.monkey-modal-panel.monkey-modal-fullscreen monkey-modal{border-radius:0}.monkey-modal-panel.monkey-modal-fullscreen monkey-modal .mecx-modal-content{max-height:100%}\n"] }]
3973
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.OverlayRef, decorators: [{
3974
- type: Optional
3975
- }] }, { type: MonkeyModalRef, decorators: [{
3976
- type: Optional
3977
- }] }] });
4535
+ /** ************************
4536
+ * Copyright Monkey Exchange. All Rights Reserved
4537
+ * This style guide was developed by Monkey Exchange Team
4538
+ * MIT Licence
4539
+ ************************* */
3978
4540
 
3979
4541
  /** ************************
3980
4542
  * Copyright Monkey Exchange. All Rights Reserved
3981
4543
  * This style guide was developed by Monkey Exchange Team
3982
4544
  * MIT Licence
3983
4545
  ************************* */
3984
- const MECX_MODAL_DATA = new InjectionToken('mecxModalData');
3985
- const MECX_MODAL_DEFAULT_CONFIG = new InjectionToken('mecxModalDefaultConfig');
3986
- const MECX_MODAL_CONFIRMATION_CONFIG = new InjectionToken('mecxModalConfirmationConfig');
3987
- /**
3988
- * @license
3989
- * Copyright Google LLC All Rights Reserved.
3990
- *
3991
- * Use of this source code is governed by an MIT-style license that can be
3992
- * found in the LICENSE file at https://angular.dev/license
3993
- */
3994
- function reverseForEach(items, callback) {
3995
- let i = items.length;
3996
- // eslint-disable-next-line no-plusplus
3997
- while (i--) {
3998
- callback(items[i]);
4546
+ class MonkeyModalActionsDirective {
4547
+ constructor() {
4548
+ this.mkAlign = 'end';
4549
+ this.id = inject(IdGenerator).getId('monkey-modal-actions-');
3999
4550
  }
4551
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalActionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
4552
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyModalActionsDirective, selector: "monkey-modal-actions, [monkey-modal-actions]", inputs: { mkAlign: "mkAlign" }, host: { properties: { "class": "'mecx-modal-actions align-'+mkAlign", "attr.id": "id || null" } }, ngImport: i0 }); }
4000
4553
  }
4554
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalActionsDirective, decorators: [{
4555
+ type: Directive,
4556
+ args: [{
4557
+ selector: 'monkey-modal-actions, [monkey-modal-actions]',
4558
+ host: {
4559
+ '[class]': `'mecx-modal-actions align-'+mkAlign`,
4560
+ '[attr.id]': 'id || null'
4561
+ }
4562
+ }]
4563
+ }], propDecorators: { mkAlign: [{
4564
+ type: Input
4565
+ }] } });
4001
4566
 
4002
4567
  /** ************************
4003
4568
  * Copyright Monkey Exchange. All Rights Reserved
4004
4569
  * This style guide was developed by Monkey Exchange Team
4005
4570
  * MIT Licence
4006
4571
  ************************* */
4007
- class MonkeyModalDefaultComponent {
4008
- constructor(config, modalRef) {
4009
- this.config = config;
4010
- this.modalRef = modalRef;
4011
- // not to do
4012
- }
4013
- onSubmit() {
4014
- this.modalRef.close(true);
4015
- }
4016
- onClose() {
4017
- this.modalRef.close();
4572
+ class MonkeyModalContentDirective {
4573
+ constructor() {
4574
+ this.id = inject(IdGenerator).getId('monkey-modal-content-');
4018
4575
  }
4019
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalDefaultComponent, deps: [{ token: MECX_MODAL_DEFAULT_CONFIG }, { token: MonkeyModalRef }], target: i0.ɵɵFactoryTarget.Component }); }
4020
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyModalDefaultComponent, selector: "monkey-modal-default", ngImport: i0, template: `
4021
- <monkey-modal>
4022
- <monkey-modal-title [innerHTML]="config.title"></monkey-modal-title>
4023
- <monkey-modal-subtitle [innerHTML]="config.subtitle"></monkey-modal-subtitle>
4024
- <monkey-modal-content [innerHTML]="config.content"></monkey-modal-content>
4025
- <monkey-modal-actions mkAlign="end">
4026
- <monkey-button type="tertiary" (click)="onClose()">{{ config.cancelLabel }}</monkey-button>
4027
- <monkey-button type="primary" (click)="onSubmit()">{{ config.okLabel }}</monkey-button>
4028
- </monkey-modal-actions>
4029
- </monkey-modal>
4030
- `, isInline: true, dependencies: [{ kind: "component", type: MonkeyButtonComponent, selector: "monkey-button", inputs: ["disabled", "size", "type", "id"] }, { kind: "component", type: MonkeyModalComponent, selector: "monkey-modal" }, { kind: "directive", type: MonkeyModalTitleDirective, selector: "monkey-modal-title, [monkey-modal-title]" }, { kind: "directive", type: MonkeyModalSubtitleDirective, selector: "monkey-modal-subtitle, [monkey-modal-subtitle]" }, { kind: "directive", type: MonkeyModalContentDirective, selector: "monkey-modal-content, [monkey-modal-content]" }, { kind: "directive", type: MonkeyModalActionsDirective, selector: "monkey-modal-actions, [monkey-modal-actions]", inputs: ["mkAlign"] }] }); }
4576
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
4577
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyModalContentDirective, selector: "monkey-modal-content, [monkey-modal-content]", host: { properties: { "attr.id": "id || null" }, classAttribute: "mecx-modal-content" }, ngImport: i0 }); }
4031
4578
  }
4032
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalDefaultComponent, decorators: [{
4033
- type: Component,
4579
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalContentDirective, decorators: [{
4580
+ type: Directive,
4034
4581
  args: [{
4035
- selector: 'monkey-modal-default',
4036
- template: `
4037
- <monkey-modal>
4038
- <monkey-modal-title [innerHTML]="config.title"></monkey-modal-title>
4039
- <monkey-modal-subtitle [innerHTML]="config.subtitle"></monkey-modal-subtitle>
4040
- <monkey-modal-content [innerHTML]="config.content"></monkey-modal-content>
4041
- <monkey-modal-actions mkAlign="end">
4042
- <monkey-button type="tertiary" (click)="onClose()">{{ config.cancelLabel }}</monkey-button>
4043
- <monkey-button type="primary" (click)="onSubmit()">{{ config.okLabel }}</monkey-button>
4044
- </monkey-modal-actions>
4045
- </monkey-modal>
4046
- `
4582
+ selector: 'monkey-modal-content, [monkey-modal-content]',
4583
+ host: {
4584
+ class: 'mecx-modal-content',
4585
+ '[attr.id]': 'id || null'
4586
+ }
4047
4587
  }]
4048
- }], ctorParameters: () => [{ type: undefined, decorators: [{
4049
- type: Inject,
4050
- args: [MECX_MODAL_DEFAULT_CONFIG]
4051
- }] }, { type: MonkeyModalRef, decorators: [{
4052
- type: Inject,
4053
- args: [MonkeyModalRef]
4054
- }] }] });
4588
+ }] });
4055
4589
 
4056
- class MonkeyModalConfirmationComponent {
4057
- constructor(config, modalRef) {
4058
- this.config = config;
4059
- this.modalRef = modalRef;
4060
- // not to do
4061
- }
4062
- onSubmit() {
4063
- this.modalRef.close(true);
4064
- }
4065
- onClose() {
4066
- this.modalRef.close();
4590
+ /** ************************
4591
+ * Copyright Monkey Exchange. All Rights Reserved
4592
+ * This style guide was developed by Monkey Exchange Team
4593
+ * MIT Licence
4594
+ ************************* */
4595
+ class MonkeyModalSubtitleDirective {
4596
+ constructor() {
4597
+ this.id = inject(IdGenerator).getId('monkey-modal-subtitle-');
4067
4598
  }
4068
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalConfirmationComponent, deps: [{ token: MECX_MODAL_CONFIRMATION_CONFIG }, { token: MonkeyModalRef }], target: i0.ɵɵFactoryTarget.Component }); }
4069
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyModalConfirmationComponent, selector: "monkey-modal-confirmation", ngImport: i0, template: `
4070
- <monkey-modal class="modal-confirmation">
4071
- <monkey-modal-content>
4072
- @if (config.icon) {
4073
- <div class="modal-confirmation-icon {{ config.type }}">
4074
- <monkey-icon [icon]="config.icon" size="xxl"></monkey-icon>
4075
- </div>
4076
- }
4077
- <div class="confirmation-title" [innerHTML]="config.title"></div>
4078
- <div class="confirmation-description" [innerHTML]="config.content"></div>
4079
- </monkey-modal-content>
4080
- <monkey-modal-actions>
4081
- <monkey-button type="tertiary" (click)="onClose()">{{ config.cancelLabel }}</monkey-button>
4082
- <monkey-button type="primary" (click)="onSubmit()">{{ config.okLabel }}</monkey-button>
4083
- </monkey-modal-actions>
4084
- </monkey-modal>
4085
- `, isInline: true, styles: [".modal-confirmation .mecx-modal-header{border:none}.modal-confirmation .confirmation-title{color:var(--mecx-color-gray-900);text-align:center;font-size:18px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.54px;margin-bottom:8px}.modal-confirmation .confirmation-description{color:var(--mecx-color-gray-700);text-align:center;font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px;margin-bottom:24px}.modal-confirmation .modal-confirmation-icon{width:80px;height:80px;border-radius:50%;display:flex;margin:0 auto 16px;align-items:center;justify-content:center;background-color:var(--mecx-color-gray-50)}.modal-confirmation .modal-confirmation-icon monkey-icon{color:var(--mecx-color-gray-900)}.modal-confirmation .modal-confirmation-icon.warning{background-color:var(--mecx-color-warning-100)}.modal-confirmation .modal-confirmation-icon.warning monkey-icon{color:var(--mecx-color-warning-500)}.modal-confirmation .modal-confirmation-icon.error{background-color:var(--mecx-color-error-100)}.modal-confirmation .modal-confirmation-icon.error monkey-icon{color:var(--mecx-color-error-500)}.modal-confirmation .modal-confirmation-icon.success{background-color:var(--mecx-color-success-100)}.modal-confirmation .modal-confirmation-icon.success monkey-icon{color:var(--mecx-color-success-500)}\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: MonkeyModalComponent, selector: "monkey-modal" }, { kind: "directive", type: MonkeyModalContentDirective, selector: "monkey-modal-content, [monkey-modal-content]" }, { kind: "directive", type: MonkeyModalActionsDirective, selector: "monkey-modal-actions, [monkey-modal-actions]", inputs: ["mkAlign"] }], encapsulation: i0.ViewEncapsulation.None }); }
4599
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalSubtitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
4600
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyModalSubtitleDirective, selector: "monkey-modal-subtitle, [monkey-modal-subtitle]", host: { properties: { "attr.id": "id || null" }, classAttribute: "mecx-modal-subtitle" }, ngImport: i0 }); }
4086
4601
  }
4087
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalConfirmationComponent, decorators: [{
4088
- type: Component,
4089
- args: [{ selector: 'monkey-modal-confirmation', encapsulation: ViewEncapsulation.None, template: `
4090
- <monkey-modal class="modal-confirmation">
4091
- <monkey-modal-content>
4092
- @if (config.icon) {
4093
- <div class="modal-confirmation-icon {{ config.type }}">
4094
- <monkey-icon [icon]="config.icon" size="xxl"></monkey-icon>
4095
- </div>
4096
- }
4097
- <div class="confirmation-title" [innerHTML]="config.title"></div>
4098
- <div class="confirmation-description" [innerHTML]="config.content"></div>
4099
- </monkey-modal-content>
4100
- <monkey-modal-actions>
4101
- <monkey-button type="tertiary" (click)="onClose()">{{ config.cancelLabel }}</monkey-button>
4102
- <monkey-button type="primary" (click)="onSubmit()">{{ config.okLabel }}</monkey-button>
4103
- </monkey-modal-actions>
4104
- </monkey-modal>
4105
- `, styles: [".modal-confirmation .mecx-modal-header{border:none}.modal-confirmation .confirmation-title{color:var(--mecx-color-gray-900);text-align:center;font-size:18px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.54px;margin-bottom:8px}.modal-confirmation .confirmation-description{color:var(--mecx-color-gray-700);text-align:center;font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px;margin-bottom:24px}.modal-confirmation .modal-confirmation-icon{width:80px;height:80px;border-radius:50%;display:flex;margin:0 auto 16px;align-items:center;justify-content:center;background-color:var(--mecx-color-gray-50)}.modal-confirmation .modal-confirmation-icon monkey-icon{color:var(--mecx-color-gray-900)}.modal-confirmation .modal-confirmation-icon.warning{background-color:var(--mecx-color-warning-100)}.modal-confirmation .modal-confirmation-icon.warning monkey-icon{color:var(--mecx-color-warning-500)}.modal-confirmation .modal-confirmation-icon.error{background-color:var(--mecx-color-error-100)}.modal-confirmation .modal-confirmation-icon.error monkey-icon{color:var(--mecx-color-error-500)}.modal-confirmation .modal-confirmation-icon.success{background-color:var(--mecx-color-success-100)}.modal-confirmation .modal-confirmation-icon.success monkey-icon{color:var(--mecx-color-success-500)}\n"] }]
4106
- }], ctorParameters: () => [{ type: undefined, decorators: [{
4107
- type: Inject,
4108
- args: [MECX_MODAL_CONFIRMATION_CONFIG]
4109
- }] }, { type: MonkeyModalRef, decorators: [{
4110
- type: Inject,
4111
- args: [MonkeyModalRef]
4112
- }] }] });
4602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalSubtitleDirective, decorators: [{
4603
+ type: Directive,
4604
+ args: [{
4605
+ selector: 'monkey-modal-subtitle, [monkey-modal-subtitle]',
4606
+ host: {
4607
+ class: 'mecx-modal-subtitle',
4608
+ '[attr.id]': 'id || null'
4609
+ }
4610
+ }]
4611
+ }] });
4113
4612
 
4114
4613
  /** ************************
4115
4614
  * Copyright Monkey Exchange. All Rights Reserved
4116
4615
  * This style guide was developed by Monkey Exchange Team
4117
4616
  * MIT Licence
4118
4617
  ************************* */
4119
- class MonkeyModalModule {
4120
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4121
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalModule, declarations: [MonkeyModalComponent,
4122
- MonkeyModalDefaultComponent,
4123
- MonkeyModalConfirmationComponent,
4124
- MonkeyModalTitleDirective,
4125
- MonkeyModalSubtitleDirective,
4126
- MonkeyModalContentDirective,
4127
- MonkeyModalActionsDirective], imports: [CommonModule, MonkeyButtonComponent, MonkeyIconButtonComponent, MonkeyIconComponent], exports: [MonkeyModalComponent,
4128
- MonkeyModalTitleDirective,
4129
- MonkeyModalSubtitleDirective,
4130
- MonkeyModalContentDirective,
4131
- MonkeyModalActionsDirective] }); }
4132
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalModule, imports: [CommonModule, MonkeyButtonComponent, MonkeyIconButtonComponent, MonkeyIconComponent] }); }
4618
+ class MonkeyModalTitleDirective {
4619
+ constructor() {
4620
+ this.id = inject(IdGenerator).getId('monkey-modal-title-');
4621
+ }
4622
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
4623
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyModalTitleDirective, selector: "monkey-modal-title, [monkey-modal-title]", host: { properties: { "attr.id": "id || null" }, classAttribute: "mecx-modal-title" }, ngImport: i0 }); }
4133
4624
  }
4134
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalModule, decorators: [{
4135
- type: NgModule,
4625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalTitleDirective, decorators: [{
4626
+ type: Directive,
4136
4627
  args: [{
4137
- imports: [CommonModule, MonkeyButtonComponent, MonkeyIconButtonComponent, MonkeyIconComponent],
4138
- declarations: [
4139
- MonkeyModalComponent,
4140
- MonkeyModalDefaultComponent,
4141
- MonkeyModalConfirmationComponent,
4142
- MonkeyModalTitleDirective,
4143
- MonkeyModalSubtitleDirective,
4144
- MonkeyModalContentDirective,
4145
- MonkeyModalActionsDirective
4146
- ],
4147
- exports: [
4148
- MonkeyModalComponent,
4149
- MonkeyModalTitleDirective,
4150
- MonkeyModalSubtitleDirective,
4151
- MonkeyModalContentDirective,
4152
- MonkeyModalActionsDirective
4153
- ]
4628
+ selector: 'monkey-modal-title, [monkey-modal-title]',
4629
+ host: {
4630
+ class: 'mecx-modal-title',
4631
+ '[attr.id]': 'id || null'
4632
+ }
4154
4633
  }]
4155
4634
  }] });
4156
4635
 
@@ -4159,456 +4638,508 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
4159
4638
  * This style guide was developed by Monkey Exchange Team
4160
4639
  * MIT Licence
4161
4640
  ************************* */
4162
- class MonkeyModalService {
4641
+ class MonkeyModalConfig {
4163
4642
  constructor() {
4164
- this._idGenerator = inject(IdGenerator);
4165
- this._injector = inject(Injector);
4166
- this._overlay = inject(Overlay);
4167
- this._openDialogsAtThisLevel = [];
4168
- this._parentDialog = inject(MonkeyModalService, { optional: true, skipSelf: true });
4169
- }
4170
- get openDialogs() {
4171
- return this._parentDialog ? this._parentDialog.openDialogs : this._openDialogsAtThisLevel;
4643
+ this.panelClass = '';
4644
+ this.hasBackdrop = true;
4645
+ this.backdropClass = 'mecx-modal-overlay';
4646
+ this.disableClose = false;
4647
+ this.disableBackdropClose = false;
4648
+ this.fullscreen = false;
4649
+ this.position = 'center-center';
4650
+ this.data = null;
4651
+ this.closeOnNavigation = true;
4172
4652
  }
4173
- getOverlayConfig(config) {
4174
- let positionStrategy;
4175
- const marginStrategy = '20px';
4176
- if (config.position === 'left-top') {
4177
- positionStrategy = this._overlay.position().global().left(marginStrategy).top(marginStrategy);
4178
- }
4179
- else if (config.position === 'center-top') {
4180
- positionStrategy = this._overlay.position().global().centerHorizontally().top(marginStrategy);
4181
- }
4182
- else if (config.position === 'right-top') {
4183
- positionStrategy = this._overlay
4184
- .position()
4185
- .global()
4186
- .right(marginStrategy)
4187
- .top(marginStrategy);
4188
- }
4189
- else if (config.position === 'left-center') {
4190
- positionStrategy = this._overlay.position().global().left(marginStrategy).centerVertically();
4191
- }
4192
- else if (config.position === 'center-center') {
4193
- positionStrategy = this._overlay.position().global().centerHorizontally().centerVertically();
4194
- }
4195
- else if (config.position === 'right-center') {
4196
- positionStrategy = this._overlay.position().global().right(marginStrategy).centerVertically();
4197
- }
4198
- else if (config.position === 'left-bottom') {
4199
- positionStrategy = this._overlay
4200
- .position()
4201
- .global()
4202
- .left(marginStrategy)
4203
- .bottom(marginStrategy);
4204
- }
4205
- else if (config.position === 'center-bottom') {
4206
- positionStrategy = this._overlay.position().global().centerHorizontally().bottom('20px');
4207
- }
4208
- else if (config.position === 'right-bottom') {
4209
- positionStrategy = this._overlay
4210
- .position()
4211
- .global()
4212
- .right(marginStrategy)
4213
- .bottom(marginStrategy);
4214
- }
4215
- let panelClass = ['monkey-modal-panel'];
4216
- if (config.fullscreen) {
4217
- panelClass.push('monkey-modal-fullscreen');
4218
- }
4219
- if (Array.isArray(config.panelClass)) {
4220
- panelClass = [...panelClass, ...config.panelClass];
4221
- }
4222
- else {
4223
- panelClass.push(config.panelClass);
4224
- }
4225
- const state = new OverlayConfig({
4226
- positionStrategy,
4227
- scrollStrategy: this._overlay.scrollStrategies.block(),
4228
- panelClass,
4229
- hasBackdrop: config.hasBackdrop,
4230
- maxWidth: config.maxWidth,
4231
- maxHeight: config.maxHeight,
4232
- disposeOnNavigation: config.closeOnNavigation
4233
- });
4234
- if (config.backdropClass) {
4235
- state.backdropClass = config.backdropClass;
4236
- }
4237
- if (config.maxWidth) {
4238
- state.width = '100%';
4239
- }
4240
- if (config.maxHeight) {
4241
- state.height = '100%';
4653
+ }
4654
+
4655
+ /** ************************
4656
+ * Copyright Monkey Exchange. All Rights Reserved
4657
+ * This style guide was developed by Monkey Exchange Team
4658
+ * MIT Licence
4659
+ ************************* */
4660
+ class MonkeyModalRef {
4661
+ constructor(overlayRef, config) {
4662
+ this.overlayRef = overlayRef;
4663
+ this.config = config;
4664
+ this.closed = new Subject();
4665
+ this.id = config.id;
4666
+ this.icon = config.icon;
4667
+ this.disableClose = config.disableClose;
4668
+ this.disableBackdropClose = config.disableBackdropClose;
4669
+ this.closeOnNavigation = config.closeOnNavigation;
4670
+ this.backdropClick = overlayRef.backdropClick();
4671
+ this.keydownEvents = overlayRef.keydownEvents();
4672
+ this.outsidePointerEvents = overlayRef.outsidePointerEvents();
4673
+ if (!this.disableBackdropClose) {
4674
+ this.keydownEvents.subscribe((event) => {
4675
+ if (event.key === 'Escape' && !this.disableClose && !hasModifierKey(event)) {
4676
+ event.preventDefault();
4677
+ this.close(undefined);
4678
+ }
4679
+ });
4680
+ this.backdropClick.subscribe(() => {
4681
+ if (!this.disableClose) {
4682
+ this.close(undefined);
4683
+ }
4684
+ });
4242
4685
  }
4243
- return state;
4244
4686
  }
4245
- createInjector(config, dialogRef, overlayRef, fallbackInjector) {
4246
- const providers = [
4247
- { provide: OverlayRef, useValue: overlayRef },
4248
- { provide: MonkeyModalRef, useValue: dialogRef },
4249
- { provide: MECX_MODAL_DATA, useValue: config.data }
4250
- ];
4251
- if (config.providers) {
4252
- providers.push(...config.providers);
4687
+ close(result) {
4688
+ if (this.componentInstance) {
4689
+ const closedSubject = this.closed;
4690
+ const active = document.activeElement;
4691
+ if (active && this.componentElement.contains(active)) {
4692
+ active.blur();
4693
+ }
4694
+ this.componentElement.querySelectorAll('monkey-modal')[0].classList.add('fade-out');
4695
+ setTimeout(() => {
4696
+ this.overlayRef.detach();
4697
+ }, 150);
4698
+ closedSubject.next(result);
4699
+ closedSubject.complete();
4700
+ // eslint-disable-next-line no-multi-assign
4701
+ this.componentInstance = null;
4253
4702
  }
4254
- return Injector.create({ parent: fallbackInjector, providers });
4255
4703
  }
4256
- open(component, config) {
4257
- const defaultConfig = new MonkeyModalConfig();
4258
- config = { ...defaultConfig, ...config };
4259
- config.id = this._idGenerator.getId('monkey-modal-');
4260
- const overlayConfig = this.getOverlayConfig(config);
4261
- const overlayRef = this._overlay.create(overlayConfig);
4262
- const modalRef = new MonkeyModalRef(overlayRef, config);
4263
- const injector = this.createInjector(config, modalRef, overlayRef, this._injector);
4264
- const componentPortal = new ComponentPortal(component, null, injector);
4265
- const componentRef = overlayRef.attach(componentPortal);
4266
- const componentElement = componentRef.location.nativeElement;
4267
- componentElement.style.width = '100%';
4268
- componentElement.style.height = '100%';
4269
- modalRef.componentElement = componentElement;
4270
- modalRef.componentInstance = componentRef.instance;
4271
- this.openDialogs.push(modalRef);
4272
- return modalRef;
4704
+ afterClosed() {
4705
+ return this.closed;
4273
4706
  }
4274
- openDefault(params, config) {
4275
- config.providers = [{ provide: MECX_MODAL_DEFAULT_CONFIG, useValue: params }];
4276
- config.icon = config.icon ? config.icon : 'help';
4277
- return this.open(MonkeyModalDefaultComponent, config);
4707
+ }
4708
+
4709
+ class MonkeyModalComponent {
4710
+ constructor(_elementRef, overlayRef, modalRef) {
4711
+ this._elementRef = _elementRef;
4712
+ this.overlayRef = overlayRef;
4713
+ this.modalRef = modalRef;
4714
+ this._navigationSubscription = null;
4715
+ this._router = inject(Router);
4716
+ // not to do
4278
4717
  }
4279
- openConfirmation(params, config) {
4280
- config.providers = [{ provide: MECX_MODAL_CONFIRMATION_CONFIG, useValue: params }];
4281
- return this.open(MonkeyModalConfirmationComponent, config);
4718
+ ngAfterViewInit() {
4719
+ if (this._elementRef) {
4720
+ this._elementRef.nativeElement.focus();
4721
+ }
4722
+ if (this.modalRef?.closeOnNavigation) {
4723
+ this._navigationSubscription = this._router.events.subscribe((event) => {
4724
+ if (event instanceof NavigationStart) {
4725
+ this.close();
4726
+ }
4727
+ });
4728
+ }
4282
4729
  }
4283
- closeAll() {
4284
- reverseForEach(this.openDialogs, (dialog) => {
4285
- return dialog.close();
4286
- });
4287
- this.openDialogs.splice(0, this.openDialogs.length);
4730
+ ngOnDestroy() {
4731
+ if (this._navigationSubscription) {
4732
+ this._navigationSubscription.unsubscribe();
4733
+ this._navigationSubscription = null;
4734
+ }
4288
4735
  }
4289
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4290
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalService, providedIn: 'root' }); }
4736
+ close() {
4737
+ const element = this._elementRef.nativeElement;
4738
+ element.classList.add('fade-out');
4739
+ setTimeout(() => {
4740
+ this.modalRef?.close();
4741
+ }, 150);
4742
+ }
4743
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.OverlayRef, optional: true }, { token: MonkeyModalRef, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
4744
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyModalComponent, selector: "monkey-modal", host: { attributes: { "tabindex": "-1" }, properties: { "attr.id": "modalRef?.id || null" }, classAttribute: "mecx-modal" }, ngImport: i0, template: `
4745
+ <div class="mecx-modal-header">
4746
+ <div class="mecx-modal-header-group">
4747
+ <div class="mecx-modal-header-title">
4748
+ @if (modalRef?.icon) {
4749
+ <div class="mecx-modal-header-icon">
4750
+ <monkey-icon [icon]="modalRef?.icon + ''" first></monkey-icon>
4751
+ </div>
4752
+ }
4753
+ <ng-content select="monkey-modal-title"></ng-content>
4754
+ <ng-content select="[monkey-modal-title]"></ng-content>
4755
+ </div>
4756
+
4757
+ <ng-content select="monkey-modal-subtitle"></ng-content>
4758
+ <ng-content select="[monkey-modal-subtitle]"></ng-content>
4759
+ </div>
4760
+ @if (!modalRef?.disableClose) {
4761
+ <monkey-icon-button
4762
+ size="sm"
4763
+ type="tertiary"
4764
+ icon="close"
4765
+ class="mecx-modal-close"
4766
+ (click)="close()"
4767
+ >
4768
+ </monkey-icon-button>
4769
+ }
4770
+ </div>
4771
+ <ng-content select="monkey-modal-content"></ng-content>
4772
+ <ng-content select="[monkey-modal-content]"></ng-content>
4773
+ <ng-content select="monkey-modal-actions"></ng-content>
4774
+ <ng-content select="[monkey-modal-actions]"></ng-content>
4775
+ `, isInline: true, styles: ["monkey-modal{width:100%;height:100%;display:flex;flex-direction:column;background:#fff;border-radius:8px}.mecx-modal{opacity:0;animation:modal-fade-in .2s ease-out forwards;transition:opacity .15s ease-in}.mecx-modal.fade-out{animation:modal-fade-out .15s ease-in forwards}@keyframes modal-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes modal-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}.mecx-modal-header{display:flex;gap:12px;align-items:flex-start;justify-content:space-between;border-bottom:1px solid var(--mecx-color-gray-200);padding:12px;position:relative}.mecx-modal-header-group{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:4px}.mecx-modal-header-title{display:flex;gap:8px;align-items:center;justify-content:flex-start}.mecx-modal-header-icon{padding:8px;display:flex;align-items:center;justify-content:center;background:var(--mecx-color-gray-100);border-radius:8px;font-size:24px;color:var(--mecx-color-gray-900)}.mecx-modal-title{font-size:18px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.54px;color:var(--mecx-color-gray-900)}.mecx-modal-subtitle{font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px;color:var(--mecx-color-gray-700)}.mecx-modal-content{display:block;flex-grow:1;box-sizing:border-box;overflow:auto;max-height:65vh;padding:12px;scrollbar-color:var(--mecx-color-gray-400) transparent}.mecx-modal-actions{display:flex;flex-wrap:wrap;gap:8px;border-top:1px solid var(--mecx-color-gray-200);padding:12px}.mecx-modal-actions.align-start{justify-content:flex-start}.mecx-modal-actions.align-center{justify-content:center}.mecx-modal-actions.align-end{justify-content:flex-end}.mecx-modal-overlay{background:#00000052}.monkey-modal-panel{padding:16px}.monkey-modal-panel.monkey-modal-fullscreen{width:100%!important;max-width:100%!important;height:100%!important;max-height:100%!important;padding:0}.monkey-modal-panel.monkey-modal-fullscreen monkey-modal{border-radius:0}.monkey-modal-panel.monkey-modal-fullscreen monkey-modal .mecx-modal-content{max-height:100%}\n"], dependencies: [{ kind: "component", type: MonkeyIconButtonComponent, selector: "monkey-icon-button", inputs: ["type", "size", "disabled", "icon", "id"] }, { kind: "component", type: MonkeyIconComponent, selector: "monkey-icon", inputs: ["icon", "size", "id"] }], encapsulation: i0.ViewEncapsulation.None }); }
4291
4776
  }
4292
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalService, decorators: [{
4293
- type: Injectable,
4294
- args: [{ providedIn: 'root' }]
4295
- }] });
4777
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalComponent, decorators: [{
4778
+ type: Component,
4779
+ args: [{ encapsulation: ViewEncapsulation.None, selector: 'monkey-modal', template: `
4780
+ <div class="mecx-modal-header">
4781
+ <div class="mecx-modal-header-group">
4782
+ <div class="mecx-modal-header-title">
4783
+ @if (modalRef?.icon) {
4784
+ <div class="mecx-modal-header-icon">
4785
+ <monkey-icon [icon]="modalRef?.icon + ''" first></monkey-icon>
4786
+ </div>
4787
+ }
4788
+ <ng-content select="monkey-modal-title"></ng-content>
4789
+ <ng-content select="[monkey-modal-title]"></ng-content>
4790
+ </div>
4791
+
4792
+ <ng-content select="monkey-modal-subtitle"></ng-content>
4793
+ <ng-content select="[monkey-modal-subtitle]"></ng-content>
4794
+ </div>
4795
+ @if (!modalRef?.disableClose) {
4796
+ <monkey-icon-button
4797
+ size="sm"
4798
+ type="tertiary"
4799
+ icon="close"
4800
+ class="mecx-modal-close"
4801
+ (click)="close()"
4802
+ >
4803
+ </monkey-icon-button>
4804
+ }
4805
+ </div>
4806
+ <ng-content select="monkey-modal-content"></ng-content>
4807
+ <ng-content select="[monkey-modal-content]"></ng-content>
4808
+ <ng-content select="monkey-modal-actions"></ng-content>
4809
+ <ng-content select="[monkey-modal-actions]"></ng-content>
4810
+ `, host: {
4811
+ class: 'mecx-modal',
4812
+ tabindex: '-1',
4813
+ '[attr.id]': 'modalRef?.id || null'
4814
+ }, styles: ["monkey-modal{width:100%;height:100%;display:flex;flex-direction:column;background:#fff;border-radius:8px}.mecx-modal{opacity:0;animation:modal-fade-in .2s ease-out forwards;transition:opacity .15s ease-in}.mecx-modal.fade-out{animation:modal-fade-out .15s ease-in forwards}@keyframes modal-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes modal-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}.mecx-modal-header{display:flex;gap:12px;align-items:flex-start;justify-content:space-between;border-bottom:1px solid var(--mecx-color-gray-200);padding:12px;position:relative}.mecx-modal-header-group{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:4px}.mecx-modal-header-title{display:flex;gap:8px;align-items:center;justify-content:flex-start}.mecx-modal-header-icon{padding:8px;display:flex;align-items:center;justify-content:center;background:var(--mecx-color-gray-100);border-radius:8px;font-size:24px;color:var(--mecx-color-gray-900)}.mecx-modal-title{font-size:18px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.54px;color:var(--mecx-color-gray-900)}.mecx-modal-subtitle{font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px;color:var(--mecx-color-gray-700)}.mecx-modal-content{display:block;flex-grow:1;box-sizing:border-box;overflow:auto;max-height:65vh;padding:12px;scrollbar-color:var(--mecx-color-gray-400) transparent}.mecx-modal-actions{display:flex;flex-wrap:wrap;gap:8px;border-top:1px solid var(--mecx-color-gray-200);padding:12px}.mecx-modal-actions.align-start{justify-content:flex-start}.mecx-modal-actions.align-center{justify-content:center}.mecx-modal-actions.align-end{justify-content:flex-end}.mecx-modal-overlay{background:#00000052}.monkey-modal-panel{padding:16px}.monkey-modal-panel.monkey-modal-fullscreen{width:100%!important;max-width:100%!important;height:100%!important;max-height:100%!important;padding:0}.monkey-modal-panel.monkey-modal-fullscreen monkey-modal{border-radius:0}.monkey-modal-panel.monkey-modal-fullscreen monkey-modal .mecx-modal-content{max-height:100%}\n"] }]
4815
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.OverlayRef, decorators: [{
4816
+ type: Optional
4817
+ }] }, { type: MonkeyModalRef, decorators: [{
4818
+ type: Optional
4819
+ }] }] });
4296
4820
 
4297
4821
  /** ************************
4298
4822
  * Copyright Monkey Exchange. All Rights Reserved
4299
4823
  * This style guide was developed by Monkey Exchange Team
4300
4824
  * MIT Licence
4301
4825
  ************************* */
4826
+ const MECX_MODAL_DATA = new InjectionToken('mecxModalData');
4827
+ const MECX_MODAL_DEFAULT_CONFIG = new InjectionToken('mecxModalDefaultConfig');
4828
+ const MECX_MODAL_CONFIRMATION_CONFIG = new InjectionToken('mecxModalConfirmationConfig');
4829
+ /**
4830
+ * @license
4831
+ * Copyright Google LLC All Rights Reserved.
4832
+ *
4833
+ * Use of this source code is governed by an MIT-style license that can be
4834
+ * found in the LICENSE file at https://angular.dev/license
4835
+ */
4836
+ function reverseForEach(items, callback) {
4837
+ let i = items.length;
4838
+ // eslint-disable-next-line no-plusplus
4839
+ while (i--) {
4840
+ callback(items[i]);
4841
+ }
4842
+ }
4302
4843
 
4303
4844
  /** ************************
4304
4845
  * Copyright Monkey Exchange. All Rights Reserved
4305
4846
  * This style guide was developed by Monkey Exchange Team
4306
4847
  * MIT Licence
4307
4848
  ************************* */
4308
- class MonkeyOptionComponent {
4309
- constructor() {
4310
- this.idGenerator = inject(IdGenerator);
4311
- this.disabled = false;
4312
- this.type = 'select';
4313
- this.selected = false;
4314
- this.tabIndex = 0;
4315
- this.id = this.idGenerator.getId('mecx-option-');
4316
- }
4317
- get displayContent() {
4318
- return (this._content?.nativeElement.textContent || '').trim();
4319
- }
4320
- handleAction(event) {
4321
- if (this.disabled) {
4322
- event.stopPropagation();
4323
- event.preventDefault();
4324
- }
4325
- else {
4326
- this.action?.();
4327
- }
4849
+ class MonkeyModalDefaultComponent {
4850
+ constructor(config, modalRef) {
4851
+ this.config = config;
4852
+ this.modalRef = modalRef;
4853
+ // not to do
4328
4854
  }
4329
- onClick(event) {
4330
- this.handleAction(event);
4855
+ onSubmit() {
4856
+ this.modalRef.close(true);
4331
4857
  }
4332
- handleKeyDown(event) {
4333
- const { key } = event;
4334
- if (key === 'Enter' || key === ' ') {
4335
- this.handleAction(event);
4336
- }
4858
+ onClose() {
4859
+ this.modalRef.close();
4337
4860
  }
4338
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4339
- 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], type: "type" }, host: { attributes: { "data-testid": "monkey-option" }, listeners: { "click": "onClick($event)", "keydown": "handleKeyDown($event)" }, properties: { "attr.id": "id", "class.mecx-option-disabled": "disabled", "class.mecx-option-selected": "selected", "attr.tabindex": "disabled ? -1 : tabIndex", "class": "type" }, 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.select:hover{color:var(--mecx-color-gray-900);background-color:var(--mecx-color-gray-100)}monkey-option.select.mecx-option-disabled{color:var(--mecx-color-gray-400);background-color:#fff;cursor:default}monkey-option.select.mecx-option-selected{color:var(--mecx-color-theme-contrast-main);background-color:var(--mecx-color-theme-main)}.ng-animating monkey-option.select.mecx-option-selected{color:var(--mecx-color-gray-900);background-color:var(--mecx-color-gray-100)}monkey-option.radio{display:flex;align-items:center;gap:10px;padding:8px 24px 8px 0;cursor:pointer;border-radius:4px;-webkit-user-select:none;user-select:none;position:relative}monkey-option.radio:before{content:\"\";width:20px;height:20px;border:2px solid var(--mecx-color-gray-600);border-radius:800px;box-sizing:border-box;background-color:var(--mecx-color-white)}monkey-option.radio:focus{outline:unset;outline-offset:1px}monkey-option.radio:focus:before{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}monkey-option.radio.mecx-option-selected:before{border:5px solid var(--mecx-color-theme-main)}monkey-option.radio.mecx-option-disabled{opacity:.5;pointer-events:none}monkey-option.radio.mecx-option-disabled:before{background:var(--mecx-color-white);border-color:var(--mecx-color-gray-400)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
4861
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalDefaultComponent, deps: [{ token: MECX_MODAL_DEFAULT_CONFIG }, { token: MonkeyModalRef }], target: i0.ɵɵFactoryTarget.Component }); }
4862
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MonkeyModalDefaultComponent, selector: "monkey-modal-default", ngImport: i0, template: `
4863
+ <monkey-modal>
4864
+ <monkey-modal-title [innerHTML]="config.title"></monkey-modal-title>
4865
+ <monkey-modal-subtitle [innerHTML]="config.subtitle"></monkey-modal-subtitle>
4866
+ <monkey-modal-content [innerHTML]="config.content"></monkey-modal-content>
4867
+ <monkey-modal-actions mkAlign="end">
4868
+ <monkey-button type="tertiary" (click)="onClose()">{{ config.cancelLabel }}</monkey-button>
4869
+ <monkey-button type="primary" (click)="onSubmit()">{{ config.okLabel }}</monkey-button>
4870
+ </monkey-modal-actions>
4871
+ </monkey-modal>
4872
+ `, isInline: true, dependencies: [{ kind: "component", type: MonkeyButtonComponent, selector: "monkey-button", inputs: ["disabled", "size", "type", "id"] }, { kind: "component", type: MonkeyModalComponent, selector: "monkey-modal" }, { kind: "directive", type: MonkeyModalTitleDirective, selector: "monkey-modal-title, [monkey-modal-title]" }, { kind: "directive", type: MonkeyModalSubtitleDirective, selector: "monkey-modal-subtitle, [monkey-modal-subtitle]" }, { kind: "directive", type: MonkeyModalContentDirective, selector: "monkey-modal-content, [monkey-modal-content]" }, { kind: "directive", type: MonkeyModalActionsDirective, selector: "monkey-modal-actions, [monkey-modal-actions]", inputs: ["mkAlign"] }] }); }
4340
4873
  }
4341
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyOptionComponent, decorators: [{
4874
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalDefaultComponent, decorators: [{
4342
4875
  type: Component,
4343
- args: [{ selector: 'monkey-option', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `<div #content><ng-content /></div>`, encapsulation: ViewEncapsulation.None, host: {
4344
- 'data-testid': 'monkey-option',
4345
- '[attr.id]': 'id',
4346
- class: 'mecx-option',
4347
- '[class.mecx-option-disabled]': 'disabled',
4348
- '[class.mecx-option-selected]': 'selected',
4349
- '[attr.tabindex]': 'disabled ? -1 : tabIndex',
4350
- '[class]': 'type'
4351
- }, 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.select:hover{color:var(--mecx-color-gray-900);background-color:var(--mecx-color-gray-100)}monkey-option.select.mecx-option-disabled{color:var(--mecx-color-gray-400);background-color:#fff;cursor:default}monkey-option.select.mecx-option-selected{color:var(--mecx-color-theme-contrast-main);background-color:var(--mecx-color-theme-main)}.ng-animating monkey-option.select.mecx-option-selected{color:var(--mecx-color-gray-900);background-color:var(--mecx-color-gray-100)}monkey-option.radio{display:flex;align-items:center;gap:10px;padding:8px 24px 8px 0;cursor:pointer;border-radius:4px;-webkit-user-select:none;user-select:none;position:relative}monkey-option.radio:before{content:\"\";width:20px;height:20px;border:2px solid var(--mecx-color-gray-600);border-radius:800px;box-sizing:border-box;background-color:var(--mecx-color-white)}monkey-option.radio:focus{outline:unset;outline-offset:1px}monkey-option.radio:focus:before{outline:2px solid var(--mecx-color-theme-main);outline-offset:1px}monkey-option.radio.mecx-option-selected:before{border:5px solid var(--mecx-color-theme-main)}monkey-option.radio.mecx-option-disabled{opacity:.5;pointer-events:none}monkey-option.radio.mecx-option-disabled:before{background:var(--mecx-color-white);border-color:var(--mecx-color-gray-400)}\n"] }]
4352
- }], propDecorators: { _content: [{
4353
- type: ViewChild,
4354
- args: ['content', { static: true }]
4355
- }], value: [{
4356
- type: Input
4357
- }], disabled: [{
4358
- type: Input,
4359
- args: [{ transform: booleanAttribute }]
4360
- }], type: [{
4361
- type: Input
4362
- }], onClick: [{
4363
- type: HostListener,
4364
- args: ['click', ['$event']]
4365
- }], handleKeyDown: [{
4366
- type: HostListener,
4367
- args: ['keydown', ['$event']]
4368
- }] } });
4369
-
4370
- /** ************************
4371
- * Copyright Monkey Exchange. All Rights Reserved
4372
- * This style guide was developed by Monkey Exchange Team
4373
- * MIT Licence
4374
- ************************* */
4876
+ args: [{
4877
+ selector: 'monkey-modal-default',
4878
+ template: `
4879
+ <monkey-modal>
4880
+ <monkey-modal-title [innerHTML]="config.title"></monkey-modal-title>
4881
+ <monkey-modal-subtitle [innerHTML]="config.subtitle"></monkey-modal-subtitle>
4882
+ <monkey-modal-content [innerHTML]="config.content"></monkey-modal-content>
4883
+ <monkey-modal-actions mkAlign="end">
4884
+ <monkey-button type="tertiary" (click)="onClose()">{{ config.cancelLabel }}</monkey-button>
4885
+ <monkey-button type="primary" (click)="onSubmit()">{{ config.okLabel }}</monkey-button>
4886
+ </monkey-modal-actions>
4887
+ </monkey-modal>
4888
+ `
4889
+ }]
4890
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
4891
+ type: Inject,
4892
+ args: [MECX_MODAL_DEFAULT_CONFIG]
4893
+ }] }, { type: MonkeyModalRef, decorators: [{
4894
+ type: Inject,
4895
+ args: [MonkeyModalRef]
4896
+ }] }] });
4375
4897
 
4376
4898
  /** ************************
4377
4899
  * Copyright Monkey Exchange. All Rights Reserved
4378
4900
  * This style guide was developed by Monkey Exchange Team
4379
4901
  * MIT Licence
4380
4902
  ************************* */
4381
- class MonkeyRadioButtonComponent {
4382
- get classes() {
4383
- return `${this.position} ${this.size}`;
4384
- }
4385
- get disabled() {
4386
- if (this.ngControl && this.ngControl.disabled !== null) {
4387
- return this.ngControl.disabled;
4388
- }
4389
- return this._disabled;
4390
- }
4391
- set disabled(value) {
4392
- this._disabled = value;
4393
- if (this.focused) {
4394
- this.focused = false;
4395
- this.stateChanges.next();
4396
- }
4397
- }
4398
- get required() {
4399
- return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;
4400
- }
4401
- set required(value) {
4402
- this._required = value;
4403
- this.stateChanges.next();
4404
- }
4405
- set value(value) {
4406
- if (this._value !== value) {
4407
- this._value = value;
4408
- this._onChange(value);
4409
- }
4410
- }
4411
- get value() {
4412
- return this._value;
4413
- }
4414
- constructor(changeDetectorRef, formField) {
4415
- this.changeDetectorRef = changeDetectorRef;
4416
- this.formField = formField;
4417
- this.tabIndex = 0;
4418
- this.onChange = new EventEmitter();
4419
- this.onSearch = new EventEmitter();
4420
- this.position = 'horizontal';
4421
- this.size = 'lg';
4422
- this._value = null;
4423
- this._destroyRef = inject(DestroyRef);
4424
- this.idGenerator = inject(IdGenerator);
4425
- this.ngControl = inject(NgControl, { self: true, optional: true });
4426
- this._elementRef = inject(ElementRef);
4427
- this.focused = false;
4428
- this._disabled = false;
4429
- this.id = this.idGenerator.getId('monkey-radiobutton-');
4430
- this.stateChanges = new Subject();
4431
- this.type = 'radio-button';
4432
- this._onChange = () => { };
4433
- this._onTouched = () => { };
4434
- if (this.ngControl) {
4435
- this.ngControl.valueAccessor = this;
4436
- }
4437
- }
4438
- changeSelected() {
4439
- setTimeout(() => {
4440
- if (this.options) {
4441
- this.options.forEach((opt) => {
4442
- opt.selected = opt.value === this.value;
4443
- });
4444
- }
4445
- this.changeDetectorRef.markForCheck();
4446
- });
4447
- }
4448
- initializeOptions() {
4449
- setTimeout(() => {
4450
- this.options?.forEach((option) => {
4451
- option.type = 'radio';
4452
- if (!option.action) {
4453
- option.action = this.selectOption.bind(this, option);
4454
- }
4455
- });
4456
- this.changeDetectorRef.markForCheck();
4457
- }, 0);
4458
- }
4459
- ngAfterContentInit() {
4460
- this.initializeOptions();
4461
- this.options.changes.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
4462
- this.initializeOptions();
4463
- this.changeSelected();
4464
- });
4465
- }
4466
- selectOption(option) {
4467
- if (!option.disabled && !this.disabled) {
4468
- this.value = option.value;
4469
- this._onChange(this.value);
4470
- this.onChange.emit(this.value);
4471
- this.options.forEach((opt) => {
4472
- opt.selected = opt.value === this.value;
4473
- });
4474
- }
4903
+ class MonkeyModalConfirmationComponent {
4904
+ constructor(config, modalRef) {
4905
+ this.config = config;
4906
+ this.modalRef = modalRef;
4907
+ // not to do
4475
4908
  }
4476
- writeValue(value) {
4477
- this.value = value;
4478
- this.changeSelected();
4909
+ onSubmit() {
4910
+ this.modalRef.close(true);
4479
4911
  }
4480
- onContainerClick(event) {
4481
- if (this.disabled)
4482
- return;
4483
- this._elementRef.nativeElement.focus();
4912
+ onClose() {
4913
+ this.modalRef.close();
4484
4914
  }
4485
- _onFocus() {
4486
- if (!this.disabled) {
4487
- this.focused = true;
4488
- this._onTouched();
4489
- this.stateChanges.next();
4915
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalConfirmationComponent, deps: [{ token: MECX_MODAL_CONFIRMATION_CONFIG }, { token: MonkeyModalRef }], target: i0.ɵɵFactoryTarget.Component }); }
4916
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonkeyModalConfirmationComponent, selector: "monkey-modal-confirmation", ngImport: i0, template: `
4917
+ <monkey-modal class="modal-confirmation">
4918
+ <monkey-modal-content>
4919
+ @if (config.icon) {
4920
+ <div class="modal-confirmation-icon {{ config.type }}">
4921
+ <monkey-icon [icon]="config.icon" size="xxl"></monkey-icon>
4922
+ </div>
4490
4923
  }
4491
- }
4492
- _onBlur() {
4493
- this.focused = false;
4494
- this.stateChanges.next();
4495
- }
4496
- registerOnChange(fn) {
4497
- this._onChange = fn;
4498
- }
4499
- registerOnTouched(fn) {
4500
- this._onTouched = fn;
4501
- }
4502
- setDisabledState(isDisabled) {
4503
- this.disabled = isDisabled;
4504
- this.initializeOptions();
4505
- }
4506
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyRadioButtonComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: MonkeyFormFieldComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
4507
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.13", type: MonkeyRadioButtonComponent, isStandalone: true, selector: "monkey-radiobutton", inputs: { tabIndex: "tabIndex", position: "position", size: "size", disabled: ["disabled", "disabled", booleanAttribute], required: ["required", "required", booleanAttribute], value: "value" }, outputs: { onChange: "onChange", onSearch: "onSearch" }, host: { attributes: { "data-testid": "monkey-radiobutton" }, listeners: { "focus": "_onFocus()", "blur": "_onBlur()" }, properties: { "class.mecx-disabled": "disabled", "class.mecx-radiobutton-focused": "focused", "attr.id": "id", "attr.tabindex": "disabled ? -1 : tabIndex", "class": "this.classes" }, classAttribute: "mecx-radiobutton" }, providers: [
4508
- // eslint-disable-next-line no-use-before-define
4509
- { provide: MonkeyFormFieldControl, useExisting: MonkeyRadioButtonComponent }
4510
- ], queries: [{ propertyName: "options", predicate: MonkeyOptionComponent }], ngImport: i0, template: "<ng-content />\n", styles: ["monkey-radiobutton{display:inline-flex;width:100%;min-width:0;position:relative;flex-wrap:wrap}monkey-radiobutton:focus-visible,monkey-radiobutton:focus{outline:none}monkey-radiobutton.vertical{flex-direction:column}monkey-radiobutton.mecx-disabled monkey-option{opacity:.5;pointer-events:none}monkey-radiobutton.mecx-disabled monkey-option:before{background:var(--mecx-color-white);border-color:var(--mecx-color-gray-400)}monkey-radiobutton.mecx-form-field-invalid{background:var(--mecx-color-error-700)}monkey-radiobutton.md monkey-option:before{width:16px;height:16px}monkey-radiobutton.sm monkey-option:before{width:14px;height:14px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
4924
+ <div class="confirmation-title" [innerHTML]="config.title"></div>
4925
+ <div class="confirmation-description" [innerHTML]="config.content"></div>
4926
+ </monkey-modal-content>
4927
+ <monkey-modal-actions>
4928
+ <monkey-button type="tertiary" (click)="onClose()">{{ config.cancelLabel }}</monkey-button>
4929
+ <monkey-button type="primary" (click)="onSubmit()">{{ config.okLabel }}</monkey-button>
4930
+ </monkey-modal-actions>
4931
+ </monkey-modal>
4932
+ `, isInline: true, styles: [".modal-confirmation .mecx-modal-header{border:none}.modal-confirmation .confirmation-title{color:var(--mecx-color-gray-900);text-align:center;font-size:18px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.54px;margin-bottom:8px}.modal-confirmation .confirmation-description{color:var(--mecx-color-gray-700);text-align:center;font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px;margin-bottom:24px}.modal-confirmation .modal-confirmation-icon{width:80px;height:80px;border-radius:50%;display:flex;margin:0 auto 16px;align-items:center;justify-content:center;background-color:var(--mecx-color-gray-50)}.modal-confirmation .modal-confirmation-icon monkey-icon{color:var(--mecx-color-gray-900)}.modal-confirmation .modal-confirmation-icon.warning{background-color:var(--mecx-color-warning-100)}.modal-confirmation .modal-confirmation-icon.warning monkey-icon{color:var(--mecx-color-warning-500)}.modal-confirmation .modal-confirmation-icon.error{background-color:var(--mecx-color-error-100)}.modal-confirmation .modal-confirmation-icon.error monkey-icon{color:var(--mecx-color-error-500)}.modal-confirmation .modal-confirmation-icon.success{background-color:var(--mecx-color-success-100)}.modal-confirmation .modal-confirmation-icon.success monkey-icon{color:var(--mecx-color-success-500)}\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: MonkeyModalComponent, selector: "monkey-modal" }, { kind: "directive", type: MonkeyModalContentDirective, selector: "monkey-modal-content, [monkey-modal-content]" }, { kind: "directive", type: MonkeyModalActionsDirective, selector: "monkey-modal-actions, [monkey-modal-actions]", inputs: ["mkAlign"] }], encapsulation: i0.ViewEncapsulation.None }); }
4511
4933
  }
4512
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyRadioButtonComponent, decorators: [{
4934
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalConfirmationComponent, decorators: [{
4513
4935
  type: Component,
4514
- args: [{ selector: 'monkey-radiobutton', standalone: true, imports: [CommonModule, ReactiveFormsModule, FormsModule, UtilIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
4515
- // eslint-disable-next-line no-use-before-define
4516
- { provide: MonkeyFormFieldControl, useExisting: MonkeyRadioButtonComponent }
4517
- ], host: {
4518
- 'data-testid': 'monkey-radiobutton',
4519
- class: 'mecx-radiobutton',
4520
- '[class.mecx-disabled]': 'disabled',
4521
- '[class.mecx-radiobutton-focused]': 'focused',
4522
- '[attr.id]': 'id',
4523
- '[attr.tabindex]': 'disabled ? -1 : tabIndex',
4524
- '(focus)': '_onFocus()',
4525
- '(blur)': '_onBlur()'
4526
- }, template: "<ng-content />\n", styles: ["monkey-radiobutton{display:inline-flex;width:100%;min-width:0;position:relative;flex-wrap:wrap}monkey-radiobutton:focus-visible,monkey-radiobutton:focus{outline:none}monkey-radiobutton.vertical{flex-direction:column}monkey-radiobutton.mecx-disabled monkey-option{opacity:.5;pointer-events:none}monkey-radiobutton.mecx-disabled monkey-option:before{background:var(--mecx-color-white);border-color:var(--mecx-color-gray-400)}monkey-radiobutton.mecx-form-field-invalid{background:var(--mecx-color-error-700)}monkey-radiobutton.md monkey-option:before{width:16px;height:16px}monkey-radiobutton.sm monkey-option:before{width:14px;height:14px}\n"] }]
4527
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: MonkeyFormFieldComponent, decorators: [{
4528
- type: Optional
4529
- }] }], propDecorators: { options: [{
4530
- type: ContentChildren,
4531
- args: [MonkeyOptionComponent]
4532
- }], tabIndex: [{
4533
- type: Input
4534
- }], onChange: [{
4535
- type: Output
4536
- }], onSearch: [{
4537
- type: Output
4538
- }], position: [{
4539
- type: Input
4540
- }], size: [{
4541
- type: Input
4542
- }], classes: [{
4543
- type: HostBinding,
4544
- args: ['class']
4545
- }], disabled: [{
4546
- type: Input,
4547
- args: [{ transform: booleanAttribute }]
4548
- }], required: [{
4549
- type: Input,
4550
- args: [{ transform: booleanAttribute }]
4551
- }], value: [{
4552
- type: Input
4553
- }] } });
4936
+ args: [{ selector: 'monkey-modal-confirmation', encapsulation: ViewEncapsulation.None, template: `
4937
+ <monkey-modal class="modal-confirmation">
4938
+ <monkey-modal-content>
4939
+ @if (config.icon) {
4940
+ <div class="modal-confirmation-icon {{ config.type }}">
4941
+ <monkey-icon [icon]="config.icon" size="xxl"></monkey-icon>
4942
+ </div>
4943
+ }
4944
+ <div class="confirmation-title" [innerHTML]="config.title"></div>
4945
+ <div class="confirmation-description" [innerHTML]="config.content"></div>
4946
+ </monkey-modal-content>
4947
+ <monkey-modal-actions>
4948
+ <monkey-button type="tertiary" (click)="onClose()">{{ config.cancelLabel }}</monkey-button>
4949
+ <monkey-button type="primary" (click)="onSubmit()">{{ config.okLabel }}</monkey-button>
4950
+ </monkey-modal-actions>
4951
+ </monkey-modal>
4952
+ `, styles: [".modal-confirmation .mecx-modal-header{border:none}.modal-confirmation .confirmation-title{color:var(--mecx-color-gray-900);text-align:center;font-size:18px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.54px;margin-bottom:8px}.modal-confirmation .confirmation-description{color:var(--mecx-color-gray-700);text-align:center;font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px;margin-bottom:24px}.modal-confirmation .modal-confirmation-icon{width:80px;height:80px;border-radius:50%;display:flex;margin:0 auto 16px;align-items:center;justify-content:center;background-color:var(--mecx-color-gray-50)}.modal-confirmation .modal-confirmation-icon monkey-icon{color:var(--mecx-color-gray-900)}.modal-confirmation .modal-confirmation-icon.warning{background-color:var(--mecx-color-warning-100)}.modal-confirmation .modal-confirmation-icon.warning monkey-icon{color:var(--mecx-color-warning-500)}.modal-confirmation .modal-confirmation-icon.error{background-color:var(--mecx-color-error-100)}.modal-confirmation .modal-confirmation-icon.error monkey-icon{color:var(--mecx-color-error-500)}.modal-confirmation .modal-confirmation-icon.success{background-color:var(--mecx-color-success-100)}.modal-confirmation .modal-confirmation-icon.success monkey-icon{color:var(--mecx-color-success-500)}\n"] }]
4953
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
4954
+ type: Inject,
4955
+ args: [MECX_MODAL_CONFIRMATION_CONFIG]
4956
+ }] }, { type: MonkeyModalRef, decorators: [{
4957
+ type: Inject,
4958
+ args: [MonkeyModalRef]
4959
+ }] }] });
4554
4960
 
4555
4961
  /** ************************
4556
4962
  * Copyright Monkey Exchange. All Rights Reserved
4557
4963
  * This style guide was developed by Monkey Exchange Team
4558
4964
  * MIT Licence
4559
4965
  ************************* */
4966
+ class MonkeyModalModule {
4967
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4968
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalModule, declarations: [MonkeyModalComponent,
4969
+ MonkeyModalDefaultComponent,
4970
+ MonkeyModalConfirmationComponent,
4971
+ MonkeyModalTitleDirective,
4972
+ MonkeyModalSubtitleDirective,
4973
+ MonkeyModalContentDirective,
4974
+ MonkeyModalActionsDirective], imports: [CommonModule, MonkeyButtonComponent, MonkeyIconButtonComponent, MonkeyIconComponent], exports: [MonkeyModalComponent,
4975
+ MonkeyModalTitleDirective,
4976
+ MonkeyModalSubtitleDirective,
4977
+ MonkeyModalContentDirective,
4978
+ MonkeyModalActionsDirective] }); }
4979
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalModule, imports: [CommonModule, MonkeyButtonComponent, MonkeyIconButtonComponent, MonkeyIconComponent] }); }
4980
+ }
4981
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalModule, decorators: [{
4982
+ type: NgModule,
4983
+ args: [{
4984
+ imports: [CommonModule, MonkeyButtonComponent, MonkeyIconButtonComponent, MonkeyIconComponent],
4985
+ declarations: [
4986
+ MonkeyModalComponent,
4987
+ MonkeyModalDefaultComponent,
4988
+ MonkeyModalConfirmationComponent,
4989
+ MonkeyModalTitleDirective,
4990
+ MonkeyModalSubtitleDirective,
4991
+ MonkeyModalContentDirective,
4992
+ MonkeyModalActionsDirective
4993
+ ],
4994
+ exports: [
4995
+ MonkeyModalComponent,
4996
+ MonkeyModalTitleDirective,
4997
+ MonkeyModalSubtitleDirective,
4998
+ MonkeyModalContentDirective,
4999
+ MonkeyModalActionsDirective
5000
+ ]
5001
+ }]
5002
+ }] });
4560
5003
 
4561
5004
  /** ************************
4562
5005
  * Copyright Monkey Exchange. All Rights Reserved
4563
5006
  * This style guide was developed by Monkey Exchange Team
4564
5007
  * MIT Licence
4565
5008
  ************************* */
4566
- class MonkeySecurityLevelComponent {
4567
- get class() {
4568
- if (this.score() === 0) {
4569
- return 'empty';
5009
+ class MonkeyModalService {
5010
+ constructor() {
5011
+ this._idGenerator = inject(IdGenerator);
5012
+ this._injector = inject(Injector);
5013
+ this._overlay = inject(Overlay);
5014
+ this._openDialogsAtThisLevel = [];
5015
+ this._parentDialog = inject(MonkeyModalService, { optional: true, skipSelf: true });
5016
+ }
5017
+ get openDialogs() {
5018
+ return this._parentDialog ? this._parentDialog.openDialogs : this._openDialogsAtThisLevel;
5019
+ }
5020
+ getOverlayConfig(config) {
5021
+ let positionStrategy;
5022
+ const marginStrategy = '20px';
5023
+ if (config.position === 'left-top') {
5024
+ positionStrategy = this._overlay.position().global().left(marginStrategy).top(marginStrategy);
4570
5025
  }
4571
- if (this.score() < 300) {
4572
- return 'weak';
5026
+ else if (config.position === 'center-top') {
5027
+ positionStrategy = this._overlay.position().global().centerHorizontally().top(marginStrategy);
4573
5028
  }
4574
- if (this.score() >= 300 && this.score() < 800) {
4575
- return 'medium';
5029
+ else if (config.position === 'right-top') {
5030
+ positionStrategy = this._overlay
5031
+ .position()
5032
+ .global()
5033
+ .right(marginStrategy)
5034
+ .top(marginStrategy);
4576
5035
  }
4577
- if (this.score() >= 800 && this.score() < 1000) {
4578
- return 'strong';
5036
+ else if (config.position === 'left-center') {
5037
+ positionStrategy = this._overlay.position().global().left(marginStrategy).centerVertically();
4579
5038
  }
4580
- return 'very-strong';
5039
+ else if (config.position === 'center-center') {
5040
+ positionStrategy = this._overlay.position().global().centerHorizontally().centerVertically();
5041
+ }
5042
+ else if (config.position === 'right-center') {
5043
+ positionStrategy = this._overlay.position().global().right(marginStrategy).centerVertically();
5044
+ }
5045
+ else if (config.position === 'left-bottom') {
5046
+ positionStrategy = this._overlay
5047
+ .position()
5048
+ .global()
5049
+ .left(marginStrategy)
5050
+ .bottom(marginStrategy);
5051
+ }
5052
+ else if (config.position === 'center-bottom') {
5053
+ positionStrategy = this._overlay.position().global().centerHorizontally().bottom('20px');
5054
+ }
5055
+ else if (config.position === 'right-bottom') {
5056
+ positionStrategy = this._overlay
5057
+ .position()
5058
+ .global()
5059
+ .right(marginStrategy)
5060
+ .bottom(marginStrategy);
5061
+ }
5062
+ let panelClass = ['monkey-modal-panel'];
5063
+ if (config.fullscreen) {
5064
+ panelClass.push('monkey-modal-fullscreen');
5065
+ }
5066
+ if (Array.isArray(config.panelClass)) {
5067
+ panelClass = [...panelClass, ...config.panelClass];
5068
+ }
5069
+ else {
5070
+ panelClass.push(config.panelClass);
5071
+ }
5072
+ const state = new OverlayConfig({
5073
+ positionStrategy,
5074
+ scrollStrategy: this._overlay.scrollStrategies.block(),
5075
+ panelClass,
5076
+ hasBackdrop: config.hasBackdrop,
5077
+ maxWidth: config.maxWidth,
5078
+ maxHeight: config.maxHeight,
5079
+ disposeOnNavigation: config.closeOnNavigation
5080
+ });
5081
+ if (config.backdropClass) {
5082
+ state.backdropClass = config.backdropClass;
5083
+ }
5084
+ if (config.maxWidth) {
5085
+ state.width = '100%';
5086
+ }
5087
+ if (config.maxHeight) {
5088
+ state.height = '100%';
5089
+ }
5090
+ return state;
5091
+ }
5092
+ createInjector(config, dialogRef, overlayRef, fallbackInjector) {
5093
+ const providers = [
5094
+ { provide: OverlayRef, useValue: overlayRef },
5095
+ { provide: MonkeyModalRef, useValue: dialogRef },
5096
+ { provide: MECX_MODAL_DATA, useValue: config.data }
5097
+ ];
5098
+ if (config.providers) {
5099
+ providers.push(...config.providers);
5100
+ }
5101
+ return Injector.create({ parent: fallbackInjector, providers });
4581
5102
  }
4582
- get id() {
4583
- return this._id;
5103
+ open(component, config) {
5104
+ const defaultConfig = new MonkeyModalConfig();
5105
+ config = { ...defaultConfig, ...config };
5106
+ config.id = this._idGenerator.getId('monkey-modal-');
5107
+ const overlayConfig = this.getOverlayConfig(config);
5108
+ const overlayRef = this._overlay.create(overlayConfig);
5109
+ const modalRef = new MonkeyModalRef(overlayRef, config);
5110
+ const injector = this.createInjector(config, modalRef, overlayRef, this._injector);
5111
+ const componentPortal = new ComponentPortal(component, null, injector);
5112
+ const componentRef = overlayRef.attach(componentPortal);
5113
+ const componentElement = componentRef.location.nativeElement;
5114
+ componentElement.style.width = '100%';
5115
+ componentElement.style.height = '100%';
5116
+ modalRef.componentElement = componentElement;
5117
+ modalRef.componentInstance = componentRef.instance;
5118
+ this.openDialogs.push(modalRef);
5119
+ return modalRef;
4584
5120
  }
4585
- set id(value) {
4586
- this._id = value || this._uid;
5121
+ openDefault(params, config) {
5122
+ config.providers = [{ provide: MECX_MODAL_DEFAULT_CONFIG, useValue: params }];
5123
+ config.icon = config.icon ? config.icon : 'help';
5124
+ return this.open(MonkeyModalDefaultComponent, config);
4587
5125
  }
4588
- constructor() {
4589
- this.label = input();
4590
- this.score = input.required();
4591
- this.strengthLabel = input();
4592
- this._uid = inject(IdGenerator).getId('monkey-security-level-');
4593
- // eslint-disable-next-line no-self-assign
4594
- this.id = this.id;
5126
+ openConfirmation(params, config) {
5127
+ config.providers = [{ provide: MECX_MODAL_CONFIRMATION_CONFIG, useValue: params }];
5128
+ return this.open(MonkeyModalConfirmationComponent, config);
4595
5129
  }
4596
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySecurityLevelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4597
- 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:var(--mecx-color-gray-700);font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px}monkey-security-level .level-info{color:var(--mecx-color-gray-900);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:var(--mecx-color-gray-300);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:var(--mecx-color-success-main);width:100%}monkey-security-level.strong .bar:before{background:var(--mecx-color-success-main);width:80%}monkey-security-level.medium .bar:before{background:var(--mecx-color-warning-main);width:66%}monkey-security-level.weak .bar:before{background:var(--mecx-color-error-700);width:33%}monkey-security-level.empty .bar:before{background:var(--mecx-color-error-700);width:0%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None }); }
5130
+ closeAll() {
5131
+ reverseForEach(this.openDialogs, (dialog) => {
5132
+ return dialog.close();
5133
+ });
5134
+ this.openDialogs.splice(0, this.openDialogs.length);
5135
+ }
5136
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5137
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalService, providedIn: 'root' }); }
4598
5138
  }
4599
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySecurityLevelComponent, decorators: [{
4600
- type: Component,
4601
- args: [{ encapsulation: ViewEncapsulation.None, imports: [CommonModule], selector: 'monkey-security-level', standalone: true, host: {
4602
- 'data-testid': 'monkey-security-level',
4603
- '[attr.id]': 'id',
4604
- '[id]': 'id'
4605
- }, 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:var(--mecx-color-gray-700);font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px}monkey-security-level .level-info{color:var(--mecx-color-gray-900);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:var(--mecx-color-gray-300);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:var(--mecx-color-success-main);width:100%}monkey-security-level.strong .bar:before{background:var(--mecx-color-success-main);width:80%}monkey-security-level.medium .bar:before{background:var(--mecx-color-warning-main);width:66%}monkey-security-level.weak .bar:before{background:var(--mecx-color-error-700);width:33%}monkey-security-level.empty .bar:before{background:var(--mecx-color-error-700);width:0%}\n"] }]
4606
- }], ctorParameters: () => [], propDecorators: { class: [{
4607
- type: HostBinding,
4608
- args: ['class']
4609
- }], id: [{
4610
- type: Input
4611
- }] } });
5139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyModalService, decorators: [{
5140
+ type: Injectable,
5141
+ args: [{ providedIn: 'root' }]
5142
+ }] });
4612
5143
 
4613
5144
  /** ************************
4614
5145
  * Copyright Monkey Exchange. All Rights Reserved
@@ -4621,7 +5152,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
4621
5152
  * This style guide was developed by Monkey Exchange Team
4622
5153
  * MIT Licence
4623
5154
  ************************* */
4624
- class MonkeySelectComponent {
5155
+ class MonkeyRadioButtonComponent {
5156
+ get classes() {
5157
+ return `${this.position} ${this.size}`;
5158
+ }
4625
5159
  get disabled() {
4626
5160
  if (this.ngControl && this.ngControl.disabled !== null) {
4627
5161
  return this.ngControl.disabled;
@@ -4651,238 +5185,61 @@ class MonkeySelectComponent {
4651
5185
  get value() {
4652
5186
  return this._value;
4653
5187
  }
4654
- constructor(overlay, changeDetectorRef, viewContainerRef, formField) {
4655
- this.overlay = overlay;
4656
- this.changeDetectorRef = changeDetectorRef;
4657
- this.viewContainerRef = viewContainerRef;
4658
- this.formField = formField;
4659
- this.tabIndex = 0;
4660
- this.onChange = new EventEmitter();
4661
- this.onSearch = new EventEmitter();
4662
- this.placeholder = '';
4663
- this.loading = false;
4664
- this.showSearch = true;
4665
- this.searchPlaceholder = '';
4666
- this.callbackSearch = false;
4667
- this._value = null;
4668
- this.labelSelected = '';
4669
- this.overlayRef = null;
4670
- this._destroyRef = inject(DestroyRef);
4671
- this.idGenerator = inject(IdGenerator);
4672
- this.ngControl = inject(NgControl, { self: true, optional: true });
4673
- this._elementRef = inject(ElementRef);
4674
- this.currency = false;
4675
- this.focused = false;
4676
- this._disabled = false;
4677
- this.id = this.idGenerator.getId('monkey-select-');
4678
- this.percent = false;
4679
- this.stateChanges = new Subject();
4680
- this.type = '';
4681
- this.searchHandle = new EventEmitter();
4682
- this.searchDictionary = inject(MonkeyDictionaryService).get('NO-DATA');
4683
- this.loadingDictionary = inject(MonkeyDictionaryService).get('LOADING');
4684
- this.showSearchNoData = false;
4685
- this.isOpen = false;
4686
- this.searchData = '';
4687
- this.onAnimationEnd = (event) => {
4688
- if (event.toState === 'closed') {
4689
- this.closeOverlay();
4690
- }
4691
- };
4692
- this._onChange = () => { };
4693
- this._onTouched = () => { };
4694
- if (this.ngControl) {
4695
- this.ngControl.valueAccessor = this;
4696
- }
4697
- }
4698
- changeControl() {
4699
- if (this.formField?.control) {
4700
- this.formField.control.loading = this.loading;
4701
- }
4702
- }
4703
- changeSelected() {
4704
- setTimeout(() => {
4705
- if (this.options) {
4706
- this.options.forEach((opt) => {
4707
- opt.selected = opt.value === this.value;
4708
- });
4709
- this.updateSelectedLabel();
4710
- }
4711
- this.changeDetectorRef.markForCheck();
4712
- });
4713
- }
4714
- initializeOptions() {
4715
- this.options.forEach((option) => {
4716
- if (!option.action) {
4717
- option.action = this.selectOption.bind(this, option);
4718
- }
4719
- });
4720
- }
4721
- openDropdown() {
4722
- if (this.options?.length) {
4723
- this.formField.control.disableToBeDirty = true;
4724
- this.isOpen = true;
4725
- this.createOverlay();
4726
- }
4727
- }
4728
- closeDropdown() {
4729
- this.changeDetectorRef.markForCheck();
4730
- this.isOpen = false;
4731
- this.focused = false;
4732
- this.formField.control.disableToBeDirty = false;
4733
- if (!this.callbackSearch) {
4734
- this.searchData = '';
4735
- }
4736
- }
4737
- closeOverlay() {
4738
- if (this.overlayRef) {
4739
- this.overlayRef.dispose();
4740
- this.overlayRef = null;
4741
- }
4742
- }
4743
- initializeWithOverlay() {
4744
- if (this.showSearch) {
4745
- const element = this.overlayRef?.overlayElement.querySelector(`#${this.id}-search`);
4746
- this.options.forEach((opt) => {
4747
- const element = this.overlayRef?.overlayElement.querySelector(`#${opt.id}`);
4748
- if (!element)
4749
- return;
4750
- element.style.display = '';
4751
- });
4752
- setTimeout(() => {
4753
- element?.focus();
4754
- }, 0);
4755
- this.showSearchNoData = false;
4756
- }
4757
- setTimeout(() => {
4758
- const selected = this.options.find((opt) => {
4759
- return opt.selected;
4760
- });
4761
- if (selected) {
4762
- const element = this.overlayRef?.overlayElement.querySelector(`#${selected.id}`);
4763
- element?.scrollIntoView({ behavior: 'instant', block: 'center' });
4764
- }
4765
- }, 0);
4766
- }
4767
- createOverlay() {
4768
- if (this.overlayRef) {
4769
- return;
4770
- }
4771
- const offset = 4;
4772
- const positions = [
4773
- {
4774
- originX: 'start',
4775
- originY: 'bottom',
4776
- overlayX: 'start',
4777
- overlayY: 'top',
4778
- offsetY: offset
4779
- },
4780
- {
4781
- originX: 'start',
4782
- originY: 'top',
4783
- overlayX: 'start',
4784
- overlayY: 'bottom',
4785
- offsetY: -offset
4786
- }
4787
- ];
4788
- let anchor = this.trigger;
4789
- let width = anchor.nativeElement.offsetWidth;
4790
- if (this.formField?.elementRef) {
4791
- const el = this.formField?.elementRef.nativeElement.querySelector('.mecx-form-field-body');
4792
- anchor = el;
4793
- width = el.offsetWidth;
4794
- }
4795
- const positionStrategy = this.overlay
4796
- .position()
4797
- .flexibleConnectedTo(anchor)
4798
- .withPositions(positions)
4799
- .withPush(true);
4800
- this.overlayRef = this.overlay.create({
4801
- positionStrategy,
4802
- scrollStrategy: this.overlay.scrollStrategies.block(),
4803
- width,
4804
- hasBackdrop: true,
4805
- backdropClass: 'no-class'
4806
- });
4807
- const portal = new TemplatePortal(this.overlayTemplate, this.viewContainerRef);
4808
- this.overlayRef.attach(portal);
4809
- this.overlayRef
4810
- .backdropClick()
4811
- .pipe(takeUntilDestroyed(this._destroyRef))
4812
- .subscribe(() => {
4813
- return this.closeDropdown();
4814
- });
4815
- this.initializeWithOverlay();
4816
- }
4817
- updateSelectedLabel() {
4818
- const selectedOption = this.options.find((opt) => {
4819
- return opt.value === this.value;
4820
- });
4821
- this.labelSelected = selectedOption ? selectedOption.displayContent : '';
4822
- }
4823
- executeSearch(search) {
4824
- let found = false;
4825
- this.options.forEach((opt) => {
4826
- const element = this.overlayRef?.overlayElement.querySelector(`#${opt.id}`);
4827
- if (!element)
4828
- return;
4829
- const isMatch = normalizeStringToSearch(opt.displayContent).includes(normalizeStringToSearch(search));
4830
- if (isMatch) {
4831
- found = true;
4832
- }
4833
- element.style.display = isMatch ? '' : 'none';
4834
- });
4835
- this.repositionScroll();
4836
- this.showSearchNoData = !found;
4837
- }
4838
- repositionScroll() {
4839
- const overlayElement = this.overlayRef?.overlayElement.querySelector('.mecx-select-overlay');
4840
- if (overlayElement) {
4841
- overlayElement.scrollTop = 0;
5188
+ constructor(changeDetectorRef, formField) {
5189
+ this.changeDetectorRef = changeDetectorRef;
5190
+ this.formField = formField;
5191
+ this.tabIndex = 0;
5192
+ this.onChange = new EventEmitter();
5193
+ this.onSearch = new EventEmitter();
5194
+ this.position = 'horizontal';
5195
+ this.size = 'lg';
5196
+ this._value = null;
5197
+ this._destroyRef = inject(DestroyRef);
5198
+ this.idGenerator = inject(IdGenerator);
5199
+ this.ngControl = inject(NgControl, { self: true, optional: true });
5200
+ this._elementRef = inject(ElementRef);
5201
+ this.focused = false;
5202
+ this._disabled = false;
5203
+ this.id = this.idGenerator.getId('monkey-radiobutton-');
5204
+ this.stateChanges = new Subject();
5205
+ this.type = 'radio-button';
5206
+ this._onChange = () => { };
5207
+ this._onTouched = () => { };
5208
+ if (this.ngControl) {
5209
+ this.ngControl.valueAccessor = this;
4842
5210
  }
4843
5211
  }
4844
- ngOnInit() {
4845
- this.searchHandle
4846
- .pipe(debounceTime(200), takeUntilDestroyed(this._destroyRef))
4847
- .subscribe((search) => {
4848
- if (this.callbackSearch) {
4849
- this.onSearch.next(search);
4850
- this.repositionScroll();
4851
- }
4852
- else {
4853
- this.executeSearch(search);
5212
+ changeSelected() {
5213
+ setTimeout(() => {
5214
+ if (this.options) {
5215
+ this.options.forEach((opt) => {
5216
+ opt.selected = opt.value === this.value;
5217
+ });
4854
5218
  }
5219
+ this.changeDetectorRef.markForCheck();
4855
5220
  });
4856
5221
  }
5222
+ initializeOptions() {
5223
+ setTimeout(() => {
5224
+ this.options?.forEach((option) => {
5225
+ option.type = 'radio';
5226
+ if (!option.action) {
5227
+ option.action = this.selectOption.bind(this, option);
5228
+ }
5229
+ });
5230
+ this.changeDetectorRef.markForCheck();
5231
+ }, 0);
5232
+ }
4857
5233
  ngAfterContentInit() {
4858
5234
  this.initializeOptions();
4859
- this.options.changes.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((resp) => {
4860
- this.updateSelectedLabel();
5235
+ this.options.changes.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
4861
5236
  this.initializeOptions();
4862
5237
  this.changeSelected();
4863
5238
  });
4864
5239
  }
4865
- ngOnDestroy() {
4866
- if (this.overlayRef) {
4867
- this.overlayRef.dispose();
4868
- }
4869
- }
4870
- toggleDropdown() {
4871
- if (!this.disabled) {
4872
- if (this.isOpen) {
4873
- this.closeDropdown();
4874
- this._onTouched();
4875
- }
4876
- else {
4877
- this.openDropdown();
4878
- }
4879
- }
4880
- }
4881
5240
  selectOption(option) {
4882
5241
  if (!option.disabled && !this.disabled) {
4883
5242
  this.value = option.value;
4884
- this.updateSelectedLabel();
4885
- this.closeDropdown();
4886
5243
  this._onChange(this.value);
4887
5244
  this.onChange.emit(this.value);
4888
5245
  this.options.forEach((opt) => {
@@ -4897,7 +5254,6 @@ class MonkeySelectComponent {
4897
5254
  onContainerClick(event) {
4898
5255
  if (this.disabled)
4899
5256
  return;
4900
- this.openDropdown();
4901
5257
  this._elementRef.nativeElement.focus();
4902
5258
  }
4903
5259
  _onFocus() {
@@ -4919,98 +5275,32 @@ class MonkeySelectComponent {
4919
5275
  }
4920
5276
  setDisabledState(isDisabled) {
4921
5277
  this.disabled = isDisabled;
5278
+ this.initializeOptions();
4922
5279
  }
4923
- ngOnChanges(changes) {
4924
- let hasChanges = false;
4925
- // eslint-disable-next-line dot-notation
4926
- const changesLoading = changes?.['loading'];
4927
- if (changesLoading?.currentValue !== changesLoading?.previousValue) {
4928
- hasChanges = true;
4929
- this.changeControl();
4930
- }
4931
- if (hasChanges) {
4932
- this.stateChanges.next();
4933
- }
4934
- }
4935
- onHandleSearch(event) {
4936
- try {
4937
- const { value } = event.target;
4938
- const handled = sanitizeString(value);
4939
- this.searchHandle.next(handled || '');
4940
- }
4941
- catch (e) {
4942
- // not to do
4943
- }
4944
- }
4945
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySelectComponent, deps: [{ token: i1$1.Overlay }, { token: i0.ChangeDetectorRef }, { token: i0.ViewContainerRef }, { token: MonkeyFormFieldComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
4946
- 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], showSearch: ["showSearch", "showSearch", booleanAttribute], searchPlaceholder: "searchPlaceholder", callbackSearch: ["callbackSearch", "callbackSearch", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], required: ["required", "required", booleanAttribute], value: "value" }, outputs: { onChange: "onChange", onSearch: "onSearch" }, 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: [
5280
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyRadioButtonComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: MonkeyFormFieldComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
5281
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.13", type: MonkeyRadioButtonComponent, isStandalone: true, selector: "monkey-radiobutton", inputs: { tabIndex: "tabIndex", position: "position", size: "size", disabled: ["disabled", "disabled", booleanAttribute], required: ["required", "required", booleanAttribute], value: "value" }, outputs: { onChange: "onChange", onSearch: "onSearch" }, host: { attributes: { "data-testid": "monkey-radiobutton" }, listeners: { "focus": "_onFocus()", "blur": "_onBlur()" }, properties: { "class.mecx-disabled": "disabled", "class.mecx-radiobutton-focused": "focused", "attr.id": "id", "attr.tabindex": "disabled ? -1 : tabIndex", "class": "this.classes" }, classAttribute: "mecx-radiobutton" }, providers: [
4947
5282
  // eslint-disable-next-line no-use-before-define
4948
- { provide: MonkeyFormFieldControl, useExisting: MonkeySelectComponent }
4949
- ], 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 <util-icon class=\"mecx-select-icon\" name=\"arrowDown\" />\n }\n</div>\n\n<ng-template #overlayTemplate>\n <div class=\"mecx-select-body-overlay\">\n @if (showSearch) {\n <div class=\"mecx-select-search\">\n <util-icon class=\"mecx-select-search-icon\" name=\"search\" />\n <input\n (input)=\"onHandleSearch($event)\"\n type=\"text\"\n [id]=\"id + '-search'\"\n autocomplete=\"off\"\n maxlength=\"50\"\n [placeholder]=\"searchPlaceholder\"\n [(ngModel)]=\"searchData\"\n />\n </div>\n }\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 @if (showSearch && showSearchNoData) {\n <div class=\"mecx-select-search-no-data\">\n <util-icon class=\"mecx-select-search-no-data-icon\" name=\"searchFail\" />\n {{ searchDictionary | async }}\n </div>\n }\n @if (loading) {\n <div class=\"mecx-select-search-loading\">\n {{ loadingDictionary | async }}\n </div>\n }\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-body-overlay{width:100%;background:#fff;border:2px solid var(--mecx-color-gray-400);overflow:hidden;border-radius:4px;box-shadow:0 16px 32px 0 var(--mecx-color-box-shadow)}.mecx-select-body-overlay .mecx-select-search{display:flex;gap:4px;border-bottom:2px solid var(--mecx-color-gray-400);padding:8px}.mecx-select-body-overlay .mecx-select-search-icon{width:12px;display:flex}.mecx-select-body-overlay .mecx-select-search-icon svg path{stroke:var(--mecx-color-gray-600)}.mecx-select-body-overlay input{border:none;width:90%;color:var(--mecx-color-gray-600)!important;font-size:12px;letter-spacing:.54px}.mecx-select-body-overlay .mecx-select-search-no-data,.mecx-select-body-overlay .mecx-select-search-loading{padding:12px;display:flex;justify-content:center;flex-direction:column;align-items:center;gap:4px;color:var(--mecx-color-gray-600);font-size:12px;letter-spacing:.54px;text-align:center}.mecx-select-body-overlay .mecx-select-search-no-data-icon svg path,.mecx-select-body-overlay .mecx-select-search-loading-icon svg path{stroke:var(--mecx-color-gray-600)}.mecx-select-overlay{width:100%;background:#fff;overflow:hidden auto;max-height:360px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UtilIconComponent, selector: "util-icon", inputs: ["name"] }], animations: [
4950
- trigger('animation', [
4951
- transition(':enter', [
4952
- style({
4953
- opacity: 0,
4954
- transform: 'scaleY(.9)'
4955
- }),
4956
- animate('100ms ease-in-out', style({
4957
- opacity: 1,
4958
- transform: 'scaleY(1)'
4959
- }))
4960
- ]),
4961
- state('closed', style({
4962
- transform: 'scaleY(.9)',
4963
- opacity: 0
4964
- })),
4965
- transition('closed <=> open', animate('200ms ease-in-out'))
4966
- ])
4967
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
5283
+ { provide: MonkeyFormFieldControl, useExisting: MonkeyRadioButtonComponent }
5284
+ ], queries: [{ propertyName: "options", predicate: MonkeyOptionComponent }], ngImport: i0, template: "<ng-content />\n", styles: ["monkey-radiobutton{display:inline-flex;width:100%;min-width:0;position:relative;flex-wrap:wrap}monkey-radiobutton:focus-visible,monkey-radiobutton:focus{outline:none}monkey-radiobutton.vertical{flex-direction:column}monkey-radiobutton.mecx-disabled monkey-option{opacity:.5;pointer-events:none}monkey-radiobutton.mecx-disabled monkey-option:before{background:var(--mecx-color-white);border-color:var(--mecx-color-gray-400)}monkey-radiobutton.mecx-form-field-invalid{background:var(--mecx-color-error-700)}monkey-radiobutton.md monkey-option:before{width:16px;height:16px}monkey-radiobutton.sm monkey-option:before{width:14px;height:14px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
4968
5285
  }
4969
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySelectComponent, decorators: [{
5286
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeyRadioButtonComponent, decorators: [{
4970
5287
  type: Component,
4971
- args: [{ selector: 'monkey-select', standalone: true, imports: [CommonModule, ReactiveFormsModule, FormsModule, UtilIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
5288
+ args: [{ selector: 'monkey-radiobutton', standalone: true, imports: [CommonModule, ReactiveFormsModule, FormsModule, UtilIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
4972
5289
  // eslint-disable-next-line no-use-before-define
4973
- { provide: MonkeyFormFieldControl, useExisting: MonkeySelectComponent }
4974
- ], animations: [
4975
- trigger('animation', [
4976
- transition(':enter', [
4977
- style({
4978
- opacity: 0,
4979
- transform: 'scaleY(.9)'
4980
- }),
4981
- animate('100ms ease-in-out', style({
4982
- opacity: 1,
4983
- transform: 'scaleY(1)'
4984
- }))
4985
- ]),
4986
- state('closed', style({
4987
- transform: 'scaleY(.9)',
4988
- opacity: 0
4989
- })),
4990
- transition('closed <=> open', animate('200ms ease-in-out'))
4991
- ])
5290
+ { provide: MonkeyFormFieldControl, useExisting: MonkeyRadioButtonComponent }
4992
5291
  ], host: {
4993
- 'data-testid': 'monkey-select',
4994
- class: 'mecx-select',
4995
- '[class.mecx-select-disabled]': '_disabled',
4996
- '[class.mecx-select-focused]': 'focused',
5292
+ 'data-testid': 'monkey-radiobutton',
5293
+ class: 'mecx-radiobutton',
5294
+ '[class.mecx-disabled]': 'disabled',
5295
+ '[class.mecx-radiobutton-focused]': 'focused',
4997
5296
  '[attr.id]': 'id',
4998
5297
  '[attr.tabindex]': 'disabled ? -1 : tabIndex',
4999
5298
  '(focus)': '_onFocus()',
5000
5299
  '(blur)': '_onBlur()'
5001
- }, 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 <util-icon class=\"mecx-select-icon\" name=\"arrowDown\" />\n }\n</div>\n\n<ng-template #overlayTemplate>\n <div class=\"mecx-select-body-overlay\">\n @if (showSearch) {\n <div class=\"mecx-select-search\">\n <util-icon class=\"mecx-select-search-icon\" name=\"search\" />\n <input\n (input)=\"onHandleSearch($event)\"\n type=\"text\"\n [id]=\"id + '-search'\"\n autocomplete=\"off\"\n maxlength=\"50\"\n [placeholder]=\"searchPlaceholder\"\n [(ngModel)]=\"searchData\"\n />\n </div>\n }\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 @if (showSearch && showSearchNoData) {\n <div class=\"mecx-select-search-no-data\">\n <util-icon class=\"mecx-select-search-no-data-icon\" name=\"searchFail\" />\n {{ searchDictionary | async }}\n </div>\n }\n @if (loading) {\n <div class=\"mecx-select-search-loading\">\n {{ loadingDictionary | async }}\n </div>\n }\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-body-overlay{width:100%;background:#fff;border:2px solid var(--mecx-color-gray-400);overflow:hidden;border-radius:4px;box-shadow:0 16px 32px 0 var(--mecx-color-box-shadow)}.mecx-select-body-overlay .mecx-select-search{display:flex;gap:4px;border-bottom:2px solid var(--mecx-color-gray-400);padding:8px}.mecx-select-body-overlay .mecx-select-search-icon{width:12px;display:flex}.mecx-select-body-overlay .mecx-select-search-icon svg path{stroke:var(--mecx-color-gray-600)}.mecx-select-body-overlay input{border:none;width:90%;color:var(--mecx-color-gray-600)!important;font-size:12px;letter-spacing:.54px}.mecx-select-body-overlay .mecx-select-search-no-data,.mecx-select-body-overlay .mecx-select-search-loading{padding:12px;display:flex;justify-content:center;flex-direction:column;align-items:center;gap:4px;color:var(--mecx-color-gray-600);font-size:12px;letter-spacing:.54px;text-align:center}.mecx-select-body-overlay .mecx-select-search-no-data-icon svg path,.mecx-select-body-overlay .mecx-select-search-loading-icon svg path{stroke:var(--mecx-color-gray-600)}.mecx-select-overlay{width:100%;background:#fff;overflow:hidden auto;max-height:360px}\n"] }]
5002
- }], ctorParameters: () => [{ type: i1$1.Overlay }, { type: i0.ChangeDetectorRef }, { type: i0.ViewContainerRef }, { type: MonkeyFormFieldComponent, decorators: [{
5300
+ }, template: "<ng-content />\n", styles: ["monkey-radiobutton{display:inline-flex;width:100%;min-width:0;position:relative;flex-wrap:wrap}monkey-radiobutton:focus-visible,monkey-radiobutton:focus{outline:none}monkey-radiobutton.vertical{flex-direction:column}monkey-radiobutton.mecx-disabled monkey-option{opacity:.5;pointer-events:none}monkey-radiobutton.mecx-disabled monkey-option:before{background:var(--mecx-color-white);border-color:var(--mecx-color-gray-400)}monkey-radiobutton.mecx-form-field-invalid{background:var(--mecx-color-error-700)}monkey-radiobutton.md monkey-option:before{width:16px;height:16px}monkey-radiobutton.sm monkey-option:before{width:14px;height:14px}\n"] }]
5301
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: MonkeyFormFieldComponent, decorators: [{
5003
5302
  type: Optional
5004
- }] }], propDecorators: { overlayTemplate: [{
5005
- type: ViewChild,
5006
- args: ['overlayTemplate']
5007
- }], overlayEl: [{
5008
- type: ViewChild,
5009
- args: ['overlay']
5010
- }], trigger: [{
5011
- type: ViewChild,
5012
- args: ['trigger']
5013
- }], options: [{
5303
+ }] }], propDecorators: { options: [{
5014
5304
  type: ContentChildren,
5015
5305
  args: [MonkeyOptionComponent]
5016
5306
  }], tabIndex: [{
@@ -5019,20 +5309,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
5019
5309
  type: Output
5020
5310
  }], onSearch: [{
5021
5311
  type: Output
5022
- }], placeholder: [{
5023
- type: Input,
5024
- args: [{ required: true }]
5025
- }], loading: [{
5026
- type: Input,
5027
- args: [{ transform: booleanAttribute }]
5028
- }], showSearch: [{
5029
- type: Input,
5030
- args: [{ transform: booleanAttribute }]
5031
- }], searchPlaceholder: [{
5312
+ }], position: [{
5032
5313
  type: Input
5033
- }], callbackSearch: [{
5034
- type: Input,
5035
- args: [{ transform: booleanAttribute }]
5314
+ }], size: [{
5315
+ type: Input
5316
+ }], classes: [{
5317
+ type: HostBinding,
5318
+ args: ['class']
5036
5319
  }], disabled: [{
5037
5320
  type: Input,
5038
5321
  args: [{ transform: booleanAttribute }]
@@ -5049,6 +5332,64 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
5049
5332
  * MIT Licence
5050
5333
  ************************* */
5051
5334
 
5335
+ /** ************************
5336
+ * Copyright Monkey Exchange. All Rights Reserved
5337
+ * This style guide was developed by Monkey Exchange Team
5338
+ * MIT Licence
5339
+ ************************* */
5340
+ class MonkeySecurityLevelComponent {
5341
+ get class() {
5342
+ if (this.score() === 0) {
5343
+ return 'empty';
5344
+ }
5345
+ if (this.score() < 300) {
5346
+ return 'weak';
5347
+ }
5348
+ if (this.score() >= 300 && this.score() < 800) {
5349
+ return 'medium';
5350
+ }
5351
+ if (this.score() >= 800 && this.score() < 1000) {
5352
+ return 'strong';
5353
+ }
5354
+ return 'very-strong';
5355
+ }
5356
+ get id() {
5357
+ return this._id;
5358
+ }
5359
+ set id(value) {
5360
+ this._id = value || this._uid;
5361
+ }
5362
+ constructor() {
5363
+ this.label = input();
5364
+ this.score = input.required();
5365
+ this.strengthLabel = input();
5366
+ this._uid = inject(IdGenerator).getId('monkey-security-level-');
5367
+ // eslint-disable-next-line no-self-assign
5368
+ this.id = this.id;
5369
+ }
5370
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySecurityLevelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5371
+ 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:var(--mecx-color-gray-700);font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px}monkey-security-level .level-info{color:var(--mecx-color-gray-900);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:var(--mecx-color-gray-300);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:var(--mecx-color-success-main);width:100%}monkey-security-level.strong .bar:before{background:var(--mecx-color-success-main);width:80%}monkey-security-level.medium .bar:before{background:var(--mecx-color-warning-main);width:66%}monkey-security-level.weak .bar:before{background:var(--mecx-color-error-700);width:33%}monkey-security-level.empty .bar:before{background:var(--mecx-color-error-700);width:0%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None }); }
5372
+ }
5373
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonkeySecurityLevelComponent, decorators: [{
5374
+ type: Component,
5375
+ args: [{ encapsulation: ViewEncapsulation.None, imports: [CommonModule], selector: 'monkey-security-level', standalone: true, host: {
5376
+ 'data-testid': 'monkey-security-level',
5377
+ '[attr.id]': 'id',
5378
+ '[id]': 'id'
5379
+ }, 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:var(--mecx-color-gray-700);font-size:14px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.42px}monkey-security-level .level-info{color:var(--mecx-color-gray-900);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:var(--mecx-color-gray-300);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:var(--mecx-color-success-main);width:100%}monkey-security-level.strong .bar:before{background:var(--mecx-color-success-main);width:80%}monkey-security-level.medium .bar:before{background:var(--mecx-color-warning-main);width:66%}monkey-security-level.weak .bar:before{background:var(--mecx-color-error-700);width:33%}monkey-security-level.empty .bar:before{background:var(--mecx-color-error-700);width:0%}\n"] }]
5380
+ }], ctorParameters: () => [], propDecorators: { class: [{
5381
+ type: HostBinding,
5382
+ args: ['class']
5383
+ }], id: [{
5384
+ type: Input
5385
+ }] } });
5386
+
5387
+ /** ************************
5388
+ * Copyright Monkey Exchange. All Rights Reserved
5389
+ * This style guide was developed by Monkey Exchange Team
5390
+ * MIT Licence
5391
+ ************************* */
5392
+
5052
5393
  /** ************************
5053
5394
  * Copyright Monkey Exchange. All Rights Reserved
5054
5395
  * This style guide was developed by Monkey Exchange Team
@@ -6275,6 +6616,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
6275
6616
  * MIT Licence
6276
6617
  ************************* */
6277
6618
 
6619
+ /** ************************
6620
+ * Copyright Monkey Exchange. All Rights Reserved
6621
+ * This style guide was developed by Monkey Exchange Team
6622
+ * MIT Licence
6623
+ ************************* */
6624
+
6278
6625
  class MonkeyToastRef {
6279
6626
  constructor(componentRef) {
6280
6627
  this.componentRef = componentRef;
@@ -6285,6 +6632,12 @@ class MonkeyToastRef {
6285
6632
  }
6286
6633
  }
6287
6634
 
6635
+ /** ************************
6636
+ * Copyright Monkey Exchange. All Rights Reserved
6637
+ * This style guide was developed by Monkey Exchange Team
6638
+ * MIT Licence
6639
+ ************************* */
6640
+
6288
6641
  class MonkeyToastService {
6289
6642
  constructor(overlay) {
6290
6643
  this.overlay = overlay;
@@ -6369,5 +6722,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
6369
6722
  * Generated bundle index. Do not edit.
6370
6723
  */
6371
6724
 
6372
- export { MECX_MODAL_DATA, MECX_MODAL_DEFAULT_CONFIG, MONKEY_I18N_WRAPPER, MONKEY_POPOVER_OPTIONS, MonkeyAccordionComponent, MonkeyActionBarComponent, MonkeyAlertComponent, MonkeyAvatarComponent, MonkeyBadgeComponent, MonkeyBadgeDirective, MonkeyBreadcrumbComponent, MonkeyButtonComponent, MonkeyCheckboxComponent, MonkeyColumnChecked, MonkeyColumnExpansible, MonkeyColumnSortable, MonkeyColumnStick, MonkeyDateRangeComponent, MonkeyDirectivesModule, MonkeyDividerComponent, MonkeyErrorDirective, MonkeyFormFieldComponent, MonkeyFormFieldControl, MonkeyFormFieldModule, MonkeyHelperDirective, MonkeyIconButtonComponent, MonkeyIconComponent, MonkeyInfoDirective, MonkeyInputCodeComponent, MonkeyInputCurrencyDirective, MonkeyInputDirective, MonkeyInputModule, MonkeyInputUploadComponent, MonkeyLabelDirective, MonkeyModalActionsDirective, MonkeyModalComponent, MonkeyModalConfig, MonkeyModalContentDirective, MonkeyModalModule, MonkeyModalRef, MonkeyModalService, MonkeyModalSubtitleDirective, MonkeyModalTitleDirective, MonkeyOptionComponent, MonkeyPaginationActionComponent, MonkeyPaginationLabelComponent, MonkeyPaginationSizeComponent, MonkeyPopoverContentComponent, MonkeyPopoverDirective, MonkeyPrefixDirective, MonkeyRadioButtonComponent, MonkeySecurityLevelComponent, MonkeySelectComponent, MonkeyStatusComponent, MonkeySuffixDirective, MonkeyTableComponent, MonkeyTableModule, MonkeyToastComponent, MonkeyToastRef, MonkeyToastService, MonkeyToggleComponent, MonkeyToggleLineButtonComponent, MonkeyToggleLineComponent, MonkeyTooltipComponent, MonkeyTooltipDirective, getCurrencySymbol };
6725
+ export { MECX_COUNTRY_CODE, MECX_I18N_WRAPPER, MECX_MODAL_DATA, MECX_MODAL_DEFAULT_CONFIG, MECX_POPOVER_OPTIONS, MonkeyAccordionComponent, MonkeyActionBarComponent, MonkeyAlertComponent, MonkeyAvatarComponent, MonkeyBadgeComponent, MonkeyBadgeDirective, MonkeyBreadcrumbComponent, MonkeyButtonComponent, MonkeyCheckboxComponent, MonkeyColumnChecked, MonkeyColumnExpansible, MonkeyColumnSortable, MonkeyColumnStick, MonkeyDateRangeComponent, MonkeyDirectivesModule, MonkeyDividerComponent, MonkeyErrorDirective, MonkeyFormFieldComponent, MonkeyFormFieldControl, MonkeyFormFieldModule, MonkeyHelperDirective, MonkeyIconButtonComponent, MonkeyIconComponent, MonkeyInfoDirective, MonkeyInputCodeComponent, MonkeyInputCurrencyDirective, MonkeyInputDirective, MonkeyInputModule, MonkeyInputPhoneComponent, MonkeyInputUploadComponent, MonkeyLabelDirective, MonkeyModalActionsDirective, MonkeyModalComponent, MonkeyModalConfig, MonkeyModalContentDirective, MonkeyModalModule, MonkeyModalRef, MonkeyModalService, MonkeyModalSubtitleDirective, MonkeyModalTitleDirective, MonkeyOptionComponent, MonkeyPaginationActionComponent, MonkeyPaginationLabelComponent, MonkeyPaginationSizeComponent, MonkeyPopoverContentComponent, MonkeyPopoverDirective, MonkeyPrefixDirective, MonkeyRadioButtonComponent, MonkeySecurityLevelComponent, MonkeySelectComponent, MonkeyStatusComponent, MonkeySuffixDirective, MonkeyTableComponent, MonkeyTableModule, MonkeyToastComponent, MonkeyToastRef, MonkeyToastService, MonkeyToggleComponent, MonkeyToggleLineButtonComponent, MonkeyToggleLineComponent, MonkeyTooltipComponent, MonkeyTooltipDirective, getCurrencySymbol };
6373
6726
  //# sourceMappingURL=monkey-style-guide-v2.mjs.map