@qrvey/utils 1.2.9-13 → 1.2.9-17

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 (209) hide show
  1. package/README.md +926 -766
  2. package/dist/charts/constants/AGGREGATE_LABEL.d.ts +1 -1
  3. package/dist/charts/constants/AGGREGATE_LABEL.js +1 -1
  4. package/dist/cjs/charts/constants/AGGREGATE_LABEL.d.ts +1 -1
  5. package/dist/cjs/charts/constants/AGGREGATE_LABEL.js +1 -1
  6. package/dist/cjs/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -0
  7. package/dist/cjs/filters/helpers/ui/getQrveyIdsByUIFilters.d.ts +7 -0
  8. package/dist/cjs/filters/helpers/ui/getQrveyIdsByUIFilters.js +24 -0
  9. package/dist/cjs/filters/helpers/ui/getUpdatedUIFilters.d.ts +9 -0
  10. package/dist/cjs/filters/helpers/ui/getUpdatedUIFilters.js +36 -0
  11. package/dist/cjs/filters/helpers/ui/index.d.ts +3 -0
  12. package/dist/cjs/filters/helpers/ui/index.js +3 -0
  13. package/dist/cjs/filters/helpers/ui/transformFilterValues.d.ts +4 -0
  14. package/dist/cjs/filters/helpers/ui/transformFilterValues.js +22 -0
  15. package/dist/cjs/filters/interfaces/builder/IFilterBuilderGeneralConfig.d.ts +1 -0
  16. package/dist/cjs/filters/interfaces/panel/IFPSettingsGeneral.d.ts +2 -1
  17. package/dist/cjs/filters/interfaces/panel/IFilterPanelConfig.d.ts +1 -0
  18. package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
  19. package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.js +2 -0
  20. package/dist/cjs/filters/interfaces/ui/index.d.ts +3 -2
  21. package/dist/cjs/filters/interfaces/ui/index.js +3 -2
  22. package/dist/cjs/format/definition.d.ts +17 -0
  23. package/dist/cjs/format/definition.js +31 -1
  24. package/dist/cjs/format/format.d.ts +2 -1
  25. package/dist/cjs/format/format.js +8 -5
  26. package/dist/cjs/format/index.d.ts +1 -0
  27. package/dist/cjs/format/index.js +1 -0
  28. package/dist/cjs/format/localization.d.ts +3 -0
  29. package/dist/cjs/format/localization.js +56 -0
  30. package/dist/cjs/globalization/interfaces/IResourceI18n.d.ts +2 -0
  31. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.d.ts +5 -3
  32. package/dist/cjs/globalization/interfaces/index.d.ts +4 -1
  33. package/dist/cjs/globalization/interfaces/index.js +4 -1
  34. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemes.d.ts +13 -0
  35. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemes.js +2 -0
  36. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.d.ts +6 -0
  37. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.js +2 -0
  38. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMenu.d.ts +6 -0
  39. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMenu.js +2 -0
  40. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMessages.d.ts +9 -0
  41. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesMessages.js +2 -0
  42. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +27 -0
  43. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.js +2 -0
  44. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTooltips.d.ts +3 -0
  45. package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTooltips.js +2 -0
  46. package/dist/cjs/globalization/interfaces/style_themes/index.d.ts +6 -0
  47. package/dist/cjs/globalization/interfaces/style_themes/index.js +18 -0
  48. package/dist/cjs/globalization/labels/I18N_DEFAULT.js +2 -0
  49. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +1 -1
  50. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +7 -5
  51. package/dist/cjs/globalization/labels/index.d.ts +5 -3
  52. package/dist/cjs/globalization/labels/index.js +5 -3
  53. package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.d.ts +2 -0
  54. package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.js +57 -0
  55. package/dist/cjs/globalization/labels/style_themes/index.d.ts +1 -0
  56. package/dist/cjs/globalization/labels/style_themes/index.js +13 -0
  57. package/dist/cjs/globalization/labels/table_charts/I18N_TABLE_CHARTS.js +1 -1
  58. package/dist/cjs/interfaces/format/IFormatConfig.Interface.d.ts +5 -0
  59. package/dist/cjs/interfaces/format/IFormatConfig.Interface.js +2 -0
  60. package/dist/cjs/interfaces/format/IFormatCurrency.Interface.d.ts +4 -0
  61. package/dist/cjs/interfaces/format/IFormatCurrency.Interface.js +2 -0
  62. package/dist/cjs/interfaces/format/IFormatOutputFormat.Interface.d.ts +8 -0
  63. package/dist/cjs/interfaces/format/IFormatOutputFormat.Interface.js +2 -0
  64. package/dist/cjs/interfaces/format/index.d.ts +3 -0
  65. package/dist/cjs/interfaces/format/index.js +15 -0
  66. package/dist/cjs/interfaces/general/IGeneralWidgetConfig.d.ts +2 -0
  67. package/dist/cjs/interfaces/index.d.ts +1 -0
  68. package/dist/cjs/interfaces/index.js +1 -0
  69. package/dist/cjs/qrvey/helpers/getValueWithSuffixes.d.ts +9 -0
  70. package/dist/cjs/qrvey/helpers/getValueWithSuffixes.js +23 -0
  71. package/dist/cjs/qrvey/helpers/index.d.ts +2 -0
  72. package/dist/cjs/qrvey/helpers/index.js +2 -0
  73. package/dist/cjs/qrvey/helpers/transformValue.d.ts +8 -0
  74. package/dist/cjs/qrvey/helpers/transformValue.js +46 -0
  75. package/dist/cjs/qrvey/interfaces/IGetValueWithSuffixesSettings.d.ts +11 -0
  76. package/dist/cjs/qrvey/interfaces/IGetValueWithSuffixesSettings.js +2 -0
  77. package/dist/cjs/qrvey/interfaces/ITransformValueSettings.d.ts +10 -0
  78. package/dist/cjs/qrvey/interfaces/ITransformValueSettings.js +2 -0
  79. package/dist/cjs/qrvey/interfaces/index.d.ts +2 -0
  80. package/dist/cjs/qrvey/interfaces/index.js +2 -0
  81. package/dist/cjs/services/api/getAllDatasets.api.d.ts +2 -1
  82. package/dist/cjs/services/api/getAllDatasets.api.js +2 -1
  83. package/dist/cjs/services/api/getDatasetColumns.api.js +3 -0
  84. package/dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -0
  85. package/dist/filters/helpers/ui/getQrveyIdsByUIFilters.d.ts +7 -0
  86. package/dist/filters/helpers/ui/getQrveyIdsByUIFilters.js +20 -0
  87. package/dist/filters/helpers/ui/getUpdatedUIFilters.d.ts +9 -0
  88. package/dist/filters/helpers/ui/getUpdatedUIFilters.js +32 -0
  89. package/dist/filters/helpers/ui/index.d.ts +3 -0
  90. package/dist/filters/helpers/ui/index.js +3 -0
  91. package/dist/filters/helpers/ui/transformFilterValues.d.ts +4 -0
  92. package/dist/filters/helpers/ui/transformFilterValues.js +18 -0
  93. package/dist/filters/interfaces/builder/IFilterBuilderGeneralConfig.d.ts +1 -0
  94. package/dist/filters/interfaces/panel/IFPSettingsGeneral.d.ts +2 -1
  95. package/dist/filters/interfaces/panel/IFilterPanelConfig.d.ts +1 -0
  96. package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
  97. package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.js +1 -0
  98. package/dist/filters/interfaces/ui/index.d.ts +3 -2
  99. package/dist/filters/interfaces/ui/index.js +3 -2
  100. package/dist/format/definition.d.ts +17 -0
  101. package/dist/format/definition.js +30 -0
  102. package/dist/format/format.d.ts +2 -1
  103. package/dist/format/format.js +6 -3
  104. package/dist/format/index.d.ts +1 -0
  105. package/dist/format/index.js +1 -0
  106. package/dist/format/localization.d.ts +3 -0
  107. package/dist/format/localization.js +51 -0
  108. package/dist/globalization/interfaces/IResourceI18n.d.ts +2 -0
  109. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.d.ts +5 -3
  110. package/dist/globalization/interfaces/index.d.ts +4 -1
  111. package/dist/globalization/interfaces/index.js +4 -1
  112. package/dist/globalization/interfaces/style_themes/II18nStyleThemes.d.ts +13 -0
  113. package/dist/globalization/interfaces/style_themes/II18nStyleThemes.js +1 -0
  114. package/dist/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.d.ts +6 -0
  115. package/dist/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.js +1 -0
  116. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMenu.d.ts +6 -0
  117. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMenu.js +1 -0
  118. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMessages.d.ts +9 -0
  119. package/dist/globalization/interfaces/style_themes/II18nStyleThemesMessages.js +1 -0
  120. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +27 -0
  121. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.js +1 -0
  122. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTooltips.d.ts +3 -0
  123. package/dist/globalization/interfaces/style_themes/II18nStyleThemesTooltips.js +1 -0
  124. package/dist/globalization/interfaces/style_themes/index.d.ts +6 -0
  125. package/dist/globalization/interfaces/style_themes/index.js +6 -0
  126. package/dist/globalization/labels/I18N_DEFAULT.js +2 -0
  127. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +1 -1
  128. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +7 -5
  129. package/dist/globalization/labels/index.d.ts +5 -3
  130. package/dist/globalization/labels/index.js +5 -3
  131. package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.d.ts +2 -0
  132. package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.js +54 -0
  133. package/dist/globalization/labels/style_themes/index.d.ts +1 -0
  134. package/dist/globalization/labels/style_themes/index.js +1 -0
  135. package/dist/globalization/labels/table_charts/I18N_TABLE_CHARTS.js +1 -1
  136. package/dist/interfaces/format/IFormatConfig.Interface.d.ts +5 -0
  137. package/dist/interfaces/format/IFormatConfig.Interface.js +1 -0
  138. package/dist/interfaces/format/IFormatCurrency.Interface.d.ts +4 -0
  139. package/dist/interfaces/format/IFormatCurrency.Interface.js +1 -0
  140. package/dist/interfaces/format/IFormatOutputFormat.Interface.d.ts +8 -0
  141. package/dist/interfaces/format/IFormatOutputFormat.Interface.js +1 -0
  142. package/dist/interfaces/format/index.d.ts +3 -0
  143. package/dist/interfaces/format/index.js +3 -0
  144. package/dist/interfaces/general/IGeneralWidgetConfig.d.ts +2 -0
  145. package/dist/interfaces/index.d.ts +1 -0
  146. package/dist/interfaces/index.js +1 -0
  147. package/dist/qrvey/helpers/getValueWithSuffixes.d.ts +9 -0
  148. package/dist/qrvey/helpers/getValueWithSuffixes.js +19 -0
  149. package/dist/qrvey/helpers/index.d.ts +2 -0
  150. package/dist/qrvey/helpers/index.js +2 -0
  151. package/dist/qrvey/helpers/transformValue.d.ts +8 -0
  152. package/dist/qrvey/helpers/transformValue.js +42 -0
  153. package/dist/qrvey/interfaces/IGetValueWithSuffixesSettings.d.ts +11 -0
  154. package/dist/qrvey/interfaces/IGetValueWithSuffixesSettings.js +1 -0
  155. package/dist/qrvey/interfaces/ITransformValueSettings.d.ts +10 -0
  156. package/dist/qrvey/interfaces/ITransformValueSettings.js +1 -0
  157. package/dist/qrvey/interfaces/index.d.ts +2 -0
  158. package/dist/qrvey/interfaces/index.js +2 -0
  159. package/dist/services/api/getAllDatasets.api.d.ts +2 -1
  160. package/dist/services/api/getAllDatasets.api.js +2 -1
  161. package/dist/services/api/getDatasetColumns.api.js +3 -0
  162. package/package.json +1 -1
  163. package/src/charts/constants/AGGREGATE_LABEL.ts +1 -1
  164. package/src/filters/helpers/builder/getFilterBuilderGeneralConfig.ts +1 -0
  165. package/src/filters/helpers/ui/getQrveyIdsByUIFilters.ts +22 -0
  166. package/src/filters/helpers/ui/getUpdatedUIFilters.ts +34 -0
  167. package/src/filters/helpers/ui/index.ts +3 -0
  168. package/src/filters/helpers/ui/transformFilterValues.ts +29 -0
  169. package/src/filters/interfaces/builder/IFilterBuilderGeneralConfig.ts +2 -1
  170. package/src/filters/interfaces/panel/IFPSettingsGeneral.ts +2 -1
  171. package/src/filters/interfaces/panel/IFilterPanelConfig.ts +1 -0
  172. package/src/filters/interfaces/ui/IFUTransformFilterValuesSettings.ts +7 -0
  173. package/src/filters/interfaces/ui/index.ts +3 -2
  174. package/src/format/definition.ts +45 -0
  175. package/src/format/format.ts +19 -15
  176. package/src/format/index.ts +1 -0
  177. package/src/format/localization.ts +52 -0
  178. package/src/globalization/interfaces/IResourceI18n.ts +2 -0
  179. package/src/globalization/interfaces/chart_builder/II18nChartBuilderFontOptions.ts +5 -3
  180. package/src/globalization/interfaces/index.ts +4 -1
  181. package/src/globalization/interfaces/style_themes/II18nStyleThemes.ts +14 -0
  182. package/src/globalization/interfaces/style_themes/II18nStyleThemesDeleteDialog.ts +6 -0
  183. package/src/globalization/interfaces/style_themes/II18nStyleThemesMenu.ts +6 -0
  184. package/src/globalization/interfaces/style_themes/II18nStyleThemesMessages.ts +9 -0
  185. package/src/globalization/interfaces/style_themes/II18nStyleThemesTheme.ts +27 -0
  186. package/src/globalization/interfaces/style_themes/II18nStyleThemesTooltips.ts +3 -0
  187. package/src/globalization/interfaces/style_themes/index.ts +6 -0
  188. package/src/globalization/labels/I18N_DEFAULT.ts +2 -0
  189. package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.ts +1 -1
  190. package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.ts +8 -6
  191. package/src/globalization/labels/index.ts +5 -3
  192. package/src/globalization/labels/style_themes/I18N_STYLE_THEMES.ts +56 -0
  193. package/src/globalization/labels/style_themes/index.ts +1 -0
  194. package/src/globalization/labels/table_charts/I18N_TABLE_CHARTS.ts +1 -1
  195. package/src/interfaces/format/IFormatConfig.Interface.ts +5 -0
  196. package/src/interfaces/format/IFormatCurrency.Interface.ts +4 -0
  197. package/src/interfaces/format/IFormatOutputFormat.Interface.ts +9 -0
  198. package/src/interfaces/format/index.ts +3 -0
  199. package/src/interfaces/general/IGeneralWidgetConfig.ts +2 -0
  200. package/src/interfaces/index.ts +1 -0
  201. package/src/qrvey/helpers/getValueWithSuffixes.ts +19 -0
  202. package/src/qrvey/helpers/index.ts +2 -0
  203. package/src/qrvey/helpers/transformValue.ts +47 -0
  204. package/src/qrvey/interfaces/IGetValueWithSuffixesSettings.ts +12 -0
  205. package/src/qrvey/interfaces/ITransformValueSettings.ts +12 -0
  206. package/src/qrvey/interfaces/index.ts +2 -0
  207. package/src/services/api/getAllDatasets.api.ts +3 -2
  208. package/src/services/api/getDatasetColumns.api.ts +3 -0
  209. 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-13*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.2.9-17*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -80,12 +80,12 @@ Get a text and evaluate if it matchs with a token box label.
80
80
 
81
81
 
82
82
 
83
- ### dist/dates/adapters/mdyDateToDate.js
83
+ ### dist/general/array/delete.js
84
84
 
85
85
 
86
- #### mdyDateToDate(monthYearDate, time)
86
+ #### ArrayDelete(array, index)
87
87
 
88
- Transforms String Date from a [mm/dd/yyyy] format to Date object.
88
+ Inmutable Array Item deletion
89
89
 
90
90
 
91
91
 
@@ -94,8 +94,8 @@ Transforms String Date from a [mm/dd/yyyy] format to Date object.
94
94
 
95
95
  | Name | Type | Description | |
96
96
  | ---- | ---- | ----------- | -------- |
97
- | monthYearDate | | String of [mm/dd/yyyy] date |   |
98
- | time | | Flag to parse the object date to milliseconds. |   |
97
+ | array | `Array` | a collection of items to delete |   |
98
+ | index | `Number` | the position of the item to delete |   |
99
99
 
100
100
 
101
101
 
@@ -103,17 +103,20 @@ Transforms String Date from a [mm/dd/yyyy] format to Date object.
103
103
  ##### Returns
104
104
 
105
105
 
106
- - The date object or the date in milliseconds
106
+ - a new Array or the given parameter when is empty or not an array
107
107
 
108
108
 
