@qrvey/utils 1.2.9-13 → 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 (94) hide show
  1. package/README.md +700 -643
  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/getUpdatedUIFilters.d.ts +9 -0
  9. package/dist/cjs/filters/helpers/ui/getUpdatedUIFilters.js +36 -0
  10. package/dist/cjs/filters/helpers/ui/index.d.ts +2 -0
  11. package/dist/cjs/filters/helpers/ui/index.js +2 -0
  12. package/dist/cjs/filters/interfaces/panel/IFPSettingsGeneral.d.ts +2 -1
  13. package/dist/cjs/globalization/interfaces/IResourceI18n.d.ts +2 -0
  14. package/dist/cjs/globalization/interfaces/index.d.ts +4 -1
  15. package/dist/cjs/globalization/interfaces/index.js +4 -1
  16. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemes.d.ts +13 -0
  17. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemes.js +2 -0
  18. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.d.ts +6 -0
  19. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.js +2 -0
  20. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMenu.d.ts +6 -0
  21. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMenu.js +2 -0
  22. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMessages.d.ts +9 -0
  23. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMessages.js +2 -0
  24. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +27 -0
  25. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.js +2 -0
  26. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTooltips.d.ts +3 -0
  27. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTooltips.js +2 -0
  28. package/dist/cjs/globalization/interfaces/style_themes/index.d.ts +6 -0
  29. package/dist/cjs/globalization/interfaces/style_themes/index.js +18 -0
  30. package/dist/cjs/globalization/labels/I18N_DEFAULT.js +2 -0
  31. package/dist/cjs/globalization/labels/index.d.ts +5 -3
  32. package/dist/cjs/globalization/labels/index.js +5 -3
  33. package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.d.ts +2 -0
  34. package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.js +57 -0
  35. package/dist/cjs/globalization/labels/style_themes/index.d.ts +1 -0
  36. package/dist/cjs/globalization/labels/style_themes/index.js +13 -0
  37. package/dist/cjs/globalization/labels/table_charts/I18N_TABLE_CHARTS.js +1 -1
  38. package/dist/cjs/services/api/getAllDatasets.api.d.ts +2 -1
  39. package/dist/cjs/services/api/getAllDatasets.api.js +2 -1
  40. package/dist/filters/helpers/ui/getQrveyIdsByUIFilters.d.ts +7 -0
  41. package/dist/filters/helpers/ui/getQrveyIdsByUIFilters.js +20 -0
  42. package/dist/filters/helpers/ui/getUpdatedUIFilters.d.ts +9 -0
  43. package/dist/filters/helpers/ui/getUpdatedUIFilters.js +32 -0
  44. package/dist/filters/helpers/ui/index.d.ts +2 -0
  45. package/dist/filters/helpers/ui/index.js +2 -0
  46. package/dist/filters/interfaces/panel/IFPSettingsGeneral.d.ts +2 -1
  47. package/dist/globalization/interfaces/IResourceI18n.d.ts +2 -0
  48. package/dist/globalization/interfaces/index.d.ts +4 -1
  49. package/dist/globalization/interfaces/index.js +4 -1
  50. package/dist/globalization/interfaces/style_themes/II18nStyleThemes.d.ts +13 -0
  51. package/dist/globalization/interfaces/style_themes/II18nStyleThemes.js +1 -0
  52. package/dist/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.d.ts +6 -0
  53. package/dist/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.js +1 -0
  54. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMenu.d.ts +6 -0
  55. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMenu.js +1 -0
  56. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMessages.d.ts +9 -0
  57. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMessages.js +1 -0
  58. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +27 -0
  59. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.js +1 -0
  60. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTooltips.d.ts +3 -0
  61. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTooltips.js +1 -0
  62. package/dist/globalization/interfaces/style_themes/index.d.ts +6 -0
  63. package/dist/globalization/interfaces/style_themes/index.js +6 -0
  64. package/dist/globalization/labels/I18N_DEFAULT.js +2 -0
  65. package/dist/globalization/labels/index.d.ts +5 -3
  66. package/dist/globalization/labels/index.js +5 -3
  67. package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.d.ts +2 -0
  68. package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.js +54 -0
  69. package/dist/globalization/labels/style_themes/index.d.ts +1 -0
  70. package/dist/globalization/labels/style_themes/index.js +1 -0
  71. package/dist/globalization/labels/table_charts/I18N_TABLE_CHARTS.js +1 -1
  72. package/dist/services/api/getAllDatasets.api.d.ts +2 -1
  73. package/dist/services/api/getAllDatasets.api.js +2 -1
  74. package/package.json +1 -1
  75. package/src/charts/constants/AGGREGATE_LABEL.ts +1 -1
  76. package/src/filters/helpers/ui/getQrveyIdsByUIFilters.ts +22 -0
  77. package/src/filters/helpers/ui/getUpdatedUIFilters.ts +34 -0
  78. package/src/filters/helpers/ui/index.ts +2 -0
  79. package/src/filters/interfaces/panel/IFPSettingsGeneral.ts +2 -1
  80. package/src/globalization/interfaces/IResourceI18n.ts +2 -0
  81. package/src/globalization/interfaces/index.ts +4 -1
  82. package/src/globalization/interfaces/style_themes/II18nStyleThemes.ts +14 -0
  83. package/src/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.ts +6 -0
  84. package/src/globalization/interfaces/style_themes/II18nStyleThemesMenu.ts +6 -0
  85. package/src/globalization/interfaces/style_themes/II18nStyleThemesMessages.ts +9 -0
  86. package/src/globalization/interfaces/style_themes/II18nStyleThemesTheme.ts +27 -0
  87. package/src/globalization/interfaces/style_themes/II18nStyleThemesTooltips.ts +3 -0
  88. package/src/globalization/interfaces/style_themes/index.ts +6 -0
  89. package/src/globalization/labels/I18N_DEFAULT.ts +2 -0
  90. package/src/globalization/labels/index.ts +5 -3
  91. package/src/globalization/labels/style_themes/I18N_STYLE_THEMES.ts +56 -0
  92. package/src/globalization/labels/style_themes/index.ts +1 -0
  93. package/src/globalization/labels/table_charts/I18N_TABLE_CHARTS.ts +1 -1
  94. 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-13*
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,26 +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/adaptDateGroupingProperty.js
950
999
 
1000
+ - `Promise` Promise when all script have been loaded
951
1001
 
952
- #### adaptDateGroupingProperty(property)
953
1002
 
954
- [TODO: For 2022, eliminate this adapter]
955
- Get the new property base on the old date grouping properties
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
956
1008
 
957
1009
 
958
1010
 
@@ -961,7 +1013,9 @@ Get the new property base on the old date grouping properties
961
1013
 
962
1014
  | Name | Type | Description | |
963
1015
  | ---- | ---- | ----------- | -------- |
964
- | property | | | &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; |
965
1019
 
966
1020
 
967
1021
 
@@ -969,17 +1023,17 @@ Get the new property base on the old date grouping properties
969
1023
  ##### Returns
970
1024
 
971
1025
 
972
- -
1026
+ - `Void`
973
1027
 
974
1028
 
975
1029
 
976
1030
 
977
- ### dist/filters/adapters/adaptFilterData.js
1031
+ ### dist/general/mix/isEmpty.js
978
1032
 
979
1033
 
980
- #### adaptFilterData(filterData, getUIFilterData, datasetsInfo)
1034
+ #### isEmpty(variable, includeFalsy)
981
1035
 
982
- Checks and adapts the v2.0 Filter Data Structure to the v2.1
1036
+ Validates if the given argument is empty
983
1037
 
984
1038
 
985
1039
 
@@ -988,9 +1042,8 @@ Checks and adapts the v2.0 Filter Data Structure to the v2.1
988
1042
 
989
1043
  | Name | Type | Description | |
990
1044
  | ---- | ---- | ----------- | -------- |
991
- | filterData | | The filter data structure. Accepts both v2.1 or v2.0 | &nbsp; |
992
- | getUIFilterData | | Flag to get a Filter Data (False) or the UI Filter Data (True) | &nbsp; |
993
- | datasetsInfo | | Collection of datasets information. If getUIFilterData is true, the datasetsInfo should be mandatory | &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,18 +1051,19 @@ Checks and adapts the v2.0 Filter Data Structure to the v2.1
998
1051
  ##### Returns
