@mediusinc/mng-commons 0.15.1 → 0.16.0
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/esm2020/lib/components/action/action.component.mjs +7 -7
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +41 -20
- package/esm2020/lib/components/action/route/action-route.component.mjs +3 -3
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +29 -29
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +13 -15
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +5 -5
- package/esm2020/lib/components/tableview/table/table.component.mjs +1 -1
- package/esm2020/lib/components/tableview/tableview.component.mjs +16 -14
- package/esm2020/lib/descriptors/action.descriptor.mjs +19 -12
- package/esm2020/lib/descriptors/editor.descriptor.mjs +5 -8
- package/esm2020/lib/descriptors/field.descriptor.mjs +2 -2
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +32 -32
- package/esm2020/lib/descriptors/types/editor.type.mjs +8 -8
- package/esm2020/lib/models/view-container.model.mjs +1 -1
- package/esm2020/lib/router/tableview-route-builder.mjs +2 -2
- package/esm2020/lib/security/model/permissions.model.mjs +1 -9
- package/esm2020/lib/services/view-container.component.service.mjs +21 -8
- package/fesm2015/mediusinc-mng-commons.mjs +543 -511
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +542 -512
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/components/action/editor/action-editor.component.d.ts +1 -2
- package/lib/components/form/editor/form-editor.component.d.ts +1 -1
- package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +0 -3
- package/lib/components/tableview/tableview.component.d.ts +2 -2
- package/lib/descriptors/action.descriptor.d.ts +6 -4
- package/lib/descriptors/editor.descriptor.d.ts +5 -6
- package/lib/descriptors/tableview.descriptor.d.ts +5 -5
- package/lib/descriptors/types/editor.type.d.ts +2 -2
- package/lib/models/view-container.model.d.ts +31 -0
- package/lib/router/tableview-route-builder.d.ts +1 -1
- package/lib/security/model/permissions.model.d.ts +0 -7
- package/lib/services/view-container.component.service.d.ts +12 -6
- package/package.json +1 -1
- package/scss/mng-overrides/_layout_dialog.scss +1 -0
- package/version-info.json +5 -5
|
@@ -74,7 +74,7 @@ import * as i6$2 from 'primeng/toolbar';
|
|
|
74
74
|
import { ToolbarModule } from 'primeng/toolbar';
|
|
75
75
|
import * as i7 from 'primeng/tooltip';
|
|
76
76
|
import { TooltipModule } from 'primeng/tooltip';
|
|
77
|
-
import { isObservable, throwError,
|
|
77
|
+
import { isObservable, throwError, BehaviorSubject, Subject, ReplaySubject, distinctUntilChanged, of, combineLatest, tap, switchMap, mergeMap as mergeMap$1, from, Observable, merge, debounceTime } from 'rxjs';
|
|
78
78
|
import { map, mergeMap, catchError, first, filter, finalize, startWith } from 'rxjs/operators';
|
|
79
79
|
import 'reflect-metadata';
|
|
80
80
|
import * as i4 from '@angular/platform-browser';
|
|
@@ -589,6 +589,257 @@ DateUtil.NG_PRIME_FORMAT_MAP = {
|
|
|
589
589
|
YYYY: 'yy'
|
|
590
590
|
};
|
|
591
591
|
|
|
592
|
+
class ActionError {
|
|
593
|
+
constructor(error, // error details
|
|
594
|
+
dismissed = false // by user
|
|
595
|
+
) {
|
|
596
|
+
this.error = error;
|
|
597
|
+
this.dismissed = dismissed;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Action execution instance containing data about execution state of action
|
|
602
|
+
*/
|
|
603
|
+
class ActionInstance {
|
|
604
|
+
constructor(action, state = ActionInstanceStateEnum.TriggerStart, debug = false) {
|
|
605
|
+
this.debug = debug;
|
|
606
|
+
// function execution
|
|
607
|
+
this.isRunLoadingSubject = new BehaviorSubject(false);
|
|
608
|
+
this.contexts = [];
|
|
609
|
+
this.executionSubject = new Subject();
|
|
610
|
+
this.executionIsRunningSubject = new BehaviorSubject(false);
|
|
611
|
+
this.stateSubject = new BehaviorSubject(1);
|
|
612
|
+
this.resultSubject = new ReplaySubject(1);
|
|
613
|
+
this.errorSubject = new ReplaySubject(1);
|
|
614
|
+
this.contextExecutionSubscriptions = [];
|
|
615
|
+
this.instanceId = Math.random().toString(36).substring(2);
|
|
616
|
+
this.instanceLongName = `${action.actionNameLong}_${this.instanceId}`;
|
|
617
|
+
this.action = action;
|
|
618
|
+
this.state = state;
|
|
619
|
+
}
|
|
620
|
+
get isRunLoading$() {
|
|
621
|
+
return this.isRunLoadingSubject.asObservable();
|
|
622
|
+
}
|
|
623
|
+
get context() {
|
|
624
|
+
return this.contexts.length === 0 ? undefined : this.contexts[this.contexts.length - 1];
|
|
625
|
+
}
|
|
626
|
+
get execution$() {
|
|
627
|
+
return this.executionSubject.asObservable();
|
|
628
|
+
}
|
|
629
|
+
get executionIsRunning$() {
|
|
630
|
+
return this.executionIsRunningSubject.asObservable().pipe(distinctUntilChanged());
|
|
631
|
+
}
|
|
632
|
+
get state() {
|
|
633
|
+
return this.stateSubject.value;
|
|
634
|
+
}
|
|
635
|
+
set state(state) {
|
|
636
|
+
if (state > this.stateSubject.value) {
|
|
637
|
+
if (this.debug) {
|
|
638
|
+
console.debug(`ActionInstance ${this.instanceLongName} - state #${state}: ${ActionInstanceStateEnum[state]}`);
|
|
639
|
+
}
|
|
640
|
+
this.stateSubject.next(state);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
get state$() {
|
|
644
|
+
return this.stateSubject.asObservable().pipe(distinctUntilChanged());
|
|
645
|
+
}
|
|
646
|
+
get result() {
|
|
647
|
+
return this._result;
|
|
648
|
+
}
|
|
649
|
+
set result(result) {
|
|
650
|
+
if (typeof result === 'undefined') {
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
if (this.debug) {
|
|
654
|
+
console.debug(`ActionInstance ${this.instanceLongName} - result`, result);
|
|
655
|
+
}
|
|
656
|
+
this._result = result;
|
|
657
|
+
this.resultSubject.next(result);
|
|
658
|
+
}
|
|
659
|
+
get result$() {
|
|
660
|
+
return this.resultSubject.asObservable();
|
|
661
|
+
}
|
|
662
|
+
get error() {
|
|
663
|
+
return this._error;
|
|
664
|
+
}
|
|
665
|
+
set error(error) {
|
|
666
|
+
if (typeof error === 'undefined') {
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
if (this.debug) {
|
|
670
|
+
console.debug(`ActionInstance ${this.instanceLongName} - error`, error);
|
|
671
|
+
}
|
|
672
|
+
this._error = error;
|
|
673
|
+
this.errorSubject.next(error);
|
|
674
|
+
}
|
|
675
|
+
get error$() {
|
|
676
|
+
return this.errorSubject.asObservable();
|
|
677
|
+
}
|
|
678
|
+
contextAt(idx) {
|
|
679
|
+
return idx < this.contexts.length ? this.contexts[idx] : undefined;
|
|
680
|
+
}
|
|
681
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
682
|
+
newContext(context, finishPrevious = true) {
|
|
683
|
+
if (this.debug) {
|
|
684
|
+
console.debug(`ActionInstance ${this.instanceLongName} - new context ${context.contextLongName}`);
|
|
685
|
+
}
|
|
686
|
+
const currentContext = this.context;
|
|
687
|
+
if (currentContext) {
|
|
688
|
+
currentContext.executionComplete();
|
|
689
|
+
}
|
|
690
|
+
this.contextExecutionSubscriptions.forEach(s => s.unsubscribe());
|
|
691
|
+
this.contextExecutionSubscriptions = [];
|
|
692
|
+
this.contextExecutionSubscriptions.push(context.execution$.subscribe({
|
|
693
|
+
next: next => this.executionSubject.next(next),
|
|
694
|
+
error: error => this.executionSubject.error(error)
|
|
695
|
+
}));
|
|
696
|
+
this.contextExecutionSubscriptions.push(context.executionIsRunning$.subscribe({
|
|
697
|
+
next: next => this.executionIsRunningSubject.next(next)
|
|
698
|
+
}));
|
|
699
|
+
this.contexts.push(context);
|
|
700
|
+
}
|
|
701
|
+
finish() {
|
|
702
|
+
if (this.stateSubject.value < ActionInstanceStateEnum.FinishSuccess) {
|
|
703
|
+
this.state = ActionInstanceStateEnum.FinishSuccess;
|
|
704
|
+
}
|
|
705
|
+
// complete all subjects
|
|
706
|
+
this.contexts.forEach(c => c.finish());
|
|
707
|
+
this.executionSubject.complete();
|
|
708
|
+
this.executionIsRunningSubject.complete();
|
|
709
|
+
this.stateSubject.complete();
|
|
710
|
+
this.resultSubject.complete();
|
|
711
|
+
this.errorSubject.complete();
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Class containing all main data for action to be executed in run/fetch/submit states.
|
|
716
|
+
*/
|
|
717
|
+
class ActionContext {
|
|
718
|
+
constructor(instance, parameters, functionName, dataProvider, serviceInstance, executionSubject = new ReplaySubject(1), executionIsRunningSubject = new BehaviorSubject(false)) {
|
|
719
|
+
this.instance = instance;
|
|
720
|
+
this.parameters = parameters;
|
|
721
|
+
this.functionName = functionName;
|
|
722
|
+
this.dataProvider = dataProvider;
|
|
723
|
+
this.serviceInstance = serviceInstance;
|
|
724
|
+
this.executionSubject = executionSubject;
|
|
725
|
+
this.executionIsRunningSubject = executionIsRunningSubject;
|
|
726
|
+
this.contextLongName = `${this.instance.instanceLongName}_${functionName}`;
|
|
727
|
+
}
|
|
728
|
+
get execution$() {
|
|
729
|
+
return this.executionSubject.asObservable();
|
|
730
|
+
}
|
|
731
|
+
get executionIsRunning$() {
|
|
732
|
+
return this.executionIsRunningSubject.asObservable().pipe(distinctUntilChanged());
|
|
733
|
+
}
|
|
734
|
+
executionStart() {
|
|
735
|
+
if (this.instance.debug) {
|
|
736
|
+
console.debug(`ActionContext ${this.contextLongName} - execution start`);
|
|
737
|
+
}
|
|
738
|
+
this.executionIsRunningSubject.next(true);
|
|
739
|
+
}
|
|
740
|
+
executionNext(next, finish = true) {
|
|
741
|
+
if (this.instance.debug) {
|
|
742
|
+
console.debug(`ActionContext ${this.contextLongName} - execution next event`, next, finish);
|
|
743
|
+
}
|
|
744
|
+
this.executionSubject.next(next);
|
|
745
|
+
if (finish) {
|
|
746
|
+
this.executionComplete();
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
executionComplete() {
|
|
750
|
+
if (this.instance.debug) {
|
|
751
|
+
console.debug(`ActionContext ${this.contextLongName} - execution complete`);
|
|
752
|
+
}
|
|
753
|
+
this.executionSubject.complete();
|
|
754
|
+
this.executionIsRunningSubject.next(false);
|
|
755
|
+
}
|
|
756
|
+
executionError(err) {
|
|
757
|
+
if (this.instance.debug) {
|
|
758
|
+
console.debug(`ActionContext ${this.contextLongName} - execution error`, err);
|
|
759
|
+
}
|
|
760
|
+
this.executionSubject.error(err);
|
|
761
|
+
this.executionIsRunningSubject.next(false);
|
|
762
|
+
}
|
|
763
|
+
finish() {
|
|
764
|
+
this.executionSubject.complete();
|
|
765
|
+
this.executionIsRunningSubject.complete();
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Class containing all main data for action validations (enabled/visible) to be executed in validation states.
|
|
770
|
+
*/
|
|
771
|
+
class ActionContextValidation {
|
|
772
|
+
constructor(descriptor, parameters, dataProvider, serviceInstance) {
|
|
773
|
+
this.descriptor = descriptor;
|
|
774
|
+
this.parameters = parameters;
|
|
775
|
+
this.dataProvider = dataProvider;
|
|
776
|
+
this.serviceInstance = serviceInstance;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
class ActionParameters {
|
|
780
|
+
constructor(itemId, item) {
|
|
781
|
+
this.itemId = itemId;
|
|
782
|
+
this.item = item;
|
|
783
|
+
this.selectedItems = [];
|
|
784
|
+
}
|
|
785
|
+
withActionData(actionData) {
|
|
786
|
+
this.actionData = actionData;
|
|
787
|
+
return this;
|
|
788
|
+
}
|
|
789
|
+
withQueryParam(queryParam) {
|
|
790
|
+
this.queryParam = queryParam;
|
|
791
|
+
return this;
|
|
792
|
+
}
|
|
793
|
+
withViewContainer(viewContainer) {
|
|
794
|
+
this.viewContainer = viewContainer;
|
|
795
|
+
return this;
|
|
796
|
+
}
|
|
797
|
+
withSourceComponent(sourceComponent) {
|
|
798
|
+
this.sourceComponent = sourceComponent;
|
|
799
|
+
return this;
|
|
800
|
+
}
|
|
801
|
+
withRoute(route) {
|
|
802
|
+
this.route = route;
|
|
803
|
+
return this;
|
|
804
|
+
}
|
|
805
|
+
withSelectedItems(selectedItems) {
|
|
806
|
+
this.selectedItems = selectedItems;
|
|
807
|
+
return this;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
var ActionInstanceStateEnum;
|
|
811
|
+
(function (ActionInstanceStateEnum) {
|
|
812
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["TriggerStart"] = 0] = "TriggerStart";
|
|
813
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["TriggerEnd"] = 1] = "TriggerEnd";
|
|
814
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["ActivationStart"] = 2] = "ActivationStart";
|
|
815
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["ActivationEnd"] = 3] = "ActivationEnd";
|
|
816
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FetchStart"] = 4] = "FetchStart";
|
|
817
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FetchEnd"] = 5] = "FetchEnd";
|
|
818
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FetchError"] = 6] = "FetchError";
|
|
819
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["RunConfirmationStart"] = 7] = "RunConfirmationStart";
|
|
820
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["RunConfirmationEndAccept"] = 8] = "RunConfirmationEndAccept";
|
|
821
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["RunConfirmationEndReject"] = 9] = "RunConfirmationEndReject";
|
|
822
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["RunStart"] = 10] = "RunStart";
|
|
823
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["RunEnd"] = 11] = "RunEnd";
|
|
824
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["RunError"] = 12] = "RunError";
|
|
825
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["NextActionStart"] = 13] = "NextActionStart";
|
|
826
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["NextActionEnd"] = 14] = "NextActionEnd";
|
|
827
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishSuccess"] = 15] = "FinishSuccess";
|
|
828
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishError"] = 16] = "FinishError";
|
|
829
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishDismissed"] = 17] = "FinishDismissed"; // action was dismissed by user
|
|
830
|
+
})(ActionInstanceStateEnum || (ActionInstanceStateEnum = {}));
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* Default categories for tableview actions
|
|
834
|
+
*/
|
|
835
|
+
class TableviewActionDefaultCategories {
|
|
836
|
+
}
|
|
837
|
+
TableviewActionDefaultCategories.READ = 'read';
|
|
838
|
+
TableviewActionDefaultCategories.ADD = 'add';
|
|
839
|
+
TableviewActionDefaultCategories.EDIT = 'edit';
|
|
840
|
+
TableviewActionDefaultCategories.DELETE = 'delete';
|
|
841
|
+
TableviewActionDefaultCategories.DETAILS = 'details';
|
|
842
|
+
|
|
592
843
|
class DataProvider {
|
|
593
844
|
constructor(modelType, serviceType) {
|
|
594
845
|
this._modelType = modelType;
|
|
@@ -703,143 +954,41 @@ class DynamicTableviewDataProvider extends TableviewDataProvider {
|
|
|
703
954
|
this._fetch = () => of({});
|
|
704
955
|
}
|
|
705
956
|
withGetAll(getAll) {
|
|
706
|
-
this._getAll = getAll;
|
|
707
|
-
return this;
|
|
708
|
-
}
|
|
709
|
-
withFetch(fetch) {
|
|
710
|
-
this._fetch = fetch;
|
|
711
|
-
return this;
|
|
712
|
-
}
|
|
713
|
-
get getAll() {
|
|
714
|
-
return this._getAll;
|
|
715
|
-
}
|
|
716
|
-
get fetch() {
|
|
717
|
-
return this._fetch;
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
class TableviewCrudDataProvider extends TableviewDataProvider {
|
|
722
|
-
constructor(modelType, serviceType, idPropertyName, useGetAllForFetch = false) {
|
|
723
|
-
var _a;
|
|
724
|
-
super(modelType, serviceType);
|
|
725
|
-
this.withGetAll((queryParam, service) => service.getAllPost(queryParam));
|
|
726
|
-
if (useGetAllForFetch) {
|
|
727
|
-
const selectedIdPropertyName = (_a = idPropertyName !== null && idPropertyName !== void 0 ? idPropertyName : ModelUtil.findIdAttribute(modelType)) !== null && _a !== void 0 ? _a : 'id';
|
|
728
|
-
this.withFetch((id, service) => {
|
|
729
|
-
const qp = MediusQueryParamBuilder.create(10, 0).withFilter(selectedIdPropertyName, id, id, MediusFilterMatchType.Equals, true).build();
|
|
730
|
-
return service.getAllPost(qp).pipe(map(res => res.pageData[0]));
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
else {
|
|
734
|
-
this.withFetch((id, service) => service.getByIdGet(id));
|
|
735
|
-
}
|
|
736
|
-
this.withCreate((item, service) => service.createPost(item));
|
|
737
|
-
this.withUpdate((id, item, service) => service.updatePut(id, item));
|
|
738
|
-
this.withDelete((id, item, service) => service.removeDelete(id, item));
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
var AuthorizationTypeEnum;
|
|
743
|
-
(function (AuthorizationTypeEnum) {
|
|
744
|
-
AuthorizationTypeEnum["All"] = "ALL";
|
|
745
|
-
AuthorizationTypeEnum["Any"] = "ANY";
|
|
746
|
-
AuthorizationTypeEnum["Rbac"] = "ROLE_BASED_ACCESS_CONTROL";
|
|
747
|
-
AuthorizationTypeEnum["Service"] = "SERVICE";
|
|
748
|
-
})(AuthorizationTypeEnum || (AuthorizationTypeEnum = {}));
|
|
749
|
-
|
|
750
|
-
class APermissions {
|
|
751
|
-
constructor(type) {
|
|
752
|
-
this._authorizationType = type;
|
|
753
|
-
}
|
|
754
|
-
get authorizationType() {
|
|
755
|
-
return this._authorizationType;
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
var Permissions;
|
|
759
|
-
(function (Permissions) {
|
|
760
|
-
class All extends APermissions {
|
|
761
|
-
constructor() {
|
|
762
|
-
super(AuthorizationTypeEnum.All);
|
|
763
|
-
this._permissions = [];
|
|
764
|
-
}
|
|
765
|
-
static of(...permissions) {
|
|
766
|
-
const inst = new All();
|
|
767
|
-
inst.and(...permissions);
|
|
768
|
-
return inst;
|
|
769
|
-
}
|
|
770
|
-
get permissions() {
|
|
771
|
-
return this._permissions;
|
|
772
|
-
}
|
|
773
|
-
and(...permissions) {
|
|
774
|
-
this._permissions.push(...permissions);
|
|
775
|
-
return this;
|
|
776
|
-
}
|
|
957
|
+
this._getAll = getAll;
|
|
958
|
+
return this;
|
|
777
959
|
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
super(AuthorizationTypeEnum.Any);
|
|
782
|
-
this._permissions = [];
|
|
783
|
-
}
|
|
784
|
-
static of(...permissions) {
|
|
785
|
-
const inst = new Any();
|
|
786
|
-
inst.or(...permissions);
|
|
787
|
-
return inst;
|
|
788
|
-
}
|
|
789
|
-
get permissions() {
|
|
790
|
-
return this._permissions;
|
|
791
|
-
}
|
|
792
|
-
or(...permissions) {
|
|
793
|
-
this._permissions.push(...permissions);
|
|
794
|
-
return this;
|
|
795
|
-
}
|
|
960
|
+
withFetch(fetch) {
|
|
961
|
+
this._fetch = fetch;
|
|
962
|
+
return this;
|
|
796
963
|
}
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
constructor() {
|
|
800
|
-
super(AuthorizationTypeEnum.Rbac);
|
|
801
|
-
this._roles = [];
|
|
802
|
-
}
|
|
803
|
-
static of(...roles) {
|
|
804
|
-
const inst = new Roles();
|
|
805
|
-
inst.or(...roles);
|
|
806
|
-
return inst;
|
|
807
|
-
}
|
|
808
|
-
get roles() {
|
|
809
|
-
return this._roles;
|
|
810
|
-
}
|
|
811
|
-
and(...roles) {
|
|
812
|
-
if (this._roles.length === 0) {
|
|
813
|
-
this._roles.push([]);
|
|
814
|
-
}
|
|
815
|
-
this._roles[this._roles.length - 1].push(...roles);
|
|
816
|
-
return this;
|
|
817
|
-
}
|
|
818
|
-
or(...roles) {
|
|
819
|
-
this._roles.push(...roles.map(s => [s]));
|
|
820
|
-
return this;
|
|
821
|
-
}
|
|
964
|
+
get getAll() {
|
|
965
|
+
return this._getAll;
|
|
822
966
|
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
967
|
+
get fetch() {
|
|
968
|
+
return this._fetch;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
class TableviewCrudDataProvider extends TableviewDataProvider {
|
|
973
|
+
constructor(modelType, serviceType, idPropertyName, useGetAllForFetch = false) {
|
|
974
|
+
var _a;
|
|
975
|
+
super(modelType, serviceType);
|
|
976
|
+
this.withGetAll((queryParam, service) => service.getAllPost(queryParam));
|
|
977
|
+
if (useGetAllForFetch) {
|
|
978
|
+
const selectedIdPropertyName = (_a = idPropertyName !== null && idPropertyName !== void 0 ? idPropertyName : ModelUtil.findIdAttribute(modelType)) !== null && _a !== void 0 ? _a : 'id';
|
|
979
|
+
this.withFetch((id, service) => {
|
|
980
|
+
const qp = MediusQueryParamBuilder.create(10, 0).withFilter(selectedIdPropertyName, id, id, MediusFilterMatchType.Equals, true).build();
|
|
981
|
+
return service.getAllPost(qp).pipe(map(res => res.pageData[0]));
|
|
982
|
+
});
|
|
828
983
|
}
|
|
829
|
-
|
|
830
|
-
|
|
984
|
+
else {
|
|
985
|
+
this.withFetch((id, service) => service.getByIdGet(id));
|
|
831
986
|
}
|
|
987
|
+
this.withCreate((item, service) => service.createPost(item));
|
|
988
|
+
this.withUpdate((id, item, service) => service.updatePut(id, item));
|
|
989
|
+
this.withDelete((id, item, service) => service.removeDelete(id, item));
|
|
832
990
|
}
|
|
833
|
-
|
|
834
|
-
class ActionTypes {
|
|
835
|
-
}
|
|
836
|
-
ActionTypes.READ = 'read';
|
|
837
|
-
ActionTypes.ADD = 'add';
|
|
838
|
-
ActionTypes.EDIT = 'edit';
|
|
839
|
-
ActionTypes.DELETE = 'delete';
|
|
840
|
-
ActionTypes.DETAILS = 'details';
|
|
841
|
-
Permissions.ActionTypes = ActionTypes;
|
|
842
|
-
})(Permissions || (Permissions = {}));
|
|
991
|
+
}
|
|
843
992
|
|
|
844
993
|
var ActionPositionEnum;
|
|
845
994
|
(function (ActionPositionEnum) {
|
|
@@ -878,13 +1027,13 @@ var ColumnTypeEnum;
|
|
|
878
1027
|
ColumnTypeEnum[ColumnTypeEnum["Custom"] = 6] = "Custom";
|
|
879
1028
|
})(ColumnTypeEnum || (ColumnTypeEnum = {}));
|
|
880
1029
|
|
|
881
|
-
var
|
|
882
|
-
(function (
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
})(
|
|
1030
|
+
var TableviewEditorTypeEnum;
|
|
1031
|
+
(function (TableviewEditorTypeEnum) {
|
|
1032
|
+
TableviewEditorTypeEnum[TableviewEditorTypeEnum["None"] = 0] = "None";
|
|
1033
|
+
TableviewEditorTypeEnum[TableviewEditorTypeEnum["Details"] = 1] = "Details";
|
|
1034
|
+
TableviewEditorTypeEnum[TableviewEditorTypeEnum["Edit"] = 2] = "Edit";
|
|
1035
|
+
TableviewEditorTypeEnum[TableviewEditorTypeEnum["Add"] = 3] = "Add";
|
|
1036
|
+
})(TableviewEditorTypeEnum || (TableviewEditorTypeEnum = {}));
|
|
888
1037
|
|
|
889
1038
|
var FieldSizeEnum;
|
|
890
1039
|
(function (FieldSizeEnum) {
|
|
@@ -1475,8 +1624,8 @@ class ActionDescriptor {
|
|
|
1475
1624
|
get permissions() {
|
|
1476
1625
|
return this._permissions;
|
|
1477
1626
|
}
|
|
1478
|
-
get
|
|
1479
|
-
return this.
|
|
1627
|
+
get tableviewCategory() {
|
|
1628
|
+
return this._tableviewCategory;
|
|
1480
1629
|
}
|
|
1481
1630
|
get hasItemsSelection() {
|
|
1482
1631
|
return this._hasItemsSelection;
|
|
@@ -1484,6 +1633,9 @@ class ActionDescriptor {
|
|
|
1484
1633
|
get button() {
|
|
1485
1634
|
return this._button;
|
|
1486
1635
|
}
|
|
1636
|
+
get positionTableviewCategories() {
|
|
1637
|
+
return this._positionTableviewCategories;
|
|
1638
|
+
}
|
|
1487
1639
|
withDataProvider(dataProvider) {
|
|
1488
1640
|
this._dataProvider = dataProvider;
|
|
1489
1641
|
return this;
|
|
@@ -1555,14 +1707,14 @@ class ActionDescriptor {
|
|
|
1555
1707
|
return this;
|
|
1556
1708
|
}
|
|
1557
1709
|
withPermissions(permissions) {
|
|
1558
|
-
if (this.
|
|
1559
|
-
console.warn(`Permissions set on action ${this._actionNameLong} with route type '${this.
|
|
1710
|
+
if (this._tableviewCategory) {
|
|
1711
|
+
console.warn(`Permissions set on action ${this._actionNameLong} with route type '${this._tableviewCategory}' will be omitted in route guard validation.`);
|
|
1560
1712
|
}
|
|
1561
1713
|
this._permissions = permissions;
|
|
1562
1714
|
return this;
|
|
1563
1715
|
}
|
|
1564
|
-
|
|
1565
|
-
this.
|
|
1716
|
+
withTableviewCategory(permissionsRouteType) {
|
|
1717
|
+
this._tableviewCategory = permissionsRouteType;
|
|
1566
1718
|
return this;
|
|
1567
1719
|
}
|
|
1568
1720
|
withButtonDescriptor(button) {
|
|
@@ -1579,6 +1731,10 @@ class ActionDescriptor {
|
|
|
1579
1731
|
this._isEnabledFunction = (_a = this._isEnabledFunction) !== null && _a !== void 0 ? _a : (ctx => { var _a, _b; return of(((_b = (_a = ctx.parameters.selectedItems) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0); });
|
|
1580
1732
|
return this;
|
|
1581
1733
|
}
|
|
1734
|
+
withPositionTableviewCategories(positionTableviewCategories) {
|
|
1735
|
+
this._positionTableviewCategories = positionTableviewCategories;
|
|
1736
|
+
return this;
|
|
1737
|
+
}
|
|
1582
1738
|
}
|
|
1583
1739
|
class ActionSimpleDescriptor extends ActionDescriptor {
|
|
1584
1740
|
constructor(actionName, modelType, idProperty, titleProperty) {
|
|
@@ -1731,7 +1887,7 @@ class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
|
|
|
1731
1887
|
this.withRouteTrigger(':itemId');
|
|
1732
1888
|
this.withFetchFunction(ActionDataProviderUtil.runFetchOrFail);
|
|
1733
1889
|
this.withEditorActions([new ActionEditorSubmitDescriptor(this, ActionEditorSubmitTypeEnum.Cancel)]);
|
|
1734
|
-
this.
|
|
1890
|
+
this.withTableviewCategory(TableviewActionDefaultCategories.DETAILS);
|
|
1735
1891
|
}
|
|
1736
1892
|
withServiceType(serviceType) {
|
|
1737
1893
|
return this.withServiceFetchFunction(serviceType);
|
|
@@ -1754,7 +1910,7 @@ class ActionEditorAddDescriptor extends ActionEditorDescriptor {
|
|
|
1754
1910
|
this.withSubmitFunction(ActionDataProviderUtil.runCreateOrFail);
|
|
1755
1911
|
this.button.styleClass.withActionLevel(StyleLevelEnum.Success);
|
|
1756
1912
|
this.button.withIcon('pi pi-plus');
|
|
1757
|
-
this.
|
|
1913
|
+
this.withTableviewCategory(TableviewActionDefaultCategories.ADD);
|
|
1758
1914
|
}
|
|
1759
1915
|
withServiceType(serviceType) {
|
|
1760
1916
|
return this.withServiceSubmitFunction(serviceType);
|
|
@@ -1779,7 +1935,7 @@ class ActionEditorEditDescriptor extends ActionEditorDescriptor {
|
|
|
1779
1935
|
this.withRouteTrigger(':itemId/edit');
|
|
1780
1936
|
this.withFetchFunction(ActionDataProviderUtil.runFetchOrFail);
|
|
1781
1937
|
this.withSubmitFunction(ActionDataProviderUtil.runUpdateOrFail);
|
|
1782
|
-
this.
|
|
1938
|
+
this.withTableviewCategory(TableviewActionDefaultCategories.EDIT);
|
|
1783
1939
|
this.button.withLabel(null).withIcon('pi pi-pencil');
|
|
1784
1940
|
}
|
|
1785
1941
|
withServiceType(serviceType) {
|
|
@@ -1805,7 +1961,7 @@ class ActionDeleteDescriptor extends ActionDescriptor {
|
|
|
1805
1961
|
this.withRunFunction(ActionDataProviderUtil.runDeleteOrFail);
|
|
1806
1962
|
this.button.styleClass.withActionLevel(StyleLevelEnum.Danger);
|
|
1807
1963
|
this.withRunConfirmation();
|
|
1808
|
-
this.
|
|
1964
|
+
this.withTableviewCategory(TableviewActionDefaultCategories.DELETE);
|
|
1809
1965
|
this.button.withLabel(null).withIcon('pi pi-trash');
|
|
1810
1966
|
}
|
|
1811
1967
|
withServiceType(serviceType) {
|
|
@@ -2710,7 +2866,7 @@ class ColumnDynamicDescriptor extends ColumnDescriptor {
|
|
|
2710
2866
|
}
|
|
2711
2867
|
|
|
2712
2868
|
class EditorDescriptor {
|
|
2713
|
-
constructor(modelType, idProperty, titleProperty, tableviewEditorType =
|
|
2869
|
+
constructor(modelType, idProperty, titleProperty, tableviewEditorType = TableviewEditorTypeEnum.None) {
|
|
2714
2870
|
this._tabs = [];
|
|
2715
2871
|
this._groups = [];
|
|
2716
2872
|
this._fields = [];
|
|
@@ -2727,7 +2883,7 @@ class EditorDescriptor {
|
|
|
2727
2883
|
* @param titleProperty
|
|
2728
2884
|
* @param tableEditorType
|
|
2729
2885
|
*/
|
|
2730
|
-
static from(modelType, idProperty, titleProperty, tableEditorType =
|
|
2886
|
+
static from(modelType, idProperty, titleProperty, tableEditorType = TableviewEditorTypeEnum.None) {
|
|
2731
2887
|
return EditorDescriptor.fromModelWithAttributes(modelType, TableviewUtil.getAttributeDefMap(modelType), titleProperty, idProperty, tableEditorType);
|
|
2732
2888
|
}
|
|
2733
2889
|
/**
|
|
@@ -2739,7 +2895,7 @@ class EditorDescriptor {
|
|
|
2739
2895
|
* @param titleProperty
|
|
2740
2896
|
* @param tableEditorType
|
|
2741
2897
|
*/
|
|
2742
|
-
static fromModelWithAttributes(modelType, attributes, idProperty, titleProperty, tableEditorType =
|
|
2898
|
+
static fromModelWithAttributes(modelType, attributes, idProperty, titleProperty, tableEditorType = TableviewEditorTypeEnum.None) {
|
|
2743
2899
|
const descriptor = new EditorDescriptor(modelType, idProperty, titleProperty, tableEditorType);
|
|
2744
2900
|
attributes
|
|
2745
2901
|
.filter(attr => !attr.type.includes('Set') && !attr.type.includes('Array'))
|
|
@@ -2755,9 +2911,6 @@ class EditorDescriptor {
|
|
|
2755
2911
|
get fields() {
|
|
2756
2912
|
return this._fields;
|
|
2757
2913
|
}
|
|
2758
|
-
get tableviewEditorType() {
|
|
2759
|
-
return this._disabled;
|
|
2760
|
-
}
|
|
2761
2914
|
get disabled() {
|
|
2762
2915
|
return this._disabled;
|
|
2763
2916
|
}
|
|
@@ -3734,7 +3887,7 @@ class FieldManyEditorDescriptor extends AFieldDescriptor {
|
|
|
3734
3887
|
return this._tableviewDescriptor.addEditor;
|
|
3735
3888
|
}
|
|
3736
3889
|
get editorForRead() {
|
|
3737
|
-
return this._tableviewDescriptor.
|
|
3890
|
+
return this._tableviewDescriptor.detailsEditor;
|
|
3738
3891
|
}
|
|
3739
3892
|
get editorForUpdate() {
|
|
3740
3893
|
return this._tableviewDescriptor.editEditor;
|
|
@@ -4371,10 +4524,10 @@ class TableviewDescriptor {
|
|
|
4371
4524
|
this._modelType = modelType;
|
|
4372
4525
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
4373
4526
|
this._table = new TableDescriptor(modelType, idProperty, titleProperty);
|
|
4374
|
-
this.
|
|
4375
|
-
this.
|
|
4376
|
-
this._addEditor = new EditorDescriptor(modelType, idProperty, titleProperty,
|
|
4377
|
-
this._editEditor = new EditorDescriptor(modelType, idProperty, titleProperty,
|
|
4527
|
+
this._detailsEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Details);
|
|
4528
|
+
this._detailsEditor.withDisabled();
|
|
4529
|
+
this._addEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Add);
|
|
4530
|
+
this._editEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Edit);
|
|
4378
4531
|
this._tableTitle = `${this._model.typeName}.name`;
|
|
4379
4532
|
}
|
|
4380
4533
|
/**
|
|
@@ -4387,7 +4540,7 @@ class TableviewDescriptor {
|
|
|
4387
4540
|
const descriptor = new TableviewDescriptor(modelType, idProperty, titleProperty);
|
|
4388
4541
|
descriptor._table = TableDescriptor.from(modelType, idProperty, titleProperty);
|
|
4389
4542
|
descriptor._editEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4390
|
-
descriptor.
|
|
4543
|
+
descriptor._detailsEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4391
4544
|
descriptor._addEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4392
4545
|
return descriptor;
|
|
4393
4546
|
}
|
|
@@ -4404,7 +4557,7 @@ class TableviewDescriptor {
|
|
|
4404
4557
|
descriptor._table = TableDescriptor.fromModelWithAttributes(modelType, columnAttributes, idProperty, titleProperty);
|
|
4405
4558
|
if (fieldAttributes !== null) {
|
|
4406
4559
|
descriptor._editEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes !== null && fieldAttributes !== void 0 ? fieldAttributes : columnAttributes, idProperty, titleProperty);
|
|
4407
|
-
descriptor.
|
|
4560
|
+
descriptor._detailsEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes !== null && fieldAttributes !== void 0 ? fieldAttributes : columnAttributes, idProperty, titleProperty);
|
|
4408
4561
|
descriptor._addEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes !== null && fieldAttributes !== void 0 ? fieldAttributes : columnAttributes, idProperty, titleProperty);
|
|
4409
4562
|
}
|
|
4410
4563
|
return descriptor;
|
|
@@ -4412,8 +4565,8 @@ class TableviewDescriptor {
|
|
|
4412
4565
|
get table() {
|
|
4413
4566
|
return this._table;
|
|
4414
4567
|
}
|
|
4415
|
-
get
|
|
4416
|
-
return this.
|
|
4568
|
+
get detailsEditor() {
|
|
4569
|
+
return this._detailsEditor;
|
|
4417
4570
|
}
|
|
4418
4571
|
get addEditor() {
|
|
4419
4572
|
return this._addEditor;
|
|
@@ -4432,13 +4585,13 @@ class TableviewDescriptor {
|
|
|
4432
4585
|
return this;
|
|
4433
4586
|
}
|
|
4434
4587
|
withEditorDescriptors(descriptor) {
|
|
4435
|
-
this.
|
|
4588
|
+
this._detailsEditor = descriptor;
|
|
4436
4589
|
this._editEditor = descriptor;
|
|
4437
4590
|
this._addEditor = descriptor;
|
|
4438
4591
|
return this;
|
|
4439
4592
|
}
|
|
4440
|
-
|
|
4441
|
-
this.
|
|
4593
|
+
withDetailsDescriptor(descriptor) {
|
|
4594
|
+
this._detailsEditor = descriptor;
|
|
4442
4595
|
return this;
|
|
4443
4596
|
}
|
|
4444
4597
|
withAddDescriptor(descriptor) {
|
|
@@ -4454,7 +4607,7 @@ class TableviewDescriptor {
|
|
|
4454
4607
|
return this;
|
|
4455
4608
|
}
|
|
4456
4609
|
withValidator(name, expression) {
|
|
4457
|
-
this.
|
|
4610
|
+
this._detailsEditor.addValidation(name, expression);
|
|
4458
4611
|
this._addEditor.addValidation(name, expression);
|
|
4459
4612
|
this._editEditor.addValidation(name, expression);
|
|
4460
4613
|
return this;
|
|
@@ -4470,20 +4623,20 @@ class TableviewDescriptor {
|
|
|
4470
4623
|
}
|
|
4471
4624
|
getField(property, editorType) {
|
|
4472
4625
|
switch (editorType) {
|
|
4473
|
-
case
|
|
4626
|
+
case TableviewEditorTypeEnum.Edit:
|
|
4474
4627
|
return this._editEditor.getField(property);
|
|
4475
|
-
case
|
|
4628
|
+
case TableviewEditorTypeEnum.Add:
|
|
4476
4629
|
return this._addEditor.getField(property);
|
|
4477
|
-
case
|
|
4478
|
-
return this.
|
|
4479
|
-
case
|
|
4630
|
+
case TableviewEditorTypeEnum.Details:
|
|
4631
|
+
return this._detailsEditor.getField(property);
|
|
4632
|
+
case TableviewEditorTypeEnum.None:
|
|
4480
4633
|
return null;
|
|
4481
4634
|
}
|
|
4482
4635
|
}
|
|
4483
4636
|
removeField(property) {
|
|
4484
4637
|
this._editEditor.removeField(property);
|
|
4485
4638
|
this._addEditor.removeField(property);
|
|
4486
|
-
this.
|
|
4639
|
+
this._detailsEditor.removeField(property);
|
|
4487
4640
|
}
|
|
4488
4641
|
addColumnNumber(property, displayFormat) {
|
|
4489
4642
|
return this._table.addColumnNumber(property, displayFormat);
|
|
@@ -4501,49 +4654,49 @@ class TableviewDescriptor {
|
|
|
4501
4654
|
return this._table.addColumnCustomComponent(property, customComponentType);
|
|
4502
4655
|
}
|
|
4503
4656
|
createTabGroup(name, title) {
|
|
4504
|
-
this.
|
|
4657
|
+
this._detailsEditor.createTabGroup(name, title);
|
|
4505
4658
|
this._addEditor.createTabGroup(name, title);
|
|
4506
4659
|
this._editEditor.createTabGroup(name, title);
|
|
4507
4660
|
return this;
|
|
4508
4661
|
}
|
|
4509
4662
|
createFieldGroup(name, title) {
|
|
4510
|
-
this.
|
|
4663
|
+
this._detailsEditor.createFieldGroup(name, title);
|
|
4511
4664
|
this._addEditor.createFieldGroup(name, title);
|
|
4512
4665
|
this._editEditor.createFieldGroup(name, title);
|
|
4513
4666
|
return this;
|
|
4514
4667
|
}
|
|
4515
4668
|
addFieldDescriptor(field) {
|
|
4516
|
-
this.
|
|
4669
|
+
this._detailsEditor.addFieldDescriptor(field);
|
|
4517
4670
|
this._addEditor.addFieldDescriptor(field);
|
|
4518
4671
|
this._editEditor.addFieldDescriptor(field);
|
|
4519
4672
|
return this;
|
|
4520
4673
|
}
|
|
4521
4674
|
addField(property) {
|
|
4522
|
-
const field = this.
|
|
4675
|
+
const field = this._detailsEditor.addField(property);
|
|
4523
4676
|
this._addEditor.addFieldDescriptor(field);
|
|
4524
4677
|
this._editEditor.addFieldDescriptor(field);
|
|
4525
4678
|
return field;
|
|
4526
4679
|
}
|
|
4527
4680
|
addFieldLookup(property, modelType) {
|
|
4528
|
-
const field = this.
|
|
4681
|
+
const field = this._detailsEditor.addFieldLookup(property, modelType);
|
|
4529
4682
|
this._addEditor.addFieldDescriptor(field);
|
|
4530
4683
|
this._editEditor.addFieldDescriptor(field);
|
|
4531
4684
|
return field;
|
|
4532
4685
|
}
|
|
4533
4686
|
addFieldLookupEnum(property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
4534
|
-
const field = this.
|
|
4687
|
+
const field = this._detailsEditor.addFieldLookupEnum(property, enumType, options, nameAsValue, optionsTitlePath);
|
|
4535
4688
|
this._addEditor.addFieldDescriptor(field);
|
|
4536
4689
|
this._editEditor.addFieldDescriptor(field);
|
|
4537
4690
|
return field;
|
|
4538
4691
|
}
|
|
4539
4692
|
addFieldManyEditor(property, tableviewDescriptor) {
|
|
4540
|
-
const field = this.
|
|
4693
|
+
const field = this._detailsEditor.addFieldManyEditor(property, tableviewDescriptor);
|
|
4541
4694
|
this._addEditor.addFieldDescriptor(field);
|
|
4542
4695
|
this._editEditor.addFieldDescriptor(field);
|
|
4543
4696
|
return field;
|
|
4544
4697
|
}
|
|
4545
4698
|
addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor) {
|
|
4546
|
-
const field = this.
|
|
4699
|
+
const field = this._detailsEditor.addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor);
|
|
4547
4700
|
this._addEditor.addFieldDescriptor(field);
|
|
4548
4701
|
this._editEditor.addFieldDescriptor(field);
|
|
4549
4702
|
return field;
|
|
@@ -4551,7 +4704,7 @@ class TableviewDescriptor {
|
|
|
4551
4704
|
copy() {
|
|
4552
4705
|
const tableview = new TableviewDescriptor(this._model.type, this._model.idPropertyName, this._model.titlePropertyName);
|
|
4553
4706
|
tableview._table = this._table.copy();
|
|
4554
|
-
tableview.
|
|
4707
|
+
tableview._detailsEditor = this._detailsEditor.copy();
|
|
4555
4708
|
tableview._addEditor = this._addEditor.copy();
|
|
4556
4709
|
tableview._editEditor = this._editEditor.copy();
|
|
4557
4710
|
return tableview;
|
|
@@ -4577,7 +4730,7 @@ class TableviewDescriptor {
|
|
|
4577
4730
|
this._table.withColumnModifiedType(property, columnType);
|
|
4578
4731
|
this._editEditor.withFieldModifiedType(property, fieldType);
|
|
4579
4732
|
this._addEditor.withFieldModifiedType(property, fieldType);
|
|
4580
|
-
this.
|
|
4733
|
+
this._detailsEditor.withFieldModifiedType(property, fieldType);
|
|
4581
4734
|
}
|
|
4582
4735
|
return this;
|
|
4583
4736
|
}
|
|
@@ -4594,7 +4747,7 @@ class TableviewDescriptor {
|
|
|
4594
4747
|
attributeDef.fieldType = fieldType !== null && fieldType !== void 0 ? fieldType : FieldInputTypeEnum.Text;
|
|
4595
4748
|
this._table.withColumnModifiedEnum(property, enumType);
|
|
4596
4749
|
this._editEditor.withFieldModifiedEnum(property, enumType);
|
|
4597
|
-
this.
|
|
4750
|
+
this._detailsEditor.withFieldModifiedEnum(property, enumType);
|
|
4598
4751
|
this._addEditor.withFieldModifiedEnum(property, enumType);
|
|
4599
4752
|
}
|
|
4600
4753
|
return this;
|
|
@@ -4621,7 +4774,7 @@ class TableviewDescriptor {
|
|
|
4621
4774
|
if (lookupProvider != null) {
|
|
4622
4775
|
this._table.withColumnModifiedLookup(property, lookupProvider, itemsLabelProperty, filterProperty);
|
|
4623
4776
|
this._addEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4624
|
-
this.
|
|
4777
|
+
this._detailsEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4625
4778
|
this._editEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4626
4779
|
}
|
|
4627
4780
|
else {
|
|
@@ -5907,256 +6060,99 @@ MediusRestUtil.matchModeMapping = [
|
|
|
5907
6060
|
[FilterMatchMode.DATE_IS_NOT, 'neq', MediusFilterMatchType.NotEquals, FilterTypeEnum.Date]
|
|
5908
6061
|
];
|
|
5909
6062
|
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
class ActionInstance {
|
|
5922
|
-
constructor(action, state = ActionInstanceStateEnum.TriggerStart, debug = false) {
|
|
5923
|
-
this.debug = debug;
|
|
5924
|
-
// function execution
|
|
5925
|
-
this.isRunLoadingSubject = new BehaviorSubject(false);
|
|
5926
|
-
this.contexts = [];
|
|
5927
|
-
this.executionSubject = new Subject();
|
|
5928
|
-
this.executionIsRunningSubject = new BehaviorSubject(false);
|
|
5929
|
-
this.stateSubject = new BehaviorSubject(1);
|
|
5930
|
-
this.resultSubject = new ReplaySubject(1);
|
|
5931
|
-
this.errorSubject = new ReplaySubject(1);
|
|
5932
|
-
this.contextExecutionSubscriptions = [];
|
|
5933
|
-
this.instanceId = Math.random().toString(36).substring(2);
|
|
5934
|
-
this.instanceLongName = `${action.actionNameLong}_${this.instanceId}`;
|
|
5935
|
-
this.action = action;
|
|
5936
|
-
this.state = state;
|
|
5937
|
-
}
|
|
5938
|
-
get isRunLoading$() {
|
|
5939
|
-
return this.isRunLoadingSubject.asObservable();
|
|
5940
|
-
}
|
|
5941
|
-
get context() {
|
|
5942
|
-
return this.contexts.length === 0 ? undefined : this.contexts[this.contexts.length - 1];
|
|
5943
|
-
}
|
|
5944
|
-
get execution$() {
|
|
5945
|
-
return this.executionSubject.asObservable();
|
|
5946
|
-
}
|
|
5947
|
-
get executionIsRunning$() {
|
|
5948
|
-
return this.executionIsRunningSubject.asObservable().pipe(distinctUntilChanged());
|
|
5949
|
-
}
|
|
5950
|
-
get state() {
|
|
5951
|
-
return this.stateSubject.value;
|
|
5952
|
-
}
|
|
5953
|
-
set state(state) {
|
|
5954
|
-
if (state > this.stateSubject.value) {
|
|
5955
|
-
if (this.debug) {
|
|
5956
|
-
console.debug(`ActionInstance ${this.instanceLongName} - state #${state}: ${ActionInstanceStateEnum[state]}`);
|
|
5957
|
-
}
|
|
5958
|
-
this.stateSubject.next(state);
|
|
5959
|
-
}
|
|
5960
|
-
}
|
|
5961
|
-
get state$() {
|
|
5962
|
-
return this.stateSubject.asObservable().pipe(distinctUntilChanged());
|
|
5963
|
-
}
|
|
5964
|
-
get result() {
|
|
5965
|
-
return this._result;
|
|
5966
|
-
}
|
|
5967
|
-
set result(result) {
|
|
5968
|
-
if (typeof result === 'undefined') {
|
|
5969
|
-
return;
|
|
5970
|
-
}
|
|
5971
|
-
if (this.debug) {
|
|
5972
|
-
console.debug(`ActionInstance ${this.instanceLongName} - result`, result);
|
|
5973
|
-
}
|
|
5974
|
-
this._result = result;
|
|
5975
|
-
this.resultSubject.next(result);
|
|
5976
|
-
}
|
|
5977
|
-
get result$() {
|
|
5978
|
-
return this.resultSubject.asObservable();
|
|
5979
|
-
}
|
|
5980
|
-
get error() {
|
|
5981
|
-
return this._error;
|
|
5982
|
-
}
|
|
5983
|
-
set error(error) {
|
|
5984
|
-
if (typeof error === 'undefined') {
|
|
5985
|
-
return;
|
|
5986
|
-
}
|
|
5987
|
-
if (this.debug) {
|
|
5988
|
-
console.debug(`ActionInstance ${this.instanceLongName} - error`, error);
|
|
5989
|
-
}
|
|
5990
|
-
this._error = error;
|
|
5991
|
-
this.errorSubject.next(error);
|
|
5992
|
-
}
|
|
5993
|
-
get error$() {
|
|
5994
|
-
return this.errorSubject.asObservable();
|
|
6063
|
+
var AuthorizationTypeEnum;
|
|
6064
|
+
(function (AuthorizationTypeEnum) {
|
|
6065
|
+
AuthorizationTypeEnum["All"] = "ALL";
|
|
6066
|
+
AuthorizationTypeEnum["Any"] = "ANY";
|
|
6067
|
+
AuthorizationTypeEnum["Rbac"] = "ROLE_BASED_ACCESS_CONTROL";
|
|
6068
|
+
AuthorizationTypeEnum["Service"] = "SERVICE";
|
|
6069
|
+
})(AuthorizationTypeEnum || (AuthorizationTypeEnum = {}));
|
|
6070
|
+
|
|
6071
|
+
class APermissions {
|
|
6072
|
+
constructor(type) {
|
|
6073
|
+
this._authorizationType = type;
|
|
5995
6074
|
}
|
|
5996
|
-
|
|
5997
|
-
return
|
|
6075
|
+
get authorizationType() {
|
|
6076
|
+
return this._authorizationType;
|
|
5998
6077
|
}
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6078
|
+
}
|
|
6079
|
+
var Permissions;
|
|
6080
|
+
(function (Permissions) {
|
|
6081
|
+
class All extends APermissions {
|
|
6082
|
+
constructor() {
|
|
6083
|
+
super(AuthorizationTypeEnum.All);
|
|
6084
|
+
this._permissions = [];
|
|
6003
6085
|
}
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6086
|
+
static of(...permissions) {
|
|
6087
|
+
const inst = new All();
|
|
6088
|
+
inst.and(...permissions);
|
|
6089
|
+
return inst;
|
|
6007
6090
|
}
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
this.contextExecutionSubscriptions.push(context.execution$.subscribe({
|
|
6011
|
-
next: next => this.executionSubject.next(next),
|
|
6012
|
-
error: error => this.executionSubject.error(error)
|
|
6013
|
-
}));
|
|
6014
|
-
this.contextExecutionSubscriptions.push(context.executionIsRunning$.subscribe({
|
|
6015
|
-
next: next => this.executionIsRunningSubject.next(next)
|
|
6016
|
-
}));
|
|
6017
|
-
this.contexts.push(context);
|
|
6018
|
-
}
|
|
6019
|
-
finish() {
|
|
6020
|
-
if (this.stateSubject.value < ActionInstanceStateEnum.FinishSuccess) {
|
|
6021
|
-
this.state = ActionInstanceStateEnum.FinishSuccess;
|
|
6091
|
+
get permissions() {
|
|
6092
|
+
return this._permissions;
|
|
6022
6093
|
}
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
this.executionIsRunningSubject.complete();
|
|
6027
|
-
this.stateSubject.complete();
|
|
6028
|
-
this.resultSubject.complete();
|
|
6029
|
-
this.errorSubject.complete();
|
|
6030
|
-
}
|
|
6031
|
-
}
|
|
6032
|
-
/**
|
|
6033
|
-
* Class containing all main data for action to be executed in run/fetch/submit states.
|
|
6034
|
-
*/
|
|
6035
|
-
class ActionContext {
|
|
6036
|
-
constructor(instance, parameters, functionName, dataProvider, serviceInstance, executionSubject = new ReplaySubject(1), executionIsRunningSubject = new BehaviorSubject(false)) {
|
|
6037
|
-
this.instance = instance;
|
|
6038
|
-
this.parameters = parameters;
|
|
6039
|
-
this.functionName = functionName;
|
|
6040
|
-
this.dataProvider = dataProvider;
|
|
6041
|
-
this.serviceInstance = serviceInstance;
|
|
6042
|
-
this.executionSubject = executionSubject;
|
|
6043
|
-
this.executionIsRunningSubject = executionIsRunningSubject;
|
|
6044
|
-
this.contextLongName = `${this.instance.instanceLongName}_${functionName}`;
|
|
6045
|
-
}
|
|
6046
|
-
get execution$() {
|
|
6047
|
-
return this.executionSubject.asObservable();
|
|
6048
|
-
}
|
|
6049
|
-
get executionIsRunning$() {
|
|
6050
|
-
return this.executionIsRunningSubject.asObservable().pipe(distinctUntilChanged());
|
|
6051
|
-
}
|
|
6052
|
-
executionStart() {
|
|
6053
|
-
if (this.instance.debug) {
|
|
6054
|
-
console.debug(`ActionContext ${this.contextLongName} - execution start`);
|
|
6094
|
+
and(...permissions) {
|
|
6095
|
+
this._permissions.push(...permissions);
|
|
6096
|
+
return this;
|
|
6055
6097
|
}
|
|
6056
|
-
this.executionIsRunningSubject.next(true);
|
|
6057
6098
|
}
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6099
|
+
Permissions.All = All;
|
|
6100
|
+
class Any extends APermissions {
|
|
6101
|
+
constructor() {
|
|
6102
|
+
super(AuthorizationTypeEnum.Any);
|
|
6103
|
+
this._permissions = [];
|
|
6061
6104
|
}
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6105
|
+
static of(...permissions) {
|
|
6106
|
+
const inst = new Any();
|
|
6107
|
+
inst.or(...permissions);
|
|
6108
|
+
return inst;
|
|
6065
6109
|
}
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
if (this.instance.debug) {
|
|
6069
|
-
console.debug(`ActionContext ${this.contextLongName} - execution complete`);
|
|
6110
|
+
get permissions() {
|
|
6111
|
+
return this._permissions;
|
|
6070
6112
|
}
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
executionError(err) {
|
|
6075
|
-
if (this.instance.debug) {
|
|
6076
|
-
console.debug(`ActionContext ${this.contextLongName} - execution error`, err);
|
|
6113
|
+
or(...permissions) {
|
|
6114
|
+
this._permissions.push(...permissions);
|
|
6115
|
+
return this;
|
|
6077
6116
|
}
|
|
6078
|
-
this.executionSubject.error(err);
|
|
6079
|
-
this.executionIsRunningSubject.next(false);
|
|
6080
|
-
}
|
|
6081
|
-
finish() {
|
|
6082
|
-
this.executionSubject.complete();
|
|
6083
|
-
this.executionIsRunningSubject.complete();
|
|
6084
|
-
}
|
|
6085
|
-
}
|
|
6086
|
-
/**
|
|
6087
|
-
* Class containing all main data for action validations (enabled/visible) to be executed in validation states.
|
|
6088
|
-
*/
|
|
6089
|
-
class ActionContextValidation {
|
|
6090
|
-
constructor(descriptor, parameters, dataProvider, serviceInstance) {
|
|
6091
|
-
this.descriptor = descriptor;
|
|
6092
|
-
this.parameters = parameters;
|
|
6093
|
-
this.dataProvider = dataProvider;
|
|
6094
|
-
this.serviceInstance = serviceInstance;
|
|
6095
|
-
}
|
|
6096
|
-
}
|
|
6097
|
-
class ActionParameters {
|
|
6098
|
-
constructor(itemId, item) {
|
|
6099
|
-
this.itemId = itemId;
|
|
6100
|
-
this.item = item;
|
|
6101
|
-
this.selectedItems = [];
|
|
6102
|
-
}
|
|
6103
|
-
withActionData(actionData) {
|
|
6104
|
-
this.actionData = actionData;
|
|
6105
|
-
return this;
|
|
6106
|
-
}
|
|
6107
|
-
withQueryParam(queryParam) {
|
|
6108
|
-
this.queryParam = queryParam;
|
|
6109
|
-
return this;
|
|
6110
|
-
}
|
|
6111
|
-
withViewContainer(viewContainer) {
|
|
6112
|
-
this.viewContainer = viewContainer;
|
|
6113
|
-
return this;
|
|
6114
|
-
}
|
|
6115
|
-
withSourceComponent(sourceComponent) {
|
|
6116
|
-
this.sourceComponent = sourceComponent;
|
|
6117
|
-
return this;
|
|
6118
6117
|
}
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6118
|
+
Permissions.Any = Any;
|
|
6119
|
+
class Roles extends APermissions {
|
|
6120
|
+
constructor() {
|
|
6121
|
+
super(AuthorizationTypeEnum.Rbac);
|
|
6122
|
+
this._roles = [];
|
|
6123
|
+
}
|
|
6124
|
+
static of(...roles) {
|
|
6125
|
+
const inst = new Roles();
|
|
6126
|
+
inst.or(...roles);
|
|
6127
|
+
return inst;
|
|
6128
|
+
}
|
|
6129
|
+
get roles() {
|
|
6130
|
+
return this._roles;
|
|
6131
|
+
}
|
|
6132
|
+
and(...roles) {
|
|
6133
|
+
if (this._roles.length === 0) {
|
|
6134
|
+
this._roles.push([]);
|
|
6135
|
+
}
|
|
6136
|
+
this._roles[this._roles.length - 1].push(...roles);
|
|
6137
|
+
return this;
|
|
6138
|
+
}
|
|
6139
|
+
or(...roles) {
|
|
6140
|
+
this._roles.push(...roles.map(s => [s]));
|
|
6141
|
+
return this;
|
|
6142
|
+
}
|
|
6122
6143
|
}
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6144
|
+
Permissions.Roles = Roles;
|
|
6145
|
+
class Service extends APermissions {
|
|
6146
|
+
constructor(service) {
|
|
6147
|
+
super(AuthorizationTypeEnum.Service);
|
|
6148
|
+
this.service = service;
|
|
6149
|
+
}
|
|
6150
|
+
static of(service) {
|
|
6151
|
+
return new Service(service);
|
|
6152
|
+
}
|
|
6126
6153
|
}
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
(function (ActionInstanceStateEnum) {
|
|
6130
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["TriggerStart"] = 0] = "TriggerStart";
|
|
6131
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["TriggerEnd"] = 1] = "TriggerEnd";
|
|
6132
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["ActivationStart"] = 2] = "ActivationStart";
|
|
6133
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["ActivationEnd"] = 3] = "ActivationEnd";
|
|
6134
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["FetchStart"] = 4] = "FetchStart";
|
|
6135
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["FetchEnd"] = 5] = "FetchEnd";
|
|
6136
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["FetchError"] = 6] = "FetchError";
|
|
6137
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["RunConfirmationStart"] = 7] = "RunConfirmationStart";
|
|
6138
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["RunConfirmationEndAccept"] = 8] = "RunConfirmationEndAccept";
|
|
6139
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["RunConfirmationEndReject"] = 9] = "RunConfirmationEndReject";
|
|
6140
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["RunStart"] = 10] = "RunStart";
|
|
6141
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["RunEnd"] = 11] = "RunEnd";
|
|
6142
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["RunError"] = 12] = "RunError";
|
|
6143
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["NextActionStart"] = 13] = "NextActionStart";
|
|
6144
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["NextActionEnd"] = 14] = "NextActionEnd";
|
|
6145
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishSuccess"] = 15] = "FinishSuccess";
|
|
6146
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishError"] = 16] = "FinishError";
|
|
6147
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishDismissed"] = 17] = "FinishDismissed"; // action was dismissed by user
|
|
6148
|
-
})(ActionInstanceStateEnum || (ActionInstanceStateEnum = {}));
|
|
6149
|
-
|
|
6150
|
-
/**
|
|
6151
|
-
* Default categories for tableview actions
|
|
6152
|
-
*/
|
|
6153
|
-
class TableviewActionDefaultCategories {
|
|
6154
|
-
}
|
|
6155
|
-
TableviewActionDefaultCategories.READ = 'read';
|
|
6156
|
-
TableviewActionDefaultCategories.ADD = 'add';
|
|
6157
|
-
TableviewActionDefaultCategories.EDIT = 'edit';
|
|
6158
|
-
TableviewActionDefaultCategories.DELETE = 'delete';
|
|
6159
|
-
TableviewActionDefaultCategories.DETAILS = 'details';
|
|
6154
|
+
Permissions.Service = Service;
|
|
6155
|
+
})(Permissions || (Permissions = {}));
|
|
6160
6156
|
|
|
6161
6157
|
class AuthorizationUtil {
|
|
6162
6158
|
static isPermitted(permissions, userRoles) {
|
|
@@ -7531,23 +7527,36 @@ class MngViewContainerComponentService {
|
|
|
7531
7527
|
constructor(messageService) {
|
|
7532
7528
|
this.messageService = messageService;
|
|
7533
7529
|
this.actions = [];
|
|
7534
|
-
this.
|
|
7530
|
+
this._tableReloadSubject = new Subject();
|
|
7531
|
+
this._editorResetSubject = new Subject();
|
|
7535
7532
|
}
|
|
7536
7533
|
set dataProvider(dataProvider) {
|
|
7537
7534
|
this._dataProvider = dataProvider;
|
|
7538
7535
|
}
|
|
7539
|
-
get reloadTable() {
|
|
7540
|
-
return this._reloadTableSubject.asObservable();
|
|
7541
|
-
}
|
|
7542
|
-
triggerTableReload(event) {
|
|
7543
|
-
this._reloadTableSubject.next(event);
|
|
7544
|
-
}
|
|
7545
7536
|
getMessageService() {
|
|
7546
7537
|
return this.messageService;
|
|
7547
7538
|
}
|
|
7548
7539
|
getDataProvider() {
|
|
7549
7540
|
return this._dataProvider;
|
|
7550
7541
|
}
|
|
7542
|
+
getActions() {
|
|
7543
|
+
return this.actions;
|
|
7544
|
+
}
|
|
7545
|
+
setActions(actions) {
|
|
7546
|
+
this.actions = actions;
|
|
7547
|
+
}
|
|
7548
|
+
getTableReload$() {
|
|
7549
|
+
return this._tableReloadSubject.asObservable();
|
|
7550
|
+
}
|
|
7551
|
+
reloadTable(event) {
|
|
7552
|
+
this._tableReloadSubject.next(event !== null && event !== void 0 ? event : {});
|
|
7553
|
+
}
|
|
7554
|
+
getEditorReset$() {
|
|
7555
|
+
return this._editorResetSubject.asObservable();
|
|
7556
|
+
}
|
|
7557
|
+
resetEditor(event) {
|
|
7558
|
+
this._editorResetSubject.next(event !== null && event !== void 0 ? event : {});
|
|
7559
|
+
}
|
|
7551
7560
|
}
|
|
7552
7561
|
MngViewContainerComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngViewContainerComponentService, deps: [{ token: i2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7553
7562
|
MngViewContainerComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngViewContainerComponentService });
|
|
@@ -7660,9 +7669,9 @@ class MngActionComponent {
|
|
|
7660
7669
|
if (this.action instanceof ActionLinkDescriptor) {
|
|
7661
7670
|
this.actionLink = this.action;
|
|
7662
7671
|
}
|
|
7663
|
-
if (this.action.
|
|
7664
|
-
if (routeData.tableviewPermissions[this.action.
|
|
7665
|
-
this.routePermissions = routeData.tableviewPermissions[this.action.
|
|
7672
|
+
if (this.action.tableviewCategory && routeData.tableviewPermissions) {
|
|
7673
|
+
if (routeData.tableviewPermissions[this.action.tableviewCategory]) {
|
|
7674
|
+
this.routePermissions = routeData.tableviewPermissions[this.action.tableviewCategory];
|
|
7666
7675
|
}
|
|
7667
7676
|
}
|
|
7668
7677
|
this.processSubscriptions();
|
|
@@ -7707,10 +7716,10 @@ class MngActionComponent {
|
|
|
7707
7716
|
const instance = this.actionExecutor.triggerAction(this.action, parameters);
|
|
7708
7717
|
this.subscriptions.push(instance.result$.subscribe({
|
|
7709
7718
|
next: () => {
|
|
7710
|
-
var _a;
|
|
7719
|
+
var _a, _b;
|
|
7711
7720
|
this.finishEventEmitter.next(instance);
|
|
7712
7721
|
if (this.action.hasItemsSelection) {
|
|
7713
|
-
(_a = this.
|
|
7722
|
+
(_b = (_a = this.viewContainer) === null || _a === void 0 ? void 0 : _a.reloadTable) === null || _b === void 0 ? void 0 : _b.call(_a, { data: { event: event } });
|
|
7714
7723
|
}
|
|
7715
7724
|
}
|
|
7716
7725
|
}));
|
|
@@ -7775,10 +7784,10 @@ class MngActionComponent {
|
|
|
7775
7784
|
}
|
|
7776
7785
|
}
|
|
7777
7786
|
MngActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionComponent, deps: [{ token: i1.ActivatedRoute }, { token: i1$2.TranslateService }, { token: MngAuthorizationService }, { token: MngActionExecutorService }, { token: i2.ConfirmationService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
7778
|
-
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", queryParam: "queryParam", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"], selectedItems: "selectedItems" }, outputs: { finishEventEmitter: "finish" }, host: { properties: { "class": "this.hostClass", "class.m-0": "this.isHostHidden" } }, providers: [ConfirmationService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { kind: "directive", type: i7.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i9.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "directive", type: i6.Ripple, selector: "[pRipple]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: MngParametrizePipe, name: "parametrize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7787
|
+
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", queryParam: "queryParam", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"], selectedItems: "selectedItems" }, outputs: { finishEventEmitter: "finish" }, host: { properties: { "class": "this.hostClass", "class.m-0": "this.isHostHidden" } }, providers: [ConfirmationService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { kind: "directive", type: i7.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i9.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "directive", type: i6.Ripple, selector: "[pRipple]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: MngParametrizePipe, name: "parametrize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7779
7788
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionComponent, decorators: [{
|
|
7780
7789
|
type: Component,
|
|
7781
|
-
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"] }]
|
|
7790
|
+
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"] }]
|
|
7782
7791
|
}], ctorParameters: function () {
|
|
7783
7792
|
return [{ type: i1.ActivatedRoute }, { type: i1$2.TranslateService }, { type: MngAuthorizationService }, { type: MngActionExecutorService }, { type: i2.ConfirmationService }, { type: MngViewContainerComponentService, decorators: [{
|
|
7784
7793
|
type: Optional
|
|
@@ -7831,7 +7840,7 @@ class MngActionRouteComponent {
|
|
|
7831
7840
|
}
|
|
7832
7841
|
ngOnInit() {
|
|
7833
7842
|
var _a, _b;
|
|
7834
|
-
this.actions = (_b = (_a = this.viewContainerService) === null || _a === void 0 ? void 0 : _a.
|
|
7843
|
+
this.actions = (_b = (_a = this.viewContainerService) === null || _a === void 0 ? void 0 : _a.getActions().filter(a => a.activationTrigger === ActionActivationTriggerEnum.OnRoute)) !== null && _b !== void 0 ? _b : [];
|
|
7835
7844
|
const subscription = this.route.params.subscribe(p => {
|
|
7836
7845
|
const action = this.findActiveAction(p);
|
|
7837
7846
|
if (action) {
|
|
@@ -7879,7 +7888,7 @@ class MngActionRouteComponent {
|
|
|
7879
7888
|
if (!this.viewContainerService) {
|
|
7880
7889
|
console.warn(`View container service could not be found, table reload will not be triggered.`);
|
|
7881
7890
|
}
|
|
7882
|
-
(_a = this.viewContainerService) === null || _a === void 0 ? void 0 : _a.
|
|
7891
|
+
(_a = this.viewContainerService) === null || _a === void 0 ? void 0 : _a.reloadTable({ data: { event: actionEv } }); // reload only if no error in action and
|
|
7883
7892
|
}
|
|
7884
7893
|
this.untriggerAction();
|
|
7885
7894
|
});
|
|
@@ -8083,6 +8092,34 @@ class MngFormEditorComponent {
|
|
|
8083
8092
|
});
|
|
8084
8093
|
return formValue;
|
|
8085
8094
|
}
|
|
8095
|
+
resetFormModel(item) {
|
|
8096
|
+
this.formOrigItem = item;
|
|
8097
|
+
// TODO: to check if this is ok, could be problems with dates, if so, try lodash
|
|
8098
|
+
const formModel = JSON.parse(JSON.stringify(item !== null && item !== void 0 ? item : {}));
|
|
8099
|
+
this.descriptor.fields.forEach(field => {
|
|
8100
|
+
if (field.getter && item) {
|
|
8101
|
+
const splitPath = field.property.split('.');
|
|
8102
|
+
let currentObject = formModel;
|
|
8103
|
+
for (let i = 0; i < splitPath.length; i++) {
|
|
8104
|
+
const currentSubPath = splitPath[i];
|
|
8105
|
+
if (i === splitPath.length - 1) {
|
|
8106
|
+
currentObject[currentSubPath] = field.getter(item);
|
|
8107
|
+
}
|
|
8108
|
+
else {
|
|
8109
|
+
if (typeof currentObject[currentSubPath] !== 'object') {
|
|
8110
|
+
currentObject[currentSubPath] = {};
|
|
8111
|
+
}
|
|
8112
|
+
currentObject = currentObject[currentSubPath];
|
|
8113
|
+
}
|
|
8114
|
+
}
|
|
8115
|
+
}
|
|
8116
|
+
});
|
|
8117
|
+
if (typeof this.formOptions.resetModel === 'function') {
|
|
8118
|
+
// could not be initiated yet
|
|
8119
|
+
this.formOptions.resetModel(this.formModel);
|
|
8120
|
+
}
|
|
8121
|
+
this.formModel = formModel;
|
|
8122
|
+
}
|
|
8086
8123
|
getFormField(key) {
|
|
8087
8124
|
return this.findFormField(this.form, key.split('.'));
|
|
8088
8125
|
}
|
|
@@ -8151,34 +8188,6 @@ class MngFormEditorComponent {
|
|
|
8151
8188
|
}
|
|
8152
8189
|
return false;
|
|
8153
8190
|
}
|
|
8154
|
-
resetFormModel(item) {
|
|
8155
|
-
this.formOrigItem = item;
|
|
8156
|
-
// TODO: to check if this is ok, could be problems with dates, if so, try lodash
|
|
8157
|
-
const formModel = JSON.parse(JSON.stringify(item !== null && item !== void 0 ? item : {}));
|
|
8158
|
-
this.descriptor.fields.forEach(field => {
|
|
8159
|
-
if (field.getter && item) {
|
|
8160
|
-
const splitPath = field.property.split('.');
|
|
8161
|
-
let currentObject = formModel;
|
|
8162
|
-
for (let i = 0; i < splitPath.length; i++) {
|
|
8163
|
-
const currentSubPath = splitPath[i];
|
|
8164
|
-
if (i === splitPath.length - 1) {
|
|
8165
|
-
currentObject[currentSubPath] = field.getter(item);
|
|
8166
|
-
}
|
|
8167
|
-
else {
|
|
8168
|
-
if (typeof currentObject[currentSubPath] !== 'object') {
|
|
8169
|
-
currentObject[currentSubPath] = {};
|
|
8170
|
-
}
|
|
8171
|
-
currentObject = currentObject[currentSubPath];
|
|
8172
|
-
}
|
|
8173
|
-
}
|
|
8174
|
-
}
|
|
8175
|
-
});
|
|
8176
|
-
if (typeof this.formOptions.resetModel === 'function') {
|
|
8177
|
-
// could not be initiated yet
|
|
8178
|
-
this.formOptions.resetModel(this.formModel);
|
|
8179
|
-
}
|
|
8180
|
-
this.formModel = formModel;
|
|
8181
|
-
}
|
|
8182
8191
|
updateFormState() {
|
|
8183
8192
|
this.formOptions.formState.disabled = this.isFormDisabled !== null ? this.isFormDisabled === true : this.descriptor.disabled;
|
|
8184
8193
|
}
|
|
@@ -8823,9 +8832,7 @@ class MngActionEditorComponent {
|
|
|
8823
8832
|
this.viewContainerService = viewContainerService;
|
|
8824
8833
|
this.actionRunEventEmitter = new EventEmitter();
|
|
8825
8834
|
this.actionCancelEventEmitter = new EventEmitter();
|
|
8826
|
-
this.cmpId = Math.random().toString(36).substring(2);
|
|
8827
8835
|
this.isDialog = true;
|
|
8828
|
-
this.isSaveButton = true;
|
|
8829
8836
|
this.toolbarLeftActions = [];
|
|
8830
8837
|
this.toolbarRightActions = [];
|
|
8831
8838
|
this.footerLeftActions = [];
|
|
@@ -8839,7 +8846,7 @@ class MngActionEditorComponent {
|
|
|
8839
8846
|
this.subscriptions = [];
|
|
8840
8847
|
}
|
|
8841
8848
|
ngOnInit() {
|
|
8842
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
8849
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
8843
8850
|
if ((_a = this.dialogConfig) === null || _a === void 0 ? void 0 : _a.data) {
|
|
8844
8851
|
if (this.dialogConfig.data.actionInstance) {
|
|
8845
8852
|
this.instance = this.dialogConfig.data.actionInstance;
|
|
@@ -8866,7 +8873,6 @@ class MngActionEditorComponent {
|
|
|
8866
8873
|
this.isDialog = false;
|
|
8867
8874
|
this.viewContainer = (_o = (_m = this.viewContainerInit) !== null && _m !== void 0 ? _m : this.viewContainerService) !== null && _o !== void 0 ? _o : undefined;
|
|
8868
8875
|
}
|
|
8869
|
-
this.isSaveButton = typeof this.action.submitFunction === 'function';
|
|
8870
8876
|
this.setTitle();
|
|
8871
8877
|
for (const action of this.action.editorActions) {
|
|
8872
8878
|
if (action instanceof ActionEditorSubmitDescriptor) {
|
|
@@ -8891,24 +8897,33 @@ class MngActionEditorComponent {
|
|
|
8891
8897
|
});
|
|
8892
8898
|
}
|
|
8893
8899
|
}
|
|
8894
|
-
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
case ActionPositionEnum.ToolbarRight:
|
|
8899
|
-
this.toolbarRightActions.push(action);
|
|
8900
|
-
break;
|
|
8901
|
-
case ActionPositionEnum.FooterLeft:
|
|
8902
|
-
this.footerLeftActions.push(action);
|
|
8903
|
-
break;
|
|
8904
|
-
case ActionPositionEnum.FooterRight:
|
|
8905
|
-
this.footerRightActions.push(action);
|
|
8906
|
-
break;
|
|
8907
|
-
}
|
|
8900
|
+
this.placeActionsOnPositions(action);
|
|
8901
|
+
}
|
|
8902
|
+
for (const action of (_q = (_p = this.viewContainer) === null || _p === void 0 ? void 0 : _p.getActions().filter(value => { var _a; return (_a = value.positionTableviewCategories) === null || _a === void 0 ? void 0 : _a.includes(this.action.tableviewCategory); })) !== null && _q !== void 0 ? _q : []) {
|
|
8903
|
+
this.placeActionsOnPositions(action);
|
|
8908
8904
|
}
|
|
8909
8905
|
this.toolbarRightActions = this.toolbarRightActions.reverse();
|
|
8910
8906
|
this.footerRightActions = this.footerRightActions.reverse();
|
|
8911
8907
|
this.loadItemWithDataProvider();
|
|
8908
|
+
if (typeof this.viewContainer.getEditorReset$ === 'function') {
|
|
8909
|
+
const viewContainerEditor = this.viewContainer;
|
|
8910
|
+
viewContainerEditor.getEditorReset$().subscribe({
|
|
8911
|
+
next: e => {
|
|
8912
|
+
var _a, _b;
|
|
8913
|
+
if (e.fetch) {
|
|
8914
|
+
this.loadItemWithDataProvider();
|
|
8915
|
+
}
|
|
8916
|
+
else if (e.item) {
|
|
8917
|
+
(_a = this.editorComponent) === null || _a === void 0 ? void 0 : _a.resetFormModel(e.item);
|
|
8918
|
+
}
|
|
8919
|
+
else if (e.fields) {
|
|
8920
|
+
for (const key in e.fields) {
|
|
8921
|
+
(_b = this.editorComponent) === null || _b === void 0 ? void 0 : _b.resetFormFieldValue(key, e.fields[key]);
|
|
8922
|
+
}
|
|
8923
|
+
}
|
|
8924
|
+
}
|
|
8925
|
+
});
|
|
8926
|
+
}
|
|
8912
8927
|
}
|
|
8913
8928
|
ngOnDestroy() {
|
|
8914
8929
|
this.subscriptions.forEach(s => s.unsubscribe());
|
|
@@ -9000,12 +9015,28 @@ class MngActionEditorComponent {
|
|
|
9000
9015
|
this.actionExecutor.deactivateAction(this.instance);
|
|
9001
9016
|
}
|
|
9002
9017
|
}
|
|
9018
|
+
placeActionsOnPositions(action) {
|
|
9019
|
+
switch (action.position) {
|
|
9020
|
+
case ActionPositionEnum.ToolbarLeft:
|
|
9021
|
+
this.toolbarLeftActions.push(action);
|
|
9022
|
+
break;
|
|
9023
|
+
case ActionPositionEnum.ToolbarRight:
|
|
9024
|
+
this.toolbarRightActions.push(action);
|
|
9025
|
+
break;
|
|
9026
|
+
case ActionPositionEnum.FooterLeft:
|
|
9027
|
+
this.footerLeftActions.push(action);
|
|
9028
|
+
break;
|
|
9029
|
+
case ActionPositionEnum.FooterRight:
|
|
9030
|
+
this.footerRightActions.push(action);
|
|
9031
|
+
break;
|
|
9032
|
+
}
|
|
9033
|
+
}
|
|
9003
9034
|
}
|
|
9004
9035
|
MngActionEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionEditorComponent, deps: [{ token: i0.Injector }, { token: i1$2.TranslateService }, { token: MngActionExecutorService }, { token: MngCommonsService }, { token: MngNavigationService }, { token: i3.DynamicDialogRef, optional: true }, { token: i3.DynamicDialogConfig, optional: true }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
9005
|
-
MngActionEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionEditorComponent, selector: "mng-action-editor", inputs: { action: "action", itemId: "itemId", item: "item", actionData: "actionData", dataProvider: "dataProvider", viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { actionRunEventEmitter: "actionSubmit", actionCancelEventEmitter: "actionCancel" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }, { propertyName: "editorComponent", first: true, predicate: MngFormEditorComponent, descendants: true }], ngImport: i0, template: "<h5 *ngIf=\"!isDialog && title\">{{ title }}</h5>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action
|
|
9036
|
+
MngActionEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionEditorComponent, selector: "mng-action-editor", inputs: { action: "action", itemId: "itemId", item: "item", actionData: "actionData", dataProvider: "dataProvider", viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { actionRunEventEmitter: "actionSubmit", actionCancelEventEmitter: "actionCancel" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }, { propertyName: "editorComponent", first: true, predicate: MngFormEditorComponent, descendants: true }], ngImport: i0, template: "<h5 *ngIf=\"!isDialog && title\">{{ title }}</h5>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action\n *ngFor=\"let action of toolbarLeftActions\"\n [action]=\"action\"\n [disabled]=\"submitLoading$\"\n [viewContainer]=\"viewContainer\"\n [item]=\"item\"\n [itemId]=\"itemId\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action\n *ngFor=\"let action of toolbarRightActions\"\n [action]=\"action\"\n [disabled]=\"submitLoading$\"\n [viewContainer]=\"viewContainer\"\n [item]=\"item\"\n [itemId]=\"itemId\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action\n *ngFor=\"let action of footerLeftActions\"\n [action]=\"action\"\n [disabled]=\"submitLoading$\"\n [viewContainer]=\"viewContainer\"\n [item]=\"item\"\n [itemId]=\"itemId\"></mng-action>\n </div>\n <div>\n <mng-action\n *ngFor=\"let action of footerRightActions\"\n [action]=\"action\"\n [disabled]=\"submitLoading$\"\n [viewContainer]=\"viewContainer\"\n [item]=\"item\"\n [itemId]=\"itemId\"></mng-action>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$2.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { kind: "component", type: i7$1.ProgressSpinner, selector: "p-progressSpinner", inputs: ["style", "styleClass", "strokeWidth", "fill", "animationDuration"] }, { kind: "component", type: MngFormEditorComponent, selector: "mng-form-editor", inputs: ["descriptor", "submitLoading", "item", "isSubmitButtonVisible", "isFormDisabled"], outputs: ["formSubmit"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9006
9037
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionEditorComponent, decorators: [{
|
|
9007
9038
|
type: Component,
|
|
9008
|
-
args: [{ selector: 'mng-action-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<h5 *ngIf=\"!isDialog && title\">{{ title }}</h5>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action
|
|
9039
|
+
args: [{ selector: 'mng-action-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<h5 *ngIf=\"!isDialog && title\">{{ title }}</h5>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action\n *ngFor=\"let action of toolbarLeftActions\"\n [action]=\"action\"\n [disabled]=\"submitLoading$\"\n [viewContainer]=\"viewContainer\"\n [item]=\"item\"\n [itemId]=\"itemId\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action\n *ngFor=\"let action of toolbarRightActions\"\n [action]=\"action\"\n [disabled]=\"submitLoading$\"\n [viewContainer]=\"viewContainer\"\n [item]=\"item\"\n [itemId]=\"itemId\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action\n *ngFor=\"let action of footerLeftActions\"\n [action]=\"action\"\n [disabled]=\"submitLoading$\"\n [viewContainer]=\"viewContainer\"\n [item]=\"item\"\n [itemId]=\"itemId\"></mng-action>\n </div>\n <div>\n <mng-action\n *ngFor=\"let action of footerRightActions\"\n [action]=\"action\"\n [disabled]=\"submitLoading$\"\n [viewContainer]=\"viewContainer\"\n [item]=\"item\"\n [itemId]=\"itemId\"></mng-action>\n </div>\n </div>\n</div>\n" }]
|
|
9009
9040
|
}], ctorParameters: function () {
|
|
9010
9041
|
return [{ type: i0.Injector }, { type: i1$2.TranslateService }, { type: MngActionExecutorService }, { type: MngCommonsService }, { type: MngNavigationService }, { type: i3.DynamicDialogRef, decorators: [{
|
|
9011
9042
|
type: Optional
|
|
@@ -9966,8 +9997,7 @@ class MngTableviewComponent {
|
|
|
9966
9997
|
this.actionExecutor = actionExecutor;
|
|
9967
9998
|
this.viewContainerService = viewContainerService;
|
|
9968
9999
|
this.actions = [];
|
|
9969
|
-
this.
|
|
9970
|
-
this.rowInlineActions = [];
|
|
10000
|
+
this.tableActions = [];
|
|
9971
10001
|
this.toolbarLeftActions = [];
|
|
9972
10002
|
this.toolbarRightActions = [];
|
|
9973
10003
|
this.subscriptions = [];
|
|
@@ -9975,28 +10005,27 @@ class MngTableviewComponent {
|
|
|
9975
10005
|
this.selectedItems = [];
|
|
9976
10006
|
}
|
|
9977
10007
|
ngOnInit() {
|
|
9978
|
-
this.viewContainerService.
|
|
10008
|
+
this.viewContainerService.setActions(this.actions);
|
|
9979
10009
|
if (this.dataProvider) {
|
|
9980
10010
|
this.viewContainerService.dataProvider = this.dataProvider;
|
|
9981
10011
|
}
|
|
9982
|
-
const reloadTableSubscription = this.viewContainerService.
|
|
10012
|
+
const reloadTableSubscription = this.viewContainerService.getTableReload$().subscribe(() => {
|
|
9983
10013
|
this.reloadTable();
|
|
9984
10014
|
});
|
|
9985
10015
|
this.subscriptions.push(reloadTableSubscription);
|
|
9986
|
-
for (const action of this.actions) {
|
|
10016
|
+
for (const action of this.actions.filter(value => { var _a, _b; return (_b = (_a = value.positionTableviewCategories) === null || _a === void 0 ? void 0 : _a.includes(TableviewActionDefaultCategories.READ)) !== null && _b !== void 0 ? _b : true; })) {
|
|
9987
10017
|
switch (action.position) {
|
|
9988
|
-
case ActionPositionEnum.RowClick:
|
|
9989
|
-
this.rowClickActions.push(action);
|
|
9990
|
-
break;
|
|
9991
|
-
case ActionPositionEnum.RowInline:
|
|
9992
|
-
this.rowInlineActions.push(action);
|
|
9993
|
-
break;
|
|
9994
10018
|
case ActionPositionEnum.ToolbarLeft:
|
|
9995
10019
|
this.toolbarLeftActions.push(action);
|
|
9996
10020
|
break;
|
|
9997
10021
|
case ActionPositionEnum.ToolbarRight:
|
|
9998
10022
|
this.toolbarRightActions.push(action);
|
|
9999
10023
|
break;
|
|
10024
|
+
case ActionPositionEnum.TableHeader:
|
|
10025
|
+
case ActionPositionEnum.RowInline:
|
|
10026
|
+
case ActionPositionEnum.RowClick:
|
|
10027
|
+
this.tableActions.push(action);
|
|
10028
|
+
break;
|
|
10000
10029
|
}
|
|
10001
10030
|
}
|
|
10002
10031
|
this.toolbarRightActions = this.toolbarRightActions.reverse();
|
|
@@ -10020,6 +10049,9 @@ class MngTableviewComponent {
|
|
|
10020
10049
|
getDataProvider() {
|
|
10021
10050
|
return this.dataProvider;
|
|
10022
10051
|
}
|
|
10052
|
+
getActions() {
|
|
10053
|
+
return this.actions;
|
|
10054
|
+
}
|
|
10023
10055
|
reloadTable() {
|
|
10024
10056
|
var _a;
|
|
10025
10057
|
(_a = this.tableComponent) === null || _a === void 0 ? void 0 : _a.reload();
|
|
@@ -10032,10 +10064,10 @@ class MngTableviewComponent {
|
|
|
10032
10064
|
}
|
|
10033
10065
|
}
|
|
10034
10066
|
MngTableviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.MessageService }, { token: i1$2.TranslateService }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
10035
|
-
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n [actions]=\"
|
|
10067
|
+
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n [actions]=\"tableActions\"\n [selectionEnabled]=\"hasItemSelectionAction\"\n [selectionMode]=\"'multiple'\"\n (tableLoad)=\"onTableLoad($event)\"\n (selectionChange)=\"selectionChange($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle ?? '' | translate }}</h5>\n </div>\n </ng-template>\n\n <ng-template let-queryResult=\"queryResult\" mngTemplate=\"footer\">\n <ng-container *ngIf=\"footerTemplate\" [ngTemplateOutlet]=\"footerTemplate\" [ngTemplateOutletContext]=\"{queryResult: queryResult}\"></ng-container>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i7$4.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "component", type: i6$2.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { kind: "directive", type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { kind: "component", type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "actions", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent", "columnActionMinWidth"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
|
|
10036
10068
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewComponent, decorators: [{
|
|
10037
10069
|
type: Component,
|
|
10038
|
-
args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, MngViewContainerComponentService], template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n [actions]=\"
|
|
10070
|
+
args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, MngViewContainerComponentService], template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n [actions]=\"tableActions\"\n [selectionEnabled]=\"hasItemSelectionAction\"\n [selectionMode]=\"'multiple'\"\n (tableLoad)=\"onTableLoad($event)\"\n (selectionChange)=\"selectionChange($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle ?? '' | translate }}</h5>\n </div>\n </ng-template>\n\n <ng-template let-queryResult=\"queryResult\" mngTemplate=\"footer\">\n <ng-container *ngIf=\"footerTemplate\" [ngTemplateOutlet]=\"footerTemplate\" [ngTemplateOutletContext]=\"{queryResult: queryResult}\"></ng-container>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n" }]
|
|
10039
10071
|
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i2.MessageService }, { type: i1$2.TranslateService }, { type: i3.DialogService }, { type: i2.ConfirmationService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService }]; }, propDecorators: { descriptor: [{
|
|
10040
10072
|
type: Input
|
|
10041
10073
|
}], dataProvider: [{
|
|
@@ -10072,7 +10104,7 @@ class AMngTableviewRouteComponent {
|
|
|
10072
10104
|
this.createActionDescriptorForExport()
|
|
10073
10105
|
].filter(e => e != null);
|
|
10074
10106
|
}
|
|
10075
|
-
createActionDescriptorForDetails(descriptor = this.descriptor.
|
|
10107
|
+
createActionDescriptorForDetails(descriptor = this.descriptor.detailsEditor) {
|
|
10076
10108
|
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasDetails ? new ActionEditorDetailsDescriptor(descriptor) : null;
|
|
10077
10109
|
}
|
|
10078
10110
|
createActionDescriptorForAdd(descriptor = this.descriptor.addEditor) {
|
|
@@ -10105,10 +10137,11 @@ class AMngTableviewRouteComponent {
|
|
|
10105
10137
|
createActionDescriptorForRefresh(descriptor = this.descriptor.model) {
|
|
10106
10138
|
const action = new ActionDescriptor(descriptor, 'refresh')
|
|
10107
10139
|
.withPosition(ActionPositionEnum.ToolbarRight)
|
|
10108
|
-
.
|
|
10140
|
+
.withTableviewCategory(TableviewActionDefaultCategories.READ)
|
|
10109
10141
|
.withRunNotificationSuccess(undefined, undefined, false)
|
|
10110
10142
|
.withRunFunction((ctx) => {
|
|
10111
|
-
|
|
10143
|
+
var _a, _b;
|
|
10144
|
+
(_b = (_a = ctx.parameters.viewContainer) === null || _a === void 0 ? void 0 : _a.reloadTable) === null || _b === void 0 ? void 0 : _b.call(_a, {});
|
|
10112
10145
|
return of(null);
|
|
10113
10146
|
});
|
|
10114
10147
|
action.button.withIcon('pi pi-refresh').styleClass.withActionLevel(StyleLevelEnum.Secondary);
|
|
@@ -10339,9 +10372,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
10339
10372
|
}] } });
|
|
10340
10373
|
|
|
10341
10374
|
class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
10342
|
-
constructor(
|
|
10343
|
-
super();
|
|
10344
|
-
this.actionExecutor = actionExecutor;
|
|
10375
|
+
constructor() {
|
|
10376
|
+
super(...arguments);
|
|
10345
10377
|
this.itemsSubject = new ReplaySubject(1);
|
|
10346
10378
|
this.items$ = this.itemsSubject.asObservable();
|
|
10347
10379
|
this.actions = [];
|
|
@@ -10351,13 +10383,13 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
10351
10383
|
this.isEnabled$ = this.isDisabledSubject.asObservable().pipe(distinctUntilChanged(), map(e => !e));
|
|
10352
10384
|
}
|
|
10353
10385
|
ngOnInit() {
|
|
10354
|
-
this.descriptor = this.
|
|
10386
|
+
this.descriptor = this.props['descriptor'];
|
|
10355
10387
|
const hasViewAction = this.descriptor.fieldActions.some(a => a === FieldManyEditorActionEnum.View);
|
|
10356
10388
|
const hasAddAction = this.descriptor.fieldActions.some(a => a === FieldManyEditorActionEnum.Add);
|
|
10357
10389
|
const hasEditAction = this.descriptor.fieldActions.some(a => a === FieldManyEditorActionEnum.Edit);
|
|
10358
10390
|
const hasDeleteAction = this.descriptor.fieldActions.some(a => a === FieldManyEditorActionEnum.Delete);
|
|
10359
10391
|
if (hasViewAction) {
|
|
10360
|
-
const viewAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.
|
|
10392
|
+
const viewAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.detailsEditor, 'details', this.descriptor.editor.model.type, this.descriptor.property)
|
|
10361
10393
|
.withPosition(ActionPositionEnum.RowClick)
|
|
10362
10394
|
.withDialogClassName('mng-field-dialog mng-action-editor-dialog')
|
|
10363
10395
|
.withDialogSize(StyleSizeEnum.Small);
|
|
@@ -10490,12 +10522,12 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
10490
10522
|
});
|
|
10491
10523
|
}
|
|
10492
10524
|
}
|
|
10493
|
-
MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps:
|
|
10525
|
+
MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
10494
10526
|
MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" [actions]=\"actions\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { kind: "component", type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "actions", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent", "columnActionMinWidth"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10495
10527
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
|
|
10496
10528
|
type: Component,
|
|
10497
10529
|
args: [{ selector: 'mng-formly-table-dialog-form-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" [actions]=\"actions\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"] }]
|
|
10498
|
-
}]
|
|
10530
|
+
}] });
|
|
10499
10531
|
|
|
10500
10532
|
class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
10501
10533
|
constructor(injector) {
|
|
@@ -12657,7 +12689,7 @@ class TableviewRouteBuilder {
|
|
|
12657
12689
|
}
|
|
12658
12690
|
return this;
|
|
12659
12691
|
}
|
|
12660
|
-
|
|
12692
|
+
withPermissionByCategory(key, permissions) {
|
|
12661
12693
|
if (!this.permissions) {
|
|
12662
12694
|
this.permissions = {};
|
|
12663
12695
|
}
|
|
@@ -12741,5 +12773,5 @@ class TableviewRouteBuilder {
|
|
|
12741
12773
|
* Generated bundle index. Do not edit.
|
|
12742
12774
|
*/
|
|
12743
12775
|
|
|
12744
|
-
export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, APermissions, ActionActivationTriggerEnum, ActionButtonDescriptor, ActionConfirmationDialogDescriptor, ActionContext, ActionContextValidation, ActionDataProviderUtil, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionEditorSubmitTypeEnum, ActionError, ActionInstance, ActionInstanceStateEnum, ActionLinkDescriptor, ActionParameters, ActionPositionEnum, ActionSimpleDescriptor, ActionTypeEnum, AuthorizationTypeEnum, AuthorizationUtil, ButtonStyleBuilder, ButtonStyleRoundedEnum, ColumnDescriptor, ColumnDynamicDescriptor, ColumnTypeEnum, DataProvider, DateUtil, DefaultMngErrorMapperService, DynamicTableviewDataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterMatchModeEnum, FilterTypeEnum, I18nUtils, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DATE_RANGE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAuthorizationGuard, MngAuthorizationService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngClassMapPipe, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDateRangeComponent, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLabelComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngGetterPipe, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngParametrizePipe, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTemplatePipe, MngTopbarComponent, MngVersionComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, Permissions, RouteBuilder, RoutesBuilder, StringUtil, StyleLevelEnum, StyleSizeEnum, StylesUtil, TableDataProvider, TableDescriptor, TableDynamicColumnsModeEnum, TableDynamicDescriptor, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum, TableviewActionDefaultCategories, TableviewCrudDataProvider, TableviewDataProvider, TableviewDescriptor, TableviewDynamicDescriptor,
|
|
12776
|
+
export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, APermissions, ActionActivationTriggerEnum, ActionButtonDescriptor, ActionConfirmationDialogDescriptor, ActionContext, ActionContextValidation, ActionDataProviderUtil, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionEditorSubmitTypeEnum, ActionError, ActionInstance, ActionInstanceStateEnum, ActionLinkDescriptor, ActionParameters, ActionPositionEnum, ActionSimpleDescriptor, ActionTypeEnum, AuthorizationTypeEnum, AuthorizationUtil, ButtonStyleBuilder, ButtonStyleRoundedEnum, ColumnDescriptor, ColumnDynamicDescriptor, ColumnTypeEnum, DataProvider, DateUtil, DefaultMngErrorMapperService, DynamicTableviewDataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterMatchModeEnum, FilterTypeEnum, I18nUtils, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DATE_RANGE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAuthorizationGuard, MngAuthorizationService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngClassMapPipe, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDateRangeComponent, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLabelComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngGetterPipe, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngParametrizePipe, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTemplatePipe, MngTopbarComponent, MngVersionComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, Permissions, RouteBuilder, RoutesBuilder, StringUtil, StyleLevelEnum, StyleSizeEnum, StylesUtil, TableDataProvider, TableDescriptor, TableDynamicColumnsModeEnum, TableDynamicDescriptor, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum, TableviewActionDefaultCategories, TableviewCrudDataProvider, TableviewDataProvider, TableviewDescriptor, TableviewDynamicDescriptor, TableviewEditorTypeEnum, TableviewRouteBuilder, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
|
|
12745
12777
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|