@elite.framework/ng.core 1.0.63 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -22
- package/directives/README.md +3 -0
- package/directives/index.d.ts +23 -0
- package/fesm2022/elite.framework-ng.core-directives.mjs +59 -0
- package/fesm2022/elite.framework-ng.core-directives.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-models.mjs +47 -0
- package/fesm2022/elite.framework-ng.core-models.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-pipes.mjs +135 -0
- package/fesm2022/elite.framework-ng.core-pipes.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-providers.mjs +18 -0
- package/fesm2022/elite.framework-ng.core-providers.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-services.mjs +509 -0
- package/fesm2022/elite.framework-ng.core-services.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-tokens.mjs +17 -0
- package/fesm2022/elite.framework-ng.core-tokens.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core.mjs +7 -980
- package/fesm2022/elite.framework-ng.core.mjs.map +1 -1
- package/index.d.ts +4 -179
- package/models/README.md +3 -0
- package/models/index.d.ts +135 -0
- package/package.json +24 -216
- package/pipes/README.md +3 -0
- package/pipes/index.d.ts +20 -0
- package/providers/README.md +3 -0
- package/providers/index.d.ts +6 -0
- package/services/README.md +3 -0
- package/services/index.d.ts +250 -0
- package/tokens/README.md +3 -0
- package/tokens/index.d.ts +15 -0
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elite.framework/ng.core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^20.
|
|
6
|
-
"@angular/core": "^20.
|
|
7
|
-
},
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"tslib": "^2.3.0"
|
|
5
|
+
"@angular/common": "^20.1.0",
|
|
6
|
+
"@angular/core": "^20.1.0"
|
|
10
7
|
},
|
|
11
8
|
"sideEffects": false,
|
|
12
9
|
"module": "fesm2022/elite.framework-ng.core.mjs",
|
|
@@ -19,221 +16,32 @@
|
|
|
19
16
|
"types": "./index.d.ts",
|
|
20
17
|
"default": "./fesm2022/elite.framework-ng.core.mjs"
|
|
21
18
|
},
|
|
22
|
-
"./
|
|
23
|
-
"types": "./
|
|
24
|
-
"default": "./fesm2022/elite.framework-ng.core-
|
|
25
|
-
},
|
|
26
|
-
"./src/lib/directives": {
|
|
27
|
-
"types": "./src/lib/directives/index.d.ts",
|
|
28
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-directives.mjs"
|
|
29
|
-
},
|
|
30
|
-
"./src/lib/models": {
|
|
31
|
-
"types": "./src/lib/models/index.d.ts",
|
|
32
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-models.mjs"
|
|
33
|
-
},
|
|
34
|
-
"./src/lib/pipes": {
|
|
35
|
-
"types": "./src/lib/pipes/index.d.ts",
|
|
36
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-pipes.mjs"
|
|
37
|
-
},
|
|
38
|
-
"./src/lib/providers": {
|
|
39
|
-
"types": "./src/lib/providers/index.d.ts",
|
|
40
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-providers.mjs"
|
|
41
|
-
},
|
|
42
|
-
"./src/lib/services": {
|
|
43
|
-
"types": "./src/lib/services/index.d.ts",
|
|
44
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-services.mjs"
|
|
45
|
-
},
|
|
46
|
-
"./src/lib/tokens": {
|
|
47
|
-
"types": "./src/lib/tokens/index.d.ts",
|
|
48
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-tokens.mjs"
|
|
49
|
-
},
|
|
50
|
-
"./src/lib/components/attachments": {
|
|
51
|
-
"types": "./src/lib/components/attachments/index.d.ts",
|
|
52
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-attachments.mjs"
|
|
53
|
-
},
|
|
54
|
-
"./src/lib/components/breadcrumb": {
|
|
55
|
-
"types": "./src/lib/components/breadcrumb/index.d.ts",
|
|
56
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-breadcrumb.mjs"
|
|
57
|
-
},
|
|
58
|
-
"./src/lib/components/checkbox": {
|
|
59
|
-
"types": "./src/lib/components/checkbox/index.d.ts",
|
|
60
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-checkbox.mjs"
|
|
61
|
-
},
|
|
62
|
-
"./src/lib/components/color-picker": {
|
|
63
|
-
"types": "./src/lib/components/color-picker/index.d.ts",
|
|
64
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-color-picker.mjs"
|
|
65
|
-
},
|
|
66
|
-
"./src/lib/components/column-settings-popover": {
|
|
67
|
-
"types": "./src/lib/components/column-settings-popover/index.d.ts",
|
|
68
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-column-settings-popover.mjs"
|
|
69
|
-
},
|
|
70
|
-
"./src/lib/components/condition-editor": {
|
|
71
|
-
"types": "./src/lib/components/condition-editor/index.d.ts",
|
|
72
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-condition-editor.mjs"
|
|
73
|
-
},
|
|
74
|
-
"./src/lib/components/custom-switch": {
|
|
75
|
-
"types": "./src/lib/components/custom-switch/index.d.ts",
|
|
76
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-custom-switch.mjs"
|
|
77
|
-
},
|
|
78
|
-
"./src/lib/components/datepicker": {
|
|
79
|
-
"types": "./src/lib/components/datepicker/index.d.ts",
|
|
80
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-datepicker.mjs"
|
|
81
|
-
},
|
|
82
|
-
"./src/lib/components/deactivation-reason": {
|
|
83
|
-
"types": "./src/lib/components/deactivation-reason/index.d.ts",
|
|
84
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-deactivation-reason.mjs"
|
|
85
|
-
},
|
|
86
|
-
"./src/lib/components/form-button": {
|
|
87
|
-
"types": "./src/lib/components/form-button/index.d.ts",
|
|
88
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-form-button.mjs"
|
|
89
|
-
},
|
|
90
|
-
"./src/lib/components/form-field": {
|
|
91
|
-
"types": "./src/lib/components/form-field/index.d.ts",
|
|
92
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-form-field.mjs"
|
|
93
|
-
},
|
|
94
|
-
"./src/lib/components/form-template": {
|
|
95
|
-
"types": "./src/lib/components/form-template/index.d.ts",
|
|
96
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-form-template.mjs"
|
|
97
|
-
},
|
|
98
|
-
"./src/lib/components/formly-avatar-image": {
|
|
99
|
-
"types": "./src/lib/components/formly-avatar-image/index.d.ts",
|
|
100
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-formly-avatar-image.mjs"
|
|
101
|
-
},
|
|
102
|
-
"./src/lib/components/formly-avatar-label": {
|
|
103
|
-
"types": "./src/lib/components/formly-avatar-label/index.d.ts",
|
|
104
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-formly-avatar-label.mjs"
|
|
105
|
-
},
|
|
106
|
-
"./src/lib/components/formly-button": {
|
|
107
|
-
"types": "./src/lib/components/formly-button/index.d.ts",
|
|
108
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-formly-button.mjs"
|
|
109
|
-
},
|
|
110
|
-
"./src/lib/components/formly-button-selector": {
|
|
111
|
-
"types": "./src/lib/components/formly-button-selector/index.d.ts",
|
|
112
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-formly-button-selector.mjs"
|
|
113
|
-
},
|
|
114
|
-
"./src/lib/components/formly-split-button": {
|
|
115
|
-
"types": "./src/lib/components/formly-split-button/index.d.ts",
|
|
116
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-formly-split-button.mjs"
|
|
117
|
-
},
|
|
118
|
-
"./src/lib/components/formly-username-with-domain": {
|
|
119
|
-
"types": "./src/lib/components/formly-username-with-domain/index.d.ts",
|
|
120
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-formly-username-with-domain.mjs"
|
|
19
|
+
"./directives": {
|
|
20
|
+
"types": "./directives/index.d.ts",
|
|
21
|
+
"default": "./fesm2022/elite.framework-ng.core-directives.mjs"
|
|
121
22
|
},
|
|
122
|
-
"./
|
|
123
|
-
"types": "./
|
|
124
|
-
"default": "./fesm2022/elite.framework-ng.core-
|
|
23
|
+
"./models": {
|
|
24
|
+
"types": "./models/index.d.ts",
|
|
25
|
+
"default": "./fesm2022/elite.framework-ng.core-models.mjs"
|
|
125
26
|
},
|
|
126
|
-
"./
|
|
127
|
-
"types": "./
|
|
128
|
-
"default": "./fesm2022/elite.framework-ng.core-
|
|
27
|
+
"./pipes": {
|
|
28
|
+
"types": "./pipes/index.d.ts",
|
|
29
|
+
"default": "./fesm2022/elite.framework-ng.core-pipes.mjs"
|
|
129
30
|
},
|
|
130
|
-
"./
|
|
131
|
-
"types": "./
|
|
132
|
-
"default": "./fesm2022/elite.framework-ng.core-
|
|
31
|
+
"./providers": {
|
|
32
|
+
"types": "./providers/index.d.ts",
|
|
33
|
+
"default": "./fesm2022/elite.framework-ng.core-providers.mjs"
|
|
133
34
|
},
|
|
134
|
-
"./
|
|
135
|
-
"types": "./
|
|
136
|
-
"default": "./fesm2022/elite.framework-ng.core-
|
|
35
|
+
"./services": {
|
|
36
|
+
"types": "./services/index.d.ts",
|
|
37
|
+
"default": "./fesm2022/elite.framework-ng.core-services.mjs"
|
|
137
38
|
},
|
|
138
|
-
"./
|
|
139
|
-
"types": "./
|
|
140
|
-
"default": "./fesm2022/elite.framework-ng.core-
|
|
141
|
-
},
|
|
142
|
-
"./src/lib/components/generic-crud-dialog": {
|
|
143
|
-
"types": "./src/lib/components/generic-crud-dialog/index.d.ts",
|
|
144
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-generic-crud-dialog.mjs"
|
|
145
|
-
},
|
|
146
|
-
"./src/lib/components/generic-errormessage": {
|
|
147
|
-
"types": "./src/lib/components/generic-errormessage/index.d.ts",
|
|
148
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-generic-errormessage.mjs"
|
|
149
|
-
},
|
|
150
|
-
"./src/lib/components/generic-formly-fields": {
|
|
151
|
-
"types": "./src/lib/components/generic-formly-fields/index.d.ts",
|
|
152
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-generic-formly-fields.mjs"
|
|
153
|
-
},
|
|
154
|
-
"./src/lib/components/generic-loadingspinner": {
|
|
155
|
-
"types": "./src/lib/components/generic-loadingspinner/index.d.ts",
|
|
156
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-generic-loadingspinner.mjs"
|
|
157
|
-
},
|
|
158
|
-
"./src/lib/components/generic-search": {
|
|
159
|
-
"types": "./src/lib/components/generic-search/index.d.ts",
|
|
160
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-generic-search.mjs"
|
|
161
|
-
},
|
|
162
|
-
"./src/lib/components/generic-selector": {
|
|
163
|
-
"types": "./src/lib/components/generic-selector/index.d.ts",
|
|
164
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-generic-selector.mjs"
|
|
165
|
-
},
|
|
166
|
-
"./src/lib/components/generic-table": {
|
|
167
|
-
"types": "./src/lib/components/generic-table/index.d.ts",
|
|
168
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-generic-table.mjs"
|
|
169
|
-
},
|
|
170
|
-
"./src/lib/components/icon-picker": {
|
|
171
|
-
"types": "./src/lib/components/icon-picker/index.d.ts",
|
|
172
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-icon-picker.mjs"
|
|
173
|
-
},
|
|
174
|
-
"./src/lib/components/header-wrapper": {
|
|
175
|
-
"types": "./src/lib/components/header-wrapper/index.d.ts",
|
|
176
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-header-wrapper.mjs"
|
|
177
|
-
},
|
|
178
|
-
"./src/lib/components/input": {
|
|
179
|
-
"types": "./src/lib/components/input/index.d.ts",
|
|
180
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-input.mjs"
|
|
181
|
-
},
|
|
182
|
-
"./src/lib/components/input-switch": {
|
|
183
|
-
"types": "./src/lib/components/input-switch/index.d.ts",
|
|
184
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-input-switch.mjs"
|
|
185
|
-
},
|
|
186
|
-
"./src/lib/components/input-with-icon": {
|
|
187
|
-
"types": "./src/lib/components/input-with-icon/index.d.ts",
|
|
188
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-input-with-icon.mjs"
|
|
189
|
-
},
|
|
190
|
-
"./src/lib/components/label-type": {
|
|
191
|
-
"types": "./src/lib/components/label-type/index.d.ts",
|
|
192
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-label-type.mjs"
|
|
193
|
-
},
|
|
194
|
-
"./src/lib/components/odata-query-builder": {
|
|
195
|
-
"types": "./src/lib/components/odata-query-builder/index.d.ts",
|
|
196
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-odata-query-builder.mjs"
|
|
197
|
-
},
|
|
198
|
-
"./src/lib/components/radio": {
|
|
199
|
-
"types": "./src/lib/components/radio/index.d.ts",
|
|
200
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-radio.mjs"
|
|
201
|
-
},
|
|
202
|
-
"./src/lib/components/repeat": {
|
|
203
|
-
"types": "./src/lib/components/repeat/index.d.ts",
|
|
204
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-repeat.mjs"
|
|
205
|
-
},
|
|
206
|
-
"./src/lib/components/select": {
|
|
207
|
-
"types": "./src/lib/components/select/index.d.ts",
|
|
208
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-select.mjs"
|
|
209
|
-
},
|
|
210
|
-
"./src/lib/components/sidebar-cards": {
|
|
211
|
-
"types": "./src/lib/components/sidebar-cards/index.d.ts",
|
|
212
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-sidebar-cards.mjs"
|
|
213
|
-
},
|
|
214
|
-
"./src/lib/components/sidebar-toggles": {
|
|
215
|
-
"types": "./src/lib/components/sidebar-toggles/index.d.ts",
|
|
216
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-sidebar-toggles.mjs"
|
|
217
|
-
},
|
|
218
|
-
"./src/lib/components/tabs": {
|
|
219
|
-
"types": "./src/lib/components/tabs/index.d.ts",
|
|
220
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-tabs.mjs"
|
|
221
|
-
},
|
|
222
|
-
"./src/lib/components/tag-type": {
|
|
223
|
-
"types": "./src/lib/components/tag-type/index.d.ts",
|
|
224
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-tag-type.mjs"
|
|
225
|
-
},
|
|
226
|
-
"./src/lib/components/text-editor": {
|
|
227
|
-
"types": "./src/lib/components/text-editor/index.d.ts",
|
|
228
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-text-editor.mjs"
|
|
229
|
-
},
|
|
230
|
-
"./src/lib/components/textarea": {
|
|
231
|
-
"types": "./src/lib/components/textarea/index.d.ts",
|
|
232
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-textarea.mjs"
|
|
233
|
-
},
|
|
234
|
-
"./src/lib/components/wrappers": {
|
|
235
|
-
"types": "./src/lib/components/wrappers/index.d.ts",
|
|
236
|
-
"default": "./fesm2022/elite.framework-ng.core-src-lib-components-wrappers.mjs"
|
|
39
|
+
"./tokens": {
|
|
40
|
+
"types": "./tokens/index.d.ts",
|
|
41
|
+
"default": "./fesm2022/elite.framework-ng.core-tokens.mjs"
|
|
237
42
|
}
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"tslib": "^2.3.0"
|
|
238
46
|
}
|
|
239
47
|
}
|
package/pipes/README.md
ADDED
package/pipes/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { PipeTransform } from '@angular/core';
|
|
3
|
+
import { DatePipe } from '@angular/common';
|
|
4
|
+
|
|
5
|
+
declare class TafqeetPipe implements PipeTransform {
|
|
6
|
+
transform(value: number, currencyName?: string): string;
|
|
7
|
+
private toArabicWords;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TafqeetPipe, never>;
|
|
9
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TafqeetPipe, "tafqeet", true>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare class TimeAgoWithFullDatePipe implements PipeTransform {
|
|
13
|
+
private datePipe;
|
|
14
|
+
constructor(datePipe: DatePipe);
|
|
15
|
+
transform(value: Date | string | null): string;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TimeAgoWithFullDatePipe, never>;
|
|
17
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TimeAgoWithFullDatePipe, "timeAgoWithFullDate", true>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { TafqeetPipe, TimeAgoWithFullDatePipe };
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import * as rxjs from 'rxjs';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { HttpClient, HttpRequest } from '@angular/common/http';
|
|
4
|
+
import { Root, Rest, PaginatedResult } from '@elite.framework/ng.core/models';
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { InjectionToken } from '@angular/core';
|
|
7
|
+
import * as qs from 'qs';
|
|
8
|
+
import * as express_serve_static_core from 'express-serve-static-core';
|
|
9
|
+
import { Request } from 'express';
|
|
10
|
+
import { SweetAlertResult, SweetAlertOptions, SweetAlertIcon } from 'sweetalert2';
|
|
11
|
+
|
|
12
|
+
declare class RestService {
|
|
13
|
+
protected options: Root;
|
|
14
|
+
protected http: HttpClient;
|
|
15
|
+
private environment;
|
|
16
|
+
constructor(options: Root, http: HttpClient);
|
|
17
|
+
protected getApiFromStore(apiName: string | undefined): string;
|
|
18
|
+
handleError(err: any): Observable<any>;
|
|
19
|
+
request<T, R>(request: HttpRequest<T> | Rest.Request<T>, config?: Rest.Config, api?: string): Observable<R>;
|
|
20
|
+
private getHttpClient;
|
|
21
|
+
private getParams;
|
|
22
|
+
private removeDuplicateSlashes;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RestService, never>;
|
|
24
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RestService>;
|
|
25
|
+
}
|
|
26
|
+
declare function isUndefinedOrEmptyString(value: unknown): boolean;
|
|
27
|
+
|
|
28
|
+
declare class BaseService {
|
|
29
|
+
restService: RestService;
|
|
30
|
+
apiName: string;
|
|
31
|
+
moduleName: string;
|
|
32
|
+
constructor(restService: RestService);
|
|
33
|
+
get: (id: string) => rxjs.Observable<any>;
|
|
34
|
+
getList: (input: any, endpoint?: string) => rxjs.Observable<PaginatedResult<any>>;
|
|
35
|
+
create: (input: any) => rxjs.Observable<any>;
|
|
36
|
+
update: (id: string, input: any) => rxjs.Observable<any>;
|
|
37
|
+
delete: (id: string) => rxjs.Observable<void>;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseService, never>;
|
|
39
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BaseService>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface CrudService<T, F = any> {
|
|
43
|
+
getAll(): Observable<T[]>;
|
|
44
|
+
getPage(pageIndex: number, pageSize: number, filters: Partial<F>, sort?: string): Observable<PaginatedResult<T>>;
|
|
45
|
+
getById(id: any): Observable<T>;
|
|
46
|
+
create(item: Partial<T>): Observable<T>;
|
|
47
|
+
update(id: any, item: Partial<T>): Observable<T>;
|
|
48
|
+
delete(id: any): Observable<void>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* GenericService<T, K>:
|
|
53
|
+
* - T = نوع الكائن (Model)
|
|
54
|
+
* - K = نوع المفتاح الأساسي (ID)، افتراضي number
|
|
55
|
+
*
|
|
56
|
+
* يحتوي على جميع دوال الـ CRUD القياسية للتوريث في الخدمات المتخصصة.
|
|
57
|
+
*/
|
|
58
|
+
declare abstract class GenericService<T, K = number> implements CrudService<T, Record<string, any>> {
|
|
59
|
+
protected http: HttpClient;
|
|
60
|
+
/**
|
|
61
|
+
* ✏️ على كل خدمة فرعية أن تعرّف هذا:
|
|
62
|
+
* مثال: protected baseUrl = 'https://api.example.com/api/jobtyps';
|
|
63
|
+
*/
|
|
64
|
+
protected abstract baseUrl: string;
|
|
65
|
+
constructor(http: HttpClient);
|
|
66
|
+
/**
|
|
67
|
+
* جلب كل السجلات
|
|
68
|
+
*/
|
|
69
|
+
getAll(): Observable<T[]>;
|
|
70
|
+
/**
|
|
71
|
+
* جلب سجل واحد بناءً على المعرف
|
|
72
|
+
*/
|
|
73
|
+
getById(id: K): Observable<T>;
|
|
74
|
+
/**
|
|
75
|
+
* إنشاء سجل جديد
|
|
76
|
+
*/
|
|
77
|
+
create(item: Partial<T>): Observable<T>;
|
|
78
|
+
/**
|
|
79
|
+
* تحديث سجل موجود
|
|
80
|
+
*/
|
|
81
|
+
update(id: K, item: Partial<T>): Observable<T>;
|
|
82
|
+
/**
|
|
83
|
+
* حذف سجل
|
|
84
|
+
*/
|
|
85
|
+
delete(id: K): Observable<void>;
|
|
86
|
+
/** endpoint قابل للتخصيص — يمكن للفرع override–ها */
|
|
87
|
+
protected getPageUrl(): string;
|
|
88
|
+
/**
|
|
89
|
+
* جلب صفحة من البيانات مع دعم الفلاتر والفرز
|
|
90
|
+
* @param pageIndex صفر-based
|
|
91
|
+
* @param pageSize عدد السجلات
|
|
92
|
+
* @param filters كائن Partial<T> أو Record<string,any>
|
|
93
|
+
* @param sort نص الفرز، مثلاً "eiNa:desc"
|
|
94
|
+
*/
|
|
95
|
+
getPage(pageIndex: number, pageSize: number, filters?: Record<string, any>, sort?: string): Observable<PaginatedResult<T>>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
declare const REQUEST: InjectionToken<Request<express_serve_static_core.ParamsDictionary, any, any, qs.ParsedQs, Record<string, any>>>;
|
|
99
|
+
declare class SsrCookieService {
|
|
100
|
+
private document;
|
|
101
|
+
private platformId;
|
|
102
|
+
private request;
|
|
103
|
+
private readonly documentIsAccessible;
|
|
104
|
+
static initialUrl: string;
|
|
105
|
+
constructor(document: Document, platformId: any, request: Request);
|
|
106
|
+
/**
|
|
107
|
+
* Get cookie Regular Expression
|
|
108
|
+
*
|
|
109
|
+
* @param name Cookie name
|
|
110
|
+
* @returns property RegExp
|
|
111
|
+
*
|
|
112
|
+
* @author: Stepan Suvorov
|
|
113
|
+
* @since: 1.0.0
|
|
114
|
+
*/
|
|
115
|
+
static getCookieRegExp(name: string): RegExp;
|
|
116
|
+
/**
|
|
117
|
+
* Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).
|
|
118
|
+
*
|
|
119
|
+
* @param encodedURIComponent A value representing an encoded URI component.
|
|
120
|
+
*
|
|
121
|
+
* @returns The unencoded version of an encoded component of a Uniform Resource Identifier (URI).
|
|
122
|
+
*
|
|
123
|
+
* @author: Stepan Suvorov
|
|
124
|
+
* @since: 1.0.0
|
|
125
|
+
*/
|
|
126
|
+
static safeDecodeURIComponent(encodedURIComponent: string): string;
|
|
127
|
+
/**
|
|
128
|
+
* Return `true` if {@link Document} is accessible, otherwise return `false`
|
|
129
|
+
*
|
|
130
|
+
* @param name Cookie name
|
|
131
|
+
* @returns boolean - whether cookie with specified name exists
|
|
132
|
+
*
|
|
133
|
+
* @author: Stepan Suvorov
|
|
134
|
+
* @since: 1.0.0
|
|
135
|
+
*/
|
|
136
|
+
check(name: string): boolean;
|
|
137
|
+
isDocumentIsAccessible(): boolean;
|
|
138
|
+
get url(): string;
|
|
139
|
+
/**
|
|
140
|
+
* Get cookies by name
|
|
141
|
+
*
|
|
142
|
+
* @param name Cookie name
|
|
143
|
+
* @returns property value
|
|
144
|
+
*
|
|
145
|
+
* @author: Stepan Suvorov
|
|
146
|
+
* @since: 1.0.0
|
|
147
|
+
*/
|
|
148
|
+
get(name: string): string;
|
|
149
|
+
/**
|
|
150
|
+
* Get all cookies in JSON format
|
|
151
|
+
*
|
|
152
|
+
* @returns all the cookies in json
|
|
153
|
+
*
|
|
154
|
+
* @author: Stepan Suvorov
|
|
155
|
+
* @since: 1.0.0
|
|
156
|
+
*/
|
|
157
|
+
getAll(): {
|
|
158
|
+
[key: string]: string;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Set cookie based on provided information
|
|
162
|
+
*
|
|
163
|
+
* @param name Cookie name
|
|
164
|
+
* @param value Cookie value
|
|
165
|
+
* @param expires Number of days until the cookies expires or an actual `Date`
|
|
166
|
+
* @param path Cookie path
|
|
167
|
+
* @param domain Cookie domain
|
|
168
|
+
* @param secure Secure flag
|
|
169
|
+
* @param sameSite OWASP same site token `Lax`, `None`, or `Strict`. Defaults to `Lax`
|
|
170
|
+
* @param partitioned Partitioned flag
|
|
171
|
+
*
|
|
172
|
+
* @author: Stepan Suvorov
|
|
173
|
+
* @since: 1.0.0
|
|
174
|
+
*/
|
|
175
|
+
set(name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean, sameSite?: 'Lax' | 'None' | 'Strict', partitioned?: boolean): void;
|
|
176
|
+
/**
|
|
177
|
+
* Set cookie based on provided information
|
|
178
|
+
*
|
|
179
|
+
* Cookie's parameters:
|
|
180
|
+
* <pre>
|
|
181
|
+
* expires Number of days until the cookies expires or an actual `Date`
|
|
182
|
+
* path Cookie path
|
|
183
|
+
* domain Cookie domain
|
|
184
|
+
* secure Cookie secure flag
|
|
185
|
+
* sameSite OWASP same site token `Lax`, `None`, or `Strict`. Defaults to `Lax`
|
|
186
|
+
* </pre>
|
|
187
|
+
*
|
|
188
|
+
* @param name Cookie name
|
|
189
|
+
* @param value Cookie value
|
|
190
|
+
* @param options Body with cookie's params
|
|
191
|
+
*
|
|
192
|
+
* @author: Stepan Suvorov
|
|
193
|
+
* @since: 1.0.0
|
|
194
|
+
*/
|
|
195
|
+
set(name: string, value: string, options?: {
|
|
196
|
+
expires?: number | Date;
|
|
197
|
+
path?: string;
|
|
198
|
+
domain?: string;
|
|
199
|
+
secure?: boolean;
|
|
200
|
+
sameSite?: 'Lax' | 'None' | 'Strict';
|
|
201
|
+
partitioned?: boolean;
|
|
202
|
+
}): void;
|
|
203
|
+
/**
|
|
204
|
+
* Delete cookie by name
|
|
205
|
+
*
|
|
206
|
+
* @param name Cookie name
|
|
207
|
+
* @param path Cookie path
|
|
208
|
+
* @param domain Cookie domain
|
|
209
|
+
* @param secure Cookie secure flag
|
|
210
|
+
* @param sameSite Cookie sameSite flag - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite
|
|
211
|
+
*
|
|
212
|
+
* @author: Stepan Suvorov
|
|
213
|
+
* @since: 1.0.0
|
|
214
|
+
*/
|
|
215
|
+
delete(name: string, path?: string, domain?: string, secure?: boolean, sameSite?: 'Lax' | 'None' | 'Strict'): void;
|
|
216
|
+
/**
|
|
217
|
+
* Delete all cookies
|
|
218
|
+
*
|
|
219
|
+
* @param path Cookie path
|
|
220
|
+
* @param domain Cookie domain
|
|
221
|
+
* @param secure Is the Cookie secure
|
|
222
|
+
* @param sameSite Is the cookie same site
|
|
223
|
+
*
|
|
224
|
+
* @author: Stepan Suvorov
|
|
225
|
+
* @since: 1.0.0
|
|
226
|
+
*/
|
|
227
|
+
deleteAll(path?: string, domain?: string, secure?: boolean, sameSite?: 'Lax' | 'None' | 'Strict'): void;
|
|
228
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SsrCookieService, [null, null, { optional: true; }]>;
|
|
229
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SsrCookieService>;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
declare class SwalService {
|
|
233
|
+
/** رسالة تأكيد قبل تنفيذ إجراء */
|
|
234
|
+
confirm(title?: string, text?: string, confirmButtonText?: string, cancelButtonText?: string): Promise<SweetAlertResult>;
|
|
235
|
+
/** رسالة نجاح */
|
|
236
|
+
success(title: string, text?: string, timer?: number): Promise<SweetAlertResult>;
|
|
237
|
+
/** رسالة خطأ */
|
|
238
|
+
error(title: string, text?: string, footer?: string): Promise<SweetAlertResult>;
|
|
239
|
+
/** رسالة معلومات */
|
|
240
|
+
info(title: string, text?: string): Promise<SweetAlertResult>;
|
|
241
|
+
/** عرض نافذة SweetAlert2 بأي خيارات تريد */
|
|
242
|
+
alert(options: SweetAlertOptions): Promise<SweetAlertResult>;
|
|
243
|
+
/** Toast بسيط قابل لإعادة الاستخدام */
|
|
244
|
+
toast(title: string, icon?: SweetAlertIcon, position?: SweetAlertOptions['position'], timer?: number): void;
|
|
245
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SwalService, never>;
|
|
246
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SwalService>;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export { BaseService, GenericService, REQUEST, RestService, SsrCookieService, SwalService, isUndefinedOrEmptyString };
|
|
250
|
+
export type { CrudService };
|
package/tokens/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { Root } from '@elite.framework/ng.core/models';
|
|
3
|
+
|
|
4
|
+
declare const ENVIRONMENT: InjectionToken<EnvironmentConfig>;
|
|
5
|
+
interface EnvironmentConfig {
|
|
6
|
+
production: boolean;
|
|
7
|
+
apiUrl: string;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare const CORE_OPTIONS: InjectionToken<Root>;
|
|
12
|
+
declare function coreOptionsFactory({ ...options }: Root): Root;
|
|
13
|
+
|
|
14
|
+
export { CORE_OPTIONS, ENVIRONMENT, coreOptionsFactory };
|
|
15
|
+
export type { EnvironmentConfig };
|