@qrvey/utils 1.2.9-10 → 1.2.9-14

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.
Files changed (134) hide show
  1. package/README.md +703 -646
  2. package/dist/charts/constants/AGGREGATE_LABEL.d.ts +1 -1
  3. package/dist/charts/constants/AGGREGATE_LABEL.js +1 -1
  4. package/dist/cjs/charts/constants/AGGREGATE_LABEL.d.ts +1 -1
  5. package/dist/cjs/charts/constants/AGGREGATE_LABEL.js +1 -1
  6. package/dist/cjs/filters/helpers/ui/getQrveyIdsByUIFilters.d.ts +7 -0
  7. package/dist/cjs/filters/helpers/ui/getQrveyIdsByUIFilters.js +24 -0
  8. package/dist/cjs/filters/helpers/ui/getUIValues.js +11 -5
  9. package/dist/cjs/filters/helpers/ui/getUpdatedUIFilters.d.ts +9 -0
  10. package/dist/cjs/filters/helpers/ui/getUpdatedUIFilters.js +36 -0
  11. package/dist/cjs/filters/helpers/ui/index.d.ts +2 -0
  12. package/dist/cjs/filters/helpers/ui/index.js +2 -0
  13. package/dist/cjs/filters/interfaces/panel/IFPSettingsGeneral.d.ts +2 -1
  14. package/dist/cjs/globalization/interfaces/IResourceI18n.d.ts +2 -0
  15. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderRefernceLine.d.ts +1 -0
  16. package/dist/cjs/globalization/interfaces/dashboard/II18nDashboard.d.ts +2 -0
  17. package/dist/cjs/globalization/interfaces/dashboard/II18nDashboardMessages.d.ts +6 -0
  18. package/dist/cjs/globalization/interfaces/dashboard/II18nDashboardMessages.js +2 -0
  19. package/dist/cjs/globalization/interfaces/dashboard/index.d.ts +1 -0
  20. package/dist/cjs/globalization/interfaces/dashboard/index.js +1 -0
  21. package/dist/cjs/globalization/interfaces/filters/II18nRelativeContainer.d.ts +1 -0
  22. package/dist/cjs/globalization/interfaces/index.d.ts +4 -1
  23. package/dist/cjs/globalization/interfaces/index.js +4 -1
  24. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemes.d.ts +13 -0
  25. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemes.js +2 -0
  26. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.d.ts +6 -0
  27. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.js +2 -0
  28. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMenu.d.ts +6 -0
  29. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMenu.js +2 -0
  30. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMessages.d.ts +9 -0
  31. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMessages.js +2 -0
  32. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +27 -0
  33. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.js +2 -0
  34. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTooltips.d.ts +3 -0
  35. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTooltips.js +2 -0
  36. package/dist/cjs/globalization/interfaces/style_themes/index.d.ts +6 -0
  37. package/dist/cjs/globalization/interfaces/style_themes/index.js +18 -0
  38. package/dist/cjs/globalization/interfaces/table_charts/II18nTableChartsPagination.d.ts +1 -0
  39. package/dist/cjs/globalization/labels/I18N_DEFAULT.js +2 -0
  40. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +2 -1
  41. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +1 -1
  42. package/dist/cjs/globalization/labels/dashboard/I18N_DASHBOARD.js +6 -0
  43. package/dist/cjs/globalization/labels/filters/I18N_RELATIVE_CONTAINER.js +1 -0
  44. package/dist/cjs/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +2 -2
  45. package/dist/cjs/globalization/labels/index.d.ts +5 -3
  46. package/dist/cjs/globalization/labels/index.js +5 -3
  47. package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.d.ts +2 -0
  48. package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.js +57 -0
  49. package/dist/cjs/globalization/labels/style_themes/index.d.ts +1 -0
  50. package/dist/cjs/globalization/labels/style_themes/index.js +13 -0
  51. package/dist/cjs/globalization/labels/table_charts/I18N_TABLE_CHARTS.js +1 -0
  52. package/dist/cjs/services/api/getAllDatasets.api.d.ts +2 -1
  53. package/dist/cjs/services/api/getAllDatasets.api.js +2 -1
  54. package/dist/filters/helpers/ui/getQrveyIdsByUIFilters.d.ts +7 -0
  55. package/dist/filters/helpers/ui/getQrveyIdsByUIFilters.js +20 -0
  56. package/dist/filters/helpers/ui/getUIValues.js +11 -5
  57. package/dist/filters/helpers/ui/getUpdatedUIFilters.d.ts +9 -0
  58. package/dist/filters/helpers/ui/getUpdatedUIFilters.js +32 -0
  59. package/dist/filters/helpers/ui/index.d.ts +2 -0
  60. package/dist/filters/helpers/ui/index.js +2 -0
  61. package/dist/filters/interfaces/panel/IFPSettingsGeneral.d.ts +2 -1
  62. package/dist/globalization/interfaces/IResourceI18n.d.ts +2 -0
  63. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderRefernceLine.d.ts +1 -0
  64. package/dist/globalization/interfaces/dashboard/II18nDashboard.d.ts +2 -0
  65. package/dist/globalization/interfaces/dashboard/II18nDashboardMessages.d.ts +6 -0
  66. package/dist/globalization/interfaces/dashboard/II18nDashboardMessages.js +1 -0
  67. package/dist/globalization/interfaces/dashboard/index.d.ts +1 -0
  68. package/dist/globalization/interfaces/dashboard/index.js +1 -0
  69. package/dist/globalization/interfaces/filters/II18nRelativeContainer.d.ts +1 -0
  70. package/dist/globalization/interfaces/index.d.ts +4 -1
  71. package/dist/globalization/interfaces/index.js +4 -1
  72. package/dist/globalization/interfaces/style_themes/II18nStyleThemes.d.ts +13 -0
  73. package/dist/globalization/interfaces/style_themes/II18nStyleThemes.js +1 -0
  74. package/dist/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.d.ts +6 -0
  75. package/dist/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.js +1 -0
  76. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMenu.d.ts +6 -0
  77. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMenu.js +1 -0
  78. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMessages.d.ts +9 -0
  79. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMessages.js +1 -0
  80. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +27 -0
  81. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.js +1 -0
  82. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTooltips.d.ts +3 -0
  83. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTooltips.js +1 -0
  84. package/dist/globalization/interfaces/style_themes/index.d.ts +6 -0
  85. package/dist/globalization/interfaces/style_themes/index.js +6 -0
  86. package/dist/globalization/interfaces/table_charts/II18nTableChartsPagination.d.ts +1 -0
  87. package/dist/globalization/labels/I18N_DEFAULT.js +2 -0
  88. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +2 -1
  89. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +1 -1
  90. package/dist/globalization/labels/dashboard/I18N_DASHBOARD.js +6 -0
  91. package/dist/globalization/labels/filters/I18N_RELATIVE_CONTAINER.js +1 -0
  92. package/dist/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.js +2 -2
  93. package/dist/globalization/labels/index.d.ts +5 -3
  94. package/dist/globalization/labels/index.js +5 -3
  95. package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.d.ts +2 -0
  96. package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.js +54 -0
  97. package/dist/globalization/labels/style_themes/index.d.ts +1 -0
  98. package/dist/globalization/labels/style_themes/index.js +1 -0
  99. package/dist/globalization/labels/table_charts/I18N_TABLE_CHARTS.js +1 -0
  100. package/dist/services/api/getAllDatasets.api.d.ts +2 -1
  101. package/dist/services/api/getAllDatasets.api.js +2 -1
  102. package/package.json +1 -1
  103. package/src/charts/constants/AGGREGATE_LABEL.ts +1 -1
  104. package/src/filters/helpers/ui/getQrveyIdsByUIFilters.ts +22 -0
  105. package/src/filters/helpers/ui/getUIValues.ts +12 -7
  106. package/src/filters/helpers/ui/getUpdatedUIFilters.ts +34 -0
  107. package/src/filters/helpers/ui/index.ts +2 -0
  108. package/src/filters/interfaces/panel/IFPSettingsGeneral.ts +2 -1
  109. package/src/globalization/interfaces/IResourceI18n.ts +2 -0
  110. package/src/globalization/interfaces/chart_builder/II18nChartBuilderRefernceLine.ts +1 -0
  111. package/src/globalization/interfaces/dashboard/II18nDashboard.ts +2 -0
  112. package/src/globalization/interfaces/dashboard/II18nDashboardMessages.ts +6 -0
  113. package/src/globalization/interfaces/dashboard/index.ts +1 -0
  114. package/src/globalization/interfaces/filters/II18nRelativeContainer.ts +1 -0
  115. package/src/globalization/interfaces/index.ts +4 -1
  116. package/src/globalization/interfaces/style_themes/II18nStyleThemes.ts +14 -0
  117. package/src/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.ts +6 -0
  118. package/src/globalization/interfaces/style_themes/II18nStyleThemesMenu.ts +6 -0
  119. package/src/globalization/interfaces/style_themes/II18nStyleThemesMessages.ts +9 -0
  120. package/src/globalization/interfaces/style_themes/II18nStyleThemesTheme.ts +27 -0
  121. package/src/globalization/interfaces/style_themes/II18nStyleThemesTooltips.ts +3 -0
  122. package/src/globalization/interfaces/style_themes/index.ts +6 -0
  123. package/src/globalization/interfaces/table_charts/II18nTableChartsPagination.ts +1 -0
  124. package/src/globalization/labels/I18N_DEFAULT.ts +2 -0
  125. package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.ts +2 -1
  126. package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.ts +1 -1
  127. package/src/globalization/labels/dashboard/I18N_DASHBOARD.ts +6 -0
  128. package/src/globalization/labels/filters/I18N_RELATIVE_CONTAINER.ts +1 -0
  129. package/src/globalization/labels/formula_builder/I18N_FORMULA_BUILDER.ts +2 -2
  130. package/src/globalization/labels/index.ts +5 -3
  131. package/src/globalization/labels/style_themes/I18N_STYLE_THEMES.ts +56 -0
  132. package/src/globalization/labels/style_themes/index.ts +1 -0
  133. package/src/globalization/labels/table_charts/I18N_TABLE_CHARTS.ts +1 -0
  134. package/src/services/api/getAllDatasets.api.ts +3 -2
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.2.9-10*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.2.9-14*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -220,6 +220,64 @@ Transforms String Date from a [Year] format to Date object.
220
220
 
221
221
 
222
222
 
223
+ ### dist/dates/range/getDateRange.js
224
+
225
+
226
+ #### getDateRange(value, dateGroupLabel, withTime)
227
+
228
+ Get date range object from a string date value
229
+
230
+
231
+
232
+
233
+ ##### Parameters
234
+
235
+ | Name | Type | Description | |
236
+ | ---- | ---- | ----------- | -------- |
237
+ | value | `String` | string date value |   |
238
+ | dateGroupLabel | `String` | could be 'YEAR', 'QUARTER', 'MONTH' or 'DAY'. Deafult is 'DAY' |   |
239
+ | withTime | `Boolean` | determines if the date range will include time. Default is true |   |
240
+
241
+
242
+
243
+
244
+ ##### Examples
245
+
246
+ ```javascript
247
+ // 1) Year:
248
+ getDateRange('2020', 'YEAR');
249
+ // Will return:
250
+ {
251
+ from: '01/01/2020 00:00:00',
252
+ to: '12/31/2020 23:59:59'
253
+ }
254
+
255
+ // 2) Quarter:
256
+ getDateRange('Q3 2020', 'QUARTER');
257
+ // Will return:
258
+ {
259
+ from: '07/01/2020 00:00:00',
260
+ to: '09/30/2020 23:59:59'
261
+ }
262
+
263
+ // 3) Month:
264
+ getDateRange('Oct 2020', 'MONTH');
265
+ // Will return:
266
+ {
267
+ from: '10/01/2020 00:00:00',
268
+ to: '10/31/2020 23:59:59'
269
+ }
270
+ ```
271
+
272
+
273
+ ##### Returns
274
+
275
+
276
+ - `Object` an object with the date range with two string date properties: from and to
277
+
278
+
279
+
280
+
223
281
  ### dist/dates/helpers/getDateByDateFormat.js
224
282
 
225
283
 
@@ -417,64 +475,6 @@ Validates the given string as Date by its date format.
417
475
 
418
476
 
419
477
 
420
- ### dist/dates/range/getDateRange.js
421
-
422
-
423
- #### getDateRange(value, dateGroupLabel, withTime)
424
-
425
- Get date range object from a string date value
426
-
427
-
428
-
429
-
430
- ##### Parameters
431
-
432
- | Name | Type | Description | |
433
- | ---- | ---- | ----------- | -------- |
434
- | value | `String` | string date value |   |
435
- | dateGroupLabel | `String` | could be 'YEAR', 'QUARTER', 'MONTH' or 'DAY'. Deafult is 'DAY' |   |
436
- | withTime | `Boolean` | determines if the date range will include time. Default is true |   |
437
-
438
-
439
-
440
-
441
- ##### Examples
442
-
443
- ```javascript
444
- // 1) Year:
445
- getDateRange('2020', 'YEAR');
446
- // Will return:
447
- {
448
- from: '01/01/2020 00:00:00',
449
- to: '12/31/2020 23:59:59'
450
- }
451
-
452
- // 2) Quarter:
453
- getDateRange('Q3 2020', 'QUARTER');
454
- // Will return:
455
- {
456
- from: '07/01/2020 00:00:00',
457
- to: '09/30/2020 23:59:59'
458
- }
459
-
460
- // 3) Month:
461
- getDateRange('Oct 2020', 'MONTH');
462
- // Will return:
463
- {
464
- from: '10/01/2020 00:00:00',
465
- to: '10/31/2020 23:59:59'
466
- }
467
- ```
468
-
469
-
470
- ##### Returns
471
-
472
-
473
- - `Object` an object with the date range with two string date properties: from and to
474
-
475
-
476
-
477
-
478
478
  ### dist/dates/relative/Adapter.js
