@provoly/dashboard 1.4.8 → 1.4.10

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 (74) hide show
  1. package/components/paginator/paginator.component.d.ts +3 -1
  2. package/dataset/components/dataset-detail/dataset-detail.component.d.ts +4 -3
  3. package/esm2022/components/paginator/paginator.component.mjs +8 -4
  4. package/esm2022/dataset/components/dataset-detail/dataset-detail.component.mjs +9 -11
  5. package/esm2022/filters/autocomplete/autocomplete.component.mjs +2 -1
  6. package/esm2022/filters/date/date-filter.component.mjs +2 -1
  7. package/esm2022/filters/list/list-filter.component.mjs +7 -3
  8. package/esm2022/filters/number/number-filter.component.mjs +7 -3
  9. package/esm2022/filters/text/text-filter.component.mjs +7 -3
  10. package/esm2022/import/components/list/import-list.component.mjs +1 -1
  11. package/esm2022/lib/core/components/select/select.component.mjs +3 -3
  12. package/esm2022/lib/core/model/manifest.interface.mjs +1 -1
  13. package/esm2022/lib/core/model/result-set.interface.mjs +1 -1
  14. package/esm2022/lib/core/model/widget-map-manifest.interface.mjs +1 -1
  15. package/esm2022/lib/core/store/search/search.actions.mjs +1 -1
  16. package/esm2022/lib/core/store/search/search.effects.mjs +33 -8
  17. package/esm2022/lib/core/store/search/search.service.mjs +24 -6
  18. package/esm2022/lib/dashboard/components/widgets/widget-instanciator/widget-factory.service.mjs +20 -2
  19. package/esm2022/lib/dashboard/filter/base-filter.component.mjs +5 -2
  20. package/esm2022/lib/dashboard/filter/components/filter-group/filter-group.component.mjs +16 -3
  21. package/esm2022/lib/dashboard/filter/components/filter-instanciator/filter-instanciator.component.mjs +6 -2
  22. package/esm2022/lib/dashboard/store/dashboard.actions.mjs +3 -5
  23. package/esm2022/lib/dashboard/store/dashboard.reducers.mjs +16 -49
  24. package/esm2022/lib/dashboard/store/dashboard.selectors.mjs +2 -4
  25. package/esm2022/widgets/widget-aggregated-chart/component/widget-aggregated-chart.component.mjs +34 -15
  26. package/esm2022/widgets/widget-map/component/widget-map.component.mjs +60 -55
  27. package/esm2022/widgets/widget-map/interaction/tooltip-manager.class.mjs +41 -48
  28. package/esm2022/widgets/widget-map/utils/cql-utils.class.mjs +2 -2
  29. package/esm2022/widgets/widget-table/component/widget-table.component.mjs +32 -17
  30. package/fesm2022/provoly-dashboard-components-paginator.mjs +7 -3
  31. package/fesm2022/provoly-dashboard-components-paginator.mjs.map +1 -1
  32. package/fesm2022/provoly-dashboard-dataset.mjs +9 -11
  33. package/fesm2022/provoly-dashboard-dataset.mjs.map +1 -1
  34. package/fesm2022/provoly-dashboard-filters-autocomplete.mjs +1 -0
  35. package/fesm2022/provoly-dashboard-filters-autocomplete.mjs.map +1 -1
  36. package/fesm2022/provoly-dashboard-filters-date.mjs +1 -0
  37. package/fesm2022/provoly-dashboard-filters-date.mjs.map +1 -1
  38. package/fesm2022/provoly-dashboard-filters-list.mjs +6 -2
  39. package/fesm2022/provoly-dashboard-filters-list.mjs.map +1 -1
  40. package/fesm2022/provoly-dashboard-filters-number.mjs +6 -2
  41. package/fesm2022/provoly-dashboard-filters-number.mjs.map +1 -1
  42. package/fesm2022/provoly-dashboard-filters-text.mjs +6 -2
  43. package/fesm2022/provoly-dashboard-filters-text.mjs.map +1 -1
  44. package/fesm2022/provoly-dashboard-import.mjs +1 -1
  45. package/fesm2022/provoly-dashboard-import.mjs.map +1 -1
  46. package/fesm2022/provoly-dashboard-widgets-widget-aggregated-chart.mjs +32 -13
  47. package/fesm2022/provoly-dashboard-widgets-widget-aggregated-chart.mjs.map +1 -1
  48. package/fesm2022/provoly-dashboard-widgets-widget-map.mjs +100 -102
  49. package/fesm2022/provoly-dashboard-widgets-widget-map.mjs.map +1 -1
  50. package/fesm2022/provoly-dashboard-widgets-widget-table.mjs +32 -17
  51. package/fesm2022/provoly-dashboard-widgets-widget-table.mjs.map +1 -1
  52. package/fesm2022/provoly-dashboard.mjs +323 -284
  53. package/fesm2022/provoly-dashboard.mjs.map +1 -1
  54. package/filters/list/list-filter.component.d.ts +1 -0
  55. package/filters/number/number-filter.component.d.ts +1 -0
  56. package/filters/text/text-filter.component.d.ts +1 -0
  57. package/lib/core/model/manifest.interface.d.ts +2 -10
  58. package/lib/core/model/result-set.interface.d.ts +1 -0
  59. package/lib/core/model/widget-map-manifest.interface.d.ts +1 -0
  60. package/lib/core/store/search/search.actions.d.ts +4 -0
  61. package/lib/core/store/search/search.effects.d.ts +12 -1
  62. package/lib/core/store/search/search.service.d.ts +3 -1
  63. package/lib/dashboard/components/widgets/widget-instanciator/widget-factory.service.d.ts +1 -0
  64. package/lib/dashboard/components/widgets/widget-placement/widget-placement.utils.d.ts +1 -0
  65. package/lib/dashboard/filter/base-filter.component.d.ts +2 -1
  66. package/lib/dashboard/filter/components/filter-group/filter-group.component.d.ts +4 -1
  67. package/lib/dashboard/filter/components/filter-instanciator/filter-instanciator.component.d.ts +2 -1
  68. package/lib/dashboard/store/dashboard.actions.d.ts +9 -18
  69. package/lib/dashboard/store/dashboard.effects.d.ts +3 -1
  70. package/lib/dashboard/store/dashboard.selectors.d.ts +0 -9
  71. package/package.json +37 -37
  72. package/widgets/widget-aggregated-chart/component/widget-aggregated-chart.component.d.ts +2 -1
  73. package/widgets/widget-map/component/widget-map.component.d.ts +1 -2
  74. package/widgets/widget-map/interaction/tooltip-manager.class.d.ts +0 -2
@@ -12,7 +12,7 @@ import * as i1$3 from '@ngrx/effects';
12
12
  import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
13
13
  import * as i1 from '@ngrx/store';
14
14
  import { createAction, props, createReducer, on, createFeatureSelector, createSelector, StoreModule } from '@ngrx/store';
15
- import { of, Subscription, filter, combineLatest, debounceTime, BehaviorSubject, map, Subject, windowTime, switchMap, mergeMap, from as from$1, forkJoin, catchError as catchError$1, startWith, throwError, tap as tap$1, withLatestFrom as withLatestFrom$1, share, merge, ReplaySubject, combineLatestWith, distinctUntilChanged as distinctUntilChanged$1, delay, fromEvent, auditTime, interval } from 'rxjs';
15
+ import { of, Subscription, filter, combineLatest, debounceTime, BehaviorSubject, map, Subject, windowTime, switchMap, mergeMap, from as from$1, forkJoin, catchError as catchError$1, startWith, throwError, tap as tap$1, combineLatestWith, merge, distinctUntilChanged as distinctUntilChanged$1, withLatestFrom as withLatestFrom$1, EMPTY, share, ReplaySubject, delay, fromEvent, auditTime, interval } from 'rxjs';
16
16
  import * as i3$1 from '@angular/platform-browser';
17
17
  import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
18
18
  import * as i3$2 from '@angular/cdk/a11y';
