@qrvey/utils 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.2.0*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.2.1*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -80,12 +80,12 @@ Get a text and evaluate if it matchs with a token box label.
80
80
 
81
81
 
82
82
 
83
- ### dist/filters/adapters/FDToFlatUI.js
83
+ ### dist/dates/range/getDateRange.js
84
84
 
85
85
 
86
- #### FDToFlatUI(filterData, datasetsInfo)
86
+ #### getDateRange(value, dateGroupLabel, withTime)
87
87
 
88
- Generates a Flattened UI filter structure from Filter Data structure.
88
+ Get date range object from a string date value
89
89
 
90
90
 
91
91
 
@@ -94,59 +94,74 @@ Generates a Flattened UI filter structure from Filter Data structure.
94
94
 
95
95
  | Name | Type | Description | |
96
96
  | ---- | ---- | ----------- | -------- |
97
- | filterData | | The filter data object. |   |
98
- | datasetsInfo | | Collection of datasets information |   |
99
-
97
+ | value | `String` | string date value |   |
98
+ | dateGroupLabel | `String` | could be 'YEAR', 'QUARTER', 'MONTH' or 'DAY'. Deafult is 'DAY' |   |
99
+ | withTime | `Boolean` | determines if the date range will include time. Default is true |   |
100
100
 
101
101
 
102
102
 
103
- ##### Returns
104
103
 
104
+ ##### Examples
105
105
 
106
- - a flattened UI filters array
106
+ ```javascript
107
+ // 1) Year:
108
+ getDateRange('2020', 'YEAR');
109
+ // Will return:
110
+ {
111
+ from: '01/01/2020 00:00:00',
112
+ to: '12/31/2020 23:59:59'
113
+ }
107
114
 
115
+ // 2) Quarter:
116
+ getDateRange('Q3 2020', 'QUARTER');
117
+ // Will return:
118
+ {
119
+ from: '07/01/2020 00:00:00',
120
+ to: '09/30/2020 23:59:59'
121
+ }
108
122
 
123
+ // 3) Month:
124
+ getDateRange('Oct 2020', 'MONTH');
125
+ // Will return:
126
+ {
127
+ from: '10/01/2020 00:00:00',
128
+ to: '10/31/2020 23:59:59'
129
+ }
130
+ ```
109
131
 
110
- #### FD21ToFlatUI(scopes, datasetsInfo)
111
132
 
112
- Generates a Filter Builder Structure from the Filter Data structure v2.1
133
+ ##### Returns
113
134
 
114
135
 
136
+ - `Object` an object with the date range with two string date properties: from and to
115
137
 
116
138
 
117
- ##### Parameters
118
139
 
119
- | Name | Type | Description | |
120
- | ---- | ---- | ----------- | -------- |
121
- | scopes | | The filter scope section |   |
122
- | datasetsInfo | | Collection of datasets information |   |
123
140
 
141
+ ### dist/dates/relative/Adapter.js
124
142
 
125
143
 
144
+ #### value()
126
145
 
127
- ##### Returns
146
+ Resolves statement and returns statement value
128
147
 
129
148
 
130
- - a flattened UI filters array
131
149
 
132
150
 
133
151
 
134
152
 
135
- ### dist/filters/adapters/FDToLogic.js
153
+ ##### Returns
136
154
 
137
155
 
138
- #### FDToLogic(filterData)
156
+ - `AbsoluteRange` `string`
139
157
 
140
- Generates a Filter Logic structure from Filter Data structure.
141
158
 
142
159
 
160
+ #### valueAsAnchor()
143
161
 
162
+ Resolves statement as an anchor
144
163
 
145
- ##### Parameters
146
164
 
147
- | Name | Type | Description | |
148
- | ---- | ---- | ----------- | -------- |
149
- | filterData | | The filter data object. |   |
150
165
 
151
166
 
152
167
 
@@ -154,22 +169,15 @@ Generates a Filter Logic structure from Filter Data structure.
154
169
  ##### Returns
155
170
 
156
171
 
157
- - a filter logic array
158
-
159
-
160
-
161
- #### getLogicBodyFromFD21(filterData)
172
+ - `string`
162
173
 
163
- Gets the logic body
164
174
 
165
175
 
176
+ #### _statementToRange() *private method*
166
177
 
178
+ Convert verbal statement to range value
167
179
 
168
- ##### Parameters
169
180
 
170
- | Name | Type | Description | |
171
- | ---- | ---- | ----------- | -------- |
172
- | filterData | | The filter data object |   |
173
181
 
174
182
 
175
183
 
@@ -177,71 +185,61 @@ Gets the logic body
177
185
  ##### Returns
178
186
 
179
187
 
180
- - a filter logic array
188
+ - `AbsoluteRange`
181
189
 
182
190
 
183
191
 
192
+ #### _resolveAsThis() *private method*
184
193
 
185
- ### dist/filters/adapters/FDToUI.js
194
+ Apply 'this' cursor logic to statement
186
195
 
187
196
 
188
- #### FDToUI(filterData, datasetsInfo)
189
197
 
190
- Generates a UI filter structure from Filter Data structure.
191
198
 
192
199
 
193
200
 
201
+ ##### Returns
194
202
 
195
- ##### Parameters
196
203
 
197
- | Name | Type | Description | |
198
- | ---- | ---- | ----------- | -------- |
199
- | filterData | | The filter data object. |   |
200
- | datasetsInfo | | Collection of datasets information |   |
204
+ - `AbsoluteStatement`
201
205
 
202
206
 
203
207
 
208
+ #### _resolveAsTheLast() *private method*
204
209
 
205
- ##### Returns
210
+ Apply 'the last' cursor logic to statement
206
211
 
207
212
 
208
- - a UI Filters structure
209
213
 
210
214
 
211
215
 
212
- #### FD21ToUI(scopes, section, version, datasetsInfo)
213
216
 
214
- Generates a UI filter Structure from the Filter Data structure v2.1
217
+ ##### Returns
215
218
 
216
219
 
220
+ - `AbsoluteStatement`
217
221
 
218
222
 
219
- ##### Parameters
220
223
 
