tango-app-ui-shared 3.5.0-alpha.2 → 3.5.0-alpha.3
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/lib/modules/layout/toolbar/metrics-header/metrics-header.component.mjs +298 -208
- package/esm2022/lib/modules/layout/toolbar/single-storedate/single-storedate.component.mjs +10 -11
- package/fesm2022/tango-app-ui-shared.mjs +306 -217
- package/fesm2022/tango-app-ui-shared.mjs.map +1 -1
- package/lib/modules/layout/toolbar/metrics-header/metrics-header.component.d.ts +2 -2
- package/package.json +1 -1
|
@@ -5251,6 +5251,11 @@ class SingleStoredateComponent {
|
|
|
5251
5251
|
this.selectedFilters.clientName = headerFilters.clientName || "";
|
|
5252
5252
|
this.selectedFilters.store = this.dataUser?.storeId ?? headerFilters.store ?? "";
|
|
5253
5253
|
this.selectedFilters.storeName = headerFilters.storeName || "";
|
|
5254
|
+
this.selectedFilters.group = headerFilters.group;
|
|
5255
|
+
this.selectedFilters.location = headerFilters.location;
|
|
5256
|
+
this.selectedFilters.country = headerFilters.country;
|
|
5257
|
+
this.selectedFilters.stores = headerFilters.stores ?? "";
|
|
5258
|
+
this.selectedFilters.zoneName = headerFilters.zoneName ?? "";
|
|
5254
5259
|
// ✅ Handle query param date if present
|
|
5255
5260
|
if (this.dataUser?.date) {
|
|
5256
5261
|
const date = this.dataUser.date;
|
|
@@ -5317,19 +5322,13 @@ class SingleStoredateComponent {
|
|
|
5317
5322
|
const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
|
|
5318
5323
|
this.selectedFilters.date = headerFilters.date;
|
|
5319
5324
|
}
|
|
5320
|
-
|
|
5321
|
-
this.selectedFilters.date.startDate = this.dataUser.date;
|
|
5322
|
-
this.selectedFilters.date.endDate = this.dataUser.date;
|
|
5323
|
-
}
|
|
5324
|
-
else {
|
|
5325
|
-
this.selectedFilters.date = this.selectedFilters.date;
|
|
5326
|
-
}
|
|
5327
|
-
const clientId = this.users?.clientId ?? this.dataUser?.client ?? '';
|
|
5325
|
+
const clientId = this.users?.clientId ?? this.dataUser?.client ?? this.selectedFilters.client;
|
|
5328
5326
|
this.selectedFilters.client = clientId;
|
|
5329
|
-
this.selectedFilters.clients = clientId ? [clientId] : [];
|
|
5327
|
+
this.selectedFilters.clients = clientId ? [clientId] : [this.selectedFilters.client];
|
|
5328
|
+
this.selectedFilters.date = this.selectedFilters.date;
|
|
5330
5329
|
this.selectedFilters.storeName = this.selectedFilters.storeName || '';
|
|
5331
|
-
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
5332
5330
|
this.gs.dataRangeValue.next(this.selectedFilters);
|
|
5331
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
5333
5332
|
this.cd.detectChanges();
|
|
5334
5333
|
}
|
|
5335
5334
|
Apply() {
|
|
@@ -6861,8 +6860,10 @@ class MetricsHeaderComponent {
|
|
|
6861
6860
|
const isValidDate = m > this.dayjs();
|
|
6862
6861
|
return isValidDate ? "invalid-date" : false;
|
|
6863
6862
|
};
|
|
6864
|
-
selectedDateRange = {
|
|
6865
|
-
|
|
6863
|
+
selectedDateRange = {
|
|
6864
|
+
startDate: dayjs().subtract(30, "days"),
|
|
6865
|
+
endDate: dayjs().subtract(1, "days"),
|
|
6866
|
+
};
|
|
6866
6867
|
selectedFilters = {
|
|
6867
6868
|
client: null,
|
|
6868
6869
|
clientName: null,
|
|
@@ -6873,7 +6874,7 @@ class MetricsHeaderComponent {
|
|
|
6873
6874
|
group: [],
|
|
6874
6875
|
location: [],
|
|
6875
6876
|
country: [],
|
|
6876
|
-
zoneName: []
|
|
6877
|
+
zoneName: [],
|
|
6877
6878
|
};
|
|
6878
6879
|
Opendropdown = false;
|
|
6879
6880
|
dropdownOpen = null; // 'location' or 'group'
|
|
@@ -6887,8 +6888,8 @@ class MetricsHeaderComponent {
|
|
|
6887
6888
|
filteredZones = [];
|
|
6888
6889
|
stores = [];
|
|
6889
6890
|
zones = [];
|
|
6890
|
-
searchStoreText =
|
|
6891
|
-
searchZoneText =
|
|
6891
|
+
searchStoreText = "";
|
|
6892
|
+
searchZoneText = "";
|
|
6892
6893
|
clientList = [];
|
|
6893
6894
|
selectedClient;
|
|
6894
6895
|
locationLabel = [];
|
|
@@ -6907,7 +6908,7 @@ class MetricsHeaderComponent {
|
|
|
6907
6908
|
}
|
|
6908
6909
|
onClick(event) {
|
|
6909
6910
|
const target = event.target;
|
|
6910
|
-
if (!target.closest(
|
|
6911
|
+
if (!target.closest(".dropdown2")) {
|
|
6911
6912
|
this.Opendropdown = false;
|
|
6912
6913
|
}
|
|
6913
6914
|
}
|
|
@@ -6922,12 +6923,12 @@ class MetricsHeaderComponent {
|
|
|
6922
6923
|
// this.setRangesBasedOnRoute();
|
|
6923
6924
|
// }
|
|
6924
6925
|
// });
|
|
6925
|
-
this.url = this.router.url.split("?")[0].split(
|
|
6926
|
-
const user = JSON.parse(localStorage.getItem(
|
|
6926
|
+
this.url = this.router.url.split("?")[0].split("/");
|
|
6927
|
+
const user = JSON.parse(localStorage.getItem("user-info"));
|
|
6927
6928
|
this.users = user;
|
|
6928
6929
|
this.gs?.manageRefreshTrigger?.subscribe((e) => {
|
|
6929
6930
|
if (e) {
|
|
6930
|
-
if (user.userType ===
|
|
6931
|
+
if (user.userType === "tango") {
|
|
6931
6932
|
this.getClient();
|
|
6932
6933
|
}
|
|
6933
6934
|
else {
|
|
@@ -6936,18 +6937,18 @@ class MetricsHeaderComponent {
|
|
|
6936
6937
|
const headerFilters = JSON.parse(storedFilters);
|
|
6937
6938
|
this.filteredStores = headerFilters?.stores.map((store) => ({
|
|
6938
6939
|
...store,
|
|
6939
|
-
checked: store.checked
|
|
6940
|
+
checked: store.checked,
|
|
6940
6941
|
}));
|
|
6941
6942
|
this.filteredZones = headerFilters?.zoneName.map((store) => ({
|
|
6942
6943
|
...store,
|
|
6943
|
-
checked: store.checked
|
|
6944
|
+
checked: store.checked,
|
|
6944
6945
|
}));
|
|
6945
6946
|
}
|
|
6946
6947
|
}
|
|
6947
6948
|
}
|
|
6948
6949
|
});
|
|
6949
6950
|
// Fetch client data if the user is of type 'tango'
|
|
6950
|
-
if (user.userType ===
|
|
6951
|
+
if (user.userType === "tango") {
|
|
6951
6952
|
this.getClient();
|
|
6952
6953
|
}
|
|
6953
6954
|
else {
|
|
@@ -6959,7 +6960,7 @@ class MetricsHeaderComponent {
|
|
|
6959
6960
|
if (clientFilters) {
|
|
6960
6961
|
const headerclientFilters = JSON.parse(clientFilters);
|
|
6961
6962
|
this.selectedClient = {
|
|
6962
|
-
trafficDateRange: headerclientFilters.trafficDateRange
|
|
6963
|
+
trafficDateRange: headerclientFilters.trafficDateRange,
|
|
6963
6964
|
};
|
|
6964
6965
|
}
|
|
6965
6966
|
}
|
|
@@ -6970,7 +6971,7 @@ class MetricsHeaderComponent {
|
|
|
6970
6971
|
// Initialize selectedFilters with defaults or existing values
|
|
6971
6972
|
this.selectedFilters = {
|
|
6972
6973
|
client: headerFilters.client || this.users.client,
|
|
6973
|
-
clientName: headerFilters.clientName ||
|
|
6974
|
+
clientName: headerFilters.clientName || "",
|
|
6974
6975
|
clients: headerFilters.clients || [],
|
|
6975
6976
|
store: headerFilters.store || null,
|
|
6976
6977
|
date: headerFilters.date || {},
|
|
@@ -7013,7 +7014,7 @@ class MetricsHeaderComponent {
|
|
|
7013
7014
|
return items
|
|
7014
7015
|
? items.map((item) => ({
|
|
7015
7016
|
...item,
|
|
7016
|
-
checked: item.checked === true
|
|
7017
|
+
checked: item.checked === true,
|
|
7017
7018
|
}))
|
|
7018
7019
|
: [];
|
|
7019
7020
|
}
|
|
@@ -7028,7 +7029,7 @@ class MetricsHeaderComponent {
|
|
|
7028
7029
|
resetFilters() {
|
|
7029
7030
|
this.selectedFilters = {
|
|
7030
7031
|
client: null,
|
|
7031
|
-
clientName:
|
|
7032
|
+
clientName: "",
|
|
7032
7033
|
clients: [],
|
|
7033
7034
|
store: null,
|
|
7034
7035
|
date: {},
|
|
@@ -7036,7 +7037,7 @@ class MetricsHeaderComponent {
|
|
|
7036
7037
|
group: [],
|
|
7037
7038
|
location: [],
|
|
7038
7039
|
country: [],
|
|
7039
|
-
zoneName: []
|
|
7040
|
+
zoneName: [],
|
|
7040
7041
|
};
|
|
7041
7042
|
this.filteredLocations = [];
|
|
7042
7043
|
this.filteredGroups = [];
|
|
@@ -7135,13 +7136,13 @@ class MetricsHeaderComponent {
|
|
|
7135
7136
|
}
|
|
7136
7137
|
getUserInfo(client) {
|
|
7137
7138
|
let obj = {
|
|
7138
|
-
clientId: client ? client :
|
|
7139
|
+
clientId: client ? client : "",
|
|
7139
7140
|
};
|
|
7140
7141
|
if (client) {
|
|
7141
7142
|
this.auth.getHeaderUsers(obj).subscribe({
|
|
7142
7143
|
next: (e) => {
|
|
7143
7144
|
localStorage.setItem("usersEmail-info", JSON.stringify(e?.data?.userEmailData || []));
|
|
7144
|
-
}
|
|
7145
|
+
},
|
|
7145
7146
|
});
|
|
7146
7147
|
}
|
|
7147
7148
|
}
|
|
@@ -7174,7 +7175,7 @@ class MetricsHeaderComponent {
|
|
|
7174
7175
|
this.getStore();
|
|
7175
7176
|
this.getGroups();
|
|
7176
7177
|
// Update localStorage with the new client selection and empty filter data
|
|
7177
|
-
localStorage.setItem(
|
|
7178
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
7178
7179
|
window.location.reload();
|
|
7179
7180
|
// Emit data to the global service
|
|
7180
7181
|
// this.gs.dataRangeValue.next(this.selectedFilters);
|
|
@@ -7183,16 +7184,16 @@ class MetricsHeaderComponent {
|
|
|
7183
7184
|
}
|
|
7184
7185
|
ranges = {
|
|
7185
7186
|
Today: [dayjs(), dayjs()],
|
|
7186
|
-
Yesterday: [dayjs().subtract(1,
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
dayjs().subtract(14,
|
|
7190
|
-
dayjs().subtract(8,
|
|
7187
|
+
Yesterday: [dayjs().subtract(1, "days"), dayjs().subtract(1, "days")],
|
|
7188
|
+
"This Week": [dayjs().subtract(7, "days"), dayjs().subtract(1, "days")],
|
|
7189
|
+
"Last Week": [
|
|
7190
|
+
dayjs().subtract(14, "days").startOf("day"),
|
|
7191
|
+
dayjs().subtract(8, "days").endOf("day"),
|
|
7191
7192
|
],
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
dayjs().subtract(1,
|
|
7195
|
-
dayjs().subtract(1,
|
|
7193
|
+
"This Month": [dayjs().subtract(30, "days"), dayjs().subtract(1, "days")],
|
|
7194
|
+
"Last Month": [
|
|
7195
|
+
dayjs().subtract(1, "month").startOf("month"),
|
|
7196
|
+
dayjs().subtract(1, "month").endOf("month"),
|
|
7196
7197
|
],
|
|
7197
7198
|
};
|
|
7198
7199
|
onStartDateChange(event) {
|
|
@@ -7205,7 +7206,8 @@ class MetricsHeaderComponent {
|
|
|
7205
7206
|
}
|
|
7206
7207
|
else {
|
|
7207
7208
|
this.isCustomDate = (m) => {
|
|
7208
|
-
const isValidDate = m > this.dayjs() ||
|
|
7209
|
+
const isValidDate = m > this.dayjs() ||
|
|
7210
|
+
m > this.dayjs(event.startDate.add(180, "days"));
|
|
7209
7211
|
return isValidDate ? "invalid-date" : false;
|
|
7210
7212
|
};
|
|
7211
7213
|
}
|
|
@@ -7234,18 +7236,22 @@ class MetricsHeaderComponent {
|
|
|
7234
7236
|
}
|
|
7235
7237
|
getLocations() {
|
|
7236
7238
|
const country = this.countries
|
|
7237
|
-
.filter(country => country.checked)
|
|
7238
|
-
.map(country => country.country);
|
|
7239
|
+
.filter((country) => country.checked)
|
|
7240
|
+
.map((country) => country.country);
|
|
7239
7241
|
// const headerFilters: any = JSON.parse(localStorage.getItem("header-filters") || "{}");
|
|
7240
7242
|
let obj = {
|
|
7241
|
-
clientId: this.selectedFilters.client
|
|
7243
|
+
clientId: this.selectedFilters.client
|
|
7244
|
+
? this.selectedFilters.client
|
|
7245
|
+
: this.users.clientId,
|
|
7242
7246
|
country,
|
|
7243
7247
|
city: [],
|
|
7244
7248
|
group: [],
|
|
7245
7249
|
};
|
|
7246
7250
|
this.auth.getLocation(obj).subscribe({
|
|
7247
7251
|
next: (res) => {
|
|
7248
|
-
let cityList = this.selectedFilters?.location
|
|
7252
|
+
let cityList = this.selectedFilters?.location
|
|
7253
|
+
?.filter((location) => location.checked)
|
|
7254
|
+
.map((loc) => loc.city);
|
|
7249
7255
|
// Map the fetched locations with default unchecked state
|
|
7250
7256
|
this.locations = res?.data?.locationData.map((city) => ({
|
|
7251
7257
|
city: city.city,
|
|
@@ -7253,19 +7259,26 @@ class MetricsHeaderComponent {
|
|
|
7253
7259
|
checked: cityList?.includes(city.city) ? true : false,
|
|
7254
7260
|
}));
|
|
7255
7261
|
// Sync the fetched locations with any stored checked values in localStorage
|
|
7256
|
-
if (this.selectedFilters.location &&
|
|
7257
|
-
|
|
7262
|
+
if (this.selectedFilters.location &&
|
|
7263
|
+
Array.isArray(this.selectedFilters.location)) {
|
|
7264
|
+
this.filteredLocations = this.locations.map((location) => {
|
|
7258
7265
|
const matchedLocation = this.selectedFilters.location.find((loc) => loc.city === location.city);
|
|
7259
|
-
return matchedLocation
|
|
7266
|
+
return matchedLocation
|
|
7267
|
+
? { ...location, checked: matchedLocation.checked }
|
|
7268
|
+
: location;
|
|
7260
7269
|
});
|
|
7261
7270
|
}
|
|
7262
7271
|
else {
|
|
7263
7272
|
this.filteredLocations = this.locations;
|
|
7264
7273
|
}
|
|
7265
7274
|
if (this.searchLocationText) {
|
|
7266
|
-
this.filteredLocations = this.locations.filter((location) => location.city
|
|
7275
|
+
this.filteredLocations = this.locations.filter((location) => location.city
|
|
7276
|
+
.toLowerCase()
|
|
7277
|
+
.includes(this.searchLocationText.toLowerCase()));
|
|
7267
7278
|
}
|
|
7268
|
-
const selectedLocations = this.locations
|
|
7279
|
+
const selectedLocations = this.locations
|
|
7280
|
+
.filter((location) => location.checked)
|
|
7281
|
+
.map((location) => location.city);
|
|
7269
7282
|
if (selectedLocations.length > 0) {
|
|
7270
7283
|
setTimeout(() => {
|
|
7271
7284
|
this.getGroups();
|
|
@@ -7282,36 +7295,50 @@ class MetricsHeaderComponent {
|
|
|
7282
7295
|
});
|
|
7283
7296
|
}
|
|
7284
7297
|
isAllLocationsSelected() {
|
|
7285
|
-
return this.filteredLocations.every(location => location.checked);
|
|
7298
|
+
return this.filteredLocations.every((location) => location.checked);
|
|
7286
7299
|
}
|
|
7287
7300
|
selectedLocationsLabel() {
|
|
7288
|
-
const selectedLocations = this.locationLabel = this.searchLocationText
|
|
7289
|
-
.
|
|
7290
|
-
|
|
7301
|
+
const selectedLocations = (this.locationLabel = this.searchLocationText
|
|
7302
|
+
.length
|
|
7303
|
+
? this.locations
|
|
7304
|
+
.filter((location) => location.checked)
|
|
7305
|
+
.map((location) => location.city)
|
|
7306
|
+
: this.filteredLocations
|
|
7307
|
+
.filter((location) => location.checked)
|
|
7308
|
+
.map((location) => location.city));
|
|
7291
7309
|
return selectedLocations.length === 0
|
|
7292
|
-
?
|
|
7310
|
+
? ""
|
|
7293
7311
|
: selectedLocations.length === 1
|
|
7294
7312
|
? selectedLocations[0]
|
|
7295
|
-
: `${selectedLocations.length}
|
|
7313
|
+
: `${selectedLocations.length} Region`;
|
|
7296
7314
|
}
|
|
7297
7315
|
removeLocation() {
|
|
7298
7316
|
this.Reset();
|
|
7299
7317
|
}
|
|
7300
7318
|
getGroups() {
|
|
7301
7319
|
const country = this.countries
|
|
7302
|
-
.filter(country => country.checked)
|
|
7303
|
-
.map(country => country.country);
|
|
7320
|
+
.filter((country) => country.checked)
|
|
7321
|
+
.map((country) => country.country);
|
|
7304
7322
|
let city;
|
|
7305
7323
|
city = this.locations
|
|
7306
|
-
.filter(location => location.checked)
|
|
7307
|
-
.map(location => location.city);
|
|
7324
|
+
.filter((location) => location.checked)
|
|
7325
|
+
.map((location) => location.city);
|
|
7308
7326
|
if (!city.length && country.length) {
|
|
7309
7327
|
city = this.locations.map((loc) => loc.city);
|
|
7310
7328
|
}
|
|
7311
|
-
const obj = {
|
|
7329
|
+
const obj = {
|
|
7330
|
+
country,
|
|
7331
|
+
city,
|
|
7332
|
+
clientId: this.selectedFilters.client
|
|
7333
|
+
? this.selectedFilters.client
|
|
7334
|
+
: this.users.clientId,
|
|
7335
|
+
group: [],
|
|
7336
|
+
};
|
|
7312
7337
|
this.auth.getGroups(obj).subscribe({
|
|
7313
7338
|
next: (res) => {
|
|
7314
|
-
let checkedGroup = this.selectedFilters?.group
|
|
7339
|
+
let checkedGroup = this.selectedFilters?.group
|
|
7340
|
+
?.filter((group) => group.checked)
|
|
7341
|
+
.map((group) => group.groupName);
|
|
7315
7342
|
const combinedGroups = res?.data?.groupData?.map((groupName) => ({
|
|
7316
7343
|
groupName: groupName.groupName,
|
|
7317
7344
|
checked: checkedGroup?.includes(groupName.groupName) ? true : false,
|
|
@@ -7325,7 +7352,9 @@ class MetricsHeaderComponent {
|
|
|
7325
7352
|
this.filteredGroups = combinedGroups;
|
|
7326
7353
|
}
|
|
7327
7354
|
// Auto-fetch stores when groups are selected
|
|
7328
|
-
const selectedGroups = this.groupsData
|
|
7355
|
+
const selectedGroups = this.groupsData
|
|
7356
|
+
.filter((group) => group.checked)
|
|
7357
|
+
.map((group) => group.groupName);
|
|
7329
7358
|
if (selectedGroups.length > 0) {
|
|
7330
7359
|
setTimeout(() => {
|
|
7331
7360
|
this.getStore(); // Fetch stores based on selected groups
|
|
@@ -7345,51 +7374,57 @@ class MetricsHeaderComponent {
|
|
|
7345
7374
|
else {
|
|
7346
7375
|
// Open the specific dropdown and handle data fetching only if necessary
|
|
7347
7376
|
this.dropdownOpen = type;
|
|
7348
|
-
if (type ===
|
|
7377
|
+
if (type === "country") {
|
|
7349
7378
|
// Fetch countries only if not already fetched and no search text exists
|
|
7350
|
-
if ((!this.filteredCountries || this.filteredCountries.length === 0) &&
|
|
7379
|
+
if ((!this.filteredCountries || this.filteredCountries.length === 0) &&
|
|
7380
|
+
!this.searchCountryText.trim()) {
|
|
7351
7381
|
this.getCountry();
|
|
7352
7382
|
}
|
|
7353
7383
|
}
|
|
7354
|
-
if (type ===
|
|
7384
|
+
if (type === "group") {
|
|
7355
7385
|
// Fetch groups only if there are selected cities and no active search text
|
|
7356
7386
|
const selectedCities = this.locations
|
|
7357
7387
|
.filter((location) => location.checked)
|
|
7358
7388
|
.map((location) => location.city);
|
|
7359
7389
|
// Fetch groups only if locations are selected, no search text exists, and dropdown is opened
|
|
7360
|
-
if (this.filteredLocations.length > 0 ||
|
|
7390
|
+
if (this.filteredLocations.length > 0 ||
|
|
7391
|
+
(selectedCities.length > 0 && !this.searchGroupText.trim())) {
|
|
7361
7392
|
this.getGroups();
|
|
7362
7393
|
}
|
|
7363
7394
|
else {
|
|
7364
7395
|
this.filteredGroups = []; // Clear groups if no locations are selected
|
|
7365
7396
|
}
|
|
7366
7397
|
}
|
|
7367
|
-
if (type ===
|
|
7398
|
+
if (type === "store") {
|
|
7368
7399
|
// Fetch stores only if not already fetched and no search text is active
|
|
7369
|
-
if ((!this.filteredStores || this.filteredStores.length === 0) &&
|
|
7400
|
+
if ((!this.filteredStores || this.filteredStores.length === 0) &&
|
|
7401
|
+
!this.searchStoreText.trim()) {
|
|
7370
7402
|
this.getStore();
|
|
7371
7403
|
}
|
|
7372
7404
|
}
|
|
7373
|
-
if (type ===
|
|
7405
|
+
if (type === "zone") {
|
|
7374
7406
|
// Fetch stores only if not already fetched and no search text is active
|
|
7375
|
-
if ((!this.filteredZones || this.filteredZones.length === 0) &&
|
|
7407
|
+
if ((!this.filteredZones || this.filteredZones.length === 0) &&
|
|
7408
|
+
!this.searchZoneText.trim()) {
|
|
7376
7409
|
this.getZone();
|
|
7377
7410
|
}
|
|
7378
7411
|
}
|
|
7379
7412
|
}
|
|
7380
7413
|
}
|
|
7381
7414
|
handleGroupDropdownClick() {
|
|
7382
|
-
if (this.dropdownOpen ===
|
|
7415
|
+
if (this.dropdownOpen === "group") {
|
|
7383
7416
|
this.resetSelectedGroups();
|
|
7384
7417
|
}
|
|
7385
|
-
this.toggleDropdown(
|
|
7418
|
+
this.toggleDropdown("group");
|
|
7386
7419
|
}
|
|
7387
7420
|
resetSelectedGroups() {
|
|
7388
7421
|
this.filteredGroups.forEach((group) => (group.checked = false));
|
|
7389
7422
|
this.searchGroupText = "";
|
|
7390
7423
|
}
|
|
7391
7424
|
selectedGroupsLabel() {
|
|
7392
|
-
const selectedGroups = this.groupLabel = this.searchGroupText.length
|
|
7425
|
+
const selectedGroups = (this.groupLabel = this.searchGroupText.length
|
|
7426
|
+
? this.groupsData.filter((group) => group.checked)
|
|
7427
|
+
: this.filteredGroups.filter((group) => group.checked));
|
|
7393
7428
|
return selectedGroups.length === 0
|
|
7394
7429
|
? ""
|
|
7395
7430
|
: selectedGroups.length === 1
|
|
@@ -7400,23 +7435,25 @@ class MetricsHeaderComponent {
|
|
|
7400
7435
|
this.Reset();
|
|
7401
7436
|
}
|
|
7402
7437
|
isAllGroupsSelected() {
|
|
7403
|
-
return this.filteredGroups.length
|
|
7438
|
+
return this.filteredGroups.length
|
|
7439
|
+
? this.filteredGroups.every((group) => group.checked)
|
|
7440
|
+
: false;
|
|
7404
7441
|
}
|
|
7405
7442
|
getStore() {
|
|
7406
7443
|
const country = this.countries
|
|
7407
|
-
.filter(country => country.checked)
|
|
7408
|
-
.map(country => country.country);
|
|
7444
|
+
.filter((country) => country.checked)
|
|
7445
|
+
.map((country) => country.country);
|
|
7409
7446
|
const city = this.locations
|
|
7410
|
-
.filter(location => location.checked)
|
|
7411
|
-
.map(location => location.city);
|
|
7447
|
+
.filter((location) => location.checked)
|
|
7448
|
+
.map((location) => location.city);
|
|
7412
7449
|
const group = this.groupsData
|
|
7413
|
-
.filter(group => group.checked)
|
|
7414
|
-
.map(group => group.groupName);
|
|
7450
|
+
.filter((group) => group.checked)
|
|
7451
|
+
.map((group) => group.groupName);
|
|
7415
7452
|
const data = {
|
|
7416
7453
|
country,
|
|
7417
7454
|
city,
|
|
7418
7455
|
clusters: group,
|
|
7419
|
-
clientId: this.users.clientId || this.selectedFilters.client
|
|
7456
|
+
clientId: this.users.clientId || this.selectedFilters.client,
|
|
7420
7457
|
};
|
|
7421
7458
|
this.auth.getHeaderStores(data).subscribe({
|
|
7422
7459
|
next: (res) => {
|
|
@@ -7425,30 +7462,34 @@ class MetricsHeaderComponent {
|
|
|
7425
7462
|
this.stores = res.data.storesData;
|
|
7426
7463
|
// Check if there are previously selected stores
|
|
7427
7464
|
const checkedStoreIds = this.selectedFilters?.stores
|
|
7428
|
-
? this.selectedFilters.stores
|
|
7465
|
+
? this.selectedFilters.stores
|
|
7466
|
+
.filter((store) => store.checked)
|
|
7467
|
+
.map((store) => store.storeId)
|
|
7429
7468
|
: [];
|
|
7430
7469
|
// Sync the `checked` state
|
|
7431
|
-
this.stores.forEach(store => {
|
|
7470
|
+
this.stores.forEach((store) => {
|
|
7432
7471
|
store.checked = checkedStoreIds.length
|
|
7433
7472
|
? checkedStoreIds.includes(store.storeId) // Use previous selection
|
|
7434
7473
|
: true; // Default to true if no previous selection
|
|
7435
7474
|
});
|
|
7436
7475
|
// Apply search filter if search text is present
|
|
7437
7476
|
if (this.searchStoreText.length) {
|
|
7438
|
-
this.filteredStores = this.stores.filter(store => store.storeName
|
|
7477
|
+
this.filteredStores = this.stores.filter((store) => store.storeName
|
|
7478
|
+
.toLowerCase()
|
|
7479
|
+
.includes(this.searchStoreText.toLowerCase()));
|
|
7439
7480
|
}
|
|
7440
7481
|
else {
|
|
7441
7482
|
this.filteredStores = [...this.stores];
|
|
7442
7483
|
}
|
|
7443
7484
|
// Update `selectedFilters.stores` to reflect the current state
|
|
7444
|
-
this.selectedFilters.stores = this.filteredStores.map(store => ({
|
|
7485
|
+
this.selectedFilters.stores = this.filteredStores.map((store) => ({
|
|
7445
7486
|
storeId: store.storeId,
|
|
7446
7487
|
storeName: store.storeName,
|
|
7447
|
-
checked: store.checked
|
|
7488
|
+
checked: store.checked,
|
|
7448
7489
|
}));
|
|
7449
7490
|
// this.selectedFilters.country = country;
|
|
7450
7491
|
// Save updated filters to localStorage
|
|
7451
|
-
localStorage.setItem(
|
|
7492
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
7452
7493
|
this.getZone();
|
|
7453
7494
|
// Trigger UI change detection
|
|
7454
7495
|
this.cd.detectChanges();
|
|
@@ -7461,93 +7502,108 @@ class MetricsHeaderComponent {
|
|
|
7461
7502
|
error: (err) => {
|
|
7462
7503
|
console.error("Failed to fetch stores", err);
|
|
7463
7504
|
this.clearStoresState();
|
|
7464
|
-
}
|
|
7505
|
+
},
|
|
7465
7506
|
});
|
|
7466
7507
|
}
|
|
7467
7508
|
getZone() {
|
|
7468
7509
|
const country = this.countries
|
|
7469
|
-
.filter(country => country.checked)
|
|
7470
|
-
.map(country => country.country);
|
|
7510
|
+
.filter((country) => country.checked)
|
|
7511
|
+
.map((country) => country.country);
|
|
7471
7512
|
const city = this.locations
|
|
7472
|
-
.filter(location => location.checked)
|
|
7473
|
-
.map(location => location.city);
|
|
7513
|
+
.filter((location) => location.checked)
|
|
7514
|
+
.map((location) => location.city);
|
|
7474
7515
|
const group = this.groupsData
|
|
7475
|
-
.filter(group => group.checked)
|
|
7476
|
-
.map(group => group.groupName);
|
|
7516
|
+
.filter((group) => group.checked)
|
|
7517
|
+
.map((group) => group.groupName);
|
|
7477
7518
|
const storeId = this.filteredStores
|
|
7478
|
-
.filter(group => group.checked)
|
|
7479
|
-
.map(group => group.storeId);
|
|
7519
|
+
.filter((group) => group.checked)
|
|
7520
|
+
.map((group) => group.storeId);
|
|
7480
7521
|
const data = {
|
|
7481
7522
|
country,
|
|
7482
7523
|
city,
|
|
7483
7524
|
clusters: group,
|
|
7484
7525
|
clientId: this.users.clientId || this.selectedFilters.client,
|
|
7485
|
-
storeId: storeId
|
|
7526
|
+
storeId: storeId,
|
|
7486
7527
|
};
|
|
7487
7528
|
this.auth.getHeaderZone(data).subscribe({
|
|
7488
7529
|
next: (res) => {
|
|
7489
7530
|
if (res && res.code === 200) {
|
|
7490
|
-
// Initialize
|
|
7491
|
-
this.zones =
|
|
7492
|
-
|
|
7531
|
+
// Initialize zones with Overall Store first, unchecked by default
|
|
7532
|
+
this.zones = [
|
|
7533
|
+
{ _id: "overall", tagName: "Overall Store", checked: false },
|
|
7534
|
+
...(res?.data?.zoneData?.map((zone) => ({
|
|
7535
|
+
_id: zone._id,
|
|
7536
|
+
tagName: zone.tagName,
|
|
7537
|
+
checked: false, // initialize unchecked; will update below
|
|
7538
|
+
})) || []),
|
|
7539
|
+
];
|
|
7540
|
+
// Get previously selected zone IDs (checked ones)
|
|
7493
7541
|
const checkedStoreIds = this.selectedFilters?.zoneName
|
|
7494
|
-
? this.selectedFilters
|
|
7542
|
+
? this.selectedFilters.zoneName
|
|
7543
|
+
.filter((zone) => zone.checked)
|
|
7544
|
+
.map((zone) => zone._id)
|
|
7495
7545
|
: [];
|
|
7496
|
-
// Sync
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7546
|
+
// Sync checked state with previous selections or default:
|
|
7547
|
+
// If no previous selection, Overall Store unchecked, others checked
|
|
7548
|
+
this.zones.forEach((zone) => {
|
|
7549
|
+
if (checkedStoreIds.length) {
|
|
7550
|
+
zone.checked = checkedStoreIds.includes(zone._id);
|
|
7551
|
+
}
|
|
7552
|
+
else {
|
|
7553
|
+
zone.checked = zone._id !== "overall";
|
|
7554
|
+
}
|
|
7501
7555
|
});
|
|
7502
|
-
// Apply search filter if
|
|
7556
|
+
// Apply search filter if any
|
|
7503
7557
|
if (this.searchZoneText.length) {
|
|
7504
|
-
this.filteredZones = this.zones.filter(zone => zone.tagName
|
|
7558
|
+
this.filteredZones = this.zones.filter((zone) => zone.tagName
|
|
7559
|
+
.toLowerCase()
|
|
7560
|
+
.includes(this.searchZoneText.toLowerCase()));
|
|
7505
7561
|
}
|
|
7506
7562
|
else {
|
|
7507
7563
|
this.filteredZones = [...this.zones];
|
|
7508
7564
|
}
|
|
7509
|
-
// Update
|
|
7510
|
-
this.selectedFilters.zoneName = this.filteredZones.map(zone => ({
|
|
7565
|
+
// Update selectedFilters.zoneName with current checked states
|
|
7566
|
+
this.selectedFilters.zoneName = this.filteredZones.map((zone) => ({
|
|
7511
7567
|
_id: zone._id,
|
|
7512
7568
|
tagName: zone.tagName,
|
|
7513
|
-
checked: zone.checked
|
|
7569
|
+
checked: zone.checked,
|
|
7514
7570
|
}));
|
|
7515
|
-
// this.selectedFilters.country = couthis.filteredZonesntry;
|
|
7516
7571
|
// Save updated filters to localStorage
|
|
7517
|
-
localStorage.setItem(
|
|
7518
|
-
// Trigger
|
|
7572
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
7573
|
+
// Trigger change detection if needed
|
|
7519
7574
|
this.cd.detectChanges();
|
|
7520
7575
|
}
|
|
7521
7576
|
else {
|
|
7522
|
-
// Handle empty or error response
|
|
7523
7577
|
this.clearZoneState();
|
|
7524
7578
|
}
|
|
7525
7579
|
},
|
|
7526
7580
|
error: (err) => {
|
|
7527
|
-
console.error("Failed to fetch
|
|
7581
|
+
console.error("Failed to fetch zones", err);
|
|
7528
7582
|
this.clearZoneState();
|
|
7529
|
-
}
|
|
7583
|
+
},
|
|
7530
7584
|
});
|
|
7531
7585
|
}
|
|
7532
7586
|
clearZoneState() {
|
|
7533
7587
|
this.zones = [];
|
|
7534
7588
|
this.filteredZones = [];
|
|
7535
7589
|
this.selectedFilters.zonename = [];
|
|
7536
|
-
localStorage.setItem(
|
|
7590
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
7537
7591
|
}
|
|
7538
7592
|
// Clear stores state and reset filters
|
|
7539
7593
|
clearStoresState() {
|
|
7540
7594
|
this.stores = [];
|
|
7541
7595
|
this.filteredStores = [];
|
|
7542
7596
|
this.selectedFilters.stores = [];
|
|
7543
|
-
localStorage.setItem(
|
|
7597
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
7544
7598
|
}
|
|
7545
7599
|
resetSelectedStores() {
|
|
7546
7600
|
this.filteredStores.forEach((store) => (store.checked = false));
|
|
7547
7601
|
this.searchStoreText = "";
|
|
7548
7602
|
}
|
|
7549
7603
|
selectedStoresLabel() {
|
|
7550
|
-
const selectedStores = this.searchStoreText.length
|
|
7604
|
+
const selectedStores = this.searchStoreText.length
|
|
7605
|
+
? this.stores.filter((store) => store.checked)
|
|
7606
|
+
: this.filteredStores.filter((store) => store.checked);
|
|
7551
7607
|
return selectedStores.length === 0
|
|
7552
7608
|
? "0 Stores"
|
|
7553
7609
|
: selectedStores.length === 1
|
|
@@ -7555,7 +7611,9 @@ class MetricsHeaderComponent {
|
|
|
7555
7611
|
: `${selectedStores.length} Stores`;
|
|
7556
7612
|
}
|
|
7557
7613
|
selectedZonesLabel() {
|
|
7558
|
-
const selectedStores = this.searchZoneText.length
|
|
7614
|
+
const selectedStores = this.searchZoneText.length
|
|
7615
|
+
? this.zones.filter((zone) => zone.checked)
|
|
7616
|
+
: this.filteredZones.filter((zone) => zone.checked);
|
|
7559
7617
|
return selectedStores.length === 0
|
|
7560
7618
|
? "0 Zones"
|
|
7561
7619
|
: selectedStores.length === 1
|
|
@@ -7563,23 +7621,26 @@ class MetricsHeaderComponent {
|
|
|
7563
7621
|
: `${selectedStores.length} Zones`;
|
|
7564
7622
|
}
|
|
7565
7623
|
isAllStoresSelected() {
|
|
7566
|
-
return this.filteredStores.length > 0 &&
|
|
7624
|
+
return (this.filteredStores.length > 0 &&
|
|
7625
|
+
this.filteredStores.every((store) => store.checked));
|
|
7567
7626
|
}
|
|
7568
7627
|
isAllZonesSelected() {
|
|
7569
|
-
return this.filteredZones
|
|
7628
|
+
return this.filteredZones
|
|
7629
|
+
.filter((zone) => zone._id !== "overall")
|
|
7630
|
+
.every((zone) => zone.checked);
|
|
7570
7631
|
}
|
|
7571
7632
|
// Method to handle dropdown item selection
|
|
7572
7633
|
updateSelectedStores() {
|
|
7573
|
-
this.filteredStores.forEach(store => {
|
|
7574
|
-
const filteredStore = this.stores.findIndex(fStore => fStore.storeId === store.storeId);
|
|
7634
|
+
this.filteredStores.forEach((store) => {
|
|
7635
|
+
const filteredStore = this.stores.findIndex((fStore) => fStore.storeId === store.storeId);
|
|
7575
7636
|
if (filteredStore != -1) {
|
|
7576
7637
|
this.stores[filteredStore].checked = store.checked; // Sync the checked state with full store list
|
|
7577
7638
|
}
|
|
7578
7639
|
});
|
|
7579
7640
|
// Update selectedFilters based on the current store selection
|
|
7580
|
-
this.selectedFilters.stores = this.stores.filter(store => store.checked);
|
|
7641
|
+
this.selectedFilters.stores = this.stores.filter((store) => store.checked);
|
|
7581
7642
|
// Update localStorage with the latest selection
|
|
7582
|
-
localStorage.setItem(
|
|
7643
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
7583
7644
|
// Emit updated filters via service
|
|
7584
7645
|
// this.gs.dataRangeValue.next(this.selectedFilters);
|
|
7585
7646
|
// Trigger change detection if necessary
|
|
@@ -7591,20 +7652,30 @@ class MetricsHeaderComponent {
|
|
|
7591
7652
|
this.selectedFilters.zoneName = [];
|
|
7592
7653
|
this.cd.detectChanges();
|
|
7593
7654
|
}
|
|
7594
|
-
updateSelectedZones() {
|
|
7595
|
-
this.filteredZones.forEach(zone => {
|
|
7596
|
-
const
|
|
7597
|
-
if (
|
|
7598
|
-
this.zones[
|
|
7655
|
+
updateSelectedZones(clickedZoneId) {
|
|
7656
|
+
this.filteredZones.forEach((zone) => {
|
|
7657
|
+
const index = this.zones.findIndex((z) => z._id === zone._id);
|
|
7658
|
+
if (index !== -1) {
|
|
7659
|
+
this.zones[index].checked = zone.checked;
|
|
7599
7660
|
}
|
|
7600
7661
|
});
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7662
|
+
const overallZone = this.zones.find((z) => z._id === "overall");
|
|
7663
|
+
const overallChecked = overallZone?.checked ?? false;
|
|
7664
|
+
const othersSelected = this.zones.some((z) => z._id !== "overall" && z.checked);
|
|
7665
|
+
if (clickedZoneId === "overall" && overallChecked) {
|
|
7666
|
+
this.zones = this.zones.map((z) => ({
|
|
7667
|
+
...z,
|
|
7668
|
+
checked: z._id === "overall",
|
|
7669
|
+
}));
|
|
7670
|
+
}
|
|
7671
|
+
if (clickedZoneId !== "overall" && overallChecked) {
|
|
7672
|
+
if (overallZone) {
|
|
7673
|
+
overallZone.checked = false;
|
|
7674
|
+
}
|
|
7675
|
+
}
|
|
7676
|
+
this.filteredZones = [...this.zones];
|
|
7677
|
+
this.selectedFilters.zoneName = this.zones.filter((z) => z.checked);
|
|
7678
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
7608
7679
|
this.cd.detectChanges();
|
|
7609
7680
|
}
|
|
7610
7681
|
toggleSelectAllLocations(event) {
|
|
@@ -7615,9 +7686,9 @@ class MetricsHeaderComponent {
|
|
|
7615
7686
|
toggleSelectAllStores(event) {
|
|
7616
7687
|
const checked = event.target.checked;
|
|
7617
7688
|
// Apply the selection to both filtered and full list of stores
|
|
7618
|
-
this.filteredStores.forEach(store => store.checked = checked);
|
|
7619
|
-
this.stores.forEach(store => {
|
|
7620
|
-
const filteredStore = this.filteredStores.find(fStore => fStore.storeId === store.storeId);
|
|
7689
|
+
this.filteredStores.forEach((store) => (store.checked = checked));
|
|
7690
|
+
this.stores.forEach((store) => {
|
|
7691
|
+
const filteredStore = this.filteredStores.find((fStore) => fStore.storeId === store.storeId);
|
|
7621
7692
|
if (filteredStore) {
|
|
7622
7693
|
store.checked = checked; // Sync the checked state with full store list
|
|
7623
7694
|
}
|
|
@@ -7627,16 +7698,24 @@ class MetricsHeaderComponent {
|
|
|
7627
7698
|
}
|
|
7628
7699
|
toggleSelectAllZones(event) {
|
|
7629
7700
|
const checked = event.target.checked;
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
zone.checked =
|
|
7701
|
+
this.filteredZones.forEach((zone) => {
|
|
7702
|
+
if (zone._id !== "overall") {
|
|
7703
|
+
zone.checked = checked;
|
|
7704
|
+
}
|
|
7705
|
+
else {
|
|
7706
|
+
zone.checked = false;
|
|
7636
7707
|
}
|
|
7637
7708
|
});
|
|
7638
|
-
|
|
7639
|
-
|
|
7709
|
+
this.zones.forEach((zone) => {
|
|
7710
|
+
const match = this.filteredZones.find((fz) => fz._id === zone._id);
|
|
7711
|
+
if (match) {
|
|
7712
|
+
zone.checked = match.checked;
|
|
7713
|
+
}
|
|
7714
|
+
});
|
|
7715
|
+
// Since this is bulk, pass a dummy value — any non-overall zone is fine
|
|
7716
|
+
const anySelectedZone = this.filteredZones.find((z) => z._id !== "overall");
|
|
7717
|
+
const clickedId = anySelectedZone ? anySelectedZone._id : "";
|
|
7718
|
+
this.updateSelectedZones(clickedId);
|
|
7640
7719
|
}
|
|
7641
7720
|
updateSelectedLocations() {
|
|
7642
7721
|
// When locations are selected, fetch the related groups
|
|
@@ -7663,8 +7742,8 @@ class MetricsHeaderComponent {
|
|
|
7663
7742
|
}
|
|
7664
7743
|
this.selectedFilters.group = [];
|
|
7665
7744
|
this.filteredStores = []; // Reset stores as well
|
|
7666
|
-
this.searchGroupText =
|
|
7667
|
-
this.searchStoreText =
|
|
7745
|
+
this.searchGroupText = "";
|
|
7746
|
+
this.searchStoreText = "";
|
|
7668
7747
|
// this.Opendropdown = false;
|
|
7669
7748
|
}
|
|
7670
7749
|
toggleSelectAllGroups(event) {
|
|
@@ -7694,26 +7773,25 @@ class MetricsHeaderComponent {
|
|
|
7694
7773
|
this.filteredStores = [];
|
|
7695
7774
|
// Also, update localStorage to reflect the cleared store selection
|
|
7696
7775
|
this.selectedFilters.stores = [];
|
|
7697
|
-
localStorage.setItem(
|
|
7776
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
7698
7777
|
// Emit data via service
|
|
7699
7778
|
// this.gs.dataRangeValue.next(this.selectedFilters);
|
|
7700
7779
|
}
|
|
7701
7780
|
// Clear the search store text when groups are updated
|
|
7702
|
-
this.searchStoreText =
|
|
7781
|
+
this.searchStoreText = "";
|
|
7703
7782
|
}
|
|
7704
7783
|
Reset() {
|
|
7705
7784
|
setTimeout(() => {
|
|
7706
|
-
// Clear selected groups, stores, and locations
|
|
7707
7785
|
this.filteredCountries = [];
|
|
7708
7786
|
this.filteredGroups = [];
|
|
7709
7787
|
this.filteredStores = [];
|
|
7710
|
-
this.filteredLocations = [];
|
|
7788
|
+
this.filteredLocations = [];
|
|
7711
7789
|
this.locations = [];
|
|
7712
7790
|
this.groupsData = [];
|
|
7713
7791
|
this.stores = [];
|
|
7714
7792
|
this.filteredZones = [];
|
|
7715
7793
|
this.zones = [];
|
|
7716
|
-
|
|
7794
|
+
this.countries = [];
|
|
7717
7795
|
this.searchLocationText = "";
|
|
7718
7796
|
this.searchGroupText = "";
|
|
7719
7797
|
this.searchStoreText = "";
|
|
@@ -7722,32 +7800,14 @@ class MetricsHeaderComponent {
|
|
|
7722
7800
|
this.selectedFilters.location = [];
|
|
7723
7801
|
this.selectedFilters.country = [];
|
|
7724
7802
|
this.selectedFilters.zoneName = [];
|
|
7725
|
-
// Fetch locations, groups, and stores again
|
|
7726
7803
|
this.getCountry();
|
|
7727
7804
|
this.getLocations();
|
|
7728
7805
|
this.getStore();
|
|
7729
7806
|
this.getGroups();
|
|
7730
|
-
|
|
7731
|
-
// // Once stores are fetched, mark all as checked
|
|
7732
|
-
// setTimeout(() => {
|
|
7733
|
-
// this.filteredStores = this.stores.map(store => ({
|
|
7734
|
-
// ...store,
|
|
7735
|
-
// checked: true // Mark all stores as checked
|
|
7736
|
-
// }));
|
|
7737
|
-
// // Sync selectedFilters with the updated store state
|
|
7738
|
-
// this.selectedFilters.stores = this.filteredStores.map(store => ({
|
|
7739
|
-
// ...store,
|
|
7740
|
-
// checked: true
|
|
7741
|
-
// }));
|
|
7742
|
-
// Update localStorage with the latest selectedFilters
|
|
7743
|
-
localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
|
|
7807
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
7744
7808
|
window.location.reload();
|
|
7745
|
-
// Emit the reset filters to update other components if needed
|
|
7746
7809
|
// this.gs.dataRangeValue.next(this.selectedFilters);
|
|
7747
|
-
// Trigger change detection
|
|
7748
7810
|
this.cd.detectChanges();
|
|
7749
|
-
// Adding a slight delay to ensure stores are fetched first
|
|
7750
|
-
// Close dropdown after reset if necessary
|
|
7751
7811
|
this.Opendropdown = false;
|
|
7752
7812
|
}, 100);
|
|
7753
7813
|
}
|
|
@@ -7756,17 +7816,18 @@ class MetricsHeaderComponent {
|
|
|
7756
7816
|
if (searchText) {
|
|
7757
7817
|
// Preserve the checked state during filtering
|
|
7758
7818
|
this.filteredLocations = this.locations
|
|
7759
|
-
.map(location => ({
|
|
7819
|
+
.map((location) => ({
|
|
7760
7820
|
...location,
|
|
7761
|
-
checked: this.filteredLocations.find(l => l.city === location.city)
|
|
7821
|
+
checked: this.filteredLocations.find((l) => l.city === location.city)
|
|
7822
|
+
?.checked || false,
|
|
7762
7823
|
}))
|
|
7763
|
-
.filter(location => location?.city?.toLowerCase().includes(searchText));
|
|
7824
|
+
.filter((location) => location?.city?.toLowerCase().includes(searchText));
|
|
7764
7825
|
}
|
|
7765
7826
|
else {
|
|
7766
7827
|
// Restore the original checked state when search text is cleared
|
|
7767
|
-
this.filteredLocations = this.locations.map(location => ({
|
|
7828
|
+
this.filteredLocations = this.locations.map((location) => ({
|
|
7768
7829
|
...location,
|
|
7769
|
-
checked: this.selectedFilters.location.find((l) => l.city === location.city)?.checked || false
|
|
7830
|
+
checked: this.selectedFilters.location.find((l) => l.city === location.city)?.checked || false,
|
|
7770
7831
|
}));
|
|
7771
7832
|
}
|
|
7772
7833
|
}
|
|
@@ -7775,17 +7836,18 @@ class MetricsHeaderComponent {
|
|
|
7775
7836
|
if (searchText) {
|
|
7776
7837
|
// Preserve the checked state during filtering
|
|
7777
7838
|
this.filteredGroups = this.groupsData
|
|
7778
|
-
.map(group => ({
|
|
7839
|
+
.map((group) => ({
|
|
7779
7840
|
...group,
|
|
7780
|
-
checked: this.filteredGroups.find(g => g.groupName === group.groupName)
|
|
7841
|
+
checked: this.filteredGroups.find((g) => g.groupName === group.groupName)
|
|
7842
|
+
?.checked || false,
|
|
7781
7843
|
}))
|
|
7782
|
-
.filter(group => group?.groupName?.toLowerCase().includes(searchText));
|
|
7844
|
+
.filter((group) => group?.groupName?.toLowerCase().includes(searchText));
|
|
7783
7845
|
}
|
|
7784
7846
|
else {
|
|
7785
7847
|
// Restore the original checked state when search text is cleared
|
|
7786
|
-
this.filteredGroups = this.groupsData.map(group => ({
|
|
7848
|
+
this.filteredGroups = this.groupsData.map((group) => ({
|
|
7787
7849
|
...group,
|
|
7788
|
-
checked: this.selectedFilters.group.find((g) => g.groupName === group.groupName)?.checked || false
|
|
7850
|
+
checked: this.selectedFilters.group.find((g) => g.groupName === group.groupName)?.checked || false,
|
|
7789
7851
|
}));
|
|
7790
7852
|
}
|
|
7791
7853
|
}
|
|
@@ -7795,19 +7857,23 @@ class MetricsHeaderComponent {
|
|
|
7795
7857
|
if (searchText) {
|
|
7796
7858
|
// Filter based on search text while preserving checked state
|
|
7797
7859
|
this.filteredStores = this.stores
|
|
7798
|
-
.map(store => ({
|
|
7860
|
+
.map((store) => ({
|
|
7799
7861
|
...store,
|
|
7800
7862
|
// Check if the store is already checked in filteredStores, fallback to original stores' checked state
|
|
7801
|
-
checked: this.selectedFilters.stores.find((s) => s.storeId === store.storeId)?.checked ||
|
|
7863
|
+
checked: this.selectedFilters.stores.find((s) => s.storeId === store.storeId)?.checked ||
|
|
7864
|
+
store.checked ||
|
|
7865
|
+
false,
|
|
7802
7866
|
}))
|
|
7803
|
-
.filter(store => store.storeName.toLowerCase().includes(searchText));
|
|
7867
|
+
.filter((store) => store.storeName.toLowerCase().includes(searchText));
|
|
7804
7868
|
}
|
|
7805
7869
|
else {
|
|
7806
7870
|
// When the search text is cleared, restore the original list with preserved checked states
|
|
7807
|
-
this.filteredStores = this.stores.map(store => ({
|
|
7871
|
+
this.filteredStores = this.stores.map((store) => ({
|
|
7808
7872
|
...store,
|
|
7809
7873
|
// Preserve the checked state based on the selected filters
|
|
7810
|
-
checked: this.selectedFilters.stores.find((s) => s.storeId === store.storeId)?.checked ||
|
|
7874
|
+
checked: this.selectedFilters.stores.find((s) => s.storeId === store.storeId)?.checked ||
|
|
7875
|
+
store.checked ||
|
|
7876
|
+
false,
|
|
7811
7877
|
}));
|
|
7812
7878
|
}
|
|
7813
7879
|
}
|
|
@@ -7817,19 +7883,25 @@ class MetricsHeaderComponent {
|
|
|
7817
7883
|
if (searchText) {
|
|
7818
7884
|
// Filter based on search text while preserving checked state
|
|
7819
7885
|
this.filteredZones = this.zones
|
|
7820
|
-
.map(zone => ({
|
|
7886
|
+
.map((zone) => ({
|
|
7821
7887
|
...zone,
|
|
7822
7888
|
// Check if the store is already checked in filteredStores, fallback to original stores' checked state
|
|
7823
|
-
checked: this.selectedFilters.zoneName.find((s) => s._id === zone._id)
|
|
7889
|
+
checked: this.selectedFilters.zoneName.find((s) => s._id === zone._id)
|
|
7890
|
+
?.checked ||
|
|
7891
|
+
zone.checked ||
|
|
7892
|
+
false,
|
|
7824
7893
|
}))
|
|
7825
|
-
.filter(zone => zone.tagName.toLowerCase().includes(searchText));
|
|
7894
|
+
.filter((zone) => zone.tagName.toLowerCase().includes(searchText));
|
|
7826
7895
|
}
|
|
7827
7896
|
else {
|
|
7828
7897
|
// When the search text is cleared, restore the original list with preserved checked states
|
|
7829
|
-
this.filteredZones = this.zones.map(zone => ({
|
|
7898
|
+
this.filteredZones = this.zones.map((zone) => ({
|
|
7830
7899
|
...zone,
|
|
7831
7900
|
// Preserve the checked state based on the selected filters
|
|
7832
|
-
checked: this.selectedFilters.zoneName.find((s) => s._id === zone._id)
|
|
7901
|
+
checked: this.selectedFilters.zoneName.find((s) => s._id === zone._id)
|
|
7902
|
+
?.checked ||
|
|
7903
|
+
zone.checked ||
|
|
7904
|
+
false,
|
|
7833
7905
|
}));
|
|
7834
7906
|
}
|
|
7835
7907
|
}
|
|
@@ -7896,7 +7968,7 @@ class MetricsHeaderComponent {
|
|
|
7896
7968
|
// isAllCountriesSelected(): boolean {
|
|
7897
7969
|
// return this.filteredCountries.every(country => country.checked);
|
|
7898
7970
|
// }
|
|
7899
|
-
// filterCountries(): void {
|
|
7971
|
+
// filterCountries(): void {
|
|
7900
7972
|
// const searchText = this.searchCountryText.toLowerCase();
|
|
7901
7973
|
// if (searchText) {
|
|
7902
7974
|
// // Preserve the checked state during filtering
|
|
@@ -7918,12 +7990,16 @@ class MetricsHeaderComponent {
|
|
|
7918
7990
|
// }
|
|
7919
7991
|
getCountry() {
|
|
7920
7992
|
let obj = {
|
|
7921
|
-
clientId: this.selectedFilters.client
|
|
7993
|
+
clientId: this.selectedFilters.client
|
|
7994
|
+
? this.selectedFilters.client
|
|
7995
|
+
: this.users.clientId,
|
|
7922
7996
|
};
|
|
7923
7997
|
this.auth.getCountry(obj).subscribe({
|
|
7924
7998
|
next: (res) => {
|
|
7925
7999
|
// Extract selected countries from existing filters (if any)
|
|
7926
|
-
let countryList = this.selectedFilters?.country
|
|
8000
|
+
let countryList = this.selectedFilters?.country
|
|
8001
|
+
?.filter((country) => country.checked)
|
|
8002
|
+
.map((loc) => loc.country);
|
|
7927
8003
|
// Map API response to frontend model
|
|
7928
8004
|
this.countries = res?.data?.countryData.map((item) => ({
|
|
7929
8005
|
country: item.country,
|
|
@@ -7931,10 +8007,13 @@ class MetricsHeaderComponent {
|
|
|
7931
8007
|
// checked: cityList?.length ? cityList.includes(city.city) : true,
|
|
7932
8008
|
checked: countryList?.includes(item.country) ? true : false,
|
|
7933
8009
|
}));
|
|
7934
|
-
if (this.selectedFilters.country &&
|
|
7935
|
-
|
|
8010
|
+
if (this.selectedFilters.country &&
|
|
8011
|
+
Array.isArray(this.selectedFilters.country)) {
|
|
8012
|
+
this.filteredCountries = this.countries.map((location) => {
|
|
7936
8013
|
const matchedLocation = this.selectedFilters.country.find((loc) => loc.country === location.country);
|
|
7937
|
-
return matchedLocation
|
|
8014
|
+
return matchedLocation
|
|
8015
|
+
? { ...location, checked: matchedLocation.checked }
|
|
8016
|
+
: location;
|
|
7938
8017
|
});
|
|
7939
8018
|
}
|
|
7940
8019
|
else {
|
|
@@ -7962,10 +8041,14 @@ class MetricsHeaderComponent {
|
|
|
7962
8041
|
}
|
|
7963
8042
|
selectedCountriesLabel() {
|
|
7964
8043
|
const selectedCountries = this.searchCountryText.length
|
|
7965
|
-
? this.filteredCountries
|
|
7966
|
-
|
|
8044
|
+
? this.filteredCountries
|
|
8045
|
+
.filter((country) => country.checked)
|
|
8046
|
+
.map((country) => country.country)
|
|
8047
|
+
: this.countries
|
|
8048
|
+
.filter((country) => country.checked)
|
|
8049
|
+
.map((country) => country.country);
|
|
7967
8050
|
return selectedCountries.length === 0
|
|
7968
|
-
?
|
|
8051
|
+
? ""
|
|
7969
8052
|
: selectedCountries.length === 1
|
|
7970
8053
|
? selectedCountries[0]
|
|
7971
8054
|
: `${selectedCountries.length} countries`;
|
|
@@ -7975,22 +8058,24 @@ class MetricsHeaderComponent {
|
|
|
7975
8058
|
if (searchText) {
|
|
7976
8059
|
// Filter and preserve checked state
|
|
7977
8060
|
this.filteredCountries = this.countries
|
|
7978
|
-
.map(country => ({
|
|
8061
|
+
.map((country) => ({
|
|
7979
8062
|
...country,
|
|
7980
|
-
checked: this.filteredCountries.find(c => c.country === country.country)
|
|
8063
|
+
checked: this.filteredCountries.find((c) => c.country === country.country)
|
|
8064
|
+
?.checked || false,
|
|
7981
8065
|
}))
|
|
7982
|
-
.filter(country => country.country.toLowerCase().includes(searchText));
|
|
8066
|
+
.filter((country) => country.country.toLowerCase().includes(searchText));
|
|
7983
8067
|
}
|
|
7984
8068
|
else {
|
|
7985
8069
|
// Reset to full list
|
|
7986
8070
|
this.filteredCountries = this.countries.map((country) => ({
|
|
7987
8071
|
...country,
|
|
7988
|
-
checked: this.selectedFilters.country?.find((c) => c.country === country.country)?.checked || false
|
|
8072
|
+
checked: this.selectedFilters.country?.find((c) => c.country === country.country)?.checked || false,
|
|
7989
8073
|
}));
|
|
7990
8074
|
}
|
|
7991
8075
|
}
|
|
7992
8076
|
isAllCountriesSelected() {
|
|
7993
|
-
return this.filteredCountries.length > 0 &&
|
|
8077
|
+
return (this.filteredCountries.length > 0 &&
|
|
8078
|
+
this.filteredCountries.every((country) => country.checked));
|
|
7994
8079
|
}
|
|
7995
8080
|
toggleSelectAllCountries(event) {
|
|
7996
8081
|
const isChecked = event.target.checked;
|
|
@@ -8027,8 +8112,8 @@ class MetricsHeaderComponent {
|
|
|
8027
8112
|
this.selectedFilters.group = [];
|
|
8028
8113
|
this.filteredStores = []; // Reset stores as well
|
|
8029
8114
|
this.filteredZones = [];
|
|
8030
|
-
this.searchGroupText =
|
|
8031
|
-
this.searchStoreText =
|
|
8115
|
+
this.searchGroupText = "";
|
|
8116
|
+
this.searchStoreText = "";
|
|
8032
8117
|
// this.Opendropdown = false;
|
|
8033
8118
|
}
|
|
8034
8119
|
removeCountry() {
|
|
@@ -8044,8 +8129,12 @@ class MetricsHeaderComponent {
|
|
|
8044
8129
|
this.selectedFilters.country = this.filteredCountries;
|
|
8045
8130
|
this.selectedFilters.location = this.locations;
|
|
8046
8131
|
this.selectedFilters.group = this.groupsData;
|
|
8047
|
-
this.selectedFilters.stores = headerFilters.stores
|
|
8048
|
-
|
|
8132
|
+
this.selectedFilters.stores = headerFilters.stores
|
|
8133
|
+
? headerFilters.stores
|
|
8134
|
+
: this.stores;
|
|
8135
|
+
this.selectedFilters.zoneName = headerFilters.zoneName
|
|
8136
|
+
? headerFilters.zoneName
|
|
8137
|
+
: this.zones;
|
|
8049
8138
|
// this.selectedFilters.zoneName = this.filteredZones;
|
|
8050
8139
|
// Store updated filters back in localStorage
|
|
8051
8140
|
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
@@ -8058,14 +8147,14 @@ class MetricsHeaderComponent {
|
|
|
8058
8147
|
this.cd.detectChanges();
|
|
8059
8148
|
}
|
|
8060
8149
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MetricsHeaderComponent, deps: [{ token: AuthService }, { token: i2.Router }, { token: i1.GlobalStateService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
8061
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MetricsHeaderComponent, selector: "lib-metrics-header", host: { listeners: { "document:click": "clickOutside($event)" } }, ngImport: i0, template: "<div class=\"me-3\">\r\n <label *ngIf=\"selectedCountriesLabel()\" class=\"badge badge-light-default mx-2\">{{selectedCountriesLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeCountry()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedLocationsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedLocationsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeLocation()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedGroupsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedGroupsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label class=\"badge badge-light-default\">{{selectedStoresLabel()}}</label>\r\n <label class=\"badge badge-light-default mx-2\">{{selectedZonesLabel()}} \r\n <!-- <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span> -->\r\n </label>\r\n</div>\r\n\r\n\r\n<div class=\"wrapper me-3\" *ngIf=\"(gs.userAccess | async)?.userType === 'tango'\">\r\n<lib-select [items]=\"clientList\" [multi]=\"false\" [searchField]=\"'clientName'\" [disabled]=\"false\" [idField]=\"'clientId'\"\r\n(selected)=\"onClientSelect($event)\" [selectedValues]=\"[selectedClient]\"></lib-select>\r\n</div>\r\n<div class=\"d-flex align-items-center position-relative my-1\">\r\n <span class=\"svg-icon svg-icon-1 position-absolute ms-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M13.3333 1.66663V4.99996M6.66667 1.66663V4.99996M2.5 8.33329H17.5M4.16667 3.33329H15.8333C16.7538 3.33329 17.5 4.07948 17.5 4.99996V16.6666C17.5 17.5871 16.7538 18.3333 15.8333 18.3333H4.16667C3.24619 18.3333 2.5 17.5871 2.5 16.6666V4.99996C2.5 4.07948 3.24619 3.33329 4.16667 3.33329Z\"\r\n stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </span>\r\n <input class=\"fx-date-range form-control ps-14\" style=\"min-width: 260px !important;\" type=\"text\" matInput\r\n ngxDaterangepickerMd [drops]=\"'down'\" [opens]=\"'right'\" [ranges]=\"ranges\" [showCustomRangeLabel]=\"true\" [autoApply]=\"true\"\r\n [alwaysShowCalendars]=\"false\" [keepCalendarOpeningWithRange]=\"true\" [showCancel]=\"true\" autocomplete=\"off\"\r\n [(ngModel)]=\"selectedDateRange\" (startDateChanged)=\"onStartDateChange($event)\" [isCustomDate]=\"isCustomDate\"\r\n [locale]=\"{ format: 'DD-MM-YYYY', firstDay: 1, monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }\"\r\n (datesUpdated)=\"datechange($event)\" name=\"daterange\" [readonly]=\"true\" />\r\n</div>\r\n<div class=\"position-relative\">\r\n <button type=\"button\" (click)=\"opendropdown($event)\" class=\"btn btn-default mx-2 rounded-3 text-nowrap border-val\">\r\n <!-- <span class=\"me-2\">Filter</span> -->\r\n <svg class=\"pl-3\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M5 10H15M2.5 5H17.5M7.5 15H12.5\" stroke=\"#344054\" stroke-width=\"2\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n\r\n <div *ngIf=\"Opendropdown\" class=\"card p-5 dropdown2 position-absolute z-1 end-0\" style=\"z-index: 1 !important;\" (clickOutside)=\"closeDropdown1()\">\r\n <div class=\"dropdown-title d-flex justify-content-between mb-2\">Filter Options\r\n <button class=\"btn btn-outline w-25 ms-3 btn-resize\" (click)=\"Reset()\"> Reset </button>\r\n <button class=\"btn btn-primary w-25 btn-resize\" (click)=\"Apply()\">Apply</button>\r\n </div>\r\n\r\n <!-- Country Dropdown -->\r\n<div class=\"dropdown-container\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('country')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedCountriesLabel()\"\r\n readonly\r\n placeholder=\"Select country\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'country'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search country\" \r\n [(ngModel)]=\"searchCountryText\" \r\n (ngModelChange)=\"filterCountries()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllCountries\" \r\n [checked]=\"isAllCountriesSelected()\" \r\n (change)=\"toggleSelectAllCountries($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllCountries\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let country of filteredCountries\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"country.country\" \r\n [(ngModel)]=\"country.checked\"\r\n (change)=\"updateSelectedCountries()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"country.country\">\r\n {{ country.country }}\r\n </label>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n\r\n <!-- Location Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('location')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedLocationsLabel()\"\r\n readonly\r\n placeholder=\"Select Region\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'location'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search Region\" \r\n [(ngModel)]=\"searchLocationText\" \r\n (ngModelChange)=\"filterLocations()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllLocations\" \r\n [checked]=\"isAllLocationsSelected()\" \r\n (change)=\"toggleSelectAllLocations($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllLocations\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let location of filteredLocations\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"location.city\" \r\n [(ngModel)]=\"location.checked\"\r\n (change)=\"updateSelectedLocations()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"location.city\">\r\n {{ location.city }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Group Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('group')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedGroupsLabel()\" readonly\r\n placeholder=\"Select clusters\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'group'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search clusters\" \r\n [(ngModel)]=\"searchGroupText\" \r\n (ngModelChange)=\"filterGroups()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllGroups\" \r\n [checked]=\"isAllGroupsSelected()\" \r\n (change)=\"toggleSelectAllGroups($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllGroups\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let group of filteredGroups\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"group.groupName\"\r\n [(ngModel)]=\"group.checked\"\r\n (change)=\"updateSelectedGroups()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"group.groupName\">\r\n {{ group.groupName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<!-- Store Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('store')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedStoresLabel()\"\r\n readonly\r\n placeholder=\"Select stores\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'store'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search stores\" \r\n [(ngModel)]=\"searchStoreText\" \r\n (ngModelChange)=\"filterStores()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllStores\" \r\n [checked]=\"isAllStoresSelected()\" \r\n (change)=\"toggleSelectAllStores($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllStores\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let store of filteredStores\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"store.storeId\"\r\n [(ngModel)]=\"store.checked\"\r\n (change)=\"updateSelectedStores()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"store.storeId\">\r\n {{ store.storeName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Zone Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('zone')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedZonesLabel()\"\r\n readonly\r\n placeholder=\"Select zones\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'zone'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search zones\" \r\n [(ngModel)]=\"searchZoneText\" \r\n (ngModelChange)=\"filterZones()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllZones\" \r\n [checked]=\"isAllZonesSelected()\" \r\n (change)=\"toggleSelectAllZones($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllZones\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let zone of filteredZones\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"zone._id\"\r\n [(ngModel)]=\"zone.checked\"\r\n (change)=\"updateSelectedZones()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"zone._id\">\r\n {{ zone.tagName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div>", styles: [".daterangepicker{display:block!important;top:153.85px!important;left:900px!important;right:0}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize}::ng-deep .applyBtn{display:none!important}:host::ng-deep .md-drppicker .btn{line-height:10px!important}:host::ng-deep .daterangepicker-input+.ngx-daterangepicker-material .applyBtn{display:none}:host::ng-deep .md-drppicker.drops-down-right.ltr.double.show-ranges.shown{top:65px!important;left:-470px!important;height:365px!important}:host::ng-deep .md-drppicker .btn{border-radius:8px!important;border:1px solid var(--Primary-600, #00A3FF)!important;background:var(--Primary-600, #00A3FF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--White, #FFF)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize}:host::ng-deep .md-drppicker .ranges ul li button{padding:12px 16px;width:160px;color:var(--Gray-700, #344054);font-size:14px;font-weight:400;line-height:20px;background:none;border:none;text-align:left;cursor:pointer}:host::ng-deep .md-drppicker td.active,:host::ng-deep .md-drppicker td.active:hover{background-color:#029cf4!important;border-radius:20px!important;color:var(--White, #FFF)!important;text-align:center!important;font-size:14px!important;font-weight:500!important;line-height:20px}:host::ng-deep .md-drppicker.ltr .ranges{float:left;margin-top:10px!important}:host::ng-deep .md-drppicker td.in-range{background:var(--Primary-50, #EAF8FF)}:host::ng-deep .md-drppicker .ranges ul li button.active{background:var(--Primary-50, #EAF8FF)!important;border-radius:8px!important;color:var(--Primary-700, #009BF3);font-size:14px!important;font-weight:500!important;line-height:20px!important}:host::ng-deep table th,:host::ng-deep table td{width:40px!important;height:40px!important;padding:10px 8px!important}:host::ng-deep .md-drppicker td.available.prev,:host::ng-deep .md-drppicker th.available.prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep .md-drppicker td.available.next,:host::ng-deep .md-drppicker th.available.next{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep table th{border-bottom:0px solid var(--Gray-200, #EAECF0)!important;background:transparent!important;color:var(--Gray-700, #344054)!important;text-align:center;font-size:16px!important;font-weight:500!important;line-height:24px}:host::ng-deep .md-drppicker .btn.btn-default{border-radius:8px!important;border:1px solid var(--Gray-300, #D0D5DD)!important;background:var(--White, #FFF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize;margin-right:10px!important}:host::ng-deep .md-drppicker td.available.invalid-date{text-decoration:line-through;pointer-events:none;color:#a9a9a9}:host::ng-deep .md-drppicker td.available.today:not(.invalid-date){text-decoration:unset;pointer-events:unset;color:unset}.wrapper{min-width:200px}.btn-primary{line-height:18px!important}.filter-label{color:var(--Gray-500, #667085)!important;font-size:14px;font-style:normal;font-weight:600;line-height:20px;text-transform:capitalize}.position-relative{position:relative}.filter-icon{cursor:pointer}.dropdown-container{position:relative;display:inline-block;width:100%}.dropdown-header{cursor:pointer;width:100%}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize;width:100%;box-sizing:border-box}.dropdown-menu{position:absolute;top:100%;left:0;right:0;border:1px solid #ccc;background-color:#fff;z-index:1000;max-height:230px;overflow-y:auto;display:block;box-sizing:border-box;padding:10px 5px}.dropdown-item{padding:6px 0}.dropdown-item:hover{background-color:#f1f1f1}.dropdown-item input[type=checkbox]{margin-right:10px}.custom-dropdown-menu{border-radius:4px;box-shadow:0 1px 2px #1018280d}.custom-dropdown-item{display:flex;align-items:center}.custom-dropdown-item input{margin-left:10px}.btn-resize{font-size:13px!important;height:29px!important;line-height:11px!important;padding:3px!important}.dropdown2{position:absolute;top:70px;min-width:270px!important}.dropdown2 .dropdown-title{color:var(--Gray-900, #101828);font-size:14px;font-weight:600;line-height:24px}.dropdown2 .dropdown{position:relative;display:inline-block}.dropdown2 .dropdown span{color:var(--Gray-700, #344054);font-size:14px;font-weight:600;line-height:20px}.form-check-label{color:var(--Gray-700, #344054)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px}input[type=checkbox]{width:16px!important;height:16px!important;margin:0 5px;border-radius:4px!important;-webkit-appearance:none;-moz-appearance:none;-o-appearance:none;appearance:none;outline:1px solid var(--gray-300, #D0D5DD);box-shadow:none;font-size:.8em;text-align:center;line-height:1em;background:#fff}input[type=checkbox]:checked{outline:1px solid var(--primary-600, #00A3FF);background-color:var(--primary-50, #EAF8FF)}input[type=checkbox]:checked:after{content:\"\";transform:rotate(45deg);border-bottom:2px solid #00A3FF;border-right:2px solid #00A3FF;display:inline-block;width:.2em;padding-left:0;padding-top:9px;padding-right:4px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CustomSelectComponent, selector: "lib-select", inputs: ["items", "searchField", "multi", "idField", "selectedValues", "disabled", "label"], outputs: ["selected"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i7.DaterangepickerDirective, selector: "input[ngxDaterangepickerMd]", inputs: ["minDate", "maxDate", "autoApply", "alwaysShowCalendars", "showCustomRangeLabel", "linkedCalendars", "dateLimit", "singleDatePicker", "showWeekNumbers", "showISOWeekNumbers", "showDropdowns", "isInvalidDate", "isCustomDate", "isTooltipDate", "showClearButton", "customRangeDirection", "ranges", "opens", "drops", "firstMonthDayClass", "lastMonthDayClass", "emptyWeekRowClass", "emptyWeekColumnClass", "firstDayOfNextMonthClass", "lastDayOfPreviousMonthClass", "keepCalendarOpeningWithRange", "showRangeLabelOnInput", "showCancel", "lockStartDate", "timePicker", "timePicker24Hour", "timePickerIncrement", "timePickerSeconds", "closeOnAutoApply", "endKeyHolder", "startKey", "locale", "endKey"], outputs: ["change", "rangeClicked", "datesUpdated", "startDateChanged", "endDateChanged", "clearClicked"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
|
|
8150
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MetricsHeaderComponent, selector: "lib-metrics-header", host: { listeners: { "document:click": "clickOutside($event)" } }, ngImport: i0, template: "<div class=\"me-3\">\r\n <label *ngIf=\"selectedCountriesLabel()\" class=\"badge badge-light-default mx-2\">{{selectedCountriesLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeCountry()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedLocationsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedLocationsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeLocation()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedGroupsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedGroupsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label class=\"badge badge-light-default\">{{selectedStoresLabel()}}</label>\r\n <label class=\"badge badge-light-default mx-2\">{{selectedZonesLabel()}} \r\n <!-- <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span> -->\r\n </label>\r\n</div>\r\n\r\n\r\n<div class=\"wrapper me-3\" *ngIf=\"(gs.userAccess | async)?.userType === 'tango'\">\r\n<lib-select [items]=\"clientList\" [multi]=\"false\" [searchField]=\"'clientName'\" [disabled]=\"false\" [idField]=\"'clientId'\"\r\n(selected)=\"onClientSelect($event)\" [selectedValues]=\"[selectedClient]\"></lib-select>\r\n</div>\r\n<div class=\"d-flex align-items-center position-relative my-1\">\r\n <span class=\"svg-icon svg-icon-1 position-absolute ms-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M13.3333 1.66663V4.99996M6.66667 1.66663V4.99996M2.5 8.33329H17.5M4.16667 3.33329H15.8333C16.7538 3.33329 17.5 4.07948 17.5 4.99996V16.6666C17.5 17.5871 16.7538 18.3333 15.8333 18.3333H4.16667C3.24619 18.3333 2.5 17.5871 2.5 16.6666V4.99996C2.5 4.07948 3.24619 3.33329 4.16667 3.33329Z\"\r\n stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </span>\r\n <input class=\"fx-date-range form-control ps-14\" style=\"min-width: 260px !important;\" type=\"text\" matInput\r\n ngxDaterangepickerMd [drops]=\"'down'\" [opens]=\"'right'\" [ranges]=\"ranges\" [showCustomRangeLabel]=\"true\" [autoApply]=\"true\"\r\n [alwaysShowCalendars]=\"false\" [keepCalendarOpeningWithRange]=\"true\" [showCancel]=\"true\" autocomplete=\"off\"\r\n [(ngModel)]=\"selectedDateRange\" (startDateChanged)=\"onStartDateChange($event)\" [isCustomDate]=\"isCustomDate\"\r\n [locale]=\"{ format: 'DD-MM-YYYY', firstDay: 1, monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }\"\r\n (datesUpdated)=\"datechange($event)\" name=\"daterange\" [readonly]=\"true\" />\r\n</div>\r\n<div class=\"position-relative\">\r\n <button type=\"button\" (click)=\"opendropdown($event)\" class=\"btn btn-default mx-2 rounded-3 text-nowrap border-val\">\r\n <!-- <span class=\"me-2\">Filter</span> -->\r\n <svg class=\"pl-3\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M5 10H15M2.5 5H17.5M7.5 15H12.5\" stroke=\"#344054\" stroke-width=\"2\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n\r\n <div *ngIf=\"Opendropdown\" class=\"card p-5 dropdown2 position-absolute z-1 end-0\" style=\"z-index: 1 !important;\" (clickOutside)=\"closeDropdown1()\">\r\n <div class=\"dropdown-title d-flex justify-content-between mb-2\">Filter Options\r\n <button class=\"btn btn-outline w-25 ms-3 btn-resize\" (click)=\"Reset()\"> Reset </button>\r\n <button class=\"btn btn-primary w-25 btn-resize\" (click)=\"Apply()\">Apply</button>\r\n </div>\r\n\r\n <!-- Country Dropdown -->\r\n<div class=\"dropdown-container\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('country')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedCountriesLabel()\"\r\n readonly\r\n placeholder=\"Select country\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'country'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search country\" \r\n [(ngModel)]=\"searchCountryText\" \r\n (ngModelChange)=\"filterCountries()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllCountries\" \r\n [checked]=\"isAllCountriesSelected()\" \r\n (change)=\"toggleSelectAllCountries($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllCountries\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let country of filteredCountries\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"country.country\" \r\n [(ngModel)]=\"country.checked\"\r\n (change)=\"updateSelectedCountries()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"country.country\">\r\n {{ country.country }}\r\n </label>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n\r\n <!-- Location Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('location')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedLocationsLabel()\"\r\n readonly\r\n placeholder=\"Select Region\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'location'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search Region\" \r\n [(ngModel)]=\"searchLocationText\" \r\n (ngModelChange)=\"filterLocations()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllLocations\" \r\n [checked]=\"isAllLocationsSelected()\" \r\n (change)=\"toggleSelectAllLocations($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllLocations\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let location of filteredLocations\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"location.city\" \r\n [(ngModel)]=\"location.checked\"\r\n (change)=\"updateSelectedLocations()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"location.city\">\r\n {{ location.city }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Group Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('group')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedGroupsLabel()\" readonly\r\n placeholder=\"Select clusters\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'group'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search clusters\" \r\n [(ngModel)]=\"searchGroupText\" \r\n (ngModelChange)=\"filterGroups()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllGroups\" \r\n [checked]=\"isAllGroupsSelected()\" \r\n (change)=\"toggleSelectAllGroups($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllGroups\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let group of filteredGroups\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"group.groupName\"\r\n [(ngModel)]=\"group.checked\"\r\n (change)=\"updateSelectedGroups()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"group.groupName\">\r\n {{ group.groupName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<!-- Store Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('store')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedStoresLabel()\"\r\n readonly\r\n placeholder=\"Select stores\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'store'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search stores\" \r\n [(ngModel)]=\"searchStoreText\" \r\n (ngModelChange)=\"filterStores()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllStores\" \r\n [checked]=\"isAllStoresSelected()\" \r\n (change)=\"toggleSelectAllStores($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllStores\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let store of filteredStores\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"store.storeId\"\r\n [(ngModel)]=\"store.checked\"\r\n (change)=\"updateSelectedStores()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"store.storeId\">\r\n {{ store.storeName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Zone Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('zone')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedZonesLabel()\"\r\n readonly\r\n placeholder=\"Select zones\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'zone'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search zones\" \r\n [(ngModel)]=\"searchZoneText\" \r\n (ngModelChange)=\"filterZones()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllZones\" \r\n [checked]=\"isAllZonesSelected()\" \r\n (change)=\"toggleSelectAllZones($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllZones\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let zone of filteredZones\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"zone._id\"\r\n [(ngModel)]=\"zone.checked\"\r\n (change)=\"updateSelectedZones(zone._id)\"\r\n />\r\n <label class=\"form-check-label\" [for]=\"zone._id\">\r\n {{ zone.tagName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div>", styles: [".daterangepicker{display:block!important;top:153.85px!important;left:900px!important;right:0}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize}::ng-deep .applyBtn{display:none!important}:host::ng-deep .md-drppicker .btn{line-height:10px!important}:host::ng-deep .daterangepicker-input+.ngx-daterangepicker-material .applyBtn{display:none}:host::ng-deep .md-drppicker.drops-down-right.ltr.double.show-ranges.shown{top:65px!important;left:-470px!important;height:365px!important}:host::ng-deep .md-drppicker .btn{border-radius:8px!important;border:1px solid var(--Primary-600, #00A3FF)!important;background:var(--Primary-600, #00A3FF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--White, #FFF)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize}:host::ng-deep .md-drppicker .ranges ul li button{padding:12px 16px;width:160px;color:var(--Gray-700, #344054);font-size:14px;font-weight:400;line-height:20px;background:none;border:none;text-align:left;cursor:pointer}:host::ng-deep .md-drppicker td.active,:host::ng-deep .md-drppicker td.active:hover{background-color:#029cf4!important;border-radius:20px!important;color:var(--White, #FFF)!important;text-align:center!important;font-size:14px!important;font-weight:500!important;line-height:20px}:host::ng-deep .md-drppicker.ltr .ranges{float:left;margin-top:10px!important}:host::ng-deep .md-drppicker td.in-range{background:var(--Primary-50, #EAF8FF)}:host::ng-deep .md-drppicker .ranges ul li button.active{background:var(--Primary-50, #EAF8FF)!important;border-radius:8px!important;color:var(--Primary-700, #009BF3);font-size:14px!important;font-weight:500!important;line-height:20px!important}:host::ng-deep table th,:host::ng-deep table td{width:40px!important;height:40px!important;padding:10px 8px!important}:host::ng-deep .md-drppicker td.available.prev,:host::ng-deep .md-drppicker th.available.prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep .md-drppicker td.available.next,:host::ng-deep .md-drppicker th.available.next{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep table th{border-bottom:0px solid var(--Gray-200, #EAECF0)!important;background:transparent!important;color:var(--Gray-700, #344054)!important;text-align:center;font-size:16px!important;font-weight:500!important;line-height:24px}:host::ng-deep .md-drppicker .btn.btn-default{border-radius:8px!important;border:1px solid var(--Gray-300, #D0D5DD)!important;background:var(--White, #FFF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize;margin-right:10px!important}:host::ng-deep .md-drppicker td.available.invalid-date{text-decoration:line-through;pointer-events:none;color:#a9a9a9}:host::ng-deep .md-drppicker td.available.today:not(.invalid-date){text-decoration:unset;pointer-events:unset;color:unset}.wrapper{min-width:200px}.btn-primary{line-height:18px!important}.filter-label{color:var(--Gray-500, #667085)!important;font-size:14px;font-style:normal;font-weight:600;line-height:20px;text-transform:capitalize}.position-relative{position:relative}.filter-icon{cursor:pointer}.dropdown-container{position:relative;display:inline-block;width:100%}.dropdown-header{cursor:pointer;width:100%}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize;width:100%;box-sizing:border-box}.dropdown-menu{position:absolute;top:100%;left:0;right:0;border:1px solid #ccc;background-color:#fff;z-index:1000;max-height:230px;overflow-y:auto;display:block;box-sizing:border-box;padding:10px 5px}.dropdown-item{padding:6px 0}.dropdown-item:hover{background-color:#f1f1f1}.dropdown-item input[type=checkbox]{margin-right:10px}.custom-dropdown-menu{border-radius:4px;box-shadow:0 1px 2px #1018280d}.custom-dropdown-item{display:flex;align-items:center}.custom-dropdown-item input{margin-left:10px}.btn-resize{font-size:13px!important;height:29px!important;line-height:11px!important;padding:3px!important}.dropdown2{position:absolute;top:70px;min-width:270px!important}.dropdown2 .dropdown-title{color:var(--Gray-900, #101828);font-size:14px;font-weight:600;line-height:24px}.dropdown2 .dropdown{position:relative;display:inline-block}.dropdown2 .dropdown span{color:var(--Gray-700, #344054);font-size:14px;font-weight:600;line-height:20px}.form-check-label{color:var(--Gray-700, #344054)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px}input[type=checkbox]{width:16px!important;height:16px!important;margin:0 5px;border-radius:4px!important;-webkit-appearance:none;-moz-appearance:none;-o-appearance:none;appearance:none;outline:1px solid var(--gray-300, #D0D5DD);box-shadow:none;font-size:.8em;text-align:center;line-height:1em;background:#fff}input[type=checkbox]:checked{outline:1px solid var(--primary-600, #00A3FF);background-color:var(--primary-50, #EAF8FF)}input[type=checkbox]:checked:after{content:\"\";transform:rotate(45deg);border-bottom:2px solid #00A3FF;border-right:2px solid #00A3FF;display:inline-block;width:.2em;padding-left:0;padding-top:9px;padding-right:4px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CustomSelectComponent, selector: "lib-select", inputs: ["items", "searchField", "multi", "idField", "selectedValues", "disabled", "label"], outputs: ["selected"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i7.DaterangepickerDirective, selector: "input[ngxDaterangepickerMd]", inputs: ["minDate", "maxDate", "autoApply", "alwaysShowCalendars", "showCustomRangeLabel", "linkedCalendars", "dateLimit", "singleDatePicker", "showWeekNumbers", "showISOWeekNumbers", "showDropdowns", "isInvalidDate", "isCustomDate", "isTooltipDate", "showClearButton", "customRangeDirection", "ranges", "opens", "drops", "firstMonthDayClass", "lastMonthDayClass", "emptyWeekRowClass", "emptyWeekColumnClass", "firstDayOfNextMonthClass", "lastDayOfPreviousMonthClass", "keepCalendarOpeningWithRange", "showRangeLabelOnInput", "showCancel", "lockStartDate", "timePicker", "timePicker24Hour", "timePickerIncrement", "timePickerSeconds", "closeOnAutoApply", "endKeyHolder", "startKey", "locale", "endKey"], outputs: ["change", "rangeClicked", "datesUpdated", "startDateChanged", "endDateChanged", "clearClicked"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
|
|
8062
8151
|
}
|
|
8063
8152
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MetricsHeaderComponent, decorators: [{
|
|
8064
8153
|
type: Component,
|
|
8065
|
-
args: [{ selector: 'lib-metrics-header', template: "<div class=\"me-3\">\r\n <label *ngIf=\"selectedCountriesLabel()\" class=\"badge badge-light-default mx-2\">{{selectedCountriesLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeCountry()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedLocationsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedLocationsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeLocation()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedGroupsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedGroupsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label class=\"badge badge-light-default\">{{selectedStoresLabel()}}</label>\r\n <label class=\"badge badge-light-default mx-2\">{{selectedZonesLabel()}} \r\n <!-- <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span> -->\r\n </label>\r\n</div>\r\n\r\n\r\n<div class=\"wrapper me-3\" *ngIf=\"(gs.userAccess | async)?.userType === 'tango'\">\r\n<lib-select [items]=\"clientList\" [multi]=\"false\" [searchField]=\"'clientName'\" [disabled]=\"false\" [idField]=\"'clientId'\"\r\n(selected)=\"onClientSelect($event)\" [selectedValues]=\"[selectedClient]\"></lib-select>\r\n</div>\r\n<div class=\"d-flex align-items-center position-relative my-1\">\r\n <span class=\"svg-icon svg-icon-1 position-absolute ms-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M13.3333 1.66663V4.99996M6.66667 1.66663V4.99996M2.5 8.33329H17.5M4.16667 3.33329H15.8333C16.7538 3.33329 17.5 4.07948 17.5 4.99996V16.6666C17.5 17.5871 16.7538 18.3333 15.8333 18.3333H4.16667C3.24619 18.3333 2.5 17.5871 2.5 16.6666V4.99996C2.5 4.07948 3.24619 3.33329 4.16667 3.33329Z\"\r\n stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </span>\r\n <input class=\"fx-date-range form-control ps-14\" style=\"min-width: 260px !important;\" type=\"text\" matInput\r\n ngxDaterangepickerMd [drops]=\"'down'\" [opens]=\"'right'\" [ranges]=\"ranges\" [showCustomRangeLabel]=\"true\" [autoApply]=\"true\"\r\n [alwaysShowCalendars]=\"false\" [keepCalendarOpeningWithRange]=\"true\" [showCancel]=\"true\" autocomplete=\"off\"\r\n [(ngModel)]=\"selectedDateRange\" (startDateChanged)=\"onStartDateChange($event)\" [isCustomDate]=\"isCustomDate\"\r\n [locale]=\"{ format: 'DD-MM-YYYY', firstDay: 1, monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }\"\r\n (datesUpdated)=\"datechange($event)\" name=\"daterange\" [readonly]=\"true\" />\r\n</div>\r\n<div class=\"position-relative\">\r\n <button type=\"button\" (click)=\"opendropdown($event)\" class=\"btn btn-default mx-2 rounded-3 text-nowrap border-val\">\r\n <!-- <span class=\"me-2\">Filter</span> -->\r\n <svg class=\"pl-3\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M5 10H15M2.5 5H17.5M7.5 15H12.5\" stroke=\"#344054\" stroke-width=\"2\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n\r\n <div *ngIf=\"Opendropdown\" class=\"card p-5 dropdown2 position-absolute z-1 end-0\" style=\"z-index: 1 !important;\" (clickOutside)=\"closeDropdown1()\">\r\n <div class=\"dropdown-title d-flex justify-content-between mb-2\">Filter Options\r\n <button class=\"btn btn-outline w-25 ms-3 btn-resize\" (click)=\"Reset()\"> Reset </button>\r\n <button class=\"btn btn-primary w-25 btn-resize\" (click)=\"Apply()\">Apply</button>\r\n </div>\r\n\r\n <!-- Country Dropdown -->\r\n<div class=\"dropdown-container\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('country')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedCountriesLabel()\"\r\n readonly\r\n placeholder=\"Select country\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'country'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search country\" \r\n [(ngModel)]=\"searchCountryText\" \r\n (ngModelChange)=\"filterCountries()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllCountries\" \r\n [checked]=\"isAllCountriesSelected()\" \r\n (change)=\"toggleSelectAllCountries($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllCountries\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let country of filteredCountries\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"country.country\" \r\n [(ngModel)]=\"country.checked\"\r\n (change)=\"updateSelectedCountries()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"country.country\">\r\n {{ country.country }}\r\n </label>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n\r\n <!-- Location Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('location')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedLocationsLabel()\"\r\n readonly\r\n placeholder=\"Select Region\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'location'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search Region\" \r\n [(ngModel)]=\"searchLocationText\" \r\n (ngModelChange)=\"filterLocations()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllLocations\" \r\n [checked]=\"isAllLocationsSelected()\" \r\n (change)=\"toggleSelectAllLocations($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllLocations\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let location of filteredLocations\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"location.city\" \r\n [(ngModel)]=\"location.checked\"\r\n (change)=\"updateSelectedLocations()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"location.city\">\r\n {{ location.city }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Group Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('group')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedGroupsLabel()\" readonly\r\n placeholder=\"Select clusters\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'group'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search clusters\" \r\n [(ngModel)]=\"searchGroupText\" \r\n (ngModelChange)=\"filterGroups()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllGroups\" \r\n [checked]=\"isAllGroupsSelected()\" \r\n (change)=\"toggleSelectAllGroups($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllGroups\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let group of filteredGroups\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"group.groupName\"\r\n [(ngModel)]=\"group.checked\"\r\n (change)=\"updateSelectedGroups()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"group.groupName\">\r\n {{ group.groupName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<!-- Store Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('store')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedStoresLabel()\"\r\n readonly\r\n placeholder=\"Select stores\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'store'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search stores\" \r\n [(ngModel)]=\"searchStoreText\" \r\n (ngModelChange)=\"filterStores()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllStores\" \r\n [checked]=\"isAllStoresSelected()\" \r\n (change)=\"toggleSelectAllStores($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllStores\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let store of filteredStores\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"store.storeId\"\r\n [(ngModel)]=\"store.checked\"\r\n (change)=\"updateSelectedStores()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"store.storeId\">\r\n {{ store.storeName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Zone Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('zone')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedZonesLabel()\"\r\n readonly\r\n placeholder=\"Select zones\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'zone'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search zones\" \r\n [(ngModel)]=\"searchZoneText\" \r\n (ngModelChange)=\"filterZones()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllZones\" \r\n [checked]=\"isAllZonesSelected()\" \r\n (change)=\"toggleSelectAllZones($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllZones\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let zone of filteredZones\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"zone._id\"\r\n [(ngModel)]=\"zone.checked\"\r\n (change)=\"updateSelectedZones()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"zone._id\">\r\n {{ zone.tagName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div>", styles: [".daterangepicker{display:block!important;top:153.85px!important;left:900px!important;right:0}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize}::ng-deep .applyBtn{display:none!important}:host::ng-deep .md-drppicker .btn{line-height:10px!important}:host::ng-deep .daterangepicker-input+.ngx-daterangepicker-material .applyBtn{display:none}:host::ng-deep .md-drppicker.drops-down-right.ltr.double.show-ranges.shown{top:65px!important;left:-470px!important;height:365px!important}:host::ng-deep .md-drppicker .btn{border-radius:8px!important;border:1px solid var(--Primary-600, #00A3FF)!important;background:var(--Primary-600, #00A3FF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--White, #FFF)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize}:host::ng-deep .md-drppicker .ranges ul li button{padding:12px 16px;width:160px;color:var(--Gray-700, #344054);font-size:14px;font-weight:400;line-height:20px;background:none;border:none;text-align:left;cursor:pointer}:host::ng-deep .md-drppicker td.active,:host::ng-deep .md-drppicker td.active:hover{background-color:#029cf4!important;border-radius:20px!important;color:var(--White, #FFF)!important;text-align:center!important;font-size:14px!important;font-weight:500!important;line-height:20px}:host::ng-deep .md-drppicker.ltr .ranges{float:left;margin-top:10px!important}:host::ng-deep .md-drppicker td.in-range{background:var(--Primary-50, #EAF8FF)}:host::ng-deep .md-drppicker .ranges ul li button.active{background:var(--Primary-50, #EAF8FF)!important;border-radius:8px!important;color:var(--Primary-700, #009BF3);font-size:14px!important;font-weight:500!important;line-height:20px!important}:host::ng-deep table th,:host::ng-deep table td{width:40px!important;height:40px!important;padding:10px 8px!important}:host::ng-deep .md-drppicker td.available.prev,:host::ng-deep .md-drppicker th.available.prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep .md-drppicker td.available.next,:host::ng-deep .md-drppicker th.available.next{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep table th{border-bottom:0px solid var(--Gray-200, #EAECF0)!important;background:transparent!important;color:var(--Gray-700, #344054)!important;text-align:center;font-size:16px!important;font-weight:500!important;line-height:24px}:host::ng-deep .md-drppicker .btn.btn-default{border-radius:8px!important;border:1px solid var(--Gray-300, #D0D5DD)!important;background:var(--White, #FFF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize;margin-right:10px!important}:host::ng-deep .md-drppicker td.available.invalid-date{text-decoration:line-through;pointer-events:none;color:#a9a9a9}:host::ng-deep .md-drppicker td.available.today:not(.invalid-date){text-decoration:unset;pointer-events:unset;color:unset}.wrapper{min-width:200px}.btn-primary{line-height:18px!important}.filter-label{color:var(--Gray-500, #667085)!important;font-size:14px;font-style:normal;font-weight:600;line-height:20px;text-transform:capitalize}.position-relative{position:relative}.filter-icon{cursor:pointer}.dropdown-container{position:relative;display:inline-block;width:100%}.dropdown-header{cursor:pointer;width:100%}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize;width:100%;box-sizing:border-box}.dropdown-menu{position:absolute;top:100%;left:0;right:0;border:1px solid #ccc;background-color:#fff;z-index:1000;max-height:230px;overflow-y:auto;display:block;box-sizing:border-box;padding:10px 5px}.dropdown-item{padding:6px 0}.dropdown-item:hover{background-color:#f1f1f1}.dropdown-item input[type=checkbox]{margin-right:10px}.custom-dropdown-menu{border-radius:4px;box-shadow:0 1px 2px #1018280d}.custom-dropdown-item{display:flex;align-items:center}.custom-dropdown-item input{margin-left:10px}.btn-resize{font-size:13px!important;height:29px!important;line-height:11px!important;padding:3px!important}.dropdown2{position:absolute;top:70px;min-width:270px!important}.dropdown2 .dropdown-title{color:var(--Gray-900, #101828);font-size:14px;font-weight:600;line-height:24px}.dropdown2 .dropdown{position:relative;display:inline-block}.dropdown2 .dropdown span{color:var(--Gray-700, #344054);font-size:14px;font-weight:600;line-height:20px}.form-check-label{color:var(--Gray-700, #344054)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px}input[type=checkbox]{width:16px!important;height:16px!important;margin:0 5px;border-radius:4px!important;-webkit-appearance:none;-moz-appearance:none;-o-appearance:none;appearance:none;outline:1px solid var(--gray-300, #D0D5DD);box-shadow:none;font-size:.8em;text-align:center;line-height:1em;background:#fff}input[type=checkbox]:checked{outline:1px solid var(--primary-600, #00A3FF);background-color:var(--primary-50, #EAF8FF)}input[type=checkbox]:checked:after{content:\"\";transform:rotate(45deg);border-bottom:2px solid #00A3FF;border-right:2px solid #00A3FF;display:inline-block;width:.2em;padding-left:0;padding-top:9px;padding-right:4px}\n"] }]
|
|
8154
|
+
args: [{ selector: "lib-metrics-header", template: "<div class=\"me-3\">\r\n <label *ngIf=\"selectedCountriesLabel()\" class=\"badge badge-light-default mx-2\">{{selectedCountriesLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeCountry()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedLocationsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedLocationsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeLocation()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedGroupsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedGroupsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label class=\"badge badge-light-default\">{{selectedStoresLabel()}}</label>\r\n <label class=\"badge badge-light-default mx-2\">{{selectedZonesLabel()}} \r\n <!-- <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span> -->\r\n </label>\r\n</div>\r\n\r\n\r\n<div class=\"wrapper me-3\" *ngIf=\"(gs.userAccess | async)?.userType === 'tango'\">\r\n<lib-select [items]=\"clientList\" [multi]=\"false\" [searchField]=\"'clientName'\" [disabled]=\"false\" [idField]=\"'clientId'\"\r\n(selected)=\"onClientSelect($event)\" [selectedValues]=\"[selectedClient]\"></lib-select>\r\n</div>\r\n<div class=\"d-flex align-items-center position-relative my-1\">\r\n <span class=\"svg-icon svg-icon-1 position-absolute ms-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M13.3333 1.66663V4.99996M6.66667 1.66663V4.99996M2.5 8.33329H17.5M4.16667 3.33329H15.8333C16.7538 3.33329 17.5 4.07948 17.5 4.99996V16.6666C17.5 17.5871 16.7538 18.3333 15.8333 18.3333H4.16667C3.24619 18.3333 2.5 17.5871 2.5 16.6666V4.99996C2.5 4.07948 3.24619 3.33329 4.16667 3.33329Z\"\r\n stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </span>\r\n <input class=\"fx-date-range form-control ps-14\" style=\"min-width: 260px !important;\" type=\"text\" matInput\r\n ngxDaterangepickerMd [drops]=\"'down'\" [opens]=\"'right'\" [ranges]=\"ranges\" [showCustomRangeLabel]=\"true\" [autoApply]=\"true\"\r\n [alwaysShowCalendars]=\"false\" [keepCalendarOpeningWithRange]=\"true\" [showCancel]=\"true\" autocomplete=\"off\"\r\n [(ngModel)]=\"selectedDateRange\" (startDateChanged)=\"onStartDateChange($event)\" [isCustomDate]=\"isCustomDate\"\r\n [locale]=\"{ format: 'DD-MM-YYYY', firstDay: 1, monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }\"\r\n (datesUpdated)=\"datechange($event)\" name=\"daterange\" [readonly]=\"true\" />\r\n</div>\r\n<div class=\"position-relative\">\r\n <button type=\"button\" (click)=\"opendropdown($event)\" class=\"btn btn-default mx-2 rounded-3 text-nowrap border-val\">\r\n <!-- <span class=\"me-2\">Filter</span> -->\r\n <svg class=\"pl-3\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M5 10H15M2.5 5H17.5M7.5 15H12.5\" stroke=\"#344054\" stroke-width=\"2\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n\r\n <div *ngIf=\"Opendropdown\" class=\"card p-5 dropdown2 position-absolute z-1 end-0\" style=\"z-index: 1 !important;\" (clickOutside)=\"closeDropdown1()\">\r\n <div class=\"dropdown-title d-flex justify-content-between mb-2\">Filter Options\r\n <button class=\"btn btn-outline w-25 ms-3 btn-resize\" (click)=\"Reset()\"> Reset </button>\r\n <button class=\"btn btn-primary w-25 btn-resize\" (click)=\"Apply()\">Apply</button>\r\n </div>\r\n\r\n <!-- Country Dropdown -->\r\n<div class=\"dropdown-container\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('country')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedCountriesLabel()\"\r\n readonly\r\n placeholder=\"Select country\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'country'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search country\" \r\n [(ngModel)]=\"searchCountryText\" \r\n (ngModelChange)=\"filterCountries()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllCountries\" \r\n [checked]=\"isAllCountriesSelected()\" \r\n (change)=\"toggleSelectAllCountries($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllCountries\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let country of filteredCountries\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"country.country\" \r\n [(ngModel)]=\"country.checked\"\r\n (change)=\"updateSelectedCountries()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"country.country\">\r\n {{ country.country }}\r\n </label>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n\r\n <!-- Location Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('location')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedLocationsLabel()\"\r\n readonly\r\n placeholder=\"Select Region\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'location'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search Region\" \r\n [(ngModel)]=\"searchLocationText\" \r\n (ngModelChange)=\"filterLocations()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllLocations\" \r\n [checked]=\"isAllLocationsSelected()\" \r\n (change)=\"toggleSelectAllLocations($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllLocations\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let location of filteredLocations\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"location.city\" \r\n [(ngModel)]=\"location.checked\"\r\n (change)=\"updateSelectedLocations()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"location.city\">\r\n {{ location.city }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Group Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('group')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedGroupsLabel()\" readonly\r\n placeholder=\"Select clusters\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'group'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search clusters\" \r\n [(ngModel)]=\"searchGroupText\" \r\n (ngModelChange)=\"filterGroups()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllGroups\" \r\n [checked]=\"isAllGroupsSelected()\" \r\n (change)=\"toggleSelectAllGroups($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllGroups\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let group of filteredGroups\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"group.groupName\"\r\n [(ngModel)]=\"group.checked\"\r\n (change)=\"updateSelectedGroups()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"group.groupName\">\r\n {{ group.groupName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<!-- Store Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('store')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedStoresLabel()\"\r\n readonly\r\n placeholder=\"Select stores\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'store'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search stores\" \r\n [(ngModel)]=\"searchStoreText\" \r\n (ngModelChange)=\"filterStores()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllStores\" \r\n [checked]=\"isAllStoresSelected()\" \r\n (change)=\"toggleSelectAllStores($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllStores\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let store of filteredStores\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"store.storeId\"\r\n [(ngModel)]=\"store.checked\"\r\n (change)=\"updateSelectedStores()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"store.storeId\">\r\n {{ store.storeName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Zone Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('zone')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedZonesLabel()\"\r\n readonly\r\n placeholder=\"Select zones\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'zone'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search zones\" \r\n [(ngModel)]=\"searchZoneText\" \r\n (ngModelChange)=\"filterZones()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllZones\" \r\n [checked]=\"isAllZonesSelected()\" \r\n (change)=\"toggleSelectAllZones($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllZones\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let zone of filteredZones\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"zone._id\"\r\n [(ngModel)]=\"zone.checked\"\r\n (change)=\"updateSelectedZones(zone._id)\"\r\n />\r\n <label class=\"form-check-label\" [for]=\"zone._id\">\r\n {{ zone.tagName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div>", styles: [".daterangepicker{display:block!important;top:153.85px!important;left:900px!important;right:0}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize}::ng-deep .applyBtn{display:none!important}:host::ng-deep .md-drppicker .btn{line-height:10px!important}:host::ng-deep .daterangepicker-input+.ngx-daterangepicker-material .applyBtn{display:none}:host::ng-deep .md-drppicker.drops-down-right.ltr.double.show-ranges.shown{top:65px!important;left:-470px!important;height:365px!important}:host::ng-deep .md-drppicker .btn{border-radius:8px!important;border:1px solid var(--Primary-600, #00A3FF)!important;background:var(--Primary-600, #00A3FF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--White, #FFF)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize}:host::ng-deep .md-drppicker .ranges ul li button{padding:12px 16px;width:160px;color:var(--Gray-700, #344054);font-size:14px;font-weight:400;line-height:20px;background:none;border:none;text-align:left;cursor:pointer}:host::ng-deep .md-drppicker td.active,:host::ng-deep .md-drppicker td.active:hover{background-color:#029cf4!important;border-radius:20px!important;color:var(--White, #FFF)!important;text-align:center!important;font-size:14px!important;font-weight:500!important;line-height:20px}:host::ng-deep .md-drppicker.ltr .ranges{float:left;margin-top:10px!important}:host::ng-deep .md-drppicker td.in-range{background:var(--Primary-50, #EAF8FF)}:host::ng-deep .md-drppicker .ranges ul li button.active{background:var(--Primary-50, #EAF8FF)!important;border-radius:8px!important;color:var(--Primary-700, #009BF3);font-size:14px!important;font-weight:500!important;line-height:20px!important}:host::ng-deep table th,:host::ng-deep table td{width:40px!important;height:40px!important;padding:10px 8px!important}:host::ng-deep .md-drppicker td.available.prev,:host::ng-deep .md-drppicker th.available.prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep .md-drppicker td.available.next,:host::ng-deep .md-drppicker th.available.next{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep table th{border-bottom:0px solid var(--Gray-200, #EAECF0)!important;background:transparent!important;color:var(--Gray-700, #344054)!important;text-align:center;font-size:16px!important;font-weight:500!important;line-height:24px}:host::ng-deep .md-drppicker .btn.btn-default{border-radius:8px!important;border:1px solid var(--Gray-300, #D0D5DD)!important;background:var(--White, #FFF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize;margin-right:10px!important}:host::ng-deep .md-drppicker td.available.invalid-date{text-decoration:line-through;pointer-events:none;color:#a9a9a9}:host::ng-deep .md-drppicker td.available.today:not(.invalid-date){text-decoration:unset;pointer-events:unset;color:unset}.wrapper{min-width:200px}.btn-primary{line-height:18px!important}.filter-label{color:var(--Gray-500, #667085)!important;font-size:14px;font-style:normal;font-weight:600;line-height:20px;text-transform:capitalize}.position-relative{position:relative}.filter-icon{cursor:pointer}.dropdown-container{position:relative;display:inline-block;width:100%}.dropdown-header{cursor:pointer;width:100%}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize;width:100%;box-sizing:border-box}.dropdown-menu{position:absolute;top:100%;left:0;right:0;border:1px solid #ccc;background-color:#fff;z-index:1000;max-height:230px;overflow-y:auto;display:block;box-sizing:border-box;padding:10px 5px}.dropdown-item{padding:6px 0}.dropdown-item:hover{background-color:#f1f1f1}.dropdown-item input[type=checkbox]{margin-right:10px}.custom-dropdown-menu{border-radius:4px;box-shadow:0 1px 2px #1018280d}.custom-dropdown-item{display:flex;align-items:center}.custom-dropdown-item input{margin-left:10px}.btn-resize{font-size:13px!important;height:29px!important;line-height:11px!important;padding:3px!important}.dropdown2{position:absolute;top:70px;min-width:270px!important}.dropdown2 .dropdown-title{color:var(--Gray-900, #101828);font-size:14px;font-weight:600;line-height:24px}.dropdown2 .dropdown{position:relative;display:inline-block}.dropdown2 .dropdown span{color:var(--Gray-700, #344054);font-size:14px;font-weight:600;line-height:20px}.form-check-label{color:var(--Gray-700, #344054)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px}input[type=checkbox]{width:16px!important;height:16px!important;margin:0 5px;border-radius:4px!important;-webkit-appearance:none;-moz-appearance:none;-o-appearance:none;appearance:none;outline:1px solid var(--gray-300, #D0D5DD);box-shadow:none;font-size:.8em;text-align:center;line-height:1em;background:#fff}input[type=checkbox]:checked{outline:1px solid var(--primary-600, #00A3FF);background-color:var(--primary-50, #EAF8FF)}input[type=checkbox]:checked:after{content:\"\";transform:rotate(45deg);border-bottom:2px solid #00A3FF;border-right:2px solid #00A3FF;display:inline-block;width:.2em;padding-left:0;padding-top:9px;padding-right:4px}\n"] }]
|
|
8066
8155
|
}], ctorParameters: () => [{ type: AuthService }, { type: i2.Router }, { type: i1.GlobalStateService }, { type: i0.ChangeDetectorRef }], propDecorators: { onClick: [{
|
|
8067
8156
|
type: HostListener,
|
|
8068
|
-
args: [
|
|
8157
|
+
args: ["document:click", ["$event"]]
|
|
8069
8158
|
}], clickOutside: [{
|
|
8070
8159
|
type: HostListener,
|
|
8071
8160
|
args: ["document:click", ["$event"]]
|