@osovitny/anatoly 2.0.10 → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/osovitny-anatoly.umd.js +249 -253
- package/bundles/osovitny-anatoly.umd.js.map +1 -1
- package/bundles/osovitny-anatoly.umd.min.js +2 -2
- package/bundles/osovitny-anatoly.umd.min.js.map +1 -1
- package/esm2015/lib/core/consts/index.js +20 -0
- package/esm2015/lib/core/consts/settings.js +21 -0
- package/esm2015/lib/core/go/base-go.service.js +38 -0
- package/esm2015/lib/core/index.js +7 -5
- package/esm2015/lib/core/services/appcontext.service.js +4 -3
- package/esm2015/lib/ui/components/html-editor/base-html-editor.component.js +3 -2
- package/esm2015/lib/ui/index.js +3 -4
- package/esm2015/lib/ui/ui.module.js +3 -6
- package/fesm2015/osovitny-anatoly.js +252 -255
- package/fesm2015/osovitny-anatoly.js.map +1 -1
- package/lib/core/consts/index.d.ts +1 -0
- package/lib/core/consts/settings.d.ts +2 -0
- package/lib/core/index.d.ts +2 -1
- package/lib/ui/index.d.ts +1 -1
- package/package.json +1 -1
- package/esm2015/lib/core/services/base-go.service.js +0 -38
- package/esm2015/lib/ui/components/copy-2-clipboard/copy-2-clipboard.component.js +0 -45
- package/lib/ui/components/copy-2-clipboard/copy-2-clipboard.component.d.ts +0 -5
- /package/lib/core/{services → go}/base-go.service.d.ts +0 -0
|
@@ -262,6 +262,30 @@ class Guid {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
+
/*
|
|
266
|
+
<file>
|
|
267
|
+
Project:
|
|
268
|
+
@osovitny/anatoly
|
|
269
|
+
|
|
270
|
+
Authors:
|
|
271
|
+
Vadim Osovitny
|
|
272
|
+
Anatoly Osovitny
|
|
273
|
+
|
|
274
|
+
Created:
|
|
275
|
+
26 Jun 2020
|
|
276
|
+
|
|
277
|
+
Version:
|
|
278
|
+
1.0
|
|
279
|
+
|
|
280
|
+
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
281
|
+
</file>
|
|
282
|
+
*/
|
|
283
|
+
function throwIfAlreadyLoaded(parentModule, moduleName) {
|
|
284
|
+
if (parentModule) {
|
|
285
|
+
throw new Error(`${moduleName} has already been loaded. Import ${moduleName} modules in the AppModule only.`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
265
289
|
/*
|
|
266
290
|
<file>
|
|
267
291
|
Project:
|
|
@@ -298,6 +322,46 @@ BaseGoService.ctorParameters = () => [
|
|
|
298
322
|
{ type: Router }
|
|
299
323
|
];
|
|
300
324
|
|
|
325
|
+
/*
|
|
326
|
+
<file>
|
|
327
|
+
Project:
|
|
328
|
+
@osovitny/anatoly
|
|
329
|
+
|
|
330
|
+
Authors:
|
|
331
|
+
Vadim Osovitny
|
|
332
|
+
Anatoly Osovitny
|
|
333
|
+
|
|
334
|
+
Created:
|
|
335
|
+
26 Jun 2020
|
|
336
|
+
|
|
337
|
+
Version:
|
|
338
|
+
1.0
|
|
339
|
+
|
|
340
|
+
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
341
|
+
</file>
|
|
342
|
+
*/
|
|
343
|
+
const ContextInitState = JSON.parse((document.getElementById("contextInitState")).getAttribute("data-contextinitstate"));
|
|
344
|
+
const AppCoreSettings = JSON.parse((document.getElementById("appCoreSettings")).getAttribute("data-appcoresettings"));
|
|
345
|
+
|
|
346
|
+
/*
|
|
347
|
+
<file>
|
|
348
|
+
Project:
|
|
349
|
+
@osovitny/anatoly
|
|
350
|
+
|
|
351
|
+
Authors:
|
|
352
|
+
Vadim Osovitny
|
|
353
|
+
Anatoly Osovitny
|
|
354
|
+
|
|
355
|
+
Created:
|
|
356
|
+
26 Jun 2020
|
|
357
|
+
|
|
358
|
+
Version:
|
|
359
|
+
1.0
|
|
360
|
+
|
|
361
|
+
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
362
|
+
</file>
|
|
363
|
+
*/
|
|
364
|
+
|
|
301
365
|
/*
|
|
302
366
|
<file>
|
|
303
367
|
Project:
|
|
@@ -439,10 +503,10 @@ class AppContextService extends BaseApiService {
|
|
|
439
503
|
this.current = null;
|
|
440
504
|
}
|
|
441
505
|
isUserSignedIn() {
|
|
442
|
-
return
|
|
506
|
+
return ContextInitState.isUserSignedIn;
|
|
443
507
|
}
|
|
444
508
|
isUserAdmin() {
|
|
445
|
-
return
|
|
509
|
+
return ContextInitState.isUserAdmin;
|
|
446
510
|
}
|
|
447
511
|
}
|
|
448
512
|
AppContextService.decorators = [
|
|
@@ -523,30 +587,6 @@ GlobalErrorHandler.ctorParameters = () => [
|
|
|
523
587
|
{ type: Injector }
|
|
524
588
|
];
|
|
525
589
|
|
|
526
|
-
/*
|
|
527
|
-
<file>
|
|
528
|
-
Project:
|
|
529
|
-
@osovitny/anatoly
|
|
530
|
-
|
|
531
|
-
Authors:
|
|
532
|
-
Vadim Osovitny
|
|
533
|
-
Anatoly Osovitny
|
|
534
|
-
|
|
535
|
-
Created:
|
|
536
|
-
26 Jun 2020
|
|
537
|
-
|
|
538
|
-
Version:
|
|
539
|
-
1.0
|
|
540
|
-
|
|
541
|
-
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
542
|
-
</file>
|
|
543
|
-
*/
|
|
544
|
-
function throwIfAlreadyLoaded(parentModule, moduleName) {
|
|
545
|
-
if (parentModule) {
|
|
546
|
-
throw new Error(`${moduleName} has already been loaded. Import ${moduleName} modules in the AppModule only.`);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
590
|
const providers = [
|
|
551
591
|
LoggingService,
|
|
552
592
|
AppContextService,
|
|
@@ -574,7 +614,7 @@ AnatolyCoreModule.ctorParameters = () => [
|
|
|
574
614
|
<file>
|
|
575
615
|
Project:
|
|
576
616
|
@osovitny/anatoly
|
|
577
|
-
|
|
617
|
+
./go/base-go.service
|
|
578
618
|
Authors:
|
|
579
619
|
Vadim Osovitny
|
|
580
620
|
Anatoly Osovitny
|
|
@@ -826,6 +866,74 @@ AnatolyDataModule.decorators = [
|
|
|
826
866
|
</file>
|
|
827
867
|
*/
|
|
828
868
|
|
|
869
|
+
/*
|
|
870
|
+
<file>
|
|
871
|
+
Project:
|
|
872
|
+
@osovitny/anatoly
|
|
873
|
+
|
|
874
|
+
Authors:
|
|
875
|
+
Vadim Osovitny
|
|
876
|
+
Anatoly Osovitny
|
|
877
|
+
|
|
878
|
+
Created:
|
|
879
|
+
14 Aug 2018
|
|
880
|
+
|
|
881
|
+
Version:
|
|
882
|
+
1.0
|
|
883
|
+
|
|
884
|
+
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
885
|
+
</file>
|
|
886
|
+
*/
|
|
887
|
+
class BuyAccessButtonComponent {
|
|
888
|
+
constructor(appcontext, api) {
|
|
889
|
+
this.appcontext = appcontext;
|
|
890
|
+
this.api = api;
|
|
891
|
+
this.contextUpdated = false;
|
|
892
|
+
this.isUserSignedIn = false;
|
|
893
|
+
this.currentPlan = 0;
|
|
894
|
+
this.currentPlanTitle = "";
|
|
895
|
+
}
|
|
896
|
+
ngOnInit() {
|
|
897
|
+
if (!this.appcontext.isUserSignedIn()) {
|
|
898
|
+
this.contextUpdated = true;
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
this.appcontext.getCurrent((current) => {
|
|
902
|
+
this.isUserSignedIn = current.isUserSignedIn;
|
|
903
|
+
if (this.isUserSignedIn) {
|
|
904
|
+
this.currentPlan = current.account.billingPlan;
|
|
905
|
+
this.currentPlanTitle = current.account.billingPlanAsString;
|
|
906
|
+
}
|
|
907
|
+
this.contextUpdated = true;
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
onBuyPlan() {
|
|
911
|
+
const text = `Requested plan: ${this.plantitle} `;
|
|
912
|
+
const that = this;
|
|
913
|
+
Alerts.AreYouSure(text, "Buying access", "Confirm change", "Cancel", () => {
|
|
914
|
+
that.api.buyAccess(that.plan, () => {
|
|
915
|
+
Alerts.Success("Access Granted", null, () => {
|
|
916
|
+
window.location.reload();
|
|
917
|
+
});
|
|
918
|
+
});
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
BuyAccessButtonComponent.decorators = [
|
|
923
|
+
{ type: Component, args: [{
|
|
924
|
+
selector: "anatoly-buyaccess-button",
|
|
925
|
+
template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"plan != currentPlan && currentPlan == 1\" (click)=\"onBuyPlan()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n"
|
|
926
|
+
},] }
|
|
927
|
+
];
|
|
928
|
+
BuyAccessButtonComponent.ctorParameters = () => [
|
|
929
|
+
{ type: AppContextService },
|
|
930
|
+
{ type: BillingApiService }
|
|
931
|
+
];
|
|
932
|
+
BuyAccessButtonComponent.propDecorators = {
|
|
933
|
+
plan: [{ type: Input }],
|
|
934
|
+
plantitle: [{ type: Input }]
|
|
935
|
+
};
|
|
936
|
+
|
|
829
937
|
/*
|
|
830
938
|
<file>
|
|
831
939
|
Project:
|
|
@@ -945,7 +1053,7 @@ UpgradePlanButtonComponent.propDecorators = {
|
|
|
945
1053
|
Anatoly Osovitny
|
|
946
1054
|
|
|
947
1055
|
Created:
|
|
948
|
-
|
|
1056
|
+
4 Jul 2018
|
|
949
1057
|
|
|
950
1058
|
Version:
|
|
951
1059
|
1.0
|
|
@@ -953,54 +1061,18 @@ UpgradePlanButtonComponent.propDecorators = {
|
|
|
953
1061
|
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
954
1062
|
</file>
|
|
955
1063
|
*/
|
|
956
|
-
class
|
|
957
|
-
constructor(
|
|
958
|
-
this.appcontext = appcontext;
|
|
959
|
-
this.api = api;
|
|
960
|
-
this.contextUpdated = false;
|
|
961
|
-
this.isUserSignedIn = false;
|
|
962
|
-
this.currentPlan = 0;
|
|
963
|
-
this.currentPlanTitle = "";
|
|
964
|
-
}
|
|
965
|
-
ngOnInit() {
|
|
966
|
-
if (!this.appcontext.isUserSignedIn()) {
|
|
967
|
-
this.contextUpdated = true;
|
|
968
|
-
return;
|
|
969
|
-
}
|
|
970
|
-
this.appcontext.getCurrent((current) => {
|
|
971
|
-
this.isUserSignedIn = current.isUserSignedIn;
|
|
972
|
-
if (this.isUserSignedIn) {
|
|
973
|
-
this.currentPlan = current.account.billingPlan;
|
|
974
|
-
this.currentPlanTitle = current.account.billingPlanAsString;
|
|
975
|
-
}
|
|
976
|
-
this.contextUpdated = true;
|
|
977
|
-
});
|
|
978
|
-
}
|
|
979
|
-
onBuyPlan() {
|
|
980
|
-
const text = `Requested plan: ${this.plantitle} `;
|
|
981
|
-
const that = this;
|
|
982
|
-
Alerts.AreYouSure(text, "Buying access", "Confirm change", "Cancel", () => {
|
|
983
|
-
that.api.buyAccess(that.plan, () => {
|
|
984
|
-
Alerts.Success("Access Granted", null, () => {
|
|
985
|
-
window.location.reload();
|
|
986
|
-
});
|
|
987
|
-
});
|
|
988
|
-
});
|
|
989
|
-
}
|
|
1064
|
+
class SignInButtonComponent {
|
|
1065
|
+
constructor() { }
|
|
990
1066
|
}
|
|
991
|
-
|
|
1067
|
+
SignInButtonComponent.decorators = [
|
|
992
1068
|
{ type: Component, args: [{
|
|
993
|
-
selector: "anatoly-
|
|
994
|
-
template: "<
|
|
1069
|
+
selector: "anatoly-signin-button",
|
|
1070
|
+
template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
|
|
995
1071
|
},] }
|
|
996
1072
|
];
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
{ type:
|
|
1000
|
-
];
|
|
1001
|
-
BuyAccessButtonComponent.propDecorators = {
|
|
1002
|
-
plan: [{ type: Input }],
|
|
1003
|
-
plantitle: [{ type: Input }]
|
|
1073
|
+
SignInButtonComponent.ctorParameters = () => [];
|
|
1074
|
+
SignInButtonComponent.propDecorators = {
|
|
1075
|
+
classbtn: [{ type: Input }]
|
|
1004
1076
|
};
|
|
1005
1077
|
|
|
1006
1078
|
/*
|
|
@@ -1021,17 +1093,17 @@ BuyAccessButtonComponent.propDecorators = {
|
|
|
1021
1093
|
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
1022
1094
|
</file>
|
|
1023
1095
|
*/
|
|
1024
|
-
class
|
|
1096
|
+
class SignOutButtonComponent {
|
|
1025
1097
|
constructor() { }
|
|
1026
1098
|
}
|
|
1027
|
-
|
|
1099
|
+
SignOutButtonComponent.decorators = [
|
|
1028
1100
|
{ type: Component, args: [{
|
|
1029
|
-
selector: "anatoly-
|
|
1030
|
-
template: "<a href=\"identity/
|
|
1101
|
+
selector: "anatoly-signout-button",
|
|
1102
|
+
template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
|
|
1031
1103
|
},] }
|
|
1032
1104
|
];
|
|
1033
|
-
|
|
1034
|
-
|
|
1105
|
+
SignOutButtonComponent.ctorParameters = () => [];
|
|
1106
|
+
SignOutButtonComponent.propDecorators = {
|
|
1035
1107
|
classbtn: [{ type: Input }]
|
|
1036
1108
|
};
|
|
1037
1109
|
|
|
@@ -1075,7 +1147,7 @@ SignUpButtonComponent.propDecorators = {
|
|
|
1075
1147
|
Anatoly Osovitny
|
|
1076
1148
|
|
|
1077
1149
|
Created:
|
|
1078
|
-
|
|
1150
|
+
23 Apr 2018
|
|
1079
1151
|
|
|
1080
1152
|
Version:
|
|
1081
1153
|
1.0
|
|
@@ -1083,18 +1155,21 @@ SignUpButtonComponent.propDecorators = {
|
|
|
1083
1155
|
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
1084
1156
|
</file>
|
|
1085
1157
|
*/
|
|
1086
|
-
class
|
|
1087
|
-
|
|
1158
|
+
class ContentHeaderComponent {
|
|
1159
|
+
ngOnInit() {
|
|
1160
|
+
if (this.title == null) {
|
|
1161
|
+
this.title = "";
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1088
1164
|
}
|
|
1089
|
-
|
|
1165
|
+
ContentHeaderComponent.decorators = [
|
|
1090
1166
|
{ type: Component, args: [{
|
|
1091
|
-
selector: "anatoly-
|
|
1092
|
-
template: "<
|
|
1167
|
+
selector: "anatoly-content-header",
|
|
1168
|
+
template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
|
|
1093
1169
|
},] }
|
|
1094
1170
|
];
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
classbtn: [{ type: Input }]
|
|
1171
|
+
ContentHeaderComponent.propDecorators = {
|
|
1172
|
+
title: [{ type: Input }]
|
|
1098
1173
|
};
|
|
1099
1174
|
|
|
1100
1175
|
/*
|
|
@@ -1199,142 +1274,6 @@ BaseEditComponent.propDecorators = {
|
|
|
1199
1274
|
formSubmitted: [{ type: Input }]
|
|
1200
1275
|
};
|
|
1201
1276
|
|
|
1202
|
-
/*
|
|
1203
|
-
<file>
|
|
1204
|
-
Project:
|
|
1205
|
-
@osovitny/anatoly
|
|
1206
|
-
|
|
1207
|
-
Authors:
|
|
1208
|
-
Vadim Osovitny
|
|
1209
|
-
Anatoly Osovitny
|
|
1210
|
-
|
|
1211
|
-
Created:
|
|
1212
|
-
8 Dec 2017
|
|
1213
|
-
|
|
1214
|
-
Version:
|
|
1215
|
-
1.0
|
|
1216
|
-
|
|
1217
|
-
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
1218
|
-
</file>
|
|
1219
|
-
*/
|
|
1220
|
-
class ValidationSummaryComponent extends BaseEditComponent {
|
|
1221
|
-
constructor() {
|
|
1222
|
-
super();
|
|
1223
|
-
}
|
|
1224
|
-
getFormValidationMessages() {
|
|
1225
|
-
let messages = [];
|
|
1226
|
-
Object.keys(this.formGroup.controls).forEach((k) => {
|
|
1227
|
-
var control = this.formGroup.controls[k];
|
|
1228
|
-
if (control.controls != null) {
|
|
1229
|
-
Object.keys(control.controls).forEach((k) => {
|
|
1230
|
-
var child = control.controls[k];
|
|
1231
|
-
this.getValidationMessages(child, k).forEach((m) => messages.push(m));
|
|
1232
|
-
});
|
|
1233
|
-
}
|
|
1234
|
-
else {
|
|
1235
|
-
this.getValidationMessages(control, k).forEach((m) => messages.push(m));
|
|
1236
|
-
}
|
|
1237
|
-
});
|
|
1238
|
-
return messages;
|
|
1239
|
-
}
|
|
1240
|
-
getValidationMessages(state, thingName) {
|
|
1241
|
-
let thing = state.path || thingName;
|
|
1242
|
-
let messages = [];
|
|
1243
|
-
if (state.errors) {
|
|
1244
|
-
for (let errorName in state.errors) {
|
|
1245
|
-
if (state.errors.hasOwnProperty(errorName)) {
|
|
1246
|
-
switch (errorName) {
|
|
1247
|
-
case "required":
|
|
1248
|
-
messages.push(`${thing} is required`);
|
|
1249
|
-
break;
|
|
1250
|
-
case "minlength":
|
|
1251
|
-
messages.push(`${thing} must be at least ${state.errors["minlength"].requiredLength} characters`);
|
|
1252
|
-
break;
|
|
1253
|
-
case "pattern":
|
|
1254
|
-
messages.push(`${thing} contains illegal characters`);
|
|
1255
|
-
break;
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
}
|
|
1260
|
-
return messages;
|
|
1261
|
-
}
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1264
|
-
/*
|
|
1265
|
-
<file>
|
|
1266
|
-
Project:
|
|
1267
|
-
@osovitny/anatoly
|
|
1268
|
-
|
|
1269
|
-
Authors:
|
|
1270
|
-
Vadim Osovitny
|
|
1271
|
-
Anatoly Osovitny
|
|
1272
|
-
|
|
1273
|
-
Created:
|
|
1274
|
-
7 Dec 2017
|
|
1275
|
-
|
|
1276
|
-
Version:
|
|
1277
|
-
1.0
|
|
1278
|
-
|
|
1279
|
-
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
1280
|
-
</file>
|
|
1281
|
-
*/
|
|
1282
|
-
class FormValidationSummaryComponent extends ValidationSummaryComponent {
|
|
1283
|
-
constructor() {
|
|
1284
|
-
super();
|
|
1285
|
-
this.isVisible = false;
|
|
1286
|
-
}
|
|
1287
|
-
getErrors() {
|
|
1288
|
-
const messages = this.getFormValidationMessages();
|
|
1289
|
-
return messages;
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
FormValidationSummaryComponent.decorators = [
|
|
1293
|
-
{ type: Component, args: [{
|
|
1294
|
-
selector: "anatoly-form-validation-summary",
|
|
1295
|
-
template: "<div class=\"callout callout-danger\" *ngIf=\"isVisible\">\r\n <h4 class=\"box-title\">There are problems with the form</h4>\r\n <p *ngFor=\"let error of getErrors()\">\r\n <span class=\"help-block\" style=\"color: white;\">{{ error }}</span>\r\n </p>\r\n</div>\r\n"
|
|
1296
|
-
},] }
|
|
1297
|
-
];
|
|
1298
|
-
FormValidationSummaryComponent.ctorParameters = () => [];
|
|
1299
|
-
FormValidationSummaryComponent.propDecorators = {
|
|
1300
|
-
isVisible: [{ type: Input }]
|
|
1301
|
-
};
|
|
1302
|
-
|
|
1303
|
-
/*
|
|
1304
|
-
<file>
|
|
1305
|
-
Project:
|
|
1306
|
-
@osovitny/anatoly
|
|
1307
|
-
|
|
1308
|
-
Authors:
|
|
1309
|
-
Vadim Osovitny
|
|
1310
|
-
Anatoly Osovitny
|
|
1311
|
-
|
|
1312
|
-
Created:
|
|
1313
|
-
6 Dec 2017
|
|
1314
|
-
|
|
1315
|
-
Version:
|
|
1316
|
-
1.0
|
|
1317
|
-
|
|
1318
|
-
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
1319
|
-
</file>
|
|
1320
|
-
*/
|
|
1321
|
-
class ItemValidationSummaryComponent extends ValidationSummaryComponent {
|
|
1322
|
-
constructor() {
|
|
1323
|
-
super();
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
ItemValidationSummaryComponent.decorators = [
|
|
1327
|
-
{ type: Component, args: [{
|
|
1328
|
-
selector: "anatoly-item-validation-summary",
|
|
1329
|
-
template: "<ul class=\"list-unstyled\" *ngIf=\"isItemInvalid(controlName)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(controlName), controlTitle)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>\r\n"
|
|
1330
|
-
},] }
|
|
1331
|
-
];
|
|
1332
|
-
ItemValidationSummaryComponent.ctorParameters = () => [];
|
|
1333
|
-
ItemValidationSummaryComponent.propDecorators = {
|
|
1334
|
-
controlName: [{ type: Input }],
|
|
1335
|
-
controlTitle: [{ type: Input }]
|
|
1336
|
-
};
|
|
1337
|
-
|
|
1338
1277
|
/*
|
|
1339
1278
|
<file>
|
|
1340
1279
|
Project:
|
|
@@ -1457,7 +1396,7 @@ class BaseHtmlEditorComponent extends BaseEditComponent {
|
|
|
1457
1396
|
opt = JSON.parse(this.editorOptions);
|
|
1458
1397
|
}
|
|
1459
1398
|
let newOptions = $.extend({}, DefaultEditorOptions, opt);
|
|
1460
|
-
let key =
|
|
1399
|
+
let key = AppCoreSettings.froalaEditorKey;
|
|
1461
1400
|
if (key) {
|
|
1462
1401
|
newOptions = $.extend({}, newOptions, JSON.parse('{ "key": "' + key + '" }'));
|
|
1463
1402
|
}
|
|
@@ -1617,7 +1556,7 @@ FormsHtmlEditorComponent.propDecorators = {
|
|
|
1617
1556
|
Anatoly Osovitny
|
|
1618
1557
|
|
|
1619
1558
|
Created:
|
|
1620
|
-
|
|
1559
|
+
8 Dec 2017
|
|
1621
1560
|
|
|
1622
1561
|
Version:
|
|
1623
1562
|
1.0
|
|
@@ -1625,21 +1564,87 @@ FormsHtmlEditorComponent.propDecorators = {
|
|
|
1625
1564
|
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
1626
1565
|
</file>
|
|
1627
1566
|
*/
|
|
1628
|
-
class
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1567
|
+
class ValidationSummaryComponent extends BaseEditComponent {
|
|
1568
|
+
constructor() {
|
|
1569
|
+
super();
|
|
1570
|
+
}
|
|
1571
|
+
getFormValidationMessages() {
|
|
1572
|
+
let messages = [];
|
|
1573
|
+
Object.keys(this.formGroup.controls).forEach((k) => {
|
|
1574
|
+
var control = this.formGroup.controls[k];
|
|
1575
|
+
if (control.controls != null) {
|
|
1576
|
+
Object.keys(control.controls).forEach((k) => {
|
|
1577
|
+
var child = control.controls[k];
|
|
1578
|
+
this.getValidationMessages(child, k).forEach((m) => messages.push(m));
|
|
1579
|
+
});
|
|
1580
|
+
}
|
|
1581
|
+
else {
|
|
1582
|
+
this.getValidationMessages(control, k).forEach((m) => messages.push(m));
|
|
1583
|
+
}
|
|
1584
|
+
});
|
|
1585
|
+
return messages;
|
|
1586
|
+
}
|
|
1587
|
+
getValidationMessages(state, thingName) {
|
|
1588
|
+
let thing = state.path || thingName;
|
|
1589
|
+
let messages = [];
|
|
1590
|
+
if (state.errors) {
|
|
1591
|
+
for (let errorName in state.errors) {
|
|
1592
|
+
if (state.errors.hasOwnProperty(errorName)) {
|
|
1593
|
+
switch (errorName) {
|
|
1594
|
+
case "required":
|
|
1595
|
+
messages.push(`${thing} is required`);
|
|
1596
|
+
break;
|
|
1597
|
+
case "minlength":
|
|
1598
|
+
messages.push(`${thing} must be at least ${state.errors["minlength"].requiredLength} characters`);
|
|
1599
|
+
break;
|
|
1600
|
+
case "pattern":
|
|
1601
|
+
messages.push(`${thing} contains illegal characters`);
|
|
1602
|
+
break;
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1632
1606
|
}
|
|
1607
|
+
return messages;
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
/*
|
|
1612
|
+
<file>
|
|
1613
|
+
Project:
|
|
1614
|
+
@osovitny/anatoly
|
|
1615
|
+
|
|
1616
|
+
Authors:
|
|
1617
|
+
Vadim Osovitny
|
|
1618
|
+
Anatoly Osovitny
|
|
1619
|
+
|
|
1620
|
+
Created:
|
|
1621
|
+
7 Dec 2017
|
|
1622
|
+
|
|
1623
|
+
Version:
|
|
1624
|
+
1.0
|
|
1625
|
+
|
|
1626
|
+
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
1627
|
+
</file>
|
|
1628
|
+
*/
|
|
1629
|
+
class FormValidationSummaryComponent extends ValidationSummaryComponent {
|
|
1630
|
+
constructor() {
|
|
1631
|
+
super();
|
|
1632
|
+
this.isVisible = false;
|
|
1633
|
+
}
|
|
1634
|
+
getErrors() {
|
|
1635
|
+
const messages = this.getFormValidationMessages();
|
|
1636
|
+
return messages;
|
|
1633
1637
|
}
|
|
1634
1638
|
}
|
|
1635
|
-
|
|
1639
|
+
FormValidationSummaryComponent.decorators = [
|
|
1636
1640
|
{ type: Component, args: [{
|
|
1637
|
-
selector: "anatoly-
|
|
1638
|
-
template: "<
|
|
1641
|
+
selector: "anatoly-form-validation-summary",
|
|
1642
|
+
template: "<div class=\"callout callout-danger\" *ngIf=\"isVisible\">\r\n <h4 class=\"box-title\">There are problems with the form</h4>\r\n <p *ngFor=\"let error of getErrors()\">\r\n <span class=\"help-block\" style=\"color: white;\">{{ error }}</span>\r\n </p>\r\n</div>\r\n"
|
|
1639
1643
|
},] }
|
|
1640
1644
|
];
|
|
1641
|
-
|
|
1642
|
-
|
|
1645
|
+
FormValidationSummaryComponent.ctorParameters = () => [];
|
|
1646
|
+
FormValidationSummaryComponent.propDecorators = {
|
|
1647
|
+
isVisible: [{ type: Input }]
|
|
1643
1648
|
};
|
|
1644
1649
|
|
|
1645
1650
|
/*
|
|
@@ -1652,7 +1657,7 @@ ContentHeaderComponent.propDecorators = {
|
|
|
1652
1657
|
Anatoly Osovitny
|
|
1653
1658
|
|
|
1654
1659
|
Created:
|
|
1655
|
-
|
|
1660
|
+
6 Dec 2017
|
|
1656
1661
|
|
|
1657
1662
|
Version:
|
|
1658
1663
|
1.0
|
|
@@ -1660,27 +1665,21 @@ ContentHeaderComponent.propDecorators = {
|
|
|
1660
1665
|
Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
|
|
1661
1666
|
</file>
|
|
1662
1667
|
*/
|
|
1663
|
-
class
|
|
1668
|
+
class ItemValidationSummaryComponent extends ValidationSummaryComponent {
|
|
1664
1669
|
constructor() {
|
|
1665
|
-
|
|
1666
|
-
this.text = "";
|
|
1667
|
-
}
|
|
1668
|
-
onCopy2Clipboard(event) {
|
|
1669
|
-
this.tooltip = "Copied";
|
|
1670
|
-
setTimeout(() => {
|
|
1671
|
-
this.tooltip = "Copy to clipboard";
|
|
1672
|
-
}, 1000);
|
|
1673
|
-
Utils.copyToClipBoard(event, this.text);
|
|
1670
|
+
super();
|
|
1674
1671
|
}
|
|
1675
1672
|
}
|
|
1676
|
-
|
|
1673
|
+
ItemValidationSummaryComponent.decorators = [
|
|
1677
1674
|
{ type: Component, args: [{
|
|
1678
|
-
selector: "anatoly-
|
|
1679
|
-
template: "<
|
|
1675
|
+
selector: "anatoly-item-validation-summary",
|
|
1676
|
+
template: "<ul class=\"list-unstyled\" *ngIf=\"isItemInvalid(controlName)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(controlName), controlTitle)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>\r\n"
|
|
1680
1677
|
},] }
|
|
1681
1678
|
];
|
|
1682
|
-
|
|
1683
|
-
|
|
1679
|
+
ItemValidationSummaryComponent.ctorParameters = () => [];
|
|
1680
|
+
ItemValidationSummaryComponent.propDecorators = {
|
|
1681
|
+
controlName: [{ type: Input }],
|
|
1682
|
+
controlTitle: [{ type: Input }]
|
|
1684
1683
|
};
|
|
1685
1684
|
|
|
1686
1685
|
/*
|
|
@@ -1725,8 +1724,7 @@ AnatolyUIModule.decorators = [
|
|
|
1725
1724
|
ItemValidationSummaryComponent,
|
|
1726
1725
|
HtmlEditorComponent,
|
|
1727
1726
|
FormsHtmlEditorComponent,
|
|
1728
|
-
ContentHeaderComponent
|
|
1729
|
-
Copy2ClipboardComponent,
|
|
1727
|
+
ContentHeaderComponent
|
|
1730
1728
|
],
|
|
1731
1729
|
exports: [
|
|
1732
1730
|
SubscribePlanButtonComponent,
|
|
@@ -1739,8 +1737,7 @@ AnatolyUIModule.decorators = [
|
|
|
1739
1737
|
ItemValidationSummaryComponent,
|
|
1740
1738
|
HtmlEditorComponent,
|
|
1741
1739
|
FormsHtmlEditorComponent,
|
|
1742
|
-
ContentHeaderComponent
|
|
1743
|
-
Copy2ClipboardComponent,
|
|
1740
|
+
ContentHeaderComponent
|
|
1744
1741
|
],
|
|
1745
1742
|
},] }
|
|
1746
1743
|
];
|
|
@@ -1772,5 +1769,5 @@ AnatolyUIModule.decorators = [
|
|
|
1772
1769
|
* Generated bundle index. Do not edit.
|
|
1773
1770
|
*/
|
|
1774
1771
|
|
|
1775
|
-
export { Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyUIModule, AppContextService, BaseApiService, BaseComponent, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BillingApiService, BuyAccessButtonComponent, ContentHeaderComponent, FormValidationSummaryComponent, FormsHtmlEditorComponent, GlobalErrorHandler, Guid, HtmlEditorComponent, ItemValidationSummaryComponent, LoggingService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, Subs, SubscribePlanButtonComponent, UpgradePlanButtonComponent, Utils, ValidationSummaryComponent };
|
|
1772
|
+
export { Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyUIModule, AppContextService, BaseApiService, BaseComponent, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BillingApiService, BuyAccessButtonComponent, ContentHeaderComponent, FormValidationSummaryComponent, FormsHtmlEditorComponent, GlobalErrorHandler, Guid, HtmlEditorComponent, ItemValidationSummaryComponent, LoggingService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, Subs, SubscribePlanButtonComponent, UpgradePlanButtonComponent, Utils, ValidationSummaryComponent, throwIfAlreadyLoaded };
|
|
1776
1773
|
//# sourceMappingURL=osovitny-anatoly.js.map
|