@elderbyte/ngx-starter 12.12.1 → 12.13.1
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/elderbyte-ngx-starter.umd.js +364 -107
- package/bundles/elderbyte-ngx-starter.umd.js.map +1 -1
- package/elderbyte-ngx-starter.d.ts +7 -6
- package/elderbyte-ngx-starter.metadata.json +1 -1
- package/esm2015/elderbyte-ngx-starter.js +8 -7
- package/esm2015/lib/common/data/data-context/data-context-active-page.js +1 -1
- package/esm2015/lib/common/data/data-context/data-context-auto-starter.js +74 -0
- package/esm2015/lib/common/data/data-context/data-context-base.js +10 -2
- package/esm2015/lib/common/data/data-context/data-context-builder.js +32 -5
- package/esm2015/lib/common/data/data-context/data-context-continuable-base.js +1 -1
- package/esm2015/lib/common/data/data-context/data-context-continuable-paged.js +1 -1
- package/esm2015/lib/common/data/data-context/data-context-continuable-token.js +2 -2
- package/esm2015/lib/common/data/data-context/data-context-life-cycle-binding.js +30 -0
- package/esm2015/lib/common/data/data-context/data-context-simple.js +1 -1
- package/esm2015/lib/common/data/data-context/data-context-source-auto-reloader.js +12 -0
- package/esm2015/lib/common/data/data-context/data-context.js +1 -1
- package/esm2015/lib/common/data/data-context/public_api.js +4 -2
- package/esm2015/lib/common/data/required-filter-evaluator.js +70 -0
- package/esm2015/lib/components/auditing/audited-entity/elder-audited-entity.component.js +2 -2
- package/esm2015/lib/components/data-view/base/elder-data-view-base.js +46 -3
- package/esm2015/lib/components/data-view/common/data-context-state-indicator/data-context-state-indicator.component.js +45 -0
- package/esm2015/lib/components/data-view/common/elder-data-common.module.js +6 -3
- package/esm2015/lib/components/data-view/grid/elder-grid/elder-grid.component.js +3 -22
- package/esm2015/lib/components/data-view/table/elder-table/elder-table.component.js +5 -48
- package/esm2015/lib/components/files/blob-viewer/elder-blob-viewer.component.js +4 -3
- package/fesm2015/elderbyte-ngx-starter.js +305 -84
- package/fesm2015/elderbyte-ngx-starter.js.map +1 -1
- package/lib/common/data/data-context/data-context-auto-starter.d.ts +41 -0
- package/lib/common/data/data-context/data-context-base.d.ts +7 -1
- package/lib/common/data/data-context/data-context-builder.d.ts +9 -1
- package/lib/common/data/data-context/data-context-continuable-token.d.ts +1 -1
- package/lib/common/data/data-context/data-context-life-cycle-binding.d.ts +33 -0
- package/lib/common/data/data-context/data-context-source-auto-reloader.d.ts +8 -0
- package/lib/common/data/data-context/data-context.d.ts +4 -0
- package/lib/common/data/data-context/public_api.d.ts +3 -1
- package/lib/common/data/required-filter-evaluator.d.ts +46 -0
- package/lib/components/data-view/base/elder-data-view-base.d.ts +11 -1
- package/lib/components/data-view/common/data-context-state-indicator/data-context-state-indicator.component.d.ts +29 -0
- package/lib/components/data-view/grid/elder-grid/elder-grid.component.d.ts +0 -5
- package/lib/components/data-view/table/elder-table/elder-table.component.d.ts +5 -10
- package/package.json +1 -1
- package/src/lib/components/data-view/common/data-context-state-indicator/data-context-state-indicator.component.scss +0 -0
- package/esm2015/lib/common/data/data-context/data-source-to-data-context-binding.js +0 -20
- package/lib/common/data/data-context/data-source-to-data-context-binding.d.ts +0 -12
|
@@ -2837,8 +2837,8 @@ class DataContextBase extends DataSource {
|
|
|
2837
2837
|
this._started = new BehaviorSubject(false);
|
|
2838
2838
|
this._closed = new BehaviorSubject(false);
|
|
2839
2839
|
this._primaryIndex = new Map();
|
|
2840
|
-
this.unsubscribe$ = new Subject();
|
|
2841
2840
|
this._reloadQueue = new Subject();
|
|
2841
|
+
this.unsubscribe$ = new Subject();
|
|
2842
2842
|
this._dataSource = dataSource;
|
|
2843
2843
|
this._loading = this._status.pipe(map(status => status.loading));
|
|
2844
2844
|
this._filter.filters.pipe(filter(() => this.started), takeUntil(this.unsubscribe$)).subscribe(filters => this.onFiltersChanged(filters));
|
|
@@ -2908,6 +2908,9 @@ class DataContextBase extends DataSource {
|
|
|
2908
2908
|
get isStarted() {
|
|
2909
2909
|
return this.started;
|
|
2910
2910
|
}
|
|
2911
|
+
get isStarted$() {
|
|
2912
|
+
return this._started.asObservable();
|
|
2913
|
+
}
|
|
2911
2914
|
get isClosed() {
|
|
2912
2915
|
return this._closed.getValue();
|
|
2913
2916
|
}
|
|
@@ -3075,6 +3078,11 @@ class DataContextBase extends DataSource {
|
|
|
3075
3078
|
onStatus(status) {
|
|
3076
3079
|
this._status.next(status);
|
|
3077
3080
|
}
|
|
3081
|
+
/***************************************************************************
|
|
3082
|
+
* *
|
|
3083
|
+
* Private methods *
|
|
3084
|
+
* *
|
|
3085
|
+
**************************************************************************/
|
|
3078
3086
|
clearIndex() {
|
|
3079
3087
|
this._primaryIndex.clear();
|
|
3080
3088
|
}
|
|
@@ -3344,7 +3352,7 @@ class DataContextContinuableToken extends DataContextContinuableBase {
|
|
|
3344
3352
|
// protected nextContinuationToken?: string;
|
|
3345
3353
|
/***************************************************************************
|
|
3346
3354
|
* *
|
|
3347
|
-
*
|
|
3355
|
+
* Constructor *
|
|
3348
3356
|
* *
|
|
3349
3357
|
**************************************************************************/
|
|
3350
3358
|
constructor(dataSource, chunkSize, indexFn, localApply, localSort) {
|
|
@@ -3725,22 +3733,182 @@ class MatTableDataContextBinding {
|
|
|
3725
3733
|
}
|
|
3726
3734
|
}
|
|
3727
3735
|
|
|
3728
|
-
|
|
3729
|
-
|
|
3736
|
+
/**
|
|
3737
|
+
* Allows making any kind of subscription which will be automatically unsubscribed
|
|
3738
|
+
* upon data context closing/cleanup.
|
|
3739
|
+
*/
|
|
3740
|
+
class DataContextLifeCycleBinding {
|
|
3741
|
+
/***************************************************************************
|
|
3742
|
+
* *
|
|
3743
|
+
* Constructor *
|
|
3744
|
+
* *
|
|
3745
|
+
**************************************************************************/
|
|
3746
|
+
constructor(_dataContext) {
|
|
3730
3747
|
this._dataContext = _dataContext;
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3748
|
+
if (_dataContext == null) {
|
|
3749
|
+
throw new Error('dataContext must not be null!');
|
|
3750
|
+
}
|
|
3734
3751
|
this._dataContext.data.subscribe(changed => { }, err => { }, () => this.unsubscribe());
|
|
3735
3752
|
}
|
|
3753
|
+
/***************************************************************************
|
|
3754
|
+
* *
|
|
3755
|
+
* Public API *
|
|
3756
|
+
* *
|
|
3757
|
+
**************************************************************************/
|
|
3736
3758
|
unsubscribe() {
|
|
3737
3759
|
if (this._subscription) {
|
|
3738
3760
|
this._subscription.unsubscribe();
|
|
3739
3761
|
this._subscription = null;
|
|
3740
3762
|
}
|
|
3741
3763
|
}
|
|
3764
|
+
}
|
|
3765
|
+
|
|
3766
|
+
class RequiredFilterContextChangedEvent {
|
|
3767
|
+
constructor(requiredFilters, currentFilters, isValid) {
|
|
3768
|
+
this.requiredFilters = requiredFilters;
|
|
3769
|
+
this.currentFilters = currentFilters;
|
|
3770
|
+
this.isValid = isValid;
|
|
3771
|
+
}
|
|
3772
|
+
}
|
|
3773
|
+
class RequiredFilterEvaluator {
|
|
3774
|
+
/***************************************************************************
|
|
3775
|
+
* *
|
|
3776
|
+
* Fields *
|
|
3777
|
+
* *
|
|
3778
|
+
**************************************************************************/
|
|
3779
|
+
constructor(filterContext, requiredFilters) {
|
|
3780
|
+
this._requiredFilters = new BehaviorSubject([]);
|
|
3781
|
+
if (filterContext == null) {
|
|
3782
|
+
throw new Error('filterContext must not be null!');
|
|
3783
|
+
}
|
|
3784
|
+
this._filterContext = filterContext;
|
|
3785
|
+
if (requiredFilters) {
|
|
3786
|
+
this._requiredFilters.next(requiredFilters);
|
|
3787
|
+
}
|
|
3788
|
+
this.context$ = combineLatest([
|
|
3789
|
+
this._requiredFilters,
|
|
3790
|
+
this._filterContext.filters
|
|
3791
|
+
]).pipe(map(([required, currentFilters]) => this.createEvent(requiredFilters, currentFilters)));
|
|
3792
|
+
}
|
|
3793
|
+
/***************************************************************************
|
|
3794
|
+
* *
|
|
3795
|
+
* Properties *
|
|
3796
|
+
* *
|
|
3797
|
+
**************************************************************************/
|
|
3798
|
+
get filterContext() {
|
|
3799
|
+
return this._filterContext;
|
|
3800
|
+
}
|
|
3801
|
+
get requiredFilters$() {
|
|
3802
|
+
return this._requiredFilters.asObservable();
|
|
3803
|
+
}
|
|
3804
|
+
get requiredFilters() {
|
|
3805
|
+
return this._requiredFilters.getValue();
|
|
3806
|
+
}
|
|
3807
|
+
/***************************************************************************
|
|
3808
|
+
* *
|
|
3809
|
+
* Public API *
|
|
3810
|
+
* *
|
|
3811
|
+
**************************************************************************/
|
|
3812
|
+
/***************************************************************************
|
|
3813
|
+
* *
|
|
3814
|
+
* Private methods *
|
|
3815
|
+
* *
|
|
3816
|
+
**************************************************************************/
|
|
3817
|
+
createEvent(requiredFilters, currentFilters) {
|
|
3818
|
+
return new RequiredFilterContextChangedEvent(requiredFilters, currentFilters, this.allRequiredFiltersPresent(requiredFilters, currentFilters));
|
|
3819
|
+
}
|
|
3820
|
+
allRequiredFiltersPresent(requiredFilters, currentFilters) {
|
|
3821
|
+
if (requiredFilters) {
|
|
3822
|
+
const validatedFilterGroups = requiredFilters.map(filterGroup => this.hasAllFilters(filterGroup, currentFilters));
|
|
3823
|
+
return validatedFilterGroups.find(validGroup => !!validGroup);
|
|
3824
|
+
}
|
|
3825
|
+
return true;
|
|
3826
|
+
}
|
|
3827
|
+
hasAllFilters(requiredFilters, currentFilters) {
|
|
3828
|
+
const currentFilterKeys = currentFilters.map(f => f.key);
|
|
3829
|
+
const currentFilterKeySet = new Set(currentFilterKeys);
|
|
3830
|
+
return requiredFilters.every(required => currentFilterKeySet.has(required));
|
|
3831
|
+
}
|
|
3832
|
+
}
|
|
3833
|
+
|
|
3834
|
+
class AutoStartSpec {
|
|
3835
|
+
constructor(requiredFilters, initialSort) {
|
|
3836
|
+
this.requiredFilters = requiredFilters;
|
|
3837
|
+
this.initialSort = initialSort;
|
|
3838
|
+
}
|
|
3839
|
+
static asap(sort) {
|
|
3840
|
+
return new AutoStartSpec(null, sort);
|
|
3841
|
+
}
|
|
3842
|
+
static requireFiltersAll(filters, sort) {
|
|
3843
|
+
return AutoStartSpec.requireFilters([filters], sort);
|
|
3844
|
+
}
|
|
3845
|
+
static requireFiltersAny(filters, sort) {
|
|
3846
|
+
const separateFilterArrays = filters.map(singleFilter => [singleFilter]);
|
|
3847
|
+
return AutoStartSpec.requireFilters(separateFilterArrays, sort);
|
|
3848
|
+
}
|
|
3849
|
+
static requireFilters(filters, sort) {
|
|
3850
|
+
return new AutoStartSpec(filters, sort);
|
|
3851
|
+
}
|
|
3852
|
+
}
|
|
3853
|
+
class DataContextAutoStarter extends DataContextLifeCycleBinding {
|
|
3854
|
+
/***************************************************************************
|
|
3855
|
+
* *
|
|
3856
|
+
* Constructor *
|
|
3857
|
+
* *
|
|
3858
|
+
**************************************************************************/
|
|
3859
|
+
constructor(dataContext, _autoStartSpec) {
|
|
3860
|
+
super(dataContext);
|
|
3861
|
+
this._autoStartSpec = _autoStartSpec;
|
|
3862
|
+
/***************************************************************************
|
|
3863
|
+
* *
|
|
3864
|
+
* Fields *
|
|
3865
|
+
* *
|
|
3866
|
+
**************************************************************************/
|
|
3867
|
+
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
3868
|
+
if (_autoStartSpec == null) {
|
|
3869
|
+
throw new Error('autoStartSpec must not be null!');
|
|
3870
|
+
}
|
|
3871
|
+
if (_autoStartSpec.requiredFilters) {
|
|
3872
|
+
this._autoStartConditionFulfilled$ = this.buildRequiredFilterConditionObservable();
|
|
3873
|
+
}
|
|
3874
|
+
else {
|
|
3875
|
+
// no condition defined, try to start immediately
|
|
3876
|
+
this.startDataContext();
|
|
3877
|
+
}
|
|
3878
|
+
this.subscribe();
|
|
3879
|
+
}
|
|
3880
|
+
/***************************************************************************
|
|
3881
|
+
* *
|
|
3882
|
+
* Public API *
|
|
3883
|
+
* *
|
|
3884
|
+
**************************************************************************/
|
|
3885
|
+
subscribe() {
|
|
3886
|
+
if (this._autoStartConditionFulfilled$) {
|
|
3887
|
+
this._subscription = this._autoStartConditionFulfilled$.pipe(filter(fulfilled => !!fulfilled)).subscribe(() => this.startDataContext());
|
|
3888
|
+
}
|
|
3889
|
+
}
|
|
3890
|
+
/***************************************************************************
|
|
3891
|
+
* *
|
|
3892
|
+
* Private methods *
|
|
3893
|
+
* *
|
|
3894
|
+
**************************************************************************/
|
|
3895
|
+
buildRequiredFilterConditionObservable() {
|
|
3896
|
+
return new RequiredFilterEvaluator(this._dataContext.filter, this._autoStartSpec.requiredFilters).context$.pipe(map(event => event.isValid));
|
|
3897
|
+
}
|
|
3898
|
+
startDataContext() {
|
|
3899
|
+
this.logger.debug('Auto starting data context...');
|
|
3900
|
+
this._dataContext.start(this._autoStartSpec.initialSort);
|
|
3901
|
+
}
|
|
3902
|
+
}
|
|
3903
|
+
|
|
3904
|
+
class DataContextSourceAutoReloader extends DataContextLifeCycleBinding {
|
|
3905
|
+
constructor(dataContext, dataApi) {
|
|
3906
|
+
super(dataContext);
|
|
3907
|
+
this.dataApi = dataApi;
|
|
3908
|
+
this.subscribe();
|
|
3909
|
+
}
|
|
3742
3910
|
subscribe() {
|
|
3743
|
-
this._subscription = this.
|
|
3911
|
+
this._subscription = this.dataApi.dataChanged.subscribe(() => this._dataContext.reload());
|
|
3744
3912
|
}
|
|
3745
3913
|
}
|
|
3746
3914
|
|
|
@@ -4173,6 +4341,22 @@ class DataContextBuilder {
|
|
|
4173
4341
|
this._reloadOnLocalChanges = true;
|
|
4174
4342
|
return this;
|
|
4175
4343
|
}
|
|
4344
|
+
autoStartAsap(sort) {
|
|
4345
|
+
return this.autoStartOn(AutoStartSpec.asap(sort));
|
|
4346
|
+
}
|
|
4347
|
+
autoStartOnFilters(filters, sort) {
|
|
4348
|
+
return this.autoStartOn(AutoStartSpec.requireFilters(filters, sort));
|
|
4349
|
+
}
|
|
4350
|
+
autoStartOnFiltersAll(filters, sort) {
|
|
4351
|
+
return this.autoStartOn(AutoStartSpec.requireFiltersAll(filters, sort));
|
|
4352
|
+
}
|
|
4353
|
+
autoStartOnFiltersAny(filters, sort) {
|
|
4354
|
+
return this.autoStartOn(AutoStartSpec.requireFiltersAny(filters, sort));
|
|
4355
|
+
}
|
|
4356
|
+
autoStartOn(spec) {
|
|
4357
|
+
this._autoStartSpec = spec;
|
|
4358
|
+
return this;
|
|
4359
|
+
}
|
|
4176
4360
|
/***************************************************************************
|
|
4177
4361
|
* *
|
|
4178
4362
|
* DataSource Builder *
|
|
@@ -4270,7 +4454,10 @@ class DataContextBuilder {
|
|
|
4270
4454
|
else {
|
|
4271
4455
|
throw new Error('Unsupported IDataSource type: ' + typeof (ds));
|
|
4272
4456
|
}
|
|
4273
|
-
|
|
4457
|
+
if (this._autoStartSpec) {
|
|
4458
|
+
this.setupDataContextAutoStart(dataContext, this._autoStartSpec);
|
|
4459
|
+
}
|
|
4460
|
+
return this.setupDataContextAutoReload(dataContext, ds);
|
|
4274
4461
|
}
|
|
4275
4462
|
fromListSource(listSource) {
|
|
4276
4463
|
return new DataContextSimple(listSource, this._indexFn, this._localApply, this._localSort);
|
|
@@ -4284,9 +4471,16 @@ class DataContextBuilder {
|
|
|
4284
4471
|
fromActivePageSource(pageSource) {
|
|
4285
4472
|
return new DataContextActivePage(pageSource, this._pageSize, this._indexFn, this._localApply, this._skipLocalSort ? null : this._localSort);
|
|
4286
4473
|
}
|
|
4287
|
-
|
|
4474
|
+
setupDataContextAutoReload(dc, dataSource) {
|
|
4288
4475
|
if (this._reloadOnLocalChanges) {
|
|
4289
|
-
const binding = new
|
|
4476
|
+
const binding = new DataContextSourceAutoReloader(dc, dataSource);
|
|
4477
|
+
}
|
|
4478
|
+
return dc;
|
|
4479
|
+
}
|
|
4480
|
+
setupDataContextAutoStart(dc, autoStartSpec) {
|
|
4481
|
+
if (this._autoStartSpec) {
|
|
4482
|
+
this.logger.debug('Setting up data context auto start with spec:', this._autoStartSpec);
|
|
4483
|
+
const binding = new DataContextAutoStarter(dc, autoStartSpec);
|
|
4290
4484
|
}
|
|
4291
4485
|
return dc;
|
|
4292
4486
|
}
|
|
@@ -8109,14 +8303,15 @@ class ElderBlobViewerComponent {
|
|
|
8109
8303
|
this._mimeType$ = new BehaviorSubject(null);
|
|
8110
8304
|
this.destroy$ = new Subject();
|
|
8111
8305
|
this._displayUnknownAsText = false;
|
|
8112
|
-
combineLatest([this._url$, this._mimeType$]).pipe(takeUntil(this.destroy$), filter(([url, mimeType]) => !!url), map(([url, mimeType]) => BlobUrl.from(url, mimeType))).subscribe(blobUrl => this.blobUrl = blobUrl);
|
|
8113
8306
|
}
|
|
8114
8307
|
/***************************************************************************
|
|
8115
8308
|
* *
|
|
8116
8309
|
* Life Cycle *
|
|
8117
8310
|
* *
|
|
8118
8311
|
**************************************************************************/
|
|
8119
|
-
ngOnInit() {
|
|
8312
|
+
ngOnInit() {
|
|
8313
|
+
combineLatest([this._url$, this._mimeType$]).pipe(takeUntil(this.destroy$), filter(([url, mimeType]) => !!url), map(([url, mimeType]) => BlobUrl.from(url, mimeType))).subscribe(blobUrl => this.blobUrl = blobUrl);
|
|
8314
|
+
}
|
|
8120
8315
|
ngOnDestroy() {
|
|
8121
8316
|
this.destroy$.next();
|
|
8122
8317
|
this.destroy$.complete();
|
|
@@ -9710,6 +9905,49 @@ ElderSelectionMasterCheckboxComponent.ctorParameters = () => [
|
|
|
9710
9905
|
{ type: DataContextSelectionDirective }
|
|
9711
9906
|
];
|
|
9712
9907
|
|
|
9908
|
+
class DataContextStateIndicatorComponent {
|
|
9909
|
+
/***************************************************************************
|
|
9910
|
+
* *
|
|
9911
|
+
* Constructor *
|
|
9912
|
+
* *
|
|
9913
|
+
**************************************************************************/
|
|
9914
|
+
constructor() {
|
|
9915
|
+
/***************************************************************************
|
|
9916
|
+
* *
|
|
9917
|
+
* Fields *
|
|
9918
|
+
* *
|
|
9919
|
+
**************************************************************************/
|
|
9920
|
+
this.dataContext$ = new BehaviorSubject(null);
|
|
9921
|
+
}
|
|
9922
|
+
/***************************************************************************
|
|
9923
|
+
* *
|
|
9924
|
+
* Life Cycle *
|
|
9925
|
+
* *
|
|
9926
|
+
**************************************************************************/
|
|
9927
|
+
ngOnInit() {
|
|
9928
|
+
}
|
|
9929
|
+
/***************************************************************************
|
|
9930
|
+
* *
|
|
9931
|
+
* Properties *
|
|
9932
|
+
* *
|
|
9933
|
+
**************************************************************************/
|
|
9934
|
+
set dataContext(dataContext) {
|
|
9935
|
+
this.dataContext$.next(dataContext);
|
|
9936
|
+
}
|
|
9937
|
+
}
|
|
9938
|
+
DataContextStateIndicatorComponent.decorators = [
|
|
9939
|
+
{ type: Component, args: [{
|
|
9940
|
+
selector: 'elder-data-context-state-indicator',
|
|
9941
|
+
template: "<ng-container *ngIf=\"dataContext$ | async as dataContext\">\n\n <ng-container *ngIf=\"dataContext else noDataContext\">\n\n <ng-container *ngIf=\"(dataContext.isStarted$ | async) else dataContextNotStarted\">\n\n <ng-container *ngIf=\"!(dataContext?.status | async)?.hasError else dataContextHasError\">\n\n <ng-container *ngIf=\"(dataContext?.data | async)?.length === 0\">\n <ng-template [ngTemplateOutlet]=\"dataContextNoData\"></ng-template>\n </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n </ng-container>\n\n</ng-container>\n\n<ng-template #noDataContext>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', text: 'No data context'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextNotStarted>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', text: 'Data context not started'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextHasError>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'warning', iconColor: 'warn', text: 'Error while loading data'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #dataContextNoData>\n <ng-container *ngTemplateOutlet=\"indicator; context:{icon: 'info', text: 'No data available'}\">\n </ng-container>\n</ng-template>\n\n<ng-template #indicator let-icon=\"icon\" let-iconColor=\"iconColor\" let-text=\"text\">\n\n <div fxFill\n fxLayout=\"column\"\n fxLayoutAlign=\"center center\"\n class=\"elder-table-hint mat-body-1\">\n\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"16px\">\n <mat-icon [color]=\"iconColor\">{{icon}}</mat-icon>\n <span class=\"hint mat-body-1\">{{text | translate}}</span>\n </div>\n\n </div>\n\n</ng-template>\n",
|
|
9942
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9943
|
+
styles: [""]
|
|
9944
|
+
},] }
|
|
9945
|
+
];
|
|
9946
|
+
DataContextStateIndicatorComponent.ctorParameters = () => [];
|
|
9947
|
+
DataContextStateIndicatorComponent.propDecorators = {
|
|
9948
|
+
dataContext: [{ type: Input }]
|
|
9949
|
+
};
|
|
9950
|
+
|
|
9713
9951
|
class ElderDataCommonModule {
|
|
9714
9952
|
}
|
|
9715
9953
|
ElderDataCommonModule.decorators = [
|
|
@@ -9730,14 +9968,16 @@ ElderDataCommonModule.decorators = [
|
|
|
9730
9968
|
ElderToolbarContentDirective,
|
|
9731
9969
|
ElderSingleSortComponent,
|
|
9732
9970
|
ElderSelectionMasterCheckboxComponent,
|
|
9733
|
-
DataContextSelectionDirective
|
|
9971
|
+
DataContextSelectionDirective,
|
|
9972
|
+
DataContextStateIndicatorComponent
|
|
9734
9973
|
],
|
|
9735
9974
|
exports: [
|
|
9736
9975
|
ElderDataToolbarComponent,
|
|
9737
9976
|
ElderToolbarContentDirective,
|
|
9738
9977
|
ElderSingleSortComponent,
|
|
9739
9978
|
ElderSelectionMasterCheckboxComponent,
|
|
9740
|
-
DataContextSelectionDirective
|
|
9979
|
+
DataContextSelectionDirective,
|
|
9980
|
+
DataContextStateIndicatorComponent
|
|
9741
9981
|
],
|
|
9742
9982
|
},] }
|
|
9743
9983
|
];
|
|
@@ -10213,6 +10453,7 @@ class ElderDataViewBaseComponent {
|
|
|
10213
10453
|
* Underlying data context.
|
|
10214
10454
|
*/
|
|
10215
10455
|
this.dataContext$ = new BehaviorSubject(null);
|
|
10456
|
+
this.interactionMode = 'open';
|
|
10216
10457
|
/**
|
|
10217
10458
|
* If true, this table is in dense mode.
|
|
10218
10459
|
* Heights are generally reduced.
|
|
@@ -10228,6 +10469,7 @@ class ElderDataViewBaseComponent {
|
|
|
10228
10469
|
* No borders / floating visible so that the table can be embedded into another container
|
|
10229
10470
|
*/
|
|
10230
10471
|
this._embedded = false;
|
|
10472
|
+
this._itemClickSubject = new Subject();
|
|
10231
10473
|
if (!selectionModel) {
|
|
10232
10474
|
this.selectionModel = new SelectionModel(false, [], (entity) => entity ? this.getId(entity) : 0);
|
|
10233
10475
|
}
|
|
@@ -10294,6 +10536,14 @@ class ElderDataViewBaseComponent {
|
|
|
10294
10536
|
this.selectionModel.isMultipleSelection = enableMultiSelection;
|
|
10295
10537
|
}
|
|
10296
10538
|
}
|
|
10539
|
+
/***************************************************************************
|
|
10540
|
+
* *
|
|
10541
|
+
* On click properties *
|
|
10542
|
+
* *
|
|
10543
|
+
**************************************************************************/
|
|
10544
|
+
get itemClick() {
|
|
10545
|
+
return this._itemClickSubject;
|
|
10546
|
+
}
|
|
10297
10547
|
/***************************************************************************
|
|
10298
10548
|
* *
|
|
10299
10549
|
* Style Properties *
|
|
@@ -10328,7 +10578,38 @@ class ElderDataViewBaseComponent {
|
|
|
10328
10578
|
* @param data
|
|
10329
10579
|
* @protected
|
|
10330
10580
|
*/
|
|
10331
|
-
onDataContextSet(data) {
|
|
10581
|
+
onDataContextSet(data) {
|
|
10582
|
+
}
|
|
10583
|
+
onItemClick(entity) {
|
|
10584
|
+
if (entity) {
|
|
10585
|
+
switch (this.interactionMode) {
|
|
10586
|
+
case 'open':
|
|
10587
|
+
if (this.selectionModel.hasValue) {
|
|
10588
|
+
this.selectionModel.toggle(entity);
|
|
10589
|
+
}
|
|
10590
|
+
else {
|
|
10591
|
+
this._itemClickSubject.next(entity);
|
|
10592
|
+
}
|
|
10593
|
+
break;
|
|
10594
|
+
case 'selection':
|
|
10595
|
+
this.selectionModel.toggle(entity);
|
|
10596
|
+
break;
|
|
10597
|
+
}
|
|
10598
|
+
}
|
|
10599
|
+
}
|
|
10600
|
+
onItemDoubleClick(entity) {
|
|
10601
|
+
if (entity) {
|
|
10602
|
+
switch (this.interactionMode) {
|
|
10603
|
+
// double click in open mode not supported
|
|
10604
|
+
case 'open':
|
|
10605
|
+
break;
|
|
10606
|
+
// double click in selection mode triggers normal item click
|
|
10607
|
+
case 'selection':
|
|
10608
|
+
this._itemClickSubject.next(entity);
|
|
10609
|
+
break;
|
|
10610
|
+
}
|
|
10611
|
+
}
|
|
10612
|
+
}
|
|
10332
10613
|
/***************************************************************************
|
|
10333
10614
|
* *
|
|
10334
10615
|
* Private Methods *
|
|
@@ -10347,11 +10628,13 @@ ElderDataViewBaseComponent.ctorParameters = () => [
|
|
|
10347
10628
|
{ type: ElderDataViewSelectionMode }
|
|
10348
10629
|
];
|
|
10349
10630
|
ElderDataViewBaseComponent.propDecorators = {
|
|
10631
|
+
interactionMode: [{ type: Input }],
|
|
10350
10632
|
selectableEvaluatorFn: [{ type: Input }],
|
|
10351
10633
|
selection: [{ type: Input }],
|
|
10352
10634
|
selectionChange: [{ type: Output }],
|
|
10353
10635
|
selectionSingleChange: [{ type: Output }],
|
|
10354
10636
|
selectionMultiEnabled: [{ type: Input }],
|
|
10637
|
+
itemClick: [{ type: Output }],
|
|
10355
10638
|
dense: [{ type: Input }],
|
|
10356
10639
|
float: [{ type: Input }],
|
|
10357
10640
|
embedded: [{ type: Input }]
|
|
@@ -10780,7 +11063,6 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
10780
11063
|
**************************************************************************/
|
|
10781
11064
|
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
10782
11065
|
this.destroy$ = new Subject();
|
|
10783
|
-
this._itemClickSubject = new Subject();
|
|
10784
11066
|
/**
|
|
10785
11067
|
* Load next chunk after current is done
|
|
10786
11068
|
*/
|
|
@@ -10811,7 +11093,6 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
10811
11093
|
this.cleanUp = true;
|
|
10812
11094
|
this.keepSelection = true;
|
|
10813
11095
|
this.showFooter = false;
|
|
10814
|
-
this.interactionMode = 'open';
|
|
10815
11096
|
this.toolbarRowTemplates$ = new BehaviorSubject([]);
|
|
10816
11097
|
/**
|
|
10817
11098
|
* Gets the current rows of this table.
|
|
@@ -10890,7 +11171,7 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
10890
11171
|
if (data instanceof Array) {
|
|
10891
11172
|
dc = DataContextBuilder.start()
|
|
10892
11173
|
.localSort()
|
|
10893
|
-
.buildLocal(data); // Potential Memory leak (See autoCleanUp)
|
|
11174
|
+
.buildLocal(data, this.idField); // Potential Memory leak (See autoCleanUp)
|
|
10894
11175
|
dc.start();
|
|
10895
11176
|
}
|
|
10896
11177
|
else if (isDataSource(data)) {
|
|
@@ -10935,9 +11216,6 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
10935
11216
|
get selectionVisible() {
|
|
10936
11217
|
return this.tableModel.selectionVisible;
|
|
10937
11218
|
}
|
|
10938
|
-
get itemClick() {
|
|
10939
|
-
return this._itemClickSubject;
|
|
10940
|
-
}
|
|
10941
11219
|
/*
|
|
10942
11220
|
@Output()
|
|
10943
11221
|
public get activeItem(): Observable<any> {
|
|
@@ -10972,42 +11250,6 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
10972
11250
|
get trackByFn() {
|
|
10973
11251
|
return (index, entity) => this.getId(entity);
|
|
10974
11252
|
}
|
|
10975
|
-
/**
|
|
10976
|
-
* Occurs when the user clicks on a row
|
|
10977
|
-
*/
|
|
10978
|
-
onItemClick(entity) {
|
|
10979
|
-
switch (this.interactionMode) {
|
|
10980
|
-
case 'open':
|
|
10981
|
-
if (this.selectionModel.hasValue) {
|
|
10982
|
-
this.selectionModel.toggle(entity);
|
|
10983
|
-
}
|
|
10984
|
-
else {
|
|
10985
|
-
this._itemClickSubject.next(entity);
|
|
10986
|
-
}
|
|
10987
|
-
break;
|
|
10988
|
-
case 'selection':
|
|
10989
|
-
this.selectionModel.toggle(entity);
|
|
10990
|
-
break;
|
|
10991
|
-
// TODO improve onItemDoubleClick behavior with Observable
|
|
10992
|
-
/*
|
|
10993
|
-
clickStream
|
|
10994
|
-
.bufferTime(250)
|
|
10995
|
-
.map(arr => arr.length)
|
|
10996
|
-
.filter(len => len === 2);
|
|
10997
|
-
*/
|
|
10998
|
-
}
|
|
10999
|
-
}
|
|
11000
|
-
onItemDoubleClick(entity) {
|
|
11001
|
-
switch (this.interactionMode) {
|
|
11002
|
-
// double click in open mode not supported
|
|
11003
|
-
case 'open':
|
|
11004
|
-
break;
|
|
11005
|
-
// double click in selection mode triggers normal item click
|
|
11006
|
-
case 'selection':
|
|
11007
|
-
this._itemClickSubject.next(entity);
|
|
11008
|
-
break;
|
|
11009
|
-
}
|
|
11010
|
-
}
|
|
11011
11253
|
/***************************************************************************
|
|
11012
11254
|
* *
|
|
11013
11255
|
* Private Methods *
|
|
@@ -11048,7 +11290,7 @@ class ElderTableComponent extends ElderDataViewBaseComponent {
|
|
|
11048
11290
|
ElderTableComponent.decorators = [
|
|
11049
11291
|
{ type: Component, args: [{
|
|
11050
11292
|
selector: 'elder-table, ebs-table',
|
|
11051
|
-
template: "\n<div fxLayout=\"column\" fxFlex\n class=\"elder-table\"\n [class.elder-mat-table-container]=\"!embedded\"\n [class.mat-elevation-z5]=\"float\"\n [class.elder-mat-table-flat]=\"!embedded && !float\"\n>\n\n <!-- Toolbar Rows -->\n <ng-container *ngFor=\"let toolbarRowTemplate of toolbarRowTemplates$ | async\">\n <ng-template *ngTemplateOutlet=\"toolbarRowTemplate; context: {$implicit: this}\">\n </ng-template>\n </ng-container>\n\n <!-- Scrollable Table -->\n <div fxLayout=\"column\" class=\"scrollable elder-table-scroll\"\n infiniteScroll\n [eventThrottle]=\"150\"\n [offsetFactor]=\"2\"\n [ignoreScrollEvent]=\"!isContinuable || !(canLoadMore$ | async)\"\n (closeToEnd)=\"requestMoreDataZoned($event)\"\n >\n <table\n mat-table\n class=\"elder-mat-inner-table\"\n [trackBy]=\"trackByFn\"\n [dataSource]=\"dataContext$ | async\"\n [elderDataContextSelection]=\"dataContext$ | async\" #dataSelection=\"elderDataContextSelection\"\n [elderDataContextSelectionModel]=\"selectionModel\"\n >\n\n <!-- selection Column -->\n <ng-container matColumnDef=\"select\">\n <th mat-header-cell *matHeaderCellDef>\n <elder-selection-master-checkbox></elder-selection-master-checkbox>\n </th>\n <td mat-cell *matCellDef=\"let entity\">\n <mat-checkbox (click)=\"$event.stopPropagation()\"\n (change)=\"$event ? selectionModel.toggle(entity) : null\"\n [checked]=\"selectionModel.observeSelection(entity) | async\"\n [disabled]=\"!selectionModel.isSelectable(entity)\"\n class=\"elder-table-checkbox\"\n [class.elder-table-checkbox-visible]=\"(dataSelection.selectionState$ | async).anySelected\"\n >\n </mat-checkbox>\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container *ngIf=\"(tableModel.displayedColumnsInner$ | async) as displayedColumnsInner\">\n <tr mat-header-row *matHeaderRowDef=\"displayedColumnsInner; sticky: true\"></tr>\n <tr mat-row class=\"elder-table-row\"\n *matRowDef=\"let entity; columns: displayedColumnsInner;\"\n [elderTableRow]=\"entity\"\n [class.dense]=\"dense\"\n [class.elder-row-hidden]=\"hiddenField && entity[hiddenField]\"\n [class.elder-row-removing]=\"removingField && entity[removingField]\"\n [class.elder-table-row-selected]=\"interactionMode == 'selection' && selectionModel.observeSelection(entity) | async\"\n (click)=\"
|
|
11293
|
+
template: "\n<div fxLayout=\"column\" fxFlex\n class=\"elder-table\"\n [class.elder-mat-table-container]=\"!embedded\"\n [class.mat-elevation-z5]=\"float\"\n [class.elder-mat-table-flat]=\"!embedded && !float\"\n>\n\n <!-- Toolbar Rows -->\n <ng-container *ngFor=\"let toolbarRowTemplate of toolbarRowTemplates$ | async\">\n <ng-template *ngTemplateOutlet=\"toolbarRowTemplate; context: {$implicit: this}\">\n </ng-template>\n </ng-container>\n\n <!-- Scrollable Table -->\n <div fxLayout=\"column\" class=\"scrollable elder-table-scroll\"\n infiniteScroll\n [eventThrottle]=\"150\"\n [offsetFactor]=\"2\"\n [ignoreScrollEvent]=\"!isContinuable || !(canLoadMore$ | async)\"\n (closeToEnd)=\"requestMoreDataZoned($event)\"\n >\n <table\n mat-table\n class=\"elder-mat-inner-table\"\n [trackBy]=\"trackByFn\"\n [dataSource]=\"dataContext$ | async\"\n [elderDataContextSelection]=\"dataContext$ | async\" #dataSelection=\"elderDataContextSelection\"\n [elderDataContextSelectionModel]=\"selectionModel\"\n >\n\n <!-- selection Column -->\n <ng-container matColumnDef=\"select\">\n <th mat-header-cell *matHeaderCellDef>\n <elder-selection-master-checkbox></elder-selection-master-checkbox>\n </th>\n <td mat-cell *matCellDef=\"let entity\">\n <mat-checkbox (click)=\"$event.stopPropagation()\"\n (change)=\"$event ? selectionModel.toggle(entity) : null\"\n [checked]=\"selectionModel.observeSelection(entity) | async\"\n [disabled]=\"!selectionModel.isSelectable(entity)\"\n class=\"elder-table-checkbox\"\n [class.elder-table-checkbox-visible]=\"(dataSelection.selectionState$ | async).anySelected\"\n >\n </mat-checkbox>\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container *ngIf=\"(tableModel.displayedColumnsInner$ | async) as displayedColumnsInner\">\n <tr mat-header-row *matHeaderRowDef=\"displayedColumnsInner; sticky: true\"></tr>\n <tr mat-row class=\"elder-table-row\"\n *matRowDef=\"let entity; columns: displayedColumnsInner;\"\n [elderTableRow]=\"entity\"\n [class.dense]=\"dense\"\n [class.elder-row-hidden]=\"hiddenField && entity[hiddenField]\"\n [class.elder-row-removing]=\"removingField && entity[removingField]\"\n [class.elder-table-row-selected]=\"interactionMode == 'selection' && selectionModel.observeSelection(entity) | async\"\n (click)=\"onItemClick(entity)\"\n (dblclick)=\"onItemDoubleClick(entity)\"\n >\n </tr>\n <ng-container *ngIf=\"showFooter\">\n <tr mat-footer-row *matFooterRowDef=\"displayedColumnsInner; sticky: true\"></tr>\n </ng-container>\n </ng-container>\n </table>\n </div>\n\n <elder-data-context-state-indicator fxFlex [dataContext]=\"dataContext\">\n </elder-data-context-state-indicator>\n\n <mat-progress-bar fxFlex=\"none\"\n [mode]=\"(dataContext?.loading | async) ? 'indeterminate' : 'determinate'\"\n [color]=\"((dataContext?.status | async)?.hasError) ? 'warn' : 'primary'\">\n </mat-progress-bar>\n\n <!-- Optional Paginator Toolbar -->\n <mat-paginator #matPaginator *ngIf=\"isActivePaged && (dataActivePaged.page | async) as page\"\n fxFlex=\"none\"\n [length]=\"dataContext?.total | async\"\n [pageIndex]=\"page?.index\"\n [pageSize]=\"page?.size\"\n [pageSizeOptions]=\"pageSizeOptions\">\n </mat-paginator>\n\n <!-- Optional Continuation Footer -->\n <div *ngIf=\"isContinuable\" class=\"elder-table-footer\"\n fxLayout=\"row\" fxFlex=\"none\" fxLayoutAlign=\"end center\" fxLayoutGap=\"10px\"\n style=\"padding-right: 10px\" >\n\n <span class=\"mat-caption noselect\" style=\"color: gray\">\n {{(dataContext?.data | async)?.length}} / {{total$ | async}}\n </span>\n\n <button mat-icon-button type=\"button\" color=\"primary\"\n [disabled]=\"!(canLoadMore$ | async)\"\n (click)=\"dataContinuable.loadMore()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n </div>\n\n</div>\n",
|
|
11052
11294
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11053
11295
|
providers: [
|
|
11054
11296
|
ElderTableProviders.ExistingOrNewTableModel,
|
|
@@ -11082,14 +11324,12 @@ ElderTableComponent.propDecorators = {
|
|
|
11082
11324
|
cleanUp: [{ type: Input }],
|
|
11083
11325
|
keepSelection: [{ type: Input }],
|
|
11084
11326
|
showFooter: [{ type: Input }],
|
|
11085
|
-
interactionMode: [{ type: Input }],
|
|
11086
11327
|
toolbarRowTemplateQuery: [{ type: ContentChildren, args: [ElderTableToolbarDirective, { read: TemplateRef },] }],
|
|
11087
11328
|
rowsQuery: [{ type: ViewChildren, args: [ElderTableRowDirective,] }],
|
|
11088
11329
|
toolbarTemplate: [{ type: Input }],
|
|
11089
11330
|
data: [{ type: Input }],
|
|
11090
11331
|
displayedColumns: [{ type: Input }],
|
|
11091
|
-
selectionVisible: [{ type: Input }]
|
|
11092
|
-
itemClick: [{ type: Output }]
|
|
11332
|
+
selectionVisible: [{ type: Input }]
|
|
11093
11333
|
};
|
|
11094
11334
|
|
|
11095
11335
|
class ElderInfiniteScrollDirective {
|
|
@@ -12889,13 +13129,8 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
12889
13129
|
*/
|
|
12890
13130
|
this.idField = 'id';
|
|
12891
13131
|
this.selectionVisible = true;
|
|
12892
|
-
this.interactionMode = 'open';
|
|
12893
13132
|
this.pageSizeOptions = [30, 50, 100, 150, 200];
|
|
12894
13133
|
this.destroy$ = new Subject();
|
|
12895
|
-
this._itemClickSubject = new Subject();
|
|
12896
|
-
}
|
|
12897
|
-
get itemClick() {
|
|
12898
|
-
return this._itemClickSubject;
|
|
12899
13134
|
}
|
|
12900
13135
|
/***************************************************************************
|
|
12901
13136
|
* *
|
|
@@ -12972,18 +13207,6 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
12972
13207
|
* Public API *
|
|
12973
13208
|
* *
|
|
12974
13209
|
**************************************************************************/
|
|
12975
|
-
onItemClick(entity) {
|
|
12976
|
-
switch (this.interactionMode) {
|
|
12977
|
-
case 'open':
|
|
12978
|
-
if (this.selectionModel.hasValue) {
|
|
12979
|
-
this.selectionModel.toggle(entity);
|
|
12980
|
-
}
|
|
12981
|
-
else {
|
|
12982
|
-
this._itemClickSubject.next(entity);
|
|
12983
|
-
}
|
|
12984
|
-
break;
|
|
12985
|
-
}
|
|
12986
|
-
}
|
|
12987
13210
|
inSelectionMode(currentSelection) {
|
|
12988
13211
|
if (this.interactionMode === 'selection') {
|
|
12989
13212
|
return true;
|
|
@@ -13060,7 +13283,7 @@ class ElderGridComponent extends ElderDataViewBaseComponent {
|
|
|
13060
13283
|
ElderGridComponent.decorators = [
|
|
13061
13284
|
{ type: Component, args: [{
|
|
13062
13285
|
selector: 'elder-grid',
|
|
13063
|
-
template: "<div fxLayout=\"column\" class=\"scroll-fix\" fxFill>\n\n <!-- Grid Browser -->\n <div fxLayout=\"column\" fxFlex\n class=\"scroll-fix elder-grid-container\"\n *ngIf=\"dataContext$ | async as data\"\n [class.elder-mat-table-container]=\"!embedded\"\n [class.mat-elevation-z5]=\"float\"\n [class.elder-mat-table-flat]=\"!embedded && !float\"\n\n [elderDataContextSelection]=\"data\" #dataSelection=\"elderDataContextSelection\"\n [elderDataContextSelectionModel]=\"selectionModel\"\n >\n\n <!-- Toolbar Row -->\n <div *ngIf=\"toolbarVisible\"\n fxLayout=\"row\" fxLayoutAlign=\"start center\" fxFlex=\"none\" class=\"elder-grid-toolbar\">\n\n <div fxLayout=\"column\" fxFlex=\"none\" style=\"padding-left: 8px; padding-right: 8px\" *ngIf=\"selectionVisible\">\n <elder-selection-master-checkbox fxFlex=\"none\" style=\"padding-left: 12px\"></elder-selection-master-checkbox>\n </div>\n\n <!-- Toolbar -->\n <ng-container *ngIf=\"toolbarTemplate\">\n <ng-template *ngTemplateOutlet=\"toolbarTemplate; context: {$implicit: this}\"></ng-template>\n </ng-container>\n\n <elder-single-sort *ngIf=\"availableSorts && availableSorts.length > 0 && data.sort.sorts | async as sorts\"\n fxFlex=\"none\"\n [availableSorts]=\"availableSorts\"\n [translationPrefix]=\"sortTranslationPrefix\"\n [sort]=\"sorts[0]\"\n (sortChange)=\"updateSort($event)\">\n </elder-single-sort>\n\n </div>\n\n <mat-divider *ngIf=\"toolbarVisible\"></mat-divider>\n\n <span class=\"elder-table-hint mat-body-1\" fxFlex fxLayoutAlign=\"center center\"\n *ngIf=\"!dataContext?.isStarted\">\n {{'Datacontext not started' | translate}}\n </span>\n\n <div *ngIf=\"(dataContext?.data | async)?.isStarted\" fxFlex fxLayoutAlign=\"center center\">\n\n <span class=\"elder-table-hint mat-body-1\"\n *ngIf=\"(dataContext?.data | async)?.length === 0 && !(dataContext?.status | async)?.hasError\">\n {{'No data available' | translate}}\n </span>\n\n <div *ngIf=\"(dataContext?.status | async)?.hasError\"\n fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"20px\">\n <mat-icon color=\"warn\">warning</mat-icon>\n <span class=\"hint mat-body-1\">{{'Error while loading data' | translate}}</span>\n </div>\n\n </div>\n\n <!-- [cdkDropListSortingDisabled]=\"true\" -->\n <!-- cdkDropList -->\n <cdk-virtual-scroll-viewport\n class=\"elder-grid-browser\" fxLayout=\"column\" fxFlex\n id=\"documents-container\"\n [itemSize]=\"itemHeight\"\n [minBufferPx]=\"itemHeight * 2\"\n [maxBufferPx]=\"itemHeight * 3\"\n #virtualScrollViewPort\n infiniteScroll\n [eventThrottle]=\"200\"\n [offsetFactor]=\"2\"\n [ignoreScrollEvent]=\"data.loading | async\"\n [containerId]=\"'documents-container'\" [listenToHost]=\"false\"\n (closeToEnd)=\"requestMoreDataZoned($event)\">\n\n <!-- (scrolling)=\"onScrolling($event)\" -->\n\n <div\n *cdkVirtualFor=\"let row of dataRows$; trackBy: trackByIndex; templateCacheSize: 50\"\n class=\"elder-grid-tile-row\"\n [style.height]=\"itemHeight + 'px'\">\n\n <ng-container *ngFor=\"let tile of row; trackBy: trackByFn\">\n\n <!-- Tile Cell -->\n <div *ngIf=\"showTile(tile)\" class=\"elder-grid-tile\"
|
|
13286
|
+
template: "<div fxLayout=\"column\" class=\"scroll-fix\" fxFill>\n\n <!-- Grid Browser -->\n <div fxLayout=\"column\" fxFlex\n class=\"scroll-fix elder-grid-container\"\n *ngIf=\"dataContext$ | async as data\"\n [class.elder-mat-table-container]=\"!embedded\"\n [class.mat-elevation-z5]=\"float\"\n [class.elder-mat-table-flat]=\"!embedded && !float\"\n\n [elderDataContextSelection]=\"data\" #dataSelection=\"elderDataContextSelection\"\n [elderDataContextSelectionModel]=\"selectionModel\"\n >\n\n <!-- Toolbar Row -->\n <div *ngIf=\"toolbarVisible\"\n fxLayout=\"row\" fxLayoutAlign=\"start center\" fxFlex=\"none\" class=\"elder-grid-toolbar\">\n\n <div fxLayout=\"column\" fxFlex=\"none\" style=\"padding-left: 8px; padding-right: 8px\" *ngIf=\"selectionVisible\">\n <elder-selection-master-checkbox fxFlex=\"none\" style=\"padding-left: 12px\"></elder-selection-master-checkbox>\n </div>\n\n <!-- Toolbar -->\n <ng-container *ngIf=\"toolbarTemplate\">\n <ng-template *ngTemplateOutlet=\"toolbarTemplate; context: {$implicit: this}\"></ng-template>\n </ng-container>\n\n <elder-single-sort *ngIf=\"availableSorts && availableSorts.length > 0 && data.sort.sorts | async as sorts\"\n fxFlex=\"none\"\n [availableSorts]=\"availableSorts\"\n [translationPrefix]=\"sortTranslationPrefix\"\n [sort]=\"sorts[0]\"\n (sortChange)=\"updateSort($event)\">\n </elder-single-sort>\n\n </div>\n\n <mat-divider *ngIf=\"toolbarVisible\"></mat-divider>\n\n <span class=\"elder-table-hint mat-body-1\" fxFlex fxLayoutAlign=\"center center\"\n *ngIf=\"!dataContext?.isStarted\">\n {{'Datacontext not started' | translate}}\n </span>\n\n <div *ngIf=\"(dataContext?.data | async)?.isStarted\" fxFlex fxLayoutAlign=\"center center\">\n\n <span class=\"elder-table-hint mat-body-1\"\n *ngIf=\"(dataContext?.data | async)?.length === 0 && !(dataContext?.status | async)?.hasError\">\n {{'No data available' | translate}}\n </span>\n\n <div *ngIf=\"(dataContext?.status | async)?.hasError\"\n fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"20px\">\n <mat-icon color=\"warn\">warning</mat-icon>\n <span class=\"hint mat-body-1\">{{'Error while loading data' | translate}}</span>\n </div>\n\n </div>\n\n <!-- [cdkDropListSortingDisabled]=\"true\" -->\n <!-- cdkDropList -->\n <cdk-virtual-scroll-viewport\n class=\"elder-grid-browser\" fxLayout=\"column\" fxFlex\n id=\"documents-container\"\n [itemSize]=\"itemHeight\"\n [minBufferPx]=\"itemHeight * 2\"\n [maxBufferPx]=\"itemHeight * 3\"\n #virtualScrollViewPort\n infiniteScroll\n [eventThrottle]=\"200\"\n [offsetFactor]=\"2\"\n [ignoreScrollEvent]=\"data.loading | async\"\n [containerId]=\"'documents-container'\" [listenToHost]=\"false\"\n (closeToEnd)=\"requestMoreDataZoned($event)\">\n\n <!-- (scrolling)=\"onScrolling($event)\" -->\n\n <div\n *cdkVirtualFor=\"let row of dataRows$; trackBy: trackByIndex; templateCacheSize: 50\"\n class=\"elder-grid-tile-row\"\n [style.height]=\"itemHeight + 'px'\">\n\n <ng-container *ngFor=\"let tile of row; trackBy: trackByFn\">\n\n <!-- Tile Cell -->\n <div *ngIf=\"showTile(tile)\" class=\"elder-grid-tile\">\n <!-- cdkDrag [cdkDragDisabled]=\"true\" [cdkDragData]=\"tile\" -->\n <!-- <div class=\"tile-placeholder\" *cdkDragPlaceholder></div> -->\n <div class=\"elder-grid-tile-content\"\n (click)=\"onItemClick(tile)\"\n (dblclick)=\"onItemDoubleClick(tile)\">\n <ng-container\n *ngTemplateOutlet=\"tileTemplate || simpleTileTemplate; context: {$implicit: tile}\">\n </ng-container>\n\n <!-- Overlay (Selection) -->\n <ng-container *ngIf=\"selectionVisible\">\n <div *ngIf=\"selectionModel.selection | async as selection\"\n class=\"elder-grid-tile-overlay\"\n [class.elder-grid-tile-overlay-hidden]=\"!inSelectionMode(selection)\"\n [class.elder-grid-tile-overlay-visible]=\"inSelectionMode(selection)\"\n [class.elder-click-through]=\"true\"\n >\n <button mat-icon-button type=\"button\"\n (click)=\"selectionModel.toggle(tile)\" elderStopEventPropagation\n class=\"elder-grid-tile-check\">\n <mat-icon\n [class.elder-selected]=\"(selectionModel.observeSelection(tile) | async)\"\n >\n {{(selectionModel.observeSelection(tile) | async) ? 'check_circle' : 'radio_button_unchecked'}}\n </mat-icon>\n </button>\n </div>\n </ng-container>\n\n </div>\n </div>\n\n <div *ngIf=\"!showTile(tile)\" class=\"elder-grid-tile-hidden\"></div>\n </ng-container>\n\n </div>\n\n </cdk-virtual-scroll-viewport>\n\n\n <mat-progress-bar fxFlex=\"none\"\n [mode]=\"(data?.loading | async) ? 'indeterminate' : 'determinate'\"\n [color]=\"(data && (data.status | async)?.hasError) ? 'warn' : 'primary'\">\n </mat-progress-bar>\n\n <!-- Footer -->\n <div class=\"elder-grid-footer\" *ngIf=\"footerVisible\"\n fxLayout=\"row\" fxFlex=\"none\" fxLayoutAlign=\"end center\" fxLayoutGap=\"10px\"\n style=\"padding-right: 10px\">\n\n <!-- Continuable -->\n <ng-container *ngIf=\"isContinuable\">\n <span class=\"mat-caption noselect\" style=\"color: gray\">\n {{(dataSnapshot?.data | async)?.length}} / {{total$ | async}}\n </span>\n\n <button mat-icon-button type=\"button\"\n color=\"primary\"\n [disabled]=\"!(canLoadMore$ | async)\"\n (click)=\"dataSnapshot.loadMore()\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n </ng-container>\n\n <!-- Paged -->\n <mat-paginator #matPaginator *ngIf=\"isActivePaged && (dataActivePaged.page | async) as page\"\n fxFlex=\"none\"\n [length]=\"dataContext?.total | async\"\n [pageIndex]=\"page?.index\"\n [pageSize]=\"page?.size\"\n [pageSizeOptions]=\"pageSizeOptions\">\n </mat-paginator>\n\n <!-- Local Source -->\n <ng-container *ngIf=\"!isActivePaged && !isContinuable\">\n <span class=\"mat-caption noselect\" style=\"color: gray\">\n {{(dataSnapshot?.data | async)?.length}}\n </span>\n </ng-container>\n\n </div>\n\n\n </div>\n</div>\n\n<ng-template #simpleTileTemplate let-tile>\n <div *ngIf=\"tile\" fxLayout=\"column\" fxFlex fxLayoutAlign=\"center center\" style=\"background-color: lightblue\">\n <p class=\"noselect\">Tile: {{tile}}</p>\n </div>\n</ng-template>\n",
|
|
13064
13287
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13065
13288
|
providers: [
|
|
13066
13289
|
{
|
|
@@ -13088,11 +13311,9 @@ ElderGridComponent.propDecorators = {
|
|
|
13088
13311
|
hiddenField: [{ type: Input }],
|
|
13089
13312
|
idField: [{ type: Input }],
|
|
13090
13313
|
selectionVisible: [{ type: Input }],
|
|
13091
|
-
interactionMode: [{ type: Input }],
|
|
13092
13314
|
pageSizeOptions: [{ type: Input }],
|
|
13093
13315
|
matPaginator: [{ type: ViewChild, args: [MatPaginator,] }],
|
|
13094
13316
|
toolbarTemplateQuery: [{ type: ContentChild, args: [ElderGridToolbarDirective, { read: TemplateRef, static: true },] }],
|
|
13095
|
-
itemClick: [{ type: Output }],
|
|
13096
13317
|
tileTemplate: [{ type: Input }],
|
|
13097
13318
|
toolbarTemplate: [{ type: Input }],
|
|
13098
13319
|
data: [{ type: Input }],
|
|
@@ -21795,7 +22016,7 @@ class ElderAuditedEntityComponent {
|
|
|
21795
22016
|
ElderAuditedEntityComponent.decorators = [
|
|
21796
22017
|
{ type: Component, args: [{
|
|
21797
22018
|
selector: 'elder-audited-entity',
|
|
21798
|
-
template: "<section [fxLayout]=\"layout\" fxLayoutGap=\"8px\" *ngIf=\"auditedCtx$ | async as ctx\">\n\n <mat-form-field class=\"elder-std-form-field\" [appearance]=\"appearance\">\n <mat-icon class=\"decent noselect\"
|
|
22019
|
+
template: "<section [fxLayout]=\"layout\" fxLayoutGap=\"8px\" *ngIf=\"auditedCtx$ | async as ctx\">\n\n <mat-form-field class=\"elder-std-form-field\" [appearance]=\"appearance\">\n <mat-label fxLayoutAlign=\"start center\" fxLayoutGap=\"4px\">\n <mat-icon class=\"decent noselect\" inline>add_circle_outline</mat-icon>\n <span>{{'context.createdAt' | translate}} {{ctx.audited?.createdAt | timeAgo}}</span>\n </mat-label>\n <input matInput name=\"created\"\n [value]=\"ctx.audited?.createdAt | date:'dd.MM.yyyy hh:mm'\"\n readonly>\n <mat-hint>{{ctx.audited?.createdBy}}</mat-hint>\n </mat-form-field>\n\n <mat-form-field class=\"elder-std-form-field\" [appearance]=\"appearance\">\n <mat-label fxLayoutAlign=\"start center\" fxLayoutGap=\"4px\">\n <mat-icon class=\"decent noselect\">mode_edit_outline</mat-icon>\n <span>{{'context.modifiedAt' | translate}} {{ctx.audited?.modifiedAt | timeAgo}}</span>\n </mat-label>\n <input matInput name=\"modified\"\n [value]=\"ctx.audited?.modifiedAt | date:'dd.MM.yyyy hh:mm'\"\n readonly>\n <mat-hint>{{ctx.audited?.modifiedBy}}</mat-hint>\n </mat-form-field>\n\n</section>\n",
|
|
21799
22020
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21800
22021
|
styles: [".decent{opacity:.5}\n"]
|
|
21801
22022
|
},] }
|
|
@@ -22501,5 +22722,5 @@ KafentModule.decorators = [
|
|
|
22501
22722
|
* Generated bundle index. Do not edit.
|
|
22502
22723
|
*/
|
|
22503
22724
|
|
|
22504
|
-
export { AuditedEntity, BlobUrl, BytesFormat, BytesPerSecondFormat, BytesPipe, CardDropEvent, CardOrganizerData, CardStack, CollectionUtil, ComparatorBuilder, ConfirmDialogConfig, ContinuableListing, CsvColumnSpec, CsvSerializer, CsvSpec, CsvStreamExporter, CsvStreamExporterBuilder, CsvStreamExporterBuilderService, Currency, CurrencyCode, CurrencyUnit, CurrencyUnitRegistry, CustomDateAdapter, DataContextActivePage, DataContextBase, DataContextBuilder, DataContextContinuableBase, DataContextContinuablePaged, DataContextContinuableToken, DataContextSelectionDirective, DataContextSimple, DataContextSnapshot, DataContextStatus, DataSourceAdapter, DataSourceProcessor,
|
|
22725
|
+
export { AuditedEntity, AutoStartSpec, BlobUrl, BytesFormat, BytesPerSecondFormat, BytesPipe, CardDropEvent, CardOrganizerData, CardStack, CollectionUtil, ComparatorBuilder, ConfirmDialogConfig, ContinuableListing, CsvColumnSpec, CsvSerializer, CsvSpec, CsvStreamExporter, CsvStreamExporterBuilder, CsvStreamExporterBuilderService, Currency, CurrencyCode, CurrencyUnit, CurrencyUnitRegistry, CustomDateAdapter, DataContextActivePage, DataContextAutoStarter, DataContextBase, DataContextBuilder, DataContextContinuableBase, DataContextContinuablePaged, DataContextContinuableToken, DataContextLifeCycleBinding, DataContextSelectionDirective, DataContextSimple, DataContextSnapshot, DataContextSourceAutoReloader, DataContextStatus, DataSourceAdapter, DataSourceProcessor, DataTransferFactory, DataTransferProgress, DataTransferProgressAggregate, DataTransferState, DataTransferStatus, DateUtil, DelegateContinuableDataSource, DelegateDataSource, DelegateListDataSource, DelegatePagedDataSource, Dimensions, DrawerOutletBinding, DurationBucket, DurationFormat, EbsCommonDialogService, EbsToastService, ElderAccessDeniedComponent, ElderAccessDeniedModule, ElderAppHeaderComponent, ElderAuditModule, ElderAuditedEntityComponent, ElderAutocompleteComponent, ElderAutocompleteDirective, ElderAutocompleteModule, ElderBlobViewerComponent, ElderBreadCrumbsComponent, ElderBreadCrumbsModule, ElderButtonGroupComponent, ElderButtonGroupModule, ElderCardComponent, ElderCardContentDirective, ElderCardHeaderActionsDirective, ElderCardHeaderComponent, ElderCardModule, ElderCardOrganizerComponent, ElderCardOrganizerModule, ElderCardPanelComponent, ElderCardStackComponent, ElderCardSubtitleDirective, ElderCardTitleDirective, ElderChipListSelectComponent, ElderChipListSelectModule, ElderClipboardPutDirective, ElderClipboardService, ElderConfirmDialogComponent, ElderConnectivityModule, ElderConnectivityService, ElderContainersModule, ElderCsvExportBtnComponent, ElderCsvModule, ElderCurrencyModule, ElderCurrencyPipe, ElderDataCommonModule, ElderDataToolbarComponent, ElderDataTransferModule, ElderDataTransferService, ElderDataViewBaseComponent, ElderDataViewBaseModule, ElderDataViewSelectionMode, ElderDateSwitcherComponent, ElderDateTimeInputComponent, ElderDatesModule, ElderDelayedFocusDirective, ElderDialogConfig, ElderDialogModule, ElderDialogService, ElderDimensionsInputComponent, ElderDurationInputComponent, ElderEnumTranslationService, ElderErrorModule, ElderEventSourceService, ElderExceptionDetailComponent, ElderExpandToggleButtonComponent, ElderExpandToggleButtonModule, ElderFileDropZoneDirective, ElderFileModule, ElderFileSelectComponent, ElderFileSelectDirective, ElderFileUploadComponent, ElderFormFieldDenseDirective, ElderFormFieldLabelDirective, ElderFormFieldNoSpinnerDirective, ElderFormsDirectivesModule, ElderFormsModule, ElderGlobalSearchComponent, ElderGlobalSearchModule, ElderGlobalSearchService, ElderGridComponent, ElderGridModule, ElderGridTileDirective, ElderGridToolbarDirective, ElderHeaderComponent, ElderHeaderModule, ElderHttpClient, ElderI18nEntitiesModule, ElderIFrameModule, ElderInfiniteAutocompleteDirective, ElderInfiniteScrollDirective, ElderInfiniteScrollLegacyDirective, ElderInfiniteScrollModule, ElderIntervalInputComponent, ElderKeyEventDirective, ElderLabelInputComponent, ElderLabelsModule, ElderLanguageConfig, ElderLanguageInterceptor, ElderLanguageModule, ElderLanguageService, ElderLanguageSwitcherComponent, ElderLocalDateInputComponent, ElderLocalTimeInputComponent, ElderLocalesDeChModule, ElderLocalizedInputComponent, ElderLocalizedInputDialogComponent, ElderLocalizedInputDialogService, ElderLocalizedInputTableComponent, ElderLocalizedTextColumnDirective, ElderLocalizedTextsDirective, ElderMaxDirective, ElderMeasuresModule, ElderMinDirective, ElderMultiAutoCompleteModule, ElderMultiAutocompleteComponent, ElderMultiSelectBase, ElderMultiSelectChipsComponent, ElderMultipleOfValidator, ElderNavGroupComponent, ElderNavLinkComponent, ElderNavListComponent, ElderNavModule, ElderNextFocusableDirective, ElderNumberCellDirective, ElderOfflineIndicatorComponent, ElderOverlayComponent, ElderOverlayModule, ElderOverlayOriginDirective, ElderOverlayTriggerDirective, ElderPaddingDirective, ElderPanelComponent, ElderPanelModule, ElderPeriodInputComponent, ElderPipesModule, ElderPlugParentFormDirective, ElderPlugParentFormDirectiveLegacy, ElderProgressBarComponent, ElderProgressBarModule, ElderQuantityInputComponent, ElderQuantityModule, ElderQuantityPipe, ElderQuantityService, ElderQuantityTransformPipe, ElderQuestionDialogComponent, ElderRepeatPipe, ElderRepeatPipeLegacy, ElderRequiredIgnoreZeroValidator, ElderRoundPipe, ElderRouteOutletDrawerService, ElderRouterOutletService, ElderSafeUrlPipe, ElderScrollContainerComponent, ElderSearchBoxComponent, ElderSearchContextDirective, ElderSearchInputDirective, ElderSearchModule, ElderSearchPanelComponent, ElderSelectChipDirective, ElderSelectComponent, ElderSelectListComponent, ElderSelectListItemComponent, ElderSelectListModule, ElderSelectModule, ElderSelectValueDirective, ElderSelectionDialogComponent, ElderSelectionDialogDirective, ElderSelectionMasterCheckboxComponent, ElderShellCenterDirective, ElderShellComponent, ElderShellModule, ElderShellNavigationToggleComponent, ElderShellService, ElderShellSideLeftDirective, ElderShellSideRightDirective, ElderShellSlotDirective, ElderSimpleSelectionViewComponent, ElderSimpleSelectionViewModule, ElderSingleSortComponent, ElderStackCardDirective, ElderStopEventPropagationDirective, ElderStopEventPropagationDirectiveLegacy, ElderSvgViewerComponent, ElderTabFocusTrapDirective, ElderTableActivationDirective, ElderTableComponent, ElderTableExtensionDirective, ElderTableGroup, ElderTableModel, ElderTableModelCdkTableBinding, ElderTableModelQueryGroup, ElderTableModule, ElderTableProviders, ElderTableRootDirective, ElderTableSortDirective, ElderTableToolbarDirective, ElderTimeModule, ElderToastModule, ElderToastService, ElderToolbarColumnDirective, ElderToolbarComponent, ElderToolbarContentDirective, ElderToolbarModule, ElderToolbarService, ElderToolbarTitleComponent, ElderToolbarTitleService, ElderTouchedDirective, ElderTouchedDirectiveLegacy, ElderUnitSelectDirective, ElderUnitService, ElderUrlFragment, ElderUrlFragmentModule, ElderUrlFragmentSwitcherComponent, ElderViewersModule, ExceptionDetailCtx, FileUploadClient, Filter, FilterContext, FilterUtil, FormFieldBaseComponent, HttpClientBuilder, HttpClientPristine, HttpDataTransfer, HttpDataTransferAggregateComponent, HttpDataTransferComponent, HttpDataTransferIndicatorComponent, HttpDataTransferOverviewComponent, HttpParamsBuilder, I18nBase, I18nPickAsyncPipe, I18nPickPipe, I18nText, IFrameState, IframeCloseDirective, IframeDialogComponent, IframeHostComponent, IframeService, IframeSideContentComponent, InternalRestClientConfig, Interval, IsoDurationPipe, IsoIntervalParsePipe, IsoIntervalPipe, KafentConfig, KafentEvent, KafentEventService, KafentEventStream, KafentEventStreamDisabled, KafentEventStreamSse, KafentEventTransport, KafentModule, KafentSseEventChannel, KafentTokenProvider, KafentTokenProviderSessionStorage, KafentTopicSse, KnownLocaleType, LazyBehaviorSubject, LocalListDataSource, LocalPagedDataSource, LocalisationPickerService, MasterSelectionState, MatTableDataContextBinding, MatTableDataContextBindingBuilder, MultiModelBaseComponent, NextNumberUtil, Objects, OnlineStatus, Page, PageRequest, Pageable, ParseUtil, Path, PathNode, PeriodBucket, PeriodDuration, PeriodFormat, ProcessIterationContext, ProcessState, PropertyPathUtil, Quantity, QueryListBinding, QuestionDialogConfig, ReactiveEventSource, ReactiveMap, RefreshingEntity, ReplacementResult, RestClient, RestClientConfig, RestClientContinuable, RestClientList, RestClientPaged, SearchQuery, SelectOnTabDirective, SelectionModel, SelectionModelPopupDirective, Sets, SimpleLocalisationPicker, Sort, SortOption, SortUtil, SubBar, SuggestionProvider, TemplateCompositeControl, TemplatedSelectionDialogComponent, TextRange, TimeAgoPipe, TimeDurationPipe, TimeUtil, ToastService, ToastType, TokenChunkRequest, ToolbarHeader, TranslatedEnumValue, Unit, UnitDimension, UnitDimensionInfo, UnitInfo, UnitRegistry, UrlBuilder, UuidUtil, ValueAccessorBase, ValueWrapper, ViewProviders, WeightPipe, WordPositionFinder, alphaNumStringComparator, buildFormIntegrationProviders, existingOrNewElderTableModel, isActivePagedDataContext, isContinuableDataContext, isContinuableDataSource, isDataContext, isDataSource, isListDataSource, isPagedDataSource, naturalValueComparator, newElderTableModel, proxyControlContainer, registerLocale, runInZone, ElderPanelComponentBase as ɵa, _ElderPanelMixinBase as ɵb, provideForm as ɵc, createSelectionModel as ɵd, createDataViewSelection as ɵe, ELDER_DATA_VIEW as ɵf, DataContextStateIndicatorComponent as ɵh, ElderTripleStateCheckboxDirective as ɵi, ElderTableColumnDirective as ɵj, ElderTableRowDirective as ɵk, ElderPaginatorIntl as ɵl, StandardToastComponent as ɵm, ElderSelectBase as ɵn };
|
|
22505
22726
|
//# sourceMappingURL=elderbyte-ngx-starter.js.map
|