@osovitny/anatoly 2.1.1 → 2.1.2

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.
@@ -98,9 +98,10 @@
98
98
  function BaseGoService(route, router) {
99
99
  this.route = route;
100
100
  this.router = router;
101
+ this.route = route;
102
+ this.router = router;
101
103
  }
102
104
  BaseGoService.prototype.locationReload = function () {
103
- // this.router.navigate([this.route.url]);
104
105
  window.location.reload();
105
106
  };
106
107
  BaseGoService.prototype.homeReload = function () {
@@ -2252,6 +2253,202 @@
2252
2253
  { type: AnatolyDataModule, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] }
2253
2254
  ]; };
2254
2255
 
2256
+ /*
2257
+ <file>
2258
+ Project:
2259
+ @osovitny/anatoly
2260
+
2261
+ Authors:
2262
+ Vadim Osovitny
2263
+ Anatoly Osovitny
2264
+
2265
+ Created:
2266
+ 28 Aug 2018
2267
+
2268
+ Version:
2269
+ 1.0
2270
+
2271
+ Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
2272
+ </file>
2273
+ */
2274
+ var BaseComponent = /** @class */ (function () {
2275
+ function BaseComponent() {
2276
+ this.subs = new Subs();
2277
+ }
2278
+ BaseComponent.prototype.getQSId = function () {
2279
+ var id = Utils.getValueByNameInQS("id");
2280
+ if (typeof id === "undefined" || id == "")
2281
+ return null;
2282
+ return id;
2283
+ };
2284
+ BaseComponent.prototype.ngOnDestroy = function () {
2285
+ this.subs.unsubscribe();
2286
+ };
2287
+ return BaseComponent;
2288
+ }());
2289
+ BaseComponent.decorators = [
2290
+ { type: i0.Component, args: [{
2291
+ template: ''
2292
+ },] }
2293
+ ];
2294
+
2295
+ var BaseEditComponent = /** @class */ (function (_super) {
2296
+ __extends(BaseEditComponent, _super);
2297
+ function BaseEditComponent() {
2298
+ var _this = _super.call(this) || this;
2299
+ _this.formSubmitted = false;
2300
+ return _this;
2301
+ }
2302
+ BaseEditComponent.prototype.isActionAdding = function () {
2303
+ var id = Utils.getValueByNameInQS("id");
2304
+ if (typeof id === "undefined" || id == "")
2305
+ return true;
2306
+ return false;
2307
+ };
2308
+ BaseEditComponent.prototype.getEntityId = function () {
2309
+ return this.getQSId();
2310
+ };
2311
+ BaseEditComponent.prototype.isControlValid = function (name, frmGroup) {
2312
+ if (frmGroup === void 0) { frmGroup = null; }
2313
+ return !this.isControlInvalid(name, frmGroup);
2314
+ };
2315
+ BaseEditComponent.prototype.isControlInvalid = function (name, frmGroup) {
2316
+ if (frmGroup === void 0) { frmGroup = null; }
2317
+ if (typeof name === "undefined" || name == "") {
2318
+ return false;
2319
+ }
2320
+ var fg = frmGroup ? frmGroup : this.formGroup;
2321
+ if (!fg) {
2322
+ return false;
2323
+ }
2324
+ if (fg.get(name)) {
2325
+ return ((this.formSubmitted && fg.get(name).invalid) ||
2326
+ (fg.get(name).touched && fg.get(name).invalid));
2327
+ }
2328
+ return false;
2329
+ };
2330
+ //FormGroup functions
2331
+ BaseEditComponent.prototype.getFormValue = function (name, frmGroup) {
2332
+ if (frmGroup === void 0) { frmGroup = null; }
2333
+ var fg = frmGroup ? frmGroup : this.formGroup;
2334
+ return fg.controls[name].value;
2335
+ };
2336
+ BaseEditComponent.prototype.setFormValue = function (name, value, frmGroup) {
2337
+ if (frmGroup === void 0) { frmGroup = null; }
2338
+ var fg = frmGroup ? frmGroup : this.formGroup;
2339
+ fg.controls[name].setValue(value);
2340
+ };
2341
+ BaseEditComponent.prototype.getFormGroupValue = function (groupName, name, frmGroup) {
2342
+ if (frmGroup === void 0) { frmGroup = null; }
2343
+ var fg = frmGroup ? frmGroup : this.formGroup;
2344
+ return fg.controls[groupName].get(name).value;
2345
+ };
2346
+ BaseEditComponent.prototype.setFormGroupValue = function (groupName, name, value, frmGroup) {
2347
+ if (frmGroup === void 0) { frmGroup = null; }
2348
+ var fg = frmGroup ? frmGroup : this.formGroup;
2349
+ fg.controls[groupName].get(name).setValue(value);
2350
+ };
2351
+ /**
2352
+ * Add control to form group
2353
+ * @param name
2354
+ * @param formControl
2355
+ * @param formGroup
2356
+ */
2357
+ BaseEditComponent.prototype.addControl = function (name, formControl, frmGroup) {
2358
+ if (frmGroup === void 0) { frmGroup = null; }
2359
+ var fg = frmGroup ? frmGroup : this.formGroup;
2360
+ fg.addControl(name, formControl);
2361
+ };
2362
+ /**
2363
+ * Removes control from form group
2364
+ * @param name
2365
+ * @param formGroup
2366
+ */
2367
+ BaseEditComponent.prototype.removeControl = function (name, frmGroup) {
2368
+ if (frmGroup === void 0) { frmGroup = null; }
2369
+ var fg = frmGroup ? frmGroup : this.formGroup;
2370
+ if (fg.get(name)) {
2371
+ fg.removeControl(name);
2372
+ }
2373
+ };
2374
+ /**
2375
+ * return new form control
2376
+ * @param formState
2377
+ * @param validatorOrOpts
2378
+ * @param asyncValidator
2379
+ */
2380
+ BaseEditComponent.prototype.createFormControl = function (formState, validatorOrOpts, asyncValidator) {
2381
+ return new forms.FormControl(formState, validatorOrOpts, asyncValidator);
2382
+ };
2383
+ /**
2384
+ * Set error to control
2385
+ * @param controlName formControl name
2386
+ * @param err error expect {erroname: boolean} format
2387
+ * @param formGroup Specific form group. default it will apply on this.formGroup property
2388
+ */
2389
+ BaseEditComponent.prototype.setControlError = function (controlName, err, frmGroup) {
2390
+ if (frmGroup === void 0) { frmGroup = null; }
2391
+ var _a;
2392
+ var fg = frmGroup ? frmGroup : this.formGroup;
2393
+ (_a = fg.get(controlName)) === null || _a === void 0 ? void 0 : _a.setErrors(err);
2394
+ };
2395
+ /**
2396
+ * Set {invalid: true} for the specified form
2397
+ * @param controlName form control name
2398
+ * @param formGroup
2399
+ */
2400
+ BaseEditComponent.prototype.setInValidError = function (controlName, frmGroup) {
2401
+ if (frmGroup === void 0) { frmGroup = null; }
2402
+ var _a;
2403
+ var fg = frmGroup ? frmGroup : this.formGroup;
2404
+ (_a = fg.get(controlName)) === null || _a === void 0 ? void 0 : _a.setErrors({ invalid: true });
2405
+ };
2406
+ Object.defineProperty(BaseEditComponent.prototype, "fc", {
2407
+ /**
2408
+ * returns formgroup controls.
2409
+ * main use case is used in html pages
2410
+ */
2411
+ get: function () {
2412
+ return this.formGroup.controls;
2413
+ },
2414
+ enumerable: false,
2415
+ configurable: true
2416
+ });
2417
+ return BaseEditComponent;
2418
+ }(BaseComponent));
2419
+ BaseEditComponent.decorators = [
2420
+ { type: i0.Component, args: [{
2421
+ template: ''
2422
+ },] }
2423
+ ];
2424
+ BaseEditComponent.ctorParameters = function () { return []; };
2425
+ BaseEditComponent.propDecorators = {
2426
+ formGroup: [{ type: i0.Input }],
2427
+ formSubmitted: [{ type: i0.Input }]
2428
+ };
2429
+
2430
+ var BaseDialogComponent = /** @class */ (function (_super) {
2431
+ __extends(BaseDialogComponent, _super);
2432
+ function BaseDialogComponent() {
2433
+ var _this = _super.call(this) || this;
2434
+ _this.opened = false;
2435
+ return _this;
2436
+ }
2437
+ BaseDialogComponent.prototype.show = function () {
2438
+ this.opened = true;
2439
+ };
2440
+ BaseDialogComponent.prototype.hide = function () {
2441
+ this.opened = false;
2442
+ };
2443
+ return BaseDialogComponent;
2444
+ }(BaseEditComponent));
2445
+ BaseDialogComponent.decorators = [
2446
+ { type: i0.Component, args: [{
2447
+ template: ''
2448
+ },] }
2449
+ ];
2450
+ BaseDialogComponent.ctorParameters = function () { return []; };
2451
+
2255
2452
  /*
2256
2453
  <file>
2257
2454
  Project:
@@ -2561,180 +2758,6 @@
2561
2758
  imageUploadParams: { uploadType: "", uploadParentId: "" },
2562
2759
  };
2563
2760
 
2564
- /*
2565
- <file>
2566
- Project:
2567
- @osovitny/anatoly
2568
-
2569
- Authors:
2570
- Vadim Osovitny
2571
- Anatoly Osovitny
2572
-
2573
- Created:
2574
- 28 Aug 2018
2575
-
2576
- Version:
2577
- 1.0
2578
-
2579
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
2580
- </file>
2581
- */
2582
- var BaseComponent = /** @class */ (function () {
2583
- function BaseComponent() {
2584
- this.subs = new Subs();
2585
- }
2586
- BaseComponent.prototype.getQSId = function () {
2587
- var id = Utils.getValueByNameInQS("id");
2588
- if (typeof id === "undefined" || id == "")
2589
- return null;
2590
- return id;
2591
- };
2592
- BaseComponent.prototype.ngOnDestroy = function () {
2593
- this.subs.unsubscribe();
2594
- };
2595
- return BaseComponent;
2596
- }());
2597
- BaseComponent.decorators = [
2598
- { type: i0.Component, args: [{
2599
- template: ''
2600
- },] }
2601
- ];
2602
-
2603
- var BaseEditComponent = /** @class */ (function (_super) {
2604
- __extends(BaseEditComponent, _super);
2605
- function BaseEditComponent() {
2606
- var _this = _super.call(this) || this;
2607
- _this.formSubmitted = false;
2608
- return _this;
2609
- }
2610
- BaseEditComponent.prototype.isActionAdding = function () {
2611
- var id = Utils.getValueByNameInQS("id");
2612
- if (typeof id === "undefined" || id == "")
2613
- return true;
2614
- return false;
2615
- };
2616
- BaseEditComponent.prototype.getEntityId = function () {
2617
- return this.getQSId();
2618
- };
2619
- BaseEditComponent.prototype.isControlValid = function (name, frmGroup) {
2620
- if (frmGroup === void 0) { frmGroup = null; }
2621
- return !this.isControlInvalid(name, frmGroup);
2622
- };
2623
- BaseEditComponent.prototype.isControlInvalid = function (name, frmGroup) {
2624
- if (frmGroup === void 0) { frmGroup = null; }
2625
- if (typeof name === "undefined" || name == "") {
2626
- return false;
2627
- }
2628
- var fg = frmGroup ? frmGroup : this.formGroup;
2629
- if (!fg) {
2630
- return false;
2631
- }
2632
- if (fg.get(name)) {
2633
- return ((this.formSubmitted && fg.get(name).invalid) ||
2634
- (fg.get(name).touched && fg.get(name).invalid));
2635
- }
2636
- return false;
2637
- };
2638
- //FormGroup functions
2639
- BaseEditComponent.prototype.getFormValue = function (name, frmGroup) {
2640
- if (frmGroup === void 0) { frmGroup = null; }
2641
- var fg = frmGroup ? frmGroup : this.formGroup;
2642
- return fg.controls[name].value;
2643
- };
2644
- BaseEditComponent.prototype.setFormValue = function (name, value, frmGroup) {
2645
- if (frmGroup === void 0) { frmGroup = null; }
2646
- var fg = frmGroup ? frmGroup : this.formGroup;
2647
- fg.controls[name].setValue(value);
2648
- };
2649
- BaseEditComponent.prototype.getFormGroupValue = function (groupName, name, frmGroup) {
2650
- if (frmGroup === void 0) { frmGroup = null; }
2651
- var fg = frmGroup ? frmGroup : this.formGroup;
2652
- return fg.controls[groupName].get(name).value;
2653
- };
2654
- BaseEditComponent.prototype.setFormGroupValue = function (groupName, name, value, frmGroup) {
2655
- if (frmGroup === void 0) { frmGroup = null; }
2656
- var fg = frmGroup ? frmGroup : this.formGroup;
2657
- fg.controls[groupName].get(name).setValue(value);
2658
- };
2659
- /**
2660
- * Add control to form group
2661
- * @param name
2662
- * @param formControl
2663
- * @param formGroup
2664
- */
2665
- BaseEditComponent.prototype.addControl = function (name, formControl, frmGroup) {
2666
- if (frmGroup === void 0) { frmGroup = null; }
2667
- var fg = frmGroup ? frmGroup : this.formGroup;
2668
- fg.addControl(name, formControl);
2669
- };
2670
- /**
2671
- * Removes control from form group
2672
- * @param name
2673
- * @param formGroup
2674
- */
2675
- BaseEditComponent.prototype.removeControl = function (name, frmGroup) {
2676
- if (frmGroup === void 0) { frmGroup = null; }
2677
- var fg = frmGroup ? frmGroup : this.formGroup;
2678
- if (fg.get(name)) {
2679
- fg.removeControl(name);
2680
- }
2681
- };
2682
- /**
2683
- * return new form control
2684
- * @param formState
2685
- * @param validatorOrOpts
2686
- * @param asyncValidator
2687
- */
2688
- BaseEditComponent.prototype.createFormControl = function (formState, validatorOrOpts, asyncValidator) {
2689
- return new forms.FormControl(formState, validatorOrOpts, asyncValidator);
2690
- };
2691
- /**
2692
- * Set error to control
2693
- * @param controlName formControl name
2694
- * @param err error expect {erroname: boolean} format
2695
- * @param formGroup Specific form group. default it will apply on this.formGroup property
2696
- */
2697
- BaseEditComponent.prototype.setControlError = function (controlName, err, frmGroup) {
2698
- if (frmGroup === void 0) { frmGroup = null; }
2699
- var _a;
2700
- var fg = frmGroup ? frmGroup : this.formGroup;
2701
- (_a = fg.get(controlName)) === null || _a === void 0 ? void 0 : _a.setErrors(err);
2702
- };
2703
- /**
2704
- * Set {invalid: true} for the specified form
2705
- * @param controlName form control name
2706
- * @param formGroup
2707
- */
2708
- BaseEditComponent.prototype.setInValidError = function (controlName, frmGroup) {
2709
- if (frmGroup === void 0) { frmGroup = null; }
2710
- var _a;
2711
- var fg = frmGroup ? frmGroup : this.formGroup;
2712
- (_a = fg.get(controlName)) === null || _a === void 0 ? void 0 : _a.setErrors({ invalid: true });
2713
- };
2714
- Object.defineProperty(BaseEditComponent.prototype, "fc", {
2715
- /**
2716
- * returns formgroup controls.
2717
- * main use case is used in html pages
2718
- */
2719
- get: function () {
2720
- return this.formGroup.controls;
2721
- },
2722
- enumerable: false,
2723
- configurable: true
2724
- });
2725
- return BaseEditComponent;
2726
- }(BaseComponent));
2727
- BaseEditComponent.decorators = [
2728
- { type: i0.Component, args: [{
2729
- template: ''
2730
- },] }
2731
- ];
2732
- BaseEditComponent.ctorParameters = function () { return []; };
2733
- BaseEditComponent.propDecorators = {
2734
- formGroup: [{ type: i0.Input }],
2735
- formSubmitted: [{ type: i0.Input }]
2736
- };
2737
-
2738
2761
  var BaseHtmlEditorComponent = /** @class */ (function (_super) {
2739
2762
  __extends(BaseHtmlEditorComponent, _super);
2740
2763
  function BaseHtmlEditorComponent() {
@@ -3519,6 +3542,7 @@
3519
3542
  exports.AppCoreSettings = AppCoreSettings;
3520
3543
  exports.BaseApiService = BaseApiService;
3521
3544
  exports.BaseComponent = BaseComponent;
3545
+ exports.BaseDialogComponent = BaseDialogComponent;
3522
3546
  exports.BaseEditComponent = BaseEditComponent;
3523
3547
  exports.BaseGoService = BaseGoService;
3524
3548
  exports.BaseGridEditService = BaseGridEditService;