@hmcts/rpx-xui-common-lib 1.4.7-select-all-v1 → 1.4.8-paging

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.
Files changed (45) hide show
  1. package/bundles/hmcts-rpx-xui-common-lib.umd.js +288 -122
  2. package/bundles/hmcts-rpx-xui-common-lib.umd.js.map +1 -1
  3. package/bundles/hmcts-rpx-xui-common-lib.umd.min.js +1 -1
  4. package/bundles/hmcts-rpx-xui-common-lib.umd.min.js.map +1 -1
  5. package/esm2015/hmcts-rpx-xui-common-lib.js +25 -23
  6. package/esm2015/lib/components/generic-filter/generic-filter.component.js +29 -91
  7. package/esm2015/lib/components/index.js +2 -2
  8. package/esm2015/lib/components/loading-spinner/loading-spinner.component.js +3 -3
  9. package/esm2015/lib/components/pagination/pagination.component.js +50 -0
  10. package/esm2015/lib/components/pagination-v1/pagination.component.js +130 -0
  11. package/esm2015/lib/components/public_api.js +3 -1
  12. package/esm2015/lib/components/user-list/user-list.component.js +57 -2
  13. package/esm2015/lib/exui-common-lib.module.js +11 -4
  14. package/esm2015/lib/models/filter.model.js +1 -1
  15. package/esm2015/lib/models/index.js +2 -1
  16. package/esm2015/lib/models/pagination.model.js +16 -0
  17. package/esm2015/public-api.js +2 -2
  18. package/esm5/hmcts-rpx-xui-common-lib.js +25 -23
  19. package/esm5/lib/components/generic-filter/generic-filter.component.js +37 -98
  20. package/esm5/lib/components/index.js +2 -2
  21. package/esm5/lib/components/loading-spinner/loading-spinner.component.js +3 -3
  22. package/esm5/lib/components/pagination/pagination.component.js +58 -0
  23. package/esm5/lib/components/pagination-v1/pagination.component.js +144 -0
  24. package/esm5/lib/components/public_api.js +3 -1
  25. package/esm5/lib/components/user-list/user-list.component.js +73 -2
  26. package/esm5/lib/exui-common-lib.module.js +12 -4
  27. package/esm5/lib/models/filter.model.js +1 -1
  28. package/esm5/lib/models/index.js +2 -1
  29. package/esm5/lib/models/pagination.model.js +16 -0
  30. package/esm5/public-api.js +2 -2
  31. package/fesm2015/hmcts-rpx-xui-common-lib.js +228 -97
  32. package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
  33. package/fesm5/hmcts-rpx-xui-common-lib.js +273 -104
  34. package/fesm5/hmcts-rpx-xui-common-lib.js.map +1 -1
  35. package/hmcts-rpx-xui-common-lib.d.ts +23 -21
  36. package/hmcts-rpx-xui-common-lib.metadata.json +1 -1
  37. package/lib/components/generic-filter/generic-filter.component.d.ts +3 -6
  38. package/lib/components/pagination/pagination.component.d.ts +10 -0
  39. package/lib/components/pagination-v1/pagination.component.d.ts +19 -0
  40. package/lib/components/public_api.d.ts +2 -0
  41. package/lib/components/user-list/user-list.component.d.ts +8 -0
  42. package/lib/models/filter.model.d.ts +0 -1
  43. package/lib/models/index.d.ts +1 -0
  44. package/lib/models/pagination.model.d.ts +4 -0
  45. package/package.json +3 -2
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/material'), require('@angular/material/autocomplete'), require('@angular/forms'), require('@angular/common/http'), require('launchdarkly-js-client-sdk'), require('@angular/common'), require('@angular/platform-browser'), require('@ng-idle/core'), require('@ng-idle/keepalive'), require('@angular/router'), require('@angular/core'), require('rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@hmcts/rpx-xui-common-lib', ['exports', '@angular/material', '@angular/material/autocomplete', '@angular/forms', '@angular/common/http', 'launchdarkly-js-client-sdk', '@angular/common', '@angular/platform-browser', '@ng-idle/core', '@ng-idle/keepalive', '@angular/router', '@angular/core', 'rxjs', 'rxjs/operators'], factory) :
4
- (factory((global.hmcts = global.hmcts || {}, global.hmcts['rpx-xui-common-lib'] = {}),global.ng.material,global.ng.material.autocomplete,global.ng.forms,global.ng.common.http,global.LDClient,global.ng.common,global.ng.platformBrowser,global.i1$1,global.i2$1,global.ng.router,global.ng.core,global.rxjs,global.rxjs.operators));
5
- }(this, (function (exports,material,autocomplete,forms,i1,LDClient,i4,i2,i1$1,i2$1,i2$2,i0,rxjs,operators) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/material'), require('@angular/material/autocomplete'), require('ngx-pagination'), require('@angular/forms'), require('@angular/common/http'), require('launchdarkly-js-client-sdk'), require('@angular/common'), require('@angular/platform-browser'), require('@ng-idle/core'), require('@ng-idle/keepalive'), require('@angular/router'), require('@angular/core'), require('rxjs'), require('rxjs/operators')) :
3
+ typeof define === 'function' && define.amd ? define('@hmcts/rpx-xui-common-lib', ['exports', '@angular/material', '@angular/material/autocomplete', 'ngx-pagination', '@angular/forms', '@angular/common/http', 'launchdarkly-js-client-sdk', '@angular/common', '@angular/platform-browser', '@ng-idle/core', '@ng-idle/keepalive', '@angular/router', '@angular/core', 'rxjs', 'rxjs/operators'], factory) :
4
+ (factory((global.hmcts = global.hmcts || {}, global.hmcts['rpx-xui-common-lib'] = {}),global.ng.material,global.ng.material.autocomplete,global.ngxPagination,global.ng.forms,global.ng.common.http,global.LDClient,global.ng.common,global.ng.platformBrowser,global.i1$1,global.i2$1,global.ng.router,global.ng.core,global.rxjs,global.rxjs.operators));
5
+ }(this, (function (exports,material,autocomplete,ngxPagination,forms,i1,LDClient,i4,i2,i1$1,i2$1,i2$2,i0,rxjs,operators) { 'use strict';
6
6
 
7
7
  /**
8
8
  * @fileoverview added by tsickle
@@ -1030,7 +1030,7 @@
1030
1030
  * @param {?} form
1031
1031
  * @return {?}
1032
1032
  */
1033
- GenericFilterComponent.prototype.updateSpecificPerson =
1033
+ GenericFilterComponent.prototype.selectChanged =
1034
1034
  // when domain changes ensure that person field is reset
1035
1035
  /**
1036
1036
  * @param {?} field
@@ -1047,13 +1047,38 @@
1047
1047
  if (currentField) {
1048
1048
  currentField.domain = form.get(field.name).value;
1049
1049
  }
1050
- if (this.form.get(field.findPersonField)) {
1051
- this.form.get(field.findPersonField).get('domain').setValue(null);
1052
- this.form.get(field.findPersonField).get('email').setValue(null);
1053
- this.form.get(field.findPersonField).get('id').setValue(null);
1054
- this.form.get(field.findPersonField).get('name').setValue(null);
1055
- this.form.get(field.findPersonField).get('knownAs').setValue(null);
1056
- }
1050
+ this.removePersonField(field);
1051
+ }
1052
+ };
1053
+ /**
1054
+ * @param {?} field
1055
+ * @return {?}
1056
+ */
1057
+ GenericFilterComponent.prototype.radiosChanged = /**
1058
+ * @param {?} field
1059
+ * @return {?}
1060
+ */
1061
+ function (field) {
1062
+ if (field.findPersonField) {
1063
+ this.form.get('findPersonControl').setValue(null);
1064
+ this.removePersonField(field);
1065
+ }
1066
+ };
1067
+ /**
1068
+ * @param {?} field
1069
+ * @return {?}
1070
+ */
1071
+ GenericFilterComponent.prototype.removePersonField = /**
1072
+ * @param {?} field
1073
+ * @return {?}
1074
+ */
1075
+ function (field) {
1076
+ if (this.form.get(field.findPersonField)) {
1077
+ this.form.get(field.findPersonField).get('domain').setValue(null);
1078
+ this.form.get(field.findPersonField).get('email').setValue(null);
1079
+ this.form.get(field.findPersonField).get('id').setValue(null);
1080
+ this.form.get(field.findPersonField).get('name').setValue(null);
1081
+ this.form.get(field.findPersonField).get('knownAs').setValue(null);
1057
1082
  }
1058
1083
  };
1059
1084
  /**
@@ -1068,7 +1093,6 @@
1068
1093
  this._settings.fields = JSON.parse(JSON.stringify(this.config.cancelSetting.fields));
1069
1094
  }
1070
1095
  this.filterService.persist(this.settings, this.config.persistence);
1071
- this.filterService.givenErrors.next(null);
1072
1096
  };
1073
1097
  /**
1074
1098
  * @param {?} values
@@ -1106,85 +1130,6 @@
1106
1130
  }
1107
1131
  }
1108
1132
  };
1109
- /**
1110
- * @param {?} event
1111
- * @param {?} form
1112
- * @param {?} item
1113
- * @param {?} field
1114
- * @return {?}
1115
- */
1116
- GenericFilterComponent.prototype.toggleSelectAll = /**
1117
- * @param {?} event
1118
- * @param {?} form
1119
- * @param {?} item
1120
- * @param {?} field
1121
- * @return {?}
1122
- */
1123
- function (event, form, item, field) {
1124
- /** @type {?} */
1125
- var isChecked = event.target.checked;
1126
- /** @type {?} */
1127
- var formArray = ( /** @type {?} */(form.get(field.name)));
1128
- if (!item.selectAll) {
1129
- /** @type {?} */
1130
- var allChecked = formArray.controls.every(( /**
1131
- * @param {?} control
1132
- * @return {?}
1133
- */function (control) { return control.value; }));
1134
- /** @type {?} */
1135
- var index_1 = null;
1136
- /** @type {?} */
1137
- var hasSelectAllOption = field.options.find(( /**
1138
- * @param {?} option
1139
- * @param {?} i
1140
- * @return {?}
1141
- */function (option, i) {
1142
- if (option.hasOwnProperty('selectAll')) {
1143
- index_1 = i;
1144
- return true;
1145
- }
1146
- return false;
1147
- }));
1148
- // tslint:disable-next-line:variable-name
1149
- /** @type {?} */
1150
- var isAllCheckedExcludingTheSelectAllOption = formArray.controls.filter(( /**
1151
- * @param {?} _control
1152
- * @param {?} i
1153
- * @return {?}
1154
- */function (_control, i) { return i !== index_1; }))
1155
- .every(( /**
1156
- * @param {?} control
1157
- * @return {?}
1158
- */function (control) { return control.value; }));
1159
- if (!allChecked && hasSelectAllOption && !isChecked) {
1160
- formArray.controls.forEach(( /**
1161
- * @param {?} control
1162
- * @param {?} i
1163
- * @return {?}
1164
- */function (control, i) {
1165
- if (index_1 === i) {
1166
- control.patchValue(false);
1167
- return;
1168
- }
1169
- }));
1170
- }
1171
- else if (hasSelectAllOption && !allChecked && isChecked && isAllCheckedExcludingTheSelectAllOption) {
1172
- formArray.controls[index_1].patchValue(true);
1173
- }
1174
- return;
1175
- }
1176
- formArray.controls.forEach(( /**
1177
- * @param {?} control
1178
- * @return {?}
1179
- */function (control) {
1180
- if (isChecked) {
1181
- control.patchValue(true);
1182
- }
1183
- else {
1184
- control.patchValue(false);
1185
- }
1186
- }));
1187
- };
1188
1133
  /**
1189
1134
  * @private
1190
1135
  * @param {?} filter
@@ -1289,7 +1234,7 @@
1289
1234
  }
1290
1235
  // if field updates find person component set the initial domain
1291
1236
  if (field.findPersonField) {
1292
- this_1.updateSpecificPerson(field, this_1.form);
1237
+ this_1.selectChanged(field, this_1.form);
1293
1238
  }
1294
1239
  }
1295
1240
  };
@@ -1464,10 +1409,10 @@
1464
1409
  GenericFilterComponent.decorators = [
1465
1410
  { type: i0.Component, args: [{
1466
1411
  selector: 'xuilib-generic-filter',
1467
- 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 [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)=\"updateSpecificPerson(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=\"'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 />\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 [disabled]=\"disabled(field, form)\"\n [domain]=\"field.domain\"\n [findPersonGroup]=\"form\"\n [selectedPerson]=\"form.get(field.name)?.value?.email\"\n ></xuilib-find-person>\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\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",
1412
+ 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 [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 <div class=\"govuk-body\" [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <select class=\"govuk-select\" (change)=\"selectChanged(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\">\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 [value]=\"item.key\" [id]=\"'checkbox_' + item.key\"\n [name]=\"'checkbox_' + item.key\"\n />\n <label [for]=\"'checkbox_' + item.key\" class=\"govuk-label govuk-checkboxes__label\">{{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)=\"radiosChanged(field)\"\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 [disabled]=\"disabled(field, form)\"\n [domain]=\"field.domain\"\n [findPersonGroup]=\"form\"\n [selectedPerson]=\"form.get(field.name)?.value?.email\"\n ></xuilib-find-person>\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\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",
1468
1413
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1469
1414
  encapsulation: i0.ViewEncapsulation.None,
1470
- 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}"]
1415
+ 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;flex-basis:calc(50% - 34px);width:29%}"]
1471
1416
  }] }
1472
1417
  ];
1473
1418
  /** @nocollapse */
@@ -1601,14 +1546,14 @@
1601
1546
  */
1602
1547
  var LoadingSpinnerComponent = /** @class */ (function () {
1603
1548
  function LoadingSpinnerComponent() {
1604
- this.loadingText = 'Searching';
1549
+ this.loadingText = 'Loading';
1605
1550
  }
1606
1551
  LoadingSpinnerComponent.decorators = [
1607
1552
  { type: i0.Component, args: [{
1608
1553
  selector: 'xuilib-loading-spinner',
1609
1554
  template: "<div class=\"spinner-container\">\n <div class=\"spinner-inner-container\">\n <p>{{loadingText}}</p>\n <div class=\"spinner\" style=\"margin: auto;\"></div>\n </div>\n</div>\n",
1610
1555
  encapsulation: i0.ViewEncapsulation.None,
1611
- styles: [".spinner-container{position:fixed;top:32%;left:50%;transform:translate(-50%,-50%);z-index:99}.spinner-container .spinner-inner-container{padding:72px;width:560px;background-color:#fff}.spinner-container .spinner-inner-container p{text-align:center}.spinner-container .spinner-inner-container .spinner{border:10px solid #ddd;border-top:10px solid #000;border-radius:50%;width:40px;height:40px;-webkit-animation:1s linear infinite spin;animation:1s linear infinite spin}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}"]
1556
+ styles: [".spinner-container{position:fixed;top:0;left:0;height:100%;width:100%;display:flex;justify-content:center;align-items:center;background:rgba(255,255,255,.5);z-index:99}.spinner-container .spinner-inner-container p{text-align:center}.spinner-container .spinner-inner-container .spinner{border:10px solid #ddd;border-top:10px solid #000;border-radius:50%;width:40px;height:40px;-webkit-animation:1s linear infinite spin;animation:1s linear infinite spin}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}"]
1612
1557
  }] }
1613
1558
  ];
1614
1559
  LoadingSpinnerComponent.propDecorators = {
@@ -3262,6 +3207,11 @@
3262
3207
  function UserListComponent() {
3263
3208
  this.users = [];
3264
3209
  this.userClick = new i0.EventEmitter();
3210
+ this.moreResultsToGo = false;
3211
+ this.pagination = {
3212
+ page_number: 1,
3213
+ page_size: 25
3214
+ };
3265
3215
  }
3266
3216
  /**
3267
3217
  * @param {?} user
@@ -3274,13 +3224,75 @@
3274
3224
  function (user) {
3275
3225
  this.userClick.emit(user);
3276
3226
  };
3227
+ /**
3228
+ * @param {?} pageNumber
3229
+ * @return {?}
3230
+ */
3231
+ UserListComponent.prototype.onPaginationHandler = /**
3232
+ * @param {?} pageNumber
3233
+ * @return {?}
3234
+ */
3235
+ function (pageNumber) {
3236
+ this.pagination.page_number = pageNumber;
3237
+ };
3238
+ /**
3239
+ * @param {?} rows
3240
+ * @return {?}
3241
+ */
3242
+ UserListComponent.prototype.getFirstResult = /**
3243
+ * @param {?} rows
3244
+ * @return {?}
3245
+ */
3246
+ function (rows) {
3247
+ if (rows && rows.length > 0) {
3248
+ /** @type {?} */
3249
+ var currentPage = (this.pagination.page_number ? this.pagination.page_number : 1);
3250
+ if (currentPage === 1) {
3251
+ return currentPage;
3252
+ }
3253
+ return (currentPage - 1) * this.pagination.page_size + 1;
3254
+ }
3255
+ return 0;
3256
+ };
3257
+ /**
3258
+ * @param {?} rows
3259
+ * @return {?}
3260
+ */
3261
+ UserListComponent.prototype.getLastResult = /**
3262
+ * @param {?} rows
3263
+ * @return {?}
3264
+ */
3265
+ function (rows) {
3266
+ if (rows && rows.length > 0) {
3267
+ /** @type {?} */
3268
+ var currentPage = (this.pagination.page_number ? this.pagination.page_number : 1);
3269
+ return (currentPage) * this.pagination.page_size;
3270
+ }
3271
+ return 0;
3272
+ };
3273
+ /**
3274
+ * @param {?} rows
3275
+ * @return {?}
3276
+ */
3277
+ UserListComponent.prototype.getTotalResults = /**
3278
+ * @param {?} rows
3279
+ * @return {?}
3280
+ */
3281
+ function (rows) {
3282
+ if (rows && rows.length > 0) {
3283
+ return rows.length;
3284
+ }
3285
+ return 0;
3286
+ };
3277
3287
  UserListComponent.decorators = [
3278
3288
  { type: i0.Component, args: [{
3279
3289
  selector: 'xuilib-user-list',
3280
- template: "<table class=\"govuk-table\">\n <thead clas=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header\" scope=\"col\">Name</th>\n <th class=\"govuk-table__header\" scope=\"col\">Email</th>\n <th class=\"govuk-table__header\" scope=\"col\">Status</th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" data-selector=\"table-row\" *ngFor=\"let u of users\">\n <td class=\"govuk-table__cell\" data-selector=\"table-cell\">\n <a class=\"govuk-link\" [attr.title]=\"u.routerLinkTitle\" [routerLink]=\"u.routerLink\" (click)=\"onUserClick(u)\">{{ u.fullName }}</a>\n </td>\n <td class=\"govuk-table__cell\" data-selector=\"table-cell\">{{ u.email }}</td>\n <td class=\"govuk-table__cell\" data-selector=\"table-cell\">{{ u.status }}</td>\n </tr>\n </tbody>\n</table>",
3290
+ template: "<div class=\"pagination-top\" *ngIf=\"getTotalResults(users) > pagination.page_size\" attr.aria-label=\"{{ getTotalResults(users) }} results have been found\" role=\"status\">\n <span class=\"text-16\" id=\"search-result-summary__text\">Showing \n <span class=\"govuk-!-font-weight-bold\">{{ getFirstResult(users) }}</span>\n to\n <span class=\"govuk-!-font-weight-bold\">{{ getLastResult(users) }}</span>\n of\n <span class=\"govuk-!-font-weight-bold\">{{ getTotalResults(users) }}</span> results</span>\n</div>\n<table class=\"govuk-table\">\n <thead clas=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header\" scope=\"col\">Name</th>\n <th class=\"govuk-table__header\" scope=\"col\">Email</th>\n <th class=\"govuk-table__header\" scope=\"col\">Status</th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" data-selector=\"table-row\" *ngFor=\"let u of users | paginate: { itemsPerPage: pagination?.page_size, currentPage: pagination?.page_number, totalItems: users.length }\">\n <td class=\"govuk-table__cell\" data-selector=\"table-cell\">\n <a class=\"govuk-link\" [attr.title]=\"u.routerLinkTitle\" [routerLink]=\"u.routerLink\" (click)=\"onUserClick(u)\">{{ u.fullName }}</a>\n </td>\n <td class=\"govuk-table__cell\" data-selector=\"table-cell\">{{ u.email }}</td>\n <td class=\"govuk-table__cell\" data-selector=\"table-cell\">{{ u.status }}</td>\n </tr>\n </tbody>\n</table>\n<xuilib-pagination-v1 *ngIf=\"getTotalResults(users) > pagination.page_size\" (pageChange)=\"onPaginationHandler($event)\"></xuilib-pagination-v1>",
3281
3291
  styles: [":host{display:block}"]
3282
3292
  }] }
3283
3293
  ];
3294
+ /** @nocollapse */
3295
+ UserListComponent.ctorParameters = function () { return []; };
3284
3296
  UserListComponent.propDecorators = {
3285
3297
  users: [{ type: i0.Input }],
3286
3298
  userClick: [{ type: i0.Output }]
@@ -3554,6 +3566,151 @@
3554
3566
  return CookieBannerComponent;
3555
3567
  }());
3556
3568
 
3569
+ /**
3570
+ * @fileoverview added by tsickle
3571
+ * Generated from: lib/components/pagination/pagination.component.ts
3572
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3573
+ */
3574
+ var PaginationComponent = /** @class */ (function () {
3575
+ function PaginationComponent() {
3576
+ this.previousPage = new i0.EventEmitter();
3577
+ this.nextPage = new i0.EventEmitter();
3578
+ }
3579
+ /**
3580
+ * @return {?}
3581
+ */
3582
+ PaginationComponent.prototype.onPrevious = /**
3583
+ * @return {?}
3584
+ */
3585
+ function () {
3586
+ this.previousPage.emit(null);
3587
+ };
3588
+ /**
3589
+ * @return {?}
3590
+ */
3591
+ PaginationComponent.prototype.onNext = /**
3592
+ * @return {?}
3593
+ */
3594
+ function () {
3595
+ this.nextPage.emit(null);
3596
+ };
3597
+ PaginationComponent.decorators = [
3598
+ { type: i0.Component, args: [{
3599
+ selector: 'xuilib-pagination',
3600
+ template: "<nav class=\"hmcts-pagination\" id=\"pagination-label\">\n\n <p class=\"govuk-visually-hidden\" aria-labelledby=\"pagination-label\">Pagination navigation</p>\n\n <ul class=\"hmcts-pagination__list\">\n <li class=\"hmcts-pagination__item hmcts-pagination__item--prev\">\n <a *ngIf=\"firstRecord > 1; else noPrevious\" class=\"hmcts-pagination__link\" (click)=\"onPrevious()\" href=\"javascript:void(0)\">\n Previous page\n </a>\n <ng-template #noPrevious>\n <span class=\"hmcts-pagination__link\">Previous page</span>\n </ng-template>\n </li>\n\n <li class=\"hmcts-pagination__item hmcts-pagination__item--next\">\n <a *ngIf=\"moreItems; else noNext\" class=\"hmcts-pagination__link\" (click)=\"onNext()\" href=\"javascript:void(0)\">Next page</a>\n <ng-template #noNext>\n <span class=\"hmcts-pagination__link\">Next page</span>\n </ng-template>\n </li>\n </ul>\n</nav>\n",
3601
+ styles: ["span.hmcts-pagination__link:hover{color:revert}"]
3602
+ }] }
3603
+ ];
3604
+ /** @nocollapse */
3605
+ PaginationComponent.ctorParameters = function () { return []; };
3606
+ PaginationComponent.propDecorators = {
3607
+ moreItems: [{ type: i0.Input }],
3608
+ firstRecord: [{ type: i0.Input }],
3609
+ previousPage: [{ type: i0.Output }],
3610
+ nextPage: [{ type: i0.Output }]
3611
+ };
3612
+ return PaginationComponent;
3613
+ }());
3614
+
3615
+ /**
3616
+ * @fileoverview added by tsickle
3617
+ * Generated from: lib/components/pagination-v1/pagination.component.ts
3618
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3619
+ */
3620
+ /**
3621
+ * @param {?} input
3622
+ * @return {?}
3623
+ */
3624
+ function coerceToBoolean(input) {
3625
+ return !!input && input !== 'false';
3626
+ }
3627
+ var PaginationV1Component = /** @class */ (function () {
3628
+ function PaginationV1Component() {
3629
+ this.maxSize = 7;
3630
+ this.previousLabel = 'Previous';
3631
+ this.nextLabel = 'Next';
3632
+ this.screenReaderPaginationLabel = 'Pagination';
3633
+ this.screenReaderPageLabel = 'page';
3634
+ this.screenReaderCurrentLabel = "You're on page";
3635
+ this.pageChange = new i0.EventEmitter();
3636
+ this.pageBoundsCorrection = new i0.EventEmitter();
3637
+ // tslint:disable-next-line:variable-name
3638
+ this._directionLinks = true;
3639
+ // tslint:disable-next-line:variable-name
3640
+ this._autoHide = false;
3641
+ // tslint:disable-next-line:variable-name
3642
+ this._responsive = false;
3643
+ }
3644
+ Object.defineProperty(PaginationV1Component.prototype, "directionLinks", {
3645
+ get: /**
3646
+ * @return {?}
3647
+ */ function () {
3648
+ return this._directionLinks;
3649
+ },
3650
+ set: /**
3651
+ * @param {?} value
3652
+ * @return {?}
3653
+ */ function (value) {
3654
+ this._directionLinks = coerceToBoolean(value);
3655
+ },
3656
+ enumerable: true,
3657
+ configurable: true
3658
+ });
3659
+ Object.defineProperty(PaginationV1Component.prototype, "autoHide", {
3660
+ get: /**
3661
+ * @return {?}
3662
+ */ function () {
3663
+ return this._autoHide;
3664
+ },
3665
+ set: /**
3666
+ * @param {?} value
3667
+ * @return {?}
3668
+ */ function (value) {
3669
+ this._autoHide = coerceToBoolean(value);
3670
+ },
3671
+ enumerable: true,
3672
+ configurable: true
3673
+ });
3674
+ Object.defineProperty(PaginationV1Component.prototype, "responsive", {
3675
+ get: /**
3676
+ * @return {?}
3677
+ */ function () {
3678
+ return this._responsive;
3679
+ },
3680
+ set: /**
3681
+ * @param {?} value
3682
+ * @return {?}
3683
+ */ function (value) {
3684
+ this._responsive = coerceToBoolean(value);
3685
+ },
3686
+ enumerable: true,
3687
+ configurable: true
3688
+ });
3689
+ PaginationV1Component.decorators = [
3690
+ { type: i0.Component, args: [{
3691
+ selector: 'xuilib-pagination-v1',
3692
+ template: "<pagination-template #p=\"paginationApi\" [id]=\"id\" [maxSize]=\"maxSize\" (pageChange)=\"pageChange.emit($event)\"\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\">\n <nav role=\"navigation\" aria-label=\"Pagination\">\n <ul class=\"ngx-pagination\" role=\"navigation\" [attr.aria-label]=\"screenReaderPaginationLabel\"\n [class.responsive]=\"responsive\" *ngIf=\"!(autoHide && p.pages.length <= 1)\">\n <li class=\"pagination-previous\" [class.disabled]=\"p.isFirstPage()\" *ngIf=\"directionLinks\">\n <a tabindex=\"0\" *ngIf=\"1 < p.getCurrent()\" (keyup.enter)=\"p.previous()\" (click)=\"p.previous()\"\n [attr.aria-label]=\"previousLabel + ' ' + screenReaderPageLabel\">\n {{ previousLabel }} <span class=\"show-for-sr\">{{ screenReaderPageLabel }}</span>\n </a>\n <span *ngIf=\"p.isFirstPage()\">\n {{ previousLabel }} <span class=\"show-for-sr\">{{ screenReaderPageLabel }}</span>\n </span>\n </li>\n <li class=\"small-screen\">\n {{ p.getCurrent() }} / {{ p.getLastPage() }}\n </li>\n <li [class.current]=\"p.getCurrent() === page.value\" [class.ellipsis]=\"page.label === '...'\"\n *ngFor=\"let page of p.pages\">\n <a tabindex=\"0\" (keyup.enter)=\"p.setCurrent(page.value)\" (click)=\"p.setCurrent(page.value)\"\n *ngIf=\"p.getCurrent() !== page.value\">\n <span class=\"show-for-sr\">{{ screenReaderPageLabel }} </span>\n <span>{{ (page.label === '...') ? page.label : (page.label | number:'') }}</span>\n </a>\n <ng-container *ngIf=\"p.getCurrent() === page.value\">\n <span class=\"show-for-sr\">{{ screenReaderCurrentLabel }} </span>\n <span>{{ (page.label === '...') ? page.label : (page.label | number:'') }}</span>\n </ng-container>\n </li>\n <li class=\"pagination-next\" [class.disabled]=\"p.isLastPage()\" *ngIf=\"directionLinks\">\n <a tabindex=\"0\" *ngIf=\"!p.isLastPage()\" (keyup.enter)=\"p.next()\" (click)=\"p.next()\"\n [attr.aria-label]=\"nextLabel + ' ' + screenReaderPageLabel\">\n {{ nextLabel }} <span class=\"show-for-sr\">{{ screenReaderPageLabel }}</span>\n </a>\n <span *ngIf=\"p.isLastPage()\">\n {{ nextLabel }} <span class=\"show-for-sr\">{{ screenReaderPageLabel }}</span>\n </span>\n </li>\n </ul>\n </nav>\n</pagination-template>\n",
3693
+ styles: [".ngx-pagination{margin-left:0;margin-bottom:1rem;padding-top:25px;text-decoration:none;text-align:left;font-size:16px}.ngx-pagination::after,.ngx-pagination::before{content:\" \";display:table}.ngx-pagination::after{clear:both}.ngx-pagination li{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;margin-right:.0625rem;border-radius:0;display:inline-block}.ngx-pagination a,.ngx-pagination button{display:block;padding:.1875rem .625rem;border-radius:0;color:#005da6;cursor:pointer}.ngx-pagination a:hover,.ngx-pagination button:hover{background:#e6e6e6}.ngx-pagination .current{padding:.1875rem .625rem;background:#fff;color:#4c2c92;cursor:default;font-weight:900}.ngx-pagination .disabled{display:none}.ngx-pagination .disabled:hover{background:0 0}.ngx-pagination .pagination-previous a::before,.ngx-pagination .pagination-previous.disabled::before{margin-right:.5rem;display:inline-block;height:10px;width:10px;border-style:solid;color:#0a0a0a;background:0 0;transform:rotate(-45deg);content:\"\";border-width:3px 0 0 3px}.ngx-pagination .pagination-next a::after,.ngx-pagination .pagination-next.disabled::after{margin-left:.5rem;display:inline-block;height:10px;width:10px;border-style:solid;color:#0a0a0a;background:0 0;transform:rotate(-45deg);content:\"\";border-width:0 3px 3px 0}.ngx-pagination .show-for-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.ngx-pagination .small-screen{display:none}@media screen and (max-width:601px){.ngx-pagination.responsive .small-screen{display:inline-block}.ngx-pagination.responsive li:not(.small-screen):not(.pagination-previous):not(.pagination-next){display:none}}"]
3694
+ }] }
3695
+ ];
3696
+ PaginationV1Component.propDecorators = {
3697
+ visibilityLabel: [{ type: i0.Input }],
3698
+ id: [{ type: i0.Input }],
3699
+ maxSize: [{ type: i0.Input }],
3700
+ directionLinks: [{ type: i0.Input }],
3701
+ autoHide: [{ type: i0.Input }],
3702
+ responsive: [{ type: i0.Input }],
3703
+ previousLabel: [{ type: i0.Input }],
3704
+ nextLabel: [{ type: i0.Input }],
3705
+ screenReaderPaginationLabel: [{ type: i0.Input }],
3706
+ screenReaderPageLabel: [{ type: i0.Input }],
3707
+ screenReaderCurrentLabel: [{ type: i0.Input }],
3708
+ pageChange: [{ type: i0.Output }],
3709
+ pageBoundsCorrection: [{ type: i0.Output }]
3710
+ };
3711
+ return PaginationV1Component;
3712
+ }());
3713
+
3557
3714
  /**
3558
3715
  * @fileoverview added by tsickle
3559
3716
  * Generated from: lib/components/public_api.ts
@@ -5104,7 +5261,9 @@
5104
5261
  LoadingSpinnerComponent,
5105
5262
  GenericFilterComponent,
5106
5263
  CookieBannerComponent,
5107
- FindPersonComponent
5264
+ FindPersonComponent,
5265
+ PaginationComponent,
5266
+ PaginationV1Component
5108
5267
  ];
5109
5268
  /** @type {?} */
5110
5269
  var GOV_UI_COMPONENTS = [
@@ -5143,12 +5302,15 @@
5143
5302
  forms.ReactiveFormsModule,
5144
5303
  i2$2.RouterModule.forChild([]),
5145
5304
  autocomplete.MatAutocompleteModule,
5146
- material.MatTabsModule
5305
+ material.MatTabsModule,
5306
+ ngxPagination.NgxPaginationModule
5147
5307
  ],
5148
5308
  providers: [
5149
5309
  { provide: windowToken, useFactory: ɵ0 }
5150
5310
  ],
5151
- exports: __spread(COMMON_COMPONENTS, GOV_UI_COMPONENTS)
5311
+ exports: __spread(COMMON_COMPONENTS, GOV_UI_COMPONENTS, [
5312
+ ngxPagination.PaginatePipe
5313
+ ])
5152
5314
  },] }
5153
5315
  ];
5154
5316
  return ExuiCommonLibModule;
@@ -6176,6 +6338,8 @@
6176
6338
  exports.UserDetailsComponent = UserDetailsComponent;
6177
6339
  exports.UserListComponent = UserListComponent;
6178
6340
  exports.CookieBannerComponent = CookieBannerComponent;
6341
+ exports.PaginationComponent = PaginationComponent;
6342
+ exports.PaginationV1Component = PaginationV1Component;
6179
6343
  exports.FeatureToggleDirective = FeatureToggleDirective;
6180
6344
  exports.LetContext = LetContext;
6181
6345
  exports.LetDirective = LetDirective;
@@ -6223,6 +6387,8 @@
6223
6387
  exports.ɵo = InviteUserFormComponent;
6224
6388
  exports.ɵn = InviteUserPermissionComponent;
6225
6389
  exports.ɵbc = LoadingSpinnerComponent;
6390
+ exports.ɵbl = PaginationV1Component;
6391
+ exports.ɵbk = PaginationComponent;
6226
6392
  exports.ɵv = SelectedCaseConfirmComponent;
6227
6393
  exports.ɵt = SelectedCaseListComponent;
6228
6394
  exports.ɵu = SelectedCaseComponent;
@@ -6241,27 +6407,27 @@
6241
6407
  exports.ɵg = FeatureToggleDirective;
6242
6408
  exports.ɵi = LetContext;
6243
6409
  exports.ɵj = LetDirective;
6244
- exports.ɵbs = GovUkCheckboxComponent;
6245
- exports.ɵby = GovUkCheckboxesComponent;
6246
- exports.ɵbx = GovUkDateComponent;
6247
- exports.ɵbv = GovUkErrorMessageComponent;
6248
- exports.ɵbw = GovUkFieldsetComponent;
6249
- exports.ɵcd = GovUkFileUploadComponent;
6250
- exports.ɵbt = GovUkFormGroupWrapperComponent;
6251
- exports.ɵbr = GovUkInputComponent;
6252
- exports.ɵbu = GovUkLabelComponent;
6253
- exports.ɵbz = GovUkRadioComponent;
6254
- exports.ɵca = GovUkRadiosComponent;
6255
- exports.ɵcb = GovUkSelectComponent;
6256
- exports.ɵbq = GovukTableComponent;
6257
- exports.ɵcc = GovUkTextareaComponent;
6258
- exports.ɵbp = HmctsBannerComponent;
6259
- exports.ɵbn = HmctsErrorSummaryComponent;
6260
- exports.ɵbk = HmctsIdentityBarComponent;
6261
- exports.ɵbo = HmctsMainWrapperComponent;
6262
- exports.ɵbm = HmctsPrimaryNavigationComponent;
6263
- exports.ɵbl = HmctsSubNavigationComponent;
6264
- exports.ɵce = RemoveHostDirective;
6410
+ exports.ɵbu = GovUkCheckboxComponent;
6411
+ exports.ɵca = GovUkCheckboxesComponent;
6412
+ exports.ɵbz = GovUkDateComponent;
6413
+ exports.ɵbx = GovUkErrorMessageComponent;
6414
+ exports.ɵby = GovUkFieldsetComponent;
6415
+ exports.ɵcf = GovUkFileUploadComponent;
6416
+ exports.ɵbv = GovUkFormGroupWrapperComponent;
6417
+ exports.ɵbt = GovUkInputComponent;
6418
+ exports.ɵbw = GovUkLabelComponent;
6419
+ exports.ɵcb = GovUkRadioComponent;
6420
+ exports.ɵcc = GovUkRadiosComponent;
6421
+ exports.ɵcd = GovUkSelectComponent;
6422
+ exports.ɵbs = GovukTableComponent;
6423
+ exports.ɵce = GovUkTextareaComponent;
6424
+ exports.ɵbr = HmctsBannerComponent;
6425
+ exports.ɵbp = HmctsErrorSummaryComponent;
6426
+ exports.ɵbm = HmctsIdentityBarComponent;
6427
+ exports.ɵbq = HmctsMainWrapperComponent;
6428
+ exports.ɵbo = HmctsPrimaryNavigationComponent;
6429
+ exports.ɵbn = HmctsSubNavigationComponent;
6430
+ exports.ɵcg = RemoveHostDirective;
6265
6431
  exports.ɵr = CaseSharingStateService;
6266
6432
  exports.ɵbg = CookieService;
6267
6433
  exports.ɵh = FeatureToggleService;