tango-app-ui-shared 3.0.9 → 3.0.11-dev
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/classic/classic.component.mjs +18 -17
- package/esm2022/lib/modules/layout/toolbar/date-single-select/date-single-select.component.mjs +17 -16
- package/esm2022/lib/modules/layout/toolbar/datepicker/datepicker.component.mjs +19 -18
- package/esm2022/lib/modules/layout/toolbar/single-store/single-store.component.mjs +17 -16
- package/esm2022/lib/modules/layout/toolbar/toolbar.component.mjs +21 -13
- package/fesm2022/tango-app-ui-shared.mjs +91 -80
- package/fesm2022/tango-app-ui-shared.mjs.map +1 -1
- package/lib/modules/layout/toolbar/classic/classic.component.d.ts +2 -1
- package/lib/modules/layout/toolbar/date-single-select/date-single-select.component.d.ts +2 -1
- package/lib/modules/layout/toolbar/datepicker/datepicker.component.d.ts +2 -1
- package/lib/modules/layout/toolbar/single-store/single-store.component.d.ts +2 -1
- package/lib/modules/layout/toolbar/toolbar.component.d.ts +5 -1
- package/package.json +1 -1
|
@@ -8,11 +8,11 @@ import * as i2 from '@angular/common';
|
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
9
|
import { filter } from 'rxjs/operators';
|
|
10
10
|
import * as i3 from '@angular/platform-browser';
|
|
11
|
-
import
|
|
11
|
+
import { BehaviorSubject, throwError, map, catchError } from 'rxjs';
|
|
12
|
+
import dayjs from 'dayjs';
|
|
12
13
|
import 'dayjs/locale/en';
|
|
13
14
|
import utc from 'dayjs/plugin/utc';
|
|
14
15
|
import timezone from 'dayjs/plugin/timezone';
|
|
15
|
-
import { BehaviorSubject, throwError, map, catchError } from 'rxjs';
|
|
16
16
|
import * as i3$1 from '@angular/common/http';
|
|
17
17
|
import * as i4 from '@angular/forms';
|
|
18
18
|
import { FormsModule } from '@angular/forms';
|
|
@@ -1539,6 +1539,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
1539
1539
|
args: [{ selector: 'lib-scripts-init', template: "" }]
|
|
1540
1540
|
}], ctorParameters: () => [{ type: i1.LayoutService }, { type: i1.PageInfoService }, { type: i1$1.Router }, { type: i3.Title }] });
|
|
1541
1541
|
|
|
1542
|
+
class GlobalStateService {
|
|
1543
|
+
userData = new BehaviorSubject(null);
|
|
1544
|
+
environment = new BehaviorSubject(null);
|
|
1545
|
+
dataRangeValue = new BehaviorSubject(null);
|
|
1546
|
+
selectedClient = new BehaviorSubject(null);
|
|
1547
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1548
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalStateService, providedIn: 'root' });
|
|
1549
|
+
}
|
|
1550
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalStateService, decorators: [{
|
|
1551
|
+
type: Injectable,
|
|
1552
|
+
args: [{
|
|
1553
|
+
providedIn: 'root'
|
|
1554
|
+
}]
|
|
1555
|
+
}] });
|
|
1556
|
+
|
|
1542
1557
|
class PageTitleComponent {
|
|
1543
1558
|
pageInfo;
|
|
1544
1559
|
cd;
|
|
@@ -1584,21 +1599,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
1584
1599
|
type: Input
|
|
1585
1600
|
}] } });
|
|
1586
1601
|
|
|
1587
|
-
class GlobalStateService {
|
|
1588
|
-
userData = new BehaviorSubject(null);
|
|
1589
|
-
environment = new BehaviorSubject(null);
|
|
1590
|
-
dataRangeValue = new BehaviorSubject(null);
|
|
1591
|
-
selectedClient = new BehaviorSubject(null);
|
|
1592
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1593
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalStateService, providedIn: 'root' });
|
|
1594
|
-
}
|
|
1595
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalStateService, decorators: [{
|
|
1596
|
-
type: Injectable,
|
|
1597
|
-
args: [{
|
|
1598
|
-
providedIn: 'root'
|
|
1599
|
-
}]
|
|
1600
|
-
}] });
|
|
1601
|
-
|
|
1602
1602
|
class AuthService {
|
|
1603
1603
|
router;
|
|
1604
1604
|
gs;
|
|
@@ -1650,6 +1650,7 @@ class ClassicComponent {
|
|
|
1650
1650
|
globalService;
|
|
1651
1651
|
service;
|
|
1652
1652
|
cd;
|
|
1653
|
+
dayjs = dayjs;
|
|
1653
1654
|
unsubscribe = [];
|
|
1654
1655
|
dataObject = [{ Description: "Clients", Issues: [] }];
|
|
1655
1656
|
isCustomDate;
|
|
@@ -1718,8 +1719,8 @@ class ClassicComponent {
|
|
|
1718
1719
|
this.toggleCheckbox("Select All", 0);
|
|
1719
1720
|
this.dummyArray = JSON.parse(JSON.stringify(this.dataObject));
|
|
1720
1721
|
this.responseArray = JSON.parse(JSON.stringify(this.dataObject));
|
|
1721
|
-
this.selectedDateRange.startDate = dayjs().format("MM-DD-YYYY");
|
|
1722
|
-
this.selectedDateRange.endDate = dayjs().format("MM-DD-YYYY");
|
|
1722
|
+
this.selectedDateRange.startDate = this.dayjs().format("MM-DD-YYYY");
|
|
1723
|
+
this.selectedDateRange.endDate = this.dayjs().format("MM-DD-YYYY");
|
|
1723
1724
|
const currentIssues = this.dummyArray[0].Issues.map((item) => item.clientId);
|
|
1724
1725
|
this.selectedFilters.clients = currentIssues;
|
|
1725
1726
|
this.selectedFilters.date = this.selectedDateRange;
|
|
@@ -1873,35 +1874,35 @@ class ClassicComponent {
|
|
|
1873
1874
|
this.cd.detectChanges();
|
|
1874
1875
|
}
|
|
1875
1876
|
ranges = {
|
|
1876
|
-
Today: [dayjs(), dayjs()],
|
|
1877
|
-
Yesterday: [dayjs().subtract(1, "days"), dayjs().subtract(1, "days")],
|
|
1878
|
-
"This Week": [dayjs().subtract(6, "days"), dayjs()],
|
|
1877
|
+
"Today": [this.dayjs(), this.dayjs()],
|
|
1878
|
+
"Yesterday": [this.dayjs().subtract(1, "days"), this.dayjs().subtract(1, "days")],
|
|
1879
|
+
"This Week": [this.dayjs().subtract(6, "days"), dayjs()],
|
|
1879
1880
|
"Last Week": [
|
|
1880
|
-
dayjs().subtract(14, "days").startOf("days"),
|
|
1881
|
-
dayjs().subtract(8, "days").endOf("days"),
|
|
1881
|
+
this.dayjs().subtract(14, "days").startOf("days"),
|
|
1882
|
+
this.dayjs().subtract(8, "days").endOf("days"),
|
|
1882
1883
|
],
|
|
1883
|
-
"This Month": [dayjs().startOf("month"), dayjs().endOf("month")],
|
|
1884
|
+
"This Month": [this.dayjs().startOf("month"), this.dayjs().endOf("month")],
|
|
1884
1885
|
"Last Month": [
|
|
1885
|
-
dayjs().subtract(1, "month").startOf("month"),
|
|
1886
|
-
dayjs().subtract(1, "month").endOf("month"),
|
|
1886
|
+
this.dayjs().subtract(1, "month").startOf("month"),
|
|
1887
|
+
this.dayjs().subtract(1, "month").endOf("month"),
|
|
1887
1888
|
],
|
|
1888
1889
|
};
|
|
1889
1890
|
onStartDateChange(event) {
|
|
1890
|
-
if (dayjs(event.startDate).isValid()) {
|
|
1891
|
+
if (this.dayjs(event.startDate).isValid()) {
|
|
1891
1892
|
this.isCustomDate = (m) => {
|
|
1892
|
-
const isValidDate = m > dayjs() || m > dayjs(event.startDate.add(90, "days"));
|
|
1893
|
+
const isValidDate = m > this.dayjs() || m > this.dayjs(event.startDate.add(90, "days"));
|
|
1893
1894
|
return isValidDate ? "invalid-date" : false;
|
|
1894
1895
|
};
|
|
1895
1896
|
}
|
|
1896
1897
|
}
|
|
1897
1898
|
datechange(event) {
|
|
1898
1899
|
if (event && event.startDate && event.endDate) {
|
|
1899
|
-
if (dayjs(event.startDate).isValid() && dayjs(event.endDate).isValid()) {
|
|
1900
|
+
if (this.dayjs(event.startDate).isValid() && this.dayjs(event.endDate).isValid()) {
|
|
1900
1901
|
// Dates are valid, proceed with formatting
|
|
1901
|
-
this.selectedDateRange.startDate = dayjs(event.startDate)
|
|
1902
|
+
this.selectedDateRange.startDate = this.dayjs(event.startDate)
|
|
1902
1903
|
.utc()
|
|
1903
1904
|
.format("DD-MM-YYYY");
|
|
1904
|
-
this.selectedDateRange.endDate = dayjs(event.endDate)
|
|
1905
|
+
this.selectedDateRange.endDate = this.dayjs(event.endDate)
|
|
1905
1906
|
.utc()
|
|
1906
1907
|
.format("DD-MM-YYYY");
|
|
1907
1908
|
console.log(this.selectedDateRange);
|
|
@@ -2129,6 +2130,7 @@ class DatepickerComponent {
|
|
|
2129
2130
|
gs;
|
|
2130
2131
|
service;
|
|
2131
2132
|
cd;
|
|
2133
|
+
dayjs = dayjs;
|
|
2132
2134
|
unsubscribe = [];
|
|
2133
2135
|
isCustomDate;
|
|
2134
2136
|
selectedDateRange = {};
|
|
@@ -2160,25 +2162,25 @@ class DatepickerComponent {
|
|
|
2160
2162
|
// }
|
|
2161
2163
|
}
|
|
2162
2164
|
else {
|
|
2163
|
-
this.selectedDateRange.startDate = dayjs().format("MM-DD-YYYY");
|
|
2164
|
-
this.selectedDateRange.endDate = dayjs().format("MM-DD-YYYY");
|
|
2165
|
+
this.selectedDateRange.startDate = this.dayjs().format("MM-DD-YYYY");
|
|
2166
|
+
this.selectedDateRange.endDate = this.dayjs().format("MM-DD-YYYY");
|
|
2165
2167
|
}
|
|
2166
2168
|
}
|
|
2167
2169
|
ranges = {
|
|
2168
|
-
'Today': [dayjs(), dayjs()],
|
|
2169
|
-
'Yesterday': [dayjs().subtract(1, 'days'), dayjs().subtract(1, 'days')],
|
|
2170
|
-
'This Week': [dayjs().subtract(6, 'days'), dayjs()],
|
|
2171
|
-
'Last Week': [dayjs().subtract(14, 'days').startOf('days'), dayjs().subtract(8, 'days').endOf('days')],
|
|
2172
|
-
'This Month': [dayjs().startOf('month'), dayjs().endOf('month')],
|
|
2170
|
+
'Today': [this.dayjs(), this.dayjs()],
|
|
2171
|
+
'Yesterday': [this.dayjs().subtract(1, 'days'), this.dayjs().subtract(1, 'days')],
|
|
2172
|
+
'This Week': [this.dayjs().subtract(6, 'days'), this.dayjs()],
|
|
2173
|
+
'Last Week': [this.dayjs().subtract(14, 'days').startOf('days'), this.dayjs().subtract(8, 'days').endOf('days')],
|
|
2174
|
+
'This Month': [this.dayjs().startOf('month'), this.dayjs().endOf('month')],
|
|
2173
2175
|
'Last Month': [
|
|
2174
|
-
dayjs().subtract(1, 'month').startOf('month'),
|
|
2175
|
-
dayjs().subtract(1, 'month').endOf('month')
|
|
2176
|
+
this.dayjs().subtract(1, 'month').startOf('month'),
|
|
2177
|
+
this.dayjs().subtract(1, 'month').endOf('month')
|
|
2176
2178
|
]
|
|
2177
2179
|
};
|
|
2178
2180
|
onStartDateChange(event) {
|
|
2179
|
-
if (dayjs(event.startDate).isValid()) {
|
|
2181
|
+
if (this.dayjs(event.startDate).isValid()) {
|
|
2180
2182
|
this.isCustomDate = (m) => {
|
|
2181
|
-
const isValidDate = m > dayjs() || m > dayjs(event.startDate.add(90, 'days'));
|
|
2183
|
+
const isValidDate = m > this.dayjs() || m > this.dayjs(event.startDate.add(90, 'days'));
|
|
2182
2184
|
return isValidDate ? 'invalid-date' : false;
|
|
2183
2185
|
};
|
|
2184
2186
|
}
|
|
@@ -2186,10 +2188,10 @@ class DatepickerComponent {
|
|
|
2186
2188
|
datechange(event) {
|
|
2187
2189
|
// debugger
|
|
2188
2190
|
if (event && event.startDate && event.endDate) {
|
|
2189
|
-
if (dayjs(event.startDate).isValid() && dayjs(event.endDate).isValid()) {
|
|
2191
|
+
if (this.dayjs(event.startDate).isValid() && this.dayjs(event.endDate).isValid()) {
|
|
2190
2192
|
// Dates are valid, proceed with formatting
|
|
2191
|
-
this.selectedDateRange.startDate = dayjs(event.startDate).utc().format('DD-MM-YYYY');
|
|
2192
|
-
this.selectedDateRange.endDate = dayjs(event.endDate).utc().format('DD-MM-YYYY');
|
|
2193
|
+
this.selectedDateRange.startDate = this.dayjs(event.startDate).utc().format('DD-MM-YYYY');
|
|
2194
|
+
this.selectedDateRange.endDate = this.dayjs(event.endDate).utc().format('DD-MM-YYYY');
|
|
2193
2195
|
}
|
|
2194
2196
|
else {
|
|
2195
2197
|
// Dates are not valid, handle the scenario accordingly
|
|
@@ -2197,8 +2199,8 @@ class DatepickerComponent {
|
|
|
2197
2199
|
// If you want to fallback to stored filters when the dates are invalid, you can keep the existing logic
|
|
2198
2200
|
const storedFilters = JSON.parse(localStorage.getItem('header-filters') || '{}');
|
|
2199
2201
|
if (storedFilters.startDate && storedFilters.endDate) {
|
|
2200
|
-
this.selectedDateRange.startDate = dayjs(storedFilters.startDate).format('DD-MM-YYYY');
|
|
2201
|
-
this.selectedDateRange.endDate = dayjs(storedFilters.endDate).format('DD-MM-YYYY');
|
|
2202
|
+
this.selectedDateRange.startDate = this.dayjs(storedFilters.startDate).format('DD-MM-YYYY');
|
|
2203
|
+
this.selectedDateRange.endDate = this.dayjs(storedFilters.endDate).format('DD-MM-YYYY');
|
|
2202
2204
|
}
|
|
2203
2205
|
}
|
|
2204
2206
|
}
|
|
@@ -2226,6 +2228,7 @@ class DateSingleSelectComponent {
|
|
|
2226
2228
|
auth;
|
|
2227
2229
|
gs;
|
|
2228
2230
|
cd;
|
|
2231
|
+
dayjs = dayjs;
|
|
2229
2232
|
isCustomDate;
|
|
2230
2233
|
selectedDateRange = {};
|
|
2231
2234
|
clientList = [];
|
|
@@ -2286,8 +2289,8 @@ class DateSingleSelectComponent {
|
|
|
2286
2289
|
this.selectedDateRange.endDate = headerFilters.date.endDate;
|
|
2287
2290
|
}
|
|
2288
2291
|
else {
|
|
2289
|
-
this.selectedDateRange.startDate = dayjs().format('MM-DD-YYYY');
|
|
2290
|
-
this.selectedDateRange.endDate = dayjs().format('MM-DD-YYYY');
|
|
2292
|
+
this.selectedDateRange.startDate = this.dayjs().format('MM-DD-YYYY');
|
|
2293
|
+
this.selectedDateRange.endDate = this.dayjs().format('MM-DD-YYYY');
|
|
2291
2294
|
}
|
|
2292
2295
|
}
|
|
2293
2296
|
onClientSelect(event) {
|
|
@@ -2296,30 +2299,30 @@ class DateSingleSelectComponent {
|
|
|
2296
2299
|
this.cd.detectChanges();
|
|
2297
2300
|
}
|
|
2298
2301
|
ranges = {
|
|
2299
|
-
'Today': [dayjs(), dayjs()],
|
|
2300
|
-
'Yesterday': [dayjs().subtract(1, 'days'), dayjs().subtract(1, 'days')],
|
|
2301
|
-
'This Week': [dayjs().subtract(6, 'days'), dayjs()],
|
|
2302
|
-
'Last Week': [dayjs().subtract(14, 'days').startOf('days'), dayjs().subtract(8, 'days').endOf('days')],
|
|
2303
|
-
'This Month': [dayjs().startOf('month'), dayjs().endOf('month')],
|
|
2302
|
+
'Today': [this.dayjs(), this.dayjs()],
|
|
2303
|
+
'Yesterday': [this.dayjs().subtract(1, 'days'), this.dayjs().subtract(1, 'days')],
|
|
2304
|
+
'This Week': [this.dayjs().subtract(6, 'days'), this.dayjs()],
|
|
2305
|
+
'Last Week': [this.dayjs().subtract(14, 'days').startOf('days'), this.dayjs().subtract(8, 'days').endOf('days')],
|
|
2306
|
+
'This Month': [this.dayjs().startOf('month'), this.dayjs().endOf('month')],
|
|
2304
2307
|
'Last Month': [
|
|
2305
|
-
dayjs().subtract(1, 'month').startOf('month'),
|
|
2306
|
-
dayjs().subtract(1, 'month').endOf('month')
|
|
2308
|
+
this.dayjs().subtract(1, 'month').startOf('month'),
|
|
2309
|
+
this.dayjs().subtract(1, 'month').endOf('month')
|
|
2307
2310
|
]
|
|
2308
2311
|
};
|
|
2309
2312
|
onStartDateChange(event) {
|
|
2310
|
-
if (dayjs(event.startDate).isValid()) {
|
|
2313
|
+
if (this.dayjs(event.startDate).isValid()) {
|
|
2311
2314
|
this.isCustomDate = (m) => {
|
|
2312
|
-
const isValidDate = m > dayjs() || m > dayjs(event.startDate.add(90, 'days'));
|
|
2315
|
+
const isValidDate = m > this.dayjs() || m > this.dayjs(event.startDate.add(90, 'days'));
|
|
2313
2316
|
return isValidDate ? 'invalid-date' : false;
|
|
2314
2317
|
};
|
|
2315
2318
|
}
|
|
2316
2319
|
}
|
|
2317
2320
|
datechange(event) {
|
|
2318
2321
|
if (event && event.startDate && event.endDate) {
|
|
2319
|
-
if (dayjs(event.startDate).isValid() && dayjs(event.endDate).isValid()) {
|
|
2322
|
+
if (this.dayjs(event.startDate).isValid() && this.dayjs(event.endDate).isValid()) {
|
|
2320
2323
|
// Dates are valid, proceed with formatting
|
|
2321
|
-
this.selectedDateRange.startDate = dayjs(event.startDate).utc().format('DD-MM-YYYY');
|
|
2322
|
-
this.selectedDateRange.endDate = dayjs(event.endDate).utc().format('DD-MM-YYYY');
|
|
2324
|
+
this.selectedDateRange.startDate = this.dayjs(event.startDate).utc().format('DD-MM-YYYY');
|
|
2325
|
+
this.selectedDateRange.endDate = this.dayjs(event.endDate).utc().format('DD-MM-YYYY');
|
|
2323
2326
|
}
|
|
2324
2327
|
else {
|
|
2325
2328
|
// Dates are not valid, handle the scenario accordingly
|
|
@@ -2362,6 +2365,7 @@ class SingleStoreComponent {
|
|
|
2362
2365
|
auth;
|
|
2363
2366
|
gs;
|
|
2364
2367
|
cd;
|
|
2368
|
+
dayjs = dayjs;
|
|
2365
2369
|
isCustomDate;
|
|
2366
2370
|
selectedDateRange = {};
|
|
2367
2371
|
storeList = [];
|
|
@@ -2424,8 +2428,8 @@ class SingleStoreComponent {
|
|
|
2424
2428
|
this.cd.detectChanges();
|
|
2425
2429
|
}
|
|
2426
2430
|
else {
|
|
2427
|
-
this.selectedDateRange.startDate = dayjs().format('MM-DD-YYYY');
|
|
2428
|
-
this.selectedDateRange.endDate = dayjs().format('MM-DD-YYYY');
|
|
2431
|
+
this.selectedDateRange.startDate = this.dayjs().format('MM-DD-YYYY');
|
|
2432
|
+
this.selectedDateRange.endDate = this.dayjs().format('MM-DD-YYYY');
|
|
2429
2433
|
}
|
|
2430
2434
|
}
|
|
2431
2435
|
onClientSelect(event) {
|
|
@@ -2433,30 +2437,30 @@ class SingleStoreComponent {
|
|
|
2433
2437
|
this.gs.selectedClient.next(this.selectedClient);
|
|
2434
2438
|
}
|
|
2435
2439
|
ranges = {
|
|
2436
|
-
'Today': [dayjs(), dayjs()],
|
|
2437
|
-
'Yesterday': [dayjs().subtract(1, 'days'), dayjs().subtract(1, 'days')],
|
|
2438
|
-
'This Week': [dayjs().subtract(6, 'days'), dayjs()],
|
|
2439
|
-
'Last Week': [dayjs().subtract(14, 'days').startOf('days'), dayjs().subtract(8, 'days').endOf('days')],
|
|
2440
|
-
'This Month': [dayjs().startOf('month'), dayjs().endOf('month')],
|
|
2440
|
+
'Today': [this.dayjs(), this.dayjs()],
|
|
2441
|
+
'Yesterday': [this.dayjs().subtract(1, 'days'), this.dayjs().subtract(1, 'days')],
|
|
2442
|
+
'This Week': [this.dayjs().subtract(6, 'days'), this.dayjs()],
|
|
2443
|
+
'Last Week': [this.dayjs().subtract(14, 'days').startOf('days'), this.dayjs().subtract(8, 'days').endOf('days')],
|
|
2444
|
+
'This Month': [this.dayjs().startOf('month'), this.dayjs().endOf('month')],
|
|
2441
2445
|
'Last Month': [
|
|
2442
|
-
dayjs().subtract(1, 'month').startOf('month'),
|
|
2443
|
-
dayjs().subtract(1, 'month').endOf('month')
|
|
2446
|
+
this.dayjs().subtract(1, 'month').startOf('month'),
|
|
2447
|
+
this.dayjs().subtract(1, 'month').endOf('month')
|
|
2444
2448
|
]
|
|
2445
2449
|
};
|
|
2446
2450
|
onStartDateChange(event) {
|
|
2447
|
-
if (dayjs(event.startDate).isValid()) {
|
|
2451
|
+
if (this.dayjs(event.startDate).isValid()) {
|
|
2448
2452
|
this.isCustomDate = (m) => {
|
|
2449
|
-
const isValidDate = m > dayjs() || m > dayjs(event.startDate.add(90, 'days'));
|
|
2453
|
+
const isValidDate = m > this.dayjs() || m > this.dayjs(event.startDate.add(90, 'days'));
|
|
2450
2454
|
return isValidDate ? 'invalid-date' : false;
|
|
2451
2455
|
};
|
|
2452
2456
|
}
|
|
2453
2457
|
}
|
|
2454
2458
|
datechange(event) {
|
|
2455
2459
|
if (event && event.startDate && event.endDate) {
|
|
2456
|
-
if (dayjs(event.startDate).isValid() && dayjs(event.endDate).isValid()) {
|
|
2460
|
+
if (this.dayjs(event.startDate).isValid() && this.dayjs(event.endDate).isValid()) {
|
|
2457
2461
|
// Dates are valid, proceed with formatting
|
|
2458
|
-
this.selectedDateRange.startDate = dayjs(event.startDate).utc().format('DD-MM-YYYY');
|
|
2459
|
-
this.selectedDateRange.endDate = dayjs(event.endDate).utc().format('DD-MM-YYYY');
|
|
2462
|
+
this.selectedDateRange.startDate = this.dayjs(event.startDate).utc().format('DD-MM-YYYY');
|
|
2463
|
+
this.selectedDateRange.endDate = this.dayjs(event.endDate).utc().format('DD-MM-YYYY');
|
|
2460
2464
|
}
|
|
2461
2465
|
else {
|
|
2462
2466
|
// Dates are not valid, handle the scenario accordingly
|
|
@@ -2499,6 +2503,7 @@ class ToolbarComponent {
|
|
|
2499
2503
|
layout;
|
|
2500
2504
|
router;
|
|
2501
2505
|
route;
|
|
2506
|
+
gs;
|
|
2502
2507
|
unsubscribe = [];
|
|
2503
2508
|
// Public props
|
|
2504
2509
|
currentLayoutType;
|
|
@@ -2521,12 +2526,18 @@ class ToolbarComponent {
|
|
|
2521
2526
|
datepicker;
|
|
2522
2527
|
singleSelectdatepicker;
|
|
2523
2528
|
singleStore;
|
|
2524
|
-
|
|
2529
|
+
headervalue;
|
|
2530
|
+
storeId;
|
|
2531
|
+
constructor(layout, router, route, gs) {
|
|
2525
2532
|
this.layout = layout;
|
|
2526
2533
|
this.router = router;
|
|
2527
2534
|
this.route = route;
|
|
2535
|
+
this.gs = gs;
|
|
2528
2536
|
}
|
|
2529
2537
|
ngOnInit() {
|
|
2538
|
+
this.gs.dataRangeValue.subscribe((res) => {
|
|
2539
|
+
this.storeId = res.store;
|
|
2540
|
+
});
|
|
2530
2541
|
this.route.queryParams.subscribe((queryParams) => {
|
|
2531
2542
|
this.querParams = queryParams;
|
|
2532
2543
|
});
|
|
@@ -2602,7 +2613,7 @@ class ToolbarComponent {
|
|
|
2602
2613
|
this.singleStore = false;
|
|
2603
2614
|
this.singleSelectdatepicker = true;
|
|
2604
2615
|
}
|
|
2605
|
-
else if (this.router.url ==
|
|
2616
|
+
else if (this.router.url == `/manage/stores/${this.storeId}/infra-ticket` || this.router.url == `/manage/stores/${this.storeId}/settings`) {
|
|
2606
2617
|
this.singleSelect = false;
|
|
2607
2618
|
this.multiSelect = false;
|
|
2608
2619
|
this.datepicker = false;
|
|
@@ -2620,13 +2631,13 @@ class ToolbarComponent {
|
|
|
2620
2631
|
return (this.appPageTitleDisplay &&
|
|
2621
2632
|
viewsWithPageTitles.some((t) => t === this.appToolbarLayout));
|
|
2622
2633
|
}
|
|
2623
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1.LayoutService }, { token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
2634
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1.LayoutService }, { token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: GlobalStateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2624
2635
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: ToolbarComponent, selector: "lib-toolbar", inputs: { currentLayoutType: "currentLayoutType", appToolbarLayout: "appToolbarLayout" }, ngImport: i0, template: "<!--begin::Toolbar container-->\r\n<div id=\"kt_app_toolbar_container\" class=\"app-container\" [ngClass]=\"appToolbarContainerCSSClass\">\r\n <ng-container *ngIf=\"showPageTitle()\">\r\n <lib-page-title [appPageTitleDirection]=\"appPageTitleDirection\" [appPageTitleBreadcrumb]=\"appPageTitleBreadcrumb\"\r\n [appPageTitleDescription]=\"appPageTitleDescription\" class=\"page-title d-flex flex-wrap me-3\"\r\n [ngClass]=\"{'flex-column justify-content-center': appPageTitleDirection === 'column', 'align-items-center': appPageTitleDirection !== 'column', appPageTitleCSSClass}\">\r\n </lib-page-title>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"multiSelect\">\r\n <lib-classic class=\"d-flex align-items-center gap-2 gap-lg-3\"></lib-classic>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelect\">\r\n <lib-client-settings class=\"d-flex align-items-center me-5\"></lib-client-settings>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"datepicker\">\r\n <lib-datepicker class=\"d-flex align-items-center me-5\"></lib-datepicker>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelectdatepicker\">\r\n <lib-date-single-select class=\"d-flex align-items-center me-5\"></lib-date-single-select>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleStore\">\r\n <lib-single-store class=\"d-flex align-items-center me-5\"></lib-single-store>\r\n </ng-container>\r\n <!-- <ng-container *ngIf=\"appToolbarLayout === 'extended'\">\r\n <lib-extended class=\"d-flex align-items-center flex-shrink-0 me-5\"></lib-extended>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'reports'\">\r\n <lib-reports class=\"d-flex align-items-center overflow-auto\" [appPageTitleDisplay]=\"appPageTitleDisplay\">\r\n </lib-reports>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'saas'\">\r\n <lib-saas class=\"d-flex align-items-center gap-2\" [appPageTitleDisplay]=\"appPageTitleDisplay\"></lib-saas>\r\n </ng-container> -->\r\n</div>\r\n<!--end::Toolbar container-->\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PageTitleComponent, selector: "lib-page-title", inputs: ["appPageTitleDirection", "appPageTitleBreadcrumb", "appPageTitleDescription"] }, { kind: "component", type: ClassicComponent, selector: "lib-classic" }, { kind: "component", type: ClientSettingsComponent, selector: "lib-client-settings" }, { kind: "component", type: DatepickerComponent, selector: "lib-datepicker" }, { kind: "component", type: DateSingleSelectComponent, selector: "lib-date-single-select" }, { kind: "component", type: SingleStoreComponent, selector: "lib-single-store" }] });
|
|
2625
2636
|
}
|
|
2626
2637
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ToolbarComponent, decorators: [{
|
|
2627
2638
|
type: Component,
|
|
2628
2639
|
args: [{ selector: "lib-toolbar", template: "<!--begin::Toolbar container-->\r\n<div id=\"kt_app_toolbar_container\" class=\"app-container\" [ngClass]=\"appToolbarContainerCSSClass\">\r\n <ng-container *ngIf=\"showPageTitle()\">\r\n <lib-page-title [appPageTitleDirection]=\"appPageTitleDirection\" [appPageTitleBreadcrumb]=\"appPageTitleBreadcrumb\"\r\n [appPageTitleDescription]=\"appPageTitleDescription\" class=\"page-title d-flex flex-wrap me-3\"\r\n [ngClass]=\"{'flex-column justify-content-center': appPageTitleDirection === 'column', 'align-items-center': appPageTitleDirection !== 'column', appPageTitleCSSClass}\">\r\n </lib-page-title>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"multiSelect\">\r\n <lib-classic class=\"d-flex align-items-center gap-2 gap-lg-3\"></lib-classic>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelect\">\r\n <lib-client-settings class=\"d-flex align-items-center me-5\"></lib-client-settings>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"datepicker\">\r\n <lib-datepicker class=\"d-flex align-items-center me-5\"></lib-datepicker>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelectdatepicker\">\r\n <lib-date-single-select class=\"d-flex align-items-center me-5\"></lib-date-single-select>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleStore\">\r\n <lib-single-store class=\"d-flex align-items-center me-5\"></lib-single-store>\r\n </ng-container>\r\n <!-- <ng-container *ngIf=\"appToolbarLayout === 'extended'\">\r\n <lib-extended class=\"d-flex align-items-center flex-shrink-0 me-5\"></lib-extended>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'reports'\">\r\n <lib-reports class=\"d-flex align-items-center overflow-auto\" [appPageTitleDisplay]=\"appPageTitleDisplay\">\r\n </lib-reports>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'saas'\">\r\n <lib-saas class=\"d-flex align-items-center gap-2\" [appPageTitleDisplay]=\"appPageTitleDisplay\"></lib-saas>\r\n </ng-container> -->\r\n</div>\r\n<!--end::Toolbar container-->\r\n" }]
|
|
2629
|
-
}], ctorParameters: () => [{ type: i1.LayoutService }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }], propDecorators: { currentLayoutType: [{
|
|
2640
|
+
}], ctorParameters: () => [{ type: i1.LayoutService }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: GlobalStateService }], propDecorators: { currentLayoutType: [{
|
|
2630
2641
|
type: Input
|
|
2631
2642
|
}], appToolbarLayout: [{
|
|
2632
2643
|
type: Input
|