@hmcts/rpx-xui-common-lib 1.7.43 → 1.7.47-add-default-option1
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 +384 -57
- 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/hmcts-rpx-xui-common-lib.js +3 -2
- package/esm2015/lib/components/find-location/find-location.component.js +2 -2
- package/esm2015/lib/components/find-service/find-service.component.js +128 -27
- package/esm2015/lib/components/generic-filter/generic-filter-utils.js +1 -1
- package/esm2015/lib/components/generic-filter/generic-filter.component.js +152 -13
- package/esm2015/lib/components/search-location/search-location.component.js +2 -2
- package/esm2015/lib/components/search-service/search-service.component.js +16 -33
- package/esm2015/lib/exui-common-lib.module.js +10 -3
- package/esm2015/lib/models/filter.model.js +57 -3
- package/esm2015/lib/pipes/capitalize.pipe.js +21 -0
- package/esm2015/lib/services/filter/filter.service.js +19 -5
- package/esm2015/lib/services/find-person/find-person.service.js +3 -3
- package/esm2015/lib/services/storage/session-storage/session-storage.service.js +55 -0
- package/esm5/hmcts-rpx-xui-common-lib.js +3 -2
- package/esm5/lib/components/find-location/find-location.component.js +2 -2
- package/esm5/lib/components/find-service/find-service.component.js +166 -25
- package/esm5/lib/components/generic-filter/generic-filter-utils.js +1 -1
- package/esm5/lib/components/generic-filter/generic-filter.component.js +168 -12
- package/esm5/lib/components/search-location/search-location.component.js +2 -2
- package/esm5/lib/components/search-service/search-service.component.js +18 -37
- package/esm5/lib/exui-common-lib.module.js +8 -3
- package/esm5/lib/models/filter.model.js +57 -3
- package/esm5/lib/pipes/capitalize.pipe.js +29 -0
- package/esm5/lib/services/filter/filter.service.js +23 -5
- package/esm5/lib/services/find-person/find-person.service.js +3 -3
- package/esm5/lib/services/{session-storage → storage/session-storage}/session-storage.service.js +2 -2
- package/fesm2015/hmcts-rpx-xui-common-lib.js +333 -56
- package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/fesm5/hmcts-rpx-xui-common-lib.js +397 -57
- package/fesm5/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/hmcts-rpx-xui-common-lib.d.ts +2 -1
- package/hmcts-rpx-xui-common-lib.metadata.json +1 -1
- package/lib/components/find-service/find-service.component.d.ts +15 -9
- package/lib/components/generic-filter/generic-filter-utils.d.ts +2 -5
- package/lib/components/generic-filter/generic-filter.component.d.ts +6 -2
- package/lib/components/search-location/search-location.component.d.ts +1 -1
- package/lib/components/search-service/search-service.component.d.ts +5 -11
- package/lib/exui-common-lib.module.d.ts +1 -2
- package/lib/models/filter.model.d.ts +26 -7
- package/lib/pipes/capitalize.pipe.d.ts +4 -0
- package/lib/services/filter/filter.service.d.ts +1 -0
- package/lib/services/find-person/find-person.service.d.ts +1 -1
- package/lib/services/{session-storage → storage/session-storage}/session-storage.service.d.ts +0 -0
- package/package.json +1 -1
- package/esm2015/lib/services/session-storage/session-storage.service.js +0 -55
|
@@ -709,10 +709,10 @@
|
|
|
709
709
|
return this.filterSettings[id];
|
|
710
710
|
}
|
|
711
711
|
if (sessionStorage.getItem(id)) {
|
|
712
|
-
return JSON.parse(
|
|
712
|
+
return JSON.parse(sessionStorage.getItem(id));
|
|
713
713
|
}
|
|
714
714
|
if (localStorage.getItem(id)) {
|
|
715
|
-
return JSON.parse(
|
|
715
|
+
return JSON.parse(localStorage.getItem(id));
|
|
716
716
|
}
|
|
717
717
|
return null;
|
|
718
718
|
};
|
|
@@ -730,6 +730,24 @@
|
|
|
730
730
|
}
|
|
731
731
|
return this.streams[id].asObservable();
|
|
732
732
|
};
|
|
733
|
+
/**
|
|
734
|
+
* @param {?} id
|
|
735
|
+
* @return {?}
|
|
736
|
+
*/
|
|
737
|
+
FilterService.prototype.clearSessionAndLocalPersistance = /**
|
|
738
|
+
* @param {?} id
|
|
739
|
+
* @return {?}
|
|
740
|
+
*/
|
|
741
|
+
function (id) {
|
|
742
|
+
sessionStorage.removeItem(id);
|
|
743
|
+
localStorage.removeItem(id);
|
|
744
|
+
if (this.filterSettings[id] !== undefined) {
|
|
745
|
+
this.filterSettings[id] = null;
|
|
746
|
+
}
|
|
747
|
+
if (this.streams[id] !== undefined) {
|
|
748
|
+
this.streams[id].next(null);
|
|
749
|
+
}
|
|
750
|
+
};
|
|
733
751
|
/**
|
|
734
752
|
* @private
|
|
735
753
|
* @param {?} setting
|
|
@@ -741,7 +759,7 @@
|
|
|
741
759
|
* @return {?}
|
|
742
760
|
*/
|
|
743
761
|
function (setting) {
|
|
744
|
-
|
|
762
|
+
localStorage.setItem(setting.id, JSON.stringify(setting));
|
|
745
763
|
};
|
|
746
764
|
/**
|
|
747
765
|
* @private
|
|
@@ -754,7 +772,7 @@
|
|
|
754
772
|
* @return {?}
|
|
755
773
|
*/
|
|
756
774
|
function (setting) {
|
|
757
|
-
|
|
775
|
+
sessionStorage.setItem(setting.id, JSON.stringify(setting));
|
|
758
776
|
};
|
|
759
777
|
/**
|
|
760
778
|
* @private
|
|
@@ -917,10 +935,10 @@
|
|
|
917
935
|
function (field) {
|
|
918
936
|
/** @type {?} */
|
|
919
937
|
var validators = [];
|
|
920
|
-
if (field && field.minSelected) {
|
|
938
|
+
if (field && field.minSelected > 0) {
|
|
921
939
|
validators.push(minSelectedValidator(field.minSelected));
|
|
922
940
|
}
|
|
923
|
-
if (field && field.maxSelected) {
|
|
941
|
+
if (field && field.maxSelected > 0) {
|
|
924
942
|
validators.push(maxSelectedValidator(field.maxSelected));
|
|
925
943
|
}
|
|
926
944
|
return validators;
|
|
@@ -941,6 +959,7 @@
|
|
|
941
959
|
this.formSub = this.form.valueChanges.subscribe(( /**
|
|
942
960
|
* @return {?}
|
|
943
961
|
*/function () { return _this.submitted = false; }));
|
|
962
|
+
this.filterSkillsByServices(null, this.config);
|
|
944
963
|
};
|
|
945
964
|
/**
|
|
946
965
|
* @return {?}
|
|
@@ -1120,6 +1139,11 @@
|
|
|
1120
1139
|
* @return {?}
|
|
1121
1140
|
*/
|
|
1122
1141
|
function (field) {
|
|
1142
|
+
if (field.name === 'user-services') {
|
|
1143
|
+
/** @type {?} */
|
|
1144
|
+
var selectedServices = this.getSelectedValuesForFields(this.form.controls, field);
|
|
1145
|
+
this.filterSkillsByServices(selectedServices, this.config);
|
|
1146
|
+
}
|
|
1123
1147
|
if (field.radioSelectionChange && typeof field.radioSelectionChange === 'string') {
|
|
1124
1148
|
var _a = __read(field.enableCondition.split('='), 2), name_3 = _a[0], value = _a[1];
|
|
1125
1149
|
this.form.get(name_3).patchValue(value);
|
|
@@ -1141,6 +1165,9 @@
|
|
|
1141
1165
|
this.filterService.persist(settings, this.config.persistence);
|
|
1142
1166
|
this.filterService.givenErrors.next(null);
|
|
1143
1167
|
this.submitted = false;
|
|
1168
|
+
if (this.config.cancelButtonCallback) {
|
|
1169
|
+
this.config.cancelButtonCallback();
|
|
1170
|
+
}
|
|
1144
1171
|
};
|
|
1145
1172
|
/**
|
|
1146
1173
|
* @param {?} values
|
|
@@ -1404,9 +1431,9 @@
|
|
|
1404
1431
|
var formArray = this_1.buildCheckBoxFormArray(field, settings);
|
|
1405
1432
|
this_1.form.addControl(field.name, formArray);
|
|
1406
1433
|
}
|
|
1407
|
-
else if (field.type === 'find-location') {
|
|
1434
|
+
else if (field.type === 'find-location' || field.type === 'find-service') {
|
|
1408
1435
|
/** @type {?} */
|
|
1409
|
-
var formArray = this_1.
|
|
1436
|
+
var formArray = this_1.buildFormArray(field, settings);
|
|
1410
1437
|
this_1.form.addControl(field.name, formArray);
|
|
1411
1438
|
}
|
|
1412
1439
|
else {
|
|
@@ -1417,6 +1444,9 @@
|
|
|
1417
1444
|
if (field.type === 'text-input') {
|
|
1418
1445
|
validators.push(forms.Validators.minLength(field.minSelected));
|
|
1419
1446
|
}
|
|
1447
|
+
if (field.type === 'email-input') {
|
|
1448
|
+
validators.push(forms.Validators.email);
|
|
1449
|
+
}
|
|
1420
1450
|
}
|
|
1421
1451
|
/** @type {?} */
|
|
1422
1452
|
var defaultValue = null;
|
|
@@ -1448,7 +1478,7 @@
|
|
|
1448
1478
|
});
|
|
1449
1479
|
this_1.form.addControl(field.name, formGroup);
|
|
1450
1480
|
}
|
|
1451
|
-
else {
|
|
1481
|
+
else if (field.type !== 'group-title') {
|
|
1452
1482
|
/** @type {?} */
|
|
1453
1483
|
var control = new forms.FormControl(defaultValue, validators);
|
|
1454
1484
|
this_1.form.addControl(field.name, control);
|
|
@@ -1544,7 +1574,7 @@
|
|
|
1544
1574
|
* @param {?} settings
|
|
1545
1575
|
* @return {?}
|
|
1546
1576
|
*/
|
|
1547
|
-
GenericFilterComponent.prototype.
|
|
1577
|
+
GenericFilterComponent.prototype.buildFormArray = /**
|
|
1548
1578
|
* @private
|
|
1549
1579
|
* @param {?} field
|
|
1550
1580
|
* @param {?} settings
|
|
@@ -1643,11 +1673,11 @@
|
|
|
1643
1673
|
var field = _c.value;
|
|
1644
1674
|
/** @type {?} */
|
|
1645
1675
|
var formGroup = form.get(field.name);
|
|
1646
|
-
if (formGroup && formGroup.errors && formGroup.errors.minlength) {
|
|
1676
|
+
if (formGroup && formGroup.errors && (formGroup.errors.minlength || formGroup.errors.required)) {
|
|
1647
1677
|
errors.push({ name: field.name, error: field.minSelectedError });
|
|
1648
1678
|
}
|
|
1649
|
-
if (formGroup && formGroup.errors && formGroup.errors.
|
|
1650
|
-
errors.push({ name: field.name, error: field.
|
|
1679
|
+
if (formGroup && formGroup.errors && formGroup.errors.maxlength) {
|
|
1680
|
+
errors.push({ name: field.name, error: field.maxSelectedError });
|
|
1651
1681
|
}
|
|
1652
1682
|
}
|
|
1653
1683
|
}
|
|
@@ -1664,17 +1694,148 @@
|
|
|
1664
1694
|
throw e_8.error;
|
|
1665
1695
|
}
|
|
1666
1696
|
}
|
|
1697
|
+
// remove duplicates
|
|
1698
|
+
errors = errors.filter(( /**
|
|
1699
|
+
* @param {?} filterError
|
|
1700
|
+
* @param {?} i
|
|
1701
|
+
* @param {?} arr
|
|
1702
|
+
* @return {?}
|
|
1703
|
+
*/function (filterError, i, arr) {
|
|
1704
|
+
return errors.indexOf(arr.find(( /**
|
|
1705
|
+
* @param {?} item
|
|
1706
|
+
* @return {?}
|
|
1707
|
+
*/function (item) { return item.name === filterError.name; }))) === i;
|
|
1708
|
+
}));
|
|
1667
1709
|
if (errors.length) {
|
|
1668
1710
|
this.filterService.givenErrors.next(errors);
|
|
1669
1711
|
}
|
|
1670
1712
|
};
|
|
1713
|
+
/**
|
|
1714
|
+
* @param {?} services
|
|
1715
|
+
* @param {?} config
|
|
1716
|
+
* @return {?}
|
|
1717
|
+
*/
|
|
1718
|
+
GenericFilterComponent.prototype.filterSkillsByServices = /**
|
|
1719
|
+
* @param {?} services
|
|
1720
|
+
* @param {?} config
|
|
1721
|
+
* @return {?}
|
|
1722
|
+
*/
|
|
1723
|
+
function (services, config) {
|
|
1724
|
+
var _this = this;
|
|
1725
|
+
this.filteredSkillsByServices = [];
|
|
1726
|
+
/** @type {?} */
|
|
1727
|
+
var userSkillsField = config.fields.find(( /**
|
|
1728
|
+
* @param {?} f
|
|
1729
|
+
* @return {?}
|
|
1730
|
+
*/function (f) { return f.name === 'user-skills'; }));
|
|
1731
|
+
if (userSkillsField) {
|
|
1732
|
+
/** @type {?} */
|
|
1733
|
+
var userSkills_1 = userSkillsField.groupOptions;
|
|
1734
|
+
if (!services || services.length === 0) {
|
|
1735
|
+
this.filteredSkillsByServices = userSkills_1;
|
|
1736
|
+
}
|
|
1737
|
+
else {
|
|
1738
|
+
services.forEach(( /**
|
|
1739
|
+
* @param {?} s
|
|
1740
|
+
* @return {?}
|
|
1741
|
+
*/function (s) {
|
|
1742
|
+
/** @type {?} */
|
|
1743
|
+
var groupOption = userSkills_1.find(( /**
|
|
1744
|
+
* @param {?} u
|
|
1745
|
+
* @return {?}
|
|
1746
|
+
*/function (u) { return u.group === s; }));
|
|
1747
|
+
if (groupOption) {
|
|
1748
|
+
_this.filteredSkillsByServices.push(groupOption);
|
|
1749
|
+
}
|
|
1750
|
+
}));
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
this.filteredSkillsByServices = this.sortGroupOptions(this.filteredSkillsByServices);
|
|
1754
|
+
return this.filteredSkillsByServices;
|
|
1755
|
+
};
|
|
1756
|
+
/**
|
|
1757
|
+
* @private
|
|
1758
|
+
* @param {?} formValues
|
|
1759
|
+
* @param {?} field
|
|
1760
|
+
* @return {?}
|
|
1761
|
+
*/
|
|
1762
|
+
GenericFilterComponent.prototype.getSelectedValuesForFields = /**
|
|
1763
|
+
* @private
|
|
1764
|
+
* @param {?} formValues
|
|
1765
|
+
* @param {?} field
|
|
1766
|
+
* @return {?}
|
|
1767
|
+
*/
|
|
1768
|
+
function (formValues, field) {
|
|
1769
|
+
/** @type {?} */
|
|
1770
|
+
var selectedValues = [];
|
|
1771
|
+
Object.keys(formValues).map(( /**
|
|
1772
|
+
* @param {?} name
|
|
1773
|
+
* @return {?}
|
|
1774
|
+
*/function (name) {
|
|
1775
|
+
/** @type {?} */
|
|
1776
|
+
var values = formValues[name].value;
|
|
1777
|
+
if (name === field.name) {
|
|
1778
|
+
values.forEach(( /**
|
|
1779
|
+
* @param {?} v
|
|
1780
|
+
* @return {?}
|
|
1781
|
+
*/function (v) {
|
|
1782
|
+
selectedValues.push(v.key);
|
|
1783
|
+
}));
|
|
1784
|
+
}
|
|
1785
|
+
}));
|
|
1786
|
+
return selectedValues;
|
|
1787
|
+
};
|
|
1788
|
+
/**
|
|
1789
|
+
* @private
|
|
1790
|
+
* @param {?} groupOptions
|
|
1791
|
+
* @return {?}
|
|
1792
|
+
*/
|
|
1793
|
+
GenericFilterComponent.prototype.sortGroupOptions = /**
|
|
1794
|
+
* @private
|
|
1795
|
+
* @param {?} groupOptions
|
|
1796
|
+
* @return {?}
|
|
1797
|
+
*/
|
|
1798
|
+
function (groupOptions) {
|
|
1799
|
+
/** @type {?} */
|
|
1800
|
+
var sortedResults = [];
|
|
1801
|
+
/** @type {?} */
|
|
1802
|
+
var groups = groupOptions.map(( /**
|
|
1803
|
+
* @param {?} go
|
|
1804
|
+
* @return {?}
|
|
1805
|
+
*/function (go) { return go.group; }));
|
|
1806
|
+
groups.sort().forEach(( /**
|
|
1807
|
+
* @param {?} g
|
|
1808
|
+
* @return {?}
|
|
1809
|
+
*/function (g) {
|
|
1810
|
+
/** @type {?} */
|
|
1811
|
+
var options = groupOptions.find(( /**
|
|
1812
|
+
* @param {?} go
|
|
1813
|
+
* @return {?}
|
|
1814
|
+
*/function (go) { return go.group === g; })).options;
|
|
1815
|
+
/** @type {?} */
|
|
1816
|
+
var sortedOptions = options.sort(( /**
|
|
1817
|
+
* @param {?} a
|
|
1818
|
+
* @param {?} b
|
|
1819
|
+
* @return {?}
|
|
1820
|
+
*/function (a, b) {
|
|
1821
|
+
return a.label.toLowerCase() > b.label.toLowerCase() ? 1 : (b.label.toLowerCase() > a.label.toLowerCase() ? -1 : 0);
|
|
1822
|
+
}));
|
|
1823
|
+
/** @type {?} */
|
|
1824
|
+
var result = {
|
|
1825
|
+
group: g,
|
|
1826
|
+
options: sortedOptions
|
|
1827
|
+
};
|
|
1828
|
+
sortedResults.push(result);
|
|
1829
|
+
}));
|
|
1830
|
+
return sortedResults;
|
|
1831
|
+
};
|
|
1671
1832
|
GenericFilterComponent.decorators = [
|
|
1672
1833
|
{ type: i0.Component, args: [{
|
|
1673
1834
|
selector: 'xuilib-generic-filter',
|
|
1674
|
-
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 || form.get(field.name).errors?.required)\">\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 (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 ></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 [services]=\"form.get(field.findLocationField)?.value\"\n [field]=\"field\"\n ></xuilib-find-location>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-service'\">\n <xuilib-find-service (serviceFieldChanged)=\"inputChanged(field)\"\n [form]=\"form\"\n [fields]=\"config.fields\"\n [title]=\"field.title\"\n [enableAddServiceButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [disableInputField]=\"field.disable\"\n [selectedServices]=\"form.get(field.name)?.value\"\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 />\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",
|
|
1835
|
+
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 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\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?.required) || form.get(field.name).errors?.maxlength || form.get(field.name).errors?.email)}\">\n\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\n <div *ngIf=\"field?.titleHint\" class=\"govuk-!-margin-left-2\">\n {{ field.titleHint }}\n </div>\n </div>\n\n <p class=\"govuk-body\" *ngIf=\"field.subTitle\">{{field.subTitle}}</p>\n\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\"\n *ngIf=\"field.displayMinSelectedError && submitted && (form.get(field.name).errors?.minlength || form.get(field.name).errors?.required)\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.minSelectedError}}\n </span>\n\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\"\n *ngIf=\"field.displayMaxSelectedError && submitted && form.get(field.name).errors?.maxlength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.maxSelectedError}}\n </span>\n\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\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_' + 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 (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 ></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 [services]=\"form.get(field.findLocationField)?.value\"\n [field]=\"field\"\n ></xuilib-find-location>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-service'\">\n <xuilib-find-service (serviceFieldChanged)=\"inputChanged(field)\"\n [form]=\"form\"\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 />\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 />\n </ng-container>\n </div>\n </div>\n </ng-container>\n </ng-container>\n\n </div>\n <hr class=\"govuk-section-break govuk-section-break--m\"/>\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",
|
|
1675
1836
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1676
1837
|
encapsulation: i0.ViewEncapsulation.None,
|
|
1677
|
-
styles: [".contain-classes .elevated-break{margin-bottom:20px}@media (min-width:40.0625em){.contain-classes .elevated-break{margin-bottom:30px}}.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 .govuk-select{width:100%}"]
|
|
1838
|
+
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%}"]
|
|
1678
1839
|
}] }
|
|
1679
1840
|
];
|
|
1680
1841
|
/** @nocollapse */
|
|
@@ -3940,7 +4101,7 @@
|
|
|
3940
4101
|
|
|
3941
4102
|
/**
|
|
3942
4103
|
* @fileoverview added by tsickle
|
|
3943
|
-
* Generated from: lib/services/session-storage/session-storage.service.ts
|
|
4104
|
+
* Generated from: lib/services/storage/session-storage/session-storage.service.ts
|
|
3944
4105
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3945
4106
|
*/
|
|
3946
4107
|
var SessionStorageService = /** @class */ (function () {
|
|
@@ -4506,7 +4667,7 @@
|
|
|
4506
4667
|
FindLocationComponent.decorators = [
|
|
4507
4668
|
{ type: i0.Component, args: [{
|
|
4508
4669
|
selector: 'xuilib-find-location',
|
|
4509
|
-
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\n <div class=\"search-location__input-container\">\n <exui-search-location class=\"search-location__input\"\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()\"
|
|
4670
|
+
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\n <div class=\"search-location__input-container\">\n <exui-search-location class=\"search-location__input\"\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()\"\n class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\" data-module=\"govuk-button\"\n *ngIf=\"enableAddLocationButton\">\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 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",
|
|
4510
4671
|
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}"]
|
|
4511
4672
|
}] }
|
|
4512
4673
|
];
|
|
@@ -5216,15 +5377,27 @@
|
|
|
5216
5377
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5217
5378
|
*/
|
|
5218
5379
|
var FindServiceComponent = /** @class */ (function () {
|
|
5219
|
-
function FindServiceComponent(
|
|
5220
|
-
this.
|
|
5221
|
-
this.
|
|
5380
|
+
function FindServiceComponent() {
|
|
5381
|
+
this.services = [];
|
|
5382
|
+
this.selectedServices = [];
|
|
5222
5383
|
this.enableAddServiceButton = true;
|
|
5223
|
-
this.
|
|
5224
|
-
this.
|
|
5225
|
-
|
|
5226
|
-
});
|
|
5384
|
+
this.disabled = false;
|
|
5385
|
+
this.serviceFieldChanged = new i0.EventEmitter();
|
|
5386
|
+
this.tempSelectedService = null;
|
|
5227
5387
|
}
|
|
5388
|
+
/**
|
|
5389
|
+
* @return {?}
|
|
5390
|
+
*/
|
|
5391
|
+
FindServiceComponent.prototype.ngOnInit = /**
|
|
5392
|
+
* @return {?}
|
|
5393
|
+
*/
|
|
5394
|
+
function () {
|
|
5395
|
+
this.selectedServices = this.selectedServices !== null ? this.selectedServices.filter(( /**
|
|
5396
|
+
* @param {?} service
|
|
5397
|
+
* @return {?}
|
|
5398
|
+
*/function (service) { return service.key; })) : [];
|
|
5399
|
+
this.SortAnOptions();
|
|
5400
|
+
};
|
|
5228
5401
|
/**
|
|
5229
5402
|
* @return {?}
|
|
5230
5403
|
*/
|
|
@@ -5232,21 +5405,150 @@
|
|
|
5232
5405
|
* @return {?}
|
|
5233
5406
|
*/
|
|
5234
5407
|
function () {
|
|
5235
|
-
|
|
5408
|
+
var _this = this;
|
|
5409
|
+
if (this.tempSelectedService === null) {
|
|
5410
|
+
return;
|
|
5411
|
+
}
|
|
5412
|
+
this.selectedServices = __spread(this.selectedServices, [this.tempSelectedService]);
|
|
5413
|
+
this.addSelectedServicesToForm([this.tempSelectedService]);
|
|
5414
|
+
this.services = this.services.filter(( /**
|
|
5415
|
+
* @param {?} s
|
|
5416
|
+
* @return {?}
|
|
5417
|
+
*/function (s) { return s.key !== _this.tempSelectedService.key; }));
|
|
5418
|
+
this.tempSelectedService = null;
|
|
5419
|
+
this.serviceFieldChanged.emit();
|
|
5420
|
+
};
|
|
5421
|
+
/**
|
|
5422
|
+
* @param {?} service
|
|
5423
|
+
* @return {?}
|
|
5424
|
+
*/
|
|
5425
|
+
FindServiceComponent.prototype.removeService = /**
|
|
5426
|
+
* @param {?} service
|
|
5427
|
+
* @return {?}
|
|
5428
|
+
*/
|
|
5429
|
+
function (service) {
|
|
5430
|
+
if (service.key) {
|
|
5431
|
+
this.selectedServices = this.selectedServices !== null ? this.selectedServices.filter(( /**
|
|
5432
|
+
* @param {?} selectedService
|
|
5433
|
+
* @return {?}
|
|
5434
|
+
*/function (selectedService) { return selectedService.key !== service.key; })) : [];
|
|
5435
|
+
/** @type {?} */
|
|
5436
|
+
var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
|
|
5437
|
+
/** @type {?} */
|
|
5438
|
+
var index = (formArray.value).findIndex(( /**
|
|
5439
|
+
* @param {?} selectedService
|
|
5440
|
+
* @return {?}
|
|
5441
|
+
*/function (selectedService) { return selectedService.key === service.key; }));
|
|
5442
|
+
if (index > -1) {
|
|
5443
|
+
formArray.removeAt(index);
|
|
5444
|
+
this.services.splice(index, 0, service);
|
|
5445
|
+
this.SortAnOptions();
|
|
5446
|
+
}
|
|
5447
|
+
this.serviceFieldChanged.emit();
|
|
5448
|
+
}
|
|
5449
|
+
};
|
|
5450
|
+
/**
|
|
5451
|
+
* @param {?} service
|
|
5452
|
+
* @return {?}
|
|
5453
|
+
*/
|
|
5454
|
+
FindServiceComponent.prototype.onServiceSelected = /**
|
|
5455
|
+
* @param {?} service
|
|
5456
|
+
* @return {?}
|
|
5457
|
+
*/
|
|
5458
|
+
function (service) {
|
|
5459
|
+
if (!service) {
|
|
5460
|
+
this.tempSelectedService = null;
|
|
5461
|
+
return;
|
|
5462
|
+
}
|
|
5463
|
+
if (this.field.maxSelected === 1) {
|
|
5464
|
+
this.removeSelectedValues();
|
|
5465
|
+
this.addSelectedServicesToForm([service]);
|
|
5466
|
+
}
|
|
5467
|
+
else {
|
|
5468
|
+
if (!this.selectedServices.find(( /**
|
|
5469
|
+
* @param {?} s
|
|
5470
|
+
* @return {?}
|
|
5471
|
+
*/function (s) { return s.key === service.key; }))) {
|
|
5472
|
+
if (service.key) {
|
|
5473
|
+
this.tempSelectedService = service;
|
|
5474
|
+
}
|
|
5475
|
+
}
|
|
5476
|
+
}
|
|
5477
|
+
};
|
|
5478
|
+
/**
|
|
5479
|
+
* @private
|
|
5480
|
+
* @return {?}
|
|
5481
|
+
*/
|
|
5482
|
+
FindServiceComponent.prototype.removeSelectedValues = /**
|
|
5483
|
+
* @private
|
|
5484
|
+
* @return {?}
|
|
5485
|
+
*/
|
|
5486
|
+
function () {
|
|
5487
|
+
/** @type {?} */
|
|
5488
|
+
var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
|
|
5489
|
+
for (var i = 0; i < formArray.length; i++) {
|
|
5490
|
+
formArray.removeAt(i);
|
|
5491
|
+
}
|
|
5492
|
+
this.selectedServices = [];
|
|
5493
|
+
};
|
|
5494
|
+
/**
|
|
5495
|
+
* @private
|
|
5496
|
+
* @param {?} services
|
|
5497
|
+
* @return {?}
|
|
5498
|
+
*/
|
|
5499
|
+
FindServiceComponent.prototype.addSelectedServicesToForm = /**
|
|
5500
|
+
* @private
|
|
5501
|
+
* @param {?} services
|
|
5502
|
+
* @return {?}
|
|
5503
|
+
*/
|
|
5504
|
+
function (services) {
|
|
5505
|
+
var e_1, _a;
|
|
5506
|
+
/** @type {?} */
|
|
5507
|
+
var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
|
|
5508
|
+
try {
|
|
5509
|
+
for (var services_1 = __values(services), services_1_1 = services_1.next(); !services_1_1.done; services_1_1 = services_1.next()) {
|
|
5510
|
+
var service = services_1_1.value;
|
|
5511
|
+
formArray.push(new forms.FormControl(service));
|
|
5512
|
+
}
|
|
5513
|
+
}
|
|
5514
|
+
catch (e_1_1) {
|
|
5515
|
+
e_1 = { error: e_1_1 };
|
|
5516
|
+
}
|
|
5517
|
+
finally {
|
|
5518
|
+
try {
|
|
5519
|
+
if (services_1_1 && !services_1_1.done && (_a = services_1.return))
|
|
5520
|
+
_a.call(services_1);
|
|
5521
|
+
}
|
|
5522
|
+
finally {
|
|
5523
|
+
if (e_1)
|
|
5524
|
+
throw e_1.error;
|
|
5525
|
+
}
|
|
5526
|
+
}
|
|
5527
|
+
};
|
|
5528
|
+
/**
|
|
5529
|
+
* @private
|
|
5530
|
+
* @return {?}
|
|
5531
|
+
*/
|
|
5532
|
+
FindServiceComponent.prototype.SortAnOptions = /**
|
|
5533
|
+
* @private
|
|
5534
|
+
* @return {?}
|
|
5535
|
+
*/
|
|
5536
|
+
function () {
|
|
5537
|
+
return this.services.sort(( /**
|
|
5538
|
+
* @param {?} a
|
|
5539
|
+
* @param {?} b
|
|
5540
|
+
* @return {?}
|
|
5541
|
+
*/function (a, b) {
|
|
5542
|
+
return a.label.toLowerCase() > b.label.toLowerCase() ? 1 : (b.label.toLowerCase() > a.label.toLowerCase() ? -1 : 0);
|
|
5543
|
+
}));
|
|
5236
5544
|
};
|
|
5237
5545
|
FindServiceComponent.decorators = [
|
|
5238
5546
|
{ type: i0.Component, args: [{
|
|
5239
5547
|
selector: 'xuilib-find-service',
|
|
5240
|
-
template: "<div class=\"service-picker-custom\">\n <div class=\"search-service\">\n
|
|
5548
|
+
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\" [services]=\"services\"\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 class=\"hmcts-filter__tag\" (click)=\"removeService(selection)\" href=\"javascript:void(0)\">\n {{ selection.label }}\n </a>\n </li>\n </ul>\n</div>",
|
|
5241
5549
|
styles: ["#add-service{background-color:#ddd}.search-service__input-container{display:flex}.search-service__input{flex:1 0 auto}"]
|
|
5242
5550
|
}] }
|
|
5243
5551
|
];
|
|
5244
|
-
/** @nocollapse */
|
|
5245
|
-
FindServiceComponent.ctorParameters = function () {
|
|
5246
|
-
return [
|
|
5247
|
-
{ type: forms.FormBuilder }
|
|
5248
|
-
];
|
|
5249
|
-
};
|
|
5250
5552
|
FindServiceComponent.propDecorators = {
|
|
5251
5553
|
field: [{ type: i0.Input }],
|
|
5252
5554
|
fields: [{ type: i0.Input }],
|
|
@@ -5254,9 +5556,9 @@
|
|
|
5254
5556
|
form: [{ type: i0.Input }],
|
|
5255
5557
|
services: [{ type: i0.Input }],
|
|
5256
5558
|
selectedServices: [{ type: i0.Input }],
|
|
5257
|
-
disabled: [{ type: i0.Input }],
|
|
5258
5559
|
enableAddServiceButton: [{ type: i0.Input }],
|
|
5259
|
-
|
|
5560
|
+
disabled: [{ type: i0.Input }],
|
|
5561
|
+
serviceFieldChanged: [{ type: i0.Output }]
|
|
5260
5562
|
};
|
|
5261
5563
|
return FindServiceComponent;
|
|
5262
5564
|
}());
|
|
@@ -5507,42 +5809,35 @@
|
|
|
5507
5809
|
*/
|
|
5508
5810
|
var SearchServiceComponent = /** @class */ (function () {
|
|
5509
5811
|
function SearchServiceComponent() {
|
|
5510
|
-
this.
|
|
5511
|
-
this.
|
|
5512
|
-
this.term = '';
|
|
5812
|
+
this.services = [];
|
|
5813
|
+
this.serviceChanged = new i0.EventEmitter();
|
|
5513
5814
|
}
|
|
5514
5815
|
/**
|
|
5816
|
+
* @param {?} key
|
|
5515
5817
|
* @return {?}
|
|
5516
5818
|
*/
|
|
5517
|
-
SearchServiceComponent.prototype.
|
|
5518
|
-
* @
|
|
5519
|
-
*/
|
|
5520
|
-
function () {
|
|
5521
|
-
// Todo
|
|
5522
|
-
};
|
|
5523
|
-
/**
|
|
5524
|
-
* @return {?}
|
|
5525
|
-
*/
|
|
5526
|
-
SearchServiceComponent.prototype.onSelectionChange = /**
|
|
5819
|
+
SearchServiceComponent.prototype.onSelectionChanged = /**
|
|
5820
|
+
* @param {?} key
|
|
5527
5821
|
* @return {?}
|
|
5528
5822
|
*/
|
|
5529
|
-
function () {
|
|
5530
|
-
|
|
5823
|
+
function (key) {
|
|
5824
|
+
/** @type {?} */
|
|
5825
|
+
var selectedService = this.services.find(( /**
|
|
5826
|
+
* @param {?} s
|
|
5827
|
+
* @return {?}
|
|
5828
|
+
*/function (s) { return s.key === key; }));
|
|
5829
|
+
this.serviceChanged.emit(selectedService);
|
|
5531
5830
|
};
|
|
5532
5831
|
SearchServiceComponent.decorators = [
|
|
5533
5832
|
{ type: i0.Component, args: [{
|
|
5534
5833
|
selector: 'exui-search-service',
|
|
5535
|
-
template: "<div class=\"
|
|
5834
|
+
template: "<div class=\"govuk-form-group\">\n <select id=\"serviceSearch__select\" class=\"govuk-select\" name=\"serviceSearch__select\"\n (change)=\"onSelectionChanged($event.target.value)\">\n <option [value]=\"null\">All</option>\n <option *ngFor=\"let service of services\" [value]=\"service.key\">\n {{ service.label }}\n </option>\n </select>\n</div>",
|
|
5536
5835
|
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: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{width:calc(100% - 4px);display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}"]
|
|
5537
5836
|
}] }
|
|
5538
5837
|
];
|
|
5539
5838
|
SearchServiceComponent.propDecorators = {
|
|
5540
5839
|
services: [{ type: i0.Input }],
|
|
5541
|
-
|
|
5542
|
-
disabled: [{ type: i0.Input }],
|
|
5543
|
-
delay: [{ type: i0.Input }],
|
|
5544
|
-
form: [{ type: i0.Input }],
|
|
5545
|
-
showAutocomplete: [{ type: i0.Input }]
|
|
5840
|
+
serviceChanged: [{ type: i0.Output }]
|
|
5546
5841
|
};
|
|
5547
5842
|
return SearchServiceComponent;
|
|
5548
5843
|
}());
|
|
@@ -6905,6 +7200,33 @@
|
|
|
6905
7200
|
return RemoveHostDirective;
|
|
6906
7201
|
}());
|
|
6907
7202
|
|
|
7203
|
+
/**
|
|
7204
|
+
* @fileoverview added by tsickle
|
|
7205
|
+
* Generated from: lib/pipes/capitalize.pipe.ts
|
|
7206
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
7207
|
+
*/
|
|
7208
|
+
var CapitalizePipe = /** @class */ (function () {
|
|
7209
|
+
function CapitalizePipe() {
|
|
7210
|
+
}
|
|
7211
|
+
/**
|
|
7212
|
+
* @param {?} value
|
|
7213
|
+
* @return {?}
|
|
7214
|
+
*/
|
|
7215
|
+
CapitalizePipe.prototype.transform = /**
|
|
7216
|
+
* @param {?} value
|
|
7217
|
+
* @return {?}
|
|
7218
|
+
*/
|
|
7219
|
+
function (value) {
|
|
7220
|
+
/** @type {?} */
|
|
7221
|
+
var lowerCaseString = value.toLowerCase();
|
|
7222
|
+
return lowerCaseString.charAt(0).toUpperCase() + lowerCaseString.slice(1);
|
|
7223
|
+
};
|
|
7224
|
+
CapitalizePipe.decorators = [
|
|
7225
|
+
{ type: i0.Pipe, args: [{ name: 'capitalize' },] }
|
|
7226
|
+
];
|
|
7227
|
+
return CapitalizePipe;
|
|
7228
|
+
}());
|
|
7229
|
+
|
|
6908
7230
|
/**
|
|
6909
7231
|
* @fileoverview added by tsickle
|
|
6910
7232
|
* Generated from: lib/exui-common-lib.module.ts
|
|
@@ -6974,13 +7296,17 @@
|
|
|
6974
7296
|
GovUkFileUploadComponent,
|
|
6975
7297
|
RemoveHostDirective
|
|
6976
7298
|
];
|
|
7299
|
+
/** @type {?} */
|
|
7300
|
+
var pipes = [
|
|
7301
|
+
CapitalizePipe
|
|
7302
|
+
];
|
|
6977
7303
|
var ɵ0 = windowProvider;
|
|
6978
7304
|
var ExuiCommonLibModule = /** @class */ (function () {
|
|
6979
7305
|
function ExuiCommonLibModule() {
|
|
6980
7306
|
}
|
|
6981
7307
|
ExuiCommonLibModule.decorators = [
|
|
6982
7308
|
{ type: i0.NgModule, args: [{
|
|
6983
|
-
declarations: __spread(COMMON_COMPONENTS, GOV_UI_COMPONENTS),
|
|
7309
|
+
declarations: __spread(COMMON_COMPONENTS, GOV_UI_COMPONENTS, pipes),
|
|
6984
7310
|
imports: [
|
|
6985
7311
|
i4.CommonModule,
|
|
6986
7312
|
forms.FormsModule,
|
|
@@ -6996,7 +7322,7 @@
|
|
|
6996
7322
|
],
|
|
6997
7323
|
exports: __spread(COMMON_COMPONENTS, GOV_UI_COMPONENTS, [
|
|
6998
7324
|
ngxPagination.PaginatePipe
|
|
6999
|
-
])
|
|
7325
|
+
], pipes)
|
|
7000
7326
|
},] }
|
|
7001
7327
|
];
|
|
7002
7328
|
return ExuiCommonLibModule;
|
|
@@ -8126,6 +8452,7 @@
|
|
|
8126
8452
|
exports.ɵbv = HmctsPrimaryNavigationComponent;
|
|
8127
8453
|
exports.ɵbu = HmctsSubNavigationComponent;
|
|
8128
8454
|
exports.ɵcn = RemoveHostDirective;
|
|
8455
|
+
exports.ɵco = CapitalizePipe;
|
|
8129
8456
|
exports.ɵr = CaseSharingStateService;
|
|
8130
8457
|
exports.ɵbg = CookieService;
|
|
8131
8458
|
exports.ɵh = FeatureToggleService;
|