newportsite 1.1.3
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/newportsite-1.1.3.tgz +0 -0
- package/ng-package.json +7 -0
- package/obfuscate.js +70 -0
- package/package.json +15 -0
- package/src/lib/app.component.ts +47 -0
- package/src/lib/app.routing.ts +38 -0
- package/src/lib/auth/alert.component.html +5 -0
- package/src/lib/auth/alert.component.ts +24 -0
- package/src/lib/auth/auth.component.html +1 -0
- package/src/lib/auth/auth.component.ts +10 -0
- package/src/lib/auth/auth.routes.ts +16 -0
- package/src/lib/auth/index.ts +4 -0
- package/src/lib/auth/login.component.html +87 -0
- package/src/lib/auth/login.component.ts +158 -0
- package/src/lib/auth/models/index.ts +1 -0
- package/src/lib/auth/models/user.ts +25 -0
- package/src/lib/auth/register.component.html +157 -0
- package/src/lib/auth/register.component.ts +219 -0
- package/src/lib/auth/services/alert.service.ts +47 -0
- package/src/lib/auth/services/auth.service.ts +28 -0
- package/src/lib/auth/services/index.ts +3 -0
- package/src/lib/auth/services/user.service.spec.ts +112 -0
- package/src/lib/auth/services/user.service.ts +47 -0
- package/src/lib/common/card.component.html +72 -0
- package/src/lib/common/card.component.ts +102 -0
- package/src/lib/common/commands.component.html +8 -0
- package/src/lib/common/commands.component.ts +42 -0
- package/src/lib/common/context.component.html +9 -0
- package/src/lib/common/context.component.ts +38 -0
- package/src/lib/common/grid.component.html +20 -0
- package/src/lib/common/grid.component.ts +747 -0
- package/src/lib/common/index.ts +9 -0
- package/src/lib/common/loader.component.html +5 -0
- package/src/lib/common/loader.component.ts +27 -0
- package/src/lib/common/lookup.component.html +29 -0
- package/src/lib/common/lookup.component.ts +115 -0
- package/src/lib/common/messagebox.component.html +39 -0
- package/src/lib/common/messagebox.component.ts +74 -0
- package/src/lib/common/theme-toggle.component.ts +139 -0
- package/src/lib/config.ts +62 -0
- package/src/lib/containers/default-layout/default-layout.component.html +191 -0
- package/src/lib/containers/default-layout/default-layout.component.ts +158 -0
- package/src/lib/containers/default-layout/index.ts +1 -0
- package/src/lib/containers/index.ts +1 -0
- package/src/lib/directives/component.draggable.ts +80 -0
- package/src/lib/directives/index.ts +2 -0
- package/src/lib/directives/input.directive.spec.ts +158 -0
- package/src/lib/directives/input.directive.ts +210 -0
- package/src/lib/home/dashboard/dashboard.component.html +38 -0
- package/src/lib/home/dashboard/dashboard.component.ts +50 -0
- package/src/lib/home/dashboard/index.ts +1 -0
- package/src/lib/home/index.component.html +1 -0
- package/src/lib/home/index.component.ts +10 -0
- package/src/lib/home/index.routes.ts +29 -0
- package/src/lib/home/index.ts +1 -0
- package/src/lib/home/info/index.ts +1 -0
- package/src/lib/home/info/info.component.css +476 -0
- package/src/lib/home/info/info.component.html +174 -0
- package/src/lib/home/info/info.component.ts +287 -0
- package/src/lib/home/model/article.component.html +10 -0
- package/src/lib/home/model/article.component.ts +50 -0
- package/src/lib/home/model/barchart.component.html +8 -0
- package/src/lib/home/model/barchart.component.ts +59 -0
- package/src/lib/home/model/index.ts +7 -0
- package/src/lib/home/model/itemdetail.component.html +25 -0
- package/src/lib/home/model/itemdetail.component.ts +93 -0
- package/src/lib/home/model/itemtab.component.html +25 -0
- package/src/lib/home/model/itemtab.component.ts +105 -0
- package/src/lib/home/model/model.component.html +121 -0
- package/src/lib/home/model/model.component.ts +510 -0
- package/src/lib/home/model/modeltoolbar.component.html +111 -0
- package/src/lib/home/model/modeltoolbar.component.ts +157 -0
- package/src/lib/home/model/navigation.component.html +86 -0
- package/src/lib/home/model/navigation.component.ts +247 -0
- package/src/lib/home/model/services/index.ts +1 -0
- package/src/lib/home/model/services/model.service.spec.ts +423 -0
- package/src/lib/home/model/services/model.service.ts +319 -0
- package/src/lib/home/modelsearch/index.ts +1 -0
- package/src/lib/home/modelsearch/modelsearch.component.html +124 -0
- package/src/lib/home/modelsearch/modelsearch.component.ts +453 -0
- package/src/lib/interfaces/data.interface.ts +131 -0
- package/src/lib/interfaces/index.ts +2 -0
- package/src/lib/interfaces/item.interface.ts +438 -0
- package/src/lib/players/lookup/lookup.directive.ts +6 -0
- package/src/lib/players/lookup/lookup.item.component.ts +37 -0
- package/src/lib/players/lookup/lookup.item.ts +9 -0
- package/src/lib/players/lookup/lookup.player.component.ts +59 -0
- package/src/lib/players/lookup/lookup.selector.component.ts +41 -0
- package/src/lib/players/model/model.directive.ts +6 -0
- package/src/lib/players/model/model.item.component.spec.ts +311 -0
- package/src/lib/players/model/model.item.component.ts +3457 -0
- package/src/lib/players/model/model.item.ts +9 -0
- package/src/lib/players/model/model.player.component.ts +109 -0
- package/src/lib/players/model/model.selector.component.ts +59 -0
- package/src/lib/scheduler/scheduler.component.html +13 -0
- package/src/lib/scheduler/scheduler.component.scss +6 -0
- package/src/lib/scheduler/scheduler.component.ts +296 -0
- package/src/lib/scheduler/scheduler.routes.ts +15 -0
- package/src/lib/scheduler/schedulerdialog.component.html +72 -0
- package/src/lib/scheduler/schedulerdialog.component.ts +208 -0
- package/src/lib/scheduler/services/scheduler.service.ts +133 -0
- package/src/lib/services/auth-state.service.ts +129 -0
- package/src/lib/services/auth.interceptor.spec.ts +144 -0
- package/src/lib/services/auth.interceptor.ts +44 -0
- package/src/lib/services/cache.service.spec.ts +143 -0
- package/src/lib/services/cache.service.ts +71 -0
- package/src/lib/services/global-error-handler.spec.ts +39 -0
- package/src/lib/services/global-error-handler.ts +28 -0
- package/src/lib/services/global.service.spec.ts +801 -0
- package/src/lib/services/global.service.ts +724 -0
- package/src/lib/services/message.service.ts +556 -0
- package/src/lib/services/theme.service.ts +96 -0
- package/src/lib/template/authtemplate.component.html +6 -0
- package/src/lib/template/authtemplate.component.ts +13 -0
- package/src/lib/template/basetemplate.component.html +7 -0
- package/src/lib/template/basetemplate.component.ts +13 -0
- package/src/lib/template/index.ts +3 -0
- package/src/lib/template/modeltemplate.component.html +7 -0
- package/src/lib/template/modeltemplate.component.ts +21 -0
- package/src/lib/utils/piva.spec.ts +56 -0
- package/src/lib/utils/piva.ts +29 -0
- package/src/lib/validators/email.validator.spec.ts +57 -0
- package/src/lib/validators/email.validator.ts +17 -0
- package/src/lib/validators/equalPasswords.validator.spec.ts +54 -0
- package/src/lib/validators/equalPasswords.validator.ts +17 -0
- package/src/lib/validators/index.ts +2 -0
- package/src/lib/version.ts +1 -0
- package/src/public-api.ts +64 -0
- package/src/typings.d.ts +2 -0
- package/tsconfig.lib.json +18 -0
- package/tsconfig.lib.prod.json +9 -0
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EntitiesData,
|
|
3
|
+
Entity,
|
|
4
|
+
EntityData,
|
|
5
|
+
FieldValue,
|
|
6
|
+
Member,
|
|
7
|
+
ModuleData,
|
|
8
|
+
} from './data.interface';
|
|
9
|
+
|
|
10
|
+
export interface ManagmentInterface {
|
|
11
|
+
functionId: string;
|
|
12
|
+
appId: string;
|
|
13
|
+
entId: string;
|
|
14
|
+
year: number;
|
|
15
|
+
keys: string;
|
|
16
|
+
fields: string[][];
|
|
17
|
+
states: string[][];
|
|
18
|
+
entIds: string[];
|
|
19
|
+
keyId: string;
|
|
20
|
+
filterId: string;
|
|
21
|
+
page: number;
|
|
22
|
+
data: string;
|
|
23
|
+
currentFieldId?: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
codmag?: string;
|
|
26
|
+
codart?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface SchedulerInterface {
|
|
30
|
+
year: number;
|
|
31
|
+
id: string;
|
|
32
|
+
start: Date | null;
|
|
33
|
+
end: Date | null;
|
|
34
|
+
assigned: number;
|
|
35
|
+
description: string;
|
|
36
|
+
allday: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ItemCommandInterface {
|
|
40
|
+
id: string;
|
|
41
|
+
state: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ItemCurrentFocusInterface {
|
|
45
|
+
id: string;
|
|
46
|
+
value: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Event emitted by the lookup popup when the user selects a row. */
|
|
50
|
+
export interface LookupResultEvent {
|
|
51
|
+
/** The selected row(s) as a map of field-name → value, or null if dismissed. */
|
|
52
|
+
value: Array<Record<string, string>> | null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Event emitted by the message-box dialog when the user confirms or dismisses. */
|
|
56
|
+
export interface DialogResultEvent {
|
|
57
|
+
/** true = confirmed (OK), false = dismissed (Cancel/close). */
|
|
58
|
+
value: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface ItemDialogInterface {
|
|
62
|
+
target: string;
|
|
63
|
+
state: boolean;
|
|
64
|
+
tag?: unknown;
|
|
65
|
+
props?: string[];
|
|
66
|
+
delete?: boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface ItemInterface {
|
|
70
|
+
id: string;
|
|
71
|
+
name: string;
|
|
72
|
+
title: string;
|
|
73
|
+
titleGb: string;
|
|
74
|
+
type: ItemType;
|
|
75
|
+
groupName: string;
|
|
76
|
+
focusOnInsert: string;
|
|
77
|
+
focusOnUpdate: string;
|
|
78
|
+
visible: boolean;
|
|
79
|
+
ivisible: boolean;
|
|
80
|
+
enabled: boolean;
|
|
81
|
+
state: ItemState;
|
|
82
|
+
mandatory: boolean;
|
|
83
|
+
allowAdd: boolean;
|
|
84
|
+
allowDelete: ItemDeleteMode;
|
|
85
|
+
printable: boolean;
|
|
86
|
+
viewList: boolean;
|
|
87
|
+
width: string;
|
|
88
|
+
height: string;
|
|
89
|
+
cache: boolean;
|
|
90
|
+
prgDim: number;
|
|
91
|
+
masterDetail?: number;
|
|
92
|
+
linkedDetails?: string[];
|
|
93
|
+
linkedItems?: string[];
|
|
94
|
+
parentItems?: string[];
|
|
95
|
+
preview?: boolean;
|
|
96
|
+
svg?: string;
|
|
97
|
+
pdfOffsetLeft?: number;
|
|
98
|
+
pdfOffsetTop?: number;
|
|
99
|
+
rootModel?: boolean;
|
|
100
|
+
loaded?: boolean;
|
|
101
|
+
initItem?(Item: ItemInterface): void;
|
|
102
|
+
sendCommand?(cmd: ItemCommandInterface): void;
|
|
103
|
+
setViewList?(state: boolean): void;
|
|
104
|
+
lookupResult?(rsp: LookupResultEvent): void;
|
|
105
|
+
dialogResult?(rsp: DialogResultEvent): void;
|
|
106
|
+
setScale?(scale: number): void;
|
|
107
|
+
close?(): void;
|
|
108
|
+
setFocus?(id: string): void;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface ItemLinkInterface {
|
|
112
|
+
id: string;
|
|
113
|
+
groupName: string;
|
|
114
|
+
prg: number[];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface ItemComponentInterface {
|
|
118
|
+
model: ItemInterface;
|
|
119
|
+
managment: ManagmentInterface;
|
|
120
|
+
insertMode: boolean;
|
|
121
|
+
data: EntitiesData;
|
|
122
|
+
entity: Entity;
|
|
123
|
+
fieldsId: string;
|
|
124
|
+
sS(id: string, state: FieldState, message?: string, dialog?: boolean): void;
|
|
125
|
+
gS(id: string): FieldState;
|
|
126
|
+
gT(id: string): FieldType;
|
|
127
|
+
sV(id: string, value: FieldValue): void;
|
|
128
|
+
gV(id: string): FieldValue;
|
|
129
|
+
gF(id: string): Member;
|
|
130
|
+
gE(id: string): HTMLInputElement;
|
|
131
|
+
checkConstraint(
|
|
132
|
+
appId: string,
|
|
133
|
+
entId: string,
|
|
134
|
+
year: number,
|
|
135
|
+
key: string,
|
|
136
|
+
value: string
|
|
137
|
+
): Promise<boolean>;
|
|
138
|
+
getMessage(id: string): string;
|
|
139
|
+
checkKey(id: string): void;
|
|
140
|
+
getKeyArray(): number[];
|
|
141
|
+
getLastKey(): number;
|
|
142
|
+
getDataEntity(name: string): EntityData;
|
|
143
|
+
getDataModule(data: EntityData, key: number, keyElement: number): ModuleData;
|
|
144
|
+
getDataEntityModule(
|
|
145
|
+
name: string,
|
|
146
|
+
key: number,
|
|
147
|
+
keyElement: number
|
|
148
|
+
): ModuleData;
|
|
149
|
+
sendCommand(command: ItemCommandInterface): Promise<void>;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface CalcInterface {
|
|
153
|
+
init(): void;
|
|
154
|
+
calc(id: string, lastKey: number, keyArray: number[]): void;
|
|
155
|
+
function(id: string, lastKey: number, keyArray: number[], name: string): void;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface ItemFieldChangedInterface {
|
|
159
|
+
id: string;
|
|
160
|
+
value: string;
|
|
161
|
+
function: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface GroupedDataArt {
|
|
165
|
+
user_id: number;
|
|
166
|
+
year_id: number;
|
|
167
|
+
codmag: number;
|
|
168
|
+
codart: number;
|
|
169
|
+
avarage_prz_out: number;
|
|
170
|
+
avarage_prz_in: number;
|
|
171
|
+
available: number;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export enum Functions {
|
|
175
|
+
save = 'save',
|
|
176
|
+
changed = 'changed',
|
|
177
|
+
executedCommand = 'executedCommand',
|
|
178
|
+
lostfocus = 'lostfocus',
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export enum FixedField {
|
|
182
|
+
cfpiva = 'cfpiva',
|
|
183
|
+
modnum = 'modnum',
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export enum DialogType {
|
|
187
|
+
None,
|
|
188
|
+
Save,
|
|
189
|
+
ExitSave,
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export enum ItemState {
|
|
193
|
+
None,
|
|
194
|
+
Error,
|
|
195
|
+
Warning,
|
|
196
|
+
Valid,
|
|
197
|
+
Empty,
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export enum ItemDeleteMode {
|
|
201
|
+
None,
|
|
202
|
+
All,
|
|
203
|
+
Last,
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export enum ItemType {
|
|
207
|
+
Multiple,
|
|
208
|
+
Single,
|
|
209
|
+
Detail,
|
|
210
|
+
Dialog,
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export enum FieldType {
|
|
214
|
+
Text,
|
|
215
|
+
Number,
|
|
216
|
+
Date,
|
|
217
|
+
TextualCheck,
|
|
218
|
+
Check,
|
|
219
|
+
Radio,
|
|
220
|
+
Combo,
|
|
221
|
+
Label,
|
|
222
|
+
Video,
|
|
223
|
+
Image,
|
|
224
|
+
Button,
|
|
225
|
+
Map,
|
|
226
|
+
Chart,
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export enum LabelAction {
|
|
230
|
+
Field,
|
|
231
|
+
Plus,
|
|
232
|
+
Minus,
|
|
233
|
+
Exit,
|
|
234
|
+
Save,
|
|
235
|
+
First,
|
|
236
|
+
Previous,
|
|
237
|
+
Next,
|
|
238
|
+
Last,
|
|
239
|
+
Table,
|
|
240
|
+
Print,
|
|
241
|
+
Detail,
|
|
242
|
+
Upload,
|
|
243
|
+
Download,
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export const FieldAttr = new Map<string, string>([
|
|
247
|
+
['state', 'data-state'],
|
|
248
|
+
['tag', 'data-tag'],
|
|
249
|
+
['type', 'data-type'],
|
|
250
|
+
['length', 'data-length'],
|
|
251
|
+
['decimal', 'data-decimal'],
|
|
252
|
+
['allowchar', 'data-allowedchars'],
|
|
253
|
+
['sign', 'data-sign'],
|
|
254
|
+
['thousand', 'data-thousandseparator'],
|
|
255
|
+
['match', 'data-match'],
|
|
256
|
+
['replace', 'data-replace'],
|
|
257
|
+
['padleftchar', 'data-padleftchar'],
|
|
258
|
+
['padrightchar', 'data-padrightchar'],
|
|
259
|
+
['fixedspace', 'data-autoformatter'],
|
|
260
|
+
['min', 'data-min'],
|
|
261
|
+
['max', 'data-max'],
|
|
262
|
+
['mandatory', 'data-mandatory'],
|
|
263
|
+
['initialvalue', 'data-initialvalue'],
|
|
264
|
+
['viewlist', 'data-viewlist'],
|
|
265
|
+
['lookup', 'data-lookup'],
|
|
266
|
+
]);
|
|
267
|
+
|
|
268
|
+
export const FieldFontSize = {
|
|
269
|
+
default: '15.8px',
|
|
270
|
+
compact: '12px',
|
|
271
|
+
compactPx: 12,
|
|
272
|
+
} as const;
|
|
273
|
+
|
|
274
|
+
export const FieldPaddingTop = {
|
|
275
|
+
none: '0px',
|
|
276
|
+
tall: '8px',
|
|
277
|
+
short: '1px',
|
|
278
|
+
tallThreshold: 16,
|
|
279
|
+
} as const;
|
|
280
|
+
|
|
281
|
+
export enum PadType {
|
|
282
|
+
Left,
|
|
283
|
+
Right,
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export enum FieldAlignment {
|
|
287
|
+
Left = 'left',
|
|
288
|
+
Center = 'center',
|
|
289
|
+
Right = 'right',
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export enum FieldState {
|
|
293
|
+
None = 0,
|
|
294
|
+
Error = 1,
|
|
295
|
+
Warning = 2,
|
|
296
|
+
Valid = 3,
|
|
297
|
+
Detail = 4,
|
|
298
|
+
ReadOnly = 5,
|
|
299
|
+
Hidden = 6,
|
|
300
|
+
Required = 7,
|
|
301
|
+
NotRequired = 8,
|
|
302
|
+
Forced = 9,
|
|
303
|
+
DetailCompiled = 10,
|
|
304
|
+
Fatal = 11,
|
|
305
|
+
Visible = 12,
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface FieldInterface {
|
|
309
|
+
id: string;
|
|
310
|
+
name: string;
|
|
311
|
+
tabindex: string;
|
|
312
|
+
x: string;
|
|
313
|
+
y: string;
|
|
314
|
+
width: string;
|
|
315
|
+
height: string;
|
|
316
|
+
type: FieldType;
|
|
317
|
+
length?: number;
|
|
318
|
+
precision?: number;
|
|
319
|
+
scale?: number;
|
|
320
|
+
allowsign?: boolean;
|
|
321
|
+
thousandseparator?: boolean;
|
|
322
|
+
alignment?: FieldAlignment;
|
|
323
|
+
caption?: string;
|
|
324
|
+
captiongb?: string;
|
|
325
|
+
state?: FieldState;
|
|
326
|
+
match?: string;
|
|
327
|
+
replace?: string;
|
|
328
|
+
value?: string;
|
|
329
|
+
tag?: string;
|
|
330
|
+
allowedchars?: string;
|
|
331
|
+
autoformatter?: number;
|
|
332
|
+
padleftchar?: string;
|
|
333
|
+
padrightchar?: string;
|
|
334
|
+
readonly?: boolean;
|
|
335
|
+
enabled?: boolean;
|
|
336
|
+
visible?: boolean;
|
|
337
|
+
min?: number | string;
|
|
338
|
+
max?: number | string;
|
|
339
|
+
mandatory?: boolean;
|
|
340
|
+
initialvalue?: string;
|
|
341
|
+
title?: string;
|
|
342
|
+
viewlist?: number;
|
|
343
|
+
lookup?: string;
|
|
344
|
+
lookuplink?: string;
|
|
345
|
+
lookupoutput?: boolean;
|
|
346
|
+
function?: string;
|
|
347
|
+
output?: boolean;
|
|
348
|
+
generateuid?: boolean;
|
|
349
|
+
groupname?: string;
|
|
350
|
+
spacing?: number;
|
|
351
|
+
action?: LabelAction;
|
|
352
|
+
today?: boolean;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export interface PaginationInterface {
|
|
356
|
+
numRec: number;
|
|
357
|
+
isFirst: boolean;
|
|
358
|
+
isLast: boolean;
|
|
359
|
+
totPages: number;
|
|
360
|
+
data: unknown;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export interface TransportInterface {
|
|
364
|
+
svg: string;
|
|
365
|
+
dataFile: unknown;
|
|
366
|
+
booleanResult: boolean;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export interface ViewListInterface {
|
|
370
|
+
state: boolean;
|
|
371
|
+
rows?: unknown[];
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface UserLicenses {
|
|
375
|
+
project: string;
|
|
376
|
+
description: string;
|
|
377
|
+
descriptiongb: string;
|
|
378
|
+
extendeddescription: string;
|
|
379
|
+
extendeddescriptiongb: string;
|
|
380
|
+
foldertitle: string;
|
|
381
|
+
foldertitlegb: string;
|
|
382
|
+
year: number;
|
|
383
|
+
active: boolean;
|
|
384
|
+
help: string;
|
|
385
|
+
type: string;
|
|
386
|
+
summary: boolean;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export interface LookupInterface {
|
|
390
|
+
lookup: string;
|
|
391
|
+
filter: string;
|
|
392
|
+
initItem?(Item: LookupInterface): void;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export interface DialogFieldInterface {
|
|
396
|
+
showdialog: boolean;
|
|
397
|
+
titledialog: string;
|
|
398
|
+
textdialog: string;
|
|
399
|
+
showconfirm: boolean;
|
|
400
|
+
dialogHeight: number;
|
|
401
|
+
dialogWidth: number;
|
|
402
|
+
dialogTop: number;
|
|
403
|
+
dialogLeft: number;
|
|
404
|
+
}
|
|
405
|
+
export interface LookupFieldInterface {
|
|
406
|
+
showlookup: boolean;
|
|
407
|
+
titlelookup: string;
|
|
408
|
+
textlookup: string;
|
|
409
|
+
lookupHeight: number;
|
|
410
|
+
lookupWidth: number;
|
|
411
|
+
lookupTop: number;
|
|
412
|
+
lookupLeft: number;
|
|
413
|
+
lookup: string;
|
|
414
|
+
lookupfilter: string;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export interface DataInterface {
|
|
418
|
+
key_id?: string;
|
|
419
|
+
tag_id?: string;
|
|
420
|
+
codicefiscale_id?: string;
|
|
421
|
+
partitaiva_id?: string;
|
|
422
|
+
denominazione_id?: string;
|
|
423
|
+
cognome_id?: string;
|
|
424
|
+
nome_id?: string;
|
|
425
|
+
prog_id?: string;
|
|
426
|
+
date_id?: string;
|
|
427
|
+
state_id?: ItemState;
|
|
428
|
+
errors_id: number;
|
|
429
|
+
warnings_id: number;
|
|
430
|
+
frontitems?: DataStoreInterface[];
|
|
431
|
+
backitems?: DataStoreInterface[];
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
export interface DataStoreInterface {
|
|
435
|
+
id: string;
|
|
436
|
+
name_id: string;
|
|
437
|
+
value_id: string | number | boolean | null;
|
|
438
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy, inject } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { LookupInterface, ViewListInterface } from '../../interfaces/index';
|
|
4
|
+
|
|
5
|
+
import { GlobalService } from '../../services/global.service';
|
|
6
|
+
|
|
7
|
+
import { AppMessageService } from '../../services/message.service';
|
|
8
|
+
import { GridComponent } from '../../common/grid.component';
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
template: `
|
|
13
|
+
<grid
|
|
14
|
+
[viewList]="false"
|
|
15
|
+
[lookup]="lookup.lookup"
|
|
16
|
+
[filter]="lookup.filter"
|
|
17
|
+
(viewChanged)="viewChanged($event)"></grid>
|
|
18
|
+
`,
|
|
19
|
+
imports: [GridComponent],
|
|
20
|
+
})
|
|
21
|
+
export class LookupItemComponent {
|
|
22
|
+
gsv = inject(GlobalService);
|
|
23
|
+
msg = inject(AppMessageService);
|
|
24
|
+
|
|
25
|
+
public lookup!: LookupInterface;
|
|
26
|
+
|
|
27
|
+
public viewChanged(changed: ViewListInterface) {
|
|
28
|
+
this.gsv.setLookup({
|
|
29
|
+
state: true,
|
|
30
|
+
rows: changed.rows,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private initItem(lookup: LookupInterface) {
|
|
35
|
+
this.lookup = lookup;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
input,
|
|
4
|
+
output,
|
|
5
|
+
effect,
|
|
6
|
+
ChangeDetectionStrategy,
|
|
7
|
+
viewChild,
|
|
8
|
+
OnInit,
|
|
9
|
+
DestroyRef,
|
|
10
|
+
inject,
|
|
11
|
+
} from '@angular/core';
|
|
12
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
13
|
+
import { LookupDirective } from './lookup.directive';
|
|
14
|
+
import { LookupItem } from './lookup.item';
|
|
15
|
+
import { LookupInterface, ViewListInterface } from '../../interfaces/index';
|
|
16
|
+
import { GlobalService } from '../../services/global.service';
|
|
17
|
+
import { AppMessageService } from '../../services/message.service';
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'lookupplayer',
|
|
21
|
+
template: `<ng-template mdLookup></ng-template>`,
|
|
22
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
23
|
+
imports: [LookupDirective],
|
|
24
|
+
})
|
|
25
|
+
export class LookupPlayerComponent implements OnInit {
|
|
26
|
+
private gsv = inject(GlobalService);
|
|
27
|
+
private msg = inject(AppMessageService);
|
|
28
|
+
private destroyRef = inject(DestroyRef);
|
|
29
|
+
|
|
30
|
+
readonly lookupItem = input<LookupItem>();
|
|
31
|
+
readonly lookupData = input<LookupInterface>();
|
|
32
|
+
readonly lookupChanged = output<ViewListInterface>();
|
|
33
|
+
|
|
34
|
+
readonly modelHost = viewChild.required(LookupDirective);
|
|
35
|
+
|
|
36
|
+
private componentRef!: any;
|
|
37
|
+
|
|
38
|
+
constructor() {
|
|
39
|
+
effect(() => {
|
|
40
|
+
const li = this.lookupItem();
|
|
41
|
+
if (!li) return;
|
|
42
|
+
const viewContainerRef = this.modelHost().viewContainerRef;
|
|
43
|
+
viewContainerRef.clear();
|
|
44
|
+
this.componentRef = null;
|
|
45
|
+
this.componentRef = viewContainerRef.createComponent(li.component);
|
|
46
|
+
(this.componentRef.instance as LookupInterface).initItem?.(li.data);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Lifecycle: subscribes to the GlobalService lookup stream and forwards selections via lookupChanged. */
|
|
51
|
+
public ngOnInit() {
|
|
52
|
+
this.gsv
|
|
53
|
+
.getLookup()
|
|
54
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
55
|
+
.subscribe(lookup => {
|
|
56
|
+
this.lookupChanged.emit(lookup);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
effect,
|
|
5
|
+
input,
|
|
6
|
+
output,
|
|
7
|
+
signal,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { LookupItemComponent } from './lookup.item.component';
|
|
10
|
+
import { LookupItem } from './lookup.item';
|
|
11
|
+
import { LookupInterface, ViewListInterface } from '../../interfaces/index';
|
|
12
|
+
import { LookupPlayerComponent } from './lookup.player.component';
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'lookupselector',
|
|
16
|
+
template: `<lookupplayer
|
|
17
|
+
[lookupItem]="lookupItem()"
|
|
18
|
+
[lookupData]="lookupData()"
|
|
19
|
+
(lookupChanged)="onLookupChanged($event)"></lookupplayer>`,
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
imports: [LookupPlayerComponent],
|
|
22
|
+
})
|
|
23
|
+
export class LookupSelectorComponent {
|
|
24
|
+
lookupData = input<LookupInterface>();
|
|
25
|
+
lookupChanged = output<ViewListInterface>();
|
|
26
|
+
lookupItem = signal<LookupItem | null>(null);
|
|
27
|
+
|
|
28
|
+
constructor() {
|
|
29
|
+
effect(() => {
|
|
30
|
+
const data = this.lookupData();
|
|
31
|
+
if (data) {
|
|
32
|
+
this.lookupItem.set(new LookupItem(LookupItemComponent, data));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Forwards the lookup selection event from the player to the parent component. */
|
|
38
|
+
onLookupChanged(lookup: ViewListInterface) {
|
|
39
|
+
this.lookupChanged.emit(lookup);
|
|
40
|
+
}
|
|
41
|
+
}
|