fixa-admin 0.0.67 → 0.0.68
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/components/grid/filter/time-filter.component.mjs +15 -8
- package/esm2022/lib/components/grid/grid.component.mjs +20 -13
- package/fesm2022/fixa-admin.mjs +33 -19
- package/fesm2022/fixa-admin.mjs.map +1 -1
- package/lib/components/grid/filter/time-filter.component.d.ts +1 -0
- package/package.json +1 -1
package/fesm2022/fixa-admin.mjs
CHANGED
|
@@ -539,16 +539,21 @@ class TimeFilter {
|
|
|
539
539
|
constructor() {
|
|
540
540
|
this.time = "";
|
|
541
541
|
}
|
|
542
|
+
isValidTime() {
|
|
543
|
+
if (!this.time || this.time.length !== 4)
|
|
544
|
+
return false;
|
|
545
|
+
const regex = /^([01]\d|2[0-3])([0-5]\d)$/;
|
|
546
|
+
return regex.test(this.time);
|
|
547
|
+
}
|
|
542
548
|
agInit(params) {
|
|
543
549
|
this.params = params;
|
|
544
550
|
}
|
|
545
551
|
isFilterActive() {
|
|
546
|
-
|
|
547
|
-
return false;
|
|
548
|
-
}
|
|
549
|
-
return true;
|
|
552
|
+
return this.isValidTime();
|
|
550
553
|
}
|
|
551
554
|
doesFilterPass(params) {
|
|
555
|
+
if (!this.isValidTime())
|
|
556
|
+
return false;
|
|
552
557
|
let passed = true;
|
|
553
558
|
const { node } = params;
|
|
554
559
|
this.time
|
|
@@ -576,6 +581,9 @@ class TimeFilter {
|
|
|
576
581
|
this.time = model == null || model.time == null ? null : model.time;
|
|
577
582
|
}
|
|
578
583
|
filter() {
|
|
584
|
+
if (!this.isValidTime()) {
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
579
587
|
this.params.filterChangedCallback();
|
|
580
588
|
}
|
|
581
589
|
clear() {
|
|
@@ -584,7 +592,6 @@ class TimeFilter {
|
|
|
584
592
|
}
|
|
585
593
|
afterGuiAttached(params) {
|
|
586
594
|
if (!params?.suppressFocus) {
|
|
587
|
-
// focus the input element for keyboard navigation
|
|
588
595
|
this.eFilterText.nativeElement.focus();
|
|
589
596
|
}
|
|
590
597
|
}
|
|
@@ -594,7 +601,7 @@ class TimeFilter {
|
|
|
594
601
|
<nz-form-item>
|
|
595
602
|
<nz-form-label>ساعت</nz-form-label>
|
|
596
603
|
<nz-form-control>
|
|
597
|
-
<input nz-input appMask="00:00
|
|
604
|
+
<input nz-input appMask="00:00" placeholder="12:00" autocomplete="off" class="w-[250px]" dir="ltr" [(ngModel)]="time" #eFilterText/>
|
|
598
605
|
</nz-form-control>
|
|
599
606
|
</nz-form-item>
|
|
600
607
|
<hr/>
|
|
@@ -613,7 +620,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
613
620
|
<nz-form-item>
|
|
614
621
|
<nz-form-label>ساعت</nz-form-label>
|
|
615
622
|
<nz-form-control>
|
|
616
|
-
<input nz-input appMask="00:00
|
|
623
|
+
<input nz-input appMask="00:00" placeholder="12:00" autocomplete="off" class="w-[250px]" dir="ltr" [(ngModel)]="time" #eFilterText/>
|
|
617
624
|
</nz-form-control>
|
|
618
625
|
</nz-form-item>
|
|
619
626
|
<hr/>
|
|
@@ -1060,7 +1067,7 @@ class GridComponent {
|
|
|
1060
1067
|
cellClassRules: this.renderCellClassRules,
|
|
1061
1068
|
cellRenderer: params => {
|
|
1062
1069
|
if (params.value) {
|
|
1063
|
-
return params.value;
|
|
1070
|
+
return params.value.substr(0, 5);
|
|
1064
1071
|
}
|
|
1065
1072
|
else {
|
|
1066
1073
|
return '';
|
|
@@ -1419,6 +1426,7 @@ class GridComponent {
|
|
|
1419
1426
|
}
|
|
1420
1427
|
handleFilterLabelValue() {
|
|
1421
1428
|
this._filterBoxItems.forEach((el) => {
|
|
1429
|
+
debugger;
|
|
1422
1430
|
const findEl = this.filterItemsValues.find((fi) => fi.field == el.field);
|
|
1423
1431
|
let value = el.value;
|
|
1424
1432
|
switch (el.type) {
|
|
@@ -1433,6 +1441,9 @@ class GridComponent {
|
|
|
1433
1441
|
case 'boolean':
|
|
1434
1442
|
value = el.value != null && el.value == true ? 'True' : 'False';
|
|
1435
1443
|
break;
|
|
1444
|
+
case 'time':
|
|
1445
|
+
value = el.value.substr(0, 5);
|
|
1446
|
+
break;
|
|
1436
1447
|
case 'tree-select':
|
|
1437
1448
|
const findItemByValue = (items, targetValue) => {
|
|
1438
1449
|
for (const item of items) {
|
|
@@ -1554,11 +1565,12 @@ class GridComponent {
|
|
|
1554
1565
|
}
|
|
1555
1566
|
else if (params.request.filterModel[key].filterType == 'custom-time' && params.request.filterModel[key].time != null) {
|
|
1556
1567
|
operator = FilterOperator.equals;
|
|
1557
|
-
value = `${params.request.filterModel[key].time.substr(0, 2)}:${params.request.filterModel[key].time.substr(2, 2)}
|
|
1568
|
+
value = `${params.request.filterModel[key].time.substr(0, 2)}:${params.request.filterModel[key].time.substr(2, 2)}:00`;
|
|
1558
1569
|
}
|
|
1559
1570
|
else if (params.request.filterModel[key].type && params.request.filterModel[key].type == 'inRange') {
|
|
1560
1571
|
operator = FilterOperator.between;
|
|
1561
1572
|
value = [params.request.filterModel[key].filter, params.request.filterModel[key].filterTo];
|
|
1573
|
+
translateValue = `${params.request.filterModel[key].filter} - ${params.request.filterModel[key].filterTo}`;
|
|
1562
1574
|
}
|
|
1563
1575
|
else {
|
|
1564
1576
|
if (FilterOperator[params.request.filterModel[key].type]) {
|
|
@@ -1570,16 +1582,18 @@ class GridComponent {
|
|
|
1570
1582
|
ignoreCase = false;
|
|
1571
1583
|
}
|
|
1572
1584
|
}
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1585
|
+
if (findEl != null) {
|
|
1586
|
+
const findFilterItemsEl = this.filterItemsValues.find((fi) => fi.field == findEl.field);
|
|
1587
|
+
if (!findFilterItemsEl) {
|
|
1588
|
+
this.filterItemsValues.push({
|
|
1589
|
+
field: findEl.field,
|
|
1590
|
+
label: findEl.label,
|
|
1591
|
+
value: translateValue != null ? translateValue : params.request.filterModel[key].filterType == 'custom-time' ? value.substr(0, 5) : value
|
|
1592
|
+
});
|
|
1593
|
+
}
|
|
1594
|
+
else {
|
|
1595
|
+
findFilterItemsEl.value = translateValue != null ? translateValue : value;
|
|
1596
|
+
}
|
|
1583
1597
|
}
|
|
1584
1598
|
filter.filters.push({
|
|
1585
1599
|
disable: false,
|