asksuite-citrus 3.15.8-beta.1 → 3.15.9-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/assets/icons/proprietary/dark-chatweb-contrast.svg +5 -0
  2. package/assets/icons/proprietary/dark-chatweb-default.svg +5 -0
  3. package/assets/icons/proprietary/dark-chatweb-disabled.svg +5 -0
  4. package/assets/icons/proprietary/dark-chatweb-grey.svg +5 -0
  5. package/assets/icons/proprietary/dark-chatweb-inverse.svg +5 -0
  6. package/assets/icons/proprietary/dark-email-contrast.svg +8 -0
  7. package/assets/icons/proprietary/dark-email-default.svg +8 -0
  8. package/assets/icons/proprietary/dark-email-disabled.svg +8 -0
  9. package/assets/icons/proprietary/dark-email-grey.svg +8 -0
  10. package/assets/icons/proprietary/dark-email-inverse.svg +8 -0
  11. package/assets/icons/proprietary/dark-facebook-contrast.svg +8 -0
  12. package/assets/icons/proprietary/dark-facebook-default.svg +8 -0
  13. package/assets/icons/proprietary/dark-facebook-disabled.svg +8 -0
  14. package/assets/icons/proprietary/dark-facebook-grey.svg +8 -0
  15. package/assets/icons/proprietary/dark-facebook-inverse.svg +8 -0
  16. package/assets/icons/proprietary/dark-instagram-contrast.svg +8 -0
  17. package/assets/icons/proprietary/dark-instagram-default.svg +8 -0
  18. package/assets/icons/proprietary/dark-instagram-disabled.svg +8 -0
  19. package/assets/icons/proprietary/dark-instagram-grey.svg +8 -0
  20. package/assets/icons/proprietary/dark-instagram-inverse.svg +8 -0
  21. package/assets/icons/proprietary/dark-phone-contrast.svg +7 -0
  22. package/assets/icons/proprietary/dark-phone-default.svg +7 -0
  23. package/assets/icons/proprietary/dark-phone-disabled.svg +7 -0
  24. package/assets/icons/proprietary/dark-phone-grey.svg +7 -0
  25. package/assets/icons/proprietary/dark-phone-inverse.svg +7 -0
  26. package/assets/icons/proprietary/dark-whatsapp-contrast.svg +8 -0
  27. package/assets/icons/proprietary/dark-whatsapp-default.svg +8 -0
  28. package/assets/icons/proprietary/dark-whatsapp-disabled.svg +8 -0
  29. package/assets/icons/proprietary/dark-whatsapp-grey.svg +8 -0
  30. package/assets/icons/proprietary/dark-whatsapp-inverse.svg +8 -0
  31. package/assets/icons/proprietary/light-chatweb-contrast.svg +5 -0
  32. package/assets/icons/proprietary/light-chatweb-default.svg +5 -0
  33. package/assets/icons/proprietary/light-chatweb-disabled.svg +5 -0
  34. package/assets/icons/proprietary/light-chatweb-grey.svg +5 -0
  35. package/assets/icons/proprietary/light-chatweb-inverse.svg +5 -0
  36. package/assets/icons/proprietary/light-email-contrast.svg +8 -0
  37. package/assets/icons/proprietary/light-email-default.svg +8 -0
  38. package/assets/icons/proprietary/light-email-disabled.svg +8 -0
  39. package/assets/icons/proprietary/light-email-grey.svg +8 -0
  40. package/assets/icons/proprietary/light-email-inverse.svg +8 -0
  41. package/assets/icons/proprietary/light-facebook-contrast.svg +8 -0
  42. package/assets/icons/proprietary/light-facebook-default.svg +8 -0
  43. package/assets/icons/proprietary/light-facebook-disabled.svg +8 -0
  44. package/assets/icons/proprietary/light-facebook-grey.svg +8 -0
  45. package/assets/icons/proprietary/light-facebook-inverse.svg +8 -0
  46. package/assets/icons/proprietary/light-instagram-contrast.svg +8 -0
  47. package/assets/icons/proprietary/light-instagram-default.svg +8 -0
  48. package/assets/icons/proprietary/light-instagram-disabled.svg +8 -0
  49. package/assets/icons/proprietary/light-instagram-grey.svg +8 -0
  50. package/assets/icons/proprietary/light-instagram-inverse.svg +8 -0
  51. package/assets/icons/proprietary/light-phone-contrast.svg +7 -0
  52. package/assets/icons/proprietary/light-phone-default.svg +7 -0
  53. package/assets/icons/proprietary/light-phone-disabled.svg +7 -0
  54. package/assets/icons/proprietary/light-phone-grey.svg +7 -0
  55. package/assets/icons/proprietary/light-phone-inverse.svg +7 -0
  56. package/assets/icons/proprietary/light-whatsapp-contrast.svg +8 -0
  57. package/assets/icons/proprietary/light-whatsapp-default.svg +8 -0
  58. package/assets/icons/proprietary/light-whatsapp-disabled.svg +8 -0
  59. package/assets/icons/proprietary/light-whatsapp-grey.svg +8 -0
  60. package/assets/icons/proprietary/light-whatsapp-inverse.svg +8 -0
  61. package/esm2022/lib/asksuite-citrus.module.mjs +36 -13
  62. package/esm2022/lib/components/icon-v2/icon-v2.component.mjs +65 -0
  63. package/esm2022/lib/constants/icons.mjs +17 -0
  64. package/esm2022/lib/directives/sizeable/sizeable.directive.mjs +33 -0
  65. package/esm2022/lib/interfaces/icons.type.mjs +2 -0
  66. package/esm2022/lib/services/custom-icon-register/custom-icon-register.service.mjs +46 -0
  67. package/esm2022/lib/services/dynamic-dropdown/dynamic-dropdown.service.mjs +28 -17
  68. package/esm2022/public-api.mjs +2 -1
  69. package/fesm2022/asksuite-citrus.mjs +263 -83
  70. package/fesm2022/asksuite-citrus.mjs.map +1 -1
  71. package/lib/asksuite-citrus.module.d.ts +7 -1
  72. package/lib/components/icon-v2/icon-v2.component.d.ts +27 -0
  73. package/lib/constants/icons.d.ts +3 -0
  74. package/lib/directives/sizeable/sizeable.directive.d.ts +10 -0
  75. package/lib/interfaces/icons.type.d.ts +4 -0
  76. package/lib/services/custom-icon-register/custom-icon-register.service.d.ts +18 -0
  77. package/lib/services/dynamic-dropdown/dynamic-dropdown.service.d.ts +12 -7
  78. package/package.json +1 -1
  79. package/public-api.d.ts +1 -0
