@wemake4u/form-player-se 1.0.17 → 1.0.18
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/esm2022/lib/controls/table.mjs +5 -5
- package/esm2022/lib/controls/textfield.mjs +3 -3
- package/esm2022/lib/dialog/dialog.component.mjs +94 -0
- package/esm2022/lib/directives/dialog.directive.mjs +25 -0
- package/esm2022/lib/directives/register.directive.mjs +5 -8
- package/esm2022/lib/dynamic-form/dynamic-form.component.mjs +41 -12
- package/esm2022/lib/locale/locale-de.mjs +11 -1
- package/esm2022/lib/locale/locale-en.mjs +11 -1
- package/esm2022/lib/locale/locale-es.mjs +11 -1
- package/esm2022/lib/locale/locale-fr.mjs +11 -1
- package/esm2022/lib/locale/locale-it.mjs +11 -1
- package/esm2022/lib/locale/locale-pt.mjs +11 -1
- package/esm2022/lib/services/dialog.service.mjs +107 -0
- package/esm2022/lib/services/function.service.mjs +44 -0
- package/esm2022/lib/services/metadata.service.mjs +28 -1
- package/esm2022/lib/services/programmability.service.mjs +54 -40
- package/esm2022/lib/services/register.service.mjs +13 -22
- package/esm2022/lib/services/scope.service.mjs +12 -23
- package/esm2022/lib/services/toast.service.mjs +10 -1
- package/esm2022/lib/utils/functions.mjs +31 -0
- package/esm2022/lib/utils/gridCells.mjs +12 -8
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/wemake4u-form-player-se.mjs +725 -455
- package/fesm2022/wemake4u-form-player-se.mjs.map +1 -1
- package/lib/controls/table.d.ts +2 -2
- package/lib/controls/textfield.d.ts +1 -1
- package/lib/dialog/dialog.component.d.ts +291 -0
- package/lib/directives/dialog.directive.d.ts +8 -0
- package/lib/directives/register.directive.d.ts +1 -3
- package/lib/dynamic-fields/dynamic-fields.component.d.ts +70 -0
- package/lib/dynamic-form/dynamic-form.component.d.ts +78 -3
- package/lib/locale/locale-de.d.ts +10 -0
- package/lib/locale/locale-en.d.ts +10 -0
- package/lib/locale/locale-es.d.ts +10 -0
- package/lib/locale/locale-fr.d.ts +10 -0
- package/lib/locale/locale-it.d.ts +10 -0
- package/lib/locale/locale-pt.d.ts +10 -0
- package/lib/locale/locale.d.ts +70 -0
- package/lib/services/dialog.service.d.ts +39 -0
- package/lib/services/function.service.d.ts +14 -0
- package/lib/services/metadata.service.d.ts +4 -0
- package/lib/services/programmability.service.d.ts +13 -6
- package/lib/services/register.service.d.ts +5 -6
- package/lib/services/scope.service.d.ts +7 -8
- package/lib/services/toast.service.d.ts +3 -1
- package/lib/utils/functions.d.ts +2 -0
- package/lib/utils/gridCells.d.ts +20 -0
- package/lib/utils/setFilter.d.ts +10 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/esm2022/lib/services/proxy.service.mjs +0 -131
- package/lib/services/proxy.service.d.ts +0 -32
|
@@ -10,6 +10,16 @@ export declare const Texts: {
|
|
|
10
10
|
Show: string;
|
|
11
11
|
Remove: string;
|
|
12
12
|
Close: string;
|
|
13
|
+
Confirm: string;
|
|
14
|
+
OK: string;
|
|
15
|
+
Cancel: string;
|
|
16
|
+
Abort: string;
|
|
17
|
+
Retry: string;
|
|
18
|
+
Ignore: string;
|
|
19
|
+
Yes: string;
|
|
20
|
+
No: string;
|
|
21
|
+
Try: string;
|
|
22
|
+
Continue: string;
|
|
13
23
|
Name: string;
|
|
14
24
|
Size: string;
|
|
15
25
|
Type: string;
|
|
@@ -10,6 +10,16 @@ export declare const Texts: {
|
|
|
10
10
|
Show: string;
|
|
11
11
|
Remove: string;
|
|
12
12
|
Close: string;
|
|
13
|
+
Confirm: string;
|
|
14
|
+
OK: string;
|
|
15
|
+
Cancel: string;
|
|
16
|
+
Abort: string;
|
|
17
|
+
Retry: string;
|
|
18
|
+
Ignore: string;
|
|
19
|
+
Yes: string;
|
|
20
|
+
No: string;
|
|
21
|
+
Try: string;
|
|
22
|
+
Continue: string;
|
|
13
23
|
Name: string;
|
|
14
24
|
Size: string;
|
|
15
25
|
Type: string;
|
package/lib/locale/locale.d.ts
CHANGED
|
@@ -12,6 +12,16 @@ export declare const Texts: {
|
|
|
12
12
|
Show: string;
|
|
13
13
|
Remove: string;
|
|
14
14
|
Close: string;
|
|
15
|
+
Confirm: string;
|
|
16
|
+
OK: string;
|
|
17
|
+
Cancel: string;
|
|
18
|
+
Abort: string;
|
|
19
|
+
Retry: string;
|
|
20
|
+
Ignore: string;
|
|
21
|
+
Yes: string;
|
|
22
|
+
No: string;
|
|
23
|
+
Try: string;
|
|
24
|
+
Continue: string;
|
|
15
25
|
Name: string;
|
|
16
26
|
Size: string;
|
|
17
27
|
Type: string;
|
|
@@ -40,6 +50,16 @@ export declare const Texts: {
|
|
|
40
50
|
Show: string;
|
|
41
51
|
Remove: string;
|
|
42
52
|
Close: string;
|
|
53
|
+
Confirm: string;
|
|
54
|
+
OK: string;
|
|
55
|
+
Cancel: string;
|
|
56
|
+
Abort: string;
|
|
57
|
+
Retry: string;
|
|
58
|
+
Ignore: string;
|
|
59
|
+
Yes: string;
|
|
60
|
+
No: string;
|
|
61
|
+
Try: string;
|
|
62
|
+
Continue: string;
|
|
43
63
|
Name: string;
|
|
44
64
|
Size: string;
|
|
45
65
|
Type: string;
|
|
@@ -68,6 +88,16 @@ export declare const Texts: {
|
|
|
68
88
|
Show: string;
|
|
69
89
|
Remove: string;
|
|
70
90
|
Close: string;
|
|
91
|
+
Confirm: string;
|
|
92
|
+
OK: string;
|
|
93
|
+
Cancel: string;
|
|
94
|
+
Abort: string;
|
|
95
|
+
Retry: string;
|
|
96
|
+
Ignore: string;
|
|
97
|
+
Yes: string;
|
|
98
|
+
No: string;
|
|
99
|
+
Try: string;
|
|
100
|
+
Continue: string;
|
|
71
101
|
Name: string;
|
|
72
102
|
Size: string;
|
|
73
103
|
Type: string;
|
|
@@ -96,6 +126,16 @@ export declare const Texts: {
|
|
|
96
126
|
Show: string;
|
|
97
127
|
Remove: string;
|
|
98
128
|
Close: string;
|
|
129
|
+
Confirm: string;
|
|
130
|
+
OK: string;
|
|
131
|
+
Cancel: string;
|
|
132
|
+
Abort: string;
|
|
133
|
+
Retry: string;
|
|
134
|
+
Ignore: string;
|
|
135
|
+
Yes: string;
|
|
136
|
+
No: string;
|
|
137
|
+
Try: string;
|
|
138
|
+
Continue: string;
|
|
99
139
|
Name: string;
|
|
100
140
|
Size: string;
|
|
101
141
|
Type: string;
|
|
@@ -124,6 +164,16 @@ export declare const Texts: {
|
|
|
124
164
|
Show: string;
|
|
125
165
|
Remove: string;
|
|
126
166
|
Close: string;
|
|
167
|
+
Confirm: string;
|
|
168
|
+
OK: string;
|
|
169
|
+
Cancel: string;
|
|
170
|
+
Abort: string;
|
|
171
|
+
Retry: string;
|
|
172
|
+
Ignore: string;
|
|
173
|
+
Yes: string;
|
|
174
|
+
No: string;
|
|
175
|
+
Try: string;
|
|
176
|
+
Continue: string;
|
|
127
177
|
Name: string;
|
|
128
178
|
Size: string;
|
|
129
179
|
Type: string;
|
|
@@ -152,6 +202,16 @@ export declare const Texts: {
|
|
|
152
202
|
Show: string;
|
|
153
203
|
Remove: string;
|
|
154
204
|
Close: string;
|
|
205
|
+
Confirm: string;
|
|
206
|
+
OK: string;
|
|
207
|
+
Cancel: string;
|
|
208
|
+
Abort: string;
|
|
209
|
+
Retry: string;
|
|
210
|
+
Ignore: string;
|
|
211
|
+
Yes: string;
|
|
212
|
+
No: string;
|
|
213
|
+
Try: string;
|
|
214
|
+
Continue: string;
|
|
155
215
|
Name: string;
|
|
156
216
|
Size: string;
|
|
157
217
|
Type: string;
|
|
@@ -180,6 +240,16 @@ export declare const Texts: {
|
|
|
180
240
|
Show: string;
|
|
181
241
|
Remove: string;
|
|
182
242
|
Close: string;
|
|
243
|
+
Confirm: string;
|
|
244
|
+
OK: string;
|
|
245
|
+
Cancel: string;
|
|
246
|
+
Abort: string;
|
|
247
|
+
Retry: string;
|
|
248
|
+
Ignore: string;
|
|
249
|
+
Yes: string;
|
|
250
|
+
No: string;
|
|
251
|
+
Try: string;
|
|
252
|
+
Continue: string;
|
|
183
253
|
Name: string;
|
|
184
254
|
Size: string;
|
|
185
255
|
Type: string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SirioDialogService, DialogTypes, DialogSizes } from 'ngx-sirio-lib';
|
|
2
|
+
import { IEvaluatorProvider } from '../services/programmability.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class DialogService implements IEvaluatorProvider {
|
|
5
|
+
private dialogService;
|
|
6
|
+
constructor(dialogService: SirioDialogService);
|
|
7
|
+
openDialog(formSchema: any, options?: FormDialogOptions): void;
|
|
8
|
+
alert(text: string, options?: DialogOptions): void;
|
|
9
|
+
info(text: string, options?: DialogOptions): void;
|
|
10
|
+
confirm(text: string, options?: DialogOptions): void;
|
|
11
|
+
getContext(): Record<string, any>;
|
|
12
|
+
private showDialog;
|
|
13
|
+
private createTextSchema;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>;
|
|
16
|
+
}
|
|
17
|
+
export interface DialogOptions {
|
|
18
|
+
type?: DialogTypes;
|
|
19
|
+
size?: DialogSizes;
|
|
20
|
+
title?: string;
|
|
21
|
+
isDrawer?: boolean;
|
|
22
|
+
closeButton?: boolean;
|
|
23
|
+
language?: string;
|
|
24
|
+
buttons?: DialogButtons;
|
|
25
|
+
onResult?: (result: DialogResult) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface FormDialogOptions extends DialogOptions {
|
|
28
|
+
value?: any;
|
|
29
|
+
showNav?: boolean;
|
|
30
|
+
showNavButton?: boolean;
|
|
31
|
+
showProgress?: boolean;
|
|
32
|
+
showFormTitle?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface DialogResult {
|
|
35
|
+
action: DialogAction;
|
|
36
|
+
value?: any;
|
|
37
|
+
}
|
|
38
|
+
export type DialogAction = 'OK' | 'Cancel' | 'Yes' | 'No' | 'Confirm' | 'Close' | 'Abort' | 'Retry' | 'Ignore' | 'Try' | 'Continue';
|
|
39
|
+
export type DialogButtons = 'OK' | 'OKCancel' | 'ConfirmClose' | 'AbortRetryIgnore' | 'YesNoCancel' | 'YesNo' | 'RetryCancel' | 'CancelTryContinue';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MetadataService } from '../services/metadata.service';
|
|
2
|
+
import { DialogService, DialogOptions } from '../services/dialog.service';
|
|
3
|
+
import { IEvaluatorProvider } from '../services/programmability.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class FunctionService implements IEvaluatorProvider {
|
|
6
|
+
private metadata;
|
|
7
|
+
private dialog;
|
|
8
|
+
constructor(metadata: MetadataService, dialog: DialogService);
|
|
9
|
+
invokable(func: any): Function;
|
|
10
|
+
openForm(template: string, options: DialogOptions): void;
|
|
11
|
+
getContext(): Record<string, any>;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FunctionService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FunctionService>;
|
|
14
|
+
}
|
|
@@ -4,10 +4,14 @@ export declare class MetadataService {
|
|
|
4
4
|
setSchema(schema: any): void;
|
|
5
5
|
getSchema(): any;
|
|
6
6
|
setForms(forms: any[]): void;
|
|
7
|
+
getTemplateByName(name: string): any;
|
|
7
8
|
getForms(): any[];
|
|
8
9
|
getFormByName(name: string): any;
|
|
10
|
+
setLanguage(language: string): void;
|
|
11
|
+
getLanguage(): string;
|
|
9
12
|
private schema;
|
|
10
13
|
private forms;
|
|
14
|
+
private language;
|
|
11
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<MetadataService, never>;
|
|
12
16
|
static ɵprov: i0.ɵɵInjectableDeclaration<MetadataService>;
|
|
13
17
|
}
|
|
@@ -2,19 +2,22 @@ import { OnDestroy } from '@angular/core';
|
|
|
2
2
|
import { FormGroup } from '@angular/forms';
|
|
3
3
|
import { FeelService } from '../services/feel.service';
|
|
4
4
|
import { ScopeService } from '../services/scope.service';
|
|
5
|
-
import { ProxyService, ProxyConfigFn } from '../services/proxy.service';
|
|
6
5
|
import { RegisterService } from '../services/register.service';
|
|
7
6
|
import { ToastService } from '../services/toast.service';
|
|
7
|
+
import { FunctionService } from '../services/function.service';
|
|
8
|
+
import { DialogService } from '../services/dialog.service';
|
|
8
9
|
import { WeakService } from '../services/weak.service';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
export declare class ProgrammabilityService implements OnDestroy {
|
|
11
12
|
private feelService;
|
|
12
13
|
private weakService;
|
|
13
|
-
private proxyService;
|
|
14
14
|
private toastService;
|
|
15
|
+
private dialogService;
|
|
16
|
+
private functionService;
|
|
15
17
|
private register;
|
|
16
18
|
private scope;
|
|
17
|
-
constructor(feelService: FeelService, weakService: WeakService,
|
|
19
|
+
constructor(feelService: FeelService, weakService: WeakService, toastService: ToastService, dialogService: DialogService, functionService: FunctionService, register: RegisterService, scope: ScopeService);
|
|
20
|
+
private readonly predefinedFunctions;
|
|
18
21
|
private destroy$;
|
|
19
22
|
ngOnDestroy(): void;
|
|
20
23
|
isExpression(text: string | null): boolean;
|
|
@@ -29,16 +32,20 @@ export declare class ProgrammabilityService implements OnDestroy {
|
|
|
29
32
|
private evalUnaryTest;
|
|
30
33
|
private evalExpression;
|
|
31
34
|
private evalTemplate;
|
|
32
|
-
private
|
|
35
|
+
private getPredefinedFunctions;
|
|
33
36
|
private getParentContext;
|
|
34
37
|
private getParent;
|
|
35
38
|
private getContext;
|
|
36
39
|
private watchExpression;
|
|
37
40
|
private watchDependencies;
|
|
38
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ProgrammabilityService, [null, null, null, null, { optional: true; }, { optional: true; }]>;
|
|
41
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ProgrammabilityService, [null, null, null, null, null, { optional: true; }, { optional: true; }]>;
|
|
39
42
|
static ɵprov: i0.ɵɵInjectableDeclaration<ProgrammabilityService>;
|
|
40
43
|
}
|
|
44
|
+
export interface IEvaluatorProvider {
|
|
45
|
+
getContext(): Record<string, any>;
|
|
46
|
+
}
|
|
41
47
|
export interface EvaluateOptions {
|
|
42
48
|
cacheable?: boolean;
|
|
43
|
-
|
|
49
|
+
extendContext?: ExtendContextFn;
|
|
44
50
|
}
|
|
51
|
+
export type ExtendContextFn = () => Record<string, any>;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { Control } from '../controls/control';
|
|
2
|
-
import {
|
|
2
|
+
import { IEvaluatorProvider } from '../services/programmability.service';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class RegisterService {
|
|
5
|
-
private proxyService;
|
|
4
|
+
export declare class RegisterService implements IEvaluatorProvider {
|
|
6
5
|
private parent;
|
|
7
|
-
constructor(
|
|
6
|
+
constructor(parent: RegisterService | null);
|
|
8
7
|
private controls;
|
|
9
8
|
register(name: string, control: Control): void;
|
|
10
9
|
unregister(name: string): void;
|
|
11
10
|
unregisterAll(): void;
|
|
12
11
|
getControl(name: string): Control | undefined;
|
|
13
12
|
getControls(): Control[];
|
|
14
|
-
|
|
13
|
+
getContext(): Record<string, any>;
|
|
15
14
|
private resolve;
|
|
16
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RegisterService, [
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RegisterService, [{ optional: true; skipSelf: true; }]>;
|
|
17
16
|
static ɵprov: i0.ɵɵInjectableDeclaration<RegisterService>;
|
|
18
17
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IEvaluatorProvider } from '../services/programmability.service';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class ScopeService {
|
|
4
|
-
private proxyService;
|
|
3
|
+
export declare class ScopeService implements IEvaluatorProvider {
|
|
5
4
|
private parent;
|
|
6
|
-
constructor(
|
|
5
|
+
constructor(parent: ScopeService | null);
|
|
7
6
|
private scope;
|
|
8
|
-
set(scope: Record<string, any>): void;
|
|
9
|
-
get(): any;
|
|
10
|
-
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ScopeService, [
|
|
7
|
+
set(scope: Record<string, any> | null): void;
|
|
8
|
+
get(): Record<string, any> | null;
|
|
9
|
+
getContext(): Record<string, any>;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ScopeService, [{ optional: true; skipSelf: true; }]>;
|
|
12
11
|
static ɵprov: i0.ɵɵInjectableDeclaration<ScopeService>;
|
|
13
12
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { IEvaluatorProvider } from '../services/programmability.service';
|
|
1
2
|
import { SirioToastService } from "ngx-sirio-lib";
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class ToastService {
|
|
4
|
+
export declare class ToastService implements IEvaluatorProvider {
|
|
4
5
|
private sirioToast;
|
|
5
6
|
constructor(sirioToast: SirioToastService);
|
|
6
7
|
notifyInfo(message: string, delay?: number): void;
|
|
7
8
|
notifySuccess(message: string, delay?: number): void;
|
|
8
9
|
notifyWarning(message: string, delay?: number): void;
|
|
9
10
|
notifyError(message: string, delay?: number): void;
|
|
11
|
+
getContext(): Record<string, any>;
|
|
10
12
|
private notify;
|
|
11
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToastService, never>;
|
|
12
14
|
static ɵprov: i0.ɵɵInjectableDeclaration<ToastService>;
|
package/lib/utils/gridCells.d.ts
CHANGED
|
@@ -16,6 +16,16 @@ export declare class ObjectURLRendererComponent implements ICellRendererAngularC
|
|
|
16
16
|
Show: string;
|
|
17
17
|
Remove: string;
|
|
18
18
|
Close: string;
|
|
19
|
+
Confirm: string;
|
|
20
|
+
OK: string;
|
|
21
|
+
Cancel: string;
|
|
22
|
+
Abort: string;
|
|
23
|
+
Retry: string;
|
|
24
|
+
Ignore: string;
|
|
25
|
+
Yes: string;
|
|
26
|
+
No: string;
|
|
27
|
+
Try: string;
|
|
28
|
+
Continue: string;
|
|
19
29
|
Name: string;
|
|
20
30
|
Size: string;
|
|
21
31
|
Type: string;
|
|
@@ -52,6 +62,16 @@ export declare class DeleteRowCellRenderer implements ICellRendererAngularComp {
|
|
|
52
62
|
Show: string;
|
|
53
63
|
Remove: string;
|
|
54
64
|
Close: string;
|
|
65
|
+
Confirm: string;
|
|
66
|
+
OK: string;
|
|
67
|
+
Cancel: string;
|
|
68
|
+
Abort: string;
|
|
69
|
+
Retry: string;
|
|
70
|
+
Ignore: string;
|
|
71
|
+
Yes: string;
|
|
72
|
+
No: string;
|
|
73
|
+
Try: string;
|
|
74
|
+
Continue: string;
|
|
55
75
|
Name: string;
|
|
56
76
|
Size: string;
|
|
57
77
|
Type: string;
|
package/lib/utils/setFilter.d.ts
CHANGED
|
@@ -16,6 +16,16 @@ export declare class SetFilterComponent implements IFilterAngularComp {
|
|
|
16
16
|
Show: string;
|
|
17
17
|
Remove: string;
|
|
18
18
|
Close: string;
|
|
19
|
+
Confirm: string;
|
|
20
|
+
OK: string;
|
|
21
|
+
Cancel: string;
|
|
22
|
+
Abort: string;
|
|
23
|
+
Retry: string;
|
|
24
|
+
Ignore: string;
|
|
25
|
+
Yes: string;
|
|
26
|
+
No: string;
|
|
27
|
+
Try: string;
|
|
28
|
+
Continue: string;
|
|
19
29
|
Name: string;
|
|
20
30
|
Size: string;
|
|
21
31
|
Type: string;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
const IS_PROXY = Symbol("__isProxy$");
|
|
4
|
-
export class ProxyService {
|
|
5
|
-
constructor() { }
|
|
6
|
-
getProxy(instance, options = null) {
|
|
7
|
-
return this.createProxy(instance, true, options);
|
|
8
|
-
}
|
|
9
|
-
createProxy(instance, root, options = null) {
|
|
10
|
-
if (!instance) {
|
|
11
|
-
return instance;
|
|
12
|
-
}
|
|
13
|
-
return new Proxy(instance, {
|
|
14
|
-
get: (target, property) => {
|
|
15
|
-
if (property === IS_PROXY) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
let value = undefined;
|
|
19
|
-
if (root && options && options.extend && property in options.extend) {
|
|
20
|
-
value = Reflect.get(options.extend, property, target);
|
|
21
|
-
}
|
|
22
|
-
else if (options && options.isCustom && options.getCustom && options.isCustom(target, property, root)) {
|
|
23
|
-
value = options.getCustom(target, property, root);
|
|
24
|
-
}
|
|
25
|
-
else if (property in target) {
|
|
26
|
-
value = Reflect.get(target, property, target);
|
|
27
|
-
}
|
|
28
|
-
if (options?.log) {
|
|
29
|
-
console.log(target, property, value);
|
|
30
|
-
}
|
|
31
|
-
if (this.isProxy(value))
|
|
32
|
-
return value;
|
|
33
|
-
if (typeof value === 'function') {
|
|
34
|
-
return this.createFunction(value, target);
|
|
35
|
-
}
|
|
36
|
-
else if (typeof value === 'object' && value !== null) {
|
|
37
|
-
return this.createProxy(value, false, options);
|
|
38
|
-
}
|
|
39
|
-
return value;
|
|
40
|
-
},
|
|
41
|
-
set: (target, property, value) => {
|
|
42
|
-
if (options && options.canSet && !options.canSet(target, property, root)) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
return Reflect.set(target, property, value, target);
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
deleteProperty: (target, property) => {
|
|
50
|
-
if (options && options.canDelete && !options.canDelete(target, property, root)) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
else if (property in target) {
|
|
54
|
-
return delete target[property];
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
has: (target, property) => {
|
|
61
|
-
if (root && options && options.extend && property in options.extend) {
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
else if (options && options.isCustom && options.isCustom(target, property, root)) {
|
|
65
|
-
return true;
|
|
66
|
-
}
|
|
67
|
-
else if (property in target) {
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
createFunction(fn, target) {
|
|
77
|
-
return (...args) => {
|
|
78
|
-
return fn.bind(target)(...args);
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
isProxy(obj) {
|
|
82
|
-
return obj && obj[IS_PROXY] === true;
|
|
83
|
-
}
|
|
84
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProxyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
85
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProxyService, providedIn: 'root' });
|
|
86
|
-
}
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProxyService, decorators: [{
|
|
88
|
-
type: Injectable,
|
|
89
|
-
args: [{
|
|
90
|
-
providedIn: 'root'
|
|
91
|
-
}]
|
|
92
|
-
}], ctorParameters: () => [] });
|
|
93
|
-
export class ProxyOptions {
|
|
94
|
-
_canDelete = () => true;
|
|
95
|
-
_canSet = () => true;
|
|
96
|
-
_isCustom = () => false;
|
|
97
|
-
_getCustom = () => undefined;
|
|
98
|
-
_extend = () => undefined;
|
|
99
|
-
set extend(fn) {
|
|
100
|
-
this._extend = fn;
|
|
101
|
-
}
|
|
102
|
-
get extend() {
|
|
103
|
-
return this._extend;
|
|
104
|
-
}
|
|
105
|
-
set canDelete(fn) {
|
|
106
|
-
this._canDelete = fn;
|
|
107
|
-
}
|
|
108
|
-
get canDelete() {
|
|
109
|
-
return this._canDelete;
|
|
110
|
-
}
|
|
111
|
-
set canSet(fn) {
|
|
112
|
-
this._canSet = fn;
|
|
113
|
-
}
|
|
114
|
-
get canSet() {
|
|
115
|
-
return this._canSet;
|
|
116
|
-
}
|
|
117
|
-
set isCustom(fn) {
|
|
118
|
-
this._isCustom = fn;
|
|
119
|
-
}
|
|
120
|
-
get isCustom() {
|
|
121
|
-
return this._isCustom;
|
|
122
|
-
}
|
|
123
|
-
set getCustom(fn) {
|
|
124
|
-
this._getCustom = fn;
|
|
125
|
-
}
|
|
126
|
-
get getCustom() {
|
|
127
|
-
return this._getCustom;
|
|
128
|
-
}
|
|
129
|
-
log = false;
|
|
130
|
-
}
|
|
131
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJveHkuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1zaXJpby9zcmMvbGliL3NlcnZpY2VzL3Byb3h5LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7QUFFM0MsTUFBTSxRQUFRLEdBQUcsTUFBTSxDQUFDLFlBQVksQ0FBQyxDQUFDO0FBS3RDLE1BQU0sT0FBTyxZQUFZO0lBRXZCLGdCQUFnQixDQUFDO0lBRWpCLFFBQVEsQ0FBQyxRQUFhLEVBQUUsVUFBK0IsSUFBSTtRQUN6RCxPQUFPLElBQUksQ0FBQyxXQUFXLENBQUMsUUFBUSxFQUFFLElBQUksRUFBRSxPQUFPLENBQUMsQ0FBQztJQUNuRCxDQUFDO0lBRU8sV0FBVyxDQUFDLFFBQWEsRUFBRSxJQUFhLEVBQzVDLFVBQStCLElBQUk7UUFFckMsSUFBSSxDQUFDLFFBQVEsRUFBRSxDQUFDO1lBQ2QsT0FBTyxRQUFRLENBQUM7UUFDbEIsQ0FBQztRQUVELE9BQU8sSUFBSSxLQUFLLENBQUMsUUFBUSxFQUFFO1lBQ3pCLEdBQUcsRUFBRSxDQUFDLE1BQVcsRUFBRSxRQUFRLEVBQUUsRUFBRTtnQ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XG5cclxuXHJcbiAgc2V0IGNhblNldChmbjogUHJveHlRdWVyeSkge1xyXG4gICAgdGhpcy5fY2FuU2V0ID0gZm47XHJcbiAgfVxyXG5cclxuICBnZXQgY2FuU2V0KCk6IFByb3h5UXVlcnkge1xyXG4gICAgcmV0dXJuIHRoaXMuX2NhblNldDtcclxuICB9XHJcblxyXG5cclxuICBzZXQgaXNDdXN0b20oZm46IFByb3h5UXVlcnkpIHtcclxuICAgIHRoaXMuX2lzQ3VzdG9tID0gZm47XHJcbiAgfVxyXG5cclxuICBnZXQgaXNDdXN0b20oKTogUHJveHlRdWVyeSB7XHJcbiAgICByZXR1cm4gdGhpcy5faXNDdXN0b207XHJcbiAgfVxyXG5cclxuXHJcbiAgc2V0IGdldEN1c3RvbShmbjogUHJveHlHZXR0ZXIpIHtcclxuICAgIHRoaXMuX2dldEN1c3RvbSA9IGZuO1xyXG4gIH1cclxuXHJcbiAgZ2V0IGdldEN1c3RvbSgpOiBQcm94eUdldHRlciB7XHJcbiAgICByZXR1cm4gdGhpcy5fZ2V0Q3VzdG9tO1xyXG4gIH1cclxuXHJcblxyXG4gIHB1YmxpYyBsb2c6IGJvb2xlYW4gPSBmYWxzZTtcclxufVxyXG5cclxuZXhwb3J0IHR5cGUgUHJveHlDb25maWdGbiA9IChvcHRpb25zOiBQcm94eU9wdGlvbnMpID0+IHZvaWQ7XHJcbiJdfQ==
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class ProxyService {
|
|
3
|
-
constructor();
|
|
4
|
-
getProxy(instance: any, options?: ProxyOptions | null): any;
|
|
5
|
-
private createProxy;
|
|
6
|
-
private createFunction;
|
|
7
|
-
private isProxy;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ProxyService, never>;
|
|
9
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ProxyService>;
|
|
10
|
-
}
|
|
11
|
-
type ProxyQuery = (target: any, property: string | symbol, root: boolean) => boolean;
|
|
12
|
-
type ProxyGetter = (target: any, property: string | symbol, root: boolean) => any;
|
|
13
|
-
export declare class ProxyOptions {
|
|
14
|
-
private _canDelete;
|
|
15
|
-
private _canSet;
|
|
16
|
-
private _isCustom;
|
|
17
|
-
private _getCustom;
|
|
18
|
-
private _extend;
|
|
19
|
-
set extend(fn: Record<string, any>);
|
|
20
|
-
get extend(): Record<string, any>;
|
|
21
|
-
set canDelete(fn: ProxyQuery);
|
|
22
|
-
get canDelete(): ProxyQuery;
|
|
23
|
-
set canSet(fn: ProxyQuery);
|
|
24
|
-
get canSet(): ProxyQuery;
|
|
25
|
-
set isCustom(fn: ProxyQuery);
|
|
26
|
-
get isCustom(): ProxyQuery;
|
|
27
|
-
set getCustom(fn: ProxyGetter);
|
|
28
|
-
get getCustom(): ProxyGetter;
|
|
29
|
-
log: boolean;
|
|
30
|
-
}
|
|
31
|
-
export type ProxyConfigFn = (options: ProxyOptions) => void;
|
|
32
|
-
export {};
|