479
479
 
480
480
 
@@ -688,12 +688,12 @@ Output:
688
688
 
689
689
 
690
690
 
691
- ### dist/filters/adapters/FDToFlatUI.js
691
+ ### dist/general/array/delete.js
692
692
 
693
693
 
694
- #### FDToFlatUI(filterData, datasetsInfo)
694
+ #### ArrayDelete(array, index)
695
695
 
696
- Generates a Flattened UI filter structure from Filter Data structure.
696
+ Inmutable Array Item deletion
697
697
 
698
698
 
699
699
 
@@ -702,8 +702,8 @@ Generates a Flattened UI filter structure from Filter Data structure.
702
702
 
703
703
  | Name | Type | Description | |
704
704
  | ---- | ---- | ----------- | -------- |
705
- | filterData | | The filter data object. |   |
706
- | datasetsInfo | | Collection of datasets information |   |
705
+ | array | `Array` | a collection of items to delete |   |
706
+ | index | `Number` | the position of the item to delete |   |
707
707
 
708
708
 
709
709
 
@@ -711,13 +711,20 @@ Generates a Flattened UI filter structure from Filter Data structure.
711
711
  ##### Returns
712
712
 
713
713
 
714
- - a flattened UI filters array
714
+ - a new Array or the given parameter when is empty or not an array
715
715
 
716
716
 
717
717
 
718
- #### FD21ToFlatUI(scopes, datasetsInfo)
719
718
 
720
- Generates a Filter Builder Structure from the Filter Data structure v2.1
719
+ ### dist/general/array/filterNestedTree.js
720
+
721
+
722
+ #### filterNestedTree(arr, childArrKey, condition)
723
+
724
+ Filters a nested tree array by a custom condition on the last child node
725
+ - If the given arguments are not valid, the function returns the first argument.
726
+ - If the childArrKey is not matched in the object, the condition tries to resolve the filter anyway and returns an empty array.
727
+ - If the condition is not fulfilled, the function returns a filtered array, probably a empty array inside of the child array
721
728
 
722
729
 
723
730
 
@@ -726,8 +733,9 @@ Generates a Filter Builder Structure from the Filter Data structure v2.1
726
733
 
727
734
  | Name | Type | Description | |
728
735
  | ---- | ---- | ----------- | -------- |
729
- | scopes | | The filter scope section |   |
730
- | datasetsInfo | | Collection of datasets information |   |
736
+ | arr | | nested tree array |   |
737
+ | childArrKey | | property representing the children array on the nested tree |   |
738
+ | condition | | function callback that determines if the filter is applied on the last child node of the nested tree |   |
731
739
 
732
740
 
733
741
 
@@ -735,17 +743,17 @@ Generates a Filter Builder Structure from the Filter Data structure v2.1
735
743
  ##### Returns
736
744
 
737
745
 
738
- - a flattened UI filters array
746
+ - array filtered
739
747
 
740
748
 
741
749
 
742
750
 
743
- ### dist/filters/adapters/FDToLogic.js
751
+ ### dist/general/array/flattenDeep.js
744
752
 
745
753
 
746
- #### FDToLogic(filterData)
754
+ #### flattenDeep(arr)
747
755
 
748
- Generates a Filter Logic structure from Filter Data structure.
756
+ Flat deeply an array
749
757
 
750
758
 
751
759
 
@@ -754,7 +762,7 @@ Generates a Filter Logic structure from Filter Data structure.
754
762
 
755
763
  | Name | Type | Description | |
756
764
  | ---- | ---- | ----------- | -------- |
757
- | filterData | | The filter data object. |   |
765
+ | arr | | Array to flat deeply |   |
758
766
 
759
767
 
760
768
 
@@ -762,13 +770,17 @@ Generates a Filter Logic structure from Filter Data structure.
762
770
  ##### Returns
763
771
 
764
772
 
765
- - a filter logic array
773
+ - flatten array
766
774
 
767
775
 
768
776
 
769
- #### getLogicBodyFromFD21(filterData)
770
777
 
771
- Gets the logic body
778
+ ### dist/general/array/getFirstIndexFromArray.js
779
+
780
+
781
+ #### getFirstIndexFromArray(array, callback)
782
+
783
+ Gets the first index from the array by a callback condition
772
784
 
773
785
 
774
786
 
@@ -777,7 +789,8 @@ Gets the logic body
777
789
 
778
790
  | Name | Type | Description | |
779
791
  | ---- | ---- | ----------- | -------- |
780
- | filterData | | The filter data object |   |
792
+ | array | | |   |
793
+ | callback | | function callback |   |
781
794
 
782
795
 
783
796
 
@@ -785,17 +798,17 @@ Gets the logic body
785
798
  ##### Returns
786
799
 
787
800
 
788
- - a filter logic array
801
+ - the first index of the array. -1 when the condition is not satisfied
789
802
 
790
803
 
791
804
 
792
805
 
793
- ### dist/filters/adapters/FDToUI.js
806
+ ### dist/general/array/getLastIndexFromArray.js
794
807
 
795
808
 
796
- #### FDToUI(filterData, datasetsInfo)
809
+ #### getLastIndexFromArray(array, callback)
797
810
 
798
- Generates a UI filter structure from Filter Data structure.
811
+ Gets the last index from the array by a callback condition
799
812
 
800
813
 
801
814
 
@@ -804,8 +817,8 @@ Generates a UI filter structure from Filter Data structure.
804
817
 
805
818
  | Name | Type | Description | |
806
819
  | ---- | ---- | ----------- | -------- |
807
- | filterData | | The filter data object. |   |
808
- | datasetsInfo | | Collection of datasets information |   |
820
+ | array | | |   |
821
+ | callback | | function callback |   |
809
822
 
810
823
 
811
824
 
@@ -813,13 +826,17 @@ Generates a UI filter structure from Filter Data structure.
813
826
  ##### Returns
814
827
 
815
828
 
816
- - a UI Filters structure
829
+ - the last index of the array. -1 when the condition is not satisfied
817
830
 
818
831
 
819
832
 
820
- #### FD21ToUI(scopes, section, version, datasetsInfo)
821
833
 
822
- Generates a UI filter Structure from the Filter Data structure v2.1
834
+ ### dist/general/function/debounce.js
835
+
836
+
837
+ #### debounce(fn, time)
838
+
839
+ Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last time the debounced function was invoked.
823
840
 
824
841
 
825
842
 
@@ -828,10 +845,8 @@ Generates a UI filter Structure from the Filter Data structure v2.1
828
845
 
829
846
  | Name | Type | Description | |
830
847
  | ---- | ---- | ----------- | -------- |
831
- | scopes | | The filter scope section |   |
832
- | section | | The filter section. |   |
833
- | version | | The version of the filter structure |   |
834
- | datasetsInfo | | Collection of datasets information |   |
848
+ | fn | `Function` | original Function |   |
849
+ | time | `Number` | default 500ms |   |
835
850
 
836
851
 
837
852
 
@@ -839,17 +854,17 @@ Generates a UI filter Structure from the Filter Data structure v2.1
839
854
  ##### Returns
840
855
 
841
856
 
842
- - a UI filter Structure
857
+ - `Function` debounced functions
843
858
 
844
859
 
845
860
 
846
861
 
847
- ### dist/filters/adapters/UIToFD.js
862
+ ### dist/general/function/throttled.js
848
863
 
849
864
 
850
- #### UIToFD(filterData)
865
+ #### throttled(fn, time)
851
866
 
852
- Generates a Filter Data Structure structure from UI Filter Data structure.
867
+ Make sure to only invokes _fn_ at most once per every _time_ milliseconds
853
868
 
854
869
 
855
870
 
@@ -858,7 +873,8 @@ Generates a Filter Data Structure structure from UI Filter Data structure.
858
873
 
859
874
  | Name | Type | Description | |
860
875
  | ---- | ---- | ----------- | -------- |
861
- | filterData | | The UI filter data object. |   |
876
+ | fn | `Function` | original Function |   |
877
+ | time | `Number` | default 500ms |   |
862
878
 
863
879
 
864
880
 
@@ -866,13 +882,18 @@ Generates a Filter Data Structure structure from UI Filter Data structure.
866
882
  ##### Returns
867
883
 
868
884
 
869
- - a Filter Data structure
885
+ - `Function` throttled function
870
886
 
871
887
 
872
888
 
873
- #### UI21ToFD(uFilterData, version)
874
889
 
875
- Builds the Fitler Data structure from UI filter data
890
+ ### dist/general/mix/compareDeep.js
891
+
892
+
893
+ #### compareDeep(object1, object2)
894
+
895
+ Compares two objects to know if they are equals. Go across nested objects.
896
+ Includes arrays in the comparison.
876
897
 
877
898
 
878
899
 
@@ -881,8 +902,8 @@ Builds the Fitler Data structure from UI filter data
881
902
 
882
903
  | Name | Type | Description | |
883
904
  | ---- | ---- | ----------- | -------- |
884
- | uFilterData | | The UI filter Data object |   |
885
- | version | | the version of the structure |   |
905
+ | object1 | | First Object to compare |   |
906
+ | object2 | | Second Object to compare |   |
886
907
 
887
908
 
888
909
 
@@ -890,17 +911,17 @@ Builds the Fitler Data structure from UI filter data
890
911
  ##### Returns
891
912
 
892
913
 
893
- -
914
+ - True: objects are equal. False: Objects are not equal. Undefined: invalid
894
915
 
895
916
 
896
917
 
897
918
 
898
- ### dist/filters/adapters/UIToFlatUI.js
919
+ ### dist/general/mix/getTag.js
899
920
 
900
921
 
901
- #### UIToFlatUI(filterData, datasetsInfo)
922
+ #### getTag(value)
902
923
 
903
- Generates a Flattened UI filter structure from UI Filter Data structure.
924
+ Gets the `toStringTag` of `value`.
904
925
 
905
926
 
906
927
 
@@ -909,8 +930,7 @@ Generates a Flattened UI filter structure from UI Filter Data structure.
909
930
 
910
931
  | Name | Type | Description | |
911
932
  | ---- | ---- | ----------- | -------- |
912
- | filterData | | The UI filter data object. |   |
913
- | datasetsInfo | | Collection of datasets information. Optional for updating the datasets info |   |
933
+ | value | | The value to query. |   |
914
934
 
915
935
 
916
936
 
@@ -918,13 +938,17 @@ Generates a Flattened UI filter structure from UI Filter Data structure.
918
938
  ##### Returns
919
939
 
920
940
 
921
- - a flattened UI filters array
941
+ - `string` Returns the `toStringTag`.
922
942
 
923
943
 
924
944
 
925
- #### UI21ToFlatUI(scopes)
926
945
 
927
- Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
946
+ ### dist/general/mix/importScripts.js
947
+
948
+
949
+ #### importScripts(scripts)
950
+
951
+ Import a set of external Scripts given the URL in both serie and cascade way
928
952
 
929
953
 
930
954
 
@@ -933,25 +957,54 @@ Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
933
957
 
934
958
  | Name | Type | Description | |
935
959
  | ---- | ---- | ----------- | -------- |
936
- | scopes | | The filter scope section |   |
937
-
960
+ | scripts | `Array.<String>` `Array.<Object>` | can be an array of string or an array of object with the follow structure: | &nbsp; |
961
+ | scripts.url | `String` | CDN URL | &nbsp; |
962
+ | 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 | &nbsp; |
963
+ | scripts.type | `String` | (Optional) it could be `module` of `text/javascript`. Default `text/javascript` | &nbsp; |
964
+ | scripts.noModule | `Boolean` | (Optional) add `momodule` attribute to script tag. Default `false` | &nbsp; |
965
+ | scripts.dependencies | `Array.<Object>` | an array with the same structure to load in cascade mode | &nbsp; |
938
966
 
939
967
 
940
968
 
941
- ##### Returns
942
969
 
970
+ ##### Examples
943
971
 
944
- - a flattened UI filters array
972
+ ```javascript
973
+ // 1) Simple script (paralell loading)
974
+ importScripts(['http://myscript.js', 'http://another.js']);
945
975
 
976
+ // 2) Loading `.js` and `.esm.js` script (parallel loading)
977
+ importScripts([
978
+ { url: 'http://myscript.esm.js', type: 'module' },
979
+ { url: 'http://myscript.js', noModule: true }
980
+ ]);
981
+
982
+ // 3) import dependent scripts (cascade)
983
+ importScripts([
984
+ { url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] }
985
+ ]);
986
+
987
+ // 4) mix
988
+ importScripts([
989
+ { url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] },
990
+ { url: 'http://another.esm.js', type: 'module' },
991
+ { url: 'http://another.js', noModule: true },
992
+ 'http://simplescript.js'
993
+ ]);
994
+ ```
946
995
 
947
996
 
997
+ ##### Returns
948
998
 
949
- ### dist/filters/adapters/adaptFilterData.js
950
999
 
1000
+ - `Promise` Promise when all script have been loaded
951
1001
 
952
- #### adaptFilterData(filterData, getUIFilterData, datasetsInfo)
953
1002
 
954
- Checks and adapts the v2.0 Filter Data Structure to the v2.1
1003
+
1004
+ #### loadScript(url, type, noModule)
1005
+
1006
+ Creates the script element and appends to document.head
1007
+ return a Promise that is resolved when the script is loaded
955
1008
 
956
1009
 
957
1010
 
@@ -960,9 +1013,9 @@ Checks and adapts the v2.0 Filter Data Structure to the v2.1
960
1013
 
961
1014
  | Name | Type | Description | |
962
1015
  | ---- | ---- | ----------- | -------- |
