@qrvey/utils 1.2.9-14 → 1.2.9-18

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 (191) hide show
  1. package/README.md +755 -652
  2. package/dist/cjs/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -0
  3. package/dist/cjs/filters/helpers/ui/index.d.ts +1 -0
  4. package/dist/cjs/filters/helpers/ui/index.js +1 -0
  5. package/dist/cjs/filters/helpers/ui/transformFilterValues.d.ts +4 -0
  6. package/dist/cjs/filters/helpers/ui/transformFilterValues.js +22 -0
  7. package/dist/cjs/filters/interfaces/builder/IFilterBuilderGeneralConfig.d.ts +1 -0
  8. package/dist/cjs/filters/interfaces/panel/IFilterPanelConfig.d.ts +1 -0
  9. package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
  10. package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.js +2 -0
  11. package/dist/cjs/filters/interfaces/ui/index.d.ts +3 -2
  12. package/dist/cjs/filters/interfaces/ui/index.js +3 -2
  13. package/dist/cjs/format/definition.d.ts +17 -0
  14. package/dist/cjs/format/definition.js +31 -1
  15. package/dist/cjs/format/format.d.ts +2 -1
  16. package/dist/cjs/format/format.js +8 -5
  17. package/dist/cjs/format/index.d.ts +1 -0
  18. package/dist/cjs/format/index.js +1 -0
  19. package/dist/cjs/format/localization.d.ts +3 -0
  20. package/dist/cjs/format/localization.js +56 -0
  21. package/dist/cjs/globalization/helpers/getI18nCalendar.d.ts +4 -0
  22. package/dist/cjs/globalization/helpers/getI18nCalendar.js +69 -0
  23. package/dist/cjs/globalization/helpers/index.d.ts +1 -0
  24. package/dist/cjs/globalization/helpers/index.js +1 -0
  25. package/dist/cjs/globalization/interfaces/calendar/II18nCalendar.d.ts +7 -0
  26. package/dist/cjs/globalization/interfaces/calendar/II18nCalendar.js +2 -0
  27. package/dist/cjs/globalization/interfaces/calendar/II18nCalendarProperties.d.ts +9 -0
  28. package/dist/cjs/globalization/interfaces/calendar/II18nCalendarProperties.js +2 -0
  29. package/dist/cjs/globalization/interfaces/calendar/index.d.ts +2 -0
  30. package/dist/cjs/globalization/interfaces/calendar/index.js +14 -0
  31. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.d.ts +5 -3
  32. package/dist/cjs/globalization/interfaces/common/II18nCommon.d.ts +2 -0
  33. package/dist/cjs/globalization/interfaces/common/II18nDayNames.d.ts +7 -0
  34. package/dist/cjs/globalization/interfaces/filters/II18nFilter.d.ts +2 -0
  35. package/dist/cjs/globalization/interfaces/filters/II18nTokenBox.d.ts +6 -0
  36. package/dist/cjs/globalization/interfaces/filters/II18nTokenBox.js +2 -0
  37. package/dist/cjs/globalization/interfaces/index.d.ts +1 -0
  38. package/dist/cjs/globalization/interfaces/index.js +1 -0
  39. package/dist/cjs/globalization/labels/calendar/I18N_CALENDAR.d.ts +2 -0
  40. package/dist/cjs/globalization/labels/calendar/I18N_CALENDAR.js +10 -0
  41. package/dist/cjs/globalization/labels/calendar/index.d.ts +1 -0
  42. package/dist/cjs/globalization/labels/calendar/index.js +13 -0
  43. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +1 -1
  44. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +7 -5
  45. package/dist/cjs/globalization/labels/common/I18N_COMMON.js +2 -0
  46. package/dist/cjs/globalization/labels/common/I18N_DAY_NAMES.js +7 -0
  47. package/dist/cjs/globalization/labels/filters/I18N_FILTER.js +6 -0
  48. package/dist/cjs/globalization/labels/index.d.ts +1 -0
  49. package/dist/cjs/globalization/labels/index.js +1 -0
  50. package/dist/cjs/interfaces/format/IFormatConfig.Interface.d.ts +5 -0
  51. package/dist/cjs/interfaces/format/IFormatConfig.Interface.js +2 -0
  52. package/dist/cjs/interfaces/format/IFormatCurrency.Interface.d.ts +4 -0
  53. package/dist/cjs/interfaces/format/IFormatCurrency.Interface.js +2 -0
  54. package/dist/cjs/interfaces/format/IFormatOutputFormat.Interface.d.ts +8 -0
  55. package/dist/cjs/interfaces/format/IFormatOutputFormat.Interface.js +2 -0
  56. package/dist/cjs/interfaces/format/index.d.ts +3 -0
  57. package/dist/cjs/interfaces/format/index.js +15 -0
  58. package/dist/cjs/interfaces/general/IGeneralWidgetConfig.d.ts +2 -0
  59. package/dist/cjs/interfaces/index.d.ts +1 -0
  60. package/dist/cjs/interfaces/index.js +1 -0
  61. package/dist/cjs/qrvey/helpers/getValueWithSuffixes.d.ts +9 -0
  62. package/dist/cjs/qrvey/helpers/getValueWithSuffixes.js +23 -0
  63. package/dist/cjs/qrvey/helpers/index.d.ts +2 -0
  64. package/dist/cjs/qrvey/helpers/index.js +2 -0
  65. package/dist/cjs/qrvey/helpers/transformValue.d.ts +8 -0
  66. package/dist/cjs/qrvey/helpers/transformValue.js +46 -0
  67. package/dist/cjs/qrvey/interfaces/IGetValueWithSuffixesSettings.d.ts +11 -0
  68. package/dist/cjs/qrvey/interfaces/IGetValueWithSuffixesSettings.js +2 -0
  69. package/dist/cjs/qrvey/interfaces/ITransformValueSettings.d.ts +10 -0
  70. package/dist/cjs/qrvey/interfaces/ITransformValueSettings.js +2 -0
  71. package/dist/cjs/qrvey/interfaces/index.d.ts +2 -0
  72. package/dist/cjs/qrvey/interfaces/index.js +2 -0
  73. package/dist/cjs/services/api/getDatasetColumns.api.js +5 -1
  74. package/dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -0
  75. package/dist/filters/helpers/ui/index.d.ts +1 -0
  76. package/dist/filters/helpers/ui/index.js +1 -0
  77. package/dist/filters/helpers/ui/transformFilterValues.d.ts +4 -0
  78. package/dist/filters/helpers/ui/transformFilterValues.js +18 -0
  79. package/dist/filters/interfaces/builder/IFilterBuilderGeneralConfig.d.ts +1 -0
  80. package/dist/filters/interfaces/panel/IFilterPanelConfig.d.ts +1 -0
  81. package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
  82. package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.js +1 -0
  83. package/dist/filters/interfaces/ui/index.d.ts +3 -2
  84. package/dist/filters/interfaces/ui/index.js +3 -2
  85. package/dist/format/definition.d.ts +17 -0
  86. package/dist/format/definition.js +30 -0
  87. package/dist/format/format.d.ts +2 -1
  88. package/dist/format/format.js +6 -3
  89. package/dist/format/index.d.ts +1 -0
  90. package/dist/format/index.js +1 -0
  91. package/dist/format/localization.d.ts +3 -0
  92. package/dist/format/localization.js +51 -0
  93. package/dist/globalization/helpers/getI18nCalendar.d.ts +4 -0
  94. package/dist/globalization/helpers/getI18nCalendar.js +65 -0
  95. package/dist/globalization/helpers/index.d.ts +1 -0
  96. package/dist/globalization/helpers/index.js +1 -0
  97. package/dist/globalization/interfaces/calendar/II18nCalendar.d.ts +7 -0
  98. package/dist/globalization/interfaces/calendar/II18nCalendar.js +1 -0
  99. package/dist/globalization/interfaces/calendar/II18nCalendarProperties.d.ts +9 -0
  100. package/dist/globalization/interfaces/calendar/II18nCalendarProperties.js +1 -0
  101. package/dist/globalization/interfaces/calendar/index.d.ts +2 -0
  102. package/dist/globalization/interfaces/calendar/index.js +2 -0
  103. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.d.ts +5 -3
  104. package/dist/globalization/interfaces/common/II18nCommon.d.ts +2 -0
  105. package/dist/globalization/interfaces/common/II18nDayNames.d.ts +7 -0
  106. package/dist/globalization/interfaces/filters/II18nFilter.d.ts +2 -0
  107. package/dist/globalization/interfaces/filters/II18nTokenBox.d.ts +6 -0
  108. package/dist/globalization/interfaces/filters/II18nTokenBox.js +1 -0
  109. package/dist/globalization/interfaces/index.d.ts +1 -0
  110. package/dist/globalization/interfaces/index.js +1 -0
  111. package/dist/globalization/labels/calendar/I18N_CALENDAR.d.ts +2 -0
  112. package/dist/globalization/labels/calendar/I18N_CALENDAR.js +7 -0
  113. package/dist/globalization/labels/calendar/index.d.ts +1 -0
  114. package/dist/globalization/labels/calendar/index.js +1 -0
  115. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +1 -1
  116. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +7 -5
  117. package/dist/globalization/labels/common/I18N_COMMON.js +2 -0
  118. package/dist/globalization/labels/common/I18N_DAY_NAMES.js +7 -0
  119. package/dist/globalization/labels/filters/I18N_FILTER.js +6 -0
  120. package/dist/globalization/labels/index.d.ts +1 -0
  121. package/dist/globalization/labels/index.js +1 -0
  122. package/dist/interfaces/format/IFormatConfig.Interface.d.ts +5 -0
  123. package/dist/interfaces/format/IFormatConfig.Interface.js +1 -0
  124. package/dist/interfaces/format/IFormatCurrency.Interface.d.ts +4 -0
  125. package/dist/interfaces/format/IFormatCurrency.Interface.js +1 -0
  126. package/dist/interfaces/format/IFormatOutputFormat.Interface.d.ts +8 -0
  127. package/dist/interfaces/format/IFormatOutputFormat.Interface.js +1 -0
  128. package/dist/interfaces/format/index.d.ts +3 -0
  129. package/dist/interfaces/format/index.js +3 -0
  130. package/dist/interfaces/general/IGeneralWidgetConfig.d.ts +2 -0
  131. package/dist/interfaces/index.d.ts +1 -0
  132. package/dist/interfaces/index.js +1 -0
  133. package/dist/qrvey/helpers/getValueWithSuffixes.d.ts +9 -0
  134. package/dist/qrvey/helpers/getValueWithSuffixes.js +19 -0
  135. package/dist/qrvey/helpers/index.d.ts +2 -0
  136. package/dist/qrvey/helpers/index.js +2 -0
  137. package/dist/qrvey/helpers/transformValue.d.ts +8 -0
  138. package/dist/qrvey/helpers/transformValue.js +42 -0
  139. package/dist/qrvey/interfaces/IGetValueWithSuffixesSettings.d.ts +11 -0
  140. package/dist/qrvey/interfaces/IGetValueWithSuffixesSettings.js +1 -0
  141. package/dist/qrvey/interfaces/ITransformValueSettings.d.ts +10 -0
  142. package/dist/qrvey/interfaces/ITransformValueSettings.js +1 -0
  143. package/dist/qrvey/interfaces/index.d.ts +2 -0
  144. package/dist/qrvey/interfaces/index.js +2 -0
  145. package/dist/services/api/getDatasetColumns.api.js +5 -1
  146. package/package.json +1 -1
  147. package/src/filters/helpers/builder/getFilterBuilderGeneralConfig.ts +1 -0
  148. package/src/filters/helpers/ui/index.ts +1 -0
  149. package/src/filters/helpers/ui/transformFilterValues.ts +29 -0
  150. package/src/filters/interfaces/builder/IFilterBuilderGeneralConfig.ts +2 -1
  151. package/src/filters/interfaces/panel/IFilterPanelConfig.ts +1 -0
  152. package/src/filters/interfaces/ui/IFUTransformFilterValuesSettings.ts +7 -0
  153. package/src/filters/interfaces/ui/index.ts +3 -2
  154. package/src/format/definition.ts +45 -0
  155. package/src/format/format.ts +19 -15
  156. package/src/format/index.ts +1 -0
  157. package/src/format/localization.ts +52 -0
  158. package/src/globalization/helpers/getI18nCalendar.ts +68 -0
  159. package/src/globalization/helpers/index.ts +1 -0
  160. package/src/globalization/interfaces/calendar/II18nCalendar.ts +7 -0
  161. package/src/globalization/interfaces/calendar/II18nCalendarProperties.ts +9 -0
  162. package/src/globalization/interfaces/calendar/index.ts +2 -0
  163. package/src/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.ts +5 -3
  164. package/src/globalization/interfaces/common/II18nCommon.ts +2 -0
  165. package/src/globalization/interfaces/common/II18nDayNames.ts +8 -0
  166. package/src/globalization/interfaces/filters/II18nFilter.ts +2 -0
  167. package/src/globalization/interfaces/filters/II18nTokenBox.ts +6 -0
  168. package/src/globalization/interfaces/index.ts +1 -0
  169. package/src/globalization/labels/calendar/I18N_CALENDAR.ts +9 -0
  170. package/src/globalization/labels/calendar/index.ts +1 -0
  171. package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.ts +1 -1
  172. package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.ts +8 -6
  173. package/src/globalization/labels/common/I18N_COMMON.ts +2 -0
  174. package/src/globalization/labels/common/I18N_DAY_NAMES.ts +8 -0
  175. package/src/globalization/labels/filters/I18N_FILTER.ts +6 -0
  176. package/src/globalization/labels/index.ts +1 -0
  177. package/src/interfaces/format/IFormatConfig.Interface.ts +5 -0
  178. package/src/interfaces/format/IFormatCurrency.Interface.ts +4 -0
  179. package/src/interfaces/format/IFormatOutputFormat.Interface.ts +9 -0
  180. package/src/interfaces/format/index.ts +3 -0
  181. package/src/interfaces/general/IGeneralWidgetConfig.ts +2 -0
  182. package/src/interfaces/index.ts +1 -0
  183. package/src/qrvey/helpers/getValueWithSuffixes.ts +19 -0
  184. package/src/qrvey/helpers/index.ts +2 -0
  185. package/src/qrvey/helpers/transformValue.ts +47 -0
  186. package/src/qrvey/interfaces/IGetValueWithSuffixesSettings.ts +12 -0
  187. package/src/qrvey/interfaces/ITransformValueSettings.ts +12 -0
  188. package/src/qrvey/interfaces/index.ts +2 -0
  189. package/src/services/api/getDatasetColumns.api.ts +4 -1
  190. package/test/columns/isNumericalColumn.test.js +154 -0
  191. package/test/format.test.js +11 -11
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.2.9-14*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.2.9-18*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -220,64 +220,6 @@ 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
-
281
223
  ### dist/dates/helpers/getDateByDateFormat.js
