@csmart/ngc-smart-victim 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- package/karma.conf.js +32 -0
- package/ng-package.json +7 -0
- package/package.json +13 -26
- package/src/lib/caseNote/caseNote.component.css +20 -0
- package/src/lib/caseNote/caseNote.component.html +188 -0
- package/src/lib/caseNote/caseNote.component.ts +248 -0
- package/src/lib/common-dialog/common-dialog.component.css +10 -0
- package/src/lib/common-dialog/common-dialog.component.html +23 -0
- package/src/lib/common-dialog/common-dialog.component.spec.ts +25 -0
- package/src/lib/common-dialog/common-dialog.component.ts +21 -0
- package/src/lib/common-dialog/common-dialog.module.ts +25 -0
- package/src/lib/common-dialog/common-dialog.service.ts +35 -0
- package/src/lib/contact/contact.component.css +20 -0
- package/src/lib/contact/contact.component.html +124 -0
- package/src/lib/contact/contact.component.ts +176 -0
- package/src/lib/intake.service.ts +82 -0
- package/src/lib/safetyPlan/serviceProvider.component.ts +94 -0
- package/src/lib/safetyPlan/victimSafetyPlan.component.css +27 -0
- package/src/lib/safetyPlan/victimSafetyPlan.component.html +85 -0
- package/src/lib/safetyPlan/victimSafetyPlan.component.ts +178 -0
- package/src/lib/safetyPlan/victimSafetyPlanDetail.component.html +234 -0
- package/src/lib/safetyPlan/victimSafetyPlanDetail.component.ts +492 -0
- package/src/lib/shared/app.shared.module.ts +118 -0
- package/src/lib/shared/directives/phone-mask.directive.ts +41 -0
- package/src/lib/shared/validators/date.validator.ts +73 -0
- package/src/lib/shared/validators/index.ts +1 -0
- package/src/lib/smart-victim-delete-confirm.component.ts +35 -0
- package/src/lib/smart-victim-detail/smart-victim-detail.component.css +43 -0
- package/src/lib/smart-victim-detail/smart-victim-detail.component.html +860 -0
- package/src/lib/smart-victim-detail/smart-victim-detail.component.spec.ts +25 -0
- package/src/lib/smart-victim-detail/smart-victim-detail.component.ts +1241 -0
- package/src/lib/smart-victim.component.css +192 -0
- package/src/lib/smart-victim.component.html +133 -0
- package/src/lib/smart-victim.component.spec.ts +25 -0
- package/src/lib/smart-victim.component.ts +323 -0
- package/src/lib/smart-victim.model.ts +301 -0
- package/src/lib/smart-victim.module.ts +116 -0
- package/src/lib/smart-victim.service.spec.ts +12 -0
- package/src/lib/smart-victim.service.ts +563 -0
- package/src/lib/victim-routing.module.ts +34 -0
- package/{lib/victimSearch/VictimSearchFilter.d.ts → src/lib/victimSearch/VictimSearchFilter.ts} +4 -2
- package/src/lib/victimSearch/victimSearchForm.component.html +35 -0
- package/src/lib/victimSearch/victimSearchForm.component.ts +41 -0
- package/src/public-api.ts +12 -0
- package/src/test.ts +22 -0
- package/tsconfig.lib.json +37 -0
- package/tsconfig.spec.json +17 -0
- package/tslint.json +17 -0
- package/bundles/csmart-ngc-smart-victim.umd.js +0 -6434
- package/bundles/csmart-ngc-smart-victim.umd.js.map +0 -1
- package/bundles/csmart-ngc-smart-victim.umd.min.js +0 -16
- package/bundles/csmart-ngc-smart-victim.umd.min.js.map +0 -1
- package/csmart-ngc-smart-victim.d.ts +0 -19
- package/csmart-ngc-smart-victim.metadata.json +0 -1
- package/esm2015/csmart-ngc-smart-victim.js +0 -25
- package/esm2015/lib/caseNote/caseNote.component.js +0 -349
- package/esm2015/lib/common-dialog/common-dialog.component.js +0 -46
- package/esm2015/lib/common-dialog/common-dialog.module.js +0 -32
- package/esm2015/lib/common-dialog/common-dialog.service.js +0 -63
- package/esm2015/lib/contact/contact.component.js +0 -232
- package/esm2015/lib/intake.service.js +0 -183
- package/esm2015/lib/safetyPlan/serviceProvider.component.js +0 -130
- package/esm2015/lib/safetyPlan/victimSafetyPlan.component.js +0 -257
- package/esm2015/lib/safetyPlan/victimSafetyPlanDetail.component.js +0 -556
- package/esm2015/lib/shared/app.shared.module.js +0 -81
- package/esm2015/lib/shared/directives/phone-mask.directive.js +0 -168
- package/esm2015/lib/shared/validators/date.validator.js +0 -108
- package/esm2015/lib/shared/validators/index.js +0 -7
- package/esm2015/lib/smart-victim-delete-confirm.component.js +0 -61
- package/esm2015/lib/smart-victim-detail/smart-victim-detail.component.js +0 -1410
- package/esm2015/lib/smart-victim.component.js +0 -476
- package/esm2015/lib/smart-victim.model.js +0 -631
- package/esm2015/lib/smart-victim.module.js +0 -84
- package/esm2015/lib/smart-victim.service.js +0 -792
- package/esm2015/lib/victim-routing.module.js +0 -40
- package/esm2015/lib/victimSearch/VictimSearchFilter.js +0 -20
- package/esm2015/lib/victimSearch/victimSearchForm.component.js +0 -59
- package/esm2015/public-api.js +0 -13
- package/esm5/csmart-ngc-smart-victim.js +0 -25
- package/esm5/lib/caseNote/caseNote.component.js +0 -372
- package/esm5/lib/common-dialog/common-dialog.component.js +0 -48
- package/esm5/lib/common-dialog/common-dialog.module.js +0 -36
- package/esm5/lib/common-dialog/common-dialog.service.js +0 -75
- package/esm5/lib/contact/contact.component.js +0 -285
- package/esm5/lib/intake.service.js +0 -194
- package/esm5/lib/safetyPlan/serviceProvider.component.js +0 -99
- package/esm5/lib/safetyPlan/victimSafetyPlan.component.js +0 -306
- package/esm5/lib/safetyPlan/victimSafetyPlanDetail.component.js +0 -628
- package/esm5/lib/shared/app.shared.module.js +0 -85
- package/esm5/lib/shared/directives/phone-mask.directive.js +0 -184
- package/esm5/lib/shared/validators/date.validator.js +0 -108
- package/esm5/lib/shared/validators/index.js +0 -7
- package/esm5/lib/smart-victim-delete-confirm.component.js +0 -51
- package/esm5/lib/smart-victim-detail/smart-victim-detail.component.js +0 -1502
- package/esm5/lib/smart-victim.component.js +0 -528
- package/esm5/lib/smart-victim.model.js +0 -541
- package/esm5/lib/smart-victim.module.js +0 -84
- package/esm5/lib/smart-victim.service.js +0 -1063
- package/esm5/lib/victim-routing.module.js +0 -44
- package/esm5/lib/victimSearch/VictimSearchFilter.js +0 -24
- package/esm5/lib/victimSearch/victimSearchForm.component.js +0 -70
- package/esm5/public-api.js +0 -13
- package/fesm2015/csmart-ngc-smart-victim.js +0 -5690
- package/fesm2015/csmart-ngc-smart-victim.js.map +0 -1
- package/fesm5/csmart-ngc-smart-victim.js +0 -6211
- package/fesm5/csmart-ngc-smart-victim.js.map +0 -1
- package/lib/caseNote/caseNote.component.d.ts +0 -45
- package/lib/common-dialog/common-dialog.component.d.ts +0 -11
- package/lib/common-dialog/common-dialog.module.d.ts +0 -2
- package/lib/common-dialog/common-dialog.service.d.ts +0 -8
- package/lib/contact/contact.component.d.ts +0 -37
- package/lib/intake.service.d.ts +0 -54
- package/lib/safetyPlan/serviceProvider.component.d.ts +0 -16
- package/lib/safetyPlan/victimSafetyPlan.component.d.ts +0 -49
- package/lib/safetyPlan/victimSafetyPlanDetail.component.d.ts +0 -57
- package/lib/shared/app.shared.module.d.ts +0 -2
- package/lib/shared/directives/phone-mask.directive.d.ts +0 -14
- package/lib/shared/validators/date.validator.d.ts +0 -9
- package/lib/shared/validators/index.d.ts +0 -1
- package/lib/smart-victim-delete-confirm.component.d.ts +0 -9
- package/lib/smart-victim-detail/smart-victim-detail.component.d.ts +0 -109
- package/lib/smart-victim.component.d.ts +0 -63
- package/lib/smart-victim.model.d.ts +0 -204
- package/lib/smart-victim.module.d.ts +0 -2
- package/lib/smart-victim.service.d.ts +0 -67
- package/lib/victim-routing.module.d.ts +0 -2
- package/lib/victimSearch/victimSearchForm.component.d.ts +0 -11
- package/public-api.d.ts +0 -4
@@ -0,0 +1,73 @@
|
|
1
|
+
import { AbstractControl, ValidatorFn } from '@angular/forms';
|
2
|
+
|
3
|
+
|
4
|
+
export function dateValidator(): ValidatorFn {
|
5
|
+
return (control: AbstractControl): {[key: string]: any} => {
|
6
|
+
const dateStr = control.value;
|
7
|
+
const invalidObj = { 'date': 'future Date is Not Allowed' };
|
8
|
+
const date = new Date(dateStr);
|
9
|
+
if (date > new Date()) {
|
10
|
+
return invalidObj;
|
11
|
+
}
|
12
|
+
return null;
|
13
|
+
};
|
14
|
+
}
|
15
|
+
|
16
|
+
|
17
|
+
export function passDateValidator(): ValidatorFn {
|
18
|
+
return (control: AbstractControl): {[key: string]: any} => {
|
19
|
+
const dateStr = control.value;
|
20
|
+
const invalidObj = { 'date': 'Pass Date is Not Allowed' };
|
21
|
+
const date = new Date(dateStr);
|
22
|
+
if (date < new Date()) {
|
23
|
+
return invalidObj;
|
24
|
+
}
|
25
|
+
return null;
|
26
|
+
};
|
27
|
+
}
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
export function dateLessThan(dateField1: string, dateField2: string, validatorField: { [key: string]: boolean }): ValidatorFn {
|
32
|
+
return (c: AbstractControl): { [key: string]: any } | null => {
|
33
|
+
const date1 = c.get(dateField1).value;
|
34
|
+
const date2 = c.get(dateField2).value;
|
35
|
+
|
36
|
+
console.log('date1');
|
37
|
+
console.log(date1);
|
38
|
+
console.log('date2');
|
39
|
+
console.log(date2);
|
40
|
+
//const invalidObj = { 'dateRule': 'date is Not Allowed' };
|
41
|
+
if ((date1 !== null && date2 !== null) && date1 > date2) {
|
42
|
+
console.log(validatorField);
|
43
|
+
return validatorField;
|
44
|
+
//return invalidObj;
|
45
|
+
|
46
|
+
}
|
47
|
+
console.log('return null');
|
48
|
+
return null;
|
49
|
+
};
|
50
|
+
}
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
export function greaterLessThan(dateField1: string, dateField2: string, validatorField: { [key: string]: boolean }): ValidatorFn {
|
55
|
+
return (c: AbstractControl): { [key: string]: any } | null => {
|
56
|
+
const date1 = c.get(dateField1).value;
|
57
|
+
const date2 = c.get(dateField2).value;
|
58
|
+
|
59
|
+
console.log('end date');
|
60
|
+
console.log(date1);
|
61
|
+
console.log('ver date');
|
62
|
+
console.log(date2);
|
63
|
+
//const invalidObj = { 'dateRule': 'date is Not Allowed' };
|
64
|
+
if ((date1 !== null && date2 !== null) && date1 < date2) {
|
65
|
+
console.log(validatorField);
|
66
|
+
return validatorField;
|
67
|
+
//return invalidObj;
|
68
|
+
|
69
|
+
}
|
70
|
+
console.log('return null');
|
71
|
+
return null;
|
72
|
+
};
|
73
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './date.validator';
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { Component, OnInit, Inject } from '@angular/core';
|
2
|
+
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
|
3
|
+
|
4
|
+
@Component({
|
5
|
+
selector: 'csmart-victim-delete-confirm',
|
6
|
+
template: `
|
7
|
+
<h1 mat-dialog-title>Delete Confirmation</h1>
|
8
|
+
<div mat-dialog-content>
|
9
|
+
<p>Are you sure you want to delete this item?</p>
|
10
|
+
</div>
|
11
|
+
<div mat-dialog-actions class="actions">
|
12
|
+
<button mat-flat-button color="primary" (click)="onNoClick()">No</button>
|
13
|
+
<button mat-flat-button color="warn" [mat-dialog-close]='"YES"' cdkFocusInitial>Yes</button>
|
14
|
+
</div>
|
15
|
+
`,
|
16
|
+
styles: [`
|
17
|
+
.actions{
|
18
|
+
display: flex;
|
19
|
+
justify-content: space-between;
|
20
|
+
}
|
21
|
+
`]
|
22
|
+
})
|
23
|
+
export class SmartVictimDeleteConfirmComponent implements OnInit {
|
24
|
+
|
25
|
+
constructor( public dialogRef: MatDialogRef<SmartVictimDeleteConfirmComponent>,
|
26
|
+
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
27
|
+
|
28
|
+
onNoClick(): void {
|
29
|
+
this.dialogRef.close();
|
30
|
+
}
|
31
|
+
|
32
|
+
ngOnInit() {
|
33
|
+
}
|
34
|
+
|
35
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
|
2
|
+
mat-form-field {
|
3
|
+
width: 100%;
|
4
|
+
}
|
5
|
+
.container{
|
6
|
+
margin: 16px;
|
7
|
+
display: grid;
|
8
|
+
grid-template-columns: repeat(2, 1fr);
|
9
|
+
grid-gap: 10px;
|
10
|
+
grid-auto-rows: minmax(50px, auto);
|
11
|
+
justify-items: stretch;
|
12
|
+
}
|
13
|
+
|
14
|
+
|
15
|
+
@media only screen and (max-width: 1120px) {
|
16
|
+
.container{
|
17
|
+
display: grid;
|
18
|
+
grid-template-columns: 1fr 1fr;
|
19
|
+
grid-row-gap: 15px;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
@media only screen and (max-width: 675px) {
|
24
|
+
.container{
|
25
|
+
display: flex;
|
26
|
+
flex-direction: column;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
#outer
|
31
|
+
{
|
32
|
+
width:100%;
|
33
|
+
text-align: center;
|
34
|
+
}
|
35
|
+
.inner
|
36
|
+
{
|
37
|
+
display: inline-block;
|
38
|
+
}
|
39
|
+
.tp-radio-group {
|
40
|
+
display:flex ;
|
41
|
+
justify-content: space-between;
|
42
|
+
}
|
43
|
+
|