963
- | filterData | | The filter data structure. Accepts both v2.1 or v2.0 | &nbsp; |
964
- | getUIFilterData | | Flag to get a Filter Data (False) or the UI Filter Data (True) | &nbsp; |
965
- | datasetsInfo | | Collection of datasets information. If getUIFilterData is true, the datasetsInfo should be mandatory | &nbsp; |
1016
+ | url | `String` | Cdn Url | &nbsp; |
1017
+ | type | `String` | (Optional) it could be `module` of `text/javascript`. Default `text/javascript` | &nbsp; |
1018
+ | noModule | `boolean` | (Optional) add `momodule` attribute to script tag. Default `false` | &nbsp; |
966
1019
 
967
1020
 
968
1021
 
@@ -970,18 +1023,17 @@ Checks and adapts the v2.0 Filter Data Structure to the v2.1
970
1023
  ##### Returns
971
1024
 
972
1025
 
973
- - A new filter data structure v2.1
1026
+ - `Void`
974
1027
 
975
1028
 
976
1029
 
977
1030
 
978
- ### dist/filters/adapters/adaptFilterValues.js
1031
+ ### dist/general/mix/isEmpty.js
979
1032
 
980
1033
 
981
- #### adaptFilterValues(filter)
1034
+ #### isEmpty(variable, includeFalsy)
982
1035
 
983
- [TODO: For 2022, eliminate this adapter]
984
- Gets an adapted filter value array. Validates the enabled property and sets
1036
+ Validates if the given argument is empty
985
1037
 
986
1038
 
987
1039
 
@@ -990,7 +1042,8 @@ Gets an adapted filter value array. Validates the enabled property and sets
990
1042
 
991
1043
  | Name | Type | Description | |
992
1044
  | ---- | ---- | ----------- | -------- |
993
- | filter | | The filter | &nbsp; |
1045
+ | variable | | the given variable | &nbsp; |
1046
+ | includeFalsy | | flag to determine include the falsy variables into the validation | &nbsp; |
994
1047
 
995
1048
 
996
1049
 
@@ -998,17 +1051,19 @@ Gets an adapted filter value array. Validates the enabled property and sets
998
1051
  ##### Returns
999
1052
 
1000
1053
 
1001
- - A new value array with the filled properties.
1054
+ - true: the given argument is empty; false: is not.
1002
1055
 
1003
1056
 
1004
1057
 
1005
1058
 
1006
- ### dist/filters/adapters/flatUIToFD.js
1059
+ ### dist/general/mix/isNaNV2.js
1007
1060
 
1008
1061
 
1009
- #### flatUIToFD(uFilters, version)
1062
+ #### isNaNV2(variable)
1010
1063
 
1011
- Generates a filter data structure from the flatttened UI filters.
1064
+ Validates if the recieved number is NaN type.
1065
+ This function recieves any variable but will return false.
1066
+ Validates if variable is null, undefined, or an empty string, also, the function uses isNaN native function.
1012
1067
 
1013
1068
 
1014
1069
 
@@ -1017,8 +1072,7 @@ Generates a filter data structure from the flatttened UI filters.
1017
1072
 
1018
1073
  | Name | Type | Description | |
1019
1074
  | ---- | ---- | ----------- | -------- |
1020
- | uFilters | | Array of flattened filters from UI | &nbsp; |
1021
- | version | | Tag for the version of the filter data structure | &nbsp; |
1075
+ | variable | | the variable to validate | &nbsp; |
1022
1076
 
1023
1077
 
1024
1078
 
@@ -1026,14 +1080,18 @@ Generates a filter data structure from the flatttened UI filters.
1026
1080
  ##### Returns
1027
1081
 
1028
1082
 
1029
- - a Filter Data.
1083
+ - True if variable is a NaN or false otherwise
1030
1084
 
1031
1085
 
1032
1086
 
1033
- #### buildScopes(fbFilters)
1034
1087
 
1035
- Gets an array of scopes structure for the filter data. The scopes is organized by scope types and scope IDs
1036
- Also, adds and organizes filters by datasets
1088
+ ### dist/general/mix/isNull.js
1089
+
1090
+
1091
+ #### isNull(arg)
1092
+
1093
+ return if a given variable is either `null` or `undefined`
1094
+ useful to avoid falsify validating Number Zero (0)
1037
1095
 
1038
1096
 
1039
1097
 
@@ -1042,7 +1100,7 @@ Also, adds and organizes filters by datasets
1042
1100
 
1043
1101
  | Name | Type | Description | |
1044
1102
  | ---- | ---- | ----------- | -------- |
1045
- | fbFilters | | Array of flat filters from UI | &nbsp; |
1103
+ | arg | `any` | | &nbsp; |
1046
1104
 
1047
1105
 
1048
1106
 
@@ -1050,13 +1108,19 @@ Also, adds and organizes filters by datasets
1050
1108
  ##### Returns
1051
1109
 
1052
1110
 
1053
- - an array of scopes structure.
1111
+ - `Boolean`
1054
1112
 
1055
1113
 
1056
1114
 
1057
- #### buildScope(uFilter)
1058
1115
 
1059
- Gets an scope structure for the filter data
1116
+ ### dist/general/mix/randomId.js
1117
+
1118
+
1119
+ #### randomId(length, exclude)
1120
+
1121
+ Creates a random string
1122
+ - If the first given argument is different than a length number, the variable is replaced by a default number
1123
+ - If the optional second given argument is passed the random string is permutated.
1060
1124
 
1061
1125
 
1062
1126
 
@@ -1065,7 +1129,8 @@ Gets an scope structure for the filter data
1065
1129
 
1066
1130
  | Name | Type | Description | |
1067
1131
  | ---- | ---- | ----------- | -------- |
1068
- | uFilter | | UI structure filter | &nbsp; |
1132
+ | length | `Number` | size of the generated string. Default 8 | &nbsp; |
1133
+ | exclude | `Array` | collection of strings that is going to be excluded of the random string. | &nbsp; |
1069
1134
 
1070
1135
 
1071
1136
 
@@ -1073,13 +1138,19 @@ Gets an scope structure for the filter data
1073
1138
  ##### Returns
1074
1139
 
1075
1140
 
1076
- - an scope structure
1141
+ - `String` Random string
1077
1142
 
1078
1143
 
1079
1144
 
1080
- #### buildDataset(uFilter)
1081
1145
 
1082
- Gets an dataset structure for the filter data
1146
+ ### dist/general/mix/size.js
1147
+
1148
+
1149
+ #### size(obj)
1150
+
1151
+ Gets the length of the given array.
1152
+ - Useful for Object, Array and string type.
1153
+ - For `null` or `undefined` or else argument the returned value will be 0.
1083
1154
 
1084
1155
 
1085
1156
 
@@ -1088,7 +1159,7 @@ Gets an dataset structure for the filter data
1088
1159
 
1089
1160
  | Name | Type | Description | |
1090
1161
  | ---- | ---- | ----------- | -------- |
1091
- | uFilter | | a UI structure filter | &nbsp; |
1162
+ | obj | `Any` | Any object-type variable | &nbsp; |
1092
1163
 
1093
1164
 
1094
1165
 
@@ -1096,13 +1167,18 @@ Gets an dataset structure for the filter data
1096
1167
  ##### Returns
1097
1168
 
1098
1169
 
1099
- - an dataset structure
1170
+ - `Number` the size of the given variable
1100
1171
 
1101
1172
 
1102
1173
 
1103
- #### buildFilter(uFilter)
1104
1174
 
1105
- Gets an filter structure for the filter data
1175
+ ### dist/general/object/cloneDeep.js
1176
+
1177
+
1178
+ #### cloneDeep(obj)
1179
+
1180
+ A simple Deep Cloning function. Valid only for primivite values and object with primitive values.
1181
+ Not to use this function with inner objects and functions
1106
1182
 
1107
1183
 
1108
1184
 
@@ -1111,7 +1187,7 @@ Gets an filter structure for the filter data
1111
1187
 
1112
1188
  | Name | Type | Description | |
1113
1189
  | ---- | ---- | ----------- | -------- |
1114
- | uFilter | | a UI structure filter | &nbsp; |
1190
+ | obj | | The object | &nbsp; |
1115
1191
 
1116
1192
 
1117
1193
 
@@ -1119,17 +1195,21 @@ Gets an filter structure for the filter data
1119
1195
  ##### Returns
1120
1196
 
1121
1197
 
1122
- - an filter structure
1198
+ - The new reference object or the given object if the parsing is incorrect or empty
1123
1199
 
1124
1200
 
1125
1201
 
1126
1202
 
1127
- ### dist/filters/adapters/flatUIToLogic.js
1203
+ ### dist/general/object/get.js
1128
1204
 
1129
1205
 
1130
- #### flatUIToLogic(uFilter)
1206
+ #### _get(baseObject, path, defaultValue)
1131
1207
 
1132
- Generates a Logic structure from flattened UI filters
1208
+ Like lodash _.get.
1209
+ Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.
1210
+
1211
+ Empty arrays and empty objects are returned but the defaultValue is not
1212
+ Undefined and null values will return the defaultValue.
1133
1213
 
1134
1214
 
1135
1215
 
@@ -1138,25 +1218,59 @@ Generates a Logic structure from flattened UI filters
1138
1218
 
1139
1219
  | Name | Type | Description | |
1140
1220
  | ---- | ---- | ----------- | -------- |
1141
- | uFilter | | Array of flat filters from UI | &nbsp; |
1221
+ | baseObject | | The object to query | &nbsp; |
1222
+ | path | | The string path or collection of string paths of the property to get. | &nbsp; |
1223
+ | defaultValue | | The value returned for undefined resolved values. | &nbsp; |
1142
1224
 
1143
1225
 
1144
1226
 
1145
1227
 
1228
+ ##### Examples
1229
+
1230
+ ```javascript
1231
+ // returns 'Hello'
1232
+ _get({ item1: 'Hello', item2: 'World' }, 'item1')
1233
+ ```
1234
+ ```javascript
1235
+ // returns 'A simple Hello'
1236
+ _get({ item1: 'Hello', item2: 'World' }, 'item3', 'A simple Hello')
1237
+ ```
1238
+ ```javascript
1239
+ // returns 'Hello Again'
1240
+ _get({ item1: { item11: 'Hello Again' }, item2: {} }, 'item1.item11')
1241
+ ```
1242
+ ```javascript
1243
+ // returns 'Hello 2'
1244
+ _get({ item1: ['Hello 1', 'Hello 2' }, item2: [] }, 'item1[1]')
1245
+ ```
1246
+ ```javascript
1247
+ // returns 'Hello Again'
1248
+ _get({ item1: { item11: 'Hello Again' }, item2: {} }, ['item1', 'item11'])
1249
+ ```
1250
+
1251
+
1146
1252
  ##### Returns
1147
1253
 
1148
1254
 
1149
- - The logic structure
1255
+ - the resolved value.
1150
1256
 
1151
1257
 
1152
1258
 
1153
1259
 
1154
- ### dist/filters/adapters/flatUIToOldLogic.js
1260
+ ### dist/general/object/getAttribute.js
1155
1261
 
1156
1262
 
1157
- #### flatUIToOldLogic(uFilters)
1263
+ #### getAttribute(obj, key)
1158
1264
 
1159
- Generates a Logic structure from flattened UI filters
1265
+ Searchs for properties in different case styles such as: lower, upper, camel and pascal
1266
+ - To optimize the searching, it is required a key in a snake_case style
1267
+ - List of cases that do not match
1268
+ -- From lower to snake case
1269
+ -- From upper to snake case
1270
+ -- From lower to camel case
1271
+ -- From upper to camel case
1272
+ -- From lower to pascal case
1273
+ -- From upper to pascal case
1160
1274
 
1161
1275
 
1162
1276
 
@@ -1165,25 +1279,33 @@ Generates a Logic structure from flattened UI filters
1165
1279
 
1166
1280
  | Name | Type | Description | |
1167
1281
  | ---- | ---- | ----------- | -------- |
1168
- | uFilters | | Array of flat filters from UI | &nbsp; |
1282
+ | obj | `object` | object to look for | &nbsp; |
1283
+ | key | `string` | String attribute in snake_case style | &nbsp; |
1284
+
1169
1285
 
1170
1286
 
1171
1287
 
1288
+ ##### Examples
1289
+
1290
+ ```javascript
1291
+ getAttribute(obj, 'snake_case') //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
1292
+ ```
1293
+
1172
1294
 
1173
1295
  ##### Returns
1174
1296
 
1175
1297
 
1176
- - The logic structure
1298
+ - `Void`
1177
1299
 
1178
1300
 
1179
1301
 
1180
1302
 
1181
- ### dist/filters/adapters/flatUIToUI.js
1303
+ ### dist/general/object/hasProperty.js
1182
1304
 
1183
1305
 
1184
- #### flatUIToUI(uFilters, version)
1306
+ #### _hasProperty(obj, property)
1185
1307
 
1186
- Generates a UI filter data structure from the flatttened UI filters.
1308
+ Use the hasOwnProperty in order to verify if the given property exists in the object.
1187
1309
 
1188
1310
 
1189
1311
 
@@ -1192,23 +1314,38 @@ Generates a UI filter data structure from the flatttened UI filters.
1192
1314
 
1193
1315
  | Name | Type | Description | |
1194
1316
  | ---- | ---- | ----------- | -------- |
1195
- | uFilters | | Array of flattened filters from UI | &nbsp; |
1196
- | version | | Tag for the version of the filter data structure | &nbsp; |
1317
+ | obj | `object` | an object | &nbsp; |
1318
+ | property | `string` | String to verify if exists in the object as property | &nbsp; |
1319
+
1320
+
1197
1321
 
1198
1322
 
1323
+ ##### Examples
1324
+
1325
+ ```javascript
1326
+ const prop = 'prop2'
1327
+ const obj1 = { prop1: 'hello', prop2: 'world'}
1328
+ _hasProperty(ob1, prop1) // true
1329
+
1330
+ const obj2 = { prop1: 'hello world' }
1331
+ _hasProperty(ob1, prop2) // false
1332
+ ```
1199
1333
 