@@ -24,6 +24,9 @@ import * as i1$4 from '@angular/common/http';
24
24
  import { parsePhoneNumber } from 'libphonenumber-js';
25
25
  import * as i1$5 from '@angular/material/progress-bar';
26
26
  import { MatProgressBarModule } from '@angular/material/progress-bar';
27
+ import * as i1$6 from '@angular/material/icon';
28
+ import { MatIcon, MatIconModule } from '@angular/material/icon';
29
+ import * as i2$1 from '@angular/platform-browser';
27
30
 
28
31
  class ButtonComponent {
29
32
  constructor() {
@@ -4018,7 +4021,212 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
4018
4021
  args: [TabComponent]
4019
4022
  }] } });
4020
4023
 
4024
+ class SizeableDirective {
4025
+ constructor() {
4026
+ this.size = 20;
4027
+ this.disabled = false;
4028
+ }
4029
+ ngOnChanges() { }
4030
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: SizeableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
4031
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.7", type: SizeableDirective, inputs: { size: "size", disabled: "disabled" }, host: { properties: { "class.sizeable": "true", "style.width.px": "this.size", "style.height.px": "this.size", "style.fontSize.px": "this.size" } }, usesOnChanges: true, ngImport: i0 }); }
4032
+ }
4033
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: SizeableDirective, decorators: [{
4034
+ type: Directive,
4035
+ args: [{
4036
+ host: {
4037
+ '[class.sizeable]': 'true',
4038
+ },
4039
+ }]
4040
+ }], propDecorators: { size: [{
4041
+ type: HostBinding,
4042
+ args: ['style.width.px']
4043
+ }, {
4044
+ type: HostBinding,
4045
+ args: ['style.height.px']
4046
+ }, {
4047
+ type: HostBinding,
4048
+ args: ['style.fontSize.px']
4049
+ }, {
4050
+ type: Input
4051
+ }], disabled: [{
4052
+ type: Input
4053
+ }] } });
4054
+
4055
+ const names = [
4056
+ 'chatweb',
4057
+ 'email',
4058
+ 'facebook',
4059
+ 'instagram',
4060
+ 'phone',
4061
+ 'whatsapp',
4062
+ ];
4063
+ const themes = ['dark', 'light'];
4064
+ const variations = [
4065
+ 'contrast',
4066
+ 'default',
4067
+ 'disabled',
4068
+ 'grey',
4069
+ 'inverse',
4070
+ ];
4071
+
4072
+ class StorageUtilService {
4073
+ constructor(localstorage) {
4074
+ this.localstorage = localstorage;
4075
+ }
4076
+ getItem(key) {
4077
+ return JSON.parse(this.localstorage.getItem(key));
4078
+ }
4079
+ setItem(key, value) {
4080
+ this.localstorage.setItem(key, JSON.stringify(value));
4081
+ }
4082
+ removeItem(key) {
4083
+ this.localstorage.removeItem(key);
4084
+ }
4085
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: StorageUtilService, deps: [{ token: Storage }], target: i0.ɵɵFactoryTarget.Injectable }); }
4086
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: StorageUtilService, providedIn: 'root' }); }
4087
+ }
4088
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: StorageUtilService, decorators: [{
4089
+ type: Injectable,
4090
+ args: [{
4091
+ providedIn: 'root'
4092
+ }]
4093
+ }], ctorParameters: () => [{ type: Storage }] });
4094
+
4095
+ class ThemeService {
4096
+ constructor(storageUtilService) {
4097
+ this.storageUtilService = storageUtilService;
4098
+ this.themeKey = 'asksuite-theme-color';
4099
+ this.theme$ = new BehaviorSubject('light');
4100
+ const theme = this.storageUtilService.getItem(this.themeKey) || 'light';
4101
+ this.theme$.next(theme);
4102
+ this.saveTheme();
4103
+ }
4104
+ getTheme() {
4105
+ return this.theme$.value;
4106
+ }
4107
+ setTheme(theme) {
4108
+ this.theme$.next(theme);
4109
+ this.saveTheme();
4110
+ }
4111
+ listenThemeChange() {
4112
+ return this.theme$.asObservable();
4113
+ }
4114
+ saveTheme() {
4115
+ document.body.className = this.theme$.value;
4116
+ this.storageUtilService.setItem(this.themeKey, this.theme$.value);
4117
+ }
4118
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ThemeService, deps: [{ token: StorageUtilService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4119
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
4120
+ }
4121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ThemeService, decorators: [{
4122
+ type: Injectable,
4123
+ args: [{
4124
+ providedIn: 'root'
4125
+ }]
4126
+ }], ctorParameters: () => [{ type: StorageUtilService }] });
4127
+
4128
+ class CustomIconsRegisterService {
4129
+ constructor(matIconRegistry, domSanitizer, theme) {
4130
+ this.matIconRegistry = matIconRegistry;
4131
+ this.domSanitizer = domSanitizer;
4132
+ this.theme = theme;
4133
+ }
4134
+ register() {
4135
+ const icons = this.getIconSrcs();
4136
+ for (const cIcon of icons) {
4137
+ this.matIconRegistry.addSvgIcon(cIcon, this.domSanitizer.bypassSecurityTrustResourceUrl(`assets/icons/proprietary/${cIcon}.svg`));
4138
+ }
4139
+ }
4140
+ getIcon$(name, variations) {
4141
+ return this.theme.listenThemeChange().pipe(map((theme) => `${theme}-${name}-${variations}`));
4142
+ }
4143
+ hasIcon(name) {
4144
+ return names.includes(name);
4145
+ }
4146
+ getIconSrcs() {
4147
+ let _icons = [];
4148
+ for (const theme of themes) {
4149
+ for (const variation of variations) {
4150
+ for (const name of names) {
4151
+ _icons.push(`${theme}-${name}-${variation}`);
4152
+ }
4153
+ }
4154
+ }
4155
+ return _icons;
4156
+ }
4157
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: CustomIconsRegisterService, deps: [{ token: i1$6.MatIconRegistry }, { token: i2$1.DomSanitizer }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4158
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: CustomIconsRegisterService, providedIn: 'root' }); }
4159
+ }
4160
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: CustomIconsRegisterService, decorators: [{
4161
+ type: Injectable,
4162
+ args: [{
4163
+ providedIn: 'root',
4164
+ }]
4165
+ }], ctorParameters: () => [{ type: i1$6.MatIconRegistry }, { type: i2$1.DomSanitizer }, { type: ThemeService }] });
4166
+
4167
+ class IconV2Component extends SizeableDirective {
4168
+ constructor(customIconRegister) {
4169
+ super();
4170
+ this.customIconRegister = customIconRegister;
4171
+ this.name = '';
4172
+ this.appearance = 'default';
4173
+ this.theme = 'light';
4174
+ this.matFontSet = 'material-icons';
4175
+ this.fontIcon = '';
4176
+ this.svgIcon = '';
4177
+ }
4178
+ ngOnInit() {
4179
+ this.prepareIcon();
4180
+ }
4181
+ ngOnChanges() {
4182
+ this.prepareIcon();
4183
+ }
4184
+ ngOnDestroy() {
4185
+ this.iconSubscription?.unsubscribe();
4186
+ }
4187
+ prepareIcon() {
4188
+ this.iconSubscription?.unsubscribe();
4189
+ if (this.customIconRegister.hasIcon(this.name)) {
4190
+ this.iconSubscription = this.prepareCustomIconName().subscribe((iconName) => {
4191
+ this.svgIcon = iconName;
4192
+ });
4193
+ }
4194
+ else {
4195
+ this.fontIcon = this.name;
4196
+ }
4197
+ }
4198
+ prepareCustomIconName() {
4199
+ let appearance = this.appearance;
4200
+ if (this.disabled)
4201
+ appearance = 'disabled';
4202
+ return this.customIconRegister.getIcon$(this.name, appearance);
4203
+ }
4204
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: IconV2Component, deps: [{ token: CustomIconsRegisterService }], target: i0.ɵɵFactoryTarget.Component }); }
4205
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: IconV2Component, isStandalone: true, selector: "ask-icon-v2", inputs: { name: "name", appearance: "appearance", theme: "theme", color: "color", matFontSet: "matFontSet" }, providers: [{ provide: SizeableDirective, useExisting: IconV2Component }], viewQueries: [{ propertyName: "matIcon", first: true, predicate: MatIcon, descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<mat-icon inline [style.color]=\"color\" [fontSet]=\"matFontSet\" [svgIcon]=\"svgIcon\">{{fontIcon}}</mat-icon>\n", styles: [":host{line-height:normal}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
4206
+ }
4207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: IconV2Component, decorators: [{
4208
+ type: Component,
4209
+ args: [{ selector: 'ask-icon-v2', standalone: true, imports: [MatIconModule], providers: [{ provide: SizeableDirective, useExisting: IconV2Component }], template: "<mat-icon inline [style.color]=\"color\" [fontSet]=\"matFontSet\" [svgIcon]=\"svgIcon\">{{fontIcon}}</mat-icon>\n", styles: [":host{line-height:normal}\n"] }]
4210
+ }], ctorParameters: () => [{ type: CustomIconsRegisterService }], propDecorators: { matIcon: [{
4211
+ type: ViewChild,
4212
+ args: [MatIcon, { static: true }]
4213
+ }], name: [{
4214
+ type: Input,
4215
+ args: [{ required: true }]
4216
+ }], appearance: [{
4217
+ type: Input
4218
+ }], theme: [{
4219
+ type: Input
4220
+ }], color: [{
4221
+ type: Input
4222
+ }], matFontSet: [{
4223
+ type: Input
4224
+ }] } });
4225
+
4021
4226
  Quill.register(HTMLPanelQuillBlot);