221
- | Name | Type | Description | |
222
- | ---- | ---- | ----------- | -------- |
223
- | scopes | | The filter scope section |   |
224
- | section | | The filter section. |   |
225
- | version | | The version of the filter structure |   |
226
- | datasetsInfo | | Collection of datasets information |   |
224
+ #### _resolveAsTheNext() *private method*
227
225
 
226
+ Apply 'the next' cursor logic to statement
228
227
 
229
228
 
230
229
 
231
- ##### Returns
232
230
 
233
231
 
234
- - a UI filter Structure
235
232
 
233
+ ##### Returns
236
234
 
237
235
 
236
+ - `AbsoluteStatement`
238
237
 
239
- ### dist/filters/adapters/UIToFD.js
240
238
 
241
239
 
242
- #### UIToFD(filterData)
240
+ #### replaceNowToken(value, now)
243
241
 
244
- Generates a Filter Data Structure structure from UI Filter Data structure.
242
+ Replace '@now' token inside a string
245
243
 
246
244
 
247
245
 
@@ -250,7 +248,8 @@ Generates a Filter Data Structure structure from UI Filter Data structure.
250
248
 
251
249
  | Name | Type | Description | |
252
250
  | ---- | ---- | ----------- | -------- |
253
- | filterData | | The UI filter data object. |   |
251
+ | value | `string` | |   |
252
+ | now | `Date` | |   |
254
253
 
255
254
 
256
255
 
@@ -258,13 +257,13 @@ Generates a Filter Data Structure structure from UI Filter Data structure.
258
257
  ##### Returns
259
258
 
260
259
 
261
- - a Filter Data structure
260
+ - `string`
262
261
 
263
262
 
264
263
 
265
- #### UI21ToFD(uFilterData, version)
264
+ #### convertRelativeToAbsolute(args)
266
265
 
267
- Builds the Fitler Data structure from UI filter data
266
+ Returns a range object (date) from a group of statement params
268
267
 
269
268
 
270
269
 
@@ -273,26 +272,45 @@ Builds the Fitler Data structure from UI filter data
273
272
 
274
273
  | Name | Type | Description | |
275
274
  | ---- | ---- | ----------- | -------- |
276
- | uFilterData | | The UI filter Data object |   |
277
- | version | | the version of the structure |   |
275
+ | args | `RelativeToAbsoluteStruct` | |   |
278
276
 
279
277
 
280
278
 
281
279
 
280
+ ##### Examples
281
+
282
+ ```javascript
283
+ pivot = '2021-03-03T12:30:40'
284
+ unit = month
285
+ steps = 2
286
+ setTo = END
287
+ resolverAsCalendar: true
288
+ => Returns '2021-05-31T23:59:59'
289
+ ```
290
+ ```javascript
291
+ pivot = '2021-03-03T12:30:40'
292
+ unit = month
293
+ steps = -2
294
+ setTo = START
295
+ resolverAsCalendar: false
296
+ => Returns '2021-01-03T00:00:00'
297
+ ```
298
+
299
+
282
300
  ##### Returns
283
301
 
284
302
 
285
- -
303
+ - `string`
286
304
 
287
305
 
288
306
 
289
307
 
290
- ### dist/filters/adapters/UIToFlatUI.js
308
+ ### dist/dates/relative/relative.js
291
309
 
292
310
 
293
- #### UIToFlatUI(filterData, datasetsInfo)
311
+ #### resolveRelative(statements, clock)
294
312
 
295
- Generates a Flattened UI filter structure from UI Filter Data structure.
313
+ Resolve a list of relative statements according to operator
296
314
 
297
315
 
298
316
 
@@ -301,22 +319,44 @@ Generates a Flattened UI filter structure from UI Filter Data structure.
301
319
 
302
320
  | Name | Type | Description | |
303
321
  | ---- | ---- | ----------- | -------- |
304
- | filterData | | The UI filter data object. |   |
305
- | datasetsInfo | | Collection of datasets information. Optional for updating the datasets info |   |
322
+ | statements | `Array.<RelativeStatement>` `Array.<string>` | - Raw statements/values | &nbsp; |
323
+ | clock | `Date` | - Clock/time reference for relative date resolution | &nbsp; |
306
324
 
307
325
 
308
326
 
309
327
 
328
+ ##### Examples
329
+
330
+ ```javascript
331
+ Input:
332
+ {
333
+ "cursor": "the_next",
334
+ "unit": "year",
335
+ "number": 1,
336
+ "includeCurrent": false,
337
+ "isCalendarDate": false,
338
+ "anchor": "03/05/2021"
339
+ }
340
+
341
+ Output:
342
+ { gte: "03/06/2021 00:00:00", lte: "03/05/2022 23:59:59" }
343
+ ```
344
+
345
+
310
346
  ##### Returns
311
347
 
312
348
 
313
- - a flattened UI filters array
349
+ - `Array.&lt;AbsoluteRange&gt;` `Array.&lt;string&gt;`
314
350
 
315
351
 
316
352
 
317
- #### UI21ToFlatUI(scopes)
318
353
 
319
- Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
354
+ ### dist/filters/adapters/FDToFlatUI.js
355
+
356
+
357
+ #### FDToFlatUI(filterData, datasetsInfo)
358
+
359
+ Generates a Flattened UI filter structure from Filter Data structure.
320
360
 
321
361
 
322
362
 
@@ -325,7 +365,8 @@ Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
325
365
 
326
366
  | Name | Type | Description | |
327
367
  | ---- | ---- | ----------- | -------- |
328
- | scopes | | The filter scope section | &nbsp; |
368
+ | filterData | | The filter data object. | &nbsp; |
369
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
329
370
 
330
371
 
331
372
 
@@ -337,14 +378,9 @@ Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
337
378
 
338
379
 
339
380
 
381
+ #### FD21ToFlatUI(scopes, datasetsInfo)
340
382
 
341
- ### dist/filters/adapters/adaptDateGroupingProperty.js
342
-
343
-
344
- #### adaptDateGroupingProperty(property)
345
-
346
- [TODO: For 2022, eliminate this adapter]
347
- Get the new property base on the old date grouping properties
383
+ Generates a Filter Builder Structure from the Filter Data structure v2.1
348
384
 
349
385
 
350
386
 