1200
1334
 
1201
1335
  ##### Returns
1202
1336
 
1203
1337
 
1204
- - a UI Filter Data.
1338
+ - True if the object has the given property; otherwise, false.
1205
1339
 
1206
1340
 
1207
1341
 
1208
- #### buildScopes(fbFilters)
1209
1342
 
1210
- Gets an array of scopes structure for the UI filter data. The scopes is organized by scope types and scope IDs
1211
- Also, adds and organizes filters by datasets
1343
+ ### dist/general/object/isObject.js
1344
+
1345
+
1346
+ #### isObject(obj)
1347
+
1348
+ Checks if the given argument is an object type
1212
1349
 
1213
1350
 
1214
1351
 
@@ -1217,7 +1354,7 @@ Also, adds and organizes filters by datasets
1217
1354
 
1218
1355
  | Name | Type | Description | |
1219
1356
  | ---- | ---- | ----------- | -------- |
1220
- | fbFilters | | Array of flat filters from UI | &nbsp; |
1357
+ | obj | | the variable to check | &nbsp; |
1221
1358
 
1222
1359
 
1223
1360
 
@@ -1225,13 +1362,18 @@ Also, adds and organizes filters by datasets
1225
1362
  ##### Returns
1226
1363
 
1227
1364
 
1228
- - an array of scopes structure.
1365
+ - True: It is an object; False: It is not.
1229
1366
 
1230
1367
 
1231
1368
 
1232
- #### buildScope(uFilter)
1233
1369
 
1234
- Gets an scope structure for the UI filter data
1370
+ ### dist/general/object/mapValues.js
1371
+
1372
+
1373
+ #### mapValues(baseObject, iteratee)
1374
+
1375
+ Invoke iteratee (function) for each object key-value pair
1376
+ and return a mapped object
1235
1377
 
1236
1378
 
1237
1379
 
@@ -1240,7 +1382,8 @@ Gets an scope structure for the UI filter data
1240
1382
 
1241
1383
  | Name | Type | Description | |
1242
1384
  | ---- | ---- | ----------- | -------- |
1243
- | uFilter | | UI structure filter | &nbsp; |
1385
+ | baseObject | `Object` | Base object. | &nbsp; |
1386
+ | iteratee | `Function` | The executed per iteration. | &nbsp; |
1244
1387
 
1245
1388
 
1246
1389
 
@@ -1248,13 +1391,18 @@ Gets an scope structure for the UI filter data
1248
1391
  ##### Returns
1249
1392
 
1250
1393
 
1251
- - an scope structure
1394
+ - `Object` New mapped object.
1252
1395
 
1253
1396
 
1254
1397
 
1255
- #### buildDataset(uFilter)
1256
1398
 
1257
- Gets an dataset structure for the UI filter data
1399
+ ### dist/general/object/mergeDeep.js
1400
+
1401
+
1402
+ #### mergeDeep(obj1, obj2, settings)
1403
+
1404
+ Merges two objects into a new one.
1405
+ The second given argument to the first given argument.
1258
1406
 
1259
1407
 
1260
1408
 
@@ -1263,7 +1411,9 @@ Gets an dataset structure for the UI filter data
1263
1411
 
1264
1412
  | Name | Type | Description | |
1265
1413
  | ---- | ---- | ----------- | -------- |
1266
- | uFilter | | a UI structure filter | &nbsp; |
1414
+ | obj1 | | The target object | &nbsp; |
1415
+ | obj2 | | The object to be merged | &nbsp; |
1416
+ | settings | | Object settings for this function | &nbsp; |
1267
1417
 
1268
1418
 
1269
1419
 
@@ -1271,13 +1421,13 @@ Gets an dataset structure for the UI filter data
1271
1421
  ##### Returns
1272
1422
 
1273
1423
 
1274
- - an dataset structure
1424
+ - a new merged object
1275
1425
 
1276
1426
 
1277
1427
 
1278
- #### buildFilter(uFilter)
1428
+ #### isValid(obj1, obj2)
1279
1429
 
1280
- Gets an filter structure for the UI filter data
1430
+ Validates if the two arguments are objects
1281
1431
 
1282
1432
 
1283
1433
 
@@ -1286,25 +1436,22 @@ Gets an filter structure for the UI filter data
1286
1436
 
1287
1437
  | Name | Type | Description | |
1288
1438
  | ---- | ---- | ----------- | -------- |
1289
- | uFilter | | a UI structure filter | &nbsp; |
1290
-
1291
-
1292
-
1439
+ | obj1 | | The target object | &nbsp; |
1440
+ | obj2 | | The object to be merged | &nbsp; |
1293
1441
 
1294
- ##### Returns
1295
1442
 
1296
1443
 
1297
- - an filter structure
1298
1444
 
1445
+ ##### Returns
1299
1446
 
1300
1447
 
1448
+ - true: they are valid; false: they are not
1301
1449
 
1302
- ### dist/filters/adapters/logicToFD.js
1303
1450
 
1304
1451
 
1305
- #### logicToFD(filterData, version)
1452
+ #### getParamsToMergeDeep(settings)
1306
1453
 
1307
- Generates a filter data structure from the old logic structure (v2.0).
1454
+ Validates and gets the settings with all set parameters.
1308
1455
 
1309
1456
 
1310
1457
 
@@ -1313,8 +1460,7 @@ Generates a filter data structure from the old logic structure (v2.0).
1313
1460
 
1314
1461
  | Name | Type | Description | |
1315
1462
  | ---- | ---- | ----------- | -------- |
1316
- | filterData | | The old filter data structure with logic (v2.0) | &nbsp; |
1317
- | version | | Tag for the version of the filter data structure | &nbsp; |
1463
+ | settings | | the settings object | &nbsp; |
1318
1464
 
1319
1465
 
1320
1466
 
@@ -1322,17 +1468,17 @@ Generates a filter data structure from the old logic structure (v2.0).
1322
1468
  ##### Returns
1323
1469
 
1324
1470
 
1325
- - a Filter Data.
1471
+ - a new settings object with all set parameters.
1326
1472
 
1327
1473
 
1328
1474
 
1329
1475
 
1330
- ### dist/filters/adapters/logicToFlatUI.js
1476
+ ### dist/general/object/objectCopy.js
1331
1477
 
1332
1478
 
1333
- #### logicToFlatUI(logics)
1479
+ #### objectCopy(entity, cache)
1334
1480
 
1335
- Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
1481
+ Created a new reference of the given argument
1336
1482
 
1337
1483
 
1338
1484
 
@@ -1341,7 +1487,8 @@ Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
1341
1487
 
1342
1488
  | Name | Type | Description | |
1343
1489
  | ---- | ---- | ----------- | -------- |
1344
- | logics | | The old logic structure (v2.0) | &nbsp; |
1490
+ | entity | | The variable to be copied | &nbsp; |
1491
+ | cache | | | &nbsp; |
1345
1492
 
1346
1493
 
1347
1494
 
@@ -1349,13 +1496,17 @@ Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
1349
1496
  ##### Returns
1350
1497
 
1351
1498
 
1352
- - The Flattened UI Filters array
1499
+ - A new reference of the given argument
1353
1500
 
1354
1501
 
1355
1502
 
1356
- #### getFilter(filters, filter, getIndex)
1357
1503
 
1358
- Get the filter or the index of the given array, validating an old filter structure.
1504
+ ### dist/general/object/omit.js
1505
+
1506
+
1507
+ #### omit(obj, props)
1508
+
1509
+ return a new Object excluding attributes in _props_ list
1359
1510
 
1360
1511
 
1361
1512
 
@@ -1364,9 +1515,8 @@ Get the filter or the index of the given array, validating an old filter structu
1364
1515
 
1365
1516
  | Name | Type | Description | |
1366
1517
  | ---- | ---- | ----------- | -------- |
1367
- | filters | | The array of UI filters | &nbsp; |
1368
- | filter | | The old logic structure filter | &nbsp; |
1369
- | getIndex | | Determines if the index or returns the UI filter object | &nbsp; |
1518
+ | obj | `Object` | base object | &nbsp; |
1519
+ | props | `Array.<String>` | list of attribute to exclude | &nbsp; |
1370
1520
 
1371
1521
 
1372
1522
 
@@ -1374,13 +1524,17 @@ Get the filter or the index of the given array, validating an old filter structu
1374
1524
  ##### Returns
1375
1525
 
1376
1526
 
1377
- - the index or the UI filter object
1527
+ - `Object` clean object
1378
1528
 
1379
1529
 
1380
1530
 
1381
- #### refineRankingValues(values, uiValues)
1382
1531
 
1383
- Refines the values of the Ranking column type.
1532
+ ### dist/general/object/pick.js
1533
+
1534
+
1535
+ #### pick(baseObject, keys)
1536
+
1537
+ return a new object just with attributes in _keys_ list
1384
1538
 
1385
1539
 
1386
1540
 
@@ -1389,8 +1543,8 @@ Refines the values of the Ranking column type.
1389
1543
 
1390
1544
  | Name | Type | Description | |
1391
1545
  | ---- | ---- | ----------- | -------- |
1392
- | values | | the Array of Ranking values | &nbsp; |
1393
- | uiValues | | Object with additional info about the values of the filter. | &nbsp; |
1546
+ | baseObject | `Object` | base object | &nbsp; |
1547
+ | keys | `Array.<String>` | list of attributes to preserve | &nbsp; |
1394
1548
 
1395
1549
 
1396
1550
 
@@ -1398,17 +1552,17 @@ Refines the values of the Ranking column type.
1398
1552
  ##### Returns
1399
1553
 
1400
1554
 
1401
- - the array of Ranking values
1555
+ - `Object` new object just with desired attributes
1402
1556
 
1403
1557
 
1404
1558
 
1405
1559
 
1406
- ### dist/filters/adapters/logicToUI.js
1560
+ ### dist/general/object/serialize.js
1407
1561
 
1408
1562
 
1409
- #### logicToUI(uFilters, datasetsInfo)
1563
+ #### serialize(obj)
1410
1564
 
1411
- Generates a UI filter structure from the old logic structure (v2.0).
1565
+ serialize object to url param
1412
1566
 
1413
1567
 
1414
1568
 
@@ -1417,8 +1571,7 @@ Generates a UI filter structure from the old logic structure (v2.0).
1417
1571
 
1418
1572
  | Name | Type | Description | |
1419
1573
  | ---- | ---- | ----------- | -------- |
1420
- | uFilters | | Array of filters from old logic structure | &nbsp; |
1421
- | datasetsInfo | | Collection of datasets information | &nbsp; |
1574
+ | obj | | - Object to be serialized | &nbsp; |
1422
1575
 
1423
1576
 
1424
1577
 
@@ -1426,17 +1579,17 @@ Generates a UI filter structure from the old logic structure (v2.0).
1426
1579
  ##### Returns
1427
1580
 
1428
1581
 
1429
- - a UI Filter Data.
1582
+ - `Void`
1430
1583
 
1431
1584
 
1432
1585
 
1433
1586
 
1434
- ### dist/filters/adapters/transformFilters.js
1587
+ ### dist/general/string/capitalize.js
1435
1588
 
1436
1589
 
1437
- #### transformFilters(oldFiltersObj, section)
1590
+ #### capitalize(text)
1438
1591
 
1439
- Transform the old filters structure into the new one
1592
+ Upper case the first letter of a given text
1440
1593
 
1441
1594
 
1442
1595
 
@@ -1445,77 +1598,25 @@ Transform the old filters structure into the new one
1445
1598
 
1446
1599
  | Name | Type | Description | |
1447
1600
  | ---- | ---- | ----------- | -------- |
1448
- | oldFiltersObj | `Object` | an object with the old filters structure | &nbsp; |
1449
- | section | `String` | could be 'ANALYZE', 'PB', 'UM' or any other value. Deafult is 'ANYWHERE' | &nbsp; |
1450
-
1451
-
1452
-
1453
-
1454
- ##### Examples
1455
-
1456
- ```javascript
1601
+ | text | `String` | | &nbsp; |
1457
1602
 
1458
- const oldPreferenceFilters = {
1459
- "WWXHAULtR-_-xYOQAdpqT__ENABLED": true,
1460
- "WWXHAULtR-_-xYOQAdpqT__ALL--ENABLED": true,
1461
- "WWXHAULtR-_-xYOQAdpqT__COLLAPSED": false,
1462
- "WWXHAULtR-_-xYOQAdpqT__LABEL": "GLOBAL",
1463
- "WWXHAULtR-_-xYOQAdpqT-_-AK4M8UV2": {
1464
- "formulaId": null,
1465
- "panelId": null,
1466
- "values": [
1467
- {
1468
- "EQUALS": [
1469
- {
1470
- "id": "AK4M8UV2a0",
1471
- "value": "A",
1472
- "enabled": true,
1473
- "imageUrl": null
1474
- },
1475
- {
1476
- "id": "AK4M8UV2a1",
1477
- "value": "B",
1478
- "enabled": true,
1479
- "imageUrl": null
1480
- }
1481
- ]
1482
- }
1483
- ],
1484
- "bucketId": null,
1485
- "text": "MC",
1486
- "title": "MC",
1487
- "type": "SINGLE_CHOICE",
1488
- "qid": "AK4M8UV2",
1489
- "dataset": {
1490
- "sourceid": "xYOQAdpqT",
1491
- "name": "Form All Questions",
1492
- "qrveyid": "xYOQAdpqT",
1493
- "text": "Form All Questions",
1494
- "linkid": 0
1495
- },
1496
- "enabled": true,
1497
- "linked": null
1498
- }
1499
- };
1500
1603
 
1501
- const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
1502
- ```
1503
1604
 
1504
1605
 
1505
1606
  ##### Returns
1506
1607
 