4227
+ function initMyLib(myLibService) {
4228
+ return new StorageUtilService(myLibService);
4229
+ }
4022
4230
  class AsksuiteCitrusModule {
4023
4231
  static forRoot(params) {
4024
4232
  return {
@@ -4031,7 +4239,11 @@ class AsksuiteCitrusModule {
4031
4239
  ]
4032
4240
  };
4033
4241
  }
4034
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: AsksuiteCitrusModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4242
+ constructor(customIconsRegisterService) {
4243
+ this.customIconsRegisterService = customIconsRegisterService;
4244
+ this.customIconsRegisterService.register();
4245
+ }
4246
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: AsksuiteCitrusModule, deps: [{ token: CustomIconsRegisterService }], target: i0.ɵɵFactoryTarget.NgModule }); }
4035
4247
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.7", ngImport: i0, type: AsksuiteCitrusModule, declarations: [ButtonComponent,
4036
4248
  InputComponent,
4037
4249
  SelectComponent,
@@ -4087,7 +4299,8 @@ class AsksuiteCitrusModule {
4087
4299
  NgxMaskDirective,
4088
4300
  NgxMaskPipe,
4089
4301
  MatProgressBarModule,
4090
- IconComponent], exports: [ButtonComponent,
4302
+ IconComponent,
4303
+ IconV2Component], exports: [ButtonComponent,
4091
4304
  InputComponent,
4092
4305
  SelectComponent,
4093
4306
  BoxComponent,
@@ -4127,9 +4340,14 @@ class AsksuiteCitrusModule {
4127
4340
  TagComponent,
4128
4341
  ArrowTagComponent,
4129
4342
  TabGroupComponent,
4130
- TabComponent] }); }
4343
+ TabComponent,
4344
+ IconV2Component] }); }
4131
4345
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: AsksuiteCitrusModule, providers: [
4132
- provideNgxMask()
4346
+ {
4347
+ provide: Storage,
4348
+ useValue: window.localStorage
4349
+ },
4350
+ provideNgxMask(),
4133
4351
  ], imports: [CommonModule,
4134
4352
  FormsModule,
4135
4353
  ReactiveFormsModule,
@@ -4137,7 +4355,8 @@ class AsksuiteCitrusModule {
4137
4355
  TranslateModule.forChild(),
4138
4356
  NgxSkeletonLoaderModule,
4139
4357
  MatTooltipModule,
4140
- MatProgressBarModule] }); }
4358
+ MatProgressBarModule,
4359
+ IconV2Component] }); }
4141
4360
  }
