@quadrel-enterprise-ui/framework 21.19.1 → 21.20.0
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.
|
@@ -794,7 +794,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
794
794
|
}]
|
|
795
795
|
}] });
|
|
796
796
|
|
|
797
|
-
// @ts-strict-ignore
|
|
798
797
|
class QdMockFilterComponent {
|
|
799
798
|
filterId;
|
|
800
799
|
filterData;
|
|
@@ -824,7 +823,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
824
823
|
args: ['attr.data-test-id']
|
|
825
824
|
}] } });
|
|
826
825
|
|
|
827
|
-
// @ts-strict-ignore
|
|
828
826
|
class QdMockFilterCategoryBooleanComponent {
|
|
829
827
|
filterId;
|
|
830
828
|
categoryIndex;
|
|
@@ -854,7 +852,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
854
852
|
args: ['attr.data-test-id']
|
|
855
853
|
}] } });
|
|
856
854
|
|
|
857
|
-
// @ts-strict-ignore
|
|
858
855
|
class QdMockFilterCategoryComponent {
|
|
859
856
|
filterId;
|
|
860
857
|
categoryIndex;
|
|
@@ -887,7 +884,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
887
884
|
args: ['attr.data-test-id']
|
|
888
885
|
}] } });
|
|
889
886
|
|
|
890
|
-
// @ts-strict-ignore
|
|
891
887
|
class QdMockFilterCategoryDateComponent {
|
|
892
888
|
filterId;
|
|
893
889
|
categoryIndex;
|
|
@@ -920,7 +916,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
920
916
|
args: ['attr.data-test-id']
|
|
921
917
|
}] } });
|
|
922
918
|
|
|
923
|
-
// @ts-strict-ignore
|
|
924
919
|
class QdMockFilterCategoryDateRangeComponent {
|
|
925
920
|
filterId;
|
|
926
921
|
categoryIndex;
|
|
@@ -953,7 +948,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
953
948
|
args: ['attr.data-test-id']
|
|
954
949
|
}] } });
|
|
955
950
|
|
|
956
|
-
// @ts-strict-ignore
|
|
957
951
|
class QdMockFilterCategoryFreeTextComponent {
|
|
958
952
|
filterId;
|
|
959
953
|
isInstantFiltering;
|
|
@@ -986,7 +980,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
986
980
|
args: ['attr.data-test-id']
|
|
987
981
|
}] } });
|
|
988
982
|
|
|
989
|
-
// @ts-strict-ignore
|
|
990
983
|
class QdMockFilterCategorySelectComponent {
|
|
991
984
|
filterId;
|
|
992
985
|
categoryIndex;
|
|
@@ -1016,7 +1009,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1016
1009
|
args: ['attr.data-test-id']
|
|
1017
1010
|
}] } });
|
|
1018
1011
|
|
|
1019
|
-
// @ts-strict-ignore
|
|
1020
1012
|
class QdMockFilterItemBooleanComponent {
|
|
1021
1013
|
filterId;
|
|
1022
1014
|
categoryIndex;
|
|
@@ -1052,7 +1044,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1052
1044
|
args: ['attr.data-test-id']
|
|
1053
1045
|
}] } });
|
|
1054
1046
|
|
|
1055
|
-
// @ts-strict-ignore
|
|
1056
1047
|
class QdMockFilterItemDateComponent {
|
|
1057
1048
|
filterId;
|
|
1058
1049
|
categoryIndex;
|
|
@@ -1088,7 +1079,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1088
1079
|
args: ['attr.data-test-id']
|
|
1089
1080
|
}] } });
|
|
1090
1081
|
|
|
1091
|
-
// @ts-strict-ignore
|
|
1092
1082
|
class QdMockFilterItemDateRangeComponent {
|
|
1093
1083
|
filterId;
|
|
1094
1084
|
categoryIndex;
|
|
@@ -1125,7 +1115,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1125
1115
|
args: ['attr.data-test-id']
|
|
1126
1116
|
}] } });
|
|
1127
1117
|
|
|
1128
|
-
// @ts-strict-ignore
|
|
1129
1118
|
class QdMockFilterItemFreeTextComponent {
|
|
1130
1119
|
filterId;
|
|
1131
1120
|
isInstantFiltering;
|
|
@@ -1161,7 +1150,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1161
1150
|
args: ['attr.data-test-id']
|
|
1162
1151
|
}] } });
|
|
1163
1152
|
|
|
1164
|
-
// @ts-strict-ignore
|
|
1165
1153
|
class QdMockFilterItemMultiSelectComponent {
|
|
1166
1154
|
filterId;
|
|
1167
1155
|
categoryIndex;
|
|
@@ -1196,9 +1184,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1196
1184
|
|
|
1197
1185
|
const QD_FILTER_LISTBOX_HOST = new InjectionToken('QD_FILTER_LISTBOX_HOST');
|
|
1198
1186
|
|
|
1199
|
-
// @ts-strict-ignore
|
|
1200
1187
|
class QdMockFilterItemSingleSelectComponent {
|
|
1201
|
-
|
|
1188
|
+
_category = inject(QD_FILTER_LISTBOX_HOST, { optional: true });
|
|
1202
1189
|
filterId;
|
|
1203
1190
|
categoryIndex;
|
|
1204
1191
|
itemIndex;
|
|
@@ -1211,10 +1198,10 @@ class QdMockFilterItemSingleSelectComponent {
|
|
|
1211
1198
|
return this.testId;
|
|
1212
1199
|
}
|
|
1213
1200
|
ngOnInit() {
|
|
1214
|
-
this.
|
|
1201
|
+
this._category?.registerOption(this);
|
|
1215
1202
|
}
|
|
1216
1203
|
ngOnDestroy() {
|
|
1217
|
-
this.
|
|
1204
|
+
this._category?.unregisterOption(this);
|
|
1218
1205
|
}
|
|
1219
1206
|
setActiveStyles() {
|
|
1220
1207
|
this.isActive = true;
|
|
@@ -1439,7 +1426,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1439
1426
|
}]
|
|
1440
1427
|
}] });
|
|
1441
1428
|
|
|
1442
|
-
// @ts-strict-ignore
|
|
1443
1429
|
class QdMockCalendarComponent {
|
|
1444
1430
|
selectedDate;
|
|
1445
1431
|
language;
|
|
@@ -1472,7 +1458,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1472
1458
|
type: Output
|
|
1473
1459
|
}] } });
|
|
1474
1460
|
|
|
1475
|
-
// @ts-strict-ignore
|
|
1476
1461
|
class QdMockCheckboxChipsComponent {
|
|
1477
1462
|
values;
|
|
1478
1463
|
config;
|
|
@@ -1502,7 +1487,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1502
1487
|
args: ['attr.data-test-id']
|
|
1503
1488
|
}] } });
|
|
1504
1489
|
|
|
1505
|
-
// @ts-strict-ignore
|
|
1506
1490
|
class QdMockCheckboxChipsItemComponent {
|
|
1507
1491
|
data;
|
|
1508
1492
|
testId = 'checkbox-chips-item';
|
|
@@ -1523,7 +1507,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1523
1507
|
args: ['data-test-id']
|
|
1524
1508
|
}] } });
|
|
1525
1509
|
|
|
1526
|
-
// @ts-strict-ignore
|
|
1527
1510
|
class QdMockCheckboxComponent {
|
|
1528
1511
|
inputData;
|
|
1529
1512
|
value;
|
|
@@ -1571,7 +1554,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1571
1554
|
args: ['click']
|
|
1572
1555
|
}] } });
|
|
1573
1556
|
|
|
1574
|
-
// @ts-strict-ignore
|
|
1575
1557
|
class QdMockCheckboxesComponent {
|
|
1576
1558
|
formControlName;
|
|
1577
1559
|
values;
|
|
@@ -1604,7 +1586,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1604
1586
|
args: ['attr.data-test-id']
|
|
1605
1587
|
}] } });
|
|
1606
1588
|
|
|
1607
|
-
// @ts-strict-ignore
|
|
1608
1589
|
class QdMockDatepickerComponent {
|
|
1609
1590
|
config;
|
|
1610
1591
|
formControlName;
|
|
@@ -1636,7 +1617,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1636
1617
|
type: Output
|
|
1637
1618
|
}] } });
|
|
1638
1619
|
|
|
1639
|
-
// @ts-strict-ignore
|
|
1640
1620
|
class QdMockDropdownComponent {
|
|
1641
1621
|
value;
|
|
1642
1622
|
id;
|
|
@@ -1704,7 +1684,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1704
1684
|
args: ['attr.data-test-id']
|
|
1705
1685
|
}] } });
|
|
1706
1686
|
|
|
1707
|
-
// @ts-strict-ignore
|
|
1708
1687
|
class QdMockFormErrorComponent {
|
|
1709
1688
|
control;
|
|
1710
1689
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdMockFormErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -1721,7 +1700,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1721
1700
|
type: Input
|
|
1722
1701
|
}] } });
|
|
1723
1702
|
|
|
1724
|
-
// @ts-strict-ignore
|
|
1725
1703
|
class QdMockFormGroupErrorComponent {
|
|
1726
1704
|
formGroup;
|
|
1727
1705
|
errorKey;
|
|
@@ -1741,7 +1719,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1741
1719
|
type: Input
|
|
1742
1720
|
}] } });
|
|
1743
1721
|
|
|
1744
|
-
// @ts-strict-ignore
|
|
1745
1722
|
class QdMockFormHintComponent {
|
|
1746
1723
|
hint;
|
|
1747
1724
|
hasError;
|
|
@@ -1771,7 +1748,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1771
1748
|
args: ['data-test-id']
|
|
1772
1749
|
}] } });
|
|
1773
1750
|
|
|
1774
|
-
// @ts-strict-ignore
|
|
1775
1751
|
class QdMockFormLabelComponent {
|
|
1776
1752
|
label;
|
|
1777
1753
|
readonly;
|
|
@@ -1809,7 +1785,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1809
1785
|
args: ['data-test-id']
|
|
1810
1786
|
}] } });
|
|
1811
1787
|
|
|
1812
|
-
// @ts-strict-ignore
|
|
1813
1788
|
class QdMockFormReadonlyComponent {
|
|
1814
1789
|
values;
|
|
1815
1790
|
readonlyAction;
|
|
@@ -1833,7 +1808,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1833
1808
|
args: ['data-test-id']
|
|
1834
1809
|
}] } });
|
|
1835
1810
|
|
|
1836
|
-
// @ts-strict-ignore
|
|
1837
1811
|
class QdMockFormViewonlyComponent {
|
|
1838
1812
|
values;
|
|
1839
1813
|
viewonlyAction;
|
|
@@ -1860,7 +1834,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1860
1834
|
args: ['data-test-id']
|
|
1861
1835
|
}] } });
|
|
1862
1836
|
|
|
1863
|
-
// @ts-strict-ignore
|
|
1864
1837
|
class QdMockInputComponent {
|
|
1865
1838
|
formControlName;
|
|
1866
1839
|
value;
|
|
@@ -1951,7 +1924,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1951
1924
|
type: Output
|
|
1952
1925
|
}] } });
|
|
1953
1926
|
|
|
1954
|
-
// @ts-strict-ignore
|
|
1955
1927
|
class QdMockPinCodeComponent {
|
|
1956
1928
|
formControlName;
|
|
1957
1929
|
value;
|
|
@@ -2024,7 +1996,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
2024
1996
|
type: Output
|
|
2025
1997
|
}] } });
|
|
2026
1998
|
|
|
2027
|
-
// @ts-strict-ignore
|
|
2028
1999
|
class QdMockRadioButtonsComponent {
|
|
2029
2000
|
value;
|
|
2030
2001
|
config;
|
|
@@ -2063,7 +2034,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
2063
2034
|
args: ['attr.data-test-id']
|
|
2064
2035
|
}] } });
|
|
2065
2036
|
|
|
2066
|
-
// @ts-strict-ignore
|
|
2067
2037
|
class QdMockSwitchComponent {
|
|
2068
2038
|
inputData;
|
|
2069
2039
|
value;
|
|
@@ -2117,7 +2087,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
2117
2087
|
args: ['attr.data-test-id']
|
|
2118
2088
|
}] } });
|
|
2119
2089
|
|
|
2120
|
-
// @ts-strict-ignore
|
|
2121
2090
|
class QdMockSwitchesComponent {
|
|
2122
2091
|
formControlName;
|
|
2123
2092
|
values = [];
|
|
@@ -2169,7 +2138,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
2169
2138
|
args: ['attr.data-test-id']
|
|
2170
2139
|
}] } });
|
|
2171
2140
|
|
|
2172
|
-
// @ts-strict-ignore
|
|
2173
2141
|
class QdMockTextareaComponent {
|
|
2174
2142
|
formControlName;
|
|
2175
2143
|
value;
|
|
@@ -2361,7 +2329,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
2361
2329
|
}]
|
|
2362
2330
|
}] });
|
|
2363
2331
|
|
|
2364
|
-
// @ts-strict-ignore
|
|
2365
2332
|
class QdMockImageComponent {
|
|
2366
2333
|
primarySrc;
|
|
2367
2334
|
primaryAlt;
|
|
@@ -4927,11 +4894,11 @@ class QdIconButtonComponent {
|
|
|
4927
4894
|
return this.testId;
|
|
4928
4895
|
}
|
|
4929
4896
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdIconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4930
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: QdIconButtonComponent, isStandalone: false, selector: "button[qdIconButton], a[qdIconButton]", inputs: { color: "color", testId: ["data-test-id", "testId"] }, host: { properties: { "class": "this.colorClassName", "attr.data-test-id": "this.dataTestId" }, classAttribute: "qd-icon-button" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: ["button.qd-icon-button{display:inline-flex;width:2.25rem;height:2.25rem;align-items:center;padding:.5rem;border-radius:50%;background:#fff0;color:#171717}button.qd-icon-button qd-icon.qd-icon:not(:first-child){display:none}button.qd-icon-button.primary,button.qd-icon-button.secondary{color:#171717}button.qd-icon-button.critical{color:#c70023}button.qd-icon-button:active,button.qd-icon-button:hover
|
|
4897
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: QdIconButtonComponent, isStandalone: false, selector: "button[qdIconButton], a[qdIconButton]", inputs: { color: "color", testId: ["data-test-id", "testId"] }, host: { properties: { "class": "this.colorClassName", "attr.data-test-id": "this.dataTestId" }, classAttribute: "qd-icon-button" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: ["button.qd-icon-button{display:inline-flex;width:2.25rem;height:2.25rem;align-items:center;padding:.5rem;border-radius:50%;background:#fff0;color:#171717}button.qd-icon-button qd-icon.qd-icon:not(:first-child){display:none}button.qd-icon-button.primary,button.qd-icon-button.secondary{color:#171717}button.qd-icon-button.critical{color:#c70023}button.qd-icon-button:active,button.qd-icon-button:hover{background:#e5e5e5}button.qd-icon-button:active qd-icon.qd-icon:first-child:not(:only-child),button.qd-icon-button:hover qd-icon.qd-icon:first-child:not(:only-child){display:none}button.qd-icon-button:active qd-icon.qd-icon:not(:first-child),button.qd-icon-button:hover qd-icon.qd-icon:not(:first-child){display:inline}button.qd-icon-button:focus-visible{outline:2px solid rgb(0,102,153);outline-offset:2px}button.qd-icon-button[disabled]{background:none;color:#979797}button.qd-icon-button .qd-icon{font-size:1.25rem}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
4931
4898
|
}
|
|
4932
4899
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdIconButtonComponent, decorators: [{
|
|
4933
4900
|
type: Component,
|
|
4934
|
-
args: [{ selector: 'button[qdIconButton], a[qdIconButton]', encapsulation: ViewEncapsulation.None, host: { class: 'qd-icon-button' }, standalone: false, template: "<ng-content></ng-content>\n", styles: ["button.qd-icon-button{display:inline-flex;width:2.25rem;height:2.25rem;align-items:center;padding:.5rem;border-radius:50%;background:#fff0;color:#171717}button.qd-icon-button qd-icon.qd-icon:not(:first-child){display:none}button.qd-icon-button.primary,button.qd-icon-button.secondary{color:#171717}button.qd-icon-button.critical{color:#c70023}button.qd-icon-button:active,button.qd-icon-button:hover
|
|
4901
|
+
args: [{ selector: 'button[qdIconButton], a[qdIconButton]', encapsulation: ViewEncapsulation.None, host: { class: 'qd-icon-button' }, standalone: false, template: "<ng-content></ng-content>\n", styles: ["button.qd-icon-button{display:inline-flex;width:2.25rem;height:2.25rem;align-items:center;padding:.5rem;border-radius:50%;background:#fff0;color:#171717}button.qd-icon-button qd-icon.qd-icon:not(:first-child){display:none}button.qd-icon-button.primary,button.qd-icon-button.secondary{color:#171717}button.qd-icon-button.critical{color:#c70023}button.qd-icon-button:active,button.qd-icon-button:hover{background:#e5e5e5}button.qd-icon-button:active qd-icon.qd-icon:first-child:not(:only-child),button.qd-icon-button:hover qd-icon.qd-icon:first-child:not(:only-child){display:none}button.qd-icon-button:active qd-icon.qd-icon:not(:first-child),button.qd-icon-button:hover qd-icon.qd-icon:not(:first-child){display:inline}button.qd-icon-button:focus-visible{outline:2px solid rgb(0,102,153);outline-offset:2px}button.qd-icon-button[disabled]{background:none;color:#979797}button.qd-icon-button .qd-icon{font-size:1.25rem}\n"] }]
|
|
4935
4902
|
}], propDecorators: { color: [{
|
|
4936
4903
|
type: Input
|
|
4937
4904
|
}], testId: [{
|
|
@@ -9086,7 +9053,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
9086
9053
|
}]
|
|
9087
9054
|
}] });
|
|
9088
9055
|
|
|
9089
|
-
// @ts-strict-ignore
|
|
9090
9056
|
class QdFormControl extends UntypedFormControl {
|
|
9091
9057
|
maxLength;
|
|
9092
9058
|
revalidationPartners = [];
|
|
@@ -9154,7 +9120,9 @@ function isOptionsObj$1(validatorOrOpts) {
|
|
|
9154
9120
|
}
|
|
9155
9121
|
|
|
9156
9122
|
function get(object, path, defaultValue) {
|
|
9157
|
-
const value = path
|
|
9123
|
+
const value = path
|
|
9124
|
+
.split('.')
|
|
9125
|
+
.reduce((current, key) => current?.[key], object);
|
|
9158
9126
|
return value === null || value === undefined || Number.isNaN(value) ? defaultValue : value;
|
|
9159
9127
|
}
|
|
9160
9128
|
/**
|
|
@@ -9274,7 +9242,6 @@ const setSingleSelectOptions = (options, optionIndex) => options.map((option, in
|
|
|
9274
9242
|
return { ...option, ...{ active: false } };
|
|
9275
9243
|
});
|
|
9276
9244
|
|
|
9277
|
-
// @ts-strict-ignore
|
|
9278
9245
|
class QdCheckboxChipsService {
|
|
9279
9246
|
setOptionsByValues(options, values) {
|
|
9280
9247
|
return setOptionsByValues(options, values);
|
|
@@ -9375,7 +9342,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
9375
9342
|
type: Injectable
|
|
9376
9343
|
}] });
|
|
9377
9344
|
|
|
9378
|
-
// @ts-strict-ignore
|
|
9379
9345
|
class QdCheckboxChipsItemComponent {
|
|
9380
9346
|
data;
|
|
9381
9347
|
testId = 'checkbox-chips-item';
|
|
@@ -9684,7 +9650,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
9684
9650
|
args: ['data-test-id']
|
|
9685
9651
|
}] } });
|
|
9686
9652
|
|
|
9687
|
-
// @ts-strict-ignore
|
|
9688
9653
|
/**
|
|
9689
9654
|
* The **QdCheckboxChips** is a component that provides a checkbox chip functionality.<br />
|
|
9690
9655
|
* It allows you to create a group of checkboxes in the form of chips, that represent a choice or selection. It can be used with Quadrel Reactive Forms or with model binding.
|
|
@@ -9717,10 +9682,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
9717
9682
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
9718
9683
|
*/
|
|
9719
9684
|
class QdCheckboxChipsComponent {
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9685
|
+
_checkboxChipsService = inject(QdCheckboxChipsService, { self: true });
|
|
9686
|
+
_actionEmitterService = inject(QdFormsActionEmitterService, { self: true });
|
|
9687
|
+
_controlContainer = inject(ControlContainer, { optional: true, host: true, skipSelf: true });
|
|
9688
|
+
_eventBrokerService = inject(QdEventBrokerService, { optional: true });
|
|
9724
9689
|
/**
|
|
9725
9690
|
* The form control name can be assigned here if you want to use Reactive Forms.
|
|
9726
9691
|
*/
|
|
@@ -9742,6 +9707,7 @@ class QdCheckboxChipsComponent {
|
|
|
9742
9707
|
config;
|
|
9743
9708
|
/**
|
|
9744
9709
|
* The current form item values, if you are working with Model Binding.
|
|
9710
|
+
* The array has one entry per option: the option value when it is selected, otherwise `null`.
|
|
9745
9711
|
*
|
|
9746
9712
|
* @example
|
|
9747
9713
|
* <qd-checkboxes [(values)]="checkboxGroupValue" [config]="config"></qd-checkboxes>
|
|
@@ -9754,6 +9720,7 @@ class QdCheckboxChipsComponent {
|
|
|
9754
9720
|
testId = 'checkbox-chips';
|
|
9755
9721
|
/**
|
|
9756
9722
|
* Emits event when the values change. Return values match the current values.
|
|
9723
|
+
* The array has one entry per option: the option value when it is selected, otherwise `null`.
|
|
9757
9724
|
*/
|
|
9758
9725
|
valuesChange = new EventEmitter();
|
|
9759
9726
|
/**
|
|
@@ -9773,7 +9740,7 @@ class QdCheckboxChipsComponent {
|
|
|
9773
9740
|
return this.control ? this.control.touched && this.control.invalid : false;
|
|
9774
9741
|
}
|
|
9775
9742
|
get selectedTranslations() {
|
|
9776
|
-
return this.
|
|
9743
|
+
return this._checkboxChipsService.getSelectedTranslations(this.options);
|
|
9777
9744
|
}
|
|
9778
9745
|
control;
|
|
9779
9746
|
label;
|
|
@@ -9791,9 +9758,9 @@ class QdCheckboxChipsComponent {
|
|
|
9791
9758
|
_onTouch = () => { };
|
|
9792
9759
|
ngOnInit() {
|
|
9793
9760
|
this.updateConfiguration();
|
|
9794
|
-
if (this.
|
|
9761
|
+
if (this._controlContainer) {
|
|
9795
9762
|
if (this.formControlName) {
|
|
9796
|
-
this.control = this.
|
|
9763
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
9797
9764
|
if (!(this.control instanceof QdFormControl)) {
|
|
9798
9765
|
console.warn('Quadrel Framework | QdCheckboxChips - Please use the QdFormControl instead of the Angular FormControl.');
|
|
9799
9766
|
}
|
|
@@ -9802,13 +9769,13 @@ class QdCheckboxChipsComponent {
|
|
|
9802
9769
|
console.warn('Quadrel Framework | QdCheckboxChips - Missing FormControlName directive from host element of the component.');
|
|
9803
9770
|
}
|
|
9804
9771
|
}
|
|
9805
|
-
this.
|
|
9772
|
+
this._actionEmitterService.hintEventEmitter$
|
|
9806
9773
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
9807
9774
|
.subscribe(() => this.clickHint.emit());
|
|
9808
|
-
this.
|
|
9775
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
9809
9776
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
9810
9777
|
.subscribe(() => this.clickReadonly.emit());
|
|
9811
|
-
this.
|
|
9778
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
9812
9779
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
9813
9780
|
.subscribe(() => this.clickViewonly.emit());
|
|
9814
9781
|
this.initOpModeSubscription();
|
|
@@ -9827,12 +9794,12 @@ class QdCheckboxChipsComponent {
|
|
|
9827
9794
|
this.disabled = disabled;
|
|
9828
9795
|
}
|
|
9829
9796
|
writeValue(value) {
|
|
9830
|
-
this.options = this.
|
|
9831
|
-
this.values = this.
|
|
9797
|
+
this.options = this._checkboxChipsService.setOptionsByValues(this.options, value);
|
|
9798
|
+
this.values = this._checkboxChipsService.getValues(this.config.options);
|
|
9832
9799
|
}
|
|
9833
9800
|
handleClick(index) {
|
|
9834
|
-
this.options = this.
|
|
9835
|
-
this.values = this.
|
|
9801
|
+
this.options = this._checkboxChipsService.updateOptions(this.options, index);
|
|
9802
|
+
this.values = this._checkboxChipsService.getValues(this.options);
|
|
9836
9803
|
this._onChange(this.values);
|
|
9837
9804
|
this._onTouch(this.values);
|
|
9838
9805
|
this.valuesChange.emit(this.values);
|
|
@@ -9851,9 +9818,9 @@ class QdCheckboxChipsComponent {
|
|
|
9851
9818
|
this.isHintDisabled = getIsHintDisabled(this.config);
|
|
9852
9819
|
}
|
|
9853
9820
|
initOpModeSubscription() {
|
|
9854
|
-
if (!this.
|
|
9821
|
+
if (!this._eventBrokerService)
|
|
9855
9822
|
return;
|
|
9856
|
-
this.
|
|
9823
|
+
this._eventBrokerService
|
|
9857
9824
|
.consume('operation_mode_changed')
|
|
9858
9825
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
9859
9826
|
.subscribe(topic => {
|
|
@@ -9909,7 +9876,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
9909
9876
|
args: ['class.qd-form-error']
|
|
9910
9877
|
}] } });
|
|
9911
9878
|
|
|
9912
|
-
// @ts-strict-ignore
|
|
9913
9879
|
class QdCheckboxComponent {
|
|
9914
9880
|
// TODO: Refactor FormInput for better internal interface
|
|
9915
9881
|
inputData;
|
|
@@ -10014,9 +9980,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
10014
9980
|
args: ['class.qd-checkbox--disabled']
|
|
10015
9981
|
}] } });
|
|
10016
9982
|
|
|
10017
|
-
// @ts-strict-ignore
|
|
10018
9983
|
class QdCheckboxesService {
|
|
10019
|
-
|
|
9984
|
+
_translateService = inject(TranslateService);
|
|
10020
9985
|
checkboxesList;
|
|
10021
9986
|
checkboxesListForView;
|
|
10022
9987
|
formatFormControlValues(formControlValues) {
|
|
@@ -10032,7 +9997,7 @@ class QdCheckboxesService {
|
|
|
10032
9997
|
});
|
|
10033
9998
|
}
|
|
10034
9999
|
isAtLeastOneCheckboxSelected(checkboxesList) {
|
|
10035
|
-
return checkboxesList.reduce((hasValue, checkbox) => hasValue || checkbox.checked, false);
|
|
10000
|
+
return checkboxesList.reduce((hasValue, checkbox) => hasValue || !!checkbox.checked, false);
|
|
10036
10001
|
}
|
|
10037
10002
|
setCheckboxesList(checkboxesList) {
|
|
10038
10003
|
this.checkboxesList = checkboxesList.map(checkbox => ({ ...checkbox, disabled: checkbox.disabled || false }));
|
|
@@ -10098,7 +10063,7 @@ class QdCheckboxesService {
|
|
|
10098
10063
|
}
|
|
10099
10064
|
const checkboxesListWithTranslation = this.checkboxesList.map((checkbox) => ({
|
|
10100
10065
|
...checkbox,
|
|
10101
|
-
translation: this.
|
|
10066
|
+
translation: this._translateService.instant(checkbox.i18n)
|
|
10102
10067
|
}));
|
|
10103
10068
|
this.checkboxesListForView = this.checkboxesList.filter((_checkbox, index) => checkboxesListWithTranslation[index].translation.toLowerCase().includes(value.toLowerCase()));
|
|
10104
10069
|
}
|
|
@@ -10155,7 +10120,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
10155
10120
|
type: Output
|
|
10156
10121
|
}] } });
|
|
10157
10122
|
|
|
10158
|
-
// @ts-strict-ignore
|
|
10159
10123
|
/**
|
|
10160
10124
|
* The **QdCheckboxes** is a component that provides a form element for checkboxes.<br />
|
|
10161
10125
|
* It allows users to select multiple options from a list of checkboxes. It can be used with Quadrel Reactive Forms or with model binding.
|
|
@@ -10188,11 +10152,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
10188
10152
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
10189
10153
|
*/
|
|
10190
10154
|
class QdCheckboxesComponent {
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10155
|
+
_checkboxesService = inject(QdCheckboxesService);
|
|
10156
|
+
_actionEmitterService = inject(QdFormsActionEmitterService);
|
|
10157
|
+
_controlContainer = inject(ControlContainer, { optional: true, host: true, skipSelf: true });
|
|
10158
|
+
_eventBrokerService = inject(QdEventBrokerService, { optional: true });
|
|
10159
|
+
_ngZone = inject(NgZone);
|
|
10196
10160
|
/**
|
|
10197
10161
|
* The form control name can be assigned here if you want to use Reactive Forms.
|
|
10198
10162
|
*/
|
|
@@ -10227,6 +10191,7 @@ class QdCheckboxesComponent {
|
|
|
10227
10191
|
testId = 'checkboxes';
|
|
10228
10192
|
/**
|
|
10229
10193
|
* Emits event when the values change. Return values match the current values.
|
|
10194
|
+
* The array has one entry per option: the option value when it is checked, otherwise `null`.
|
|
10230
10195
|
*/
|
|
10231
10196
|
valuesChange = new EventEmitter();
|
|
10232
10197
|
/**
|
|
@@ -10273,10 +10238,10 @@ class QdCheckboxesComponent {
|
|
|
10273
10238
|
_onTouch = () => { };
|
|
10274
10239
|
_destroyRef = inject(DestroyRef);
|
|
10275
10240
|
get hasHint() {
|
|
10276
|
-
return this.config.hint && this.config.hint.i18n && !this.config.hint.disabled;
|
|
10241
|
+
return !!(this.config.hint && this.config.hint.i18n && !this.config.hint.disabled);
|
|
10277
10242
|
}
|
|
10278
10243
|
get selectedValuesTranslated() {
|
|
10279
|
-
return this.
|
|
10244
|
+
return this._checkboxesService.getSelectedValuesTranslated();
|
|
10280
10245
|
}
|
|
10281
10246
|
get required() {
|
|
10282
10247
|
if (!this.control)
|
|
@@ -10288,25 +10253,25 @@ class QdCheckboxesComponent {
|
|
|
10288
10253
|
}
|
|
10289
10254
|
ngOnInit() {
|
|
10290
10255
|
this.updateConfiguration();
|
|
10291
|
-
if (this.
|
|
10256
|
+
if (this._controlContainer) {
|
|
10292
10257
|
if (this.formControlName) {
|
|
10293
|
-
this.control = this.
|
|
10258
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
10294
10259
|
}
|
|
10295
10260
|
else {
|
|
10296
10261
|
console.warn('Quadrel Framework | QdCheckboxGroup - Missing FormControlName directive from host element of the component.');
|
|
10297
10262
|
}
|
|
10298
10263
|
}
|
|
10299
10264
|
this.setInitialValues();
|
|
10300
|
-
this.
|
|
10301
|
-
this.
|
|
10265
|
+
this._checkboxesService.setCheckboxesList(this.options);
|
|
10266
|
+
this._checkboxesService.fillCheckboxesListWithDefaults(this.values);
|
|
10302
10267
|
this.setCheckboxesData();
|
|
10303
|
-
this.
|
|
10268
|
+
this._actionEmitterService.hintEventEmitter$
|
|
10304
10269
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
10305
10270
|
.subscribe(() => this.clickHint.emit());
|
|
10306
|
-
this.
|
|
10271
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
10307
10272
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
10308
10273
|
.subscribe(() => this.clickReadonly.emit());
|
|
10309
|
-
this.
|
|
10274
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
10310
10275
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
10311
10276
|
.subscribe(() => this.clickViewonly.emit());
|
|
10312
10277
|
this.initOpModeSubscription();
|
|
@@ -10326,7 +10291,7 @@ class QdCheckboxesComponent {
|
|
|
10326
10291
|
this._onTouch = fn;
|
|
10327
10292
|
}
|
|
10328
10293
|
writeValue(values) {
|
|
10329
|
-
this.
|
|
10294
|
+
this._checkboxesService.fillCheckboxesListWithDefaults(values);
|
|
10330
10295
|
this.setCheckboxesData();
|
|
10331
10296
|
this.checkboxesValues = values;
|
|
10332
10297
|
}
|
|
@@ -10342,14 +10307,14 @@ class QdCheckboxesComponent {
|
|
|
10342
10307
|
this.valuesChange.emit(this.checkboxesValues);
|
|
10343
10308
|
}
|
|
10344
10309
|
changeValue($event) {
|
|
10345
|
-
this.
|
|
10346
|
-
this.
|
|
10347
|
-
this.checkboxesListForView = this.
|
|
10310
|
+
this._checkboxesService.filterOptions($event);
|
|
10311
|
+
this._ngZone.run(() => {
|
|
10312
|
+
this.checkboxesListForView = this._checkboxesService.getCheckboxesListForView();
|
|
10348
10313
|
});
|
|
10349
10314
|
}
|
|
10350
10315
|
haveOptionsChanged(changes) {
|
|
10351
|
-
return (!changes
|
|
10352
|
-
!qdIsDeepEqual(changes
|
|
10316
|
+
return (!changes['config'].firstChange &&
|
|
10317
|
+
!qdIsDeepEqual(changes['config'].previousValue?.options, changes['config'].currentValue?.options));
|
|
10353
10318
|
}
|
|
10354
10319
|
updateConfiguration() {
|
|
10355
10320
|
this.label = getLabel(this.config);
|
|
@@ -10368,19 +10333,19 @@ class QdCheckboxesComponent {
|
|
|
10368
10333
|
this.isHintDisabled = getIsHintDisabled(this.config);
|
|
10369
10334
|
}
|
|
10370
10335
|
setCheckboxesData() {
|
|
10371
|
-
this.
|
|
10372
|
-
this.checkboxesValues = this.
|
|
10373
|
-
this.checkboxesListForView = this.
|
|
10336
|
+
this._checkboxesService.setCheckboxesListForView();
|
|
10337
|
+
this.checkboxesValues = this._checkboxesService.getCheckboxValues();
|
|
10338
|
+
this.checkboxesListForView = this._checkboxesService.getCheckboxesListForView();
|
|
10374
10339
|
}
|
|
10375
10340
|
updateCheckboxesData(value) {
|
|
10376
|
-
this.
|
|
10377
|
-
this.
|
|
10378
|
-
this.checkboxesValues = this.
|
|
10379
|
-
this.checkboxesListForView = this.
|
|
10341
|
+
this._checkboxesService.updateCheckboxesList(value);
|
|
10342
|
+
this._checkboxesService.updateCheckboxesListForView(value);
|
|
10343
|
+
this.checkboxesValues = this._checkboxesService.getCheckboxValues();
|
|
10344
|
+
this.checkboxesListForView = this._checkboxesService.getCheckboxesListForView();
|
|
10380
10345
|
}
|
|
10381
10346
|
handleOptionsChange() {
|
|
10382
|
-
this.
|
|
10383
|
-
this.
|
|
10347
|
+
this._checkboxesService.setCheckboxesList(this.options);
|
|
10348
|
+
this._checkboxesService.fillCheckboxesListWithDefaults(this.checkboxesValues);
|
|
10384
10349
|
this.setCheckboxesData();
|
|
10385
10350
|
this._onChange(this.checkboxesValues);
|
|
10386
10351
|
this._onTouch(this.checkboxesValues);
|
|
@@ -10389,16 +10354,17 @@ class QdCheckboxesComponent {
|
|
|
10389
10354
|
setInitialValues() {
|
|
10390
10355
|
if (this.values)
|
|
10391
10356
|
return;
|
|
10392
|
-
|
|
10357
|
+
const values = [];
|
|
10393
10358
|
this.options.forEach(option => {
|
|
10394
10359
|
if (option.active)
|
|
10395
|
-
|
|
10360
|
+
values.push(option.value);
|
|
10396
10361
|
});
|
|
10362
|
+
this.values = values;
|
|
10397
10363
|
}
|
|
10398
10364
|
initOpModeSubscription() {
|
|
10399
|
-
if (!this.
|
|
10365
|
+
if (!this._eventBrokerService)
|
|
10400
10366
|
return;
|
|
10401
|
-
this.
|
|
10367
|
+
this._eventBrokerService
|
|
10402
10368
|
.consume('operation_mode_changed')
|
|
10403
10369
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
10404
10370
|
.subscribe(topic => {
|
|
@@ -10615,12 +10581,11 @@ class QdDateAdapter {
|
|
|
10615
10581
|
}
|
|
10616
10582
|
}
|
|
10617
10583
|
|
|
10618
|
-
// @ts-strict-ignore
|
|
10619
10584
|
const YearsBefore = 9;
|
|
10620
10585
|
const YearsAfter = 2;
|
|
10621
10586
|
const PickerColumnsPerRow = 3;
|
|
10622
10587
|
class QdCalendarComponent {
|
|
10623
|
-
|
|
10588
|
+
_injector = inject(Injector);
|
|
10624
10589
|
/**
|
|
10625
10590
|
* This property is used to highlight the selected date in the calendar. It should be in the format for example 'DD.MM.YYYY' or 'MM/DD/YYYY' depending on the language used.
|
|
10626
10591
|
*
|
|
@@ -10672,7 +10637,7 @@ class QdCalendarComponent {
|
|
|
10672
10637
|
this.generateCalendar(this.currentDate);
|
|
10673
10638
|
}
|
|
10674
10639
|
ngAfterViewInit() {
|
|
10675
|
-
afterNextRender(() => this.focusActiveCell(), { injector: this.
|
|
10640
|
+
afterNextRender(() => this.focusActiveCell(), { injector: this._injector });
|
|
10676
10641
|
}
|
|
10677
10642
|
ngOnChanges(changes) {
|
|
10678
10643
|
if (changes['language']) {
|
|
@@ -10833,7 +10798,7 @@ class QdCalendarComponent {
|
|
|
10833
10798
|
event.preventDefault();
|
|
10834
10799
|
event.stopPropagation();
|
|
10835
10800
|
this.activePickerIndex = index;
|
|
10836
|
-
afterNextRender(() => this.focusActivePickerCell(), { injector: this.
|
|
10801
|
+
afterNextRender(() => this.focusActivePickerCell(), { injector: this._injector });
|
|
10837
10802
|
}
|
|
10838
10803
|
selectDate(date) {
|
|
10839
10804
|
this.selectedChange.emit(date.formatted);
|
|
@@ -10866,7 +10831,7 @@ class QdCalendarComponent {
|
|
|
10866
10831
|
this.currentDate = target.clone();
|
|
10867
10832
|
this.generateCalendar(this.currentDate);
|
|
10868
10833
|
}
|
|
10869
|
-
afterNextRender(() => this.focusActiveCell(), { injector: this.
|
|
10834
|
+
afterNextRender(() => this.focusActiveCell(), { injector: this._injector });
|
|
10870
10835
|
}
|
|
10871
10836
|
syncActiveToCurrentMonth() {
|
|
10872
10837
|
if (this.activeDate.isSame(this.currentDate, 'month'))
|
|
@@ -10879,14 +10844,14 @@ class QdCalendarComponent {
|
|
|
10879
10844
|
const selected = this.years.findIndex(year => this.isSameYear(year));
|
|
10880
10845
|
const fallback = this.years.indexOf(this.currentDate.year());
|
|
10881
10846
|
this.activePickerIndex = selected >= 0 ? selected : Math.max(0, fallback);
|
|
10882
|
-
afterNextRender(() => this.focusActivePickerCell(), { injector: this.
|
|
10847
|
+
afterNextRender(() => this.focusActivePickerCell(), { injector: this._injector });
|
|
10883
10848
|
}
|
|
10884
10849
|
else if (this.mode === QdCalendarMode.MonthPicker) {
|
|
10885
10850
|
this.activePickerIndex = this.currentDate.month();
|
|
10886
|
-
afterNextRender(() => this.focusActivePickerCell(), { injector: this.
|
|
10851
|
+
afterNextRender(() => this.focusActivePickerCell(), { injector: this._injector });
|
|
10887
10852
|
}
|
|
10888
10853
|
else {
|
|
10889
|
-
afterNextRender(() => this.focusActiveCell(), { injector: this.
|
|
10854
|
+
afterNextRender(() => this.focusActiveCell(), { injector: this._injector });
|
|
10890
10855
|
}
|
|
10891
10856
|
}
|
|
10892
10857
|
focusActiveCell() {
|
|
@@ -10952,11 +10917,11 @@ class QdCalendarComponent {
|
|
|
10952
10917
|
this.weekdays = w.slice(1).concat(w[0]);
|
|
10953
10918
|
}
|
|
10954
10919
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10955
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: QdCalendarComponent, isStandalone: false, selector: "qd-calendar", inputs: { selectedDate: "selectedDate", language: "language", disabledDates: "disabledDates" }, outputs: { selectedChange: "selectedChange", closeRequested: "closeRequested" }, viewQueries: [{ propertyName: "dayCells", predicate: ["dayCell"], descendants: true }, { propertyName: "pickerCells", predicate: ["pickerCell"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"nav\">\n <button type=\"button\" class=\"nav-prev\" (click)=\"prev()\" [attr.aria-label]=\"prevAriaKey | translate\">\n <qd-icon icon=\"arrowLeft\"></qd-icon>\n </button>\n\n <ng-container>\n @if (mode === QdCalendarMode.Default) {\n <button\n type=\"button\"\n class=\"header-toggle current-month-year\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.chooseMonthYear' | translate\"\n (click)=\"changeMode(QdCalendarMode.YearPicker)\"\n >\n {{ currentDate.locale(language).format(\"MMMM\") }} {{ currentDate?.format(\"YYYY\") }}\n </button>\n } @if (mode === QdCalendarMode.YearPicker) {\n <button\n type=\"button\"\n class=\"header-toggle current-years-list\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.chooseMonthYear' | translate\"\n (click)=\"changeMode(QdCalendarMode.MonthPicker)\"\n >\n {{ years[0] }} - {{ years[years.length - 1] }}\n </button>\n } @if (mode === QdCalendarMode.MonthPicker) {\n <button\n type=\"button\"\n class=\"header-toggle current-year\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.chooseMonthYear' | translate\"\n (click)=\"changeMode(QdCalendarMode.YearPicker)\"\n >\n {{ currentDate?.format(\"YYYY\") }}\n </button>\n }\n </ng-container>\n\n <button type=\"button\" class=\"nav-next\" (click)=\"next()\" [attr.aria-label]=\"nextAriaKey | translate\">\n <qd-icon icon=\"arrowRight\"></qd-icon>\n </button>\n</div>\n\n@if (mode === QdCalendarMode.Default) {\n<table\n role=\"grid\"\n [attr.aria-label]=\"currentDate.locale(language).format('MMMM YYYY')\"\n (keydown)=\"onGridKeydown($event)\"\n>\n <tbody>\n <tr role=\"row\">\n @for (name of weekdays; track $index) {\n <th scope=\"col\" class=\"weekday\">{{ name }}</th>\n }\n </tr>\n @for (week of weeks; track $index) {\n <tr role=\"row\">\n @for (day of week; track day.moment.valueOf()) {\n <td\n #dayCell\n role=\"gridcell\"\n class=\"day {{ day.moment.date() }}\"\n [attr.data-date]=\"day.moment.format('YYYY-MM-DD')\"\n [attr.tabindex]=\"isActive(day.moment) ? 0 : -1\"\n [attr.aria-label]=\"day.moment.locale(language).format('D. MMMM YYYY')\"\n [attr.aria-selected]=\"day.selected ? true : null\"\n [attr.aria-current]=\"day.today ? 'date' : null\"\n [attr.aria-disabled]=\"day.disabled ? true : null\"\n [attr.aria-hidden]=\"!isSameYearMonth(day.moment) ? true : null\"\n (click)=\"selectDate(day)\"\n [ngClass]=\"{\n today: day.today,\n selected: day.selected,\n hidden: !isSameYearMonth(day.moment),\n disabled: day.disabled\n }\"\n >\n {{ day.moment.date() }}\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n} @if (mode !== QdCalendarMode.Default) {\n<div class=\"calendar\">\n @if (mode === QdCalendarMode.YearPicker) {\n <div\n class=\"picker\"\n role=\"listbox\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.yearPicker' | translate\"\n (keydown)=\"onPickerKeydown($event)\"\n >\n @for (year of years; track year; let i = $index) {\n <div class=\"col {{ year }}\">\n <div\n #pickerCell\n role=\"option\"\n class=\"entry\"\n [attr.tabindex]=\"isActivePicker(i) ? 0 : -1\"\n [attr.aria-selected]=\"isSameYear(year) ? true : null\"\n (click)=\"selectYear(year)\"\n [ngClass]=\"{ selected: isSameYear(year) }\"\n >\n {{ year }}\n </div>\n </div>\n }\n </div>\n } @if (mode === QdCalendarMode.MonthPicker) {\n <div\n class=\"picker\"\n role=\"listbox\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.monthPicker' | translate\"\n (keydown)=\"onPickerKeydown($event)\"\n >\n @for (month of months; track month; let i = $index) {\n <div class=\"col {{ month }}\">\n <div\n #pickerCell\n role=\"option\"\n class=\"entry\"\n [attr.tabindex]=\"isActivePicker(i) ? 0 : -1\"\n [attr.aria-selected]=\"isSameMonth(i) ? true : null\"\n (click)=\"selectMonth(i)\"\n [ngClass]=\"{ selected: isSameMonth(i), month }\"\n >\n {{ month }}\n </div>\n </div>\n }\n </div>\n }\n</div>\n}\n", styles: [".nav{color:#171717;font-size:1rem;font-weight:700;line-height:1.5rem;display:grid;margin:.75rem;grid-template-columns:[next] 2rem [monthyear] auto [prev] 2rem [end];text-transform:capitalize}.nav span{line-height:2.5rem;text-align:center}.nav .header-toggle{padding:0;border:0;background:transparent;color:inherit;font:inherit;line-height:2.5rem;text-align:center;text-transform:inherit}.nav .current-month-year,.nav .current-years-list,.nav .current-year{cursor:pointer}tbody{display:inherit;margin:.75rem}td,th{color:#171717;font-size:.875rem;font-weight:400;line-height:1.3125rem;min-width:2.5625rem;padding:.4375rem;text-align:center;text-transform:capitalize}td.disabled,th.disabled{color:#d5d5d5;pointer-events:none}td.hidden,th.hidden{opacity:0;pointer-events:none}td.today,th.today{box-shadow:0 0 0 .125rem #d5d5d5 inset}td.selected,td.day:hover,th.selected,th.day:hover{background:#d5d5d5;cursor:pointer}.picker{display:flex;width:100%;flex-wrap:wrap;padding:.75rem}.picker .col{flex:0 0 33.33%;padding:.5rem .25rem}.picker .entry{padding:.4375rem;background:#d5d5d5;cursor:pointer;text-align:center}.picker .entry.selected,.picker .entry:hover{background:gray}td.day:focus,.nav button:focus,.picker .entry:focus{outline:none}
|
|
10920
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: QdCalendarComponent, isStandalone: false, selector: "qd-calendar", inputs: { selectedDate: "selectedDate", language: "language", disabledDates: "disabledDates" }, outputs: { selectedChange: "selectedChange", closeRequested: "closeRequested" }, viewQueries: [{ propertyName: "dayCells", predicate: ["dayCell"], descendants: true }, { propertyName: "pickerCells", predicate: ["pickerCell"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"nav\">\n <button type=\"button\" class=\"nav-prev\" (click)=\"prev()\" [attr.aria-label]=\"prevAriaKey | translate\">\n <qd-icon icon=\"arrowLeft\"></qd-icon>\n </button>\n\n <ng-container>\n @if (mode === QdCalendarMode.Default) {\n <button\n type=\"button\"\n class=\"header-toggle current-month-year\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.chooseMonthYear' | translate\"\n (click)=\"changeMode(QdCalendarMode.YearPicker)\"\n >\n {{ currentDate.locale(language).format(\"MMMM\") }} {{ currentDate?.format(\"YYYY\") }}\n </button>\n } @if (mode === QdCalendarMode.YearPicker) {\n <button\n type=\"button\"\n class=\"header-toggle current-years-list\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.chooseMonthYear' | translate\"\n (click)=\"changeMode(QdCalendarMode.MonthPicker)\"\n >\n {{ years[0] }} - {{ years[years.length - 1] }}\n </button>\n } @if (mode === QdCalendarMode.MonthPicker) {\n <button\n type=\"button\"\n class=\"header-toggle current-year\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.chooseMonthYear' | translate\"\n (click)=\"changeMode(QdCalendarMode.YearPicker)\"\n >\n {{ currentDate?.format(\"YYYY\") }}\n </button>\n }\n </ng-container>\n\n <button type=\"button\" class=\"nav-next\" (click)=\"next()\" [attr.aria-label]=\"nextAriaKey | translate\">\n <qd-icon icon=\"arrowRight\"></qd-icon>\n </button>\n</div>\n\n@if (mode === QdCalendarMode.Default) {\n<table\n role=\"grid\"\n [attr.aria-label]=\"currentDate.locale(language).format('MMMM YYYY')\"\n (keydown)=\"onGridKeydown($event)\"\n>\n <tbody>\n <tr role=\"row\">\n @for (name of weekdays; track $index) {\n <th scope=\"col\" class=\"weekday\">{{ name }}</th>\n }\n </tr>\n @for (week of weeks; track $index) {\n <tr role=\"row\">\n @for (day of week; track day.moment.valueOf()) {\n <td\n #dayCell\n role=\"gridcell\"\n class=\"day {{ day.moment.date() }}\"\n [attr.data-date]=\"day.moment.format('YYYY-MM-DD')\"\n [attr.tabindex]=\"isActive(day.moment) ? 0 : -1\"\n [attr.aria-label]=\"day.moment.locale(language).format('D. MMMM YYYY')\"\n [attr.aria-selected]=\"day.selected ? true : null\"\n [attr.aria-current]=\"day.today ? 'date' : null\"\n [attr.aria-disabled]=\"day.disabled ? true : null\"\n [attr.aria-hidden]=\"!isSameYearMonth(day.moment) ? true : null\"\n (click)=\"selectDate(day)\"\n [ngClass]=\"{\n today: day.today,\n selected: day.selected,\n hidden: !isSameYearMonth(day.moment),\n disabled: day.disabled\n }\"\n >\n {{ day.moment.date() }}\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n} @if (mode !== QdCalendarMode.Default) {\n<div class=\"calendar\">\n @if (mode === QdCalendarMode.YearPicker) {\n <div\n class=\"picker\"\n role=\"listbox\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.yearPicker' | translate\"\n (keydown)=\"onPickerKeydown($event)\"\n >\n @for (year of years; track year; let i = $index) {\n <div class=\"col {{ year }}\">\n <div\n #pickerCell\n role=\"option\"\n class=\"entry\"\n [attr.tabindex]=\"isActivePicker(i) ? 0 : -1\"\n [attr.aria-selected]=\"isSameYear(year) ? true : null\"\n (click)=\"selectYear(year)\"\n [ngClass]=\"{ selected: isSameYear(year) }\"\n >\n {{ year }}\n </div>\n </div>\n }\n </div>\n } @if (mode === QdCalendarMode.MonthPicker) {\n <div\n class=\"picker\"\n role=\"listbox\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.monthPicker' | translate\"\n (keydown)=\"onPickerKeydown($event)\"\n >\n @for (month of months; track month; let i = $index) {\n <div class=\"col {{ month }}\">\n <div\n #pickerCell\n role=\"option\"\n class=\"entry\"\n [attr.tabindex]=\"isActivePicker(i) ? 0 : -1\"\n [attr.aria-selected]=\"isSameMonth(i) ? true : null\"\n (click)=\"selectMonth(i)\"\n [ngClass]=\"{ selected: isSameMonth(i), month }\"\n >\n {{ month }}\n </div>\n </div>\n }\n </div>\n }\n</div>\n}\n", styles: [".nav{color:#171717;font-size:1rem;font-weight:700;line-height:1.5rem;display:grid;margin:.75rem;grid-template-columns:[next] 2rem [monthyear] auto [prev] 2rem [end];text-transform:capitalize}.nav span{line-height:2.5rem;text-align:center}.nav .header-toggle{padding:0;border:0;background:transparent;color:inherit;font:inherit;line-height:2.5rem;text-align:center;text-transform:inherit}.nav .current-month-year,.nav .current-years-list,.nav .current-year{cursor:pointer}tbody{display:inherit;margin:.75rem}td,th{color:#171717;font-size:.875rem;font-weight:400;line-height:1.3125rem;min-width:2.5625rem;padding:.4375rem;text-align:center;text-transform:capitalize}td.disabled,th.disabled{color:#d5d5d5;pointer-events:none}td.hidden,th.hidden{opacity:0;pointer-events:none}td.today,th.today{box-shadow:0 0 0 .125rem #d5d5d5 inset}td.selected,td.day:hover,th.selected,th.day:hover{background:#d5d5d5;cursor:pointer}.picker{display:flex;width:100%;flex-wrap:wrap;padding:.75rem}.picker .col{flex:0 0 33.33%;padding:.5rem .25rem}.picker .entry{padding:.4375rem;background:#d5d5d5;cursor:pointer;text-align:center}.picker .entry.selected,.picker .entry:hover{background:gray}td.day:focus,.nav button:focus,.picker .entry:focus{outline:none}td.day:focus-visible,.nav button:focus-visible,.picker .entry:focus-visible{box-shadow:inset 0 0 0 2px #069}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10956
10921
|
}
|
|
10957
10922
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdCalendarComponent, decorators: [{
|
|
10958
10923
|
type: Component,
|
|
10959
|
-
args: [{ selector: 'qd-calendar', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"nav\">\n <button type=\"button\" class=\"nav-prev\" (click)=\"prev()\" [attr.aria-label]=\"prevAriaKey | translate\">\n <qd-icon icon=\"arrowLeft\"></qd-icon>\n </button>\n\n <ng-container>\n @if (mode === QdCalendarMode.Default) {\n <button\n type=\"button\"\n class=\"header-toggle current-month-year\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.chooseMonthYear' | translate\"\n (click)=\"changeMode(QdCalendarMode.YearPicker)\"\n >\n {{ currentDate.locale(language).format(\"MMMM\") }} {{ currentDate?.format(\"YYYY\") }}\n </button>\n } @if (mode === QdCalendarMode.YearPicker) {\n <button\n type=\"button\"\n class=\"header-toggle current-years-list\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.chooseMonthYear' | translate\"\n (click)=\"changeMode(QdCalendarMode.MonthPicker)\"\n >\n {{ years[0] }} - {{ years[years.length - 1] }}\n </button>\n } @if (mode === QdCalendarMode.MonthPicker) {\n <button\n type=\"button\"\n class=\"header-toggle current-year\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.chooseMonthYear' | translate\"\n (click)=\"changeMode(QdCalendarMode.YearPicker)\"\n >\n {{ currentDate?.format(\"YYYY\") }}\n </button>\n }\n </ng-container>\n\n <button type=\"button\" class=\"nav-next\" (click)=\"next()\" [attr.aria-label]=\"nextAriaKey | translate\">\n <qd-icon icon=\"arrowRight\"></qd-icon>\n </button>\n</div>\n\n@if (mode === QdCalendarMode.Default) {\n<table\n role=\"grid\"\n [attr.aria-label]=\"currentDate.locale(language).format('MMMM YYYY')\"\n (keydown)=\"onGridKeydown($event)\"\n>\n <tbody>\n <tr role=\"row\">\n @for (name of weekdays; track $index) {\n <th scope=\"col\" class=\"weekday\">{{ name }}</th>\n }\n </tr>\n @for (week of weeks; track $index) {\n <tr role=\"row\">\n @for (day of week; track day.moment.valueOf()) {\n <td\n #dayCell\n role=\"gridcell\"\n class=\"day {{ day.moment.date() }}\"\n [attr.data-date]=\"day.moment.format('YYYY-MM-DD')\"\n [attr.tabindex]=\"isActive(day.moment) ? 0 : -1\"\n [attr.aria-label]=\"day.moment.locale(language).format('D. MMMM YYYY')\"\n [attr.aria-selected]=\"day.selected ? true : null\"\n [attr.aria-current]=\"day.today ? 'date' : null\"\n [attr.aria-disabled]=\"day.disabled ? true : null\"\n [attr.aria-hidden]=\"!isSameYearMonth(day.moment) ? true : null\"\n (click)=\"selectDate(day)\"\n [ngClass]=\"{\n today: day.today,\n selected: day.selected,\n hidden: !isSameYearMonth(day.moment),\n disabled: day.disabled\n }\"\n >\n {{ day.moment.date() }}\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n} @if (mode !== QdCalendarMode.Default) {\n<div class=\"calendar\">\n @if (mode === QdCalendarMode.YearPicker) {\n <div\n class=\"picker\"\n role=\"listbox\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.yearPicker' | translate\"\n (keydown)=\"onPickerKeydown($event)\"\n >\n @for (year of years; track year; let i = $index) {\n <div class=\"col {{ year }}\">\n <div\n #pickerCell\n role=\"option\"\n class=\"entry\"\n [attr.tabindex]=\"isActivePicker(i) ? 0 : -1\"\n [attr.aria-selected]=\"isSameYear(year) ? true : null\"\n (click)=\"selectYear(year)\"\n [ngClass]=\"{ selected: isSameYear(year) }\"\n >\n {{ year }}\n </div>\n </div>\n }\n </div>\n } @if (mode === QdCalendarMode.MonthPicker) {\n <div\n class=\"picker\"\n role=\"listbox\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.monthPicker' | translate\"\n (keydown)=\"onPickerKeydown($event)\"\n >\n @for (month of months; track month; let i = $index) {\n <div class=\"col {{ month }}\">\n <div\n #pickerCell\n role=\"option\"\n class=\"entry\"\n [attr.tabindex]=\"isActivePicker(i) ? 0 : -1\"\n [attr.aria-selected]=\"isSameMonth(i) ? true : null\"\n (click)=\"selectMonth(i)\"\n [ngClass]=\"{ selected: isSameMonth(i), month }\"\n >\n {{ month }}\n </div>\n </div>\n }\n </div>\n }\n</div>\n}\n", styles: [".nav{color:#171717;font-size:1rem;font-weight:700;line-height:1.5rem;display:grid;margin:.75rem;grid-template-columns:[next] 2rem [monthyear] auto [prev] 2rem [end];text-transform:capitalize}.nav span{line-height:2.5rem;text-align:center}.nav .header-toggle{padding:0;border:0;background:transparent;color:inherit;font:inherit;line-height:2.5rem;text-align:center;text-transform:inherit}.nav .current-month-year,.nav .current-years-list,.nav .current-year{cursor:pointer}tbody{display:inherit;margin:.75rem}td,th{color:#171717;font-size:.875rem;font-weight:400;line-height:1.3125rem;min-width:2.5625rem;padding:.4375rem;text-align:center;text-transform:capitalize}td.disabled,th.disabled{color:#d5d5d5;pointer-events:none}td.hidden,th.hidden{opacity:0;pointer-events:none}td.today,th.today{box-shadow:0 0 0 .125rem #d5d5d5 inset}td.selected,td.day:hover,th.selected,th.day:hover{background:#d5d5d5;cursor:pointer}.picker{display:flex;width:100%;flex-wrap:wrap;padding:.75rem}.picker .col{flex:0 0 33.33%;padding:.5rem .25rem}.picker .entry{padding:.4375rem;background:#d5d5d5;cursor:pointer;text-align:center}.picker .entry.selected,.picker .entry:hover{background:gray}td.day:focus,.nav button:focus,.picker .entry:focus{outline:none}
|
|
10924
|
+
args: [{ selector: 'qd-calendar', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"nav\">\n <button type=\"button\" class=\"nav-prev\" (click)=\"prev()\" [attr.aria-label]=\"prevAriaKey | translate\">\n <qd-icon icon=\"arrowLeft\"></qd-icon>\n </button>\n\n <ng-container>\n @if (mode === QdCalendarMode.Default) {\n <button\n type=\"button\"\n class=\"header-toggle current-month-year\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.chooseMonthYear' | translate\"\n (click)=\"changeMode(QdCalendarMode.YearPicker)\"\n >\n {{ currentDate.locale(language).format(\"MMMM\") }} {{ currentDate?.format(\"YYYY\") }}\n </button>\n } @if (mode === QdCalendarMode.YearPicker) {\n <button\n type=\"button\"\n class=\"header-toggle current-years-list\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.chooseMonthYear' | translate\"\n (click)=\"changeMode(QdCalendarMode.MonthPicker)\"\n >\n {{ years[0] }} - {{ years[years.length - 1] }}\n </button>\n } @if (mode === QdCalendarMode.MonthPicker) {\n <button\n type=\"button\"\n class=\"header-toggle current-year\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.chooseMonthYear' | translate\"\n (click)=\"changeMode(QdCalendarMode.YearPicker)\"\n >\n {{ currentDate?.format(\"YYYY\") }}\n </button>\n }\n </ng-container>\n\n <button type=\"button\" class=\"nav-next\" (click)=\"next()\" [attr.aria-label]=\"nextAriaKey | translate\">\n <qd-icon icon=\"arrowRight\"></qd-icon>\n </button>\n</div>\n\n@if (mode === QdCalendarMode.Default) {\n<table\n role=\"grid\"\n [attr.aria-label]=\"currentDate.locale(language).format('MMMM YYYY')\"\n (keydown)=\"onGridKeydown($event)\"\n>\n <tbody>\n <tr role=\"row\">\n @for (name of weekdays; track $index) {\n <th scope=\"col\" class=\"weekday\">{{ name }}</th>\n }\n </tr>\n @for (week of weeks; track $index) {\n <tr role=\"row\">\n @for (day of week; track day.moment.valueOf()) {\n <td\n #dayCell\n role=\"gridcell\"\n class=\"day {{ day.moment.date() }}\"\n [attr.data-date]=\"day.moment.format('YYYY-MM-DD')\"\n [attr.tabindex]=\"isActive(day.moment) ? 0 : -1\"\n [attr.aria-label]=\"day.moment.locale(language).format('D. MMMM YYYY')\"\n [attr.aria-selected]=\"day.selected ? true : null\"\n [attr.aria-current]=\"day.today ? 'date' : null\"\n [attr.aria-disabled]=\"day.disabled ? true : null\"\n [attr.aria-hidden]=\"!isSameYearMonth(day.moment) ? true : null\"\n (click)=\"selectDate(day)\"\n [ngClass]=\"{\n today: day.today,\n selected: day.selected,\n hidden: !isSameYearMonth(day.moment),\n disabled: day.disabled\n }\"\n >\n {{ day.moment.date() }}\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n} @if (mode !== QdCalendarMode.Default) {\n<div class=\"calendar\">\n @if (mode === QdCalendarMode.YearPicker) {\n <div\n class=\"picker\"\n role=\"listbox\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.yearPicker' | translate\"\n (keydown)=\"onPickerKeydown($event)\"\n >\n @for (year of years; track year; let i = $index) {\n <div class=\"col {{ year }}\">\n <div\n #pickerCell\n role=\"option\"\n class=\"entry\"\n [attr.tabindex]=\"isActivePicker(i) ? 0 : -1\"\n [attr.aria-selected]=\"isSameYear(year) ? true : null\"\n (click)=\"selectYear(year)\"\n [ngClass]=\"{ selected: isSameYear(year) }\"\n >\n {{ year }}\n </div>\n </div>\n }\n </div>\n } @if (mode === QdCalendarMode.MonthPicker) {\n <div\n class=\"picker\"\n role=\"listbox\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.monthPicker' | translate\"\n (keydown)=\"onPickerKeydown($event)\"\n >\n @for (month of months; track month; let i = $index) {\n <div class=\"col {{ month }}\">\n <div\n #pickerCell\n role=\"option\"\n class=\"entry\"\n [attr.tabindex]=\"isActivePicker(i) ? 0 : -1\"\n [attr.aria-selected]=\"isSameMonth(i) ? true : null\"\n (click)=\"selectMonth(i)\"\n [ngClass]=\"{ selected: isSameMonth(i), month }\"\n >\n {{ month }}\n </div>\n </div>\n }\n </div>\n }\n</div>\n}\n", styles: [".nav{color:#171717;font-size:1rem;font-weight:700;line-height:1.5rem;display:grid;margin:.75rem;grid-template-columns:[next] 2rem [monthyear] auto [prev] 2rem [end];text-transform:capitalize}.nav span{line-height:2.5rem;text-align:center}.nav .header-toggle{padding:0;border:0;background:transparent;color:inherit;font:inherit;line-height:2.5rem;text-align:center;text-transform:inherit}.nav .current-month-year,.nav .current-years-list,.nav .current-year{cursor:pointer}tbody{display:inherit;margin:.75rem}td,th{color:#171717;font-size:.875rem;font-weight:400;line-height:1.3125rem;min-width:2.5625rem;padding:.4375rem;text-align:center;text-transform:capitalize}td.disabled,th.disabled{color:#d5d5d5;pointer-events:none}td.hidden,th.hidden{opacity:0;pointer-events:none}td.today,th.today{box-shadow:0 0 0 .125rem #d5d5d5 inset}td.selected,td.day:hover,th.selected,th.day:hover{background:#d5d5d5;cursor:pointer}.picker{display:flex;width:100%;flex-wrap:wrap;padding:.75rem}.picker .col{flex:0 0 33.33%;padding:.5rem .25rem}.picker .entry{padding:.4375rem;background:#d5d5d5;cursor:pointer;text-align:center}.picker .entry.selected,.picker .entry:hover{background:gray}td.day:focus,.nav button:focus,.picker .entry:focus{outline:none}td.day:focus-visible,.nav button:focus-visible,.picker .entry:focus-visible{box-shadow:inset 0 0 0 2px #069}\n"] }]
|
|
10960
10925
|
}], propDecorators: { selectedDate: [{
|
|
10961
10926
|
type: Input
|
|
10962
10927
|
}], language: [{
|
|
@@ -10975,7 +10940,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
10975
10940
|
args: ['pickerCell']
|
|
10976
10941
|
}] } });
|
|
10977
10942
|
|
|
10978
|
-
// @ts-strict-ignore
|
|
10979
10943
|
class TimePickerService {
|
|
10980
10944
|
getConfig(customConfig) {
|
|
10981
10945
|
const defaultConfig = {
|
|
@@ -11039,38 +11003,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
11039
11003
|
}]
|
|
11040
11004
|
}] });
|
|
11041
11005
|
|
|
11042
|
-
class QdKeyboardDetectionService {
|
|
11043
|
-
static KEYBOARD_ACTIVE_CLASS = 'qd-keyboard-active';
|
|
11044
|
-
document = inject(DOCUMENT);
|
|
11045
|
-
ngZone = inject(NgZone);
|
|
11046
|
-
onKeydown = () => {
|
|
11047
|
-
this.document?.documentElement?.classList.add(QdKeyboardDetectionService.KEYBOARD_ACTIVE_CLASS);
|
|
11048
|
-
};
|
|
11049
|
-
onPointerdown = () => {
|
|
11050
|
-
this.document?.documentElement?.classList.remove(QdKeyboardDetectionService.KEYBOARD_ACTIVE_CLASS);
|
|
11051
|
-
};
|
|
11052
|
-
constructor() {
|
|
11053
|
-
const root = this.document?.documentElement;
|
|
11054
|
-
if (!root)
|
|
11055
|
-
return;
|
|
11056
|
-
root.classList.add(QdKeyboardDetectionService.KEYBOARD_ACTIVE_CLASS);
|
|
11057
|
-
this.ngZone.runOutsideAngular(() => {
|
|
11058
|
-
this.document.addEventListener('keydown', this.onKeydown, true);
|
|
11059
|
-
this.document.addEventListener('pointerdown', this.onPointerdown, true);
|
|
11060
|
-
});
|
|
11061
|
-
}
|
|
11062
|
-
ngOnDestroy() {
|
|
11063
|
-
this.document?.removeEventListener('keydown', this.onKeydown, true);
|
|
11064
|
-
this.document?.removeEventListener('pointerdown', this.onPointerdown, true);
|
|
11065
|
-
}
|
|
11066
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdKeyboardDetectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
11067
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdKeyboardDetectionService, providedIn: 'root' });
|
|
11068
|
-
}
|
|
11069
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdKeyboardDetectionService, decorators: [{
|
|
11070
|
-
type: Injectable,
|
|
11071
|
-
args: [{ providedIn: 'root' }]
|
|
11072
|
-
}], ctorParameters: () => [] });
|
|
11073
|
-
|
|
11074
11006
|
/**
|
|
11075
11007
|
* Provide focusable components by this token.
|
|
11076
11008
|
*/
|
|
@@ -11580,7 +11512,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
11580
11512
|
args: [QdFormOptionItemComponent]
|
|
11581
11513
|
}] } });
|
|
11582
11514
|
|
|
11583
|
-
// @ts-strict-ignore
|
|
11584
11515
|
/**
|
|
11585
11516
|
* The **QdDropdown** is an component that provides a dropdown form element.<br />
|
|
11586
11517
|
* It can be used with Quadrel Reactive Forms or with model binding.
|
|
@@ -11613,17 +11544,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
11613
11544
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
11614
11545
|
*/
|
|
11615
11546
|
class QdDropdownComponent {
|
|
11616
|
-
|
|
11617
|
-
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
|
|
11621
|
-
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
|
|
11625
|
-
|
|
11626
|
-
|
|
11547
|
+
_translateService = inject(TranslateService);
|
|
11548
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
11549
|
+
_actionEmitterService = inject(QdFormsActionEmitterService);
|
|
11550
|
+
_resolverRegistry = inject(QdFormOptionsResolverRegistry);
|
|
11551
|
+
_optionsService = inject(QdFormOptionsService);
|
|
11552
|
+
_keyboardService = inject(QdFormKeyboardService);
|
|
11553
|
+
_injector = inject(Injector);
|
|
11554
|
+
_controlContainer = inject(ControlContainer, { optional: true, host: true, skipSelf: true });
|
|
11555
|
+
_eventBrokerService = inject(QdEventBrokerService, { optional: true });
|
|
11556
|
+
_elementRef = inject(ElementRef);
|
|
11557
|
+
_document = inject(DOCUMENT);
|
|
11627
11558
|
/**
|
|
11628
11559
|
* The current form item value, if you are working with Model Binding.
|
|
11629
11560
|
*
|
|
@@ -11640,7 +11571,7 @@ class QdDropdownComponent {
|
|
|
11640
11571
|
* Current selected value
|
|
11641
11572
|
*/
|
|
11642
11573
|
get value() {
|
|
11643
|
-
return this._value ?? this.options.find(option => option.active)?.value;
|
|
11574
|
+
return (this._value ?? this.options.find(option => option.active)?.value);
|
|
11644
11575
|
}
|
|
11645
11576
|
/**
|
|
11646
11577
|
* Identifier to distinguish click events on same options in different dropdowns.
|
|
@@ -11695,6 +11626,7 @@ class QdDropdownComponent {
|
|
|
11695
11626
|
qdPopoverMaxHeight = 250;
|
|
11696
11627
|
/**
|
|
11697
11628
|
* Emits event when the value has changed. Return value matches the current value.
|
|
11629
|
+
* It is `null` or `undefined` when the selected option has no value.
|
|
11698
11630
|
*/
|
|
11699
11631
|
valueChange = new EventEmitter();
|
|
11700
11632
|
/**
|
|
@@ -11753,7 +11685,7 @@ class QdDropdownComponent {
|
|
|
11753
11685
|
filter = false;
|
|
11754
11686
|
options;
|
|
11755
11687
|
filterText = '';
|
|
11756
|
-
filteredOptions$ = this.
|
|
11688
|
+
filteredOptions$ = this._optionsService.filteredOptions$;
|
|
11757
11689
|
control;
|
|
11758
11690
|
_value = null;
|
|
11759
11691
|
_selectedOption = null;
|
|
@@ -11773,13 +11705,13 @@ class QdDropdownComponent {
|
|
|
11773
11705
|
return this._selectedOption;
|
|
11774
11706
|
}
|
|
11775
11707
|
get hasHint() {
|
|
11776
|
-
return this.config?.hint?.i18n && !this.config.hint.disabled;
|
|
11708
|
+
return !!(this.config?.hint?.i18n && !this.config.hint.disabled);
|
|
11777
11709
|
}
|
|
11778
11710
|
get isSelected() {
|
|
11779
11711
|
return this.selectedOption !== undefined;
|
|
11780
11712
|
}
|
|
11781
11713
|
get errors() {
|
|
11782
|
-
return this.control ? this.control.errors : [];
|
|
11714
|
+
return (this.control ? this.control.errors : []);
|
|
11783
11715
|
}
|
|
11784
11716
|
get selected() {
|
|
11785
11717
|
return this.placeholderPrefix + this.placeholder;
|
|
@@ -11791,18 +11723,18 @@ class QdDropdownComponent {
|
|
|
11791
11723
|
}
|
|
11792
11724
|
get placeholderPrefix() {
|
|
11793
11725
|
return this.config?.placeholderPrefix?.i18n && !this.config.placeholderPrefix.disabled
|
|
11794
|
-
? this.
|
|
11726
|
+
? this._translateService.instant(this.config.placeholderPrefix.i18n) + ' '
|
|
11795
11727
|
: '';
|
|
11796
11728
|
}
|
|
11797
11729
|
get placeholder() {
|
|
11798
11730
|
return this.config?.placeholder?.i18n && !this.config.placeholder.disabled
|
|
11799
|
-
? this.
|
|
11800
|
-
: this.
|
|
11731
|
+
? this._translateService.instant(this.config.placeholder.i18n)
|
|
11732
|
+
: this._translateService.instant('i18n.qd.dropdown.defaultValue');
|
|
11801
11733
|
}
|
|
11802
11734
|
constructor() {
|
|
11803
11735
|
if (!this.id)
|
|
11804
11736
|
this.id = v4();
|
|
11805
|
-
this.
|
|
11737
|
+
this._optionsService.optionsResolved$
|
|
11806
11738
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
11807
11739
|
.subscribe(resolvedEvent => this.optionsResolved.emit(resolvedEvent));
|
|
11808
11740
|
}
|
|
@@ -11812,26 +11744,26 @@ class QdDropdownComponent {
|
|
|
11812
11744
|
this.loadOptionsForCurrentConfig();
|
|
11813
11745
|
this.resolveControl();
|
|
11814
11746
|
this.updateSelectedOption(this.value);
|
|
11815
|
-
this.
|
|
11747
|
+
this._actionEmitterService.hintEventEmitter$
|
|
11816
11748
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
11817
11749
|
.subscribe(() => this.clickHint.emit());
|
|
11818
|
-
this.
|
|
11750
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
11819
11751
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
11820
11752
|
.subscribe(() => this.clickReadonly.emit());
|
|
11821
|
-
this.
|
|
11753
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
11822
11754
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
11823
11755
|
.subscribe(() => this.clickViewonly.emit());
|
|
11824
11756
|
this.initOpModeSubscription();
|
|
11825
11757
|
}
|
|
11826
11758
|
ngOnChanges(changes) {
|
|
11827
|
-
if (changes
|
|
11759
|
+
if (changes['config']) {
|
|
11828
11760
|
this.updateConfiguration();
|
|
11829
11761
|
if (this.haveOptionsChanged(changes))
|
|
11830
11762
|
this.handleOptionsChange();
|
|
11831
11763
|
}
|
|
11832
11764
|
}
|
|
11833
11765
|
ngOnDestroy() {
|
|
11834
|
-
this.
|
|
11766
|
+
this._optionsService.reset();
|
|
11835
11767
|
}
|
|
11836
11768
|
focus() {
|
|
11837
11769
|
this.box.nativeElement.focus();
|
|
@@ -11845,20 +11777,20 @@ class QdDropdownComponent {
|
|
|
11845
11777
|
writeValue(value) {
|
|
11846
11778
|
this.value = value;
|
|
11847
11779
|
this.updateSelectedOption(value);
|
|
11848
|
-
this.
|
|
11780
|
+
this.emitValueChange(this.value);
|
|
11849
11781
|
}
|
|
11850
11782
|
setDisabledState(disabled) {
|
|
11851
11783
|
this.disabled = disabled;
|
|
11852
11784
|
}
|
|
11853
11785
|
hasOptions() {
|
|
11854
|
-
return this.
|
|
11786
|
+
return this._optionsService.hasOptions();
|
|
11855
11787
|
}
|
|
11856
11788
|
handleOptionSelected(option) {
|
|
11857
11789
|
this._value = option.value;
|
|
11858
11790
|
this._selectedOption = option;
|
|
11859
11791
|
this._onChange(option.value);
|
|
11860
11792
|
this._onTouch(option.value);
|
|
11861
|
-
this.
|
|
11793
|
+
this.emitValueChange(option.value);
|
|
11862
11794
|
}
|
|
11863
11795
|
handleClick(option) {
|
|
11864
11796
|
this._isWaitingForNextFocus = true;
|
|
@@ -11866,21 +11798,21 @@ class QdDropdownComponent {
|
|
|
11866
11798
|
this._onTouch(option.value);
|
|
11867
11799
|
this.value = option.value;
|
|
11868
11800
|
this._selectedOption = option;
|
|
11869
|
-
this.
|
|
11801
|
+
this.emitValueChange(option.value);
|
|
11870
11802
|
this.dropdownDirective?.close();
|
|
11871
11803
|
}
|
|
11872
11804
|
handleFilterChange($event) {
|
|
11873
11805
|
const trimmed = ($event ?? '').trim();
|
|
11874
11806
|
this.filterText = trimmed;
|
|
11875
|
-
this.
|
|
11876
|
-
this.
|
|
11807
|
+
this._optionsService.load(trimmed);
|
|
11808
|
+
this._changeDetectorRef.detectChanges();
|
|
11877
11809
|
}
|
|
11878
11810
|
onListKeydown(event) {
|
|
11879
11811
|
if (!this.isOpen)
|
|
11880
11812
|
return;
|
|
11881
11813
|
switch (event.key) {
|
|
11882
11814
|
case 'Enter': {
|
|
11883
|
-
const option = this.
|
|
11815
|
+
const option = this._keyboardService.pickActiveOption();
|
|
11884
11816
|
if (!option)
|
|
11885
11817
|
return;
|
|
11886
11818
|
this.handleClick(option);
|
|
@@ -11889,7 +11821,7 @@ class QdDropdownComponent {
|
|
|
11889
11821
|
}
|
|
11890
11822
|
case 'ArrowUp':
|
|
11891
11823
|
case 'ArrowDown':
|
|
11892
|
-
this.
|
|
11824
|
+
this._keyboardService.handleKeydown(event);
|
|
11893
11825
|
}
|
|
11894
11826
|
}
|
|
11895
11827
|
onOpenDropdown() {
|
|
@@ -11901,7 +11833,7 @@ class QdDropdownComponent {
|
|
|
11901
11833
|
this.dropdownOpened.emit(true);
|
|
11902
11834
|
this.loadOptionsForCurrentConfig();
|
|
11903
11835
|
setTimeout(() => {
|
|
11904
|
-
this.
|
|
11836
|
+
this._keyboardService.setActiveOptionByValue(this._selectedOption?.value ?? '');
|
|
11905
11837
|
this.filterInput?.nativeElement.focus();
|
|
11906
11838
|
this.filterInput?.nativeElement.scrollIntoView({ block: 'start', behavior: 'auto' });
|
|
11907
11839
|
});
|
|
@@ -11928,10 +11860,10 @@ class QdDropdownComponent {
|
|
|
11928
11860
|
emitBlurredIfFocusLeft() {
|
|
11929
11861
|
if (!this._hasFocus || this.isOpen)
|
|
11930
11862
|
return;
|
|
11931
|
-
const focused = this.
|
|
11863
|
+
const focused = this._document.activeElement;
|
|
11932
11864
|
if (this.isFocusInside(focused))
|
|
11933
11865
|
return;
|
|
11934
|
-
if (this._isWaitingForNextFocus && (!focused || focused === this.
|
|
11866
|
+
if (this._isWaitingForNextFocus && (!focused || focused === this._document.body))
|
|
11935
11867
|
return;
|
|
11936
11868
|
this._hasFocus = false;
|
|
11937
11869
|
this._isWaitingForNextFocus = false;
|
|
@@ -11939,18 +11871,21 @@ class QdDropdownComponent {
|
|
|
11939
11871
|
}
|
|
11940
11872
|
isFocusInside(focused) {
|
|
11941
11873
|
const popover = this.dropdownDirective?.overlayRef?.overlayElement;
|
|
11942
|
-
return this.
|
|
11874
|
+
return this._elementRef.nativeElement.contains(focused) || !!popover?.contains(focused);
|
|
11875
|
+
}
|
|
11876
|
+
emitValueChange(value) {
|
|
11877
|
+
this.valueChange.emit(value);
|
|
11943
11878
|
}
|
|
11944
11879
|
loadOptionsForCurrentConfig() {
|
|
11945
|
-
this.
|
|
11946
|
-
this.
|
|
11880
|
+
this._optionsService.initialize(this.config);
|
|
11881
|
+
this._optionsService.validateOptionsSetup('QdDropdown');
|
|
11947
11882
|
}
|
|
11948
11883
|
resolveControl() {
|
|
11949
|
-
if (this.
|
|
11950
|
-
this.control = this.
|
|
11884
|
+
if (this._controlContainer && this.formControlName) {
|
|
11885
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
11951
11886
|
return;
|
|
11952
11887
|
}
|
|
11953
|
-
const directive = this.
|
|
11888
|
+
const directive = this._injector.get(FormControlDirective, null);
|
|
11954
11889
|
if (directive) {
|
|
11955
11890
|
this.control = directive.control;
|
|
11956
11891
|
return;
|
|
@@ -11969,7 +11904,7 @@ class QdDropdownComponent {
|
|
|
11969
11904
|
this.options = getOptions(this.config);
|
|
11970
11905
|
}
|
|
11971
11906
|
haveOptionsChanged(changes) {
|
|
11972
|
-
return !qdIsDeepEqual(changes
|
|
11907
|
+
return !qdIsDeepEqual(changes['config'].previousValue?.options, changes['config'].currentValue?.options);
|
|
11973
11908
|
}
|
|
11974
11909
|
handleOptionsChange() {
|
|
11975
11910
|
if (this.value && !this.options.find(option => option.value === this.value)) {
|
|
@@ -11978,7 +11913,7 @@ class QdDropdownComponent {
|
|
|
11978
11913
|
this.valueChange.emit('');
|
|
11979
11914
|
}
|
|
11980
11915
|
this.updateSelectedOption(this.value);
|
|
11981
|
-
this.
|
|
11916
|
+
this._optionsService.updateStaticOptions(this.config.options);
|
|
11982
11917
|
}
|
|
11983
11918
|
updateSelectedOption(value) {
|
|
11984
11919
|
if (!this.config || !Array.isArray(this.config.options))
|
|
@@ -11986,9 +11921,9 @@ class QdDropdownComponent {
|
|
|
11986
11921
|
this._selectedOption = this.config.options.find(opt => opt.value === value) ?? null;
|
|
11987
11922
|
}
|
|
11988
11923
|
initOpModeSubscription() {
|
|
11989
|
-
if (!this.
|
|
11924
|
+
if (!this._eventBrokerService)
|
|
11990
11925
|
return;
|
|
11991
|
-
this.
|
|
11926
|
+
this._eventBrokerService
|
|
11992
11927
|
.consume('operation_mode_changed')
|
|
11993
11928
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
11994
11929
|
.subscribe(topic => {
|
|
@@ -12012,7 +11947,7 @@ class QdDropdownComponent {
|
|
|
12012
11947
|
provide: QD_FOCUSABLE_TOKEN,
|
|
12013
11948
|
useExisting: QdDropdownComponent
|
|
12014
11949
|
}
|
|
12015
|
-
], viewQueries: [{ propertyName: "filterInput", first: true, predicate: ["filterInput"], descendants: true }, { propertyName: "dropdownDirective", first: true, predicate: QdPopoverOnClickDirective, descendants: true }, { propertyName: "box", first: true, predicate: ["box"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<qd-form-label\n [label]=\"label\"\n [readonly]=\"readonly\"\n [viewonly]=\"viewonly\"\n [control]=\"control\"\n [tooltip]=\"config?.tooltip\"\n [data-test-id]=\"testId\"\n></qd-form-label>\n\n<div class=\"qd-dropdown__wrapper\">\n @if (!readonly && !viewonly && hasOptions) {\n <div\n class=\"qd-dropdown__box\"\n tabindex=\"0\"\n [attr.data-test-id]=\"testId + '-box'\"\n (keydown)=\"onListKeydown($event)\"\n [qdPopoverOnClick]=\"dropdownMenu\"\n [qdPopoverCloseStrategy]=\"'onOutsideClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverDisabled]=\"disabled\"\n [qdPopoverMaxHeight]=\"qdPopoverMaxHeight\"\n [qdPopoverMinWidth]=\"160\"\n [qdPopoverAutoSize]=\"{ width: true }\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n [qdPopoverFlipIntoViewport]=\"true\"\n [qdPopoverOffsetY]=\"2\"\n (opened)=\"onOpenDropdown()\"\n (closed)=\"onDropdownClosed()\"\n qdPopoverPlacement=\"bottom-start\"\n >\n {{ (selectedOption?.i18n | translate) || placeholder }}\n <div class=\"qd-dropdown-suffix\">\n @if (hasError) {\n <qd-icon class=\"qd-error-icon\" icon=\"exclamationCircleSolid\"></qd-icon>\n }\n </div>\n </div>\n }\n</div>\n\n@if (!readonly && !viewonly && (hasHint || hasError)) {\n<qd-form-hint\n [hint]=\"hasHint ? config.hint.i18n : ''\"\n [control]=\"control\"\n [hasError]=\"hasError\"\n [hintAction]=\"hintAction\"\n [data-test-id]=\"testId\"\n></qd-form-hint>\n} @if (readonly) {\n<qd-form-readonly\n [values]=\"[selectedOption]\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n} @if (viewonly) {\n<qd-form-viewonly\n [values]=\"[selectedOption]\"\n [viewonlyAction]=\"viewonlyAction\"\n [status]=\"config?.viewonlyStatus\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n}\n\n<ng-template #dropdownMenu>\n <qd-form-options-list\n [options]=\"filteredOptions$ | async\"\n [id]=\"id\"\n [radioName]=\"testId + '-options'\"\n [data-test-id]=\"testId\"\n (optionSelected)=\"handleClick($event)\"\n >\n <div qdFormOptionsListHeader class=\"filter-wrapper\">\n @if (filter) {\n <input\n #filterInput\n type=\"text\"\n class=\"qd-dropdown__filter\"\n [(ngModel)]=\"filterText\"\n (ngModelChange)=\"handleFilterChange($event)\"\n (keydown)=\"onListKeydown($event)\"\n [attr.data-test-id]=\"testId + '-filter'\"\n autocomplete=\"off\"\n />\n\n <qd-icon [icon]=\"'filter'\" class=\"qd-dropdown__filter-magnifier\"></qd-icon>\n }\n </div>\n </qd-form-options-list>\n</ng-template>\n", styles: [".qd-dropdown__wrapper{position:relative;margin-bottom:.375rem}.qd-dropdown__wrapper.dense{margin-bottom:0}.qd-dropdown__wrapper .qd-dropdown__box{display:flex;overflow:hidden;width:100%;height:2.25rem;justify-content:space-between;padding:0 .75rem;border:.0625rem solid rgb(180,180,180);margin-bottom:.25rem;background:#fff;color:#fff;font-size:.875rem;font-weight:400;line-height:2.25rem;text-overflow:ellipsis;white-space:nowrap}.qd-dropdown__wrapper .qd-dropdown__box.dense{margin-bottom:0}.qd-dropdown-selected .qd-dropdown__wrapper .qd-dropdown__box{color:#171717}.qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown__wrapper .qd-dropdown__box:active,.qd-dropdown__wrapper .qd-dropdown__box:hover{padding:0 .6875rem;border-width:.125rem;border-color:#171717;line-height:2.125rem;outline:0}.qd-dropdown__wrapper .qd-dropdown__box:active{color:#b4b4b4}.qd-dropdown__wrapper .qd-dropdown__box:hover:after{border-top-color:#b4b4b4}.qd-dropdown__wrapper .qd-dropdown__box:after{position:absolute;z-index:5;top:1rem;right:.75rem;width:0;height:0;border-top:.3125rem solid rgb(180,180,180);border-right:.3125rem solid rgba(255,255,255,0);border-left:.3125rem solid rgba(255,255,255,0);content:\"\";pointer-events:none}.qd-dropdown__wrapper .qd-dropdown__box .qd-dropdown-suffix{position:relative;z-index:8;margin-right:1rem;background:#fff}.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box{background:#f5f5f5;color:#979797}.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box:hover,.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box:active{padding:0 .75rem;border:.0625rem solid rgb(180,180,180);line-height:2.25rem}.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box{height:inherit;padding:0;border:none;line-height:2.25rem}.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:hover,.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:active{color:inherit}.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:after{display:none}.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box{height:inherit;padding:0;border:none;line-height:2.25rem}.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:hover,.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:active{color:inherit}.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:after{display:none}.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly{color:#069;cursor:pointer}.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly:hover,.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly:active,.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly:focus{color:#069;text-decoration:underline}.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly{color:#069;cursor:pointer}.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly:hover,.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly:active,.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly:focus{color:#069;text-decoration:underline}.qd-dropdown-error .qd-dropdown__box{padding:0 .75rem;border:.0625rem solid rgb(199,0,35);line-height:2.25rem}.qd-dropdown-error .qd-dropdown__box:focus,.qd-dropdown-error .qd-dropdown__box:hover,.qd-dropdown-error .qd-dropdown__box:active{padding:0 .6875rem;border:.125rem solid rgb(199,0,35);line-height:2.125rem}.qd-dropdown-error .qd-dropdown__box .qd-error-icon{color:#c70023}.qd-dropdown{display:block;height:4.5rem;margin-bottom:.75rem}.qd-dropdown.dense{width:100%;height:auto;margin-bottom:0}.qd-dropdown.dense .qd-dropdown__wrapper,.qd-dropdown.dense .qd-dropdown__box{margin-bottom:0}.qd-dropdown-open .qd-dropdown__wrapper .qd-dropdown__box{padding:0 .6875rem;border-width:.125rem;border-color:#069;line-height:2.125rem}.qd-dropdown-open .qd-dropdown__wrapper .qd-dropdown__box:after{border-top:none;border-bottom:.3125rem solid rgb(23,23,23)}.filter-wrapper{position:relative}.qd-dropdown__filter{width:100%;height:2.25rem;padding:0 .75rem 0 2.25rem;border:none;border-bottom:.0625rem solid rgb(213,213,213);background:#fff;color:#171717;overflow-y:auto;scroll-behavior:smooth}.qd-dropdown__filter:focus,.qd-dropdown__filter:hover,.qd-dropdown__filter:active{border:none;border-bottom:.125rem solid rgb(23,23,23);background:#f5f5f5;outline:none}.qd-dropdown-filter-focus .qd-dropdown__filter{border-bottom:.125rem solid rgb(0,102,153)}.qd-dropdown-filter-focus .qd-dropdown__filter:focus,.qd-dropdown-filter-focus .qd-dropdown__filter:hover,.qd-dropdown-filter-focus .qd-dropdown__filter:active{border-bottom:.125rem solid rgb(0,102,153)}.qd-dropdown__filter-magnifier{position:absolute;top:0;left:0;padding:.625rem 0 .625rem .75rem}.qd-dropdown__filter-magnifier .qd-icon{color:#757575}\n"], dependencies: [{ kind: "directive", type: i1$1.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: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "qdPopoverPlacement", "qdPopoverOffsetX", "qdPopoverOffsetY", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl", "qdPopoverRestoreFocus", "qdPopoverFlipIntoViewport"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "component", type: QdFormHintComponent, selector: "qd-form-hint", inputs: ["hint", "control", "hasError", "hintAction", "data-test-id"] }, { kind: "component", type: QdFormLabelComponent, selector: "qd-form-label", inputs: ["label", "isDisabled", "readonly", "viewonly", "control", "tooltip", "data-test-id"] }, { kind: "component", type: QdFormReadonlyComponent, selector: "qd-form-readonly", inputs: ["values", "readonlyAction", "data-test-id"] }, { kind: "component", type: QdFormViewonlyComponent, selector: "qd-form-viewonly", inputs: ["values", "viewonlyAction", "status", "data-test-id"] }, { kind: "component", type: QdFormOptionsListComponent, selector: "qd-form-options-list", inputs: ["id", "options", "radioName", "data-test-id"], outputs: ["optionSelected"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
11950
|
+
], viewQueries: [{ propertyName: "filterInput", first: true, predicate: ["filterInput"], descendants: true }, { propertyName: "dropdownDirective", first: true, predicate: QdPopoverOnClickDirective, descendants: true }, { propertyName: "box", first: true, predicate: ["box"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<qd-form-label\n [label]=\"label\"\n [readonly]=\"readonly\"\n [viewonly]=\"viewonly\"\n [control]=\"control\"\n [tooltip]=\"config?.tooltip\"\n [data-test-id]=\"testId\"\n></qd-form-label>\n\n<div class=\"qd-dropdown__wrapper\">\n @if (!readonly && !viewonly && hasOptions) {\n <div\n class=\"qd-dropdown__box\"\n tabindex=\"0\"\n [attr.data-test-id]=\"testId + '-box'\"\n (keydown)=\"onListKeydown($event)\"\n [qdPopoverOnClick]=\"dropdownMenu\"\n [qdPopoverCloseStrategy]=\"'onOutsideClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverDisabled]=\"disabled\"\n [qdPopoverMaxHeight]=\"qdPopoverMaxHeight\"\n [qdPopoverMinWidth]=\"160\"\n [qdPopoverAutoSize]=\"{ width: true }\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n [qdPopoverFlipIntoViewport]=\"true\"\n [qdPopoverOffsetY]=\"2\"\n (opened)=\"onOpenDropdown()\"\n (closed)=\"onDropdownClosed()\"\n qdPopoverPlacement=\"bottom-start\"\n >\n {{ (selectedOption?.i18n | translate) || placeholder }}\n <div class=\"qd-dropdown-suffix\">\n @if (hasError) {\n <qd-icon class=\"qd-error-icon\" icon=\"exclamationCircleSolid\"></qd-icon>\n }\n </div>\n </div>\n }\n</div>\n\n@if (!readonly && !viewonly && (hasHint || hasError)) {\n<qd-form-hint\n [hint]=\"hasHint ? config.hint.i18n : ''\"\n [control]=\"control\"\n [hasError]=\"hasError\"\n [hintAction]=\"hintAction\"\n [data-test-id]=\"testId\"\n></qd-form-hint>\n} @if (readonly) {\n<qd-form-readonly\n [values]=\"[selectedOption]\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n} @if (viewonly) {\n<qd-form-viewonly\n [values]=\"[selectedOption]\"\n [viewonlyAction]=\"viewonlyAction\"\n [status]=\"config?.viewonlyStatus\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n}\n\n<ng-template #dropdownMenu>\n <qd-form-options-list\n [options]=\"filteredOptions$ | async\"\n [id]=\"id\"\n [radioName]=\"testId + '-options'\"\n [data-test-id]=\"testId\"\n (optionSelected)=\"handleClick($event)\"\n >\n <div qdFormOptionsListHeader class=\"filter-wrapper\">\n @if (filter) {\n <input\n #filterInput\n type=\"text\"\n class=\"qd-dropdown__filter\"\n [(ngModel)]=\"filterText\"\n (ngModelChange)=\"handleFilterChange($event)\"\n (keydown)=\"onListKeydown($event)\"\n [attr.data-test-id]=\"testId + '-filter'\"\n autocomplete=\"off\"\n />\n\n <qd-icon [icon]=\"'filter'\" class=\"qd-dropdown__filter-magnifier\"></qd-icon>\n }\n </div>\n </qd-form-options-list>\n</ng-template>\n", styles: [".qd-dropdown__wrapper{position:relative;margin-bottom:.375rem}.qd-dropdown__wrapper.dense{margin-bottom:0}.qd-dropdown__wrapper .qd-dropdown__box{display:flex;overflow:hidden;width:100%;height:2.25rem;justify-content:space-between;padding:0 .75rem;border:.0625rem solid rgb(180,180,180);margin-bottom:.25rem;background:#fff;color:#fff;font-size:.875rem;font-weight:400;line-height:2.25rem;text-overflow:ellipsis;white-space:nowrap}.qd-dropdown__wrapper .qd-dropdown__box.dense{margin-bottom:0}.qd-dropdown-selected .qd-dropdown__wrapper .qd-dropdown__box{color:#171717}.qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown__wrapper .qd-dropdown__box:active,.qd-dropdown__wrapper .qd-dropdown__box:hover{padding:0 .6875rem;border-width:.125rem;border-color:#171717;line-height:2.125rem;outline:0}.qd-dropdown__wrapper .qd-dropdown__box:focus{border-color:#069}.qd-dropdown__wrapper .qd-dropdown__box:active{color:#b4b4b4}.qd-dropdown__wrapper .qd-dropdown__box:hover:after{border-top-color:#b4b4b4}.qd-dropdown__wrapper .qd-dropdown__box:after{position:absolute;z-index:5;top:1rem;right:.75rem;width:0;height:0;border-top:.3125rem solid rgb(180,180,180);border-right:.3125rem solid rgba(255,255,255,0);border-left:.3125rem solid rgba(255,255,255,0);content:\"\";pointer-events:none}.qd-dropdown__wrapper .qd-dropdown__box .qd-dropdown-suffix{position:relative;z-index:8;margin-right:1rem;background:#fff}.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box{background:#f5f5f5;color:#979797}.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box:hover,.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box:active{padding:0 .75rem;border:.0625rem solid rgb(180,180,180);line-height:2.25rem}.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box{height:inherit;padding:0;border:none;line-height:2.25rem}.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:hover,.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:active{color:inherit}.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:after{display:none}.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box{height:inherit;padding:0;border:none;line-height:2.25rem}.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:hover,.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:active{color:inherit}.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:after{display:none}.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly{color:#069;cursor:pointer}.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly:hover,.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly:active,.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly:focus{color:#069;text-decoration:underline}.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly{color:#069;cursor:pointer}.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly:hover,.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly:active,.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly:focus{color:#069;text-decoration:underline}.qd-dropdown-error .qd-dropdown__box{padding:0 .75rem;border:.0625rem solid rgb(199,0,35);line-height:2.25rem}.qd-dropdown-error .qd-dropdown__box:focus,.qd-dropdown-error .qd-dropdown__box:hover,.qd-dropdown-error .qd-dropdown__box:active{padding:0 .6875rem;border:.125rem solid rgb(199,0,35);line-height:2.125rem}.qd-dropdown-error .qd-dropdown__box .qd-error-icon{color:#c70023}.qd-dropdown{display:block;height:4.5rem;margin-bottom:.75rem}.qd-dropdown.dense{width:100%;height:auto;margin-bottom:0}.qd-dropdown.dense .qd-dropdown__wrapper,.qd-dropdown.dense .qd-dropdown__box{margin-bottom:0}.qd-dropdown-open .qd-dropdown__wrapper .qd-dropdown__box{padding:0 .6875rem;border-width:.125rem;border-color:#069;line-height:2.125rem}.qd-dropdown-open .qd-dropdown__wrapper .qd-dropdown__box:after{border-top:none;border-bottom:.3125rem solid rgb(23,23,23)}.filter-wrapper{position:relative}.qd-dropdown__filter{width:100%;height:2.25rem;padding:0 .75rem 0 2.25rem;border:none;border-bottom:.0625rem solid rgb(213,213,213);background:#fff;color:#171717;overflow-y:auto;scroll-behavior:smooth}.qd-dropdown__filter:focus,.qd-dropdown__filter:hover,.qd-dropdown__filter:active{border:none;border-bottom:.125rem solid rgb(23,23,23);background:#f5f5f5;outline:none}.qd-dropdown-filter-focus .qd-dropdown__filter{border-bottom:.125rem solid rgb(0,102,153)}.qd-dropdown-filter-focus .qd-dropdown__filter:focus,.qd-dropdown-filter-focus .qd-dropdown__filter:hover,.qd-dropdown-filter-focus .qd-dropdown__filter:active{border-bottom:.125rem solid rgb(0,102,153)}.qd-dropdown__filter-magnifier{position:absolute;top:0;left:0;padding:.625rem 0 .625rem .75rem}.qd-dropdown__filter-magnifier .qd-icon{color:#757575}\n"], dependencies: [{ kind: "directive", type: i1$1.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: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "qdPopoverPlacement", "qdPopoverOffsetX", "qdPopoverOffsetY", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl", "qdPopoverRestoreFocus", "qdPopoverFlipIntoViewport"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "component", type: QdFormHintComponent, selector: "qd-form-hint", inputs: ["hint", "control", "hasError", "hintAction", "data-test-id"] }, { kind: "component", type: QdFormLabelComponent, selector: "qd-form-label", inputs: ["label", "isDisabled", "readonly", "viewonly", "control", "tooltip", "data-test-id"] }, { kind: "component", type: QdFormReadonlyComponent, selector: "qd-form-readonly", inputs: ["values", "readonlyAction", "data-test-id"] }, { kind: "component", type: QdFormViewonlyComponent, selector: "qd-form-viewonly", inputs: ["values", "viewonlyAction", "status", "data-test-id"] }, { kind: "component", type: QdFormOptionsListComponent, selector: "qd-form-options-list", inputs: ["id", "options", "radioName", "data-test-id"], outputs: ["optionSelected"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
12016
11951
|
}
|
|
12017
11952
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdDropdownComponent, decorators: [{
|
|
12018
11953
|
type: Component,
|
|
@@ -12030,7 +11965,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
12030
11965
|
provide: QD_FOCUSABLE_TOKEN,
|
|
12031
11966
|
useExisting: QdDropdownComponent
|
|
12032
11967
|
}
|
|
12033
|
-
], encapsulation: ViewEncapsulation.None, host: { class: 'qd-dropdown' }, standalone: false, template: "<qd-form-label\n [label]=\"label\"\n [readonly]=\"readonly\"\n [viewonly]=\"viewonly\"\n [control]=\"control\"\n [tooltip]=\"config?.tooltip\"\n [data-test-id]=\"testId\"\n></qd-form-label>\n\n<div class=\"qd-dropdown__wrapper\">\n @if (!readonly && !viewonly && hasOptions) {\n <div\n class=\"qd-dropdown__box\"\n tabindex=\"0\"\n [attr.data-test-id]=\"testId + '-box'\"\n (keydown)=\"onListKeydown($event)\"\n [qdPopoverOnClick]=\"dropdownMenu\"\n [qdPopoverCloseStrategy]=\"'onOutsideClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverDisabled]=\"disabled\"\n [qdPopoverMaxHeight]=\"qdPopoverMaxHeight\"\n [qdPopoverMinWidth]=\"160\"\n [qdPopoverAutoSize]=\"{ width: true }\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n [qdPopoverFlipIntoViewport]=\"true\"\n [qdPopoverOffsetY]=\"2\"\n (opened)=\"onOpenDropdown()\"\n (closed)=\"onDropdownClosed()\"\n qdPopoverPlacement=\"bottom-start\"\n >\n {{ (selectedOption?.i18n | translate) || placeholder }}\n <div class=\"qd-dropdown-suffix\">\n @if (hasError) {\n <qd-icon class=\"qd-error-icon\" icon=\"exclamationCircleSolid\"></qd-icon>\n }\n </div>\n </div>\n }\n</div>\n\n@if (!readonly && !viewonly && (hasHint || hasError)) {\n<qd-form-hint\n [hint]=\"hasHint ? config.hint.i18n : ''\"\n [control]=\"control\"\n [hasError]=\"hasError\"\n [hintAction]=\"hintAction\"\n [data-test-id]=\"testId\"\n></qd-form-hint>\n} @if (readonly) {\n<qd-form-readonly\n [values]=\"[selectedOption]\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n} @if (viewonly) {\n<qd-form-viewonly\n [values]=\"[selectedOption]\"\n [viewonlyAction]=\"viewonlyAction\"\n [status]=\"config?.viewonlyStatus\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n}\n\n<ng-template #dropdownMenu>\n <qd-form-options-list\n [options]=\"filteredOptions$ | async\"\n [id]=\"id\"\n [radioName]=\"testId + '-options'\"\n [data-test-id]=\"testId\"\n (optionSelected)=\"handleClick($event)\"\n >\n <div qdFormOptionsListHeader class=\"filter-wrapper\">\n @if (filter) {\n <input\n #filterInput\n type=\"text\"\n class=\"qd-dropdown__filter\"\n [(ngModel)]=\"filterText\"\n (ngModelChange)=\"handleFilterChange($event)\"\n (keydown)=\"onListKeydown($event)\"\n [attr.data-test-id]=\"testId + '-filter'\"\n autocomplete=\"off\"\n />\n\n <qd-icon [icon]=\"'filter'\" class=\"qd-dropdown__filter-magnifier\"></qd-icon>\n }\n </div>\n </qd-form-options-list>\n</ng-template>\n", styles: [".qd-dropdown__wrapper{position:relative;margin-bottom:.375rem}.qd-dropdown__wrapper.dense{margin-bottom:0}.qd-dropdown__wrapper .qd-dropdown__box{display:flex;overflow:hidden;width:100%;height:2.25rem;justify-content:space-between;padding:0 .75rem;border:.0625rem solid rgb(180,180,180);margin-bottom:.25rem;background:#fff;color:#fff;font-size:.875rem;font-weight:400;line-height:2.25rem;text-overflow:ellipsis;white-space:nowrap}.qd-dropdown__wrapper .qd-dropdown__box.dense{margin-bottom:0}.qd-dropdown-selected .qd-dropdown__wrapper .qd-dropdown__box{color:#171717}.qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown__wrapper .qd-dropdown__box:active,.qd-dropdown__wrapper .qd-dropdown__box:hover{padding:0 .6875rem;border-width:.125rem;border-color:#171717;line-height:2.125rem;outline:0}.qd-dropdown__wrapper .qd-dropdown__box:active{color:#b4b4b4}.qd-dropdown__wrapper .qd-dropdown__box:hover:after{border-top-color:#b4b4b4}.qd-dropdown__wrapper .qd-dropdown__box:after{position:absolute;z-index:5;top:1rem;right:.75rem;width:0;height:0;border-top:.3125rem solid rgb(180,180,180);border-right:.3125rem solid rgba(255,255,255,0);border-left:.3125rem solid rgba(255,255,255,0);content:\"\";pointer-events:none}.qd-dropdown__wrapper .qd-dropdown__box .qd-dropdown-suffix{position:relative;z-index:8;margin-right:1rem;background:#fff}.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box{background:#f5f5f5;color:#979797}.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box:hover,.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box:active{padding:0 .75rem;border:.0625rem solid rgb(180,180,180);line-height:2.25rem}.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box{height:inherit;padding:0;border:none;line-height:2.25rem}.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:hover,.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:active{color:inherit}.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:after{display:none}.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box{height:inherit;padding:0;border:none;line-height:2.25rem}.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:hover,.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:active{color:inherit}.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:after{display:none}.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly{color:#069;cursor:pointer}.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly:hover,.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly:active,.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly:focus{color:#069;text-decoration:underline}.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly{color:#069;cursor:pointer}.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly:hover,.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly:active,.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly:focus{color:#069;text-decoration:underline}.qd-dropdown-error .qd-dropdown__box{padding:0 .75rem;border:.0625rem solid rgb(199,0,35);line-height:2.25rem}.qd-dropdown-error .qd-dropdown__box:focus,.qd-dropdown-error .qd-dropdown__box:hover,.qd-dropdown-error .qd-dropdown__box:active{padding:0 .6875rem;border:.125rem solid rgb(199,0,35);line-height:2.125rem}.qd-dropdown-error .qd-dropdown__box .qd-error-icon{color:#c70023}.qd-dropdown{display:block;height:4.5rem;margin-bottom:.75rem}.qd-dropdown.dense{width:100%;height:auto;margin-bottom:0}.qd-dropdown.dense .qd-dropdown__wrapper,.qd-dropdown.dense .qd-dropdown__box{margin-bottom:0}.qd-dropdown-open .qd-dropdown__wrapper .qd-dropdown__box{padding:0 .6875rem;border-width:.125rem;border-color:#069;line-height:2.125rem}.qd-dropdown-open .qd-dropdown__wrapper .qd-dropdown__box:after{border-top:none;border-bottom:.3125rem solid rgb(23,23,23)}.filter-wrapper{position:relative}.qd-dropdown__filter{width:100%;height:2.25rem;padding:0 .75rem 0 2.25rem;border:none;border-bottom:.0625rem solid rgb(213,213,213);background:#fff;color:#171717;overflow-y:auto;scroll-behavior:smooth}.qd-dropdown__filter:focus,.qd-dropdown__filter:hover,.qd-dropdown__filter:active{border:none;border-bottom:.125rem solid rgb(23,23,23);background:#f5f5f5;outline:none}.qd-dropdown-filter-focus .qd-dropdown__filter{border-bottom:.125rem solid rgb(0,102,153)}.qd-dropdown-filter-focus .qd-dropdown__filter:focus,.qd-dropdown-filter-focus .qd-dropdown__filter:hover,.qd-dropdown-filter-focus .qd-dropdown__filter:active{border-bottom:.125rem solid rgb(0,102,153)}.qd-dropdown__filter-magnifier{position:absolute;top:0;left:0;padding:.625rem 0 .625rem .75rem}.qd-dropdown__filter-magnifier .qd-icon{color:#757575}\n"] }]
|
|
11968
|
+
], encapsulation: ViewEncapsulation.None, host: { class: 'qd-dropdown' }, standalone: false, template: "<qd-form-label\n [label]=\"label\"\n [readonly]=\"readonly\"\n [viewonly]=\"viewonly\"\n [control]=\"control\"\n [tooltip]=\"config?.tooltip\"\n [data-test-id]=\"testId\"\n></qd-form-label>\n\n<div class=\"qd-dropdown__wrapper\">\n @if (!readonly && !viewonly && hasOptions) {\n <div\n class=\"qd-dropdown__box\"\n tabindex=\"0\"\n [attr.data-test-id]=\"testId + '-box'\"\n (keydown)=\"onListKeydown($event)\"\n [qdPopoverOnClick]=\"dropdownMenu\"\n [qdPopoverCloseStrategy]=\"'onOutsideClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverDisabled]=\"disabled\"\n [qdPopoverMaxHeight]=\"qdPopoverMaxHeight\"\n [qdPopoverMinWidth]=\"160\"\n [qdPopoverAutoSize]=\"{ width: true }\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n [qdPopoverFlipIntoViewport]=\"true\"\n [qdPopoverOffsetY]=\"2\"\n (opened)=\"onOpenDropdown()\"\n (closed)=\"onDropdownClosed()\"\n qdPopoverPlacement=\"bottom-start\"\n >\n {{ (selectedOption?.i18n | translate) || placeholder }}\n <div class=\"qd-dropdown-suffix\">\n @if (hasError) {\n <qd-icon class=\"qd-error-icon\" icon=\"exclamationCircleSolid\"></qd-icon>\n }\n </div>\n </div>\n }\n</div>\n\n@if (!readonly && !viewonly && (hasHint || hasError)) {\n<qd-form-hint\n [hint]=\"hasHint ? config.hint.i18n : ''\"\n [control]=\"control\"\n [hasError]=\"hasError\"\n [hintAction]=\"hintAction\"\n [data-test-id]=\"testId\"\n></qd-form-hint>\n} @if (readonly) {\n<qd-form-readonly\n [values]=\"[selectedOption]\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n} @if (viewonly) {\n<qd-form-viewonly\n [values]=\"[selectedOption]\"\n [viewonlyAction]=\"viewonlyAction\"\n [status]=\"config?.viewonlyStatus\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n}\n\n<ng-template #dropdownMenu>\n <qd-form-options-list\n [options]=\"filteredOptions$ | async\"\n [id]=\"id\"\n [radioName]=\"testId + '-options'\"\n [data-test-id]=\"testId\"\n (optionSelected)=\"handleClick($event)\"\n >\n <div qdFormOptionsListHeader class=\"filter-wrapper\">\n @if (filter) {\n <input\n #filterInput\n type=\"text\"\n class=\"qd-dropdown__filter\"\n [(ngModel)]=\"filterText\"\n (ngModelChange)=\"handleFilterChange($event)\"\n (keydown)=\"onListKeydown($event)\"\n [attr.data-test-id]=\"testId + '-filter'\"\n autocomplete=\"off\"\n />\n\n <qd-icon [icon]=\"'filter'\" class=\"qd-dropdown__filter-magnifier\"></qd-icon>\n }\n </div>\n </qd-form-options-list>\n</ng-template>\n", styles: [".qd-dropdown__wrapper{position:relative;margin-bottom:.375rem}.qd-dropdown__wrapper.dense{margin-bottom:0}.qd-dropdown__wrapper .qd-dropdown__box{display:flex;overflow:hidden;width:100%;height:2.25rem;justify-content:space-between;padding:0 .75rem;border:.0625rem solid rgb(180,180,180);margin-bottom:.25rem;background:#fff;color:#fff;font-size:.875rem;font-weight:400;line-height:2.25rem;text-overflow:ellipsis;white-space:nowrap}.qd-dropdown__wrapper .qd-dropdown__box.dense{margin-bottom:0}.qd-dropdown-selected .qd-dropdown__wrapper .qd-dropdown__box{color:#171717}.qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown__wrapper .qd-dropdown__box:active,.qd-dropdown__wrapper .qd-dropdown__box:hover{padding:0 .6875rem;border-width:.125rem;border-color:#171717;line-height:2.125rem;outline:0}.qd-dropdown__wrapper .qd-dropdown__box:focus{border-color:#069}.qd-dropdown__wrapper .qd-dropdown__box:active{color:#b4b4b4}.qd-dropdown__wrapper .qd-dropdown__box:hover:after{border-top-color:#b4b4b4}.qd-dropdown__wrapper .qd-dropdown__box:after{position:absolute;z-index:5;top:1rem;right:.75rem;width:0;height:0;border-top:.3125rem solid rgb(180,180,180);border-right:.3125rem solid rgba(255,255,255,0);border-left:.3125rem solid rgba(255,255,255,0);content:\"\";pointer-events:none}.qd-dropdown__wrapper .qd-dropdown__box .qd-dropdown-suffix{position:relative;z-index:8;margin-right:1rem;background:#fff}.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box{background:#f5f5f5;color:#979797}.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box:hover,.qd-dropdown-disabled .qd-dropdown__wrapper .qd-dropdown__box:active{padding:0 .75rem;border:.0625rem solid rgb(180,180,180);line-height:2.25rem}.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box{height:inherit;padding:0;border:none;line-height:2.25rem}.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:hover,.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:active{color:inherit}.qd-dropdown-readonly .qd-dropdown__wrapper .qd-dropdown__box:after{display:none}.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box{height:inherit;padding:0;border:none;line-height:2.25rem}.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:focus,.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:hover,.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:active{color:inherit}.qd-dropdown-viewonly .qd-dropdown__wrapper .qd-dropdown__box:after{display:none}.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly{color:#069;cursor:pointer}.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly:hover,.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly:active,.qd-dropdown--readonly-action .qd-dropdown__box.qd-dropdown__box--readonly:focus{color:#069;text-decoration:underline}.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly{color:#069;cursor:pointer}.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly:hover,.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly:active,.qd-dropdown--viewonly-action .qd-dropdown__box.qd-dropdown__box--viewonly:focus{color:#069;text-decoration:underline}.qd-dropdown-error .qd-dropdown__box{padding:0 .75rem;border:.0625rem solid rgb(199,0,35);line-height:2.25rem}.qd-dropdown-error .qd-dropdown__box:focus,.qd-dropdown-error .qd-dropdown__box:hover,.qd-dropdown-error .qd-dropdown__box:active{padding:0 .6875rem;border:.125rem solid rgb(199,0,35);line-height:2.125rem}.qd-dropdown-error .qd-dropdown__box .qd-error-icon{color:#c70023}.qd-dropdown{display:block;height:4.5rem;margin-bottom:.75rem}.qd-dropdown.dense{width:100%;height:auto;margin-bottom:0}.qd-dropdown.dense .qd-dropdown__wrapper,.qd-dropdown.dense .qd-dropdown__box{margin-bottom:0}.qd-dropdown-open .qd-dropdown__wrapper .qd-dropdown__box{padding:0 .6875rem;border-width:.125rem;border-color:#069;line-height:2.125rem}.qd-dropdown-open .qd-dropdown__wrapper .qd-dropdown__box:after{border-top:none;border-bottom:.3125rem solid rgb(23,23,23)}.filter-wrapper{position:relative}.qd-dropdown__filter{width:100%;height:2.25rem;padding:0 .75rem 0 2.25rem;border:none;border-bottom:.0625rem solid rgb(213,213,213);background:#fff;color:#171717;overflow-y:auto;scroll-behavior:smooth}.qd-dropdown__filter:focus,.qd-dropdown__filter:hover,.qd-dropdown__filter:active{border:none;border-bottom:.125rem solid rgb(23,23,23);background:#f5f5f5;outline:none}.qd-dropdown-filter-focus .qd-dropdown__filter{border-bottom:.125rem solid rgb(0,102,153)}.qd-dropdown-filter-focus .qd-dropdown__filter:focus,.qd-dropdown-filter-focus .qd-dropdown__filter:hover,.qd-dropdown-filter-focus .qd-dropdown__filter:active{border-bottom:.125rem solid rgb(0,102,153)}.qd-dropdown__filter-magnifier{position:absolute;top:0;left:0;padding:.625rem 0 .625rem .75rem}.qd-dropdown__filter-magnifier .qd-icon{color:#757575}\n"] }]
|
|
12034
11969
|
}], ctorParameters: () => [], propDecorators: { value: [{
|
|
12035
11970
|
type: Input
|
|
12036
11971
|
}], id: [{
|
|
@@ -12123,7 +12058,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
12123
12058
|
|
|
12124
12059
|
function getValueWithUnit(value, config) {
|
|
12125
12060
|
const valueWithUnit = getValueObject(value);
|
|
12126
|
-
if (config?.units?.length > 0 && !valueWithUnit.unit) {
|
|
12061
|
+
if ((config?.units?.length ?? 0) > 0 && !valueWithUnit.unit) {
|
|
12127
12062
|
valueWithUnit.unit = getUnitFromConfig(config);
|
|
12128
12063
|
}
|
|
12129
12064
|
return valueWithUnit;
|
|
@@ -12140,10 +12075,11 @@ function getValueObject(value) {
|
|
|
12140
12075
|
}
|
|
12141
12076
|
}
|
|
12142
12077
|
function getUnitFromConfig(config) {
|
|
12143
|
-
|
|
12078
|
+
const units = config.units;
|
|
12079
|
+
const unit = units.length > 1 ? units.find(option => option.active)?.value : units[0].value;
|
|
12080
|
+
return unit;
|
|
12144
12081
|
}
|
|
12145
12082
|
|
|
12146
|
-
// @ts-strict-ignore
|
|
12147
12083
|
const DEFAULT_UNITS_PLACEHOLDER = 'i18n.qd.input.units.unit';
|
|
12148
12084
|
class QdInputUnitsComponent {
|
|
12149
12085
|
config;
|
|
@@ -12165,7 +12101,7 @@ class QdInputUnitsComponent {
|
|
|
12165
12101
|
this.setUnitByUnitValue();
|
|
12166
12102
|
}
|
|
12167
12103
|
setUnitByUnitValue() {
|
|
12168
|
-
this._unit = this.config.units
|
|
12104
|
+
this._unit = this.config.units?.find(unit => unit.value === this.unitValue);
|
|
12169
12105
|
}
|
|
12170
12106
|
handleUnitSelection(unit) {
|
|
12171
12107
|
if (unit.disabled) {
|
|
@@ -12199,7 +12135,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
12199
12135
|
type: Output
|
|
12200
12136
|
}] } });
|
|
12201
12137
|
|
|
12202
|
-
// @ts-strict-ignore
|
|
12203
12138
|
/**
|
|
12204
12139
|
* The **QdInput** component provides a FormElement for entering text into a UI.<br />
|
|
12205
12140
|
* It can be used with Quadrel Reactive Forms or with model binding.
|
|
@@ -12412,14 +12347,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
12412
12347
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
12413
12348
|
*/
|
|
12414
12349
|
class QdInputComponent {
|
|
12415
|
-
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
|
|
12422
|
-
|
|
12350
|
+
_actionEmitterService = inject(QdFormsActionEmitterService);
|
|
12351
|
+
_optionsService = inject(QdFormOptionsService);
|
|
12352
|
+
_resolverRegistry = inject(QdFormOptionsResolverRegistry);
|
|
12353
|
+
_keyboardService = inject(QdFormKeyboardService);
|
|
12354
|
+
_controlContainer = inject(ControlContainer, { optional: true, host: true, skipSelf: true });
|
|
12355
|
+
_eventBrokerService = inject(QdEventBrokerService, { optional: true });
|
|
12356
|
+
_numberInputService = inject(QdNumberInputService);
|
|
12357
|
+
_translateService = inject(TranslateService);
|
|
12423
12358
|
/**
|
|
12424
12359
|
* The form control name can be assigned here if you want to use Reactive Forms.
|
|
12425
12360
|
*/
|
|
@@ -12509,7 +12444,7 @@ class QdInputComponent {
|
|
|
12509
12444
|
if (!this.hasOptions)
|
|
12510
12445
|
return;
|
|
12511
12446
|
if (this.isOptionsOpen) {
|
|
12512
|
-
this.
|
|
12447
|
+
this._keyboardService.handleKeydown(event);
|
|
12513
12448
|
return;
|
|
12514
12449
|
}
|
|
12515
12450
|
event.preventDefault();
|
|
@@ -12518,7 +12453,7 @@ class QdInputComponent {
|
|
|
12518
12453
|
selectActiveOption() {
|
|
12519
12454
|
if (!this.isOptionsOpen)
|
|
12520
12455
|
return;
|
|
12521
|
-
const option = this.
|
|
12456
|
+
const option = this._keyboardService.pickActiveOption();
|
|
12522
12457
|
if (!option?.value)
|
|
12523
12458
|
return;
|
|
12524
12459
|
this.handleOptionSelected(option);
|
|
@@ -12543,8 +12478,8 @@ class QdInputComponent {
|
|
|
12543
12478
|
inputElement;
|
|
12544
12479
|
popover;
|
|
12545
12480
|
isOptionsOpen = false;
|
|
12546
|
-
filteredOptions$ = this.
|
|
12547
|
-
optionsRequestState$ = this.
|
|
12481
|
+
filteredOptions$ = this._optionsService.filteredOptions$;
|
|
12482
|
+
optionsRequestState$ = this._optionsService.delayedRequestState$;
|
|
12548
12483
|
QdFormOptionsRequestState = QdFormOptionsRequestState;
|
|
12549
12484
|
inputType;
|
|
12550
12485
|
inputMode;
|
|
@@ -12574,16 +12509,16 @@ class QdInputComponent {
|
|
|
12574
12509
|
return this._optionsResolver?.requestErrorHint?.i18n || 'i18n.qd.input.options.error';
|
|
12575
12510
|
}
|
|
12576
12511
|
get hasUnits() {
|
|
12577
|
-
return this.config?.units?.length > 0;
|
|
12512
|
+
return (this.config?.units?.length ?? 0) > 0;
|
|
12578
12513
|
}
|
|
12579
12514
|
get ambiguityHintKey() {
|
|
12580
|
-
return this.
|
|
12515
|
+
return this._numberInputService.getAmbiguityHintKey(this._value.value);
|
|
12581
12516
|
}
|
|
12582
12517
|
get isAmbiguousInput() {
|
|
12583
12518
|
return (this.inputType === 'number' &&
|
|
12584
12519
|
!this.hasError &&
|
|
12585
12520
|
this._isUserTyped &&
|
|
12586
|
-
this.
|
|
12521
|
+
this._numberInputService.isAmbiguous(this._value.value));
|
|
12587
12522
|
}
|
|
12588
12523
|
get numberOfCharacters() {
|
|
12589
12524
|
if (!this._value.value)
|
|
@@ -12604,17 +12539,17 @@ class QdInputComponent {
|
|
|
12604
12539
|
const value = this._value.value;
|
|
12605
12540
|
if (value == null || value === '')
|
|
12606
12541
|
return [null];
|
|
12607
|
-
const displayValue = this.inputType === 'number' ? this.
|
|
12542
|
+
const displayValue = this.inputType === 'number' ? this._numberInputService.formatNumberForViewonly(value) : value;
|
|
12608
12543
|
return [`${displayValue}${this._value.unit ? ' ' + this.getUnitLabel(this._value.unit) : ''}`];
|
|
12609
12544
|
}
|
|
12610
12545
|
ngOnInit() {
|
|
12611
12546
|
this.subscribeToOptions();
|
|
12612
|
-
this.
|
|
12613
|
-
this._optionsResolver = this.
|
|
12547
|
+
this._optionsService.initialize(this.config);
|
|
12548
|
+
this._optionsResolver = this._resolverRegistry.findResolver();
|
|
12614
12549
|
this.updateConfig();
|
|
12615
|
-
if (this.
|
|
12550
|
+
if (this._controlContainer) {
|
|
12616
12551
|
if (this.formControlName) {
|
|
12617
|
-
this.control = this.
|
|
12552
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
12618
12553
|
// TODO remove logic for support of angular FormControl with angular 20 update
|
|
12619
12554
|
if (!(this.control instanceof QdFormControl))
|
|
12620
12555
|
console.warn('Quadrel Framework | QdInput - Please use the QdFormControl instead of the Angular FormControl.');
|
|
@@ -12627,13 +12562,13 @@ class QdInputComponent {
|
|
|
12627
12562
|
console.error('Quadrel Framework | QdInput - Please use either decimal or numeric when using QdInputType number.');
|
|
12628
12563
|
this.writeValue(this.value ?? getValue(this.config));
|
|
12629
12564
|
this.normalizeInitialControlValueIfNeeded();
|
|
12630
|
-
this.
|
|
12565
|
+
this._actionEmitterService.hintEventEmitter$
|
|
12631
12566
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
12632
12567
|
.subscribe(() => this.clickHint.emit());
|
|
12633
|
-
this.
|
|
12568
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
12634
12569
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
12635
12570
|
.subscribe(() => this.clickReadonly.emit());
|
|
12636
|
-
this.
|
|
12571
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
12637
12572
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
12638
12573
|
.subscribe(() => this.clickViewonly.emit());
|
|
12639
12574
|
this.initOpModeSubscription();
|
|
@@ -12641,7 +12576,7 @@ class QdInputComponent {
|
|
|
12641
12576
|
ngOnChanges(changes) {
|
|
12642
12577
|
if (changes['config']) {
|
|
12643
12578
|
if (!changes['config'].isFirstChange())
|
|
12644
|
-
this.
|
|
12579
|
+
this._optionsService.initialize(this.config);
|
|
12645
12580
|
this.updateConfig();
|
|
12646
12581
|
this.normalizeInitialControlValueIfNeeded();
|
|
12647
12582
|
}
|
|
@@ -12672,7 +12607,7 @@ class QdInputComponent {
|
|
|
12672
12607
|
const input = target;
|
|
12673
12608
|
if (input?.validity?.badInput)
|
|
12674
12609
|
return;
|
|
12675
|
-
const value =
|
|
12610
|
+
const value = input.value;
|
|
12676
12611
|
if (this.inputType === 'number' && value && !this.handleNumberInput(value))
|
|
12677
12612
|
return;
|
|
12678
12613
|
this._isUserTyped = true;
|
|
@@ -12683,12 +12618,12 @@ class QdInputComponent {
|
|
|
12683
12618
|
this._onTouch();
|
|
12684
12619
|
}
|
|
12685
12620
|
handleNumberInput(value) {
|
|
12686
|
-
if (!this.
|
|
12621
|
+
if (!this._numberInputService.isValidNumber(value)) {
|
|
12687
12622
|
this.setInvalidCharactersError();
|
|
12688
12623
|
return false;
|
|
12689
12624
|
}
|
|
12690
|
-
const valueWithoutGroups = value.split(this.
|
|
12691
|
-
const filtered = this.
|
|
12625
|
+
const valueWithoutGroups = value.split(this._numberInputService.groupSeparator).join('');
|
|
12626
|
+
const filtered = this._numberInputService.filterValue(valueWithoutGroups);
|
|
12692
12627
|
if (filtered !== valueWithoutGroups) {
|
|
12693
12628
|
this._value = { ...this._value, value: filtered };
|
|
12694
12629
|
this.setInvalidCharactersError();
|
|
@@ -12705,7 +12640,7 @@ class QdInputComponent {
|
|
|
12705
12640
|
return;
|
|
12706
12641
|
this.control.setErrors({
|
|
12707
12642
|
...this.control.errors,
|
|
12708
|
-
invalidCharacters: this.
|
|
12643
|
+
invalidCharacters: this._numberInputService.invalidCharactersErrorKey
|
|
12709
12644
|
});
|
|
12710
12645
|
}
|
|
12711
12646
|
clearInvalidCharactersError() {
|
|
@@ -12728,7 +12663,7 @@ class QdInputComponent {
|
|
|
12728
12663
|
this.isOptionsOpen = false;
|
|
12729
12664
|
}
|
|
12730
12665
|
handleUnitChange(unit) {
|
|
12731
|
-
this._value = { ...this._value, unit };
|
|
12666
|
+
this._value = { ...this._value, unit: unit };
|
|
12732
12667
|
this.emitValue();
|
|
12733
12668
|
}
|
|
12734
12669
|
handleInputFocus() {
|
|
@@ -12779,7 +12714,7 @@ class QdInputComponent {
|
|
|
12779
12714
|
if (this.inputType === 'number') {
|
|
12780
12715
|
this.htmlInputType = 'text';
|
|
12781
12716
|
if (!this.inputMode) {
|
|
12782
|
-
this.inputMode = isConfirmedNonIOS() ? 'decimal' :
|
|
12717
|
+
this.inputMode = isConfirmedNonIOS() ? 'decimal' : null;
|
|
12783
12718
|
}
|
|
12784
12719
|
}
|
|
12785
12720
|
else {
|
|
@@ -12796,13 +12731,13 @@ class QdInputComponent {
|
|
|
12796
12731
|
this.disabled = getDisabled(this.config) || !!this.control?.disabled;
|
|
12797
12732
|
this.clearable = !this.disabled && getClearable(this.config);
|
|
12798
12733
|
this.hasAutofocus = getHasAutofocus(this.config);
|
|
12799
|
-
this.hasOptions = this.
|
|
12734
|
+
this.hasOptions = this._optionsService.hasOptions();
|
|
12800
12735
|
}
|
|
12801
12736
|
subscribeToOptions() {
|
|
12802
|
-
this.
|
|
12737
|
+
this._optionsService.filteredOptions$
|
|
12803
12738
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
12804
12739
|
.subscribe(options => (this._filteredOptions = options));
|
|
12805
|
-
this.
|
|
12740
|
+
this._optionsService.optionsResolved$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(event => {
|
|
12806
12741
|
this.optionsResolved.emit(event);
|
|
12807
12742
|
const currentOption = event.options.find(option => option.value === this._value.value);
|
|
12808
12743
|
if (currentOption)
|
|
@@ -12812,8 +12747,8 @@ class QdInputComponent {
|
|
|
12812
12747
|
loadOptionsForTypedValue(value) {
|
|
12813
12748
|
if (!this.hasOptions)
|
|
12814
12749
|
return;
|
|
12815
|
-
this.
|
|
12816
|
-
if (this.
|
|
12750
|
+
this._optionsService.load(value);
|
|
12751
|
+
if (this._optionsService.hasResolver() || this._filteredOptions.length > 0) {
|
|
12817
12752
|
this.popover?.open();
|
|
12818
12753
|
}
|
|
12819
12754
|
else {
|
|
@@ -12822,10 +12757,12 @@ class QdInputComponent {
|
|
|
12822
12757
|
}
|
|
12823
12758
|
getUnitLabel(unit) {
|
|
12824
12759
|
const unitOption = this.config?.units?.find(option => option.value === unit);
|
|
12825
|
-
return unitOption ? this.
|
|
12760
|
+
return unitOption ? this._translateService.instant(unitOption.i18n) : unit;
|
|
12826
12761
|
}
|
|
12827
12762
|
emittableValue() {
|
|
12828
|
-
const emittable = this.inputType === 'number'
|
|
12763
|
+
const emittable = this.inputType === 'number'
|
|
12764
|
+
? this._numberInputService.parseValue(this._value.value)
|
|
12765
|
+
: this._value.value;
|
|
12829
12766
|
return this.hasUnits ? { ...this._value, value: emittable } : emittable;
|
|
12830
12767
|
}
|
|
12831
12768
|
emitValue() {
|
|
@@ -12834,9 +12771,9 @@ class QdInputComponent {
|
|
|
12834
12771
|
this._onChange(emittable);
|
|
12835
12772
|
}
|
|
12836
12773
|
initOpModeSubscription() {
|
|
12837
|
-
if (!this.
|
|
12774
|
+
if (!this._eventBrokerService)
|
|
12838
12775
|
return;
|
|
12839
|
-
this.
|
|
12776
|
+
this._eventBrokerService
|
|
12840
12777
|
.consume('operation_mode_changed')
|
|
12841
12778
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
12842
12779
|
.subscribe(topic => {
|
|
@@ -12862,7 +12799,10 @@ class QdInputComponent {
|
|
|
12862
12799
|
}
|
|
12863
12800
|
applyDisplayFormat() {
|
|
12864
12801
|
if (this.inputType === 'number') {
|
|
12865
|
-
this._value = {
|
|
12802
|
+
this._value = {
|
|
12803
|
+
...this._value,
|
|
12804
|
+
value: this._numberInputService.formatValueForDisplay(this._value.value)
|
|
12805
|
+
};
|
|
12866
12806
|
this._displayValue = String(this._value.value ?? '');
|
|
12867
12807
|
}
|
|
12868
12808
|
}
|
|
@@ -12991,7 +12931,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
12991
12931
|
args: [QdPopoverOnClickDirective]
|
|
12992
12932
|
}] } });
|
|
12993
12933
|
|
|
12994
|
-
// @ts-strict-ignore
|
|
12995
12934
|
const DEFAULT_LANGUAGE = 'de';
|
|
12996
12935
|
/**
|
|
12997
12936
|
* The **QdDatepicker** component provides a FormElement that can be used to select a date.<br />
|
|
@@ -13025,13 +12964,12 @@ const DEFAULT_LANGUAGE = 'de';
|
|
|
13025
12964
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
13026
12965
|
*/
|
|
13027
12966
|
class QdDatepickerComponent {
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
keyboardDetection = inject(QdKeyboardDetectionService);
|
|
12967
|
+
_actionEmitterService = inject(QdFormsActionEmitterService);
|
|
12968
|
+
_timePickerService = inject(TimePickerService);
|
|
12969
|
+
_translateService = inject(TranslateService, { optional: true });
|
|
12970
|
+
_controlContainer = inject(ControlContainer, { optional: true, host: true, skipSelf: true });
|
|
12971
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
12972
|
+
_eventBrokerService = inject(QdEventBrokerService, { optional: true });
|
|
13035
12973
|
/**
|
|
13036
12974
|
* Configuration object
|
|
13037
12975
|
*
|
|
@@ -13075,7 +13013,7 @@ class QdDatepickerComponent {
|
|
|
13075
13013
|
/**
|
|
13076
13014
|
* Emits event when the value has changed.
|
|
13077
13015
|
* Return value matches the current value.
|
|
13078
|
-
* * Output format: Javascript Date object.
|
|
13016
|
+
* * Output format: Javascript Date object, or `null` when the field is cleared or the input is invalid.
|
|
13079
13017
|
*/
|
|
13080
13018
|
valueChange = new EventEmitter();
|
|
13081
13019
|
/**
|
|
@@ -13099,7 +13037,7 @@ class QdDatepickerComponent {
|
|
|
13099
13037
|
*/
|
|
13100
13038
|
clickViewonly = new EventEmitter();
|
|
13101
13039
|
popover;
|
|
13102
|
-
|
|
13040
|
+
_hostRef = inject(ElementRef);
|
|
13103
13041
|
readonly = false;
|
|
13104
13042
|
viewonly = false;
|
|
13105
13043
|
hintAction = false;
|
|
@@ -13128,7 +13066,7 @@ class QdDatepickerComponent {
|
|
|
13128
13066
|
_onChange = () => { };
|
|
13129
13067
|
_onTouched = () => { };
|
|
13130
13068
|
ngOnInit() {
|
|
13131
|
-
this.language = this.
|
|
13069
|
+
this.language = this._translateService?.currentLang ?? DEFAULT_LANGUAGE;
|
|
13132
13070
|
this.subscribeToLanguageChange();
|
|
13133
13071
|
this.subscribeToActionEmitterEvents();
|
|
13134
13072
|
this.initControl();
|
|
@@ -13138,7 +13076,7 @@ class QdDatepickerComponent {
|
|
|
13138
13076
|
this.initOpModeSubscription();
|
|
13139
13077
|
}
|
|
13140
13078
|
ngOnChanges(changes) {
|
|
13141
|
-
if (changes
|
|
13079
|
+
if (changes['config']) {
|
|
13142
13080
|
this.updateConfiguration();
|
|
13143
13081
|
}
|
|
13144
13082
|
}
|
|
@@ -13157,7 +13095,7 @@ class QdDatepickerComponent {
|
|
|
13157
13095
|
this.displayedDate = date ? QdDateAdapter.formatToDateLocaleString(date) : '';
|
|
13158
13096
|
this.displayedDateTime = date ? QdDateAdapter.formatToDateTimeLocaleString(date, this.config?.enableSeconds) : '';
|
|
13159
13097
|
this.displayedTime = date ? QdDateAdapter.formatToTimeLocaleString(date, this.config?.enableSeconds) : '';
|
|
13160
|
-
this.
|
|
13098
|
+
this._changeDetectorRef.detectChanges();
|
|
13161
13099
|
}
|
|
13162
13100
|
setDisabledState(disabled) {
|
|
13163
13101
|
this.disabled = disabled;
|
|
@@ -13177,7 +13115,7 @@ class QdDatepickerComponent {
|
|
|
13177
13115
|
this.popover?.close();
|
|
13178
13116
|
}
|
|
13179
13117
|
focusToggle() {
|
|
13180
|
-
const toggle = this.
|
|
13118
|
+
const toggle = this._hostRef.nativeElement.querySelector('.datepicker-toggle');
|
|
13181
13119
|
toggle?.focus();
|
|
13182
13120
|
}
|
|
13183
13121
|
handleUpdatedDate($rawValue) {
|
|
@@ -13186,20 +13124,20 @@ class QdDatepickerComponent {
|
|
|
13186
13124
|
this.displayedDate = '';
|
|
13187
13125
|
this._onChange(null);
|
|
13188
13126
|
this._onTouched(null);
|
|
13189
|
-
this.
|
|
13127
|
+
this.emitValueChange(null);
|
|
13190
13128
|
this.popover?.close();
|
|
13191
|
-
if (!this.
|
|
13129
|
+
if (!this._controlContainer)
|
|
13192
13130
|
this.control.setValue(null);
|
|
13193
13131
|
return;
|
|
13194
13132
|
}
|
|
13195
13133
|
if (!this.isValidDateInput($event)) {
|
|
13196
13134
|
this._onChange('Invalid Date');
|
|
13197
13135
|
this._onTouched('Invalid Date');
|
|
13198
|
-
if (!this.
|
|
13136
|
+
if (!this._controlContainer) {
|
|
13199
13137
|
this.control.setValue('Invalid Date');
|
|
13200
13138
|
this.control.markAsTouched();
|
|
13201
13139
|
}
|
|
13202
|
-
this.
|
|
13140
|
+
this.emitValueChange(null);
|
|
13203
13141
|
this.popover?.close();
|
|
13204
13142
|
return;
|
|
13205
13143
|
}
|
|
@@ -13222,7 +13160,7 @@ class QdDatepickerComponent {
|
|
|
13222
13160
|
this._onChange(newDate);
|
|
13223
13161
|
this._onTouched(newDate);
|
|
13224
13162
|
this.valueChange.emit(newDate);
|
|
13225
|
-
if (!this.
|
|
13163
|
+
if (!this._controlContainer)
|
|
13226
13164
|
this.control.setValue(newDate);
|
|
13227
13165
|
this.closeCalendar();
|
|
13228
13166
|
}
|
|
@@ -13257,11 +13195,11 @@ class QdDatepickerComponent {
|
|
|
13257
13195
|
if (!this.isValidDateTimeInput($event)) {
|
|
13258
13196
|
this._onChange('Invalid Date');
|
|
13259
13197
|
this._onTouched('Invalid Date');
|
|
13260
|
-
if (!this.
|
|
13198
|
+
if (!this._controlContainer) {
|
|
13261
13199
|
this.control.setValue('Invalid Date');
|
|
13262
13200
|
this.control.markAsTouched();
|
|
13263
13201
|
}
|
|
13264
|
-
this.
|
|
13202
|
+
this.emitValueChange(null);
|
|
13265
13203
|
this.popover?.close();
|
|
13266
13204
|
return;
|
|
13267
13205
|
}
|
|
@@ -13271,29 +13209,30 @@ class QdDatepickerComponent {
|
|
|
13271
13209
|
this.displayedDate = QdDateAdapter.formatToDateLocaleString(parsed);
|
|
13272
13210
|
this.displayedTime = QdDateAdapter.formatToTimeLocaleString(parsed, this.config?.enableSeconds);
|
|
13273
13211
|
this.displayedDateTime = $event;
|
|
13274
|
-
this.
|
|
13275
|
-
if (!this.
|
|
13212
|
+
this.emitValueChange(parsed);
|
|
13213
|
+
if (!this._controlContainer)
|
|
13276
13214
|
this.control.setValue(parsed);
|
|
13277
13215
|
this.popover?.close();
|
|
13278
13216
|
}
|
|
13217
|
+
emitValueChange(value) {
|
|
13218
|
+
this.valueChange.emit(value);
|
|
13219
|
+
}
|
|
13279
13220
|
subscribeToLanguageChange() {
|
|
13280
|
-
this.
|
|
13281
|
-
.pipe(tap(({ lang }) => (this.language = lang)), tap(() => this.control.updateValueAndValidity()), takeUntilDestroyed(this._destroyRef))
|
|
13282
|
-
.subscribe();
|
|
13221
|
+
this._translateService.onLangChange.pipe(tap(({ lang }) => (this.language = lang)), tap(() => this.control.updateValueAndValidity()), takeUntilDestroyed(this._destroyRef)).subscribe();
|
|
13283
13222
|
}
|
|
13284
13223
|
subscribeToActionEmitterEvents() {
|
|
13285
|
-
this.
|
|
13224
|
+
this._actionEmitterService.hintEventEmitter$
|
|
13286
13225
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
13287
13226
|
.subscribe(() => this.clickHint.emit());
|
|
13288
|
-
this.
|
|
13227
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
13289
13228
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
13290
13229
|
.subscribe(() => this.clickReadonly.emit());
|
|
13291
|
-
this.
|
|
13230
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
13292
13231
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
13293
13232
|
.subscribe(() => this.clickViewonly.emit());
|
|
13294
13233
|
}
|
|
13295
13234
|
initControl() {
|
|
13296
|
-
if (!this.
|
|
13235
|
+
if (!this._controlContainer) {
|
|
13297
13236
|
this.initInnerControl();
|
|
13298
13237
|
if (!this.value)
|
|
13299
13238
|
return;
|
|
@@ -13301,7 +13240,7 @@ class QdDatepickerComponent {
|
|
|
13301
13240
|
return;
|
|
13302
13241
|
}
|
|
13303
13242
|
if (this.formControlName) {
|
|
13304
|
-
this.control = this.
|
|
13243
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
13305
13244
|
}
|
|
13306
13245
|
else {
|
|
13307
13246
|
console.warn('Quadrel Framework | QdDatepicker - Missing FormControlName directive from host element of the component.');
|
|
@@ -13321,7 +13260,7 @@ class QdDatepickerComponent {
|
|
|
13321
13260
|
this.viewonlyAction = getViewonlyAction(this.config);
|
|
13322
13261
|
this.disabled = getDisabled(this.config) || !!this.control?.disabled;
|
|
13323
13262
|
if (this.config?.timePicker) {
|
|
13324
|
-
this.timePicker = this.
|
|
13263
|
+
this.timePicker = this._timePickerService.getConfig({
|
|
13325
13264
|
...this.config.timePicker,
|
|
13326
13265
|
viewonly: this.viewonly
|
|
13327
13266
|
});
|
|
@@ -13402,7 +13341,7 @@ class QdDatepickerComponent {
|
|
|
13402
13341
|
this.control.updateValueAndValidity();
|
|
13403
13342
|
}
|
|
13404
13343
|
if (this.config?.disabledDates && this.config?.disabledDatesValidation) {
|
|
13405
|
-
const hasCustomErrorKey = (disabledDatesValidation) => disabledDatesValidation.errorKey;
|
|
13344
|
+
const hasCustomErrorKey = (disabledDatesValidation) => !!disabledDatesValidation.errorKey;
|
|
13406
13345
|
this._disabledDatesValidator = hasCustomErrorKey(this.config.disabledDatesValidation)
|
|
13407
13346
|
? QdValidators.disabledDates(this.config.disabledDates, this.config.disabledDatesValidation.errorKey)
|
|
13408
13347
|
: QdValidators.disabledDates(this.config.disabledDates);
|
|
@@ -13418,7 +13357,7 @@ class QdDatepickerComponent {
|
|
|
13418
13357
|
this.control.updateValueAndValidity();
|
|
13419
13358
|
}
|
|
13420
13359
|
if (this.config?.timePicker?.disabledTimes && this.config?.timePicker?.disabledTimesValidation) {
|
|
13421
|
-
const hasCustomErrorKey = (disabledTimesValidation) => disabledTimesValidation.errorKey;
|
|
13360
|
+
const hasCustomErrorKey = (disabledTimesValidation) => !!disabledTimesValidation.errorKey;
|
|
13422
13361
|
this._disabledTimesValidator = hasCustomErrorKey(this.config?.timePicker?.disabledTimesValidation)
|
|
13423
13362
|
? QdValidators.disabledTimes(this.config.timePicker?.disabledTimes, this.config.timePicker?.disabledTimesValidation.errorKey)
|
|
13424
13363
|
: QdValidators.disabledTimes(this.config.timePicker?.disabledTimes);
|
|
@@ -13434,9 +13373,9 @@ class QdDatepickerComponent {
|
|
|
13434
13373
|
this.isValidDateInput(formatted));
|
|
13435
13374
|
}
|
|
13436
13375
|
initOpModeSubscription() {
|
|
13437
|
-
if (!this.
|
|
13376
|
+
if (!this._eventBrokerService)
|
|
13438
13377
|
return;
|
|
13439
|
-
this.
|
|
13378
|
+
this._eventBrokerService
|
|
13440
13379
|
.consume('operation_mode_changed')
|
|
13441
13380
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
13442
13381
|
.subscribe(topic => {
|
|
@@ -13462,7 +13401,7 @@ class QdDatepickerComponent {
|
|
|
13462
13401
|
useValue: true
|
|
13463
13402
|
},
|
|
13464
13403
|
QdFormsActionEmitterService
|
|
13465
|
-
], viewQueries: [{ propertyName: "popover", first: true, predicate: ["qdPopoverOnClick"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<qd-form-label\n [label]=\"label\"\n [readonly]=\"readonly\"\n [viewonly]=\"viewonly\"\n [control]=\"control\"\n [tooltip]=\"config?.tooltip\"\n [data-test-id]=\"testId\"\n></qd-form-label>\n\n@if (!readonly && !viewonly) {\n<qd-input\n [value]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n (valueChange)=\"config?.timePicker ? handleUpdatedDateTime($event) : handleUpdatedDate($event)\"\n [config]=\"{\n disabled,\n readonly,\n viewonly,\n placeholder: config?.placeholder,\n hasAutofocus\n }\"\n [isError]=\"hasError\"\n>\n <button\n type=\"button\"\n class=\"datepicker-toggle\"\n qdIconButton\n [qdPopoverOnClick]=\"disabled ? null : calendar\"\n [qdPopoverMaxWidth]=\"332\"\n qdPopoverCloseStrategy=\"onOutsideClick\"\n #qdPopoverOnClick=\"qdPopoverOnClick\"\n >\n <qd-icon [icon]=\"'calendar'\"></qd-icon>\n </button>\n</qd-input>\n}\n\n<ng-template #calendar>\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.dialogLabel' | translate\"\n cdkTrapFocus\n (keydown.escape)=\"onCalendarCloseRequested()\"\n >\n <qd-calendar\n [selectedDate]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n [language]=\"language\"\n [disabledDates]=\"config?.disabledDates\"\n (selectedChange)=\"handleUpdatedDate($event)\"\n (closeRequested)=\"onCalendarCloseRequested()\"\n ></qd-calendar>\n @if (timePicker) {\n <qd-dropdown\n class=\"timepicker-dropdown\"\n [value]=\"displayedTime\"\n (valueChange)=\"handleUpdatedTime($event)\"\n [config]=\"timePicker\"\n [qdPopoverMaxHeight]=\"300\"\n ></qd-dropdown>\n }\n </div>\n</ng-template>\n\n@if (!readonly && !viewonly && (hint || hasError)) {\n<qd-form-hint\n [hint]=\"hint\"\n [control]=\"control\"\n [hasError]=\"hasError\"\n [hintAction]=\"hintAction\"\n [data-test-id]=\"testId\"\n></qd-form-hint>\n} @if (readonly) {\n<qd-form-readonly\n [values]=\"[displayedDate]\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n} @if (viewonly) {\n<qd-form-viewonly\n [values]=\"[displayedDate]\"\n [viewonlyAction]=\"viewonlyAction\"\n [status]=\"config?.viewonlyStatus\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n}\n", styles: ["qd-datepicker{position:relative;display:block;width:100%;margin-bottom:.75rem}qd-datepicker .calendar{padding:1rem}qd-datepicker button.datepicker-toggle{width:1.75rem;height:1.75rem;justify-content:center;padding:.25rem;margin-right:.125rem}qd-datepicker button.datepicker-toggle .qd-icon{display:flex;align-items:center;justify-content:center;font-size:1.125rem;line-height:1}qd-datepicker button.datepicker-toggle:focus-visible{
|
|
13404
|
+
], viewQueries: [{ propertyName: "popover", first: true, predicate: ["qdPopoverOnClick"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<qd-form-label\n [label]=\"label\"\n [readonly]=\"readonly\"\n [viewonly]=\"viewonly\"\n [control]=\"control\"\n [tooltip]=\"config?.tooltip\"\n [data-test-id]=\"testId\"\n></qd-form-label>\n\n@if (!readonly && !viewonly) {\n<qd-input\n [value]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n (valueChange)=\"config?.timePicker ? handleUpdatedDateTime($event) : handleUpdatedDate($event)\"\n [config]=\"{\n disabled,\n readonly,\n viewonly,\n placeholder: config?.placeholder,\n hasAutofocus\n }\"\n [isError]=\"hasError\"\n>\n <button\n type=\"button\"\n class=\"datepicker-toggle\"\n qdIconButton\n [qdPopoverOnClick]=\"disabled ? null : calendar\"\n [qdPopoverMaxWidth]=\"332\"\n qdPopoverCloseStrategy=\"onOutsideClick\"\n #qdPopoverOnClick=\"qdPopoverOnClick\"\n >\n <qd-icon [icon]=\"'calendar'\"></qd-icon>\n </button>\n</qd-input>\n}\n\n<ng-template #calendar>\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.dialogLabel' | translate\"\n cdkTrapFocus\n (keydown.escape)=\"onCalendarCloseRequested()\"\n >\n <qd-calendar\n [selectedDate]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n [language]=\"language\"\n [disabledDates]=\"config?.disabledDates\"\n (selectedChange)=\"handleUpdatedDate($event)\"\n (closeRequested)=\"onCalendarCloseRequested()\"\n ></qd-calendar>\n @if (timePicker) {\n <qd-dropdown\n class=\"timepicker-dropdown\"\n [value]=\"displayedTime\"\n (valueChange)=\"handleUpdatedTime($event)\"\n [config]=\"timePicker\"\n [qdPopoverMaxHeight]=\"300\"\n ></qd-dropdown>\n }\n </div>\n</ng-template>\n\n@if (!readonly && !viewonly && (hint || hasError)) {\n<qd-form-hint\n [hint]=\"hint\"\n [control]=\"control\"\n [hasError]=\"hasError\"\n [hintAction]=\"hintAction\"\n [data-test-id]=\"testId\"\n></qd-form-hint>\n} @if (readonly) {\n<qd-form-readonly\n [values]=\"[displayedDate]\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n} @if (viewonly) {\n<qd-form-viewonly\n [values]=\"[displayedDate]\"\n [viewonlyAction]=\"viewonlyAction\"\n [status]=\"config?.viewonlyStatus\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n}\n", styles: ["qd-datepicker{position:relative;display:block;width:100%;margin-bottom:.75rem}qd-datepicker .calendar{padding:1rem}qd-datepicker button.datepicker-toggle{width:1.75rem;height:1.75rem;justify-content:center;padding:.25rem;margin-right:.125rem}qd-datepicker button.datepicker-toggle .qd-icon{display:flex;align-items:center;justify-content:center;font-size:1.125rem;line-height:1}qd-datepicker button.datepicker-toggle:focus-visible{box-shadow:inset 0 0 0 2px #069;background:#fff0;outline:none}qd-datepicker:not(.qd-datepicker-calendar-only) qd-input{height:2.25rem;margin-bottom:.375rem!important}qd-datepicker:not(.qd-datepicker-calendar-only) qd-input .qd-form-label,qd-datepicker:not(.qd-datepicker-calendar-only) qd-input .qd-form-hint{display:none}qd-datepicker .qd-form-disabled .datepicker-toggle{color:#979797;cursor:default}qd-datepicker.qd-datepicker-calendar-only{margin-bottom:0}qd-datepicker.qd-datepicker-calendar-only qd-input{margin:0}qd-datepicker.qd-datepicker-calendar-only .qd-form-label,qd-datepicker.qd-datepicker-calendar-only .qd-form-hint,qd-datepicker.qd-datepicker-calendar-only .qd-input-input input{display:none}qd-datepicker.qd-datepicker-calendar-only .qd-input-input{height:initial!important;padding:0!important;border:none!important;margin:0!important}qd-datepicker.qd-datepicker-calendar-only .qd-input-suffix{margin-left:0!important}.timepicker-dropdown{margin:.75rem}\n"], dependencies: [{ kind: "directive", type: i1$4.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: QdIconButtonComponent, selector: "button[qdIconButton], a[qdIconButton]", inputs: ["color", "data-test-id"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "qdPopoverPlacement", "qdPopoverOffsetX", "qdPopoverOffsetY", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl", "qdPopoverRestoreFocus", "qdPopoverFlipIntoViewport"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "component", type: QdCalendarComponent, selector: "qd-calendar", inputs: ["selectedDate", "language", "disabledDates"], outputs: ["selectedChange", "closeRequested"] }, { kind: "component", type: QdDropdownComponent, selector: "qd-dropdown", inputs: ["value", "id", "formControlName", "config", "data-test-id", "qdPopoverMaxHeight", "dense"], outputs: ["valueChange", "enterClick", "dropdownOpened", "blurred", "clickHint", "clickReadonly", "clickViewonly", "optionsResolved"] }, { kind: "component", type: QdFormHintComponent, selector: "qd-form-hint", inputs: ["hint", "control", "hasError", "hintAction", "data-test-id"] }, { kind: "component", type: QdFormLabelComponent, selector: "qd-form-label", inputs: ["label", "isDisabled", "readonly", "viewonly", "control", "tooltip", "data-test-id"] }, { kind: "component", type: QdFormReadonlyComponent, selector: "qd-form-readonly", inputs: ["values", "readonlyAction", "data-test-id"] }, { kind: "component", type: QdFormViewonlyComponent, selector: "qd-form-viewonly", inputs: ["values", "viewonlyAction", "status", "data-test-id"] }, { kind: "component", type: QdInputComponent, selector: "qd-input", inputs: ["formControlName", "value", "config", "isError", "data-test-id"], outputs: ["valueChange", "enterClick", "clickClear", "clickHint", "clickReadonly", "clickViewonly", "blurred", "optionsResolved"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
13466
13405
|
}
|
|
13467
13406
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdDatepickerComponent, decorators: [{
|
|
13468
13407
|
type: Component,
|
|
@@ -13477,7 +13416,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
13477
13416
|
useValue: true
|
|
13478
13417
|
},
|
|
13479
13418
|
QdFormsActionEmitterService
|
|
13480
|
-
], standalone: false, template: "<qd-form-label\n [label]=\"label\"\n [readonly]=\"readonly\"\n [viewonly]=\"viewonly\"\n [control]=\"control\"\n [tooltip]=\"config?.tooltip\"\n [data-test-id]=\"testId\"\n></qd-form-label>\n\n@if (!readonly && !viewonly) {\n<qd-input\n [value]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n (valueChange)=\"config?.timePicker ? handleUpdatedDateTime($event) : handleUpdatedDate($event)\"\n [config]=\"{\n disabled,\n readonly,\n viewonly,\n placeholder: config?.placeholder,\n hasAutofocus\n }\"\n [isError]=\"hasError\"\n>\n <button\n type=\"button\"\n class=\"datepicker-toggle\"\n qdIconButton\n [qdPopoverOnClick]=\"disabled ? null : calendar\"\n [qdPopoverMaxWidth]=\"332\"\n qdPopoverCloseStrategy=\"onOutsideClick\"\n #qdPopoverOnClick=\"qdPopoverOnClick\"\n >\n <qd-icon [icon]=\"'calendar'\"></qd-icon>\n </button>\n</qd-input>\n}\n\n<ng-template #calendar>\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.dialogLabel' | translate\"\n cdkTrapFocus\n (keydown.escape)=\"onCalendarCloseRequested()\"\n >\n <qd-calendar\n [selectedDate]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n [language]=\"language\"\n [disabledDates]=\"config?.disabledDates\"\n (selectedChange)=\"handleUpdatedDate($event)\"\n (closeRequested)=\"onCalendarCloseRequested()\"\n ></qd-calendar>\n @if (timePicker) {\n <qd-dropdown\n class=\"timepicker-dropdown\"\n [value]=\"displayedTime\"\n (valueChange)=\"handleUpdatedTime($event)\"\n [config]=\"timePicker\"\n [qdPopoverMaxHeight]=\"300\"\n ></qd-dropdown>\n }\n </div>\n</ng-template>\n\n@if (!readonly && !viewonly && (hint || hasError)) {\n<qd-form-hint\n [hint]=\"hint\"\n [control]=\"control\"\n [hasError]=\"hasError\"\n [hintAction]=\"hintAction\"\n [data-test-id]=\"testId\"\n></qd-form-hint>\n} @if (readonly) {\n<qd-form-readonly\n [values]=\"[displayedDate]\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n} @if (viewonly) {\n<qd-form-viewonly\n [values]=\"[displayedDate]\"\n [viewonlyAction]=\"viewonlyAction\"\n [status]=\"config?.viewonlyStatus\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n}\n", styles: ["qd-datepicker{position:relative;display:block;width:100%;margin-bottom:.75rem}qd-datepicker .calendar{padding:1rem}qd-datepicker button.datepicker-toggle{width:1.75rem;height:1.75rem;justify-content:center;padding:.25rem;margin-right:.125rem}qd-datepicker button.datepicker-toggle .qd-icon{display:flex;align-items:center;justify-content:center;font-size:1.125rem;line-height:1}qd-datepicker button.datepicker-toggle:focus-visible{
|
|
13419
|
+
], standalone: false, template: "<qd-form-label\n [label]=\"label\"\n [readonly]=\"readonly\"\n [viewonly]=\"viewonly\"\n [control]=\"control\"\n [tooltip]=\"config?.tooltip\"\n [data-test-id]=\"testId\"\n></qd-form-label>\n\n@if (!readonly && !viewonly) {\n<qd-input\n [value]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n (valueChange)=\"config?.timePicker ? handleUpdatedDateTime($event) : handleUpdatedDate($event)\"\n [config]=\"{\n disabled,\n readonly,\n viewonly,\n placeholder: config?.placeholder,\n hasAutofocus\n }\"\n [isError]=\"hasError\"\n>\n <button\n type=\"button\"\n class=\"datepicker-toggle\"\n qdIconButton\n [qdPopoverOnClick]=\"disabled ? null : calendar\"\n [qdPopoverMaxWidth]=\"332\"\n qdPopoverCloseStrategy=\"onOutsideClick\"\n #qdPopoverOnClick=\"qdPopoverOnClick\"\n >\n <qd-icon [icon]=\"'calendar'\"></qd-icon>\n </button>\n</qd-input>\n}\n\n<ng-template #calendar>\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"'i18n.qd.datepicker.a11y.dialogLabel' | translate\"\n cdkTrapFocus\n (keydown.escape)=\"onCalendarCloseRequested()\"\n >\n <qd-calendar\n [selectedDate]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n [language]=\"language\"\n [disabledDates]=\"config?.disabledDates\"\n (selectedChange)=\"handleUpdatedDate($event)\"\n (closeRequested)=\"onCalendarCloseRequested()\"\n ></qd-calendar>\n @if (timePicker) {\n <qd-dropdown\n class=\"timepicker-dropdown\"\n [value]=\"displayedTime\"\n (valueChange)=\"handleUpdatedTime($event)\"\n [config]=\"timePicker\"\n [qdPopoverMaxHeight]=\"300\"\n ></qd-dropdown>\n }\n </div>\n</ng-template>\n\n@if (!readonly && !viewonly && (hint || hasError)) {\n<qd-form-hint\n [hint]=\"hint\"\n [control]=\"control\"\n [hasError]=\"hasError\"\n [hintAction]=\"hintAction\"\n [data-test-id]=\"testId\"\n></qd-form-hint>\n} @if (readonly) {\n<qd-form-readonly\n [values]=\"[displayedDate]\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n} @if (viewonly) {\n<qd-form-viewonly\n [values]=\"[displayedDate]\"\n [viewonlyAction]=\"viewonlyAction\"\n [status]=\"config?.viewonlyStatus\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n}\n", styles: ["qd-datepicker{position:relative;display:block;width:100%;margin-bottom:.75rem}qd-datepicker .calendar{padding:1rem}qd-datepicker button.datepicker-toggle{width:1.75rem;height:1.75rem;justify-content:center;padding:.25rem;margin-right:.125rem}qd-datepicker button.datepicker-toggle .qd-icon{display:flex;align-items:center;justify-content:center;font-size:1.125rem;line-height:1}qd-datepicker button.datepicker-toggle:focus-visible{box-shadow:inset 0 0 0 2px #069;background:#fff0;outline:none}qd-datepicker:not(.qd-datepicker-calendar-only) qd-input{height:2.25rem;margin-bottom:.375rem!important}qd-datepicker:not(.qd-datepicker-calendar-only) qd-input .qd-form-label,qd-datepicker:not(.qd-datepicker-calendar-only) qd-input .qd-form-hint{display:none}qd-datepicker .qd-form-disabled .datepicker-toggle{color:#979797;cursor:default}qd-datepicker.qd-datepicker-calendar-only{margin-bottom:0}qd-datepicker.qd-datepicker-calendar-only qd-input{margin:0}qd-datepicker.qd-datepicker-calendar-only .qd-form-label,qd-datepicker.qd-datepicker-calendar-only .qd-form-hint,qd-datepicker.qd-datepicker-calendar-only .qd-input-input input{display:none}qd-datepicker.qd-datepicker-calendar-only .qd-input-input{height:initial!important;padding:0!important;border:none!important;margin:0!important}qd-datepicker.qd-datepicker-calendar-only .qd-input-suffix{margin-left:0!important}.timepicker-dropdown{margin:.75rem}\n"] }]
|
|
13481
13420
|
}], propDecorators: { config: [{
|
|
13482
13421
|
type: Input
|
|
13483
13422
|
}], formControlName: [{
|
|
@@ -13934,14 +13873,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
13934
13873
|
type: Output
|
|
13935
13874
|
}] } });
|
|
13936
13875
|
|
|
13937
|
-
// @ts-strict-ignore
|
|
13938
13876
|
/**
|
|
13939
13877
|
* Holds the selection state of a multi-input: the known options and the
|
|
13940
13878
|
* selected items. Filtering and the visible option list live in
|
|
13941
13879
|
* QdFormOptionsService; labels resolve through QdTranslateService.
|
|
13942
13880
|
*/
|
|
13943
13881
|
class QdMultiInputService {
|
|
13944
|
-
|
|
13882
|
+
_translateService = inject(QdTranslateService);
|
|
13945
13883
|
_optionsListSubject = new BehaviorSubject([]);
|
|
13946
13884
|
_selectedItemsSubject = new BehaviorSubject([]);
|
|
13947
13885
|
optionsList$ = this._optionsListSubject.asObservable();
|
|
@@ -14000,7 +13938,7 @@ class QdMultiInputService {
|
|
|
14000
13938
|
}
|
|
14001
13939
|
}
|
|
14002
13940
|
getTranslation(option) {
|
|
14003
|
-
return this.
|
|
13941
|
+
return this._translateService.translate(option);
|
|
14004
13942
|
}
|
|
14005
13943
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdMultiInputService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
14006
13944
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdMultiInputService });
|
|
@@ -14009,9 +13947,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
14009
13947
|
type: Injectable
|
|
14010
13948
|
}] });
|
|
14011
13949
|
|
|
14012
|
-
// @ts-strict-ignore
|
|
14013
13950
|
class QdMultiInputChipComponent {
|
|
14014
|
-
|
|
13951
|
+
_multiInputService = inject(QdMultiInputService);
|
|
14015
13952
|
itemControl;
|
|
14016
13953
|
value;
|
|
14017
13954
|
close = false;
|
|
@@ -14031,10 +13968,10 @@ class QdMultiInputChipComponent {
|
|
|
14031
13968
|
return 'neutral';
|
|
14032
13969
|
}
|
|
14033
13970
|
get errorMessages() {
|
|
14034
|
-
return Object.values(this.itemControl
|
|
13971
|
+
return Object.values(this.itemControl?.errors ?? {});
|
|
14035
13972
|
}
|
|
14036
13973
|
get chipText() {
|
|
14037
|
-
return this.itemControl ? this.getTranslation(this.itemControl.value) : this.value;
|
|
13974
|
+
return this.itemControl ? this.getTranslation(this.itemControl.value) : this.value ?? '';
|
|
14038
13975
|
}
|
|
14039
13976
|
get title() {
|
|
14040
13977
|
if (this.itemControl) {
|
|
@@ -14045,8 +13982,8 @@ class QdMultiInputChipComponent {
|
|
|
14045
13982
|
}
|
|
14046
13983
|
}
|
|
14047
13984
|
getTranslation(value) {
|
|
14048
|
-
const option = this.
|
|
14049
|
-
return option ? this.
|
|
13985
|
+
const option = this._multiInputService.findOption(value);
|
|
13986
|
+
return option ? this._multiInputService.getTranslation(option) : value;
|
|
14050
13987
|
}
|
|
14051
13988
|
clickClose($event) {
|
|
14052
13989
|
$event.stopPropagation();
|
|
@@ -14899,7 +14836,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
14899
14836
|
args: ['document:click', ['$event']]
|
|
14900
14837
|
}] } });
|
|
14901
14838
|
|
|
14902
|
-
// @ts-strict-ignore
|
|
14903
14839
|
class QdPinCodeService {
|
|
14904
14840
|
_values;
|
|
14905
14841
|
_currentIndex = 0;
|
|
@@ -14987,7 +14923,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
14987
14923
|
type: Injectable
|
|
14988
14924
|
}] });
|
|
14989
14925
|
|
|
14990
|
-
// @ts-strict-ignore
|
|
14991
14926
|
/**
|
|
14992
14927
|
* **QdPinCode** component provides a FormElement.
|
|
14993
14928
|
* The **QdPinCode** is a component that provides a form element for entering a PIN code.<br />
|
|
@@ -15021,11 +14956,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
15021
14956
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
15022
14957
|
*/
|
|
15023
14958
|
class QdPinCodeComponent {
|
|
15024
|
-
|
|
15025
|
-
|
|
15026
|
-
|
|
15027
|
-
|
|
15028
|
-
|
|
14959
|
+
_pinCodeService = inject(QdPinCodeService);
|
|
14960
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
14961
|
+
_actionEmitterService = inject(QdFormsActionEmitterService);
|
|
14962
|
+
_controlContainer = inject(ControlContainer, { optional: true, host: true, skipSelf: true });
|
|
14963
|
+
_eventBrokerService = inject(QdEventBrokerService, { optional: true });
|
|
15029
14964
|
/**
|
|
15030
14965
|
* The form control name can be assigned here if you want to use Reactive Forms.
|
|
15031
14966
|
*/
|
|
@@ -15102,13 +15037,13 @@ class QdPinCodeComponent {
|
|
|
15102
15037
|
_onChange = () => { };
|
|
15103
15038
|
_onTouch = () => { };
|
|
15104
15039
|
get firstEmptyIndex() {
|
|
15105
|
-
return this.
|
|
15040
|
+
return this._pinCodeService.firstEmpty;
|
|
15106
15041
|
}
|
|
15107
15042
|
get joinedValues() {
|
|
15108
|
-
return this.
|
|
15043
|
+
return this._pinCodeService.joinedValues;
|
|
15109
15044
|
}
|
|
15110
15045
|
get errors() {
|
|
15111
|
-
return this.control ? this.control.errors : [];
|
|
15046
|
+
return (this.control ? this.control.errors : []);
|
|
15112
15047
|
}
|
|
15113
15048
|
get required() {
|
|
15114
15049
|
if (!this.control)
|
|
@@ -15117,30 +15052,30 @@ class QdPinCodeComponent {
|
|
|
15117
15052
|
}
|
|
15118
15053
|
ngOnInit() {
|
|
15119
15054
|
this.updateConfiguration();
|
|
15120
|
-
this.
|
|
15121
|
-
this.
|
|
15122
|
-
if (this.
|
|
15055
|
+
this._pinCodeService.codeLength = this.codeLength;
|
|
15056
|
+
this._pinCodeService.values = (this.value ?? this.config?.value)?.split('') ?? [];
|
|
15057
|
+
if (this._controlContainer) {
|
|
15123
15058
|
if (this.formControlName) {
|
|
15124
|
-
this.control = this.
|
|
15059
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
15125
15060
|
}
|
|
15126
15061
|
else {
|
|
15127
15062
|
console.warn('Quadrel Framework | QdPinCode - Missing FormControlName directive from host element of the component.');
|
|
15128
15063
|
}
|
|
15129
15064
|
}
|
|
15130
|
-
this.
|
|
15065
|
+
this._actionEmitterService.hintEventEmitter$
|
|
15131
15066
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15132
15067
|
.subscribe(() => this.clickHint.emit());
|
|
15133
|
-
this.
|
|
15068
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
15134
15069
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15135
15070
|
.subscribe(() => this.clickReadonly.emit());
|
|
15136
|
-
this.
|
|
15071
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
15137
15072
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15138
15073
|
.subscribe(() => this.clickViewonly.emit());
|
|
15139
15074
|
this.initOpModeSubscription();
|
|
15140
15075
|
}
|
|
15141
15076
|
ngAfterViewInit() {
|
|
15142
15077
|
this.getInputs();
|
|
15143
|
-
this.fillInputs(this.
|
|
15078
|
+
this.fillInputs(this._pinCodeService.values);
|
|
15144
15079
|
this.focusFirstOnInit();
|
|
15145
15080
|
}
|
|
15146
15081
|
ngOnChanges(changes) {
|
|
@@ -15166,14 +15101,14 @@ class QdPinCodeComponent {
|
|
|
15166
15101
|
return;
|
|
15167
15102
|
if (!this.isNumericOrLatin(values))
|
|
15168
15103
|
return;
|
|
15169
|
-
this.
|
|
15104
|
+
this._pinCodeService.addValues(values);
|
|
15170
15105
|
}
|
|
15171
15106
|
setDisabledState(disabled) {
|
|
15172
15107
|
this.disabled = disabled;
|
|
15173
15108
|
}
|
|
15174
15109
|
handleCLick($event) {
|
|
15175
15110
|
$event.preventDefault();
|
|
15176
|
-
if (!this.
|
|
15111
|
+
if (!this._pinCodeService.allFilled) {
|
|
15177
15112
|
this.focusFirstEmpty();
|
|
15178
15113
|
return;
|
|
15179
15114
|
}
|
|
@@ -15181,11 +15116,11 @@ class QdPinCodeComponent {
|
|
|
15181
15116
|
}
|
|
15182
15117
|
handleDelete($event) {
|
|
15183
15118
|
$event.preventDefault();
|
|
15184
|
-
this._inputs[this.
|
|
15119
|
+
this._inputs[this._pinCodeService.currentIndex].value = '';
|
|
15185
15120
|
this.handlePrevious();
|
|
15186
|
-
this._onChange(this.
|
|
15187
|
-
this._onTouch(this.
|
|
15188
|
-
this.valueChange.emit(this.
|
|
15121
|
+
this._onChange(this._pinCodeService.joinedValues);
|
|
15122
|
+
this._onTouch(this._pinCodeService.joinedValues);
|
|
15123
|
+
this.valueChange.emit(this._pinCodeService.joinedValues);
|
|
15189
15124
|
}
|
|
15190
15125
|
handleInput($event) {
|
|
15191
15126
|
$event.preventDefault();
|
|
@@ -15198,24 +15133,24 @@ class QdPinCodeComponent {
|
|
|
15198
15133
|
}
|
|
15199
15134
|
if (!this.isNumericOrLatin(value))
|
|
15200
15135
|
return;
|
|
15201
|
-
this._inputs[this.
|
|
15202
|
-
this.
|
|
15203
|
-
this.
|
|
15136
|
+
this._inputs[this._pinCodeService.currentIndex].value = value;
|
|
15137
|
+
this._pinCodeService.filledTill = this._pinCodeService.currentIndex;
|
|
15138
|
+
this._pinCodeService.addValue(value);
|
|
15204
15139
|
this.handleNext();
|
|
15205
|
-
this._onChange(this.
|
|
15206
|
-
this._onTouch(this.
|
|
15207
|
-
this.valueChange.emit(this.
|
|
15140
|
+
this._onChange(this._pinCodeService.joinedValues);
|
|
15141
|
+
this._onTouch(this._pinCodeService.joinedValues);
|
|
15142
|
+
this.valueChange.emit(this._pinCodeService.joinedValues);
|
|
15208
15143
|
}
|
|
15209
15144
|
handleBlur(index) {
|
|
15210
15145
|
this.blurCurrent = false;
|
|
15211
|
-
if (this.
|
|
15146
|
+
if (this._pinCodeService.currentIndex === index) {
|
|
15212
15147
|
this.blurCurrent = true;
|
|
15213
15148
|
this.checkError();
|
|
15214
15149
|
}
|
|
15215
15150
|
}
|
|
15216
15151
|
handleComplete() {
|
|
15217
|
-
if (this.
|
|
15218
|
-
this.completed.emit(this.
|
|
15152
|
+
if (this._pinCodeService.allFilled) {
|
|
15153
|
+
this.completed.emit(this._pinCodeService.joinedValues);
|
|
15219
15154
|
this.blurAll();
|
|
15220
15155
|
return;
|
|
15221
15156
|
}
|
|
@@ -15246,9 +15181,9 @@ class QdPinCodeComponent {
|
|
|
15246
15181
|
if (!this.inputsList)
|
|
15247
15182
|
return;
|
|
15248
15183
|
this.control?.markAsPristine();
|
|
15249
|
-
this.
|
|
15250
|
-
this.
|
|
15251
|
-
this.
|
|
15184
|
+
this._pinCodeService.reset();
|
|
15185
|
+
this._controlContainer?.reset();
|
|
15186
|
+
this._pinCodeService.codeLength = this.codeLength;
|
|
15252
15187
|
if (this._isSubscribedToInputChanges)
|
|
15253
15188
|
return;
|
|
15254
15189
|
this._isSubscribedToInputChanges = true;
|
|
@@ -15268,13 +15203,13 @@ class QdPinCodeComponent {
|
|
|
15268
15203
|
this._inputs[0]?.focus();
|
|
15269
15204
|
}
|
|
15270
15205
|
focusCurrent() {
|
|
15271
|
-
this._inputs[this.
|
|
15206
|
+
this._inputs[this._pinCodeService.currentIndex].focus();
|
|
15272
15207
|
}
|
|
15273
15208
|
focusFirstEmpty() {
|
|
15274
|
-
if (this.
|
|
15209
|
+
if (this._pinCodeService.firstEmpty === -1)
|
|
15275
15210
|
return;
|
|
15276
|
-
this._inputs[this.
|
|
15277
|
-
this.
|
|
15211
|
+
this._inputs[this._pinCodeService.firstEmpty]?.focus();
|
|
15212
|
+
this._pinCodeService.currentIndex = this._pinCodeService.firstEmpty;
|
|
15278
15213
|
}
|
|
15279
15214
|
focusFirstOnInit() {
|
|
15280
15215
|
if (this.focusOnInit)
|
|
@@ -15299,12 +15234,12 @@ class QdPinCodeComponent {
|
|
|
15299
15234
|
this.emptyAll();
|
|
15300
15235
|
this.focusFirst();
|
|
15301
15236
|
this.handleInputsWhenPaste(this.getClipboardText($event).toUpperCase().split(''));
|
|
15302
|
-
this.
|
|
15237
|
+
this._pinCodeService.addValues(this.getClipboardText($event));
|
|
15303
15238
|
this.focusFirstEmpty();
|
|
15304
15239
|
this.handleComplete();
|
|
15305
|
-
this._onChange(this.
|
|
15306
|
-
this._onTouch(this.
|
|
15307
|
-
this.valueChange.emit(this.
|
|
15240
|
+
this._onChange(this._pinCodeService.joinedValues);
|
|
15241
|
+
this._onTouch(this._pinCodeService.joinedValues);
|
|
15242
|
+
this.valueChange.emit(this._pinCodeService.joinedValues);
|
|
15308
15243
|
}
|
|
15309
15244
|
matchPastedTextPattern($event) {
|
|
15310
15245
|
return this.getClipboardText($event)
|
|
@@ -15312,14 +15247,14 @@ class QdPinCodeComponent {
|
|
|
15312
15247
|
.every(item => (this.digitsOnly && this.isNumeric(item)) || (!this.digitsOnly && this.isNumericOrLatin(item)));
|
|
15313
15248
|
}
|
|
15314
15249
|
isInitialTextNumeric(text) {
|
|
15315
|
-
return text.split('').every(element => this.isNumeric(element));
|
|
15250
|
+
return text.split('').every((element) => this.isNumeric(element));
|
|
15316
15251
|
}
|
|
15317
15252
|
getClipboardText($event) {
|
|
15318
15253
|
return $event.clipboardData.getData('text');
|
|
15319
15254
|
}
|
|
15320
15255
|
handleInputsWhenPaste(codeList) {
|
|
15321
15256
|
this.fillInputs(codeList);
|
|
15322
|
-
this.
|
|
15257
|
+
this._pinCodeService.filledTill =
|
|
15323
15258
|
this._inputs.length < codeList.length ? this._inputs.length - 1 : codeList.length - 1;
|
|
15324
15259
|
}
|
|
15325
15260
|
fillInputs(codeList) {
|
|
@@ -15335,11 +15270,11 @@ class QdPinCodeComponent {
|
|
|
15335
15270
|
return key === 'Enter';
|
|
15336
15271
|
}
|
|
15337
15272
|
handlePrevious() {
|
|
15338
|
-
this.
|
|
15273
|
+
this._pinCodeService.stepPrevious();
|
|
15339
15274
|
this.focusCurrent();
|
|
15340
15275
|
}
|
|
15341
15276
|
handleNext() {
|
|
15342
|
-
this.
|
|
15277
|
+
this._pinCodeService.stepNext();
|
|
15343
15278
|
this.focusCurrent();
|
|
15344
15279
|
}
|
|
15345
15280
|
setErrorDigitsOnly() {
|
|
@@ -15349,9 +15284,9 @@ class QdPinCodeComponent {
|
|
|
15349
15284
|
this.triggerValidation();
|
|
15350
15285
|
}
|
|
15351
15286
|
initOpModeSubscription() {
|
|
15352
|
-
if (!this.
|
|
15287
|
+
if (!this._eventBrokerService)
|
|
15353
15288
|
return;
|
|
15354
|
-
this.
|
|
15289
|
+
this._eventBrokerService
|
|
15355
15290
|
.consume('operation_mode_changed')
|
|
15356
15291
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15357
15292
|
.subscribe(topic => {
|
|
@@ -15433,9 +15368,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
15433
15368
|
args: ['paste', ['$event']]
|
|
15434
15369
|
}] } });
|
|
15435
15370
|
|
|
15436
|
-
// @ts-strict-ignore
|
|
15437
15371
|
class QdRadioButtonsService {
|
|
15438
|
-
|
|
15372
|
+
_translateService = inject(TranslateService);
|
|
15439
15373
|
radioButtonsList;
|
|
15440
15374
|
radioButtonsListForView;
|
|
15441
15375
|
setRadioButtonsList(radioButtons) {
|
|
@@ -15460,7 +15394,7 @@ class QdRadioButtonsService {
|
|
|
15460
15394
|
}
|
|
15461
15395
|
const radioButtonsListWithTranslation = this.radioButtonsList.map((radioButton) => ({
|
|
15462
15396
|
...radioButton,
|
|
15463
|
-
translation: this.
|
|
15397
|
+
translation: this._translateService.instant(radioButton.i18n)
|
|
15464
15398
|
}));
|
|
15465
15399
|
this.radioButtonsListForView = this.radioButtonsList.filter((_radioButton, index) => radioButtonsListWithTranslation[index].translation.toLowerCase().includes(value.toLowerCase()));
|
|
15466
15400
|
}
|
|
@@ -15471,7 +15405,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
15471
15405
|
type: Injectable
|
|
15472
15406
|
}] });
|
|
15473
15407
|
|
|
15474
|
-
// @ts-strict-ignore
|
|
15475
15408
|
/**
|
|
15476
15409
|
* The **QdRadioButtons** is a component that provides a form element for radio buttons.<br />
|
|
15477
15410
|
* It allows users to select one option from a list of options. It can be used with Quadrel Reactive Forms or with model binding.
|
|
@@ -15504,11 +15437,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
15504
15437
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
15505
15438
|
*/
|
|
15506
15439
|
class QdRadioButtonsComponent {
|
|
15507
|
-
|
|
15508
|
-
|
|
15509
|
-
|
|
15510
|
-
|
|
15511
|
-
|
|
15440
|
+
_radioButtonsService = inject(QdRadioButtonsService);
|
|
15441
|
+
_actionEmitterService = inject(QdFormsActionEmitterService);
|
|
15442
|
+
_controlContainer = inject(ControlContainer, { optional: true, host: true, skipSelf: true });
|
|
15443
|
+
_ngZone = inject(NgZone);
|
|
15444
|
+
_eventBrokerService = inject(QdEventBrokerService, { optional: true });
|
|
15512
15445
|
/**
|
|
15513
15446
|
* The current form item value, if you are working with Model Binding.
|
|
15514
15447
|
*
|
|
@@ -15576,7 +15509,7 @@ class QdRadioButtonsComponent {
|
|
|
15576
15509
|
return this.control ? this.control.touched && this.control.invalid : false;
|
|
15577
15510
|
}
|
|
15578
15511
|
get hasHint() {
|
|
15579
|
-
return this.config.hint && this.config.hint.i18n && !this.config.hint.disabled;
|
|
15512
|
+
return !!(this.config.hint && this.config.hint.i18n && !this.config.hint.disabled);
|
|
15580
15513
|
}
|
|
15581
15514
|
get required() {
|
|
15582
15515
|
if (!this.control)
|
|
@@ -15610,22 +15543,22 @@ class QdRadioButtonsComponent {
|
|
|
15610
15543
|
ngOnInit() {
|
|
15611
15544
|
this.updateConfiguration();
|
|
15612
15545
|
this.setInitialValue();
|
|
15613
|
-
if (this.
|
|
15546
|
+
if (this._controlContainer) {
|
|
15614
15547
|
if (this.formControlName) {
|
|
15615
|
-
this.control = this.
|
|
15548
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
15616
15549
|
}
|
|
15617
15550
|
else {
|
|
15618
15551
|
console.warn('Quadrel Framework | QdRadioButtons - Missing FormControlName directive from host element of the component.');
|
|
15619
15552
|
}
|
|
15620
15553
|
}
|
|
15621
15554
|
this.initRadioButtonList();
|
|
15622
|
-
this.
|
|
15555
|
+
this._actionEmitterService.hintEventEmitter$
|
|
15623
15556
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15624
15557
|
.subscribe(() => this.clickHint.emit());
|
|
15625
|
-
this.
|
|
15558
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
15626
15559
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15627
15560
|
.subscribe(() => this.clickReadonly.emit());
|
|
15628
|
-
this.
|
|
15561
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
15629
15562
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15630
15563
|
.subscribe(() => this.clickViewonly.emit());
|
|
15631
15564
|
this.initOpModeSubscription();
|
|
@@ -15657,9 +15590,9 @@ class QdRadioButtonsComponent {
|
|
|
15657
15590
|
this.valueChange.emit(this.value);
|
|
15658
15591
|
}
|
|
15659
15592
|
changeValue($event) {
|
|
15660
|
-
this.
|
|
15661
|
-
this.
|
|
15662
|
-
this.radioButtonsListForView = this.
|
|
15593
|
+
this._radioButtonsService.filterOptions($event);
|
|
15594
|
+
this._ngZone.run(() => {
|
|
15595
|
+
this.radioButtonsListForView = this._radioButtonsService.getRadioButtonsListForView();
|
|
15663
15596
|
});
|
|
15664
15597
|
}
|
|
15665
15598
|
updateConfiguration() {
|
|
@@ -15678,9 +15611,9 @@ class QdRadioButtonsComponent {
|
|
|
15678
15611
|
this.isLabelDisabled = getIsLabelDisabled(this.config);
|
|
15679
15612
|
}
|
|
15680
15613
|
initRadioButtonList() {
|
|
15681
|
-
this.
|
|
15682
|
-
this.
|
|
15683
|
-
this.radioButtonsListForView = this.
|
|
15614
|
+
this._radioButtonsService.setRadioButtonsList(this.options);
|
|
15615
|
+
this._radioButtonsService.setRadioButtonsListForView();
|
|
15616
|
+
this.radioButtonsListForView = this._radioButtonsService.getRadioButtonsListForView();
|
|
15684
15617
|
}
|
|
15685
15618
|
setInitialValue() {
|
|
15686
15619
|
if (this.value)
|
|
@@ -15691,9 +15624,9 @@ class QdRadioButtonsComponent {
|
|
|
15691
15624
|
});
|
|
15692
15625
|
}
|
|
15693
15626
|
initOpModeSubscription() {
|
|
15694
|
-
if (!this.
|
|
15627
|
+
if (!this._eventBrokerService)
|
|
15695
15628
|
return;
|
|
15696
|
-
this.
|
|
15629
|
+
this._eventBrokerService
|
|
15697
15630
|
.consume('operation_mode_changed')
|
|
15698
15631
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15699
15632
|
.subscribe(topic => {
|
|
@@ -16649,7 +16582,6 @@ class QdValidators {
|
|
|
16649
16582
|
}
|
|
16650
16583
|
}
|
|
16651
16584
|
|
|
16652
|
-
// @ts-strict-ignore
|
|
16653
16585
|
class QdSwitchComponent {
|
|
16654
16586
|
inputData;
|
|
16655
16587
|
id;
|
|
@@ -16657,7 +16589,7 @@ class QdSwitchComponent {
|
|
|
16657
16589
|
testId = 'switch';
|
|
16658
16590
|
valueChange = new EventEmitter();
|
|
16659
16591
|
get active() {
|
|
16660
|
-
return this.inputData.active;
|
|
16592
|
+
return !!this.inputData.active;
|
|
16661
16593
|
}
|
|
16662
16594
|
get isDisabled() {
|
|
16663
16595
|
return this.inputData.disabled || this.disabled;
|
|
@@ -16702,7 +16634,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
16702
16634
|
args: ['class.qd-switch-disabled']
|
|
16703
16635
|
}] } });
|
|
16704
16636
|
|
|
16705
|
-
// @ts-strict-ignore
|
|
16706
16637
|
class QdSwitchesService {
|
|
16707
16638
|
switchesList;
|
|
16708
16639
|
formatFormControlValues(formControlValues) {
|
|
@@ -16717,7 +16648,7 @@ class QdSwitchesService {
|
|
|
16717
16648
|
});
|
|
16718
16649
|
}
|
|
16719
16650
|
isAtLeastOneSelected(list) {
|
|
16720
|
-
return list.reduce((hasValue, item) => hasValue || item.active, false);
|
|
16651
|
+
return list.reduce((hasValue, item) => hasValue || !!item.active, false);
|
|
16721
16652
|
}
|
|
16722
16653
|
setList(list) {
|
|
16723
16654
|
this.switchesList = list.map(item => ({ ...item, disabled: item.disabled || false }));
|
|
@@ -16767,7 +16698,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
16767
16698
|
type: Injectable
|
|
16768
16699
|
}] });
|
|
16769
16700
|
|
|
16770
|
-
// @ts-strict-ignore
|
|
16771
16701
|
/**
|
|
16772
16702
|
* **QdSwitches** component provides a FormElement.
|
|
16773
16703
|
* The **QdSwitches** is a component that provides a form element for switches.<br />
|
|
@@ -16801,11 +16731,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
16801
16731
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
16802
16732
|
*/
|
|
16803
16733
|
class QdSwitchesComponent {
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
|
|
16734
|
+
_switchesService = inject(QdSwitchesService);
|
|
16735
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
16736
|
+
_actionEmitterService = inject(QdFormsActionEmitterService);
|
|
16737
|
+
_controlContainer = inject(ControlContainer, { optional: true, host: true, skipSelf: true });
|
|
16738
|
+
_eventBrokerService = inject(QdEventBrokerService, { optional: true });
|
|
16809
16739
|
/**
|
|
16810
16740
|
* The current form control name can be assigned here if you want to use Reactive Forms.
|
|
16811
16741
|
*/
|
|
@@ -16839,6 +16769,7 @@ class QdSwitchesComponent {
|
|
|
16839
16769
|
testId = 'switches';
|
|
16840
16770
|
/**
|
|
16841
16771
|
* Emits event when the values change. Return values match the current values.
|
|
16772
|
+
* The array has one entry per option: the option value when it is active, otherwise `null`.
|
|
16842
16773
|
*/
|
|
16843
16774
|
valuesChange = new EventEmitter();
|
|
16844
16775
|
/**
|
|
@@ -16866,7 +16797,7 @@ class QdSwitchesComponent {
|
|
|
16866
16797
|
return this.align === 'vertical';
|
|
16867
16798
|
}
|
|
16868
16799
|
get hasHint() {
|
|
16869
|
-
return this.config.hint && this.config.hint.i18n && !this.config.hint.disabled;
|
|
16800
|
+
return !!(this.config.hint && this.config.hint.i18n && !this.config.hint.disabled);
|
|
16870
16801
|
}
|
|
16871
16802
|
get required() {
|
|
16872
16803
|
if (!this.control)
|
|
@@ -16889,24 +16820,24 @@ class QdSwitchesComponent {
|
|
|
16889
16820
|
}
|
|
16890
16821
|
ngOnInit() {
|
|
16891
16822
|
this.updateConfiguration();
|
|
16892
|
-
if (this.
|
|
16823
|
+
if (this._controlContainer) {
|
|
16893
16824
|
if (this.formControlName) {
|
|
16894
|
-
this.control = this.
|
|
16825
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
16895
16826
|
}
|
|
16896
16827
|
else {
|
|
16897
16828
|
console.warn('Quadrel Framework | QdSwitches - Missing FormControlName directive from host element of the component.');
|
|
16898
16829
|
}
|
|
16899
16830
|
}
|
|
16900
|
-
this.
|
|
16901
|
-
this.
|
|
16831
|
+
this._switchesService.setList(this.options);
|
|
16832
|
+
this._switchesService.fillListWithDefaults(this.values);
|
|
16902
16833
|
this.setData();
|
|
16903
|
-
this.
|
|
16834
|
+
this._actionEmitterService.hintEventEmitter$
|
|
16904
16835
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
16905
16836
|
.subscribe(() => this.clickHint.emit());
|
|
16906
|
-
this.
|
|
16837
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
16907
16838
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
16908
16839
|
.subscribe(() => this.clickReadonly.emit());
|
|
16909
|
-
this.
|
|
16840
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
16910
16841
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
16911
16842
|
.subscribe(() => this.clickViewonly.emit());
|
|
16912
16843
|
this.initOpModeSubscription();
|
|
@@ -16925,7 +16856,7 @@ class QdSwitchesComponent {
|
|
|
16925
16856
|
this.disabled = disabled;
|
|
16926
16857
|
}
|
|
16927
16858
|
writeValue(values) {
|
|
16928
|
-
this.
|
|
16859
|
+
this._switchesService.fillListWithDefaults(values);
|
|
16929
16860
|
this.setData();
|
|
16930
16861
|
this.switchesValues = values;
|
|
16931
16862
|
}
|
|
@@ -16952,18 +16883,18 @@ class QdSwitchesComponent {
|
|
|
16952
16883
|
this.viewonlyAction = getViewonlyAction(this.config);
|
|
16953
16884
|
}
|
|
16954
16885
|
setData() {
|
|
16955
|
-
this.switchesValues = this.
|
|
16956
|
-
this.switchesInputs = this.
|
|
16886
|
+
this.switchesValues = this._switchesService.getValues();
|
|
16887
|
+
this.switchesInputs = this._switchesService.getList();
|
|
16957
16888
|
}
|
|
16958
16889
|
updateData(value) {
|
|
16959
|
-
this.
|
|
16960
|
-
this.switchesValues = this.
|
|
16961
|
-
this.switchesInputs = this.
|
|
16890
|
+
this._switchesService.updateList(value);
|
|
16891
|
+
this.switchesValues = this._switchesService.getValues();
|
|
16892
|
+
this.switchesInputs = this._switchesService.getList();
|
|
16962
16893
|
}
|
|
16963
16894
|
initOpModeSubscription() {
|
|
16964
|
-
if (!this.
|
|
16895
|
+
if (!this._eventBrokerService)
|
|
16965
16896
|
return;
|
|
16966
|
-
this.
|
|
16897
|
+
this._eventBrokerService
|
|
16967
16898
|
.consume('operation_mode_changed')
|
|
16968
16899
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
16969
16900
|
.subscribe(topic => {
|
|
@@ -17046,7 +16977,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
17046
16977
|
args: ['class.qd-switches-hint']
|
|
17047
16978
|
}] } });
|
|
17048
16979
|
|
|
17049
|
-
// @ts-strict-ignore
|
|
17050
16980
|
/**
|
|
17051
16981
|
* The **QdTextarea** is an component that provides a form element for a textarea input.<br />
|
|
17052
16982
|
* It is used to create a textarea input field with various configurable options. It can be used with Quadrel Reactive Forms or with model binding.
|
|
@@ -17079,10 +17009,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
17079
17009
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
17080
17010
|
*/
|
|
17081
17011
|
class QdTextareaComponent {
|
|
17082
|
-
|
|
17083
|
-
|
|
17084
|
-
|
|
17085
|
-
|
|
17012
|
+
_actionEmitterService = inject(QdFormsActionEmitterService);
|
|
17013
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
17014
|
+
_controlContainer = inject(ControlContainer, { optional: true, host: true, skipSelf: true });
|
|
17015
|
+
_eventBrokerService = inject(QdEventBrokerService, { optional: true });
|
|
17086
17016
|
/**
|
|
17087
17017
|
* The form control name can be assigned here if you want to use Reactive Forms.
|
|
17088
17018
|
*/
|
|
@@ -17146,7 +17076,7 @@ class QdTextareaComponent {
|
|
|
17146
17076
|
label;
|
|
17147
17077
|
hint;
|
|
17148
17078
|
rows;
|
|
17149
|
-
valueForView;
|
|
17079
|
+
valueForView = null;
|
|
17150
17080
|
_destroyRef = inject(DestroyRef);
|
|
17151
17081
|
_onChange = () => { };
|
|
17152
17082
|
_onTouch = () => { };
|
|
@@ -17176,9 +17106,9 @@ class QdTextareaComponent {
|
|
|
17176
17106
|
}
|
|
17177
17107
|
ngOnInit() {
|
|
17178
17108
|
this.updateConfiguration();
|
|
17179
|
-
if (this.
|
|
17109
|
+
if (this._controlContainer) {
|
|
17180
17110
|
if (this.formControlName) {
|
|
17181
|
-
this.control = this.
|
|
17111
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
17182
17112
|
// TODO remove logic for support of angular FormControl with angular 18 update
|
|
17183
17113
|
if (!(this.control instanceof QdFormControl)) {
|
|
17184
17114
|
console.warn('Quadrel Framework | QdTextarea - Please use the QdFormControl instead of the Angular FormControl.');
|
|
@@ -17189,19 +17119,19 @@ class QdTextareaComponent {
|
|
|
17189
17119
|
}
|
|
17190
17120
|
}
|
|
17191
17121
|
this.valueForView = this.value || getValue(this.config);
|
|
17192
|
-
this.
|
|
17122
|
+
this._actionEmitterService.hintEventEmitter$
|
|
17193
17123
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
17194
17124
|
.subscribe(() => this.clickHint.emit());
|
|
17195
|
-
this.
|
|
17125
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
17196
17126
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
17197
17127
|
.subscribe(() => this.clickReadonly.emit());
|
|
17198
|
-
this.
|
|
17128
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
17199
17129
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
17200
17130
|
.subscribe(() => this.clickViewonly.emit());
|
|
17201
17131
|
this.initOpModeSubscription();
|
|
17202
17132
|
}
|
|
17203
17133
|
ngOnChanges(changes) {
|
|
17204
|
-
if (changes
|
|
17134
|
+
if (changes['config']) {
|
|
17205
17135
|
this.updateConfiguration();
|
|
17206
17136
|
}
|
|
17207
17137
|
}
|
|
@@ -17245,9 +17175,9 @@ class QdTextareaComponent {
|
|
|
17245
17175
|
this.disabled = getDisabled(this.config) || !!this.control?.disabled;
|
|
17246
17176
|
}
|
|
17247
17177
|
initOpModeSubscription() {
|
|
17248
|
-
if (!this.
|
|
17178
|
+
if (!this._eventBrokerService)
|
|
17249
17179
|
return;
|
|
17250
|
-
this.
|
|
17180
|
+
this._eventBrokerService
|
|
17251
17181
|
.consume('operation_mode_changed')
|
|
17252
17182
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
17253
17183
|
.subscribe(topic => {
|
|
@@ -22190,43 +22120,51 @@ const isIsoTimestampValid = (isoTimestamp) => {
|
|
|
22190
22120
|
return valid;
|
|
22191
22121
|
};
|
|
22192
22122
|
const getDateTypeItems = (category) => {
|
|
22193
|
-
|
|
22123
|
+
const categoryItems = category.items ?? [];
|
|
22124
|
+
if (categoryItems[0]?.item !== undefined && !isIsoTimestampValid(categoryItems[0].item)) {
|
|
22194
22125
|
return [{ item: '', active: false }];
|
|
22195
22126
|
}
|
|
22196
22127
|
return [
|
|
22197
22128
|
{
|
|
22198
|
-
item:
|
|
22199
|
-
active:
|
|
22129
|
+
item: categoryItems[0]?.item || '',
|
|
22130
|
+
active: categoryItems[0]?.active || false
|
|
22200
22131
|
}
|
|
22201
22132
|
];
|
|
22202
22133
|
};
|
|
22203
22134
|
const getDateRangeTypeItems = (category) => {
|
|
22135
|
+
const categoryItems = category.items ?? [];
|
|
22204
22136
|
const items = [];
|
|
22205
22137
|
for (let i = 0; i < 2; i++) {
|
|
22206
|
-
if (
|
|
22138
|
+
if (categoryItems[i]?.item !== undefined && !isIsoTimestampValid(categoryItems[i].item)) {
|
|
22207
22139
|
items.push({ item: '', active: false });
|
|
22208
22140
|
}
|
|
22209
22141
|
else {
|
|
22210
22142
|
items.push({
|
|
22211
|
-
item:
|
|
22212
|
-
active:
|
|
22143
|
+
item: categoryItems[i]?.item || '',
|
|
22144
|
+
active: categoryItems[i]?.active || false
|
|
22213
22145
|
});
|
|
22214
22146
|
}
|
|
22215
22147
|
}
|
|
22216
22148
|
return items;
|
|
22217
22149
|
};
|
|
22218
|
-
const getBooleanTypeItems = (category) =>
|
|
22219
|
-
|
|
22220
|
-
|
|
22221
|
-
|
|
22222
|
-
|
|
22223
|
-
|
|
22224
|
-
|
|
22225
|
-
|
|
22226
|
-
|
|
22227
|
-
|
|
22228
|
-
|
|
22229
|
-
|
|
22150
|
+
const getBooleanTypeItems = (category) => {
|
|
22151
|
+
const [booleanItem] = category.items;
|
|
22152
|
+
return [
|
|
22153
|
+
{
|
|
22154
|
+
item: booleanItem.item,
|
|
22155
|
+
active: booleanItem.active || false
|
|
22156
|
+
}
|
|
22157
|
+
];
|
|
22158
|
+
};
|
|
22159
|
+
const getFreeTextTypeItems = (category) => {
|
|
22160
|
+
const categoryItems = category.items ?? [];
|
|
22161
|
+
return [
|
|
22162
|
+
{
|
|
22163
|
+
item: categoryItems[0]?.item || '',
|
|
22164
|
+
active: categoryItems[0]?.active || false
|
|
22165
|
+
}
|
|
22166
|
+
];
|
|
22167
|
+
};
|
|
22230
22168
|
const getCategoryItems = (category) => {
|
|
22231
22169
|
if (category.type === 'date' || category.type === 'dateTime') {
|
|
22232
22170
|
return getDateTypeItems(category);
|
|
@@ -22269,7 +22207,6 @@ const createFilterState = (filterData) => {
|
|
|
22269
22207
|
return { categories, filters, childCategoryMap };
|
|
22270
22208
|
};
|
|
22271
22209
|
|
|
22272
|
-
// @ts-strict-ignore
|
|
22273
22210
|
const initFilterState = createAction('[QdFilter] initFilterState', props());
|
|
22274
22211
|
const updateItem = createAction('[QdFilter] updateItem', props());
|
|
22275
22212
|
const updateCategoryItems = createAction('[QdFilter] updateCategoryItems', props());
|
|
@@ -22328,7 +22265,6 @@ function validateFilterSelection(filterSelection, filterCategories, selectionSou
|
|
|
22328
22265
|
});
|
|
22329
22266
|
}
|
|
22330
22267
|
|
|
22331
|
-
// @ts-strict-ignore
|
|
22332
22268
|
const initialState$2 = {};
|
|
22333
22269
|
const _filterReducer = createReducer(initialState$2, on(QdFilterActions.initFilterState, (state, { filterId, filterData }) => {
|
|
22334
22270
|
if (filterData === undefined || filterData.categories.length === 0) {
|
|
@@ -22349,7 +22285,7 @@ const _filterReducer = createReducer(initialState$2, on(QdFilterActions.initFilt
|
|
|
22349
22285
|
return updateStateWithNewItem(state, filterId, categoryIndex, itemIndex, newItem);
|
|
22350
22286
|
}), on(QdFilterActions.setItemsStateSingleSelect, (state, { filterId, categoryIndex, itemIndex }) => {
|
|
22351
22287
|
const newCategory = getNewCategory(state, filterId, categoryIndex);
|
|
22352
|
-
newCategory.items
|
|
22288
|
+
newCategory.items?.forEach((item, index) => {
|
|
22353
22289
|
item.active = index === itemIndex ? !item.active : false;
|
|
22354
22290
|
});
|
|
22355
22291
|
return updateStateWithNewCategory(state, filterId, categoryIndex, newCategory);
|
|
@@ -22357,14 +22293,12 @@ const _filterReducer = createReducer(initialState$2, on(QdFilterActions.initFilt
|
|
|
22357
22293
|
const newFilter = getNewFilter(state, filterId);
|
|
22358
22294
|
newFilter.categories.forEach((category, index) => {
|
|
22359
22295
|
if (categoryIndex === index) {
|
|
22360
|
-
category.items
|
|
22296
|
+
category.items?.forEach((itemDate) => {
|
|
22361
22297
|
if (filterKey === undefined || filterKey === '') {
|
|
22362
|
-
|
|
22298
|
+
itemDate.hidden = false;
|
|
22363
22299
|
return;
|
|
22364
22300
|
}
|
|
22365
|
-
|
|
22366
|
-
.toLowerCase()
|
|
22367
|
-
.includes(filterKey.toLowerCase());
|
|
22301
|
+
itemDate.hidden = !translateFunc(itemDate.i18n).toLowerCase().includes(filterKey.toLowerCase());
|
|
22368
22302
|
});
|
|
22369
22303
|
}
|
|
22370
22304
|
});
|
|
@@ -22389,7 +22323,7 @@ const _filterReducer = createReducer(initialState$2, on(QdFilterActions.initFilt
|
|
|
22389
22323
|
case 'dateRange':
|
|
22390
22324
|
case 'dateTimeRange':
|
|
22391
22325
|
case 'freeText':
|
|
22392
|
-
category.items
|
|
22326
|
+
category.items?.forEach((item, itemIndex) => {
|
|
22393
22327
|
const itemValue = newFilterSelection[category.category]?.[itemIndex] || '';
|
|
22394
22328
|
item.item = itemValue;
|
|
22395
22329
|
item.active = !!itemValue;
|
|
@@ -22398,7 +22332,7 @@ const _filterReducer = createReducer(initialState$2, on(QdFilterActions.initFilt
|
|
|
22398
22332
|
case 'singleSelect':
|
|
22399
22333
|
case 'multiSelect':
|
|
22400
22334
|
case 'boolean':
|
|
22401
|
-
category.items
|
|
22335
|
+
category.items?.forEach(item => {
|
|
22402
22336
|
item.active = newFilterSelection[category.category]?.includes(item.item) || false;
|
|
22403
22337
|
});
|
|
22404
22338
|
}
|
|
@@ -22416,7 +22350,7 @@ const _filterReducer = createReducer(initialState$2, on(QdFilterActions.initFilt
|
|
|
22416
22350
|
};
|
|
22417
22351
|
}), on(QdFilterActions.clearCategorySelection, (state, { filterId, categoryIndex }) => {
|
|
22418
22352
|
const newCategory = getNewCategory(state, filterId, categoryIndex);
|
|
22419
|
-
newCategory.items
|
|
22353
|
+
newCategory.items?.forEach((item) => {
|
|
22420
22354
|
item.active = false;
|
|
22421
22355
|
});
|
|
22422
22356
|
return updateStateWithNewCategory(state, filterId, categoryIndex, newCategory);
|
|
@@ -22427,32 +22361,32 @@ function filterReducer(state, action) {
|
|
|
22427
22361
|
|
|
22428
22362
|
const categoryHasActiveItem = (category) => {
|
|
22429
22363
|
const items = (category && category.items) || [];
|
|
22430
|
-
return items.reduce((hasActiveItem, item) => hasActiveItem || item.active, false);
|
|
22364
|
+
return items.reduce((hasActiveItem, item) => hasActiveItem || !!item.active, false);
|
|
22431
22365
|
};
|
|
22432
22366
|
const hasActiveCategory = (categories = []) => categories.reduce((res, category) => res || categoryHasActiveItem(category), false);
|
|
22433
22367
|
|
|
22434
22368
|
const getActiveItems = (categories) => {
|
|
22435
22369
|
const activeItems = [];
|
|
22436
22370
|
categories.forEach(category => {
|
|
22437
|
-
const
|
|
22371
|
+
const categoryItems = [];
|
|
22438
22372
|
let isCategoryActive = false;
|
|
22439
|
-
category.items.forEach(item => {
|
|
22373
|
+
(category.items ?? []).forEach(item => {
|
|
22440
22374
|
if (category.type === 'dateRange' || category.type === 'dateTimeRange') {
|
|
22441
22375
|
if (!item.active) {
|
|
22442
|
-
|
|
22376
|
+
categoryItems.push('');
|
|
22443
22377
|
return;
|
|
22444
22378
|
}
|
|
22445
22379
|
isCategoryActive = true;
|
|
22446
|
-
|
|
22380
|
+
categoryItems.push(item.item);
|
|
22447
22381
|
return;
|
|
22448
22382
|
}
|
|
22449
22383
|
if (item.active) {
|
|
22450
22384
|
isCategoryActive = true;
|
|
22451
|
-
|
|
22385
|
+
categoryItems.push(item.item);
|
|
22452
22386
|
}
|
|
22453
22387
|
});
|
|
22454
22388
|
if (isCategoryActive)
|
|
22455
|
-
activeItems.push(
|
|
22389
|
+
activeItems.push({ category: category.category, items: categoryItems });
|
|
22456
22390
|
});
|
|
22457
22391
|
return activeItems;
|
|
22458
22392
|
};
|
|
@@ -22488,7 +22422,7 @@ function getFilterUrlParameter(categories, outputLegacyQueryStringFormat = false
|
|
|
22488
22422
|
.map(category => category.category + categoryToItemsAssigner + getCategoryItemsUrlStrings(category).join(itemSeparator))
|
|
22489
22423
|
.join(categorySeparator);
|
|
22490
22424
|
function hasCategoryActiveItems(category) {
|
|
22491
|
-
return category.items.some(item => item.active);
|
|
22425
|
+
return (category.items ?? []).some(item => item.active);
|
|
22492
22426
|
}
|
|
22493
22427
|
function getCategoryItemsUrlStrings(category) {
|
|
22494
22428
|
if (category.type === 'dateRange' || category.type === 'dateTimeRange') {
|
|
@@ -22509,7 +22443,6 @@ function escapeFilterValue(value) {
|
|
|
22509
22443
|
return value.replace(new RegExp(`(${SERIALIZATION_SYMBOLS.map(s => '\\' + s).join('|')})`, 'g'), '\\$1');
|
|
22510
22444
|
}
|
|
22511
22445
|
|
|
22512
|
-
// @ts-strict-ignore
|
|
22513
22446
|
const selectFeature$1 = (state) => state.qdFilter;
|
|
22514
22447
|
const selectFilterDataById = createSelector(selectFeature$1, (state, { filterId }) => getCategories(state, filterId));
|
|
22515
22448
|
const selectCategoryById = createSelector(selectFeature$1, (state, { filterId, categoryIndex }) => getCategory(state, filterId, categoryIndex));
|
|
@@ -22542,26 +22475,25 @@ const QdFilterSelector = {
|
|
|
22542
22475
|
selectFilterCategoryValue
|
|
22543
22476
|
};
|
|
22544
22477
|
|
|
22545
|
-
// @ts-strict-ignore
|
|
22546
22478
|
class QdFilterService {
|
|
22547
|
-
|
|
22479
|
+
_store = inject(Store);
|
|
22548
22480
|
translateService = inject(TranslateService);
|
|
22549
|
-
queryStringSubjects =
|
|
22550
|
-
filterUrlParameterSubjects =
|
|
22551
|
-
postBodySubjects =
|
|
22481
|
+
queryStringSubjects = {};
|
|
22482
|
+
filterUrlParameterSubjects = {};
|
|
22483
|
+
postBodySubjects = {};
|
|
22552
22484
|
itemsLoadingSubjects = {};
|
|
22553
22485
|
getItems$(filterId, categoryIndex) {
|
|
22554
|
-
return this.
|
|
22486
|
+
return this._store.select(QdFilterSelector.selectItems, {
|
|
22555
22487
|
filterId,
|
|
22556
22488
|
categoryIndex
|
|
22557
22489
|
});
|
|
22558
22490
|
}
|
|
22559
22491
|
getItemById$(filterId, categoryIndex, itemIndex) {
|
|
22560
|
-
return this.
|
|
22492
|
+
return this._store.select(selectItem(filterId, categoryIndex, itemIndex));
|
|
22561
22493
|
}
|
|
22562
22494
|
getMinDate$(filterId, categoryIndex, itemIndex) {
|
|
22563
22495
|
return itemIndex === 1
|
|
22564
|
-
? this.
|
|
22496
|
+
? this._store.select(QdFilterSelector.selectItemDate, {
|
|
22565
22497
|
categoryIndex,
|
|
22566
22498
|
itemIndex: 0,
|
|
22567
22499
|
filterId
|
|
@@ -22570,7 +22502,7 @@ class QdFilterService {
|
|
|
22570
22502
|
}
|
|
22571
22503
|
getMaxDate$(filterId, categoryIndex, itemIndex) {
|
|
22572
22504
|
return itemIndex === 0
|
|
22573
|
-
? this.
|
|
22505
|
+
? this._store.select(QdFilterSelector.selectItemDate, {
|
|
22574
22506
|
categoryIndex,
|
|
22575
22507
|
itemIndex: 1,
|
|
22576
22508
|
filterId
|
|
@@ -22594,7 +22526,7 @@ class QdFilterService {
|
|
|
22594
22526
|
});
|
|
22595
22527
|
}
|
|
22596
22528
|
getCurrentQueryString(filterId, outputLegacyQueryStringFormat) {
|
|
22597
|
-
return this.
|
|
22529
|
+
return this._store.select(state => QdFilterSelector.selectQueryString(state, { filterId, outputLegacyQueryStringFormat }));
|
|
22598
22530
|
}
|
|
22599
22531
|
emitFilterUrlParameterString(filterId) {
|
|
22600
22532
|
this.getCurrentFilterUrlParameterString(filterId)
|
|
@@ -22604,7 +22536,7 @@ class QdFilterService {
|
|
|
22604
22536
|
});
|
|
22605
22537
|
}
|
|
22606
22538
|
getCurrentFilterUrlParameterString(filterId) {
|
|
22607
|
-
return this.
|
|
22539
|
+
return this._store.select(state => QdFilterSelector.selectFilterUrlParameter(state, { filterId }));
|
|
22608
22540
|
}
|
|
22609
22541
|
emitPostBody(filterId) {
|
|
22610
22542
|
this.getCurrentPostBody(filterId)
|
|
@@ -22614,19 +22546,19 @@ class QdFilterService {
|
|
|
22614
22546
|
});
|
|
22615
22547
|
}
|
|
22616
22548
|
getCurrentPostBody(filterId) {
|
|
22617
|
-
return this.
|
|
22549
|
+
return this._store.select(state => QdFilterSelector.selectPostBody(state, { filterId }));
|
|
22618
22550
|
}
|
|
22619
22551
|
/**
|
|
22620
22552
|
* State Selector
|
|
22621
22553
|
*/
|
|
22622
22554
|
selectFilterDataById$(filterId) {
|
|
22623
|
-
return this.
|
|
22555
|
+
return this._store.select(QdFilterSelector.selectFilterDataById, { filterId });
|
|
22624
22556
|
}
|
|
22625
22557
|
selectHasActiveCategory$(filterId) {
|
|
22626
|
-
return this.
|
|
22558
|
+
return this._store.select(QdFilterSelector.selectHasActiveCategory, { filterId });
|
|
22627
22559
|
}
|
|
22628
22560
|
getCategoryById$(filterId, categoryIndex) {
|
|
22629
|
-
return this.
|
|
22561
|
+
return this._store.select(QdFilterSelector.selectCategoryById, {
|
|
22630
22562
|
filterId,
|
|
22631
22563
|
categoryIndex
|
|
22632
22564
|
});
|
|
@@ -22635,7 +22567,7 @@ class QdFilterService {
|
|
|
22635
22567
|
return this.getItemsLoadingSubject(filterId, categoryIndex).asObservable();
|
|
22636
22568
|
}
|
|
22637
22569
|
getFilterCategoryValue$(filterId, categoryIndex) {
|
|
22638
|
-
return this.
|
|
22570
|
+
return this._store.select(QdFilterSelector.selectFilterCategoryValue, {
|
|
22639
22571
|
filterId,
|
|
22640
22572
|
categoryIndex
|
|
22641
22573
|
});
|
|
@@ -22644,10 +22576,10 @@ class QdFilterService {
|
|
|
22644
22576
|
* Action dispatcher
|
|
22645
22577
|
*/
|
|
22646
22578
|
initFilterState(filterId, filterData) {
|
|
22647
|
-
this.
|
|
22579
|
+
this._store.dispatch(QdFilterActions.initFilterState({ filterId, filterData }));
|
|
22648
22580
|
}
|
|
22649
22581
|
updateItem(filterId, categoryIndex, itemIndex, value) {
|
|
22650
|
-
this.
|
|
22582
|
+
this._store.dispatch(QdFilterActions.updateItem({
|
|
22651
22583
|
filterId,
|
|
22652
22584
|
categoryIndex,
|
|
22653
22585
|
itemIndex,
|
|
@@ -22655,14 +22587,14 @@ class QdFilterService {
|
|
|
22655
22587
|
}));
|
|
22656
22588
|
}
|
|
22657
22589
|
updateCategoryItems(filterId, categoryIndex, items) {
|
|
22658
|
-
this.
|
|
22590
|
+
this._store.dispatch(QdFilterActions.updateCategoryItems({
|
|
22659
22591
|
filterId,
|
|
22660
22592
|
categoryIndex,
|
|
22661
22593
|
items
|
|
22662
22594
|
}));
|
|
22663
22595
|
}
|
|
22664
22596
|
setItemIsActive(filterId, categoryIndex, itemIndex, isActive) {
|
|
22665
|
-
this.
|
|
22597
|
+
this._store.dispatch(QdFilterActions.setItemIsActive({
|
|
22666
22598
|
categoryIndex,
|
|
22667
22599
|
itemIndex,
|
|
22668
22600
|
isActive,
|
|
@@ -22670,28 +22602,28 @@ class QdFilterService {
|
|
|
22670
22602
|
}));
|
|
22671
22603
|
}
|
|
22672
22604
|
setItemsStateSingleSelect(filterId, categoryIndex, itemIndex) {
|
|
22673
|
-
this.
|
|
22605
|
+
this._store.dispatch(QdFilterActions.setItemsStateSingleSelect({
|
|
22674
22606
|
categoryIndex,
|
|
22675
22607
|
itemIndex,
|
|
22676
22608
|
filterId
|
|
22677
22609
|
}));
|
|
22678
22610
|
}
|
|
22679
22611
|
hideShowItems(filterId, categoryIndex, filterKey) {
|
|
22680
|
-
this.
|
|
22612
|
+
this._store.dispatch(QdFilterActions.hideShowItems({
|
|
22681
22613
|
filterId,
|
|
22682
22614
|
categoryIndex,
|
|
22683
22615
|
filterKey,
|
|
22684
|
-
translateFunc: key => this.translateService.instant(key)
|
|
22616
|
+
translateFunc: (key) => this.translateService.instant(key)
|
|
22685
22617
|
}));
|
|
22686
22618
|
}
|
|
22687
22619
|
updateCategoryTranslation(filterId, filterData) {
|
|
22688
|
-
this.
|
|
22620
|
+
this._store.dispatch(QdFilterActions.updateCategoryTranslation({
|
|
22689
22621
|
filterId,
|
|
22690
22622
|
filterData
|
|
22691
22623
|
}));
|
|
22692
22624
|
}
|
|
22693
22625
|
setFilterSelection(filterId, filterSelection) {
|
|
22694
|
-
this.
|
|
22626
|
+
this._store.dispatch(QdFilterActions.setFilterSelection({
|
|
22695
22627
|
filterId,
|
|
22696
22628
|
filterSelection
|
|
22697
22629
|
}));
|
|
@@ -22702,20 +22634,20 @@ class QdFilterService {
|
|
|
22702
22634
|
this.filterUrlParameterSubjects[filterId] = new ReplaySubject(1);
|
|
22703
22635
|
}
|
|
22704
22636
|
setCategoryFilter(filterId, categoryIndex, filter) {
|
|
22705
|
-
this.
|
|
22637
|
+
this._store.dispatch(QdFilterActions.setCategoryFilter({
|
|
22706
22638
|
filterId,
|
|
22707
22639
|
categoryIndex,
|
|
22708
22640
|
filter
|
|
22709
22641
|
}));
|
|
22710
22642
|
}
|
|
22711
22643
|
resetCategoryFilter(filterId, categoryIndex) {
|
|
22712
|
-
this.
|
|
22644
|
+
this._store.dispatch(QdFilterActions.resetCategoryFilter({
|
|
22713
22645
|
filterId,
|
|
22714
22646
|
categoryIndex
|
|
22715
22647
|
}));
|
|
22716
22648
|
}
|
|
22717
22649
|
clearCategorySelection(filterId, categoryIndex) {
|
|
22718
|
-
this.
|
|
22650
|
+
this._store.dispatch(QdFilterActions.clearCategorySelection({
|
|
22719
22651
|
filterId,
|
|
22720
22652
|
categoryIndex
|
|
22721
22653
|
}));
|
|
@@ -22754,9 +22686,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
22754
22686
|
}]
|
|
22755
22687
|
}] });
|
|
22756
22688
|
|
|
22757
|
-
// @ts-strict-ignore
|
|
22758
22689
|
class QdFilterItemBooleanComponent {
|
|
22759
|
-
filterService = inject(QdFilterService);
|
|
22760
22690
|
filterId;
|
|
22761
22691
|
categoryIndex;
|
|
22762
22692
|
itemIndex;
|
|
@@ -22767,9 +22697,10 @@ class QdFilterItemBooleanComponent {
|
|
|
22767
22697
|
}
|
|
22768
22698
|
itemData;
|
|
22769
22699
|
active;
|
|
22700
|
+
_filterService = inject(QdFilterService);
|
|
22770
22701
|
_destroyRef = inject(DestroyRef);
|
|
22771
22702
|
ngOnInit() {
|
|
22772
|
-
this.
|
|
22703
|
+
this._filterService
|
|
22773
22704
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
22774
22705
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
22775
22706
|
.subscribe(item => {
|
|
@@ -22778,7 +22709,7 @@ class QdFilterItemBooleanComponent {
|
|
|
22778
22709
|
});
|
|
22779
22710
|
}
|
|
22780
22711
|
clickToggle(value) {
|
|
22781
|
-
this.
|
|
22712
|
+
this._filterService.setItemIsActive(this.filterId, this.categoryIndex, this.itemIndex, value === this.itemData);
|
|
22782
22713
|
}
|
|
22783
22714
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemBooleanComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22784
22715
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: QdFilterItemBooleanComponent, isStandalone: false, selector: "qd-filter-item-boolean", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", itemIndex: "itemIndex", i18n: "i18n", testId: ["data-test-id", "testId"] }, host: { properties: { "attr.data-test-id": "this.dataTestId" } }, ngImport: i0, template: "<qd-checkbox\n [inputData]=\"{ value: itemData, i18n: i18n || '', disabled: false }\"\n [value]=\"active ? itemData : null\"\n (valueChange)=\"clickToggle($event)\"\n qdRwdDisabled\n [data-test-id]=\"testId\"\n [attr.data-test-id]=\"testId + '-checkbox'\"\n></qd-checkbox>\n", styles: [":host{position:relative;display:flex;flex-wrap:wrap-reverse;margin:0 .75rem;line-height:2.125rem}:host ::ng-deep .qd-checkbox,:host ::ng-deep .qd-checkbox__label,:host ::ng-deep .qd-checkbox__caption{padding:0!important;border:0;margin:0!important}:host ::ng-deep .qd-checkbox__label{color:#757575!important}:host ::ng-deep .qd-checkbox__label:hover,:host ::ng-deep .qd-checkbox__label:focus,:host ::ng-deep .qd-checkbox__label:active{color:#171717!important}:host ::ng-deep .qd-checkbox__indicator{margin-right:.5rem!important}\n"], dependencies: [{ kind: "directive", type: QdRwdDisabledDirective, selector: "[qdRwdDisabled]" }, { kind: "component", type: QdCheckboxComponent, selector: "qd-checkbox", inputs: ["inputData", "value", "data-test-id", "disabled", "hasAutofocus", "isAriaHidden"], outputs: ["valueChange"] }] });
|
|
@@ -22802,9 +22733,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
22802
22733
|
args: ['attr.data-test-id']
|
|
22803
22734
|
}] } });
|
|
22804
22735
|
|
|
22805
|
-
// @ts-strict-ignore
|
|
22806
22736
|
class QdFilterCategoryBooleanComponent {
|
|
22807
|
-
|
|
22737
|
+
_filterService = inject(QdFilterService);
|
|
22808
22738
|
_destroyRef = inject(DestroyRef);
|
|
22809
22739
|
filterId;
|
|
22810
22740
|
categoryIndex;
|
|
@@ -22812,7 +22742,7 @@ class QdFilterCategoryBooleanComponent {
|
|
|
22812
22742
|
itemIndex = 0;
|
|
22813
22743
|
i18n;
|
|
22814
22744
|
ngOnInit() {
|
|
22815
|
-
this.
|
|
22745
|
+
this._filterService
|
|
22816
22746
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
22817
22747
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
22818
22748
|
.subscribe(item => {
|
|
@@ -22834,9 +22764,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
22834
22764
|
args: ['data-test-id']
|
|
22835
22765
|
}] } });
|
|
22836
22766
|
|
|
22837
|
-
// @ts-strict-ignore
|
|
22838
22767
|
class QdFilterItemFreeTextComponent {
|
|
22839
|
-
filterService = inject(QdFilterService);
|
|
22840
22768
|
filterId;
|
|
22841
22769
|
isInstantFiltering;
|
|
22842
22770
|
categoryIndex;
|
|
@@ -22849,18 +22777,19 @@ class QdFilterItemFreeTextComponent {
|
|
|
22849
22777
|
item;
|
|
22850
22778
|
i18n;
|
|
22851
22779
|
inputValue = '';
|
|
22780
|
+
_filterService = inject(QdFilterService);
|
|
22852
22781
|
_destroyRef = inject(DestroyRef);
|
|
22853
22782
|
get value() {
|
|
22854
22783
|
return (this.item && this.item.item) || '';
|
|
22855
22784
|
}
|
|
22856
22785
|
ngOnInit() {
|
|
22857
|
-
this.
|
|
22786
|
+
this._filterService
|
|
22858
22787
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
22859
22788
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
22860
22789
|
.subscribe(category => {
|
|
22861
22790
|
this.i18n = category.i18n;
|
|
22862
22791
|
});
|
|
22863
|
-
this.
|
|
22792
|
+
this._filterService
|
|
22864
22793
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
22865
22794
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
22866
22795
|
.subscribe(item => {
|
|
@@ -22872,18 +22801,18 @@ class QdFilterItemFreeTextComponent {
|
|
|
22872
22801
|
handleValueChange(value) {
|
|
22873
22802
|
this.inputValue = value;
|
|
22874
22803
|
if (!this.isInstantFiltering && value !== '') {
|
|
22875
|
-
this.
|
|
22804
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, `${value ?? ''}`);
|
|
22876
22805
|
}
|
|
22877
22806
|
}
|
|
22878
22807
|
handleEnter($event) {
|
|
22879
22808
|
if (this.isInstantFiltering && $event !== '') {
|
|
22880
|
-
this.
|
|
22809
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, `${$event ?? ''}`);
|
|
22881
22810
|
}
|
|
22882
22811
|
this.enterClick.emit();
|
|
22883
22812
|
this.inputValue = '';
|
|
22884
22813
|
}
|
|
22885
22814
|
handleReset() {
|
|
22886
|
-
this.
|
|
22815
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, '');
|
|
22887
22816
|
}
|
|
22888
22817
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemFreeTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22889
22818
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: QdFilterItemFreeTextComponent, isStandalone: false, selector: "qd-filter-item-free-text", inputs: { filterId: "filterId", isInstantFiltering: "isInstantFiltering", categoryIndex: "categoryIndex", itemIndex: "itemIndex", testId: ["data-test-id", "testId"] }, outputs: { enterClick: "enterClick" }, host: { properties: { "attr.data-test-id": "this.dataTestId" }, classAttribute: "qd-filter__item-free-text" }, ngImport: i0, template: "<qd-input\n [value]=\"inputValue\"\n (valueChange)=\"handleValueChange($event)\"\n (enterClick)=\"handleEnter($event)\"\n [config]=\"{ placeholder: { i18n: i18n }, viewonly: false }\"\n [data-test-id]=\"testId\"\n></qd-input>\n", styles: [":host ::ng-deep qd-input{width:10.25rem;max-width:12.5rem;height:2.125rem;margin-bottom:0!important}:host ::ng-deep qd-input .qd-form-label,:host ::ng-deep qd-input .qd-form-hint{display:none}:host ::ng-deep qd-input .qd-form-label,:host ::ng-deep qd-input .qd-input-input,:host ::ng-deep qd-input .qd-form-hint{margin-bottom:0!important}:host ::ng-deep qd-input .qd-input-input{height:2.125rem!important;border-color:transparent!important}:host ::ng-deep qd-input .qd-input-input input::placeholder{color:#757575!important}:host:hover ::ng-deep qd-input .qd-input-input input::placeholder{color:#171717!important}\n"], dependencies: [{ kind: "component", type: QdInputComponent, selector: "qd-input", inputs: ["formControlName", "value", "config", "isError", "data-test-id"], outputs: ["valueChange", "enterClick", "clickClear", "clickHint", "clickReadonly", "clickViewonly", "blurred", "optionsResolved"] }] });
|
|
@@ -22909,9 +22838,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
22909
22838
|
args: ['attr.data-test-id']
|
|
22910
22839
|
}] } });
|
|
22911
22840
|
|
|
22912
|
-
// @ts-strict-ignore
|
|
22913
22841
|
class QdFilterItemFreeTextCategoryComponent {
|
|
22914
|
-
|
|
22842
|
+
_filterService = inject(QdFilterService);
|
|
22915
22843
|
filterId;
|
|
22916
22844
|
isInstantFiltering;
|
|
22917
22845
|
categoryIndex;
|
|
@@ -22922,7 +22850,7 @@ class QdFilterItemFreeTextCategoryComponent {
|
|
|
22922
22850
|
this.updateState();
|
|
22923
22851
|
}
|
|
22924
22852
|
updateState() {
|
|
22925
|
-
this.
|
|
22853
|
+
this._filterService
|
|
22926
22854
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
22927
22855
|
.pipe(take(1))
|
|
22928
22856
|
.subscribe(item => {
|
|
@@ -22939,7 +22867,7 @@ class QdFilterItemFreeTextCategoryComponent {
|
|
|
22939
22867
|
this.updateState();
|
|
22940
22868
|
}
|
|
22941
22869
|
close() {
|
|
22942
|
-
this.
|
|
22870
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, '');
|
|
22943
22871
|
this.updateState();
|
|
22944
22872
|
}
|
|
22945
22873
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemFreeTextCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -22959,9 +22887,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
22959
22887
|
args: ['data-test-id']
|
|
22960
22888
|
}] } });
|
|
22961
22889
|
|
|
22962
|
-
// @ts-strict-ignore
|
|
22963
22890
|
class QdFilterItemDateComponent {
|
|
22964
|
-
|
|
22891
|
+
_filterService = inject(QdFilterService);
|
|
22965
22892
|
filterId;
|
|
22966
22893
|
categoryIndex;
|
|
22967
22894
|
itemIndex = 0;
|
|
@@ -22981,7 +22908,7 @@ class QdFilterItemDateComponent {
|
|
|
22981
22908
|
}
|
|
22982
22909
|
handleDateChange(date) {
|
|
22983
22910
|
if (date)
|
|
22984
|
-
this.
|
|
22911
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, date.toISOString());
|
|
22985
22912
|
}
|
|
22986
22913
|
handleClickTimePlaceholder($event) {
|
|
22987
22914
|
this.clickTimePlaceholder.emit($event);
|
|
@@ -22990,7 +22917,7 @@ class QdFilterItemDateComponent {
|
|
|
22990
22917
|
this.datepicker?.open();
|
|
22991
22918
|
}
|
|
22992
22919
|
subscribeGetItem() {
|
|
22993
|
-
this.
|
|
22920
|
+
this._filterService
|
|
22994
22921
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
22995
22922
|
.pipe(takeUntilDestroyed(this._destroyRef), filter(item => item !== undefined), tap(item => (this.item = QdDateAdapter.parseStoredDate(item.item))))
|
|
22996
22923
|
.subscribe();
|
|
@@ -23022,9 +22949,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23022
22949
|
args: [QdDatepickerComponent]
|
|
23023
22950
|
}] } });
|
|
23024
22951
|
|
|
23025
|
-
// @ts-strict-ignore
|
|
23026
22952
|
class QdFilterItemDateCategoryComponent {
|
|
23027
|
-
|
|
22953
|
+
_filterService = inject(QdFilterService);
|
|
23028
22954
|
filterId;
|
|
23029
22955
|
categoryIndex;
|
|
23030
22956
|
timePickerConfig;
|
|
@@ -23038,19 +22964,19 @@ class QdFilterItemDateCategoryComponent {
|
|
|
23038
22964
|
this.setItem();
|
|
23039
22965
|
}
|
|
23040
22966
|
removeItem(itemIndex) {
|
|
23041
|
-
this.
|
|
23042
|
-
this.
|
|
22967
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, Number(itemIndex), '');
|
|
22968
|
+
this._filterService.setItemIsActive(this.filterId, this.categoryIndex, Number(itemIndex), false);
|
|
23043
22969
|
}
|
|
23044
22970
|
handleClickTimePlaceholder($event) {
|
|
23045
22971
|
this.timePlaceholderSelected = $event;
|
|
23046
22972
|
}
|
|
23047
22973
|
setCategoryI18n() {
|
|
23048
|
-
this.i18n$ = this.
|
|
22974
|
+
this.i18n$ = this._filterService
|
|
23049
22975
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
23050
22976
|
.pipe(map(category => category.i18n));
|
|
23051
22977
|
}
|
|
23052
22978
|
setItem() {
|
|
23053
|
-
this.item$ = this.
|
|
22979
|
+
this.item$ = this._filterService.getItemById$(this.filterId, this.categoryIndex, this.itemIndex);
|
|
23054
22980
|
}
|
|
23055
22981
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemDateCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23056
22982
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: QdFilterItemDateCategoryComponent, isStandalone: false, selector: "qd-filter-category-date", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", timePickerConfig: "timePickerConfig", testId: ["data-test-id", "testId"] }, host: { classAttribute: "qd-filter__category-date" }, ngImport: i0, template: "<span\n class=\"qd-filter__date-label\"\n (click)=\"dateItem.open(); $event.stopPropagation()\"\n [attr.data-test-id]=\"testId + '-label'\"\n>\n {{ this.i18n$ | async | translate }} {{ \"i18n.qd.filter.date.on\" | translate }}\n</span>\n\n<qd-filter-item-date\n #dateItem\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n [data-test-id]=\"testId + '-item'\"\n [timePickerConfig]=\"timePickerConfig\"\n (clickTimePlaceholder)=\"handleClickTimePlaceholder($event)\"\n></qd-filter-item-date>\n\n@if ((item$ | async)?.active && (item$ | async)?.item) {\n<qd-chip\n [close]=\"true\"\n (closeClickEmitter)=\"removeItem($event)\"\n [data]=\"itemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + (item$ | async).item\"\n>\n {{ (item$ | async).item | localeDate : !!timePickerConfig : timePlaceholderSelected | async }}\n</qd-chip>\n}\n", styles: [":host{display:flex;align-items:center;padding-right:.75rem;padding-left:.75rem;color:#757575;cursor:default;line-height:2.125rem}:host:hover{color:#171717}:host .qd-filter__date-label{cursor:pointer}\n"], dependencies: [{ kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "component", type: QdFilterItemDateComponent, selector: "qd-filter-item-date", inputs: ["filterId", "categoryIndex", "itemIndex", "timePickerConfig", "data-test-id"], outputs: ["clickTimePlaceholder"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "pipe", type: LocaleDatePipe, name: "localeDate" }] });
|
|
@@ -23069,9 +22995,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23069
22995
|
args: ['data-test-id']
|
|
23070
22996
|
}] } });
|
|
23071
22997
|
|
|
23072
|
-
// @ts-strict-ignore
|
|
23073
22998
|
class QdFilterItemDateRangeComponent {
|
|
23074
|
-
|
|
22999
|
+
_filterService = inject(QdFilterService);
|
|
23075
23000
|
filterId;
|
|
23076
23001
|
categoryIndex;
|
|
23077
23002
|
itemIndex;
|
|
@@ -23092,10 +23017,10 @@ class QdFilterItemDateRangeComponent {
|
|
|
23092
23017
|
this.datepicker?.open();
|
|
23093
23018
|
}
|
|
23094
23019
|
get minDate$() {
|
|
23095
|
-
return this.
|
|
23020
|
+
return this._filterService.getMinDate$(this.filterId, this.categoryIndex, this.itemIndex);
|
|
23096
23021
|
}
|
|
23097
23022
|
get maxDate$() {
|
|
23098
|
-
return this.
|
|
23023
|
+
return this._filterService.getMaxDate$(this.filterId, this.categoryIndex, this.itemIndex);
|
|
23099
23024
|
}
|
|
23100
23025
|
ngOnInit() {
|
|
23101
23026
|
this.subscribeGetItem();
|
|
@@ -23104,23 +23029,23 @@ class QdFilterItemDateRangeComponent {
|
|
|
23104
23029
|
}
|
|
23105
23030
|
handleDateChange(date) {
|
|
23106
23031
|
if (date)
|
|
23107
|
-
this.
|
|
23032
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, date.toISOString());
|
|
23108
23033
|
}
|
|
23109
23034
|
handleClickTimePlaceholder($event) {
|
|
23110
23035
|
this.clickTimePlaceholder.emit($event);
|
|
23111
23036
|
}
|
|
23112
23037
|
subscribeGetItem() {
|
|
23113
|
-
this.
|
|
23038
|
+
this._filterService
|
|
23114
23039
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
23115
23040
|
.pipe(takeUntilDestroyed(this._destroyRef), filter(item => item !== undefined), tap(item => (this.item = QdDateAdapter.parseStoredDate(item.item))))
|
|
23116
23041
|
.subscribe();
|
|
23117
23042
|
}
|
|
23118
23043
|
subscribeMinMaxDate() {
|
|
23119
|
-
this.
|
|
23044
|
+
this._filterService
|
|
23120
23045
|
.getMinDate$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
23121
23046
|
.pipe(takeUntilDestroyed(this._destroyRef), tap(minDate => this.updateDisabledDates(minDate, 'to')))
|
|
23122
23047
|
.subscribe();
|
|
23123
|
-
this.
|
|
23048
|
+
this._filterService
|
|
23124
23049
|
.getMaxDate$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
23125
23050
|
.pipe(takeUntilDestroyed(this._destroyRef), tap(maxDate => this.updateDisabledDates(maxDate, 'from')))
|
|
23126
23051
|
.subscribe();
|
|
@@ -23134,7 +23059,7 @@ class QdFilterItemDateRangeComponent {
|
|
|
23134
23059
|
const index = targetProperty === 'from' ? 0 : 1;
|
|
23135
23060
|
this.config = {
|
|
23136
23061
|
...this.config,
|
|
23137
|
-
disabledDates: [{ ...this.config.disabledDates[index], [targetProperty]: parsed }]
|
|
23062
|
+
disabledDates: [{ ...this.config.disabledDates?.[index], [targetProperty]: parsed }]
|
|
23138
23063
|
};
|
|
23139
23064
|
}
|
|
23140
23065
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemDateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -23167,9 +23092,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23167
23092
|
args: [QdDatepickerComponent]
|
|
23168
23093
|
}] } });
|
|
23169
23094
|
|
|
23170
|
-
// @ts-strict-ignore
|
|
23171
23095
|
class QdFilterItemDateRangeCategoryComponent {
|
|
23172
|
-
|
|
23096
|
+
_filterService = inject(QdFilterService);
|
|
23173
23097
|
filterId;
|
|
23174
23098
|
categoryIndex;
|
|
23175
23099
|
testId;
|
|
@@ -23199,8 +23123,8 @@ class QdFilterItemDateRangeCategoryComponent {
|
|
|
23199
23123
|
event.stopPropagation();
|
|
23200
23124
|
}
|
|
23201
23125
|
removeItem(itemIndex) {
|
|
23202
|
-
this.
|
|
23203
|
-
this.
|
|
23126
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, Number(itemIndex), '');
|
|
23127
|
+
this._filterService.setItemIsActive(this.filterId, this.categoryIndex, Number(itemIndex), false);
|
|
23204
23128
|
}
|
|
23205
23129
|
handleFromTimePlaceholderClicked($event) {
|
|
23206
23130
|
this.fromItemTimePlaceholderClicked = $event;
|
|
@@ -23209,12 +23133,12 @@ class QdFilterItemDateRangeCategoryComponent {
|
|
|
23209
23133
|
this.untilItemTimePlaceholderClicked = $event;
|
|
23210
23134
|
}
|
|
23211
23135
|
setCategoryI18n() {
|
|
23212
|
-
this.i18n$ = this.
|
|
23136
|
+
this.i18n$ = this._filterService
|
|
23213
23137
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
23214
23138
|
.pipe(map(category => category.i18n));
|
|
23215
23139
|
}
|
|
23216
23140
|
setFromItem(index, targetMember) {
|
|
23217
|
-
this[targetMember] = this.
|
|
23141
|
+
this[targetMember] = this._filterService.getItemById$(this.filterId, this.categoryIndex, index);
|
|
23218
23142
|
}
|
|
23219
23143
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemDateRangeCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23220
23144
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: QdFilterItemDateRangeCategoryComponent, isStandalone: false, selector: "qd-filter-category-date-range", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", testId: ["data-test-id", "testId"], timePickerConfig: "timePickerConfig" }, host: { classAttribute: "qd-filter__category-date-range" }, ngImport: i0, template: "{{ this.i18n$ | async | translate }}\n\n<span class=\"qd-filter__date-range__group\">\n <span class=\"qd-filter__item-date-range__label\" (click)=\"openItem(fromItemRef, $event)\">{{\n \"i18n.qd.filter.dateRange.from\" | translate\n }}</span>\n\n <qd-filter-item-date-range\n #fromItemRef\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"fromItemIndex\"\n [data-test-id]=\"testId + '-item-date-from'\"\n [timePickerConfig]=\"fromItemTimePickerConfig\"\n (clickTimePlaceholder)=\"handleFromTimePlaceholderClicked($event)\"\n ></qd-filter-item-date-range>\n\n @if ((fromItem$ | async)?.active && (fromItem$ | async)?.item) {\n <qd-chip\n [close]=\"true\"\n (closeClickEmitter)=\"removeItem($event)\"\n [data]=\"fromItemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + (fromItem$ | async).item\"\n >\n {{ (fromItem$ | async).item | localeDate : !!timePickerConfig : fromItemTimePlaceholderClicked | async }}\n </qd-chip>\n }\n</span>\n\n<span class=\"qd-filter__date-range__group\">\n <span class=\"qd-filter__item-date-range__label\" (click)=\"openItem(untilItemRef, $event)\">{{\n \"i18n.qd.filter.dateRange.until\" | translate\n }}</span>\n\n <qd-filter-item-date-range\n #untilItemRef\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"untilItemIndex\"\n [data-test-id]=\"testId + '-item-date-until'\"\n [timePickerConfig]=\"untilItemTimePickerConfig\"\n (clickTimePlaceholder)=\"handleUntilTimePlaceholderClicked($event)\"\n ></qd-filter-item-date-range>\n\n @if ((untilItem$ | async)?.active && (untilItem$ | async)?.item) {\n <qd-chip\n [close]=\"true\"\n (closeClickEmitter)=\"removeItem($event)\"\n [data]=\"untilItemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + (untilItem$ | async).item\"\n >\n {{ (untilItem$ | async).item | localeDate : !!timePickerConfig : untilItemTimePlaceholderClicked | async }}\n </qd-chip>\n }\n</span>\n", styles: [":host{display:flex;flex-wrap:wrap;align-items:center;padding-right:.75rem;padding-left:.75rem;color:#757575;cursor:default;line-height:2.125rem}:host:hover{color:#171717}:host .qd-filter__item-date-range__label{margin-left:.25rem;cursor:pointer}:host .qd-filter__date-range__group{display:flex;align-items:center}\n"], dependencies: [{ kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "component", type: QdFilterItemDateRangeComponent, selector: "qd-filter-item-date-range", inputs: ["filterId", "categoryIndex", "itemIndex", "timePickerConfig", "data-test-id"], outputs: ["clickTimePlaceholder"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "pipe", type: LocaleDatePipe, name: "localeDate" }] });
|
|
@@ -23233,21 +23157,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23233
23157
|
type: Input
|
|
23234
23158
|
}] } });
|
|
23235
23159
|
|
|
23236
|
-
// @ts-strict-ignore
|
|
23237
23160
|
class QdFilterItemMultiSelectComponent {
|
|
23238
|
-
filterService = inject(QdFilterService);
|
|
23239
|
-
translateService = inject(TranslateService);
|
|
23240
|
-
elementRef = inject(ElementRef);
|
|
23241
|
-
category = inject(QD_FILTER_LISTBOX_HOST, { optional: true });
|
|
23242
23161
|
filterId;
|
|
23243
23162
|
categoryIndex;
|
|
23244
23163
|
itemIndex;
|
|
23245
23164
|
optionElementId;
|
|
23246
23165
|
testId;
|
|
23247
|
-
item;
|
|
23248
|
-
i18n;
|
|
23249
|
-
active;
|
|
23250
|
-
isActive = false;
|
|
23251
23166
|
role = 'option';
|
|
23252
23167
|
get idAttr() {
|
|
23253
23168
|
return this.optionElementId;
|
|
@@ -23264,9 +23179,17 @@ class QdFilterItemMultiSelectComponent {
|
|
|
23264
23179
|
onMouseDown(event) {
|
|
23265
23180
|
event.preventDefault();
|
|
23266
23181
|
}
|
|
23182
|
+
item;
|
|
23183
|
+
i18n;
|
|
23184
|
+
active;
|
|
23185
|
+
isActive = false;
|
|
23186
|
+
_filterService = inject(QdFilterService);
|
|
23187
|
+
_translateService = inject(TranslateService);
|
|
23188
|
+
_elementRef = inject(ElementRef);
|
|
23189
|
+
_category = inject(QD_FILTER_LISTBOX_HOST, { optional: true });
|
|
23267
23190
|
_destroyRef = inject(DestroyRef);
|
|
23268
23191
|
ngOnInit() {
|
|
23269
|
-
this.
|
|
23192
|
+
this._filterService
|
|
23270
23193
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
23271
23194
|
.pipe(takeUntilDestroyed(this._destroyRef), filter(item => !!item))
|
|
23272
23195
|
.subscribe(item => {
|
|
@@ -23274,10 +23197,10 @@ class QdFilterItemMultiSelectComponent {
|
|
|
23274
23197
|
this.i18n = item.i18n;
|
|
23275
23198
|
this.active = item.active;
|
|
23276
23199
|
});
|
|
23277
|
-
this.
|
|
23200
|
+
this._category?.registerOption(this);
|
|
23278
23201
|
}
|
|
23279
23202
|
ngOnDestroy() {
|
|
23280
|
-
this.
|
|
23203
|
+
this._category?.unregisterOption(this);
|
|
23281
23204
|
}
|
|
23282
23205
|
setActiveStyles() {
|
|
23283
23206
|
this.isActive = true;
|
|
@@ -23286,17 +23209,17 @@ class QdFilterItemMultiSelectComponent {
|
|
|
23286
23209
|
this.isActive = false;
|
|
23287
23210
|
}
|
|
23288
23211
|
getLabel() {
|
|
23289
|
-
return this.i18n ? this.
|
|
23212
|
+
return this.i18n ? this._translateService.instant(this.i18n) : '';
|
|
23290
23213
|
}
|
|
23291
23214
|
scrollIntoView() {
|
|
23292
|
-
this.
|
|
23215
|
+
this._elementRef.nativeElement.scrollIntoView({ block: 'nearest' });
|
|
23293
23216
|
}
|
|
23294
23217
|
setTabbable() { }
|
|
23295
23218
|
focus() {
|
|
23296
|
-
this.
|
|
23219
|
+
this._elementRef.nativeElement.focus();
|
|
23297
23220
|
}
|
|
23298
23221
|
clickToggle($event) {
|
|
23299
|
-
this.
|
|
23222
|
+
this._filterService.setItemIsActive(this.filterId, this.categoryIndex, this.itemIndex, !!$event);
|
|
23300
23223
|
}
|
|
23301
23224
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemMultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23302
23225
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: QdFilterItemMultiSelectComponent, isStandalone: false, selector: "qd-filter-item-multi-select", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", itemIndex: "itemIndex", optionElementId: "optionElementId", testId: ["data-test-id", "testId"] }, host: { listeners: { "mousedown": "onMouseDown($event)" }, properties: { "attr.role": "this.role", "attr.id": "this.idAttr", "attr.aria-selected": "this.ariaSelected", "class.qd-filter__category-option--active": "this.activeClass", "attr.data-test-id": "this.dataTestId" } }, ngImport: i0, template: "<qd-checkbox\n [inputData]=\"{ value: item, i18n: i18n, disabled: false }\"\n [value]=\"active ? item : null\"\n [isAriaHidden]=\"true\"\n (valueChange)=\"clickToggle($event)\"\n qdRwdDisabled\n [data-test-id]=\"testId\"\n></qd-checkbox>\n", styles: [":host{position:relative;display:flex;overflow:clip;flex-wrap:wrap-reverse;padding:0 .75rem;line-height:2.5rem;overflow-clip-margin:4px}:host:hover,:host:focus,:host:active{background:#f5f5f5}:host ::ng-deep .qd-checkbox{overflow:clip;overflow-clip-margin:4px}:host ::ng-deep .qd-checkbox__caption{display:block;cursor:pointer!important;white-space:nowrap}\n"], dependencies: [{ kind: "directive", type: QdRwdDisabledDirective, selector: "[qdRwdDisabled]" }, { kind: "component", type: QdCheckboxComponent, selector: "qd-checkbox", inputs: ["inputData", "value", "data-test-id", "disabled", "hasAutofocus", "isAriaHidden"], outputs: ["valueChange"] }] });
|
|
@@ -23335,12 +23258,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23335
23258
|
args: ['mousedown', ['$event']]
|
|
23336
23259
|
}] } });
|
|
23337
23260
|
|
|
23338
|
-
// @ts-strict-ignore
|
|
23339
23261
|
class QdFilterItemSingleSelectComponent {
|
|
23340
|
-
|
|
23341
|
-
|
|
23342
|
-
|
|
23343
|
-
|
|
23262
|
+
_filterService = inject(QdFilterService);
|
|
23263
|
+
_translateService = inject(TranslateService);
|
|
23264
|
+
_elementRef = inject(ElementRef);
|
|
23265
|
+
_category = inject(QD_FILTER_LISTBOX_HOST, { optional: true });
|
|
23344
23266
|
filterId;
|
|
23345
23267
|
categoryIndex;
|
|
23346
23268
|
itemIndex;
|
|
@@ -23369,7 +23291,7 @@ class QdFilterItemSingleSelectComponent {
|
|
|
23369
23291
|
_destroyRef = inject(DestroyRef);
|
|
23370
23292
|
ngOnInit() {
|
|
23371
23293
|
this.setTabbable(false);
|
|
23372
|
-
this.
|
|
23294
|
+
this._filterService
|
|
23373
23295
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
23374
23296
|
.pipe(takeUntilDestroyed(this._destroyRef), filter(item => !!item))
|
|
23375
23297
|
.subscribe(item => {
|
|
@@ -23377,10 +23299,10 @@ class QdFilterItemSingleSelectComponent {
|
|
|
23377
23299
|
this.i18n = item.i18n;
|
|
23378
23300
|
this.active = item.active;
|
|
23379
23301
|
});
|
|
23380
|
-
this.
|
|
23302
|
+
this._category?.registerOption(this);
|
|
23381
23303
|
}
|
|
23382
23304
|
ngOnDestroy() {
|
|
23383
|
-
this.
|
|
23305
|
+
this._category?.unregisterOption(this);
|
|
23384
23306
|
}
|
|
23385
23307
|
setActiveStyles() {
|
|
23386
23308
|
this.isActive = true;
|
|
@@ -23390,22 +23312,22 @@ class QdFilterItemSingleSelectComponent {
|
|
|
23390
23312
|
}
|
|
23391
23313
|
setTabbable(isTabbable) {
|
|
23392
23314
|
this.isTabbable = isTabbable;
|
|
23393
|
-
this.
|
|
23315
|
+
this._elementRef.nativeElement.setAttribute('tabindex', isTabbable ? '0' : '-1');
|
|
23394
23316
|
}
|
|
23395
23317
|
focus() {
|
|
23396
|
-
this.
|
|
23318
|
+
this._elementRef.nativeElement.focus();
|
|
23397
23319
|
}
|
|
23398
23320
|
getLabel() {
|
|
23399
|
-
return this.i18n ? this.
|
|
23321
|
+
return this.i18n ? this._translateService.instant(this.i18n) : '';
|
|
23400
23322
|
}
|
|
23401
23323
|
scrollIntoView() {
|
|
23402
|
-
this.
|
|
23324
|
+
this._elementRef.nativeElement.scrollIntoView({ block: 'nearest' });
|
|
23403
23325
|
}
|
|
23404
23326
|
handleActive() {
|
|
23405
23327
|
this.setItems();
|
|
23406
23328
|
}
|
|
23407
23329
|
setItems() {
|
|
23408
|
-
this.
|
|
23330
|
+
this._filterService.setItemsStateSingleSelect(this.filterId, this.categoryIndex, this.itemIndex);
|
|
23409
23331
|
}
|
|
23410
23332
|
close() {
|
|
23411
23333
|
this.closeEventEmitter.emit();
|
|
@@ -23448,11 +23370,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23448
23370
|
|
|
23449
23371
|
const NAVIGATION_KEYS = new Set(['ArrowDown', 'ArrowUp', 'Home', 'End']);
|
|
23450
23372
|
class QdFilterItemSelectCategoryComponent {
|
|
23451
|
-
|
|
23452
|
-
|
|
23453
|
-
|
|
23454
|
-
|
|
23455
|
-
isMobile$ = this.breakpointService.isViewportBelow('md');
|
|
23373
|
+
_filterService = inject(QdFilterService);
|
|
23374
|
+
_breakpointService = inject(QdBreakpointService);
|
|
23375
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
23376
|
+
isMobile$ = this._breakpointService.isViewportBelow('md');
|
|
23456
23377
|
filterId;
|
|
23457
23378
|
categoryIndex;
|
|
23458
23379
|
testId;
|
|
@@ -23516,13 +23437,13 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23516
23437
|
return `qd-filter__category-layer qd-filter__category-layer--${this.type}`;
|
|
23517
23438
|
}
|
|
23518
23439
|
get filterCategoryValue$() {
|
|
23519
|
-
return this.
|
|
23440
|
+
return this._filterService.getFilterCategoryValue$(this.filterId, this.categoryIndex);
|
|
23520
23441
|
}
|
|
23521
23442
|
ngOnInit() {
|
|
23522
23443
|
this.initCategorySubscription();
|
|
23523
23444
|
this.initItemsSubscription();
|
|
23524
23445
|
this.initShowSelectButton();
|
|
23525
|
-
this.itemsLoading$ = this.
|
|
23446
|
+
this.itemsLoading$ = this._filterService.getItemsLoading$(this.filterId, this.categoryIndex);
|
|
23526
23447
|
this.updateListboxAriaState();
|
|
23527
23448
|
}
|
|
23528
23449
|
ngAfterViewInit() {
|
|
@@ -23541,7 +23462,7 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23541
23462
|
}
|
|
23542
23463
|
onActiveOptionChanged() {
|
|
23543
23464
|
this.updateListboxAriaState();
|
|
23544
|
-
this.
|
|
23465
|
+
this._changeDetectorRef.markForCheck();
|
|
23545
23466
|
if (!this.isRadioGroup)
|
|
23546
23467
|
return;
|
|
23547
23468
|
this.moveTabStopToActiveOption();
|
|
@@ -23667,7 +23588,7 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23667
23588
|
this.updateListboxAriaState();
|
|
23668
23589
|
}
|
|
23669
23590
|
initialActiveOption() {
|
|
23670
|
-
return this.options.find(option => option.active) ?? this.options.first;
|
|
23591
|
+
return this.options.find(option => !!option.active) ?? this.options.first;
|
|
23671
23592
|
}
|
|
23672
23593
|
selectActiveOption() {
|
|
23673
23594
|
const active = this.keyManager?.activeItem;
|
|
@@ -23677,7 +23598,7 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23677
23598
|
const item = this.items?.[active.itemIndex];
|
|
23678
23599
|
if (!item)
|
|
23679
23600
|
return;
|
|
23680
|
-
this.
|
|
23601
|
+
this._filterService.setItemIsActive(this.filterId, this.categoryIndex, active.itemIndex, !item.active);
|
|
23681
23602
|
return;
|
|
23682
23603
|
}
|
|
23683
23604
|
this.applySingleSelection();
|
|
@@ -23686,19 +23607,19 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23686
23607
|
const active = this.keyManager?.activeItem;
|
|
23687
23608
|
if (!active || active.active)
|
|
23688
23609
|
return;
|
|
23689
|
-
this.
|
|
23610
|
+
this._filterService.setItemsStateSingleSelect(this.filterId, this.categoryIndex, active.itemIndex);
|
|
23690
23611
|
}
|
|
23691
23612
|
closeAndRefocus() {
|
|
23692
23613
|
this.closeLayer();
|
|
23693
23614
|
this.triggerRef?.nativeElement.focus();
|
|
23694
23615
|
}
|
|
23695
23616
|
close(itemIndex) {
|
|
23696
|
-
this.
|
|
23697
|
-
this.
|
|
23617
|
+
this._filterService.setItemIsActive(this.filterId, this.categoryIndex, Number(itemIndex), false);
|
|
23618
|
+
this._filterService.resetCategoryFilter(this.filterId, this.categoryIndex);
|
|
23698
23619
|
}
|
|
23699
23620
|
clearAll() {
|
|
23700
|
-
this.
|
|
23701
|
-
this.
|
|
23621
|
+
this._filterService.clearCategorySelection(this.filterId, this.categoryIndex);
|
|
23622
|
+
this._filterService.resetCategoryFilter(this.filterId, this.categoryIndex);
|
|
23702
23623
|
}
|
|
23703
23624
|
trackByItem(_index, entry) {
|
|
23704
23625
|
return entry.item.item;
|
|
@@ -23719,23 +23640,23 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23719
23640
|
.filter(entry => !!entry.item);
|
|
23720
23641
|
}
|
|
23721
23642
|
changeValue($event) {
|
|
23722
|
-
this.
|
|
23723
|
-
this.
|
|
23643
|
+
this._filterService.hideShowItems(this.filterId, this.categoryIndex, $event);
|
|
23644
|
+
this._filterService.setCategoryFilter(this.filterId, this.categoryIndex, $event);
|
|
23724
23645
|
}
|
|
23725
23646
|
initCategorySubscription() {
|
|
23726
|
-
this.
|
|
23647
|
+
this._filterService
|
|
23727
23648
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
23728
23649
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
23729
23650
|
.subscribe(category => {
|
|
23730
23651
|
this.type = category.type;
|
|
23731
23652
|
this.filter = category.filter;
|
|
23732
23653
|
this.i18n = category.i18n;
|
|
23733
|
-
this.dependsOn = category.dependsOn
|
|
23654
|
+
this.dependsOn = 'dependsOn' in category ? category.dependsOn : [];
|
|
23734
23655
|
this.updateListboxAriaState();
|
|
23735
23656
|
});
|
|
23736
23657
|
}
|
|
23737
23658
|
initItemsSubscription() {
|
|
23738
|
-
this.
|
|
23659
|
+
this._filterService
|
|
23739
23660
|
.getItems$(this.filterId, this.categoryIndex)
|
|
23740
23661
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
23741
23662
|
.subscribe(items => {
|
|
@@ -23754,18 +23675,18 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23754
23675
|
previousItems.every((item, index) => item.item === nextItems[index].item));
|
|
23755
23676
|
}
|
|
23756
23677
|
initShowSelectButton() {
|
|
23757
|
-
const category$ = this.
|
|
23678
|
+
const category$ = this._filterService
|
|
23758
23679
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
23759
23680
|
.pipe(takeUntilDestroyed(this._destroyRef));
|
|
23760
|
-
const allCategories$ = this.
|
|
23681
|
+
const allCategories$ = this._filterService
|
|
23761
23682
|
.selectFilterDataById$(this.filterId)
|
|
23762
23683
|
.pipe(takeUntilDestroyed(this._destroyRef));
|
|
23763
23684
|
this.showSelectButton$ = combineLatest([category$, allCategories$]).pipe(switchMap$1(([category, allCategories]) => {
|
|
23764
|
-
if (!Array.isArray(category
|
|
23685
|
+
if (!('dependsOn' in category) || !Array.isArray(category.dependsOn) || category.dependsOn.length === 0)
|
|
23765
23686
|
return of(true);
|
|
23766
23687
|
const parentItems$ = category.dependsOn.map((parentKey) => {
|
|
23767
23688
|
const parentIndex = allCategories.findIndex(cat => cat.category === parentKey);
|
|
23768
|
-
return this.
|
|
23689
|
+
return this._filterService
|
|
23769
23690
|
.getItems$(this.filterId, parentIndex)
|
|
23770
23691
|
.pipe(map$1(parentItems => Array.isArray(parentItems) && parentItems.some((item) => item.active)));
|
|
23771
23692
|
});
|
|
@@ -23778,7 +23699,7 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23778
23699
|
provide: QD_FILTER_LISTBOX_HOST,
|
|
23779
23700
|
useExisting: forwardRef(() => QdFilterItemSelectCategoryComponent)
|
|
23780
23701
|
}
|
|
23781
|
-
], viewQueries: [{ propertyName: "popoverDirective", first: true, predicate: QdPopoverOnClickDirective, descendants: true }, { propertyName: "triggerRef", first: true, predicate: ["triggerRef"], descendants: true }], ngImport: i0, template: "@if (showSelectButton$ | async) {\n<div\n #triggerRef\n [class]=\"buttonClassName\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-haspopup]=\"type === 'multiSelect' ? 'listbox' : null\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-label]=\"i18n | translate\"\n [attr.aria-controls]=\"triggerAriaControls\"\n [qdPopoverOnClick]=\"filterLayer\"\n [qdPopoverCloseStrategy]=\"'onOutsideClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n [qdPopoverMaxHeight]=\"maxFlyoutHeight\"\n qdPopoverPlacement=\"bottom-start\"\n [qdPopoverOffsetY]=\"-1\"\n (opened)=\"onLayerOpened()\"\n (closed)=\"onLayerClosed()\"\n [attr.data-test-id]=\"testId + '-select-button'\"\n>\n @if (!open) {\n <qd-icon\n [icon]=\"'ctrlDown'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--closed'\"\n [attr.data-test-id]=\"testId + '-closed'\"\n ></qd-icon>\n } @if (open) {\n <qd-icon\n [icon]=\"'ctrlTop'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--open'\"\n [attr.data-test-id]=\"testId + '-opened'\"\n ></qd-icon>\n }\n\n <div class=\"qd-filter__category-button-caption\">\n <span>\n {{ i18n | translate }}\n </span>\n </div>\n\n @if ((isMobile$ | async) && type === 'multiSelect') { @if (activeItemCount > 0) {\n <qd-chip [close]=\"true\" (closeClickEmitter)=\"clearAll()\" [data-test-id]=\"testId + '-selected-chip-count'\">{{\n activeItemCount\n }}</qd-chip>\n } } @else {\n <ng-container *ngTemplateOutlet=\"SelectedChip\"></ng-container>\n }\n</div>\n}\n\n<ng-template #filterLayer>\n <div [class]=\"layerContentClassName\" (focusout)=\"onFlyoutFocusout($event)\" (keydown.escape)=\"onFlyoutEscape()\">\n @if (closeButton) {\n <qd-icon\n [class]=\"'qd-filter__category-layer-close'\"\n (click)=\"closeLayer()\"\n [icon]=\"'ctrlTop'\"\n [attr.data-test-id]=\"testId + '-layer-close'\"\n ></qd-icon>\n } @if (itemsLoading$ | async) {\n <ng-container [ngTemplateOutlet]=\"loadingState\"></ng-container>\n } @else { @switch (type) { @case ('multiSelect') { @if (filter) {\n <qd-filter-form-items\n [inputFilterValue]=\"filterCategoryValue$ | async\"\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId\"\n ></qd-filter-form-items>\n }\n <ul\n class=\"qd-filter__category-layer-items qd-filter__category-listbox\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [id]=\"listboxId\"\n tabindex=\"0\"\n [qdAutofocus]=\"!filter\"\n [attr.aria-label]=\"i18n | translate\"\n [attr.aria-activedescendant]=\"activeOptionId\"\n (keydown)=\"onListboxKeydown($event)\"\n (focus)=\"onListboxFocus()\"\n (blur)=\"onListboxBlur()\"\n >\n @for (entry of selectedDropdownEntries; track trackByItem($index, entry)) {\n <ng-container\n [ngTemplateOutlet]=\"multiSelectItem\"\n [ngTemplateOutletContext]=\"{ item: entry.item, itemIndex: entry.itemIndex }\"\n ></ng-container>\n } @if (showSelectedSeparator) {\n <div\n class=\"qd-filter__category-layer-separator\"\n aria-hidden=\"true\"\n [attr.data-test-id]=\"testId + '-selected-separator'\"\n ></div>\n } @for (entry of unselectedDropdownEntries; track trackByItem($index, entry)) {\n <ng-container\n [ngTemplateOutlet]=\"multiSelectItem\"\n [ngTemplateOutletContext]=\"{ item: entry.item, itemIndex: entry.itemIndex }\"\n ></ng-container>\n } @if (hasNoVisibleItems) {\n <ng-container [ngTemplateOutlet]=\"emptyState\"></ng-container>\n }\n </ul>\n } @case ('singleSelect') { @if (filter) {\n <qd-filter-form-items\n [inputFilterValue]=\"filterCategoryValue$ | async\"\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId\"\n ></qd-filter-form-items>\n }\n <ul\n class=\"qd-filter__category-layer-items qd-filter__category-radiogroup\"\n role=\"radiogroup\"\n [id]=\"listboxId\"\n [attr.aria-label]=\"i18n | translate\"\n (keydown)=\"onListboxKeydown($event)\"\n >\n @for (item of items; track item.item; let itemIndex = $index) { @if (!item.hidden) {\n <qd-filter-item-single-select\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n [qdAutofocus]=\"isInitialFocusOption(itemIndex)\"\n [filterId]=\"filterId\"\n [data-test-id]=\"testId + '-item-' + itemIndex + '-' + item.item\"\n >\n </qd-filter-item-single-select>\n } }\n </ul>\n @if (hasNoVisibleItems) {\n <ng-container [ngTemplateOutlet]=\"emptyState\"></ng-container>\n } } } }\n </div>\n</ng-template>\n\n<ng-template #emptyState>\n <p class=\"qd-filter__category-layer-empty\" [attr.data-test-id]=\"testId + '-no-results'\">\n {{ \"i18n.qd.filter.noResults\" | translate }}\n </p>\n</ng-template>\n\n<ng-template #loadingState>\n <p class=\"qd-filter__category-layer-loading\" [attr.data-test-id]=\"testId + '-items-loading'\">\n {{ \"i18n.qd.filter.loading\" | translate }}\n </p>\n</ng-template>\n\n<ng-template #multiSelectItem let-item=\"item\" let-itemIndex=\"itemIndex\">\n @if (!item.hidden) {\n <qd-filter-item-multi-select\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n [optionElementId]=\"optionIds[itemIndex]\"\n [filterId]=\"filterId\"\n [data-test-id]=\"testId + '-item-' + itemIndex + '-' + item.item\"\n ></qd-filter-item-multi-select>\n }\n</ng-template>\n\n<ng-template #SelectedChip>\n @for (item of items; track item; let itemIndex = $index) {\n <!-- TODO: Add tooltip-->\n @if (item.active) {\n <qd-chip\n [close]=\"true\"\n (closeClickEmitter)=\"close($event)\"\n [data]=\"itemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + item.item\"\n >{{ item.i18n | translate }}</qd-chip\n >\n } }\n</ng-template>\n", styles: ["::ng-deep .qd-filter__category-layer{position:relative;display:flex;overflow:hidden;min-width:16.25rem;max-width:56.25rem;height:100%;flex-direction:column;padding:0;border:.0625rem solid rgb(151,151,151);background:#fff;box-shadow:#d5d5d5 .125rem .25rem .4375rem}::ng-deep .qd-filter__category-layer .qd-filter-form-items__filter{flex-shrink:0;margin-bottom:0}::ng-deep .qd-filter__category-layer .qd-checkbox__label{display:flex;height:2.5rem}::ng-deep .qd-filter__category-layer .qd-checkbox__indicator,::ng-deep .qd-filter__category-layer .qd-radio-buttons__indicator{transform:translateY(-.0625rem)}::ng-deep .qd-filter__category-layer-items{flex:1;overflow-y:auto}::ng-deep .qd-filter__category-listbox,::ng-deep .qd-filter__category-radiogroup{padding:0;margin:0;list-style:none}::ng-deep .qd-filter__category-listbox:focus,::ng-deep .qd-filter__category-listbox:focus-visible,::ng-deep .qd-filter__category-radiogroup:focus,::ng-deep .qd-filter__category-radiogroup:focus-visible{outline:none}::ng-deep .qd-filter__item-single-select:focus,::ng-deep .qd-filter__item-single-select:focus-visible{outline:none}::ng-deep .qd-keyboard-active .qd-filter__item-single-select:focus .qd-radio-buttons__indicator:after,::ng-deep .qd-keyboard-active .qd-filter__category-option--active .qd-radio-buttons__indicator:after,::ng-deep .qd-keyboard-active .qd-filter__category-option--active .qd-checkbox__indicator:after{position:absolute;top:50%;left:50%;width:1.25rem;height:1.25rem;content:\"\";outline:.125rem solid rgb(0,102,153);outline-offset:0;transform:translate(-50%,-50%)}::ng-deep .qd-filter__category-layer-separator{height:.0625rem;flex-shrink:0;background:#d5d5d5}::ng-deep .qd-filter__category-layer-empty,::ng-deep .qd-filter__category-layer-loading{padding:0 .9375rem;margin:0;color:#757575;font-size:.875rem;line-height:2.5rem}::ng-deep .qd-filter__category-layer-container{position:relative}::ng-deep .qd-filter__category-layer-close{position:absolute;z-index:1;top:.5rem;right:1rem;color:#757575;cursor:pointer}::ng-deep .qd-filter__category-layer-close:before{position:absolute;content:\"\";inset:-.5rem}::ng-deep .qd-filter__category-layer-close:hover,::ng-deep .qd-filter__category-layer-close:focus{color:#171717}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "component", type: QdFilterFormItemsComponent, selector: "qd-filter-form-items", inputs: ["inputFilterValue", "data-test-id"], outputs: ["filterValueChange"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "qdPopoverPlacement", "qdPopoverOffsetX", "qdPopoverOffsetY", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl", "qdPopoverRestoreFocus", "qdPopoverFlipIntoViewport"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "directive", type: QdAutofocusDirective, selector: "[qdAutofocus]", inputs: ["qdAutofocus"] }, { kind: "component", type: QdFilterItemMultiSelectComponent, selector: "qd-filter-item-multi-select", inputs: ["filterId", "categoryIndex", "itemIndex", "optionElementId", "data-test-id"] }, { kind: "component", type: QdFilterItemSingleSelectComponent, selector: "qd-filter-item-single-select", inputs: ["filterId", "categoryIndex", "itemIndex", "optionElementId", "data-test-id"], outputs: ["closeEventEmitter"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
23702
|
+
], viewQueries: [{ propertyName: "popoverDirective", first: true, predicate: QdPopoverOnClickDirective, descendants: true }, { propertyName: "triggerRef", first: true, predicate: ["triggerRef"], descendants: true }], ngImport: i0, template: "@if (showSelectButton$ | async) {\n<div\n #triggerRef\n [class]=\"buttonClassName\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-haspopup]=\"type === 'multiSelect' ? 'listbox' : null\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-label]=\"i18n | translate\"\n [attr.aria-controls]=\"triggerAriaControls\"\n [qdPopoverOnClick]=\"filterLayer\"\n [qdPopoverCloseStrategy]=\"'onOutsideClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n [qdPopoverMaxHeight]=\"maxFlyoutHeight\"\n qdPopoverPlacement=\"bottom-start\"\n [qdPopoverOffsetY]=\"-1\"\n (opened)=\"onLayerOpened()\"\n (closed)=\"onLayerClosed()\"\n [attr.data-test-id]=\"testId + '-select-button'\"\n>\n @if (!open) {\n <qd-icon\n [icon]=\"'ctrlDown'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--closed'\"\n [attr.data-test-id]=\"testId + '-closed'\"\n ></qd-icon>\n } @if (open) {\n <qd-icon\n [icon]=\"'ctrlTop'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--open'\"\n [attr.data-test-id]=\"testId + '-opened'\"\n ></qd-icon>\n }\n\n <div class=\"qd-filter__category-button-caption\">\n <span>\n {{ i18n | translate }}\n </span>\n </div>\n\n @if ((isMobile$ | async) && type === 'multiSelect') { @if (activeItemCount > 0) {\n <qd-chip [close]=\"true\" (closeClickEmitter)=\"clearAll()\" [data-test-id]=\"testId + '-selected-chip-count'\">{{\n activeItemCount\n }}</qd-chip>\n } } @else {\n <ng-container *ngTemplateOutlet=\"SelectedChip\"></ng-container>\n }\n</div>\n}\n\n<ng-template #filterLayer>\n <div [class]=\"layerContentClassName\" (focusout)=\"onFlyoutFocusout($event)\" (keydown.escape)=\"onFlyoutEscape()\">\n @if (closeButton) {\n <qd-icon\n [class]=\"'qd-filter__category-layer-close'\"\n (click)=\"closeLayer()\"\n [icon]=\"'ctrlTop'\"\n [attr.data-test-id]=\"testId + '-layer-close'\"\n ></qd-icon>\n } @if (itemsLoading$ | async) {\n <ng-container [ngTemplateOutlet]=\"loadingState\"></ng-container>\n } @else { @switch (type) { @case ('multiSelect') { @if (filter) {\n <qd-filter-form-items\n [inputFilterValue]=\"filterCategoryValue$ | async\"\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId\"\n ></qd-filter-form-items>\n }\n <ul\n class=\"qd-filter__category-layer-items qd-filter__category-listbox\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [id]=\"listboxId\"\n tabindex=\"0\"\n [qdAutofocus]=\"!filter\"\n [attr.aria-label]=\"i18n | translate\"\n [attr.aria-activedescendant]=\"activeOptionId\"\n (keydown)=\"onListboxKeydown($event)\"\n (focus)=\"onListboxFocus()\"\n (blur)=\"onListboxBlur()\"\n >\n @for (entry of selectedDropdownEntries; track trackByItem($index, entry)) {\n <ng-container\n [ngTemplateOutlet]=\"multiSelectItem\"\n [ngTemplateOutletContext]=\"{ item: entry.item, itemIndex: entry.itemIndex }\"\n ></ng-container>\n } @if (showSelectedSeparator) {\n <div\n class=\"qd-filter__category-layer-separator\"\n aria-hidden=\"true\"\n [attr.data-test-id]=\"testId + '-selected-separator'\"\n ></div>\n } @for (entry of unselectedDropdownEntries; track trackByItem($index, entry)) {\n <ng-container\n [ngTemplateOutlet]=\"multiSelectItem\"\n [ngTemplateOutletContext]=\"{ item: entry.item, itemIndex: entry.itemIndex }\"\n ></ng-container>\n } @if (hasNoVisibleItems) {\n <ng-container [ngTemplateOutlet]=\"emptyState\"></ng-container>\n }\n </ul>\n } @case ('singleSelect') { @if (filter) {\n <qd-filter-form-items\n [inputFilterValue]=\"filterCategoryValue$ | async\"\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId\"\n ></qd-filter-form-items>\n }\n <ul\n class=\"qd-filter__category-layer-items qd-filter__category-radiogroup\"\n role=\"radiogroup\"\n [id]=\"listboxId\"\n [attr.aria-label]=\"i18n | translate\"\n (keydown)=\"onListboxKeydown($event)\"\n >\n @for (item of items; track item.item; let itemIndex = $index) { @if (!item.hidden) {\n <qd-filter-item-single-select\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n [qdAutofocus]=\"isInitialFocusOption(itemIndex)\"\n [filterId]=\"filterId\"\n [data-test-id]=\"testId + '-item-' + itemIndex + '-' + item.item\"\n >\n </qd-filter-item-single-select>\n } }\n </ul>\n @if (hasNoVisibleItems) {\n <ng-container [ngTemplateOutlet]=\"emptyState\"></ng-container>\n } } } }\n </div>\n</ng-template>\n\n<ng-template #emptyState>\n <p class=\"qd-filter__category-layer-empty\" [attr.data-test-id]=\"testId + '-no-results'\">\n {{ \"i18n.qd.filter.noResults\" | translate }}\n </p>\n</ng-template>\n\n<ng-template #loadingState>\n <p class=\"qd-filter__category-layer-loading\" [attr.data-test-id]=\"testId + '-items-loading'\">\n {{ \"i18n.qd.filter.loading\" | translate }}\n </p>\n</ng-template>\n\n<ng-template #multiSelectItem let-item=\"item\" let-itemIndex=\"itemIndex\">\n @if (!item.hidden) {\n <qd-filter-item-multi-select\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n [optionElementId]=\"optionIds[itemIndex]\"\n [filterId]=\"filterId\"\n [data-test-id]=\"testId + '-item-' + itemIndex + '-' + item.item\"\n ></qd-filter-item-multi-select>\n }\n</ng-template>\n\n<ng-template #SelectedChip>\n @for (item of items; track item; let itemIndex = $index) {\n <!-- TODO: Add tooltip-->\n @if (item.active) {\n <qd-chip\n [close]=\"true\"\n (closeClickEmitter)=\"close($event)\"\n [data]=\"itemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + item.item\"\n >{{ item.i18n | translate }}</qd-chip\n >\n } }\n</ng-template>\n", styles: ["::ng-deep .qd-filter__category-layer{position:relative;display:flex;overflow:hidden;min-width:16.25rem;max-width:56.25rem;height:100%;flex-direction:column;padding:0;border:.0625rem solid rgb(151,151,151);background:#fff;box-shadow:#d5d5d5 .125rem .25rem .4375rem}::ng-deep .qd-filter__category-layer .qd-filter-form-items__filter{flex-shrink:0;margin-bottom:0}::ng-deep .qd-filter__category-layer .qd-checkbox__label{display:flex;height:2.5rem}::ng-deep .qd-filter__category-layer .qd-checkbox__indicator,::ng-deep .qd-filter__category-layer .qd-radio-buttons__indicator{transform:translateY(-.0625rem)}::ng-deep .qd-filter__category-layer-items{flex:1;overflow-y:auto}::ng-deep .qd-filter__category-listbox,::ng-deep .qd-filter__category-radiogroup{padding:0;margin:0;list-style:none}::ng-deep .qd-filter__category-listbox:focus,::ng-deep .qd-filter__category-listbox:focus-visible,::ng-deep .qd-filter__category-radiogroup:focus,::ng-deep .qd-filter__category-radiogroup:focus-visible{outline:none}::ng-deep .qd-filter__item-single-select:focus,::ng-deep .qd-filter__item-single-select:focus-visible{outline:none}::ng-deep .qd-filter__item-single-select:focus-visible .qd-radio-buttons__indicator:after,::ng-deep .qd-filter__category-listbox:focus-visible .qd-filter__category-option--active .qd-checkbox__indicator:after{outline:2px solid rgb(0,102,153);outline-offset:2px;position:absolute;top:50%;left:50%;width:calc(1.25rem - 4px);height:calc(1.25rem - 4px);content:\"\";transform:translate(-50%,-50%)}::ng-deep .qd-filter__category-layer-separator{height:.0625rem;flex-shrink:0;background:#d5d5d5}::ng-deep .qd-filter__category-layer-empty,::ng-deep .qd-filter__category-layer-loading{padding:0 .9375rem;margin:0;color:#757575;font-size:.875rem;line-height:2.5rem}::ng-deep .qd-filter__category-layer-container{position:relative}::ng-deep .qd-filter__category-layer-close{position:absolute;z-index:1;top:.5rem;right:1rem;color:#757575;cursor:pointer}::ng-deep .qd-filter__category-layer-close:before{position:absolute;content:\"\";inset:-.5rem}::ng-deep .qd-filter__category-layer-close:hover,::ng-deep .qd-filter__category-layer-close:focus{color:#171717}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "component", type: QdFilterFormItemsComponent, selector: "qd-filter-form-items", inputs: ["inputFilterValue", "data-test-id"], outputs: ["filterValueChange"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "qdPopoverPlacement", "qdPopoverOffsetX", "qdPopoverOffsetY", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl", "qdPopoverRestoreFocus", "qdPopoverFlipIntoViewport"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "directive", type: QdAutofocusDirective, selector: "[qdAutofocus]", inputs: ["qdAutofocus"] }, { kind: "component", type: QdFilterItemMultiSelectComponent, selector: "qd-filter-item-multi-select", inputs: ["filterId", "categoryIndex", "itemIndex", "optionElementId", "data-test-id"] }, { kind: "component", type: QdFilterItemSingleSelectComponent, selector: "qd-filter-item-single-select", inputs: ["filterId", "categoryIndex", "itemIndex", "optionElementId", "data-test-id"], outputs: ["closeEventEmitter"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
23782
23703
|
}
|
|
23783
23704
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemSelectCategoryComponent, decorators: [{
|
|
23784
23705
|
type: Component,
|
|
@@ -23787,7 +23708,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23787
23708
|
provide: QD_FILTER_LISTBOX_HOST,
|
|
23788
23709
|
useExisting: forwardRef(() => QdFilterItemSelectCategoryComponent)
|
|
23789
23710
|
}
|
|
23790
|
-
], standalone: false, template: "@if (showSelectButton$ | async) {\n<div\n #triggerRef\n [class]=\"buttonClassName\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-haspopup]=\"type === 'multiSelect' ? 'listbox' : null\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-label]=\"i18n | translate\"\n [attr.aria-controls]=\"triggerAriaControls\"\n [qdPopoverOnClick]=\"filterLayer\"\n [qdPopoverCloseStrategy]=\"'onOutsideClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n [qdPopoverMaxHeight]=\"maxFlyoutHeight\"\n qdPopoverPlacement=\"bottom-start\"\n [qdPopoverOffsetY]=\"-1\"\n (opened)=\"onLayerOpened()\"\n (closed)=\"onLayerClosed()\"\n [attr.data-test-id]=\"testId + '-select-button'\"\n>\n @if (!open) {\n <qd-icon\n [icon]=\"'ctrlDown'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--closed'\"\n [attr.data-test-id]=\"testId + '-closed'\"\n ></qd-icon>\n } @if (open) {\n <qd-icon\n [icon]=\"'ctrlTop'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--open'\"\n [attr.data-test-id]=\"testId + '-opened'\"\n ></qd-icon>\n }\n\n <div class=\"qd-filter__category-button-caption\">\n <span>\n {{ i18n | translate }}\n </span>\n </div>\n\n @if ((isMobile$ | async) && type === 'multiSelect') { @if (activeItemCount > 0) {\n <qd-chip [close]=\"true\" (closeClickEmitter)=\"clearAll()\" [data-test-id]=\"testId + '-selected-chip-count'\">{{\n activeItemCount\n }}</qd-chip>\n } } @else {\n <ng-container *ngTemplateOutlet=\"SelectedChip\"></ng-container>\n }\n</div>\n}\n\n<ng-template #filterLayer>\n <div [class]=\"layerContentClassName\" (focusout)=\"onFlyoutFocusout($event)\" (keydown.escape)=\"onFlyoutEscape()\">\n @if (closeButton) {\n <qd-icon\n [class]=\"'qd-filter__category-layer-close'\"\n (click)=\"closeLayer()\"\n [icon]=\"'ctrlTop'\"\n [attr.data-test-id]=\"testId + '-layer-close'\"\n ></qd-icon>\n } @if (itemsLoading$ | async) {\n <ng-container [ngTemplateOutlet]=\"loadingState\"></ng-container>\n } @else { @switch (type) { @case ('multiSelect') { @if (filter) {\n <qd-filter-form-items\n [inputFilterValue]=\"filterCategoryValue$ | async\"\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId\"\n ></qd-filter-form-items>\n }\n <ul\n class=\"qd-filter__category-layer-items qd-filter__category-listbox\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [id]=\"listboxId\"\n tabindex=\"0\"\n [qdAutofocus]=\"!filter\"\n [attr.aria-label]=\"i18n | translate\"\n [attr.aria-activedescendant]=\"activeOptionId\"\n (keydown)=\"onListboxKeydown($event)\"\n (focus)=\"onListboxFocus()\"\n (blur)=\"onListboxBlur()\"\n >\n @for (entry of selectedDropdownEntries; track trackByItem($index, entry)) {\n <ng-container\n [ngTemplateOutlet]=\"multiSelectItem\"\n [ngTemplateOutletContext]=\"{ item: entry.item, itemIndex: entry.itemIndex }\"\n ></ng-container>\n } @if (showSelectedSeparator) {\n <div\n class=\"qd-filter__category-layer-separator\"\n aria-hidden=\"true\"\n [attr.data-test-id]=\"testId + '-selected-separator'\"\n ></div>\n } @for (entry of unselectedDropdownEntries; track trackByItem($index, entry)) {\n <ng-container\n [ngTemplateOutlet]=\"multiSelectItem\"\n [ngTemplateOutletContext]=\"{ item: entry.item, itemIndex: entry.itemIndex }\"\n ></ng-container>\n } @if (hasNoVisibleItems) {\n <ng-container [ngTemplateOutlet]=\"emptyState\"></ng-container>\n }\n </ul>\n } @case ('singleSelect') { @if (filter) {\n <qd-filter-form-items\n [inputFilterValue]=\"filterCategoryValue$ | async\"\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId\"\n ></qd-filter-form-items>\n }\n <ul\n class=\"qd-filter__category-layer-items qd-filter__category-radiogroup\"\n role=\"radiogroup\"\n [id]=\"listboxId\"\n [attr.aria-label]=\"i18n | translate\"\n (keydown)=\"onListboxKeydown($event)\"\n >\n @for (item of items; track item.item; let itemIndex = $index) { @if (!item.hidden) {\n <qd-filter-item-single-select\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n [qdAutofocus]=\"isInitialFocusOption(itemIndex)\"\n [filterId]=\"filterId\"\n [data-test-id]=\"testId + '-item-' + itemIndex + '-' + item.item\"\n >\n </qd-filter-item-single-select>\n } }\n </ul>\n @if (hasNoVisibleItems) {\n <ng-container [ngTemplateOutlet]=\"emptyState\"></ng-container>\n } } } }\n </div>\n</ng-template>\n\n<ng-template #emptyState>\n <p class=\"qd-filter__category-layer-empty\" [attr.data-test-id]=\"testId + '-no-results'\">\n {{ \"i18n.qd.filter.noResults\" | translate }}\n </p>\n</ng-template>\n\n<ng-template #loadingState>\n <p class=\"qd-filter__category-layer-loading\" [attr.data-test-id]=\"testId + '-items-loading'\">\n {{ \"i18n.qd.filter.loading\" | translate }}\n </p>\n</ng-template>\n\n<ng-template #multiSelectItem let-item=\"item\" let-itemIndex=\"itemIndex\">\n @if (!item.hidden) {\n <qd-filter-item-multi-select\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n [optionElementId]=\"optionIds[itemIndex]\"\n [filterId]=\"filterId\"\n [data-test-id]=\"testId + '-item-' + itemIndex + '-' + item.item\"\n ></qd-filter-item-multi-select>\n }\n</ng-template>\n\n<ng-template #SelectedChip>\n @for (item of items; track item; let itemIndex = $index) {\n <!-- TODO: Add tooltip-->\n @if (item.active) {\n <qd-chip\n [close]=\"true\"\n (closeClickEmitter)=\"close($event)\"\n [data]=\"itemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + item.item\"\n >{{ item.i18n | translate }}</qd-chip\n >\n } }\n</ng-template>\n", styles: ["::ng-deep .qd-filter__category-layer{position:relative;display:flex;overflow:hidden;min-width:16.25rem;max-width:56.25rem;height:100%;flex-direction:column;padding:0;border:.0625rem solid rgb(151,151,151);background:#fff;box-shadow:#d5d5d5 .125rem .25rem .4375rem}::ng-deep .qd-filter__category-layer .qd-filter-form-items__filter{flex-shrink:0;margin-bottom:0}::ng-deep .qd-filter__category-layer .qd-checkbox__label{display:flex;height:2.5rem}::ng-deep .qd-filter__category-layer .qd-checkbox__indicator,::ng-deep .qd-filter__category-layer .qd-radio-buttons__indicator{transform:translateY(-.0625rem)}::ng-deep .qd-filter__category-layer-items{flex:1;overflow-y:auto}::ng-deep .qd-filter__category-listbox,::ng-deep .qd-filter__category-radiogroup{padding:0;margin:0;list-style:none}::ng-deep .qd-filter__category-listbox:focus,::ng-deep .qd-filter__category-listbox:focus-visible,::ng-deep .qd-filter__category-radiogroup:focus,::ng-deep .qd-filter__category-radiogroup:focus-visible{outline:none}::ng-deep .qd-filter__item-single-select:focus,::ng-deep .qd-filter__item-single-select:focus-visible{outline:none}::ng-deep .qd-
|
|
23711
|
+
], standalone: false, template: "@if (showSelectButton$ | async) {\n<div\n #triggerRef\n [class]=\"buttonClassName\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-haspopup]=\"type === 'multiSelect' ? 'listbox' : null\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-label]=\"i18n | translate\"\n [attr.aria-controls]=\"triggerAriaControls\"\n [qdPopoverOnClick]=\"filterLayer\"\n [qdPopoverCloseStrategy]=\"'onOutsideClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n [qdPopoverMaxHeight]=\"maxFlyoutHeight\"\n qdPopoverPlacement=\"bottom-start\"\n [qdPopoverOffsetY]=\"-1\"\n (opened)=\"onLayerOpened()\"\n (closed)=\"onLayerClosed()\"\n [attr.data-test-id]=\"testId + '-select-button'\"\n>\n @if (!open) {\n <qd-icon\n [icon]=\"'ctrlDown'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--closed'\"\n [attr.data-test-id]=\"testId + '-closed'\"\n ></qd-icon>\n } @if (open) {\n <qd-icon\n [icon]=\"'ctrlTop'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--open'\"\n [attr.data-test-id]=\"testId + '-opened'\"\n ></qd-icon>\n }\n\n <div class=\"qd-filter__category-button-caption\">\n <span>\n {{ i18n | translate }}\n </span>\n </div>\n\n @if ((isMobile$ | async) && type === 'multiSelect') { @if (activeItemCount > 0) {\n <qd-chip [close]=\"true\" (closeClickEmitter)=\"clearAll()\" [data-test-id]=\"testId + '-selected-chip-count'\">{{\n activeItemCount\n }}</qd-chip>\n } } @else {\n <ng-container *ngTemplateOutlet=\"SelectedChip\"></ng-container>\n }\n</div>\n}\n\n<ng-template #filterLayer>\n <div [class]=\"layerContentClassName\" (focusout)=\"onFlyoutFocusout($event)\" (keydown.escape)=\"onFlyoutEscape()\">\n @if (closeButton) {\n <qd-icon\n [class]=\"'qd-filter__category-layer-close'\"\n (click)=\"closeLayer()\"\n [icon]=\"'ctrlTop'\"\n [attr.data-test-id]=\"testId + '-layer-close'\"\n ></qd-icon>\n } @if (itemsLoading$ | async) {\n <ng-container [ngTemplateOutlet]=\"loadingState\"></ng-container>\n } @else { @switch (type) { @case ('multiSelect') { @if (filter) {\n <qd-filter-form-items\n [inputFilterValue]=\"filterCategoryValue$ | async\"\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId\"\n ></qd-filter-form-items>\n }\n <ul\n class=\"qd-filter__category-layer-items qd-filter__category-listbox\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [id]=\"listboxId\"\n tabindex=\"0\"\n [qdAutofocus]=\"!filter\"\n [attr.aria-label]=\"i18n | translate\"\n [attr.aria-activedescendant]=\"activeOptionId\"\n (keydown)=\"onListboxKeydown($event)\"\n (focus)=\"onListboxFocus()\"\n (blur)=\"onListboxBlur()\"\n >\n @for (entry of selectedDropdownEntries; track trackByItem($index, entry)) {\n <ng-container\n [ngTemplateOutlet]=\"multiSelectItem\"\n [ngTemplateOutletContext]=\"{ item: entry.item, itemIndex: entry.itemIndex }\"\n ></ng-container>\n } @if (showSelectedSeparator) {\n <div\n class=\"qd-filter__category-layer-separator\"\n aria-hidden=\"true\"\n [attr.data-test-id]=\"testId + '-selected-separator'\"\n ></div>\n } @for (entry of unselectedDropdownEntries; track trackByItem($index, entry)) {\n <ng-container\n [ngTemplateOutlet]=\"multiSelectItem\"\n [ngTemplateOutletContext]=\"{ item: entry.item, itemIndex: entry.itemIndex }\"\n ></ng-container>\n } @if (hasNoVisibleItems) {\n <ng-container [ngTemplateOutlet]=\"emptyState\"></ng-container>\n }\n </ul>\n } @case ('singleSelect') { @if (filter) {\n <qd-filter-form-items\n [inputFilterValue]=\"filterCategoryValue$ | async\"\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId\"\n ></qd-filter-form-items>\n }\n <ul\n class=\"qd-filter__category-layer-items qd-filter__category-radiogroup\"\n role=\"radiogroup\"\n [id]=\"listboxId\"\n [attr.aria-label]=\"i18n | translate\"\n (keydown)=\"onListboxKeydown($event)\"\n >\n @for (item of items; track item.item; let itemIndex = $index) { @if (!item.hidden) {\n <qd-filter-item-single-select\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n [qdAutofocus]=\"isInitialFocusOption(itemIndex)\"\n [filterId]=\"filterId\"\n [data-test-id]=\"testId + '-item-' + itemIndex + '-' + item.item\"\n >\n </qd-filter-item-single-select>\n } }\n </ul>\n @if (hasNoVisibleItems) {\n <ng-container [ngTemplateOutlet]=\"emptyState\"></ng-container>\n } } } }\n </div>\n</ng-template>\n\n<ng-template #emptyState>\n <p class=\"qd-filter__category-layer-empty\" [attr.data-test-id]=\"testId + '-no-results'\">\n {{ \"i18n.qd.filter.noResults\" | translate }}\n </p>\n</ng-template>\n\n<ng-template #loadingState>\n <p class=\"qd-filter__category-layer-loading\" [attr.data-test-id]=\"testId + '-items-loading'\">\n {{ \"i18n.qd.filter.loading\" | translate }}\n </p>\n</ng-template>\n\n<ng-template #multiSelectItem let-item=\"item\" let-itemIndex=\"itemIndex\">\n @if (!item.hidden) {\n <qd-filter-item-multi-select\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n [optionElementId]=\"optionIds[itemIndex]\"\n [filterId]=\"filterId\"\n [data-test-id]=\"testId + '-item-' + itemIndex + '-' + item.item\"\n ></qd-filter-item-multi-select>\n }\n</ng-template>\n\n<ng-template #SelectedChip>\n @for (item of items; track item; let itemIndex = $index) {\n <!-- TODO: Add tooltip-->\n @if (item.active) {\n <qd-chip\n [close]=\"true\"\n (closeClickEmitter)=\"close($event)\"\n [data]=\"itemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + item.item\"\n >{{ item.i18n | translate }}</qd-chip\n >\n } }\n</ng-template>\n", styles: ["::ng-deep .qd-filter__category-layer{position:relative;display:flex;overflow:hidden;min-width:16.25rem;max-width:56.25rem;height:100%;flex-direction:column;padding:0;border:.0625rem solid rgb(151,151,151);background:#fff;box-shadow:#d5d5d5 .125rem .25rem .4375rem}::ng-deep .qd-filter__category-layer .qd-filter-form-items__filter{flex-shrink:0;margin-bottom:0}::ng-deep .qd-filter__category-layer .qd-checkbox__label{display:flex;height:2.5rem}::ng-deep .qd-filter__category-layer .qd-checkbox__indicator,::ng-deep .qd-filter__category-layer .qd-radio-buttons__indicator{transform:translateY(-.0625rem)}::ng-deep .qd-filter__category-layer-items{flex:1;overflow-y:auto}::ng-deep .qd-filter__category-listbox,::ng-deep .qd-filter__category-radiogroup{padding:0;margin:0;list-style:none}::ng-deep .qd-filter__category-listbox:focus,::ng-deep .qd-filter__category-listbox:focus-visible,::ng-deep .qd-filter__category-radiogroup:focus,::ng-deep .qd-filter__category-radiogroup:focus-visible{outline:none}::ng-deep .qd-filter__item-single-select:focus,::ng-deep .qd-filter__item-single-select:focus-visible{outline:none}::ng-deep .qd-filter__item-single-select:focus-visible .qd-radio-buttons__indicator:after,::ng-deep .qd-filter__category-listbox:focus-visible .qd-filter__category-option--active .qd-checkbox__indicator:after{outline:2px solid rgb(0,102,153);outline-offset:2px;position:absolute;top:50%;left:50%;width:calc(1.25rem - 4px);height:calc(1.25rem - 4px);content:\"\";transform:translate(-50%,-50%)}::ng-deep .qd-filter__category-layer-separator{height:.0625rem;flex-shrink:0;background:#d5d5d5}::ng-deep .qd-filter__category-layer-empty,::ng-deep .qd-filter__category-layer-loading{padding:0 .9375rem;margin:0;color:#757575;font-size:.875rem;line-height:2.5rem}::ng-deep .qd-filter__category-layer-container{position:relative}::ng-deep .qd-filter__category-layer-close{position:absolute;z-index:1;top:.5rem;right:1rem;color:#757575;cursor:pointer}::ng-deep .qd-filter__category-layer-close:before{position:absolute;content:\"\";inset:-.5rem}::ng-deep .qd-filter__category-layer-close:hover,::ng-deep .qd-filter__category-layer-close:focus{color:#171717}\n"] }]
|
|
23791
23712
|
}], propDecorators: { filterId: [{
|
|
23792
23713
|
type: Input
|
|
23793
23714
|
}], categoryIndex: [{
|
|
@@ -23803,9 +23724,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23803
23724
|
args: ['triggerRef']
|
|
23804
23725
|
}] } });
|
|
23805
23726
|
|
|
23806
|
-
// @ts-strict-ignore
|
|
23807
23727
|
class QdFilterCategoryComponent {
|
|
23808
|
-
|
|
23728
|
+
_filterService = inject(QdFilterService);
|
|
23809
23729
|
translateService = inject(TranslateService);
|
|
23810
23730
|
_destroyRef = inject(DestroyRef);
|
|
23811
23731
|
filterId;
|
|
@@ -23828,7 +23748,7 @@ class QdFilterCategoryComponent {
|
|
|
23828
23748
|
return this.testId;
|
|
23829
23749
|
}
|
|
23830
23750
|
ngOnInit() {
|
|
23831
|
-
this.
|
|
23751
|
+
this._filterService
|
|
23832
23752
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
23833
23753
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
23834
23754
|
.subscribe(category => {
|
|
@@ -23870,11 +23790,11 @@ class QdFilterCategoryComponent {
|
|
|
23870
23790
|
}
|
|
23871
23791
|
}
|
|
23872
23792
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23873
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: QdFilterCategoryComponent, isStandalone: false, selector: "qd-filter-category", inputs: { filterId: "filterId", isInstantFiltering: "isInstantFiltering", categoryIndex: "categoryIndex", lastCategory: "lastCategory", testId: ["data-test-id", "testId"] }, host: { properties: { "attr.data-category-index": "this.categoryIndexAttribute", "class": "this.categoryNumberClassName", "attr.data-test-id": "this.dataTestId" } }, viewQueries: [{ propertyName: "itemFreeTextCategory", predicate: i0.forwardRef(() => QdFilterItemFreeTextCategoryComponent), descendants: true }], ngImport: i0, template: "@if (isBoolean) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-boolean\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-boolean'\"\n >\n </qd-filter-category-boolean>\n</div>\n} @if (isDate) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date'\"\n ></qd-filter-category-date>\n</div>\n} @if (isDateTime) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date'\"\n [timePickerConfig]=\"timePickerConfig\"\n ></qd-filter-category-date>\n</div>\n} @if (isDateRange) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date-range\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date-range-'\"\n ></qd-filter-category-date-range>\n</div>\n} @if (isDateTimeRange) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date-range\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date-range-'\"\n [timePickerConfig]=\"timePickerConfig\"\n ></qd-filter-category-date-range>\n</div>\n} @if (isFreeText) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-free-text\n [filterId]=\"filterId\"\n [isInstantFiltering]=\"isInstantFiltering\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-item'\"\n ></qd-filter-category-free-text>\n</div>\n} @if (isSelect) {\n<qd-filter-category-select\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId\"\n></qd-filter-category-select>\n}\n", styles: [":host{position:relative}:host ::ng-deep .qd-filter__category-button{position:relative;display:flex;align-items:center;justify-content:center;padding:0 .75rem 0 2rem;border:.0625rem solid rgb(213,213,213);margin:0 .75rem .75rem 0;background-color:#fff;color:#757575;cursor:pointer;font-size:.875rem;font-weight:400}:host ::ng-deep .qd-filter__category-button-caption{position:relative;display:flex;max-width:40ch;line-height:2.125rem}:host ::ng-deep .qd-filter__category-button-caption span{overflow:inherit;text-overflow:inherit;white-space:nowrap}:host ::ng-deep .qd-filter__category-button--type-boolean{padding:0}:host ::ng-deep .qd-filter__category-button--type-date,:host ::ng-deep .qd-filter__category-button--type-dateRange,:host ::ng-deep .qd-filter__category-button--type-freeText{display:flex;flex-direction:row;align-items:center;padding-right:0;padding-left:0}:host ::ng-deep .qd-filter__category-button--type-date qd-chip,:host ::ng-deep .qd-filter__category-button--type-dateRange qd-chip,:host ::ng-deep .qd-filter__category-button--type-freeText qd-chip{height:1.5rem}@media(max-width:599.98px){:host ::ng-deep .qd-filter__category-button--type-dateRange{width:100%;height:auto;flex-wrap:wrap;align-items:flex-start;line-height:2.125rem}}:host ::ng-deep .qd-filter__category-button--open,:host ::ng-deep .qd-filter__category-button:hover,:host ::ng-deep .qd-filter__category-button:focus{border-color:#979797!important;color:#171717}:host ::ng-deep .qd-filter__category-button:focus{outline:none}:host ::ng-deep .qd-filter__category-button:focus-visible{box-shadow:inset 0 0 0
|
|
23793
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: QdFilterCategoryComponent, isStandalone: false, selector: "qd-filter-category", inputs: { filterId: "filterId", isInstantFiltering: "isInstantFiltering", categoryIndex: "categoryIndex", lastCategory: "lastCategory", testId: ["data-test-id", "testId"] }, host: { properties: { "attr.data-category-index": "this.categoryIndexAttribute", "class": "this.categoryNumberClassName", "attr.data-test-id": "this.dataTestId" } }, viewQueries: [{ propertyName: "itemFreeTextCategory", predicate: i0.forwardRef(() => QdFilterItemFreeTextCategoryComponent), descendants: true }], ngImport: i0, template: "@if (isBoolean) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-boolean\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-boolean'\"\n >\n </qd-filter-category-boolean>\n</div>\n} @if (isDate) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date'\"\n ></qd-filter-category-date>\n</div>\n} @if (isDateTime) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date'\"\n [timePickerConfig]=\"timePickerConfig\"\n ></qd-filter-category-date>\n</div>\n} @if (isDateRange) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date-range\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date-range-'\"\n ></qd-filter-category-date-range>\n</div>\n} @if (isDateTimeRange) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date-range\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date-range-'\"\n [timePickerConfig]=\"timePickerConfig\"\n ></qd-filter-category-date-range>\n</div>\n} @if (isFreeText) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-free-text\n [filterId]=\"filterId\"\n [isInstantFiltering]=\"isInstantFiltering\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-item'\"\n ></qd-filter-category-free-text>\n</div>\n} @if (isSelect) {\n<qd-filter-category-select\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId\"\n></qd-filter-category-select>\n}\n", styles: [":host{position:relative}:host ::ng-deep .qd-filter__category-button{position:relative;display:flex;align-items:center;justify-content:center;padding:0 .75rem 0 2rem;border:.0625rem solid rgb(213,213,213);margin:0 .75rem .75rem 0;background-color:#fff;color:#757575;cursor:pointer;font-size:.875rem;font-weight:400}:host ::ng-deep .qd-filter__category-button-caption{position:relative;display:flex;max-width:40ch;line-height:2.125rem}:host ::ng-deep .qd-filter__category-button-caption span{overflow:inherit;text-overflow:inherit;white-space:nowrap}:host ::ng-deep .qd-filter__category-button--type-boolean{padding:0}:host ::ng-deep .qd-filter__category-button--type-date,:host ::ng-deep .qd-filter__category-button--type-dateRange,:host ::ng-deep .qd-filter__category-button--type-freeText{display:flex;flex-direction:row;align-items:center;padding-right:0;padding-left:0}:host ::ng-deep .qd-filter__category-button--type-date qd-chip,:host ::ng-deep .qd-filter__category-button--type-dateRange qd-chip,:host ::ng-deep .qd-filter__category-button--type-freeText qd-chip{height:1.5rem}@media(max-width:599.98px){:host ::ng-deep .qd-filter__category-button--type-dateRange{width:100%;height:auto;flex-wrap:wrap;align-items:flex-start;line-height:2.125rem}}:host ::ng-deep .qd-filter__category-button--open,:host ::ng-deep .qd-filter__category-button:hover,:host ::ng-deep .qd-filter__category-button:focus{border-color:#979797!important;color:#171717}:host ::ng-deep .qd-filter__category-button:focus{outline:none}:host ::ng-deep .qd-filter__category-button:focus-visible{box-shadow:inset 0 0 0 2px #069}:host ::ng-deep .qd-filter__category-button .qd-filter__category-icon{position:absolute;left:0;display:inline-flex;padding:0 .4375rem 0 .3125rem;font-size:1.25rem;line-height:2.125rem;pointer-events:none}:host ::ng-deep .qd-filter__category-button .qd-chip{display:inline-flex;margin-left:.5rem}:host ::ng-deep .qd-filter__category-button .qd-chip ::ng-deep .qd-chip__label{overflow:hidden;max-width:10ch;text-overflow:ellipsis}:host ::ng-deep .qd-filter__category-button .qd-filter__item-date+.qd-chip ::ng-deep .qd-chip__label,:host ::ng-deep .qd-filter__category-button .qd-filter__item-date-range+.qd-chip ::ng-deep .qd-chip__label{max-width:20ch}:host ::ng-deep .qd-filter__category-button--open{z-index:20}:host ::ng-deep .qd-filter__category--last{margin-right:1rem}\n"], dependencies: [{ kind: "component", type: QdFilterCategoryBooleanComponent, selector: "qd-filter-category-boolean", inputs: ["filterId", "categoryIndex", "data-test-id"] }, { kind: "component", type: QdFilterItemDateCategoryComponent, selector: "qd-filter-category-date", inputs: ["filterId", "categoryIndex", "timePickerConfig", "data-test-id"] }, { kind: "component", type: QdFilterItemDateRangeCategoryComponent, selector: "qd-filter-category-date-range", inputs: ["filterId", "categoryIndex", "data-test-id", "timePickerConfig"] }, { kind: "component", type: QdFilterItemFreeTextCategoryComponent, selector: "qd-filter-category-free-text", inputs: ["filterId", "isInstantFiltering", "categoryIndex", "data-test-id"] }, { kind: "component", type: QdFilterItemSelectCategoryComponent, selector: "qd-filter-category-select", inputs: ["filterId", "categoryIndex", "data-test-id"] }] });
|
|
23874
23794
|
}
|
|
23875
23795
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterCategoryComponent, decorators: [{
|
|
23876
23796
|
type: Component,
|
|
23877
|
-
args: [{ selector: 'qd-filter-category', standalone: false, template: "@if (isBoolean) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-boolean\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-boolean'\"\n >\n </qd-filter-category-boolean>\n</div>\n} @if (isDate) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date'\"\n ></qd-filter-category-date>\n</div>\n} @if (isDateTime) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date'\"\n [timePickerConfig]=\"timePickerConfig\"\n ></qd-filter-category-date>\n</div>\n} @if (isDateRange) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date-range\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date-range-'\"\n ></qd-filter-category-date-range>\n</div>\n} @if (isDateTimeRange) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date-range\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date-range-'\"\n [timePickerConfig]=\"timePickerConfig\"\n ></qd-filter-category-date-range>\n</div>\n} @if (isFreeText) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-free-text\n [filterId]=\"filterId\"\n [isInstantFiltering]=\"isInstantFiltering\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-item'\"\n ></qd-filter-category-free-text>\n</div>\n} @if (isSelect) {\n<qd-filter-category-select\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId\"\n></qd-filter-category-select>\n}\n", styles: [":host{position:relative}:host ::ng-deep .qd-filter__category-button{position:relative;display:flex;align-items:center;justify-content:center;padding:0 .75rem 0 2rem;border:.0625rem solid rgb(213,213,213);margin:0 .75rem .75rem 0;background-color:#fff;color:#757575;cursor:pointer;font-size:.875rem;font-weight:400}:host ::ng-deep .qd-filter__category-button-caption{position:relative;display:flex;max-width:40ch;line-height:2.125rem}:host ::ng-deep .qd-filter__category-button-caption span{overflow:inherit;text-overflow:inherit;white-space:nowrap}:host ::ng-deep .qd-filter__category-button--type-boolean{padding:0}:host ::ng-deep .qd-filter__category-button--type-date,:host ::ng-deep .qd-filter__category-button--type-dateRange,:host ::ng-deep .qd-filter__category-button--type-freeText{display:flex;flex-direction:row;align-items:center;padding-right:0;padding-left:0}:host ::ng-deep .qd-filter__category-button--type-date qd-chip,:host ::ng-deep .qd-filter__category-button--type-dateRange qd-chip,:host ::ng-deep .qd-filter__category-button--type-freeText qd-chip{height:1.5rem}@media(max-width:599.98px){:host ::ng-deep .qd-filter__category-button--type-dateRange{width:100%;height:auto;flex-wrap:wrap;align-items:flex-start;line-height:2.125rem}}:host ::ng-deep .qd-filter__category-button--open,:host ::ng-deep .qd-filter__category-button:hover,:host ::ng-deep .qd-filter__category-button:focus{border-color:#979797!important;color:#171717}:host ::ng-deep .qd-filter__category-button:focus{outline:none}:host ::ng-deep .qd-filter__category-button:focus-visible{box-shadow:inset 0 0 0
|
|
23797
|
+
args: [{ selector: 'qd-filter-category', standalone: false, template: "@if (isBoolean) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-boolean\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-boolean'\"\n >\n </qd-filter-category-boolean>\n</div>\n} @if (isDate) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date'\"\n ></qd-filter-category-date>\n</div>\n} @if (isDateTime) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date'\"\n [timePickerConfig]=\"timePickerConfig\"\n ></qd-filter-category-date>\n</div>\n} @if (isDateRange) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date-range\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date-range-'\"\n ></qd-filter-category-date-range>\n</div>\n} @if (isDateTimeRange) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-date-range\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-date-range-'\"\n [timePickerConfig]=\"timePickerConfig\"\n ></qd-filter-category-date-range>\n</div>\n} @if (isFreeText) {\n<div [class]=\"buttonClassName\">\n <qd-filter-category-free-text\n [filterId]=\"filterId\"\n [isInstantFiltering]=\"isInstantFiltering\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId + '-item'\"\n ></qd-filter-category-free-text>\n</div>\n} @if (isSelect) {\n<qd-filter-category-select\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [data-test-id]=\"testId\"\n></qd-filter-category-select>\n}\n", styles: [":host{position:relative}:host ::ng-deep .qd-filter__category-button{position:relative;display:flex;align-items:center;justify-content:center;padding:0 .75rem 0 2rem;border:.0625rem solid rgb(213,213,213);margin:0 .75rem .75rem 0;background-color:#fff;color:#757575;cursor:pointer;font-size:.875rem;font-weight:400}:host ::ng-deep .qd-filter__category-button-caption{position:relative;display:flex;max-width:40ch;line-height:2.125rem}:host ::ng-deep .qd-filter__category-button-caption span{overflow:inherit;text-overflow:inherit;white-space:nowrap}:host ::ng-deep .qd-filter__category-button--type-boolean{padding:0}:host ::ng-deep .qd-filter__category-button--type-date,:host ::ng-deep .qd-filter__category-button--type-dateRange,:host ::ng-deep .qd-filter__category-button--type-freeText{display:flex;flex-direction:row;align-items:center;padding-right:0;padding-left:0}:host ::ng-deep .qd-filter__category-button--type-date qd-chip,:host ::ng-deep .qd-filter__category-button--type-dateRange qd-chip,:host ::ng-deep .qd-filter__category-button--type-freeText qd-chip{height:1.5rem}@media(max-width:599.98px){:host ::ng-deep .qd-filter__category-button--type-dateRange{width:100%;height:auto;flex-wrap:wrap;align-items:flex-start;line-height:2.125rem}}:host ::ng-deep .qd-filter__category-button--open,:host ::ng-deep .qd-filter__category-button:hover,:host ::ng-deep .qd-filter__category-button:focus{border-color:#979797!important;color:#171717}:host ::ng-deep .qd-filter__category-button:focus{outline:none}:host ::ng-deep .qd-filter__category-button:focus-visible{box-shadow:inset 0 0 0 2px #069}:host ::ng-deep .qd-filter__category-button .qd-filter__category-icon{position:absolute;left:0;display:inline-flex;padding:0 .4375rem 0 .3125rem;font-size:1.25rem;line-height:2.125rem;pointer-events:none}:host ::ng-deep .qd-filter__category-button .qd-chip{display:inline-flex;margin-left:.5rem}:host ::ng-deep .qd-filter__category-button .qd-chip ::ng-deep .qd-chip__label{overflow:hidden;max-width:10ch;text-overflow:ellipsis}:host ::ng-deep .qd-filter__category-button .qd-filter__item-date+.qd-chip ::ng-deep .qd-chip__label,:host ::ng-deep .qd-filter__category-button .qd-filter__item-date-range+.qd-chip ::ng-deep .qd-chip__label{max-width:20ch}:host ::ng-deep .qd-filter__category-button--open{z-index:20}:host ::ng-deep .qd-filter__category--last{margin-right:1rem}\n"] }]
|
|
23878
23798
|
}], propDecorators: { filterId: [{
|
|
23879
23799
|
type: Input
|
|
23880
23800
|
}], isInstantFiltering: [{
|
|
@@ -24285,7 +24205,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
24285
24205
|
type: Injectable
|
|
24286
24206
|
}] });
|
|
24287
24207
|
|
|
24288
|
-
// @ts-strict-ignore
|
|
24289
24208
|
/**
|
|
24290
24209
|
* **QdFilterComponent** lets users build and apply a filter with several categories over a data set.
|
|
24291
24210
|
*
|
|
@@ -24412,8 +24331,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
24412
24331
|
*/
|
|
24413
24332
|
class QdFilterComponent {
|
|
24414
24333
|
filterService = inject(QdFilterService);
|
|
24415
|
-
|
|
24416
|
-
|
|
24334
|
+
_filterRouterConnectorService = inject(QdFilterRouterConnectorService);
|
|
24335
|
+
_dependentFiltersService = inject(QdDependentFiltersService);
|
|
24417
24336
|
_destroyRef = inject(DestroyRef);
|
|
24418
24337
|
/**
|
|
24419
24338
|
* The configuration of the filter
|
|
@@ -24478,7 +24397,7 @@ class QdFilterComponent {
|
|
|
24478
24397
|
this.init();
|
|
24479
24398
|
}
|
|
24480
24399
|
waitForFilterData() {
|
|
24481
|
-
return firstValueFrom(this._filterDataSubject.pipe(filter(filterData => !!filterData)));
|
|
24400
|
+
return firstValueFrom(this._filterDataSubject.pipe(filter((filterData) => !!filterData)));
|
|
24482
24401
|
}
|
|
24483
24402
|
ngOnChanges(changes) {
|
|
24484
24403
|
// TODO: Decision: Is there really a need for this???
|
|
@@ -24564,7 +24483,7 @@ class QdFilterComponent {
|
|
|
24564
24483
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
24565
24484
|
.subscribe(postBody => this.postBodyOutput.emit(postBody));
|
|
24566
24485
|
this.hasPreselection = hasActiveCategory(this.filterData?.categories);
|
|
24567
|
-
merge(this.hasPreselectionAfterRouterConnection$.pipe(filter(hasPreselection => hasPreselection || this.filterData?.emitOutputsInitially)), this.allFiltersRemoved$)
|
|
24486
|
+
merge(this.hasPreselectionAfterRouterConnection$.pipe(filter(hasPreselection => hasPreselection || !!this.filterData?.emitOutputsInitially)), this.allFiltersRemoved$)
|
|
24568
24487
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
24569
24488
|
.subscribe(() => {
|
|
24570
24489
|
this.emitOutputs();
|
|
@@ -24579,10 +24498,10 @@ class QdFilterComponent {
|
|
|
24579
24498
|
this.initializeDependentFiltersService();
|
|
24580
24499
|
}
|
|
24581
24500
|
initializeDependentFiltersService() {
|
|
24582
|
-
this.
|
|
24501
|
+
this._dependentFiltersService.initialize(this);
|
|
24583
24502
|
this._filterDataSubject
|
|
24584
24503
|
.pipe(skip(1)) // skip current value, only reinitialize for changes
|
|
24585
|
-
.subscribe(() => this.
|
|
24504
|
+
.subscribe(() => this._dependentFiltersService.reinitialize());
|
|
24586
24505
|
}
|
|
24587
24506
|
initResetButtonActivation() {
|
|
24588
24507
|
this.disableResetButton$ = combineLatest([
|
|
@@ -24597,7 +24516,7 @@ class QdFilterComponent {
|
|
|
24597
24516
|
}
|
|
24598
24517
|
comparableItemsOf(categories) {
|
|
24599
24518
|
return categories
|
|
24600
|
-
.flatMap(category => category.items)
|
|
24519
|
+
.flatMap(category => category.items ?? [])
|
|
24601
24520
|
.filter(item => item.item)
|
|
24602
24521
|
.map(item => {
|
|
24603
24522
|
const comparableItem = { ...item };
|
|
@@ -24607,12 +24526,12 @@ class QdFilterComponent {
|
|
|
24607
24526
|
}
|
|
24608
24527
|
get preselectedItems() {
|
|
24609
24528
|
return this.filterData.categories
|
|
24610
|
-
.flatMap(category => category.items)
|
|
24529
|
+
.flatMap(category => category.items ?? [])
|
|
24611
24530
|
.map(item => ({ active: false, ...item }))
|
|
24612
24531
|
.filter(item => item.item);
|
|
24613
24532
|
}
|
|
24614
24533
|
get hasPreselectionAfterRouterConnection$() {
|
|
24615
|
-
return this.
|
|
24534
|
+
return this._filterRouterConnectorService.connectFilterWithRouter(this).pipe(tap$1(() => this._filterConnectedWithRouterSubject.next()), switchMap$1(() => this.filterService.selectHasActiveCategory$(this.filterId)), take(1));
|
|
24616
24535
|
}
|
|
24617
24536
|
isUnchangedSince(currentPostBody, applied) {
|
|
24618
24537
|
if (!applied)
|
|
@@ -24626,15 +24545,15 @@ class QdFilterComponent {
|
|
|
24626
24545
|
return this.filterService.selectHasActiveCategory$(this.filterId).pipe(skip(1), filter(someCategoryActive => !someCategoryActive));
|
|
24627
24546
|
}
|
|
24628
24547
|
hasChangesByKey(changes, key) {
|
|
24629
|
-
const _diff = diff(changes
|
|
24548
|
+
const _diff = diff(changes['filterData'].currentValue, changes['filterData'].previousValue);
|
|
24630
24549
|
if (!_diff || !_diff.categories)
|
|
24631
24550
|
return false;
|
|
24632
24551
|
return Object.values(_diff.categories)?.filter(category => category && category[key] !== undefined).length > 0;
|
|
24633
24552
|
}
|
|
24634
24553
|
hasChangesByCategoriesLength(changes) {
|
|
24635
|
-
if (changes
|
|
24554
|
+
if (changes['filterData'].previousValue === undefined)
|
|
24636
24555
|
return false;
|
|
24637
|
-
return changes
|
|
24556
|
+
return (changes['filterData'].currentValue.categories.length !== changes['filterData'].previousValue.categories.length);
|
|
24638
24557
|
}
|
|
24639
24558
|
reInitFromStoreIfReMounted() {
|
|
24640
24559
|
this.filterService
|
|
@@ -25150,7 +25069,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
25150
25069
|
args: [{ selector: 'qd-status-pairs-caption', template: '<ng-content></ng-content>', host: { class: 'qd-status-pairs__caption' }, standalone: false, styles: [":host{display:block;margin-bottom:.375rem;font-size:13px;font-weight:400;line-height:13px}\n"] }]
|
|
25151
25070
|
}] });
|
|
25152
25071
|
|
|
25153
|
-
// @ts-strict-ignore
|
|
25154
25072
|
/**
|
|
25155
25073
|
* The **QdStatusPairsError** can display an error message that can be placed at the bottom inside a **QdStatusPairs**. < br />
|
|
25156
25074
|
* The message is displayed when a single **QdStatusPairsItem** is set to "Error".
|
|
@@ -25166,11 +25084,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
25166
25084
|
* description: The list picks up the error with a ContentChild query and shows it under the failing pair.
|
|
25167
25085
|
*/
|
|
25168
25086
|
class QdStatusPairsErrorComponent {
|
|
25169
|
-
|
|
25170
|
-
|
|
25087
|
+
error = false;
|
|
25088
|
+
_ref = inject(ChangeDetectorRef);
|
|
25171
25089
|
showError(error) {
|
|
25172
25090
|
this.error = error;
|
|
25173
|
-
this.
|
|
25091
|
+
this._ref.detectChanges();
|
|
25174
25092
|
}
|
|
25175
25093
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdStatusPairsErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
25176
25094
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: QdStatusPairsErrorComponent, isStandalone: false, selector: "qd-status-pairs-error", host: { classAttribute: "qd-status-pairs__error" }, ngImport: i0, template: "@if (error) {\n<qd-icon class=\"qd-status-pairs__error-icon\" [icon]=\"'exclamationCircleSolid'\"></qd-icon>\n<span class=\"qd-status-pairs__error-text\"><ng-content></ng-content></span>\n}\n", styles: [".qd-status-pairs__error{display:flex;align-items:center;margin-bottom:1rem}.qd-status-pairs__error-icon{margin-right:.5rem;color:#c70023;line-height:16px}.qd-status-pairs__error-text{color:#171717;font-size:14px;font-weight:400;line-height:20px;color:#c70023;font-weight:500;line-height:16px}\n"], dependencies: [{ kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
@@ -25215,7 +25133,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
25215
25133
|
args: ['class.qd-status-pairs__item--error']
|
|
25216
25134
|
}] } });
|
|
25217
25135
|
|
|
25218
|
-
// @ts-strict-ignore
|
|
25219
25136
|
/**
|
|
25220
25137
|
* The **QdStatusPairs** renders key-value pairs. <br />
|
|
25221
25138
|
*
|
|
@@ -25762,6 +25679,204 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
25762
25679
|
}]
|
|
25763
25680
|
}] });
|
|
25764
25681
|
|
|
25682
|
+
/**
|
|
25683
|
+
* Converts a point in time of a `QdTimeSpan` to a timestamp in milliseconds.
|
|
25684
|
+
*
|
|
25685
|
+
* Returns `null` when the value is missing or cannot be parsed, e.g. `'21.10.2026 10:00'`.
|
|
25686
|
+
*/
|
|
25687
|
+
function qdToTimestamp(value) {
|
|
25688
|
+
if (value === undefined || value === null)
|
|
25689
|
+
return null;
|
|
25690
|
+
const timestamp = new Date(value).getTime();
|
|
25691
|
+
return Number.isNaN(timestamp) ? null : timestamp;
|
|
25692
|
+
}
|
|
25693
|
+
/**
|
|
25694
|
+
* Returns the duration of a `QdTimeSpan` in milliseconds.
|
|
25695
|
+
*
|
|
25696
|
+
* Returns `0` when the time span is missing, a point in time is invalid or `endsAt` is not after `startsAt`.
|
|
25697
|
+
*/
|
|
25698
|
+
function qdTimeSpanDuration(timeSpan) {
|
|
25699
|
+
const startsAt = qdToTimestamp(timeSpan?.startsAt);
|
|
25700
|
+
const endsAt = qdToTimestamp(timeSpan?.endsAt);
|
|
25701
|
+
if (startsAt === null || endsAt === null)
|
|
25702
|
+
return 0;
|
|
25703
|
+
return Math.max(0, endsAt - startsAt);
|
|
25704
|
+
}
|
|
25705
|
+
/**
|
|
25706
|
+
* Returns the time left until `endsAt` of a `QdTimeSpan` in milliseconds, at most the duration of the time span.
|
|
25707
|
+
*
|
|
25708
|
+
* Returns `0` when the time span has ended, is empty or is invalid.
|
|
25709
|
+
*/
|
|
25710
|
+
function qdTimeSpanRemaining(timeSpan) {
|
|
25711
|
+
const endsAt = qdToTimestamp(timeSpan?.endsAt) ?? 0;
|
|
25712
|
+
return Math.min(qdTimeSpanDuration(timeSpan), Math.max(0, endsAt - Date.now()));
|
|
25713
|
+
}
|
|
25714
|
+
/**
|
|
25715
|
+
* Formats a number of seconds as a duration in the given locale, e.g. `04:05` (`'digital'`) or `4 min, 5 s` (`'short'`).
|
|
25716
|
+
* Hours are only shown when there are hours left.
|
|
25717
|
+
*
|
|
25718
|
+
* Uses `Intl.DurationFormat`. Where the browser does not support it yet, a simple fallback formats the duration.
|
|
25719
|
+
*/
|
|
25720
|
+
function qdFormatDuration(totalSeconds, locale, format) {
|
|
25721
|
+
const wholeSeconds = Math.max(0, Math.floor(totalSeconds));
|
|
25722
|
+
const parts = {
|
|
25723
|
+
hours: Math.floor(wholeSeconds / 3600),
|
|
25724
|
+
minutes: Math.floor((wholeSeconds % 3600) / 60),
|
|
25725
|
+
seconds: wholeSeconds % 60
|
|
25726
|
+
};
|
|
25727
|
+
const DurationFormat = Intl.DurationFormat;
|
|
25728
|
+
if (DurationFormat) {
|
|
25729
|
+
const options = { style: format, hoursDisplay: 'auto' };
|
|
25730
|
+
const formatter = new DurationFormat(locale, wholeSeconds === 0 ? { ...options, secondsDisplay: 'always' } : options);
|
|
25731
|
+
return formatter.format(parts);
|
|
25732
|
+
}
|
|
25733
|
+
return format === 'digital' ? formatDigitalFallback(parts) : formatShortFallback(parts, locale);
|
|
25734
|
+
}
|
|
25735
|
+
function formatDigitalFallback({ hours, minutes, seconds }) {
|
|
25736
|
+
const paddedMinutes = minutes.toString().padStart(2, '0');
|
|
25737
|
+
const paddedSeconds = seconds.toString().padStart(2, '0');
|
|
25738
|
+
return hours === 0 ? `${paddedMinutes}:${paddedSeconds}` : `${hours}:${paddedMinutes}:${paddedSeconds}`;
|
|
25739
|
+
}
|
|
25740
|
+
function formatShortFallback(parts, locale) {
|
|
25741
|
+
const hasNoTimeLeft = parts.hours === 0 && parts.minutes === 0 && parts.seconds === 0;
|
|
25742
|
+
const units = ['hours', 'minutes', 'seconds'].filter(unit => parts[unit] > 0 || (unit === 'seconds' && hasNoTimeLeft));
|
|
25743
|
+
const formattedUnits = units.map(unit => new Intl.NumberFormat(locale, { style: 'unit', unit: unit.slice(0, -1), unitDisplay: 'short' }).format(parts[unit]));
|
|
25744
|
+
return new Intl.ListFormat(locale, { type: 'unit', style: 'short' }).format(formattedUnits);
|
|
25745
|
+
}
|
|
25746
|
+
|
|
25747
|
+
/**
|
|
25748
|
+
* **QdTimerProgressBar** displays a countdown to a point in time, e.g. the end of a reaction time.
|
|
25749
|
+
*
|
|
25750
|
+
* The countdown runs until `timeSpan.endsAt`. The remaining time is `endsAt` minus the current time of the client, so
|
|
25751
|
+
* reloading the page does not restart the countdown. A time span that has already ended shows an empty bar and emits
|
|
25752
|
+
* `countdownExpired` right away. Before `timeSpan.startsAt` the bar stays full.
|
|
25753
|
+
* The remaining time is derived from the clock on every tick, so it is correct again on the next tick after the
|
|
25754
|
+
* browser has throttled the page. In a background tab the browser can delay the ticks by up to a minute, so the display
|
|
25755
|
+
* and `countdownExpired` can be late there. The bar empties continuously and shows the remaining time inside the bar.
|
|
25756
|
+
*
|
|
25757
|
+
* The remaining time is formatted with `Intl.DurationFormat` in the language of the application, which the service
|
|
25758
|
+
* navigation sets. `format` chooses between a digital clock (`04:05`) and abbreviated units (`4 min, 5 s`).
|
|
25759
|
+
*
|
|
25760
|
+
* The ticks run outside the Angular zone and only update the timer progress bar itself, so a running countdown does
|
|
25761
|
+
* not trigger change detection for the whole application every second. `countdownExpired` is emitted inside the
|
|
25762
|
+
* Angular zone and always asynchronously, so a host can update its template in response.
|
|
25763
|
+
*
|
|
25764
|
+
* This component is internal to the framework and not part of the public API.
|
|
25765
|
+
*/
|
|
25766
|
+
class QdTimerProgressBarComponent {
|
|
25767
|
+
/**
|
|
25768
|
+
* The configuration of the timer progress bar, e.g. the `timeSpan` of the countdown.
|
|
25769
|
+
*/
|
|
25770
|
+
config;
|
|
25771
|
+
/**
|
|
25772
|
+
* A static test ID for integration tests can be set. <br />
|
|
25773
|
+
* The value for the HTML attribute [data-test-id].
|
|
25774
|
+
*/
|
|
25775
|
+
testId = 'timer-progress-bar';
|
|
25776
|
+
/**
|
|
25777
|
+
* Emits once when the countdown reaches 0.
|
|
25778
|
+
* Also emits once, right after the config is set, when the time span has already ended, is empty or is invalid.
|
|
25779
|
+
*/
|
|
25780
|
+
countdownExpired = new EventEmitter();
|
|
25781
|
+
get dataTestId() {
|
|
25782
|
+
return this.testId;
|
|
25783
|
+
}
|
|
25784
|
+
get hostClasses() {
|
|
25785
|
+
return `qd-timer-progress-bar-${this.state}`;
|
|
25786
|
+
}
|
|
25787
|
+
state = 'critical';
|
|
25788
|
+
remainingSeconds = 0;
|
|
25789
|
+
percentage = 0;
|
|
25790
|
+
formattedTime = '';
|
|
25791
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
25792
|
+
_destroyRef = inject(DestroyRef);
|
|
25793
|
+
_ngZone = inject(NgZone);
|
|
25794
|
+
_localeService = inject(QdLocaleService, { optional: true });
|
|
25795
|
+
_locale = navigator.language;
|
|
25796
|
+
_format = 'digital';
|
|
25797
|
+
_duration = 0;
|
|
25798
|
+
_remaining = 0;
|
|
25799
|
+
_countdown;
|
|
25800
|
+
ngOnInit() {
|
|
25801
|
+
this._localeService?.locale$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(locale => {
|
|
25802
|
+
this._locale = locale;
|
|
25803
|
+
this.formattedTime = qdFormatDuration(this.remainingSeconds, this._locale, this._format);
|
|
25804
|
+
this._changeDetectorRef.markForCheck();
|
|
25805
|
+
});
|
|
25806
|
+
}
|
|
25807
|
+
ngOnChanges(changes) {
|
|
25808
|
+
if (!changes['config'])
|
|
25809
|
+
return;
|
|
25810
|
+
this.state = this.config?.state ?? 'critical';
|
|
25811
|
+
this._format = this.config?.format ?? 'digital';
|
|
25812
|
+
this._duration = qdTimeSpanDuration(this.config?.timeSpan);
|
|
25813
|
+
this.updateData();
|
|
25814
|
+
this.startCountdown();
|
|
25815
|
+
}
|
|
25816
|
+
startCountdown() {
|
|
25817
|
+
this._countdown?.unsubscribe();
|
|
25818
|
+
if (this.remainingSeconds === 0) {
|
|
25819
|
+
this._countdown = timer(0)
|
|
25820
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
25821
|
+
.subscribe(() => this.countdownExpired.emit());
|
|
25822
|
+
return;
|
|
25823
|
+
}
|
|
25824
|
+
this._countdown = this._ngZone.runOutsideAngular(() => timer(this._remaining % 1000 || 1000, 1000)
|
|
25825
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
25826
|
+
.subscribe(() => this.tick()));
|
|
25827
|
+
}
|
|
25828
|
+
tick() {
|
|
25829
|
+
this.updateData();
|
|
25830
|
+
this._changeDetectorRef.detectChanges();
|
|
25831
|
+
if (this.remainingSeconds > 0)
|
|
25832
|
+
return;
|
|
25833
|
+
this._countdown?.unsubscribe();
|
|
25834
|
+
this._ngZone.run(() => this.countdownExpired.emit());
|
|
25835
|
+
}
|
|
25836
|
+
updateData() {
|
|
25837
|
+
this._remaining = qdTimeSpanRemaining(this.config?.timeSpan);
|
|
25838
|
+
this.remainingSeconds = Math.ceil(this._remaining / 1000);
|
|
25839
|
+
this.percentage = this._duration > 0 ? (this._remaining / this._duration) * 100 : 0;
|
|
25840
|
+
this.formattedTime = qdFormatDuration(this.remainingSeconds, this._locale, this._format);
|
|
25841
|
+
}
|
|
25842
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdTimerProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
25843
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: QdTimerProgressBarComponent, isStandalone: false, selector: "qd-timer-progress-bar", inputs: { config: "config", testId: ["data-test-id", "testId"] }, outputs: { countdownExpired: "countdownExpired" }, host: { properties: { "attr.data-test-id": "this.dataTestId", "class": "this.hostClasses" } }, usesOnChanges: true, ngImport: i0, template: "<span class=\"qd-timer-progress-bar-container\" role=\"timer\" [attr.aria-label]=\"formattedTime\">\n <span\n class=\"qd-timer-progress-bar-progress\"\n [style.width.%]=\"percentage\"\n [attr.data-test-id]=\"testId + '-progress'\"\n ></span>\n <span class=\"qd-timer-progress-bar-value\" [attr.data-test-id]=\"testId + '-value'\">{{ formattedTime }}</span>\n</span>\n", styles: [":host{display:block}:host .qd-timer-progress-bar-container{position:relative;display:flex;overflow:hidden;width:100%;min-width:7rem;height:1.625rem;box-sizing:border-box;align-items:center;justify-content:center;padding:0 .5rem;border-radius:.8125rem}:host .qd-timer-progress-bar-progress{position:absolute;top:0;bottom:0;left:0;transition:width 1s linear}:host .qd-timer-progress-bar-value{position:relative;font-size:.8125rem;font-weight:400;white-space:nowrap}:host(.qd-timer-progress-bar-neutral) .qd-timer-progress-bar-container{border:.0625rem solid rgb(117,117,117)}:host(.qd-timer-progress-bar-info) .qd-timer-progress-bar-container{background:#6ebee6;color:#fff}:host(.qd-timer-progress-bar-info) .qd-timer-progress-bar-progress{background:#069}:host(.qd-timer-progress-bar-positive) .qd-timer-progress-bar-container{background:#00813a80;color:#fff}:host(.qd-timer-progress-bar-positive) .qd-timer-progress-bar-progress{background:#00813a}:host(.qd-timer-progress-bar-critical) .qd-timer-progress-bar-container{background:#c7002380;color:#fff}:host(.qd-timer-progress-bar-critical) .qd-timer-progress-bar-progress{background:#c70023}:host(.qd-timer-progress-bar-neutral) .qd-timer-progress-bar-container{background:#fff;color:#171717}:host(.qd-timer-progress-bar-neutral) .qd-timer-progress-bar-progress{background:#e5e5e5}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
25844
|
+
}
|
|
25845
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdTimerProgressBarComponent, decorators: [{
|
|
25846
|
+
type: Component,
|
|
25847
|
+
args: [{ selector: 'qd-timer-progress-bar', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<span class=\"qd-timer-progress-bar-container\" role=\"timer\" [attr.aria-label]=\"formattedTime\">\n <span\n class=\"qd-timer-progress-bar-progress\"\n [style.width.%]=\"percentage\"\n [attr.data-test-id]=\"testId + '-progress'\"\n ></span>\n <span class=\"qd-timer-progress-bar-value\" [attr.data-test-id]=\"testId + '-value'\">{{ formattedTime }}</span>\n</span>\n", styles: [":host{display:block}:host .qd-timer-progress-bar-container{position:relative;display:flex;overflow:hidden;width:100%;min-width:7rem;height:1.625rem;box-sizing:border-box;align-items:center;justify-content:center;padding:0 .5rem;border-radius:.8125rem}:host .qd-timer-progress-bar-progress{position:absolute;top:0;bottom:0;left:0;transition:width 1s linear}:host .qd-timer-progress-bar-value{position:relative;font-size:.8125rem;font-weight:400;white-space:nowrap}:host(.qd-timer-progress-bar-neutral) .qd-timer-progress-bar-container{border:.0625rem solid rgb(117,117,117)}:host(.qd-timer-progress-bar-info) .qd-timer-progress-bar-container{background:#6ebee6;color:#fff}:host(.qd-timer-progress-bar-info) .qd-timer-progress-bar-progress{background:#069}:host(.qd-timer-progress-bar-positive) .qd-timer-progress-bar-container{background:#00813a80;color:#fff}:host(.qd-timer-progress-bar-positive) .qd-timer-progress-bar-progress{background:#00813a}:host(.qd-timer-progress-bar-critical) .qd-timer-progress-bar-container{background:#c7002380;color:#fff}:host(.qd-timer-progress-bar-critical) .qd-timer-progress-bar-progress{background:#c70023}:host(.qd-timer-progress-bar-neutral) .qd-timer-progress-bar-container{background:#fff;color:#171717}:host(.qd-timer-progress-bar-neutral) .qd-timer-progress-bar-progress{background:#e5e5e5}\n"] }]
|
|
25848
|
+
}], propDecorators: { config: [{
|
|
25849
|
+
type: Input
|
|
25850
|
+
}], testId: [{
|
|
25851
|
+
type: Input,
|
|
25852
|
+
args: ['data-test-id']
|
|
25853
|
+
}], countdownExpired: [{
|
|
25854
|
+
type: Output
|
|
25855
|
+
}], dataTestId: [{
|
|
25856
|
+
type: HostBinding,
|
|
25857
|
+
args: ['attr.data-test-id']
|
|
25858
|
+
}], hostClasses: [{
|
|
25859
|
+
type: HostBinding,
|
|
25860
|
+
args: ['class']
|
|
25861
|
+
}] } });
|
|
25862
|
+
|
|
25863
|
+
/**
|
|
25864
|
+
* Internal module of the timer progress bar. It is deliberately not part of the public API.
|
|
25865
|
+
* Consumers use the timer through a configuration, e.g. the page object header facet of type `timer`.
|
|
25866
|
+
*/
|
|
25867
|
+
class QdTimerProgressBarModule {
|
|
25868
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdTimerProgressBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
25869
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: QdTimerProgressBarModule, declarations: [QdTimerProgressBarComponent], exports: [QdTimerProgressBarComponent] });
|
|
25870
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdTimerProgressBarModule });
|
|
25871
|
+
}
|
|
25872
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdTimerProgressBarModule, decorators: [{
|
|
25873
|
+
type: NgModule,
|
|
25874
|
+
args: [{
|
|
25875
|
+
declarations: [QdTimerProgressBarComponent],
|
|
25876
|
+
exports: [QdTimerProgressBarComponent]
|
|
25877
|
+
}]
|
|
25878
|
+
}] });
|
|
25879
|
+
|
|
25765
25880
|
const updateStateWithNewSearch = (state, searchId, newSearch) => ({
|
|
25766
25881
|
...state,
|
|
25767
25882
|
[searchId]: newSearch
|
|
@@ -32407,11 +32522,11 @@ class QdReferencesFacetComponent {
|
|
|
32407
32522
|
return this.data[this.facet.name];
|
|
32408
32523
|
}
|
|
32409
32524
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdReferencesFacetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32410
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: QdReferencesFacetComponent, isStandalone: false, selector: "qd-references-facet", inputs: { facet: "facet", data: "data" }, ngImport: i0, template: "<ul>\n @for (reference of references; track reference) {\n <li>\n <a [href]=\"reference.url\" type=\"button\" (click)=\"$event.stopPropagation()\">\n <qd-icon icon=\"link\"></qd-icon>\n {{ reference.label }}\n </a>\n </li>\n }\n</ul>\n", styles: [":host ul{padding:0;margin:0;list-style:none}:host li{margin-bottom:.5rem;font-size:.875rem;line-height:.875rem}:host li:last-child{margin-bottom:0}:host a{border-bottom:.0625rem solid transparent;color:#069;
|
|
32525
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: QdReferencesFacetComponent, isStandalone: false, selector: "qd-references-facet", inputs: { facet: "facet", data: "data" }, ngImport: i0, template: "<ul>\n @for (reference of references; track reference) {\n <li>\n <a [href]=\"reference.url\" type=\"button\" (click)=\"$event.stopPropagation()\">\n <qd-icon icon=\"link\"></qd-icon>\n {{ reference.label }}\n </a>\n </li>\n }\n</ul>\n", styles: [":host ul{padding:0;margin:0;list-style:none}:host li{margin-bottom:.5rem;font-size:.875rem;line-height:.875rem}:host li:last-child{margin-bottom:0}:host a{border-bottom:.0625rem solid transparent;color:#069;text-decoration:none}:host a:visited{color:#069}:host a:hover{border-bottom-color:#14516f;color:#14516f}:host a:focus-visible{outline:2px solid rgb(0,102,153);outline-offset:2px}\n"], dependencies: [{ kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }] });
|
|
32411
32526
|
}
|
|
32412
32527
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdReferencesFacetComponent, decorators: [{
|
|
32413
32528
|
type: Component,
|
|
32414
|
-
args: [{ selector: 'qd-references-facet', standalone: false, template: "<ul>\n @for (reference of references; track reference) {\n <li>\n <a [href]=\"reference.url\" type=\"button\" (click)=\"$event.stopPropagation()\">\n <qd-icon icon=\"link\"></qd-icon>\n {{ reference.label }}\n </a>\n </li>\n }\n</ul>\n", styles: [":host ul{padding:0;margin:0;list-style:none}:host li{margin-bottom:.5rem;font-size:.875rem;line-height:.875rem}:host li:last-child{margin-bottom:0}:host a{border-bottom:.0625rem solid transparent;color:#069;
|
|
32529
|
+
args: [{ selector: 'qd-references-facet', standalone: false, template: "<ul>\n @for (reference of references; track reference) {\n <li>\n <a [href]=\"reference.url\" type=\"button\" (click)=\"$event.stopPropagation()\">\n <qd-icon icon=\"link\"></qd-icon>\n {{ reference.label }}\n </a>\n </li>\n }\n</ul>\n", styles: [":host ul{padding:0;margin:0;list-style:none}:host li{margin-bottom:.5rem;font-size:.875rem;line-height:.875rem}:host li:last-child{margin-bottom:0}:host a{border-bottom:.0625rem solid transparent;color:#069;text-decoration:none}:host a:visited{color:#069}:host a:hover{border-bottom-color:#14516f;color:#14516f}:host a:focus-visible{outline:2px solid rgb(0,102,153);outline-offset:2px}\n"] }]
|
|
32415
32530
|
}], propDecorators: { facet: [{
|
|
32416
32531
|
type: Input
|
|
32417
32532
|
}], data: [{
|
|
@@ -32474,6 +32589,92 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
32474
32589
|
type: Input
|
|
32475
32590
|
}] } });
|
|
32476
32591
|
|
|
32592
|
+
/**
|
|
32593
|
+
* **QdTimerFacet** shows the time span of a page object in the page object header.
|
|
32594
|
+
*
|
|
32595
|
+
* The facet value is a `QdTimeSpan` or `null`:
|
|
32596
|
+
* - `endsAt` after `startsAt` and in the future: a timer progress bar counts down to `endsAt`.
|
|
32597
|
+
* A page reload does not restart the countdown.
|
|
32598
|
+
* - Countdown expired: `startsAt` is shown as date and time in the language of the application, also when the page is
|
|
32599
|
+
* opened after the end.
|
|
32600
|
+
* - `endsAt` not after `startsAt` or not parsable: `startsAt` is shown as date.
|
|
32601
|
+
* - `null` or a `startsAt` that cannot be parsed: nothing is shown.
|
|
32602
|
+
*
|
|
32603
|
+
* `state` and `format` from the facet options are passed to the timer progress bar.
|
|
32604
|
+
*
|
|
32605
|
+
* The timer config is only rebuilt when the time span or the facet changes.
|
|
32606
|
+
*/
|
|
32607
|
+
class QdTimerFacetComponent {
|
|
32608
|
+
set facet(facet) {
|
|
32609
|
+
this._facet = facet;
|
|
32610
|
+
this.updateData(true);
|
|
32611
|
+
}
|
|
32612
|
+
get facet() {
|
|
32613
|
+
return this._facet;
|
|
32614
|
+
}
|
|
32615
|
+
set data(data) {
|
|
32616
|
+
this._data = data;
|
|
32617
|
+
this.updateData();
|
|
32618
|
+
}
|
|
32619
|
+
get data() {
|
|
32620
|
+
return this._data;
|
|
32621
|
+
}
|
|
32622
|
+
testId;
|
|
32623
|
+
config = null;
|
|
32624
|
+
startsAt = null;
|
|
32625
|
+
endsAt = null;
|
|
32626
|
+
hasDuration = false;
|
|
32627
|
+
formattedStartsAt = '';
|
|
32628
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
32629
|
+
_destroyRef = inject(DestroyRef);
|
|
32630
|
+
_localeService = inject(QdLocaleService);
|
|
32631
|
+
_facet;
|
|
32632
|
+
_data;
|
|
32633
|
+
_locale = navigator.language;
|
|
32634
|
+
ngOnInit() {
|
|
32635
|
+
this._localeService.locale$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(locale => {
|
|
32636
|
+
this._locale = locale;
|
|
32637
|
+
this.updateFormattedStartsAt();
|
|
32638
|
+
this._changeDetectorRef.markForCheck();
|
|
32639
|
+
});
|
|
32640
|
+
}
|
|
32641
|
+
handleCountdownExpired() {
|
|
32642
|
+
this.config = null;
|
|
32643
|
+
}
|
|
32644
|
+
updateData(facetChanged = false) {
|
|
32645
|
+
if (!this._facet || !this._data)
|
|
32646
|
+
return;
|
|
32647
|
+
const timeSpan = this._data[this._facet.name];
|
|
32648
|
+
const startsAt = qdToTimestamp(timeSpan?.startsAt);
|
|
32649
|
+
const endsAt = qdToTimestamp(timeSpan?.endsAt);
|
|
32650
|
+
if (!facetChanged && startsAt === this.startsAt && endsAt === this.endsAt)
|
|
32651
|
+
return;
|
|
32652
|
+
const { state, format } = this._facet.options;
|
|
32653
|
+
this.startsAt = startsAt;
|
|
32654
|
+
this.endsAt = endsAt;
|
|
32655
|
+
this.hasDuration = qdTimeSpanDuration(timeSpan) > 0;
|
|
32656
|
+
this.updateFormattedStartsAt();
|
|
32657
|
+
this.config = qdTimeSpanRemaining(timeSpan) > 0 ? { timeSpan: timeSpan, state, format } : null;
|
|
32658
|
+
}
|
|
32659
|
+
updateFormattedStartsAt() {
|
|
32660
|
+
if (this.startsAt === null)
|
|
32661
|
+
return;
|
|
32662
|
+
this.formattedStartsAt = new Intl.DateTimeFormat(this._locale, { dateStyle: 'medium', timeStyle: 'short' }).format(this.startsAt);
|
|
32663
|
+
}
|
|
32664
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdTimerFacetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32665
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: QdTimerFacetComponent, isStandalone: false, selector: "qd-timer-facet", inputs: { facet: "facet", data: "data", testId: "testId" }, ngImport: i0, template: "@if (config) {\n<qd-timer-progress-bar\n [config]=\"config\"\n [data-test-id]=\"testId + '-timer'\"\n (countdownExpired)=\"handleCountdownExpired()\"\n></qd-timer-progress-bar>\n} @else if (hasDuration) {\n<span class=\"timer-facet-date\" [attr.data-test-id]=\"testId + '-date'\">{{ formattedStartsAt }}</span>\n} @else if (startsAt !== null) {\n<span class=\"timer-facet-date\" [attr.data-test-id]=\"testId + '-date'\">{{ startsAt | date }}</span>\n}\n", styles: [":host{display:block}:host .timer-facet-date{font-weight:500}:host qd-timer-progress-bar{width:fit-content}\n"], dependencies: [{ kind: "component", type: QdTimerProgressBarComponent, selector: "qd-timer-progress-bar", inputs: ["config", "data-test-id"], outputs: ["countdownExpired"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
32666
|
+
}
|
|
32667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdTimerFacetComponent, decorators: [{
|
|
32668
|
+
type: Component,
|
|
32669
|
+
args: [{ selector: 'qd-timer-facet', standalone: false, template: "@if (config) {\n<qd-timer-progress-bar\n [config]=\"config\"\n [data-test-id]=\"testId + '-timer'\"\n (countdownExpired)=\"handleCountdownExpired()\"\n></qd-timer-progress-bar>\n} @else if (hasDuration) {\n<span class=\"timer-facet-date\" [attr.data-test-id]=\"testId + '-date'\">{{ formattedStartsAt }}</span>\n} @else if (startsAt !== null) {\n<span class=\"timer-facet-date\" [attr.data-test-id]=\"testId + '-date'\">{{ startsAt | date }}</span>\n}\n", styles: [":host{display:block}:host .timer-facet-date{font-weight:500}:host qd-timer-progress-bar{width:fit-content}\n"] }]
|
|
32670
|
+
}], propDecorators: { facet: [{
|
|
32671
|
+
type: Input
|
|
32672
|
+
}], data: [{
|
|
32673
|
+
type: Input
|
|
32674
|
+
}], testId: [{
|
|
32675
|
+
type: Input
|
|
32676
|
+
}] } });
|
|
32677
|
+
|
|
32477
32678
|
class QdValueFacetComponent {
|
|
32478
32679
|
facet;
|
|
32479
32680
|
data;
|
|
@@ -32502,6 +32703,7 @@ class QdDynamicFacetsService {
|
|
|
32502
32703
|
['references', QdReferencesFacetComponent],
|
|
32503
32704
|
['singleSelect', QdSingleSelectFacetComponent],
|
|
32504
32705
|
['status', QdStatusFacetComponent],
|
|
32706
|
+
['timer', QdTimerFacetComponent],
|
|
32505
32707
|
['value', QdValueFacetComponent]
|
|
32506
32708
|
]);
|
|
32507
32709
|
static getInstance() {
|
|
@@ -35705,6 +35907,7 @@ class QdPageModule {
|
|
|
35705
35907
|
QdDynamicFacetDirective,
|
|
35706
35908
|
QdCriticalityFacetComponent,
|
|
35707
35909
|
QdProgressFacetComponent,
|
|
35910
|
+
QdTimerFacetComponent,
|
|
35708
35911
|
QdReferencesFacetComponent,
|
|
35709
35912
|
QdConnectFormStateToPageDirective,
|
|
35710
35913
|
QdPageFooterCustomContentDirective,
|
|
@@ -35725,6 +35928,7 @@ class QdPageModule {
|
|
|
35725
35928
|
QdSpinnerModule,
|
|
35726
35929
|
QdStatusIndicatorModule,
|
|
35727
35930
|
QdTableModule,
|
|
35931
|
+
QdTimerProgressBarModule,
|
|
35728
35932
|
QdTextSectionModule,
|
|
35729
35933
|
QdSearchModule,
|
|
35730
35934
|
QdPopoverModule,
|
|
@@ -35757,6 +35961,7 @@ class QdPageModule {
|
|
|
35757
35961
|
QdSpinnerModule,
|
|
35758
35962
|
QdStatusIndicatorModule,
|
|
35759
35963
|
QdTableModule,
|
|
35964
|
+
QdTimerProgressBarModule,
|
|
35760
35965
|
QdTextSectionModule,
|
|
35761
35966
|
QdSearchModule,
|
|
35762
35967
|
QdPopoverModule,
|
|
@@ -35780,6 +35985,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
35780
35985
|
QdSpinnerModule,
|
|
35781
35986
|
QdStatusIndicatorModule,
|
|
35782
35987
|
QdTableModule,
|
|
35988
|
+
QdTimerProgressBarModule,
|
|
35783
35989
|
QdTextSectionModule,
|
|
35784
35990
|
QdSearchModule,
|
|
35785
35991
|
QdPopoverModule,
|
|
@@ -35801,6 +36007,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
35801
36007
|
QdDynamicFacetDirective,
|
|
35802
36008
|
QdCriticalityFacetComponent,
|
|
35803
36009
|
QdProgressFacetComponent,
|
|
36010
|
+
QdTimerFacetComponent,
|
|
35804
36011
|
QdReferencesFacetComponent,
|
|
35805
36012
|
QdConnectFormStateToPageDirective,
|
|
35806
36013
|
QdPageFooterCustomContentDirective,
|
|
@@ -36186,7 +36393,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
36186
36393
|
args: [{ selector: 'qd-shell-header-search', standalone: false, template: "<qd-search [configData]=\"config\"> </qd-search>\n", styles: [":host{display:none}:host:not(:last-child){margin-right:1rem}:host ::ng-deep .qd-input-input{border-color:#fff0!important;background:#efefef!important}:host ::ng-deep input{background:#fff0!important}:host ::ng-deep input::placeholder{color:#979797!important}:host ::ng-deep input:hover::placeholder,:host ::ng-deep input:focus::placeholder{color:#171717!important}@media(min-width:1280px){:host{display:block}}\n"] }]
|
|
36187
36394
|
}] });
|
|
36188
36395
|
|
|
36189
|
-
// @ts-strict-ignore
|
|
36190
36396
|
const loadJavascriptAsset = (path, scriptElementAttributes = {}) => {
|
|
36191
36397
|
const scriptElement = document.createElement('script');
|
|
36192
36398
|
scriptElement.setAttribute('src', path);
|
|
@@ -38829,11 +39035,11 @@ class QdQuickEditComponent {
|
|
|
38829
39035
|
this.controlContainer.control.valueChanges.pipe(takeUntilDestroyed(this._destroyRef), tap(() => this.changeDetectorRef.detectChanges())).subscribe();
|
|
38830
39036
|
}
|
|
38831
39037
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdQuickEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
38832
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: QdQuickEditComponent, isStandalone: false, selector: "qd-quick-edit", inputs: { config: "config", data: "data", testId: ["data-test-id", "testId"] }, outputs: { formGroupChange: "formGroupChange", addNewClicked: "addNewClicked", fieldBlurred: "fieldBlurred" }, viewQueries: [{ propertyName: "customForDirective", first: true, predicate: QdCustomForDirective, descendants: true }, { propertyName: "focusables", predicate: QdFocusableDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (showStandaloneCreate) {\n<div class=\"editable-actions\">\n <button\n type=\"button\"\n qdButton\n qdButtonGhost\n icon=\"plus\"\n (click)=\"createRow()\"\n [data-test-id]=\"testId + '-button-add-new'\"\n >\n {{ config.standaloneCreateLabel?.i18n ?? \"i18n.qd.quick.edit.createButtonLabel\" | translate }}\n </button>\n</div>\n}\n\n<div class=\"table\" [formGroup]=\"control\">\n @if (!config.canAdd || templateData.length > 0 || config.emptyStateView) {\n <div class=\"table-header\">\n <div class=\"table-row\">\n @for (header of visibleColumns; track header) {\n <div class=\"table-cell\">\n {{ header?.i18n | translate }}\n <qd-tooltip-icon [tooltip]=\"header?.tooltip\"></qd-tooltip-icon>\n </div>\n } @if (hasVisibleActions$ | async) {\n <div class=\"table-cell actions-column\">\n <button type=\"button\" class=\"menu-button\">\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"table-body\">\n <div\n class=\"table-row\"\n *qdCustomFor=\"let row of templateData; let rowIndex = index; toggler: togglerDrawing\"\n [formGroupName]=\"rowIndex\"\n [attr.data-test-id]=\"testId + '-row-' + rowIndex\"\n >\n @for (column of visibleColumns; track trackByColumnName($index, column)) {\n <div class=\"table-cell\">\n @if (column.type === 'enum') {\n <qd-dropdown\n [config]=\"{\n filter: column.filter,\n options: column.options,\n placeholder: column.placeholder,\n placeholderPrefix: column.placeholderPrefix,\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n [data-test-id]=\"column.name + rowIndex\"\n [dense]=\"true\"\n [formControl]=\"$any(control.controls[rowIndex])?.controls[column.name]\"\n (blurred)=\"handleCellBlur(rowIndex, column)\"\n qdFocusable\n class=\"dropdown\"\n >\n </qd-dropdown>\n } @else { @if ($any(control.controls[rowIndex])?.controls[column.name]) {\n <qd-input\n [data-test-id]=\"column.name + rowIndex\"\n [formControlName]=\"column.name\"\n [config]=\"{\n inputType: column.type === 'integer' ? 'number' : 'text',\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n (blurred)=\"handleCellBlur(rowIndex, column)\"\n qdFocusable\n ></qd-input>\n } }\n </div>\n } @if (hasVisibleActions$ | async) {\n <td class=\"table-cell actions\" [attr.data-test-id]=\"testId + '-cell-inline-actions'\">\n <button\n type=\"button\"\n #rowMenuToggler=\"qdPopoverOnClick\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n (keydown.enter)=\"markRowMenuOpeningByKeyboard(rowIndex)\"\n (keydown.space)=\"markRowMenuOpeningByKeyboard(rowIndex)\"\n (opened)=\"openRowMenu(rowIndex)\"\n (closed)=\"closeRowMenu()\"\n [attr.aria-label]=\"'i18n.qd.quick.edit.a11y.moreActions' | translate\"\n aria-haspopup=\"menu\"\n [attr.aria-expanded]=\"openRowMenuIndex === rowIndex\"\n [attr.aria-controls]=\"openRowMenuIndex === rowIndex ? rowMenuId(rowIndex) : null\"\n class=\"menu-button\"\n data-test=\"secondary-actions-toggler\"\n >\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n <ng-template #menu>\n <div\n role=\"menu\"\n [id]=\"rowMenuId(rowIndex)\"\n [attr.aria-label]=\"'i18n.qd.quick.edit.a11y.moreActions' | translate\"\n (keydown)=\"handleRowMenuKeydown($event, rowMenuToggler)\"\n >\n @for (secondaryAction of actions$ | async; track secondaryAction) {\n <button\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"secondary-actions\"\n [ngClass]=\"{ disabled: isActionDisabled(secondaryAction, row) }\"\n [attr.disabled]=\"isActionDisabled(secondaryAction, row) || null\"\n (click)=\"handleSecondaryAction(secondaryAction, rowIndex)\"\n >\n {{ secondaryAction.label.i18n | translate }}\n </button>\n } @if (canAdd && (viewonly$ | async) === false) {\n <button\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"secondary-actions\"\n [attr.data-test-id]=\"testId + '-row-' + rowIndex + '-menu-remove'\"\n (click)=\"removeRow(rowIndex)\"\n >\n {{ \"i18n.qd.quick.edit.removeButtonLabel\" | translate }}\n </button>\n }\n </div>\n </ng-template>\n </td>\n }\n </div>\n </div>\n @if (config.emptyStateView && !config.emptyStateView.disabled && templateData.length === 0) {\n <div class=\"empty-body\">\n <p>{{ config.emptyStateView.i18n | translate }}</p>\n </div>\n }\n</div>\n", styles: [".table{display:flex;width:100%;flex-direction:column;margin:1.25rem auto;background-color:#fff;font-size:.875rem}.table ::ng-deep .qd-input-input{margin-bottom:0!important}.table-header .table-row{padding-top:.125rem;padding-bottom:.125rem;background-color:#e5e5e5;font-weight:700}.table-header .table-row .actions-column{visibility:hidden}.table-header,.table-body{display:flex;flex-direction:column}.table-row{display:flex;flex-direction:row;padding:.25rem 1rem;border-bottom:.0625rem solid rgb(213,213,213);gap:1rem}.table-row ::ng-deep qd-form-label{display:none!important}.table-row ::ng-deep qd-input{min-width:0;margin-bottom:0!important}.table-body .table-row:hover{background-color:#f5f5f5}.table-cell{display:flex;min-width:0;height:2.3125rem;flex:1;align-items:center;text-align:left}.table-cell:has(.qd-input-error),.table-cell:has(.qd-dropdown-error){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input{position:relative}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input .qd-input-character-counter{position:absolute;right:.25rem;bottom:.125rem;font-size:.625rem;line-height:1;pointer-events:none}.table-cell.actions,.table-cell.actions-column{min-width:auto;flex:0 0 auto}.table-row:last-child{border-bottom:none}.editable-actions{display:flex;justify-content:flex-end;margin-right:.625rem;gap:.625rem}.menu-button{display:flex;padding:0 .625rem 0 .375rem;background:unset;color:#454545;font-size:2rem;vertical-align:middle}.menu-button:hover,.menu-button:focus{color:#000;outline:0!important}.secondary-actions{display:block;width:100%;min-height:2rem;padding:0 1rem;background:#fff0;font-size:.75rem;text-align:left}.secondary-actions:hover,.secondary-actions:focus-visible{background-color:#f2f7fa}.secondary-actions.disabled{color:#b4b4b4;cursor:not-allowed}.secondary-actions.disabled:hover{background-color:#fff0}.dropdown{width:100%;min-width:0}.empty-body{padding:1.5rem;background:#fff}.empty-body p{margin:0 0 .5rem}\n"], dependencies: [{ kind: "component", type: QdButtonComponent, selector: "button[qdButton], a[qdButton]", inputs: ["disabled", "color", "icon", "data-test-id", "additionalInfo"] }, { kind: "directive", type: QdButtonGhostDirective, selector: "button[qdButtonGhost], a[qdButtonGhost]" }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: QdDropdownComponent, selector: "qd-dropdown", inputs: ["value", "id", "formControlName", "config", "data-test-id", "qdPopoverMaxHeight", "dense"], outputs: ["valueChange", "enterClick", "dropdownOpened", "blurred", "clickHint", "clickReadonly", "clickViewonly", "optionsResolved"] }, { kind: "component", type: QdInputComponent, selector: "qd-input", inputs: ["formControlName", "value", "config", "isError", "data-test-id"], outputs: ["valueChange", "enterClick", "clickClear", "clickHint", "clickReadonly", "clickViewonly", "blurred", "optionsResolved"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "qdPopoverPlacement", "qdPopoverOffsetX", "qdPopoverOffsetY", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl", "qdPopoverRestoreFocus", "qdPopoverFlipIntoViewport"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "directive", type: QdFocusableDirective, selector: "[qdFocusable]" }, { kind: "component", type: QdTooltipIconComponent, selector: "qd-tooltip-icon", inputs: ["tooltip"] }, { kind: "directive", type: QdCustomForDirective, selector: "[qdCustomFor]", inputs: ["qdCustomForOf", "qdCustomForToggler"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
39038
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: QdQuickEditComponent, isStandalone: false, selector: "qd-quick-edit", inputs: { config: "config", data: "data", testId: ["data-test-id", "testId"] }, outputs: { formGroupChange: "formGroupChange", addNewClicked: "addNewClicked", fieldBlurred: "fieldBlurred" }, viewQueries: [{ propertyName: "customForDirective", first: true, predicate: QdCustomForDirective, descendants: true }, { propertyName: "focusables", predicate: QdFocusableDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (showStandaloneCreate) {\n<div class=\"editable-actions\">\n <button\n type=\"button\"\n qdButton\n qdButtonGhost\n icon=\"plus\"\n (click)=\"createRow()\"\n [data-test-id]=\"testId + '-button-add-new'\"\n >\n {{ config.standaloneCreateLabel?.i18n ?? \"i18n.qd.quick.edit.createButtonLabel\" | translate }}\n </button>\n</div>\n}\n\n<div class=\"table\" [formGroup]=\"control\">\n @if (!config.canAdd || templateData.length > 0 || config.emptyStateView) {\n <div class=\"table-header\">\n <div class=\"table-row\">\n @for (header of visibleColumns; track header) {\n <div class=\"table-cell\">\n {{ header?.i18n | translate }}\n <qd-tooltip-icon [tooltip]=\"header?.tooltip\"></qd-tooltip-icon>\n </div>\n } @if (hasVisibleActions$ | async) {\n <div class=\"table-cell actions-column\">\n <button type=\"button\" class=\"menu-button\">\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"table-body\">\n <div\n class=\"table-row\"\n *qdCustomFor=\"let row of templateData; let rowIndex = index; toggler: togglerDrawing\"\n [formGroupName]=\"rowIndex\"\n [attr.data-test-id]=\"testId + '-row-' + rowIndex\"\n >\n @for (column of visibleColumns; track trackByColumnName($index, column)) {\n <div class=\"table-cell\">\n @if (column.type === 'enum') {\n <qd-dropdown\n [config]=\"{\n filter: column.filter,\n options: column.options,\n placeholder: column.placeholder,\n placeholderPrefix: column.placeholderPrefix,\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n [data-test-id]=\"column.name + rowIndex\"\n [dense]=\"true\"\n [formControl]=\"$any(control.controls[rowIndex])?.controls[column.name]\"\n (blurred)=\"handleCellBlur(rowIndex, column)\"\n qdFocusable\n class=\"dropdown\"\n >\n </qd-dropdown>\n } @else { @if ($any(control.controls[rowIndex])?.controls[column.name]) {\n <qd-input\n [data-test-id]=\"column.name + rowIndex\"\n [formControlName]=\"column.name\"\n [config]=\"{\n inputType: column.type === 'integer' ? 'number' : 'text',\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n (blurred)=\"handleCellBlur(rowIndex, column)\"\n qdFocusable\n ></qd-input>\n } }\n </div>\n } @if (hasVisibleActions$ | async) {\n <td class=\"table-cell actions\" [attr.data-test-id]=\"testId + '-cell-inline-actions'\">\n <button\n type=\"button\"\n #rowMenuToggler=\"qdPopoverOnClick\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n (keydown.enter)=\"markRowMenuOpeningByKeyboard(rowIndex)\"\n (keydown.space)=\"markRowMenuOpeningByKeyboard(rowIndex)\"\n (opened)=\"openRowMenu(rowIndex)\"\n (closed)=\"closeRowMenu()\"\n [attr.aria-label]=\"'i18n.qd.quick.edit.a11y.moreActions' | translate\"\n aria-haspopup=\"menu\"\n [attr.aria-expanded]=\"openRowMenuIndex === rowIndex\"\n [attr.aria-controls]=\"openRowMenuIndex === rowIndex ? rowMenuId(rowIndex) : null\"\n class=\"menu-button\"\n data-test=\"secondary-actions-toggler\"\n >\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n <ng-template #menu>\n <div\n role=\"menu\"\n [id]=\"rowMenuId(rowIndex)\"\n [attr.aria-label]=\"'i18n.qd.quick.edit.a11y.moreActions' | translate\"\n (keydown)=\"handleRowMenuKeydown($event, rowMenuToggler)\"\n >\n @for (secondaryAction of actions$ | async; track secondaryAction) {\n <button\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"secondary-actions\"\n [ngClass]=\"{ disabled: isActionDisabled(secondaryAction, row) }\"\n [attr.disabled]=\"isActionDisabled(secondaryAction, row) || null\"\n (click)=\"handleSecondaryAction(secondaryAction, rowIndex)\"\n >\n {{ secondaryAction.label.i18n | translate }}\n </button>\n } @if (canAdd && (viewonly$ | async) === false) {\n <button\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"secondary-actions\"\n [attr.data-test-id]=\"testId + '-row-' + rowIndex + '-menu-remove'\"\n (click)=\"removeRow(rowIndex)\"\n >\n {{ \"i18n.qd.quick.edit.removeButtonLabel\" | translate }}\n </button>\n }\n </div>\n </ng-template>\n </td>\n }\n </div>\n </div>\n @if (config.emptyStateView && !config.emptyStateView.disabled && templateData.length === 0) {\n <div class=\"empty-body\">\n <p>{{ config.emptyStateView.i18n | translate }}</p>\n </div>\n }\n</div>\n", styles: [".table{display:flex;width:100%;flex-direction:column;margin:1.25rem auto;background-color:#fff;font-size:.875rem}.table ::ng-deep .qd-input-input{margin-bottom:0!important}.table-header .table-row{padding-top:.125rem;padding-bottom:.125rem;background-color:#e5e5e5;font-weight:700}.table-header .table-row .actions-column{visibility:hidden}.table-header,.table-body{display:flex;flex-direction:column}.table-row{display:flex;flex-direction:row;padding:.25rem 1rem;border-bottom:.0625rem solid rgb(213,213,213);gap:1rem}.table-row ::ng-deep qd-form-label{display:none!important}.table-row ::ng-deep qd-input{min-width:0;margin-bottom:0!important}.table-body .table-row:hover{background-color:#f5f5f5}.table-cell{display:flex;min-width:0;height:2.3125rem;flex:1;align-items:center;text-align:left}.table-cell:has(.qd-input-error),.table-cell:has(.qd-dropdown-error){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input{position:relative}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input .qd-input-character-counter{position:absolute;right:.25rem;bottom:.125rem;font-size:.625rem;line-height:1;pointer-events:none}.table-cell.actions,.table-cell.actions-column{min-width:auto;flex:0 0 auto}.table-row:last-child{border-bottom:none}.editable-actions{display:flex;justify-content:flex-end;margin-right:.625rem;gap:.625rem}.menu-button{display:flex;padding:0 .625rem 0 .375rem;background:unset;color:#454545;font-size:2rem;vertical-align:middle}.menu-button:hover,.menu-button:focus{color:#000}.menu-button:focus-visible{outline:2px solid rgb(0,102,153);outline-offset:2px}.secondary-actions{display:block;width:100%;min-height:2rem;padding:0 1rem;background:#fff0;font-size:.75rem;text-align:left}.secondary-actions:hover{background-color:#f2f7fa}.secondary-actions:focus-visible{box-shadow:inset 0 0 0 2px #069}.secondary-actions.disabled{color:#b4b4b4;cursor:not-allowed}.secondary-actions.disabled:hover{background-color:#fff0}.dropdown{width:100%;min-width:0}.empty-body{padding:1.5rem;background:#fff}.empty-body p{margin:0 0 .5rem}\n"], dependencies: [{ kind: "component", type: QdButtonComponent, selector: "button[qdButton], a[qdButton]", inputs: ["disabled", "color", "icon", "data-test-id", "additionalInfo"] }, { kind: "directive", type: QdButtonGhostDirective, selector: "button[qdButtonGhost], a[qdButtonGhost]" }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: QdDropdownComponent, selector: "qd-dropdown", inputs: ["value", "id", "formControlName", "config", "data-test-id", "qdPopoverMaxHeight", "dense"], outputs: ["valueChange", "enterClick", "dropdownOpened", "blurred", "clickHint", "clickReadonly", "clickViewonly", "optionsResolved"] }, { kind: "component", type: QdInputComponent, selector: "qd-input", inputs: ["formControlName", "value", "config", "isError", "data-test-id"], outputs: ["valueChange", "enterClick", "clickClear", "clickHint", "clickReadonly", "clickViewonly", "blurred", "optionsResolved"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "qdPopoverPlacement", "qdPopoverOffsetX", "qdPopoverOffsetY", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl", "qdPopoverRestoreFocus", "qdPopoverFlipIntoViewport"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "directive", type: QdFocusableDirective, selector: "[qdFocusable]" }, { kind: "component", type: QdTooltipIconComponent, selector: "qd-tooltip-icon", inputs: ["tooltip"] }, { kind: "directive", type: QdCustomForDirective, selector: "[qdCustomFor]", inputs: ["qdCustomForOf", "qdCustomForToggler"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
38833
39039
|
}
|
|
38834
39040
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdQuickEditComponent, decorators: [{
|
|
38835
39041
|
type: Component,
|
|
38836
|
-
args: [{ selector: 'qd-quick-edit', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@if (showStandaloneCreate) {\n<div class=\"editable-actions\">\n <button\n type=\"button\"\n qdButton\n qdButtonGhost\n icon=\"plus\"\n (click)=\"createRow()\"\n [data-test-id]=\"testId + '-button-add-new'\"\n >\n {{ config.standaloneCreateLabel?.i18n ?? \"i18n.qd.quick.edit.createButtonLabel\" | translate }}\n </button>\n</div>\n}\n\n<div class=\"table\" [formGroup]=\"control\">\n @if (!config.canAdd || templateData.length > 0 || config.emptyStateView) {\n <div class=\"table-header\">\n <div class=\"table-row\">\n @for (header of visibleColumns; track header) {\n <div class=\"table-cell\">\n {{ header?.i18n | translate }}\n <qd-tooltip-icon [tooltip]=\"header?.tooltip\"></qd-tooltip-icon>\n </div>\n } @if (hasVisibleActions$ | async) {\n <div class=\"table-cell actions-column\">\n <button type=\"button\" class=\"menu-button\">\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"table-body\">\n <div\n class=\"table-row\"\n *qdCustomFor=\"let row of templateData; let rowIndex = index; toggler: togglerDrawing\"\n [formGroupName]=\"rowIndex\"\n [attr.data-test-id]=\"testId + '-row-' + rowIndex\"\n >\n @for (column of visibleColumns; track trackByColumnName($index, column)) {\n <div class=\"table-cell\">\n @if (column.type === 'enum') {\n <qd-dropdown\n [config]=\"{\n filter: column.filter,\n options: column.options,\n placeholder: column.placeholder,\n placeholderPrefix: column.placeholderPrefix,\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n [data-test-id]=\"column.name + rowIndex\"\n [dense]=\"true\"\n [formControl]=\"$any(control.controls[rowIndex])?.controls[column.name]\"\n (blurred)=\"handleCellBlur(rowIndex, column)\"\n qdFocusable\n class=\"dropdown\"\n >\n </qd-dropdown>\n } @else { @if ($any(control.controls[rowIndex])?.controls[column.name]) {\n <qd-input\n [data-test-id]=\"column.name + rowIndex\"\n [formControlName]=\"column.name\"\n [config]=\"{\n inputType: column.type === 'integer' ? 'number' : 'text',\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n (blurred)=\"handleCellBlur(rowIndex, column)\"\n qdFocusable\n ></qd-input>\n } }\n </div>\n } @if (hasVisibleActions$ | async) {\n <td class=\"table-cell actions\" [attr.data-test-id]=\"testId + '-cell-inline-actions'\">\n <button\n type=\"button\"\n #rowMenuToggler=\"qdPopoverOnClick\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n (keydown.enter)=\"markRowMenuOpeningByKeyboard(rowIndex)\"\n (keydown.space)=\"markRowMenuOpeningByKeyboard(rowIndex)\"\n (opened)=\"openRowMenu(rowIndex)\"\n (closed)=\"closeRowMenu()\"\n [attr.aria-label]=\"'i18n.qd.quick.edit.a11y.moreActions' | translate\"\n aria-haspopup=\"menu\"\n [attr.aria-expanded]=\"openRowMenuIndex === rowIndex\"\n [attr.aria-controls]=\"openRowMenuIndex === rowIndex ? rowMenuId(rowIndex) : null\"\n class=\"menu-button\"\n data-test=\"secondary-actions-toggler\"\n >\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n <ng-template #menu>\n <div\n role=\"menu\"\n [id]=\"rowMenuId(rowIndex)\"\n [attr.aria-label]=\"'i18n.qd.quick.edit.a11y.moreActions' | translate\"\n (keydown)=\"handleRowMenuKeydown($event, rowMenuToggler)\"\n >\n @for (secondaryAction of actions$ | async; track secondaryAction) {\n <button\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"secondary-actions\"\n [ngClass]=\"{ disabled: isActionDisabled(secondaryAction, row) }\"\n [attr.disabled]=\"isActionDisabled(secondaryAction, row) || null\"\n (click)=\"handleSecondaryAction(secondaryAction, rowIndex)\"\n >\n {{ secondaryAction.label.i18n | translate }}\n </button>\n } @if (canAdd && (viewonly$ | async) === false) {\n <button\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"secondary-actions\"\n [attr.data-test-id]=\"testId + '-row-' + rowIndex + '-menu-remove'\"\n (click)=\"removeRow(rowIndex)\"\n >\n {{ \"i18n.qd.quick.edit.removeButtonLabel\" | translate }}\n </button>\n }\n </div>\n </ng-template>\n </td>\n }\n </div>\n </div>\n @if (config.emptyStateView && !config.emptyStateView.disabled && templateData.length === 0) {\n <div class=\"empty-body\">\n <p>{{ config.emptyStateView.i18n | translate }}</p>\n </div>\n }\n</div>\n", styles: [".table{display:flex;width:100%;flex-direction:column;margin:1.25rem auto;background-color:#fff;font-size:.875rem}.table ::ng-deep .qd-input-input{margin-bottom:0!important}.table-header .table-row{padding-top:.125rem;padding-bottom:.125rem;background-color:#e5e5e5;font-weight:700}.table-header .table-row .actions-column{visibility:hidden}.table-header,.table-body{display:flex;flex-direction:column}.table-row{display:flex;flex-direction:row;padding:.25rem 1rem;border-bottom:.0625rem solid rgb(213,213,213);gap:1rem}.table-row ::ng-deep qd-form-label{display:none!important}.table-row ::ng-deep qd-input{min-width:0;margin-bottom:0!important}.table-body .table-row:hover{background-color:#f5f5f5}.table-cell{display:flex;min-width:0;height:2.3125rem;flex:1;align-items:center;text-align:left}.table-cell:has(.qd-input-error),.table-cell:has(.qd-dropdown-error){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input{position:relative}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input .qd-input-character-counter{position:absolute;right:.25rem;bottom:.125rem;font-size:.625rem;line-height:1;pointer-events:none}.table-cell.actions,.table-cell.actions-column{min-width:auto;flex:0 0 auto}.table-row:last-child{border-bottom:none}.editable-actions{display:flex;justify-content:flex-end;margin-right:.625rem;gap:.625rem}.menu-button{display:flex;padding:0 .625rem 0 .375rem;background:unset;color:#454545;font-size:2rem;vertical-align:middle}.menu-button:hover,.menu-button:focus{color:#000;outline:
|
|
39042
|
+
args: [{ selector: 'qd-quick-edit', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@if (showStandaloneCreate) {\n<div class=\"editable-actions\">\n <button\n type=\"button\"\n qdButton\n qdButtonGhost\n icon=\"plus\"\n (click)=\"createRow()\"\n [data-test-id]=\"testId + '-button-add-new'\"\n >\n {{ config.standaloneCreateLabel?.i18n ?? \"i18n.qd.quick.edit.createButtonLabel\" | translate }}\n </button>\n</div>\n}\n\n<div class=\"table\" [formGroup]=\"control\">\n @if (!config.canAdd || templateData.length > 0 || config.emptyStateView) {\n <div class=\"table-header\">\n <div class=\"table-row\">\n @for (header of visibleColumns; track header) {\n <div class=\"table-cell\">\n {{ header?.i18n | translate }}\n <qd-tooltip-icon [tooltip]=\"header?.tooltip\"></qd-tooltip-icon>\n </div>\n } @if (hasVisibleActions$ | async) {\n <div class=\"table-cell actions-column\">\n <button type=\"button\" class=\"menu-button\">\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"table-body\">\n <div\n class=\"table-row\"\n *qdCustomFor=\"let row of templateData; let rowIndex = index; toggler: togglerDrawing\"\n [formGroupName]=\"rowIndex\"\n [attr.data-test-id]=\"testId + '-row-' + rowIndex\"\n >\n @for (column of visibleColumns; track trackByColumnName($index, column)) {\n <div class=\"table-cell\">\n @if (column.type === 'enum') {\n <qd-dropdown\n [config]=\"{\n filter: column.filter,\n options: column.options,\n placeholder: column.placeholder,\n placeholderPrefix: column.placeholderPrefix,\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n [data-test-id]=\"column.name + rowIndex\"\n [dense]=\"true\"\n [formControl]=\"$any(control.controls[rowIndex])?.controls[column.name]\"\n (blurred)=\"handleCellBlur(rowIndex, column)\"\n qdFocusable\n class=\"dropdown\"\n >\n </qd-dropdown>\n } @else { @if ($any(control.controls[rowIndex])?.controls[column.name]) {\n <qd-input\n [data-test-id]=\"column.name + rowIndex\"\n [formControlName]=\"column.name\"\n [config]=\"{\n inputType: column.type === 'integer' ? 'number' : 'text',\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n (blurred)=\"handleCellBlur(rowIndex, column)\"\n qdFocusable\n ></qd-input>\n } }\n </div>\n } @if (hasVisibleActions$ | async) {\n <td class=\"table-cell actions\" [attr.data-test-id]=\"testId + '-cell-inline-actions'\">\n <button\n type=\"button\"\n #rowMenuToggler=\"qdPopoverOnClick\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n (keydown.enter)=\"markRowMenuOpeningByKeyboard(rowIndex)\"\n (keydown.space)=\"markRowMenuOpeningByKeyboard(rowIndex)\"\n (opened)=\"openRowMenu(rowIndex)\"\n (closed)=\"closeRowMenu()\"\n [attr.aria-label]=\"'i18n.qd.quick.edit.a11y.moreActions' | translate\"\n aria-haspopup=\"menu\"\n [attr.aria-expanded]=\"openRowMenuIndex === rowIndex\"\n [attr.aria-controls]=\"openRowMenuIndex === rowIndex ? rowMenuId(rowIndex) : null\"\n class=\"menu-button\"\n data-test=\"secondary-actions-toggler\"\n >\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n <ng-template #menu>\n <div\n role=\"menu\"\n [id]=\"rowMenuId(rowIndex)\"\n [attr.aria-label]=\"'i18n.qd.quick.edit.a11y.moreActions' | translate\"\n (keydown)=\"handleRowMenuKeydown($event, rowMenuToggler)\"\n >\n @for (secondaryAction of actions$ | async; track secondaryAction) {\n <button\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"secondary-actions\"\n [ngClass]=\"{ disabled: isActionDisabled(secondaryAction, row) }\"\n [attr.disabled]=\"isActionDisabled(secondaryAction, row) || null\"\n (click)=\"handleSecondaryAction(secondaryAction, rowIndex)\"\n >\n {{ secondaryAction.label.i18n | translate }}\n </button>\n } @if (canAdd && (viewonly$ | async) === false) {\n <button\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"secondary-actions\"\n [attr.data-test-id]=\"testId + '-row-' + rowIndex + '-menu-remove'\"\n (click)=\"removeRow(rowIndex)\"\n >\n {{ \"i18n.qd.quick.edit.removeButtonLabel\" | translate }}\n </button>\n }\n </div>\n </ng-template>\n </td>\n }\n </div>\n </div>\n @if (config.emptyStateView && !config.emptyStateView.disabled && templateData.length === 0) {\n <div class=\"empty-body\">\n <p>{{ config.emptyStateView.i18n | translate }}</p>\n </div>\n }\n</div>\n", styles: [".table{display:flex;width:100%;flex-direction:column;margin:1.25rem auto;background-color:#fff;font-size:.875rem}.table ::ng-deep .qd-input-input{margin-bottom:0!important}.table-header .table-row{padding-top:.125rem;padding-bottom:.125rem;background-color:#e5e5e5;font-weight:700}.table-header .table-row .actions-column{visibility:hidden}.table-header,.table-body{display:flex;flex-direction:column}.table-row{display:flex;flex-direction:row;padding:.25rem 1rem;border-bottom:.0625rem solid rgb(213,213,213);gap:1rem}.table-row ::ng-deep qd-form-label{display:none!important}.table-row ::ng-deep qd-input{min-width:0;margin-bottom:0!important}.table-body .table-row:hover{background-color:#f5f5f5}.table-cell{display:flex;min-width:0;height:2.3125rem;flex:1;align-items:center;text-align:left}.table-cell:has(.qd-input-error),.table-cell:has(.qd-dropdown-error){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input{position:relative}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input .qd-input-character-counter{position:absolute;right:.25rem;bottom:.125rem;font-size:.625rem;line-height:1;pointer-events:none}.table-cell.actions,.table-cell.actions-column{min-width:auto;flex:0 0 auto}.table-row:last-child{border-bottom:none}.editable-actions{display:flex;justify-content:flex-end;margin-right:.625rem;gap:.625rem}.menu-button{display:flex;padding:0 .625rem 0 .375rem;background:unset;color:#454545;font-size:2rem;vertical-align:middle}.menu-button:hover,.menu-button:focus{color:#000}.menu-button:focus-visible{outline:2px solid rgb(0,102,153);outline-offset:2px}.secondary-actions{display:block;width:100%;min-height:2rem;padding:0 1rem;background:#fff0;font-size:.75rem;text-align:left}.secondary-actions:hover{background-color:#f2f7fa}.secondary-actions:focus-visible{box-shadow:inset 0 0 0 2px #069}.secondary-actions.disabled{color:#b4b4b4;cursor:not-allowed}.secondary-actions.disabled:hover{background-color:#fff0}.dropdown{width:100%;min-width:0}.empty-body{padding:1.5rem;background:#fff}.empty-body p{margin:0 0 .5rem}\n"] }]
|
|
38837
39043
|
}], ctorParameters: () => [], propDecorators: { config: [{
|
|
38838
39044
|
type: Input,
|
|
38839
39045
|
args: [{ required: true }]
|