282
224
 
283
225
 
@@ -475,6 +417,64 @@ Validates the given string as Date by its date format.
475
417
 
476
418
 
477
419
 
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/general/array/delete.js
691
+ ### dist/filters/adapters/FDToFlatUI.js
692
692
 
693
693
 
694
- #### ArrayDelete(array, index)
694
+ #### FDToFlatUI(filterData, datasetsInfo)
695
695
 
696
- Inmutable Array Item deletion
696
+ Generates a Flattened UI filter structure from Filter Data structure.
697
697
 
698
698
 
699
699
 
@@ -702,8 +702,8 @@ Inmutable Array Item deletion
702
702
 
703
703
  | Name | Type | Description | |
704
704
  | ---- | ---- | ----------- | -------- |
705
- | array | `Array` | a collection of items to delete |   |
706
- | index | `Number` | the position of the item to delete |   |
705
+ | filterData | | The filter data object. |   |
706
+ | datasetsInfo | | Collection of datasets information |   |
707
707
 
708
708
 
709
709
 
@@ -711,20 +711,13 @@ Inmutable Array Item deletion
711
711
  ##### Returns
712
712
 
713
713
 
714
- - a new Array or the given parameter when is empty or not an array
715
-
716
-
717
-
714
+ - a flattened UI filters array
718
715
 
719
- ### dist/general/array/filterNestedTree.js
720
716
 
721
717
 
722
- #### filterNestedTree(arr, childArrKey, condition)
718
+ #### FD21ToFlatUI(scopes, datasetsInfo)
723
719
 
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
720
+ Generates a Filter Builder Structure from the Filter Data structure v2.1
728
721
 
729
722
 
730
723
 
@@ -733,9 +726,8 @@ Filters a nested tree array by a custom condition on the last child node
733
726
 
734
727
  | Name | Type | Description | |
735
728
  | ---- | ---- | ----------- | -------- |
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 |   |
729
+ | scopes | | The filter scope section |   |
730
+ | datasetsInfo | | Collection of datasets information |   |
739
731
 
740
732
 
741
733
 
@@ -743,17 +735,17 @@ Filters a nested tree array by a custom condition on the last child node
743
735
  ##### Returns
744
736
 
745
737
 
746
- - array filtered
738
+ - a flattened UI filters array
747
739
 
748
740
 
749
741
 
750
742
 
751
- ### dist/general/array/flattenDeep.js
743
+ ### dist/filters/adapters/FDToLogic.js
752
744
 
753
745
 
754
- #### flattenDeep(arr)
746
+ #### FDToLogic(filterData)
755
747
 
756
- Flat deeply an array
748
+ Generates a Filter Logic structure from Filter Data structure.
757
749
 
758
750
 
759
751
 
@@ -762,7 +754,7 @@ Flat deeply an array
762
754
 
763
755
  | Name | Type | Description | |
764
756
  | ---- | ---- | ----------- | -------- |
765
- | arr | | Array to flat deeply |   |
757
+ | filterData | | The filter data object. |   |
766
758
 
767
759
 
768
760
 
@@ -770,17 +762,13 @@ Flat deeply an array
770
762
  ##### Returns
771
763
 
772
764
 
773
- - flatten array
774
-
775
-
776
-
765
+ - a filter logic array
777
766
 
778
- ### dist/general/array/getFirstIndexFromArray.js
779
767
 
780
768
 
781
- #### getFirstIndexFromArray(array, callback)
769
+ #### getLogicBodyFromFD21(filterData)
782
770
 
783
- Gets the first index from the array by a callback condition
771
+ Gets the logic body
784
772
 
785
773
 
786
774
 
@@ -789,8 +777,7 @@ Gets the first index from the array by a callback condition
789
777
 
790
778
  | Name | Type | Description | |
791
779
  | ---- | ---- | ----------- | -------- |
792
- | array | | |   |
793
- | callback | | function callback |   |
780
+ | filterData | | The filter data object |   |
794
781
 
795
782
 
796
783
 
@@ -798,17 +785,17 @@ Gets the first index from the array by a callback condition
798
785
  ##### Returns
799
786
 
800
787
 
801
- - the first index of the array. -1 when the condition is not satisfied
788
+ - a filter logic array
802
789
 
803
790
 
804
791
 
805
792
 
806
- ### dist/general/array/getLastIndexFromArray.js
793
+ ### dist/filters/adapters/FDToUI.js
807
794
 
808
795
 
809
- #### getLastIndexFromArray(array, callback)
796
+ #### FDToUI(filterData, datasetsInfo)
810
797
 
811
- Gets the last index from the array by a callback condition
798
+ Generates a UI filter structure from Filter Data structure.
812
799
 
813
800
 
814
801
 
@@ -817,8 +804,8 @@ Gets the last index from the array by a callback condition
817
804
 
818
805
  | Name | Type | Description | |
819
806
  | ---- | ---- | ----------- | -------- |
820
- | array | | |   |
821
- | callback | | function callback |   |
807
+ | filterData | | The filter data object. |   |
808
+ | datasetsInfo | | Collection of datasets information |   |
822
809
 
823
810
 
824
811
 
@@ -826,17 +813,13 @@ Gets the last index from the array by a callback condition
826
813
  ##### Returns
827
814
 
828
815
 
829
- - the last index of the array. -1 when the condition is not satisfied
830
-
831
-
832
-
816
+ - a UI Filters structure
833
817
 
834
- ### dist/general/function/debounce.js
835
818
 
836
819
 
837
- #### debounce(fn, time)
820
+ #### FD21ToUI(scopes, section, version, datasetsInfo)
838
821
 
839
- Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last time the debounced function was invoked.
822
+ Generates a UI filter Structure from the Filter Data structure v2.1
840
823
 
841
824
 
842
825
 
@@ -845,8 +828,10 @@ Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last
845
828
 
846
829
  | Name | Type | Description | |
847
830
  | ---- | ---- | ----------- | -------- |
848
- | fn | `Function` | original Function |   |
849
- | time | `Number` | default 500ms |   |
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 |   |
850
835
 
851
836
 
852
837
 
@@ -854,17 +839,17 @@ Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last
854
839
  ##### Returns
855
840
 
856
841
 
857
- - `Function` debounced functions
842
+ - a UI filter Structure
858
843
 
859
844
 
860
845
 
861
846
 
862
- ### dist/general/function/throttled.js
847
+ ### dist/filters/adapters/UIToFD.js
863
848
 
864
849
 
865
- #### throttled(fn, time)
850
+ #### UIToFD(filterData)
866
851
 
867
- Make sure to only invokes _fn_ at most once per every _time_ milliseconds
852
+ Generates a Filter Data Structure structure from UI Filter Data structure.
868
853
 
869
854
 
870
855
 
@@ -873,8 +858,7 @@ Make sure to only invokes _fn_ at most once per every _time_ milliseconds
873
858
 
874
859
  | Name | Type | Description | |
875
860
  | ---- | ---- | ----------- | -------- |
876
- | fn | `Function` | original Function |   |
877
- | time | `Number` | default 500ms |   |
861
+ | filterData | | The UI filter data object. |   |
878
862
 
879
863
 
880
864
 
@@ -882,18 +866,13 @@ Make sure to only invokes _fn_ at most once per every _time_ milliseconds
882
866
  ##### Returns
883
867
 
884
868
 
885
- - `Function` throttled function
886
-
887
-
888
-
869
+ - a Filter Data structure
889
870
 
890
- ### dist/general/mix/compareDeep.js
891
871
 
892
872
 
893
- #### compareDeep(object1, object2)
873
+ #### UI21ToFD(uFilterData, version)
894
874
 
895
- Compares two objects to know if they are equals. Go across nested objects.
896
- Includes arrays in the comparison.
875
+ Builds the Fitler Data structure from UI filter data
897
876
 
898
877
 
899
878
 
@@ -902,8 +881,8 @@ Includes arrays in the comparison.
902
881
 
903
882
  | Name | Type | Description | |
904
883
  | ---- | ---- | ----------- | -------- |
905
- | object1 | | First Object to compare |   |
906
- | object2 | | Second Object to compare |   |
884
+ | uFilterData | | The UI filter Data object |   |
885
+ | version | | the version of the structure |   |
907
886
 
908
887
 
909
888
 
@@ -911,17 +890,17 @@ Includes arrays in the comparison.
911
890
  ##### Returns
912
891
 
913
892
 
914
- - True: objects are equal. False: Objects are not equal. Undefined: invalid
893
+ -
915
894
 
916
895
 
917
896
 
918
897
 
919
- ### dist/general/mix/getTag.js
898
+ ### dist/filters/adapters/UIToFlatUI.js
920
899
 
921
900
 
922
- #### getTag(value)
901
+ #### UIToFlatUI(filterData, datasetsInfo)
923
902
 
924
- Gets the `toStringTag` of `value`.
903
+ Generates a Flattened UI filter structure from UI Filter Data structure.
925
904
 
926
905
 
927
906
 
@@ -930,7 +909,8 @@ Gets the `toStringTag` of `value`.
930
909
 
931
910
  | Name | Type | Description | |
932
911
  | ---- | ---- | ----------- | -------- |
933
- | value | | The value to query. |   |
912
+ | filterData | | The UI filter data object. |   |
913
+ | datasetsInfo | | Collection of datasets information. Optional for updating the datasets info |   |
934
914
 
935
915
 
936
916
 
@@ -938,17 +918,13 @@ Gets the `toStringTag` of `value`.
938
918
  ##### Returns
939
919
 
940
920
 
941
- - `string` Returns the `toStringTag`.
942
-
943
-
944
-
921
+ - a flattened UI filters array
945
922
 
946
- ### dist/general/mix/importScripts.js
947
923
 
948
924
 
949
- #### importScripts(scripts)
925
+ #### UI21ToFlatUI(scopes)
950
926
 
951
- Import a set of external Scripts given the URL in both serie and cascade way
927
+ Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
952
928
 
953
929
 
954
930
 
@@ -957,54 +933,26 @@ Import a set of external Scripts given the URL in both serie and cascade way
957
933
 
958
934
  | Name | Type | Description | |