109
109
 
110
110
 
111
- ### dist/dates/adapters/monthYearToDate.js
111
+ ### dist/general/array/filterNestedTree.js
112
112
 
113
113
 
114
- #### monthYearToDate(monthYearDate, time)
114
+ #### filterNestedTree(arr, childArrKey, condition)
115
115
 
116
- Transforms String Date from a [Month Year] format to Date object.
116
+ Filters a nested tree array by a custom condition on the last child node
117
+ - If the given arguments are not valid, the function returns the first argument.
118
+ - If the childArrKey is not matched in the object, the condition tries to resolve the filter anyway and returns an empty array.
119
+ - If the condition is not fulfilled, the function returns a filtered array, probably a empty array inside of the child array
117
120
 
118
121
 
119
122
 
@@ -122,8 +125,9 @@ Transforms String Date from a [Month Year] format to Date object.
122
125
 
123
126
  | Name | Type | Description | |
124
127
  | ---- | ---- | ----------- | -------- |
125
- | monthYearDate | | String of [Month Year] date |   |
126
- | time | | Flag to parse the object date to milliseconds. |   |
128
+ | arr | | nested tree array |   |
129
+ | childArrKey | | property representing the children array on the nested tree |   |
130
+ | condition | | function callback that determines if the filter is applied on the last child node of the nested tree |   |
127
131
 
128
132
 
129
133
 
@@ -131,17 +135,17 @@ Transforms String Date from a [Month Year] format to Date object.
131
135
  ##### Returns
132
136
 
133
137
 
134
- - The date object or the date in milliseconds
138
+ - array filtered
135
139
 
136
140
 
137
141
 
138
142
 
139
- ### dist/dates/adapters/quarterYearToDate.js
143
+ ### dist/general/array/flattenDeep.js
140
144
 
141
145
 
142
- #### quarterYearToDate(quarterYearDate, time)
146
+ #### flattenDeep(arr)
143
147
 
144
- Transforms String Date from a [Quarter Year] format to Date object.
148
+ Flat deeply an array
145
149
 
146
150
 
147
151
 
@@ -150,8 +154,7 @@ Transforms String Date from a [Quarter Year] format to Date object.
150
154
 
151
155
  | Name | Type | Description | |
152
156
  | ---- | ---- | ----------- | -------- |
153
- | quarterYearDate | | String of [Quarter Year] date |   |
154
- | time | | Flag to parse the object date to milliseconds. |   |
157
+ | arr | | Array to flat deeply |   |
155
158
 
156
159
 
157
160
 
@@ -159,17 +162,17 @@ Transforms String Date from a [Quarter Year] format to Date object.
159
162
  ##### Returns
160
163
 
161
164
 
162
- - The date object or the date in milliseconds
165
+ - flatten array
163
166
 
164
167
 
165
168
 
166
169
 
167
- ### dist/dates/adapters/weekYearToDate.js
170
+ ### dist/general/array/getFirstIndexFromArray.js
168
171
 
169
172
 
170
- #### weekYearToDate(date, time)
173
+ #### getFirstIndexFromArray(array, callback)
171
174
 
172
- Transforms String Date from a [Week Year] format to Date object.
175
+ Gets the first index from the array by a callback condition
173
176
 
174
177
 
175
178
 
@@ -178,8 +181,8 @@ Transforms String Date from a [Week Year] format to Date object.
178
181
 
179
182
  | Name | Type | Description | |
180
183
  | ---- | ---- | ----------- | -------- |
181
- | date | | String of [Week Year] date |   |
182
- | time | | Flag to parse the object date to milliseconds. |   |
184
+ | array | | |   |
185
+ | callback | | function callback |   |
183
186
 
184
187
 
185
188
 
@@ -187,17 +190,17 @@ Transforms String Date from a [Week Year] format to Date object.
187
190
  ##### Returns
188
191
 
189
192
 
190
- - The date object or the date in milliseconds
193
+ - the first index of the array. -1 when the condition is not satisfied
191
194
 
192
195
 
193
196
 
194
197
 
195
- ### dist/dates/adapters/yearToDate.js
198
+ ### dist/general/array/getLastIndexFromArray.js
196
199
 
197
200
 
198
- #### yearToDate(yearDate, time)
201
+ #### getLastIndexFromArray(array, callback)
199
202
 
200
- Transforms String Date from a [Year] format to Date object.
203
+ Gets the last index from the array by a callback condition
201
204
 
202
205
 
203
206
 
@@ -206,8 +209,8 @@ Transforms String Date from a [Year] format to Date object.
206
209
 
207
210
  | Name | Type | Description | |
208
211
  | ---- | ---- | ----------- | -------- |
209
- | yearDate | | String of [Year] date |   |
210
- | time | | Flag to parse the object date to milliseconds. |   |
212
+ | array | | |   |
213
+ | callback | | function callback |   |
211
214
 
212
215
 
213
216
 
@@ -215,17 +218,17 @@ Transforms String Date from a [Year] format to Date object.
215
218
  ##### Returns
216
219
 
217
220
 
218
- - The date object or the date in milliseconds
221
+ - the last index of the array. -1 when the condition is not satisfied
219
222
 
220
223
 
221
224
 
222
225
 
223
- ### dist/dates/helpers/getDateByDateFormat.js
226
+ ### dist/general/function/debounce.js
224
227
 
225
228
 
226
- #### getDateByDateFormat(date, format, time)
229
+ #### debounce(fn, time)
227
230
 
228
- Gets a Date Object instance by a Date format
231
+ Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last time the debounced function was invoked.
229
232
 
230
233
 
231
234
 
@@ -234,9 +237,8 @@ Gets a Date Object instance by a Date format
234
237
 
235
238
  | Name | Type | Description | |
236
239
  | ---- | ---- | ----------- | -------- |
237
- | date | | String with a formatted date |   |
238
- | format | | The date format |   |
239
- | time | | flag to convert the formatted date to miliseconds |   |
240
+ | fn | `Function` | original Function |   |
241
+ | time | `Number` | default 500ms |   |
240
242
 
241
243
 
242
244
 
@@ -244,17 +246,17 @@ Gets a Date Object instance by a Date format
244
246
  ##### Returns
245
247
 
246
248
 
247
- - a Date object, milisecond time or the same value if date format does not match.
249
+ - `Function` debounced functions
248
250
 
249
251
 
250
252
 
251
253
 
252
- ### dist/dates/helpers/getDateFormatByProperty.js
254
+ ### dist/general/function/throttled.js
253
255
 
254
256
 
255
- #### getDateFormatByProperty(property)
257
+ #### throttled(fn, time)
256
258
 
257
- Gets the date format by the given property
259
+ Make sure to only invokes _fn_ at most once per every _time_ milliseconds
258
260
 
259
261
 
260
262
 
@@ -263,7 +265,8 @@ Gets the date format by the given property
263
265
 
264
266
  | Name | Type | Description | |
265
267
  | ---- | ---- | ----------- | -------- |
266
- | property | | The Column Property |   |
268
+ | fn | `Function` | original Function |   |
269
+ | time | `Number` | default 500ms |   |
267
270
 
268
271
 
269
272
 
@@ -271,17 +274,18 @@ Gets the date format by the given property
271
274
  ##### Returns
272
275
 
273
276
 
274
- - The date format
277
+ - `Function` throttled function
275
278
 
276
279
 
277
280
 
278
281
 
279
- ### dist/dates/helpers/getDateFormatRegularExpressionInArray.js
282
+ ### dist/general/mix/compareDeep.js
280
283
 
281
284
 
282
- #### getDateFormatRegularExpressionInArray(dateFormat)
285
+ #### compareDeep(object1, object2)
283
286
 
284
- Gets an array of regular expressions by the given date format
287
+ Compares two objects to know if they are equals. Go across nested objects.
288
+ Includes arrays in the comparison.
285
289
 
286
290
 
287
291
 
@@ -290,7 +294,8 @@ Gets an array of regular expressions by the given date format
290
294
 
291
295
  | Name | Type | Description | |
292
296
  | ---- | ---- | ----------- | -------- |
293
- | dateFormat | | the date format |   |
297
+ | object1 | | First Object to compare |   |
298
+ | object2 | | Second Object to compare |   |
294
299
 
295
300
 
296
301
 
@@ -298,17 +303,17 @@ Gets an array of regular expressions by the given date format
298
303
  ##### Returns
299
304
 
300
305
 
301
- - an array of regular expressions
306
+ - True: objects are equal. False: Objects are not equal. Undefined: invalid
302
307
 
303
308
 
304
309
 
305
310
 
306
- ### dist/dates/helpers/getSeparatorByDateFormat.js
311
+ ### dist/general/mix/getTag.js
307
312
 
308
313
 
309
- #### getSeparatorByDateFormat(format)
314
+ #### getTag(value)
310
315
 
311
- Gets the separator of the date format
316
+ Gets the `toStringTag` of `value`.
312
317
 
313
318
 
314
319
 
@@ -317,7 +322,7 @@ Gets the separator of the date format
317
322
 
318
323
  | Name | Type | Description | |
319
324
  | ---- | ---- | ----------- | -------- |
320
- | format | | the date format |   |
325
+ | value | | The value to query. |   |
321
326
 
322
327
 
323
328
 
@@ -325,18 +330,17 @@ Gets the separator of the date format
325
330
  ##### Returns
326
331
 
327
332
 
328
- - a separator string
333
+ - `string` Returns the `toStringTag`.
329
334
 
330
335
 
331
336
 
332
337
 
333
- ### dist/dates/helpers/getWeek.js
338
+ ### dist/general/mix/importScripts.js
334
339
 
335
340
 
336
- #### getWeek(date)
341
+ #### importScripts(scripts)
337
342
 
338
- Gets the week number of the year
339
- Additionally, the month and the year
343
+ Import a set of external Scripts given the URL in both serie and cascade way
340
344
 
341
345
 
342
346
 
@@ -345,28 +349,54 @@ Additionally, the month and the year
345
349
 
346
350
  | Name | Type | Description | |
347
351
  | ---- | ---- | ----------- | -------- |
348
- | date | | the date object |   |
352
+ | scripts | `Array.<String>` `Array.<Object>` | can be an array of string or an array of object with the follow structure: | &nbsp; |
353
+ | scripts.url | `String` | CDN URL | &nbsp; |
354
+ | 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; |
355
+ | scripts.type | `String` | (Optional) it could be `module` of `text/javascript`. Default `text/javascript` | &nbsp; |
356
+ | scripts.noModule | `Boolean` | (Optional) add `momodule` attribute to script tag. Default `false` | &nbsp; |
357
+ | scripts.dependencies | `Array.<Object>` | an array with the same structure to load in cascade mode | &nbsp; |
349
358
 
350
359
 
351
360
 
352
361
 
353
- ##### Returns
362
+ ##### Examples
363
+
364
+ ```javascript
365
+ // 1) Simple script (paralell loading)
366
+ importScripts(['http://myscript.js', 'http://another.js']);
354
367
 
368
+ // 2) Loading `.js` and `.esm.js` script (parallel loading)
369
+ importScripts([
370
+ { url: 'http://myscript.esm.js', type: 'module' },
371
+ { url: 'http://myscript.js', noModule: true }
372
+ ]);
355
373
 
356
- - an object with the week, month and year.
374
+ // 3) import dependent scripts (cascade)
375
+ importScripts([
376
+ { url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] }
377
+ ]);
378
+
379
+ // 4) mix
380
+ importScripts([
381
+ { url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] },
382
+ { url: 'http://another.esm.js', type: 'module' },
383
+ { url: 'http://another.js', noModule: true },
384
+ 'http://simplescript.js'
385
+ ]);
386
+ ```
357
387
 
358
388
 
389
+ ##### Returns
359
390
 
360
391
 
361
- ### dist/dates/helpers/validateDate.js
392
+ - `Promise` Promise when all script have been loaded
362
393
 
363
394
 
364
- #### validateDate(date, format)
365
395
 
366
- Validate a string date depending on giving format
367
- - If the string is a token label, the function lets it pass.
368
- - Otherwise depends of the format
369
- - Some escenarios the string is a mix of token labels and dates
396
+ #### loadScript(url, type, noModule)
397
+
398
+ Creates the script element and appends to document.head
399
+ return a Promise that is resolved when the script is loaded
370
400
 
371
401
 
372
402
 
@@ -375,8 +405,9 @@ Validate a string date depending on giving format
375
405
 
376
406
  | Name | Type | Description | |
377
407
  | ---- | ---- | ----------- | -------- |
378
- | date | | String of date | &nbsp; |
379
- | format | | String of the format to validate | &nbsp; |
408
+ | url | `String` | Cdn Url | &nbsp; |
409
+ | type | `String` | (Optional) it could be `module` of `text/javascript`. Default `text/javascript` | &nbsp; |
410
+ | noModule | `boolean` | (Optional) add `momodule` attribute to script tag. Default `false` | &nbsp; |
380
411
 
381
412
 
382
413
 
@@ -384,17 +415,19 @@ Validate a string date depending on giving format
384
415
  ##### Returns
385
416
 
386
417
 
387
- - True if it is valid or not. Undefined if date is undefined
418
+ - `Void`
388
419
 
389
420
 
390
421
 
391
422
 
392
- ### dist/dates/helpers/validateDateByDateFormat.js
423
+ ### dist/general/mix/isNaNV2.js
393
424
 
394
425
 
395
- #### validateDateByDateFormat(date, dateForma)
426
+ #### isNaNV2(variable)
396
427
 
397
- Validates the given string as Date by its date format.
428
+ Validates if the recieved number is NaN type.
429
+ This function recieves any variable but will return false.
430
+ Validates if variable is null, undefined, or an empty string, also, the function uses isNaN native function.
398
431
 
399
432
 
400
433
 
@@ -403,8 +436,7 @@ Validates the given string as Date by its date format.
403
436
 
404
437
  | Name | Type | Description | |
405
438
  | ---- | ---- | ----------- | -------- |
406
- | date | | a string to validate as date form | &nbsp; |
407
- | dateForma | | the format of the date to validate the string | &nbsp; |
439
+ | variable | | the variable to validate | &nbsp; |
408
440
 
409
441
 
410
442
 
@@ -412,17 +444,17 @@ Validates the given string as Date by its date format.
412
444
  ##### Returns
413
445
 
414
446
 
415
- - true: the string is a valida date
447
+ - True if variable is a NaN or false otherwise
416
448
 
417
449
 
418
450
 
419
451
 
420
- ### dist/dates/range/getDateRange.js
452
+ ### dist/general/mix/isEmpty.js
421
453
 
422
454
 
423
- #### getDateRange(value, dateGroupLabel, withTime)
455
+ #### isEmpty(variable, includeFalsy)
424
456
 
425
- Get date range object from a string date value
457
+ Validates if the given argument is empty
426
458
 
427
459
 
428
460
 
@@ -431,58 +463,36 @@ Get date range object from a string date value
431
463
 
432
464
  | Name | Type | Description | |
433
465
  | ---- | ---- | ----------- | -------- |
434
- | value | `String` | string date value | &nbsp; |
435
- | dateGroupLabel | `String` | could be 'YEAR', 'QUARTER', 'MONTH' or 'DAY'. Deafult is 'DAY' | &nbsp; |
436
- | withTime | `Boolean` | determines if the date range will include time. Default is true | &nbsp; |
437
-
438
-
466
+ | variable | | the given variable | &nbsp; |
467
+ | includeFalsy | | flag to determine include the falsy variables into the validation | &nbsp; |
439
468
 
440
469
 
441
- ##### Examples
442
470
 
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
471
 
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
- }
472
+ ##### Returns
459
473
 
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
474
 
475
+ - true: the given argument is empty; false: is not.
469
476
 
470
- ##### Returns
471
477
 
472
478
 
473
- - `Object` an object with the date range with two string date properties: from and to
474
479
 
480
+ ### dist/general/mix/isNull.js
475
481
 
476
482
 
483
+ #### isNull(arg)
477
484
 
478
- ### dist/dates/relative/Adapter.js
485
+ return if a given variable is either `null` or `undefined`
486
+ useful to avoid falsify validating Number Zero (0)
479
487
 
480
488
 
481
- #### value()
482
489
 
483
- Resolves statement and returns statement value
484
490
 
491
+ ##### Parameters
485
492
 
493
+ | Name | Type | Description | |
494
+ | ---- | ---- | ----------- | -------- |
495
+ | arg | `any` | | &nbsp; |
486
496
 
487
497
 
488
498
 
@@ -490,93 +500,108 @@ Resolves statement and returns statement value
490
500
  ##### Returns
491
501
 
492
502
 
493
- - `AbsoluteRange` `string`
494
-
503
+ - `Boolean`
495
504
 
496
505
 
497
- #### valueAsAnchor()
498
506
 
499
- Resolves statement as an anchor
500
507
 