@@ -353,7 +389,8 @@ Get the new property base on the old date grouping properties
353
389
 
354
390
  | Name | Type | Description | |
355
391
  | ---- | ---- | ----------- | -------- |
356
- | property | | | &nbsp; |
392
+ | scopes | | The filter scope section | &nbsp; |
393
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
357
394
 
358
395
 
359
396
 
@@ -361,17 +398,17 @@ Get the new property base on the old date grouping properties
361
398
  ##### Returns
362
399
 
363
400
 
364
- -
401
+ - a flattened UI filters array
365
402
 
366
403
 
367
404
 
368
405
 
369
- ### dist/filters/adapters/adaptFilterData.js
406
+ ### dist/filters/adapters/FDToLogic.js
370
407
 
371
408
 
372
- #### adaptFilterData(filterData, getUIFilterData, datasetsInfo)
409
+ #### FDToLogic(filterData)
373
410
 
374
- Checks and adapts the v2.0 Filter Data Structure to the v2.1
411
+ Generates a Filter Logic structure from Filter Data structure.
375
412
 
376
413
 
377
414
 
@@ -380,9 +417,7 @@ Checks and adapts the v2.0 Filter Data Structure to the v2.1
380
417
 
381
418
  | Name | Type | Description | |
382
419
  | ---- | ---- | ----------- | -------- |
383
- | filterData | | The filter data structure. Accepts both v2.1 or v2.0 | &nbsp; |
384
- | getUIFilterData | | Flag to get a Filter Data (False) or the UI Filter Data (True) | &nbsp; |
385
- | datasetsInfo | | Collection of datasets information. If getUIFilterData is true, the datasetsInfo should be mandatory | &nbsp; |
420
+ | filterData | | The filter data object. | &nbsp; |
386
421
 
387
422
 
388
423
 
@@ -390,18 +425,13 @@ Checks and adapts the v2.0 Filter Data Structure to the v2.1
390
425
  ##### Returns
391
426
 
392
427
 
393
- - A new filter data structure v2.1
394
-
395
-
396
-
428
+ - a filter logic array
397
429
 
398
- ### dist/filters/adapters/adaptFilterValues.js
399
430
 
400
431
 
401
- #### adaptFilterValues(filter)
432
+ #### getLogicBodyFromFD21(filterData)
402
433
 
403
- [TODO: For 2022, eliminate this adapter]
404
- Gets an adapted filter value array. Validates the enabled property and sets
434
+ Gets the logic body
405
435
 
406
436
 
407
437
 
@@ -410,7 +440,7 @@ Gets an adapted filter value array. Validates the enabled property and sets
410
440
 
411
441
  | Name | Type | Description | |
412
442
  | ---- | ---- | ----------- | -------- |
413
- | filter | | The filter | &nbsp; |
443
+ | filterData | | The filter data object | &nbsp; |
414
444
 
415
445
 
416
446
 
@@ -418,17 +448,17 @@ Gets an adapted filter value array. Validates the enabled property and sets
418
448
  ##### Returns
419
449
 
420
450
 
421
- - A new value array with the filled properties.
451
+ - a filter logic array
422
452
 
423
453
 
424
454
 
425
455
 
426
- ### dist/filters/adapters/flatUIToFD.js
456
+ ### dist/filters/adapters/FDToUI.js
427
457
 
428
458
 
429
- #### flatUIToFD(uFilters, version)
459
+ #### FDToUI(filterData, datasetsInfo)
430
460
 
431
- Generates a filter data structure from the flatttened UI filters.
461
+ Generates a UI filter structure from Filter Data structure.
432
462
 
433
463
 
434
464
 
@@ -437,8 +467,8 @@ Generates a filter data structure from the flatttened UI filters.
437
467
 
438
468
  | Name | Type | Description | |
439
469
  | ---- | ---- | ----------- | -------- |
440
- | uFilters | | Array of flattened filters from UI | &nbsp; |
441
- | version | | Tag for the version of the filter data structure | &nbsp; |
470
+ | filterData | | The filter data object. | &nbsp; |
471
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
442
472
 
443
473
 
444
474
 
@@ -446,14 +476,13 @@ Generates a filter data structure from the flatttened UI filters.
446
476
  ##### Returns
447
477
 
448
478
 
449
- - a Filter Data.
479
+ - a UI Filters structure
450
480
 
451
481
 
452
482
 
453
- #### buildScopes(fbFilters)
483
+ #### FD21ToUI(scopes, section, version, datasetsInfo)
454
484
 
455
- Gets an array of scopes structure for the filter data. The scopes is organized by scope types and scope IDs
456
- Also, adds and organizes filters by datasets
485
+ Generates a UI filter Structure from the Filter Data structure v2.1
457
486
 
458
487
 
459
488
 
@@ -462,7 +491,10 @@ Also, adds and organizes filters by datasets
462
491
 
463
492
  | Name | Type | Description | |
464
493
  | ---- | ---- | ----------- | -------- |
465
- | fbFilters | | Array of flat filters from UI | &nbsp; |
494
+ | scopes | | The filter scope section | &nbsp; |
495
+ | section | | The filter section. | &nbsp; |
496
+ | version | | The version of the filter structure | &nbsp; |
497
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
466
498
 
467
499
 
468
500
 
@@ -470,13 +502,252 @@ Also, adds and organizes filters by datasets
470
502
  ##### Returns
471
503
 
472
504
 
473
- - an array of scopes structure.
505
+ - a UI filter Structure
474
506
 
475
507
 
476
508
 
477
- #### buildScope(uFilter)
478
509
 