@@ -3833,6 +3833,7 @@ const DashboardActions = {
3833
3833
  setRefreshRate: createAction('[Dashboard] (bus) setting refreshRate', props()),
3834
3834
  updateManifestsList: createAction('[Dashboard] (bus) received manifests list', props()),
3835
3835
  fetchStaticManifest: createAction('[Dashboard] (bus) fetching staticManifest', props()),
3836
+ fetchMoreItems: createAction('[Dashboard] (bus) fetching more items', props()),
3836
3837
  endLoading: createAction('[Dashboard] end loading'),
3837
3838
  updateStaticManifest: createAction('[Dashboard] (bus) received staticManifest', props()),
3838
3839
  loadManifest: createAction('[Dashboard] (bus) load manifest', props()),
@@ -3887,10 +3888,7 @@ const DashboardActions = {
3887
3888
  addManifestMetadata: createAction('[Dashboard] Add manifest metadata', props()),
3888
3889
  deleteManifestMetadata: createAction('[Dashboard] Delete manifest metadata', props()),
3889
3890
  triggerAggregate: createAction('[Dashboard] (bus) Triggering aggregates for datasource', props()),
3890
- loadPresentation: createAction('[Dashboard] load presentation', props()),
3891
- initDefaultLayerGroup: createAction('[Dashboard] init default layer group', props()),
3892
- updateLayerVisibility: createAction('[Dashboard] update visible layers on the layer group', props()),
3893
- updateLayerGroups: createAction('[Dashboard] update all layer groups', props())
3891
+ loadPresentation: createAction('[Dashboard] load presentation', props())
3894
3892
  };
3895
3893
 
3896
3894
  var DashboardGridLayout;
@@ -4080,7 +4078,6 @@ const wmsFeatures = (componentId) => {
4080
4078
  };
4081
4079
  const displayOptions = createSelector(feature$5, (state) => state?.display ?? BASE_DISPLAY_OPTIONS);
4082
4080
  const capabilities = createSelector(feature$5, (state) => state?.capabilities);
4083
- const layerGroups = createSelector(feature$5, (state) => state?.manifests.manifest.layerGroups ?? []);
4084
4081
  const DashboardSelectors = {
4085
4082
  feature: feature$5,
4086
4083
  rank,
@@ -4117,8 +4114,7 @@ const DashboardSelectors = {
4117
4114
  datasourceFilters,
4118
4115
  wmsFeatures,
4119
4116
  displayOptions,
4120
- capabilities,
4121
- layerGroups
4117
+ capabilities
4122
4118
  };
4123
4119
 
4124
4120
  const SearchActions = {
@@ -4204,20 +4200,31 @@ class SearchService {
4204
4200
  this.transformations = [];
4205
4201
  this.filters = {};
4206
4202
  this.limits = {};
4203
+ this.datasources = [];
4207
4204
  store.select(DashboardSelectors.datasourceFilters).subscribe((filters) => {
4208
4205
  this.filters = filters;
4209
4206
  });
4210
4207
  store.select(ConfigSelectors.limits).subscribe((limits) => {
4211
4208
  this.limits = limits;
4212
4209
  });
4210
+ store.select(DataSourceSelectors.getDataSources).subscribe((datasources) => {
4211
+ this.datasources = datasources;
4212
+ });
4213
4213
  }
4214
- getItems(id, quickOrder, excludeGeo) {
4215
- const params = this.getItemsFilter(id, this.getOrder(quickOrder)).append('excludeGeo', excludeGeo ?? false);
4214
+ getItems(id, quickOrder, excludeGeo, searchAfter) {
4215
+ const params = this.getItemsFilter(id, this.getOrder(quickOrder));
4216
4216
  if (!id) {
4217
4217
  console.warn('Not sending items request with no datasource attached.');
4218
4218
  return of({ items: {}, relations: [] });
4219
4219
  }
4220
- return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => this.httpClient.get(encodeURI(`${url}/data-sources/id/${id}/items`), { params })), map((rs) => this.applyTransformations('current', rs)));
4220
+ return this.store.select(ConfigSelectors.dataUrl).pipe(mergeMap((url) => {
4221
+ const ds = this.datasources.find((d) => d.id === id);
4222
+ return this.httpClient.post(encodeURI(`${url}/data-sources/id/${id}/items`), {
4223
+ type: ds?.sourceType === 'namedQuery' ? ds.request.type : NamedQueryTypes.MONO_CLASS,
4224
+ excludeGeo: excludeGeo ?? false,
4225
+ searchAfter: searchAfter ?? undefined
4226
+ }, { params });
4227
+ }), map((rs) => this.applyTransformations('current', rs)));
4221
4228
  }
4222
4229
  getItemsSerializedParams(id, quickOrder = {}) {
4223
4230
  return '|' + this.getItemsFilter(id, this.getOrder(quickOrder[id])).toString() + '|';
@@ -4248,8 +4255,10 @@ class SearchService {
4248
4255
  });
4249
4256
  }
4250
4257
  if (includeLimit) {
4251
- const limit = this.limits[id] ?? this.limits['default'];
4252
- params = params.append('limit', limit);
4258
+ const limit = this.limits[id];
4259
+ if (limit) {
4260
+ params = params.append('limit', limit);
4261
+ }
4253
4262
  }
4254
4263
  return params;
4255
4264
  }
@@ -4258,6 +4267,9 @@ class SearchService {
4258
4267
  if (quickOrder) {
4259
4268
  params = params.append('order', `${quickOrder.attribute},${quickOrder.asc ?? ''}`);
4260
4269
  }
4270
+ else {
4271
+ params = params.append('order', 'true,asc');
4272
+ }
4261
4273
  return params;
4262
4274
  }