959
935
  | ---- | ---- | ----------- | -------- |
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; |
936
+ | scopes | | The filter scope section | &nbsp; |
966
937
 
967
938
 
968
939
 
969
940
 
970
- ##### Examples
941
+ ##### Returns
971
942
 
972
- ```javascript
973
- // 1) Simple script (paralell loading)
974
- importScripts(['http://myscript.js', 'http://another.js']);
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
- ```
995
943
 
944
+ - a flattened UI filters array
996
945
 
997
- ##### Returns
998
946
 
999
947
 
1000
- - `Promise` Promise when all script have been loaded
1001
948
 
949
+ ### dist/filters/adapters/adaptDateGroupingProperty.js
1002
950
 
1003
951
 
1004
- #### loadScript(url, type, noModule)
952
+ #### adaptDateGroupingProperty(property)
1005
953
 
1006
- Creates the script element and appends to document.head
1007
- return a Promise that is resolved when the script is loaded
954
+ [TODO: For 2022, eliminate this adapter]
955
+ Get the new property base on the old date grouping properties
1008
956
 
1009
957
 
1010
958
 
@@ -1013,9 +961,7 @@ return a Promise that is resolved when the script is loaded
1013
961
 
1014
962
  | Name | Type | Description | |
1015
963
  | ---- | ---- | ----------- | -------- |
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; |
964
+ | property | | | &nbsp; |
1019
965
 
1020
966
 
1021
967
 
@@ -1023,17 +969,17 @@ return a Promise that is resolved when the script is loaded
1023
969
  ##### Returns
1024
970
 
1025
971
 
1026
- - `Void`
972
+ -
1027
973
 
1028
974
 
1029
975
 
1030
976
 
1031
- ### dist/general/mix/isEmpty.js
977
+ ### dist/filters/adapters/adaptFilterData.js
1032
978
 
1033
979
 
1034
- #### isEmpty(variable, includeFalsy)
980
+ #### adaptFilterData(filterData, getUIFilterData, datasetsInfo)
1035
981
 
1036
- Validates if the given argument is empty
982
+ Checks and adapts the v2.0 Filter Data Structure to the v2.1
1037
983
 
1038
984
 
1039
985
 
@@ -1042,8 +988,9 @@ Validates if the given argument is empty
1042
988
 
1043
989
  | Name | Type | Description | |
1044
990
  | ---- | ---- | ----------- | -------- |
1045
- | variable | | the given variable | &nbsp; |
1046
- | includeFalsy | | flag to determine include the falsy variables into the validation | &nbsp; |
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; |
1047
994
 
1048
995
 
1049
996
 
@@ -1051,19 +998,18 @@ Validates if the given argument is empty
1051
998
  ##### Returns
1052
999
 
1053
1000
 
1054
- - true: the given argument is empty; false: is not.
1001
+ - A new filter data structure v2.1
1055
1002
 
1056
1003
 
1057
1004
 
1058
1005
 
1059
- ### dist/general/mix/isNaNV2.js
1006
+ ### dist/filters/adapters/adaptFilterValues.js
1060
1007
 
1061
1008
 
1062
- #### isNaNV2(variable)
1009
+ #### adaptFilterValues(filter)
1063
1010
 
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.
1011
+ [TODO: For 2022, eliminate this adapter]
1012
+ Gets an adapted filter value array. Validates the enabled property and sets
1067
1013
 
1068
1014
 
1069
1015
 
@@ -1072,7 +1018,7 @@ Validates if variable is null, undefined, or an empty string, also, the function
1072
1018
 
1073
1019
  | Name | Type | Description | |
1074
1020
  | ---- | ---- | ----------- | -------- |
1075
- | variable | | the variable to validate | &nbsp; |
1021
+ | filter | | The filter | &nbsp; |
1076
1022
 
1077
1023
 
1078
1024
 
@@ -1080,18 +1026,17 @@ Validates if variable is null, undefined, or an empty string, also, the function
1080
1026
  ##### Returns
1081
1027
 
1082
1028
 
1083
- - True if variable is a NaN or false otherwise
1029
+ - A new value array with the filled properties.
1084
1030
 
1085
1031
 
1086
1032
 
1087
1033
 
1088
- ### dist/general/mix/isNull.js
1034
+ ### dist/filters/adapters/flatUIToFD.js
1089
1035
 
1090
1036
 
1091
- #### isNull(arg)
1037
+ #### flatUIToFD(uFilters, version)
1092
1038
 
1093
- return if a given variable is either `null` or `undefined`
1094
- useful to avoid falsify validating Number Zero (0)
1039
+ Generates a filter data structure from the flatttened UI filters.
1095
1040
 
1096
1041
 
1097
1042
 
@@ -1100,7 +1045,8 @@ useful to avoid falsify validating Number Zero (0)
1100
1045
 
1101
1046
  | Name | Type | Description | |
1102
1047
  | ---- | ---- | ----------- | -------- |
1103
- | arg | `any` | | &nbsp; |
1048
+ | uFilters | | Array of flattened filters from UI | &nbsp; |
1049
+ | version | | Tag for the version of the filter data structure | &nbsp; |
1104
1050
 
1105
1051
 
1106
1052
 
@@ -1108,19 +1054,14 @@ useful to avoid falsify validating Number Zero (0)
1108
1054
  ##### Returns
1109
1055
 
1110
1056
 
1111
- - `Boolean`
1112
-
1113
-
1114
-
1057
+ - a Filter Data.
1115
1058
 
1116
- ### dist/general/mix/randomId.js
1117
1059
 
1118
1060
 
1119
- #### randomId(length, exclude)
1061
+ #### buildScopes(fbFilters)
1120
1062
 
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.
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
1124
1065
 
1125
1066
 
1126
1067
 
@@ -1129,8 +1070,7 @@ Creates a random string
1129
1070
 
1130
1071
  | Name | Type | Description | |
1131
1072
  | ---- | ---- | ----------- | -------- |
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; |
1073
+ | fbFilters | | Array of flat filters from UI | &nbsp; |
1134
1074
 
1135
1075
 
1136
1076
 
@@ -1138,19 +1078,13 @@ Creates a random string
1138
1078
  ##### Returns
1139
1079
 
1140
1080
 
1141
- - `String` Random string
1142
-
1143
-
1144
-
1081
+ - an array of scopes structure.
1145
1082
 
1146
- ### dist/general/mix/size.js
1147
1083
 
1148
1084
 
1149
- #### size(obj)
1085
+ #### buildScope(uFilter)
1150
1086
 
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.
1087
+ Gets an scope structure for the filter data
1154
1088
 
1155
1089
 
1156
1090
 
@@ -1159,7 +1093,7 @@ Gets the length of the given array.
1159
1093
 
1160
1094
  | Name | Type | Description | |
1161
1095
  | ---- | ---- | ----------- | -------- |
1162
- | obj | `Any` | Any object-type variable | &nbsp; |
1096
+ | uFilter | | UI structure filter | &nbsp; |
1163
1097
 
1164
1098
 
1165
1099
 
@@ -1167,18 +1101,13 @@ Gets the length of the given array.
1167
1101
  ##### Returns
1168
1102
 
1169
1103
 
1170
- - `Number` the size of the given variable
1171
-
1172
-
1173
-
1104
+ - an scope structure
1174
1105
 
1175
- ### dist/general/object/cloneDeep.js
1176
1106
 
1177
1107
 
1178
- #### cloneDeep(obj)
1108
+ #### buildDataset(uFilter)
1179
1109
 
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
1110
+ Gets an dataset structure for the filter data
1182
1111
 
1183
1112
 
1184
1113
 
@@ -1187,7 +1116,7 @@ Not to use this function with inner objects and functions
1187
1116
 
1188
1117
  | Name | Type | Description | |
1189
1118
  | ---- | ---- | ----------- | -------- |
1190
- | obj | | The object | &nbsp; |
1119
+ | uFilter | | a UI structure filter | &nbsp; |
1191
1120
 
1192
1121
 
1193
1122
 
@@ -1195,21 +1124,13 @@ Not to use this function with inner objects and functions
1195
1124
  ##### Returns
1196
1125
 
1197
1126
 
1198
- - The new reference object or the given object if the parsing is incorrect or empty
1199
-
1200
-
1201
-
1202
-
1203
- ### dist/general/object/get.js
1127
+ - an dataset structure
1204
1128
 
1205
1129
 
1206
- #### _get(baseObject, path, defaultValue)
1207
1130
 
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.
1131
+ #### buildFilter(uFilter)
1210
1132
 
1211
- Empty arrays and empty objects are returned but the defaultValue is not
1212
- Undefined and null values will return the defaultValue.
1133
+ Gets an filter structure for the filter data
1213
1134
 
1214
1135
 
1215
1136
 
@@ -1218,59 +1139,25 @@ Undefined and null values will return the defaultValue.
1218
1139
 
1219
1140
  | Name | Type | Description | |
1220
1141
  | ---- | ---- | ----------- | -------- |
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
-
1142
+ | uFilter | | a UI structure filter | &nbsp; |
1227
1143
 
1228
- ##### Examples
1229
1144
 
1230
- ```javascript
1231
- // returns 'Hello'
1232
- _get({ item1: 'Hello', item2: 'World' }, 'item1')
1233
- ```
1234
- ```javascript
1235
- // returns 'A simple Hello'
1236
- _get({ item1: 'Hello', item2: 'World' }, 'item3', 'A simple Hello')
1237
- ```
1238
- ```javascript
1239
- // returns 'Hello Again'
1240
- _get({ item1: { item11: 'Hello Again' }, item2: {} }, 'item1.item11')
1241
- ```
1242
- ```javascript
1243
- // returns 'Hello 2'
1244
- _get({ item1: ['Hello 1', 'Hello 2' }, item2: [] }, 'item1[1]')
1245
- ```
1246
- ```javascript
1247
- // returns 'Hello Again'
1248
- _get({ item1: { item11: 'Hello Again' }, item2: {} }, ['item1', 'item11'])
1249
- ```
1250
1145
 
1251
1146
 
1252
1147
  ##### Returns
1253
1148
 
1254
1149
 
1255
- - the resolved value.
1150
+ - an filter structure
1256
1151
 
1257
1152
 
1258
1153
 
1259
1154
 
1260
- ### dist/general/object/getAttribute.js
1155
+ ### dist/filters/adapters/flatUIToLogic.js
1261
1156
 
1262
1157
 
1263
- #### getAttribute(obj, key)
1158
+ #### flatUIToLogic(uFilter)
1264
1159
 
1265
- Searchs for properties in different case styles such as: lower, upper, camel and pascal
1266
- - To optimize the searching, it is required a key in a snake_case style
1267
- - List of cases that do not match
1268
- -- From lower to snake case
1269
- -- From upper to snake case
1270
- -- From lower to camel case
1271
- -- From upper to camel case
1272
- -- From lower to pascal case
1273
- -- From upper to pascal case
1160
+ Generates a Logic structure from flattened UI filters
1274
1161
 
1275
1162
 
1276
1163
 
@@ -1279,33 +1166,25 @@ Searchs for properties in different case styles such as: lower, upper, camel and
1279
1166
 
1280
1167
  | Name | Type | Description | |
1281
1168
  | ---- | ---- | ----------- | -------- |
1282
- | obj | `object` | object to look for | &nbsp; |
1283
- | key | `string` | String attribute in snake_case style | &nbsp; |
1284
-
1285
-
1286
-
1169
+ | uFilter | | Array of flat filters from UI | &nbsp; |
1287
1170
 
1288
- ##### Examples
1289
1171
 
1290
- ```javascript
1291
- getAttribute(obj, 'snake_case') //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
1292
- ```
1293
1172
 
1294
1173
 
1295
1174
  ##### Returns
1296
1175
 
1297
1176
 
1298
- - `Void`
1177
+ - The logic structure
1299
1178
 
1300
1179
 
1301
1180
 
1302
1181
 
1303
- ### dist/general/object/hasProperty.js
1182
+ ### dist/filters/adapters/flatUIToOldLogic.js
1304
1183
 
1305
1184
 
1306
- #### _hasProperty(obj, property)
1185
+ #### flatUIToOldLogic(uFilters)
1307
1186
 
1308
- Use the hasOwnProperty in order to verify if the given property exists in the object.
1187
+ Generates a Logic structure from flattened UI filters
1309
1188
 
1310
1189
 
1311
1190
 
@@ -1314,38 +1193,25 @@ Use the hasOwnProperty in order to verify if the given property exists in the ob
1314
1193
 
1315
1194
  | Name | Type | Description | |
1316
1195
  | ---- | ---- | ----------- | -------- |
