@hmcts/rpx-xui-common-lib 1.8.10-generic-filter-readonly-changes → 1.8.10-generic-filter-readonly-changes-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.
- package/bundles/hmcts-rpx-xui-common-lib.umd.js +166 -93
- package/bundles/hmcts-rpx-xui-common-lib.umd.js.map +1 -1
- package/bundles/hmcts-rpx-xui-common-lib.umd.min.js +1 -1
- package/bundles/hmcts-rpx-xui-common-lib.umd.min.js.map +1 -1
- package/esm2015/lib/components/find-location/find-location.component.js +3 -2
- package/esm2015/lib/components/find-service/find-service.component.js +7 -3
- package/esm2015/lib/components/generic-filter/generic-filter.component.js +79 -28
- package/esm2015/lib/components/search-service/search-service.component.js +12 -5
- package/esm2015/lib/models/filter.model.js +1 -1
- package/fesm2015/hmcts-rpx-xui-common-lib.js +130 -68
- package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/hmcts-rpx-xui-common-lib.metadata.json +1 -1
- package/lib/components/find-location/find-location.component.d.ts +1 -0
- package/lib/components/find-service/find-service.component.d.ts +3 -0
- package/lib/components/generic-filter/generic-filter.component.d.ts +3 -1
- package/lib/components/search-service/search-service.component.d.ts +2 -1
- package/lib/models/filter.model.d.ts +1 -0
- package/package.json +1 -1
|
@@ -856,6 +856,12 @@
|
|
|
856
856
|
_this.form.get('user-services').push(new forms.FormControl({ key: 'All', label: 'All' }));
|
|
857
857
|
}
|
|
858
858
|
};
|
|
859
|
+
this.searchTermServiceForm = this.fb.group({
|
|
860
|
+
searchTerm: ['']
|
|
861
|
+
});
|
|
862
|
+
this.searchTermLocationForm = this.fb.group({
|
|
863
|
+
searchTerm: ['']
|
|
864
|
+
});
|
|
859
865
|
}
|
|
860
866
|
Object.defineProperty(GenericFilterComponent.prototype, "config", {
|
|
861
867
|
get: function () {
|
|
@@ -909,7 +915,9 @@
|
|
|
909
915
|
var services = this.config.fields.find(function (field) { return field.name === 'user-services'; });
|
|
910
916
|
if (services) {
|
|
911
917
|
this.startFilterSkillsByServices(this.form, services);
|
|
912
|
-
this.
|
|
918
|
+
if (!this._config.copyFields) {
|
|
919
|
+
this.initValuesFromCacheForSkillsByServices();
|
|
920
|
+
}
|
|
913
921
|
}
|
|
914
922
|
};
|
|
915
923
|
GenericFilterComponent.prototype.ngOnDestroy = function () {
|
|
@@ -986,6 +994,7 @@
|
|
|
986
994
|
return field.disable ? field.disable : null;
|
|
987
995
|
};
|
|
988
996
|
GenericFilterComponent.prototype.applyFilter = function (form) {
|
|
997
|
+
var e_1, _a;
|
|
989
998
|
this.submitted = true;
|
|
990
999
|
form.markAsTouched();
|
|
991
1000
|
if (form.valid) {
|
|
@@ -1001,13 +1010,32 @@
|
|
|
1001
1010
|
else {
|
|
1002
1011
|
this.emitFormErrors(form);
|
|
1003
1012
|
}
|
|
1013
|
+
try {
|
|
1014
|
+
for (var _b = __values(this.config.fields), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1015
|
+
var field = _c.value;
|
|
1016
|
+
var fieldName = field.name;
|
|
1017
|
+
if (fieldName === 'user-services') {
|
|
1018
|
+
this.searchTermServiceForm.reset();
|
|
1019
|
+
}
|
|
1020
|
+
else if (fieldName === 'user-location') {
|
|
1021
|
+
this.searchTermLocationForm.reset();
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1026
|
+
finally {
|
|
1027
|
+
try {
|
|
1028
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1029
|
+
}
|
|
1030
|
+
finally { if (e_1) throw e_1.error; }
|
|
1031
|
+
}
|
|
1004
1032
|
if (this._config.applyButtonCallback) {
|
|
1005
1033
|
this._config.applyButtonCallback();
|
|
1006
1034
|
}
|
|
1007
1035
|
};
|
|
1008
1036
|
// when domain changes ensure that person field is reset
|
|
1009
1037
|
GenericFilterComponent.prototype.fieldChanged = function (field, form) {
|
|
1010
|
-
var
|
|
1038
|
+
var e_2, _a;
|
|
1011
1039
|
// TODO - Do similar with jurisdiction/service for caseworkers by services
|
|
1012
1040
|
if (field.changeResetFields && field.changeResetFields.length) {
|
|
1013
1041
|
try {
|
|
@@ -1016,12 +1044,12 @@
|
|
|
1016
1044
|
this.resetField(resetField, form);
|
|
1017
1045
|
}
|
|
1018
1046
|
}
|
|
1019
|
-
catch (
|
|
1047
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1020
1048
|
finally {
|
|
1021
1049
|
try {
|
|
1022
1050
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1023
1051
|
}
|
|
1024
|
-
finally { if (
|
|
1052
|
+
finally { if (e_2) throw e_2.error; }
|
|
1025
1053
|
}
|
|
1026
1054
|
}
|
|
1027
1055
|
};
|
|
@@ -1032,8 +1060,8 @@
|
|
|
1032
1060
|
this.form.get(name).patchValue(value);
|
|
1033
1061
|
}
|
|
1034
1062
|
};
|
|
1035
|
-
GenericFilterComponent.prototype.inputServiceChanged = function (
|
|
1036
|
-
if (
|
|
1063
|
+
GenericFilterComponent.prototype.inputServiceChanged = function (selectedNotAddedService, field) {
|
|
1064
|
+
if (selectedNotAddedService === undefined) {
|
|
1037
1065
|
this.addAllOption(field);
|
|
1038
1066
|
}
|
|
1039
1067
|
else {
|
|
@@ -1058,7 +1086,7 @@
|
|
|
1058
1086
|
}
|
|
1059
1087
|
};
|
|
1060
1088
|
GenericFilterComponent.prototype.updatePersonControls = function (values, field) {
|
|
1061
|
-
var
|
|
1089
|
+
var e_3, _a;
|
|
1062
1090
|
var keys;
|
|
1063
1091
|
if (!values) {
|
|
1064
1092
|
keys = Object.keys(this.form.get(field.name).value);
|
|
@@ -1075,12 +1103,12 @@
|
|
|
1075
1103
|
}
|
|
1076
1104
|
}
|
|
1077
1105
|
}
|
|
1078
|
-
catch (
|
|
1106
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1079
1107
|
finally {
|
|
1080
1108
|
try {
|
|
1081
1109
|
if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);
|
|
1082
1110
|
}
|
|
1083
|
-
finally { if (
|
|
1111
|
+
finally { if (e_3) throw e_3.error; }
|
|
1084
1112
|
}
|
|
1085
1113
|
};
|
|
1086
1114
|
GenericFilterComponent.prototype.checkBoxChecked = function (field, i) {
|
|
@@ -1090,7 +1118,7 @@
|
|
|
1090
1118
|
this.form.get(field.name).patchValue(values);
|
|
1091
1119
|
};
|
|
1092
1120
|
GenericFilterComponent.prototype.toggleSelectAll = function (event, form, item, field) {
|
|
1093
|
-
var
|
|
1121
|
+
var e_4, _a;
|
|
1094
1122
|
var isChecked = event.target.checked;
|
|
1095
1123
|
var formArray = form.get(field.name);
|
|
1096
1124
|
if (!item.selectAll) {
|
|
@@ -1135,12 +1163,12 @@
|
|
|
1135
1163
|
this.resetField(resetField, form);
|
|
1136
1164
|
}
|
|
1137
1165
|
}
|
|
1138
|
-
catch (
|
|
1166
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
1139
1167
|
finally {
|
|
1140
1168
|
try {
|
|
1141
1169
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1142
1170
|
}
|
|
1143
|
-
finally { if (
|
|
1171
|
+
finally { if (e_4) throw e_4.error; }
|
|
1144
1172
|
}
|
|
1145
1173
|
}
|
|
1146
1174
|
if (field.name === 'user-services') {
|
|
@@ -1172,7 +1200,7 @@
|
|
|
1172
1200
|
this.filterSkillsByServices(servicesArray, this.config);
|
|
1173
1201
|
};
|
|
1174
1202
|
GenericFilterComponent.prototype.resetField = function (resetField, form) {
|
|
1175
|
-
var
|
|
1203
|
+
var e_5, _a;
|
|
1176
1204
|
var control = form.get(resetField);
|
|
1177
1205
|
var defaultValue = this.config.cancelSetting.fields.find(function (f) { return f.name === resetField; });
|
|
1178
1206
|
if (control instanceof forms.FormArray) {
|
|
@@ -1188,12 +1216,12 @@
|
|
|
1188
1216
|
this.resetField(key, control);
|
|
1189
1217
|
}
|
|
1190
1218
|
}
|
|
1191
|
-
catch (
|
|
1219
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1192
1220
|
finally {
|
|
1193
1221
|
try {
|
|
1194
1222
|
if (keys_2_1 && !keys_2_1.done && (_a = keys_2.return)) _a.call(keys_2);
|
|
1195
1223
|
}
|
|
1196
|
-
finally { if (
|
|
1224
|
+
finally { if (e_5) throw e_5.error; }
|
|
1197
1225
|
}
|
|
1198
1226
|
}
|
|
1199
1227
|
else if (control instanceof forms.FormControl) {
|
|
@@ -1216,7 +1244,7 @@
|
|
|
1216
1244
|
this._settings = this.filterService.get(this.config.id);
|
|
1217
1245
|
};
|
|
1218
1246
|
GenericFilterComponent.prototype.buildForm = function (config, settings, reset) {
|
|
1219
|
-
var
|
|
1247
|
+
var e_6, _a;
|
|
1220
1248
|
var findPersonControl = this.form ? this.form.get('findPersonControl') : null;
|
|
1221
1249
|
this.form = this.fb.group({});
|
|
1222
1250
|
if (findPersonControl) {
|
|
@@ -1281,16 +1309,16 @@
|
|
|
1281
1309
|
_loop_1(field);
|
|
1282
1310
|
}
|
|
1283
1311
|
}
|
|
1284
|
-
catch (
|
|
1312
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
1285
1313
|
finally {
|
|
1286
1314
|
try {
|
|
1287
1315
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1288
1316
|
}
|
|
1289
|
-
finally { if (
|
|
1317
|
+
finally { if (e_6) throw e_6.error; }
|
|
1290
1318
|
}
|
|
1291
1319
|
};
|
|
1292
1320
|
GenericFilterComponent.prototype.buildCheckBoxFormArray = function (field, settings) {
|
|
1293
|
-
var
|
|
1321
|
+
var e_7, _a;
|
|
1294
1322
|
var validators = GenericFilterComponent.addFormValidators(field);
|
|
1295
1323
|
var formArray = this.fb.array([], validators);
|
|
1296
1324
|
var defaultValues;
|
|
@@ -1310,17 +1338,17 @@
|
|
|
1310
1338
|
_loop_2(option);
|
|
1311
1339
|
}
|
|
1312
1340
|
}
|
|
1313
|
-
catch (
|
|
1341
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1314
1342
|
finally {
|
|
1315
1343
|
try {
|
|
1316
1344
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1317
1345
|
}
|
|
1318
|
-
finally { if (
|
|
1346
|
+
finally { if (e_7) throw e_7.error; }
|
|
1319
1347
|
}
|
|
1320
1348
|
return formArray;
|
|
1321
1349
|
};
|
|
1322
1350
|
GenericFilterComponent.prototype.buildFormArray = function (field, settings) {
|
|
1323
|
-
var
|
|
1351
|
+
var e_8, _a;
|
|
1324
1352
|
var validators = GenericFilterComponent.addFormValidators(field);
|
|
1325
1353
|
var formArray = this.fb.array([], validators);
|
|
1326
1354
|
var defaultValues;
|
|
@@ -1333,12 +1361,12 @@
|
|
|
1333
1361
|
formArray.push(new forms.FormControl(defaultValue));
|
|
1334
1362
|
}
|
|
1335
1363
|
}
|
|
1336
|
-
catch (
|
|
1364
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1337
1365
|
finally {
|
|
1338
1366
|
try {
|
|
1339
1367
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1340
1368
|
}
|
|
1341
|
-
finally { if (
|
|
1369
|
+
finally { if (e_8) throw e_8.error; }
|
|
1342
1370
|
}
|
|
1343
1371
|
}
|
|
1344
1372
|
}
|
|
@@ -1362,26 +1390,33 @@
|
|
|
1362
1390
|
});
|
|
1363
1391
|
};
|
|
1364
1392
|
GenericFilterComponent.prototype.emitFormErrors = function (form) {
|
|
1365
|
-
var
|
|
1393
|
+
var e_9, _a;
|
|
1366
1394
|
var errors = [];
|
|
1367
1395
|
try {
|
|
1368
1396
|
for (var _b = __values(this.config.fields), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1369
1397
|
var field = _c.value;
|
|
1370
|
-
var
|
|
1398
|
+
var fieldName = field.name;
|
|
1399
|
+
var formGroup = form.get(fieldName);
|
|
1371
1400
|
if (formGroup && formGroup.errors && (formGroup.errors.minlength || formGroup.errors.required)) {
|
|
1372
|
-
errors.push({ name:
|
|
1401
|
+
errors.push({ name: fieldName, error: field.minSelectedError });
|
|
1402
|
+
if (fieldName === 'user-services') {
|
|
1403
|
+
this.searchTermServiceForm.reset();
|
|
1404
|
+
}
|
|
1405
|
+
else if (fieldName === 'user-location') {
|
|
1406
|
+
this.searchTermLocationForm.reset();
|
|
1407
|
+
}
|
|
1373
1408
|
}
|
|
1374
1409
|
if (formGroup && formGroup.errors && formGroup.errors.maxlength) {
|
|
1375
|
-
errors.push({ name:
|
|
1410
|
+
errors.push({ name: fieldName, error: field.maxSelectedError });
|
|
1376
1411
|
}
|
|
1377
1412
|
}
|
|
1378
1413
|
}
|
|
1379
|
-
catch (
|
|
1414
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
1380
1415
|
finally {
|
|
1381
1416
|
try {
|
|
1382
1417
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1383
1418
|
}
|
|
1384
|
-
finally { if (
|
|
1419
|
+
finally { if (e_9) throw e_9.error; }
|
|
1385
1420
|
}
|
|
1386
1421
|
// remove duplicates
|
|
1387
1422
|
errors = errors.filter(function (filterError, i, arr) {
|
|
@@ -1451,29 +1486,56 @@
|
|
|
1451
1486
|
userSkillsCheckboxField.options = [];
|
|
1452
1487
|
userSkillsCheckboxField.options = this.filteredSkillsByServicesCheckbox;
|
|
1453
1488
|
this.form.setControl('user-skills', new forms.FormArray([]));
|
|
1454
|
-
this.
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
var
|
|
1459
|
-
|
|
1460
|
-
if (_this.
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1489
|
+
if (!this._config.copyFields) {
|
|
1490
|
+
this.filteredSkillsByServicesCheckbox.forEach(function () {
|
|
1491
|
+
_this.form.get('user-skills').push(new forms.FormControl(false));
|
|
1492
|
+
});
|
|
1493
|
+
var prevValues = this.filteredSkillsByServicesCheckbox.map(function (skill) {
|
|
1494
|
+
var selected = false;
|
|
1495
|
+
if (_this.settings && _this.settings.fields) {
|
|
1496
|
+
if (_this.previousSelectedNestedCheckbox.length > 0) {
|
|
1497
|
+
selected = _this.previousSelectedNestedCheckbox.includes(skill.key);
|
|
1498
|
+
}
|
|
1499
|
+
var isSelectedUserSkill = void 0;
|
|
1500
|
+
var selectedUserSkills = _this.settings.fields.find(function (setting) { return setting.name === 'user-skills'; });
|
|
1501
|
+
if (selectedUserSkills && selectedUserSkills.value && selectedUserSkills.value.length > 0) {
|
|
1502
|
+
isSelectedUserSkill = selectedUserSkills.value.findIndex(function (val) { return Number(val) === Number(skill.key); });
|
|
1503
|
+
selected = isSelectedUserSkill !== -1;
|
|
1504
|
+
}
|
|
1505
|
+
if (_this.previousSelectedNestedCheckbox.length > 0) {
|
|
1506
|
+
// Pick up from previous selected
|
|
1507
|
+
selected = _this.previousSelectedNestedCheckbox.includes(String(skill.key));
|
|
1508
|
+
}
|
|
1468
1509
|
}
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1510
|
+
return selected;
|
|
1511
|
+
});
|
|
1512
|
+
this.form.get('user-skills').setValue(prevValues);
|
|
1513
|
+
}
|
|
1514
|
+
else {
|
|
1515
|
+
var preSelectedSkills_1 = [];
|
|
1516
|
+
this.filteredSkillsByServicesCheckbox.map(function (skillsByServices, index) {
|
|
1517
|
+
for (var i = 0; i < _this._config.preSelectedNestedCheckbox.length; i++) {
|
|
1518
|
+
var skillCopyValue = _this._config.preSelectedNestedCheckbox[i];
|
|
1519
|
+
if (skillCopyValue.toString() === skillsByServices.key.toString()) {
|
|
1520
|
+
preSelectedSkills_1[index] = true;
|
|
1521
|
+
break;
|
|
1522
|
+
}
|
|
1523
|
+
else {
|
|
1524
|
+
preSelectedSkills_1[index] = false;
|
|
1525
|
+
}
|
|
1472
1526
|
}
|
|
1527
|
+
});
|
|
1528
|
+
if (preSelectedSkills_1.length > 0) {
|
|
1529
|
+
preSelectedSkills_1.forEach(function (h) {
|
|
1530
|
+
_this.form.get('user-skills').push(new forms.FormControl(h));
|
|
1531
|
+
});
|
|
1473
1532
|
}
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1533
|
+
else {
|
|
1534
|
+
this.filteredSkillsByServicesCheckbox.map(function () {
|
|
1535
|
+
_this.form.get('user-skills').push(new forms.FormControl(false));
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1477
1539
|
return this.filteredSkillsByServicesCheckbox;
|
|
1478
1540
|
}
|
|
1479
1541
|
}
|
|
@@ -1513,7 +1575,7 @@
|
|
|
1513
1575
|
GenericFilterComponent.decorators = [
|
|
1514
1576
|
{ type: i0.Component, args: [{
|
|
1515
1577
|
selector: 'xuilib-generic-filter',
|
|
1516
|
-
template: "<form [formGroup]=\"form\" (ngSubmit)=\"applyFilter(form)\">\n <div class=\"contain-classes\" *ngFor=\"let field of config.fields\">\n <hr *ngIf=\"field.lineBreakBefore\" class=\"govuk-section-break govuk-section-break--visible elevated-break\">\n <ng-container [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'group-title'\">\n <div [class]=\"field.titleClasses ? field.titleClasses: 'govuk-label govuk-label--m govuk-!-margin-bottom-4'\">\n {{ field.name | capitalize }}\n </div>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <div class=\"govuk-form-group xui-generic-filter\"\n [hidden]=\"hidden(field, form)\"\n [id]=\"field.name\"\n [ngClass]=\"{'form-group-error': submitted && (form.get(field.name).errors?.minLength || form.get(field.name).errors?.maxLength)}\">\n <div *ngIf=\"field.title\" class=\"xui-generic-filter__field-title\">\n <h3 [class]=\"field.titleClasses ? field.titleClasses : 'govuk-heading-s'\" style=\"margin-bottom: 0!important\">\n {{field.title | capitalize}}\n </h3>\n <div *ngIf=\"field?.titleHint\" class=\"govuk-!-margin-left-2\">\n {{ field.titleHint }}\n </div>\n </div>\n <p class=\"govuk-body\" *ngIf=\"field.subTitle\">{{field.subTitle}}</p>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMinSelectedError && submitted && form.get(field.name).errors?.minLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.minSelectedError}}\n </span>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMaxSelectedError && submitted && form.get(field.name).errors?.maxLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.maxSelectedError}}\n </span>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\"\n *ngIf=\"field.emailError && submitted && form.get(field.name).errors?.email\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.emailError}}\n </span>\n <div class=\"govuk-body\" [class.govuk-body--maxWidth480px]=\"field.maxWidth480px\" [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <select class=\"govuk-select\" (change)=\"fieldChanged(field, form)\" [attr.disabled]=\"disabled(field, form)\" [name]=\"'select_' + field.name\" [id]=\"'select_' + field.name\" [formControlName]=\"field.name\">\n <option disabled selected hidden value=\"\">{{field.disabledText}}</option>\n <option *ngIf=\"field.defaultOption\" [attr.selected]=\"true\" [value]=\"field.defaultOption.key\">{{field.defaultOption.label}}</option>\n <option class=\"govuk-radios__item\" *ngFor=\"let item of field.options\" [value]=\"item.key\">{{item.label}}</option>\n </select>\n </ng-container>\n <ng-container *ngSwitchCase=\"'group-select'\">\n <select class=\"govuk-select\" (change)=\"fieldChanged(field, form)\" [attr.disabled]=\"disabled(field, form)\" [name]=\"'select_' + field.name\" [id]=\"'select_' + field.name\" [formControlName]=\"field.name\">\n <option disabled selected hidden value=\"\">{{field.disabledText}}</option>\n <option *ngIf=\"field.defaultOption\" selected [value]=\"field.defaultOption.key\">{{field.defaultOption.label}}</option>\n <optgroup *ngFor = 'let grp of filteredSkillsByServices' label=\"{{grp.group | titlecase}}\">\n <option *ngFor = 'let item of grp.options' [value]=\"item.key\">{{item.label}}</option>\n </optgroup>\n </select>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div class=\"govuk-checkboxes govuk-checkboxes--small\" [formGroupName]=\"field.name\" [attr.field]=\"field.name\" [id]=\"'checkbox_' + field.name\">\n <div *ngFor=\"let item of field.options; let i = index\" class=\"govuk-checkboxes__item\">\n <input type=\"checkbox\" class=\"govuk-checkboxes__input\"\n [attr.disabled]=\"disabled(field, form)\"\n [formControlName]=\"i\"\n (change)=\"toggleSelectAll($event, form, item, field)\"\n [value]=\"item.key\" [id]=\"'checkbox_' + field.name + item.key\"\n [name]=\"'checkbox_' + field.name + item.key\"\n />\n <label\n [for]=\"'checkbox_' + field.name + item.key\"\n class=\"govuk-label govuk-checkboxes__label\"\n [ngClass]=\"{'govuk-!-font-weight-bold': item.selectAll}\"\n >{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'nested-checkbox'\">\n <div class=\"govuk-checkboxes govuk-checkboxes--small\" [formGroupName]=\"field.name\" [attr.field]=\"field.name\" [id]=\"'checkbox_' + field.name\">\n <div *ngFor=\"let item of filteredSkillsByServicesCheckbox; let i = index\" class=\"govuk-checkboxes__item\">\n <input type=\"checkbox\" class=\"govuk-checkboxes__input\"\n [attr.disabled]=\"disabled(field, form)\"\n [formControlName]=\"i\"\n (change)=\"toggleSelectAll($event, form, item, field)\"\n [value]=\"item.key\" [id]=\"'checkbox_' + field.name + item.key\"\n [name]=\"'checkbox_' + field.name + item.key\"\n />\n <label\n [for]=\"'checkbox_' + field.name + item.key\"\n class=\"govuk-label govuk-checkboxes__label\"\n [ngClass]=\"{'govuk-!-font-weight-bold': item.selectAll}\"\n >{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox-large'\">\n <div class=\"govuk-checkboxes\" [formGroupName]=\"field.name\" [attr.field]=\"field.name\" [id]=\"'checkbox_' + field.name\">\n <div *ngFor=\"let item of field.options; let i = index\" class=\"govuk-checkboxes__item\">\n <input type=\"checkbox\" class=\"govuk-checkboxes__input\"\n [attr.disabled]=\"disabled(field, form)\"\n [formControlName]=\"i\"\n (change)=\"toggleSelectAll($event, form, item, field)\"\n [value]=\"item.key\" [id]=\"'checkbox_' + field.name + item.key\"\n [name]=\"'checkbox_' + field.name + item.key\"\n />\n <label\n [for]=\"'checkbox_' + field.name + item.key\"\n class=\"govuk-label govuk-checkboxes__label\"\n [ngClass]=\"{'govuk-!-font-weight-bold': item.selectAll}\"\n >{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'radio'\">\n <div class=\"govuk-radios\">\n <div *ngFor=\"let item of field.options\" class=\"govuk-radios__item\">\n <input type=\"radio\"\n [formControlName]=\"field.name\"\n [id]=\"'radio_' + item.key\"\n [attr.disabled]=\"disabled(field, form)\"\n [checked]=\"item.key === form.get(field.name).value\"\n class=\"govuk-radios__input\"\n [value]=\"item.key\"\n (change)=\"fieldChanged(field, form)\"\n />\n <label [for]=\"'radio_' + item.key\" class=\"govuk-label govuk-radios__label\">{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-person'\">\n <xuilib-find-person subTitle=\"\" (personSelected)=\"updatePersonControls($event, field)\"\n (personFieldChanged)=\"inputChanged(field)\"\n [submitted]=\"submitted\"\n [disabled]=\"disabled(field, form)\"\n [domain]=\"form.get(field.domainField)?.value\"\n [findPersonGroup]=\"form\"\n [selectedPerson]=\"form.get(field.name)?.value?.email\"\n [userIncluded]=\"false\"\n [placeholderContent]=\"field.placeholderContent ? field.placeholderContent : ''\"\n [services]=\"form.get(field.servicesField)?.value\"\n ></xuilib-find-person>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-location'\">\n <xuilib-find-location (locationFieldChanged)=\"inputChanged(field)\"\n [form]=\"form\"\n [fields]=\"config.fields\"\n [locationTitle]=\"field.locationTitle\"\n [enableAddLocationButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [disableInputField]=\"field.disable\"\n [selectedLocations]=\"form.get(field.name)?.value\"\n [submitted]=\"submitted\"\n [field]=\"field\"\n [services]=\"form.get(field.findLocationField)?.value\"\n ></xuilib-find-location>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-task-name'\">\n <xuilib-find-task-name subTitle=\"\" (taskNameSelected)=\"updateTaskNameControls($event, field)\"\n (taskNameFieldChanged)=\"inputChanged(field)\"\n [submitted]=\"submitted\"\n [disabled]=\"disabled(field, form)\"\n [domain]=\"form.get(field.domainField)?.value\"\n [findTaskNameGroup]=\"form\"\n [selectedTaskName]=\"form.get(field.name).value.taskName\"\n [userIncluded]=\"false\"\n ></xuilib-find-task-name>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-service'\">\n <xuilib-find-service (serviceFieldChanged)=\"inputServiceChanged($event, field)\"\n [form]=\"form\"\n [fields]=\"config.fields\"\n [title]=\"field.title\"\n [enableAddServiceButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [selectedServices]=\"form.get(field.name)?.value\"\n [services]=\"field.options\"\n [field]=\"field\">\n ></xuilib-find-service>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text-input'\">\n <input class=\"govuk-input\" type=\"text\"\n [formControlName]=\"field.name\"\n [id]=\"field.name\"\n [attr.disabled]=\"disabled(field, form)\"\n (change)=\"fieldChanged(field, form)\"\n [attr.maxlength]=\"field.maxlength ? field.maxlength : null\"\n [readonly]=\"field.readonly\"\n />\n </ng-container>\n <ng-container *ngSwitchCase=\"'email-input'\">\n <input class=\"govuk-input\" type=\"email\"\n [formControlName]=\"field.name\"\n [id]=\"field.name\"\n [attr.disabled]=\"disabled(field, form)\"\n (change)=\"fieldChanged(field, form)\"\n [readonly]=\"field.readonly\"\n />\n </ng-container>\n </div>\n </div>\n </ng-container>\n</ng-container>\n </div>\n <hr class=\"govuk-section-break govuk-section-break--m govuk-section-break--visible\"/>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <button\n class=\"govuk-button govuk-!-margin-right-1 govuk-!-margin-bottom-0\"\n type=\"submit\"\n id=\"applyFilter\"\n [disabled]=\"config.enableDisabledButton && form.invalid\"\n >{{config.applyButtonText || 'Apply'}}</button>\n <button *ngIf=\"config.showCancelFilterButton\"\n class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\"\n type=\"button\"\n id=\"cancelFilter\"\n (click)=\"cancelFilter()\">{{ config.cancelButtonText || 'Cancel'}}</button>\n </div>\n </div>\n</form>\n",
|
|
1578
|
+
template: "<form [formGroup]=\"form\" (ngSubmit)=\"applyFilter(form)\">\n <div class=\"contain-classes\" *ngFor=\"let field of config.fields\">\n <hr *ngIf=\"field.lineBreakBefore\" class=\"govuk-section-break govuk-section-break--visible elevated-break\">\n <ng-container [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'group-title'\">\n <div [class]=\"field.titleClasses ? field.titleClasses: 'govuk-label govuk-label--m govuk-!-margin-bottom-4'\">\n {{ field.name | capitalize }}\n </div>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <div class=\"govuk-form-group xui-generic-filter\"\n [hidden]=\"hidden(field, form)\"\n [id]=\"field.name\"\n [ngClass]=\"{'form-group-error': submitted && (form.get(field.name).errors?.minLength || form.get(field.name).errors?.maxLength)}\">\n <div *ngIf=\"field.title\" class=\"xui-generic-filter__field-title\">\n <h3 [class]=\"field.titleClasses ? field.titleClasses : 'govuk-heading-s'\" style=\"margin-bottom: 0!important\">\n {{field.title | capitalize}}\n </h3>\n <div *ngIf=\"field?.titleHint\" class=\"govuk-!-margin-left-2\">\n {{ field.titleHint }}\n </div>\n </div>\n <p class=\"govuk-body\" *ngIf=\"field.subTitle\">{{field.subTitle}}</p>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMinSelectedError && submitted && form.get(field.name).errors?.minLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.minSelectedError}}\n </span>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMaxSelectedError && submitted && form.get(field.name).errors?.maxLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.maxSelectedError}}\n </span>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\"\n *ngIf=\"field.emailError && submitted && form.get(field.name).errors?.email\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.emailError}}\n </span>\n <div class=\"govuk-body\" [class.govuk-body--maxWidth480px]=\"field.maxWidth480px\" [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <select class=\"govuk-select\" (change)=\"fieldChanged(field, form)\" [attr.disabled]=\"disabled(field, form)\" [name]=\"'select_' + field.name\" [id]=\"'select_' + field.name\" [formControlName]=\"field.name\">\n <option disabled selected hidden value=\"\">{{field.disabledText}}</option>\n <option *ngIf=\"field.defaultOption\" [attr.selected]=\"true\" [value]=\"field.defaultOption.key\">{{field.defaultOption.label}}</option>\n <option class=\"govuk-radios__item\" *ngFor=\"let item of field.options\" [value]=\"item.key\">{{item.label}}</option>\n </select>\n </ng-container>\n <ng-container *ngSwitchCase=\"'group-select'\">\n <select class=\"govuk-select\" (change)=\"fieldChanged(field, form)\" [attr.disabled]=\"disabled(field, form)\" [name]=\"'select_' + field.name\" [id]=\"'select_' + field.name\" [formControlName]=\"field.name\">\n <option disabled selected hidden value=\"\">{{field.disabledText}}</option>\n <option *ngIf=\"field.defaultOption\" selected [value]=\"field.defaultOption.key\">{{field.defaultOption.label}}</option>\n <optgroup *ngFor = 'let grp of filteredSkillsByServices' label=\"{{grp.group | titlecase}}\">\n <option *ngFor = 'let item of grp.options' [value]=\"item.key\">{{item.label}}</option>\n </optgroup>\n </select>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div class=\"govuk-checkboxes govuk-checkboxes--small\" [formGroupName]=\"field.name\" [attr.field]=\"field.name\" [id]=\"'checkbox_' + field.name\">\n <div *ngFor=\"let item of field.options; let i = index\" class=\"govuk-checkboxes__item\">\n <input type=\"checkbox\" class=\"govuk-checkboxes__input\"\n [attr.disabled]=\"disabled(field, form)\"\n [formControlName]=\"i\"\n (change)=\"toggleSelectAll($event, form, item, field)\"\n [value]=\"item.key\" [id]=\"'checkbox_' + field.name + item.key\"\n [name]=\"'checkbox_' + field.name + item.key\"\n />\n <label\n [for]=\"'checkbox_' + field.name + item.key\"\n class=\"govuk-label govuk-checkboxes__label\"\n [ngClass]=\"{'govuk-!-font-weight-bold': item.selectAll}\"\n >{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'nested-checkbox'\">\n <div class=\"govuk-checkboxes govuk-checkboxes--small\" [formGroupName]=\"field.name\" [attr.field]=\"field.name\" [id]=\"'checkbox_' + field.name\">\n <div *ngFor=\"let item of filteredSkillsByServicesCheckbox; let i = index\" class=\"govuk-checkboxes__item\">\n <input type=\"checkbox\" class=\"govuk-checkboxes__input\"\n [attr.disabled]=\"disabled(field, form)\"\n [formControlName]=\"i\"\n (change)=\"toggleSelectAll($event, form, item, field)\"\n [value]=\"item.key\" [id]=\"'checkbox_' + field.name + item.key\"\n [name]=\"'checkbox_' + field.name + item.key\"\n />\n <label\n [for]=\"'checkbox_' + field.name + item.key\"\n class=\"govuk-label govuk-checkboxes__label\"\n [ngClass]=\"{'govuk-!-font-weight-bold': item.selectAll}\"\n >{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox-large'\">\n <div class=\"govuk-checkboxes\" [formGroupName]=\"field.name\" [attr.field]=\"field.name\" [id]=\"'checkbox_' + field.name\">\n <div *ngFor=\"let item of field.options; let i = index\" class=\"govuk-checkboxes__item\">\n <input type=\"checkbox\" class=\"govuk-checkboxes__input\"\n [attr.disabled]=\"disabled(field, form)\"\n [formControlName]=\"i\"\n (change)=\"toggleSelectAll($event, form, item, field)\"\n [value]=\"item.key\" [id]=\"'checkbox_' + field.name + item.key\"\n [name]=\"'checkbox_' + field.name + item.key\"\n />\n <label\n [for]=\"'checkbox_' + field.name + item.key\"\n class=\"govuk-label govuk-checkboxes__label\"\n [ngClass]=\"{'govuk-!-font-weight-bold': item.selectAll}\"\n >{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'radio'\">\n <div class=\"govuk-radios\">\n <div *ngFor=\"let item of field.options\" class=\"govuk-radios__item\">\n <input type=\"radio\"\n [formControlName]=\"field.name\"\n [id]=\"'radio_' + item.key\"\n [attr.disabled]=\"disabled(field, form)\"\n [checked]=\"item.key === form.get(field.name).value\"\n class=\"govuk-radios__input\"\n [value]=\"item.key\"\n (change)=\"fieldChanged(field, form)\"\n />\n <label [for]=\"'radio_' + item.key\" class=\"govuk-label govuk-radios__label\">{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-person'\">\n <xuilib-find-person subTitle=\"\" (personSelected)=\"updatePersonControls($event, field)\"\n (personFieldChanged)=\"inputChanged(field)\"\n [submitted]=\"submitted\"\n [disabled]=\"disabled(field, form)\"\n [domain]=\"form.get(field.domainField)?.value\"\n [findPersonGroup]=\"form\"\n [selectedPerson]=\"form.get(field.name)?.value?.email\"\n [userIncluded]=\"false\"\n [placeholderContent]=\"field.placeholderContent ? field.placeholderContent : ''\"\n [services]=\"form.get(field.servicesField)?.value\"\n ></xuilib-find-person>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-location'\">\n <xuilib-find-location (locationFieldChanged)=\"inputChanged(field)\"\n [form]=\"form\"\n [fields]=\"config.fields\"\n [searchTermLocationForm]=\"searchTermLocationForm\"\n [locationTitle]=\"field.locationTitle\"\n [enableAddLocationButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [disableInputField]=\"field.disable\"\n [selectedLocations]=\"form.get(field.name)?.value\"\n [submitted]=\"submitted\"\n [field]=\"field\"\n [services]=\"form.get(field.findLocationField)?.value\"\n ></xuilib-find-location>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-task-name'\">\n <xuilib-find-task-name subTitle=\"\" (taskNameSelected)=\"updateTaskNameControls($event, field)\"\n (taskNameFieldChanged)=\"inputChanged(field)\"\n [submitted]=\"submitted\"\n [disabled]=\"disabled(field, form)\"\n [domain]=\"form.get(field.domainField)?.value\"\n [findTaskNameGroup]=\"form\"\n [selectedTaskName]=\"form.get(field.name).value.taskName\"\n [userIncluded]=\"false\"\n ></xuilib-find-task-name>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-service'\">\n <xuilib-find-service (serviceFieldChanged)=\"inputServiceChanged($event, field)\"\n [form]=\"form\"\n [searchTermServiceForm]=\"searchTermServiceForm\"\n [fields]=\"config.fields\"\n [title]=\"field.title\"\n [enableAddServiceButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [selectedServices]=\"form.get(field.name)?.value\"\n [services]=\"field.options\"\n [field]=\"field\">\n ></xuilib-find-service>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text-input'\">\n <input class=\"govuk-input\" type=\"text\"\n [formControlName]=\"field.name\"\n [id]=\"field.name\"\n [attr.disabled]=\"disabled(field, form)\"\n (change)=\"fieldChanged(field, form)\"\n [attr.maxlength]=\"field.maxlength ? field.maxlength : null\"\n [readonly]=\"field.readonly\"\n />\n </ng-container>\n <ng-container *ngSwitchCase=\"'email-input'\">\n <input class=\"govuk-input\" type=\"email\"\n [formControlName]=\"field.name\"\n [id]=\"field.name\"\n [attr.disabled]=\"disabled(field, form)\"\n (change)=\"fieldChanged(field, form)\"\n [readonly]=\"field.readonly\"\n />\n </ng-container>\n </div>\n </div>\n </ng-container>\n</ng-container>\n </div>\n <hr class=\"govuk-section-break govuk-section-break--m govuk-section-break--visible\"/>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <button\n class=\"govuk-button govuk-!-margin-right-1 govuk-!-margin-bottom-0\"\n type=\"submit\"\n id=\"applyFilter\"\n [disabled]=\"config.enableDisabledButton && form.invalid\"\n >{{config.applyButtonText || 'Apply'}}</button>\n <button *ngIf=\"config.showCancelFilterButton\"\n class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\"\n type=\"button\"\n id=\"cancelFilter\"\n (click)=\"cancelFilter()\">{{ config.cancelButtonText || 'Cancel'}}</button>\n </div>\n </div>\n</form>\n",
|
|
1517
1579
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1518
1580
|
encapsulation: i0.ViewEncapsulation.None,
|
|
1519
1581
|
styles: [".contain-classes .elevated-break{margin-bottom:20px}@media (min-width:40.0625em){.contain-classes .elevated-break{margin-bottom:30px}}.contain-classes .govuk-body--maxWidth480px{max-width:480px}.contain-classes .xui-generic-filter .select-all{margin-bottom:10px}.contain-classes .xui-generic-filter .govuk-checkboxes{display:flex;flex-direction:column;flex-wrap:wrap}.contain-classes .xui-generic-filter .govuk-checkboxes>div{flex-grow:1;flex-shrink:0}.contain-classes .xui-generic-filter__field-title{display:flex;align-items:center;margin-bottom:10px}.contain-classes .govuk-select{width:100%}"]
|
|
@@ -3212,7 +3274,7 @@
|
|
|
3212
3274
|
FindLocationComponent.decorators = [
|
|
3213
3275
|
{ type: i0.Component, args: [{
|
|
3214
3276
|
selector: 'xuilib-find-location',
|
|
3215
|
-
template: "<div class=\"location-picker-custom\">\n <div class=\"search-location\">\n <div>\n <label id=\"input-selected-location-label\" *ngIf=\"locationTitle\">{{locationTitle}}</label>\n </div>\n <exui-search-location class=\"search-location\"\n [locations]=\"locations\"\n [selectedLocations]=\"selectedLocations\"\n [singleMode]=\"field.maxSelected === 1\"\n [bookingCheck]=\"field.bookingCheckType\"\n [delay]=\"300\"\n [disabled]=\"disabled\"\n [serviceIds]=\"serviceIds\"\n (locationInputChanged)=\"onInputChanged($event)\"\n (locationSelected)=\"onLocationSelected($event)\"\n (searchLocationChanged)=\"onSearchInputChanged()\"\n [locationType]=\"'case-management'\"></exui-search-location>\n <a href=\"javascript:void(0)\" (click)=\"addLocation()\" class=\"govuk-button\" data-module=\"govuk-button\" *ngIf=\"enableAddLocationButton\">\n Add location\n </a>\n </div>\n <ul class=\"hmcts-filter-tags selection-container\" *ngIf=\"field.maxSelected != 1\">\n <li class=\"location-selection\" *ngFor=\"let selection of selectedLocations\">\n <a class=\"hmcts-filter__tag\" (click)=\"removeLocation(selection)\" href=\"javascript:void(0)\">\n {{ selection.site_name }}\n </a>\n </li>\n </ul>\n</div>\n",
|
|
3277
|
+
template: "<div class=\"location-picker-custom\">\n <div class=\"search-location\">\n <div>\n <label id=\"input-selected-location-label\" *ngIf=\"locationTitle\">{{locationTitle}}</label>\n </div>\n <exui-search-location class=\"search-location\"\n [form]=\"searchTermLocationForm\"\n [locations]=\"locations\"\n [selectedLocations]=\"selectedLocations\"\n [singleMode]=\"field.maxSelected === 1\"\n [bookingCheck]=\"field.bookingCheckType\"\n [delay]=\"300\"\n [disabled]=\"disabled\"\n [serviceIds]=\"serviceIds\"\n (locationInputChanged)=\"onInputChanged($event)\"\n (locationSelected)=\"onLocationSelected($event)\"\n (searchLocationChanged)=\"onSearchInputChanged()\"\n [locationType]=\"'case-management'\"></exui-search-location>\n <a href=\"javascript:void(0)\" (click)=\"addLocation()\" class=\"govuk-button\" data-module=\"govuk-button\" *ngIf=\"enableAddLocationButton\">\n Add location\n </a>\n </div>\n <ul class=\"hmcts-filter-tags selection-container\" *ngIf=\"field.maxSelected != 1\">\n <li class=\"location-selection\" *ngFor=\"let selection of selectedLocations\">\n <a class=\"hmcts-filter__tag\" (click)=\"removeLocation(selection)\" href=\"javascript:void(0)\">\n {{ selection.site_name }}\n </a>\n </li>\n </ul>\n</div>\n",
|
|
3216
3278
|
styles: [".search-location__input-container{display:flex}.search-location .auto-complete-container{min-width:unset;width:calc(100% - 4px)}.search-location__input{flex:1 0 auto}.search-location .govuk-button--secondary{background-color:#ddd}"]
|
|
3217
3279
|
},] }
|
|
3218
3280
|
];
|
|
@@ -3226,6 +3288,7 @@
|
|
|
3226
3288
|
fields: [{ type: i0.Input }],
|
|
3227
3289
|
locationTitle: [{ type: i0.Input }],
|
|
3228
3290
|
disableInputField: [{ type: i0.Input }],
|
|
3291
|
+
searchTermLocationForm: [{ type: i0.Input }],
|
|
3229
3292
|
searchLocationComponent: [{ type: i0.ViewChild, args: [SearchLocationComponent, { static: true },] }],
|
|
3230
3293
|
disabled: [{ type: i0.Input }],
|
|
3231
3294
|
services: [{ type: i0.Input }]
|
|
@@ -3876,6 +3939,53 @@
|
|
|
3876
3939
|
xuilibLet: [{ type: i0.Input }]
|
|
3877
3940
|
};
|
|
3878
3941
|
|
|
3942
|
+
var SearchServiceComponent = /** @class */ (function () {
|
|
3943
|
+
function SearchServiceComponent(fb) {
|
|
3944
|
+
this.fb = fb;
|
|
3945
|
+
this.showAutocomplete = false;
|
|
3946
|
+
this.serviceChanged = new i0.EventEmitter();
|
|
3947
|
+
this.minSearchCharacters = 3;
|
|
3948
|
+
this.term = '';
|
|
3949
|
+
this.form = this.fb.group({
|
|
3950
|
+
searchTerm: ['']
|
|
3951
|
+
});
|
|
3952
|
+
}
|
|
3953
|
+
SearchServiceComponent.prototype.onInput = function () {
|
|
3954
|
+
// Todo
|
|
3955
|
+
};
|
|
3956
|
+
SearchServiceComponent.prototype.resetSearchTerm = function () {
|
|
3957
|
+
this.form.controls.searchTerm.patchValue('', { emitEvent: false, onlySelf: true });
|
|
3958
|
+
};
|
|
3959
|
+
SearchServiceComponent.prototype.onSelectionChanged = function ($event) {
|
|
3960
|
+
var _a;
|
|
3961
|
+
var label = (_a = $event.source) === null || _a === void 0 ? void 0 : _a.value;
|
|
3962
|
+
if (label && $event.source.selected) {
|
|
3963
|
+
var selectedService = this.services.find(function (s) { return s.label === label; });
|
|
3964
|
+
this.serviceChanged.emit(selectedService);
|
|
3965
|
+
}
|
|
3966
|
+
};
|
|
3967
|
+
return SearchServiceComponent;
|
|
3968
|
+
}());
|
|
3969
|
+
SearchServiceComponent.decorators = [
|
|
3970
|
+
{ type: i0.Component, args: [{
|
|
3971
|
+
selector: 'exui-search-service',
|
|
3972
|
+
template: "<div class=\"auto-complete-container\">\n <input\n id=\"inputServiceSearch\"\n (input)=\"onInput()\"\n [formControl]=\"form?.controls.searchTerm\"\n [matAutocomplete]=\"autoSearchService\"\n class=\"govuk-input\"\n [attr.disabled]=\"disabled\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchService=\"matAutocomplete\">\n <mat-option *ngFor=\"let service of services\" (onSelectionChange)=\"onSelectionChanged($event)\" [value]=\"service.label\">\n {{ service.label }}\n </mat-option>\n <mat-option *ngIf=\"!services?.length && showAutocomplete && term && term.length >= this.minSearchCharacters\">No results found</mat-option>\n </mat-autocomplete>\n</div>\n",
|
|
3973
|
+
styles: [".autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:0 2px 6px rgba(0,0,0,.256863);left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-left-width:0;border-bottom:1px solid #b1b4b6;border-right-width:0;border-top-width:1px;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{min-width:250px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}"]
|
|
3974
|
+
},] }
|
|
3975
|
+
];
|
|
3976
|
+
SearchServiceComponent.ctorParameters = function () { return [
|
|
3977
|
+
{ type: forms.FormBuilder }
|
|
3978
|
+
]; };
|
|
3979
|
+
SearchServiceComponent.propDecorators = {
|
|
3980
|
+
services: [{ type: i0.Input }],
|
|
3981
|
+
selectedServices: [{ type: i0.Input }],
|
|
3982
|
+
disabled: [{ type: i0.Input }],
|
|
3983
|
+
delay: [{ type: i0.Input }],
|
|
3984
|
+
form: [{ type: i0.Input }],
|
|
3985
|
+
showAutocomplete: [{ type: i0.Input }],
|
|
3986
|
+
serviceChanged: [{ type: i0.Output }]
|
|
3987
|
+
};
|
|
3988
|
+
|
|
3879
3989
|
var FindServiceComponent = /** @class */ (function () {
|
|
3880
3990
|
function FindServiceComponent() {
|
|
3881
3991
|
this.services = [];
|
|
@@ -3926,6 +4036,7 @@
|
|
|
3926
4036
|
}
|
|
3927
4037
|
this.tempSelectedService = null;
|
|
3928
4038
|
this.serviceFieldChanged.emit(this.tempSelectedService);
|
|
4039
|
+
this.searchServiceComponent.resetSearchTerm();
|
|
3929
4040
|
};
|
|
3930
4041
|
FindServiceComponent.prototype.removeService = function (service) {
|
|
3931
4042
|
if (service.key) {
|
|
@@ -3996,7 +4107,7 @@
|
|
|
3996
4107
|
FindServiceComponent.decorators = [
|
|
3997
4108
|
{ type: i0.Component, args: [{
|
|
3998
4109
|
selector: 'xuilib-find-service',
|
|
3999
|
-
template: "<div class=\"service-picker-custom\">\n <div class=\"search-service\">\n <div class=\"govuk-body\">\n <label id=\"selectServiceSearch-label\" for=\"serviceSearch__select\" *ngIf=\"serviceTitle\">\n {{ serviceTitle}}\n </label>\n </div>\n <div class=\"search-service__input-container\">\n <exui-search-service class=\"search-service__input\"\n [services]=\"services\"\n [selectedServices]=\"selectedServices\"\n [delay]=\"300\"\n [disabled]=\"disabled\"\n (serviceChanged)=\"onServiceSelected($event)\">\n </exui-search-service>\n <a href=\"javascript:void(0)\" (click)=\"addService()\"\n class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\" data-module=\"govuk-button\"\n *ngIf=\"enableAddServiceButton\" id=\"add-service\">\n Add\n </a>\n </div>\n </div>\n <ul class=\"hmcts-filter-tags selection-container\" *ngIf=\"field.maxSelected != 1\">\n <li class=\"location-selection\" *ngFor=\"let selection of selectedServices\">\n <a *ngIf=\"selection.key!=='All'\" class=\"hmcts-filter__tag\" (click)=\"removeService(selection)\" href=\"javascript:void(0)\">\n {{ selection.label }}\n </a>\n </li>\n </ul>\n</div>\n",
|
|
4110
|
+
template: "<div class=\"service-picker-custom\">\n <div class=\"search-service\">\n <div class=\"govuk-body\">\n <label id=\"selectServiceSearch-label\" for=\"serviceSearch__select\" *ngIf=\"serviceTitle\">\n {{ serviceTitle}}\n </label>\n </div>\n <div class=\"search-service__input-container\">\n <exui-search-service class=\"search-service__input\"\n [services]=\"services\"\n [form]=\"searchTermServiceForm\"\n [selectedServices]=\"selectedServices\"\n [delay]=\"300\"\n [disabled]=\"disabled\"\n (serviceChanged)=\"onServiceSelected($event)\">\n </exui-search-service>\n <a href=\"javascript:void(0)\" (click)=\"addService()\"\n class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\" data-module=\"govuk-button\"\n *ngIf=\"enableAddServiceButton\" id=\"add-service\">\n Add\n </a>\n </div>\n </div>\n <ul class=\"hmcts-filter-tags selection-container\" *ngIf=\"field.maxSelected != 1\">\n <li class=\"location-selection\" *ngFor=\"let selection of selectedServices\">\n <a *ngIf=\"selection.key!=='All'\" class=\"hmcts-filter__tag\" (click)=\"removeService(selection)\" href=\"javascript:void(0)\">\n {{ selection.label }}\n </a>\n </li>\n </ul>\n</div>\n",
|
|
4000
4111
|
styles: ["#add-service{background-color:#ddd}"]
|
|
4001
4112
|
},] }
|
|
4002
4113
|
];
|
|
@@ -4005,11 +4116,13 @@
|
|
|
4005
4116
|
fields: [{ type: i0.Input }],
|
|
4006
4117
|
serviceTitle: [{ type: i0.Input }],
|
|
4007
4118
|
form: [{ type: i0.Input }],
|
|
4119
|
+
searchTermServiceForm: [{ type: i0.Input }],
|
|
4008
4120
|
services: [{ type: i0.Input }],
|
|
4009
4121
|
selectedServices: [{ type: i0.Input }],
|
|
4010
4122
|
enableAddServiceButton: [{ type: i0.Input }],
|
|
4011
4123
|
disabled: [{ type: i0.Input }],
|
|
4012
4124
|
disableInputField: [{ type: i0.Input }],
|
|
4125
|
+
searchServiceComponent: [{ type: i0.ViewChild, args: [SearchServiceComponent, { static: true },] }],
|
|
4013
4126
|
serviceFieldChanged: [{ type: i0.Output }]
|
|
4014
4127
|
};
|
|
4015
4128
|
|
|
@@ -4140,46 +4253,6 @@
|
|
|
4140
4253
|
disabled: [{ type: i0.Input }]
|
|
4141
4254
|
};
|
|
4142
4255
|
|
|
4143
|
-
var SearchServiceComponent = /** @class */ (function () {
|
|
4144
|
-
function SearchServiceComponent(fb) {
|
|
4145
|
-
this.fb = fb;
|
|
4146
|
-
this.showAutocomplete = false;
|
|
4147
|
-
this.serviceChanged = new i0.EventEmitter();
|
|
4148
|
-
this.minSearchCharacters = 3;
|
|
4149
|
-
this.term = '';
|
|
4150
|
-
this.form = this.fb.group({
|
|
4151
|
-
searchTerm: ['']
|
|
4152
|
-
});
|
|
4153
|
-
}
|
|
4154
|
-
SearchServiceComponent.prototype.onInput = function () {
|
|
4155
|
-
// Todo
|
|
4156
|
-
};
|
|
4157
|
-
SearchServiceComponent.prototype.onSelectionChanged = function (label) {
|
|
4158
|
-
var selectedService = this.services.find(function (s) { return s.label === label; });
|
|
4159
|
-
this.serviceChanged.emit(selectedService);
|
|
4160
|
-
};
|
|
4161
|
-
return SearchServiceComponent;
|
|
4162
|
-
}());
|
|
4163
|
-
SearchServiceComponent.decorators = [
|
|
4164
|
-
{ type: i0.Component, args: [{
|
|
4165
|
-
selector: 'exui-search-service',
|
|
4166
|
-
template: "<div class=\"auto-complete-container\">\n <input\n id=\"inputServiceSearch\"\n (input)=\"onInput()\"\n [formControl]=\"form?.controls.searchTerm\"\n [matAutocomplete]=\"autoSearchService\"\n class=\"govuk-input\"\n [attr.disabled]=\"disabled\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchService=\"matAutocomplete\">\n <mat-option *ngFor=\"let service of services\" (onSelectionChange)=\"onSelectionChanged($event.source.value)\" [value]=\"service.label\">\n {{ service.label }}\n </mat-option>\n <mat-option *ngIf=\"!services?.length && showAutocomplete && term && term.length >= this.minSearchCharacters\">No results found</mat-option>\n </mat-autocomplete>\n</div>\n",
|
|
4167
|
-
styles: [".autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:0 2px 6px rgba(0,0,0,.256863);left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-left-width:0;border-bottom:1px solid #b1b4b6;border-right-width:0;border-top-width:1px;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{min-width:250px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}"]
|
|
4168
|
-
},] }
|
|
4169
|
-
];
|
|
4170
|
-
SearchServiceComponent.ctorParameters = function () { return [
|
|
4171
|
-
{ type: forms.FormBuilder }
|
|
4172
|
-
]; };
|
|
4173
|
-
SearchServiceComponent.propDecorators = {
|
|
4174
|
-
services: [{ type: i0.Input }],
|
|
4175
|
-
selectedServices: [{ type: i0.Input }],
|
|
4176
|
-
disabled: [{ type: i0.Input }],
|
|
4177
|
-
delay: [{ type: i0.Input }],
|
|
4178
|
-
form: [{ type: i0.Input }],
|
|
4179
|
-
showAutocomplete: [{ type: i0.Input }],
|
|
4180
|
-
serviceChanged: [{ type: i0.Output }]
|
|
4181
|
-
};
|
|
4182
|
-
|
|
4183
4256
|
/*
|
|
4184
4257
|
* Gov Uk Checkbox Dumb Component responsible for
|
|
4185
4258
|
* displaying checkbox input and hint
|