@quadrel-enterprise-ui/framework 21.19.0 → 21.19.2
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,41 +9876,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
9909
9876
|
args: ['class.qd-form-error']
|
|
9910
9877
|
}] } });
|
|
9911
9878
|
|
|
9912
|
-
class QdKeyboardDetectionService {
|
|
9913
|
-
static KEYBOARD_ACTIVE_CLASS = 'qd-keyboard-active';
|
|
9914
|
-
document = inject(DOCUMENT);
|
|
9915
|
-
ngZone = inject(NgZone);
|
|
9916
|
-
onKeydown = () => {
|
|
9917
|
-
this.document?.documentElement?.classList.add(QdKeyboardDetectionService.KEYBOARD_ACTIVE_CLASS);
|
|
9918
|
-
};
|
|
9919
|
-
onPointerdown = () => {
|
|
9920
|
-
this.document?.documentElement?.classList.remove(QdKeyboardDetectionService.KEYBOARD_ACTIVE_CLASS);
|
|
9921
|
-
};
|
|
9922
|
-
constructor() {
|
|
9923
|
-
const root = this.document?.documentElement;
|
|
9924
|
-
if (!root)
|
|
9925
|
-
return;
|
|
9926
|
-
root.classList.add(QdKeyboardDetectionService.KEYBOARD_ACTIVE_CLASS);
|
|
9927
|
-
this.ngZone.runOutsideAngular(() => {
|
|
9928
|
-
this.document.addEventListener('keydown', this.onKeydown, true);
|
|
9929
|
-
this.document.addEventListener('pointerdown', this.onPointerdown, true);
|
|
9930
|
-
});
|
|
9931
|
-
}
|
|
9932
|
-
ngOnDestroy() {
|
|
9933
|
-
this.document?.removeEventListener('keydown', this.onKeydown, true);
|
|
9934
|
-
this.document?.removeEventListener('pointerdown', this.onPointerdown, true);
|
|
9935
|
-
}
|
|
9936
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdKeyboardDetectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9937
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdKeyboardDetectionService, providedIn: 'root' });
|
|
9938
|
-
}
|
|
9939
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdKeyboardDetectionService, decorators: [{
|
|
9940
|
-
type: Injectable,
|
|
9941
|
-
args: [{ providedIn: 'root' }]
|
|
9942
|
-
}], ctorParameters: () => [] });
|
|
9943
|
-
|
|
9944
|
-
// @ts-strict-ignore
|
|
9945
9879
|
class QdCheckboxComponent {
|
|
9946
|
-
keyboardDetection = inject(QdKeyboardDetectionService);
|
|
9947
9880
|
// TODO: Refactor FormInput for better internal interface
|
|
9948
9881
|
inputData;
|
|
9949
9882
|
value;
|
|
@@ -10010,7 +9943,7 @@ class QdCheckboxComponent {
|
|
|
10010
9943
|
useExisting: QdCheckboxComponent,
|
|
10011
9944
|
multi: true
|
|
10012
9945
|
}
|
|
10013
|
-
], ngImport: i0, template: "<label\n [for]=\"inputData.value + id\"\n [attr.data-test-id]=\"testId + '-label'\"\n [ngClass]=\"\n 'qd-checkbox__label' +\n (inputData.disabled || disabled ? ' qd-checkbox__label--disabled' : '') +\n (checked ? ' qd-checkbox__label--checked' : '')\n \"\n>\n <input\n type=\"checkbox\"\n [attr.tabindex]=\"isAriaHidden ? -1 : 0\"\n [attr.aria-hidden]=\"isAriaHidden ? true : null\"\n qdVisuallyHidden\n [qdAutofocus]=\"hasAutofocus\"\n [id]=\"inputData.value + id\"\n [attr.data-test-id]=\"testId + '-input'\"\n [ngClass]=\"'qd-checkbox__checkbox'\"\n [name]=\"id\"\n [value]=\"inputData.value\"\n [disabled]=\"inputData.disabled || disabled\"\n (click)=\"handleClick(inputData.value, $event)\"\n [checked]=\"checked\"\n />\n\n @if (checked) {\n <qd-icon\n [ngClass]=\"'qd-checkbox__indicator'\"\n [icon]=\"'checkboxCheckedFilled'\"\n [attr.data-test-id]=\"testId + '-indicator-checked'\"\n ></qd-icon>\n } @if (!checked) {\n <qd-icon\n [ngClass]=\"'qd-checkbox__indicator'\"\n [icon]=\"'checkbox'\"\n [attr.data-test-id]=\"testId + '-indicator-unchecked'\"\n ></qd-icon>\n }\n\n <span [ngClass]=\"'qd-checkbox__caption qd-intersection-target'\">{{ inputData.i18n | translate }}</span>\n</label>\n", styles: [".qd-checkbox{display:flex;align-items:center;margin-right:1rem}@media(max-width:959.98px){.qd-checkbox:not(.qd-rwd-disabled){border:.0625rem solid rgb(180,180,180);margin-right:0;margin-bottom:.75rem;background:#fff}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__label{width:100%;padding-left:.75rem;line-height:2.25rem}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__label .qd-checkbox__indicator.qd-icon{margin-right:.75rem}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__label--disabled .qd-checkbox__caption{color:#d5d5d5}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__caption{margin-right:.75rem;color:#171717;transform:translateY(.0625rem)}}@media(max-width:959.98px)and (max-width:959.98px){.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__caption{padding:.375rem 0;line-height:1.25rem}}@media(max-width:959.98px){.qd-checkbox:not(.qd-rwd-disabled):last-child{margin-bottom:0}}.qd-checkbox:last-child{margin-right:0}.qd-checkbox .qd-checkbox__label{position:relative;display:flex;max-width:100%;align-items:center;color:#454545;cursor:pointer;font-size:.875rem;font-weight:400}.qd-checkbox .qd-checkbox__label .qd-checkbox__indicator{position:relative;margin-right:.375rem;color:#b4b4b4;font-size:1.25rem}.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):hover,.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):focus{color:#171717}.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):hover .qd-checkbox__indicator,.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):focus .qd-checkbox__indicator{color:#171717}.qd-checkbox .qd-checkbox__label--checked{color:#171717}.qd-checkbox .qd-checkbox__label--checked .qd-checkbox__indicator{color:#069}.qd-checkbox .qd-checkbox__label--disabled{color:#d5d5d5;cursor:default}.qd-checkbox .qd-checkbox__label--disabled .qd-checkbox__indicator{color:#d5d5d5}.qd-
|
|
9946
|
+
], ngImport: i0, template: "<label\n [for]=\"inputData.value + id\"\n [attr.data-test-id]=\"testId + '-label'\"\n [ngClass]=\"\n 'qd-checkbox__label' +\n (inputData.disabled || disabled ? ' qd-checkbox__label--disabled' : '') +\n (checked ? ' qd-checkbox__label--checked' : '')\n \"\n>\n <input\n type=\"checkbox\"\n [attr.tabindex]=\"isAriaHidden ? -1 : 0\"\n [attr.aria-hidden]=\"isAriaHidden ? true : null\"\n qdVisuallyHidden\n [qdAutofocus]=\"hasAutofocus\"\n [id]=\"inputData.value + id\"\n [attr.data-test-id]=\"testId + '-input'\"\n [ngClass]=\"'qd-checkbox__checkbox'\"\n [name]=\"id\"\n [value]=\"inputData.value\"\n [disabled]=\"inputData.disabled || disabled\"\n (click)=\"handleClick(inputData.value, $event)\"\n [checked]=\"checked\"\n />\n\n @if (checked) {\n <qd-icon\n [ngClass]=\"'qd-checkbox__indicator'\"\n [icon]=\"'checkboxCheckedFilled'\"\n [attr.data-test-id]=\"testId + '-indicator-checked'\"\n ></qd-icon>\n } @if (!checked) {\n <qd-icon\n [ngClass]=\"'qd-checkbox__indicator'\"\n [icon]=\"'checkbox'\"\n [attr.data-test-id]=\"testId + '-indicator-unchecked'\"\n ></qd-icon>\n }\n\n <span [ngClass]=\"'qd-checkbox__caption qd-intersection-target'\">{{ inputData.i18n | translate }}</span>\n</label>\n", styles: [".qd-checkbox{display:flex;align-items:center;margin-right:1rem}@media(max-width:959.98px){.qd-checkbox:not(.qd-rwd-disabled){border:.0625rem solid rgb(180,180,180);margin-right:0;margin-bottom:.75rem;background:#fff}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__label{width:100%;padding-left:.75rem;line-height:2.25rem}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__label .qd-checkbox__indicator.qd-icon{margin-right:.75rem}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__label--disabled .qd-checkbox__caption{color:#d5d5d5}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__caption{margin-right:.75rem;color:#171717;transform:translateY(.0625rem)}}@media(max-width:959.98px)and (max-width:959.98px){.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__caption{padding:.375rem 0;line-height:1.25rem}}@media(max-width:959.98px){.qd-checkbox:not(.qd-rwd-disabled):last-child{margin-bottom:0}}.qd-checkbox:last-child{margin-right:0}.qd-checkbox .qd-checkbox__label{position:relative;display:flex;max-width:100%;align-items:center;color:#454545;cursor:pointer;font-size:.875rem;font-weight:400}.qd-checkbox .qd-checkbox__label .qd-checkbox__indicator{position:relative;margin-right:.375rem;color:#b4b4b4;font-size:1.25rem}.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):hover,.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):focus{color:#171717}.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):hover .qd-checkbox__indicator,.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):focus .qd-checkbox__indicator{color:#171717}.qd-checkbox .qd-checkbox__label--checked{color:#171717}.qd-checkbox .qd-checkbox__label--checked .qd-checkbox__indicator{color:#069}.qd-checkbox .qd-checkbox__label--disabled{color:#d5d5d5;cursor:default}.qd-checkbox .qd-checkbox__label--disabled .qd-checkbox__indicator{color:#d5d5d5}.qd-checkbox .qd-checkbox__checkbox:focus-visible~.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%)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: QdAutofocusDirective, selector: "[qdAutofocus]", inputs: ["qdAutofocus"] }, { kind: "directive", type: QdVisuallyHiddenDirective, selector: "[qdVisuallyHidden]" }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
10014
9947
|
}
|
|
10015
9948
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdCheckboxComponent, decorators: [{
|
|
10016
9949
|
type: Component,
|
|
@@ -10020,7 +9953,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
10020
9953
|
useExisting: QdCheckboxComponent,
|
|
10021
9954
|
multi: true
|
|
10022
9955
|
}
|
|
10023
|
-
], encapsulation: ViewEncapsulation.None, host: { class: 'qd-checkbox' }, standalone: false, template: "<label\n [for]=\"inputData.value + id\"\n [attr.data-test-id]=\"testId + '-label'\"\n [ngClass]=\"\n 'qd-checkbox__label' +\n (inputData.disabled || disabled ? ' qd-checkbox__label--disabled' : '') +\n (checked ? ' qd-checkbox__label--checked' : '')\n \"\n>\n <input\n type=\"checkbox\"\n [attr.tabindex]=\"isAriaHidden ? -1 : 0\"\n [attr.aria-hidden]=\"isAriaHidden ? true : null\"\n qdVisuallyHidden\n [qdAutofocus]=\"hasAutofocus\"\n [id]=\"inputData.value + id\"\n [attr.data-test-id]=\"testId + '-input'\"\n [ngClass]=\"'qd-checkbox__checkbox'\"\n [name]=\"id\"\n [value]=\"inputData.value\"\n [disabled]=\"inputData.disabled || disabled\"\n (click)=\"handleClick(inputData.value, $event)\"\n [checked]=\"checked\"\n />\n\n @if (checked) {\n <qd-icon\n [ngClass]=\"'qd-checkbox__indicator'\"\n [icon]=\"'checkboxCheckedFilled'\"\n [attr.data-test-id]=\"testId + '-indicator-checked'\"\n ></qd-icon>\n } @if (!checked) {\n <qd-icon\n [ngClass]=\"'qd-checkbox__indicator'\"\n [icon]=\"'checkbox'\"\n [attr.data-test-id]=\"testId + '-indicator-unchecked'\"\n ></qd-icon>\n }\n\n <span [ngClass]=\"'qd-checkbox__caption qd-intersection-target'\">{{ inputData.i18n | translate }}</span>\n</label>\n", styles: [".qd-checkbox{display:flex;align-items:center;margin-right:1rem}@media(max-width:959.98px){.qd-checkbox:not(.qd-rwd-disabled){border:.0625rem solid rgb(180,180,180);margin-right:0;margin-bottom:.75rem;background:#fff}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__label{width:100%;padding-left:.75rem;line-height:2.25rem}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__label .qd-checkbox__indicator.qd-icon{margin-right:.75rem}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__label--disabled .qd-checkbox__caption{color:#d5d5d5}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__caption{margin-right:.75rem;color:#171717;transform:translateY(.0625rem)}}@media(max-width:959.98px)and (max-width:959.98px){.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__caption{padding:.375rem 0;line-height:1.25rem}}@media(max-width:959.98px){.qd-checkbox:not(.qd-rwd-disabled):last-child{margin-bottom:0}}.qd-checkbox:last-child{margin-right:0}.qd-checkbox .qd-checkbox__label{position:relative;display:flex;max-width:100%;align-items:center;color:#454545;cursor:pointer;font-size:.875rem;font-weight:400}.qd-checkbox .qd-checkbox__label .qd-checkbox__indicator{position:relative;margin-right:.375rem;color:#b4b4b4;font-size:1.25rem}.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):hover,.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):focus{color:#171717}.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):hover .qd-checkbox__indicator,.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):focus .qd-checkbox__indicator{color:#171717}.qd-checkbox .qd-checkbox__label--checked{color:#171717}.qd-checkbox .qd-checkbox__label--checked .qd-checkbox__indicator{color:#069}.qd-checkbox .qd-checkbox__label--disabled{color:#d5d5d5;cursor:default}.qd-checkbox .qd-checkbox__label--disabled .qd-checkbox__indicator{color:#d5d5d5}.qd-
|
|
9956
|
+
], encapsulation: ViewEncapsulation.None, host: { class: 'qd-checkbox' }, standalone: false, template: "<label\n [for]=\"inputData.value + id\"\n [attr.data-test-id]=\"testId + '-label'\"\n [ngClass]=\"\n 'qd-checkbox__label' +\n (inputData.disabled || disabled ? ' qd-checkbox__label--disabled' : '') +\n (checked ? ' qd-checkbox__label--checked' : '')\n \"\n>\n <input\n type=\"checkbox\"\n [attr.tabindex]=\"isAriaHidden ? -1 : 0\"\n [attr.aria-hidden]=\"isAriaHidden ? true : null\"\n qdVisuallyHidden\n [qdAutofocus]=\"hasAutofocus\"\n [id]=\"inputData.value + id\"\n [attr.data-test-id]=\"testId + '-input'\"\n [ngClass]=\"'qd-checkbox__checkbox'\"\n [name]=\"id\"\n [value]=\"inputData.value\"\n [disabled]=\"inputData.disabled || disabled\"\n (click)=\"handleClick(inputData.value, $event)\"\n [checked]=\"checked\"\n />\n\n @if (checked) {\n <qd-icon\n [ngClass]=\"'qd-checkbox__indicator'\"\n [icon]=\"'checkboxCheckedFilled'\"\n [attr.data-test-id]=\"testId + '-indicator-checked'\"\n ></qd-icon>\n } @if (!checked) {\n <qd-icon\n [ngClass]=\"'qd-checkbox__indicator'\"\n [icon]=\"'checkbox'\"\n [attr.data-test-id]=\"testId + '-indicator-unchecked'\"\n ></qd-icon>\n }\n\n <span [ngClass]=\"'qd-checkbox__caption qd-intersection-target'\">{{ inputData.i18n | translate }}</span>\n</label>\n", styles: [".qd-checkbox{display:flex;align-items:center;margin-right:1rem}@media(max-width:959.98px){.qd-checkbox:not(.qd-rwd-disabled){border:.0625rem solid rgb(180,180,180);margin-right:0;margin-bottom:.75rem;background:#fff}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__label{width:100%;padding-left:.75rem;line-height:2.25rem}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__label .qd-checkbox__indicator.qd-icon{margin-right:.75rem}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__label--disabled .qd-checkbox__caption{color:#d5d5d5}.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__caption{margin-right:.75rem;color:#171717;transform:translateY(.0625rem)}}@media(max-width:959.98px)and (max-width:959.98px){.qd-checkbox:not(.qd-rwd-disabled) .qd-checkbox__caption{padding:.375rem 0;line-height:1.25rem}}@media(max-width:959.98px){.qd-checkbox:not(.qd-rwd-disabled):last-child{margin-bottom:0}}.qd-checkbox:last-child{margin-right:0}.qd-checkbox .qd-checkbox__label{position:relative;display:flex;max-width:100%;align-items:center;color:#454545;cursor:pointer;font-size:.875rem;font-weight:400}.qd-checkbox .qd-checkbox__label .qd-checkbox__indicator{position:relative;margin-right:.375rem;color:#b4b4b4;font-size:1.25rem}.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):hover,.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):focus{color:#171717}.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):hover .qd-checkbox__indicator,.qd-checkbox .qd-checkbox__label:not(.qd-checkbox__label--checked,.qd-checkbox__label--disabled):focus .qd-checkbox__indicator{color:#171717}.qd-checkbox .qd-checkbox__label--checked{color:#171717}.qd-checkbox .qd-checkbox__label--checked .qd-checkbox__indicator{color:#069}.qd-checkbox .qd-checkbox__label--disabled{color:#d5d5d5;cursor:default}.qd-checkbox .qd-checkbox__label--disabled .qd-checkbox__indicator{color:#d5d5d5}.qd-checkbox .qd-checkbox__checkbox:focus-visible~.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%)}\n"] }]
|
|
10024
9957
|
}], ctorParameters: () => [], propDecorators: { inputData: [{
|
|
10025
9958
|
type: Input
|
|
10026
9959
|
}], value: [{
|
|
@@ -10047,9 +9980,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
10047
9980
|
args: ['class.qd-checkbox--disabled']
|
|
10048
9981
|
}] } });
|
|
10049
9982
|
|
|
10050
|
-
// @ts-strict-ignore
|
|
10051
9983
|
class QdCheckboxesService {
|
|
10052
|
-
|
|
9984
|
+
_translateService = inject(TranslateService);
|
|
10053
9985
|
checkboxesList;
|
|
10054
9986
|
checkboxesListForView;
|
|
10055
9987
|
formatFormControlValues(formControlValues) {
|
|
@@ -10065,7 +9997,7 @@ class QdCheckboxesService {
|
|
|
10065
9997
|
});
|
|
10066
9998
|
}
|
|
10067
9999
|
isAtLeastOneCheckboxSelected(checkboxesList) {
|
|
10068
|
-
return checkboxesList.reduce((hasValue, checkbox) => hasValue || checkbox.checked, false);
|
|
10000
|
+
return checkboxesList.reduce((hasValue, checkbox) => hasValue || !!checkbox.checked, false);
|
|
10069
10001
|
}
|
|
10070
10002
|
setCheckboxesList(checkboxesList) {
|
|
10071
10003
|
this.checkboxesList = checkboxesList.map(checkbox => ({ ...checkbox, disabled: checkbox.disabled || false }));
|
|
@@ -10131,7 +10063,7 @@ class QdCheckboxesService {
|
|
|
10131
10063
|
}
|
|
10132
10064
|
const checkboxesListWithTranslation = this.checkboxesList.map((checkbox) => ({
|
|
10133
10065
|
...checkbox,
|
|
10134
|
-
translation: this.
|
|
10066
|
+
translation: this._translateService.instant(checkbox.i18n)
|
|
10135
10067
|
}));
|
|
10136
10068
|
this.checkboxesListForView = this.checkboxesList.filter((_checkbox, index) => checkboxesListWithTranslation[index].translation.toLowerCase().includes(value.toLowerCase()));
|
|
10137
10069
|
}
|
|
@@ -10188,7 +10120,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
10188
10120
|
type: Output
|
|
10189
10121
|
}] } });
|
|
10190
10122
|
|
|
10191
|
-
// @ts-strict-ignore
|
|
10192
10123
|
/**
|
|
10193
10124
|
* The **QdCheckboxes** is a component that provides a form element for checkboxes.<br />
|
|
10194
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.
|
|
@@ -10221,11 +10152,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
10221
10152
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
10222
10153
|
*/
|
|
10223
10154
|
class QdCheckboxesComponent {
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
|
|
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);
|
|
10229
10160
|
/**
|
|
10230
10161
|
* The form control name can be assigned here if you want to use Reactive Forms.
|
|
10231
10162
|
*/
|
|
@@ -10260,6 +10191,7 @@ class QdCheckboxesComponent {
|
|
|
10260
10191
|
testId = 'checkboxes';
|
|
10261
10192
|
/**
|
|
10262
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`.
|
|
10263
10195
|
*/
|
|
10264
10196
|
valuesChange = new EventEmitter();
|
|
10265
10197
|
/**
|
|
@@ -10306,10 +10238,10 @@ class QdCheckboxesComponent {
|
|
|
10306
10238
|
_onTouch = () => { };
|
|
10307
10239
|
_destroyRef = inject(DestroyRef);
|
|
10308
10240
|
get hasHint() {
|
|
10309
|
-
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);
|
|
10310
10242
|
}
|
|
10311
10243
|
get selectedValuesTranslated() {
|
|
10312
|
-
return this.
|
|
10244
|
+
return this._checkboxesService.getSelectedValuesTranslated();
|
|
10313
10245
|
}
|
|
10314
10246
|
get required() {
|
|
10315
10247
|
if (!this.control)
|
|
@@ -10321,25 +10253,25 @@ class QdCheckboxesComponent {
|
|
|
10321
10253
|
}
|
|
10322
10254
|
ngOnInit() {
|
|
10323
10255
|
this.updateConfiguration();
|
|
10324
|
-
if (this.
|
|
10256
|
+
if (this._controlContainer) {
|
|
10325
10257
|
if (this.formControlName) {
|
|
10326
|
-
this.control = this.
|
|
10258
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
10327
10259
|
}
|
|
10328
10260
|
else {
|
|
10329
10261
|
console.warn('Quadrel Framework | QdCheckboxGroup - Missing FormControlName directive from host element of the component.');
|
|
10330
10262
|
}
|
|
10331
10263
|
}
|
|
10332
10264
|
this.setInitialValues();
|
|
10333
|
-
this.
|
|
10334
|
-
this.
|
|
10265
|
+
this._checkboxesService.setCheckboxesList(this.options);
|
|
10266
|
+
this._checkboxesService.fillCheckboxesListWithDefaults(this.values);
|
|
10335
10267
|
this.setCheckboxesData();
|
|
10336
|
-
this.
|
|
10268
|
+
this._actionEmitterService.hintEventEmitter$
|
|
10337
10269
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
10338
10270
|
.subscribe(() => this.clickHint.emit());
|
|
10339
|
-
this.
|
|
10271
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
10340
10272
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
10341
10273
|
.subscribe(() => this.clickReadonly.emit());
|
|
10342
|
-
this.
|
|
10274
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
10343
10275
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
10344
10276
|
.subscribe(() => this.clickViewonly.emit());
|
|
10345
10277
|
this.initOpModeSubscription();
|
|
@@ -10359,7 +10291,7 @@ class QdCheckboxesComponent {
|
|
|
10359
10291
|
this._onTouch = fn;
|
|
10360
10292
|
}
|
|
10361
10293
|
writeValue(values) {
|
|
10362
|
-
this.
|
|
10294
|
+
this._checkboxesService.fillCheckboxesListWithDefaults(values);
|
|
10363
10295
|
this.setCheckboxesData();
|
|
10364
10296
|
this.checkboxesValues = values;
|
|
10365
10297
|
}
|
|
@@ -10375,14 +10307,14 @@ class QdCheckboxesComponent {
|
|
|
10375
10307
|
this.valuesChange.emit(this.checkboxesValues);
|
|
10376
10308
|
}
|
|
10377
10309
|
changeValue($event) {
|
|
10378
|
-
this.
|
|
10379
|
-
this.
|
|
10380
|
-
this.checkboxesListForView = this.
|
|
10310
|
+
this._checkboxesService.filterOptions($event);
|
|
10311
|
+
this._ngZone.run(() => {
|
|
10312
|
+
this.checkboxesListForView = this._checkboxesService.getCheckboxesListForView();
|
|
10381
10313
|
});
|
|
10382
10314
|
}
|
|
10383
10315
|
haveOptionsChanged(changes) {
|
|
10384
|
-
return (!changes
|
|
10385
|
-
!qdIsDeepEqual(changes
|
|
10316
|
+
return (!changes['config'].firstChange &&
|
|
10317
|
+
!qdIsDeepEqual(changes['config'].previousValue?.options, changes['config'].currentValue?.options));
|
|
10386
10318
|
}
|
|
10387
10319
|
updateConfiguration() {
|
|
10388
10320
|
this.label = getLabel(this.config);
|
|
@@ -10401,19 +10333,19 @@ class QdCheckboxesComponent {
|
|
|
10401
10333
|
this.isHintDisabled = getIsHintDisabled(this.config);
|
|
10402
10334
|
}
|
|
10403
10335
|
setCheckboxesData() {
|
|
10404
|
-
this.
|
|
10405
|
-
this.checkboxesValues = this.
|
|
10406
|
-
this.checkboxesListForView = this.
|
|
10336
|
+
this._checkboxesService.setCheckboxesListForView();
|
|
10337
|
+
this.checkboxesValues = this._checkboxesService.getCheckboxValues();
|
|
10338
|
+
this.checkboxesListForView = this._checkboxesService.getCheckboxesListForView();
|
|
10407
10339
|
}
|
|
10408
10340
|
updateCheckboxesData(value) {
|
|
10409
|
-
this.
|
|
10410
|
-
this.
|
|
10411
|
-
this.checkboxesValues = this.
|
|
10412
|
-
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();
|
|
10413
10345
|
}
|
|
10414
10346
|
handleOptionsChange() {
|
|
10415
|
-
this.
|
|
10416
|
-
this.
|
|
10347
|
+
this._checkboxesService.setCheckboxesList(this.options);
|
|
10348
|
+
this._checkboxesService.fillCheckboxesListWithDefaults(this.checkboxesValues);
|
|
10417
10349
|
this.setCheckboxesData();
|
|
10418
10350
|
this._onChange(this.checkboxesValues);
|
|
10419
10351
|
this._onTouch(this.checkboxesValues);
|
|
@@ -10422,16 +10354,17 @@ class QdCheckboxesComponent {
|
|
|
10422
10354
|
setInitialValues() {
|
|
10423
10355
|
if (this.values)
|
|
10424
10356
|
return;
|
|
10425
|
-
|
|
10357
|
+
const values = [];
|
|
10426
10358
|
this.options.forEach(option => {
|
|
10427
10359
|
if (option.active)
|
|
10428
|
-
|
|
10360
|
+
values.push(option.value);
|
|
10429
10361
|
});
|
|
10362
|
+
this.values = values;
|
|
10430
10363
|
}
|
|
10431
10364
|
initOpModeSubscription() {
|
|
10432
|
-
if (!this.
|
|
10365
|
+
if (!this._eventBrokerService)
|
|
10433
10366
|
return;
|
|
10434
|
-
this.
|
|
10367
|
+
this._eventBrokerService
|
|
10435
10368
|
.consume('operation_mode_changed')
|
|
10436
10369
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
10437
10370
|
.subscribe(topic => {
|
|
@@ -10648,12 +10581,11 @@ class QdDateAdapter {
|
|
|
10648
10581
|
}
|
|
10649
10582
|
}
|
|
10650
10583
|
|
|
10651
|
-
// @ts-strict-ignore
|
|
10652
10584
|
const YearsBefore = 9;
|
|
10653
10585
|
const YearsAfter = 2;
|
|
10654
10586
|
const PickerColumnsPerRow = 3;
|
|
10655
10587
|
class QdCalendarComponent {
|
|
10656
|
-
|
|
10588
|
+
_injector = inject(Injector);
|
|
10657
10589
|
/**
|
|
10658
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.
|
|
10659
10591
|
*
|
|
@@ -10705,7 +10637,7 @@ class QdCalendarComponent {
|
|
|
10705
10637
|
this.generateCalendar(this.currentDate);
|
|
10706
10638
|
}
|
|
10707
10639
|
ngAfterViewInit() {
|
|
10708
|
-
afterNextRender(() => this.focusActiveCell(), { injector: this.
|
|
10640
|
+
afterNextRender(() => this.focusActiveCell(), { injector: this._injector });
|
|
10709
10641
|
}
|
|
10710
10642
|
ngOnChanges(changes) {
|
|
10711
10643
|
if (changes['language']) {
|
|
@@ -10866,7 +10798,7 @@ class QdCalendarComponent {
|
|
|
10866
10798
|
event.preventDefault();
|
|
10867
10799
|
event.stopPropagation();
|
|
10868
10800
|
this.activePickerIndex = index;
|
|
10869
|
-
afterNextRender(() => this.focusActivePickerCell(), { injector: this.
|
|
10801
|
+
afterNextRender(() => this.focusActivePickerCell(), { injector: this._injector });
|
|
10870
10802
|
}
|
|
10871
10803
|
selectDate(date) {
|
|
10872
10804
|
this.selectedChange.emit(date.formatted);
|
|
@@ -10899,7 +10831,7 @@ class QdCalendarComponent {
|
|
|
10899
10831
|
this.currentDate = target.clone();
|
|
10900
10832
|
this.generateCalendar(this.currentDate);
|
|
10901
10833
|
}
|
|
10902
|
-
afterNextRender(() => this.focusActiveCell(), { injector: this.
|
|
10834
|
+
afterNextRender(() => this.focusActiveCell(), { injector: this._injector });
|
|
10903
10835
|
}
|
|
10904
10836
|
syncActiveToCurrentMonth() {
|
|
10905
10837
|
if (this.activeDate.isSame(this.currentDate, 'month'))
|
|
@@ -10912,14 +10844,14 @@ class QdCalendarComponent {
|
|
|
10912
10844
|
const selected = this.years.findIndex(year => this.isSameYear(year));
|
|
10913
10845
|
const fallback = this.years.indexOf(this.currentDate.year());
|
|
10914
10846
|
this.activePickerIndex = selected >= 0 ? selected : Math.max(0, fallback);
|
|
10915
|
-
afterNextRender(() => this.focusActivePickerCell(), { injector: this.
|
|
10847
|
+
afterNextRender(() => this.focusActivePickerCell(), { injector: this._injector });
|
|
10916
10848
|
}
|
|
10917
10849
|
else if (this.mode === QdCalendarMode.MonthPicker) {
|
|
10918
10850
|
this.activePickerIndex = this.currentDate.month();
|
|
10919
|
-
afterNextRender(() => this.focusActivePickerCell(), { injector: this.
|
|
10851
|
+
afterNextRender(() => this.focusActivePickerCell(), { injector: this._injector });
|
|
10920
10852
|
}
|
|
10921
10853
|
else {
|
|
10922
|
-
afterNextRender(() => this.focusActiveCell(), { injector: this.
|
|
10854
|
+
afterNextRender(() => this.focusActiveCell(), { injector: this._injector });
|
|
10923
10855
|
}
|
|
10924
10856
|
}
|
|
10925
10857
|
focusActiveCell() {
|
|
@@ -10985,11 +10917,11 @@ class QdCalendarComponent {
|
|
|
10985
10917
|
this.weekdays = w.slice(1).concat(w[0]);
|
|
10986
10918
|
}
|
|
10987
10919
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10988
|
-
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 });
|
|
10989
10921
|
}
|
|
10990
10922
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdCalendarComponent, decorators: [{
|
|
10991
10923
|
type: Component,
|
|
10992
|
-
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"] }]
|
|
10993
10925
|
}], propDecorators: { selectedDate: [{
|
|
10994
10926
|
type: Input
|
|
10995
10927
|
}], language: [{
|
|
@@ -11008,7 +10940,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
11008
10940
|
args: ['pickerCell']
|
|
11009
10941
|
}] } });
|
|
11010
10942
|
|
|
11011
|
-
// @ts-strict-ignore
|
|
11012
10943
|
class TimePickerService {
|
|
11013
10944
|
getConfig(customConfig) {
|
|
11014
10945
|
const defaultConfig = {
|
|
@@ -11581,7 +11512,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
11581
11512
|
args: [QdFormOptionItemComponent]
|
|
11582
11513
|
}] } });
|
|
11583
11514
|
|
|
11584
|
-
// @ts-strict-ignore
|
|
11585
11515
|
/**
|
|
11586
11516
|
* The **QdDropdown** is an component that provides a dropdown form element.<br />
|
|
11587
11517
|
* It can be used with Quadrel Reactive Forms or with model binding.
|
|
@@ -11614,17 +11544,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
11614
11544
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
11615
11545
|
*/
|
|
11616
11546
|
class QdDropdownComponent {
|
|
11617
|
-
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
|
|
11621
|
-
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
|
|
11625
|
-
|
|
11626
|
-
|
|
11627
|
-
|
|
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);
|
|
11628
11558
|
/**
|
|
11629
11559
|
* The current form item value, if you are working with Model Binding.
|
|
11630
11560
|
*
|
|
@@ -11641,7 +11571,7 @@ class QdDropdownComponent {
|
|
|
11641
11571
|
* Current selected value
|
|
11642
11572
|
*/
|
|
11643
11573
|
get value() {
|
|
11644
|
-
return this._value ?? this.options.find(option => option.active)?.value;
|
|
11574
|
+
return (this._value ?? this.options.find(option => option.active)?.value);
|
|
11645
11575
|
}
|
|
11646
11576
|
/**
|
|
11647
11577
|
* Identifier to distinguish click events on same options in different dropdowns.
|
|
@@ -11696,6 +11626,7 @@ class QdDropdownComponent {
|
|
|
11696
11626
|
qdPopoverMaxHeight = 250;
|
|
11697
11627
|
/**
|
|
11698
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.
|
|
11699
11630
|
*/
|
|
11700
11631
|
valueChange = new EventEmitter();
|
|
11701
11632
|
/**
|
|
@@ -11754,7 +11685,7 @@ class QdDropdownComponent {
|
|
|
11754
11685
|
filter = false;
|
|
11755
11686
|
options;
|
|
11756
11687
|
filterText = '';
|
|
11757
|
-
filteredOptions$ = this.
|
|
11688
|
+
filteredOptions$ = this._optionsService.filteredOptions$;
|
|
11758
11689
|
control;
|
|
11759
11690
|
_value = null;
|
|
11760
11691
|
_selectedOption = null;
|
|
@@ -11774,13 +11705,13 @@ class QdDropdownComponent {
|
|
|
11774
11705
|
return this._selectedOption;
|
|
11775
11706
|
}
|
|
11776
11707
|
get hasHint() {
|
|
11777
|
-
return this.config?.hint?.i18n && !this.config.hint.disabled;
|
|
11708
|
+
return !!(this.config?.hint?.i18n && !this.config.hint.disabled);
|
|
11778
11709
|
}
|
|
11779
11710
|
get isSelected() {
|
|
11780
11711
|
return this.selectedOption !== undefined;
|
|
11781
11712
|
}
|
|
11782
11713
|
get errors() {
|
|
11783
|
-
return this.control ? this.control.errors : [];
|
|
11714
|
+
return (this.control ? this.control.errors : []);
|
|
11784
11715
|
}
|
|
11785
11716
|
get selected() {
|
|
11786
11717
|
return this.placeholderPrefix + this.placeholder;
|
|
@@ -11792,18 +11723,18 @@ class QdDropdownComponent {
|
|
|
11792
11723
|
}
|
|
11793
11724
|
get placeholderPrefix() {
|
|
11794
11725
|
return this.config?.placeholderPrefix?.i18n && !this.config.placeholderPrefix.disabled
|
|
11795
|
-
? this.
|
|
11726
|
+
? this._translateService.instant(this.config.placeholderPrefix.i18n) + ' '
|
|
11796
11727
|
: '';
|
|
11797
11728
|
}
|
|
11798
11729
|
get placeholder() {
|
|
11799
11730
|
return this.config?.placeholder?.i18n && !this.config.placeholder.disabled
|
|
11800
|
-
? this.
|
|
11801
|
-
: this.
|
|
11731
|
+
? this._translateService.instant(this.config.placeholder.i18n)
|
|
11732
|
+
: this._translateService.instant('i18n.qd.dropdown.defaultValue');
|
|
11802
11733
|
}
|
|
11803
11734
|
constructor() {
|
|
11804
11735
|
if (!this.id)
|
|
11805
11736
|
this.id = v4();
|
|
11806
|
-
this.
|
|
11737
|
+
this._optionsService.optionsResolved$
|
|
11807
11738
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
11808
11739
|
.subscribe(resolvedEvent => this.optionsResolved.emit(resolvedEvent));
|
|
11809
11740
|
}
|
|
@@ -11813,26 +11744,26 @@ class QdDropdownComponent {
|
|
|
11813
11744
|
this.loadOptionsForCurrentConfig();
|
|
11814
11745
|
this.resolveControl();
|
|
11815
11746
|
this.updateSelectedOption(this.value);
|
|
11816
|
-
this.
|
|
11747
|
+
this._actionEmitterService.hintEventEmitter$
|
|
11817
11748
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
11818
11749
|
.subscribe(() => this.clickHint.emit());
|
|
11819
|
-
this.
|
|
11750
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
11820
11751
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
11821
11752
|
.subscribe(() => this.clickReadonly.emit());
|
|
11822
|
-
this.
|
|
11753
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
11823
11754
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
11824
11755
|
.subscribe(() => this.clickViewonly.emit());
|
|
11825
11756
|
this.initOpModeSubscription();
|
|
11826
11757
|
}
|
|
11827
11758
|
ngOnChanges(changes) {
|
|
11828
|
-
if (changes
|
|
11759
|
+
if (changes['config']) {
|
|
11829
11760
|
this.updateConfiguration();
|
|
11830
11761
|
if (this.haveOptionsChanged(changes))
|
|
11831
11762
|
this.handleOptionsChange();
|
|
11832
11763
|
}
|
|
11833
11764
|
}
|
|
11834
11765
|
ngOnDestroy() {
|
|
11835
|
-
this.
|
|
11766
|
+
this._optionsService.reset();
|
|
11836
11767
|
}
|
|
11837
11768
|
focus() {
|
|
11838
11769
|
this.box.nativeElement.focus();
|
|
@@ -11846,20 +11777,20 @@ class QdDropdownComponent {
|
|
|
11846
11777
|
writeValue(value) {
|
|
11847
11778
|
this.value = value;
|
|
11848
11779
|
this.updateSelectedOption(value);
|
|
11849
|
-
this.
|
|
11780
|
+
this.emitValueChange(this.value);
|
|
11850
11781
|
}
|
|
11851
11782
|
setDisabledState(disabled) {
|
|
11852
11783
|
this.disabled = disabled;
|
|
11853
11784
|
}
|
|
11854
11785
|
hasOptions() {
|
|
11855
|
-
return this.
|
|
11786
|
+
return this._optionsService.hasOptions();
|
|
11856
11787
|
}
|
|
11857
11788
|
handleOptionSelected(option) {
|
|
11858
11789
|
this._value = option.value;
|
|
11859
11790
|
this._selectedOption = option;
|
|
11860
11791
|
this._onChange(option.value);
|
|
11861
11792
|
this._onTouch(option.value);
|
|
11862
|
-
this.
|
|
11793
|
+
this.emitValueChange(option.value);
|
|
11863
11794
|
}
|
|
11864
11795
|
handleClick(option) {
|
|
11865
11796
|
this._isWaitingForNextFocus = true;
|
|
@@ -11867,21 +11798,21 @@ class QdDropdownComponent {
|
|
|
11867
11798
|
this._onTouch(option.value);
|
|
11868
11799
|
this.value = option.value;
|
|
11869
11800
|
this._selectedOption = option;
|
|
11870
|
-
this.
|
|
11801
|
+
this.emitValueChange(option.value);
|
|
11871
11802
|
this.dropdownDirective?.close();
|
|
11872
11803
|
}
|
|
11873
11804
|
handleFilterChange($event) {
|
|
11874
11805
|
const trimmed = ($event ?? '').trim();
|
|
11875
11806
|
this.filterText = trimmed;
|
|
11876
|
-
this.
|
|
11877
|
-
this.
|
|
11807
|
+
this._optionsService.load(trimmed);
|
|
11808
|
+
this._changeDetectorRef.detectChanges();
|
|
11878
11809
|
}
|
|
11879
11810
|
onListKeydown(event) {
|
|
11880
11811
|
if (!this.isOpen)
|
|
11881
11812
|
return;
|
|
11882
11813
|
switch (event.key) {
|
|
11883
11814
|
case 'Enter': {
|
|
11884
|
-
const option = this.
|
|
11815
|
+
const option = this._keyboardService.pickActiveOption();
|
|
11885
11816
|
if (!option)
|
|
11886
11817
|
return;
|
|
11887
11818
|
this.handleClick(option);
|
|
@@ -11890,7 +11821,7 @@ class QdDropdownComponent {
|
|
|
11890
11821
|
}
|
|
11891
11822
|
case 'ArrowUp':
|
|
11892
11823
|
case 'ArrowDown':
|
|
11893
|
-
this.
|
|
11824
|
+
this._keyboardService.handleKeydown(event);
|
|
11894
11825
|
}
|
|
11895
11826
|
}
|
|
11896
11827
|
onOpenDropdown() {
|
|
@@ -11902,7 +11833,7 @@ class QdDropdownComponent {
|
|
|
11902
11833
|
this.dropdownOpened.emit(true);
|
|
11903
11834
|
this.loadOptionsForCurrentConfig();
|
|
11904
11835
|
setTimeout(() => {
|
|
11905
|
-
this.
|
|
11836
|
+
this._keyboardService.setActiveOptionByValue(this._selectedOption?.value ?? '');
|
|
11906
11837
|
this.filterInput?.nativeElement.focus();
|
|
11907
11838
|
this.filterInput?.nativeElement.scrollIntoView({ block: 'start', behavior: 'auto' });
|
|
11908
11839
|
});
|
|
@@ -11929,10 +11860,10 @@ class QdDropdownComponent {
|
|
|
11929
11860
|
emitBlurredIfFocusLeft() {
|
|
11930
11861
|
if (!this._hasFocus || this.isOpen)
|
|
11931
11862
|
return;
|
|
11932
|
-
const focused = this.
|
|
11863
|
+
const focused = this._document.activeElement;
|
|
11933
11864
|
if (this.isFocusInside(focused))
|
|
11934
11865
|
return;
|
|
11935
|
-
if (this._isWaitingForNextFocus && (!focused || focused === this.
|
|
11866
|
+
if (this._isWaitingForNextFocus && (!focused || focused === this._document.body))
|
|
11936
11867
|
return;
|
|
11937
11868
|
this._hasFocus = false;
|
|
11938
11869
|
this._isWaitingForNextFocus = false;
|
|
@@ -11940,18 +11871,21 @@ class QdDropdownComponent {
|
|
|
11940
11871
|
}
|
|
11941
11872
|
isFocusInside(focused) {
|
|
11942
11873
|
const popover = this.dropdownDirective?.overlayRef?.overlayElement;
|
|
11943
|
-
return this.
|
|
11874
|
+
return this._elementRef.nativeElement.contains(focused) || !!popover?.contains(focused);
|
|
11875
|
+
}
|
|
11876
|
+
emitValueChange(value) {
|
|
11877
|
+
this.valueChange.emit(value);
|
|
11944
11878
|
}
|
|
11945
11879
|
loadOptionsForCurrentConfig() {
|
|
11946
|
-
this.
|
|
11947
|
-
this.
|
|
11880
|
+
this._optionsService.initialize(this.config);
|
|
11881
|
+
this._optionsService.validateOptionsSetup('QdDropdown');
|
|
11948
11882
|
}
|
|
11949
11883
|
resolveControl() {
|
|
11950
|
-
if (this.
|
|
11951
|
-
this.control = this.
|
|
11884
|
+
if (this._controlContainer && this.formControlName) {
|
|
11885
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
11952
11886
|
return;
|
|
11953
11887
|
}
|
|
11954
|
-
const directive = this.
|
|
11888
|
+
const directive = this._injector.get(FormControlDirective, null);
|
|
11955
11889
|
if (directive) {
|
|
11956
11890
|
this.control = directive.control;
|
|
11957
11891
|
return;
|
|
@@ -11970,7 +11904,7 @@ class QdDropdownComponent {
|
|
|
11970
11904
|
this.options = getOptions(this.config);
|
|
11971
11905
|
}
|
|
11972
11906
|
haveOptionsChanged(changes) {
|
|
11973
|
-
return !qdIsDeepEqual(changes
|
|
11907
|
+
return !qdIsDeepEqual(changes['config'].previousValue?.options, changes['config'].currentValue?.options);
|
|
11974
11908
|
}
|
|
11975
11909
|
handleOptionsChange() {
|
|
11976
11910
|
if (this.value && !this.options.find(option => option.value === this.value)) {
|
|
@@ -11979,7 +11913,7 @@ class QdDropdownComponent {
|
|
|
11979
11913
|
this.valueChange.emit('');
|
|
11980
11914
|
}
|
|
11981
11915
|
this.updateSelectedOption(this.value);
|
|
11982
|
-
this.
|
|
11916
|
+
this._optionsService.updateStaticOptions(this.config.options);
|
|
11983
11917
|
}
|
|
11984
11918
|
updateSelectedOption(value) {
|
|
11985
11919
|
if (!this.config || !Array.isArray(this.config.options))
|
|
@@ -11987,9 +11921,9 @@ class QdDropdownComponent {
|
|
|
11987
11921
|
this._selectedOption = this.config.options.find(opt => opt.value === value) ?? null;
|
|
11988
11922
|
}
|
|
11989
11923
|
initOpModeSubscription() {
|
|
11990
|
-
if (!this.
|
|
11924
|
+
if (!this._eventBrokerService)
|
|
11991
11925
|
return;
|
|
11992
|
-
this.
|
|
11926
|
+
this._eventBrokerService
|
|
11993
11927
|
.consume('operation_mode_changed')
|
|
11994
11928
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
11995
11929
|
.subscribe(topic => {
|
|
@@ -12013,7 +11947,7 @@ class QdDropdownComponent {
|
|
|
12013
11947
|
provide: QD_FOCUSABLE_TOKEN,
|
|
12014
11948
|
useExisting: QdDropdownComponent
|
|
12015
11949
|
}
|
|
12016
|
-
], 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 });
|
|
12017
11951
|
}
|
|
12018
11952
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdDropdownComponent, decorators: [{
|
|
12019
11953
|
type: Component,
|
|
@@ -12031,7 +11965,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
12031
11965
|
provide: QD_FOCUSABLE_TOKEN,
|
|
12032
11966
|
useExisting: QdDropdownComponent
|
|
12033
11967
|
}
|
|
12034
|
-
], 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"] }]
|
|
12035
11969
|
}], ctorParameters: () => [], propDecorators: { value: [{
|
|
12036
11970
|
type: Input
|
|
12037
11971
|
}], id: [{
|
|
@@ -12124,7 +12058,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
12124
12058
|
|
|
12125
12059
|
function getValueWithUnit(value, config) {
|
|
12126
12060
|
const valueWithUnit = getValueObject(value);
|
|
12127
|
-
if (config?.units?.length > 0 && !valueWithUnit.unit) {
|
|
12061
|
+
if ((config?.units?.length ?? 0) > 0 && !valueWithUnit.unit) {
|
|
12128
12062
|
valueWithUnit.unit = getUnitFromConfig(config);
|
|
12129
12063
|
}
|
|
12130
12064
|
return valueWithUnit;
|
|
@@ -12141,10 +12075,11 @@ function getValueObject(value) {
|
|
|
12141
12075
|
}
|
|
12142
12076
|
}
|
|
12143
12077
|
function getUnitFromConfig(config) {
|
|
12144
|
-
|
|
12078
|
+
const units = config.units;
|
|
12079
|
+
const unit = units.length > 1 ? units.find(option => option.active)?.value : units[0].value;
|
|
12080
|
+
return unit;
|
|
12145
12081
|
}
|
|
12146
12082
|
|
|
12147
|
-
// @ts-strict-ignore
|
|
12148
12083
|
const DEFAULT_UNITS_PLACEHOLDER = 'i18n.qd.input.units.unit';
|
|
12149
12084
|
class QdInputUnitsComponent {
|
|
12150
12085
|
config;
|
|
@@ -12166,7 +12101,7 @@ class QdInputUnitsComponent {
|
|
|
12166
12101
|
this.setUnitByUnitValue();
|
|
12167
12102
|
}
|
|
12168
12103
|
setUnitByUnitValue() {
|
|
12169
|
-
this._unit = this.config.units
|
|
12104
|
+
this._unit = this.config.units?.find(unit => unit.value === this.unitValue);
|
|
12170
12105
|
}
|
|
12171
12106
|
handleUnitSelection(unit) {
|
|
12172
12107
|
if (unit.disabled) {
|
|
@@ -12200,7 +12135,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
12200
12135
|
type: Output
|
|
12201
12136
|
}] } });
|
|
12202
12137
|
|
|
12203
|
-
// @ts-strict-ignore
|
|
12204
12138
|
/**
|
|
12205
12139
|
* The **QdInput** component provides a FormElement for entering text into a UI.<br />
|
|
12206
12140
|
* It can be used with Quadrel Reactive Forms or with model binding.
|
|
@@ -12413,14 +12347,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
12413
12347
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
12414
12348
|
*/
|
|
12415
12349
|
class QdInputComponent {
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
|
|
12422
|
-
|
|
12423
|
-
|
|
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);
|
|
12424
12358
|
/**
|
|
12425
12359
|
* The form control name can be assigned here if you want to use Reactive Forms.
|
|
12426
12360
|
*/
|
|
@@ -12510,7 +12444,7 @@ class QdInputComponent {
|
|
|
12510
12444
|
if (!this.hasOptions)
|
|
12511
12445
|
return;
|
|
12512
12446
|
if (this.isOptionsOpen) {
|
|
12513
|
-
this.
|
|
12447
|
+
this._keyboardService.handleKeydown(event);
|
|
12514
12448
|
return;
|
|
12515
12449
|
}
|
|
12516
12450
|
event.preventDefault();
|
|
@@ -12519,7 +12453,7 @@ class QdInputComponent {
|
|
|
12519
12453
|
selectActiveOption() {
|
|
12520
12454
|
if (!this.isOptionsOpen)
|
|
12521
12455
|
return;
|
|
12522
|
-
const option = this.
|
|
12456
|
+
const option = this._keyboardService.pickActiveOption();
|
|
12523
12457
|
if (!option?.value)
|
|
12524
12458
|
return;
|
|
12525
12459
|
this.handleOptionSelected(option);
|
|
@@ -12544,8 +12478,8 @@ class QdInputComponent {
|
|
|
12544
12478
|
inputElement;
|
|
12545
12479
|
popover;
|
|
12546
12480
|
isOptionsOpen = false;
|
|
12547
|
-
filteredOptions$ = this.
|
|
12548
|
-
optionsRequestState$ = this.
|
|
12481
|
+
filteredOptions$ = this._optionsService.filteredOptions$;
|
|
12482
|
+
optionsRequestState$ = this._optionsService.delayedRequestState$;
|
|
12549
12483
|
QdFormOptionsRequestState = QdFormOptionsRequestState;
|
|
12550
12484
|
inputType;
|
|
12551
12485
|
inputMode;
|
|
@@ -12575,16 +12509,16 @@ class QdInputComponent {
|
|
|
12575
12509
|
return this._optionsResolver?.requestErrorHint?.i18n || 'i18n.qd.input.options.error';
|
|
12576
12510
|
}
|
|
12577
12511
|
get hasUnits() {
|
|
12578
|
-
return this.config?.units?.length > 0;
|
|
12512
|
+
return (this.config?.units?.length ?? 0) > 0;
|
|
12579
12513
|
}
|
|
12580
12514
|
get ambiguityHintKey() {
|
|
12581
|
-
return this.
|
|
12515
|
+
return this._numberInputService.getAmbiguityHintKey(this._value.value);
|
|
12582
12516
|
}
|
|
12583
12517
|
get isAmbiguousInput() {
|
|
12584
12518
|
return (this.inputType === 'number' &&
|
|
12585
12519
|
!this.hasError &&
|
|
12586
12520
|
this._isUserTyped &&
|
|
12587
|
-
this.
|
|
12521
|
+
this._numberInputService.isAmbiguous(this._value.value));
|
|
12588
12522
|
}
|
|
12589
12523
|
get numberOfCharacters() {
|
|
12590
12524
|
if (!this._value.value)
|
|
@@ -12605,17 +12539,17 @@ class QdInputComponent {
|
|
|
12605
12539
|
const value = this._value.value;
|
|
12606
12540
|
if (value == null || value === '')
|
|
12607
12541
|
return [null];
|
|
12608
|
-
const displayValue = this.inputType === 'number' ? this.
|
|
12542
|
+
const displayValue = this.inputType === 'number' ? this._numberInputService.formatNumberForViewonly(value) : value;
|
|
12609
12543
|
return [`${displayValue}${this._value.unit ? ' ' + this.getUnitLabel(this._value.unit) : ''}`];
|
|
12610
12544
|
}
|
|
12611
12545
|
ngOnInit() {
|
|
12612
12546
|
this.subscribeToOptions();
|
|
12613
|
-
this.
|
|
12614
|
-
this._optionsResolver = this.
|
|
12547
|
+
this._optionsService.initialize(this.config);
|
|
12548
|
+
this._optionsResolver = this._resolverRegistry.findResolver();
|
|
12615
12549
|
this.updateConfig();
|
|
12616
|
-
if (this.
|
|
12550
|
+
if (this._controlContainer) {
|
|
12617
12551
|
if (this.formControlName) {
|
|
12618
|
-
this.control = this.
|
|
12552
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
12619
12553
|
// TODO remove logic for support of angular FormControl with angular 20 update
|
|
12620
12554
|
if (!(this.control instanceof QdFormControl))
|
|
12621
12555
|
console.warn('Quadrel Framework | QdInput - Please use the QdFormControl instead of the Angular FormControl.');
|
|
@@ -12628,13 +12562,13 @@ class QdInputComponent {
|
|
|
12628
12562
|
console.error('Quadrel Framework | QdInput - Please use either decimal or numeric when using QdInputType number.');
|
|
12629
12563
|
this.writeValue(this.value ?? getValue(this.config));
|
|
12630
12564
|
this.normalizeInitialControlValueIfNeeded();
|
|
12631
|
-
this.
|
|
12565
|
+
this._actionEmitterService.hintEventEmitter$
|
|
12632
12566
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
12633
12567
|
.subscribe(() => this.clickHint.emit());
|
|
12634
|
-
this.
|
|
12568
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
12635
12569
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
12636
12570
|
.subscribe(() => this.clickReadonly.emit());
|
|
12637
|
-
this.
|
|
12571
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
12638
12572
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
12639
12573
|
.subscribe(() => this.clickViewonly.emit());
|
|
12640
12574
|
this.initOpModeSubscription();
|
|
@@ -12642,7 +12576,7 @@ class QdInputComponent {
|
|
|
12642
12576
|
ngOnChanges(changes) {
|
|
12643
12577
|
if (changes['config']) {
|
|
12644
12578
|
if (!changes['config'].isFirstChange())
|
|
12645
|
-
this.
|
|
12579
|
+
this._optionsService.initialize(this.config);
|
|
12646
12580
|
this.updateConfig();
|
|
12647
12581
|
this.normalizeInitialControlValueIfNeeded();
|
|
12648
12582
|
}
|
|
@@ -12673,7 +12607,7 @@ class QdInputComponent {
|
|
|
12673
12607
|
const input = target;
|
|
12674
12608
|
if (input?.validity?.badInput)
|
|
12675
12609
|
return;
|
|
12676
|
-
const value =
|
|
12610
|
+
const value = input.value;
|
|
12677
12611
|
if (this.inputType === 'number' && value && !this.handleNumberInput(value))
|
|
12678
12612
|
return;
|
|
12679
12613
|
this._isUserTyped = true;
|
|
@@ -12684,12 +12618,12 @@ class QdInputComponent {
|
|
|
12684
12618
|
this._onTouch();
|
|
12685
12619
|
}
|
|
12686
12620
|
handleNumberInput(value) {
|
|
12687
|
-
if (!this.
|
|
12621
|
+
if (!this._numberInputService.isValidNumber(value)) {
|
|
12688
12622
|
this.setInvalidCharactersError();
|
|
12689
12623
|
return false;
|
|
12690
12624
|
}
|
|
12691
|
-
const valueWithoutGroups = value.split(this.
|
|
12692
|
-
const filtered = this.
|
|
12625
|
+
const valueWithoutGroups = value.split(this._numberInputService.groupSeparator).join('');
|
|
12626
|
+
const filtered = this._numberInputService.filterValue(valueWithoutGroups);
|
|
12693
12627
|
if (filtered !== valueWithoutGroups) {
|
|
12694
12628
|
this._value = { ...this._value, value: filtered };
|
|
12695
12629
|
this.setInvalidCharactersError();
|
|
@@ -12706,7 +12640,7 @@ class QdInputComponent {
|
|
|
12706
12640
|
return;
|
|
12707
12641
|
this.control.setErrors({
|
|
12708
12642
|
...this.control.errors,
|
|
12709
|
-
invalidCharacters: this.
|
|
12643
|
+
invalidCharacters: this._numberInputService.invalidCharactersErrorKey
|
|
12710
12644
|
});
|
|
12711
12645
|
}
|
|
12712
12646
|
clearInvalidCharactersError() {
|
|
@@ -12729,7 +12663,7 @@ class QdInputComponent {
|
|
|
12729
12663
|
this.isOptionsOpen = false;
|
|
12730
12664
|
}
|
|
12731
12665
|
handleUnitChange(unit) {
|
|
12732
|
-
this._value = { ...this._value, unit };
|
|
12666
|
+
this._value = { ...this._value, unit: unit };
|
|
12733
12667
|
this.emitValue();
|
|
12734
12668
|
}
|
|
12735
12669
|
handleInputFocus() {
|
|
@@ -12780,7 +12714,7 @@ class QdInputComponent {
|
|
|
12780
12714
|
if (this.inputType === 'number') {
|
|
12781
12715
|
this.htmlInputType = 'text';
|
|
12782
12716
|
if (!this.inputMode) {
|
|
12783
|
-
this.inputMode = isConfirmedNonIOS() ? 'decimal' :
|
|
12717
|
+
this.inputMode = isConfirmedNonIOS() ? 'decimal' : null;
|
|
12784
12718
|
}
|
|
12785
12719
|
}
|
|
12786
12720
|
else {
|
|
@@ -12797,13 +12731,13 @@ class QdInputComponent {
|
|
|
12797
12731
|
this.disabled = getDisabled(this.config) || !!this.control?.disabled;
|
|
12798
12732
|
this.clearable = !this.disabled && getClearable(this.config);
|
|
12799
12733
|
this.hasAutofocus = getHasAutofocus(this.config);
|
|
12800
|
-
this.hasOptions = this.
|
|
12734
|
+
this.hasOptions = this._optionsService.hasOptions();
|
|
12801
12735
|
}
|
|
12802
12736
|
subscribeToOptions() {
|
|
12803
|
-
this.
|
|
12737
|
+
this._optionsService.filteredOptions$
|
|
12804
12738
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
12805
12739
|
.subscribe(options => (this._filteredOptions = options));
|
|
12806
|
-
this.
|
|
12740
|
+
this._optionsService.optionsResolved$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(event => {
|
|
12807
12741
|
this.optionsResolved.emit(event);
|
|
12808
12742
|
const currentOption = event.options.find(option => option.value === this._value.value);
|
|
12809
12743
|
if (currentOption)
|
|
@@ -12813,8 +12747,8 @@ class QdInputComponent {
|
|
|
12813
12747
|
loadOptionsForTypedValue(value) {
|
|
12814
12748
|
if (!this.hasOptions)
|
|
12815
12749
|
return;
|
|
12816
|
-
this.
|
|
12817
|
-
if (this.
|
|
12750
|
+
this._optionsService.load(value);
|
|
12751
|
+
if (this._optionsService.hasResolver() || this._filteredOptions.length > 0) {
|
|
12818
12752
|
this.popover?.open();
|
|
12819
12753
|
}
|
|
12820
12754
|
else {
|
|
@@ -12823,10 +12757,12 @@ class QdInputComponent {
|
|
|
12823
12757
|
}
|
|
12824
12758
|
getUnitLabel(unit) {
|
|
12825
12759
|
const unitOption = this.config?.units?.find(option => option.value === unit);
|
|
12826
|
-
return unitOption ? this.
|
|
12760
|
+
return unitOption ? this._translateService.instant(unitOption.i18n) : unit;
|
|
12827
12761
|
}
|
|
12828
12762
|
emittableValue() {
|
|
12829
|
-
const emittable = this.inputType === 'number'
|
|
12763
|
+
const emittable = this.inputType === 'number'
|
|
12764
|
+
? this._numberInputService.parseValue(this._value.value)
|
|
12765
|
+
: this._value.value;
|
|
12830
12766
|
return this.hasUnits ? { ...this._value, value: emittable } : emittable;
|
|
12831
12767
|
}
|
|
12832
12768
|
emitValue() {
|
|
@@ -12835,9 +12771,9 @@ class QdInputComponent {
|
|
|
12835
12771
|
this._onChange(emittable);
|
|
12836
12772
|
}
|
|
12837
12773
|
initOpModeSubscription() {
|
|
12838
|
-
if (!this.
|
|
12774
|
+
if (!this._eventBrokerService)
|
|
12839
12775
|
return;
|
|
12840
|
-
this.
|
|
12776
|
+
this._eventBrokerService
|
|
12841
12777
|
.consume('operation_mode_changed')
|
|
12842
12778
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
12843
12779
|
.subscribe(topic => {
|
|
@@ -12863,7 +12799,10 @@ class QdInputComponent {
|
|
|
12863
12799
|
}
|
|
12864
12800
|
applyDisplayFormat() {
|
|
12865
12801
|
if (this.inputType === 'number') {
|
|
12866
|
-
this._value = {
|
|
12802
|
+
this._value = {
|
|
12803
|
+
...this._value,
|
|
12804
|
+
value: this._numberInputService.formatValueForDisplay(this._value.value)
|
|
12805
|
+
};
|
|
12867
12806
|
this._displayValue = String(this._value.value ?? '');
|
|
12868
12807
|
}
|
|
12869
12808
|
}
|
|
@@ -12992,7 +12931,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
12992
12931
|
args: [QdPopoverOnClickDirective]
|
|
12993
12932
|
}] } });
|
|
12994
12933
|
|
|
12995
|
-
// @ts-strict-ignore
|
|
12996
12934
|
const DEFAULT_LANGUAGE = 'de';
|
|
12997
12935
|
/**
|
|
12998
12936
|
* The **QdDatepicker** component provides a FormElement that can be used to select a date.<br />
|
|
@@ -13026,13 +12964,12 @@ const DEFAULT_LANGUAGE = 'de';
|
|
|
13026
12964
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
13027
12965
|
*/
|
|
13028
12966
|
class QdDatepickerComponent {
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
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 });
|
|
13036
12973
|
/**
|
|
13037
12974
|
* Configuration object
|
|
13038
12975
|
*
|
|
@@ -13076,7 +13013,7 @@ class QdDatepickerComponent {
|
|
|
13076
13013
|
/**
|
|
13077
13014
|
* Emits event when the value has changed.
|
|
13078
13015
|
* Return value matches the current value.
|
|
13079
|
-
* * Output format: Javascript Date object.
|
|
13016
|
+
* * Output format: Javascript Date object, or `null` when the field is cleared or the input is invalid.
|
|
13080
13017
|
*/
|
|
13081
13018
|
valueChange = new EventEmitter();
|
|
13082
13019
|
/**
|
|
@@ -13100,7 +13037,7 @@ class QdDatepickerComponent {
|
|
|
13100
13037
|
*/
|
|
13101
13038
|
clickViewonly = new EventEmitter();
|
|
13102
13039
|
popover;
|
|
13103
|
-
|
|
13040
|
+
_hostRef = inject(ElementRef);
|
|
13104
13041
|
readonly = false;
|
|
13105
13042
|
viewonly = false;
|
|
13106
13043
|
hintAction = false;
|
|
@@ -13129,7 +13066,7 @@ class QdDatepickerComponent {
|
|
|
13129
13066
|
_onChange = () => { };
|
|
13130
13067
|
_onTouched = () => { };
|
|
13131
13068
|
ngOnInit() {
|
|
13132
|
-
this.language = this.
|
|
13069
|
+
this.language = this._translateService?.currentLang ?? DEFAULT_LANGUAGE;
|
|
13133
13070
|
this.subscribeToLanguageChange();
|
|
13134
13071
|
this.subscribeToActionEmitterEvents();
|
|
13135
13072
|
this.initControl();
|
|
@@ -13139,7 +13076,7 @@ class QdDatepickerComponent {
|
|
|
13139
13076
|
this.initOpModeSubscription();
|
|
13140
13077
|
}
|
|
13141
13078
|
ngOnChanges(changes) {
|
|
13142
|
-
if (changes
|
|
13079
|
+
if (changes['config']) {
|
|
13143
13080
|
this.updateConfiguration();
|
|
13144
13081
|
}
|
|
13145
13082
|
}
|
|
@@ -13158,7 +13095,7 @@ class QdDatepickerComponent {
|
|
|
13158
13095
|
this.displayedDate = date ? QdDateAdapter.formatToDateLocaleString(date) : '';
|
|
13159
13096
|
this.displayedDateTime = date ? QdDateAdapter.formatToDateTimeLocaleString(date, this.config?.enableSeconds) : '';
|
|
13160
13097
|
this.displayedTime = date ? QdDateAdapter.formatToTimeLocaleString(date, this.config?.enableSeconds) : '';
|
|
13161
|
-
this.
|
|
13098
|
+
this._changeDetectorRef.detectChanges();
|
|
13162
13099
|
}
|
|
13163
13100
|
setDisabledState(disabled) {
|
|
13164
13101
|
this.disabled = disabled;
|
|
@@ -13178,7 +13115,7 @@ class QdDatepickerComponent {
|
|
|
13178
13115
|
this.popover?.close();
|
|
13179
13116
|
}
|
|
13180
13117
|
focusToggle() {
|
|
13181
|
-
const toggle = this.
|
|
13118
|
+
const toggle = this._hostRef.nativeElement.querySelector('.datepicker-toggle');
|
|
13182
13119
|
toggle?.focus();
|
|
13183
13120
|
}
|
|
13184
13121
|
handleUpdatedDate($rawValue) {
|
|
@@ -13187,20 +13124,20 @@ class QdDatepickerComponent {
|
|
|
13187
13124
|
this.displayedDate = '';
|
|
13188
13125
|
this._onChange(null);
|
|
13189
13126
|
this._onTouched(null);
|
|
13190
|
-
this.
|
|
13127
|
+
this.emitValueChange(null);
|
|
13191
13128
|
this.popover?.close();
|
|
13192
|
-
if (!this.
|
|
13129
|
+
if (!this._controlContainer)
|
|
13193
13130
|
this.control.setValue(null);
|
|
13194
13131
|
return;
|
|
13195
13132
|
}
|
|
13196
13133
|
if (!this.isValidDateInput($event)) {
|
|
13197
13134
|
this._onChange('Invalid Date');
|
|
13198
13135
|
this._onTouched('Invalid Date');
|
|
13199
|
-
if (!this.
|
|
13136
|
+
if (!this._controlContainer) {
|
|
13200
13137
|
this.control.setValue('Invalid Date');
|
|
13201
13138
|
this.control.markAsTouched();
|
|
13202
13139
|
}
|
|
13203
|
-
this.
|
|
13140
|
+
this.emitValueChange(null);
|
|
13204
13141
|
this.popover?.close();
|
|
13205
13142
|
return;
|
|
13206
13143
|
}
|
|
@@ -13223,7 +13160,7 @@ class QdDatepickerComponent {
|
|
|
13223
13160
|
this._onChange(newDate);
|
|
13224
13161
|
this._onTouched(newDate);
|
|
13225
13162
|
this.valueChange.emit(newDate);
|
|
13226
|
-
if (!this.
|
|
13163
|
+
if (!this._controlContainer)
|
|
13227
13164
|
this.control.setValue(newDate);
|
|
13228
13165
|
this.closeCalendar();
|
|
13229
13166
|
}
|
|
@@ -13258,11 +13195,11 @@ class QdDatepickerComponent {
|
|
|
13258
13195
|
if (!this.isValidDateTimeInput($event)) {
|
|
13259
13196
|
this._onChange('Invalid Date');
|
|
13260
13197
|
this._onTouched('Invalid Date');
|
|
13261
|
-
if (!this.
|
|
13198
|
+
if (!this._controlContainer) {
|
|
13262
13199
|
this.control.setValue('Invalid Date');
|
|
13263
13200
|
this.control.markAsTouched();
|
|
13264
13201
|
}
|
|
13265
|
-
this.
|
|
13202
|
+
this.emitValueChange(null);
|
|
13266
13203
|
this.popover?.close();
|
|
13267
13204
|
return;
|
|
13268
13205
|
}
|
|
@@ -13272,29 +13209,30 @@ class QdDatepickerComponent {
|
|
|
13272
13209
|
this.displayedDate = QdDateAdapter.formatToDateLocaleString(parsed);
|
|
13273
13210
|
this.displayedTime = QdDateAdapter.formatToTimeLocaleString(parsed, this.config?.enableSeconds);
|
|
13274
13211
|
this.displayedDateTime = $event;
|
|
13275
|
-
this.
|
|
13276
|
-
if (!this.
|
|
13212
|
+
this.emitValueChange(parsed);
|
|
13213
|
+
if (!this._controlContainer)
|
|
13277
13214
|
this.control.setValue(parsed);
|
|
13278
13215
|
this.popover?.close();
|
|
13279
13216
|
}
|
|
13217
|
+
emitValueChange(value) {
|
|
13218
|
+
this.valueChange.emit(value);
|
|
13219
|
+
}
|
|
13280
13220
|
subscribeToLanguageChange() {
|
|
13281
|
-
this.
|
|
13282
|
-
.pipe(tap(({ lang }) => (this.language = lang)), tap(() => this.control.updateValueAndValidity()), takeUntilDestroyed(this._destroyRef))
|
|
13283
|
-
.subscribe();
|
|
13221
|
+
this._translateService.onLangChange.pipe(tap(({ lang }) => (this.language = lang)), tap(() => this.control.updateValueAndValidity()), takeUntilDestroyed(this._destroyRef)).subscribe();
|
|
13284
13222
|
}
|
|
13285
13223
|
subscribeToActionEmitterEvents() {
|
|
13286
|
-
this.
|
|
13224
|
+
this._actionEmitterService.hintEventEmitter$
|
|
13287
13225
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
13288
13226
|
.subscribe(() => this.clickHint.emit());
|
|
13289
|
-
this.
|
|
13227
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
13290
13228
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
13291
13229
|
.subscribe(() => this.clickReadonly.emit());
|
|
13292
|
-
this.
|
|
13230
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
13293
13231
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
13294
13232
|
.subscribe(() => this.clickViewonly.emit());
|
|
13295
13233
|
}
|
|
13296
13234
|
initControl() {
|
|
13297
|
-
if (!this.
|
|
13235
|
+
if (!this._controlContainer) {
|
|
13298
13236
|
this.initInnerControl();
|
|
13299
13237
|
if (!this.value)
|
|
13300
13238
|
return;
|
|
@@ -13302,7 +13240,7 @@ class QdDatepickerComponent {
|
|
|
13302
13240
|
return;
|
|
13303
13241
|
}
|
|
13304
13242
|
if (this.formControlName) {
|
|
13305
|
-
this.control = this.
|
|
13243
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
13306
13244
|
}
|
|
13307
13245
|
else {
|
|
13308
13246
|
console.warn('Quadrel Framework | QdDatepicker - Missing FormControlName directive from host element of the component.');
|
|
@@ -13322,7 +13260,7 @@ class QdDatepickerComponent {
|
|
|
13322
13260
|
this.viewonlyAction = getViewonlyAction(this.config);
|
|
13323
13261
|
this.disabled = getDisabled(this.config) || !!this.control?.disabled;
|
|
13324
13262
|
if (this.config?.timePicker) {
|
|
13325
|
-
this.timePicker = this.
|
|
13263
|
+
this.timePicker = this._timePickerService.getConfig({
|
|
13326
13264
|
...this.config.timePicker,
|
|
13327
13265
|
viewonly: this.viewonly
|
|
13328
13266
|
});
|
|
@@ -13403,7 +13341,7 @@ class QdDatepickerComponent {
|
|
|
13403
13341
|
this.control.updateValueAndValidity();
|
|
13404
13342
|
}
|
|
13405
13343
|
if (this.config?.disabledDates && this.config?.disabledDatesValidation) {
|
|
13406
|
-
const hasCustomErrorKey = (disabledDatesValidation) => disabledDatesValidation.errorKey;
|
|
13344
|
+
const hasCustomErrorKey = (disabledDatesValidation) => !!disabledDatesValidation.errorKey;
|
|
13407
13345
|
this._disabledDatesValidator = hasCustomErrorKey(this.config.disabledDatesValidation)
|
|
13408
13346
|
? QdValidators.disabledDates(this.config.disabledDates, this.config.disabledDatesValidation.errorKey)
|
|
13409
13347
|
: QdValidators.disabledDates(this.config.disabledDates);
|
|
@@ -13419,7 +13357,7 @@ class QdDatepickerComponent {
|
|
|
13419
13357
|
this.control.updateValueAndValidity();
|
|
13420
13358
|
}
|
|
13421
13359
|
if (this.config?.timePicker?.disabledTimes && this.config?.timePicker?.disabledTimesValidation) {
|
|
13422
|
-
const hasCustomErrorKey = (disabledTimesValidation) => disabledTimesValidation.errorKey;
|
|
13360
|
+
const hasCustomErrorKey = (disabledTimesValidation) => !!disabledTimesValidation.errorKey;
|
|
13423
13361
|
this._disabledTimesValidator = hasCustomErrorKey(this.config?.timePicker?.disabledTimesValidation)
|
|
13424
13362
|
? QdValidators.disabledTimes(this.config.timePicker?.disabledTimes, this.config.timePicker?.disabledTimesValidation.errorKey)
|
|
13425
13363
|
: QdValidators.disabledTimes(this.config.timePicker?.disabledTimes);
|
|
@@ -13435,9 +13373,9 @@ class QdDatepickerComponent {
|
|
|
13435
13373
|
this.isValidDateInput(formatted));
|
|
13436
13374
|
}
|
|
13437
13375
|
initOpModeSubscription() {
|
|
13438
|
-
if (!this.
|
|
13376
|
+
if (!this._eventBrokerService)
|
|
13439
13377
|
return;
|
|
13440
|
-
this.
|
|
13378
|
+
this._eventBrokerService
|
|
13441
13379
|
.consume('operation_mode_changed')
|
|
13442
13380
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
13443
13381
|
.subscribe(topic => {
|
|
@@ -13463,7 +13401,7 @@ class QdDatepickerComponent {
|
|
|
13463
13401
|
useValue: true
|
|
13464
13402
|
},
|
|
13465
13403
|
QdFormsActionEmitterService
|
|
13466
|
-
], 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 });
|
|
13467
13405
|
}
|
|
13468
13406
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdDatepickerComponent, decorators: [{
|
|
13469
13407
|
type: Component,
|
|
@@ -13478,7 +13416,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
13478
13416
|
useValue: true
|
|
13479
13417
|
},
|
|
13480
13418
|
QdFormsActionEmitterService
|
|
13481
|
-
], 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"] }]
|
|
13482
13420
|
}], propDecorators: { config: [{
|
|
13483
13421
|
type: Input
|
|
13484
13422
|
}], formControlName: [{
|
|
@@ -13935,14 +13873,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
13935
13873
|
type: Output
|
|
13936
13874
|
}] } });
|
|
13937
13875
|
|
|
13938
|
-
// @ts-strict-ignore
|
|
13939
13876
|
/**
|
|
13940
13877
|
* Holds the selection state of a multi-input: the known options and the
|
|
13941
13878
|
* selected items. Filtering and the visible option list live in
|
|
13942
13879
|
* QdFormOptionsService; labels resolve through QdTranslateService.
|
|
13943
13880
|
*/
|
|
13944
13881
|
class QdMultiInputService {
|
|
13945
|
-
|
|
13882
|
+
_translateService = inject(QdTranslateService);
|
|
13946
13883
|
_optionsListSubject = new BehaviorSubject([]);
|
|
13947
13884
|
_selectedItemsSubject = new BehaviorSubject([]);
|
|
13948
13885
|
optionsList$ = this._optionsListSubject.asObservable();
|
|
@@ -14001,7 +13938,7 @@ class QdMultiInputService {
|
|
|
14001
13938
|
}
|
|
14002
13939
|
}
|
|
14003
13940
|
getTranslation(option) {
|
|
14004
|
-
return this.
|
|
13941
|
+
return this._translateService.translate(option);
|
|
14005
13942
|
}
|
|
14006
13943
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdMultiInputService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
14007
13944
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdMultiInputService });
|
|
@@ -14010,9 +13947,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
14010
13947
|
type: Injectable
|
|
14011
13948
|
}] });
|
|
14012
13949
|
|
|
14013
|
-
// @ts-strict-ignore
|
|
14014
13950
|
class QdMultiInputChipComponent {
|
|
14015
|
-
|
|
13951
|
+
_multiInputService = inject(QdMultiInputService);
|
|
14016
13952
|
itemControl;
|
|
14017
13953
|
value;
|
|
14018
13954
|
close = false;
|
|
@@ -14032,10 +13968,10 @@ class QdMultiInputChipComponent {
|
|
|
14032
13968
|
return 'neutral';
|
|
14033
13969
|
}
|
|
14034
13970
|
get errorMessages() {
|
|
14035
|
-
return Object.values(this.itemControl
|
|
13971
|
+
return Object.values(this.itemControl?.errors ?? {});
|
|
14036
13972
|
}
|
|
14037
13973
|
get chipText() {
|
|
14038
|
-
return this.itemControl ? this.getTranslation(this.itemControl.value) : this.value;
|
|
13974
|
+
return this.itemControl ? this.getTranslation(this.itemControl.value) : this.value ?? '';
|
|
14039
13975
|
}
|
|
14040
13976
|
get title() {
|
|
14041
13977
|
if (this.itemControl) {
|
|
@@ -14046,8 +13982,8 @@ class QdMultiInputChipComponent {
|
|
|
14046
13982
|
}
|
|
14047
13983
|
}
|
|
14048
13984
|
getTranslation(value) {
|
|
14049
|
-
const option = this.
|
|
14050
|
-
return option ? this.
|
|
13985
|
+
const option = this._multiInputService.findOption(value);
|
|
13986
|
+
return option ? this._multiInputService.getTranslation(option) : value;
|
|
14051
13987
|
}
|
|
14052
13988
|
clickClose($event) {
|
|
14053
13989
|
$event.stopPropagation();
|
|
@@ -14900,7 +14836,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
14900
14836
|
args: ['document:click', ['$event']]
|
|
14901
14837
|
}] } });
|
|
14902
14838
|
|
|
14903
|
-
// @ts-strict-ignore
|
|
14904
14839
|
class QdPinCodeService {
|
|
14905
14840
|
_values;
|
|
14906
14841
|
_currentIndex = 0;
|
|
@@ -14988,7 +14923,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
14988
14923
|
type: Injectable
|
|
14989
14924
|
}] });
|
|
14990
14925
|
|
|
14991
|
-
// @ts-strict-ignore
|
|
14992
14926
|
/**
|
|
14993
14927
|
* **QdPinCode** component provides a FormElement.
|
|
14994
14928
|
* The **QdPinCode** is a component that provides a form element for entering a PIN code.<br />
|
|
@@ -15022,11 +14956,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
15022
14956
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
15023
14957
|
*/
|
|
15024
14958
|
class QdPinCodeComponent {
|
|
15025
|
-
|
|
15026
|
-
|
|
15027
|
-
|
|
15028
|
-
|
|
15029
|
-
|
|
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 });
|
|
15030
14964
|
/**
|
|
15031
14965
|
* The form control name can be assigned here if you want to use Reactive Forms.
|
|
15032
14966
|
*/
|
|
@@ -15103,13 +15037,13 @@ class QdPinCodeComponent {
|
|
|
15103
15037
|
_onChange = () => { };
|
|
15104
15038
|
_onTouch = () => { };
|
|
15105
15039
|
get firstEmptyIndex() {
|
|
15106
|
-
return this.
|
|
15040
|
+
return this._pinCodeService.firstEmpty;
|
|
15107
15041
|
}
|
|
15108
15042
|
get joinedValues() {
|
|
15109
|
-
return this.
|
|
15043
|
+
return this._pinCodeService.joinedValues;
|
|
15110
15044
|
}
|
|
15111
15045
|
get errors() {
|
|
15112
|
-
return this.control ? this.control.errors : [];
|
|
15046
|
+
return (this.control ? this.control.errors : []);
|
|
15113
15047
|
}
|
|
15114
15048
|
get required() {
|
|
15115
15049
|
if (!this.control)
|
|
@@ -15118,30 +15052,30 @@ class QdPinCodeComponent {
|
|
|
15118
15052
|
}
|
|
15119
15053
|
ngOnInit() {
|
|
15120
15054
|
this.updateConfiguration();
|
|
15121
|
-
this.
|
|
15122
|
-
this.
|
|
15123
|
-
if (this.
|
|
15055
|
+
this._pinCodeService.codeLength = this.codeLength;
|
|
15056
|
+
this._pinCodeService.values = (this.value ?? this.config?.value)?.split('') ?? [];
|
|
15057
|
+
if (this._controlContainer) {
|
|
15124
15058
|
if (this.formControlName) {
|
|
15125
|
-
this.control = this.
|
|
15059
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
15126
15060
|
}
|
|
15127
15061
|
else {
|
|
15128
15062
|
console.warn('Quadrel Framework | QdPinCode - Missing FormControlName directive from host element of the component.');
|
|
15129
15063
|
}
|
|
15130
15064
|
}
|
|
15131
|
-
this.
|
|
15065
|
+
this._actionEmitterService.hintEventEmitter$
|
|
15132
15066
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15133
15067
|
.subscribe(() => this.clickHint.emit());
|
|
15134
|
-
this.
|
|
15068
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
15135
15069
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15136
15070
|
.subscribe(() => this.clickReadonly.emit());
|
|
15137
|
-
this.
|
|
15071
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
15138
15072
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15139
15073
|
.subscribe(() => this.clickViewonly.emit());
|
|
15140
15074
|
this.initOpModeSubscription();
|
|
15141
15075
|
}
|
|
15142
15076
|
ngAfterViewInit() {
|
|
15143
15077
|
this.getInputs();
|
|
15144
|
-
this.fillInputs(this.
|
|
15078
|
+
this.fillInputs(this._pinCodeService.values);
|
|
15145
15079
|
this.focusFirstOnInit();
|
|
15146
15080
|
}
|
|
15147
15081
|
ngOnChanges(changes) {
|
|
@@ -15167,14 +15101,14 @@ class QdPinCodeComponent {
|
|
|
15167
15101
|
return;
|
|
15168
15102
|
if (!this.isNumericOrLatin(values))
|
|
15169
15103
|
return;
|
|
15170
|
-
this.
|
|
15104
|
+
this._pinCodeService.addValues(values);
|
|
15171
15105
|
}
|
|
15172
15106
|
setDisabledState(disabled) {
|
|
15173
15107
|
this.disabled = disabled;
|
|
15174
15108
|
}
|
|
15175
15109
|
handleCLick($event) {
|
|
15176
15110
|
$event.preventDefault();
|
|
15177
|
-
if (!this.
|
|
15111
|
+
if (!this._pinCodeService.allFilled) {
|
|
15178
15112
|
this.focusFirstEmpty();
|
|
15179
15113
|
return;
|
|
15180
15114
|
}
|
|
@@ -15182,11 +15116,11 @@ class QdPinCodeComponent {
|
|
|
15182
15116
|
}
|
|
15183
15117
|
handleDelete($event) {
|
|
15184
15118
|
$event.preventDefault();
|
|
15185
|
-
this._inputs[this.
|
|
15119
|
+
this._inputs[this._pinCodeService.currentIndex].value = '';
|
|
15186
15120
|
this.handlePrevious();
|
|
15187
|
-
this._onChange(this.
|
|
15188
|
-
this._onTouch(this.
|
|
15189
|
-
this.valueChange.emit(this.
|
|
15121
|
+
this._onChange(this._pinCodeService.joinedValues);
|
|
15122
|
+
this._onTouch(this._pinCodeService.joinedValues);
|
|
15123
|
+
this.valueChange.emit(this._pinCodeService.joinedValues);
|
|
15190
15124
|
}
|
|
15191
15125
|
handleInput($event) {
|
|
15192
15126
|
$event.preventDefault();
|
|
@@ -15199,24 +15133,24 @@ class QdPinCodeComponent {
|
|
|
15199
15133
|
}
|
|
15200
15134
|
if (!this.isNumericOrLatin(value))
|
|
15201
15135
|
return;
|
|
15202
|
-
this._inputs[this.
|
|
15203
|
-
this.
|
|
15204
|
-
this.
|
|
15136
|
+
this._inputs[this._pinCodeService.currentIndex].value = value;
|
|
15137
|
+
this._pinCodeService.filledTill = this._pinCodeService.currentIndex;
|
|
15138
|
+
this._pinCodeService.addValue(value);
|
|
15205
15139
|
this.handleNext();
|
|
15206
|
-
this._onChange(this.
|
|
15207
|
-
this._onTouch(this.
|
|
15208
|
-
this.valueChange.emit(this.
|
|
15140
|
+
this._onChange(this._pinCodeService.joinedValues);
|
|
15141
|
+
this._onTouch(this._pinCodeService.joinedValues);
|
|
15142
|
+
this.valueChange.emit(this._pinCodeService.joinedValues);
|
|
15209
15143
|
}
|
|
15210
15144
|
handleBlur(index) {
|
|
15211
15145
|
this.blurCurrent = false;
|
|
15212
|
-
if (this.
|
|
15146
|
+
if (this._pinCodeService.currentIndex === index) {
|
|
15213
15147
|
this.blurCurrent = true;
|
|
15214
15148
|
this.checkError();
|
|
15215
15149
|
}
|
|
15216
15150
|
}
|
|
15217
15151
|
handleComplete() {
|
|
15218
|
-
if (this.
|
|
15219
|
-
this.completed.emit(this.
|
|
15152
|
+
if (this._pinCodeService.allFilled) {
|
|
15153
|
+
this.completed.emit(this._pinCodeService.joinedValues);
|
|
15220
15154
|
this.blurAll();
|
|
15221
15155
|
return;
|
|
15222
15156
|
}
|
|
@@ -15247,9 +15181,9 @@ class QdPinCodeComponent {
|
|
|
15247
15181
|
if (!this.inputsList)
|
|
15248
15182
|
return;
|
|
15249
15183
|
this.control?.markAsPristine();
|
|
15250
|
-
this.
|
|
15251
|
-
this.
|
|
15252
|
-
this.
|
|
15184
|
+
this._pinCodeService.reset();
|
|
15185
|
+
this._controlContainer?.reset();
|
|
15186
|
+
this._pinCodeService.codeLength = this.codeLength;
|
|
15253
15187
|
if (this._isSubscribedToInputChanges)
|
|
15254
15188
|
return;
|
|
15255
15189
|
this._isSubscribedToInputChanges = true;
|
|
@@ -15269,13 +15203,13 @@ class QdPinCodeComponent {
|
|
|
15269
15203
|
this._inputs[0]?.focus();
|
|
15270
15204
|
}
|
|
15271
15205
|
focusCurrent() {
|
|
15272
|
-
this._inputs[this.
|
|
15206
|
+
this._inputs[this._pinCodeService.currentIndex].focus();
|
|
15273
15207
|
}
|
|
15274
15208
|
focusFirstEmpty() {
|
|
15275
|
-
if (this.
|
|
15209
|
+
if (this._pinCodeService.firstEmpty === -1)
|
|
15276
15210
|
return;
|
|
15277
|
-
this._inputs[this.
|
|
15278
|
-
this.
|
|
15211
|
+
this._inputs[this._pinCodeService.firstEmpty]?.focus();
|
|
15212
|
+
this._pinCodeService.currentIndex = this._pinCodeService.firstEmpty;
|
|
15279
15213
|
}
|
|
15280
15214
|
focusFirstOnInit() {
|
|
15281
15215
|
if (this.focusOnInit)
|
|
@@ -15300,12 +15234,12 @@ class QdPinCodeComponent {
|
|
|
15300
15234
|
this.emptyAll();
|
|
15301
15235
|
this.focusFirst();
|
|
15302
15236
|
this.handleInputsWhenPaste(this.getClipboardText($event).toUpperCase().split(''));
|
|
15303
|
-
this.
|
|
15237
|
+
this._pinCodeService.addValues(this.getClipboardText($event));
|
|
15304
15238
|
this.focusFirstEmpty();
|
|
15305
15239
|
this.handleComplete();
|
|
15306
|
-
this._onChange(this.
|
|
15307
|
-
this._onTouch(this.
|
|
15308
|
-
this.valueChange.emit(this.
|
|
15240
|
+
this._onChange(this._pinCodeService.joinedValues);
|
|
15241
|
+
this._onTouch(this._pinCodeService.joinedValues);
|
|
15242
|
+
this.valueChange.emit(this._pinCodeService.joinedValues);
|
|
15309
15243
|
}
|
|
15310
15244
|
matchPastedTextPattern($event) {
|
|
15311
15245
|
return this.getClipboardText($event)
|
|
@@ -15313,14 +15247,14 @@ class QdPinCodeComponent {
|
|
|
15313
15247
|
.every(item => (this.digitsOnly && this.isNumeric(item)) || (!this.digitsOnly && this.isNumericOrLatin(item)));
|
|
15314
15248
|
}
|
|
15315
15249
|
isInitialTextNumeric(text) {
|
|
15316
|
-
return text.split('').every(element => this.isNumeric(element));
|
|
15250
|
+
return text.split('').every((element) => this.isNumeric(element));
|
|
15317
15251
|
}
|
|
15318
15252
|
getClipboardText($event) {
|
|
15319
15253
|
return $event.clipboardData.getData('text');
|
|
15320
15254
|
}
|
|
15321
15255
|
handleInputsWhenPaste(codeList) {
|
|
15322
15256
|
this.fillInputs(codeList);
|
|
15323
|
-
this.
|
|
15257
|
+
this._pinCodeService.filledTill =
|
|
15324
15258
|
this._inputs.length < codeList.length ? this._inputs.length - 1 : codeList.length - 1;
|
|
15325
15259
|
}
|
|
15326
15260
|
fillInputs(codeList) {
|
|
@@ -15336,11 +15270,11 @@ class QdPinCodeComponent {
|
|
|
15336
15270
|
return key === 'Enter';
|
|
15337
15271
|
}
|
|
15338
15272
|
handlePrevious() {
|
|
15339
|
-
this.
|
|
15273
|
+
this._pinCodeService.stepPrevious();
|
|
15340
15274
|
this.focusCurrent();
|
|
15341
15275
|
}
|
|
15342
15276
|
handleNext() {
|
|
15343
|
-
this.
|
|
15277
|
+
this._pinCodeService.stepNext();
|
|
15344
15278
|
this.focusCurrent();
|
|
15345
15279
|
}
|
|
15346
15280
|
setErrorDigitsOnly() {
|
|
@@ -15350,9 +15284,9 @@ class QdPinCodeComponent {
|
|
|
15350
15284
|
this.triggerValidation();
|
|
15351
15285
|
}
|
|
15352
15286
|
initOpModeSubscription() {
|
|
15353
|
-
if (!this.
|
|
15287
|
+
if (!this._eventBrokerService)
|
|
15354
15288
|
return;
|
|
15355
|
-
this.
|
|
15289
|
+
this._eventBrokerService
|
|
15356
15290
|
.consume('operation_mode_changed')
|
|
15357
15291
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15358
15292
|
.subscribe(topic => {
|
|
@@ -15434,9 +15368,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
15434
15368
|
args: ['paste', ['$event']]
|
|
15435
15369
|
}] } });
|
|
15436
15370
|
|
|
15437
|
-
// @ts-strict-ignore
|
|
15438
15371
|
class QdRadioButtonsService {
|
|
15439
|
-
|
|
15372
|
+
_translateService = inject(TranslateService);
|
|
15440
15373
|
radioButtonsList;
|
|
15441
15374
|
radioButtonsListForView;
|
|
15442
15375
|
setRadioButtonsList(radioButtons) {
|
|
@@ -15461,7 +15394,7 @@ class QdRadioButtonsService {
|
|
|
15461
15394
|
}
|
|
15462
15395
|
const radioButtonsListWithTranslation = this.radioButtonsList.map((radioButton) => ({
|
|
15463
15396
|
...radioButton,
|
|
15464
|
-
translation: this.
|
|
15397
|
+
translation: this._translateService.instant(radioButton.i18n)
|
|
15465
15398
|
}));
|
|
15466
15399
|
this.radioButtonsListForView = this.radioButtonsList.filter((_radioButton, index) => radioButtonsListWithTranslation[index].translation.toLowerCase().includes(value.toLowerCase()));
|
|
15467
15400
|
}
|
|
@@ -15472,7 +15405,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
15472
15405
|
type: Injectable
|
|
15473
15406
|
}] });
|
|
15474
15407
|
|
|
15475
|
-
// @ts-strict-ignore
|
|
15476
15408
|
/**
|
|
15477
15409
|
* The **QdRadioButtons** is a component that provides a form element for radio buttons.<br />
|
|
15478
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.
|
|
@@ -15505,12 +15437,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
15505
15437
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
15506
15438
|
*/
|
|
15507
15439
|
class QdRadioButtonsComponent {
|
|
15508
|
-
|
|
15509
|
-
|
|
15510
|
-
|
|
15511
|
-
|
|
15512
|
-
|
|
15513
|
-
keyboardDetection = inject(QdKeyboardDetectionService);
|
|
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 });
|
|
15514
15445
|
/**
|
|
15515
15446
|
* The current form item value, if you are working with Model Binding.
|
|
15516
15447
|
*
|
|
@@ -15578,7 +15509,7 @@ class QdRadioButtonsComponent {
|
|
|
15578
15509
|
return this.control ? this.control.touched && this.control.invalid : false;
|
|
15579
15510
|
}
|
|
15580
15511
|
get hasHint() {
|
|
15581
|
-
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);
|
|
15582
15513
|
}
|
|
15583
15514
|
get required() {
|
|
15584
15515
|
if (!this.control)
|
|
@@ -15612,22 +15543,22 @@ class QdRadioButtonsComponent {
|
|
|
15612
15543
|
ngOnInit() {
|
|
15613
15544
|
this.updateConfiguration();
|
|
15614
15545
|
this.setInitialValue();
|
|
15615
|
-
if (this.
|
|
15546
|
+
if (this._controlContainer) {
|
|
15616
15547
|
if (this.formControlName) {
|
|
15617
|
-
this.control = this.
|
|
15548
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
15618
15549
|
}
|
|
15619
15550
|
else {
|
|
15620
15551
|
console.warn('Quadrel Framework | QdRadioButtons - Missing FormControlName directive from host element of the component.');
|
|
15621
15552
|
}
|
|
15622
15553
|
}
|
|
15623
15554
|
this.initRadioButtonList();
|
|
15624
|
-
this.
|
|
15555
|
+
this._actionEmitterService.hintEventEmitter$
|
|
15625
15556
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15626
15557
|
.subscribe(() => this.clickHint.emit());
|
|
15627
|
-
this.
|
|
15558
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
15628
15559
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15629
15560
|
.subscribe(() => this.clickReadonly.emit());
|
|
15630
|
-
this.
|
|
15561
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
15631
15562
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15632
15563
|
.subscribe(() => this.clickViewonly.emit());
|
|
15633
15564
|
this.initOpModeSubscription();
|
|
@@ -15659,9 +15590,9 @@ class QdRadioButtonsComponent {
|
|
|
15659
15590
|
this.valueChange.emit(this.value);
|
|
15660
15591
|
}
|
|
15661
15592
|
changeValue($event) {
|
|
15662
|
-
this.
|
|
15663
|
-
this.
|
|
15664
|
-
this.radioButtonsListForView = this.
|
|
15593
|
+
this._radioButtonsService.filterOptions($event);
|
|
15594
|
+
this._ngZone.run(() => {
|
|
15595
|
+
this.radioButtonsListForView = this._radioButtonsService.getRadioButtonsListForView();
|
|
15665
15596
|
});
|
|
15666
15597
|
}
|
|
15667
15598
|
updateConfiguration() {
|
|
@@ -15680,9 +15611,9 @@ class QdRadioButtonsComponent {
|
|
|
15680
15611
|
this.isLabelDisabled = getIsLabelDisabled(this.config);
|
|
15681
15612
|
}
|
|
15682
15613
|
initRadioButtonList() {
|
|
15683
|
-
this.
|
|
15684
|
-
this.
|
|
15685
|
-
this.radioButtonsListForView = this.
|
|
15614
|
+
this._radioButtonsService.setRadioButtonsList(this.options);
|
|
15615
|
+
this._radioButtonsService.setRadioButtonsListForView();
|
|
15616
|
+
this.radioButtonsListForView = this._radioButtonsService.getRadioButtonsListForView();
|
|
15686
15617
|
}
|
|
15687
15618
|
setInitialValue() {
|
|
15688
15619
|
if (this.value)
|
|
@@ -15693,9 +15624,9 @@ class QdRadioButtonsComponent {
|
|
|
15693
15624
|
});
|
|
15694
15625
|
}
|
|
15695
15626
|
initOpModeSubscription() {
|
|
15696
|
-
if (!this.
|
|
15627
|
+
if (!this._eventBrokerService)
|
|
15697
15628
|
return;
|
|
15698
|
-
this.
|
|
15629
|
+
this._eventBrokerService
|
|
15699
15630
|
.consume('operation_mode_changed')
|
|
15700
15631
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
15701
15632
|
.subscribe(topic => {
|
|
@@ -15713,7 +15644,7 @@ class QdRadioButtonsComponent {
|
|
|
15713
15644
|
},
|
|
15714
15645
|
QdRadioButtonsService,
|
|
15715
15646
|
QdFormsActionEmitterService
|
|
15716
|
-
], 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 [isDisabled]=\"isLabelDisabled\"\n></qd-form-label>\n\n@if (filter) {\n<qd-filter-form-items\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId + '-filter-form'\"\n></qd-filter-form-items>\n} @if (!readonly && !viewonly) {\n<div class=\"qd-radio-buttons__button-section\">\n @for (option of radioButtonsListForView; track getOptionId($index, option)) {\n <label\n [for]=\"option.value + id\"\n [ngClass]=\"\n 'qd-radio-buttons__label' +\n (option.disabled || disabled ? ' qd-radio-buttons__label--disabled' : '') +\n (option.value === value ? ' qd-radio-buttons__label--checked' : '')\n \"\n [attr.data-test-id]=\"testId + '-label'\"\n >\n <input\n type=\"radio\"\n qdVisuallyHidden\n [qdAutofocus]=\"hasAutofocus && $index === 0\"\n [id]=\"option.value + id\"\n [ngClass]=\"'qd-radio-buttons__radio-button'\"\n [attr.tabindex]=\"isAriaHidden ? -1 : option.value === tabStopValue ? 0 : -1\"\n [attr.aria-hidden]=\"isAriaHidden ? true : null\"\n [name]=\"id\"\n [value]=\"option.value\"\n [disabled]=\"option.disabled || disabled\"\n (change)=\"handleClick(option.value)\"\n [checked]=\"option.value === value\"\n [attr.data-test-id]=\"testId + '-input-' + option.i18n\"\n />\n @if (option.value === value) {\n <qd-icon\n class=\"qd-radio-buttons__indicator\"\n [icon]=\"'radioButtonChecked'\"\n [attr.data-test-id]=\"testId + '-indicator-checked'\"\n ></qd-icon>\n } @if (option.value !== value) {\n <qd-icon\n class=\"qd-radio-buttons__indicator\"\n [icon]=\"'circle'\"\n [attr.data-test-id]=\"testId + '-indicator-unchecked'\"\n ></qd-icon>\n }\n <span [ngClass]=\"'qd-radio-buttons__caption qd-intersection-target'\">{{ option.i18n | translate }}</span>\n </label>\n }\n</div>\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]=\"activeOptionAsList\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n} @if (viewonly) {\n<qd-form-viewonly\n [values]=\"activeOptionAsList\"\n [viewonlyAction]=\"viewonlyAction\"\n [status]=\"config?.viewonlyStatus\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n}\n", styles: [".qd-radio-buttons{display:block;flex-direction:column;margin-bottom:.75rem}.qd-radio-buttons.qd-radio-align--horizontal .qd-radio-buttons__button-section{display:flex;min-height:2.25rem;flex-wrap:wrap;align-items:center;margin-bottom:.375rem}.qd-radio-buttons.qd-radio-align--horizontal .qd-radio-buttons__label:not(:last-child) .qd-radio-buttons__caption{padding-right:1rem}.qd-radio-buttons.qd-radio-align--vertical .qd-radio-buttons__button-section{display:flex;flex-direction:column;margin-bottom:.375rem}.qd-radio-buttons.qd-radio-align--vertical .qd-radio-buttons__button-section .qd-radio-buttons__caption{flex:auto}.qd-radio-buttons .qd-radio-buttons__label{display:flex;max-width:100%;padding:.625rem 0;color:#454545;cursor:pointer;font-size:.875rem;font-weight:400;line-height:1rem}.qd-radio-buttons .qd-radio-buttons__label .qd-radio-buttons__indicator{position:relative;margin:0 .375rem 0 0;color:#b4b4b4;font-size:1.25rem}.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):hover,.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):focus{color:#171717}.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):hover .qd-radio-buttons__indicator,.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):focus .qd-radio-buttons__indicator{color:#171717}.qd-radio-buttons .qd-radio-buttons__label--checked{color:#171717}.qd-radio-buttons .qd-radio-buttons__label--checked .qd-radio-buttons__indicator{color:#069}.qd-radio-buttons .qd-radio-buttons__label--disabled{color:#d5d5d5;cursor:default}.qd-radio-buttons .qd-radio-buttons__label--disabled .qd-radio-buttons__indicator{color:#d5d5d5}.qd-radio-buttons .qd-radio-buttons__label .qd-radio-buttons__caption{padding:0}.qd-radio-buttons__input-section{margin-bottom:.375rem}@media(max-width:959.98px){.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__button-section{flex-direction:column}.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label{width:100%;padding-top:.0625rem;padding-bottom:.0625rem;padding-left:.75rem;border:.0625rem solid rgb(180,180,180);margin-bottom:.75rem;background:#fff}.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label .qd-radio-buttons__caption{padding-right:.75rem!important;transform:translateY(.0625rem)}}@media(max-width:959.98px)and (max-width:959.98px){.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label .qd-radio-buttons__caption{padding:.375rem .375rem .375rem 0!important;line-height:1.25rem}}@media(max-width:959.98px){.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label:last-child{margin-bottom:0}.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label .qd-radio-buttons__indicator{display:flex;align-items:center}}.qd-
|
|
15647
|
+
], 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 [isDisabled]=\"isLabelDisabled\"\n></qd-form-label>\n\n@if (filter) {\n<qd-filter-form-items\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId + '-filter-form'\"\n></qd-filter-form-items>\n} @if (!readonly && !viewonly) {\n<div class=\"qd-radio-buttons__button-section\">\n @for (option of radioButtonsListForView; track getOptionId($index, option)) {\n <label\n [for]=\"option.value + id\"\n [ngClass]=\"\n 'qd-radio-buttons__label' +\n (option.disabled || disabled ? ' qd-radio-buttons__label--disabled' : '') +\n (option.value === value ? ' qd-radio-buttons__label--checked' : '')\n \"\n [attr.data-test-id]=\"testId + '-label'\"\n >\n <input\n type=\"radio\"\n qdVisuallyHidden\n [qdAutofocus]=\"hasAutofocus && $index === 0\"\n [id]=\"option.value + id\"\n [ngClass]=\"'qd-radio-buttons__radio-button'\"\n [attr.tabindex]=\"isAriaHidden ? -1 : option.value === tabStopValue ? 0 : -1\"\n [attr.aria-hidden]=\"isAriaHidden ? true : null\"\n [name]=\"id\"\n [value]=\"option.value\"\n [disabled]=\"option.disabled || disabled\"\n (change)=\"handleClick(option.value)\"\n [checked]=\"option.value === value\"\n [attr.data-test-id]=\"testId + '-input-' + option.i18n\"\n />\n @if (option.value === value) {\n <qd-icon\n class=\"qd-radio-buttons__indicator\"\n [icon]=\"'radioButtonChecked'\"\n [attr.data-test-id]=\"testId + '-indicator-checked'\"\n ></qd-icon>\n } @if (option.value !== value) {\n <qd-icon\n class=\"qd-radio-buttons__indicator\"\n [icon]=\"'circle'\"\n [attr.data-test-id]=\"testId + '-indicator-unchecked'\"\n ></qd-icon>\n }\n <span [ngClass]=\"'qd-radio-buttons__caption qd-intersection-target'\">{{ option.i18n | translate }}</span>\n </label>\n }\n</div>\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]=\"activeOptionAsList\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n} @if (viewonly) {\n<qd-form-viewonly\n [values]=\"activeOptionAsList\"\n [viewonlyAction]=\"viewonlyAction\"\n [status]=\"config?.viewonlyStatus\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n}\n", styles: [".qd-radio-buttons{display:block;flex-direction:column;margin-bottom:.75rem}.qd-radio-buttons.qd-radio-align--horizontal .qd-radio-buttons__button-section{display:flex;min-height:2.25rem;flex-wrap:wrap;align-items:center;margin-bottom:.375rem}.qd-radio-buttons.qd-radio-align--horizontal .qd-radio-buttons__label:not(:last-child) .qd-radio-buttons__caption{padding-right:1rem}.qd-radio-buttons.qd-radio-align--vertical .qd-radio-buttons__button-section{display:flex;flex-direction:column;margin-bottom:.375rem}.qd-radio-buttons.qd-radio-align--vertical .qd-radio-buttons__button-section .qd-radio-buttons__caption{flex:auto}.qd-radio-buttons .qd-radio-buttons__label{display:flex;max-width:100%;padding:.625rem 0;color:#454545;cursor:pointer;font-size:.875rem;font-weight:400;line-height:1rem}.qd-radio-buttons .qd-radio-buttons__label .qd-radio-buttons__indicator{position:relative;margin:0 .375rem 0 0;color:#b4b4b4;font-size:1.25rem}.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):hover,.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):focus{color:#171717}.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):hover .qd-radio-buttons__indicator,.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):focus .qd-radio-buttons__indicator{color:#171717}.qd-radio-buttons .qd-radio-buttons__label--checked{color:#171717}.qd-radio-buttons .qd-radio-buttons__label--checked .qd-radio-buttons__indicator{color:#069}.qd-radio-buttons .qd-radio-buttons__label--disabled{color:#d5d5d5;cursor:default}.qd-radio-buttons .qd-radio-buttons__label--disabled .qd-radio-buttons__indicator{color:#d5d5d5}.qd-radio-buttons .qd-radio-buttons__label .qd-radio-buttons__caption{padding:0}.qd-radio-buttons__input-section{margin-bottom:.375rem}@media(max-width:959.98px){.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__button-section{flex-direction:column}.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label{width:100%;padding-top:.0625rem;padding-bottom:.0625rem;padding-left:.75rem;border:.0625rem solid rgb(180,180,180);margin-bottom:.75rem;background:#fff}.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label .qd-radio-buttons__caption{padding-right:.75rem!important;transform:translateY(.0625rem)}}@media(max-width:959.98px)and (max-width:959.98px){.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label .qd-radio-buttons__caption{padding:.375rem .375rem .375rem 0!important;line-height:1.25rem}}@media(max-width:959.98px){.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label:last-child{margin-bottom:0}.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label .qd-radio-buttons__indicator{display:flex;align-items:center}}.qd-radio-buttons .qd-radio-buttons__radio-button:focus-visible~.qd-radio-buttons__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%)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: QdAutofocusDirective, selector: "[qdAutofocus]", inputs: ["qdAutofocus"] }, { kind: "directive", type: QdVisuallyHiddenDirective, selector: "[qdVisuallyHidden]" }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "component", type: QdFilterFormItemsComponent, selector: "qd-filter-form-items", inputs: ["inputFilterValue", "data-test-id"], outputs: ["filterValueChange"] }, { 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: "pipe", type: i2.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
15717
15648
|
}
|
|
15718
15649
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdRadioButtonsComponent, decorators: [{
|
|
15719
15650
|
type: Component,
|
|
@@ -15725,7 +15656,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
15725
15656
|
},
|
|
15726
15657
|
QdRadioButtonsService,
|
|
15727
15658
|
QdFormsActionEmitterService
|
|
15728
|
-
], encapsulation: ViewEncapsulation.None, 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 [isDisabled]=\"isLabelDisabled\"\n></qd-form-label>\n\n@if (filter) {\n<qd-filter-form-items\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId + '-filter-form'\"\n></qd-filter-form-items>\n} @if (!readonly && !viewonly) {\n<div class=\"qd-radio-buttons__button-section\">\n @for (option of radioButtonsListForView; track getOptionId($index, option)) {\n <label\n [for]=\"option.value + id\"\n [ngClass]=\"\n 'qd-radio-buttons__label' +\n (option.disabled || disabled ? ' qd-radio-buttons__label--disabled' : '') +\n (option.value === value ? ' qd-radio-buttons__label--checked' : '')\n \"\n [attr.data-test-id]=\"testId + '-label'\"\n >\n <input\n type=\"radio\"\n qdVisuallyHidden\n [qdAutofocus]=\"hasAutofocus && $index === 0\"\n [id]=\"option.value + id\"\n [ngClass]=\"'qd-radio-buttons__radio-button'\"\n [attr.tabindex]=\"isAriaHidden ? -1 : option.value === tabStopValue ? 0 : -1\"\n [attr.aria-hidden]=\"isAriaHidden ? true : null\"\n [name]=\"id\"\n [value]=\"option.value\"\n [disabled]=\"option.disabled || disabled\"\n (change)=\"handleClick(option.value)\"\n [checked]=\"option.value === value\"\n [attr.data-test-id]=\"testId + '-input-' + option.i18n\"\n />\n @if (option.value === value) {\n <qd-icon\n class=\"qd-radio-buttons__indicator\"\n [icon]=\"'radioButtonChecked'\"\n [attr.data-test-id]=\"testId + '-indicator-checked'\"\n ></qd-icon>\n } @if (option.value !== value) {\n <qd-icon\n class=\"qd-radio-buttons__indicator\"\n [icon]=\"'circle'\"\n [attr.data-test-id]=\"testId + '-indicator-unchecked'\"\n ></qd-icon>\n }\n <span [ngClass]=\"'qd-radio-buttons__caption qd-intersection-target'\">{{ option.i18n | translate }}</span>\n </label>\n }\n</div>\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]=\"activeOptionAsList\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n} @if (viewonly) {\n<qd-form-viewonly\n [values]=\"activeOptionAsList\"\n [viewonlyAction]=\"viewonlyAction\"\n [status]=\"config?.viewonlyStatus\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n}\n", styles: [".qd-radio-buttons{display:block;flex-direction:column;margin-bottom:.75rem}.qd-radio-buttons.qd-radio-align--horizontal .qd-radio-buttons__button-section{display:flex;min-height:2.25rem;flex-wrap:wrap;align-items:center;margin-bottom:.375rem}.qd-radio-buttons.qd-radio-align--horizontal .qd-radio-buttons__label:not(:last-child) .qd-radio-buttons__caption{padding-right:1rem}.qd-radio-buttons.qd-radio-align--vertical .qd-radio-buttons__button-section{display:flex;flex-direction:column;margin-bottom:.375rem}.qd-radio-buttons.qd-radio-align--vertical .qd-radio-buttons__button-section .qd-radio-buttons__caption{flex:auto}.qd-radio-buttons .qd-radio-buttons__label{display:flex;max-width:100%;padding:.625rem 0;color:#454545;cursor:pointer;font-size:.875rem;font-weight:400;line-height:1rem}.qd-radio-buttons .qd-radio-buttons__label .qd-radio-buttons__indicator{position:relative;margin:0 .375rem 0 0;color:#b4b4b4;font-size:1.25rem}.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):hover,.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):focus{color:#171717}.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):hover .qd-radio-buttons__indicator,.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):focus .qd-radio-buttons__indicator{color:#171717}.qd-radio-buttons .qd-radio-buttons__label--checked{color:#171717}.qd-radio-buttons .qd-radio-buttons__label--checked .qd-radio-buttons__indicator{color:#069}.qd-radio-buttons .qd-radio-buttons__label--disabled{color:#d5d5d5;cursor:default}.qd-radio-buttons .qd-radio-buttons__label--disabled .qd-radio-buttons__indicator{color:#d5d5d5}.qd-radio-buttons .qd-radio-buttons__label .qd-radio-buttons__caption{padding:0}.qd-radio-buttons__input-section{margin-bottom:.375rem}@media(max-width:959.98px){.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__button-section{flex-direction:column}.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label{width:100%;padding-top:.0625rem;padding-bottom:.0625rem;padding-left:.75rem;border:.0625rem solid rgb(180,180,180);margin-bottom:.75rem;background:#fff}.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label .qd-radio-buttons__caption{padding-right:.75rem!important;transform:translateY(.0625rem)}}@media(max-width:959.98px)and (max-width:959.98px){.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label .qd-radio-buttons__caption{padding:.375rem .375rem .375rem 0!important;line-height:1.25rem}}@media(max-width:959.98px){.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label:last-child{margin-bottom:0}.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label .qd-radio-buttons__indicator{display:flex;align-items:center}}.qd-
|
|
15659
|
+
], encapsulation: ViewEncapsulation.None, 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 [isDisabled]=\"isLabelDisabled\"\n></qd-form-label>\n\n@if (filter) {\n<qd-filter-form-items\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId + '-filter-form'\"\n></qd-filter-form-items>\n} @if (!readonly && !viewonly) {\n<div class=\"qd-radio-buttons__button-section\">\n @for (option of radioButtonsListForView; track getOptionId($index, option)) {\n <label\n [for]=\"option.value + id\"\n [ngClass]=\"\n 'qd-radio-buttons__label' +\n (option.disabled || disabled ? ' qd-radio-buttons__label--disabled' : '') +\n (option.value === value ? ' qd-radio-buttons__label--checked' : '')\n \"\n [attr.data-test-id]=\"testId + '-label'\"\n >\n <input\n type=\"radio\"\n qdVisuallyHidden\n [qdAutofocus]=\"hasAutofocus && $index === 0\"\n [id]=\"option.value + id\"\n [ngClass]=\"'qd-radio-buttons__radio-button'\"\n [attr.tabindex]=\"isAriaHidden ? -1 : option.value === tabStopValue ? 0 : -1\"\n [attr.aria-hidden]=\"isAriaHidden ? true : null\"\n [name]=\"id\"\n [value]=\"option.value\"\n [disabled]=\"option.disabled || disabled\"\n (change)=\"handleClick(option.value)\"\n [checked]=\"option.value === value\"\n [attr.data-test-id]=\"testId + '-input-' + option.i18n\"\n />\n @if (option.value === value) {\n <qd-icon\n class=\"qd-radio-buttons__indicator\"\n [icon]=\"'radioButtonChecked'\"\n [attr.data-test-id]=\"testId + '-indicator-checked'\"\n ></qd-icon>\n } @if (option.value !== value) {\n <qd-icon\n class=\"qd-radio-buttons__indicator\"\n [icon]=\"'circle'\"\n [attr.data-test-id]=\"testId + '-indicator-unchecked'\"\n ></qd-icon>\n }\n <span [ngClass]=\"'qd-radio-buttons__caption qd-intersection-target'\">{{ option.i18n | translate }}</span>\n </label>\n }\n</div>\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]=\"activeOptionAsList\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n} @if (viewonly) {\n<qd-form-viewonly\n [values]=\"activeOptionAsList\"\n [viewonlyAction]=\"viewonlyAction\"\n [status]=\"config?.viewonlyStatus\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n}\n", styles: [".qd-radio-buttons{display:block;flex-direction:column;margin-bottom:.75rem}.qd-radio-buttons.qd-radio-align--horizontal .qd-radio-buttons__button-section{display:flex;min-height:2.25rem;flex-wrap:wrap;align-items:center;margin-bottom:.375rem}.qd-radio-buttons.qd-radio-align--horizontal .qd-radio-buttons__label:not(:last-child) .qd-radio-buttons__caption{padding-right:1rem}.qd-radio-buttons.qd-radio-align--vertical .qd-radio-buttons__button-section{display:flex;flex-direction:column;margin-bottom:.375rem}.qd-radio-buttons.qd-radio-align--vertical .qd-radio-buttons__button-section .qd-radio-buttons__caption{flex:auto}.qd-radio-buttons .qd-radio-buttons__label{display:flex;max-width:100%;padding:.625rem 0;color:#454545;cursor:pointer;font-size:.875rem;font-weight:400;line-height:1rem}.qd-radio-buttons .qd-radio-buttons__label .qd-radio-buttons__indicator{position:relative;margin:0 .375rem 0 0;color:#b4b4b4;font-size:1.25rem}.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):hover,.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):focus{color:#171717}.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):hover .qd-radio-buttons__indicator,.qd-radio-buttons .qd-radio-buttons__label:not(.qd-radio-buttons__label--checked,.qd-radio-buttons__label--disabled):focus .qd-radio-buttons__indicator{color:#171717}.qd-radio-buttons .qd-radio-buttons__label--checked{color:#171717}.qd-radio-buttons .qd-radio-buttons__label--checked .qd-radio-buttons__indicator{color:#069}.qd-radio-buttons .qd-radio-buttons__label--disabled{color:#d5d5d5;cursor:default}.qd-radio-buttons .qd-radio-buttons__label--disabled .qd-radio-buttons__indicator{color:#d5d5d5}.qd-radio-buttons .qd-radio-buttons__label .qd-radio-buttons__caption{padding:0}.qd-radio-buttons__input-section{margin-bottom:.375rem}@media(max-width:959.98px){.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__button-section{flex-direction:column}.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label{width:100%;padding-top:.0625rem;padding-bottom:.0625rem;padding-left:.75rem;border:.0625rem solid rgb(180,180,180);margin-bottom:.75rem;background:#fff}.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label .qd-radio-buttons__caption{padding-right:.75rem!important;transform:translateY(.0625rem)}}@media(max-width:959.98px)and (max-width:959.98px){.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label .qd-radio-buttons__caption{padding:.375rem .375rem .375rem 0!important;line-height:1.25rem}}@media(max-width:959.98px){.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label:last-child{margin-bottom:0}.qd-radio-buttons:not(.qd-rwd-disabled) .qd-radio-buttons__label .qd-radio-buttons__indicator{display:flex;align-items:center}}.qd-radio-buttons .qd-radio-buttons__radio-button:focus-visible~.qd-radio-buttons__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%)}\n"] }]
|
|
15729
15660
|
}], ctorParameters: () => [], propDecorators: { value: [{
|
|
15730
15661
|
type: Input
|
|
15731
15662
|
}], config: [{
|
|
@@ -16651,7 +16582,6 @@ class QdValidators {
|
|
|
16651
16582
|
}
|
|
16652
16583
|
}
|
|
16653
16584
|
|
|
16654
|
-
// @ts-strict-ignore
|
|
16655
16585
|
class QdSwitchComponent {
|
|
16656
16586
|
inputData;
|
|
16657
16587
|
id;
|
|
@@ -16659,7 +16589,7 @@ class QdSwitchComponent {
|
|
|
16659
16589
|
testId = 'switch';
|
|
16660
16590
|
valueChange = new EventEmitter();
|
|
16661
16591
|
get active() {
|
|
16662
|
-
return this.inputData.active;
|
|
16592
|
+
return !!this.inputData.active;
|
|
16663
16593
|
}
|
|
16664
16594
|
get isDisabled() {
|
|
16665
16595
|
return this.inputData.disabled || this.disabled;
|
|
@@ -16704,7 +16634,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
16704
16634
|
args: ['class.qd-switch-disabled']
|
|
16705
16635
|
}] } });
|
|
16706
16636
|
|
|
16707
|
-
// @ts-strict-ignore
|
|
16708
16637
|
class QdSwitchesService {
|
|
16709
16638
|
switchesList;
|
|
16710
16639
|
formatFormControlValues(formControlValues) {
|
|
@@ -16719,7 +16648,7 @@ class QdSwitchesService {
|
|
|
16719
16648
|
});
|
|
16720
16649
|
}
|
|
16721
16650
|
isAtLeastOneSelected(list) {
|
|
16722
|
-
return list.reduce((hasValue, item) => hasValue || item.active, false);
|
|
16651
|
+
return list.reduce((hasValue, item) => hasValue || !!item.active, false);
|
|
16723
16652
|
}
|
|
16724
16653
|
setList(list) {
|
|
16725
16654
|
this.switchesList = list.map(item => ({ ...item, disabled: item.disabled || false }));
|
|
@@ -16769,7 +16698,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
16769
16698
|
type: Injectable
|
|
16770
16699
|
}] });
|
|
16771
16700
|
|
|
16772
|
-
// @ts-strict-ignore
|
|
16773
16701
|
/**
|
|
16774
16702
|
* **QdSwitches** component provides a FormElement.
|
|
16775
16703
|
* The **QdSwitches** is a component that provides a form element for switches.<br />
|
|
@@ -16803,11 +16731,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
16803
16731
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
16804
16732
|
*/
|
|
16805
16733
|
class QdSwitchesComponent {
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
|
|
16810
|
-
|
|
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 });
|
|
16811
16739
|
/**
|
|
16812
16740
|
* The current form control name can be assigned here if you want to use Reactive Forms.
|
|
16813
16741
|
*/
|
|
@@ -16841,6 +16769,7 @@ class QdSwitchesComponent {
|
|
|
16841
16769
|
testId = 'switches';
|
|
16842
16770
|
/**
|
|
16843
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`.
|
|
16844
16773
|
*/
|
|
16845
16774
|
valuesChange = new EventEmitter();
|
|
16846
16775
|
/**
|
|
@@ -16868,7 +16797,7 @@ class QdSwitchesComponent {
|
|
|
16868
16797
|
return this.align === 'vertical';
|
|
16869
16798
|
}
|
|
16870
16799
|
get hasHint() {
|
|
16871
|
-
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);
|
|
16872
16801
|
}
|
|
16873
16802
|
get required() {
|
|
16874
16803
|
if (!this.control)
|
|
@@ -16891,24 +16820,24 @@ class QdSwitchesComponent {
|
|
|
16891
16820
|
}
|
|
16892
16821
|
ngOnInit() {
|
|
16893
16822
|
this.updateConfiguration();
|
|
16894
|
-
if (this.
|
|
16823
|
+
if (this._controlContainer) {
|
|
16895
16824
|
if (this.formControlName) {
|
|
16896
|
-
this.control = this.
|
|
16825
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
16897
16826
|
}
|
|
16898
16827
|
else {
|
|
16899
16828
|
console.warn('Quadrel Framework | QdSwitches - Missing FormControlName directive from host element of the component.');
|
|
16900
16829
|
}
|
|
16901
16830
|
}
|
|
16902
|
-
this.
|
|
16903
|
-
this.
|
|
16831
|
+
this._switchesService.setList(this.options);
|
|
16832
|
+
this._switchesService.fillListWithDefaults(this.values);
|
|
16904
16833
|
this.setData();
|
|
16905
|
-
this.
|
|
16834
|
+
this._actionEmitterService.hintEventEmitter$
|
|
16906
16835
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
16907
16836
|
.subscribe(() => this.clickHint.emit());
|
|
16908
|
-
this.
|
|
16837
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
16909
16838
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
16910
16839
|
.subscribe(() => this.clickReadonly.emit());
|
|
16911
|
-
this.
|
|
16840
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
16912
16841
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
16913
16842
|
.subscribe(() => this.clickViewonly.emit());
|
|
16914
16843
|
this.initOpModeSubscription();
|
|
@@ -16927,7 +16856,7 @@ class QdSwitchesComponent {
|
|
|
16927
16856
|
this.disabled = disabled;
|
|
16928
16857
|
}
|
|
16929
16858
|
writeValue(values) {
|
|
16930
|
-
this.
|
|
16859
|
+
this._switchesService.fillListWithDefaults(values);
|
|
16931
16860
|
this.setData();
|
|
16932
16861
|
this.switchesValues = values;
|
|
16933
16862
|
}
|
|
@@ -16954,18 +16883,18 @@ class QdSwitchesComponent {
|
|
|
16954
16883
|
this.viewonlyAction = getViewonlyAction(this.config);
|
|
16955
16884
|
}
|
|
16956
16885
|
setData() {
|
|
16957
|
-
this.switchesValues = this.
|
|
16958
|
-
this.switchesInputs = this.
|
|
16886
|
+
this.switchesValues = this._switchesService.getValues();
|
|
16887
|
+
this.switchesInputs = this._switchesService.getList();
|
|
16959
16888
|
}
|
|
16960
16889
|
updateData(value) {
|
|
16961
|
-
this.
|
|
16962
|
-
this.switchesValues = this.
|
|
16963
|
-
this.switchesInputs = this.
|
|
16890
|
+
this._switchesService.updateList(value);
|
|
16891
|
+
this.switchesValues = this._switchesService.getValues();
|
|
16892
|
+
this.switchesInputs = this._switchesService.getList();
|
|
16964
16893
|
}
|
|
16965
16894
|
initOpModeSubscription() {
|
|
16966
|
-
if (!this.
|
|
16895
|
+
if (!this._eventBrokerService)
|
|
16967
16896
|
return;
|
|
16968
|
-
this.
|
|
16897
|
+
this._eventBrokerService
|
|
16969
16898
|
.consume('operation_mode_changed')
|
|
16970
16899
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
16971
16900
|
.subscribe(topic => {
|
|
@@ -17048,7 +16977,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
17048
16977
|
args: ['class.qd-switches-hint']
|
|
17049
16978
|
}] } });
|
|
17050
16979
|
|
|
17051
|
-
// @ts-strict-ignore
|
|
17052
16980
|
/**
|
|
17053
16981
|
* The **QdTextarea** is an component that provides a form element for a textarea input.<br />
|
|
17054
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.
|
|
@@ -17081,10 +17009,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
17081
17009
|
* description: For a field that belongs to a subgroup of the form and follows its own column count.
|
|
17082
17010
|
*/
|
|
17083
17011
|
class QdTextareaComponent {
|
|
17084
|
-
|
|
17085
|
-
|
|
17086
|
-
|
|
17087
|
-
|
|
17012
|
+
_actionEmitterService = inject(QdFormsActionEmitterService);
|
|
17013
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
17014
|
+
_controlContainer = inject(ControlContainer, { optional: true, host: true, skipSelf: true });
|
|
17015
|
+
_eventBrokerService = inject(QdEventBrokerService, { optional: true });
|
|
17088
17016
|
/**
|
|
17089
17017
|
* The form control name can be assigned here if you want to use Reactive Forms.
|
|
17090
17018
|
*/
|
|
@@ -17148,7 +17076,7 @@ class QdTextareaComponent {
|
|
|
17148
17076
|
label;
|
|
17149
17077
|
hint;
|
|
17150
17078
|
rows;
|
|
17151
|
-
valueForView;
|
|
17079
|
+
valueForView = null;
|
|
17152
17080
|
_destroyRef = inject(DestroyRef);
|
|
17153
17081
|
_onChange = () => { };
|
|
17154
17082
|
_onTouch = () => { };
|
|
@@ -17178,9 +17106,9 @@ class QdTextareaComponent {
|
|
|
17178
17106
|
}
|
|
17179
17107
|
ngOnInit() {
|
|
17180
17108
|
this.updateConfiguration();
|
|
17181
|
-
if (this.
|
|
17109
|
+
if (this._controlContainer) {
|
|
17182
17110
|
if (this.formControlName) {
|
|
17183
|
-
this.control = this.
|
|
17111
|
+
this.control = this._controlContainer.control.get(this.formControlName);
|
|
17184
17112
|
// TODO remove logic for support of angular FormControl with angular 18 update
|
|
17185
17113
|
if (!(this.control instanceof QdFormControl)) {
|
|
17186
17114
|
console.warn('Quadrel Framework | QdTextarea - Please use the QdFormControl instead of the Angular FormControl.');
|
|
@@ -17191,19 +17119,19 @@ class QdTextareaComponent {
|
|
|
17191
17119
|
}
|
|
17192
17120
|
}
|
|
17193
17121
|
this.valueForView = this.value || getValue(this.config);
|
|
17194
|
-
this.
|
|
17122
|
+
this._actionEmitterService.hintEventEmitter$
|
|
17195
17123
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
17196
17124
|
.subscribe(() => this.clickHint.emit());
|
|
17197
|
-
this.
|
|
17125
|
+
this._actionEmitterService.readonlyEventEmitter$
|
|
17198
17126
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
17199
17127
|
.subscribe(() => this.clickReadonly.emit());
|
|
17200
|
-
this.
|
|
17128
|
+
this._actionEmitterService.viewonlyEventEmitter$
|
|
17201
17129
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
17202
17130
|
.subscribe(() => this.clickViewonly.emit());
|
|
17203
17131
|
this.initOpModeSubscription();
|
|
17204
17132
|
}
|
|
17205
17133
|
ngOnChanges(changes) {
|
|
17206
|
-
if (changes
|
|
17134
|
+
if (changes['config']) {
|
|
17207
17135
|
this.updateConfiguration();
|
|
17208
17136
|
}
|
|
17209
17137
|
}
|
|
@@ -17247,9 +17175,9 @@ class QdTextareaComponent {
|
|
|
17247
17175
|
this.disabled = getDisabled(this.config) || !!this.control?.disabled;
|
|
17248
17176
|
}
|
|
17249
17177
|
initOpModeSubscription() {
|
|
17250
|
-
if (!this.
|
|
17178
|
+
if (!this._eventBrokerService)
|
|
17251
17179
|
return;
|
|
17252
|
-
this.
|
|
17180
|
+
this._eventBrokerService
|
|
17253
17181
|
.consume('operation_mode_changed')
|
|
17254
17182
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
17255
17183
|
.subscribe(topic => {
|
|
@@ -22192,43 +22120,51 @@ const isIsoTimestampValid = (isoTimestamp) => {
|
|
|
22192
22120
|
return valid;
|
|
22193
22121
|
};
|
|
22194
22122
|
const getDateTypeItems = (category) => {
|
|
22195
|
-
|
|
22123
|
+
const categoryItems = category.items ?? [];
|
|
22124
|
+
if (categoryItems[0]?.item !== undefined && !isIsoTimestampValid(categoryItems[0].item)) {
|
|
22196
22125
|
return [{ item: '', active: false }];
|
|
22197
22126
|
}
|
|
22198
22127
|
return [
|
|
22199
22128
|
{
|
|
22200
|
-
item:
|
|
22201
|
-
active:
|
|
22129
|
+
item: categoryItems[0]?.item || '',
|
|
22130
|
+
active: categoryItems[0]?.active || false
|
|
22202
22131
|
}
|
|
22203
22132
|
];
|
|
22204
22133
|
};
|
|
22205
22134
|
const getDateRangeTypeItems = (category) => {
|
|
22135
|
+
const categoryItems = category.items ?? [];
|
|
22206
22136
|
const items = [];
|
|
22207
22137
|
for (let i = 0; i < 2; i++) {
|
|
22208
|
-
if (
|
|
22138
|
+
if (categoryItems[i]?.item !== undefined && !isIsoTimestampValid(categoryItems[i].item)) {
|
|
22209
22139
|
items.push({ item: '', active: false });
|
|
22210
22140
|
}
|
|
22211
22141
|
else {
|
|
22212
22142
|
items.push({
|
|
22213
|
-
item:
|
|
22214
|
-
active:
|
|
22143
|
+
item: categoryItems[i]?.item || '',
|
|
22144
|
+
active: categoryItems[i]?.active || false
|
|
22215
22145
|
});
|
|
22216
22146
|
}
|
|
22217
22147
|
}
|
|
22218
22148
|
return items;
|
|
22219
22149
|
};
|
|
22220
|
-
const getBooleanTypeItems = (category) =>
|
|
22221
|
-
|
|
22222
|
-
|
|
22223
|
-
|
|
22224
|
-
|
|
22225
|
-
|
|
22226
|
-
|
|
22227
|
-
|
|
22228
|
-
|
|
22229
|
-
|
|
22230
|
-
|
|
22231
|
-
|
|
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
|
+
};
|
|
22232
22168
|
const getCategoryItems = (category) => {
|
|
22233
22169
|
if (category.type === 'date' || category.type === 'dateTime') {
|
|
22234
22170
|
return getDateTypeItems(category);
|
|
@@ -22271,7 +22207,6 @@ const createFilterState = (filterData) => {
|
|
|
22271
22207
|
return { categories, filters, childCategoryMap };
|
|
22272
22208
|
};
|
|
22273
22209
|
|
|
22274
|
-
// @ts-strict-ignore
|
|
22275
22210
|
const initFilterState = createAction('[QdFilter] initFilterState', props());
|
|
22276
22211
|
const updateItem = createAction('[QdFilter] updateItem', props());
|
|
22277
22212
|
const updateCategoryItems = createAction('[QdFilter] updateCategoryItems', props());
|
|
@@ -22330,7 +22265,6 @@ function validateFilterSelection(filterSelection, filterCategories, selectionSou
|
|
|
22330
22265
|
});
|
|
22331
22266
|
}
|
|
22332
22267
|
|
|
22333
|
-
// @ts-strict-ignore
|
|
22334
22268
|
const initialState$2 = {};
|
|
22335
22269
|
const _filterReducer = createReducer(initialState$2, on(QdFilterActions.initFilterState, (state, { filterId, filterData }) => {
|
|
22336
22270
|
if (filterData === undefined || filterData.categories.length === 0) {
|
|
@@ -22351,7 +22285,7 @@ const _filterReducer = createReducer(initialState$2, on(QdFilterActions.initFilt
|
|
|
22351
22285
|
return updateStateWithNewItem(state, filterId, categoryIndex, itemIndex, newItem);
|
|
22352
22286
|
}), on(QdFilterActions.setItemsStateSingleSelect, (state, { filterId, categoryIndex, itemIndex }) => {
|
|
22353
22287
|
const newCategory = getNewCategory(state, filterId, categoryIndex);
|
|
22354
|
-
newCategory.items
|
|
22288
|
+
newCategory.items?.forEach((item, index) => {
|
|
22355
22289
|
item.active = index === itemIndex ? !item.active : false;
|
|
22356
22290
|
});
|
|
22357
22291
|
return updateStateWithNewCategory(state, filterId, categoryIndex, newCategory);
|
|
@@ -22359,14 +22293,12 @@ const _filterReducer = createReducer(initialState$2, on(QdFilterActions.initFilt
|
|
|
22359
22293
|
const newFilter = getNewFilter(state, filterId);
|
|
22360
22294
|
newFilter.categories.forEach((category, index) => {
|
|
22361
22295
|
if (categoryIndex === index) {
|
|
22362
|
-
category.items
|
|
22296
|
+
category.items?.forEach((itemDate) => {
|
|
22363
22297
|
if (filterKey === undefined || filterKey === '') {
|
|
22364
|
-
|
|
22298
|
+
itemDate.hidden = false;
|
|
22365
22299
|
return;
|
|
22366
22300
|
}
|
|
22367
|
-
|
|
22368
|
-
.toLowerCase()
|
|
22369
|
-
.includes(filterKey.toLowerCase());
|
|
22301
|
+
itemDate.hidden = !translateFunc(itemDate.i18n).toLowerCase().includes(filterKey.toLowerCase());
|
|
22370
22302
|
});
|
|
22371
22303
|
}
|
|
22372
22304
|
});
|
|
@@ -22391,7 +22323,7 @@ const _filterReducer = createReducer(initialState$2, on(QdFilterActions.initFilt
|
|
|
22391
22323
|
case 'dateRange':
|
|
22392
22324
|
case 'dateTimeRange':
|
|
22393
22325
|
case 'freeText':
|
|
22394
|
-
category.items
|
|
22326
|
+
category.items?.forEach((item, itemIndex) => {
|
|
22395
22327
|
const itemValue = newFilterSelection[category.category]?.[itemIndex] || '';
|
|
22396
22328
|
item.item = itemValue;
|
|
22397
22329
|
item.active = !!itemValue;
|
|
@@ -22400,7 +22332,7 @@ const _filterReducer = createReducer(initialState$2, on(QdFilterActions.initFilt
|
|
|
22400
22332
|
case 'singleSelect':
|
|
22401
22333
|
case 'multiSelect':
|
|
22402
22334
|
case 'boolean':
|
|
22403
|
-
category.items
|
|
22335
|
+
category.items?.forEach(item => {
|
|
22404
22336
|
item.active = newFilterSelection[category.category]?.includes(item.item) || false;
|
|
22405
22337
|
});
|
|
22406
22338
|
}
|
|
@@ -22418,7 +22350,7 @@ const _filterReducer = createReducer(initialState$2, on(QdFilterActions.initFilt
|
|
|
22418
22350
|
};
|
|
22419
22351
|
}), on(QdFilterActions.clearCategorySelection, (state, { filterId, categoryIndex }) => {
|
|
22420
22352
|
const newCategory = getNewCategory(state, filterId, categoryIndex);
|
|
22421
|
-
newCategory.items
|
|
22353
|
+
newCategory.items?.forEach((item) => {
|
|
22422
22354
|
item.active = false;
|
|
22423
22355
|
});
|
|
22424
22356
|
return updateStateWithNewCategory(state, filterId, categoryIndex, newCategory);
|
|
@@ -22429,32 +22361,32 @@ function filterReducer(state, action) {
|
|
|
22429
22361
|
|
|
22430
22362
|
const categoryHasActiveItem = (category) => {
|
|
22431
22363
|
const items = (category && category.items) || [];
|
|
22432
|
-
return items.reduce((hasActiveItem, item) => hasActiveItem || item.active, false);
|
|
22364
|
+
return items.reduce((hasActiveItem, item) => hasActiveItem || !!item.active, false);
|
|
22433
22365
|
};
|
|
22434
22366
|
const hasActiveCategory = (categories = []) => categories.reduce((res, category) => res || categoryHasActiveItem(category), false);
|
|
22435
22367
|
|
|
22436
22368
|
const getActiveItems = (categories) => {
|
|
22437
22369
|
const activeItems = [];
|
|
22438
22370
|
categories.forEach(category => {
|
|
22439
|
-
const
|
|
22371
|
+
const categoryItems = [];
|
|
22440
22372
|
let isCategoryActive = false;
|
|
22441
|
-
category.items.forEach(item => {
|
|
22373
|
+
(category.items ?? []).forEach(item => {
|
|
22442
22374
|
if (category.type === 'dateRange' || category.type === 'dateTimeRange') {
|
|
22443
22375
|
if (!item.active) {
|
|
22444
|
-
|
|
22376
|
+
categoryItems.push('');
|
|
22445
22377
|
return;
|
|
22446
22378
|
}
|
|
22447
22379
|
isCategoryActive = true;
|
|
22448
|
-
|
|
22380
|
+
categoryItems.push(item.item);
|
|
22449
22381
|
return;
|
|
22450
22382
|
}
|
|
22451
22383
|
if (item.active) {
|
|
22452
22384
|
isCategoryActive = true;
|
|
22453
|
-
|
|
22385
|
+
categoryItems.push(item.item);
|
|
22454
22386
|
}
|
|
22455
22387
|
});
|
|
22456
22388
|
if (isCategoryActive)
|
|
22457
|
-
activeItems.push(
|
|
22389
|
+
activeItems.push({ category: category.category, items: categoryItems });
|
|
22458
22390
|
});
|
|
22459
22391
|
return activeItems;
|
|
22460
22392
|
};
|
|
@@ -22490,7 +22422,7 @@ function getFilterUrlParameter(categories, outputLegacyQueryStringFormat = false
|
|
|
22490
22422
|
.map(category => category.category + categoryToItemsAssigner + getCategoryItemsUrlStrings(category).join(itemSeparator))
|
|
22491
22423
|
.join(categorySeparator);
|
|
22492
22424
|
function hasCategoryActiveItems(category) {
|
|
22493
|
-
return category.items.some(item => item.active);
|
|
22425
|
+
return (category.items ?? []).some(item => item.active);
|
|
22494
22426
|
}
|
|
22495
22427
|
function getCategoryItemsUrlStrings(category) {
|
|
22496
22428
|
if (category.type === 'dateRange' || category.type === 'dateTimeRange') {
|
|
@@ -22511,7 +22443,6 @@ function escapeFilterValue(value) {
|
|
|
22511
22443
|
return value.replace(new RegExp(`(${SERIALIZATION_SYMBOLS.map(s => '\\' + s).join('|')})`, 'g'), '\\$1');
|
|
22512
22444
|
}
|
|
22513
22445
|
|
|
22514
|
-
// @ts-strict-ignore
|
|
22515
22446
|
const selectFeature$1 = (state) => state.qdFilter;
|
|
22516
22447
|
const selectFilterDataById = createSelector(selectFeature$1, (state, { filterId }) => getCategories(state, filterId));
|
|
22517
22448
|
const selectCategoryById = createSelector(selectFeature$1, (state, { filterId, categoryIndex }) => getCategory(state, filterId, categoryIndex));
|
|
@@ -22544,26 +22475,25 @@ const QdFilterSelector = {
|
|
|
22544
22475
|
selectFilterCategoryValue
|
|
22545
22476
|
};
|
|
22546
22477
|
|
|
22547
|
-
// @ts-strict-ignore
|
|
22548
22478
|
class QdFilterService {
|
|
22549
|
-
|
|
22479
|
+
_store = inject(Store);
|
|
22550
22480
|
translateService = inject(TranslateService);
|
|
22551
|
-
queryStringSubjects =
|
|
22552
|
-
filterUrlParameterSubjects =
|
|
22553
|
-
postBodySubjects =
|
|
22481
|
+
queryStringSubjects = {};
|
|
22482
|
+
filterUrlParameterSubjects = {};
|
|
22483
|
+
postBodySubjects = {};
|
|
22554
22484
|
itemsLoadingSubjects = {};
|
|
22555
22485
|
getItems$(filterId, categoryIndex) {
|
|
22556
|
-
return this.
|
|
22486
|
+
return this._store.select(QdFilterSelector.selectItems, {
|
|
22557
22487
|
filterId,
|
|
22558
22488
|
categoryIndex
|
|
22559
22489
|
});
|
|
22560
22490
|
}
|
|
22561
22491
|
getItemById$(filterId, categoryIndex, itemIndex) {
|
|
22562
|
-
return this.
|
|
22492
|
+
return this._store.select(selectItem(filterId, categoryIndex, itemIndex));
|
|
22563
22493
|
}
|
|
22564
22494
|
getMinDate$(filterId, categoryIndex, itemIndex) {
|
|
22565
22495
|
return itemIndex === 1
|
|
22566
|
-
? this.
|
|
22496
|
+
? this._store.select(QdFilterSelector.selectItemDate, {
|
|
22567
22497
|
categoryIndex,
|
|
22568
22498
|
itemIndex: 0,
|
|
22569
22499
|
filterId
|
|
@@ -22572,7 +22502,7 @@ class QdFilterService {
|
|
|
22572
22502
|
}
|
|
22573
22503
|
getMaxDate$(filterId, categoryIndex, itemIndex) {
|
|
22574
22504
|
return itemIndex === 0
|
|
22575
|
-
? this.
|
|
22505
|
+
? this._store.select(QdFilterSelector.selectItemDate, {
|
|
22576
22506
|
categoryIndex,
|
|
22577
22507
|
itemIndex: 1,
|
|
22578
22508
|
filterId
|
|
@@ -22596,7 +22526,7 @@ class QdFilterService {
|
|
|
22596
22526
|
});
|
|
22597
22527
|
}
|
|
22598
22528
|
getCurrentQueryString(filterId, outputLegacyQueryStringFormat) {
|
|
22599
|
-
return this.
|
|
22529
|
+
return this._store.select(state => QdFilterSelector.selectQueryString(state, { filterId, outputLegacyQueryStringFormat }));
|
|
22600
22530
|
}
|
|
22601
22531
|
emitFilterUrlParameterString(filterId) {
|
|
22602
22532
|
this.getCurrentFilterUrlParameterString(filterId)
|
|
@@ -22606,7 +22536,7 @@ class QdFilterService {
|
|
|
22606
22536
|
});
|
|
22607
22537
|
}
|
|
22608
22538
|
getCurrentFilterUrlParameterString(filterId) {
|
|
22609
|
-
return this.
|
|
22539
|
+
return this._store.select(state => QdFilterSelector.selectFilterUrlParameter(state, { filterId }));
|
|
22610
22540
|
}
|
|
22611
22541
|
emitPostBody(filterId) {
|
|
22612
22542
|
this.getCurrentPostBody(filterId)
|
|
@@ -22616,19 +22546,19 @@ class QdFilterService {
|
|
|
22616
22546
|
});
|
|
22617
22547
|
}
|
|
22618
22548
|
getCurrentPostBody(filterId) {
|
|
22619
|
-
return this.
|
|
22549
|
+
return this._store.select(state => QdFilterSelector.selectPostBody(state, { filterId }));
|
|
22620
22550
|
}
|
|
22621
22551
|
/**
|
|
22622
22552
|
* State Selector
|
|
22623
22553
|
*/
|
|
22624
22554
|
selectFilterDataById$(filterId) {
|
|
22625
|
-
return this.
|
|
22555
|
+
return this._store.select(QdFilterSelector.selectFilterDataById, { filterId });
|
|
22626
22556
|
}
|
|
22627
22557
|
selectHasActiveCategory$(filterId) {
|
|
22628
|
-
return this.
|
|
22558
|
+
return this._store.select(QdFilterSelector.selectHasActiveCategory, { filterId });
|
|
22629
22559
|
}
|
|
22630
22560
|
getCategoryById$(filterId, categoryIndex) {
|
|
22631
|
-
return this.
|
|
22561
|
+
return this._store.select(QdFilterSelector.selectCategoryById, {
|
|
22632
22562
|
filterId,
|
|
22633
22563
|
categoryIndex
|
|
22634
22564
|
});
|
|
@@ -22637,7 +22567,7 @@ class QdFilterService {
|
|
|
22637
22567
|
return this.getItemsLoadingSubject(filterId, categoryIndex).asObservable();
|
|
22638
22568
|
}
|
|
22639
22569
|
getFilterCategoryValue$(filterId, categoryIndex) {
|
|
22640
|
-
return this.
|
|
22570
|
+
return this._store.select(QdFilterSelector.selectFilterCategoryValue, {
|
|
22641
22571
|
filterId,
|
|
22642
22572
|
categoryIndex
|
|
22643
22573
|
});
|
|
@@ -22646,10 +22576,10 @@ class QdFilterService {
|
|
|
22646
22576
|
* Action dispatcher
|
|
22647
22577
|
*/
|
|
22648
22578
|
initFilterState(filterId, filterData) {
|
|
22649
|
-
this.
|
|
22579
|
+
this._store.dispatch(QdFilterActions.initFilterState({ filterId, filterData }));
|
|
22650
22580
|
}
|
|
22651
22581
|
updateItem(filterId, categoryIndex, itemIndex, value) {
|
|
22652
|
-
this.
|
|
22582
|
+
this._store.dispatch(QdFilterActions.updateItem({
|
|
22653
22583
|
filterId,
|
|
22654
22584
|
categoryIndex,
|
|
22655
22585
|
itemIndex,
|
|
@@ -22657,14 +22587,14 @@ class QdFilterService {
|
|
|
22657
22587
|
}));
|
|
22658
22588
|
}
|
|
22659
22589
|
updateCategoryItems(filterId, categoryIndex, items) {
|
|
22660
|
-
this.
|
|
22590
|
+
this._store.dispatch(QdFilterActions.updateCategoryItems({
|
|
22661
22591
|
filterId,
|
|
22662
22592
|
categoryIndex,
|
|
22663
22593
|
items
|
|
22664
22594
|
}));
|
|
22665
22595
|
}
|
|
22666
22596
|
setItemIsActive(filterId, categoryIndex, itemIndex, isActive) {
|
|
22667
|
-
this.
|
|
22597
|
+
this._store.dispatch(QdFilterActions.setItemIsActive({
|
|
22668
22598
|
categoryIndex,
|
|
22669
22599
|
itemIndex,
|
|
22670
22600
|
isActive,
|
|
@@ -22672,28 +22602,28 @@ class QdFilterService {
|
|
|
22672
22602
|
}));
|
|
22673
22603
|
}
|
|
22674
22604
|
setItemsStateSingleSelect(filterId, categoryIndex, itemIndex) {
|
|
22675
|
-
this.
|
|
22605
|
+
this._store.dispatch(QdFilterActions.setItemsStateSingleSelect({
|
|
22676
22606
|
categoryIndex,
|
|
22677
22607
|
itemIndex,
|
|
22678
22608
|
filterId
|
|
22679
22609
|
}));
|
|
22680
22610
|
}
|
|
22681
22611
|
hideShowItems(filterId, categoryIndex, filterKey) {
|
|
22682
|
-
this.
|
|
22612
|
+
this._store.dispatch(QdFilterActions.hideShowItems({
|
|
22683
22613
|
filterId,
|
|
22684
22614
|
categoryIndex,
|
|
22685
22615
|
filterKey,
|
|
22686
|
-
translateFunc: key => this.translateService.instant(key)
|
|
22616
|
+
translateFunc: (key) => this.translateService.instant(key)
|
|
22687
22617
|
}));
|
|
22688
22618
|
}
|
|
22689
22619
|
updateCategoryTranslation(filterId, filterData) {
|
|
22690
|
-
this.
|
|
22620
|
+
this._store.dispatch(QdFilterActions.updateCategoryTranslation({
|
|
22691
22621
|
filterId,
|
|
22692
22622
|
filterData
|
|
22693
22623
|
}));
|
|
22694
22624
|
}
|
|
22695
22625
|
setFilterSelection(filterId, filterSelection) {
|
|
22696
|
-
this.
|
|
22626
|
+
this._store.dispatch(QdFilterActions.setFilterSelection({
|
|
22697
22627
|
filterId,
|
|
22698
22628
|
filterSelection
|
|
22699
22629
|
}));
|
|
@@ -22704,20 +22634,20 @@ class QdFilterService {
|
|
|
22704
22634
|
this.filterUrlParameterSubjects[filterId] = new ReplaySubject(1);
|
|
22705
22635
|
}
|
|
22706
22636
|
setCategoryFilter(filterId, categoryIndex, filter) {
|
|
22707
|
-
this.
|
|
22637
|
+
this._store.dispatch(QdFilterActions.setCategoryFilter({
|
|
22708
22638
|
filterId,
|
|
22709
22639
|
categoryIndex,
|
|
22710
22640
|
filter
|
|
22711
22641
|
}));
|
|
22712
22642
|
}
|
|
22713
22643
|
resetCategoryFilter(filterId, categoryIndex) {
|
|
22714
|
-
this.
|
|
22644
|
+
this._store.dispatch(QdFilterActions.resetCategoryFilter({
|
|
22715
22645
|
filterId,
|
|
22716
22646
|
categoryIndex
|
|
22717
22647
|
}));
|
|
22718
22648
|
}
|
|
22719
22649
|
clearCategorySelection(filterId, categoryIndex) {
|
|
22720
|
-
this.
|
|
22650
|
+
this._store.dispatch(QdFilterActions.clearCategorySelection({
|
|
22721
22651
|
filterId,
|
|
22722
22652
|
categoryIndex
|
|
22723
22653
|
}));
|
|
@@ -22756,9 +22686,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
22756
22686
|
}]
|
|
22757
22687
|
}] });
|
|
22758
22688
|
|
|
22759
|
-
// @ts-strict-ignore
|
|
22760
22689
|
class QdFilterItemBooleanComponent {
|
|
22761
|
-
filterService = inject(QdFilterService);
|
|
22762
22690
|
filterId;
|
|
22763
22691
|
categoryIndex;
|
|
22764
22692
|
itemIndex;
|
|
@@ -22769,9 +22697,10 @@ class QdFilterItemBooleanComponent {
|
|
|
22769
22697
|
}
|
|
22770
22698
|
itemData;
|
|
22771
22699
|
active;
|
|
22700
|
+
_filterService = inject(QdFilterService);
|
|
22772
22701
|
_destroyRef = inject(DestroyRef);
|
|
22773
22702
|
ngOnInit() {
|
|
22774
|
-
this.
|
|
22703
|
+
this._filterService
|
|
22775
22704
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
22776
22705
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
22777
22706
|
.subscribe(item => {
|
|
@@ -22780,7 +22709,7 @@ class QdFilterItemBooleanComponent {
|
|
|
22780
22709
|
});
|
|
22781
22710
|
}
|
|
22782
22711
|
clickToggle(value) {
|
|
22783
|
-
this.
|
|
22712
|
+
this._filterService.setItemIsActive(this.filterId, this.categoryIndex, this.itemIndex, value === this.itemData);
|
|
22784
22713
|
}
|
|
22785
22714
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemBooleanComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22786
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"] }] });
|
|
@@ -22804,9 +22733,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
22804
22733
|
args: ['attr.data-test-id']
|
|
22805
22734
|
}] } });
|
|
22806
22735
|
|
|
22807
|
-
// @ts-strict-ignore
|
|
22808
22736
|
class QdFilterCategoryBooleanComponent {
|
|
22809
|
-
|
|
22737
|
+
_filterService = inject(QdFilterService);
|
|
22810
22738
|
_destroyRef = inject(DestroyRef);
|
|
22811
22739
|
filterId;
|
|
22812
22740
|
categoryIndex;
|
|
@@ -22814,7 +22742,7 @@ class QdFilterCategoryBooleanComponent {
|
|
|
22814
22742
|
itemIndex = 0;
|
|
22815
22743
|
i18n;
|
|
22816
22744
|
ngOnInit() {
|
|
22817
|
-
this.
|
|
22745
|
+
this._filterService
|
|
22818
22746
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
22819
22747
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
22820
22748
|
.subscribe(item => {
|
|
@@ -22836,9 +22764,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
22836
22764
|
args: ['data-test-id']
|
|
22837
22765
|
}] } });
|
|
22838
22766
|
|
|
22839
|
-
// @ts-strict-ignore
|
|
22840
22767
|
class QdFilterItemFreeTextComponent {
|
|
22841
|
-
filterService = inject(QdFilterService);
|
|
22842
22768
|
filterId;
|
|
22843
22769
|
isInstantFiltering;
|
|
22844
22770
|
categoryIndex;
|
|
@@ -22851,18 +22777,19 @@ class QdFilterItemFreeTextComponent {
|
|
|
22851
22777
|
item;
|
|
22852
22778
|
i18n;
|
|
22853
22779
|
inputValue = '';
|
|
22780
|
+
_filterService = inject(QdFilterService);
|
|
22854
22781
|
_destroyRef = inject(DestroyRef);
|
|
22855
22782
|
get value() {
|
|
22856
22783
|
return (this.item && this.item.item) || '';
|
|
22857
22784
|
}
|
|
22858
22785
|
ngOnInit() {
|
|
22859
|
-
this.
|
|
22786
|
+
this._filterService
|
|
22860
22787
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
22861
22788
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
22862
22789
|
.subscribe(category => {
|
|
22863
22790
|
this.i18n = category.i18n;
|
|
22864
22791
|
});
|
|
22865
|
-
this.
|
|
22792
|
+
this._filterService
|
|
22866
22793
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
22867
22794
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
22868
22795
|
.subscribe(item => {
|
|
@@ -22874,18 +22801,18 @@ class QdFilterItemFreeTextComponent {
|
|
|
22874
22801
|
handleValueChange(value) {
|
|
22875
22802
|
this.inputValue = value;
|
|
22876
22803
|
if (!this.isInstantFiltering && value !== '') {
|
|
22877
|
-
this.
|
|
22804
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, `${value ?? ''}`);
|
|
22878
22805
|
}
|
|
22879
22806
|
}
|
|
22880
22807
|
handleEnter($event) {
|
|
22881
22808
|
if (this.isInstantFiltering && $event !== '') {
|
|
22882
|
-
this.
|
|
22809
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, `${$event ?? ''}`);
|
|
22883
22810
|
}
|
|
22884
22811
|
this.enterClick.emit();
|
|
22885
22812
|
this.inputValue = '';
|
|
22886
22813
|
}
|
|
22887
22814
|
handleReset() {
|
|
22888
|
-
this.
|
|
22815
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, '');
|
|
22889
22816
|
}
|
|
22890
22817
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemFreeTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22891
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"] }] });
|
|
@@ -22911,9 +22838,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
22911
22838
|
args: ['attr.data-test-id']
|
|
22912
22839
|
}] } });
|
|
22913
22840
|
|
|
22914
|
-
// @ts-strict-ignore
|
|
22915
22841
|
class QdFilterItemFreeTextCategoryComponent {
|
|
22916
|
-
|
|
22842
|
+
_filterService = inject(QdFilterService);
|
|
22917
22843
|
filterId;
|
|
22918
22844
|
isInstantFiltering;
|
|
22919
22845
|
categoryIndex;
|
|
@@ -22924,7 +22850,7 @@ class QdFilterItemFreeTextCategoryComponent {
|
|
|
22924
22850
|
this.updateState();
|
|
22925
22851
|
}
|
|
22926
22852
|
updateState() {
|
|
22927
|
-
this.
|
|
22853
|
+
this._filterService
|
|
22928
22854
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
22929
22855
|
.pipe(take(1))
|
|
22930
22856
|
.subscribe(item => {
|
|
@@ -22941,7 +22867,7 @@ class QdFilterItemFreeTextCategoryComponent {
|
|
|
22941
22867
|
this.updateState();
|
|
22942
22868
|
}
|
|
22943
22869
|
close() {
|
|
22944
|
-
this.
|
|
22870
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, '');
|
|
22945
22871
|
this.updateState();
|
|
22946
22872
|
}
|
|
22947
22873
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemFreeTextCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -22961,9 +22887,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
22961
22887
|
args: ['data-test-id']
|
|
22962
22888
|
}] } });
|
|
22963
22889
|
|
|
22964
|
-
// @ts-strict-ignore
|
|
22965
22890
|
class QdFilterItemDateComponent {
|
|
22966
|
-
|
|
22891
|
+
_filterService = inject(QdFilterService);
|
|
22967
22892
|
filterId;
|
|
22968
22893
|
categoryIndex;
|
|
22969
22894
|
itemIndex = 0;
|
|
@@ -22983,7 +22908,7 @@ class QdFilterItemDateComponent {
|
|
|
22983
22908
|
}
|
|
22984
22909
|
handleDateChange(date) {
|
|
22985
22910
|
if (date)
|
|
22986
|
-
this.
|
|
22911
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, date.toISOString());
|
|
22987
22912
|
}
|
|
22988
22913
|
handleClickTimePlaceholder($event) {
|
|
22989
22914
|
this.clickTimePlaceholder.emit($event);
|
|
@@ -22992,7 +22917,7 @@ class QdFilterItemDateComponent {
|
|
|
22992
22917
|
this.datepicker?.open();
|
|
22993
22918
|
}
|
|
22994
22919
|
subscribeGetItem() {
|
|
22995
|
-
this.
|
|
22920
|
+
this._filterService
|
|
22996
22921
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
22997
22922
|
.pipe(takeUntilDestroyed(this._destroyRef), filter(item => item !== undefined), tap(item => (this.item = QdDateAdapter.parseStoredDate(item.item))))
|
|
22998
22923
|
.subscribe();
|
|
@@ -23024,9 +22949,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23024
22949
|
args: [QdDatepickerComponent]
|
|
23025
22950
|
}] } });
|
|
23026
22951
|
|
|
23027
|
-
// @ts-strict-ignore
|
|
23028
22952
|
class QdFilterItemDateCategoryComponent {
|
|
23029
|
-
|
|
22953
|
+
_filterService = inject(QdFilterService);
|
|
23030
22954
|
filterId;
|
|
23031
22955
|
categoryIndex;
|
|
23032
22956
|
timePickerConfig;
|
|
@@ -23040,19 +22964,19 @@ class QdFilterItemDateCategoryComponent {
|
|
|
23040
22964
|
this.setItem();
|
|
23041
22965
|
}
|
|
23042
22966
|
removeItem(itemIndex) {
|
|
23043
|
-
this.
|
|
23044
|
-
this.
|
|
22967
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, Number(itemIndex), '');
|
|
22968
|
+
this._filterService.setItemIsActive(this.filterId, this.categoryIndex, Number(itemIndex), false);
|
|
23045
22969
|
}
|
|
23046
22970
|
handleClickTimePlaceholder($event) {
|
|
23047
22971
|
this.timePlaceholderSelected = $event;
|
|
23048
22972
|
}
|
|
23049
22973
|
setCategoryI18n() {
|
|
23050
|
-
this.i18n$ = this.
|
|
22974
|
+
this.i18n$ = this._filterService
|
|
23051
22975
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
23052
22976
|
.pipe(map(category => category.i18n));
|
|
23053
22977
|
}
|
|
23054
22978
|
setItem() {
|
|
23055
|
-
this.item$ = this.
|
|
22979
|
+
this.item$ = this._filterService.getItemById$(this.filterId, this.categoryIndex, this.itemIndex);
|
|
23056
22980
|
}
|
|
23057
22981
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemDateCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23058
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" }] });
|
|
@@ -23071,9 +22995,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23071
22995
|
args: ['data-test-id']
|
|
23072
22996
|
}] } });
|
|
23073
22997
|
|
|
23074
|
-
// @ts-strict-ignore
|
|
23075
22998
|
class QdFilterItemDateRangeComponent {
|
|
23076
|
-
|
|
22999
|
+
_filterService = inject(QdFilterService);
|
|
23077
23000
|
filterId;
|
|
23078
23001
|
categoryIndex;
|
|
23079
23002
|
itemIndex;
|
|
@@ -23094,10 +23017,10 @@ class QdFilterItemDateRangeComponent {
|
|
|
23094
23017
|
this.datepicker?.open();
|
|
23095
23018
|
}
|
|
23096
23019
|
get minDate$() {
|
|
23097
|
-
return this.
|
|
23020
|
+
return this._filterService.getMinDate$(this.filterId, this.categoryIndex, this.itemIndex);
|
|
23098
23021
|
}
|
|
23099
23022
|
get maxDate$() {
|
|
23100
|
-
return this.
|
|
23023
|
+
return this._filterService.getMaxDate$(this.filterId, this.categoryIndex, this.itemIndex);
|
|
23101
23024
|
}
|
|
23102
23025
|
ngOnInit() {
|
|
23103
23026
|
this.subscribeGetItem();
|
|
@@ -23106,23 +23029,23 @@ class QdFilterItemDateRangeComponent {
|
|
|
23106
23029
|
}
|
|
23107
23030
|
handleDateChange(date) {
|
|
23108
23031
|
if (date)
|
|
23109
|
-
this.
|
|
23032
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, date.toISOString());
|
|
23110
23033
|
}
|
|
23111
23034
|
handleClickTimePlaceholder($event) {
|
|
23112
23035
|
this.clickTimePlaceholder.emit($event);
|
|
23113
23036
|
}
|
|
23114
23037
|
subscribeGetItem() {
|
|
23115
|
-
this.
|
|
23038
|
+
this._filterService
|
|
23116
23039
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
23117
23040
|
.pipe(takeUntilDestroyed(this._destroyRef), filter(item => item !== undefined), tap(item => (this.item = QdDateAdapter.parseStoredDate(item.item))))
|
|
23118
23041
|
.subscribe();
|
|
23119
23042
|
}
|
|
23120
23043
|
subscribeMinMaxDate() {
|
|
23121
|
-
this.
|
|
23044
|
+
this._filterService
|
|
23122
23045
|
.getMinDate$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
23123
23046
|
.pipe(takeUntilDestroyed(this._destroyRef), tap(minDate => this.updateDisabledDates(minDate, 'to')))
|
|
23124
23047
|
.subscribe();
|
|
23125
|
-
this.
|
|
23048
|
+
this._filterService
|
|
23126
23049
|
.getMaxDate$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
23127
23050
|
.pipe(takeUntilDestroyed(this._destroyRef), tap(maxDate => this.updateDisabledDates(maxDate, 'from')))
|
|
23128
23051
|
.subscribe();
|
|
@@ -23136,7 +23059,7 @@ class QdFilterItemDateRangeComponent {
|
|
|
23136
23059
|
const index = targetProperty === 'from' ? 0 : 1;
|
|
23137
23060
|
this.config = {
|
|
23138
23061
|
...this.config,
|
|
23139
|
-
disabledDates: [{ ...this.config.disabledDates[index], [targetProperty]: parsed }]
|
|
23062
|
+
disabledDates: [{ ...this.config.disabledDates?.[index], [targetProperty]: parsed }]
|
|
23140
23063
|
};
|
|
23141
23064
|
}
|
|
23142
23065
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemDateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -23169,9 +23092,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23169
23092
|
args: [QdDatepickerComponent]
|
|
23170
23093
|
}] } });
|
|
23171
23094
|
|
|
23172
|
-
// @ts-strict-ignore
|
|
23173
23095
|
class QdFilterItemDateRangeCategoryComponent {
|
|
23174
|
-
|
|
23096
|
+
_filterService = inject(QdFilterService);
|
|
23175
23097
|
filterId;
|
|
23176
23098
|
categoryIndex;
|
|
23177
23099
|
testId;
|
|
@@ -23201,8 +23123,8 @@ class QdFilterItemDateRangeCategoryComponent {
|
|
|
23201
23123
|
event.stopPropagation();
|
|
23202
23124
|
}
|
|
23203
23125
|
removeItem(itemIndex) {
|
|
23204
|
-
this.
|
|
23205
|
-
this.
|
|
23126
|
+
this._filterService.updateItem(this.filterId, this.categoryIndex, Number(itemIndex), '');
|
|
23127
|
+
this._filterService.setItemIsActive(this.filterId, this.categoryIndex, Number(itemIndex), false);
|
|
23206
23128
|
}
|
|
23207
23129
|
handleFromTimePlaceholderClicked($event) {
|
|
23208
23130
|
this.fromItemTimePlaceholderClicked = $event;
|
|
@@ -23211,12 +23133,12 @@ class QdFilterItemDateRangeCategoryComponent {
|
|
|
23211
23133
|
this.untilItemTimePlaceholderClicked = $event;
|
|
23212
23134
|
}
|
|
23213
23135
|
setCategoryI18n() {
|
|
23214
|
-
this.i18n$ = this.
|
|
23136
|
+
this.i18n$ = this._filterService
|
|
23215
23137
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
23216
23138
|
.pipe(map(category => category.i18n));
|
|
23217
23139
|
}
|
|
23218
23140
|
setFromItem(index, targetMember) {
|
|
23219
|
-
this[targetMember] = this.
|
|
23141
|
+
this[targetMember] = this._filterService.getItemById$(this.filterId, this.categoryIndex, index);
|
|
23220
23142
|
}
|
|
23221
23143
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemDateRangeCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23222
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" }] });
|
|
@@ -23235,21 +23157,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23235
23157
|
type: Input
|
|
23236
23158
|
}] } });
|
|
23237
23159
|
|
|
23238
|
-
// @ts-strict-ignore
|
|
23239
23160
|
class QdFilterItemMultiSelectComponent {
|
|
23240
|
-
filterService = inject(QdFilterService);
|
|
23241
|
-
translateService = inject(TranslateService);
|
|
23242
|
-
elementRef = inject(ElementRef);
|
|
23243
|
-
category = inject(QD_FILTER_LISTBOX_HOST, { optional: true });
|
|
23244
23161
|
filterId;
|
|
23245
23162
|
categoryIndex;
|
|
23246
23163
|
itemIndex;
|
|
23247
23164
|
optionElementId;
|
|
23248
23165
|
testId;
|
|
23249
|
-
item;
|
|
23250
|
-
i18n;
|
|
23251
|
-
active;
|
|
23252
|
-
isActive = false;
|
|
23253
23166
|
role = 'option';
|
|
23254
23167
|
get idAttr() {
|
|
23255
23168
|
return this.optionElementId;
|
|
@@ -23266,9 +23179,17 @@ class QdFilterItemMultiSelectComponent {
|
|
|
23266
23179
|
onMouseDown(event) {
|
|
23267
23180
|
event.preventDefault();
|
|
23268
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 });
|
|
23269
23190
|
_destroyRef = inject(DestroyRef);
|
|
23270
23191
|
ngOnInit() {
|
|
23271
|
-
this.
|
|
23192
|
+
this._filterService
|
|
23272
23193
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
23273
23194
|
.pipe(takeUntilDestroyed(this._destroyRef), filter(item => !!item))
|
|
23274
23195
|
.subscribe(item => {
|
|
@@ -23276,10 +23197,10 @@ class QdFilterItemMultiSelectComponent {
|
|
|
23276
23197
|
this.i18n = item.i18n;
|
|
23277
23198
|
this.active = item.active;
|
|
23278
23199
|
});
|
|
23279
|
-
this.
|
|
23200
|
+
this._category?.registerOption(this);
|
|
23280
23201
|
}
|
|
23281
23202
|
ngOnDestroy() {
|
|
23282
|
-
this.
|
|
23203
|
+
this._category?.unregisterOption(this);
|
|
23283
23204
|
}
|
|
23284
23205
|
setActiveStyles() {
|
|
23285
23206
|
this.isActive = true;
|
|
@@ -23288,17 +23209,17 @@ class QdFilterItemMultiSelectComponent {
|
|
|
23288
23209
|
this.isActive = false;
|
|
23289
23210
|
}
|
|
23290
23211
|
getLabel() {
|
|
23291
|
-
return this.i18n ? this.
|
|
23212
|
+
return this.i18n ? this._translateService.instant(this.i18n) : '';
|
|
23292
23213
|
}
|
|
23293
23214
|
scrollIntoView() {
|
|
23294
|
-
this.
|
|
23215
|
+
this._elementRef.nativeElement.scrollIntoView({ block: 'nearest' });
|
|
23295
23216
|
}
|
|
23296
23217
|
setTabbable() { }
|
|
23297
23218
|
focus() {
|
|
23298
|
-
this.
|
|
23219
|
+
this._elementRef.nativeElement.focus();
|
|
23299
23220
|
}
|
|
23300
23221
|
clickToggle($event) {
|
|
23301
|
-
this.
|
|
23222
|
+
this._filterService.setItemIsActive(this.filterId, this.categoryIndex, this.itemIndex, !!$event);
|
|
23302
23223
|
}
|
|
23303
23224
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemMultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23304
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"] }] });
|
|
@@ -23337,12 +23258,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23337
23258
|
args: ['mousedown', ['$event']]
|
|
23338
23259
|
}] } });
|
|
23339
23260
|
|
|
23340
|
-
// @ts-strict-ignore
|
|
23341
23261
|
class QdFilterItemSingleSelectComponent {
|
|
23342
|
-
|
|
23343
|
-
|
|
23344
|
-
|
|
23345
|
-
|
|
23262
|
+
_filterService = inject(QdFilterService);
|
|
23263
|
+
_translateService = inject(TranslateService);
|
|
23264
|
+
_elementRef = inject(ElementRef);
|
|
23265
|
+
_category = inject(QD_FILTER_LISTBOX_HOST, { optional: true });
|
|
23346
23266
|
filterId;
|
|
23347
23267
|
categoryIndex;
|
|
23348
23268
|
itemIndex;
|
|
@@ -23371,7 +23291,7 @@ class QdFilterItemSingleSelectComponent {
|
|
|
23371
23291
|
_destroyRef = inject(DestroyRef);
|
|
23372
23292
|
ngOnInit() {
|
|
23373
23293
|
this.setTabbable(false);
|
|
23374
|
-
this.
|
|
23294
|
+
this._filterService
|
|
23375
23295
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
23376
23296
|
.pipe(takeUntilDestroyed(this._destroyRef), filter(item => !!item))
|
|
23377
23297
|
.subscribe(item => {
|
|
@@ -23379,10 +23299,10 @@ class QdFilterItemSingleSelectComponent {
|
|
|
23379
23299
|
this.i18n = item.i18n;
|
|
23380
23300
|
this.active = item.active;
|
|
23381
23301
|
});
|
|
23382
|
-
this.
|
|
23302
|
+
this._category?.registerOption(this);
|
|
23383
23303
|
}
|
|
23384
23304
|
ngOnDestroy() {
|
|
23385
|
-
this.
|
|
23305
|
+
this._category?.unregisterOption(this);
|
|
23386
23306
|
}
|
|
23387
23307
|
setActiveStyles() {
|
|
23388
23308
|
this.isActive = true;
|
|
@@ -23392,22 +23312,22 @@ class QdFilterItemSingleSelectComponent {
|
|
|
23392
23312
|
}
|
|
23393
23313
|
setTabbable(isTabbable) {
|
|
23394
23314
|
this.isTabbable = isTabbable;
|
|
23395
|
-
this.
|
|
23315
|
+
this._elementRef.nativeElement.setAttribute('tabindex', isTabbable ? '0' : '-1');
|
|
23396
23316
|
}
|
|
23397
23317
|
focus() {
|
|
23398
|
-
this.
|
|
23318
|
+
this._elementRef.nativeElement.focus();
|
|
23399
23319
|
}
|
|
23400
23320
|
getLabel() {
|
|
23401
|
-
return this.i18n ? this.
|
|
23321
|
+
return this.i18n ? this._translateService.instant(this.i18n) : '';
|
|
23402
23322
|
}
|
|
23403
23323
|
scrollIntoView() {
|
|
23404
|
-
this.
|
|
23324
|
+
this._elementRef.nativeElement.scrollIntoView({ block: 'nearest' });
|
|
23405
23325
|
}
|
|
23406
23326
|
handleActive() {
|
|
23407
23327
|
this.setItems();
|
|
23408
23328
|
}
|
|
23409
23329
|
setItems() {
|
|
23410
|
-
this.
|
|
23330
|
+
this._filterService.setItemsStateSingleSelect(this.filterId, this.categoryIndex, this.itemIndex);
|
|
23411
23331
|
}
|
|
23412
23332
|
close() {
|
|
23413
23333
|
this.closeEventEmitter.emit();
|
|
@@ -23450,10 +23370,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23450
23370
|
|
|
23451
23371
|
const NAVIGATION_KEYS = new Set(['ArrowDown', 'ArrowUp', 'Home', 'End']);
|
|
23452
23372
|
class QdFilterItemSelectCategoryComponent {
|
|
23453
|
-
|
|
23454
|
-
|
|
23455
|
-
|
|
23456
|
-
isMobile$ = this.
|
|
23373
|
+
_filterService = inject(QdFilterService);
|
|
23374
|
+
_breakpointService = inject(QdBreakpointService);
|
|
23375
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
23376
|
+
isMobile$ = this._breakpointService.isViewportBelow('md');
|
|
23457
23377
|
filterId;
|
|
23458
23378
|
categoryIndex;
|
|
23459
23379
|
testId;
|
|
@@ -23517,13 +23437,13 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23517
23437
|
return `qd-filter__category-layer qd-filter__category-layer--${this.type}`;
|
|
23518
23438
|
}
|
|
23519
23439
|
get filterCategoryValue$() {
|
|
23520
|
-
return this.
|
|
23440
|
+
return this._filterService.getFilterCategoryValue$(this.filterId, this.categoryIndex);
|
|
23521
23441
|
}
|
|
23522
23442
|
ngOnInit() {
|
|
23523
23443
|
this.initCategorySubscription();
|
|
23524
23444
|
this.initItemsSubscription();
|
|
23525
23445
|
this.initShowSelectButton();
|
|
23526
|
-
this.itemsLoading$ = this.
|
|
23446
|
+
this.itemsLoading$ = this._filterService.getItemsLoading$(this.filterId, this.categoryIndex);
|
|
23527
23447
|
this.updateListboxAriaState();
|
|
23528
23448
|
}
|
|
23529
23449
|
ngAfterViewInit() {
|
|
@@ -23542,7 +23462,7 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23542
23462
|
}
|
|
23543
23463
|
onActiveOptionChanged() {
|
|
23544
23464
|
this.updateListboxAriaState();
|
|
23545
|
-
this.
|
|
23465
|
+
this._changeDetectorRef.markForCheck();
|
|
23546
23466
|
if (!this.isRadioGroup)
|
|
23547
23467
|
return;
|
|
23548
23468
|
this.moveTabStopToActiveOption();
|
|
@@ -23668,7 +23588,7 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23668
23588
|
this.updateListboxAriaState();
|
|
23669
23589
|
}
|
|
23670
23590
|
initialActiveOption() {
|
|
23671
|
-
return this.options.find(option => option.active) ?? this.options.first;
|
|
23591
|
+
return this.options.find(option => !!option.active) ?? this.options.first;
|
|
23672
23592
|
}
|
|
23673
23593
|
selectActiveOption() {
|
|
23674
23594
|
const active = this.keyManager?.activeItem;
|
|
@@ -23678,7 +23598,7 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23678
23598
|
const item = this.items?.[active.itemIndex];
|
|
23679
23599
|
if (!item)
|
|
23680
23600
|
return;
|
|
23681
|
-
this.
|
|
23601
|
+
this._filterService.setItemIsActive(this.filterId, this.categoryIndex, active.itemIndex, !item.active);
|
|
23682
23602
|
return;
|
|
23683
23603
|
}
|
|
23684
23604
|
this.applySingleSelection();
|
|
@@ -23687,19 +23607,19 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23687
23607
|
const active = this.keyManager?.activeItem;
|
|
23688
23608
|
if (!active || active.active)
|
|
23689
23609
|
return;
|
|
23690
|
-
this.
|
|
23610
|
+
this._filterService.setItemsStateSingleSelect(this.filterId, this.categoryIndex, active.itemIndex);
|
|
23691
23611
|
}
|
|
23692
23612
|
closeAndRefocus() {
|
|
23693
23613
|
this.closeLayer();
|
|
23694
23614
|
this.triggerRef?.nativeElement.focus();
|
|
23695
23615
|
}
|
|
23696
23616
|
close(itemIndex) {
|
|
23697
|
-
this.
|
|
23698
|
-
this.
|
|
23617
|
+
this._filterService.setItemIsActive(this.filterId, this.categoryIndex, Number(itemIndex), false);
|
|
23618
|
+
this._filterService.resetCategoryFilter(this.filterId, this.categoryIndex);
|
|
23699
23619
|
}
|
|
23700
23620
|
clearAll() {
|
|
23701
|
-
this.
|
|
23702
|
-
this.
|
|
23621
|
+
this._filterService.clearCategorySelection(this.filterId, this.categoryIndex);
|
|
23622
|
+
this._filterService.resetCategoryFilter(this.filterId, this.categoryIndex);
|
|
23703
23623
|
}
|
|
23704
23624
|
trackByItem(_index, entry) {
|
|
23705
23625
|
return entry.item.item;
|
|
@@ -23720,23 +23640,23 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23720
23640
|
.filter(entry => !!entry.item);
|
|
23721
23641
|
}
|
|
23722
23642
|
changeValue($event) {
|
|
23723
|
-
this.
|
|
23724
|
-
this.
|
|
23643
|
+
this._filterService.hideShowItems(this.filterId, this.categoryIndex, $event);
|
|
23644
|
+
this._filterService.setCategoryFilter(this.filterId, this.categoryIndex, $event);
|
|
23725
23645
|
}
|
|
23726
23646
|
initCategorySubscription() {
|
|
23727
|
-
this.
|
|
23647
|
+
this._filterService
|
|
23728
23648
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
23729
23649
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
23730
23650
|
.subscribe(category => {
|
|
23731
23651
|
this.type = category.type;
|
|
23732
23652
|
this.filter = category.filter;
|
|
23733
23653
|
this.i18n = category.i18n;
|
|
23734
|
-
this.dependsOn = category.dependsOn
|
|
23654
|
+
this.dependsOn = 'dependsOn' in category ? category.dependsOn : [];
|
|
23735
23655
|
this.updateListboxAriaState();
|
|
23736
23656
|
});
|
|
23737
23657
|
}
|
|
23738
23658
|
initItemsSubscription() {
|
|
23739
|
-
this.
|
|
23659
|
+
this._filterService
|
|
23740
23660
|
.getItems$(this.filterId, this.categoryIndex)
|
|
23741
23661
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
23742
23662
|
.subscribe(items => {
|
|
@@ -23755,18 +23675,18 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23755
23675
|
previousItems.every((item, index) => item.item === nextItems[index].item));
|
|
23756
23676
|
}
|
|
23757
23677
|
initShowSelectButton() {
|
|
23758
|
-
const category$ = this.
|
|
23678
|
+
const category$ = this._filterService
|
|
23759
23679
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
23760
23680
|
.pipe(takeUntilDestroyed(this._destroyRef));
|
|
23761
|
-
const allCategories$ = this.
|
|
23681
|
+
const allCategories$ = this._filterService
|
|
23762
23682
|
.selectFilterDataById$(this.filterId)
|
|
23763
23683
|
.pipe(takeUntilDestroyed(this._destroyRef));
|
|
23764
23684
|
this.showSelectButton$ = combineLatest([category$, allCategories$]).pipe(switchMap$1(([category, allCategories]) => {
|
|
23765
|
-
if (!Array.isArray(category
|
|
23685
|
+
if (!('dependsOn' in category) || !Array.isArray(category.dependsOn) || category.dependsOn.length === 0)
|
|
23766
23686
|
return of(true);
|
|
23767
23687
|
const parentItems$ = category.dependsOn.map((parentKey) => {
|
|
23768
23688
|
const parentIndex = allCategories.findIndex(cat => cat.category === parentKey);
|
|
23769
|
-
return this.
|
|
23689
|
+
return this._filterService
|
|
23770
23690
|
.getItems$(this.filterId, parentIndex)
|
|
23771
23691
|
.pipe(map$1(parentItems => Array.isArray(parentItems) && parentItems.some((item) => item.active)));
|
|
23772
23692
|
});
|
|
@@ -23779,7 +23699,7 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
23779
23699
|
provide: QD_FILTER_LISTBOX_HOST,
|
|
23780
23700
|
useExisting: forwardRef(() => QdFilterItemSelectCategoryComponent)
|
|
23781
23701
|
}
|
|
23782
|
-
], 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 });
|
|
23783
23703
|
}
|
|
23784
23704
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterItemSelectCategoryComponent, decorators: [{
|
|
23785
23705
|
type: Component,
|
|
@@ -23788,7 +23708,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23788
23708
|
provide: QD_FILTER_LISTBOX_HOST,
|
|
23789
23709
|
useExisting: forwardRef(() => QdFilterItemSelectCategoryComponent)
|
|
23790
23710
|
}
|
|
23791
|
-
], 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"] }]
|
|
23792
23712
|
}], propDecorators: { filterId: [{
|
|
23793
23713
|
type: Input
|
|
23794
23714
|
}], categoryIndex: [{
|
|
@@ -23804,9 +23724,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
23804
23724
|
args: ['triggerRef']
|
|
23805
23725
|
}] } });
|
|
23806
23726
|
|
|
23807
|
-
// @ts-strict-ignore
|
|
23808
23727
|
class QdFilterCategoryComponent {
|
|
23809
|
-
|
|
23728
|
+
_filterService = inject(QdFilterService);
|
|
23810
23729
|
translateService = inject(TranslateService);
|
|
23811
23730
|
_destroyRef = inject(DestroyRef);
|
|
23812
23731
|
filterId;
|
|
@@ -23829,7 +23748,7 @@ class QdFilterCategoryComponent {
|
|
|
23829
23748
|
return this.testId;
|
|
23830
23749
|
}
|
|
23831
23750
|
ngOnInit() {
|
|
23832
|
-
this.
|
|
23751
|
+
this._filterService
|
|
23833
23752
|
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
23834
23753
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
23835
23754
|
.subscribe(category => {
|
|
@@ -23871,11 +23790,11 @@ class QdFilterCategoryComponent {
|
|
|
23871
23790
|
}
|
|
23872
23791
|
}
|
|
23873
23792
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23874
|
-
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"] }] });
|
|
23875
23794
|
}
|
|
23876
23795
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdFilterCategoryComponent, decorators: [{
|
|
23877
23796
|
type: Component,
|
|
23878
|
-
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"] }]
|
|
23879
23798
|
}], propDecorators: { filterId: [{
|
|
23880
23799
|
type: Input
|
|
23881
23800
|
}], isInstantFiltering: [{
|
|
@@ -24286,7 +24205,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
24286
24205
|
type: Injectable
|
|
24287
24206
|
}] });
|
|
24288
24207
|
|
|
24289
|
-
// @ts-strict-ignore
|
|
24290
24208
|
/**
|
|
24291
24209
|
* **QdFilterComponent** lets users build and apply a filter with several categories over a data set.
|
|
24292
24210
|
*
|
|
@@ -24413,8 +24331,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
24413
24331
|
*/
|
|
24414
24332
|
class QdFilterComponent {
|
|
24415
24333
|
filterService = inject(QdFilterService);
|
|
24416
|
-
|
|
24417
|
-
|
|
24334
|
+
_filterRouterConnectorService = inject(QdFilterRouterConnectorService);
|
|
24335
|
+
_dependentFiltersService = inject(QdDependentFiltersService);
|
|
24418
24336
|
_destroyRef = inject(DestroyRef);
|
|
24419
24337
|
/**
|
|
24420
24338
|
* The configuration of the filter
|
|
@@ -24479,7 +24397,7 @@ class QdFilterComponent {
|
|
|
24479
24397
|
this.init();
|
|
24480
24398
|
}
|
|
24481
24399
|
waitForFilterData() {
|
|
24482
|
-
return firstValueFrom(this._filterDataSubject.pipe(filter(filterData => !!filterData)));
|
|
24400
|
+
return firstValueFrom(this._filterDataSubject.pipe(filter((filterData) => !!filterData)));
|
|
24483
24401
|
}
|
|
24484
24402
|
ngOnChanges(changes) {
|
|
24485
24403
|
// TODO: Decision: Is there really a need for this???
|
|
@@ -24565,7 +24483,7 @@ class QdFilterComponent {
|
|
|
24565
24483
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
24566
24484
|
.subscribe(postBody => this.postBodyOutput.emit(postBody));
|
|
24567
24485
|
this.hasPreselection = hasActiveCategory(this.filterData?.categories);
|
|
24568
|
-
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$)
|
|
24569
24487
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
24570
24488
|
.subscribe(() => {
|
|
24571
24489
|
this.emitOutputs();
|
|
@@ -24580,10 +24498,10 @@ class QdFilterComponent {
|
|
|
24580
24498
|
this.initializeDependentFiltersService();
|
|
24581
24499
|
}
|
|
24582
24500
|
initializeDependentFiltersService() {
|
|
24583
|
-
this.
|
|
24501
|
+
this._dependentFiltersService.initialize(this);
|
|
24584
24502
|
this._filterDataSubject
|
|
24585
24503
|
.pipe(skip(1)) // skip current value, only reinitialize for changes
|
|
24586
|
-
.subscribe(() => this.
|
|
24504
|
+
.subscribe(() => this._dependentFiltersService.reinitialize());
|
|
24587
24505
|
}
|
|
24588
24506
|
initResetButtonActivation() {
|
|
24589
24507
|
this.disableResetButton$ = combineLatest([
|
|
@@ -24598,7 +24516,7 @@ class QdFilterComponent {
|
|
|
24598
24516
|
}
|
|
24599
24517
|
comparableItemsOf(categories) {
|
|
24600
24518
|
return categories
|
|
24601
|
-
.flatMap(category => category.items)
|
|
24519
|
+
.flatMap(category => category.items ?? [])
|
|
24602
24520
|
.filter(item => item.item)
|
|
24603
24521
|
.map(item => {
|
|
24604
24522
|
const comparableItem = { ...item };
|
|
@@ -24608,12 +24526,12 @@ class QdFilterComponent {
|
|
|
24608
24526
|
}
|
|
24609
24527
|
get preselectedItems() {
|
|
24610
24528
|
return this.filterData.categories
|
|
24611
|
-
.flatMap(category => category.items)
|
|
24529
|
+
.flatMap(category => category.items ?? [])
|
|
24612
24530
|
.map(item => ({ active: false, ...item }))
|
|
24613
24531
|
.filter(item => item.item);
|
|
24614
24532
|
}
|
|
24615
24533
|
get hasPreselectionAfterRouterConnection$() {
|
|
24616
|
-
return this.
|
|
24534
|
+
return this._filterRouterConnectorService.connectFilterWithRouter(this).pipe(tap$1(() => this._filterConnectedWithRouterSubject.next()), switchMap$1(() => this.filterService.selectHasActiveCategory$(this.filterId)), take(1));
|
|
24617
24535
|
}
|
|
24618
24536
|
isUnchangedSince(currentPostBody, applied) {
|
|
24619
24537
|
if (!applied)
|
|
@@ -24627,15 +24545,15 @@ class QdFilterComponent {
|
|
|
24627
24545
|
return this.filterService.selectHasActiveCategory$(this.filterId).pipe(skip(1), filter(someCategoryActive => !someCategoryActive));
|
|
24628
24546
|
}
|
|
24629
24547
|
hasChangesByKey(changes, key) {
|
|
24630
|
-
const _diff = diff(changes
|
|
24548
|
+
const _diff = diff(changes['filterData'].currentValue, changes['filterData'].previousValue);
|
|
24631
24549
|
if (!_diff || !_diff.categories)
|
|
24632
24550
|
return false;
|
|
24633
24551
|
return Object.values(_diff.categories)?.filter(category => category && category[key] !== undefined).length > 0;
|
|
24634
24552
|
}
|
|
24635
24553
|
hasChangesByCategoriesLength(changes) {
|
|
24636
|
-
if (changes
|
|
24554
|
+
if (changes['filterData'].previousValue === undefined)
|
|
24637
24555
|
return false;
|
|
24638
|
-
return changes
|
|
24556
|
+
return (changes['filterData'].currentValue.categories.length !== changes['filterData'].previousValue.categories.length);
|
|
24639
24557
|
}
|
|
24640
24558
|
reInitFromStoreIfReMounted() {
|
|
24641
24559
|
this.filterService
|
|
@@ -25151,7 +25069,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
25151
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"] }]
|
|
25152
25070
|
}] });
|
|
25153
25071
|
|
|
25154
|
-
// @ts-strict-ignore
|
|
25155
25072
|
/**
|
|
25156
25073
|
* The **QdStatusPairsError** can display an error message that can be placed at the bottom inside a **QdStatusPairs**. < br />
|
|
25157
25074
|
* The message is displayed when a single **QdStatusPairsItem** is set to "Error".
|
|
@@ -25167,11 +25084,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
25167
25084
|
* description: The list picks up the error with a ContentChild query and shows it under the failing pair.
|
|
25168
25085
|
*/
|
|
25169
25086
|
class QdStatusPairsErrorComponent {
|
|
25170
|
-
|
|
25171
|
-
|
|
25087
|
+
error = false;
|
|
25088
|
+
_ref = inject(ChangeDetectorRef);
|
|
25172
25089
|
showError(error) {
|
|
25173
25090
|
this.error = error;
|
|
25174
|
-
this.
|
|
25091
|
+
this._ref.detectChanges();
|
|
25175
25092
|
}
|
|
25176
25093
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdStatusPairsErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
25177
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 });
|
|
@@ -25216,7 +25133,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
25216
25133
|
args: ['class.qd-status-pairs__item--error']
|
|
25217
25134
|
}] } });
|
|
25218
25135
|
|
|
25219
|
-
// @ts-strict-ignore
|
|
25220
25136
|
/**
|
|
25221
25137
|
* The **QdStatusPairs** renders key-value pairs. <br />
|
|
25222
25138
|
*
|
|
@@ -32408,11 +32324,11 @@ class QdReferencesFacetComponent {
|
|
|
32408
32324
|
return this.data[this.facet.name];
|
|
32409
32325
|
}
|
|
32410
32326
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdReferencesFacetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32411
|
-
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;
|
|
32327
|
+
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"] }] });
|
|
32412
32328
|
}
|
|
32413
32329
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdReferencesFacetComponent, decorators: [{
|
|
32414
32330
|
type: Component,
|
|
32415
|
-
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;
|
|
32331
|
+
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"] }]
|
|
32416
32332
|
}], propDecorators: { facet: [{
|
|
32417
32333
|
type: Input
|
|
32418
32334
|
}], data: [{
|
|
@@ -36187,7 +36103,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
36187
36103
|
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"] }]
|
|
36188
36104
|
}] });
|
|
36189
36105
|
|
|
36190
|
-
// @ts-strict-ignore
|
|
36191
36106
|
const loadJavascriptAsset = (path, scriptElementAttributes = {}) => {
|
|
36192
36107
|
const scriptElement = document.createElement('script');
|
|
36193
36108
|
scriptElement.setAttribute('src', path);
|
|
@@ -38830,11 +38745,11 @@ class QdQuickEditComponent {
|
|
|
38830
38745
|
this.controlContainer.control.valueChanges.pipe(takeUntilDestroyed(this._destroyRef), tap(() => this.changeDetectorRef.detectChanges())).subscribe();
|
|
38831
38746
|
}
|
|
38832
38747
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdQuickEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
38833
|
-
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 });
|
|
38748
|
+
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 });
|
|
38834
38749
|
}
|
|
38835
38750
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: QdQuickEditComponent, decorators: [{
|
|
38836
38751
|
type: Component,
|
|
38837
|
-
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:
|
|
38752
|
+
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"] }]
|
|
38838
38753
|
}], ctorParameters: () => [], propDecorators: { config: [{
|
|
38839
38754
|
type: Input,
|
|
38840
38755
|
args: [{ required: true }]
|