1507
1608
 
1508
- - `Object` an object with the new filters structure
1609
+ - `String` a capitalized text
1509
1610
 
1510
1611
 
1511
1612
 
1512
1613
 
1513
- ### dist/filters/helpers/applyHierarchyForAggFilters.js
1614
+ ### dist/filters/adapters/FDToLogic.js
1514
1615
 
1515
1616
 
1516
- #### applyHierarchyForAggFilters(chartSettings, scopes, currentScope)
1617
+ #### FDToLogic(filterData)
1517
1618
 
1518
- [TODO: Make a proper description for this function]
1619
+ Generates a Filter Logic structure from Filter Data structure.
1519
1620
 
1520
1621
 
1521
1622
 
@@ -1524,9 +1625,7 @@ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
1524
1625
 
1525
1626
  | Name | Type | Description | |
1526
1627
  | ---- | ---- | ----------- | -------- |
1527
- | chartSettings | | Chart Settings for the Filter Builder | &nbsp; |
1528
- | scopes | | | &nbsp; |
1529
- | currentScope | | | &nbsp; |
1628
+ | filterData | | The filter data object. | &nbsp; |
1530
1629
 
1531
1630
 
1532
1631
 
@@ -1534,17 +1633,13 @@ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
1534
1633
  ##### Returns
1535
1634
 
1536
1635
 
1537
- -
1538
-
1539
-
1540
-
1636
+ - a filter logic array
1541
1637
 
1542
- ### dist/filters/helpers/getAvailableScopes.js
1543
1638
 
1544
1639
 
1545
- #### getAvailableScopes(config)
1640
+ #### getLogicBodyFromFD21(filterData)
1546
1641
 
1547
- Gets Scopes/Scope IDs by given IDs
1642
+ Gets the logic body
1548
1643
 
1549
1644
 
1550
1645
 
@@ -1553,7 +1648,7 @@ Gets Scopes/Scope IDs by given IDs
1553
1648
 
1554
1649
  | Name | Type | Description | |
1555
1650
  | ---- | ---- | ----------- | -------- |
1556
- | config | | given Differnts IDs in order set a available scope | &nbsp; |
1651
+ | filterData | | The filter data object | &nbsp; |
1557
1652
 
1558
1653
 
1559
1654
 
@@ -1561,17 +1656,17 @@ Gets Scopes/Scope IDs by given IDs
1561
1656
  ##### Returns
1562
1657
 
1563
1658
 
1564
- - a Scopes/Scope IDs array
1659
+ - a filter logic array
1565
1660
 
1566
1661
 
1567
1662
 
1568
1663
 
1569
- ### dist/filters/helpers/getAvailableScopesIDsByConfig.js
1664
+ ### dist/filters/adapters/FDToFlatUI.js
1570
1665
 
1571
1666
 
1572
- #### getAvailableScopesIDsByConfig(config)
1667
+ #### FDToFlatUI(filterData, datasetsInfo)
1573
1668
 
1574
- Gets the Scopes IDS for the Available Scope function by any config
1669
+ Generates a Flattened UI filter structure from Filter Data structure.
1575
1670
 
1576
1671
 
1577
1672
 
@@ -1580,7 +1675,8 @@ Gets the Scopes IDS for the Available Scope function by any config
1580
1675
 
1581
1676
  | Name | Type | Description | |
1582
1677
  | ---- | ---- | ----------- | -------- |
1583
- | config | | any config | &nbsp; |
1678
+ | filterData | | The filter data object. | &nbsp; |
1679
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
1584
1680
 
1585
1681
 
1586
1682
 
@@ -1588,17 +1684,13 @@ Gets the Scopes IDS for the Available Scope function by any config
1588
1684
  ##### Returns
1589
1685
 
1590
1686
 
1591
- - a Available Scope IDS config
1592
-
1593
-
1594
-
1687
+ - a flattened UI filters array
1595
1688
 
1596
- ### dist/filters/helpers/getScopesByHierarchy.js
1597
1689
 
1598
1690
 
1599
- #### getScopesByHierarchy(scopes, currentScope)
1691
+ #### FD21ToFlatUI(scopes, datasetsInfo)
1600
1692
 
1601
- [TODO: Make a description for this]
1693
+ Generates a Filter Builder Structure from the Filter Data structure v2.1
1602
1694
 
1603
1695
 
1604
1696
 
@@ -1607,8 +1699,8 @@ Gets the Scopes IDS for the Available Scope function by any config
1607
1699
 
1608
1700
  | Name | Type | Description | |
1609
1701
  | ---- | ---- | ----------- | -------- |
1610
- | scopes | | the collection of Scopes/Scope IDs | &nbsp; |
1611
- | currentScope | | Current scope type | &nbsp; |
1702
+ | scopes | | The filter scope section | &nbsp; |
1703
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
1612
1704
 
1613
1705
 
1614
1706
 
@@ -1616,38 +1708,41 @@ Gets the Scopes IDS for the Available Scope function by any config
1616
1708
  ##### Returns
1617
1709
 
1618
1710
 
1619
- - A new array of Scopes/Scope IDs
1620
-
1711
+ - a flattened UI filters array
1621
1712
 
1622
1713
 
1623
1714
 
1624
- ### dist/filters/classes/FilterInputErrorHandler.js
1625
1715
 
1716
+ ### dist/filters/adapters/FDToUI.js
1626
1717
 
1627
- #### new FilterInputErrorHandler()
1628
1718
 
1719
+ #### FDToUI(filterData, datasetsInfo)
1629
1720
 
1721
+ Generates a UI filter structure from Filter Data structure.
1630
1722
 
1631
1723
 
1632
1724
 
1633
1725
 
1726
+ ##### Parameters
1634
1727
 
1728
+ | Name | Type | Description | |
1729
+ | ---- | ---- | ----------- | -------- |
1730
+ | filterData | | The filter data object. | &nbsp; |
1731
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
1635
1732
 
1636
- ##### Returns
1637
1733
 
1638
1734
 
1639
- - `Void`
1640
1735
 
1736
+ ##### Returns
1641
1737
 
1642
1738
 
1739
+ - a UI Filters structure
1643
1740
 
1644
- ### dist/filters/adapters/adaptDateGroupingProperty.js
1645
1741
 
1646
1742
 
1647
- #### adaptDateGroupingProperty(property)
1743
+ #### FD21ToUI(scopes, section, version, datasetsInfo)
1648
1744
 
1649
- [TODO: For 2022, eliminate this adapter]
1650
- Get the new property base on the old date grouping properties
1745
+ Generates a UI filter Structure from the Filter Data structure v2.1
1651
1746
 
1652
1747
 
1653
1748
 
@@ -1656,7 +1751,10 @@ Get the new property base on the old date grouping properties
1656
1751
 
1657
1752
  | Name | Type | Description | |
1658
1753
  | ---- | ---- | ----------- | -------- |
1659
- | property | | | &nbsp; |
1754
+ | scopes | | The filter scope section | &nbsp; |
1755
+ | section | | The filter section. | &nbsp; |
1756
+ | version | | The version of the filter structure | &nbsp; |
1757
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
1660
1758
 
1661
1759
 
1662
1760
 
@@ -1664,17 +1762,17 @@ Get the new property base on the old date grouping properties
1664
1762
  ##### Returns
1665
1763
 
1666
1764
 
1667
- -
1765
+ - a UI filter Structure
1668
1766
 
1669
1767
 
1670
1768
 
1671
1769
 
1672
- ### dist/general/array/delete.js
1770
+ ### dist/filters/adapters/UIToFD.js
1673
1771
 
1674
1772
 
1675
- #### ArrayDelete(array, index)
1773
+ #### UIToFD(filterData)
1676
1774
 
1677
- Inmutable Array Item deletion
1775
+ Generates a Filter Data Structure structure from UI Filter Data structure.
1678
1776
 
1679
1777
 
1680
1778
 
@@ -1683,8 +1781,7 @@ Inmutable Array Item deletion
1683
1781
 
1684
1782
  | Name | Type | Description | |
1685
1783
  | ---- | ---- | ----------- | -------- |
1686
- | array | `Array` | a collection of items to delete | &nbsp; |
1687
- | index | `Number` | the position of the item to delete | &nbsp; |
1784
+ | filterData | | The UI filter data object. | &nbsp; |
1688
1785
 
1689
1786
 
1690
1787
 
@@ -1692,20 +1789,13 @@ Inmutable Array Item deletion
1692
1789
  ##### Returns
1693
1790
 
1694
1791
 
1695
- - a new Array or the given parameter when is empty or not an array
1696
-
1697
-
1698
-
1792
+ - a Filter Data structure
1699
1793
 
1700
- ### dist/general/array/filterNestedTree.js
1701
1794
 
1702
1795
 
1703
- #### filterNestedTree(arr, childArrKey, condition)
1796
+ #### UI21ToFD(uFilterData, version)
1704
1797
 
1705
- Filters a nested tree array by a custom condition on the last child node
1706
- - If the given arguments are not valid, the function returns the first argument.
1707
- - If the childArrKey is not matched in the object, the condition tries to resolve the filter anyway and returns an empty array.
1708
- - If the condition is not fulfilled, the function returns a filtered array, probably a empty array inside of the child array
1798
+ Builds the Fitler Data structure from UI filter data
1709
1799
 
1710
1800
 
1711
1801
 
@@ -1714,9 +1804,8 @@ Filters a nested tree array by a custom condition on the last child node
1714
1804
 
1715
1805
  | Name | Type | Description | |
1716
1806
  | ---- | ---- | ----------- | -------- |
1717
- | arr | | nested tree array | &nbsp; |
1718
- | childArrKey | | property representing the children array on the nested tree | &nbsp; |
1719
- | condition | | function callback that determines if the filter is applied on the last child node of the nested tree | &nbsp; |
1807
+ | uFilterData | | The UI filter Data object | &nbsp; |
1808
+ | version | | the version of the structure | &nbsp; |
1720
1809
 
1721
1810
 
1722
1811
 
@@ -1724,17 +1813,17 @@ Filters a nested tree array by a custom condition on the last child node
1724
1813
  ##### Returns
1725
1814
 
1726
1815
 
1727
- - array filtered
1816
+ -
1728
1817
 
1729
1818
 
1730
1819
 
1731
1820
 
1732
- ### dist/general/array/flattenDeep.js
1821
+ ### dist/filters/adapters/UIToFlatUI.js
1733
1822
 
1734
1823
 
1735
- #### flattenDeep(arr)
1824
+ #### UIToFlatUI(filterData, datasetsInfo)
1736
1825
 
1737
- Flat deeply an array
1826
+ Generates a Flattened UI filter structure from UI Filter Data structure.
1738
1827
 
1739
1828
 
1740
1829
 
@@ -1743,7 +1832,8 @@ Flat deeply an array
1743
1832
 
1744
1833
  | Name | Type | Description | |
1745
1834
  | ---- | ---- | ----------- | -------- |
1746
- | arr | | Array to flat deeply | &nbsp; |
1835
+ | filterData | | The UI filter data object. | &nbsp; |
1836
+ | datasetsInfo | | Collection of datasets information. Optional for updating the datasets info | &nbsp; |
1747
1837
 
1748
1838
 
1749
1839
 
@@ -1751,17 +1841,13 @@ Flat deeply an array
1751
1841
  ##### Returns
1752
1842
 
1753
1843
 
1754
- - flatten array
1755
-
1756
-
1757
-
1844
+ - a flattened UI filters array
1758
1845
 
1759
- ### dist/general/array/getFirstIndexFromArray.js
1760
1846
 
1761
1847
 
1762
- #### getFirstIndexFromArray(array, callback)
1848
+ #### UI21ToFlatUI(scopes)
1763
1849
 
1764
- Gets the first index from the array by a callback condition
1850
+ Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
1765
1851
 
1766
1852
 
1767
1853
 
@@ -1770,8 +1856,7 @@ Gets the first index from the array by a callback condition
1770
1856
 
1771
1857
  | Name | Type | Description | |
1772
1858
  | ---- | ---- | ----------- | -------- |
1773
- | array | | | &nbsp; |
1774
- | callback | | function callback | &nbsp; |
1859
+ | scopes | | The filter scope section | &nbsp; |
1775
1860
 
1776
1861
 
1777
1862
 
@@ -1779,17 +1864,18 @@ Gets the first index from the array by a callback condition
1779
1864
  ##### Returns
1780
1865
 
1781
1866
 
1782
- - the first index of the array. -1 when the condition is not satisfied
1867
+ - a flattened UI filters array
1783
1868
 
1784
1869
 
1785
1870
 
1786
1871
 
1787
- ### dist/general/array/getLastIndexFromArray.js
1872
+ ### dist/filters/adapters/adaptDateGroupingProperty.js
1788
1873
 
1789
1874
 
1790
- #### getLastIndexFromArray(array, callback)
1875
+ #### adaptDateGroupingProperty(property)
1791
1876
 
1792
- Gets the last index from the array by a callback condition
1877
+ [TODO: For 2022, eliminate this adapter]
1878
+ Get the new property base on the old date grouping properties
1793
1879
 
1794
1880
 
1795
1881
 
@@ -1798,8 +1884,7 @@ Gets the last index from the array by a callback condition
1798
1884
 
1799
1885
  | Name | Type | Description | |
1800
1886
  | ---- | ---- | ----------- | -------- |
1801
- | array | | | &nbsp; |
1802
- | callback | | function callback | &nbsp; |
1887
+ | property | | | &nbsp; |
1803
1888
 
1804
1889
 
1805
1890
 
@@ -1807,17 +1892,17 @@ Gets the last index from the array by a callback condition
1807
1892
  ##### Returns
1808
1893
 
1809
1894
 
1810
- - the last index of the array. -1 when the condition is not satisfied
1895
+ -
1811
1896
 
1812
1897
 
1813
1898
 
1814
1899
 