999
1052
 
1000
1053
 
1001
- - A new filter data structure v2.1
1054
+ - true: the given argument is empty; false: is not.
1002
1055
 
1003
1056
 
1004
1057
 
1005
1058
 
1006
- ### dist/filters/adapters/adaptFilterValues.js
1059
+ ### dist/general/mix/isNaNV2.js
1007
1060
 
1008
1061
 
1009
- #### adaptFilterValues(filter)
1062
+ #### isNaNV2(variable)
1010
1063
 
1011
- [TODO: For 2022, eliminate this adapter]
1012
- Gets an adapted filter value array. Validates the enabled property and sets
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.
1013
1067
 
1014
1068
 
1015
1069
 
@@ -1018,7 +1072,7 @@ Gets an adapted filter value array. Validates the enabled property and sets
1018
1072
 
1019
1073
  | Name | Type | Description | |
1020
1074
  | ---- | ---- | ----------- | -------- |
1021
- | filter | | The filter | &nbsp; |
1075
+ | variable | | the variable to validate | &nbsp; |
1022
1076
 
1023
1077
 
1024
1078
 
@@ -1026,17 +1080,18 @@ Gets an adapted filter value array. Validates the enabled property and sets
1026
1080
  ##### Returns
1027
1081
 
1028
1082
 
1029
- - A new value array with the filled properties.
1083
+ - True if variable is a NaN or false otherwise
1030
1084
 
1031
1085
 
1032
1086
 
1033
1087
 
1034
- ### dist/filters/adapters/flatUIToFD.js
1088
+ ### dist/general/mix/isNull.js
1035
1089
 
1036
1090
 
1037
- #### flatUIToFD(uFilters, version)
1091
+ #### isNull(arg)
1038
1092
 
1039
- Generates a filter data structure from the flatttened UI filters.
1093
+ return if a given variable is either `null` or `undefined`
1094
+ useful to avoid falsify validating Number Zero (0)
1040
1095
 
1041
1096
 
1042
1097
 
@@ -1045,8 +1100,7 @@ Generates a filter data structure from the flatttened UI filters.
1045
1100
 
1046
1101
  | Name | Type | Description | |
1047
1102
  | ---- | ---- | ----------- | -------- |
1048
- | uFilters | | Array of flattened filters from UI | &nbsp; |
1049
- | version | | Tag for the version of the filter data structure | &nbsp; |
1103
+ | arg | `any` | | &nbsp; |
1050
1104
 
1051
1105
 
1052
1106
 
@@ -1054,14 +1108,19 @@ Generates a filter data structure from the flatttened UI filters.
1054
1108
  ##### Returns
1055
1109
 
1056
1110
 
1057
- - a Filter Data.
1111
+ - `Boolean`
1058
1112
 
1059
1113
 
1060
1114
 
1061
- #### buildScopes(fbFilters)
1062
1115
 
1063
- Gets an array of scopes structure for the filter data. The scopes is organized by scope types and scope IDs
1064
- Also, adds and organizes filters by datasets
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.
1065
1124
 
1066
1125
 
1067
1126
 
@@ -1070,7 +1129,8 @@ Also, adds and organizes filters by datasets
1070
1129
 
1071
1130
  | Name | Type | Description | |
1072
1131
  | ---- | ---- | ----------- | -------- |
1073
- | fbFilters | | Array of flat filters from UI | &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; |
1074
1134
 
1075
1135
 
1076
1136
 
@@ -1078,13 +1138,19 @@ Also, adds and organizes filters by datasets
1078
1138
  ##### Returns
1079
1139
 
1080
1140
 
1081
- - an array of scopes structure.
1141
+ - `String` Random string
1082
1142
 
1083
1143
 
1084
1144
 
1085
- #### buildScope(uFilter)
1086
1145
 
1087
- Gets an scope 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.
1088
1154
 
1089
1155
 
1090
1156
 
@@ -1093,7 +1159,7 @@ Gets an scope structure for the filter data
1093
1159
 
1094
1160
  | Name | Type | Description | |
1095
1161
  | ---- | ---- | ----------- | -------- |
1096
- | uFilter | | UI structure filter | &nbsp; |
1162
+ | obj | `Any` | Any object-type variable | &nbsp; |
1097
1163
 
1098
1164
 
1099
1165
 
@@ -1101,13 +1167,18 @@ Gets an scope structure for the filter data
1101
1167
  ##### Returns
1102
1168
 
1103
1169
 
1104
- - an scope structure
1170
+ - `Number` the size of the given variable
1105
1171
 
1106
1172
 
1107
1173
 
1108
- #### buildDataset(uFilter)
1109
1174
 
1110
- Gets an dataset 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
1111
1182
 
1112
1183
 
1113
1184
 
@@ -1116,7 +1187,7 @@ Gets an dataset structure for the filter data
1116
1187
 
1117
1188
  | Name | Type | Description | |
1118
1189
  | ---- | ---- | ----------- | -------- |
1119
- | uFilter | | a UI structure filter | &nbsp; |
1190
+ | obj | | The object | &nbsp; |
1120
1191
 
1121
1192
 
1122
1193
 
@@ -1124,13 +1195,21 @@ Gets an dataset structure for the filter data
1124
1195
  ##### Returns
1125
1196
 
1126
1197
 
1127
- - an dataset structure
1198
+ - The new reference object or the given object if the parsing is incorrect or empty
1128
1199
 
1129
1200
 
1130
1201
 
1131
- #### buildFilter(uFilter)
1132
1202
 
1133
- Gets an filter structure for the filter data
1203
+ ### dist/general/object/get.js
1204
+
1205
+
1206
+ #### _get(baseObject, path, defaultValue)
1207
+
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.
1134
1213
 
1135
1214
 
1136
1215
 
@@ -1139,25 +1218,59 @@ Gets an filter structure for the filter data
1139
1218
 
1140
1219
  | Name | Type | Description | |
1141
1220
  | ---- | ---- | ----------- | -------- |
1142
- | uFilter | | a UI structure filter | &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; |
1224
+
1225
+
1226
+
1143
1227
 