479
- Gets an scope structure for the filter data
510
+ ### dist/filters/adapters/UIToFD.js
511
+
512
+
513
+ #### UIToFD(filterData)
514
+
515
+ Generates a Filter Data Structure structure from UI Filter Data structure.
516
+
517
+
518
+
519
+
520
+ ##### Parameters
521
+
522
+ | Name | Type | Description | |
523
+ | ---- | ---- | ----------- | -------- |
524
+ | filterData | | The UI filter data object. | &nbsp; |
525
+
526
+
527
+
528
+
529
+ ##### Returns
530
+
531
+
532
+ - a Filter Data structure
533
+
534
+
535
+
536
+ #### UI21ToFD(uFilterData, version)
537
+
538
+ Builds the Fitler Data structure from UI filter data
539
+
540
+
541
+
542
+
543
+ ##### Parameters
544
+
545
+ | Name | Type | Description | |
546
+ | ---- | ---- | ----------- | -------- |
547
+ | uFilterData | | The UI filter Data object | &nbsp; |
548
+ | version | | the version of the structure | &nbsp; |
549
+
550
+
551
+
552
+
553
+ ##### Returns
554
+
555
+
556
+ -
557
+
558
+
559
+
560
+
561
+ ### dist/filters/adapters/UIToFlatUI.js
562
+
563
+
564
+ #### UIToFlatUI(filterData, datasetsInfo)
565
+
566
+ Generates a Flattened UI filter structure from UI Filter Data structure.
567
+
568
+
569
+
570
+
571
+ ##### Parameters
572
+
573
+ | Name | Type | Description | |
574
+ | ---- | ---- | ----------- | -------- |
575
+ | filterData | | The UI filter data object. | &nbsp; |
576
+ | datasetsInfo | | Collection of datasets information. Optional for updating the datasets info | &nbsp; |
577
+
578
+
579
+
580
+
581
+ ##### Returns
582
+
583
+
584
+ - a flattened UI filters array
585
+
586
+
587
+
588
+ #### UI21ToFlatUI(scopes)
589
+
590
+ Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
591
+
592
+
593
+
594
+
595
+ ##### Parameters
596
+
597
+ | Name | Type | Description | |
598
+ | ---- | ---- | ----------- | -------- |
599
+ | scopes | | The filter scope section | &nbsp; |
600
+
601
+
602
+
603
+
604
+ ##### Returns
605
+
606
+
607
+ - a flattened UI filters array
608
+
609
+
610
+
611
+
612
+ ### dist/filters/adapters/adaptFilterData.js
613
+
614
+
615
+ #### adaptFilterData(filterData, getUIFilterData, datasetsInfo)
616
+
617
+ Checks and adapts the v2.0 Filter Data Structure to the v2.1
618
+
619
+
620
+
621
+
622
+ ##### Parameters
623
+
624
+ | Name | Type | Description | |
625
+ | ---- | ---- | ----------- | -------- |
626
+ | filterData | | The filter data structure. Accepts both v2.1 or v2.0 | &nbsp; |
627
+ | getUIFilterData | | Flag to get a Filter Data (False) or the UI Filter Data (True) | &nbsp; |
628
+ | datasetsInfo | | Collection of datasets information. If getUIFilterData is true, the datasetsInfo should be mandatory | &nbsp; |
629
+
630
+
631
+
632
+
633
+ ##### Returns
634
+
635
+
636
+ - A new filter data structure v2.1
637
+
638
+
639
+
640
+
641
+ ### dist/filters/adapters/adaptDateGroupingProperty.js
642
+
643
+
644
+ #### adaptDateGroupingProperty(property)
645
+
646
+ [TODO: For 2022, eliminate this adapter]
647
+ Get the new property base on the old date grouping properties
648
+
649
+
650
+
651
+
652
+ ##### Parameters
653
+
654
+ | Name | Type | Description | |
655
+ | ---- | ---- | ----------- | -------- |
656
+ | property | | | &nbsp; |
657
+
658
+
659
+
660
+
661
+ ##### Returns
662
+
663
+
664
+ -
665
+
666
+
667
+
668
+
669
+ ### dist/filters/adapters/adaptFilterValues.js
670
+
671
+
672
+ #### adaptFilterValues(filter)
673
+
674
+ [TODO: For 2022, eliminate this adapter]
675
+ Gets an adapted filter value array. Validates the enabled property and sets
676
+
677
+
678
+
679
+
680
+ ##### Parameters
681
+
682
+ | Name | Type | Description | |
683
+ | ---- | ---- | ----------- | -------- |
684
+ | filter | | The filter | &nbsp; |
685
+
686
+
687
+
688
+
689
+ ##### Returns
690
+
691
+
692
+ - A new value array with the filled properties.
693
+
694
+
695
+
696
+
697
+ ### dist/filters/adapters/flatUIToFD.js
698
+
699
+
700
+ #### flatUIToFD(uFilters, version)
701
+
702
+ Generates a filter data structure from the flatttened UI filters.
703
+
704
+
705
+
706
+
707
+ ##### Parameters
708
+
709
+ | Name | Type | Description | |
710
+ | ---- | ---- | ----------- | -------- |
711
+ | uFilters | | Array of flattened filters from UI | &nbsp; |
712
+ | version | | Tag for the version of the filter data structure | &nbsp; |
713
+
714
+
715
+
716
+
717
+ ##### Returns
718
+
719
+
720
+ - a Filter Data.
721
+
722
+
723
+
724
+ #### buildScopes(fbFilters)
725
+
726
+ Gets an array of scopes structure for the filter data. The scopes is organized by scope types and scope IDs
727
+ Also, adds and organizes filters by datasets
728
+
729
+
730
+
731
+
732
+ ##### Parameters
733
+
734
+ | Name | Type | Description | |
735
+ | ---- | ---- | ----------- | -------- |
736
+ | fbFilters | | Array of flat filters from UI | &nbsp; |
737
+
738
+
739
+
740
+
741
+ ##### Returns
742
+
743
+
744
+ - an array of scopes structure.
745
+
746
+
747
+
748
+ #### buildScope(uFilter)
749
+
750
+ Gets an scope structure for the filter data
480
751
 
481
752
 
482
753
 
@@ -959,12 +1230,12 @@ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
959
1230
 
960
1231
 
961
1232
 
962
- ### dist/filters/helpers/getAvailableScopesIDsByConfig.js
1233
+ ### dist/filters/helpers/getAvailableScopes.js
963
1234
 
964
1235
 
965
- #### getAvailableScopesIDsByConfig(config)
1236
+ #### getAvailableScopes(config)
966
1237
 
967
- Gets the Scopes IDS for the Available Scope function by any config
1238
+ Gets Scopes/Scope IDs by given IDs
968
1239
 
969
1240
 
970
1241
 
@@ -973,7 +1244,7 @@ Gets the Scopes IDS for the Available Scope function by any config
973
1244
 