508
+ ### dist/general/mix/size.js
501
509
 
502
510
 
511
+ #### size(obj)
503
512
 
513
+ Gets the length of the given array.
514
+ - Useful for Object, Array and string type.
515
+ - For `null` or `undefined` or else argument the returned value will be 0.
504
516
 
505
517
 
506
- ##### Returns
507
518
 
508
519
 
509
- - `string`
520
+ ##### Parameters
510
521
 
522
+ | Name | Type | Description | |
523
+ | ---- | ---- | ----------- | -------- |
524
+ | obj | `Any` | Any object-type variable | &nbsp; |
511
525
 
512
526
 
513
- #### _statementToRange() *private method*
514
527
 
515
- Convert verbal statement to range value
516
528
 
529
+ ##### Returns
517
530
 
518
531
 
532
+ - `Number` the size of the given variable
519
533
 
520
534
 
521
535
 
522
- ##### Returns
523
536
 
537
+ ### dist/general/mix/randomId.js
524
538
 
525
- - `AbsoluteRange`
526
539
 
540
+ #### randomId(length, exclude)
527
541
 
542
+ Creates a random string
543
+ - If the first given argument is different than a length number, the variable is replaced by a default number
544
+ - If the optional second given argument is passed the random string is permutated.
528
545
 
529
- #### _resolveAsThis() *private method*
530
-
531
- Apply 'this' cursor logic to statement
532
546
 
533
547
 
534
548
 
549
+ ##### Parameters
535
550
 
551
+ | Name | Type | Description | |
552
+ | ---- | ---- | ----------- | -------- |
553
+ | length | `Number` | size of the generated string. Default 8 | &nbsp; |
554
+ | exclude | `Array` | collection of strings that is going to be excluded of the random string. | &nbsp; |
536
555
 
537
556
 
538
- ##### Returns
539
557
 
540
558
 
541
- - `AbsoluteStatement`
559
+ ##### Returns
542
560
 
543
561
 
562
+ - `String` Random string
544
563
 
545
- #### _resolveAsTheLast() *private method*
546
564
 
547
- Apply 'the last' cursor logic to statement
548
565
 
549
566
 
567
+ ### dist/general/object/cloneDeep.js
550
568
 
551
569
 
570
+ #### cloneDeep(obj)
552
571
 
572
+ A simple Deep Cloning function. Valid only for primivite values and object with primitive values.
573
+ Not to use this function with inner objects and functions
553
574
 
554
- ##### Returns
555
575
 
556
576
 
557
- - `AbsoluteStatement`
558
577
 
578
+ ##### Parameters
559
579
 
580
+ | Name | Type | Description | |
581
+ | ---- | ---- | ----------- | -------- |
582
+ | obj | | The object | &nbsp; |
560
583
 
561
- #### _resolveAsTheNext() *private method*
562
584
 
563
- Apply 'the next' cursor logic to statement
564
585
 
565
586
 
587
+ ##### Returns
566
588
 
567
589
 
590
+ - The new reference object or the given object if the parsing is incorrect or empty
568
591
 
569
592
 
570
- ##### Returns
571
593
 
572
594
 
573
- - `AbsoluteStatement`
595
+ ### dist/general/object/get.js
574
596
 
575
597
 
598
+ #### _get(baseObject, path, defaultValue)
576
599
 
577
- #### replaceNowToken(value, now)
600
+ Like lodash _.get.
601
+ Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.
578
602
 
579
- Replace '@now' token inside a string
603
+ Empty arrays and empty objects are returned but the defaultValue is not
604
+ Undefined and null values will return the defaultValue.
580
605
 
581
606
 
582
607
 
@@ -585,22 +610,59 @@ Replace '@now' token inside a string
585
610
 
586
611
  | Name | Type | Description | |
587
612
  | ---- | ---- | ----------- | -------- |
588
- | value | `string` | | &nbsp; |
589
- | now | `Date` | | &nbsp; |
613
+ | baseObject | | The object to query | &nbsp; |
614
+ | path | | The string path or collection of string paths of the property to get. | &nbsp; |
615
+ | defaultValue | | The value returned for undefined resolved values. | &nbsp; |
616
+
617
+
590
618
 
591
619
 
620
+ ##### Examples
621
+
622
+ ```javascript
623
+ // returns 'Hello'
624
+ _get({ item1: 'Hello', item2: 'World' }, 'item1')
625
+ ```
626
+ ```javascript
627
+ // returns 'A simple Hello'
628
+ _get({ item1: 'Hello', item2: 'World' }, 'item3', 'A simple Hello')
629
+ ```
630
+ ```javascript
631
+ // returns 'Hello Again'
632
+ _get({ item1: { item11: 'Hello Again' }, item2: {} }, 'item1.item11')
633
+ ```
634
+ ```javascript
635
+ // returns 'Hello 2'
636
+ _get({ item1: ['Hello 1', 'Hello 2' }, item2: [] }, 'item1[1]')
637
+ ```
638
+ ```javascript
639
+ // returns 'Hello Again'
640
+ _get({ item1: { item11: 'Hello Again' }, item2: {} }, ['item1', 'item11'])
641
+ ```
592
642
 
593
643
 
594
644
  ##### Returns
595
645
 
596
646
 
597
- - `string`
647
+ - the resolved value.
598
648
 
599
649
 
600
650
 
601
- #### convertRelativeToAbsolute(args)
602
651
 
603
- Returns a range object (date) from a group of statement params
652
+ ### dist/general/object/getAttribute.js
653
+
654
+
655
+ #### getAttribute(obj, key)
656
+
657
+ Searchs for properties in different case styles such as: lower, upper, camel and pascal
658
+ - To optimize the searching, it is required a key in a snake_case style
659
+ - List of cases that do not match
660
+ -- From lower to snake case
661
+ -- From upper to snake case
662
+ -- From lower to camel case
663
+ -- From upper to camel case
664
+ -- From lower to pascal case
665
+ -- From upper to pascal case
604
666
 
605
667
 
606
668
 
@@ -609,7 +671,8 @@ Returns a range object (date) from a group of statement params
609
671
 
610
672
  | Name | Type | Description | |
611
673
  | ---- | ---- | ----------- | -------- |
612
- | args | `RelativeToAbsoluteStruct` | | &nbsp; |
674
+ | obj | `object` | object to look for | &nbsp; |
675
+ | key | `string` | String attribute in snake_case style | &nbsp; |
613
676
 
614
677
 
615
678
 
@@ -617,37 +680,24 @@ Returns a range object (date) from a group of statement params
617
680
  ##### Examples
618
681
 
619
682
  ```javascript
620
- pivot = '2021-03-03T12:30:40'
621
- unit = month
622
- steps = 2
623
- setTo = END
624
- resolverAsCalendar: true
625
- => Returns '2021-05-31T23:59:59'
626
- ```
627
- ```javascript
628
- pivot = '2021-03-03T12:30:40'
629
- unit = month
630
- steps = -2
631
- setTo = START
632
- resolverAsCalendar: false
633
- => Returns '2021-01-03T00:00:00'
683
+ getAttribute(obj, 'snake_case') //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
634
684
  ```
635
685
 
636
686
 
637
687
  ##### Returns
638
688
 
639
689
 
640
- - `string`
690
+ - `Void`
641
691
 
642
692
 
643
693
 
644
694
 
645
- ### dist/dates/relative/relative.js
695
+ ### dist/general/object/hasProperty.js
646
696
 
647
697
 
648
- #### resolveRelative(statements, clock)
698
+ #### _hasProperty(obj, property)
649
699
 
650
- Resolve a list of relative statements according to operator
700
+ Use the hasOwnProperty in order to verify if the given property exists in the object.
651
701
 
652
702
 
653
703
 
@@ -656,8 +706,8 @@ Resolve a list of relative statements according to operator
656
706
 
657
707
  | Name | Type | Description | |
658
708
  | ---- | ---- | ----------- | -------- |
659
- | statements | `Array.<RelativeStatement>` `Array.<string>` | - Raw statements/values | &nbsp; |
660
- | clock | `Date` | - Clock/time reference for relative date resolution | &nbsp; |
709
+ | obj | `object` | an object | &nbsp; |
710
+ | property | `string` | String to verify if exists in the object as property | &nbsp; |
661
711
 
662
712
 
663
713
 
@@ -665,35 +715,29 @@ Resolve a list of relative statements according to operator
665
715
  ##### Examples
666
716
 
667
717
  ```javascript
668
- Input:
669
- {
670
- "cursor": "the_next",
671
- "unit": "year",
672
- "number": 1,
673
- "includeCurrent": false,
674
- "isCalendarDate": false,
675
- "anchor": "03/05/2021"
676
- }
718
+ const prop = 'prop2'
719
+ const obj1 = { prop1: 'hello', prop2: 'world'}
720
+ _hasProperty(ob1, prop1) // true
677
721
 
678
- Output:
679
- { gte: "03/06/2021 00:00:00", lte: "03/05/2022 23:59:59" }
722
+ const obj2 = { prop1: 'hello world' }
723
+ _hasProperty(ob1, prop2) // false
680
724
  ```
681
725
 
682
726
 
683
727
  ##### Returns
684
728
 
685
729
 
686
- - `Array.&lt;AbsoluteRange&gt;` `Array.&lt;string&gt;`
730
+ - True if the object has the given property; otherwise, false.
687
731
 
688
732
 
689
733
 
690
734
 
691
- ### dist/filters/adapters/FDToFlatUI.js
735
+ ### dist/general/object/isObject.js
692
736
 
693
737
 
694
- #### FDToFlatUI(filterData, datasetsInfo)
738
+ #### isObject(obj)
695
739
 
696
- Generates a Flattened UI filter structure from Filter Data structure.
740
+ Checks if the given argument is an object type
697
741
 
698
742
 
699
743
 
@@ -702,8 +746,7 @@ Generates a Flattened UI filter structure from Filter Data structure.
702
746
 
703
747
  | Name | Type | Description | |
704
748
  | ---- | ---- | ----------- | -------- |
705
- | filterData | | The filter data object. | &nbsp; |
706
- | datasetsInfo | | Collection of datasets information | &nbsp; |
749
+ | obj | | the variable to check | &nbsp; |
707
750
 
708
751
 
709
752
 
@@ -711,13 +754,18 @@ Generates a Flattened UI filter structure from Filter Data structure.
711
754
  ##### Returns
712
755
 
713
756
 
714
- - a flattened UI filters array
757
+ - True: It is an object; False: It is not.
715
758
 
716
759
 
717
760
 
718
- #### FD21ToFlatUI(scopes, datasetsInfo)
719
761
 
720
- Generates a Filter Builder Structure from the Filter Data structure v2.1
762
+ ### dist/general/object/mapValues.js
763
+
764
+
765
+ #### mapValues(baseObject, iteratee)
766
+
767
+ Invoke iteratee (function) for each object key-value pair
768
+ and return a mapped object
721
769
 
722
770
 
723
771
 
@@ -726,8 +774,8 @@ Generates a Filter Builder Structure from the Filter Data structure v2.1
726
774
 
727
775
  | Name | Type | Description | |
728
776
  | ---- | ---- | ----------- | -------- |
729
- | scopes | | The filter scope section | &nbsp; |
730
- | datasetsInfo | | Collection of datasets information | &nbsp; |
777
+ | baseObject | `Object` | Base object. | &nbsp; |
778
+ | iteratee | `Function` | The executed per iteration. | &nbsp; |
731
779
 
732
780
 
733
781
 
@@ -735,17 +783,18 @@ Generates a Filter Builder Structure from the Filter Data structure v2.1
735
783
  ##### Returns
736
784
 
737
785
 
738
- - a flattened UI filters array
786
+ - `Object` New mapped object.
739
787
 
740
788
 
741
789
 
742
790
 
743
- ### dist/filters/adapters/FDToLogic.js
791
+ ### dist/general/object/mergeDeep.js
744
792
 
745
793
 
746
- #### FDToLogic(filterData)
794
+ #### mergeDeep(obj1, obj2, settings)
747
795
 
748
- Generates a Filter Logic structure from Filter Data structure.
796
+ Merges two objects into a new one.
797
+ The second given argument to the first given argument.
749
798
 
750
799
 
751
800
 
@@ -754,7 +803,9 @@ Generates a Filter Logic structure from Filter Data structure.
754
803
 
755
804
  | Name | Type | Description | |
756
805
  | ---- | ---- | ----------- | -------- |
757
- | filterData | | The filter data object. | &nbsp; |
806
+ | obj1 | | The target object | &nbsp; |
807
+ | obj2 | | The object to be merged | &nbsp; |
808
+ | settings | | Object settings for this function | &nbsp; |
758
809
 
759
810
 
760
811
 
@@ -762,13 +813,13 @@ Generates a Filter Logic structure from Filter Data structure.
762
813
  ##### Returns
763
814
 
764
815
 
765
- - a filter logic array
816
+ - a new merged object
766
817
 
767
818
 
768
819
 
769
- #### getLogicBodyFromFD21(filterData)
820
+ #### isValid(obj1, obj2)
770
821
 
771
- Gets the logic body
822
+ Validates if the two arguments are objects
772
823
 
773
824
 
774
825
 
@@ -777,7 +828,8 @@ Gets the logic body
777
828
 
778
829
  | Name | Type | Description | |
779
830
  | ---- | ---- | ----------- | -------- |
780
- | filterData | | The filter data object | &nbsp; |
831
+ | obj1 | | The target object | &nbsp; |
832
+ | obj2 | | The object to be merged | &nbsp; |
781
833
 
782
834
 
783
835
 
@@ -785,17 +837,13 @@ Gets the logic body
785
837
  ##### Returns
786
838
 
787
839
 
788
- - a filter logic array
789
-
790
-
791
-
840
+ - true: they are valid; false: they are not
792
841
 
793
- ### dist/filters/adapters/FDToUI.js
794
842
 
795
843
 
796
- #### FDToUI(filterData, datasetsInfo)
844
+ #### getParamsToMergeDeep(settings)
797
845
 
798
- Generates a UI filter structure from Filter Data structure.
846
+ Validates and gets the settings with all set parameters.
799
847
 
800
848
 
801
849
 
@@ -804,8 +852,7 @@ Generates a UI filter structure from Filter Data structure.
804
852
 
805
853
  | Name | Type | Description | |
806
854
  | ---- | ---- | ----------- | -------- |
807
- | filterData | | The filter data object. | &nbsp; |
808
- | datasetsInfo | | Collection of datasets information | &nbsp; |
855
+ | settings | | the settings object | &nbsp; |
809
856
 
810
857
 
811
858
 
@@ -813,13 +860,17 @@ Generates a UI filter structure from Filter Data structure.
813
860
  ##### Returns
814
861
 
815
862
 
816
- - a UI Filters structure
863
+ - a new settings object with all set parameters.
817
864
 
818
865
 
819
866
 
820
- #### FD21ToUI(scopes, section, version, datasetsInfo)
821
867
 
822
- Generates a UI filter Structure from the Filter Data structure v2.1
868
+ ### dist/general/object/objectCopy.js
869
+
870
+
871
+ #### objectCopy(entity, cache)
872
+
873
+ Created a new reference of the given argument
823
874
 
824
875
 
825
876
 
@@ -828,10 +879,8 @@ Generates a UI filter Structure from the Filter Data structure v2.1
828
879
 
829
880
  | Name | Type | Description | |
830
881
  | ---- | ---- | ----------- | -------- |
831
- | scopes | | The filter scope section | &nbsp; |
832
- | section | | The filter section. | &nbsp; |
833
- | version | | The version of the filter structure | &nbsp; |
834
- | datasetsInfo | | Collection of datasets information | &nbsp; |
882
+ | entity | | The variable to be copied | &nbsp; |
883
+ | cache | | | &nbsp; |
835
884
 
836
885
 
837
886
 
@@ -839,17 +888,17 @@ Generates a UI filter Structure from the Filter Data structure v2.1
839
888
  ##### Returns
840
889
 
841
890
 
842
- - a UI filter Structure
891
+ - A new reference of the given argument
843
892
 
844
893
 
845
894
 
846
895
 
847
- ### dist/filters/adapters/UIToFD.js
896
+ ### dist/general/object/omit.js
848
897
 
849
898
 
850
- #### UIToFD(filterData)
899
+ #### omit(obj, props)
851
900
 
852
- Generates a Filter Data Structure structure from UI Filter Data structure.
901
+ return a new Object excluding attributes in _props_ list
853
902
 
854
903
 
855
904
 
@@ -858,7 +907,8 @@ Generates a Filter Data Structure structure from UI Filter Data structure.
858
907
 
859
908
  | Name | Type | Description | |
860
909
  | ---- | ---- | ----------- | -------- |
861
- | filterData | | The UI filter data object. | &nbsp; |
910
+ | obj | `Object` | base object | &nbsp; |
911
+ | props | `Array.<String>` | list of attribute to exclude | &nbsp; |
862
912
 