1228
+ ##### Examples
1144
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
+ ```
1145
1250
 
1146
1251
 
1147
1252
  ##### Returns
1148
1253
 
1149
1254
 
1150
- - an filter structure
1255
+ - the resolved value.
1151
1256
 
1152
1257
 
1153
1258
 
1154
1259
 
1155
- ### dist/filters/adapters/flatUIToLogic.js
1260
+ ### dist/general/object/getAttribute.js
1156
1261
 
1157
1262
 
1158
- #### flatUIToLogic(uFilter)
1263
+ #### getAttribute(obj, key)
1159
1264
 
1160
- 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
1161
1274
 
1162
1275
 
1163
1276
 
@@ -1166,25 +1279,33 @@ Generates a Logic structure from flattened UI filters
1166
1279
 
1167
1280
  | Name | Type | Description | |
1168
1281
  | ---- | ---- | ----------- | -------- |
1169
- | uFilter | | 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; |
1170
1284
 
1171
1285
 
1172
1286
 
1173
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
+
1294
+
1174
1295
  ##### Returns
1175
1296
 
1176
1297
 
1177
- - The logic structure
1298
+ - `Void`
1178
1299
 
1179
1300
 
1180
1301
 
1181
1302
 
1182
- ### dist/filters/adapters/flatUIToOldLogic.js
1303
+ ### dist/general/object/hasProperty.js
1183
1304
 
1184
1305
 
1185
- #### flatUIToOldLogic(uFilters)
1306
+ #### _hasProperty(obj, property)
1186
1307
 
1187
- Generates a Logic structure from flattened UI filters
1308
+ Use the hasOwnProperty in order to verify if the given property exists in the object.
1188
1309
 
1189
1310
 
1190
1311
 
@@ -1193,25 +1314,38 @@ Generates a Logic structure from flattened UI filters
1193
1314
 
1194
1315
  | Name | Type | Description | |
1195
1316
  | ---- | ---- | ----------- | -------- |
1196
- | uFilters | | Array of flat filters from UI | &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
- - The logic structure
1338
+ - True if the object has the given property; otherwise, false.
1205
1339
 
1206
1340
 
1207
1341
 
1208
1342
 
1209
- ### dist/filters/adapters/flatUIToUI.js
1343
+ ### dist/general/object/isObject.js
1210
1344
 
1211
1345
 
1212
- #### flatUIToUI(uFilters, version)
1346
+ #### isObject(obj)
1213
1347
 
1214
- Generates a UI filter data structure from the flatttened UI filters.
1348
+ Checks if the given argument is an object type
1215
1349
 
1216
1350
 
1217
1351
 
@@ -1220,8 +1354,7 @@ Generates a UI filter data structure from the flatttened UI filters.
1220
1354
 
1221
1355
  | Name | Type | Description | |
1222
1356
  | ---- | ---- | ----------- | -------- |
1223
- | uFilters | | Array of flattened filters from UI | &nbsp; |
1224
- | version | | Tag for the version of the filter data structure | &nbsp; |
1357
+ | obj | | the variable to check | &nbsp; |
1225
1358
 
1226
1359
 
1227
1360
 
@@ -1229,14 +1362,18 @@ Generates a UI filter data structure from the flatttened UI filters.
1229
1362
  ##### Returns
1230
1363
 
1231
1364
 
1232
- - a UI Filter Data.
1365
+ - True: It is an object; False: It is not.
1233
1366
 
1234
1367
 
1235
1368
 
1236
- #### buildScopes(fbFilters)
1237
1369
 
1238
- Gets an array of scopes structure for the UI filter data. The scopes is organized by scope types and scope IDs
1239
- Also, adds and organizes filters by datasets
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
1240
1377
 
1241
1378
 
1242
1379
 
@@ -1245,7 +1382,8 @@ Also, adds and organizes filters by datasets
1245
1382
 
1246
1383
  | Name | Type | Description | |
1247
1384
  | ---- | ---- | ----------- | -------- |
1248
- | fbFilters | | Array of flat filters from UI | &nbsp; |
1385
+ | baseObject | `Object` | Base object. | &nbsp; |
1386
+ | iteratee | `Function` | The executed per iteration. | &nbsp; |
1249
1387
 
1250
1388
 
1251
1389
 
@@ -1253,13 +1391,18 @@ Also, adds and organizes filters by datasets
1253
1391
  ##### Returns
1254
1392
 
1255
1393
 
1256
- - an array of scopes structure.
1394
+ - `Object` New mapped object.
1257
1395
 
1258
1396
 
1259
1397
 
1260
- #### buildScope(uFilter)
1261
1398
 
1262
- Gets an scope 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.
1263
1406
 
1264
1407
 
1265
1408
 
@@ -1268,7 +1411,9 @@ Gets an scope structure for the UI filter data
1268
1411
 
1269
1412
  | Name | Type | Description | |
1270
1413
  | ---- | ---- | ----------- | -------- |
1271
- | uFilter | | 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; |
1272
1417
 
1273
1418
 
1274
1419
 
@@ -1276,13 +1421,13 @@ Gets an scope structure for the UI filter data
1276
1421
  ##### Returns
1277
1422
 
1278
1423
 
1279
- - an scope structure
1424
+ - a new merged object
1280
1425
 
1281
1426
 
1282
1427
 
1283
- #### buildDataset(uFilter)
1428
+ #### isValid(obj1, obj2)
1284
1429
 
1285
- Gets an dataset structure for the UI filter data
1430
+ Validates if the two arguments are objects
1286
1431
 
1287
1432
 
1288
1433
 
@@ -1291,7 +1436,8 @@ Gets an dataset structure for the UI filter data
1291
1436
 
1292
1437
  | Name | Type | Description | |
1293
1438
  | ---- | ---- | ----------- | -------- |
1294
- | uFilter | | a UI structure filter | &nbsp; |
1439
+ | obj1 | | The target object | &nbsp; |
1440
+ | obj2 | | The object to be merged | &nbsp; |
1295
1441
 
1296
1442
 
1297
1443
 
@@ -1299,13 +1445,13 @@ Gets an dataset structure for the UI filter data
1299
1445
  ##### Returns
1300
1446
 
1301
1447
 
1302
- - an dataset structure
1448
+ - true: they are valid; false: they are not
1303
1449
 
1304
1450
 
1305
1451
 
1306
- #### buildFilter(uFilter)
1452
+ #### getParamsToMergeDeep(settings)
1307
1453
 
1308
- Gets an filter structure for the UI filter data
1454
+ Validates and gets the settings with all set parameters.
1309
1455
 
1310
1456
 
1311
1457
 
@@ -1314,7 +1460,7 @@ Gets an filter structure for the UI filter data
1314
1460
 
1315
1461
  | Name | Type | Description | |
1316
1462
  | ---- | ---- | ----------- | -------- |
1317
- | uFilter | | a UI structure filter | &nbsp; |
1463
+ | settings | | the settings object | &nbsp; |
1318
1464
 
1319
1465
 
1320
1466
 
@@ -1322,17 +1468,17 @@ Gets an filter structure for the UI filter data
1322
1468
  ##### Returns
1323
1469
 
1324
1470
 
1325
- - an filter structure
1471
+ - a new settings object with all set parameters.
1326
1472
 
1327
1473
 
1328
1474
 
1329
1475
 
1330
- ### dist/filters/adapters/logicToFD.js
1476
+ ### dist/general/object/objectCopy.js
1331
1477
 
1332
1478
 
1333
- #### logicToFD(filterData, version)
1479
+ #### objectCopy(entity, cache)
1334
1480
 
1335
- Generates a filter data structure from the old logic structure (v2.0).
1481
+ Created a new reference of the given argument
1336
1482
 
1337
1483
 
1338
1484
 
@@ -1341,8 +1487,8 @@ Generates a filter data structure from the old logic structure (v2.0).
1341
1487
 
1342
1488
  | Name | Type | Description | |
1343
1489
  | ---- | ---- | ----------- | -------- |
1344
- | filterData | | The old filter data structure with logic (v2.0) | &nbsp; |
1345
- | version | | Tag for the version of the filter data structure | &nbsp; |
1490
+ | entity | | The variable to be copied | &nbsp; |
1491
+ | cache | | | &nbsp; |
1346
1492
 
1347
1493
 
1348
1494
 
@@ -1350,17 +1496,17 @@ Generates a filter data structure from the old logic structure (v2.0).
1350
1496
  ##### Returns
1351
1497
 
1352
1498
 
1353
- - a Filter Data.
1499
+ - A new reference of the given argument
1354
1500
 
1355
1501
 
1356
1502
 
1357
1503
 
1358
- ### dist/filters/adapters/logicToFlatUI.js
1504
+ ### dist/general/object/omit.js
1359
1505
 
1360
1506
 
1361
- #### logicToFlatUI(logics)
1507
+ #### omit(obj, props)
1362
1508
 
1363
- Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
1509
+ return a new Object excluding attributes in _props_ list
1364
1510
 
1365
1511
 
1366
1512
 
@@ -1369,7 +1515,8 @@ Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
1369
1515
 
1370
1516
  | Name | Type | Description | |
1371
1517
  | ---- | ---- | ----------- | -------- |
1372
- | logics | | The old logic structure (v2.0) | &nbsp; |
1518
+ | obj | `Object` | base object | &nbsp; |
1519
+ | props | `Array.<String>` | list of attribute to exclude | &nbsp; |
1373
1520
 
1374
1521
 
1375
1522
 
@@ -1377,13 +1524,17 @@ Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
1377
1524
  ##### Returns
1378
1525
 
1379
1526
 
1380
- - The Flattened UI Filters array
1527
+ - `Object` clean object
1381
1528
 
1382
1529
 
1383
1530
 
1384
- #### getFilter(filters, filter, getIndex)
1385
1531
 
1386
- Get the filter or the index of the given array, validating an old filter structure.
1532
+ ### dist/general/object/pick.js
1533
+
1534
+
1535
+ #### pick(baseObject, keys)
1536
+
1537
+ return a new object just with attributes in _keys_ list
1387
1538
 
1388
1539
 
1389
1540
 
@@ -1392,9 +1543,8 @@ Get the filter or the index of the given array, validating an old filter structu
1392
1543
 
1393
1544
  | Name | Type | Description | |
1394
1545
  | ---- | ---- | ----------- | -------- |
1395
- | filters | | The array of UI filters | &nbsp; |
1396
- | filter | | The old logic structure filter | &nbsp; |
1397
- | getIndex | | Determines if the index or returns the UI filter object | &nbsp; |
1546
+ | baseObject | `Object` | base object | &nbsp; |
1547
+ | keys | `Array.<String>` | list of attributes to preserve | &nbsp; |
1398
1548
 
1399
1549
 
1400
1550
 
@@ -1402,13 +1552,17 @@ Get the filter or the index of the given array, validating an old filter structu
1402
1552
  ##### Returns
1403
1553
 
1404
1554
 
1405
- - the index or the UI filter object
1555
+ - `Object` new object just with desired attributes
1406
1556
 
1407
1557
 
1408
1558
 
1409
- #### refineRankingValues(values, uiValues)
1410
1559
 
1411
- Refines the values of the Ranking column type.
1560
+ ### dist/general/object/serialize.js
1561
+
1562
+
1563
+ #### serialize(obj)
1564
+
1565
+ serialize object to url param
1412
1566
 
1413
1567
 
1414
1568
 
@@ -1417,8 +1571,7 @@ Refines the values of the Ranking column type.
1417
1571
 
1418
1572
  | Name | Type | Description | |
1419
1573
  | ---- | ---- | ----------- | -------- |
1420
- | values | | the Array of Ranking values | &nbsp; |
1421
- | uiValues | | Object with additional info about the values of the filter. | &nbsp; |
1574
+ | obj | | - Object to be serialized | &nbsp; |
1422
1575
 
1423
1576
 
1424
1577
 
@@ -1426,17 +1579,17 @@ Refines the values of the Ranking column type.
1426
1579
  ##### Returns
1427
1580
 
1428
1581
 
1429
- - the array of Ranking values
1582
+ - `Void`
1430
1583
 
1431
1584
 
1432
1585
 
1433
1586
 
1434
- ### dist/filters/adapters/logicToUI.js
1587
+ ### dist/general/string/capitalize.js
1435
1588
 
1436
1589
 
1437
- #### logicToUI(uFilters, datasetsInfo)
1590
+ #### capitalize(text)
1438
1591
 
1439
- Generates a UI filter structure from the old logic structure (v2.0).
1592
+ Upper case the first letter of a given text
1440
1593
 
1441
1594
 
1442
1595
 
@@ -1445,8 +1598,7 @@ Generates a UI filter structure from the old logic structure (v2.0).
1445
1598
 
1446
1599
  | Name | Type | Description | |
1447
1600
  | ---- | ---- | ----------- | -------- |
1448
- | uFilters | | Array of filters from old logic structure | &nbsp; |
1449
- | datasetsInfo | | Collection of datasets information | &nbsp; |
1601
+ | text | `String` | | &nbsp; |
1450
1602
 
1451
1603
 
1452
1604
 
@@ -1454,17 +1606,17 @@ Generates a UI filter structure from the old logic structure (v2.0).
1454
1606
  ##### Returns
1455
1607
 
1456
1608
 
1457
- - a UI Filter Data.
1609
+ - `String` a capitalized text
1458
1610
 
1459
1611
 
1460
1612
 
1461
1613
 
1462
- ### dist/filters/adapters/transformFilters.js
1614
+ ### dist/filters/adapters/FDToLogic.js
1463
1615
 
1464
1616
 
1465
- #### transformFilters(oldFiltersObj, section)
1617
+ #### FDToLogic(filterData)
1466
1618
 
1467
- Transform the old filters structure into the new one
1619
+ Generates a Filter Logic structure from Filter Data structure.
1468
1620
 
1469
1621
 
1470
1622
 
@@ -1473,79 +1625,30 @@ Transform the old filters structure into the new one
1473
1625
 
1474
1626
  | Name | Type | Description | |
1475
1627
  | ---- | ---- | ----------- | -------- |
1476
- | oldFiltersObj | `Object` | an object with the old filters structure | &nbsp; |
1477
- | section | `String` | could be 'ANALYZE', 'PB', 'UM' or any other value. Deafult is 'ANYWHERE' | &nbsp; |
1478
-
1479
-
1480
-
1481
-
1482
- ##### Examples
1483
-
1484
- ```javascript
1628
+ | filterData | | The filter data object. | &nbsp; |
1485
1629
 