974
1245
  | Name | Type | Description | |
975
1246
  | ---- | ---- | ----------- | -------- |
976
- | config | | any config | &nbsp; |
1247
+ | config | | given Differnts IDs in order set a available scope | &nbsp; |
977
1248
 
978
1249
 
979
1250
 
@@ -981,17 +1252,17 @@ Gets the Scopes IDS for the Available Scope function by any config
981
1252
  ##### Returns
982
1253
 
983
1254
 
984
- - a Available Scope IDS config
1255
+ - a Scopes/Scope IDs array
985
1256
 
986
1257
 
987
1258
 
988
1259
 
989
- ### dist/filters/helpers/getAvailableScopes.js
1260
+ ### dist/filters/helpers/getAvailableScopesIDsByConfig.js
990
1261
 
991
1262
 
992
- #### getAvailableScopes(config)
1263
+ #### getAvailableScopesIDsByConfig(config)
993
1264
 
994
- Gets Scopes/Scope IDs by given IDs
1265
+ Gets the Scopes IDS for the Available Scope function by any config
995
1266
 
996
1267
 
997
1268
 
@@ -1000,7 +1271,7 @@ Gets Scopes/Scope IDs by given IDs
1000
1271
 
1001
1272
  | Name | Type | Description | |
1002
1273
  | ---- | ---- | ----------- | -------- |
1003
- | config | | given Differnts IDs in order set a available scope | &nbsp; |
1274
+ | config | | any config | &nbsp; |
1004
1275
 
1005
1276
 
1006
1277
 
@@ -1008,7 +1279,7 @@ Gets Scopes/Scope IDs by given IDs
1008
1279
  ##### Returns
1009
1280
 
1010
1281
 
1011
- - a Scopes/Scope IDs array
1282
+ - a Available Scope IDS config
1012
1283
 
1013
1284
 
1014
1285
 
@@ -1025,289 +1296,18 @@ Gets Scopes/Scope IDs by given IDs
1025
1296
 
1026
1297
  ##### Parameters
1027
1298
 
1028
- | Name | Type | Description | |
1029
- | ---- | ---- | ----------- | -------- |
1030
- | scopes | | the collection of Scopes/Scope IDs | &nbsp; |
1031
- | currentScope | | Current scope type | &nbsp; |
1032
-
1033
-
1034
-
1035
-
1036
- ##### Returns
1037
-
1038
-
1039
- - A new array of Scopes/Scope IDs
1040
-
1041
-
1042
-
1043
-
1044
- ### dist/dates/range/getDateRange.js
1045
-
1046
-
1047
- #### getDateRange(value, dateGroupLabel, withTime)
1048
-
1049
- Get date range object from a string date value
1050
-
1051
-
1052
-
1053
-
1054
- ##### Parameters
1055
-
1056
- | Name | Type | Description | |
1057
- | ---- | ---- | ----------- | -------- |
1058
- | value | `String` | string date value | &nbsp; |
1059
- | dateGroupLabel | `String` | could be 'YEAR', 'QUARTER', 'MONTH' or 'DAY'. Deafult is 'DAY' | &nbsp; |
1060
- | withTime | `Boolean` | determines if the date range will include time. Default is true | &nbsp; |
1061
-
1062
-
1063
-
1064
-
1065
- ##### Examples
1066
-
1067
- ```javascript
1068
- // 1) Year:
1069
- getDateRange('2020', 'YEAR');
1070
- // Will return:
1071
- {
1072
- from: '01/01/2020 00:00:00',
1073
- to: '12/31/2020 23:59:59'
1074
- }
1075
-
1076
- // 2) Quarter:
1077
- getDateRange('Q3 2020', 'QUARTER');
1078
- // Will return:
1079
- {
1080
- from: '07/01/2020 00:00:00',
1081
- to: '09/30/2020 23:59:59'
1082
- }
1083
-
1084
- // 3) Month:
1085
- getDateRange('Oct 2020', 'MONTH');
1086
- // Will return:
1087
- {
1088
- from: '10/01/2020 00:00:00',
1089
- to: '10/31/2020 23:59:59'
1090
- }
1091
- ```
1092
-
1093
-
1094
- ##### Returns
1095
-
1096
-
1097
- - `Object` an object with the date range with two string date properties: from and to
1098
-
1099
-
1100
-
1101
-
1102
- ### dist/dates/relative/Adapter.js
1103
-
1104
-
1105
- #### value()
1106
-
1107
- Resolves statement and returns statement value
1108
-
1109
-
1110
-
1111
-
1112
-
1113
-
1114
- ##### Returns
1115
-
1116
-
1117
- - `AbsoluteRange` `string`
1118
-
1119
-
1120
-
1121
- #### valueAsAnchor()
1122
-
1123
- Resolves statement as an anchor
1124
-
1125
-
1126
-
1127
-
1128
-
1129
-
1130
- ##### Returns
1131
-
1132
-
1133
- - `string`
1134
-
1135
-
1136
-
1137
- #### _statementToRange() *private method*
1138
-
1139
- Convert verbal statement to range value
1140
-
1141
-
1142
-
1143
-
1144
-
1145
-
1146
- ##### Returns
1147
-
1148
-
1149
- - `AbsoluteRange`
1150
-
1151
-
1152
-
1153
- #### _resolveAsThis() *private method*
1154
-
1155
- Apply 'this' cursor logic to statement
1156
-
1157
-
1158
-
1159
-
1160
-
1161
-
1162
- ##### Returns
1163
-
1164
-
1165
- - `AbsoluteStatement`
1166
-
1167
-
1168
-
1169
- #### _resolveAsTheLast() *private method*
1170
-
1171
- Apply 'the last' cursor logic to statement
1172
-
1173
-
1174
-
1175
-
1176
-
1177
-
1178
- ##### Returns
1179
-
1180
-
1181
- - `AbsoluteStatement`
1182
-
1183
-
1184
-
1185
- #### _resolveAsTheNext() *private method*
1186
-
1187
- Apply 'the next' cursor logic to statement
1188
-
1189
-
1190
-
1191
-
1192
-
1193
-
1194
- ##### Returns
1195
-
1196
-
1197
- - `AbsoluteStatement`
1198
-
1199
-
1200
-
1201
- #### replaceNowToken(value, now)
1202
-
1203
- Replace '@now' token inside a string
1204
-
1205
-
1206
-
1207
-
1208
- ##### Parameters
1209
-
1210
- | Name | Type | Description | |
1211
- | ---- | ---- | ----------- | -------- |
1212
- | value | `string` | | &nbsp; |
1213
- | now | `Date` | | &nbsp; |
1214
-
1215
-
1216
-
1217
-
1218
- ##### Returns
1219
-
1220
-
1221
- - `string`
1222
-
1223
-
1224
-
1225
- #### convertRelativeToAbsolute(args)
1226
-
1227
- Returns a range object (date) from a group of statement params
1228
-
1229
-
1230
-
1231
-
1232
- ##### Parameters
1233
-
1234
- | Name | Type | Description | |
1235
- | ---- | ---- | ----------- | -------- |
1236
- | args | `RelativeToAbsoluteStruct` | | &nbsp; |
1237
-
1238
-
1239
-
1240
-
1241
- ##### Examples
1242
-
1243
- ```javascript
1244
- pivot = '2021-03-03T12:30:40'
1245
- unit = month
1246
- steps = 2
1247
- setTo = END
1248
- resolverAsCalendar: true
1249
- => Returns '2021-05-31T23:59:59'
1250
- ```
1251
- ```javascript
1252
- pivot = '2021-03-03T12:30:40'
1253
- unit = month
1254
- steps = -2
1255
- setTo = START
1256
- resolverAsCalendar: false
1257
- => Returns '2021-01-03T00:00:00'
1258
- ```
1259
-
1260
-
1261
- ##### Returns
1262
-
1263
-
1264
- - `string`
1265
-
1266
-
1267
-
1268
-
1269
- ### dist/dates/relative/relative.js
1270
-
1271
-
1272
- #### resolveRelative(statements, clock)
1273
-
1274
- Resolve a list of relative statements according to operator
1275
-
1276
-
1277
-
1278
-
1279
- ##### Parameters
1280
-
1281
- | Name | Type | Description | |
1282
- | ---- | ---- | ----------- | -------- |
1283
- | statements | `Array.<RelativeStatement>` `Array.<string>` | - Raw statements/values | &nbsp; |
1284
- | clock | `Date` | - Clock/time reference for relative date resolution | &nbsp; |
1285
-
1286
-
1287
-
1288
-
1289
- ##### Examples
1290
-
1291
- ```javascript
1292
- Input:
1293
- {
1294
- "cursor": "the_next",
1295
- "unit": "year",
1296
- "number": 1,
1297
- "includeCurrent": false,
1298
- "isCalendarDate": false,
1299
- "anchor": "03/05/2021"
1300
- }
1299
+ | Name | Type | Description | |
1300
+ | ---- | ---- | ----------- | -------- |
1301
+ | scopes | | the collection of Scopes/Scope IDs | &nbsp; |
1302
+ | currentScope | | Current scope type | &nbsp; |
1303
+
1301
1304
 
1302
- Output:
1303
- { gte: "03/06/2021 00:00:00", lte: "03/05/2022 23:59:59" }
1304
- ```
1305
1305
 
