@provoly/dashboard 0.21.11 → 0.22.2

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 (46) hide show
  1. package/esm2022/dataset/components/dataset-detail/dataset-detail.component.mjs +1 -1
  2. package/esm2022/lib/core/components/select/select-a11y.service.mjs +10 -3
  3. package/esm2022/lib/core/model/automatic-grid-layout-definition.interface.mjs +2 -0
  4. package/esm2022/lib/core/model/manifest.interface.mjs +1 -1
  5. package/esm2022/lib/core/model/public-api.mjs +2 -1
  6. package/esm2022/lib/dashboard/components/dashboard.component.mjs +17 -11
  7. package/esm2022/lib/dashboard/components/widgets/header/widget-header.component.mjs +2 -4
  8. package/esm2022/lib/dashboard/components/widgets/widget-placement/widget-placement.utils.mjs +79 -125
  9. package/esm2022/lib/dashboard/dashboard.module.mjs +5 -8
  10. package/esm2022/lib/dashboard/store/dashboard.actions.mjs +1 -1
  11. package/esm2022/lib/dashboard/store/dashboard.effects.mjs +3 -3
  12. package/esm2022/lib/dashboard/store/dashboard.reducers.mjs +7 -5
  13. package/esm2022/lib/dashboard/store/dashboard.selectors.mjs +3 -4
  14. package/esm2022/presentation/components/add-edit-presentation/add-edit-presentation.component.mjs +4 -4
  15. package/esm2022/presentation/components/presentation.component.mjs +5 -6
  16. package/esm2022/search/search-home/search-home.component.mjs +1 -1
  17. package/esm2022/toolbox/components/select-grid-layout/select-grid-layout.component.mjs +6 -12
  18. package/esm2022/toolbox/style/css.component.mjs +2 -2
  19. package/fesm2022/provoly-dashboard-dataset.mjs +1 -1
  20. package/fesm2022/provoly-dashboard-dataset.mjs.map +1 -1
  21. package/fesm2022/provoly-dashboard-presentation.mjs +7 -8
  22. package/fesm2022/provoly-dashboard-presentation.mjs.map +1 -1
  23. package/fesm2022/provoly-dashboard-search.mjs.map +1 -1
  24. package/fesm2022/provoly-dashboard-toolbox.mjs +7 -13
  25. package/fesm2022/provoly-dashboard-toolbox.mjs.map +1 -1
  26. package/fesm2022/provoly-dashboard.mjs +187 -290
  27. package/fesm2022/provoly-dashboard.mjs.map +1 -1
  28. package/lib/core/model/automatic-grid-layout-definition.interface.d.ts +9 -0
  29. package/lib/core/model/manifest.interface.d.ts +2 -2
  30. package/lib/core/model/public-api.d.ts +1 -0
  31. package/lib/dashboard/components/dashboard.component.d.ts +4 -3
  32. package/lib/dashboard/components/widgets/header/widget-header.component.d.ts +2 -2
  33. package/lib/dashboard/components/widgets/widget-placement/widget-placement.utils.d.ts +14 -30
  34. package/lib/dashboard/dashboard.module.d.ts +2 -7
  35. package/lib/dashboard/store/dashboard.actions.d.ts +3 -3
  36. package/lib/dashboard/store/dashboard.selectors.d.ts +2 -2
  37. package/package.json +7 -7
  38. package/presentation/components/add-edit-presentation/add-edit-presentation.component.d.ts +2 -2
  39. package/search/search-home/search-home.component.d.ts +1 -1
  40. package/styles/components/_a-page-loader.scss +2 -4
  41. package/styles-theme/components-theme/_a-page-loader.theme.scss +9 -0
  42. package/styles-theme/main-theme.scss +1 -0
  43. package/toolbox/components/select-grid-layout/select-grid-layout.component.d.ts +4 -8
  44. package/toolbox/style/_o-select-grid-layout.scss +6 -1
  45. package/esm2022/lib/dashboard/store/proxy.utils.mjs +0 -72
  46. package/lib/dashboard/store/proxy.utils.d.ts +0 -26
@@ -3880,118 +3880,6 @@ class ManifestUtils {
3880
3880
  }
3881
3881
  }
3882
3882
 