1486
- const oldPreferenceFilters = {
1487
- "WWXHAULtR-_-xYOQAdpqT__ENABLED": true,
1488
- "WWXHAULtR-_-xYOQAdpqT__ALL--ENABLED": true,
1489
- "WWXHAULtR-_-xYOQAdpqT__COLLAPSED": false,
1490
- "WWXHAULtR-_-xYOQAdpqT__LABEL": "GLOBAL",
1491
- "WWXHAULtR-_-xYOQAdpqT-_-AK4M8UV2": {
1492
- "formulaId": null,
1493
- "panelId": null,
1494
- "values": [
1495
- {
1496
- "EQUALS": [
1497
- {
1498
- "id": "AK4M8UV2a0",
1499
- "value": "A",
1500
- "enabled": true,
1501
- "imageUrl": null
1502
- },
1503
- {
1504
- "id": "AK4M8UV2a1",
1505
- "value": "B",
1506
- "enabled": true,
1507
- "imageUrl": null
1508
- }
1509
- ]
1510
- }
1511
- ],
1512
- "bucketId": null,
1513
- "text": "MC",
1514
- "title": "MC",
1515
- "type": "SINGLE_CHOICE",
1516
- "qid": "AK4M8UV2",
1517
- "dataset": {
1518
- "sourceid": "xYOQAdpqT",
1519
- "name": "Form All Questions",
1520
- "qrveyid": "xYOQAdpqT",
1521
- "text": "Form All Questions",
1522
- "linkid": 0
1523
- },
1524
- "enabled": true,
1525
- "linked": null
1526
- }
1527
- };
1528
1630
 
