@adins/ucviewgeneric 1.0.0 → 1.0.2
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 +43 -447
- package/bundles/ucviewgeneric.umd.js +166 -0
- package/bundles/ucviewgeneric.umd.js.map +1 -0
- package/bundles/ucviewgeneric.umd.min.js +2 -0
- package/bundles/ucviewgeneric.umd.min.js.map +1 -0
- package/esm2015/lib/ucviewgeneric.component.js +114 -0
- package/esm2015/lib/ucviewgeneric.module.js +23 -0
- package/esm2015/lib/ucviewgeneric.service.js +18 -0
- package/esm2015/public-api.js +11 -0
- package/esm2015/ucviewgeneric.js +9 -0
- package/esm5/lib/ucviewgeneric.component.js +128 -0
- package/esm5/lib/ucviewgeneric.module.js +27 -0
- package/esm5/lib/ucviewgeneric.service.js +21 -0
- package/esm5/public-api.js +11 -0
- package/esm5/ucviewgeneric.js +9 -0
- package/fesm2015/ucviewgeneric.js +144 -0
- package/fesm2015/ucviewgeneric.js.map +1 -0
- package/fesm5/ucviewgeneric.js +162 -0
- package/fesm5/ucviewgeneric.js.map +1 -0
- package/lib/ucviewgeneric.component.d.ts +8 -36
- package/lib/ucviewgeneric.module.d.ts +0 -11
- package/lib/ucviewgeneric.service.d.ts +0 -3
- package/package.json +20 -4
- package/{adins-ucviewgeneric.d.ts → ucviewgeneric.d.ts} +0 -1
- package/ucviewgeneric.metadata.json +1 -0
- package/esm2020/adins-ucviewgeneric.mjs +0 -5
- package/esm2020/lib/model/grid-view-obj.model.mjs +0 -8
- package/esm2020/lib/model/input-grid-obj.model.mjs +0 -24
- package/esm2020/lib/model/uc-view-generic-obj.model.mjs +0 -30
- package/esm2020/lib/ucviewgeneric.component.mjs +0 -566
- package/esm2020/lib/ucviewgeneric.module.mjs +0 -42
- package/esm2020/lib/ucviewgeneric.service.mjs +0 -14
- package/esm2020/public-api.mjs +0 -7
- package/fesm2015/adins-ucviewgeneric.mjs +0 -687
- package/fesm2015/adins-ucviewgeneric.mjs.map +0 -1
- package/fesm2020/adins-ucviewgeneric.mjs +0 -682
- package/fesm2020/adins-ucviewgeneric.mjs.map +0 -1
- package/lib/model/grid-view-obj.model.d.ts +0 -18
- package/lib/model/input-grid-obj.model.d.ts +0 -26
- package/lib/model/uc-view-generic-obj.model.d.ts +0 -27
package/README.md
CHANGED
|
@@ -1,447 +1,43 @@
|
|
|
1
|
-
# Ucviewgeneric
|
|
2
|
-
|
|
3
|
-
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version
|
|
4
|
-
|
|
5
|
-
## Version
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
2.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Version 3.1.3
|
|
45
|
-
1. fix get data by API
|
|
46
|
-
|
|
47
|
-
Version 3.1.1
|
|
48
|
-
1. remove useCustomRes option setting
|
|
49
|
-
|
|
50
|
-
Version 3.1.0
|
|
51
|
-
1. add reqObj option setting
|
|
52
|
-
2. add enviroment setting for get data by listEnvironment
|
|
53
|
-
3. add useCustomRes option setting
|
|
54
|
-
4. add resObjName option setting
|
|
55
|
-
|
|
56
|
-
Version 3.0.2
|
|
57
|
-
1. fix dataInput undefined
|
|
58
|
-
|
|
59
|
-
Version 3.0.1
|
|
60
|
-
1. fix dataInput
|
|
61
|
-
|
|
62
|
-
Version 3.0.0
|
|
63
|
-
1. fix versioning
|
|
64
|
-
2. support dataInput
|
|
65
|
-
|
|
66
|
-
Version 2.4.0
|
|
67
|
-
1. Update Angular 13 + IsCard
|
|
68
|
-
|
|
69
|
-
Version 2.3.2
|
|
70
|
-
1. type date dateFormat
|
|
71
|
-
|
|
72
|
-
Version 2.3.1
|
|
73
|
-
1. type callback-isText
|
|
74
|
-
|
|
75
|
-
Version 2.2.1
|
|
76
|
-
1. update folder/file name to lower-case
|
|
77
|
-
|
|
78
|
-
Version 2.2.0
|
|
79
|
-
1. Add logic hide (label and value) for switch case
|
|
80
|
-
|
|
81
|
-
Version 2.1.0
|
|
82
|
-
1. Add logic hide (label and value) for switch case
|
|
83
|
-
|
|
84
|
-
Version 2.0.81
|
|
85
|
-
1. Add logic concat for switch case.
|
|
86
|
-
|
|
87
|
-
Version 2.0.77
|
|
88
|
-
1. Bug fixing.
|
|
89
|
-
|
|
90
|
-
Version 2.0.76
|
|
91
|
-
1. tambah precision di type decimal.
|
|
92
|
-
|
|
93
|
-
Version 2.0.75
|
|
94
|
-
1. localStorage => Cookie
|
|
95
|
-
2. switchCase restriction IN And NIN (Not In)
|
|
96
|
-
|
|
97
|
-
Version 2.0.74
|
|
98
|
-
1. Add word-break
|
|
99
|
-
|
|
100
|
-
Version 2.0.72
|
|
101
|
-
1. read localstorage lang
|
|
102
|
-
|
|
103
|
-
Version 2.0.70
|
|
104
|
-
1. translate module
|
|
105
|
-
|
|
106
|
-
Version 2.0.69
|
|
107
|
-
1. tambah view link isCurrency
|
|
108
|
-
|
|
109
|
-
Version 2.0.68
|
|
110
|
-
1. concat tidak muncul karena emptyLabel bug
|
|
111
|
-
|
|
112
|
-
Version 2.0.66
|
|
113
|
-
1. fix viewgeneric bug boolean != '' => false
|
|
114
|
-
|
|
115
|
-
Version 2.0.65
|
|
116
|
-
1. fix viewgeneric undefined
|
|
117
|
-
|
|
118
|
-
Version 2.0.64
|
|
119
|
-
1. tambah property customClassLabel
|
|
120
|
-
1. tambah property customClassProperty
|
|
121
|
-
|
|
122
|
-
Version 2.0.63
|
|
123
|
-
1. Menambahkan Navigation Constant untuk link
|
|
124
|
-
|
|
125
|
-
Version 2.0.61
|
|
126
|
-
1. tambah property customclass
|
|
127
|
-
|
|
128
|
-
Version 2.0.60
|
|
129
|
-
1. tambah type switchcase
|
|
130
|
-
|
|
131
|
-
Version 2.0.39
|
|
132
|
-
1. tambah delimiter untuk currency
|
|
133
|
-
|
|
134
|
-
Version 2.0.36
|
|
135
|
-
1. kurang penjagaan null dan string kosong
|
|
136
|
-
|
|
137
|
-
Version 2.0.35
|
|
138
|
-
1. bug label isHide
|
|
139
|
-
|
|
140
|
-
Version 2.0.33
|
|
141
|
-
1. bug label div
|
|
142
|
-
|
|
143
|
-
Version 2.0.32
|
|
144
|
-
1. fix position
|
|
145
|
-
|
|
146
|
-
Version 2.0.31
|
|
147
|
-
1. tambah property isHide
|
|
148
|
-
2. fix jika empty jadi " - "
|
|
149
|
-
|
|
150
|
-
Version 2.0.27
|
|
151
|
-
1. Fix css title
|
|
152
|
-
|
|
153
|
-
Version 2.0.27
|
|
154
|
-
1. Ubah input object
|
|
155
|
-
2. tambah link envi
|
|
156
|
-
|
|
157
|
-
Version 2.0.22
|
|
158
|
-
1. tambah input ddlEnvironments
|
|
159
|
-
|
|
160
|
-
Version 2.0.21
|
|
161
|
-
1. tambah input ddlEnvironments
|
|
162
|
-
|
|
163
|
-
Version 2.0.20
|
|
164
|
-
1. fix logic type concat
|
|
165
|
-
|
|
166
|
-
Version 2.0.15
|
|
167
|
-
1. tambah type concat
|
|
168
|
-
|
|
169
|
-
Version 2.0.14
|
|
170
|
-
1. ubah Input jdi string
|
|
171
|
-
|
|
172
|
-
Version 2.0.13
|
|
173
|
-
1. Tambah Input ddlEnvironments
|
|
174
|
-
|
|
175
|
-
Version 2.0.12
|
|
176
|
-
1. fix data kosong
|
|
177
|
-
|
|
178
|
-
Version 2.0.11
|
|
179
|
-
1. fix data kosong
|
|
180
|
-
|
|
181
|
-
Version 2.0.10
|
|
182
|
-
1. fix boolean false agar tidak tampil '-'
|
|
183
|
-
2. string kosong akan menampilkan '-'
|
|
184
|
-
|
|
185
|
-
Version 2.0.9
|
|
186
|
-
1. fix jika data kosong
|
|
187
|
-
|
|
188
|
-
Version 2.0.8
|
|
189
|
-
1. where value from input
|
|
190
|
-
|
|
191
|
-
Version 2.0.5
|
|
192
|
-
1. if no title fix
|
|
193
|
-
|
|
194
|
-
Version 2.0.4
|
|
195
|
-
1. add type boolean
|
|
196
|
-
|
|
197
|
-
Version 2.0.3
|
|
198
|
-
1. get returnObject querystring TOP 1
|
|
199
|
-
|
|
200
|
-
Version 2.0.2
|
|
201
|
-
1. get data from queryString
|
|
202
|
-
|
|
203
|
-
Version 2.0.1
|
|
204
|
-
1. label position viewGeneric, textarea input disable, loop subsection
|
|
205
|
-
|
|
206
|
-
Version 2.0.0
|
|
207
|
-
1. Update ReadMe
|
|
208
|
-
|
|
209
|
-
Version 1.0.3
|
|
210
|
-
1. Update ReadMe
|
|
211
|
-
|
|
212
|
-
Version 1.0.2
|
|
213
|
-
1. fix subsection not working
|
|
214
|
-
|
|
215
|
-
Version 1.0.1
|
|
216
|
-
1. Added ReadMe
|
|
217
|
-
|
|
218
|
-
## Dependency Module
|
|
219
|
-
import this module :
|
|
220
|
-
- RouterModule
|
|
221
|
-
- UcSubsectionModule ` npm i @adins/uc-subsection `
|
|
222
|
-
|
|
223
|
-
## Selector
|
|
224
|
-
lib-ucviewgeneric
|
|
225
|
-
|
|
226
|
-
## Input
|
|
227
|
-
1. viewGenericObj : UcViewGenericObj (object) *mandatory
|
|
228
|
-
|
|
229
|
-
## Output
|
|
230
|
-
1. callback : return view object
|
|
231
|
-
|
|
232
|
-
## Object property & JSON property
|
|
233
|
-
viewGenericObj :
|
|
234
|
-
- viewInput : view.json
|
|
235
|
-
- viewEnvironment : environment path (foundation, setting, vendor)
|
|
236
|
-
- navigationConst : navigation constant
|
|
237
|
-
- listEnvironments : list EnvisObj (object)
|
|
238
|
-
- whereValue : []
|
|
239
|
-
- IsCard : Is use class card
|
|
240
|
-
- dataInput : alternative data supply; use ESModule import to load json data, then pass the value into here. will override http.get
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
## Callback
|
|
244
|
-
- Callback return object:
|
|
245
|
-
{
|
|
246
|
-
ViewObj: item, // return view object
|
|
247
|
-
Key: key // Key name
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
## JSON property
|
|
251
|
-
view.json :
|
|
252
|
-
``` javascript
|
|
253
|
-
{
|
|
254
|
-
"title": "title", // title view paging
|
|
255
|
-
"subsection": [ // subsection list
|
|
256
|
-
{
|
|
257
|
-
"subSectionId": "id", // uniqueId
|
|
258
|
-
"subSectionTitle": "Main Information", // sub-section title
|
|
259
|
-
"mainInfoUrl": "", // full path API get data
|
|
260
|
-
"mainInfoPath": "", // only path API get data
|
|
261
|
-
"environment": "", // refer to listEnvironment
|
|
262
|
-
"reqObj": {}, // request object for hit API, default take from queryParamfalse will take from response[resObjName]
|
|
263
|
-
"resObjName": "", // response object name to get data
|
|
264
|
-
"mainInfo": [ // view information list
|
|
265
|
-
{
|
|
266
|
-
"type": "blank"
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
"type": "link", // text with link button
|
|
270
|
-
"label": "View Name", // label information name
|
|
271
|
-
"customClassLabel": "font-weight-bold", // *optional, additional class to change css in label
|
|
272
|
-
"customClassProperty": "font-weight-bold", // *optional, additional class to change css in property
|
|
273
|
-
"property": "viewName", // property to view
|
|
274
|
-
"position": "left", // label position (left, center, right | default left) *optional
|
|
275
|
-
"path": "/test/paging", // router path
|
|
276
|
-
"target" : "_self", // *optional _blank: Opens the linked document in a new window or tab
|
|
277
|
-
"param": [ // passing optional parameters
|
|
278
|
-
{
|
|
279
|
-
"type" : "vendorId", // key parameter
|
|
280
|
-
"property": "vendorId", // property to pass
|
|
281
|
-
}
|
|
282
|
-
],
|
|
283
|
-
"name": "name" // set name for ddlEnvironments *optional,
|
|
284
|
-
"isHide": true // jika value kosong, label dihide juga
|
|
285
|
-
"isCurrency": true // if true, currency separator formatter
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
"type": "text", // text only
|
|
289
|
-
"label": "View Code",
|
|
290
|
-
"property": "viewCode"
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
"type": "currency", // currency separator formatter
|
|
294
|
-
"label": "View Code",
|
|
295
|
-
"property": "viewCode",
|
|
296
|
-
"precision" : "0.2" //Precision (0.2, 0.4, 0.6, ... | default 0.2) *optional
|
|
297
|
-
"IsPrcnt": false, // if true, ' %'
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
"type": "date", // date formatter
|
|
301
|
-
"label": "View Code",
|
|
302
|
-
"property": "viewCode",
|
|
303
|
-
"dateFormat": "dd-MMM-yyyy" //Default format dd-MMM-yyyy *optional
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
"type": "textarea", // textarea input type, read only
|
|
307
|
-
"label": "View Code",
|
|
308
|
-
"property": "viewCode"
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
"type": "boolean", // boolean 0|1 (no|yes)
|
|
312
|
-
"label": "View Code",
|
|
313
|
-
"property": "viewCode"
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
"type" : "callback", // return selected row object
|
|
317
|
-
"label": "View Code",
|
|
318
|
-
"property" : "bodyId",
|
|
319
|
-
"key" : "download/upload/trigger" // Key name for specific action
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
"type": "concat",
|
|
323
|
-
"label": "View Code",
|
|
324
|
-
"propertyList": [
|
|
325
|
-
{
|
|
326
|
-
"property": "viewCode",
|
|
327
|
-
"prefix": "",
|
|
328
|
-
"suffix": " + "
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
"property": "viewCode",
|
|
332
|
-
"prefix": "RT: ",
|
|
333
|
-
"suffix": ""
|
|
334
|
-
}
|
|
335
|
-
]
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
"type" : "switch", // switch case condition
|
|
339
|
-
"case" : [ // list of case
|
|
340
|
-
{
|
|
341
|
-
"conditions" : [ // list of conditions
|
|
342
|
-
{
|
|
343
|
-
"isUser": true,
|
|
344
|
-
"property" : "isActive", // property for condition checking
|
|
345
|
-
"value" : "0", // value to check (IN or NIN list/[])
|
|
346
|
-
"restriction" : "EQ" // condition restrictions (EQ, NEQ, GT, GTE, LT, LTE, IN, NIN | default EQ) *optional
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
"property" : "type",
|
|
350
|
-
"value" : "EXE",
|
|
351
|
-
"restriction" : "EQ"
|
|
352
|
-
}
|
|
353
|
-
],
|
|
354
|
-
"result" : { // result of this case
|
|
355
|
-
"type": "url", // redirect path action
|
|
356
|
-
"label": "View Code",
|
|
357
|
-
"path" : "/test/paging",
|
|
358
|
-
"icon" : "ft-edit-2", // set class icon from feather icon
|
|
359
|
-
"param" : [
|
|
360
|
-
{
|
|
361
|
-
"type" : "refBodyId",
|
|
362
|
-
"property" : "refBodyId"
|
|
363
|
-
}
|
|
364
|
-
],
|
|
365
|
-
"hideIfEmpty" : true // if one property yield empty value, label will also hide *optional, boolean
|
|
366
|
-
},
|
|
367
|
-
"result" : { // result of this case
|
|
368
|
-
"type": "callback", // return selected row object"label": "View Code",
|
|
369
|
-
"label": "View Code",
|
|
370
|
-
"icon" : "ft-edit-2"
|
|
371
|
-
},
|
|
372
|
-
"result" : { // result of this case
|
|
373
|
-
"type": "text", // type like bodyList : text,decimal,date,link,boolean
|
|
374
|
-
"label": "View Code",
|
|
375
|
-
"property" : "bodyId"
|
|
376
|
-
},
|
|
377
|
-
"result" : {
|
|
378
|
-
"type": "concat",
|
|
379
|
-
"label": "View Code",
|
|
380
|
-
"propertyList": [
|
|
381
|
-
{
|
|
382
|
-
"property": "viewCode",
|
|
383
|
-
"prefix": "",
|
|
384
|
-
"suffix": " + "
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
"property": "viewCode",
|
|
388
|
-
"prefix": "RT: ",
|
|
389
|
-
"suffix": ""
|
|
390
|
-
}
|
|
391
|
-
]
|
|
392
|
-
},
|
|
393
|
-
"isHide" : true // hide icon if condition true, MUST *boolean
|
|
394
|
-
}
|
|
395
|
-
]
|
|
396
|
-
}
|
|
397
|
-
],
|
|
398
|
-
"gridViews": [
|
|
399
|
-
{
|
|
400
|
-
"getData": {
|
|
401
|
-
"environment": "", // refer to listEnvironment
|
|
402
|
-
"apiPath": "", // only path API get data
|
|
403
|
-
"customObjName": "ReturnObject", // / CustomObjName variable *Default: "ReturnObject"
|
|
404
|
-
"reqObj": [
|
|
405
|
-
{
|
|
406
|
-
"propName": "", // Property name for request payload
|
|
407
|
-
"propValue": "" // Property value for request payload
|
|
408
|
-
}
|
|
409
|
-
]
|
|
410
|
-
},
|
|
411
|
-
"tableInput": { // same as ucgridview setting
|
|
412
|
-
"isSeq": false, // show numbering on the left side of table
|
|
413
|
-
"headerList": {}, // same as ucgridview setting
|
|
414
|
-
"bodyList": {} // same as ucgridview setting
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
]
|
|
418
|
-
}
|
|
419
|
-
],
|
|
420
|
-
"querystring": {
|
|
421
|
-
"select": "", // ex: "SELECT OFFICE_NAME AS OfficeName,IS_ACTIVE AS IsActive" *must use alias
|
|
422
|
-
"from": "", // ex: "FROM REF_OFFICE WITH(NOLOCK)"
|
|
423
|
-
"where": "" // ex: "WHERE REF_OFFICE_ID = {0} OR OFFICE_CODE = N'{1}'" *where condition sequence, with value from queryParam sequence
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
## Code scaffolding
|
|
429
|
-
|
|
430
|
-
Run `ng generate component component-name --project ucviewgeneric` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ucviewgeneric`.
|
|
431
|
-
> Note: Don't forget to add `--project ucviewgeneric` or else it will be added to the default project in your `angular.json` file.
|
|
432
|
-
|
|
433
|
-
## Build
|
|
434
|
-
|
|
435
|
-
Run `ng build ucviewgeneric` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
436
|
-
|
|
437
|
-
## Publishing
|
|
438
|
-
|
|
439
|
-
After building your library with `ng build ucviewgeneric`, go to the dist folder `cd dist/ucviewgeneric` and run `npm publish`.
|
|
440
|
-
|
|
441
|
-
## Running unit tests
|
|
442
|
-
|
|
443
|
-
Run `ng test ucviewgeneric` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
444
|
-
|
|
445
|
-
## Further help
|
|
446
|
-
|
|
447
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
|
1
|
+
# Ucviewgeneric
|
|
2
|
+
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.2.0.
|
|
4
|
+
|
|
5
|
+
## Version
|
|
6
|
+
|
|
7
|
+
Version 1.0.2
|
|
8
|
+
1. fix subsection not working
|
|
9
|
+
|
|
10
|
+
Version 1.0.1
|
|
11
|
+
1. Added ReadMe
|
|
12
|
+
|
|
13
|
+
## Input
|
|
14
|
+
1. title : string : mandatory
|
|
15
|
+
used to set subsection title
|
|
16
|
+
2. panel : string : mandatory
|
|
17
|
+
used to set panel hide or unhide
|
|
18
|
+
3. id : string : mandatory
|
|
19
|
+
used to set id hide or unhide
|
|
20
|
+
|
|
21
|
+
## Output
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## Code scaffolding
|
|
25
|
+
|
|
26
|
+
Run `ng generate component component-name --project ucviewgeneric` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ucviewgeneric`.
|
|
27
|
+
> Note: Don't forget to add `--project ucviewgeneric` or else it will be added to the default project in your `angular.json` file.
|
|
28
|
+
|
|
29
|
+
## Build
|
|
30
|
+
|
|
31
|
+
Run `ng build ucviewgeneric` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
32
|
+
|
|
33
|
+
## Publishing
|
|
34
|
+
|
|
35
|
+
After building your library with `ng build ucviewgeneric`, go to the dist folder `cd dist/ucviewgeneric` and run `npm publish`.
|
|
36
|
+
|
|
37
|
+
## Running unit tests
|
|
38
|
+
|
|
39
|
+
Run `ng test ucviewgeneric` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
40
|
+
|
|
41
|
+
## Further help
|
|
42
|
+
|
|
43
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@angular/core'), require('@angular/common'), require('@angular/router'), require('@adins/uc-subsection')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('ucviewgeneric', ['exports', '@angular/common/http', '@angular/core', '@angular/common', '@angular/router', '@adins/uc-subsection'], factory) :
|
|
4
|
+
(factory((global.ucviewgeneric = {}),global.ng.common.http,global.ng.core,global.ng.common,global.ng.router,global.ucSubsection));
|
|
5
|
+
}(this, (function (exports,http,i0,common,router,ucSubsection) { 'use strict';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview added by tsickle
|
|
9
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
10
|
+
*/
|
|
11
|
+
var UcviewgenericService = /** @class */ (function () {
|
|
12
|
+
function UcviewgenericService() {
|
|
13
|
+
}
|
|
14
|
+
UcviewgenericService.decorators = [
|
|
15
|
+
{ type: i0.Injectable, args: [{
|
|
16
|
+
providedIn: 'root'
|
|
17
|
+
},] }
|
|
18
|
+
];
|
|
19
|
+
/** @nocollapse */
|
|
20
|
+
UcviewgenericService.ctorParameters = function () { return []; };
|
|
21
|
+
/** @nocollapse */ UcviewgenericService.ngInjectableDef = i0.defineInjectable({ factory: function UcviewgenericService_Factory() { return new UcviewgenericService(); }, token: UcviewgenericService, providedIn: "root" });
|
|
22
|
+
return UcviewgenericService;
|
|
23
|
+
}());
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @fileoverview added by tsickle
|
|
27
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
28
|
+
*/
|
|
29
|
+
var UcviewgenericComponent = /** @class */ (function () {
|
|
30
|
+
function UcviewgenericComponent(route, http$$1) {
|
|
31
|
+
var _this = this;
|
|
32
|
+
this.route = route;
|
|
33
|
+
this.http = http$$1;
|
|
34
|
+
this.viewList = "";
|
|
35
|
+
this.mainInfoObj = "";
|
|
36
|
+
this.route.queryParams.subscribe(( /**
|
|
37
|
+
* @param {?} params
|
|
38
|
+
* @return {?}
|
|
39
|
+
*/function (params) {
|
|
40
|
+
_this.getList = params;
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @return {?}
|
|
45
|
+
*/
|
|
46
|
+
UcviewgenericComponent.prototype.ngOnInit = /**
|
|
47
|
+
* @return {?}
|
|
48
|
+
*/
|
|
49
|
+
function () {
|
|
50
|
+
console.log("viewgeneric");
|
|
51
|
+
this.initiateForm();
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* @return {?}
|
|
55
|
+
*/
|
|
56
|
+
UcviewgenericComponent.prototype.initiateForm = /**
|
|
57
|
+
* @return {?}
|
|
58
|
+
*/
|
|
59
|
+
function () {
|
|
60
|
+
var _this = this;
|
|
61
|
+
this.getJSON(this.viewInput).subscribe(( /**
|
|
62
|
+
* @param {?} data
|
|
63
|
+
* @return {?}
|
|
64
|
+
*/function (data) {
|
|
65
|
+
console.log(data);
|
|
66
|
+
_this.viewList = data;
|
|
67
|
+
_this.http.post(_this.viewList.mainInfoUrl, _this.getList).subscribe(( /**
|
|
68
|
+
* @param {?} response
|
|
69
|
+
* @return {?}
|
|
70
|
+
*/function (response) {
|
|
71
|
+
console.log(response);
|
|
72
|
+
_this.mainInfoObj = response["returnObject"];
|
|
73
|
+
}), ( /**
|
|
74
|
+
* @param {?} error
|
|
75
|
+
* @return {?}
|
|
76
|
+
*/function (error) {
|
|
77
|
+
console.log(error);
|
|
78
|
+
}));
|
|
79
|
+
}));
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* @param {?} url
|
|
83
|
+
* @return {?}
|
|
84
|
+
*/
|
|
85
|
+
UcviewgenericComponent.prototype.getJSON = /**
|
|
86
|
+
* @param {?} url
|
|
87
|
+
* @return {?}
|
|
88
|
+
*/
|
|
89
|
+
function (url) {
|
|
90
|
+
return this.http.get(url);
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* @param {?} param
|
|
94
|
+
* @return {?}
|
|
95
|
+
*/
|
|
96
|
+
UcviewgenericComponent.prototype.genAction = /**
|
|
97
|
+
* @param {?} param
|
|
98
|
+
* @return {?}
|
|
99
|
+
*/
|
|
100
|
+
function (param) {
|
|
101
|
+
/** @type {?} */
|
|
102
|
+
var arrList = {};
|
|
103
|
+
for (var i = 0; i < param.length; i++) {
|
|
104
|
+
arrList[param[i].property] = this.mainInfoObj[param[i].property];
|
|
105
|
+
}
|
|
106
|
+
return arrList;
|
|
107
|
+
};
|
|
108
|
+
UcviewgenericComponent.decorators = [
|
|
109
|
+
{ type: i0.Component, args: [{
|
|
110
|
+
selector: 'lib-ucviewgeneric',
|
|
111
|
+
template: "<div class=\"col-md-12\">\r\n <div class=\"card\">\r\n <div class=\"card-header\">\r\n <h4 class=\"card-title\" id=\"horz-layout-colored-controls\" translate> {{ viewList.title }} </h4>\r\n </div>\r\n <div class=\"card-body\">\r\n <div class=\"px-3\">\r\n <lib-ucSubsection *ngIf=\"viewList != ''\" [id]=\"viewList.subSectionId + 'id'\"\r\n [title]=\"viewList.subSectionTitle\" [panel]=\"viewList.subSectionId\">\r\n </lib-ucSubsection>\r\n <div class=\"form-body\" [id]='viewList.subSectionId'>\r\n <div class=\"form-group row\">\r\n <div class=\"col-md-6\" *ngFor=\"let mi of viewList?.mainInfo\">\r\n <div class=\"row\">\r\n <div class=\"col-md-6\">\r\n <label class=\"label-control\" name=\"VendorCode\" translate> {{ mi.label }} </label>\r\n </div>\r\n <div class=\"col-md-6\">\r\n <label *ngIf=\"mi.type == 'text'\" class=\"label-control\" translate>\r\n {{ mainInfoObj[mi.property] }} </label>\r\n <label *ngIf=\"mi.type == 'currency'\" class=\"label-control\" translate>\r\n {{ mainInfoObj[mi.property] | number}} </label>\r\n <label *ngIf=\"mi.type == 'date'\" class=\"label-control\" translate>\r\n {{ mainInfoObj[mi.property] | date: 'dd-MMM-yyyy'}} </label>\r\n <label *ngIf=\"mi.type == 'link'\" class=\"label-control\" translate><a\r\n [routerLink]=\"[mi.path]\" [queryParams]=\"genAction(mi.param)\">\r\n {{ mainInfoObj[mi.property] }} </a></label>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>"
|
|
112
|
+
}] }
|
|
113
|
+
];
|
|
114
|
+
/** @nocollapse */
|
|
115
|
+
UcviewgenericComponent.ctorParameters = function () {
|
|
116
|
+
return [
|
|
117
|
+
{ type: router.ActivatedRoute },
|
|
118
|
+
{ type: http.HttpClient }
|
|
119
|
+
];
|
|
120
|
+
};
|
|
121
|
+
UcviewgenericComponent.propDecorators = {
|
|
122
|
+
viewInput: [{ type: i0.Input }]
|
|
123
|
+
};
|
|
124
|
+
return UcviewgenericComponent;
|
|
125
|
+
}());
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @fileoverview added by tsickle
|
|
129
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
130
|
+
*/
|
|
131
|
+
var UcviewgenericModule = /** @class */ (function () {
|
|
132
|
+
function UcviewgenericModule() {
|
|
133
|
+
}
|
|
134
|
+
UcviewgenericModule.decorators = [
|
|
135
|
+
{ type: i0.NgModule, args: [{
|
|
136
|
+
declarations: [UcviewgenericComponent],
|
|
137
|
+
imports: [
|
|
138
|
+
common.CommonModule,
|
|
139
|
+
router.RouterModule,
|
|
140
|
+
ucSubsection.UcSubsectionModule
|
|
141
|
+
],
|
|
142
|
+
exports: [UcviewgenericComponent]
|
|
143
|
+
},] }
|
|
144
|
+
];
|
|
145
|
+
return UcviewgenericModule;
|
|
146
|
+
}());
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @fileoverview added by tsickle
|
|
150
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @fileoverview added by tsickle
|
|
155
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
156
|
+
*/
|
|
157
|
+
|
|
158
|
+
exports.UcviewgenericService = UcviewgenericService;
|
|
159
|
+
exports.UcviewgenericComponent = UcviewgenericComponent;
|
|
160
|
+
exports.UcviewgenericModule = UcviewgenericModule;
|
|
161
|
+
|
|
162
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
163
|
+
|
|
164
|
+
})));
|
|
165
|
+
|
|
166
|
+
//# sourceMappingURL=ucviewgeneric.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ucviewgeneric.umd.js.map","sources":["ng://ucviewgeneric/lib/ucviewgeneric.service.ts","ng://ucviewgeneric/lib/ucviewgeneric.component.ts","ng://ucviewgeneric/lib/ucviewgeneric.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UcviewgenericService {\n\n constructor() { }\n}\n","import { Component, OnInit, Input } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable } from 'rxjs';\n\n@Component({\n selector: 'lib-ucviewgeneric',\n templateUrl: './ucviewgeneric.component.html',\n styles: []\n})\nexport class UcviewgenericComponent implements OnInit {\n\n @Input() viewInput: any;\n viewList: any = \"\";\n mainInfoObj: any = \"\";\n getList: any;\n\n constructor(private route: ActivatedRoute, private http: HttpClient) { \n this.route.queryParams.subscribe(params => {\n this.getList = params;\n });\n }\n\n ngOnInit() {\n console.log(\"viewgeneric\");\n this.initiateForm();\n }\n\n initiateForm() {\n this.getJSON(this.viewInput).subscribe(data => {\n console.log(data);\n this.viewList = data;\n\n this.http.post(this.viewList.mainInfoUrl, this.getList).subscribe(\n (response) => {\n console.log(response);\n this.mainInfoObj = response[\"returnObject\"];\n },\n (error) => {\n console.log(error);\n })\n })\n }\n\n public getJSON(url: string): Observable<any> {\n return this.http.get(url);\n }\n \n genAction(param) {\n var arrList = {};\n\n for (var i = 0; i < param.length; i++) {\n arrList[param[i].property] = this.mainInfoObj[param[i].property];\n }\n return arrList;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { UcviewgenericComponent } from './ucviewgeneric.component';\nimport { CommonModule } from '@angular/common';\nimport { RouterModule } from '@angular/router';\nimport { UcSubsectionModule } from '@adins/uc-subsection';\n\n@NgModule({\n declarations: [UcviewgenericComponent],\n imports: [\n CommonModule,\n RouterModule,\n UcSubsectionModule\n ],\n exports: [UcviewgenericComponent]\n})\nexport class UcviewgenericModule { }\n"],"names":["Injectable","http","Component","ActivatedRoute","HttpClient","Input","NgModule","CommonModule","RouterModule","UcSubsectionModule"],"mappings":";;;;;;;;;;AAAA;QAOE;SAAiB;;oBALlBA,aAAU,SAAC;wBACV,UAAU,EAAE,MAAM;qBACnB;;;;;mCAJD;KAEA;;;;;;ACFA;QAiBE,gCAAoB,KAAqB,EAAUC,OAAgB;YAAnE,iBAIC;YAJmB,UAAK,GAAL,KAAK,CAAgB;YAAU,SAAI,GAAJA,OAAI,CAAY;YAJnE,aAAQ,GAAQ,EAAE,CAAC;YACnB,gBAAW,GAAQ,EAAE,CAAC;YAIpB,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS;;;eAAC,UAAA,MAAM;gBACrC,KAAI,CAAC,OAAO,GAAG,MAAM,CAAC;aACvB,EAAC,CAAC;SACJ;;;;QAED,yCAAQ;;;YAAR;gBACE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;gBAC3B,IAAI,CAAC,YAAY,EAAE,CAAC;aACrB;;;;QAED,6CAAY;;;YAAZ;gBAAA,iBAcC;gBAbC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS;;;mBAAC,UAAA,IAAI;oBACzC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBAClB,KAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBAErB,KAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC,SAAS;;;uBAC/D,UAAC,QAAQ;wBACP,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;wBACtB,KAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;qBAC7C;;;uBACD,UAAC,KAAK;wBACJ,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;qBACpB,EAAC,CAAA;iBACL,EAAC,CAAA;aACH;;;;;QAEM,wCAAO;;;;YAAd,UAAe,GAAW;gBACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aAC3B;;;;;QAED,0CAAS;;;;YAAT,UAAU,KAAK;;oBACT,OAAO,GAAG,EAAE;gBAEhB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACrC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;iBAClE;gBACD,OAAO,OAAO,CAAC;aAChB;;oBAlDFC,YAAS,SAAC;wBACT,QAAQ,EAAE,mBAAmB;wBAC7B,mtEAA6C;qBAE9C;;;;;wBARQC,qBAAc;wBACdC,eAAU;;;;gCAUhBC,QAAK;;QA4CR,6BAAC;KAnDD;;;;;;ACLA;QAMA;SASoC;;oBATnCC,WAAQ,SAAC;wBACR,YAAY,EAAE,CAAC,sBAAsB,CAAC;wBACtC,OAAO,EAAE;4BACPC,mBAAY;4BACZC,mBAAY;4BACZC,+BAAkB;yBACnB;wBACD,OAAO,EAAE,CAAC,sBAAsB,CAAC;qBAClC;;QACkC,0BAAC;KATpC;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/common/http"),require("@angular/core"),require("@angular/common"),require("@angular/router"),require("@adins/uc-subsection")):"function"==typeof define&&define.amd?define("ucviewgeneric",["exports","@angular/common/http","@angular/core","@angular/common","@angular/router","@adins/uc-subsection"],n):n(e.ucviewgeneric={},e.ng.common.http,e.ng.core,e.ng.common,e.ng.router,e.ucSubsection)}(this,function(e,n,t,r,i,o){"use strict";var a=(c.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],c.ctorParameters=function(){return[]},c.ngInjectableDef=t.defineInjectable({factory:function(){return new c},token:c,providedIn:"root"}),c);function c(){}var s=(l.prototype.ngOnInit=function(){console.log("viewgeneric"),this.initiateForm()},l.prototype.initiateForm=function(){var n=this;this.getJSON(this.viewInput).subscribe(function(e){console.log(e),n.viewList=e,n.http.post(n.viewList.mainInfoUrl,n.getList).subscribe(function(e){console.log(e),n.mainInfoObj=e.returnObject},function(e){console.log(e)})})},l.prototype.getJSON=function(e){return this.http.get(e)},l.prototype.genAction=function(e){for(var n={},t=0;t<e.length;t++)n[e[t].property]=this.mainInfoObj[e[t].property];return n},l.decorators=[{type:t.Component,args:[{selector:"lib-ucviewgeneric",template:'<div class="col-md-12">\r\n <div class="card">\r\n <div class="card-header">\r\n <h4 class="card-title" id="horz-layout-colored-controls" translate> {{ viewList.title }} </h4>\r\n </div>\r\n <div class="card-body">\r\n <div class="px-3">\r\n <lib-ucSubsection *ngIf="viewList != \'\'" [id]="viewList.subSectionId + \'id\'"\r\n [title]="viewList.subSectionTitle" [panel]="viewList.subSectionId">\r\n </lib-ucSubsection>\r\n <div class="form-body" [id]=\'viewList.subSectionId\'>\r\n <div class="form-group row">\r\n <div class="col-md-6" *ngFor="let mi of viewList?.mainInfo">\r\n <div class="row">\r\n <div class="col-md-6">\r\n <label class="label-control" name="VendorCode" translate> {{ mi.label }} </label>\r\n </div>\r\n <div class="col-md-6">\r\n <label *ngIf="mi.type == \'text\'" class="label-control" translate>\r\n {{ mainInfoObj[mi.property] }} </label>\r\n <label *ngIf="mi.type == \'currency\'" class="label-control" translate>\r\n {{ mainInfoObj[mi.property] | number}} </label>\r\n <label *ngIf="mi.type == \'date\'" class="label-control" translate>\r\n {{ mainInfoObj[mi.property] | date: \'dd-MMM-yyyy\'}} </label>\r\n <label *ngIf="mi.type == \'link\'" class="label-control" translate><a\r\n [routerLink]="[mi.path]" [queryParams]="genAction(mi.param)">\r\n {{ mainInfoObj[mi.property] }} </a></label>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>'}]}],l.ctorParameters=function(){return[{type:i.ActivatedRoute},{type:n.HttpClient}]},l.propDecorators={viewInput:[{type:t.Input}]},l);function l(e,n){var t=this;this.route=e,this.http=n,this.viewList="",this.mainInfoObj="",this.route.queryParams.subscribe(function(e){t.getList=e})}var u=(d.decorators=[{type:t.NgModule,args:[{declarations:[s],imports:[r.CommonModule,i.RouterModule,o.UcSubsectionModule],exports:[s]}]}],d);function d(){}e.UcviewgenericService=a,e.UcviewgenericComponent=s,e.UcviewgenericModule=u,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
2
|
+
//# sourceMappingURL=ucviewgeneric.umd.min.js.map
|