1306
1306
 
1307
1307
  ##### Returns
1308
1308
 
1309
1309
 
1310
- - `Array.&lt;AbsoluteRange&gt;` `Array.&lt;string&gt;`
1310
+ - A new array of Scopes/Scope IDs
1311
1311
 
1312
1312
 
1313
1313
 
@@ -1455,12 +1455,12 @@ Gets the last index from the array by a callback condition
1455
1455
 
1456
1456
 
1457
1457
 
1458
- ### dist/general/function/debounce.js
1458
+ ### dist/general/function/throttled.js
1459
1459
 
1460
1460
 
1461
- #### debounce(fn, time)
1461
+ #### throttled(fn, time)
1462
1462
 
1463
- Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last time the debounced function was invoked.
1463
+ Make sure to only invokes _fn_ at most once per every _time_ milliseconds
1464
1464
 
1465
1465
 
1466
1466
 
@@ -1478,17 +1478,17 @@ Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last
1478
1478
  ##### Returns
1479
1479
 
1480
1480
 
1481
- - `Function` debounced functions
1481
+ - `Function` throttled function
1482
1482
 
1483
1483
 
1484
1484
 
1485
1485
 
1486
- ### dist/general/function/throttled.js
1486
+ ### dist/general/function/debounce.js
1487
1487
 
1488
1488
 
1489
- #### throttled(fn, time)
1489
+ #### debounce(fn, time)
1490
1490
 
1491
- Make sure to only invokes _fn_ at most once per every _time_ milliseconds
1491
+ Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last time the debounced function was invoked.
1492
1492
 
1493
1493
 
1494
1494
 
@@ -1506,7 +1506,7 @@ Make sure to only invokes _fn_ at most once per every _time_ milliseconds
1506
1506
  ##### Returns
1507
1507
 
1508
1508
 
1509
- - `Function` throttled function
1509
+ - `Function` debounced functions
1510
1510
 
1511
1511
 
1512
1512
 
@@ -1623,12 +1623,13 @@ return a Promise that is resolved when the script is loaded
1623
1623
 
1624
1624
 
1625
1625
 
1626
- ### dist/general/mix/isEmpty.js
1626
+ ### dist/general/mix/isNull.js
1627
1627
 
1628
1628
 
1629
- #### isEmpty(variable, includeFalsy)
1629
+ #### isNull(arg)
1630
1630
 
1631
- Validates if the given argument is empty
1631
+ return if a given variable is either `null` or `undefined`
1632
+ useful to avoid falsify validating Number Zero (0)
1632
1633
 
1633
1634
 
1634
1635
 
@@ -1637,8 +1638,7 @@ Validates if the given argument is empty
1637
1638
 
1638
1639
  | Name | Type | Description | |
1639
1640
  | ---- | ---- | ----------- | -------- |
1640
- | variable | | the given variable | &nbsp; |
1641
- | includeFalsy | | flag to determine include the falsy variables into the validation | &nbsp; |
1641
+ | arg | `any` | | &nbsp; |
1642
1642
 
