@smartsoft001/crud-shell-angular 1.1.595 → 1.1.602
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/smartsoft001-crud-shell-angular.umd.js +377 -245
- package/bundles/smartsoft001-crud-shell-angular.umd.js.map +1 -1
- package/esm2015/index.js +3 -1
- package/esm2015/lib/+state/crud.actions.js +1 -1
- package/esm2015/lib/+state/crud.effects.js +1 -1
- package/esm2015/lib/+state/crud.facade.js +1 -1
- package/esm2015/lib/+state/crud.reducer.js +1 -1
- package/esm2015/lib/+state/crud.selectors.js +1 -1
- package/esm2015/lib/components/components.module.js +1 -1
- package/esm2015/lib/components/export/export.component.js +1 -1
- package/esm2015/lib/components/filter/base/base.component.js +1 -1
- package/esm2015/lib/components/filter/check/check.component.js +1 -1
- package/esm2015/lib/components/filter/date/date.component.js +1 -1
- package/esm2015/lib/components/filter/date-with-edit/date-with-edit.component.js +1 -1
- package/esm2015/lib/components/filter/filter.component.js +1 -1
- package/esm2015/lib/components/filter/flag/flag.component.js +1 -1
- package/esm2015/lib/components/filter/index.js +1 -1
- package/esm2015/lib/components/filter/radio/radio.component.js +1 -1
- package/esm2015/lib/components/filter/text/text.component.js +1 -1
- package/esm2015/lib/components/filters/filters.component.js +1 -1
- package/esm2015/lib/components/filters-config/filters-config.component.js +1 -1
- package/esm2015/lib/components/group/group.component.js +1 -1
- package/esm2015/lib/components/index.js +2 -1
- package/esm2015/lib/components/multiselect/multiselect.component.js +1 -1
- package/esm2015/lib/crud-full.module.js +10 -3
- package/esm2015/lib/crud.config.js +1 -1
- package/esm2015/lib/crud.module.js +3 -1
- package/esm2015/lib/factories/list-pagination/list-pagination.factory.js +1 -1
- package/esm2015/lib/models/index.js +1 -1
- package/esm2015/lib/models/interfaces.js +1 -1
- package/esm2015/lib/pages/index.js +3 -0
- package/esm2015/lib/pages/item/base/base.component.js +41 -0
- package/esm2015/lib/pages/item/item.component.js +56 -17
- package/esm2015/lib/pages/item/standard/standard.component.js +13 -0
- package/esm2015/lib/pages/list/base/base.component.js +30 -0
- package/esm2015/lib/pages/list/list.component.js +30 -14
- package/esm2015/lib/pages/list/standard/standard.component.js +13 -0
- package/esm2015/lib/pipes/form-options/form-options.pipe.js +1 -1
- package/esm2015/lib/pipes/index.js +1 -1
- package/esm2015/lib/pipes/pipes.module.js +1 -1
- package/esm2015/lib/providers/model-possibilities/model-possibilities.provider.js +1 -1
- package/esm2015/lib/services/crud/crud.service.js +1 -1
- package/esm2015/lib/services/page/page.service.js +48 -0
- package/esm2015/lib/services/socket/socket.service.js +1 -1
- package/esm2015/smartsoft001-crud-shell-angular.js +6 -3
- package/fesm2015/smartsoft001-crud-shell-angular.js +358 -218
- package/fesm2015/smartsoft001-crud-shell-angular.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/crud-full.module.d.ts.map +1 -1
- package/lib/crud-full.module.ngfactory.d.ts.map +1 -1
- package/lib/crud.module.d.ts.map +1 -1
- package/lib/pages/index.d.ts +3 -0
- package/lib/pages/index.d.ts.map +1 -0
- package/lib/pages/item/base/base.component.d.ts +22 -0
- package/lib/pages/item/base/base.component.d.ts.map +1 -0
- package/lib/pages/item/item.component.d.ts +17 -7
- package/lib/pages/item/item.component.d.ts.map +1 -1
- package/lib/pages/item/standard/standard.component.d.ts +5 -0
- package/lib/pages/item/standard/standard.component.d.ts.map +1 -0
- package/lib/pages/item/standard/standard.component.ngfactory.d.ts.map +1 -0
- package/lib/pages/item/standard/standard.component.scss.shim.ngstyle.d.ts.map +1 -0
- package/lib/pages/list/base/base.component.d.ts +12 -0
- package/lib/pages/list/base/base.component.d.ts.map +1 -0
- package/lib/pages/list/list.component.d.ts +12 -5
- package/lib/pages/list/list.component.d.ts.map +1 -1
- package/lib/pages/list/standard/standard.component.d.ts +5 -0
- package/lib/pages/list/standard/standard.component.d.ts.map +1 -0
- package/lib/pages/list/standard/standard.component.ngfactory.d.ts.map +1 -0
- package/lib/pages/list/standard/standard.component.scss.shim.ngstyle.d.ts.map +1 -0
- package/lib/services/page/page.service.d.ts +9 -0
- package/lib/services/page/page.service.d.ts.map +1 -0
- package/lib/services/page/page.service.ngfactory.d.ts.map +1 -0
- package/package.json +10 -10
- package/smartsoft001-crud-shell-angular.d.ts +5 -2
- package/smartsoft001-crud-shell-angular.d.ts.map +1 -1
- package/smartsoft001-crud-shell-angular.metadata.json +1 -1
- package/esm2015/index.js.map +0 -1
- package/esm2015/index.metadata.json +0 -1
- package/esm2015/lib/+state/crud.actions.js.map +0 -1
- package/esm2015/lib/+state/crud.actions.metadata.json +0 -1
- package/esm2015/lib/+state/crud.effects.js.map +0 -1
- package/esm2015/lib/+state/crud.effects.metadata.json +0 -1
- package/esm2015/lib/+state/crud.effects.ngfactory.js.map +0 -1
- package/esm2015/lib/+state/crud.facade.js.map +0 -1
- package/esm2015/lib/+state/crud.facade.metadata.json +0 -1
- package/esm2015/lib/+state/crud.facade.ngfactory.js.map +0 -1
- package/esm2015/lib/+state/crud.reducer.js.map +0 -1
- package/esm2015/lib/+state/crud.reducer.metadata.json +0 -1
- package/esm2015/lib/+state/crud.selectors.js.map +0 -1
- package/esm2015/lib/+state/crud.selectors.metadata.json +0 -1
- package/esm2015/lib/components/components.module.js.map +0 -1
- package/esm2015/lib/components/components.module.metadata.json +0 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +0 -1
- package/esm2015/lib/components/export/export.component.js.map +0 -1
- package/esm2015/lib/components/export/export.component.metadata.json +0 -1
- package/esm2015/lib/components/export/export.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/export/export.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/filter/base/base.component.js.map +0 -1
- package/esm2015/lib/components/filter/base/base.component.metadata.json +0 -1
- package/esm2015/lib/components/filter/check/check.component.js.map +0 -1
- package/esm2015/lib/components/filter/check/check.component.metadata.json +0 -1
- package/esm2015/lib/components/filter/check/check.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/filter/check/check.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/filter/date/date.component.js.map +0 -1
- package/esm2015/lib/components/filter/date/date.component.metadata.json +0 -1
- package/esm2015/lib/components/filter/date/date.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/filter/date/date.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/filter/date-with-edit/date-with-edit.component.js.map +0 -1
- package/esm2015/lib/components/filter/date-with-edit/date-with-edit.component.metadata.json +0 -1
- package/esm2015/lib/components/filter/date-with-edit/date-with-edit.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/filter/date-with-edit/date-with-edit.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/filter/filter.component.js.map +0 -1
- package/esm2015/lib/components/filter/filter.component.metadata.json +0 -1
- package/esm2015/lib/components/filter/filter.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/filter/filter.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/filter/flag/flag.component.js.map +0 -1
- package/esm2015/lib/components/filter/flag/flag.component.metadata.json +0 -1
- package/esm2015/lib/components/filter/flag/flag.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/filter/flag/flag.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/filter/index.js.map +0 -1
- package/esm2015/lib/components/filter/index.metadata.json +0 -1
- package/esm2015/lib/components/filter/radio/radio.component.js.map +0 -1
- package/esm2015/lib/components/filter/radio/radio.component.metadata.json +0 -1
- package/esm2015/lib/components/filter/radio/radio.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/filter/radio/radio.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/filter/text/text.component.js.map +0 -1
- package/esm2015/lib/components/filter/text/text.component.metadata.json +0 -1
- package/esm2015/lib/components/filter/text/text.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/filter/text/text.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/filters/filters.component.js.map +0 -1
- package/esm2015/lib/components/filters/filters.component.metadata.json +0 -1
- package/esm2015/lib/components/filters/filters.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/filters/filters.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/filters-config/filters-config.component.js.map +0 -1
- package/esm2015/lib/components/filters-config/filters-config.component.metadata.json +0 -1
- package/esm2015/lib/components/filters-config/filters-config.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/filters-config/filters-config.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/group/group.component.js.map +0 -1
- package/esm2015/lib/components/group/group.component.metadata.json +0 -1
- package/esm2015/lib/components/group/group.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/group/group.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/index.js.map +0 -1
- package/esm2015/lib/components/index.metadata.json +0 -1
- package/esm2015/lib/components/multiselect/multiselect.component.js.map +0 -1
- package/esm2015/lib/components/multiselect/multiselect.component.metadata.json +0 -1
- package/esm2015/lib/components/multiselect/multiselect.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/multiselect/multiselect.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/crud-full.module.js.map +0 -1
- package/esm2015/lib/crud-full.module.metadata.json +0 -1
- package/esm2015/lib/crud-full.module.ngfactory.js.map +0 -1
- package/esm2015/lib/crud.config.js.map +0 -1
- package/esm2015/lib/crud.config.metadata.json +0 -1
- package/esm2015/lib/crud.config.ngfactory.js.map +0 -1
- package/esm2015/lib/crud.module.js.map +0 -1
- package/esm2015/lib/crud.module.metadata.json +0 -1
- package/esm2015/lib/crud.module.ngfactory.js.map +0 -1
- package/esm2015/lib/factories/list-pagination/list-pagination.factory.js.map +0 -1
- package/esm2015/lib/factories/list-pagination/list-pagination.factory.metadata.json +0 -1
- package/esm2015/lib/factories/list-pagination/list-pagination.factory.ngfactory.js.map +0 -1
- package/esm2015/lib/models/index.js.map +0 -1
- package/esm2015/lib/models/index.metadata.json +0 -1
- package/esm2015/lib/models/interfaces.js.map +0 -1
- package/esm2015/lib/models/interfaces.metadata.json +0 -1
- package/esm2015/lib/pages/base/base.component.js +0 -54
- package/esm2015/lib/pages/base/base.component.js.map +0 -1
- package/esm2015/lib/pages/base/base.component.metadata.json +0 -1
- package/esm2015/lib/pages/item/item.component.js.map +0 -1
- package/esm2015/lib/pages/item/item.component.metadata.json +0 -1
- package/esm2015/lib/pages/item/item.component.ngfactory.js.map +0 -1
- package/esm2015/lib/pages/item/item.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/pages/list/list.component.js.map +0 -1
- package/esm2015/lib/pages/list/list.component.metadata.json +0 -1
- package/esm2015/lib/pages/list/list.component.ngfactory.js.map +0 -1
- package/esm2015/lib/pages/list/list.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/pipes/form-options/form-options.pipe.js.map +0 -1
- package/esm2015/lib/pipes/form-options/form-options.pipe.metadata.json +0 -1
- package/esm2015/lib/pipes/form-options/form-options.pipe.ngfactory.js.map +0 -1
- package/esm2015/lib/pipes/index.js.map +0 -1
- package/esm2015/lib/pipes/index.metadata.json +0 -1
- package/esm2015/lib/pipes/pipes.module.js.map +0 -1
- package/esm2015/lib/pipes/pipes.module.metadata.json +0 -1
- package/esm2015/lib/pipes/pipes.module.ngfactory.js.map +0 -1
- package/esm2015/lib/providers/model-possibilities/model-possibilities.provider.js.map +0 -1
- package/esm2015/lib/providers/model-possibilities/model-possibilities.provider.metadata.json +0 -1
- package/esm2015/lib/services/crud/crud.service.js.map +0 -1
- package/esm2015/lib/services/crud/crud.service.metadata.json +0 -1
- package/esm2015/lib/services/crud/crud.service.ngfactory.js.map +0 -1
- package/esm2015/lib/services/socket/socket.service.js.map +0 -1
- package/esm2015/lib/services/socket/socket.service.metadata.json +0 -1
- package/esm2015/lib/services/socket/socket.service.ngfactory.js.map +0 -1
- package/esm2015/smartsoft001-crud-shell-angular.js.map +0 -1
- package/esm2015/smartsoft001-crud-shell-angular.metadata.json +0 -1
- package/lib/pages/base/base.component.d.ts +0 -11
- package/lib/pages/base/base.component.d.ts.map +0 -1
- package/lib/pages/item/item.component.scss.shim.ngstyle.d.ts.map +0 -1
- package/lib/pages/list/list.component.scss.shim.ngstyle.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createFeatureSelector, createSelector, select as select$1, Store, ActionsSubject, State, StoreModule } from '@ngrx/store';
|
|
2
|
-
import { Injectable, Component, ElementRef, Input, InjectionToken, Directive, Optional, Inject, ViewChild, ChangeDetectorRef, Pipe, NgModule, Injector, ViewContainerRef, QueryList, ViewChildren } from '@angular/core';
|
|
3
|
-
import { NgrxStoreService, BaseComponent as BaseComponent$1, PopoverService, StyleService, MenuService, AuthService, ListMode, DynamicComponentLoader, HardwareService,
|
|
2
|
+
import { Injectable, Component, ElementRef, Input, InjectionToken, Directive, Optional, Inject, ViewChild, ChangeDetectorRef, Pipe, NgModule, Injector, NgModuleRef, ComponentFactoryResolver, ViewContainerRef, QueryList, ViewChildren } from '@angular/core';
|
|
3
|
+
import { NgrxStoreService, BaseComponent as BaseComponent$1, PopoverService, StyleService, MenuService, SharedModule, AuthService, CreateDynamicComponent, ListMode, DynamicComponentLoader, HardwareService, FormComponent, ToastService, NgrxSharedModule, FILE_SERVICE_CONFIG } from '@smartsoft001/angular';
|
|
4
4
|
import { map, tap, first, catchError } from 'rxjs/operators';
|
|
5
5
|
import { FieldType, getModelOptions, getModelFieldsWithOptions } from '@smartsoft001/models';
|
|
6
6
|
import * as moment from 'moment';
|
|
@@ -9,10 +9,10 @@ import { Debounce } from 'lodash-decorators';
|
|
|
9
9
|
import { IonDatetime, IonContent } from '@ionic/angular';
|
|
10
10
|
import { Subscription, combineLatest, forkJoin, of, BehaviorSubject } from 'rxjs';
|
|
11
11
|
import * as _ from 'lodash';
|
|
12
|
-
import { FormControl, FormGroup, FormArray
|
|
13
|
-
import {
|
|
14
|
-
import 'reflect-metadata';
|
|
12
|
+
import { FormsModule, FormControl, FormGroup, FormArray } from '@angular/forms';
|
|
13
|
+
import { CommonModule, Location } from '@angular/common';
|
|
15
14
|
import { HttpClient } from '@angular/common/http';
|
|
15
|
+
import 'reflect-metadata';
|
|
16
16
|
import { Router, ActivatedRoute, RouterModule } from '@angular/router';
|
|
17
17
|
import { TranslateService } from '@ngx-translate/core';
|
|
18
18
|
|
|
@@ -961,6 +961,74 @@ NotSocketService.decorators = [
|
|
|
961
961
|
{ type: Injectable }
|
|
962
962
|
];
|
|
963
963
|
|
|
964
|
+
class FormOptionsPipe {
|
|
965
|
+
constructor(modelPossibilitiesProvider) {
|
|
966
|
+
this.modelPossibilitiesProvider = modelPossibilitiesProvider;
|
|
967
|
+
}
|
|
968
|
+
transform(item, mode, type, uniqueProvider, inputComponents) {
|
|
969
|
+
if (!mode || !type)
|
|
970
|
+
return null;
|
|
971
|
+
let possibilities = {};
|
|
972
|
+
if (type && this.modelPossibilitiesProvider) {
|
|
973
|
+
possibilities = this.modelPossibilitiesProvider.get(type);
|
|
974
|
+
}
|
|
975
|
+
if (mode === "create") {
|
|
976
|
+
return {
|
|
977
|
+
mode: "create",
|
|
978
|
+
possibilities,
|
|
979
|
+
inputComponents,
|
|
980
|
+
uniqueProvider,
|
|
981
|
+
model: new type(),
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
else {
|
|
985
|
+
const model = new type();
|
|
986
|
+
if (item) {
|
|
987
|
+
Object.keys(item).forEach((key) => {
|
|
988
|
+
model[key] = item[key];
|
|
989
|
+
});
|
|
990
|
+
}
|
|
991
|
+
return {
|
|
992
|
+
mode: mode,
|
|
993
|
+
uniqueProvider,
|
|
994
|
+
possibilities: possibilities,
|
|
995
|
+
inputComponents,
|
|
996
|
+
model: model,
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
1002
|
+
FormOptionsPipe.decorators = [
|
|
1003
|
+
{ type: Pipe, args: [{
|
|
1004
|
+
name: "smartFormOptions",
|
|
1005
|
+
},] }
|
|
1006
|
+
];
|
|
1007
|
+
/**
|
|
1008
|
+
* @type {function(): !Array<(null|{
|
|
1009
|
+
* type: ?,
|
|
1010
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
1011
|
+
* })>}
|
|
1012
|
+
* @nocollapse
|
|
1013
|
+
*/
|
|
1014
|
+
FormOptionsPipe.ctorParameters = () => [
|
|
1015
|
+
{ type: ICrudModelPossibilitiesProvider, decorators: [{ type: Optional }, { type: Inject, args: [CRUD_MODEL_POSSIBILITIES_PROVIDER,] }] }
|
|
1016
|
+
];
|
|
1017
|
+
|
|
1018
|
+
class CrudPipesModule {
|
|
1019
|
+
}
|
|
1020
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
1021
|
+
CrudPipesModule.decorators = [
|
|
1022
|
+
{ type: NgModule, args: [{
|
|
1023
|
+
declarations: [
|
|
1024
|
+
FormOptionsPipe
|
|
1025
|
+
],
|
|
1026
|
+
exports: [
|
|
1027
|
+
FormOptionsPipe
|
|
1028
|
+
]
|
|
1029
|
+
},] }
|
|
1030
|
+
];
|
|
1031
|
+
|
|
964
1032
|
class CrudService {
|
|
965
1033
|
constructor(config, http, socket) {
|
|
966
1034
|
this.config = config;
|
|
@@ -1258,6 +1326,120 @@ CrudEffects.ctorParameters = () => [
|
|
|
1258
1326
|
{ type: State }
|
|
1259
1327
|
];
|
|
1260
1328
|
|
|
1329
|
+
class CrudListPaginationFactory {
|
|
1330
|
+
constructor(facade) {
|
|
1331
|
+
this.facade = facade;
|
|
1332
|
+
}
|
|
1333
|
+
create(options) {
|
|
1334
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1335
|
+
return {
|
|
1336
|
+
limit: options.limit,
|
|
1337
|
+
loadNextPage: () => {
|
|
1338
|
+
if (!options.provider.getLinks() || !options.provider.getLinks().next)
|
|
1339
|
+
return Promise.resolve(false);
|
|
1340
|
+
return new Promise((res) => {
|
|
1341
|
+
const sub = this.facade.loaded$.subscribe((l) => {
|
|
1342
|
+
if (l) {
|
|
1343
|
+
// if (sub && !sub.closed) sub.unsubscribe();
|
|
1344
|
+
setTimeout(() => {
|
|
1345
|
+
res(options.provider.getLinks() &&
|
|
1346
|
+
options.provider.getLinks().next);
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
});
|
|
1350
|
+
this.facade.read(Object.assign(Object.assign({}, options.provider.getFilter()), { offset: options.provider.getFilter().offset +
|
|
1351
|
+
options.provider.getFilter().limit }));
|
|
1352
|
+
});
|
|
1353
|
+
},
|
|
1354
|
+
loadPrevPage: () => {
|
|
1355
|
+
if (!options.provider.getLinks() || !options.provider.getLinks().prev)
|
|
1356
|
+
return Promise.resolve(false);
|
|
1357
|
+
return new Promise((res) => {
|
|
1358
|
+
const sub = this.facade.loaded$.subscribe((l) => {
|
|
1359
|
+
if (l) {
|
|
1360
|
+
// if (sub && !sub.closed) sub.unsubscribe();
|
|
1361
|
+
setTimeout(() => {
|
|
1362
|
+
res(options.provider.getLinks() &&
|
|
1363
|
+
options.provider.getLinks().prev);
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
this.facade.read(Object.assign(Object.assign({}, options.provider.getFilter()), { offset: options.provider.getFilter().offset -
|
|
1368
|
+
options.provider.getFilter().limit }));
|
|
1369
|
+
});
|
|
1370
|
+
},
|
|
1371
|
+
page$: this.facade.filter$.pipe(map((f) => {
|
|
1372
|
+
return (f === null || f === void 0 ? void 0 : f.limit) ? f.offset / f.limit + 1 : 0;
|
|
1373
|
+
})),
|
|
1374
|
+
totalPages$: combineLatest(this.facade.filter$, this.facade.totalCount$).pipe(map(([filter, totalCount]) => {
|
|
1375
|
+
return (filter === null || filter === void 0 ? void 0 : filter.limit) ? Math.ceil(totalCount / filter.limit) : 0;
|
|
1376
|
+
})),
|
|
1377
|
+
};
|
|
1378
|
+
});
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
1382
|
+
CrudListPaginationFactory.decorators = [
|
|
1383
|
+
{ type: Injectable }
|
|
1384
|
+
];
|
|
1385
|
+
/**
|
|
1386
|
+
* @type {function(): !Array<(null|{
|
|
1387
|
+
* type: ?,
|
|
1388
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
1389
|
+
* })>}
|
|
1390
|
+
* @nocollapse
|
|
1391
|
+
*/
|
|
1392
|
+
CrudListPaginationFactory.ctorParameters = () => [
|
|
1393
|
+
{ type: CrudFacade }
|
|
1394
|
+
];
|
|
1395
|
+
|
|
1396
|
+
const COMPONENTS = [
|
|
1397
|
+
ExportComponent,
|
|
1398
|
+
FilterComponent,
|
|
1399
|
+
FilterTextComponent,
|
|
1400
|
+
FiltersConfigComponent,
|
|
1401
|
+
FilterDateComponent,
|
|
1402
|
+
FilterDateWithEditComponent,
|
|
1403
|
+
FilterRadioComponent,
|
|
1404
|
+
FiltersComponent,
|
|
1405
|
+
FilterFlagComponent,
|
|
1406
|
+
FilterCheckComponent,
|
|
1407
|
+
MultiselectComponent,
|
|
1408
|
+
GroupComponent
|
|
1409
|
+
];
|
|
1410
|
+
class CrudComponentsModule {
|
|
1411
|
+
}
|
|
1412
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
1413
|
+
CrudComponentsModule.decorators = [
|
|
1414
|
+
{ type: NgModule, args: [{
|
|
1415
|
+
declarations: [
|
|
1416
|
+
...COMPONENTS
|
|
1417
|
+
],
|
|
1418
|
+
entryComponents: [
|
|
1419
|
+
...COMPONENTS
|
|
1420
|
+
],
|
|
1421
|
+
imports: [
|
|
1422
|
+
//AuthSharedModule,
|
|
1423
|
+
StoreModule,
|
|
1424
|
+
SharedModule,
|
|
1425
|
+
CrudPipesModule,
|
|
1426
|
+
FormsModule,
|
|
1427
|
+
CommonModule
|
|
1428
|
+
],
|
|
1429
|
+
exports: [
|
|
1430
|
+
CrudPipesModule,
|
|
1431
|
+
...COMPONENTS
|
|
1432
|
+
],
|
|
1433
|
+
providers: [
|
|
1434
|
+
CrudService,
|
|
1435
|
+
CrudEffects,
|
|
1436
|
+
CrudFacade,
|
|
1437
|
+
SocketService,
|
|
1438
|
+
CrudListPaginationFactory,
|
|
1439
|
+
],
|
|
1440
|
+
},] }
|
|
1441
|
+
];
|
|
1442
|
+
|
|
1261
1443
|
const initialState = {
|
|
1262
1444
|
loaded: false
|
|
1263
1445
|
};
|
|
@@ -1345,86 +1527,13 @@ function getReducer(entity) {
|
|
|
1345
1527
|
};
|
|
1346
1528
|
}
|
|
1347
1529
|
|
|
1348
|
-
class
|
|
1349
|
-
constructor(modelPossibilitiesProvider) {
|
|
1350
|
-
this.modelPossibilitiesProvider = modelPossibilitiesProvider;
|
|
1351
|
-
}
|
|
1352
|
-
transform(item, mode, type, uniqueProvider, inputComponents) {
|
|
1353
|
-
if (!mode || !type)
|
|
1354
|
-
return null;
|
|
1355
|
-
let possibilities = {};
|
|
1356
|
-
if (type && this.modelPossibilitiesProvider) {
|
|
1357
|
-
possibilities = this.modelPossibilitiesProvider.get(type);
|
|
1358
|
-
}
|
|
1359
|
-
if (mode === "create") {
|
|
1360
|
-
return {
|
|
1361
|
-
mode: "create",
|
|
1362
|
-
possibilities,
|
|
1363
|
-
inputComponents,
|
|
1364
|
-
uniqueProvider,
|
|
1365
|
-
model: new type(),
|
|
1366
|
-
};
|
|
1367
|
-
}
|
|
1368
|
-
else {
|
|
1369
|
-
const model = new type();
|
|
1370
|
-
if (item) {
|
|
1371
|
-
Object.keys(item).forEach((key) => {
|
|
1372
|
-
model[key] = item[key];
|
|
1373
|
-
});
|
|
1374
|
-
}
|
|
1375
|
-
return {
|
|
1376
|
-
mode: mode,
|
|
1377
|
-
uniqueProvider,
|
|
1378
|
-
possibilities: possibilities,
|
|
1379
|
-
inputComponents,
|
|
1380
|
-
model: model,
|
|
1381
|
-
};
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
1386
|
-
FormOptionsPipe.decorators = [
|
|
1387
|
-
{ type: Pipe, args: [{
|
|
1388
|
-
name: "smartFormOptions",
|
|
1389
|
-
},] }
|
|
1390
|
-
];
|
|
1391
|
-
/**
|
|
1392
|
-
* @type {function(): !Array<(null|{
|
|
1393
|
-
* type: ?,
|
|
1394
|
-
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
1395
|
-
* })>}
|
|
1396
|
-
* @nocollapse
|
|
1397
|
-
*/
|
|
1398
|
-
FormOptionsPipe.ctorParameters = () => [
|
|
1399
|
-
{ type: ICrudModelPossibilitiesProvider, decorators: [{ type: Optional }, { type: Inject, args: [CRUD_MODEL_POSSIBILITIES_PROVIDER,] }] }
|
|
1400
|
-
];
|
|
1401
|
-
|
|
1402
|
-
class CrudPipesModule {
|
|
1403
|
-
}
|
|
1404
|
-
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
1405
|
-
CrudPipesModule.decorators = [
|
|
1406
|
-
{ type: NgModule, args: [{
|
|
1407
|
-
declarations: [
|
|
1408
|
-
FormOptionsPipe
|
|
1409
|
-
],
|
|
1410
|
-
exports: [
|
|
1411
|
-
FormOptionsPipe
|
|
1412
|
-
]
|
|
1413
|
-
},] }
|
|
1414
|
-
];
|
|
1415
|
-
|
|
1416
|
-
class PageBaseComponent extends BaseComponent$1 {
|
|
1530
|
+
class PageService {
|
|
1417
1531
|
constructor(authService, config) {
|
|
1418
|
-
super();
|
|
1419
1532
|
this.authService = authService;
|
|
1420
1533
|
this.config = config;
|
|
1421
1534
|
}
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
this.checkPermissions(this.config);
|
|
1425
|
-
});
|
|
1426
|
-
}
|
|
1427
|
-
checkPermissions(val) {
|
|
1535
|
+
checkPermissions() {
|
|
1536
|
+
const val = this.config;
|
|
1428
1537
|
const modelOptions = getModelOptions(val.type);
|
|
1429
1538
|
if (val.add &&
|
|
1430
1539
|
modelOptions.create &&
|
|
@@ -1447,8 +1556,8 @@ class PageBaseComponent extends BaseComponent$1 {
|
|
|
1447
1556
|
}
|
|
1448
1557
|
}
|
|
1449
1558
|
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
1450
|
-
|
|
1451
|
-
{ type:
|
|
1559
|
+
PageService.decorators = [
|
|
1560
|
+
{ type: Injectable }
|
|
1452
1561
|
];
|
|
1453
1562
|
/**
|
|
1454
1563
|
* @type {function(): !Array<(null|{
|
|
@@ -1457,81 +1566,14 @@ PageBaseComponent.decorators = [
|
|
|
1457
1566
|
* })>}
|
|
1458
1567
|
* @nocollapse
|
|
1459
1568
|
*/
|
|
1460
|
-
|
|
1569
|
+
PageService.ctorParameters = () => [
|
|
1461
1570
|
{ type: AuthService },
|
|
1462
1571
|
{ type: CrudFullConfig }
|
|
1463
1572
|
];
|
|
1464
1573
|
|
|
1465
|
-
class
|
|
1466
|
-
constructor(facade) {
|
|
1467
|
-
|
|
1468
|
-
}
|
|
1469
|
-
create(options) {
|
|
1470
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1471
|
-
return {
|
|
1472
|
-
limit: options.limit,
|
|
1473
|
-
loadNextPage: () => {
|
|
1474
|
-
if (!options.provider.getLinks() || !options.provider.getLinks().next)
|
|
1475
|
-
return Promise.resolve(false);
|
|
1476
|
-
return new Promise((res) => {
|
|
1477
|
-
const sub = this.facade.loaded$.subscribe((l) => {
|
|
1478
|
-
if (l) {
|
|
1479
|
-
// if (sub && !sub.closed) sub.unsubscribe();
|
|
1480
|
-
setTimeout(() => {
|
|
1481
|
-
res(options.provider.getLinks() &&
|
|
1482
|
-
options.provider.getLinks().next);
|
|
1483
|
-
});
|
|
1484
|
-
}
|
|
1485
|
-
});
|
|
1486
|
-
this.facade.read(Object.assign(Object.assign({}, options.provider.getFilter()), { offset: options.provider.getFilter().offset +
|
|
1487
|
-
options.provider.getFilter().limit }));
|
|
1488
|
-
});
|
|
1489
|
-
},
|
|
1490
|
-
loadPrevPage: () => {
|
|
1491
|
-
if (!options.provider.getLinks() || !options.provider.getLinks().prev)
|
|
1492
|
-
return Promise.resolve(false);
|
|
1493
|
-
return new Promise((res) => {
|
|
1494
|
-
const sub = this.facade.loaded$.subscribe((l) => {
|
|
1495
|
-
if (l) {
|
|
1496
|
-
// if (sub && !sub.closed) sub.unsubscribe();
|
|
1497
|
-
setTimeout(() => {
|
|
1498
|
-
res(options.provider.getLinks() &&
|
|
1499
|
-
options.provider.getLinks().prev);
|
|
1500
|
-
});
|
|
1501
|
-
}
|
|
1502
|
-
});
|
|
1503
|
-
this.facade.read(Object.assign(Object.assign({}, options.provider.getFilter()), { offset: options.provider.getFilter().offset -
|
|
1504
|
-
options.provider.getFilter().limit }));
|
|
1505
|
-
});
|
|
1506
|
-
},
|
|
1507
|
-
page$: this.facade.filter$.pipe(map((f) => {
|
|
1508
|
-
return (f === null || f === void 0 ? void 0 : f.limit) ? f.offset / f.limit + 1 : 0;
|
|
1509
|
-
})),
|
|
1510
|
-
totalPages$: combineLatest(this.facade.filter$, this.facade.totalCount$).pipe(map(([filter, totalCount]) => {
|
|
1511
|
-
return (filter === null || filter === void 0 ? void 0 : filter.limit) ? Math.ceil(totalCount / filter.limit) : 0;
|
|
1512
|
-
})),
|
|
1513
|
-
};
|
|
1514
|
-
});
|
|
1515
|
-
}
|
|
1516
|
-
}
|
|
1517
|
-
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
1518
|
-
CrudListPaginationFactory.decorators = [
|
|
1519
|
-
{ type: Injectable }
|
|
1520
|
-
];
|
|
1521
|
-
/**
|
|
1522
|
-
* @type {function(): !Array<(null|{
|
|
1523
|
-
* type: ?,
|
|
1524
|
-
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
1525
|
-
* })>}
|
|
1526
|
-
* @nocollapse
|
|
1527
|
-
*/
|
|
1528
|
-
CrudListPaginationFactory.ctorParameters = () => [
|
|
1529
|
-
{ type: CrudFacade }
|
|
1530
|
-
];
|
|
1531
|
-
|
|
1532
|
-
class ListComponent extends PageBaseComponent {
|
|
1533
|
-
constructor(facade, router, dynamicComponentLoader, injector, cd, menuService, hardwareService, paginationFacade, styleService, elementRef, config, authService) {
|
|
1534
|
-
super(authService, config);
|
|
1574
|
+
class ListComponent extends CreateDynamicComponent('crud-list-page') {
|
|
1575
|
+
constructor(facade, router, dynamicComponentLoader, injector, cd, menuService, hardwareService, paginationFacade, styleService, elementRef, pageService, config, moduleRef, componentFactoryResolver) {
|
|
1576
|
+
super(cd, moduleRef, componentFactoryResolver);
|
|
1535
1577
|
this.facade = facade;
|
|
1536
1578
|
this.router = router;
|
|
1537
1579
|
this.dynamicComponentLoader = dynamicComponentLoader;
|
|
@@ -1542,7 +1584,10 @@ class ListComponent extends PageBaseComponent {
|
|
|
1542
1584
|
this.paginationFacade = paginationFacade;
|
|
1543
1585
|
this.styleService = styleService;
|
|
1544
1586
|
this.elementRef = elementRef;
|
|
1587
|
+
this.pageService = pageService;
|
|
1545
1588
|
this.config = config;
|
|
1589
|
+
this.moduleRef = moduleRef;
|
|
1590
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
1546
1591
|
this.filter$ = this.facade.filter$.pipe(tap((filter) => {
|
|
1547
1592
|
this.filter = filter;
|
|
1548
1593
|
}));
|
|
@@ -1550,13 +1595,13 @@ class ListComponent extends PageBaseComponent {
|
|
|
1550
1595
|
this.links = links;
|
|
1551
1596
|
});
|
|
1552
1597
|
}
|
|
1598
|
+
refreshProperties() {
|
|
1599
|
+
this.baseInstance.listOptions = this.listOptions;
|
|
1600
|
+
}
|
|
1553
1601
|
ngOnInit() {
|
|
1554
|
-
const _super = Object.create(null, {
|
|
1555
|
-
ngOnInit: { get: () => super.ngOnInit }
|
|
1556
|
-
});
|
|
1557
1602
|
var _a;
|
|
1558
1603
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1559
|
-
yield
|
|
1604
|
+
yield this.pageService.checkPermissions();
|
|
1560
1605
|
this.facade.read({
|
|
1561
1606
|
limit: this.config.pagination ? this.config.pagination.limit : null,
|
|
1562
1607
|
offset: this.config.pagination ? 0 : null,
|
|
@@ -1674,6 +1719,7 @@ class ListComponent extends PageBaseComponent {
|
|
|
1674
1719
|
this.cd.detectChanges();
|
|
1675
1720
|
this.initCloseMenu();
|
|
1676
1721
|
this.initTopComponent(compiledComponents);
|
|
1722
|
+
this.refreshDynamicInstance();
|
|
1677
1723
|
});
|
|
1678
1724
|
}
|
|
1679
1725
|
initCloseMenu() {
|
|
@@ -1771,8 +1817,18 @@ class ListComponent extends PageBaseComponent {
|
|
|
1771
1817
|
ListComponent.decorators = [
|
|
1772
1818
|
{ type: Component, args: [{
|
|
1773
1819
|
selector: "smart-crud-list-page",
|
|
1774
|
-
template:
|
|
1775
|
-
|
|
1820
|
+
template: `
|
|
1821
|
+
<smart-page [options]="pageOptions" *ngIf="filter$ | async">
|
|
1822
|
+
<div #topTpl></div>
|
|
1823
|
+
<smart-crud-list-standard-page *ngIf="template === 'default'" [listOptions]="listOptions">
|
|
1824
|
+
<ng-container [ngTemplateOutlet]="contentTpl"></ng-container>
|
|
1825
|
+
</smart-crud-list-standard-page>
|
|
1826
|
+
<ng-template #contentTpl>
|
|
1827
|
+
<ng-content></ng-content>
|
|
1828
|
+
</ng-template>
|
|
1829
|
+
<div #customTpl></div>
|
|
1830
|
+
</smart-page>
|
|
1831
|
+
`
|
|
1776
1832
|
},] }
|
|
1777
1833
|
];
|
|
1778
1834
|
/**
|
|
@@ -1793,17 +1849,67 @@ ListComponent.ctorParameters = () => [
|
|
|
1793
1849
|
{ type: CrudListPaginationFactory },
|
|
1794
1850
|
{ type: StyleService },
|
|
1795
1851
|
{ type: ElementRef },
|
|
1852
|
+
{ type: PageService },
|
|
1796
1853
|
{ type: CrudFullConfig },
|
|
1797
|
-
{ type:
|
|
1854
|
+
{ type: NgModuleRef },
|
|
1855
|
+
{ type: ComponentFactoryResolver }
|
|
1798
1856
|
];
|
|
1799
1857
|
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
1800
1858
|
ListComponent.propDecorators = {
|
|
1801
1859
|
topTpl: [{ type: ViewChild, args: ["topTpl", { read: ViewContainerRef, static: false },] }]
|
|
1802
1860
|
};
|
|
1803
1861
|
|
|
1804
|
-
class
|
|
1805
|
-
constructor(
|
|
1806
|
-
super(
|
|
1862
|
+
class CrudItemPageBaseComponent extends BaseComponent$1 {
|
|
1863
|
+
constructor(config, facade) {
|
|
1864
|
+
super();
|
|
1865
|
+
this.config = config;
|
|
1866
|
+
this.facade = facade;
|
|
1867
|
+
this.formComponents = new QueryList();
|
|
1868
|
+
this.selected$ = facade.selected$;
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
CrudItemPageBaseComponent.smartType = "crud-item-page";
|
|
1872
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
1873
|
+
CrudItemPageBaseComponent.decorators = [
|
|
1874
|
+
{ type: Directive }
|
|
1875
|
+
];
|
|
1876
|
+
/**
|
|
1877
|
+
* @type {function(): !Array<(null|{
|
|
1878
|
+
* type: ?,
|
|
1879
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
1880
|
+
* })>}
|
|
1881
|
+
* @nocollapse
|
|
1882
|
+
*/
|
|
1883
|
+
CrudItemPageBaseComponent.ctorParameters = () => [
|
|
1884
|
+
{ type: CrudFullConfig },
|
|
1885
|
+
{ type: CrudFacade }
|
|
1886
|
+
];
|
|
1887
|
+
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
1888
|
+
CrudItemPageBaseComponent.propDecorators = {
|
|
1889
|
+
contentTpl: [{ type: ViewChild, args: ["contentTpl", { read: ViewContainerRef, static: true },] }],
|
|
1890
|
+
formComponents: [{ type: ViewChildren, args: [FormComponent, { read: FormComponent },] }],
|
|
1891
|
+
detailsOptions: [{ type: Input }],
|
|
1892
|
+
mode: [{ type: Input }],
|
|
1893
|
+
uniqueProvider: [{ type: Input }],
|
|
1894
|
+
onPartialChange: [{ type: Input }],
|
|
1895
|
+
onChange: [{ type: Input }],
|
|
1896
|
+
onValidChange: [{ type: Input }]
|
|
1897
|
+
};
|
|
1898
|
+
|
|
1899
|
+
class ItemStandardComponent extends CrudItemPageBaseComponent {
|
|
1900
|
+
}
|
|
1901
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
1902
|
+
ItemStandardComponent.decorators = [
|
|
1903
|
+
{ type: Component, args: [{
|
|
1904
|
+
selector: "smart-crud-item-standard-page",
|
|
1905
|
+
template: "<ng-container *ngIf=\"mode === 'details'; else editTpl\">\n <smart-details *ngIf=\"detailsOptions\" [options]='detailsOptions'></smart-details>\n</ng-container>\n\n<ng-template #editTpl>\n <smart-form\n [options]=\"\n (selected$ | async)\n | smartFormOptions : mode:config?.type:uniqueProvider : config.inputComponents\n \"\n (valuePartialChange)=\"onPartialChange($event)\"\n (valueChange)=\"onChange($event)\"\n (validChange)=\"onValidChange($event)\"\n ></smart-form>\n</ng-template>\n\n<br/><br/>",
|
|
1906
|
+
styles: [""]
|
|
1907
|
+
},] }
|
|
1908
|
+
];
|
|
1909
|
+
|
|
1910
|
+
class ItemComponent extends CreateDynamicComponent('crud-item-page') {
|
|
1911
|
+
constructor(router, activeRoute, facade, service, route, dynamicComponentLoader, translateService, config, location, cd, authService, styleService, elementRef, toastService, pageService, moduleRef, componentFactoryResolver) {
|
|
1912
|
+
super(cd, moduleRef, componentFactoryResolver);
|
|
1807
1913
|
this.router = router;
|
|
1808
1914
|
this.activeRoute = activeRoute;
|
|
1809
1915
|
this.facade = facade;
|
|
@@ -1817,22 +1923,37 @@ class ItemComponent extends PageBaseComponent {
|
|
|
1817
1923
|
this.styleService = styleService;
|
|
1818
1924
|
this.elementRef = elementRef;
|
|
1819
1925
|
this.toastService = toastService;
|
|
1926
|
+
this.pageService = pageService;
|
|
1927
|
+
this.moduleRef = moduleRef;
|
|
1928
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
1820
1929
|
this.pageOptions = {
|
|
1821
1930
|
title: "",
|
|
1822
1931
|
showBackButton: true,
|
|
1823
1932
|
hideMenuButton: true,
|
|
1824
1933
|
};
|
|
1825
1934
|
this.formValid = false;
|
|
1826
|
-
this.
|
|
1935
|
+
this.standardComponents = new QueryList();
|
|
1827
1936
|
this.selected$ = this.facade.selected$;
|
|
1828
1937
|
}
|
|
1938
|
+
set mode(val) {
|
|
1939
|
+
this._mode = val;
|
|
1940
|
+
this.refreshDynamicInstance();
|
|
1941
|
+
}
|
|
1942
|
+
get mode() {
|
|
1943
|
+
return this._mode;
|
|
1944
|
+
}
|
|
1945
|
+
refreshProperties() {
|
|
1946
|
+
this.baseInstance.detailsOptions = this.detailsOptions;
|
|
1947
|
+
this.baseInstance.mode = this.mode;
|
|
1948
|
+
this.baseInstance.uniqueProvider = this.uniqueProvider;
|
|
1949
|
+
this.baseInstance.onPartialChange = this.onPartialChange;
|
|
1950
|
+
this.baseInstance.onChange = this.onChange;
|
|
1951
|
+
this.baseInstance.onValidChange = this.onValidChange;
|
|
1952
|
+
}
|
|
1829
1953
|
ngOnInit() {
|
|
1830
|
-
const _super = Object.create(null, {
|
|
1831
|
-
ngOnInit: { get: () => super.ngOnInit }
|
|
1832
|
-
});
|
|
1833
1954
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1834
1955
|
this.styleService.init(this.elementRef);
|
|
1835
|
-
|
|
1956
|
+
this.pageService.checkPermissions();
|
|
1836
1957
|
if (this.router.routerState.snapshot.url.endsWith("/add")) {
|
|
1837
1958
|
this.mode = "create";
|
|
1838
1959
|
}
|
|
@@ -1905,6 +2026,7 @@ class ItemComponent extends PageBaseComponent {
|
|
|
1905
2026
|
this.initPageOptions();
|
|
1906
2027
|
this.cd.detectChanges();
|
|
1907
2028
|
});
|
|
2029
|
+
this.refreshDynamicInstance();
|
|
1908
2030
|
});
|
|
1909
2031
|
}
|
|
1910
2032
|
onPartialChange(val) {
|
|
@@ -2006,7 +2128,9 @@ class ItemComponent extends PageBaseComponent {
|
|
|
2006
2128
|
return item.innerHTML;
|
|
2007
2129
|
}
|
|
2008
2130
|
checkFirstInvalid() {
|
|
2009
|
-
const form = this.
|
|
2131
|
+
const form = this.template === 'default'
|
|
2132
|
+
? this.standardComponents.first.formComponents.first.form
|
|
2133
|
+
: this.baseInstance.formComponents.first.form;
|
|
2010
2134
|
if (form.valid)
|
|
2011
2135
|
return false;
|
|
2012
2136
|
const invalidFields = [];
|
|
@@ -2040,8 +2164,25 @@ class ItemComponent extends PageBaseComponent {
|
|
|
2040
2164
|
ItemComponent.decorators = [
|
|
2041
2165
|
{ type: Component, args: [{
|
|
2042
2166
|
selector: "smart-crud-item-page",
|
|
2043
|
-
template:
|
|
2044
|
-
|
|
2167
|
+
template: `
|
|
2168
|
+
<smart-page [options]="pageOptions">
|
|
2169
|
+
<div #topTpl></div>
|
|
2170
|
+
<smart-crud-item-standard-page *ngIf="template === 'default'"
|
|
2171
|
+
[detailsOptions]="detailsOptions"
|
|
2172
|
+
[mode]="mode"
|
|
2173
|
+
[uniqueProvider]="uniqueProvider"
|
|
2174
|
+
[onPartialChange]="onPartialChange"
|
|
2175
|
+
[onChange]="onPartialChange"
|
|
2176
|
+
[onValidChange]="onValidChange"
|
|
2177
|
+
>
|
|
2178
|
+
<ng-container [ngTemplateOutlet]="contentTpl"></ng-container>
|
|
2179
|
+
</smart-crud-item-standard-page>
|
|
2180
|
+
<ng-template #contentTpl>
|
|
2181
|
+
<ng-content></ng-content>
|
|
2182
|
+
</ng-template>
|
|
2183
|
+
<div #customTpl></div>
|
|
2184
|
+
</smart-page>
|
|
2185
|
+
`
|
|
2045
2186
|
},] }
|
|
2046
2187
|
];
|
|
2047
2188
|
/**
|
|
@@ -2065,64 +2206,60 @@ ItemComponent.ctorParameters = () => [
|
|
|
2065
2206
|
{ type: AuthService },
|
|
2066
2207
|
{ type: StyleService },
|
|
2067
2208
|
{ type: ElementRef },
|
|
2068
|
-
{ type: ToastService }
|
|
2209
|
+
{ type: ToastService },
|
|
2210
|
+
{ type: PageService },
|
|
2211
|
+
{ type: NgModuleRef },
|
|
2212
|
+
{ type: ComponentFactoryResolver }
|
|
2069
2213
|
];
|
|
2070
2214
|
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
2071
2215
|
ItemComponent.propDecorators = {
|
|
2072
|
-
|
|
2216
|
+
standardComponents: [{ type: ViewChildren, args: [ItemStandardComponent, { read: ItemStandardComponent },] }],
|
|
2073
2217
|
content: [{ type: ViewChild, args: [IonContent, { static: true },] }]
|
|
2074
2218
|
};
|
|
2075
2219
|
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
FilterCheckComponent,
|
|
2087
|
-
MultiselectComponent,
|
|
2088
|
-
GroupComponent
|
|
2220
|
+
class CrudListPageBaseComponent extends BaseComponent$1 {
|
|
2221
|
+
constructor(config) {
|
|
2222
|
+
super();
|
|
2223
|
+
this.config = config;
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
CrudListPageBaseComponent.smartType = "crud-list-page";
|
|
2227
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
2228
|
+
CrudListPageBaseComponent.decorators = [
|
|
2229
|
+
{ type: Directive }
|
|
2089
2230
|
];
|
|
2090
|
-
|
|
2231
|
+
/**
|
|
2232
|
+
* @type {function(): !Array<(null|{
|
|
2233
|
+
* type: ?,
|
|
2234
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
2235
|
+
* })>}
|
|
2236
|
+
* @nocollapse
|
|
2237
|
+
*/
|
|
2238
|
+
CrudListPageBaseComponent.ctorParameters = () => [
|
|
2239
|
+
{ type: CrudFullConfig }
|
|
2240
|
+
];
|
|
2241
|
+
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
2242
|
+
CrudListPageBaseComponent.propDecorators = {
|
|
2243
|
+
contentTpl: [{ type: ViewChild, args: ["contentTpl", { read: ViewContainerRef, static: true },] }],
|
|
2244
|
+
listOptions: [{ type: Input }]
|
|
2245
|
+
};
|
|
2246
|
+
|
|
2247
|
+
class ListStandardComponent extends CrudListPageBaseComponent {
|
|
2091
2248
|
}
|
|
2092
2249
|
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
2093
|
-
|
|
2094
|
-
{ type:
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
]
|
|
2098
|
-
entryComponents: [
|
|
2099
|
-
...COMPONENTS
|
|
2100
|
-
],
|
|
2101
|
-
imports: [
|
|
2102
|
-
//AuthSharedModule,
|
|
2103
|
-
StoreModule,
|
|
2104
|
-
SharedModule,
|
|
2105
|
-
CrudPipesModule,
|
|
2106
|
-
FormsModule,
|
|
2107
|
-
CommonModule
|
|
2108
|
-
],
|
|
2109
|
-
exports: [
|
|
2110
|
-
CrudPipesModule,
|
|
2111
|
-
...COMPONENTS
|
|
2112
|
-
],
|
|
2113
|
-
providers: [
|
|
2114
|
-
CrudService,
|
|
2115
|
-
CrudEffects,
|
|
2116
|
-
CrudFacade,
|
|
2117
|
-
SocketService,
|
|
2118
|
-
CrudListPaginationFactory,
|
|
2119
|
-
],
|
|
2250
|
+
ListStandardComponent.decorators = [
|
|
2251
|
+
{ type: Component, args: [{
|
|
2252
|
+
selector: "smart-crud-list-standard-page",
|
|
2253
|
+
template: "<smart-crud-filters-config></smart-crud-filters-config>\n<smart-list *ngIf=\"listOptions\" [hidden]=\"config.list?.groups\" [options]=\"listOptions\"></smart-list>\n<smart-crud-group *ngIf=\"config.list?.groups\" [groups]=\"config.list?.groups\" [listOptions]=\"listOptions\">\n</smart-crud-group>",
|
|
2254
|
+
styles: [""]
|
|
2120
2255
|
},] }
|
|
2121
2256
|
];
|
|
2122
2257
|
|
|
2123
2258
|
const PAGES = [
|
|
2124
2259
|
ItemComponent,
|
|
2125
|
-
ListComponent
|
|
2260
|
+
ListComponent,
|
|
2261
|
+
ListStandardComponent,
|
|
2262
|
+
ItemStandardComponent
|
|
2126
2263
|
];
|
|
2127
2264
|
class CrudFullModule {
|
|
2128
2265
|
constructor(store, config, effects) {
|
|
@@ -2155,10 +2292,12 @@ CrudFullModule.decorators = [
|
|
|
2155
2292
|
CrudComponentsModule
|
|
2156
2293
|
],
|
|
2157
2294
|
exports: [
|
|
2158
|
-
...PAGES
|
|
2295
|
+
...PAGES,
|
|
2296
|
+
CrudComponentsModule
|
|
2159
2297
|
],
|
|
2160
2298
|
providers: [
|
|
2161
2299
|
CrudService,
|
|
2300
|
+
PageService,
|
|
2162
2301
|
CrudEffects,
|
|
2163
2302
|
CrudFacade,
|
|
2164
2303
|
CrudListPaginationFactory,
|
|
@@ -2202,6 +2341,7 @@ CrudCoreModule.decorators = [
|
|
|
2202
2341
|
exports: [CrudComponentsModule],
|
|
2203
2342
|
providers: [
|
|
2204
2343
|
CrudService,
|
|
2344
|
+
PageService,
|
|
2205
2345
|
CrudEffects,
|
|
2206
2346
|
CrudFacade,
|
|
2207
2347
|
SocketService,
|
|
@@ -2247,5 +2387,5 @@ CrudModule.decorators = [
|
|
|
2247
2387
|
* Generated bundle index. Do not edit.
|
|
2248
2388
|
*/
|
|
2249
2389
|
|
|
2250
|
-
export { CRUD_MODEL_POSSIBILITIES_PROVIDER, CrudConfig, CrudCoreModule, CrudEffects, CrudFacade, CrudFullConfig, CrudListPaginationFactory, CrudModule, CrudPipesModule, CrudService, ExportComponent, FilterCheckComponent, FilterComponent, FilterDateComponent, FilterDateWithEditComponent, FilterFlagComponent, FilterRadioComponent, FilterTextComponent, FiltersComponent, FiltersConfigComponent, FormOptionsPipe, GroupComponent, ICrudModelPossibilitiesProvider, MultiselectComponent, create, createFailure, createMany, createManyFailure, createManySuccess, createSuccess, deleteFailure, deleteItem, deleteSuccess, exportList, exportListFailure, exportListSuccess, getCrudError, getCrudFilter, getCrudLinks, getCrudList, getCrudLoaded, getCrudMultiSelected, getCrudSelected, getCrudState, getCrudTotalCount, getReducer, initialState, multiSelect, read, readFailure, readSuccess, select, selectFailure, selectSuccess, unselect, update, updateFailure, updatePartial, updatePartialFailure, updatePartialMany, updatePartialManyFailure, updatePartialManySuccess, updatePartialSuccess, updateSuccess, ɵ0, CrudPipesModule as ɵa, FormOptionsPipe as ɵb, CrudComponentsModule as ɵc, ExportComponent as ɵd, FilterComponent as ɵe, FilterTextComponent as ɵf, FiltersConfigComponent as ɵg, FilterDateComponent as ɵh, FilterDateWithEditComponent as ɵi, FilterRadioComponent as ɵj, FiltersComponent as ɵk, FilterFlagComponent as ɵl, FilterCheckComponent as ɵm, MultiselectComponent as ɵn, GroupComponent as ɵo, SocketService as ɵp, NotSocketService as ɵq, CrudFullModule as ɵr, ItemComponent as ɵs,
|
|
2390
|
+
export { CRUD_MODEL_POSSIBILITIES_PROVIDER, CrudComponentsModule, CrudConfig, CrudCoreModule, CrudEffects, CrudFacade, CrudFullConfig, CrudItemPageBaseComponent, CrudListPageBaseComponent, CrudListPaginationFactory, CrudModule, CrudPipesModule, CrudService, ExportComponent, FilterCheckComponent, FilterComponent, FilterDateComponent, FilterDateWithEditComponent, FilterFlagComponent, FilterRadioComponent, FilterTextComponent, FiltersComponent, FiltersConfigComponent, FormOptionsPipe, GroupComponent, ICrudModelPossibilitiesProvider, MultiselectComponent, PageService, create, createFailure, createMany, createManyFailure, createManySuccess, createSuccess, deleteFailure, deleteItem, deleteSuccess, exportList, exportListFailure, exportListSuccess, getCrudError, getCrudFilter, getCrudLinks, getCrudList, getCrudLoaded, getCrudMultiSelected, getCrudSelected, getCrudState, getCrudTotalCount, getReducer, initialState, multiSelect, read, readFailure, readSuccess, select, selectFailure, selectSuccess, unselect, update, updateFailure, updatePartial, updatePartialFailure, updatePartialMany, updatePartialManyFailure, updatePartialManySuccess, updatePartialSuccess, updateSuccess, ɵ0, CrudPipesModule as ɵa, FormOptionsPipe as ɵb, CrudComponentsModule as ɵc, ExportComponent as ɵd, FilterComponent as ɵe, FilterTextComponent as ɵf, FiltersConfigComponent as ɵg, FilterDateComponent as ɵh, FilterDateWithEditComponent as ɵi, FilterRadioComponent as ɵj, FiltersComponent as ɵk, FilterFlagComponent as ɵl, FilterCheckComponent as ɵm, MultiselectComponent as ɵn, GroupComponent as ɵo, SocketService as ɵp, NotSocketService as ɵq, CrudFullModule as ɵr, ItemComponent as ɵs, ItemStandardComponent as ɵt, CrudItemPageBaseComponent as ɵu, ListComponent as ɵv, ListStandardComponent as ɵw, CrudListPageBaseComponent as ɵx };
|
|
2251
2391
|
//# sourceMappingURL=smartsoft001-crud-shell-angular.js.map
|