@hmcts/rpx-xui-common-lib 1.6.7-generic-filter-show-cancel-button → 1.6.7-location-integration
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 +432 -329
- 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 +111 -47
- package/esm2015/lib/components/find-person/find-person.component.js +52 -21
- package/esm2015/lib/components/generic-filter/generic-filter-utils.js +2 -2
- package/esm2015/lib/components/generic-filter/generic-filter.component.js +48 -42
- package/esm2015/lib/components/search-location/search-location.component.js +60 -66
- package/esm2015/lib/exui-common-lib.module.js +4 -3
- package/esm2015/lib/models/filter.model.js +9 -1
- package/esm2015/lib/models/location.model.js +24 -24
- package/esm2015/lib/services/find-person/find-person.service.js +2 -2
- package/esm2015/lib/services/locations/location.service.js +2 -2
- package/esm5/lib/components/find-location/find-location.component.js +139 -67
- package/esm5/lib/components/find-person/find-person.component.js +52 -22
- package/esm5/lib/components/generic-filter/generic-filter-utils.js +2 -2
- package/esm5/lib/components/generic-filter/generic-filter.component.js +97 -71
- package/esm5/lib/components/search-location/search-location.component.js +66 -74
- package/esm5/lib/exui-common-lib.module.js +4 -3
- package/esm5/lib/models/filter.model.js +9 -1
- package/esm5/lib/models/location.model.js +24 -24
- package/esm5/lib/services/find-person/find-person.service.js +2 -2
- package/esm5/lib/services/locations/location.service.js +4 -4
- package/fesm2015/hmcts-rpx-xui-common-lib.js +320 -245
- package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/fesm5/hmcts-rpx-xui-common-lib.js +424 -324
- package/fesm5/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 +17 -11
- package/lib/components/find-person/find-person.component.d.ts +9 -8
- package/lib/components/generic-filter/generic-filter-utils.d.ts +2 -2
- package/lib/components/generic-filter/generic-filter.component.d.ts +2 -3
- package/lib/components/search-location/search-location.component.d.ts +14 -13
- package/lib/models/filter.model.d.ts +4 -0
- package/lib/models/location.model.d.ts +3 -3
- package/lib/services/find-person/find-person.service.d.ts +1 -2
- package/lib/services/locations/location.service.d.ts +3 -3
- package/package.json +1 -1
|
@@ -839,7 +839,7 @@
|
|
|
839
839
|
* @param {?} values
|
|
840
840
|
* @return {?}
|
|
841
841
|
*/
|
|
842
|
-
function
|
|
842
|
+
function getValues(options, values) {
|
|
843
843
|
return options.reduce(( /**
|
|
844
844
|
* @param {?} acc
|
|
845
845
|
* @param {?} option
|
|
@@ -1069,7 +1069,7 @@
|
|
|
1069
1069
|
* @param {?} form
|
|
1070
1070
|
* @return {?}
|
|
1071
1071
|
*/
|
|
1072
|
-
GenericFilterComponent.prototype.
|
|
1072
|
+
GenericFilterComponent.prototype.fieldChanged =
|
|
1073
1073
|
// when domain changes ensure that person field is reset
|
|
1074
1074
|
/**
|
|
1075
1075
|
* @param {?} field
|
|
@@ -1077,48 +1077,28 @@
|
|
|
1077
1077
|
* @return {?}
|
|
1078
1078
|
*/
|
|
1079
1079
|
function (field, form) {
|
|
1080
|
+
var e_1, _a;
|
|
1080
1081
|
// TODO - Do similar with jurisdiction/service for caseworkers by services
|
|
1081
|
-
if (field.
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1082
|
+
if (field.changeResetFields && field.changeResetFields.length) {
|
|
1083
|
+
try {
|
|
1084
|
+
for (var _b = __values(field.changeResetFields), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1085
|
+
var resetField = _c.value;
|
|
1086
|
+
this.resetField(resetField, form);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
catch (e_1_1) {
|
|
1090
|
+
e_1 = { error: e_1_1 };
|
|
1091
|
+
}
|
|
1092
|
+
finally {
|
|
1093
|
+
try {
|
|
1094
|
+
if (_c && !_c.done && (_a = _b.return))
|
|
1095
|
+
_a.call(_b);
|
|
1096
|
+
}
|
|
1097
|
+
finally {
|
|
1098
|
+
if (e_1)
|
|
1099
|
+
throw e_1.error;
|
|
1100
|
+
}
|
|
1089
1101
|
}
|
|
1090
|
-
this.removePersonField(field);
|
|
1091
|
-
}
|
|
1092
|
-
};
|
|
1093
|
-
/**
|
|
1094
|
-
* @param {?} field
|
|
1095
|
-
* @return {?}
|
|
1096
|
-
*/
|
|
1097
|
-
GenericFilterComponent.prototype.radiosChanged = /**
|
|
1098
|
-
* @param {?} field
|
|
1099
|
-
* @return {?}
|
|
1100
|
-
*/
|
|
1101
|
-
function (field) {
|
|
1102
|
-
if (field.findPersonField) {
|
|
1103
|
-
this.form.get('findPersonControl').setValue(null);
|
|
1104
|
-
this.removePersonField(field);
|
|
1105
|
-
}
|
|
1106
|
-
};
|
|
1107
|
-
/**
|
|
1108
|
-
* @param {?} field
|
|
1109
|
-
* @return {?}
|
|
1110
|
-
*/
|
|
1111
|
-
GenericFilterComponent.prototype.removePersonField = /**
|
|
1112
|
-
* @param {?} field
|
|
1113
|
-
* @return {?}
|
|
1114
|
-
*/
|
|
1115
|
-
function (field) {
|
|
1116
|
-
if (this.form.get(field.findPersonField)) {
|
|
1117
|
-
this.form.get(field.findPersonField).get('domain').setValue(null);
|
|
1118
|
-
this.form.get(field.findPersonField).get('email').setValue(null);
|
|
1119
|
-
this.form.get(field.findPersonField).get('id').setValue(null);
|
|
1120
|
-
this.form.get(field.findPersonField).get('name').setValue(null);
|
|
1121
|
-
this.form.get(field.findPersonField).get('knownAs').setValue(null);
|
|
1122
1102
|
}
|
|
1123
1103
|
};
|
|
1124
1104
|
/**
|
|
@@ -1136,6 +1116,7 @@
|
|
|
1136
1116
|
var settings = __assign({}, this.settings, { reset: true });
|
|
1137
1117
|
this.filterService.persist(settings, this.config.persistence);
|
|
1138
1118
|
this.filterService.givenErrors.next(null);
|
|
1119
|
+
this.submitted = false;
|
|
1139
1120
|
};
|
|
1140
1121
|
/**
|
|
1141
1122
|
* @param {?} values
|
|
@@ -1148,7 +1129,7 @@
|
|
|
1148
1129
|
* @return {?}
|
|
1149
1130
|
*/
|
|
1150
1131
|
function (values, field) {
|
|
1151
|
-
var
|
|
1132
|
+
var e_2, _a;
|
|
1152
1133
|
/** @type {?} */
|
|
1153
1134
|
var keys = Object.keys(values);
|
|
1154
1135
|
try {
|
|
@@ -1159,8 +1140,8 @@
|
|
|
1159
1140
|
}
|
|
1160
1141
|
}
|
|
1161
1142
|
}
|
|
1162
|
-
catch (
|
|
1163
|
-
|
|
1143
|
+
catch (e_2_1) {
|
|
1144
|
+
e_2 = { error: e_2_1 };
|
|
1164
1145
|
}
|
|
1165
1146
|
finally {
|
|
1166
1147
|
try {
|
|
@@ -1168,8 +1149,8 @@
|
|
|
1168
1149
|
_a.call(keys_1);
|
|
1169
1150
|
}
|
|
1170
1151
|
finally {
|
|
1171
|
-
if (
|
|
1172
|
-
throw
|
|
1152
|
+
if (e_2)
|
|
1153
|
+
throw e_2.error;
|
|
1173
1154
|
}
|
|
1174
1155
|
}
|
|
1175
1156
|
};
|
|
@@ -1252,6 +1233,61 @@
|
|
|
1252
1233
|
}
|
|
1253
1234
|
}));
|
|
1254
1235
|
};
|
|
1236
|
+
/**
|
|
1237
|
+
* @private
|
|
1238
|
+
* @param {?} resetField
|
|
1239
|
+
* @param {?} form
|
|
1240
|
+
* @return {?}
|
|
1241
|
+
*/
|
|
1242
|
+
GenericFilterComponent.prototype.resetField = /**
|
|
1243
|
+
* @private
|
|
1244
|
+
* @param {?} resetField
|
|
1245
|
+
* @param {?} form
|
|
1246
|
+
* @return {?}
|
|
1247
|
+
*/
|
|
1248
|
+
function (resetField, form) {
|
|
1249
|
+
var e_3, _a;
|
|
1250
|
+
/** @type {?} */
|
|
1251
|
+
var control = form.get(resetField);
|
|
1252
|
+
/** @type {?} */
|
|
1253
|
+
var defaultValue = this.config.cancelSetting.fields.find(( /**
|
|
1254
|
+
* @param {?} f
|
|
1255
|
+
* @return {?}
|
|
1256
|
+
*/function (f) { return f.name === resetField; }));
|
|
1257
|
+
if (control instanceof forms.FormArray) {
|
|
1258
|
+
for (var i = 0; i < control.length; i++) {
|
|
1259
|
+
control.removeAt(i);
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
else if (control instanceof forms.FormGroup) {
|
|
1263
|
+
/** @type {?} */
|
|
1264
|
+
var keys = Object.keys(control.value);
|
|
1265
|
+
try {
|
|
1266
|
+
for (var keys_2 = __values(keys), keys_2_1 = keys_2.next(); !keys_2_1.done; keys_2_1 = keys_2.next()) {
|
|
1267
|
+
var key = keys_2_1.value;
|
|
1268
|
+
this.resetField(key, control);
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
catch (e_3_1) {
|
|
1272
|
+
e_3 = { error: e_3_1 };
|
|
1273
|
+
}
|
|
1274
|
+
finally {
|
|
1275
|
+
try {
|
|
1276
|
+
if (keys_2_1 && !keys_2_1.done && (_a = keys_2.return))
|
|
1277
|
+
_a.call(keys_2);
|
|
1278
|
+
}
|
|
1279
|
+
finally {
|
|
1280
|
+
if (e_3)
|
|
1281
|
+
throw e_3.error;
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
else if (control instanceof forms.FormControl) {
|
|
1286
|
+
/** @type {?} */
|
|
1287
|
+
var value = defaultValue && defaultValue.value && defaultValue.value.length ? defaultValue.value[0] : null;
|
|
1288
|
+
control.setValue(value);
|
|
1289
|
+
}
|
|
1290
|
+
};
|
|
1255
1291
|
/**
|
|
1256
1292
|
* @private
|
|
1257
1293
|
* @param {?} filter
|
|
@@ -1299,7 +1335,7 @@
|
|
|
1299
1335
|
* @return {?}
|
|
1300
1336
|
*/
|
|
1301
1337
|
function (config, settings, reset) {
|
|
1302
|
-
var
|
|
1338
|
+
var e_4, _a;
|
|
1303
1339
|
/** @type {?} */
|
|
1304
1340
|
var findPersonControl = this.form ? this.form.get('findPersonControl') : null;
|
|
1305
1341
|
this.form = this.fb.group({});
|
|
@@ -1361,7 +1397,7 @@
|
|
|
1361
1397
|
}
|
|
1362
1398
|
// if field updates find person component set the initial domain
|
|
1363
1399
|
if (field.findPersonField) {
|
|
1364
|
-
this_1.
|
|
1400
|
+
this_1.fieldChanged(field, this_1.form);
|
|
1365
1401
|
}
|
|
1366
1402
|
}
|
|
1367
1403
|
};
|
|
@@ -1372,8 +1408,8 @@
|
|
|
1372
1408
|
_loop_1(field);
|
|
1373
1409
|
}
|
|
1374
1410
|
}
|
|
1375
|
-
catch (
|
|
1376
|
-
|
|
1411
|
+
catch (e_4_1) {
|
|
1412
|
+
e_4 = { error: e_4_1 };
|
|
1377
1413
|
}
|
|
1378
1414
|
finally {
|
|
1379
1415
|
try {
|
|
@@ -1381,8 +1417,8 @@
|
|
|
1381
1417
|
_a.call(_b);
|
|
1382
1418
|
}
|
|
1383
1419
|
finally {
|
|
1384
|
-
if (
|
|
1385
|
-
throw
|
|
1420
|
+
if (e_4)
|
|
1421
|
+
throw e_4.error;
|
|
1386
1422
|
}
|
|
1387
1423
|
}
|
|
1388
1424
|
};
|
|
@@ -1399,7 +1435,7 @@
|
|
|
1399
1435
|
* @return {?}
|
|
1400
1436
|
*/
|
|
1401
1437
|
function (field, settings) {
|
|
1402
|
-
var
|
|
1438
|
+
var e_5, _a;
|
|
1403
1439
|
/** @type {?} */
|
|
1404
1440
|
var validators = GenericFilterComponent.addFormValidators(field);
|
|
1405
1441
|
/** @type {?} */
|
|
@@ -1429,8 +1465,8 @@
|
|
|
1429
1465
|
_loop_2(option);
|
|
1430
1466
|
}
|
|
1431
1467
|
}
|
|
1432
|
-
catch (
|
|
1433
|
-
|
|
1468
|
+
catch (e_5_1) {
|
|
1469
|
+
e_5 = { error: e_5_1 };
|
|
1434
1470
|
}
|
|
1435
1471
|
finally {
|
|
1436
1472
|
try {
|
|
@@ -1438,8 +1474,8 @@
|
|
|
1438
1474
|
_a.call(_b);
|
|
1439
1475
|
}
|
|
1440
1476
|
finally {
|
|
1441
|
-
if (
|
|
1442
|
-
throw
|
|
1477
|
+
if (e_5)
|
|
1478
|
+
throw e_5.error;
|
|
1443
1479
|
}
|
|
1444
1480
|
}
|
|
1445
1481
|
return formArray;
|
|
@@ -1457,7 +1493,7 @@
|
|
|
1457
1493
|
* @return {?}
|
|
1458
1494
|
*/
|
|
1459
1495
|
function (field, settings) {
|
|
1460
|
-
var
|
|
1496
|
+
var e_6, _a;
|
|
1461
1497
|
/** @type {?} */
|
|
1462
1498
|
var validators = GenericFilterComponent.addFormValidators(field);
|
|
1463
1499
|
/** @type {?} */
|
|
@@ -1469,23 +1505,25 @@
|
|
|
1469
1505
|
* @param {?} f
|
|
1470
1506
|
* @return {?}
|
|
1471
1507
|
*/function (f) { return f.name === field.name; }));
|
|
1472
|
-
|
|
1473
|
-
for (var _b = __values(defaultValues.value), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1474
|
-
var defaultValue = _c.value;
|
|
1475
|
-
formArray.push(new forms.FormControl(defaultValue));
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
|
-
catch (e_4_1) {
|
|
1479
|
-
e_4 = { error: e_4_1 };
|
|
1480
|
-
}
|
|
1481
|
-
finally {
|
|
1508
|
+
if (defaultValues) {
|
|
1482
1509
|
try {
|
|
1483
|
-
|
|
1484
|
-
|
|
1510
|
+
for (var _b = __values(defaultValues.value), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1511
|
+
var defaultValue = _c.value;
|
|
1512
|
+
formArray.push(new forms.FormControl(defaultValue));
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
catch (e_6_1) {
|
|
1516
|
+
e_6 = { error: e_6_1 };
|
|
1485
1517
|
}
|
|
1486
1518
|
finally {
|
|
1487
|
-
|
|
1488
|
-
|
|
1519
|
+
try {
|
|
1520
|
+
if (_c && !_c.done && (_a = _b.return))
|
|
1521
|
+
_a.call(_b);
|
|
1522
|
+
}
|
|
1523
|
+
finally {
|
|
1524
|
+
if (e_6)
|
|
1525
|
+
throw e_6.error;
|
|
1526
|
+
}
|
|
1489
1527
|
}
|
|
1490
1528
|
}
|
|
1491
1529
|
}
|
|
@@ -1520,7 +1558,7 @@
|
|
|
1520
1558
|
return { value: values, name: name };
|
|
1521
1559
|
}
|
|
1522
1560
|
else {
|
|
1523
|
-
return { value:
|
|
1561
|
+
return { value: getValues(field.options, values), name: name };
|
|
1524
1562
|
}
|
|
1525
1563
|
}
|
|
1526
1564
|
else {
|
|
@@ -1539,7 +1577,7 @@
|
|
|
1539
1577
|
* @return {?}
|
|
1540
1578
|
*/
|
|
1541
1579
|
function (form) {
|
|
1542
|
-
var
|
|
1580
|
+
var e_7, _a;
|
|
1543
1581
|
/** @type {?} */
|
|
1544
1582
|
var errors = [];
|
|
1545
1583
|
try {
|
|
@@ -1555,8 +1593,8 @@
|
|
|
1555
1593
|
}
|
|
1556
1594
|
}
|
|
1557
1595
|
}
|
|
1558
|
-
catch (
|
|
1559
|
-
|
|
1596
|
+
catch (e_7_1) {
|
|
1597
|
+
e_7 = { error: e_7_1 };
|
|
1560
1598
|
}
|
|
1561
1599
|
finally {
|
|
1562
1600
|
try {
|
|
@@ -1564,8 +1602,8 @@
|
|
|
1564
1602
|
_a.call(_b);
|
|
1565
1603
|
}
|
|
1566
1604
|
finally {
|
|
1567
|
-
if (
|
|
1568
|
-
throw
|
|
1605
|
+
if (e_7)
|
|
1606
|
+
throw e_7.error;
|
|
1569
1607
|
}
|
|
1570
1608
|
}
|
|
1571
1609
|
if (errors.length) {
|
|
@@ -1575,7 +1613,7 @@
|
|
|
1575
1613
|
GenericFilterComponent.decorators = [
|
|
1576
1614
|
{ type: i0.Component, args: [{
|
|
1577
1615
|
selector: 'xuilib-generic-filter',
|
|
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 <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 <h3 *ngIf=\"field.title\" class=\"govuk-heading-s\">{{field.title}}</h3>\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 <div class=\"govuk-body\" [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <select class=\"govuk-select\" (change)=\"
|
|
1616
|
+
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 <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 <h3 *ngIf=\"field.title\" class=\"govuk-heading-s\">{{field.title}}</h3>\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 <div class=\"govuk-body\" [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 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=\"'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_' + item.key\"\n [name]=\"'checkbox_' + item.key\"\n />\n <label\n [for]=\"'checkbox_' + 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_' + item.key\"\n [name]=\"'checkbox_' + item.key\"\n />\n <label\n [for]=\"'checkbox_' + 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 [submitted]=\"submitted\"\n [domain]=\"form.get(field.domainField)?.value\"\n [findPersonGroup]=\"form\"\n [selectedPerson]=\"form.get(field.name)?.value?.email\"\n [disabled]=\"disabled(field, form)\"\n [userIncluded]=\"false\"\n ></xuilib-find-person>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-location'\">\n <xuilib-find-location [form]=\"form\"\n [fields]=\"config.fields\"\n [title]=\"field.title\"\n [enableAddLocationButton]=\"field.enableAddLocationButton\"\n [disabled]=\"disabled(field, form)\"\n [selectedLocations]=\"form.get(field.name)?.value\"\n [submitted]=\"submitted\"\n [services]=\"form.get(field.findLocationField)?.value\"\n [field]=\"field\"\n ></xuilib-find-location>\n </ng-container>\n </div>\n </div>\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",
|
|
1579
1617
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1580
1618
|
encapsulation: i0.ViewEncapsulation.None,
|
|
1581
1619
|
styles: [".contain-classes .elevated-break{position:relative;top:-10px}.contain-classes .xui-generic-filter .select-all{margin-bottom:10px}.contain-classes .xui-generic-filter .govuk-checkboxes{display:flex;flex-wrap:wrap}.contain-classes .xui-generic-filter .govuk-checkboxes>div{flex-grow:1;flex-shrink:0}"]
|
|
@@ -3665,168 +3703,6 @@
|
|
|
3665
3703
|
return CookieBannerComponent;
|
|
3666
3704
|
}());
|
|
3667
3705
|
|
|
3668
|
-
/**
|
|
3669
|
-
* @fileoverview added by tsickle
|
|
3670
|
-
* Generated from: lib/components/find-location/find-location.component.ts
|
|
3671
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3672
|
-
*/
|
|
3673
|
-
var FindLocationComponent = /** @class */ (function () {
|
|
3674
|
-
function FindLocationComponent() {
|
|
3675
|
-
this.selectedLocations = [];
|
|
3676
|
-
this.submitted = true;
|
|
3677
|
-
this.locations = [];
|
|
3678
|
-
this.locationsForm = new forms.FormArray([]);
|
|
3679
|
-
this.serviceIds = 'SSCS,IA';
|
|
3680
|
-
this.pServices = [];
|
|
3681
|
-
}
|
|
3682
|
-
Object.defineProperty(FindLocationComponent.prototype, "services", {
|
|
3683
|
-
get: /**
|
|
3684
|
-
* @return {?}
|
|
3685
|
-
*/ function () {
|
|
3686
|
-
return this.pServices;
|
|
3687
|
-
},
|
|
3688
|
-
set: /**
|
|
3689
|
-
* @param {?} value
|
|
3690
|
-
* @return {?}
|
|
3691
|
-
*/ function (value) {
|
|
3692
|
-
var _this = this;
|
|
3693
|
-
this.pServices = value;
|
|
3694
|
-
/** @type {?} */
|
|
3695
|
-
var field = this.fields.find(( /**
|
|
3696
|
-
* @param {?} f
|
|
3697
|
-
* @return {?}
|
|
3698
|
-
*/function (f) { return f.name === _this.field.findPersonField; }));
|
|
3699
|
-
if (field) {
|
|
3700
|
-
this.serviceIds = getCheckBoxesValues(field.options, value).filter(( /**
|
|
3701
|
-
* @param {?} x
|
|
3702
|
-
* @return {?}
|
|
3703
|
-
*/function (x) { return x !== 'services_all'; })).join(',');
|
|
3704
|
-
}
|
|
3705
|
-
},
|
|
3706
|
-
enumerable: true,
|
|
3707
|
-
configurable: true
|
|
3708
|
-
});
|
|
3709
|
-
/**
|
|
3710
|
-
* @private
|
|
3711
|
-
* @param {?} selectedLocations
|
|
3712
|
-
* @param {?} formArray
|
|
3713
|
-
* @return {?}
|
|
3714
|
-
*/
|
|
3715
|
-
FindLocationComponent.initForm = /**
|
|
3716
|
-
* @private
|
|
3717
|
-
* @param {?} selectedLocations
|
|
3718
|
-
* @param {?} formArray
|
|
3719
|
-
* @return {?}
|
|
3720
|
-
*/
|
|
3721
|
-
function (selectedLocations, formArray) {
|
|
3722
|
-
var e_1, _a;
|
|
3723
|
-
try {
|
|
3724
|
-
for (var selectedLocations_1 = __values(selectedLocations), selectedLocations_1_1 = selectedLocations_1.next(); !selectedLocations_1_1.done; selectedLocations_1_1 = selectedLocations_1.next()) {
|
|
3725
|
-
var location_1 = selectedLocations_1_1.value;
|
|
3726
|
-
formArray.push(new forms.FormControl(location_1));
|
|
3727
|
-
}
|
|
3728
|
-
}
|
|
3729
|
-
catch (e_1_1) {
|
|
3730
|
-
e_1 = { error: e_1_1 };
|
|
3731
|
-
}
|
|
3732
|
-
finally {
|
|
3733
|
-
try {
|
|
3734
|
-
if (selectedLocations_1_1 && !selectedLocations_1_1.done && (_a = selectedLocations_1.return))
|
|
3735
|
-
_a.call(selectedLocations_1);
|
|
3736
|
-
}
|
|
3737
|
-
finally {
|
|
3738
|
-
if (e_1)
|
|
3739
|
-
throw e_1.error;
|
|
3740
|
-
}
|
|
3741
|
-
}
|
|
3742
|
-
return formArray;
|
|
3743
|
-
};
|
|
3744
|
-
/**
|
|
3745
|
-
* @return {?}
|
|
3746
|
-
*/
|
|
3747
|
-
FindLocationComponent.prototype.ngOnInit = /**
|
|
3748
|
-
* @return {?}
|
|
3749
|
-
*/
|
|
3750
|
-
function () {
|
|
3751
|
-
this.locationsForm = FindLocationComponent.initForm(this.selectedLocations, this.locationsForm);
|
|
3752
|
-
};
|
|
3753
|
-
/**
|
|
3754
|
-
* @return {?}
|
|
3755
|
-
*/
|
|
3756
|
-
FindLocationComponent.prototype.addLocation = /**
|
|
3757
|
-
* @return {?}
|
|
3758
|
-
*/
|
|
3759
|
-
function () {
|
|
3760
|
-
if (this.locations && this.locations.length) {
|
|
3761
|
-
/** @type {?} */
|
|
3762
|
-
var locationsForm = this.locationsForm;
|
|
3763
|
-
this.selectedLocations = ( /** @type {?} */(this.locationsForm.value));
|
|
3764
|
-
/** @type {?} */
|
|
3765
|
-
var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
|
|
3766
|
-
/** @type {?} */
|
|
3767
|
-
var lastSavedValue = this.selectedLocations[this.selectedLocations.length - 1];
|
|
3768
|
-
FindLocationComponent.initForm([lastSavedValue], formArray);
|
|
3769
|
-
locationsForm.at(this.selectedLocations.length - 1).setValue(null);
|
|
3770
|
-
}
|
|
3771
|
-
this.locations = [];
|
|
3772
|
-
};
|
|
3773
|
-
/**
|
|
3774
|
-
* @param {?} location
|
|
3775
|
-
* @return {?}
|
|
3776
|
-
*/
|
|
3777
|
-
FindLocationComponent.prototype.removeLocation = /**
|
|
3778
|
-
* @param {?} location
|
|
3779
|
-
* @return {?}
|
|
3780
|
-
*/
|
|
3781
|
-
function (location) {
|
|
3782
|
-
if (location.epims_id) {
|
|
3783
|
-
this.selectedLocations = this.selectedLocations.filter(( /**
|
|
3784
|
-
* @param {?} selectedLocation
|
|
3785
|
-
* @return {?}
|
|
3786
|
-
*/function (selectedLocation) { return selectedLocation.epims_id !== location.epims_id; }));
|
|
3787
|
-
/** @type {?} */
|
|
3788
|
-
var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
|
|
3789
|
-
/** @type {?} */
|
|
3790
|
-
var index = (( /** @type {?} */(formArray.value))).findIndex(( /**
|
|
3791
|
-
* @param {?} selectedLocation
|
|
3792
|
-
* @return {?}
|
|
3793
|
-
*/function (selectedLocation) { return selectedLocation.epims_id === location.epims_id; }));
|
|
3794
|
-
if (index > -1) {
|
|
3795
|
-
formArray.removeAt(index);
|
|
3796
|
-
}
|
|
3797
|
-
}
|
|
3798
|
-
};
|
|
3799
|
-
/**
|
|
3800
|
-
* @param {?} location
|
|
3801
|
-
* @return {?}
|
|
3802
|
-
*/
|
|
3803
|
-
FindLocationComponent.prototype.onLocationSelected = /**
|
|
3804
|
-
* @param {?} location
|
|
3805
|
-
* @return {?}
|
|
3806
|
-
*/
|
|
3807
|
-
function (location) {
|
|
3808
|
-
if (location && location.epims_id) {
|
|
3809
|
-
this.locations = __spread(this.locations, [location]);
|
|
3810
|
-
}
|
|
3811
|
-
};
|
|
3812
|
-
FindLocationComponent.decorators = [
|
|
3813
|
-
{ type: i0.Component, args: [{
|
|
3814
|
-
selector: 'xuilib-find-location',
|
|
3815
|
-
template: "<div class=\"location-picker-custom\">\n <div class=\"search-location\">\n <div>\n <label id=\"input-selected-location-label\">Search for a location by name</label>\n </div>\n <exui-search-location class=\"search-location\"\n (locationSelected)=\"onLocationSelected($event)\"\n [selectedLocations]=\"selectedLocations\"\n [control]=\"locationsForm\"\n [locations]=\"locations\"\n [delay]=\"300\"\n [disabled]=false\n [serviceIds]=\"serviceIds\"\n [locationType]=\"'case-management'\"></exui-search-location>\n <a href=\"javascript:void(0)\" (click)=\"addLocation()\" class=\"govuk-button\" data-module=\"govuk-button\">\n Add location\n </a>\n </div>\n <ul *ngIf=\"selectedLocations.length\" class=\"hmcts-filter-tags selection-container\">\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.court_name }}\n </a>\n </li>\n </ul>\n</div>\n",
|
|
3816
|
-
styles: [""]
|
|
3817
|
-
}] }
|
|
3818
|
-
];
|
|
3819
|
-
FindLocationComponent.propDecorators = {
|
|
3820
|
-
selectedLocations: [{ type: i0.Input }],
|
|
3821
|
-
submitted: [{ type: i0.Input }],
|
|
3822
|
-
form: [{ type: i0.Input }],
|
|
3823
|
-
field: [{ type: i0.Input }],
|
|
3824
|
-
fields: [{ type: i0.Input }],
|
|
3825
|
-
services: [{ type: i0.Input }]
|
|
3826
|
-
};
|
|
3827
|
-
return FindLocationComponent;
|
|
3828
|
-
}());
|
|
3829
|
-
|
|
3830
3706
|
/**
|
|
3831
3707
|
* @fileoverview added by tsickle
|
|
3832
3708
|
* Generated from: lib/services/locations/location.service.ts
|
|
@@ -3841,21 +3717,21 @@
|
|
|
3841
3717
|
* @param serviceIds: SSCS | SSCS,IA split with ','
|
|
3842
3718
|
* @param locationType: optional | hearing | case_management
|
|
3843
3719
|
* @param searchTerm: any search term for postcode | site name | venue name |court name | court address etc.
|
|
3844
|
-
* @return Observable<
|
|
3720
|
+
* @return Observable<LocationByEPIMMSModel[]>: Array of locationModel in Observable
|
|
3845
3721
|
*/
|
|
3846
3722
|
/**
|
|
3847
3723
|
* \@description getAllLocations from service Ids/location type/search term
|
|
3848
3724
|
* @param {?} serviceIds
|
|
3849
3725
|
* @param {?} locationType
|
|
3850
3726
|
* @param {?} searchTerm
|
|
3851
|
-
* @return {?} Observable<
|
|
3727
|
+
* @return {?} Observable<LocationByEPIMMSModel[]>: Array of locationModel in Observable
|
|
3852
3728
|
*/
|
|
3853
3729
|
LocationService.prototype.getAllLocations = /**
|
|
3854
3730
|
* \@description getAllLocations from service Ids/location type/search term
|
|
3855
3731
|
* @param {?} serviceIds
|
|
3856
3732
|
* @param {?} locationType
|
|
3857
3733
|
* @param {?} searchTerm
|
|
3858
|
-
* @return {?} Observable<
|
|
3734
|
+
* @return {?} Observable<LocationByEPIMMSModel[]>: Array of locationModel in Observable
|
|
3859
3735
|
*/
|
|
3860
3736
|
function (serviceIds, locationType, searchTerm) {
|
|
3861
3737
|
return this.http.get("api/locations/getLocations?serviceIds=" + serviceIds + "&locationType=" + locationType + "&searchTerm=" + searchTerm);
|
|
@@ -3886,6 +3762,7 @@
|
|
|
3886
3762
|
this.fb = fb;
|
|
3887
3763
|
this.cd = cd;
|
|
3888
3764
|
this.disabled = null;
|
|
3765
|
+
this.singleMode = false;
|
|
3889
3766
|
this.locationType = '';
|
|
3890
3767
|
this.serviceIds = '';
|
|
3891
3768
|
this.submitted = true;
|
|
@@ -3893,15 +3770,31 @@
|
|
|
3893
3770
|
this.showAutocomplete = false;
|
|
3894
3771
|
this.locations = [];
|
|
3895
3772
|
this.locationSelected = new i0.EventEmitter();
|
|
3896
|
-
this.
|
|
3897
|
-
this.readyAfterContent = false;
|
|
3773
|
+
this.locationInputChanged = new i0.EventEmitter();
|
|
3898
3774
|
this.minSearchCharacters = 3;
|
|
3775
|
+
this.term = '';
|
|
3899
3776
|
this.pSelectedLocations = [];
|
|
3900
|
-
this.
|
|
3901
|
-
|
|
3902
|
-
|
|
3777
|
+
this.pReset = true;
|
|
3778
|
+
this.form = this.fb.group({
|
|
3779
|
+
searchTerm: ['']
|
|
3903
3780
|
});
|
|
3904
3781
|
}
|
|
3782
|
+
Object.defineProperty(SearchLocationComponent.prototype, "reset", {
|
|
3783
|
+
get: /**
|
|
3784
|
+
* @return {?}
|
|
3785
|
+
*/ function () {
|
|
3786
|
+
return this.pReset;
|
|
3787
|
+
},
|
|
3788
|
+
set: /**
|
|
3789
|
+
* @param {?} value
|
|
3790
|
+
* @return {?}
|
|
3791
|
+
*/ function (value) {
|
|
3792
|
+
this.pReset = value;
|
|
3793
|
+
this.resetSearchTerm();
|
|
3794
|
+
},
|
|
3795
|
+
enumerable: true,
|
|
3796
|
+
configurable: true
|
|
3797
|
+
});
|
|
3905
3798
|
Object.defineProperty(SearchLocationComponent.prototype, "selectedLocations", {
|
|
3906
3799
|
get: /**
|
|
3907
3800
|
* @return {?}
|
|
@@ -3913,20 +3806,10 @@
|
|
|
3913
3806
|
* @return {?}
|
|
3914
3807
|
*/ function (value) {
|
|
3915
3808
|
this.pSelectedLocations = value;
|
|
3916
|
-
this.showAutocomplete = false;
|
|
3917
3809
|
},
|
|
3918
3810
|
enumerable: true,
|
|
3919
3811
|
configurable: true
|
|
3920
3812
|
});
|
|
3921
|
-
/**
|
|
3922
|
-
* @return {?}
|
|
3923
|
-
*/
|
|
3924
|
-
SearchLocationComponent.prototype.ngAfterContentInit = /**
|
|
3925
|
-
* @return {?}
|
|
3926
|
-
*/
|
|
3927
|
-
function () {
|
|
3928
|
-
this.readyAfterContent = true;
|
|
3929
|
-
};
|
|
3930
3813
|
/**
|
|
3931
3814
|
* @return {?}
|
|
3932
3815
|
*/
|
|
@@ -3934,22 +3817,13 @@
|
|
|
3934
3817
|
* @return {?}
|
|
3935
3818
|
*/
|
|
3936
3819
|
function () {
|
|
3937
|
-
if (this.
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
}
|
|
3820
|
+
if (this.singleMode && this.selectedLocations.length > 0) {
|
|
3821
|
+
/** @type {?} */
|
|
3822
|
+
var location_1 = this.selectedLocations[0];
|
|
3823
|
+
this.form.controls.searchTerm.patchValue(location_1.venue_name, { emitEvent: false, onlySelf: true });
|
|
3941
3824
|
}
|
|
3942
3825
|
this.search();
|
|
3943
3826
|
};
|
|
3944
|
-
/**
|
|
3945
|
-
* @return {?}
|
|
3946
|
-
*/
|
|
3947
|
-
SearchLocationComponent.prototype.onKeyDown = /**
|
|
3948
|
-
* @return {?}
|
|
3949
|
-
*/
|
|
3950
|
-
function () {
|
|
3951
|
-
this.locationSelected.emit();
|
|
3952
|
-
};
|
|
3953
3827
|
/**
|
|
3954
3828
|
* @param {?} term
|
|
3955
3829
|
* @return {?}
|
|
@@ -3966,23 +3840,16 @@
|
|
|
3966
3840
|
*/function (locations) { return _this.removeSelectedLocations(locations); })));
|
|
3967
3841
|
};
|
|
3968
3842
|
/**
|
|
3969
|
-
* @param {
|
|
3843
|
+
* @param {?} location
|
|
3970
3844
|
* @return {?}
|
|
3971
3845
|
*/
|
|
3972
3846
|
SearchLocationComponent.prototype.onSelectionChange = /**
|
|
3973
|
-
* @param {
|
|
3847
|
+
* @param {?} location
|
|
3974
3848
|
* @return {?}
|
|
3975
3849
|
*/
|
|
3976
|
-
function (
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
}
|
|
3980
|
-
else {
|
|
3981
|
-
this.findLocationFormGroup.controls.locationSelectedFormControl.setValue(selection);
|
|
3982
|
-
}
|
|
3983
|
-
this.showAutocomplete = false;
|
|
3984
|
-
this.locationSelected.emit(selection);
|
|
3985
|
-
this.locations = [];
|
|
3850
|
+
function (location) {
|
|
3851
|
+
this.form.controls.searchTerm.patchValue(location.venue_name, { emitEvent: false, onlySelf: true });
|
|
3852
|
+
this.locationSelected.emit(location);
|
|
3986
3853
|
};
|
|
3987
3854
|
/**
|
|
3988
3855
|
* @return {?}
|
|
@@ -3992,12 +3859,13 @@
|
|
|
3992
3859
|
*/
|
|
3993
3860
|
function () {
|
|
3994
3861
|
var _this = this;
|
|
3995
|
-
this.
|
|
3862
|
+
this.form.controls.searchTerm.valueChanges
|
|
3996
3863
|
.pipe(operators.tap(( /**
|
|
3864
|
+
* @param {?} term
|
|
3997
3865
|
* @return {?}
|
|
3998
|
-
*/function () { return _this.
|
|
3866
|
+
*/function (term) { return _this.locationInputChanged.next(term); })), operators.tap(( /**
|
|
3999
3867
|
* @return {?}
|
|
4000
|
-
*/function () { return _this.
|
|
3868
|
+
*/function () { return _this.locations = []; })), operators.tap(( /**
|
|
4001
3869
|
* @param {?} term
|
|
4002
3870
|
* @return {?}
|
|
4003
3871
|
*/function (term) { return _this.term = term; })), operators.filter(( /**
|
|
@@ -4015,13 +3883,10 @@
|
|
|
4015
3883
|
*/function (locations) {
|
|
4016
3884
|
_this.locations = locations;
|
|
4017
3885
|
_this.cd.markForCheck();
|
|
4018
|
-
if (locations.length === 1 && _this.term === locations[0].
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
_this.showAutocomplete = false;
|
|
4023
|
-
return;
|
|
4024
|
-
}
|
|
3886
|
+
if (locations.length === 1 && _this.term === locations[0].venue_name && !_this.singleMode) {
|
|
3887
|
+
_this.locationSelected.emit(locations[0]);
|
|
3888
|
+
_this.showAutocomplete = false;
|
|
3889
|
+
return;
|
|
4025
3890
|
}
|
|
4026
3891
|
_this.showAutocomplete = true;
|
|
4027
3892
|
}));
|
|
@@ -4040,23 +3905,11 @@
|
|
|
4040
3905
|
/**
|
|
4041
3906
|
* @return {?}
|
|
4042
3907
|
*/
|
|
4043
|
-
SearchLocationComponent.prototype.
|
|
3908
|
+
SearchLocationComponent.prototype.resetSearchTerm = /**
|
|
4044
3909
|
* @return {?}
|
|
4045
3910
|
*/
|
|
4046
3911
|
function () {
|
|
4047
|
-
|
|
4048
|
-
/** @type {?} */
|
|
4049
|
-
var formArray = ( /** @type {?} */(this.findLocationFormGroup.controls.locationSelectedFormControl));
|
|
4050
|
-
if (formArray.length > 0) {
|
|
4051
|
-
/** @type {?} */
|
|
4052
|
-
var value = formArray.value[formArray.length - 1];
|
|
4053
|
-
return value ? formArray.value[formArray.length - 1].court_name : null;
|
|
4054
|
-
}
|
|
4055
|
-
}
|
|
4056
|
-
else {
|
|
4057
|
-
return this.findLocationFormGroup && this.findLocationFormGroup.controls && this.findLocationFormGroup.controls.locationSelectedFormControl.value ?
|
|
4058
|
-
(( /** @type {?} */(this.findLocationFormGroup.controls.locationSelectedFormControl.value))).court_name : '';
|
|
4059
|
-
}
|
|
3912
|
+
this.form.controls.searchTerm.patchValue('', { emitEvent: false, onlySelf: true });
|
|
4060
3913
|
};
|
|
4061
3914
|
/**
|
|
4062
3915
|
* @private
|
|
@@ -4070,6 +3923,9 @@
|
|
|
4070
3923
|
*/
|
|
4071
3924
|
function (locations) {
|
|
4072
3925
|
var _this = this;
|
|
3926
|
+
if (this.singleMode) {
|
|
3927
|
+
return locations;
|
|
3928
|
+
}
|
|
4073
3929
|
return locations.filter(( /**
|
|
4074
3930
|
* @param {?} location
|
|
4075
3931
|
* @return {?}
|
|
@@ -4077,14 +3933,14 @@
|
|
|
4077
3933
|
return !_this.selectedLocations.map(( /**
|
|
4078
3934
|
* @param {?} selectedLocation
|
|
4079
3935
|
* @return {?}
|
|
4080
|
-
*/function (selectedLocation) { return selectedLocation.
|
|
3936
|
+
*/function (selectedLocation) { return selectedLocation.epimms_id; })).includes(location.epimms_id) && location.venue_name;
|
|
4081
3937
|
}));
|
|
4082
3938
|
};
|
|
4083
3939
|
SearchLocationComponent.decorators = [
|
|
4084
3940
|
{ type: i0.Component, args: [{
|
|
4085
3941
|
selector: 'exui-search-location',
|
|
4086
|
-
template: "<div class=\"auto-complete-container\">\n <
|
|
4087
|
-
styles: [".autocomplete__input
|
|
3942
|
+
template: "<div class=\"auto-complete-container\">\n <input\n [formControl]=\"form.controls.searchTerm\"\n [matAutocomplete]=\"autoSearchLocation\"\n class=\"govuk-input\"\n [attr.disabled]=\"disabled\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchLocation=\"matAutocomplete\">\n <mat-option *ngFor=\"let location of locations\"\n (onSelectionChange)=\"onSelectionChange(location)\">\n {{ location.venue_name }}\n </mat-option>\n <mat-option *ngIf=\"!locations.length && showAutocomplete && term && term.length >= this.minSearchCharacters\">No results found</mat-option>\n </mat-autocomplete>\n</div>\n",
|
|
3943
|
+
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:rgba(0,0,0,.256863) 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:solid #b1b4b6;border-width:1px 0;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:550px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}"]
|
|
4088
3944
|
}] }
|
|
4089
3945
|
];
|
|
4090
3946
|
/** @nocollapse */
|
|
@@ -4098,19 +3954,241 @@
|
|
|
4098
3954
|
SearchLocationComponent.propDecorators = {
|
|
4099
3955
|
control: [{ type: i0.Input }],
|
|
4100
3956
|
disabled: [{ type: i0.Input }],
|
|
3957
|
+
singleMode: [{ type: i0.Input }],
|
|
4101
3958
|
locationType: [{ type: i0.Input }],
|
|
4102
3959
|
serviceIds: [{ type: i0.Input }],
|
|
4103
3960
|
submitted: [{ type: i0.Input }],
|
|
4104
3961
|
delay: [{ type: i0.Input }],
|
|
4105
|
-
|
|
3962
|
+
form: [{ type: i0.Input }],
|
|
4106
3963
|
showAutocomplete: [{ type: i0.Input }],
|
|
4107
3964
|
locations: [{ type: i0.Input }],
|
|
4108
3965
|
locationSelected: [{ type: i0.Output }],
|
|
3966
|
+
locationInputChanged: [{ type: i0.Output }],
|
|
3967
|
+
reset: [{ type: i0.Input }],
|
|
4109
3968
|
selectedLocations: [{ type: i0.Input }]
|
|
4110
3969
|
};
|
|
4111
3970
|
return SearchLocationComponent;
|
|
4112
3971
|
}());
|
|
4113
3972
|
|
|
3973
|
+
/**
|
|
3974
|
+
* @fileoverview added by tsickle
|
|
3975
|
+
* Generated from: lib/components/find-location/find-location.component.ts
|
|
3976
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3977
|
+
*/
|
|
3978
|
+
var FindLocationComponent = /** @class */ (function () {
|
|
3979
|
+
function FindLocationComponent() {
|
|
3980
|
+
this.selectedLocations = [];
|
|
3981
|
+
this.submitted = true;
|
|
3982
|
+
this.enableAddLocationButton = true;
|
|
3983
|
+
this.title = 'Search for a location by name';
|
|
3984
|
+
this.locations = [];
|
|
3985
|
+
this.tempSelectedLocation = null;
|
|
3986
|
+
this.serviceIds = 'SSCS,IA';
|
|
3987
|
+
this.pServices = [];
|
|
3988
|
+
this.pDisabled = false;
|
|
3989
|
+
}
|
|
3990
|
+
Object.defineProperty(FindLocationComponent.prototype, "disabled", {
|
|
3991
|
+
get: /**
|
|
3992
|
+
* @return {?}
|
|
3993
|
+
*/ function () {
|
|
3994
|
+
return this.pDisabled;
|
|
3995
|
+
},
|
|
3996
|
+
set: /**
|
|
3997
|
+
* @param {?} value
|
|
3998
|
+
* @return {?}
|
|
3999
|
+
*/ function (value) {
|
|
4000
|
+
if (value) {
|
|
4001
|
+
this.searchLocationComponent.resetSearchTerm();
|
|
4002
|
+
this.removeSelectedValues();
|
|
4003
|
+
}
|
|
4004
|
+
this.pDisabled = value;
|
|
4005
|
+
},
|
|
4006
|
+
enumerable: true,
|
|
4007
|
+
configurable: true
|
|
4008
|
+
});
|
|
4009
|
+
Object.defineProperty(FindLocationComponent.prototype, "services", {
|
|
4010
|
+
get: /**
|
|
4011
|
+
* @return {?}
|
|
4012
|
+
*/ function () {
|
|
4013
|
+
return this.pServices;
|
|
4014
|
+
},
|
|
4015
|
+
set: /**
|
|
4016
|
+
* @param {?} value
|
|
4017
|
+
* @return {?}
|
|
4018
|
+
*/ function (value) {
|
|
4019
|
+
var _this = this;
|
|
4020
|
+
this.pServices = value;
|
|
4021
|
+
/** @type {?} */
|
|
4022
|
+
var field = this.fields.find(( /**
|
|
4023
|
+
* @param {?} f
|
|
4024
|
+
* @return {?}
|
|
4025
|
+
*/function (f) { return f.name === _this.field.findLocationField; }));
|
|
4026
|
+
if (field) {
|
|
4027
|
+
if (typeof value === 'string') {
|
|
4028
|
+
this.serviceIds = value;
|
|
4029
|
+
}
|
|
4030
|
+
else {
|
|
4031
|
+
this.serviceIds = getValues(field.options, value).filter(( /**
|
|
4032
|
+
* @param {?} x
|
|
4033
|
+
* @return {?}
|
|
4034
|
+
*/function (x) { return x !== 'services_all'; })).join(',');
|
|
4035
|
+
}
|
|
4036
|
+
}
|
|
4037
|
+
},
|
|
4038
|
+
enumerable: true,
|
|
4039
|
+
configurable: true
|
|
4040
|
+
});
|
|
4041
|
+
/**
|
|
4042
|
+
* @return {?}
|
|
4043
|
+
*/
|
|
4044
|
+
FindLocationComponent.prototype.addLocation = /**
|
|
4045
|
+
* @return {?}
|
|
4046
|
+
*/
|
|
4047
|
+
function () {
|
|
4048
|
+
if (this.tempSelectedLocation) {
|
|
4049
|
+
this.selectedLocations = __spread(this.selectedLocations, [this.tempSelectedLocation]);
|
|
4050
|
+
this.addSelectedLocationsToForm([this.tempSelectedLocation]);
|
|
4051
|
+
this.tempSelectedLocation = null;
|
|
4052
|
+
this.locations = [];
|
|
4053
|
+
this.searchLocationComponent.resetSearchTerm();
|
|
4054
|
+
}
|
|
4055
|
+
};
|
|
4056
|
+
/**
|
|
4057
|
+
* @param {?} location
|
|
4058
|
+
* @return {?}
|
|
4059
|
+
*/
|
|
4060
|
+
FindLocationComponent.prototype.removeLocation = /**
|
|
4061
|
+
* @param {?} location
|
|
4062
|
+
* @return {?}
|
|
4063
|
+
*/
|
|
4064
|
+
function (location) {
|
|
4065
|
+
if (location.epimms_id) {
|
|
4066
|
+
this.selectedLocations = this.selectedLocations.filter(( /**
|
|
4067
|
+
* @param {?} selectedLocation
|
|
4068
|
+
* @return {?}
|
|
4069
|
+
*/function (selectedLocation) { return selectedLocation.epimms_id !== location.epimms_id; }));
|
|
4070
|
+
/** @type {?} */
|
|
4071
|
+
var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
|
|
4072
|
+
/** @type {?} */
|
|
4073
|
+
var index = (( /** @type {?} */(formArray.value))).findIndex(( /**
|
|
4074
|
+
* @param {?} selectedLocation
|
|
4075
|
+
* @return {?}
|
|
4076
|
+
*/function (selectedLocation) { return selectedLocation.epimms_id === location.epimms_id; }));
|
|
4077
|
+
if (index > -1) {
|
|
4078
|
+
formArray.removeAt(index);
|
|
4079
|
+
}
|
|
4080
|
+
}
|
|
4081
|
+
};
|
|
4082
|
+
/**
|
|
4083
|
+
* @param {?} term
|
|
4084
|
+
* @return {?}
|
|
4085
|
+
*/
|
|
4086
|
+
FindLocationComponent.prototype.onInputChanged = /**
|
|
4087
|
+
* @param {?} term
|
|
4088
|
+
* @return {?}
|
|
4089
|
+
*/
|
|
4090
|
+
function (term) {
|
|
4091
|
+
// if the filter is in single mode clear the selected locations
|
|
4092
|
+
if (typeof term === 'string' && this.field.maxSelected === 1) {
|
|
4093
|
+
this.removeSelectedValues();
|
|
4094
|
+
}
|
|
4095
|
+
};
|
|
4096
|
+
/**
|
|
4097
|
+
* @param {?} location
|
|
4098
|
+
* @return {?}
|
|
4099
|
+
*/
|
|
4100
|
+
FindLocationComponent.prototype.onLocationSelected = /**
|
|
4101
|
+
* @param {?} location
|
|
4102
|
+
* @return {?}
|
|
4103
|
+
*/
|
|
4104
|
+
function (location) {
|
|
4105
|
+
if (this.field.maxSelected === 1) {
|
|
4106
|
+
this.removeSelectedValues();
|
|
4107
|
+
this.addSelectedLocationsToForm([location]);
|
|
4108
|
+
}
|
|
4109
|
+
else {
|
|
4110
|
+
if (!this.selectedLocations.find(( /**
|
|
4111
|
+
* @param {?} x
|
|
4112
|
+
* @return {?}
|
|
4113
|
+
*/function (x) { return x.epimms_id === location.epimms_id; }))) {
|
|
4114
|
+
if (location.epimms_id) {
|
|
4115
|
+
this.tempSelectedLocation = location;
|
|
4116
|
+
}
|
|
4117
|
+
}
|
|
4118
|
+
}
|
|
4119
|
+
};
|
|
4120
|
+
/**
|
|
4121
|
+
* @private
|
|
4122
|
+
* @return {?}
|
|
4123
|
+
*/
|
|
4124
|
+
FindLocationComponent.prototype.removeSelectedValues = /**
|
|
4125
|
+
* @private
|
|
4126
|
+
* @return {?}
|
|
4127
|
+
*/
|
|
4128
|
+
function () {
|
|
4129
|
+
/** @type {?} */
|
|
4130
|
+
var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
|
|
4131
|
+
for (var i = 0; i < formArray.length; i++) {
|
|
4132
|
+
formArray.removeAt(i);
|
|
4133
|
+
}
|
|
4134
|
+
this.selectedLocations = [];
|
|
4135
|
+
};
|
|
4136
|
+
/**
|
|
4137
|
+
* @private
|
|
4138
|
+
* @param {?} locations
|
|
4139
|
+
* @return {?}
|
|
4140
|
+
*/
|
|
4141
|
+
FindLocationComponent.prototype.addSelectedLocationsToForm = /**
|
|
4142
|
+
* @private
|
|
4143
|
+
* @param {?} locations
|
|
4144
|
+
* @return {?}
|
|
4145
|
+
*/
|
|
4146
|
+
function (locations) {
|
|
4147
|
+
var e_1, _a;
|
|
4148
|
+
/** @type {?} */
|
|
4149
|
+
var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
|
|
4150
|
+
try {
|
|
4151
|
+
for (var locations_1 = __values(locations), locations_1_1 = locations_1.next(); !locations_1_1.done; locations_1_1 = locations_1.next()) {
|
|
4152
|
+
var location_1 = locations_1_1.value;
|
|
4153
|
+
formArray.push(new forms.FormControl(location_1));
|
|
4154
|
+
}
|
|
4155
|
+
}
|
|
4156
|
+
catch (e_1_1) {
|
|
4157
|
+
e_1 = { error: e_1_1 };
|
|
4158
|
+
}
|
|
4159
|
+
finally {
|
|
4160
|
+
try {
|
|
4161
|
+
if (locations_1_1 && !locations_1_1.done && (_a = locations_1.return))
|
|
4162
|
+
_a.call(locations_1);
|
|
4163
|
+
}
|
|
4164
|
+
finally {
|
|
4165
|
+
if (e_1)
|
|
4166
|
+
throw e_1.error;
|
|
4167
|
+
}
|
|
4168
|
+
}
|
|
4169
|
+
};
|
|
4170
|
+
FindLocationComponent.decorators = [
|
|
4171
|
+
{ type: i0.Component, args: [{
|
|
4172
|
+
selector: 'xuilib-find-location',
|
|
4173
|
+
template: "<div class=\"location-picker-custom\">\n <div class=\"search-location\">\n <div>\n <label id=\"input-selected-location-label\" *ngIf=\"title\">{{title}}</label>\n </div>\n <exui-search-location class=\"search-location\"\n [locations]=\"locations\"\n [selectedLocations]=\"selectedLocations\"\n [singleMode]=\"field.maxSelected === 1\"\n [delay]=\"300\"\n [disabled]=\"disabled\"\n [serviceIds]=\"serviceIds\"\n (locationInputChanged)=\"onInputChanged($event)\"\n (locationSelected)=\"onLocationSelected($event)\"\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.venue_name }}\n </a>\n </li>\n </ul>\n</div>\n",
|
|
4174
|
+
styles: [""]
|
|
4175
|
+
}] }
|
|
4176
|
+
];
|
|
4177
|
+
FindLocationComponent.propDecorators = {
|
|
4178
|
+
selectedLocations: [{ type: i0.Input }],
|
|
4179
|
+
submitted: [{ type: i0.Input }],
|
|
4180
|
+
enableAddLocationButton: [{ type: i0.Input }],
|
|
4181
|
+
form: [{ type: i0.Input }],
|
|
4182
|
+
field: [{ type: i0.Input }],
|
|
4183
|
+
fields: [{ type: i0.Input }],
|
|
4184
|
+
title: [{ type: i0.Input }],
|
|
4185
|
+
searchLocationComponent: [{ type: i0.ViewChild, args: [SearchLocationComponent,] }],
|
|
4186
|
+
disabled: [{ type: i0.Input }],
|
|
4187
|
+
services: [{ type: i0.Input }]
|
|
4188
|
+
};
|
|
4189
|
+
return FindLocationComponent;
|
|
4190
|
+
}());
|
|
4191
|
+
|
|
4114
4192
|
/**
|
|
4115
4193
|
* @fileoverview added by tsickle
|
|
4116
4194
|
* Generated from: lib/components/pagination/pagination.component.ts
|
|
@@ -4717,8 +4795,9 @@
|
|
|
4717
4795
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4718
4796
|
*/
|
|
4719
4797
|
var FindPersonComponent = /** @class */ (function () {
|
|
4720
|
-
function FindPersonComponent(findPersonService) {
|
|
4798
|
+
function FindPersonComponent(findPersonService, cd) {
|
|
4721
4799
|
this.findPersonService = findPersonService;
|
|
4800
|
+
this.cd = cd;
|
|
4722
4801
|
this.personSelected = new i0.EventEmitter();
|
|
4723
4802
|
this.boldTitle = 'Find the person';
|
|
4724
4803
|
this.subTitle = 'Type the name of the person and select them.';
|
|
@@ -4727,7 +4806,7 @@
|
|
|
4727
4806
|
this.disabled = null;
|
|
4728
4807
|
this.userIncluded = false;
|
|
4729
4808
|
this.placeholderContent = '';
|
|
4730
|
-
this.isNoResultsShown =
|
|
4809
|
+
this.isNoResultsShown = true;
|
|
4731
4810
|
this.showUpdatedColor = false;
|
|
4732
4811
|
this.selectedPersons = [];
|
|
4733
4812
|
this.errorMessage = 'You must select a name';
|
|
@@ -4736,8 +4815,9 @@
|
|
|
4736
4815
|
this.isPersonSelectionCompleted = false;
|
|
4737
4816
|
this.showAutocomplete = false;
|
|
4738
4817
|
this.currentInputValue = '';
|
|
4739
|
-
this.
|
|
4740
|
-
this.findPersonControl = new forms.FormControl();
|
|
4818
|
+
this.chosenPerson = null;
|
|
4819
|
+
this.findPersonControl = new forms.FormControl('');
|
|
4820
|
+
this.filteredOptions = [];
|
|
4741
4821
|
this.minSearchCharacters = 2;
|
|
4742
4822
|
}
|
|
4743
4823
|
/**
|
|
@@ -4754,12 +4834,29 @@
|
|
|
4754
4834
|
else {
|
|
4755
4835
|
this.findPersonGroup.addControl('findPersonControl', this.findPersonControl);
|
|
4756
4836
|
}
|
|
4757
|
-
this.
|
|
4837
|
+
this.findPersonControl.valueChanges.pipe(operators.startWith(''), operators.tap(( /**
|
|
4838
|
+
* @return {?}
|
|
4839
|
+
*/function () { return _this.showAutocomplete = false; })), operators.tap(( /**
|
|
4840
|
+
* @return {?}
|
|
4841
|
+
*/function () { return _this.filteredOptions = []; })), operators.filter(( /**
|
|
4842
|
+
* @param {?} searchTerm
|
|
4843
|
+
* @return {?}
|
|
4844
|
+
*/function (searchTerm) { return searchTerm && searchTerm.length > _this.minSearchCharacters; })), operators.switchMap(( /**
|
|
4758
4845
|
* @param {?} searchTerm
|
|
4759
4846
|
* @return {?}
|
|
4760
4847
|
*/function (searchTerm) {
|
|
4761
|
-
return _this.filter(searchTerm
|
|
4762
|
-
|
|
4848
|
+
return _this.filter(searchTerm).pipe(operators.tap(( /**
|
|
4849
|
+
* @return {?}
|
|
4850
|
+
*/function () { return _this.showAutocomplete = true; })), operators.catchError(( /**
|
|
4851
|
+
* @return {?}
|
|
4852
|
+
*/function () { return _this.filteredOptions = []; })));
|
|
4853
|
+
}))).subscribe(( /**
|
|
4854
|
+
* @param {?} people
|
|
4855
|
+
* @return {?}
|
|
4856
|
+
*/function (people) {
|
|
4857
|
+
_this.filteredOptions = people;
|
|
4858
|
+
_this.cd.detectChanges();
|
|
4859
|
+
}));
|
|
4763
4860
|
this.findPersonControl.setValue(this.selectedPerson);
|
|
4764
4861
|
};
|
|
4765
4862
|
/**
|
|
@@ -4829,24 +4926,25 @@
|
|
|
4829
4926
|
return findCaseworkersOrAdmins;
|
|
4830
4927
|
}
|
|
4831
4928
|
default: {
|
|
4832
|
-
return rxjs.of();
|
|
4929
|
+
return rxjs.of([]);
|
|
4833
4930
|
}
|
|
4834
4931
|
}
|
|
4835
4932
|
}
|
|
4836
|
-
return rxjs.of();
|
|
4933
|
+
return rxjs.of([]);
|
|
4837
4934
|
};
|
|
4838
4935
|
/**
|
|
4839
|
-
* @param {
|
|
4936
|
+
* @param {?} selectedPerson
|
|
4840
4937
|
* @return {?}
|
|
4841
4938
|
*/
|
|
4842
4939
|
FindPersonComponent.prototype.onSelectionChange = /**
|
|
4843
|
-
* @param {
|
|
4940
|
+
* @param {?} selectedPerson
|
|
4844
4941
|
* @return {?}
|
|
4845
4942
|
*/
|
|
4846
4943
|
function (selectedPerson) {
|
|
4847
4944
|
this.isPersonSelectionCompleted = true;
|
|
4848
|
-
this.
|
|
4945
|
+
this.chosenPerson = selectedPerson;
|
|
4849
4946
|
this.personSelected.emit(selectedPerson);
|
|
4947
|
+
this.findPersonControl.setValue('');
|
|
4850
4948
|
};
|
|
4851
4949
|
/**
|
|
4852
4950
|
* @param {?} currentValue
|
|
@@ -4859,7 +4957,7 @@
|
|
|
4859
4957
|
function (currentValue) {
|
|
4860
4958
|
this.currentInputValue = currentValue;
|
|
4861
4959
|
this.showAutocomplete = !!currentValue && (currentValue.length > this.minSearchCharacters);
|
|
4862
|
-
this.isPersonSelectionCompleted =
|
|
4960
|
+
this.isPersonSelectionCompleted = this.getDisplayName(this.chosenPerson) === currentValue;
|
|
4863
4961
|
};
|
|
4864
4962
|
/**
|
|
4865
4963
|
* @param {?} selectedPerson
|
|
@@ -4870,6 +4968,9 @@
|
|
|
4870
4968
|
* @return {?}
|
|
4871
4969
|
*/
|
|
4872
4970
|
function (selectedPerson) {
|
|
4971
|
+
if (!selectedPerson) {
|
|
4972
|
+
return '';
|
|
4973
|
+
}
|
|
4873
4974
|
if (selectedPerson.domain === PersonRole.JUDICIAL && selectedPerson.knownAs) {
|
|
4874
4975
|
return selectedPerson.knownAs + "(" + selectedPerson.email + ")";
|
|
4875
4976
|
}
|
|
@@ -4878,14 +4979,15 @@
|
|
|
4878
4979
|
FindPersonComponent.decorators = [
|
|
4879
4980
|
{ type: i0.Component, args: [{
|
|
4880
4981
|
selector: 'xuilib-find-person',
|
|
4881
|
-
template: "<h1 class=\"govuk-heading-l\" *ngIf=\"title && title.length\">\n <span class=\"govuk-caption-l\">{{title}}</span>\n {{boldTitle}}\n</h1>\n<div class=\"govuk-form-group\" [formGroup]=\"findPersonGroup\"\n [ngClass]=\"{'form-group-error':
|
|
4982
|
+
template: "<h1 class=\"govuk-heading-l\" *ngIf=\"title && title.length\">\n <span class=\"govuk-caption-l\">{{title}}</span>\n {{boldTitle}}\n</h1>\n<div class=\"govuk-form-group\" [formGroup]=\"findPersonGroup\"\n [ngClass]=\"{'form-group-error': findPersonGroup.get('findPersonControl').invalid && submitted}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"sub-title-hint\">\n <div id=\"sub-title-hint\" class=\"govuk-hint\" *ngIf=\"subTitle && subTitle.length\">\n {{subTitle}}\n </div>\n <span id=\"validation-error\" class=\"govuk-error-message\" *ngIf=\"findPersonGroup && findPersonGroup.errors\">\n <span class=\"govuk-visually-hidden\">Error:</span>{{findPersonGroup.errors.error ? findPersonGroup.errors.error : errorMessage}}\n </span>\n <input id=\"inputSelectPerson{{idValue}}\" type=\"text\" aria-label=\"select a person\" matInput\n formControlName=\"findPersonControl\"\n [matAutocomplete]=\"auto\"\n class=\"govuk-input govuk-!-width-one-third\"\n (ngModelChange)=\"updatedVal($event)\"\n [placeholder]=\"placeholderContent\"\n [attr.disabled]=\"disabled\"\n [value]=\"selectedPerson\">\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of filteredOptions\"\n [value]=\"getDisplayName(option)\"\n (onSelectionChange)=\"onSelectionChange(option)\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete, 'select-option': showUpdatedColor}\">\n {{getDisplayName(option)}}\n </mat-option>\n <mat-option [ngClass]=\"{'select-option': showUpdatedColor}\" *ngIf=\"isNoResultsShown && currentInputValue && currentInputValue.length > minSearchCharacters && !filteredOptions.length && showAutocomplete\">No results found</mat-option>\n </mat-autocomplete>\n </fieldset>\n</div>\n",
|
|
4882
4983
|
styles: [".mat-option:hover{background:#2596be}.mat-option.select-option:hover{background:#1d70b8;color:#fff}.hide-autocomplete{display:none}"]
|
|
4883
4984
|
}] }
|
|
4884
4985
|
];
|
|
4885
4986
|
/** @nocollapse */
|
|
4886
4987
|
FindPersonComponent.ctorParameters = function () {
|
|
4887
4988
|
return [
|
|
4888
|
-
{ type: FindAPersonService }
|
|
4989
|
+
{ type: FindAPersonService },
|
|
4990
|
+
{ type: i0.ChangeDetectorRef }
|
|
4889
4991
|
];
|
|
4890
4992
|
};
|
|
4891
4993
|
FindPersonComponent.propDecorators = {
|
|
@@ -5986,7 +6088,8 @@
|
|
|
5986
6088
|
forms.ReactiveFormsModule,
|
|
5987
6089
|
i2$2.RouterModule.forChild([]),
|
|
5988
6090
|
autocomplete.MatAutocompleteModule,
|
|
5989
|
-
material.MatTabsModule
|
|
6091
|
+
material.MatTabsModule,
|
|
6092
|
+
material.MatInputModule
|
|
5990
6093
|
],
|
|
5991
6094
|
providers: [
|
|
5992
6095
|
{ provide: windowToken, useFactory: ɵ0 }
|