@mediusinc/mng-commons 0.15.0 → 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 +8 -8
- 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/autocomplete/autocomplete.component.mjs +21 -3
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +29 -29
- package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +3 -3
- 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/column-filter/column-filter.component.mjs +1 -1
- 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 +13 -3
- 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 +587 -527
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +568 -510
- 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/autocomplete/autocomplete.component.d.ts +7 -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/field.descriptor.d.ts +5 -1
- 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/scss/mng-overrides/_theme_autocomplete.scss +16 -0
- package/scss/mng-overrides/_theme_styles.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;
|
|
@@ -695,151 +946,49 @@ class TableviewDataProvider extends EditorDataProvider {
|
|
|
695
946
|
getAllReload(queryParam) {
|
|
696
947
|
this._getAllReloadSubject.next(queryParam);
|
|
697
948
|
}
|
|
698
|
-
}
|
|
699
|
-
class DynamicTableviewDataProvider extends TableviewDataProvider {
|
|
700
|
-
constructor() {
|
|
701
|
-
super({});
|
|
702
|
-
this._getAll = () => of(new MediusQueryResult());
|
|
703
|
-
this._fetch = () => of({});
|
|
704
|
-
}
|
|
705
|
-
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
|
-
}
|
|
777
|
-
}
|
|
778
|
-
Permissions.All = All;
|
|
779
|
-
class Any extends APermissions {
|
|
780
|
-
constructor() {
|
|
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
|
-
}
|
|
796
|
-
}
|
|
797
|
-
Permissions.Any = Any;
|
|
798
|
-
class Roles extends APermissions {
|
|
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
|
-
}
|
|
949
|
+
}
|
|
950
|
+
class DynamicTableviewDataProvider extends TableviewDataProvider {
|
|
951
|
+
constructor() {
|
|
952
|
+
super({});
|
|
953
|
+
this._getAll = () => of(new MediusQueryResult());
|
|
954
|
+
this._fetch = () => of({});
|
|
822
955
|
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
956
|
+
withGetAll(getAll) {
|
|
957
|
+
this._getAll = getAll;
|
|
958
|
+
return this;
|
|
959
|
+
}
|
|
960
|
+
withFetch(fetch) {
|
|
961
|
+
this._fetch = fetch;
|
|
962
|
+
return this;
|
|
963
|
+
}
|
|
964
|
+
get getAll() {
|
|
965
|
+
return this._getAll;
|
|
966
|
+
}
|
|
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
|
}
|
|
@@ -3458,6 +3611,8 @@ class FieldLookupDescriptor extends AFieldDescriptor {
|
|
|
3458
3611
|
this._dropdownClassName = 'mng-filter-lookup-dropdown';
|
|
3459
3612
|
this._autocompleteOpenOnFocus = false;
|
|
3460
3613
|
this._autocompleteInlineSearch = false;
|
|
3614
|
+
this._autocompleteAutoClear = false;
|
|
3615
|
+
this._autocompleteSelectFirst = false;
|
|
3461
3616
|
this._modelType = modelType;
|
|
3462
3617
|
ModelUtil.trySetLookupItemsProperties(this);
|
|
3463
3618
|
}
|
|
@@ -3488,6 +3643,12 @@ class FieldLookupDescriptor extends AFieldDescriptor {
|
|
|
3488
3643
|
get autocompleteInlineSearch() {
|
|
3489
3644
|
return this._autocompleteInlineSearch;
|
|
3490
3645
|
}
|
|
3646
|
+
get autocompleteAutoClear() {
|
|
3647
|
+
return this._autocompleteAutoClear;
|
|
3648
|
+
}
|
|
3649
|
+
get autocompleteSelectFirst() {
|
|
3650
|
+
return this._autocompleteSelectFirst;
|
|
3651
|
+
}
|
|
3491
3652
|
get dropdownClassName() {
|
|
3492
3653
|
return this._dropdownClassName;
|
|
3493
3654
|
}
|
|
@@ -3535,8 +3696,10 @@ class FieldLookupDescriptor extends AFieldDescriptor {
|
|
|
3535
3696
|
withConfig(config) {
|
|
3536
3697
|
return super.withConfig(config);
|
|
3537
3698
|
}
|
|
3538
|
-
asAutocomplete(openOnFocus = false, inlineSearch = false) {
|
|
3699
|
+
asAutocomplete(openOnFocus = false, inlineSearch = false, selectFirst = false, autoClear = false) {
|
|
3539
3700
|
this._lookupType = FieldLookupTypeEnum.Autocomplete;
|
|
3701
|
+
this._autocompleteAutoClear = autoClear;
|
|
3702
|
+
this._autocompleteSelectFirst = selectFirst;
|
|
3540
3703
|
this._autocompleteOpenOnFocus = openOnFocus;
|
|
3541
3704
|
this._autocompleteInlineSearch = inlineSearch;
|
|
3542
3705
|
return this;
|
|
@@ -3724,7 +3887,7 @@ class FieldManyEditorDescriptor extends AFieldDescriptor {
|
|
|
3724
3887
|
return this._tableviewDescriptor.addEditor;
|
|
3725
3888
|
}
|
|
3726
3889
|
get editorForRead() {
|
|
3727
|
-
return this._tableviewDescriptor.
|
|
3890
|
+
return this._tableviewDescriptor.detailsEditor;
|
|
3728
3891
|
}
|
|
3729
3892
|
get editorForUpdate() {
|
|
3730
3893
|
return this._tableviewDescriptor.editEditor;
|
|
@@ -4361,10 +4524,10 @@ class TableviewDescriptor {
|
|
|
4361
4524
|
this._modelType = modelType;
|
|
4362
4525
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
4363
4526
|
this._table = new TableDescriptor(modelType, idProperty, titleProperty);
|
|
4364
|
-
this.
|
|
4365
|
-
this.
|
|
4366
|
-
this._addEditor = new EditorDescriptor(modelType, idProperty, titleProperty,
|
|
4367
|
-
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);
|
|
4368
4531
|
this._tableTitle = `${this._model.typeName}.name`;
|
|
4369
4532
|
}
|
|
4370
4533
|
/**
|
|
@@ -4377,7 +4540,7 @@ class TableviewDescriptor {
|
|
|
4377
4540
|
const descriptor = new TableviewDescriptor(modelType, idProperty, titleProperty);
|
|
4378
4541
|
descriptor._table = TableDescriptor.from(modelType, idProperty, titleProperty);
|
|
4379
4542
|
descriptor._editEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4380
|
-
descriptor.
|
|
4543
|
+
descriptor._detailsEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4381
4544
|
descriptor._addEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4382
4545
|
return descriptor;
|
|
4383
4546
|
}
|
|
@@ -4394,7 +4557,7 @@ class TableviewDescriptor {
|
|
|
4394
4557
|
descriptor._table = TableDescriptor.fromModelWithAttributes(modelType, columnAttributes, idProperty, titleProperty);
|
|
4395
4558
|
if (fieldAttributes !== null) {
|
|
4396
4559
|
descriptor._editEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes !== null && fieldAttributes !== void 0 ? fieldAttributes : columnAttributes, idProperty, titleProperty);
|
|
4397
|
-
descriptor.
|
|
4560
|
+
descriptor._detailsEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes !== null && fieldAttributes !== void 0 ? fieldAttributes : columnAttributes, idProperty, titleProperty);
|
|
4398
4561
|
descriptor._addEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes !== null && fieldAttributes !== void 0 ? fieldAttributes : columnAttributes, idProperty, titleProperty);
|
|
4399
4562
|
}
|
|
4400
4563
|
return descriptor;
|
|
@@ -4402,8 +4565,8 @@ class TableviewDescriptor {
|
|
|
4402
4565
|
get table() {
|
|
4403
4566
|
return this._table;
|
|
4404
4567
|
}
|
|
4405
|
-
get
|
|
4406
|
-
return this.
|
|
4568
|
+
get detailsEditor() {
|
|
4569
|
+
return this._detailsEditor;
|
|
4407
4570
|
}
|
|
4408
4571
|
get addEditor() {
|
|
4409
4572
|
return this._addEditor;
|
|
@@ -4422,13 +4585,13 @@ class TableviewDescriptor {
|
|
|
4422
4585
|
return this;
|
|
4423
4586
|
}
|
|
4424
4587
|
withEditorDescriptors(descriptor) {
|
|
4425
|
-
this.
|
|
4588
|
+
this._detailsEditor = descriptor;
|
|
4426
4589
|
this._editEditor = descriptor;
|
|
4427
4590
|
this._addEditor = descriptor;
|
|
4428
4591
|
return this;
|
|
4429
4592
|
}
|
|
4430
|
-
|
|
4431
|
-
this.
|
|
4593
|
+
withDetailsDescriptor(descriptor) {
|
|
4594
|
+
this._detailsEditor = descriptor;
|
|
4432
4595
|
return this;
|
|
4433
4596
|
}
|
|
4434
4597
|
withAddDescriptor(descriptor) {
|
|
@@ -4444,7 +4607,7 @@ class TableviewDescriptor {
|
|
|
4444
4607
|
return this;
|
|
4445
4608
|
}
|
|
4446
4609
|
withValidator(name, expression) {
|
|
4447
|
-
this.
|
|
4610
|
+
this._detailsEditor.addValidation(name, expression);
|
|
4448
4611
|
this._addEditor.addValidation(name, expression);
|
|
4449
4612
|
this._editEditor.addValidation(name, expression);
|
|
4450
4613
|
return this;
|
|
@@ -4460,20 +4623,20 @@ class TableviewDescriptor {
|
|
|
4460
4623
|
}
|
|
4461
4624
|
getField(property, editorType) {
|
|
4462
4625
|
switch (editorType) {
|
|
4463
|
-
case
|
|
4626
|
+
case TableviewEditorTypeEnum.Edit:
|
|
4464
4627
|
return this._editEditor.getField(property);
|
|
4465
|
-
case
|
|
4628
|
+
case TableviewEditorTypeEnum.Add:
|
|
4466
4629
|
return this._addEditor.getField(property);
|
|
4467
|
-
case
|
|
4468
|
-
return this.
|
|
4469
|
-
case
|
|
4630
|
+
case TableviewEditorTypeEnum.Details:
|
|
4631
|
+
return this._detailsEditor.getField(property);
|
|
4632
|
+
case TableviewEditorTypeEnum.None:
|
|
4470
4633
|
return null;
|
|
4471
4634
|
}
|
|
4472
4635
|
}
|
|
4473
4636
|
removeField(property) {
|
|
4474
4637
|
this._editEditor.removeField(property);
|
|
4475
4638
|
this._addEditor.removeField(property);
|
|
4476
|
-
this.
|
|
4639
|
+
this._detailsEditor.removeField(property);
|
|
4477
4640
|
}
|
|
4478
4641
|
addColumnNumber(property, displayFormat) {
|
|
4479
4642
|
return this._table.addColumnNumber(property, displayFormat);
|
|
@@ -4491,49 +4654,49 @@ class TableviewDescriptor {
|
|
|
4491
4654
|
return this._table.addColumnCustomComponent(property, customComponentType);
|
|
4492
4655
|
}
|
|
4493
4656
|
createTabGroup(name, title) {
|
|
4494
|
-
this.
|
|
4657
|
+
this._detailsEditor.createTabGroup(name, title);
|
|
4495
4658
|
this._addEditor.createTabGroup(name, title);
|
|
4496
4659
|
this._editEditor.createTabGroup(name, title);
|
|
4497
4660
|
return this;
|
|
4498
4661
|
}
|
|
4499
4662
|
createFieldGroup(name, title) {
|
|
4500
|
-
this.
|
|
4663
|
+
this._detailsEditor.createFieldGroup(name, title);
|
|
4501
4664
|
this._addEditor.createFieldGroup(name, title);
|
|
4502
4665
|
this._editEditor.createFieldGroup(name, title);
|
|
4503
4666
|
return this;
|
|
4504
4667
|
}
|
|
4505
4668
|
addFieldDescriptor(field) {
|
|
4506
|
-
this.
|
|
4669
|
+
this._detailsEditor.addFieldDescriptor(field);
|
|
4507
4670
|
this._addEditor.addFieldDescriptor(field);
|
|
4508
4671
|
this._editEditor.addFieldDescriptor(field);
|
|
4509
4672
|
return this;
|
|
4510
4673
|
}
|
|
4511
4674
|
addField(property) {
|
|
4512
|
-
const field = this.
|
|
4675
|
+
const field = this._detailsEditor.addField(property);
|
|
4513
4676
|
this._addEditor.addFieldDescriptor(field);
|
|
4514
4677
|
this._editEditor.addFieldDescriptor(field);
|
|
4515
4678
|
return field;
|
|
4516
4679
|
}
|
|
4517
4680
|
addFieldLookup(property, modelType) {
|
|
4518
|
-
const field = this.
|
|
4681
|
+
const field = this._detailsEditor.addFieldLookup(property, modelType);
|
|
4519
4682
|
this._addEditor.addFieldDescriptor(field);
|
|
4520
4683
|
this._editEditor.addFieldDescriptor(field);
|
|
4521
4684
|
return field;
|
|
4522
4685
|
}
|
|
4523
4686
|
addFieldLookupEnum(property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
4524
|
-
const field = this.
|
|
4687
|
+
const field = this._detailsEditor.addFieldLookupEnum(property, enumType, options, nameAsValue, optionsTitlePath);
|
|
4525
4688
|
this._addEditor.addFieldDescriptor(field);
|
|
4526
4689
|
this._editEditor.addFieldDescriptor(field);
|
|
4527
4690
|
return field;
|
|
4528
4691
|
}
|
|
4529
4692
|
addFieldManyEditor(property, tableviewDescriptor) {
|
|
4530
|
-
const field = this.
|
|
4693
|
+
const field = this._detailsEditor.addFieldManyEditor(property, tableviewDescriptor);
|
|
4531
4694
|
this._addEditor.addFieldDescriptor(field);
|
|
4532
4695
|
this._editEditor.addFieldDescriptor(field);
|
|
4533
4696
|
return field;
|
|
4534
4697
|
}
|
|
4535
4698
|
addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor) {
|
|
4536
|
-
const field = this.
|
|
4699
|
+
const field = this._detailsEditor.addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor);
|
|
4537
4700
|
this._addEditor.addFieldDescriptor(field);
|
|
4538
4701
|
this._editEditor.addFieldDescriptor(field);
|
|
4539
4702
|
return field;
|
|
@@ -4541,7 +4704,7 @@ class TableviewDescriptor {
|
|
|
4541
4704
|
copy() {
|
|
4542
4705
|
const tableview = new TableviewDescriptor(this._model.type, this._model.idPropertyName, this._model.titlePropertyName);
|
|
4543
4706
|
tableview._table = this._table.copy();
|
|
4544
|
-
tableview.
|
|
4707
|
+
tableview._detailsEditor = this._detailsEditor.copy();
|
|
4545
4708
|
tableview._addEditor = this._addEditor.copy();
|
|
4546
4709
|
tableview._editEditor = this._editEditor.copy();
|
|
4547
4710
|
return tableview;
|
|
@@ -4567,7 +4730,7 @@ class TableviewDescriptor {
|
|
|
4567
4730
|
this._table.withColumnModifiedType(property, columnType);
|
|
4568
4731
|
this._editEditor.withFieldModifiedType(property, fieldType);
|
|
4569
4732
|
this._addEditor.withFieldModifiedType(property, fieldType);
|
|
4570
|
-
this.
|
|
4733
|
+
this._detailsEditor.withFieldModifiedType(property, fieldType);
|
|
4571
4734
|
}
|
|
4572
4735
|
return this;
|
|
4573
4736
|
}
|
|
@@ -4584,7 +4747,7 @@ class TableviewDescriptor {
|
|
|
4584
4747
|
attributeDef.fieldType = fieldType !== null && fieldType !== void 0 ? fieldType : FieldInputTypeEnum.Text;
|
|
4585
4748
|
this._table.withColumnModifiedEnum(property, enumType);
|
|
4586
4749
|
this._editEditor.withFieldModifiedEnum(property, enumType);
|
|
4587
|
-
this.
|
|
4750
|
+
this._detailsEditor.withFieldModifiedEnum(property, enumType);
|
|
4588
4751
|
this._addEditor.withFieldModifiedEnum(property, enumType);
|
|
4589
4752
|
}
|
|
4590
4753
|
return this;
|
|
@@ -4611,7 +4774,7 @@ class TableviewDescriptor {
|
|
|
4611
4774
|
if (lookupProvider != null) {
|
|
4612
4775
|
this._table.withColumnModifiedLookup(property, lookupProvider, itemsLabelProperty, filterProperty);
|
|
4613
4776
|
this._addEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4614
|
-
this.
|
|
4777
|
+
this._detailsEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4615
4778
|
this._editEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4616
4779
|
}
|
|
4617
4780
|
else {
|
|
@@ -5897,256 +6060,99 @@ MediusRestUtil.matchModeMapping = [
|
|
|
5897
6060
|
[FilterMatchMode.DATE_IS_NOT, 'neq', MediusFilterMatchType.NotEquals, FilterTypeEnum.Date]
|
|
5898
6061
|
];
|
|
5899
6062
|
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
class ActionInstance {
|
|
5912
|
-
constructor(action, state = ActionInstanceStateEnum.TriggerStart, debug = false) {
|
|
5913
|
-
this.debug = debug;
|
|
5914
|
-
// function execution
|
|
5915
|
-
this.isRunLoadingSubject = new BehaviorSubject(false);
|
|
5916
|
-
this.contexts = [];
|
|
5917
|
-
this.executionSubject = new Subject();
|
|
5918
|
-
this.executionIsRunningSubject = new BehaviorSubject(false);
|
|
5919
|
-
this.stateSubject = new BehaviorSubject(1);
|
|
5920
|
-
this.resultSubject = new ReplaySubject(1);
|
|
5921
|
-
this.errorSubject = new ReplaySubject(1);
|
|
5922
|
-
this.contextExecutionSubscriptions = [];
|
|
5923
|
-
this.instanceId = Math.random().toString(36).substring(2);
|
|
5924
|
-
this.instanceLongName = `${action.actionNameLong}_${this.instanceId}`;
|
|
5925
|
-
this.action = action;
|
|
5926
|
-
this.state = state;
|
|
5927
|
-
}
|
|
5928
|
-
get isRunLoading$() {
|
|
5929
|
-
return this.isRunLoadingSubject.asObservable();
|
|
5930
|
-
}
|
|
5931
|
-
get context() {
|
|
5932
|
-
return this.contexts.length === 0 ? undefined : this.contexts[this.contexts.length - 1];
|
|
5933
|
-
}
|
|
5934
|
-
get execution$() {
|
|
5935
|
-
return this.executionSubject.asObservable();
|
|
5936
|
-
}
|
|
5937
|
-
get executionIsRunning$() {
|
|
5938
|
-
return this.executionIsRunningSubject.asObservable().pipe(distinctUntilChanged());
|
|
5939
|
-
}
|
|
5940
|
-
get state() {
|
|
5941
|
-
return this.stateSubject.value;
|
|
5942
|
-
}
|
|
5943
|
-
set state(state) {
|
|
5944
|
-
if (state > this.stateSubject.value) {
|
|
5945
|
-
if (this.debug) {
|
|
5946
|
-
console.debug(`ActionInstance ${this.instanceLongName} - state #${state}: ${ActionInstanceStateEnum[state]}`);
|
|
5947
|
-
}
|
|
5948
|
-
this.stateSubject.next(state);
|
|
5949
|
-
}
|
|
5950
|
-
}
|
|
5951
|
-
get state$() {
|
|
5952
|
-
return this.stateSubject.asObservable().pipe(distinctUntilChanged());
|
|
5953
|
-
}
|
|
5954
|
-
get result() {
|
|
5955
|
-
return this._result;
|
|
5956
|
-
}
|
|
5957
|
-
set result(result) {
|
|
5958
|
-
if (typeof result === 'undefined') {
|
|
5959
|
-
return;
|
|
5960
|
-
}
|
|
5961
|
-
if (this.debug) {
|
|
5962
|
-
console.debug(`ActionInstance ${this.instanceLongName} - result`, result);
|
|
5963
|
-
}
|
|
5964
|
-
this._result = result;
|
|
5965
|
-
this.resultSubject.next(result);
|
|
5966
|
-
}
|
|
5967
|
-
get result$() {
|
|
5968
|
-
return this.resultSubject.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;
|
|
5969
6074
|
}
|
|
5970
|
-
get
|
|
5971
|
-
return this.
|
|
6075
|
+
get authorizationType() {
|
|
6076
|
+
return this._authorizationType;
|
|
5972
6077
|
}
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
6078
|
+
}
|
|
6079
|
+
var Permissions;
|
|
6080
|
+
(function (Permissions) {
|
|
6081
|
+
class All extends APermissions {
|
|
6082
|
+
constructor() {
|
|
6083
|
+
super(AuthorizationTypeEnum.All);
|
|
6084
|
+
this._permissions = [];
|
|
5976
6085
|
}
|
|
5977
|
-
|
|
5978
|
-
|
|
6086
|
+
static of(...permissions) {
|
|
6087
|
+
const inst = new All();
|
|
6088
|
+
inst.and(...permissions);
|
|
6089
|
+
return inst;
|
|
5979
6090
|
}
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
}
|
|
5983
|
-
get error$() {
|
|
5984
|
-
return this.errorSubject.asObservable();
|
|
5985
|
-
}
|
|
5986
|
-
contextAt(idx) {
|
|
5987
|
-
return idx < this.contexts.length ? this.contexts[idx] : undefined;
|
|
5988
|
-
}
|
|
5989
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5990
|
-
newContext(context, finishPrevious = true) {
|
|
5991
|
-
if (this.debug) {
|
|
5992
|
-
console.debug(`ActionInstance ${this.instanceLongName} - new context ${context.contextLongName}`);
|
|
6091
|
+
get permissions() {
|
|
6092
|
+
return this._permissions;
|
|
5993
6093
|
}
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
6094
|
+
and(...permissions) {
|
|
6095
|
+
this._permissions.push(...permissions);
|
|
6096
|
+
return this;
|
|
5997
6097
|
}
|
|
5998
|
-
this.contextExecutionSubscriptions.forEach(s => s.unsubscribe());
|
|
5999
|
-
this.contextExecutionSubscriptions = [];
|
|
6000
|
-
this.contextExecutionSubscriptions.push(context.execution$.subscribe({
|
|
6001
|
-
next: next => this.executionSubject.next(next),
|
|
6002
|
-
error: error => this.executionSubject.error(error)
|
|
6003
|
-
}));
|
|
6004
|
-
this.contextExecutionSubscriptions.push(context.executionIsRunning$.subscribe({
|
|
6005
|
-
next: next => this.executionIsRunningSubject.next(next)
|
|
6006
|
-
}));
|
|
6007
|
-
this.contexts.push(context);
|
|
6008
6098
|
}
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6099
|
+
Permissions.All = All;
|
|
6100
|
+
class Any extends APermissions {
|
|
6101
|
+
constructor() {
|
|
6102
|
+
super(AuthorizationTypeEnum.Any);
|
|
6103
|
+
this._permissions = [];
|
|
6012
6104
|
}
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
this.stateSubject.complete();
|
|
6018
|
-
this.resultSubject.complete();
|
|
6019
|
-
this.errorSubject.complete();
|
|
6020
|
-
}
|
|
6021
|
-
}
|
|
6022
|
-
/**
|
|
6023
|
-
* Class containing all main data for action to be executed in run/fetch/submit states.
|
|
6024
|
-
*/
|
|
6025
|
-
class ActionContext {
|
|
6026
|
-
constructor(instance, parameters, functionName, dataProvider, serviceInstance, executionSubject = new ReplaySubject(1), executionIsRunningSubject = new BehaviorSubject(false)) {
|
|
6027
|
-
this.instance = instance;
|
|
6028
|
-
this.parameters = parameters;
|
|
6029
|
-
this.functionName = functionName;
|
|
6030
|
-
this.dataProvider = dataProvider;
|
|
6031
|
-
this.serviceInstance = serviceInstance;
|
|
6032
|
-
this.executionSubject = executionSubject;
|
|
6033
|
-
this.executionIsRunningSubject = executionIsRunningSubject;
|
|
6034
|
-
this.contextLongName = `${this.instance.instanceLongName}_${functionName}`;
|
|
6035
|
-
}
|
|
6036
|
-
get execution$() {
|
|
6037
|
-
return this.executionSubject.asObservable();
|
|
6038
|
-
}
|
|
6039
|
-
get executionIsRunning$() {
|
|
6040
|
-
return this.executionIsRunningSubject.asObservable().pipe(distinctUntilChanged());
|
|
6041
|
-
}
|
|
6042
|
-
executionStart() {
|
|
6043
|
-
if (this.instance.debug) {
|
|
6044
|
-
console.debug(`ActionContext ${this.contextLongName} - execution start`);
|
|
6105
|
+
static of(...permissions) {
|
|
6106
|
+
const inst = new Any();
|
|
6107
|
+
inst.or(...permissions);
|
|
6108
|
+
return inst;
|
|
6045
6109
|
}
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
executionNext(next, finish = true) {
|
|
6049
|
-
if (this.instance.debug) {
|
|
6050
|
-
console.debug(`ActionContext ${this.contextLongName} - execution next event`, next, finish);
|
|
6110
|
+
get permissions() {
|
|
6111
|
+
return this._permissions;
|
|
6051
6112
|
}
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
this
|
|
6113
|
+
or(...permissions) {
|
|
6114
|
+
this._permissions.push(...permissions);
|
|
6115
|
+
return this;
|
|
6055
6116
|
}
|
|
6056
6117
|
}
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6118
|
+
Permissions.Any = Any;
|
|
6119
|
+
class Roles extends APermissions {
|
|
6120
|
+
constructor() {
|
|
6121
|
+
super(AuthorizationTypeEnum.Rbac);
|
|
6122
|
+
this._roles = [];
|
|
6060
6123
|
}
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
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;
|
|
6067
6142
|
}
|
|
6068
|
-
this.executionSubject.error(err);
|
|
6069
|
-
this.executionIsRunningSubject.next(false);
|
|
6070
|
-
}
|
|
6071
|
-
finish() {
|
|
6072
|
-
this.executionSubject.complete();
|
|
6073
|
-
this.executionIsRunningSubject.complete();
|
|
6074
|
-
}
|
|
6075
|
-
}
|
|
6076
|
-
/**
|
|
6077
|
-
* Class containing all main data for action validations (enabled/visible) to be executed in validation states.
|
|
6078
|
-
*/
|
|
6079
|
-
class ActionContextValidation {
|
|
6080
|
-
constructor(descriptor, parameters, dataProvider, serviceInstance) {
|
|
6081
|
-
this.descriptor = descriptor;
|
|
6082
|
-
this.parameters = parameters;
|
|
6083
|
-
this.dataProvider = dataProvider;
|
|
6084
|
-
this.serviceInstance = serviceInstance;
|
|
6085
|
-
}
|
|
6086
|
-
}
|
|
6087
|
-
class ActionParameters {
|
|
6088
|
-
constructor(itemId, item) {
|
|
6089
|
-
this.itemId = itemId;
|
|
6090
|
-
this.item = item;
|
|
6091
|
-
this.selectedItems = [];
|
|
6092
|
-
}
|
|
6093
|
-
withActionData(actionData) {
|
|
6094
|
-
this.actionData = actionData;
|
|
6095
|
-
return this;
|
|
6096
|
-
}
|
|
6097
|
-
withQueryParam(queryParam) {
|
|
6098
|
-
this.queryParam = queryParam;
|
|
6099
|
-
return this;
|
|
6100
|
-
}
|
|
6101
|
-
withViewContainer(viewContainer) {
|
|
6102
|
-
this.viewContainer = viewContainer;
|
|
6103
|
-
return this;
|
|
6104
|
-
}
|
|
6105
|
-
withSourceComponent(sourceComponent) {
|
|
6106
|
-
this.sourceComponent = sourceComponent;
|
|
6107
|
-
return this;
|
|
6108
|
-
}
|
|
6109
|
-
withRoute(route) {
|
|
6110
|
-
this.route = route;
|
|
6111
|
-
return this;
|
|
6112
6143
|
}
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
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
|
+
}
|
|
6116
6153
|
}
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
(function (ActionInstanceStateEnum) {
|
|
6120
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["TriggerStart"] = 0] = "TriggerStart";
|
|
6121
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["TriggerEnd"] = 1] = "TriggerEnd";
|
|
6122
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["ActivationStart"] = 2] = "ActivationStart";
|
|
6123
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["ActivationEnd"] = 3] = "ActivationEnd";
|
|
6124
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["FetchStart"] = 4] = "FetchStart";
|
|
6125
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["FetchEnd"] = 5] = "FetchEnd";
|
|
6126
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["FetchError"] = 6] = "FetchError";
|
|
6127
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["RunConfirmationStart"] = 7] = "RunConfirmationStart";
|
|
6128
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["RunConfirmationEndAccept"] = 8] = "RunConfirmationEndAccept";
|
|
6129
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["RunConfirmationEndReject"] = 9] = "RunConfirmationEndReject";
|
|
6130
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["RunStart"] = 10] = "RunStart";
|
|
6131
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["RunEnd"] = 11] = "RunEnd";
|
|
6132
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["RunError"] = 12] = "RunError";
|
|
6133
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["NextActionStart"] = 13] = "NextActionStart";
|
|
6134
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["NextActionEnd"] = 14] = "NextActionEnd";
|
|
6135
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishSuccess"] = 15] = "FinishSuccess";
|
|
6136
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishError"] = 16] = "FinishError";
|
|
6137
|
-
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishDismissed"] = 17] = "FinishDismissed"; // action was dismissed by user
|
|
6138
|
-
})(ActionInstanceStateEnum || (ActionInstanceStateEnum = {}));
|
|
6139
|
-
|
|
6140
|
-
/**
|
|
6141
|
-
* Default categories for tableview actions
|
|
6142
|
-
*/
|
|
6143
|
-
class TableviewActionDefaultCategories {
|
|
6144
|
-
}
|
|
6145
|
-
TableviewActionDefaultCategories.READ = 'read';
|
|
6146
|
-
TableviewActionDefaultCategories.ADD = 'add';
|
|
6147
|
-
TableviewActionDefaultCategories.EDIT = 'edit';
|
|
6148
|
-
TableviewActionDefaultCategories.DELETE = 'delete';
|
|
6149
|
-
TableviewActionDefaultCategories.DETAILS = 'details';
|
|
6154
|
+
Permissions.Service = Service;
|
|
6155
|
+
})(Permissions || (Permissions = {}));
|
|
6150
6156
|
|
|
6151
6157
|
class AuthorizationUtil {
|
|
6152
6158
|
static isPermitted(permissions, userRoles) {
|
|
@@ -7521,23 +7527,36 @@ class MngViewContainerComponentService {
|
|
|
7521
7527
|
constructor(messageService) {
|
|
7522
7528
|
this.messageService = messageService;
|
|
7523
7529
|
this.actions = [];
|
|
7524
|
-
this.
|
|
7530
|
+
this._tableReloadSubject = new Subject();
|
|
7531
|
+
this._editorResetSubject = new Subject();
|
|
7525
7532
|
}
|
|
7526
7533
|
set dataProvider(dataProvider) {
|
|
7527
7534
|
this._dataProvider = dataProvider;
|
|
7528
7535
|
}
|
|
7529
|
-
get reloadTable() {
|
|
7530
|
-
return this._reloadTableSubject.asObservable();
|
|
7531
|
-
}
|
|
7532
|
-
triggerTableReload(event) {
|
|
7533
|
-
this._reloadTableSubject.next(event);
|
|
7534
|
-
}
|
|
7535
7536
|
getMessageService() {
|
|
7536
7537
|
return this.messageService;
|
|
7537
7538
|
}
|
|
7538
7539
|
getDataProvider() {
|
|
7539
7540
|
return this._dataProvider;
|
|
7540
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
|
+
}
|
|
7541
7560
|
}
|
|
7542
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 });
|
|
7543
7562
|
MngViewContainerComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngViewContainerComponentService });
|
|
@@ -7650,9 +7669,9 @@ class MngActionComponent {
|
|
|
7650
7669
|
if (this.action instanceof ActionLinkDescriptor) {
|
|
7651
7670
|
this.actionLink = this.action;
|
|
7652
7671
|
}
|
|
7653
|
-
if (this.action.
|
|
7654
|
-
if (routeData.tableviewPermissions[this.action.
|
|
7655
|
-
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];
|
|
7656
7675
|
}
|
|
7657
7676
|
}
|
|
7658
7677
|
this.processSubscriptions();
|
|
@@ -7663,7 +7682,7 @@ class MngActionComponent {
|
|
|
7663
7682
|
this.isHostHidden = !isVisible || !isPermitted;
|
|
7664
7683
|
});
|
|
7665
7684
|
this.subscriptions.push(hostVisibilitySubscription);
|
|
7666
|
-
this.buttonClass = this.action.button.styleClass.build(this.
|
|
7685
|
+
this.buttonClass = this.action.button.styleClass.build(this.hasNoTitle);
|
|
7667
7686
|
}
|
|
7668
7687
|
ngOnChanges(changes) {
|
|
7669
7688
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -7697,10 +7716,10 @@ class MngActionComponent {
|
|
|
7697
7716
|
const instance = this.actionExecutor.triggerAction(this.action, parameters);
|
|
7698
7717
|
this.subscriptions.push(instance.result$.subscribe({
|
|
7699
7718
|
next: () => {
|
|
7700
|
-
var _a;
|
|
7719
|
+
var _a, _b;
|
|
7701
7720
|
this.finishEventEmitter.next(instance);
|
|
7702
7721
|
if (this.action.hasItemsSelection) {
|
|
7703
|
-
(_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 } });
|
|
7704
7723
|
}
|
|
7705
7724
|
}
|
|
7706
7725
|
}));
|
|
@@ -7765,10 +7784,10 @@ class MngActionComponent {
|
|
|
7765
7784
|
}
|
|
7766
7785
|
}
|
|
7767
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 });
|
|
7768
|
-
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 });
|
|
7769
7788
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionComponent, decorators: [{
|
|
7770
7789
|
type: Component,
|
|
7771
|
-
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"] }]
|
|
7772
7791
|
}], ctorParameters: function () {
|
|
7773
7792
|
return [{ type: i1.ActivatedRoute }, { type: i1$2.TranslateService }, { type: MngAuthorizationService }, { type: MngActionExecutorService }, { type: i2.ConfirmationService }, { type: MngViewContainerComponentService, decorators: [{
|
|
7774
7793
|
type: Optional
|
|
@@ -7821,7 +7840,7 @@ class MngActionRouteComponent {
|
|
|
7821
7840
|
}
|
|
7822
7841
|
ngOnInit() {
|
|
7823
7842
|
var _a, _b;
|
|
7824
|
-
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 : [];
|
|
7825
7844
|
const subscription = this.route.params.subscribe(p => {
|
|
7826
7845
|
const action = this.findActiveAction(p);
|
|
7827
7846
|
if (action) {
|
|
@@ -7869,7 +7888,7 @@ class MngActionRouteComponent {
|
|
|
7869
7888
|
if (!this.viewContainerService) {
|
|
7870
7889
|
console.warn(`View container service could not be found, table reload will not be triggered.`);
|
|
7871
7890
|
}
|
|
7872
|
-
(_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
|
|
7873
7892
|
}
|
|
7874
7893
|
this.untriggerAction();
|
|
7875
7894
|
});
|
|
@@ -8073,6 +8092,34 @@ class MngFormEditorComponent {
|
|
|
8073
8092
|
});
|
|
8074
8093
|
return formValue;
|
|
8075
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
|
+
}
|
|
8076
8123
|
getFormField(key) {
|
|
8077
8124
|
return this.findFormField(this.form, key.split('.'));
|
|
8078
8125
|
}
|
|
@@ -8141,34 +8188,6 @@ class MngFormEditorComponent {
|
|
|
8141
8188
|
}
|
|
8142
8189
|
return false;
|
|
8143
8190
|
}
|
|
8144
|
-
resetFormModel(item) {
|
|
8145
|
-
this.formOrigItem = item;
|
|
8146
|
-
// TODO: to check if this is ok, could be problems with dates, if so, try lodash
|
|
8147
|
-
const formModel = JSON.parse(JSON.stringify(item !== null && item !== void 0 ? item : {}));
|
|
8148
|
-
this.descriptor.fields.forEach(field => {
|
|
8149
|
-
if (field.getter && item) {
|
|
8150
|
-
const splitPath = field.property.split('.');
|
|
8151
|
-
let currentObject = formModel;
|
|
8152
|
-
for (let i = 0; i < splitPath.length; i++) {
|
|
8153
|
-
const currentSubPath = splitPath[i];
|
|
8154
|
-
if (i === splitPath.length - 1) {
|
|
8155
|
-
currentObject[currentSubPath] = field.getter(item);
|
|
8156
|
-
}
|
|
8157
|
-
else {
|
|
8158
|
-
if (typeof currentObject[currentSubPath] !== 'object') {
|
|
8159
|
-
currentObject[currentSubPath] = {};
|
|
8160
|
-
}
|
|
8161
|
-
currentObject = currentObject[currentSubPath];
|
|
8162
|
-
}
|
|
8163
|
-
}
|
|
8164
|
-
}
|
|
8165
|
-
});
|
|
8166
|
-
if (typeof this.formOptions.resetModel === 'function') {
|
|
8167
|
-
// could not be initiated yet
|
|
8168
|
-
this.formOptions.resetModel(this.formModel);
|
|
8169
|
-
}
|
|
8170
|
-
this.formModel = formModel;
|
|
8171
|
-
}
|
|
8172
8191
|
updateFormState() {
|
|
8173
8192
|
this.formOptions.formState.disabled = this.isFormDisabled !== null ? this.isFormDisabled === true : this.descriptor.disabled;
|
|
8174
8193
|
}
|
|
@@ -8233,6 +8252,9 @@ class MngAutocompleteComponent {
|
|
|
8233
8252
|
this.multiselect = false;
|
|
8234
8253
|
this.className = null;
|
|
8235
8254
|
this.dropdownClassName = null;
|
|
8255
|
+
this.showClear = false;
|
|
8256
|
+
this.autoClear = false;
|
|
8257
|
+
this.selectFirst = false; //on every input field change return first given value (or null)
|
|
8236
8258
|
this.valueChangeEventEmitter = new EventEmitter();
|
|
8237
8259
|
this.isInited = false;
|
|
8238
8260
|
this.suggestionsSubject = new BehaviorSubject([]);
|
|
@@ -8247,10 +8269,14 @@ class MngAutocompleteComponent {
|
|
|
8247
8269
|
}
|
|
8248
8270
|
ngOnInit() {
|
|
8249
8271
|
this.setItemsAndDataProvider();
|
|
8272
|
+
if (this.selectFirst) {
|
|
8273
|
+
this.suggestionSubscription = this.suggestions$.subscribe(e => this.valueChangeEventEmitter.emit(e.length === 0 ? null : e[0]));
|
|
8274
|
+
}
|
|
8250
8275
|
}
|
|
8251
8276
|
ngOnDestroy() {
|
|
8252
|
-
var _a;
|
|
8277
|
+
var _a, _b;
|
|
8253
8278
|
(_a = this.searchSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
8279
|
+
(_b = this.suggestionSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
8254
8280
|
}
|
|
8255
8281
|
onSearch(event) {
|
|
8256
8282
|
var _a;
|
|
@@ -8290,6 +8316,11 @@ class MngAutocompleteComponent {
|
|
|
8290
8316
|
var _a, _b;
|
|
8291
8317
|
(_b = (_a = this.formlyWrapper) === null || _a === void 0 ? void 0 : _a.formControl) === null || _b === void 0 ? void 0 : _b.markAsTouched();
|
|
8292
8318
|
}
|
|
8319
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8320
|
+
onClear(event) {
|
|
8321
|
+
this.onChangeFn();
|
|
8322
|
+
this.valueChangeEventEmitter.next(null);
|
|
8323
|
+
}
|
|
8293
8324
|
registerOnChange(fn) {
|
|
8294
8325
|
this.onChangeFn = fn;
|
|
8295
8326
|
}
|
|
@@ -8454,10 +8485,10 @@ class MngAutocompleteComponent {
|
|
|
8454
8485
|
}
|
|
8455
8486
|
}
|
|
8456
8487
|
MngAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngAutocompleteComponent, deps: [{ token: i0.Injector }, { token: i1$2.TranslateService }, { token: MngFormlyFieldWrapperComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
8457
|
-
MngAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: { dataProvider: "dataProvider", dataKeyProperty: "dataKeyProperty", itemsValuePropertyInit: ["itemsValueProperty", "itemsValuePropertyInit"], itemsLabelPropertyInit: ["itemsLabelProperty", "itemsLabelPropertyInit"], itemsLabelTranslate: "itemsLabelTranslate", inlineSearch: "inlineSearch", openOnFocus: "openOnFocus", multiselect: "multiselect", placeholder: "placeholder", className: "className", dropdownClassName: "dropdownClassName" }, outputs: { valueChangeEventEmitter: "valueChange" }, providers: [MNG_AUTOCOMPLETE_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeAutocomplete", first: true, predicate: AutoComplete, descendants: true }], ngImport: i0, template: "<p-autoComplete\n (onFocus)=\"onFocus($event)\"\n [formControl]=\"autocompleteFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dropdown]=\"true\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [field]=\"$any(itemsLabelProperty)\"\n [suggestions]=\"(suggestions$ | async) ?? []\"\n [multiple]=\"multiselect\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n [minLength]=\"openOnFocus ? 0 : 1\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n (onBlur)=\"onBlur($event)\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n", dependencies: [{ kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4$2.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "field", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "itemSize", "suggestions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8488
|
+
MngAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: { dataProvider: "dataProvider", dataKeyProperty: "dataKeyProperty", itemsValuePropertyInit: ["itemsValueProperty", "itemsValuePropertyInit"], itemsLabelPropertyInit: ["itemsLabelProperty", "itemsLabelPropertyInit"], itemsLabelTranslate: "itemsLabelTranslate", inlineSearch: "inlineSearch", openOnFocus: "openOnFocus", multiselect: "multiselect", placeholder: "placeholder", className: "className", dropdownClassName: "dropdownClassName", showClear: "showClear", autoClear: "autoClear", selectFirst: "selectFirst" }, outputs: { valueChangeEventEmitter: "valueChange" }, providers: [MNG_AUTOCOMPLETE_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeAutocomplete", first: true, predicate: AutoComplete, descendants: true }], ngImport: i0, template: "<p-autoComplete\n (onFocus)=\"onFocus($event)\"\n [formControl]=\"autocompleteFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dropdown]=\"true\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [field]=\"$any(itemsLabelProperty)\"\n [suggestions]=\"(suggestions$ | async) ?? []\"\n [multiple]=\"multiselect\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n [minLength]=\"openOnFocus ? 0 : 1\"\n [showClear]=\"showClear\"\n [forceSelection]=\"autoClear\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n (onBlur)=\"onBlur($event)\"\n (onClear)=\"onClear($event)\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n", dependencies: [{ kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4$2.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "field", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "itemSize", "suggestions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8458
8489
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngAutocompleteComponent, decorators: [{
|
|
8459
8490
|
type: Component,
|
|
8460
|
-
args: [{ selector: 'mng-autocomplete', providers: [MNG_AUTOCOMPLETE_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-autoComplete\n (onFocus)=\"onFocus($event)\"\n [formControl]=\"autocompleteFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dropdown]=\"true\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [field]=\"$any(itemsLabelProperty)\"\n [suggestions]=\"(suggestions$ | async) ?? []\"\n [multiple]=\"multiselect\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n [minLength]=\"openOnFocus ? 0 : 1\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n (onBlur)=\"onBlur($event)\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n" }]
|
|
8491
|
+
args: [{ selector: 'mng-autocomplete', providers: [MNG_AUTOCOMPLETE_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-autoComplete\n (onFocus)=\"onFocus($event)\"\n [formControl]=\"autocompleteFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dropdown]=\"true\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [field]=\"$any(itemsLabelProperty)\"\n [suggestions]=\"(suggestions$ | async) ?? []\"\n [multiple]=\"multiselect\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n [minLength]=\"openOnFocus ? 0 : 1\"\n [showClear]=\"showClear\"\n [forceSelection]=\"autoClear\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n (onBlur)=\"onBlur($event)\"\n (onClear)=\"onClear($event)\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n" }]
|
|
8461
8492
|
}], ctorParameters: function () {
|
|
8462
8493
|
return [{ type: i0.Injector }, { type: i1$2.TranslateService }, { type: MngFormlyFieldWrapperComponent, decorators: [{
|
|
8463
8494
|
type: Optional
|
|
@@ -8486,6 +8517,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
8486
8517
|
type: Input
|
|
8487
8518
|
}], dropdownClassName: [{
|
|
8488
8519
|
type: Input
|
|
8520
|
+
}], showClear: [{
|
|
8521
|
+
type: Input
|
|
8522
|
+
}], autoClear: [{
|
|
8523
|
+
type: Input
|
|
8524
|
+
}], selectFirst: [{
|
|
8525
|
+
type: Input
|
|
8489
8526
|
}], valueChangeEventEmitter: [{
|
|
8490
8527
|
type: Output,
|
|
8491
8528
|
args: ['valueChange']
|
|
@@ -8795,9 +8832,7 @@ class MngActionEditorComponent {
|
|
|
8795
8832
|
this.viewContainerService = viewContainerService;
|
|
8796
8833
|
this.actionRunEventEmitter = new EventEmitter();
|
|
8797
8834
|
this.actionCancelEventEmitter = new EventEmitter();
|
|
8798
|
-
this.cmpId = Math.random().toString(36).substring(2);
|
|
8799
8835
|
this.isDialog = true;
|
|
8800
|
-
this.isSaveButton = true;
|
|
8801
8836
|
this.toolbarLeftActions = [];
|
|
8802
8837
|
this.toolbarRightActions = [];
|
|
8803
8838
|
this.footerLeftActions = [];
|
|
@@ -8811,7 +8846,7 @@ class MngActionEditorComponent {
|
|
|
8811
8846
|
this.subscriptions = [];
|
|
8812
8847
|
}
|
|
8813
8848
|
ngOnInit() {
|
|
8814
|
-
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;
|
|
8815
8850
|
if ((_a = this.dialogConfig) === null || _a === void 0 ? void 0 : _a.data) {
|
|
8816
8851
|
if (this.dialogConfig.data.actionInstance) {
|
|
8817
8852
|
this.instance = this.dialogConfig.data.actionInstance;
|
|
@@ -8838,7 +8873,6 @@ class MngActionEditorComponent {
|
|
|
8838
8873
|
this.isDialog = false;
|
|
8839
8874
|
this.viewContainer = (_o = (_m = this.viewContainerInit) !== null && _m !== void 0 ? _m : this.viewContainerService) !== null && _o !== void 0 ? _o : undefined;
|
|
8840
8875
|
}
|
|
8841
|
-
this.isSaveButton = typeof this.action.submitFunction === 'function';
|
|
8842
8876
|
this.setTitle();
|
|
8843
8877
|
for (const action of this.action.editorActions) {
|
|
8844
8878
|
if (action instanceof ActionEditorSubmitDescriptor) {
|
|
@@ -8863,24 +8897,33 @@ class MngActionEditorComponent {
|
|
|
8863
8897
|
});
|
|
8864
8898
|
}
|
|
8865
8899
|
}
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
case ActionPositionEnum.ToolbarRight:
|
|
8871
|
-
this.toolbarRightActions.push(action);
|
|
8872
|
-
break;
|
|
8873
|
-
case ActionPositionEnum.FooterLeft:
|
|
8874
|
-
this.footerLeftActions.push(action);
|
|
8875
|
-
break;
|
|
8876
|
-
case ActionPositionEnum.FooterRight:
|
|
8877
|
-
this.footerRightActions.push(action);
|
|
8878
|
-
break;
|
|
8879
|
-
}
|
|
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);
|
|
8880
8904
|
}
|
|
8881
8905
|
this.toolbarRightActions = this.toolbarRightActions.reverse();
|
|
8882
8906
|
this.footerRightActions = this.footerRightActions.reverse();
|
|
8883
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
|
+
}
|
|
8884
8927
|
}
|
|
8885
8928
|
ngOnDestroy() {
|
|
8886
8929
|
this.subscriptions.forEach(s => s.unsubscribe());
|
|
@@ -8972,12 +9015,28 @@ class MngActionEditorComponent {
|
|
|
8972
9015
|
this.actionExecutor.deactivateAction(this.instance);
|
|
8973
9016
|
}
|
|
8974
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
|
+
}
|
|
8975
9034
|
}
|
|
8976
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 });
|
|
8977
|
-
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 });
|
|
8978
9037
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionEditorComponent, decorators: [{
|
|
8979
9038
|
type: Component,
|
|
8980
|
-
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" }]
|
|
8981
9040
|
}], ctorParameters: function () {
|
|
8982
9041
|
return [{ type: i0.Injector }, { type: i1$2.TranslateService }, { type: MngActionExecutorService }, { type: MngCommonsService }, { type: MngNavigationService }, { type: i3.DynamicDialogRef, decorators: [{
|
|
8983
9042
|
type: Optional
|
|
@@ -9051,10 +9110,10 @@ class MngFormlyFieldAutocompleteComponent extends FieldType {
|
|
|
9051
9110
|
}
|
|
9052
9111
|
}
|
|
9053
9112
|
MngFormlyFieldAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
9054
|
-
MngFormlyFieldAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngFormlyFieldAutocompleteComponent, selector: "mng-formly-field-autocomplete", usesInheritance: true, ngImport: i0, template: "<mng-autocomplete\n [id]=\"$any(key)\"\n [formControl]=\"aFormControl\"\n [formlyAttributes]=\"field\"\n [dataProvider]=\"$any(descriptor.dataProvider)\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [className]=\"descriptor.inputClassName\">\n</mng-autocomplete>\n", dependencies: [{ kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { kind: "component", type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsValueProperty", "itemsLabelProperty", "itemsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9113
|
+
MngFormlyFieldAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngFormlyFieldAutocompleteComponent, selector: "mng-formly-field-autocomplete", usesInheritance: true, ngImport: i0, template: "<mng-autocomplete\n [id]=\"$any(key)\"\n [formControl]=\"aFormControl\"\n [formlyAttributes]=\"field\"\n [dataProvider]=\"$any(descriptor.dataProvider)\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [className]=\"descriptor.inputClassName\"\n [showClear]=\"!to.required\"\n [selectFirst]=\"descriptor.autocompleteSelectFirst\"\n [autoClear]=\"descriptor.autocompleteAutoClear\">\n</mng-autocomplete>\n", dependencies: [{ kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { kind: "component", type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsValueProperty", "itemsLabelProperty", "itemsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName", "showClear", "autoClear", "selectFirst"], outputs: ["valueChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9055
9114
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldAutocompleteComponent, decorators: [{
|
|
9056
9115
|
type: Component,
|
|
9057
|
-
args: [{ selector: 'mng-formly-field-autocomplete', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-autocomplete\n [id]=\"$any(key)\"\n [formControl]=\"aFormControl\"\n [formlyAttributes]=\"field\"\n [dataProvider]=\"$any(descriptor.dataProvider)\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [className]=\"descriptor.inputClassName\">\n</mng-autocomplete>\n" }]
|
|
9116
|
+
args: [{ selector: 'mng-formly-field-autocomplete', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-autocomplete\n [id]=\"$any(key)\"\n [formControl]=\"aFormControl\"\n [formlyAttributes]=\"field\"\n [dataProvider]=\"$any(descriptor.dataProvider)\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [className]=\"descriptor.inputClassName\"\n [showClear]=\"!to.required\"\n [selectFirst]=\"descriptor.autocompleteSelectFirst\"\n [autoClear]=\"descriptor.autocompleteAutoClear\">\n</mng-autocomplete>\n" }]
|
|
9058
9117
|
}] });
|
|
9059
9118
|
|
|
9060
9119
|
class MngFormlyFieldInputComponent extends FieldType {
|
|
@@ -9374,7 +9433,7 @@ class MngTableColumnFilterComponent {
|
|
|
9374
9433
|
}
|
|
9375
9434
|
}
|
|
9376
9435
|
MngTableColumnFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableColumnFilterComponent, deps: [{ token: i2.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });
|
|
9377
|
-
MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, viewQueries: [{ propertyName: "primeColumnFilter", first: true, predicate: ColumnFilter, descendants: true }], ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"$any(primeDefaultMatchMode)\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\"\n [showMenu]=\"primeShowMatchMode\"\n [minFractionDigits]=\"$any(descriptor.numberMinFractionDigits)\"\n [maxFractionDigits]=\"$any(descriptor.numberMaxFractionDigits)\"\n [useGrouping]=\"descriptor.numberUseGrouping\">\n <ng-template *ngIf=\"primeType === 'date'\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container *ngIf=\"activeMatchMode === 'between'; else datePicker\">\n <mng-date-range\n [ngModel]=\"value\"\n (ngModelChange)=\"dateFilter($event, filterCallback)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [dateFormat]=\"descriptor.datePickerFormat\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"></mng-date-range>\n </ng-container>\n <ng-template #datePicker>\n <p-calendar\n appendTo=\"body\"\n [ngModel]=\"value\"\n (ngModelChange)=\"dateFilter($event, filterCallback)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showIcon]=\"true\"\n [dateFormat]=\"descriptor.datePickerFormat ?? 'dd.mm.yy'\"\n [showTime]=\"descriptor.datePickerShowTime\">\n </p-calendar>\n </ng-template>\n </ng-template>\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [openOnFocus]=\"lookupDescriptor.autocompleteOpenOnFocus\"\n [inlineSearch]=\"lookupDescriptor.autocompleteInlineSearch\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"false\"\n [changeValueOnBlur]=\"lookupDescriptor.multiselect\"\n (valueChange)=\"dropdownFilter($event, filterCallback)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n", dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i4$3.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$4.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { kind: "component", type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsValueProperty", "itemsLabelProperty", "itemsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }, { kind: "component", type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsLabelTranslate", "itemsValueProperty", "itemsDisabledProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName", "changeValueOnBlur"], outputs: ["valueChange"] }, { kind: "component", type: MngDateRangeComponent, selector: "mng-date-range", inputs: ["placeholder", "showTime", "showSeconds", "dateFormat"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
|
|
9436
|
+
MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, viewQueries: [{ propertyName: "primeColumnFilter", first: true, predicate: ColumnFilter, descendants: true }], ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"$any(primeDefaultMatchMode)\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\"\n [showMenu]=\"primeShowMatchMode\"\n [minFractionDigits]=\"$any(descriptor.numberMinFractionDigits)\"\n [maxFractionDigits]=\"$any(descriptor.numberMaxFractionDigits)\"\n [useGrouping]=\"descriptor.numberUseGrouping\">\n <ng-template *ngIf=\"primeType === 'date'\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container *ngIf=\"activeMatchMode === 'between'; else datePicker\">\n <mng-date-range\n [ngModel]=\"value\"\n (ngModelChange)=\"dateFilter($event, filterCallback)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [dateFormat]=\"descriptor.datePickerFormat\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"></mng-date-range>\n </ng-container>\n <ng-template #datePicker>\n <p-calendar\n appendTo=\"body\"\n [ngModel]=\"value\"\n (ngModelChange)=\"dateFilter($event, filterCallback)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showIcon]=\"true\"\n [dateFormat]=\"descriptor.datePickerFormat ?? 'dd.mm.yy'\"\n [showTime]=\"descriptor.datePickerShowTime\">\n </p-calendar>\n </ng-template>\n </ng-template>\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [openOnFocus]=\"lookupDescriptor.autocompleteOpenOnFocus\"\n [inlineSearch]=\"lookupDescriptor.autocompleteInlineSearch\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"false\"\n [changeValueOnBlur]=\"lookupDescriptor.multiselect\"\n (valueChange)=\"dropdownFilter($event, filterCallback)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n", dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i4$3.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$4.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { kind: "component", type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsValueProperty", "itemsLabelProperty", "itemsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName", "showClear", "autoClear", "selectFirst"], outputs: ["valueChange"] }, { kind: "component", type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsLabelTranslate", "itemsValueProperty", "itemsDisabledProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName", "changeValueOnBlur"], outputs: ["valueChange"] }, { kind: "component", type: MngDateRangeComponent, selector: "mng-date-range", inputs: ["placeholder", "showTime", "showSeconds", "dateFormat"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
|
|
9378
9437
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableColumnFilterComponent, decorators: [{
|
|
9379
9438
|
type: Component,
|
|
9380
9439
|
args: [{ selector: 'mng-table-column-filter', template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"$any(primeDefaultMatchMode)\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\"\n [showMenu]=\"primeShowMatchMode\"\n [minFractionDigits]=\"$any(descriptor.numberMinFractionDigits)\"\n [maxFractionDigits]=\"$any(descriptor.numberMaxFractionDigits)\"\n [useGrouping]=\"descriptor.numberUseGrouping\">\n <ng-template *ngIf=\"primeType === 'date'\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container *ngIf=\"activeMatchMode === 'between'; else datePicker\">\n <mng-date-range\n [ngModel]=\"value\"\n (ngModelChange)=\"dateFilter($event, filterCallback)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [dateFormat]=\"descriptor.datePickerFormat\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"></mng-date-range>\n </ng-container>\n <ng-template #datePicker>\n <p-calendar\n appendTo=\"body\"\n [ngModel]=\"value\"\n (ngModelChange)=\"dateFilter($event, filterCallback)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showIcon]=\"true\"\n [dateFormat]=\"descriptor.datePickerFormat ?? 'dd.mm.yy'\"\n [showTime]=\"descriptor.datePickerShowTime\">\n </p-calendar>\n </ng-template>\n </ng-template>\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [openOnFocus]=\"lookupDescriptor.autocompleteOpenOnFocus\"\n [inlineSearch]=\"lookupDescriptor.autocompleteInlineSearch\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"false\"\n [changeValueOnBlur]=\"lookupDescriptor.multiselect\"\n (valueChange)=\"dropdownFilter($event, filterCallback)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n" }]
|
|
@@ -9938,8 +9997,7 @@ class MngTableviewComponent {
|
|
|
9938
9997
|
this.actionExecutor = actionExecutor;
|
|
9939
9998
|
this.viewContainerService = viewContainerService;
|
|
9940
9999
|
this.actions = [];
|
|
9941
|
-
this.
|
|
9942
|
-
this.rowInlineActions = [];
|
|
10000
|
+
this.tableActions = [];
|
|
9943
10001
|
this.toolbarLeftActions = [];
|
|
9944
10002
|
this.toolbarRightActions = [];
|
|
9945
10003
|
this.subscriptions = [];
|
|
@@ -9947,28 +10005,27 @@ class MngTableviewComponent {
|
|
|
9947
10005
|
this.selectedItems = [];
|
|
9948
10006
|
}
|
|
9949
10007
|
ngOnInit() {
|
|
9950
|
-
this.viewContainerService.
|
|
10008
|
+
this.viewContainerService.setActions(this.actions);
|
|
9951
10009
|
if (this.dataProvider) {
|
|
9952
10010
|
this.viewContainerService.dataProvider = this.dataProvider;
|
|
9953
10011
|
}
|
|
9954
|
-
const reloadTableSubscription = this.viewContainerService.
|
|
10012
|
+
const reloadTableSubscription = this.viewContainerService.getTableReload$().subscribe(() => {
|
|
9955
10013
|
this.reloadTable();
|
|
9956
10014
|
});
|
|
9957
10015
|
this.subscriptions.push(reloadTableSubscription);
|
|
9958
|
-
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; })) {
|
|
9959
10017
|
switch (action.position) {
|
|
9960
|
-
case ActionPositionEnum.RowClick:
|
|
9961
|
-
this.rowClickActions.push(action);
|
|
9962
|
-
break;
|
|
9963
|
-
case ActionPositionEnum.RowInline:
|
|
9964
|
-
this.rowInlineActions.push(action);
|
|
9965
|
-
break;
|
|
9966
10018
|
case ActionPositionEnum.ToolbarLeft:
|
|
9967
10019
|
this.toolbarLeftActions.push(action);
|
|
9968
10020
|
break;
|
|
9969
10021
|
case ActionPositionEnum.ToolbarRight:
|
|
9970
10022
|
this.toolbarRightActions.push(action);
|
|
9971
10023
|
break;
|
|
10024
|
+
case ActionPositionEnum.TableHeader:
|
|
10025
|
+
case ActionPositionEnum.RowInline:
|
|
10026
|
+
case ActionPositionEnum.RowClick:
|
|
10027
|
+
this.tableActions.push(action);
|
|
10028
|
+
break;
|
|
9972
10029
|
}
|
|
9973
10030
|
}
|
|
9974
10031
|
this.toolbarRightActions = this.toolbarRightActions.reverse();
|
|
@@ -9992,6 +10049,9 @@ class MngTableviewComponent {
|
|
|
9992
10049
|
getDataProvider() {
|
|
9993
10050
|
return this.dataProvider;
|
|
9994
10051
|
}
|
|
10052
|
+
getActions() {
|
|
10053
|
+
return this.actions;
|
|
10054
|
+
}
|
|
9995
10055
|
reloadTable() {
|
|
9996
10056
|
var _a;
|
|
9997
10057
|
(_a = this.tableComponent) === null || _a === void 0 ? void 0 : _a.reload();
|
|
@@ -10004,10 +10064,10 @@ class MngTableviewComponent {
|
|
|
10004
10064
|
}
|
|
10005
10065
|
}
|
|
10006
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 });
|
|
10007
|
-
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" }] });
|
|
10008
10068
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewComponent, decorators: [{
|
|
10009
10069
|
type: Component,
|
|
10010
|
-
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" }]
|
|
10011
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: [{
|
|
10012
10072
|
type: Input
|
|
10013
10073
|
}], dataProvider: [{
|
|
@@ -10044,7 +10104,7 @@ class AMngTableviewRouteComponent {
|
|
|
10044
10104
|
this.createActionDescriptorForExport()
|
|
10045
10105
|
].filter(e => e != null);
|
|
10046
10106
|
}
|
|
10047
|
-
createActionDescriptorForDetails(descriptor = this.descriptor.
|
|
10107
|
+
createActionDescriptorForDetails(descriptor = this.descriptor.detailsEditor) {
|
|
10048
10108
|
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasDetails ? new ActionEditorDetailsDescriptor(descriptor) : null;
|
|
10049
10109
|
}
|
|
10050
10110
|
createActionDescriptorForAdd(descriptor = this.descriptor.addEditor) {
|
|
@@ -10077,10 +10137,11 @@ class AMngTableviewRouteComponent {
|
|
|
10077
10137
|
createActionDescriptorForRefresh(descriptor = this.descriptor.model) {
|
|
10078
10138
|
const action = new ActionDescriptor(descriptor, 'refresh')
|
|
10079
10139
|
.withPosition(ActionPositionEnum.ToolbarRight)
|
|
10080
|
-
.
|
|
10140
|
+
.withTableviewCategory(TableviewActionDefaultCategories.READ)
|
|
10081
10141
|
.withRunNotificationSuccess(undefined, undefined, false)
|
|
10082
10142
|
.withRunFunction((ctx) => {
|
|
10083
|
-
|
|
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, {});
|
|
10084
10145
|
return of(null);
|
|
10085
10146
|
});
|
|
10086
10147
|
action.button.withIcon('pi pi-refresh').styleClass.withActionLevel(StyleLevelEnum.Secondary);
|
|
@@ -10311,9 +10372,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
10311
10372
|
}] } });
|
|
10312
10373
|
|
|
10313
10374
|
class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
10314
|
-
constructor(
|
|
10315
|
-
super();
|
|
10316
|
-
this.actionExecutor = actionExecutor;
|
|
10375
|
+
constructor() {
|
|
10376
|
+
super(...arguments);
|
|
10317
10377
|
this.itemsSubject = new ReplaySubject(1);
|
|
10318
10378
|
this.items$ = this.itemsSubject.asObservable();
|
|
10319
10379
|
this.actions = [];
|
|
@@ -10323,13 +10383,13 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
10323
10383
|
this.isEnabled$ = this.isDisabledSubject.asObservable().pipe(distinctUntilChanged(), map(e => !e));
|
|
10324
10384
|
}
|
|
10325
10385
|
ngOnInit() {
|
|
10326
|
-
this.descriptor = this.
|
|
10386
|
+
this.descriptor = this.props['descriptor'];
|
|
10327
10387
|
const hasViewAction = this.descriptor.fieldActions.some(a => a === FieldManyEditorActionEnum.View);
|
|
10328
10388
|
const hasAddAction = this.descriptor.fieldActions.some(a => a === FieldManyEditorActionEnum.Add);
|
|
10329
10389
|
const hasEditAction = this.descriptor.fieldActions.some(a => a === FieldManyEditorActionEnum.Edit);
|
|
10330
10390
|
const hasDeleteAction = this.descriptor.fieldActions.some(a => a === FieldManyEditorActionEnum.Delete);
|
|
10331
10391
|
if (hasViewAction) {
|
|
10332
|
-
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)
|
|
10333
10393
|
.withPosition(ActionPositionEnum.RowClick)
|
|
10334
10394
|
.withDialogClassName('mng-field-dialog mng-action-editor-dialog')
|
|
10335
10395
|
.withDialogSize(StyleSizeEnum.Small);
|
|
@@ -10462,12 +10522,12 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
10462
10522
|
});
|
|
10463
10523
|
}
|
|
10464
10524
|
}
|
|
10465
|
-
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 });
|
|
10466
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 });
|
|
10467
10527
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
|
|
10468
10528
|
type: Component,
|
|
10469
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"] }]
|
|
10470
|
-
}]
|
|
10530
|
+
}] });
|
|
10471
10531
|
|
|
10472
10532
|
class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
10473
10533
|
constructor(injector) {
|
|
@@ -12629,7 +12689,7 @@ class TableviewRouteBuilder {
|
|
|
12629
12689
|
}
|
|
12630
12690
|
return this;
|
|
12631
12691
|
}
|
|
12632
|
-
|
|
12692
|
+
withPermissionByCategory(key, permissions) {
|
|
12633
12693
|
if (!this.permissions) {
|
|
12634
12694
|
this.permissions = {};
|
|
12635
12695
|
}
|
|
@@ -12713,5 +12773,5 @@ class TableviewRouteBuilder {
|
|
|
12713
12773
|
* Generated bundle index. Do not edit.
|
|
12714
12774
|
*/
|
|
12715
12775
|
|
|
12716
|
-
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 };
|
|
12717
12777
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|