1815
- ### dist/general/function/debounce.js
1900
+ ### dist/filters/adapters/adaptFilterData.js
1816
1901
 
1817
1902
 
1818
- #### debounce(fn, time)
1903
+ #### adaptFilterData(filterData, getUIFilterData, datasetsInfo)
1819
1904
 
1820
- Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last time the debounced function was invoked.
1905
+ Checks and adapts the v2.0 Filter Data Structure to the v2.1
1821
1906
 
1822
1907
 
1823
1908
 
@@ -1826,8 +1911,9 @@ Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last
1826
1911
 
1827
1912
  | Name | Type | Description | |
1828
1913
  | ---- | ---- | ----------- | -------- |
1829
- | fn | `Function` | original Function | &nbsp; |
1830
- | time | `Number` | default 500ms | &nbsp; |
1914
+ | filterData | | The filter data structure. Accepts both v2.1 or v2.0 | &nbsp; |
1915
+ | getUIFilterData | | Flag to get a Filter Data (False) or the UI Filter Data (True) | &nbsp; |
1916
+ | datasetsInfo | | Collection of datasets information. If getUIFilterData is true, the datasetsInfo should be mandatory | &nbsp; |
1831
1917
 
1832
1918
 
1833
1919
 
@@ -1835,17 +1921,18 @@ Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last
1835
1921
  ##### Returns
1836
1922
 
1837
1923
 
1838
- - `Function` debounced functions
1924
+ - A new filter data structure v2.1
1839
1925
 
1840
1926
 
1841
1927
 
1842
1928
 
1843
- ### dist/general/function/throttled.js
1929
+ ### dist/filters/adapters/adaptFilterValues.js
1844
1930
 
1845
1931
 
1846
- #### throttled(fn, time)
1932
+ #### adaptFilterValues(filter)
1847
1933
 
1848
- Make sure to only invokes _fn_ at most once per every _time_ milliseconds
1934
+ [TODO: For 2022, eliminate this adapter]
1935
+ Gets an adapted filter value array. Validates the enabled property and sets
1849
1936
 
1850
1937
 
1851
1938
 
@@ -1854,8 +1941,7 @@ Make sure to only invokes _fn_ at most once per every _time_ milliseconds
1854
1941
 
1855
1942
  | Name | Type | Description | |
1856
1943
  | ---- | ---- | ----------- | -------- |
1857
- | fn | `Function` | original Function | &nbsp; |
1858
- | time | `Number` | default 500ms | &nbsp; |
1944
+ | filter | | The filter | &nbsp; |
1859
1945
 
1860
1946
 
1861
1947
 
@@ -1863,18 +1949,17 @@ Make sure to only invokes _fn_ at most once per every _time_ milliseconds
1863
1949
  ##### Returns
1864
1950
 
1865
1951
 
1866
- - `Function` throttled function
1952
+ - A new value array with the filled properties.
1867
1953
 
1868
1954
 
1869
1955
 
1870
1956
 
1871
- ### dist/general/mix/compareDeep.js
1957
+ ### dist/filters/adapters/flatUIToFD.js
1872
1958
 
1873
1959
 
1874
- #### compareDeep(object1, object2)
1960
+ #### flatUIToFD(uFilters, version)
1875
1961
 
1876
- Compares two objects to know if they are equals. Go across nested objects.
1877
- Includes arrays in the comparison.
1962
+ Generates a filter data structure from the flatttened UI filters.
1878
1963
 
1879
1964
 
1880
1965
 
@@ -1883,8 +1968,8 @@ Includes arrays in the comparison.
1883
1968
 
1884
1969
  | Name | Type | Description | |
1885
1970
  | ---- | ---- | ----------- | -------- |
1886
- | object1 | | First Object to compare | &nbsp; |
1887
- | object2 | | Second Object to compare | &nbsp; |
1971
+ | uFilters | | Array of flattened filters from UI | &nbsp; |
1972
+ | version | | Tag for the version of the filter data structure | &nbsp; |
1888
1973
 
1889
1974
 
1890
1975
 
@@ -1892,17 +1977,14 @@ Includes arrays in the comparison.
1892
1977
  ##### Returns
1893
1978
 
1894
1979
 
1895
- - True: objects are equal. False: Objects are not equal. Undefined: invalid
1896
-
1897
-
1898
-
1980
+ - a Filter Data.
1899
1981
 
1900
- ### dist/general/mix/getTag.js
1901
1982
 
1902
1983
 
1903
- #### getTag(value)
1984
+ #### buildScopes(fbFilters)
1904
1985
 
1905
- Gets the `toStringTag` of `value`.
1986
+ Gets an array of scopes structure for the filter data. The scopes is organized by scope types and scope IDs
1987
+ Also, adds and organizes filters by datasets
1906
1988
 
1907
1989
 
1908
1990
 
@@ -1911,7 +1993,7 @@ Gets the `toStringTag` of `value`.
1911
1993
 
1912
1994
  | Name | Type | Description | |
1913
1995
  | ---- | ---- | ----------- | -------- |
1914
- | value | | The value to query. | &nbsp; |
1996
+ | fbFilters | | Array of flat filters from UI | &nbsp; |
1915
1997
 
1916
1998
 
1917
1999
 
@@ -1919,17 +2001,13 @@ Gets the `toStringTag` of `value`.
1919
2001
  ##### Returns
1920
2002
 
1921
2003
 
1922
- - `string` Returns the `toStringTag`.
1923
-
1924
-
2004
+ - an array of scopes structure.
1925
2005
 
1926
2006
 
1927
- ### dist/general/mix/importScripts.js
1928
2007
 
2008
+ #### buildScope(uFilter)
1929
2009
 
1930
- #### importScripts(scripts)
1931
-
1932
- Import a set of external Scripts given the URL in both serie and cascade way
2010
+ Gets an scope structure for the filter data
1933
2011
 
1934
2012
 
1935
2013
 
@@ -1938,54 +2016,44 @@ Import a set of external Scripts given the URL in both serie and cascade way
1938
2016
 
1939
2017
  | Name | Type | Description | |
1940
2018
  | ---- | ---- | ----------- | -------- |
1941
- | scripts | `Array.<String>` `Array.<Object>` | can be an array of string or an array of object with the follow structure: | &nbsp; |
1942
- | scripts.url | `String` | CDN URL | &nbsp; |
1943
- | 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 | &nbsp; |
1944
- | scripts.type | `String` | (Optional) it could be `module` of `text/javascript`. Default `text/javascript` | &nbsp; |
1945
- | scripts.noModule | `Boolean` | (Optional) add `momodule` attribute to script tag. Default `false` | &nbsp; |
1946
- | scripts.dependencies | `Array.<Object>` | an array with the same structure to load in cascade mode | &nbsp; |
2019
+ | uFilter | | UI structure filter | &nbsp; |
1947
2020
 
1948
2021
 
1949
2022
 
1950
2023
 
1951
- ##### Examples
2024
+ ##### Returns
1952
2025
 
1953
- ```javascript
1954
- // 1) Simple script (paralell loading)
1955
- importScripts(['http://myscript.js', 'http://another.js']);
1956
2026
 
1957
- // 2) Loading `.js` and `.esm.js` script (parallel loading)
1958
- importScripts([
1959
- { url: 'http://myscript.esm.js', type: 'module' },
1960
- { url: 'http://myscript.js', noModule: true }
1961
- ]);
2027
+ - an scope structure
2028
+
2029
+
2030
+
2031
+ #### buildDataset(uFilter)
2032
+
2033
+ Gets an dataset structure for the filter data
2034
+
2035
+
2036
+
2037
+
2038
+ ##### Parameters
2039
+
2040
+ | Name | Type | Description | |
2041
+ | ---- | ---- | ----------- | -------- |
2042
+ | uFilter | | a UI structure filter | &nbsp; |
1962
2043
 
1963
- // 3) import dependent scripts (cascade)
1964
- importScripts([
1965
- { url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] }
1966
- ]);
1967
2044
 
1968
- // 4) mix
1969
- importScripts([
1970
- { url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] },
1971
- { url: 'http://another.esm.js', type: 'module' },
1972
- { url: 'http://another.js', noModule: true },
1973
- 'http://simplescript.js'
1974
- ]);
1975
- ```
1976
2045
 
1977
2046
 
1978
2047
  ##### Returns
1979
2048
 
1980
2049
 
1981
- - `Promise` Promise when all script have been loaded
2050
+ - an dataset structure
1982
2051
 
1983
2052
 
1984
2053
 
1985
- #### loadScript(url, type, noModule)
2054
+ #### buildFilter(uFilter)
1986
2055
 
1987
- Creates the script element and appends to document.head
1988
- return a Promise that is resolved when the script is loaded
2056
+ Gets an filter structure for the filter data
1989
2057
 
1990
2058
 
1991
2059
 
@@ -1994,9 +2062,7 @@ return a Promise that is resolved when the script is loaded
1994
2062
 
1995
2063
  | Name | Type | Description | |
1996
2064
  | ---- | ---- | ----------- | -------- |
1997
- | url | `String` | Cdn Url | &nbsp; |
1998
- | type | `String` | (Optional) it could be `module` of `text/javascript`. Default `text/javascript` | &nbsp; |
1999
- | noModule | `boolean` | (Optional) add `momodule` attribute to script tag. Default `false` | &nbsp; |
2065
+ | uFilter | | a UI structure filter | &nbsp; |
2000
2066
 
2001
2067
 
2002
2068
 
@@ -2004,17 +2070,17 @@ return a Promise that is resolved when the script is loaded
2004
2070
  ##### Returns
2005
2071
 
2006
2072
 
2007
- - `Void`
2073
+ - an filter structure
2008
2074
 
2009
2075
 
2010
2076
 
2011
2077
 
2012
- ### dist/general/mix/isEmpty.js
2078
+ ### dist/filters/adapters/flatUIToLogic.js
2013
2079
 
2014
2080
 
2015
- #### isEmpty(variable, includeFalsy)
2081
+ #### flatUIToLogic(uFilter)
2016
2082
 
2017
- Validates if the given argument is empty
2083
+ Generates a Logic structure from flattened UI filters
2018
2084
 
2019
2085
 
2020
2086
 
@@ -2023,8 +2089,7 @@ Validates if the given argument is empty
2023
2089
 
2024
2090
  | Name | Type | Description | |
2025
2091
  | ---- | ---- | ----------- | -------- |
2026
- | variable | | the given variable | &nbsp; |
2027
- | includeFalsy | | flag to determine include the falsy variables into the validation | &nbsp; |
2092
+ | uFilter | | Array of flat filters from UI | &nbsp; |
2028
2093
 
2029
2094
 
2030
2095
 
@@ -2032,19 +2097,17 @@ Validates if the given argument is empty
2032
2097
  ##### Returns
2033
2098
 
2034
2099
 
2035
- - true: the given argument is empty; false: is not.
2100
+ - The logic structure
2036
2101
 
2037
2102
 
2038
2103
 
2039
2104
 
2040
- ### dist/general/mix/isNaNV2.js
2105
+ ### dist/filters/adapters/flatUIToOldLogic.js
2041
2106
 
2042
2107
 
2043
- #### isNaNV2(variable)
2108
+ #### flatUIToOldLogic(uFilters)
2044
2109
 
2045
- Validates if the recieved number is NaN type.
2046
- This function recieves any variable but will return false.
2047
- Validates if variable is null, undefined, or an empty string, also, the function uses isNaN native function.
2110
+ Generates a Logic structure from flattened UI filters
2048
2111
 
2049
2112
 
2050
2113
 
@@ -2053,7 +2116,7 @@ Validates if variable is null, undefined, or an empty string, also, the function
2053
2116
 
2054
2117
  | Name | Type | Description | |
2055
2118
  | ---- | ---- | ----------- | -------- |
2056
- | variable | | the variable to validate | &nbsp; |
2119
+ | uFilters | | Array of flat filters from UI | &nbsp; |
2057
2120
 
2058
2121
 
2059
2122
 
@@ -2061,18 +2124,17 @@ Validates if variable is null, undefined, or an empty string, also, the function
2061
2124
  ##### Returns
2062
2125
 
2063
2126
 
2064
- - True if variable is a NaN or false otherwise
2127
+ - The logic structure
2065
2128
 
2066
2129
 
2067
2130
 
2068
2131
 
2069
- ### dist/general/mix/isNull.js
2132
+ ### dist/filters/adapters/flatUIToUI.js
2070
2133
 
2071
2134
 
2072
- #### isNull(arg)
2135
+ #### flatUIToUI(uFilters, version)
2073
2136
 
2074
- return if a given variable is either `null` or `undefined`
2075
- useful to avoid falsify validating Number Zero (0)
2137
+ Generates a UI filter data structure from the flatttened UI filters.
2076
2138
 
2077
2139
 
2078
2140
 
@@ -2081,7 +2143,8 @@ useful to avoid falsify validating Number Zero (0)
2081
2143
 
2082
2144
  | Name | Type | Description | |
2083
2145
  | ---- | ---- | ----------- | -------- |
2084
- | arg | `any` | | &nbsp; |
2146
+ | uFilters | | Array of flattened filters from UI | &nbsp; |
2147
+ | version | | Tag for the version of the filter data structure | &nbsp; |
2085
2148
 
2086
2149
 
2087
2150
 
@@ -2089,19 +2152,14 @@ useful to avoid falsify validating Number Zero (0)
2089
2152
  ##### Returns
2090
2153
 
2091
2154
 
2092
- - `Boolean`
2093
-
2094
-
2155
+ - a UI Filter Data.
2095
2156
 
2096
2157
 
2097
- ### dist/general/mix/randomId.js
2098
2158
 
2159
+ #### buildScopes(fbFilters)
2099
2160
 