1317
- | obj | `object` | an object | &nbsp; |
1318
- | property | `string` | String to verify if exists in the object as property | &nbsp; |
1319
-
1320
-
1321
-
1322
-
1323
- ##### Examples
1196
+ | uFilters | | Array of flat filters from UI | &nbsp; |
1324
1197
 
1325
- ```javascript
1326
- const prop = 'prop2'
1327
- const obj1 = { prop1: 'hello', prop2: 'world'}
1328
- _hasProperty(ob1, prop1) // true
1329
1198
 
1330
- const obj2 = { prop1: 'hello world' }
1331
- _hasProperty(ob1, prop2) // false
1332
- ```
1333
1199
 
1334
1200
 
1335
1201
  ##### Returns
1336
1202
 
1337
1203
 
1338
- - True if the object has the given property; otherwise, false.
1204
+ - The logic structure
1339
1205
 
1340
1206
 
1341
1207
 
1342
1208
 
1343
- ### dist/general/object/isObject.js
1209
+ ### dist/filters/adapters/flatUIToUI.js
1344
1210
 
1345
1211
 
1346
- #### isObject(obj)
1212
+ #### flatUIToUI(uFilters, version)
1347
1213
 
1348
- Checks if the given argument is an object type
1214
+ Generates a UI filter data structure from the flatttened UI filters.
1349
1215
 
1350
1216
 
1351
1217
 
@@ -1354,7 +1220,8 @@ Checks if the given argument is an object type
1354
1220
 
1355
1221
  | Name | Type | Description | |
1356
1222
  | ---- | ---- | ----------- | -------- |
1357
- | obj | | the variable to check | &nbsp; |
1223
+ | uFilters | | Array of flattened filters from UI | &nbsp; |
1224
+ | version | | Tag for the version of the filter data structure | &nbsp; |
1358
1225
 
1359
1226
 
1360
1227
 
@@ -1362,18 +1229,14 @@ Checks if the given argument is an object type
1362
1229
  ##### Returns
1363
1230
 
1364
1231
 
1365
- - True: It is an object; False: It is not.
1366
-
1367
-
1368
-
1232
+ - a UI Filter Data.
1369
1233
 
1370
- ### dist/general/object/mapValues.js
1371
1234
 
1372
1235
 
1373
- #### mapValues(baseObject, iteratee)
1236
+ #### buildScopes(fbFilters)
1374
1237
 
1375
- Invoke iteratee (function) for each object key-value pair
1376
- and return a mapped object
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
1377
1240
 
1378
1241
 
1379
1242
 
@@ -1382,8 +1245,7 @@ and return a mapped object
1382
1245
 
1383
1246
  | Name | Type | Description | |
1384
1247
  | ---- | ---- | ----------- | -------- |
1385
- | baseObject | `Object` | Base object. | &nbsp; |
1386
- | iteratee | `Function` | The executed per iteration. | &nbsp; |
1248
+ | fbFilters | | Array of flat filters from UI | &nbsp; |
1387
1249
 
1388
1250
 
1389
1251
 
@@ -1391,18 +1253,13 @@ and return a mapped object
1391
1253
  ##### Returns
1392
1254
 
1393
1255
 
1394
- - `Object` New mapped object.
1395
-
1396
-
1397
-
1256
+ - an array of scopes structure.
1398
1257
 
1399
- ### dist/general/object/mergeDeep.js
1400
1258
 
1401
1259
 
1402
- #### mergeDeep(obj1, obj2, settings)
1260
+ #### buildScope(uFilter)
1403
1261
 
1404
- Merges two objects into a new one.
1405
- The second given argument to the first given argument.
1262
+ Gets an scope structure for the UI filter data
1406
1263
 
1407
1264
 
1408
1265
 
@@ -1411,9 +1268,7 @@ The second given argument to the first given argument.
1411
1268
 
1412
1269
  | Name | Type | Description | |
1413
1270
  | ---- | ---- | ----------- | -------- |
1414
- | obj1 | | The target object | &nbsp; |
1415
- | obj2 | | The object to be merged | &nbsp; |
1416
- | settings | | Object settings for this function | &nbsp; |
1271
+ | uFilter | | UI structure filter | &nbsp; |
1417
1272
 
1418
1273
 
1419
1274
 
@@ -1421,13 +1276,13 @@ The second given argument to the first given argument.
1421
1276
  ##### Returns
1422
1277
 
1423
1278
 
1424
- - a new merged object
1279
+ - an scope structure
1425
1280
 
1426
1281
 
1427
1282
 
1428
- #### isValid(obj1, obj2)
1283
+ #### buildDataset(uFilter)
1429
1284
 
1430
- Validates if the two arguments are objects
1285
+ Gets an dataset structure for the UI filter data
1431
1286
 
1432
1287
 
1433
1288
 
@@ -1436,8 +1291,7 @@ Validates if the two arguments are objects
1436
1291
 
1437
1292
  | Name | Type | Description | |
1438
1293
  | ---- | ---- | ----------- | -------- |
1439
- | obj1 | | The target object | &nbsp; |
1440
- | obj2 | | The object to be merged | &nbsp; |
1294
+ | uFilter | | a UI structure filter | &nbsp; |
1441
1295
 
1442
1296
 
1443
1297
 
@@ -1445,13 +1299,13 @@ Validates if the two arguments are objects
1445
1299
  ##### Returns
1446
1300
 
1447
1301
 
1448
- - true: they are valid; false: they are not
1302
+ - an dataset structure
1449
1303
 
1450
1304
 
1451
1305
 
1452
- #### getParamsToMergeDeep(settings)
1306
+ #### buildFilter(uFilter)
1453
1307
 
1454
- Validates and gets the settings with all set parameters.
1308
+ Gets an filter structure for the UI filter data
1455
1309
 
1456
1310
 
1457
1311
 
@@ -1460,7 +1314,7 @@ Validates and gets the settings with all set parameters.
1460
1314
 
1461
1315
  | Name | Type | Description | |
1462
1316
  | ---- | ---- | ----------- | -------- |
1463
- | settings | | the settings object | &nbsp; |
1317
+ | uFilter | | a UI structure filter | &nbsp; |
1464
1318
 
1465
1319
 
1466
1320
 
@@ -1468,17 +1322,17 @@ Validates and gets the settings with all set parameters.
1468
1322
  ##### Returns
1469
1323
 
1470
1324
 
1471
- - a new settings object with all set parameters.
1325
+ - an filter structure
1472
1326
 
1473
1327
 
1474
1328
 
1475
1329
 
1476
- ### dist/general/object/objectCopy.js
1330
+ ### dist/filters/adapters/logicToFD.js
1477
1331
 
1478
1332
 
1479
- #### objectCopy(entity, cache)
1333
+ #### logicToFD(filterData, version)
1480
1334
 
1481
- Created a new reference of the given argument
1335
+ Generates a filter data structure from the old logic structure (v2.0).
1482
1336
 
1483
1337
 
1484
1338
 
@@ -1487,8 +1341,8 @@ Created a new reference of the given argument
1487
1341
 
1488
1342
  | Name | Type | Description | |
1489
1343
  | ---- | ---- | ----------- | -------- |
1490
- | entity | | The variable to be copied | &nbsp; |
1491
- | cache | | | &nbsp; |
1344
+ | filterData | | The old filter data structure with logic (v2.0) | &nbsp; |
1345
+ | version | | Tag for the version of the filter data structure | &nbsp; |
1492
1346
 
1493
1347
 
1494
1348
 
@@ -1496,17 +1350,17 @@ Created a new reference of the given argument
1496
1350
  ##### Returns
1497
1351
 
1498
1352
 
1499
- - A new reference of the given argument
1353
+ - a Filter Data.
1500
1354
 
1501
1355
 
1502
1356
 
1503
1357
 
1504
- ### dist/general/object/omit.js
1358
+ ### dist/filters/adapters/logicToFlatUI.js
1505
1359
 
1506
1360
 
1507
- #### omit(obj, props)
1361
+ #### logicToFlatUI(logics)
1508
1362
 
1509
- return a new Object excluding attributes in _props_ list
1363
+ Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
1510
1364
 
1511
1365
 
1512
1366
 
@@ -1515,8 +1369,7 @@ return a new Object excluding attributes in _props_ list
1515
1369
 
1516
1370
  | Name | Type | Description | |
1517
1371
  | ---- | ---- | ----------- | -------- |
1518
- | obj | `Object` | base object | &nbsp; |
1519
- | props | `Array.<String>` | list of attribute to exclude | &nbsp; |
1372
+ | logics | | The old logic structure (v2.0) | &nbsp; |
1520
1373
 
1521
1374
 
1522
1375
 
@@ -1524,17 +1377,13 @@ return a new Object excluding attributes in _props_ list
1524
1377
  ##### Returns
1525
1378
 
1526
1379
 
1527
- - `Object` clean object
1528
-
1529
-
1530
-
1380
+ - The Flattened UI Filters array
1531
1381
 
1532
- ### dist/general/object/pick.js
1533
1382
 
1534
1383
 
1535
- #### pick(baseObject, keys)
1384
+ #### getFilter(filters, filter, getIndex)
1536
1385
 
1537
- return a new object just with attributes in _keys_ list
1386
+ Get the filter or the index of the given array, validating an old filter structure.
1538
1387
 
1539
1388
 
1540
1389
 
@@ -1543,8 +1392,9 @@ return a new object just with attributes in _keys_ list
1543
1392
 
1544
1393
  | Name | Type | Description | |
1545
1394
  | ---- | ---- | ----------- | -------- |
1546
- | baseObject | `Object` | base object | &nbsp; |
1547
- | keys | `Array.<String>` | list of attributes to preserve | &nbsp; |
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; |
1548
1398
 
1549
1399
 
1550
1400
 
@@ -1552,17 +1402,13 @@ return a new object just with attributes in _keys_ list
1552
1402
  ##### Returns
1553
1403
 
1554
1404
 
1555
- - `Object` new object just with desired attributes
1556
-
1557
-
1558
-
1405
+ - the index or the UI filter object
1559
1406
 
1560
- ### dist/general/object/serialize.js
1561
1407
 
1562
1408
 
1563
- #### serialize(obj)
1409
+ #### refineRankingValues(values, uiValues)
1564
1410
 
1565
- serialize object to url param
1411
+ Refines the values of the Ranking column type.
1566
1412
 
1567
1413
 
1568
1414
 
@@ -1571,7 +1417,8 @@ serialize object to url param
1571
1417
 
1572
1418
  | Name | Type | Description | |
1573
1419
  | ---- | ---- | ----------- | -------- |
1574
- | obj | | - Object to be serialized | &nbsp; |
1420
+ | values | | the Array of Ranking values | &nbsp; |
1421
+ | uiValues | | Object with additional info about the values of the filter. | &nbsp; |
1575
1422
 
1576
1423
 
1577
1424
 
@@ -1579,17 +1426,17 @@ serialize object to url param
1579
1426
  ##### Returns
1580
1427
 
1581
1428
 
1582
- - `Void`
1429
+ - the array of Ranking values
1583
1430
 
1584
1431
 
1585
1432
 
1586
1433
 
1587
- ### dist/general/string/capitalize.js
1434
+ ### dist/filters/adapters/logicToUI.js
1588
1435
 
1589
1436
 
1590
- #### capitalize(text)
1437
+ #### logicToUI(uFilters, datasetsInfo)
1591
1438
 
1592
- Upper case the first letter of a given text
1439
+ Generates a UI filter structure from the old logic structure (v2.0).
1593
1440
 
1594
1441
 
1595
1442
 
@@ -1598,7 +1445,8 @@ Upper case the first letter of a given text
1598
1445
 
1599
1446
  | Name | Type | Description | |
1600
1447
  | ---- | ---- | ----------- | -------- |
1601
- | text | `String` | | &nbsp; |
1448
+ | uFilters | | Array of filters from old logic structure | &nbsp; |
1449
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
1602
1450
 
1603
1451
 
1604
1452
 
@@ -1606,17 +1454,17 @@ Upper case the first letter of a given text
1606
1454
  ##### Returns
1607
1455
 
1608
1456
 
1609
- - `String` a capitalized text
1457
+ - a UI Filter Data.
1610
1458
 
1611
1459
 
1612
1460
 
1613
1461
 
1614
- ### dist/filters/adapters/FDToLogic.js
1462
+ ### dist/filters/adapters/transformFilters.js
1615
1463
 
1616
1464
 
1617
- #### FDToLogic(filterData)
1465
+ #### transformFilters(oldFiltersObj, section)
1618
1466
 