1643
1643
 
1644
1644
 
@@ -1646,18 +1646,17 @@ Validates if the given argument is empty
1646
1646
  ##### Returns
1647
1647
 
1648
1648
 
1649
- - true: the given argument is empty; false: is not.
1649
+ - `Boolean`
1650
1650
 
1651
1651
 
1652
1652
 
1653
1653
 
1654
- ### dist/general/mix/isNull.js
1654
+ ### dist/general/mix/isEmpty.js
1655
1655
 
1656
1656
 
1657
- #### isNull(arg)
1657
+ #### isEmpty(variable, includeFalsy)
1658
1658
 
1659
- return if a given variable is either `null` or `undefined`
1660
- useful to avoid falsify validating Number Zero (0)
1659
+ Validates if the given argument is empty
1661
1660
 
1662
1661
 
1663
1662
 
@@ -1666,7 +1665,8 @@ useful to avoid falsify validating Number Zero (0)
1666
1665
 
1667
1666
  | Name | Type | Description | |
1668
1667
  | ---- | ---- | ----------- | -------- |
1669
- | arg | `any` | | &nbsp; |
1668
+ | variable | | the given variable | &nbsp; |
1669
+ | includeFalsy | | flag to determine include the falsy variables into the validation | &nbsp; |
1670
1670
 
1671
1671
 
1672
1672
 
@@ -1674,7 +1674,7 @@ useful to avoid falsify validating Number Zero (0)
1674
1674
  ##### Returns
1675
1675
 
1676
1676
 
1677
- - `Boolean`
1677
+ - true: the given argument is empty; false: is not.
1678
1678
 
1679
1679
 
1680
1680
 
@@ -2347,12 +2347,12 @@ try to find this string as a variable on Windows object
2347
2347
 
2348
2348
 
2349
2349
 
2350
- ### dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js
2350
+ ### dist/dates/relative/helpers/formatStatement.js
2351
2351
 
2352
2352
 
2353
- #### getFilterBuilderGeneralConfig(config)
2353
+ #### formatStatement(statement)
2354
2354
 
2355
- Returns a filter builder config object by a any given config
2355
+ Build a proper relative date statement type
2356
2356
 
2357
2357
 
2358
2358
 
@@ -2361,7 +2361,7 @@ Returns a filter builder config object by a any given config
2361
2361
 
2362
2362
  | Name | Type | Description | |
2363
2363
  | ---- | ---- | ----------- | -------- |
2364
- | config | | any config object | &nbsp; |
2364
+ | statement | `RelativeStatement` | | &nbsp; |
2365
2365
 
2366
2366
 
2367
2367
 
@@ -2369,7 +2369,62 @@ Returns a filter builder config object by a any given config
2369
2369
  ##### Returns
2370
2370
 
2371
2371
 
2372
- - The filter builder config object
2372
+ - `RelativeStatement`
2373
+
2374
+
2375
+
2376
+
2377
+ ### dist/dates/relative/helpers/getStatementCase.js
2378
+
2379
+
2380
+ #### getStatementCase(includeCurrent, isCalendarDate)
2381
+
2382
+ Returns a number/constant that identifies a relative date case
2383
+
2384
+
2385
+
2386
+
2387
+ ##### Parameters
2388
+
2389
+ | Name | Type | Description | |
2390
+ | ---- | ---- | ----------- | -------- |
2391
+ | includeCurrent | `boolean` | | &nbsp; |
2392
+ | isCalendarDate | `boolean` | | &nbsp; |
2393
+
2394
+
2395
+
2396
+
2397
+ ##### Returns
2398
+
2399
+
2400
+ - `number`
2401
+
2402
+
2403
+
2404
+
2405
+ ### dist/dates/relative/helpers/parseDate.js
2406
+
2407
+
2408
+ #### parseDate(date)
2409
+
2410
+ Parses a string date and returns a dayjs date
2411
+
2412
+
2413
+
2414
+
2415
+ ##### Parameters
2416
+
2417
+ | Name | Type | Description | |
2418
+ | ---- | ---- | ----------- | -------- |
2419
+ | date | `string` `Dayjs` `Date` | | &nbsp; |
2420
+
2421
+
2422
+
2423
+
2424
+ ##### Returns
2425
+
2426
+
2427
+ - `Dayjs` A dayjs date
2373
2428
 
2374
2429
 
2375
2430
 
@@ -2670,12 +2725,12 @@ Gets filters from the logic by the scopes hierarchy.
2670
2725
 
2671
2726
 
2672
2727
 
2673
- ### dist/filters/helpers/common/areFiltersEquals.js
2728
+ ### dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js
2674
2729
 
2675
2730
 
2676
- #### areFiltersEquals(filter1, filter2)
2731
+ #### getFilterBuilderGeneralConfig(config)
2677
2732
 
2678
- Validates if both filters are the same
2733
+ Returns a filter builder config object by a any given config
2679
2734
 
2680
2735
 
2681
2736
 
@@ -2684,8 +2739,7 @@ Validates if both filters are the same
2684
2739
 
2685
2740
  | Name | Type | Description | |
2686
2741
  | ---- | ---- | ----------- | -------- |
2687
- | filter1 | | filter 1 | &nbsp; |
2688
- | filter2 | | filter 2 | &nbsp; |
2742
+ | config | | any config object | &nbsp; |
2689
2743
 
2690
2744
 
2691
2745
 
@@ -2693,17 +2747,17 @@ Validates if both filters are the same
2693
2747
  ##### Returns
2694
2748
 
2695
2749
 
2696
- - true: the filters are equal; false: the filters are NOT equal
2750
+ - The filter builder config object
2697
2751
 
2698
2752
 
2699
2753
 
2700
2754
 
2701
- ### dist/filters/helpers/common/excludeFiltersByAggregateColumn.js
2755
+ ### dist/filters/helpers/common/areFiltersEquals.js
2702
2756
 
2703
2757
 
2704
- #### excludeFiltersByAggregateColumn(filterData)
2758
+ #### areFiltersEquals(filter1, filter2)
2705
2759
 
2706
- Excludes Aggregate Filters in the Filter Data. Excluding filters when the column.aggregate is included.
2760
+ Validates if both filters are the same
2707
2761
 