863
913
 
864
914
 
@@ -866,13 +916,17 @@ Generates a Filter Data Structure structure from UI Filter Data structure.
866
916
  ##### Returns
867
917
 
868
918
 
869
- - a Filter Data structure
919
+ - `Object` clean object
870
920
 
871
921
 
872
922
 
873
- #### UI21ToFD(uFilterData, version)
874
923
 
875
- Builds the Fitler Data structure from UI filter data
924
+ ### dist/general/object/pick.js
925
+
926
+
927
+ #### pick(baseObject, keys)
928
+
929
+ return a new object just with attributes in _keys_ list
876
930
 
877
931
 
878
932
 
@@ -881,8 +935,8 @@ Builds the Fitler Data structure from UI filter data
881
935
 
882
936
  | Name | Type | Description | |
883
937
  | ---- | ---- | ----------- | -------- |
884
- | uFilterData | | The UI filter Data object | &nbsp; |
885
- | version | | the version of the structure | &nbsp; |
938
+ | baseObject | `Object` | base object | &nbsp; |
939
+ | keys | `Array.<String>` | list of attributes to preserve | &nbsp; |
886
940
 
887
941
 
888
942
 
@@ -890,17 +944,17 @@ Builds the Fitler Data structure from UI filter data
890
944
  ##### Returns
891
945
 
892
946
 
893
- -
947
+ - `Object` new object just with desired attributes
894
948
 
895
949
 
896
950
 
897
951
 
898
- ### dist/filters/adapters/UIToFlatUI.js
952
+ ### dist/general/object/serialize.js
899
953
 
900
954
 
901
- #### UIToFlatUI(filterData, datasetsInfo)
955
+ #### serialize(obj)
902
956
 
903
- Generates a Flattened UI filter structure from UI Filter Data structure.
957
+ serialize object to url param
904
958
 
905
959
 
906
960
 
@@ -909,8 +963,7 @@ Generates a Flattened UI filter structure from UI Filter Data structure.
909
963
 
910
964
  | Name | Type | Description | |
911
965
  | ---- | ---- | ----------- | -------- |
912
- | filterData | | The UI filter data object. | &nbsp; |
913
- | datasetsInfo | | Collection of datasets information. Optional for updating the datasets info | &nbsp; |
966
+ | obj | | - Object to be serialized | &nbsp; |
914
967
 
915
968
 
916
969
 
@@ -918,22 +971,26 @@ Generates a Flattened UI filter structure from UI Filter Data structure.
918
971
  ##### Returns
919
972
 
920
973
 
921
- - a flattened UI filters array
974
+ - `Void`
922
975
 
923
976
 
924
977
 
925
- #### UI21ToFlatUI(scopes)
926
978
 
927
- Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
979
+ ### dist/general/string/capitalize.js
928
980
 
929
981
 
982
+ #### capitalize(text)
930
983
 
984
+ Upper case the first letter of a given text
931
985
 
932
- ##### Parameters
933
986
 
934
- | Name | Type | Description | |
987
+
988
+
989
+ ##### Parameters
990
+
991
+ | Name | Type | Description | |
935
992
  | ---- | ---- | ----------- | -------- |
936
- | scopes | | The filter scope section | &nbsp; |
993
+ | text | `String` | | &nbsp; |
937
994
 
938
995
 
939
996
 
@@ -941,18 +998,17 @@ Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
941
998
  ##### Returns
942
999
 
943
1000
 
944
- - a flattened UI filters array
1001
+ - `String` a capitalized text
945
1002
 
946
1003
 
947
1004
 
948
1005
 
949
- ### dist/filters/adapters/adaptDateGroupingProperty.js
1006
+ ### dist/dates/adapters/mdyDateToDate.js
950
1007
 
951
1008
 
952
- #### adaptDateGroupingProperty(property)
1009
+ #### mdyDateToDate(monthYearDate, time)
953
1010
 
954
- [TODO: For 2022, eliminate this adapter]
955
- Get the new property base on the old date grouping properties
1011
+ Transforms String Date from a [mm/dd/yyyy] format to Date object.
956
1012
 
957
1013
 
958
1014
 
@@ -961,7 +1017,8 @@ Get the new property base on the old date grouping properties
961
1017
 
962
1018
  | Name | Type | Description | |
963
1019
  | ---- | ---- | ----------- | -------- |
964
- | property | | | &nbsp; |
1020
+ | monthYearDate | | String of [mm/dd/yyyy] date | &nbsp; |
1021
+ | time | | Flag to parse the object date to milliseconds. | &nbsp; |
965
1022
 
966
1023
 
967
1024
 
@@ -969,17 +1026,17 @@ Get the new property base on the old date grouping properties
969
1026
  ##### Returns
970
1027
 
971
1028
 
972
- -
1029
+ - The date object or the date in milliseconds
973
1030
 
974
1031
 
975
1032
 
976
1033
 
977
- ### dist/filters/adapters/adaptFilterData.js
1034
+ ### dist/dates/adapters/monthYearToDate.js
978
1035
 
979
1036
 
980
- #### adaptFilterData(filterData, getUIFilterData, datasetsInfo)
1037
+ #### monthYearToDate(monthYearDate, time)
981
1038
 
982
- Checks and adapts the v2.0 Filter Data Structure to the v2.1
1039
+ Transforms String Date from a [Month Year] format to Date object.
983
1040
 
984
1041
 
985
1042
 
@@ -988,9 +1045,8 @@ Checks and adapts the v2.0 Filter Data Structure to the v2.1
988
1045
 
989
1046
  | Name | Type | Description | |
990
1047
  | ---- | ---- | ----------- | -------- |
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; |
1048
+ | monthYearDate | | String of [Month Year] date | &nbsp; |
1049
+ | time | | Flag to parse the object date to milliseconds. | &nbsp; |
994
1050
 
995
1051
 
996
1052
 
@@ -998,18 +1054,17 @@ Checks and adapts the v2.0 Filter Data Structure to the v2.1
998
1054
  ##### Returns
999
1055
 
1000
1056
 
1001
- - A new filter data structure v2.1
1057
+ - The date object or the date in milliseconds
1002
1058
 
1003
1059
 
1004
1060
 
1005
1061
 
1006
- ### dist/filters/adapters/adaptFilterValues.js
1062
+ ### dist/dates/adapters/quarterYearToDate.js
1007
1063
 
1008
1064
 
1009
- #### adaptFilterValues(filter)
1065
+ #### quarterYearToDate(quarterYearDate, time)
1010
1066
 
1011
- [TODO: For 2022, eliminate this adapter]
1012
- Gets an adapted filter value array. Validates the enabled property and sets
1067
+ Transforms String Date from a [Quarter Year] format to Date object.
1013
1068
 
1014
1069
 
1015
1070
 
@@ -1018,7 +1073,8 @@ Gets an adapted filter value array. Validates the enabled property and sets
1018
1073
 
1019
1074
  | Name | Type | Description | |
1020
1075
  | ---- | ---- | ----------- | -------- |
1021
- | filter | | The filter | &nbsp; |
1076
+ | quarterYearDate | | String of [Quarter Year] date | &nbsp; |
1077
+ | time | | Flag to parse the object date to milliseconds. | &nbsp; |
1022
1078
 
1023
1079
 
1024
1080
 
@@ -1026,17 +1082,17 @@ Gets an adapted filter value array. Validates the enabled property and sets
1026
1082
  ##### Returns
1027
1083
 
1028
1084
 
1029
- - A new value array with the filled properties.
1085
+ - The date object or the date in milliseconds
1030
1086
 
1031
1087
 
1032
1088
 
1033
1089
 
1034
- ### dist/filters/adapters/flatUIToFD.js
1090
+ ### dist/dates/adapters/weekYearToDate.js
1035
1091
 
1036
1092
 
1037
- #### flatUIToFD(uFilters, version)
1093
+ #### weekYearToDate(date, time)
1038
1094
 
1039
- Generates a filter data structure from the flatttened UI filters.
1095
+ Transforms String Date from a [Week Year] format to Date object.
1040
1096
 
1041
1097
 
1042
1098
 
@@ -1045,8 +1101,8 @@ Generates a filter data structure from the flatttened UI filters.
1045
1101
 
1046
1102
  | Name | Type | Description | |
1047
1103
  | ---- | ---- | ----------- | -------- |
1048
- | uFilters | | Array of flattened filters from UI | &nbsp; |
1049
- | version | | Tag for the version of the filter data structure | &nbsp; |
1104
+ | date | | String of [Week Year] date | &nbsp; |
1105
+ | time | | Flag to parse the object date to milliseconds. | &nbsp; |
1050
1106
 
1051
1107
 
1052
1108
 
@@ -1054,14 +1110,17 @@ Generates a filter data structure from the flatttened UI filters.
1054
1110
  ##### Returns
1055
1111
 
1056
1112
 
1057
- - a Filter Data.
1113
+ - The date object or the date in milliseconds
1058
1114
 
1059
1115
 
1060
1116
 
1061
- #### buildScopes(fbFilters)
1062
1117
 
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
1118
+ ### dist/dates/adapters/yearToDate.js
1119
+
1120
+
1121
+ #### yearToDate(yearDate, time)
1122
+
1123
+ Transforms String Date from a [Year] format to Date object.
1065
1124
 
1066
1125
 
1067
1126
 
@@ -1070,7 +1129,8 @@ Also, adds and organizes filters by datasets
1070
1129
 
1071
1130
  | Name | Type | Description | |
1072
1131
  | ---- | ---- | ----------- | -------- |
1073
- | fbFilters | | Array of flat filters from UI | &nbsp; |
1132
+ | yearDate | | String of [Year] date | &nbsp; |
1133
+ | time | | Flag to parse the object date to milliseconds. | &nbsp; |
1074
1134
 
1075
1135
 
1076
1136
 
@@ -1078,13 +1138,17 @@ Also, adds and organizes filters by datasets
1078
1138
  ##### Returns
1079
1139
 
1080
1140
 
1081
- - an array of scopes structure.
1141
+ - The date object or the date in milliseconds
1082
1142
 
1083
1143
 
1084
1144
 
1085
- #### buildScope(uFilter)
1086
1145
 
1087
- Gets an scope structure for the filter data
1146
+ ### dist/dates/helpers/getDateByDateFormat.js
1147
+
1148
+
1149
+ #### getDateByDateFormat(date, format, time)
1150
+
1151
+ Gets a Date Object instance by a Date format
1088
1152
 
1089
1153
 
1090
1154
 
@@ -1093,7 +1157,9 @@ Gets an scope structure for the filter data
1093
1157
 
1094
1158
  | Name | Type | Description | |
1095
1159
  | ---- | ---- | ----------- | -------- |
1096
- | uFilter | | UI structure filter | &nbsp; |
1160
+ | date | | String with a formatted date | &nbsp; |
1161
+ | format | | The date format | &nbsp; |
1162
+ | time | | flag to convert the formatted date to miliseconds | &nbsp; |
1097
1163
 
1098
1164
 
1099
1165
 
@@ -1101,13 +1167,17 @@ Gets an scope structure for the filter data
1101
1167
  ##### Returns
1102
1168
 
1103
1169
 
1104
- - an scope structure
1170
+ - a Date object, milisecond time or the same value if date format does not match.
1105
1171
 
1106
1172
 
1107
1173
 
1108
- #### buildDataset(uFilter)
1109
1174
 
1110
- Gets an dataset structure for the filter data
1175
+ ### dist/dates/helpers/getDateFormatByProperty.js
1176
+
1177
+
1178
+ #### getDateFormatByProperty(property)
1179
+
1180
+ Gets the date format by the given property
1111
1181
 
1112
1182
 
1113
1183
 
@@ -1116,7 +1186,7 @@ Gets an dataset structure for the filter data
1116
1186
 
1117
1187
  | Name | Type | Description | |
1118
1188
  | ---- | ---- | ----------- | -------- |
1119
- | uFilter | | a UI structure filter | &nbsp; |
1189
+ | property | | The Column Property | &nbsp; |
1120
1190
 
1121
1191
 
1122
1192
 
@@ -1124,13 +1194,17 @@ Gets an dataset structure for the filter data
1124
1194
  ##### Returns
1125
1195
 
1126
1196
 
1127
- - an dataset structure
1197
+ - The date format
1128
1198
 
1129
1199
 
1130
1200
 
1131
- #### buildFilter(uFilter)
1132
1201
 
1133
- Gets an filter structure for the filter data
1202
+ ### dist/dates/helpers/getDateFormatRegularExpressionInArray.js
1203
+
1204
+
1205
+ #### getDateFormatRegularExpressionInArray(dateFormat)
1206
+
1207
+ Gets an array of regular expressions by the given date format
1134
1208
 
1135
1209
 
1136
1210
 
@@ -1139,7 +1213,7 @@ Gets an filter structure for the filter data
1139
1213
 
1140
1214
  | Name | Type | Description | |
1141
1215
  | ---- | ---- | ----------- | -------- |
1142
- | uFilter | | a UI structure filter | &nbsp; |
1216
+ | dateFormat | | the date format | &nbsp; |
1143
1217
 
1144
1218
 
1145
1219
 
@@ -1147,17 +1221,17 @@ Gets an filter structure for the filter data
1147
1221
  ##### Returns
1148
1222
 
1149
1223
 
1150
- - an filter structure
1224
+ - an array of regular expressions
1151
1225
 
1152
1226
 
1153
1227
 
1154
1228
 
1155
- ### dist/filters/adapters/flatUIToLogic.js
1229
+ ### dist/dates/helpers/getSeparatorByDateFormat.js
1156
1230
 
1157
1231
 
1158
- #### flatUIToLogic(uFilter)
1232
+ #### getSeparatorByDateFormat(format)
1159
1233
 
1160
- Generates a Logic structure from flattened UI filters
1234
+ Gets the separator of the date format
1161
1235
 
1162
1236
 
1163
1237
 
@@ -1166,7 +1240,7 @@ Generates a Logic structure from flattened UI filters
1166
1240
 
1167
1241
  | Name | Type | Description | |
1168
1242
  | ---- | ---- | ----------- | -------- |
1169
- | uFilter | | Array of flat filters from UI | &nbsp; |
1243
+ | format | | the date format | &nbsp; |
1170
1244
 
1171
1245
 
1172
1246
 
@@ -1174,17 +1248,18 @@ Generates a Logic structure from flattened UI filters
1174
1248
  ##### Returns
1175
1249
 
1176
1250
 
1177
- - The logic structure
1251
+ - a separator string
1178
1252
 
1179
1253
 
1180
1254
 
1181
1255
 
1182
- ### dist/filters/adapters/flatUIToOldLogic.js
1256
+ ### dist/dates/helpers/getWeek.js
1183
1257
 
1184
1258
 
1185
- #### flatUIToOldLogic(uFilters)
1259
+ #### getWeek(date)
1186
1260
 
1187
- Generates a Logic structure from flattened UI filters
1261
+ Gets the week number of the year
1262
+ Additionally, the month and the year
1188
1263
 
1189
1264
 
1190
1265
 
@@ -1193,7 +1268,7 @@ Generates a Logic structure from flattened UI filters
1193
1268
 
1194
1269
  | Name | Type | Description | |
1195
1270
  | ---- | ---- | ----------- | -------- |
1196
- | uFilters | | Array of flat filters from UI | &nbsp; |
1271
+ | date | | the date object | &nbsp; |
1197
1272
 
1198
1273
 
1199
1274
 
@@ -1201,17 +1276,20 @@ Generates a Logic structure from flattened UI filters
1201
1276
  ##### Returns
1202
1277
 
1203
1278
 
1204
- - The logic structure
1279
+ - an object with the week, month and year.
1205
1280
 
1206
1281
 
1207
1282
 
1208
1283
 
1209
- ### dist/filters/adapters/flatUIToUI.js
1284
+ ### dist/dates/helpers/validateDate.js
1210
1285
 
1211
1286
 
1212
- #### flatUIToUI(uFilters, version)
1287
+ #### validateDate(date, format)
1213
1288
 
1214
- Generates a UI filter data structure from the flatttened UI filters.
1289
+ Validate a string date depending on giving format
1290
+ - If the string is a token label, the function lets it pass.
1291
+ - Otherwise depends of the format
1292
+ - Some escenarios the string is a mix of token labels and dates
1215
1293
 
1216
1294
 
1217
1295
 
@@ -1220,8 +1298,8 @@ Generates a UI filter data structure from the flatttened UI filters.
1220
1298
 
1221
1299
  | Name | Type | Description | |
1222
1300
  | ---- | ---- | ----------- | -------- |
1223
- | uFilters | | Array of flattened filters from UI | &nbsp; |
1224
- | version | | Tag for the version of the filter data structure | &nbsp; |
1301
+ | date | | String of date | &nbsp; |
1302
+ | format | | String of the format to validate | &nbsp; |
1225
1303
 