1619
- Generates a Filter Logic structure from Filter Data structure.
1467
+ Transform the old filters structure into the new one
1620
1468
 
1621
1469
 
1622
1470
 
@@ -1625,30 +1473,79 @@ Generates a Filter Logic structure from Filter Data structure.
1625
1473
 
1626
1474
  | Name | Type | Description | |
1627
1475
  | ---- | ---- | ----------- | -------- |
1628
- | filterData | | The filter data object. | &nbsp; |
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
+
1629
1479
 
1630
1480
 
1631
1481
 
1482
+ ##### Examples
1483
+
1484
+ ```javascript
1485
+
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
+
1529
+ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
1530
+ ```
1531
+
1632
1532
 
1633
1533
  ##### Returns
1634
1534
 
1635
1535
 
1636
- - a filter logic array
1536
+ - `Object` an object with the new filters structure
1637
1537
 
1638
1538
 
1639
1539
 
1640
- #### getLogicBodyFromFD21(filterData)
1641
1540
 
1642
- Gets the logic body
1541
+ ### dist/filters/classes/FilterInputErrorHandler.js
1542
+
1643
1543
 
1544
+ #### new FilterInputErrorHandler()
1644
1545
 
1645
1546
 
1646
1547
 
1647
- ##### Parameters
1648
1548
 
1649
- | Name | Type | Description | |
1650
- | ---- | ---- | ----------- | -------- |
1651
- | filterData | | The filter data object | &nbsp; |
1652
1549
 
1653
1550
 
1654
1551
 
@@ -1656,17 +1553,17 @@ Gets the logic body
1656
1553
  ##### Returns
1657
1554
 
1658
1555
 
1659
- - a filter logic array
1556
+ - `Void`
1660
1557
 
1661
1558
 
1662
1559
 
1663
1560
 
1664
- ### dist/filters/adapters/FDToFlatUI.js
1561
+ ### dist/filters/helpers/applyHierarchyForAggFilters.js
1665
1562
 
1666
1563
 
1667
- #### FDToFlatUI(filterData, datasetsInfo)
1564
+ #### applyHierarchyForAggFilters(chartSettings, scopes, currentScope)
1668
1565
 
1669
- Generates a Flattened UI filter structure from Filter Data structure.
1566
+ [TODO: Make a proper description for this function]
1670
1567
 
1671
1568
 
1672
1569
 
@@ -1675,8 +1572,9 @@ Generates a Flattened UI filter structure from Filter Data structure.
1675
1572
 
1676
1573
  | Name | Type | Description | |
1677
1574
  | ---- | ---- | ----------- | -------- |
1678
- | filterData | | The filter data object. | &nbsp; |
1679
- | datasetsInfo | | Collection of datasets information | &nbsp; |
1575
+ | chartSettings | | Chart Settings for the Filter Builder | &nbsp; |
1576
+ | scopes | | | &nbsp; |
1577
+ | currentScope | | | &nbsp; |
1680
1578
 
1681
1579
 
1682
1580
 
@@ -1684,13 +1582,17 @@ Generates a Flattened UI filter structure from Filter Data structure.
1684
1582
  ##### Returns
1685
1583
 
1686
1584
 
1687
- - a flattened UI filters array
1585
+ -
1688
1586
 
1689
1587
 
1690
1588
 
1691
- #### FD21ToFlatUI(scopes, datasetsInfo)
1692
1589
 
1693
- Generates a Filter Builder Structure from the Filter Data structure v2.1
1590
+ ### dist/filters/helpers/getAvailableScopes.js
1591
+
1592
+
1593
+ #### getAvailableScopes(config)
1594
+
1595
+ Gets Scopes/Scope IDs by given IDs
1694
1596
 
1695
1597
 
1696
1598
 
@@ -1699,8 +1601,7 @@ Generates a Filter Builder Structure from the Filter Data structure v2.1
1699
1601
 
1700
1602
  | Name | Type | Description | |
1701
1603
  | ---- | ---- | ----------- | -------- |
1702
- | scopes | | The filter scope section | &nbsp; |
1703
- | datasetsInfo | | Collection of datasets information | &nbsp; |
1604
+ | config | | given Differnts IDs in order set a available scope | &nbsp; |
1704
1605
 
1705
1606
 
1706
1607
 
@@ -1708,17 +1609,17 @@ Generates a Filter Builder Structure from the Filter Data structure v2.1
1708
1609
  ##### Returns
1709
1610
 
1710
1611
 
1711
- - a flattened UI filters array
1612
+ - a Scopes/Scope IDs array
1712
1613
 
1713
1614
 
1714
1615
 
1715
1616
 
1716
- ### dist/filters/adapters/FDToUI.js
1617
+ ### dist/filters/helpers/getAvailableScopesIDsByConfig.js
1717
1618
 
1718
1619
 
1719
- #### FDToUI(filterData, datasetsInfo)
1620
+ #### getAvailableScopesIDsByConfig(config)
1720
1621
 
1721
- Generates a UI filter structure from Filter Data structure.
1622
+ Gets the Scopes IDS for the Available Scope function by any config
1722
1623
 
1723
1624
 
1724
1625
 
@@ -1727,8 +1628,7 @@ Generates a UI filter structure from Filter Data structure.
1727
1628
 
1728
1629
  | Name | Type | Description | |
1729
1630
  | ---- | ---- | ----------- | -------- |
1730
- | filterData | | The filter data object. | &nbsp; |
1731
- | datasetsInfo | | Collection of datasets information | &nbsp; |
1631
+ | config | | any config | &nbsp; |
1732
1632
 
1733
1633
 
1734
1634
 
@@ -1736,13 +1636,17 @@ Generates a UI filter structure from Filter Data structure.
1736
1636
  ##### Returns
1737
1637
 
1738
1638
 
1739
- - a UI Filters structure
1639
+ - a Available Scope IDS config
1740
1640
 
1741
1641
 
1742
1642
 
1743
- #### FD21ToUI(scopes, section, version, datasetsInfo)
1744
1643
 
1745
- Generates a UI filter Structure from the Filter Data structure v2.1
1644
+ ### dist/filters/helpers/getScopesByHierarchy.js
1645
+
1646
+
1647
+ #### getScopesByHierarchy(scopes, currentScope)
1648
+
1649
+ [TODO: Make a description for this]
1746
1650
 
1747
1651
 
1748
1652
 
@@ -1751,10 +1655,8 @@ Generates a UI filter Structure from the Filter Data structure v2.1
1751
1655
 
1752
1656
  | Name | Type | Description | |
1753
1657
  | ---- | ---- | ----------- | -------- |
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; |
1658
+ | scopes | | the collection of Scopes/Scope IDs | &nbsp; |
1659
+ | currentScope | | Current scope type | &nbsp; |
1758
1660
 
1759
1661
 
1760
1662
 
@@ -1762,17 +1664,17 @@ Generates a UI filter Structure from the Filter Data structure v2.1
1762
1664
  ##### Returns
1763
1665
 
1764
1666
 
1765
- - a UI filter Structure
1667
+ - A new array of Scopes/Scope IDs
1766
1668
 
1767
1669
 
1768
1670
 
1769
1671
 
1770
- ### dist/filters/adapters/UIToFD.js
1672
+ ### dist/general/array/delete.js
1771
1673
 
1772
1674
 
1773
- #### UIToFD(filterData)
1675
+ #### ArrayDelete(array, index)
1774
1676
 
1775
- Generates a Filter Data Structure structure from UI Filter Data structure.
1677
+ Inmutable Array Item deletion
1776
1678
 
1777
1679
 
1778
1680
 
@@ -1781,7 +1683,8 @@ Generates a Filter Data Structure structure from UI Filter Data structure.
1781
1683
 
1782
1684
  | Name | Type | Description | |
1783
1685
  | ---- | ---- | ----------- | -------- |
1784
- | filterData | | The UI filter data object. | &nbsp; |
1686
+ | array | `Array` | a collection of items to delete | &nbsp; |
1687
+ | index | `Number` | the position of the item to delete | &nbsp; |
1785
1688
 
1786
1689
 
1787
1690
 
@@ -1789,13 +1692,20 @@ Generates a Filter Data Structure structure from UI Filter Data structure.
1789
1692
  ##### Returns
1790
1693
 
1791
1694
 
1792
- - a Filter Data structure
1695
+ - a new Array or the given parameter when is empty or not an array
1793
1696
 
1794
1697
 
1795
1698
 
1796
- #### UI21ToFD(uFilterData, version)
1797
1699
 
1798
- Builds the Fitler Data structure from UI filter data
1700
+ ### dist/general/array/filterNestedTree.js
1701
+
1702
+
1703
+ #### filterNestedTree(arr, childArrKey, condition)
1704
+
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
1799
1709
 
1800
1710
 
1801
1711
 
@@ -1804,8 +1714,9 @@ Builds the Fitler Data structure from UI filter data
1804
1714
 
1805
1715
  | Name | Type | Description | |
1806
1716
  | ---- | ---- | ----------- | -------- |
1807
- | uFilterData | | The UI filter Data object | &nbsp; |
1808
- | version | | the version of the structure | &nbsp; |
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; |
1809
1720
 
1810
1721
 
1811
1722
 
@@ -1813,17 +1724,17 @@ Builds the Fitler Data structure from UI filter data
1813
1724
  ##### Returns
1814
1725
 
1815
1726
 
1816
- -
1727
+ - array filtered
1817
1728
 
1818
1729
 
1819
1730
 
1820
1731
 
1821
- ### dist/filters/adapters/UIToFlatUI.js
1732
+ ### dist/general/array/flattenDeep.js
1822
1733
 
1823
1734
 
1824
- #### UIToFlatUI(filterData, datasetsInfo)
1735
+ #### flattenDeep(arr)
1825
1736
 
1826
- Generates a Flattened UI filter structure from UI Filter Data structure.
1737
+ Flat deeply an array
1827
1738
 
1828
1739
 
1829
1740
 
@@ -1832,8 +1743,7 @@ Generates a Flattened UI filter structure from UI Filter Data structure.
1832
1743
 
1833
1744
  | Name | Type | Description | |
1834
1745
  | ---- | ---- | ----------- | -------- |
1835
- | filterData | | The UI filter data object. | &nbsp; |
1836
- | datasetsInfo | | Collection of datasets information. Optional for updating the datasets info | &nbsp; |
1746
+ | arr | | Array to flat deeply | &nbsp; |
1837
1747
 
1838
1748
 
1839
1749
 
@@ -1841,13 +1751,17 @@ Generates a Flattened UI filter structure from UI Filter Data structure.
1841
1751
  ##### Returns
1842
1752
 
1843
1753
 
1844
- - a flattened UI filters array
1754
+ - flatten array
1845
1755
 
1846
1756
 
1847
1757
 
1848
- #### UI21ToFlatUI(scopes)
1849
1758
 
1850
- Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
1759
+ ### dist/general/array/getFirstIndexFromArray.js
1760
+
1761
+
1762
+ #### getFirstIndexFromArray(array, callback)
1763
+
1764
+ Gets the first index from the array by a callback condition
1851
1765
 
1852
1766
 
1853
1767
 
@@ -1856,7 +1770,8 @@ Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
1856
1770
 
1857
1771
  | Name | Type | Description | |
1858
1772
  | ---- | ---- | ----------- | -------- |
1859
- | scopes | | The filter scope section | &nbsp; |
1773
+ | array | | | &nbsp; |
1774
+ | callback | | function callback | &nbsp; |
1860
1775
 
1861
1776
 
1862
1777
 
@@ -1864,18 +1779,17 @@ Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
1864
1779
  ##### Returns
1865
1780
 
1866
1781
 
1867
- - a flattened UI filters array
1782
+ - the first index of the array. -1 when the condition is not satisfied
1868
1783
 
1869
1784
 
1870
1785
 
1871
1786
 
1872
- ### dist/filters/adapters/adaptDateGroupingProperty.js
1787
+ ### dist/general/array/getLastIndexFromArray.js
1873
1788
 
1874
1789
 
1875
- #### adaptDateGroupingProperty(property)
1790
+ #### getLastIndexFromArray(array, callback)
1876
1791
 
1877
- [TODO: For 2022, eliminate this adapter]
1878
- Get the new property base on the old date grouping properties
1792
+ Gets the last index from the array by a callback condition
1879
1793
 
1880
1794
 
1881
1795
 
@@ -1884,7 +1798,8 @@ Get the new property base on the old date grouping properties
1884
1798
 
1885
1799
  | Name | Type | Description | |
1886
1800
  | ---- | ---- | ----------- | -------- |
