@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.
Files changed (128) hide show
  1. package/karma.conf.js +32 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +13 -26
  4. package/src/lib/caseNote/caseNote.component.css +20 -0
  5. package/src/lib/caseNote/caseNote.component.html +188 -0
  6. package/src/lib/caseNote/caseNote.component.ts +248 -0
  7. package/src/lib/common-dialog/common-dialog.component.css +10 -0
  8. package/src/lib/common-dialog/common-dialog.component.html +23 -0
  9. package/src/lib/common-dialog/common-dialog.component.spec.ts +25 -0
  10. package/src/lib/common-dialog/common-dialog.component.ts +21 -0
  11. package/src/lib/common-dialog/common-dialog.module.ts +25 -0
  12. package/src/lib/common-dialog/common-dialog.service.ts +35 -0
  13. package/src/lib/contact/contact.component.css +20 -0
  14. package/src/lib/contact/contact.component.html +124 -0
  15. package/src/lib/contact/contact.component.ts +176 -0
  16. package/src/lib/intake.service.ts +82 -0
  17. package/src/lib/safetyPlan/serviceProvider.component.ts +94 -0
  18. package/src/lib/safetyPlan/victimSafetyPlan.component.css +27 -0
  19. package/src/lib/safetyPlan/victimSafetyPlan.component.html +85 -0
  20. package/src/lib/safetyPlan/victimSafetyPlan.component.ts +178 -0
  21. package/src/lib/safetyPlan/victimSafetyPlanDetail.component.html +234 -0
  22. package/src/lib/safetyPlan/victimSafetyPlanDetail.component.ts +492 -0
  23. package/src/lib/shared/app.shared.module.ts +118 -0
  24. package/src/lib/shared/directives/phone-mask.directive.ts +41 -0
  25. package/src/lib/shared/validators/date.validator.ts +73 -0
  26. package/src/lib/shared/validators/index.ts +1 -0
  27. package/src/lib/smart-victim-delete-confirm.component.ts +35 -0
  28. package/src/lib/smart-victim-detail/smart-victim-detail.component.css +43 -0
  29. package/src/lib/smart-victim-detail/smart-victim-detail.component.html +860 -0
  30. package/src/lib/smart-victim-detail/smart-victim-detail.component.spec.ts +25 -0
  31. package/src/lib/smart-victim-detail/smart-victim-detail.component.ts +1241 -0
  32. package/src/lib/smart-victim.component.css +192 -0
  33. package/src/lib/smart-victim.component.html +133 -0
  34. package/src/lib/smart-victim.component.spec.ts +25 -0
  35. package/src/lib/smart-victim.component.ts +323 -0
  36. package/src/lib/smart-victim.model.ts +301 -0
  37. package/src/lib/smart-victim.module.ts +116 -0
  38. package/src/lib/smart-victim.service.spec.ts +12 -0
  39. package/src/lib/smart-victim.service.ts +563 -0
  40. package/src/lib/victim-routing.module.ts +34 -0
  41. package/{lib/victimSearch/VictimSearchFilter.d.ts → src/lib/victimSearch/VictimSearchFilter.ts} +4 -2
  42. package/src/lib/victimSearch/victimSearchForm.component.html +35 -0
  43. package/src/lib/victimSearch/victimSearchForm.component.ts +41 -0
  44. package/src/public-api.ts +12 -0
  45. package/src/test.ts +22 -0
  46. package/tsconfig.lib.json +37 -0
  47. package/tsconfig.spec.json +17 -0
  48. package/tslint.json +17 -0
  49. package/bundles/csmart-ngc-smart-victim.umd.js +0 -6434
  50. package/bundles/csmart-ngc-smart-victim.umd.js.map +0 -1
  51. package/bundles/csmart-ngc-smart-victim.umd.min.js +0 -16
  52. package/bundles/csmart-ngc-smart-victim.umd.min.js.map +0 -1
  53. package/csmart-ngc-smart-victim.d.ts +0 -19
  54. package/csmart-ngc-smart-victim.metadata.json +0 -1
  55. package/esm2015/csmart-ngc-smart-victim.js +0 -25
  56. package/esm2015/lib/caseNote/caseNote.component.js +0 -349
  57. package/esm2015/lib/common-dialog/common-dialog.component.js +0 -46
  58. package/esm2015/lib/common-dialog/common-dialog.module.js +0 -32
  59. package/esm2015/lib/common-dialog/common-dialog.service.js +0 -63
  60. package/esm2015/lib/contact/contact.component.js +0 -232
  61. package/esm2015/lib/intake.service.js +0 -183
  62. package/esm2015/lib/safetyPlan/serviceProvider.component.js +0 -130
  63. package/esm2015/lib/safetyPlan/victimSafetyPlan.component.js +0 -257
  64. package/esm2015/lib/safetyPlan/victimSafetyPlanDetail.component.js +0 -556
  65. package/esm2015/lib/shared/app.shared.module.js +0 -81
  66. package/esm2015/lib/shared/directives/phone-mask.directive.js +0 -168
  67. package/esm2015/lib/shared/validators/date.validator.js +0 -108
  68. package/esm2015/lib/shared/validators/index.js +0 -7
  69. package/esm2015/lib/smart-victim-delete-confirm.component.js +0 -61
  70. package/esm2015/lib/smart-victim-detail/smart-victim-detail.component.js +0 -1410
  71. package/esm2015/lib/smart-victim.component.js +0 -476
  72. package/esm2015/lib/smart-victim.model.js +0 -631
  73. package/esm2015/lib/smart-victim.module.js +0 -84
  74. package/esm2015/lib/smart-victim.service.js +0 -792
  75. package/esm2015/lib/victim-routing.module.js +0 -40
  76. package/esm2015/lib/victimSearch/VictimSearchFilter.js +0 -20
  77. package/esm2015/lib/victimSearch/victimSearchForm.component.js +0 -59
  78. package/esm2015/public-api.js +0 -13
  79. package/esm5/csmart-ngc-smart-victim.js +0 -25
  80. package/esm5/lib/caseNote/caseNote.component.js +0 -372
  81. package/esm5/lib/common-dialog/common-dialog.component.js +0 -48
  82. package/esm5/lib/common-dialog/common-dialog.module.js +0 -36
  83. package/esm5/lib/common-dialog/common-dialog.service.js +0 -75
  84. package/esm5/lib/contact/contact.component.js +0 -285
  85. package/esm5/lib/intake.service.js +0 -194
  86. package/esm5/lib/safetyPlan/serviceProvider.component.js +0 -99
  87. package/esm5/lib/safetyPlan/victimSafetyPlan.component.js +0 -306
  88. package/esm5/lib/safetyPlan/victimSafetyPlanDetail.component.js +0 -628
  89. package/esm5/lib/shared/app.shared.module.js +0 -85
  90. package/esm5/lib/shared/directives/phone-mask.directive.js +0 -184
  91. package/esm5/lib/shared/validators/date.validator.js +0 -108
  92. package/esm5/lib/shared/validators/index.js +0 -7
  93. package/esm5/lib/smart-victim-delete-confirm.component.js +0 -51
  94. package/esm5/lib/smart-victim-detail/smart-victim-detail.component.js +0 -1502
  95. package/esm5/lib/smart-victim.component.js +0 -528
  96. package/esm5/lib/smart-victim.model.js +0 -541
  97. package/esm5/lib/smart-victim.module.js +0 -84
  98. package/esm5/lib/smart-victim.service.js +0 -1063
  99. package/esm5/lib/victim-routing.module.js +0 -44
  100. package/esm5/lib/victimSearch/VictimSearchFilter.js +0 -24
  101. package/esm5/lib/victimSearch/victimSearchForm.component.js +0 -70
  102. package/esm5/public-api.js +0 -13
  103. package/fesm2015/csmart-ngc-smart-victim.js +0 -5690
  104. package/fesm2015/csmart-ngc-smart-victim.js.map +0 -1
  105. package/fesm5/csmart-ngc-smart-victim.js +0 -6211
  106. package/fesm5/csmart-ngc-smart-victim.js.map +0 -1
  107. package/lib/caseNote/caseNote.component.d.ts +0 -45
  108. package/lib/common-dialog/common-dialog.component.d.ts +0 -11
  109. package/lib/common-dialog/common-dialog.module.d.ts +0 -2
  110. package/lib/common-dialog/common-dialog.service.d.ts +0 -8
  111. package/lib/contact/contact.component.d.ts +0 -37
  112. package/lib/intake.service.d.ts +0 -54
  113. package/lib/safetyPlan/serviceProvider.component.d.ts +0 -16
  114. package/lib/safetyPlan/victimSafetyPlan.component.d.ts +0 -49
  115. package/lib/safetyPlan/victimSafetyPlanDetail.component.d.ts +0 -57
  116. package/lib/shared/app.shared.module.d.ts +0 -2
  117. package/lib/shared/directives/phone-mask.directive.d.ts +0 -14
  118. package/lib/shared/validators/date.validator.d.ts +0 -9
  119. package/lib/shared/validators/index.d.ts +0 -1
  120. package/lib/smart-victim-delete-confirm.component.d.ts +0 -9
  121. package/lib/smart-victim-detail/smart-victim-detail.component.d.ts +0 -109
  122. package/lib/smart-victim.component.d.ts +0 -63
  123. package/lib/smart-victim.model.d.ts +0 -204
  124. package/lib/smart-victim.module.d.ts +0 -2
  125. package/lib/smart-victim.service.d.ts +0 -67
  126. package/lib/victim-routing.module.d.ts +0 -2
  127. package/lib/victimSearch/victimSearchForm.component.d.ts +0 -11
  128. 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
+