1529
- const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
1530
- ```
1531
1631
 
1532
1632
 
1533
1633
  ##### Returns
1534
1634
 
1535
1635
 
1536
- - `Object` an object with the new filters structure
1537
-
1636
+ - a filter logic array
1538
1637
 
1539
1638
 
1540
1639
 
1541
- ### dist/filters/classes/FilterInputErrorHandler.js
1640
+ #### getLogicBodyFromFD21(filterData)
1542
1641
 
1642
+ Gets the logic body
1543
1643
 
1544
- #### new FilterInputErrorHandler()
1545
1644
 
1546
1645
 
1547
1646
 
1647
+ ##### Parameters
1548
1648
 
1649
+ | Name | Type | Description | |
1650
+ | ---- | ---- | ----------- | -------- |
1651
+ | filterData | | The filter data object | &nbsp; |
1549
1652
 
1550
1653
 
1551
1654
 
@@ -1553,17 +1656,17 @@ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
1553
1656
  ##### Returns
1554
1657
 
1555
1658
 
1556
- - `Void`
1659
+ - a filter logic array
1557
1660
 
1558
1661
 
1559
1662
 
1560
1663
 
1561
- ### dist/filters/helpers/applyHierarchyForAggFilters.js
1664
+ ### dist/filters/adapters/FDToFlatUI.js
1562
1665
 
1563
1666
 
1564
- #### applyHierarchyForAggFilters(chartSettings, scopes, currentScope)
1667
+ #### FDToFlatUI(filterData, datasetsInfo)
1565
1668
 
1566
- [TODO: Make a proper description for this function]
1669
+ Generates a Flattened UI filter structure from Filter Data structure.
1567
1670
 
1568
1671
 
1569
1672
 
@@ -1572,9 +1675,8 @@ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
1572
1675
 
1573
1676
  | Name | Type | Description | |
1574
1677
  | ---- | ---- | ----------- | -------- |
1575
- | chartSettings | | Chart Settings for the Filter Builder | &nbsp; |
1576
- | scopes | | | &nbsp; |
1577
- | currentScope | | | &nbsp; |
1678
+ | filterData | | The filter data object. | &nbsp; |
1679
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
1578
1680
 
1579
1681
 
1580
1682
 
@@ -1582,17 +1684,13 @@ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
1582
1684
  ##### Returns
1583
1685
 
1584
1686
 
1585
- -
1586
-
1587
-
1588
-
1687
+ - a flattened UI filters array
1589
1688
 
1590
- ### dist/filters/helpers/getAvailableScopes.js
1591
1689
 
1592
1690
 
1593
- #### getAvailableScopes(config)
1691
+ #### FD21ToFlatUI(scopes, datasetsInfo)
1594
1692
 
1595
- Gets Scopes/Scope IDs by given IDs
1693
+ Generates a Filter Builder Structure from the Filter Data structure v2.1
1596
1694
 
1597
1695
 
1598
1696
 
@@ -1601,7 +1699,8 @@ Gets Scopes/Scope IDs by given IDs
1601
1699
 
1602
1700
  | Name | Type | Description | |
1603
1701
  | ---- | ---- | ----------- | -------- |
1604
- | config | | given Differnts IDs in order set a available scope | &nbsp; |
1702
+ | scopes | | The filter scope section | &nbsp; |
1703
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
1605
1704
 
1606
1705
 
1607
1706
 
@@ -1609,17 +1708,17 @@ Gets Scopes/Scope IDs by given IDs
1609
1708
  ##### Returns
1610
1709
 
1611
1710
 
1612
- - a Scopes/Scope IDs array
1711
+ - a flattened UI filters array
1613
1712
 
1614
1713
 
1615
1714
 
1616
1715
 
1617
- ### dist/filters/helpers/getAvailableScopesIDsByConfig.js
1716
+ ### dist/filters/adapters/FDToUI.js
1618
1717
 
1619
1718
 
1620
- #### getAvailableScopesIDsByConfig(config)
1719
+ #### FDToUI(filterData, datasetsInfo)
1621
1720
 
1622
- Gets the Scopes IDS for the Available Scope function by any config
1721
+ Generates a UI filter structure from Filter Data structure.
1623
1722
 
1624
1723
 
1625
1724
 
@@ -1628,7 +1727,8 @@ Gets the Scopes IDS for the Available Scope function by any config
1628
1727
 
1629
1728
  | Name | Type | Description | |
1630
1729
  | ---- | ---- | ----------- | -------- |
1631
- | config | | any config | &nbsp; |
1730
+ | filterData | | The filter data object. | &nbsp; |
1731
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
1632
1732
 
1633
1733
 
1634
1734
 
@@ -1636,17 +1736,13 @@ Gets the Scopes IDS for the Available Scope function by any config
1636
1736
  ##### Returns
1637
1737
 
1638
1738
 
1639
- - a Available Scope IDS config
1640
-
1641
-
1642
-
1739
+ - a UI Filters structure
1643
1740
 
1644
- ### dist/filters/helpers/getScopesByHierarchy.js
1645
1741
 
1646
1742
 
1647
- #### getScopesByHierarchy(scopes, currentScope)
1743
+ #### FD21ToUI(scopes, section, version, datasetsInfo)
1648
1744
 
1649
- [TODO: Make a description for this]
1745
+ Generates a UI filter Structure from the Filter Data structure v2.1
1650
1746
 
1651
1747
 
1652
1748
 
@@ -1655,8 +1751,10 @@ Gets the Scopes IDS for the Available Scope function by any config
1655
1751
 
1656
1752
  | Name | Type | Description | |
1657
1753
  | ---- | ---- | ----------- | -------- |
1658
- | scopes | | the collection of Scopes/Scope IDs | &nbsp; |
1659
- | currentScope | | Current scope type | &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 @@ Gets the Scopes IDS for the Available Scope function by any config
1664
1762
  ##### Returns
1665
1763
 
1666
1764
 
1667
- - A new array of Scopes/Scope IDs
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
-
1980
+ - a Filter Data.
1898
1981
 
1899
1982
 
1900
- ### dist/general/mix/getTag.js
1901
1983
 
1984
+ #### buildScopes(fbFilters)
1902
1985
 
1903
- #### getTag(value)
1904
-
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
-
1925
-
2004
+ - an array of scopes structure.
1926
2005
 
1927
- ### dist/general/mix/importScripts.js
1928
2006
 
1929
2007
 
1930
- #### importScripts(scripts)
2008
+ #### buildScope(uFilter)
1931
2009
 
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,21 @@ 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; |
1947
-
1948
-
1949
-
1950
-
1951
- ##### Examples
1952
-
1953
- ```javascript
1954
- // 1) Simple script (paralell loading)
1955
- importScripts(['http://myscript.js', 'http://another.js']);
1956
-
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
- ]);
2019
+ | uFilter | | UI structure filter | &nbsp; |
1962
2020
 
1963
- // 3) import dependent scripts (cascade)
1964
- importScripts([
1965
- { url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] }
1966
- ]);
1967
2021
 
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
2022
 
1977
2023
 
1978
2024
  ##### Returns
1979
2025
 
1980
2026
 
1981
- - `Promise` Promise when all script have been loaded
2027
+ - an scope structure
1982
2028
 
1983
2029
 
1984
2030
 
1985
- #### loadScript(url, type, noModule)
2031
+ #### buildDataset(uFilter)
1986
2032
 
1987
- Creates the script element and appends to document.head
1988
- return a Promise that is resolved when the script is loaded
2033
+ Gets an dataset structure for the filter data
1989
2034
 
1990
2035
 
1991
2036
 
@@ -1994,9 +2039,7 @@ return a Promise that is resolved when the script is loaded
1994
2039
 
1995
2040
  | Name | Type | Description | |
1996
2041
  | ---- | ---- | ----------- | -------- |
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; |
2042
+ | uFilter | | a UI structure filter | &nbsp; |
2000
2043
 
2001
2044
 
2002
2045
 
@@ -2004,17 +2047,13 @@ return a Promise that is resolved when the script is loaded
2004
2047
  ##### Returns
2005
2048
 
2006
2049
 
2007
- - `Void`
2008
-
2009
-
2010
-
2050
+ - an dataset structure
2011
2051
 
2012
- ### dist/general/mix/isEmpty.js
2013
2052
 
2014
2053
 
2015
- #### isEmpty(variable, includeFalsy)
2054
+ #### buildFilter(uFilter)
2016
2055
 
2017
- Validates if the given argument is empty
2056
+ Gets an filter structure for the filter data
2018
2057
 
2019
2058
 
2020
2059
 
@@ -2023,8 +2062,7 @@ Validates if the given argument is empty
2023
2062
 
2024
2063
  | Name | Type | Description | |
2025
2064
  | ---- | ---- | ----------- | -------- |
2026
- | variable | | the given variable | &nbsp; |
2027
- | includeFalsy | | flag to determine include the falsy variables into the validation | &nbsp; |
2065
+ | uFilter | | a UI structure filter | &nbsp; |
2028
2066
 
2029
2067
 
2030
2068
 
@@ -2032,19 +2070,17 @@ Validates if the given argument is empty
2032
2070
  ##### Returns
2033
2071
 
2034
2072
 
2035
- - true: the given argument is empty; false: is not.
2073
+ - an filter structure
2036
2074
 
2037
2075
 
2038
2076
 
2039
2077
 
2040
- ### dist/general/mix/isNaNV2.js
2078
+ ### dist/filters/adapters/flatUIToLogic.js
2041
2079
 
2042
2080
 
2043
- #### isNaNV2(variable)
2081
+ #### flatUIToLogic(uFilter)
2044
2082
 
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.
2083
+ Generates a Logic structure from flattened UI filters
2048
2084
 
2049
2085
 
2050
2086
 
@@ -2053,7 +2089,7 @@ Validates if variable is null, undefined, or an empty string, also, the function
2053
2089
 
2054
2090
  | Name | Type | Description | |
2055
2091
  | ---- | ---- | ----------- | -------- |
2056
- | variable | | the variable to validate | &nbsp; |
2092
+ | uFilter | | Array of flat filters from UI | &nbsp; |
2057
2093
 
2058
2094
 
2059
2095
 
@@ -2061,18 +2097,17 @@ Validates if variable is null, undefined, or an empty string, also, the function
2061
2097
  ##### Returns
2062
2098
 
2063
2099
 
2064
- - True if variable is a NaN or false otherwise
2100
+ - The logic structure
2065
2101
 
2066
2102
 
2067
2103
 
2068
2104
 
2069
- ### dist/general/mix/isNull.js
2105
+ ### dist/filters/adapters/flatUIToOldLogic.js
2070
2106
 
2071
2107
 
2072
- #### isNull(arg)
2108
+ #### flatUIToOldLogic(uFilters)
2073
2109
 
2074
- return if a given variable is either `null` or `undefined`
2075
- useful to avoid falsify validating Number Zero (0)
2110
+ Generates a Logic structure from flattened UI filters
2076
2111
 
2077
2112
 
2078
2113
 
@@ -2081,7 +2116,7 @@ useful to avoid falsify validating Number Zero (0)
2081
2116
 