1887
- | property | | | &nbsp; |
1801
+ | array | | | &nbsp; |
1802
+ | callback | | function callback | &nbsp; |
1888
1803
 
1889
1804
 
1890
1805
 
@@ -1892,17 +1807,17 @@ Get the new property base on the old date grouping properties
1892
1807
  ##### Returns
1893
1808
 
1894
1809
 
1895
- -
1810
+ - the last index of the array. -1 when the condition is not satisfied
1896
1811
 
1897
1812
 
1898
1813
 
1899
1814
 
1900
- ### dist/filters/adapters/adaptFilterData.js
1815
+ ### dist/general/function/debounce.js
1901
1816
 
1902
1817
 
1903
- #### adaptFilterData(filterData, getUIFilterData, datasetsInfo)
1818
+ #### debounce(fn, time)
1904
1819
 
1905
- Checks and adapts the v2.0 Filter Data Structure to the v2.1
1820
+ Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last time the debounced function was invoked.
1906
1821
 
1907
1822
 
1908
1823
 
@@ -1911,9 +1826,8 @@ Checks and adapts the v2.0 Filter Data Structure to the v2.1
1911
1826
 
1912
1827
  | Name | Type | Description | |
1913
1828
  | ---- | ---- | ----------- | -------- |
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; |
1829
+ | fn | `Function` | original Function | &nbsp; |
1830
+ | time | `Number` | default 500ms | &nbsp; |
1917
1831
 
1918
1832
 
1919
1833
 
@@ -1921,18 +1835,17 @@ Checks and adapts the v2.0 Filter Data Structure to the v2.1
1921
1835
  ##### Returns
1922
1836
 
1923
1837
 
1924
- - A new filter data structure v2.1
1838
+ - `Function` debounced functions
1925
1839
 
1926
1840
 
1927
1841
 
1928
1842
 
1929
- ### dist/filters/adapters/adaptFilterValues.js
1843
+ ### dist/general/function/throttled.js
1930
1844
 
1931
1845
 
1932
- #### adaptFilterValues(filter)
1846
+ #### throttled(fn, time)
1933
1847
 
1934
- [TODO: For 2022, eliminate this adapter]
1935
- Gets an adapted filter value array. Validates the enabled property and sets
1848
+ Make sure to only invokes _fn_ at most once per every _time_ milliseconds
1936
1849
 
1937
1850
 
1938
1851
 
@@ -1941,7 +1854,8 @@ Gets an adapted filter value array. Validates the enabled property and sets
1941
1854
 
1942
1855
  | Name | Type | Description | |
1943
1856
  | ---- | ---- | ----------- | -------- |
1944
- | filter | | The filter | &nbsp; |
1857
+ | fn | `Function` | original Function | &nbsp; |
1858
+ | time | `Number` | default 500ms | &nbsp; |
1945
1859
 
1946
1860
 
1947
1861
 
@@ -1949,17 +1863,18 @@ Gets an adapted filter value array. Validates the enabled property and sets
1949
1863
  ##### Returns
1950
1864
 
1951
1865
 
1952
- - A new value array with the filled properties.
1866
+ - `Function` throttled function
1953
1867
 
1954
1868
 
1955
1869
 
1956
1870
 
1957
- ### dist/filters/adapters/flatUIToFD.js
1871
+ ### dist/general/mix/compareDeep.js
1958
1872
 
1959
1873
 
1960
- #### flatUIToFD(uFilters, version)
1874
+ #### compareDeep(object1, object2)
1961
1875
 
1962
- Generates a filter data structure from the flatttened UI filters.
1876
+ Compares two objects to know if they are equals. Go across nested objects.
1877
+ Includes arrays in the comparison.
1963
1878
 
1964
1879
 
1965
1880
 
@@ -1968,8 +1883,8 @@ Generates a filter data structure from the flatttened UI filters.
1968
1883
 
1969
1884
  | Name | Type | Description | |
1970
1885
  | ---- | ---- | ----------- | -------- |
1971
- | uFilters | | Array of flattened filters from UI | &nbsp; |
1972
- | version | | Tag for the version of the filter data structure | &nbsp; |
1886
+ | object1 | | First Object to compare | &nbsp; |
1887
+ | object2 | | Second Object to compare | &nbsp; |
1973
1888
 
1974
1889
 
1975
1890
 
@@ -1977,14 +1892,17 @@ Generates a filter data structure from the flatttened UI filters.
1977
1892
  ##### Returns
1978
1893
 
1979
1894
 
1980
- - a Filter Data.
1895
+ - True: objects are equal. False: Objects are not equal. Undefined: invalid
1981
1896
 
1982
1897
 
1983
1898
 
1984
- #### buildScopes(fbFilters)
1985
1899
 
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
1900
+ ### dist/general/mix/getTag.js
1901
+
1902
+
1903
+ #### getTag(value)
1904
+
1905
+ Gets the `toStringTag` of `value`.
1988
1906
 
1989
1907
 
1990
1908
 
@@ -1993,7 +1911,7 @@ Also, adds and organizes filters by datasets
1993
1911
 
1994
1912
  | Name | Type | Description | |
1995
1913
  | ---- | ---- | ----------- | -------- |
1996
- | fbFilters | | Array of flat filters from UI | &nbsp; |
1914
+ | value | | The value to query. | &nbsp; |
1997
1915
 
1998
1916
 
1999
1917
 
@@ -2001,13 +1919,17 @@ Also, adds and organizes filters by datasets
2001
1919
  ##### Returns
2002
1920
 
2003
1921
 
2004
- - an array of scopes structure.
1922
+ - `string` Returns the `toStringTag`.
2005
1923
 
2006
1924
 
2007
1925
 
2008
- #### buildScope(uFilter)
2009
1926
 
2010
- Gets an scope structure for the filter data
1927
+ ### dist/general/mix/importScripts.js
1928
+
1929
+
1930
+ #### importScripts(scripts)
1931
+
1932
+ Import a set of external Scripts given the URL in both serie and cascade way
2011
1933
 
2012
1934
 
2013
1935
 
@@ -2016,21 +1938,54 @@ Gets an scope structure for the filter data
2016
1938
 
2017
1939
  | Name | Type | Description | |
2018
1940
  | ---- | ---- | ----------- | -------- |
