@provoly/dashboard 0.21.11 → 0.22.1
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.
- package/esm2022/dataset/components/dataset-detail/dataset-detail.component.mjs +1 -1
- package/esm2022/lib/core/model/automatic-grid-layout-definition.interface.mjs +2 -0
- package/esm2022/lib/core/model/manifest.interface.mjs +1 -1
- package/esm2022/lib/core/model/public-api.mjs +2 -1
- package/esm2022/lib/dashboard/components/dashboard.component.mjs +17 -11
- package/esm2022/lib/dashboard/components/widgets/header/widget-header.component.mjs +2 -4
- package/esm2022/lib/dashboard/components/widgets/widget-placement/widget-placement.utils.mjs +79 -125
- package/esm2022/lib/dashboard/dashboard.module.mjs +5 -8
- package/esm2022/lib/dashboard/store/dashboard.actions.mjs +1 -1
- package/esm2022/lib/dashboard/store/dashboard.effects.mjs +3 -3
- package/esm2022/lib/dashboard/store/dashboard.reducers.mjs +7 -5
- package/esm2022/lib/dashboard/store/dashboard.selectors.mjs +3 -4
- package/esm2022/presentation/components/add-edit-presentation/add-edit-presentation.component.mjs +4 -4
- package/esm2022/presentation/components/presentation.component.mjs +5 -6
- package/esm2022/search/search-home/search-home.component.mjs +1 -1
- package/esm2022/toolbox/components/select-grid-layout/select-grid-layout.component.mjs +6 -12
- package/esm2022/toolbox/style/css.component.mjs +2 -2
- package/fesm2022/provoly-dashboard-dataset.mjs +1 -1
- package/fesm2022/provoly-dashboard-dataset.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-presentation.mjs +7 -8
- package/fesm2022/provoly-dashboard-presentation.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-search.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-toolbox.mjs +7 -13
- package/fesm2022/provoly-dashboard-toolbox.mjs.map +1 -1
- package/fesm2022/provoly-dashboard.mjs +178 -288
- package/fesm2022/provoly-dashboard.mjs.map +1 -1
- package/lib/core/model/automatic-grid-layout-definition.interface.d.ts +9 -0
- package/lib/core/model/manifest.interface.d.ts +2 -2
- package/lib/core/model/public-api.d.ts +1 -0
- package/lib/dashboard/components/dashboard.component.d.ts +4 -3
- package/lib/dashboard/components/widgets/header/widget-header.component.d.ts +2 -2
- package/lib/dashboard/components/widgets/widget-placement/widget-placement.utils.d.ts +14 -30
- package/lib/dashboard/dashboard.module.d.ts +2 -7
- package/lib/dashboard/store/dashboard.actions.d.ts +3 -3
- package/lib/dashboard/store/dashboard.selectors.d.ts +2 -2
- package/package.json +37 -37
- package/presentation/components/add-edit-presentation/add-edit-presentation.component.d.ts +2 -2
- package/search/search-home/search-home.component.d.ts +1 -1
- package/styles/components/_a-page-loader.scss +2 -4
- package/styles-theme/components-theme/_a-page-loader.theme.scss +9 -0
- package/styles-theme/main-theme.scss +1 -0
- package/toolbox/components/select-grid-layout/select-grid-layout.component.d.ts +4 -8
- package/toolbox/style/_o-select-grid-layout.scss +6 -1
- package/esm2022/lib/dashboard/store/proxy.utils.mjs +0 -72
- 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$
|
|
4077
|
-
const manifests = createSelector(feature$
|
|
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$
|
|
4109
|
-
const resultSets = createSelector(results, (results) =>
|
|
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$
|
|
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$
|
|
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$
|
|
4146
|
-
const datasourceFilters = createSelector(feature$
|
|
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$
|
|
4155
|
-
const displayOptions = createSelector(feature$
|
|
4156
|
-
const capabilities = createSelector(feature$
|
|
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$
|
|
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$
|
|
4608
|
-
const opened = createSelector(feature$
|
|
4609
|
-
const position = createSelector(feature$
|
|
4610
|
-
const itemId = createSelector(feature$
|
|
4611
|
-
const from = createSelector(feature$
|
|
4612
|
-
const coordinates = createSelector(feature$
|
|
4613
|
-
const resultSet = createSelector(feature$
|
|
4614
|
-
const allowObjectCreation = createSelector(feature$
|
|
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$
|
|
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;
|
|
@@ -7482,11 +7413,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
7482
7413
|
|
|
7483
7414
|
const MIME_TYPE_RESULTSET = 'application/resultset';
|
|
7484
7415
|
|
|
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
7416
|
const arrayOf = (item, num) => {
|
|
7491
7417
|
return [...new Array(num)].map(() => item);
|
|
7492
7418
|
};
|
|
@@ -7502,143 +7428,98 @@ const createPlacedWidgetCopy = (widget, position) => {
|
|
|
7502
7428
|
return tmp;
|
|
7503
7429
|
};
|
|
7504
7430
|
const WidgetPlacementUtils = {
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7431
|
+
layouts: [
|
|
7432
|
+
{
|
|
7433
|
+
type: DashboardGridLayout.MANUAL,
|
|
7434
|
+
places: [],
|
|
7435
|
+
label: '@pry.toolbox.layout.0',
|
|
7436
|
+
description: '@pry.toolbox.layout.0_detailled',
|
|
7437
|
+
rows: 12,
|
|
7438
|
+
columns: 12
|
|
7510
7439
|
},
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
|
|
7440
|
+
{
|
|
7441
|
+
type: DashboardGridLayout.FULL,
|
|
7442
|
+
places: [{ x: 1, y: 1, width: 12, height: 12 }],
|
|
7443
|
+
label: '@pry.toolbox.layout.1',
|
|
7444
|
+
description: '@pry.toolbox.layout.1_detailled',
|
|
7445
|
+
rows: 12,
|
|
7446
|
+
columns: 12
|
|
7515
7447
|
},
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
|
|
7448
|
+
{
|
|
7449
|
+
type: DashboardGridLayout.HALF_HORIZONTAL,
|
|
7450
|
+
places: [
|
|
7451
|
+
{ x: 1, y: 1, width: 12, height: 6 },
|
|
7452
|
+
{ x: 1, y: 7, width: 12, height: 6 }
|
|
7453
|
+
],
|
|
7454
|
+
label: '@pry.toolbox.layout.1/2h',
|
|
7455
|
+
description: '@pry.toolbox.layout.1/2h_detailled',
|
|
7456
|
+
rows: 12,
|
|
7457
|
+
columns: 12
|
|
7520
7458
|
},
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7459
|
+
{
|
|
7460
|
+
type: DashboardGridLayout.HALF_VERTICAL,
|
|
7461
|
+
places: [
|
|
7462
|
+
{ x: 1, y: 1, width: 6, height: 12 },
|
|
7463
|
+
{ x: 7, y: 1, width: 6, height: 12 }
|
|
7464
|
+
],
|
|
7465
|
+
label: '@pry.toolbox.layout.1/2v',
|
|
7466
|
+
description: '@pry.toolbox.layout.1/2v_detailled',
|
|
7467
|
+
rows: 12,
|
|
7468
|
+
columns: 12
|
|
7525
7469
|
},
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7470
|
+
{
|
|
7471
|
+
type: DashboardGridLayout.THIRD_HORIZONTAL,
|
|
7472
|
+
places: [
|
|
7473
|
+
{ x: 1, y: 1, width: 12, height: 4 },
|
|
7474
|
+
{ x: 1, y: 5, width: 12, height: 4 },
|
|
7475
|
+
{ x: 1, y: 9, width: 12, height: 4 }
|
|
7476
|
+
],
|
|
7477
|
+
label: '@pry.toolbox.layout.1/3h',
|
|
7478
|
+
description: '@pry.toolbox.layout.1/3h_detailled',
|
|
7479
|
+
rows: 12,
|
|
7480
|
+
columns: 12
|
|
7530
7481
|
},
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7482
|
+
{
|
|
7483
|
+
type: DashboardGridLayout.THIRD_VERTICAL,
|
|
7484
|
+
places: [
|
|
7485
|
+
{ x: 1, y: 1, width: 4, height: 12 },
|
|
7486
|
+
{ x: 5, y: 1, width: 4, height: 12 },
|
|
7487
|
+
{ x: 9, y: 1, width: 4, height: 12 }
|
|
7488
|
+
],
|
|
7489
|
+
label: '@pry.toolbox.layout.1/3v',
|
|
7490
|
+
description: '@pry.toolbox.layout.1/3v_detailled',
|
|
7491
|
+
rows: 12,
|
|
7492
|
+
columns: 12
|
|
7535
7493
|
},
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
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
|
-
]
|
|
7494
|
+
{
|
|
7495
|
+
type: DashboardGridLayout.QUARTER,
|
|
7496
|
+
places: [
|
|
7497
|
+
{ x: 1, y: 1, width: 6, height: 6 },
|
|
7498
|
+
{ x: 1, y: 7, width: 6, height: 6 },
|
|
7499
|
+
{ x: 7, y: 1, width: 6, height: 6 },
|
|
7500
|
+
{ x: 7, y: 7, width: 6, height: 6 }
|
|
7501
|
+
],
|
|
7502
|
+
label: '@pry.toolbox.layout.1/4',
|
|
7503
|
+
description: '@pry.toolbox.layout.1/4_detailled',
|
|
7504
|
+
rows: 12,
|
|
7505
|
+
columns: 12
|
|
7506
|
+
}
|
|
7507
|
+
],
|
|
7508
|
+
addGridLayout(layout) {
|
|
7509
|
+
this.layouts.push(layout);
|
|
7606
7510
|
},
|
|
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';
|
|
7620
|
-
},
|
|
7621
|
-
getLayouts: () => Object.keys(WidgetPlacementUtils.placementOptionsImplementations).map((layout) => ({
|
|
7622
|
-
key: layout,
|
|
7623
|
-
image: WidgetPlacementUtils.layoutImages[layout]
|
|
7624
|
-
})),
|
|
7625
7511
|
isLeft: (w1, w2) => w2.layout.x + w2.layout.width <= w1.layout.x,
|
|
7626
7512
|
isBelow: (w1, w2) => w2.layout.y + w2.layout.height <= w1.layout.y,
|
|
7627
7513
|
areDisjoint: (w1, w2) => WidgetPlacementUtils.isLeft(w1, w2) ||
|
|
7628
7514
|
WidgetPlacementUtils.isLeft(w2, w1) ||
|
|
7629
7515
|
WidgetPlacementUtils.isBelow(w1, w2) ||
|
|
7630
7516
|
WidgetPlacementUtils.isBelow(w2, w1),
|
|
7631
|
-
placementOptions: (widgetToPlace, layout
|
|
7632
|
-
|
|
7517
|
+
placementOptions: (widgetToPlace, layout) => {
|
|
7518
|
+
const layoutO = WidgetPlacementUtils.getLayout(layout);
|
|
7519
|
+
if (!layoutO) {
|
|
7633
7520
|
return [];
|
|
7634
7521
|
}
|
|
7635
|
-
return
|
|
7636
|
-
},
|
|
7637
|
-
getLayoutSize(layout, params) {
|
|
7638
|
-
if (!WidgetPlacementUtils.layoutSizeImplementations[layout]) {
|
|
7639
|
-
return [];
|
|
7640
|
-
}
|
|
7641
|
-
return WidgetPlacementUtils.layoutSizeImplementations[layout]({ x: 1, y: 1, height: 1, width: 1 }, params);
|
|
7522
|
+
return layoutO.places.map((place) => ({ ...widgetToPlace, layout: place }));
|
|
7642
7523
|
},
|
|
7643
7524
|
swapArrayElements: (arr, x, y) => {
|
|
7644
7525
|
if (arr.length === 1)
|
|
@@ -7663,11 +7544,16 @@ const WidgetPlacementUtils = {
|
|
|
7663
7544
|
problems.sort((a, b) => a[0].layout.y * 100000 - b[0].layout.y * 100000 + a[0].layout.x - b[0].layout.y);
|
|
7664
7545
|
return problems;
|
|
7665
7546
|
},
|
|
7666
|
-
|
|
7667
|
-
return this.
|
|
7547
|
+
getLayout(layout) {
|
|
7548
|
+
return this.layouts.find((lay) => lay.type === layout);
|
|
7668
7549
|
}
|
|
7669
7550
|
};
|
|
7670
7551
|
|
|
7552
|
+
const DEFAULT_GAP_PX = 15;
|
|
7553
|
+
const DEFAULT_COLUMNS_NUMBER = 12;
|
|
7554
|
+
const DEFAULT_ROWS_NUMBER = 12;
|
|
7555
|
+
const DEFAULT_ROW_HEIGHT_PX = 50;
|
|
7556
|
+
|
|
7671
7557
|
function orderWidgetsAccordingToPlacement(a, b) {
|
|
7672
7558
|
return ((b.layout.weight ?? 0) * 1000000 -
|
|
7673
7559
|
(a.layout.weight ?? 0) * 1000000 +
|
|
@@ -8387,6 +8273,7 @@ class DashboardComponent extends SubscriptionnerDirective {
|
|
|
8387
8273
|
this.indexForRemoval = -1;
|
|
8388
8274
|
this.params = {};
|
|
8389
8275
|
this.CloseOnDragOut = true;
|
|
8276
|
+
this.noBackground = false;
|
|
8390
8277
|
this.canCalculateView = false;
|
|
8391
8278
|
this.dashboardParams = {
|
|
8392
8279
|
gridWidth: 1,
|
|
@@ -8428,8 +8315,8 @@ class DashboardComponent extends SubscriptionnerDirective {
|
|
|
8428
8315
|
const wManifest = JSON.parse(JSON.stringify(_wManifest));
|
|
8429
8316
|
if (wManifest.grid?.layout && wManifest.grid.layout !== DashboardGridLayout.MANUAL) {
|
|
8430
8317
|
// Complete with placeholders
|
|
8431
|
-
const size = WidgetPlacementUtils.
|
|
8432
|
-
const places = WidgetPlacementUtils.placementOptions({ type: 'filler', layout: { x: 1, y: 1, width: 1, height: 1 } }, wManifest.grid.layout
|
|
8318
|
+
const size = WidgetPlacementUtils.getLayout(wManifest.grid.layout)?.places.length ?? 0;
|
|
8319
|
+
const places = WidgetPlacementUtils.placementOptions({ type: 'filler', layout: { x: 1, y: 1, width: 1, height: 1 } }, wManifest.grid.layout);
|
|
8433
8320
|
let added = true;
|
|
8434
8321
|
while (wManifest.widgets.length < size && added) {
|
|
8435
8322
|
added = false;
|
|
@@ -8502,9 +8389,7 @@ class DashboardComponent extends SubscriptionnerDirective {
|
|
|
8502
8389
|
: `3/1/${(manifest.grid?.columns ?? DEFAULT_COLUMNS_NUMBER) - 1}/1`));
|
|
8503
8390
|
this.separators$ = this.store
|
|
8504
8391
|
.select(DashboardSelectors.gridLayout)
|
|
8505
|
-
.pipe(map$1((layout) => layout === DashboardGridLayout.MANUAL
|
|
8506
|
-
? []
|
|
8507
|
-
: WidgetPlacementUtils.getLayoutSize(layout, { rows: 1, columns: 1 })));
|
|
8392
|
+
.pipe(map$1((layout) => layout === DashboardGridLayout.MANUAL ? [] : WidgetPlacementUtils.getLayout(layout)?.places ?? []));
|
|
8508
8393
|
}
|
|
8509
8394
|
ngOnInit() {
|
|
8510
8395
|
if (this.displayOptions)
|
|
@@ -8563,7 +8448,7 @@ class DashboardComponent extends SubscriptionnerDirective {
|
|
|
8563
8448
|
return '1 / 1';
|
|
8564
8449
|
}
|
|
8565
8450
|
if (layout.width > 1) {
|
|
8566
|
-
return `${Math.min(layout.x, this.
|
|
8451
|
+
return `${Math.min(layout.x, this.params.columns - layout.width + 1)} / ${Math.min(layout.x + layout.width, this.params.columns + 1)}`;
|
|
8567
8452
|
}
|
|
8568
8453
|
else {
|
|
8569
8454
|
return `${layout.x}`;
|
|
@@ -8580,7 +8465,7 @@ class DashboardComponent extends SubscriptionnerDirective {
|
|
|
8580
8465
|
return `${previousHeight ?? 1} / ${(previousHeight ?? 1) + layout.height}`;
|
|
8581
8466
|
}
|
|
8582
8467
|
if (layout.height > 1) {
|
|
8583
|
-
return `${Math.max(1, Math.min(layout.y, this.
|
|
8468
|
+
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
8469
|
}
|
|
8585
8470
|
else {
|
|
8586
8471
|
return `${layout.y}`;
|
|
@@ -8677,7 +8562,10 @@ class DashboardComponent extends SubscriptionnerDirective {
|
|
|
8677
8562
|
}
|
|
8678
8563
|
else {
|
|
8679
8564
|
// Use grid size
|
|
8680
|
-
const layout = WidgetPlacementUtils.
|
|
8565
|
+
const layout = (WidgetPlacementUtils.getLayout(this.layout)?.places ?? [])[this.initialWidgetManifestList.length] ?? {
|
|
8566
|
+
width: 1,
|
|
8567
|
+
height: 1
|
|
8568
|
+
};
|
|
8681
8569
|
this.currentlyModifiedManifest.layout.width = layout.width;
|
|
8682
8570
|
this.currentlyModifiedManifest.layout.height = layout.height;
|
|
8683
8571
|
}
|
|
@@ -8883,11 +8771,11 @@ class DashboardComponent extends SubscriptionnerDirective {
|
|
|
8883
8771
|
return index + '-' + widgetManifest.type + '-' + JSON.stringify(widgetManifest.layout);
|
|
8884
8772
|
}
|
|
8885
8773
|
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
|
|
8774
|
+
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
8775
|
}
|
|
8888
8776
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DashboardComponent, decorators: [{
|
|
8889
8777
|
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
|
|
8778
|
+
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
8779
|
}], ctorParameters: function () { return [{ type: i1.Store }, { type: i2.Overlay }, { type: i0.ViewContainerRef }]; }, propDecorators: { templateModal: [{
|
|
8892
8780
|
type: ViewChild,
|
|
8893
8781
|
args: ['templateModal', { read: TemplateRef }]
|
|
@@ -8900,9 +8788,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
8900
8788
|
type: Input
|
|
8901
8789
|
}], displayOptions: [{
|
|
8902
8790
|
type: Input
|
|
8791
|
+
}], noBackground: [{
|
|
8792
|
+
type: Input
|
|
8903
8793
|
}], gridRef: [{
|
|
8904
8794
|
type: ViewChild,
|
|
8905
8795
|
args: ['grid']
|
|
8796
|
+
}], breakpoint: [{
|
|
8797
|
+
type: Input
|
|
8906
8798
|
}], rowHeight: [{
|
|
8907
8799
|
type: Output
|
|
8908
8800
|
}], rows: [{
|
|
@@ -10087,9 +9979,7 @@ class PryWidgetHeaderComponent extends SubscriptionnerDirective {
|
|
|
10087
9979
|
}
|
|
10088
9980
|
toggleChangeSpot() {
|
|
10089
9981
|
if (!this.spotRef) {
|
|
10090
|
-
this.places = WidgetPlacementUtils.placementOptions({ type: 'icon' }, this.currentLayout
|
|
10091
|
-
...this.windowManifest?.grid
|
|
10092
|
-
});
|
|
9982
|
+
this.places = WidgetPlacementUtils.placementOptions({ type: 'icon' }, this.currentLayout);
|
|
10093
9983
|
this.spotRef = this.overlay.create(new OverlayConfig({
|
|
10094
9984
|
hasBackdrop: true,
|
|
10095
9985
|
panelClass: ['o-modal-wrapper'],
|
|
@@ -11012,7 +10902,7 @@ class DashboardEffects {
|
|
|
11012
10902
|
// Trying all placement options
|
|
11013
10903
|
for (const actualRank of sequence) {
|
|
11014
10904
|
const windowLayout = manifestGlobal.windows[actualRank].grid?.layout ?? DashboardGridLayout.FULL;
|
|
11015
|
-
const options = WidgetPlacementUtils.placementOptions(newWidgetManifest, windowLayout
|
|
10905
|
+
const options = WidgetPlacementUtils.placementOptions(newWidgetManifest, windowLayout);
|
|
11016
10906
|
if (!found) {
|
|
11017
10907
|
for (const option of options) {
|
|
11018
10908
|
if (!found) {
|
|
@@ -11035,7 +10925,7 @@ class DashboardEffects {
|
|
|
11035
10925
|
else {
|
|
11036
10926
|
const currentWindowLayout = manifestGlobal.windows[rank].grid?.layout ?? DashboardGridLayout.FULL;
|
|
11037
10927
|
// si non trouvé : nouvelle page, première position suggérée
|
|
11038
|
-
const firstProposedLayout = WidgetPlacementUtils.placementOptions(newWidgetManifest, currentWindowLayout
|
|
10928
|
+
const firstProposedLayout = WidgetPlacementUtils.placementOptions(newWidgetManifest, currentWindowLayout)[0];
|
|
11039
10929
|
manifestGlobal.windows.push({ widgets: [firstProposedLayout], grid: { layout: currentWindowLayout } });
|
|
11040
10930
|
}
|
|
11041
10931
|
if (action.alert === undefined || action.alert === true) {
|
|
@@ -11579,12 +11469,14 @@ const internalReducer = createReducer(dashboardInitialState, on(DashboardActions
|
|
|
11579
11469
|
}
|
|
11580
11470
|
newWindows[myRank].grid.layout = action.layout;
|
|
11581
11471
|
if (action.layout !== DashboardGridLayout.MANUAL) {
|
|
11472
|
+
const layout = WidgetPlacementUtils.getLayout(action.layout);
|
|
11582
11473
|
// Reorder layouts
|
|
11583
|
-
|
|
11584
|
-
|
|
11585
|
-
|
|
11474
|
+
newWindows[myRank].grid = {
|
|
11475
|
+
...newWindows[myRank].grid,
|
|
11476
|
+
rows: layout?.rows ?? DEFAULT_ROWS_NUMBER,
|
|
11477
|
+
columns: layout?.columns ?? DEFAULT_COLUMNS_NUMBER
|
|
11586
11478
|
};
|
|
11587
|
-
const places = WidgetPlacementUtils.placementOptions({}, action.layout
|
|
11479
|
+
const places = WidgetPlacementUtils.placementOptions({}, action.layout);
|
|
11588
11480
|
newWindows[myRank].widgets.forEach((widget, idx) => {
|
|
11589
11481
|
let targetLayout = places[idx]?.layout;
|
|
11590
11482
|
if (!targetLayout) {
|
|
@@ -11894,9 +11786,9 @@ const components = [
|
|
|
11894
11786
|
DatasourceSelectorComponent
|
|
11895
11787
|
];
|
|
11896
11788
|
class PryDashboardModule {
|
|
11897
|
-
static forRoot(widgetReference, options, tooltipReference, filterReference,
|
|
11898
|
-
|
|
11899
|
-
WidgetPlacementUtils.
|
|
11789
|
+
static forRoot(widgetReference, options, tooltipReference, filterReference, additionalGridLayouts = []) {
|
|
11790
|
+
additionalGridLayouts.forEach((impl) => {
|
|
11791
|
+
WidgetPlacementUtils.addGridLayout(impl);
|
|
11900
11792
|
});
|
|
11901
11793
|
return {
|
|
11902
11794
|
ngModule: PryDashboardModule,
|
|
@@ -11916,9 +11808,7 @@ class PryDashboardModule {
|
|
|
11916
11808
|
]
|
|
11917
11809
|
};
|
|
11918
11810
|
}
|
|
11919
|
-
constructor(store) {
|
|
11920
|
-
ProxyUtils.init(store);
|
|
11921
|
-
}
|
|
11811
|
+
constructor(store) { }
|
|
11922
11812
|
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
11813
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: PryDashboardModule, declarations: [DashboardComponent,
|
|
11924
11814
|
WidgetInstanciatorComponent,
|