4263
4275
  /**
@@ -5011,32 +5023,283 @@ const relationTypeReducer = createReducer(initialRelationTypeState, on(RelationT
5011
5023
  openModal: false
5012
5024
  })));
5013
5025
 
5026
+ class BaseWidgetComponent extends SubscriptionnerDirective {
5027
+ set widgetIndex(index) {
5028
+ this.widgetIndex$.next(index);
5029
+ }
5030
+ set staticManifest(manifest) {
5031
+ this.staticManifest$.next(manifest);
5032
+ }
5033
+ set _manifest$(manifest) {
5034
+ this.manifest$ = manifest;
5035
+ this.sub?.unsubscribe();
5036
+ this.observableList$.next([manifest]);
5037
+ }
5038
+ get widgetIndex() {
5039
+ return this.widgetIndex$.getValue();
5040
+ }
5041
+ constructor(store, el) {
5042
+ super();
5043
+ this.store = store;
5044
+ this.el = el;
5045
+ this.widgetIndex$ = new BehaviorSubject(0);
5046
+ this.manifest = { type: 'placeholder' };
5047
+ this.observableList$ = new BehaviorSubject([]);
5048
+ this.staticManifest$ = new BehaviorSubject(null);
5049
+ this._widgetSize$ = new BehaviorSubject({ width: 300, height: 300 });
5050
+ this.open$ = new Subject();
5051
+ this.manifestModified = new EventEmitter();
5052
+ this.manifest$ = this.observableList$.pipe(combineLatestWith(this.staticManifest$), switchMap(([observables, staticManifest]) => (!staticManifest ? merge(...observables) : of(staticManifest))), distinctUntilChanged$1((p, v) => equal(p, v)));
5053
+ this.subscriptions.add(this.manifest$.subscribe((manifest) => (this.manifest = manifest)));
5054
+ this.displayHeader$ = this.manifest$.pipe(map((manifest) => manifest.header === undefined || manifest.header));
5055
+ this.widgetSize$ = this._widgetSize$.pipe(startWith({
5056
+ width: 300,
5057
+ height: 300
5058
+ }), distinctUntilChanged$1((p, c) => p.width === c.width && p.height === c.height), debounceTime(100), distinctUntilChanged$1((p, c) => p.width === c.width && p.height === c.height));
5059
+ }
5060
+ ngAfterViewChecked() {
5061
+ const boundingRect = this.el.nativeElement.getBoundingClientRect();
5062
+ this._widgetSize$.next({ width: boundingRect.width, height: boundingRect.height });
5063
+ }
5064
+ toImage() {
5065
+ return Promise.reject('Not yet implemented');
5066
+ }
5067
+ changeWidgetTitle($event) {
5068
+ this.manifest.title = $event;
5069
+ }
5070
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BaseWidgetComponent, deps: [{ token: i1.Store }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
5071
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: BaseWidgetComponent, selector: "pry-base-widget", inputs: { open$: "open$", widgetIndex: "widgetIndex", staticManifest: "staticManifest" }, outputs: { manifestModified: "manifestModified" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
5072
+ }
5073
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BaseWidgetComponent, decorators: [{
5074
+ type: Component,
5075
+ args: [{ selector: 'pry-base-widget', template: '' }]
5076
+ }], ctorParameters: () => [{ type: i1.Store }, { type: i0.ElementRef }], propDecorators: { open$: [{
5077
+ type: Input
5078
+ }], manifestModified: [{
5079
+ type: Output
5080
+ }], widgetIndex: [{
5081
+ type: Input
5082
+ }], staticManifest: [{
5083
+ type: Input
5084
+ }] } });
5085
+
5086
+ class WidgetFillerComponent extends BaseWidgetComponent {
5087
+ constructor(store, el) {
5088
+ super(store, el);
5089
+ }
5090
+ get index() {
5091
+ // @ts-ignore
5092
+ return this.manifest.options?.index ?? 0;
5093
+ }
5094
+ moveToPlace() {
5095
+ // @ts-ignore
5096
+ const startLayout = this.manifest.options?.sourcePlace;
5097
+ // @ts-ignore
5098
+ const targetLayout = this.manifest.options?.targetPlace;
5099
+ // @ts-ignore
5100
+ if (startLayout && targetLayout && this.manifest.options?.windowManifest && this.index !== '-') {
5101
+ // @ts-ignore
5102
+ const newWindowManifest = JSON.parse(JSON.stringify(this.manifest.options?.windowManifest));
5103
+ const targetWidgetIndex = newWindowManifest.widgets.findIndex((w) => w.layout.x === targetLayout.x &&
5104
+ w.layout.y === targetLayout.y &&
5105
+ w.layout.width === targetLayout.width &&
5106
+ w.layout.height === targetLayout.height);
5107
+ const startWidgetIndex = newWindowManifest.widgets.findIndex((w) => w.layout.x === startLayout.x &&
5108
+ w.layout.y === startLayout.y &&
5109
+ w.layout.width === startLayout.width &&
5110
+ w.layout.height === startLayout.height);
5111
+ if (targetWidgetIndex !== -1) {
5112
+ newWindowManifest.widgets[targetWidgetIndex].layout = startLayout;
5113
+ }
5114
+ newWindowManifest.widgets[startWidgetIndex].layout = targetLayout;
5115
+ this.store.dispatch(DashboardActions.updateDashboardManifest({ manifest: newWindowManifest }));
5116
+ }
5117
+ }
5118
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetFillerComponent, deps: [{ token: i1.Store }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
5119
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: WidgetFillerComponent, selector: "pry-widget-filler", usesInheritance: true, ngImport: i0, template: "<div class=\"filler-backdrop\" (click)=\"moveToPlace()\">\n <div class=\"a-indicator-block\">\n <p>{{ index === -1 ? '-' : index + 1 }}</p>\n </div>\n</div>\n" }); }
5120
+ }
5121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetFillerComponent, decorators: [{
5122
+ type: Component,
5123
+ args: [{ selector: 'pry-widget-filler', template: "<div class=\"filler-backdrop\" (click)=\"moveToPlace()\">\n <div class=\"a-indicator-block\">\n <p>{{ index === -1 ? '-' : index + 1 }}</p>\n </div>\n</div>\n" }]
5124
+ }], ctorParameters: () => [{ type: i1.Store }, { type: i0.ElementRef }] });
5125
+
5126
+ class WidgetPlaceholderComponent extends BaseWidgetComponent {
5127
+ constructor(store, el) {
5128
+ super(store, el);
5129
+ }
5130
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetPlaceholderComponent, deps: [{ token: i1.Store }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
5131
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: WidgetPlaceholderComponent, selector: "pry-widget-placeholder", usesInheritance: true, ngImport: i0, template: "<p>{{ '@pry.widget.unrecognized' | i18n: { type: manifest ? manifest.type : 'placeholder' } }}</p>\n", dependencies: [{ kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
5132
+ }
5133
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetPlaceholderComponent, decorators: [{
5134
+ type: Component,
5135
+ args: [{ selector: 'pry-widget-placeholder', template: "<p>{{ '@pry.widget.unrecognized' | i18n: { type: manifest ? manifest.type : 'placeholder' } }}</p>\n" }]
5136
+ }], ctorParameters: () => [{ type: i1.Store }, { type: i0.ElementRef }] });
5137
+
5138
+ const WIDGET_DEFINITION = new InjectionToken('Widgets definition');
5139
+ const NON_EXCLUDE_GEO_WIDGET_TYPES = {
5140
+ values: ['map', 'tile']
5141
+ };
5142
+ class WidgetFactoryService {
5143
+ constructor(injector, reference, store) {
5144
+ this.injector = injector;
5145
+ this.store = store;
5146
+ this.reference$ = new BehaviorSubject({
5147
+ placeholder: { name: 'placeholder', component: WidgetPlaceholderComponent },
5148
+ filler: { name: 'filler', component: WidgetFillerComponent }
5149
+ });
5150
+ this.moduleRefCache = {};
5151
+ this.datasources = [];
5152
+ this.putDefinitions(reference);
5153
+ this.store.select(DataSourceSelectors.getDataSources).subscribe((datasources) => (this.datasources = datasources));
5154
+ }
5155
+ resolveComponent(manifest) {
5156
+ if (this.moduleRefCache[manifest.type]) {
5157
+ return of(this.moduleRefCache[manifest.type]);
5158
+ }
5159
+ if (!!manifest && this.reference$.getValue()[manifest.type]) {
5160
+ // @ts-ignore
5161
+ if (this.reference$.getValue()[manifest.type].load === undefined) {
5162
+ this.moduleRefCache[manifest.type] = this.reference$.getValue()[manifest.type].component;
5163
+ return of(this.moduleRefCache[manifest.type]);
5164
+ }
5165
+ else {
5166
+ return from$1(this.reference$.getValue()[manifest.type].load().then((fn) => {
5167
+ this.moduleRefCache[manifest.type] = fn(this.injector);
5168
+ return this.moduleRefCache[manifest.type];
5169
+ }));
5170
+ }
5171
+ }
5172
+ else {
5173
+ this.moduleRefCache[manifest.type] = this.reference$.getValue()['placeholder'].component;
5174
+ return of(this.moduleRefCache[manifest.type]);
5175
+ }
5176
+ }
5177
+ putDefinitions(definitions) {
5178
+ this.reference$.next({
5179
+ ...this.reference$.getValue(),
5180
+ ...definitions
5181
+ });
5182
+ }
5183
+ isModuleLoaded(type) {
5184
+ return this.reference$.pipe(map((componentDefs) => !!componentDefs[type]));
5185
+ }
5186
+ datasourcesToAutoLoad(manifest) {
5187
+ const widgetDefinition = this.reference$.getValue()[manifest.type];
5188
+ const datasourcesArray = Array.isArray(manifest.datasource ?? [])
5189
+ ? (manifest.datasource ?? [])
5190
+ : [manifest.datasource];
5191
+ return datasourcesArray
5192
+ .filter((datasource) => {
5193
+ const matching = this.datasources.find((ds) => ds.id === datasource);
5194
+ return (!!matching &&
5195
+ (widgetDefinition.autoLoadDatasource === undefined ||
5196
+ widgetDefinition.autoLoadDatasource === 'all' ||
5197
+ (widgetDefinition.autoLoadDatasource === 'geo' && DatasourceUtils.isGeo(matching)) ||
5198
+ (widgetDefinition.autoLoadDatasource === 'not-geo' && !DatasourceUtils.isGeo(matching))));
5199
+ })
5200
+ .map((datasetId) => {
5201
+ const matching = this.datasources.find((ds) => ds.id === datasetId);
5202
+ return { datasetId: datasetId, excludeGeo: this.calculateExcludeGeo(manifest, matching) };
5203
+ });
5204
+ }
5205
+ calculateExcludeGeo(manifest, matching) {
5206
+ if (manifest.excludeGeo === undefined || manifest.excludeGeo === 'widget-type-based') {
5207
+ return !NON_EXCLUDE_GEO_WIDGET_TYPES.values.includes(manifest.type);
5208
+ }
5209
+ switch (manifest.excludeGeo) {
5210
+ case 'exclude-all':
5211
+ return true;
5212
+ case 'exclude-none':
5213
+ return false;
5214
+ case 'exclude-geo':
5215
+ return DatasourceUtils.isGeo(matching);
5216
+ case 'exclude-not-geo':
5217
+ return !DatasourceUtils.isGeo(matching);
5218
+ }
5219
+ }
5220
+ aggregatesToAutoLoad(manifest) {
5221
+ const widgetDefinition = this.reference$.getValue()[manifest.type];
5222
+ const datasourcesArray = Array.isArray(manifest.datasource ?? [])
5223
+ ? (manifest.datasource ?? [])
5224
+ : [manifest.datasource];
5225
+ return datasourcesArray.filter(() => widgetDefinition.autoLoadDatasource === undefined || widgetDefinition.autoLoadDatasource === 'aggregate');
5226
+ }
5227
+ getObjectsToAutoLoad(manifest) {
5228
+ const datasources = [];
5229
+ const aggregates = [];
5230
+ manifest.windows.forEach((windowManifest) => {
5231
+ (windowManifest.widgets ?? []).forEach((widgetManifest) => {
5232
+ this.datasourcesToAutoLoad(widgetManifest).forEach((res) => {
5233
+ if (res.datasetId) {
5234
+ datasources.push(res);
5235
+ }
5236
+ });
5237
+ this.aggregatesToAutoLoad(widgetManifest).forEach((ds) => aggregates.push(ds));
5238
+ });
5239
+ });
5240
+ return { datasources, aggregates };
5241
+ }
5242
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetFactoryService, deps: [{ token: i0.Injector }, { token: WIDGET_DEFINITION }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
5243
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetFactoryService, providedIn: 'root' }); }
5244
+ }
5245
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetFactoryService, decorators: [{
5246
+ type: Injectable,
5247
+ args: [{
5248
+ providedIn: 'root'
5249
+ }]
5250
+ }], ctorParameters: () => [{ type: i0.Injector }, { type: undefined, decorators: [{
5251
+ type: Inject,
5252
+ args: [WIDGET_DEFINITION]
5253
+ }] }, { type: i1.Store }] });
5254
+
5014
5255
  class SearchEffects {
5015
- constructor(actions$, searchService, store) {
5256
+ constructor(actions$, searchService, store, widgetFactoryService) {
5016
5257
  this.actions$ = actions$;
5017
5258
  this.searchService = searchService;
5018
5259
  this.store = store;
5019
- this.searchNamed$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.getDatasourceItems), withLatestFrom$1(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.quickOrder)), filter(([_, rank]) => rank === 0), filter(([props, rank]) => props.id !== DEFAULT_NAMED_QUERY_ID && props.id !== EXPLORE_NAMED_QUERY_ID), mergeMap(([props, rank, quickOrder]) => this.searchService.getItems(props.id, quickOrder[props.id], props.excludeGeo).pipe(map((resultSet) => SearchActions.searchSuccess({
5260
+ this.widgetFactoryService = widgetFactoryService;
5261
+ this.searchNamed$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.getDatasourceItems), withLatestFrom$1(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.quickOrder), this.store.select(DashboardSelectors.resultSets)), filter(([_, rank]) => rank === 0), filter(([props, rank]) => props.id !== DEFAULT_NAMED_QUERY_ID && props.id !== EXPLORE_NAMED_QUERY_ID), distinctUntilChanged((p, c) => equal(p, c)), debounceTime(100), mergeMap(([props, rank, quickOrder, rs]) => this.searchService
5262
+ .getItems(props.id, quickOrder[props.id], props.excludeGeo, props.next ? rs[props.id].searchAfter : undefined)
5263
+ .pipe(map((resultSet) => SearchActions.searchSuccess({
5020
5264
  resultSet,
5021
5265
  id: props.id,
5022
- params: this.searchService.getItemsSerializedParams(props.id, quickOrder)
5266
+ params: this.searchService.getItemsSerializedParams(props.id, quickOrder),
5267
+ next: props.next
5023
5268
  })), catchError$1((error) => [SearchActions.searchFailure({ error, id: props.id })])))));
5269
+ this.fetchMore$ = createEffect(() => this.actions$.pipe(ofType(DashboardActions.fetchMoreItems), withLatestFrom$1(this.store.select(DashboardSelectors.rank), this.store.select(DashboardSelectors.resultSets)), filter(([props, rank, rs]) => rank === 0 && !!rs[props.id].searchAfter), debounceTime(300), mergeMap(([props]) => {
5270
+ const ds = this.widgetFactoryService.datasourcesToAutoLoad({
5271
+ type: props.widgetType,
5272
+ datasource: [props.id]
5273
+ })[0];
5274
+ if (!!ds) {
5275
+ return of(SearchActions.getDatasourceItems({
5276
+ id: ds.datasetId,
5277
+ excludeGeo: ds.excludeGeo,
5278
+ from: 'fetchMore',
5279
+ next: true
5280
+ }));
5281
+ }
5282
+ else {
5283
+ return EMPTY;
5284
+ }
5285
+ })));
5024
5286
  this.search$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.search), mergeMap((props) => this.searchService.search(props.payload).pipe(map((resultSet) => SearchActions.searchSuccess({ resultSet, id: props.id })), catchError$1((error) => [SearchActions.searchFailure({ error, id: props.id })])))));
5025
5287
  this.searchSuccess$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.searchSuccess), map((action) => DashboardActions.updateResultSet({
5026
5288
  id: action.id ?? DEFAULT_NAMED_QUERY_ID,
5027
5289
  resultSet: action.resultSet,
5028
- params: action.params
5290
+ params: action.params,
5291
+ next: action.next
5029
5292
  }))));
5030
5293
  this.getPossibleFilterValues$ = createEffect(() => this.actions$.pipe(ofType(SearchActions.getPossibleFilterValues), mergeMap((action) => this.searchService
5031
5294
  .autocomplete(action.attributes, '', action.limit)
5032
5295
  .pipe(map((values) => SearchActions.setPossibleFilterValues({ filterId: action.filterId, values }))))));
5033
5296
  }
5034
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchEffects, deps: [{ token: i1$3.Actions }, { token: SearchService }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
5297
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchEffects, deps: [{ token: i1$3.Actions }, { token: SearchService }, { token: i1.Store }, { token: WidgetFactoryService }], target: i0.ɵɵFactoryTarget.Injectable }); }
5035
5298
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchEffects }); }
5036
5299
  }
5037
5300
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: SearchEffects, decorators: [{
5038
5301
  type: Injectable
5039
- }], ctorParameters: () => [{ type: i1$3.Actions }, { type: SearchService }, { type: i1.Store }] });
5302
+ }], ctorParameters: () => [{ type: i1$3.Actions }, { type: SearchService }, { type: i1.Store }, { type: WidgetFactoryService }] });
5040
5303
 
5041
5304
  const searchFeatureKey = '@pry/search';
5042
5305
  const initialSearchState = {
@@ -7366,7 +7629,7 @@ class PrySelectComponent extends SubscriptionnerDirective {
7366
7629
  multi: true
7367
7630
  },
7368
7631
  SelectA11yService
7369
- ], viewQueries: [{ propertyName: "optionsModal", first: true, predicate: ["optionsModal"], descendants: true, read: TemplateRef }, { propertyName: "selectElement", first: true, predicate: ["selectElement"], descendants: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"a-pry-select\"\n [attr.aria-disabled]=\"disabled\"\n #selectElement\n [class.-focused]=\"focused\"\n (click)=\"handleClick()\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-owns]=\"open ? modalId : null\"\n aria-haspopup=\"listbox\"\n tabindex=\"0\"\n cdkMonitorElementFocus\n (cdkFocusChange)=\"onFocusChange($event)\"\n (keydown)=\"onKeydownSelect($event)\"\n>\n <div class=\"a-pry-select__content\">\n @if (autocomplete) {\n <input\n type=\"text\"\n class=\"a-pry-select__search\"\n [ngModel]=\"search$.getValue()\"\n (ngModelChange)=\"search($event, true)\"\n aria-autocomplete=\"list\"\n [attr.aria-controls]=\"open ? modalId : null\"\n [attr.aria-disabled]=\"disabled\"\n [disabled]=\"disabled\"\n (keydown)=\"onKeydownAutocompleteInput($event)\"\n [placeholder]=\"placeholder ?? ''\"\n (keydown.enter)=\"enterPressed($event)\"\n #input\n />\n } @else if ((valueItems$ | async).length === 0) {\n <span class=\"a-pry-select__placeholder\">{{ placeholder }}</span>\n <div class=\"a-pry-select__filler\"></div>\n } @else {\n @for (item of valueItems$ | async; track !!item.id ? item.id : item) {\n <div\n class=\"a-pry-select__value\"\n [class.pry-select-form]=\"isForm\"\n [class.-multiple]=\"multiple\"\n [ngClass]=\"item ? item[bindClasses ?? ''] ?? {} : {}\"\n >\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item, clear }\"></ng-container>\n } @else {\n <pry-icon\n *ngIf=\"bindIcon\"\n [iconSvg]=\"item[bindIcon]\"\n [width]=\"iconSize[0]\"\n [height]=\"iconSize[1]\"\n ></pry-icon>\n @if (bindLabel ? item?.[bindLabel] : item; as value) {\n {{ (i18nPrefix ?? '') + value | i18n: { warn: false } }}\n <span\n *ngIf=\"multiple && clearable\"\n class=\"a-pry-select__clear\"\n (click)=\"clear($event, item)\"\n aria-hidden=\"true\"\n >\u00D7</span\n >\n }\n }\n </div>\n }\n <div class=\"a-pry-select__filler\"></div>\n }\n </div>\n <div class=\"a-pry-select__actions\">\n <div class=\"a-pry-select__actions__clear-button\">\n @if (clearable && (search$ | async)) {\n <span class=\"a-pry-select__clear\" (click)=\"clearAll($event)\" aria-hidden=\"true\">\u00D7</span>\n }\n </div>\n <pry-icon\n class=\"a-pry-select__toggle\"\n [iconSvg]=\"open ? 'chevron_top' : 'chevron_bottom'\"\n [width]=\"iconSize[0]\"\n [height]=\"iconSize[1]\"\n ></pry-icon>\n </div>\n</div>\n<ng-template #optionsModal>\n <div\n role=\"listbox\"\n [attr.aria-label]=\"'@pry.select.label' | i18n\"\n [id]=\"modalId\"\n [attr.aria-activedescendant]=\"'select-option-' + activeDescendant\"\n [attr.aria-multiselectable]=\"multiple\"\n [attr.required]=\"required\"\n [attr.aria-readonly]=\"disabled\"\n cdkTrapFocus=\"!autocomplete\"\n [cdkTrapFocusAutoCapture]=\"!autocomplete\"\n >\n @if (loading) {\n <div class=\"a-pry-select__options__option -hint\" [style.width.px]=\"modalWidth\">\n <div class=\"no-widget no-widget__loader\">\n <pry-page-loader></pry-page-loader>\n </div>\n <p>{{ '@pry.select.loading' | i18n }}...</p>\n </div>\n } @else {\n @for (\n item of matchingItems$ | async;\n track !!item.id ? item.id : item;\n let index = $index;\n let first = $first;\n let last = $last\n ) {\n <div\n class=\"a-pry-select__options__option\"\n [attr.aria-selected]=\"(valueItems$ | async).includes(item)\"\n [attr.aria-checked]=\"(valueItems$ | async).includes(item)\"\n [attr.aria-disabled]=\"disabled\"\n (click)=\"select($event, item, index)\"\n (keydown)=\"onKeydownOption($event, item, index, optionDivRef, first, last)\"\n [style.width.px]=\"modalWidth\"\n role=\"option\"\n [id]=\"'select-option-' + index\"\n tabindex=\"0\"\n #optionDivRef\n >\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item, clear }\"></ng-container>\n } @else {\n @if (multiple) {\n <pry-checkbox\n (click)=\"$event.preventDefault()\"\n [ngModel]=\"(valueItems$ | async).includes(item)\"\n ></pry-checkbox>\n }\n @if (bindIcon) {\n <pry-icon [iconSvg]=\"item[bindIcon]\" [width]=\"iconSize[0]\" [height]=\"iconSize[1]\"></pry-icon>\n }\n @if (bindLabel ? item?.[bindLabel] : item; as value) {\n {{ (i18nPrefix ? i18nPrefix : '') + value | i18n: { warn: false } }}\n }\n }\n </div>\n } @empty {\n <div class=\"a-pry-select__options__option -hint\" [style.width.px]=\"modalWidth\">\n <p>{{ '@pry.select.empty' | i18n }}</p>\n </div>\n }\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i3$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: i3$2.CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$3.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: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i7.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle", "name", "inputId", "inhibit"] }, { kind: "component", type: i8.PryPageLoaderComponent, selector: "pry-page-loader", inputs: ["image", "imageAltText"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
7632
+ ], viewQueries: [{ propertyName: "optionsModal", first: true, predicate: ["optionsModal"], descendants: true, read: TemplateRef }, { propertyName: "selectElement", first: true, predicate: ["selectElement"], descendants: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"a-pry-select\"\n [attr.aria-disabled]=\"disabled\"\n #selectElement\n [class.-focused]=\"focused\"\n (click)=\"handleClick()\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-owns]=\"open ? modalId : null\"\n aria-haspopup=\"listbox\"\n tabindex=\"0\"\n cdkMonitorElementFocus\n (cdkFocusChange)=\"onFocusChange($event)\"\n (keydown)=\"onKeydownSelect($event)\"\n>\n <div class=\"a-pry-select__content\">\n @if (autocomplete) {\n <input\n type=\"text\"\n class=\"a-pry-select__search\"\n [ngModel]=\"search$.getValue()\"\n (ngModelChange)=\"search($event, true)\"\n aria-autocomplete=\"list\"\n [attr.aria-controls]=\"open ? modalId : null\"\n [attr.aria-disabled]=\"disabled\"\n [disabled]=\"disabled\"\n (keydown)=\"onKeydownAutocompleteInput($event)\"\n [placeholder]=\"placeholder ?? ''\"\n (keydown.enter)=\"enterPressed($event)\"\n #input\n />\n } @else if ((valueItems$ | async).length === 0) {\n <span class=\"a-pry-select__placeholder\">{{ placeholder }}</span>\n <div class=\"a-pry-select__filler\"></div>\n } @else {\n @for (item of valueItems$ | async; track !!item && !!item.id ? item.id : item) {\n <div\n class=\"a-pry-select__value\"\n [class.pry-select-form]=\"isForm\"\n [class.-multiple]=\"multiple\"\n [ngClass]=\"item ? item[bindClasses ?? ''] ?? {} : {}\"\n >\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item, clear }\"></ng-container>\n } @else {\n <pry-icon\n *ngIf=\"bindIcon\"\n [iconSvg]=\"item[bindIcon]\"\n [width]=\"iconSize[0]\"\n [height]=\"iconSize[1]\"\n ></pry-icon>\n @if (bindLabel ? item?.[bindLabel] : item; as value) {\n {{ (i18nPrefix ?? '') + value | i18n: { warn: false } }}\n <span\n *ngIf=\"multiple && clearable\"\n class=\"a-pry-select__clear\"\n (click)=\"clear($event, item)\"\n aria-hidden=\"true\"\n >\u00D7</span\n >\n }\n }\n </div>\n }\n <div class=\"a-pry-select__filler\"></div>\n }\n </div>\n <div class=\"a-pry-select__actions\">\n <div class=\"a-pry-select__actions__clear-button\">\n @if (clearable && (search$ | async)) {\n <span class=\"a-pry-select__clear\" (click)=\"clearAll($event)\" aria-hidden=\"true\">\u00D7</span>\n }\n </div>\n <pry-icon\n class=\"a-pry-select__toggle\"\n [iconSvg]=\"open ? 'chevron_top' : 'chevron_bottom'\"\n [width]=\"iconSize[0]\"\n [height]=\"iconSize[1]\"\n ></pry-icon>\n </div>\n</div>\n<ng-template #optionsModal>\n <div\n role=\"listbox\"\n [attr.aria-label]=\"'@pry.select.label' | i18n\"\n [id]=\"modalId\"\n [attr.aria-activedescendant]=\"'select-option-' + activeDescendant\"\n [attr.aria-multiselectable]=\"multiple\"\n [attr.required]=\"required\"\n [attr.aria-readonly]=\"disabled\"\n cdkTrapFocus=\"!autocomplete\"\n [cdkTrapFocusAutoCapture]=\"!autocomplete\"\n >\n @if (loading) {\n <div class=\"a-pry-select__options__option -hint\" [style.width.px]=\"modalWidth\">\n <div class=\"no-widget no-widget__loader\">\n <pry-page-loader></pry-page-loader>\n </div>\n <p>{{ '@pry.select.loading' | i18n }}...</p>\n </div>\n } @else {\n @for (\n item of matchingItems$ | async;\n track !!item && !!item.id ? item.id : item;\n let index = $index;\n let first = $first;\n let last = $last\n ) {\n <div\n class=\"a-pry-select__options__option\"\n [attr.aria-selected]=\"(valueItems$ | async).includes(item)\"\n [attr.aria-checked]=\"(valueItems$ | async).includes(item)\"\n [attr.aria-disabled]=\"disabled\"\n (click)=\"select($event, item, index)\"\n (keydown)=\"onKeydownOption($event, item, index, optionDivRef, first, last)\"\n [style.width.px]=\"modalWidth\"\n role=\"option\"\n [id]=\"'select-option-' + index\"\n tabindex=\"0\"\n #optionDivRef\n >\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item, clear }\"></ng-container>\n } @else {\n @if (multiple) {\n <pry-checkbox\n (click)=\"$event.preventDefault()\"\n [ngModel]=\"(valueItems$ | async).includes(item)\"\n ></pry-checkbox>\n }\n @if (bindIcon) {\n <pry-icon [iconSvg]=\"item[bindIcon]\" [width]=\"iconSize[0]\" [height]=\"iconSize[1]\"></pry-icon>\n }\n @if (bindLabel ? item?.[bindLabel] : item; as value) {\n {{ (i18nPrefix ? i18nPrefix : '') + value | i18n: { warn: false } }}\n }\n }\n </div>\n } @empty {\n <div class=\"a-pry-select__options__option -hint\" [style.width.px]=\"modalWidth\">\n <p>{{ '@pry.select.empty' | i18n }}</p>\n </div>\n }\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i3$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: i3$2.CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$3.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: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i7.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle", "name", "inputId", "inhibit"] }, { kind: "component", type: i8.PryPageLoaderComponent, selector: "pry-page-loader", inputs: ["image", "imageAltText"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
7370
7633
  }
7371
7634
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: PrySelectComponent, decorators: [{
7372
7635
  type: Component,
@@ -7377,7 +7640,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
7377
7640
  multi: true
7378
7641
  },
7379
7642
  SelectA11yService
7380
- ], template: "<div\n class=\"a-pry-select\"\n [attr.aria-disabled]=\"disabled\"\n #selectElement\n [class.-focused]=\"focused\"\n (click)=\"handleClick()\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-owns]=\"open ? modalId : null\"\n aria-haspopup=\"listbox\"\n tabindex=\"0\"\n cdkMonitorElementFocus\n (cdkFocusChange)=\"onFocusChange($event)\"\n (keydown)=\"onKeydownSelect($event)\"\n>\n <div class=\"a-pry-select__content\">\n @if (autocomplete) {\n <input\n type=\"text\"\n class=\"a-pry-select__search\"\n [ngModel]=\"search$.getValue()\"\n (ngModelChange)=\"search($event, true)\"\n aria-autocomplete=\"list\"\n [attr.aria-controls]=\"open ? modalId : null\"\n [attr.aria-disabled]=\"disabled\"\n [disabled]=\"disabled\"\n (keydown)=\"onKeydownAutocompleteInput($event)\"\n [placeholder]=\"placeholder ?? ''\"\n (keydown.enter)=\"enterPressed($event)\"\n #input\n />\n } @else if ((valueItems$ | async).length === 0) {\n <span class=\"a-pry-select__placeholder\">{{ placeholder }}</span>\n <div class=\"a-pry-select__filler\"></div>\n } @else {\n @for (item of valueItems$ | async; track !!item.id ? item.id : item) {\n <div\n class=\"a-pry-select__value\"\n [class.pry-select-form]=\"isForm\"\n [class.-multiple]=\"multiple\"\n [ngClass]=\"item ? item[bindClasses ?? ''] ?? {} : {}\"\n >\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item, clear }\"></ng-container>\n } @else {\n <pry-icon\n *ngIf=\"bindIcon\"\n [iconSvg]=\"item[bindIcon]\"\n [width]=\"iconSize[0]\"\n [height]=\"iconSize[1]\"\n ></pry-icon>\n @if (bindLabel ? item?.[bindLabel] : item; as value) {\n {{ (i18nPrefix ?? '') + value | i18n: { warn: false } }}\n <span\n *ngIf=\"multiple && clearable\"\n class=\"a-pry-select__clear\"\n (click)=\"clear($event, item)\"\n aria-hidden=\"true\"\n >\u00D7</span\n >\n }\n }\n </div>\n }\n <div class=\"a-pry-select__filler\"></div>\n }\n </div>\n <div class=\"a-pry-select__actions\">\n <div class=\"a-pry-select__actions__clear-button\">\n @if (clearable && (search$ | async)) {\n <span class=\"a-pry-select__clear\" (click)=\"clearAll($event)\" aria-hidden=\"true\">\u00D7</span>\n }\n </div>\n <pry-icon\n class=\"a-pry-select__toggle\"\n [iconSvg]=\"open ? 'chevron_top' : 'chevron_bottom'\"\n [width]=\"iconSize[0]\"\n [height]=\"iconSize[1]\"\n ></pry-icon>\n </div>\n</div>\n<ng-template #optionsModal>\n <div\n role=\"listbox\"\n [attr.aria-label]=\"'@pry.select.label' | i18n\"\n [id]=\"modalId\"\n [attr.aria-activedescendant]=\"'select-option-' + activeDescendant\"\n [attr.aria-multiselectable]=\"multiple\"\n [attr.required]=\"required\"\n [attr.aria-readonly]=\"disabled\"\n cdkTrapFocus=\"!autocomplete\"\n [cdkTrapFocusAutoCapture]=\"!autocomplete\"\n >\n @if (loading) {\n <div class=\"a-pry-select__options__option -hint\" [style.width.px]=\"modalWidth\">\n <div class=\"no-widget no-widget__loader\">\n <pry-page-loader></pry-page-loader>\n </div>\n <p>{{ '@pry.select.loading' | i18n }}...</p>\n </div>\n } @else {\n @for (\n item of matchingItems$ | async;\n track !!item.id ? item.id : item;\n let index = $index;\n let first = $first;\n let last = $last\n ) {\n <div\n class=\"a-pry-select__options__option\"\n [attr.aria-selected]=\"(valueItems$ | async).includes(item)\"\n [attr.aria-checked]=\"(valueItems$ | async).includes(item)\"\n [attr.aria-disabled]=\"disabled\"\n (click)=\"select($event, item, index)\"\n (keydown)=\"onKeydownOption($event, item, index, optionDivRef, first, last)\"\n [style.width.px]=\"modalWidth\"\n role=\"option\"\n [id]=\"'select-option-' + index\"\n tabindex=\"0\"\n #optionDivRef\n >\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item, clear }\"></ng-container>\n } @else {\n @if (multiple) {\n <pry-checkbox\n (click)=\"$event.preventDefault()\"\n [ngModel]=\"(valueItems$ | async).includes(item)\"\n ></pry-checkbox>\n }\n @if (bindIcon) {\n <pry-icon [iconSvg]=\"item[bindIcon]\" [width]=\"iconSize[0]\" [height]=\"iconSize[1]\"></pry-icon>\n }\n @if (bindLabel ? item?.[bindLabel] : item; as value) {\n {{ (i18nPrefix ? i18nPrefix : '') + value | i18n: { warn: false } }}\n }\n }\n </div>\n } @empty {\n <div class=\"a-pry-select__options__option -hint\" [style.width.px]=\"modalWidth\">\n <p>{{ '@pry.select.empty' | i18n }}</p>\n </div>\n }\n }\n </div>\n</ng-template>\n" }]
7643
+ ], template: "<div\n class=\"a-pry-select\"\n [attr.aria-disabled]=\"disabled\"\n #selectElement\n [class.-focused]=\"focused\"\n (click)=\"handleClick()\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-owns]=\"open ? modalId : null\"\n aria-haspopup=\"listbox\"\n tabindex=\"0\"\n cdkMonitorElementFocus\n (cdkFocusChange)=\"onFocusChange($event)\"\n (keydown)=\"onKeydownSelect($event)\"\n>\n <div class=\"a-pry-select__content\">\n @if (autocomplete) {\n <input\n type=\"text\"\n class=\"a-pry-select__search\"\n [ngModel]=\"search$.getValue()\"\n (ngModelChange)=\"search($event, true)\"\n aria-autocomplete=\"list\"\n [attr.aria-controls]=\"open ? modalId : null\"\n [attr.aria-disabled]=\"disabled\"\n [disabled]=\"disabled\"\n (keydown)=\"onKeydownAutocompleteInput($event)\"\n [placeholder]=\"placeholder ?? ''\"\n (keydown.enter)=\"enterPressed($event)\"\n #input\n />\n } @else if ((valueItems$ | async).length === 0) {\n <span class=\"a-pry-select__placeholder\">{{ placeholder }}</span>\n <div class=\"a-pry-select__filler\"></div>\n } @else {\n @for (item of valueItems$ | async; track !!item && !!item.id ? item.id : item) {\n <div\n class=\"a-pry-select__value\"\n [class.pry-select-form]=\"isForm\"\n [class.-multiple]=\"multiple\"\n [ngClass]=\"item ? item[bindClasses ?? ''] ?? {} : {}\"\n >\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item, clear }\"></ng-container>\n } @else {\n <pry-icon\n *ngIf=\"bindIcon\"\n [iconSvg]=\"item[bindIcon]\"\n [width]=\"iconSize[0]\"\n [height]=\"iconSize[1]\"\n ></pry-icon>\n @if (bindLabel ? item?.[bindLabel] : item; as value) {\n {{ (i18nPrefix ?? '') + value | i18n: { warn: false } }}\n <span\n *ngIf=\"multiple && clearable\"\n class=\"a-pry-select__clear\"\n (click)=\"clear($event, item)\"\n aria-hidden=\"true\"\n >\u00D7</span\n >\n }\n }\n </div>\n }\n <div class=\"a-pry-select__filler\"></div>\n }\n </div>\n <div class=\"a-pry-select__actions\">\n <div class=\"a-pry-select__actions__clear-button\">\n @if (clearable && (search$ | async)) {\n <span class=\"a-pry-select__clear\" (click)=\"clearAll($event)\" aria-hidden=\"true\">\u00D7</span>\n }\n </div>\n <pry-icon\n class=\"a-pry-select__toggle\"\n [iconSvg]=\"open ? 'chevron_top' : 'chevron_bottom'\"\n [width]=\"iconSize[0]\"\n [height]=\"iconSize[1]\"\n ></pry-icon>\n </div>\n</div>\n<ng-template #optionsModal>\n <div\n role=\"listbox\"\n [attr.aria-label]=\"'@pry.select.label' | i18n\"\n [id]=\"modalId\"\n [attr.aria-activedescendant]=\"'select-option-' + activeDescendant\"\n [attr.aria-multiselectable]=\"multiple\"\n [attr.required]=\"required\"\n [attr.aria-readonly]=\"disabled\"\n cdkTrapFocus=\"!autocomplete\"\n [cdkTrapFocusAutoCapture]=\"!autocomplete\"\n >\n @if (loading) {\n <div class=\"a-pry-select__options__option -hint\" [style.width.px]=\"modalWidth\">\n <div class=\"no-widget no-widget__loader\">\n <pry-page-loader></pry-page-loader>\n </div>\n <p>{{ '@pry.select.loading' | i18n }}...</p>\n </div>\n } @else {\n @for (\n item of matchingItems$ | async;\n track !!item && !!item.id ? item.id : item;\n let index = $index;\n let first = $first;\n let last = $last\n ) {\n <div\n class=\"a-pry-select__options__option\"\n [attr.aria-selected]=\"(valueItems$ | async).includes(item)\"\n [attr.aria-checked]=\"(valueItems$ | async).includes(item)\"\n [attr.aria-disabled]=\"disabled\"\n (click)=\"select($event, item, index)\"\n (keydown)=\"onKeydownOption($event, item, index, optionDivRef, first, last)\"\n [style.width.px]=\"modalWidth\"\n role=\"option\"\n [id]=\"'select-option-' + index\"\n tabindex=\"0\"\n #optionDivRef\n >\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item, clear }\"></ng-container>\n } @else {\n @if (multiple) {\n <pry-checkbox\n (click)=\"$event.preventDefault()\"\n [ngModel]=\"(valueItems$ | async).includes(item)\"\n ></pry-checkbox>\n }\n @if (bindIcon) {\n <pry-icon [iconSvg]=\"item[bindIcon]\" [width]=\"iconSize[0]\" [height]=\"iconSize[1]\"></pry-icon>\n }\n @if (bindLabel ? item?.[bindLabel] : item; as value) {\n {{ (i18nPrefix ? i18nPrefix : '') + value | i18n: { warn: false } }}\n }\n }\n </div>\n } @empty {\n <div class=\"a-pry-select__options__option -hint\" [style.width.px]=\"modalWidth\">\n <p>{{ '@pry.select.empty' | i18n }}</p>\n </div>\n }\n }\n </div>\n</ng-template>\n" }]
7381
7644
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i2.Overlay }, { type: i0.ViewContainerRef }, { type: SelectA11yService }], propDecorators: { items: [{
7382
7645
  type: Input
7383
7646
  }], clearable: [{
@@ -8615,217 +8878,6 @@ function solveCollisions(candidateWidget, initialWidgetManifestList, dashboardMa
8615
8878
  return newOverlaps.length > 0 ? dashboardManifest : result;
8616
8879
  }
8617
8880
 
8618
- class BaseWidgetComponent extends SubscriptionnerDirective {
8619
- set widgetIndex(index) {
8620
- this.widgetIndex$.next(index);
8621
- }
8622
- set staticManifest(manifest) {
8623
- this.staticManifest$.next(manifest);
8624
- }
8625
- set _manifest$(manifest) {
8626
- this.manifest$ = manifest;
8627
- this.sub?.unsubscribe();
8628
- this.observableList$.next([manifest]);
8629
- }
8630
- get widgetIndex() {
8631
- return this.widgetIndex$.getValue();
8632
- }
8633
- constructor(store, el) {
8634
- super();
8635
- this.store = store;
8636
- this.el = el;
8637
- this.widgetIndex$ = new BehaviorSubject(0);
8638
- this.manifest = { type: 'placeholder' };
8639
- this.observableList$ = new BehaviorSubject([]);
8640
- this.staticManifest$ = new BehaviorSubject(null);
8641
- this._widgetSize$ = new BehaviorSubject({ width: 300, height: 300 });
8642
- this.open$ = new Subject();
8643
- this.manifestModified = new EventEmitter();
8644
- this.manifest$ = this.observableList$.pipe(combineLatestWith(this.staticManifest$), switchMap(([observables, staticManifest]) => (!staticManifest ? merge(...observables) : of(staticManifest))), distinctUntilChanged$1((p, v) => equal(p, v)));
8645
- this.subscriptions.add(this.manifest$.subscribe((manifest) => (this.manifest = manifest)));
8646
- this.displayHeader$ = this.manifest$.pipe(map((manifest) => manifest.header === undefined || manifest.header));
8647
- this.widgetSize$ = this._widgetSize$.pipe(startWith({
8648
- width: 300,
8649
- height: 300
8650
- }), distinctUntilChanged$1((p, c) => p.width === c.width && p.height === c.height), debounceTime(100), distinctUntilChanged$1((p, c) => p.width === c.width && p.height === c.height));
8651
- }
8652
- ngAfterViewChecked() {
8653
- const boundingRect = this.el.nativeElement.getBoundingClientRect();
8654
- this._widgetSize$.next({ width: boundingRect.width, height: boundingRect.height });
8655
- }
8656
- toImage() {
8657
- return Promise.reject('Not yet implemented');
8658
- }
8659
- changeWidgetTitle($event) {
8660
- this.manifest.title = $event;
8661
- }
8662
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BaseWidgetComponent, deps: [{ token: i1.Store }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
8663
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: BaseWidgetComponent, selector: "pry-base-widget", inputs: { open$: "open$", widgetIndex: "widgetIndex", staticManifest: "staticManifest" }, outputs: { manifestModified: "manifestModified" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
8664
- }
8665
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BaseWidgetComponent, decorators: [{
8666
- type: Component,
8667
- args: [{ selector: 'pry-base-widget', template: '' }]
8668
- }], ctorParameters: () => [{ type: i1.Store }, { type: i0.ElementRef }], propDecorators: { open$: [{
8669
- type: Input
8670
- }], manifestModified: [{
8671
- type: Output
8672
- }], widgetIndex: [{
8673
- type: Input
8674
- }], staticManifest: [{
8675
- type: Input
8676
- }] } });
8677
-
8678
- class WidgetPlaceholderComponent extends BaseWidgetComponent {
8679
- constructor(store, el) {
8680
- super(store, el);
8681
- }
8682
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetPlaceholderComponent, deps: [{ token: i1.Store }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
8683
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: WidgetPlaceholderComponent, selector: "pry-widget-placeholder", usesInheritance: true, ngImport: i0, template: "<p>{{ '@pry.widget.unrecognized' | i18n: { type: manifest ? manifest.type : 'placeholder' } }}</p>\n", dependencies: [{ kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
8684
- }
8685
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetPlaceholderComponent, decorators: [{
8686
- type: Component,
8687
- args: [{ selector: 'pry-widget-placeholder', template: "<p>{{ '@pry.widget.unrecognized' | i18n: { type: manifest ? manifest.type : 'placeholder' } }}</p>\n" }]
8688
- }], ctorParameters: () => [{ type: i1.Store }, { type: i0.ElementRef }] });
8689
-
8690
- class WidgetFillerComponent extends BaseWidgetComponent {
8691
- constructor(store, el) {
8692
- super(store, el);
8693
- }
8694
- get index() {
8695
- // @ts-ignore
8696
- return this.manifest.options?.index ?? 0;
8697
- }
8698
- moveToPlace() {
8699
- // @ts-ignore
8700
- const startLayout = this.manifest.options?.sourcePlace;
8701
- // @ts-ignore
8702
- const targetLayout = this.manifest.options?.targetPlace;
8703
- // @ts-ignore
8704
- if (startLayout && targetLayout && this.manifest.options?.windowManifest && this.index !== '-') {
8705
- // @ts-ignore
8706
- const newWindowManifest = JSON.parse(JSON.stringify(this.manifest.options?.windowManifest));
8707
- const targetWidgetIndex = newWindowManifest.widgets.findIndex((w) => w.layout.x === targetLayout.x &&
8708
- w.layout.y === targetLayout.y &&
8709
- w.layout.width === targetLayout.width &&
8710
- w.layout.height === targetLayout.height);
8711
- const startWidgetIndex = newWindowManifest.widgets.findIndex((w) => w.layout.x === startLayout.x &&
8712
- w.layout.y === startLayout.y &&
8713
- w.layout.width === startLayout.width &&
8714
- w.layout.height === startLayout.height);
8715
- if (targetWidgetIndex !== -1) {
8716
- newWindowManifest.widgets[targetWidgetIndex].layout = startLayout;
8717
- }
8718
- newWindowManifest.widgets[startWidgetIndex].layout = targetLayout;
8719
- this.store.dispatch(DashboardActions.updateDashboardManifest({ manifest: newWindowManifest }));
8720
- }
8721
- }
8722
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetFillerComponent, deps: [{ token: i1.Store }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
8723
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: WidgetFillerComponent, selector: "pry-widget-filler", usesInheritance: true, ngImport: i0, template: "<div class=\"filler-backdrop\" (click)=\"moveToPlace()\">\n <div class=\"a-indicator-block\">\n <p>{{ index === -1 ? '-' : index + 1 }}</p>\n </div>\n</div>\n" }); }
8724
- }
8725
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetFillerComponent, decorators: [{
8726
- type: Component,
8727
- args: [{ selector: 'pry-widget-filler', template: "<div class=\"filler-backdrop\" (click)=\"moveToPlace()\">\n <div class=\"a-indicator-block\">\n <p>{{ index === -1 ? '-' : index + 1 }}</p>\n </div>\n</div>\n" }]
8728
- }], ctorParameters: () => [{ type: i1.Store }, { type: i0.ElementRef }] });
8729
-
8730
- const WIDGET_DEFINITION = new InjectionToken('Widgets definition');
8731
- const NON_EXCLUDE_GEO_WIDGET_TYPES = {
8732
- values: ['map', 'tile']
8733
- };
8734
- class WidgetFactoryService {
8735
- constructor(injector, reference, store) {
8736
- this.injector = injector;
8737
- this.store = store;
8738
- this.reference$ = new BehaviorSubject({
8739
- placeholder: { name: 'placeholder', component: WidgetPlaceholderComponent },
8740
- filler: { name: 'filler', component: WidgetFillerComponent }
8741
- });
8742
- this.moduleRefCache = {};
8743
- this.datasources = [];
8744
- this.putDefinitions(reference);
8745
- this.store.select(DataSourceSelectors.getDataSources).subscribe((datasources) => (this.datasources = datasources));
8746
- }
8747
- resolveComponent(manifest) {
8748
- if (this.moduleRefCache[manifest.type]) {
8749
- return of(this.moduleRefCache[manifest.type]);
8750
- }
8751
- if (!!manifest && this.reference$.getValue()[manifest.type]) {
8752
- // @ts-ignore
8753
- if (this.reference$.getValue()[manifest.type].load === undefined) {
8754
- this.moduleRefCache[manifest.type] = this.reference$.getValue()[manifest.type].component;
8755
- return of(this.moduleRefCache[manifest.type]);
8756
- }
8757
- else {
8758
- return from$1(this.reference$.getValue()[manifest.type].load().then((fn) => {
8759
- this.moduleRefCache[manifest.type] = fn(this.injector);
8760
- return this.moduleRefCache[manifest.type];
8761
- }));
8762
- }
8763
- }
8764
- else {
8765
- this.moduleRefCache[manifest.type] = this.reference$.getValue()['placeholder'].component;
8766
- return of(this.moduleRefCache[manifest.type]);
8767
- }
8768
- }
8769
- putDefinitions(definitions) {
8770
- this.reference$.next({
8771
- ...this.reference$.getValue(),
8772
- ...definitions
8773
- });
8774
- }
8775
- isModuleLoaded(type) {
8776
- return this.reference$.pipe(map((componentDefs) => !!componentDefs[type]));
8777
- }
8778
- datasourcesToAutoLoad(manifest) {
8779
- const widgetDefinition = this.reference$.getValue()[manifest.type];
8780
- const datasourcesArray = Array.isArray(manifest.datasource ?? [])
8781
- ? (manifest.datasource ?? [])
8782
- : [manifest.datasource];
8783
- return datasourcesArray
8784
- .filter((datasource) => {
8785
- const matching = this.datasources.find((ds) => ds.id === datasource);
8786
- return (!!matching &&
8787
- (widgetDefinition.autoLoadDatasource === undefined ||
8788
- widgetDefinition.autoLoadDatasource === 'all' ||
8789
- (widgetDefinition.autoLoadDatasource === 'geo' && DatasourceUtils.isGeo(matching)) ||
8790
- (widgetDefinition.autoLoadDatasource === 'not-geo' && !DatasourceUtils.isGeo(matching))));
8791
- })
8792
- .map((ds) => ({ datasetId: ds, excludeGeo: !NON_EXCLUDE_GEO_WIDGET_TYPES.values.includes(manifest.type) }));
8793
- }
8794
- aggregatesToAutoLoad(manifest) {
8795
- const widgetDefinition = this.reference$.getValue()[manifest.type];
8796
- const datasourcesArray = Array.isArray(manifest.datasource ?? [])
8797
- ? (manifest.datasource ?? [])
8798
- : [manifest.datasource];
8799
- return datasourcesArray.filter(() => widgetDefinition.autoLoadDatasource === undefined || widgetDefinition.autoLoadDatasource === 'aggregate');
8800
- }
8801
- getObjectsToAutoLoad(manifest) {
8802
- const datasources = [];
8803
- const aggregates = [];
8804
- manifest.windows.forEach((windowManifest) => {
8805
- (windowManifest.widgets ?? []).forEach((widgetManifest) => {
8806
- this.datasourcesToAutoLoad(widgetManifest).forEach((res) => {
8807
- if (res.datasetId) {
8808
- datasources.push(res);
8809
- }
8810
- });
8811
- this.aggregatesToAutoLoad(widgetManifest).forEach((ds) => aggregates.push(ds));
8812
- });
8813
- });
8814
- return { datasources, aggregates };
8815
- }
8816
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetFactoryService, deps: [{ token: i0.Injector }, { token: WIDGET_DEFINITION }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
8817
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetFactoryService, providedIn: 'root' }); }
8818
- }
8819
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: WidgetFactoryService, decorators: [{
8820
- type: Injectable,
8821
- args: [{
8822
- providedIn: 'root'
8823
- }]
8824
- }], ctorParameters: () => [{ type: i0.Injector }, { type: undefined, decorators: [{
8825
- type: Inject,
8826
- args: [WIDGET_DEFINITION]
8827
- }] }, { type: i1.Store }] });
8828
-
8829
8881
  class WidgetInstanciatorComponent extends SubscriptionnerDirective {
8830
8882
  set widgetIndex(manifest) {
8831
8883
  this._widgetIndex$.next(manifest);
@@ -11492,6 +11544,7 @@ class BaseFilterComponent extends SubscriptionnerDirective {
11492
11544
  this.store = store;
11493
11545
  this.valueUpdated = new EventEmitter();
11494
11546
  this.pressedEnter = new EventEmitter();
11547
+ this.cleared = new EventEmitter();
11495
11548
  this.type = 'base';
11496
11549
  }
11497
11550
  ngOnInit() {
@@ -11513,7 +11566,7 @@ class BaseFilterComponent extends SubscriptionnerDirective {
11513
11566
  }
11514
11567
  }
11515
11568
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BaseFilterComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
11516
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: BaseFilterComponent, selector: "pry-base-filter", inputs: { filter: "filter" }, outputs: { valueUpdated: "valueUpdated", pressedEnter: "pressedEnter" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
11569
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: BaseFilterComponent, selector: "pry-base-filter", inputs: { filter: "filter" }, outputs: { valueUpdated: "valueUpdated", pressedEnter: "pressedEnter", cleared: "cleared" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
11517
11570
  }
11518
11571
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BaseFilterComponent, decorators: [{
11519
11572
  type: Component,
@@ -11524,6 +11577,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
11524
11577
  type: Output
11525
11578
  }], pressedEnter: [{
11526
11579
  type: Output
11580
+ }], cleared: [{
11581
+ type: Output
11527
11582
  }] } });
11528
11583
 
11529
11584
  const FILTER_DEFINITION = new InjectionToken('Filter definition');
@@ -11606,6 +11661,7 @@ class FilterInstanciatorComponent extends SubscriptionnerDirective {
11606
11661
  this.changeDetector = changeDetector;
11607
11662
  this.filter$ = new BehaviorSubject(null);
11608
11663
  this.pressedEnter = new EventEmitter();
11664
+ this.cleared = new EventEmitter();
11609
11665
  }
11610
11666
  ngAfterViewInit() {
11611
11667
  this.subscriptions.add(this.filter$.subscribe((filter) => {
@@ -11619,6 +11675,7 @@ class FilterInstanciatorComponent extends SubscriptionnerDirective {
11619
11675
  this.currentInstance = component.instance;
11620
11676
  this.currentInstance.filter = filter;
11621
11677
  this.currentInstance.pressedEnter = this.pressedEnter;
11678
+ this.currentInstance.cleared = this.cleared;
11622
11679
  this.changeDetector.detectChanges();
11623
11680
  });
11624
11681
  }
@@ -11629,13 +11686,15 @@ class FilterInstanciatorComponent extends SubscriptionnerDirective {
11629
11686
  this.applySub?.unsubscribe();
11630
11687
  }
11631
11688
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FilterInstanciatorComponent, deps: [{ token: i1.Store }, { token: i0.Injector }, { token: FilterFactoryService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
11632
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FilterInstanciatorComponent, selector: "pry-filter-instanciator", inputs: { filter: "filter", applyFilter$: "applyFilter$" }, outputs: { pressedEnter: "pressedEnter" }, viewQueries: [{ propertyName: "filterContainerRef", first: true, predicate: ["filters"], descendants: true, read: ViewContainerRef }], usesInheritance: true, ngImport: i0, template: "<ng-template #filters></ng-template>\n" }); }
11689
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FilterInstanciatorComponent, selector: "pry-filter-instanciator", inputs: { filter: "filter", applyFilter$: "applyFilter$" }, outputs: { pressedEnter: "pressedEnter", cleared: "cleared" }, viewQueries: [{ propertyName: "filterContainerRef", first: true, predicate: ["filters"], descendants: true, read: ViewContainerRef }], usesInheritance: true, ngImport: i0, template: "<ng-template #filters></ng-template>\n" }); }
11633
11690
  }
11634
11691
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FilterInstanciatorComponent, decorators: [{
11635
11692
  type: Component,
11636
11693
  args: [{ selector: 'pry-filter-instanciator', template: "<ng-template #filters></ng-template>\n" }]
11637
11694
  }], ctorParameters: () => [{ type: i1.Store }, { type: i0.Injector }, { type: FilterFactoryService }, { type: i0.ChangeDetectorRef }], propDecorators: { pressedEnter: [{
11638
11695
  type: Output
11696
+ }], cleared: [{
11697
+ type: Output
11639
11698
  }], filter: [{
11640
11699
  type: Input
11641
11700
  }], filterContainerRef: [{
@@ -11661,6 +11720,7 @@ class FilterGroupComponent {
11661
11720
  this.apply$ = new BehaviorSubject(undefined);
11662
11721
  this.isSelectOpen = false;
11663
11722
  this.enterTriggerFilter = false;
11723
+ this.clearTriggerFilter = false;
11664
11724
  this.globalManifest$ = this.store.select(DashboardSelectors.globalManifest);
11665
11725
  }
11666
11726
  filter() {
@@ -11676,17 +11736,29 @@ class FilterGroupComponent {
11676
11736
  .querySelector('.o-container__filter-container')
11677
11737
  ?.contains(document.querySelector('ng-dropdown-panel.ng-dropdown-panel')) || false;
11678
11738
  }
11739
+ enterPressed() {
11740
+ if (this.enterTriggerFilter) {
11741
+ this.filter();
11742
+ }
11743
+ }
11744
+ cleared() {
11745
+ if (this.clearTriggerFilter) {
11746
+ this.filter();
11747
+ }
11748
+ }
11679
11749
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FilterGroupComponent, deps: [{ token: i1.Store }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
11680
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FilterGroupComponent, selector: "pry-filter-group", inputs: { enterTriggerFilter: "enterTriggerFilter" }, ngImport: i0, template: "<pry-filter-group-css></pry-filter-group-css>\n<ng-container *ngIf=\"globalManifest$ | async as manifest\">\n <div class=\"o-container__filters\" *ngIf=\"manifest.filters && manifest.filters.length > 0\">\n <div class=\"o-container__filter-container\" (click)=\"openSelect()\">\n @for (filterDescription of manifest.filters; track filterDescription.id) {\n <pry-filter-instanciator\n [filter]=\"filterDescription\"\n [applyFilter$]=\"apply$\"\n (pressedEnter)=\"filter()\"\n ></pry-filter-instanciator>\n }\n </div>\n <div class=\"o-container__filter-actions\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"clearFilters()\">\n <pry-icon iconSvg=\"clear_filter\" [width]=\"30\" [height]=\"30\"></pry-icon>\n </button>\n <button type=\"button\" class=\"a-btn a-btn--primary\" (click)=\"filter()\">\n {{ '@pry.toolbox.apply' | i18n }}\n <pry-icon iconSvg=\"refresh_filter\" [width]=\"18\" [height]=\"18\"></pry-icon>\n </button>\n </div>\n </div>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: FilterInstanciatorComponent, selector: "pry-filter-instanciator", inputs: ["filter", "applyFilter$"], outputs: ["pressedEnter"] }, { kind: "component", type: PryFilterGroupCssComponent, selector: "pry-filter-group-css" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
11750
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FilterGroupComponent, selector: "pry-filter-group", inputs: { enterTriggerFilter: "enterTriggerFilter", clearTriggerFilter: "clearTriggerFilter" }, ngImport: i0, template: "<pry-filter-group-css></pry-filter-group-css>\n<ng-container *ngIf=\"globalManifest$ | async as manifest\">\n <div class=\"o-container__filters\" *ngIf=\"manifest.filters && manifest.filters.length > 0\">\n <div class=\"o-container__filter-container\" (click)=\"openSelect()\">\n @for (filterDescription of manifest.filters; track filterDescription.id) {\n <pry-filter-instanciator\n [filter]=\"filterDescription\"\n [applyFilter$]=\"apply$\"\n (pressedEnter)=\"enterPressed()\"\n (cleared)=\"cleared()\"\n ></pry-filter-instanciator>\n }\n </div>\n <div class=\"o-container__filter-actions\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"clearFilters()\">\n <pry-icon iconSvg=\"clear_filter\" [width]=\"30\" [height]=\"30\"></pry-icon>\n </button>\n <button type=\"button\" class=\"a-btn a-btn--primary\" (click)=\"filter()\">\n {{ '@pry.toolbox.apply' | i18n }}\n <pry-icon iconSvg=\"refresh_filter\" [width]=\"18\" [height]=\"18\"></pry-icon>\n </button>\n </div>\n </div>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: FilterInstanciatorComponent, selector: "pry-filter-instanciator", inputs: ["filter", "applyFilter$"], outputs: ["pressedEnter", "cleared"] }, { kind: "component", type: PryFilterGroupCssComponent, selector: "pry-filter-group-css" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
11681
11751
  }
11682
11752
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FilterGroupComponent, decorators: [{
11683
11753
  type: Component,
11684
- args: [{ selector: 'pry-filter-group', template: "<pry-filter-group-css></pry-filter-group-css>\n<ng-container *ngIf=\"globalManifest$ | async as manifest\">\n <div class=\"o-container__filters\" *ngIf=\"manifest.filters && manifest.filters.length > 0\">\n <div class=\"o-container__filter-container\" (click)=\"openSelect()\">\n @for (filterDescription of manifest.filters; track filterDescription.id) {\n <pry-filter-instanciator\n [filter]=\"filterDescription\"\n [applyFilter$]=\"apply$\"\n (pressedEnter)=\"filter()\"\n ></pry-filter-instanciator>\n }\n </div>\n <div class=\"o-container__filter-actions\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"clearFilters()\">\n <pry-icon iconSvg=\"clear_filter\" [width]=\"30\" [height]=\"30\"></pry-icon>\n </button>\n <button type=\"button\" class=\"a-btn a-btn--primary\" (click)=\"filter()\">\n {{ '@pry.toolbox.apply' | i18n }}\n <pry-icon iconSvg=\"refresh_filter\" [width]=\"18\" [height]=\"18\"></pry-icon>\n </button>\n </div>\n </div>\n</ng-container>\n" }]
11754
+ args: [{ selector: 'pry-filter-group', template: "<pry-filter-group-css></pry-filter-group-css>\n<ng-container *ngIf=\"globalManifest$ | async as manifest\">\n <div class=\"o-container__filters\" *ngIf=\"manifest.filters && manifest.filters.length > 0\">\n <div class=\"o-container__filter-container\" (click)=\"openSelect()\">\n @for (filterDescription of manifest.filters; track filterDescription.id) {\n <pry-filter-instanciator\n [filter]=\"filterDescription\"\n [applyFilter$]=\"apply$\"\n (pressedEnter)=\"enterPressed()\"\n (cleared)=\"cleared()\"\n ></pry-filter-instanciator>\n }\n </div>\n <div class=\"o-container__filter-actions\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"clearFilters()\">\n <pry-icon iconSvg=\"clear_filter\" [width]=\"30\" [height]=\"30\"></pry-icon>\n </button>\n <button type=\"button\" class=\"a-btn a-btn--primary\" (click)=\"filter()\">\n {{ '@pry.toolbox.apply' | i18n }}\n <pry-icon iconSvg=\"refresh_filter\" [width]=\"18\" [height]=\"18\"></pry-icon>\n </button>\n </div>\n </div>\n</ng-container>\n" }]
11685
11755
  }], ctorParameters: () => [{ type: i1.Store }, { type: Document, decorators: [{
11686
11756
  type: Inject,
11687
11757
  args: [DOCUMENT]
11688
11758
  }] }], propDecorators: { enterTriggerFilter: [{
11689
11759
  type: Input
11760
+ }], clearTriggerFilter: [{
11761
+ type: Input
11690
11762
  }] } });
11691
11763
 
11692
11764
  const BASE_CONFIG = new InjectionToken('base config');
@@ -12619,7 +12691,21 @@ const internalReducer = createReducer(dashboardInitialState, on(DashboardActions
12619
12691
  ...state.results,
12620
12692
  resultSets: {
12621
12693
  ...state.results.resultSets,
12622
- [action.id]: action.resultSet
12694
+ [action.id]: !action.next
12695
+ ? action.resultSet
12696
+ : {
12697
+ items: [
12698
+ ...new Set(Object.keys(action.resultSet.items).concat(Object.keys(state.results.resultSets[action.id].items)))
12699
+ ]
12700
+ .map((key) => ({
12701
+ [key]: [...action.resultSet.items[key], ...state.results.resultSets[action.id].items[key]]
12702
+ }))
12703
+ .reduce((p, c) => ({ ...p, ...c }), {}),
12704
+ count: action.resultSet.count,
12705
+ relations: [...state.results.resultSets[action.id].relations, ...action.resultSet.relations],
12706
+ autoRefreshInterval: action.resultSet.autoRefreshInterval,
12707
+ searchAfter: action.resultSet.searchAfter
12708
+ }
12623
12709
  },
12624
12710
  resultSetsParams: {
12625
12711
  ...state.results.resultSetsParams,
@@ -13092,53 +13178,6 @@ const internalReducer = createReducer(dashboardInitialState, on(DashboardActions
13092
13178
  ...state.manifests,
13093
13179
  loading: true
13094
13180
  }
13095
- })), on(DashboardActions.initDefaultLayerGroup, (state, action) => ({
13096
- ...state,
13097
- manifests: {
13098
- ...state.manifests,
13099
- manifest: {
13100
- ...state.manifests.manifest,
13101
- layerGroups: state.manifests.manifest.layerGroups?.some((group) => group.name === 'DEFAULT')
13102
- ? state.manifests.manifest.layerGroups.map((group) => action.layers ? { ...group, visibleLayers: action.layers } : group)
13103
- : [
13104
- ...(state.manifests.manifest.layerGroups ?? []),
13105
- {
13106
- name: 'DEFAULT',
13107
- singleLayer: false,
13108
- visibleLayers: action.layers ? action.layers : []
13109
- }
13110
- ]
13111
- }
13112
- }
13113
- })), on(DashboardActions.updateLayerVisibility, (state, action) => ({
13114
- ...state,
13115
- manifests: {
13116
- ...state.manifests,
13117
- manifest: {
13118
- ...state.manifests.manifest,
13119
- layerGroups: [
13120
- ...(state.manifests.manifest.layerGroups ?? []).map((group) => group.name === action.name
13121
- ? {
13122
- ...group,
13123
- visibleLayers: action.visibleLayers
13124
- ? typeof action.visibleLayers === 'string'
13125
- ? [...group.visibleLayers, action.visibleLayers]
13126
- : action.visibleLayers
13127
- : group.visibleLayers
13128
- }
13129
- : group)
13130
- ]
13131
- }
13132
- }
13133
- })), on(DashboardActions.updateLayerGroups, (state, { layerGroups }) => ({
13134
- ...state,
13135
- manifests: {
13136
- ...state.manifests,
13137
- manifest: {
13138
- ...state.manifests.manifest,
13139
- layerGroups
13140
- }
13141
- }
13142
13181
  })));
13143
13182
  function dashboardReducer(state, action) {
13144
13183
  return internalReducer(state, action);