@hmcts/ccd-case-ui-toolkit 4.10.0-rc.2 → 4.10.0-rc.3
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/dist/case-ui-toolkit.module.js +0 -1
- package/dist/case-ui-toolkit.module.js.map +1 -1
- package/dist/case-ui-toolkit.module.metadata.json +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/index.metadata.json +1 -1
- package/dist/index.umd.js +98 -264
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.LICENSE.txt +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/shared/components/palette/complex/ccd-collection-table-value-case-fields.pipe.d.ts +7 -0
- package/dist/shared/components/palette/complex/ccd-collection-table-value-case-fields.pipe.js +48 -0
- package/dist/shared/components/palette/complex/ccd-collection-table-value-case-fields.pipe.js.map +1 -0
- package/dist/shared/components/palette/complex/ccd-collection-table-value-case-fields.pipe.metadata.json +1 -0
- package/dist/shared/components/palette/complex/complex.module.js +5 -2
- package/dist/shared/components/palette/complex/complex.module.js.map +1 -1
- package/dist/shared/components/palette/complex/complex.module.metadata.json +1 -1
- package/dist/shared/components/palette/complex/read-complex-field-collection-table.component.d.ts +5 -4
- package/dist/shared/components/palette/complex/read-complex-field-collection-table.component.js +24 -13
- package/dist/shared/components/palette/complex/read-complex-field-collection-table.component.js.map +1 -1
- package/dist/shared/components/palette/complex/read-complex-field-collection-table.component.metadata.json +1 -1
- package/dist/shared/components/palette/money-gbp/money-gbp-input.component.js +1 -1
- package/dist/shared/components/palette/money-gbp/money-gbp-input.component.js.map +1 -1
- package/dist/shared/components/palette/money-gbp/money-gbp-input.component.metadata.json +1 -1
- package/dist/shared/components/workbasket-filters/workbasket-filters.component.js +12 -10
- package/dist/shared/components/workbasket-filters/workbasket-filters.component.js.map +1 -1
- package/dist/shared/directives/conditional-show/conditional-show.module.js +0 -3
- package/dist/shared/directives/conditional-show/conditional-show.module.js.map +1 -1
- package/dist/shared/directives/conditional-show/conditional-show.module.metadata.json +1 -1
- package/dist/shared/directives/conditional-show/index.d.ts +0 -1
- package/dist/shared/directives/conditional-show/index.js +0 -1
- package/dist/shared/directives/conditional-show/index.js.map +1 -1
- package/dist/shared/directives/conditional-show/index.metadata.json +1 -1
- package/dist/shared/directives/conditional-show/services/conditional-show-registrar.service.d.ts +3 -4
- package/dist/shared/directives/conditional-show/services/conditional-show-registrar.service.js +0 -5
- package/dist/shared/directives/conditional-show/services/conditional-show-registrar.service.js.map +1 -1
- package/dist/shared/directives/conditional-show/services/conditional-show-registrar.service.metadata.json +1 -1
- package/package.json +1 -1
- package/dist/shared/directives/conditional-show/conditional-show.directive.d.ts +0 -46
- package/dist/shared/directives/conditional-show/conditional-show.directive.js +0 -219
- package/dist/shared/directives/conditional-show/conditional-show.directive.js.map +0 -1
- package/dist/shared/directives/conditional-show/conditional-show.directive.metadata.json +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @hmcts/ccd-case-ui-toolkit - Case UI Toolkit
|
|
3
|
-
* @version v4.10.0-rc.
|
|
3
|
+
* @version v4.10.0-rc.3
|
|
4
4
|
* @link undefined
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -17057,7 +17057,6 @@ var CaseUIToolkitModule = /** @class */ (function () {
|
|
|
17057
17057
|
shared_1.WriteNumberFieldComponent,
|
|
17058
17058
|
shared_1.WriteEmailFieldComponent,
|
|
17059
17059
|
shared_1.WriteDateFieldComponent,
|
|
17060
|
-
shared_1.ConditionalShowDirective,
|
|
17061
17060
|
shared_1.LabelSubstitutorDirective,
|
|
17062
17061
|
shared_1.FocusElementDirective,
|
|
17063
17062
|
ngx_pagination_1.PaginatePipe
|
|
@@ -18152,7 +18151,6 @@ exports.SortOrder = domain_1.SortOrder;
|
|
|
18152
18151
|
exports.SortParameters = domain_1.SortParameters;
|
|
18153
18152
|
var directives_1 = __webpack_require__(66395);
|
|
18154
18153
|
exports.ShowCondition = directives_1.ShowCondition;
|
|
18155
|
-
exports.ConditionalShowDirective = directives_1.ConditionalShowDirective;
|
|
18156
18154
|
exports.ConditionalShowModule = directives_1.ConditionalShowModule;
|
|
18157
18155
|
exports.PlaceholderService = directives_1.PlaceholderService;
|
|
18158
18156
|
exports.LabelSubstitutorDirective = directives_1.LabelSubstitutorDirective;
|
|
@@ -28702,6 +28700,61 @@ var WriteCollectionFieldComponent = /** @class */ (function (_super) {
|
|
|
28702
28700
|
exports.WriteCollectionFieldComponent = WriteCollectionFieldComponent;
|
|
28703
28701
|
|
|
28704
28702
|
|
|
28703
|
+
/***/ }),
|
|
28704
|
+
|
|
28705
|
+
/***/ 18649:
|
|
28706
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
28707
|
+
|
|
28708
|
+
"use strict";
|
|
28709
|
+
|
|
28710
|
+
var __assign = (this && this.__assign) || function () {
|
|
28711
|
+
__assign = Object.assign || function(t) {
|
|
28712
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
28713
|
+
s = arguments[i];
|
|
28714
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
28715
|
+
t[p] = s[p];
|
|
28716
|
+
}
|
|
28717
|
+
return t;
|
|
28718
|
+
};
|
|
28719
|
+
return __assign.apply(this, arguments);
|
|
28720
|
+
};
|
|
28721
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
28722
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
28723
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
28724
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
28725
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
28726
|
+
};
|
|
28727
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
28728
|
+
var core_1 = __webpack_require__(57208);
|
|
28729
|
+
var definition_1 = __webpack_require__(11080);
|
|
28730
|
+
var class_transformer_1 = __webpack_require__(86631);
|
|
28731
|
+
var CcdCollectionTableCaseFieldsFilterPipe = /** @class */ (function () {
|
|
28732
|
+
function CcdCollectionTableCaseFieldsFilterPipe() {
|
|
28733
|
+
}
|
|
28734
|
+
CcdCollectionTableCaseFieldsFilterPipe.prototype.transform = function (objs, caseField, value) {
|
|
28735
|
+
var fields = objs.map(function (obj) { return (__assign({}, obj.value.caseField, { type: obj.value.type.type ? obj.value.type.type : obj.value.type })); });
|
|
28736
|
+
return class_transformer_1.plainToClassFromExist(new definition_1.CaseField(), {
|
|
28737
|
+
id: caseField ? caseField.id : '',
|
|
28738
|
+
label: caseField ? caseField.label : '',
|
|
28739
|
+
display_context: 'READONLY',
|
|
28740
|
+
value: value,
|
|
28741
|
+
field_type: {
|
|
28742
|
+
id: caseField ? caseField.id : '',
|
|
28743
|
+
type: 'Complex',
|
|
28744
|
+
complex_fields: fields,
|
|
28745
|
+
}
|
|
28746
|
+
});
|
|
28747
|
+
};
|
|
28748
|
+
CcdCollectionTableCaseFieldsFilterPipe = __decorate([
|
|
28749
|
+
core_1.Pipe({
|
|
28750
|
+
name: 'ccdCollectionTableCaseFieldsFilter'
|
|
28751
|
+
})
|
|
28752
|
+
], CcdCollectionTableCaseFieldsFilterPipe);
|
|
28753
|
+
return CcdCollectionTableCaseFieldsFilterPipe;
|
|
28754
|
+
}());
|
|
28755
|
+
exports.CcdCollectionTableCaseFieldsFilterPipe = CcdCollectionTableCaseFieldsFilterPipe;
|
|
28756
|
+
|
|
28757
|
+
|
|
28705
28758
|
/***/ }),
|
|
28706
28759
|
|
|
28707
28760
|
/***/ 41392:
|
|
@@ -29075,6 +29128,7 @@ var read_complex_field_table_component_1 = __webpack_require__(12259);
|
|
|
29075
29128
|
var read_complex_field_component_1 = __webpack_require__(47157);
|
|
29076
29129
|
var write_complex_field_component_1 = __webpack_require__(94091);
|
|
29077
29130
|
var ccd_cyapage_label_filter_pipe_1 = __webpack_require__(41392);
|
|
29131
|
+
var ccd_collection_table_value_case_fields_pipe_1 = __webpack_require__(18649);
|
|
29078
29132
|
var ComplexModule = /** @class */ (function () {
|
|
29079
29133
|
function ComplexModule() {
|
|
29080
29134
|
}
|
|
@@ -29101,6 +29155,7 @@ var ComplexModule = /** @class */ (function () {
|
|
|
29101
29155
|
read_complex_field_raw_component_1.ReadComplexFieldRawComponent,
|
|
29102
29156
|
read_complex_field_table_component_1.ReadComplexFieldTableComponent,
|
|
29103
29157
|
read_complex_field_collection_table_component_1.ReadComplexFieldCollectionTableComponent,
|
|
29158
|
+
ccd_collection_table_value_case_fields_pipe_1.CcdCollectionTableCaseFieldsFilterPipe,
|
|
29104
29159
|
ccd_cyapage_label_filter_pipe_1.CcdCYAPageLabelFilterPipe,
|
|
29105
29160
|
],
|
|
29106
29161
|
entryComponents: [
|
|
@@ -29112,8 +29167,9 @@ var ComplexModule = /** @class */ (function () {
|
|
|
29112
29167
|
fields_filter_pipe_1.FieldsFilterPipe,
|
|
29113
29168
|
ccd_tab_fields_pipe_1.CcdTabFieldsPipe,
|
|
29114
29169
|
ccd_read_fields_filter_pipe_1.ReadFieldsFilterPipe,
|
|
29115
|
-
|
|
29116
|
-
|
|
29170
|
+
ccd_cyapage_label_filter_pipe_1.CcdCYAPageLabelFilterPipe,
|
|
29171
|
+
ccd_collection_table_value_case_fields_pipe_1.CcdCollectionTableCaseFieldsFilterPipe,
|
|
29172
|
+
write_complex_field_component_1.WriteComplexFieldComponent
|
|
29117
29173
|
]
|
|
29118
29174
|
})
|
|
29119
29175
|
], ComplexModule);
|
|
@@ -29306,6 +29362,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
29306
29362
|
var core_1 = __webpack_require__(57208);
|
|
29307
29363
|
var abstract_field_read_component_1 = __webpack_require__(73860);
|
|
29308
29364
|
var sort_order_1 = __webpack_require__(88843);
|
|
29365
|
+
var definition_1 = __webpack_require__(11080);
|
|
29366
|
+
var class_transformer_1 = __webpack_require__(86631);
|
|
29309
29367
|
var ReadComplexFieldCollectionTableComponent = /** @class */ (function (_super) {
|
|
29310
29368
|
__extends(ReadComplexFieldCollectionTableComponent, _super);
|
|
29311
29369
|
function ReadComplexFieldCollectionTableComponent() {
|
|
@@ -29315,13 +29373,17 @@ var ReadComplexFieldCollectionTableComponent = /** @class */ (function (_super)
|
|
|
29315
29373
|
_this.keepOriginalOrder = function (a, b) { return a.key; };
|
|
29316
29374
|
return _this;
|
|
29317
29375
|
}
|
|
29376
|
+
ReadComplexFieldCollectionTableComponent_1 = ReadComplexFieldCollectionTableComponent;
|
|
29377
|
+
ReadComplexFieldCollectionTableComponent.isSortAscending = function (column) {
|
|
29378
|
+
return !(column.sortOrder === sort_order_1.SortOrder.UNSORTED || column.sortOrder === sort_order_1.SortOrder.DESCENDING);
|
|
29379
|
+
};
|
|
29318
29380
|
ReadComplexFieldCollectionTableComponent.prototype.ngOnInit = function () {
|
|
29319
29381
|
_super.prototype.ngOnInit.call(this);
|
|
29320
29382
|
if (this.caseField.display_context_parameter
|
|
29321
29383
|
&& this.caseField.display_context_parameter.trim().startsWith('#TABLE(')) {
|
|
29322
29384
|
var displayContextParameter = this.caseField.display_context_parameter.trim();
|
|
29323
29385
|
var result = displayContextParameter.replace('#TABLE(', '');
|
|
29324
|
-
this.columns = result.replace(')', '').split(',');
|
|
29386
|
+
this.columns = result.replace(')', '').split(',').map(function (c) { return c.trim(); });
|
|
29325
29387
|
var labelsVertical = {};
|
|
29326
29388
|
var labelsHorizontal = {};
|
|
29327
29389
|
var allLabels = {};
|
|
@@ -29336,9 +29398,10 @@ var ReadComplexFieldCollectionTableComponent = /** @class */ (function (_super)
|
|
|
29336
29398
|
ReadComplexFieldCollectionTableComponent.prototype.populateHorizontalLabels = function (labelsHorizontal, allLabels, labelsVertical) {
|
|
29337
29399
|
for (var _i = 0, _a = this.columns; _i < _a.length; _i++) {
|
|
29338
29400
|
var id = _a[_i];
|
|
29339
|
-
|
|
29340
|
-
labelsHorizontal[
|
|
29341
|
-
|
|
29401
|
+
var trimmedId = id.trim();
|
|
29402
|
+
labelsHorizontal[trimmedId] = allLabels[trimmedId];
|
|
29403
|
+
labelsHorizontal[trimmedId].sortOrder = sort_order_1.SortOrder.UNSORTED;
|
|
29404
|
+
delete labelsVertical[trimmedId];
|
|
29342
29405
|
}
|
|
29343
29406
|
};
|
|
29344
29407
|
ReadComplexFieldCollectionTableComponent.prototype.populateLabels = function (labelsVertical, allLabels) {
|
|
@@ -29395,6 +29458,15 @@ var ReadComplexFieldCollectionTableComponent = /** @class */ (function (_super)
|
|
|
29395
29458
|
field.value = { CaseReference: value };
|
|
29396
29459
|
return field;
|
|
29397
29460
|
};
|
|
29461
|
+
ReadComplexFieldCollectionTableComponent.prototype.toCaseField = function (id, label, field_type, value) {
|
|
29462
|
+
return class_transformer_1.plainToClassFromExist(new definition_1.CaseField(), {
|
|
29463
|
+
id: id,
|
|
29464
|
+
label: label,
|
|
29465
|
+
display_context: 'READONLY',
|
|
29466
|
+
value: value,
|
|
29467
|
+
field_type: field_type
|
|
29468
|
+
});
|
|
29469
|
+
};
|
|
29398
29470
|
ReadComplexFieldCollectionTableComponent.prototype.isVerticleDataNotEmpty = function (row) {
|
|
29399
29471
|
var result = false;
|
|
29400
29472
|
for (var key in this.columnsVerticalLabel) {
|
|
@@ -29443,16 +29515,11 @@ var ReadComplexFieldCollectionTableComponent = /** @class */ (function (_super)
|
|
|
29443
29515
|
break;
|
|
29444
29516
|
}
|
|
29445
29517
|
};
|
|
29446
|
-
ReadComplexFieldCollectionTableComponent.prototype.isSortAscending = function (column) {
|
|
29447
|
-
return !(column.sortOrder === sort_order_1.SortOrder.UNSORTED || column.sortOrder === sort_order_1.SortOrder.DESCENDING);
|
|
29448
|
-
};
|
|
29449
29518
|
ReadComplexFieldCollectionTableComponent.prototype.sortWidget = function (column) {
|
|
29450
|
-
return
|
|
29451
|
-
};
|
|
29452
|
-
ReadComplexFieldCollectionTableComponent.prototype.trackByIndex = function (index, obj) {
|
|
29453
|
-
return index;
|
|
29519
|
+
return ReadComplexFieldCollectionTableComponent_1.isSortAscending(column) ? '▼' : '▲';
|
|
29454
29520
|
};
|
|
29455
|
-
|
|
29521
|
+
var ReadComplexFieldCollectionTableComponent_1;
|
|
29522
|
+
ReadComplexFieldCollectionTableComponent = ReadComplexFieldCollectionTableComponent_1 = __decorate([
|
|
29456
29523
|
core_1.Component({
|
|
29457
29524
|
selector: 'ccd-read-complex-field-collection-table',
|
|
29458
29525
|
template: __webpack_require__(9643),
|
|
@@ -32421,7 +32488,7 @@ var MoneyGbpInputComponent = /** @class */ (function () {
|
|
|
32421
32488
|
// Not used.
|
|
32422
32489
|
};
|
|
32423
32490
|
var MoneyGbpInputComponent_1;
|
|
32424
|
-
MoneyGbpInputComponent.PATTERN_REGEXP = new RegExp('
|
|
32491
|
+
MoneyGbpInputComponent.PATTERN_REGEXP = new RegExp('^-?\\d*(\\.\\d{0,2})?$');
|
|
32425
32492
|
__decorate([
|
|
32426
32493
|
core_1.Input(),
|
|
32427
32494
|
__metadata("design:type", String)
|
|
@@ -36639,16 +36706,18 @@ var WorkbasketFiltersComponent = /** @class */ (function () {
|
|
|
36639
36706
|
var formGroupLS = JSON.parse(this.windowService.getLocalStorage(FORM_GROUP_VAL_LOC_STORAGE));
|
|
36640
36707
|
// Form group local storage is available and contains regionList property
|
|
36641
36708
|
if (util_1.isDefined(formGroupLS) && formGroupLS.hasOwnProperty(REGION_LIST_AND_FRC_FILTER)) {
|
|
36642
|
-
|
|
36643
|
-
|
|
36644
|
-
|
|
36645
|
-
|
|
36646
|
-
|
|
36647
|
-
|
|
36648
|
-
|
|
36649
|
-
|
|
36650
|
-
|
|
36651
|
-
|
|
36709
|
+
if (this.formGroup.get(REGION_LIST_AND_FRC_FILTER)) {
|
|
36710
|
+
// If regionList value does not match between local storage and form group
|
|
36711
|
+
// then the filter value has been changed and we need to clear the old filter values
|
|
36712
|
+
if (formGroupLS[REGION_LIST_AND_FRC_FILTER] !== this.formGroup.get(REGION_LIST_AND_FRC_FILTER).value) {
|
|
36713
|
+
for (var key in formGroupLS) {
|
|
36714
|
+
if (formGroupLS.hasOwnProperty(key)) {
|
|
36715
|
+
var value = formGroupLS[key];
|
|
36716
|
+
// Clear the filter form group control values if it has a value in local storage
|
|
36717
|
+
// The regionList form group control value should be ignored as it always contain the latest value
|
|
36718
|
+
if (key !== REGION_LIST_AND_FRC_FILTER && value != null) {
|
|
36719
|
+
this.formGroup.get(key).setValue(null);
|
|
36720
|
+
}
|
|
36652
36721
|
}
|
|
36653
36722
|
}
|
|
36654
36723
|
}
|
|
@@ -36935,232 +37004,6 @@ var ConditionalShowFormDirective = /** @class */ (function () {
|
|
|
36935
37004
|
exports.ConditionalShowFormDirective = ConditionalShowFormDirective;
|
|
36936
37005
|
|
|
36937
37006
|
|
|
36938
|
-
/***/ }),
|
|
36939
|
-
|
|
36940
|
-
/***/ 74015:
|
|
36941
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
36942
|
-
|
|
36943
|
-
"use strict";
|
|
36944
|
-
|
|
36945
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
36946
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
36947
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
36948
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
36949
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
36950
|
-
};
|
|
36951
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
36952
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
36953
|
-
};
|
|
36954
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
36955
|
-
var core_1 = __webpack_require__(57208);
|
|
36956
|
-
var forms_1 = __webpack_require__(92985);
|
|
36957
|
-
var case_field_model_1 = __webpack_require__(13930);
|
|
36958
|
-
var conditional_show_model_1 = __webpack_require__(5369);
|
|
36959
|
-
var fields_utils_1 = __webpack_require__(40980);
|
|
36960
|
-
var conditional_show_registrar_service_1 = __webpack_require__(49532);
|
|
36961
|
-
var grey_bar_service_1 = __webpack_require__(100);
|
|
36962
|
-
var operators_1 = __webpack_require__(19443);
|
|
36963
|
-
var ConditionalShowDirective = /** @class */ (function () {
|
|
36964
|
-
function ConditionalShowDirective(el, fieldsUtils, registry, renderer, greyBarService) {
|
|
36965
|
-
this.el = el;
|
|
36966
|
-
this.fieldsUtils = fieldsUtils;
|
|
36967
|
-
this.registry = registry;
|
|
36968
|
-
this.renderer = renderer;
|
|
36969
|
-
this.greyBarService = greyBarService;
|
|
36970
|
-
this.contextFields = [];
|
|
36971
|
-
this.greyBarEnabled = false;
|
|
36972
|
-
}
|
|
36973
|
-
ConditionalShowDirective.prototype.ngAfterViewInit = function () {
|
|
36974
|
-
// Ensure this.caseField is actually a CaseField instance even if instantiated with {}
|
|
36975
|
-
// this.caseField = FieldsUtils.convertToCaseField(this.caseField);
|
|
36976
|
-
if (this.caseField.show_condition) {
|
|
36977
|
-
this.condition = conditional_show_model_1.ShowCondition.getInstance(this.caseField.show_condition);
|
|
36978
|
-
this.formGroup = this.formGroup || new forms_1.FormGroup({});
|
|
36979
|
-
this.complexFormGroup = this.complexFormGroup || new forms_1.FormGroup({});
|
|
36980
|
-
this.formField = this.complexFormGroup.get(this.caseField.id) || this.formGroup.get(this.caseField.id);
|
|
36981
|
-
this.updateVisibility(this.getCurrentPagesReadOnlyAndFormFieldValues());
|
|
36982
|
-
if (this.greyBarEnabled && this.greyBarService.wasToggledToShow(this.caseField.id)) {
|
|
36983
|
-
this.greyBarService.showGreyBar(this.caseField, this.el);
|
|
36984
|
-
}
|
|
36985
|
-
this.subscribeToFormChanges();
|
|
36986
|
-
this.registry.register(this);
|
|
36987
|
-
}
|
|
36988
|
-
};
|
|
36989
|
-
ConditionalShowDirective.prototype.refreshVisibility = function () {
|
|
36990
|
-
this.updateVisibility(this.getCurrentPagesReadOnlyAndFormFieldValues(), true);
|
|
36991
|
-
this.subscribeToFormChanges();
|
|
36992
|
-
};
|
|
36993
|
-
ConditionalShowDirective.prototype.ngOnDestroy = function () {
|
|
36994
|
-
this.unsubscribeFromFormChanges();
|
|
36995
|
-
};
|
|
36996
|
-
ConditionalShowDirective.prototype.subscribeToFormChanges = function () {
|
|
36997
|
-
var _this = this;
|
|
36998
|
-
this.unsubscribeFromFormChanges();
|
|
36999
|
-
this.formChangesSubscription = this.formGroup
|
|
37000
|
-
.valueChanges
|
|
37001
|
-
.pipe(operators_1.debounceTime(200))
|
|
37002
|
-
.subscribe(function (_) {
|
|
37003
|
-
var shown = _this.updateVisibility(_this.getCurrentPagesReadOnlyAndFormFieldValues());
|
|
37004
|
-
if (_this.greyBarEnabled && shown !== undefined) {
|
|
37005
|
-
_this.updateGreyBar(shown);
|
|
37006
|
-
}
|
|
37007
|
-
});
|
|
37008
|
-
};
|
|
37009
|
-
/**
|
|
37010
|
-
* returns whether the field visibility has changed, or undefined if not
|
|
37011
|
-
*/
|
|
37012
|
-
ConditionalShowDirective.prototype.updateVisibility = function (fields, forced) {
|
|
37013
|
-
if (forced === void 0) { forced = false; }
|
|
37014
|
-
if (this.shouldToggleToHide(fields, forced)) {
|
|
37015
|
-
this.onHide();
|
|
37016
|
-
return false;
|
|
37017
|
-
}
|
|
37018
|
-
else if (this.shouldToggleToShow(fields)) {
|
|
37019
|
-
this.onShow();
|
|
37020
|
-
return true;
|
|
37021
|
-
}
|
|
37022
|
-
};
|
|
37023
|
-
ConditionalShowDirective.prototype.onHide = function () {
|
|
37024
|
-
if (this.formField) {
|
|
37025
|
-
this.unsubscribeFromFormChanges();
|
|
37026
|
-
this.formField.disable({ emitEvent: false });
|
|
37027
|
-
this.subscribeToFormChanges();
|
|
37028
|
-
}
|
|
37029
|
-
this.hideField();
|
|
37030
|
-
this.greyBarService.removeGreyBar(this.el);
|
|
37031
|
-
};
|
|
37032
|
-
ConditionalShowDirective.prototype.onShow = function () {
|
|
37033
|
-
if (this.formField) {
|
|
37034
|
-
this.unsubscribeFromFormChanges();
|
|
37035
|
-
this.formField.enable({ emitEvent: false });
|
|
37036
|
-
this.subscribeToFormChanges();
|
|
37037
|
-
}
|
|
37038
|
-
this.showField();
|
|
37039
|
-
if (this.formField) {
|
|
37040
|
-
this.checkHideShowCondition(this.caseField.id, this.formField);
|
|
37041
|
-
}
|
|
37042
|
-
};
|
|
37043
|
-
ConditionalShowDirective.prototype.hideField = function () {
|
|
37044
|
-
this.el.nativeElement.hidden = true;
|
|
37045
|
-
};
|
|
37046
|
-
ConditionalShowDirective.prototype.showField = function () {
|
|
37047
|
-
this.el.nativeElement.hidden = false;
|
|
37048
|
-
};
|
|
37049
|
-
ConditionalShowDirective.prototype.shouldToggleToHide = function (fields, forced) {
|
|
37050
|
-
return (!this.isHidden() || forced) && !this.condition.match(fields, this.buildPath());
|
|
37051
|
-
};
|
|
37052
|
-
ConditionalShowDirective.prototype.shouldToggleToShow = function (fields) {
|
|
37053
|
-
return this.isHidden() && this.condition.match(fields, this.buildPath());
|
|
37054
|
-
};
|
|
37055
|
-
ConditionalShowDirective.prototype.buildPath = function () {
|
|
37056
|
-
if (this.idPrefix) {
|
|
37057
|
-
return this.idPrefix + this.caseField.id;
|
|
37058
|
-
}
|
|
37059
|
-
return this.caseField.id;
|
|
37060
|
-
};
|
|
37061
|
-
ConditionalShowDirective.prototype.getCurrentPagesReadOnlyAndFormFieldValues = function () {
|
|
37062
|
-
var formFields = this.getFormFieldsValuesIncludingDisabled();
|
|
37063
|
-
return this.fieldsUtils.mergeCaseFieldsAndFormFields(this.contextFields, formFields);
|
|
37064
|
-
};
|
|
37065
|
-
ConditionalShowDirective.prototype.getFormFieldsValuesIncludingDisabled = function () {
|
|
37066
|
-
if (this.formGroupRawValue) {
|
|
37067
|
-
return this.formGroupRawValue;
|
|
37068
|
-
}
|
|
37069
|
-
this.formGroupRawValue = this.formGroup.getRawValue();
|
|
37070
|
-
return this.formGroupRawValue;
|
|
37071
|
-
};
|
|
37072
|
-
ConditionalShowDirective.prototype.isHidden = function () {
|
|
37073
|
-
return this.el.nativeElement.hidden;
|
|
37074
|
-
};
|
|
37075
|
-
ConditionalShowDirective.prototype.unsubscribeFromFormChanges = function () {
|
|
37076
|
-
if (this.formChangesSubscription) {
|
|
37077
|
-
this.formChangesSubscription.unsubscribe();
|
|
37078
|
-
}
|
|
37079
|
-
};
|
|
37080
|
-
// TODO This must be extracted to a generic service for traversing see RDM-2233
|
|
37081
|
-
ConditionalShowDirective.prototype.checkHideShowCondition = function (key, aControl) {
|
|
37082
|
-
var _this = this;
|
|
37083
|
-
if (aControl instanceof forms_1.FormArray) { // We're in a collection
|
|
37084
|
-
aControl.controls.forEach(function (formControl, i) {
|
|
37085
|
-
_this.checkHideShowCondition('' + i, formControl);
|
|
37086
|
-
});
|
|
37087
|
-
}
|
|
37088
|
-
else if (aControl instanceof forms_1.FormGroup) {
|
|
37089
|
-
if (aControl.get('value')) { // Complex Field
|
|
37090
|
-
var complexControl_1 = aControl.get('value');
|
|
37091
|
-
Object.keys(complexControl_1.controls).forEach(function (controlKey) {
|
|
37092
|
-
_this.checkHideShowCondition(controlKey, complexControl_1.get(controlKey));
|
|
37093
|
-
});
|
|
37094
|
-
}
|
|
37095
|
-
else if (aControl.controls) { // Special Field like AddressUK, AddressGlobal
|
|
37096
|
-
Object.keys(aControl.controls).forEach(function (controlKey) {
|
|
37097
|
-
_this.checkHideShowCondition(controlKey, aControl.get(controlKey));
|
|
37098
|
-
});
|
|
37099
|
-
}
|
|
37100
|
-
}
|
|
37101
|
-
else if (aControl instanceof forms_1.FormControl) { // FormControl
|
|
37102
|
-
if (aControl.invalid) {
|
|
37103
|
-
this.registry.refresh();
|
|
37104
|
-
}
|
|
37105
|
-
}
|
|
37106
|
-
};
|
|
37107
|
-
ConditionalShowDirective.prototype.updateGreyBar = function (shown) {
|
|
37108
|
-
if (shown) {
|
|
37109
|
-
this.greyBarService.addToggledToShow(this.caseField.id);
|
|
37110
|
-
this.greyBarService.showGreyBar(this.caseField, this.el);
|
|
37111
|
-
}
|
|
37112
|
-
else {
|
|
37113
|
-
this.greyBarService.removeToggledToShow(this.caseField.id);
|
|
37114
|
-
this.greyBarService.removeGreyBar(this.el);
|
|
37115
|
-
}
|
|
37116
|
-
};
|
|
37117
|
-
__decorate([
|
|
37118
|
-
core_1.Input(),
|
|
37119
|
-
__metadata("design:type", case_field_model_1.CaseField)
|
|
37120
|
-
], ConditionalShowDirective.prototype, "caseField", void 0);
|
|
37121
|
-
__decorate([
|
|
37122
|
-
core_1.Input(),
|
|
37123
|
-
__metadata("design:type", String)
|
|
37124
|
-
], ConditionalShowDirective.prototype, "idPrefix", void 0);
|
|
37125
|
-
__decorate([
|
|
37126
|
-
core_1.Input(),
|
|
37127
|
-
__metadata("design:type", Array)
|
|
37128
|
-
], ConditionalShowDirective.prototype, "contextFields", void 0);
|
|
37129
|
-
__decorate([
|
|
37130
|
-
core_1.Input(),
|
|
37131
|
-
__metadata("design:type", forms_1.FormGroup)
|
|
37132
|
-
], ConditionalShowDirective.prototype, "formGroup", void 0);
|
|
37133
|
-
__decorate([
|
|
37134
|
-
core_1.Input(),
|
|
37135
|
-
__metadata("design:type", Object)
|
|
37136
|
-
], ConditionalShowDirective.prototype, "greyBarEnabled", void 0);
|
|
37137
|
-
__decorate([
|
|
37138
|
-
core_1.Input(),
|
|
37139
|
-
__metadata("design:type", forms_1.FormGroup)
|
|
37140
|
-
], ConditionalShowDirective.prototype, "complexFormGroup", void 0);
|
|
37141
|
-
ConditionalShowDirective = __decorate([
|
|
37142
|
-
core_1.Directive({ selector: '[ccdConditionalShow]' })
|
|
37143
|
-
/** Hides and shows the host element based on the show condition if the condition is not empty. Works on read only fields and form fields.
|
|
37144
|
-
* The show condition is evaluated on all the fields of the page. i.e. read only and form fields. When a form field is hidden, if its
|
|
37145
|
-
* initial value was changed then the field is cleared. Otherwise the original value is kept and will display next time the field is
|
|
37146
|
-
* shown. Evaluation of the show condition includes disabled fields, which can be on their initial value or empty. Executes on the
|
|
37147
|
-
* host field initialization and when any field of the form changes.
|
|
37148
|
-
* Collaborates with the GreyBarService to show a vertical grey bar when a field initially hidden on the page is shown. When returning
|
|
37149
|
-
* to the page after the page has been left, the grey bar has to be redisplayed. If instead on initial page load the field renders as
|
|
37150
|
-
* initially shown, the grey bar is not displayed.
|
|
37151
|
-
*/
|
|
37152
|
-
,
|
|
37153
|
-
__metadata("design:paramtypes", [core_1.ElementRef,
|
|
37154
|
-
fields_utils_1.FieldsUtils,
|
|
37155
|
-
conditional_show_registrar_service_1.ConditionalShowRegistrarService,
|
|
37156
|
-
core_1.Renderer2,
|
|
37157
|
-
grey_bar_service_1.GreyBarService])
|
|
37158
|
-
], ConditionalShowDirective);
|
|
37159
|
-
return ConditionalShowDirective;
|
|
37160
|
-
}());
|
|
37161
|
-
exports.ConditionalShowDirective = ConditionalShowDirective;
|
|
37162
|
-
|
|
37163
|
-
|
|
37164
37007
|
/***/ }),
|
|
37165
37008
|
|
|
37166
37009
|
/***/ 95844:
|
|
@@ -37176,7 +37019,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
37176
37019
|
};
|
|
37177
37020
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
37178
37021
|
var core_1 = __webpack_require__(57208);
|
|
37179
|
-
var conditional_show_directive_1 = __webpack_require__(74015);
|
|
37180
37022
|
var fields_utils_1 = __webpack_require__(40980);
|
|
37181
37023
|
var conditional_show_registrar_service_1 = __webpack_require__(49532);
|
|
37182
37024
|
var grey_bar_service_1 = __webpack_require__(100);
|
|
@@ -37187,11 +37029,9 @@ var ConditionalShowModule = /** @class */ (function () {
|
|
|
37187
37029
|
ConditionalShowModule = __decorate([
|
|
37188
37030
|
core_1.NgModule({
|
|
37189
37031
|
declarations: [
|
|
37190
|
-
conditional_show_directive_1.ConditionalShowDirective,
|
|
37191
37032
|
conditional_show_form_directive_1.ConditionalShowFormDirective
|
|
37192
37033
|
],
|
|
37193
37034
|
exports: [
|
|
37194
|
-
conditional_show_directive_1.ConditionalShowDirective,
|
|
37195
37035
|
conditional_show_form_directive_1.ConditionalShowFormDirective
|
|
37196
37036
|
],
|
|
37197
37037
|
providers: [
|
|
@@ -37543,7 +37383,6 @@ function __export(m) {
|
|
|
37543
37383
|
}
|
|
37544
37384
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
37545
37385
|
__export(__webpack_require__(97965));
|
|
37546
|
-
__export(__webpack_require__(74015));
|
|
37547
37386
|
__export(__webpack_require__(32225));
|
|
37548
37387
|
__export(__webpack_require__(95844));
|
|
37549
37388
|
|
|
@@ -37570,11 +37409,6 @@ var ConditionalShowRegistrarService = /** @class */ (function () {
|
|
|
37570
37409
|
ConditionalShowRegistrarService.prototype.register = function (newDirective) {
|
|
37571
37410
|
this.registeredDirectives.push(newDirective);
|
|
37572
37411
|
};
|
|
37573
|
-
ConditionalShowRegistrarService.prototype.refresh = function () {
|
|
37574
|
-
this.registeredDirectives.forEach(function (dir) {
|
|
37575
|
-
dir.refreshVisibility();
|
|
37576
|
-
});
|
|
37577
|
-
};
|
|
37578
37412
|
ConditionalShowRegistrarService.prototype.reset = function () {
|
|
37579
37413
|
this.registeredDirectives = [];
|
|
37580
37414
|
};
|
|
@@ -89482,7 +89316,7 @@ module.exports = "<div class=\"form-group\" [id]=\"id()\">\n\n <div class=\"pan
|
|
|
89482
89316
|
/***/ 9643:
|
|
89483
89317
|
/***/ ((module) => {
|
|
89484
89318
|
|
|
89485
|
-
module.exports = "
|
|
89319
|
+
module.exports = "<div class=\"complex-panel\" [hidden]=\"caseField.hidden\">\n <dl class=\"complex-panel-title\">\n <dt><span class=\"text-16\">{{caseField.label}}</span></dt>\n <dd></dd>\n </dl>\n <table class=\"complex-panel-table\">\n <tbody>\n <!-- <COMPLEX table field header>-->\n <tr>\n <th *ngFor=\"let heading of columns\" scope=\"col\">\n <span class=\"text-16\">{{columnsAllLabels[heading].label}}</span>\n <a href=\"javascript:void(0)\"\n (click)=\"sortRowsByColumns(heading)\"\n class=\"sort-widget\"\n [innerHTML]=\"sortWidget(columnsAllLabels[heading])\"></a>\n </th>\n <th></th>\n </tr>\n <!-- </COMPLEX table field header>-->\n <ng-container *ngFor=\"let item of rows; let i = index;\">\n <!-- <COMPLEX table collapsed view>-->\n <tr class=\"new-table-row accordion-heading\" (click)=\"isHidden[i] = !isHidden[i]\"\n [class.last-accordion]=\"isHidden[i]\">\n <ng-container *ngFor=\"let heading of columns\">\n <td class=\"text-16\">\n <div *ngIf=\"item[heading]; else showEmptyTd\">\n <ccd-field-read\n [caseField]=\"toCaseField(heading, item[heading].label, columnsHorizontalLabel[heading].type, item[heading])\"\n [context]=\"context\"></ccd-field-read>\n </div>\n <ng-template #showEmptyTd>\n <div> </div>\n </ng-template>\n </td>\n </ng-container>\n <td>\n <div style=\"float: right;\">\n <a href=\"javascript:void(0)\"> <img src=\"{{ getImage(i) }}\" class=\"accordion-image\"/></a>\n </div>\n </td>\n </tr>\n <!-- </COMPLEX table collapsed view>-->\n <!-- <COMPLEX table expanded view>-->\n <tr [hidden]=\"isHidden[i]\">\n <td [colSpan]=\"columns.length + 1\">\n <table class=\"complex-panel-table\">\n <tbody>\n <ng-container\n *ngFor=\"let vLabel of columnsVerticalLabel | keyvalue: keepOriginalOrder | ccdCollectionTableCaseFieldsFilter: caseField: rows[i] | ccdReadFieldsFilter:true :undefined :true\">\n <!-- <COMPLEX table expandable body simple field>-->\n <tr class=\"complex-panel-simple-field accordion-body\" *ngIf=\"item[vLabel.id]\" [hidden]=\"vLabel.hidden\">\n <th scope=\"col\"><span class=\"text-16\">{{vLabel.label}}</span></th>\n <td *ngIf=\"vLabel['type'] !== 'Complex'\" class=\"text-16\">\n <ccd-field-read [caseField]=\"toCaseField('', vLabel.label, vLabel.field_type, item[vLabel.id])\"\n [context]=\"context\"></ccd-field-read>\n </td>\n </tr>\n <!-- </COMPLEX table expandable body simple field>-->\n\n <!-- <COMPLEX table expandable body complex field>-->\n <tr *ngIf=\"vLabel['type'] === 'Complex' && addCaseFieldValue(vLabel, item[vLabel.id])\" [hidden]=\"vLabel.hidden\">\n <td colspan=\"2\">\n <ng-container *ngFor=\"let caseField of vLabel | ccdReadFieldsFilter:true :undefined :true\">\n <tr class=\"complex-panel-compound-field\" *ngIf=\"(caseField | ccdIsCompound); else SimpleRow\" [hidden]=\"caseField\">\n <td colspan=\"2\">\n <span class=\"text-16\"><ccd-field-read [caseField]=\"caseField\" [context]=\"context\"></ccd-field-read></span>\n </td>\n </tr>\n <ng-template #SimpleRow>\n <tr class=\"complex-panel-nested-field\" [hidden]=\"caseField.hidden\">\n <th scope=\"col\"><span class=\"text-16\">{{caseField.label}}</span></th>\n <td *ngIf=\"!item[vLabel.id].hasOwnProperty('CaseReference')\">\n <span class=\"text-16\"><ccd-field-read [caseField]=\"caseField\" [context]=\"context\"></ccd-field-read></span>\n </td>\n <td *ngIf=\"item[vLabel.id].hasOwnProperty('CaseReference')\">\n <ccd-read-case-link-field [caseField]=\"addCaseReferenceValue(caseField, item[vLabel.id].CaseReference)\" [context]=\"context\"></ccd-read-case-link-field>\n </td>\n </tr>\n </ng-template>\n </ng-container>\n </td>\n </tr>\n <!-- <COMPLEX table expandable body complex field>-->\n </ng-container>\n </tbody>\n </table>\n </td>\n </tr>\n <!-- </COMPLEX table expanded view>-->\n </ng-container>\n </tbody>\n </table>\n</div>\n"
|
|
89486
89320
|
|
|
89487
89321
|
/***/ }),
|
|
89488
89322
|
|