2100
- #### randomId(length, exclude)
2101
-
2102
- Creates a random string
2103
- - If the first given argument is different than a length number, the variable is replaced by a default number
2104
- - If the optional second given argument is passed the random string is permutated.
2161
+ Gets an array of scopes structure for the UI filter data. The scopes is organized by scope types and scope IDs
2162
+ Also, adds and organizes filters by datasets
2105
2163
 
2106
2164
 
2107
2165
 
@@ -2110,8 +2168,7 @@ Creates a random string
2110
2168
 
2111
2169
  | Name | Type | Description | |
2112
2170
  | ---- | ---- | ----------- | -------- |
2113
- | length | `Number` | size of the generated string. Default 8 | &nbsp; |
2114
- | exclude | `Array` | collection of strings that is going to be excluded of the random string. | &nbsp; |
2171
+ | fbFilters | | Array of flat filters from UI | &nbsp; |
2115
2172
 
2116
2173
 
2117
2174
 
@@ -2119,19 +2176,13 @@ Creates a random string
2119
2176
  ##### Returns
2120
2177
 
2121
2178
 
2122
- - `String` Random string
2123
-
2124
-
2125
-
2179
+ - an array of scopes structure.
2126
2180
 
2127
- ### dist/general/mix/size.js
2128
2181
 
2129
2182
 
2130
- #### size(obj)
2183
+ #### buildScope(uFilter)
2131
2184
 
2132
- Gets the length of the given array.
2133
- - Useful for Object, Array and string type.
2134
- - For `null` or `undefined` or else argument the returned value will be 0.
2185
+ Gets an scope structure for the UI filter data
2135
2186
 
2136
2187
 
2137
2188
 
@@ -2140,7 +2191,7 @@ Gets the length of the given array.
2140
2191
 
2141
2192
  | Name | Type | Description | |
2142
2193
  | ---- | ---- | ----------- | -------- |
2143
- | obj | `Any` | Any object-type variable | &nbsp; |
2194
+ | uFilter | | UI structure filter | &nbsp; |
2144
2195
 
2145
2196
 
2146
2197
 
@@ -2148,18 +2199,13 @@ Gets the length of the given array.
2148
2199
  ##### Returns
2149
2200
 
2150
2201
 
2151
- - `Number` the size of the given variable
2152
-
2153
-
2154
-
2202
+ - an scope structure
2155
2203
 
2156
- ### dist/general/object/cloneDeep.js
2157
2204
 
2158
2205
 
2159
- #### cloneDeep(obj)
2206
+ #### buildDataset(uFilter)
2160
2207
 
2161
- A simple Deep Cloning function. Valid only for primivite values and object with primitive values.
2162
- Not to use this function with inner objects and functions
2208
+ Gets an dataset structure for the UI filter data
2163
2209
 
2164
2210
 
2165
2211
 
@@ -2168,7 +2214,7 @@ Not to use this function with inner objects and functions
2168
2214
 
2169
2215
  | Name | Type | Description | |
2170
2216
  | ---- | ---- | ----------- | -------- |
2171
- | obj | | The object | &nbsp; |
2217
+ | uFilter | | a UI structure filter | &nbsp; |
2172
2218
 
2173
2219
 
2174
2220
 
@@ -2176,21 +2222,13 @@ Not to use this function with inner objects and functions
2176
2222
  ##### Returns
2177
2223
 
2178
2224
 
2179
- - The new reference object or the given object if the parsing is incorrect or empty
2180
-
2181
-
2182
-
2183
-
2184
- ### dist/general/object/get.js
2225
+ - an dataset structure
2185
2226
 
2186
2227
 
2187
- #### _get(baseObject, path, defaultValue)
2188
2228
 
2189
- Like lodash _.get.
2190
- Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.
2229
+ #### buildFilter(uFilter)
2191
2230
 
2192
- Empty arrays and empty objects are returned but the defaultValue is not
2193
- Undefined and null values will return the defaultValue.
2231
+ Gets an filter structure for the UI filter data
2194
2232
 
2195
2233
 
2196
2234
 
@@ -2199,59 +2237,25 @@ Undefined and null values will return the defaultValue.
2199
2237
 
2200
2238
  | Name | Type | Description | |
2201
2239
  | ---- | ---- | ----------- | -------- |
2202
- | baseObject | | The object to query | &nbsp; |
2203
- | path | | The string path or collection of string paths of the property to get. | &nbsp; |
2204
- | defaultValue | | The value returned for undefined resolved values. | &nbsp; |
2205
-
2240
+ | uFilter | | a UI structure filter | &nbsp; |
2206
2241
 
2207
2242
 
2208
2243
 
2209
- ##### Examples
2210
-
2211
- ```javascript
2212
- // returns 'Hello'
2213
- _get({ item1: 'Hello', item2: 'World' }, 'item1')
2214
- ```
2215
- ```javascript
2216
- // returns 'A simple Hello'
2217
- _get({ item1: 'Hello', item2: 'World' }, 'item3', 'A simple Hello')
2218
- ```
2219
- ```javascript
2220
- // returns 'Hello Again'
2221
- _get({ item1: { item11: 'Hello Again' }, item2: {} }, 'item1.item11')
2222
- ```
2223
- ```javascript
2224
- // returns 'Hello 2'
2225
- _get({ item1: ['Hello 1', 'Hello 2' }, item2: [] }, 'item1[1]')
2226
- ```
2227
- ```javascript
2228
- // returns 'Hello Again'
2229
- _get({ item1: { item11: 'Hello Again' }, item2: {} }, ['item1', 'item11'])
2230
- ```
2231
-
2232
2244
 
2233
2245
  ##### Returns
2234
2246
 
2235
2247
 
2236
- - the resolved value.
2248
+ - an filter structure
2237
2249
 
2238
2250
 
2239
2251
 
2240
2252
 
2241
- ### dist/general/object/getAttribute.js
2253
+ ### dist/filters/adapters/logicToFD.js
2242
2254
 
2243
2255
 
2244
- #### getAttribute(obj, key)
2256
+ #### logicToFD(filterData, version)
2245
2257
 
2246
- Searchs for properties in different case styles such as: lower, upper, camel and pascal
2247
- - To optimize the searching, it is required a key in a snake_case style
2248
- - List of cases that do not match
2249
- -- From lower to snake case
2250
- -- From upper to snake case
2251
- -- From lower to camel case
2252
- -- From upper to camel case
2253
- -- From lower to pascal case
2254
- -- From upper to pascal case
2258
+ Generates a filter data structure from the old logic structure (v2.0).
2255
2259
 
2256
2260
 
2257
2261
 
@@ -2260,33 +2264,26 @@ Searchs for properties in different case styles such as: lower, upper, camel and
2260
2264
 
2261
2265
  | Name | Type | Description | |
2262
2266
  | ---- | ---- | ----------- | -------- |
2263
- | obj | `object` | object to look for | &nbsp; |
2264
- | key | `string` | String attribute in snake_case style | &nbsp; |
2265
-
2266
-
2267
-
2267
+ | filterData | | The old filter data structure with logic (v2.0) | &nbsp; |
2268
+ | version | | Tag for the version of the filter data structure | &nbsp; |
2268
2269
 
2269
- ##### Examples
2270
2270
 
2271
- ```javascript
2272
- getAttribute(obj, 'snake_case') //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
2273
- ```
2274
2271
 
2275
2272
 
2276
2273
  ##### Returns
2277
2274
 
2278
2275
 
2279
- - `Void`
2276
+ - a Filter Data.
2280
2277
 
2281
2278
 
2282
2279
 
2283
2280
 
2284
- ### dist/general/object/hasProperty.js
2281
+ ### dist/filters/adapters/logicToFlatUI.js
2285
2282
 
2286
2283
 
2287
- #### _hasProperty(obj, property)
2284
+ #### logicToFlatUI(logics)
2288
2285
 
2289
- Use the hasOwnProperty in order to verify if the given property exists in the object.
2286
+ Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
2290
2287
 
2291
2288
 
2292
2289
 
@@ -2295,38 +2292,21 @@ Use the hasOwnProperty in order to verify if the given property exists in the ob
2295
2292
 
2296
2293
  | Name | Type | Description | |
2297
2294
  | ---- | ---- | ----------- | -------- |
2298
- | obj | `object` | an object | &nbsp; |
2299
- | property | `string` | String to verify if exists in the object as property | &nbsp; |
2300
-
2301
-
2302
-
2303
-
2304
- ##### Examples
2305
-
2306
- ```javascript
2307
- const prop = 'prop2'
2308
- const obj1 = { prop1: 'hello', prop2: 'world'}
2309
- _hasProperty(ob1, prop1) // true
2310
-
2311
- const obj2 = { prop1: 'hello world' }
2312
- _hasProperty(ob1, prop2) // false
2313
- ```
2314
-
2295
+ | logics | | The old logic structure (v2.0) | &nbsp; |
2315
2296
 
2316
- ##### Returns
2317
2297
 
2318
2298
 
2319
- - True if the object has the given property; otherwise, false.
2320
2299
 
2300
+ ##### Returns
2321
2301
 
2322
2302
 
2303
+ - The Flattened UI Filters array
2323
2304
 
2324
- ### dist/general/object/isObject.js
2325
2305
 
2326
2306
 
2327
- #### isObject(obj)
2307
+ #### getFilter(filters, filter, getIndex)
2328
2308
 
2329
- Checks if the given argument is an object type
2309
+ Get the filter or the index of the given array, validating an old filter structure.
2330
2310
 
2331
2311
 
2332
2312
 
@@ -2335,7 +2315,9 @@ Checks if the given argument is an object type
2335
2315
 
2336
2316
  | Name | Type | Description | |
2337
2317
  | ---- | ---- | ----------- | -------- |
2338
- | obj | | the variable to check | &nbsp; |
2318
+ | filters | | The array of UI filters | &nbsp; |
2319
+ | filter | | The old logic structure filter | &nbsp; |
2320
+ | getIndex | | Determines if the index or returns the UI filter object | &nbsp; |
2339
2321
 
2340
2322
 
2341
2323
 
@@ -2343,18 +2325,13 @@ Checks if the given argument is an object type
2343
2325
  ##### Returns
2344
2326
 
2345
2327
 
2346
- - True: It is an object; False: It is not.
2347
-
2348
-
2349
-
2328
+ - the index or the UI filter object
2350
2329
 
2351
- ### dist/general/object/mergeDeep.js
2352
2330
 
2353
2331
 
2354
- #### mergeDeep(obj1, obj2, settings)
2332
+ #### refineRankingValues(values, uiValues)
2355
2333
 
2356
- Merges two objects into a new one.
2357
- The second given argument to the first given argument.
2334
+ Refines the values of the Ranking column type.
2358
2335
 
2359
2336
 
2360
2337
 
@@ -2363,9 +2340,8 @@ The second given argument to the first given argument.
2363
2340
 
2364
2341
  | Name | Type | Description | |
2365
2342
  | ---- | ---- | ----------- | -------- |
2366
- | obj1 | | The target object | &nbsp; |
2367
- | obj2 | | The object to be merged | &nbsp; |
2368
- | settings | | Object settings for this function | &nbsp; |
2343
+ | values | | the Array of Ranking values | &nbsp; |
2344
+ | uiValues | | Object with additional info about the values of the filter. | &nbsp; |
2369
2345
 
2370
2346
 
2371
2347
 
@@ -2373,13 +2349,17 @@ The second given argument to the first given argument.
2373
2349
  ##### Returns
2374
2350
 
2375
2351
 
2376
- - a new merged object
2352
+ - the array of Ranking values
2377
2353
 
2378
2354
 
2379
2355
 
2380
- #### isValid(obj1, obj2)
2381
2356
 
2382
- Validates if the two arguments are objects
2357
+ ### dist/filters/adapters/logicToUI.js
2358
+
2359
+
2360
+ #### logicToUI(uFilters, datasetsInfo)
2361
+
2362
+ Generates a UI filter structure from the old logic structure (v2.0).
2383
2363
 
2384
2364
 
2385
2365
 
@@ -2388,8 +2368,8 @@ Validates if the two arguments are objects
2388
2368
 
2389
2369
  | Name | Type | Description | |
2390
2370
  | ---- | ---- | ----------- | -------- |
2391
- | obj1 | | The target object | &nbsp; |
2392
- | obj2 | | The object to be merged | &nbsp; |
2371
+ | uFilters | | Array of filters from old logic structure | &nbsp; |
2372
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
2393
2373
 
2394
2374
 
2395
2375
 
@@ -2397,13 +2377,17 @@ Validates if the two arguments are objects
2397
2377
  ##### Returns
2398
2378
 
2399
2379
 
2400
- - true: they are valid; false: they are not
2380
+ - a UI Filter Data.
2401
2381
 
2402
2382
 
2403
2383
 
2404
- #### getParamsToMergeDeep(settings)
2405
2384
 
2406
- Validates and gets the settings with all set parameters.
2385
+ ### dist/filters/adapters/transformFilters.js
2386
+
2387
+
2388
+ #### transformFilters(oldFiltersObj, section)
2389
+
2390
+ Transform the old filters structure into the new one
2407
2391
 
2408
2392
 
2409
2393
 
@@ -2412,35 +2396,79 @@ Validates and gets the settings with all set parameters.
2412
2396
 
2413
2397
  | Name | Type | Description | |
2414
2398
  | ---- | ---- | ----------- | -------- |
2415
- | settings | | the settings object | &nbsp; |
2399
+ | oldFiltersObj | `Object` | an object with the old filters structure | &nbsp; |
2400
+ | section | `String` | could be 'ANALYZE', 'PB', 'UM' or any other value. Deafult is 'ANYWHERE' | &nbsp; |
2416
2401
 
2417
2402
 
2418
2403
 
2419
2404
 
2420
- ##### Returns
2405
+ ##### Examples
2421
2406
 