4142
4361
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: AsksuiteCitrusModule, decorators: [{
4143
4362
  type: NgModule,
@@ -4188,7 +4407,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
4188
4407
  ListItemDirective,
4189
4408
  ArrowTagComponent,
4190
4409
  TabGroupComponent,
4191
- TabComponent
4410
+ TabComponent,
4192
4411
  ],
4193
4412
  imports: [
4194
4413
  CommonModule,
@@ -4203,7 +4422,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
4203
4422
  NgxMaskDirective,
4204
4423
  NgxMaskPipe,
4205
4424
  MatProgressBarModule,
4206
- IconComponent
4425
+ IconComponent,
4426
+ IconV2Component
4207
4427
  ],
4208
4428
  exports: [
4209
4429
  ButtonComponent,
@@ -4246,13 +4466,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
4246
4466
  TagComponent,
4247
4467
  ArrowTagComponent,
4248
4468
  TabGroupComponent,
4249
- TabComponent
4469
+ TabComponent,
4470
+ IconV2Component
4250
4471
  ],
4251
4472
  providers: [
4252
- provideNgxMask()
4473
+ {
4474
+ provide: Storage,
4475
+ useValue: window.localStorage
4476
+ },
4477
+ provideNgxMask(),
4253
4478
  ]
4254
4479
  }]