1226
1304
 
1227
1305
 
@@ -1229,14 +1307,17 @@ Generates a UI filter data structure from the flatttened UI filters.
1229
1307
  ##### Returns
1230
1308
 
1231
1309
 
1232
- - a UI Filter Data.
1310
+ - True if it is valid or not. Undefined if date is undefined
1233
1311
 
1234
1312
 
1235
1313
 
1236
- #### buildScopes(fbFilters)
1237
1314
 
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
1315
+ ### dist/dates/helpers/validateDateByDateFormat.js
1316
+
1317
+
1318
+ #### validateDateByDateFormat(date, dateForma)
1319
+
1320
+ Validates the given string as Date by its date format.
1240
1321
 
1241
1322
 
1242
1323
 
@@ -1245,7 +1326,8 @@ Also, adds and organizes filters by datasets
1245
1326
 
1246
1327
  | Name | Type | Description | |
1247
1328
  | ---- | ---- | ----------- | -------- |
1248
- | fbFilters | | Array of flat filters from UI | &nbsp; |
1329
+ | date | | a string to validate as date form | &nbsp; |
1330
+ | dateForma | | the format of the date to validate the string | &nbsp; |
1249
1331
 
1250
1332
 
1251
1333
 
@@ -1253,22 +1335,19 @@ Also, adds and organizes filters by datasets
1253
1335
  ##### Returns
1254
1336
 
1255
1337
 
1256
- - an array of scopes structure.
1338
+ - true: the string is a valida date
1257
1339
 
1258
1340
 
1259
1341
 
1260
- #### buildScope(uFilter)
1261
1342
 
1262
- Gets an scope structure for the UI filter data
1343
+ ### dist/dates/relative/Adapter.js
1263
1344
 
1264
1345
 
1346
+ #### value()
1265
1347
 
1348
+ Resolves statement and returns statement value
1266
1349
 
1267
- ##### Parameters
1268
1350
 
1269
- | Name | Type | Description | |
1270
- | ---- | ---- | ----------- | -------- |
1271
- | uFilter | | UI structure filter | &nbsp; |
1272
1351
 
1273
1352
 
1274
1353
 
@@ -1276,22 +1355,15 @@ Gets an scope structure for the UI filter data
1276
1355
  ##### Returns
1277
1356
 
1278
1357
 
1279
- - an scope structure
1280
-
1281
-
1282
-
1283
- #### buildDataset(uFilter)
1358
+ - `AbsoluteRange` `string`
1284
1359
 
1285
- Gets an dataset structure for the UI filter data
1286
1360
 
1287
1361
 
1362
+ #### valueAsAnchor()
1288
1363
 
1364
+ Resolves statement as an anchor
1289
1365
 
1290
- ##### Parameters
1291
1366
 
1292
- | Name | Type | Description | |
1293
- | ---- | ---- | ----------- | -------- |
1294
- | uFilter | | a UI structure filter | &nbsp; |
1295
1367
 
1296
1368
 
1297
1369
 
@@ -1299,22 +1371,15 @@ Gets an dataset structure for the UI filter data
1299
1371
  ##### Returns
1300
1372
 
1301
1373
 
1302
- - an dataset structure
1303
-
1304
-
1305
-
1306
- #### buildFilter(uFilter)
1374
+ - `string`
1307
1375
 
1308
- Gets an filter structure for the UI filter data
1309
1376
 
1310
1377
 
1378
+ #### _statementToRange() *private method*
1311
1379
 
1380
+ Convert verbal statement to range value
1312
1381
 
1313
- ##### Parameters
1314
1382
 
1315
- | Name | Type | Description | |
1316
- | ---- | ---- | ----------- | -------- |
1317
- | uFilter | | a UI structure filter | &nbsp; |
1318
1383
 
1319
1384
 
1320
1385
 
@@ -1322,54 +1387,47 @@ Gets an filter structure for the UI filter data
1322
1387
  ##### Returns
1323
1388
 
1324
1389
 
1325
- - an filter structure
1390
+ - `AbsoluteRange`
1326
1391
 
1327
1392
 
1328
1393
 
1394
+ #### _resolveAsThis() *private method*
1329
1395
 
1330
- ### dist/filters/adapters/logicToFD.js
1396
+ Apply 'this' cursor logic to statement
1331
1397
 
1332
1398
 
1333
- #### logicToFD(filterData, version)
1334
1399
 
1335
- Generates a filter data structure from the old logic structure (v2.0).
1336
1400
 
1337
1401
 
1338
1402
 
1403
+ ##### Returns
1339
1404
 
1340
- ##### Parameters
1341
1405
 
1342
- | Name | Type | Description | |
1343
- | ---- | ---- | ----------- | -------- |
1344
- | filterData | | The old filter data structure with logic (v2.0) | &nbsp; |
1345
- | version | | Tag for the version of the filter data structure | &nbsp; |
1406
+ - `AbsoluteStatement`
1346
1407
 
1347
1408
 
1348
1409
 
1410
+ #### _resolveAsTheLast() *private method*
1349
1411
 
1350
- ##### Returns
1412
+ Apply 'the last' cursor logic to statement
1351
1413
 
1352
1414
 
1353
- - a Filter Data.
1354
1415
 
1355
1416
 
1356
1417
 
1357
1418
 
1358
- ### dist/filters/adapters/logicToFlatUI.js
1419
+ ##### Returns
1359
1420
 
1360
1421
 
1361
- #### logicToFlatUI(logics)
1422
+ - `AbsoluteStatement`
1362
1423
 
1363
- Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
1364
1424
 
1365
1425
 
1426
+ #### _resolveAsTheNext() *private method*
1366
1427
 
1428
+ Apply 'the next' cursor logic to statement
1367
1429
 
1368
- ##### Parameters
1369
1430
 
1370
- | Name | Type | Description | |
1371
- | ---- | ---- | ----------- | -------- |
1372
- | logics | | The old logic structure (v2.0) | &nbsp; |
1373
1431
 
1374
1432
 
1375
1433
 
@@ -1377,13 +1435,13 @@ Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
1377
1435
  ##### Returns
1378
1436
 
1379
1437
 
1380
- - The Flattened UI Filters array
1438
+ - `AbsoluteStatement`
1381
1439
 
1382
1440
 
1383
1441
 
1384
- #### getFilter(filters, filter, getIndex)
1442
+ #### replaceNowToken(value, now)
1385
1443
 
1386
- Get the filter or the index of the given array, validating an old filter structure.
1444
+ Replace '@now' token inside a string
1387
1445
 
1388
1446
 
1389
1447
 
@@ -1392,9 +1450,8 @@ Get the filter or the index of the given array, validating an old filter structu
1392
1450
 
1393
1451
  | Name | Type | Description | |
1394
1452
  | ---- | ---- | ----------- | -------- |
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; |
1453
+ | value | `string` | | &nbsp; |
1454
+ | now | `Date` | | &nbsp; |
1398
1455
 
1399
1456
 
1400
1457
 
@@ -1402,13 +1459,13 @@ Get the filter or the index of the given array, validating an old filter structu
1402
1459
  ##### Returns
1403
1460
 
1404
1461
 
1405
- - the index or the UI filter object
1462
+ - `string`
1406
1463
 
1407
1464
 
1408
1465
 
1409
- #### refineRankingValues(values, uiValues)
1466
+ #### convertRelativeToAbsolute(args)
1410
1467
 
1411
- Refines the values of the Ranking column type.
1468
+ Returns a range object (date) from a group of statement params
1412
1469
 
1413
1470
 
1414
1471
 
@@ -1417,26 +1474,45 @@ Refines the values of the Ranking column type.
1417
1474
 
1418
1475
  | Name | Type | Description | |
1419
1476
  | ---- | ---- | ----------- | -------- |
1420
- | values | | the Array of Ranking values | &nbsp; |
1421
- | uiValues | | Object with additional info about the values of the filter. | &nbsp; |
1422
-
1423
-
1424
-
1425
-
1426
- ##### Returns
1427
-
1428
-
1429
- - the array of Ranking values
1430
-
1477
+ | args | `RelativeToAbsoluteStruct` | | &nbsp; |
1431
1478
 
1432
1479
 
1433
1480
 
1434
- ### dist/filters/adapters/logicToUI.js
1435
1481
 
1482
+ ##### Examples
1436
1483
 
1437
- #### logicToUI(uFilters, datasetsInfo)
1484
+ ```javascript
1485
+ pivot = '2021-03-03T12:30:40'
1486
+ unit = month
1487
+ steps = 2
1488
+ setTo = END
1489
+ resolverAsCalendar: true
1490
+ => Returns '2021-05-31T23:59:59'
1491
+ ```
1492
+ ```javascript
1493
+ pivot = '2021-03-03T12:30:40'
1494
+ unit = month
1495
+ steps = -2
1496
+ setTo = START
1497
+ resolverAsCalendar: false
1498
+ => Returns '2021-01-03T00:00:00'
1499
+ ```
1500
+
1501
+
1502
+ ##### Returns
1503
+
1504
+
1505
+ - `string`
1438
1506
 
1439
- Generates a UI filter structure from the old logic structure (v2.0).
1507
+
1508
+
1509
+
1510
+ ### dist/dates/relative/relative.js
1511
+
1512
+
1513
+ #### resolveRelative(statements, clock)
1514
+
1515
+ Resolve a list of relative statements according to operator
1440
1516
 
1441
1517
 
1442
1518
 
@@ -1445,26 +1521,44 @@ Generates a UI filter structure from the old logic structure (v2.0).
1445
1521
 
1446
1522
  | Name | Type | Description | |
1447
1523
  | ---- | ---- | ----------- | -------- |
1448
- | uFilters | | Array of filters from old logic structure | &nbsp; |
1449
- | datasetsInfo | | Collection of datasets information | &nbsp; |
1524
+ | statements | `Array.<RelativeStatement>` `Array.<string>` | - Raw statements/values | &nbsp; |
1525
+ | clock | `Date` | - Clock/time reference for relative date resolution | &nbsp; |
1450
1526
 
1451
1527
 
1452
1528
 
1453
1529
 
1530
+ ##### Examples
1531
+
1532
+ ```javascript
1533
+ Input:
1534
+ {
1535
+ "cursor": "the_next",
1536
+ "unit": "year",
1537
+ "number": 1,
1538
+ "includeCurrent": false,
1539
+ "isCalendarDate": false,
1540
+ "anchor": "03/05/2021"
1541
+ }
1542
+
1543
+ Output:
1544
+ { gte: "03/06/2021 00:00:00", lte: "03/05/2022 23:59:59" }
1545
+ ```
1546
+
1547
+
1454
1548
  ##### Returns
1455
1549
 
1456
1550
 
1457
- - a UI Filter Data.
1551
+ - `Array.&lt;AbsoluteRange&gt;` `Array.&lt;string&gt;`
1458
1552
 
1459
1553
 
1460
1554
 
1461
1555
 
1462
- ### dist/filters/adapters/transformFilters.js
1556
+ ### dist/dates/range/getDateRange.js
1463
1557
 
1464
1558
 
1465
- #### transformFilters(oldFiltersObj, section)
1559
+ #### getDateRange(value, dateGroupLabel, withTime)
1466
1560
 
1467
- Transform the old filters structure into the new one
1561
+ Get date range object from a string date value
1468
1562
 
1469
1563
 
1470
1564
 
@@ -1473,8 +1567,9 @@ Transform the old filters structure into the new one
1473
1567
 
1474
1568
  | Name | Type | Description | |
1475
1569
  | ---- | ---- | ----------- | -------- |
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; |
1570
+ | value | `String` | string date value | &nbsp; |
1571
+ | dateGroupLabel | `String` | could be 'YEAR', 'QUARTER', 'MONTH' or 'DAY'. Deafult is 'DAY' | &nbsp; |
1572
+ | withTime | `Boolean` | determines if the date range will include time. Default is true | &nbsp; |
1478
1573
 
1479
1574
 
1480
1575
 
@@ -1482,58 +1577,36 @@ Transform the old filters structure into the new one
1482
1577
  ##### Examples
1483
1578
 
1484
1579
  ```javascript
1580
+ // 1) Year:
1581
+ getDateRange('2020', 'YEAR');
1582
+ // Will return:
1583
+ {
1584
+ from: '01/01/2020 00:00:00',
1585
+ to: '12/31/2020 23:59:59'
1586
+ }
1485
1587
 
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
- };
1588
+ // 2) Quarter:
1589
+ getDateRange('Q3 2020', 'QUARTER');
1590
+ // Will return:
1591
+ {
1592
+ from: '07/01/2020 00:00:00',
1593
+ to: '09/30/2020 23:59:59'
1594
+ }
1528
1595
 
1529
- const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
1596
+ // 3) Month:
1597
+ getDateRange('Oct 2020', 'MONTH');
1598
+ // Will return:
1599
+ {
1600
+ from: '10/01/2020 00:00:00',
1601
+ to: '10/31/2020 23:59:59'
1602
+ }
1530
1603
  ```
1531
1604
 
1532
1605
 
1533
1606
  ##### Returns
1534
1607
 
1535
1608
 
1536
- - `Object` an object with the new filters structure
1609
+ - `Object` an object with the date range with two string date properties: from and to
1537
1610
 
1538
1611
 
1539
1612
 
@@ -1558,12 +1631,12 @@ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
1558
1631
 
1559
1632
 
1560
1633
 
1561
- ### dist/filters/helpers/applyHierarchyForAggFilters.js
1634
+ ### dist/filters/adapters/FDToFlatUI.js
1562
1635
 
1563
1636
 
1564
- #### applyHierarchyForAggFilters(chartSettings, scopes, currentScope)
1637
+ #### FDToFlatUI(filterData, datasetsInfo)
1565
1638
 
1566
- [TODO: Make a proper description for this function]
1639
+ Generates a Flattened UI filter structure from Filter Data structure.
1567
1640
 
1568
1641
 
1569
1642
 
@@ -1572,9 +1645,8 @@ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
1572
1645
 
1573
1646
  | Name | Type | Description | |
1574
1647
  | ---- | ---- | ----------- | -------- |
1575
- | chartSettings | | Chart Settings for the Filter Builder | &nbsp; |
1576
- | scopes | | | &nbsp; |
1577
- | currentScope | | | &nbsp; |
1648
+ | filterData | | The filter data object. | &nbsp; |
1649
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
1578
1650
 
1579
1651
 
1580
1652
 
@@ -1582,17 +1654,13 @@ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
1582
1654
  ##### Returns
1583
1655
 
1584
1656
 
1585
- -
1586
-
1587
-
1588
-
1657
+ - a flattened UI filters array
1589
1658
 
1590
- ### dist/filters/helpers/getAvailableScopes.js
1591
1659
 
1592
1660
 
1593
- #### getAvailableScopes(config)
1661
+ #### FD21ToFlatUI(scopes, datasetsInfo)
1594
1662
 
1595
- Gets Scopes/Scope IDs by given IDs
1663
+ Generates a Filter Builder Structure from the Filter Data structure v2.1
1596
1664
 
1597
1665
 
1598
1666
 
@@ -1601,7 +1669,8 @@ Gets Scopes/Scope IDs by given IDs
1601
1669
 
1602
1670
  | Name | Type | Description | |
1603
1671
  | ---- | ---- | ----------- | -------- |
1604
- | config | | given Differnts IDs in order set a available scope | &nbsp; |
1672
+ | scopes | | The filter scope section | &nbsp; |
1673
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
1605
1674
 
1606
1675
 
1607
1676
 
@@ -1609,17 +1678,17 @@ Gets Scopes/Scope IDs by given IDs
1609
1678
  ##### Returns
1610
1679
 
1611
1680
 
1612
- - a Scopes/Scope IDs array
1681
+ - a flattened UI filters array
1613
1682
 
1614
1683
 
1615
1684
 
1616
1685
 
1617
- ### dist/filters/helpers/getAvailableScopesIDsByConfig.js
1686
+ ### dist/filters/adapters/FDToLogic.js
1618
1687
 
1619
1688
 
1620
- #### getAvailableScopesIDsByConfig(config)
1689
+ #### FDToLogic(filterData)
1621
1690
 
1622
- Gets the Scopes IDS for the Available Scope function by any config
1691
+ Generates a Filter Logic structure from Filter Data structure.
1623
1692
 
1624
1693
 
1625
1694
 
@@ -1628,7 +1697,7 @@ Gets the Scopes IDS for the Available Scope function by any config
1628
1697
 
1629
1698
  | Name | Type | Description | |
1630
1699
  | ---- | ---- | ----------- | -------- |
1631
- | config | | any config | &nbsp; |
1700
+ | filterData | | The filter data object. | &nbsp; |
1632
1701
 
1633
1702
 
1634
1703
 
@@ -1636,17 +1705,40 @@ Gets the Scopes IDS for the Available Scope function by any config
1636
1705
  ##### Returns
