wacom 14.2.0 → 14.2.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 +197 -465
- package/esm2020/lib/components/alert/alert.component.mjs +5 -5
- package/esm2020/lib/components/alert/wrapper/wrapper.component.mjs +5 -5
- package/esm2020/lib/components/files/files.component.mjs +5 -5
- package/esm2020/lib/components/loader/loader.component.mjs +5 -5
- package/esm2020/lib/components/modal/modal.component.mjs +5 -5
- package/esm2020/lib/directives/click-outside.directive.mjs +5 -5
- package/esm2020/lib/guard/meta.guard.mjs +4 -4
- package/esm2020/lib/interfaces/alert.interface.mjs +1 -1
- package/esm2020/lib/interfaces/config.mjs +1 -1
- package/esm2020/lib/interfaces/modal.interface.mjs +1 -1
- package/esm2020/lib/pipes/arr.pipe.mjs +4 -4
- package/esm2020/lib/pipes/mongodate.pipe.mjs +4 -4
- package/esm2020/lib/pipes/pagination.pipe.mjs +4 -4
- package/esm2020/lib/pipes/safe.pipe.mjs +4 -4
- package/esm2020/lib/pipes/search.pipe.mjs +4 -4
- package/esm2020/lib/pipes/splice.pipe.mjs +4 -4
- package/esm2020/lib/services/alert.service.mjs +4 -4
- package/esm2020/lib/services/base.service.mjs +4 -4
- package/esm2020/lib/services/core.service.mjs +37 -27
- package/esm2020/lib/services/crud.service.mjs +4 -4
- package/esm2020/lib/services/dom.service.mjs +4 -4
- package/esm2020/lib/services/file.service.mjs +4 -4
- package/esm2020/lib/services/hash.service.mjs +4 -4
- package/esm2020/lib/services/http.service.mjs +49 -22
- package/esm2020/lib/services/loader.service.mjs +4 -4
- package/esm2020/lib/services/meta.service.mjs +7 -7
- package/esm2020/lib/services/modal.service.mjs +4 -4
- package/esm2020/lib/services/mongo.service.mjs +4 -4
- package/esm2020/lib/services/render.service.mjs +4 -4
- package/esm2020/lib/services/socket.service.mjs +4 -4
- package/esm2020/lib/services/store.service.mjs +4 -4
- package/esm2020/lib/services/time.service.mjs +4 -4
- package/esm2020/lib/services/ui.service.mjs +4 -4
- package/esm2020/lib/wacom.module.mjs +5 -5
- package/esm2020/public-api.mjs +1 -1
- package/fesm2015/wacom.mjs +181 -145
- package/fesm2015/wacom.mjs.map +1 -1
- package/fesm2020/wacom.mjs +181 -145
- package/fesm2020/wacom.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/components/alert/README.md +34 -34
- package/src/lib/components/loader/README.md +34 -34
package/README.md
CHANGED
|
@@ -1,465 +1,197 @@
|
|
|
1
|
-
# Angular (ngx) common
|
|
2
|
-
Module which has common services and components which can be used on all projects.
|
|
3
|
-
|
|
4
|
-
## Getting Started
|
|
5
|
-
|
|
6
|
-
### License
|
|
7
|
-
[MIT](LICENSE)
|
|
8
|
-
|
|
9
|
-
### Instalation
|
|
10
|
-
```bash
|
|
11
|
-
$ npm i --save wacom
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
### Services
|
|
15
|
-
| Name | Description |
|
|
16
|
-
| ------- |:-----:|
|
|
17
|
-
| [**`Core`**](https://www.npmjs.com/package/wacom#core-service) | Common supportive function which can be used in any service |
|
|
18
|
-
| [**`Http`**](https://www.npmjs.com/package/wacom#http-service) | Http layer for HttpClient |
|
|
19
|
-
| [**`Store`**](https://www.npmjs.com/package/wacom#store-service) | Service will is responsible for keeping information on the device |
|
|
20
|
-
| [**`Hash`**](https://www.npmjs.com/package/wacom#hash-service) | Hash management for easily use, storage which stay in url |
|
|
21
|
-
| [**`Render`**](https://www.npmjs.com/package/wacom#render-service) | Make not automated render management well structured |
|
|
22
|
-
| [**`Meta`**](https://www.npmjs.com/package/wacom#meta-service) | Website meta tags management within router |
|
|
23
|
-
| [**`Alert`**](https://www.npmjs.com/package/wacom#alert-service) | Alerts management |
|
|
24
|
-
| [**`Modal`**](https://www.npmjs.com/package/wacom#modal-service) | Modals management |
|
|
25
|
-
| [**`UI`**](https://www.npmjs.com/package/wacom#ui-service) | Supportive UI/UX service |
|
|
26
|
-
|
|
27
|
-
##
|
|
28
|
-
|
|
29
|
-
```javascript
|
|
30
|
-
import {
|
|
31
|
-
constructor(private
|
|
32
|
-
```
|
|
33
|
-
###
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
});
|
|
136
|
-
```
|
|
137
|
-
###
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
###
|
|
149
|
-
|
|
150
|
-
```javascript
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
###
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
```
|
|
175
|
-
###
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
Example:
|
|
199
|
-
```javascript
|
|
200
|
-
mongo.sortDescId();
|
|
201
|
-
```
|
|
202
|
-
### sortAscString `function`
|
|
203
|
-
accepting array of object and return it sorted in ascending order by alphabet
|
|
204
|
-
Example:
|
|
205
|
-
```javascript
|
|
206
|
-
mongo.sortAscString();
|
|
207
|
-
```
|
|
208
|
-
### sortDescString `function`
|
|
209
|
-
accepting array of object and return it sorted in descending order by alphabet
|
|
210
|
-
Example:
|
|
211
|
-
```javascript
|
|
212
|
-
mongo.sortDescString();
|
|
213
|
-
```
|
|
214
|
-
### sortAscDate `function`
|
|
215
|
-
accepting array of object and return it sorted in ascending order by date
|
|
216
|
-
Example:
|
|
217
|
-
```javascript
|
|
218
|
-
mongo.sortAscDate();
|
|
219
|
-
```
|
|
220
|
-
### sortDescDate `function`
|
|
221
|
-
accepting array of object and return it sorted in descending order by date
|
|
222
|
-
Example:
|
|
223
|
-
```javascript
|
|
224
|
-
mongo.sortDescDate();
|
|
225
|
-
```
|
|
226
|
-
### sortAscNumber `function`
|
|
227
|
-
accepting array of object and return it sorted in ascending order by number
|
|
228
|
-
Example:
|
|
229
|
-
```javascript
|
|
230
|
-
mongo.sortAscNumber();
|
|
231
|
-
```
|
|
232
|
-
### sortDescNumber `function`
|
|
233
|
-
accepting array of object and return it sorted in descending order by number
|
|
234
|
-
Example:
|
|
235
|
-
```javascript
|
|
236
|
-
mongo.sortDescNumber();
|
|
237
|
-
```
|
|
238
|
-
### sortAscBoolean `function`
|
|
239
|
-
accepting array of object and return it sorted: first - true, second - false
|
|
240
|
-
Example:
|
|
241
|
-
```javascript
|
|
242
|
-
mongo.sortAscBoolean();
|
|
243
|
-
```
|
|
244
|
-
### sortDescBoolean `function`
|
|
245
|
-
accepting array of object and return it sorted: first - false, second - true
|
|
246
|
-
Example:
|
|
247
|
-
```javascript
|
|
248
|
-
mongo.sortDescBoolean();
|
|
249
|
-
```
|
|
250
|
-
### beArr `function`
|
|
251
|
-
checking value if it's array then we keep it and in other case, we replace it with new array. Example where each doc will have data as array:
|
|
252
|
-
```javascript
|
|
253
|
-
mongo.get('colName', {
|
|
254
|
-
replace: {
|
|
255
|
-
data:mongo.beArr
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
```
|
|
259
|
-
### beObj `function`
|
|
260
|
-
checking value if it's object then we keep it and in other case, we replace it with new object. Example where each doc will have data as array:
|
|
261
|
-
```javascript
|
|
262
|
-
mongo.get('colName', {
|
|
263
|
-
replace: {
|
|
264
|
-
data:mongo.beObj
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
```
|
|
268
|
-
### beDate `function`
|
|
269
|
-
making value new Date(valueContent). Example where each doc will have date as date:
|
|
270
|
-
```javascript
|
|
271
|
-
mongo.get('colName', {
|
|
272
|
-
replace: {
|
|
273
|
-
date:mongo.beDate
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
```
|
|
277
|
-
### forceArr `function`
|
|
278
|
-
convert any value to array within replace options. Example where each doc will have data as empty array:
|
|
279
|
-
```javascript
|
|
280
|
-
mongo.get('colName', {
|
|
281
|
-
replace: {
|
|
282
|
-
data:mongo.forceArr
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
```
|
|
286
|
-
### forceObj `function`
|
|
287
|
-
convert any value to object within replace options. Example where each doc will have data as empty object:
|
|
288
|
-
```javascript
|
|
289
|
-
mongo.get('colName', {
|
|
290
|
-
replace: {
|
|
291
|
-
data:mongo.forceObj
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
```
|
|
295
|
-
## Alert Service
|
|
296
|
-
Alert Service is an suportive service for alerts manamanagement. Example of importing alert service:
|
|
297
|
-
```javascript
|
|
298
|
-
import { AlertService } from 'wacom';
|
|
299
|
-
constructor(private alert: AlertService){};
|
|
300
|
-
```
|
|
301
|
-
### show `function`
|
|
302
|
-
Opens the alert and return htmlElement of this alert.
|
|
303
|
-
Example 1:
|
|
304
|
-
```javascript
|
|
305
|
-
let my_alert = alert.show({
|
|
306
|
-
text: 'Are you sure?',
|
|
307
|
-
type: 'question',
|
|
308
|
-
timeout: 5000,
|
|
309
|
-
class: 'myClass',
|
|
310
|
-
position: 'bottomRight',
|
|
311
|
-
buttons: [{
|
|
312
|
-
text: 'YES',
|
|
313
|
-
callback: ()=>{
|
|
314
|
-
console.log("YES!");
|
|
315
|
-
}
|
|
316
|
-
},{
|
|
317
|
-
text: 'NO',
|
|
318
|
-
callback: ()=>{
|
|
319
|
-
console.log("NO!");
|
|
320
|
-
}
|
|
321
|
-
}]
|
|
322
|
-
});
|
|
323
|
-
```
|
|
324
|
-
Example 2:
|
|
325
|
-
```javascript
|
|
326
|
-
let my_alert = alert.show({
|
|
327
|
-
component: MyCustomComponent,
|
|
328
|
-
timeout: 5000,
|
|
329
|
-
class: 'myClass',
|
|
330
|
-
position: 'center',
|
|
331
|
-
closable: true
|
|
332
|
-
});
|
|
333
|
-
```
|
|
334
|
-
### options
|
|
335
|
-
| Name | Type | Description |
|
|
336
|
-
| --------------- |--------- | --------------- |
|
|
337
|
-
| `text` | string | Text of alert. |
|
|
338
|
-
| `type` | string | Type of alert(etc `info`, `success`, `warning`, `error`, `question`). |
|
|
339
|
-
| `class` | string | Custom class for your alert. |
|
|
340
|
-
| `unique` | string | Identificator for your alerts. |
|
|
341
|
-
| `progress` | boolean | Enable timeout progress bar. |
|
|
342
|
-
| `position` | string | Position of the alert(`topLeft`, `topCenter`, `topRight`, `right`, `bottomRight`, `bottomCenter`, `bottomLeft`, `left`, `center`). |
|
|
343
|
-
| `timeout` | number | Amount in milliseconds to close the alert, 0 to disable. |
|
|
344
|
-
| `closable` | boolean | Show "x" close button. |
|
|
345
|
-
| `buttons` | number | Array of buttons for your alerts. |
|
|
346
|
-
| `component` | string or @Component | Component which will be appended into the alert. |
|
|
347
|
-
| `close` | function | custom function for close alert. |
|
|
348
|
-
| `onClose` | function | Capture when the alert is closing. |
|
|
349
|
-
### destroy `function`
|
|
350
|
-
Close all alerts. Example:
|
|
351
|
-
```javascript
|
|
352
|
-
alert.destroy();
|
|
353
|
-
```
|
|
354
|
-
## Modal Service
|
|
355
|
-
Modal Service is an suportive service for modals manamanagement. Example of importing modal service:
|
|
356
|
-
```javascript
|
|
357
|
-
import { ModalService } from 'wacom';
|
|
358
|
-
constructor(private modal: ModalService){};
|
|
359
|
-
```
|
|
360
|
-
### show `function`
|
|
361
|
-
Opens the modal and return htmlElement of this modal. Example:
|
|
362
|
-
```javascript
|
|
363
|
-
let my_modal = modal.show({
|
|
364
|
-
component: MyCustomComponent,
|
|
365
|
-
size: 'mid',
|
|
366
|
-
timeout: 5000,
|
|
367
|
-
class: 'myClass',
|
|
368
|
-
position: 'center',
|
|
369
|
-
closable: true
|
|
370
|
-
});
|
|
371
|
-
```
|
|
372
|
-
### options
|
|
373
|
-
| Name | Type | Description |
|
|
374
|
-
| --------------- |--------- | --------------- |
|
|
375
|
-
| `id` | string | |
|
|
376
|
-
| `component` | string or @Component | Component which will be appended into the modal. |
|
|
377
|
-
| `size` | string | Size of the modal. |
|
|
378
|
-
| `timeout` | number | Amount in milliseconds to close the modal, 0 to disable. |
|
|
379
|
-
| `class` | string | Custom class for your modal. |
|
|
380
|
-
| `closable` | boolean | Show "x" close button. |
|
|
381
|
-
| `unique` | string | Identificator for your modals. |
|
|
382
|
-
| `close` | function | custom function for close modal. |
|
|
383
|
-
| `onOpen` | function | Capture when the modal is opening. |
|
|
384
|
-
| `onClose` | function | Capture when the modal is closing. |
|
|
385
|
-
### destroy `function`
|
|
386
|
-
Close all modals. Example:
|
|
387
|
-
```javascript
|
|
388
|
-
modal.destroy();
|
|
389
|
-
```
|
|
390
|
-
## Loader Service
|
|
391
|
-
Loader Service is an suportive service for loaders manamanagement.Example of importing loader service:
|
|
392
|
-
```javascript
|
|
393
|
-
import { LoaderService } from 'wacom';
|
|
394
|
-
constructor(private load: LoaderService){};
|
|
395
|
-
```
|
|
396
|
-
### show `function`
|
|
397
|
-
Opens the loader and return htmlElement of this loader. Example:
|
|
398
|
-
```javascript
|
|
399
|
-
let my_loader = load.show({
|
|
400
|
-
timeout: 5000,
|
|
401
|
-
class: 'myClass',
|
|
402
|
-
closable: true
|
|
403
|
-
});
|
|
404
|
-
```
|
|
405
|
-
### options
|
|
406
|
-
| Name | Type | Description |
|
|
407
|
-
| --------------- |--------- | --------------- |
|
|
408
|
-
| `append` | @Component | Component where the loader will be appended. |
|
|
409
|
-
| `component` | string or @Component | Component which will be appended into the loader. |
|
|
410
|
-
| `timeout` | number | Amount in milliseconds to close the loader, 0 to disable. |
|
|
411
|
-
| `progress` | boolean | Enable timeout progress bar. |
|
|
412
|
-
| `class` | string | Custom class for your loader. |
|
|
413
|
-
| `closable` | boolean | Show "x" close button. |
|
|
414
|
-
| `close` | function | custom function for close loader. |
|
|
415
|
-
| `onClose` | function | Capture when the loader is closing. |
|
|
416
|
-
### destroy `function`
|
|
417
|
-
Close all loaders. Example:
|
|
418
|
-
```javascript
|
|
419
|
-
loader.destroy();
|
|
420
|
-
```
|
|
421
|
-
## UI/UX Service
|
|
422
|
-
UI/UX Service is supportive service for front-end features. This service provides saving css varibles and containes helpful tools for the front developer.
|
|
423
|
-
### var
|
|
424
|
-
Object which can be used to contain all needed fields for front-end.
|
|
425
|
-
### get `function`
|
|
426
|
-
Returns Object with all saved css viriables.
|
|
427
|
-
Example:
|
|
428
|
-
```javascript
|
|
429
|
-
ui.get();
|
|
430
|
-
```
|
|
431
|
-
Result example:
|
|
432
|
-
```javascript
|
|
433
|
-
{
|
|
434
|
-
test: '15px solid'
|
|
435
|
-
}
|
|
436
|
-
```
|
|
437
|
-
### remove `function`
|
|
438
|
-
Removes css varible by the key.
|
|
439
|
-
Example:
|
|
440
|
-
```javascript
|
|
441
|
-
ui.remove('css');
|
|
442
|
-
```
|
|
443
|
-
### set `function`
|
|
444
|
-
Method interface sets a new value for a property on a CSS style declaration object and saves all css variables which you have passed.
|
|
445
|
-
Example:
|
|
446
|
-
```javascript
|
|
447
|
-
ui.set(variables, options);
|
|
448
|
-
```
|
|
449
|
-
```variables``` - All css varibles you want to pass. If you want to set array of variables you'll need to have specific structure of the array. Example: ```[{key: 'name', value: example}]```. Object will be saved with the same structure.
|
|
450
|
-
|
|
451
|
-
```options``` - If you want to save css variables to the localStorage you should pass ```local: true```. Also if you want to save variables only for specific host you should pass ```host: 'hostname'```
|
|
452
|
-
### arr `function`
|
|
453
|
-
Helps developer to generate array with custom length and with elements of specific type.
|
|
454
|
-
Example:
|
|
455
|
-
```html
|
|
456
|
-
<div *ngFor="let obj of ui.arr(length, type)"></div>
|
|
457
|
-
```
|
|
458
|
-
```length``` - Length of generated array.
|
|
459
|
-
```type``` - ```'number'||'text'||'date'``` Will set elements with random content at choosed type. 'number' is default type of elements.
|
|
460
|
-
### text `function`
|
|
461
|
-
Helps developer to generate random string with specific length.
|
|
462
|
-
Example:
|
|
463
|
-
```html
|
|
464
|
-
<span>{{ui.text(length)}}</span>
|
|
465
|
-
```
|
|
1
|
+
# Angular (ngx) common
|
|
2
|
+
Module which has common services and components which can be used on all projects.
|
|
3
|
+
|
|
4
|
+
## Getting Started
|
|
5
|
+
|
|
6
|
+
### License
|
|
7
|
+
[MIT](LICENSE)
|
|
8
|
+
|
|
9
|
+
### Instalation
|
|
10
|
+
```bash
|
|
11
|
+
$ npm i --save wacom
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Services
|
|
15
|
+
| Name | Description |
|
|
16
|
+
| ------- |:-----:|
|
|
17
|
+
| [**`Core`**](https://www.npmjs.com/package/wacom#core-service) | Common supportive function which can be used in any service |
|
|
18
|
+
| [**`Http`**](https://www.npmjs.com/package/wacom#http-service) | Http layer for HttpClient |
|
|
19
|
+
| [**`Store`**](https://www.npmjs.com/package/wacom#store-service) | Service will is responsible for keeping information on the device |
|
|
20
|
+
| [**`Hash`**](https://www.npmjs.com/package/wacom#hash-service) | Hash management for easily use, storage which stay in url |
|
|
21
|
+
| [**`Render`**](https://www.npmjs.com/package/wacom#render-service) | Make not automated render management well structured |
|
|
22
|
+
| [**`Meta`**](https://www.npmjs.com/package/wacom#meta-service) | Website meta tags management within router |
|
|
23
|
+
| [**`Alert`**](https://www.npmjs.com/package/wacom#alert-service) | Alerts management |
|
|
24
|
+
| [**`Modal`**](https://www.npmjs.com/package/wacom#modal-service) | Modals management |
|
|
25
|
+
| [**`UI`**](https://www.npmjs.com/package/wacom#ui-service) | Supportive UI/UX service |
|
|
26
|
+
|
|
27
|
+
## Alert Service
|
|
28
|
+
Alert Service is an suportive service for alerts manamanagement. Example of importing alert service:
|
|
29
|
+
```javascript
|
|
30
|
+
import { AlertService } from 'wacom';
|
|
31
|
+
constructor(private alert: AlertService){};
|
|
32
|
+
```
|
|
33
|
+
### show `function`
|
|
34
|
+
Opens the alert and return htmlElement of this alert.
|
|
35
|
+
Example 1:
|
|
36
|
+
```javascript
|
|
37
|
+
let my_alert = alert.show({
|
|
38
|
+
text: 'Are you sure?',
|
|
39
|
+
type: 'question',
|
|
40
|
+
timeout: 5000,
|
|
41
|
+
class: 'myClass',
|
|
42
|
+
position: 'bottomRight',
|
|
43
|
+
buttons: [{
|
|
44
|
+
text: 'YES',
|
|
45
|
+
callback: ()=>{
|
|
46
|
+
console.log("YES!");
|
|
47
|
+
}
|
|
48
|
+
},{
|
|
49
|
+
text: 'NO',
|
|
50
|
+
callback: ()=>{
|
|
51
|
+
console.log("NO!");
|
|
52
|
+
}
|
|
53
|
+
}]
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
Example 2:
|
|
57
|
+
```javascript
|
|
58
|
+
let my_alert = alert.show({
|
|
59
|
+
component: MyCustomComponent,
|
|
60
|
+
timeout: 5000,
|
|
61
|
+
class: 'myClass',
|
|
62
|
+
position: 'center',
|
|
63
|
+
closable: true
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
### options
|
|
67
|
+
| Name | Type | Description |
|
|
68
|
+
| --------------- |--------- | --------------- |
|
|
69
|
+
| `text` | string | Text of alert. |
|
|
70
|
+
| `type` | string | Type of alert(etc `info`, `success`, `warning`, `error`, `question`). |
|
|
71
|
+
| `class` | string | Custom class for your alert. |
|
|
72
|
+
| `unique` | string | Identificator for your alerts. |
|
|
73
|
+
| `progress` | boolean | Enable timeout progress bar. |
|
|
74
|
+
| `position` | string | Position of the alert(`topLeft`, `topCenter`, `topRight`, `right`, `bottomRight`, `bottomCenter`, `bottomLeft`, `left`, `center`). |
|
|
75
|
+
| `timeout` | number | Amount in milliseconds to close the alert, 0 to disable. |
|
|
76
|
+
| `closable` | boolean | Show "x" close button. |
|
|
77
|
+
| `buttons` | number | Array of buttons for your alerts. |
|
|
78
|
+
| `component` | string or @Component | Component which will be appended into the alert. |
|
|
79
|
+
| `close` | function | custom function for close alert. |
|
|
80
|
+
| `onClose` | function | Capture when the alert is closing. |
|
|
81
|
+
### destroy `function`
|
|
82
|
+
Close all alerts. Example:
|
|
83
|
+
```javascript
|
|
84
|
+
alert.destroy();
|
|
85
|
+
```
|
|
86
|
+
## Modal Service
|
|
87
|
+
Modal Service is an suportive service for modals manamanagement. Example of importing modal service:
|
|
88
|
+
```javascript
|
|
89
|
+
import { ModalService } from 'wacom';
|
|
90
|
+
constructor(private modal: ModalService){};
|
|
91
|
+
```
|
|
92
|
+
### show `function`
|
|
93
|
+
Opens the modal and return htmlElement of this modal. Example:
|
|
94
|
+
```javascript
|
|
95
|
+
let my_modal = modal.show({
|
|
96
|
+
component: MyCustomComponent,
|
|
97
|
+
size: 'mid',
|
|
98
|
+
timeout: 5000,
|
|
99
|
+
class: 'myClass',
|
|
100
|
+
position: 'center',
|
|
101
|
+
closable: true
|
|
102
|
+
});
|
|
103
|
+
```
|
|
104
|
+
### options
|
|
105
|
+
| Name | Type | Description |
|
|
106
|
+
| --------------- |--------- | --------------- |
|
|
107
|
+
| `id` | string | |
|
|
108
|
+
| `component` | string or @Component | Component which will be appended into the modal. |
|
|
109
|
+
| `size` | string | Size of the modal. |
|
|
110
|
+
| `timeout` | number | Amount in milliseconds to close the modal, 0 to disable. |
|
|
111
|
+
| `class` | string | Custom class for your modal. |
|
|
112
|
+
| `closable` | boolean | Show "x" close button. |
|
|
113
|
+
| `unique` | string | Identificator for your modals. |
|
|
114
|
+
| `close` | function | custom function for close modal. |
|
|
115
|
+
| `onOpen` | function | Capture when the modal is opening. |
|
|
116
|
+
| `onClose` | function | Capture when the modal is closing. |
|
|
117
|
+
### destroy `function`
|
|
118
|
+
Close all modals. Example:
|
|
119
|
+
```javascript
|
|
120
|
+
modal.destroy();
|
|
121
|
+
```
|
|
122
|
+
## Loader Service
|
|
123
|
+
Loader Service is an suportive service for loaders manamanagement.Example of importing loader service:
|
|
124
|
+
```javascript
|
|
125
|
+
import { LoaderService } from 'wacom';
|
|
126
|
+
constructor(private load: LoaderService){};
|
|
127
|
+
```
|
|
128
|
+
### show `function`
|
|
129
|
+
Opens the loader and return htmlElement of this loader. Example:
|
|
130
|
+
```javascript
|
|
131
|
+
let my_loader = load.show({
|
|
132
|
+
timeout: 5000,
|
|
133
|
+
class: 'myClass',
|
|
134
|
+
closable: true
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
### options
|
|
138
|
+
| Name | Type | Description |
|
|
139
|
+
| --------------- |--------- | --------------- |
|
|
140
|
+
| `append` | @Component | Component where the loader will be appended. |
|
|
141
|
+
| `component` | string or @Component | Component which will be appended into the loader. |
|
|
142
|
+
| `timeout` | number | Amount in milliseconds to close the loader, 0 to disable. |
|
|
143
|
+
| `progress` | boolean | Enable timeout progress bar. |
|
|
144
|
+
| `class` | string | Custom class for your loader. |
|
|
145
|
+
| `closable` | boolean | Show "x" close button. |
|
|
146
|
+
| `close` | function | custom function for close loader. |
|
|
147
|
+
| `onClose` | function | Capture when the loader is closing. |
|
|
148
|
+
### destroy `function`
|
|
149
|
+
Close all loaders. Example:
|
|
150
|
+
```javascript
|
|
151
|
+
loader.destroy();
|
|
152
|
+
```
|
|
153
|
+
## UI/UX Service
|
|
154
|
+
UI/UX Service is supportive service for front-end features. This service provides saving css varibles and containes helpful tools for the front developer.
|
|
155
|
+
### var
|
|
156
|
+
Object which can be used to contain all needed fields for front-end.
|
|
157
|
+
### get `function`
|
|
158
|
+
Returns Object with all saved css viriables.
|
|
159
|
+
Example:
|
|
160
|
+
```javascript
|
|
161
|
+
ui.get();
|
|
162
|
+
```
|
|
163
|
+
Result example:
|
|
164
|
+
```javascript
|
|
165
|
+
{
|
|
166
|
+
test: '15px solid'
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
### remove `function`
|
|
170
|
+
Removes css varible by the key.
|
|
171
|
+
Example:
|
|
172
|
+
```javascript
|
|
173
|
+
ui.remove('css');
|
|
174
|
+
```
|
|
175
|
+
### set `function`
|
|
176
|
+
Method interface sets a new value for a property on a CSS style declaration object and saves all css variables which you have passed.
|
|
177
|
+
Example:
|
|
178
|
+
```javascript
|
|
179
|
+
ui.set(variables, options);
|
|
180
|
+
```
|
|
181
|
+
```variables``` - All css varibles you want to pass. If you want to set array of variables you'll need to have specific structure of the array. Example: ```[{key: 'name', value: example}]```. Object will be saved with the same structure.
|
|
182
|
+
|
|
183
|
+
```options``` - If you want to save css variables to the localStorage you should pass ```local: true```. Also if you want to save variables only for specific host you should pass ```host: 'hostname'```
|
|
184
|
+
### arr `function`
|
|
185
|
+
Helps developer to generate array with custom length and with elements of specific type.
|
|
186
|
+
Example:
|
|
187
|
+
```html
|
|
188
|
+
<div *ngFor="let obj of ui.arr(length, type)"></div>
|
|
189
|
+
```
|
|
190
|
+
```length``` - Length of generated array.
|
|
191
|
+
```type``` - ```'number'||'text'||'date'``` Will set elements with random content at choosed type. 'number' is default type of elements.
|
|
192
|
+
### text `function`
|
|
193
|
+
Helps developer to generate random string with specific length.
|
|
194
|
+
Example:
|
|
195
|
+
```html
|
|
196
|
+
<span>{{ui.text(length)}}</span>
|
|
197
|
+
```
|