2082
2117
  | Name | Type | Description | |
2083
2118
  | ---- | ---- | ----------- | -------- |
2084
- | arg | `any` | | &nbsp; |
2119
+ | uFilters | | Array of flat filters from UI | &nbsp; |
2085
2120
 
2086
2121
 
2087
2122
 
@@ -2089,19 +2124,17 @@ useful to avoid falsify validating Number Zero (0)
2089
2124
  ##### Returns
2090
2125
 
2091
2126
 
2092
- - `Boolean`
2127
+ - The logic structure
2093
2128
 
2094
2129
 
2095
2130
 
2096
2131
 
2097
- ### dist/general/mix/randomId.js
2132
+ ### dist/filters/adapters/flatUIToUI.js
2098
2133
 
2099
2134
 
2100
- #### randomId(length, exclude)
2135
+ #### flatUIToUI(uFilters, version)
2101
2136
 
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.
2137
+ Generates a UI filter data structure from the flatttened UI filters.
2105
2138
 
2106
2139
 
2107
2140
 
@@ -2110,8 +2143,8 @@ Creates a random string
2110
2143
 
2111
2144
  | Name | Type | Description | |
2112
2145
  | ---- | ---- | ----------- | -------- |
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; |
2146
+ | uFilters | | Array of flattened filters from UI | &nbsp; |
2147
+ | version | | Tag for the version of the filter data structure | &nbsp; |
2115
2148
 
2116
2149
 
2117
2150
 
@@ -2119,19 +2152,14 @@ Creates a random string
2119
2152
  ##### Returns
2120
2153
 
2121
2154
 
2122
- - `String` Random string
2123
-
2124
-
2155
+ - a UI Filter Data.
2125
2156
 
2126
2157
 
2127
- ### dist/general/mix/size.js
2128
2158
 
2159
+ #### buildScopes(fbFilters)
2129
2160
 
2130
- #### size(obj)
2131
-
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.
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
2135
2163
 
2136
2164
 
2137
2165
 
@@ -2140,7 +2168,7 @@ Gets the length of the given array.
2140
2168
 
2141
2169
  | Name | Type | Description | |
2142
2170
  | ---- | ---- | ----------- | -------- |
2143
- | obj | `Any` | Any object-type variable | &nbsp; |
2171
+ | fbFilters | | Array of flat filters from UI | &nbsp; |
2144
2172
 
2145
2173
 
2146
2174
 
@@ -2148,18 +2176,13 @@ Gets the length of the given array.
2148
2176
  ##### Returns
2149
2177
 
2150
2178
 
2151
- - `Number` the size of the given variable
2152
-
2153
-
2154
-
2179
+ - an array of scopes structure.
2155
2180
 
2156
- ### dist/general/object/cloneDeep.js
2157
2181
 
2158
2182
 
2159
- #### cloneDeep(obj)
2183
+ #### buildScope(uFilter)
2160
2184
 
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
2185
+ Gets an scope structure for the UI filter data
2163
2186
 
2164
2187
 
2165
2188
 
@@ -2168,7 +2191,7 @@ Not to use this function with inner objects and functions
2168
2191
 
2169
2192
  | Name | Type | Description | |
2170
2193
  | ---- | ---- | ----------- | -------- |
2171
- | obj | | The object | &nbsp; |
2194
+ | uFilter | | UI structure filter | &nbsp; |
2172
2195
 
2173
2196
 
2174
2197
 
@@ -2176,21 +2199,13 @@ Not to use this function with inner objects and functions
2176
2199
  ##### Returns
2177
2200
 
2178
2201
 
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
2202
+ - an scope structure
2185
2203
 
2186
2204
 
2187
- #### _get(baseObject, path, defaultValue)
2188
2205
 
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.
2206
+ #### buildDataset(uFilter)
2191
2207
 
2192
- Empty arrays and empty objects are returned but the defaultValue is not
2193
- Undefined and null values will return the defaultValue.
2208
+ Gets an dataset structure for the UI filter data
2194
2209
 
2195
2210
 
2196
2211
 
@@ -2199,59 +2214,21 @@ Undefined and null values will return the defaultValue.
2199
2214
 
2200
2215
  | Name | Type | Description | |
2201
2216
  | ---- | ---- | ----------- | -------- |
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
-
2206
-
2207
-
2217
+ | uFilter | | a UI structure filter | &nbsp; |
2208
2218
 
2209
- ##### Examples
2210
2219
 
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
2220
 
2232
2221
 
2233
2222
  ##### Returns
2234
2223
 
2235
2224
 
2236
- - the resolved value.
2237
-
2238
-
2225
+ - an dataset structure
2239
2226
 
2240
2227
 
2241
- ### dist/general/object/getAttribute.js
2242
2228
 
2229
+ #### buildFilter(uFilter)
2243
2230
 
2244
- #### getAttribute(obj, key)
2245
-
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
2231
+ Gets an filter structure for the UI filter data
2255
2232
 
2256
2233
 
2257
2234
 
@@ -2260,33 +2237,25 @@ Searchs for properties in different case styles such as: lower, upper, camel and
2260
2237
 
2261
2238
  | Name | Type | Description | |
2262
2239
  | ---- | ---- | ----------- | -------- |
2263
- | obj | `object` | object to look for | &nbsp; |
2264
- | key | `string` | String attribute in snake_case style | &nbsp; |
2240
+ | uFilter | | a UI structure filter | &nbsp; |
2265
2241
 
2266
2242
 
2267
2243
 
2268
2244
 
2269
- ##### Examples
2270
-
2271
- ```javascript
2272
- getAttribute(obj, 'snake_case') //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
2273
- ```
2274
-
2275
-
2276
2245
  ##### Returns
2277
2246
 
2278
2247
 
2279
- - `Void`
2248
+ - an filter structure
2280
2249
 
2281
2250
 
2282
2251
 
2283
2252
 
2284
- ### dist/general/object/hasProperty.js
2253
+ ### dist/filters/adapters/logicToFD.js
2285
2254
 
2286
2255
 
2287
- #### _hasProperty(obj, property)
2256
+ #### logicToFD(filterData, version)
2288
2257
 
2289
- Use the hasOwnProperty in order to verify if the given property exists in the object.
2258
+ Generates a filter data structure from the old logic structure (v2.0).
2290
2259
 
2291
2260
 
2292
2261
 
@@ -2295,38 +2264,26 @@ Use the hasOwnProperty in order to verify if the given property exists in the ob
2295
2264
 
2296
2265
  | Name | Type | Description | |
2297
2266
  | ---- | ---- | ----------- | -------- |
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
2267
+ | filterData | | The old filter data structure with logic (v2.0) | &nbsp; |
2268
+ | version | | Tag for the version of the filter data structure | &nbsp; |
2305
2269
 
2306
- ```javascript
2307
- const prop = 'prop2'
2308
- const obj1 = { prop1: 'hello', prop2: 'world'}
2309
- _hasProperty(ob1, prop1) // true
2310
2270
 
2311
- const obj2 = { prop1: 'hello world' }
2312
- _hasProperty(ob1, prop2) // false
2313
- ```
2314
2271
 
2315
2272
 
2316
2273
  ##### Returns
2317
2274
 
2318
2275
 
2319
- - True if the object has the given property; otherwise, false.
2276
+ - a Filter Data.
2320
2277
 
2321
2278
 
2322
2279
 
2323
2280
 
2324
- ### dist/general/object/isObject.js
2281
+ ### dist/filters/adapters/logicToFlatUI.js
2325
2282
 
2326
2283
 
2327
- #### isObject(obj)
2284
+ #### logicToFlatUI(logics)
2328
2285
 
2329
- Checks if the given argument is an object type
2286
+ Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
2330
2287
 
2331
2288
 
2332
2289
 
@@ -2335,7 +2292,7 @@ Checks if the given argument is an object type
2335
2292
 
2336
2293
  | Name | Type | Description | |
2337
2294
  | ---- | ---- | ----------- | -------- |
2338
- | obj | | the variable to check | &nbsp; |
2295
+ | logics | | The old logic structure (v2.0) | &nbsp; |
2339
2296
 
2340
2297
 
2341
2298
 
@@ -2343,18 +2300,13 @@ Checks if the given argument is an object type
2343
2300
  ##### Returns
2344
2301
 
2345
2302
 