3883
- const SearchActions = {
3884
- search: createAction('[Search] search', props()),
3885
- getDatasourceItems: createAction('[Search] (bus) get datasource items', props()),
3886
- // result Search
3887
- searchSuccess: createAction('[Search Api] (bus) Search Success', props()),
3888
- searchFailure: createAction('[Search Api] (bus) Search Failure', props()),
3889
- setSearchLoading: createAction('[Search Api] (bus) set Search loading datasource status', props())
3890
- };
3891
-
3892
- const searchFeatureKey = '@pry/search';
3893
- const initialSearchState = {
3894
- searchLoading: [],
3895
- payload: undefined,
3896
- id: undefined
3897
- };
3898
- const searchReducer = createReducer(initialSearchState, on(SearchActions.search, (state, action) => ({
3899
- ...state,
3900
- searchLoading: [...new Set([...state.searchLoading, action.id ?? DEFAULT_NAMED_QUERY_ID])],
3901
- payload: action.payload,
3902
- id: action.id
3903
- })), on(SearchActions.getDatasourceItems, (state, action) => ({
3904
- ...state,
3905
- searchLoading: [...new Set([...state.searchLoading, action.id])]
3906
- })), on(SearchActions.searchSuccess, (state, action) => ({
3907
- ...state,
3908
- searchLoading: [...state.searchLoading.filter((id) => id !== (action.id ?? DEFAULT_NAMED_QUERY_ID))]
3909
- })), on(SearchActions.searchFailure, (state, action) => ({
3910
- ...state,
3911
- searchLoading: [...state.searchLoading.filter((id) => id !== (action.id ?? DEFAULT_NAMED_QUERY_ID))]
3912
- })), on(SearchActions.setSearchLoading, (state, action) => ({
3913
- ...state,
3914
- searchLoading: action.start
3915
- ? [...new Set([...state.searchLoading, ...action.datasources])]
3916
- : [...state.searchLoading.filter((id) => !action.datasources.includes(id))]
3917
- })));
3918
-
3919
- const feature$4 = createFeatureSelector(searchFeatureKey);
3920
- const searchLoading = createSelector(feature$4, (state) => state.searchLoading);
3921
- const SearchSelectors = {
3922
- feature: feature$4,
3923
- searchLoading
3924
- };
3925
-
3926
- class ProxyUtils {
3927
- static { this.requested = {}; }
3928
- static init(store) {
3929
- this.store = store;
3930
- store.select(SearchSelectors.searchLoading).subscribe((searchLoading) => {
3931
- this.currentlyLoading = searchLoading;
3932
- });
3933
- store.select(ClassSelectors.classes).subscribe((classes) => {
3934
- this.classes = classes;
3935
- });
3936
- }
3937
- static ResultSets(rss) {
3938
- return Object.entries(rss)
3939
- .map(([key, value]) => ({ key, proxy: ProxyUtils.ResultSet(value, key) }))
3940
- .reduce((p, c) => ({ ...p, [c.key]: c.proxy }), {});
3941
- }
3942
- static ResultSet(rs, rsId) {
3943
- return {
3944
- relations: rs.relations ?? [],
3945
- autoRefreshInterval: rs.autoRefreshInterval,
3946
- merged: rs.merged,
3947
- count: rs.count,
3948
- items: Object.keys(rs.items ?? {})
3949
- .map((classId) => ({
3950
- classId: classId,
3951
- items: rs.items[classId].map((item) => ProxyUtils.Item(item, rsId))
3952
- }))
3953
- .reduce((p, c) => ({ ...p, [c.classId]: c.items }), {})
3954
- };
3955
- }
3956
- static Item(item, rsId) {
3957
- return {
3958
- id: item.id,
3959
- oClass: item.oClass,
3960
- metadata: item.metadata,
3961
- attributes: new Proxy(JSON.parse(JSON.stringify(item.attributes)), {
3962
- get: (original, prop, proxy) => {
3963
- if (prop === 'toJSON') {
3964
- return () => original;
3965
- }
3966
- else {
3967
- if (original[prop]) {
3968
- return original[prop];
3969
- }
3970
- else {
3971
- const clazz = this.classes.find((cl) => cl.id === item.oClass);
3972
- const attr = clazz?.attributes.find((attr) => attr.technicalName === prop);
3973
- if (!!attr) {
3974
- if (!this.currentlyLoading.includes(rsId) && this.requested[prop] !== false) {
3975
- this.requested[prop] = false;
3976
- this.store.dispatch(SearchActions.getDatasourceItems({ id: rsId, excludeGeo: false, from: 'ProxyUtils.Item()' }));
3977
- }
3978
- }
3979
- else {
3980
- console.warn(`Trying to access property ${prop} from class ${clazz?.name} but does not exist in model`);
3981
- }
3982
- }
3983
- }
3984
- return {
3985
- type: 'VALUE',
3986
- value: '',
3987
- visible: false
3988
- };
3989
- }
3990
- })
3991
- };
3992
- }
3993
- }
3994
-
3995
3883
  const BASE_DISPLAY_OPTIONS = {
3996
3884
  presentationTitle: true,
3997
3885
  search: false,
@@ -4073,8 +3961,8 @@ function getDisplayOptions(mode) {
4073
3961
  }
4074
3962
 
4075
3963
  const NEW_WINDOW_TARGET = -1;
4076
- const feature$3 = createFeatureSelector('@pry/dashboard');
4077
- const manifests = createSelector(feature$3, (state) => state?.manifests);
3964
+ const feature$4 = createFeatureSelector('@pry/dashboard');
3965
+ const manifests = createSelector(feature$4, (state) => state?.manifests);
4078
3966
  const rank = createSelector(manifests, (manifests) => manifests?.tenants.indexOf(manifests.sender));
4079
3967
  const currentManifestId = createSelector(manifests, (manifests) => manifests.currentId);
4080
3968
  const globalManifest = createSelector(manifests,
@@ -4087,7 +3975,7 @@ const staticManifest = createSelector(manifests,
4087
3975
  const loading = createSelector(manifests, (manifests) => !!manifests?.loading);
4088
3976
  const refreshRates = createSelector(globalManifest, (manifests) => manifests.refreshRates ?? {});
4089
3977
  const windowManifest = createSelector(globalManifest, rank, (manifest, rank) => manifest.windows[rank] ?? { widgets: [] });
4090
- const gridLayout = createSelector(windowManifest, (manifest) => (manifest.grid ?? {}).layout ?? DashboardGridLayout.MANUAL);
3978
+ const gridLayout = createSelector(windowManifest, (manifest) => ((manifest.grid ?? {}).layout ?? DashboardGridLayout.MANUAL));
4091
3979
  const memoizeWidgetManifest = {};
4092
3980
  const widgetManifest = (index) => {
4093
3981
  if (!memoizeWidgetManifest[index]) {
@@ -4105,8 +3993,8 @@ const targetTenantsIndexes = createSelector(manifests, rank, (manifests, rank) =
4105
3993
  NEW_WINDOW_TARGET,
4106
3994
  ...(manifests.tenants ?? []).map((ten, idx) => idx).filter((idx) => idx !== rank)
4107
3995
  ]);
4108
- const results = createSelector(feature$3, (state) => state?.results);
4109
- const resultSets = createSelector(results, (results) => ProxyUtils.ResultSets(results.resultSets) ?? {});
3996
+ const results = createSelector(feature$4, (state) => state?.results);
3997
+ const resultSets = createSelector(results, (results) => results.resultSets ?? {});
4110
3998
  const resultSetsParams = createSelector(results, (results) => results.resultSetsParams ?? {});
4111
3999
  const namedQueriesNames = createSelector(resultSets, (state) => Object.keys(state) ?? []);
4112
4000
  const availableNamedQueries = createSelector(results, (results) => {
@@ -4123,7 +4011,7 @@ const allItems = createSelector(results, (results) => Object.keys(results.result
4123
4011
  .reduce((p, c) => [...p, ...c], []));
4124
4012
  const getItemsByIds = (ids) => createSelector(allItems, (items) => items.filter((item) => ids.includes(item.id)));
4125
4013
  const selectedItems = createSelector(selectedItemIds, allItems, (itemNames, allItems) => itemNames.map((name) => allItems.find((it) => it.id === name)) ?? []);
4126
- const dashboard = createSelector(feature$3, (state) => state?.dashboard ?? {});
4014
+ const dashboard = createSelector(feature$4, (state) => state?.dashboard ?? {});
4127
4015
  const dashboardCellParams = createSelector(dashboard, (dashboard) => dashboard.params ?? {});
4128
4016
  const dashboardEditionMode = createSelector(dashboard, (dashboard) => dashboard.editionMode ?? false);
4129
4017
  const namedQueriesUses = createSelector(globalManifest, (manifest) => manifest.windows
@@ -4139,11 +4027,11 @@ const namedQueriesUses = createSelector(globalManifest, (manifest) => manifest.w
4139
4027
  .reduce((p, c) => [...p, ...c], [])
4140
4028
  .reduce((p, c) => [...p, ...c], [])
4141
4029
  .reduce((p, c) => ({ ...p, [c.rsName ?? '']: [...(p[c.rsName ?? ''] || []), { ...c }] }), {}));
4142
- const presentation = createSelector(feature$3, (state) => state?.presentation);
4030
+ const presentation = createSelector(feature$4, (state) => state?.presentation);
4143
4031
  const isCurrentPresentationModified = createSelector(presentation, globalManifest, (state, global) => !equal(global, state.initial));
4144
4032
  const isCurrentPresentationOwner = createSelector(presentation, (state) => !!state.current && state.current.owner);
4145
- const filters = createSelector(feature$3, (state) => state?.manifests.manifest.filters ?? []);
4146
- const datasourceFilters = createSelector(feature$3, (state) => state?.manifests.manifest.filters
4033
+ const filters = createSelector(feature$4, (state) => state?.manifests.manifest.filters ?? []);
4034
+ const datasourceFilters = createSelector(feature$4, (state) => state?.manifests.manifest.filters
4147
4035
  ? state?.manifests.manifest.filters.reduce((obj, filter) => (filter.attributes.forEach((attribute) => (obj[attribute.datasource] || (obj[attribute.datasource] = [])).push({
4148
4036
  attribute: attribute.id,
4149
4037
  operator: filter.operator ?? '',
@@ -4151,11 +4039,11 @@ const datasourceFilters = createSelector(feature$3, (state) => state?.manifests.
4151
4039
  })),
4152
4040
  obj), {})
4153
4041
  : {});
4154
- const wmsFeatures = createSelector(feature$3, (state) => state?.wmsFeatures);
4155
- const displayOptions = createSelector(feature$3, (state) => state?.display ?? BASE_DISPLAY_OPTIONS);
4156
- const capabilities = createSelector(feature$3, (state) => state?.capabilities);
4042
+ const wmsFeatures = createSelector(feature$4, (state) => state?.wmsFeatures);
4043
+ const displayOptions = createSelector(feature$4, (state) => state?.display ?? BASE_DISPLAY_OPTIONS);
4044
+ const capabilities = createSelector(feature$4, (state) => state?.capabilities);
4157
4045
  const DashboardSelectors = {
4158
- feature: feature$3,
4046
+ feature: feature$4,
4159
4047
  rank,
4160
4048
  currentManifestId,
4161
4049
  globalManifest,
@@ -4194,6 +4082,15 @@ const DashboardSelectors = {
4194
4082
  capabilities
4195
4083
  };
4196
4084
 
4085
+ const SearchActions = {
4086
+ search: createAction('[Search] search', props()),
4087
+ getDatasourceItems: createAction('[Search] (bus) get datasource items', props()),
4088
+ // result Search
4089
+ searchSuccess: createAction('[Search Api] (bus) Search Success', props()),
4090
+ searchFailure: createAction('[Search Api] (bus) Search Failure', props()),
4091
+ setSearchLoading: createAction('[Search Api] (bus) set Search loading datasource status', props())
4092
+ };
4093
+
4197
4094
  class SearchService {
4198
4095
  constructor(httpClient, store) {
4199
4096
  this.httpClient = httpClient;
@@ -4604,16 +4501,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
4604
4501
  type: Injectable
4605
4502
  }], ctorParameters: function () { return [{ type: i1$3.Actions }, { type: ImageService }]; } });
4606
4503
 
4607
- const feature$2 = createFeatureSelector(contextMenuFeatureKey);
4608
- const opened = createSelector(feature$2, (state) => state?.opened);
4609
- const position = createSelector(feature$2, (state) => ({ clientX: state?.clientX ?? 0, clientY: state?.clientY ?? 0 }));
4610
- const itemId = createSelector(feature$2, (state) => state.itemId);
4611
- const from = createSelector(feature$2, (state) => state.from);
4612
- const coordinates = createSelector(feature$2, (state) => state.coordinates);
4613
- const resultSet = createSelector(feature$2, (state) => state.resultSet);
4614
- const allowObjectCreation = createSelector(feature$2, (state) => state.allowObjectCreation);
4504
+ const feature$3 = createFeatureSelector(contextMenuFeatureKey);
4505
+ const opened = createSelector(feature$3, (state) => state?.opened);
4506
+ const position = createSelector(feature$3, (state) => ({ clientX: state?.clientX ?? 0, clientY: state?.clientY ?? 0 }));
4507
+ const itemId = createSelector(feature$3, (state) => state.itemId);
4508
+ const from = createSelector(feature$3, (state) => state.from);
4509
+ const coordinates = createSelector(feature$3, (state) => state.coordinates);
4510
+ const resultSet = createSelector(feature$3, (state) => state.resultSet);
4511
+ const allowObjectCreation = createSelector(feature$3, (state) => state.allowObjectCreation);
4615
4512
  const ContextMenuSelectors = {
4616
- feature: feature$2,
4513
+ feature: feature$3,
4617
4514
  opened,
4618
4515
  position,
4619
4516
  itemId,
@@ -4996,6 +4893,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
4996
4893
  type: Injectable
4997
4894
  }], ctorParameters: function () { return [{ type: i1$3.Actions }, { type: SearchService }, { type: i1.Store }]; } });
4998
4895
 
4896
+ const searchFeatureKey = '@pry/search';
4897
+ const initialSearchState = {
4898
+ searchLoading: [],
4899
+ payload: undefined,
4900
+ id: undefined
4901
+ };
4902
+ const searchReducer = createReducer(initialSearchState, on(SearchActions.search, (state, action) => ({
4903
+ ...state,
4904
+ searchLoading: [...new Set([...state.searchLoading, action.id ?? DEFAULT_NAMED_QUERY_ID])],
4905
+ payload: action.payload,
4906
+ id: action.id
4907
+ })), on(SearchActions.getDatasourceItems, (state, action) => ({
4908
+ ...state,
4909
+ searchLoading: [...new Set([...state.searchLoading, action.id])]
4910
+ })), on(SearchActions.searchSuccess, (state, action) => ({
4911
+ ...state,
4912
+ searchLoading: [...state.searchLoading.filter((id) => id !== (action.id ?? DEFAULT_NAMED_QUERY_ID))]
4913
+ })), on(SearchActions.searchFailure, (state, action) => ({
4914
+ ...state,
4915
+ searchLoading: [...state.searchLoading.filter((id) => id !== (action.id ?? DEFAULT_NAMED_QUERY_ID))]
4916
+ })), on(SearchActions.setSearchLoading, (state, action) => ({
4917
+ ...state,
4918
+ searchLoading: action.start
4919
+ ? [...new Set([...state.searchLoading, ...action.datasources])]
4920
+ : [...state.searchLoading.filter((id) => !action.datasources.includes(id))]
4921
+ })));
4922
+
4999
4923
  class AccordionComponent {
5000
4924
  constructor() { }
5001
4925
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
@@ -5409,6 +5333,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
5409
5333
  }]
5410
5334
  }], ctorParameters: function () { return [{ type: PryI18nService }]; } });
5411
5335
 
5336
+ const feature$2 = createFeatureSelector(searchFeatureKey);
5337
+ const searchLoading = createSelector(feature$2, (state) => state.searchLoading);
5338
+ const SearchSelectors = {
5339
+ feature: feature$2,
5340
+ searchLoading
5341
+ };
5342
+
5412
5343
  const latLonToGeographicFieldTransformation = (latAttrName, lonAttrName, locAttrName, datasetIds = []) => (id, result) => {
5413
5344
  if (datasetIds.length > 0 && !datasetIds.includes(id)) {
5414
5345
  return result;
@@ -6804,7 +6735,9 @@ class SelectA11yService {
6804
6735
  toggleFocus();
6805
6736
  switch (origin) {
6806
6737
  case 'mouse':
6807
- this.toggle(true);
6738
+ if (!autocomplete) {
6739
+ this.toggle(true);
6740
+ }
6808
6741
  break;
6809
6742
  case 'keyboard':
6810
6743
  if (autocomplete) {
@@ -6822,9 +6755,14 @@ class SelectA11yService {
6822
6755
  }
6823
6756
  onKeydownAutocompleteInput(event, open, searchValue, optionsModalRef) {
6824
6757
  if (event.key === 'Tab') {
6758
+ if (open)
6759
+ this.toggle();
6825
6760
  return;
6826
6761
  }
6827
- if (!open && searchValue?.length > 2 && /[\W]*/.exec(event.key)) {
6762
+ if (!open && searchValue?.length > 2 && event.key.length === 1) {
6763
+ this.toggle();
6764
+ }
6765
+ else if (open && event.key === 'Enter') {
6828
6766
  this.toggle();
6829
6767
  }
6830
6768
  else if (open && event.key === 'ArrowDown') {
@@ -7482,11 +7420,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
7482
7420
 
7483
7421
  const MIME_TYPE_RESULTSET = 'application/resultset';
7484
7422
 
7485
- const DEFAULT_GAP_PX = 15;
7486
- const DEFAULT_COLUMNS_NUMBER = 12;
7487
- const DEFAULT_ROWS_NUMBER = 12;
7488
- const DEFAULT_ROW_HEIGHT_PX = 50;
7489
-
7490
7423
  const arrayOf = (item, num) => {
7491
7424
  return [...new Array(num)].map(() => item);
7492
7425
  };
@@ -7502,143 +7435,98 @@ const createPlacedWidgetCopy = (widget, position) => {
7502
7435
  return tmp;
7503
7436
  };
7504
7437
  const WidgetPlacementUtils = {
7505
- layoutSizeImplementations: {
7506
- [DashboardGridLayout.MANUAL]: (outLayout, params) => {
7507
- outLayout.height = params.rows ?? DEFAULT_ROWS_NUMBER;
7508
- outLayout.width = params.columns ?? DEFAULT_COLUMNS_NUMBER;
7509
- return arrayOf(outLayout, 20);
7438
+ layouts: [
7439
+ {
7440
+ type: DashboardGridLayout.MANUAL,
7441
+ places: [],
7442
+ label: '@pry.toolbox.layout.0',
7443
+ description: '@pry.toolbox.layout.0_detailled',
7444
+ rows: 12,
7445
+ columns: 12
7510
7446
  },
7511
- [DashboardGridLayout.FULL]: (outLayout, params) => {
7512
- outLayout.height = params.rows ?? DEFAULT_ROWS_NUMBER;
7513
- outLayout.width = params.columns ?? DEFAULT_COLUMNS_NUMBER;
7514
- return [outLayout];
7447
+ {
7448
+ type: DashboardGridLayout.FULL,
7449
+ places: [{ x: 1, y: 1, width: 12, height: 12 }],
7450
+ label: '@pry.toolbox.layout.1',
7451
+ description: '@pry.toolbox.layout.1_detailled',
7452
+ rows: 12,
7453
+ columns: 12
7515
7454
  },
7516
- [DashboardGridLayout.QUARTER]: (outLayout, params) => {
7517
- outLayout.height = Math.floor((params.rows ?? DEFAULT_ROWS_NUMBER) / 2);
7518
- outLayout.width = Math.floor((params.columns ?? DEFAULT_COLUMNS_NUMBER) / 2);
7519
- return [outLayout, outLayout, outLayout, outLayout];
7455
+ {
7456
+ type: DashboardGridLayout.HALF_HORIZONTAL,
7457
+ places: [
7458
+ { x: 1, y: 1, width: 12, height: 6 },
7459
+ { x: 1, y: 7, width: 12, height: 6 }
7460
+ ],
7461
+ label: '@pry.toolbox.layout.1/2h',
7462
+ description: '@pry.toolbox.layout.1/2h_detailled',
7463
+ rows: 12,
7464
+ columns: 12
7520
7465
  },
7521
- [DashboardGridLayout.HALF_HORIZONTAL]: (outLayout, params) => {
7522
- outLayout.height = Math.floor((params.rows ?? DEFAULT_ROWS_NUMBER) / 2);
7523
- outLayout.width = params.columns ?? DEFAULT_COLUMNS_NUMBER;
7524
- return [outLayout, outLayout];
7466
+ {
7467
+ type: DashboardGridLayout.HALF_VERTICAL,
7468
+ places: [
7469
+ { x: 1, y: 1, width: 6, height: 12 },
7470
+ { x: 7, y: 1, width: 6, height: 12 }
7471
+ ],
7472
+ label: '@pry.toolbox.layout.1/2v',
7473
+ description: '@pry.toolbox.layout.1/2v_detailled',
7474
+ rows: 12,
7475
+ columns: 12
7525
7476
  },
7526
- [DashboardGridLayout.HALF_VERTICAL]: (outLayout, params) => {
7527
- outLayout.height = params.rows ?? DEFAULT_ROWS_NUMBER;
7528
- outLayout.width = Math.floor((params.columns ?? DEFAULT_COLUMNS_NUMBER) / 2);
7529
- return [outLayout, outLayout];
7477
+ {
7478
+ type: DashboardGridLayout.THIRD_HORIZONTAL,
7479
+ places: [
7480
+ { x: 1, y: 1, width: 12, height: 4 },
7481
+ { x: 1, y: 5, width: 12, height: 4 },
7482
+ { x: 1, y: 9, width: 12, height: 4 }
7483
+ ],
7484
+ label: '@pry.toolbox.layout.1/3h',
7485
+ description: '@pry.toolbox.layout.1/3h_detailled',
7486
+ rows: 12,
7487
+ columns: 12
7530
7488
  },
7531
- [DashboardGridLayout.THIRD_HORIZONTAL]: (outLayout, params) => {
7532
- outLayout.height = Math.floor((params.rows ?? DEFAULT_ROWS_NUMBER) / 3);
7533
- outLayout.width = params.columns ?? DEFAULT_COLUMNS_NUMBER;
7534
- return [outLayout, outLayout, outLayout];
7489
+ {
7490
+ type: DashboardGridLayout.THIRD_VERTICAL,
7491
+ places: [
7492
+ { x: 1, y: 1, width: 4, height: 12 },
7493
+ { x: 5, y: 1, width: 4, height: 12 },
7494
+ { x: 9, y: 1, width: 4, height: 12 }
7495
+ ],
7496
+ label: '@pry.toolbox.layout.1/3v',
7497
+ description: '@pry.toolbox.layout.1/3v_detailled',
7498
+ rows: 12,
7499
+ columns: 12
7535
7500
  },
7536
- [DashboardGridLayout.THIRD_VERTICAL]: (outLayout, params) => {
7537
- outLayout.height = params.rows ?? DEFAULT_ROWS_NUMBER;
7538
- outLayout.width = Math.floor((params.columns ?? DEFAULT_COLUMNS_NUMBER) / 3);
7539
- return [outLayout, outLayout, outLayout];
7540
- }
7541
- },
7542
- placementOptionsImplementations: {
7543
- // Manual mode do not offer automatic placement solutions... propose fullscreen
7544
- [DashboardGridLayout.MANUAL]: (widgetToPlace, sizes, params) => [createPlacedWidgetCopy(widgetToPlace, { ...sizes[0], x: 1, y: 1 })],
7545
- [DashboardGridLayout.FULL]: (widgetToPlace, sizes, params) => [createPlacedWidgetCopy(widgetToPlace, { ...sizes[0], x: 1, y: 1 })],
7546
- [DashboardGridLayout.HALF_VERTICAL]: (widgetToPlace, sizes, params) => [
7547
- createPlacedWidgetCopy(widgetToPlace, { ...sizes[0], x: 1, y: 1 }),
7548
- createPlacedWidgetCopy(widgetToPlace, {
7549
- ...sizes[1],
7550
- x: Math.floor((params.columns ?? DEFAULT_COLUMNS_NUMBER) / 2) + 1,
7551
- y: 1
7552
- })
7553
- ],
7554
- [DashboardGridLayout.HALF_HORIZONTAL]: (widgetToPlace, sizes, params) => [
7555
- createPlacedWidgetCopy(widgetToPlace, { ...sizes[0], x: 1, y: 1 }),
7556
- createPlacedWidgetCopy(widgetToPlace, {
7557
- ...sizes[1],
7558
- x: 1,
7559
- y: Math.ceil((params.rows ?? DEFAULT_ROWS_NUMBER) / 2) + 1
7560
- })
7561
- ],
7562
- [DashboardGridLayout.THIRD_VERTICAL]: (widgetToPlace, sizes, params) => [
7563
- createPlacedWidgetCopy(widgetToPlace, { ...sizes[0], x: 1, y: 1 }),
7564
- createPlacedWidgetCopy(widgetToPlace, {
7565
- ...sizes[1],
7566
- x: Math.ceil((params.columns ?? DEFAULT_COLUMNS_NUMBER) / 3) + 1,
7567
- y: 1
7568
- }),
7569
- createPlacedWidgetCopy(widgetToPlace, {
7570
- ...sizes[2],
7571
- x: Math.ceil(((params.columns ?? DEFAULT_COLUMNS_NUMBER) * 2) / 3) + 1,
7572
- y: 1
7573
- })
7574
- ],
7575
- [DashboardGridLayout.THIRD_HORIZONTAL]: (widgetToPlace, sizes, params) => [
7576
- createPlacedWidgetCopy(widgetToPlace, { ...sizes[0], x: 1, y: 1 }),
7577
- createPlacedWidgetCopy(widgetToPlace, {
7578
- ...sizes[1],
7579
- x: 1,
7580
- y: Math.ceil((params.rows ?? DEFAULT_ROWS_NUMBER) / 3) + 1
7581
- }),
7582
- createPlacedWidgetCopy(widgetToPlace, {
7583
- ...sizes[2],
7584
- x: 1,
7585
- y: Math.ceil(((params.rows ?? DEFAULT_ROWS_NUMBER) * 2) / 3) + 1
7586
- })
7587
- ],
7588
- [DashboardGridLayout.QUARTER]: (widgetToPlace, sizes, params) => [
7589
- createPlacedWidgetCopy(widgetToPlace, { ...sizes[0], x: 1, y: 1 }),
7590
- createPlacedWidgetCopy(widgetToPlace, {
7591
- ...sizes[2],
7592
- x: Math.ceil((params.columns ?? DEFAULT_COLUMNS_NUMBER) / 2) + 1,
7593
- y: 1
7594
- }),
7595
- createPlacedWidgetCopy(widgetToPlace, {
7596
- ...sizes[1],
7597
- x: 1,
7598
- y: Math.ceil((params.rows ?? DEFAULT_ROWS_NUMBER ?? DEFAULT_ROWS_NUMBER) / 2) + 1
7599
- }),
7600
- createPlacedWidgetCopy(widgetToPlace, {
7601
- ...sizes[3],
7602
- x: Math.ceil((params.columns ?? DEFAULT_COLUMNS_NUMBER) / 2) + 1,
7603
- y: Math.ceil((params.rows ?? DEFAULT_ROWS_NUMBER) / 2) + 1
7604
- })
7605
- ]
7606
- },
7607
- layoutImages: {
7608
- [DashboardGridLayout.MANUAL]: 'assets/svgs/grid_composition_libre.svg',
7609
- [DashboardGridLayout.THIRD_VERTICAL]: 'assets/svgs/grid_1_3_vertical.svg',
7610
- [DashboardGridLayout.THIRD_HORIZONTAL]: 'assets/svgs/grid_1_3_horizontal.svg',
7611
- [DashboardGridLayout.HALF_VERTICAL]: 'assets/svgs/grid_1_2_vertical.svg',
7612
- [DashboardGridLayout.HALF_HORIZONTAL]: 'assets/svgs/grid_1_2_horizontal.svg',
7613
- [DashboardGridLayout.QUARTER]: 'assets/svgs/grid_1_4.svg',
7614
- [DashboardGridLayout.FULL]: 'assets/svgs/grid_full.svg'
7615
- },
7616
- addLayoutImplementation: (type, fnSizeImplementation, fnPlacementOptionImplementation, image) => {
7617
- WidgetPlacementUtils.layoutSizeImplementations[type] = fnSizeImplementation;
7618
- WidgetPlacementUtils.placementOptionsImplementations[type] = fnPlacementOptionImplementation;
7619
- WidgetPlacementUtils.layoutImages[type] = image ?? 'assets/svgs/default.svg';
7501
+ {
7502
+ type: DashboardGridLayout.QUARTER,
7503
+ places: [
7504
+ { x: 1, y: 1, width: 6, height: 6 },
7505
+ { x: 1, y: 7, width: 6, height: 6 },
7506
+ { x: 7, y: 1, width: 6, height: 6 },
7507
+ { x: 7, y: 7, width: 6, height: 6 }
7508
+ ],
7509
+ label: '@pry.toolbox.layout.1/4',
7510
+ description: '@pry.toolbox.layout.1/4_detailled',
7511
+ rows: 12,
7512
+ columns: 12
7513
+ }
7514
+ ],
7515
+ addGridLayout(layout) {
7516
+ this.layouts.push(layout);
7620
7517
  },
7621
- getLayouts: () => Object.keys(WidgetPlacementUtils.placementOptionsImplementations).map((layout) => ({
7622
- key: layout,
7623
- image: WidgetPlacementUtils.layoutImages[layout]
7624
- })),
7625
7518
  isLeft: (w1, w2) => w2.layout.x + w2.layout.width <= w1.layout.x,
7626
7519
  isBelow: (w1, w2) => w2.layout.y + w2.layout.height <= w1.layout.y,
7627
7520
  areDisjoint: (w1, w2) => WidgetPlacementUtils.isLeft(w1, w2) ||
7628
7521
  WidgetPlacementUtils.isLeft(w2, w1) ||
7629
7522
  WidgetPlacementUtils.isBelow(w1, w2) ||
7630
7523
  WidgetPlacementUtils.isBelow(w2, w1),
7631
- placementOptions: (widgetToPlace, layout, params) => {
7632
- if (!WidgetPlacementUtils.placementOptionsImplementations[layout]) {
7633
- return [];
7634
- }
7635
- return WidgetPlacementUtils.placementOptionsImplementations[layout](widgetToPlace, WidgetPlacementUtils.getLayoutSize(layout, params), params);
7636
- },
7637
- getLayoutSize(layout, params) {
7638
- if (!WidgetPlacementUtils.layoutSizeImplementations[layout]) {
7524
+ placementOptions: (widgetToPlace, layout) => {
7525
+ const layoutO = WidgetPlacementUtils.getLayout(layout);
7526
+ if (!layoutO) {
7639
7527
  return [];
7640
7528
  }
7641
- return WidgetPlacementUtils.layoutSizeImplementations[layout]({ x: 1, y: 1, height: 1, width: 1 }, params);
7529
+ return layoutO.places.map((place) => ({ ...widgetToPlace, layout: place }));
7642
7530
  },
7643
7531
  swapArrayElements: (arr, x, y) => {
7644
7532
  if (arr.length === 1)
@@ -7663,11 +7551,16 @@ const WidgetPlacementUtils = {
7663
7551
  problems.sort((a, b) => a[0].layout.y * 100000 - b[0].layout.y * 100000 + a[0].layout.x - b[0].layout.y);
7664
7552
  return problems;
7665
7553
  },
7666
- placesForLayout(layout) {
7667
- return this.getLayoutSize(layout, { rows: 1, columns: 1 }).length;
7554
+ getLayout(layout) {
7555
+ return this.layouts.find((lay) => lay.type === layout);
7668
7556
  }
7669
7557
  };
7670
7558
 
7559
+ const DEFAULT_GAP_PX = 15;
7560
+ const DEFAULT_COLUMNS_NUMBER = 12;
7561
+ const DEFAULT_ROWS_NUMBER = 12;
7562
+ const DEFAULT_ROW_HEIGHT_PX = 50;
7563
+
7671
7564
  function orderWidgetsAccordingToPlacement(a, b) {
7672
7565
  return ((b.layout.weight ?? 0) * 1000000 -
7673
7566
  (a.layout.weight ?? 0) * 1000000 +
@@ -8387,6 +8280,7 @@ class DashboardComponent extends SubscriptionnerDirective {
8387
8280
  this.indexForRemoval = -1;
8388
8281
  this.params = {};
8389
8282
  this.CloseOnDragOut = true;
8283
+ this.noBackground = false;
8390
8284
  this.canCalculateView = false;
8391
8285
  this.dashboardParams = {
8392
8286
  gridWidth: 1,
@@ -8428,8 +8322,8 @@ class DashboardComponent extends SubscriptionnerDirective {
8428
8322
  const wManifest = JSON.parse(JSON.stringify(_wManifest));
8429
8323
  if (wManifest.grid?.layout && wManifest.grid.layout !== DashboardGridLayout.MANUAL) {
8430
8324
  // Complete with placeholders
8431
- const size = WidgetPlacementUtils.placesForLayout(wManifest.grid.layout);
8432
- const places = WidgetPlacementUtils.placementOptions({ type: 'filler', layout: { x: 1, y: 1, width: 1, height: 1 } }, wManifest.grid.layout, wManifest.grid);
8325
+ const size = WidgetPlacementUtils.getLayout(wManifest.grid.layout)?.places.length ?? 0;
8326
+ const places = WidgetPlacementUtils.placementOptions({ type: 'filler', layout: { x: 1, y: 1, width: 1, height: 1 } }, wManifest.grid.layout);
8433
8327
  let added = true;
8434
8328
  while (wManifest.widgets.length < size && added) {
8435
8329
  added = false;
@@ -8502,9 +8396,7 @@ class DashboardComponent extends SubscriptionnerDirective {
8502
8396
  : `3/1/${(manifest.grid?.columns ?? DEFAULT_COLUMNS_NUMBER) - 1}/1`));
8503
8397
  this.separators$ = this.store
8504
8398
  .select(DashboardSelectors.gridLayout)
8505
- .pipe(map$1((layout) => layout === DashboardGridLayout.MANUAL
8506
- ? []
8507
- : WidgetPlacementUtils.getLayoutSize(layout, { rows: 1, columns: 1 })));
8399
+ .pipe(map$1((layout) => layout === DashboardGridLayout.MANUAL ? [] : WidgetPlacementUtils.getLayout(layout)?.places ?? []));
8508
8400
  }
8509
8401
  ngOnInit() {
8510
8402
  if (this.displayOptions)
@@ -8563,7 +8455,7 @@ class DashboardComponent extends SubscriptionnerDirective {
8563
8455
  return '1 / 1';
8564
8456
  }
8565
8457
  if (layout.width > 1) {
8566
- return `${Math.min(layout.x, this.dashboardParams.columns - layout.width + 1)} / ${Math.min(layout.x + layout.width, this.dashboardParams.columns + 1)}`;
8458
+ return `${Math.min(layout.x, this.params.columns - layout.width + 1)} / ${Math.min(layout.x + layout.width, this.params.columns + 1)}`;
8567
8459
  }
8568
8460
  else {
8569
8461
  return `${layout.x}`;
@@ -8580,7 +8472,7 @@ class DashboardComponent extends SubscriptionnerDirective {
8580
8472
  return `${previousHeight ?? 1} / ${(previousHeight ?? 1) + layout.height}`;
8581
8473
  }
8582
8474
  if (layout.height > 1) {
8583
- return `${Math.max(1, Math.min(layout.y, this.dashboardParams.rows - layout.height + 1))} / ${Math.min(layout.y + layout.height, this.dashboardParams.rows + 1)}`;
8475
+ return `${Math.max(1, Math.min(layout.y, this.params.rows - layout.height + 1))} / ${Math.min(layout.y + layout.height, this.params.rows + 1)}`;
8584
8476
  }
8585
8477
  else {
8586
8478
  return `${layout.y}`;
@@ -8677,7 +8569,10 @@ class DashboardComponent extends SubscriptionnerDirective {
8677
8569
  }
8678
8570
  else {
8679
8571
  // Use grid size
8680
- const layout = WidgetPlacementUtils.getLayoutSize(this.layout, this.dashboardParams)[this.initialWidgetManifestList.length];
8572
+ const layout = (WidgetPlacementUtils.getLayout(this.layout)?.places ?? [])[this.initialWidgetManifestList.length] ?? {
8573
+ width: 1,
8574
+ height: 1
8575
+ };
8681
8576
  this.currentlyModifiedManifest.layout.width = layout.width;
8682
8577
  this.currentlyModifiedManifest.layout.height = layout.height;
8683
8578
  }
@@ -8883,11 +8778,11 @@ class DashboardComponent extends SubscriptionnerDirective {
8883
8778
  return index + '-' + widgetManifest.type + '-' + JSON.stringify(widgetManifest.layout);
8884
8779
  }
8885
8780
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DashboardComponent, deps: [{ token: i1.Store }, { token: i2.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component }); }
8886
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DashboardComponent, selector: "pry-dashboard", inputs: { staticDashboard: "staticDashboard", CloseOnDragOut: "CloseOnDragOut", displayOptions: "displayOptions" }, outputs: { rowHeight: "rowHeight", rows: "rows" }, viewQueries: [{ propertyName: "templateModal", first: true, predicate: ["templateModal"], descendants: true, read: TemplateRef }, { propertyName: "gridRef", first: true, predicate: ["grid"], descendants: true }, { propertyName: "instanciators", predicate: WidgetInstanciatorComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"o-dashboard-grid\"\n [style.gridTemplateColumns]=\"gridTemplateColumns$ | async\"\n [style.gridTemplateRows]=\"gridTemplateRows$ | async\"\n [style.gridGap]=\"dashboardParams.gridGap + 'px'\"\n [style.padding]=\"'0 ' + dashboardParams.gridGap + 'px'\"\n #grid\n (mousemove)=\"movingMouse($event)\"\n (drop)=\"dropping($event)\"\n (dragover)=\"dragMove($event)\"\n (dragleave)=\"dragLeave($event)\"\n (dragenter)=\"dragEnter($event)\"\n>\n <ng-container\n *ngFor=\"\n let widgetManifest of (windowManifest$ | async)?.widgets || [];\n let widgetIndex = index;\n trackBy: trackWidgets\n \"\n >\n <div\n class=\"o-dashboard-widget\"\n [class.-edited]=\"modeEdition\"\n [style.gridColumn]=\"gridColumn(widgetManifest.layout)\"\n [style.gridRow]=\"gridRow(widgetManifest.layout)\"\n (drop)=\"droppingInWidget($event, widgetIndex)\"\n >\n <ng-container *ngIf=\"modeEdition\">\n <div class=\"resize nw-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-nw')\">\n <pry-icon iconSvg=\"north_west\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize sw-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-sw')\">\n <pry-icon iconSvg=\"south_west\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize ne-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-ne')\">\n <pry-icon iconSvg=\"north_east\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize se-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-se')\">\n <pry-icon iconSvg=\"south_east\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize delete\" (mousedown)=\"toggleRemoveConfirm($event, widgetIndex)\">\n <pry-icon iconSvg=\"close\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"move\" draggable=\"true\" (dragstart)=\"dragStart($event, widgetIndex)\">\n <div class=\"move-inside move-{{ widgetManifest.type }}\">\n <span>{{ widgetManifest.title ?? ('@pry.toolbox.' + widgetManifest.type | i18n) }}</span>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!modeEdition\">\n <pry-widget-instanciator\n [staticManifest]=\"widgetManifest\"\n [widgetIndex]=\"widgetIndex\"\n ></pry-widget-instanciator>\n </ng-container>\n </div>\n </ng-container>\n\n <ng-container\n *ngIf=\"{\n noWidgets: (nonFillerWidgets$ | async) === 0,\n globalLoading: loading$ | async,\n fetchLoading: (dataFetching$ | async)?.length ?? 1 > 0\n } as data\"\n >\n <ng-container *ngIf=\"data.noWidgets\">\n <div *ngIf=\"data.globalLoading; else notLoading\" class=\"no-widget\" [style.grid-area]=\"backgroundArea$ | async\">\n <pry-icon\n iconSvg=\"loader\"\n class=\"no-widget__loading\"\n [alt]=\"'@pry.widget.target.loading' | i18n\"\n [width]=\"100\"\n [height]=\"100\"\n />\n <span class=\"no-widget__text\">{{ '@pry.widget.target.loading' | i18n }}...</span>\n </div>\n <ng-template #notLoading>\n <div class=\"no-widget\" [style.grid-area]=\"backgroundArea$ | async\">\n <img\n class=\"no-widget__search\"\n src=\"../../../assets/svgs/pry_recherche.svg\"\n alt=\"{{\n (layout === DashboardGridLayout.MANUAL\n ? '@pry.widget.target.none_manual'\n : '@pry.widget.target.none_auto'\n ) | i18n\n }} {{ backgroundArea$ | async }}\"\n />\n <span class=\"no-widget__text\">{{\n (layout === DashboardGridLayout.MANUAL ? '@pry.widget.target.none_manual' : '@pry.widget.target.none_auto')\n | i18n\n }}</span>\n </div>\n </ng-template>\n </ng-container>\n <div\n class=\"a-page-loader backdrop\"\n [style.display]=\"data.fetchLoading && !data.globalLoading ? 'flex' : 'none'\"\n [style.width.px]=\"params.gridWidth\"\n [style.height.px]=\"params.gridHeight\"\n >\n <pry-icon\n iconSvg=\"loader\"\n class=\"no-widget__loading\"\n [alt]=\"'@pry.widget.target.loading' | i18n\"\n [width]=\"200\"\n [height]=\"200\"\n />\n <p>{{ '@pry.widget.target.loading' | i18n }}...</p>\n </div>\n </ng-container>\n</div>\n<pry-context-menu></pry-context-menu>\n\n<ng-template #templateModal>\n <div class=\"o-modal\">\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title\">\n {{ '@pry.widget.modalTitle' | i18n }}\n </h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" (click)=\"cancelRemoveConfirm()\">\n <pry-icon iconSvg=\"close\" [height]=\"35\" [width]=\"35\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.toolbox.close' | i18n }}</span>\n </button>\n </div>\n </div>\n <div class=\"m-btn-group\">\n <button type=\"button\" (click)=\"cancelRemoveConfirm()\" class=\"a-btn a-btn--secondary\">\n {{ '@pry.toolbox.manifest.close' | i18n }}\n </button>\n <button type=\"submit\" (click)=\"confirmRemove()\" class=\"a-btn a-btn--primary\">\n {{ '@pry.toolbox.manifest.validate' | i18n }}\n </button>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: WidgetInstanciatorComponent, selector: "pry-widget-instanciator", inputs: ["widgetIndex", "staticManifest", "standalone", "open$"], outputs: ["manifestModified"] }, { kind: "component", type: ContextMenuComponent, selector: "pry-context-menu" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
8781
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DashboardComponent, selector: "pry-dashboard", inputs: { staticDashboard: "staticDashboard", CloseOnDragOut: "CloseOnDragOut", displayOptions: "displayOptions", noBackground: "noBackground", breakpoint: "breakpoint" }, outputs: { rowHeight: "rowHeight", rows: "rows" }, viewQueries: [{ propertyName: "templateModal", first: true, predicate: ["templateModal"], descendants: true, read: TemplateRef }, { propertyName: "gridRef", first: true, predicate: ["grid"], descendants: true }, { propertyName: "instanciators", predicate: WidgetInstanciatorComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"o-dashboard-grid\"\n [style.gridTemplateColumns]=\"gridTemplateColumns$ | async\"\n [style.gridTemplateRows]=\"gridTemplateRows$ | async\"\n [style.gridGap]=\"dashboardParams.gridGap + 'px'\"\n [style.padding]=\"'0 ' + dashboardParams.gridGap + 'px'\"\n #grid\n (mousemove)=\"movingMouse($event)\"\n (drop)=\"dropping($event)\"\n (dragover)=\"dragMove($event)\"\n (dragleave)=\"dragLeave($event)\"\n (dragenter)=\"dragEnter($event)\"\n>\n <ng-container\n *ngFor=\"\n let widgetManifest of (windowManifest$ | async)?.widgets || [];\n let widgetIndex = index;\n trackBy: trackWidgets\n \"\n >\n <div\n class=\"o-dashboard-widget\"\n [class.-edited]=\"modeEdition\"\n [style.gridColumn]=\"gridColumn(widgetManifest.layout)\"\n [style.gridRow]=\"gridRow(widgetManifest.layout)\"\n (drop)=\"droppingInWidget($event, widgetIndex)\"\n >\n <ng-container *ngIf=\"modeEdition\">\n <div class=\"resize nw-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-nw')\">\n <pry-icon iconSvg=\"north_west\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize sw-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-sw')\">\n <pry-icon iconSvg=\"south_west\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize ne-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-ne')\">\n <pry-icon iconSvg=\"north_east\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize se-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-se')\">\n <pry-icon iconSvg=\"south_east\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize delete\" (mousedown)=\"toggleRemoveConfirm($event, widgetIndex)\">\n <pry-icon iconSvg=\"close\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"move\" draggable=\"true\" (dragstart)=\"dragStart($event, widgetIndex)\">\n <div class=\"move-inside move-{{ widgetManifest.type }}\">\n <span>{{ widgetManifest.title ?? ('@pry.toolbox.' + widgetManifest.type | i18n) }}</span>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!modeEdition\">\n <pry-widget-instanciator\n [staticManifest]=\"widgetManifest\"\n [widgetIndex]=\"widgetIndex\"\n ></pry-widget-instanciator>\n </ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!noBackground\">\n <ng-container\n *ngIf=\"{\n noWidgets: (nonFillerWidgets$ | async) === 0,\n globalLoading: loading$ | async,\n fetchLoading: (dataFetching$ | async)?.length ?? 1 > 0\n } as data\"\n >\n <ng-container *ngIf=\"data.noWidgets\">\n <div *ngIf=\"data.globalLoading; else notLoading\" class=\"no-widget\" [style.grid-area]=\"backgroundArea$ | async\">\n <pry-icon\n iconSvg=\"loader\"\n class=\"no-widget__loading\"\n [alt]=\"'@pry.widget.target.loading' | i18n\"\n [width]=\"100\"\n [height]=\"100\"\n />\n <span class=\"no-widget__text\">{{ '@pry.widget.target.loading' | i18n }}...</span>\n </div>\n <ng-template #notLoading>\n <div class=\"no-widget\" [style.grid-area]=\"backgroundArea$ | async\">\n <img\n class=\"no-widget__search\"\n src=\"../../../assets/svgs/pry_recherche.svg\"\n alt=\"{{\n (layout === DashboardGridLayout.MANUAL\n ? '@pry.widget.target.none_manual'\n : '@pry.widget.target.none_auto'\n ) | i18n\n }} {{ backgroundArea$ | async }}\"\n />\n <span class=\"no-widget__text\">{{\n (layout === DashboardGridLayout.MANUAL\n ? '@pry.widget.target.none_manual'\n : '@pry.widget.target.none_auto'\n ) | i18n\n }}</span>\n </div>\n </ng-template>\n </ng-container>\n <div\n class=\"a-page-loader backdrop\"\n [style.display]=\"data.fetchLoading && !data.globalLoading ? 'flex' : 'none'\"\n [style.width.px]=\"params.gridWidth\"\n [style.height.px]=\"params.gridHeight\"\n >\n <pry-icon\n iconSvg=\"loader\"\n class=\"no-widget__loading\"\n [alt]=\"'@pry.widget.target.loading' | i18n\"\n [width]=\"200\"\n [height]=\"200\"\n />\n <p>{{ '@pry.widget.target.loading' | i18n }}...</p>\n </div>\n </ng-container>\n </ng-container>\n</div>\n<pry-context-menu></pry-context-menu>\n\n<ng-template #templateModal>\n <div class=\"o-modal\">\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title\">\n {{ '@pry.widget.modalTitle' | i18n }}\n </h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" (click)=\"cancelRemoveConfirm()\">\n <pry-icon iconSvg=\"close\" [height]=\"35\" [width]=\"35\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.toolbox.close' | i18n }}</span>\n </button>\n </div>\n </div>\n <div class=\"m-btn-group\">\n <button type=\"button\" (click)=\"cancelRemoveConfirm()\" class=\"a-btn a-btn--secondary\">\n {{ '@pry.toolbox.manifest.close' | i18n }}\n </button>\n <button type=\"submit\" (click)=\"confirmRemove()\" class=\"a-btn a-btn--primary\">\n {{ '@pry.toolbox.manifest.validate' | i18n }}\n </button>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: WidgetInstanciatorComponent, selector: "pry-widget-instanciator", inputs: ["widgetIndex", "staticManifest", "standalone", "open$"], outputs: ["manifestModified"] }, { kind: "component", type: ContextMenuComponent, selector: "pry-context-menu" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
8887
8782
  }
8888
8783
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DashboardComponent, decorators: [{
8889
8784
  type: Component,
8890
- args: [{ selector: 'pry-dashboard', template: "<div\n class=\"o-dashboard-grid\"\n [style.gridTemplateColumns]=\"gridTemplateColumns$ | async\"\n [style.gridTemplateRows]=\"gridTemplateRows$ | async\"\n [style.gridGap]=\"dashboardParams.gridGap + 'px'\"\n [style.padding]=\"'0 ' + dashboardParams.gridGap + 'px'\"\n #grid\n (mousemove)=\"movingMouse($event)\"\n (drop)=\"dropping($event)\"\n (dragover)=\"dragMove($event)\"\n (dragleave)=\"dragLeave($event)\"\n (dragenter)=\"dragEnter($event)\"\n>\n <ng-container\n *ngFor=\"\n let widgetManifest of (windowManifest$ | async)?.widgets || [];\n let widgetIndex = index;\n trackBy: trackWidgets\n \"\n >\n <div\n class=\"o-dashboard-widget\"\n [class.-edited]=\"modeEdition\"\n [style.gridColumn]=\"gridColumn(widgetManifest.layout)\"\n [style.gridRow]=\"gridRow(widgetManifest.layout)\"\n (drop)=\"droppingInWidget($event, widgetIndex)\"\n >\n <ng-container *ngIf=\"modeEdition\">\n <div class=\"resize nw-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-nw')\">\n <pry-icon iconSvg=\"north_west\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize sw-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-sw')\">\n <pry-icon iconSvg=\"south_west\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize ne-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-ne')\">\n <pry-icon iconSvg=\"north_east\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize se-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-se')\">\n <pry-icon iconSvg=\"south_east\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize delete\" (mousedown)=\"toggleRemoveConfirm($event, widgetIndex)\">\n <pry-icon iconSvg=\"close\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"move\" draggable=\"true\" (dragstart)=\"dragStart($event, widgetIndex)\">\n <div class=\"move-inside move-{{ widgetManifest.type }}\">\n <span>{{ widgetManifest.title ?? ('@pry.toolbox.' + widgetManifest.type | i18n) }}</span>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!modeEdition\">\n <pry-widget-instanciator\n [staticManifest]=\"widgetManifest\"\n [widgetIndex]=\"widgetIndex\"\n ></pry-widget-instanciator>\n </ng-container>\n </div>\n </ng-container>\n\n <ng-container\n *ngIf=\"{\n noWidgets: (nonFillerWidgets$ | async) === 0,\n globalLoading: loading$ | async,\n fetchLoading: (dataFetching$ | async)?.length ?? 1 > 0\n } as data\"\n >\n <ng-container *ngIf=\"data.noWidgets\">\n <div *ngIf=\"data.globalLoading; else notLoading\" class=\"no-widget\" [style.grid-area]=\"backgroundArea$ | async\">\n <pry-icon\n iconSvg=\"loader\"\n class=\"no-widget__loading\"\n [alt]=\"'@pry.widget.target.loading' | i18n\"\n [width]=\"100\"\n [height]=\"100\"\n />\n <span class=\"no-widget__text\">{{ '@pry.widget.target.loading' | i18n }}...</span>\n </div>\n <ng-template #notLoading>\n <div class=\"no-widget\" [style.grid-area]=\"backgroundArea$ | async\">\n <img\n class=\"no-widget__search\"\n src=\"../../../assets/svgs/pry_recherche.svg\"\n alt=\"{{\n (layout === DashboardGridLayout.MANUAL\n ? '@pry.widget.target.none_manual'\n : '@pry.widget.target.none_auto'\n ) | i18n\n }} {{ backgroundArea$ | async }}\"\n />\n <span class=\"no-widget__text\">{{\n (layout === DashboardGridLayout.MANUAL ? '@pry.widget.target.none_manual' : '@pry.widget.target.none_auto')\n | i18n\n }}</span>\n </div>\n </ng-template>\n </ng-container>\n <div\n class=\"a-page-loader backdrop\"\n [style.display]=\"data.fetchLoading && !data.globalLoading ? 'flex' : 'none'\"\n [style.width.px]=\"params.gridWidth\"\n [style.height.px]=\"params.gridHeight\"\n >\n <pry-icon\n iconSvg=\"loader\"\n class=\"no-widget__loading\"\n [alt]=\"'@pry.widget.target.loading' | i18n\"\n [width]=\"200\"\n [height]=\"200\"\n />\n <p>{{ '@pry.widget.target.loading' | i18n }}...</p>\n </div>\n </ng-container>\n</div>\n<pry-context-menu></pry-context-menu>\n\n<ng-template #templateModal>\n <div class=\"o-modal\">\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title\">\n {{ '@pry.widget.modalTitle' | i18n }}\n </h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" (click)=\"cancelRemoveConfirm()\">\n <pry-icon iconSvg=\"close\" [height]=\"35\" [width]=\"35\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.toolbox.close' | i18n }}</span>\n </button>\n </div>\n </div>\n <div class=\"m-btn-group\">\n <button type=\"button\" (click)=\"cancelRemoveConfirm()\" class=\"a-btn a-btn--secondary\">\n {{ '@pry.toolbox.manifest.close' | i18n }}\n </button>\n <button type=\"submit\" (click)=\"confirmRemove()\" class=\"a-btn a-btn--primary\">\n {{ '@pry.toolbox.manifest.validate' | i18n }}\n </button>\n </div>\n </div>\n</ng-template>\n" }]
8785
+ args: [{ selector: 'pry-dashboard', template: "<div\n class=\"o-dashboard-grid\"\n [style.gridTemplateColumns]=\"gridTemplateColumns$ | async\"\n [style.gridTemplateRows]=\"gridTemplateRows$ | async\"\n [style.gridGap]=\"dashboardParams.gridGap + 'px'\"\n [style.padding]=\"'0 ' + dashboardParams.gridGap + 'px'\"\n #grid\n (mousemove)=\"movingMouse($event)\"\n (drop)=\"dropping($event)\"\n (dragover)=\"dragMove($event)\"\n (dragleave)=\"dragLeave($event)\"\n (dragenter)=\"dragEnter($event)\"\n>\n <ng-container\n *ngFor=\"\n let widgetManifest of (windowManifest$ | async)?.widgets || [];\n let widgetIndex = index;\n trackBy: trackWidgets\n \"\n >\n <div\n class=\"o-dashboard-widget\"\n [class.-edited]=\"modeEdition\"\n [style.gridColumn]=\"gridColumn(widgetManifest.layout)\"\n [style.gridRow]=\"gridRow(widgetManifest.layout)\"\n (drop)=\"droppingInWidget($event, widgetIndex)\"\n >\n <ng-container *ngIf=\"modeEdition\">\n <div class=\"resize nw-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-nw')\">\n <pry-icon iconSvg=\"north_west\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize sw-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-sw')\">\n <pry-icon iconSvg=\"south_west\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize ne-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-ne')\">\n <pry-icon iconSvg=\"north_east\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize se-resize\" (mousedown)=\"startResize($event, widgetIndex, 'resize-se')\">\n <pry-icon iconSvg=\"south_east\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"resize delete\" (mousedown)=\"toggleRemoveConfirm($event, widgetIndex)\">\n <pry-icon iconSvg=\"close\" [animation]=\"false\"></pry-icon>\n </div>\n <div class=\"move\" draggable=\"true\" (dragstart)=\"dragStart($event, widgetIndex)\">\n <div class=\"move-inside move-{{ widgetManifest.type }}\">\n <span>{{ widgetManifest.title ?? ('@pry.toolbox.' + widgetManifest.type | i18n) }}</span>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!modeEdition\">\n <pry-widget-instanciator\n [staticManifest]=\"widgetManifest\"\n [widgetIndex]=\"widgetIndex\"\n ></pry-widget-instanciator>\n </ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!noBackground\">\n <ng-container\n *ngIf=\"{\n noWidgets: (nonFillerWidgets$ | async) === 0,\n globalLoading: loading$ | async,\n fetchLoading: (dataFetching$ | async)?.length ?? 1 > 0\n } as data\"\n >\n <ng-container *ngIf=\"data.noWidgets\">\n <div *ngIf=\"data.globalLoading; else notLoading\" class=\"no-widget\" [style.grid-area]=\"backgroundArea$ | async\">\n <pry-icon\n iconSvg=\"loader\"\n class=\"no-widget__loading\"\n [alt]=\"'@pry.widget.target.loading' | i18n\"\n [width]=\"100\"\n [height]=\"100\"\n />\n <span class=\"no-widget__text\">{{ '@pry.widget.target.loading' | i18n }}...</span>\n </div>\n <ng-template #notLoading>\n <div class=\"no-widget\" [style.grid-area]=\"backgroundArea$ | async\">\n <img\n class=\"no-widget__search\"\n src=\"../../../assets/svgs/pry_recherche.svg\"\n alt=\"{{\n (layout === DashboardGridLayout.MANUAL\n ? '@pry.widget.target.none_manual'\n : '@pry.widget.target.none_auto'\n ) | i18n\n }} {{ backgroundArea$ | async }}\"\n />\n <span class=\"no-widget__text\">{{\n (layout === DashboardGridLayout.MANUAL\n ? '@pry.widget.target.none_manual'\n : '@pry.widget.target.none_auto'\n ) | i18n\n }}</span>\n </div>\n </ng-template>\n </ng-container>\n <div\n class=\"a-page-loader backdrop\"\n [style.display]=\"data.fetchLoading && !data.globalLoading ? 'flex' : 'none'\"\n [style.width.px]=\"params.gridWidth\"\n [style.height.px]=\"params.gridHeight\"\n >\n <pry-icon\n iconSvg=\"loader\"\n class=\"no-widget__loading\"\n [alt]=\"'@pry.widget.target.loading' | i18n\"\n [width]=\"200\"\n [height]=\"200\"\n />\n <p>{{ '@pry.widget.target.loading' | i18n }}...</p>\n </div>\n </ng-container>\n </ng-container>\n</div>\n<pry-context-menu></pry-context-menu>\n\n<ng-template #templateModal>\n <div class=\"o-modal\">\n <div class=\"o-modal__top\">\n <div class=\"o-modal__top__title\">\n <h2 class=\"a-h2\" id=\"dialog_title\">\n {{ '@pry.widget.modalTitle' | i18n }}\n </h2>\n </div>\n <div class=\"o-modal__top__close\">\n <button class=\"a-btn a-btn--icon-only\" (click)=\"cancelRemoveConfirm()\">\n <pry-icon iconSvg=\"close\" [height]=\"35\" [width]=\"35\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.toolbox.close' | i18n }}</span>\n </button>\n </div>\n </div>\n <div class=\"m-btn-group\">\n <button type=\"button\" (click)=\"cancelRemoveConfirm()\" class=\"a-btn a-btn--secondary\">\n {{ '@pry.toolbox.manifest.close' | i18n }}\n </button>\n <button type=\"submit\" (click)=\"confirmRemove()\" class=\"a-btn a-btn--primary\">\n {{ '@pry.toolbox.manifest.validate' | i18n }}\n </button>\n </div>\n </div>\n</ng-template>\n" }]
8891
8786
  }], ctorParameters: function () { return [{ type: i1.Store }, { type: i2.Overlay }, { type: i0.ViewContainerRef }]; }, propDecorators: { templateModal: [{
8892
8787
  type: ViewChild,
8893
8788
  args: ['templateModal', { read: TemplateRef }]
@@ -8900,9 +8795,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
8900
8795
  type: Input
8901
8796
  }], displayOptions: [{
8902
8797
  type: Input
8798
+ }], noBackground: [{
8799
+ type: Input
8903
8800
  }], gridRef: [{
8904
8801
  type: ViewChild,
8905
8802
  args: ['grid']
8803
+ }], breakpoint: [{
8804
+ type: Input
8906
8805
  }], rowHeight: [{
8907
8806
  type: Output
8908
8807
  }], rows: [{
@@ -10087,9 +9986,7 @@ class PryWidgetHeaderComponent extends SubscriptionnerDirective {
10087
9986
  }
10088
9987
  toggleChangeSpot() {
10089
9988
  if (!this.spotRef) {
10090
- this.places = WidgetPlacementUtils.placementOptions({ type: 'icon' }, this.currentLayout, {
10091
- ...this.windowManifest?.grid
10092
- });
9989
+ this.places = WidgetPlacementUtils.placementOptions({ type: 'icon' }, this.currentLayout);
10093
9990
  this.spotRef = this.overlay.create(new OverlayConfig({
10094
9991
  hasBackdrop: true,
10095
9992
  panelClass: ['o-modal-wrapper'],
@@ -11012,7 +10909,7 @@ class DashboardEffects {
11012
10909
  // Trying all placement options
11013
10910
  for (const actualRank of sequence) {
11014
10911
  const windowLayout = manifestGlobal.windows[actualRank].grid?.layout ?? DashboardGridLayout.FULL;
11015
- const options = WidgetPlacementUtils.placementOptions(newWidgetManifest, windowLayout, params);
10912
+ const options = WidgetPlacementUtils.placementOptions(newWidgetManifest, windowLayout);
11016
10913
  if (!found) {
11017
10914
  for (const option of options) {
11018
10915
  if (!found) {
@@ -11035,7 +10932,7 @@ class DashboardEffects {
11035
10932
  else {
11036
10933
  const currentWindowLayout = manifestGlobal.windows[rank].grid?.layout ?? DashboardGridLayout.FULL;
11037
10934
  // si non trouvé : nouvelle page, première position suggérée
11038
- const firstProposedLayout = WidgetPlacementUtils.placementOptions(newWidgetManifest, currentWindowLayout, params)[0];
10935
+ const firstProposedLayout = WidgetPlacementUtils.placementOptions(newWidgetManifest, currentWindowLayout)[0];
11039
10936
  manifestGlobal.windows.push({ widgets: [firstProposedLayout], grid: { layout: currentWindowLayout } });
11040
10937
  }
11041
10938
  if (action.alert === undefined || action.alert === true) {
@@ -11579,12 +11476,14 @@ const internalReducer = createReducer(dashboardInitialState, on(DashboardActions
11579
11476
  }
11580
11477
  newWindows[myRank].grid.layout = action.layout;
11581
11478
  if (action.layout !== DashboardGridLayout.MANUAL) {
11479
+ const layout = WidgetPlacementUtils.getLayout(action.layout);
11582
11480
  // Reorder layouts
11583
- const params = {
11584
- rows: newWindows[myRank].grid.rows,
11585
- columns: newWindows[myRank].grid.columns
11481
+ newWindows[myRank].grid = {
11482
+ ...newWindows[myRank].grid,
11483
+ rows: layout?.rows ?? DEFAULT_ROWS_NUMBER,
11484
+ columns: layout?.columns ?? DEFAULT_COLUMNS_NUMBER
11586
11485
  };
11587
- const places = WidgetPlacementUtils.placementOptions({}, action.layout, params);
11486
+ const places = WidgetPlacementUtils.placementOptions({}, action.layout);
11588
11487
  newWindows[myRank].widgets.forEach((widget, idx) => {
11589
11488
  let targetLayout = places[idx]?.layout;
11590
11489
  if (!targetLayout) {
@@ -11894,9 +11793,9 @@ const components = [
11894
11793
  DatasourceSelectorComponent
11895
11794
  ];
11896
11795
  class PryDashboardModule {
11897
- static forRoot(widgetReference, options, tooltipReference, filterReference, additionalGridImplementations = []) {
11898
- additionalGridImplementations.forEach((impl) => {
11899
- WidgetPlacementUtils.addLayoutImplementation(impl.type, impl.sizeImpl, impl.placementImpl, impl.image);
11796
+ static forRoot(widgetReference, options, tooltipReference, filterReference, additionalGridLayouts = []) {
11797
+ additionalGridLayouts.forEach((impl) => {
11798
+ WidgetPlacementUtils.addGridLayout(impl);
11900
11799
  });
11901
11800
  return {
11902
11801
  ngModule: PryDashboardModule,
@@ -11916,9 +11815,7 @@ class PryDashboardModule {
11916
11815
  ]
11917
11816
  };
11918
11817
  }
11919
- constructor(store) {
11920
- ProxyUtils.init(store);
11921
- }
11818
+ constructor(store) { }
11922
11819
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PryDashboardModule, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.NgModule }); }
11923
11820
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: PryDashboardModule, declarations: [DashboardComponent,
11924
11821
  WidgetInstanciatorComponent,