4255
- }] });
4480
+ }], ctorParameters: () => [{ type: CustomIconsRegisterService }] });
4256
4481
 
4257
4482
  class ToastService {
4258
4483
  constructor(overlay, injector) {
@@ -4319,18 +4544,29 @@ class DynamicDropdownService {
4319
4544
  constructor(overlay) {
4320
4545
  this.overlay = overlay;
4321
4546
  this.overlayRefs = [];
4547
+ // Keep track of rendered dropdowns and their templates.
4548
+ this.renderedDropdowns = [];
4322
4549
  }
4323
4550
  /**
4324
- * Opens a new modal with the given configuration.
4551
+ * Opens a new dropdown with the given configuration.
4325
4552
  */
4326
4553
  open(config) {
4327
4554
  const overlayRef = this.createOverlay(config.referenceElement, config.positionParams, config.closeOnOutsideClick);
4328
4555
  this.overlayRefs.push(overlayRef);
4329
- const portal = this.attachTemplateToOverlay(config.templateToRender, config.viewContainerRef, overlayRef);
4556
+ // Attach the template to the overlay.
4557
+ this.attachTemplateToOverlay(config.templateToRender, config.viewContainerRef, overlayRef);
4558
+ // Track that this template is rendered.
4559
+ this.renderedDropdowns.push({ overlayRef, template: config.templateToRender });
4330
4560
  const afterClosed$ = this.createAfterClosedSubject();
4331
4561
  this.setupOverlayListeners(overlayRef, config.closeOnOutsideClick, afterClosed$);
4332
4562
  return this.createModalRef(overlayRef, afterClosed$);
4333
4563
  }
4564
+ /**
4565
+ * Exposes a function to check if a given template is rendered.
4566
+ */
4567
+ isTemplateRendered(template) {
4568
+ return this.renderedDropdowns.some(item => item.template === template);
4569
+ }
4334
4570
  /**
4335
4571
  * Creates an overlay with the specified position and configuration.
4336
4572
  */
@@ -4340,19 +4576,16 @@ class DynamicDropdownService {
4340
4576
  return this.overlay.create(overlayConfig);
4341
4577
  }
4342
4578
  /**
4343
- * Creates a flexible position strategy for the modal based on the base element.
4579
+ * Creates a flexible position strategy for the dropdown.
4344
4580
  */
4345
4581
  createPositionStrategy(baseElement, positionParams) {
4346
- const a = [
4347
- // { panelClass: 'ask-dropdown-top-right', originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top' },
4348
- // { panelClass: 'ask-dropdown-top-left', originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top' },
4582
+ const positions = [
4349
4583
  { panelClass: 'ask-dropdown-bottom-right', originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' },
4350
- // { panelClass: 'ask-dropdown-bottom-left', originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' }
4351
4584
  ];
4352
4585
  return this.overlay
4353
4586
  .position()
4354
4587
  .flexibleConnectedTo(baseElement)
4355
- .withPositions(a)
4588
+ .withPositions(positions)
4356
4589
  .withFlexibleDimensions(false)
4357
4590
  .withPush(false);
4358
4591
  }
@@ -4377,7 +4610,7 @@ class DynamicDropdownService {
4377
4610
  return portal;
4378
4611
  }
4379
4612
  /**
4380
- * Sets up listeners for the overlay, such as closing on backdrop click or escape key.
4613
+ * Sets up listeners for overlay events.
4381
4614
  */
4382
4615
  setupOverlayListeners(overlayRef, closeOnOutsideClick, afterClosed$) {
4383
4616
  if (closeOnOutsideClick) {
@@ -4390,13 +4623,13 @@ class DynamicDropdownService {
4390
4623
  });
4391
4624
  }
4392
4625
  /**
4393
- * Creates a subject that will emit when the modal is closed.
4626
+ * Creates a subject that emits when the dropdown is closed.
4394
4627
  */
4395
4628
  createAfterClosedSubject() {
4396
4629
  return new Subject();
4397
4630
  }
4398
4631
  /**
4399
- * Creates a reference for the modal that can be used to control the modal's lifecycle.
4632
+ * Creates a reference for controlling the dropdown.
4400
4633
  */
4401
4634
  createModalRef(overlayRef, afterClosed$) {
4402
4635
  return {
@@ -4405,23 +4638,26 @@ class DynamicDropdownService {
4405
4638
  };
4406
4639
  }
4407
4640
  /**
4408
- * Closes the modal and cleans up resources.
4641
+ * Closes the dropdown and cleans up.
4409
4642
  */
4410
4643
  closeModal(overlayRef, result, subject) {
4411
- const index = this.overlayRefs.indexOf(overlayRef);
4412
- if (index > -1) {
4413
- this.overlayRefs.splice(index, 1);
4644
+ const overlayIndex = this.overlayRefs.indexOf(overlayRef);
4645
+ if (overlayIndex > -1) {
4646
+ this.overlayRefs.splice(overlayIndex, 1);
4414
4647
  }
4648
+ // Remove from our rendered dropdowns tracking.
4649
+ this.renderedDropdowns = this.renderedDropdowns.filter(item => item.overlayRef !== overlayRef);
4415
4650
  overlayRef.dispose();
4416
4651
  subject.next(result);
4417
4652
  subject.complete();
4418
4653
  }
4419
4654
  /**
4420
- * Closes all open modals.
4655
+ * Closes all open dropdowns.
4421
4656
  */
4422
4657
  closeAll() {
4423
4658
  this.overlayRefs.forEach(ref => ref.dispose());
4424
4659
  this.overlayRefs = [];
4660
+ this.renderedDropdowns = [];
4425
4661
  }
4426
4662
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DynamicDropdownService, deps: [{ token: i1$2.Overlay }], target: i0.ɵɵFactoryTarget.Injectable }); }
4427
4663
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DynamicDropdownService, providedIn: 'root' }); }
@@ -4433,62 +4669,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
4433
4669
  }]