2346
- - True: It is an object; False: It is not.
2347
-
2348
-
2349
-
2303
+ - The Flattened UI Filters array
2350
2304
 
2351
- ### dist/general/object/mapValues.js
2352
2305
 
2353
2306
 
2354
- #### mapValues(baseObject, iteratee)
2307
+ #### getFilter(filters, filter, getIndex)
2355
2308
 
2356
- Invoke iteratee (function) for each object key-value pair
2357
- and return a mapped object
2309
+ Get the filter or the index of the given array, validating an old filter structure.
2358
2310
 
2359
2311
 
2360
2312
 
@@ -2363,8 +2315,9 @@ and return a mapped object
2363
2315
 
2364
2316
  | Name | Type | Description | |
2365
2317
  | ---- | ---- | ----------- | -------- |
2366
- | baseObject | `Object` | Base object. | &nbsp; |
2367
- | iteratee | `Function` | The executed per iteration. | &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; |
2368
2321
 
2369
2322
 
2370
2323
 
@@ -2372,18 +2325,13 @@ and return a mapped object
2372
2325
  ##### Returns
2373
2326
 
2374
2327
 
2375
- - `Object` New mapped object.
2376
-
2377
-
2378
-
2328
+ - the index or the UI filter object
2379
2329
 
2380
- ### dist/general/object/mergeDeep.js
2381
2330
 
2382
2331
 
2383
- #### mergeDeep(obj1, obj2, settings)
2332
+ #### refineRankingValues(values, uiValues)
2384
2333
 
2385
- Merges two objects into a new one.
2386
- The second given argument to the first given argument.
2334
+ Refines the values of the Ranking column type.
2387
2335
 
2388
2336
 
2389
2337
 
@@ -2392,9 +2340,8 @@ The second given argument to the first given argument.
2392
2340
 
2393
2341
  | Name | Type | Description | |
2394
2342
  | ---- | ---- | ----------- | -------- |
2395
- | obj1 | | The target object | &nbsp; |
2396
- | obj2 | | The object to be merged | &nbsp; |
2397
- | 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; |
2398
2345
 
2399
2346
 
2400
2347
 
@@ -2402,13 +2349,17 @@ The second given argument to the first given argument.
2402
2349
  ##### Returns
2403
2350
 
2404
2351
 
2405
- - a new merged object
2352
+ - the array of Ranking values
2406
2353
 
2407
2354
 
2408
2355
 
2409
- #### isValid(obj1, obj2)
2410
2356
 
2411
- 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).
2412
2363
 
2413
2364
 
2414
2365
 
@@ -2417,8 +2368,8 @@ Validates if the two arguments are objects
2417
2368
 
2418
2369
  | Name | Type | Description | |
2419
2370
  | ---- | ---- | ----------- | -------- |
2420
- | obj1 | | The target object | &nbsp; |
2421
- | obj2 | | The object to be merged | &nbsp; |
2371
+ | uFilters | | Array of filters from old logic structure | &nbsp; |
2372
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
2422
2373
 
2423
2374
 
2424
2375
 
@@ -2426,13 +2377,17 @@ Validates if the two arguments are objects
2426
2377
  ##### Returns
2427
2378
 
2428
2379
 
2429
- - true: they are valid; false: they are not
2380
+ - a UI Filter Data.
2430
2381
 
2431
2382
 
2432
2383
 
2433
- #### getParamsToMergeDeep(settings)
2434
2384
 
2435
- 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
2436
2391
 
2437
2392
 
2438
2393
 
@@ -2441,35 +2396,79 @@ Validates and gets the settings with all set parameters.
2441
2396
 
2442
2397
  | Name | Type | Description | |
2443
2398
  | ---- | ---- | ----------- | -------- |
2444
- | 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; |
2445
2401
 
2446
2402
 
2447
2403
 
2448
2404
 
2449
- ##### Returns
2405
+ ##### Examples
2450
2406
 
2407
+ ```javascript
2451
2408
 
2452
- - 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
+ };
2453
2451
 
2452
+ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
2453
+ ```
2454
2454
 
2455
2455
 
2456
+ ##### Returns
2456
2457
 
2457
- ### dist/general/object/objectCopy.js
2458
2458
 
2459
+ - `Object` an object with the new filters structure
2459
2460
 
2460
- #### objectCopy(entity, cache)
2461
2461
 
2462
- Created a new reference of the given argument
2463
2462
 
2464
2463
 
2464
+ ### dist/filters/classes/FilterInputErrorHandler.js
2465
+
2466
+
2467
+ #### new FilterInputErrorHandler()
2468
+
2465
2469
 
2466
2470
 
2467
- ##### Parameters
2468
2471
 
2469
- | Name | Type | Description | |
2470
- | ---- | ---- | ----------- | -------- |
2471
- | entity | | The variable to be copied | &nbsp; |
2472
- | cache | | | &nbsp; |
2473
2472
 
2474
2473
 
2475
2474
 
@@ -2477,17 +2476,17 @@ Created a new reference of the given argument
2477
2476
  ##### Returns
2478
2477
 
2479
2478
 
2480
- - A new reference of the given argument
2479
+ - `Void`
2481
2480
 
2482
2481
 
2483
2482
 
2484
2483
 
2485
- ### dist/general/object/omit.js
2484
+ ### dist/filters/helpers/applyHierarchyForAggFilters.js
2486
2485
 
2487
2486
 
2488
- #### omit(obj, props)
2487
+ #### applyHierarchyForAggFilters(chartSettings, scopes, currentScope)
2489
2488
 
2490
- return a new Object excluding attributes in _props_ list
2489
+ [TODO: Make a proper description for this function]
2491
2490
 
2492
2491
 
2493
2492
 
@@ -2496,8 +2495,9 @@ return a new Object excluding attributes in _props_ list
2496
2495
 
2497
2496
  | Name | Type | Description | |
2498
2497
  | ---- | ---- | ----------- | -------- |
2499
- | obj | `Object` | base object | &nbsp; |
2500
- | props | `Array.<String>` | list of attribute to exclude | &nbsp; |
2498
+ | chartSettings | | Chart Settings for the Filter Builder | &nbsp; |
2499
+ | scopes | | | &nbsp; |
2500
+ | currentScope | | | &nbsp; |
2501
2501
 
2502
2502
 
2503
2503
 
@@ -2505,17 +2505,17 @@ return a new Object excluding attributes in _props_ list
2505
2505
  ##### Returns
2506
2506
 
2507
2507
 
2508
- - `Object` clean object
2508
+ -
2509
2509
 
2510
2510
 
2511
2511
 
2512
2512
 
2513
- ### dist/general/object/pick.js
2513
+ ### dist/filters/helpers/getAvailableScopes.js
2514
2514
 
2515
2515
 
2516
- #### pick(baseObject, keys)
2516
+ #### getAvailableScopes(config)
2517
2517
 
2518
- return a new object just with attributes in _keys_ list
2518
+ Gets Scopes/Scope IDs by given IDs
2519
2519
 
2520
2520
 
2521
2521
 
@@ -2524,8 +2524,7 @@ return a new object just with attributes in _keys_ list
2524
2524
 
2525
2525
  | Name | Type | Description | |
2526
2526
  | ---- | ---- | ----------- | -------- |
2527
- | baseObject | `Object` | base object | &nbsp; |
2528
- | keys | `Array.<String>` | list of attributes to preserve | &nbsp; |
2527
+ | config | | given Differnts IDs in order set a available scope | &nbsp; |
2529
2528
 
2530
2529
 
2531
2530
 
@@ -2533,17 +2532,17 @@ return a new object just with attributes in _keys_ list
2533
2532
  ##### Returns
2534
2533
 
2535
2534
 
2536
- - `Object` new object just with desired attributes
2535
+ - a Scopes/Scope IDs array
2537
2536
 
2538
2537
 
2539
2538
 
2540
2539
 
2541
- ### dist/general/object/serialize.js
2540
+ ### dist/filters/helpers/getAvailableScopesIDsByConfig.js
2542
2541
 
2543
2542
 
2544
- #### serialize(obj)
2543
+ #### getAvailableScopesIDsByConfig(config)
2545
2544
 
2546
- serialize object to url param
2545
+ Gets the Scopes IDS for the Available Scope function by any config
2547
2546
 
2548
2547
 
2549
2548
 