1637
1706
 
1638
1707
 
1639
- - a Available Scope IDS config
1708
+ - a filter logic array
1709
+
1640
1710
 
1641
1711
 
1712
+ #### getLogicBodyFromFD21(filterData)
1642
1713
 
1714
+ Gets the logic body
1643
1715
 
1644
- ### dist/filters/helpers/getScopesByHierarchy.js
1645
1716
 
1646
1717
 
1647
- #### getScopesByHierarchy(scopes, currentScope)
1648
1718
 
1649
- [TODO: Make a description for this]
1719
+ ##### Parameters
1720
+
1721
+ | Name | Type | Description | |
1722
+ | ---- | ---- | ----------- | -------- |
1723
+ | filterData | | The filter data object | &nbsp; |
1724
+
1725
+
1726
+
1727
+
1728
+ ##### Returns
1729
+
1730
+
1731
+ - a filter logic array
1732
+
1733
+
1734
+
1735
+
1736
+ ### dist/filters/adapters/FDToUI.js
1737
+
1738
+
1739
+ #### FDToUI(filterData, datasetsInfo)
1740
+
1741
+ Generates a UI filter structure from Filter Data structure.
1650
1742
 
1651
1743
 
1652
1744
 
@@ -1655,8 +1747,8 @@ Gets the Scopes IDS for the Available Scope function by any config
1655
1747
 
1656
1748
  | Name | Type | Description | |
1657
1749
  | ---- | ---- | ----------- | -------- |
1658
- | scopes | | the collection of Scopes/Scope IDs | &nbsp; |
1659
- | currentScope | | Current scope type | &nbsp; |
1750
+ | filterData | | The filter data object. | &nbsp; |
1751
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
1660
1752
 
1661
1753
 
1662
1754
 
@@ -1664,17 +1756,43 @@ Gets the Scopes IDS for the Available Scope function by any config
1664
1756
  ##### Returns
1665
1757
 
1666
1758
 
1667
- - A new array of Scopes/Scope IDs
1759
+ - a UI Filters structure
1668
1760
 
1669
1761
 
1670
1762
 
1763
+ #### FD21ToUI(scopes, section, version, datasetsInfo)
1671
1764
 
1672
- ### dist/general/array/delete.js
1765
+ Generates a UI filter Structure from the Filter Data structure v2.1
1673
1766
 
1674
1767
 
1675
- #### ArrayDelete(array, index)
1676
1768
 
1677
- Inmutable Array Item deletion
1769
+
1770
+ ##### Parameters
1771
+
1772
+ | Name | Type | Description | |
1773
+ | ---- | ---- | ----------- | -------- |
1774
+ | scopes | | The filter scope section | &nbsp; |
1775
+ | section | | The filter section. | &nbsp; |
1776
+ | version | | The version of the filter structure | &nbsp; |
1777
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
1778
+
1779
+
1780
+
1781
+
1782
+ ##### Returns
1783
+
1784
+
1785
+ - a UI filter Structure
1786
+
1787
+
1788
+
1789
+
1790
+ ### dist/filters/adapters/UIToFD.js
1791
+
1792
+
1793
+ #### UIToFD(filterData)
1794
+
1795
+ Generates a Filter Data Structure structure from UI Filter Data structure.
1678
1796
 
1679
1797
 
1680
1798
 
@@ -1683,8 +1801,7 @@ Inmutable Array Item deletion
1683
1801
 
1684
1802
  | Name | Type | Description | |
1685
1803
  | ---- | ---- | ----------- | -------- |
1686
- | array | `Array` | a collection of items to delete | &nbsp; |
1687
- | index | `Number` | the position of the item to delete | &nbsp; |
1804
+ | filterData | | The UI filter data object. | &nbsp; |
1688
1805
 
1689
1806
 
1690
1807
 
@@ -1692,20 +1809,41 @@ Inmutable Array Item deletion
1692
1809
  ##### Returns
1693
1810
 
1694
1811
 
1695
- - a new Array or the given parameter when is empty or not an array
1812
+ - a Filter Data structure
1696
1813
 
1697
1814
 
1698
1815
 
1816
+ #### UI21ToFD(uFilterData, version)
1699
1817
 
1700
- ### dist/general/array/filterNestedTree.js
1818
+ Builds the Fitler Data structure from UI filter data
1701
1819
 
1702
1820
 
1703
- #### filterNestedTree(arr, childArrKey, condition)
1704
1821
 
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
1822
+
1823
+ ##### Parameters
1824
+
1825
+ | Name | Type | Description | |
1826
+ | ---- | ---- | ----------- | -------- |
1827
+ | uFilterData | | The UI filter Data object | &nbsp; |
1828
+ | version | | the version of the structure | &nbsp; |
1829
+
1830
+
1831
+
1832
+
1833
+ ##### Returns
1834
+
1835
+
1836
+ -
1837
+
1838
+
1839
+
1840
+
1841
+ ### dist/filters/adapters/UIToFlatUI.js
1842
+
1843
+
1844
+ #### UIToFlatUI(filterData, datasetsInfo)
1845
+
1846
+ Generates a Flattened UI filter structure from UI Filter Data structure.
1709
1847
 
1710
1848
 
1711
1849
 
@@ -1714,9 +1852,8 @@ Filters a nested tree array by a custom condition on the last child node
1714
1852
 
1715
1853
  | Name | Type | Description | |
1716
1854
  | ---- | ---- | ----------- | -------- |
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; |
1855
+ | filterData | | The UI filter data object. | &nbsp; |
1856
+ | datasetsInfo | | Collection of datasets information. Optional for updating the datasets info | &nbsp; |
1720
1857
 
1721
1858
 
1722
1859
 
@@ -1724,17 +1861,41 @@ Filters a nested tree array by a custom condition on the last child node
1724
1861
  ##### Returns
1725
1862
 
1726
1863
 
1727
- - array filtered
1864
+ - a flattened UI filters array
1728
1865
 
1729
1866
 
1730
1867
 
1868
+ #### UI21ToFlatUI(scopes)
1731
1869
 
1732
- ### dist/general/array/flattenDeep.js
1870
+ Generates a Flattened UI Filter Structure from the UI Filter Data structure v2.1
1733
1871
 
1734
1872
 
1735
- #### flattenDeep(arr)
1736
1873
 
1737
- Flat deeply an array
1874
+
1875
+ ##### Parameters
1876
+
1877
+ | Name | Type | Description | |
1878
+ | ---- | ---- | ----------- | -------- |
1879
+ | scopes | | The filter scope section | &nbsp; |
1880
+
1881
+
1882
+
1883
+
1884
+ ##### Returns
1885
+
1886
+
1887
+ - a flattened UI filters array
1888
+
1889
+
1890
+
1891
+
1892
+ ### dist/filters/adapters/adaptDateGroupingProperty.js
1893
+
1894
+
1895
+ #### adaptDateGroupingProperty(property)
1896
+
1897
+ [TODO: For 2022, eliminate this adapter]
1898
+ Get the new property base on the old date grouping properties
1738
1899
 
1739
1900
 
1740
1901
 
@@ -1743,7 +1904,7 @@ Flat deeply an array
1743
1904
 
1744
1905
  | Name | Type | Description | |
1745
1906
  | ---- | ---- | ----------- | -------- |
1746
- | arr | | Array to flat deeply | &nbsp; |
1907
+ | property | | | &nbsp; |
1747
1908
 
1748
1909
 
1749
1910
 
@@ -1751,17 +1912,17 @@ Flat deeply an array
1751
1912
  ##### Returns
1752
1913
 
1753
1914
 
1754
- - flatten array
1915
+ -
1755
1916
 
1756
1917
 
1757
1918
 
1758
1919
 
1759
- ### dist/general/array/getFirstIndexFromArray.js
1920
+ ### dist/filters/adapters/adaptFilterData.js
1760
1921
 
1761
1922
 
1762
- #### getFirstIndexFromArray(array, callback)
1923
+ #### adaptFilterData(filterData, getUIFilterData, datasetsInfo)
1763
1924
 
1764
- Gets the first index from the array by a callback condition
1925
+ Checks and adapts the v2.0 Filter Data Structure to the v2.1
1765
1926
 
1766
1927
 
1767
1928
 
@@ -1770,8 +1931,9 @@ Gets the first index from the array by a callback condition
1770
1931
 
1771
1932
  | Name | Type | Description | |
1772
1933
  | ---- | ---- | ----------- | -------- |
1773
- | array | | | &nbsp; |
1774
- | callback | | function callback | &nbsp; |
1934
+ | filterData | | The filter data structure. Accepts both v2.1 or v2.0 | &nbsp; |
1935
+ | getUIFilterData | | Flag to get a Filter Data (False) or the UI Filter Data (True) | &nbsp; |
1936
+ | datasetsInfo | | Collection of datasets information. If getUIFilterData is true, the datasetsInfo should be mandatory | &nbsp; |
1775
1937
 
1776
1938
 
1777
1939
 
@@ -1779,17 +1941,18 @@ Gets the first index from the array by a callback condition
1779
1941
  ##### Returns
1780
1942
 
1781
1943
 
1782
- - the first index of the array. -1 when the condition is not satisfied
1944
+ - A new filter data structure v2.1
1783
1945
 
1784
1946
 
1785
1947
 
1786
1948
 
1787
- ### dist/general/array/getLastIndexFromArray.js
1949
+ ### dist/filters/adapters/adaptFilterValues.js
1788
1950
 
1789
1951
 
1790
- #### getLastIndexFromArray(array, callback)
1952
+ #### adaptFilterValues(filter)
1791
1953
 
1792
- Gets the last index from the array by a callback condition
1954
+ [TODO: For 2022, eliminate this adapter]
1955
+ Gets an adapted filter value array. Validates the enabled property and sets
1793
1956
 
1794
1957
 
1795
1958
 
@@ -1798,8 +1961,7 @@ Gets the last index from the array by a callback condition
1798
1961
 
1799
1962
  | Name | Type | Description | |
1800
1963
  | ---- | ---- | ----------- | -------- |
1801
- | array | | | &nbsp; |
1802
- | callback | | function callback | &nbsp; |
1964
+ | filter | | The filter | &nbsp; |
1803
1965
 
1804
1966
 
1805
1967
 
@@ -1807,17 +1969,17 @@ Gets the last index from the array by a callback condition
1807
1969
  ##### Returns
1808
1970
 
1809
1971
 
1810
- - the last index of the array. -1 when the condition is not satisfied
1972
+ - A new value array with the filled properties.
1811
1973
 
1812
1974
 
1813
1975
 
1814
1976
 
1815
- ### dist/general/function/debounce.js
1977
+ ### dist/filters/adapters/flatUIToFD.js
1816
1978
 
1817
1979
 
1818
- #### debounce(fn, time)
1980
+ #### flatUIToFD(uFilters, version)
1819
1981
 
1820
- Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last time the debounced function was invoked.
1982
+ Generates a filter data structure from the flatttened UI filters.
1821
1983
 
1822
1984
 
1823
1985
 
@@ -1826,8 +1988,8 @@ Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last
1826
1988
 
1827
1989
  | Name | Type | Description | |
1828
1990
  | ---- | ---- | ----------- | -------- |
1829
- | fn | `Function` | original Function | &nbsp; |
1830
- | time | `Number` | default 500ms | &nbsp; |
1991
+ | uFilters | | Array of flattened filters from UI | &nbsp; |
1992
+ | version | | Tag for the version of the filter data structure | &nbsp; |
1831
1993
 
1832
1994
 
1833
1995
 
@@ -1835,17 +1997,37 @@ Delays invoking _fn_ until after _time_ milliseconds have elapsed since the last
1835
1997
  ##### Returns
1836
1998
 
1837
1999
 
1838
- - `Function` debounced functions
2000
+ - a Filter Data.
2001
+
2002
+
2003
+
2004
+ #### buildScopes(fbFilters)
2005
+
2006
+ Gets an array of scopes structure for the filter data. The scopes is organized by scope types and scope IDs
2007
+ Also, adds and organizes filters by datasets
1839
2008
 
1840
2009
 
1841
2010
 
1842
2011
 
1843
- ### dist/general/function/throttled.js
2012
+ ##### Parameters
2013
+
2014
+ | Name | Type | Description | |
2015
+ | ---- | ---- | ----------- | -------- |
2016
+ | fbFilters | | Array of flat filters from UI | &nbsp; |
2017
+
2018
+
2019
+
2020
+
2021
+ ##### Returns
2022
+
2023
+
2024
+ - an array of scopes structure.
2025
+
1844
2026
 
1845
2027
 
1846
- #### throttled(fn, time)
2028
+ #### buildScope(uFilter)
1847
2029
 
1848
- Make sure to only invokes _fn_ at most once per every _time_ milliseconds
2030
+ Gets an scope structure for the filter data
1849
2031
 
1850
2032
 
1851
2033
 
@@ -1854,8 +2036,7 @@ Make sure to only invokes _fn_ at most once per every _time_ milliseconds
1854
2036
 
1855
2037
  | Name | Type | Description | |
1856
2038
  | ---- | ---- | ----------- | -------- |
1857
- | fn | `Function` | original Function | &nbsp; |
1858
- | time | `Number` | default 500ms | &nbsp; |
2039
+ | uFilter | | UI structure filter | &nbsp; |
1859
2040
 
1860
2041
 
1861
2042
 
@@ -1863,18 +2044,13 @@ Make sure to only invokes _fn_ at most once per every _time_ milliseconds
1863
2044
  ##### Returns
1864
2045
 
1865
2046
 
1866
- - `Function` throttled function
1867
-
1868
-
1869
-
2047
+ - an scope structure
1870
2048
 
1871
- ### dist/general/mix/compareDeep.js
1872
2049
 
1873
2050
 
1874
- #### compareDeep(object1, object2)
2051
+ #### buildDataset(uFilter)
1875
2052
 
1876
- Compares two objects to know if they are equals. Go across nested objects.
1877
- Includes arrays in the comparison.
2053
+ Gets an dataset structure for the filter data
1878
2054
 
1879
2055
 
1880
2056
 
@@ -1883,8 +2059,7 @@ Includes arrays in the comparison.
1883
2059
 
1884
2060
  | Name | Type | Description | |
1885
2061
  | ---- | ---- | ----------- | -------- |
1886
- | object1 | | First Object to compare | &nbsp; |
1887
- | object2 | | Second Object to compare | &nbsp; |
2062
+ | uFilter | | a UI structure filter | &nbsp; |
1888
2063
 
1889
2064
 
1890
2065
 
@@ -1892,17 +2067,13 @@ Includes arrays in the comparison.
1892
2067
  ##### Returns
1893
2068
 
1894
2069
 
1895
- - True: objects are equal. False: Objects are not equal. Undefined: invalid
1896
-
1897
-
1898
-
2070
+ - an dataset structure
1899
2071
 
1900
- ### dist/general/mix/getTag.js
1901
2072
 
1902
2073
 
1903
- #### getTag(value)
2074
+ #### buildFilter(uFilter)
1904
2075
 
1905
- Gets the `toStringTag` of `value`.
2076
+ Gets an filter structure for the filter data
1906
2077
 
1907
2078
 
1908
2079
 
@@ -1911,7 +2082,7 @@ Gets the `toStringTag` of `value`.
1911
2082
 
1912
2083
  | Name | Type | Description | |
1913
2084
  | ---- | ---- | ----------- | -------- |
1914
- | value | | The value to query. | &nbsp; |
2085
+ | uFilter | | a UI structure filter | &nbsp; |
1915
2086
 
1916
2087
 
1917
2088
 
@@ -1919,17 +2090,17 @@ Gets the `toStringTag` of `value`.
1919
2090
  ##### Returns
1920
2091
 
1921
2092
 
1922
- - `string` Returns the `toStringTag`.
2093
+ - an filter structure
1923
2094
 
1924
2095
 
1925
2096
 
1926
2097
 
1927
- ### dist/general/mix/importScripts.js
2098
+ ### dist/filters/adapters/flatUIToLogic.js
1928
2099
 
1929
2100
 
1930
- #### importScripts(scripts)
2101
+ #### flatUIToLogic(uFilter)
1931
2102
 
1932
- Import a set of external Scripts given the URL in both serie and cascade way
2103
+ Generates a Logic structure from flattened UI filters
1933
2104
 
1934
2105
 
1935
2106
 
@@ -1938,54 +2109,25 @@ Import a set of external Scripts given the URL in both serie and cascade way
1938
2109
 
1939
2110
  | Name | Type | Description | |
1940
2111
  | ---- | ---- | ----------- | -------- |
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
-
2112
+ | uFilter | | Array of flat filters from UI | &nbsp; |
1950
2113
 
1951
- ##### Examples
1952
2114
 