2019
- | uFilter | | UI structure filter | &nbsp; |
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']);
2020
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
+ ]);
1962
+
1963
+ // 3) import dependent scripts (cascade)
1964
+ importScripts([
1965
+ { url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] }
1966
+ ]);
2021
1967
 
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
+ ```
2022
1976
 
2023
1977
 
2024
1978
  ##### Returns
2025
1979
 
2026
1980
 
2027
- - an scope structure
1981
+ - `Promise` Promise when all script have been loaded
2028
1982
 
2029
1983
 
2030
1984
 
2031
- #### buildDataset(uFilter)
1985
+ #### loadScript(url, type, noModule)
2032
1986
 
2033
- Gets an dataset structure for the filter data
1987
+ Creates the script element and appends to document.head
1988
+ return a Promise that is resolved when the script is loaded
2034
1989
 
2035
1990
 
2036
1991
 
@@ -2039,7 +1994,9 @@ Gets an dataset structure for the filter data
2039
1994
 
2040
1995
  | Name | Type | Description | |
2041
1996
  | ---- | ---- | ----------- | -------- |
2042
- | uFilter | | a UI structure filter | &nbsp; |
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; |
2043
2000
 
2044
2001
 
2045
2002
 
@@ -2047,13 +2004,17 @@ Gets an dataset structure for the filter data
2047
2004
  ##### Returns
2048
2005
 
2049
2006
 
2050
- - an dataset structure
2007
+ - `Void`
2051
2008
 
2052
2009
 
2053
2010
 
2054
- #### buildFilter(uFilter)
2055
2011
 
2056
- Gets an filter structure for the filter data
2012
+ ### dist/general/mix/isEmpty.js
2013
+
2014
+
2015
+ #### isEmpty(variable, includeFalsy)
2016
+
2017
+ Validates if the given argument is empty
2057
2018
 
2058
2019
 
2059
2020
 
@@ -2062,7 +2023,8 @@ Gets an filter structure for the filter data
2062
2023
 
2063
2024
  | Name | Type | Description | |
2064
2025
  | ---- | ---- | ----------- | -------- |
2065
- | uFilter | | a UI structure filter | &nbsp; |
2026
+ | variable | | the given variable | &nbsp; |
2027
+ | includeFalsy | | flag to determine include the falsy variables into the validation | &nbsp; |
2066
2028
 
2067
2029
 
2068
2030
 
@@ -2070,17 +2032,19 @@ Gets an filter structure for the filter data
2070
2032
  ##### Returns
2071
2033
 
2072
2034
 
2073
- - an filter structure
2035
+ - true: the given argument is empty; false: is not.
2074
2036
 
2075
2037
 
2076
2038
 
2077
2039
 
2078
- ### dist/filters/adapters/flatUIToLogic.js
2040
+ ### dist/general/mix/isNaNV2.js
2079
2041
 
2080
2042
 
2081
- #### flatUIToLogic(uFilter)
2043
+ #### isNaNV2(variable)
2082
2044
 
2083
- Generates a Logic structure from flattened UI filters
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.
2084
2048
 
2085
2049
 
2086
2050
 
@@ -2089,7 +2053,7 @@ Generates a Logic structure from flattened UI filters
2089
2053
 
2090
2054
  | Name | Type | Description | |
2091
2055
  | ---- | ---- | ----------- | -------- |
2092
- | uFilter | | Array of flat filters from UI | &nbsp; |
2056
+ | variable | | the variable to validate | &nbsp; |
2093
2057
 
2094
2058
 
2095
2059
 
@@ -2097,17 +2061,18 @@ Generates a Logic structure from flattened UI filters
2097
2061
  ##### Returns
2098
2062
 
2099
2063
 
2100
- - The logic structure
2064
+ - True if variable is a NaN or false otherwise
2101
2065
 
2102
2066
 
2103
2067
 
2104
2068
 
2105
- ### dist/filters/adapters/flatUIToOldLogic.js
2069
+ ### dist/general/mix/isNull.js
2106
2070
 
2107
2071
 
2108
- #### flatUIToOldLogic(uFilters)
2072
+ #### isNull(arg)
2109
2073
 
2110
- Generates a Logic structure from flattened UI filters
2074
+ return if a given variable is either `null` or `undefined`
2075
+ useful to avoid falsify validating Number Zero (0)
2111
2076
 
2112
2077
 
2113
2078
 
@@ -2116,7 +2081,7 @@ Generates a Logic structure from flattened UI filters
2116
2081
 
2117
2082
  | Name | Type | Description | |
2118
2083
  | ---- | ---- | ----------- | -------- |
2119
- | uFilters | | Array of flat filters from UI | &nbsp; |
2084
+ | arg | `any` | | &nbsp; |
2120
2085
 
2121
2086
 
2122
2087
 
@@ -2124,17 +2089,19 @@ Generates a Logic structure from flattened UI filters
2124
2089
  ##### Returns
2125
2090
 
2126
2091
 
2127
- - The logic structure
2092
+ - `Boolean`
2128
2093
 
2129
2094
 
2130
2095
 
2131
2096
 
2132
- ### dist/filters/adapters/flatUIToUI.js
2097
+ ### dist/general/mix/randomId.js
2133
2098
 
2134
2099
 
2135
- #### flatUIToUI(uFilters, version)
2100
+ #### randomId(length, exclude)
2136
2101
 
2137
- Generates a UI filter data structure from the flatttened UI filters.
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.
2138
2105
 
2139
2106
 
2140
2107
 
@@ -2143,23 +2110,223 @@ Generates a UI filter data structure from the flatttened UI filters.
2143
2110
 
2144
2111
  | Name | Type | Description | |
2145
2112
  | ---- | ---- | ----------- | -------- |
2146
- | uFilters | | Array of flattened filters from UI | &nbsp; |
2147
- | version | | Tag for the version of the filter data structure | &nbsp; |
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; |
2115
+
2116
+
2117
+
2118
+
2119
+ ##### Returns
2120
+
2121
+
2122
+ - `String` Random string
2123
+
2124
+
2125
+
2126
+
2127
+ ### dist/general/mix/size.js
2128
+
2129
+
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.
2135
+
2148
2136
 
2149
2137
 
2150
2138
 
2139
+ ##### Parameters
2140
+
2141
+ | Name | Type | Description | |
2142
+ | ---- | ---- | ----------- | -------- |
2143
+ | obj | `Any` | Any object-type variable | &nbsp; |
2144
+
2145
+
2146
+
2147
+
2148
+ ##### Returns
2149
+
2150
+
2151
+ - `Number` the size of the given variable
2152
+
2153
+
2154
+
2155
+
2156
+ ### dist/general/object/cloneDeep.js
2157
+
2158
+
2159
+ #### cloneDeep(obj)
2160
+
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
2163
+
2164
+
2165
+
2166
+
2167
+ ##### Parameters
2168
+
2169
+ | Name | Type | Description | |
2170
+ | ---- | ---- | ----------- | -------- |
2171
+ | obj | | The object | &nbsp; |
2172
+
2173
+
2174
+
2175
+
2176
+ ##### Returns
2177
+
2178
+
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
2185
+
2186
+
2187
+ #### _get(baseObject, path, defaultValue)
2188
+
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.
2191
+
2192
+ Empty arrays and empty objects are returned but the defaultValue is not
2193
+ Undefined and null values will return the defaultValue.
2194
+
2195
+
2196
+
2197
+
2198
+ ##### Parameters
2199
+
2200
+ | Name | Type | Description | |
2201
+ | ---- | ---- | ----------- | -------- |
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
+
2208
+
2209
+ ##### Examples
2210
+
2211
+ ```javascript
2212
+ // returns 'Hello'
2213
+ _get({ item1: 'Hello', item2: 'World' }, 'item1')
2214
+ ```
2215
+ ```javascript
2216
+ // returns 'A simple Hello'
2217
+ _get({ item1: 'Hello', item2: 'World' }, 'item3', 'A simple Hello')
2218
+ ```
2219
+ ```javascript
2220
+ // returns 'Hello Again'
2221
+ _get({ item1: { item11: 'Hello Again' }, item2: {} }, 'item1.item11')
2222
+ ```
2223
+ ```javascript
2224
+ // returns 'Hello 2'
2225
+ _get({ item1: ['Hello 1', 'Hello 2' }, item2: [] }, 'item1[1]')
2226
+ ```
2227
+ ```javascript
2228
+ // returns 'Hello Again'
2229
+ _get({ item1: { item11: 'Hello Again' }, item2: {} }, ['item1', 'item11'])
2230
+ ```
2231
+
2232
+
2233
+ ##### Returns
2234
+
2235
+
2236
+ - the resolved value.
2237
+
2238
+
2239
+
2240
+
2241
+ ### dist/general/object/getAttribute.js
2242
+
2243
+
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
2255
+
2256
+
2257
+
2258
+
2259
+ ##### Parameters
2260
+
2261
+ | Name | Type | Description | |
2262
+ | ---- | ---- | ----------- | -------- |
2263
+ | obj | `object` | object to look for | &nbsp; |
2264
+ | key | `string` | String attribute in snake_case style | &nbsp; |
2265
+
2266
+
2267
+
2268
+
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
+ ##### Returns
2277
+
2278
+
2279
+ - `Void`
2280
+
2281
+
2282
+
2283
+
2284
+ ### dist/general/object/hasProperty.js
2285
+
2286
+
2287
+ #### _hasProperty(obj, property)
2288
+
2289
+ Use the hasOwnProperty in order to verify if the given property exists in the object.
2290
+
2291
+
2292
+
2293
+
2294
+ ##### Parameters
2295
+
2296
+ | Name | Type | Description | |
2297
+ | ---- | ---- | ----------- | -------- |
2298
+ | obj | `object` | an object | &nbsp; |
2299
+ | property | `string` | String to verify if exists in the object as property | &nbsp; |
2300
+
2301
+
2302
+
2303
+
2304
+ ##### Examples
2305
+
2306
+ ```javascript
2307
+ const prop = 'prop2'
2308
+ const obj1 = { prop1: 'hello', prop2: 'world'}
2309
+ _hasProperty(ob1, prop1) // true
2310
+
2311
+ const obj2 = { prop1: 'hello world' }
2312
+ _hasProperty(ob1, prop2) // false
2313
+ ```
2314
+
2315
+
2316
+ ##### Returns
2317
+
2318
+
2319
+ - True if the object has the given property; otherwise, false.
2151
2320
 
2152
- ##### Returns
2153
2321
 
2154
2322
 
2155
- - a UI Filter Data.
2156
2323
 
2324
+ ### dist/general/object/isObject.js
2157
2325
 
2158
2326
 
2159
- #### buildScopes(fbFilters)
2327
+ #### isObject(obj)
2160
2328
 
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
2329
+ Checks if the given argument is an object type
2163
2330
 
2164
2331
 
2165
2332
 
@@ -2168,7 +2335,7 @@ Also, adds and organizes filters by datasets
2168
2335
 
2169
2336
  | Name | Type | Description | |
2170
2337
  | ---- | ---- | ----------- | -------- |
2171
- | fbFilters | | Array of flat filters from UI | &nbsp; |
2338
+ | obj | | the variable to check | &nbsp; |
2172
2339
 
2173
2340
 
2174
2341
 
@@ -2176,13 +2343,18 @@ Also, adds and organizes filters by datasets
2176
2343
  ##### Returns
2177
2344
 
2178
2345
 
2179
- - an array of scopes structure.
2346
+ - True: It is an object; False: It is not.
2180
2347
 
2181
2348
 
2182
2349
 
2183
- #### buildScope(uFilter)
2184
2350
 
2185
- Gets an scope structure for the UI filter data
2351
+ ### dist/general/object/mapValues.js
2352
+
2353
+
2354
+ #### mapValues(baseObject, iteratee)
2355
+
2356
+ Invoke iteratee (function) for each object key-value pair
2357
+ and return a mapped object
2186
2358
 
2187
2359
 
2188
2360
 
@@ -2191,7 +2363,8 @@ Gets an scope structure for the UI filter data
2191
2363
 
2192
2364
  | Name | Type | Description | |
2193
2365
  | ---- | ---- | ----------- | -------- |
2194
- | uFilter | | UI structure filter | &nbsp; |
2366
+ | baseObject | `Object` | Base object. | &nbsp; |
2367
+ | iteratee | `Function` | The executed per iteration. | &nbsp; |
2195
2368
 
2196
2369
 
2197
2370
 
@@ -2199,13 +2372,18 @@ Gets an scope structure for the UI filter data
2199
2372
  ##### Returns
2200
2373
 
2201
2374
 
2202
- - an scope structure
2375
+ - `Object` New mapped object.
2203
2376
 
2204
2377
 
2205
2378
 
2206
- #### buildDataset(uFilter)
2207
2379
 
2208
- Gets an dataset structure for the UI filter data
2380
+ ### dist/general/object/mergeDeep.js
2381
+
2382
+
2383
+ #### mergeDeep(obj1, obj2, settings)
2384
+
2385
+ Merges two objects into a new one.
2386
+ The second given argument to the first given argument.
2209
2387
 
2210
2388
 
2211
2389
 
@@ -2214,7 +2392,9 @@ Gets an dataset structure for the UI filter data
2214
2392
 
2215
2393
  | Name | Type | Description | |
2216
2394
  | ---- | ---- | ----------- | -------- |
2217
- | uFilter | | a UI structure filter | &nbsp; |
2395
+ | obj1 | | The target object | &nbsp; |
2396
+ | obj2 | | The object to be merged | &nbsp; |
2397
+ | settings | | Object settings for this function | &nbsp; |
2218
2398
 
2219
2399
 
2220
2400
 
@@ -2222,13 +2402,13 @@ Gets an dataset structure for the UI filter data
2222
2402
  ##### Returns
2223
2403
 
2224
2404
 
2225
- - an dataset structure
2405
+ - a new merged object
2226
2406
 
2227
2407
 
2228
2408
 
2229
- #### buildFilter(uFilter)
2409
+ #### isValid(obj1, obj2)
2230
2410
 
2231
- Gets an filter structure for the UI filter data
2411
+ Validates if the two arguments are objects
2232
2412
 
2233
2413
 
2234
2414
 
@@ -2237,7 +2417,8 @@ Gets an filter structure for the UI filter data
2237
2417
 
2238
2418
  | Name | Type | Description | |
2239
2419
  | ---- | ---- | ----------- | -------- |
2240
- | uFilter | | a UI structure filter | &nbsp; |
2420
+ | obj1 | | The target object | &nbsp; |
2421
+ | obj2 | | The object to be merged | &nbsp; |
2241
2422
 
2242
2423
 
2243
2424
 
@@ -2245,17 +2426,13 @@ Gets an filter structure for the UI filter data
2245
2426
  ##### Returns
2246
2427
 
2247
2428
 
2248
- - an filter structure
2249
-
2250
-
2251
-
2429
+ - true: they are valid; false: they are not
2252
2430
 
2253
- ### dist/filters/adapters/logicToFD.js
2254
2431
 
2255
2432
 
2256
- #### logicToFD(filterData, version)
2433
+ #### getParamsToMergeDeep(settings)
2257
2434
 
2258
- Generates a filter data structure from the old logic structure (v2.0).
2435
+ Validates and gets the settings with all set parameters.
2259
2436
 
2260
2437
 
2261
2438
 
@@ -2264,8 +2441,7 @@ Generates a filter data structure from the old logic structure (v2.0).
2264
2441
 
2265
2442
  | Name | Type | Description | |
2266
2443
  | ---- | ---- | ----------- | -------- |
2267
- | filterData | | The old filter data structure with logic (v2.0) | &nbsp; |
2268
- | version | | Tag for the version of the filter data structure | &nbsp; |
2444
+ | settings | | the settings object | &nbsp; |
2269
2445
 
2270
2446
 
2271
2447
 
@@ -2273,17 +2449,17 @@ Generates a filter data structure from the old logic structure (v2.0).
2273
2449
  ##### Returns
2274
2450
 
2275
2451
 
2276
- - a Filter Data.
2452
+ - a new settings object with all set parameters.
2277
2453
 
2278
2454
 
2279
2455
 
2280
2456
 
2281
- ### dist/filters/adapters/logicToFlatUI.js
2457
+ ### dist/general/object/objectCopy.js
2282
2458
 
2283
2459
 
2284
- #### logicToFlatUI(logics)
2460
+ #### objectCopy(entity, cache)
2285
2461
 
2286
- Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
2462
+ Created a new reference of the given argument
2287
2463
 
2288
2464
 
2289
2465
 
@@ -2292,7 +2468,8 @@ Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
2292
2468
 
2293
2469
  | Name | Type | Description | |
2294
2470
  | ---- | ---- | ----------- | -------- |
2295
- | logics | | The old logic structure (v2.0) | &nbsp; |
2471
+ | entity | | The variable to be copied | &nbsp; |
2472
+ | cache | | | &nbsp; |
2296
2473
 
2297
2474
 
2298
2475
 
@@ -2300,38 +2477,17 @@ Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
2300
2477
  ##### Returns
2301
2478
 
2302
2479
 
2303
- - The Flattened UI Filters array
2304
-
2305
-
2306
-
2307
- #### getFilter(filters, filter, getIndex)
2308
-
2309
- Get the filter or the index of the given array, validating an old filter structure.
2310
-
2311
-
2312
-
2313
-
2314
- ##### Parameters
2315
-
2316
- | Name | Type | Description | |
2317
- | ---- | ---- | ----------- | -------- |
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; |
2321
-
2322
-
2323
-
2480
+ - A new reference of the given argument
2324
2481
 
2325
- ##### Returns
2326
2482
 
2327
2483
 
2328
- - the index or the UI filter object
2329
2484
 
2485
+ ### dist/general/object/omit.js
2330
2486
 
2331
2487
 
2332
- #### refineRankingValues(values, uiValues)
2488
+ #### omit(obj, props)
2333
2489
 
2334
- Refines the values of the Ranking column type.
2490
+ return a new Object excluding attributes in _props_ list
2335
2491
 
2336
2492
 
2337
2493
 
@@ -2340,8 +2496,8 @@ Refines the values of the Ranking column type.
2340
2496
 
2341
2497
  | Name | Type | Description | |
2342
2498
  | ---- | ---- | ----------- | -------- |
2343
- | values | | the Array of Ranking values | &nbsp; |
2344
- | uiValues | | Object with additional info about the values of the filter. | &nbsp; |
2499
+ | obj | `Object` | base object | &nbsp; |
2500
+ | props | `Array.<String>` | list of attribute to exclude | &nbsp; |
2345
2501
 
2346
2502
 
2347
2503
 
@@ -2349,17 +2505,17 @@ Refines the values of the Ranking column type.
2349
2505
  ##### Returns
2350
2506
 
2351
2507
 
2352
- - the array of Ranking values
2508
+ - `Object` clean object
2353
2509
 
2354
2510
 
2355
2511
 
2356
2512
 
2357
- ### dist/filters/adapters/logicToUI.js
2513
+ ### dist/general/object/pick.js
2358
2514
 
2359
2515
 
2360
- #### logicToUI(uFilters, datasetsInfo)
2516
+ #### pick(baseObject, keys)
2361
2517
 
2362
- Generates a UI filter structure from the old logic structure (v2.0).
2518
+ return a new object just with attributes in _keys_ list
2363
2519
 
2364
2520
 
2365
2521
 
@@ -2368,8 +2524,8 @@ Generates a UI filter structure from the old logic structure (v2.0).
2368
2524
 
2369
2525
  | Name | Type | Description | |
2370
2526
  | ---- | ---- | ----------- | -------- |
2371
- | uFilters | | Array of filters from old logic structure | &nbsp; |
2372
- | datasetsInfo | | Collection of datasets information | &nbsp; |
2527
+ | baseObject | `Object` | base object | &nbsp; |
2528
+ | keys | `Array.<String>` | list of attributes to preserve | &nbsp; |
2373
2529
 
2374
2530
 
2375
2531
 
@@ -2377,17 +2533,17 @@ Generates a UI filter structure from the old logic structure (v2.0).
2377
2533
  ##### Returns
2378
2534
 
2379
2535
 
2380
- - a UI Filter Data.
2536
+ - `Object` new object just with desired attributes
2381
2537
 
2382
2538
 
2383
2539
 
2384
2540
 
2385
- ### dist/filters/adapters/transformFilters.js
2541
+ ### dist/general/object/serialize.js
2386
2542
 
2387
2543
 
2388
- #### transformFilters(oldFiltersObj, section)
2544
+ #### serialize(obj)
2389
2545
 
2390
- Transform the old filters structure into the new one
2546
+ serialize object to url param
2391
2547
 
2392
2548
 
2393
2549
 
@@ -2396,79 +2552,34 @@ Transform the old filters structure into the new one
2396
2552
 
2397
2553
  | Name | Type | Description | |
2398
2554
  | ---- | ---- | ----------- | -------- |
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; |
2401
-
2402
-
2403
-
2555
+ | obj | | - Object to be serialized | &nbsp; |
2404
2556
 
2405
- ##### Examples
2406
2557
 
2407
- ```javascript
2408
2558
 
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
- };
2451
2559
 