@@ -2552,7 +2551,7 @@ serialize object to url param
2552
2551
 
2553
2552
  | Name | Type | Description | |
2554
2553
  | ---- | ---- | ----------- | -------- |
2555
- | obj | | - Object to be serialized | &nbsp; |
2554
+ | config | | any config | &nbsp; |
2556
2555
 
2557
2556
 
2558
2557
 
@@ -2560,17 +2559,17 @@ serialize object to url param
2560
2559
  ##### Returns
2561
2560
 
2562
2561
 
2563
- - `Void`
2562
+ - a Available Scope IDS config
2564
2563
 
2565
2564
 
2566
2565
 
2567
2566
 
2568
- ### dist/general/string/capitalize.js
2567
+ ### dist/filters/helpers/getScopesByHierarchy.js
2569
2568
 
2570
2569
 
2571
- #### capitalize(text)
2570
+ #### getScopesByHierarchy(scopes, currentScope)
2572
2571
 
2573
- Upper case the first letter of a given text
2572
+ [TODO: Make a description for this]
2574
2573
 
2575
2574
 
2576
2575
 
@@ -2579,7 +2578,8 @@ Upper case the first letter of a given text
2579
2578
 
2580
2579
  | Name | Type | Description | |
2581
2580
  | ---- | ---- | ----------- | -------- |
2582
- | text | `String` | | &nbsp; |
2581
+ | scopes | | the collection of Scopes/Scope IDs | &nbsp; |
2582
+ | currentScope | | Current scope type | &nbsp; |
2583
2583
 
2584
2584
 
2585
2585
 
@@ -2587,7 +2587,7 @@ Upper case the first letter of a given text
2587
2587
  ##### Returns
2588
2588
 
2589
2589
 
2590
- - `String` a capitalized text
2590
+ - A new array of Scopes/Scope IDs
2591
2591
 
2592
2592
 
2593
2593
 
@@ -2619,12 +2619,12 @@ Get an string of the properties of the given column.
2619
2619
 
2620
2620
 
2621
2621
 
2622
- ### dist/services/api/getAllDatasets.api.js
2622
+ ### dist/services/api/getAllQrveys.api.js
2623
2623
 
2624
2624
 
2625
- #### getAllDatasets(qrveyids)
2625
+ #### getAllQrveys(config, params)
2626
2626
 
2627
- 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
2628
2628
 
2629
2629
 
2630
2630
 
@@ -2633,7 +2633,8 @@ Get a dataset list from a collection of Qrvey IDs
2633
2633
 
2634
2634
  | Name | Type | Description | |
2635
2635
  | ---- | ---- | ----------- | -------- |
2636
- | qrveyids | | Collection of Qrvey IDs | &nbsp; |
2636
+ | config | | Configuration | &nbsp; |
2637
+ | params | | Object for getting precise data | &nbsp; |
2637
2638
 
2638
2639
 
2639
2640
 
@@ -2641,17 +2642,17 @@ Get a dataset list from a collection of Qrvey IDs
2641
2642
  ##### Returns
2642
2643
 
2643
2644
 
2644
- - a promise
2645
+ - `Void`
2645
2646
 
2646
2647
 
2647
2648
 
2648
2649
 
2649
- ### dist/services/api/getAllQrveys.api.js
2650
+ ### dist/services/api/getAllDatasets.api.js
2650
2651
 
2651
2652
 
2652
- #### getAllQrveys(config, params)
2653
+ #### getAllDatasets(config, pickDatasets)
2653
2654
 
2654
- 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
2655
2656
 
2656
2657
 
2657
2658
 
@@ -2660,8 +2661,8 @@ POST Request for getting Qrveys such as Web Forms and Datasets. Use params for g
2660
2661
 
2661
2662
  | Name | Type | Description | |
2662
2663
  | ---- | ---- | ----------- | -------- |
2663
- | config | | Configuration | &nbsp; |
2664
- | 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; |
2665
2666
 
2666
2667
 
2667
2668
 
@@ -2669,7 +2670,7 @@ POST Request for getting Qrveys such as Web Forms and Datasets. Use params for g
2669
2670
  ##### Returns
2670
2671
 
2671
2672
 
2672
- - `Void`
2673
+ - a promise
2673
2674
 
2674
2675
 
2675
2676
 
@@ -2785,12 +2786,12 @@ try to find this string as a variable on Windows object
2785
2786
 
2786
2787
 
2787
2788
 
2788
- ### dist/typescript/decorators/Throttled.js
2789
+ ### dist/typescript/decorators/Debounce.js
2789
2790
 
2790
2791
 
2791
- #### Throttled(time)
2792
+ #### Debounce(time)
2792
2793
 
2793
- (Method Decorator) Throttled Class Method
2794
+ (Method Decorator) Debounce Class Method
2794
2795
 
2795
2796
 
2796
2797
 
@@ -2812,12 +2813,12 @@ try to find this string as a variable on Windows object
2812
2813
 
2813
2814
 
2814
2815
 
2815
- ### dist/typescript/decorators/Debounce.js
2816
+ ### dist/typescript/decorators/Throttled.js
2816
2817
 
2817
2818
 
2818
- #### Debounce(time)
2819
+ #### Throttled(time)
2819
2820
 
2820
- (Method Decorator) Debounce Class Method
2821
+ (Method Decorator) Throttled Class Method
2821
2822
 
2822
2823
 
2823
2824
 
@@ -3604,12 +3605,12 @@ Get a new Filter Data by filtering scopes/scope IDs and enabled flags
3604
3605
 
3605
3606
 
3606
3607
 
3607
- ### dist/filters/helpers/common/getParamsToGetFilterSettings.js
3608
+ ### dist/filters/helpers/common/getMergeFiltersSettings.js
3608
3609
 
3609
3610
 
3610
- #### getParamsToGetFilterSettings(settings)
3611
+ #### getMergeFiltersSettings(settings)
3611
3612
 
3612
- Transforms the given ParamsToGetFilter settings object. Adds the missing properties if they do not exist.
3613
+ Transforms the given MergeFilters settings object. Adds the missing properties if they do not exist.
3613
3614
 
3614
3615
 
3615
3616
 
@@ -3618,7 +3619,7 @@ Transforms the given ParamsToGetFilter settings object. Adds the missing propert
3618
3619
 
3619
3620
  | Name | Type | Description | |
3620
3621
  | ---- | ---- | ----------- | -------- |
3621
- | settings | | an object to the ParamsToGetFilter settings | &nbsp; |
3622
+ | settings | | an object to the MergeFilters settings | &nbsp; |
3622
3623
 
3623
3624
 
3624
3625
 
@@ -3626,17 +3627,17 @@ Transforms the given ParamsToGetFilter settings object. Adds the missing propert
3626
3627
  ##### Returns
3627
3628
 
3628
3629
 
3629
- - a new ParamsToGetFilter settings object.
3630
+ - a new MergeFilters settings object.
3630
3631
 
3631
3632
 
3632
3633
 
3633
3634
 
3634
- ### dist/filters/helpers/common/getMergeFiltersSettings.js
3635
+ ### dist/filters/helpers/common/getParamsToGetFilterSettings.js
3635
3636
 
3636
3637
 
3637
- #### getMergeFiltersSettings(settings)
3638
+ #### getParamsToGetFilterSettings(settings)
3638
3639
 
3639
- Transforms the given MergeFilters settings object. Adds the missing properties if they do not exist.
3640
+ Transforms the given ParamsToGetFilter settings object. Adds the missing properties if they do not exist.
3640
3641
 
3641
3642
 
3642
3643
 
@@ -3645,7 +3646,7 @@ Transforms the given MergeFilters settings object. Adds the missing properties i
3645
3646
 
3646
3647
  | Name | Type | Description | |
3647
3648
  | ---- | ---- | ----------- | -------- |
3648
- | settings | | an object to the MergeFilters settings | &nbsp; |
3649
+ | settings | | an object to the ParamsToGetFilter settings | &nbsp; |
3649
3650
 
3650
3651
 
3651
3652
 
@@ -3653,7 +3654,7 @@ Transforms the given MergeFilters settings object. Adds the missing properties i
3653
3654
  ##### Returns
3654
3655
 
3655
3656
 
3656
- - a new MergeFilters settings object.
3657
+ - a new ParamsToGetFilter settings object.
3657
3658
 
3658
3659
 
3659
3660
 
@@ -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