1953
- ```javascript
1954
- // 1) Simple script (paralell loading)
1955
- importScripts(['http://myscript.js', 'http://another.js']);
1956
2115
 
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
2116
 
1963
- // 3) import dependent scripts (cascade)
1964
- importScripts([
1965
- { url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] }
1966
- ]);
2117
+ ##### Returns
1967
2118
 
1968
- // 4) mix
1969
- importScripts([
1970
- { url: 'http://myscript.js', dependencies: ['http://myscript.plugin.js'] },
1971
- { url: 'http://another.esm.js', type: 'module' },
1972
- { url: 'http://another.js', noModule: true },
1973
- 'http://simplescript.js'
1974
- ]);
1975
- ```
1976
2119
 
2120
+ - The logic structure
1977
2121
 
1978
- ##### Returns
1979
2122
 
1980
2123
 
1981
- - `Promise` Promise when all script have been loaded
1982
2124
 
2125
+ ### dist/filters/adapters/flatUIToOldLogic.js
1983
2126
 
1984
2127
 
1985
- #### loadScript(url, type, noModule)
2128
+ #### flatUIToOldLogic(uFilters)
1986
2129
 
1987
- Creates the script element and appends to document.head
1988
- return a Promise that is resolved when the script is loaded
2130
+ Generates a Logic structure from flattened UI filters
1989
2131
 
1990
2132
 
1991
2133
 
@@ -1994,9 +2136,7 @@ return a Promise that is resolved when the script is loaded
1994
2136
 
1995
2137
  | Name | Type | Description | |
1996
2138
  | ---- | ---- | ----------- | -------- |
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; |
2139
+ | uFilters | | Array of flat filters from UI | &nbsp; |
2000
2140
 
2001
2141
 
2002
2142
 
@@ -2004,17 +2144,17 @@ return a Promise that is resolved when the script is loaded
2004
2144
  ##### Returns
2005
2145
 
2006
2146
 
2007
- - `Void`
2147
+ - The logic structure
2008
2148
 
2009
2149
 
2010
2150
 
2011
2151
 
2012
- ### dist/general/mix/isEmpty.js
2152
+ ### dist/filters/adapters/flatUIToUI.js
2013
2153
 
2014
2154
 
2015
- #### isEmpty(variable, includeFalsy)
2155
+ #### flatUIToUI(uFilters, version)
2016
2156
 
2017
- Validates if the given argument is empty
2157
+ Generates a UI filter data structure from the flatttened UI filters.
2018
2158
 
2019
2159
 
2020
2160
 
@@ -2023,8 +2163,8 @@ Validates if the given argument is empty
2023
2163
 
2024
2164
  | Name | Type | Description | |
2025
2165
  | ---- | ---- | ----------- | -------- |
2026
- | variable | | the given variable | &nbsp; |
2027
- | includeFalsy | | flag to determine include the falsy variables into the validation | &nbsp; |
2166
+ | uFilters | | Array of flattened filters from UI | &nbsp; |
2167
+ | version | | Tag for the version of the filter data structure | &nbsp; |
2028
2168
 
2029
2169
 
2030
2170
 
@@ -2032,19 +2172,14 @@ Validates if the given argument is empty
2032
2172
  ##### Returns
2033
2173
 
2034
2174
 
2035
- - true: the given argument is empty; false: is not.
2036
-
2037
-
2038
-
2175
+ - a UI Filter Data.
2039
2176
 
2040
- ### dist/general/mix/isNaNV2.js
2041
2177
 
2042
2178
 
2043
- #### isNaNV2(variable)
2179
+ #### buildScopes(fbFilters)
2044
2180
 
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.
2181
+ Gets an array of scopes structure for the UI filter data. The scopes is organized by scope types and scope IDs
2182
+ Also, adds and organizes filters by datasets
2048
2183
 
2049
2184
 
2050
2185
 
@@ -2053,7 +2188,7 @@ Validates if variable is null, undefined, or an empty string, also, the function
2053
2188
 
2054
2189
  | Name | Type | Description | |
2055
2190
  | ---- | ---- | ----------- | -------- |
2056
- | variable | | the variable to validate | &nbsp; |
2191
+ | fbFilters | | Array of flat filters from UI | &nbsp; |
2057
2192
 
2058
2193
 
2059
2194
 
@@ -2061,18 +2196,13 @@ Validates if variable is null, undefined, or an empty string, also, the function
2061
2196
  ##### Returns
2062
2197
 
2063
2198
 
2064
- - True if variable is a NaN or false otherwise
2065
-
2066
-
2067
-
2199
+ - an array of scopes structure.
2068
2200
 
2069
- ### dist/general/mix/isNull.js
2070
2201
 
2071
2202
 
2072
- #### isNull(arg)
2203
+ #### buildScope(uFilter)
2073
2204
 
2074
- return if a given variable is either `null` or `undefined`
2075
- useful to avoid falsify validating Number Zero (0)
2205
+ Gets an scope structure for the UI filter data
2076
2206
 
2077
2207
 
2078
2208
 
@@ -2081,7 +2211,7 @@ useful to avoid falsify validating Number Zero (0)
2081
2211
 
2082
2212
  | Name | Type | Description | |
2083
2213
  | ---- | ---- | ----------- | -------- |
2084
- | arg | `any` | | &nbsp; |
2214
+ | uFilter | | UI structure filter | &nbsp; |
2085
2215
 
2086
2216
 
2087
2217
 
@@ -2089,19 +2219,13 @@ useful to avoid falsify validating Number Zero (0)
2089
2219
  ##### Returns
2090
2220
 
2091
2221
 
2092
- - `Boolean`
2093
-
2094
-
2095
-
2222
+ - an scope structure
2096
2223
 
2097
- ### dist/general/mix/randomId.js
2098
2224
 
2099
2225
 
2100
- #### randomId(length, exclude)
2226
+ #### buildDataset(uFilter)
2101
2227
 
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.
2228
+ Gets an dataset structure for the UI filter data
2105
2229
 
2106
2230
 
2107
2231
 
@@ -2110,8 +2234,7 @@ Creates a random string
2110
2234
 
2111
2235
  | Name | Type | Description | |
2112
2236
  | ---- | ---- | ----------- | -------- |
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; |
2237
+ | uFilter | | a UI structure filter | &nbsp; |
2115
2238
 
2116
2239
 
2117
2240
 
@@ -2119,19 +2242,13 @@ Creates a random string
2119
2242
  ##### Returns
2120
2243
 
2121
2244
 
2122
- - `String` Random string
2123
-
2124
-
2125
-
2245
+ - an dataset structure
2126
2246
 
2127
- ### dist/general/mix/size.js
2128
2247
 
2129
2248
 
2130
- #### size(obj)
2249
+ #### buildFilter(uFilter)
2131
2250
 
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.
2251
+ Gets an filter structure for the UI filter data
2135
2252
 
2136
2253
 
2137
2254
 
@@ -2140,7 +2257,7 @@ Gets the length of the given array.
2140
2257
 
2141
2258
  | Name | Type | Description | |
2142
2259
  | ---- | ---- | ----------- | -------- |
2143
- | obj | `Any` | Any object-type variable | &nbsp; |
2260
+ | uFilter | | a UI structure filter | &nbsp; |
2144
2261
 
2145
2262
 
2146
2263
 
@@ -2148,18 +2265,17 @@ Gets the length of the given array.
2148
2265
  ##### Returns
2149
2266
 
2150
2267
 
2151
- - `Number` the size of the given variable
2268
+ - an filter structure
2152
2269
 
2153
2270
 
2154
2271
 
2155
2272
 
2156
- ### dist/general/object/cloneDeep.js
2273
+ ### dist/filters/adapters/logicToFD.js
2157
2274
 
2158
2275
 
2159
- #### cloneDeep(obj)
2276
+ #### logicToFD(filterData, version)
2160
2277
 
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
2278
+ Generates a filter data structure from the old logic structure (v2.0).
2163
2279
 
2164
2280
 
2165
2281
 
@@ -2168,7 +2284,8 @@ Not to use this function with inner objects and functions
2168
2284
 
2169
2285
  | Name | Type | Description | |
2170
2286
  | ---- | ---- | ----------- | -------- |
2171
- | obj | | The object | &nbsp; |
2287
+ | filterData | | The old filter data structure with logic (v2.0) | &nbsp; |
2288
+ | version | | Tag for the version of the filter data structure | &nbsp; |
2172
2289
 
2173
2290
 
2174
2291
 
@@ -2176,21 +2293,17 @@ Not to use this function with inner objects and functions
2176
2293
  ##### Returns
2177
2294
 
2178
2295
 
2179
- - The new reference object or the given object if the parsing is incorrect or empty
2180
-
2296
+ - a Filter Data.
2181
2297
 
2182
2298
 
2183
2299
 
2184
- ### dist/general/object/get.js
2185
2300
 
2301
+ ### dist/filters/adapters/logicToFlatUI.js
2186
2302
 
2187
- #### _get(baseObject, path, defaultValue)
2188
2303
 
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.
2304
+ #### logicToFlatUI(logics)
2191
2305
 
2192
- Empty arrays and empty objects are returned but the defaultValue is not
2193
- Undefined and null values will return the defaultValue.
2306
+ Adapts the Old logic structure (v2.0) to the flattened UI filter Structure.
2194
2307
 
2195
2308
 
2196
2309
 
@@ -2199,59 +2312,21 @@ Undefined and null values will return the defaultValue.
2199
2312
 
2200
2313
  | Name | Type | Description | |
2201
2314
  | ---- | ---- | ----------- | -------- |
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
-
2315
+ | logics | | The old logic structure (v2.0) | &nbsp; |
2208
2316
 
2209
- ##### Examples
2210
2317
 
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
2318
 
2232
2319
 
2233
2320
  ##### Returns
2234
2321
 
2235
2322
 
2236
- - the resolved value.
2237
-
2238
-
2239
-
2323
+ - The Flattened UI Filters array
2240
2324
 
2241
- ### dist/general/object/getAttribute.js
2242
2325
 
2243
2326
 
2244
- #### getAttribute(obj, key)
2327
+ #### getFilter(filters, filter, getIndex)
2245
2328
 
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
2329
+ Get the filter or the index of the given array, validating an old filter structure.
2255
2330
 
2256
2331
 
2257
2332
 
@@ -2260,73 +2335,51 @@ Searchs for properties in different case styles such as: lower, upper, camel and
2260
2335
 
2261
2336
  | Name | Type | Description | |
2262
2337
  | ---- | ---- | ----------- | -------- |
2263
- | obj | `object` | object to look for | &nbsp; |
2264
- | key | `string` | String attribute in snake_case style | &nbsp; |
2265
-
2266
-
2267
-
2338
+ | filters | | The array of UI filters | &nbsp; |
2339
+ | filter | | The old logic structure filter | &nbsp; |
2340
+ | getIndex | | Determines if the index or returns the UI filter object | &nbsp; |
2268
2341
 
2269
- ##### Examples
2270
2342
 
2271
- ```javascript
2272
- getAttribute(obj, 'snake_case') //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
2273
- ```
2274
2343
 
2275
2344
 
2276
2345
  ##### Returns
2277
2346
 
2278
2347
 
2279
- - `Void`
2280
-
2281
-
2282
-
2348
+ - the index or the UI filter object
2283
2349
 
2284
- ### dist/general/object/hasProperty.js
2285
2350
 
2286
2351
 
2287
- #### _hasProperty(obj, property)
2352
+ #### refineRankingValues(values, uiValues)
2288
2353
 
2289
- Use the hasOwnProperty in order to verify if the given property exists in the object.
2354
+ Refines the values of the Ranking column type.
2290
2355
 
2291
2356
 
2292
2357
 
2293
2358
 
2294
2359
  ##### Parameters
2295
2360
 
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
2361
+ | Name | Type | Description | |
2362
+ | ---- | ---- | ----------- | -------- |
2363
+ | values | | the Array of Ranking values | &nbsp; |
2364
+ | uiValues | | Object with additional info about the values of the filter. | &nbsp; |
2305
2365
 
2306
- ```javascript
2307
- const prop = 'prop2'
2308
- const obj1 = { prop1: 'hello', prop2: 'world'}
2309
- _hasProperty(ob1, prop1) // true
2310
2366
 
2311
- const obj2 = { prop1: 'hello world' }
2312
- _hasProperty(ob1, prop2) // false
2313
- ```
2314
2367
 
2315
2368
 
2316
2369
  ##### Returns
2317
2370
 
2318
2371
 
2319
- - True if the object has the given property; otherwise, false.
2372
+ - the array of Ranking values
2320
2373
 
2321
2374
 
2322
2375
 
2323
2376
 
2324
- ### dist/general/object/isObject.js
2377
+ ### dist/filters/adapters/logicToUI.js
2325
2378
 
2326
2379
 
2327
- #### isObject(obj)
2380
+ #### logicToUI(uFilters, datasetsInfo)
2328
2381
 
2329
- Checks if the given argument is an object type
2382
+ Generates a UI filter structure from the old logic structure (v2.0).
2330
2383
 
2331
2384
 
2332
2385
 
@@ -2335,7 +2388,8 @@ Checks if the given argument is an object type
2335
2388
 
2336
2389
  | Name | Type | Description | |
2337
2390
  | ---- | ---- | ----------- | -------- |
2338
- | obj | | the variable to check | &nbsp; |
2391
+ | uFilters | | Array of filters from old logic structure | &nbsp; |
2392
+ | datasetsInfo | | Collection of datasets information | &nbsp; |
2339
2393
 
2340
2394
 
2341
2395
 
@@ -2343,18 +2397,17 @@ Checks if the given argument is an object type
2343
2397
  ##### Returns
2344
2398
 
2345
2399
 
2346
- - True: It is an object; False: It is not.
2400
+ - a UI Filter Data.
2347
2401
 
2348
2402
 
2349
2403
 
2350
2404
 
2351
- ### dist/general/object/mapValues.js
2405
+ ### dist/filters/adapters/transformFilters.js
2352
2406
 
2353
2407
 
2354
- #### mapValues(baseObject, iteratee)
2408
+ #### transformFilters(oldFiltersObj, section)
2355
2409
 
2356
- Invoke iteratee (function) for each object key-value pair
2357
- and return a mapped object
2410
+ Transform the old filters structure into the new one
2358
2411
 
2359
2412
 
2360
2413
 
@@ -2363,27 +2416,77 @@ and return a mapped object
2363
2416
 
2364
2417
  | Name | Type | Description | |
2365
2418
  | ---- | ---- | ----------- | -------- |
2366
- | baseObject | `Object` | Base object. | &nbsp; |
2367
- | iteratee | `Function` | The executed per iteration. | &nbsp; |
2419
+ | oldFiltersObj | `Object` | an object with the old filters structure | &nbsp; |
2420
+ | section | `String` | could be 'ANALYZE', 'PB', 'UM' or any other value. Deafult is 'ANYWHERE' | &nbsp; |
2421
+
2422
+
2423
+
2424
+
2425
+ ##### Examples
2426
+
2427
+ ```javascript
2368
2428
 
2429
+ const oldPreferenceFilters = {
2430
+ "WWXHAULtR-_-xYOQAdpqT__ENABLED": true,
2431
+ "WWXHAULtR-_-xYOQAdpqT__ALL--ENABLED": true,
2432
+ "WWXHAULtR-_-xYOQAdpqT__COLLAPSED": false,
2433
+ "WWXHAULtR-_-xYOQAdpqT__LABEL": "GLOBAL",
2434
+ "WWXHAULtR-_-xYOQAdpqT-_-AK4M8UV2": {
2435
+ "formulaId": null,
2436
+ "panelId": null,
2437
+ "values": [
2438
+ {
2439
+ "EQUALS": [
2440
+ {
2441
+ "id": "AK4M8UV2a0",
2442
+ "value": "A",
2443
+ "enabled": true,
2444
+ "imageUrl": null
2445
+ },
2446
+ {
2447
+ "id": "AK4M8UV2a1",
2448
+ "value": "B",
2449
+ "enabled": true,
2450
+ "imageUrl": null
2451
+ }
2452
+ ]
2453
+ }
2454
+ ],
2455
+ "bucketId": null,
2456
+ "text": "MC",
2457
+ "title": "MC",
2458
+ "type": "SINGLE_CHOICE",
2459
+ "qid": "AK4M8UV2",
2460
+ "dataset": {
2461
+ "sourceid": "xYOQAdpqT",
2462
+ "name": "Form All Questions",
2463
+ "qrveyid": "xYOQAdpqT",
2464
+ "text": "Form All Questions",
2465
+ "linkid": 0
2466
+ },
2467
+ "enabled": true,
2468
+ "linked": null
2469
+ }
2470
+ };
2369
2471
 
2472
+ const filterData = transformFilters(oldPreferenceFilters, 'ANALYZE');
2473
+ ```
2370
2474
 
2371
2475
 
2372
2476
  ##### Returns