4434
4670
  }], ctorParameters: () => [{ type: i1$2.Overlay }] });
4435
4671
 
4436
- class StorageUtilService {
4437
- constructor(localstorage) {
4438
- this.localstorage = localstorage;
4439
- }
4440
- getItem(key) {
4441
- return JSON.parse(this.localstorage.getItem(key));
4442
- }
4443
- setItem(key, value) {
4444
- this.localstorage.setItem(key, JSON.stringify(value));
4445
- }
4446
- removeItem(key) {
4447
- this.localstorage.removeItem(key);
4448
- }
4449
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: StorageUtilService, deps: [{ token: Storage }], target: i0.ɵɵFactoryTarget.Injectable }); }
4450
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: StorageUtilService, providedIn: 'root' }); }
4451
- }
4452
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: StorageUtilService, decorators: [{
4453
- type: Injectable,
4454
- args: [{
4455
- providedIn: 'root'
4456
- }]
4457
- }], ctorParameters: () => [{ type: Storage }] });
4458
-
4459
- class ThemeService {
4460
- constructor(storageUtilService) {
4461
- this.storageUtilService = storageUtilService;
4462
- this.themeKey = 'asksuite-theme-color';
4463
- this.theme$ = new BehaviorSubject('light');
4464
- const theme = this.storageUtilService.getItem(this.themeKey) || 'light';
4465
- this.theme$.next(theme);
4466
- this.saveTheme();
4467
- }
4468
- getTheme() {
4469
- return this.theme$.value;
4470
- }
4471
- setTheme(theme) {
4472
- this.theme$.next(theme);
4473
- this.saveTheme();
4474
- }
4475
- listenThemeChange() {
4476
- return this.theme$.asObservable();
4477
- }
4478
- saveTheme() {
4479
- document.body.className = this.theme$.value;
4480
- this.storageUtilService.setItem(this.themeKey, this.theme$.value);
4481
- }
4482
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ThemeService, deps: [{ token: StorageUtilService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4483
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
4484
- }
4485
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ThemeService, decorators: [{
4486
- type: Injectable,
4487
- args: [{
4488
- providedIn: 'root'
4489
- }]
4490
- }], ctorParameters: () => [{ type: StorageUtilService }] });
4491
-
4492
4672
  const PHONE_MASK_PATTERN = {
4493
4673
  '0': {
4494
4674
  pattern: /0/,
@@ -4591,5 +4771,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
4591
4771
  * Generated bundle index. Do not edit.
4592
4772
  */
4593
4773
 
4594
- export { ASK_MODAL_CONFIG, ASK_MODAL_DATA, ASK_TOAST_CONFIG, AccordionComponent, ArrowTagComponent, AskButtonDirective, AskDropdownDirective, AskStrokedButtonDirective, AskTextButtonDirective, AskTooltipDirective, AsksuiteCitrusModule, AutocompleteComponent, AutofocusDirective, AvatarComponent, AvatarStatus, BadgeDirective, BoxComponent, ButtonComponent, CharacterCounterComponent, CheckboxComponent, ChipsComponent, DEFAULT_DATE_FORMAT, DEFAULT_PERIODS, DatePickerCalendarComponent, DatePickerComponent, DropdownContainerComponent, DynamicDropdownService, ExtendablePanelComponent, FLAG_PROVIDER_URL, ForceBreakLinePipe, IconComponent, InputComponent, InputDirective, ListItemDirective, LoadingBarComponent, ModalBodyDirective, ModalFooterDirective, ModalHeaderDirective, ModalRef, ModalService, OverlayComponent, PaginatePipe, PaginationComponent, PhoneDdiComponent, PhoneMaskValidator, RichtextToolboxDirective, ScrollDirective, SelectComponent, SkeletonComponent, SpinnerDirective, TabComponent, TabGroupComponent, TableComponent, TagComponent, ThemeService, ToastService, filterSelectedList, formatFrom, formatTo, removeDiacritics, searchArray, updatePaginationConfig };
4774
+ export { ASK_MODAL_CONFIG, ASK_MODAL_DATA, ASK_TOAST_CONFIG, AccordionComponent, ArrowTagComponent, AskButtonDirective, AskDropdownDirective, AskStrokedButtonDirective, AskTextButtonDirective, AskTooltipDirective, AsksuiteCitrusModule, AutocompleteComponent, AutofocusDirective, AvatarComponent, AvatarStatus, BadgeDirective, BoxComponent, ButtonComponent, CharacterCounterComponent, CheckboxComponent, ChipsComponent, DEFAULT_DATE_FORMAT, DEFAULT_PERIODS, DatePickerCalendarComponent, DatePickerComponent, DropdownContainerComponent, DynamicDropdownService, ExtendablePanelComponent, FLAG_PROVIDER_URL, ForceBreakLinePipe, IconComponent, IconV2Component, InputComponent, InputDirective, ListItemDirective, LoadingBarComponent, ModalBodyDirective, ModalFooterDirective, ModalHeaderDirective, ModalRef, ModalService, OverlayComponent, PaginatePipe, PaginationComponent, PhoneDdiComponent, PhoneMaskValidator, RichtextToolboxDirective, ScrollDirective, SelectComponent, SkeletonComponent, SpinnerDirective, TabComponent, TabGroupComponent, TableComponent, TagComponent, ThemeService, ToastService, filterSelectedList, formatFrom, formatTo, initMyLib, removeDiacritics, searchArray, updatePaginationConfig };
4595
4775
  //# sourceMappingURL=asksuite-citrus.mjs.map