@smartsoft001/angular 1.1.685 → 1.1.690

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reflect-metadata'), require('@angular/core'), require('@angular/forms'), require('lodash'), require('rxjs/operators'), require('@smartsoft001/models'), require('@smartsoft001/utils'), require('jwt-decode'), require('ngx-cookie'), require('@ionic/angular'), require('@angular/common'), require('@ionic/storage'), require('@angular/common/http'), require('@ngx-translate/core'), require('@capacitor/core'), require('@ionic-native/fingerprint-aio/ngx'), require('moment'), require('rxjs'), require('lodash-decorators'), require('@angular/router'), require('ng2-charts'), require('@angular/material/table'), require('@angular/material/sort'), require('ngx-color-picker'), require('@angular/cdk/drag-drop'), require('ngx-editor'), require('ng-lazyload-image'), require('@angular/material/stepper'), require('@angular/material/button'), require('@angular/material/datepicker'), require('@angular/material/core'), require('@angular/material-moment-adapter'), require('@ngrx/effects'), require('@ngrx/store'), require('@ngrx/router-store'), require('@ionic/core'), require('guid-typescript')) :
3
- typeof define === 'function' && define.amd ? define('@smartsoft001/angular', ['exports', 'reflect-metadata', '@angular/core', '@angular/forms', 'lodash', 'rxjs/operators', '@smartsoft001/models', '@smartsoft001/utils', 'jwt-decode', 'ngx-cookie', '@ionic/angular', '@angular/common', '@ionic/storage', '@angular/common/http', '@ngx-translate/core', '@capacitor/core', '@ionic-native/fingerprint-aio/ngx', 'moment', 'rxjs', 'lodash-decorators', '@angular/router', 'ng2-charts', '@angular/material/table', '@angular/material/sort', 'ngx-color-picker', '@angular/cdk/drag-drop', 'ngx-editor', 'ng-lazyload-image', '@angular/material/stepper', '@angular/material/button', '@angular/material/datepicker', '@angular/material/core', '@angular/material-moment-adapter', '@ngrx/effects', '@ngrx/store', '@ngrx/router-store', '@ionic/core', 'guid-typescript'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.smartsoft001 = global.smartsoft001 || {}, global.smartsoft001.angular = {}), null, global.ng.core, global.ng.forms, global._, global.rxjs.operators, global.models, global.utils, global.decode, global.ngxCookie, global.i1, global.ng.common, global.storage, global.ng.common.http, global.core, global.core$1, global.ngx, global.moment$1, global.rxjs, global.lodashDecorators, global.ng.router, global.ng2Charts, global.ng.material.table, global.ng.material.sort, global.ngxColorPicker, global.ng.cdk.dragDrop, global.ngxEditor, global.ngLazyloadImage, global.ng.material.stepper, global.ng.material.button, global.ng.material.datepicker, global.ng.material.core, global.ng.materialMomentAdapter, global.effects, global.store, global.routerStore, global.core$3, global.guidTypescript));
5
- })(this, (function (exports, reflectMetadata, i0, forms, _, operators, models, utils, decode, ngxCookie, i1, common, storage, http, core, core$1, ngx, moment$1, rxjs, lodashDecorators, router, ng2Charts, table, sort, ngxColorPicker, dragDrop, ngxEditor, ngLazyloadImage, stepper, button, datepicker, core$2, materialMomentAdapter, effects, store, routerStore, core$3, guidTypescript) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reflect-metadata'), require('@angular/core'), require('@angular/forms'), require('lodash'), require('rxjs/operators'), require('@smartsoft001/models'), require('@smartsoft001/utils'), require('jwt-decode'), require('ngx-cookie'), require('@ionic/angular'), require('@angular/common'), require('@ionic/storage'), require('@ngx-translate/core'), require('@angular/common/http'), require('@ionic-native/fingerprint-aio/ngx'), require('@capacitor/core'), require('moment'), require('lodash-decorators'), require('rxjs'), require('@angular/router'), require('ng2-charts'), require('@angular/material/table'), require('@angular/material/sort'), require('ngx-color-picker'), require('@angular/cdk/drag-drop'), require('ngx-editor'), require('ng-lazyload-image'), require('@angular/material/stepper'), require('@angular/material/button'), require('@angular/material/datepicker'), require('@angular/material/core'), require('@angular/material-moment-adapter'), require('@ngrx/effects'), require('@ngrx/store'), require('@ngrx/router-store'), require('@ionic/core'), require('guid-typescript')) :
3
+ typeof define === 'function' && define.amd ? define('@smartsoft001/angular', ['exports', 'reflect-metadata', '@angular/core', '@angular/forms', 'lodash', 'rxjs/operators', '@smartsoft001/models', '@smartsoft001/utils', 'jwt-decode', 'ngx-cookie', '@ionic/angular', '@angular/common', '@ionic/storage', '@ngx-translate/core', '@angular/common/http', '@ionic-native/fingerprint-aio/ngx', '@capacitor/core', 'moment', 'lodash-decorators', 'rxjs', '@angular/router', 'ng2-charts', '@angular/material/table', '@angular/material/sort', 'ngx-color-picker', '@angular/cdk/drag-drop', 'ngx-editor', 'ng-lazyload-image', '@angular/material/stepper', '@angular/material/button', '@angular/material/datepicker', '@angular/material/core', '@angular/material-moment-adapter', '@ngrx/effects', '@ngrx/store', '@ngrx/router-store', '@ionic/core', 'guid-typescript'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.smartsoft001 = global.smartsoft001 || {}, global.smartsoft001.angular = {}), null, global.ng.core, global.ng.forms, global._, global.rxjs.operators, global.models, global.utils, global.decode, global.ngxCookie, global.i1, global.ng.common, global.storage, global.core, global.ng.common.http, global.ngx, global.core$1, global.moment$1, global.lodashDecorators, global.rxjs, global.ng.router, global.ng2Charts, global.ng.material.table, global.ng.material.sort, global.ngxColorPicker, global.ng.cdk.dragDrop, global.ngxEditor, global.ngLazyloadImage, global.ng.material.stepper, global.ng.material.button, global.ng.material.datepicker, global.ng.material.core, global.ng.materialMomentAdapter, global.effects, global.store, global.routerStore, global.core$3, global.guidTypescript));
5
+ })(this, (function (exports, reflectMetadata, i0, forms, _, operators, models, utils, decode, ngxCookie, i1, common, storage, core, http, ngx, core$1, moment$1, lodashDecorators, rxjs, router, ng2Charts, table, sort, ngxColorPicker, dragDrop, ngxEditor, ngLazyloadImage, stepper, button, datepicker, core$2, materialMomentAdapter, effects, store, routerStore, core$3, guidTypescript) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -256,16 +256,10 @@
256
256
  r[k] = a[j];
257
257
  return r;
258
258
  }
259
- function __spreadArray(to, from, pack) {
260
- if (pack || arguments.length === 2)
261
- for (var i = 0, l = from.length, ar; i < l; i++) {
262
- if (ar || !(i in from)) {
263
- if (!ar)
264
- ar = Array.prototype.slice.call(from, 0, i);
265
- ar[i] = from[i];
266
- }
267
- }
268
- return to.concat(ar || Array.prototype.slice.call(from));
259
+ function __spreadArray(to, from) {
260
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
261
+ to[j] = from[i];
262
+ return to;
269
263
  }
270
264
  function __await(v) {
271
265
  return this instanceof __await ? (this.v = v, this) : new __await(v);
@@ -536,173 +530,48 @@
536
530
  }());
537
531
  var MODEL_VALIDATORS_PROVIDER = new i0.InjectionToken("MODEL_VALIDATORS_PROVIDER");
538
532
 
539
- var ToastService = /** @class */ (function () {
540
- function ToastService(toastCtrl) {
541
- this.toastCtrl = toastCtrl;
533
+ var SmartFormGroup = /** @class */ (function (_super) {
534
+ __extends(SmartFormGroup, _super);
535
+ function SmartFormGroup() {
536
+ return _super !== null && _super.apply(this, arguments) || this;
542
537
  }
543
- ToastService.prototype.addLockError = function () {
544
- ++ToastService.lockError;
545
- };
546
- ToastService.prototype.removeLockError = function () {
547
- --ToastService.lockError;
548
- };
549
- ToastService.prototype.error = function (config) {
550
- return __awaiter(this, void 0, void 0, function () {
551
- var toast;
552
- return __generator(this, function (_a) {
553
- switch (_a.label) {
554
- case 0:
555
- if (ToastService.lockError)
556
- return [2 /*return*/];
557
- return [4 /*yield*/, this.toastCtrl.create({
558
- position: 'bottom',
559
- header: config.title,
560
- message: config.message,
561
- duration: config.duration ? config.duration : 2000,
562
- buttons: config.buttons ? config.buttons.map(function (b) {
563
- return {
564
- text: b.text,
565
- side: b.position,
566
- role: 'cancel',
567
- handler: b.handler
568
- };
569
- }) : null
570
- })];
571
- case 1:
572
- toast = _a.sent();
573
- return [4 /*yield*/, toast.present()];
574
- case 2:
575
- _a.sent();
576
- return [2 /*return*/];
577
- }
578
- });
579
- });
580
- };
581
- ToastService.prototype.info = function (config) {
582
- return __awaiter(this, void 0, void 0, function () {
583
- var toast;
584
- return __generator(this, function (_a) {
585
- switch (_a.label) {
586
- case 0: return [4 /*yield*/, this.toastCtrl.create({
587
- position: 'bottom',
588
- header: config.title,
589
- message: config.message,
590
- duration: config.duration ? config.duration : 2000,
591
- buttons: config.buttons ? config.buttons.map(function (b) {
592
- return {
593
- text: b.text,
594
- side: b.position,
595
- handler: b.handler
596
- };
597
- }) : null
598
- })];
599
- case 1:
600
- toast = _a.sent();
601
- return [4 /*yield*/, toast.present()];
602
- case 2:
603
- _a.sent();
604
- return [2 /*return*/];
605
- }
606
- });
607
- });
538
+ SmartFormGroup.create = function () {
539
+ return new SmartFormGroup({});
608
540
  };
609
- return ToastService;
610
- }());
611
- ToastService.lockError = 0;
612
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
613
- ToastService.decorators = [
614
- { type: i0.Injectable }
615
- ];
616
- /**
617
- * @type {function(): !Array<(null|{
618
- * type: ?,
619
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
620
- * })>}
621
- * @nocollapse
622
- */
623
- ToastService.ctorParameters = function () { return [
624
- { type: i1.ToastController }
625
- ]; };
626
-
627
- var ErrorService = /** @class */ (function () {
628
- function ErrorService(toastService, translateService) {
629
- this.toastService = toastService;
630
- this.translateService = translateService;
631
- }
632
- ErrorService.prototype.log = function (obj) {
633
- return __awaiter(this, void 0, void 0, function () {
634
- var message;
635
- return __generator(this, function (_a) {
636
- switch (_a.label) {
637
- case 0:
638
- message = '';
639
- if (!(obj instanceof http.HttpErrorResponse)) return [3 /*break*/, 2];
640
- if (!(obj.error && obj.error.details === 'Invalid username or password')) return [3 /*break*/, 2];
641
- return [4 /*yield*/, this.translateService.get('ERRORS.invalidUsernameOrPassword').toPromise()];
642
- case 1:
643
- message = _a.sent();
644
- _a.label = 2;
645
- case 2:
646
- if (!!message) return [3 /*break*/, 4];
647
- return [4 /*yield*/, this.translateService.get('ERRORS.other').toPromise()];
648
- case 3:
649
- message = _a.sent();
650
- _a.label = 4;
651
- case 4:
652
- console.error(obj);
653
- return [4 /*yield*/, this.toastService.error({ message: message })];
654
- case 5:
655
- _a.sent();
656
- return [2 /*return*/];
657
- }
658
- });
541
+ SmartFormGroup.prototype.setForm = function (form) {
542
+ var _this = this;
543
+ Object.keys(form.controls).forEach(function (key) {
544
+ if (_this.controls[key])
545
+ _this.removeControl(key);
546
+ _this.addControl(key, form.controls[key]);
659
547
  });
660
548
  };
661
- return ErrorService;
662
- }());
663
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
664
- ErrorService.decorators = [
665
- { type: i0.Injectable }
666
- ];
667
- /**
668
- * @type {function(): !Array<(null|{
669
- * type: ?,
670
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
671
- * })>}
672
- * @nocollapse
673
- */
674
- ErrorService.ctorParameters = function () { return [
675
- { type: ToastService },
676
- { type: core.TranslateService }
677
- ]; };
549
+ return SmartFormGroup;
550
+ }(forms.FormGroup));
678
551
 
679
- var HardwareService = /** @class */ (function () {
680
- function HardwareService(platform) {
681
- this.platform = platform;
552
+ var DetailsService = /** @class */ (function () {
553
+ function DetailsService() {
554
+ this.init();
682
555
  }
683
- Object.defineProperty(HardwareService.prototype, "isMobile", {
684
- get: function () {
685
- return this.platform.is('capacitor');
686
- },
687
- enumerable: false,
688
- configurable: true
689
- });
690
- Object.defineProperty(HardwareService.prototype, "isMobileWeb", {
556
+ Object.defineProperty(DetailsService.prototype, "$root", {
691
557
  get: function () {
692
- return this.platform.is('mobileweb');
558
+ return this._root;
693
559
  },
694
560
  enumerable: false,
695
561
  configurable: true
696
562
  });
697
- HardwareService.prototype.onBackButtonClick = function (callback) {
698
- return core$1.App.addListener('backButton', function () {
699
- callback();
700
- });
563
+ DetailsService.prototype.init = function () {
564
+ this._root = null;
701
565
  };
702
- return HardwareService;
566
+ DetailsService.prototype.setRoot = function (obj, force) {
567
+ if (force === void 0) { force = false; }
568
+ if (!this._root || force)
569
+ this._root = obj;
570
+ };
571
+ return DetailsService;
703
572
  }());
704
573
  /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
705
- HardwareService.decorators = [
574
+ DetailsService.decorators = [
706
575
  { type: i0.Injectable }
707
576
  ];
708
577
  /**
@@ -712,268 +581,310 @@
712
581
  * })>}
713
582
  * @nocollapse
714
583
  */
715
- HardwareService.ctorParameters = function () { return [
716
- { type: i1.Platform }
717
- ]; };
584
+ DetailsService.ctorParameters = function () { return []; };
718
585
 
719
- var ModalService = /** @class */ (function () {
720
- function ModalService(modalCtrl, navParams) {
721
- this.modalCtrl = modalCtrl;
722
- this.navParams = navParams;
586
+ var FormFactory = /** @class */ (function () {
587
+ function FormFactory(fb, authService, detailsService, validatorsProvider) {
588
+ this.fb = fb;
589
+ this.authService = authService;
590
+ this.detailsService = detailsService;
591
+ this.validatorsProvider = validatorsProvider;
723
592
  }
724
- ModalService.prototype.getParam = function (key) {
725
- var _a;
726
- return (_a = this.navParams) === null || _a === void 0 ? void 0 : _a.get(key);
593
+ FormFactory.checkModelMeta = function (obj) {
594
+ if (!obj)
595
+ throw new Error("You should set object as param");
596
+ if (!Reflect.hasMetadata(models.SYMBOL_MODEL, obj.constructor))
597
+ throw new Error("You should mark class with @Model decorator");
727
598
  };
728
- ModalService.prototype.show = function (options) {
729
- return __awaiter(this, void 0, void 0, function () {
730
- var modalOptions, modal;
731
- return __generator(this, function (_b) {
732
- switch (_b.label) {
733
- case 0:
734
- modalOptions = {
735
- component: options.component,
736
- componentProps: options.props,
737
- cssClass: options.cssClass ? options.cssClass : [],
738
- backdropDismiss: options.backdropDismiss
739
- };
740
- if (options.mode === "bottom") {
741
- modalOptions.cssClass.push('smart-modal-bottom');
742
- }
743
- return [4 /*yield*/, this.modalCtrl.create(modalOptions)];
744
- case 1:
745
- modal = _b.sent();
746
- return [4 /*yield*/, modal.present()];
747
- case 2:
748
- _b.sent();
749
- return [2 /*return*/, modal];
750
- }
751
- });
752
- });
599
+ FormFactory.getOptions = function (obj, key) {
600
+ return Reflect.getMetadata(models.SYMBOL_FIELD, obj, key);
753
601
  };
754
- ModalService.prototype.dismiss = function (data) {
755
- if (data === void 0) { data = null; }
756
- return __awaiter(this, void 0, void 0, function () {
757
- return __generator(this, function (_b) {
758
- switch (_b.label) {
759
- case 0: return [4 /*yield*/, this.modalCtrl.dismiss(data)];
760
- case 1:
761
- _b.sent();
762
- return [2 /*return*/];
763
- }
764
- });
765
- });
602
+ FormFactory.getOptionsFromMode = function (options, mode) {
603
+ var result = options;
604
+ if (!mode)
605
+ return result;
606
+ if (mode === "create" && ___namespace.isObject(options.create)) {
607
+ result = Object.assign(Object.assign({}, options), options.create);
608
+ }
609
+ else if (mode === "update" && ___namespace.isObject(options.update)) {
610
+ result = Object.assign(Object.assign({}, options), options.update);
611
+ }
612
+ return result;
766
613
  };
767
- return ModalService;
768
- }());
769
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
770
- ModalService.decorators = [
771
- { type: i0.Injectable }
772
- ];
773
- /**
774
- * @type {function(): !Array<(null|{
775
- * type: ?,
776
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
777
- * })>}
778
- * @nocollapse
779
- */
780
- ModalService.ctorParameters = function () { return [
781
- { type: i1.ModalController },
782
- { type: i1.NavParams, decorators: [{ type: i0.Optional }] }
783
- ]; };
784
-
785
- var DynamicComponentLoader = /** @class */ (function () {
786
- function DynamicComponentLoader(resolver, injector) {
787
- this.resolver = resolver;
788
- this.injector = injector;
789
- }
790
- DynamicComponentLoader.prototype.getComponentsWithFactories = function (options) {
614
+ FormFactory.prototype.create = function (obj, ops) {
615
+ if (ops === void 0) { ops = {}; }
791
616
  return __awaiter(this, void 0, void 0, function () {
792
- var components, result;
617
+ var result, fields, enabledDefinitions, _loop_1, this_1, index, rootCheck;
793
618
  var _this = this;
794
- return __generator(this, function (_a) {
795
- components = [];
796
- components = options.components.filter(function (comp) { return !DynamicComponentLoader.declaredComponents.some(function (dec) { return dec.component === comp; }); }) || [];
797
- result = options.components.map(function (c) {
798
- var factory = _this.resolver.resolveComponentFactory(c);
799
- if (!factory) {
800
- factory = DynamicComponentLoader.declaredComponents.find(function (x) { return x.component === c; }).factory;
801
- }
802
- return {
803
- component: c,
804
- factory: factory,
805
- };
806
- });
807
- DynamicComponentLoader.declaredComponents = __spreadArray(__spreadArray([], __read(DynamicComponentLoader.declaredComponents)), __read(result));
808
- return [2 /*return*/, result];
809
- });
810
- });
811
- };
812
- return DynamicComponentLoader;
813
- }());
814
- DynamicComponentLoader.declaredComponents = [];
815
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
816
- DynamicComponentLoader.decorators = [
817
- { type: i0.Injectable }
818
- ];
819
- /**
820
- * @type {function(): !Array<(null|{
821
- * type: ?,
822
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
823
- * })>}
824
- * @nocollapse
825
- */
826
- DynamicComponentLoader.ctorParameters = function () { return [
827
- { type: i0.ComponentFactoryResolver },
828
- { type: i0.Injector }
829
- ]; };
830
-
831
- var NgrxStoreService = /** @class */ (function () {
832
- function NgrxStoreService() {
833
- }
834
- NgrxStoreService.addReducer = function (key, reducer) {
835
- if (!NgrxStoreService._reducers[key]) {
836
- NgrxStoreService._reducers[key] = reducer;
837
- NgrxStoreService.store.addReducer(key, reducer);
838
- console.log(NgrxStoreService.name + " register reducer " + key);
839
- }
840
- };
841
- NgrxStoreService.prototype.connect = function (store) {
842
- NgrxStoreService.store = store;
843
- };
844
- return NgrxStoreService;
845
- }());
846
- NgrxStoreService._reducers = {};
847
- NgrxStoreService.store = undefined;
848
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
849
- NgrxStoreService.decorators = [
850
- { type: i0.Injectable }
851
- ];
852
-
853
- var PopoverService = /** @class */ (function () {
854
- function PopoverService(popoverCtrl) {
855
- this.popoverCtrl = popoverCtrl;
856
- }
857
- PopoverService.prototype.close = function () {
858
- return __awaiter(this, void 0, void 0, function () {
859
- return __generator(this, function (_a) {
860
- switch (_a.label) {
861
- case 0: return [4 /*yield*/, this.popoverCtrl.dismiss()];
619
+ return __generator(this, function (_l) {
620
+ switch (_l.label) {
621
+ case 0:
622
+ FormFactory.checkModelMeta(obj);
623
+ result = SmartFormGroup.create();
624
+ fields = models.getModelFieldsWithOptions(obj).filter(function (field) {
625
+ var _a, _b;
626
+ return (!ops.mode ||
627
+ (ops.mode === "create" && field.options.create) ||
628
+ (ops.mode === "update" && field.options.update) ||
629
+ (ops.mode === "multiUpdate" && ((_b = (_a = field.options) === null || _a === void 0 ? void 0 : _a.update) === null || _b === void 0 ? void 0 : _b.multi)) ||
630
+ (ops.mode !== "create" &&
631
+ ops.mode !== "update" &&
632
+ field.options.customs &&
633
+ field.options.customs.some(function (custom) { return custom.mode === ops.mode; })));
634
+ });
635
+ enabledDefinitions = [];
636
+ _loop_1 = function (index) {
637
+ var field, control, options, indexField, _m, _o, providerResult, confirmControl;
638
+ return __generator(this, function (_p) {
639
+ switch (_p.label) {
640
+ case 0:
641
+ field = fields[index];
642
+ control = null;
643
+ options = FormFactory.getOptionsFromMode(field.options, ops.mode);
644
+ if (options.permissions && !this_1.authService.expectPermissions(options.permissions)) {
645
+ return [2 /*return*/, "continue"];
646
+ }
647
+ if (!(field.options.type === models.FieldType.object)) return [3 /*break*/, 2];
648
+ return [4 /*yield*/, this_1.create(obj[field.key], Object.assign(Object.assign({}, ops), { root: ops.root ? ops.root : result }))];
649
+ case 1:
650
+ control = _p.sent();
651
+ return [3 /*break*/, 8];
652
+ case 2:
653
+ if (!(field.options.type === models.FieldType.array)) return [3 /*break*/, 7];
654
+ control = this_1.fb.array([]);
655
+ if (!obj[field.key]) return [3 /*break*/, 6];
656
+ indexField = 0;
657
+ _p.label = 3;
658
+ case 3:
659
+ if (!(indexField < obj[field.key].length)) return [3 /*break*/, 6];
660
+ _o = (_m = control).push;
661
+ return [4 /*yield*/, this_1.create(obj[field.key][indexField], Object.assign(Object.assign({}, ops), { root: ops.root ? ops.root : result }))];
662
+ case 4:
663
+ _o.apply(_m, [_p.sent()]);
664
+ _p.label = 5;
665
+ case 5:
666
+ indexField++;
667
+ return [3 /*break*/, 3];
668
+ case 6: return [3 /*break*/, 8];
669
+ case 7:
670
+ control = this_1.createControl(obj, field, options.required);
671
+ _p.label = 8;
672
+ case 8:
673
+ this_1.setValidators(field.key, control, options, result, ops.uniqueProvider);
674
+ if (!this_1.validatorsProvider) return [3 /*break*/, 10];
675
+ return [4 /*yield*/, this_1.validatorsProvider.get({
676
+ key: field.key,
677
+ instance: obj,
678
+ type: obj.constructor,
679
+ base: {
680
+ validators: control.validator,
681
+ asyncValidators: control.asyncValidator
682
+ }
683
+ })];
684
+ case 9:
685
+ providerResult = _p.sent();
686
+ control.setValidators(providerResult.validators);
687
+ control.setAsyncValidators(providerResult.asyncValidators);
688
+ _p.label = 10;
689
+ case 10:
690
+ result.addControl(field.key, control);
691
+ if (options.confirm && options.type === models.FieldType.object) {
692
+ throw Error("Object not supported confirms");
693
+ }
694
+ if (options.confirm) {
695
+ confirmControl = this_1.fb.control(null, [
696
+ forms.Validators.required,
697
+ function (a) {
698
+ if (a.value !== result.controls[field.key].value) {
699
+ return {
700
+ confirm: true,
701
+ };
702
+ }
703
+ return null;
704
+ },
705
+ ]);
706
+ result.addControl(field.key + "Confirm", confirmControl);
707
+ }
708
+ if (options.enabled) {
709
+ enabledDefinitions.push({
710
+ key: field.key,
711
+ control: control,
712
+ enabled: options.enabled
713
+ });
714
+ }
715
+ return [2 /*return*/];
716
+ }
717
+ });
718
+ };
719
+ this_1 = this;
720
+ index = 0;
721
+ _l.label = 1;
862
722
  case 1:
863
- _a.sent();
864
- return [2 /*return*/];
723
+ if (!(index < fields.length)) return [3 /*break*/, 4];
724
+ return [5 /*yield**/, _loop_1(index)];
725
+ case 2:
726
+ _l.sent();
727
+ _l.label = 3;
728
+ case 3:
729
+ index++;
730
+ return [3 /*break*/, 1];
731
+ case 4:
732
+ rootCheck = null;
733
+ if (enabledDefinitions.some(function (d) {
734
+ var _a;
735
+ return ((_a = d === null || d === void 0 ? void 0 : d.enabled) === null || _a === void 0 ? void 0 : _a.criteria) &&
736
+ Object.keys(d.enabled.criteria).some(function (k) { return k.indexOf(utils.SPECIFICATION_ROOT_KEY) === 0; });
737
+ }) && ops.root) {
738
+ rootCheck = ops.root;
739
+ }
740
+ (rootCheck ? rootCheck : result).valueChanges.pipe(operators.tap(function () {
741
+ enabledDefinitions.forEach(function (def) {
742
+ var enabled = utils.SpecificationService.valid(result.value, def.enabled, {
743
+ $root: rootCheck === null || rootCheck === void 0 ? void 0 : rootCheck.value
744
+ });
745
+ console.log(rootCheck.value, result.value);
746
+ def.control['__smartDisabled'] = !enabled;
747
+ });
748
+ }), operators.delay(0)).subscribe(function () {
749
+ if (rootCheck)
750
+ _this.detailsService.setRoot(rootCheck.value, true);
751
+ enabledDefinitions.forEach(function (def) {
752
+ if (!def.control['__smartDisabled'] && !result.controls[def.key]) {
753
+ result.addControl(def.key, def.control);
754
+ result.updateValueAndValidity();
755
+ }
756
+ else if (def.control['__smartDisabled'] && result.controls[def.key]) {
757
+ result.removeControl(def.key);
758
+ result.updateValueAndValidity();
759
+ }
760
+ });
761
+ });
762
+ return [2 /*return*/, result];
865
763
  }
866
764
  });
867
765
  });
868
766
  };
869
- return PopoverService;
870
- }());
871
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
872
- PopoverService.decorators = [
873
- { type: i0.Injectable }
874
- ];
875
- /**
876
- * @type {function(): !Array<(null|{
877
- * type: ?,
878
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
879
- * })>}
880
- * @nocollapse
881
- */
882
- PopoverService.ctorParameters = function () { return [
883
- { type: i1.PopoverController }
884
- ]; };
885
-
886
- var StyleService = /** @class */ (function () {
887
- function StyleService(platform, platformId) {
888
- this.platform = platform;
889
- this.platformId = platformId;
890
- }
891
- StyleService.create = function (platform, platformId, el, style) {
892
- var result = new StyleService(platform, platformId);
893
- result.init(el, style);
894
- return result;
895
- };
896
- StyleService.prototype.init = function (el, style) {
897
- this._elementRef = el;
898
- this.set(style);
899
- };
900
- StyleService.prototype.set = function (style) {
901
- if (!style)
902
- style = {};
903
- if (!StyleService.style)
904
- StyleService.style = {};
905
- StyleService.style = Object.assign(Object.assign({}, StyleService.style), style);
906
- this.execute();
907
- };
908
- StyleService.prototype.execute = function () {
909
- this.setColor('primary');
910
- this.setColor('secondary');
911
- this.setColor('tertiary');
912
- this.setColor('success');
913
- this.setColor('warning');
914
- this.setColor('danger');
915
- this.setColor('dark');
916
- this.setColor('medium');
917
- this.setColor('light');
918
- this.setFont();
919
- this.setButton();
920
- this.setMobileBreakpoint();
921
- };
922
- StyleService.prototype.setColor = function (name) {
923
- this.setProperty("--smart-color-" + name, "color-" + name);
924
- this.setProperty("--smart-color-" + name + "-rgb", "color-" + name + "-rgb");
925
- this.setProperty("--smart-color-" + name + "-contrast", "color-" + name + "-contrast");
926
- this.setProperty("--smart-color-" + name + "-contrast-rgb", "color-" + name + "-contrast-rgb");
927
- this.setProperty("--smart-color-" + name + "-shade", "color-" + name + "-shade");
928
- this.setProperty("--smart-color-" + name + "-tint", "color-" + name + "-tint");
929
- this.setProperty("--ion-color-" + name, "color-" + name);
930
- this.setProperty("--ion-color-" + name + "-rgb", "color-" + name + "-rgb");
931
- this.setProperty("--ion-color-" + name + "-contrast", "color-" + name + "-contrast");
932
- this.setProperty("--ion-color-" + name + "-contrast-rgb", "color-" + name + "-contrast-rgb");
933
- this.setProperty("--ion-color-" + name + "-shade", "color-" + name + "-shade");
934
- this.setProperty("--ion-color-" + name + "-tint", "color-" + name + "-tint");
935
- };
936
- StyleService.prototype.setProperty = function (property, type) {
937
- if (!StyleService.style[type])
938
- return;
939
- var native = this._elementRef.nativeElement;
940
- native.style.setProperty(property, StyleService.style[type]);
941
- };
942
- StyleService.prototype.setFont = function () {
943
- if (common.isPlatformBrowser(this.platformId) && this.platform.is('ios')) {
944
- this.setProperty('--ion-font-family', 'ios-font');
945
- this.setProperty('--default-font-weight', 'ios-font-weight');
946
- this.setProperty('--default-font-style', 'ios-font-style');
767
+ FormFactory.prototype.setValidators = function (key, control, options, form, uniqueProvider) {
768
+ var _this = this;
769
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
770
+ var result = [];
771
+ var asyncResult = [];
772
+ if (options.required) {
773
+ result.push(forms.Validators.required);
947
774
  }
948
- else if (common.isPlatformBrowser(this.platformId) && this.platform.is("android")) {
949
- this.setProperty('--ion-font-family', 'md-font');
950
- this.setProperty('--default-font-weight', 'md-font-weight');
951
- this.setProperty('--default-font-style', 'md-font-style');
775
+ if (options.type === models.FieldType.email) {
776
+ result.push(function (c) {
777
+ if (!c.value)
778
+ return;
779
+ var reg = new RegExp("^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$");
780
+ if (reg.test(c.value))
781
+ return null;
782
+ return { email: true };
783
+ });
952
784
  }
953
- else {
954
- this.setProperty('--ion-font-family', 'font');
955
- this.setProperty('--default-font-weight', 'font-weight');
956
- this.setProperty('--default-font-style', 'font-style');
785
+ if (options.type === models.FieldType.phoneNumber) {
786
+ result.push(function (c) {
787
+ if (!c.value)
788
+ return;
789
+ var reg = new RegExp("^((\\+91-?)|0)?[0-9]{9}$");
790
+ if (reg.test(c.value))
791
+ return null;
792
+ return { phoneNumber: true };
793
+ });
957
794
  }
795
+ if (options.type === models.FieldType.pesel) {
796
+ result.push(function (c) {
797
+ if (!c.value)
798
+ return;
799
+ if (utils.PeselService.isValid(c.value))
800
+ return null;
801
+ return { pesel: true };
802
+ });
803
+ }
804
+ if ((_a = options.possibilities) === null || _a === void 0 ? void 0 : _a.minLength) {
805
+ result.push(forms.Validators.minLength((_b = options.possibilities) === null || _b === void 0 ? void 0 : _b.minLength));
806
+ }
807
+ if ((_c = options.possibilities) === null || _c === void 0 ? void 0 : _c.maxLength) {
808
+ result.push(forms.Validators.maxLength((_d = options.possibilities) === null || _d === void 0 ? void 0 : _d.maxLength));
809
+ }
810
+ if (((_e = options.possibilities) === null || _e === void 0 ? void 0 : _e.min) || ((_f = options.possibilities) === null || _f === void 0 ? void 0 : _f.min) === 0) {
811
+ result.push(forms.Validators.min((_g = options.possibilities) === null || _g === void 0 ? void 0 : _g.min));
812
+ }
813
+ if (((_h = options.possibilities) === null || _h === void 0 ? void 0 : _h.max) || ((_j = options.possibilities) === null || _j === void 0 ? void 0 : _j.max) === 0) {
814
+ result.push(forms.Validators.max((_k = options.possibilities) === null || _k === void 0 ? void 0 : _k.max));
815
+ }
816
+ if (options.unique && uniqueProvider) {
817
+ asyncResult.push(function (c) { return __awaiter(_this, void 0, void 0, function () {
818
+ var record;
819
+ var _l;
820
+ return __generator(this, function (_m) {
821
+ switch (_m.label) {
822
+ case 0:
823
+ record = (_l = {},
824
+ _l[key] = options.type === models.FieldType.int ? c.value : "'" + c.value + "'",
825
+ _l);
826
+ if (form.value && options.unique.withFields) {
827
+ options.unique.withFields.forEach(function (fieldKey) {
828
+ record[fieldKey] = form.value[fieldKey];
829
+ });
830
+ }
831
+ return [4 /*yield*/, uniqueProvider(record)];
832
+ case 1:
833
+ if (_m.sent())
834
+ return [2 /*return*/, null];
835
+ return [2 /*return*/, {
836
+ invalidUnique: true
837
+ }];
838
+ }
839
+ });
840
+ }); });
841
+ }
842
+ control.setValidators(result);
843
+ control.setAsyncValidators(asyncResult);
958
844
  };
959
- StyleService.prototype.setButton = function () {
960
- this.setProperty('--smart-button-height', 'button-height');
961
- this.setProperty('--smart-button-min-width', 'button-min-width');
962
- this.setProperty('--smart-button-padding-right', 'button-padding-right');
963
- this.setProperty('--smart-button-padding-left', 'button-padding-left');
964
- this.setProperty('--smart-button-padding-top', 'button-padding-top');
965
- this.setProperty('--smart-button-padding-bottom', 'button-padding-bottom');
966
- this.setProperty('--smart-button-icon-size', 'button-icon-size');
967
- };
968
- StyleService.prototype.setMobileBreakpoint = function () {
969
- this.setProperty('--phone-breakpoint', 'phone-breakpoint');
970
- this.setProperty('--tablet-breakpoint', 'tablet-breakpoint');
845
+ FormFactory.prototype.createControl = function (obj, field, required) {
846
+ var result;
847
+ var zipCodeValidator = function (c) {
848
+ if (c.value && utils.ZipCodeService.isInvalid(c.value)) {
849
+ return {
850
+ invalidZipCode: true,
851
+ };
852
+ }
853
+ return null;
854
+ };
855
+ switch (field.options.type) {
856
+ case models.FieldType.address:
857
+ result = this.fb.group({
858
+ city: ["", required ? [forms.Validators.required] : null],
859
+ street: ["", required ? [forms.Validators.required] : null],
860
+ buildingNumber: ["", required ? [forms.Validators.required] : null],
861
+ flatNumber: [""],
862
+ zipCode: [
863
+ "",
864
+ required
865
+ ? [forms.Validators.required, zipCodeValidator]
866
+ : [zipCodeValidator],
867
+ ],
868
+ });
869
+ break;
870
+ default:
871
+ result = this.fb.control(null);
872
+ break;
873
+ }
874
+ var value = obj[field.key]
875
+ ? obj[field.key]
876
+ : field.options.defaltValue
877
+ ? field.options.defaltValue()
878
+ : null;
879
+ if (value)
880
+ result.setValue(value);
881
+ result.updateValueAndValidity();
882
+ return result;
971
883
  };
972
- return StyleService;
884
+ return FormFactory;
973
885
  }());
974
- StyleService.style = null;
975
886
  /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
976
- StyleService.decorators = [
887
+ FormFactory.decorators = [
977
888
  { type: i0.Injectable }
978
889
  ];
979
890
  /**
@@ -983,329 +894,339 @@
983
894
  * })>}
984
895
  * @nocollapse
985
896
  */
986
- StyleService.ctorParameters = function () { return [
987
- { type: i1.Platform },
988
- { type: Object, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] }
897
+ FormFactory.ctorParameters = function () { return [
898
+ { type: forms.FormBuilder },
899
+ { type: AuthService },
900
+ { type: DetailsService },
901
+ { type: IModelValidatorsProvider, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [MODEL_VALIDATORS_PROVIDER,] }] }
989
902
  ]; };
990
903
 
991
- var FINGERPRINT_PLATFORMS = [
992
- 'android',
993
- 'ios', 'ipad'
994
- ];
995
- var FingerprintService = /** @class */ (function () {
996
- function FingerprintService(platform, faio, translateService, storageService) {
997
- this.platform = platform;
998
- this.faio = faio;
999
- this.translateService = translateService;
1000
- this.storageService = storageService;
904
+ var SharedFactoriesModule = /** @class */ (function () {
905
+ function SharedFactoriesModule() {
1001
906
  }
1002
- FingerprintService.prototype.isSet = function () {
1003
- return FingerprintService.set || !!this.storageService.getItem('FINGERPINT_SET');
1004
- };
1005
- FingerprintService.prototype.setData = function (data) {
1006
- return __awaiter(this, void 0, void 0, function () {
1007
- var _a;
1008
- var _this = this;
1009
- return __generator(this, function (_b) {
1010
- switch (_b.label) {
1011
- case 0:
1012
- _a = !this.isSet() && FINGERPRINT_PLATFORMS.some(function (p) { return _this.platform.is(p); });
1013
- if (!_a) return [3 /*break*/, 2];
1014
- return [4 /*yield*/, this.faio.isAvailable()];
1015
- case 1:
1016
- _a = (_b.sent());
1017
- _b.label = 2;
1018
- case 2:
1019
- if (!_a) return [3 /*break*/, 4];
1020
- return [4 /*yield*/, this.faio.registerBiometricSecret({
1021
- secret: JSON.stringify(data)
1022
- })];
1023
- case 3:
1024
- _b.sent();
1025
- this.storageService.setItem('FINGERPINT_SET', "1");
1026
- FingerprintService.set = true;
1027
- return [2 /*return*/];
1028
- case 4: return [2 /*return*/];
1029
- }
1030
- });
1031
- });
1032
- };
1033
- FingerprintService.prototype.clearData = function () {
1034
- return __awaiter(this, void 0, void 0, function () {
1035
- return __generator(this, function (_a) {
1036
- this.storageService.removeItem('FINGERPINT_SET');
1037
- FingerprintService.set = false;
1038
- return [2 /*return*/];
1039
- });
1040
- });
1041
- };
1042
- FingerprintService.prototype.getDate = function (options) {
1043
- if (options === void 0) { options = {}; }
1044
- return __awaiter(this, void 0, void 0, function () {
1045
- var data;
1046
- return __generator(this, function (_a) {
1047
- switch (_a.label) {
1048
- case 0:
1049
- if (!options.force && !this.isSet())
1050
- return [2 /*return*/, null];
1051
- FingerprintService.set = true;
1052
- return [4 /*yield*/, this.faio.loadBiometricSecret({
1053
- title: this.translateService.instant('APP.signIn'),
1054
- cancelButtonTitle: this.translateService.instant('cancel')
1055
- })];
1056
- case 1:
1057
- data = _a.sent();
1058
- // // to tests
1059
- // const data = localStorage.getItem('TEST_FINGERPINT');
1060
- return [2 /*return*/, JSON.parse(data)];
1061
- }
1062
- });
1063
- });
1064
- };
1065
- return FingerprintService;
907
+ return SharedFactoriesModule;
1066
908
  }());
1067
- FingerprintService.set = false;
1068
909
  /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1069
- FingerprintService.decorators = [
1070
- { type: i0.Injectable }
1071
- ];
1072
- /**
1073
- * @type {function(): !Array<(null|{
1074
- * type: ?,
1075
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
1076
- * })>}
1077
- * @nocollapse
1078
- */
1079
- FingerprintService.ctorParameters = function () { return [
1080
- { type: i1.Platform },
1081
- { type: ngx.FingerprintAIO },
1082
- { type: core.TranslateService },
1083
- { type: StorageService }
1084
- ]; };
1085
-
1086
- var Camera = core$1.Plugins.Camera;
1087
- var CameraService = /** @class */ (function () {
1088
- function CameraService() {
1089
- }
1090
- CameraService.prototype.getCapture = function (options) {
1091
- if (options === void 0) { options = {}; }
1092
- return __awaiter(this, void 0, void 0, function () {
1093
- var image;
1094
- return __generator(this, function (_a) {
1095
- switch (_a.label) {
1096
- case 0: return [4 /*yield*/, Camera.getPhoto({
1097
- quality: options.quality ? options.quality : 100,
1098
- resultType: core$1.CameraResultType.Base64
1099
- })];
1100
- case 1:
1101
- image = _a.sent();
1102
- return [2 /*return*/, {
1103
- data: image.base64String,
1104
- exif: image.exif
1105
- }];
1106
- }
1107
- });
1108
- });
1109
- };
1110
- return CameraService;
1111
- }());
1112
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1113
- CameraService.decorators = [
1114
- { type: i0.Injectable }
910
+ SharedFactoriesModule.decorators = [
911
+ { type: i0.NgModule, args: [{
912
+ imports: [
913
+ forms.ReactiveFormsModule
914
+ ],
915
+ providers: [
916
+ FormFactory
917
+ ]
918
+ },] }
1115
919
  ];
1116
920
 
1117
- var FILE_SERVICE_CONFIG = new i0.InjectionToken('FILE_SERVICE_CONFIG');
1118
- var FileService = /** @class */ (function () {
1119
- function FileService(config, http) {
1120
- this.config = config;
1121
- this.http = http;
1122
- }
1123
- FileService.prototype.upload = function (file, callback) {
1124
- var formData = new FormData();
1125
- formData.append('file', file, file.name);
1126
- return this.http.post(this.config.apiUrl + '/attachments', formData, {
1127
- reportProgress: true,
1128
- observe: 'events'
1129
- }).pipe(operators.map(function (event) {
1130
- if (event.type === http.HttpEventType.UploadProgress) {
1131
- var percentDone = Math.round(100 * event.loaded / event.total);
1132
- return percentDone;
1133
- }
1134
- if (event.type === http.HttpEventType.Response) {
1135
- if (callback)
1136
- callback(event.body);
1137
- return 100;
1138
- }
1139
- }));
1140
- };
1141
- FileService.prototype.download = function (id) {
1142
- window.open(this.getUrl(id), '_blank').focus();
1143
- };
1144
- FileService.prototype.delete = function (id) {
1145
- return this.http.delete(this.config.apiUrl + '/attachments/' + id).toPromise();
1146
- };
1147
- FileService.prototype.getUrl = function (id) {
1148
- return this.config.apiUrl + '/attachments/' + id;
921
+ function setDefaultTranslationsAndLang(service) {
922
+ var map = {
923
+ 'pl': TRANSLATE_DATA_PL,
924
+ 'eng': TRANSLATE_DATA_ENG
1149
925
  };
1150
- return FileService;
1151
- }());
1152
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1153
- FileService.decorators = [
1154
- { type: i0.Injectable }
1155
- ];
1156
- /**
1157
- * @type {function(): !Array<(null|{
1158
- * type: ?,
1159
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
1160
- * })>}
1161
- * @nocollapse
1162
- */
1163
- FileService.ctorParameters = function () { return [
1164
- { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [FILE_SERVICE_CONFIG,] }] },
1165
- { type: http.HttpClient }
1166
- ]; };
1167
-
1168
- var CalendarService = /** @class */ (function () {
1169
- function CalendarService() {
1170
- var _this = this;
1171
- this.state = {
1172
- date: moment__namespace().add(2, 'year'),
1173
- calendar: [
1174
- {
1175
- dates: null,
1176
- monthName: null,
1177
- number: null,
1178
- year: null
1179
- }
1180
- ]
1181
- };
1182
- this.setState = function (nextState) {
1183
- _this.state = Object.assign(Object.assign({}, _this.state), nextState);
1184
- };
1185
- //this service is a singleton therefore its constructor will only
1186
- //be called once during the application life cycle
1187
- this.initCalendar();
926
+ Object.keys(map).forEach(function (key) {
927
+ service.setTranslation(key, map[key], true);
928
+ });
929
+ if (!service.currentLang) {
930
+ var lang = service.getBrowserLang();
931
+ service.use(lang);
1188
932
  }
1189
- CalendarService.prototype.getCalendar = function () {
1190
- return __spreadArray([], __read(this.state.calendar));
1191
- };
1192
- CalendarService.prototype.generatePrevMonths = function () {
1193
- var calendar = this.state.calendar;
1194
- var date = moment__namespace(calendar[0].year + '-' + calendar[0].number + '-01');
1195
- var dateYearAgo = date.clone().subtract(1, 'year');
1196
- while (date.isSameOrAfter(dateYearAgo)) {
1197
- date = date.clone().subtract(1, 'month');
1198
- calendar.unshift(this.generateMonth(date));
933
+ }
934
+ var TRANSLATE_DATA_ENG = {
935
+ details: 'details',
936
+ admin: 'admin',
937
+ add: 'add',
938
+ change: 'change',
939
+ confirm: 'confirm',
940
+ cancel: 'cancel',
941
+ delete: 'delete',
942
+ undo: 'undo',
943
+ search: 'search',
944
+ page: 'page',
945
+ filters: 'filters',
946
+ or: 'or',
947
+ signInQuicklyWith: 'sign in quickly with',
948
+ selected: "selected",
949
+ select: "select",
950
+ show: "show",
951
+ download: "download",
952
+ play: "play",
953
+ writeHere: "write here",
954
+ next: 'next',
955
+ prev: 'prev',
956
+ edit: "edit",
957
+ save: "save",
958
+ noResults: "no results",
959
+ CALENDAR: {
960
+ DAY_OF_WEEK: {
961
+ Mon: 'Mon',
962
+ Tue: 'Tue',
963
+ Wed: 'Wed',
964
+ Thu: 'Thu',
965
+ Fri: 'Fri',
966
+ Sat: 'Sat',
967
+ Sun: 'Sun',
968
+ },
969
+ MONTH: {
970
+ January: "January",
971
+ February: "February",
972
+ March: "March",
973
+ April: "April",
974
+ May: "May",
975
+ June: "June",
976
+ July: "July",
977
+ August: "August",
978
+ September: "September",
979
+ October: "October",
980
+ November: "November",
981
+ December: "December"
982
+ },
983
+ Today: "Today",
984
+ LastSevenDays: "Last 7 days",
985
+ ThisMonth: "This month",
986
+ Yesterday: "Yesterday",
987
+ LastThirtyDays: "Last 30 days",
988
+ LastMonth: "Last month"
989
+ },
990
+ OBJECT: {
991
+ deleted: 'object deleted',
992
+ confirmDelete: 'confirm delete object'
993
+ },
994
+ APP: {
995
+ logout: 'log out',
996
+ signIn: 'sign in',
997
+ logged: 'logged'
998
+ },
999
+ MODEL: {
1000
+ body: 'body',
1001
+ buildingNumber: 'building number',
1002
+ city: 'city',
1003
+ date: 'date',
1004
+ disabled: 'disabled',
1005
+ email: 'email',
1006
+ file: 'file',
1007
+ firstName: 'first name',
1008
+ flatNumber: 'flat number',
1009
+ lastName: 'last name',
1010
+ password: 'password',
1011
+ passwordConfirm: 'confirm password',
1012
+ passwordReset: 'reset password',
1013
+ permissions: 'permissions',
1014
+ price: 'price',
1015
+ send: 'send',
1016
+ street: 'street',
1017
+ username: 'user name',
1018
+ zipCode: 'zip code',
1019
+ },
1020
+ INPUT: {
1021
+ ERRORS: {
1022
+ required: 'field is required',
1023
+ requires: 'fields are required',
1024
+ invalidNip: 'Invalid nip format',
1025
+ invalidUnique: 'Invalid unique value',
1026
+ invalidFileType: 'Invalid file type',
1027
+ confirm: 'bad confirmed',
1028
+ invalidEmailFormat: "invalid email format",
1029
+ invalidPhoneNumberFormat: "invalid phone number (000000000)",
1030
+ invalidPeselFormat: "invalid pesel",
1031
+ invalidMinLength: "min length",
1032
+ invalidMaxLength: "max length",
1033
+ invalidMin: 'min value',
1034
+ invalidMax: 'max value',
1035
+ upperLetters: "upper letters",
1036
+ lowerLetters: "lower letters",
1037
+ symbols: "string"
1038
+ },
1039
+ 'PASSWORD-STRENGTH': {
1040
+ poor: 'poor',
1041
+ notGood: 'not ood',
1042
+ good: 'good'
1199
1043
  }
1200
- };
1201
- CalendarService.prototype.generateNextMonths = function () {
1202
- var calendar = this.state.calendar;
1203
- var dateString = calendar[calendar.length - 1].year + '-' + calendar[calendar.length - 1].number + '-01';
1204
- var date = moment__namespace(dateString);
1205
- var dateYearNext = date.clone().add(1, 'year');
1206
- while (date.isSameOrBefore(dateYearNext)) {
1207
- date = date.clone().add(1, 'month');
1208
- calendar.push(this.generateMonth(date));
1209
- }
1210
- };
1211
- CalendarService.prototype.initCalendar = function () {
1212
- var date = this.state.date;
1213
- var firstMonth = this.generateMonth(date);
1214
- var calendar = [firstMonth];
1215
- var currentDate = moment__namespace().clone();
1216
- var dateYearAgo = currentDate.clone().subtract(2, 'year');
1217
- while (date.isSameOrAfter(dateYearAgo)) { // creating one year calendar
1218
- calendar.unshift(this.previousMonth());
1219
- }
1220
- this.state.date = moment__namespace();
1221
- var currentMonthIndex = calendar.length - 13;
1222
- calendar[currentMonthIndex].dates = calendar[currentMonthIndex].dates.filter(this.filterFutureDates);
1223
- this.setState({ calendar: calendar });
1224
- };
1225
- CalendarService.prototype.previousMonth = function () {
1226
- var date = this.state.date;
1227
- var newDate = date.subtract(1, 'month');
1228
- var m = this.generateMonth(newDate);
1229
- this.setState({ date: newDate });
1230
- return m;
1231
- };
1232
- CalendarService.prototype.filterFutureDates = function (date) {
1233
- if (!date) {
1234
- return true;
1044
+ },
1045
+ ERRORS: {
1046
+ invalidUsernameOrPassword: 'Invalid username or password',
1047
+ other: 'Error'
1048
+ }
1049
+ };
1050
+ var TRANSLATE_DATA_PL = {
1051
+ details: 'szczegóły',
1052
+ admin: 'administrator',
1053
+ add: 'dodaj',
1054
+ change: 'zmień',
1055
+ confirm: 'potwierdź',
1056
+ cancel: 'anuluj',
1057
+ delete: 'usuń',
1058
+ undo: 'cofnij',
1059
+ search: 'wyszukaj',
1060
+ page: 'strona',
1061
+ filters: 'filtry',
1062
+ or: 'lub',
1063
+ signInQuicklyWith: 'szybko zaloguj się za pomocą',
1064
+ selected: "wybrano",
1065
+ select: "wybierz",
1066
+ show: "pokaż",
1067
+ download: "pobierz",
1068
+ play: "włącz",
1069
+ writeHere: "napisz tutaj",
1070
+ next: 'dalej',
1071
+ prev: 'wstecz',
1072
+ edit: "edycja",
1073
+ save: "zapisz",
1074
+ noResults: "brak wyników",
1075
+ CALENDAR: {
1076
+ DAY_OF_WEEK: {
1077
+ Mon: 'Pon',
1078
+ Tue: 'Wto',
1079
+ Wed: 'Śro',
1080
+ Thu: 'Czw',
1081
+ Fri: 'Pio',
1082
+ Sat: 'Sob',
1083
+ Sun: 'Nie',
1084
+ },
1085
+ MONTH: {
1086
+ January: "Styczeń",
1087
+ February: "Luty",
1088
+ March: "Marzec",
1089
+ April: "Kwiecień",
1090
+ May: "Maj",
1091
+ June: "Czerwiec",
1092
+ July: "Lipiec",
1093
+ August: "Sierpień",
1094
+ September: "Wrzesień",
1095
+ October: "Październik",
1096
+ November: "Listopad",
1097
+ December: "Grudzień"
1098
+ },
1099
+ Today: "Dzisiaj",
1100
+ LastSevenDays: "Ostatnie 7 dnii",
1101
+ ThisMonth: "Ten miesiąc",
1102
+ Yesterday: "Wczoraj",
1103
+ LastThirtyDays: "Ostatnie 30 dni",
1104
+ LastMonth: "Ostatni miesiąc"
1105
+ },
1106
+ OBJECT: {
1107
+ deleted: 'obiekt został usunięty',
1108
+ confirmDelete: 'potwierdź usunięcie'
1109
+ },
1110
+ APP: {
1111
+ logout: 'wyloguj się',
1112
+ logged: 'zalogowany',
1113
+ signIn: 'zaloguj się'
1114
+ },
1115
+ MODEL: {
1116
+ body: 'treść',
1117
+ buildingNumber: 'numer budynku',
1118
+ city: 'miasto',
1119
+ date: 'data',
1120
+ disabled: 'nieaktywny',
1121
+ email: 'email',
1122
+ file: 'plik',
1123
+ firstName: 'imię',
1124
+ flatNumber: 'numer lokalu',
1125
+ lastName: 'nazwisko',
1126
+ password: 'hasło',
1127
+ passwordConfirm: 'powtórz hasło',
1128
+ passwordReset: 'Nie pamiętam hasła',
1129
+ permissions: 'uprawnienia',
1130
+ price: 'cena',
1131
+ send: 'wyślij',
1132
+ street: 'ulica',
1133
+ username: 'nazwa użytkownika',
1134
+ zipCode: 'kod pocztowy',
1135
+ },
1136
+ INPUT: {
1137
+ ERRORS: {
1138
+ required: 'to pole jest wymagane',
1139
+ requires: 'te pola są wymagane',
1140
+ invalidNip: 'niepoprawny format nip',
1141
+ invalidUnique: 'wartość jest już w systemie',
1142
+ confirm: 'źle powtórzone',
1143
+ invalidEmailFormat: "niepoprawny adres email",
1144
+ invalidFileType: 'niepoprawny format pliku',
1145
+ invalidPhoneNumberFormat: "niepoprawny numer telefonu (000000000)",
1146
+ invalidPeselFormat: "niepoprawny numer pesel",
1147
+ invalidMinLength: "minimalna długość",
1148
+ invalidMaxLength: "maksymalna długość",
1149
+ invalidMin: "minimalna wartość",
1150
+ invalidMax: "maksymalna wartość",
1151
+ upperLetters: "duże litery",
1152
+ lowerLetters: "małe litery",
1153
+ symbols: "znaki specjalne"
1154
+ },
1155
+ 'PASSWORD-STRENGTH': {
1156
+ poor: 'bardzo słabe',
1157
+ notGood: 'słabe',
1158
+ good: 'dobre'
1235
1159
  }
1236
- return date.isSameOrBefore(moment__namespace());
1237
- };
1238
- CalendarService.prototype.generateMonth = function (date) {
1239
- var firstDay = moment__namespace(date).startOf('month');
1240
- var monthName = moment__namespace(date).format('MMMM');
1241
- var year = moment__namespace(date).format('YYYY');
1242
- var number = moment__namespace(date).format('MM');
1243
- var monthLength = date.daysInMonth();
1244
- var totalDatesInMonth = this.generateMonthDates(firstDay, monthLength);
1245
- var emptyCellsBeforeFirstDay = Array(firstDay.weekday()).fill(null);
1246
- var dates = __spreadArray(__spreadArray([], __read(emptyCellsBeforeFirstDay)), __read(totalDatesInMonth));
1247
- return {
1248
- dates: dates,
1249
- monthName: monthName,
1250
- number: number,
1251
- year: year
1252
- };
1253
- };
1254
- CalendarService.prototype.generateMonthDates = function (firstDay, length) {
1255
- return Array(length).fill(null).map(function (v, i) { return moment__namespace(firstDay).add(i, 'day'); });
1256
- };
1257
- return CalendarService;
1258
- }());
1259
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1260
- CalendarService.decorators = [
1261
- { type: i0.Injectable }
1262
- ];
1263
- /**
1264
- * @type {function(): !Array<(null|{
1265
- * type: ?,
1266
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
1267
- * })>}
1268
- * @nocollapse
1269
- */
1270
- CalendarService.ctorParameters = function () { return []; };
1160
+ },
1161
+ ERRORS: {
1162
+ invalidUsernameOrPassword: 'Niepoprawna nazwa użytkownika, lub hasło',
1163
+ other: 'Wystąpił błąd'
1164
+ }
1165
+ };
1271
1166
 
1272
- var UIService = /** @class */ (function () {
1273
- function UIService(loadingController, alertController, toastController) {
1274
- this.loadingController = loadingController;
1275
- this.alertController = alertController;
1276
- this.toastController = toastController;
1167
+ var ToastService = /** @class */ (function () {
1168
+ function ToastService(toastCtrl) {
1169
+ this.toastCtrl = toastCtrl;
1277
1170
  }
1278
- UIService.prototype.showLoading = function (msg) {
1171
+ ToastService.prototype.addLockError = function () {
1172
+ ++ToastService.lockError;
1173
+ };
1174
+ ToastService.prototype.removeLockError = function () {
1175
+ --ToastService.lockError;
1176
+ };
1177
+ ToastService.prototype.error = function (config) {
1279
1178
  return __awaiter(this, void 0, void 0, function () {
1280
- var loader;
1179
+ var toast;
1281
1180
  return __generator(this, function (_a) {
1282
1181
  switch (_a.label) {
1283
- case 0: return [4 /*yield*/, this.loadingController.create({
1284
- message: msg || 'loading...',
1285
- })];
1182
+ case 0:
1183
+ if (ToastService.lockError)
1184
+ return [2 /*return*/];
1185
+ return [4 /*yield*/, this.toastCtrl.create({
1186
+ position: 'bottom',
1187
+ header: config.title,
1188
+ message: config.message,
1189
+ duration: config.duration ? config.duration : 2000,
1190
+ buttons: config.buttons ? config.buttons.map(function (b) {
1191
+ return {
1192
+ text: b.text,
1193
+ side: b.position,
1194
+ role: 'cancel',
1195
+ handler: b.handler
1196
+ };
1197
+ }) : null
1198
+ })];
1286
1199
  case 1:
1287
- loader = _a.sent();
1288
- return [4 /*yield*/, loader.present()];
1200
+ toast = _a.sent();
1201
+ return [4 /*yield*/, toast.present()];
1289
1202
  case 2:
1290
1203
  _a.sent();
1291
- return [2 /*return*/, loader];
1204
+ return [2 /*return*/];
1292
1205
  }
1293
1206
  });
1294
1207
  });
1295
1208
  };
1296
- UIService.prototype.showSimpleAlert = function (msg, heading) {
1209
+ ToastService.prototype.info = function (config) {
1297
1210
  return __awaiter(this, void 0, void 0, function () {
1298
- var alert;
1211
+ var toast;
1299
1212
  return __generator(this, function (_a) {
1300
1213
  switch (_a.label) {
1301
- case 0: return [4 /*yield*/, this.alertController.create({
1302
- header: heading || 'Alert',
1303
- message: msg,
1304
- buttons: ['OK']
1214
+ case 0: return [4 /*yield*/, this.toastCtrl.create({
1215
+ position: 'bottom',
1216
+ header: config.title,
1217
+ message: config.message,
1218
+ duration: config.duration ? config.duration : 2000,
1219
+ buttons: config.buttons ? config.buttons.map(function (b) {
1220
+ return {
1221
+ text: b.text,
1222
+ side: b.position,
1223
+ handler: b.handler
1224
+ };
1225
+ }) : null
1305
1226
  })];
1306
1227
  case 1:
1307
- alert = _a.sent();
1308
- return [4 /*yield*/, alert.present()];
1228
+ toast = _a.sent();
1229
+ return [4 /*yield*/, toast.present()];
1309
1230
  case 2:
1310
1231
  _a.sent();
1311
1232
  return [2 /*return*/];
@@ -1313,53 +1234,11 @@
1313
1234
  });
1314
1235
  });
1315
1236
  };
1316
- UIService.prototype.showAlertWithDismissCallback = function (heading, msg, btnText, callback) {
1317
- return __awaiter(this, void 0, void 0, function () {
1318
- var alert;
1319
- return __generator(this, function (_a) {
1320
- switch (_a.label) {
1321
- case 0: return [4 /*yield*/, this.alertController.create({
1322
- header: heading,
1323
- message: msg,
1324
- buttons: [
1325
- {
1326
- text: btnText,
1327
- }
1328
- ]
1329
- })];
1330
- case 1:
1331
- alert = _a.sent();
1332
- return [4 /*yield*/, alert.present()];
1333
- case 2:
1334
- _a.sent();
1335
- alert.onDidDismiss().then(function () { callback(); });
1336
- return [2 /*return*/];
1337
- }
1338
- });
1339
- });
1340
- };
1341
- UIService.prototype.showToast = function (msg, duration) {
1342
- return __awaiter(this, void 0, void 0, function () {
1343
- var toast;
1344
- return __generator(this, function (_a) {
1345
- switch (_a.label) {
1346
- case 0: return [4 /*yield*/, this.toastController.create({
1347
- message: msg,
1348
- color: 'dark',
1349
- duration: duration || 2000
1350
- })];
1351
- case 1:
1352
- toast = _a.sent();
1353
- toast.present();
1354
- return [2 /*return*/, toast];
1355
- }
1356
- });
1357
- });
1358
- };
1359
- return UIService;
1237
+ return ToastService;
1360
1238
  }());
1239
+ ToastService.lockError = 0;
1361
1240
  /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1362
- UIService.decorators = [
1241
+ ToastService.decorators = [
1363
1242
  { type: i0.Injectable }
1364
1243
  ];
1365
1244
  /**
@@ -1369,36 +1248,48 @@
1369
1248
  * })>}
1370
1249
  * @nocollapse
1371
1250
  */
1372
- UIService.ctorParameters = function () { return [
1373
- { type: i1.LoadingController },
1374
- { type: i1.AlertController },
1251
+ ToastService.ctorParameters = function () { return [
1375
1252
  { type: i1.ToastController }
1376
1253
  ]; };
1377
1254
 
1378
- var AlertService = /** @class */ (function () {
1379
- function AlertService(alertCtrl) {
1380
- this.alertCtrl = alertCtrl;
1255
+ var ErrorService = /** @class */ (function () {
1256
+ function ErrorService(toastService, translateService) {
1257
+ this.toastService = toastService;
1258
+ this.translateService = translateService;
1381
1259
  }
1382
- AlertService.prototype.show = function (options) {
1260
+ ErrorService.prototype.log = function (obj) {
1383
1261
  return __awaiter(this, void 0, void 0, function () {
1384
- var alert;
1262
+ var message;
1385
1263
  return __generator(this, function (_a) {
1386
1264
  switch (_a.label) {
1387
- case 0: return [4 /*yield*/, this.alertCtrl.create(options)];
1265
+ case 0:
1266
+ message = '';
1267
+ if (!(obj instanceof http.HttpErrorResponse)) return [3 /*break*/, 2];
1268
+ if (!(obj.error && obj.error.details === 'Invalid username or password')) return [3 /*break*/, 2];
1269
+ return [4 /*yield*/, this.translateService.get('ERRORS.invalidUsernameOrPassword').toPromise()];
1388
1270
  case 1:
1389
- alert = _a.sent();
1390
- return [4 /*yield*/, alert.present()];
1271
+ message = _a.sent();
1272
+ _a.label = 2;
1391
1273
  case 2:
1274
+ if (!!message) return [3 /*break*/, 4];
1275
+ return [4 /*yield*/, this.translateService.get('ERRORS.other').toPromise()];
1276
+ case 3:
1277
+ message = _a.sent();
1278
+ _a.label = 4;
1279
+ case 4:
1280
+ console.error(obj);
1281
+ return [4 /*yield*/, this.toastService.error({ message: message })];
1282
+ case 5:
1392
1283
  _a.sent();
1393
1284
  return [2 /*return*/];
1394
1285
  }
1395
1286
  });
1396
1287
  });
1397
1288
  };
1398
- return AlertService;
1289
+ return ErrorService;
1399
1290
  }());
1400
1291
  /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1401
- AlertService.decorators = [
1292
+ ErrorService.decorators = [
1402
1293
  { type: i0.Injectable }
1403
1294
  ];
1404
1295
  /**
@@ -1408,171 +1299,184 @@
1408
1299
  * })>}
1409
1300
  * @nocollapse
1410
1301
  */
1411
- AlertService.ctorParameters = function () { return [
1412
- { type: i1.AlertController }
1302
+ ErrorService.ctorParameters = function () { return [
1303
+ { type: ToastService },
1304
+ { type: core.TranslateService }
1413
1305
  ]; };
1414
1306
 
1415
- var SharedServicesModule = /** @class */ (function () {
1416
- function SharedServicesModule() {
1417
- }
1418
- return SharedServicesModule;
1419
- }());
1420
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1421
- SharedServicesModule.decorators = [
1422
- { type: i0.NgModule, args: [{
1423
- imports: [
1424
- i1.IonicModule,
1425
- core.TranslateModule.forChild(),
1426
- ngxCookie.CookieModule.forRoot(),
1427
- ],
1428
- providers: [
1429
- ToastService,
1430
- ErrorService,
1431
- HardwareService,
1432
- ModalService,
1433
- DynamicComponentLoader,
1434
- PopoverService,
1435
- StorageService,
1436
- StyleService,
1437
- AuthService,
1438
- FingerprintService,
1439
- ngx.FingerprintAIO,
1440
- CameraService,
1441
- FileService,
1442
- CalendarService,
1443
- UIService,
1444
- AlertService
1445
- ],
1446
- },] }
1447
- ];
1448
-
1449
- /**
1450
- * Only to use in smart-page
1451
- * @requires PageComponent
1452
- */
1453
- var MenuService = /** @class */ (function () {
1454
- function MenuService(menuCtrl, resolver) {
1455
- this.menuCtrl = menuCtrl;
1456
- this.resolver = resolver;
1457
- this._openedEnd = false;
1458
- this._menuItemsSource = new rxjs.BehaviorSubject([]);
1459
- this.menuItems$ = this._menuItemsSource.asObservable();
1307
+ var HardwareService = /** @class */ (function () {
1308
+ function HardwareService(platform) {
1309
+ this.platform = platform;
1460
1310
  }
1461
- Object.defineProperty(MenuService.prototype, "openedEnd", {
1462
- /**
1463
- * @desc checking if the menu is open (menu on the right side of the screen)
1464
- */
1311
+ Object.defineProperty(HardwareService.prototype, "isMobile", {
1465
1312
  get: function () {
1466
- return this._openedEnd;
1313
+ return this.platform.is('capacitor');
1467
1314
  },
1468
1315
  enumerable: false,
1469
1316
  configurable: true
1470
1317
  });
1471
- MenuService.prototype.changeMenuItemByRoute = function (route, changes) {
1472
- var items = this._menuItemsSource.value.map(function (i) {
1473
- if (i.route === route)
1474
- return Object.assign(Object.assign({}, i), changes);
1475
- return i;
1318
+ Object.defineProperty(HardwareService.prototype, "isMobileWeb", {
1319
+ get: function () {
1320
+ return this.platform.is('mobileweb');
1321
+ },
1322
+ enumerable: false,
1323
+ configurable: true
1324
+ });
1325
+ HardwareService.prototype.onBackButtonClick = function (callback) {
1326
+ return core$1.App.addListener('backButton', function () {
1327
+ callback();
1476
1328
  });
1477
- this._menuItemsSource.next(items);
1478
- };
1479
- MenuService.prototype.setMenuItems = function (items) {
1480
- this._menuItemsSource.next(items);
1481
1329
  };
1482
- /**
1483
- * @private
1484
- */
1485
- MenuService.prototype.init = function (endContainer) {
1486
- return __awaiter(this, void 0, void 0, function () {
1487
- return __generator(this, function (_a) {
1488
- switch (_a.label) {
1489
- case 0:
1490
- this._endContainer = endContainer;
1491
- return [4 /*yield*/, this.menuCtrl.close("end")];
1492
- case 1:
1493
- _a.sent();
1494
- return [2 /*return*/];
1495
- }
1496
- });
1497
- });
1330
+ return HardwareService;
1331
+ }());
1332
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1333
+ HardwareService.decorators = [
1334
+ { type: i0.Injectable }
1335
+ ];
1336
+ /**
1337
+ * @type {function(): !Array<(null|{
1338
+ * type: ?,
1339
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
1340
+ * })>}
1341
+ * @nocollapse
1342
+ */
1343
+ HardwareService.ctorParameters = function () { return [
1344
+ { type: i1.Platform }
1345
+ ]; };
1346
+
1347
+ var ModalService = /** @class */ (function () {
1348
+ function ModalService(modalCtrl, navParams) {
1349
+ this.modalCtrl = modalCtrl;
1350
+ this.navParams = navParams;
1351
+ }
1352
+ ModalService.prototype.getParam = function (key) {
1353
+ var _a;
1354
+ return (_a = this.navParams) === null || _a === void 0 ? void 0 : _a.get(key);
1498
1355
  };
1499
- /**
1500
- * @desc open menu (menu on the right side of the screen)
1501
- * @param {object} options - use options
1502
- * @param {class} options.component - angular component to render
1503
- * @param {class} options.injector - angular injector to use in component
1504
- */
1505
- MenuService.prototype.openEnd = function (options) {
1356
+ ModalService.prototype.show = function (options) {
1506
1357
  return __awaiter(this, void 0, void 0, function () {
1507
- var resolver, factory;
1508
- return __generator(this, function (_a) {
1509
- switch (_a.label) {
1358
+ var modalOptions, modal;
1359
+ return __generator(this, function (_b) {
1360
+ switch (_b.label) {
1510
1361
  case 0:
1511
- this._openedEnd = true;
1512
- resolver = options.injector.get(i0.ComponentFactoryResolver);
1513
- this._endContainer.clear();
1514
- factory = resolver.resolveComponentFactory(options.component);
1515
- this._endContainer.createComponent(factory, 0, options.injector);
1516
- return [4 /*yield*/, this.menuCtrl.enable(true, "end")];
1362
+ modalOptions = {
1363
+ component: options.component,
1364
+ componentProps: options.props,
1365
+ cssClass: options.cssClass ? options.cssClass : [],
1366
+ backdropDismiss: options.backdropDismiss
1367
+ };
1368
+ if (options.mode === "bottom") {
1369
+ modalOptions.cssClass.push('smart-modal-bottom');
1370
+ }
1371
+ return [4 /*yield*/, this.modalCtrl.create(modalOptions)];
1517
1372
  case 1:
1518
- _a.sent();
1519
- return [4 /*yield*/, this.menuCtrl.open("end")];
1373
+ modal = _b.sent();
1374
+ return [4 /*yield*/, modal.present()];
1520
1375
  case 2:
1521
- _a.sent();
1522
- return [2 /*return*/];
1376
+ _b.sent();
1377
+ return [2 /*return*/, modal];
1523
1378
  }
1524
1379
  });
1525
1380
  });
1526
1381
  };
1527
- /**
1528
- * @desc close menu (menu on the left side of the screen)
1529
- */
1530
- MenuService.prototype.closeStart = function () {
1382
+ ModalService.prototype.dismiss = function (data) {
1383
+ if (data === void 0) { data = null; }
1531
1384
  return __awaiter(this, void 0, void 0, function () {
1532
- return __generator(this, function (_a) {
1533
- switch (_a.label) {
1534
- case 0:
1535
- this._openedEnd = false;
1536
- return [4 /*yield*/, this.menuCtrl.close("start")];
1385
+ return __generator(this, function (_b) {
1386
+ switch (_b.label) {
1387
+ case 0: return [4 /*yield*/, this.modalCtrl.dismiss(data)];
1537
1388
  case 1:
1538
- _a.sent();
1539
- return [4 /*yield*/, this.menuCtrl.enable(false, "start")];
1540
- case 2:
1541
- _a.sent();
1389
+ _b.sent();
1542
1390
  return [2 /*return*/];
1543
1391
  }
1544
1392
  });
1545
1393
  });
1546
1394
  };
1547
- /**
1548
- * @desc close menu (menu on the right side of the screen)
1549
- */
1550
- MenuService.prototype.closeEnd = function () {
1395
+ return ModalService;
1396
+ }());
1397
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1398
+ ModalService.decorators = [
1399
+ { type: i0.Injectable }
1400
+ ];
1401
+ /**
1402
+ * @type {function(): !Array<(null|{
1403
+ * type: ?,
1404
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
1405
+ * })>}
1406
+ * @nocollapse
1407
+ */
1408
+ ModalService.ctorParameters = function () { return [
1409
+ { type: i1.ModalController },
1410
+ { type: i1.NavParams, decorators: [{ type: i0.Optional }] }
1411
+ ]; };
1412
+
1413
+ var DynamicComponentLoader = /** @class */ (function () {
1414
+ function DynamicComponentLoader(resolver, injector) {
1415
+ this.resolver = resolver;
1416
+ this.injector = injector;
1417
+ }
1418
+ DynamicComponentLoader.prototype.getComponentsWithFactories = function (options) {
1419
+ return __awaiter(this, void 0, void 0, function () {
1420
+ var components, result;
1421
+ var _this = this;
1422
+ return __generator(this, function (_a) {
1423
+ components = [];
1424
+ components = options.components.filter(function (comp) { return !DynamicComponentLoader.declaredComponents.some(function (dec) { return dec.component === comp; }); }) || [];
1425
+ result = options.components.map(function (c) {
1426
+ var factory = _this.resolver.resolveComponentFactory(c);
1427
+ if (!factory) {
1428
+ factory = DynamicComponentLoader.declaredComponents.find(function (x) { return x.component === c; }).factory;
1429
+ }
1430
+ return {
1431
+ component: c,
1432
+ factory: factory,
1433
+ };
1434
+ });
1435
+ DynamicComponentLoader.declaredComponents = __spreadArray(__spreadArray([], __read(DynamicComponentLoader.declaredComponents)), __read(result));
1436
+ return [2 /*return*/, result];
1437
+ });
1438
+ });
1439
+ };
1440
+ return DynamicComponentLoader;
1441
+ }());
1442
+ DynamicComponentLoader.declaredComponents = [];
1443
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1444
+ DynamicComponentLoader.decorators = [
1445
+ { type: i0.Injectable }
1446
+ ];
1447
+ /**
1448
+ * @type {function(): !Array<(null|{
1449
+ * type: ?,
1450
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
1451
+ * })>}
1452
+ * @nocollapse
1453
+ */
1454
+ DynamicComponentLoader.ctorParameters = function () { return [
1455
+ { type: i0.ComponentFactoryResolver },
1456
+ { type: i0.Injector }
1457
+ ]; };
1458
+
1459
+ var PopoverService = /** @class */ (function () {
1460
+ function PopoverService(popoverCtrl) {
1461
+ this.popoverCtrl = popoverCtrl;
1462
+ }
1463
+ PopoverService.prototype.close = function () {
1551
1464
  return __awaiter(this, void 0, void 0, function () {
1552
1465
  return __generator(this, function (_a) {
1553
1466
  switch (_a.label) {
1554
- case 0:
1555
- this._openedEnd = false;
1556
- return [4 /*yield*/, this.menuCtrl.close("end")];
1467
+ case 0: return [4 /*yield*/, this.popoverCtrl.dismiss()];
1557
1468
  case 1:
1558
1469
  _a.sent();
1559
- return [4 /*yield*/, this.menuCtrl.enable(false, "end")];
1560
- case 2:
1561
- _a.sent();
1562
- this._endContainer.clear();
1563
1470
  return [2 /*return*/];
1564
1471
  }
1565
1472
  });
1566
1473
  });
1567
1474
  };
1568
- return MenuService;
1475
+ return PopoverService;
1569
1476
  }());
1570
- /** @nocollapse */ MenuService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function MenuService_Factory() { return new MenuService(i0__namespace.ɵɵinject(i1__namespace.MenuController), i0__namespace.ɵɵinject(i0__namespace.ComponentFactoryResolver)); }, token: MenuService, providedIn: "root" });
1571
1477
  /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1572
- MenuService.decorators = [
1573
- { type: i0.Injectable, args: [{
1574
- providedIn: "root",
1575
- },] }
1478
+ PopoverService.decorators = [
1479
+ { type: i0.Injectable }
1576
1480
  ];
1577
1481
  /**
1578
1482
  * @type {function(): !Array<(null|{
@@ -1581,355 +1485,194 @@
1581
1485
  * })>}
1582
1486
  * @nocollapse
1583
1487
  */
1584
- MenuService.ctorParameters = function () { return [
1585
- { type: i1.MenuController },
1586
- { type: i0.ComponentFactoryResolver }
1488
+ PopoverService.ctorParameters = function () { return [
1489
+ { type: i1.PopoverController }
1587
1490
  ]; };
1588
1491
 
1589
- var AppService = /** @class */ (function () {
1590
- function AppService() {
1591
- this.endButtons$ = AppService._endButtonsSource$.asObservable();
1492
+ var StyleService = /** @class */ (function () {
1493
+ function StyleService(platform, platformId) {
1494
+ this.platform = platform;
1495
+ this.platformId = platformId;
1592
1496
  }
1593
- AppService.prototype.addEndButton = function (button) {
1594
- if (button.id) {
1595
- var exist_1 = AppService._endButtonsSource$.value.find(function (e) { return e.id === button.id; });
1596
- if (exist_1) {
1597
- Object.keys(button).filter(function (k) { return k !== 'id'; }).forEach(function (key) {
1598
- exist_1[key] = button[key];
1599
- });
1600
- AppService._endButtonsSource$.next(__spreadArray([], __read(AppService._endButtonsSource$.value)));
1601
- return;
1602
- }
1603
- }
1604
- AppService._endButtonsSource$.next(utils.ArrayService.addItem(AppService._endButtonsSource$.value, button));
1497
+ StyleService.create = function (platform, platformId, el, style) {
1498
+ var result = new StyleService(platform, platformId);
1499
+ result.init(el, style);
1500
+ return result;
1605
1501
  };
1606
- AppService.prototype.removeEndButton = function (buttonOrId) {
1607
- if (typeof buttonOrId === 'object') {
1608
- var button = buttonOrId.id ?
1609
- AppService._endButtonsSource$.value.find(function (e) { return e.id === buttonOrId.id; })
1610
- : buttonOrId;
1611
- AppService._endButtonsSource$.next(utils.ArrayService.removeItem(AppService._endButtonsSource$.value, button));
1502
+ StyleService.prototype.init = function (el, style) {
1503
+ this._elementRef = el;
1504
+ this.set(style);
1505
+ };
1506
+ StyleService.prototype.set = function (style) {
1507
+ if (!style)
1508
+ style = {};
1509
+ if (!StyleService.style)
1510
+ StyleService.style = {};
1511
+ StyleService.style = Object.assign(Object.assign({}, StyleService.style), style);
1512
+ this.execute();
1513
+ };
1514
+ StyleService.prototype.execute = function () {
1515
+ this.setColor('primary');
1516
+ this.setColor('secondary');
1517
+ this.setColor('tertiary');
1518
+ this.setColor('success');
1519
+ this.setColor('warning');
1520
+ this.setColor('danger');
1521
+ this.setColor('dark');
1522
+ this.setColor('medium');
1523
+ this.setColor('light');
1524
+ this.setFont();
1525
+ this.setButton();
1526
+ this.setMobileBreakpoint();
1527
+ };
1528
+ StyleService.prototype.setColor = function (name) {
1529
+ this.setProperty("--smart-color-" + name, "color-" + name);
1530
+ this.setProperty("--smart-color-" + name + "-rgb", "color-" + name + "-rgb");
1531
+ this.setProperty("--smart-color-" + name + "-contrast", "color-" + name + "-contrast");
1532
+ this.setProperty("--smart-color-" + name + "-contrast-rgb", "color-" + name + "-contrast-rgb");
1533
+ this.setProperty("--smart-color-" + name + "-shade", "color-" + name + "-shade");
1534
+ this.setProperty("--smart-color-" + name + "-tint", "color-" + name + "-tint");
1535
+ this.setProperty("--ion-color-" + name, "color-" + name);
1536
+ this.setProperty("--ion-color-" + name + "-rgb", "color-" + name + "-rgb");
1537
+ this.setProperty("--ion-color-" + name + "-contrast", "color-" + name + "-contrast");
1538
+ this.setProperty("--ion-color-" + name + "-contrast-rgb", "color-" + name + "-contrast-rgb");
1539
+ this.setProperty("--ion-color-" + name + "-shade", "color-" + name + "-shade");
1540
+ this.setProperty("--ion-color-" + name + "-tint", "color-" + name + "-tint");
1541
+ };
1542
+ StyleService.prototype.setProperty = function (property, type) {
1543
+ if (!StyleService.style[type])
1612
1544
  return;
1545
+ var native = this._elementRef.nativeElement;
1546
+ native.style.setProperty(property, StyleService.style[type]);
1547
+ };
1548
+ StyleService.prototype.setFont = function () {
1549
+ if (common.isPlatformBrowser(this.platformId) && this.platform.is('ios')) {
1550
+ this.setProperty('--ion-font-family', 'ios-font');
1551
+ this.setProperty('--default-font-weight', 'ios-font-weight');
1552
+ this.setProperty('--default-font-style', 'ios-font-style');
1553
+ }
1554
+ else if (common.isPlatformBrowser(this.platformId) && this.platform.is("android")) {
1555
+ this.setProperty('--ion-font-family', 'md-font');
1556
+ this.setProperty('--default-font-weight', 'md-font-weight');
1557
+ this.setProperty('--default-font-style', 'md-font-style');
1558
+ }
1559
+ else {
1560
+ this.setProperty('--ion-font-family', 'font');
1561
+ this.setProperty('--default-font-weight', 'font-weight');
1562
+ this.setProperty('--default-font-style', 'font-style');
1613
1563
  }
1614
- AppService._endButtonsSource$.next(__spreadArray([], __read(AppService._endButtonsSource$.value.filter(function (e) { return e.id !== buttonOrId; }))));
1615
1564
  };
1616
- return AppService;
1565
+ StyleService.prototype.setButton = function () {
1566
+ this.setProperty('--smart-button-height', 'button-height');
1567
+ this.setProperty('--smart-button-min-width', 'button-min-width');
1568
+ this.setProperty('--smart-button-padding-right', 'button-padding-right');
1569
+ this.setProperty('--smart-button-padding-left', 'button-padding-left');
1570
+ this.setProperty('--smart-button-padding-top', 'button-padding-top');
1571
+ this.setProperty('--smart-button-padding-bottom', 'button-padding-bottom');
1572
+ this.setProperty('--smart-button-icon-size', 'button-icon-size');
1573
+ };
1574
+ StyleService.prototype.setMobileBreakpoint = function () {
1575
+ this.setProperty('--phone-breakpoint', 'phone-breakpoint');
1576
+ this.setProperty('--tablet-breakpoint', 'tablet-breakpoint');
1577
+ };
1578
+ return StyleService;
1617
1579
  }());
1618
- AppService._endButtonsSource$ = new rxjs.BehaviorSubject([]);
1619
- /** @nocollapse */ AppService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function AppService_Factory() { return new AppService(); }, token: AppService, providedIn: "root" });
1580
+ StyleService.style = null;
1620
1581
  /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1621
- AppService.decorators = [
1622
- { type: i0.Injectable, args: [{
1623
- providedIn: 'root'
1624
- },] }
1582
+ StyleService.decorators = [
1583
+ { type: i0.Injectable }
1625
1584
  ];
1585
+ /**
1586
+ * @type {function(): !Array<(null|{
1587
+ * type: ?,
1588
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
1589
+ * })>}
1590
+ * @nocollapse
1591
+ */
1592
+ StyleService.ctorParameters = function () { return [
1593
+ { type: i1.Platform },
1594
+ { type: Object, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] }
1595
+ ]; };
1626
1596
 
1627
- var SmartFormGroup = /** @class */ (function (_super) {
1628
- __extends(SmartFormGroup, _super);
1629
- function SmartFormGroup() {
1630
- return _super !== null && _super.apply(this, arguments) || this;
1597
+ var FINGERPRINT_PLATFORMS = [
1598
+ 'android',
1599
+ 'ios', 'ipad'
1600
+ ];
1601
+ var FingerprintService = /** @class */ (function () {
1602
+ function FingerprintService(platform, faio, translateService, storageService) {
1603
+ this.platform = platform;
1604
+ this.faio = faio;
1605
+ this.translateService = translateService;
1606
+ this.storageService = storageService;
1631
1607
  }
1632
- SmartFormGroup.create = function () {
1633
- return new SmartFormGroup({});
1634
- };
1635
- SmartFormGroup.prototype.setForm = function (form) {
1636
- var _this = this;
1637
- Object.keys(form.controls).forEach(function (key) {
1638
- if (_this.controls[key])
1639
- _this.removeControl(key);
1640
- _this.addControl(key, form.controls[key]);
1641
- });
1608
+ FingerprintService.prototype.isSet = function () {
1609
+ return FingerprintService.set || !!this.storageService.getItem('FINGERPINT_SET');
1642
1610
  };
1643
- return SmartFormGroup;
1644
- }(forms.FormGroup));
1645
-
1646
- var FormFactory = /** @class */ (function () {
1647
- function FormFactory(fb, authService, validatorsProvider) {
1648
- this.fb = fb;
1649
- this.authService = authService;
1650
- this.validatorsProvider = validatorsProvider;
1651
- }
1652
- FormFactory.checkModelMeta = function (obj) {
1653
- if (!obj)
1654
- throw new Error("You should set object as param");
1655
- if (!Reflect.hasMetadata(models.SYMBOL_MODEL, obj.constructor))
1656
- throw new Error("You should mark class with @Model decorator");
1657
- };
1658
- FormFactory.getOptions = function (obj, key) {
1659
- return Reflect.getMetadata(models.SYMBOL_FIELD, obj, key);
1660
- };
1661
- FormFactory.getOptionsFromMode = function (options, mode) {
1662
- var result = options;
1663
- if (!mode)
1664
- return result;
1665
- if (mode === "create" && ___namespace.isObject(options.create)) {
1666
- result = Object.assign(Object.assign({}, options), options.create);
1667
- }
1668
- else if (mode === "update" && ___namespace.isObject(options.update)) {
1669
- result = Object.assign(Object.assign({}, options), options.update);
1670
- }
1671
- return result;
1672
- };
1673
- FormFactory.prototype.create = function (obj, ops) {
1674
- if (ops === void 0) { ops = {}; }
1611
+ FingerprintService.prototype.setData = function (data) {
1675
1612
  return __awaiter(this, void 0, void 0, function () {
1676
- var result, fields, enabledDefinitions, _loop_1, this_1, index;
1677
- return __generator(this, function (_l) {
1678
- switch (_l.label) {
1613
+ var _a;
1614
+ var _this = this;
1615
+ return __generator(this, function (_b) {
1616
+ switch (_b.label) {
1679
1617
  case 0:
1680
- FormFactory.checkModelMeta(obj);
1681
- result = SmartFormGroup.create();
1682
- fields = models.getModelFieldsWithOptions(obj).filter(function (field) {
1683
- var _a, _b;
1684
- return (!ops.mode ||
1685
- (ops.mode === "create" && field.options.create) ||
1686
- (ops.mode === "update" && field.options.update) ||
1687
- (ops.mode === "multiUpdate" && ((_b = (_a = field.options) === null || _a === void 0 ? void 0 : _a.update) === null || _b === void 0 ? void 0 : _b.multi)) ||
1688
- (ops.mode !== "create" &&
1689
- ops.mode !== "update" &&
1690
- field.options.customs &&
1691
- field.options.customs.some(function (custom) { return custom.mode === ops.mode; })));
1692
- });
1693
- enabledDefinitions = [];
1694
- _loop_1 = function (index) {
1695
- var field, control, options, indexField, _m, _o, providerResult, confirmControl;
1696
- return __generator(this, function (_p) {
1697
- switch (_p.label) {
1698
- case 0:
1699
- field = fields[index];
1700
- control = null;
1701
- options = FormFactory.getOptionsFromMode(field.options, ops.mode);
1702
- if (options.permissions && !this_1.authService.expectPermissions(options.permissions)) {
1703
- return [2 /*return*/, "continue"];
1704
- }
1705
- if (!(field.options.type === models.FieldType.object)) return [3 /*break*/, 2];
1706
- return [4 /*yield*/, this_1.create(obj[field.key], ops)];
1707
- case 1:
1708
- control = _p.sent();
1709
- return [3 /*break*/, 8];
1710
- case 2:
1711
- if (!(field.options.type === models.FieldType.array)) return [3 /*break*/, 7];
1712
- control = this_1.fb.array([]);
1713
- if (!obj[field.key]) return [3 /*break*/, 6];
1714
- indexField = 0;
1715
- _p.label = 3;
1716
- case 3:
1717
- if (!(indexField < obj[field.key].length)) return [3 /*break*/, 6];
1718
- _o = (_m = control).push;
1719
- return [4 /*yield*/, this_1.create(obj[field.key][indexField], ops)];
1720
- case 4:
1721
- _o.apply(_m, [_p.sent()]);
1722
- _p.label = 5;
1723
- case 5:
1724
- indexField++;
1725
- return [3 /*break*/, 3];
1726
- case 6: return [3 /*break*/, 8];
1727
- case 7:
1728
- control = this_1.createControl(obj, field, options.required);
1729
- _p.label = 8;
1730
- case 8:
1731
- this_1.setValidators(field.key, control, options, result, ops.uniqueProvider);
1732
- if (!this_1.validatorsProvider) return [3 /*break*/, 10];
1733
- return [4 /*yield*/, this_1.validatorsProvider.get({
1734
- key: field.key,
1735
- instance: obj,
1736
- type: obj.constructor,
1737
- base: {
1738
- validators: control.validator,
1739
- asyncValidators: control.asyncValidator
1740
- }
1741
- })];
1742
- case 9:
1743
- providerResult = _p.sent();
1744
- control.setValidators(providerResult.validators);
1745
- control.setAsyncValidators(providerResult.asyncValidators);
1746
- _p.label = 10;
1747
- case 10:
1748
- result.addControl(field.key, control);
1749
- if (options.confirm && options.type === models.FieldType.object) {
1750
- throw Error("Object not supported confirms");
1751
- }
1752
- if (options.confirm) {
1753
- confirmControl = this_1.fb.control(null, [
1754
- forms.Validators.required,
1755
- function (a) {
1756
- if (a.value !== result.controls[field.key].value) {
1757
- return {
1758
- confirm: true,
1759
- };
1760
- }
1761
- return null;
1762
- },
1763
- ]);
1764
- result.addControl(field.key + "Confirm", confirmControl);
1765
- }
1766
- if (options.enabled) {
1767
- enabledDefinitions.push({
1768
- key: field.key,
1769
- control: control,
1770
- enabled: options.enabled
1771
- });
1772
- }
1773
- return [2 /*return*/];
1774
- }
1775
- });
1776
- };
1777
- this_1 = this;
1778
- index = 0;
1779
- _l.label = 1;
1618
+ _a = !this.isSet() && FINGERPRINT_PLATFORMS.some(function (p) { return _this.platform.is(p); });
1619
+ if (!_a) return [3 /*break*/, 2];
1620
+ return [4 /*yield*/, this.faio.isAvailable()];
1780
1621
  case 1:
1781
- if (!(index < fields.length)) return [3 /*break*/, 4];
1782
- return [5 /*yield**/, _loop_1(index)];
1622
+ _a = (_b.sent());
1623
+ _b.label = 2;
1783
1624
  case 2:
1784
- _l.sent();
1785
- _l.label = 3;
1625
+ if (!_a) return [3 /*break*/, 4];
1626
+ return [4 /*yield*/, this.faio.registerBiometricSecret({
1627
+ secret: JSON.stringify(data)
1628
+ })];
1786
1629
  case 3:
1787
- index++;
1788
- return [3 /*break*/, 1];
1789
- case 4:
1790
- result.valueChanges.pipe(operators.tap(function (value) {
1791
- enabledDefinitions.forEach(function (def) {
1792
- var enabled = utils.SpecificationService.valid(value, def.enabled);
1793
- def.control['__smartDisabled'] = !enabled;
1794
- });
1795
- }), operators.delay(0)).subscribe(function (value) {
1796
- enabledDefinitions.forEach(function (def) {
1797
- if (!def.control['__smartDisabled'] && !result.controls[def.key]) {
1798
- result.addControl(def.key, def.control);
1799
- result.updateValueAndValidity();
1800
- }
1801
- else if (def.control['__smartDisabled'] && result.controls[def.key]) {
1802
- result.removeControl(def.key);
1803
- result.updateValueAndValidity();
1804
- }
1805
- });
1806
- });
1807
- return [2 /*return*/, result];
1630
+ _b.sent();
1631
+ this.storageService.setItem('FINGERPINT_SET', "1");
1632
+ FingerprintService.set = true;
1633
+ return [2 /*return*/];
1634
+ case 4: return [2 /*return*/];
1808
1635
  }
1809
1636
  });
1810
1637
  });
1811
1638
  };
1812
- FormFactory.prototype.setValidators = function (key, control, options, form, uniqueProvider) {
1813
- var _this = this;
1814
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1815
- var result = [];
1816
- var asyncResult = [];
1817
- if (options.required) {
1818
- result.push(forms.Validators.required);
1819
- }
1820
- if (options.type === models.FieldType.email) {
1821
- result.push(function (c) {
1822
- if (!c.value)
1823
- return;
1824
- var reg = new RegExp("^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$");
1825
- if (reg.test(c.value))
1826
- return null;
1827
- return { email: true };
1828
- });
1829
- }
1830
- if (options.type === models.FieldType.phoneNumber) {
1831
- result.push(function (c) {
1832
- if (!c.value)
1833
- return;
1834
- var reg = new RegExp("^((\\+91-?)|0)?[0-9]{9}$");
1835
- if (reg.test(c.value))
1836
- return null;
1837
- return { phoneNumber: true };
1838
- });
1839
- }
1840
- if (options.type === models.FieldType.pesel) {
1841
- result.push(function (c) {
1842
- if (!c.value)
1843
- return;
1844
- if (utils.PeselService.isValid(c.value))
1845
- return null;
1846
- return { pesel: true };
1639
+ FingerprintService.prototype.clearData = function () {
1640
+ return __awaiter(this, void 0, void 0, function () {
1641
+ return __generator(this, function (_a) {
1642
+ this.storageService.removeItem('FINGERPINT_SET');
1643
+ FingerprintService.set = false;
1644
+ return [2 /*return*/];
1847
1645
  });
1848
- }
1849
- if ((_a = options.possibilities) === null || _a === void 0 ? void 0 : _a.minLength) {
1850
- result.push(forms.Validators.minLength((_b = options.possibilities) === null || _b === void 0 ? void 0 : _b.minLength));
1851
- }
1852
- if ((_c = options.possibilities) === null || _c === void 0 ? void 0 : _c.maxLength) {
1853
- result.push(forms.Validators.maxLength((_d = options.possibilities) === null || _d === void 0 ? void 0 : _d.maxLength));
1854
- }
1855
- if (((_e = options.possibilities) === null || _e === void 0 ? void 0 : _e.min) || ((_f = options.possibilities) === null || _f === void 0 ? void 0 : _f.min) === 0) {
1856
- result.push(forms.Validators.min((_g = options.possibilities) === null || _g === void 0 ? void 0 : _g.min));
1857
- }
1858
- if (((_h = options.possibilities) === null || _h === void 0 ? void 0 : _h.max) || ((_j = options.possibilities) === null || _j === void 0 ? void 0 : _j.max) === 0) {
1859
- result.push(forms.Validators.max((_k = options.possibilities) === null || _k === void 0 ? void 0 : _k.max));
1860
- }
1861
- if (options.unique && uniqueProvider) {
1862
- asyncResult.push(function (c) { return __awaiter(_this, void 0, void 0, function () {
1863
- var record;
1864
- var _l;
1865
- return __generator(this, function (_m) {
1866
- switch (_m.label) {
1867
- case 0:
1868
- record = (_l = {},
1869
- _l[key] = options.type === models.FieldType.int ? c.value : "'" + c.value + "'",
1870
- _l);
1871
- if (form.value && options.unique.withFields) {
1872
- options.unique.withFields.forEach(function (fieldKey) {
1873
- record[fieldKey] = form.value[fieldKey];
1874
- });
1875
- }
1876
- return [4 /*yield*/, uniqueProvider(record)];
1877
- case 1:
1878
- if (_m.sent())
1879
- return [2 /*return*/, null];
1880
- return [2 /*return*/, {
1881
- invalidUnique: true
1882
- }];
1883
- }
1884
- });
1885
- }); });
1886
- }
1887
- control.setValidators(result);
1888
- control.setAsyncValidators(asyncResult);
1646
+ });
1889
1647
  };
1890
- FormFactory.prototype.createControl = function (obj, field, required) {
1891
- var result;
1892
- var zipCodeValidator = function (c) {
1893
- if (c.value && utils.ZipCodeService.isInvalid(c.value)) {
1894
- return {
1895
- invalidZipCode: true,
1896
- };
1897
- }
1898
- return null;
1899
- };
1900
- switch (field.options.type) {
1901
- case models.FieldType.address:
1902
- result = this.fb.group({
1903
- city: ["", required ? [forms.Validators.required] : null],
1904
- street: ["", required ? [forms.Validators.required] : null],
1905
- buildingNumber: ["", required ? [forms.Validators.required] : null],
1906
- flatNumber: [""],
1907
- zipCode: [
1908
- "",
1909
- required
1910
- ? [forms.Validators.required, zipCodeValidator]
1911
- : [zipCodeValidator],
1912
- ],
1913
- });
1914
- break;
1915
- default:
1916
- result = this.fb.control(null);
1917
- break;
1918
- }
1919
- var value = obj[field.key]
1920
- ? obj[field.key]
1921
- : field.options.defaltValue
1922
- ? field.options.defaltValue()
1923
- : null;
1924
- if (value)
1925
- result.setValue(value);
1926
- result.updateValueAndValidity();
1927
- return result;
1648
+ FingerprintService.prototype.getDate = function (options) {
1649
+ if (options === void 0) { options = {}; }
1650
+ return __awaiter(this, void 0, void 0, function () {
1651
+ var data;
1652
+ return __generator(this, function (_a) {
1653
+ switch (_a.label) {
1654
+ case 0:
1655
+ if (!options.force && !this.isSet())
1656
+ return [2 /*return*/, null];
1657
+ FingerprintService.set = true;
1658
+ return [4 /*yield*/, this.faio.loadBiometricSecret({
1659
+ title: this.translateService.instant('APP.signIn'),
1660
+ cancelButtonTitle: this.translateService.instant('cancel')
1661
+ })];
1662
+ case 1:
1663
+ data = _a.sent();
1664
+ // // to tests
1665
+ // const data = localStorage.getItem('TEST_FINGERPINT');
1666
+ return [2 /*return*/, JSON.parse(data)];
1667
+ }
1668
+ });
1669
+ });
1928
1670
  };
1929
- return FormFactory;
1671
+ return FingerprintService;
1930
1672
  }());
1673
+ FingerprintService.set = false;
1931
1674
  /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1932
- FormFactory.decorators = [
1675
+ FingerprintService.decorators = [
1933
1676
  { type: i0.Injectable }
1934
1677
  ];
1935
1678
  /**
@@ -1939,274 +1682,376 @@
1939
1682
  * })>}
1940
1683
  * @nocollapse
1941
1684
  */
1942
- FormFactory.ctorParameters = function () { return [
1943
- { type: forms.FormBuilder },
1944
- { type: AuthService },
1945
- { type: IModelValidatorsProvider, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [MODEL_VALIDATORS_PROVIDER,] }] }
1685
+ FingerprintService.ctorParameters = function () { return [
1686
+ { type: i1.Platform },
1687
+ { type: ngx.FingerprintAIO },
1688
+ { type: core.TranslateService },
1689
+ { type: StorageService }
1946
1690
  ]; };
1947
1691
 
1948
- var SharedFactoriesModule = /** @class */ (function () {
1949
- function SharedFactoriesModule() {
1692
+ var Camera = core$1.Plugins.Camera;
1693
+ var CameraService = /** @class */ (function () {
1694
+ function CameraService() {
1950
1695
  }
1951
- return SharedFactoriesModule;
1696
+ CameraService.prototype.getCapture = function (options) {
1697
+ if (options === void 0) { options = {}; }
1698
+ return __awaiter(this, void 0, void 0, function () {
1699
+ var image;
1700
+ return __generator(this, function (_a) {
1701
+ switch (_a.label) {
1702
+ case 0: return [4 /*yield*/, Camera.getPhoto({
1703
+ quality: options.quality ? options.quality : 100,
1704
+ resultType: core$1.CameraResultType.Base64
1705
+ })];
1706
+ case 1:
1707
+ image = _a.sent();
1708
+ return [2 /*return*/, {
1709
+ data: image.base64String,
1710
+ exif: image.exif
1711
+ }];
1712
+ }
1713
+ });
1714
+ });
1715
+ };
1716
+ return CameraService;
1952
1717
  }());
1953
1718
  /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1954
- SharedFactoriesModule.decorators = [
1955
- { type: i0.NgModule, args: [{
1956
- imports: [
1957
- forms.ReactiveFormsModule
1958
- ],
1959
- providers: [
1960
- FormFactory
1961
- ]
1962
- },] }
1719
+ CameraService.decorators = [
1720
+ { type: i0.Injectable }
1963
1721
  ];
1964
1722
 
1965
- function setDefaultTranslationsAndLang(service) {
1966
- var map = {
1967
- 'pl': TRANSLATE_DATA_PL,
1968
- 'eng': TRANSLATE_DATA_ENG
1723
+ var FILE_SERVICE_CONFIG = new i0.InjectionToken('FILE_SERVICE_CONFIG');
1724
+ var FileService = /** @class */ (function () {
1725
+ function FileService(config, http) {
1726
+ this.config = config;
1727
+ this.http = http;
1728
+ }
1729
+ FileService.prototype.upload = function (file, callback) {
1730
+ var formData = new FormData();
1731
+ formData.append('file', file, file.name);
1732
+ return this.http.post(this.config.apiUrl + '/attachments', formData, {
1733
+ reportProgress: true,
1734
+ observe: 'events'
1735
+ }).pipe(operators.map(function (event) {
1736
+ if (event.type === http.HttpEventType.UploadProgress) {
1737
+ var percentDone = Math.round(100 * event.loaded / event.total);
1738
+ return percentDone;
1739
+ }
1740
+ if (event.type === http.HttpEventType.Response) {
1741
+ if (callback)
1742
+ callback(event.body);
1743
+ return 100;
1744
+ }
1745
+ }));
1969
1746
  };
1970
- Object.keys(map).forEach(function (key) {
1971
- service.setTranslation(key, map[key], true);
1972
- });
1973
- if (!service.currentLang) {
1974
- var lang = service.getBrowserLang();
1975
- service.use(lang);
1747
+ FileService.prototype.download = function (id) {
1748
+ window.open(this.getUrl(id), '_blank').focus();
1749
+ };
1750
+ FileService.prototype.delete = function (id) {
1751
+ return this.http.delete(this.config.apiUrl + '/attachments/' + id).toPromise();
1752
+ };
1753
+ FileService.prototype.getUrl = function (id) {
1754
+ return this.config.apiUrl + '/attachments/' + id;
1755
+ };
1756
+ return FileService;
1757
+ }());
1758
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1759
+ FileService.decorators = [
1760
+ { type: i0.Injectable }
1761
+ ];
1762
+ /**
1763
+ * @type {function(): !Array<(null|{
1764
+ * type: ?,
1765
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
1766
+ * })>}
1767
+ * @nocollapse
1768
+ */
1769
+ FileService.ctorParameters = function () { return [
1770
+ { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [FILE_SERVICE_CONFIG,] }] },
1771
+ { type: http.HttpClient }
1772
+ ]; };
1773
+
1774
+ var CalendarService = /** @class */ (function () {
1775
+ function CalendarService() {
1776
+ var _this = this;
1777
+ this.state = {
1778
+ date: moment__namespace().add(2, 'year'),
1779
+ calendar: [
1780
+ {
1781
+ dates: null,
1782
+ monthName: null,
1783
+ number: null,
1784
+ year: null
1785
+ }
1786
+ ]
1787
+ };
1788
+ this.setState = function (nextState) {
1789
+ _this.state = Object.assign(Object.assign({}, _this.state), nextState);
1790
+ };
1791
+ //this service is a singleton therefore its constructor will only
1792
+ //be called once during the application life cycle
1793
+ this.initCalendar();
1976
1794
  }
1977
- }
1978
- var TRANSLATE_DATA_ENG = {
1979
- details: 'details',
1980
- admin: 'admin',
1981
- add: 'add',
1982
- change: 'change',
1983
- confirm: 'confirm',
1984
- cancel: 'cancel',
1985
- delete: 'delete',
1986
- undo: 'undo',
1987
- search: 'search',
1988
- page: 'page',
1989
- filters: 'filters',
1990
- or: 'or',
1991
- signInQuicklyWith: 'sign in quickly with',
1992
- selected: "selected",
1993
- select: "select",
1994
- show: "show",
1995
- download: "download",
1996
- play: "play",
1997
- writeHere: "write here",
1998
- next: 'next',
1999
- prev: 'prev',
2000
- edit: "edit",
2001
- save: "save",
2002
- noResults: "no results",
2003
- CALENDAR: {
2004
- DAY_OF_WEEK: {
2005
- Mon: 'Mon',
2006
- Tue: 'Tue',
2007
- Wed: 'Wed',
2008
- Thu: 'Thu',
2009
- Fri: 'Fri',
2010
- Sat: 'Sat',
2011
- Sun: 'Sun',
2012
- },
2013
- MONTH: {
2014
- January: "January",
2015
- February: "February",
2016
- March: "March",
2017
- April: "April",
2018
- May: "May",
2019
- June: "June",
2020
- July: "July",
2021
- August: "August",
2022
- September: "September",
2023
- October: "October",
2024
- November: "November",
2025
- December: "December"
2026
- },
2027
- Today: "Today",
2028
- LastSevenDays: "Last 7 days",
2029
- ThisMonth: "This month",
2030
- Yesterday: "Yesterday",
2031
- LastThirtyDays: "Last 30 days",
2032
- LastMonth: "Last month"
2033
- },
2034
- OBJECT: {
2035
- deleted: 'object deleted',
2036
- confirmDelete: 'confirm delete object'
2037
- },
2038
- APP: {
2039
- logout: 'log out',
2040
- signIn: 'sign in',
2041
- logged: 'logged'
2042
- },
2043
- MODEL: {
2044
- body: 'body',
2045
- buildingNumber: 'building number',
2046
- city: 'city',
2047
- date: 'date',
2048
- disabled: 'disabled',
2049
- email: 'email',
2050
- file: 'file',
2051
- firstName: 'first name',
2052
- flatNumber: 'flat number',
2053
- lastName: 'last name',
2054
- password: 'password',
2055
- passwordConfirm: 'confirm password',
2056
- passwordReset: 'reset password',
2057
- permissions: 'permissions',
2058
- price: 'price',
2059
- send: 'send',
2060
- street: 'street',
2061
- username: 'user name',
2062
- zipCode: 'zip code',
2063
- },
2064
- INPUT: {
2065
- ERRORS: {
2066
- required: 'field is required',
2067
- requires: 'fields are required',
2068
- invalidNip: 'Invalid nip format',
2069
- invalidUnique: 'Invalid unique value',
2070
- invalidFileType: 'Invalid file type',
2071
- confirm: 'bad confirmed',
2072
- invalidEmailFormat: "invalid email format",
2073
- invalidPhoneNumberFormat: "invalid phone number (000000000)",
2074
- invalidPeselFormat: "invalid pesel",
2075
- invalidMinLength: "min length",
2076
- invalidMaxLength: "max length",
2077
- invalidMin: 'min value',
2078
- invalidMax: 'max value',
2079
- upperLetters: "upper letters",
2080
- lowerLetters: "lower letters",
2081
- symbols: "string"
2082
- },
2083
- 'PASSWORD-STRENGTH': {
2084
- poor: 'poor',
2085
- notGood: 'not ood',
2086
- good: 'good'
1795
+ CalendarService.prototype.getCalendar = function () {
1796
+ return __spreadArray([], __read(this.state.calendar));
1797
+ };
1798
+ CalendarService.prototype.generatePrevMonths = function () {
1799
+ var calendar = this.state.calendar;
1800
+ var date = moment__namespace(calendar[0].year + '-' + calendar[0].number + '-01');
1801
+ var dateYearAgo = date.clone().subtract(1, 'year');
1802
+ while (date.isSameOrAfter(dateYearAgo)) {
1803
+ date = date.clone().subtract(1, 'month');
1804
+ calendar.unshift(this.generateMonth(date));
2087
1805
  }
2088
- },
2089
- ERRORS: {
2090
- invalidUsernameOrPassword: 'Invalid username or password',
2091
- other: 'Error'
2092
- }
2093
- };
2094
- var TRANSLATE_DATA_PL = {
2095
- details: 'szczegóły',
2096
- admin: 'administrator',
2097
- add: 'dodaj',
2098
- change: 'zmień',
2099
- confirm: 'potwierdź',
2100
- cancel: 'anuluj',
2101
- delete: 'usuń',
2102
- undo: 'cofnij',
2103
- search: 'wyszukaj',
2104
- page: 'strona',
2105
- filters: 'filtry',
2106
- or: 'lub',
2107
- signInQuicklyWith: 'szybko zaloguj się za pomocą',
2108
- selected: "wybrano",
2109
- select: "wybierz",
2110
- show: "pokaż",
2111
- download: "pobierz",
2112
- play: "włącz",
2113
- writeHere: "napisz tutaj",
2114
- next: 'dalej',
2115
- prev: 'wstecz',
2116
- edit: "edycja",
2117
- save: "zapisz",
2118
- noResults: "brak wyników",
2119
- CALENDAR: {
2120
- DAY_OF_WEEK: {
2121
- Mon: 'Pon',
2122
- Tue: 'Wto',
2123
- Wed: 'Śro',
2124
- Thu: 'Czw',
2125
- Fri: 'Pio',
2126
- Sat: 'Sob',
2127
- Sun: 'Nie',
2128
- },
2129
- MONTH: {
2130
- January: "Styczeń",
2131
- February: "Luty",
2132
- March: "Marzec",
2133
- April: "Kwiecień",
2134
- May: "Maj",
2135
- June: "Czerwiec",
2136
- July: "Lipiec",
2137
- August: "Sierpień",
2138
- September: "Wrzesień",
2139
- October: "Październik",
2140
- November: "Listopad",
2141
- December: "Grudzień"
2142
- },
2143
- Today: "Dzisiaj",
2144
- LastSevenDays: "Ostatnie 7 dnii",
2145
- ThisMonth: "Ten miesiąc",
2146
- Yesterday: "Wczoraj",
2147
- LastThirtyDays: "Ostatnie 30 dni",
2148
- LastMonth: "Ostatni miesiąc"
2149
- },
2150
- OBJECT: {
2151
- deleted: 'obiekt został usunięty',
2152
- confirmDelete: 'potwierdź usunięcie'
2153
- },
2154
- APP: {
2155
- logout: 'wyloguj się',
2156
- logged: 'zalogowany',
2157
- signIn: 'zaloguj się'
2158
- },
2159
- MODEL: {
2160
- body: 'treść',
2161
- buildingNumber: 'numer budynku',
2162
- city: 'miasto',
2163
- date: 'data',
2164
- disabled: 'nieaktywny',
2165
- email: 'email',
2166
- file: 'plik',
2167
- firstName: 'imię',
2168
- flatNumber: 'numer lokalu',
2169
- lastName: 'nazwisko',
2170
- password: 'hasło',
2171
- passwordConfirm: 'powtórz hasło',
2172
- passwordReset: 'Nie pamiętam hasła',
2173
- permissions: 'uprawnienia',
2174
- price: 'cena',
2175
- send: 'wyślij',
2176
- street: 'ulica',
2177
- username: 'nazwa użytkownika',
2178
- zipCode: 'kod pocztowy',
2179
- },
2180
- INPUT: {
2181
- ERRORS: {
2182
- required: 'to pole jest wymagane',
2183
- requires: 'te pola są wymagane',
2184
- invalidNip: 'niepoprawny format nip',
2185
- invalidUnique: 'wartość jest już w systemie',
2186
- confirm: 'źle powtórzone',
2187
- invalidEmailFormat: "niepoprawny adres email",
2188
- invalidFileType: 'niepoprawny format pliku',
2189
- invalidPhoneNumberFormat: "niepoprawny numer telefonu (000000000)",
2190
- invalidPeselFormat: "niepoprawny numer pesel",
2191
- invalidMinLength: "minimalna długość",
2192
- invalidMaxLength: "maksymalna długość",
2193
- invalidMin: "minimalna wartość",
2194
- invalidMax: "maksymalna wartość",
2195
- upperLetters: "duże litery",
2196
- lowerLetters: "małe litery",
2197
- symbols: "znaki specjalne"
2198
- },
2199
- 'PASSWORD-STRENGTH': {
2200
- poor: 'bardzo słabe',
2201
- notGood: 'słabe',
2202
- good: 'dobre'
1806
+ };
1807
+ CalendarService.prototype.generateNextMonths = function () {
1808
+ var calendar = this.state.calendar;
1809
+ var dateString = calendar[calendar.length - 1].year + '-' + calendar[calendar.length - 1].number + '-01';
1810
+ var date = moment__namespace(dateString);
1811
+ var dateYearNext = date.clone().add(1, 'year');
1812
+ while (date.isSameOrBefore(dateYearNext)) {
1813
+ date = date.clone().add(1, 'month');
1814
+ calendar.push(this.generateMonth(date));
2203
1815
  }
2204
- },
2205
- ERRORS: {
2206
- invalidUsernameOrPassword: 'Niepoprawna nazwa użytkownika, lub hasło',
2207
- other: 'Wystąpił błąd'
1816
+ };
1817
+ CalendarService.prototype.initCalendar = function () {
1818
+ var date = this.state.date;
1819
+ var firstMonth = this.generateMonth(date);
1820
+ var calendar = [firstMonth];
1821
+ var currentDate = moment__namespace().clone();
1822
+ var dateYearAgo = currentDate.clone().subtract(2, 'year');
1823
+ while (date.isSameOrAfter(dateYearAgo)) { // creating one year calendar
1824
+ calendar.unshift(this.previousMonth());
1825
+ }
1826
+ this.state.date = moment__namespace();
1827
+ var currentMonthIndex = calendar.length - 13;
1828
+ calendar[currentMonthIndex].dates = calendar[currentMonthIndex].dates.filter(this.filterFutureDates);
1829
+ this.setState({ calendar: calendar });
1830
+ };
1831
+ CalendarService.prototype.previousMonth = function () {
1832
+ var date = this.state.date;
1833
+ var newDate = date.subtract(1, 'month');
1834
+ var m = this.generateMonth(newDate);
1835
+ this.setState({ date: newDate });
1836
+ return m;
1837
+ };
1838
+ CalendarService.prototype.filterFutureDates = function (date) {
1839
+ if (!date) {
1840
+ return true;
1841
+ }
1842
+ return date.isSameOrBefore(moment__namespace());
1843
+ };
1844
+ CalendarService.prototype.generateMonth = function (date) {
1845
+ var firstDay = moment__namespace(date).startOf('month');
1846
+ var monthName = moment__namespace(date).format('MMMM');
1847
+ var year = moment__namespace(date).format('YYYY');
1848
+ var number = moment__namespace(date).format('MM');
1849
+ var monthLength = date.daysInMonth();
1850
+ var totalDatesInMonth = this.generateMonthDates(firstDay, monthLength);
1851
+ var emptyCellsBeforeFirstDay = Array(firstDay.weekday()).fill(null);
1852
+ var dates = __spreadArray(__spreadArray([], __read(emptyCellsBeforeFirstDay)), __read(totalDatesInMonth));
1853
+ return {
1854
+ dates: dates,
1855
+ monthName: monthName,
1856
+ number: number,
1857
+ year: year
1858
+ };
1859
+ };
1860
+ CalendarService.prototype.generateMonthDates = function (firstDay, length) {
1861
+ return Array(length).fill(null).map(function (v, i) { return moment__namespace(firstDay).add(i, 'day'); });
1862
+ };
1863
+ return CalendarService;
1864
+ }());
1865
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1866
+ CalendarService.decorators = [
1867
+ { type: i0.Injectable }
1868
+ ];
1869
+ /**
1870
+ * @type {function(): !Array<(null|{
1871
+ * type: ?,
1872
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
1873
+ * })>}
1874
+ * @nocollapse
1875
+ */
1876
+ CalendarService.ctorParameters = function () { return []; };
1877
+
1878
+ var UIService = /** @class */ (function () {
1879
+ function UIService(loadingController, alertController, toastController) {
1880
+ this.loadingController = loadingController;
1881
+ this.alertController = alertController;
1882
+ this.toastController = toastController;
1883
+ }
1884
+ UIService.prototype.showLoading = function (msg) {
1885
+ return __awaiter(this, void 0, void 0, function () {
1886
+ var loader;
1887
+ return __generator(this, function (_a) {
1888
+ switch (_a.label) {
1889
+ case 0: return [4 /*yield*/, this.loadingController.create({
1890
+ message: msg || 'loading...',
1891
+ })];
1892
+ case 1:
1893
+ loader = _a.sent();
1894
+ return [4 /*yield*/, loader.present()];
1895
+ case 2:
1896
+ _a.sent();
1897
+ return [2 /*return*/, loader];
1898
+ }
1899
+ });
1900
+ });
1901
+ };
1902
+ UIService.prototype.showSimpleAlert = function (msg, heading) {
1903
+ return __awaiter(this, void 0, void 0, function () {
1904
+ var alert;
1905
+ return __generator(this, function (_a) {
1906
+ switch (_a.label) {
1907
+ case 0: return [4 /*yield*/, this.alertController.create({
1908
+ header: heading || 'Alert',
1909
+ message: msg,
1910
+ buttons: ['OK']
1911
+ })];
1912
+ case 1:
1913
+ alert = _a.sent();
1914
+ return [4 /*yield*/, alert.present()];
1915
+ case 2:
1916
+ _a.sent();
1917
+ return [2 /*return*/];
1918
+ }
1919
+ });
1920
+ });
1921
+ };
1922
+ UIService.prototype.showAlertWithDismissCallback = function (heading, msg, btnText, callback) {
1923
+ return __awaiter(this, void 0, void 0, function () {
1924
+ var alert;
1925
+ return __generator(this, function (_a) {
1926
+ switch (_a.label) {
1927
+ case 0: return [4 /*yield*/, this.alertController.create({
1928
+ header: heading,
1929
+ message: msg,
1930
+ buttons: [
1931
+ {
1932
+ text: btnText,
1933
+ }
1934
+ ]
1935
+ })];
1936
+ case 1:
1937
+ alert = _a.sent();
1938
+ return [4 /*yield*/, alert.present()];
1939
+ case 2:
1940
+ _a.sent();
1941
+ alert.onDidDismiss().then(function () { callback(); });
1942
+ return [2 /*return*/];
1943
+ }
1944
+ });
1945
+ });
1946
+ };
1947
+ UIService.prototype.showToast = function (msg, duration) {
1948
+ return __awaiter(this, void 0, void 0, function () {
1949
+ var toast;
1950
+ return __generator(this, function (_a) {
1951
+ switch (_a.label) {
1952
+ case 0: return [4 /*yield*/, this.toastController.create({
1953
+ message: msg,
1954
+ color: 'dark',
1955
+ duration: duration || 2000
1956
+ })];
1957
+ case 1:
1958
+ toast = _a.sent();
1959
+ toast.present();
1960
+ return [2 /*return*/, toast];
1961
+ }
1962
+ });
1963
+ });
1964
+ };
1965
+ return UIService;
1966
+ }());
1967
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1968
+ UIService.decorators = [
1969
+ { type: i0.Injectable }
1970
+ ];
1971
+ /**
1972
+ * @type {function(): !Array<(null|{
1973
+ * type: ?,
1974
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
1975
+ * })>}
1976
+ * @nocollapse
1977
+ */
1978
+ UIService.ctorParameters = function () { return [
1979
+ { type: i1.LoadingController },
1980
+ { type: i1.AlertController },
1981
+ { type: i1.ToastController }
1982
+ ]; };
1983
+
1984
+ var AlertService = /** @class */ (function () {
1985
+ function AlertService(alertCtrl) {
1986
+ this.alertCtrl = alertCtrl;
1987
+ }
1988
+ AlertService.prototype.show = function (options) {
1989
+ return __awaiter(this, void 0, void 0, function () {
1990
+ var alert;
1991
+ return __generator(this, function (_a) {
1992
+ switch (_a.label) {
1993
+ case 0: return [4 /*yield*/, this.alertCtrl.create(options)];
1994
+ case 1:
1995
+ alert = _a.sent();
1996
+ return [4 /*yield*/, alert.present()];
1997
+ case 2:
1998
+ _a.sent();
1999
+ return [2 /*return*/];
2000
+ }
2001
+ });
2002
+ });
2003
+ };
2004
+ return AlertService;
2005
+ }());
2006
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
2007
+ AlertService.decorators = [
2008
+ { type: i0.Injectable }
2009
+ ];
2010
+ /**
2011
+ * @type {function(): !Array<(null|{
2012
+ * type: ?,
2013
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
2014
+ * })>}
2015
+ * @nocollapse
2016
+ */
2017
+ AlertService.ctorParameters = function () { return [
2018
+ { type: i1.AlertController }
2019
+ ]; };
2020
+
2021
+ var SharedServicesModule = /** @class */ (function () {
2022
+ function SharedServicesModule() {
2208
2023
  }
2209
- };
2024
+ return SharedServicesModule;
2025
+ }());
2026
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
2027
+ SharedServicesModule.decorators = [
2028
+ { type: i0.NgModule, args: [{
2029
+ imports: [
2030
+ i1.IonicModule,
2031
+ core.TranslateModule.forChild(),
2032
+ ngxCookie.CookieModule.forRoot(),
2033
+ ],
2034
+ providers: [
2035
+ ToastService,
2036
+ ErrorService,
2037
+ HardwareService,
2038
+ ModalService,
2039
+ DynamicComponentLoader,
2040
+ PopoverService,
2041
+ StorageService,
2042
+ StyleService,
2043
+ AuthService,
2044
+ FingerprintService,
2045
+ ngx.FingerprintAIO,
2046
+ CameraService,
2047
+ FileService,
2048
+ CalendarService,
2049
+ UIService,
2050
+ AlertService,
2051
+ DetailsService
2052
+ ],
2053
+ },] }
2054
+ ];
2210
2055
 
2211
2056
  var EnumToListPipe = /** @class */ (function () {
2212
2057
  function EnumToListPipe() {
@@ -2576,6 +2421,149 @@
2576
2421
  */
2577
2422
  AccordionHeaderComponent.ctorParameters = function () { return []; };
2578
2423
 
2424
+ /**
2425
+ * Only to use in smart-page
2426
+ * @requires PageComponent
2427
+ */
2428
+ var MenuService = /** @class */ (function () {
2429
+ function MenuService(menuCtrl, resolver) {
2430
+ this.menuCtrl = menuCtrl;
2431
+ this.resolver = resolver;
2432
+ this._openedEnd = false;
2433
+ this._menuItemsSource = new rxjs.BehaviorSubject([]);
2434
+ this.menuItems$ = this._menuItemsSource.asObservable();
2435
+ }
2436
+ Object.defineProperty(MenuService.prototype, "openedEnd", {
2437
+ /**
2438
+ * @desc checking if the menu is open (menu on the right side of the screen)
2439
+ */
2440
+ get: function () {
2441
+ return this._openedEnd;
2442
+ },
2443
+ enumerable: false,
2444
+ configurable: true
2445
+ });
2446
+ MenuService.prototype.changeMenuItemByRoute = function (route, changes) {
2447
+ var items = this._menuItemsSource.value.map(function (i) {
2448
+ if (i.route === route)
2449
+ return Object.assign(Object.assign({}, i), changes);
2450
+ return i;
2451
+ });
2452
+ this._menuItemsSource.next(items);
2453
+ };
2454
+ MenuService.prototype.setMenuItems = function (items) {
2455
+ this._menuItemsSource.next(items);
2456
+ };
2457
+ /**
2458
+ * @private
2459
+ */
2460
+ MenuService.prototype.init = function (endContainer) {
2461
+ return __awaiter(this, void 0, void 0, function () {
2462
+ return __generator(this, function (_b) {
2463
+ switch (_b.label) {
2464
+ case 0:
2465
+ this._endContainer = endContainer;
2466
+ return [4 /*yield*/, this.menuCtrl.close("end")];
2467
+ case 1:
2468
+ _b.sent();
2469
+ return [2 /*return*/];
2470
+ }
2471
+ });
2472
+ });
2473
+ };
2474
+ /**
2475
+ * @desc open menu (menu on the right side of the screen)
2476
+ * @param {object} options - use options
2477
+ * @param {class} options.component - angular component to render
2478
+ * @param {class} options.injector - angular injector to use in component
2479
+ */
2480
+ MenuService.prototype.openEnd = function (options) {
2481
+ return __awaiter(this, void 0, void 0, function () {
2482
+ var resolver, factory;
2483
+ return __generator(this, function (_b) {
2484
+ switch (_b.label) {
2485
+ case 0:
2486
+ this._openedEnd = true;
2487
+ if (this._endContainer) {
2488
+ resolver = options.injector.get(i0.ComponentFactoryResolver);
2489
+ this._endContainer.clear();
2490
+ factory = resolver.resolveComponentFactory(options.component);
2491
+ this._endContainer.createComponent(factory, 0, options.injector);
2492
+ }
2493
+ return [4 /*yield*/, this.menuCtrl.enable(true, "end")];
2494
+ case 1:
2495
+ _b.sent();
2496
+ return [4 /*yield*/, this.menuCtrl.open("end")];
2497
+ case 2:
2498
+ _b.sent();
2499
+ return [2 /*return*/];
2500
+ }
2501
+ });
2502
+ });
2503
+ };
2504
+ /**
2505
+ * @desc close menu (menu on the left side of the screen)
2506
+ */
2507
+ MenuService.prototype.closeStart = function () {
2508
+ return __awaiter(this, void 0, void 0, function () {
2509
+ return __generator(this, function (_b) {
2510
+ switch (_b.label) {
2511
+ case 0:
2512
+ this._openedEnd = false;
2513
+ return [4 /*yield*/, this.menuCtrl.close("start")];
2514
+ case 1:
2515
+ _b.sent();
2516
+ return [4 /*yield*/, this.menuCtrl.enable(false, "start")];
2517
+ case 2:
2518
+ _b.sent();
2519
+ return [2 /*return*/];
2520
+ }
2521
+ });
2522
+ });
2523
+ };
2524
+ /**
2525
+ * @desc close menu (menu on the right side of the screen)
2526
+ */
2527
+ MenuService.prototype.closeEnd = function () {
2528
+ var _a;
2529
+ return __awaiter(this, void 0, void 0, function () {
2530
+ return __generator(this, function (_b) {
2531
+ switch (_b.label) {
2532
+ case 0:
2533
+ this._openedEnd = false;
2534
+ return [4 /*yield*/, this.menuCtrl.close("end")];
2535
+ case 1:
2536
+ _b.sent();
2537
+ return [4 /*yield*/, this.menuCtrl.enable(false, "end")];
2538
+ case 2:
2539
+ _b.sent();
2540
+ (_a = this._endContainer) === null || _a === void 0 ? void 0 : _a.clear();
2541
+ return [2 /*return*/];
2542
+ }
2543
+ });
2544
+ });
2545
+ };
2546
+ return MenuService;
2547
+ }());
2548
+ /** @nocollapse */ MenuService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function MenuService_Factory() { return new MenuService(i0__namespace.ɵɵinject(i1__namespace.MenuController), i0__namespace.ɵɵinject(i0__namespace.ComponentFactoryResolver)); }, token: MenuService, providedIn: "root" });
2549
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
2550
+ MenuService.decorators = [
2551
+ { type: i0.Injectable, args: [{
2552
+ providedIn: "root",
2553
+ },] }
2554
+ ];
2555
+ /**
2556
+ * @type {function(): !Array<(null|{
2557
+ * type: ?,
2558
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
2559
+ * })>}
2560
+ * @nocollapse
2561
+ */
2562
+ MenuService.ctorParameters = function () { return [
2563
+ { type: i1.MenuController },
2564
+ { type: i0.ComponentFactoryResolver }
2565
+ ]; };
2566
+
2579
2567
  var AppBaseComponent = /** @class */ (function () {
2580
2568
  function AppBaseComponent(router, cd, elementRef, styleService, menuService, authService, platformId, document) {
2581
2569
  this.router = router;
@@ -3340,8 +3328,9 @@
3340
3328
 
3341
3329
  var DetailsComponent = /** @class */ (function (_super) {
3342
3330
  __extends(DetailsComponent, _super);
3343
- function DetailsComponent() {
3344
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
3331
+ function DetailsComponent(cd, moduleRef, cfr, detailsService) {
3332
+ var _this = _super.call(this, cd, moduleRef, cfr) || this;
3333
+ _this.detailsService = detailsService;
3345
3334
  _this._subscription = new rxjs.Subscription();
3346
3335
  _this.dynamicContents = new i0.QueryList();
3347
3336
  return _this;
@@ -3354,6 +3343,7 @@
3354
3343
  var _this = this;
3355
3344
  this._options = val;
3356
3345
  this._subscription.add(this._options.item$.subscribe(function (item) {
3346
+ _this.detailsService.setRoot(item);
3357
3347
  _this.item = item;
3358
3348
  }));
3359
3349
  this.refreshDynamicInstance();
@@ -3379,6 +3369,19 @@
3379
3369
  changeDetection: i0.ChangeDetectionStrategy.OnPush
3380
3370
  },] }
3381
3371
  ];
3372
+ /**
3373
+ * @type {function(): !Array<(null|{
3374
+ * type: ?,
3375
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
3376
+ * })>}
3377
+ * @nocollapse
3378
+ */
3379
+ DetailsComponent.ctorParameters = function () { return [
3380
+ { type: i0.ChangeDetectorRef },
3381
+ { type: i0.NgModuleRef },
3382
+ { type: i0.ComponentFactoryResolver },
3383
+ { type: DetailsService }
3384
+ ]; };
3382
3385
  /** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
3383
3386
  DetailsComponent.propDecorators = {
3384
3387
  options: [{ type: i0.Input }],
@@ -3387,8 +3390,9 @@
3387
3390
  };
3388
3391
 
3389
3392
  var DetailsBaseComponent = /** @class */ (function () {
3390
- function DetailsBaseComponent(authService) {
3393
+ function DetailsBaseComponent(authService, detailsService) {
3391
3394
  this.authService = authService;
3395
+ this.detailsService = detailsService;
3392
3396
  }
3393
3397
  Object.defineProperty(DetailsBaseComponent.prototype, "fields", {
3394
3398
  get: function () {
@@ -3439,7 +3443,9 @@
3439
3443
  else
3440
3444
  result = utils.ObjectService.createByType(item, obj.type);
3441
3445
  var removeFields = enabledDefinitions.filter(function (def) {
3442
- return utils.SpecificationService.invalid(result, def.spec);
3446
+ return utils.SpecificationService.invalid(result, def.spec, {
3447
+ $root: _this.detailsService.$root
3448
+ });
3443
3449
  }).map(function (def) { return def.key; });
3444
3450
  _this._fields = _this._fields.filter(function (f) { return !removeFields.some(function (rf) { return rf === f.key; }); });
3445
3451
  return result;
@@ -3484,7 +3490,8 @@
3484
3490
  * @nocollapse
3485
3491
  */
3486
3492
  DetailsBaseComponent.ctorParameters = function () { return [
3487
- { type: AuthService }
3493
+ { type: AuthService },
3494
+ { type: DetailsService }
3488
3495
  ]; };
3489
3496
  /** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
3490
3497
  DetailsBaseComponent.propDecorators = {
@@ -3937,6 +3944,66 @@
3937
3944
  rowClassExist: [{ type: i0.HostBinding, args: ['class.row',] }]
3938
3945
  };
3939
3946
 
3947
+ var NgrxStoreService = /** @class */ (function () {
3948
+ function NgrxStoreService() {
3949
+ }
3950
+ NgrxStoreService.addReducer = function (key, reducer) {
3951
+ if (!NgrxStoreService._reducers[key]) {
3952
+ NgrxStoreService._reducers[key] = reducer;
3953
+ NgrxStoreService.store.addReducer(key, reducer);
3954
+ console.log(NgrxStoreService.name + " register reducer " + key);
3955
+ }
3956
+ };
3957
+ NgrxStoreService.prototype.connect = function (store) {
3958
+ NgrxStoreService.store = store;
3959
+ };
3960
+ return NgrxStoreService;
3961
+ }());
3962
+ NgrxStoreService._reducers = {};
3963
+ NgrxStoreService.store = undefined;
3964
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
3965
+ NgrxStoreService.decorators = [
3966
+ { type: i0.Injectable }
3967
+ ];
3968
+
3969
+ var AppService = /** @class */ (function () {
3970
+ function AppService() {
3971
+ this.endButtons$ = AppService._endButtonsSource$.asObservable();
3972
+ }
3973
+ AppService.prototype.addEndButton = function (button) {
3974
+ if (button.id) {
3975
+ var exist_1 = AppService._endButtonsSource$.value.find(function (e) { return e.id === button.id; });
3976
+ if (exist_1) {
3977
+ Object.keys(button).filter(function (k) { return k !== 'id'; }).forEach(function (key) {
3978
+ exist_1[key] = button[key];
3979
+ });
3980
+ AppService._endButtonsSource$.next(__spreadArray([], __read(AppService._endButtonsSource$.value)));
3981
+ return;
3982
+ }
3983
+ }
3984
+ AppService._endButtonsSource$.next(utils.ArrayService.addItem(AppService._endButtonsSource$.value, button));
3985
+ };
3986
+ AppService.prototype.removeEndButton = function (buttonOrId) {
3987
+ if (typeof buttonOrId === 'object') {
3988
+ var button = buttonOrId.id ?
3989
+ AppService._endButtonsSource$.value.find(function (e) { return e.id === buttonOrId.id; })
3990
+ : buttonOrId;
3991
+ AppService._endButtonsSource$.next(utils.ArrayService.removeItem(AppService._endButtonsSource$.value, button));
3992
+ return;
3993
+ }
3994
+ AppService._endButtonsSource$.next(__spreadArray([], __read(AppService._endButtonsSource$.value.filter(function (e) { return e.id !== buttonOrId; }))));
3995
+ };
3996
+ return AppService;
3997
+ }());
3998
+ AppService._endButtonsSource$ = new rxjs.BehaviorSubject([]);
3999
+ /** @nocollapse */ AppService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function AppService_Factory() { return new AppService(); }, token: AppService, providedIn: "root" });
4000
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
4001
+ AppService.decorators = [
4002
+ { type: i0.Injectable, args: [{
4003
+ providedIn: 'root'
4004
+ },] }
4005
+ ];
4006
+
3940
4007
  var InputComponent = /** @class */ (function () {
3941
4008
  function InputComponent(componentFactoryResolver, injector) {
3942
4009
  this.componentFactoryResolver = componentFactoryResolver;
@@ -8491,6 +8558,7 @@
8491
8558
  exports.DetailsComponent = DetailsComponent;
8492
8559
  exports.DetailsDirective = DetailsDirective;
8493
8560
  exports.DetailsPage = DetailsPage;
8561
+ exports.DetailsService = DetailsService;
8494
8562
  exports.DetailsStandardComponent = DetailsStandardComponent;
8495
8563
  exports.DynamicComponent = DynamicComponent;
8496
8564
  exports.DynamicComponentLoader = DynamicComponentLoader;
@@ -8613,171 +8681,172 @@
8613
8681
  exports.modalFromBottomLeaveAnimation = modalFromBottomLeaveAnimation;
8614
8682
  exports["ɵa"] = SharedFactoriesModule;
8615
8683
  exports["ɵb"] = FormFactory;
8616
- exports["ɵba"] = ListHeaderPipe;
8617
- exports["ɵbb"] = IModelLabelProvider;
8618
- exports["ɵbc"] = MODEL_LABEL_PROVIDER;
8619
- exports["ɵbd"] = ModelLabelPipe;
8620
- exports["ɵbe"] = APP_COMPONENTS;
8621
- exports["ɵbf"] = ACCORDION_COMPONENTS;
8622
- exports["ɵbg"] = BUTTON_COMPONENTS;
8623
- exports["ɵbh"] = CARD_COMPONENTS;
8624
- exports["ɵbi"] = CHART_COMPONENTS;
8625
- exports["ɵbj"] = DETAILS_COMPONENTS;
8626
- exports["ɵbk"] = DETAIL_COMPONENTS;
8627
- exports["ɵbl"] = FORM_COMPONENTS;
8628
- exports["ɵbm"] = INPUT_COMPONENTS;
8629
- exports["ɵbn"] = LIST_COMPONENTS;
8630
- exports["ɵbo"] = LOADER_COMPONENTS;
8631
- exports["ɵbp"] = PAGE_COMPONENTS;
8632
- exports["ɵbq"] = SEARCHBAR_COMPONENTS;
8633
- exports["ɵbr"] = TABS_COMPONENTS;
8634
- exports["ɵbs"] = GRID_COMPONENTS;
8635
- exports["ɵbt"] = INFO_COMPONENTS;
8636
- exports["ɵbu"] = DATE_RANGE_COMPONENTS;
8637
- exports["ɵbv"] = DATE_EDIT_COMPONENTS;
8638
- exports["ɵbw"] = DYNAMIC_COMPONENTS;
8639
- exports["ɵbx"] = COMPONENTS$1;
8640
- exports["ɵby"] = IMPORTS;
8641
- exports["ɵbz"] = SharedComponentsModule;
8684
+ exports["ɵba"] = FileUrlPipe;
8685
+ exports["ɵbb"] = ListHeaderPipe;
8686
+ exports["ɵbc"] = IModelLabelProvider;
8687
+ exports["ɵbd"] = MODEL_LABEL_PROVIDER;
8688
+ exports["ɵbe"] = ModelLabelPipe;
8689
+ exports["ɵbf"] = APP_COMPONENTS;
8690
+ exports["ɵbg"] = ACCORDION_COMPONENTS;
8691
+ exports["ɵbh"] = BUTTON_COMPONENTS;
8692
+ exports["ɵbi"] = CARD_COMPONENTS;
8693
+ exports["ɵbj"] = CHART_COMPONENTS;
8694
+ exports["ɵbk"] = DETAILS_COMPONENTS;
8695
+ exports["ɵbl"] = DETAIL_COMPONENTS;
8696
+ exports["ɵbm"] = FORM_COMPONENTS;
8697
+ exports["ɵbn"] = INPUT_COMPONENTS;
8698
+ exports["ɵbo"] = LIST_COMPONENTS;
8699
+ exports["ɵbp"] = LOADER_COMPONENTS;
8700
+ exports["ɵbq"] = PAGE_COMPONENTS;
8701
+ exports["ɵbr"] = SEARCHBAR_COMPONENTS;
8702
+ exports["ɵbs"] = TABS_COMPONENTS;
8703
+ exports["ɵbt"] = GRID_COMPONENTS;
8704
+ exports["ɵbu"] = INFO_COMPONENTS;
8705
+ exports["ɵbv"] = DATE_RANGE_COMPONENTS;
8706
+ exports["ɵbw"] = DATE_EDIT_COMPONENTS;
8707
+ exports["ɵbx"] = DYNAMIC_COMPONENTS;
8708
+ exports["ɵby"] = COMPONENTS$1;
8709
+ exports["ɵbz"] = IMPORTS;
8642
8710
  exports["ɵc"] = IModelValidatorsProvider;
8643
- exports["ɵca"] = FormStandardComponent;
8644
- exports["ɵcb"] = FormBaseComponent;
8645
- exports["ɵcc"] = BaseComponent;
8646
- exports["ɵcd"] = FormStepperComponent;
8647
- exports["ɵce"] = FormComponent;
8648
- exports["ɵcf"] = DynamicContentDirective;
8649
- exports["ɵcg"] = IModelExportProvider;
8650
- exports["ɵch"] = MODEL_EXPORT_PROVIDER;
8651
- exports["ɵci"] = IModelImportProvider;
8652
- exports["ɵcj"] = MODEL_IMPORT_PROVIDER;
8653
- exports["ɵck"] = AppSplitPanelComponent;
8654
- exports["ɵcl"] = AppBaseComponent;
8655
- exports["ɵcm"] = MenuService;
8656
- exports["ɵcn"] = PageStandardComponent;
8657
- exports["ɵco"] = PageBaseComponent;
8658
- exports["ɵcp"] = AppService;
8659
- exports["ɵcq"] = PageComponent;
8660
- exports["ɵcr"] = InputComponent;
8661
- exports["ɵcs"] = InputIntComponent;
8662
- exports["ɵct"] = InputBaseComponent;
8663
- exports["ɵcu"] = BaseComponent;
8664
- exports["ɵcv"] = InputErrorComponent;
8665
- exports["ɵcw"] = InputTextComponent;
8666
- exports["ɵcx"] = InputPasswordComponent;
8667
- exports["ɵcy"] = InputFlagComponent;
8668
- exports["ɵcz"] = InputEnumComponent;
8711
+ exports["ɵca"] = SharedComponentsModule;
8712
+ exports["ɵcb"] = FormStandardComponent;
8713
+ exports["ɵcc"] = FormBaseComponent;
8714
+ exports["ɵcd"] = BaseComponent;
8715
+ exports["ɵce"] = FormStepperComponent;
8716
+ exports["ɵcf"] = FormComponent;
8717
+ exports["ɵcg"] = DynamicContentDirective;
8718
+ exports["ɵch"] = IModelExportProvider;
8719
+ exports["ɵci"] = MODEL_EXPORT_PROVIDER;
8720
+ exports["ɵcj"] = IModelImportProvider;
8721
+ exports["ɵck"] = MODEL_IMPORT_PROVIDER;
8722
+ exports["ɵcl"] = AppSplitPanelComponent;
8723
+ exports["ɵcm"] = AppBaseComponent;
8724
+ exports["ɵcn"] = MenuService;
8725
+ exports["ɵco"] = PageStandardComponent;
8726
+ exports["ɵcp"] = PageBaseComponent;
8727
+ exports["ɵcq"] = AppService;
8728
+ exports["ɵcr"] = PageComponent;
8729
+ exports["ɵcs"] = InputComponent;
8730
+ exports["ɵct"] = InputIntComponent;
8731
+ exports["ɵcu"] = InputBaseComponent;
8732
+ exports["ɵcv"] = BaseComponent;
8733
+ exports["ɵcw"] = InputErrorComponent;
8734
+ exports["ɵcx"] = InputTextComponent;
8735
+ exports["ɵcy"] = InputPasswordComponent;
8736
+ exports["ɵcz"] = InputFlagComponent;
8669
8737
  exports["ɵd"] = MODEL_VALIDATORS_PROVIDER;
8670
- exports["ɵda"] = InputEmailComponent;
8671
- exports["ɵdb"] = InputCurrencyComponent;
8672
- exports["ɵdc"] = MY_FORMATS;
8673
- exports["ɵdd"] = InputDateComponent;
8674
- exports["ɵde"] = InputDateWithEditComponent;
8675
- exports["ɵdf"] = InputFileComponent;
8676
- exports["ɵdg"] = InputRadioComponent;
8677
- exports["ɵdh"] = InputPossibilitiesBaseComponent;
8678
- exports["ɵdi"] = IModelPossibilitiesProvider;
8679
- exports["ɵdj"] = MODEL_POSSIBILITIES_PROVIDER;
8680
- exports["ɵdk"] = InputNipComponent;
8681
- exports["ɵdl"] = InputStringsComponent;
8682
- exports["ɵdm"] = InputLongTextComponent;
8683
- exports["ɵdn"] = InputAddressComponent;
8684
- exports["ɵdo"] = InputObjectComponent;
8685
- exports["ɵdp"] = InputColorComponent;
8686
- exports["ɵdq"] = InputLogoComponent;
8687
- exports["ɵdr"] = InputCheckComponent;
8688
- exports["ɵds"] = InputIntsComponent;
8689
- exports["ɵdt"] = InputPhoneNumberComponent;
8690
- exports["ɵdu"] = InputPeselComponent;
8691
- exports["ɵdv"] = InputArrayComponent;
8692
- exports["ɵdw"] = InputPdfComponent;
8693
- exports["ɵdx"] = InputFileBaseComponent;
8694
- exports["ɵdy"] = InputVideoComponent;
8695
- exports["ɵdz"] = InputAttachmentComponent;
8738
+ exports["ɵda"] = InputEnumComponent;
8739
+ exports["ɵdb"] = InputEmailComponent;
8740
+ exports["ɵdc"] = InputCurrencyComponent;
8741
+ exports["ɵdd"] = MY_FORMATS;
8742
+ exports["ɵde"] = InputDateComponent;
8743
+ exports["ɵdf"] = InputDateWithEditComponent;
8744
+ exports["ɵdg"] = InputFileComponent;
8745
+ exports["ɵdh"] = InputRadioComponent;
8746
+ exports["ɵdi"] = InputPossibilitiesBaseComponent;
8747
+ exports["ɵdj"] = IModelPossibilitiesProvider;
8748
+ exports["ɵdk"] = MODEL_POSSIBILITIES_PROVIDER;
8749
+ exports["ɵdl"] = InputNipComponent;
8750
+ exports["ɵdm"] = InputStringsComponent;
8751
+ exports["ɵdn"] = InputLongTextComponent;
8752
+ exports["ɵdo"] = InputAddressComponent;
8753
+ exports["ɵdp"] = InputObjectComponent;
8754
+ exports["ɵdq"] = InputColorComponent;
8755
+ exports["ɵdr"] = InputLogoComponent;
8756
+ exports["ɵds"] = InputCheckComponent;
8757
+ exports["ɵdt"] = InputIntsComponent;
8758
+ exports["ɵdu"] = InputPhoneNumberComponent;
8759
+ exports["ɵdv"] = InputPeselComponent;
8760
+ exports["ɵdw"] = InputArrayComponent;
8761
+ exports["ɵdx"] = InputPdfComponent;
8762
+ exports["ɵdy"] = InputFileBaseComponent;
8763
+ exports["ɵdz"] = InputVideoComponent;
8696
8764
  exports["ɵe"] = AuthService;
8697
- exports["ɵea"] = InputDateRangeComponent;
8698
- exports["ɵeb"] = InputImageComponent;
8699
- exports["ɵec"] = InputFloatComponent;
8700
- exports["ɵed"] = ButtonComponent;
8701
- exports["ɵee"] = ButtonStandardComponent;
8702
- exports["ɵef"] = ButtonBaseComponent;
8703
- exports["ɵeg"] = CardComponent;
8704
- exports["ɵeh"] = ListComponent;
8705
- exports["ɵei"] = ListMobileComponent;
8706
- exports["ɵej"] = ListBaseComponent;
8707
- exports["ɵek"] = ListDesktopComponent;
8708
- exports["ɵel"] = ListMasonryGridComponent;
8709
- exports["ɵem"] = LoaderComponent;
8710
- exports["ɵen"] = DetailComponent;
8711
- exports["ɵeo"] = DetailTextComponent;
8712
- exports["ɵep"] = DetailBaseComponent;
8713
- exports["ɵeq"] = DetailFlagComponent;
8714
- exports["ɵer"] = DetailEnumComponent;
8715
- exports["ɵes"] = DetailEmailComponent;
8716
- exports["ɵet"] = DetailAddressComponent;
8717
- exports["ɵeu"] = DetailObjectComponent;
8718
- exports["ɵev"] = DetailColorComponent;
8719
- exports["ɵew"] = DetailLogoComponent;
8720
- exports["ɵex"] = DetailArrayComponent;
8721
- exports["ɵey"] = DetailPdfComponent;
8722
- exports["ɵez"] = DetailVideoComponent;
8765
+ exports["ɵea"] = InputAttachmentComponent;
8766
+ exports["ɵeb"] = InputDateRangeComponent;
8767
+ exports["ɵec"] = InputImageComponent;
8768
+ exports["ɵed"] = InputFloatComponent;
8769
+ exports["ɵee"] = ButtonComponent;
8770
+ exports["ɵef"] = ButtonStandardComponent;
8771
+ exports["ɵeg"] = ButtonBaseComponent;
8772
+ exports["ɵeh"] = CardComponent;
8773
+ exports["ɵei"] = ListComponent;
8774
+ exports["ɵej"] = ListMobileComponent;
8775
+ exports["ɵek"] = ListBaseComponent;
8776
+ exports["ɵel"] = ListDesktopComponent;
8777
+ exports["ɵem"] = ListMasonryGridComponent;
8778
+ exports["ɵen"] = LoaderComponent;
8779
+ exports["ɵeo"] = DetailComponent;
8780
+ exports["ɵep"] = DetailTextComponent;
8781
+ exports["ɵeq"] = DetailBaseComponent;
8782
+ exports["ɵer"] = DetailFlagComponent;
8783
+ exports["ɵes"] = DetailEnumComponent;
8784
+ exports["ɵet"] = DetailEmailComponent;
8785
+ exports["ɵeu"] = DetailAddressComponent;
8786
+ exports["ɵev"] = DetailObjectComponent;
8787
+ exports["ɵew"] = DetailColorComponent;
8788
+ exports["ɵex"] = DetailLogoComponent;
8789
+ exports["ɵey"] = DetailArrayComponent;
8790
+ exports["ɵez"] = DetailPdfComponent;
8723
8791
  exports["ɵf"] = StorageService;
8724
- exports["ɵfa"] = DetailAttachmentComponent;
8725
- exports["ɵfb"] = DetailDateRangeComponent;
8726
- exports["ɵfc"] = DetailImageComponent;
8727
- exports["ɵfd"] = DetailsComponent;
8728
- exports["ɵfe"] = DetailsStandardComponent;
8729
- exports["ɵff"] = DetailsBaseComponent;
8730
- exports["ɵfg"] = SearchbarComponent;
8731
- exports["ɵfh"] = TabsComponent;
8732
- exports["ɵfi"] = TabComponent;
8733
- exports["ɵfj"] = AccordionComponent;
8734
- exports["ɵfk"] = AccordionHeaderComponent;
8735
- exports["ɵfl"] = AccordionBodyComponent;
8736
- exports["ɵfm"] = ChartComponent;
8737
- exports["ɵfn"] = ChartLineComponent;
8738
- exports["ɵfo"] = ChartBaseComponent;
8739
- exports["ɵfp"] = ChartBarComponent;
8740
- exports["ɵfq"] = GridComponent;
8741
- exports["ɵfr"] = GridRowComponent;
8742
- exports["ɵfs"] = GridColumnComponent;
8743
- exports["ɵft"] = DynamicComponent;
8744
- exports["ɵfu"] = PasswordStrengthComponent;
8745
- exports["ɵfv"] = InfoComponent;
8746
- exports["ɵfw"] = InfoModalComponent;
8747
- exports["ɵfx"] = DateRangeComponent;
8748
- exports["ɵfy"] = DateRangeModalComponent;
8749
- exports["ɵfz"] = DateEditComponent;
8750
- exports["ɵg"] = SharedServicesModule;
8751
- exports["ɵga"] = ErrorContextComponent;
8752
- exports["ɵgb"] = ExportComponent;
8753
- exports["ɵgc"] = PagingComponent;
8754
- exports["ɵgd"] = ImportComponent;
8755
- exports["ɵge"] = SharedDirectivesModule;
8756
- exports["ɵgf"] = DetailsDirective;
8757
- exports["ɵgg"] = DateValidator;
8758
- exports["ɵgh"] = SharedPagesModule;
8759
- exports["ɵgi"] = DetailsPage;
8760
- exports["ɵgj"] = NgrxStoreService;
8761
- exports["ɵgk"] = ErrorEffects;
8762
- exports["ɵh"] = ToastService;
8763
- exports["ɵi"] = ErrorService;
8764
- exports["ɵj"] = HardwareService;
8765
- exports["ɵk"] = ModalService;
8766
- exports["ɵl"] = DynamicComponentLoader;
8767
- exports["ɵm"] = PopoverService;
8768
- exports["ɵn"] = StyleService;
8769
- exports["ɵo"] = FingerprintService;
8770
- exports["ɵp"] = CameraService;
8771
- exports["ɵq"] = FILE_SERVICE_CONFIG;
8772
- exports["ɵr"] = FileService;
8773
- exports["ɵs"] = CalendarService;
8774
- exports["ɵt"] = UIService;
8775
- exports["ɵu"] = AlertService;
8776
- exports["ɵv"] = PIPES;
8777
- exports["ɵw"] = SharedPipesModule;
8778
- exports["ɵx"] = EnumToListPipe;
8779
- exports["ɵy"] = ListCellPipe;
8780
- exports["ɵz"] = FileUrlPipe;
8792
+ exports["ɵfa"] = DetailVideoComponent;
8793
+ exports["ɵfb"] = DetailAttachmentComponent;
8794
+ exports["ɵfc"] = DetailDateRangeComponent;
8795
+ exports["ɵfd"] = DetailImageComponent;
8796
+ exports["ɵfe"] = DetailsComponent;
8797
+ exports["ɵff"] = DetailsStandardComponent;
8798
+ exports["ɵfg"] = DetailsBaseComponent;
8799
+ exports["ɵfh"] = SearchbarComponent;
8800
+ exports["ɵfi"] = TabsComponent;
8801
+ exports["ɵfj"] = TabComponent;
8802
+ exports["ɵfk"] = AccordionComponent;
8803
+ exports["ɵfl"] = AccordionHeaderComponent;
8804
+ exports["ɵfm"] = AccordionBodyComponent;
8805
+ exports["ɵfn"] = ChartComponent;
8806
+ exports["ɵfo"] = ChartLineComponent;
8807
+ exports["ɵfp"] = ChartBaseComponent;
8808
+ exports["ɵfq"] = ChartBarComponent;
8809
+ exports["ɵfr"] = GridComponent;
8810
+ exports["ɵfs"] = GridRowComponent;
8811
+ exports["ɵft"] = GridColumnComponent;
8812
+ exports["ɵfu"] = DynamicComponent;
8813
+ exports["ɵfv"] = PasswordStrengthComponent;
8814
+ exports["ɵfw"] = InfoComponent;
8815
+ exports["ɵfx"] = InfoModalComponent;
8816
+ exports["ɵfy"] = DateRangeComponent;
8817
+ exports["ɵfz"] = DateRangeModalComponent;
8818
+ exports["ɵg"] = DetailsService;
8819
+ exports["ɵga"] = DateEditComponent;
8820
+ exports["ɵgb"] = ErrorContextComponent;
8821
+ exports["ɵgc"] = ExportComponent;
8822
+ exports["ɵgd"] = PagingComponent;
8823
+ exports["ɵge"] = ImportComponent;
8824
+ exports["ɵgf"] = SharedDirectivesModule;
8825
+ exports["ɵgg"] = DetailsDirective;
8826
+ exports["ɵgh"] = DateValidator;
8827
+ exports["ɵgi"] = SharedPagesModule;
8828
+ exports["ɵgj"] = DetailsPage;
8829
+ exports["ɵgk"] = NgrxStoreService;
8830
+ exports["ɵgl"] = ErrorEffects;
8831
+ exports["ɵh"] = SharedServicesModule;
8832
+ exports["ɵi"] = ToastService;
8833
+ exports["ɵj"] = ErrorService;
8834
+ exports["ɵk"] = HardwareService;
8835
+ exports["ɵl"] = ModalService;
8836
+ exports["ɵm"] = DynamicComponentLoader;
8837
+ exports["ɵn"] = PopoverService;
8838
+ exports["ɵo"] = StyleService;
8839
+ exports["ɵp"] = FingerprintService;
8840
+ exports["ɵq"] = CameraService;
8841
+ exports["ɵr"] = FILE_SERVICE_CONFIG;
8842
+ exports["ɵs"] = FileService;
8843
+ exports["ɵt"] = CalendarService;
8844
+ exports["ɵu"] = UIService;
8845
+ exports["ɵv"] = AlertService;
8846
+ exports["ɵw"] = PIPES;
8847
+ exports["ɵx"] = SharedPipesModule;
8848
+ exports["ɵy"] = EnumToListPipe;
8849
+ exports["ɵz"] = ListCellPipe;
8781
8850
 
8782
8851
  Object.defineProperty(exports, '__esModule', { value: true });
8783
8852