2373
2477
 
2374
2478
 
2375
- - `Object` New mapped object.
2479
+ - `Object` an object with the new filters structure
2376
2480
 
2377
2481
 
2378
2482
 
2379
2483
 
2380
- ### dist/general/object/mergeDeep.js
2484
+ ### dist/filters/helpers/applyHierarchyForAggFilters.js
2381
2485
 
2382
2486
 
2383
- #### mergeDeep(obj1, obj2, settings)
2487
+ #### applyHierarchyForAggFilters(chartSettings, scopes, currentScope)
2384
2488
 
2385
- Merges two objects into a new one.
2386
- The second given argument to the first given argument.
2489
+ [TODO: Make a proper description for this function]
2387
2490
 
2388
2491
 
2389
2492
 
@@ -2392,9 +2495,9 @@ The second given argument to the first given argument.
2392
2495
 
2393
2496
  | Name | Type | Description | |
2394
2497
  | ---- | ---- | ----------- | -------- |
2395
- | obj1 | | The target object | &nbsp; |
2396
- | obj2 | | The object to be merged | &nbsp; |
2397
- | settings | | Object settings for this function | &nbsp; |
2498
+ | chartSettings | | Chart Settings for the Filter Builder | &nbsp; |
2499
+ | scopes | | | &nbsp; |
2500
+ | currentScope | | | &nbsp; |
2398
2501
 
2399
2502
 
2400
2503
 
@@ -2402,13 +2505,17 @@ The second given argument to the first given argument.
2402
2505
  ##### Returns
2403
2506
 
2404
2507
 
2405
- - a new merged object
2508
+ -
2406
2509
 
2407
2510
 
2408
2511
 
2409
- #### isValid(obj1, obj2)
2410
2512
 
2411
- Validates if the two arguments are objects
2513
+ ### dist/filters/helpers/getAvailableScopes.js
2514
+
2515
+
2516
+ #### getAvailableScopes(config)
2517
+
2518
+ Gets Scopes/Scope IDs by given IDs
2412
2519
 
2413
2520
 
2414
2521
 
@@ -2417,8 +2524,7 @@ Validates if the two arguments are objects
2417
2524
 
2418
2525
  | Name | Type | Description | |
2419
2526
  | ---- | ---- | ----------- | -------- |
2420
- | obj1 | | The target object | &nbsp; |
2421
- | obj2 | | The object to be merged | &nbsp; |
2527
+ | config | | given Differnts IDs in order set a available scope | &nbsp; |
2422
2528
 
2423
2529
 
2424
2530
 
@@ -2426,13 +2532,17 @@ Validates if the two arguments are objects
2426
2532
  ##### Returns
2427
2533
 
2428
2534
 
2429
- - true: they are valid; false: they are not
2535
+ - a Scopes/Scope IDs array
2430
2536
 
2431
2537
 
2432
2538
 
2433
- #### getParamsToMergeDeep(settings)
2434
2539
 
2435
- Validates and gets the settings with all set parameters.
2540
+ ### dist/filters/helpers/getAvailableScopesIDsByConfig.js
2541
+
2542
+
2543
+ #### getAvailableScopesIDsByConfig(config)
2544
+
2545
+ Gets the Scopes IDS for the Available Scope function by any config
2436
2546
 
2437
2547
 
2438
2548
 
@@ -2441,7 +2551,7 @@ Validates and gets the settings with all set parameters.
2441
2551
 
2442
2552
  | Name | Type | Description | |
2443
2553
  | ---- | ---- | ----------- | -------- |
2444
- | settings | | the settings object | &nbsp; |
2554
+ | config | | any config | &nbsp; |
2445
2555
 
2446
2556
 
2447
2557
 
@@ -2449,17 +2559,17 @@ Validates and gets the settings with all set parameters.
2449
2559
  ##### Returns
2450
2560
 
2451
2561
 
2452
- - a new settings object with all set parameters.
2562
+ - a Available Scope IDS config
2453
2563
 
2454
2564
 
2455
2565
 
2456
2566
 
2457
- ### dist/general/object/objectCopy.js
2567
+ ### dist/filters/helpers/getScopesByHierarchy.js
2458
2568
 
2459
2569
 
2460
- #### objectCopy(entity, cache)
2570
+ #### getScopesByHierarchy(scopes, currentScope)
2461
2571
 
2462
- Created a new reference of the given argument
2572
+ [TODO: Make a description for this]
2463
2573
 
2464
2574
 
2465
2575
 
@@ -2468,8 +2578,8 @@ Created a new reference of the given argument
2468
2578
 
2469
2579
  | Name | Type | Description | |
2470
2580
  | ---- | ---- | ----------- | -------- |
2471
- | entity | | The variable to be copied | &nbsp; |
2472
- | cache | | | &nbsp; |
2581
+ | scopes | | the collection of Scopes/Scope IDs | &nbsp; |
2582
+ | currentScope | | Current scope type | &nbsp; |
2473
2583
 
2474
2584
 
2475
2585
 
@@ -2477,17 +2587,17 @@ Created a new reference of the given argument
2477
2587
  ##### Returns
2478
2588
 
2479
2589
 
2480
- - A new reference of the given argument
2590
+ - A new array of Scopes/Scope IDs
2481
2591
 
2482
2592
 
2483
2593
 
2484
2594
 
2485
- ### dist/general/object/omit.js
2595
+ ### dist/qrvey/helpers/getColumnsLabel.js
2486
2596
 
2487
2597
 
2488
- #### omit(obj, props)
2598
+ #### getColumnLabels(column)
2489
2599
 
2490
- return a new Object excluding attributes in _props_ list
2600
+ Get an string of the properties of the given column.
2491
2601
 
2492
2602
 
2493
2603
 
@@ -2496,8 +2606,7 @@ return a new Object excluding attributes in _props_ list
2496
2606
 
2497
2607
  | Name | Type | Description | |
2498
2608
  | ---- | ---- | ----------- | -------- |
2499
- | obj | `Object` | base object | &nbsp; |
2500
- | props | `Array.<String>` | list of attribute to exclude | &nbsp; |
2609
+ | column | | The column | &nbsp; |
2501
2610
 
2502
2611
 
2503
2612
 
@@ -2505,17 +2614,18 @@ return a new Object excluding attributes in _props_ list
2505
2614
  ##### Returns
2506
2615
 
2507
2616
 
2508
- - `Object` clean object
2617
+ - an string with the property, aggregate or calculation label.
2509
2618
 
2510
2619
 
2511
2620
 
2512
2621
 
2513
- ### dist/general/object/pick.js
2622
+ ### dist/qrvey/helpers/getValueWithSuffixes.js
2514
2623
 
2515
2624
 
2516
- #### pick(baseObject, keys)
2625
+ #### getValueWithSuffixes(value, suffixes)
2517
2626
 
2518
- return a new object just with attributes in _keys_ list
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,8 +2634,8 @@ return a new object just with attributes in _keys_ list
2524
2634
 
2525
2635
  | Name | Type | Description | |
2526
2636
  | ---- | ---- | ----------- | -------- |
2527
- | baseObject | `Object` | base object | &nbsp; |
2528
- | keys | `Array.<String>` | list of attributes to preserve | &nbsp; |
2637
+ | value | | a number or string | &nbsp; |
2638
+ | suffixes | | An object with singular or plural suffix string. | &nbsp; |
2529
2639
 
2530
2640
 
2531
2641
 
@@ -2533,17 +2643,17 @@ return a new object just with attributes in _keys_ list
2533
2643
  ##### Returns
2534
2644
 
2535
2645
 
2536
- - `Object` new object just with desired attributes
2646
+ - a string value with suffix
2537
2647
 
2538
2648
 
2539
2649
 
2540
2650
 
2541
- ### dist/general/object/serialize.js
2651
+ ### dist/qrvey/helpers/transformValue.js
2542
2652
 
2543
2653
 
2544
- #### serialize(obj)
2654
+ #### transformValue(value, settings)
2545
2655
 
2546
- serialize object to url param
2656
+ Transforms a value depending of localization/globalization and extras settings.
2547
2657
 
2548
2658
 
2549
2659
 
@@ -2552,7 +2662,8 @@ serialize object to url param
2552
2662
 
2553
2663
  | Name | Type | Description | |
2554
2664
  | ---- | ---- | ----------- | -------- |
2555
- | obj | | - Object to be serialized | &nbsp; |
2665
+ | value | | A value to transform | &nbsp; |
2666
+ | settings | | The settings of the transformValue function | &nbsp; |
2556
2667
 
2557
2668
 
2558
2669
 
@@ -2560,17 +2671,13 @@ serialize object to url param
2560
2671
  ##### Returns
2561
2672
 
2562
2673
 
2563
- - `Void`
2564
-
2565
-
2566
-
2674
+ - A transformed value
2567
2675
 
2568
- ### dist/general/string/capitalize.js
2569
2676
 
2570
2677
 
2571
- #### capitalize(text)
2678
+ #### getOutputFormat(settings)
2572
2679
 
2573
- Upper case the first letter of a given text
2680
+ Gets the outputformat settings
2574
2681
 
2575
2682
 
2576
2683
 
@@ -2579,7 +2686,7 @@ Upper case the first letter of a given text
2579
2686
 
2580
2687
  | Name | Type | Description | |
2581
2688
  | ---- | ---- | ----------- | -------- |
2582
- | text | `String` | | &nbsp; |
2689
+ | settings | | The settings of the transformValue function | &nbsp; |
2583
2690
 
2584
2691
 
2585
2692
 
@@ -2587,17 +2694,13 @@ Upper case the first letter of a given text
2587
2694
  ##### Returns
2588
2695
 
2589
2696
 
2590
- - `String` a capitalized text
2591
-
2592
-
2593
-
2697
+ - the outputformat settings
2594
2698
 
2595
- ### dist/qrvey/helpers/getColumnsLabel.js
2596
2699
 
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,7 +2717,7 @@ 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
 
@@ -2622,7 +2725,7 @@ Get an string of the properties of the given column.
2622
2725
  ### dist/services/api/getAllDatasets.api.js
2623
2726
 
2624
2727
 
2625
- #### getAllDatasets(qrveyids)
2728
+ #### getAllDatasets(config, pickDatasets)
2626
2729
 
2627
2730
  Get a dataset list from a collection of Qrvey IDs
2628
2731
 
@@ -2633,7 +2736,8 @@ Get a dataset list from a collection of Qrvey IDs
2633
2736
 
2634
2737
  | Name | Type | Description | |
2635
2738
  | ---- | ---- | ----------- | -------- |
2636
- | qrveyids | | Collection of Qrvey IDs | &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; |
2637
2741
 
2638
2742
 
2639
2743
 
@@ -2785,12 +2889,12 @@ try to find this string as a variable on Windows object
2785
2889
 
2786
2890
 
2787
2891
 
2788
- ### dist/typescript/decorators/Throttled.js
2892
+ ### dist/typescript/decorators/Debounce.js
2789
2893
 
2790
2894
 
2791
- #### Throttled(time)
2895
+ #### Debounce(time)
2792
2896
 
2793
- (Method Decorator) Throttled Class Method
2897
+ (Method Decorator) Debounce Class Method
2794
2898
 
2795
2899
 
2796
2900
 
@@ -2812,12 +2916,12 @@ try to find this string as a variable on Windows object
2812
2916
 
2813
2917
 
2814
2918
 
2815
- ### dist/typescript/decorators/Debounce.js
2919
+ ### dist/typescript/decorators/Throttled.js
2816
2920
 
2817
2921
 
2818
- #### Debounce(time)
2922
+ #### Throttled(time)
2819
2923
 
2820
- (Method Decorator) Debounce Class Method
2924
+ (Method Decorator) Throttled Class Method
2821
2925
 
2822
2926
 
2823
2927
 
@@ -3604,12 +3708,12 @@ Get a new Filter Data by filtering scopes/scope IDs and enabled flags
3604
3708
 
3605
3709
 
3606
3710
 
3607
- ### dist/filters/helpers/common/getParamsToGetFilterSettings.js
3711
+ ### dist/filters/helpers/common/getMergeFiltersSettings.js
3608
3712
 
3609
3713
 
3610
- #### getParamsToGetFilterSettings(settings)
3714
+ #### getMergeFiltersSettings(settings)
3611
3715
 
3612
- Transforms the given ParamsToGetFilter settings object. Adds the missing properties if they do not exist.
3716
+ Transforms the given MergeFilters settings object. Adds the missing properties if they do not exist.
3613
3717
 
3614
3718
 
3615
3719
 
@@ -3618,7 +3722,7 @@ Transforms the given ParamsToGetFilter settings object. Adds the missing propert
3618
3722
 
3619
3723
  | Name | Type | Description | |
3620
3724
  | ---- | ---- | ----------- | -------- |
3621
- | settings | | an object to the ParamsToGetFilter settings | &nbsp; |
3725
+ | settings | | an object to the MergeFilters settings | &nbsp; |
3622
3726
 
3623
3727
 
3624
3728
 
@@ -3626,17 +3730,17 @@ Transforms the given ParamsToGetFilter settings object. Adds the missing propert
3626
3730
  ##### Returns
3627
3731
 
3628
3732
 
3629
- - a new ParamsToGetFilter settings object.
3733
+ - a new MergeFilters settings object.
3630
3734
 
3631
3735
 
3632
3736
 
3633
3737
 
3634
- ### dist/filters/helpers/common/getMergeFiltersSettings.js
3738
+ ### dist/filters/helpers/common/getParamsToGetFilterSettings.js
3635
3739
 
3636
3740
 
3637
- #### getMergeFiltersSettings(settings)
3741
+ #### getParamsToGetFilterSettings(settings)
3638
3742
 
3639
- Transforms the given MergeFilters settings object. Adds the missing properties if they do not exist.
3743
+ Transforms the given ParamsToGetFilter settings object. Adds the missing properties if they do not exist.
3640
3744
 
3641
3745
 
3642
3746
 
@@ -3645,7 +3749,7 @@ Transforms the given MergeFilters settings object. Adds the missing properties i
3645
3749
 
3646
3750
  | Name | Type | Description | |
3647
3751
  | ---- | ---- | ----------- | -------- |
3648
- | settings | | an object to the MergeFilters settings | &nbsp; |
3752
+ | settings | | an object to the ParamsToGetFilter settings | &nbsp; |
3649
3753
 
3650
3754
 
3651
3755
 
@@ -3653,7 +3757,7 @@ Transforms the given MergeFilters settings object. Adds the missing properties i
3653
3757
  ##### Returns
3654
3758
 
3655
3759
 
3656
- - a new MergeFilters settings object.
3760
+ - a new ParamsToGetFilter settings object.
3657
3761
 
3658
3762
 
3659
3763
 
@@ -4178,6 +4282,34 @@ Gets output format object from Datasets by the given column. Item of the dataset
4178
4282
 
4179
4283
 
4180
4284
 
4285
+ ### dist/filters/helpers/ui/getQrveyIdsByUIFilters.js
4286
+
4287
+
4288
+ #### getQrveyIdsByUIFilters(uiFilter)
4289
+
4290
+ Gets a collection of Qrvey IDs in the UI Filter structure.
4291
+ Looks around all filter structure finding the qrveyid propertty in each dataset
4292
+
4293
+
4294
+
4295
+
4296
+ ##### Parameters
4297
+
4298
+ | Name | Type | Description | |
4299
+ | ---- | ---- | ----------- | -------- |
4300
+ | uiFilter | | | &nbsp; |
4301
+
4302
+
4303
+
4304
+
4305
+ ##### Returns
4306
+
4307
+
4308
+ - `Void`
4309
+
4310
+
4311
+
4312
+
4181
4313
  ### dist/filters/helpers/ui/getUIFlatFilterByParams.js
4182
4314
 
4183
4315
 
@@ -4292,6 +4424,34 @@ Filters and gets a UI Flatten Filters by the given scopes
4292
4424
 
4293
4425
 
4294
4426
 
4427
+ ### dist/filters/helpers/ui/getUpdatedUIFilters.js
4428
+
4429
+
4430
+ #### getUpdatedUIFilters(data, datasets)
4431
+
4432
+ Gets a new UI Filter structure with a datasets/columns info updates
4433
+
4434
+
4435
+
4436
+
4437
+ ##### Parameters
4438
+
4439
+ | Name | Type | Description | |
4440
+ | ---- | ---- | ----------- | -------- |
4441
+ | data | | The UI Filter structure | &nbsp; |
4442
+ | datasets | | An array of datasets/column info used for updating the data | &nbsp; |
4443
+
4444
+
4445
+
4446
+
4447
+ ##### Returns
4448
+
4449
+
4450
+ - A new UI FIlter structure
4451
+
4452
+
4453
+
4454
+
4295
4455
  ### dist/filters/helpers/ui/resolveUIFlatFiltersByParams.js
4296
4456
 
4297
4457