@theseam/ui-common 0.4.4 → 0.4.5

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 (55) hide show
  1. package/datatable/models/preferences-accessor.d.ts +3 -15
  2. package/datatable/models/preferences.d.ts +2 -1
  3. package/datatable/services/datatable-preferences.service.d.ts +11 -14
  4. package/datatable/tokens/datatable-preferences-accessor.d.ts +2 -2
  5. package/esm2020/datatable/datatable/datatable.component.mjs +3 -3
  6. package/esm2020/datatable/models/preferences-accessor.mjs +1 -1
  7. package/esm2020/datatable/models/preferences.mjs +1 -1
  8. package/esm2020/datatable/services/datatable-preferences.service.mjs +34 -106
  9. package/esm2020/datatable/tokens/datatable-preferences-accessor.mjs +1 -1
  10. package/esm2020/framework/dashboard/dashboard-widgets/dashboard-widgets.service.mjs +9 -3
  11. package/esm2020/services/preferences/preferences-accessor.mjs +2 -0
  12. package/esm2020/services/preferences/preferences-manager.service.mjs +69 -0
  13. package/esm2020/services/preferences/preferences-record.mjs +74 -0
  14. package/esm2020/services/preferences/preferences.models.mjs +2 -0
  15. package/esm2020/services/public-api.mjs +5 -1
  16. package/esm2020/story-helpers/public-api.mjs +2 -1
  17. package/esm2020/story-helpers/story-preferences-accessor.service.mjs +34 -0
  18. package/esm2020/widget/preferences/widget-preferences.models.mjs +5 -0
  19. package/esm2020/widget/preferences/widget-preferences.service.mjs +78 -0
  20. package/esm2020/widget/preferences/widget-preferences.token.mjs +3 -0
  21. package/esm2020/widget/widget/widget.component.mjs +68 -31
  22. package/esm2020/widget/widget-token.mjs +2 -1
  23. package/fesm2015/theseam-ui-common-datatable.mjs +45 -116
  24. package/fesm2015/theseam-ui-common-datatable.mjs.map +1 -1
  25. package/fesm2015/theseam-ui-common-framework.mjs +9 -3
  26. package/fesm2015/theseam-ui-common-framework.mjs.map +1 -1
  27. package/fesm2015/theseam-ui-common-services.mjs +144 -8
  28. package/fesm2015/theseam-ui-common-services.mjs.map +1 -1
  29. package/fesm2015/theseam-ui-common-story-helpers.mjs +32 -1
  30. package/fesm2015/theseam-ui-common-story-helpers.mjs.map +1 -1
  31. package/fesm2015/theseam-ui-common-widget.mjs +152 -36
  32. package/fesm2015/theseam-ui-common-widget.mjs.map +1 -1
  33. package/fesm2020/theseam-ui-common-datatable.mjs +45 -116
  34. package/fesm2020/theseam-ui-common-datatable.mjs.map +1 -1
  35. package/fesm2020/theseam-ui-common-framework.mjs +8 -3
  36. package/fesm2020/theseam-ui-common-framework.mjs.map +1 -1
  37. package/fesm2020/theseam-ui-common-services.mjs +144 -8
  38. package/fesm2020/theseam-ui-common-services.mjs.map +1 -1
  39. package/fesm2020/theseam-ui-common-story-helpers.mjs +32 -1
  40. package/fesm2020/theseam-ui-common-story-helpers.mjs.map +1 -1
  41. package/fesm2020/theseam-ui-common-widget.mjs +148 -36
  42. package/fesm2020/theseam-ui-common-widget.mjs.map +1 -1
  43. package/package.json +1 -1
  44. package/services/preferences/preferences-accessor.d.ts +15 -0
  45. package/services/preferences/preferences-manager.service.d.ts +15 -0
  46. package/services/preferences/preferences-record.d.ts +28 -0
  47. package/services/preferences/preferences.models.d.ts +3 -0
  48. package/services/public-api.d.ts +4 -0
  49. package/story-helpers/public-api.d.ts +1 -0
  50. package/story-helpers/story-preferences-accessor.service.d.ts +19 -0
  51. package/widget/preferences/widget-preferences.models.d.ts +8 -0
  52. package/widget/preferences/widget-preferences.service.d.ts +21 -0
  53. package/widget/preferences/widget-preferences.token.d.ts +3 -0
  54. package/widget/widget/widget.component.d.ts +10 -2
  55. package/widget/widget-token.d.ts +1 -0
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, InjectionToken, Optional, Inject, HostBinding, Input, HostListener, forwardRef, isDevMode, TemplateRef, Component, ChangeDetectionStrategy, ViewEncapsulation, ContentChild, NgModule, ViewChild, EventEmitter, Output, Injectable, ViewChildren, SkipSelf, Host, Self, ContentChildren } from '@angular/core';
2
+ import { Directive, InjectionToken, Optional, Inject, HostBinding, Input, HostListener, forwardRef, isDevMode, TemplateRef, Component, ChangeDetectionStrategy, ViewEncapsulation, ContentChild, NgModule, ViewChild, EventEmitter, Output, Injectable, Injector, ViewChildren, SkipSelf, Host, Self, ContentChildren } from '@angular/core';
3
3
  import * as i3 from '@angular/cdk/portal';
4
4
  import { TemplatePortal, PortalModule, BasePortalOutlet, ComponentPortal } from '@angular/cdk/portal';
5
5
  import { BehaviorSubject, isObservable, from, Subject, of, combineLatest, defer, Observable } from 'rxjs';
@@ -21,7 +21,7 @@ import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coerci
21
21
  import * as i3$1 from '@angular/cdk/drag-drop';
22
22
  import { moveItemInArray, transferArrayItem, CdkDrag, DragDropModule } from '@angular/cdk/drag-drop';
23
23
  import { InputBoolean, InputNumber, mixinDisabled } from '@theseam/ui-common/core';
24
- import { THESEAM_WIDGET_ACCESSOR } from '@theseam/ui-common/widget';
24
+ import { THESEAM_WIDGET_DATA, THESEAM_WIDGET_ACCESSOR } from '@theseam/ui-common/widget';
25
25
  import * as i1$1 from '@theseam/ui-common/dynamic-component-loader';
26
26
  import * as i6 from '@theseam/ui-common/shared';
27
27
  import { TheSeamSharedModule } from '@theseam/ui-common/shared';
@@ -742,10 +742,15 @@ class DashboardWidgetsService {
742
742
  }
743
743
  createWidgetPortal(def, vcr) {
744
744
  if (typeof def.component === 'string') {
745
+ const injector = Injector.create({ providers: [
746
+ { provide: THESEAM_WIDGET_DATA, useValue: { widgetId: def.widgetId } }
747
+ ], parent: this._viewContainerRefSubject.value?.injector });
745
748
  return this._dynamicComponentLoaderModule
746
749
  .getComponentFactory(def.component)
747
750
  .pipe(map(componentFactory => {
748
- return new ComponentPortal(componentFactory.componentType, vcr, undefined, componentFactory /* ComponentFactoryBoundToModule */.ngModule.componentFactoryResolver);
751
+ return new ComponentPortal(componentFactory.componentType, vcr,
752
+ // undefined,
753
+ injector, componentFactory /* ComponentFactoryBoundToModule */.ngModule.componentFactoryResolver);
749
754
  }), take(1));
750
755
  }
751
756
  return def.componentFactoryResolver