2708
2762
 
2709
2763
 
@@ -2712,7 +2766,8 @@ Excludes Aggregate Filters in the Filter Data. Excluding filters when the column
2712
2766
 
2713
2767
  | Name | Type | Description | |
2714
2768
  | ---- | ---- | ----------- | -------- |
2715
- | filterData | | The filter data object | &nbsp; |
2769
+ | filter1 | | filter 1 | &nbsp; |
2770
+ | filter2 | | filter 2 | &nbsp; |
2716
2771
 
2717
2772
 
2718
2773
 
@@ -2720,7 +2775,7 @@ Excludes Aggregate Filters in the Filter Data. Excluding filters when the column
2720
2775
  ##### Returns
2721
2776
 
2722
2777
 
2723
- - The new filter data object that were excluded the aggregate filters
2778
+ - true: the filters are equal; false: the filters are NOT equal
2724
2779
 
2725
2780
 
2726
2781
 
@@ -2762,6 +2817,33 @@ The validation to filter the stored filter is depending on:
2762
2817
 
2763
2818
 
2764
2819
 
2820
+ ### dist/filters/helpers/common/excludeFiltersByAggregateColumn.js
2821
+
2822
+
2823
+ #### excludeFiltersByAggregateColumn(filterData)
2824
+
2825
+ Excludes Aggregate Filters in the Filter Data. Excluding filters when the column.aggregate is included.
2826
+
2827
+
2828
+
2829
+
2830
+ ##### Parameters
2831
+
2832
+ | Name | Type | Description | |
2833
+ | ---- | ---- | ----------- | -------- |
2834
+ | filterData | | The filter data object | &nbsp; |
2835
+
2836
+
2837
+
2838
+
2839
+ ##### Returns
2840
+
2841
+
2842
+ - The new filter data object that were excluded the aggregate filters
2843
+
2844
+
2845
+
2846
+
2765
2847
  ### dist/filters/helpers/common/excludeFiltersByScopes.js
2766
2848
 
2767
2849
 
@@ -3604,10 +3686,10 @@ Gets output format object from Datasets by the given column. Item of the dataset
3604
3686
 
3605
3687
 
3606
3688
 
3607
- ### dist/filters/helpers/ui/getUIFlatFiltersByParams.js
3689
+ ### dist/filters/helpers/ui/getUIFlatFilterByParams.js
3608
3690
 
3609
3691
 
3610
- #### getUIFlatFiltersByParams()
3692
+ #### getUIFlatFilterByParams()
3611
3693
 
3612
3694
  Gets a filter from the given Flattened UI Filters by given params. Return a index of the array or an object
3613
3695
  The validation to filter the stored filter is depending on:
@@ -3618,7 +3700,6 @@ The validation to filter the stored filter is depending on:
3618
3700
  - Panel ID
3619
3701
  - Validator type
3620
3702
  - Property type
3621
- - Enabled flags
3622
3703
 
3623
3704
 
3624
3705
 
@@ -3633,10 +3714,10 @@ The validation to filter the stored filter is depending on:
3633
3714
 
3634
3715
 
3635
3716
 
3636
- ### dist/filters/helpers/ui/getUIFlatFilterByParams.js
3717
+ ### dist/filters/helpers/ui/getUIFlatFiltersByParams.js
3637
3718
 
3638
3719
 
3639
- #### getUIFlatFilterByParams()
3720
+ #### getUIFlatFiltersByParams()
3640
3721
 
3641
3722
  Gets a filter from the given Flattened UI Filters by given params. Return a index of the array or an object
3642
3723
  The validation to filter the stored filter is depending on:
@@ -3647,6 +3728,7 @@ The validation to filter the stored filter is depending on:
3647
3728
  - Panel ID
3648
3729
  - Validator type
3649
3730
  - Property type
3731
+ - Enabled flags
3650
3732
 
3651
3733
 
3652
3734
 
@@ -3746,86 +3828,4 @@ Resolves conditions between UI flattened filter and given parameters
3746
3828
 
3747
3829
 
3748
3830
 
3749
- ### dist/dates/relative/helpers/formatStatement.js
3750
-
3751
-
3752
- #### formatStatement(statement)
3753
-
3754
- Build a proper relative date statement type
3755
-
3756
-
3757
-
3758
-
3759
- ##### Parameters
3760
-
3761
- | Name | Type | Description | |
3762
- | ---- | ---- | ----------- | -------- |
3763
- | statement | `RelativeStatement` | | &nbsp; |
3764
-
3765
-
3766
-
3767
-
3768
- ##### Returns
3769
-
3770
-
3771
- - `RelativeStatement`
3772
-
3773
-
3774
-
3775
-
3776
- ### dist/dates/relative/helpers/getStatementCase.js
3777
-
3778
-
3779
- #### getStatementCase(includeCurrent, isCalendarDate)
3780
-
3781
- Returns a number/constant that identifies a relative date case
3782
-
3783
-
3784
-
3785
-
3786
- ##### Parameters
3787
-
3788
- | Name | Type | Description | |
3789
- | ---- | ---- | ----------- | -------- |
3790
- | includeCurrent | `boolean` | | &nbsp; |
3791
- | isCalendarDate | `boolean` | | &nbsp; |
3792
-
3793
-
3794
-
3795
-
3796
- ##### Returns
3797
-
3798
-
3799
- - `number`
3800
-
3801
-
3802
-
3803
-
3804
- ### dist/dates/relative/helpers/parseDate.js
3805
-
3806
-
3807
- #### parseDate(date)
3808
-
3809
- Parses a string date and returns a dayjs date
3810
-
3811
-
3812
-
3813
-
3814
- ##### Parameters
3815
-
3816
- | Name | Type | Description | |
3817
- | ---- | ---- | ----------- | -------- |
3818
- | date | `string` `Dayjs` `Date` | | &nbsp; |
3819
-
3820
-
3821
-
3822
-
3823
- ##### Returns
3824
-
3825
-
3826
- - `Dayjs` A dayjs date
3827
-
3828
-
3829
-
3830
-
3831
3831
  *Documentation generated with [doxdox](https://github.com/neogeek/doxdox).*