2407
+ ```javascript
2422
2408
 
2423
- - a new settings object with all set parameters.
2409
+ const oldPreferenceFilters = {
2410
+ "WWXHAULtR-_-xYOQAdpqT__ENABLED": true,
2411
+ "WWXHAULtR-_-xYOQAdpqT__ALL--ENABLED": true,
2412
+ "WWXHAULtR-_-xYOQAdpqT__COLLAPSED": false,
2413
+ "WWXHAULtR-_-xYOQAdpqT__LABEL": "GLOBAL",
2414
+ "WWXHAULtR-_-xYOQAdpqT-_-AK4M8UV2": {
2415
+ "formulaId": null,
2416
+ "panelId": null,
2417
+ "values": [
2418
+ {
2419
+ "EQUALS": [
2420
+ {
2421
+ "id": "AK4M8UV2a0",
2422
+ "value": "A",
2423
+ "enabled": true,
2424
+ "imageUrl": null
2425
+ },
2426
+ {
2427
+ "id": "AK4M8UV2a1",
2428
+ "value": "B",
2429
+ "enabled": true,
2430
+ "imageUrl": null
2431
+ }
2432
+ ]
2433
+ }
2434
+ ],
2435
+ "bucketId": null,
2436
+ "text": "MC",
2437
+ "title": "MC",
2438
+ "type": "SINGLE_CHOICE",
2439
+ "qid": "AK4M8UV2",
2440
+ "dataset": {
2441
+ "sourceid": "xYOQAdpqT",
2442
+ "name": "Form All Questions",
2443
+ "qrveyid": "xYOQAdpqT",
2444
+ "text": "Form All Questions",
2445
+ "linkid": 0
2446
+ },
2447
+ "enabled": true,
2448
+ "linked": null
2449
+ }
2450
+ };
2424
2451
 
2452
+ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
2453
+ ```
2425
2454
 
2426
2455
 
2456
+ ##### Returns
2427
2457
 
2428
- ### dist/general/object/objectCopy.js
2429
2458
 
2459
+ - `Object` an object with the new filters structure
2430
2460
 
2431
- #### objectCopy(entity, cache)
2432
2461
 
2433
- Created a new reference of the given argument
2434
2462
 
2435
2463
 
2464
+ ### dist/filters/classes/FilterInputErrorHandler.js
2465
+
2466
+
2467
+ #### new FilterInputErrorHandler()
2468
+
2436
2469
 
2437
2470
 
2438
- ##### Parameters
2439
2471
 
2440
- | Name | Type | Description | |
2441
- | ---- | ---- | ----------- | -------- |
2442
- | entity | | The variable to be copied | &nbsp; |
2443
- | cache | | | &nbsp; |
2444
2472
 
2445
2473
 
2446
2474
 
@@ -2448,17 +2476,17 @@ Created a new reference of the given argument
2448
2476
  ##### Returns
2449
2477
 
2450
2478
 
2451
- - A new reference of the given argument
2479
+ - `Void`
2452
2480
 
2453
2481
 
2454
2482
 
2455
2483
 
2456
- ### dist/general/object/omit.js
2484
+ ### dist/filters/helpers/applyHierarchyForAggFilters.js
2457
2485
 
2458
2486
 
2459
- #### omit(obj, props)
2487
+ #### applyHierarchyForAggFilters(chartSettings, scopes, currentScope)
2460
2488
 
2461
- return a new Object excluding attributes in _props_ list
2489
+ [TODO: Make a proper description for this function]
2462
2490
 
2463
2491
 
2464
2492
 
@@ -2467,8 +2495,9 @@ return a new Object excluding attributes in _props_ list
2467
2495
 
2468
2496
  | Name | Type | Description | |
2469
2497
  | ---- | ---- | ----------- | -------- |
2470
- | obj | `Object` | base object | &nbsp; |
2471
- | props | `Array.<String>` | list of attribute to exclude | &nbsp; |
2498
+ | chartSettings | | Chart Settings for the Filter Builder | &nbsp; |
2499
+ | scopes | | | &nbsp; |
2500
+ | currentScope | | | &nbsp; |
2472
2501
 
2473
2502
 
2474
2503
 
@@ -2476,17 +2505,17 @@ return a new Object excluding attributes in _props_ list
2476
2505
  ##### Returns
2477
2506
 
2478
2507
 
2479
- - `Object` clean object
2508
+ -
2480
2509
 
2481
2510
 
2482
2511
 
2483
2512
 
2484
- ### dist/general/object/pick.js
2513
+ ### dist/filters/helpers/getAvailableScopes.js
2485
2514
 
2486
2515
 
2487
- #### pick(baseObject, keys)
2516
+ #### getAvailableScopes(config)
2488
2517
 
2489
- return a new object just with attributes in _keys_ list
2518
+ Gets Scopes/Scope IDs by given IDs
2490
2519
 
2491
2520
 
2492
2521
 
@@ -2495,8 +2524,7 @@ return a new object just with attributes in _keys_ list
2495
2524
 
2496
2525
  | Name | Type | Description | |
2497
2526
  | ---- | ---- | ----------- | -------- |
2498
- | baseObject | `Object` | base object | &nbsp; |
2499
- | keys | `Array.<String>` | list of attributes to preserve | &nbsp; |
2527
+ | config | | given Differnts IDs in order set a available scope | &nbsp; |
2500
2528
 
2501
2529
 
2502
2530
 
@@ -2504,17 +2532,17 @@ return a new object just with attributes in _keys_ list
2504
2532
  ##### Returns
2505
2533
 
2506
2534
 
2507
- - `Object` new object just with desired attributes
2535
+ - a Scopes/Scope IDs array
2508
2536
 
2509
2537
 
2510
2538
 
2511
2539
 
2512
- ### dist/general/object/serialize.js
2540
+ ### dist/filters/helpers/getAvailableScopesIDsByConfig.js
2513
2541
 
2514
2542
 
2515
- #### serialize(obj)
2543
+ #### getAvailableScopesIDsByConfig(config)
2516
2544
 
2517
- serialize object to url param
2545
+ Gets the Scopes IDS for the Available Scope function by any config
2518
2546
 
2519
2547
 
2520
2548
 
@@ -2523,7 +2551,7 @@ serialize object to url param
2523
2551
 
2524
2552
  | Name | Type | Description | |
2525
2553
  | ---- | ---- | ----------- | -------- |
2526
- | obj | | - Object to be serialized | &nbsp; |
2554
+ | config | | any config | &nbsp; |
2527
2555
 
2528
2556
 
2529
2557
 
@@ -2531,17 +2559,17 @@ serialize object to url param
2531
2559
  ##### Returns
2532
2560
 
2533
2561
 
2534
- - `Void`
2562
+ - a Available Scope IDS config
2535
2563
 
2536
2564
 
2537
2565
 
2538
2566
 
2539
- ### dist/general/string/capitalize.js
2567
+ ### dist/filters/helpers/getScopesByHierarchy.js
2540
2568
 
2541
2569
 
2542
- #### capitalize(text)
2570
+ #### getScopesByHierarchy(scopes, currentScope)
2543
2571
 
2544
- Upper case the first letter of a given text
2572
+ [TODO: Make a description for this]
2545
2573
 
2546
2574
 
2547
2575
 
@@ -2550,7 +2578,8 @@ Upper case the first letter of a given text
2550
2578
 
2551
2579
  | Name | Type | Description | |
2552
2580
  | ---- | ---- | ----------- | -------- |
2553
- | text | `String` | | &nbsp; |
2581
+ | scopes | | the collection of Scopes/Scope IDs | &nbsp; |
2582
+ | currentScope | | Current scope type | &nbsp; |
2554
2583
 
2555
2584
 
2556
2585
 
@@ -2558,7 +2587,7 @@ Upper case the first letter of a given text
2558
2587
  ##### Returns
2559
2588
 
2560
2589
 
2561
- - `String` a capitalized text
2590
+ - A new array of Scopes/Scope IDs
2562
2591
 
2563
2592
 
2564
2593
 
@@ -2590,12 +2619,12 @@ Get an string of the properties of the given column.
2590
2619
 
2591
2620
 
2592
2621
 
2593
- ### dist/services/api/getAllDatasets.api.js
2622
+ ### dist/services/api/getAllQrveys.api.js
2594
2623
 
2595
2624
 
2596
- #### getAllDatasets(qrveyids)
2625
+ #### getAllQrveys(config, params)
2597
2626
 
2598
- Get a dataset list from a collection of Qrvey IDs
2627
+ POST Request for getting Qrveys such as Web Forms and Datasets. Use params for getting precise data
2599
2628
 
2600
2629
 
2601
2630
 
@@ -2604,7 +2633,8 @@ Get a dataset list from a collection of Qrvey IDs
2604
2633
 
2605
2634
  | Name | Type | Description | |
2606
2635
  | ---- | ---- | ----------- | -------- |
2607
- | qrveyids | | Collection of Qrvey IDs | &nbsp; |
2636
+ | config | | Configuration | &nbsp; |
2637
+ | params | | Object for getting precise data | &nbsp; |
2608
2638
 
2609
2639
 
2610
2640
 
@@ -2612,17 +2642,17 @@ Get a dataset list from a collection of Qrvey IDs
2612
2642
  ##### Returns
2613
2643
 
2614
2644
 
2615
- - a promise
2645
+ - `Void`
2616
2646
 
2617
2647
 
2618
2648
 
2619
2649
 
2620
- ### dist/services/api/getAllQrveys.api.js
2650
+ ### dist/services/api/getAllDatasets.api.js
2621
2651
 
2622
2652
 
2623
- #### getAllQrveys(config, params)
2653
+ #### getAllDatasets(config, pickDatasets)
2624
2654
 
2625
- POST Request for getting Qrveys such as Web Forms and Datasets. Use params for getting precise data
2655
+ Get a dataset list from a collection of Qrvey IDs
2626
2656
 
2627
2657
 
2628
2658
 
@@ -2631,8 +2661,8 @@ POST Request for getting Qrveys such as Web Forms and Datasets. Use params for g
2631
2661
 
2632
2662
  | Name | Type | Description | |
2633
2663
  | ---- | ---- | ----------- | -------- |
2634
- | config | | Configuration | &nbsp; |
2635
- | params | | Object for getting precise data | &nbsp; |
2664
+ | config | | the widget config. Includes the appid and others configuration properties | &nbsp; |
2665
+ | pickDatasets | | Collection of Qrvey IDs for filtering the request | &nbsp; |
2636
2666
 
2637
2667
 
2638
2668
 
@@ -2640,7 +2670,7 @@ POST Request for getting Qrveys such as Web Forms and Datasets. Use params for g
2640
2670
  ##### Returns
2641
2671
 
2642
2672
 
2643
- - `Void`
2673
+ - a promise
2644
2674
 
2645
2675
 
2646
2676
 
@@ -2810,35 +2840,6 @@ try to find this string as a variable on Windows object
2810
2840
 
2811
2841
 
2812
2842
 
2813
- ### dist/general/object/mapValues.js
2814
-
2815
-
2816
- #### mapValues(baseObject, iteratee)
2817
-
2818
- Invoke iteratee (function) for each object key-value pair
2819
- and return a mapped object
2820
-
2821
-
2822
-
2823
-
2824
- ##### Parameters
2825
-
2826
- | Name | Type | Description | |
2827
- | ---- | ---- | ----------- | -------- |
2828
- | baseObject | `Object` | Base object. | &nbsp; |
2829
- | iteratee | `Function` | The executed per iteration. | &nbsp; |
2830
-
2831
-
2832
-
2833
-
2834
- ##### Returns
2835
-
2836
-
2837
- - `Object` New mapped object.
2838
-
2839
-
2840
-
2841
-
2842
2843
  ### dist/dates/relative/helpers/formatStatement.js
2843
2844
 
2844
2845
 
@@ -4178,6 +4179,34 @@ Gets output format object from Datasets by the given column. Item of the dataset
4178
4179
 
4179
4180
 
4180
4181
 
4182
+ ### dist/filters/helpers/ui/getQrveyIdsByUIFilters.js
4183
+
4184
+
4185
+ #### getQrveyIdsByUIFilters(uiFilter)
4186
+
4187
+ Gets a collection of Qrvey IDs in the UI Filter structure.
4188
+ Looks around all filter structure finding the qrveyid propertty in each dataset
4189
+
4190
+
4191
+
4192
+
4193
+ ##### Parameters
4194
+
4195
+ | Name | Type | Description | |
4196
+ | ---- | ---- | ----------- | -------- |
4197
+ | uiFilter | | | &nbsp; |
4198
+
4199
+
4200
+
4201
+
4202
+ ##### Returns
4203
+
4204
+
4205
+ - `Void`
4206
+
4207
+
4208
+
4209
+
4181
4210
  ### dist/filters/helpers/ui/getUIFlatFilterByParams.js
4182
4211
 
4183
4212
 
@@ -4292,6 +4321,34 @@ Filters and gets a UI Flatten Filters by the given scopes
4292
4321
 
4293
4322
 
4294
4323
 
4324
+ ### dist/filters/helpers/ui/getUpdatedUIFilters.js
4325
+
4326
+
4327
+ #### getUpdatedUIFilters(data, datasets)
4328
+
4329
+ Gets a new UI Filter structure with a datasets/columns info updates
4330
+
4331
+
4332
+
4333
+
4334
+ ##### Parameters
4335
+
4336
+ | Name | Type | Description | |
4337
+ | ---- | ---- | ----------- | -------- |
4338
+ | data | | The UI Filter structure | &nbsp; |
4339
+ | datasets | | An array of datasets/column info used for updating the data | &nbsp; |
4340
+
4341
+
4342
+
4343
+
4344
+ ##### Returns
4345
+
4346
+
4347
+ - A new UI FIlter structure
4348
+
4349
+
4350
+
4351
+
4295
4352
  ### dist/filters/helpers/ui/resolveUIFlatFiltersByParams.js
4296
4353
 
4297
4354