@qrvey/utils 1.1.5 → 1.1.6
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
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.1.
|
|
1
|
+
# [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.1.6*
|
|
2
2
|
|
|
3
3
|
> Helper, Utils for all Qrvey Projects
|
|
4
4
|
|
|
@@ -107,12 +107,12 @@ Get a text and evaluate if it matchs with a token box label.
|
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
### dist/
|
|
110
|
+
### dist/filters/adapters/FDToFlatUI.js
|
|
111
111
|
|
|
112
112
|
|
|
113
|
-
####
|
|
113
|
+
#### FDToFlatUI(filterData, datasetsInfo)
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
Generates a Flattened UI filter structure from Filter Data structure.
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
|
|
@@ -121,74 +121,59 @@ Get date range object from a string date value
|
|
|
121
121
|
|
|
122
122
|
| Name | Type | Description | |
|
|
123
123
|
| ---- | ---- | ----------- | -------- |
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
| withTime | `Boolean` | determines if the date range will include time. Default is true | |
|
|
124
|
+
| filterData | | The filter data object. | |
|
|
125
|
+
| datasetsInfo | | Collection of datasets information | |
|
|
127
126
|
|
|
128
127
|
|
|
129
128
|
|
|
130
129
|
|
|
131
|
-
#####
|
|
130
|
+
##### Returns
|
|
132
131
|
|
|
133
|
-
```javascript
|
|
134
|
-
// 1) Year:
|
|
135
|
-
getDateRange('2020', 'YEAR');
|
|
136
|
-
// Will return:
|
|
137
|
-
{
|
|
138
|
-
from: '01/01/2020 00:00:00',
|
|
139
|
-
to: '12/31/2020 23:59:59'
|
|
140
|
-
}
|
|
141
132
|
|
|
142
|
-
|
|
143
|
-
getDateRange('Q3 2020', 'QUARTER');
|
|
144
|
-
// Will return:
|
|
145
|
-
{
|
|
146
|
-
from: '07/01/2020 00:00:00',
|
|
147
|
-
to: '09/30/2020 23:59:59'
|
|
148
|
-
}
|
|
133
|
+
- a flattened UI filters array
|
|
149
134
|
|
|
150
|
-
// 3) Month:
|
|
151
|
-
getDateRange('Oct 2020', 'MONTH');
|
|
152
|
-
// Will return:
|
|
153
|
-
{
|
|
154
|
-
from: '10/01/2020 00:00:00',
|
|
155
|
-
to: '10/31/2020 23:59:59'
|
|
156
|
-
}
|
|
157
|
-
```
|
|
158
135
|
|
|
159
136
|
|
|
160
|
-
|
|
137
|
+
#### FD21ToFlatUI(scopes, datasetsInfo)
|
|
161
138
|
|
|
139
|
+
Generates a Filter Builder Structure from the Filter Data structure v2.1
|
|
162
140
|
|
|
163
|
-
- `Object` an object with the date range with two string date properties: from and to
|
|
164
141
|
|
|
165
142
|
|
|
166
143
|
|
|
144
|
+
##### Parameters
|
|
167
145
|
|
|
168
|
-
|
|
146
|
+
| Name | Type | Description | |
|
|
147
|
+
| ---- | ---- | ----------- | -------- |
|
|
148
|
+
| scopes | | The filter scope section | |
|
|
149
|
+
| datasetsInfo | | Collection of datasets information | |
|
|
169
150
|
|
|
170
151
|
|
|
171
|
-
#### value()
|
|
172
152
|
|
|
173
|
-
Resolves statement and returns statement value
|
|
174
153
|
|
|
154
|
+
##### Returns
|
|
175
155
|
|
|
176
156
|
|
|
157
|
+
- a flattened UI filters array
|
|
177
158
|
|
|
178
159
|
|
|
179
160
|
|
|
180
|
-
##### Returns
|
|
181
161
|
|
|
162
|
+
### dist/filters/adapters/FDToLogic.js
|
|
182
163
|
|
|
183
|
-
- `AbsoluteRange` `string`
|
|
184
164
|
|
|
165
|
+
#### FDToLogic(filterData)
|
|
166
|
+
|
|
167
|
+
Generates a Filter Logic structure from Filter Data structure.
|
|
185
168
|
|
|
186
169
|
|
|
187
|
-
#### valueAsAnchor()
|
|
188
170
|
|
|
189
|
-
Resolves statement as an anchor
|
|
190
171
|
|
|
172
|
+
##### Parameters
|
|
191
173
|
|
|
174
|
+
| Name | Type | Description | |
|
|
175
|
+
| ---- | ---- | ----------- | -------- |
|
|
176
|
+
| filterData | | The filter data object. | |
|
|
192
177
|
|
|
193
178
|
|
|
194
179
|
|
|
@@ -196,63 +181,76 @@ Resolves statement as an anchor
|
|
|
196
181
|
##### Returns
|
|
197
182
|
|
|
198
183
|
|
|
199
|
-
-
|
|
184
|
+
- a filter logic array
|
|
200
185
|
|
|
201
186
|
|
|
202
187
|
|
|
203
|
-
####
|
|
188
|
+
#### getLogicBodyFromFD21(filterData)
|
|
204
189
|
|
|
205
|
-
|
|
190
|
+
Gets the logic body
|
|
206
191
|
|
|
207
192
|
|
|
208
193
|
|
|
209
194
|
|
|
195
|
+
##### Parameters
|
|
210
196
|
|
|
197
|
+
| Name | Type | Description | |
|
|
198
|
+
| ---- | ---- | ----------- | -------- |
|
|
199
|
+
| filterData | | The filter data object | |
|
|
211
200
|
|
|
212
|
-
##### Returns
|
|
213
201
|
|
|
214
202
|
|
|
215
|
-
- `AbsoluteRange`
|
|
216
203
|
|
|
204
|
+
##### Returns
|
|
217
205
|
|
|
218
206
|
|
|
219
|
-
|
|
207
|
+
- a filter logic array
|
|
220
208
|
|
|
221
|
-
Apply 'this' cursor logic to statement
|
|
222
209
|
|
|
223
210
|
|
|
224
211
|
|
|
212
|
+
### dist/filters/adapters/FDToUI.js
|
|
225
213
|
|
|
226
214
|
|
|
215
|
+
#### FDToUI(filterData, datasetsInfo)
|
|
227
216
|
|
|
228
|
-
|
|
217
|
+
Generates a UI filter structure from Filter Data structure.
|
|
229
218
|
|
|
230
219
|
|
|
231
|
-
- `AbsoluteStatement`
|
|
232
220
|
|
|
233
221
|
|
|
222
|
+
##### Parameters
|
|
234
223
|
|
|
235
|
-
|
|
224
|
+
| Name | Type | Description | |
|
|
225
|
+
| ---- | ---- | ----------- | -------- |
|
|
226
|
+
| filterData | | The filter data object. | |
|
|
227
|
+
| datasetsInfo | | Collection of datasets information | |
|
|
236
228
|
|
|
237
|
-
Apply 'the last' cursor logic to statement
|
|
238
229
|
|
|
239
230
|
|
|
240
231
|
|
|
232
|
+
##### Returns
|
|
241
233
|
|
|
242
234
|
|
|
235
|
+
- a UI Filters structure
|
|
243
236
|
|
|
244
|
-
##### Returns
|
|
245
237
|
|
|
246
238
|
|
|
247
|
-
|
|
239
|
+
#### FD21ToUI(scopes, section, version, datasetsInfo)
|
|
248
240
|
|
|
241
|
+
Generates a UI filter Structure from the Filter Data structure v2.1
|
|
249
242
|
|
|
250
243
|
|
|
251
|
-
#### _resolveAsTheNext() *private method*
|
|
252
244
|
|
|
253
|
-
Apply 'the next' cursor logic to statement
|
|
254
245
|
|
|
246
|
+
##### Parameters
|
|
255
247
|
|
|
248
|
+
| Name | Type | Description | |
|
|
249
|
+
| ---- | ---- | ----------- | -------- |
|
|
250
|
+
| scopes | | The filter scope section | |
|
|
251
|
+
| section | | The filter section. | |
|
|
252
|
+
| version | | The version of the filter structure | |
|
|
253
|
+
| datasetsInfo | | Collection of datasets information | |
|
|
256
254
|
|
|
257
255
|
|
|
258
256
|
|
|
@@ -260,13 +258,17 @@ Apply 'the next' cursor logic to statement
|
|
|
260
258
|
##### Returns
|
|
261
259
|
|
|
262
260
|
|
|
263
|
-
-
|
|
261
|
+
- a UI filter Structure
|
|
264
262
|
|
|
265
263
|
|
|
266
264
|
|
|
267
|
-
#### replaceNowToken(value, now)
|
|
268
265
|
|
|
269
|
-
|
|
266
|
+
### dist/filters/adapters/UIToFD.js
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
#### UIToFD(filterData)
|
|
270
|
+
|
|
271
|
+
Generates a Filter Data Structure structure from UI Filter Data structure.
|
|
270
272
|
|
|
271
273
|
|
|
272
274
|
|
|
@@ -275,8 +277,7 @@ Replace '@now' token inside a string
|
|
|
275
277
|
|
|
276
278
|
| Name | Type | Description | |
|
|
277
279
|
| ---- | ---- | ----------- | -------- |
|
|
278
|
-
|
|
|
279
|
-
| now | `Date` | | |
|
|
280
|
+
| filterData | | The UI filter data object. | |
|
|
280
281
|
|
|
281
282
|
|
|
282
283
|
|
|
@@ -284,13 +285,13 @@ Replace '@now' token inside a string
|
|
|
284
285
|
##### Returns
|
|
285
286
|
|
|
286
287
|
|
|
287
|
-
-
|
|
288
|
+
- a Filter Data structure
|
|
288
289
|
|
|
289
290
|
|
|
290
291
|
|
|
291
|
-
####
|
|
292
|
+
#### UI21ToFD(uFilterData, version)
|
|
292
293
|
|
|
293
|
-
|
|
294
|
+
Builds the Fitler Data structure from UI filter data
|
|
294
295
|
|
|
295
296
|
|
|
296
297
|
|
|
@@ -299,45 +300,26 @@ Returns a range object (date) from a group of statement params
|
|
|
299
300
|
|
|
300
301
|
| Name | Type | Description | |
|
|
301
302
|
| ---- | ---- | ----------- | -------- |
|
|
302
|
-
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
303
|
+
| uFilterData | | The UI filter Data object | |
|
|
304
|
+
| version | | the version of the structure | |
|
|
306
305
|
|
|
307
|
-
##### Examples
|
|
308
306
|
|
|
309
|
-
```javascript
|
|
310
|
-
pivot = '2021-03-03T12:30:40'
|
|
311
|
-
unit = month
|
|
312
|
-
steps = 2
|
|
313
|
-
setTo = END
|
|
314
|
-
resolverAsCalendar: true
|
|
315
|
-
=> Returns '2021-05-31T23:59:59'
|
|
316
|
-
```
|
|
317
|
-
```javascript
|
|
318
|
-
pivot = '2021-03-03T12:30:40'
|
|
319
|
-
unit = month
|
|
320
|
-
steps = -2
|
|
321
|
-
setTo = START
|
|
322
|
-
resolverAsCalendar: false
|
|
323
|
-
=> Returns '2021-01-03T00:00:00'
|
|
324
|
-
```
|
|
325
307
|
|
|
326
308
|
|
|
327
309
|
##### Returns
|
|
328
310
|
|
|
329
311
|
|
|
330
|
-
-
|
|
312
|
+
-
|
|
331
313
|
|
|
332
314
|
|
|
333
315
|
|
|
334
316
|
|
|
335
|
-
### dist/
|
|
317
|
+
### dist/filters/adapters/UIToFlatUI.js
|
|
336
318
|
|
|
337
319
|
|
|
338
|
-
####
|
|
320
|
+
#### UIToFlatUI(filterData, datasetsInfo)
|
|
339
321
|
|
|
340
|
-
|
|
322
|
+
Generates a Flattened UI filter structure from UI Filter Data structure.
|
|
341
323
|
|
|
342
324
|
|
|
343
325
|
|
|
@@ -346,44 +328,22 @@ Resolve a list of relative statements according to operator
|
|
|
346
328
|
|
|
347
329
|
| Name | Type | Description | |
|
|
348
330
|
| ---- | ---- | ----------- | -------- |
|
|
349
|
-
|
|
|
350
|
-
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
##### Examples
|
|
331
|
+
| filterData | | The UI filter data object. | |
|
|
332
|
+
| datasetsInfo | | Collection of datasets information. Optional for updating the datasets info | |
|
|
356
333
|
|
|
357
|
-
```javascript
|
|
358
|
-
Input:
|
|
359
|
-
{
|
|
360
|
-
"cursor": "the_next",
|
|
361
|
-
"unit": "year",
|
|
362
|
-
"number": 1,
|
|
363
|
-
"includeCurrent": false,
|
|
364
|
-
"isCalendarDate": false,
|
|
365
|
-
"anchor": "03/05/2021"
|
|
366
|
-
}
|
|
367
334
|
|
|
368
|
-
Output:
|
|
369
|
-
{ gte: "03/06/2021 00:00:00", lte: "03/05/2022 23:59:59" }
|
|
370
|
-
```
|
|
371
335
|
|
|
372
336
|
|
|
373
337
|
##### Returns
|
|
374
338
|
|
|
375
339
|
|
|
376
|
-
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
340
|
+
- a flattened UI filters array
|
|
380
341
|
|
|
381
|
-
### dist/general/array/delete.js
|
|
382
342
|
|
|
383
343
|
|
|
384
|
-
####
|
|
344
|
+
#### UI21ToFlatUI(scopes)
|
|
385
345
|
|
|
386
|
-
|
|
346
|
+
Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
|
|
387
347
|
|
|
388
348
|
|
|
389
349
|
|
|
@@ -392,8 +352,7 @@ Inmutable Array Item deletion
|
|
|
392
352
|
|
|
393
353
|
| Name | Type | Description | |
|
|
394
354
|
| ---- | ---- | ----------- | -------- |
|
|
395
|
-
|
|
|
396
|
-
| index | `Number` | the position of the item to delete | |
|
|
355
|
+
| scopes | | The filter scope section | |
|
|
397
356
|
|
|
398
357
|
|
|
399
358
|
|
|
@@ -401,20 +360,18 @@ Inmutable Array Item deletion
|
|
|
401
360
|
##### Returns
|
|
402
361
|
|
|
403
362
|
|
|
404
|
-
- a
|
|
363
|
+
- a flattened UI filters array
|
|
405
364
|
|
|
406
365
|
|
|
407
366
|
|
|
408
367
|
|
|
409
|
-
### dist/
|
|
368
|
+
### dist/filters/adapters/adaptDateGroupingProperty.js
|
|
410
369
|
|
|
411
370
|
|
|
412
|
-
####
|
|
371
|
+
#### adaptDateGroupingProperty(property)
|
|
413
372
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
- If the childArrKey is not matched in the object, the condition tries to resolve the filter anyway and returns an empty array.
|
|
417
|
-
- If the condition is not fulfilled, the function returns a filtered array, probably a empty array inside of the child array
|
|
373
|
+
[TODO: For 2022, eliminate this adapter]
|
|
374
|
+
Get the new property base on the old date grouping properties
|
|
418
375
|
|
|
419
376
|
|
|
420
377
|
|
|
@@ -423,9 +380,7 @@ Filters a nested tree array by a custom condition on the last child node
|
|
|
423
380
|
|
|
424
381
|
| Name | Type | Description | |
|
|
425
382
|
| ---- | ---- | ----------- | -------- |
|
|
426
|
-
|
|
|
427
|
-
| childArrKey | | property representing the children array on the nested tree | |
|
|
428
|
-
| condition | | function callback that determines if the filter is applied on the last child node of the nested tree | |
|
|
383
|
+
| property | | | |
|
|
429
384
|
|
|
430
385
|
|
|
431
386
|
|
|
@@ -433,17 +388,17 @@ Filters a nested tree array by a custom condition on the last child node
|
|
|
433
388
|
##### Returns
|
|
434
389
|
|
|
435
390
|
|
|
436
|
-
-
|
|
391
|
+
-
|
|
437
392
|
|
|
438
393
|
|
|
439
394
|
|
|
440
395
|
|
|
441
|
-
### dist/
|
|
396
|
+
### dist/filters/adapters/adaptFilterData.js
|
|
442
397
|
|
|
443
398
|
|
|
444
|
-
####
|
|
399
|
+
#### adaptFilterData(filterData, getUIFilterData, datasetsInfo)
|
|
445
400
|
|
|
446
|
-
|
|
401
|
+
Checks and adapts the v2.0 Filter Data Structure to the v2.1
|
|
447
402
|
|
|
448
403
|
|
|
449
404
|
|
|
@@ -452,7 +407,9 @@ Flat deeply an array
|
|
|
452
407
|
|
|
453
408
|
| Name | Type | Description | |
|
|
454
409
|
| ---- | ---- | ----------- | -------- |
|
|
455
|
-
|
|
|
410
|
+
| filterData | | The filter data structure. Accepts both v2.1 or v2.0 | |
|
|
411
|
+
| getUIFilterData | | Flag to get a Filter Data (False) or the UI Filter Data (True) | |
|
|
412
|
+
| datasetsInfo | | Collection of datasets information. If getUIFilterData is true, the datasetsInfo should be mandatory | |
|
|
456
413
|
|
|
457
414
|
|
|
458
415
|
|
|
@@ -460,17 +417,18 @@ Flat deeply an array
|
|
|
460
417
|
##### Returns
|
|
461
418
|
|
|
462
419
|
|
|
463
|
-
-
|
|
420
|
+
- A new filter data structure v2.1
|
|
464
421
|
|
|
465
422
|
|
|
466
423
|
|
|
467
424
|
|
|
468
|
-
### dist/
|
|
425
|
+
### dist/filters/adapters/adaptFilterValues.js
|
|
469
426
|
|
|
470
427
|
|
|
471
|
-
####
|
|
428
|
+
#### adaptFilterValues(filter)
|
|
472
429
|
|
|
473
|
-
|
|
430
|
+
[TODO: For 2022, eliminate this adapter]
|
|
431
|
+
Gets an adapted filter value array. Validates the enabled property and sets
|
|
474
432
|
|
|
475
433
|
|
|
476
434
|
|
|
@@ -479,8 +437,7 @@ Gets the first index from the array by a callback condition
|
|
|
479
437
|
|
|
480
438
|
| Name | Type | Description | |
|
|
481
439
|
| ---- | ---- | ----------- | -------- |
|
|
482
|
-
|
|
|
483
|
-
| callback | | function callback | |
|
|
440
|
+
| filter | | The filter | |
|
|
484
441
|
|
|
485
442
|
|
|
486
443
|
|
|
@@ -488,17 +445,17 @@ Gets the first index from the array by a callback condition
|
|
|
488
445
|
##### Returns
|
|
489
446
|
|
|
490
447
|
|
|
491
|
-
-
|
|
448
|
+
- A new value array with the filled properties.
|
|
492
449
|
|
|
493
450
|
|
|
494
451
|
|
|
495
452
|
|
|
496
|
-
### dist/
|
|
453
|
+
### dist/filters/adapters/flatUIToFD.js
|
|
497
454
|
|
|
498
455
|
|
|
499
|
-
####
|
|
456
|
+
#### flatUIToFD(uFilters, version)
|
|
500
457
|
|
|
501
|
-
|
|
458
|
+
Generates a filter data structure from the flatttened UI filters.
|
|
502
459
|
|
|
503
460
|
|
|
504
461
|
|
|
@@ -507,8 +464,8 @@ Gets the last index from the array by a callback condition
|
|
|
507
464
|
|
|
508
465
|
| Name | Type | Description | |
|
|
509
466
|
| ---- | ---- | ----------- | -------- |
|
|
510
|
-
|
|
|
511
|
-
|
|
|
467
|
+
| uFilters | | Array of flattened filters from UI | |
|
|
468
|
+
| version | | Tag for the version of the filter data structure | |
|
|
512
469
|
|
|
513
470
|
|
|
514
471
|
|
|
@@ -516,17 +473,14 @@ Gets the last index from the array by a callback condition
|
|
|
516
473
|
##### Returns
|
|
517
474
|
|
|
518
475
|
|
|
519
|
-
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
476
|
+
- a Filter Data.
|
|
523
477
|
|
|
524
|
-
### dist/general/function/debounce.js
|
|
525
478
|
|
|
526
479
|
|
|
527
|
-
####
|
|
480
|
+
#### buildScopes(fbFilters)
|
|
528
481
|
|
|
529
|
-
|
|
482
|
+
Gets an array of scopes structure for the filter data. The scopes is organized by scope types and scope IDs
|
|
483
|
+
Also, adds and organizes filters by datasets
|
|
530
484
|
|
|
531
485
|
|
|
532
486
|
|
|
@@ -535,8 +489,7 @@ Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last
|
|
|
535
489
|
|
|
536
490
|
| Name | Type | Description | |
|
|
537
491
|
| ---- | ---- | ----------- | -------- |
|
|
538
|
-
|
|
|
539
|
-
| time | `Number` | default 500ms | |
|
|
492
|
+
| fbFilters | | Array of flat filters from UI | |
|
|
540
493
|
|
|
541
494
|
|
|
542
495
|
|
|
@@ -544,17 +497,13 @@ Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last
|
|
|
544
497
|
##### Returns
|
|
545
498
|
|
|
546
499
|
|
|
547
|
-
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
500
|
+
- an array of scopes structure.
|
|
551
501
|
|
|
552
|
-
### dist/general/function/throttled.js
|
|
553
502
|
|
|
554
503
|
|
|
555
|
-
####
|
|
504
|
+
#### buildScope(uFilter)
|
|
556
505
|
|
|
557
|
-
|
|
506
|
+
Gets an scope structure for the filter data
|
|
558
507
|
|
|
559
508
|
|
|
560
509
|
|
|
@@ -563,8 +512,7 @@ Make sure to only invokes _fn_ at most once per every _time_ milliseconds
|
|
|
563
512
|
|
|
564
513
|
| Name | Type | Description | |
|
|
565
514
|
| ---- | ---- | ----------- | -------- |
|
|
566
|
-
|
|
|
567
|
-
| time | `Number` | default 500ms | |
|
|
515
|
+
| uFilter | | UI structure filter | |
|
|
568
516
|
|
|
569
517
|
|
|
570
518
|
|
|
@@ -572,17 +520,13 @@ Make sure to only invokes _fn_ at most once per every _time_ milliseconds
|
|
|
572
520
|
##### Returns
|
|
573
521
|
|
|
574
522
|
|
|
575
|
-
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
523
|
+
- an scope structure
|
|
579
524
|
|
|
580
|
-
### dist/general/mix/getTag.js
|
|
581
525
|
|
|
582
526
|
|
|
583
|
-
####
|
|
527
|
+
#### buildDataset(uFilter)
|
|
584
528
|
|
|
585
|
-
Gets the
|
|
529
|
+
Gets an dataset structure for the filter data
|
|
586
530
|
|
|
587
531
|
|
|
588
532
|
|
|
@@ -591,7 +535,7 @@ Gets the `toStringTag` of `value`.
|
|
|
591
535
|
|
|
592
536
|
| Name | Type | Description | |
|
|
593
537
|
| ---- | ---- | ----------- | -------- |
|
|
594
|
-
|
|
|
538
|
+
| uFilter | | a UI structure filter | |
|
|
595
539
|
|
|
596
540
|
|
|
597
541
|
|
|
@@ -599,17 +543,13 @@ Gets the `toStringTag` of `value`.
|
|
|
599
543
|
##### Returns
|
|
600
544
|
|
|
601
545
|
|
|
602
|
-
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
546
|
+
- an dataset structure
|
|
606
547
|
|
|
607
|
-
### dist/general/mix/importScripts.js
|
|
608
548
|
|
|
609
549
|
|
|
610
|
-
####
|
|
550
|
+
#### buildFilter(uFilter)
|
|
611
551
|
|
|
612
|
-
|
|
552
|
+
Gets an filter structure for the filter data
|
|
613
553
|
|
|
614
554
|
|
|
615
555
|
|
|
@@ -618,54 +558,25 @@ Import a set of external Scripts given the URL in both serie and cascade way
|
|
|
618
558
|
|
|
619
559
|
| Name | Type | Description | |
|
|
620
560
|
| ---- | ---- | ----------- | -------- |
|
|
621
|
-
|
|
|
622
|
-
| scripts.url | `String` | CDN URL | |
|
|
623
|
-
| scripts.namespace | `String` `Function` | (Optional) if is a String, that name is evaluated on Window[namespace] object otherwise the Function is invoked expecting a Thrutly value | |
|
|
624
|
-
| scripts.type | `String` | (Optional) it could be `module` of `text/javascript`. Default `text/javascript` | |
|
|
625
|
-
| scripts.noModule | `Boolean` | (Optional) add `momodule` attribute to script tag. Default `false` | |
|
|
626
|
-
| scripts.dependencies | `Array.<Object>` | an array with the same structure to load in cascade mode | |
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
561
|
+
| uFilter | | a UI structure filter | |
|
|
630
562
|
|
|
631
|
-
##### Examples
|
|
632
563
|
|
|
633
|
-
```javascript
|
|
634
|
-
// 1) Simple script (paralell loading)
|
|
635
|
-
importScripts(['http://myscript.js', 'http://another.js']);
|
|
636
564
|
|
|
637
|
-
// 2) Loading `.js` and `.esm.js` script (parallel loading)
|
|
638
|
-
importScripts([
|
|
639
|
-
{ url: 'http://myscript.esm.js', type: 'module' },
|
|
640
|
-
{ url: 'http://myscript.js', noModule: true }
|
|
641
|
-
]);
|
|
642
565
|
|
|
643
|
-
|
|
644
|
-
importScripts([
|
|
645
|
-
{ url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] }
|
|
646
|
-
]);
|
|
566
|
+
##### Returns
|
|
647
567
|
|
|
648
|
-
// 4) mix
|
|
649
|
-
importScripts([
|
|
650
|
-
{ url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] },
|
|
651
|
-
{ url: 'http://another.esm.js', type: 'module' },
|
|
652
|
-
{ url: 'http://another.js', noModule: true },
|
|
653
|
-
'http://simplescript.js'
|
|
654
|
-
]);
|
|
655
|
-
```
|
|
656
568
|
|
|
569
|
+
- an filter structure
|
|
657
570
|
|
|
658
|
-
##### Returns
|
|
659
571
|
|
|
660
572
|
|
|
661
|
-
- `Promise` Promise when all script have been loaded
|
|
662
573
|
|
|
574
|
+
### dist/filters/adapters/flatUIToLogic.js
|
|
663
575
|
|
|
664
576
|
|
|
665
|
-
####
|
|
577
|
+
#### flatUIToLogic(uFilter)
|
|
666
578
|
|
|
667
|
-
|
|
668
|
-
return a Promise that is resolved when the script is loaded
|
|
579
|
+
Generates a Logic structure from flattened UI filters
|
|
669
580
|
|
|
670
581
|
|
|
671
582
|
|
|
@@ -674,9 +585,7 @@ return a Promise that is resolved when the script is loaded
|
|
|
674
585
|
|
|
675
586
|
| Name | Type | Description | |
|
|
676
587
|
| ---- | ---- | ----------- | -------- |
|
|
677
|
-
|
|
|
678
|
-
| type | `String` | (Optional) it could be `module` of `text/javascript`. Default `text/javascript` | |
|
|
679
|
-
| noModule | `boolean` | (Optional) add `momodule` attribute to script tag. Default `false` | |
|
|
588
|
+
| uFilter | | Array of flat filters from UI | |
|
|
680
589
|
|
|
681
590
|
|
|
682
591
|
|
|
@@ -684,17 +593,17 @@ return a Promise that is resolved when the script is loaded
|
|
|
684
593
|
##### Returns
|
|
685
594
|
|
|
686
595
|
|
|
687
|
-
-
|
|
596
|
+
- The logic structure
|
|
688
597
|
|
|
689
598
|
|
|
690
599
|
|
|
691
600
|
|
|
692
|
-
### dist/
|
|
601
|
+
### dist/filters/adapters/flatUIToOldLogic.js
|
|
693
602
|
|
|
694
603
|
|
|
695
|
-
####
|
|
604
|
+
#### flatUIToOldLogic(uFilters)
|
|
696
605
|
|
|
697
|
-
|
|
606
|
+
Generates a Logic structure from flattened UI filters
|
|
698
607
|
|
|
699
608
|
|
|
700
609
|
|
|
@@ -703,8 +612,7 @@ Validates if the given argument is empty
|
|
|
703
612
|
|
|
704
613
|
| Name | Type | Description | |
|
|
705
614
|
| ---- | ---- | ----------- | -------- |
|
|
706
|
-
|
|
|
707
|
-
| includeFalsy | | flag to determine include the falsy variables into the validation | |
|
|
615
|
+
| uFilters | | Array of flat filters from UI | |
|
|
708
616
|
|
|
709
617
|
|
|
710
618
|
|
|
@@ -712,18 +620,17 @@ Validates if the given argument is empty
|
|
|
712
620
|
##### Returns
|
|
713
621
|
|
|
714
622
|
|
|
715
|
-
-
|
|
623
|
+
- The logic structure
|
|
716
624
|
|
|
717
625
|
|
|
718
626
|
|
|
719
627
|
|
|
720
|
-
### dist/
|
|
628
|
+
### dist/filters/adapters/flatUIToUI.js
|
|
721
629
|
|
|
722
630
|
|
|
723
|
-
####
|
|
631
|
+
#### flatUIToUI(uFilters, version)
|
|
724
632
|
|
|
725
|
-
|
|
726
|
-
useful to avoid falsify validating Number Zero (0)
|
|
633
|
+
Generates a UI filter data structure from the flatttened UI filters.
|
|
727
634
|
|
|
728
635
|
|
|
729
636
|
|
|
@@ -732,7 +639,8 @@ useful to avoid falsify validating Number Zero (0)
|
|
|
732
639
|
|
|
733
640
|
| Name | Type | Description | |
|
|
734
641
|
| ---- | ---- | ----------- | -------- |
|
|
735
|
-
|
|
|
642
|
+
| uFilters | | Array of flattened filters from UI | |
|
|
643
|
+
| version | | Tag for the version of the filter data structure | |
|
|
736
644
|
|
|
737
645
|
|
|
738
646
|
|
|
@@ -740,19 +648,14 @@ useful to avoid falsify validating Number Zero (0)
|
|
|
740
648
|
##### Returns
|
|
741
649
|
|
|
742
650
|
|
|
743
|
-
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
651
|
+
- a UI Filter Data.
|
|
747
652
|
|
|
748
|
-
### dist/general/mix/randomId.js
|
|
749
653
|
|
|
750
654
|
|
|
751
|
-
####
|
|
655
|
+
#### buildScopes(fbFilters)
|
|
752
656
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
- If the optional second given argument is passed the random string is permutated.
|
|
657
|
+
Gets an array of scopes structure for the UI filter data. The scopes is organized by scope types and scope IDs
|
|
658
|
+
Also, adds and organizes filters by datasets
|
|
756
659
|
|
|
757
660
|
|
|
758
661
|
|
|
@@ -761,8 +664,7 @@ Creates a random string
|
|
|
761
664
|
|
|
762
665
|
| Name | Type | Description | |
|
|
763
666
|
| ---- | ---- | ----------- | -------- |
|
|
764
|
-
|
|
|
765
|
-
| exclude | `Array` | collection of strings that is going to be excluded of the random string. | |
|
|
667
|
+
| fbFilters | | Array of flat filters from UI | |
|
|
766
668
|
|
|
767
669
|
|
|
768
670
|
|
|
@@ -770,19 +672,13 @@ Creates a random string
|
|
|
770
672
|
##### Returns
|
|
771
673
|
|
|
772
674
|
|
|
773
|
-
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
675
|
+
- an array of scopes structure.
|
|
777
676
|
|
|
778
|
-
### dist/general/mix/size.js
|
|
779
677
|
|
|
780
678
|
|
|
781
|
-
####
|
|
679
|
+
#### buildScope(uFilter)
|
|
782
680
|
|
|
783
|
-
Gets
|
|
784
|
-
- Useful for Object, Array and string type.
|
|
785
|
-
- For `null` or `undefined` or else argument the returned value will be 0.
|
|
681
|
+
Gets an scope structure for the UI filter data
|
|
786
682
|
|
|
787
683
|
|
|
788
684
|
|
|
@@ -791,7 +687,7 @@ Gets the length of the given array.
|
|
|
791
687
|
|
|
792
688
|
| Name | Type | Description | |
|
|
793
689
|
| ---- | ---- | ----------- | -------- |
|
|
794
|
-
|
|
|
690
|
+
| uFilter | | UI structure filter | |
|
|
795
691
|
|
|
796
692
|
|
|
797
693
|
|
|
@@ -799,18 +695,13 @@ Gets the length of the given array.
|
|
|
799
695
|
##### Returns
|
|
800
696
|
|
|
801
697
|
|
|
802
|
-
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
698
|
+
- an scope structure
|
|
806
699
|
|
|
807
|
-
### dist/general/object/cloneDeep.js
|
|
808
700
|
|
|
809
701
|
|
|
810
|
-
####
|
|
702
|
+
#### buildDataset(uFilter)
|
|
811
703
|
|
|
812
|
-
|
|
813
|
-
Not to use this function with inner objects and functions
|
|
704
|
+
Gets an dataset structure for the UI filter data
|
|
814
705
|
|
|
815
706
|
|
|
816
707
|
|
|
@@ -819,7 +710,7 @@ Not to use this function with inner objects and functions
|
|
|
819
710
|
|
|
820
711
|
| Name | Type | Description | |
|
|
821
712
|
| ---- | ---- | ----------- | -------- |
|
|
822
|
-
|
|
|
713
|
+
| uFilter | | a UI structure filter | |
|
|
823
714
|
|
|
824
715
|
|
|
825
716
|
|
|
@@ -827,21 +718,13 @@ Not to use this function with inner objects and functions
|
|
|
827
718
|
##### Returns
|
|
828
719
|
|
|
829
720
|
|
|
830
|
-
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
### dist/general/object/get.js
|
|
721
|
+
- an dataset structure
|
|
836
722
|
|
|
837
723
|
|
|
838
|
-
#### _get(baseObject, path, defaultValue)
|
|
839
724
|
|
|
840
|
-
|
|
841
|
-
Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.
|
|
725
|
+
#### buildFilter(uFilter)
|
|
842
726
|
|
|
843
|
-
|
|
844
|
-
Undefined and null values will return the defaultValue.
|
|
727
|
+
Gets an filter structure for the UI filter data
|
|
845
728
|
|
|
846
729
|
|
|
847
730
|
|
|
@@ -850,51 +733,25 @@ Undefined and null values will return the defaultValue.
|
|
|
850
733
|
|
|
851
734
|
| Name | Type | Description | |
|
|
852
735
|
| ---- | ---- | ----------- | -------- |
|
|
853
|
-
|
|
|
854
|
-
| path | | The string path or collection of string paths of the property to get. | |
|
|
855
|
-
| defaultValue | | The value returned for undefined resolved values. | |
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
736
|
+
| uFilter | | a UI structure filter | |
|
|
859
737
|
|
|
860
|
-
##### Examples
|
|
861
738
|
|
|
862
|
-
```javascript
|
|
863
|
-
// returns 'Hello'
|
|
864
|
-
_get({ item1: 'Hello', item2: 'World' }, 'item1')
|
|
865
|
-
```
|
|
866
|
-
```javascript
|
|
867
|
-
// returns 'A simple Hello'
|
|
868
|
-
_get({ item1: 'Hello', item2: 'World' }, 'item3', 'A simple Hello')
|
|
869
|
-
```
|
|
870
|
-
```javascript
|
|
871
|
-
// returns 'Hello Again'
|
|
872
|
-
_get({ item1: { item11: 'Hello Again' }, item2: {} }, 'item1.item11')
|
|
873
|
-
```
|
|
874
|
-
```javascript
|
|
875
|
-
// returns 'Hello 2'
|
|
876
|
-
_get({ item1: ['Hello 1', 'Hello 2' }, item2: [] }, 'item1[1]')
|
|
877
|
-
```
|
|
878
|
-
```javascript
|
|
879
|
-
// returns 'Hello Again'
|
|
880
|
-
_get({ item1: { item11: 'Hello Again' }, item2: {} }, ['item1', 'item11'])
|
|
881
|
-
```
|
|
882
739
|
|
|
883
740
|
|
|
884
741
|
##### Returns
|
|
885
742
|
|
|
886
743
|
|
|
887
|
-
-
|
|
744
|
+
- an filter structure
|
|
888
745
|
|
|
889
746
|
|
|
890
747
|
|
|
891
748
|
|
|
892
|
-
### dist/
|
|
749
|
+
### dist/filters/adapters/logicToFD.js
|
|
893
750
|
|
|
894
751
|
|
|
895
|
-
####
|
|
752
|
+
#### logicToFD(filterData, version)
|
|
896
753
|
|
|
897
|
-
|
|
754
|
+
Generates a filter data structure from the old logic structure (v2.0).
|
|
898
755
|
|
|
899
756
|
|
|
900
757
|
|
|
@@ -903,38 +760,26 @@ Use the hasOwnProperty in order to verify if the given property exists in the ob
|
|
|
903
760
|
|
|
904
761
|
| Name | Type | Description | |
|
|
905
762
|
| ---- | ---- | ----------- | -------- |
|
|
906
|
-
|
|
|
907
|
-
|
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
##### Examples
|
|
763
|
+
| filterData | | The old filter data structure with logic (v2.0) | |
|
|
764
|
+
| version | | Tag for the version of the filter data structure | |
|
|
913
765
|
|
|
914
|
-
```javascript
|
|
915
|
-
const prop = 'prop2'
|
|
916
|
-
const obj1 = { prop1: 'hello', prop2: 'world'}
|
|
917
|
-
_hasProperty(ob1, prop1) // true
|
|
918
766
|
|
|
919
|
-
const obj2 = { prop1: 'hello world' }
|
|
920
|
-
_hasProperty(ob1, prop2) // false
|
|
921
|
-
```
|
|
922
767
|
|
|
923
768
|
|
|
924
769
|
##### Returns
|
|
925
770
|
|
|
926
771
|
|
|
927
|
-
-
|
|
772
|
+
- a Filter Data.
|
|
928
773
|
|
|
929
774
|
|
|
930
775
|
|
|
931
776
|
|
|
932
|
-
### dist/
|
|
777
|
+
### dist/filters/adapters/logicToFlatUI.js
|
|
933
778
|
|
|
934
779
|
|
|
935
|
-
####
|
|
780
|
+
#### logicToFlatUI(logics)
|
|
936
781
|
|
|
937
|
-
|
|
782
|
+
Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
|
|
938
783
|
|
|
939
784
|
|
|
940
785
|
|
|
@@ -943,7 +788,7 @@ Checks if the given argument is an object type
|
|
|
943
788
|
|
|
944
789
|
| Name | Type | Description | |
|
|
945
790
|
| ---- | ---- | ----------- | -------- |
|
|
946
|
-
|
|
|
791
|
+
| logics | | The old logic structure (v2.0) | |
|
|
947
792
|
|
|
948
793
|
|
|
949
794
|
|
|
@@ -951,18 +796,13 @@ Checks if the given argument is an object type
|
|
|
951
796
|
##### Returns
|
|
952
797
|
|
|
953
798
|
|
|
954
|
-
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
799
|
+
- The Flattened UI Filters array
|
|
958
800
|
|
|
959
|
-
### dist/general/object/mapValues.js
|
|
960
801
|
|
|
961
802
|
|
|
962
|
-
####
|
|
803
|
+
#### getFilter(filters, filter, getIndex)
|
|
963
804
|
|
|
964
|
-
|
|
965
|
-
and return a mapped object
|
|
805
|
+
Get the filter or the index of the given array, validating an old filter structure.
|
|
966
806
|
|
|
967
807
|
|
|
968
808
|
|
|
@@ -971,8 +811,9 @@ and return a mapped object
|
|
|
971
811
|
|
|
972
812
|
| Name | Type | Description | |
|
|
973
813
|
| ---- | ---- | ----------- | -------- |
|
|
974
|
-
|
|
|
975
|
-
|
|
|
814
|
+
| filters | | The array of UI filters | |
|
|
815
|
+
| filter | | The old logic structure filter | |
|
|
816
|
+
| getIndex | | Determines if the index or returns the UI filter object | |
|
|
976
817
|
|
|
977
818
|
|
|
978
819
|
|
|
@@ -980,17 +821,13 @@ and return a mapped object
|
|
|
980
821
|
##### Returns
|
|
981
822
|
|
|
982
823
|
|
|
983
|
-
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
824
|
+
- the index or the UI filter object
|
|
987
825
|
|
|
988
|
-
### dist/general/object/objectCopy.js
|
|
989
826
|
|
|
990
827
|
|
|
991
|
-
####
|
|
828
|
+
#### refineRankingValues(values, uiValues)
|
|
992
829
|
|
|
993
|
-
|
|
830
|
+
Refines the values of the Ranking column type.
|
|
994
831
|
|
|
995
832
|
|
|
996
833
|
|
|
@@ -999,8 +836,8 @@ Created a new reference of the given argument
|
|
|
999
836
|
|
|
1000
837
|
| Name | Type | Description | |
|
|
1001
838
|
| ---- | ---- | ----------- | -------- |
|
|
1002
|
-
|
|
|
1003
|
-
|
|
|
839
|
+
| values | | the Array of Ranking values | |
|
|
840
|
+
| uiValues | | Object with additional info about the values of the filter. | |
|
|
1004
841
|
|
|
1005
842
|
|
|
1006
843
|
|
|
@@ -1008,17 +845,17 @@ Created a new reference of the given argument
|
|
|
1008
845
|
##### Returns
|
|
1009
846
|
|
|
1010
847
|
|
|
1011
|
-
-
|
|
848
|
+
- the array of Ranking values
|
|
1012
849
|
|
|
1013
850
|
|
|
1014
851
|
|
|
1015
852
|
|
|
1016
|
-
### dist/
|
|
853
|
+
### dist/filters/adapters/logicToUI.js
|
|
1017
854
|
|
|
1018
855
|
|
|
1019
|
-
####
|
|
856
|
+
#### logicToUI(uFilters, datasetsInfo)
|
|
1020
857
|
|
|
1021
|
-
|
|
858
|
+
Generates a UI filter structure from the old logic structure (v2.0).
|
|
1022
859
|
|
|
1023
860
|
|
|
1024
861
|
|
|
@@ -1027,8 +864,8 @@ return a nwe Object excluding attributes in _props_ list
|
|
|
1027
864
|
|
|
1028
865
|
| Name | Type | Description | |
|
|
1029
866
|
| ---- | ---- | ----------- | -------- |
|
|
1030
|
-
|
|
|
1031
|
-
|
|
|
867
|
+
| uFilters | | Array of filters from old logic structure | |
|
|
868
|
+
| datasetsInfo | | Collection of datasets information | |
|
|
1032
869
|
|
|
1033
870
|
|
|
1034
871
|
|
|
@@ -1036,17 +873,17 @@ return a nwe Object excluding attributes in _props_ list
|
|
|
1036
873
|
##### Returns
|
|
1037
874
|
|
|
1038
875
|
|
|
1039
|
-
-
|
|
876
|
+
- a UI Filter Data.
|
|
1040
877
|
|
|
1041
878
|
|
|
1042
879
|
|
|
1043
880
|
|
|
1044
|
-
### dist/
|
|
881
|
+
### dist/filters/adapters/transformFilters.js
|
|
1045
882
|
|
|
1046
883
|
|
|
1047
|
-
####
|
|
884
|
+
#### transformFilters(oldFiltersObj, section)
|
|
1048
885
|
|
|
1049
|
-
|
|
886
|
+
Transform the old filters structure into the new one
|
|
1050
887
|
|
|
1051
888
|
|
|
1052
889
|
|
|
@@ -1055,43 +892,67 @@ return a new object just with attributes in _keys_ list
|
|
|
1055
892
|
|
|
1056
893
|
| Name | Type | Description | |
|
|
1057
894
|
| ---- | ---- | ----------- | -------- |
|
|
1058
|
-
|
|
|
1059
|
-
|
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
##### Returns
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
- `Object` new object just with desired attributes
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
### dist/general/string/capitalize.js
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
#### capitalize(text)
|
|
1076
|
-
|
|
1077
|
-
Upper case the first letter of a given text
|
|
895
|
+
| oldFiltersObj | `Object` | an object with the old filters structure | |
|
|
896
|
+
| section | `String` | could be 'ANALYZE', 'PB', 'UM' or any other value. Deafult is 'ANYWHERE' | |
|
|
1078
897
|
|
|
1079
898
|
|
|
1080
899
|
|
|
1081
900
|
|
|
1082
|
-
#####
|
|
901
|
+
##### Examples
|
|
1083
902
|
|
|
1084
|
-
|
|
1085
|
-
| ---- | ---- | ----------- | -------- |
|
|
1086
|
-
| text | `String` | | |
|
|
903
|
+
```javascript
|
|
1087
904
|
|
|
905
|
+
const oldPreferenceFilters = {
|
|
906
|
+
"WWXHAULtR-_-xYOQAdpqT__ENABLED": true,
|
|
907
|
+
"WWXHAULtR-_-xYOQAdpqT__ALL--ENABLED": true,
|
|
908
|
+
"WWXHAULtR-_-xYOQAdpqT__COLLAPSED": false,
|
|
909
|
+
"WWXHAULtR-_-xYOQAdpqT__LABEL": "GLOBAL",
|
|
910
|
+
"WWXHAULtR-_-xYOQAdpqT-_-AK4M8UV2": {
|
|
911
|
+
"formulaId": null,
|
|
912
|
+
"panelId": null,
|
|
913
|
+
"values": [
|
|
914
|
+
{
|
|
915
|
+
"EQUALS": [
|
|
916
|
+
{
|
|
917
|
+
"id": "AK4M8UV2a0",
|
|
918
|
+
"value": "A",
|
|
919
|
+
"enabled": true,
|
|
920
|
+
"imageUrl": null
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"id": "AK4M8UV2a1",
|
|
924
|
+
"value": "B",
|
|
925
|
+
"enabled": true,
|
|
926
|
+
"imageUrl": null
|
|
927
|
+
}
|
|
928
|
+
]
|
|
929
|
+
}
|
|
930
|
+
],
|
|
931
|
+
"bucketId": null,
|
|
932
|
+
"text": "MC",
|
|
933
|
+
"title": "MC",
|
|
934
|
+
"type": "SINGLE_CHOICE",
|
|
935
|
+
"qid": "AK4M8UV2",
|
|
936
|
+
"dataset": {
|
|
937
|
+
"sourceid": "xYOQAdpqT",
|
|
938
|
+
"name": "Form All Questions",
|
|
939
|
+
"qrveyid": "xYOQAdpqT",
|
|
940
|
+
"text": "Form All Questions",
|
|
941
|
+
"linkid": 0
|
|
942
|
+
},
|
|
943
|
+
"enabled": true,
|
|
944
|
+
"linked": null
|
|
945
|
+
}
|
|
946
|
+
};
|
|
1088
947
|
|
|
948
|
+
const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
|
|
949
|
+
```
|
|
1089
950
|
|
|
1090
951
|
|
|
1091
952
|
##### Returns
|
|
1092
953
|
|
|
1093
954
|
|
|
1094
|
-
- `
|
|
955
|
+
- `Object` an object with the new filters structure
|
|
1095
956
|
|
|
1096
957
|
|
|
1097
958
|
|
|
@@ -1207,12 +1068,12 @@ Gets the Scopes IDS for the Available Scope function by any config
|
|
|
1207
1068
|
|
|
1208
1069
|
|
|
1209
1070
|
|
|
1210
|
-
### dist/
|
|
1071
|
+
### dist/date/range/getDateRange.js
|
|
1211
1072
|
|
|
1212
1073
|
|
|
1213
|
-
####
|
|
1074
|
+
#### getDateRange(value, dateGroupLabel, withTime)
|
|
1214
1075
|
|
|
1215
|
-
|
|
1076
|
+
Get date range object from a string date value
|
|
1216
1077
|
|
|
1217
1078
|
|
|
1218
1079
|
|
|
@@ -1221,58 +1082,74 @@ Generates a Filter Logic structure from Filter Data structure.
|
|
|
1221
1082
|
|
|
1222
1083
|
| Name | Type | Description | |
|
|
1223
1084
|
| ---- | ---- | ----------- | -------- |
|
|
1224
|
-
|
|
|
1225
|
-
|
|
1085
|
+
| value | `String` | string date value | |
|
|
1086
|
+
| dateGroupLabel | `String` | could be 'YEAR', 'QUARTER', 'MONTH' or 'DAY'. Deafult is 'DAY' | |
|
|
1087
|
+
| withTime | `Boolean` | determines if the date range will include time. Default is true | |
|
|
1226
1088
|
|
|
1227
1089
|
|
|
1228
1090
|
|
|
1229
|
-
##### Returns
|
|
1230
1091
|
|
|
1092
|
+
##### Examples
|
|
1231
1093
|
|
|
1232
|
-
|
|
1094
|
+
```javascript
|
|
1095
|
+
// 1) Year:
|
|
1096
|
+
getDateRange('2020', 'YEAR');
|
|
1097
|
+
// Will return:
|
|
1098
|
+
{
|
|
1099
|
+
from: '01/01/2020 00:00:00',
|
|
1100
|
+
to: '12/31/2020 23:59:59'
|
|
1101
|
+
}
|
|
1233
1102
|
|
|
1103
|
+
// 2) Quarter:
|
|
1104
|
+
getDateRange('Q3 2020', 'QUARTER');
|
|
1105
|
+
// Will return:
|
|
1106
|
+
{
|
|
1107
|
+
from: '07/01/2020 00:00:00',
|
|
1108
|
+
to: '09/30/2020 23:59:59'
|
|
1109
|
+
}
|
|
1234
1110
|
|
|
1111
|
+
// 3) Month:
|
|
1112
|
+
getDateRange('Oct 2020', 'MONTH');
|
|
1113
|
+
// Will return:
|
|
1114
|
+
{
|
|
1115
|
+
from: '10/01/2020 00:00:00',
|
|
1116
|
+
to: '10/31/2020 23:59:59'
|
|
1117
|
+
}
|
|
1118
|
+
```
|
|
1235
1119
|
|
|
1236
|
-
#### getLogicBodyFromFD21(filterData)
|
|
1237
1120
|
|
|
1238
|
-
|
|
1121
|
+
##### Returns
|
|
1239
1122
|
|
|
1240
1123
|
|
|
1124
|
+
- `Object` an object with the date range with two string date properties: from and to
|
|
1241
1125
|
|
|
1242
1126
|
|
|
1243
|
-
##### Parameters
|
|
1244
1127
|
|
|
1245
|
-
| Name | Type | Description | |
|
|
1246
|
-
| ---- | ---- | ----------- | -------- |
|
|
1247
|
-
| filterData | | The filter data object | |
|
|
1248
1128
|
|
|
1129
|
+
### dist/date/relative/Adapter.js
|
|
1249
1130
|
|
|
1250
1131
|
|
|
1132
|
+
#### value()
|
|
1251
1133
|
|
|
1252
|
-
|
|
1134
|
+
Resolves statement and returns statement value
|
|
1253
1135
|
|
|
1254
1136
|
|
|
1255
|
-
- a filter logic array
|
|
1256
1137
|
|
|
1257
1138
|
|
|
1258
1139
|
|
|
1259
1140
|
|
|
1260
|
-
|
|
1141
|
+
##### Returns
|
|
1261
1142
|
|
|
1262
1143
|
|
|
1263
|
-
|
|
1144
|
+
- `AbsoluteRange` `string`
|
|
1264
1145
|
|
|
1265
|
-
Generates a UI filter structure from Filter Data structure.
|
|
1266
1146
|
|
|
1267
1147
|
|
|
1148
|
+
#### valueAsAnchor()
|
|
1268
1149
|
|
|
1150
|
+
Resolves statement as an anchor
|
|
1269
1151
|
|
|
1270
|
-
##### Parameters
|
|
1271
1152
|
|
|
1272
|
-
| Name | Type | Description | |
|
|
1273
|
-
| ---- | ---- | ----------- | -------- |
|
|
1274
|
-
| filterData | | The filter data object. | |
|
|
1275
|
-
| datasetsInfo | | Collection of datasets information | |
|
|
1276
1153
|
|
|
1277
1154
|
|
|
1278
1155
|
|
|
@@ -1280,25 +1157,15 @@ Generates a UI filter structure from Filter Data structure.
|
|
|
1280
1157
|
##### Returns
|
|
1281
1158
|
|
|
1282
1159
|
|
|
1283
|
-
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
#### FD21ToUI(scopes, section, version, datasetsInfo)
|
|
1160
|
+
- `string`
|
|
1288
1161
|
|
|
1289
|
-
Generates a UI filter Structure from the Filter Data structure v2.1
|
|
1290
1162
|
|
|
1291
1163
|
|
|
1164
|
+
#### _statementToRange() *private method*
|
|
1292
1165
|
|
|
1166
|
+
Convert verbal statement to range value
|
|
1293
1167
|
|
|
1294
|
-
##### Parameters
|
|
1295
1168
|
|
|
1296
|
-
| Name | Type | Description | |
|
|
1297
|
-
| ---- | ---- | ----------- | -------- |
|
|
1298
|
-
| scopes | | The filter scope section | |
|
|
1299
|
-
| section | | The filter section. | |
|
|
1300
|
-
| version | | The version of the filter structure | |
|
|
1301
|
-
| datasetsInfo | | Collection of datasets information | |
|
|
1302
1169
|
|
|
1303
1170
|
|
|
1304
1171
|
|
|
@@ -1306,69 +1173,61 @@ Generates a UI filter Structure from the Filter Data structure v2.1
|
|
|
1306
1173
|
##### Returns
|
|
1307
1174
|
|
|
1308
1175
|
|
|
1309
|
-
-
|
|
1176
|
+
- `AbsoluteRange`
|
|
1310
1177
|
|
|
1311
1178
|
|
|
1312
1179
|
|
|
1180
|
+
#### _resolveAsThis() *private method*
|
|
1313
1181
|
|
|
1314
|
-
|
|
1182
|
+
Apply 'this' cursor logic to statement
|
|
1315
1183
|
|
|
1316
1184
|
|
|
1317
|
-
#### FDToFlatUI(filterData, datasetsInfo)
|
|
1318
1185
|
|
|
1319
|
-
Generates a Flattened UI filter structure from Filter Data structure.
|
|
1320
1186
|
|
|
1321
1187
|
|
|
1322
1188
|
|
|
1189
|
+
##### Returns
|
|
1323
1190
|
|
|
1324
|
-
##### Parameters
|
|
1325
1191
|
|
|
1326
|
-
|
|
1327
|
-
| ---- | ---- | ----------- | -------- |
|
|
1328
|
-
| filterData | | The filter data object. | |
|
|
1329
|
-
| datasetsInfo | | Collection of datasets information | |
|
|
1192
|
+
- `AbsoluteStatement`
|
|
1330
1193
|
|
|
1331
1194
|
|
|
1332
1195
|
|
|
1196
|
+
#### _resolveAsTheLast() *private method*
|
|
1333
1197
|
|
|
1334
|
-
|
|
1198
|
+
Apply 'the last' cursor logic to statement
|
|
1335
1199
|
|
|
1336
1200
|
|
|
1337
|
-
- a flattened UI filters array
|
|
1338
1201
|
|
|
1339
1202
|
|
|
1340
1203
|
|
|
1341
|
-
#### FD21ToFlatUI(scopes, datasetsInfo)
|
|
1342
1204
|
|
|
1343
|
-
|
|
1205
|
+
##### Returns
|
|
1344
1206
|
|
|
1345
1207
|
|
|
1208
|
+
- `AbsoluteStatement`
|
|
1346
1209
|
|
|
1347
1210
|
|
|
1348
|
-
##### Parameters
|
|
1349
1211
|
|
|
1350
|
-
|
|
1351
|
-
| ---- | ---- | ----------- | -------- |
|
|
1352
|
-
| scopes | | The filter scope section | |
|
|
1353
|
-
| datasetsInfo | | Collection of datasets information | |
|
|
1212
|
+
#### _resolveAsTheNext() *private method*
|
|
1354
1213
|
|
|
1214
|
+
Apply 'the next' cursor logic to statement
|
|
1355
1215
|
|
|
1356
1216
|
|
|
1357
1217
|
|
|
1358
|
-
##### Returns
|
|
1359
1218
|
|
|
1360
1219
|
|
|
1361
|
-
- a flattened UI filters array
|
|
1362
1220
|
|
|
1221
|
+
##### Returns
|
|
1363
1222
|
|
|
1364
1223
|
|
|
1224
|
+
- `AbsoluteStatement`
|
|
1365
1225
|
|
|
1366
|
-
### dist/filters/adapters/UIToFD.js
|
|
1367
1226
|
|
|
1368
1227
|
|
|
1369
|
-
####
|
|
1228
|
+
#### replaceNowToken(value, now)
|
|
1370
1229
|
|
|
1371
|
-
|
|
1230
|
+
Replace '@now' token inside a string
|
|
1372
1231
|
|
|
1373
1232
|
|
|
1374
1233
|
|
|
@@ -1377,7 +1236,8 @@ Generates a Filter Data Structure structure from UI Filter Data structure.
|
|
|
1377
1236
|
|
|
1378
1237
|
| Name | Type | Description | |
|
|
1379
1238
|
| ---- | ---- | ----------- | -------- |
|
|
1380
|
-
|
|
|
1239
|
+
| value | `string` | | |
|
|
1240
|
+
| now | `Date` | | |
|
|
1381
1241
|
|
|
1382
1242
|
|
|
1383
1243
|
|
|
@@ -1385,13 +1245,13 @@ Generates a Filter Data Structure structure from UI Filter Data structure.
|
|
|
1385
1245
|
##### Returns
|
|
1386
1246
|
|
|
1387
1247
|
|
|
1388
|
-
-
|
|
1248
|
+
- `string`
|
|
1389
1249
|
|
|
1390
1250
|
|
|
1391
1251
|
|
|
1392
|
-
####
|
|
1252
|
+
#### convertRelativeToAbsolute(args)
|
|
1393
1253
|
|
|
1394
|
-
|
|
1254
|
+
Returns a range object (date) from a group of statement params
|
|
1395
1255
|
|
|
1396
1256
|
|
|
1397
1257
|
|
|
@@ -1400,26 +1260,45 @@ Builds the Fitler Data structure from UI filter data
|
|
|
1400
1260
|
|
|
1401
1261
|
| Name | Type | Description | |
|
|
1402
1262
|
| ---- | ---- | ----------- | -------- |
|
|
1403
|
-
|
|
|
1404
|
-
|
|
1263
|
+
| args | `RelativeToAbsoluteStruct` | | |
|
|
1264
|
+
|
|
1405
1265
|
|
|
1406
1266
|
|
|
1407
1267
|
|
|
1268
|
+
##### Examples
|
|
1269
|
+
|
|
1270
|
+
```javascript
|
|
1271
|
+
pivot = '2021-03-03T12:30:40'
|
|
1272
|
+
unit = month
|
|
1273
|
+
steps = 2
|
|
1274
|
+
setTo = END
|
|
1275
|
+
resolverAsCalendar: true
|
|
1276
|
+
=> Returns '2021-05-31T23:59:59'
|
|
1277
|
+
```
|
|
1278
|
+
```javascript
|
|
1279
|
+
pivot = '2021-03-03T12:30:40'
|
|
1280
|
+
unit = month
|
|
1281
|
+
steps = -2
|
|
1282
|
+
setTo = START
|
|
1283
|
+
resolverAsCalendar: false
|
|
1284
|
+
=> Returns '2021-01-03T00:00:00'
|
|
1285
|
+
```
|
|
1286
|
+
|
|
1408
1287
|
|
|
1409
1288
|
##### Returns
|
|
1410
1289
|
|
|
1411
1290
|
|
|
1412
|
-
-
|
|
1291
|
+
- `string`
|
|
1413
1292
|
|
|
1414
1293
|
|
|
1415
1294
|
|
|
1416
1295
|
|
|
1417
|
-
### dist/
|
|
1296
|
+
### dist/date/relative/relative.js
|
|
1418
1297
|
|
|
1419
1298
|
|
|
1420
|
-
####
|
|
1299
|
+
#### resolveRelative(statements, clock)
|
|
1421
1300
|
|
|
1422
|
-
|
|
1301
|
+
Resolve a list of relative statements according to operator
|
|
1423
1302
|
|
|
1424
1303
|
|
|
1425
1304
|
|
|
@@ -1428,50 +1307,44 @@ Generates a Flattened UI filter structure from UI Filter Data structure.
|
|
|
1428
1307
|
|
|
1429
1308
|
| Name | Type | Description | |
|
|
1430
1309
|
| ---- | ---- | ----------- | -------- |
|
|
1431
|
-
|
|
|
1432
|
-
|
|
|
1433
|
-
|
|
1434
|
-
|
|
1310
|
+
| statements | `Array.<RelativeStatement>` `Array.<string>` | - Raw statements/values | |
|
|
1311
|
+
| clock | `Date` | - Clock/time reference for relative date resolution | |
|
|
1435
1312
|
|
|
1436
1313
|
|
|
1437
|
-
##### Returns
|
|
1438
1314
|
|
|
1439
1315
|
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
#### UI21ToFlatUI(scopes)
|
|
1445
|
-
|
|
1446
|
-
Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
##### Parameters
|
|
1452
|
-
|
|
1453
|
-
| Name | Type | Description | |
|
|
1454
|
-
| ---- | ---- | ----------- | -------- |
|
|
1455
|
-
| scopes | | The filter scope section | |
|
|
1316
|
+
##### Examples
|
|
1456
1317
|
|
|
1318
|
+
```javascript
|
|
1319
|
+
Input:
|
|
1320
|
+
{
|
|
1321
|
+
"cursor": "the_next",
|
|
1322
|
+
"unit": "year",
|
|
1323
|
+
"number": 1,
|
|
1324
|
+
"includeCurrent": false,
|
|
1325
|
+
"isCalendarDate": false,
|
|
1326
|
+
"anchor": "03/05/2021"
|
|
1327
|
+
}
|
|
1457
1328
|
|
|
1329
|
+
Output:
|
|
1330
|
+
{ gte: "03/06/2021 00:00:00", lte: "03/05/2022 23:59:59" }
|
|
1331
|
+
```
|
|
1458
1332
|
|
|
1459
1333
|
|
|
1460
1334
|
##### Returns
|
|
1461
1335
|
|
|
1462
1336
|
|
|
1463
|
-
-
|
|
1337
|
+
- `Array.<AbsoluteRange>` `Array.<string>`
|
|
1464
1338
|
|
|
1465
1339
|
|
|
1466
1340
|
|
|
1467
1341
|
|
|
1468
|
-
### dist/
|
|
1342
|
+
### dist/general/array/delete.js
|
|
1469
1343
|
|
|
1470
1344
|
|
|
1471
|
-
####
|
|
1345
|
+
#### ArrayDelete(array, index)
|
|
1472
1346
|
|
|
1473
|
-
|
|
1474
|
-
Get the new property base on the old date grouping properties
|
|
1347
|
+
Inmutable Array Item deletion
|
|
1475
1348
|
|
|
1476
1349
|
|
|
1477
1350
|
|
|
@@ -1480,7 +1353,8 @@ Get the new property base on the old date grouping properties
|
|
|
1480
1353
|
|
|
1481
1354
|
| Name | Type | Description | |
|
|
1482
1355
|
| ---- | ---- | ----------- | -------- |
|
|
1483
|
-
|
|
|
1356
|
+
| array | `Array` | a collection of items to delete | |
|
|
1357
|
+
| index | `Number` | the position of the item to delete | |
|
|
1484
1358
|
|
|
1485
1359
|
|
|
1486
1360
|
|
|
@@ -1488,17 +1362,20 @@ Get the new property base on the old date grouping properties
|
|
|
1488
1362
|
##### Returns
|
|
1489
1363
|
|
|
1490
1364
|
|
|
1491
|
-
-
|
|
1365
|
+
- a new Array or the given parameter when is empty or not an array
|
|
1492
1366
|
|
|
1493
1367
|
|
|
1494
1368
|
|
|
1495
1369
|
|
|
1496
|
-
### dist/
|
|
1370
|
+
### dist/general/array/filterNestedTree.js
|
|
1497
1371
|
|
|
1498
1372
|
|
|
1499
|
-
####
|
|
1373
|
+
#### filterNestedTree(arr, childArrKey, condition)
|
|
1500
1374
|
|
|
1501
|
-
|
|
1375
|
+
Filters a nested tree array by a custom condition on the last child node
|
|
1376
|
+
- If the given arguments are not valid, the function returns the first argument.
|
|
1377
|
+
- If the childArrKey is not matched in the object, the condition tries to resolve the filter anyway and returns an empty array.
|
|
1378
|
+
- If the condition is not fulfilled, the function returns a filtered array, probably a empty array inside of the child array
|
|
1502
1379
|
|
|
1503
1380
|
|
|
1504
1381
|
|
|
@@ -1507,9 +1384,9 @@ Checks and adapts the v2.0 Filter Data Structure to the v2.1
|
|
|
1507
1384
|
|
|
1508
1385
|
| Name | Type | Description | |
|
|
1509
1386
|
| ---- | ---- | ----------- | -------- |
|
|
1510
|
-
|
|
|
1511
|
-
|
|
|
1512
|
-
|
|
|
1387
|
+
| arr | | nested tree array | |
|
|
1388
|
+
| childArrKey | | property representing the children array on the nested tree | |
|
|
1389
|
+
| condition | | function callback that determines if the filter is applied on the last child node of the nested tree | |
|
|
1513
1390
|
|
|
1514
1391
|
|
|
1515
1392
|
|
|
@@ -1517,18 +1394,17 @@ Checks and adapts the v2.0 Filter Data Structure to the v2.1
|
|
|
1517
1394
|
##### Returns
|
|
1518
1395
|
|
|
1519
1396
|
|
|
1520
|
-
-
|
|
1397
|
+
- array filtered
|
|
1521
1398
|
|
|
1522
1399
|
|
|
1523
1400
|
|
|
1524
1401
|
|
|
1525
|
-
### dist/
|
|
1402
|
+
### dist/general/array/flattenDeep.js
|
|
1526
1403
|
|
|
1527
1404
|
|
|
1528
|
-
####
|
|
1405
|
+
#### flattenDeep(arr)
|
|
1529
1406
|
|
|
1530
|
-
|
|
1531
|
-
Gets an adapted filter value array. Validates the enabled property and sets
|
|
1407
|
+
Flat deeply an array
|
|
1532
1408
|
|
|
1533
1409
|
|
|
1534
1410
|
|
|
@@ -1537,7 +1413,7 @@ Gets an adapted filter value array. Validates the enabled property and sets
|
|
|
1537
1413
|
|
|
1538
1414
|
| Name | Type | Description | |
|
|
1539
1415
|
| ---- | ---- | ----------- | -------- |
|
|
1540
|
-
|
|
|
1416
|
+
| arr | | Array to flat deeply | |
|
|
1541
1417
|
|
|
1542
1418
|
|
|
1543
1419
|
|
|
@@ -1545,17 +1421,17 @@ Gets an adapted filter value array. Validates the enabled property and sets
|
|
|
1545
1421
|
##### Returns
|
|
1546
1422
|
|
|
1547
1423
|
|
|
1548
|
-
-
|
|
1424
|
+
- flatten array
|
|
1549
1425
|
|
|
1550
1426
|
|
|
1551
1427
|
|
|
1552
1428
|
|
|
1553
|
-
### dist/
|
|
1429
|
+
### dist/general/array/getFirstIndexFromArray.js
|
|
1554
1430
|
|
|
1555
1431
|
|
|
1556
|
-
####
|
|
1432
|
+
#### getFirstIndexFromArray(array, callback)
|
|
1557
1433
|
|
|
1558
|
-
|
|
1434
|
+
Gets the first index from the array by a callback condition
|
|
1559
1435
|
|
|
1560
1436
|
|
|
1561
1437
|
|
|
@@ -1564,8 +1440,8 @@ Generates a filter data structure from the flatttened UI filters.
|
|
|
1564
1440
|
|
|
1565
1441
|
| Name | Type | Description | |
|
|
1566
1442
|
| ---- | ---- | ----------- | -------- |
|
|
1567
|
-
|
|
|
1568
|
-
|
|
|
1443
|
+
| array | | | |
|
|
1444
|
+
| callback | | function callback | |
|
|
1569
1445
|
|
|
1570
1446
|
|
|
1571
1447
|
|
|
@@ -1573,37 +1449,17 @@ Generates a filter data structure from the flatttened UI filters.
|
|
|
1573
1449
|
##### Returns
|
|
1574
1450
|
|
|
1575
1451
|
|
|
1576
|
-
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
#### buildScopes(fbFilters)
|
|
1581
|
-
|
|
1582
|
-
Gets an array of scopes structure for the filter data. The scopes is organized by scope types and scope IDs
|
|
1583
|
-
Also, adds and organizes filters by datasets
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
##### Parameters
|
|
1589
|
-
|
|
1590
|
-
| Name | Type | Description | |
|
|
1591
|
-
| ---- | ---- | ----------- | -------- |
|
|
1592
|
-
| fbFilters | | Array of flat filters from UI | |
|
|
1593
|
-
|
|
1594
|
-
|
|
1452
|
+
- the first index of the array. -1 when the condition is not satisfied
|
|
1595
1453
|
|
|
1596
1454
|
|
|
1597
|
-
##### Returns
|
|
1598
1455
|
|
|
1599
1456
|
|
|
1600
|
-
|
|
1601
|
-
|
|
1457
|
+
### dist/general/array/getLastIndexFromArray.js
|
|
1602
1458
|
|
|
1603
1459
|
|
|
1604
|
-
####
|
|
1460
|
+
#### getLastIndexFromArray(array, callback)
|
|
1605
1461
|
|
|
1606
|
-
Gets
|
|
1462
|
+
Gets the last index from the array by a callback condition
|
|
1607
1463
|
|
|
1608
1464
|
|
|
1609
1465
|
|
|
@@ -1612,7 +1468,8 @@ Gets an scope structure for the filter data
|
|
|
1612
1468
|
|
|
1613
1469
|
| Name | Type | Description | |
|
|
1614
1470
|
| ---- | ---- | ----------- | -------- |
|
|
1615
|
-
|
|
|
1471
|
+
| array | | | |
|
|
1472
|
+
| callback | | function callback | |
|
|
1616
1473
|
|
|
1617
1474
|
|
|
1618
1475
|
|
|
@@ -1620,13 +1477,17 @@ Gets an scope structure for the filter data
|
|
|
1620
1477
|
##### Returns
|
|
1621
1478
|
|
|
1622
1479
|
|
|
1623
|
-
-
|
|
1480
|
+
- the last index of the array. -1 when the condition is not satisfied
|
|
1624
1481
|
|
|
1625
1482
|
|
|
1626
1483
|
|
|
1627
|
-
#### buildDataset(uFilter)
|
|
1628
1484
|
|
|
1629
|
-
|
|
1485
|
+
### dist/general/function/debounce.js
|
|
1486
|
+
|
|
1487
|
+
|
|
1488
|
+
#### debounce(fn, time)
|
|
1489
|
+
|
|
1490
|
+
Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last time the debounced function was invoked.
|
|
1630
1491
|
|
|
1631
1492
|
|
|
1632
1493
|
|
|
@@ -1635,7 +1496,8 @@ Gets an dataset structure for the filter data
|
|
|
1635
1496
|
|
|
1636
1497
|
| Name | Type | Description | |
|
|
1637
1498
|
| ---- | ---- | ----------- | -------- |
|
|
1638
|
-
|
|
|
1499
|
+
| fn | `Function` | original Function | |
|
|
1500
|
+
| time | `Number` | default 500ms | |
|
|
1639
1501
|
|
|
1640
1502
|
|
|
1641
1503
|
|
|
@@ -1643,13 +1505,17 @@ Gets an dataset structure for the filter data
|
|
|
1643
1505
|
##### Returns
|
|
1644
1506
|
|
|
1645
1507
|
|
|
1646
|
-
-
|
|
1508
|
+
- `Function` debounced functions
|
|
1647
1509
|
|
|
1648
1510
|
|
|
1649
1511
|
|
|
1650
|
-
#### buildFilter(uFilter)
|
|
1651
1512
|
|
|
1652
|
-
|
|
1513
|
+
### dist/general/function/throttled.js
|
|
1514
|
+
|
|
1515
|
+
|
|
1516
|
+
#### throttled(fn, time)
|
|
1517
|
+
|
|
1518
|
+
Make sure to only invokes _fn_ at most once per every _time_ milliseconds
|
|
1653
1519
|
|
|
1654
1520
|
|
|
1655
1521
|
|
|
@@ -1658,7 +1524,8 @@ Gets an filter structure for the filter data
|
|
|
1658
1524
|
|
|
1659
1525
|
| Name | Type | Description | |
|
|
1660
1526
|
| ---- | ---- | ----------- | -------- |
|
|
1661
|
-
|
|
|
1527
|
+
| fn | `Function` | original Function | |
|
|
1528
|
+
| time | `Number` | default 500ms | |
|
|
1662
1529
|
|
|
1663
1530
|
|
|
1664
1531
|
|
|
@@ -1666,17 +1533,17 @@ Gets an filter structure for the filter data
|
|
|
1666
1533
|
##### Returns
|
|
1667
1534
|
|
|
1668
1535
|
|
|
1669
|
-
-
|
|
1536
|
+
- `Function` throttled function
|
|
1670
1537
|
|
|
1671
1538
|
|
|
1672
1539
|
|
|
1673
1540
|
|
|
1674
|
-
### dist/
|
|
1541
|
+
### dist/general/mix/getTag.js
|
|
1675
1542
|
|
|
1676
1543
|
|
|
1677
|
-
####
|
|
1544
|
+
#### getTag(value)
|
|
1678
1545
|
|
|
1679
|
-
|
|
1546
|
+
Gets the `toStringTag` of `value`.
|
|
1680
1547
|
|
|
1681
1548
|
|
|
1682
1549
|
|
|
@@ -1685,7 +1552,7 @@ Generates a Logic structure from flattened UI filters
|
|
|
1685
1552
|
|
|
1686
1553
|
| Name | Type | Description | |
|
|
1687
1554
|
| ---- | ---- | ----------- | -------- |
|
|
1688
|
-
|
|
|
1555
|
+
| value | | The value to query. | |
|
|
1689
1556
|
|
|
1690
1557
|
|
|
1691
1558
|
|
|
@@ -1693,17 +1560,17 @@ Generates a Logic structure from flattened UI filters
|
|
|
1693
1560
|
##### Returns
|
|
1694
1561
|
|
|
1695
1562
|
|
|
1696
|
-
-
|
|
1563
|
+
- `string` Returns the `toStringTag`.
|
|
1697
1564
|
|
|
1698
1565
|
|
|
1699
1566
|
|
|
1700
1567
|
|
|
1701
|
-
### dist/
|
|
1568
|
+
### dist/general/mix/importScripts.js
|
|
1702
1569
|
|
|
1703
1570
|
|
|
1704
|
-
####
|
|
1571
|
+
#### importScripts(scripts)
|
|
1705
1572
|
|
|
1706
|
-
|
|
1573
|
+
Import a set of external Scripts given the URL in both serie and cascade way
|
|
1707
1574
|
|
|
1708
1575
|
|
|
1709
1576
|
|
|
@@ -1712,25 +1579,54 @@ Generates a Logic structure from flattened UI filters
|
|
|
1712
1579
|
|
|
1713
1580
|
| Name | Type | Description | |
|
|
1714
1581
|
| ---- | ---- | ----------- | -------- |
|
|
1715
|
-
|
|
|
1582
|
+
| scripts | `Array.<String>` `Array.<Object>` | can be an array of string or an array of object with the follow structure: | |
|
|
1583
|
+
| scripts.url | `String` | CDN URL | |
|
|
1584
|
+
| scripts.namespace | `String` `Function` | (Optional) if is a String, that name is evaluated on Window[namespace] object otherwise the Function is invoked expecting a Thrutly value | |
|
|
1585
|
+
| scripts.type | `String` | (Optional) it could be `module` of `text/javascript`. Default `text/javascript` | |
|
|
1586
|
+
| scripts.noModule | `Boolean` | (Optional) add `momodule` attribute to script tag. Default `false` | |
|
|
1587
|
+
| scripts.dependencies | `Array.<Object>` | an array with the same structure to load in cascade mode | |
|
|
1716
1588
|
|
|
1717
1589
|
|
|
1718
1590
|
|
|
1719
1591
|
|
|
1720
|
-
#####
|
|
1592
|
+
##### Examples
|
|
1721
1593
|
|
|
1594
|
+
```javascript
|
|
1595
|
+
// 1) Simple script (paralell loading)
|
|
1596
|
+
importScripts(['http://myscript.js', 'http://another.js']);
|
|
1722
1597
|
|
|
1723
|
-
|
|
1598
|
+
// 2) Loading `.js` and `.esm.js` script (parallel loading)
|
|
1599
|
+
importScripts([
|
|
1600
|
+
{ url: 'http://myscript.esm.js', type: 'module' },
|
|
1601
|
+
{ url: 'http://myscript.js', noModule: true }
|
|
1602
|
+
]);
|
|
1603
|
+
|
|
1604
|
+
// 3) import dependent scripts (cascade)
|
|
1605
|
+
importScripts([
|
|
1606
|
+
{ url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] }
|
|
1607
|
+
]);
|
|
1608
|
+
|
|
1609
|
+
// 4) mix
|
|
1610
|
+
importScripts([
|
|
1611
|
+
{ url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] },
|
|
1612
|
+
{ url: 'http://another.esm.js', type: 'module' },
|
|
1613
|
+
{ url: 'http://another.js', noModule: true },
|
|
1614
|
+
'http://simplescript.js'
|
|
1615
|
+
]);
|
|
1616
|
+
```
|
|
1724
1617
|
|
|
1725
1618
|
|
|
1619
|
+
##### Returns
|
|
1726
1620
|
|
|
1727
1621
|
|
|
1728
|
-
|
|
1622
|
+
- `Promise` Promise when all script have been loaded
|
|
1729
1623
|
|
|
1730
1624
|
|
|
1731
|
-
#### flatUIToUI(uFilters, version)
|
|
1732
1625
|
|
|
1733
|
-
|
|
1626
|
+
#### loadScript(url, type, noModule)
|
|
1627
|
+
|
|
1628
|
+
Creates the script element and appends to document.head
|
|
1629
|
+
return a Promise that is resolved when the script is loaded
|
|
1734
1630
|
|
|
1735
1631
|
|
|
1736
1632
|
|
|
@@ -1739,8 +1635,9 @@ Generates a UI filter data structure from the flatttened UI filters.
|
|
|
1739
1635
|
|
|
1740
1636
|
| Name | Type | Description | |
|
|
1741
1637
|
| ---- | ---- | ----------- | -------- |
|
|
1742
|
-
|
|
|
1743
|
-
|
|
|
1638
|
+
| url | `String` | Cdn Url | |
|
|
1639
|
+
| type | `String` | (Optional) it could be `module` of `text/javascript`. Default `text/javascript` | |
|
|
1640
|
+
| noModule | `boolean` | (Optional) add `momodule` attribute to script tag. Default `false` | |
|
|
1744
1641
|
|
|
1745
1642
|
|
|
1746
1643
|
|
|
@@ -1748,14 +1645,17 @@ Generates a UI filter data structure from the flatttened UI filters.
|
|
|
1748
1645
|
##### Returns
|
|
1749
1646
|
|
|
1750
1647
|
|
|
1751
|
-
-
|
|
1648
|
+
- `Void`
|
|
1752
1649
|
|
|
1753
1650
|
|
|
1754
1651
|
|
|
1755
|
-
#### buildScopes(fbFilters)
|
|
1756
1652
|
|
|
1757
|
-
|
|
1758
|
-
|
|
1653
|
+
### dist/general/mix/isEmpty.js
|
|
1654
|
+
|
|
1655
|
+
|
|
1656
|
+
#### isEmpty(variable, includeFalsy)
|
|
1657
|
+
|
|
1658
|
+
Validates if the given argument is empty
|
|
1759
1659
|
|
|
1760
1660
|
|
|
1761
1661
|
|
|
@@ -1764,7 +1664,8 @@ Also, adds and organizes filters by datasets
|
|
|
1764
1664
|
|
|
1765
1665
|
| Name | Type | Description | |
|
|
1766
1666
|
| ---- | ---- | ----------- | -------- |
|
|
1767
|
-
|
|
|
1667
|
+
| variable | | the given variable | |
|
|
1668
|
+
| includeFalsy | | flag to determine include the falsy variables into the validation | |
|
|
1768
1669
|
|
|
1769
1670
|
|
|
1770
1671
|
|
|
@@ -1772,13 +1673,18 @@ Also, adds and organizes filters by datasets
|
|
|
1772
1673
|
##### Returns
|
|
1773
1674
|
|
|
1774
1675
|
|
|
1775
|
-
-
|
|
1676
|
+
- true: the given argument is empty; false: is not.
|
|
1776
1677
|
|
|
1777
1678
|
|
|
1778
1679
|
|
|
1779
|
-
#### buildScope(uFilter)
|
|
1780
1680
|
|
|
1781
|
-
|
|
1681
|
+
### dist/general/mix/isNull.js
|
|
1682
|
+
|
|
1683
|
+
|
|
1684
|
+
#### isNull(arg)
|
|
1685
|
+
|
|
1686
|
+
return if a given variable is either `null` or `undefined`
|
|
1687
|
+
useful to avoid falsify validating Number Zero (0)
|
|
1782
1688
|
|
|
1783
1689
|
|
|
1784
1690
|
|
|
@@ -1787,7 +1693,7 @@ Gets an scope structure for the UI filter data
|
|
|
1787
1693
|
|
|
1788
1694
|
| Name | Type | Description | |
|
|
1789
1695
|
| ---- | ---- | ----------- | -------- |
|
|
1790
|
-
|
|
|
1696
|
+
| arg | `any` | | |
|
|
1791
1697
|
|
|
1792
1698
|
|
|
1793
1699
|
|
|
@@ -1795,13 +1701,19 @@ Gets an scope structure for the UI filter data
|
|
|
1795
1701
|
##### Returns
|
|
1796
1702
|
|
|
1797
1703
|
|
|
1798
|
-
-
|
|
1704
|
+
- `Boolean`
|
|
1799
1705
|
|
|
1800
1706
|
|
|
1801
1707
|
|
|
1802
|
-
#### buildDataset(uFilter)
|
|
1803
1708
|
|
|
1804
|
-
|
|
1709
|
+
### dist/general/mix/randomId.js
|
|
1710
|
+
|
|
1711
|
+
|
|
1712
|
+
#### randomId(length, exclude)
|
|
1713
|
+
|
|
1714
|
+
Creates a random string
|
|
1715
|
+
- If the first given argument is different than a length number, the variable is replaced by a default number
|
|
1716
|
+
- If the optional second given argument is passed the random string is permutated.
|
|
1805
1717
|
|
|
1806
1718
|
|
|
1807
1719
|
|
|
@@ -1810,7 +1722,8 @@ Gets an dataset structure for the UI filter data
|
|
|
1810
1722
|
|
|
1811
1723
|
| Name | Type | Description | |
|
|
1812
1724
|
| ---- | ---- | ----------- | -------- |
|
|
1813
|
-
|
|
|
1725
|
+
| length | `Number` | size of the generated string. Default 8 | |
|
|
1726
|
+
| exclude | `Array` | collection of strings that is going to be excluded of the random string. | |
|
|
1814
1727
|
|
|
1815
1728
|
|
|
1816
1729
|
|
|
@@ -1818,13 +1731,19 @@ Gets an dataset structure for the UI filter data
|
|
|
1818
1731
|
##### Returns
|
|
1819
1732
|
|
|
1820
1733
|
|
|
1821
|
-
-
|
|
1734
|
+
- `String` Random string
|
|
1822
1735
|
|
|
1823
1736
|
|
|
1824
1737
|
|
|
1825
|
-
#### buildFilter(uFilter)
|
|
1826
1738
|
|
|
1827
|
-
|
|
1739
|
+
### dist/general/mix/size.js
|
|
1740
|
+
|
|
1741
|
+
|
|
1742
|
+
#### size(obj)
|
|
1743
|
+
|
|
1744
|
+
Gets the length of the given array.
|
|
1745
|
+
- Useful for Object, Array and string type.
|
|
1746
|
+
- For `null` or `undefined` or else argument the returned value will be 0.
|
|
1828
1747
|
|
|
1829
1748
|
|
|
1830
1749
|
|
|
@@ -1833,7 +1752,7 @@ Gets an filter structure for the UI filter data
|
|
|
1833
1752
|
|
|
1834
1753
|
| Name | Type | Description | |
|
|
1835
1754
|
| ---- | ---- | ----------- | -------- |
|
|
1836
|
-
|
|
|
1755
|
+
| obj | `Any` | Any object-type variable | |
|
|
1837
1756
|
|
|
1838
1757
|
|
|
1839
1758
|
|
|
@@ -1841,17 +1760,18 @@ Gets an filter structure for the UI filter data
|
|
|
1841
1760
|
##### Returns
|
|
1842
1761
|
|
|
1843
1762
|
|
|
1844
|
-
-
|
|
1763
|
+
- `Number` the size of the given variable
|
|
1845
1764
|
|
|
1846
1765
|
|
|
1847
1766
|
|
|
1848
1767
|
|
|
1849
|
-
### dist/
|
|
1768
|
+
### dist/general/object/cloneDeep.js
|
|
1850
1769
|
|
|
1851
1770
|
|
|
1852
|
-
####
|
|
1771
|
+
#### cloneDeep(obj)
|
|
1853
1772
|
|
|
1854
|
-
|
|
1773
|
+
A simple Deep Cloning function. Valid only for primivite values and object with primitive values.
|
|
1774
|
+
Not to use this function with inner objects and functions
|
|
1855
1775
|
|
|
1856
1776
|
|
|
1857
1777
|
|
|
@@ -1860,8 +1780,7 @@ Generates a filter data structure from the old logic structure (v2.0).
|
|
|
1860
1780
|
|
|
1861
1781
|
| Name | Type | Description | |
|
|
1862
1782
|
| ---- | ---- | ----------- | -------- |
|
|
1863
|
-
|
|
|
1864
|
-
| version | | Tag for the version of the filter data structure | |
|
|
1783
|
+
| obj | | The object | |
|
|
1865
1784
|
|
|
1866
1785
|
|
|
1867
1786
|
|
|
@@ -1869,17 +1788,21 @@ Generates a filter data structure from the old logic structure (v2.0).
|
|
|
1869
1788
|
##### Returns
|
|
1870
1789
|
|
|
1871
1790
|
|
|
1872
|
-
-
|
|
1791
|
+
- The new reference object or the given object if the parsing is incorrect or empty
|
|
1873
1792
|
|
|
1874
1793
|
|
|
1875
1794
|
|
|
1876
1795
|
|
|
1877
|
-
### dist/
|
|
1796
|
+
### dist/general/object/get.js
|
|
1878
1797
|
|
|
1879
1798
|
|
|
1880
|
-
####
|
|
1799
|
+
#### _get(baseObject, path, defaultValue)
|
|
1881
1800
|
|
|
1882
|
-
|
|
1801
|
+
Like lodash _.get.
|
|
1802
|
+
Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.
|
|
1803
|
+
|
|
1804
|
+
Empty arrays and empty objects are returned but the defaultValue is not
|
|
1805
|
+
Undefined and null values will return the defaultValue.
|
|
1883
1806
|
|
|
1884
1807
|
|
|
1885
1808
|
|
|
@@ -1888,74 +1811,91 @@ Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
|
|
|
1888
1811
|
|
|
1889
1812
|
| Name | Type | Description | |
|
|
1890
1813
|
| ---- | ---- | ----------- | -------- |
|
|
1891
|
-
|
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
##### Returns
|
|
1814
|
+
| baseObject | | The object to query | |
|
|
1815
|
+
| path | | The string path or collection of string paths of the property to get. | |
|
|
1816
|
+
| defaultValue | | The value returned for undefined resolved values. | |
|
|
1897
1817
|
|
|
1898
1818
|
|
|
1899
|
-
- The Flattened UI Filters array
|
|
1900
1819
|
|
|
1901
1820
|
|
|
1821
|
+
##### Examples
|
|
1902
1822
|
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1823
|
+
```javascript
|
|
1824
|
+
// returns 'Hello'
|
|
1825
|
+
_get({ item1: 'Hello', item2: 'World' }, 'item1')
|
|
1826
|
+
```
|
|
1827
|
+
```javascript
|
|
1828
|
+
// returns 'A simple Hello'
|
|
1829
|
+
_get({ item1: 'Hello', item2: 'World' }, 'item3', 'A simple Hello')
|
|
1830
|
+
```
|
|
1831
|
+
```javascript
|
|
1832
|
+
// returns 'Hello Again'
|
|
1833
|
+
_get({ item1: { item11: 'Hello Again' }, item2: {} }, 'item1.item11')
|
|
1834
|
+
```
|
|
1835
|
+
```javascript
|
|
1836
|
+
// returns 'Hello 2'
|
|
1837
|
+
_get({ item1: ['Hello 1', 'Hello 2' }, item2: [] }, 'item1[1]')
|
|
1838
|
+
```
|
|
1839
|
+
```javascript
|
|
1840
|
+
// returns 'Hello Again'
|
|
1841
|
+
_get({ item1: { item11: 'Hello Again' }, item2: {} }, ['item1', 'item11'])
|
|
1842
|
+
```
|
|
1906
1843
|
|
|
1907
1844
|
|
|
1845
|
+
##### Returns
|
|
1908
1846
|
|
|
1909
1847
|
|
|
1910
|
-
|
|
1848
|
+
- the resolved value.
|
|
1911
1849
|
|
|
1912
|
-
| Name | Type | Description | |
|
|
1913
|
-
| ---- | ---- | ----------- | -------- |
|
|
1914
|
-
| filters | | The array of UI filters | |
|
|
1915
|
-
| filter | | The old logic structure filter | |
|
|
1916
|
-
| getIndex | | Determines if the index or returns the UI filter object | |
|
|
1917
1850
|
|
|
1918
1851
|
|
|
1919
1852
|
|
|
1853
|
+
### dist/general/object/hasProperty.js
|
|
1920
1854
|
|
|
1921
|
-
##### Returns
|
|
1922
1855
|
|
|
1856
|
+
#### _hasProperty(obj, property)
|
|
1923
1857
|
|
|
1924
|
-
|
|
1858
|
+
Use the hasOwnProperty in order to verify if the given property exists in the object.
|
|
1925
1859
|
|
|
1926
1860
|
|
|
1927
1861
|
|
|
1928
|
-
#### refineRankingValues(values, uiValues)
|
|
1929
1862
|
|
|
1930
|
-
|
|
1863
|
+
##### Parameters
|
|
1931
1864
|
|
|
1865
|
+
| Name | Type | Description | |
|
|
1866
|
+
| ---- | ---- | ----------- | -------- |
|
|
1867
|
+
| obj | `object` | an object | |
|
|
1868
|
+
| property | `string` | String to verify if exists in the object as property | |
|
|
1932
1869
|
|
|
1933
1870
|
|
|
1934
1871
|
|
|
1935
|
-
##### Parameters
|
|
1936
1872
|
|
|
1937
|
-
|
|
1938
|
-
| ---- | ---- | ----------- | -------- |
|
|
1939
|
-
| values | | the Array of Ranking values | |
|
|
1940
|
-
| uiValues | | Object with additional info about the values of the filter. | |
|
|
1873
|
+
##### Examples
|
|
1941
1874
|
|
|
1875
|
+
```javascript
|
|
1876
|
+
const prop = 'prop2'
|
|
1877
|
+
const obj1 = { prop1: 'hello', prop2: 'world'}
|
|
1878
|
+
_hasProperty(ob1, prop1) // true
|
|
1942
1879
|
|
|
1880
|
+
const obj2 = { prop1: 'hello world' }
|
|
1881
|
+
_hasProperty(ob1, prop2) // false
|
|
1882
|
+
```
|
|
1943
1883
|
|
|
1944
1884
|
|
|
1945
1885
|
##### Returns
|
|
1946
1886
|
|
|
1947
1887
|
|
|
1948
|
-
- the
|
|
1888
|
+
- True if the object has the given property; otherwise, false.
|
|
1949
1889
|
|
|
1950
1890
|
|
|
1951
1891
|
|
|
1952
1892
|
|
|
1953
|
-
### dist/
|
|
1893
|
+
### dist/general/object/isObject.js
|
|
1954
1894
|
|
|
1955
1895
|
|
|
1956
|
-
####
|
|
1896
|
+
#### isObject(obj)
|
|
1957
1897
|
|
|
1958
|
-
|
|
1898
|
+
Checks if the given argument is an object type
|
|
1959
1899
|
|
|
1960
1900
|
|
|
1961
1901
|
|
|
@@ -1964,8 +1904,7 @@ Generates a UI filter structure from the old logic structure (v2.0).
|
|
|
1964
1904
|
|
|
1965
1905
|
| Name | Type | Description | |
|
|
1966
1906
|
| ---- | ---- | ----------- | -------- |
|
|
1967
|
-
|
|
|
1968
|
-
| datasetsInfo | | Collection of datasets information | |
|
|
1907
|
+
| obj | | the variable to check | |
|
|
1969
1908
|
|
|
1970
1909
|
|
|
1971
1910
|
|
|
@@ -1973,17 +1912,18 @@ Generates a UI filter structure from the old logic structure (v2.0).
|
|
|
1973
1912
|
##### Returns
|
|
1974
1913
|
|
|
1975
1914
|
|
|
1976
|
-
-
|
|
1915
|
+
- True: It is an object; False: It is not.
|
|
1977
1916
|
|
|
1978
1917
|
|
|
1979
1918
|
|
|
1980
1919
|
|
|
1981
|
-
### dist/
|
|
1920
|
+
### dist/general/object/mapValues.js
|
|
1982
1921
|
|
|
1983
1922
|
|
|
1984
|
-
####
|
|
1923
|
+
#### mapValues(baseObject, iteratee)
|
|
1985
1924
|
|
|
1986
|
-
|
|
1925
|
+
Invoke iteratee (function) for each object key-value pair
|
|
1926
|
+
and return a mapped object
|
|
1987
1927
|
|
|
1988
1928
|
|
|
1989
1929
|
|
|
@@ -1992,114 +1932,54 @@ Transform the old filters structure into the new one
|
|
|
1992
1932
|
|
|
1993
1933
|
| Name | Type | Description | |
|
|
1994
1934
|
| ---- | ---- | ----------- | -------- |
|
|
1995
|
-
|
|
|
1996
|
-
|
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
##### Examples
|
|
2002
|
-
|
|
2003
|
-
```javascript
|
|
1935
|
+
| baseObject | `Object` | Base object. | |
|
|
1936
|
+
| iteratee | `Function` | The executed per iteration. | |
|
|
2004
1937
|
|
|
2005
|
-
const oldPreferenceFilters = {
|
|
2006
|
-
"WWXHAULtR-_-xYOQAdpqT__ENABLED": true,
|
|
2007
|
-
"WWXHAULtR-_-xYOQAdpqT__ALL--ENABLED": true,
|
|
2008
|
-
"WWXHAULtR-_-xYOQAdpqT__COLLAPSED": false,
|
|
2009
|
-
"WWXHAULtR-_-xYOQAdpqT__LABEL": "GLOBAL",
|
|
2010
|
-
"WWXHAULtR-_-xYOQAdpqT-_-AK4M8UV2": {
|
|
2011
|
-
"formulaId": null,
|
|
2012
|
-
"panelId": null,
|
|
2013
|
-
"values": [
|
|
2014
|
-
{
|
|
2015
|
-
"EQUALS": [
|
|
2016
|
-
{
|
|
2017
|
-
"id": "AK4M8UV2a0",
|
|
2018
|
-
"value": "A",
|
|
2019
|
-
"enabled": true,
|
|
2020
|
-
"imageUrl": null
|
|
2021
|
-
},
|
|
2022
|
-
{
|
|
2023
|
-
"id": "AK4M8UV2a1",
|
|
2024
|
-
"value": "B",
|
|
2025
|
-
"enabled": true,
|
|
2026
|
-
"imageUrl": null
|
|
2027
|
-
}
|
|
2028
|
-
]
|
|
2029
|
-
}
|
|
2030
|
-
],
|
|
2031
|
-
"bucketId": null,
|
|
2032
|
-
"text": "MC",
|
|
2033
|
-
"title": "MC",
|
|
2034
|
-
"type": "SINGLE_CHOICE",
|
|
2035
|
-
"qid": "AK4M8UV2",
|
|
2036
|
-
"dataset": {
|
|
2037
|
-
"sourceid": "xYOQAdpqT",
|
|
2038
|
-
"name": "Form All Questions",
|
|
2039
|
-
"qrveyid": "xYOQAdpqT",
|
|
2040
|
-
"text": "Form All Questions",
|
|
2041
|
-
"linkid": 0
|
|
2042
|
-
},
|
|
2043
|
-
"enabled": true,
|
|
2044
|
-
"linked": null
|
|
2045
|
-
}
|
|
2046
|
-
};
|
|
2047
1938
|
|
|
2048
|
-
const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
|
|
2049
|
-
```
|
|
2050
1939
|
|
|
2051
1940
|
|
|
2052
1941
|
##### Returns
|
|
2053
1942
|
|
|
2054
1943
|
|
|
2055
|
-
- `Object`
|
|
2056
|
-
|
|
1944
|
+
- `Object` New mapped object.
|
|
2057
1945
|
|
|
2058
1946
|
|
|
2059
1947
|
|
|
2060
|
-
### dist/stencil/decorators/Config.js
|
|
2061
1948
|
|
|
1949
|
+
### dist/general/object/objectCopy.js
|
|
2062
1950
|
|
|
2063
|
-
#### Config()
|
|
2064
1951
|
|
|
2065
|
-
|
|
2066
|
-
Get and Parse the Widget Configuration Object and also provide the ability to get properties in different case styles such as: lower, upper, camel and pascal
|
|
2067
|
-
But for this, is required ask for a property in `snake_case` style
|
|
1952
|
+
#### objectCopy(entity, cache)
|
|
2068
1953
|
|
|
1954
|
+
Created a new reference of the given argument
|
|
2069
1955
|
|
|
2070
1956
|
|
|
2071
1957
|
|
|
2072
1958
|
|
|
1959
|
+
##### Parameters
|
|
2073
1960
|
|
|
2074
|
-
|
|
1961
|
+
| Name | Type | Description | |
|
|
1962
|
+
| ---- | ---- | ----------- | -------- |
|
|
1963
|
+
| entity | | The variable to be copied | |
|
|
1964
|
+
| cache | | | |
|
|
2075
1965
|
|
|
2076
|
-
```javascript
|
|
2077
|
-
\ @Config() @Prop() settings;
|
|
2078
1966
|
|
|
2079
|
-
someMethod() {
|
|
2080
|
-
this.settings.snake_case //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
|
|
2081
|
-
}
|
|
2082
|
-
```
|
|
2083
1967
|
|
|
2084
1968
|
|
|
2085
1969
|
##### Returns
|
|
2086
1970
|
|
|
2087
1971
|
|
|
2088
|
-
-
|
|
1972
|
+
- A new reference of the given argument
|
|
2089
1973
|
|
|
2090
1974
|
|
|
2091
1975
|
|
|
2092
1976
|
|
|
2093
|
-
### dist/
|
|
1977
|
+
### dist/general/object/omit.js
|
|
2094
1978
|
|
|
2095
1979
|
|
|
2096
|
-
####
|
|
1980
|
+
#### omit(obj, props)
|
|
2097
1981
|
|
|
2098
|
-
|
|
2099
|
-
- In case _cfg_ is a string, first try to make a JSON parse in other case
|
|
2100
|
-
try to find this string as a variable on Windows object
|
|
2101
|
-
- If _cfg_ is a fuction, tis is invoked and parsed
|
|
2102
|
-
- Finally, if is an object, _cfg_ is inmediatly returned
|
|
1982
|
+
return a nwe Object excluding attributes in _props_ list
|
|
2103
1983
|
|
|
2104
1984
|
|
|
2105
1985
|
|
|
@@ -2108,7 +1988,8 @@ try to find this string as a variable on Windows object
|
|
|
2108
1988
|
|
|
2109
1989
|
| Name | Type | Description | |
|
|
2110
1990
|
| ---- | ---- | ----------- | -------- |
|
|
2111
|
-
|
|
|
1991
|
+
| obj | `Object` | base object | |
|
|
1992
|
+
| props | `Array.<String>` | list of attribute to exclude | |
|
|
2112
1993
|
|
|
2113
1994
|
|
|
2114
1995
|
|
|
@@ -2116,17 +1997,17 @@ try to find this string as a variable on Windows object
|
|
|
2116
1997
|
##### Returns
|
|
2117
1998
|
|
|
2118
1999
|
|
|
2119
|
-
- `
|
|
2000
|
+
- `Object` clean object
|
|
2120
2001
|
|
|
2121
2002
|
|
|
2122
2003
|
|
|
2123
2004
|
|
|
2124
|
-
### dist/
|
|
2005
|
+
### dist/general/object/pick.js
|
|
2125
2006
|
|
|
2126
2007
|
|
|
2127
|
-
####
|
|
2008
|
+
#### pick(baseObject, keys)
|
|
2128
2009
|
|
|
2129
|
-
|
|
2010
|
+
return a new object just with attributes in _keys_ list
|
|
2130
2011
|
|
|
2131
2012
|
|
|
2132
2013
|
|
|
@@ -2135,7 +2016,8 @@ try to find this string as a variable on Windows object
|
|
|
2135
2016
|
|
|
2136
2017
|
| Name | Type | Description | |
|
|
2137
2018
|
| ---- | ---- | ----------- | -------- |
|
|
2138
|
-
|
|
|
2019
|
+
| baseObject | `Object` | base object | |
|
|
2020
|
+
| keys | `Array.<String>` | list of attributes to preserve | |
|
|
2139
2021
|
|
|
2140
2022
|
|
|
2141
2023
|
|
|
@@ -2143,17 +2025,17 @@ try to find this string as a variable on Windows object
|
|
|
2143
2025
|
##### Returns
|
|
2144
2026
|
|
|
2145
2027
|
|
|
2146
|
-
- `
|
|
2028
|
+
- `Object` new object just with desired attributes
|
|
2147
2029
|
|
|
2148
2030
|
|
|
2149
2031
|
|
|
2150
2032
|
|
|
2151
|
-
### dist/
|
|
2033
|
+
### dist/general/string/capitalize.js
|
|
2152
2034
|
|
|
2153
2035
|
|
|
2154
|
-
####
|
|
2036
|
+
#### capitalize(text)
|
|
2155
2037
|
|
|
2156
|
-
|
|
2038
|
+
Upper case the first letter of a given text
|
|
2157
2039
|
|
|
2158
2040
|
|
|
2159
2041
|
|
|
@@ -2162,7 +2044,7 @@ try to find this string as a variable on Windows object
|
|
|
2162
2044
|
|
|
2163
2045
|
| Name | Type | Description | |
|
|
2164
2046
|
| ---- | ---- | ----------- | -------- |
|
|
2165
|
-
|
|
|
2047
|
+
| text | `String` | | |
|
|
2166
2048
|
|
|
2167
2049
|
|
|
2168
2050
|
|
|
@@ -2170,19 +2052,26 @@ try to find this string as a variable on Windows object
|
|
|
2170
2052
|
##### Returns
|
|
2171
2053
|
|
|
2172
2054
|
|
|
2173
|
-
- `
|
|
2055
|
+
- `String` a capitalized text
|
|
2174
2056
|
|
|
2175
2057
|
|
|
2176
2058
|
|
|
2177
2059
|
|
|
2178
|
-
### dist/
|
|
2060
|
+
### dist/typescript/decorators/Debounce.js
|
|
2179
2061
|
|
|
2180
2062
|
|
|
2181
|
-
####
|
|
2063
|
+
#### Debounce(time)
|
|
2064
|
+
|
|
2065
|
+
(Method Decorator) Debounce Class Method
|
|
2066
|
+
|
|
2182
2067
|
|
|
2183
|
-
lit implementation of React createRef (https://reactjs.org/docs/refs-and-the-dom.html)
|
|
2184
2068
|
|
|
2185
2069
|
|
|
2070
|
+
##### Parameters
|
|
2071
|
+
|
|
2072
|
+
| Name | Type | Description | |
|
|
2073
|
+
| ---- | ---- | ----------- | -------- |
|
|
2074
|
+
| time | | (optional) deafult 500 | |
|
|
2186
2075
|
|
|
2187
2076
|
|
|
2188
2077
|
|
|
@@ -2190,17 +2079,17 @@ lit implementation of React createRef (https://reactjs.org/docs/refs-and-the-dom
|
|
|
2190
2079
|
##### Returns
|
|
2191
2080
|
|
|
2192
2081
|
|
|
2193
|
-
-
|
|
2082
|
+
- `Void`
|
|
2194
2083
|
|
|
2195
2084
|
|
|
2196
2085
|
|
|
2197
2086
|
|
|
2198
|
-
### dist/
|
|
2087
|
+
### dist/typescript/decorators/Throttled.js
|
|
2199
2088
|
|
|
2200
2089
|
|
|
2201
|
-
####
|
|
2090
|
+
#### Throttled(time)
|
|
2202
2091
|
|
|
2203
|
-
|
|
2092
|
+
(Method Decorator) Throttled Class Method
|
|
2204
2093
|
|
|
2205
2094
|
|
|
2206
2095
|
|
|
@@ -2209,7 +2098,7 @@ Build a proper relative date statement type
|
|
|
2209
2098
|
|
|
2210
2099
|
| Name | Type | Description | |
|
|
2211
2100
|
| ---- | ---- | ----------- | -------- |
|
|
2212
|
-
|
|
|
2101
|
+
| time | | (optional) deafult 500 | |
|
|
2213
2102
|
|
|
2214
2103
|
|
|
2215
2104
|
|
|
@@ -2217,54 +2106,52 @@ Build a proper relative date statement type
|
|
|
2217
2106
|
##### Returns
|
|
2218
2107
|
|
|
2219
2108
|
|
|
2220
|
-
- `
|
|
2221
|
-
|
|
2222
|
-
|
|
2109
|
+
- `Void`
|
|
2223
2110
|
|
|
2224
2111
|
|
|
2225
|
-
### dist/date/relative/helpers/getStatementCase.js
|
|
2226
2112
|
|
|
2227
2113
|
|
|
2228
|
-
|
|
2114
|
+
### dist/stencil/decorators/Config.js
|
|
2229
2115
|
|
|
2230
|
-
Returns a number/constant that identifies a relative date case
|
|
2231
2116
|
|
|
2117
|
+
#### Config()
|
|
2232
2118
|
|
|
2119
|
+
Stencil.js - Prop Decorator
|
|
2120
|
+
Get and Parse the Widget Configuration Object and also provide the ability to get properties in different case styles such as: lower, upper, camel and pascal
|
|
2121
|
+
But for this, is required ask for a property in `snake_case` style
|
|
2233
2122
|
|
|
2234
2123
|
|
|
2235
|
-
##### Parameters
|
|
2236
2124
|
|
|
2237
|
-
| Name | Type | Description | |
|
|
2238
|
-
| ---- | ---- | ----------- | -------- |
|
|
2239
|
-
| includeCurrent | `boolean` | | |
|
|
2240
|
-
| isCalendarDate | `boolean` | | |
|
|
2241
2125
|
|
|
2242
2126
|
|
|
2243
2127
|
|
|
2128
|
+
##### Examples
|
|
2244
2129
|
|
|
2245
|
-
|
|
2130
|
+
```javascript
|
|
2131
|
+
\ @Config() @Prop() settings;
|
|
2246
2132
|
|
|
2133
|
+
someMethod() {
|
|
2134
|
+
this.settings.snake_case //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
|
|
2135
|
+
}
|
|
2136
|
+
```
|
|
2247
2137
|
|
|
2248
|
-
- `number`
|
|
2249
2138
|
|
|
2139
|
+
##### Returns
|
|
2250
2140
|
|
|
2251
2141
|
|
|
2142
|
+
- `Void`
|
|
2252
2143
|
|
|
2253
|
-
### dist/date/relative/helpers/parseDate.js
|
|
2254
2144
|
|
|
2255
2145
|
|
|
2256
|
-
#### parseDate(date)
|
|
2257
2146
|
|
|
2258
|
-
|
|
2147
|
+
### dist/stencil/util/createRef.js
|
|
2259
2148
|
|
|
2260
2149
|
|
|
2150
|
+
#### createRef()
|
|
2261
2151
|
|
|
2152
|
+
lit implementation of React createRef (https://reactjs.org/docs/refs-and-the-dom.html)
|
|
2262
2153
|
|
|
2263
|
-
##### Parameters
|
|
2264
2154
|
|
|
2265
|
-
| Name | Type | Description | |
|
|
2266
|
-
| ---- | ---- | ----------- | -------- |
|
|
2267
|
-
| date | `string` `Dayjs` `Date` | | |
|
|
2268
2155
|
|
|
2269
2156
|
|
|
2270
2157
|
|
|
@@ -2272,17 +2159,21 @@ Parses a string date and returns a dayjs date
|
|
|
2272
2159
|
##### Returns
|
|
2273
2160
|
|
|
2274
2161
|
|
|
2275
|
-
-
|
|
2162
|
+
- function - Function to use in ref prop in html elements
|
|
2276
2163
|
|
|
2277
2164
|
|
|
2278
2165
|
|
|
2279
2166
|
|
|
2280
|
-
### dist/
|
|
2167
|
+
### dist/stencil/util/getConfig.js
|
|
2281
2168
|
|
|
2282
2169
|
|
|
2283
|
-
####
|
|
2170
|
+
#### getConfig(cfg)
|
|
2284
2171
|
|
|
2285
|
-
|
|
2172
|
+
verify the Config object type and try to return a parsed Object
|
|
2173
|
+
- In case _cfg_ is a string, first try to make a JSON parse in other case
|
|
2174
|
+
try to find this string as a variable on Windows object
|
|
2175
|
+
- If _cfg_ is a fuction, tis is invoked and parsed
|
|
2176
|
+
- Finally, if is an object, _cfg_ is inmediatly returned
|
|
2286
2177
|
|
|
2287
2178
|
|
|
2288
2179
|
|
|
@@ -2291,7 +2182,7 @@ Returns a filter builder config object by a any given config
|
|
|
2291
2182
|
|
|
2292
2183
|
| Name | Type | Description | |
|
|
2293
2184
|
| ---- | ---- | ----------- | -------- |
|
|
2294
|
-
|
|
|
2185
|
+
| cfg | | | |
|
|
2295
2186
|
|
|
2296
2187
|
|
|
2297
2188
|
|
|
@@ -2299,7 +2190,7 @@ Returns a filter builder config object by a any given config
|
|
|
2299
2190
|
##### Returns
|
|
2300
2191
|
|
|
2301
2192
|
|
|
2302
|
-
-
|
|
2193
|
+
- `Void`
|
|
2303
2194
|
|
|
2304
2195
|
|
|
2305
2196
|
|
|
@@ -2600,12 +2491,12 @@ Gets filters from the logic by the scopes hierarchy.
|
|
|
2600
2491
|
|
|
2601
2492
|
|
|
2602
2493
|
|
|
2603
|
-
### dist/filters/helpers/
|
|
2494
|
+
### dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js
|
|
2604
2495
|
|
|
2605
2496
|
|
|
2606
|
-
####
|
|
2497
|
+
#### getFilterBuilderGeneralConfig(config)
|
|
2607
2498
|
|
|
2608
|
-
|
|
2499
|
+
Returns a filter builder config object by a any given config
|
|
2609
2500
|
|
|
2610
2501
|
|
|
2611
2502
|
|
|
@@ -2614,8 +2505,7 @@ Determines if the filter column and property is a distinct group dates type
|
|
|
2614
2505
|
|
|
2615
2506
|
| Name | Type | Description | |
|
|
2616
2507
|
| ---- | ---- | ----------- | -------- |
|
|
2617
|
-
|
|
|
2618
|
-
| property | | The filter property | |
|
|
2508
|
+
| config | | any config object | |
|
|
2619
2509
|
|
|
2620
2510
|
|
|
2621
2511
|
|
|
@@ -2623,7 +2513,7 @@ Determines if the filter column and property is a distinct group dates type
|
|
|
2623
2513
|
##### Returns
|
|
2624
2514
|
|
|
2625
2515
|
|
|
2626
|
-
-
|
|
2516
|
+
- The filter builder config object
|
|
2627
2517
|
|
|
2628
2518
|
|
|
2629
2519
|
|
|
@@ -2656,6 +2546,34 @@ Validates if both filters are the same
|
|
|
2656
2546
|
|
|
2657
2547
|
|
|
2658
2548
|
|
|
2549
|
+
### dist/filters/helpers/common/arePropertiesDateP.js
|
|
2550
|
+
|
|
2551
|
+
|
|
2552
|
+
#### arePropertiesDateP(column, property)
|
|
2553
|
+
|
|
2554
|
+
Determines if the filter column and property is a distinct group dates type
|
|
2555
|
+
|
|
2556
|
+
|
|
2557
|
+
|
|
2558
|
+
|
|
2559
|
+
##### Parameters
|
|
2560
|
+
|
|
2561
|
+
| Name | Type | Description | |
|
|
2562
|
+
| ---- | ---- | ----------- | -------- |
|
|
2563
|
+
| column | | The filter column | |
|
|
2564
|
+
| property | | The filter property | |
|
|
2565
|
+
|
|
2566
|
+
|
|
2567
|
+
|
|
2568
|
+
|
|
2569
|
+
##### Returns
|
|
2570
|
+
|
|
2571
|
+
|
|
2572
|
+
- True if the given property is included from distinct group dates type
|
|
2573
|
+
|
|
2574
|
+
|
|
2575
|
+
|
|
2576
|
+
|
|
2659
2577
|
### dist/filters/helpers/common/excludeFiltersByAggregateColumn.js
|
|
2660
2578
|
|
|
2661
2579
|
|
|
@@ -2720,12 +2638,12 @@ The validation to filter the stored filter is depending on:
|
|
|
2720
2638
|
|
|
2721
2639
|
|
|
2722
2640
|
|
|
2723
|
-
### dist/filters/helpers/common/
|
|
2641
|
+
### dist/filters/helpers/common/getFilterColumnLabel.js
|
|
2724
2642
|
|
|
2725
2643
|
|
|
2726
|
-
####
|
|
2644
|
+
#### getFilterColumnLabel(column)
|
|
2727
2645
|
|
|
2728
|
-
|
|
2646
|
+
Get an string of the properties of the given filter column.
|
|
2729
2647
|
|
|
2730
2648
|
|
|
2731
2649
|
|
|
@@ -2734,8 +2652,7 @@ Excludes and returns a filter data without filters by the given scopes
|
|
|
2734
2652
|
|
|
2735
2653
|
| Name | Type | Description | |
|
|
2736
2654
|
| ---- | ---- | ----------- | -------- |
|
|
2737
|
-
|
|
|
2738
|
-
| scopes | | collection of scopes to be as filtering parameters | |
|
|
2655
|
+
| column | | The filter column | |
|
|
2739
2656
|
|
|
2740
2657
|
|
|
2741
2658
|
|
|
@@ -2743,17 +2660,17 @@ Excludes and returns a filter data without filters by the given scopes
|
|
|
2743
2660
|
##### Returns
|
|
2744
2661
|
|
|
2745
2662
|
|
|
2746
|
-
-
|
|
2663
|
+
- an string with the property, aggregate or calculation label.
|
|
2747
2664
|
|
|
2748
2665
|
|
|
2749
2666
|
|
|
2750
2667
|
|
|
2751
|
-
### dist/filters/helpers/common/
|
|
2668
|
+
### dist/filters/helpers/common/excludeFiltersByScopes.js
|
|
2752
2669
|
|
|
2753
2670
|
|
|
2754
|
-
####
|
|
2671
|
+
#### excludeFiltersByScopes(filterData, scopes)
|
|
2755
2672
|
|
|
2756
|
-
|
|
2673
|
+
Excludes and returns a filter data without filters by the given scopes
|
|
2757
2674
|
|
|
2758
2675
|
|
|
2759
2676
|
|
|
@@ -2762,7 +2679,8 @@ Get an string of the properties of the given filter column.
|
|
|
2762
2679
|
|
|
2763
2680
|
| Name | Type | Description | |
|
|
2764
2681
|
| ---- | ---- | ----------- | -------- |
|
|
2765
|
-
|
|
|
2682
|
+
| filterData | | The Filter Data | |
|
|
2683
|
+
| scopes | | collection of scopes to be as filtering parameters | |
|
|
2766
2684
|
|
|
2767
2685
|
|
|
2768
2686
|
|
|
@@ -2770,7 +2688,7 @@ Get an string of the properties of the given filter column.
|
|
|
2770
2688
|
##### Returns
|
|
2771
2689
|
|
|
2772
2690
|
|
|
2773
|
-
-
|
|
2691
|
+
- The new Filter Data without filters by the given scopes.
|
|
2774
2692
|
|
|
2775
2693
|
|
|
2776
2694
|
|
|
@@ -3647,4 +3565,86 @@ Resolves conditions between UI flattened filter and given parameters
|
|
|
3647
3565
|
|
|
3648
3566
|
|
|
3649
3567
|
|
|
3568
|
+
### dist/date/relative/helpers/formatStatement.js
|
|
3569
|
+
|
|
3570
|
+
|
|
3571
|
+
#### formatStatement(statement)
|
|
3572
|
+
|
|
3573
|
+
Build a proper relative date statement type
|
|
3574
|
+
|
|
3575
|
+
|
|
3576
|
+
|
|
3577
|
+
|
|
3578
|
+
##### Parameters
|
|
3579
|
+
|
|
3580
|
+
| Name | Type | Description | |
|
|
3581
|
+
| ---- | ---- | ----------- | -------- |
|
|
3582
|
+
| statement | `RelativeStatement` | | |
|
|
3583
|
+
|
|
3584
|
+
|
|
3585
|
+
|
|
3586
|
+
|
|
3587
|
+
##### Returns
|
|
3588
|
+
|
|
3589
|
+
|
|
3590
|
+
- `RelativeStatement`
|
|
3591
|
+
|
|
3592
|
+
|
|
3593
|
+
|
|
3594
|
+
|
|
3595
|
+
### dist/date/relative/helpers/getStatementCase.js
|
|
3596
|
+
|
|
3597
|
+
|
|
3598
|
+
#### getStatementCase(includeCurrent, isCalendarDate)
|
|
3599
|
+
|
|
3600
|
+
Returns a number/constant that identifies a relative date case
|
|
3601
|
+
|
|
3602
|
+
|
|
3603
|
+
|
|
3604
|
+
|
|
3605
|
+
##### Parameters
|
|
3606
|
+
|
|
3607
|
+
| Name | Type | Description | |
|
|
3608
|
+
| ---- | ---- | ----------- | -------- |
|
|
3609
|
+
| includeCurrent | `boolean` | | |
|
|
3610
|
+
| isCalendarDate | `boolean` | | |
|
|
3611
|
+
|
|
3612
|
+
|
|
3613
|
+
|
|
3614
|
+
|
|
3615
|
+
##### Returns
|
|
3616
|
+
|
|
3617
|
+
|
|
3618
|
+
- `number`
|
|
3619
|
+
|
|
3620
|
+
|
|
3621
|
+
|
|
3622
|
+
|
|
3623
|
+
### dist/date/relative/helpers/parseDate.js
|
|
3624
|
+
|
|
3625
|
+
|
|
3626
|
+
#### parseDate(date)
|
|
3627
|
+
|
|
3628
|
+
Parses a string date and returns a dayjs date
|
|
3629
|
+
|
|
3630
|
+
|
|
3631
|
+
|
|
3632
|
+
|
|
3633
|
+
##### Parameters
|
|
3634
|
+
|
|
3635
|
+
| Name | Type | Description | |
|
|
3636
|
+
| ---- | ---- | ----------- | -------- |
|
|
3637
|
+
| date | `string` `Dayjs` `Date` | | |
|
|
3638
|
+
|
|
3639
|
+
|
|
3640
|
+
|
|
3641
|
+
|
|
3642
|
+
##### Returns
|
|
3643
|
+
|
|
3644
|
+
|
|
3645
|
+
- `Dayjs` A dayjs date
|
|
3646
|
+
|
|
3647
|
+
|
|
3648
|
+
|
|
3649
|
+
|
|
3650
3650
|
*Documentation generated with [doxdox](https://github.com/neogeek/doxdox).*
|