2452
- const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
2453
- ```
2560
+ ##### Returns
2454
2561
 
2455
2562
 
2456
- ##### Returns
2563
+ - `Void`
2457
2564
 
2458
2565
 
2459
- - `Object` an object with the new filters structure
2460
2566
 
2461
2567
 
2568
+ ### dist/general/string/capitalize.js
2462
2569
 
2463
2570
 
2464
- ### dist/filters/classes/FilterInputErrorHandler.js
2571
+ #### capitalize(text)
2465
2572
 
2573
+ Upper case the first letter of a given text
2466
2574
 
2467
- #### new FilterInputErrorHandler()
2468
2575
 
2469
2576
 
2470
2577
 
2578
+ ##### Parameters
2471
2579
 
2580
+ | Name | Type | Description | |
2581
+ | ---- | ---- | ----------- | -------- |
2582
+ | text | `String` | | &nbsp; |
2472
2583
 
2473
2584
 
2474
2585
 
@@ -2476,17 +2587,17 @@ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
2476
2587
  ##### Returns
2477
2588
 
2478
2589
 
2479
- - `Void`
2590
+ - `String` a capitalized text
2480
2591
 
2481
2592
 
2482
2593
 
2483
2594
 
2484
- ### dist/filters/helpers/applyHierarchyForAggFilters.js
2595
+ ### dist/qrvey/helpers/getColumnsLabel.js
2485
2596
 
2486
2597
 
2487
- #### applyHierarchyForAggFilters(chartSettings, scopes, currentScope)
2598
+ #### getColumnLabels(column)
2488
2599
 
2489
- [TODO: Make a proper description for this function]
2600
+ Get an string of the properties of the given column.
2490
2601
 
2491
2602
 
2492
2603
 
@@ -2495,9 +2606,7 @@ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
2495
2606
 
2496
2607
  | Name | Type | Description | |
2497
2608
  | ---- | ---- | ----------- | -------- |
2498
- | chartSettings | | Chart Settings for the Filter Builder | &nbsp; |
2499
- | scopes | | | &nbsp; |
2500
- | currentScope | | | &nbsp; |
2609
+ | column | | The column | &nbsp; |
2501
2610
 
2502
2611
 
2503
2612
 
@@ -2505,17 +2614,18 @@ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
2505
2614
  ##### Returns
2506
2615
 
2507
2616
 
2508
- -
2617
+ - an string with the property, aggregate or calculation label.
2509
2618
 
2510
2619
 
2511
2620
 
2512
2621
 
2513
- ### dist/filters/helpers/getAvailableScopes.js
2622
+ ### dist/qrvey/helpers/getValueWithSuffixes.js
2514
2623
 
2515
2624
 
2516
- #### getAvailableScopes(config)
2625
+ #### getValueWithSuffixes(value, suffixes)
2517
2626
 
2518
- Gets Scopes/Scope IDs by given IDs
2627
+ Get a string value with suffixes if available.
2628
+ Add suffix into the value string. Prioritized for numeric values.
2519
2629
 
2520
2630
 
2521
2631
 
@@ -2524,7 +2634,8 @@ Gets Scopes/Scope IDs by given IDs
2524
2634
 
2525
2635
  | Name | Type | Description | |
2526
2636
  | ---- | ---- | ----------- | -------- |
2527
- | config | | given Differnts IDs in order set a available scope | &nbsp; |
2637
+ | value | | a number or string | &nbsp; |
2638
+ | suffixes | | An object with singular or plural suffix string. | &nbsp; |
2528
2639
 
2529
2640
 
2530
2641
 
@@ -2532,17 +2643,17 @@ Gets Scopes/Scope IDs by given IDs
2532
2643
  ##### Returns
2533
2644
 
2534
2645
 
2535
- - a Scopes/Scope IDs array
2646
+ - a string value with suffix
2536
2647
 
2537
2648
 
2538
2649
 
2539
2650
 
2540
- ### dist/filters/helpers/getAvailableScopesIDsByConfig.js
2651
+ ### dist/qrvey/helpers/transformValue.js
2541
2652
 
2542
2653
 
2543
- #### getAvailableScopesIDsByConfig(config)
2654
+ #### transformValue(value, settings)
2544
2655
 
2545
- Gets the Scopes IDS for the Available Scope function by any config
2656
+ Transforms a value depending of localization/globalization and extras settings.
2546
2657
 
2547
2658
 
2548
2659
 
@@ -2551,7 +2662,8 @@ Gets the Scopes IDS for the Available Scope function by any config
2551
2662
 
2552
2663
  | Name | Type | Description | |
2553
2664
  | ---- | ---- | ----------- | -------- |
2554
- | config | | any config | &nbsp; |
2665
+ | value | | A value to transform | &nbsp; |
2666
+ | settings | | The settings of the transformValue function | &nbsp; |
2555
2667
 
2556
2668
 
2557
2669
 
@@ -2559,17 +2671,13 @@ Gets the Scopes IDS for the Available Scope function by any config
2559
2671
  ##### Returns
2560
2672
 
2561
2673
 
2562
- - a Available Scope IDS config
2563
-
2564
-
2565
-
2674
+ - A transformed value
2566
2675
 
2567
- ### dist/filters/helpers/getScopesByHierarchy.js
2568
2676
 
2569
2677
 
2570
- #### getScopesByHierarchy(scopes, currentScope)
2678
+ #### getOutputFormat(settings)
2571
2679
 
2572
- [TODO: Make a description for this]
2680
+ Gets the outputformat settings
2573
2681
 
2574
2682
 
2575
2683
 
@@ -2578,8 +2686,7 @@ Gets the Scopes IDS for the Available Scope function by any config
2578
2686
 
2579
2687
  | Name | Type | Description | |
2580
2688
  | ---- | ---- | ----------- | -------- |
2581
- | scopes | | the collection of Scopes/Scope IDs | &nbsp; |
2582
- | currentScope | | Current scope type | &nbsp; |
2689
+ | settings | | The settings of the transformValue function | &nbsp; |
2583
2690
 
2584
2691
 
2585
2692
 
@@ -2587,17 +2694,13 @@ Gets the Scopes IDS for the Available Scope function by any config
2587
2694
  ##### Returns
2588
2695
 
2589
2696
 
2590
- - A new array of Scopes/Scope IDs
2591
-
2592
-
2697
+ - the outputformat settings
2593
2698
 
2594
2699
 
2595
- ### dist/qrvey/helpers/getColumnsLabel.js
2596
-
2597
2700
 
2598
- #### getColumnLabels(column)
2701
+ #### getFormatConfig(settings)
2599
2702
 
2600
- Get an string of the properties of the given column.
2703
+ Gets the format config
2601
2704
 
2602
2705
 
2603
2706
 
@@ -2606,7 +2709,7 @@ Get an string of the properties of the given column.
2606
2709
 
2607
2710
  | Name | Type | Description | |
2608
2711
  | ---- | ---- | ----------- | -------- |
2609
- | column | | The column | &nbsp; |
2712
+ | settings | | The settings of the transformValue function | &nbsp; |
2610
2713
 
2611
2714
 
2612
2715
 
@@ -2614,17 +2717,17 @@ Get an string of the properties of the given column.
2614
2717
  ##### Returns
2615
2718
 
2616
2719
 
2617
- - an string with the property, aggregate or calculation label.
2720
+ - the format config
2618
2721
 
2619
2722
 
2620
2723
 
2621
2724
 
2622
- ### dist/services/api/getAllQrveys.api.js
2725
+ ### dist/services/api/getAllDatasets.api.js
2623
2726
 
2624
2727
 
2625
- #### getAllQrveys(config, params)
2728
+ #### getAllDatasets(config, pickDatasets)
2626
2729
 
2627
- POST Request for getting Qrveys such as Web Forms and Datasets. Use params for getting precise data
2730
+ Get a dataset list from a collection of Qrvey IDs
2628
2731
 
2629
2732
 
2630
2733
 
@@ -2633,8 +2736,8 @@ POST Request for getting Qrveys such as Web Forms and Datasets. Use params for g
2633
2736
 
2634
2737
  | Name | Type | Description | |
2635
2738
  | ---- | ---- | ----------- | -------- |
2636
- | config | | Configuration | &nbsp; |
2637
- | params | | Object for getting precise data | &nbsp; |
2739
+ | config | | the widget config. Includes the appid and others configuration properties | &nbsp; |
2740
+ | pickDatasets | | Collection of Qrvey IDs for filtering the request | &nbsp; |
2638
2741
 
2639
2742
 
2640
2743
 
@@ -2642,17 +2745,17 @@ POST Request for getting Qrveys such as Web Forms and Datasets. Use params for g
2642
2745
  ##### Returns
2643
2746
 
2644
2747
 
2645
- - `Void`
2748
+ - a promise
2646
2749
 
2647
2750
 
2648
2751
 
2649
2752
 
2650
- ### dist/services/api/getAllDatasets.api.js
2753
+ ### dist/services/api/getAllQrveys.api.js
2651
2754
 
2652
2755
 
2653
- #### getAllDatasets(config, pickDatasets)
2756
+ #### getAllQrveys(config, params)
2654
2757
 
2655
- Get a dataset list from a collection of Qrvey IDs
2758
+ POST Request for getting Qrveys such as Web Forms and Datasets. Use params for getting precise data
2656
2759
 
2657
2760
 
2658
2761
 
@@ -2661,8 +2764,8 @@ Get a dataset list from a collection of Qrvey IDs
2661
2764
 
2662
2765
  | Name | Type | Description | |
2663
2766
  | ---- | ---- | ----------- | -------- |
2664
- | config | | the widget config. Includes the appid and others configuration properties | &nbsp; |
2665
- | pickDatasets | | Collection of Qrvey IDs for filtering the request | &nbsp; |
2767
+ | config | | Configuration | &nbsp; |
2768
+ | params | | Object for getting precise data | &nbsp; |
2666
2769
 
2667
2770
 
2668
2771
 
@@ -2670,7 +2773,7 @@ Get a dataset list from a collection of Qrvey IDs
2670
2773
  ##### Returns
2671
2774
 
2672
2775
 
2673
- - a promise
2776
+ - `Void`
2674
2777
 
2675
2778
 
2676
2779